diff --git a/.index b/.index index db5a0269..ab9d61ed 100644 --- a/.index +++ b/.index @@ -187,7 +187,7 @@ Mi b.md Mi.md Modélisation conceptuelle des BD.md Node JS.md -Norme.md + Notation mathématique traditionnelle.md Noyau d'une application linéaire.md Obsidian.md @@ -209,7 +209,7 @@ Pages unix.md Partitionnement de la mémoire.md Partitionnement fixe (tailles différentes) de la mémoire.md Passport JS unique token authentification.md -Point stationnaire d'une courbe paramétrique.md + Portes logiques.md Présentation jeu de la vie discord.md Program Evaluation Review Technique.md @@ -1632,7 +1632,7 @@ position relative de droites vectorielles.md post queue challenges docstring.md post queue discord science.md post queue docstring.md -post queues.md + postulat de la logique formelle.md pourquoi réduire les énergies fossiles d'abord.md ppcm.md @@ -2155,3 +2155,14 @@ zetetique.md zotero literature notes.md zotero workflow highlights.md zotero workflow.md +distance produit.md +env +exports +idées articles blog.md +identités.md +impression 3D slicer.md +impression 3D.md +listes d'idées.md +norme.md +point stationnaire d'une courbe paramétrique.md +ultimaker cura.md diff --git a/.obsidian/appearance.json b/.obsidian/appearance.json index 4819dad8..5ee7d63f 100644 --- a/.obsidian/appearance.json +++ b/.obsidian/appearance.json @@ -1,7 +1,7 @@ { "theme": "obsidian", "cssTheme": "Minimal", - "baseFontSize": 27, + "baseFontSize": 23, "enabledCssSnippets": [ "pdf_darkmode", "query_header_title", @@ -30,7 +30,17 @@ "Custom Frames - Duotone", "Excalidraw - Compact", "MySnippets", - "Omnisearch" + "Omnisearch", + "omts-MySnippets", + "omts-[ui] Floating Tab Header", + "omts-[ui] Compact Tab Header", + "omts-[ui] Compact Sidebar", + "omts-[editor] Compact Right Sidebar notes", + "omts-Calendar", + "omts-compact_tabs", + "omts-Tasks - Compact", + "omts-Excalidraw - Compact", + "omts-Day Planner (Ivan Lednev)" ], "interfaceFontFamily": "CMU Bright,CMU Sans Serif,FiraCode Nerd Font", "textFontFamily": "CMU Sans Serif,FiraCode Nerd Font,CMU Serif", diff --git a/.obsidian/community-plugins.json b/.obsidian/community-plugins.json index 4d843ee3..13091358 100644 --- a/.obsidian/community-plugins.json +++ b/.obsidian/community-plugins.json @@ -12,5 +12,6 @@ "obsidian-hider", "lazy-plugins", "mysnippets-plugin", + "janitor", "obsidian-custom-frames" ] \ No newline at end of file diff --git a/.obsidian/graph.json b/.obsidian/graph.json index 63c00d52..58c8ea2c 100644 --- a/.obsidian/graph.json +++ b/.obsidian/graph.json @@ -130,6 +130,6 @@ "repelStrength": 6.47786458333333, "linkStrength": 1, "linkDistance": 30, - "scale": 0.12691043529086585, - "close": false + "scale": 0.15827308065586748, + "close": true } \ No newline at end of file diff --git a/.obsidian/plugins/darlal-switcher-plus/main.js b/.obsidian/plugins/darlal-switcher-plus/main.js index 01b2787c..d106a52c 100644 --- a/.obsidian/plugins/darlal-switcher-plus/main.js +++ b/.obsidian/plugins/darlal-switcher-plus/main.js @@ -1,3 +1,3 @@ -"use strict";var e,t,s,i,n=require("obsidian"),a=require("electron");!function(e){e[e.None=0]="None",e[e.Full=1]="Full",e[e.FolderOnly=2]="FolderOnly",e[e.FolderWithFilename=3]="FolderWithFilename",e[e.FolderPathFilenameOptional=4]="FolderPathFilenameOptional"}(e||(e={})),function(e){e[e.Standard=1]="Standard",e[e.EditorList=2]="EditorList",e[e.SymbolList=4]="SymbolList",e[e.WorkspaceList=8]="WorkspaceList",e[e.HeadingsList=16]="HeadingsList",e[e.BookmarksList=32]="BookmarksList",e[e.CommandList=64]="CommandList",e[e.RelatedItemsList=128]="RelatedItemsList",e[e.VaultList=256]="VaultList"}(t||(t={})),function(e){e[e.Link=1]="Link",e[e.Embed=2]="Embed",e[e.Tag=4]="Tag",e[e.Heading=8]="Heading",e[e.Callout=16]="Callout",e[e.CanvasNode=32]="CanvasNode"}(s||(s={})),function(e){e[e.None=0]="None",e[e.Normal=1]="Normal",e[e.Heading=2]="Heading",e[e.Block=4]="Block"}(i||(i={}));const o={};o[s.Link]="🔗",o[s.Embed]="!",o[s.Tag]="#",o[s.Heading]="H";const r={};var l,d,c;function h(e,t,s){let i=!1;return e&&void 0!==e[t]&&(i=!0,void 0!==s&&s!==e[t]&&(i=!1)),i}function m(e){return h(e,"type",l.SymbolList)}function u(e){return h(e,"type",l.HeadingsList)}function g(e){return h(e,"type",l.File)}function p(e){return h(e,"type",l.Alias)}function f(e){return h(e,"type",l.Unresolved)}function y(e){return e&&!(g(t=e)||f(t)||p(t));var t}function b(e){return h(e,"level")}function S(e){return h(e,"type","callout")}function k(e){return h(e,"extension")}function v(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function L(e,t){return e?.internalPlugins?.getEnabledPluginById(t)}function C(e){const t=function(e,t){return e?.internalPlugins?.getPluginById(t)}(e,"switcher");return t?.instance}function w(e){let t=null;if(e){const s=n.normalizePath(e),i=s.lastIndexOf("/");t=-1===i?s:s.slice(i+1)}return t}function I(e){e=e??[];const t=[];for(const s of e)try{const e=new RegExp(s);t.push(e)}catch(e){console.log(`Switcher++: error creating RegExp from string: ${s}`,e)}return e=>{for(const s of t)if(s.test(e))return!0;return!1}}function T(e){let t=i.None;if(e){const s=e.link.split("|")[0];t=s.includes("#^")?i.Block:s.includes("#")?i.Heading:i.Normal}return t}function E(e,t){return t?.getFileByPath(e)}function F(e){let t=null;if(!e)return t;if(e.isDeferred){const s=e.getViewState()?.state?.file;s&&(t=E(s,e.app?.vault))}else e.view?.file&&(t=e.view.file);return t}function A(e,t,s,i,a){let o=null;if(a=Object.assign({useBasenameAsAlias:!0,useHeadingAsAlias:!0},a),s){let r=function(e){let t=null;[l.Alias,l.Bookmark,l.HeadingsList,l.SymbolList,l.RelatedItemsList,l.EditorList,l.File].includes(e.type)&&(t=e.file);return t}(s),d=null,c=null;switch(s.type){case l.Unresolved:o=O(s.linktext);break;case l.Alias:d=s.alias;break;case l.Bookmark:{const{item:e}=s;"file"===e.type&&e.title&&(d=e.title);break}case l.HeadingsList:{const{heading:e}=s.item;({subpath:c,alias:d}=x(e,a.useHeadingAsAlias));break}case l.SymbolList:{const{item:{symbol:l}}=s;if(b(l))({subpath:c,alias:d}=x(l.heading,a.useHeadingAsAlias));else if(h(l,"link")){o=new RegExp(/^\[(.*?)\]\((.+?)\)/).test(l.original)?l.original:function(e,t,s,i,a,o){const{link:r,displayText:l}=i,{path:d,subpath:c}=n.parseLinktext(r);let h=l,m=null,u=null;m=d?.length?E(d,t):a;m?(!h?.length&&o&&(h=m.basename),u=e.generateMarkdownLink(m,s,c,h)):u=O(d,h);return u}(e,t,i,l,r,a.useBasenameAsAlias)}else r=null;break}case l.RelatedItemsList:{const{item:e}=s;e.unresolvedText&&(o=O(e.unresolvedText));break}}r&&!o&&(!d&&a.useBasenameAsAlias&&(d=r.basename),o=e.generateMarkdownLink(r,i,c,d))}return o}function x(e,t){const s=e.replace(/([:#|^\\\r\n]|%%|\[\[|]])/g," ").replace(/\s+/g," ").trim();return{subpath:`#${s}`,alias:t?s:null}}function O(e,t){return`[[${e}${t=t?.length?`|${t}`:""}]]`}r[1]="H₁",r[2]="H₂",r[3]="H₃",r[4]="H₄",r[5]="H₅",r[6]="H₆",function(e){e.EditorList="editorList",e.SymbolList="symbolList",e.WorkspaceList="workspaceList",e.HeadingsList="headingsList",e.Bookmark="bookmark",e.CommandList="commandList",e.RelatedItemsList="relatedItemsList",e.VaultList="vaultList",e.File="file",e.Alias="alias",e.Unresolved="unresolved"}(l||(l={})),function(e){e[e.None=0]="None",e[e.Primary=1]="Primary",e[e.Basename=2]="Basename",e[e.Path=3]="Path"}(d||(d={})),function(e){e.DiskLocation="disk-location",e.Backlink="backlink",e.OutgoingLink="outgoing-link"}(c||(c={}));class P{static getAliases(e){let t=[];return e&&(t=P.getValueForKey(e,/^alias(es)?$/i)),t}static getValueForKey(e,t){const s=[],i=Object.keys(e).find((e=>t.test(e)));if(i){let t=e[i];"string"==typeof t&&(t=t.split(",")),Array.isArray(t)&&t.forEach((e=>{"string"==typeof e&&s.push(e.trim())}))}return s}}class M{static getRootComponent(){return this.rootComponent||(this.rootComponent=new n.Component),this.rootComponent}static unload(){this.rootComponent?.unload()}}const R={file:"canvas-node-file",text:"canvas-node-text",link:"canvas-node-link",group:"canvas-node-group"},H=[{id:s[s.Heading],mode:t.SymbolList,label:"headings",isActive:!1,isAvailable:!0},{id:s[s.Tag],mode:t.SymbolList,label:"tags",isActive:!1,isAvailable:!0},{id:s[s.Callout],mode:t.SymbolList,label:"callouts",isActive:!1,isAvailable:!0},{id:s[s.Link],mode:t.SymbolList,label:"links",isActive:!1,isAvailable:!0},{id:s[s.Embed],mode:t.SymbolList,label:"embeds",isActive:!1,isAvailable:!0},{id:R.file,mode:t.SymbolList,label:"file cards",isActive:!1,isAvailable:!0},{id:R.text,mode:t.SymbolList,label:"text cards",isActive:!1,isAvailable:!0},{id:R.link,mode:t.SymbolList,label:"link cards",isActive:!1,isAvailable:!0},{id:R.group,mode:t.SymbolList,label:"groups",isActive:!1,isAvailable:!0}],B=[{id:c.Backlink,mode:t.RelatedItemsList,label:"backlinks",isActive:!1,isAvailable:!0},{id:c.OutgoingLink,mode:t.RelatedItemsList,label:"outgoing links",isActive:!1,isAvailable:!0},{id:c.DiskLocation,mode:t.RelatedItemsList,label:"disk location",isActive:!1,isAvailable:!0}],D={file:"bookmarks-file",folder:"bookmarks-folder",search:"bookmarks-search",group:"bookmarks-group"},W=[{id:D.file,mode:t.BookmarksList,label:"files",isActive:!1,isAvailable:!0},{id:D.folder,mode:t.BookmarksList,label:"folders",isActive:!1,isAvailable:!0},{id:D.search,mode:t.BookmarksList,label:"searches",isActive:!1,isAvailable:!0}];var N;!function(e){e.Pinned="pinnedCommands",e.Recent="recentCommands"}(N||(N={}));const V=[{id:N.Pinned,mode:t.CommandList,label:"pinned",isActive:!1,isAvailable:!0},{id:N.Recent,mode:t.CommandList,label:"recent",isActive:!1,isAvailable:!0}];var q;!function(e){e.RecentFiles="recentFilesSearch",e.Bookmarks="bookmarksSearch",e.Filenames="filenamesSearch",e.Headings="headingsSearch",e.ExternalFiles="externalFilesSearch"}(q||(q={}));const j=[{id:q.RecentFiles,mode:t.HeadingsList,label:"recent files",isActive:!1,isAvailable:!0},{id:q.Bookmarks,mode:t.HeadingsList,label:"bookmarks",isActive:!1,isAvailable:!0},{id:q.Filenames,mode:t.HeadingsList,label:"filenames",isActive:!1,isAvailable:!0},{id:q.Headings,mode:t.HeadingsList,label:"headings",isActive:!1,isAvailable:!0},{id:q.ExternalFiles,mode:t.HeadingsList,label:"external files",isActive:!1,isAvailable:!0}];function K(){const e={};return[H,B,W,V,j].flat().reduce(((e,t)=>(e[t.id]=Object.assign({},t),e)),e),e}const $=e=>{if("object"==typeof e&&null!==e){if("function"==typeof Object.getPrototypeOf){const t=Object.getPrototypeOf(e);return t===Object.prototype||null===t}return"[object Object]"===Object.prototype.toString.call(e)}return!1},Q=(...e)=>e.reduce(((e,t)=>{if(Array.isArray(t))throw new TypeError("Arguments provided to ts-deepmerge must be objects, not arrays.");return Object.keys(t).forEach((s=>{["__proto__","constructor","prototype"].includes(s)||(Array.isArray(e[s])&&Array.isArray(t[s])?e[s]=Q.options.mergeArrays?Q.options.uniqueArrayItems?Array.from(new Set(e[s].concat(t[s]))):[...e[s],...t[s]]:t[s]:$(e[s])&&$(t[s])?e[s]=Q(e[s],t[s]):e[s]=void 0===t[s]?Q.options.allowUndefinedOverrides?t[s]:e[s]:t[s])})),e}),{}),U={allowUndefinedOverrides:!0,mergeArrays:!0,uniqueArrayItems:!0};Q.options=U,Q.withOptions=(e,...t)=>{Q.options=Object.assign(Object.assign({},U),e);const s=Q(...t);return Q.options=U,s};class z{static get defaults(){const i={};return i[s.Link]=!0,i[s.Embed]=!0,i[s.Tag]=!0,i[s.Heading]=!0,i[s.Callout]=!0,{version:"2.0.0",onOpenPreferNewTab:!0,alwaysNewTabForSymbols:!1,useActiveTabForSymbolsOnMobile:!1,symbolsInLineOrder:!0,editorListCommand:"edt ",symbolListCommand:"@",symbolListActiveEditorCommand:"$ ",workspaceListCommand:"+",headingsListCommand:"#",bookmarksListCommand:"'",commandListCommand:">",vaultListCommand:"vault ",relatedItemsListCommand:"~",relatedItemsListActiveEditorCommand:"^ ",shouldSearchHeadings:!0,strictHeadingsOnly:!1,searchAllHeadings:!0,headingsSearchDebounceMilli:250,excludeViewTypes:["empty"],referenceViews:["backlink","localgraph","outgoing-link","outline"],limit:50,includeSidePanelViewTypes:["backlink","image","markdown","pdf"],enabledSymbolTypes:i,selectNearestHeading:!0,excludeFolders:[],excludeLinkSubTypes:0,excludeRelatedFolders:[""],excludeOpenRelatedFiles:!1,excludeObsidianIgnoredFiles:!1,shouldSearchFilenames:!1,shouldSearchBookmarks:!1,shouldSearchRecentFiles:!0,pathDisplayFormat:e.FolderWithFilename,hidePathIfRoot:!0,enabledRelatedItems:Object.values(c),showOptionalIndicatorIcons:!0,overrideStandardModeBehaviors:!0,enabledRibbonCommands:[t[t.HeadingsList],t[t.SymbolList]],fileExtAllowList:["canvas"],matchPriorityAdjustments:{isEnabled:!1,adjustments:{isOpenInEditor:{value:0,label:"Open items"},isBookmarked:{value:0,label:"Bookmarked items"},isRecent:{value:0,label:"Recent items"},isAttachment:{value:0,label:"Attachment file types"},file:{value:0,label:"Filenames"},alias:{value:0,label:"Aliases"},unresolved:{value:0,label:"Unresolved filenames"},h1:{value:0,label:"H₁ headings"}},fileExtAdjustments:{canvas:{value:0,label:"Canvas files"}}},quickFilters:{resetKey:"0",keyList:["1","2","3","4","5","6","7","8","9"],modifiers:["Ctrl","Alt"],facetList:K(),shouldResetActiveFacets:!1,shouldShowFacetInstructions:!0},preserveCommandPaletteLastInput:!1,preserveQuickSwitcherLastInput:!1,shouldCloseModalOnBackspace:!1,maxRecentFileSuggestionsOnInit:25,orderEditorListByAccessTime:!0,insertLinkInEditor:{isEnabled:!0,keymap:{modifiers:["Mod"],key:"i",purpose:"insert in editor"},insertableEditorTypes:["markdown"],useBasenameAsAlias:!0,useHeadingAsAlias:!0},removeDefaultTabBinding:!0,navigationKeys:{nextKeys:[{modifiers:["Ctrl"],key:"n"},{modifiers:["Ctrl"],key:"j"}],prevKeys:[{modifiers:["Ctrl"],key:"p"},{modifiers:["Ctrl"],key:"k"}]},preferredSourceForTitle:"H1",closeWhenEmptyKeys:[{modifiers:null,key:"Backspace"}],navigateToHotkeySelectorKeys:{modifiers:["Ctrl","Shift"],key:"h"},togglePinnedCommandKeys:{modifiers:["Ctrl","Shift"],key:"p"},escapeCmdChar:"!",mobileLauncher:{isEnabled:!1,modeString:t[t.HeadingsList],iconName:"",coreLauncherButtonIconSelector:"span.clickable-icon",coreLauncherButtonSelector:".mobile-navbar-action:has(span.clickable-icon svg.svg-icon.lucide-plus-circle)"},allowCreateNewFileInModeNames:[t[t.Standard],t[t.HeadingsList]],showModeTriggerInstructions:!0,renderMarkdownContentInSuggestions:{isEnabled:!1,renderHeadings:!1,toggleContentRenderingKeys:{modifiers:["Shift","Ctrl"],key:"m"}},quickOpen:{isEnabled:!0,modifiers:["Alt"],keyList:["1","2","3","4","5","6","7","8","9"]}}}get version(){return this.data.version}set version(e){this.data.version=e}get builtInSystemOptions(){return C(this.plugin.app)?.options}get showAllFileTypes(){return this.builtInSystemOptions?.showAllFileTypes}get showAttachments(){return this.builtInSystemOptions?.showAttachments}get showExistingOnly(){return this.builtInSystemOptions?.showExistingOnly}get onOpenPreferNewTab(){return this.data.onOpenPreferNewTab}set onOpenPreferNewTab(e){this.data.onOpenPreferNewTab=e}get alwaysNewTabForSymbols(){return this.data.alwaysNewTabForSymbols}set alwaysNewTabForSymbols(e){this.data.alwaysNewTabForSymbols=e}get useActiveTabForSymbolsOnMobile(){return this.data.useActiveTabForSymbolsOnMobile}set useActiveTabForSymbolsOnMobile(e){this.data.useActiveTabForSymbolsOnMobile=e}get symbolsInLineOrder(){return this.data.symbolsInLineOrder}set symbolsInLineOrder(e){this.data.symbolsInLineOrder=e}get editorListPlaceholderText(){return z.defaults.editorListCommand}get editorListCommand(){return this.data.editorListCommand}set editorListCommand(e){this.data.editorListCommand=e}get symbolListPlaceholderText(){return z.defaults.symbolListCommand}get symbolListCommand(){return this.data.symbolListCommand}set symbolListCommand(e){this.data.symbolListCommand=e}get symbolListActiveEditorCommand(){return this.data.symbolListActiveEditorCommand}set symbolListActiveEditorCommand(e){this.data.symbolListActiveEditorCommand=e}get workspaceListCommand(){return this.data.workspaceListCommand}set workspaceListCommand(e){this.data.workspaceListCommand=e}get workspaceListPlaceholderText(){return z.defaults.workspaceListCommand}get headingsListCommand(){return this.data.headingsListCommand}set headingsListCommand(e){this.data.headingsListCommand=e}get headingsListPlaceholderText(){return z.defaults.headingsListCommand}get bookmarksListCommand(){return this.data.bookmarksListCommand}set bookmarksListCommand(e){this.data.bookmarksListCommand=e}get bookmarksListPlaceholderText(){return z.defaults.bookmarksListCommand}get commandListCommand(){return this.data.commandListCommand}set commandListCommand(e){this.data.commandListCommand=e}get commandListPlaceholderText(){return z.defaults.commandListCommand}get vaultListCommand(){return this.data.vaultListCommand}set vaultListCommand(e){this.data.vaultListCommand=e}get vaultListPlaceholderText(){return z.defaults.vaultListCommand}get relatedItemsListCommand(){return this.data.relatedItemsListCommand}set relatedItemsListCommand(e){this.data.relatedItemsListCommand=e}get relatedItemsListPlaceholderText(){return z.defaults.relatedItemsListCommand}get relatedItemsListActiveEditorCommand(){return this.data.relatedItemsListActiveEditorCommand}set relatedItemsListActiveEditorCommand(e){this.data.relatedItemsListActiveEditorCommand=e}get shouldSearchHeadings(){return this.data.shouldSearchHeadings}set shouldSearchHeadings(e){this.data.shouldSearchHeadings=e}get strictHeadingsOnly(){return this.data.strictHeadingsOnly}set strictHeadingsOnly(e){this.data.strictHeadingsOnly=e}get searchAllHeadings(){return this.data.searchAllHeadings}set searchAllHeadings(e){this.data.searchAllHeadings=e}get headingsSearchDebounceMilli(){return this.data.headingsSearchDebounceMilli}set headingsSearchDebounceMilli(e){this.data.headingsSearchDebounceMilli=e}get excludeViewTypes(){return this.data.excludeViewTypes}set excludeViewTypes(e){this.data.excludeViewTypes=e}get referenceViews(){return this.data.referenceViews}set referenceViews(e){this.data.referenceViews=e}get limit(){return this.data.limit}set limit(e){this.data.limit=e}get includeSidePanelViewTypes(){return this.data.includeSidePanelViewTypes}set includeSidePanelViewTypes(e){this.data.includeSidePanelViewTypes=[...new Set(e)]}get includeSidePanelViewTypesPlaceholder(){return z.defaults.includeSidePanelViewTypes.join("\n")}get selectNearestHeading(){return this.data.selectNearestHeading}set selectNearestHeading(e){this.data.selectNearestHeading=e}get excludeFolders(){return this.data.excludeFolders}set excludeFolders(e){this.data.excludeFolders=[...new Set(e)]}get excludeLinkSubTypes(){return this.data.excludeLinkSubTypes}set excludeLinkSubTypes(e){this.data.excludeLinkSubTypes=e}get excludeRelatedFolders(){return this.data.excludeRelatedFolders}set excludeRelatedFolders(e){this.data.excludeRelatedFolders=[...new Set(e)]}get excludeOpenRelatedFiles(){return this.data.excludeOpenRelatedFiles}set excludeOpenRelatedFiles(e){this.data.excludeOpenRelatedFiles=e}get excludeObsidianIgnoredFiles(){return this.data.excludeObsidianIgnoredFiles}set excludeObsidianIgnoredFiles(e){this.data.excludeObsidianIgnoredFiles=e}get shouldSearchFilenames(){return this.data.shouldSearchFilenames}set shouldSearchFilenames(e){this.data.shouldSearchFilenames=e}get shouldSearchBookmarks(){return this.data.shouldSearchBookmarks}set shouldSearchBookmarks(e){this.data.shouldSearchBookmarks=e}get shouldSearchRecentFiles(){return this.data.shouldSearchRecentFiles}set shouldSearchRecentFiles(e){this.data.shouldSearchRecentFiles=e}get pathDisplayFormat(){return this.data.pathDisplayFormat}set pathDisplayFormat(e){this.data.pathDisplayFormat=e}get hidePathIfRoot(){return this.data.hidePathIfRoot}set hidePathIfRoot(e){this.data.hidePathIfRoot=e}get enabledRelatedItems(){return this.data.enabledRelatedItems}set enabledRelatedItems(e){this.data.enabledRelatedItems=e}get showOptionalIndicatorIcons(){return this.data.showOptionalIndicatorIcons}set showOptionalIndicatorIcons(e){this.data.showOptionalIndicatorIcons=e}get overrideStandardModeBehaviors(){return this.data.overrideStandardModeBehaviors}set overrideStandardModeBehaviors(e){this.data.overrideStandardModeBehaviors=e}get enabledRibbonCommands(){return this.data.enabledRibbonCommands}set enabledRibbonCommands(e){this.data.enabledRibbonCommands=[...new Set(e)]}get fileExtAllowList(){return this.data.fileExtAllowList}set fileExtAllowList(e){this.data.fileExtAllowList=e}get matchPriorityAdjustments(){return this.data.matchPriorityAdjustments}set matchPriorityAdjustments(e){this.data.matchPriorityAdjustments=e}get quickFilters(){return this.data.quickFilters}set quickFilters(e){this.data.quickFilters=e}get preserveCommandPaletteLastInput(){return this.data.preserveCommandPaletteLastInput}set preserveCommandPaletteLastInput(e){this.data.preserveCommandPaletteLastInput=e}get preserveQuickSwitcherLastInput(){return this.data.preserveQuickSwitcherLastInput}set preserveQuickSwitcherLastInput(e){this.data.preserveQuickSwitcherLastInput=e}get shouldCloseModalOnBackspace(){return this.data.shouldCloseModalOnBackspace}set shouldCloseModalOnBackspace(e){this.data.shouldCloseModalOnBackspace=e}get maxRecentFileSuggestionsOnInit(){return this.data.maxRecentFileSuggestionsOnInit}set maxRecentFileSuggestionsOnInit(e){this.data.maxRecentFileSuggestionsOnInit=e}get orderEditorListByAccessTime(){return this.data.orderEditorListByAccessTime}set orderEditorListByAccessTime(e){this.data.orderEditorListByAccessTime=e}get insertLinkInEditor(){return this.data.insertLinkInEditor}set insertLinkInEditor(e){this.data.insertLinkInEditor=e}get removeDefaultTabBinding(){return this.data.removeDefaultTabBinding}set removeDefaultTabBinding(e){this.data.removeDefaultTabBinding=e}get navigationKeys(){return this.data.navigationKeys}set navigationKeys(e){this.data.navigationKeys=e}get preferredSourceForTitle(){return this.data.preferredSourceForTitle}set preferredSourceForTitle(e){this.data.preferredSourceForTitle=e}get closeWhenEmptyKeys(){return this.data.closeWhenEmptyKeys}set closeWhenEmptyKeys(e){this.data.closeWhenEmptyKeys=e}get navigateToHotkeySelectorKeys(){return this.data.navigateToHotkeySelectorKeys}set navigateToHotkeySelectorKeys(e){this.data.navigateToHotkeySelectorKeys=e}get togglePinnedCommandKeys(){return this.data.togglePinnedCommandKeys}set togglePinnedCommandKeys(e){this.data.togglePinnedCommandKeys=e}get escapeCmdChar(){return this.data.escapeCmdChar}set escapeCmdChar(e){this.data.escapeCmdChar=e}get mobileLauncher(){return this.data.mobileLauncher}set mobileLauncher(e){this.data.mobileLauncher=e}get allowCreateNewFileInModeNames(){return this.data.allowCreateNewFileInModeNames}set allowCreateNewFileInModeNames(e){this.data.allowCreateNewFileInModeNames=[...new Set(e)]}get showModeTriggerInstructions(){return this.data.showModeTriggerInstructions}set showModeTriggerInstructions(e){this.data.showModeTriggerInstructions=e}get renderMarkdownContentInSuggestions(){return this.data.renderMarkdownContentInSuggestions}set renderMarkdownContentInSuggestions(e){this.data.renderMarkdownContentInSuggestions=e}get quickOpen(){return this.data.quickOpen}set quickOpen(e){this.data.quickOpen=e}constructor(e){this.plugin=e,this.data=z.defaults}async updateDataAndLoadSettings(){return await z.transformDataFile(this.plugin,z.defaults),await this.loadSettings()}async loadSettings(){try{const e=await(this.plugin?.loadData());if(e){const t=Object.keys(z.defaults);((e,t,s)=>{const i=["matchPriorityAdjustments","quickFilters"],n=s=>Q.withOptions({mergeArrays:!1},t[s],e[s]);for(const a of s)a in e&&(t[a]=i.includes(a)?n(a):e[a])})(e,this.data,t)}}catch(e){console.log("Switcher++: error loading settings, using defaults. ",e)}}async saveSettings(){const{plugin:e,data:t}=this;await(e?.saveData(t))}save(){this.saveSettings().catch((e=>{console.log("Switcher++: error saving changes to settings",e)}))}isSymbolTypeEnabled(e){const{enabledSymbolTypes:t}=this.data;let s=z.defaults.enabledSymbolTypes[e];return Object.prototype.hasOwnProperty.call(t,e)&&(s=t[e]),s}setSymbolTypeEnabled(e,t){this.data.enabledSymbolTypes[e]=t}static async transformDataFile(e,t){await z.transformDataFileToV1(e,t),await z.transformDataFileToV2(e,t)}static async transformDataFileToV1(e,t){let s=!1;try{const i=await(e?.loadData());if(i&&"object"==typeof i){const n="version";if(!Object.prototype.hasOwnProperty.call(i,n)){const a="starredListCommand";Object.prototype.hasOwnProperty.call(i,a)&&(i.bookmarksListCommand=i[a]??t.bookmarksListCommand,delete i[a]);const o="isStarred",r=i.matchPriorityAdjustments;r&&Object.prototype.hasOwnProperty.call(r,o)&&(r.isBookmarked=r[o],delete r[o]),i[n]="1.0.0",await(e?.saveData(i)),s=!0}}}catch(e){console.log("Switcher++: error transforming data.json to v1.0.0",e)}return s}static async transformDataFileToV2(e,t){let s=!1;try{const i=await(e?.loadData());if(i&&"object"==typeof i){const n="version";if("1.0.0"===i[n]){const a="matchPriorityAdjustments";if(Object.prototype.hasOwnProperty.call(i,a)){const e=i[a],s={};i[a]={isEnabled:!!i.enableMatchPriorityAdjustments,adjustments:s},delete i.enableMatchPriorityAdjustments,Object.entries(e).forEach((([e,i])=>{const n=t.matchPriorityAdjustments.adjustments[e]?.label??"";s[e]={value:i,label:n}}))}const o="quickFilters";if(Object.prototype.hasOwnProperty.call(i,o)){const e="facetList",t=i[o],s=t[e],n=s?.reduce(((e,t)=>(e[t.id]=t,e)),{});t[e]=n}i[n]="2.0.0",await(e?.saveData(i)),s=!0}}}catch(e){console.log("Switcher++: error transforming data.json to v2.0.0",e)}return s}}class _{constructor(e,t,s){this.app=e,this.mainSettingsTab=t,this.config=s}createSetting(e,t,s){const i=new n.Setting(e);return i.setName(t),i.setDesc(s),i}addSectionTitle(e,t,s=""){const i=this.createSetting(e,t,s);return i.setHeading(),i}addTextSetting(e,t,s,i,n,a){const o=this.createSetting(e,t,s);return o.addText((e=>{e.setPlaceholder(a),e.setValue(i),e.onChange((e=>{const t=e.length?e:i;this.saveChangesToConfig(n,t)}))})),o}addToggleSetting(e,t,s,i,n,a){const o=this.createSetting(e,t,s);return o.addToggle((e=>{e.setValue(i),e.onChange((e=>{a?a(e,this.config):this.saveChangesToConfig(n,e)}))})),o}addTextAreaSetting(e,t,s,i,n,a){const o=this.createSetting(e,t,s);return o.addTextArea((e=>{e.setPlaceholder(a),e.setValue(i),e.onChange((e=>{const t=e.length?e:i,s=Array.isArray(this.config[n]);this.saveChangesToConfig(n,s?t.split("\n"):t)}))})),o}addDropdownSetting(e,t,s,i,n,a,o){const r=this.createSetting(e,t,s);return r.addDropdown((e=>{e.addOptions(n),e.setValue(i),e.onChange((e=>{o?o(e,this.config):this.saveChangesToConfig(a,e)}))})),r}addSliderSetting(e,t,s,i,n,a,o){const r=this.createSetting(e,t,s);return r.addExtraButton((e=>(e.setIcon("lucide-rotate-ccw"),e.setTooltip("Restore default"),e.onClick((()=>r.components[1].setValue(0))),e))),r.addSlider((e=>{e.setLimits(n[0],n[1],n[2]),e.setValue(i),e.setDynamicTooltip(),e.onChange((e=>{o?o(e,this.config):this.saveChangesToConfig(a,e)}))})),r}saveChangesToConfig(e,t){if(e){const{config:s}=this;s[e]=t,s.save()}}}class G extends _{display(e){const{config:t}=this;this.addSectionTitle(e,"Bookmarks List Mode Settings"),this.addTextSetting(e,"Bookmarks list mode trigger","Character that will trigger bookmarks list mode in the switcher",t.bookmarksListCommand,"bookmarksListCommand",t.bookmarksListPlaceholderText)}}class J extends _{display(e){const{config:t}=this;this.addSectionTitle(e,"Command List Mode Settings"),this.addTextSetting(e,"Command list mode trigger","Character that will trigger command list mode in the switcher",t.commandListCommand,"commandListCommand",t.commandListPlaceholderText)}}class X extends _{display(e){const{config:t}=this;this.addSectionTitle(e,"Related Items List Mode Settings"),this.addTextSetting(e,"Related Items list mode trigger","Character that will trigger related items list mode in the switcher. This triggers a display of Related Items for the source file of the currently selected (highlighted) suggestion in the switcher. If there is not a suggestion, display results for the active editor.",t.relatedItemsListCommand,"relatedItemsListCommand",t.relatedItemsListPlaceholderText),this.addTextSetting(e,"Related Items list mode trigger - Active editor only","Character that will trigger related items list mode in the switcher. This always triggers a display of Related Items for the active editor only.",t.relatedItemsListActiveEditorCommand,"relatedItemsListActiveEditorCommand",t.relatedItemsListActiveEditorCommand),this.showEnabledRelatedItems(e,t),this.addToggleSetting(e,"Exclude open files","Enable, related files which are already open will not be displayed in the list. Disabled, All related files will be displayed in the list.",t.excludeOpenRelatedFiles,"excludeOpenRelatedFiles")}showEnabledRelatedItems(e,t){const s=Object.values(c).sort(),i=s.join(", "),n=`The types of related items to show in the list. Add one type per line. Available types: ${i}`;this.createSetting(e,"Show related item types",n).addTextArea((e=>{e.setValue(t.enabledRelatedItems.join("\n")),e.inputEl.addEventListener("focusout",(()=>{const n=e.getValue().split("\n").map((e=>e.trim())).filter((e=>e.length>0)),a=[...new Set(n)].filter((e=>!s.includes(e)));a?.length?this.showErrorPopup(a.join("
"),i):(t.enabledRelatedItems=n,t.save())}))}))}showErrorPopup(e,t){const s=new n.Modal(this.app);s.titleEl.setText("Invalid related item type"),s.contentEl.innerHTML=`Changes not saved. Available relation types are: ${t}. The following types are invalid:

${e}`,s.open()}}class Y extends _{display(e){const{config:t}=this;this.addSectionTitle(e,"General Settings"),this.showEnabledRibbonCommands(e,t),this.showOverrideMobileLauncher(e,t),this.showPreferredSourceForTitle(e,t),this.showPathDisplayFormat(e,t),this.addToggleSetting(e,"Hide path for root items","When enabled, path information will be hidden for items at the root of the vault.",t.hidePathIfRoot,"hidePathIfRoot").setClass("qsp-setting-item-indent"),this.addTextSetting(e,"Mode trigger escape character","Character to indicate that a mode trigger character should be treated just as a normal text.",t.escapeCmdChar,"escapeCmdChar"),this.addToggleSetting(e,"Default to open in new tab","When enabled, navigating to un-opened files will open a new editor tab whenever possible (as if cmd/ctrl were held). When the file is already open, the existing tab will be activated. This overrides all other tab settings.",t.onOpenPreferNewTab,"onOpenPreferNewTab"),this.addToggleSetting(e,"Override Standard mode behavior","When enabled, Switcher++ will change the default Obsidian builtin Switcher functionality (Standard mode) to inject custom behavior.",t.overrideStandardModeBehaviors,"overrideStandardModeBehaviors"),this.addToggleSetting(e,"Show indicator icons","Display icons to indicate that an item is recent, bookmarked, etc..",t.showOptionalIndicatorIcons,"showOptionalIndicatorIcons"),this.addToggleSetting(e,"Allow Backspace key to close the Switcher","When the search box is empty, pressing the backspace key will close Switcher++.",t.shouldCloseModalOnBackspace,"shouldCloseModalOnBackspace"),this.showMatchPriorityAdjustments(e,t),this.showInsertLinkInEditor(e,t),this.addToggleSetting(e,"Restore previous input in Command Mode","When enabled, restore the last typed input in Command Mode when launched via global command hotkey.",t.preserveCommandPaletteLastInput,"preserveCommandPaletteLastInput"),this.addToggleSetting(e,"Restore previous input","When enabled, restore the last typed input when launched via global command hotkey.",t.preserveQuickSwitcherLastInput,"preserveQuickSwitcherLastInput"),this.addToggleSetting(e,"Display mode trigger instructions","When enabled, the trigger key for each mode will be displayed in the instructions section of the Switcher.",t.showModeTriggerInstructions,"showModeTriggerInstructions"),this.showResetFacetEachSession(e,t),this.showRenderMarkdownContentAsHTML(e,t),this.showQuickOpen(e,t)}showPreferredSourceForTitle(e,t){this.addDropdownSetting(e,"Preferred suggestion title source",'The preferred source to use for the "title" text that will be searched and displayed for file based suggestions',t.preferredSourceForTitle,{H1:"First H₁ heading",Default:"Default"},"preferredSourceForTitle")}showPathDisplayFormat(t,s){const i={};i[e.None.toString()]="Hide path",i[e.Full.toString()]="Full path",i[e.FolderOnly.toString()]="Only parent folder",i[e.FolderWithFilename.toString()]="Parent folder & filename",i[e.FolderPathFilenameOptional.toString()]="Parent folder path (filename optional)",this.addDropdownSetting(t,"Preferred file path display format","The preferred way to display file paths in suggestions",s.pathDisplayFormat.toString(),i,null,((e,t)=>{t.pathDisplayFormat=Number(e),t.save()}))}showEnabledRibbonCommands(e,s){const i=Object.values(t).filter((e=>isNaN(Number(e)))).sort(),n=i.join(" "),a=`Display an icon in the ribbon menu to launch specific modes. Add one mode per line. Available modes: ${n}`;this.createSetting(e,"Show ribbon icons",a).addTextArea((e=>{e.setValue(s.enabledRibbonCommands.join("\n")),e.inputEl.addEventListener("focusout",(()=>{const t=e.getValue().split("\n").map((e=>e.trim())).filter((e=>e.length>0)),a=Array.from(new Set(t)).filter((e=>!i.includes(e)));a.length?this.showErrorPopup(a.join("
"),n):(s.enabledRibbonCommands=t,s.save(),this.mainSettingsTab.plugin.registerRibbonCommandIcons())}))}))}showErrorPopup(e,t){const s=new n.Modal(this.app);s.titleEl.setText("Invalid mode"),s.contentEl.innerHTML=`Changes not saved. Available modes are: ${t}. The following are invalid:

${e}`,s.open()}showOverrideMobileLauncher(e,s){const{mobileLauncher:i}=s,n="disabled",a={[n]:"Do not override"},o=Object.values(t).filter((e=>isNaN(Number(e)))).sort();o.forEach((e=>{a[e]=e}));let r=n;i.isEnabled&&o.includes(i.modeString)&&(r=i.modeString),this.addDropdownSetting(e,'Override default Switcher launch button (the "⊕" button) on mobile platforms','Override the "⊕" button (in the Navigation Bar) on mobile platforms to launch Switcher++ instead of the default system switcher. Select the Mode to launch Switcher++ in, or select "Do not override" to disable the feature.',r,a,null,((e,t)=>{const s=e!==n;t.mobileLauncher.isEnabled=s,s&&(t.mobileLauncher.modeString=e),t.save(),this.mainSettingsTab.plugin.updateMobileLauncherButtonOverride(s)}))}showMatchPriorityAdjustments(e,t){const{matchPriorityAdjustments:{isEnabled:s,adjustments:i,fileExtAdjustments:n}}=t;this.addToggleSetting(e,"Result priority adjustments","Artificially increase the match score of the specified item types by a fixed percentage so they appear higher in the results list (does not apply to Standard Mode).",s,null,((e,t)=>{t.matchPriorityAdjustments.isEnabled=e,t.saveSettings().then((()=>{this.mainSettingsTab.display()}),(e=>console.log('Switcher++: error saving "Result Priority Adjustments" setting. ',e)))})),s&&[i,n].forEach((t=>{Object.entries(t).forEach((([s,i])=>{const{value:n,label:a}=i,o=this.addSliderSetting(e,a,i.desc??"",n,[-1,1,.05],null,((e,i)=>{t[s].value=e,i.save()}));o.setClass("qsp-setting-item-indent")}))}))}showResetFacetEachSession(e,t){this.addToggleSetting(e,"Reset active Quick Filters","When enabled, the switcher will reset all Quick Filters back to inactive for each session.",t.quickFilters.shouldResetActiveFacets,null,((e,t)=>{t.quickFilters.shouldResetActiveFacets=e,t.save()}))}showRenderMarkdownContentAsHTML(e,t){const s=this.addToggleSetting(e,"Display Headings as Live Preview",'When enabled, Headings will be rendered as HTML similar to the Obsidian "Live Preview" display. When disabled, Headings will be rendered as raw text. Use the "toggle preview (selected heading)" hotkey to toggle the display for individual headings.',t.renderMarkdownContentInSuggestions.renderHeadings,null,((e,t)=>{const{renderMarkdownContentInSuggestions:s}=t;s.renderHeadings=e,s.isEnabled=e,t.save()}));s?.nameEl?.createSpan({cls:["qsp-tag","qsp-warning"],text:"Experimental"})}showInsertLinkInEditor(e,t){this.createSetting(e,"Insert link in editor","");let s=this.addToggleSetting(e,"Use filename as alias","When enabled, the file basename will be set as the link alias.",t.insertLinkInEditor.useBasenameAsAlias,null,((e,t)=>{t.insertLinkInEditor.useBasenameAsAlias=e,t.save()}));s.setClass("qsp-setting-item-indent"),s=this.addToggleSetting(e,"Use heading as alias",'When enabled, the file heading will be set as the link alias. This overrides the "use filename as alias" setting.',t.insertLinkInEditor.useHeadingAsAlias,null,((e,t)=>{t.insertLinkInEditor.useHeadingAsAlias=e,t.save()})),s.setClass("qsp-setting-item-indent")}showQuickOpen(e,t){this.addToggleSetting(e,"Enable quick open hotkeys for top results","When enabled, hotkeys will be defined for each of the top N results displayed in the Switcher. These hotkeys can be used to quickly open the associated suggestion directly. when disabled, no hotkeys are defined.",t.quickOpen.isEnabled,null,((e,t)=>{t.quickOpen.isEnabled=e,t.save()}))}}class Z extends _{display(e){const{config:t}=this;this.addSectionTitle(e,"Workspace List Mode Settings"),this.addTextSetting(e,"Workspace list mode trigger","Character that will trigger workspace list mode in the switcher",t.workspaceListCommand,"workspaceListCommand",t.workspaceListPlaceholderText)}}class ee extends _{display(e){const{config:t}=this;this.addSectionTitle(e,"Editor List Mode Settings"),this.addTextSetting(e,"Editor list mode trigger","Character that will trigger editor list mode in the switcher",t.editorListCommand,"editorListCommand",t.editorListPlaceholderText),this.showIncludeSidePanelViews(e,t),this.addToggleSetting(e,"Order default editor list by most recently accessed","When there is no search term, order the list of editors by most recent access time.",t.orderEditorListByAccessTime,"orderEditorListByAccessTime")}showIncludeSidePanelViews(e,t){const s=`When in Editor list mode, show the following view types from the side panels. Add one view type per line. Available view types: ${Object.keys(this.app.viewRegistry.viewByType).sort().join(" ")}`;this.addTextAreaSetting(e,"Include side panel views",s,t.includeSidePanelViewTypes.join("\n"),"includeSidePanelViewTypes",t.includeSidePanelViewTypesPlaceholder)}}class te extends _{display(e){const{config:t}=this;this.addSectionTitle(e,"Headings List Mode Settings"),this.addTextSetting(e,"Headings list mode trigger","Character that will trigger headings list mode in the switcher",t.headingsListCommand,"headingsListCommand",t.headingsListPlaceholderText),this.showHeadingSettings(e,t),this.addToggleSetting(e,"Search Filenames","Enabled, search and show suggestions for filenames. Disabled, Don't search through filenames (except for fallback searches)",t.shouldSearchFilenames,"shouldSearchFilenames"),this.addToggleSetting(e,"Search Bookmarks","Enabled, search and show suggestions for Bookmarks. Disabled, Don't search through Bookmarks",t.shouldSearchBookmarks,"shouldSearchBookmarks"),this.addSliderSetting(e,"Max recent files to show","The maximum number of recent files to show when there is no search term",t.maxRecentFileSuggestionsOnInit,[0,75,1],"maxRecentFileSuggestionsOnInit"),this.showExcludeFolders(e,t),this.addToggleSetting(e,'Hide Obsidian "Excluded files"','Enabled, do not display suggestions for files that are in Obsidian\'s "Options > Files & Links > Excluded files" list. Disabled, suggestions for those files will be displayed but downranked.',t.excludeObsidianIgnoredFiles,"excludeObsidianIgnoredFiles"),this.showFileExtAllowList(e,t)}showHeadingSettings(e,t){const s=t.shouldSearchHeadings;if(this.addToggleSetting(e,"Search Headings","Enabled, search and show suggestions for Headings. Disabled, Don't search through Headings",s,null,((e,t)=>{t.shouldSearchHeadings=e,t.saveSettings().then((()=>{this.mainSettingsTab.display()}),(e=>console.log('Switcher++: error saving "Search Headings" setting. ',e)))})),s){let s=this.addToggleSetting(e,"Turn off filename fallback","Enabled, strictly search through only the headings contained in the file. Do not fallback to searching the filename when an H1 match is not found. Disabled, fallback to searching against the filename when there is not a match in the first H1 contained in the file.",t.strictHeadingsOnly,"strictHeadingsOnly");s.setClass("qsp-setting-item-indent"),s=this.addToggleSetting(e,"Search all headings","Enabled, search through all headings contained in each file. Disabled, only search through the first H1 in each file.",t.searchAllHeadings,"searchAllHeadings"),s.setClass("qsp-setting-item-indent")}}showFileExtAllowList(e,t){this.createSetting(e,"File extension override",'Override the "Show attachments" and the "Show all file types" builtin, system Switcher settings and always search files with the listed extensions. Add one path per line. For example to add ".canvas" file extension, just add "canvas".').addTextArea((e=>{e.setValue(t.fileExtAllowList.join("\n")),e.inputEl.addEventListener("focusout",(()=>{const s=e.getValue().split("\n").map((e=>e.trim())).filter((e=>e.length>0));t.fileExtAllowList=s,t.save()}))}))}showExcludeFolders(e,t){const s="Exclude folders";this.createSetting(e,s,"When in Headings list mode, folder path that match any regex listed here will not be searched for suggestions. Path should start from the Vault Root. Add one path per line.").addTextArea((e=>{e.setValue(t.excludeFolders.join("\n")),e.inputEl.addEventListener("focusout",(()=>{const i=e.getValue().split("\n").filter((e=>e.length>0));this.validateExcludeFolderList(s,i)&&(t.excludeFolders=i,t.save())}))}))}validateExcludeFolderList(e,t){let s=!0,i="";for(const e of t)try{new RegExp(e)}catch(t){i+=`${e}
${t}

`,s=!1}if(!s){const t=new n.Modal(this.app);t.titleEl.setText(e),t.contentEl.innerHTML=`Changes not saved. The following regex contain errors:

${i}`,t.open()}return s}}class se extends _{display(e){const{config:t}=this;this.addSectionTitle(e,"Symbol List Mode Settings"),this.addTextSetting(e,"Symbol list mode trigger","Character that will trigger symbol list mode in the switcher. This triggers a display of Symbols for the source file of the currently selected (highlighted) suggestion in the switcher. If there is not a suggestion, display results for the active editor.",t.symbolListCommand,"symbolListCommand",t.symbolListPlaceholderText),this.addTextSetting(e,"Symbol list mode trigger - Active editor only","Character that will trigger symbol list mode in the switcher. This always triggers a display of Symbols for the active editor only.",t.symbolListActiveEditorCommand,"symbolListActiveEditorCommand",t.symbolListActiveEditorCommand),this.addToggleSetting(e,"List symbols as indented outline","Enabled, symbols will be displayed in the (line) order they appear in the source text, indented under any preceding heading. Disabled, symbols will be grouped by type: Headings, Tags, Links, Embeds.",t.symbolsInLineOrder,"symbolsInLineOrder"),this.addToggleSetting(e,"Open Symbols in new tab","Enabled, always open a new tab when navigating to Symbols. Disabled, navigate in an already open tab (if one exists).",t.alwaysNewTabForSymbols,"alwaysNewTabForSymbols"),this.addToggleSetting(e,"Open Symbols in active tab on mobile devices","Enabled, navigate to the target file and symbol in the active editor tab. Disabled, open a new tab when navigating to Symbols, even on mobile devices.",t.useActiveTabForSymbolsOnMobile,"useActiveTabForSymbolsOnMobile"),this.addToggleSetting(e,"Auto-select nearest heading","Enabled, in an unfiltered symbol list, select the closest preceding Heading to the current cursor position. Disabled, the first symbol in the list is selected.",t.selectNearestHeading,"selectNearestHeading"),this.showEnableSymbolTypesToggle(e,t),this.showEnableLinksToggle(e,t)}showEnableSymbolTypesToggle(e,t){[["Show Headings",s.Heading],["Show Tags",s.Tag],["Show Embeds",s.Embed],["Show Callouts",s.Callout]].forEach((([s,i])=>{this.addToggleSetting(e,s,"",t.isSymbolTypeEnabled(i),null,(e=>{t.setSymbolTypeEnabled(i,e),t.save()}))}))}showEnableLinksToggle(e,t){const n=t.isSymbolTypeEnabled(s.Link);if(this.addToggleSetting(e,"Show Links","",n,null,(e=>{t.setSymbolTypeEnabled(s.Link,e),t.saveSettings().then((()=>{this.mainSettingsTab.display()}),(e=>console.log('Switcher++: error saving "Show Links" setting. ',e)))})),n){[["Links to headings",i.Heading],["Links to blocks",i.Block]].forEach((([s,i])=>{const n=(t.excludeLinkSubTypes&i)===i;this.addToggleSetting(e,s,"",!n,null,(e=>this.saveEnableSubLinkChange(i,e))).setClass("qsp-setting-item-indent")}))}}saveEnableSubLinkChange(e,t){const{config:s}=this;let i=s.excludeLinkSubTypes;t?i&=~e:i|=e,s.excludeLinkSubTypes=i,s.save()}}class ie extends _{display(e){const{config:t}=this,s=this.addSectionTitle(e,"Vault List Mode Settings");s.nameEl?.createSpan({cls:["qsp-tag","qsp-warning"],text:"Experimental"}),this.addTextSetting(e,"Vault list mode trigger","Character that will trigger vault list mode in the switcher",t.vaultListCommand,"vaultListCommand",t.vaultListPlaceholderText)}}class ne extends n.PluginSettingTab{constructor(e,t,s){super(e,t),this.plugin=t,this.config=s}display(){const{containerEl:e}=this,t=[Y,se,te,ee,X,G,J,Z,ie];e.empty(),e.createEl("h2",{text:"Quick Switcher++ Settings"}),t.forEach((e=>{this.displayTabSection(e)}))}displayTabSection(e){const{app:t,config:s,containerEl:i}=this;new e(t,this,s).display(i)}}class ae{static get defaultParsedCommand(){return{isValidated:!1,index:-1,parsedInput:null}}get parsedInputQuery(){const e=(this.parsedCommand()?.parsedInput??"").trim().toLowerCase();return{query:e,hasSearchTerm:!!e.length}}get inputTextSansEscapeChar(){return this._inputTextSansEscapeChar??this.inputText}set inputTextSansEscapeChar(e){this._inputTextSansEscapeChar=e}constructor(e="",s=t.Standard,i){this.inputText=e,this.mode=s,this._inputTextSansEscapeChar=null,this.currentWorkspaceEnvList={openWorkspaceLeaves:new Set,openWorkspaceFiles:new Set,fileBookmarks:new Map,nonFileBookmarks:new Set,mostRecentFiles:new Set,attachmentFileExtensions:new Set},this.sessionOpts=i??{};const n={...ae.defaultParsedCommand,source:null},a={...ae.defaultParsedCommand,source:null},o={};this.parsedCommands=o,o[t.SymbolList]=n,o[t.RelatedItemsList]=a,[t.Standard,t.EditorList,t.WorkspaceList,t.HeadingsList,t.BookmarksList,t.CommandList,t.VaultList].forEach((e=>{o[e]=ae.defaultParsedCommand}))}parsedCommand(e){return e=e??this.mode,this.parsedCommands[e]}}class oe{constructor(e,t){this.app=e,this.settings=t}reset(){}onNoResultsCreateAction(e,t){return!1}getFacets(e){if(!this.facets){const t=this.settings?.quickFilters?.facetList;t&&(this.facets=Object.values(t).filter((t=>t.mode===e)))}return this.facets??[]}getAvailableFacets(e){return this.getFacets(e.mode).filter((e=>e.isAvailable))}activateFacet(e,t){e.forEach((e=>e.isActive=t)),this.settings.quickFilters.shouldResetActiveFacets||this.settings.save()}getActiveFacetIds(e){const t=this.getAvailableFacets(e).filter((e=>e.isActive)).map((e=>e.id));return new Set(t)}isFacetedWith(e,t){const s=!!e.size;return s&&e.has(t)||!s}getEditorInfo(e){const{excludeViewTypes:t}=this.settings;let s=null,i=!1,n=null;if(e){s=F(e),n=this.getCursorPosition(e);i=!t.includes(e.view.getViewType())&&!!s}return{isValidSource:i,leaf:e,file:s,suggestion:null,cursor:n}}getSuggestionInfo(e){const t=this.getSourceInfoFromSuggestion(e);let s=t.leaf;t.isValidSource&&({leaf:s}=this.findMatchingLeaf(t.file,t.leaf));const i=this.getCursorPosition(s);return{...t,leaf:s,cursor:i}}getSourceInfoFromSuggestion(e){let t=null,s=null;const i=[l.SymbolList,l.Unresolved,l.WorkspaceList,l.CommandList,l.VaultList];e&&!i.includes(e.type)&&(t=e.file),h(e,"type",l.EditorList)&&(s=e.item);return{isValidSource:!!t,leaf:s,file:t,suggestion:e}}getCursorPosition(e){let t=null;if(function(e,t){return e?.view?.getViewType()===t&&!e.isDeferred}(e,"markdown")){const s=e.view;"preview"!==s.getMode()&&(t=s.editor.getCursor("head"))}return t}getTitleText(e){const t=function(e){let t=null;if(e){const{path:s}=e;if(t=s,"md"===e.extension){const e=s.lastIndexOf(".");-1!==e&&e!==s.length-1&&0!==e&&(t=s.slice(0,e))}}return t}(e),s=this.getFirstH1(e);return s?.heading??t}getFirstH1(e){return oe.getFirstH1(e,this.app.metadataCache)}static getFirstH1(e,t){let s=null;const i=t.getFileCache(e)?.headings?.filter((e=>1===e.level))??[];return i.length&&(s=i.reduce(((e,t)=>{const{line:s}=t.position.start;return s{let o=!1;if(i?.view){const r=a.includes(i.view.getViewType()),l=s||!r,d=n&&a.includes(t.view.getViewType());l&&(o=!n||!s&&d?F(i)===e:i===t)}return o},d=this.getActiveLeaf();if(l(d))i=d;else{const e=this.getOpenLeaves(o,r);i=[t,...e].find(l)}return{leaf:i??null,file:e,suggestion:null,isValidSource:!1}}extractTabNavigationType(e,t,s){const i=e?.shiftKey?"horizontal":"vertical",a=e?.key;let o=n.Keymap.isModEvent(e)??!1;return!0!==o&&"tab"!==o||("o"===a?o="window":"\\"===a&&(o="split")),o=this.applyTabCreationPreferences(o,t,s),{navType:o,splitDirection:i}}applyTabCreationPreferences(e,s=!1,i){let a=e;const{onOpenPreferNewTab:o,alwaysNewTabForSymbols:r,useActiveTabForSymbolsOnMobile:l}=this.settings;return!1===e&&(o?a=!s:i===t.SymbolList&&(a=n.Platform.isMobile?!l:r)),a}isMainPanelLeaf(e){const{workspace:t}=this.app,s=e?.getRoot();return s===t.rootSplit||s===t.floatingSplit}async activateLeaf(e,t){const{workspace:s}=this.app;try{await s.revealLeaf(e),s.setActiveLeaf(e,{focus:!0}),e.view.setEphemeralState({focus:!0,...t})}catch(t){const s=e?.getDisplayText();console.log(`Switcher++: error activating WorkspaceLeaf with title: ${s}`,t)}}getOpenLeaves(e,t,s){const i=[];return this.app.workspace.iterateAllLeaves((s=>{const n=s?.view?.getViewType();this.isMainPanelLeaf(s)?e?.includes(n)||i.push(s):t?.includes(n)&&i.push(s)})),s?.orderByAccessTime&&i.sort(((e,t)=>{const s=e?.activeTime??0;return(t?.activeTime??0)-s})),i}async openFileInLeaf(e,t,s,i="vertical"){const{workspace:n}=this.app,a="split"===t?n.getLeaf(t,i):n.getLeaf(t);await a.openFile(e,s)}navigateToLeafOrOpenFile(e,t,s,i,n,a,o=!1){this.navigateToLeafOrOpenFileAsync(e,t,i,n,a,o).catch((e=>{console.log(`Switcher++: error navigating to open file. ${s}`,e)}))}async navigateToLeafOrOpenFileAsync(e,t,s,i,n,a=!1){const{leaf:o}=this.findMatchingLeaf(t,i,a),r=!!o,{navType:l,splitDirection:d}=this.extractTabNavigationType(e,r,n);await this.activateLeafOrOpenFile(l,t,o,s,d)}async activateLeafOrOpenFile(e,t,s,i,n){if(i=i??{active:!0,eState:{active:!0,focus:!0}},s&&!1===e){const e=i?.eState;await this.activateLeaf(s,e)}else await this.openFileInLeaf(t,e,i,n)}renderPath(t,s,i,a,o){if(t&&s){const r=s.parent.isRoot();let l=this.settings.pathDisplayFormat,d=l===e.None||r&&this.settings.hidePathIfRoot;if(o&&(l=e.FolderPathFilenameOptional,d=!1),!d){const e=t.createDiv({cls:["suggestion-note","qsp-note"]}),o=this.getPathDisplayText(s,l,i),r=e.createSpan({cls:["qsp-path-indicator"]});n.setIcon(r,"folder");const d=e.createSpan({cls:"qsp-path"});n.renderResults(d,o,a)}}}getPathDisplayText(t,s,i){let a="";if(t){const{parent:o}=t,r=o.name,l=o.isRoot(),d=this.app.vault.getRoot().path;switch(s){case e.FolderWithFilename:a=l?`${t.name}`:n.normalizePath(`${r}/${t.name}`);break;case e.FolderOnly:a=l?d:r;break;case e.Full:a=t.path;break;case e.FolderPathFilenameOptional:i?(a=o.path,l||(a+=d)):a=this.getPathDisplayText(t,e.Full)}}return a}renderContent(e,t,s,i){const{contentEl:a,titleEl:o}=oe.createContentStructureElements(e);return n.renderResults(o,t,s,i),a}static createContentStructureElements(e){const t=e.createDiv({cls:["suggestion-content","qsp-content"]}),s=t.createDiv({cls:["suggestion-title","qsp-title"]});return{contentEl:t,titleEl:s}}static renderMarkdownContentAsync(e,t,s,i){oe.renderMarkdownContent(e,t,s,i,M.getRootComponent()).catch((e=>{console.log("Switcher++: error rendering markdown to html. ",e,`content: ${s}`)}))}static async renderMarkdownContent(e,t,s,i,a){const o=t.createSpan({cls:["qsp-rendered-container"]});if(await n.MarkdownRenderer.render(e,s,o,i,a),1===o.childNodes.length&&"P"===o.firstChild.nodeName){const e=o.firstChild;e.replaceWith(...Array.from(e.childNodes))}return o}addClassesToSuggestionContainer(e,t){const s=["mod-complex"];t&&s.push(...t),e?.addClasses(s)}splitSearchMatchesAtBasename(e,t){let s=null,i=null;const n=(e,t)=>{e.forEach((e=>{e[0]-=t,e[1]-=t}))};if(e&&t?.matches){const a=e.path.lastIndexOf(e.basename);if(a>=0){const{matches:e,score:o}=t,r=e[0][0],l=e[e.length-1][1];if(r>=a)s=t,n(s.matches,a);else if(l<=a)i=t;else{let t=e.length;for(;t--;){const r=e[t][0],l=t+1;if(e[t][1]<=a){i={score:o,matches:e.slice(0,l)},s={score:o,matches:e.slice(l)},n(s.matches,a);break}if(r{t=t??o;let s=0;return Object.prototype.hasOwnProperty.call(t,e)&&(s=Number(t[e]?.value)),isNaN(s)?0:s},h=(t,s)=>{let i=0;return(null!==t&&t===n||e[s])&&(i=c(s)),i};d+=h(l.Bookmark,"isBookmarked"),d+=h(l.EditorList,"isOpenInEditor"),d+=h(null,"isRecent"),d+=h(null,"isAttachment"),d+=c(a?.extension,r),u(e)&&(d+=c(`h${e.item?.level}`));const m=n.toString();d+=c(m),i.score+=Math.abs(i.score)/100*(100*d)}}return e}static updateWorkspaceEnvListStatus(e,t){if(e&&t?.file){const{file:s}=t;t.isOpenInEditor=e.openWorkspaceFiles?.has(s),t.isRecent=e.mostRecentFiles?.has(s),t.isBookmarked=e.fileBookmarks?.has(s),t.isAttachment=e.attachmentFileExtensions?.has(s.extension)}return t}renderFileCreationSuggestion(e,t){this.addClassesToSuggestionContainer(e);const s=this.renderContent(e,t,null),i=this.createFlairContainer(e);return i?.createSpan({cls:"suggestion-hotkey",text:"Enter to create"}),s}createFile(e,t){const{workspace:s}=this.app,{navType:i}=this.extractTabNavigationType(t),a=s.getActiveViewOfType(n.FileView);let o="";a?.file&&(o=a.file.path),s.openLinkText(e,o,i,{active:!0}).catch((e=>{console.log("Switcher++: error creating new file. ",e)}))}}class re{constructor(e,t){this.useSimpleSearch=t,this.query=(e??"").trim().toLowerCase(),this.hasSearchTerm=!!this.query.length}static create(e,t=!1){return new re(e,t)}searchWithFallback(e,t){let s,i=d.None,n=null,a=this.searchAndDownrankSecondaryMatch(e);if(a.match)n=a.match,i=d.Primary,s=e;else if(t){const{basename:e,path:o}=t;a=this.searchAndDownrankSecondaryMatch(e,o),a.isPrimary?(i=d.Basename,s=e):a.match&&(i=d.Path,s=o),n=a.match}return{matchType:i,matchText:s,match:n}}searchAndDownrankSecondaryMatch(e,t){let s=!1,i=null;return e&&(i=this.executeSearch(e),s=!!i),!i&&t&&(i=this.executeSearch(t),i&&(i.score-=1)),{isPrimary:s,match:i}}executeSearch(e){const t=this.getSearchDelegate();return t?t(e):null}getSearchDelegate(){if(!this._searchDelegate){const{query:e,useSimpleSearch:t}=this;this._searchDelegate=t?n.prepareSimpleSearch(e):n.prepareFuzzySearch(e)}return this._searchDelegate}}class le extends oe{getCommandString(e){return this.settings?.workspaceListCommand}validateCommand(e,s,i,n,a){const o=e.parsedCommand(t.WorkspaceList);return this.getEnabledWorkspacesPluginInstance()&&(e.mode=t.WorkspaceList,o.index=s,o.parsedInput=i,o.isValidated=!0),o}getSuggestions(e){const t=[];if(e){const{query:s,hasSearchTerm:i}=e.parsedInputQuery,a=re.create(s);this.getItems().forEach((e=>{let s=!0,n=null;i&&(({match:n}=a.searchWithFallback(e.id)),s=!!n),s&&t.push({type:l.WorkspaceList,item:e,match:n})})),i&&n.sortSearchResults(t)}return t}renderSuggestion(e,t){let s=!1;return e&&(this.addClassesToSuggestionContainer(t,["qsp-suggestion-workspace"]),this.renderContent(t,e.item.id,e.match),s=!0),s}onChooseSuggestion(e,t){let s=!1;if(e){const{id:t}=e.item,i=this.getEnabledWorkspacesPluginInstance();i&&i.loadWorkspace(t),s=!0}return s}onNoResultsCreateAction(e,s){const i=this.getEnabledWorkspacesPluginInstance();if(i){const s=e.parsedCommand(t.WorkspaceList)?.parsedInput;i.saveWorkspace(s),i.setActiveWorkspace(s)}return!0}getItems(){const e=[],t=this.getEnabledWorkspacesPluginInstance()?.workspaces;return t&&Object.keys(t).forEach((t=>e.push({id:t,type:"workspaceInfo"}))),e.sort(((e,t)=>e.id.localeCompare(t.id)))}getEnabledWorkspacesPluginInstance(){return L(this.app,"workspaces")}}class de extends oe{getCommandString(e){return""}validateCommand(e,t,s,i,n){throw new Error("Method not implemented.")}getSuggestions(e){throw new Error("Method not implemented.")}renderSuggestion(e,t){let s=!1;return s=g(e)?this.renderFileSuggestion(e,t):this.renderAliasSuggestion(e,t),e?.downranked&&t.addClass("mod-downranked"),s}onChooseSuggestion(e,t){let s=!1;if(e){const{file:i}=e;this.navigateToLeafOrOpenFile(t,i,`Unable to open file from SystemSuggestion ${i.path}`),s=!0}return s}renderFileSuggestion(e,t){let s=!1;if(e){const{file:i,matchType:n,match:a}=e;this.renderAsFileInfoPanel(t,["qsp-suggestion-file"],null,i,n,a),this.renderOptionalIndicators(t,e),s=!0}return s}renderAliasSuggestion(e,t){let s=!1;if(e){const{file:i,matchType:n,match:a}=e;this.renderAsFileInfoPanel(t,["qsp-suggestion-alias"],e.alias,i,n,a,!1);const o=this.renderOptionalIndicators(t,e);this.renderIndicator(o,["qsp-alias-indicator"],"lucide-forward"),s=!0}return s}addPropertiesToStandardSuggestions(e,t){const{match:s,file:i}=t,n=s?.matches;let a=d.None,o=null;n&&(p(t)?(a=d.Primary,o=t.alias):(a=d.Path,o=i?.path)),t.matchType=a,t.matchText=o,oe.updateWorkspaceEnvListStatus(e.currentWorkspaceEnvList,t)}static createUnresolvedSuggestion(e,t,s,i){const n={linktext:e,type:l.Unresolved,...t};return oe.applyMatchPriorityPreferences(n,s,i)}}class ce extends oe{getCommandString(e){return this.settings?.editorListCommand}validateCommand(e,s,i,n,a){e.mode=t.EditorList;const o=e.parsedCommand(t.EditorList);return o.index=s,o.parsedInput=i,o.isValidated=!0,o}getSuggestions(e){const t=[];if(e){const{query:s,hasSearchTerm:i}=e.parsedInputQuery,a=re.create(s);this.getItems().forEach((s=>{const n=F(s);let o=!0,r={matchType:d.None,match:null};const l=this.getPreferredTitle(s,this.settings.preferredSourceForTitle);i&&(r=a.searchWithFallback(l,n),o=r.matchType!==d.None),o&&t.push(this.createSuggestion(e.currentWorkspaceEnvList,s,n,r,l))})),i&&n.sortSearchResults(t)}return t}getPreferredTitle(e,t){return ce.getPreferredTitle(e,t,this.app.metadataCache)}static getPreferredTitle(e,t,s){const{view:i}=e,n=i?.file;let a=e.getDisplayText();if("H1"===t&&n){const e=ce.getFirstH1(n,s);e&&(a=a.replace(n.basename,e.heading))}return a}getItems(){const{excludeViewTypes:e,includeSidePanelViewTypes:t,orderEditorListByAccessTime:s}=this.settings;return this.getOpenLeaves(e,t,{orderByAccessTime:s})}renderSuggestion(e,t){let s=!1;if(e){const{file:i,matchType:n,match:a}=e,o=[d.None,d.Primary].includes(n);this.renderAsFileInfoPanel(t,["qsp-suggestion-editor"],e.preferredTitle,i,n,a,o),this.renderOptionalIndicators(t,e),s=!0}return s}onChooseSuggestion(e,t){let s=!1;return e&&(this.navigateToLeafOrOpenFile(t,e.file,"Unable to reopen existing editor in new Leaf.",null,e.item,null,!0),s=!0),s}createSuggestion(e,t,s,i,n){return ce.createSuggestion(e,t,s,this.settings,this.app.metadataCache,n,i)}static createSuggestion(e,t,s,i,n,a,o){o=o??{matchType:d.None,match:null,matchText:null};let r={item:t,file:s,preferredTitle:a=a??null,type:l.EditorList,...o};return r=oe.updateWorkspaceEnvListStatus(e,r),oe.applyMatchPriorityPreferences(r,i,n)}}class he extends oe{getCommandString(e){return this.settings?.bookmarksListCommand}validateCommand(e,s,i,n,a){const o=e.parsedCommand(t.BookmarksList);return this.getEnabledBookmarksPluginInstance()&&(e.mode=t.BookmarksList,o.index=s,o.parsedInput=i,o.isValidated=!0),o}getSuggestions(e){const t=[];if(e){const{query:s,hasSearchTerm:i}=e.parsedInputQuery,a=re.create(s),{allBookmarks:o}=this.getItems(e);o.forEach((s=>{let n=!0,o={matchType:d.None,match:null};i&&(o=a.searchWithFallback(s.bookmarkPath),n=o.matchType!==d.None),n&&t.push(this.createSuggestion(e.currentWorkspaceEnvList,s,o))})),i&&n.sortSearchResults(t)}return t}renderSuggestion(e,t){return!1}onChooseSuggestion(e,t){return!1}getPreferredTitle(e,t,s,i){let n=e.getItemTitle(t);if("H1"===i&&s){const e=this.getFirstH1(s);e&&(n=n.replace(/^[^#]*/,e.heading))}return n}getItems(e){const t=[],s=new Map,i=new Set,n=this.getEnabledBookmarksPluginInstance();if(n){const a=e?this.getActiveFacetIds(e):new Set,o=(e,r)=>{e?.forEach((e=>{if(he.isBookmarksPluginGroupItem(e))o(e.items,`${r}${e.title}/`);else if(this.isFacetedWith(a,D[e.type])){let a;if(he.isBookmarksPluginFileItem(e)){const t=this.getTFileByPath(e.path);if(t){a={item:e,bookmarkPath:null,file:t};const i=s.get(t)??[];i.push(a),s.set(t,i)}}else a={item:e,bookmarkPath:null,file:null},i.add(a);if(a){const s=this.getPreferredTitle(n,e,a.file,this.settings.preferredSourceForTitle);a.bookmarkPath=r+s,t.push(a)}}}))};o(n.items,"")}return{allBookmarks:t,fileBookmarks:s,nonFileBookmarks:i}}getEnabledBookmarksPluginInstance(){return L(this.app,"bookmarks")}createSuggestion(e,t,s){return he.createSuggestion(e,t,this.settings,this.app.metadataCache,s)}static createSuggestion(e,t,s,i,n){let a={type:l.Bookmark,item:t.item,bookmarkPath:t.bookmarkPath,file:t.file,...n};return a=oe.updateWorkspaceEnvListStatus(e,a),oe.applyMatchPriorityPreferences(a,s,i)}static isBookmarksPluginFileItem(e){return h(e,"type","file")}static isBookmarksPluginGroupItem(e){return h(e,"type","group")}}class me extends oe{getCommandString(e){return this.settings?.headingsListCommand}validateCommand(e,s,i,n,a){e.mode=t.HeadingsList;const o=e.parsedCommand(t.HeadingsList);return o.index=s,o.parsedInput=i,o.isValidated=!0,o}onChooseSuggestion(e,t){let s=!1;if(e){const{start:{line:i,col:n},end:a}=e.item.position,o={active:!0,focus:!0,startLoc:{line:i,col:n},endLoc:a,line:i,cursor:{from:{line:i,ch:n},to:{line:i,ch:n}}};this.navigateToLeafOrOpenFile(t,e.file,"Unable to navigate to heading for file.",{active:!0,eState:o}),s=!0}return s}renderSuggestion(e,t){let s=!1;if(e){const{item:i,file:n,match:a}=e,{app:o,settings:l}=this;this.addClassesToSuggestionContainer(t,["qsp-suggestion-headings",`qsp-headings-l${i.level}`]);const{contentEl:d,titleEl:c}=oe.createContentStructureElements(t);me.renderHeadingContent(o,l,c,i,n,a),this.renderPath(d,n);const h=this.createFlairContainer(t);this.renderOptionalIndicators(t,e,h),this.renderIndicator(h,["qsp-headings-indicator"],null,r[i.level]),e.downranked&&t.addClass("mod-downranked"),s=!0}return s}static renderHeadingContent(e,t,s,i,a,o,r){const{heading:l}=i,{renderMarkdownContentInSuggestions:{isEnabled:d,renderHeadings:c}}=t;(r=r??(d&&c))?oe.renderMarkdownContentAsync(e,s,l,a.path):n.renderResults(s,l,o)}getAvailableFacets(e){const{settings:{shouldSearchHeadings:t,shouldSearchBookmarks:s,shouldSearchFilenames:i,shouldSearchRecentFiles:n,builtInSystemOptions:{showAttachments:a,showAllFileTypes:o}}}=this,r=a||o,l={[q.RecentFiles]:n,[q.Bookmarks]:s,[q.Filenames]:i,[q.Headings]:t,[q.ExternalFiles]:r};return this.getFacets(e.mode).filter((e=>(Object.prototype.hasOwnProperty.call(l,e.id)&&(e.isAvailable=l[e.id]),e.isAvailable)))}getSuggestions(e){let t=[];if(e){const{hasSearchTerm:s}=e.parsedInputQuery,{settings:i}=this,a=this.getActiveFacetIds(e),o=!!a.size;if(s||o){const{limit:s}=i,{app:{vault:o}}=this,r={headings:i.shouldSearchHeadings,allHeadings:i.searchAllHeadings,aliases:i.shouldShowAlias,bookmarks:i.shouldSearchBookmarks,filename:i.shouldSearchFilenames,filenameAsFallback:!i.strictHeadingsOnly,unresolved:!i.showExistingOnly};this.getItems([o.getRoot()],e,t,a,r),n.sortSearchResults(t),s>0&&t.length>s&&(t=t.slice(0,s))}else this.getSuggestionsForEditorsAndRecentFiles(e,t,new Set,{editors:!0,recentFiles:i.shouldSearchRecentFiles})}return t}getItems(e,t,s,i,n){const a=!!i.size,o=re.create(t.parsedInputQuery.query);this.getSuggestionsForEditorsAndRecentFiles(t,s,i,{editors:!1,recentFiles:!1});const r={fileBookmarks:n.bookmarks,nonFileBookmarks:n.bookmarks};this.getSuggestionsForBookmarks(t,o,s,i,r);const l={headings:n.headings,allHeadings:n.allHeadings,aliases:n.aliases,filename:n.filename,filenameAsFallback:n.filenameAsFallback};this.getSuggestionForFiles(t,o,e,s,i,l),n.unresolved&&!a&&this.addUnresolvedSuggestions(s,o)}getSuggestionsForBookmarks(e,t,s,i,n){const a=!!i.size,{fileBookmarks:o,nonFileBookmarks:r}=e.currentWorkspaceEnvList;if(a){const e=i.has(q.Bookmarks);n=Object.assign(n,{fileBookmarks:e,nonFileBookmarks:e})}const l=i=>{for(const n of i)this.addBookmarkSuggestion(e,s,t,n)};n.fileBookmarks&&o.forEach((e=>{l(e)})),n.nonFileBookmarks&&l(r)}getSuggestionForFiles(e,t,s,i,n,a){if(!!n.size){const e=this.isFacetedWith(n,q.Headings),t=this.isFacetedWith(n,q.ExternalFiles)||this.isFacetedWith(n,q.Filenames);let s=!1,i=!1;e&&(s=!0===a.allHeadings,i=!0===a.filenameAsFallback),a=Object.assign(a,{headings:e,aliases:!1,filename:t,allHeadings:s,filenameAsFallback:i})}else a=Object.assign({headings:!0,allHeadings:!0,aliases:!0,filename:!0,filenameAsFallback:!0},a);if([a.headings,a.aliases,a.filename].some((e=>!0===e))){const{excludeFolders:o}=this.settings,r=I(o);let l=Array.prototype.concat(s);for(;l.length>0;){const s=l.pop();k(s)?this.shouldIncludeFile(s,n)&&this.addSuggestionsForFile(e,t,i,s,a):r(s.path)||(l=l.concat(s.children))}}}addSuggestionsForFile(e,t,s,i,n){let a=!1;n.headings&&(a=this.addHeadingSuggestions(e,t,s,i,n.allHeadings)),(n.filename||!a&&n.filenameAsFallback)&&this.addFileSuggestions(e,t,s,i),n.aliases&&this.addAliasSuggestions(e,t,s,i)}shouldIncludeFile(e,t=new Set){let s=!1;if(e){const i=new Set(["md","canvas"]),{extension:n}=e,{app:{viewRegistry:a,metadataCache:o},settings:{excludeObsidianIgnoredFiles:r,fileExtAllowList:l,builtInSystemOptions:{showAttachments:d,showAllFileTypes:c}}}=this;if(!(r&&o.isUserIgnored(e.path)))if(t.has(q.ExternalFiles)){const e=d||c;s=!i.has(n)&&e}else{s=this.isExternalFileTypeAllowed(e,a,d,c,l)||i.has(n)}}return s}isExternalFileTypeAllowed(e,t,s,i,n){const{extension:a}=e;let o=t.isExtensionRegistered(a)?s:i;if(!o){o=new Set(n).has(a)}return o}addAliasSuggestions(e,t,s,i){const{metadataCache:n}=this.app,a=n.getFileCache(i)?.frontmatter;if(a){const n=P.getAliases(a);let o=n.length;for(;o--;){const a=n[o],{match:r}=t.searchWithFallback(a);r&&s.push(this.createAliasSuggestion(e,a,i,r))}}}addFileSuggestions(e,t,s,i){const{match:n,matchType:a,matchText:o}=t.searchWithFallback(null,i);n&&s.push(this.createFileSuggestion(e,i,n,a,o))}addBookmarkSuggestion(e,t,s,i){const n=s.searchWithFallback(i.bookmarkPath);if(n.match){const s=he.createSuggestion(e.currentWorkspaceEnvList,i,this.settings,this.app.metadataCache,n);t.push(s)}}addHeadingSuggestions(e,t,s,i,n){const{metadataCache:a}=this.app,o=a.getFileCache(i)?.headings??[];let r=null,l=!1,d=o.length;for(;d--;){const a=o[d];let c=!1;if(n&&(c=this.matchAndPushHeading(e,t,s,i,a)),1===a.level){const{line:e}=a.position.start;(null===r||e{this.addOpenEditorSuggestions(s,e,a,t)}))}if(i.recentFiles){const i=e.currentWorkspaceEnvList?.mostRecentFiles;i?.forEach((i=>{this.shouldIncludeFile(i,s)&&this.addRecentFilesSuggestions(i,e,a,t)}))}}onNoResultsCreateAction(e,s){const i=e.parsedCommand(t.HeadingsList)?.parsedInput;return this.createFile(i,s),!0}}const ue={file:"lucide-file-text",text:"lucide-sticky-note",link:"lucide-globe",group:"create-group"};class ge extends oe{getCommandString(e){const{settings:t}=this;return e?.useActiveEditorAsSource?t.symbolListActiveEditorCommand:t.symbolListCommand}validateCommand(e,s,i,n,a){const o=e.parsedCommand(t.SymbolList),r=this.getSourceInfoForSymbolOperation(n,a,0===s,e.sessionOpts);return r&&(e.mode=t.SymbolList,o.source=r,o.index=s,o.parsedInput=i,o.isValidated=!0),o}async getSuggestions(e){const s=[];if(e){this.inputInfo=e;const{query:i,hasSearchTerm:a}=e.parsedInputQuery,o=re.create(i),r=e.parsedCommand(t.SymbolList);(await this.getItems(r.source,a)).forEach((e=>{let t=!0,i=null;if(a){const s=ge.getSuggestionTextForSymbol(e);({match:i}=o.searchWithFallback(s)),t=!!i}if(t){const{file:t}=r.source;s.push({type:l.SymbolList,file:t,item:e,match:i})}})),a&&n.sortSearchResults(s)}return s}renderSuggestion(e,t){let s=!1;if(e){const{item:i,file:a,match:o}=e,r=["qsp-suggestion-symbol"];Object.prototype.hasOwnProperty.call(i,"indentLevel")&&this.settings.symbolsInLineOrder&&!this.inputInfo?.parsedInputQuery?.hasSearchTerm&&r.push(`qsp-symbol-l${i.indentLevel}`),this.addClassesToSuggestionContainer(t,r);const{titleEl:l}=oe.createContentStructureElements(t);if(b(i.symbol))me.renderHeadingContent(this.app,this.settings,l,i.symbol,a,o);else{const e=ge.getSuggestionTextForSymbol(i);n.renderResults(l,e,o)}this.addSymbolIndicator(i,t),s=!0}return s}onChooseSuggestion(e,i){let n=!1;if(e){const a=this.inputInfo.parsedCommand(),{leaf:o,file:r}=a.source,l={active:!0},{item:d}=e;d.symbolType!==s.CanvasNode&&(l.eState=this.constructMDFileNavigationState(d).eState),this.navigateToLeafOrOpenFileAsync(i,r,l,o,t.SymbolList).then((()=>{const{symbol:e}=d;ge.isCanvasSymbolPayload(d,e)&&this.zoomToCanvasNode(this.getActiveLeaf().view,e)}),(e=>{console.log(`Switcher++: Unable to navigate to symbols for file ${r.path}`,e)})),n=!0}return n}reset(){this.inputInfo=null}getAvailableFacets(e){const i=e.parsedCommand(t.SymbolList),n=ge.isCanvasFile(i?.source?.file),a=this.getFacets(e.mode),o=new Set(Object.values(R)),r=new Set(Object.values(s).filter((e=>isNaN(Number(e)))));return a.forEach((e=>{const{id:t}=e;e.isAvailable=n?o.has(t):r.has(t)})),a.filter((e=>e.isAvailable))}zoomToCanvasNode(e,t){if(ge.isCanvasView(e)&&t){const s=e.canvas,i=s.nodes.get(t.id);s.selectOnly(i),s.zoomToSelection()}}constructMDFileNavigationState(e){const{start:{line:t,col:s},end:i}=e.symbol.position;return{eState:{active:!0,focus:!0,startLoc:{line:t,col:s},endLoc:i,line:t,cursor:{from:{line:t,ch:s},to:{line:t,ch:s}}}}}getSourceInfoForSymbolOperation(e,s,i,n){const a=this.inputInfo;let o=null,r=t.Standard;a&&(o=a.parsedCommand().source,r=a.mode);const l=r===t.SymbolList&&!!o,d=this.getEditorInfo(s),c=this.getSuggestionInfo(e);let h=null;return l?h=o:c.isValidSource&&!n.useActiveEditorAsSource?h=c:d.isValidSource&&i&&(h=d),h}async getItems(e,t){let s=[],i=!1,n=!1;return t||({selectNearestHeading:n,symbolsInLineOrder:i}=this.settings),s=await this.getSymbolsFromSource(e,i),n&&ge.FindNearestHeadingSymbol(s,e),s}static FindNearestHeadingSymbol(e,t){const s=t?.cursor?.line;if(s){let t=null;const i=e.filter((e=>b(e.symbol)));i.length&&(t=i.reduce(((e,t)=>{const{line:i}=t.symbol.position.start;return i>(e?e.symbol.position.start.line:-1)&&i<=s?t:e}))),t&&(t.isSelected=!0)}}async getSymbolsFromSource(e,t){const{app:{metadataCache:i},inputInfo:n}=this,a=[];if(e?.file){const{file:o}=e,r=this.getActiveFacetIds(n);if(ge.isCanvasFile(o))await this.addCanvasSymbolsFromSource(o,a,r);else{const e=i.getFileCache(o);if(e){const i=(e=[],t)=>{this.shouldIncludeSymbol(t,r)&&e.forEach((e=>a.push({type:"symbolInfo",symbol:e,symbolType:t})))};i(e.headings,s.Heading),i(e.tags,s.Tag),this.addLinksFromSource(e.links,a,r),i(e.embeds,s.Embed),await this.addCalloutsFromSource(o,e.sections?.filter((e=>"callout"===e.type)),a,r),t&&ge.orderSymbolsByLineNumber(a)}}}return a}shouldIncludeSymbol(e,t){let i=!1;return i="string"==typeof e?this.isFacetedWith(t,e):this.settings.isSymbolTypeEnabled(e)&&this.isFacetedWith(t,s[e]),i}async addCanvasSymbolsFromSource(e,t,i){let n;try{const t=await this.app.vault.cachedRead(e);n=JSON.parse(t).nodes}catch(t){console.log(`Switcher++: error reading file to extract canvas node information. ${e.path} `,t)}Array.isArray(n)&&n.forEach((e=>{this.shouldIncludeSymbol(R[e.type],i)&&t.push({type:"symbolInfo",symbolType:s.CanvasNode,symbol:{...e}})}))}async addCalloutsFromSource(e,t,i,n){const{app:{vault:a}}=this;if(this.shouldIncludeSymbol(s.Callout,n)&&t?.length&&e){let n=null;try{n=await a.cachedRead(e)}catch(t){console.log(`Switcher++: error reading file to extract callout information. ${e.path} `,t)}if(n)for(const e of t){const{start:t,end:a}=e.position,o=n.slice(t.offset,a.offset).match(/^> \[!([^\]]+)\][+-]?(.*?)(?:\n>|$)/);if(o){const t=o[1],n={calloutTitle:o[o.length-1].trim(),calloutType:t,...e};i.push({type:"symbolInfo",symbolType:s.Callout,symbol:n})}}}}addLinksFromSource(e,t,i){const{settings:n}=this;if(e=e??[],this.shouldIncludeSymbol(s.Link,i))for(const i of e){const e=T(i);(n.excludeLinkSubTypes&e)===e||t.push({type:"symbolInfo",symbol:i,symbolType:s.Link})}}static orderSymbolsByLineNumber(e){const t=e.sort(((e,t)=>{const{start:s}=e.symbol.position,{start:i}=t.symbol.position,n=s.line-i.line;return 0===n?s.col-i.col:n}));let s=0;return t.forEach((e=>{let t=0;b(e.symbol)?(s=e.symbol.level,t=e.symbol.level-1):t=s,e.indentLevel=t})),t}static getSuggestionTextForSymbol(e){const{symbol:t}=e;let s;if(b(t))s=t.heading;else if(h(t,"tag"))s=t.tag.slice(1);else if(S(t))s=t.calloutTitle;else if(ge.isCanvasSymbolPayload(e,t))s=ge.getSuggestionTextForCanvasNode(t);else{const e=t;({link:s}=e);const{displayText:i}=e;i&&i!==s&&(s+=`|${i}`)}return s}static getSuggestionTextForCanvasNode(e){let t="";const s={file:()=>e.file,text:()=>e.text,link:()=>e.url,group:()=>e.label}[e?.type];return s&&(t=s()),t}addSymbolIndicator(e,t){const{symbolType:s,symbol:i}=e,a=["qsp-symbol-indicator"],l=this.createFlairContainer(t);if(S(i)){a.push("suggestion-flair","callout","callout-icon","svg-icon");const e=l.createSpan({cls:a,attr:{"data-callout":i.calloutType}}),t=e.getCssPropertyValue("--callout-icon");n.setIcon(e,t)}else if(ge.isCanvasSymbolPayload(e,i)){const e=ue[i.type];this.renderIndicator(l,a,e,null)}else{let e;e=b(i)?r[i.level]:o[s],this.renderIndicator(l,a,null,e)}}static isCanvasSymbolPayload(e,t){return e.symbolType===s.CanvasNode}static isCanvasFile(e){return"canvas"===e?.extension}static isCanvasView(e){return"canvas"===e?.getViewType()}}const pe=[];class fe extends oe{getCommandString(e){return this.settings?.commandListCommand}validateCommand(e,s,i,n,a){const o=e.parsedCommand(t.CommandList);return this.getEnabledCommandPalettePluginInstance()&&(e.mode=t.CommandList,o.index=s,o.parsedInput=i,o.isValidated=!0),o}getSuggestions(e){const t=[];if(e){const{query:s,hasSearchTerm:i}=e.parsedInputQuery,a=re.create(s);this.getItems(e,i).forEach((e=>{let s=!0,n=null;i&&(({match:n}=a.searchWithFallback(e.cmd.name)),s=!!n),s&&t.push(this.createSuggestion(e,n))})),i&&n.sortSearchResults(t)}return t}renderSuggestion(e,t){let s=!1;if(e){const{item:i,match:n,isPinned:a,isRecent:o}=e;this.addClassesToSuggestionContainer(t,["qsp-suggestion-command"]),this.renderContent(t,i.name,n);const r=this.createFlairContainer(t);this.renderHotkeyForCommand(i.id,this.app,r),i.icon&&this.renderIndicator(r,[],i.icon),a?this.renderIndicator(r,[],"filled-pin"):o&&this.renderOptionalIndicators(t,e,r),s=!0}return s}renderHotkeyForCommand(e,t,s){try{const{hotkeyManager:i}=t;if(i.getHotkeys(e)||i.getDefaultHotkeys(e)){const t=i.printHotkeyForCommand(e);t?.length&&s.createEl("kbd",{cls:"suggestion-hotkey",text:t})}}catch(t){console.log("Switcher++: error rendering hotkey for command id: ",e,t)}}onChooseSuggestion(e){let t=!1;if(e){const{item:s}=e;this.app.commands.executeCommandById(s.id),this.saveUsageToList(s.id,pe),t=!0}return t}saveUsageToList(e,t){if(t){const s=t.indexOf(e);s>-1&&t.splice(s,1),t.unshift(e),t.splice(25)}}getItems(e,t){let s=[];const i=this.getActiveFacetIds(e);if(!!i.size)s=this.getPinnedAndRecentCommands(i);else if(t)s=this.getAllCommands();else{const e=this.getPinnedAndRecentCommands(i);s=e.length?e:this.getAllCommands()}return s}getPinnedAndRecentCommands(e){const t=[],s=this.getPinnedCommandIds(),i=this.getRecentCommandIds(),n=e=>{let t=null;const n=this.app.commands.findCommand(e);return n&&(t={isPinned:s.has(e),isRecent:i.has(e),cmd:n}),t},a=(s,i)=>{this.isFacetedWith(e,s)&&i.forEach((e=>{const s=n(e);s&&t.push(s)}))};a(N.Pinned,Array.from(s));const o=this.isFacetedWith(e,N.Pinned),r=Array.from(i).filter((e=>!o||o&&!s.has(e)));return a(N.Recent,r),t}getAllCommands(){const e=this.getPinnedCommandIds(),t=this.getRecentCommandIds();return this.app.commands.listCommands()?.sort(((e,t)=>e.name.localeCompare(t.name))).map((s=>({isPinned:e.has(s.id),isRecent:t.has(s.id),cmd:s})))}getPinnedCommandIds(){const e=this.getEnabledCommandPalettePluginInstance()?.options?.pinned;return new Set(e??[])}getRecentCommandIds(){return new Set(pe)}createSuggestion(e,t){const{cmd:s,isPinned:i,isRecent:n}=e,a={type:l.CommandList,item:s,isPinned:i,isRecent:n,match:t};return this.applyMatchPriorityPreferences(a)}getEnabledCommandPalettePluginInstance(){return fe.getEnabledCommandPalettePluginInstance(this.app)}static getEnabledCommandPalettePluginInstance(e){return L(e,"command-palette")}}class ye extends oe{getCommandString(e){const{settings:t}=this;return e?.useActiveEditorAsSource?t.relatedItemsListActiveEditorCommand:t.relatedItemsListCommand}validateCommand(e,s,i,n,a){const o=e.parsedCommand(t.RelatedItemsList),r=this.getSourceInfo(n,a,0===s,e.sessionOpts);return r&&(e.mode=t.RelatedItemsList,o.source=r,o.index=s,o.parsedInput=i,o.isValidated=!0),o}getSuggestions(e){const s=[];if(e){this.inputInfo=e;const i=re.create(e.parsedInputQuery.query),a=e.parsedCommand(t.RelatedItemsList);this.getItems(a.source,e).forEach((t=>{const n=this.searchAndCreateSuggestion(e,i,t);n&&s.push(n)})),i.hasSearchTerm&&n.sortSearchResults(s)}return s}renderSuggestion(e,t){let s=!1;if(e){const{file:i,matchType:n,match:a,item:o}=e,r=new Map([[c.Backlink,"links-coming-in"],[c.DiskLocation,"folder-tree"],[c.OutgoingLink,"links-going-out"]]);t.setAttribute("data-relation-type",o.relationType),this.renderAsFileInfoPanel(t,["qsp-suggestion-related"],e.preferredTitle,i,n,a);const l=this.renderOptionalIndicators(t,e);e.item.count&&this.renderIndicator(l,[],null,`${e.item.count}`),this.renderIndicator(l,["qsp-related-indicator"],r.get(o.relationType)),s=!0}return s}onChooseSuggestion(e,t){let s=!1;if(e){const{file:i}=e;this.navigateToLeafOrOpenFile(t,i,`Unable to open related file ${i.path}`),s=!0}return s}getPreferredTitle(e,t){let s=null;const{file:i,unresolvedText:n}=e;if(i)"H1"===t&&(s=this.getFirstH1(i)?.heading??null);else{!!n?.length&&(s=n)}return s}searchAndCreateSuggestion(e,t,s){const{file:i,unresolvedText:n}=s;let a={matchType:d.None,match:null};const o=null===i&&n?.length,{currentWorkspaceEnvList:r}=e,{settings:l,app:{metadataCache:c}}=this,h=this.getPreferredTitle(s,l.preferredSourceForTitle);return t.hasSearchTerm&&(a=t.searchWithFallback(h,i),a.matchType===d.None)?null:o?de.createUnresolvedSuggestion(h,a,l,c):this.createSuggestion(r,s,a,h)}getItems(e,t){const s=[],{metadataCache:i}=this.app,{file:n,suggestion:a}=e,o=new Set(this.settings.enabledRelatedItems),r=this.getActiveFacetIds(t),l=e=>o.has(e)&&this.isFacetedWith(r,e);if(l(c.Backlink)){let e=n?.path,t=i.resolvedLinks;f(a)&&(e=a.linktext,t=i.unresolvedLinks),this.addBacklinks(e,t,s)}return l(c.DiskLocation)&&this.addRelatedDiskFiles(n,s),l(c.OutgoingLink)&&this.addOutgoingLinks(n,s),s}addRelatedDiskFiles(e,t){const{excludeRelatedFolders:s,excludeOpenRelatedFiles:i}=this.settings;if(e){const n=I(s);let a=[...e.parent.children];for(;a.length>0;){const s=a.pop();if(k(s)){s===e||i&&!!this.findMatchingLeaf(s).leaf||t.push({file:s,relationType:c.DiskLocation})}else n(s.path)||(a=a.concat(s.children))}}}addOutgoingLinks(e,t){if(e){const s=new Map,i=new Map,{metadataCache:n}=this.app,a=n.getFileCache(e).links??[],o=e=>!!e&&!!(e.count+=1);a.forEach((a=>{const r=a.link,l=n.getFirstLinkpathDest(r,e.path);let d;l?o(i.get(l))||l===e||(d={file:l,relationType:c.OutgoingLink,count:1},i.set(l,d),t.push(d)):o(s.get(r))||(d={file:null,relationType:c.OutgoingLink,unresolvedText:r,count:1},s.set(r,d),t.push(d))}))}}addBacklinks(e,t,s){for(const[i,n]of Object.entries(t))if(i!==e&&Object.prototype.hasOwnProperty.call(n,e)){const t=n[e],a=this.getTFileByPath(i);a&&s.push({count:t,file:a,relationType:c.Backlink})}}reset(){this.inputInfo=null}getSourceInfo(e,s,i,n){const a=this.inputInfo;let o=null,r=t.Standard;a&&(o=a.parsedCommand().source,r=a.mode);const l=r===t.RelatedItemsList&&!!o,d=this.getEditorInfo(s),c=this.getSuggestionInfo(e);!c.isValidSource&&f(e)&&(c.isValidSource=!0);let h=null;return l?h=o:c.isValidSource&&!n.useActiveEditorAsSource?h=c:d.isValidSource&&i&&(h=d),h}createSuggestion(e,t,s,i){let n={item:t,file:t?.file,type:l.RelatedItemsList,preferredTitle:i,...s};return n=oe.updateWorkspaceEnvListStatus(e,n),this.applyMatchPriorityPreferences(n)}}class be extends oe{constructor(){super(...arguments),this.mobileVaultChooserMarker={type:l.VaultList,match:null,item:null,pathSegments:null}}getCommandString(e){return this.settings?.vaultListCommand}validateCommand(e,s,i,n,a){e.mode=t.VaultList;const o=e.parsedCommand(t.VaultList);return o.index=s,o.parsedInput=i,o.isValidated=!0,o}getSuggestions(e){const t=[];if(e){const{query:s,hasSearchTerm:i}=e.parsedInputQuery,a=re.create(s);(n.Platform.isDesktop?this.getItems():[this.mobileVaultChooserMarker]).forEach((e=>{let s=!0;if(i){const t=a.searchWithFallback(null,e.pathSegments);Object.assign(e,t),s=!!t.match}s&&t.push(e)})),i&&n.sortSearchResults(t)}return t}renderSuggestion(e,t){let s=!1;return e&&(this.addClassesToSuggestionContainer(t,["qsp-suggestion-vault"]),s=!0,n.Platform.isDesktop?this.renderVaultSuggestion(e,t):e===this.mobileVaultChooserMarker&&this.renderMobileHintSuggestion(t)),s}renderMobileHintSuggestion(e){this.renderContent(e,"Show mobile vault chooser",null)}renderVaultSuggestion(e,t){const{pathSegments:s,matchType:i}=e;let{match:a}=e,o=null;i===d.Basename&&(o=a,a=null);const r=this.renderContent(t,s.basename,o).createDiv({cls:["suggestion-note","qsp-note"]}),l=r.createSpan({cls:["qsp-path-indicator"]}),c=r.createSpan({cls:"qsp-path"});n.setIcon(l,"folder"),n.renderResults(c,s.path,a)}onChooseSuggestion(e,t){let s=!1;return e&&(n.Platform.isDesktop?s=a.ipcRenderer.sendSync("vault-open",e.pathSegments?.path,!1):e===this.mobileVaultChooserMarker&&(this.app.openVaultChooser(),s=!0)),s}getItems(){const e=[];try{const t=a.ipcRenderer.sendSync("vault-list");if(t)for(const[s,{path:i,open:n}]of Object.entries(t)){const t=w(i),a={type:l.VaultList,match:null,item:s,isOpen:!!n,pathSegments:{basename:t,path:i}};e.push(a)}}catch(e){console.log("Switcher++: error retrieving list of available vaults. ",e)}return e.sort(((e,t)=>e.pathSegments.basename.localeCompare(t.pathSegments.basename)))}}const Se={};class ke{constructor(e,s,i){this.app=e,this.settings=s,this.exKeymap=i,this.sessionOpts={},this.noResultActionModes=[t.HeadingsList,t.WorkspaceList];const a=new de(e,s),o=new Map([[t.SymbolList,new ge(e,s)],[t.WorkspaceList,new le(e,s)],[t.HeadingsList,new me(e,s)],[t.EditorList,new ce(e,s)],[t.BookmarksList,new he(e,s)],[t.CommandList,new fe(e,s)],[t.RelatedItemsList,new ye(e,s)],[t.VaultList,new be(e,s)]]);this.handlersByMode=o,this.handlersByType=new Map([[l.CommandList,o.get(t.CommandList)],[l.EditorList,o.get(t.EditorList)],[l.HeadingsList,o.get(t.HeadingsList)],[l.RelatedItemsList,o.get(t.RelatedItemsList)],[l.Bookmark,o.get(t.BookmarksList)],[l.SymbolList,o.get(t.SymbolList)],[l.WorkspaceList,o.get(t.WorkspaceList)],[l.VaultList,o.get(t.VaultList)],[l.File,a],[l.Alias,a]]),this.handlersByCommand=new Map([[s.editorListCommand,o.get(t.EditorList)],[s.workspaceListCommand,o.get(t.WorkspaceList)],[s.headingsListCommand,o.get(t.HeadingsList)],[s.bookmarksListCommand,o.get(t.BookmarksList)],[s.commandListCommand,o.get(t.CommandList)],[s.symbolListCommand,o.get(t.SymbolList)],[s.symbolListActiveEditorCommand,o.get(t.SymbolList)],[s.relatedItemsListCommand,o.get(t.RelatedItemsList)],[s.vaultListCommand,o.get(t.VaultList)],[s.relatedItemsListActiveEditorCommand,o.get(t.RelatedItemsList)]]),this.debouncedGetSuggestions=n.debounce(this.getSuggestions.bind(this),s.headingsSearchDebounceMilli,!0),this.reset()}onOpen(){const{exKeymap:e,settings:t}=this;e.isOpen=!0,t.quickFilters?.shouldResetActiveFacets&&Object.values(t.quickFilters.facetList).forEach((e=>e.isActive=!1))}onClose(){this.exKeymap.isOpen=!1,M.unload()}setSessionOpenMode(e,s,i){if(this.reset(),s?.setSuggestions([]),e!==t.Standard){const t=this.getHandler(e).getCommandString(i);Object.assign(this.sessionOpts,i,{openModeString:t})}if(Se[e]&&(e===t.CommandList&&this.settings.preserveCommandPaletteLastInput||e!==t.CommandList&&this.settings.preserveQuickSwitcherLastInput)){const t=Se[e];this.lastInput=t.inputText}}insertSessionOpenModeOrLastInputString(e){const{sessionOpts:t,lastInput:s}=this,i=t.openModeString??null;if(s&&s!==i){e.value=s;const t=i?i.length:0;e.setSelectionRange(t,e.value.length)}else null!==i&&""!==i&&(e.value=i,t.openModeString=null);this.lastInput=null}updateSuggestions(e,s,i){const{exKeymap:n,settings:a,sessionOpts:o}=this;let r=!1;this.debouncedGetSuggestions.cancel();const l=oe.getActiveLeaf(this.app.workspace),d=ke.getActiveSuggestion(s),c=this.determineRunMode(e,d,l,o);this.inputInfo=c;const{mode:h}=c;return Se[h]=c,this.updatedKeymapForMode(c,s,i,n,a,l),this.toggleMobileCreateFileButton(i,h,a),h!==t.Standard&&(h===t.HeadingsList&&c.parsedCommand().parsedInput?.length?this.debouncedGetSuggestions(c,s,i):this.getSuggestions(c,s,i),r=!0),r}toggleMobileCreateFileButton(e,s,i){if(!n.Platform.isMobile)return;const a=t[s];e.allowCreateNewFile=i.allowCreateNewFileInModeNames.includes(a),e.allowCreateNewFile||e.createButtonEl?.detach()}updatedKeymapForMode(e,t,s,i,n,a){const{mode:o}=e,r=this.getHandler(o),l=r?.getAvailableFacets(e)??[],d={mode:o,activeLeaf:a,facets:{facetList:l,facetSettings:n.quickFilters,onToggleFacet:((o,l)=>{if(l){const e=o.some((e=>!0===e.isActive));r.activateFacet(o,!e)}else r.activateFacet(o,!o[0].isActive);return this.updatedKeymapForMode(e,t,s,i,n,a),this.getSuggestions(e,t,s),!1}).bind(this)}};i.updateKeymapForMode(d)}renderSuggestion(e,s){const{inputInfo:i,settings:{overrideStandardModeBehaviors:n}}=this,{mode:a}=i,o=a===t.HeadingsList;let r=!1;const d=new Set([l.Unresolved,l.Bookmark]);if(null===e){if(o){const e=this.getHandler(a),t=i.parsedCommand(a)?.parsedInput;e.renderFileCreationSuggestion(s,t),r=!0}}else if(!d.has(e.type)&&(n||o||y(e))){const n=this.getHandler(e);n&&(a===t.Standard&&n.addPropertiesToStandardSuggestions(i,e),r=n.renderSuggestion(e,s))}return r}onChooseSuggestion(e,s){const{inputInfo:i,settings:{overrideStandardModeBehaviors:n}}=this,{mode:a}=i,o=a===t.HeadingsList;let r=!1;const d=new Set([l.Unresolved,l.Bookmark]);if(null===e){if(this.noResultActionModes.includes(a)){const e=this.getHandler(a);r=!!e?.onNoResultsCreateAction(i,s)}}else if(!d.has(e.type)&&(n||o||y(e))){const t=this.getHandler(e);t&&(r=t.onChooseSuggestion(e,s))}return r}determineRunMode(e,s,i,n){const a=e??"",o=new ae(a,t.Standard,n);return this.addWorkspaceEnvLists(o),0===a.length&&this.reset(),this.validatePrefixCommands(o,s,i,this.settings),o}getSuggestions(e,t,s){t.setSuggestions([]);const{mode:i}=e,n=this.getHandler(i).getSuggestions(e),a=n=>{n?.length?(t.setSuggestions(n),ke.setActiveSuggestion(i,t),this.exKeymap?.renderQuickOpenFlairIcons(t.suggestions,this.settings)):this.noResultActionModes.includes(i)&&e.parsedCommand(i).parsedInput?s.onNoSuggestion():t.setSuggestions(null)};Array.isArray(n)?a(n):n.then((e=>{a(e)}),(e=>{console.log("Switcher++: error retrieving suggestions as Promise. ",e)}))}removeEscapeCommandCharFromInput(e,t,s){const i=e.inputTextSansEscapeChar.replace(new RegExp(`(?:${v(t)})(?:${v(s)})`),s);return e.inputTextSansEscapeChar=i,i}validatePrefixCommands(e,t,s,i){let n=null,a=null;const o=[i.symbolListActiveEditorCommand,i.relatedItemsListActiveEditorCommand],r=[i.editorListCommand,i.workspaceListCommand,i.headingsListCommand,i.bookmarksListCommand,i.commandListCommand,i.vaultListCommand].concat(o).map((e=>`(?:${v(e)})`)).sort(((e,t)=>t.length-e.length)),l=new RegExp(`^((?:${v(i.escapeCmdChar)})?)(${r.join("|")})`).exec(e.inputText);if(l){const t=!!l[1].length;n=l[2],t?(this.removeEscapeCommandCharFromInput(e,i.escapeCmdChar,n),n=null):a=this.getHandler(n)}if(!this.validateSourcedCommands(e,n,t,s,i)&&a){e.sessionOpts.useActiveEditorAsSource=o.includes(n);const i=e.inputTextSansEscapeChar.slice(n.length);a.validateCommand(e,l.index,i,t,s)}}validateSourcedCommands(e,t,s,i,n){let a=!1;const o=[],r=e.inputTextSansEscapeChar,l=[n.editorListCommand,n.headingsListCommand,n.bookmarksListCommand];if(!t||l.includes(t)){let t=null;const l=[n.symbolListCommand,n.relatedItemsListCommand].map((e=>`(?:${v(e)})`)).sort(((e,t)=>t.length-e.length)),d=new RegExp(`((?:${v(n.escapeCmdChar)})?)(${l.join("|")})`,"g");for(;null!==(t=d.exec(r));){const l=!!t[1].length,c=t[2];if(!l){const n=r.slice(d.lastIndex),l=this.getHandler(c);if(l){const r=l.validateCommand(e,t.index,n,s,i);a=!!r?.isValidated;const d=this.getSourcedHandlers().filter((e=>e!==l));o.push(...d)}break}this.removeEscapeCommandCharFromInput(e,n.escapeCmdChar,c)}}return this.resetSourcedHandlers(o.length?o:null),a}static setActiveSuggestion(e,s){if(e===t.SymbolList){const e=s.values.filter((e=>m(e))).findIndex((e=>e.item.isSelected));-1!==e&&(s.setSelectedItem(e,null),s.suggestions[s.selectedItem].scrollIntoView(!1))}}static getActiveSuggestion(e){let t=null;return e?.values&&(t=e.values[e.selectedItem]),t}reset(){this.inputInfo=new ae,this.sessionOpts={},this.resetSourcedHandlers()}resetSourcedHandlers(e){(e=e??this.getSourcedHandlers()).forEach((e=>e?.reset()))}getSourcedHandlers(){return[t.RelatedItemsList,t.SymbolList].map((e=>this.getHandler(e)))}addWorkspaceEnvLists(e){if(e){const s=this.getHandler(t.EditorList).getItems(),i=s.map((e=>F(e))).filter((e=>!!e)).reduce(((e,t)=>e.add(t)),new Set),{fileBookmarks:n,nonFileBookmarks:a}=this.getHandler(t.BookmarksList).getItems(null),o=e.currentWorkspaceEnvList;o.openWorkspaceLeaves=new Set(s),o.openWorkspaceFiles=i,o.fileBookmarks=n,o.nonFileBookmarks=a,o.attachmentFileExtensions=this.getAttachmentFileExtensions(this.app.viewRegistry,this.settings.fileExtAllowList);const r=i.size+this.settings.maxRecentFileSuggestionsOnInit;o.mostRecentFiles=this.getRecentFiles(i,r)}return e}getAttachmentFileExtensions(e,t){const s=new Set;try{const i=new Set(["md","canvas",...t]);Object.keys(e.typeByExtension).reduce(((e,t)=>(i.has(t)||e.add(t),e)),s)}catch(e){console.log("Switcher++: error retrieving attachment list from ViewRegistry",e)}return s}getRecentFiles(e,t=75){e=e??new Set;const s=new Set;if(t>0){const{workspace:i,vault:n}=this.app,a=i.getRecentFiles({showMarkdown:!0,showCanvas:!0,showNonImageAttachments:!0,showImages:!0,maxCount:t});a?.forEach((t=>{const i=n.getAbstractFileByPath(t);k(i)&&!e.has(i)&&s.add(i)}))}return s}inputTextForStandardMode(e){const{mode:s,inputTextSansEscapeChar:i}=this.inputInfo;let n=e;return s===t.Standard&&i?.length&&(n=i),n}getHandler(e){let t;const{handlersByMode:s,handlersByType:i,handlersByCommand:n}=this;return"number"==typeof e?t=s.get(e):h(e,"type")?t=i.get(e.type):"string"==typeof e&&(t=n.get(e)),t}}const ve={Enter:"↵",Backspace:"⌫",ArrowLeft:"←",ArrowUp:"↑",ArrowDown:"↓",ArrowRight:"→",Tab:"↹"},Le={...ve,Mod:"Ctrl",Ctrl:"Ctrl",Meta:"Win",Alt:"Alt",Shift:"Shift"},Ce={...ve,Mod:"⌘",Ctrl:"⌃",Meta:"⌘",Alt:"⌥",Shift:"⇧"};class we{get isOpen(){return this._isOpen}set isOpen(e){this._isOpen=e}static get modKey(){return n.Platform.isMacOS?"Meta":"Ctrl"}static get keyDisplayStr(){return n.Platform.isMacOS?Ce:Le}constructor(e,t,s,i,n){this.app=e,this.scope=t,this.chooser=s,this.modal=i,this.config=n,this.standardKeysInfo=[],this.customKeysInfo=[],this.savedStandardKeysInfo=[],this.customInstructionEls=new Map,this.facetKeysInfo=[],this.insertIntoEditorKeysInfo=[],this.initKeysInfo(),this.removeDefaultTabKeyBinding(t,n),this.registerNavigationBindings(t,n.navigationKeys),this.registerEditorTabBindings(t),this.registerCloseWhenEmptyBindings(t,n),this.registerQuickOpenBindings(t,n),this.renderModeTriggerInstructions(i.modalEl,n),this.standardInstructionsEl=i.modalEl.querySelector(".prompt-instructions")}initKeysInfo(){this.standardKeysInfo.push(),this.addCustomKeymaps(this.config)}removeDefaultTabKeyBinding(e,t){if(t?.removeDefaultTabBinding){const t=e.keys.find((({modifiers:e,key:t})=>null===e&&"Tab"===t));e.unregister(t)}}registerNavigationBindings(e,t){const s=(t,s)=>{t.forEach((({modifiers:t,key:i})=>{e.register(t,i,((e,t)=>(this.navigateItems(e,s),!1)))}))};s(t?.nextKeys??[],!0),s(t?.prevKeys??[],!1)}registerFacetBinding(e,s){const{mode:i,facets:n}=s;if(n?.facetList?.length){const{facetList:s,facetSettings:a,onToggleFacet:o}=n,{keyList:r,modifiers:l,resetKey:d,resetModifiers:c}=a;let h=0;const m=(t,s,i,n)=>e.register(t,s,(()=>o(i,n)));for(let e=0;e{e.register(t[0],t[1],this.useSelectedItem.bind(this))}))}registerCloseWhenEmptyBindings(e,t){const s=t.closeWhenEmptyKeys;s?.forEach((({modifiers:t,key:s})=>{e.register(t,s,this.closeModalIfEmpty.bind(this))}))}registerQuickOpenBindings(e,t){const{isEnabled:s,modifiers:i,keyList:n}=t.quickOpen;s&&n?.forEach((t=>{e.register(i,t,this.quickOpenByIndex.bind(this))}))}quickOpenByIndex(e,t){const s=this.config.quickOpen.keyList.indexOf(t.vkey);if(-1!==s){const{chooser:i}=this;i.values.length>s&&(i.setSelectedItem(s,e),this.useSelectedItem(e,t))}return!1}renderQuickOpenFlairIcons(e,t){const{isEnabled:s,modifiers:i,keyList:n}=t.quickOpen;if(s)for(let t=0;te.purpose===o.purpose)),!l){const{modifiers:e,key:t,purpose:s}=o;l={isInstructionOnly:!1,command:we.commandDisplayStr(e,t),modifiers:e,key:t,purpose:s},i.push(l)}l.eventListener=()=>{const{modal:e,chooser:t}=this;e.close();const i=t.values?.[t.selectedItem];return this.insertIntoEditorAsLink(i,s,n),!1},l.modes=[e]}}return l}updateKeymapForMode(e){const{mode:s,activeLeaf:i}=e,{modal:n,scope:a,customKeysInfo:o,facetKeysInfo:r,standardKeysInfo:l,savedStandardKeysInfo:d,config:{insertLinkInEditor:c,showModeTriggerInstructions:h}}=this;this.updateInsertIntoEditorCommand(s,i,o,c);const m=o.filter((e=>!e.isInstructionOnly));this.unregisterKeys(a,m),this.unregisterKeys(a,r),r.length=0;const u=m.filter((e=>e.modes?.includes(s)));s===t.Standard?this.updateKeymapForStandardMode(a,u,d):this.updateKeymapForCustomModes(a,u,l,e,n),this.showModeTriggerInstructions(n.modalEl,h)}updateKeymapForStandardMode(e,t,s){const i=s.map((([e,t])=>({eventListener:t.func,...e})));this.registerKeys(e,i),s.length=0,this.registerKeys(e,t),this.toggleStandardInstructions(!0)}updateKeymapForCustomModes(e,t,s,i,n){const{savedStandardKeysInfo:a,customKeysInfo:o,facetKeysInfo:r}=this,l=this.unregisterKeys(e,s);l.length&&a.push(...l),this.registerKeys(e,t),this.registerFacetBinding(e,i),this.showCustomInstructions(n,i,o,r)}registerKeys(e,t){t.forEach((({modifiers:t,key:s,eventListener:i})=>{e.register(t,s,i)}))}unregisterKeys(e,t){const s=[],i={};t.map((e=>{const{key:t,modifiers:s}=e,n=we.modifiersToKeymapInfoStr(s),a=i[t];a?a[n]=e:i[t]={[n]:e}}));let n=e.keys.length;for(;n--;){const t=e.keys[n],a=i[t.key],o=a?.[t.modifiers];o&&(e.unregister(t),s.push([o,t]))}return s}detachCustomInstructionEls(){this.customInstructionEls.forEach((e=>{e.detach()}))}toggleStandardInstructions(e){const{standardInstructionsEl:t}=this;let s="none";e&&(s="",this.detachCustomInstructionEls()),t&&(t.style.display=s)}showCustomInstructions(e,t,s,i){const{mode:n,facets:a}=t,{modalEl:o}=e,r=s.filter((e=>e.modes?.includes(n)));this.toggleStandardInstructions(!1),this.renderCustomInstructions(o,r),this.renderFacetInstructions(o,a?.facetSettings,i)}renderFacetInstructions(e,t,s){if(s?.length&&t.shouldShowFacetInstructions){const i=this.getCustomInstructionsEl("facets",e);i.empty(),e.appendChild(i);const n=`filters | ${we.commandDisplayStr(t.modifiers)}`;this.createPromptInstructionCommandEl(i,n),s.forEach((e=>{const{facet:s,command:n,purpose:a}=e;let o,r,l=null;s?(r=n,o=s.modifiers,s.isActive&&(l=["qsp-filter-active"])):(r=t.resetKey,o=t.resetModifiers);const d=o?`(${we.commandDisplayStr(o)}) ${r}`:`${r}`;this.createPromptInstructionCommandEl(i,d,a,[],l)}))}}renderCustomInstructions(e,t){const s=this.getCustomInstructionsEl("custom",e);s.empty(),e.appendChild(s),t.forEach((e=>{this.createPromptInstructionCommandEl(s,e.command,e.purpose)}))}showModeTriggerInstructions(e,t){if(t){const t=this.customInstructionEls.get("modes");t&&e.appendChild(t)}}renderModeTriggerInstructions(e,t){const s=new Map([[t.headingsListCommand,"heading list"],[t.editorListCommand,"editor list"],[t.bookmarksListCommand,"bookmark list"],[t.commandListCommand,"command list"],[t.workspaceListCommand,"workspace list"],[t.vaultListCommand,"vault list"],[t.symbolListActiveEditorCommand,"symbol list (active editor)"],[t.symbolListCommand,"symbol list (embedded)"],[t.relatedItemsListActiveEditorCommand,"related items (active editor)"],[t.relatedItemsListCommand,"related items (embedded)"]]),i=this.getCustomInstructionsEl("modes",e);i.detach(),i.empty(),this.createPromptInstructionCommandEl(i,"mode triggers |"),s.forEach(((e,t)=>{this.createPromptInstructionCommandEl(i,t,e)}))}getCustomInstructionsEl(e,t){let s=this.customInstructionEls.get(e);if(!s){const i={custom:["qsp-prompt-instructions"],facets:["qsp-prompt-instructions-facets"],modes:["qsp-prompt-instructions-modes"]};s=this.createPromptInstructionsEl(i[e],t),this.customInstructionEls.set(e,s)}return s}createPromptInstructionsEl(e,t){const s={cls:["prompt-instructions",...e]};return t.createDiv(s)}createPromptInstructionCommandEl(e,t,s,i,n){i=i??[];const a=e.createDiv();return a.createSpan({cls:["prompt-instruction-command",...i],text:t}),s&&(n=n??[],a.createSpan({cls:n,text:s})),a}closeModalIfEmpty(e,t){const{modal:s,config:i}=this;i.shouldCloseModalOnBackspace&&!s?.inputEl.value&&(s.close(),e.preventDefault())}navigateToCommandHotkeySelector(e,t){const{modal:s,chooser:i,app:{setting:n}}=this,a=i.values?.[i.selectedItem];if(a){n.open();const e=n.openTabById("hotkeys");if(e){s.close();const t=a.item.id;e.setQuery(`${t}`)}}return!1}togglePinnedCommand(e,t){const{app:s,config:i,chooser:n}=this,a=n.values?.[n.selectedItem],o=fe.getEnabledCommandPalettePluginInstance(s);if(a&&o){const e=a.item.id,t=n.suggestions[n.selectedItem];let r=o.options?.pinned;if(r){const t=r.indexOf(e);a.isPinned=-1===t,a.isPinned?r.push(e):r.splice(t,1)}else r=[e],o.options.pinned=r;o.saveSettings(o.plugin),t.empty(),new fe(s,i).renderSuggestion(a,t)}return!1}toggleMarkdownContentRendering(e,t){const{app:s,config:i,chooser:n}=this,a=n.values?.[n.selectedItem];let o=null,r=null;if(m(a)&&b(a.item.symbol)?(o=a.item.symbol,r=a.file):u(a)&&(o=a.item,r=a.file),o&&r){const e=n.suggestions[n.selectedItem].querySelector(".qsp-title"),t=!e.querySelector(".qsp-rendered-container");e.empty(),me.renderHeadingContent(s,i,e,o,r,a.match,t)}return!1}useSelectedItem(e,t){return this.chooser.useSelectedItem(e),!1}insertIntoEditorAsLink(e,t,s){const{app:{workspace:i,fileManager:a,vault:o}}=this,r=i.getActiveViewOfType(n.MarkdownView),l=r?.leaf===t,d=r?.file;if(l&&d){const t=A(a,o,e,d.path,s);t&&r.editor?.replaceSelection(t)}}navigateItems(e,t){const{isOpen:s,chooser:i}=this;if(s){let s=i.selectedItem;s=t?++s:--s,i.setSelectedItem(s,e)}}static commandDisplayStr(e,t){const{keyDisplayStr:s}=this;let i=null,n=null;return e&&(i=e.map((e=>s[e]?.toLocaleLowerCase())).sort().join(" ")),t&&(n=Object.prototype.hasOwnProperty.call(s,t)?s[t]:t),[i,n].filter((e=>e)).join(" ")}static modifiersToKeymapInfoStr(e){return e?.map((e=>"Mod"===e?this.modKey:e)).sort().join(",")}createCustomKeymap(e,t,s,i,n=!0,a=!1){let o=null;if(s){const{modifiers:r,key:l}=s;o={modes:t,modifiers:r,key:l,eventListener:i,purpose:e,command:we.commandDisplayStr(r,l),isInstructionOnly:a},n&&this.customKeysInfo.push(o)}return o}addCustomKeymaps(e){const s=[t.EditorList,t.HeadingsList,t.RelatedItemsList,t.BookmarksList,t.SymbolList],{quickOpen:i}=this.config,n=i?.keyList;if(n?.length){const e=`${n[0]}~${n[n.length-1]}`;this.createCustomKeymap("open nth item",[t.CommandList,t.VaultList,t.WorkspaceList,...s],{modifiers:i.modifiers,key:e},null,i.isEnabled,!0)}this.createCustomKeymap("open in new tab",s,{modifiers:["Mod"],key:"Enter"},null,!0,!0),this.createCustomKeymap("open to the right",s,{modifiers:["Mod"],key:"\\"},null,!0,!0),this.createCustomKeymap("open below",s,{modifiers:["Mod","Shift"],key:"\\"},null,!0,!0),this.createCustomKeymap("open in new window",s,{modifiers:["Mod"],key:"o"},null,!0,!0),this.createCustomKeymap("execute command",[t.CommandList],{modifiers:[],key:"Enter"},null,!0,!0),this.createCustomKeymap("open workspace",[t.WorkspaceList],{modifiers:[],key:"Enter"},null,!0,!0),this.createCustomKeymap("set hotkey",[t.CommandList],e.navigateToHotkeySelectorKeys,this.navigateToCommandHotkeySelector.bind(this)),this.createCustomKeymap("toggle pinned",[t.CommandList],e.togglePinnedCommandKeys,this.togglePinnedCommand.bind(this));const{renderMarkdownContentInSuggestions:a}=e;this.createCustomKeymap("toggle preview (selected heading)",[t.HeadingsList,t.SymbolList],a.toggleContentRenderingKeys,this.toggleMarkdownContentRendering.bind(this),a.isEnabled)}}class Ie{static installMobileLauncherOverride(e,t,s){let i=null;if(!n.Platform.isMobile||!t.isEnabled||Ie.coreMobileLauncherButtonEl)return null;const a=function(e,t){let s=null;const i=e?.mobileNavbar?.containerEl;return i&&(s=i.querySelector(z.defaults.mobileLauncher.coreLauncherButtonSelector),s||(s=i.querySelector(t.coreLauncherButtonSelector))),s}(e,t);if(a){const e=function(e,t,s){let i=null;if(e&&(i=e.cloneNode(!0),i)){const{iconName:e,coreLauncherButtonIconSelector:a}=t;if(i.addClass("qsp-mobile-launcher-button"),i.addEventListener("click",s),e?.length){const t=i.querySelector(a);t&&n.setIcon(t,e)}}return i}(a,t,s);(function(e,t){let s=!1;if(e&&t){const i=t.style.display;t.style.display="none",e.insertAdjacentElement("beforebegin",t)&&(e.remove(),s=!0),t.style.display=i}return s})(a,e)&&(Ie.coreMobileLauncherButtonEl=a,Ie.qspMobileLauncherButtonEl=e,i=e)}return i}static removeMobileLauncherOverride(){let e=!1;if(!Ie.coreMobileLauncherButtonEl)return e;if(Ie.qspMobileLauncherButtonEl?.parentElement){const t=Ie.qspMobileLauncherButtonEl,s=Ie.coreMobileLauncherButtonEl,i=s.style.display;s.style.display="none",t.insertAdjacentElement("beforebegin",s)&&(t.remove(),Ie.qspMobileLauncherButtonEl=null,Ie.coreMobileLauncherButtonEl=null,e=!0),s.style.display=i}return e}}const Te=[{id:"switcher-plus:open",name:"Open in Standard Mode",mode:t.Standard,iconId:"lucide-file-search",ribbonIconEl:null},{id:"switcher-plus:open-editors",name:"Open in Editor Mode",mode:t.EditorList,iconId:"lucide-file-edit",ribbonIconEl:null},{id:"switcher-plus:open-symbols",name:"Open Symbols for selected suggestion or editor",mode:t.SymbolList,iconId:"lucide-dollar-sign",ribbonIconEl:null},{id:"switcher-plus:open-symbols-active",name:"Open Symbols for the active editor",mode:t.SymbolList,iconId:"lucide-dollar-sign",ribbonIconEl:null,sessionOpts:{useActiveEditorAsSource:!0}},{id:"switcher-plus:open-workspaces",name:"Open in Workspaces Mode",mode:t.WorkspaceList,iconId:"lucide-album",ribbonIconEl:null},{id:"switcher-plus:open-headings",name:"Open in Headings Mode",mode:t.HeadingsList,iconId:"lucide-file-search",ribbonIconEl:null},{id:"switcher-plus:open-starred",name:"Open in Bookmarks Mode",mode:t.BookmarksList,iconId:"lucide-bookmark",ribbonIconEl:null},{id:"switcher-plus:open-commands",name:"Open in Commands Mode",mode:t.CommandList,iconId:"run-command",ribbonIconEl:null},{id:"switcher-plus:open-related-items",name:"Open Related Items for selected suggestion or editor",mode:t.RelatedItemsList,iconId:"lucide-file-plus-2",ribbonIconEl:null},{id:"switcher-plus:open-related-items-active",name:"Open Related Items for the active editor",mode:t.RelatedItemsList,iconId:"lucide-file-plus-2",ribbonIconEl:null,sessionOpts:{useActiveEditorAsSource:!0}},{id:"switcher-plus:open-vaults",name:"Open in Vaults Mode",mode:t.VaultList,iconId:"vault",ribbonIconEl:null}];class Ee extends n.Plugin{async onload(){const e=new z(this);await e.updateDataAndLoadSettings(),this.options=e,this.addSettingTab(new ne(this.app,this,e)),this.registerRibbonCommandIcons(),this.updateMobileLauncherButtonOverride(e.mobileLauncher.isEnabled),Te.forEach((({id:e,name:t,mode:s,iconId:i,sessionOpts:n})=>{this.registerCommand(e,t,s,i,n)}))}onunload(){this.updateMobileLauncherButtonOverride(!1)}registerCommand(e,t,s,i,n){this.addCommand({id:e,name:t,icon:i,checkCallback:e=>this.createModalAndOpen(s,e,n)})}registerRibbonCommandIcons(){Te.forEach((e=>{e.ribbonIconEl?.remove(),e.ribbonIconEl=null}));const e=Te.reduce(((e,t)=>(e[t.mode]=t,e)),{});this.options.enabledRibbonCommands.forEach((s=>{const i=e[t[s]];i&&(i.ribbonIconEl=this.addRibbonIcon(i.iconId,i.name,(()=>{this.createModalAndOpen(i.mode,!1)})))}))}createModalAndOpen(e,t,s){if(!t){const t=function(e,t){const s=C(e)?.QuickSwitcherModal;return s?new class extends s{constructor(e,t){super(e,t.options.builtInSystemOptions),this.plugin=t;const{options:s}=t;s.shouldShowAlias=this.shouldShowAlias;const i=new we(e,this.scope,this.chooser,this,s);this.exMode=new ke(e,s,i)}openInMode(e,t){this.exMode.setSessionOpenMode(e,this.chooser,t),super.open()}onOpen(){this.exMode.onOpen(),super.onOpen()}onClose(){super.onClose(),this.exMode.onClose()}updateSuggestions(){const{exMode:e,inputEl:t,chooser:s}=this;e.insertSessionOpenModeOrLastInputString(t),e.updateSuggestions(t.value,s,this)||super.updateSuggestions()}getSuggestions(e){const t=this.exMode.inputTextForStandardMode(e);return super.getSuggestions(t)}onChooseSuggestion(e,t){this.exMode.onChooseSuggestion(e,t)||super.onChooseSuggestion(e,t)}renderSuggestion(e,t){this.exMode.renderSuggestion(e,t)||super.renderSuggestion(e,t)}}(e,t):(console.log("Switcher++: unable to extend system switcher. Plugin UI will not be loaded. Use the builtin switcher instead."),null)}(this.app,this);if(!t)return!1;t.openInMode(e,s)}return!0}updateMobileLauncherButtonOverride(e){if(e){const e=()=>{const e=this.options.mobileLauncher.modeString,s=t[e];s&&this.createModalAndOpen(s,!1)};Ie.installMobileLauncherOverride(this.app,this.options.mobileLauncher,e)}else Ie.removeMobileLauncherOverride()}}module.exports=Ee; +"use strict";var e,t,s,i,n=require("obsidian");!function(e){e[e.None=0]="None",e[e.Full=1]="Full",e[e.FolderOnly=2]="FolderOnly",e[e.FolderWithFilename=3]="FolderWithFilename",e[e.FolderPathFilenameOptional=4]="FolderPathFilenameOptional"}(e||(e={})),function(e){e[e.Standard=1]="Standard",e[e.EditorList=2]="EditorList",e[e.SymbolList=4]="SymbolList",e[e.WorkspaceList=8]="WorkspaceList",e[e.HeadingsList=16]="HeadingsList",e[e.BookmarksList=32]="BookmarksList",e[e.CommandList=64]="CommandList",e[e.RelatedItemsList=128]="RelatedItemsList",e[e.VaultList=256]="VaultList"}(t||(t={})),function(e){e[e.Link=1]="Link",e[e.Embed=2]="Embed",e[e.Tag=4]="Tag",e[e.Heading=8]="Heading",e[e.Callout=16]="Callout",e[e.CanvasNode=32]="CanvasNode"}(s||(s={})),function(e){e[e.None=0]="None",e[e.Normal=1]="Normal",e[e.Heading=2]="Heading",e[e.Block=4]="Block"}(i||(i={}));const a={};a[s.Link]="🔗",a[s.Embed]="!",a[s.Tag]="#",a[s.Heading]="H";const o={};var r,l,d;function c(e,t,s){let i=!1;return e&&void 0!==e[t]&&(i=!0,void 0!==s&&s!==e[t]&&(i=!1)),i}function h(e){return c(e,"type",r.SymbolList)}function u(e){return c(e,"type",r.HeadingsList)}function m(e){return c(e,"type",r.File)}function g(e){return c(e,"type",r.Alias)}function p(e){return c(e,"type",r.Unresolved)}function f(e){return e&&!(m(t=e)||p(t)||g(t));var t}function y(e){return c(e,"level")}function b(e){return c(e,"type","callout")}function S(e){return c(e,"extension")}function k(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function v(e,t){return e?.internalPlugins?.getEnabledPluginById(t)}function C(e){const t=function(e,t){return e?.internalPlugins?.getPluginById(t)}(e,"switcher");return t?.instance}function L(){return Object.values(t).filter((e=>isNaN(Number(e)))).sort()}function w(){return[t.RelatedItemsList,t.SymbolList]}function I(e){let t=null;if(e){const s=n.normalizePath(e),i=s.lastIndexOf("/");t=-1===i?s:s.slice(i+1)}return t}function T(e){e=e??[];const t=[];for(const s of e)try{const e=new RegExp(s);t.push(e)}catch(e){console.log(`Switcher++: error creating RegExp from string: ${s}`,e)}return e=>{for(const s of t)if(s.test(e))return!0;return!1}}function E(e){let t=i.None;if(e){const s=e.link.split("|")[0];t=s.includes("#^")?i.Block:s.includes("#")?i.Heading:i.Normal}return t}function F(e,t){return t?.getFileByPath(e)}function A(e){let t=null;if(!e)return t;if(e.isDeferred){const s=e.getViewState()?.state?.file;s&&(t=F(s,e.app?.vault))}else e.view?.file&&(t=e.view.file);return t}function x(e,t,s,i,a){let o=null;if(a=Object.assign({useBasenameAsAlias:!0,useHeadingAsAlias:!0},a),s){let l=P(s),d=null,h=null;switch(s.type){case r.Unresolved:o=M(s.linktext);break;case r.Alias:d=s.alias;break;case r.Bookmark:{const{item:e}=s;"file"===e.type&&e.title&&(d=e.title);break}case r.HeadingsList:{const{heading:e}=s.item;({subpath:h,alias:d}=O(e,a.useHeadingAsAlias));break}case r.SymbolList:{const{item:{symbol:r}}=s;if(y(r))({subpath:h,alias:d}=O(r.heading,a.useHeadingAsAlias));else if(c(r,"link")){o=new RegExp(/^\[(.*?)\]\((.+?)\)/).test(r.original)?r.original:function(e,t,s,i,a,o){const{link:r,displayText:l}=i,{path:d,subpath:c}=n.parseLinktext(r);let h=l,u=null,m=null;u=d?.length?F(d,t):a;u?(!h?.length&&o&&(h=u.basename),m=e.generateMarkdownLink(u,s,c,h)):m=M(d,h);return m}(e,t,i,r,l,a.useBasenameAsAlias)}else l=null;break}case r.RelatedItemsList:{const{item:e}=s;e.unresolvedText&&(o=M(e.unresolvedText));break}}l&&!o&&(!d&&a.useBasenameAsAlias&&(d=l.basename),o=e.generateMarkdownLink(l,i,h,d))}return o}function O(e,t){const s=n.stripHeadingForLink(e);return{subpath:`#${s}`,alias:t?s:null}}function P(e){let t=null;return[r.Alias,r.Bookmark,r.HeadingsList,r.SymbolList,r.RelatedItemsList,r.EditorList,r.File].includes(e?.type)&&(t=e.file),t}function M(e,t){return`[[${e}${t=t?.length?`|${t}`:""}]]`}o[1]="H₁",o[2]="H₂",o[3]="H₃",o[4]="H₄",o[5]="H₅",o[6]="H₆",function(e){e.EditorList="editorList",e.SymbolList="symbolList",e.WorkspaceList="workspaceList",e.HeadingsList="headingsList",e.Bookmark="bookmark",e.CommandList="commandList",e.RelatedItemsList="relatedItemsList",e.VaultList="vaultList",e.File="file",e.Alias="alias",e.Unresolved="unresolved"}(r||(r={})),function(e){e[e.None=0]="None",e[e.Primary=1]="Primary",e[e.Basename=2]="Basename",e[e.Path=3]="Path"}(l||(l={})),function(e){e.DiskLocation="disk-location",e.Backlink="backlink",e.OutgoingLink="outgoing-link"}(d||(d={}));class R{static getAliases(e){let t=[];return e&&(t=R.getValueForKey(e,/^alias(es)?$/i)),t}static getValueForKey(e,t){const s=[],i=Object.keys(e).find((e=>t.test(e)));if(i){let t=e[i];"string"==typeof t&&(t=t.split(",")),Array.isArray(t)&&t.forEach((e=>{"string"==typeof e&&s.push(e.trim())}))}return s}}class H{static getRootComponent(){return this.rootComponent||(this.rootComponent=new n.Component),this.rootComponent}static unload(){this.rootComponent?.unload()}}const B={file:"canvas-node-file",text:"canvas-node-text",link:"canvas-node-link",group:"canvas-node-group"},D=[{id:s[s.Heading],mode:t.SymbolList,label:"headings",isActive:!1,isAvailable:!0},{id:s[s.Tag],mode:t.SymbolList,label:"tags",isActive:!1,isAvailable:!0},{id:s[s.Callout],mode:t.SymbolList,label:"callouts",isActive:!1,isAvailable:!0},{id:s[s.Link],mode:t.SymbolList,label:"links",isActive:!1,isAvailable:!0},{id:s[s.Embed],mode:t.SymbolList,label:"embeds",isActive:!1,isAvailable:!0},{id:B.file,mode:t.SymbolList,label:"file cards",isActive:!1,isAvailable:!0},{id:B.text,mode:t.SymbolList,label:"text cards",isActive:!1,isAvailable:!0},{id:B.link,mode:t.SymbolList,label:"link cards",isActive:!1,isAvailable:!0},{id:B.group,mode:t.SymbolList,label:"groups",isActive:!1,isAvailable:!0}],V=[{id:d.Backlink,mode:t.RelatedItemsList,label:"backlinks",isActive:!1,isAvailable:!0},{id:d.OutgoingLink,mode:t.RelatedItemsList,label:"outgoing links",isActive:!1,isAvailable:!0},{id:d.DiskLocation,mode:t.RelatedItemsList,label:"disk location",isActive:!1,isAvailable:!0}],W={file:"bookmarks-file",folder:"bookmarks-folder",search:"bookmarks-search",group:"bookmarks-group"},N=[{id:W.file,mode:t.BookmarksList,label:"files",isActive:!1,isAvailable:!0},{id:W.folder,mode:t.BookmarksList,label:"folders",isActive:!1,isAvailable:!0},{id:W.search,mode:t.BookmarksList,label:"searches",isActive:!1,isAvailable:!0}];var q;!function(e){e.Pinned="pinnedCommands",e.Recent="recentCommands"}(q||(q={}));const j=[{id:q.Pinned,mode:t.CommandList,label:"pinned",isActive:!1,isAvailable:!0},{id:q.Recent,mode:t.CommandList,label:"recent",isActive:!1,isAvailable:!0}];var K;!function(e){e.RecentFiles="recentFilesSearch",e.Bookmarks="bookmarksSearch",e.Filenames="filenamesSearch",e.Headings="headingsSearch",e.ExternalFiles="externalFilesSearch"}(K||(K={}));const $=[{id:K.RecentFiles,mode:t.HeadingsList,label:"recent files",isActive:!1,isAvailable:!0},{id:K.Bookmarks,mode:t.HeadingsList,label:"bookmarks",isActive:!1,isAvailable:!0},{id:K.Filenames,mode:t.HeadingsList,label:"filenames",isActive:!1,isAvailable:!0},{id:K.Headings,mode:t.HeadingsList,label:"headings",isActive:!1,isAvailable:!0},{id:K.ExternalFiles,mode:t.HeadingsList,label:"external files",isActive:!1,isAvailable:!0}];function Q(){const e={};return[D,V,N,j,$].flat().reduce(((e,t)=>(e[t.id]=Object.assign({},t),e)),e),e}const U=e=>{if("object"==typeof e&&null!==e){if("function"==typeof Object.getPrototypeOf){const t=Object.getPrototypeOf(e);return t===Object.prototype||null===t}return"[object Object]"===Object.prototype.toString.call(e)}return!1},z=(...e)=>e.reduce(((e,t)=>{if(Array.isArray(t))throw new TypeError("Arguments provided to ts-deepmerge must be objects, not arrays.");return Object.keys(t).forEach((s=>{["__proto__","constructor","prototype"].includes(s)||(Array.isArray(e[s])&&Array.isArray(t[s])?e[s]=z.options.mergeArrays?z.options.uniqueArrayItems?Array.from(new Set(e[s].concat(t[s]))):[...e[s],...t[s]]:t[s]:U(e[s])&&U(t[s])?e[s]=z(e[s],t[s]):e[s]=void 0===t[s]?z.options.allowUndefinedOverrides?t[s]:e[s]:t[s])})),e}),{}),_={allowUndefinedOverrides:!0,mergeArrays:!0,uniqueArrayItems:!0};z.options=_,z.withOptions=(e,...t)=>{z.options=Object.assign(Object.assign({},_),e);const s=z(...t);return z.options=_,s};class G{static get defaults(){const i={};return i[s.Link]=!0,i[s.Embed]=!0,i[s.Tag]=!0,i[s.Heading]=!0,i[s.Callout]=!0,{version:"2.0.0",onOpenPreferNewTab:!0,alwaysNewTabForSymbols:!1,useActiveTabForSymbolsOnMobile:!1,symbolsInLineOrder:!0,editorListCommand:"edt ",symbolListCommand:"@",symbolListActiveEditorCommand:"$ ",workspaceListCommand:"+",headingsListCommand:"#",bookmarksListCommand:"'",commandListCommand:">",vaultListCommand:"vault ",relatedItemsListCommand:"~",relatedItemsListActiveEditorCommand:"^ ",shouldSearchHeadings:!0,strictHeadingsOnly:!1,searchAllHeadings:!0,headingsSearchDebounceMilli:250,excludeViewTypes:["empty"],referenceViews:["backlink","localgraph","outgoing-link","outline"],limit:50,includeSidePanelViewTypes:["backlink","image","markdown","pdf"],enabledSymbolTypes:i,selectNearestHeading:!0,excludeFolders:[],excludeLinkSubTypes:0,excludeRelatedFolders:[""],excludeOpenRelatedFiles:!1,excludeObsidianIgnoredFiles:!1,shouldSearchFilenames:!1,shouldSearchBookmarks:!1,shouldSearchRecentFiles:!0,pathDisplayFormat:e.FolderWithFilename,hidePathIfRoot:!0,enabledRelatedItems:Object.values(d),showOptionalIndicatorIcons:!0,overrideStandardModeBehaviors:!0,enabledRibbonCommands:[t[t.HeadingsList],t[t.SymbolList]],fileExtAllowList:["canvas"],matchPriorityAdjustments:{isEnabled:!1,adjustments:{isOpenInEditor:{value:0,label:"Open items"},isBookmarked:{value:0,label:"Bookmarked items"},isRecent:{value:0,label:"Recent items"},isAttachment:{value:0,label:"Attachment file types"},file:{value:0,label:"Filenames"},alias:{value:0,label:"Aliases"},unresolved:{value:0,label:"Unresolved filenames"},h1:{value:0,label:"H₁ headings"}},fileExtAdjustments:{canvas:{value:0,label:"Canvas files"}}},quickFilters:{resetKey:"0",keyList:["1","2","3","4","5","6","7","8","9"],modifiers:["Ctrl","Alt"],facetList:Q(),shouldResetActiveFacets:!1,shouldShowFacetInstructions:!0},preserveCommandPaletteLastInput:!1,preserveQuickSwitcherLastInput:!1,shouldCloseModalOnBackspace:!1,maxRecentFileSuggestionsOnInit:25,orderEditorListByAccessTime:!0,insertLinkInEditor:{isEnabled:!0,keymap:{modifiers:["Mod"],key:"i",purpose:"insert in editor"},insertableEditorTypes:["markdown"],useBasenameAsAlias:!0,useHeadingAsAlias:!0},removeDefaultTabBinding:!0,navigationKeys:{nextKeys:[{modifiers:["Ctrl"],key:"n"},{modifiers:["Ctrl"],key:"j"}],prevKeys:[{modifiers:["Ctrl"],key:"p"},{modifiers:["Ctrl"],key:"k"}]},preferredSourceForTitle:"H1",closeWhenEmptyKeys:[{modifiers:null,key:"Backspace"}],navigateToHotkeySelectorKeys:{modifiers:["Ctrl","Shift"],key:"h"},togglePinnedCommandKeys:{modifiers:["Ctrl","Shift"],key:"p"},escapeCmdChar:"!",mobileLauncher:{isEnabled:!1,modeString:t[t.HeadingsList],iconName:"",coreLauncherButtonIconSelector:"span.clickable-icon",coreLauncherButtonSelector:".mobile-navbar-action:has(span.clickable-icon svg.svg-icon.lucide-plus-circle)"},allowCreateNewFileInModeNames:[t[t.Standard],t[t.HeadingsList]],showModeTriggerInstructions:!0,renderMarkdownContentInSuggestions:{isEnabled:!1,renderHeadings:!1,toggleContentRenderingKeys:{modifiers:["Shift","Ctrl"],key:"m"}},quickOpen:{isEnabled:!0,modifiers:["Alt"],keyList:["1","2","3","4","5","6","7","8","9"]},openDefaultApp:{isEnabled:!0,openInDefaultAppKeys:{modifiers:["Shift","Ctrl"],key:"o"},excludeFileExtensions:[]}}}get version(){return this.data.version}set version(e){this.data.version=e}get builtInSystemOptions(){return C(this.plugin.app)?.options}get showAllFileTypes(){return this.builtInSystemOptions?.showAllFileTypes}get showAttachments(){return this.builtInSystemOptions?.showAttachments}get showExistingOnly(){return this.builtInSystemOptions?.showExistingOnly}get onOpenPreferNewTab(){return this.data.onOpenPreferNewTab}set onOpenPreferNewTab(e){this.data.onOpenPreferNewTab=e}get alwaysNewTabForSymbols(){return this.data.alwaysNewTabForSymbols}set alwaysNewTabForSymbols(e){this.data.alwaysNewTabForSymbols=e}get useActiveTabForSymbolsOnMobile(){return this.data.useActiveTabForSymbolsOnMobile}set useActiveTabForSymbolsOnMobile(e){this.data.useActiveTabForSymbolsOnMobile=e}get symbolsInLineOrder(){return this.data.symbolsInLineOrder}set symbolsInLineOrder(e){this.data.symbolsInLineOrder=e}get editorListPlaceholderText(){return G.defaults.editorListCommand}get editorListCommand(){return this.data.editorListCommand}set editorListCommand(e){this.data.editorListCommand=e}get symbolListPlaceholderText(){return G.defaults.symbolListCommand}get symbolListCommand(){return this.data.symbolListCommand}set symbolListCommand(e){this.data.symbolListCommand=e}get symbolListActiveEditorCommand(){return this.data.symbolListActiveEditorCommand}set symbolListActiveEditorCommand(e){this.data.symbolListActiveEditorCommand=e}get workspaceListCommand(){return this.data.workspaceListCommand}set workspaceListCommand(e){this.data.workspaceListCommand=e}get workspaceListPlaceholderText(){return G.defaults.workspaceListCommand}get headingsListCommand(){return this.data.headingsListCommand}set headingsListCommand(e){this.data.headingsListCommand=e}get headingsListPlaceholderText(){return G.defaults.headingsListCommand}get bookmarksListCommand(){return this.data.bookmarksListCommand}set bookmarksListCommand(e){this.data.bookmarksListCommand=e}get bookmarksListPlaceholderText(){return G.defaults.bookmarksListCommand}get commandListCommand(){return this.data.commandListCommand}set commandListCommand(e){this.data.commandListCommand=e}get commandListPlaceholderText(){return G.defaults.commandListCommand}get vaultListCommand(){return this.data.vaultListCommand}set vaultListCommand(e){this.data.vaultListCommand=e}get vaultListPlaceholderText(){return G.defaults.vaultListCommand}get relatedItemsListCommand(){return this.data.relatedItemsListCommand}set relatedItemsListCommand(e){this.data.relatedItemsListCommand=e}get relatedItemsListPlaceholderText(){return G.defaults.relatedItemsListCommand}get relatedItemsListActiveEditorCommand(){return this.data.relatedItemsListActiveEditorCommand}set relatedItemsListActiveEditorCommand(e){this.data.relatedItemsListActiveEditorCommand=e}get shouldSearchHeadings(){return this.data.shouldSearchHeadings}set shouldSearchHeadings(e){this.data.shouldSearchHeadings=e}get strictHeadingsOnly(){return this.data.strictHeadingsOnly}set strictHeadingsOnly(e){this.data.strictHeadingsOnly=e}get searchAllHeadings(){return this.data.searchAllHeadings}set searchAllHeadings(e){this.data.searchAllHeadings=e}get headingsSearchDebounceMilli(){return this.data.headingsSearchDebounceMilli}set headingsSearchDebounceMilli(e){this.data.headingsSearchDebounceMilli=e}get excludeViewTypes(){return this.data.excludeViewTypes}set excludeViewTypes(e){this.data.excludeViewTypes=e}get referenceViews(){return this.data.referenceViews}set referenceViews(e){this.data.referenceViews=e}get limit(){return this.data.limit}set limit(e){this.data.limit=e}get includeSidePanelViewTypes(){return this.data.includeSidePanelViewTypes}set includeSidePanelViewTypes(e){this.data.includeSidePanelViewTypes=[...new Set(e)]}get includeSidePanelViewTypesPlaceholder(){return G.defaults.includeSidePanelViewTypes.join("\n")}get selectNearestHeading(){return this.data.selectNearestHeading}set selectNearestHeading(e){this.data.selectNearestHeading=e}get excludeFolders(){return this.data.excludeFolders}set excludeFolders(e){this.data.excludeFolders=[...new Set(e)]}get excludeLinkSubTypes(){return this.data.excludeLinkSubTypes}set excludeLinkSubTypes(e){this.data.excludeLinkSubTypes=e}get excludeRelatedFolders(){return this.data.excludeRelatedFolders}set excludeRelatedFolders(e){this.data.excludeRelatedFolders=[...new Set(e)]}get excludeOpenRelatedFiles(){return this.data.excludeOpenRelatedFiles}set excludeOpenRelatedFiles(e){this.data.excludeOpenRelatedFiles=e}get excludeObsidianIgnoredFiles(){return this.data.excludeObsidianIgnoredFiles}set excludeObsidianIgnoredFiles(e){this.data.excludeObsidianIgnoredFiles=e}get shouldSearchFilenames(){return this.data.shouldSearchFilenames}set shouldSearchFilenames(e){this.data.shouldSearchFilenames=e}get shouldSearchBookmarks(){return this.data.shouldSearchBookmarks}set shouldSearchBookmarks(e){this.data.shouldSearchBookmarks=e}get shouldSearchRecentFiles(){return this.data.shouldSearchRecentFiles}set shouldSearchRecentFiles(e){this.data.shouldSearchRecentFiles=e}get pathDisplayFormat(){return this.data.pathDisplayFormat}set pathDisplayFormat(e){this.data.pathDisplayFormat=e}get hidePathIfRoot(){return this.data.hidePathIfRoot}set hidePathIfRoot(e){this.data.hidePathIfRoot=e}get enabledRelatedItems(){return this.data.enabledRelatedItems}set enabledRelatedItems(e){this.data.enabledRelatedItems=e}get showOptionalIndicatorIcons(){return this.data.showOptionalIndicatorIcons}set showOptionalIndicatorIcons(e){this.data.showOptionalIndicatorIcons=e}get overrideStandardModeBehaviors(){return this.data.overrideStandardModeBehaviors}set overrideStandardModeBehaviors(e){this.data.overrideStandardModeBehaviors=e}get enabledRibbonCommands(){return this.data.enabledRibbonCommands}set enabledRibbonCommands(e){this.data.enabledRibbonCommands=[...new Set(e)]}get fileExtAllowList(){return this.data.fileExtAllowList}set fileExtAllowList(e){this.data.fileExtAllowList=e}get matchPriorityAdjustments(){return this.data.matchPriorityAdjustments}set matchPriorityAdjustments(e){this.data.matchPriorityAdjustments=e}get quickFilters(){return this.data.quickFilters}set quickFilters(e){this.data.quickFilters=e}get preserveCommandPaletteLastInput(){return this.data.preserveCommandPaletteLastInput}set preserveCommandPaletteLastInput(e){this.data.preserveCommandPaletteLastInput=e}get preserveQuickSwitcherLastInput(){return this.data.preserveQuickSwitcherLastInput}set preserveQuickSwitcherLastInput(e){this.data.preserveQuickSwitcherLastInput=e}get shouldCloseModalOnBackspace(){return this.data.shouldCloseModalOnBackspace}set shouldCloseModalOnBackspace(e){this.data.shouldCloseModalOnBackspace=e}get maxRecentFileSuggestionsOnInit(){return this.data.maxRecentFileSuggestionsOnInit}set maxRecentFileSuggestionsOnInit(e){this.data.maxRecentFileSuggestionsOnInit=e}get orderEditorListByAccessTime(){return this.data.orderEditorListByAccessTime}set orderEditorListByAccessTime(e){this.data.orderEditorListByAccessTime=e}get insertLinkInEditor(){return this.data.insertLinkInEditor}set insertLinkInEditor(e){this.data.insertLinkInEditor=e}get removeDefaultTabBinding(){return this.data.removeDefaultTabBinding}set removeDefaultTabBinding(e){this.data.removeDefaultTabBinding=e}get navigationKeys(){return this.data.navigationKeys}set navigationKeys(e){this.data.navigationKeys=e}get preferredSourceForTitle(){return this.data.preferredSourceForTitle}set preferredSourceForTitle(e){this.data.preferredSourceForTitle=e}get closeWhenEmptyKeys(){return this.data.closeWhenEmptyKeys}set closeWhenEmptyKeys(e){this.data.closeWhenEmptyKeys=e}get navigateToHotkeySelectorKeys(){return this.data.navigateToHotkeySelectorKeys}set navigateToHotkeySelectorKeys(e){this.data.navigateToHotkeySelectorKeys=e}get togglePinnedCommandKeys(){return this.data.togglePinnedCommandKeys}set togglePinnedCommandKeys(e){this.data.togglePinnedCommandKeys=e}get escapeCmdChar(){return this.data.escapeCmdChar}set escapeCmdChar(e){this.data.escapeCmdChar=e}get mobileLauncher(){return this.data.mobileLauncher}set mobileLauncher(e){this.data.mobileLauncher=e}get allowCreateNewFileInModeNames(){return this.data.allowCreateNewFileInModeNames}set allowCreateNewFileInModeNames(e){this.data.allowCreateNewFileInModeNames=[...new Set(e)]}get showModeTriggerInstructions(){return this.data.showModeTriggerInstructions}set showModeTriggerInstructions(e){this.data.showModeTriggerInstructions=e}get renderMarkdownContentInSuggestions(){return this.data.renderMarkdownContentInSuggestions}set renderMarkdownContentInSuggestions(e){this.data.renderMarkdownContentInSuggestions=e}get quickOpen(){return this.data.quickOpen}set quickOpen(e){this.data.quickOpen=e}get openDefaultApp(){return this.data.openDefaultApp}set openDefaultApp(e){this.data.openDefaultApp=e}constructor(e){this.plugin=e,this.data=G.defaults}async updateDataAndLoadSettings(){return await G.transformDataFile(this.plugin,G.defaults),await this.loadSettings()}async loadSettings(){try{const e=await(this.plugin?.loadData());if(e){const t=Object.keys(G.defaults);((e,t,s)=>{const i=["matchPriorityAdjustments","quickFilters"],n=s=>z.withOptions({mergeArrays:!1},t[s],e[s]);for(const a of s)a in e&&(t[a]=i.includes(a)?n(a):e[a])})(e,this.data,t)}}catch(e){console.log("Switcher++: error loading settings, using defaults. ",e)}}async saveSettings(){const{plugin:e,data:t}=this;await(e?.saveData(t))}save(){this.saveSettings().catch((e=>{console.log("Switcher++: error saving changes to settings",e)}))}isSymbolTypeEnabled(e){const{enabledSymbolTypes:t}=this.data;let s=G.defaults.enabledSymbolTypes[e];return Object.prototype.hasOwnProperty.call(t,e)&&(s=t[e]),s}setSymbolTypeEnabled(e,t){this.data.enabledSymbolTypes[e]=t}static async transformDataFile(e,t){await G.transformDataFileToV1(e,t),await G.transformDataFileToV2(e,t)}static async transformDataFileToV1(e,t){let s=!1;try{const i=await(e?.loadData());if(i&&"object"==typeof i){const n="version";if(!Object.prototype.hasOwnProperty.call(i,n)){const a="starredListCommand";Object.prototype.hasOwnProperty.call(i,a)&&(i.bookmarksListCommand=i[a]??t.bookmarksListCommand,delete i[a]);const o="isStarred",r=i.matchPriorityAdjustments;r&&Object.prototype.hasOwnProperty.call(r,o)&&(r.isBookmarked=r[o],delete r[o]),i[n]="1.0.0",await(e?.saveData(i)),s=!0}}}catch(e){console.log("Switcher++: error transforming data.json to v1.0.0",e)}return s}static async transformDataFileToV2(e,t){let s=!1;try{const i=await(e?.loadData());if(i&&"object"==typeof i){const n="version";if("1.0.0"===i[n]){const a="matchPriorityAdjustments";if(Object.prototype.hasOwnProperty.call(i,a)){const e=i[a],s={};i[a]={isEnabled:!!i.enableMatchPriorityAdjustments,adjustments:s},delete i.enableMatchPriorityAdjustments,Object.entries(e).forEach((([e,i])=>{const n=t.matchPriorityAdjustments.adjustments[e]?.label??"";s[e]={value:i,label:n}}))}const o="quickFilters";if(Object.prototype.hasOwnProperty.call(i,o)){const e="facetList",t=i[o],s=t[e],n=s?.reduce(((e,t)=>(e[t.id]=t,e)),{});t[e]=n}i[n]="2.0.0",await(e?.saveData(i)),s=!0}}}catch(e){console.log("Switcher++: error transforming data.json to v2.0.0",e)}return s}}class J{constructor(e,t,s){this.app=e,this.mainSettingsTab=t,this.config=s}createSetting(e,t,s){const i=new n.Setting(e);return i.setName(t),i.setDesc(s),i}addSectionTitle(e,t,s=""){const i=this.createSetting(e,t,s);return i.setHeading(),i}addTextSetting(e,t,s,i,n,a){const o=this.createSetting(e,t,s);return o.addText((e=>{e.setPlaceholder(a),e.setValue(i),e.onChange((e=>{const t=e.length?e:i;this.saveChangesToConfig(n,t)}))})),o}addToggleSetting(e,t,s,i,n,a){const o=this.createSetting(e,t,s);return o.addToggle((e=>{e.setValue(i),e.onChange((e=>{a?a(e,this.config):this.saveChangesToConfig(n,e)}))})),o}addTextAreaSetting(e,t,s,i,n,a){const o=this.createSetting(e,t,s);return o.addTextArea((e=>{e.setPlaceholder(a),e.setValue(i),e.onChange((e=>{const t=e.length?e:i,s=Array.isArray(this.config[n]);this.saveChangesToConfig(n,s?t.split("\n"):t)}))})),o}addDropdownSetting(e,t,s,i,n,a,o){const r=this.createSetting(e,t,s);return r.addDropdown((e=>{e.addOptions(n),e.setValue(i),e.onChange((e=>{o?o(e,this.config):this.saveChangesToConfig(a,e)}))})),r}addSliderSetting(e,t,s,i,n,a,o){const r=this.createSetting(e,t,s);return r.addExtraButton((e=>(e.setIcon("lucide-rotate-ccw"),e.setTooltip("Restore default"),e.onClick((()=>r.components[1].setValue(0))),e))),r.addSlider((e=>{e.setLimits(n[0],n[1],n[2]),e.setValue(i),e.setDynamicTooltip(),e.onChange((e=>{o?o(e,this.config):this.saveChangesToConfig(a,e)}))})),r}saveChangesToConfig(e,t){if(e){const{config:s}=this;s[e]=t,s.save()}}}class X extends J{display(e){const{config:t}=this;this.addSectionTitle(e,"Bookmarks List Mode Settings"),this.addTextSetting(e,"Bookmarks list mode trigger","Character that will trigger bookmarks list mode in the switcher",t.bookmarksListCommand,"bookmarksListCommand",t.bookmarksListPlaceholderText)}}class Y extends J{display(e){const{config:t}=this;this.addSectionTitle(e,"Command List Mode Settings"),this.addTextSetting(e,"Command list mode trigger","Character that will trigger command list mode in the switcher",t.commandListCommand,"commandListCommand",t.commandListPlaceholderText)}}class Z extends J{display(e){const{config:t}=this;this.addSectionTitle(e,"Related Items List Mode Settings"),this.addTextSetting(e,"Related Items list mode trigger","Character that will trigger related items list mode in the switcher. This triggers a display of Related Items for the source file of the currently selected (highlighted) suggestion in the switcher. If there is not a suggestion, display results for the active editor.",t.relatedItemsListCommand,"relatedItemsListCommand",t.relatedItemsListPlaceholderText),this.addTextSetting(e,"Related Items list mode trigger - Active editor only","Character that will trigger related items list mode in the switcher. This always triggers a display of Related Items for the active editor only.",t.relatedItemsListActiveEditorCommand,"relatedItemsListActiveEditorCommand",t.relatedItemsListActiveEditorCommand),this.showEnabledRelatedItems(e,t),this.addToggleSetting(e,"Exclude open files","Enable, related files which are already open will not be displayed in the list. Disabled, All related files will be displayed in the list.",t.excludeOpenRelatedFiles,"excludeOpenRelatedFiles")}showEnabledRelatedItems(e,t){const s=Object.values(d).sort(),i=s.join(", "),n=`The types of related items to show in the list. Add one type per line. Available types: ${i}`;this.createSetting(e,"Show related item types",n).addTextArea((e=>{e.setValue(t.enabledRelatedItems.join("\n")),e.inputEl.addEventListener("focusout",(()=>{const n=e.getValue().split("\n").map((e=>e.trim())).filter((e=>e.length>0)),a=[...new Set(n)].filter((e=>!s.includes(e)));a?.length?this.showErrorPopup(a.join("
"),i):(t.enabledRelatedItems=n,t.save())}))}))}showErrorPopup(e,t){const s=new n.Modal(this.app);s.titleEl.setText("Invalid related item type"),s.contentEl.innerHTML=`Changes not saved. Available relation types are: ${t}. The following types are invalid:

${e}`,s.open()}}class ee extends J{display(e){const{config:t}=this;this.addSectionTitle(e,"General Settings"),this.showEnabledRibbonCommands(e,t),this.showOverrideMobileLauncher(e,t),this.showPreferredSourceForTitle(e,t),this.showPathDisplayFormat(e,t),this.addToggleSetting(e,"Hide path for root items","When enabled, path information will be hidden for items at the root of the vault.",t.hidePathIfRoot,"hidePathIfRoot").setClass("qsp-setting-item-indent"),this.addTextSetting(e,"Mode trigger escape character","Character to indicate that a mode trigger character should be treated just as a normal text.",t.escapeCmdChar,"escapeCmdChar"),this.addToggleSetting(e,"Default to open in new tab","When enabled, navigating to un-opened files will open a new editor tab whenever possible (as if cmd/ctrl were held). When the file is already open, the existing tab will be activated. This overrides all other tab settings.",t.onOpenPreferNewTab,"onOpenPreferNewTab"),this.addToggleSetting(e,"Override Standard mode behavior","When enabled, Switcher++ will change the default Obsidian builtin Switcher functionality (Standard mode) to inject custom behavior.",t.overrideStandardModeBehaviors,"overrideStandardModeBehaviors"),this.addToggleSetting(e,"Show indicator icons","Display icons to indicate that an item is recent, bookmarked, etc..",t.showOptionalIndicatorIcons,"showOptionalIndicatorIcons"),this.addToggleSetting(e,"Allow Backspace key to close the Switcher","When the search box is empty, pressing the backspace key will close Switcher++.",t.shouldCloseModalOnBackspace,"shouldCloseModalOnBackspace"),this.showMatchPriorityAdjustments(e,t),this.showInsertLinkInEditor(e,t),this.addToggleSetting(e,"Restore previous input in Command Mode","When enabled, restore the last typed input in Command Mode when launched via global command hotkey.",t.preserveCommandPaletteLastInput,"preserveCommandPaletteLastInput"),this.addToggleSetting(e,"Restore previous input","When enabled, restore the last typed input when launched via global command hotkey.",t.preserveQuickSwitcherLastInput,"preserveQuickSwitcherLastInput"),this.addToggleSetting(e,"Display mode trigger instructions","When enabled, the trigger key for each mode will be displayed in the instructions section of the Switcher.",t.showModeTriggerInstructions,"showModeTriggerInstructions"),this.showResetFacetEachSession(e,t),this.showRenderMarkdownContentAsHTML(e,t),this.showQuickOpen(e,t)}showPreferredSourceForTitle(e,t){this.addDropdownSetting(e,"Preferred suggestion title source",'The preferred source to use for the "title" text that will be searched and displayed for file based suggestions',t.preferredSourceForTitle,{H1:"First H₁ heading",Default:"Default"},"preferredSourceForTitle")}showPathDisplayFormat(t,s){const i={};i[e.None.toString()]="Hide path",i[e.Full.toString()]="Full path",i[e.FolderOnly.toString()]="Only parent folder",i[e.FolderWithFilename.toString()]="Parent folder & filename",i[e.FolderPathFilenameOptional.toString()]="Parent folder path (filename optional)",this.addDropdownSetting(t,"Preferred file path display format","The preferred way to display file paths in suggestions",s.pathDisplayFormat.toString(),i,null,((e,t)=>{t.pathDisplayFormat=Number(e),t.save()}))}showEnabledRibbonCommands(e,t){const s=L(),i=s.join(" "),n=`Display an icon in the ribbon menu to launch specific modes. Add one mode per line. Available modes: ${i}`;this.createSetting(e,"Show ribbon icons",n).addTextArea((e=>{e.setValue(t.enabledRibbonCommands.join("\n")),e.inputEl.addEventListener("focusout",(()=>{const n=e.getValue().split("\n").map((e=>e.trim())).filter((e=>e.length>0)),a=Array.from(new Set(n)).filter((e=>!s.includes(e)));a.length?this.showErrorPopup(a.join("
"),i):(t.enabledRibbonCommands=n,t.save(),this.mainSettingsTab.plugin.registerRibbonCommandIcons())}))}))}showErrorPopup(e,t){const s=new n.Modal(this.app);s.titleEl.setText("Invalid mode"),s.contentEl.innerHTML=`Changes not saved. Available modes are: ${t}. The following are invalid:

${e}`,s.open()}showOverrideMobileLauncher(e,t){const{mobileLauncher:s}=t,i="disabled",n={[i]:"Do not override"},a=L();a.forEach((e=>{n[e]=e}));let o=i;s.isEnabled&&a.includes(s.modeString)&&(o=s.modeString),this.addDropdownSetting(e,'Override default Switcher launch button (the "⊕" button) on mobile platforms','Override the "⊕" button (in the Navigation Bar) on mobile platforms to launch Switcher++ instead of the default system switcher. Select the Mode to launch Switcher++ in, or select "Do not override" to disable the feature.',o,n,null,((e,t)=>{const s=e!==i;t.mobileLauncher.isEnabled=s,s&&(t.mobileLauncher.modeString=e),t.save(),this.mainSettingsTab.plugin.updateMobileLauncherButtonOverride(s)}))}showMatchPriorityAdjustments(e,t){const{matchPriorityAdjustments:{isEnabled:s,adjustments:i,fileExtAdjustments:n}}=t;this.addToggleSetting(e,"Result priority adjustments","Artificially increase the match score of the specified item types by a fixed percentage so they appear higher in the results list (does not apply to Standard Mode).",s,null,((e,t)=>{t.matchPriorityAdjustments.isEnabled=e,t.saveSettings().then((()=>{this.mainSettingsTab.display()}),(e=>console.log('Switcher++: error saving "Result Priority Adjustments" setting. ',e)))})),s&&[i,n].forEach((t=>{Object.entries(t).forEach((([s,i])=>{const{value:n,label:a}=i,o=this.addSliderSetting(e,a,i.desc??"",n,[-1,1,.05],null,((e,i)=>{t[s].value=e,i.save()}));o.setClass("qsp-setting-item-indent")}))}))}showResetFacetEachSession(e,t){this.addToggleSetting(e,"Reset active Quick Filters","When enabled, the switcher will reset all Quick Filters back to inactive for each session.",t.quickFilters.shouldResetActiveFacets,null,((e,t)=>{t.quickFilters.shouldResetActiveFacets=e,t.save()}))}showRenderMarkdownContentAsHTML(e,t){const s=this.addToggleSetting(e,"Display Headings as Live Preview",'When enabled, Headings will be rendered as HTML similar to the Obsidian "Live Preview" display. When disabled, Headings will be rendered as raw text. Use the "toggle preview (selected heading)" hotkey to toggle the display for individual headings.',t.renderMarkdownContentInSuggestions.renderHeadings,null,((e,t)=>{const{renderMarkdownContentInSuggestions:s}=t;s.renderHeadings=e,s.isEnabled=e,t.save()}));s?.nameEl?.createSpan({cls:["qsp-tag","qsp-warning"],text:"Experimental"})}showInsertLinkInEditor(e,t){this.createSetting(e,"Insert link in editor","");let s=this.addToggleSetting(e,"Use filename as alias","When enabled, the file basename will be set as the link alias.",t.insertLinkInEditor.useBasenameAsAlias,null,((e,t)=>{t.insertLinkInEditor.useBasenameAsAlias=e,t.save()}));s.setClass("qsp-setting-item-indent"),s=this.addToggleSetting(e,"Use heading as alias",'When enabled, the file heading will be set as the link alias. This overrides the "use filename as alias" setting.',t.insertLinkInEditor.useHeadingAsAlias,null,((e,t)=>{t.insertLinkInEditor.useHeadingAsAlias=e,t.save()})),s.setClass("qsp-setting-item-indent")}showQuickOpen(e,t){this.addToggleSetting(e,"Enable quick open hotkeys for top results","When enabled, hotkeys will be defined for each of the top N results displayed in the Switcher. These hotkeys can be used to quickly open the associated suggestion directly. when disabled, no hotkeys are defined.",t.quickOpen.isEnabled,null,((e,t)=>{t.quickOpen.isEnabled=e,t.save()}))}}class te extends J{display(e){const{config:t}=this;this.addSectionTitle(e,"Workspace List Mode Settings"),this.addTextSetting(e,"Workspace list mode trigger","Character that will trigger workspace list mode in the switcher",t.workspaceListCommand,"workspaceListCommand",t.workspaceListPlaceholderText)}}class se extends J{display(e){const{config:t}=this;this.addSectionTitle(e,"Editor List Mode Settings"),this.addTextSetting(e,"Editor list mode trigger","Character that will trigger editor list mode in the switcher",t.editorListCommand,"editorListCommand",t.editorListPlaceholderText),this.showIncludeSidePanelViews(e,t),this.addToggleSetting(e,"Order default editor list by most recently accessed","When there is no search term, order the list of editors by most recent access time.",t.orderEditorListByAccessTime,"orderEditorListByAccessTime")}showIncludeSidePanelViews(e,t){const s=`When in Editor list mode, show the following view types from the side panels. Add one view type per line. Available view types: ${Object.keys(this.app.viewRegistry.viewByType).sort().join(" ")}`;this.addTextAreaSetting(e,"Include side panel views",s,t.includeSidePanelViewTypes.join("\n"),"includeSidePanelViewTypes",t.includeSidePanelViewTypesPlaceholder)}}class ie extends J{display(e){const{config:t}=this;this.addSectionTitle(e,"Headings List Mode Settings"),this.addTextSetting(e,"Headings list mode trigger","Character that will trigger headings list mode in the switcher",t.headingsListCommand,"headingsListCommand",t.headingsListPlaceholderText),this.showHeadingSettings(e,t),this.addToggleSetting(e,"Search Filenames","Enabled, search and show suggestions for filenames. Disabled, Don't search through filenames (except for fallback searches)",t.shouldSearchFilenames,"shouldSearchFilenames"),this.addToggleSetting(e,"Search Bookmarks","Enabled, search and show suggestions for Bookmarks. Disabled, Don't search through Bookmarks",t.shouldSearchBookmarks,"shouldSearchBookmarks"),this.addSliderSetting(e,"Max recent files to show","The maximum number of recent files to show when there is no search term",t.maxRecentFileSuggestionsOnInit,[0,75,1],"maxRecentFileSuggestionsOnInit"),this.showExcludeFolders(e,t),this.addToggleSetting(e,'Hide Obsidian "Excluded files"','Enabled, do not display suggestions for files that are in Obsidian\'s "Options > Files & Links > Excluded files" list. Disabled, suggestions for those files will be displayed but downranked.',t.excludeObsidianIgnoredFiles,"excludeObsidianIgnoredFiles"),this.showFileExtAllowList(e,t)}showHeadingSettings(e,t){const s=t.shouldSearchHeadings;if(this.addToggleSetting(e,"Search Headings","Enabled, search and show suggestions for Headings. Disabled, Don't search through Headings",s,null,((e,t)=>{t.shouldSearchHeadings=e,t.saveSettings().then((()=>{this.mainSettingsTab.display()}),(e=>console.log('Switcher++: error saving "Search Headings" setting. ',e)))})),s){let s=this.addToggleSetting(e,"Turn off filename fallback","Enabled, strictly search through only the headings contained in the file. Do not fallback to searching the filename when an H1 match is not found. Disabled, fallback to searching against the filename when there is not a match in the first H1 contained in the file.",t.strictHeadingsOnly,"strictHeadingsOnly");s.setClass("qsp-setting-item-indent"),s=this.addToggleSetting(e,"Search all headings","Enabled, search through all headings contained in each file. Disabled, only search through the first H1 in each file.",t.searchAllHeadings,"searchAllHeadings"),s.setClass("qsp-setting-item-indent")}}showFileExtAllowList(e,t){this.createSetting(e,"File extension override",'Override the "Show attachments" and the "Show all file types" builtin, system Switcher settings and always search files with the listed extensions. Add one path per line. For example to add ".canvas" file extension, just add "canvas".').addTextArea((e=>{e.setValue(t.fileExtAllowList.join("\n")),e.inputEl.addEventListener("focusout",(()=>{const s=e.getValue().split("\n").map((e=>e.trim())).filter((e=>e.length>0));t.fileExtAllowList=s,t.save()}))}))}showExcludeFolders(e,t){const s="Exclude folders";this.createSetting(e,s,"When in Headings list mode, folder path that match any regex listed here will not be searched for suggestions. Path should start from the Vault Root. Add one path per line.").addTextArea((e=>{e.setValue(t.excludeFolders.join("\n")),e.inputEl.addEventListener("focusout",(()=>{const i=e.getValue().split("\n").filter((e=>e.length>0));this.validateExcludeFolderList(s,i)&&(t.excludeFolders=i,t.save())}))}))}validateExcludeFolderList(e,t){let s=!0,i="";for(const e of t)try{new RegExp(e)}catch(t){i+=`${e}
${t}

`,s=!1}if(!s){const t=new n.Modal(this.app);t.titleEl.setText(e),t.contentEl.innerHTML=`Changes not saved. The following regex contain errors:

${i}`,t.open()}return s}}class ne extends J{display(e){const{config:t}=this;this.addSectionTitle(e,"Symbol List Mode Settings"),this.addTextSetting(e,"Symbol list mode trigger","Character that will trigger symbol list mode in the switcher. This triggers a display of Symbols for the source file of the currently selected (highlighted) suggestion in the switcher. If there is not a suggestion, display results for the active editor.",t.symbolListCommand,"symbolListCommand",t.symbolListPlaceholderText),this.addTextSetting(e,"Symbol list mode trigger - Active editor only","Character that will trigger symbol list mode in the switcher. This always triggers a display of Symbols for the active editor only.",t.symbolListActiveEditorCommand,"symbolListActiveEditorCommand",t.symbolListActiveEditorCommand),this.addToggleSetting(e,"List symbols as indented outline","Enabled, symbols will be displayed in the (line) order they appear in the source text, indented under any preceding heading. Disabled, symbols will be grouped by type: Headings, Tags, Links, Embeds.",t.symbolsInLineOrder,"symbolsInLineOrder"),this.addToggleSetting(e,"Open Symbols in new tab","Enabled, always open a new tab when navigating to Symbols. Disabled, navigate in an already open tab (if one exists).",t.alwaysNewTabForSymbols,"alwaysNewTabForSymbols"),this.addToggleSetting(e,"Open Symbols in active tab on mobile devices","Enabled, navigate to the target file and symbol in the active editor tab. Disabled, open a new tab when navigating to Symbols, even on mobile devices.",t.useActiveTabForSymbolsOnMobile,"useActiveTabForSymbolsOnMobile"),this.addToggleSetting(e,"Auto-select nearest heading","Enabled, in an unfiltered symbol list, select the closest preceding Heading to the current cursor position. Disabled, the first symbol in the list is selected.",t.selectNearestHeading,"selectNearestHeading"),this.showEnableSymbolTypesToggle(e,t),this.showEnableLinksToggle(e,t)}showEnableSymbolTypesToggle(e,t){[["Show Headings",s.Heading],["Show Tags",s.Tag],["Show Embeds",s.Embed],["Show Callouts",s.Callout]].forEach((([s,i])=>{this.addToggleSetting(e,s,"",t.isSymbolTypeEnabled(i),null,(e=>{t.setSymbolTypeEnabled(i,e),t.save()}))}))}showEnableLinksToggle(e,t){const n=t.isSymbolTypeEnabled(s.Link);if(this.addToggleSetting(e,"Show Links","",n,null,(e=>{t.setSymbolTypeEnabled(s.Link,e),t.saveSettings().then((()=>{this.mainSettingsTab.display()}),(e=>console.log('Switcher++: error saving "Show Links" setting. ',e)))})),n){[["Links to headings",i.Heading],["Links to blocks",i.Block]].forEach((([s,i])=>{const n=(t.excludeLinkSubTypes&i)===i;this.addToggleSetting(e,s,"",!n,null,(e=>this.saveEnableSubLinkChange(i,e))).setClass("qsp-setting-item-indent")}))}}saveEnableSubLinkChange(e,t){const{config:s}=this;let i=s.excludeLinkSubTypes;t?i&=~e:i|=e,s.excludeLinkSubTypes=i,s.save()}}class ae extends J{display(e){const{config:t}=this,s=this.addSectionTitle(e,"Vault List Mode Settings");s.nameEl?.createSpan({cls:["qsp-tag","qsp-warning"],text:"Experimental"}),this.addTextSetting(e,"Vault list mode trigger","Character that will trigger vault list mode in the switcher",t.vaultListCommand,"vaultListCommand",t.vaultListPlaceholderText)}}class oe extends n.PluginSettingTab{constructor(e,t,s){super(e,t),this.plugin=t,this.config=s}display(){const{containerEl:e}=this,t=[ee,ne,ie,se,Z,X,Y,te,ae];e.empty(),e.createEl("h2",{text:"Quick Switcher++ Settings"}),t.forEach((e=>{this.displayTabSection(e)}))}displayTabSection(e){const{app:t,config:s,containerEl:i}=this;new e(t,this,s).display(i)}}class re{static get defaultParsedCommand(){return{isValidated:!1,index:-1,parsedInput:null}}get parsedInputQuery(){const e=(this.parsedCommand()?.parsedInput??"").trim().toLowerCase();return{query:e,hasSearchTerm:!!e.length}}get inputTextSansEscapeChar(){return this._inputTextSansEscapeChar??this.inputText}set inputTextSansEscapeChar(e){this._inputTextSansEscapeChar=e}constructor(e="",s=t.Standard,i){this.inputText=e,this.mode=s,this._inputTextSansEscapeChar=null,this.currentWorkspaceEnvList={openWorkspaceLeaves:new Set,openWorkspaceFiles:new Set,fileBookmarks:new Map,nonFileBookmarks:new Set,mostRecentFiles:new Set,attachmentFileExtensions:new Set},this.sessionOpts=i??{};const n=w();this.parsedCommands={},L().forEach((e=>{const s=t[e];n.includes(s)?this.parsedCommands[s]={...re.defaultParsedCommand,source:null}:this.parsedCommands[s]=re.defaultParsedCommand}))}parsedCommand(e){return e=e??this.mode,this.parsedCommands[e]}}class le{constructor(e,t){this.app=e,this.settings=t}reset(){}onNoResultsCreateAction(e,t){return!1}getFacets(e){if(!this.facets){const t=this.settings?.quickFilters?.facetList;t&&(this.facets=Object.values(t).filter((t=>t.mode===e)))}return this.facets??[]}getAvailableFacets(e){return this.getFacets(e.mode).filter((e=>e.isAvailable))}activateFacet(e,t){e.forEach((e=>e.isActive=t)),this.settings.quickFilters.shouldResetActiveFacets||this.settings.save()}getActiveFacetIds(e){const t=this.getAvailableFacets(e).filter((e=>e.isActive)).map((e=>e.id));return new Set(t)}isFacetedWith(e,t){const s=!!e.size;return s&&e.has(t)||!s}getEditorInfo(e){const{excludeViewTypes:t}=this.settings;let s=null,i=!1,n=null;if(e){s=A(e),n=this.getCursorPosition(e);i=!t.includes(e.view.getViewType())&&!!s}return{isValidSource:i,leaf:e,file:s,suggestion:null,cursor:n}}getSuggestionInfo(e){const t=this.getSourceInfoFromSuggestion(e);let s=t.leaf;t.isValidSource&&({leaf:s}=this.findMatchingLeaf(t.file,t.leaf));const i=this.getCursorPosition(s);return{...t,leaf:s,cursor:i}}getSourceInfoFromSuggestion(e){let t=null,s=null;const i=[r.SymbolList,r.Unresolved,r.WorkspaceList,r.CommandList,r.VaultList];e&&!i.includes(e.type)&&(t=e.file),c(e,"type",r.EditorList)&&(s=e.item);return{isValidSource:!!t,leaf:s,file:t,suggestion:e}}getCursorPosition(e){let t=null;if(function(e,t){return e?.view?.getViewType()===t&&!e.isDeferred}(e,"markdown")){const s=e.view;"preview"!==s.getMode()&&(t=s.editor.getCursor("head"))}return t}getTitleText(e){const t=function(e){let t=null;if(e){const{path:s}=e;if(t=s,"md"===e.extension){const e=s.lastIndexOf(".");-1!==e&&e!==s.length-1&&0!==e&&(t=s.slice(0,e))}}return t}(e),s=this.getFirstH1(e);return s?.heading??t}getFirstH1(e){return le.getFirstH1(e,this.app.metadataCache)}static getFirstH1(e,t){let s=null;const i=t.getFileCache(e)?.headings?.filter((e=>1===e.level))??[];return i.length&&(s=i.reduce(((e,t)=>{const{line:s}=t.position.start;return s{let o=!1;if(i?.view){const r=a.includes(i.view.getViewType()),l=s||!r,d=n&&a.includes(t.view.getViewType());l&&(o=!n||!s&&d?A(i)===e:i===t)}return o},d=this.getActiveLeaf();if(l(d))i=d;else{const e=this.getOpenLeaves(o,r);i=[t,...e].find(l)}return{leaf:i??null,file:e,suggestion:null,isValidSource:!1}}extractTabNavigationType(e,t,s){const i=e?.shiftKey?"horizontal":"vertical",a=e?.key;let o=n.Keymap.isModEvent(e)??!1;return!0!==o&&"tab"!==o||("o"===a?o="window":"\\"===a&&(o="split")),o=this.applyTabCreationPreferences(o,t,s),{navType:o,splitDirection:i}}applyTabCreationPreferences(e,s=!1,i){let a=e;const{onOpenPreferNewTab:o,alwaysNewTabForSymbols:r,useActiveTabForSymbolsOnMobile:l}=this.settings;return!1===e&&(o?a=!s:i===t.SymbolList&&(a=n.Platform.isMobile?!l:r)),a}isMainPanelLeaf(e){const{workspace:t}=this.app,s=e?.getRoot();return s===t.rootSplit||s===t.floatingSplit}async activateLeaf(e,t){const{workspace:s}=this.app;try{await s.revealLeaf(e),s.setActiveLeaf(e,{focus:!0}),e.view.setEphemeralState({focus:!0,...t})}catch(t){const s=e?.getDisplayText();console.log(`Switcher++: error activating WorkspaceLeaf with title: ${s}`,t)}}getOpenLeaves(e,t,s){const i=[];return this.app.workspace.iterateAllLeaves((s=>{const n=s?.view?.getViewType();this.isMainPanelLeaf(s)?e?.includes(n)||i.push(s):t?.includes(n)&&i.push(s)})),s?.orderByAccessTime&&i.sort(((e,t)=>{const s=e?.activeTime??0;return(t?.activeTime??0)-s})),i}async openFileInLeaf(e,t,s,i="vertical"){const{workspace:n}=this.app,a="split"===t?n.getLeaf(t,i):n.getLeaf(t);await a.openFile(e,s)}navigateToLeafOrOpenFile(e,t,s,i,n,a,o=!1){this.navigateToLeafOrOpenFileAsync(e,t,i,n,a,o).catch((e=>{console.log(`Switcher++: error navigating to open file. ${s}`,e)}))}async navigateToLeafOrOpenFileAsync(e,t,s,i,n,a=!1){const{leaf:o}=this.findMatchingLeaf(t,i,a),r=!!o,{navType:l,splitDirection:d}=this.extractTabNavigationType(e,r,n);await this.activateLeafOrOpenFile(l,t,o,s,d)}async activateLeafOrOpenFile(e,t,s,i,n){if(i=i??{active:!0,eState:{active:!0,focus:!0}},s&&!1===e){const e=i?.eState;await this.activateLeaf(s,e)}else await this.openFileInLeaf(t,e,i,n)}renderPath(t,s,i,a,o){if(t&&s){const r=s.parent.isRoot();let l=this.settings.pathDisplayFormat,d=l===e.None||r&&this.settings.hidePathIfRoot;if(o&&(l=e.FolderPathFilenameOptional,d=!1),!d){const e=t.createDiv({cls:["suggestion-note","qsp-note"]}),o=this.getPathDisplayText(s,l,i),r=e.createSpan({cls:["qsp-path-indicator"]});n.setIcon(r,"folder");const d=e.createSpan({cls:"qsp-path"});n.renderResults(d,o,a)}}}getPathDisplayText(t,s,i){let a="";if(t){const{parent:o}=t,r=o.name,l=o.isRoot(),d=this.app.vault.getRoot().path;switch(s){case e.FolderWithFilename:a=l?`${t.name}`:n.normalizePath(`${r}/${t.name}`);break;case e.FolderOnly:a=l?d:r;break;case e.Full:a=t.path;break;case e.FolderPathFilenameOptional:i?(a=o.path,l||(a+=d)):a=this.getPathDisplayText(t,e.Full)}}return a}renderContent(e,t,s,i){const{contentEl:a,titleEl:o}=le.createContentStructureElements(e);return n.renderResults(o,t,s,i),a}static createContentStructureElements(e){const t=e.createDiv({cls:["suggestion-content","qsp-content"]}),s=t.createDiv({cls:["suggestion-title","qsp-title"]});return{contentEl:t,titleEl:s}}static renderMarkdownContentAsync(e,t,s,i){le.renderMarkdownContent(e,t,s,i,H.getRootComponent()).catch((e=>{console.log("Switcher++: error rendering markdown to html. ",e,`content: ${s}`)}))}static async renderMarkdownContent(e,t,s,i,a){const o=t.createSpan({cls:["qsp-rendered-container"]});if(await n.MarkdownRenderer.render(e,s,o,i,a),1===o.childNodes.length&&"P"===o.firstChild.nodeName){const e=o.firstChild;e.replaceWith(...Array.from(e.childNodes))}return o}addClassesToSuggestionContainer(e,t){const s=["mod-complex"];t&&s.push(...t),e?.addClasses(s)}splitSearchMatchesAtBasename(e,t){let s=null,i=null;const n=(e,t)=>{e.forEach((e=>{e[0]-=t,e[1]-=t}))};if(e&&t?.matches){const a=e.path.lastIndexOf(e.basename);if(a>=0){const{matches:e,score:o}=t,r=e[0][0],l=e[e.length-1][1];if(r>=a)s=t,n(s.matches,a);else if(l<=a)i=t;else{let t=e.length;for(;t--;){const r=e[t][0],l=t+1;if(e[t][1]<=a){i={score:o,matches:e.slice(0,l)},s={score:o,matches:e.slice(l)},n(s.matches,a);break}if(r{t=t??o;let s=0;return Object.prototype.hasOwnProperty.call(t,e)&&(s=Number(t[e]?.value)),isNaN(s)?0:s},h=(t,s)=>{let i=0;return(null!==t&&t===n||e[s])&&(i=c(s)),i};d+=h(r.Bookmark,"isBookmarked"),d+=h(r.EditorList,"isOpenInEditor"),d+=h(null,"isRecent"),d+=h(null,"isAttachment"),d+=c(a?.extension,l),u(e)&&(d+=c(`h${e.item?.level}`));const m=n.toString();d+=c(m),i.score+=Math.abs(i.score)/100*(100*d)}}return e}static updateWorkspaceEnvListStatus(e,t){if(e&&t?.file){const{file:s}=t;t.isOpenInEditor=e.openWorkspaceFiles?.has(s),t.isRecent=e.mostRecentFiles?.has(s),t.isBookmarked=e.fileBookmarks?.has(s),t.isAttachment=e.attachmentFileExtensions?.has(s.extension)}return t}renderFileCreationSuggestion(e,t){this.addClassesToSuggestionContainer(e);const s=this.renderContent(e,t,null),i=this.createFlairContainer(e);return i?.createSpan({cls:"suggestion-hotkey",text:"Enter to create"}),s}createFile(e,t){const{workspace:s}=this.app,{navType:i}=this.extractTabNavigationType(t),a=s.getActiveViewOfType(n.FileView);let o="";a?.file&&(o=a.file.path),s.openLinkText(e,o,i,{active:!0}).catch((e=>{console.log("Switcher++: error creating new file. ",e)}))}}class de{constructor(e,t){this.useSimpleSearch=t,this.query=(e??"").trim().toLowerCase(),this.hasSearchTerm=!!this.query.length}static create(e,t=!1){return new de(e,t)}searchWithFallback(e,t){let s,i=l.None,n=null,a=this.searchAndDownrankSecondaryMatch(e);if(a.match)n=a.match,i=l.Primary,s=e;else if(t){const{basename:e,path:o}=t;a=this.searchAndDownrankSecondaryMatch(e,o),a.isPrimary?(i=l.Basename,s=e):a.match&&(i=l.Path,s=o),n=a.match}return{matchType:i,matchText:s,match:n}}searchAndDownrankSecondaryMatch(e,t){let s=!1,i=null;return e&&(i=this.executeSearch(e),s=!!i),!i&&t&&(i=this.executeSearch(t),i&&(i.score-=1)),{isPrimary:s,match:i}}executeSearch(e){const t=this.getSearchDelegate();return t?t(e):null}getSearchDelegate(){if(!this._searchDelegate){const{query:e,useSimpleSearch:t}=this;this._searchDelegate=t?n.prepareSimpleSearch(e):n.prepareFuzzySearch(e)}return this._searchDelegate}}class ce extends le{getCommandString(e){return this.settings?.workspaceListCommand}validateCommand(e,s,i,n,a){const o=e.parsedCommand(t.WorkspaceList);return this.getEnabledWorkspacesPluginInstance()&&(e.mode=t.WorkspaceList,o.index=s,o.parsedInput=i,o.isValidated=!0),o}getSuggestions(e){const t=[];if(e){const{query:s,hasSearchTerm:i}=e.parsedInputQuery,a=de.create(s);this.getItems().forEach((e=>{let s=!0,n=null;i&&(({match:n}=a.searchWithFallback(e.id)),s=!!n),s&&t.push({type:r.WorkspaceList,item:e,match:n})})),i&&n.sortSearchResults(t)}return t}renderSuggestion(e,t){let s=!1;return e&&(this.addClassesToSuggestionContainer(t,["qsp-suggestion-workspace"]),this.renderContent(t,e.item.id,e.match),s=!0),s}onChooseSuggestion(e,t){let s=!1;if(e){const{id:t}=e.item,i=this.getEnabledWorkspacesPluginInstance();i&&i.loadWorkspace(t),s=!0}return s}onNoResultsCreateAction(e,s){const i=this.getEnabledWorkspacesPluginInstance();if(i){const s=e.parsedCommand(t.WorkspaceList)?.parsedInput;i.saveWorkspace(s),i.setActiveWorkspace(s)}return!0}getItems(){const e=[],t=this.getEnabledWorkspacesPluginInstance()?.workspaces;return t&&Object.keys(t).forEach((t=>e.push({id:t,type:"workspaceInfo"}))),e.sort(((e,t)=>e.id.localeCompare(t.id)))}getEnabledWorkspacesPluginInstance(){return v(this.app,"workspaces")}}class he extends le{getCommandString(e){return""}validateCommand(e,t,s,i,n){throw new Error("Method not implemented.")}getSuggestions(e){throw new Error("Method not implemented.")}renderSuggestion(e,t){let s=!1;return s=m(e)?this.renderFileSuggestion(e,t):this.renderAliasSuggestion(e,t),e?.downranked&&t.addClass("mod-downranked"),s}onChooseSuggestion(e,t){let s=!1;if(e){const{file:i}=e;this.navigateToLeafOrOpenFile(t,i,`Unable to open file from SystemSuggestion ${i.path}`),s=!0}return s}renderFileSuggestion(e,t){let s=!1;if(e){const{file:i,matchType:n,match:a}=e;this.renderAsFileInfoPanel(t,["qsp-suggestion-file"],null,i,n,a),this.renderOptionalIndicators(t,e),s=!0}return s}renderAliasSuggestion(e,t){let s=!1;if(e){const{file:i,matchType:n,match:a}=e;this.renderAsFileInfoPanel(t,["qsp-suggestion-alias"],e.alias,i,n,a,!1);const o=this.renderOptionalIndicators(t,e);this.renderIndicator(o,["qsp-alias-indicator"],"lucide-forward"),s=!0}return s}addPropertiesToStandardSuggestions(e,t){const{match:s,file:i}=t,n=s?.matches;let a=l.None,o=null;n&&(g(t)?(a=l.Primary,o=t.alias):(a=l.Path,o=i?.path)),t.matchType=a,t.matchText=o,le.updateWorkspaceEnvListStatus(e.currentWorkspaceEnvList,t)}static createUnresolvedSuggestion(e,t,s,i){const n={linktext:e,type:r.Unresolved,...t};return le.applyMatchPriorityPreferences(n,s,i)}}class ue extends le{getCommandString(e){return this.settings?.editorListCommand}validateCommand(e,s,i,n,a){e.mode=t.EditorList;const o=e.parsedCommand(t.EditorList);return o.index=s,o.parsedInput=i,o.isValidated=!0,o}getSuggestions(e){const t=[];if(e){const{query:s,hasSearchTerm:i}=e.parsedInputQuery,a=de.create(s);this.getItems().forEach((s=>{const n=A(s);let o=!0,r={matchType:l.None,match:null};const d=this.getPreferredTitle(s,this.settings.preferredSourceForTitle);i&&(r=a.searchWithFallback(d,n),o=r.matchType!==l.None),o&&t.push(this.createSuggestion(e.currentWorkspaceEnvList,s,n,r,d))})),i&&n.sortSearchResults(t)}return t}getPreferredTitle(e,t){return ue.getPreferredTitle(e,t,this.app.metadataCache)}static getPreferredTitle(e,t,s){const{view:i}=e,n=i?.file;let a=e.getDisplayText();if("H1"===t&&n){const e=ue.getFirstH1(n,s);e&&(a=a.replace(n.basename,e.heading))}return a}getItems(){const{excludeViewTypes:e,includeSidePanelViewTypes:t,orderEditorListByAccessTime:s}=this.settings;return this.getOpenLeaves(e,t,{orderByAccessTime:s})}renderSuggestion(e,t){let s=!1;if(e){const{file:i,matchType:n,match:a}=e,o=[l.None,l.Primary].includes(n);this.renderAsFileInfoPanel(t,["qsp-suggestion-editor"],e.preferredTitle,i,n,a,o),this.renderOptionalIndicators(t,e),s=!0}return s}onChooseSuggestion(e,t){let s=!1;return e&&(this.navigateToLeafOrOpenFile(t,e.file,"Unable to reopen existing editor in new Leaf.",null,e.item,null,!0),s=!0),s}createSuggestion(e,t,s,i,n){return ue.createSuggestion(e,t,s,this.settings,this.app.metadataCache,n,i)}static createSuggestion(e,t,s,i,n,a,o){o=o??{matchType:l.None,match:null,matchText:null};let d={item:t,file:s,preferredTitle:a=a??null,type:r.EditorList,...o};return d=le.updateWorkspaceEnvListStatus(e,d),le.applyMatchPriorityPreferences(d,i,n)}}class me extends le{getCommandString(e){return this.settings?.bookmarksListCommand}validateCommand(e,s,i,n,a){const o=e.parsedCommand(t.BookmarksList);return this.getEnabledBookmarksPluginInstance()&&(e.mode=t.BookmarksList,o.index=s,o.parsedInput=i,o.isValidated=!0),o}getSuggestions(e){const t=[];if(e){const{query:s,hasSearchTerm:i}=e.parsedInputQuery,a=de.create(s),{allBookmarks:o}=this.getItems(e);o.forEach((s=>{let n=!0,o={matchType:l.None,match:null};i&&(o=a.searchWithFallback(s.bookmarkPath),n=o.matchType!==l.None),n&&t.push(this.createSuggestion(e.currentWorkspaceEnvList,s,o))})),i&&n.sortSearchResults(t)}return t}renderSuggestion(e,t){return!1}onChooseSuggestion(e,t){return!1}getPreferredTitle(e,t,s,i){let n=e.getItemTitle(t);if("H1"===i&&s){const e=this.getFirstH1(s);e&&(n=n.replace(/^[^#]*/,e.heading))}return n}getItems(e){const t=[],s=new Map,i=new Set,n=this.getEnabledBookmarksPluginInstance();if(n){const a=e?this.getActiveFacetIds(e):new Set,o=(e,r)=>{e?.forEach((e=>{if(me.isBookmarksPluginGroupItem(e))o(e.items,`${r}${e.title}/`);else if(this.isFacetedWith(a,W[e.type])){let a;if(me.isBookmarksPluginFileItem(e)){const t=this.getTFileByPath(e.path);if(t){a={item:e,bookmarkPath:null,file:t};const i=s.get(t)??[];i.push(a),s.set(t,i)}}else a={item:e,bookmarkPath:null,file:null},i.add(a);if(a){const s=this.getPreferredTitle(n,e,a.file,this.settings.preferredSourceForTitle);a.bookmarkPath=r+s,t.push(a)}}}))};o(n.items,"")}return{allBookmarks:t,fileBookmarks:s,nonFileBookmarks:i}}getEnabledBookmarksPluginInstance(){return v(this.app,"bookmarks")}createSuggestion(e,t,s){return me.createSuggestion(e,t,this.settings,this.app.metadataCache,s)}static createSuggestion(e,t,s,i,n){let a={type:r.Bookmark,item:t.item,bookmarkPath:t.bookmarkPath,file:t.file,...n};return a=le.updateWorkspaceEnvListStatus(e,a),le.applyMatchPriorityPreferences(a,s,i)}static isBookmarksPluginFileItem(e){return c(e,"type","file")}static isBookmarksPluginGroupItem(e){return c(e,"type","group")}}class ge extends le{getCommandString(e){return this.settings?.headingsListCommand}validateCommand(e,s,i,n,a){e.mode=t.HeadingsList;const o=e.parsedCommand(t.HeadingsList);return o.index=s,o.parsedInput=i,o.isValidated=!0,o}onChooseSuggestion(e,t){let s=!1;if(e){const{start:{line:i,col:n},end:a}=e.item.position,o={active:!0,focus:!0,startLoc:{line:i,col:n},endLoc:a,line:i,cursor:{from:{line:i,ch:n},to:{line:i,ch:n}}};this.navigateToLeafOrOpenFile(t,e.file,"Unable to navigate to heading for file.",{active:!0,eState:o}),s=!0}return s}renderSuggestion(e,t){let s=!1;if(e){const{item:i,file:n,match:a}=e,{app:r,settings:l}=this;this.addClassesToSuggestionContainer(t,["qsp-suggestion-headings",`qsp-headings-l${i.level}`]);const{contentEl:d,titleEl:c}=le.createContentStructureElements(t);ge.renderHeadingContent(r,l,c,i,n,a),this.renderPath(d,n);const h=this.createFlairContainer(t);this.renderOptionalIndicators(t,e,h),this.renderIndicator(h,["qsp-headings-indicator"],null,o[i.level]),e.downranked&&t.addClass("mod-downranked"),s=!0}return s}static renderHeadingContent(e,t,s,i,a,o,r){const{heading:l}=i,{renderMarkdownContentInSuggestions:{isEnabled:d,renderHeadings:c}}=t;(r=r??(d&&c))?le.renderMarkdownContentAsync(e,s,l,a.path):n.renderResults(s,l,o)}getAvailableFacets(e){const{settings:{shouldSearchHeadings:t,shouldSearchBookmarks:s,shouldSearchFilenames:i,shouldSearchRecentFiles:n,builtInSystemOptions:{showAttachments:a,showAllFileTypes:o}}}=this,r=a||o,l={[K.RecentFiles]:n,[K.Bookmarks]:s,[K.Filenames]:i,[K.Headings]:t,[K.ExternalFiles]:r};return this.getFacets(e.mode).filter((e=>(Object.prototype.hasOwnProperty.call(l,e.id)&&(e.isAvailable=l[e.id]),e.isAvailable)))}getSuggestions(e){let t=[];if(e){const{hasSearchTerm:s}=e.parsedInputQuery,{settings:i}=this,a=this.getActiveFacetIds(e),o=!!a.size;if(s||o){const{limit:s}=i,{app:{vault:o}}=this,r={headings:i.shouldSearchHeadings,allHeadings:i.searchAllHeadings,aliases:i.shouldShowAlias,bookmarks:i.shouldSearchBookmarks,filename:i.shouldSearchFilenames,filenameAsFallback:!i.strictHeadingsOnly,unresolved:!i.showExistingOnly};this.getItems([o.getRoot()],e,t,a,r),n.sortSearchResults(t),s>0&&t.length>s&&(t=t.slice(0,s))}else this.getSuggestionsForEditorsAndRecentFiles(e,t,new Set,{editors:!0,recentFiles:i.shouldSearchRecentFiles})}return t}getItems(e,t,s,i,n){const a=!!i.size,o=de.create(t.parsedInputQuery.query);this.getSuggestionsForEditorsAndRecentFiles(t,s,i,{editors:!1,recentFiles:!1});const r={fileBookmarks:n.bookmarks,nonFileBookmarks:n.bookmarks};this.getSuggestionsForBookmarks(t,o,s,i,r);const l={headings:n.headings,allHeadings:n.allHeadings,aliases:n.aliases,filename:n.filename,filenameAsFallback:n.filenameAsFallback};this.getSuggestionForFiles(t,o,e,s,i,l),n.unresolved&&!a&&this.addUnresolvedSuggestions(s,o)}getSuggestionsForBookmarks(e,t,s,i,n){const a=!!i.size,{fileBookmarks:o,nonFileBookmarks:r}=e.currentWorkspaceEnvList;if(a){const e=i.has(K.Bookmarks);n=Object.assign(n,{fileBookmarks:e,nonFileBookmarks:e})}const l=i=>{for(const n of i)this.addBookmarkSuggestion(e,s,t,n)};n.fileBookmarks&&o.forEach((e=>{l(e)})),n.nonFileBookmarks&&l(r)}getSuggestionForFiles(e,t,s,i,n,a){if(!!n.size){const e=this.isFacetedWith(n,K.Headings),t=this.isFacetedWith(n,K.ExternalFiles)||this.isFacetedWith(n,K.Filenames);let s=!1,i=!1;e&&(s=!0===a.allHeadings,i=!0===a.filenameAsFallback),a=Object.assign(a,{headings:e,aliases:!1,filename:t,allHeadings:s,filenameAsFallback:i})}else a=Object.assign({headings:!0,allHeadings:!0,aliases:!0,filename:!0,filenameAsFallback:!0},a);if([a.headings,a.aliases,a.filename].some((e=>!0===e))){const{excludeFolders:o}=this.settings,r=T(o);let l=Array.prototype.concat(s);for(;l.length>0;){const s=l.pop();S(s)?this.shouldIncludeFile(s,n)&&this.addSuggestionsForFile(e,t,i,s,a):r(s.path)||(l=l.concat(s.children))}}}addSuggestionsForFile(e,t,s,i,n){let a=!1;n.headings&&(a=this.addHeadingSuggestions(e,t,s,i,n.allHeadings)),(n.filename||!a&&n.filenameAsFallback)&&this.addFileSuggestions(e,t,s,i),n.aliases&&this.addAliasSuggestions(e,t,s,i)}shouldIncludeFile(e,t=new Set){let s=!1;if(e){const i=new Set(["md","canvas"]),{extension:n}=e,{app:{viewRegistry:a,metadataCache:o},settings:{excludeObsidianIgnoredFiles:r,fileExtAllowList:l,builtInSystemOptions:{showAttachments:d,showAllFileTypes:c}}}=this;if(!(r&&o.isUserIgnored(e.path)))if(t.has(K.ExternalFiles)){const e=d||c;s=!i.has(n)&&e}else{s=this.isExternalFileTypeAllowed(e,a,d,c,l)||i.has(n)}}return s}isExternalFileTypeAllowed(e,t,s,i,n){const{extension:a}=e;let o=t.isExtensionRegistered(a)?s:i;if(!o){o=new Set(n).has(a)}return o}addAliasSuggestions(e,t,s,i){const{metadataCache:n}=this.app,a=n.getFileCache(i)?.frontmatter;if(a){const n=R.getAliases(a);let o=n.length;for(;o--;){const a=n[o],{match:r}=t.searchWithFallback(a);r&&s.push(this.createAliasSuggestion(e,a,i,r))}}}addFileSuggestions(e,t,s,i){const{match:n,matchType:a,matchText:o}=t.searchWithFallback(null,i);n&&s.push(this.createFileSuggestion(e,i,n,a,o))}addBookmarkSuggestion(e,t,s,i){const n=s.searchWithFallback(i.bookmarkPath);if(n.match){const s=me.createSuggestion(e.currentWorkspaceEnvList,i,this.settings,this.app.metadataCache,n);t.push(s)}}addHeadingSuggestions(e,t,s,i,n){const{metadataCache:a}=this.app,o=a.getFileCache(i)?.headings??[];let r=null,l=!1,d=o.length;for(;d--;){const a=o[d];let c=!1;if(n&&(c=this.matchAndPushHeading(e,t,s,i,a)),1===a.level){const{line:e}=a.position.start;(null===r||e{this.addOpenEditorSuggestions(s,e,a,t)}))}if(i.recentFiles){const i=e.currentWorkspaceEnvList?.mostRecentFiles;i?.forEach((i=>{this.shouldIncludeFile(i,s)&&this.addRecentFilesSuggestions(i,e,a,t)}))}}onNoResultsCreateAction(e,s){const i=e.parsedCommand(t.HeadingsList)?.parsedInput;return this.createFile(i,s),!0}}const pe={file:"lucide-file-text",text:"lucide-sticky-note",link:"lucide-globe",group:"create-group"};class fe extends le{getCommandString(e){const{settings:t}=this;return e?.useActiveEditorAsSource?t.symbolListActiveEditorCommand:t.symbolListCommand}validateCommand(e,s,i,n,a){const o=e.parsedCommand(t.SymbolList),r=this.getSourceInfoForSymbolOperation(n,a,0===s,e.sessionOpts);return r&&(e.mode=t.SymbolList,o.source=r,o.index=s,o.parsedInput=i,o.isValidated=!0),o}async getSuggestions(e){const s=[];if(e){this.inputInfo=e;const{query:i,hasSearchTerm:a}=e.parsedInputQuery,o=de.create(i),l=e.parsedCommand(t.SymbolList);(await this.getItems(l.source,a)).forEach((e=>{let t=!0,i=null;if(a){const s=fe.getSuggestionTextForSymbol(e);({match:i}=o.searchWithFallback(s)),t=!!i}if(t){const{file:t}=l.source;s.push({type:r.SymbolList,file:t,item:e,match:i})}})),a&&n.sortSearchResults(s)}return s}renderSuggestion(e,t){let s=!1;if(e){const{item:i,file:a,match:o}=e,r=["qsp-suggestion-symbol"];Object.prototype.hasOwnProperty.call(i,"indentLevel")&&this.settings.symbolsInLineOrder&&!this.inputInfo?.parsedInputQuery?.hasSearchTerm&&r.push(`qsp-symbol-l${i.indentLevel}`),this.addClassesToSuggestionContainer(t,r);const{titleEl:l}=le.createContentStructureElements(t);if(y(i.symbol))ge.renderHeadingContent(this.app,this.settings,l,i.symbol,a,o);else{const e=fe.getSuggestionTextForSymbol(i);n.renderResults(l,e,o)}this.addSymbolIndicator(i,t),s=!0}return s}onChooseSuggestion(e,i){let n=!1;if(e){const a=this.inputInfo.parsedCommand(),{leaf:o,file:r}=a.source,l={active:!0},{item:d}=e;d.symbolType!==s.CanvasNode&&(l.eState=this.constructMDFileNavigationState(d).eState),this.navigateToLeafOrOpenFileAsync(i,r,l,o,t.SymbolList).then((()=>{const{symbol:e}=d;fe.isCanvasSymbolPayload(d,e)&&this.zoomToCanvasNode(this.getActiveLeaf().view,e)}),(e=>{console.log(`Switcher++: Unable to navigate to symbols for file ${r?.path}`,e)})),n=!0}return n}reset(){this.inputInfo=null}getAvailableFacets(e){const i=e.parsedCommand(t.SymbolList),n=fe.isCanvasFile(i?.source?.file),a=this.getFacets(e.mode),o=new Set(Object.values(B)),r=new Set(Object.values(s).filter((e=>isNaN(Number(e)))));return a.forEach((e=>{const{id:t}=e;e.isAvailable=n?o.has(t):r.has(t)})),a.filter((e=>e.isAvailable))}zoomToCanvasNode(e,t){if(fe.isCanvasView(e)&&t){const s=e.canvas,i=s.nodes.get(t.id);s.selectOnly(i),s.zoomToSelection()}}constructMDFileNavigationState(e){const{start:{line:t,col:s},end:i}=e.symbol.position;return{eState:{active:!0,focus:!0,startLoc:{line:t,col:s},endLoc:i,line:t,cursor:{from:{line:t,ch:s},to:{line:t,ch:s}}}}}getSourceInfoForSymbolOperation(e,s,i,n){const a=this.inputInfo;let o=null,r=t.Standard;a&&(o=a.parsedCommand().source,r=a.mode);const l=r===t.SymbolList&&!!o,d=this.getEditorInfo(s),c=this.getSuggestionInfo(e);let h=null;return l?h=o:c.isValidSource&&!n.useActiveEditorAsSource?h=c:d.isValidSource&&i&&(h=d),h}async getItems(e,t){let s=[],i=!1,n=!1;return t||({selectNearestHeading:n,symbolsInLineOrder:i}=this.settings),s=await this.getSymbolsFromSource(e,i),n&&fe.FindNearestHeadingSymbol(s,e),s}static FindNearestHeadingSymbol(e,t){const s=t?.cursor?.line;if(s){let t=null;const i=e.filter((e=>y(e.symbol)));i.length&&(t=i.reduce(((e,t)=>{const{line:i}=t.symbol.position.start;return i>(e?e.symbol.position.start.line:-1)&&i<=s?t:e}))),t&&(t.isSelected=!0)}}async getSymbolsFromSource(e,t){const{app:{metadataCache:i},inputInfo:n}=this,a=[];if(e?.file){const{file:o}=e,r=this.getActiveFacetIds(n);if(fe.isCanvasFile(o))await this.addCanvasSymbolsFromSource(o,a,r);else{const e=i.getFileCache(o);if(e){const i=(e=[],t)=>{this.shouldIncludeSymbol(t,r)&&e.forEach((e=>a.push({type:"symbolInfo",symbol:e,symbolType:t})))};i(e.headings,s.Heading),i(e.tags,s.Tag),this.addLinksFromSource(e.links,a,r),i(e.embeds,s.Embed),await this.addCalloutsFromSource(o,e.sections?.filter((e=>"callout"===e.type)),a,r),t&&fe.orderSymbolsByLineNumber(a)}}}return a}shouldIncludeSymbol(e,t){let i=!1;return i="string"==typeof e?this.isFacetedWith(t,e):this.settings.isSymbolTypeEnabled(e)&&this.isFacetedWith(t,s[e]),i}async addCanvasSymbolsFromSource(e,t,i){let n;try{const t=await this.app.vault.cachedRead(e);n=JSON.parse(t).nodes}catch(t){console.log(`Switcher++: error reading file to extract canvas node information. ${e.path} `,t)}Array.isArray(n)&&n.forEach((e=>{this.shouldIncludeSymbol(B[e.type],i)&&t.push({type:"symbolInfo",symbolType:s.CanvasNode,symbol:{...e}})}))}async addCalloutsFromSource(e,t,i,n){const{app:{vault:a}}=this;if(this.shouldIncludeSymbol(s.Callout,n)&&t?.length&&e){let n=null;try{n=await a.cachedRead(e)}catch(t){console.log(`Switcher++: error reading file to extract callout information. ${e.path} `,t)}if(n)for(const e of t){const{start:t,end:a}=e.position,o=n.slice(t.offset,a.offset).match(/^> \[!([^\]]+)\][+-]?(.*?)(?:\n>|$)/);if(o){const t=o[1],n={calloutTitle:o[o.length-1].trim(),calloutType:t,...e};i.push({type:"symbolInfo",symbolType:s.Callout,symbol:n})}}}}addLinksFromSource(e,t,i){const{settings:n}=this;if(e=e??[],this.shouldIncludeSymbol(s.Link,i))for(const i of e){const e=E(i);(n.excludeLinkSubTypes&e)===e||t.push({type:"symbolInfo",symbol:i,symbolType:s.Link})}}static orderSymbolsByLineNumber(e){const t=e.sort(((e,t)=>{const{start:s}=e.symbol.position,{start:i}=t.symbol.position,n=s.line-i.line;return 0===n?s.col-i.col:n}));let s=0;return t.forEach((e=>{let t=0;y(e.symbol)?(s=e.symbol.level,t=e.symbol.level-1):t=s,e.indentLevel=t})),t}static getSuggestionTextForSymbol(e){const{symbol:t}=e;let s;if(y(t))s=t.heading;else if(c(t,"tag"))s=t.tag.slice(1);else if(b(t))s=t.calloutTitle;else if(fe.isCanvasSymbolPayload(e,t))s=fe.getSuggestionTextForCanvasNode(t);else{const e=t;({link:s}=e);const{displayText:i}=e;i&&i!==s&&(s+=`|${i}`)}return s}static getSuggestionTextForCanvasNode(e){let t="";const s={file:()=>e.file,text:()=>e.text,link:()=>e.url,group:()=>e.label}[e?.type];return s&&(t=s()),t}addSymbolIndicator(e,t){const{symbolType:s,symbol:i}=e,r=["qsp-symbol-indicator"],l=this.createFlairContainer(t);if(b(i)){r.push("suggestion-flair","callout","callout-icon","svg-icon");const e=l.createSpan({cls:r,attr:{"data-callout":i.calloutType}}),t=e.getCssPropertyValue("--callout-icon");n.setIcon(e,t)}else if(fe.isCanvasSymbolPayload(e,i)){const e=pe[i.type];this.renderIndicator(l,r,e,null)}else{let e;e=y(i)?o[i.level]:a[s],this.renderIndicator(l,r,null,e)}}static isCanvasSymbolPayload(e,t){return e.symbolType===s.CanvasNode}static isCanvasFile(e){return"canvas"===e?.extension}static isCanvasView(e){return"canvas"===e?.getViewType()}}const ye=[];class be extends le{getCommandString(e){return this.settings?.commandListCommand}validateCommand(e,s,i,n,a){const o=e.parsedCommand(t.CommandList);return this.getEnabledCommandPalettePluginInstance()&&(e.mode=t.CommandList,o.index=s,o.parsedInput=i,o.isValidated=!0),o}getSuggestions(e){const t=[];if(e){const{query:s,hasSearchTerm:i}=e.parsedInputQuery,a=de.create(s);this.getItems(e,i).forEach((e=>{let s=!0,n=null;i&&(({match:n}=a.searchWithFallback(e.cmd.name)),s=!!n),s&&t.push(this.createSuggestion(e,n))})),i&&n.sortSearchResults(t)}return t}renderSuggestion(e,t){let s=!1;if(e){const{item:i,match:n,isPinned:a,isRecent:o}=e;this.addClassesToSuggestionContainer(t,["qsp-suggestion-command"]),this.renderContent(t,i.name,n);const r=this.createFlairContainer(t);this.renderHotkeyForCommand(i.id,this.app,r),i.icon&&this.renderIndicator(r,[],i.icon),a?this.renderIndicator(r,[],"filled-pin"):o&&this.renderOptionalIndicators(t,e,r),s=!0}return s}renderHotkeyForCommand(e,t,s){try{const{hotkeyManager:i}=t;if(i.getHotkeys(e)||i.getDefaultHotkeys(e)){const t=i.printHotkeyForCommand(e);t?.length&&s.createEl("kbd",{cls:"suggestion-hotkey",text:t})}}catch(t){console.log("Switcher++: error rendering hotkey for command id: ",e,t)}}onChooseSuggestion(e){let t=!1;if(e){const{item:s}=e;this.app.commands.executeCommandById(s.id),this.saveUsageToList(s.id,ye),t=!0}return t}saveUsageToList(e,t){if(t){const s=t.indexOf(e);s>-1&&t.splice(s,1),t.unshift(e),t.splice(25)}}getItems(e,t){let s=[];const i=this.getActiveFacetIds(e);if(!!i.size)s=this.getPinnedAndRecentCommands(i);else if(t)s=this.getAllCommands();else{const e=this.getPinnedAndRecentCommands(i);s=e.length?e:this.getAllCommands()}return s}getPinnedAndRecentCommands(e){const t=[],s=this.getPinnedCommandIds(),i=this.getRecentCommandIds(),n=e=>{let t=null;const n=this.app.commands.findCommand(e);return n&&(t={isPinned:s.has(e),isRecent:i.has(e),cmd:n}),t},a=(s,i)=>{this.isFacetedWith(e,s)&&i.forEach((e=>{const s=n(e);s&&t.push(s)}))};a(q.Pinned,Array.from(s));const o=this.isFacetedWith(e,q.Pinned),r=Array.from(i).filter((e=>!o||o&&!s.has(e)));return a(q.Recent,r),t}getAllCommands(){const e=this.getPinnedCommandIds(),t=this.getRecentCommandIds();return this.app.commands.listCommands()?.sort(((e,t)=>e.name.localeCompare(t.name))).map((s=>({isPinned:e.has(s.id),isRecent:t.has(s.id),cmd:s})))}getPinnedCommandIds(){const e=this.getEnabledCommandPalettePluginInstance()?.options?.pinned;return new Set(e??[])}getRecentCommandIds(){return new Set(ye)}createSuggestion(e,t){const{cmd:s,isPinned:i,isRecent:n}=e,a={type:r.CommandList,item:s,isPinned:i,isRecent:n,match:t};return this.applyMatchPriorityPreferences(a)}getEnabledCommandPalettePluginInstance(){return be.getEnabledCommandPalettePluginInstance(this.app)}static getEnabledCommandPalettePluginInstance(e){return v(e,"command-palette")}}class Se extends le{getCommandString(e){const{settings:t}=this;return e?.useActiveEditorAsSource?t.relatedItemsListActiveEditorCommand:t.relatedItemsListCommand}validateCommand(e,s,i,n,a){const o=e.parsedCommand(t.RelatedItemsList),r=this.getSourceInfo(n,a,0===s,e.sessionOpts);return r&&(e.mode=t.RelatedItemsList,o.source=r,o.index=s,o.parsedInput=i,o.isValidated=!0),o}getSuggestions(e){const s=[];if(e){this.inputInfo=e;const i=de.create(e.parsedInputQuery.query),a=e.parsedCommand(t.RelatedItemsList);this.getItems(a.source,e).forEach((t=>{const n=this.searchAndCreateSuggestion(e,i,t);n&&s.push(n)})),i.hasSearchTerm&&n.sortSearchResults(s)}return s}renderSuggestion(e,t){let s=!1;if(e){const{file:i,matchType:n,match:a,item:o}=e,r=new Map([[d.Backlink,"links-coming-in"],[d.DiskLocation,"folder-tree"],[d.OutgoingLink,"links-going-out"]]);t.setAttribute("data-relation-type",o.relationType),this.renderAsFileInfoPanel(t,["qsp-suggestion-related"],e.preferredTitle,i,n,a);const l=this.renderOptionalIndicators(t,e);e.item.count&&this.renderIndicator(l,[],null,`${e.item.count}`),this.renderIndicator(l,["qsp-related-indicator"],r.get(o.relationType)),s=!0}return s}onChooseSuggestion(e,t){let s=!1;if(e){const{file:i}=e;this.navigateToLeafOrOpenFile(t,i,`Unable to open related file ${i.path}`),s=!0}return s}getPreferredTitle(e,t){let s=null;const{file:i,unresolvedText:n}=e;if(i)"H1"===t&&(s=this.getFirstH1(i)?.heading??null);else{!!n?.length&&(s=n)}return s}searchAndCreateSuggestion(e,t,s){const{file:i,unresolvedText:n}=s;let a={matchType:l.None,match:null};const o=null===i&&n?.length,{currentWorkspaceEnvList:r}=e,{settings:d,app:{metadataCache:c}}=this,h=this.getPreferredTitle(s,d.preferredSourceForTitle);return t.hasSearchTerm&&(a=t.searchWithFallback(h,i),a.matchType===l.None)?null:o?he.createUnresolvedSuggestion(h,a,d,c):this.createSuggestion(r,s,a,h)}getItems(e,t){const s=[],{metadataCache:i}=this.app,{file:n,suggestion:a}=e,o=new Set(this.settings.enabledRelatedItems),r=this.getActiveFacetIds(t),l=e=>o.has(e)&&this.isFacetedWith(r,e);if(l(d.Backlink)){let e=n?.path,t=i.resolvedLinks;p(a)&&(e=a.linktext,t=i.unresolvedLinks),this.addBacklinks(e,t,s)}return l(d.DiskLocation)&&this.addRelatedDiskFiles(n,s),l(d.OutgoingLink)&&this.addOutgoingLinks(n,s),s}addRelatedDiskFiles(e,t){const{excludeRelatedFolders:s,excludeOpenRelatedFiles:i}=this.settings;if(e){const n=T(s);let a=[...e.parent.children];for(;a.length>0;){const s=a.pop();if(S(s)){s===e||i&&!!this.findMatchingLeaf(s).leaf||t.push({file:s,relationType:d.DiskLocation})}else n(s.path)||(a=a.concat(s.children))}}}addOutgoingLinks(e,t){if(e){const s=new Map,i=new Map,{metadataCache:n}=this.app,a=n.getFileCache(e).links??[],o=e=>!!e&&!!(e.count+=1);a.forEach((a=>{const r=a.link,l=n.getFirstLinkpathDest(r,e.path);let c;l?o(i.get(l))||l===e||(c={file:l,relationType:d.OutgoingLink,count:1},i.set(l,c),t.push(c)):o(s.get(r))||(c={file:null,relationType:d.OutgoingLink,unresolvedText:r,count:1},s.set(r,c),t.push(c))}))}}addBacklinks(e,t,s){for(const[i,n]of Object.entries(t))if(i!==e&&Object.prototype.hasOwnProperty.call(n,e)){const t=n[e],a=this.getTFileByPath(i);a&&s.push({count:t,file:a,relationType:d.Backlink})}}reset(){this.inputInfo=null}getSourceInfo(e,s,i,n){const a=this.inputInfo;let o=null,r=t.Standard;a&&(o=a.parsedCommand().source,r=a.mode);const l=r===t.RelatedItemsList&&!!o,d=this.getEditorInfo(s),c=this.getSuggestionInfo(e);!c.isValidSource&&p(e)&&(c.isValidSource=!0);let h=null;return l?h=o:c.isValidSource&&!n.useActiveEditorAsSource?h=c:d.isValidSource&&i&&(h=d),h}createSuggestion(e,t,s,i){let n={item:t,file:t?.file,type:r.RelatedItemsList,preferredTitle:i,...s};return n=le.updateWorkspaceEnvListStatus(e,n),this.applyMatchPriorityPreferences(n)}}class ke extends le{constructor(){super(...arguments),this.mobileVaultChooserMarker={type:r.VaultList,match:null,item:null,pathSegments:null}}getCommandString(e){return this.settings?.vaultListCommand}validateCommand(e,s,i,n,a){e.mode=t.VaultList;const o=e.parsedCommand(t.VaultList);return o.index=s,o.parsedInput=i,o.isValidated=!0,o}getSuggestions(e){const t=[];if(e){const{query:s,hasSearchTerm:i}=e.parsedInputQuery,a=de.create(s);this.getItems().forEach((e=>{let s=!0;if(i){const t=a.searchWithFallback(null,e.pathSegments);Object.assign(e,t),s=!!t.match}s&&t.push(e)})),i&&n.sortSearchResults(t)}return t}renderSuggestion(e,t){let s=!1;return e&&(this.addClassesToSuggestionContainer(t,["qsp-suggestion-vault"]),s=!0,n.Platform.isDesktop?this.renderVaultSuggestion(e,t):e===this.mobileVaultChooserMarker&&this.renderMobileHintSuggestion(t)),s}renderMobileHintSuggestion(e){this.renderContent(e,"Show mobile vault chooser",null)}renderVaultSuggestion(e,t){const{pathSegments:s,matchType:i}=e;let{match:a}=e,o=null;i===l.Basename&&(o=a,a=null);const r=this.renderContent(t,s.basename,o).createDiv({cls:["suggestion-note","qsp-note"]}),d=r.createSpan({cls:["qsp-path-indicator"]}),c=r.createSpan({cls:"qsp-path"});n.setIcon(d,"folder"),n.renderResults(c,s.path,a)}onChooseSuggestion(e,t){let s=!1;return e&&(n.Platform.isDesktop?(this.openVaultOnDesktop(e.pathSegments?.path),s=!0):e===this.mobileVaultChooserMarker&&(this.app.openVaultChooser(),s=!0)),s}getItems(){const e=[];if(n.Platform.isDesktop)try{const t=this.getVaultListDataOnDesktop();for(const[s,{path:i,open:n}]of Object.entries(t)){const t=I(i),a={type:r.VaultList,match:null,item:s,isOpen:!!n,pathSegments:{basename:t,path:i}};e.push(a)}}catch(e){console.log("Switcher++: error parsing vault data. ",e)}else e.push(this.mobileVaultChooserMarker);return e.sort(((e,t)=>e.pathSegments.basename.localeCompare(t.pathSegments.basename)))}openVaultOnDesktop(e){if(n.Platform.isDesktop)try{window.require("electron").ipcRenderer.sendSync("vault-open",e,!1)}catch(t){console.log(`Switcher++: error opening vault with path: ${e} `,t)}}getVaultListDataOnDesktop(){let e=null;if(n.Platform.isDesktop)try{e=window.require("electron").ipcRenderer.sendSync("vault-list")}catch(e){console.log("Switcher++: error retrieving list of available vaults. ",e)}return e}}const ve={};class Ce{constructor(e,s,i){this.app=e,this.settings=s,this.exKeymap=i,this.sessionOpts={},this.noResultActionModes=[t.HeadingsList,t.WorkspaceList];const a=new he(e,s),o=new Map([[t.SymbolList,new fe(e,s)],[t.WorkspaceList,new ce(e,s)],[t.HeadingsList,new ge(e,s)],[t.EditorList,new ue(e,s)],[t.BookmarksList,new me(e,s)],[t.CommandList,new be(e,s)],[t.RelatedItemsList,new Se(e,s)],[t.VaultList,new ke(e,s)]]);this.handlersByMode=o,this.handlersByType=new Map([[r.CommandList,o.get(t.CommandList)],[r.EditorList,o.get(t.EditorList)],[r.HeadingsList,o.get(t.HeadingsList)],[r.RelatedItemsList,o.get(t.RelatedItemsList)],[r.Bookmark,o.get(t.BookmarksList)],[r.SymbolList,o.get(t.SymbolList)],[r.WorkspaceList,o.get(t.WorkspaceList)],[r.VaultList,o.get(t.VaultList)],[r.File,a],[r.Alias,a]]),this.handlersByCommand=new Map([[s.editorListCommand,o.get(t.EditorList)],[s.workspaceListCommand,o.get(t.WorkspaceList)],[s.headingsListCommand,o.get(t.HeadingsList)],[s.bookmarksListCommand,o.get(t.BookmarksList)],[s.commandListCommand,o.get(t.CommandList)],[s.symbolListCommand,o.get(t.SymbolList)],[s.symbolListActiveEditorCommand,o.get(t.SymbolList)],[s.relatedItemsListCommand,o.get(t.RelatedItemsList)],[s.vaultListCommand,o.get(t.VaultList)],[s.relatedItemsListActiveEditorCommand,o.get(t.RelatedItemsList)]]),this.debouncedGetSuggestions=n.debounce(this.getSuggestions.bind(this),s.headingsSearchDebounceMilli,!0),this.reset()}onOpen(){const{exKeymap:e,settings:t}=this;e.isOpen=!0,t.quickFilters?.shouldResetActiveFacets&&Object.values(t.quickFilters.facetList).forEach((e=>e.isActive=!1))}onClose(){this.exKeymap.isOpen=!1,H.unload()}setSessionOpenMode(e,s,i){if(this.reset(),s?.setSuggestions([]),e!==t.Standard){const t=this.getHandler(e).getCommandString(i);Object.assign(this.sessionOpts,i,{openModeString:t})}if(ve[e]&&(e===t.CommandList&&this.settings.preserveCommandPaletteLastInput||e!==t.CommandList&&this.settings.preserveQuickSwitcherLastInput)){const t=ve[e];this.lastInput=t.inputText}}insertSessionOpenModeOrLastInputString(e){const{sessionOpts:t,lastInput:s}=this,i=t.openModeString??null;if(s&&s!==i){e.value=s;const t=i?i.length:0;e.setSelectionRange(t,e.value.length)}else null!==i&&""!==i&&(e.value=i,t.openModeString=null);this.lastInput=null}updateSuggestions(e,s,i){const{exKeymap:n,settings:a,sessionOpts:o}=this;let r=!1;this.debouncedGetSuggestions.cancel();const l=le.getActiveLeaf(this.app.workspace),d=Ce.getActiveSuggestion(s),c=this.determineRunMode(e,d,l,o);this.inputInfo=c;const{mode:h}=c;return ve[h]=c,this.updatedKeymapForMode(c,s,i,n,a,l),this.toggleMobileCreateFileButton(i,h,a),h!==t.Standard&&(h===t.HeadingsList&&c.parsedCommand().parsedInput?.length?this.debouncedGetSuggestions(c,s,i):this.getSuggestions(c,s,i),r=!0),r}toggleMobileCreateFileButton(e,s,i){if(!n.Platform.isMobile)return;const a=t[s];e.allowCreateNewFile=i.allowCreateNewFileInModeNames.includes(a),e.allowCreateNewFile||e.createButtonEl?.detach()}updatedKeymapForMode(e,t,s,i,n,a){const{mode:o}=e,r=this.getHandler(o),l=r?.getAvailableFacets(e)??[],d={mode:o,activeLeaf:a,facets:{facetList:l,facetSettings:n.quickFilters,onToggleFacet:((o,l)=>{if(l){const e=o.some((e=>!0===e.isActive));r.activateFacet(o,!e)}else r.activateFacet(o,!o[0].isActive);return this.updatedKeymapForMode(e,t,s,i,n,a),this.getSuggestions(e,t,s),!1}).bind(this)}};i.updateKeymapForMode(d)}renderSuggestion(e,s){const{inputInfo:i,settings:{overrideStandardModeBehaviors:n}}=this,{mode:a}=i,o=a===t.HeadingsList;let l=!1;const d=new Set([r.Unresolved,r.Bookmark]);if(null===e){if(o){const e=this.getHandler(a),t=i.parsedCommand(a)?.parsedInput;e.renderFileCreationSuggestion(s,t),l=!0}}else if(!d.has(e.type)&&(n||o||f(e))){const n=this.getHandler(e);n&&(a===t.Standard&&n.addPropertiesToStandardSuggestions(i,e),l=n.renderSuggestion(e,s))}return l}onChooseSuggestion(e,s){const{inputInfo:i,settings:{overrideStandardModeBehaviors:n}}=this,{mode:a}=i,o=a===t.HeadingsList;let l=!1;const d=new Set([r.Unresolved,r.Bookmark]);if(null===e){if(this.noResultActionModes.includes(a)){const e=this.getHandler(a);l=!!e?.onNoResultsCreateAction(i,s)}}else if(!d.has(e.type)&&(n||o||f(e))){const t=this.getHandler(e);t&&(l=t.onChooseSuggestion(e,s))}return l}determineRunMode(e,s,i,n){const a=e??"",o=new re(a,t.Standard,n);return this.addWorkspaceEnvLists(o),0===a.length&&this.reset(),this.validatePrefixCommands(o,s,i,this.settings),o}getSuggestions(e,t,s){t.setSuggestions([]);const{mode:i}=e,n=this.getHandler(i).getSuggestions(e),a=n=>{n?.length?(t.setSuggestions(n),Ce.setActiveSuggestion(i,t),this.exKeymap?.renderQuickOpenFlairIcons(t.suggestions,this.settings)):this.noResultActionModes.includes(i)&&e.parsedCommand(i).parsedInput?s.onNoSuggestion():t.setSuggestions(null)};Array.isArray(n)?a(n):n.then((e=>{a(e)}),(e=>{console.log("Switcher++: error retrieving suggestions as Promise. ",e)}))}removeEscapeCommandCharFromInput(e,t,s){const i=e.inputTextSansEscapeChar.replace(new RegExp(`(?:${k(t)})(?:${k(s)})`),s);return e.inputTextSansEscapeChar=i,i}validatePrefixCommands(e,t,s,i){let n=null,a=null;const o=[i.symbolListActiveEditorCommand,i.relatedItemsListActiveEditorCommand],r=[i.editorListCommand,i.workspaceListCommand,i.headingsListCommand,i.bookmarksListCommand,i.commandListCommand,i.vaultListCommand].concat(o).map((e=>`(?:${k(e)})`)).sort(((e,t)=>t.length-e.length)),l=new RegExp(`^((?:${k(i.escapeCmdChar)})?)(${r.join("|")})`).exec(e.inputText);if(l){const t=!!l[1].length;n=l[2],t?(this.removeEscapeCommandCharFromInput(e,i.escapeCmdChar,n),n=null):a=this.getHandler(n)}if(!this.validateSourcedCommands(e,n,t,s,i)&&a){e.sessionOpts.useActiveEditorAsSource=o.includes(n);const i=e.inputTextSansEscapeChar.slice(n.length);a.validateCommand(e,l.index,i,t,s)}}validateSourcedCommands(e,t,s,i,n){let a=!1;const o=[],r=e.inputTextSansEscapeChar,l=[n.editorListCommand,n.headingsListCommand,n.bookmarksListCommand];if(!t||l.includes(t)){let t=null;const l=[n.symbolListCommand,n.relatedItemsListCommand].map((e=>`(?:${k(e)})`)).sort(((e,t)=>t.length-e.length)),d=new RegExp(`((?:${k(n.escapeCmdChar)})?)(${l.join("|")})`,"g");for(;null!==(t=d.exec(r));){const l=!!t[1].length,c=t[2];if(!l){const n=r.slice(d.lastIndex),l=this.getHandler(c);if(l){const r=l.validateCommand(e,t.index,n,s,i);a=!!r?.isValidated;const d=this.getSourcedHandlers().filter((e=>e!==l));o.push(...d)}break}this.removeEscapeCommandCharFromInput(e,n.escapeCmdChar,c)}}return this.resetSourcedHandlers(o.length?o:null),a}static setActiveSuggestion(e,s){if(e===t.SymbolList){const e=s.values.filter((e=>h(e))).findIndex((e=>e.item.isSelected));-1!==e&&(s.setSelectedItem(e,null),s.suggestions[s.selectedItem].scrollIntoView(!1))}}static getActiveSuggestion(e){let t=null;return e?.values&&(t=e.values[e.selectedItem]),t}reset(){this.inputInfo=new re,this.sessionOpts={},this.resetSourcedHandlers()}resetSourcedHandlers(e){(e=e??this.getSourcedHandlers()).forEach((e=>e?.reset()))}getSourcedHandlers(){return w().map((e=>this.getHandler(e)))}addWorkspaceEnvLists(e){if(e){const s=this.getHandler(t.EditorList).getItems(),i=s.map((e=>A(e))).filter((e=>!!e)).reduce(((e,t)=>e.add(t)),new Set),{fileBookmarks:n,nonFileBookmarks:a}=this.getHandler(t.BookmarksList).getItems(null),o=e.currentWorkspaceEnvList;o.openWorkspaceLeaves=new Set(s),o.openWorkspaceFiles=i,o.fileBookmarks=n,o.nonFileBookmarks=a,o.attachmentFileExtensions=this.getAttachmentFileExtensions(this.app.viewRegistry,this.settings.fileExtAllowList);const r=i.size+this.settings.maxRecentFileSuggestionsOnInit;o.mostRecentFiles=this.getRecentFiles(i,r)}return e}getAttachmentFileExtensions(e,t){const s=new Set;try{const i=new Set(["md","canvas",...t]);Object.keys(e.typeByExtension).reduce(((e,t)=>(i.has(t)||e.add(t),e)),s)}catch(e){console.log("Switcher++: error retrieving attachment list from ViewRegistry",e)}return s}getRecentFiles(e,t=75){e=e??new Set;const s=new Set;if(t>0){const{workspace:i,vault:n}=this.app,a=i.getRecentFiles({showMarkdown:!0,showCanvas:!0,showNonImageAttachments:!0,showImages:!0,maxCount:t});a?.forEach((t=>{const i=n.getAbstractFileByPath(t);S(i)&&!e.has(i)&&s.add(i)}))}return s}inputTextForStandardMode(e){const{mode:s,inputTextSansEscapeChar:i}=this.inputInfo;let n=e;return s===t.Standard&&i?.length&&(n=i),n}getHandler(e){let t;const{handlersByMode:s,handlersByType:i,handlersByCommand:n}=this;return"number"==typeof e?t=s.get(e):c(e,"type")?t=i.get(e.type):"string"==typeof e&&(t=n.get(e)),t}}const Le={Enter:"↵",Backspace:"⌫",ArrowLeft:"←",ArrowUp:"↑",ArrowDown:"↓",ArrowRight:"→",Tab:"↹"},we={...Le,Mod:"Ctrl",Ctrl:"Ctrl",Meta:"Win",Alt:"Alt",Shift:"Shift"},Ie={...Le,Mod:"⌘",Ctrl:"⌃",Meta:"⌘",Alt:"⌥",Shift:"⇧"};class Te{get isOpen(){return this._isOpen}set isOpen(e){this._isOpen=e}static get modKey(){return n.Platform.isMacOS?"Meta":"Ctrl"}static get keyDisplayStr(){return n.Platform.isMacOS?Ie:we}constructor(e,t,s,i,n){this.app=e,this.scope=t,this.chooser=s,this.modal=i,this.config=n,this.standardKeysInfo=[],this.customKeysInfo=[],this.savedStandardKeysInfo=[],this.customInstructionEls=new Map,this.facetKeysInfo=[],this.insertIntoEditorKeysInfo=[],this.initKeysInfo(),this.removeDefaultTabKeyBinding(t,n),this.registerNavigationBindings(t,n.navigationKeys),this.registerEditorTabBindings(t),this.registerCloseWhenEmptyBindings(t,n),this.registerQuickOpenBindings(t,n),this.renderModeTriggerInstructions(i.modalEl,n),this.standardInstructionsEl=i.modalEl.querySelector(".prompt-instructions")}initKeysInfo(){this.standardKeysInfo.push(),this.addCustomKeymaps(this.config)}removeDefaultTabKeyBinding(e,t){if(t?.removeDefaultTabBinding){const t=e.keys.find((({modifiers:e,key:t})=>null===e&&"Tab"===t));e.unregister(t)}}registerNavigationBindings(e,t){const s=(t,s)=>{t.forEach((({modifiers:t,key:i})=>{e.register(t,i,((e,t)=>(this.navigateItems(e,s),!1)))}))};s(t?.nextKeys??[],!0),s(t?.prevKeys??[],!1)}registerFacetBinding(e,s){const{mode:i,facets:n}=s;if(n?.facetList?.length){const{facetList:s,facetSettings:a,onToggleFacet:o}=n,{keyList:r,modifiers:l,resetKey:d,resetModifiers:c}=a;let h=0;const u=(t,s,i,n)=>e.register(t,s,(()=>o(i,n)));for(let e=0;e{e.register(t[0],t[1],this.useSelectedItem.bind(this))}))}registerCloseWhenEmptyBindings(e,t){const s=t.closeWhenEmptyKeys;s?.forEach((({modifiers:t,key:s})=>{e.register(t,s,this.closeModalIfEmpty.bind(this))}))}registerQuickOpenBindings(e,t){const{isEnabled:s,modifiers:i,keyList:n}=t.quickOpen;s&&n?.forEach((t=>{e.register(i,t,this.quickOpenByIndex.bind(this))}))}quickOpenByIndex(e,t){const s=this.config.quickOpen.keyList.indexOf(t.vkey);if(-1!==s){const{chooser:i}=this;i.values.length>s&&(i.setSelectedItem(s,e),this.useSelectedItem(e,t))}return!1}renderQuickOpenFlairIcons(e,t){const{isEnabled:s,modifiers:i,keyList:n}=t.quickOpen;if(s)for(let t=0;te.purpose===o.purpose)),!l){const{modifiers:e,key:t,purpose:s}=o;l={isInstructionOnly:!1,command:Te.commandDisplayStr(e,t),modifiers:e,key:t,purpose:s},i.push(l)}l.eventListener=()=>{const{modal:e,chooser:t}=this;e.close();const i=t.values?.[t.selectedItem];return this.insertIntoEditorAsLink(i,s,n),!1},l.modes=[e]}}return l}updateKeymapForMode(e){const{mode:s,activeLeaf:i}=e,{modal:n,scope:a,customKeysInfo:o,facetKeysInfo:r,standardKeysInfo:l,savedStandardKeysInfo:d,config:{insertLinkInEditor:c,showModeTriggerInstructions:h}}=this;this.updateInsertIntoEditorCommand(s,i,o,c);const u=o.filter((e=>!e.isInstructionOnly));this.unregisterKeys(a,u),this.unregisterKeys(a,r),r.length=0;const m=u.filter((e=>e.modes?.includes(s)));s===t.Standard?this.updateKeymapForStandardMode(a,m,d):this.updateKeymapForCustomModes(a,m,l,e,n),this.showModeTriggerInstructions(n.modalEl,h)}updateKeymapForStandardMode(e,t,s){const i=s.map((([e,t])=>({eventListener:t.func,...e})));this.registerKeys(e,i),s.length=0,this.registerKeys(e,t),this.toggleStandardInstructions(!0)}updateKeymapForCustomModes(e,t,s,i,n){const{savedStandardKeysInfo:a,customKeysInfo:o,facetKeysInfo:r}=this,l=this.unregisterKeys(e,s);l.length&&a.push(...l),this.registerKeys(e,t),this.registerFacetBinding(e,i),this.showCustomInstructions(n,i,o,r)}registerKeys(e,t){t.forEach((({modifiers:t,key:s,eventListener:i})=>{e.register(t,s,i)}))}unregisterKeys(e,t){const s=[],i={};t.map((e=>{const{key:t,modifiers:s}=e,n=Te.modifiersToKeymapInfoStr(s),a=i[t];a?a[n]=e:i[t]={[n]:e}}));let n=e.keys.length;for(;n--;){const t=e.keys[n],a=i[t.key],o=a?.[t.modifiers];o&&(e.unregister(t),s.push([o,t]))}return s}detachCustomInstructionEls(){this.customInstructionEls.forEach((e=>{e.detach()}))}toggleStandardInstructions(e){const{standardInstructionsEl:t}=this;let s="none";e&&(s="",this.detachCustomInstructionEls()),t&&(t.style.display=s)}showCustomInstructions(e,t,s,i){const{mode:n,facets:a}=t,{modalEl:o}=e,r=s.filter((e=>e.modes?.includes(n)));this.toggleStandardInstructions(!1),this.renderCustomInstructions(o,r),this.renderFacetInstructions(o,a?.facetSettings,i)}renderFacetInstructions(e,t,s){if(s?.length&&t.shouldShowFacetInstructions){const i=this.getCustomInstructionsEl("facets",e);i.empty(),e.appendChild(i);const n=`filters | ${Te.commandDisplayStr(t.modifiers)}`;this.createPromptInstructionCommandEl(i,n),s.forEach((e=>{const{facet:s,command:n,purpose:a}=e;let o,r,l=null;s?(r=n,o=s.modifiers,s.isActive&&(l=["qsp-filter-active"])):(r=t.resetKey,o=t.resetModifiers);const d=o?`(${Te.commandDisplayStr(o)}) ${r}`:`${r}`;this.createPromptInstructionCommandEl(i,d,a,[],l)}))}}renderCustomInstructions(e,t){const s=this.getCustomInstructionsEl("custom",e);s.empty(),e.appendChild(s),t.forEach((e=>{this.createPromptInstructionCommandEl(s,e.command,e.purpose)}))}showModeTriggerInstructions(e,t){if(t){const t=this.customInstructionEls.get("modes");t&&e.appendChild(t)}}renderModeTriggerInstructions(e,t){const s=new Map([[t.headingsListCommand,"heading list"],[t.editorListCommand,"editor list"],[t.bookmarksListCommand,"bookmark list"],[t.commandListCommand,"command list"],[t.workspaceListCommand,"workspace list"],[t.vaultListCommand,"vault list"],[t.symbolListActiveEditorCommand,"symbol list (active editor)"],[t.symbolListCommand,"symbol list (embedded)"],[t.relatedItemsListActiveEditorCommand,"related items (active editor)"],[t.relatedItemsListCommand,"related items (embedded)"]]),i=this.getCustomInstructionsEl("modes",e);i.detach(),i.empty(),this.createPromptInstructionCommandEl(i,"mode triggers |"),s.forEach(((e,t)=>{this.createPromptInstructionCommandEl(i,t,e)}))}getCustomInstructionsEl(e,t){let s=this.customInstructionEls.get(e);if(!s){const i={custom:["qsp-prompt-instructions"],facets:["qsp-prompt-instructions-facets"],modes:["qsp-prompt-instructions-modes"]};s=this.createPromptInstructionsEl(i[e],t),this.customInstructionEls.set(e,s)}return s}createPromptInstructionsEl(e,t){const s={cls:["prompt-instructions",...e]};return t.createDiv(s)}createPromptInstructionCommandEl(e,t,s,i,n){i=i??[];const a=e.createDiv();return a.createSpan({cls:["prompt-instruction-command",...i],text:t}),s&&(n=n??[],a.createSpan({cls:n,text:s})),a}closeModalIfEmpty(e,t){const{modal:s,config:i}=this;i.shouldCloseModalOnBackspace&&!s?.inputEl.value&&(s.close(),e.preventDefault())}navigateToCommandHotkeySelector(e,t){const{modal:s,chooser:i,app:{setting:n}}=this,a=i.values?.[i.selectedItem];if(a){n.open();const e=n.openTabById("hotkeys");if(e){s.close();const t=a.item.id;e.setQuery(`${t}`)}}return!1}togglePinnedCommand(e,t){const{app:s,config:i,chooser:n}=this,a=n.values?.[n.selectedItem],o=be.getEnabledCommandPalettePluginInstance(s);if(a&&o){const e=a.item.id,t=n.suggestions[n.selectedItem];let r=o.options?.pinned;if(r){const t=r.indexOf(e);a.isPinned=-1===t,a.isPinned?r.push(e):r.splice(t,1)}else r=[e],o.options.pinned=r;o.saveSettings(o.plugin),t.empty(),new be(s,i).renderSuggestion(a,t)}return!1}toggleMarkdownContentRendering(e,t){const{app:s,config:i,chooser:n}=this,a=n.values?.[n.selectedItem];let o=null,r=null;if(h(a)&&y(a.item.symbol)?(o=a.item.symbol,r=a.file):u(a)&&(o=a.item,r=a.file),o&&r){const e=n.suggestions[n.selectedItem].querySelector(".qsp-title"),t=!e.querySelector(".qsp-rendered-container");e.empty(),ge.renderHeadingContent(s,i,e,o,r,a.match,t)}return!1}openDefaultApp(e,t){const{app:s,config:{openDefaultApp:{excludeFileExtensions:i}},chooser:n}=this,a=n.values?.[n.selectedItem],o=P(a);if(o&&!i.includes(o.extension)){const e=`Switcher++: error opening file (${o.path}) in default app. `;s.openWithDefaultApp(o.path).catch((t=>{console.log(e,t)}))}return!1}useSelectedItem(e,t){return this.chooser.useSelectedItem(e),!1}insertIntoEditorAsLink(e,t,s){const{app:{workspace:i,fileManager:a,vault:o}}=this,r=i.getActiveViewOfType(n.MarkdownView),l=r?.leaf===t,d=r?.file;if(l&&d){const t=x(a,o,e,d.path,s);t&&r.editor?.replaceSelection(t)}}navigateItems(e,t){const{isOpen:s,chooser:i}=this;if(s){let s=i.selectedItem;s=t?++s:--s,i.setSelectedItem(s,e)}}static commandDisplayStr(e,t){const{keyDisplayStr:s}=this;let i=null,n=null;return e&&(i=e.map((e=>s[e]?.toLocaleLowerCase())).sort().join(" ")),t&&(n=Object.prototype.hasOwnProperty.call(s,t)?s[t]:t),[i,n].filter((e=>e)).join(" ")}static modifiersToKeymapInfoStr(e){return e?.map((e=>"Mod"===e?this.modKey:e)).sort().join(",")}createCustomKeymap(e,t,s,i,n=!0,a=!1){let o=null;if(s){const{modifiers:r,key:l}=s;o={modes:t,modifiers:r,key:l,eventListener:i,purpose:e,command:Te.commandDisplayStr(r,l),isInstructionOnly:a},n&&this.customKeysInfo.push(o)}return o}addCustomKeymaps(e){const s=[t.EditorList,t.HeadingsList,t.RelatedItemsList,t.BookmarksList,t.SymbolList],{quickOpen:i}=this.config,n=i?.keyList;if(n?.length){const e=`${n[0]}~${n[n.length-1]}`;this.createCustomKeymap("open nth item",[t.CommandList,t.VaultList,t.WorkspaceList,...s],{modifiers:i.modifiers,key:e},null,i.isEnabled,!0)}this.createCustomKeymap("open in new tab",s,{modifiers:["Mod"],key:"Enter"},null,!0,!0),this.createCustomKeymap("open to the right",s,{modifiers:["Mod"],key:"\\"},null,!0,!0),this.createCustomKeymap("open below",s,{modifiers:["Mod","Shift"],key:"\\"},null,!0,!0),this.createCustomKeymap("open in new window",s,{modifiers:["Mod"],key:"o"},null,!0,!0),this.createCustomKeymap("execute command",[t.CommandList],{modifiers:[],key:"Enter"},null,!0,!0),this.createCustomKeymap("open workspace",[t.WorkspaceList],{modifiers:[],key:"Enter"},null,!0,!0),this.createCustomKeymap("set hotkey",[t.CommandList],e.navigateToHotkeySelectorKeys,this.navigateToCommandHotkeySelector.bind(this)),this.createCustomKeymap("toggle pinned",[t.CommandList],e.togglePinnedCommandKeys,this.togglePinnedCommand.bind(this));const{renderMarkdownContentInSuggestions:a}=e;this.createCustomKeymap("toggle preview (selected heading)",[t.HeadingsList,t.SymbolList],a.toggleContentRenderingKeys,this.toggleMarkdownContentRendering.bind(this),a.isEnabled);const{openDefaultApp:o}=e;this.createCustomKeymap("open default app",s,o.openInDefaultAppKeys,this.openDefaultApp.bind(this),o.isEnabled)}}class Ee{static installMobileLauncherOverride(e,t,s){let i=null;if(!n.Platform.isMobile||!t.isEnabled||Ee.coreMobileLauncherButtonEl)return null;const a=function(e,t){let s=null;const i=e?.mobileNavbar?.containerEl;return i&&(s=i.querySelector(G.defaults.mobileLauncher.coreLauncherButtonSelector),s||(s=i.querySelector(t.coreLauncherButtonSelector))),s}(e,t);if(a){const e=function(e,t,s){let i=null;if(e&&(i=e.cloneNode(!0),i)){const{iconName:e,coreLauncherButtonIconSelector:a}=t;if(i.addClass("qsp-mobile-launcher-button"),i.addEventListener("click",s),e?.length){const t=i.querySelector(a);t&&n.setIcon(t,e)}}return i}(a,t,s);(function(e,t){let s=!1;if(e&&t){const i=t.style.display;t.style.display="none",e.insertAdjacentElement("beforebegin",t)&&(e.remove(),s=!0),t.style.display=i}return s})(a,e)&&(Ee.coreMobileLauncherButtonEl=a,Ee.qspMobileLauncherButtonEl=e,i=e)}return i}static removeMobileLauncherOverride(){let e=!1;if(!Ee.coreMobileLauncherButtonEl)return e;if(Ee.qspMobileLauncherButtonEl?.parentElement){const t=Ee.qspMobileLauncherButtonEl,s=Ee.coreMobileLauncherButtonEl,i=s.style.display;s.style.display="none",t.insertAdjacentElement("beforebegin",s)&&(t.remove(),Ee.qspMobileLauncherButtonEl=null,Ee.coreMobileLauncherButtonEl=null,e=!0),s.style.display=i}return e}}const Fe=[{id:"switcher-plus:open",name:"Open in Standard Mode",mode:t.Standard,iconId:"lucide-file-search",ribbonIconEl:null},{id:"switcher-plus:open-editors",name:"Open in Editor Mode",mode:t.EditorList,iconId:"lucide-file-edit",ribbonIconEl:null},{id:"switcher-plus:open-symbols",name:"Open Symbols for selected suggestion or editor",mode:t.SymbolList,iconId:"lucide-dollar-sign",ribbonIconEl:null},{id:"switcher-plus:open-symbols-active",name:"Open Symbols for the active editor",mode:t.SymbolList,iconId:"lucide-dollar-sign",ribbonIconEl:null,sessionOpts:{useActiveEditorAsSource:!0}},{id:"switcher-plus:open-workspaces",name:"Open in Workspaces Mode",mode:t.WorkspaceList,iconId:"lucide-album",ribbonIconEl:null},{id:"switcher-plus:open-headings",name:"Open in Headings Mode",mode:t.HeadingsList,iconId:"lucide-file-search",ribbonIconEl:null},{id:"switcher-plus:open-starred",name:"Open in Bookmarks Mode",mode:t.BookmarksList,iconId:"lucide-bookmark",ribbonIconEl:null},{id:"switcher-plus:open-commands",name:"Open in Commands Mode",mode:t.CommandList,iconId:"run-command",ribbonIconEl:null},{id:"switcher-plus:open-related-items",name:"Open Related Items for selected suggestion or editor",mode:t.RelatedItemsList,iconId:"lucide-file-plus-2",ribbonIconEl:null},{id:"switcher-plus:open-related-items-active",name:"Open Related Items for the active editor",mode:t.RelatedItemsList,iconId:"lucide-file-plus-2",ribbonIconEl:null,sessionOpts:{useActiveEditorAsSource:!0}},{id:"switcher-plus:open-vaults",name:"Open in Vaults Mode",mode:t.VaultList,iconId:"vault",ribbonIconEl:null}];class Ae extends n.Plugin{async onload(){const e=new G(this);await e.updateDataAndLoadSettings(),this.options=e,this.addSettingTab(new oe(this.app,this,e)),this.registerRibbonCommandIcons(),this.updateMobileLauncherButtonOverride(e.mobileLauncher.isEnabled),Fe.forEach((({id:e,name:t,mode:s,iconId:i,sessionOpts:n})=>{this.registerCommand(e,t,s,i,n)}))}onunload(){this.updateMobileLauncherButtonOverride(!1)}registerCommand(e,t,s,i,n){this.addCommand({id:e,name:t,icon:i,checkCallback:e=>this.createModalAndOpen(s,e,n)})}registerRibbonCommandIcons(){Fe.forEach((e=>{e.ribbonIconEl?.remove(),e.ribbonIconEl=null}));const e=Fe.reduce(((e,t)=>(e[t.mode]=t,e)),{});this.options.enabledRibbonCommands.forEach((s=>{const i=e[t[s]];i&&(i.ribbonIconEl=this.addRibbonIcon(i.iconId,i.name,(()=>{this.createModalAndOpen(i.mode,!1)})))}))}createModalAndOpen(e,t,s){if(!t){const t=function(e,t){const s=C(e)?.QuickSwitcherModal;return s?new class extends s{constructor(e,t){super(e,t.options.builtInSystemOptions),this.plugin=t;const{options:s}=t;s.shouldShowAlias=this.shouldShowAlias;const i=new Te(e,this.scope,this.chooser,this,s);this.exMode=new Ce(e,s,i)}openInMode(e,t){this.exMode.setSessionOpenMode(e,this.chooser,t),super.open()}onOpen(){this.exMode.onOpen(),super.onOpen()}onClose(){super.onClose(),this.exMode.onClose()}updateSuggestions(){const{exMode:e,inputEl:t,chooser:s}=this;e.insertSessionOpenModeOrLastInputString(t),e.updateSuggestions(t.value,s,this)||super.updateSuggestions()}getSuggestions(e){const t=this.exMode.inputTextForStandardMode(e);return super.getSuggestions(t)}onChooseSuggestion(e,t){this.exMode.onChooseSuggestion(e,t)||super.onChooseSuggestion(e,t)}renderSuggestion(e,t){this.exMode.renderSuggestion(e,t)||super.renderSuggestion(e,t)}}(e,t):(console.log("Switcher++: unable to extend system switcher. Plugin UI will not be loaded. Use the builtin switcher instead."),null)}(this.app,this);if(!t)return!1;t.openInMode(e,s)}return!0}updateMobileLauncherButtonOverride(e){if(e){const e=()=>{const e=this.options.mobileLauncher.modeString,s=t[e];s&&this.createModalAndOpen(s,!1)};Ee.installMobileLauncherOverride(this.app,this.options.mobileLauncher,e)}else Ee.removeMobileLauncherOverride()}}module.exports=Ae; /* nosourcemap */ \ No newline at end of file diff --git a/.obsidian/plugins/darlal-switcher-plus/manifest.json b/.obsidian/plugins/darlal-switcher-plus/manifest.json index eacf1db5..24ff4f11 100644 --- a/.obsidian/plugins/darlal-switcher-plus/manifest.json +++ b/.obsidian/plugins/darlal-switcher-plus/manifest.json @@ -1,8 +1,8 @@ { "id": "darlal-switcher-plus", "name": "Quick Switcher++", - "version": "4.6.2", - "minAppVersion": "1.7.4", + "version": "4.6.3", + "minAppVersion": "1.7.7", "description": "Enhanced Quick Switcher, search open panels, and symbols.", "author": "darlal", "authorUrl": "https://github.com/darlal/obsidian-switcher-plus", diff --git a/.obsidian/plugins/janitor/main.js b/.obsidian/plugins/janitor/main.js new file mode 100644 index 00000000..73adb00a --- /dev/null +++ b/.obsidian/plugins/janitor/main.js @@ -0,0 +1,65 @@ +/* +THIS IS A GENERATED/BUNDLED FILE BY ESBUILD +if you want to view the source, please visit the github repository of this plugin +*/ + +var Xb=Object.create;var Ki=Object.defineProperty,jb=Object.defineProperties,Ub=Object.getOwnPropertyDescriptor,Jb=Object.getOwnPropertyDescriptors,Qb=Object.getOwnPropertyNames,jf=Object.getOwnPropertySymbols,$b=Object.getPrototypeOf,Jf=Object.prototype.hasOwnProperty,Kb=Object.prototype.propertyIsEnumerable;var Uf=(e,t,n)=>t in e?Ki(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,U=(e,t)=>{for(var n in t||(t={}))Jf.call(t,n)&&Uf(e,n,t[n]);if(jf)for(var n of jf(t))Kb.call(t,n)&&Uf(e,n,t[n]);return e},ce=(e,t)=>jb(e,Jb(t));var K=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),qb=(e,t)=>{for(var n in t)Ki(e,n,{get:t[n],enumerable:!0})},Qf=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Qb(t))!Jf.call(e,i)&&i!==n&&Ki(e,i,{get:()=>t[i],enumerable:!(r=Ub(t,i))||r.enumerable});return e};var we=(e,t,n)=>(n=e!=null?Xb($b(e)):{},Qf(t||!e||!e.__esModule?Ki(n,"default",{value:e,enumerable:!0}):n,e)),eI=e=>Qf(Ki({},"__esModule",{value:!0}),e);var ye=(e,t,n)=>new Promise((r,i)=>{var a=d=>{try{u(n.next(d))}catch(h){i(h)}},l=d=>{try{u(n.throw(d))}catch(h){i(h)}},u=d=>d.done?r(d.value):Promise.resolve(d.value).then(a,l);u((n=n.apply(e,t)).next())});var sp=K(Q=>{"use strict";var qi=Symbol.for("react.element"),tI=Symbol.for("react.portal"),nI=Symbol.for("react.fragment"),rI=Symbol.for("react.strict_mode"),iI=Symbol.for("react.profiler"),oI=Symbol.for("react.provider"),aI=Symbol.for("react.context"),sI=Symbol.for("react.forward_ref"),lI=Symbol.for("react.suspense"),uI=Symbol.for("react.memo"),cI=Symbol.for("react.lazy"),$f=Symbol.iterator;function dI(e){return e===null||typeof e!="object"?null:(e=$f&&e[$f]||e["@@iterator"],typeof e=="function"?e:null)}var ep={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},tp=Object.assign,np={};function si(e,t,n){this.props=e,this.context=t,this.refs=np,this.updater=n||ep}si.prototype.isReactComponent={};si.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};si.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function rp(){}rp.prototype=si.prototype;function Hl(e,t,n){this.props=e,this.context=t,this.refs=np,this.updater=n||ep}var Zl=Hl.prototype=new rp;Zl.constructor=Hl;tp(Zl,si.prototype);Zl.isPureReactComponent=!0;var Kf=Array.isArray,ip=Object.prototype.hasOwnProperty,Xl={current:null},op={key:!0,ref:!0,__self:!0,__source:!0};function ap(e,t,n){var r,i={},a=null,l=null;if(t!=null)for(r in t.ref!==void 0&&(l=t.ref),t.key!==void 0&&(a=""+t.key),t)ip.call(t,r)&&!op.hasOwnProperty(r)&&(i[r]=t[r]);var u=arguments.length-2;if(u===1)i.children=n;else if(1{"use strict";lp.exports=sp()});var yp=K(Ce=>{"use strict";function $l(e,t){var n=e.length;e.push(t);e:for(;0>>1,i=e[r];if(0>>1;rIa(u,n))dIa(h,u)?(e[r]=h,e[d]=n,r=d):(e[r]=u,e[l]=n,r=l);else if(dIa(h,n))e[r]=h,e[d]=n,r=d;else break e}}return t}function Ia(e,t){var n=e.sortIndex-t.sortIndex;return n!==0?n:e.id-t.id}typeof performance=="object"&&typeof performance.now=="function"?(up=performance,Ce.unstable_now=function(){return up.now()}):(Ul=Date,cp=Ul.now(),Ce.unstable_now=function(){return Ul.now()-cp});var up,Ul,cp,bn=[],or=[],gI=1,jt=null,ft=3,xa=!1,Gr=!1,to=!1,pp=typeof setTimeout=="function"?setTimeout:null,hp=typeof clearTimeout=="function"?clearTimeout:null,dp=typeof setImmediate!="undefined"?setImmediate:null;typeof navigator!="undefined"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function Kl(e){for(var t=sn(or);t!==null;){if(t.callback===null)wa(or);else if(t.startTime<=e)wa(or),t.sortIndex=t.expirationTime,$l(bn,t);else break;t=sn(or)}}function ql(e){if(to=!1,Kl(e),!Gr)if(sn(bn)!==null)Gr=!0,tu(eu);else{var t=sn(or);t!==null&&nu(ql,t.startTime-e)}}function eu(e,t){Gr=!1,to&&(to=!1,hp(no),no=-1),xa=!0;var n=ft;try{for(Kl(t),jt=sn(bn);jt!==null&&(!(jt.expirationTime>t)||e&&!vp());){var r=jt.callback;if(typeof r=="function"){jt.callback=null,ft=jt.priorityLevel;var i=r(jt.expirationTime<=t);t=Ce.unstable_now(),typeof i=="function"?jt.callback=i:jt===sn(bn)&&wa(bn),Kl(t)}else wa(bn);jt=sn(bn)}if(jt!==null)var a=!0;else{var l=sn(or);l!==null&&nu(ql,l.startTime-t),a=!1}return a}finally{jt=null,ft=n,xa=!1}}var Ea=!1,Sa=null,no=-1,mp=5,gp=-1;function vp(){return!(Ce.unstable_now()-gpe||125r?(e.sortIndex=n,$l(or,e),sn(bn)===null&&e===sn(or)&&(to?(hp(no),no=-1):to=!0,nu(ql,n-r))):(e.sortIndex=i,$l(bn,e),Gr||xa||(Gr=!0,tu(eu))),e};Ce.unstable_shouldYield=vp;Ce.unstable_wrapCallback=function(e){var t=ft;return function(){var n=ft;ft=t;try{return e.apply(this,arguments)}finally{ft=n}}}});var bp=K((yE,Cp)=>{"use strict";Cp.exports=yp()});var kg=K(Ht=>{"use strict";var Ah=De(),Yt=bp();function O(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;nt}return!1}function xt(e,t,n,r,i,a,l){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=a,this.removeEmptyString=l}var nt={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){nt[e]=new xt(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];nt[t]=new xt(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){nt[e]=new xt(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){nt[e]=new xt(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){nt[e]=new xt(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){nt[e]=new xt(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){nt[e]=new xt(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){nt[e]=new xt(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){nt[e]=new xt(e,5,!1,e.toLowerCase(),null,!1,!1)});var vc=/[\-:]([a-z])/g;function yc(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(vc,yc);nt[t]=new xt(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(vc,yc);nt[t]=new xt(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(vc,yc);nt[t]=new xt(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){nt[e]=new xt(e,1,!1,e.toLowerCase(),null,!1,!1)});nt.xlinkHref=new xt("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){nt[e]=new xt(e,1,!1,e.toLowerCase(),null,!0,!0)});function Cc(e,t,n,r){var i=nt.hasOwnProperty(t)?nt[t]:null;(i!==null?i.type!==0:r||!(2u||i[l]!==a[u]){var d=` +`+i[l].replace(" at new "," at ");return e.displayName&&d.includes("")&&(d=d.replace("",e.displayName)),d}while(1<=l&&0<=u);break}}}finally{iu=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?fo(e):""}function II(e){switch(e.tag){case 5:return fo(e.type);case 16:return fo("Lazy");case 13:return fo("Suspense");case 19:return fo("SuspenseList");case 0:case 2:case 15:return e=ou(e.type,!1),e;case 11:return e=ou(e.type.render,!1),e;case 1:return e=ou(e.type,!0),e;default:return""}}function Mu(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case di:return"Fragment";case ci:return"Portal";case ku:return"Profiler";case bc:return"StrictMode";case Au:return"Suspense";case Nu:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case Ph:return(e.displayName||"Context")+".Consumer";case Mh:return(e._context.displayName||"Context")+".Provider";case Ic:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Sc:return t=e.displayName||null,t!==null?t:Mu(e.type)||"Memo";case sr:t=e._payload,e=e._init;try{return Mu(e(t))}catch(n){}}return null}function SI(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Mu(t);case 8:return t===bc?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function Ir(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Fh(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function wI(e){var t=Fh(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n!="undefined"&&typeof n.get=="function"&&typeof n.set=="function"){var i=n.get,a=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(l){r=""+l,a.call(this,l)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(l){r=""+l},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Aa(e){e._valueTracker||(e._valueTracker=wI(e))}function Oh(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=Fh(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function ts(e){if(e=e||(typeof document!="undefined"?document:void 0),typeof e=="undefined")return null;try{return e.activeElement||e.body}catch(t){return e.body}}function Pu(e,t){var n=t.checked;return Fe({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n!=null?n:e._wrapperState.initialChecked})}function xp(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=Ir(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function _h(e,t){t=t.checked,t!=null&&Cc(e,"checked",t,!1)}function Tu(e,t){_h(e,t);var n=Ir(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?Fu(e,t.type,n):t.hasOwnProperty("defaultValue")&&Fu(e,t.type,Ir(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Ep(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function Fu(e,t,n){(t!=="number"||ts(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var po=Array.isArray;function Si(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i"+t.valueOf().toString()+"",t=Na.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function ko(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var go={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},xI=["Webkit","ms","Moz","O"];Object.keys(go).forEach(function(e){xI.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),go[t]=go[e]})});function Vh(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||go.hasOwnProperty(e)&&go[e]?(""+t).trim():t+"px"}function Bh(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,i=Vh(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,i):e[n]=i}}var EI=Fe({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Ru(e,t){if(t){if(EI[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(O(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(O(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(O(61))}if(t.style!=null&&typeof t.style!="object")throw Error(O(62))}}function Du(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Gu=null;function wc(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Vu=null,wi=null,xi=null;function Np(e){if(e=Ho(e)){if(typeof Vu!="function")throw Error(O(280));var t=e.stateNode;t&&(t=Ms(t),Vu(e.stateNode,e.type,t))}}function Lh(e){wi?xi?xi.push(e):xi=[e]:wi=e}function Wh(){if(wi){var e=wi,t=xi;if(xi=wi=null,Np(e),t)for(e=0;e>>=0,e===0?32:31-(DI(e)/GI|0)|0}var Ma=64,Pa=4194304;function ho(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function os(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,i=e.suspendedLanes,a=e.pingedLanes,l=n&268435455;if(l!==0){var u=l&~i;u!==0?r=ho(u):(a&=l,a!==0&&(r=ho(a)))}else l=n&~i,l!==0?r=ho(l):a!==0&&(r=ho(a));if(r===0)return 0;if(t!==0&&t!==r&&(t&i)===0&&(i=r&-r,a=t&-t,i>=a||i===16&&(a&4194240)!==0))return t;if((r&4)!==0&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0n;n++)t.push(e);return t}function Yo(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-fn(t),e[t]=n}function WI(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0=yo),Gp=String.fromCharCode(32),Vp=!1;function sm(e,t){switch(e){case"keyup":return mS.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function lm(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var fi=!1;function vS(e,t){switch(e){case"compositionend":return lm(t);case"keypress":return t.which!==32?null:(Vp=!0,Gp);case"textInput":return e=t.data,e===Gp&&Vp?null:e;default:return null}}function yS(e,t){if(fi)return e==="compositionend"||!Tc&&sm(e,t)?(e=om(),Xa=Nc=dr=null,fi=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=Wp(n)}}function fm(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?fm(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function pm(){for(var e=window,t=ts();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch(r){n=!1}if(n)e=t.contentWindow;else break;t=ts(e.document)}return t}function Fc(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function AS(e){var t=pm(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&fm(n.ownerDocument.documentElement,n)){if(r!==null&&Fc(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var i=n.textContent.length,a=Math.min(r.start,i);r=r.end===void 0?a:Math.min(r.end,i),!e.extend&&a>r&&(i=r,r=a,a=i),i=Yp(n,a);var l=Yp(n,r);i&&l&&(e.rangeCount!==1||e.anchorNode!==i.node||e.anchorOffset!==i.offset||e.focusNode!==l.node||e.focusOffset!==l.offset)&&(t=t.createRange(),t.setStart(i.node,i.offset),e.removeAllRanges(),a>r?(e.addRange(t),e.extend(l.node,l.offset)):(t.setEnd(l.node,l.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n=document.documentMode,pi=null,Hu=null,bo=null,Zu=!1;function zp(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Zu||pi==null||pi!==ts(r)||(r=pi,"selectionStart"in r&&Fc(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),bo&&Fo(bo,r)||(bo=r,r=ls(Hu,"onSelect"),0gi||(e.current=$u[gi],$u[gi]=null,gi--)}function be(e,t){gi++,$u[gi]=e.current,e.current=t}var Sr={},gt=xr(Sr),Mt=xr(!1),Zr=Sr;function Mi(e,t){var n=e.type.contextTypes;if(!n)return Sr;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var i={},a;for(a in n)i[a]=t[a];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=i),i}function Pt(e){return e=e.childContextTypes,e!=null}function cs(){Ee(Mt),Ee(gt)}function Kp(e,t,n){if(gt.current!==Sr)throw Error(O(168));be(gt,t),be(Mt,n)}function Sm(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var i in r)if(!(i in t))throw Error(O(108,SI(e)||"Unknown",i));return Fe({},n,r)}function ds(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Sr,Zr=gt.current,be(gt,e),be(Mt,Mt.current),!0}function qp(e,t,n){var r=e.stateNode;if(!r)throw Error(O(169));n?(e=Sm(e,t,Zr),r.__reactInternalMemoizedMergedChildContext=e,Ee(Mt),Ee(gt),be(gt,e)):Ee(Mt),be(Mt,n)}var zn=null,Ps=!1,gu=!1;function wm(e){zn===null?zn=[e]:zn.push(e)}function GS(e){Ps=!0,wm(e)}function Er(){if(!gu&&zn!==null){gu=!0;var e=0,t=de;try{var n=zn;for(de=1;e>=l,i-=l,Hn=1<<32-fn(t)+i|n<T?(D=F,F=null):D=F.sibling;var L=S(v,F,I[T],E);if(L===null){F===null&&(F=D);break}e&&F&&L.alternate===null&&t(v,F),g=a(L,g,T),M===null?P=L:M.sibling=L,M=L,F=D}if(T===I.length)return n(v,F),Ae&&Vr(v,T),P;if(F===null){for(;TT?(D=F,F=null):D=F.sibling;var z=S(v,F,L.value,E);if(z===null){F===null&&(F=D);break}e&&F&&z.alternate===null&&t(v,F),g=a(z,g,T),M===null?P=z:M.sibling=z,M=z,F=D}if(L.done)return n(v,F),Ae&&Vr(v,T),P;if(F===null){for(;!L.done;T++,L=I.next())L=C(v,L.value,E),L!==null&&(g=a(L,g,T),M===null?P=L:M.sibling=L,M=L);return Ae&&Vr(v,T),P}for(F=r(v,F);!L.done;T++,L=I.next())L=x(F,v,T,L.value,E),L!==null&&(e&&L.alternate!==null&&F.delete(L.key===null?T:L.key),g=a(L,g,T),M===null?P=L:M.sibling=L,M=L);return e&&F.forEach(function(ae){return t(v,ae)}),Ae&&Vr(v,T),P}function N(v,g,I,E){if(typeof I=="object"&&I!==null&&I.type===di&&I.key===null&&(I=I.props.children),typeof I=="object"&&I!==null){switch(I.$$typeof){case ka:e:{for(var P=I.key,M=g;M!==null;){if(M.key===P){if(P=I.type,P===di){if(M.tag===7){n(v,M.sibling),g=i(M,I.props.children),g.return=v,v=g;break e}}else if(M.elementType===P||typeof P=="object"&&P!==null&&P.$$typeof===sr&&ah(P)===M.type){n(v,M.sibling),g=i(M,I.props),g.ref=so(v,M,I),g.return=v,v=g;break e}n(v,M);break}else t(v,M);M=M.sibling}I.type===di?(g=Hr(I.props.children,v.mode,E,I.key),g.return=v,v=g):(E=es(I.type,I.key,I.props,null,v.mode,E),E.ref=so(v,g,I),E.return=v,v=E)}return l(v);case ci:e:{for(M=I.key;g!==null;){if(g.key===M)if(g.tag===4&&g.stateNode.containerInfo===I.containerInfo&&g.stateNode.implementation===I.implementation){n(v,g.sibling),g=i(g,I.children||[]),g.return=v,v=g;break e}else{n(v,g);break}else t(v,g);g=g.sibling}g=xu(I,v.mode,E),g.return=v,v=g}return l(v);case sr:return M=I._init,N(v,g,M(I._payload),E)}if(po(I))return w(v,g,I,E);if(ro(I))return k(v,g,I,E);Wa(v,I)}return typeof I=="string"&&I!==""||typeof I=="number"?(I=""+I,g!==null&&g.tag===6?(n(v,g.sibling),g=i(g,I),g.return=v,v=g):(n(v,g),g=wu(I,v.mode,E),g.return=v,v=g),l(v)):n(v,g)}return N}var Ti=Tm(!0),Fm=Tm(!1),Zo={},En=xr(Zo),Do=xr(Zo),Go=xr(Zo);function Yr(e){if(e===Zo)throw Error(O(174));return e}function Wc(e,t){switch(be(Go,t),be(Do,e),be(En,Zo),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:_u(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=_u(t,e)}Ee(En),be(En,t)}function Fi(){Ee(En),Ee(Do),Ee(Go)}function Om(e){Yr(Go.current);var t=Yr(En.current),n=_u(t,e.type);t!==n&&(be(Do,e),be(En,n))}function Yc(e){Do.current===e&&(Ee(En),Ee(Do))}var Pe=xr(0);function vs(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if((t.flags&128)!==0)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var vu=[];function zc(){for(var e=0;en?n:4,e(!0);var r=yu.transition;yu.transition={};try{e(!1),t()}finally{de=n,yu.transition=r}}function Jm(){return qt().memoizedState}function WS(e,t,n){var r=Cr(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},Qm(e))$m(t,n);else if(n=Am(e,t,n,r),n!==null){var i=wt();pn(n,e,r,i),Km(n,t,r)}}function YS(e,t,n){var r=Cr(e),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(Qm(e))$m(t,i);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var l=t.lastRenderedState,u=a(l,n);if(i.hasEagerState=!0,i.eagerState=u,hn(u,l)){var d=t.interleaved;d===null?(i.next=i,Bc(t)):(i.next=d.next,d.next=i),t.interleaved=i;return}}catch(h){}finally{}n=Am(e,t,i,r),n!==null&&(i=wt(),pn(n,e,r,i),Km(n,t,r))}}function Qm(e){var t=e.alternate;return e===Te||t!==null&&t===Te}function $m(e,t){Io=ys=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Km(e,t,n){if((n&4194240)!==0){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Ec(e,n)}}var Cs={readContext:Kt,useCallback:pt,useContext:pt,useEffect:pt,useImperativeHandle:pt,useInsertionEffect:pt,useLayoutEffect:pt,useMemo:pt,useReducer:pt,useRef:pt,useState:pt,useDebugValue:pt,useDeferredValue:pt,useTransition:pt,useMutableSource:pt,useSyncExternalStore:pt,useId:pt,unstable_isNewReconciler:!1},zS={readContext:Kt,useCallback:function(e,t){return Sn().memoizedState=[e,t===void 0?null:t],e},useContext:Kt,useEffect:lh,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,Qa(4194308,4,Hm.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Qa(4194308,4,e,t)},useInsertionEffect:function(e,t){return Qa(4,2,e,t)},useMemo:function(e,t){var n=Sn();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Sn();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=WS.bind(null,Te,e),[r.memoizedState,e]},useRef:function(e){var t=Sn();return e={current:e},t.memoizedState=e},useState:sh,useDebugValue:Uc,useDeferredValue:function(e){return Sn().memoizedState=e},useTransition:function(){var e=sh(!1),t=e[0];return e=LS.bind(null,e[1]),Sn().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=Te,i=Sn();if(Ae){if(n===void 0)throw Error(O(407));n=n()}else{if(n=t(),Je===null)throw Error(O(349));(jr&30)!==0||Dm(r,t,n)}i.memoizedState=n;var a={value:n,getSnapshot:t};return i.queue=a,lh(Vm.bind(null,r,a,e),[e]),r.flags|=2048,Lo(9,Gm.bind(null,r,a,n,t),void 0,null),n},useId:function(){var e=Sn(),t=Je.identifierPrefix;if(Ae){var n=Zn,r=Hn;n=(r&~(1<<32-fn(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=Vo++,0<\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=l.createElement(n,{is:r.is}):(e=l.createElement(n),n==="select"&&(l=e,r.multiple?l.multiple=!0:r.size&&(l.size=r.size))):e=l.createElementNS(e,n),e[wn]=t,e[Ro]=r,sg(e,t,!1,!1),t.stateNode=e;e:{switch(l=Du(n,r),n){case"dialog":xe("cancel",e),xe("close",e),i=r;break;case"iframe":case"object":case"embed":xe("load",e),i=r;break;case"video":case"audio":for(i=0;i_i&&(t.flags|=128,r=!0,lo(a,!1),t.lanes=4194304)}else{if(!r)if(e=vs(l),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),lo(a,!0),a.tail===null&&a.tailMode==="hidden"&&!l.alternate&&!Ae)return ht(t),null}else 2*Ge()-a.renderingStartTime>_i&&n!==1073741824&&(t.flags|=128,r=!0,lo(a,!1),t.lanes=4194304);a.isBackwards?(l.sibling=t.child,t.child=l):(n=a.last,n!==null?n.sibling=l:t.child=l,a.last=l)}return a.tail!==null?(t=a.tail,a.rendering=t,a.tail=t.sibling,a.renderingStartTime=Ge(),t.sibling=null,n=Pe.current,be(Pe,r?n&1|2:n&1),t):(ht(t),null);case 22:case 23:return ed(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&(t.mode&1)!==0?(Bt&1073741824)!==0&&(ht(t),t.subtreeFlags&6&&(t.flags|=8192)):ht(t),null;case 24:return null;case 25:return null}throw Error(O(156,t.tag))}function $S(e,t){switch(_c(t),t.tag){case 1:return Pt(t.type)&&cs(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Fi(),Ee(Mt),Ee(gt),zc(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 5:return Yc(t),null;case 13:if(Ee(Pe),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(O(340));Pi()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Ee(Pe),null;case 4:return Fi(),null;case 10:return Vc(t.type._context),null;case 22:case 23:return ed(),null;case 24:return null;default:return null}}var za=!1,mt=!1,KS=typeof WeakSet=="function"?WeakSet:Set,V=null;function bi(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){Oe(e,t,r)}else n.current=null}function uc(e,t,n){try{n()}catch(r){Oe(e,t,r)}}var vh=!1;function qS(e,t){if(Xu=as,e=pm(),Fc(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var i=r.anchorOffset,a=r.focusNode;r=r.focusOffset;try{n.nodeType,a.nodeType}catch(E){n=null;break e}var l=0,u=-1,d=-1,h=0,m=0,C=e,S=null;t:for(;;){for(var x;C!==n||i!==0&&C.nodeType!==3||(u=l+i),C!==a||r!==0&&C.nodeType!==3||(d=l+r),C.nodeType===3&&(l+=C.nodeValue.length),(x=C.firstChild)!==null;)S=C,C=x;for(;;){if(C===e)break t;if(S===n&&++h===i&&(u=l),S===a&&++m===r&&(d=l),(x=C.nextSibling)!==null)break;C=S,S=C.parentNode}C=x}n=u===-1||d===-1?null:{start:u,end:d}}else n=null}n=n||{start:0,end:0}}else n=null;for(ju={focusedElem:e,selectionRange:n},as=!1,V=t;V!==null;)if(t=V,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,V=e;else for(;V!==null;){t=V;try{var w=t.alternate;if((t.flags&1024)!==0)switch(t.tag){case 0:case 11:case 15:break;case 1:if(w!==null){var k=w.memoizedProps,N=w.memoizedState,v=t.stateNode,g=v.getSnapshotBeforeUpdate(t.elementType===t.type?k:un(t.type,k),N);v.__reactInternalSnapshotBeforeUpdate=g}break;case 3:var I=t.stateNode.containerInfo;I.nodeType===1?I.textContent="":I.nodeType===9&&I.documentElement&&I.removeChild(I.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(O(163))}}catch(E){Oe(t,t.return,E)}if(e=t.sibling,e!==null){e.return=t.return,V=e;break}V=t.return}return w=vh,vh=!1,w}function So(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var i=r=r.next;do{if((i.tag&e)===e){var a=i.destroy;i.destroy=void 0,a!==void 0&&uc(t,n,a)}i=i.next}while(i!==r)}}function Os(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function cc(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function cg(e){var t=e.alternate;t!==null&&(e.alternate=null,cg(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[wn],delete t[Ro],delete t[Qu],delete t[RS],delete t[DS])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function dg(e){return e.tag===5||e.tag===3||e.tag===4}function yh(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||dg(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function dc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=us));else if(r!==4&&(e=e.child,e!==null))for(dc(e,t,n),e=e.sibling;e!==null;)dc(e,t,n),e=e.sibling}function fc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(fc(e,t,n),e=e.sibling;e!==null;)fc(e,t,n),e=e.sibling}var et=null,cn=!1;function ar(e,t,n){for(n=n.child;n!==null;)fg(e,t,n),n=n.sibling}function fg(e,t,n){if(xn&&typeof xn.onCommitFiberUnmount=="function")try{xn.onCommitFiberUnmount(Es,n)}catch(u){}switch(n.tag){case 5:mt||bi(n,t);case 6:var r=et,i=cn;et=null,ar(e,t,n),et=r,cn=i,et!==null&&(cn?(e=et,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):et.removeChild(n.stateNode));break;case 18:et!==null&&(cn?(e=et,n=n.stateNode,e.nodeType===8?mu(e.parentNode,n):e.nodeType===1&&mu(e,n),Po(e)):mu(et,n.stateNode));break;case 4:r=et,i=cn,et=n.stateNode.containerInfo,cn=!0,ar(e,t,n),et=r,cn=i;break;case 0:case 11:case 14:case 15:if(!mt&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){i=r=r.next;do{var a=i,l=a.destroy;a=a.tag,l!==void 0&&((a&2)!==0||(a&4)!==0)&&uc(n,t,l),i=i.next}while(i!==r)}ar(e,t,n);break;case 1:if(!mt&&(bi(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(u){Oe(n,t,u)}ar(e,t,n);break;case 21:ar(e,t,n);break;case 22:n.mode&1?(mt=(r=mt)||n.memoizedState!==null,ar(e,t,n),mt=r):ar(e,t,n);break;default:ar(e,t,n)}}function Ch(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new KS),t.forEach(function(r){var i=lw.bind(null,e,r);n.has(r)||(n.add(r),r.then(i,i))})}}function ln(e,t){var n=t.deletions;if(n!==null)for(var r=0;ri&&(i=l),r&=~a}if(r=i,r=Ge()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*tw(r/1960))-r,10e?16:e,fr===null)var r=!1;else{if(e=fr,fr=null,Ss=0,(re&6)!==0)throw Error(O(331));var i=re;for(re|=4,V=e.current;V!==null;){var a=V,l=a.child;if((V.flags&16)!==0){var u=a.deletions;if(u!==null){for(var d=0;dGe()-Kc?zr(e,0):$c|=n),Tt(e,t)}function bg(e,t){t===0&&((e.mode&1)===0?t=1:(t=Pa,Pa<<=1,(Pa&130023424)===0&&(Pa=4194304)));var n=wt();e=Jn(e,t),e!==null&&(Yo(e,t,n),Tt(e,n))}function sw(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),bg(e,n)}function lw(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,i=e.memoizedState;i!==null&&(n=i.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(O(314))}r!==null&&r.delete(t),bg(e,n)}var Ig;Ig=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||Mt.current)Nt=!0;else{if((e.lanes&n)===0&&(t.flags&128)===0)return Nt=!1,JS(e,t,n);Nt=(e.flags&131072)!==0}else Nt=!1,Ae&&(t.flags&1048576)!==0&&xm(t,ps,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;$a(e,t),e=t.pendingProps;var i=Mi(t,gt.current);ki(t,n),i=Zc(null,t,r,e,i,n);var a=Xc();return t.flags|=1,typeof i=="object"&&i!==null&&typeof i.render=="function"&&i.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,Pt(r)?(a=!0,ds(t)):a=!1,t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,Lc(t),i.updater=Ts,t.stateNode=i,i._reactInternals=t,nc(t,r,e,n),t=oc(null,t,r,!0,a,n)):(t.tag=0,Ae&&a&&Oc(t),St(null,t,i,n),t=t.child),t;case 16:r=t.elementType;e:{switch($a(e,t),e=t.pendingProps,i=r._init,r=i(r._payload),t.type=r,i=t.tag=cw(r),e=un(r,e),i){case 0:t=ic(null,t,r,e,n);break e;case 1:t=hh(null,t,r,e,n);break e;case 11:t=fh(null,t,r,e,n);break e;case 14:t=ph(null,t,r,un(r.type,e),n);break e}throw Error(O(306,r,""))}return t;case 0:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:un(r,i),ic(e,t,r,i,n);case 1:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:un(r,i),hh(e,t,r,i,n);case 3:e:{if(ig(t),e===null)throw Error(O(387));r=t.pendingProps,a=t.memoizedState,i=a.element,Nm(e,t),gs(t,r,null,n);var l=t.memoizedState;if(r=l.element,a.isDehydrated)if(a={element:r,isDehydrated:!1,cache:l.cache,pendingSuspenseBoundaries:l.pendingSuspenseBoundaries,transitions:l.transitions},t.updateQueue.baseState=a,t.memoizedState=a,t.flags&256){i=Oi(Error(O(423)),t),t=mh(e,t,r,n,i);break e}else if(r!==i){i=Oi(Error(O(424)),t),t=mh(e,t,r,n,i);break e}else for(Lt=gr(t.stateNode.containerInfo.firstChild),Wt=t,Ae=!0,dn=null,n=Fm(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Pi(),r===i){t=Qn(e,t,n);break e}St(e,t,r,n)}t=t.child}return t;case 5:return Om(t),e===null&&qu(t),r=t.type,i=t.pendingProps,a=e!==null?e.memoizedProps:null,l=i.children,Uu(r,i)?l=null:a!==null&&Uu(r,a)&&(t.flags|=32),rg(e,t),St(e,t,l,n),t.child;case 6:return e===null&&qu(t),null;case 13:return og(e,t,n);case 4:return Wc(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Ti(t,null,r,n):St(e,t,r,n),t.child;case 11:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:un(r,i),fh(e,t,r,i,n);case 7:return St(e,t,t.pendingProps,n),t.child;case 8:return St(e,t,t.pendingProps.children,n),t.child;case 12:return St(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,i=t.pendingProps,a=t.memoizedProps,l=i.value,be(hs,r._currentValue),r._currentValue=l,a!==null)if(hn(a.value,l)){if(a.children===i.children&&!Mt.current){t=Qn(e,t,n);break e}}else for(a=t.child,a!==null&&(a.return=t);a!==null;){var u=a.dependencies;if(u!==null){l=a.child;for(var d=u.firstContext;d!==null;){if(d.context===r){if(a.tag===1){d=Xn(-1,n&-n),d.tag=2;var h=a.updateQueue;if(h!==null){h=h.shared;var m=h.pending;m===null?d.next=d:(d.next=m.next,m.next=d),h.pending=d}}a.lanes|=n,d=a.alternate,d!==null&&(d.lanes|=n),ec(a.return,n,t),u.lanes|=n;break}d=d.next}}else if(a.tag===10)l=a.type===t.type?null:a.child;else if(a.tag===18){if(l=a.return,l===null)throw Error(O(341));l.lanes|=n,u=l.alternate,u!==null&&(u.lanes|=n),ec(l,n,t),l=a.sibling}else l=a.child;if(l!==null)l.return=a;else for(l=a;l!==null;){if(l===t){l=null;break}if(a=l.sibling,a!==null){a.return=l.return,l=a;break}l=l.return}a=l}St(e,t,i.children,n),t=t.child}return t;case 9:return i=t.type,r=t.pendingProps.children,ki(t,n),i=Kt(i),r=r(i),t.flags|=1,St(e,t,r,n),t.child;case 14:return r=t.type,i=un(r,t.pendingProps),i=un(r.type,i),ph(e,t,r,i,n);case 15:return tg(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:un(r,i),$a(e,t),t.tag=1,Pt(r)?(e=!0,ds(t)):e=!1,ki(t,n),Pm(t,r,i),nc(t,r,i,n),oc(null,t,r,!0,e,n);case 19:return ag(e,t,n);case 22:return ng(e,t,n)}throw Error(O(156,t.tag))};function Sg(e,t){return Uh(e,t)}function uw(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Qt(e,t,n,r){return new uw(e,t,n,r)}function nd(e){return e=e.prototype,!(!e||!e.isReactComponent)}function cw(e){if(typeof e=="function")return nd(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Ic)return 11;if(e===Sc)return 14}return 2}function br(e,t){var n=e.alternate;return n===null?(n=Qt(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function es(e,t,n,r,i,a){var l=2;if(r=e,typeof e=="function")nd(e)&&(l=1);else if(typeof e=="string")l=5;else e:switch(e){case di:return Hr(n.children,i,a,t);case bc:l=8,i|=8;break;case ku:return e=Qt(12,n,t,i|2),e.elementType=ku,e.lanes=a,e;case Au:return e=Qt(13,n,t,i),e.elementType=Au,e.lanes=a,e;case Nu:return e=Qt(19,n,t,i),e.elementType=Nu,e.lanes=a,e;case Th:return Rs(n,i,a,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Mh:l=10;break e;case Ph:l=9;break e;case Ic:l=11;break e;case Sc:l=14;break e;case sr:l=16,r=null;break e}throw Error(O(130,e==null?e:typeof e,""))}return t=Qt(l,n,t,i),t.elementType=e,t.type=r,t.lanes=a,t}function Hr(e,t,n,r){return e=Qt(7,e,r,t),e.lanes=n,e}function Rs(e,t,n,r){return e=Qt(22,e,r,t),e.elementType=Th,e.lanes=n,e.stateNode={isHidden:!1},e}function wu(e,t,n){return e=Qt(6,e,null,t),e.lanes=n,e}function xu(e,t,n){return t=Qt(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function dw(e,t,n,r,i){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=su(0),this.expirationTimes=su(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=su(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function rd(e,t,n,r,i,a,l,u,d){return e=new dw(e,t,n,u,d),t===1?(t=1,a===!0&&(t|=8)):t=0,a=Qt(3,null,null,t),e.current=a,a.stateNode=e,a.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Lc(a),e}function fw(e,t,n){var r=3{"use strict";function Ag(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__=="undefined"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Ag)}catch(e){console.error(e)}}Ag(),Ng.exports=kg()});var Ws=K(sd=>{"use strict";var Mg=Ls();sd.createRoot=Mg.createRoot,sd.hydrateRoot=Mg.hydrateRoot;var IE});var zg=K(cd=>{"use strict";Object.defineProperty(cd,"__esModule",{value:!0});function ww(e){if(e.sheet)return e.sheet;for(var t=0;t{"use strict";Hg.exports=zg()});var jg=K((Qs,Xg)=>{(function(e,t){typeof Qs=="object"&&typeof Xg!="undefined"?t(Qs):typeof define=="function"&&define.amd?define(["exports"],t):(e=e||self,t(e.stylis={}))})(Qs,function(e){"use strict";var t="-ms-",n="-moz-",r="-webkit-",i="comm",a="rule",l="decl",u="@page",d="@media",h="@import",m="@charset",C="@viewport",S="@supports",x="@document",w="@namespace",k="@keyframes",N="@font-face",v="@counter-style",g="@font-feature-values",I=Math.abs,E=String.fromCharCode,P=Object.assign;function M(y,B){return(((B<<2^z(y,0))<<2^z(y,1))<<2^z(y,2))<<2^z(y,3)}function F(y){return y.trim()}function T(y,B){return(y=B.exec(y))?y[0]:y}function D(y,B,j){return y.replace(B,j)}function L(y,B){return y.indexOf(B)}function z(y,B){return y.charCodeAt(B)|0}function ae(y,B,j){return y.slice(B,j)}function q(y){return y.length}function se(y){return y.length}function $(y,B){return B.push(y),y}function Be(y,B){return y.map(B).join("")}e.line=1,e.column=1,e.length=0,e.position=0,e.character=0,e.characters="";function _e(y,B,j,J,ne,_t,Me){return{value:y,root:B,parent:j,type:J,props:ne,children:_t,line:e.line,column:e.column,length:Me,return:""}}function me(y,B){return P(_e("",null,null,"",null,null,0),y,{length:-y.length},B)}function yt(){return e.character}function rt(){return e.character=e.position>0?z(e.characters,--e.position):0,e.column--,e.character===10&&(e.column=1,e.line--),e.character}function Ie(){return e.character=e.position2||ot(e.character)>3?"":" "}function Nr(y){for(;Ie();)switch(ot(e.character)){case 0:$(Tr(e.position-1),y);break;case 2:$(Ot(e.character),y);break;default:$(E(e.character),y)}return y}function Mr(y,B){for(;--B&&Ie()&&!(e.character<48||e.character>102||e.character>57&&e.character<65||e.character>70&&e.character<97););return it(y,G()+(B<6&&ie()==32&&Ie()==32))}function tr(y){for(;Ie();)switch(e.character){case y:return e.position;case 34:case 39:y!==34&&y!==39&&tr(e.character);break;case 40:y===41&&tr(y);break;case 92:Ie();break}return e.position}function Pr(y,B){for(;Ie()&&y+e.character!==47+10;)if(y+e.character===42+42&&ie()===47)break;return"/*"+it(B,e.position-1)+"*"+E(y===47?y:Ie())}function Tr(y){for(;!ot(ie());)Ie();return it(y,e.position)}function wl(y){return Ke(Fr("",null,null,null,[""],y=Le(y),0,[0],y))}function Fr(y,B,j,J,ne,_t,Me,st,Fn){for(var tn=0,ee=0,qe=Me,On=0,nn=0,Rt=0,lt=1,rn=1,ut=1,ct=0,Dt="",ti=ne,Gt=_t,Ct=J,R=Dt;rn;)switch(Rt=ct,ct=Ie()){case 40:if(Rt!=108&&R.charCodeAt(qe-1)==58){L(R+=D(Ot(ct),"&","&\f"),"&\f")!=-1&&(ut=-1);break}case 34:case 39:case 91:R+=Ot(ct);break;case 9:case 10:case 13:case 32:R+=qr(Rt);break;case 92:R+=Mr(G()-1,7);continue;case 47:switch(ie()){case 42:case 47:$(We(Pr(Ie(),G()),B,j),Fn);break;default:R+="/"}break;case 123*lt:st[tn++]=q(R)*ut;case 125*lt:case 59:case 0:switch(ct){case 0:case 125:rn=0;case 59+ee:nn>0&&q(R)-qe&&$(nn>32?at(R+";",J,j,qe-1):at(D(R," ","")+";",J,j,qe-2),Fn);break;case 59:R+=";";default:if($(Ct=Pn(R,B,j,tn,ee,ne,st,Dt,ti=[],Gt=[],qe),_t),ct===123)if(ee===0)Fr(R,B,Ct,Ct,ti,_t,qe,st,Gt);else switch(On){case 100:case 109:case 115:Fr(y,Ct,Ct,J&&$(Pn(y,Ct,Ct,0,0,ne,st,Dt,ne,ti=[],qe),Gt),ne,Gt,qe,st,J?ti:Gt);break;default:Fr(R,Ct,Ct,Ct,[""],Gt,0,st,Gt)}}tn=ee=nn=0,lt=ut=1,Dt=R="",qe=Me;break;case 58:qe=1+q(R),nn=Rt;default:if(lt<1){if(ct==123)--lt;else if(ct==125&<++==0&&rt()==125)continue}switch(R+=E(ct),ct*lt){case 38:ut=ee>0?1:(R+="\f",-1);break;case 44:st[tn++]=(q(R)-1)*ut,ut=1;break;case 64:ie()===45&&(R+=Ot(Ie())),On=ie(),ee=qe=q(Dt=R+=Tr(G())),ct++;break;case 45:Rt===45&&q(R)==2&&(lt=0)}}return _t}function Pn(y,B,j,J,ne,_t,Me,st,Fn,tn,ee){for(var qe=ne-1,On=ne===0?_t:[""],nn=se(On),Rt=0,lt=0,rn=0;Rt0?On[ut]+" "+ct:D(ct,/&\f/g,On[ut])))&&(Fn[rn++]=Dt);return _e(y,B,j,ne===0?a:st,Fn,tn,ee)}function We(y,B,j){return _e(y,B,j,i,E(yt()),ae(y,2,-2),0)}function at(y,B,j,J){return _e(y,B,j,l,ae(y,0,J),ae(y,J+1,-1),J)}function Or(y,B){switch(M(y,B)){case 5103:return r+"print-"+y+y;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return r+y+y;case 5349:case 4246:case 4810:case 6968:case 2756:return r+y+n+y+t+y+y;case 6828:case 4268:return r+y+t+y+y;case 6165:return r+y+t+"flex-"+y+y;case 5187:return r+y+D(y,/(\w+).+(:[^]+)/,r+"box-$1$2"+t+"flex-$1$2")+y;case 5443:return r+y+t+"flex-item-"+D(y,/flex-|-self/,"")+y;case 4675:return r+y+t+"flex-line-pack"+D(y,/align-content|flex-|-self/,"")+y;case 5548:return r+y+t+D(y,"shrink","negative")+y;case 5292:return r+y+t+D(y,"basis","preferred-size")+y;case 6060:return r+"box-"+D(y,"-grow","")+r+y+t+D(y,"grow","positive")+y;case 4554:return r+D(y,/([^-])(transform)/g,"$1"+r+"$2")+y;case 6187:return D(D(D(y,/(zoom-|grab)/,r+"$1"),/(image-set)/,r+"$1"),y,"")+y;case 5495:case 3959:return D(y,/(image-set\([^]*)/,r+"$1$`$1");case 4968:return D(D(y,/(.+:)(flex-)?(.*)/,r+"box-pack:$3"+t+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+r+y+y;case 4095:case 3583:case 4068:case 2532:return D(y,/(.+)-inline(.+)/,r+"$1$2")+y;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(q(y)-1-B>6)switch(z(y,B+1)){case 109:if(z(y,B+4)!==45)break;case 102:return D(y,/(.+:)(.+)-([^]+)/,"$1"+r+"$2-$3$1"+n+(z(y,B+3)==108?"$3":"$2-$3"))+y;case 115:return~L(y,"stretch")?Or(D(y,"stretch","fill-available"),B)+y:y}break;case 4949:if(z(y,B+1)!==115)break;case 6444:switch(z(y,q(y)-3-(~L(y,"!important")&&10))){case 107:return D(y,":",":"+r)+y;case 101:return D(y,/(.+:)([^;!]+)(;|!.+)?/,"$1"+r+(z(y,14)===45?"inline-":"")+"box$3$1"+r+"$2$3$1"+t+"$2box$3")+y}break;case 5936:switch(z(y,B+11)){case 114:return r+y+t+D(y,/[svh]\w+-[tblr]{2}/,"tb")+y;case 108:return r+y+t+D(y,/[svh]\w+-[tblr]{2}/,"tb-rl")+y;case 45:return r+y+t+D(y,/[svh]\w+-[tblr]{2}/,"lr")+y}return r+y+t+y+y}return y}function Tn(y,B){for(var j="",J=se(y),ne=0;ne-1&&!y.return)switch(y.type){case l:y.return=Or(y.value,y.length);break;case k:return Tn([me(y,{value:D(y.value,"@","@"+r)})],J);case a:if(y.length)return Be(y.props,function(ne){switch(T(ne,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return Tn([me(y,{props:[D(ne,/:(read-\w+)/,":"+n+"$1")]})],J);case"::placeholder":return Tn([me(y,{props:[D(ne,/:(plac\w+)/,":"+r+"input-$1")]}),me(y,{props:[D(ne,/:(plac\w+)/,":"+n+"$1")]}),me(y,{props:[D(ne,/:(plac\w+)/,t+"input-$1")]})],J)}return""})}}function Z(y){switch(y.type){case a:y.props=y.props.map(function(B){return Be(Mn(B),function(j,J,ne){switch(z(j,0)){case 12:return ae(j,1,q(j));case 0:case 40:case 43:case 62:case 126:return j;case 58:ne[++J]==="global"&&(ne[J]="",ne[++J]="\f"+ae(ne[J],J=1,-1));case 32:return J===1?"":j;default:switch(J){case 0:return y=j,se(ne)>1?"":j;case(J=se(ne)-1):case 2:return J===2?j+y+y:j+y;default:return j}}})})}}e.CHARSET=m,e.COMMENT=i,e.COUNTER_STYLE=v,e.DECLARATION=l,e.DOCUMENT=x,e.FONT_FACE=N,e.FONT_FEATURE_VALUES=g,e.IMPORT=h,e.KEYFRAMES=k,e.MEDIA=d,e.MOZ=n,e.MS=t,e.NAMESPACE=w,e.PAGE=u,e.RULESET=a,e.SUPPORTS=S,e.VIEWPORT=C,e.WEBKIT=r,e.abs=I,e.alloc=Le,e.append=$,e.assign=P,e.caret=G,e.char=yt,e.charat=z,e.combine=Be,e.comment=We,e.commenter=Pr,e.compile=wl,e.copy=me,e.dealloc=Ke,e.declaration=at,e.delimit=Ot,e.delimiter=tr,e.escaping=Mr,e.from=E,e.hash=M,e.identifier=Tr,e.indexof=L,e.match=T,e.middleware=xl,e.namespace=Z,e.next=Ie,e.node=_e,e.parse=Fr,e.peek=ie,e.prefix=Or,e.prefixer=kt,e.prev=rt,e.replace=D,e.ruleset=Pn,e.rulesheet=ei,e.serialize=Tn,e.sizeof=se,e.slice=it,e.stringify=je,e.strlen=q,e.substr=ae,e.token=ot,e.tokenize=Mn,e.tokenizer=Nr,e.trim=F,e.whitespace=qr,Object.defineProperty(e,"__esModule",{value:!0})})});var Ug=K(dd=>{"use strict";Object.defineProperty(dd,"__esModule",{value:!0});var kw=function(t){var n=new WeakMap;return function(r){if(n.has(r))return n.get(r);var i=t(r);return n.set(r,i),i}};dd.default=kw});var $s=K((UE,Jg)=>{"use strict";Jg.exports=Ug()});var Qg=K(fd=>{"use strict";Object.defineProperty(fd,"__esModule",{value:!0});function Aw(e){var t=Object.create(null);return function(n){return t[n]===void 0&&(t[n]=e(n)),t[n]}}fd.default=Aw});var pd=K((QE,$g)=>{"use strict";$g.exports=Qg()});var ev=K(hd=>{"use strict";Object.defineProperty(hd,"__esModule",{value:!0});var Nw=Zg(),Ne=jg(),Mw=$s(),Pw=pd();function qg(e){return e&&e.__esModule?e:{default:e}}var Tw=qg(Mw),Fw=qg(Pw),Ow=function(t,n,r){for(var i=0,a=0;i=a,a=Ne.peek(),i===38&&a===12&&(n[r]=1),!Ne.token(a);)Ne.next();return Ne.slice(t,Ne.position)},_w=function(t,n){var r=-1,i=44;do switch(Ne.token(i)){case 0:i===38&&Ne.peek()===12&&(n[r]=1),t[r]+=Ow(Ne.position-1,n,r);break;case 2:t[r]+=Ne.delimit(i);break;case 4:if(i===44){t[++r]=Ne.peek()===58?"&\f":"",n[r]=t[r].length;break}default:t[r]+=Ne.from(i)}while(i=Ne.next());return t},Rw=function(t,n){return Ne.dealloc(_w(Ne.alloc(t),n))},Kg=new WeakMap,Dw=function(t){if(!(t.type!=="rule"||!t.parent||t.length<1)){for(var n=t.value,r=t.parent,i=t.column===r.column&&t.line===r.line;r.type!=="rule";)if(r=r.parent,!r)return;if(!(t.props.length===1&&n.charCodeAt(0)!==58&&!Kg.get(r))&&!i){Kg.set(t,!0);for(var a=[],l=Rw(n,a),u=r.props,d=0,h=0;d{"use strict";tv.exports=ev()});var vd=K((qE,qn)=>{function gd(){return qn.exports=gd=Object.assign?Object.assign.bind():function(e){for(var t=1;t{"use strict";var Qe=typeof Symbol=="function"&&Symbol.for,yd=Qe?Symbol.for("react.element"):60103,Cd=Qe?Symbol.for("react.portal"):60106,qs=Qe?Symbol.for("react.fragment"):60107,el=Qe?Symbol.for("react.strict_mode"):60108,tl=Qe?Symbol.for("react.profiler"):60114,nl=Qe?Symbol.for("react.provider"):60109,rl=Qe?Symbol.for("react.context"):60110,bd=Qe?Symbol.for("react.async_mode"):60111,il=Qe?Symbol.for("react.concurrent_mode"):60111,ol=Qe?Symbol.for("react.forward_ref"):60112,al=Qe?Symbol.for("react.suspense"):60113,Ww=Qe?Symbol.for("react.suspense_list"):60120,sl=Qe?Symbol.for("react.memo"):60115,ll=Qe?Symbol.for("react.lazy"):60116,Yw=Qe?Symbol.for("react.block"):60121,zw=Qe?Symbol.for("react.fundamental"):60117,Hw=Qe?Symbol.for("react.responder"):60118,Zw=Qe?Symbol.for("react.scope"):60119;function Zt(e){if(typeof e=="object"&&e!==null){var t=e.$$typeof;switch(t){case yd:switch(e=e.type,e){case bd:case il:case qs:case tl:case el:case al:return e;default:switch(e=e&&e.$$typeof,e){case rl:case ol:case ll:case sl:case nl:return e;default:return t}}case Cd:return t}}}function nv(e){return Zt(e)===il}pe.AsyncMode=bd;pe.ConcurrentMode=il;pe.ContextConsumer=rl;pe.ContextProvider=nl;pe.Element=yd;pe.ForwardRef=ol;pe.Fragment=qs;pe.Lazy=ll;pe.Memo=sl;pe.Portal=Cd;pe.Profiler=tl;pe.StrictMode=el;pe.Suspense=al;pe.isAsyncMode=function(e){return nv(e)||Zt(e)===bd};pe.isConcurrentMode=nv;pe.isContextConsumer=function(e){return Zt(e)===rl};pe.isContextProvider=function(e){return Zt(e)===nl};pe.isElement=function(e){return typeof e=="object"&&e!==null&&e.$$typeof===yd};pe.isForwardRef=function(e){return Zt(e)===ol};pe.isFragment=function(e){return Zt(e)===qs};pe.isLazy=function(e){return Zt(e)===ll};pe.isMemo=function(e){return Zt(e)===sl};pe.isPortal=function(e){return Zt(e)===Cd};pe.isProfiler=function(e){return Zt(e)===tl};pe.isStrictMode=function(e){return Zt(e)===el};pe.isSuspense=function(e){return Zt(e)===al};pe.isValidElementType=function(e){return typeof e=="string"||typeof e=="function"||e===qs||e===il||e===tl||e===el||e===al||e===Ww||typeof e=="object"&&e!==null&&(e.$$typeof===ll||e.$$typeof===sl||e.$$typeof===nl||e.$$typeof===rl||e.$$typeof===ol||e.$$typeof===zw||e.$$typeof===Hw||e.$$typeof===Zw||e.$$typeof===Yw)};pe.typeOf=Zt});var ov=K((tk,iv)=>{"use strict";iv.exports=rv()});var wd=K((nk,dv)=>{"use strict";var Id=ov(),Xw={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},jw={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},Uw={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},uv={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},Sd={};Sd[Id.ForwardRef]=Uw;Sd[Id.Memo]=uv;function av(e){return Id.isMemo(e)?uv:Sd[e.$$typeof]||Xw}var Jw=Object.defineProperty,Qw=Object.getOwnPropertyNames,sv=Object.getOwnPropertySymbols,$w=Object.getOwnPropertyDescriptor,Kw=Object.getPrototypeOf,lv=Object.prototype;function cv(e,t,n){if(typeof t!="string"){if(lv){var r=Kw(t);r&&r!==lv&&cv(e,r,n)}var i=Qw(t);sv&&(i=i.concat(sv(t)));for(var a=av(e),l=av(t),u=0;u{"use strict";Object.defineProperty(xd,"__esModule",{value:!0});var qw=wd();function ex(e){return e&&e.__esModule?e:{default:e}}var tx=ex(qw),nx=function(e,t){return tx.default(e,t)};xd.default=nx});var pv=K(jo=>{"use strict";Object.defineProperty(jo,"__esModule",{value:!0});var kd=typeof document!="undefined";function rx(e,t,n){var r="";return n.split(" ").forEach(function(i){e[i]!==void 0?t.push(e[i]+";"):r+=i+" "}),r}var fv=function(t,n,r){var i=t.key+"-"+n.name;(r===!1||kd===!1&&t.compat!==void 0)&&t.registered[i]===void 0&&(t.registered[i]=n.styles)},ix=function(t,n,r){fv(t,n,r);var i=t.key+"-"+n.name;if(t.inserted[n.name]===void 0){var a="",l=n;do{var u=t.insert(n===l?"."+i:"",l,t.sheet,!0);!kd&&u!==void 0&&(a+=u),l=l.next}while(l!==void 0);if(!kd&&a.length!==0)return a}};jo.getRegisteredStyles=rx;jo.insertStyles=ix;jo.registerStyles=fv});var Ad=K((ok,hv)=>{"use strict";hv.exports=pv()});var mv=K(Nd=>{"use strict";Object.defineProperty(Nd,"__esModule",{value:!0});function ox(e){for(var t=0,n,r=0,i=e.length;i>=4;++r,i-=4)n=e.charCodeAt(r)&255|(e.charCodeAt(++r)&255)<<8|(e.charCodeAt(++r)&255)<<16|(e.charCodeAt(++r)&255)<<24,n=(n&65535)*1540483477+((n>>>16)*59797<<16),n^=n>>>24,t=(n&65535)*1540483477+((n>>>16)*59797<<16)^(t&65535)*1540483477+((t>>>16)*59797<<16);switch(i){case 3:t^=(e.charCodeAt(r+2)&255)<<16;case 2:t^=(e.charCodeAt(r+1)&255)<<8;case 1:t^=e.charCodeAt(r)&255,t=(t&65535)*1540483477+((t>>>16)*59797<<16)}return t^=t>>>13,t=(t&65535)*1540483477+((t>>>16)*59797<<16),((t^t>>>15)>>>0).toString(36)}Nd.default=ox});var vv=K((sk,gv)=>{"use strict";gv.exports=mv()});var yv=K(Md=>{"use strict";Object.defineProperty(Md,"__esModule",{value:!0});var ax={animationIterationCount:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1};Md.default=ax});var bv=K((uk,Cv)=>{"use strict";Cv.exports=yv()});var Ev=K(Fd=>{"use strict";Object.defineProperty(Fd,"__esModule",{value:!0});var sx=vv(),lx=bv(),ux=pd();function Td(e){return e&&e.__esModule?e:{default:e}}var cx=Td(sx),dx=Td(lx),fx=Td(ux),px=/[A-Z]|^ms/g,hx=/_EMO_([^_]+?)_([^]*?)_EMO_/g,xv=function(t){return t.charCodeAt(1)===45},Iv=function(t){return t!=null&&typeof t!="boolean"},Pd=fx.default(function(e){return xv(e)?e:e.replace(px,"-$&").toLowerCase()}),Sv=function(t,n){switch(t){case"animation":case"animationName":if(typeof n=="string")return n.replace(hx,function(r,i,a){return kn={name:i,styles:a,next:kn},i})}return dx.default[t]!==1&&!xv(t)&&typeof n=="number"&&n!==0?n+"px":n};function Uo(e,t,n){if(n==null)return"";if(n.__emotion_styles!==void 0)return n;switch(typeof n){case"boolean":return"";case"object":{if(n.anim===1)return kn={name:n.name,styles:n.styles,next:kn},n.name;if(n.styles!==void 0){var r=n.next;if(r!==void 0)for(;r!==void 0;)kn={name:r.name,styles:r.styles,next:kn},r=r.next;var i=n.styles+";";return i}return mx(e,t,n)}case"function":{if(e!==void 0){var a=kn,l=n(e);return kn=a,Uo(e,t,l)}break}}if(t==null)return n;var u=t[n];return u!==void 0?u:n}function mx(e,t,n){var r="";if(Array.isArray(n))for(var i=0;i{"use strict";kv.exports=Ev()});var Tv=K(ul=>{"use strict";Object.defineProperty(ul,"__esModule",{value:!0});var Mv=De();function vx(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach(function(n){if(n!=="default"){var r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:function(){return e[n]}})}}),t.default=e,Object.freeze(t)}var Av=vx(Mv),yx=typeof document!="undefined",Nv=function(t){return t()},Pv=Av["useInsertionEffect"]?Av["useInsertionEffect"]:!1,Cx=yx&&Pv||Nv,bx=Pv||Mv.useLayoutEffect;ul.useInsertionEffectAlwaysWithSyncFallback=Cx;ul.useInsertionEffectWithLayoutFallback=bx});var _d=K((pk,Fv)=>{"use strict";Fv.exports=Tv()});var Gv=K(Ft=>{"use strict";var Ze=De(),Ix=md(),_v=vd(),Sx=$s(),wx=Ed(),Rd=Ad(),xx=Od(),Ex=_d();function Rv(e){return e&&e.__esModule?e:{default:e}}var Dv=Rv(Ix),Ov=Rv(Sx),Gd=typeof document!="undefined",Vd={}.hasOwnProperty,Jo=Ze.createContext(typeof HTMLElement!="undefined"?Dv.default({key:"css"}):null),kx=Jo.Provider,Ax=function(){return Ze.useContext(Jo)};Ft.withEmotionCache=function(t){return Ze.forwardRef(function(n,r){var i=Ze.useContext(Jo);return t(n,i,r)})};Gd||(Ft.withEmotionCache=function(t){return function(n){var r=Ze.useContext(Jo);return r===null?(r=Dv.default({key:"css"}),Ze.createElement(Jo.Provider,{value:r},t(n,r))):t(n,r)}});var Gi=Ze.createContext({}),Nx=function(){return Ze.useContext(Gi)},Mx=function(t,n){if(typeof n=="function"){var r=n(t);return r}return _v({},t,n)},Px=Ov.default(function(e){return Ov.default(function(t){return Mx(e,t)})}),Tx=function(t){var n=Ze.useContext(Gi);return t.theme!==n&&(n=Px(n)(t.theme)),Ze.createElement(Gi.Provider,{value:n},t.children)};function Fx(e){var t=e.displayName||e.name||"Component",n=function(a,l){var u=Ze.useContext(Gi);return Ze.createElement(e,_v({theme:u,ref:l},a))},r=Ze.forwardRef(n);return r.displayName="WithTheme("+t+")",wx.default(r,e)}var Dd="__EMOTION_TYPE_PLEASE_DO_NOT_USE__",Ox=function(t,n){var r={};for(var i in n)Vd.call(n,i)&&(r[i]=n[i]);return r[Dd]=t,r},_x=function(t){var n=t.cache,r=t.serialized,i=t.isStringTag;Rd.registerStyles(n,r,i);var a=Ex.useInsertionEffectAlwaysWithSyncFallback(function(){return Rd.insertStyles(n,r,i)});if(!Gd&&a!==void 0){for(var l,u=r.name,d=r.next;d!==void 0;)u+=" "+d.name,d=d.next;return Ze.createElement("style",(l={},l["data-emotion"]=n.key+" "+u,l.dangerouslySetInnerHTML={__html:a},l.nonce=n.sheet.nonce,l))}return null},Rx=Ft.withEmotionCache(function(e,t,n){var r=e.css;typeof r=="string"&&t.registered[r]!==void 0&&(r=t.registered[r]);var i=e[Dd],a=[r],l="";typeof e.className=="string"?l=Rd.getRegisteredStyles(t.registered,a,e.className):e.className!=null&&(l=e.className+" ");var u=xx.serializeStyles(a,void 0,Ze.useContext(Gi));l+=t.key+"-"+u.name;var d={};for(var h in e)Vd.call(e,h)&&h!=="css"&&h!==Dd&&(d[h]=e[h]);return d.ref=n,d.className=l,Ze.createElement(Ze.Fragment,null,Ze.createElement(_x,{cache:t,serialized:u,isStringTag:typeof i=="string"}),Ze.createElement(i,d))});Ft.CacheProvider=kx;Ft.Emotion=Rx;Ft.ThemeContext=Gi;Ft.ThemeProvider=Tx;Ft.__unsafe_useEmotionCache=Ax;Ft.createEmotionProps=Ox;Ft.hasOwnProperty=Vd;Ft.isBrowser=Gd;Ft.useTheme=Nx;Ft.withTheme=Fx});var Lv=K(Et=>{"use strict";Object.defineProperty(Et,"__esModule",{value:!0});var An=De();md();var $e=Gv();vd();$s();wd();Ed();var cl=Ad(),Ld=Od(),Bd=_d(),Vv=function(t,n){var r=arguments;if(n==null||!$e.hasOwnProperty.call(n,"css"))return An.createElement.apply(void 0,r);var i=r.length,a=new Array(i);a[0]=$e.Emotion,a[1]=$e.createEmotionProps(t,n);for(var l=2;l{"use strict";Wv.exports=Lv()});var fy=K((uf,Hi)=>{(function(e,t){typeof uf=="object"&&typeof Hi!="undefined"?Hi.exports=t():typeof define=="function"&&define.amd?define(t):e.moment=t()})(uf,function(){"use strict";var e;function t(){return e.apply(null,arguments)}function n(o){e=o}function r(o){return o instanceof Array||Object.prototype.toString.call(o)==="[object Array]"}function i(o){return o!=null&&Object.prototype.toString.call(o)==="[object Object]"}function a(o,s){return Object.prototype.hasOwnProperty.call(o,s)}function l(o){if(Object.getOwnPropertyNames)return Object.getOwnPropertyNames(o).length===0;var s;for(s in o)if(a(o,s))return!1;return!0}function u(o){return o===void 0}function d(o){return typeof o=="number"||Object.prototype.toString.call(o)==="[object Number]"}function h(o){return o instanceof Date||Object.prototype.toString.call(o)==="[object Date]"}function m(o,s){var c=[],f,p=o.length;for(f=0;f>>0,f;for(f=0;f0)for(c=0;c=0;return(b?c?"+":"":"-")+Math.pow(10,Math.max(0,p)).toString().substr(1)+f}var yt=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,rt=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,Ie={},ie={};function G(o,s,c,f){var p=f;typeof f=="string"&&(p=function(){return this[f]()}),o&&(ie[o]=p),s&&(ie[s[0]]=function(){return me(p.apply(this,arguments),s[1],s[2])}),c&&(ie[c]=function(){return this.localeData().ordinal(p.apply(this,arguments),o)})}function it(o){return o.match(/\[[\s\S]/)?o.replace(/^\[|\]$/g,""):o.replace(/\\/g,"")}function ot(o){var s=o.match(yt),c,f;for(c=0,f=s.length;c=0&&rt.test(o);)o=o.replace(rt,f),rt.lastIndex=0,c-=1;return o}var Ot={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"};function Mn(o){var s=this._longDateFormat[o],c=this._longDateFormat[o.toUpperCase()];return s||!c?s:(this._longDateFormat[o]=c.match(yt).map(function(f){return f==="MMMM"||f==="MM"||f==="DD"||f==="dddd"?f.slice(1):f}).join(""),this._longDateFormat[o])}var qr="Invalid date";function Nr(){return this._invalidDate}var Mr="%d",tr=/\d{1,2}/;function Pr(o){return this._ordinal.replace("%d",o)}var Tr={future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",w:"a week",ww:"%d weeks",M:"a month",MM:"%d months",y:"a year",yy:"%d years"};function wl(o,s,c,f){var p=this._relativeTime[c];return z(p)?p(o,s,c,f):p.replace(/%d/i,o)}function Fr(o,s){var c=this._relativeTime[o>0?"future":"past"];return z(c)?c(s):c.replace(/%s/i,s)}var Pn={};function We(o,s){var c=o.toLowerCase();Pn[c]=Pn[c+"s"]=Pn[s]=o}function at(o){return typeof o=="string"?Pn[o]||Pn[o.toLowerCase()]:void 0}function Or(o){var s={},c,f;for(f in o)a(o,f)&&(c=at(f),c&&(s[c]=o[f]));return s}var Tn={};function je(o,s){Tn[o]=s}function xl(o){var s=[],c;for(c in o)a(o,c)&&s.push({unit:c,priority:Tn[c]});return s.sort(function(f,p){return f.priority-p.priority}),s}function ei(o){return o%4===0&&o%100!==0||o%400===0}function kt(o){return o<0?Math.ceil(o)||0:Math.floor(o)}function Z(o){var s=+o,c=0;return s!==0&&isFinite(s)&&(c=kt(s)),c}function y(o,s){return function(c){return c!=null?(j(this,o,c),t.updateOffset(this,s),this):B(this,o)}}function B(o,s){return o.isValid()?o._d["get"+(o._isUTC?"UTC":"")+s]():NaN}function j(o,s,c){o.isValid()&&!isNaN(c)&&(s==="FullYear"&&ei(o.year())&&o.month()===1&&o.date()===29?(c=Z(c),o._d["set"+(o._isUTC?"UTC":"")+s](c,o.month(),aa(c,o.month()))):o._d["set"+(o._isUTC?"UTC":"")+s](c))}function J(o){return o=at(o),z(this[o])?this[o]():this}function ne(o,s){if(typeof o=="object"){o=Or(o);var c=xl(o),f,p=c.length;for(f=0;f68?1900:2e3)};var mf=y("FullYear",!0);function Py(){return ei(this.year())}function Ty(o,s,c,f,p,b,A){var W;return o<100&&o>=0?(W=new Date(o+400,s,c,f,p,b,A),isFinite(W.getFullYear())&&W.setFullYear(o)):W=new Date(o,s,c,f,p,b,A),W}function ji(o){var s,c;return o<100&&o>=0?(c=Array.prototype.slice.call(arguments),c[0]=o+400,s=new Date(Date.UTC.apply(null,c)),isFinite(s.getUTCFullYear())&&s.setUTCFullYear(o)):s=new Date(Date.UTC.apply(null,arguments)),s}function sa(o,s,c){var f=7+s-c,p=(7+ji(o,0,f).getUTCDay()-s)%7;return-p+f-1}function gf(o,s,c,f,p){var b=(7+c-f)%7,A=sa(o,f,p),W=1+7*(s-1)+b+A,X,ve;return W<=0?(X=o-1,ve=Xi(X)+W):W>Xi(o)?(X=o+1,ve=W-Xi(o)):(X=o,ve=W),{year:X,dayOfYear:ve}}function Ui(o,s,c){var f=sa(o.year(),s,c),p=Math.floor((o.dayOfYear()-f-1)/7)+1,b,A;return p<1?(A=o.year()-1,b=p+Dn(A,s,c)):p>Dn(o.year(),s,c)?(b=p-Dn(o.year(),s,c),A=o.year()+1):(A=o.year(),b=p),{week:b,year:A}}function Dn(o,s,c){var f=sa(o,s,c),p=sa(o+1,s,c);return(Xi(o)-f+p)/7}G("w",["ww",2],"wo","week"),G("W",["WW",2],"Wo","isoWeek"),We("week","w"),We("isoWeek","W"),je("week",5),je("isoWeek",5),R("w",ee),R("ww",ee,Me),R("W",ee),R("WW",ee,Me),Zi(["w","ww","W","WW"],function(o,s,c,f){s[f.substr(0,1)]=Z(o)});function Fy(o){return Ui(o,this._week.dow,this._week.doy).week}var Oy={dow:0,doy:6};function _y(){return this._week.dow}function Ry(){return this._week.doy}function Dy(o){var s=this.localeData().week(this);return o==null?s:this.add((o-s)*7,"d")}function Gy(o){var s=Ui(this,1,4).week;return o==null?s:this.add((o-s)*7,"d")}G("d",0,"do","day"),G("dd",0,0,function(o){return this.localeData().weekdaysMin(this,o)}),G("ddd",0,0,function(o){return this.localeData().weekdaysShort(this,o)}),G("dddd",0,0,function(o){return this.localeData().weekdays(this,o)}),G("e",0,0,"weekday"),G("E",0,0,"isoWeekday"),We("day","d"),We("weekday","e"),We("isoWeekday","E"),je("day",11),je("weekday",11),je("isoWeekday",11),R("d",ee),R("e",ee),R("E",ee),R("dd",function(o,s){return s.weekdaysMinRegex(o)}),R("ddd",function(o,s){return s.weekdaysShortRegex(o)}),R("dddd",function(o,s){return s.weekdaysRegex(o)}),Zi(["dd","ddd","dddd"],function(o,s,c,f){var p=c._locale.weekdaysParse(o,f,c._strict);p!=null?s.d=p:w(c).invalidWeekday=o}),Zi(["d","e","E"],function(o,s,c,f){s[f]=Z(o)});function Vy(o,s){return typeof o!="string"?o:isNaN(o)?(o=s.weekdaysParse(o),typeof o=="number"?o:null):parseInt(o,10)}function By(o,s){return typeof o=="string"?s.weekdaysParse(o)%7||7:isNaN(o)?null:o}function kl(o,s){return o.slice(s,7).concat(o.slice(0,s))}var Ly="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),vf="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),Wy="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),Yy=Gt,zy=Gt,Hy=Gt;function Zy(o,s){var c=r(this._weekdays)?this._weekdays:this._weekdays[o&&o!==!0&&this._weekdays.isFormat.test(s)?"format":"standalone"];return o===!0?kl(c,this._week.dow):o?c[o.day()]:c}function Xy(o){return o===!0?kl(this._weekdaysShort,this._week.dow):o?this._weekdaysShort[o.day()]:this._weekdaysShort}function jy(o){return o===!0?kl(this._weekdaysMin,this._week.dow):o?this._weekdaysMin[o.day()]:this._weekdaysMin}function Uy(o,s,c){var f,p,b,A=o.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],f=0;f<7;++f)b=S([2e3,1]).day(f),this._minWeekdaysParse[f]=this.weekdaysMin(b,"").toLocaleLowerCase(),this._shortWeekdaysParse[f]=this.weekdaysShort(b,"").toLocaleLowerCase(),this._weekdaysParse[f]=this.weekdays(b,"").toLocaleLowerCase();return c?s==="dddd"?(p=Re.call(this._weekdaysParse,A),p!==-1?p:null):s==="ddd"?(p=Re.call(this._shortWeekdaysParse,A),p!==-1?p:null):(p=Re.call(this._minWeekdaysParse,A),p!==-1?p:null):s==="dddd"?(p=Re.call(this._weekdaysParse,A),p!==-1||(p=Re.call(this._shortWeekdaysParse,A),p!==-1)?p:(p=Re.call(this._minWeekdaysParse,A),p!==-1?p:null)):s==="ddd"?(p=Re.call(this._shortWeekdaysParse,A),p!==-1||(p=Re.call(this._weekdaysParse,A),p!==-1)?p:(p=Re.call(this._minWeekdaysParse,A),p!==-1?p:null)):(p=Re.call(this._minWeekdaysParse,A),p!==-1||(p=Re.call(this._weekdaysParse,A),p!==-1)?p:(p=Re.call(this._shortWeekdaysParse,A),p!==-1?p:null))}function Jy(o,s,c){var f,p,b;if(this._weekdaysParseExact)return Uy.call(this,o,s,c);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),f=0;f<7;f++){if(p=S([2e3,1]).day(f),c&&!this._fullWeekdaysParse[f]&&(this._fullWeekdaysParse[f]=new RegExp("^"+this.weekdays(p,"").replace(".","\\.?")+"$","i"),this._shortWeekdaysParse[f]=new RegExp("^"+this.weekdaysShort(p,"").replace(".","\\.?")+"$","i"),this._minWeekdaysParse[f]=new RegExp("^"+this.weekdaysMin(p,"").replace(".","\\.?")+"$","i")),this._weekdaysParse[f]||(b="^"+this.weekdays(p,"")+"|^"+this.weekdaysShort(p,"")+"|^"+this.weekdaysMin(p,""),this._weekdaysParse[f]=new RegExp(b.replace(".",""),"i")),c&&s==="dddd"&&this._fullWeekdaysParse[f].test(o))return f;if(c&&s==="ddd"&&this._shortWeekdaysParse[f].test(o))return f;if(c&&s==="dd"&&this._minWeekdaysParse[f].test(o))return f;if(!c&&this._weekdaysParse[f].test(o))return f}}function Qy(o){if(!this.isValid())return o!=null?this:NaN;var s=this._isUTC?this._d.getUTCDay():this._d.getDay();return o!=null?(o=Vy(o,this.localeData()),this.add(o-s,"d")):s}function $y(o){if(!this.isValid())return o!=null?this:NaN;var s=(this.day()+7-this.localeData()._week.dow)%7;return o==null?s:this.add(o-s,"d")}function Ky(o){if(!this.isValid())return o!=null?this:NaN;if(o!=null){var s=By(o,this.localeData());return this.day(this.day()%7?s:s-7)}else return this.day()||7}function qy(o){return this._weekdaysParseExact?(a(this,"_weekdaysRegex")||Al.call(this),o?this._weekdaysStrictRegex:this._weekdaysRegex):(a(this,"_weekdaysRegex")||(this._weekdaysRegex=Yy),this._weekdaysStrictRegex&&o?this._weekdaysStrictRegex:this._weekdaysRegex)}function e1(o){return this._weekdaysParseExact?(a(this,"_weekdaysRegex")||Al.call(this),o?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(a(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=zy),this._weekdaysShortStrictRegex&&o?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)}function t1(o){return this._weekdaysParseExact?(a(this,"_weekdaysRegex")||Al.call(this),o?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(a(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=Hy),this._weekdaysMinStrictRegex&&o?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)}function Al(){function o(bt,Wn){return Wn.length-bt.length}var s=[],c=[],f=[],p=[],b,A,W,X,ve;for(b=0;b<7;b++)A=S([2e3,1]).day(b),W=Vt(this.weekdaysMin(A,"")),X=Vt(this.weekdaysShort(A,"")),ve=Vt(this.weekdays(A,"")),s.push(W),c.push(X),f.push(ve),p.push(W),p.push(X),p.push(ve);s.sort(o),c.sort(o),f.sort(o),p.sort(o),this._weekdaysRegex=new RegExp("^("+p.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+f.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+c.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+s.join("|")+")","i")}function Nl(){return this.hours()%12||12}function n1(){return this.hours()||24}G("H",["HH",2],0,"hour"),G("h",["hh",2],0,Nl),G("k",["kk",2],0,n1),G("hmm",0,0,function(){return""+Nl.apply(this)+me(this.minutes(),2)}),G("hmmss",0,0,function(){return""+Nl.apply(this)+me(this.minutes(),2)+me(this.seconds(),2)}),G("Hmm",0,0,function(){return""+this.hours()+me(this.minutes(),2)}),G("Hmmss",0,0,function(){return""+this.hours()+me(this.minutes(),2)+me(this.seconds(),2)});function yf(o,s){G(o,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),s)})}yf("a",!0),yf("A",!1),We("hour","h"),je("hour",13);function Cf(o,s){return s._meridiemParse}R("a",Cf),R("A",Cf),R("H",ee),R("h",ee),R("k",ee),R("HH",ee,Me),R("hh",ee,Me),R("kk",ee,Me),R("hmm",qe),R("hmmss",On),R("Hmm",qe),R("Hmmss",On),ge(["H","HH"],Ye),ge(["k","kk"],function(o,s,c){var f=Z(o);s[Ye]=f===24?0:f}),ge(["a","A"],function(o,s,c){c._isPm=c._locale.isPM(o),c._meridiem=o}),ge(["h","hh"],function(o,s,c){s[Ye]=Z(o),w(c).bigHour=!0}),ge("hmm",function(o,s,c){var f=o.length-2;s[Ye]=Z(o.substr(0,f)),s[on]=Z(o.substr(f)),w(c).bigHour=!0}),ge("hmmss",function(o,s,c){var f=o.length-4,p=o.length-2;s[Ye]=Z(o.substr(0,f)),s[on]=Z(o.substr(f,2)),s[Rn]=Z(o.substr(p)),w(c).bigHour=!0}),ge("Hmm",function(o,s,c){var f=o.length-2;s[Ye]=Z(o.substr(0,f)),s[on]=Z(o.substr(f))}),ge("Hmmss",function(o,s,c){var f=o.length-4,p=o.length-2;s[Ye]=Z(o.substr(0,f)),s[on]=Z(o.substr(f,2)),s[Rn]=Z(o.substr(p))});function r1(o){return(o+"").toLowerCase().charAt(0)==="p"}var i1=/[ap]\.?m?\.?/i,o1=y("Hours",!0);function a1(o,s,c){return o>11?c?"pm":"PM":c?"am":"AM"}var bf={calendar:Be,longDateFormat:Ot,invalidDate:qr,ordinal:Mr,dayOfMonthOrdinalParse:tr,relativeTime:Tr,months:by,monthsShort:cf,week:Oy,weekdays:Ly,weekdaysMin:Wy,weekdaysShort:vf,meridiemParse:i1},ke={},Ji={},Qi;function s1(o,s){var c,f=Math.min(o.length,s.length);for(c=0;c0;){if(p=la(b.slice(0,c).join("-")),p)return p;if(f&&f.length>=c&&s1(b,f)>=c-1)break;c--}s++}return Qi}function u1(o){return o.match("^[^/\\\\]*$")!=null}function la(o){var s=null,c;if(ke[o]===void 0&&typeof Hi!="undefined"&&Hi&&Hi.exports&&u1(o))try{s=Qi._abbr,c=require,c("./locale/"+o),nr(s)}catch(f){ke[o]=null}return ke[o]}function nr(o,s){var c;return o&&(u(s)?c=Gn(o):c=Ml(o,s),c?Qi=c:typeof console!="undefined"&&console.warn&&console.warn("Locale "+o+" not found. Did you forget to load it?")),Qi._abbr}function Ml(o,s){if(s!==null){var c,f=bf;if(s.abbr=o,ke[o]!=null)L("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),f=ke[o]._config;else if(s.parentLocale!=null)if(ke[s.parentLocale]!=null)f=ke[s.parentLocale]._config;else if(c=la(s.parentLocale),c!=null)f=c._config;else return Ji[s.parentLocale]||(Ji[s.parentLocale]=[]),Ji[s.parentLocale].push({name:o,config:s}),null;return ke[o]=new se(q(f,s)),Ji[o]&&Ji[o].forEach(function(p){Ml(p.name,p.config)}),nr(o),ke[o]}else return delete ke[o],null}function c1(o,s){if(s!=null){var c,f,p=bf;ke[o]!=null&&ke[o].parentLocale!=null?ke[o].set(q(ke[o]._config,s)):(f=la(o),f!=null&&(p=f._config),s=q(p,s),f==null&&(s.abbr=o),c=new se(s),c.parentLocale=ke[o],ke[o]=c),nr(o)}else ke[o]!=null&&(ke[o].parentLocale!=null?(ke[o]=ke[o].parentLocale,o===nr()&&nr(o)):ke[o]!=null&&delete ke[o]);return ke[o]}function Gn(o){var s;if(o&&o._locale&&o._locale._abbr&&(o=o._locale._abbr),!o)return Qi;if(!r(o)){if(s=la(o),s)return s;o=[o]}return l1(o)}function d1(){return $(ke)}function Pl(o){var s,c=o._a;return c&&w(o).overflow===-2&&(s=c[_n]<0||c[_n]>11?_n:c[Cn]<1||c[Cn]>aa(c[dt],c[_n])?Cn:c[Ye]<0||c[Ye]>24||c[Ye]===24&&(c[on]!==0||c[Rn]!==0||c[_r]!==0)?Ye:c[on]<0||c[on]>59?on:c[Rn]<0||c[Rn]>59?Rn:c[_r]<0||c[_r]>999?_r:-1,w(o)._overflowDayOfYear&&(sCn)&&(s=Cn),w(o)._overflowWeeks&&s===-1&&(s=vy),w(o)._overflowWeekday&&s===-1&&(s=yy),w(o).overflow=s),o}var f1=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,p1=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d|))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,h1=/Z|[+-]\d\d(?::?\d\d)?/,ua=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/],["YYYYMM",/\d{6}/,!1],["YYYY",/\d{4}/,!1]],Tl=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],m1=/^\/?Date\((-?\d+)/i,g1=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/,v1={UT:0,GMT:0,EDT:-4*60,EST:-5*60,CDT:-5*60,CST:-6*60,MDT:-6*60,MST:-7*60,PDT:-7*60,PST:-8*60};function Sf(o){var s,c,f=o._i,p=f1.exec(f)||p1.exec(f),b,A,W,X,ve=ua.length,bt=Tl.length;if(p){for(w(o).iso=!0,s=0,c=ve;sXi(A)||o._dayOfYear===0)&&(w(o)._overflowDayOfYear=!0),c=ji(A,0,o._dayOfYear),o._a[_n]=c.getUTCMonth(),o._a[Cn]=c.getUTCDate()),s=0;s<3&&o._a[s]==null;++s)o._a[s]=f[s]=p[s];for(;s<7;s++)o._a[s]=f[s]=o._a[s]==null?s===2?1:0:o._a[s];o._a[Ye]===24&&o._a[on]===0&&o._a[Rn]===0&&o._a[_r]===0&&(o._nextDay=!0,o._a[Ye]=0),o._d=(o._useUTC?ji:Ty).apply(null,f),b=o._useUTC?o._d.getUTCDay():o._d.getDay(),o._tzm!=null&&o._d.setUTCMinutes(o._d.getUTCMinutes()-o._tzm),o._nextDay&&(o._a[Ye]=24),o._w&&typeof o._w.d!="undefined"&&o._w.d!==b&&(w(o).weekdayMismatch=!0)}}function E1(o){var s,c,f,p,b,A,W,X,ve;s=o._w,s.GG!=null||s.W!=null||s.E!=null?(b=1,A=4,c=ni(s.GG,o._a[dt],Ui(Se(),1,4).year),f=ni(s.W,1),p=ni(s.E,1),(p<1||p>7)&&(X=!0)):(b=o._locale._week.dow,A=o._locale._week.doy,ve=Ui(Se(),b,A),c=ni(s.gg,o._a[dt],ve.year),f=ni(s.w,ve.week),s.d!=null?(p=s.d,(p<0||p>6)&&(X=!0)):s.e!=null?(p=s.e+b,(s.e<0||s.e>6)&&(X=!0)):p=b),f<1||f>Dn(c,b,A)?w(o)._overflowWeeks=!0:X!=null?w(o)._overflowWeekday=!0:(W=gf(c,f,p,b,A),o._a[dt]=W.year,o._dayOfYear=W.dayOfYear)}t.ISO_8601=function(){},t.RFC_2822=function(){};function Ol(o){if(o._f===t.ISO_8601){Sf(o);return}if(o._f===t.RFC_2822){wf(o);return}o._a=[],w(o).empty=!0;var s=""+o._i,c,f,p,b,A,W=s.length,X=0,ve,bt;for(p=Ke(o._f,o._locale).match(yt)||[],bt=p.length,c=0;c0&&w(o).unusedInput.push(A),s=s.slice(s.indexOf(f)+f.length),X+=f.length),ie[b]?(f?w(o).empty=!1:w(o).unusedTokens.push(b),gy(b,f,o)):o._strict&&!f&&w(o).unusedTokens.push(b);w(o).charsLeftOver=W-X,s.length>0&&w(o).unusedInput.push(s),o._a[Ye]<=12&&w(o).bigHour===!0&&o._a[Ye]>0&&(w(o).bigHour=void 0),w(o).parsedDateParts=o._a.slice(0),w(o).meridiem=o._meridiem,o._a[Ye]=k1(o._locale,o._a[Ye],o._meridiem),ve=w(o).era,ve!==null&&(o._a[dt]=o._locale.erasConvertYear(ve,o._a[dt])),Fl(o),Pl(o)}function k1(o,s,c){var f;return c==null?s:o.meridiemHour!=null?o.meridiemHour(s,c):(o.isPM!=null&&(f=o.isPM(c),f&&s<12&&(s+=12),!f&&s===12&&(s=0)),s)}function A1(o){var s,c,f,p,b,A,W=!1,X=o._f.length;if(X===0){w(o).invalidFormat=!0,o._d=new Date(NaN);return}for(p=0;pthis?this:o:v()});function kf(o,s){var c,f;if(s.length===1&&r(s[0])&&(s=s[0]),!s.length)return Se();for(c=s[0],f=1;fthis.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function U1(){if(!u(this._isDSTShifted))return this._isDSTShifted;var o={},s;return E(o,this),o=xf(o),o._a?(s=o._isUTC?S(o._a):Se(o._a),this._isDSTShifted=this.isValid()&&B1(o._a,s.toArray())>0):this._isDSTShifted=!1,this._isDSTShifted}function J1(){return this.isValid()?!this._isUTC:!1}function Q1(){return this.isValid()?this._isUTC:!1}function Nf(){return this.isValid()?this._isUTC&&this._offset===0:!1}var $1=/^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/,K1=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function an(o,s){var c=o,f=null,p,b,A;return da(o)?c={ms:o._milliseconds,d:o._days,M:o._months}:d(o)||!isNaN(+o)?(c={},s?c[s]=+o:c.milliseconds=+o):(f=$1.exec(o))?(p=f[1]==="-"?-1:1,c={y:0,d:Z(f[Cn])*p,h:Z(f[Ye])*p,m:Z(f[on])*p,s:Z(f[Rn])*p,ms:Z(_l(f[_r]*1e3))*p}):(f=K1.exec(o))?(p=f[1]==="-"?-1:1,c={y:Rr(f[2],p),M:Rr(f[3],p),w:Rr(f[4],p),d:Rr(f[5],p),h:Rr(f[6],p),m:Rr(f[7],p),s:Rr(f[8],p)}):c==null?c={}:typeof c=="object"&&("from"in c||"to"in c)&&(A=q1(Se(c.from),Se(c.to)),c={},c.ms=A.milliseconds,c.M=A.months),b=new ca(c),da(o)&&a(o,"_locale")&&(b._locale=o._locale),da(o)&&a(o,"_isValid")&&(b._isValid=o._isValid),b}an.fn=ca.prototype,an.invalid=V1;function Rr(o,s){var c=o&&parseFloat(o.replace(",","."));return(isNaN(c)?0:c)*s}function Mf(o,s){var c={};return c.months=s.month()-o.month()+(s.year()-o.year())*12,o.clone().add(c.months,"M").isAfter(s)&&--c.months,c.milliseconds=+s-+o.clone().add(c.months,"M"),c}function q1(o,s){var c;return o.isValid()&&s.isValid()?(s=Dl(s,o),o.isBefore(s)?c=Mf(o,s):(c=Mf(s,o),c.milliseconds=-c.milliseconds,c.months=-c.months),c):{milliseconds:0,months:0}}function Pf(o,s){return function(c,f){var p,b;return f!==null&&!isNaN(+f)&&(L(s,"moment()."+s+"(period, number) is deprecated. Please use moment()."+s+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),b=c,c=f,f=b),p=an(c,f),Tf(this,p,o),this}}function Tf(o,s,c,f){var p=s._milliseconds,b=_l(s._days),A=_l(s._months);!o.isValid()||(f=f==null?!0:f,A&&ff(o,B(o,"Month")+A*c),b&&j(o,"Date",B(o,"Date")+b*c),p&&o._d.setTime(o._d.valueOf()+p*c),f&&t.updateOffset(o,b||A))}var eC=Pf(1,"add"),tC=Pf(-1,"subtract");function Ff(o){return typeof o=="string"||o instanceof String}function nC(o){return M(o)||h(o)||Ff(o)||d(o)||iC(o)||rC(o)||o===null||o===void 0}function rC(o){var s=i(o)&&!l(o),c=!1,f=["years","year","y","months","month","M","days","day","d","dates","date","D","hours","hour","h","minutes","minute","m","seconds","second","s","milliseconds","millisecond","ms"],p,b,A=f.length;for(p=0;pc.valueOf():c.valueOf()9999?Le(c,s?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):z(Date.prototype.toISOString)?s?this.toDate().toISOString():new Date(this.valueOf()+this.utcOffset()*60*1e3).toISOString().replace("Z",Le(c,"Z")):Le(c,s?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")}function yC(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var o="moment",s="",c,f,p,b;return this.isLocal()||(o=this.utcOffset()===0?"moment.utc":"moment.parseZone",s="Z"),c="["+o+'("]',f=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY",p="-MM-DD[T]HH:mm:ss.SSS",b=s+'[")]',this.format(c+f+p+b)}function CC(o){o||(o=this.isUtc()?t.defaultFormatUtc:t.defaultFormat);var s=Le(this,o);return this.localeData().postformat(s)}function bC(o,s){return this.isValid()&&(M(o)&&o.isValid()||Se(o).isValid())?an({to:this,from:o}).locale(this.locale()).humanize(!s):this.localeData().invalidDate()}function IC(o){return this.from(Se(),o)}function SC(o,s){return this.isValid()&&(M(o)&&o.isValid()||Se(o).isValid())?an({from:this,to:o}).locale(this.locale()).humanize(!s):this.localeData().invalidDate()}function wC(o){return this.to(Se(),o)}function Of(o){var s;return o===void 0?this._locale._abbr:(s=Gn(o),s!=null&&(this._locale=s),this)}var _f=T("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(o){return o===void 0?this.localeData():this.locale(o)});function Rf(){return this._locale}var pa=1e3,ri=60*pa,ha=60*ri,Df=(365*400+97)*24*ha;function ii(o,s){return(o%s+s)%s}function Gf(o,s,c){return o<100&&o>=0?new Date(o+400,s,c)-Df:new Date(o,s,c).valueOf()}function Vf(o,s,c){return o<100&&o>=0?Date.UTC(o+400,s,c)-Df:Date.UTC(o,s,c)}function xC(o){var s,c;if(o=at(o),o===void 0||o==="millisecond"||!this.isValid())return this;switch(c=this._isUTC?Vf:Gf,o){case"year":s=c(this.year(),0,1);break;case"quarter":s=c(this.year(),this.month()-this.month()%3,1);break;case"month":s=c(this.year(),this.month(),1);break;case"week":s=c(this.year(),this.month(),this.date()-this.weekday());break;case"isoWeek":s=c(this.year(),this.month(),this.date()-(this.isoWeekday()-1));break;case"day":case"date":s=c(this.year(),this.month(),this.date());break;case"hour":s=this._d.valueOf(),s-=ii(s+(this._isUTC?0:this.utcOffset()*ri),ha);break;case"minute":s=this._d.valueOf(),s-=ii(s,ri);break;case"second":s=this._d.valueOf(),s-=ii(s,pa);break}return this._d.setTime(s),t.updateOffset(this,!0),this}function EC(o){var s,c;if(o=at(o),o===void 0||o==="millisecond"||!this.isValid())return this;switch(c=this._isUTC?Vf:Gf,o){case"year":s=c(this.year()+1,0,1)-1;break;case"quarter":s=c(this.year(),this.month()-this.month()%3+3,1)-1;break;case"month":s=c(this.year(),this.month()+1,1)-1;break;case"week":s=c(this.year(),this.month(),this.date()-this.weekday()+7)-1;break;case"isoWeek":s=c(this.year(),this.month(),this.date()-(this.isoWeekday()-1)+7)-1;break;case"day":case"date":s=c(this.year(),this.month(),this.date()+1)-1;break;case"hour":s=this._d.valueOf(),s+=ha-ii(s+(this._isUTC?0:this.utcOffset()*ri),ha)-1;break;case"minute":s=this._d.valueOf(),s+=ri-ii(s,ri)-1;break;case"second":s=this._d.valueOf(),s+=pa-ii(s,pa)-1;break}return this._d.setTime(s),t.updateOffset(this,!0),this}function kC(){return this._d.valueOf()-(this._offset||0)*6e4}function AC(){return Math.floor(this.valueOf()/1e3)}function NC(){return new Date(this.valueOf())}function MC(){var o=this;return[o.year(),o.month(),o.date(),o.hour(),o.minute(),o.second(),o.millisecond()]}function PC(){var o=this;return{years:o.year(),months:o.month(),date:o.date(),hours:o.hours(),minutes:o.minutes(),seconds:o.seconds(),milliseconds:o.milliseconds()}}function TC(){return this.isValid()?this.toISOString():null}function FC(){return N(this)}function OC(){return C({},w(this))}function _C(){return w(this).overflow}function RC(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}}G("N",0,0,"eraAbbr"),G("NN",0,0,"eraAbbr"),G("NNN",0,0,"eraAbbr"),G("NNNN",0,0,"eraName"),G("NNNNN",0,0,"eraNarrow"),G("y",["y",1],"yo","eraYear"),G("y",["yy",2],0,"eraYear"),G("y",["yyy",3],0,"eraYear"),G("y",["yyyy",4],0,"eraYear"),R("N",Vl),R("NN",Vl),R("NNN",Vl),R("NNNN",XC),R("NNNNN",jC),ge(["N","NN","NNN","NNNN","NNNNN"],function(o,s,c,f){var p=c._locale.erasParse(o,f,c._strict);p?w(c).era=p:w(c).invalidEra=o}),R("y",rn),R("yy",rn),R("yyy",rn),R("yyyy",rn),R("yo",UC),ge(["y","yy","yyy","yyyy"],dt),ge(["yo"],function(o,s,c,f){var p;c._locale._eraYearOrdinalRegex&&(p=o.match(c._locale._eraYearOrdinalRegex)),c._locale.eraYearOrdinalParse?s[dt]=c._locale.eraYearOrdinalParse(o,p):s[dt]=parseInt(o,10)});function DC(o,s){var c,f,p,b=this._eras||Gn("en")._eras;for(c=0,f=b.length;c=0)return b[f]}function VC(o,s){var c=o.since<=o.until?1:-1;return s===void 0?t(o.since).year():t(o.since).year()+(s-o.offset)*c}function BC(){var o,s,c,f=this.localeData().eras();for(o=0,s=f.length;ob&&(s=b),tb.call(this,o,s,c,f,p))}function tb(o,s,c,f,p){var b=gf(o,s,c,f,p),A=ji(b.year,0,b.dayOfYear);return this.year(A.getUTCFullYear()),this.month(A.getUTCMonth()),this.date(A.getUTCDate()),this}G("Q",0,"Qo","quarter"),We("quarter","Q"),je("quarter",7),R("Q",_t),ge("Q",function(o,s){s[_n]=(Z(o)-1)*3});function nb(o){return o==null?Math.ceil((this.month()+1)/3):this.month((o-1)*3+this.month()%3)}G("D",["DD",2],"Do","date"),We("date","D"),je("date",9),R("D",ee),R("DD",ee,Me),R("Do",function(o,s){return o?s._dayOfMonthOrdinalParse||s._ordinalParse:s._dayOfMonthOrdinalParseLenient}),ge(["D","DD"],Cn),ge("Do",function(o,s){s[Cn]=Z(o.match(ee)[0])});var Lf=y("Date",!0);G("DDD",["DDDD",3],"DDDo","dayOfYear"),We("dayOfYear","DDD"),je("dayOfYear",4),R("DDD",nn),R("DDDD",st),ge(["DDD","DDDD"],function(o,s,c){c._dayOfYear=Z(o)});function rb(o){var s=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return o==null?s:this.add(o-s,"d")}G("m",["mm",2],0,"minute"),We("minute","m"),je("minute",14),R("m",ee),R("mm",ee,Me),ge(["m","mm"],on);var ib=y("Minutes",!1);G("s",["ss",2],0,"second"),We("second","s"),je("second",15),R("s",ee),R("ss",ee,Me),ge(["s","ss"],Rn);var ob=y("Seconds",!1);G("S",0,0,function(){return~~(this.millisecond()/100)}),G(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),G(0,["SSS",3],0,"millisecond"),G(0,["SSSS",4],0,function(){return this.millisecond()*10}),G(0,["SSSSS",5],0,function(){return this.millisecond()*100}),G(0,["SSSSSS",6],0,function(){return this.millisecond()*1e3}),G(0,["SSSSSSS",7],0,function(){return this.millisecond()*1e4}),G(0,["SSSSSSSS",8],0,function(){return this.millisecond()*1e5}),G(0,["SSSSSSSSS",9],0,function(){return this.millisecond()*1e6}),We("millisecond","ms"),je("millisecond",16),R("S",nn,_t),R("SS",nn,Me),R("SSS",nn,st);var rr,Wf;for(rr="SSSS";rr.length<=9;rr+="S")R(rr,rn);function ab(o,s){s[_r]=Z(("0."+o)*1e3)}for(rr="S";rr.length<=9;rr+="S")ge(rr,ab);Wf=y("Milliseconds",!1),G("z",0,0,"zoneAbbr"),G("zz",0,0,"zoneName");function sb(){return this._isUTC?"UTC":""}function lb(){return this._isUTC?"Coordinated Universal Time":""}var _=P.prototype;_.add=eC,_.calendar=sC,_.clone=lC,_.diff=mC,_.endOf=EC,_.format=CC,_.from=bC,_.fromNow=IC,_.to=SC,_.toNow=wC,_.get=J,_.invalidAt=_C,_.isAfter=uC,_.isBefore=cC,_.isBetween=dC,_.isSame=fC,_.isSameOrAfter=pC,_.isSameOrBefore=hC,_.isValid=FC,_.lang=_f,_.locale=Of,_.localeData=Rf,_.max=F1,_.min=T1,_.parsingFlags=OC,_.set=ne,_.startOf=xC,_.subtract=tC,_.toArray=MC,_.toObject=PC,_.toDate=NC,_.toISOString=vC,_.inspect=yC,typeof Symbol!="undefined"&&Symbol.for!=null&&(_[Symbol.for("nodejs.util.inspect.custom")]=function(){return"Moment<"+this.format()+">"}),_.toJSON=TC,_.toString=gC,_.unix=AC,_.valueOf=kC,_.creationData=RC,_.eraName=BC,_.eraNarrow=LC,_.eraAbbr=WC,_.eraYear=YC,_.year=mf,_.isLeapYear=Py,_.weekYear=JC,_.isoWeekYear=QC,_.quarter=_.quarters=nb,_.month=pf,_.daysInMonth=Ay,_.week=_.weeks=Dy,_.isoWeek=_.isoWeeks=Gy,_.weeksInYear=qC,_.weeksInWeekYear=eb,_.isoWeeksInYear=$C,_.isoWeeksInISOWeekYear=KC,_.date=Lf,_.day=_.days=Qy,_.weekday=$y,_.isoWeekday=Ky,_.dayOfYear=rb,_.hour=_.hours=o1,_.minute=_.minutes=ib,_.second=_.seconds=ob,_.millisecond=_.milliseconds=Wf,_.utcOffset=W1,_.utc=z1,_.local=H1,_.parseZone=Z1,_.hasAlignedHourOffset=X1,_.isDST=j1,_.isLocal=J1,_.isUtcOffset=Q1,_.isUtc=Nf,_.isUTC=Nf,_.zoneAbbr=sb,_.zoneName=lb,_.dates=T("dates accessor is deprecated. Use date instead.",Lf),_.months=T("months accessor is deprecated. Use month instead",pf),_.years=T("years accessor is deprecated. Use year instead",mf),_.zone=T("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",Y1),_.isDSTShifted=T("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",U1);function ub(o){return Se(o*1e3)}function cb(){return Se.apply(null,arguments).parseZone()}function Yf(o){return o}var oe=se.prototype;oe.calendar=_e,oe.longDateFormat=Mn,oe.invalidDate=Nr,oe.ordinal=Pr,oe.preparse=Yf,oe.postformat=Yf,oe.relativeTime=wl,oe.pastFuture=Fr,oe.set=ae,oe.eras=DC,oe.erasParse=GC,oe.erasConvertYear=VC,oe.erasAbbrRegex=HC,oe.erasNameRegex=zC,oe.erasNarrowRegex=ZC,oe.months=wy,oe.monthsShort=xy,oe.monthsParse=ky,oe.monthsRegex=My,oe.monthsShortRegex=Ny,oe.week=Fy,oe.firstDayOfYear=Ry,oe.firstDayOfWeek=_y,oe.weekdays=Zy,oe.weekdaysMin=jy,oe.weekdaysShort=Xy,oe.weekdaysParse=Jy,oe.weekdaysRegex=qy,oe.weekdaysShortRegex=e1,oe.weekdaysMinRegex=t1,oe.isPM=r1,oe.meridiem=a1;function ga(o,s,c,f){var p=Gn(),b=S().set(f,s);return p[c](b,o)}function zf(o,s,c){if(d(o)&&(s=o,o=void 0),o=o||"",s!=null)return ga(o,s,c,"month");var f,p=[];for(f=0;f<12;f++)p[f]=ga(o,f,c,"month");return p}function Ll(o,s,c,f){typeof o=="boolean"?(d(s)&&(c=s,s=void 0),s=s||""):(s=o,c=s,o=!1,d(s)&&(c=s,s=void 0),s=s||"");var p=Gn(),b=o?p._week.dow:0,A,W=[];if(c!=null)return ga(s,(c+b)%7,f,"day");for(A=0;A<7;A++)W[A]=ga(s,(A+b)%7,f,"day");return W}function db(o,s){return zf(o,s,"months")}function fb(o,s){return zf(o,s,"monthsShort")}function pb(o,s,c){return Ll(o,s,c,"weekdays")}function hb(o,s,c){return Ll(o,s,c,"weekdaysShort")}function mb(o,s,c){return Ll(o,s,c,"weekdaysMin")}nr("en",{eras:[{since:"0001-01-01",until:1/0,offset:1,name:"Anno Domini",narrow:"AD",abbr:"AD"},{since:"0000-12-31",until:-1/0,offset:1,name:"Before Christ",narrow:"BC",abbr:"BC"}],dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(o){var s=o%10,c=Z(o%100/10)===1?"th":s===1?"st":s===2?"nd":s===3?"rd":"th";return o+c}}),t.lang=T("moment.lang is deprecated. Use moment.locale instead.",nr),t.langData=T("moment.langData is deprecated. Use moment.localeData instead.",Gn);var Vn=Math.abs;function gb(){var o=this._data;return this._milliseconds=Vn(this._milliseconds),this._days=Vn(this._days),this._months=Vn(this._months),o.milliseconds=Vn(o.milliseconds),o.seconds=Vn(o.seconds),o.minutes=Vn(o.minutes),o.hours=Vn(o.hours),o.months=Vn(o.months),o.years=Vn(o.years),this}function Hf(o,s,c,f){var p=an(s,c);return o._milliseconds+=f*p._milliseconds,o._days+=f*p._days,o._months+=f*p._months,o._bubble()}function vb(o,s){return Hf(this,o,s,1)}function yb(o,s){return Hf(this,o,s,-1)}function Zf(o){return o<0?Math.floor(o):Math.ceil(o)}function Cb(){var o=this._milliseconds,s=this._days,c=this._months,f=this._data,p,b,A,W,X;return o>=0&&s>=0&&c>=0||o<=0&&s<=0&&c<=0||(o+=Zf(Wl(c)+s)*864e5,s=0,c=0),f.milliseconds=o%1e3,p=kt(o/1e3),f.seconds=p%60,b=kt(p/60),f.minutes=b%60,A=kt(b/60),f.hours=A%24,s+=kt(A/24),X=kt(Xf(s)),c+=X,s-=Zf(Wl(X)),W=kt(c/12),c%=12,f.days=s,f.months=c,f.years=W,this}function Xf(o){return o*4800/146097}function Wl(o){return o*146097/4800}function bb(o){if(!this.isValid())return NaN;var s,c,f=this._milliseconds;if(o=at(o),o==="month"||o==="quarter"||o==="year")switch(s=this._days+f/864e5,c=this._months+Xf(s),o){case"month":return c;case"quarter":return c/3;case"year":return c/12}else switch(s=this._days+Math.round(Wl(this._months)),o){case"week":return s/7+f/6048e5;case"day":return s+f/864e5;case"hour":return s*24+f/36e5;case"minute":return s*1440+f/6e4;case"second":return s*86400+f/1e3;case"millisecond":return Math.floor(s*864e5)+f;default:throw new Error("Unknown unit "+o)}}function Ib(){return this.isValid()?this._milliseconds+this._days*864e5+this._months%12*2592e6+Z(this._months/12)*31536e6:NaN}function Bn(o){return function(){return this.as(o)}}var Sb=Bn("ms"),wb=Bn("s"),xb=Bn("m"),Eb=Bn("h"),kb=Bn("d"),Ab=Bn("w"),Nb=Bn("M"),Mb=Bn("Q"),Pb=Bn("y");function Tb(){return an(this)}function Fb(o){return o=at(o),this.isValid()?this[o+"s"]():NaN}function Dr(o){return function(){return this.isValid()?this._data[o]:NaN}}var Ob=Dr("milliseconds"),_b=Dr("seconds"),Rb=Dr("minutes"),Db=Dr("hours"),Gb=Dr("days"),Vb=Dr("months"),Bb=Dr("years");function Lb(){return kt(this.days()/7)}var Ln=Math.round,oi={ss:44,s:45,m:45,h:22,d:26,w:null,M:11};function Wb(o,s,c,f,p){return p.relativeTime(s||1,!!c,o,f)}function Yb(o,s,c,f){var p=an(o).abs(),b=Ln(p.as("s")),A=Ln(p.as("m")),W=Ln(p.as("h")),X=Ln(p.as("d")),ve=Ln(p.as("M")),bt=Ln(p.as("w")),Wn=Ln(p.as("y")),ir=b<=c.ss&&["s",b]||b0,ir[4]=f,Wb.apply(null,ir)}function zb(o){return o===void 0?Ln:typeof o=="function"?(Ln=o,!0):!1}function Hb(o,s){return oi[o]===void 0?!1:s===void 0?oi[o]:(oi[o]=s,o==="s"&&(oi.ss=s-1),!0)}function Zb(o,s){if(!this.isValid())return this.localeData().invalidDate();var c=!1,f=oi,p,b;return typeof o=="object"&&(s=o,o=!1),typeof o=="boolean"&&(c=o),typeof s=="object"&&(f=Object.assign({},oi,s),s.s!=null&&s.ss==null&&(f.ss=s.s-1)),p=this.localeData(),b=Yb(this,!c,f,p),c&&(b=p.pastFuture(+this,b)),p.postformat(b)}var Yl=Math.abs;function ai(o){return(o>0)-(o<0)||+o}function va(){if(!this.isValid())return this.localeData().invalidDate();var o=Yl(this._milliseconds)/1e3,s=Yl(this._days),c=Yl(this._months),f,p,b,A,W=this.asSeconds(),X,ve,bt,Wn;return W?(f=kt(o/60),p=kt(f/60),o%=60,f%=60,b=kt(c/12),c%=12,A=o?o.toFixed(3).replace(/\.?0+$/,""):"",X=W<0?"-":"",ve=ai(this._months)!==ai(W)?"-":"",bt=ai(this._days)!==ai(W)?"-":"",Wn=ai(this._milliseconds)!==ai(W)?"-":"",X+"P"+(b?ve+b+"Y":"")+(c?ve+c+"M":"")+(s?bt+s+"D":"")+(p||f||o?"T":"")+(p?Wn+p+"H":"")+(f?Wn+f+"M":"")+(o?Wn+A+"S":"")):"P0D"}var te=ca.prototype;te.isValid=G1,te.abs=gb,te.add=vb,te.subtract=yb,te.as=bb,te.asMilliseconds=Sb,te.asSeconds=wb,te.asMinutes=xb,te.asHours=Eb,te.asDays=kb,te.asWeeks=Ab,te.asMonths=Nb,te.asQuarters=Mb,te.asYears=Pb,te.valueOf=Ib,te._bubble=Cb,te.clone=Tb,te.get=Fb,te.milliseconds=Ob,te.seconds=_b,te.minutes=Rb,te.hours=Db,te.days=Gb,te.weeks=Lb,te.months=Vb,te.years=Bb,te.humanize=Zb,te.toISOString=va,te.toString=va,te.toJSON=va,te.locale=Of,te.localeData=Rf,te.toIsoString=T("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",va),te.lang=_f,G("X",0,0,"unix"),G("x",0,0,"valueOf"),R("x",ut),R("X",ti),ge("X",function(o,s,c){c._d=new Date(parseFloat(o)*1e3)}),ge("x",function(o,s,c){c._d=new Date(Z(o))});return t.version="2.29.4",n(Se),t.fn=_,t.min=O1,t.max=_1,t.now=R1,t.utc=S,t.unix=ub,t.months=db,t.isDate=h,t.locale=nr,t.invalid=v,t.duration=an,t.isMoment=M,t.weekdays=pb,t.parseZone=cb,t.localeData=Gn,t.isDuration=da,t.monthsShort=fb,t.weekdaysMin=mb,t.defineLocale=Ml,t.updateLocale=c1,t.locales=d1,t.weekdaysShort=hb,t.normalizeUnits=at,t.relativeTimeRounding=zb,t.relativeTimeThreshold=Hb,t.calendarFormat=aC,t.prototype=_,t.HTML5_FMT={DATETIME_LOCAL:"YYYY-MM-DDTHH:mm",DATETIME_LOCAL_SECONDS:"YYYY-MM-DDTHH:mm:ss",DATETIME_LOCAL_MS:"YYYY-MM-DDTHH:mm:ss.SSS",DATE:"YYYY-MM-DD",TIME:"HH:mm",TIME_SECONDS:"HH:mm:ss",TIME_MS:"HH:mm:ss.SSS",WEEK:"GGGG-[W]WW",MONTH:"YYYY-MM"},t})});var pE={};qb(pE,{default:()=>Sl});module.exports=eI(pE);var Pg=require("obsidian"),vt=we(De()),Tg=we(Ws()),Ys=require("obsidian"),zs=class extends Pg.Modal{constructor(n,r,i){super(n);this.plugin=r,this.view=i,this.date=(0,Ys.moment)().format("YYYY-MM-DD")}render(){this.root.render(vt.createElement(vt.StrictMode,null,vt.createElement("div",{className:"janitor-date-picker"},vt.createElement("form",{onSubmit:this.onApply.bind(this)},vt.createElement("label",null,vt.createElement("span",null,"Choose a date:"),vt.createElement("input",{type:"date",value:this.date,onChange:this.onDateChange.bind(this)})),vt.createElement("div",{className:"janitor-date-picker-buttons"},vt.createElement("button",{type:"button",onClick:n=>this.close()},"Cancel "),vt.createElement("button",{className:"mod-cta",type:"submit"},"OK")),vt.createElement("div",{className:"janitor-date-shortcuts"},vt.createElement("button",{onClick:n=>this.dateShortcut(n,1,"weeks"),className:"janitor-date-shortcut=button"},"In a Week"),vt.createElement("button",{onClick:n=>this.dateShortcut(n,1,"months"),className:"janitor-date-shortcut=button"},"In a Month"),vt.createElement("button",{onClick:n=>this.dateShortcut(n,1,"years"),className:"janitor-date-shortcut=button"},"In a Year"))))))}dateShortcut(n,r,i){this.date=(0,Ys.moment)().add(r,i).format("YYYY-MM-DD"),this.render()}onApply(n){n.preventDefault();let r=(0,Ys.moment)(this.date,"YYYY-MM-DD").format(this.plugin.settings.expiredDateFormat);return this.plugin.updateNoteWithDate(this.view,r),this.close(),!1}onDateChange(n){this.date=n.target.value,this.render()}onOpen(){let{contentEl:n}=this;this.root=(0,Tg.createRoot)(n),this.render()}onClose(){this.root.unmount()}};var fe=we(De()),mn=we(De());var Hs=(r=>(r.Trash="trash",r.TrashSystem="trash-system",r.Delete="delete",r))(Hs||{}),Zs={runAtStartup:!1,addRibbonIcon:!0,promptUser:!0,promptForBigFiles:!0,attachmentsExtensions:".jpg|.jpeg|.png|.gif|.svg|.pdf",defaultOperation:"trash",expiredAttribute:"expires",expiredDateFormat:"YYYY-MM-DD",sizeLimitKb:1024,processOrphans:!0,processEmpty:!0,processExpired:!0,processBig:!0,honorObsidianExcludedFiles:!0,excludedFilesFilters:[]};var Fg=e=>{let{scanning:t,onClose:n,onPerform:r}=e,i=[e.orphans,e.empty,e.expired,e.big].some(u=>u&&u.some(d=>d.selected)),a=(0,mn.useCallback)(u=>(0,mn.useCallback)(()=>{r(u)},[u,r]),[r]),l=Object.values(Hs).reduce((u,d)=>ce(U({},u),{[d]:a(d)}),{});return fe.createElement("div",{className:"janitor-modal-wrapper"},fe.createElement("div",{className:"janitor-modal-title"},"Janitor Scan Results"),fe.createElement("div",{className:"janitor-modal-content"},t?fe.createElement("h4",null,"Scanning..."):fe.createElement(vw,U({},e))),fe.createElement("div",{className:"janitor-modal-footer"},fe.createElement("div",{className:"janitor-footer-buttons"},fe.createElement("button",{tabIndex:1,style:{visibility:i?"visible":"hidden"},className:"",onClick:l["trash"],title:"Put files in the Obsidian .trash"},"Trash (Obsidian)"),fe.createElement("button",{tabIndex:1,style:{visibility:i?"visible":"hidden"},className:"",onClick:l["trash-system"],title:"Put files in the OS' trash"},"Trash (System)"),fe.createElement("button",{tabIndex:1,style:{visibility:i?"visible":"hidden"},className:"",onClick:l["delete"],title:"Permanently delete files"},"Delete"),fe.createElement("button",{tabIndex:1,className:"mod-cta",onClick:n},"Cancel"))))};function vw({orphans:e,empty:t,big:n,expired:r,onSelectionChange:i,onOpen:a}){let l=(0,mn.useCallback)(d=>(0,mn.useCallback)(h=>{i(h,d)},[i,d]),[i]),u=(0,mn.useCallback)(d=>(0,mn.useCallback)(h=>{a(h,d)},[a,d]),[a]);return fe.createElement("div",{className:"janitor-scan-results"},e&&e.length>0&&fe.createElement(Xs,{files:e,onChange:l("orphans"),onOpen:u("orphans"),title:"Orphans"}),t&&t.length>0&&fe.createElement(Xs,{title:"Empty",files:t,onChange:l("empty"),onOpen:u("empty")}),r&&r.length>0&&fe.createElement(Xs,{title:"Expired",files:r,onChange:l("expired"),onOpen:u("expired")}),n&&n.length>0&&fe.createElement(Xs,{title:"Big",files:n,onChange:l("big"),onOpen:u("big")}))}var Xs=({files:e,onChange:t,onOpen:n,title:r})=>{let i=(0,mn.useCallback)(d=>(0,mn.useCallback)(()=>{t(d)},[t,d]),[t]),a=(0,mn.useCallback)(d=>(0,mn.useCallback)(()=>{n(d)},[t,d]),[t]),l=e.every(d=>d.selected),u=e.filter(d=>d.selected).length;return fe.createElement("div",{className:"janitor-files-wrapper"},fe.createElement("div",{className:"janitor-scan-section-title"},fe.createElement("label",{title:`Click to ${l?"unselect":"select"} these ${e.length} items`},fe.createElement("input",{type:"checkbox",checked:l,onChange:i(-1)}),r," (",e.length," items)",u>0&&fe.createElement(fe.Fragment,null,"\xA0 (",u," selected)"))),e.map((d,h)=>fe.createElement("div",{key:h,className:"janitor-file"},fe.createElement("label",null,fe.createElement("input",{checked:d.selected,value:d.name,onChange:i(h),type:"checkbox"}),fe.createElement("span",null,d.name),fe.createElement("a",{href:"#",className:"openFileIcon",onClick:a(h)},"open")))))};var Og=require("obsidian"),Xo=we(De()),_g=we(Ws()),Rg=we(require("path"));function js(e,t,n){return e.map((r,i)=>t.contains(r.name)?ce(U({},r),{selected:n}):r)}var Us=class extends Og.Modal{constructor(n,r){super(n);this.plugin=r,this.state={onClose:()=>{this.close()},scanning:!0,orphans:[],empty:[],big:[],expired:[],onSelectionChange:(i,a)=>{this.handleSelectionChange(i,a)},onPerform:i=>{this.perform(i)},onSettingChange:(i,a)=>{this.onSettingChange(i,a)},onOpen:(i,a)=>{this.handleOpen(i,a)}}}perform(n){this.plugin.perform(n,this.extractFiles()),this.close()}onSettingChange(n,r){this.plugin.settings[n]=r,this.plugin.saveSettings(),this.state=U({},this.state),this.render()}handleOpen(n,r){return ye(this,null,function*(){let a=this.state[r][n],l=this.app.vault.adapter.getBasePath(),u=Rg.default.join(l,a.name),d=yield this.app.openWithDefaultApp(a.name)})}handleSelectionChange(n,r){let i=this.state[r];if(n>=0){let a=i[n],l=!a.selected;this.applySelectionChangeToAllSections([a.name],l)}else{let a=i.every(u=>u.selected),l=i.map(u=>u.name);this.applySelectionChangeToAllSections(l,!a)}this.render()}applySelectionChangeToAllSections(n,r){this.state=ce(U({},this.state),{orphans:this.state.orphans&&js(this.state.orphans,n,r),empty:this.state.empty&&js(this.state.empty,n,r),big:this.state.big&&js(this.state.big,n,r),expired:this.state.expired&&js(this.state.expired,n,r)})}updateState(n){this.state=ce(U({},this.state),{scanning:n.scanning,orphans:this.fileToSelectableItem(n.orphans),empty:this.fileToSelectableItem(n.empty),expired:this.fileToSelectableItem(n.expired),big:this.fileToSelectableItem(n.big)}),this.render()}fileToSelectableItem(n){return n&&n.map(r=>({name:r.path,selected:!1}))}render(){this.root.render(Xo.createElement(Xo.StrictMode,null,Xo.createElement(Fg,U({},this.state))))}onOpen(){let{contentEl:n}=this;this.root=(0,_g.createRoot)(n),this.render()}onClose(){this.root.unmount()}extractFiles(){return[this.state.orphans,this.state.empty,this.state.big,this.state.expired].flatMap(n=>n?n.filter(r=>r.selected).map(r=>r.name):[])}};var yn=require("obsidian");function Dg(e,t){return e.reduce(([n,r],i)=>t(i)?[[...n,i],r]:[n,[...r,i]],[[],[]])}function Gg(e,t){return ye(this,null,function*(){let n=yield Promise.all(e.map(t));return e.filter((r,i)=>n[i])})}function Vg(e){let t=e.vault.adapter.files,n=[];for(let r in t)t[r].type==="folder"&&n.push(t[r].realpath);return n}var ld=require("obsidian"),Js=class{constructor(t,n){this.whiteSpaceRegExp=new RegExp("\\S","");this.app=t,this.settings=n}isNote(t){return t.extension.toLowerCase()==="md"}scan(){return ye(this,null,function*(){let t=this.app.vault.getFiles(),n=this.settings.excludedFilesFilters||[];this.settings.honorObsidianExcludedFiles&&this.app.vault.config.userIgnoreFilters&&(n=n.concat(this.app.vault.config.userIgnoreFilters));let r=n.map(x=>new RegExp(x,"i")),i=t.filter(x=>!r.some(w=>w.exec(x.path))),[a,l]=Dg(i,this.isNote),u=this.getFrontMatters(a),d=this.settings.processOrphans&&this.findOrphans(a,l,u),h=this.settings.processEmpty&&(yield this.findEmpty(i)),m=this.settings.processExpired&&this.findExpired(u),C=this.settings.processBig&&this.findBigFiles(i);return{orphans:d,empty:h,expired:m,big:C,scanning:!1}})}findBigFiles(t){return t.filter(n=>n.stat.size>>10>this.settings.sizeLimitKb)}findExpired(t){let n=ld.moment.now();return t.filter(i=>{let a=i.frontMatter[this.settings.expiredAttribute];if(a){let l=(0,ld.moment)(a,this.settings.expiredDateFormat);if(l.isValid()&&l.isBefore(n))return!0}return!1}).map(i=>i.file)}findEmpty(t){return ye(this,null,function*(){return yield Gg(t,r=>ye(this,null,function*(){if(r.stat.size===0)return!0;let i=yield this.app.vault.cachedRead(r);return!this.whiteSpaceRegExp.test(i)}))})}findOrphans(t,n,r){let i=this.getResolvedLinks(),a=this.combineLinksAndResolvedMetadata(r,i);return this.getOrphans(n,a)}getOrphans(t,n){return t.filter(r=>!n[r.path])}combineLinksAndResolvedMetadata(t,n){return t.reduce((r,i)=>{var a;return(a=i==null?void 0:i.resolvedProps)!=null&&a.length?U(U({},r),i.resolvedProps.reduce((l,u)=>ce(U({},l),{[u]:1}),{})):r},n)}getFrontMatters(t){return t.map(n=>{var i;let r=(i=app.metadataCache.getFileCache(n))==null?void 0:i.frontmatter;if(r){let a=yw(r);if(a!=null&&a.length){let l=a.map(u=>{let d=app.metadataCache.getFirstLinkpathDest(u,n.path);if(d)return d.path}).filter(u=>!!u);return{frontMatter:r,stringProps:a,resolvedProps:l,file:n}}}}).filter(n=>!!n)}getResolvedLinks(){return Object.keys(app.metadataCache.resolvedLinks).reduce((n,r)=>Object.assign(n,app.metadataCache.resolvedLinks[r]),{})}};function yw(e){return Object.values(e).filter(t=>typeof t=="string")}var Xe=we(De()),cy=require("obsidian"),dy=we(Ws());var ud=we(De()),Cw=e=>ud.createElement("svg",U({viewBox:"0 0 100 100",className:"cross",width:16,height:16,role:"img"},e),ud.createElement("path",{fill:"currentColor",stroke:"currentColor",d:"M15.4,12.6l-2.9,2.9L47.1,50L12.6,84.6l2.9,2.9L50,52.9l34.6,34.6l2.9-2.9L52.9,50l34.6-34.6l-2.9-2.9L50,47.1L15.4,12.6z "})),Bg=Cw;var Nn=we(De());var Kn=we(De()),Lg=({name:e,description:t})=>Kn.default.createElement(bw,null,Kn.default.createElement(Iw,null,e),Kn.default.createElement(Sw,null,t)),bw=({children:e})=>Kn.default.createElement("div",{className:"setting-item-info"},e),Iw=({children:e})=>Kn.default.createElement("div",{className:"setting-item-name"},e),Sw=({children:e})=>Kn.default.createElement("div",{className:"setting-item-description"},e),Wg=({children:e})=>Kn.default.createElement("div",{className:"setting-item-control"},e),Yg=({children:e})=>Kn.default.createElement("div",{className:"setting-item"},e);var ia=we(De());function Y(){return Y=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&(n[i]=e[i]);return n}function en(e,t){if(e==null)return{};var n=zd(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i=0)&&(!Object.prototype.propertyIsEnumerable.call(e,r)||(n[r]=e[r]))}return n}function Hd(e){if(Array.isArray(e))return e}function Zd(e,t){var n=e==null?null:typeof Symbol!="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r=[],i=!0,a=!1,l,u;try{for(n=n.call(e);!(i=(l=n.next()).done)&&(r.push(l.value),!(t&&r.length===t));i=!0);}catch(d){a=!0,u=d}finally{try{!i&&n.return!=null&&n.return()}finally{if(a)throw u}}return r}}function Vi(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n-1}function Ux(e){return ta(e)?window.innerHeight:e.clientHeight}function Uv(e){return ta(e)?window.pageYOffset:e.scrollTop}function hl(e,t){if(ta(e)){window.scrollTo(0,t);return}e.scrollTop=t}function Jx(e){var t=getComputedStyle(e),n=t.position==="absolute",r=/(auto|scroll)/;if(t.position==="fixed")return document.documentElement;for(var i=e;i=i.parentElement;)if(t=getComputedStyle(i),!(n&&t.position==="static")&&r.test(t.overflow+t.overflowY+t.overflowX))return i;return document.documentElement}function Qx(e,t,n,r){return n*((e=e/r-1)*e*e+1)+t}function dl(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:200,r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:qo,i=Uv(e),a=t-i,l=10,u=0;function d(){u+=l;var h=Qx(u,i,a,n);hl(e,h),un.bottom?hl(e,Math.min(t.offsetTop+t.clientHeight-e.offsetHeight+i,e.scrollHeight)):r.top-i1?n-1:0),i=1;i=k)return{placement:"bottom",maxHeight:t};if(L>=k&&!l)return a&&dl(h,z,q),{placement:"bottom",maxHeight:t};if(!l&&L>=r||l&&T>=r){a&&dl(h,z,q);var se=l?T-P:L-P;return{placement:"bottom",maxHeight:se}}if(i==="auto"||l){var $=t,Be=l?F:D;return Be>=r&&($=Math.min(Be-P-d.controlHeight,t)),{placement:"top",maxHeight:$}}if(i==="bottom")return a&&hl(h,z),{placement:"bottom",maxHeight:t};break;case"top":if(F>=k)return{placement:"top",maxHeight:t};if(D>=k&&!l)return a&&dl(h,ae,q),{placement:"top",maxHeight:t};if(!l&&D>=r||l&&F>=r){var _e=t;return(!l&&D>=r||l&&F>=r)&&(_e=l?F-M:D-M),a&&dl(h,ae,q),{placement:"top",maxHeight:_e}}return{placement:"bottom",maxHeight:t};default:throw new Error('Invalid placement provided "'.concat(i,'".'))}return m}function t2(e){var t={bottom:"top",top:"bottom"};return e?t[e]:"bottom"}var Ud=function(t){return t==="auto"?"bottom":t},t0=function(t){var n,r=t.placement,i=t.theme,a=i.borderRadius,l=i.spacing,u=i.colors;return n={label:"menu"},gn(n,t2(r),"100%"),gn(n,"backgroundColor",u.neutral0),gn(n,"borderRadius",a),gn(n,"boxShadow","0 0 0 1px hsla(0, 0%, 0%, 0.1), 0 4px 11px hsla(0, 0%, 0%, 0.1)"),gn(n,"marginBottom",l.menuGutter),gn(n,"marginTop",l.menuGutter),gn(n,"position","absolute"),gn(n,"width","100%"),gn(n,"zIndex",1),n},n0=(0,ea.createContext)({getPortalPlacement:null}),Qd=function(e){Wi(n,e);var t=ml(n);function n(){var r;Bi(this,n);for(var i=arguments.length,a=new Array(i),l=0;l1?"s":""," ").concat(a.join(","),", selected.");case"select-option":return l?"option ".concat(i," is disabled. Select another option."):"option ".concat(i,", selected.");default:return""}},onFocus:function(t){var n=t.context,r=t.focused,i=t.options,a=t.label,l=a===void 0?"":a,u=t.selectValue,d=t.isDisabled,h=t.isSelected,m=function(w,k){return w&&w.length?"".concat(w.indexOf(k)+1," of ").concat(w.length):""};if(n==="value"&&u)return"value ".concat(l," focused, ").concat(m(u,r),".");if(n==="menu"){var C=d?" disabled":"",S="".concat(h?"selected":"focused").concat(C);return"option ".concat(l," ").concat(S,", ").concat(m(i,r),".")}return""},onFilter:function(t){var n=t.inputValue,r=t.resultsMessage;return"".concat(r).concat(n?" for search term "+n:"",".")}},R2=function(t){var n=t.ariaSelection,r=t.focusedOption,i=t.focusedValue,a=t.focusableOptions,l=t.isFocused,u=t.selectValue,d=t.selectProps,h=t.id,m=d.ariaLiveMessages,C=d.getOptionLabel,S=d.inputValue,x=d.isMulti,w=d.isOptionDisabled,k=d.isSearchable,N=d.menuIsOpen,v=d.options,g=d.screenReaderStatus,I=d.tabSelectsValue,E=d["aria-label"],P=d["aria-live"],M=(0,le.useMemo)(function(){return ue(ue({},_2),m||{})},[m]),F=(0,le.useMemo)(function(){var se="";if(n&&M.onChange){var $=n.option,Be=n.options,_e=n.removedValue,me=n.removedValues,yt=n.value,rt=function(Ke){return Array.isArray(Ke)?null:Ke},Ie=_e||$||rt(yt),ie=Ie?C(Ie):"",G=Be||me||void 0,it=G?G.map(C):[],ot=ue({isDisabled:Ie&&w(Ie,u),label:ie,labels:it},n);se=M.onChange(ot)}return se},[n,M,w,u,C]),T=(0,le.useMemo)(function(){var se="",$=r||i,Be=!!(r&&u&&u.includes(r));if($&&M.onFocus){var _e={focused:$,label:C($),isDisabled:w($,u),isSelected:Be,options:v,context:$===r?"menu":"value",selectValue:u};se=M.onFocus(_e)}return se},[r,i,C,w,M,v,u]),D=(0,le.useMemo)(function(){var se="";if(N&&v.length&&M.onFilter){var $=g({count:a.length});se=M.onFilter({inputValue:S,resultsMessage:$})}return se},[a,S,N,M,v,g]),L=(0,le.useMemo)(function(){var se="";if(M.guidance){var $=i?"value":N?"menu":"input";se=M.guidance({"aria-label":E,context:$,isDisabled:r&&w(r,u),isMulti:x,isSearchable:k,tabSelectsValue:I})}return se},[E,r,i,x,w,k,N,M,u,I]),z="".concat(T," ").concat(D," ").concat(L),ae=(0,Xt.jsx)(le.Fragment,null,(0,Xt.jsx)("span",{id:"aria-selection"},F),(0,Xt.jsx)("span",{id:"aria-context"},z)),q=(n==null?void 0:n.action)==="initial-input-focus";return(0,Xt.jsx)(le.Fragment,null,(0,Xt.jsx)(D0,{id:h},q&&ae),(0,Xt.jsx)(D0,{"aria-live":P,"aria-atomic":"false","aria-relevant":"additions text"},l&&!q&&ae))},nf=[{base:"A",letters:"A\u24B6\uFF21\xC0\xC1\xC2\u1EA6\u1EA4\u1EAA\u1EA8\xC3\u0100\u0102\u1EB0\u1EAE\u1EB4\u1EB2\u0226\u01E0\xC4\u01DE\u1EA2\xC5\u01FA\u01CD\u0200\u0202\u1EA0\u1EAC\u1EB6\u1E00\u0104\u023A\u2C6F"},{base:"AA",letters:"\uA732"},{base:"AE",letters:"\xC6\u01FC\u01E2"},{base:"AO",letters:"\uA734"},{base:"AU",letters:"\uA736"},{base:"AV",letters:"\uA738\uA73A"},{base:"AY",letters:"\uA73C"},{base:"B",letters:"B\u24B7\uFF22\u1E02\u1E04\u1E06\u0243\u0182\u0181"},{base:"C",letters:"C\u24B8\uFF23\u0106\u0108\u010A\u010C\xC7\u1E08\u0187\u023B\uA73E"},{base:"D",letters:"D\u24B9\uFF24\u1E0A\u010E\u1E0C\u1E10\u1E12\u1E0E\u0110\u018B\u018A\u0189\uA779"},{base:"DZ",letters:"\u01F1\u01C4"},{base:"Dz",letters:"\u01F2\u01C5"},{base:"E",letters:"E\u24BA\uFF25\xC8\xC9\xCA\u1EC0\u1EBE\u1EC4\u1EC2\u1EBC\u0112\u1E14\u1E16\u0114\u0116\xCB\u1EBA\u011A\u0204\u0206\u1EB8\u1EC6\u0228\u1E1C\u0118\u1E18\u1E1A\u0190\u018E"},{base:"F",letters:"F\u24BB\uFF26\u1E1E\u0191\uA77B"},{base:"G",letters:"G\u24BC\uFF27\u01F4\u011C\u1E20\u011E\u0120\u01E6\u0122\u01E4\u0193\uA7A0\uA77D\uA77E"},{base:"H",letters:"H\u24BD\uFF28\u0124\u1E22\u1E26\u021E\u1E24\u1E28\u1E2A\u0126\u2C67\u2C75\uA78D"},{base:"I",letters:"I\u24BE\uFF29\xCC\xCD\xCE\u0128\u012A\u012C\u0130\xCF\u1E2E\u1EC8\u01CF\u0208\u020A\u1ECA\u012E\u1E2C\u0197"},{base:"J",letters:"J\u24BF\uFF2A\u0134\u0248"},{base:"K",letters:"K\u24C0\uFF2B\u1E30\u01E8\u1E32\u0136\u1E34\u0198\u2C69\uA740\uA742\uA744\uA7A2"},{base:"L",letters:"L\u24C1\uFF2C\u013F\u0139\u013D\u1E36\u1E38\u013B\u1E3C\u1E3A\u0141\u023D\u2C62\u2C60\uA748\uA746\uA780"},{base:"LJ",letters:"\u01C7"},{base:"Lj",letters:"\u01C8"},{base:"M",letters:"M\u24C2\uFF2D\u1E3E\u1E40\u1E42\u2C6E\u019C"},{base:"N",letters:"N\u24C3\uFF2E\u01F8\u0143\xD1\u1E44\u0147\u1E46\u0145\u1E4A\u1E48\u0220\u019D\uA790\uA7A4"},{base:"NJ",letters:"\u01CA"},{base:"Nj",letters:"\u01CB"},{base:"O",letters:"O\u24C4\uFF2F\xD2\xD3\xD4\u1ED2\u1ED0\u1ED6\u1ED4\xD5\u1E4C\u022C\u1E4E\u014C\u1E50\u1E52\u014E\u022E\u0230\xD6\u022A\u1ECE\u0150\u01D1\u020C\u020E\u01A0\u1EDC\u1EDA\u1EE0\u1EDE\u1EE2\u1ECC\u1ED8\u01EA\u01EC\xD8\u01FE\u0186\u019F\uA74A\uA74C"},{base:"OI",letters:"\u01A2"},{base:"OO",letters:"\uA74E"},{base:"OU",letters:"\u0222"},{base:"P",letters:"P\u24C5\uFF30\u1E54\u1E56\u01A4\u2C63\uA750\uA752\uA754"},{base:"Q",letters:"Q\u24C6\uFF31\uA756\uA758\u024A"},{base:"R",letters:"R\u24C7\uFF32\u0154\u1E58\u0158\u0210\u0212\u1E5A\u1E5C\u0156\u1E5E\u024C\u2C64\uA75A\uA7A6\uA782"},{base:"S",letters:"S\u24C8\uFF33\u1E9E\u015A\u1E64\u015C\u1E60\u0160\u1E66\u1E62\u1E68\u0218\u015E\u2C7E\uA7A8\uA784"},{base:"T",letters:"T\u24C9\uFF34\u1E6A\u0164\u1E6C\u021A\u0162\u1E70\u1E6E\u0166\u01AC\u01AE\u023E\uA786"},{base:"TZ",letters:"\uA728"},{base:"U",letters:"U\u24CA\uFF35\xD9\xDA\xDB\u0168\u1E78\u016A\u1E7A\u016C\xDC\u01DB\u01D7\u01D5\u01D9\u1EE6\u016E\u0170\u01D3\u0214\u0216\u01AF\u1EEA\u1EE8\u1EEE\u1EEC\u1EF0\u1EE4\u1E72\u0172\u1E76\u1E74\u0244"},{base:"V",letters:"V\u24CB\uFF36\u1E7C\u1E7E\u01B2\uA75E\u0245"},{base:"VY",letters:"\uA760"},{base:"W",letters:"W\u24CC\uFF37\u1E80\u1E82\u0174\u1E86\u1E84\u1E88\u2C72"},{base:"X",letters:"X\u24CD\uFF38\u1E8A\u1E8C"},{base:"Y",letters:"Y\u24CE\uFF39\u1EF2\xDD\u0176\u1EF8\u0232\u1E8E\u0178\u1EF6\u1EF4\u01B3\u024E\u1EFE"},{base:"Z",letters:"Z\u24CF\uFF3A\u0179\u1E90\u017B\u017D\u1E92\u1E94\u01B5\u0224\u2C7F\u2C6B\uA762"},{base:"a",letters:"a\u24D0\uFF41\u1E9A\xE0\xE1\xE2\u1EA7\u1EA5\u1EAB\u1EA9\xE3\u0101\u0103\u1EB1\u1EAF\u1EB5\u1EB3\u0227\u01E1\xE4\u01DF\u1EA3\xE5\u01FB\u01CE\u0201\u0203\u1EA1\u1EAD\u1EB7\u1E01\u0105\u2C65\u0250"},{base:"aa",letters:"\uA733"},{base:"ae",letters:"\xE6\u01FD\u01E3"},{base:"ao",letters:"\uA735"},{base:"au",letters:"\uA737"},{base:"av",letters:"\uA739\uA73B"},{base:"ay",letters:"\uA73D"},{base:"b",letters:"b\u24D1\uFF42\u1E03\u1E05\u1E07\u0180\u0183\u0253"},{base:"c",letters:"c\u24D2\uFF43\u0107\u0109\u010B\u010D\xE7\u1E09\u0188\u023C\uA73F\u2184"},{base:"d",letters:"d\u24D3\uFF44\u1E0B\u010F\u1E0D\u1E11\u1E13\u1E0F\u0111\u018C\u0256\u0257\uA77A"},{base:"dz",letters:"\u01F3\u01C6"},{base:"e",letters:"e\u24D4\uFF45\xE8\xE9\xEA\u1EC1\u1EBF\u1EC5\u1EC3\u1EBD\u0113\u1E15\u1E17\u0115\u0117\xEB\u1EBB\u011B\u0205\u0207\u1EB9\u1EC7\u0229\u1E1D\u0119\u1E19\u1E1B\u0247\u025B\u01DD"},{base:"f",letters:"f\u24D5\uFF46\u1E1F\u0192\uA77C"},{base:"g",letters:"g\u24D6\uFF47\u01F5\u011D\u1E21\u011F\u0121\u01E7\u0123\u01E5\u0260\uA7A1\u1D79\uA77F"},{base:"h",letters:"h\u24D7\uFF48\u0125\u1E23\u1E27\u021F\u1E25\u1E29\u1E2B\u1E96\u0127\u2C68\u2C76\u0265"},{base:"hv",letters:"\u0195"},{base:"i",letters:"i\u24D8\uFF49\xEC\xED\xEE\u0129\u012B\u012D\xEF\u1E2F\u1EC9\u01D0\u0209\u020B\u1ECB\u012F\u1E2D\u0268\u0131"},{base:"j",letters:"j\u24D9\uFF4A\u0135\u01F0\u0249"},{base:"k",letters:"k\u24DA\uFF4B\u1E31\u01E9\u1E33\u0137\u1E35\u0199\u2C6A\uA741\uA743\uA745\uA7A3"},{base:"l",letters:"l\u24DB\uFF4C\u0140\u013A\u013E\u1E37\u1E39\u013C\u1E3D\u1E3B\u017F\u0142\u019A\u026B\u2C61\uA749\uA781\uA747"},{base:"lj",letters:"\u01C9"},{base:"m",letters:"m\u24DC\uFF4D\u1E3F\u1E41\u1E43\u0271\u026F"},{base:"n",letters:"n\u24DD\uFF4E\u01F9\u0144\xF1\u1E45\u0148\u1E47\u0146\u1E4B\u1E49\u019E\u0272\u0149\uA791\uA7A5"},{base:"nj",letters:"\u01CC"},{base:"o",letters:"o\u24DE\uFF4F\xF2\xF3\xF4\u1ED3\u1ED1\u1ED7\u1ED5\xF5\u1E4D\u022D\u1E4F\u014D\u1E51\u1E53\u014F\u022F\u0231\xF6\u022B\u1ECF\u0151\u01D2\u020D\u020F\u01A1\u1EDD\u1EDB\u1EE1\u1EDF\u1EE3\u1ECD\u1ED9\u01EB\u01ED\xF8\u01FF\u0254\uA74B\uA74D\u0275"},{base:"oi",letters:"\u01A3"},{base:"ou",letters:"\u0223"},{base:"oo",letters:"\uA74F"},{base:"p",letters:"p\u24DF\uFF50\u1E55\u1E57\u01A5\u1D7D\uA751\uA753\uA755"},{base:"q",letters:"q\u24E0\uFF51\u024B\uA757\uA759"},{base:"r",letters:"r\u24E1\uFF52\u0155\u1E59\u0159\u0211\u0213\u1E5B\u1E5D\u0157\u1E5F\u024D\u027D\uA75B\uA7A7\uA783"},{base:"s",letters:"s\u24E2\uFF53\xDF\u015B\u1E65\u015D\u1E61\u0161\u1E67\u1E63\u1E69\u0219\u015F\u023F\uA7A9\uA785\u1E9B"},{base:"t",letters:"t\u24E3\uFF54\u1E6B\u1E97\u0165\u1E6D\u021B\u0163\u1E71\u1E6F\u0167\u01AD\u0288\u2C66\uA787"},{base:"tz",letters:"\uA729"},{base:"u",letters:"u\u24E4\uFF55\xF9\xFA\xFB\u0169\u1E79\u016B\u1E7B\u016D\xFC\u01DC\u01D8\u01D6\u01DA\u1EE7\u016F\u0171\u01D4\u0215\u0217\u01B0\u1EEB\u1EE9\u1EEF\u1EED\u1EF1\u1EE5\u1E73\u0173\u1E77\u1E75\u0289"},{base:"v",letters:"v\u24E5\uFF56\u1E7D\u1E7F\u028B\uA75F\u028C"},{base:"vy",letters:"\uA761"},{base:"w",letters:"w\u24E6\uFF57\u1E81\u1E83\u0175\u1E87\u1E85\u1E98\u1E89\u2C73"},{base:"x",letters:"x\u24E7\uFF58\u1E8B\u1E8D"},{base:"y",letters:"y\u24E8\uFF59\u1EF3\xFD\u0177\u1EF9\u0233\u1E8F\xFF\u1EF7\u1E99\u1EF5\u01B4\u024F\u1EFF"},{base:"z",letters:"z\u24E9\uFF5A\u017A\u1E91\u017C\u017E\u1E93\u1E95\u01B6\u0225\u0240\u2C6C\uA763"}],D2=new RegExp("["+nf.map(function(e){return e.letters}).join("")+"]","g"),j0={};for(gl=0;gl-1}},L2=["innerRef"];function W2(e){var t=e.innerRef,n=en(e,L2),r=e0(n,"onExited","in","enter","exit","appear");return(0,Xt.jsx)("input",Y({ref:t},r,{css:(0,Xt.css)({label:"dummyInput",background:0,border:0,caretColor:"transparent",fontSize:"inherit",gridArea:"1 / 1 / 2 / 3",outline:0,padding:0,width:1,color:"transparent",left:-100,opacity:0,position:"relative",transform:"scale(.01)"},"","")}))}var Y2=function(t){t.preventDefault(),t.stopPropagation()};function z2(e){var t=e.isEnabled,n=e.onBottomArrive,r=e.onBottomLeave,i=e.onTopArrive,a=e.onTopLeave,l=(0,le.useRef)(!1),u=(0,le.useRef)(!1),d=(0,le.useRef)(0),h=(0,le.useRef)(null),m=(0,le.useCallback)(function(N,v){if(h.current!==null){var g=h.current,I=g.scrollTop,E=g.scrollHeight,P=g.clientHeight,M=h.current,F=v>0,T=E-P-I,D=!1;T>v&&l.current&&(r&&r(N),l.current=!1),F&&u.current&&(a&&a(N),u.current=!1),F&&v>T?(n&&!l.current&&n(N),M.scrollTop=E,D=!0,l.current=!0):!F&&-v>I&&(i&&!u.current&&i(N),M.scrollTop=0,D=!0,u.current=!0),D&&Y2(N)}},[n,r,i,a]),C=(0,le.useCallback)(function(N){m(N,N.deltaY)},[m]),S=(0,le.useCallback)(function(N){d.current=N.changedTouches[0].clientY},[]),x=(0,le.useCallback)(function(N){var v=d.current-N.changedTouches[0].clientY;m(N,v)},[m]),w=(0,le.useCallback)(function(N){if(!!N){var v=Kv?{passive:!1}:!1;N.addEventListener("wheel",C,v),N.addEventListener("touchstart",S,v),N.addEventListener("touchmove",x,v)}},[x,S,C]),k=(0,le.useCallback)(function(N){!N||(N.removeEventListener("wheel",C,!1),N.removeEventListener("touchstart",S,!1),N.removeEventListener("touchmove",x,!1))},[x,S,C]);return(0,le.useEffect)(function(){if(!!t){var N=h.current;return w(N),function(){k(N)}}},[t,w,k]),function(N){h.current=N}}var V0=["boxSizing","height","overflow","paddingRight","position"],B0={boxSizing:"border-box",overflow:"hidden",position:"relative",height:"100%"};function L0(e){e.preventDefault()}function W0(e){e.stopPropagation()}function Y0(){var e=this.scrollTop,t=this.scrollHeight,n=e+this.offsetHeight;e===0?this.scrollTop=1:n===t&&(this.scrollTop=e-1)}function z0(){return"ontouchstart"in window||navigator.maxTouchPoints}var H0=!!(typeof window!="undefined"&&window.document&&window.document.createElement),na=0,zi={capture:!1,passive:!1};function H2(e){var t=e.isEnabled,n=e.accountForScrollbars,r=n===void 0?!0:n,i=(0,le.useRef)({}),a=(0,le.useRef)(null),l=(0,le.useCallback)(function(d){if(!!H0){var h=document.body,m=h&&h.style;if(r&&V0.forEach(function(w){var k=m&&m[w];i.current[w]=k}),r&&na<1){var C=parseInt(i.current.paddingRight,10)||0,S=document.body?document.body.clientWidth:0,x=window.innerWidth-S+C||0;Object.keys(B0).forEach(function(w){var k=B0[w];m&&(m[w]=k)}),m&&(m.paddingRight="".concat(x,"px"))}h&&z0()&&(h.addEventListener("touchmove",L0,zi),d&&(d.addEventListener("touchstart",Y0,zi),d.addEventListener("touchmove",W0,zi))),na+=1}},[r]),u=(0,le.useCallback)(function(d){if(!!H0){var h=document.body,m=h&&h.style;na=Math.max(na-1,0),r&&na<1&&V0.forEach(function(C){var S=i.current[C];m&&(m[C]=S)}),h&&z0()&&(h.removeEventListener("touchmove",L0,zi),d&&(d.removeEventListener("touchstart",Y0,zi),d.removeEventListener("touchmove",W0,zi)))}},[r]);return(0,le.useEffect)(function(){if(!!t){var d=a.current;return l(d),function(){u(d)}}},[t,l,u]),function(d){a.current=d}}var Z2=function(){return document.activeElement&&document.activeElement.blur()},X2={name:"1kfdb0e",styles:"position:fixed;left:0;bottom:0;right:0;top:0"};function j2(e){var t=e.children,n=e.lockEnabled,r=e.captureEnabled,i=r===void 0?!0:r,a=e.onBottomArrive,l=e.onBottomLeave,u=e.onTopArrive,d=e.onTopLeave,h=z2({isEnabled:i,onBottomArrive:a,onBottomLeave:l,onTopArrive:u,onTopLeave:d}),m=H2({isEnabled:n}),C=function(x){h(x),m(x)};return(0,Xt.jsx)(le.Fragment,null,n&&(0,Xt.jsx)("div",{onClick:Z2,css:X2}),t(C))}var U2=function(t){return t.label},rf=function(t){return t.label},of=function(t){return t.value},J2=function(t){return!!t.isDisabled},Q2={clearIndicator:v0,container:c0,control:I0,dropdownIndicator:g0,group:S0,groupHeading:w0,indicatorsContainer:f0,indicatorSeparator:y0,input:x0,loadingIndicator:C0,loadingMessage:a0,menu:t0,menuList:r0,menuPortal:u0,multiValue:k0,multiValueLabel:A0,multiValueRemove:N0,noOptionsMessage:o0,option:P0,placeholder:T0,singleValue:F0,valueContainer:d0};var $2={primary:"#2684FF",primary75:"#4C9AFF",primary50:"#B2D4FF",primary25:"#DEEBFF",danger:"#DE350B",dangerLight:"#FFBDAD",neutral0:"hsl(0, 0%, 100%)",neutral5:"hsl(0, 0%, 95%)",neutral10:"hsl(0, 0%, 90%)",neutral20:"hsl(0, 0%, 80%)",neutral30:"hsl(0, 0%, 70%)",neutral40:"hsl(0, 0%, 60%)",neutral50:"hsl(0, 0%, 50%)",neutral60:"hsl(0, 0%, 40%)",neutral70:"hsl(0, 0%, 30%)",neutral80:"hsl(0, 0%, 20%)",neutral90:"hsl(0, 0%, 10%)"},K2=4,J0=4,q2=38,eE=J0*2,tE={baseUnit:J0,controlHeight:q2,menuGutter:eE},tf={borderRadius:K2,colors:$2,spacing:tE},nE={"aria-live":"polite",backspaceRemovesValue:!0,blurInputOnSelect:Jd(),captureMenuScroll:!Jd(),closeMenuOnSelect:!0,closeMenuOnScroll:!1,components:{},controlShouldRenderValue:!0,escapeClearsValue:!1,filterOption:B2(),formatGroupLabel:U2,getOptionLabel:rf,getOptionValue:of,isDisabled:!1,isLoading:!1,isMulti:!1,isRtl:!1,isSearchable:!0,isOptionDisabled:J2,loadingMessage:function(){return"Loading..."},maxMenuHeight:300,minMenuHeight:140,menuIsOpen:!1,menuPlacement:"bottom",menuPosition:"absolute",menuShouldBlockScroll:!1,menuShouldScrollIntoView:!Qv(),noOptionsMessage:function(){return"No options"},openMenuOnFocus:!1,openMenuOnClick:!0,options:[],pageSize:5,placeholder:"Select...",screenReaderStatus:function(t){var n=t.count;return"".concat(n," result").concat(n!==1?"s":""," available")},styles:{},tabIndex:0,tabSelectsValue:!0};function Z0(e,t,n,r){var i=q0(e,t,n),a=ey(e,t,n),l=K0(e,t),u=Cl(e,t);return{type:"option",data:t,isDisabled:i,isSelected:a,label:l,value:u,index:r}}function Q0(e,t){return e.options.map(function(n,r){if("options"in n){var i=n.options.map(function(l,u){return Z0(e,l,t,u)}).filter(function(l){return X0(e,l)});return i.length>0?{type:"group",data:n,options:i,index:r}:void 0}var a=Z0(e,n,t,r);return X0(e,a)?a:void 0}).filter(qv)}function $0(e){return e.reduce(function(t,n){return n.type==="group"?t.push.apply(t,Ar(n.options.map(function(r){return r.data}))):t.push(n.data),t},[])}function rE(e,t){return $0(Q0(e,t))}function X0(e,t){var n=e.inputValue,r=n===void 0?"":n,i=t.data,a=t.isSelected,l=t.label,u=t.value;return(!ny(e)||!a)&&ty(e,{label:l,value:u,data:i},r)}function iE(e,t){var n=e.focusedValue,r=e.selectValue,i=r.indexOf(n);if(i>-1){var a=t.indexOf(n);if(a>-1)return n;if(i-1?n:t[0]}var K0=function(t,n){return t.getOptionLabel(n)},Cl=function(t,n){return t.getOptionValue(n)};function q0(e,t,n){return typeof e.isOptionDisabled=="function"?e.isOptionDisabled(t,n):!1}function ey(e,t,n){if(n.indexOf(t)>-1)return!0;if(typeof e.isOptionSelected=="function")return e.isOptionSelected(t,n);var r=Cl(e,t);return n.some(function(i){return Cl(e,i)===r})}function ty(e,t,n){return e.filterOption?e.filterOption(t,n):!0}var ny=function(t){var n=t.hideSelectedOptions,r=t.isMulti;return n===void 0?r:n},aE=1,af=function(e){Wi(n,e);var t=ml(n);function n(r){var i;return Bi(this,n),i=t.call(this,r),i.state={ariaSelection:null,focusedOption:null,focusedValue:null,inputIsHidden:!1,isFocused:!1,selectValue:[],clearFocusValueOnUpdate:!1,prevWasFocused:!1,inputIsHiddenAfterUpdate:void 0,prevProps:void 0},i.blockOptionHover=!1,i.isComposing=!1,i.commonProps=void 0,i.initialTouchX=0,i.initialTouchY=0,i.instancePrefix="",i.openAfterFocus=!1,i.scrollToFocusedOptionOnUpdate=!1,i.userIsDragging=void 0,i.controlRef=null,i.getControlRef=function(a){i.controlRef=a},i.focusedOptionRef=null,i.getFocusedOptionRef=function(a){i.focusedOptionRef=a},i.menuListRef=null,i.getMenuListRef=function(a){i.menuListRef=a},i.inputRef=null,i.getInputRef=function(a){i.inputRef=a},i.focus=i.focusInput,i.blur=i.blurInput,i.onChange=function(a,l){var u=i.props,d=u.onChange,h=u.name;l.name=h,i.ariaOnChange(a,l),d(a,l)},i.setValue=function(a,l,u){var d=i.props,h=d.closeMenuOnSelect,m=d.isMulti,C=d.inputValue;i.onInputChange("",{action:"set-value",prevInputValue:C}),h&&(i.setState({inputIsHiddenAfterUpdate:!m}),i.onMenuClose()),i.setState({clearFocusValueOnUpdate:!0}),i.onChange(a,{action:l,option:u})},i.selectOption=function(a){var l=i.props,u=l.blurInputOnSelect,d=l.isMulti,h=l.name,m=i.state.selectValue,C=d&&i.isOptionSelected(a,m),S=i.isOptionDisabled(a,m);if(C){var x=i.getOptionValue(a);i.setValue(m.filter(function(w){return i.getOptionValue(w)!==x}),"deselect-option",a)}else if(!S)d?i.setValue([].concat(Ar(m),[a]),"select-option",a):i.setValue(a,"select-option");else{i.ariaOnChange(a,{action:"select-option",option:a,name:h});return}u&&i.blurInput()},i.removeValue=function(a){var l=i.props.isMulti,u=i.state.selectValue,d=i.getOptionValue(a),h=u.filter(function(C){return i.getOptionValue(C)!==d}),m=Kr(l,h,h[0]||null);i.onChange(m,{action:"remove-value",removedValue:a}),i.focusInput()},i.clearValue=function(){var a=i.state.selectValue;i.onChange(Kr(i.props.isMulti,[],null),{action:"clear",removedValues:a})},i.popValue=function(){var a=i.props.isMulti,l=i.state.selectValue,u=l[l.length-1],d=l.slice(0,l.length-1),h=Kr(a,d,d[0]||null);i.onChange(h,{action:"pop-value",removedValue:u})},i.getValue=function(){return i.state.selectValue},i.cx=function(){for(var a=arguments.length,l=new Array(a),u=0;um||h>m}},i.onTouchEnd=function(a){i.userIsDragging||(i.controlRef&&!i.controlRef.contains(a.target)&&i.menuListRef&&!i.menuListRef.contains(a.target)&&i.blurInput(),i.initialTouchX=0,i.initialTouchY=0)},i.onControlTouchEnd=function(a){i.userIsDragging||i.onControlMouseDown(a)},i.onClearIndicatorTouchEnd=function(a){i.userIsDragging||i.onClearIndicatorMouseDown(a)},i.onDropdownIndicatorTouchEnd=function(a){i.userIsDragging||i.onDropdownIndicatorMouseDown(a)},i.handleInputChange=function(a){var l=i.props.inputValue,u=a.currentTarget.value;i.setState({inputIsHiddenAfterUpdate:!1}),i.onInputChange(u,{action:"input-change",prevInputValue:l}),i.props.menuIsOpen||i.onMenuOpen()},i.onInputFocus=function(a){i.props.onFocus&&i.props.onFocus(a),i.setState({inputIsHiddenAfterUpdate:!1,isFocused:!0}),(i.openAfterFocus||i.props.openMenuOnFocus)&&i.openMenu("first"),i.openAfterFocus=!1},i.onInputBlur=function(a){var l=i.props.inputValue;if(i.menuListRef&&i.menuListRef.contains(document.activeElement)){i.inputRef.focus();return}i.props.onBlur&&i.props.onBlur(a),i.onInputChange("",{action:"input-blur",prevInputValue:l}),i.onMenuClose(),i.setState({focusedValue:null,isFocused:!1})},i.onOptionHover=function(a){i.blockOptionHover||i.state.focusedOption===a||i.setState({focusedOption:a})},i.shouldHideSelectedOptions=function(){return ny(i.props)},i.onKeyDown=function(a){var l=i.props,u=l.isMulti,d=l.backspaceRemovesValue,h=l.escapeClearsValue,m=l.inputValue,C=l.isClearable,S=l.isDisabled,x=l.menuIsOpen,w=l.onKeyDown,k=l.tabSelectsValue,N=l.openMenuOnFocus,v=i.state,g=v.focusedOption,I=v.focusedValue,E=v.selectValue;if(!S&&!(typeof w=="function"&&(w(a),a.defaultPrevented))){switch(i.blockOptionHover=!0,a.key){case"ArrowLeft":if(!u||m)return;i.focusValue("previous");break;case"ArrowRight":if(!u||m)return;i.focusValue("next");break;case"Delete":case"Backspace":if(m)return;if(I)i.removeValue(I);else{if(!d)return;u?i.popValue():C&&i.clearValue()}break;case"Tab":if(i.isComposing||a.shiftKey||!x||!k||!g||N&&i.isOptionSelected(g,E))return;i.selectOption(g);break;case"Enter":if(a.keyCode===229)break;if(x){if(!g||i.isComposing)return;i.selectOption(g);break}return;case"Escape":x?(i.setState({inputIsHiddenAfterUpdate:!1}),i.onInputChange("",{action:"menu-close",prevInputValue:m}),i.onMenuClose()):C&&h&&i.clearValue();break;case" ":if(m)return;if(!x){i.openMenu("first");break}if(!g)return;i.selectOption(g);break;case"ArrowUp":x?i.focusOption("up"):i.openMenu("last");break;case"ArrowDown":x?i.focusOption("down"):i.openMenu("first");break;case"PageUp":if(!x)return;i.focusOption("pageup");break;case"PageDown":if(!x)return;i.focusOption("pagedown");break;case"Home":if(!x)return;i.focusOption("first");break;case"End":if(!x)return;i.focusOption("last");break;default:return}a.preventDefault()}},i.instancePrefix="react-select-"+(i.props.instanceId||++aE),i.state.selectValue=Yi(r.value),i}return Li(n,[{key:"componentDidMount",value:function(){this.startListeningComposition(),this.startListeningToTouch(),this.props.closeMenuOnScroll&&document&&document.addEventListener&&document.addEventListener("scroll",this.onScroll,!0),this.props.autoFocus&&this.focusInput()}},{key:"componentDidUpdate",value:function(i){var a=this.props,l=a.isDisabled,u=a.menuIsOpen,d=this.state.isFocused;(d&&!l&&i.isDisabled||d&&u&&!i.menuIsOpen)&&this.focusInput(),d&&l&&!i.isDisabled&&this.setState({isFocused:!1},this.onMenuClose),this.menuListRef&&this.focusedOptionRef&&this.scrollToFocusedOptionOnUpdate&&(Jv(this.menuListRef,this.focusedOptionRef),this.scrollToFocusedOptionOnUpdate=!1)}},{key:"componentWillUnmount",value:function(){this.stopListeningComposition(),this.stopListeningToTouch(),document.removeEventListener("scroll",this.onScroll,!0)}},{key:"onMenuOpen",value:function(){this.props.onMenuOpen()}},{key:"onMenuClose",value:function(){this.onInputChange("",{action:"menu-close",prevInputValue:this.props.inputValue}),this.props.onMenuClose()}},{key:"onInputChange",value:function(i,a){this.props.onInputChange(i,a)}},{key:"focusInput",value:function(){!this.inputRef||this.inputRef.focus()}},{key:"blurInput",value:function(){!this.inputRef||this.inputRef.blur()}},{key:"openMenu",value:function(i){var a=this,l=this.state,u=l.selectValue,d=l.isFocused,h=this.buildFocusableOptions(),m=i==="first"?0:h.length-1;if(!this.props.isMulti){var C=h.indexOf(u[0]);C>-1&&(m=C)}this.scrollToFocusedOptionOnUpdate=!(d&&this.menuListRef),this.setState({inputIsHiddenAfterUpdate:!1,focusedValue:null,focusedOption:h[m]},function(){return a.onMenuOpen()})}},{key:"focusValue",value:function(i){var a=this.state,l=a.selectValue,u=a.focusedValue;if(!!this.props.isMulti){this.setState({focusedOption:null});var d=l.indexOf(u);u||(d=-1);var h=l.length-1,m=-1;if(!!l.length){switch(i){case"previous":d===0?m=0:d===-1?m=h:m=d-1;break;case"next":d>-1&&d0&&arguments[0]!==void 0?arguments[0]:"first",a=this.props.pageSize,l=this.state.focusedOption,u=this.getFocusableOptions();if(!!u.length){var d=0,h=u.indexOf(l);l||(h=-1),i==="up"?d=h>0?h-1:u.length-1:i==="down"?d=(h+1)%u.length:i==="pageup"?(d=h-a,d<0&&(d=0)):i==="pagedown"?(d=h+a,d>u.length-1&&(d=u.length-1)):i==="last"&&(d=u.length-1),this.scrollToFocusedOptionOnUpdate=!0,this.setState({focusedOption:u[d],focusedValue:null})}}},{key:"getTheme",value:function(){return this.props.theme?typeof this.props.theme=="function"?this.props.theme(tf):ue(ue({},tf),this.props.theme):tf}},{key:"getCommonProps",value:function(){var i=this.clearValue,a=this.cx,l=this.getStyles,u=this.getValue,d=this.selectOption,h=this.setValue,m=this.props,C=m.isMulti,S=m.isRtl,x=m.options,w=this.hasValue();return{clearValue:i,cx:a,getStyles:l,getValue:u,hasValue:w,isMulti:C,isRtl:S,options:x,selectOption:d,selectProps:m,setValue:h,theme:this.getTheme()}}},{key:"hasValue",value:function(){var i=this.state.selectValue;return i.length>0}},{key:"hasOptions",value:function(){return!!this.getFocusableOptions().length}},{key:"isClearable",value:function(){var i=this.props,a=i.isClearable,l=i.isMulti;return a===void 0?l:a}},{key:"isOptionDisabled",value:function(i,a){return q0(this.props,i,a)}},{key:"isOptionSelected",value:function(i,a){return ey(this.props,i,a)}},{key:"filterOption",value:function(i,a){return ty(this.props,i,a)}},{key:"formatOptionLabel",value:function(i,a){if(typeof this.props.formatOptionLabel=="function"){var l=this.props.inputValue,u=this.state.selectValue;return this.props.formatOptionLabel(i,{context:a,inputValue:l,selectValue:u})}else return this.getOptionLabel(i)}},{key:"formatGroupLabel",value:function(i){return this.props.formatGroupLabel(i)}},{key:"startListeningComposition",value:function(){document&&document.addEventListener&&(document.addEventListener("compositionstart",this.onCompositionStart,!1),document.addEventListener("compositionend",this.onCompositionEnd,!1))}},{key:"stopListeningComposition",value:function(){document&&document.removeEventListener&&(document.removeEventListener("compositionstart",this.onCompositionStart),document.removeEventListener("compositionend",this.onCompositionEnd))}},{key:"startListeningToTouch",value:function(){document&&document.addEventListener&&(document.addEventListener("touchstart",this.onTouchStart,!1),document.addEventListener("touchmove",this.onTouchMove,!1),document.addEventListener("touchend",this.onTouchEnd,!1))}},{key:"stopListeningToTouch",value:function(){document&&document.removeEventListener&&(document.removeEventListener("touchstart",this.onTouchStart),document.removeEventListener("touchmove",this.onTouchMove),document.removeEventListener("touchend",this.onTouchEnd))}},{key:"renderInput",value:function(){var i=this.props,a=i.isDisabled,l=i.isSearchable,u=i.inputId,d=i.inputValue,h=i.tabIndex,m=i.form,C=i.menuIsOpen,S=this.getComponents(),x=S.Input,w=this.state,k=w.inputIsHidden,N=w.ariaSelection,v=this.commonProps,g=u||this.getElementId("input"),I=ue(ue(ue({"aria-autocomplete":"list","aria-expanded":C,"aria-haspopup":!0,"aria-errormessage":this.props["aria-errormessage"],"aria-invalid":this.props["aria-invalid"],"aria-label":this.props["aria-label"],"aria-labelledby":this.props["aria-labelledby"],role:"combobox"},C&&{"aria-controls":this.getElementId("listbox"),"aria-owns":this.getElementId("listbox")}),!l&&{"aria-readonly":!0}),this.hasValue()?(N==null?void 0:N.action)==="initial-input-focus"&&{"aria-describedby":this.getElementId("live-region")}:{"aria-describedby":this.getElementId("placeholder")});return l?he.createElement(x,Y({},v,{autoCapitalize:"none",autoComplete:"off",autoCorrect:"off",id:g,innerRef:this.getInputRef,isDisabled:a,isHidden:k,onBlur:this.onInputBlur,onChange:this.handleInputChange,onFocus:this.onInputFocus,spellCheck:"false",tabIndex:h,form:m,type:"text",value:d},I)):he.createElement(W2,Y({id:g,innerRef:this.getInputRef,onBlur:this.onInputBlur,onChange:qo,onFocus:this.onInputFocus,disabled:a,tabIndex:h,inputMode:"none",form:m,value:""},I))}},{key:"renderPlaceholderOrValue",value:function(){var i=this,a=this.getComponents(),l=a.MultiValue,u=a.MultiValueContainer,d=a.MultiValueLabel,h=a.MultiValueRemove,m=a.SingleValue,C=a.Placeholder,S=this.commonProps,x=this.props,w=x.controlShouldRenderValue,k=x.isDisabled,N=x.isMulti,v=x.inputValue,g=x.placeholder,I=this.state,E=I.selectValue,P=I.focusedValue,M=I.isFocused;if(!this.hasValue()||!w)return v?null:he.createElement(C,Y({},S,{key:"placeholder",isDisabled:k,isFocused:M,innerProps:{id:this.getElementId("placeholder")}}),g);if(N)return E.map(function(T,D){var L=T===P,z="".concat(i.getOptionLabel(T),"-").concat(i.getOptionValue(T));return he.createElement(l,Y({},S,{components:{Container:u,Label:d,Remove:h},isFocused:L,isDisabled:k,key:z,index:D,removeProps:{onClick:function(){return i.removeValue(T)},onTouchEnd:function(){return i.removeValue(T)},onMouseDown:function(q){q.preventDefault()}},data:T}),i.formatOptionLabel(T,"value"))});if(v)return null;var F=E[0];return he.createElement(m,Y({},S,{data:F,isDisabled:k}),this.formatOptionLabel(F,"value"))}},{key:"renderClearIndicator",value:function(){var i=this.getComponents(),a=i.ClearIndicator,l=this.commonProps,u=this.props,d=u.isDisabled,h=u.isLoading,m=this.state.isFocused;if(!this.isClearable()||!a||d||!this.hasValue()||h)return null;var C={onMouseDown:this.onClearIndicatorMouseDown,onTouchEnd:this.onClearIndicatorTouchEnd,"aria-hidden":"true"};return he.createElement(a,Y({},l,{innerProps:C,isFocused:m}))}},{key:"renderLoadingIndicator",value:function(){var i=this.getComponents(),a=i.LoadingIndicator,l=this.commonProps,u=this.props,d=u.isDisabled,h=u.isLoading,m=this.state.isFocused;if(!a||!h)return null;var C={"aria-hidden":"true"};return he.createElement(a,Y({},l,{innerProps:C,isDisabled:d,isFocused:m}))}},{key:"renderIndicatorSeparator",value:function(){var i=this.getComponents(),a=i.DropdownIndicator,l=i.IndicatorSeparator;if(!a||!l)return null;var u=this.commonProps,d=this.props.isDisabled,h=this.state.isFocused;return he.createElement(l,Y({},u,{isDisabled:d,isFocused:h}))}},{key:"renderDropdownIndicator",value:function(){var i=this.getComponents(),a=i.DropdownIndicator;if(!a)return null;var l=this.commonProps,u=this.props.isDisabled,d=this.state.isFocused,h={onMouseDown:this.onDropdownIndicatorMouseDown,onTouchEnd:this.onDropdownIndicatorTouchEnd,"aria-hidden":"true"};return he.createElement(a,Y({},l,{innerProps:h,isDisabled:u,isFocused:d}))}},{key:"renderMenu",value:function(){var i=this,a=this.getComponents(),l=a.Group,u=a.GroupHeading,d=a.Menu,h=a.MenuList,m=a.MenuPortal,C=a.LoadingMessage,S=a.NoOptionsMessage,x=a.Option,w=this.commonProps,k=this.state.focusedOption,N=this.props,v=N.captureMenuScroll,g=N.inputValue,I=N.isLoading,E=N.loadingMessage,P=N.minMenuHeight,M=N.maxMenuHeight,F=N.menuIsOpen,T=N.menuPlacement,D=N.menuPosition,L=N.menuPortalTarget,z=N.menuShouldBlockScroll,ae=N.menuShouldScrollIntoView,q=N.noOptionsMessage,se=N.onMenuScrollToTop,$=N.onMenuScrollToBottom;if(!F)return null;var Be=function(G,it){var ot=G.type,Le=G.data,Ke=G.isDisabled,Ot=G.isSelected,Mn=G.label,qr=G.value,Nr=k===Le,Mr=Ke?void 0:function(){return i.onOptionHover(Le)},tr=Ke?void 0:function(){return i.selectOption(Le)},Pr="".concat(i.getElementId("option"),"-").concat(it),Tr={id:Pr,onClick:tr,onMouseMove:Mr,onMouseOver:Mr,tabIndex:-1};return he.createElement(x,Y({},w,{innerProps:Tr,data:Le,isDisabled:Ke,isSelected:Ot,key:Pr,label:Mn,type:ot,value:qr,isFocused:Nr,innerRef:Nr?i.getFocusedOptionRef:void 0}),i.formatOptionLabel(G.data,"menu"))},_e;if(this.hasOptions())_e=this.getCategorizedOptions().map(function(ie){if(ie.type==="group"){var G=ie.data,it=ie.options,ot=ie.index,Le="".concat(i.getElementId("group"),"-").concat(ot),Ke="".concat(Le,"-heading");return he.createElement(l,Y({},w,{key:Le,data:G,options:it,Heading:u,headingProps:{id:Ke,data:ie.data},label:i.formatGroupLabel(ie.data)}),ie.options.map(function(Ot){return Be(Ot,"".concat(ot,"-").concat(Ot.index))}))}else if(ie.type==="option")return Be(ie,"".concat(ie.index))});else if(I){var me=E({inputValue:g});if(me===null)return null;_e=he.createElement(C,w,me)}else{var yt=q({inputValue:g});if(yt===null)return null;_e=he.createElement(S,w,yt)}var rt={minMenuHeight:P,maxMenuHeight:M,menuPlacement:T,menuPosition:D,menuShouldScrollIntoView:ae},Ie=he.createElement(Qd,Y({},w,rt),function(ie){var G=ie.ref,it=ie.placerProps,ot=it.placement,Le=it.maxHeight;return he.createElement(d,Y({},w,rt,{innerRef:G,innerProps:{onMouseDown:i.onMenuMouseDown,onMouseMove:i.onMenuMouseMove,id:i.getElementId("listbox")},isLoading:I,placement:ot}),he.createElement(j2,{captureEnabled:v,onTopArrive:se,onBottomArrive:$,lockEnabled:z},function(Ke){return he.createElement(h,Y({},w,{innerRef:function(Mn){i.getMenuListRef(Mn),Ke(Mn)},isLoading:I,maxHeight:Le,focusedOption:k}),_e)}))});return L||D==="fixed"?he.createElement(m,Y({},w,{appendTo:L,controlElement:this.controlRef,menuPlacement:T,menuPosition:D}),Ie):Ie}},{key:"renderFormField",value:function(){var i=this,a=this.props,l=a.delimiter,u=a.isDisabled,d=a.isMulti,h=a.name,m=this.state.selectValue;if(!(!h||u))if(d)if(l){var C=m.map(function(w){return i.getOptionValue(w)}).join(l);return he.createElement("input",{name:h,type:"hidden",value:C})}else{var S=m.length>0?m.map(function(w,k){return he.createElement("input",{key:"i-".concat(k),name:h,type:"hidden",value:i.getOptionValue(w)})}):he.createElement("input",{name:h,type:"hidden"});return he.createElement("div",null,S)}else{var x=m[0]?this.getOptionValue(m[0]):"";return he.createElement("input",{name:h,type:"hidden",value:x})}}},{key:"renderLiveRegion",value:function(){var i=this.commonProps,a=this.state,l=a.ariaSelection,u=a.focusedOption,d=a.focusedValue,h=a.isFocused,m=a.selectValue,C=this.getFocusableOptions();return he.createElement(R2,Y({},i,{id:this.getElementId("live-region"),ariaSelection:l,focusedOption:u,focusedValue:d,isFocused:h,selectValue:m,focusableOptions:C}))}},{key:"render",value:function(){var i=this.getComponents(),a=i.Control,l=i.IndicatorsContainer,u=i.SelectContainer,d=i.ValueContainer,h=this.props,m=h.className,C=h.id,S=h.isDisabled,x=h.menuIsOpen,w=this.state.isFocused,k=this.commonProps=this.getCommonProps();return he.createElement(u,Y({},k,{className:m,innerProps:{id:C,onKeyDown:this.onKeyDown},isDisabled:S,isFocused:w}),this.renderLiveRegion(),he.createElement(a,Y({},k,{innerRef:this.getControlRef,innerProps:{onMouseDown:this.onControlMouseDown,onTouchEnd:this.onControlTouchEnd},isDisabled:S,isFocused:w,menuIsOpen:x}),he.createElement(d,Y({},k,{isDisabled:S}),this.renderPlaceholderOrValue(),this.renderInput()),he.createElement(l,Y({},k,{isDisabled:S}),this.renderClearIndicator(),this.renderLoadingIndicator(),this.renderIndicatorSeparator(),this.renderDropdownIndicator())),this.renderMenu(),this.renderFormField())}}],[{key:"getDerivedStateFromProps",value:function(i,a){var l=a.prevProps,u=a.clearFocusValueOnUpdate,d=a.inputIsHiddenAfterUpdate,h=a.ariaSelection,m=a.isFocused,C=a.prevWasFocused,S=i.options,x=i.value,w=i.menuIsOpen,k=i.inputValue,N=i.isMulti,v=Yi(x),g={};if(l&&(x!==l.value||S!==l.options||w!==l.menuIsOpen||k!==l.inputValue)){var I=w?rE(i,v):[],E=u?iE(a,v):null,P=oE(a,I);g={selectValue:v,focusedOption:P,focusedValue:E,clearFocusValueOnUpdate:!1}}var M=d!=null&&i!==l?{inputIsHidden:d,inputIsHiddenAfterUpdate:void 0}:{},F=h,T=m&&C;return m&&!T&&(F={value:Kr(N,v,v[0]||null),options:v,action:"initial-input-focus"},T=!C),(h==null?void 0:h.action)==="initial-input-focus"&&(F=null),ue(ue(ue({},g),M),{},{prevProps:i,ariaSelection:F,prevWasFocused:T})}}]),n}(le.Component);af.defaultProps=nE;var er=we(De()),sE=["defaultInputValue","defaultMenuIsOpen","defaultValue","inputValue","menuIsOpen","onChange","onInputChange","onMenuClose","onMenuOpen","value"];function ry(e){var t=e.defaultInputValue,n=t===void 0?"":t,r=e.defaultMenuIsOpen,i=r===void 0?!1:r,a=e.defaultValue,l=a===void 0?null:a,u=e.inputValue,d=e.menuIsOpen,h=e.onChange,m=e.onInputChange,C=e.onMenuClose,S=e.onMenuOpen,x=e.value,w=en(e,sE),k=(0,er.useState)(u!==void 0?u:n),N=kr(k,2),v=N[0],g=N[1],I=(0,er.useState)(d!==void 0?d:i),E=kr(I,2),P=E[0],M=E[1],F=(0,er.useState)(x!==void 0?x:l),T=kr(F,2),D=T[0],L=T[1],z=(0,er.useCallback)(function(me,yt){typeof h=="function"&&h(me,yt),L(me)},[h]),ae=(0,er.useCallback)(function(me,yt){var rt;typeof m=="function"&&(rt=m(me,yt)),g(rt!==void 0?rt:me)},[m]),q=(0,er.useCallback)(function(){typeof S=="function"&&S(),M(!0)},[S]),se=(0,er.useCallback)(function(){typeof C=="function"&&C(),M(!1)},[C]),$=u!==void 0?u:v,Be=d!==void 0?d:P,_e=x!==void 0?x:D;return ue(ue({},w),{},{inputValue:$,menuIsOpen:Be,onChange:z,onInputChange:ae,onMenuClose:se,onMenuOpen:q,value:_e})}var ra=we(De());var lE=["allowCreateWhileLoading","createOptionPosition","formatCreateLabel","isValidNewOption","getNewOptionData","onCreateOption","options","onChange"],iy=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",n=arguments.length>1?arguments[1]:void 0,r=arguments.length>2?arguments[2]:void 0,i=String(t).toLowerCase(),a=String(r.getOptionValue(n)).toLowerCase(),l=String(r.getOptionLabel(n)).toLowerCase();return a===i||l===i},sf={formatCreateLabel:function(t){return'Create "'.concat(t,'"')},isValidNewOption:function(t,n,r,i){return!(!t||n.some(function(a){return iy(t,a,i)})||r.some(function(a){return iy(t,a,i)}))},getNewOptionData:function(t,n){return{label:n,value:t,__isNew__:!0}}};function oy(e){var t=e.allowCreateWhileLoading,n=t===void 0?!1:t,r=e.createOptionPosition,i=r===void 0?"last":r,a=e.formatCreateLabel,l=a===void 0?sf.formatCreateLabel:a,u=e.isValidNewOption,d=u===void 0?sf.isValidNewOption:u,h=e.getNewOptionData,m=h===void 0?sf.getNewOptionData:h,C=e.onCreateOption,S=e.options,x=S===void 0?[]:S,w=e.onChange,k=en(e,lE),N=k.getOptionValue,v=N===void 0?of:N,g=k.getOptionLabel,I=g===void 0?rf:g,E=k.inputValue,P=k.isLoading,M=k.isMulti,F=k.value,T=k.name,D=(0,ra.useMemo)(function(){return d(E,Yi(F),x,{getOptionValue:v,getOptionLabel:I})?m(E,l(E)):void 0},[l,m,I,v,E,d,x,F]),L=(0,ra.useMemo)(function(){return(n||!P)&&D?i==="first"?[D].concat(Ar(x)):[].concat(Ar(x),[D]):x},[n,i,P,D,x]),z=(0,ra.useCallback)(function(ae,q){if(q.action!=="select-option")return w(ae,q);var se=Array.isArray(ae)?ae:[ae];if(se[se.length-1]===D){if(C)C(E);else{var $=m(E,E),Be={action:"create-option",name:T,option:$};w(Kr(M,[].concat(Ar(Yi(F)),[$]),$),Be)}return}w(ae,q)},[m,E,M,T,D,C,w,F]);return ue(ue({},k),{},{options:L,onChange:z})}var GA=we(Ls());var uE=(0,sy.forwardRef)(function(e,t){var n=ry(e),r=oy(n);return ay.createElement(af,Y({ref:t},r))}),ly=uE;var uy=({options:e,placeholder:t,container:n,onChange:r,onInputChange:i,newLabel:a,value:l})=>{let u=(0,ia.useCallback)(d=>cE({value:d,label:a}),[a]);return ia.default.createElement(ly,{options:e,formatCreateLabel:u,inputValue:l,onChange:r,onInputChange:i,styles:dE,isClearable:!0,placeholder:t,controlShouldRenderValue:!1,menuPortalTarget:n})},cE=({value:e,label:t})=>ia.default.createElement("span",null,t.format(e)),dE={option:(e,t)=>ce(U({},e),{background:t.isFocused?"var(--background-secondary)":"var(--background-primary)",color:"var(--text-normal)","&:hover":ce(U({},e["&:hover"]),{backgroundColor:"var(--background-secondary)"})}),valueContainer:(e,t)=>ce(U({},e),{color:"var(--text-normal)"}),menu:e=>U({},e),menuList:(e,t)=>ce(U({},e),{border:"1px solid var(--background-modifier-border)",backgroundColor:"var(--background-secondary-alt)",color:"var(--text-normal)"}),input:(e,t)=>ce(U({},e),{color:"var(--text-normal)"}),singleValue:(e,t)=>ce(U({},e),{color:"var(--text-normal)"}),control:(e,t)=>ce(U({},e),{background:"var(--background-modifier-form-field)",color:"var(--text-normal)",border:"1px solid var(--background-modifier-border)",boxShadow:"none",width:"300px","&:hover":ce(U({},e["&:hover"]),{borderColor:"var(--background-modifier-border)"}),"&:active":ce(U({},e["&:active"]),{borderColor:"var(--interactive-accent);"}),"&:focus":ce(U({},e["&:focus"]),{borderColor:"var(--interactive-accent);"}),"&:focused":ce(U({},e["&:focused"]),{borderColor:"var(--interactive-accent);"}),"&:focus-within":ce(U({},e["&:focus-within"]),{borderColor:"var(--interactive-accent);"})}),menuPortal:e=>ce(U({},e),{zIndex:"var(--layer-modal)"})};var bl=class extends cy.Modal{constructor(n,r,i){super(n);this.settings=r,this.titleEl.setText("Janitor Excluded Files"),this.onFiltersChanged=i}render(){let n=Vg(this.app).map(r=>({value:r.endsWith("/")?r:r+"/",label:r}));this.root.render(Xe.createElement(Xe.StrictMode,null,Xe.createElement(fE,{filters:this.settings.excludedFilesFilters,folders:n,onCancel:()=>{this.close()},onFilterChanged:r=>{this.close(),this.onFiltersChanged&&this.onFiltersChanged(r)}})))}onOpen(){let{contentEl:n}=this;this.root=(0,dy.createRoot)(n),this.render()}onClose(){this.root.unmount()}},fE=({filters:e,folders:t,onCancel:n,onFilterChanged:r})=>{let[i,a]=(0,Nn.useState)({filters:e,value:""}),l=i.filters,u=(0,Nn.useRef)(null),d=(0,Nn.useCallback)(k=>{a(N=>lf(N.value)?ce(U({},N),{filters:[...N.filters,N.value],value:""}):N)},[]),h=(0,Nn.useCallback)((k,N)=>{(N.action==="select-option"||N.action==="create-option")&&a(v=>lf(k.value)?ce(U({},v),{filters:[...v.filters,k.value],value:""}):v)},[]),m=(0,Nn.useCallback)((k,N)=>{N.action==="input-change"&&a(v=>ce(U({},v),{value:k}))},[]),C=(0,Nn.useCallback)(k=>{a(N=>ce(U({},N),{filters:N.filters.filter((v,g)=>k!==g)}))},[]),S=(0,Nn.useCallback)(()=>{r&&r(i.filters)},[i.filters]),x=lf(i.value),w=x?"Press enter or button to add filter":"insert a valid regular expression";return Xe.createElement("div",{ref:u},Xe.createElement("div",null,"Files matching the following regular expressions are currently ignored:"),l.map((k,N)=>Xe.createElement("div",{key:N,className:"mobile-option-setting-item"},Xe.createElement("span",{className:"mobile-option-setting-item-name"},k),Xe.createElement("span",{className:"mobile-option-setting-item-option-icon",onClick:()=>C(N)},Xe.createElement(Bg,null)))),Xe.createElement(Yg,null,Xe.createElement(Lg,{name:"Filter",description:w}),Xe.createElement(Wg,null,Xe.createElement(uy,{key:e.length,value:i.value,container:document.body,options:t,placeholder:"Insert folder or regex...",newLabel:'Add "{0}"',onChange:h,onInputChange:m}),Xe.createElement("button",{onClick:d,disabled:!x},"Add"))),Xe.createElement("div",{className:"modal-button-container"},Xe.createElement("button",{className:"mod-cta",onClick:S},"Done"),Xe.createElement("button",{onClick:n},"Cancel")))};function lf(e){let t=e.length>0;try{let n=new RegExp(e)}catch(n){t=!1}return t}var vn=require("obsidian"),oa=class extends vn.PluginSettingTab{constructor(n,r){super(n,r);this.plugin=r}display(){let{containerEl:n}=this;n.empty(),n.createEl("h2",{text:"Janitor Settings"}),new vn.Setting(n).setName("Add Ribbon Icon").setDesc("Adds an icon to the ribbon to launch scan").addToggle(i=>i.setValue(this.plugin.settings.addRibbonIcon).onChange(a=>ye(this,null,function*(){this.plugin.settings.addRibbonIcon=a,yield this.plugin.saveSettings(),a?this.plugin.addIcon():this.plugin.removeIcon(),this.display()}))),this.createToggle(n,"Run at Startup","The plugin will perform a scan automatically everytime you open a vault.","runAtStartup"),this.createToggle(n,"Ask Confirmation","The user will be able to select which files to remove","promptUser"),new vn.Setting(n).setName("Always Prompt for big files").setDesc("Always prompt before deleting big files").addToggle(i=>i.setValue(this.plugin.settings.promptForBigFiles).onChange(a=>ye(this,null,function*(){this.plugin.settings.promptForBigFiles=a,yield this.plugin.saveSettings()}))),new vn.Setting(n).setHeading(),this.createToggle(n,"Process Orphans","Remove media and attachments that are not in use","processOrphans"),this.createToggle(n,"Process Empty","Remove empty files or files with only whitespace","processEmpty"),this.createToggle(n,"Process Big Files","Removes files with big dimensions","processBig"),this.plugin.settings.processBig&&new vn.Setting(n).setName("File Size Limit (KB)").setDesc("Files larger than this size will be considered for removal.").addText(i=>i.setValue(this.plugin.settings.sizeLimitKb.toString()).onChange(a=>ye(this,null,function*(){let l=parseInt(a);isFinite(l)?this.plugin.settings.sizeLimitKb=l:this.plugin.settings.sizeLimitKb=Zs.sizeLimitKb,yield this.plugin.saveSettings()}))),this.createToggle(n,"Process Expired","Remove notes that have expired","processExpired"),this.plugin.settings.processExpired&&(n.createEl("h3",{text:"Expiration Processing"}),new vn.Setting(n).setName("Metadata Attribute").setDesc("The frontMatter key in which to search for expiration date").addText(i=>i.setPlaceholder("Insert attribute name (es: expires)").setValue(this.plugin.settings.expiredAttribute).onChange(a=>ye(this,null,function*(){this.plugin.settings.expiredAttribute=a,yield this.plugin.saveSettings()}))),new vn.Setting(n).setName("Date Format").setDesc("The format in which the expiration date is stored (e.g. YYYY-MM-DD)").addText(i=>i.setPlaceholder("Insert the date format").setValue(this.plugin.settings.expiredDateFormat).onChange(a=>ye(this,null,function*(){this.plugin.settings.expiredDateFormat=a,yield this.plugin.saveSettings()})))),n.createEl("h3",{text:"File Exclusions"}),this.createToggle(n,"Ignore Obsidian Excluded Files","Does not process files matching the Excluded Files filters in Obsidian Settings","honorObsidianExcludedFiles");let r=new vn.Setting(n).setName("Excluded Files").setDesc("Excluded files will not be processed").addButton(i=>{i.setButtonText("Manage"),i.onClick(a=>{new bl(this.app,this.plugin.settings,l=>ye(this,null,function*(){this.plugin.settings.excludedFilesFilters=l,yield this.plugin.saveSettings(),this.display()})).open()})});if(this.plugin.settings.excludedFilesFilters&&this.plugin.settings.excludedFilesFilters.length){let i=r.descEl.createEl("ul");this.plugin.settings.excludedFilesFilters.forEach(a=>{i.createEl("li").setText(a)})}}createToggle(n,r,i,a){new vn.Setting(n).setName(r).setDesc(i).addToggle(l=>l.setValue(this.plugin.settings[a]).onChange(u=>ye(this,null,function*(){this.plugin.settings[a]=u,yield this.plugin.saveSettings(),this.display()})))}};var Il=class{constructor(t){this.app=t}process(r){return ye(this,arguments,function*(t,n="trash"){let i=[...new Set(t)],a=0,l=0;for(let u of i){let d=app.vault.getAbstractFileByPath(u);if(d)try{switch(n){case"trash-system":yield app.vault.trash(d,!0),a++;break;case"trash":yield app.vault.trash(d,!1),a++;break;case"delete":yield app.vault.delete(d),a++;break;default:console.warn(`Warning: operation ${n} unknown`);break}}catch(h){l++}else console.warn(`Warning: file ${u} was not found for thrashing!`),l++}return{deletedFiles:a,notDeletedFiles:l}})}};var py=we(fy()),Sl=class extends yn.Plugin{constructor(){super(...arguments);this.initialScanDone=!1;this.frontMatterRegEx=new RegExp("^---$(.*)^---","ms")}onload(){return ye(this,null,function*(){this.initialScanDone=!1,yield this.loadSettings(),this.settings.addRibbonIcon&&this.addIcon(),this.statusBarItemEl=this.addStatusBarItem(),this.updateStatusBar(""),this.addCommand({id:"scan-files",name:"Scan Files",callback:()=>{this.scanFiles()}}),this.addCommand({id:"scan-files-noprompt",name:"Scan Files (without prompt)",callback:()=>{this.scanFiles(!1,!0)}}),this.addCommand({id:"scan-files-with-prompt",name:"Scan Files (with prompt)",callback:()=>{this.scanFiles(!0,!1)}}),this.addCommand({id:"set-expiration",name:"Sets the expiration date of the current note",checkCallback:n=>{let r=this.app.workspace.getActiveViewOfType(yn.MarkdownView);return r?(n||this.chooseDate(r),!0):!1}}),this.createShortcutCommand("set-expiration-1week","Set Expiration (1 week)",1,"week"),this.createShortcutCommand("set-expiration-1month","Set Expiration (1 month)",1,"month"),this.createShortcutCommand("set-expiration-1year","Set Expiration (1 year)",1,"year"),this.addSettingTab(new oa(this.app,this)),this.app.metadataCache.on("resolved",()=>{this.settings.runAtStartup&&!this.initialScanDone&&(this.initialScanDone=!0,this.scanFiles())})})}createShortcutCommand(n,r,i,a){this.addCommand({id:n,name:r,checkCallback:l=>{let u=this.app.workspace.getActiveViewOfType(yn.MarkdownView);return u?(l||this.updateNoteWithDate(u,(0,py.default)().add(i,a).format(this.settings.expiredDateFormat)),!0):!1}})}chooseDate(n){return ye(this,null,function*(){new zs(this.app,this,n).open()})}updateNoteWithDate(n,r){return ye(this,null,function*(){var S;let i=(S=this.app.metadataCache.getFileCache(n.file))==null?void 0:S.frontmatter,a=(i==null?void 0:i.position.start.offset)||0,l=(i==null?void 0:i.position.end.offset)||0,u=ce(U({},i),{[this.settings.expiredAttribute]:r,position:void 0}),d=(0,yn.stringifyYaml)(u),h=yield this.app.vault.cachedRead(n.file),m=this.frontMatterRegEx.exec(h);!i&&m&&(a=m.index,l=m.index+m[0].length);let C=`--- +`+d+`--- +`;if(n.getMode()==="source")n.editor.replaceRange(C,n.editor.offsetToPos(a),n.editor.offsetToPos(l));else{let x=h.substring(0,a)+C+h.substring(l);this.app.vault.modify(n.file,x)}})}updateStatusBar(n){this.statusBarItemEl.setText(n)}scanFiles(n=!1,r=!1){return ye(this,null,function*(){var u;new yn.Notice("Janitor is scanning vault"),this.updateStatusBar("Janitor Scanning...");let i,a=yield new Js(this.app,this.settings).scan(),l=a.orphans&&a.orphans.length||a.empty&&a.empty.length||a.expired&&a.expired.length||a.big&&a.big.length;if(this.updateStatusBar(""),!l){new yn.Notice("Janitor scanned and found nothing to cleanup");return}if((this.settings.promptUser&&!r||((u=a.big)==null?void 0:u.length)&&this.settings.promptForBigFiles||n)&&(i=new Us(this.app,this),i.open()),i)i.updateState(a);else{let d=[a.orphans,a.empty,a.expired,a.big].flatMap(h=>h?h.map(m=>m.path):[]);d=[...new Set(d)],this.perform(this.settings.defaultOperation,d)}})}perform(n,r){return ye(this,null,function*(){let a=yield new Il(this.app).process(r,n);new yn.Notice(`${a.deletedFiles} files deleted.`+(a.notDeletedFiles?`${a.notDeletedFiles} files not deleted`:""))})}onunload(){}addIcon(){this.removeIcon(),this.ribbonIconEl=this.addRibbonIcon("trash","Janitor: scan vault",n=>{this.scanFiles()}),this.ribbonIconEl.addClass("janitor-ribbon-class")}removeIcon(){this.ribbonIconEl&&this.ribbonIconEl.remove()}loadSettings(){return ye(this,null,function*(){this.settings=Object.assign({},Zs,yield this.loadData())})}saveSettings(){return ye(this,null,function*(){yield this.saveData(this.settings)})}}; +/** + * @license React + * react-dom.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +/** + * @license React + * react.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +/** + * @license React + * scheduler.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +/** @license React v16.13.1 + * react-is.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +//! authors : Tim Wood, Iskren Chernev, Moment.js contributors +//! license : MIT +//! moment.js +//! momentjs.com +//! version : 2.29.4 + +/* nosourcemap */ \ No newline at end of file diff --git a/.obsidian/plugins/janitor/manifest.json b/.obsidian/plugins/janitor/manifest.json new file mode 100644 index 00000000..cfe1e7a7 --- /dev/null +++ b/.obsidian/plugins/janitor/manifest.json @@ -0,0 +1,11 @@ +{ + "id": "janitor", + "name": "Janitor", + "version": "1.0.7", + "minAppVersion": "0.15.0", + "description": "Performs cleanup tasks on the Obsidian vault", + "author": "Gabriele Cannata", + "authorUrl": "https://github.com/Canna71", + "fundingUrl": "https://www.buymeacoffee.com/gcannata", + "isDesktopOnly": false +} diff --git a/.obsidian/plugins/janitor/styles.css b/.obsidian/plugins/janitor/styles.css new file mode 100644 index 00000000..c6247714 --- /dev/null +++ b/.obsidian/plugins/janitor/styles.css @@ -0,0 +1,98 @@ +/* + +This CSS file will be included with your plugin, and +available in the app when your plugin is enabled. + +If your plugin does not need CSS, delete this file. + +*/ +.janitor-modal-footer { + /* float: right; */ + padding: 10pt; + display: flex; +} + +.janitor-modal-footer button {} + +.janitor-modal-footer .janitor-footer-buttons { + flex: 1; + justify-content: flex-end; + display: flex; +} + +.janitor-scan-section-title { + font-size: larger; + margin-bottom: 5pt; + font-weight: 600; +} + +.janitor-modal-title { + text-align: center; + font-size: 150%; + margin-bottom: 10px; +} + +.janitor-file { + margin-left: 1em; + position: relative; +} + +.janitor-file:hover { + background-color: var(--background-primary); +} + + +.janitor-file .openFileIcon { + right: 0px; + position: absolute; + /* cursor: pointer; */ + visibility: hidden; +} + +.janitor-file label { + width: 100%; + /* cursor: pointer; */ +} + +.janitor-file:hover .openFileIcon { + visibility: visible; +} + +.janitor-file:focus { + outline: auto; +} + +.janitor-scan-results { + overflow-y: auto; + max-height:250px; +} + +.janitor-files-wrapper { + /* overflow-y: auto; */ + /* max-height: 180px; */ + /* border: 1px solid; */ + padding: 5px; +} + +.janitor-date-picker { + padding: 5px;; +} + +.janitor-date-picker label span { + margin-right: 1em;; +} + + +.janitor-date-picker-buttons { + float: right; +} + +.janitor-date-shortcuts { + white-space: nowrap; + margin-top: 1em; + text-align: center; +} + +.janitor-date-shortcuts .janitor-date-picker-buttons { + display: inline-block; +} diff --git a/.obsidian/plugins/lazy-plugins/data.json b/.obsidian/plugins/lazy-plugins/data.json index 3a5e4460..4ff0f5ac 100644 --- a/.obsidian/plugins/lazy-plugins/data.json +++ b/.obsidian/plugins/lazy-plugins/data.json @@ -60,7 +60,7 @@ "startupType": "disabled" }, "obsidian-custom-frames": { - "startupType": "disabled" + "startupType": "long" }, "cycle-in-sidebar": { "startupType": "disabled" @@ -343,6 +343,9 @@ }, "mysnippets-plugin": { "startupType": "instant" + }, + "janitor": { + "startupType": "instant" } } } diff --git a/.obsidian/plugins/obsidian-custom-frames/data.json b/.obsidian/plugins/obsidian-custom-frames/data.json index 3cdb2c75..e9566088 100644 --- a/.obsidian/plugins/obsidian-custom-frames/data.json +++ b/.obsidian/plugins/obsidian-custom-frames/data.json @@ -9,7 +9,7 @@ "openInCenter": false, "zoomLevel": 0.95, "forceIframe": false, - "customCss": "/* hide info clutter and ad banner */\n#classify--info-area,\n.adsbygoogle {\n display: none !important\n}\n\n/* invert colors */\n* {\n filter: invert(1);\n}" + "customCss": "/* hide info clutter and ad banner */\n#classify--info-area,\n.adsbygoogle {\n display: none !important\n}\n\n\n/* invert colors */\n" }, { "url": "https://github.com/OsKaR31415/cours", diff --git a/.obsidian/plugins/obsidian-excalidraw-plugin/data.json b/.obsidian/plugins/obsidian-excalidraw-plugin/data.json index bc700c23..75dd8a5f 100644 --- a/.obsidian/plugins/obsidian-excalidraw-plugin/data.json +++ b/.obsidian/plugins/obsidian-excalidraw-plugin/data.json @@ -12,7 +12,7 @@ "compress": true, "decompressForMDView": false, "onceOffCompressFlagReset": true, - "onceOffGPTVersionReset": false, + "onceOffGPTVersionReset": true, "autosave": true, "autosaveIntervalDesktop": 60000, "autosaveIntervalMobile": 30000, @@ -99,7 +99,7 @@ "library2": { "type": "excalidrawlib", "version": 2, - "source": "https://github.com/zsviczian/obsidian-excalidraw-plugin/releases/tag/2.6.8", + "source": "https://github.com/zsviczian/obsidian-excalidraw-plugin/releases/tag/2.7.2", "libraryItems": [] }, "imageElementNotice": true, @@ -111,7 +111,7 @@ "mdCSS": "", "scriptEngineSettings": {}, "defaultTrayMode": true, - "previousRelease": "2.6.8", + "previousRelease": "2.7.2", "showReleaseNotes": true, "showNewVersionNotification": true, "latexBoilerplate": "\\color{blue}", @@ -763,7 +763,7 @@ "longPressMobile": 500, "doubleClickLinkOpenViewMode": true, "isDebugMode": false, - "rank": "Bronze", + "rank": "Silver", "modifierKeyOverrides": [ { "modifiers": [ diff --git a/.obsidian/plugins/obsidian-excalidraw-plugin/main.js b/.obsidian/plugins/obsidian-excalidraw-plugin/main.js index 627c9cfa..ce69e690 100644 --- a/.obsidian/plugins/obsidian-excalidraw-plugin/main.js +++ b/.obsidian/plugins/obsidian-excalidraw-plugin/main.js @@ -1,8 +1,10 @@ "use strict";var obsidian_module=require("obsidian"),state=require("@codemirror/state"),view=require("@codemirror/view");const INITIAL_TIMESTAMP=Date.now();var LZString=function(){var r=String.fromCharCode,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+-$",e={};function t(r,o){if(!e[r]){e[r]={};for(var n=0;n>>8,n[2*e+1]=s%256}return n},decompressFromUint8Array:function(o){if(null==o)return i.decompress(o);for(var n=new Array(o.length/2),e=0,t=n.length;e>=1}else{for(t=1,e=0;e>=1}0==--l&&(l=Math.pow(2,h),h++),delete u[c]}else for(t=s[c],e=0;e>=1;0==--l&&(l=Math.pow(2,h),h++),s[p]=f++,c=String(a)}if(""!==c){if(Object.prototype.hasOwnProperty.call(u,c)){if(c.charCodeAt(0)<256){for(e=0;e>=1}else{for(t=1,e=0;e>=1}0==--l&&(l=Math.pow(2,h),h++),delete u[c]}else for(t=s[c],e=0;e>=1;0==--l&&(l=Math.pow(2,h),h++)}for(t=2,e=0;e>=1;for(;;){if(m<<=1,v==o-1){d.push(n(m));break}v++}return d.join("")},decompress:function(r){return null==r?"":""==r?null:i._decompress(r.length,32768,function(o){return r.charCodeAt(o)})},_decompress:function(o,n,e){var t,i,s,u,a,p,c,l=[],f=4,h=4,d=3,m="",v=[],g={val:e(0),position:n,index:1};for(t=0;t<3;t+=1)l[t]=t;for(s=0,a=Math.pow(2,2),p=1;p!=a;)u=g.val&g.position,g.position>>=1,0==g.position&&(g.position=n,g.val=e(g.index++)),s|=(u>0?1:0)*p,p<<=1;switch(s){case 0:for(s=0,a=Math.pow(2,8),p=1;p!=a;)u=g.val&g.position,g.position>>=1,0==g.position&&(g.position=n,g.val=e(g.index++)),s|=(u>0?1:0)*p,p<<=1;c=r(s);break;case 1:for(s=0,a=Math.pow(2,16),p=1;p!=a;)u=g.val&g.position,g.position>>=1,0==g.position&&(g.position=n,g.val=e(g.index++)),s|=(u>0?1:0)*p,p<<=1;c=r(s);break;case 2:return""}for(l[3]=c,i=c,v.push(c);;){if(g.index>o)return"";for(s=0,a=Math.pow(2,d),p=1;p!=a;)u=g.val&g.position,g.position>>=1,0==g.position&&(g.position=n,g.val=e(g.index++)),s|=(u>0?1:0)*p,p<<=1;switch(c=s){case 0:for(s=0,a=Math.pow(2,8),p=1;p!=a;)u=g.val&g.position,g.position>>=1,0==g.position&&(g.position=n,g.val=e(g.index++)),s|=(u>0?1:0)*p,p<<=1;l[h++]=r(s),c=h-1,f--;break;case 1:for(s=0,a=Math.pow(2,16),p=1;p!=a;)u=g.val&g.position,g.position>>=1,0==g.position&&(g.position=n,g.val=e(g.index++)),s|=(u>0?1:0)*p,p<<=1;l[h++]=r(s),c=h-1,f--;break;case 2:return v.join("")}if(0==f&&(f=Math.pow(2,d),d++),l[c])m=l[c];else{if(c!==h)return null;m=i+i.charAt(0)}v.push(m),l[h++]=i+m.charAt(0),i=m,0==--f&&(f=Math.pow(2,d),d++)}}};return i}();"function"==typeof define&&define.amd?define(function(){return LZString}):"undefined"!=typeof module&&null!=module?module.exports=LZString:"undefined"!=typeof angular&&null!=angular&&angular.module("LZString",[]).factory("LZString",function(){return LZString}); -let REACT_PACKAGES = `/**\n * @license React\n * react.production.min.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n(function(){'use strict';(function(c,x){"object"===typeof exports&&"undefined"!==typeof module?x(exports):"function"===typeof define&&define.amd?define(["exports"],x):(c=c||self,x(c.React={}))})(this,function(c){function x(a){if(null===a||"object"!==typeof a)return null;a=V&&a[V]||a["@@iterator"];return"function"===typeof a?a:null}function w(a,b,e){this.props=a;this.context=b;this.refs=W;this.updater=e||X}function Y(){}function K(a,b,e){this.props=a;this.context=b;this.refs=W;this.updater=e||X}function Z(a,b,\ne){var m,d={},c=null,h=null;if(null!=b)for(m in void 0!==b.ref&&(h=b.ref),void 0!==b.key&&(c=""+b.key),b)aa.call(b,m)&&!ba.hasOwnProperty(m)&&(d[m]=b[m]);var l=arguments.length-2;if(1===l)d.children=e;else if(1>>1,d=a[c];if(0>>1;cD(l,e))fD(g,l)?(a[c]=g,a[f]=e,c=f):(a[c]=l,a[h]=e,c=h);else if(fD(g,e))a[c]=g,a[f]=e,c=f;else break a}}return b}\nfunction D(a,b){var c=a.sortIndex-b.sortIndex;return 0!==c?c:a.id-b.id}function P(a){for(var b=p(r);null!==b;){if(null===b.callback)E(r);else if(b.startTime<=a)E(r),b.sortIndex=b.expirationTime,O(q,b);else break;b=p(r)}}function Q(a){z=!1;P(a);if(!u)if(null!==p(q))u=!0,R(S);else{var b=p(r);null!==b&&T(Q,b.startTime-a)}}function S(a,b){u=!1;z&&(z=!1,ea(A),A=-1);F=!0;var c=k;try{P(b);for(n=p(q);null!==n&&(!(n.expirationTime>b)||a&&!fa());){var m=n.callback;if("function"===typeof m){n.callback=null;\nk=n.priorityLevel;var d=m(n.expirationTime<=b);b=v();"function"===typeof d?n.callback=d:n===p(q)&&E(q);P(b)}else E(q);n=p(q)}if(null!==n)var g=!0;else{var h=p(r);null!==h&&T(Q,h.startTime-b);g=!1}return g}finally{n=null,k=c,F=!1}}function fa(){return v()-hae?(a.sortIndex=c,O(r,a),null===p(q)&&a===p(r)&&(z?(ea(A),A=-1):z=!0,T(Q,c-e))):(a.sortIndex=d,O(q,a),u||F||(u=!0,R(S)));return a},unstable_cancelCallback:function(a){a.callback=null},unstable_wrapCallback:function(a){var b=k;return function(){var c=k;k=b;try{return a.apply(this,arguments)}finally{k=c}}},unstable_getCurrentPriorityLevel:function(){return k},unstable_shouldYield:fa,\nunstable_requestPaint:function(){},unstable_continueExecution:function(){u||F||(u=!0,R(S))},unstable_pauseExecution:function(){},unstable_getFirstCallbackNode:function(){return p(q)},get unstable_now(){return v},unstable_forceFrameRate:function(a){0>a||125b}return!1}function Y(a,b,c,d,e,f,g){this.acceptsBooleans=2===b||3===b||4===b;this.attributeName=d;this.attributeNamespace=e;this.mustUseProperty=c;this.propertyName=a;this.type=b;this.sanitizeURL=f;this.removeEmptyString=g}function $d(a,b,c,d){var e=R.hasOwnProperty(b)?R[b]:null;if(null!==e?0!==e.type:d||!(2h||e[g]!==f[h]){var k="\\n"+e[g].replace(" at new "," at ");a.displayName&&k.includes("")&&(k=k.replace("",a.displayName));return k}while(1<=g&&0<=h)}break}}}finally{ce=!1,Error.prepareStackTrace=c}return(a=a?a.displayName||a.name:"")?bc(a):\n""}function gj(a){switch(a.tag){case 5:return bc(a.type);case 16:return bc("Lazy");case 13:return bc("Suspense");case 19:return bc("SuspenseList");case 0:case 2:case 15:return a=be(a.type,!1),a;case 11:return a=be(a.type.render,!1),a;case 1:return a=be(a.type,!0),a;default:return""}}function de(a){if(null==a)return null;if("function"===typeof a)return a.displayName||a.name||null;if("string"===typeof a)return a;switch(a){case Bb:return"Fragment";case Cb:return"Portal";case ee:return"Profiler";case fe:return"StrictMode";\ncase ge:return"Suspense";case he:return"SuspenseList"}if("object"===typeof a)switch(a.$$typeof){case gg:return(a.displayName||"Context")+".Consumer";case hg:return(a._context.displayName||"Context")+".Provider";case ie:var b=a.render;a=a.displayName;a||(a=b.displayName||b.name||"",a=""!==a?"ForwardRef("+a+")":"ForwardRef");return a;case je:return b=a.displayName||null,null!==b?b:de(a.type)||"Memo";case Ta:b=a._payload;a=a._init;try{return de(a(b))}catch(c){}}return null}function hj(a){var b=a.type;\nswitch(a.tag){case 24:return"Cache";case 9:return(b.displayName||"Context")+".Consumer";case 10:return(b._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return a=b.render,a=a.displayName||a.name||"",b.displayName||(""!==a?"ForwardRef("+a+")":"ForwardRef");case 7:return"Fragment";case 5:return b;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return de(b);case 8:return b===fe?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";\ncase 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if("function"===typeof b)return b.displayName||b.name||null;if("string"===typeof b)return b}return null}function Ua(a){switch(typeof a){case "boolean":case "number":case "string":case "undefined":return a;case "object":return a;default:return""}}function ig(a){var b=a.type;return(a=a.nodeName)&&"input"===a.toLowerCase()&&("checkbox"===b||"radio"===\nb)}function ij(a){var b=ig(a)?"checked":"value",c=Object.getOwnPropertyDescriptor(a.constructor.prototype,b),d=""+a[b];if(!a.hasOwnProperty(b)&&"undefined"!==typeof c&&"function"===typeof c.get&&"function"===typeof c.set){var e=c.get,f=c.set;Object.defineProperty(a,b,{configurable:!0,get:function(){return e.call(this)},set:function(a){d=""+a;f.call(this,a)}});Object.defineProperty(a,b,{enumerable:c.enumerable});return{getValue:function(){return d},setValue:function(a){d=""+a},stopTracking:function(){a._valueTracker=\nnull;delete a[b]}}}}function Pc(a){a._valueTracker||(a._valueTracker=ij(a))}function jg(a){if(!a)return!1;var b=a._valueTracker;if(!b)return!0;var c=b.getValue();var d="";a&&(d=ig(a)?a.checked?"true":"false":a.value);a=d;return a!==c?(b.setValue(a),!0):!1}function Qc(a){a=a||("undefined"!==typeof document?document:void 0);if("undefined"===typeof a)return null;try{return a.activeElement||a.body}catch(b){return a.body}}function ke(a,b){var c=b.checked;return E({},b,{defaultChecked:void 0,defaultValue:void 0,\nvalue:void 0,checked:null!=c?c:a._wrapperState.initialChecked})}function kg(a,b){var c=null==b.defaultValue?"":b.defaultValue,d=null!=b.checked?b.checked:b.defaultChecked;c=Ua(null!=b.value?b.value:c);a._wrapperState={initialChecked:d,initialValue:c,controlled:"checkbox"===b.type||"radio"===b.type?null!=b.checked:null!=b.value}}function lg(a,b){b=b.checked;null!=b&&$d(a,"checked",b,!1)}function le(a,b){lg(a,b);var c=Ua(b.value),d=b.type;if(null!=c)if("number"===d){if(0===c&&""===a.value||a.value!=\nc)a.value=""+c}else a.value!==""+c&&(a.value=""+c);else if("submit"===d||"reset"===d){a.removeAttribute("value");return}b.hasOwnProperty("value")?me(a,b.type,c):b.hasOwnProperty("defaultValue")&&me(a,b.type,Ua(b.defaultValue));null==b.checked&&null!=b.defaultChecked&&(a.defaultChecked=!!b.defaultChecked)}function mg(a,b,c){if(b.hasOwnProperty("value")||b.hasOwnProperty("defaultValue")){var d=b.type;if(!("submit"!==d&&"reset"!==d||void 0!==b.value&&null!==b.value))return;b=""+a._wrapperState.initialValue;\nc||b===a.value||(a.value=b);a.defaultValue=b}c=a.name;""!==c&&(a.name="");a.defaultChecked=!!a._wrapperState.initialChecked;""!==c&&(a.name=c)}function me(a,b,c){if("number"!==b||Qc(a.ownerDocument)!==a)null==c?a.defaultValue=""+a._wrapperState.initialValue:a.defaultValue!==""+c&&(a.defaultValue=""+c)}function Db(a,b,c,d){a=a.options;if(b){b={};for(var e=0;e>>=0;return 0===a?32:31-(rj(a)/sj|0)|0}function hc(a){switch(a&-a){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return a&\n4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return a&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return a}}function Vc(a,b){var c=a.pendingLanes;if(0===c)return 0;var d=0,e=a.suspendedLanes,f=a.pingedLanes,g=c&268435455;if(0!==g){var h=g&~e;0!==h?d=hc(h):(f&=g,0!==f&&(d=hc(f)))}else g=c&~e,0!==g?d=hc(g):0!==f&&(d=hc(f));if(0===d)return 0;if(0!==b&&b!==d&&0===(b&e)&&\n(e=d&-d,f=b&-b,e>=f||16===e&&0!==(f&4194240)))return b;0!==(d&4)&&(d|=c&16);b=a.entangledLanes;if(0!==b)for(a=a.entanglements,b&=d;0c;c++)b.push(a);\nreturn b}function ic(a,b,c){a.pendingLanes|=b;536870912!==b&&(a.suspendedLanes=0,a.pingedLanes=0);a=a.eventTimes;b=31-ta(b);a[b]=c}function vj(a,b){var c=a.pendingLanes&~b;a.pendingLanes=b;a.suspendedLanes=0;a.pingedLanes=0;a.expiredLanes&=b;a.mutableReadLanes&=b;a.entangledLanes&=b;b=a.entanglements;var d=a.eventTimes;for(a=a.expirationTimes;0=b)return{node:c,offset:b-a};a=d}a:{for(;c;){if(c.nextSibling){c=c.nextSibling;break a}c=c.parentNode}c=void 0}c=$g(c)}}function bh(a,b){return a&&b?a===b?!0:a&&3===a.nodeType?!1:b&&3===b.nodeType?bh(a,b.parentNode):"contains"in a?a.contains(b):a.compareDocumentPosition?!!(a.compareDocumentPosition(b)&16):!1:!1}function ch(){for(var a=window,b=Qc();b instanceof a.HTMLIFrameElement;){try{var c="string"===typeof b.contentWindow.location.href}catch(d){c=!1}if(c)a=b.contentWindow;else break;\nb=Qc(a.document)}return b}function Ie(a){var b=a&&a.nodeName&&a.nodeName.toLowerCase();return b&&("input"===b&&("text"===a.type||"search"===a.type||"tel"===a.type||"url"===a.type||"password"===a.type)||"textarea"===b||"true"===a.contentEditable)}function Uj(a){var b=ch(),c=a.focusedElem,d=a.selectionRange;if(b!==c&&c&&c.ownerDocument&&bh(c.ownerDocument.documentElement,c)){if(null!==d&&Ie(c))if(b=d.start,a=d.end,void 0===a&&(a=b),"selectionStart"in c)c.selectionStart=b,c.selectionEnd=Math.min(a,c.value.length);\nelse if(a=(b=c.ownerDocument||document)&&b.defaultView||window,a.getSelection){a=a.getSelection();var e=c.textContent.length,f=Math.min(d.start,e);d=void 0===d.end?f:Math.min(d.end,e);!a.extend&&f>d&&(e=d,d=f,f=e);e=ah(c,f);var g=ah(c,d);e&&g&&(1!==a.rangeCount||a.anchorNode!==e.node||a.anchorOffset!==e.offset||a.focusNode!==g.node||a.focusOffset!==g.offset)&&(b=b.createRange(),b.setStart(e.node,e.offset),a.removeAllRanges(),f>d?(a.addRange(b),a.extend(g.node,g.offset)):(b.setEnd(g.node,g.offset),\na.addRange(b)))}b=[];for(a=c;a=a.parentNode;)1===a.nodeType&&b.push({element:a,left:a.scrollLeft,top:a.scrollTop});"function"===typeof c.focus&&c.focus();for(c=0;cMb||(a.current=Se[Mb],Se[Mb]=null,Mb--)}\nfunction y(a,b,c){Mb++;Se[Mb]=a.current;a.current=b}function Nb(a,b){var c=a.type.contextTypes;if(!c)return cb;var d=a.stateNode;if(d&&d.__reactInternalMemoizedUnmaskedChildContext===b)return d.__reactInternalMemoizedMaskedChildContext;var e={},f;for(f in c)e[f]=b[f];d&&(a=a.stateNode,a.__reactInternalMemoizedUnmaskedChildContext=b,a.__reactInternalMemoizedMaskedChildContext=e);return e}function ea(a){a=a.childContextTypes;return null!==a&&void 0!==a}function th(a,b,c){if(J.current!==cb)throw Error(n(168));\ny(J,b);y(S,c)}function uh(a,b,c){var d=a.stateNode;b=b.childContextTypes;if("function"!==typeof d.getChildContext)return c;d=d.getChildContext();for(var e in d)if(!(e in b))throw Error(n(108,hj(a)||"Unknown",e));return E({},c,d)}function ld(a){a=(a=a.stateNode)&&a.__reactInternalMemoizedMergedChildContext||cb;qb=J.current;y(J,a);y(S,S.current);return!0}function vh(a,b,c){var d=a.stateNode;if(!d)throw Error(n(169));c?(a=uh(a,b,qb),d.__reactInternalMemoizedMergedChildContext=a,w(S),w(J),y(J,a)):w(S);\ny(S,c)}function wh(a){null===La?La=[a]:La.push(a)}function kk(a){md=!0;wh(a)}function db(){if(!Te&&null!==La){Te=!0;var a=0,b=z;try{var c=La;for(z=1;a>=g;e-=g;Ma=1<<32-ta(b)+e|c<q?(v=l,l=null):v=l.sibling;var A=r(e,l,h[q],k);if(null===A){null===l&&(l=v);break}a&&l&&null===A.alternate&&b(e,l);g=f(A,g,q);null===m?n=A:m.sibling=A;m=A;l=v}if(q===h.length)return c(e,l),D&&rb(e,q),n;if(null===l){for(;qv?(A=q,q=null):A=q.sibling;var x=r(e,q,t.value,k);if(null===x){null===q&&(q=A);break}a&&q&&null===x.alternate&&b(e,q);g=f(x,g,v);null===l?m=x:l.sibling=x;l=x;q=A}if(t.done)return c(e,q),D&&rb(e,v),m;\nif(null===q){for(;!t.done;v++,t=h.next())t=u(e,t.value,k),null!==t&&(g=f(t,g,v),null===l?m=t:l.sibling=t,l=t);D&&rb(e,v);return m}for(q=d(e,q);!t.done;v++,t=h.next())t=p(q,e,v,t.value,k),null!==t&&(a&&null!==t.alternate&&q.delete(null===t.key?v:t.key),g=f(t,g,v),null===l?m=t:l.sibling=t,l=t);a&&q.forEach(function(a){return b(e,a)});D&&rb(e,v);return m}function w(a,d,f,h){"object"===typeof f&&null!==f&&f.type===Bb&&null===f.key&&(f=f.props.children);if("object"===typeof f&&null!==f){switch(f.$$typeof){case xd:a:{for(var k=\nf.key,m=d;null!==m;){if(m.key===k){k=f.type;if(k===Bb){if(7===m.tag){c(a,m.sibling);d=e(m,f.props.children);d.return=a;a=d;break a}}else if(m.elementType===k||"object"===typeof k&&null!==k&&k.$$typeof===Ta&&Kh(k)===m.type){c(a,m.sibling);d=e(m,f.props);d.ref=vc(a,m,f);d.return=a;a=d;break a}c(a,m);break}else b(a,m);m=m.sibling}f.type===Bb?(d=ub(f.props.children,a.mode,h,f.key),d.return=a,a=d):(h=wd(f.type,f.key,f.props,null,a.mode,h),h.ref=vc(a,d,f),h.return=a,a=h)}return g(a);case Cb:a:{for(m=f.key;null!==\nd;){if(d.key===m)if(4===d.tag&&d.stateNode.containerInfo===f.containerInfo&&d.stateNode.implementation===f.implementation){c(a,d.sibling);d=e(d,f.children||[]);d.return=a;a=d;break a}else{c(a,d);break}else b(a,d);d=d.sibling}d=hf(f,a.mode,h);d.return=a;a=d}return g(a);case Ta:return m=f._init,w(a,d,m(f._payload),h)}if(cc(f))return x(a,d,f,h);if(ac(f))return F(a,d,f,h);vd(a,f)}return"string"===typeof f&&""!==f||"number"===typeof f?(f=""+f,null!==d&&6===d.tag?(c(a,d.sibling),d=e(d,f),d.return=a,a=d):\n(c(a,d),d=gf(f,a.mode,h),d.return=a,a=d),g(a)):c(a,d)}return w}function vb(a){if(a===wc)throw Error(n(174));return a}function jf(a,b){y(xc,b);y(yc,a);y(Ea,wc);a=b.nodeType;switch(a){case 9:case 11:b=(b=b.documentElement)?b.namespaceURI:oe(null,"");break;default:a=8===a?b.parentNode:b,b=a.namespaceURI||null,a=a.tagName,b=oe(b,a)}w(Ea);y(Ea,b)}function Tb(a){w(Ea);w(yc);w(xc)}function Mh(a){vb(xc.current);var b=vb(Ea.current);var c=oe(b,a.type);b!==c&&(y(yc,a),y(Ea,c))}function kf(a){yc.current===a&&\n(w(Ea),w(yc))}function yd(a){for(var b=a;null!==b;){if(13===b.tag){var c=b.memoizedState;if(null!==c&&(c=c.dehydrated,null===c||"$?"===c.data||"$!"===c.data))return b}else if(19===b.tag&&void 0!==b.memoizedProps.revealOrder){if(0!==(b.flags&128))return b}else if(null!==b.child){b.child.return=b;b=b.child;continue}if(b===a)break;for(;null===b.sibling;){if(null===b.return||b.return===a)return null;b=b.return}b.sibling.return=b.return;b=b.sibling}return null}function lf(){for(var a=0;ac?c:4;a(!0);var d=uf.transition;uf.transition={};try{a(!1),b()}finally{z=c,uf.transition=d}}function di(){return sa().memoizedState}function rk(a,b,\nc){var d=hb(a);c={lane:d,action:c,hasEagerState:!1,eagerState:null,next:null};if(ei(a))fi(b,c);else if(c=Ch(a,b,c,d),null!==c){var e=Z();ya(c,a,d,e);gi(c,b,d)}}function pk(a,b,c){var d=hb(a),e={lane:d,action:c,hasEagerState:!1,eagerState:null,next:null};if(ei(a))fi(b,e);else{var f=a.alternate;if(0===a.lanes&&(null===f||0===f.lanes)&&(f=b.lastRenderedReducer,null!==f))try{var g=b.lastRenderedState,h=f(g,c);e.hasEagerState=!0;e.eagerState=h;if(ua(h,g)){var k=b.interleaved;null===k?(e.next=e,cf(b)):\n(e.next=k.next,k.next=e);b.interleaved=e;return}}catch(m){}finally{}c=Ch(a,b,e,d);null!==c&&(e=Z(),ya(c,a,d,e),gi(c,b,d))}}function ei(a){var b=a.alternate;return a===C||null!==b&&b===C}function fi(a,b){zc=Bd=!0;var c=a.pending;null===c?b.next=b:(b.next=c.next,c.next=b);a.pending=b}function gi(a,b,c){if(0!==(c&4194240)){var d=b.lanes;d&=a.pendingLanes;c|=d;b.lanes=c;xe(a,c)}}function Ub(a,b){try{var c="",d=b;do c+=gj(d),d=d.return;while(d);var e=c}catch(f){e="\\nError generating stack: "+f.message+\n"\\n"+f.stack}return{value:a,source:b,stack:e,digest:null}}function vf(a,b,c){return{value:a,source:null,stack:null!=c?c:null,digest:null!=b?b:null}}function wf(a,b){try{console.error(b.value)}catch(c){setTimeout(function(){throw c;})}}function hi(a,b,c){c=Pa(-1,c);c.tag=3;c.payload={element:null};var d=b.value;c.callback=function(){Ed||(Ed=!0,xf=d);wf(a,b)};return c}function ii(a,b,c){c=Pa(-1,c);c.tag=3;var d=a.type.getDerivedStateFromError;if("function"===typeof d){var e=b.value;c.payload=function(){return d(e)};\nc.callback=function(){wf(a,b)}}var f=a.stateNode;null!==f&&"function"===typeof f.componentDidCatch&&(c.callback=function(){wf(a,b);"function"!==typeof d&&(null===ib?ib=new Set([this]):ib.add(this));var c=b.stack;this.componentDidCatch(b.value,{componentStack:null!==c?c:""})});return c}function ji(a,b,c){var d=a.pingCache;if(null===d){d=a.pingCache=new sk;var e=new Set;d.set(b,e)}else e=d.get(b),void 0===e&&(e=new Set,d.set(b,e));e.has(c)||(e.add(c),a=tk.bind(null,a,b,c),b.then(a,a))}function ki(a){do{var b;\nif(b=13===a.tag)b=a.memoizedState,b=null!==b?null!==b.dehydrated?!0:!1:!0;if(b)return a;a=a.return}while(null!==a);return null}function li(a,b,c,d,e){if(0===(a.mode&1))return a===b?a.flags|=65536:(a.flags|=128,c.flags|=131072,c.flags&=-52805,1===c.tag&&(null===c.alternate?c.tag=17:(b=Pa(-1,1),b.tag=2,eb(c,b,1))),c.lanes|=1),a;a.flags|=65536;a.lanes=e;return a}function aa(a,b,c,d){b.child=null===a?mi(b,null,c,d):Vb(b,a.child,c,d)}function ni(a,b,c,d,e){c=c.render;var f=b.ref;Sb(b,e);d=of(a,b,c,d,f,\ne);c=pf();if(null!==a&&!ha)return b.updateQueue=a.updateQueue,b.flags&=-2053,a.lanes&=~e,Qa(a,b,e);D&&c&&Ue(b);b.flags|=1;aa(a,b,d,e);return b.child}function oi(a,b,c,d,e){if(null===a){var f=c.type;if("function"===typeof f&&!yf(f)&&void 0===f.defaultProps&&null===c.compare&&void 0===c.defaultProps)return b.tag=15,b.type=f,pi(a,b,f,d,e);a=wd(c.type,null,d,b,b.mode,e);a.ref=b.ref;a.return=b;return b.child=a}f=a.child;if(0===(a.lanes&e)){var g=f.memoizedProps;c=c.compare;c=null!==c?c:qc;if(c(g,d)&&a.ref===\nb.ref)return Qa(a,b,e)}b.flags|=1;a=gb(f,d);a.ref=b.ref;a.return=b;return b.child=a}function pi(a,b,c,d,e){if(null!==a){var f=a.memoizedProps;if(qc(f,d)&&a.ref===b.ref)if(ha=!1,b.pendingProps=d=f,0!==(a.lanes&e))0!==(a.flags&131072)&&(ha=!0);else return b.lanes=a.lanes,Qa(a,b,e)}return zf(a,b,c,d,e)}function qi(a,b,c){var d=b.pendingProps,e=d.children,f=null!==a?a.memoizedState:null;if("hidden"===d.mode)if(0===(b.mode&1))b.memoizedState={baseLanes:0,cachePool:null,transitions:null},y(Ga,ba),ba|=c;\nelse{if(0===(c&1073741824))return a=null!==f?f.baseLanes|c:c,b.lanes=b.childLanes=1073741824,b.memoizedState={baseLanes:a,cachePool:null,transitions:null},b.updateQueue=null,y(Ga,ba),ba|=a,null;b.memoizedState={baseLanes:0,cachePool:null,transitions:null};d=null!==f?f.baseLanes:c;y(Ga,ba);ba|=d}else null!==f?(d=f.baseLanes|c,b.memoizedState=null):d=c,y(Ga,ba),ba|=d;aa(a,b,e,c);return b.child}function ri(a,b){var c=b.ref;if(null===a&&null!==c||null!==a&&a.ref!==c)b.flags|=512,b.flags|=2097152}function zf(a,\nb,c,d,e){var f=ea(c)?qb:J.current;f=Nb(b,f);Sb(b,e);c=of(a,b,c,d,f,e);d=pf();if(null!==a&&!ha)return b.updateQueue=a.updateQueue,b.flags&=-2053,a.lanes&=~e,Qa(a,b,e);D&&d&&Ue(b);b.flags|=1;aa(a,b,c,e);return b.child}function si(a,b,c,d,e){if(ea(c)){var f=!0;ld(b)}else f=!1;Sb(b,e);if(null===b.stateNode)Fd(a,b),Hh(b,c,d),ff(b,c,d,e),d=!0;else if(null===a){var g=b.stateNode,h=b.memoizedProps;g.props=h;var k=g.context,m=c.contextType;"object"===typeof m&&null!==m?m=qa(m):(m=ea(c)?qb:J.current,m=Nb(b,\nm));var l=c.getDerivedStateFromProps,n="function"===typeof l||"function"===typeof g.getSnapshotBeforeUpdate;n||"function"!==typeof g.UNSAFE_componentWillReceiveProps&&"function"!==typeof g.componentWillReceiveProps||(h!==d||k!==m)&&Ih(b,g,d,m);fb=!1;var r=b.memoizedState;g.state=r;td(b,d,g,e);k=b.memoizedState;h!==d||r!==k||S.current||fb?("function"===typeof l&&(ef(b,c,l,d),k=b.memoizedState),(h=fb||Gh(b,c,h,d,r,k,m))?(n||"function"!==typeof g.UNSAFE_componentWillMount&&"function"!==typeof g.componentWillMount||\n("function"===typeof g.componentWillMount&&g.componentWillMount(),"function"===typeof g.UNSAFE_componentWillMount&&g.UNSAFE_componentWillMount()),"function"===typeof g.componentDidMount&&(b.flags|=4194308)):("function"===typeof g.componentDidMount&&(b.flags|=4194308),b.memoizedProps=d,b.memoizedState=k),g.props=d,g.state=k,g.context=m,d=h):("function"===typeof g.componentDidMount&&(b.flags|=4194308),d=!1)}else{g=b.stateNode;Dh(a,b);h=b.memoizedProps;m=b.type===b.elementType?h:xa(b.type,h);g.props=\nm;n=b.pendingProps;r=g.context;k=c.contextType;"object"===typeof k&&null!==k?k=qa(k):(k=ea(c)?qb:J.current,k=Nb(b,k));var p=c.getDerivedStateFromProps;(l="function"===typeof p||"function"===typeof g.getSnapshotBeforeUpdate)||"function"!==typeof g.UNSAFE_componentWillReceiveProps&&"function"!==typeof g.componentWillReceiveProps||(h!==n||r!==k)&&Ih(b,g,d,k);fb=!1;r=b.memoizedState;g.state=r;td(b,d,g,e);var x=b.memoizedState;h!==n||r!==x||S.current||fb?("function"===typeof p&&(ef(b,c,p,d),x=b.memoizedState),\n(m=fb||Gh(b,c,m,d,r,x,k)||!1)?(l||"function"!==typeof g.UNSAFE_componentWillUpdate&&"function"!==typeof g.componentWillUpdate||("function"===typeof g.componentWillUpdate&&g.componentWillUpdate(d,x,k),"function"===typeof g.UNSAFE_componentWillUpdate&&g.UNSAFE_componentWillUpdate(d,x,k)),"function"===typeof g.componentDidUpdate&&(b.flags|=4),"function"===typeof g.getSnapshotBeforeUpdate&&(b.flags|=1024)):("function"!==typeof g.componentDidUpdate||h===a.memoizedProps&&r===a.memoizedState||(b.flags|=\n4),"function"!==typeof g.getSnapshotBeforeUpdate||h===a.memoizedProps&&r===a.memoizedState||(b.flags|=1024),b.memoizedProps=d,b.memoizedState=x),g.props=d,g.state=x,g.context=k,d=m):("function"!==typeof g.componentDidUpdate||h===a.memoizedProps&&r===a.memoizedState||(b.flags|=4),"function"!==typeof g.getSnapshotBeforeUpdate||h===a.memoizedProps&&r===a.memoizedState||(b.flags|=1024),d=!1)}return Af(a,b,c,d,f,e)}function Af(a,b,c,d,e,f){ri(a,b);var g=0!==(b.flags&128);if(!d&&!g)return e&&vh(b,c,!1),\nQa(a,b,f);d=b.stateNode;uk.current=b;var h=g&&"function"!==typeof c.getDerivedStateFromError?null:d.render();b.flags|=1;null!==a&&g?(b.child=Vb(b,a.child,null,f),b.child=Vb(b,null,h,f)):aa(a,b,h,f);b.memoizedState=d.state;e&&vh(b,c,!0);return b.child}function ti(a){var b=a.stateNode;b.pendingContext?th(a,b.pendingContext,b.pendingContext!==b.context):b.context&&th(a,b.context,!1);jf(a,b.containerInfo)}function ui(a,b,c,d,e){Qb();Ye(e);b.flags|=256;aa(a,b,c,d);return b.child}function Bf(a){return{baseLanes:a,\ncachePool:null,transitions:null}}function vi(a,b,c){var d=b.pendingProps,e=G.current,f=!1,g=0!==(b.flags&128),h;(h=g)||(h=null!==a&&null===a.memoizedState?!1:0!==(e&2));if(h)f=!0,b.flags&=-129;else if(null===a||null!==a.memoizedState)e|=1;y(G,e&1);if(null===a){Xe(b);a=b.memoizedState;if(null!==a&&(a=a.dehydrated,null!==a))return 0===(b.mode&1)?b.lanes=1:"$!"===a.data?b.lanes=8:b.lanes=1073741824,null;g=d.children;a=d.fallback;return f?(d=b.mode,f=b.child,g={mode:"hidden",children:g},0===(d&1)&&null!==\nf?(f.childLanes=0,f.pendingProps=g):f=Gd(g,d,0,null),a=ub(a,d,c,null),f.return=b,a.return=b,f.sibling=a,b.child=f,b.child.memoizedState=Bf(c),b.memoizedState=Cf,a):Df(b,g)}e=a.memoizedState;if(null!==e&&(h=e.dehydrated,null!==h))return vk(a,b,g,d,h,e,c);if(f){f=d.fallback;g=b.mode;e=a.child;h=e.sibling;var k={mode:"hidden",children:d.children};0===(g&1)&&b.child!==e?(d=b.child,d.childLanes=0,d.pendingProps=k,b.deletions=null):(d=gb(e,k),d.subtreeFlags=e.subtreeFlags&14680064);null!==h?f=gb(h,f):(f=\nub(f,g,c,null),f.flags|=2);f.return=b;d.return=b;d.sibling=f;b.child=d;d=f;f=b.child;g=a.child.memoizedState;g=null===g?Bf(c):{baseLanes:g.baseLanes|c,cachePool:null,transitions:g.transitions};f.memoizedState=g;f.childLanes=a.childLanes&~c;b.memoizedState=Cf;return d}f=a.child;a=f.sibling;d=gb(f,{mode:"visible",children:d.children});0===(b.mode&1)&&(d.lanes=c);d.return=b;d.sibling=null;null!==a&&(c=b.deletions,null===c?(b.deletions=[a],b.flags|=16):c.push(a));b.child=d;b.memoizedState=null;return d}\nfunction Df(a,b,c){b=Gd({mode:"visible",children:b},a.mode,0,null);b.return=a;return a.child=b}function Hd(a,b,c,d){null!==d&&Ye(d);Vb(b,a.child,null,c);a=Df(b,b.pendingProps.children);a.flags|=2;b.memoizedState=null;return a}function vk(a,b,c,d,e,f,g){if(c){if(b.flags&256)return b.flags&=-257,d=vf(Error(n(422))),Hd(a,b,g,d);if(null!==b.memoizedState)return b.child=a.child,b.flags|=128,null;f=d.fallback;e=b.mode;d=Gd({mode:"visible",children:d.children},e,0,null);f=ub(f,e,g,null);f.flags|=2;d.return=\nb;f.return=b;d.sibling=f;b.child=d;0!==(b.mode&1)&&Vb(b,a.child,null,g);b.child.memoizedState=Bf(g);b.memoizedState=Cf;return f}if(0===(b.mode&1))return Hd(a,b,g,null);if("$!"===e.data){d=e.nextSibling&&e.nextSibling.dataset;if(d)var h=d.dgst;d=h;f=Error(n(419));d=vf(f,d,void 0);return Hd(a,b,g,d)}h=0!==(g&a.childLanes);if(ha||h){d=O;if(null!==d){switch(g&-g){case 4:e=2;break;case 16:e=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:e=\n32;break;case 536870912:e=268435456;break;default:e=0}e=0!==(e&(d.suspendedLanes|g))?0:e;0!==e&&e!==f.retryLane&&(f.retryLane=e,Oa(a,e),ya(d,a,e,-1))}Ef();d=vf(Error(n(421)));return Hd(a,b,g,d)}if("$?"===e.data)return b.flags|=128,b.child=a.child,b=wk.bind(null,a),e._reactRetry=b,null;a=f.treeContext;fa=Ka(e.nextSibling);la=b;D=!0;wa=null;null!==a&&(na[oa++]=Ma,na[oa++]=Na,na[oa++]=sb,Ma=a.id,Na=a.overflow,sb=b);b=Df(b,d.children);b.flags|=4096;return b}function wi(a,b,c){a.lanes|=b;var d=a.alternate;\nnull!==d&&(d.lanes|=b);bf(a.return,b,c)}function Ff(a,b,c,d,e){var f=a.memoizedState;null===f?a.memoizedState={isBackwards:b,rendering:null,renderingStartTime:0,last:d,tail:c,tailMode:e}:(f.isBackwards=b,f.rendering=null,f.renderingStartTime=0,f.last=d,f.tail=c,f.tailMode=e)}function xi(a,b,c){var d=b.pendingProps,e=d.revealOrder,f=d.tail;aa(a,b,d.children,c);d=G.current;if(0!==(d&2))d=d&1|2,b.flags|=128;else{if(null!==a&&0!==(a.flags&128))a:for(a=b.child;null!==a;){if(13===a.tag)null!==a.memoizedState&&\nwi(a,c,b);else if(19===a.tag)wi(a,c,b);else if(null!==a.child){a.child.return=a;a=a.child;continue}if(a===b)break a;for(;null===a.sibling;){if(null===a.return||a.return===b)break a;a=a.return}a.sibling.return=a.return;a=a.sibling}d&=1}y(G,d);if(0===(b.mode&1))b.memoizedState=null;else switch(e){case "forwards":c=b.child;for(e=null;null!==c;)a=c.alternate,null!==a&&null===yd(a)&&(e=c),c=c.sibling;c=e;null===c?(e=b.child,b.child=null):(e=c.sibling,c.sibling=null);Ff(b,!1,e,c,f);break;case "backwards":c=\nnull;e=b.child;for(b.child=null;null!==e;){a=e.alternate;if(null!==a&&null===yd(a)){b.child=e;break}a=e.sibling;e.sibling=c;c=e;e=a}Ff(b,!0,c,null,f);break;case "together":Ff(b,!1,null,null,void 0);break;default:b.memoizedState=null}return b.child}function Fd(a,b){0===(b.mode&1)&&null!==a&&(a.alternate=null,b.alternate=null,b.flags|=2)}function Qa(a,b,c){null!==a&&(b.dependencies=a.dependencies);ra|=b.lanes;if(0===(c&b.childLanes))return null;if(null!==a&&b.child!==a.child)throw Error(n(153));if(null!==\nb.child){a=b.child;c=gb(a,a.pendingProps);b.child=c;for(c.return=b;null!==a.sibling;)a=a.sibling,c=c.sibling=gb(a,a.pendingProps),c.return=b;c.sibling=null}return b.child}function xk(a,b,c){switch(b.tag){case 3:ti(b);Qb();break;case 5:Mh(b);break;case 1:ea(b.type)&&ld(b);break;case 4:jf(b,b.stateNode.containerInfo);break;case 10:var d=b.type._context,e=b.memoizedProps.value;y(rd,d._currentValue);d._currentValue=e;break;case 13:d=b.memoizedState;if(null!==d){if(null!==d.dehydrated)return y(G,G.current&\n1),b.flags|=128,null;if(0!==(c&b.child.childLanes))return vi(a,b,c);y(G,G.current&1);a=Qa(a,b,c);return null!==a?a.sibling:null}y(G,G.current&1);break;case 19:d=0!==(c&b.childLanes);if(0!==(a.flags&128)){if(d)return xi(a,b,c);b.flags|=128}e=b.memoizedState;null!==e&&(e.rendering=null,e.tail=null,e.lastEffect=null);y(G,G.current);if(d)break;else return null;case 22:case 23:return b.lanes=0,qi(a,b,c)}return Qa(a,b,c)}function Dc(a,b){if(!D)switch(a.tailMode){case "hidden":b=a.tail;for(var c=null;null!==\nb;)null!==b.alternate&&(c=b),b=b.sibling;null===c?a.tail=null:c.sibling=null;break;case "collapsed":c=a.tail;for(var d=null;null!==c;)null!==c.alternate&&(d=c),c=c.sibling;null===d?b||null===a.tail?a.tail=null:a.tail.sibling=null:d.sibling=null}}function W(a){var b=null!==a.alternate&&a.alternate.child===a.child,c=0,d=0;if(b)for(var e=a.child;null!==e;)c|=e.lanes|e.childLanes,d|=e.subtreeFlags&14680064,d|=e.flags&14680064,e.return=a,e=e.sibling;else for(e=a.child;null!==e;)c|=e.lanes|e.childLanes,\nd|=e.subtreeFlags,d|=e.flags,e.return=a,e=e.sibling;a.subtreeFlags|=d;a.childLanes=c;return b}function yk(a,b,c){var d=b.pendingProps;Ve(b);switch(b.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return W(b),null;case 1:return ea(b.type)&&(w(S),w(J)),W(b),null;case 3:d=b.stateNode;Tb();w(S);w(J);lf();d.pendingContext&&(d.context=d.pendingContext,d.pendingContext=null);if(null===a||null===a.child)pd(b)?b.flags|=4:null===a||a.memoizedState.isDehydrated&&0===(b.flags&\n256)||(b.flags|=1024,null!==wa&&(Gf(wa),wa=null));yi(a,b);W(b);return null;case 5:kf(b);var e=vb(xc.current);c=b.type;if(null!==a&&null!=b.stateNode)zk(a,b,c,d,e),a.ref!==b.ref&&(b.flags|=512,b.flags|=2097152);else{if(!d){if(null===b.stateNode)throw Error(n(166));W(b);return null}a=vb(Ea.current);if(pd(b)){d=b.stateNode;c=b.type;var f=b.memoizedProps;d[Da]=b;d[uc]=f;a=0!==(b.mode&1);switch(c){case "dialog":B("cancel",d);B("close",d);break;case "iframe":case "object":case "embed":B("load",d);break;\ncase "video":case "audio":for(e=0;e\\x3c/script>",a=a.removeChild(a.firstChild)):"string"===typeof d.is?a=g.createElement(c,{is:d.is}):(a=g.createElement(c),"select"===c&&(g=a,d.multiple?g.multiple=!0:d.size&&(g.size=d.size))):a=g.createElementNS(a,c);a[Da]=b;a[uc]=d;Ak(a,b,!1,!1);b.stateNode=a;a:{g=qe(c,d);switch(c){case "dialog":B("cancel",a);B("close",a);e=d;break;case "iframe":case "object":case "embed":B("load",a);e=d;break;\ncase "video":case "audio":for(e=0;eHf&&(b.flags|=128,d=!0,Dc(f,!1),b.lanes=4194304)}else{if(!d)if(a=yd(g),null!==a){if(b.flags|=128,d=!0,c=a.updateQueue,null!==c&&(b.updateQueue=c,b.flags|=4),Dc(f,!0),null===f.tail&&"hidden"===f.tailMode&&!g.alternate&&!D)return W(b),null}else 2*P()-f.renderingStartTime>Hf&&1073741824!==c&&(b.flags|=\n128,d=!0,Dc(f,!1),b.lanes=4194304);f.isBackwards?(g.sibling=b.child,b.child=g):(c=f.last,null!==c?c.sibling=g:b.child=g,f.last=g)}if(null!==f.tail)return b=f.tail,f.rendering=b,f.tail=b.sibling,f.renderingStartTime=P(),b.sibling=null,c=G.current,y(G,d?c&1|2:c&1),b;W(b);return null;case 22:case 23:return ba=Ga.current,w(Ga),d=null!==b.memoizedState,null!==a&&null!==a.memoizedState!==d&&(b.flags|=8192),d&&0!==(b.mode&1)?0!==(ba&1073741824)&&(W(b),b.subtreeFlags&6&&(b.flags|=8192)):W(b),null;case 24:return null;\ncase 25:return null}throw Error(n(156,b.tag));}function Ck(a,b,c){Ve(b);switch(b.tag){case 1:return ea(b.type)&&(w(S),w(J)),a=b.flags,a&65536?(b.flags=a&-65537|128,b):null;case 3:return Tb(),w(S),w(J),lf(),a=b.flags,0!==(a&65536)&&0===(a&128)?(b.flags=a&-65537|128,b):null;case 5:return kf(b),null;case 13:w(G);a=b.memoizedState;if(null!==a&&null!==a.dehydrated){if(null===b.alternate)throw Error(n(340));Qb()}a=b.flags;return a&65536?(b.flags=a&-65537|128,b):null;case 19:return w(G),null;case 4:return Tb(),\nnull;case 10:return af(b.type._context),null;case 22:case 23:return ba=Ga.current,w(Ga),null;case 24:return null;default:return null}}function Wb(a,b){var c=a.ref;if(null!==c)if("function"===typeof c)try{c(null)}catch(d){H(a,b,d)}else c.current=null}function If(a,b,c){try{c()}catch(d){H(a,b,d)}}function Dk(a,b){Jf=Zc;a=ch();if(Ie(a)){if("selectionStart"in a)var c={start:a.selectionStart,end:a.selectionEnd};else a:{c=(c=a.ownerDocument)&&c.defaultView||window;var d=c.getSelection&&c.getSelection();\nif(d&&0!==d.rangeCount){c=d.anchorNode;var e=d.anchorOffset,f=d.focusNode;d=d.focusOffset;try{c.nodeType,f.nodeType}catch(M){c=null;break a}var g=0,h=-1,k=-1,m=0,t=0,u=a,r=null;b:for(;;){for(var p;;){u!==c||0!==e&&3!==u.nodeType||(h=g+e);u!==f||0!==d&&3!==u.nodeType||(k=g+d);3===u.nodeType&&(g+=u.nodeValue.length);if(null===(p=u.firstChild))break;r=u;u=p}for(;;){if(u===a)break b;r===c&&++m===e&&(h=g);r===f&&++t===d&&(k=g);if(null!==(p=u.nextSibling))break;u=r;r=u.parentNode}u=p}c=-1===h||-1===k?null:\n{start:h,end:k}}else c=null}c=c||{start:0,end:0}}else c=null;Kf={focusedElem:a,selectionRange:c};Zc=!1;for(l=b;null!==l;)if(b=l,a=b.child,0!==(b.subtreeFlags&1028)&&null!==a)a.return=b,l=a;else for(;null!==l;){b=l;try{var x=b.alternate;if(0!==(b.flags&1024))switch(b.tag){case 0:case 11:case 15:break;case 1:if(null!==x){var w=x.memoizedProps,z=x.memoizedState,A=b.stateNode,v=A.getSnapshotBeforeUpdate(b.elementType===b.type?w:xa(b.type,w),z);A.__reactInternalSnapshotBeforeUpdate=v}break;case 3:var q=\nb.stateNode.containerInfo;1===q.nodeType?q.textContent="":9===q.nodeType&&q.documentElement&&q.removeChild(q.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(n(163));}}catch(M){H(b,b.return,M)}a=b.sibling;if(null!==a){a.return=b.return;l=a;break}l=b.return}x=Ai;Ai=!1;return x}function Gc(a,b,c){var d=b.updateQueue;d=null!==d?d.lastEffect:null;if(null!==d){var e=d=d.next;do{if((e.tag&a)===a){var f=e.destroy;e.destroy=void 0;void 0!==f&&If(b,c,f)}e=e.next}while(e!==d)}}\nfunction Id(a,b){b=b.updateQueue;b=null!==b?b.lastEffect:null;if(null!==b){var c=b=b.next;do{if((c.tag&a)===a){var d=c.create;c.destroy=d()}c=c.next}while(c!==b)}}function Lf(a){var b=a.ref;if(null!==b){var c=a.stateNode;switch(a.tag){case 5:a=c;break;default:a=c}"function"===typeof b?b(a):b.current=a}}function Bi(a){var b=a.alternate;null!==b&&(a.alternate=null,Bi(b));a.child=null;a.deletions=null;a.sibling=null;5===a.tag&&(b=a.stateNode,null!==b&&(delete b[Da],delete b[uc],delete b[Me],delete b[Ek],\ndelete b[Fk]));a.stateNode=null;a.return=null;a.dependencies=null;a.memoizedProps=null;a.memoizedState=null;a.pendingProps=null;a.stateNode=null;a.updateQueue=null}function Ci(a){return 5===a.tag||3===a.tag||4===a.tag}function Di(a){a:for(;;){for(;null===a.sibling;){if(null===a.return||Ci(a.return))return null;a=a.return}a.sibling.return=a.return;for(a=a.sibling;5!==a.tag&&6!==a.tag&&18!==a.tag;){if(a.flags&2)continue a;if(null===a.child||4===a.tag)continue a;else a.child.return=a,a=a.child}if(!(a.flags&\n2))return a.stateNode}}function Mf(a,b,c){var d=a.tag;if(5===d||6===d)a=a.stateNode,b?8===c.nodeType?c.parentNode.insertBefore(a,b):c.insertBefore(a,b):(8===c.nodeType?(b=c.parentNode,b.insertBefore(a,c)):(b=c,b.appendChild(a)),c=c._reactRootContainer,null!==c&&void 0!==c||null!==b.onclick||(b.onclick=kd));else if(4!==d&&(a=a.child,null!==a))for(Mf(a,b,c),a=a.sibling;null!==a;)Mf(a,b,c),a=a.sibling}function Nf(a,b,c){var d=a.tag;if(5===d||6===d)a=a.stateNode,b?c.insertBefore(a,b):c.appendChild(a);\nelse if(4!==d&&(a=a.child,null!==a))for(Nf(a,b,c),a=a.sibling;null!==a;)Nf(a,b,c),a=a.sibling}function jb(a,b,c){for(c=c.child;null!==c;)Ei(a,b,c),c=c.sibling}function Ei(a,b,c){if(Ca&&"function"===typeof Ca.onCommitFiberUnmount)try{Ca.onCommitFiberUnmount(Uc,c)}catch(h){}switch(c.tag){case 5:X||Wb(c,b);case 6:var d=T,e=za;T=null;jb(a,b,c);T=d;za=e;null!==T&&(za?(a=T,c=c.stateNode,8===a.nodeType?a.parentNode.removeChild(c):a.removeChild(c)):T.removeChild(c.stateNode));break;case 18:null!==T&&(za?\n(a=T,c=c.stateNode,8===a.nodeType?Re(a.parentNode,c):1===a.nodeType&&Re(a,c),nc(a)):Re(T,c.stateNode));break;case 4:d=T;e=za;T=c.stateNode.containerInfo;za=!0;jb(a,b,c);T=d;za=e;break;case 0:case 11:case 14:case 15:if(!X&&(d=c.updateQueue,null!==d&&(d=d.lastEffect,null!==d))){e=d=d.next;do{var f=e,g=f.destroy;f=f.tag;void 0!==g&&(0!==(f&2)?If(c,b,g):0!==(f&4)&&If(c,b,g));e=e.next}while(e!==d)}jb(a,b,c);break;case 1:if(!X&&(Wb(c,b),d=c.stateNode,"function"===typeof d.componentWillUnmount))try{d.props=\nc.memoizedProps,d.state=c.memoizedState,d.componentWillUnmount()}catch(h){H(c,b,h)}jb(a,b,c);break;case 21:jb(a,b,c);break;case 22:c.mode&1?(X=(d=X)||null!==c.memoizedState,jb(a,b,c),X=d):jb(a,b,c);break;default:jb(a,b,c)}}function Fi(a){var b=a.updateQueue;if(null!==b){a.updateQueue=null;var c=a.stateNode;null===c&&(c=a.stateNode=new Gk);b.forEach(function(b){var d=Hk.bind(null,a,b);c.has(b)||(c.add(b),b.then(d,d))})}}function Aa(a,b,c){c=b.deletions;if(null!==c)for(var d=0;de&&(e=g);d&=~f}d=e;d=P()-d;d=(120>d?120:480>d?480:1080>d?1080:1920>d?1920:3E3>d?3E3:4320>d?4320:1960*Nk(d/1960))-d;if(10a?16:a;if(null===lb)var d=!1;else{a=lb;lb=null;Qd=0;if(0!==(p&6))throw Error(n(331));var e=p;p|=4;for(l=a.current;null!==l;){var f=l,g=f.child;if(0!==(l.flags&16)){var h=f.deletions;if(null!==h){for(var k=0;kP()-Of?xb(a,0):Sf|=c);ia(a,b)}function Ui(a,b){0===b&&(0===(a.mode&1)?b=1:(b=Rd,Rd<<=1,0===(Rd&130023424)&&(Rd=4194304)));var c=Z();a=Oa(a,b);null!==a&&(ic(a,b,c),ia(a,c))}function wk(a){var b=a.memoizedState,c=0;null!==b&&(c=b.retryLane);Ui(a,c)}function Hk(a,b){var c=0;switch(a.tag){case 13:var d=a.stateNode;var e=a.memoizedState;null!==e&&(c=e.retryLane);\nbreak;case 19:d=a.stateNode;break;default:throw Error(n(314));}null!==d&&d.delete(b);Ui(a,c)}function Ni(a,b){return xh(a,b)}function Uk(a,b,c,d){this.tag=a;this.key=c;this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null;this.index=0;this.ref=null;this.pendingProps=b;this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null;this.mode=d;this.subtreeFlags=this.flags=0;this.deletions=null;this.childLanes=this.lanes=0;this.alternate=null}function yf(a){a=\na.prototype;return!(!a||!a.isReactComponent)}function Vk(a){if("function"===typeof a)return yf(a)?1:0;if(void 0!==a&&null!==a){a=a.$$typeof;if(a===ie)return 11;if(a===je)return 14}return 2}function gb(a,b){var c=a.alternate;null===c?(c=pa(a.tag,b,a.key,a.mode),c.elementType=a.elementType,c.type=a.type,c.stateNode=a.stateNode,c.alternate=a,a.alternate=c):(c.pendingProps=b,c.type=a.type,c.flags=0,c.subtreeFlags=0,c.deletions=null);c.flags=a.flags&14680064;c.childLanes=a.childLanes;c.lanes=a.lanes;c.child=\na.child;c.memoizedProps=a.memoizedProps;c.memoizedState=a.memoizedState;c.updateQueue=a.updateQueue;b=a.dependencies;c.dependencies=null===b?null:{lanes:b.lanes,firstContext:b.firstContext};c.sibling=a.sibling;c.index=a.index;c.ref=a.ref;return c}function wd(a,b,c,d,e,f){var g=2;d=a;if("function"===typeof a)yf(a)&&(g=1);else if("string"===typeof a)g=5;else a:switch(a){case Bb:return ub(c.children,e,f,b);case fe:g=8;e|=8;break;case ee:return a=pa(12,c,b,e|2),a.elementType=ee,a.lanes=f,a;case ge:return a=\npa(13,c,b,e),a.elementType=ge,a.lanes=f,a;case he:return a=pa(19,c,b,e),a.elementType=he,a.lanes=f,a;case Vi:return Gd(c,e,f,b);default:if("object"===typeof a&&null!==a)switch(a.$$typeof){case hg:g=10;break a;case gg:g=9;break a;case ie:g=11;break a;case je:g=14;break a;case Ta:g=16;d=null;break a}throw Error(n(130,null==a?a:typeof a,""));}b=pa(g,c,b,e);b.elementType=a;b.type=d;b.lanes=f;return b}function ub(a,b,c,d){a=pa(7,a,d,b);a.lanes=c;return a}function Gd(a,b,c,d){a=pa(22,a,d,b);a.elementType=\nVi;a.lanes=c;a.stateNode={isHidden:!1};return a}function gf(a,b,c){a=pa(6,a,null,b);a.lanes=c;return a}function hf(a,b,c){b=pa(4,null!==a.children?a.children:[],a.key,b);b.lanes=c;b.stateNode={containerInfo:a.containerInfo,pendingChildren:null,implementation:a.implementation};return b}function Wk(a,b,c,d,e){this.tag=b;this.containerInfo=a;this.finishedWork=this.pingCache=this.current=this.pendingChildren=null;this.timeoutHandle=-1;this.callbackNode=this.pendingContext=this.context=null;this.callbackPriority=\n0;this.eventTimes=we(0);this.expirationTimes=we(-1);this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0;this.entanglements=we(0);this.identifierPrefix=d;this.onRecoverableError=e;this.mutableSourceEagerHydrationData=null}function Vf(a,b,c,d,e,f,g,h,k,m){a=new Wk(a,b,c,h,k);1===b?(b=1,!0===f&&(b|=8)):b=0;f=pa(3,null,null,b);a.current=f;f.stateNode=a;f.memoizedState={element:d,isDehydrated:c,cache:null,transitions:null,\npendingSuspenseBoundaries:null};df(f);return a}function Xk(a,b,c){var d=3