You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
10 lines
97 KiB
10 lines
97 KiB
/*
|
|
THIS IS A GENERATED/BUNDLED FILE BY ESBUILD
|
|
if you want to view the source, please visit the github repository of this plugin (https://github.com/phibr0/obsidian-commander)
|
|
*/
|
|
|
|
var Oe=Object.defineProperty,vn=Object.defineProperties,gn=Object.getOwnPropertyDescriptor,bn=Object.getOwnPropertyDescriptors,Cn=Object.getOwnPropertyNames,He=Object.getOwnPropertySymbols;var pt=Object.prototype.hasOwnProperty,qt=Object.prototype.propertyIsEnumerable;var Ut=(t,o,e)=>o in t?Oe(t,o,{enumerable:!0,configurable:!0,writable:!0,value:e}):t[o]=e,Fe=(t,o)=>{for(var e in o||(o={}))pt.call(o,e)&&Ut(t,e,o[e]);if(He)for(var e of He(o))qt.call(o,e)&&Ut(t,e,o[e]);return t},Xt=(t,o)=>vn(t,bn(o));var Jt=(t,o)=>{var e={};for(var n in t)pt.call(t,n)&&o.indexOf(n)<0&&(e[n]=t[n]);if(t!=null&&He)for(var n of He(t))o.indexOf(n)<0&&qt.call(t,n)&&(e[n]=t[n]);return e};var _n=(t,o)=>{for(var e in o)Oe(t,e,{get:o[e],enumerable:!0})},wn=(t,o,e,n)=>{if(o&&typeof o=="object"||typeof o=="function")for(let i of Cn(o))!pt.call(t,i)&&i!==e&&Oe(t,i,{get:()=>o[i],enumerable:!(n=gn(o,i))||n.enumerable});return t};var yn=t=>wn(Oe({},"__esModule",{value:!0}),t);var ri={};_n(ri,{default:()=>ct});module.exports=yn(ri);var ze=require("obsidian");var vt=require("obsidian");var jt={};var Yt={};var Zt={};var $t={"Open Commander Settings":"Commander Einstellungen \xF6ffnen","Open Macro Builder":"Makro Baukasten \xF6ffnen","Change Icon":"Symbol ver\xE4ndern",Rename:"Umbenennen",Delete:"L\xF6schen","Add command":"Befehl hinzuf\xFCgen","Add new":"Neuen Befehl hinzuf\xFCgen","This Command seems to have been removed. {{command_name}}":"Dieser Befehl wurde entfernt. {{command_name}}","Choose a Command to add":"W\xE4hle einen Befehl zum hinzuf\xFCgen","to navigate":"zum navigieren","to choose an icon":"um ein symbol auszuw\xE4hlen","to cancel":"zum abbrechen","Use a custom name":"Nutze einen benutzerdefinierten Namen","Choose a custom Name for your new Command":"W\xE4hle einen benutzerdefinierten Namen f\xFCr deinen neuen Befehl","to save":"zum speichern","Choose a Icon for your new Command":"W\xE4hle ein Symbol f\xFCr deinen neuen Befehl","to choose a custom icon":"um ein benutzerdefiniertes Symbol auszuw\xE4hlen","Remove Command":"Befehl entfernen","Double click to rename":"Zum umbenennen doppelklicken","This device":"Dieses Ger\xE4t","Added by {{plugin_name}}.":"Hinzugef\xFCgt von {{plugin_name}}.","Warning: This is a checked Command, meaning it might not run under every circumstance.":"Warnung: Dieser Befehl wird nur unter bestimmten Vorraussetzungen ausgef\xFChrt.","Move down":"Nach unten","Move up":"Nach oben","Change Mode (Currently: {{current_mode}})":"Modus ver\xE4ndern (Momentan: {{current_mode}})","Are you sure you want to delete the Command?":"Bist du dir sicher, dass du diesen Befehl entfernen m\xF6chtest?","Remove and don't ask again":"Entfernen und Auswahl speichern",Remove:"Entfernen",Cancel:"Abbrechen","Always ask before removing?":"Immer fragen, bevor ein Befehl gel\xF6scht wird?","Always show a Popup to confirm deletion of a Command.":"Zeige immer ein Popup um L\xF6schen zu best\xE4tigen.",'Show "Add Command" Button':'Zeige "Befehl hinzuf\xFCgen" Knopf','Show the "Add Command" Button in every Menu. Requires restart.':'Zeige den "Befehl hinzuf\xFCgen" Knopf in jedem Men\xFC. Erfordert neustart.',"Please restart Obsidian for these changes to take effect.":"Bitte starte Obsidian neu, damit diese \xC4nderungen in Kraft treten.","Enable debugging":"Aktiviere debugging","Enable console output.":"Aktiviere Konsolen-Output (F\xFCr Entwickler)",General:"Allgemein","Editor Menu":"Editor-Men\xFC","File Menu":"Datei-Men\xFC","Left Ribbon":"Band","Right Ribbon":"Rechtes Band",Titlebar:"Titelleiste",Statusbar:"Statusleiste","Page Header":"Kopfzeile","Support development":"Entwicklung unterst\xFCtzen","No commands here!":"Keine Befehle da!","Would you like to add one now?":"M\xF6chtest du jetzt einen hinzuf\xFCgen?","Hide Commands":"Befehle verstecken","Choose new":"W\xE4hle neu","Hide Commands of other Plugins":"Hide Commands of other Plugins",Icon:"Symbol",Name:"Name","Custom Name":"Benutzerdefinierter Name","Add command to all devices":"F\xFCge Befehl allen Ger\xE4ten hinzu","Add command only to mobile devices":"F\xFCge Befehl nur Mobilen Ger\xE4ten hinzu","Add command only to desktop devices":"F\xFCge Befehl nur Desktop Ger\xE4ten hinzu","Add command only to this device":"F\xFCge Befehl nur diesem Ger\xE4t hinzu",Done:"Fertig","By Johnny\u2728 and phibr0":"Von Johnny\u2728 und phibr0","Leave feedback":"Feedback geben",Donate:"Spenden","Share feedback, issues, and ideas with our feedback form.":"Teile Feedback, Probleme und Ideen mit unserem Feedback Formular!","Consider donating to support development.":"Spende um die Entwicklung zu unterst\xFCtzen.",Save:"Speichern","This Command is not available on this device.":"Dieser Befehl ist auf diesem Ger\xE4t nicht verf\xFCgbar.",Show:"Anzeigen",Hide:"Verstecken","Hide other Commands":"Andere Befehle verstecken","Double click to enter custom value":"Doppelklicken um eigenen Wert einzutragen","Choose custom spacing for Command Buttons":"W\xE4hle den Abstand zwischen Befehlen","Change the spacing between commands. You can set different values on mobile and desktop.":"Ver\xE4ndert den Abstand zwischen Befehlen.",Warning:"Achtung","As of Obsidian 0.16.0 you need to explicitly enable the View Header.":'Ab Obsidian Version 0.16.0 m\xFCssen Sie den "View Header" explizit aktivieren. Anschlie\xDFend muss Obsidian neugestartet werden.',"Open Appearance Settings":"\xD6ffne Darstellungs-Einstellungen",Explorer:"Explorer"};var ft={"Open Commander Settings":"Open Commander Settings","Open Macro Builder":"Open Macro Builder","Change Icon":"Change Icon",Rename:"Rename",Delete:"Delete","Add command":"Add command","Add new":"Add new command","This Command seems to have been removed. {{command_name}}":"This Command seems to have been removed. {{command_name}}","Choose a Command to add":"Choose a Command to add","to navigate":"to navigate","to choose an icon":"to choose an icon","to cancel":"to cancel","Use a custom name":"Use a custom name","Choose a custom Name for your new Command":"Choose a custom Name for your new Command","to save":"to save","Choose a Icon for your new Command":"Choose a Icon for your new Command","to choose a custom icon":"to choose a custom icon","Remove Command":"Remove Command","Double click to rename":"Double click to rename","This device":"This device","Added by {{plugin_name}}.":"Added by {{plugin_name}}.","Warning: This is a checked Command, meaning it might not run under every circumstance.":"Warning: This is a checked Command, meaning it might not run under every circumstance.","Move down":"Move down","Move up":"Move up","Change Mode (Currently: {{current_mode}})":"Change Mode (Currently: {{current_mode}})","Are you sure you want to delete the Command?":"Are you sure you want to delete the Command?","Remove and don't ask again":"Remove and don't ask again",Remove:"Remove",Cancel:"Cancel","Always ask before removing?":"Always ask before removing?","Always show a Popup to confirm deletion of a Command.":"Always show a Popup to confirm deletion of a Command.",'Show "Add Command" Button':'Show "Add Command" Button','Show the "Add Command" Button in every Menu. Requires restart.':'Show the "Add Command" Button in every Menu. Requires restart.',"Please restart Obsidian for these changes to take effect.":"Please restart Obsidian for these changes to take effect.","Enable debugging":"Enable debugging","Enable console output.":"Enable console output.",General:"General","Editor Menu":"Editor Menu","File Menu":"File Menu","Left Ribbon":"Ribbon","Right Ribbon":"Right Ribbon",Titlebar:"Titlebar",Statusbar:"Status Bar","Page Header":"Tab Bar","Support development":"Support development","No commands here!":"No commands here!","Would you like to add one now?":"Would you like to add one now?","Hide Commands":"Hide Commands","Choose new":"Choose new","Hide Commands of other Plugins":"Hide Commands of other Plugins",Icon:"Icon",Name:"Name","Custom Name":"Custom Name","Add command to all devices":"Add command to all devices","Add command only to mobile devices":"Add command only to mobile devices","Add command only to desktop devices":"Add command only to desktop devices","Add command only to this device":"Add command only to this device",Done:"Done","By Johnny\u2728 and phibr0":"By Johnny\u2728 and phibr0","Leave feedback":"Leave feedback",Donate:"Donate","Share feedback, issues, and ideas with our feedback form.":"Share feedback, issues, and ideas with our feedback form.","Consider donating to support development.":"Consider donating to support development.",Save:"Save","This Command is not available on this device.":"This Command is not available on this device.",Show:"Show",Hide:"Hide","Hide other Commands":"Hide other Commands","Double click to enter custom value":"Double click to enter custom value","Choose custom spacing for Command Buttons":"Choose custom spacing for Command Buttons","Change the spacing between commands. You can set different values on mobile and desktop.":"Change the spacing between commands.",Warning:"Warning","As of Obsidian 0.16.0 you need to explicitly enable the View Header.":"As of Obsidian 0.16.0 you need to explicitly enable the Tab Title Bar. Once enabled, you might need to restart Obsidian.","Open Appearance Settings":"Open Appearance Settings",Explorer:"Explorer"};var Gt={};var Kt={};var Qt={};var eo={};var to={};var oo={};var no={};var io={};var ao={};var ro={};var so={};var co={};var mo={};var lo={};var uo={};var po={};var fo={"Open Commander Settings":"\u6253\u5F00 Commander \u8BBE\u7F6E","Open Macro Builder":"\u6253\u5F00\u5B8F\u6307\u4EE4\u751F\u6210\u5668","Change Icon":"\u66F4\u6362\u56FE\u6807",Rename:"\u91CD\u547D\u540D",Delete:"\u5220\u9664","Add command":"\u6DFB\u52A0\u547D\u4EE4","Add new":"\u6DFB\u52A0\u65B0\u547D\u4EE4","This Command seems to have been removed. {{command_name}}":"\u8BE5\u547D\u4EE4\u4F3C\u4E4E\u5DF2\u88AB\u79FB\u9664\u3002{{command_name}}","Choose a Command to add":"\u9009\u62E9\u4E00\u4E2A\u547D\u4EE4\u5E76\u6DFB\u52A0","to navigate":"\u5BFC\u822A","to choose an icon":"\u9009\u4E2D\u4E00\u4E2A\u56FE\u6807","to cancel":"\u53D6\u6D88","Use a custom name":"\u4F7F\u7528\u4E00\u4E2A\u81EA\u5B9A\u4E49\u540D\u79F0","Choose a custom Name for your new Command":"\u4E3A\u4F60\u7684\u65B0\u547D\u4EE4\u9009\u62E9\u4E00\u4E2A\u81EA\u5B9A\u4E49\u540D\u79F0","to save":"\u4FDD\u5B58","Choose a Icon for your new Command":"\u4E3A\u4F60\u7684\u65B0\u547D\u4EE4\u9009\u62E9\u4E00\u4E2A\u56FE\u6807","to choose a custom icon":"\u9009\u62E9\u4E00\u4E2A\u81EA\u5B9A\u4E49\u56FE\u6807","Remove Command":"\u79FB\u9664\u547D\u4EE4","Double click to rename":"\u53CC\u51FB\u4EE5\u91CD\u547D\u540D","This device":"\u8BE5\u8BBE\u5907","Added by {{plugin_name}}.":"\u7531{{plugin_name}}\u6DFB\u52A0\u3002","Warning: This is a checked Command, meaning it might not run under every circumstance.":"\u8B66\u544A\uFF1A\u8FD9\u662F\u4E00\u4E2A\u53D7\u68C0\u7684\u547D\u4EE4\uFF0C\u8FD9\u610F\u5473\u7740\u5B83\u672A\u5FC5\u80FD\u5728\u6240\u4EE5\u73AF\u5883\u4E0B\u8FD0\u884C\u3002","Move down":"\u5411\u4E0B\u79FB\u52A8","Move up":"\u5411\u4E0A\u79FB\u52A8","Change Mode (Currently: {{current_mode}})":"\u5207\u6362\u6A21\u5F0F\uFF08\u5F53\u524D\uFF1A{{current_mode}}\uFF09","Are you sure you want to delete the Command?":"\u662F\u5426\u786E\u8BA4\u79FB\u9664\u8BE5\u547D\u4EE4\uFF1F","Remove and don't ask again":"\u79FB\u9664\u4E14\u4E0D\u8981\u518D\u8BE2\u95EE",Remove:"\u79FB\u9664",Cancel:"\u53D6\u6D88","Always ask before removing?":"\u5728\u79FB\u9664\u524D\u603B\u662F\u8BE2\u95EE\uFF1F","Always show a Popup to confirm deletion of a Command.":"\u5728\u786E\u8BA4\u79FB\u9664\u547D\u4EE4\u524D\u603B\u662F\u5F39\u7A97\u3002",'Show "Add Command" Button':"\u663E\u793A\u201C\u6DFB\u52A0\u547D\u4EE4\u201D\u6309\u94AE",'Show the "Add Command" Button in every Menu. Requires restart.':"\u5728\u6BCF\u4E2A\u83DC\u5355\u90FD\u5C55\u793A\u201C\u6DFB\u52A0\u547D\u4EE4\u201D\u6309\u94AE\u3002\u9700\u8981\u91CD\u542F\u3002","Please restart Obsidian for these changes to take effect.":"\u8BF7\u91CD\u542F Obsidian \u4EE5\u4F7F\u8FD9\u4E9B\u66F4\u6539\u751F\u6548\u3002","Enable debugging":"\u542F\u7528\u9664\u9519","Enable console output.":"\u542F\u7528\u63A7\u5236\u53F0\u8F93\u51FA\u3002",General:"\u901A\u7528","Editor Menu":"\u7F16\u8F91\u5668\u83DC\u5355","File Menu":"\u6587\u4EF6\u83DC\u5355","Left Ribbon":"\u5DE6\u4FA7\u8FB9\u680F","Right Ribbon":"\u53F3\u4FA7\u8FB9\u680F",Titlebar:"\u6807\u9898\u680F",Statusbar:"\u72B6\u6001\u680F","Page Header":"\u9875\u9996","Support development":"\u652F\u6301\u5F00\u53D1","No commands here!":"\u8FD9\u91CC\u6CA1\u6709\u547D\u4EE4\uFF01","Would you like to add one now?":"\u4F60\u73B0\u5728\u60F3\u8981\u52A0\u4E00\u4E2A\u5417\uFF1F","Hide Commands":"\u9690\u85CF\u547D\u4EE4","Choose new":"\u9009\u62E9\u65B0\u7684","Hide Commands of other Plugins":"\u9690\u85CF\u5176\u4ED6\u63D2\u4EF6\u7684\u547D\u4EE4",Icon:"\u56FE\u6807",Name:"\u540D\u79F0","Custom Name":"\u81EA\u5B9A\u4E49\u540D\u79F0","Add command to all devices":"\u5411\u6240\u6709\u8BBE\u5907\u6DFB\u52A0\u547D\u4EE4","Add command only to mobile devices":"\u53EA\u5411\u79FB\u52A8\u8BBE\u5907\u6DFB\u52A0\u547D\u4EE4","Add command only to desktop devices":"\u53EA\u5411\u684C\u9762\u8BBE\u5907\u6DFB\u52A0\u547D\u4EE4","Add command only to this device":"\u53EA\u5411\u5F53\u524D\u8BBE\u5907\u6DFB\u52A0\u547D\u4EE4",Done:"\u5B8C\u6210","By Johnny\u2728 and phibr0":"\u7531 Johnny\u2728 \u548C phibr0 \u5F00\u53D1","Leave feedback":"\u7559\u4E0B\u53CD\u9988",Donate:"\u6350\u8D60","Share feedback, issues, and ideas with our feedback form.":"\u4EE5\u6211\u4EEC\u7684\u53CD\u9988\u8868\uFF0C\u5206\u4EAB\u53CD\u9988\u3001\u8BAE\u9898\u6216\u8005\u4F60\u7684\u60F3\u6CD5\u3002","Consider donating to support development.":"\u8003\u8651\u6350\u8D60\u4EE5\u652F\u6301\u5F00\u53D1\u3002",Save:"\u4FDD\u5B58","This Command is not available on this device.":"\u8FD9\u4E00\u547D\u4EE4\u5728\u5F53\u524D\u8BBE\u5907\u4E0D\u53EF\u7528\u3002",Show:"\u663E\u793A",Hide:"\u9690\u85CF","Hide other Commands":"\u9690\u85CF\u5176\u4F59\u547D\u4EE4","Double click to enter custom value":"\u53CC\u51FB\u4EE5\u6DFB\u52A0\u81EA\u5B9A\u4E49\u503C","Choose custom spacing for Command Buttons":"\u4E3A\u547D\u4EE4\u6309\u94AE\u9009\u62E9\u81EA\u5B9A\u4E49\u95F4\u8DDD","Change the spacing between commands. You can set different values on mobile and desktop.":"\u6539\u53D8\u547D\u4EE4\u4E4B\u95F4\u7684\u95F4\u8DDD\u3002\u4F60\u53EF\u4EE5\u4E3A\u79FB\u52A8\u548C\u684C\u9762\u8BBE\u5907\u8BBE\u7F6E\u4E0D\u540C\u7684\u503C\u3002"};var ho={};var Jn={ar:jt,cs:Yt,da:Zt,de:$t,en:ft,"en-gb":Gt,es:Kt,fr:Qt,hi:eo,id:to,it:oo,ja:no,ko:io,nl:ao,nn:ro,pl:so,pt:co,"pt-br":mo,ro:lo,ru:uo,tr:po,"zh-cn":fo,"zh-tw":ho},ht=Jn[vt.moment.locale()];function m(t){return ht||console.error("Error: dictionary locale not found",vt.moment.locale()),ht&&ht[t]||ft[t]}var ne=class extends ze.FuzzySuggestModal{constructor(e){super(app);this.plugin=e,this.commands=Object.values(app.commands.commands),this.setPlaceholder(m("Choose a Command to add")),this.setInstructions([{command:"\u2191\u2193",purpose:m("to navigate")},{command:"\u21B5",purpose:m("to choose an icon")},{command:"esc",purpose:m("to cancel")}])}async awaitSelection(){return this.open(),new Promise((e,n)=>{this.onChooseItem=i=>e(i),this.onClose=()=>window.setTimeout(()=>n("No Command selected"),0)})}renderSuggestion(e,n){if(n.addClass("mod-complex"),n.createDiv({cls:"suggestion-content"}).createDiv({cls:"suggestion-title"}).setText(e.item.name),e.item.icon){let r=n.createDiv({cls:"suggestion-aux"});(0,ze.setIcon)(r.createSpan({cls:"suggestion-flair"}),e.item.icon)}}getItems(){return this.commands}getItemText(e){return e.name}onChooseItem(e,n){}};var vo={confirmDeletion:!0,showAddCommand:!0,debug:!1,editorMenu:[],fileMenu:[],leftRibbon:[],rightRibbon:[],titleBar:[],statusBar:[],pageHeader:[],macros:[],explorer:[],hide:{statusbar:[],leftRibbon:[]},spacing:8,advancedToolbar:{rowHeight:48,rowCount:1,spacing:0,buttonWidth:48,columnLayout:!1,mappedIcons:[],tooltips:!1,heightOffset:0}},go=["activity","airplay","alarm-check","alarm-clock-off","alarm-clock","alarm-minus","alarm-plus","album","alert-circle","alert-octagon","alert-triangle","align-center-horizontal","align-center-vertical","align-center","align-end-horizontal","align-end-vertical","align-horizontal-distribute-center","align-horizontal-distribute-end","align-horizontal-distribute-start","align-horizontal-justify-center","align-horizontal-justify-end","align-horizontal-justify-start","align-horizontal-space-around","align-horizontal-space-between","align-justify","align-left","align-right","align-start-horizontal","align-start-vertical","align-vertical-distribute-center","align-vertical-distribute-end","align-vertical-distribute-start","align-vertical-justify-center","align-vertical-justify-end","align-vertical-justify-start","align-vertical-space-around","align-vertical-space-between","anchor","aperture","archive","arrow-big-down","arrow-big-left","arrow-big-right","arrow-big-up","arrow-down-circle","arrow-down-left","arrow-down-right","arrow-down","arrow-left-circle","arrow-left-right","arrow-left","arrow-right-circle","arrow-right","arrow-up-circle","arrow-up-left","arrow-up-right","arrow-up","asterisk","at-sign","award","axe","banknote","bar-chart-2","bar-chart","baseline","battery-charging","battery-full","battery-low","battery-medium","battery","beaker","bell-minus","bell-off","bell-plus","bell-ring","bell","bike","binary","bitcoin","bluetooth-connected","bluetooth-off","bluetooth-searching","bluetooth","bold","book-open","book","bookmark-minus","bookmark-plus","bookmark","bot","box-select","box","briefcase","brush","bug","building-2","building","bus","calculator","calendar","camera-off","camera","car","carrot","cast","check-circle-2","check-circle","check-square","check","chevron-down","chevron-first","chevron-last","chevron-left","chevron-right","chevron-up","chevrons-down-up","chevrons-down","chevrons-left","chevrons-right","chevrons-up-down","chevrons-up","chrome","circle-slashed","circle","clipboard-check","clipboard-copy","clipboard-list","clipboard-x","clipboard","clock-1","clock-10","clock-11","clock-12","clock-2","clock-3","clock-4","clock-5","clock-6","clock-7","clock-8","clock-9","lucide-clock","cloud-drizzle","cloud-fog","cloud-hail","cloud-lightning","cloud-moon","cloud-off","cloud-rain-wind","cloud-rain","cloud-snow","cloud-sun","lucide-cloud","cloudy","clover","code-2","code","codepen","codesandbox","coffee","coins","columns","command","compass","contact","contrast","cookie","copy","copyleft","copyright","corner-down-left","corner-down-right","corner-left-down","corner-left-up","corner-right-down","corner-right-up","corner-up-left","corner-up-right","cpu","credit-card","crop","lucide-cross","crosshair","crown","currency","database","delete","dice-1","dice-2","dice-3","dice-4","dice-5","dice-6","disc","divide-circle","divide-square","divide","dollar-sign","download-cloud","download","dribbble","droplet","droplets","drumstick","edit-2","edit-3","edit","egg","equal-not","equal","eraser","euro","expand","external-link","eye-off","eye","facebook","fast-forward","feather","figma","file-check-2","file-check","file-code","file-digit","file-input","file-minus-2","file-minus","file-output","file-plus-2","file-plus","file-search","file-text","file-x-2","file-x","file","files","film","filter","flag-off","flag-triangle-left","flag-triangle-right","flag","flame","flashlight-off","flashlight","flask-conical","flask-round","folder-minus","folder-open","folder-plus","lucide-folder","form-input","forward","frame","framer","frown","function-square","gamepad-2","gamepad","gauge","gavel","gem","ghost","gift","git-branch-plus","git-branch","git-commit","git-fork","git-merge","git-pull-request","github","gitlab","glasses","globe-2","globe","grab","graduation-cap","grid","grip-horizontal","grip-vertical","hammer","hand-metal","hand","hard-drive","hard-hat","hash","haze","headphones","heart","help-circle","hexagon","highlighter","history","home","image-minus","image-off","image-plus","image","import","inbox","indent","indian-rupee","infinity","lucide-info","inspect","instagram","italic","japanese-yen","key","keyboard","landmark","lucide-languages","laptop-2","laptop","lasso-select","lasso","layers","layout-dashboard","layout-grid","layout-list","layout-template","layout","library","life-buoy","lightbulb-off","lightbulb","link-2-off","link-2","lucide-link","linkedin","list-checks","list-minus","list-ordered","list-plus","list-x","list","loader-2","loader","locate-fixed","locate-off","locate","lock","log-in","log-out","mail","map-pin","map","maximize-2","maximize","megaphone","meh","menu","message-circle","message-square","mic-off","mic","minimize-2","minimize","minus-circle","minus-square","minus","monitor-off","monitor-speaker","monitor","moon","more-horizontal","more-vertical","mountain-snow","mountain","mouse-pointer-2","mouse-pointer-click","mouse-pointer","mouse","move-diagonal-2","move-diagonal","move-horizontal","move-vertical","move","music","navigation-2","navigation","network","octagon","option","outdent","package-check","package-minus","package-plus","package-search","package-x","package","palette","palmtree","paperclip","pause-circle","pause-octagon","pause","pen-tool","lucide-pencil","percent","person-standing","phone-call","phone-forwarded","phone-incoming","phone-missed","phone-off","phone-outgoing","phone","pie-chart","piggy-bank","lucide-pin","pipette","plane","play-circle","play","plug-zap","plus-circle","plus-square","plus","pocket","podcast","pointer","pound-sterling","power-off","power","printer","qr-code","quote","radio-receiver","radio","redo","refresh-ccw","refresh-cw","regex","repeat-1","repeat","reply-all","reply","rewind","rocket","rocking-chair","rotate-ccw","rotate-cw","rss","ruler","russian-ruble","save","scale","scan-line","scan","scissors","screen-share-off","screen-share","lucide-search","send","separator-horizontal","separator-vertical","server-crash","server-off","server","settings-2","settings","share-2","share","sheet","shield-alert","shield-check","shield-close","shield-off","shield","shirt","shopping-bag","shopping-cart","shovel","shrink","shuffle","sidebar-close","sidebar-open","sidebar","sigma","signal-high","signal-low","signal-medium","signal-zero","signal","skip-back","skip-forward","skull","slack","slash","sliders","smartphone-charging","smartphone","smile","snowflake","sort-asc","sort-desc","speaker","sprout","square","star-half","lucide-star","stop-circle","stretch-horizontal","stretch-vertical","strikethrough","subscript","sun","sunrise","sunset","superscript","swiss-franc","switch-camera","table","tablet","tag","target","tent","terminal-square","terminal","text-cursor-input","text-cursor","thermometer-snowflake","thermometer-sun","thermometer","thumbs-down","thumbs-up","ticket","timer-off","timer-reset","timer","toggle-left","toggle-right","tornado","trash-2","lucide-trash","trello","trending-down","trending-up","triangle","truck","tv-2","tv","twitch","twitter","type","umbrella","underline","undo","unlink-2","unlink","unlock","upload-cloud","upload","user-check","user-minus","user-plus","user-x","user","users","verified","vibrate","video-off","video","view","voicemail","volume-1","volume-2","volume-x","volume","wallet","wand","watch","waves","webcam","wifi-off","wifi","wind","wrap-text","wrench","x-circle","x-octagon","x-square","x","youtube","zap-off","zap","zoom-in","zoom-out","search-large"];var We=require("obsidian");var D=class extends We.FuzzySuggestModal{constructor(e){super(app);this.plugin=e,this.setPlaceholder(m("Choose a Icon for your new Command")),this.setInstructions([{command:"\u2191\u2193",purpose:m("to navigate")},{command:"\u21B5",purpose:m("to choose a custom icon")},{command:"esc",purpose:m("to cancel")}])}async awaitSelection(){return this.open(),new Promise((e,n)=>{this.onChooseItem=i=>e(i),this.onClose=()=>window.setTimeout(()=>n("No Icon selected"),0)})}renderSuggestion(e,n){n.addClass("mod-complex"),n.createDiv({cls:"suggestion-content"}).createDiv({cls:"suggestion-title"}).setText(e.item.replace(/-/g," ").replace(/(^\w{1})|(\s+\w{1})/g,c=>c.toUpperCase()));let r=n.createDiv({cls:"suggestion-aux"});(0,We.setIcon)(r.createSpan({cls:"suggestion-flair"}),e.item)}getItems(){return go}getItemText(e){return e}onChooseItem(e,n){}};var Ke=require("obsidian");var bo=require("obsidian");var q=class extends bo.SuggestModal{constructor(e){super(app);this.defaultName=e;this.setPlaceholder(m("Use a custom name")),this.resultContainerEl.style.display="none",this.setInstructions([{command:"",purpose:m("Choose a custom Name for your new Command")},{command:"\u21B5",purpose:m("to save")},{command:"esc",purpose:m("to cancel")}])}onOpen(){var i;super.onOpen(),this.inputEl.value=this.defaultName;let e=createDiv({cls:"cmdr-name-input-wrapper"});(i=this.inputEl.parentNode)==null||i.insertBefore(e,this.inputEl),e.appendChild(this.inputEl),e.parentElement.style.display="block";let n=createEl("button",{text:m("Save"),cls:"mod-cta"});n.onclick=r=>this.selectSuggestion(this.inputEl.value,r),e.appendChild(n)}async awaitSelection(){return this.open(),new Promise((e,n)=>{this.onChooseSuggestion=i=>e(i),this.onClose=()=>window.setTimeout(()=>n("No Name selected"),0)})}getSuggestions(e){return[e]}renderSuggestion(e,n){}onChooseSuggestion(e,n){}};var je,w,ko,jn,ye,Co,Mo,qe={},Io=[],Yn=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i;function ie(t,o){for(var e in o)t[e]=o[e];return t}function xo(t){var o=t.parentNode;o&&o.removeChild(t)}function a(t,o,e){var n,i,r,c={};for(r in o)r=="key"?n=o[r]:r=="ref"?i=o[r]:c[r]=o[r];if(arguments.length>2&&(c.children=arguments.length>3?je.call(arguments,2):e),typeof t=="function"&&t.defaultProps!=null)for(r in t.defaultProps)c[r]===void 0&&(c[r]=t.defaultProps[r]);return Ve(t,c,n,i,null)}function Ve(t,o,e,n,i){var r={type:t,props:o,key:e,ref:n,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:i==null?++ko:i};return i==null&&w.vnode!=null&&w.vnode(r),r}function R(t){return t.children}function Ue(t,o){this.props=t,this.context=o}function ke(t,o){if(o==null)return t.__?ke(t.__,t.__.__k.indexOf(t)+1):null;for(var e;o<t.__k.length;o++)if((e=t.__k[o])!=null&&e.__e!=null)return e.__e;return typeof t.type=="function"?ke(t):null}function So(t){var o,e;if((t=t.__)!=null&&t.__c!=null){for(t.__e=t.__c.base=null,o=0;o<t.__k.length;o++)if((e=t.__k[o])!=null&&e.__e!=null){t.__e=t.__c.base=e.__e;break}return So(t)}}function gt(t){(!t.__d&&(t.__d=!0)&&ye.push(t)&&!Xe.__r++||Co!==w.debounceRendering)&&((Co=w.debounceRendering)||setTimeout)(Xe)}function Xe(){for(var t;Xe.__r=ye.length;)t=ye.sort(function(o,e){return o.__v.__b-e.__v.__b}),ye=[],t.some(function(o){var e,n,i,r,c,u;o.__d&&(c=(r=(e=o).__v).__e,(u=e.__P)&&(n=[],(i=ie({},r)).__v=r.__v+1,bt(u,r,i,e.__n,u.ownerSVGElement!==void 0,r.__h!=null?[c]:null,n,c==null?ke(r):c,r.__h),Ao(n,r),r.__e!=c&&So(r)))})}function Po(t,o,e,n,i,r,c,u,l,h){var s,g,v,f,b,S,C,_=n&&n.__k||Io,z=_.length;for(e.__k=[],s=0;s<o.length;s++)if((f=e.__k[s]=(f=o[s])==null||typeof f=="boolean"?null:typeof f=="string"||typeof f=="number"||typeof f=="bigint"?Ve(null,f,null,null,f):Array.isArray(f)?Ve(R,{children:f},null,null,null):f.__b>0?Ve(f.type,f.props,f.key,f.ref?f.ref:null,f.__v):f)!=null){if(f.__=e,f.__b=e.__b+1,(v=_[s])===null||v&&f.key==v.key&&f.type===v.type)_[s]=void 0;else for(g=0;g<z;g++){if((v=_[g])&&f.key==v.key&&f.type===v.type){_[g]=void 0;break}v=null}bt(t,f,v=v||qe,i,r,c,u,l,h),b=f.__e,(g=f.ref)&&v.ref!=g&&(C||(C=[]),v.ref&&C.push(v.ref,null,f),C.push(g,f.__c||b,f)),b!=null?(S==null&&(S=b),typeof f.type=="function"&&f.__k===v.__k?f.__d=l=Eo(f,l,t):l=To(t,f,v,_,b,l),typeof e.type=="function"&&(e.__d=l)):l&&v.__e==l&&l.parentNode!=t&&(l=ke(v))}for(e.__e=S,s=z;s--;)_[s]!=null&&Lo(_[s],_[s]);if(C)for(s=0;s<C.length;s++)No(C[s],C[++s],C[++s])}function Eo(t,o,e){for(var n,i=t.__k,r=0;i&&r<i.length;r++)(n=i[r])&&(n.__=t,o=typeof n.type=="function"?Eo(n,o,e):To(e,n,n,i,n.__e,o));return o}function To(t,o,e,n,i,r){var c,u,l;if(o.__d!==void 0)c=o.__d,o.__d=void 0;else if(e==null||i!=r||i.parentNode==null)e:if(r==null||r.parentNode!==t)t.appendChild(i),c=null;else{for(u=r,l=0;(u=u.nextSibling)&&l<n.length;l+=1)if(u==i)break e;t.insertBefore(i,r),c=r}return c!==void 0?c:i.nextSibling}function Zn(t,o,e,n,i){var r;for(r in e)r==="children"||r==="key"||r in o||Je(t,r,null,e[r],n);for(r in o)i&&typeof o[r]!="function"||r==="children"||r==="key"||r==="value"||r==="checked"||e[r]===o[r]||Je(t,r,o[r],e[r],n)}function _o(t,o,e){o[0]==="-"?t.setProperty(o,e):t[o]=e==null?"":typeof e!="number"||Yn.test(o)?e:e+"px"}function Je(t,o,e,n,i){var r;e:if(o==="style")if(typeof e=="string")t.style.cssText=e;else{if(typeof n=="string"&&(t.style.cssText=n=""),n)for(o in n)e&&o in e||_o(t.style,o,"");if(e)for(o in e)n&&e[o]===n[o]||_o(t.style,o,e[o])}else if(o[0]==="o"&&o[1]==="n")r=o!==(o=o.replace(/Capture$/,"")),o=o.toLowerCase()in t?o.toLowerCase().slice(2):o.slice(2),t.l||(t.l={}),t.l[o+r]=e,e?n||t.addEventListener(o,r?yo:wo,r):t.removeEventListener(o,r?yo:wo,r);else if(o!=="dangerouslySetInnerHTML"){if(i)o=o.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(o!=="href"&&o!=="list"&&o!=="form"&&o!=="tabIndex"&&o!=="download"&&o in t)try{t[o]=e==null?"":e;break e}catch(c){}typeof e=="function"||(e==null||e===!1&&o.indexOf("-")==-1?t.removeAttribute(o):t.setAttribute(o,e))}}function wo(t){this.l[t.type+!1](w.event?w.event(t):t)}function yo(t){this.l[t.type+!0](w.event?w.event(t):t)}function bt(t,o,e,n,i,r,c,u,l){var h,s,g,v,f,b,S,C,_,z,k,L,pe,fe,he,J=o.type;if(o.constructor!==void 0)return null;e.__h!=null&&(l=e.__h,u=o.__e=e.__e,o.__h=null,r=[u]),(h=w.__b)&&h(o);try{e:if(typeof J=="function"){if(C=o.props,_=(h=J.contextType)&&n[h.__c],z=h?_?_.props.value:h.__:n,e.__c?S=(s=o.__c=e.__c).__=s.__E:("prototype"in J&&J.prototype.render?o.__c=s=new J(C,z):(o.__c=s=new Ue(C,z),s.constructor=J,s.render=Gn),_&&_.sub(s),s.props=C,s.state||(s.state={}),s.context=z,s.__n=n,g=s.__d=!0,s.__h=[],s._sb=[]),s.__s==null&&(s.__s=s.state),J.getDerivedStateFromProps!=null&&(s.__s==s.state&&(s.__s=ie({},s.__s)),ie(s.__s,J.getDerivedStateFromProps(C,s.__s))),v=s.props,f=s.state,g)J.getDerivedStateFromProps==null&&s.componentWillMount!=null&&s.componentWillMount(),s.componentDidMount!=null&&s.__h.push(s.componentDidMount);else{if(J.getDerivedStateFromProps==null&&C!==v&&s.componentWillReceiveProps!=null&&s.componentWillReceiveProps(C,z),!s.__e&&s.shouldComponentUpdate!=null&&s.shouldComponentUpdate(C,s.__s,z)===!1||o.__v===e.__v){for(s.props=C,s.state=s.__s,o.__v!==e.__v&&(s.__d=!1),s.__v=o,o.__e=e.__e,o.__k=e.__k,o.__k.forEach(function(ve){ve&&(ve.__=o)}),k=0;k<s._sb.length;k++)s.__h.push(s._sb[k]);s._sb=[],s.__h.length&&c.push(s);break e}s.componentWillUpdate!=null&&s.componentWillUpdate(C,s.__s,z),s.componentDidUpdate!=null&&s.__h.push(function(){s.componentDidUpdate(v,f,b)})}if(s.context=z,s.props=C,s.__v=o,s.__P=t,L=w.__r,pe=0,"prototype"in J&&J.prototype.render){for(s.state=s.__s,s.__d=!1,L&&L(o),h=s.render(s.props,s.state,s.context),fe=0;fe<s._sb.length;fe++)s.__h.push(s._sb[fe]);s._sb=[]}else do s.__d=!1,L&&L(o),h=s.render(s.props,s.state,s.context),s.state=s.__s;while(s.__d&&++pe<25);s.state=s.__s,s.getChildContext!=null&&(n=ie(ie({},n),s.getChildContext())),g||s.getSnapshotBeforeUpdate==null||(b=s.getSnapshotBeforeUpdate(v,f)),he=h!=null&&h.type===R&&h.key==null?h.props.children:h,Po(t,Array.isArray(he)?he:[he],o,e,n,i,r,c,u,l),s.base=o.__e,o.__h=null,s.__h.length&&c.push(s),S&&(s.__E=s.__=null),s.__e=!1}else r==null&&o.__v===e.__v?(o.__k=e.__k,o.__e=e.__e):o.__e=$n(e.__e,o,e,n,i,r,c,l);(h=w.diffed)&&h(o)}catch(ve){o.__v=null,(l||r!=null)&&(o.__e=u,o.__h=!!l,r[r.indexOf(u)]=null),w.__e(ve,o,e)}}function Ao(t,o){w.__c&&w.__c(o,t),t.some(function(e){try{t=e.__h,e.__h=[],t.some(function(n){n.call(e)})}catch(n){w.__e(n,e.__v)}})}function $n(t,o,e,n,i,r,c,u){var l,h,s,g=e.props,v=o.props,f=o.type,b=0;if(f==="svg"&&(i=!0),r!=null){for(;b<r.length;b++)if((l=r[b])&&"setAttribute"in l==!!f&&(f?l.localName===f:l.nodeType===3)){t=l,r[b]=null;break}}if(t==null){if(f===null)return document.createTextNode(v);t=i?document.createElementNS("http://www.w3.org/2000/svg",f):document.createElement(f,v.is&&v),r=null,u=!1}if(f===null)g===v||u&&t.data===v||(t.data=v);else{if(r=r&&je.call(t.childNodes),h=(g=e.props||qe).dangerouslySetInnerHTML,s=v.dangerouslySetInnerHTML,!u){if(r!=null)for(g={},b=0;b<t.attributes.length;b++)g[t.attributes[b].name]=t.attributes[b].value;(s||h)&&(s&&(h&&s.__html==h.__html||s.__html===t.innerHTML)||(t.innerHTML=s&&s.__html||""))}if(Zn(t,v,g,i,u),s)o.__k=[];else if(b=o.props.children,Po(t,Array.isArray(b)?b:[b],o,e,n,i&&f!=="foreignObject",r,c,r?r[0]:e.__k&&ke(e,0),u),r!=null)for(b=r.length;b--;)r[b]!=null&&xo(r[b]);u||("value"in v&&(b=v.value)!==void 0&&(b!==t.value||f==="progress"&&!b||f==="option"&&b!==g.value)&&Je(t,"value",b,g.value,!1),"checked"in v&&(b=v.checked)!==void 0&&b!==t.checked&&Je(t,"checked",b,g.checked,!1))}return t}function No(t,o,e){try{typeof t=="function"?t(o):t.current=o}catch(n){w.__e(n,e)}}function Lo(t,o,e){var n,i;if(w.unmount&&w.unmount(t),(n=t.ref)&&(n.current&&n.current!==t.__e||No(n,null,o)),(n=t.__c)!=null){if(n.componentWillUnmount)try{n.componentWillUnmount()}catch(r){w.__e(r,o)}n.base=n.__P=null,t.__c=void 0}if(n=t.__k)for(i=0;i<n.length;i++)n[i]&&Lo(n[i],o,e||typeof t.type!="function");e||t.__e==null||xo(t.__e),t.__=t.__e=t.__d=void 0}function Gn(t,o,e){return this.constructor(t,e)}function X(t,o,e){var n,i,r;w.__&&w.__(t,o),i=(n=typeof e=="function")?null:e&&e.__k||o.__k,r=[],bt(o,t=(!n&&e||o).__k=a(R,null,[t]),i||qe,qe,o.ownerSVGElement!==void 0,!n&&e?[e]:i?null:o.firstChild?je.call(o.childNodes):null,r,!n&&e?e:i?i.__e:o.firstChild,n),Ao(r,t)}function Bo(t,o){var e={__c:o="__cC"+Mo++,__:t,Consumer:function(n,i){return n.children(i)},Provider:function(n){var i,r;return this.getChildContext||(i=[],(r={})[o]=this,this.getChildContext=function(){return r},this.shouldComponentUpdate=function(c){this.props.value!==c.value&&i.some(gt)},this.sub=function(c){i.push(c);var u=c.componentWillUnmount;c.componentWillUnmount=function(){i.splice(i.indexOf(c),1),u&&u.call(c)}}),n.children}};return e.Provider.__=e.Consumer.contextType=e}je=Io.slice,w={__e:function(t,o,e,n){for(var i,r,c;o=o.__;)if((i=o.__c)&&!i.__)try{if((r=i.constructor)&&r.getDerivedStateFromError!=null&&(i.setState(r.getDerivedStateFromError(t)),c=i.__d),i.componentDidCatch!=null&&(i.componentDidCatch(t,n||{}),c=i.__d),c)return i.__E=i}catch(u){t=u}throw t}},ko=0,jn=function(t){return t!=null&&t.constructor===void 0},Ue.prototype.setState=function(t,o){var e;e=this.__s!=null&&this.__s!==this.state?this.__s:this.__s=ie({},this.state),typeof t=="function"&&(t=t(ie({},e),this.props)),t&&ie(e,t),t!=null&&this.__v&&(o&&this._sb.push(o),gt(this))},Ue.prototype.forceUpdate=function(t){this.__v&&(this.__e=!0,t&&this.__h.push(t),gt(this))},Ue.prototype.render=R,ye=[],Xe.__r=0,Mo=0;var Me,O,Ct,Do,$e=0,Vo=[],Ye=[],Ro=w.__b,Ho=w.__r,Oo=w.diffed,Fo=w.__c,zo=w.unmount;function Ge(t,o){w.__h&&w.__h(O,t,$e||o),$e=0;var e=O.__H||(O.__H={__:[],__h:[]});return t>=e.__.length&&e.__.push({__V:Ye}),e.__[t]}function F(t){return $e=1,Kn(qo,t)}function Kn(t,o,e){var n=Ge(Me++,2);if(n.t=t,!n.__c&&(n.__=[e?e(o):qo(void 0,o),function(r){var c=n.__N?n.__N[0]:n.__[0],u=n.t(c,r);c!==u&&(n.__N=[u,n.__[1]],n.__c.setState({}))}],n.__c=O,!O.u)){O.u=!0;var i=O.shouldComponentUpdate;O.shouldComponentUpdate=function(r,c,u){if(!n.__c.__H)return!0;var l=n.__c.__H.__.filter(function(s){return s.__c});if(l.every(function(s){return!s.__N}))return!i||i.call(this,r,c,u);var h=!1;return l.forEach(function(s){if(s.__N){var g=s.__[0];s.__=s.__N,s.__N=void 0,g!==s.__[0]&&(h=!0)}}),!(!h&&n.__c.props===r)&&(!i||i.call(this,r,c,u))}}return n.__N||n.__}function W(t,o){var e=Ge(Me++,3);!w.__s&&yt(e.__H,o)&&(e.__=t,e.i=o,O.__H.__h.push(e))}function Uo(t,o){var e=Ge(Me++,4);!w.__s&&yt(e.__H,o)&&(e.__=t,e.i=o,O.__h.push(e))}function ee(t){return $e=5,wt(function(){return{current:t}},[])}function wt(t,o){var e=Ge(Me++,7);return yt(e.__H,o)?(e.__V=t(),e.i=o,e.__h=t,e.__V):e.__}function Qn(){for(var t;t=Vo.shift();)if(t.__P&&t.__H)try{t.__H.__h.forEach(Ze),t.__H.__h.forEach(_t),t.__H.__h=[]}catch(o){t.__H.__h=[],w.__e(o,t.__v)}}w.__b=function(t){O=null,Ro&&Ro(t)},w.__r=function(t){Ho&&Ho(t),Me=0;var o=(O=t.__c).__H;o&&(Ct===O?(o.__h=[],O.__h=[],o.__.forEach(function(e){e.__N&&(e.__=e.__N),e.__V=Ye,e.__N=e.i=void 0})):(o.__h.forEach(Ze),o.__h.forEach(_t),o.__h=[])),Ct=O},w.diffed=function(t){Oo&&Oo(t);var o=t.__c;o&&o.__H&&(o.__H.__h.length&&(Vo.push(o)!==1&&Do===w.requestAnimationFrame||((Do=w.requestAnimationFrame)||ei)(Qn)),o.__H.__.forEach(function(e){e.i&&(e.__H=e.i),e.__V!==Ye&&(e.__=e.__V),e.i=void 0,e.__V=Ye})),Ct=O=null},w.__c=function(t,o){o.some(function(e){try{e.__h.forEach(Ze),e.__h=e.__h.filter(function(n){return!n.__||_t(n)})}catch(n){o.some(function(i){i.__h&&(i.__h=[])}),o=[],w.__e(n,e.__v)}}),Fo&&Fo(t,o)},w.unmount=function(t){zo&&zo(t);var o,e=t.__c;e&&e.__H&&(e.__H.__.forEach(function(n){try{Ze(n)}catch(i){o=i}}),e.__H=void 0,o&&w.__e(o,e.__v))};var Wo=typeof requestAnimationFrame=="function";function ei(t){var o,e=function(){clearTimeout(n),Wo&&cancelAnimationFrame(o),setTimeout(t)},n=setTimeout(e,100);Wo&&(o=requestAnimationFrame(e))}function Ze(t){var o=O,e=t.__c;typeof e=="function"&&(t.__c=void 0,e()),O=o}function _t(t){var o=O;t.__c=t.__(),O=o}function yt(t,o){return!t||t.length!==o.length||o.some(function(e,n){return e!==t[n]})}function qo(t,o){return typeof o=="function"?o(t):o}var kt={};(function t(o,e,n,i){var r=!!(o.Worker&&o.Blob&&o.Promise&&o.OffscreenCanvas&&o.OffscreenCanvasRenderingContext2D&&o.HTMLCanvasElement&&o.HTMLCanvasElement.prototype.transferControlToOffscreen&&o.URL&&o.URL.createObjectURL);function c(){}function u(p){var d=e.exports.Promise,P=d!==void 0?d:o.Promise;return typeof P=="function"?new P(p):(p(c,c),null)}var l=function(){var p=Math.floor(16.666666666666668),d,P,M={},T=0;return typeof requestAnimationFrame=="function"&&typeof cancelAnimationFrame=="function"?(d=function(E){var I=Math.random();return M[I]=requestAnimationFrame(function x(B){T===B||T+p-1<B?(T=B,delete M[I],E()):M[I]=requestAnimationFrame(x)}),I},P=function(E){M[E]&&cancelAnimationFrame(M[E])}):(d=function(E){return setTimeout(E,p)},P=function(E){return clearTimeout(E)}),{frame:d,cancel:P}}(),h=function(){var p,d,P={};function M(T){function E(I,x){T.postMessage({options:I||{},callback:x})}T.init=function(x){var B=x.transferControlToOffscreen();T.postMessage({canvas:B},[B])},T.fire=function(x,B,te){if(d)return E(x,null),d;var A=Math.random().toString(36).slice(2);return d=u(function(K){function $(N){N.data.callback===A&&(delete P[A],T.removeEventListener("message",$),d=null,te(),K())}T.addEventListener("message",$),E(x,A),P[A]=$.bind(null,{data:{callback:A}})}),d},T.reset=function(){T.postMessage({reset:!0});for(var x in P)P[x](),delete P[x]}}return function(){if(p)return p;if(!n&&r){var T=["var CONFETTI, SIZE = {}, module = {};","("+t.toString()+")(this, module, true, SIZE);","onmessage = function(msg) {"," if (msg.data.options) {"," CONFETTI(msg.data.options).then(function () {"," if (msg.data.callback) {"," postMessage({ callback: msg.data.callback });"," }"," });"," } else if (msg.data.reset) {"," CONFETTI && CONFETTI.reset();"," } else if (msg.data.resize) {"," SIZE.width = msg.data.resize.width;"," SIZE.height = msg.data.resize.height;"," } else if (msg.data.canvas) {"," SIZE.width = msg.data.canvas.width;"," SIZE.height = msg.data.canvas.height;"," CONFETTI = module.exports.create(msg.data.canvas);"," }","}"].join(`
|
|
`);try{p=new Worker(URL.createObjectURL(new Blob([T])))}catch(E){return typeof console!==void 0&&typeof console.warn=="function"&&console.warn("\u{1F38A} Could not load worker",E),null}M(p)}return p}}(),s={particleCount:50,angle:90,spread:45,startVelocity:45,decay:.9,gravity:1,drift:0,ticks:200,x:.5,y:.5,shapes:["square","circle"],zIndex:100,colors:["#26ccff","#a25afd","#ff5e7e","#88ff5a","#fcff42","#ffa62d","#ff36ff"],disableForReducedMotion:!1,scalar:1};function g(p,d){return d?d(p):p}function v(p){return p!=null}function f(p,d,P){return g(p&&v(p[d])?p[d]:s[d],P)}function b(p){return p<0?0:Math.floor(p)}function S(p,d){return Math.floor(Math.random()*(d-p))+p}function C(p){return parseInt(p,16)}function _(p){return p.map(z)}function z(p){var d=String(p).replace(/[^0-9a-f]/gi,"");return d.length<6&&(d=d[0]+d[0]+d[1]+d[1]+d[2]+d[2]),{r:C(d.substring(0,2)),g:C(d.substring(2,4)),b:C(d.substring(4,6))}}function k(p){var d=f(p,"origin",Object);return d.x=f(d,"x",Number),d.y=f(d,"y",Number),d}function L(p){p.width=document.documentElement.clientWidth,p.height=document.documentElement.clientHeight}function pe(p){var d=p.getBoundingClientRect();p.width=d.width,p.height=d.height}function fe(p){var d=document.createElement("canvas");return d.style.position="fixed",d.style.top="0px",d.style.left="0px",d.style.pointerEvents="none",d.style.zIndex=p,d}function he(p,d,P,M,T,E,I,x,B){p.save(),p.translate(d,P),p.rotate(E),p.scale(M,T),p.arc(0,0,1,I,x,B),p.restore()}function J(p){var d=p.angle*(Math.PI/180),P=p.spread*(Math.PI/180);return{x:p.x,y:p.y,wobble:Math.random()*10,wobbleSpeed:Math.min(.11,Math.random()*.1+.05),velocity:p.startVelocity*.5+Math.random()*p.startVelocity,angle2D:-d+(.5*P-Math.random()*P),tiltAngle:(Math.random()*(.75-.25)+.25)*Math.PI,color:p.color,shape:p.shape,tick:0,totalTicks:p.ticks,decay:p.decay,drift:p.drift,random:Math.random()+2,tiltSin:0,tiltCos:0,wobbleX:0,wobbleY:0,gravity:p.gravity*3,ovalScalar:.6,scalar:p.scalar}}function ve(p,d){d.x+=Math.cos(d.angle2D)*d.velocity+d.drift,d.y+=Math.sin(d.angle2D)*d.velocity+d.gravity,d.wobble+=d.wobbleSpeed,d.velocity*=d.decay,d.tiltAngle+=.1,d.tiltSin=Math.sin(d.tiltAngle),d.tiltCos=Math.cos(d.tiltAngle),d.random=Math.random()+2,d.wobbleX=d.x+10*d.scalar*Math.cos(d.wobble),d.wobbleY=d.y+10*d.scalar*Math.sin(d.wobble);var P=d.tick++/d.totalTicks,M=d.x+d.random*d.tiltCos,T=d.y+d.random*d.tiltSin,E=d.wobbleX+d.random*d.tiltCos,I=d.wobbleY+d.random*d.tiltSin;if(p.fillStyle="rgba("+d.color.r+", "+d.color.g+", "+d.color.b+", "+(1-P)+")",p.beginPath(),d.shape==="circle")p.ellipse?p.ellipse(d.x,d.y,Math.abs(E-M)*d.ovalScalar,Math.abs(I-T)*d.ovalScalar,Math.PI/10*d.wobble,0,2*Math.PI):he(p,d.x,d.y,Math.abs(E-M)*d.ovalScalar,Math.abs(I-T)*d.ovalScalar,Math.PI/10*d.wobble,0,2*Math.PI);else if(d.shape==="star")for(var x=Math.PI/2*3,B=4*d.scalar,te=8*d.scalar,A=d.x,K=d.y,$=5,N=Math.PI/$;$--;)A=d.x+Math.cos(x)*te,K=d.y+Math.sin(x)*te,p.lineTo(A,K),x+=N,A=d.x+Math.cos(x)*B,K=d.y+Math.sin(x)*B,p.lineTo(A,K),x+=N;else p.moveTo(Math.floor(d.x),Math.floor(d.y)),p.lineTo(Math.floor(d.wobbleX),Math.floor(T)),p.lineTo(Math.floor(E),Math.floor(I)),p.lineTo(Math.floor(M),Math.floor(d.wobbleY));return p.closePath(),p.fill(),d.tick<d.totalTicks}function cn(p,d,P,M,T){var E=d.slice(),I=p.getContext("2d"),x,B,te=u(function(A){function K(){x=B=null,I.clearRect(0,0,M.width,M.height),T(),A()}function $(){n&&!(M.width===i.width&&M.height===i.height)&&(M.width=p.width=i.width,M.height=p.height=i.height),!M.width&&!M.height&&(P(p),M.width=p.width,M.height=p.height),I.clearRect(0,0,M.width,M.height),E=E.filter(function(N){return ve(I,N)}),E.length?x=l.frame($):K()}x=l.frame($),B=K});return{addFettis:function(A){return E=E.concat(A),te},canvas:p,promise:te,reset:function(){x&&l.cancel(x),B&&B()}}}function Ht(p,d){var P=!p,M=!!f(d||{},"resize"),T=f(d,"disableForReducedMotion",Boolean),E=r&&!!f(d||{},"useWorker"),I=E?h():null,x=P?L:pe,B=p&&I?!!p.__confetti_initialized:!1,te=typeof matchMedia=="function"&&matchMedia("(prefers-reduced-motion)").matches,A;function K(N,mt,lt){for(var ge=f(N,"particleCount",b),De=f(N,"angle",Number),Re=f(N,"spread",Number),re=f(N,"startVelocity",Number),dn=f(N,"decay",Number),mn=f(N,"gravity",Number),ln=f(N,"drift",Number),Ft=f(N,"colors",_),un=f(N,"ticks",Number),zt=f(N,"shapes"),pn=f(N,"scalar"),Wt=k(N),Vt=ge,ut=[],fn=p.width*Wt.x,hn=p.height*Wt.y;Vt--;)ut.push(J({x:fn,y:hn,angle:De,spread:Re,startVelocity:re,color:Ft[Vt%Ft.length],shape:zt[S(0,zt.length)],ticks:un,decay:dn,gravity:mn,drift:ln,scalar:pn}));return A?A.addFettis(ut):(A=cn(p,ut,x,mt,lt),A.promise)}function $(N){var mt=T||f(N,"disableForReducedMotion",Boolean),lt=f(N,"zIndex",Number);if(mt&&te)return u(function(re){re()});P&&A?p=A.canvas:P&&!p&&(p=fe(lt),document.body.appendChild(p)),M&&!B&&x(p);var ge={width:p.width,height:p.height};I&&!B&&I.init(p),B=!0,I&&(p.__confetti_initialized=!0);function De(){if(I){var re={getBoundingClientRect:function(){if(!P)return p.getBoundingClientRect()}};x(re),I.postMessage({resize:{width:re.width,height:re.height}});return}ge.width=ge.height=null}function Re(){A=null,M&&o.removeEventListener("resize",De),P&&p&&(document.body.removeChild(p),p=null,B=!1)}return M&&o.addEventListener("resize",De,!1),I?I.fire(N,ge,Re):K(N,ge,Re)}return $.reset=function(){I&&I.reset(),A&&A.reset()},$}var dt;function Ot(){return dt||(dt=Ht(null,{useWorker:!0,resize:!0})),dt}e.exports=function(){return Ot().apply(this,arguments)},e.exports.reset=function(){Ot().reset()},e.exports.create=Ht})(function(){return typeof window!="undefined"?window:typeof self!="undefined"?self:this||{}}(),kt,!1);var Xo=kt.exports,ha=kt.exports.create;async function V(t){let o=await new ne(t).awaitSelection(),e;o.hasOwnProperty("icon")||(e=await new D(t).awaitSelection());let n=await new q(o.name).awaitSelection();return{id:o.id,icon:e!=null?e:o.icon,name:n||o.name,mode:"any"}}function G(t){var o;return(o=app.commands.commands[t])!=null?o:null}function y(n){var i=n,{icon:t,size:o}=i,e=Jt(i,["icon","size"]);let r=ee(null);return Uo(()=>{(0,Ke.setIcon)(r.current,t,o)},[t,o]),a("div",Fe({ref:r},e))}function Z(t){let{isMobile:o,appId:e}=app;return t==="any"||t===e||t==="mobile"&&o||t==="desktop"&&!o}function Ie(t){var e;let o="";for(let n of t.hide.statusbar)o+=`div.status-bar-item.plugin-${n} {display: none !important; content-visibility: hidden;}`;for(let n of t.hide.leftRibbon)o+=`div.side-dock-ribbon-action[aria-label="${n}"] {display: none !important; content-visibility: hidden;}`;(e=document.head.querySelector("style#cmdr"))==null||e.remove(),o&&document.head.appendChild(createEl("style",{attr:{id:"cmdr"},text:o,type:"text/css"}))}async function Mt({target:t}){let o=activeDocument.createElement("canvas");activeDocument.body.appendChild(o),o.style.position="fixed",o.style.width="100vw",o.style.height="100vh",o.style.top="0px",o.style.left="0px",o.style["pointer-events"]="none",o.style["z-index"]="100";let e=Xo.create(o,{resize:!0,useWorker:!0}),n=t.getBoundingClientRect();await e({particleCount:Ke.Platform.isDesktop?160:80,startVelocity:55,spread:75,angle:90,drift:-1,ticks:250,origin:{x:(n.x+n.width/2)/activeWindow.innerWidth,y:(n.y+n.height/2)/activeWindow.innerHeight}}),o.remove()}function Qe(t){activeDocument.body.style.setProperty("--cmdr-spacing",`${t}px`)}function xe(t){let o=Object.keys(app.commands.commands).filter(n=>n.startsWith("cmdr:macro-"));for(let n of o)app.commands.removeCommand(n);let e=t.settings.macros;for(let[n,i]of Object.entries(e))t.addCommand({id:`macro-${n}`,name:i.name,callback:()=>{t.executeMacro(parseInt(n))}})}function oe(t){var n,i;let{classList:o,style:e}=document.body;e.setProperty("--at-button-height",((n=t.rowHeight)!=null?n:48)+"px"),e.setProperty("--at-button-width",((i=t.buttonWidth)!=null?i:48)+"px"),e.setProperty("--at-row-count",t.rowCount.toString()),e.setProperty("--at-spacing",t.spacing+"px"),e.setProperty("--at-offset",t.heightOffset+"px"),o.toggle("AT-multirow",t.rowCount>1),o.toggle("AT-row",!t.columnLayout),o.toggle("AT-column",t.columnLayout),o.toggle("AT-no-toolbar",t.rowCount===0)}function Jo(){let{classList:t,style:o}=document.body;o.removeProperty("--at-button-height"),o.removeProperty("--at-button-width"),o.removeProperty("--at-row-count"),o.removeProperty("--at-spacing"),o.removeProperty("--at-offset"),t.remove("AT-multirow"),t.remove("AT-row"),t.remove("AT-column"),t.remove("AT-no-toolbar"),t.remove("advanced-toolbar")}function et(t){t.mappedIcons.forEach(o=>{let e=app.commands.commands[o.commandID];e?e.icon=o.iconID:t.mappedIcons.remove(o)})}var sn=require("obsidian");var Se=require("obsidian");var Yo=require("obsidian");function jo({modal:t}){return a(R,null,a("p",null,m("Are you sure you want to delete the Command?")),a("div",{className:"modal-button-container"},a("button",{className:"mod-warning",onClick:async()=>{t.plugin.settings.confirmDeletion=!1,t.plugin.saveSettings(),t.remove=!0,t.close()}},m("Remove and don't ask again")),a("button",{className:"mod-warning",onClick:()=>{t.remove=!0,t.close()}},m("Remove")),a("button",{onClick:()=>{t.remove=!1,t.close()}},m("Cancel"))))}var H=class extends Yo.Modal{constructor(e){super(app);this.plugin=e}async onOpen(){this.titleEl.innerText=m("Remove Command"),this.containerEl.style.zIndex="99",this.reactComponent=a(jo,{modal:this}),X(this.reactComponent,this.contentEl)}async didChooseRemove(){return this.open(),new Promise(e=>{this.onClose=()=>{var n;return e((n=this.remove)!=null?n:!1)}})}onClose(){X(null,this.contentEl)}};var j=class{constructor(o,e){this.plugin=o,this.pairs=e}};var be=class extends j{constructor(e,n){super(e,n);this.actions=new Map;this.init(),this.plugin.register(()=>this.actions.forEach((i,r)=>this.removeAction(r)))}getFileExplorers(){return app.workspace.getLeavesOfType("file-explorer")}init(){app.workspace.onLayoutReady(()=>{for(let e of this.pairs)Z(e.mode)&&(app.workspace.onLayoutReady(()=>{this.getFileExplorers().forEach(i=>{this.addAction(e,i)})}),this.plugin.registerEvent(app.workspace.on("layout-change",()=>{this.getFileExplorers().forEach(i=>{this.addAction(e,i)})})))})}reorder(){this.actions.forEach((e,n)=>this.removeAction(n,!0)),this.init()}async addCommand(e){this.pairs.push(e),app.workspace.onLayoutReady(()=>{this.getFileExplorers().forEach(i=>{this.addAction(e,i)})}),this.plugin.registerEvent(app.workspace.on("layout-change",()=>{this.getFileExplorers().forEach(i=>{this.addAction(e,i)})})),await this.plugin.saveSettings()}async removeCommand(e){this.pairs.remove(e),this.removeAction(e),await this.plugin.saveSettings()}buttonExists(e,n){return[...e.view.containerEl.querySelectorAll("div.nav-buttons-container > .cmdr.clickable-icon")].some(i=>i.getAttribute("data-cmdr")===n.icon+n.name)}addAction(e,n){var l,h,s,g,v;if(this.buttonExists(n,e))return;let i=createDiv({cls:"cmdr clickable-icon",attr:{"aria-label-position":"top","aria-label":e.name,"data-cmdr":e.icon+e.name}});this.actions.set(e,i),i.style.color=e.color==="#000000"||e.color===void 0?"inherit":e.color;let r=!1,c=()=>{i.empty(),(0,Se.setIcon)(i,e.icon,12),i.onclick=()=>app.commands.executeCommandById(e.id)},u=()=>{i.empty(),(0,Se.setIcon)(i,"trash",12),i.onclick=async()=>{(!this.plugin.settings.confirmDeletion||await new H(this.plugin).didChooseRemove())&&this.removeCommand(e)}};i.addEventListener("mouseleave",()=>{c(),r=!1}),i.addEventListener("mousemove",f=>{f.preventDefault(),f.stopImmediatePropagation(),f.shiftKey&&(r||u(),r=!0)}),i.addEventListener("contextmenu",f=>{f.stopImmediatePropagation(),new Se.Menu().addItem(b=>{b.setTitle(m("Add command")).setIcon("command").onClick(async()=>{let S=await V(this.plugin);this.addCommand(S)})}).addSeparator().addItem(b=>{b.setTitle(m("Change Icon")).setIcon("box").onClick(async()=>{let S=await new D(this.plugin).awaitSelection();S&&S!==e.icon&&(e.icon=S,await this.plugin.saveSettings(),this.reorder())})}).addItem(b=>{b.setTitle(m("Rename")).setIcon("text-cursor-input").onClick(async()=>{let S=await new q(e.name).awaitSelection();S&&S!==e.name&&(e.name=S,await this.plugin.saveSettings(),this.reorder())})}).addItem(b=>{b.dom.addClass("is-warning"),b.setTitle(m("Delete")).setIcon("lucide-trash").onClick(async()=>{(!this.plugin.settings.confirmDeletion||await new H(this.plugin).didChooseRemove())&&this.removeCommand(e)})}).showAtMouseEvent(f)}),c(),(v=(g=(s=(h=(l=n.view)==null?void 0:l.containerEl)==null?void 0:h.querySelector)==null?void 0:s.call(h,"div.nav-buttons-container"))==null?void 0:g.appendChild)==null||v.call(g,i)}removeAction(e,n=!1){let i=this.actions.get(e);if(!!i){if(n){i.remove(),this.actions.delete(e);return}i.addClass("cmdr-ribbon-removing"),i.addEventListener("transitionend",async()=>{i.remove(),this.actions.delete(e)})}}};var se=require("obsidian");var tt=class extends j{async addCommand(o){this.pairs.push(o),await this.plugin.saveSettings()}async removeCommand(o){this.pairs.remove(o),await this.plugin.saveSettings()}reorder(){}addRemovableCommand(o,e,n,i,r){return c=>{var f;c.dom.addClass("cmdr"),c.dom.style.color=e.color==="#000000"||e.color===void 0?"inherit":e.color,c.setSection("cmdr"),c.dom.style.display="flex";let u=createDiv({cls:"cmdr-menu-more-options"}),l=null;u.addEventListener("click",b=>{b.preventDefault(),b.stopImmediatePropagation(),l?(l.hide(),l=null):l=new se.Menu().addItem(S=>{S.setTitle(m("Change Icon")).setIcon("box").onClick(async()=>{let C=await new D(n).awaitSelection();C&&C!==e.icon&&(e.icon=C,await n.saveSettings())})}).addItem(S=>{S.setTitle(m("Rename")).setIcon("text-cursor-input").onClick(async()=>{let C=await new q(e.name).awaitSelection();C&&C!==e.name&&(e.name=C,await n.saveSettings())})}).addItem(S=>{S.dom.addClass("is-warning"),S.setTitle(m("Delete")).setIcon("lucide-trash").onClick(async()=>{(!n.settings.confirmDeletion||await new H(n).didChooseRemove())&&v()})}).showAtMouseEvent(b)}),(0,se.setIcon)(u,"more-vertical",16),c.dom.append(u),c.setTitle((f=e.name)!=null?f:o.name).setIcon(e.icon).onClick(()=>app.commands.executeCommandById(e.id));let h=!1,s=()=>{u.style.display="none"},g=()=>{u.style.display="block"},v=async()=>{c.dom.addClass("cmdr-removing"),i.registerDomEvent(c.dom,"transitionend",()=>{c.dom.remove()}),r.remove(e),await n.saveSettings()};i.registerDomEvent(c.dom,"mousemove",b=>{b.preventDefault(),b.stopImmediatePropagation(),h||g(),h=!0}),i.registerDomEvent(c.dom,"mouseleave",()=>{s(),h=!1}),s()}}addCommandAddButton(o,e,n){o.settings.showAddCommand&&e.addItem(i=>{i.setTitle(m("Add command")).setIcon("plus-circle").setSection("cmdr").onClick(async()=>{try{let r=await V(o);n.push(r),await o.saveSettings()}catch(r){console.log(r)}})})}},Pe=class extends tt{applyEditorMenuCommands(o){return async(e,n,i)=>{this.addCommandAddButton(o,e,o.settings.editorMenu);for(let r of o.settings.editorMenu){let c=G(r.id);!c||!Z(r.mode)||c.checkCallback&&!c.checkCallback(!0)||c.editorCheckCallback&&!c.editorCheckCallback(!0,n,i)||e.addItem(this.addRemovableCommand.call(this,c,r,o,e,o.settings.editorMenu))}}}},Ee=class extends tt{applyFileMenuCommands(o){return async(e,n,i,r)=>{this.addCommandAddButton(o,e,o.settings.fileMenu);for(let c of o.settings.fileMenu){let u=G(c.id);if(!!u&&!(u.checkCallback&&!u.checkCallback(!0))){if(u.editorCallback){if(!((r==null?void 0:r.view)instanceof se.MarkdownView))continue}else if(u.editorCheckCallback)if((r==null?void 0:r.view)instanceof se.MarkdownView){if(!u.editorCheckCallback(!0,r.view.editor,r.view))continue}else continue;e.addItem(this.addRemovableCommand.call(this,u,c,o,e,o.settings.fileMenu))}}}}};var ce=require("obsidian");var Ce=class extends j{constructor(e,n){super(e,n);this.buttons=new WeakMap;this.init()}addPageHeaderButton(e,n){let{id:i,icon:r,name:c}=n,{view:u}=e;if(!(u instanceof ce.ItemView))return;let l=this.buttonsFor(e,!0);if(!l||l.has(i))return;let h=u.addAction(r,c,()=>{app.workspace.setActiveLeaf(e,{focus:!0}),app.commands.executeCommandById(i)});l.set(i,h),h.addClasses(["cmdr-page-header",i]),h.style.color=n.color==="#000000"||n.color===void 0?"inherit":n.color,h.addEventListener("contextmenu",s=>{s.stopImmediatePropagation(),new ce.Menu().addItem(g=>{g.setTitle(m("Add command")).setIcon("command").onClick(async()=>{let v=await V(this.plugin);this.addCommand(v)})}).addSeparator().addItem(g=>{g.setTitle(m("Change Icon")).setIcon("box").onClick(async()=>{let v=await new D(this.plugin).awaitSelection();v&&v!==n.icon&&(n.icon=v,await this.plugin.saveSettings(),this.reorder())})}).addItem(g=>{g.setTitle(m("Rename")).setIcon("text-cursor-input").onClick(async()=>{let v=await new q(n.name).awaitSelection();v&&v!==n.name&&(n.name=v,await this.plugin.saveSettings(),this.reorder())})}).addItem(g=>{g.dom.addClass("is-warning"),g.setTitle(m("Delete")).setIcon("lucide-trash").onClick(async()=>{(!this.plugin.settings.confirmDeletion||await new H(this.plugin).didChooseRemove())&&this.removeCommand(n)})}).showAtMouseEvent(s)})}init(){this.plugin.register(()=>{this.removeButtonsFromAllLeaves()}),this.plugin.registerEvent(app.workspace.on("layout-change",()=>{this.addButtonsToAllLeaves()})),app.workspace.onLayoutReady(()=>setTimeout(()=>this.addButtonsToAllLeaves(),100))}addAdderButton(e){var c;let{view:n}=e,i="cmdr-adder";if(!(n instanceof ce.ItemView)||(c=this.buttons.get(n))!=null&&c.has(i))return;let r=n.addAction("plus",m("Add new"),async()=>{this.addCommand(await V(this.plugin))});r.addClasses(["cmdr",i]),this.buttons.has(n)||this.buttons.set(n,new Map),this.buttons.get(n).set(i,r)}addButtonsToAllLeaves(e=!1){activeWindow.requestAnimationFrame(()=>app.workspace.iterateAllLeaves(n=>this.addButtonsToLeaf(n,e)))}removeButtonsFromAllLeaves(){activeWindow.requestAnimationFrame(()=>app.workspace.iterateAllLeaves(e=>this.removeButtonsFromLeaf(e)))}buttonsFor(e,n=!1){if(e.view instanceof ce.ItemView)return n&&!this.buttons.has(e.view)&&this.buttons.set(e.view,new Map),this.buttons.get(e.view)}addButtonsToLeaf(e,n=!1){var i;if(e.view instanceof ce.ItemView){if(n)this.removeButtonsFromLeaf(e);else if((i=this.buttonsFor(e))!=null&&i.size)return;for(let r=this.pairs.length-1;r>=0;r--){let c=this.pairs[r];Z(c.mode)&&this.addPageHeaderButton(e,c)}this.plugin.settings.showAddCommand&&this.addAdderButton(e)}}removeButtonsFromLeaf(e){let n=this.buttonsFor(e);if(n){for(let i of n.values())i.detach();n==null||n.clear()}}reorder(){this.addButtonsToAllLeaves(!0)}async addCommand(e){this.pairs.push(e),this.addButtonsToAllLeaves(!0),await this.plugin.saveSettings()}async removeCommand(e){this.pairs.remove(e),this.addButtonsToAllLeaves(!0),await this.plugin.saveSettings()}};var Q=require("obsidian");var _e=class extends j{constructor(e,n){super(n,n.settings[`${e}Ribbon`]);this.side=e;this.actions={},app.workspace.onLayoutReady(()=>{this.side==="right"?this.addActionContainer():this.ribbonEl=app.workspace.leftRibbon,this.addBtn=createDiv({cls:"cmdr side-dock-ribbon-action cmdr-adder",attr:{"aria-label-position":e==="left"?"right":"left","aria-label":m("Add new")}}),this.init()}),this.plugin.register(()=>{Q.Platform.isMobile?Object.keys(this.actions).forEach(i=>this.removeActionMobile(i)):Object.values(this.actions).forEach(i=>i.remove())})}async addCommand(e){var i;let n=G(e.id);n?this.addAction((i=e.name)!=null?i:n.name,e.icon,e,()=>app.commands.executeCommandById(e.id)):this.addAction(m("This Command seems to have been removed. {{command_name}}").replace("{{command_name}}",e.name||""),"trash",e,r=>{this.removeAction(r.target.getAttribute("aria-label")+"trash")}),this.pairs.push(e),await this.plugin.saveSettings()}async removeCommand(e){this.removeAction(e.name+e.icon),this.pairs.remove(e),await this.plugin.saveSettings()}reorder(){this.addBtn.remove(),Q.Platform.isMobile?Object.keys(this.actions).forEach(e=>this.removeActionMobile(e)):Object.values(this.actions).forEach(e=>e.remove()),this.init()}init(){for(let e of this.pairs)Z(e.mode)&&this.addAction(e.name,e.icon,e,()=>app.commands.executeCommandById(e.id));this.plugin.register(()=>this.addBtn.remove()),(0,Q.setIcon)(this.addBtn,"plus"),this.addBtn.onclick=async()=>{let e=await V(this.plugin);this.addCommand(e),this.reorder()},this.plugin.settings.showAddCommand&&app.workspace.onLayoutReady(()=>{var e,n;return(n=(e=this.ribbonEl.ribbonActionsEl)==null?void 0:e.append)==null?void 0:n.call(e,this.addBtn)})}addActionMobile(e,n,i){app.workspace.leftRibbon.orderedRibbonActions.push({cmdr__id:e+n,title:e,icon:n,callback:i})}removeActionMobile(e){app.workspace.leftRibbon.orderedRibbonActions=app.workspace.leftRibbon.orderedRibbonActions.filter(n=>n.cmdr__id!==e)}addAction(e,n,i,r){var s;let c=this.ribbonEl.makeRibbonActionButton(n,e,()=>{});if(c.addClass("cmdr"),c.style.color=i.color==="#000000"||i.color===void 0?"inherit":i.color,c.setAttribute("aria-label-position",this.side==="left"?"right":"left"),this.actions[e+n]=c,Q.Platform.isMobile){this.addActionMobile(e,n,r);return}let u=!1,l=()=>{c.empty(),(0,Q.setIcon)(c,n),c.onclick=r},h=()=>{c.empty(),(0,Q.setIcon)(c,"trash"),c.onclick=async()=>{(!this.plugin.settings.confirmDeletion||await new H(this.plugin).didChooseRemove())&&this.removeCommand(i)}};c.addEventListener("mouseleave",()=>{u=!1,l()}),c.addEventListener("mousemove",g=>{g.preventDefault(),g.stopImmediatePropagation(),g.shiftKey&&(u||h(),u=!0)}),c.addEventListener("contextmenu",g=>{g.stopImmediatePropagation(),new Q.Menu().addItem(v=>{v.setTitle(m("Add command")).setIcon("command").onClick(async()=>{let f=await V(this.plugin);this.addCommand(f)})}).addSeparator().addItem(v=>{v.setTitle(m("Change Icon")).setIcon("box").onClick(async()=>{let f=await new D(this.plugin).awaitSelection();f&&f!==i.icon&&(i.icon=f,await this.plugin.saveSettings(),this.reorder())})}).addItem(v=>{v.setTitle(m("Rename")).setIcon("text-cursor-input").onClick(async()=>{let f=await new q(i.name).awaitSelection();f&&f!==i.name&&(i.name=f,await this.plugin.saveSettings(),this.reorder())})}).addItem(v=>{v.dom.addClass("is-warning"),v.setTitle(m("Delete")).setIcon("lucide-trash").onClick(async()=>{(!this.plugin.settings.confirmDeletion||await new H(this.plugin).didChooseRemove())&&this.removeCommand(i)})}).showAtMouseEvent(g)}),l(),(s=this.ribbonEl.ribbonActionsEl)==null||s.append(c)}async removeAction(e){if(Q.Platform.isMobile){this.removeActionMobile(e);return}this.actions[e].addClass("cmdr-ribbon-removing"),this.actions[e].addEventListener("transitionend",()=>{this.actions[e].remove(),delete this.actions[e]})}addActionContainer(){let e=createDiv({cls:`side-dock-actions cmdr-${this.side}-ribbon`});this.ribbonEl.collapseButtonEl.insertAdjacentElement("afterend",e),this.ribbonEl.ribbonActionsEl=e,this.plugin.register(()=>e.remove())}};var de=require("obsidian");var we=class extends j{constructor(e,n){super(e,n);this.actions=new Map;this.addBtn=createDiv({cls:"cmdr status-bar-item cmdr-adder",attr:{"aria-label-position":"top","aria-label":m("Add new")}});this.init(),this.plugin.register(()=>this.actions.forEach((i,r)=>this.removeAction(r)))}init(){app.workspace.onLayoutReady(()=>{this.container=app.statusBar.containerEl;for(let e of this.pairs)G(e.id)||this.pairs.remove(e),Z(e.mode)&&this.addAction(e);this.plugin.saveSettings(),this.plugin.registerDomEvent(this.container,"contextmenu",e=>{e.target===this.container&&new de.Menu().addItem(n=>{n.setTitle(m("Add command")).setIcon("command").onClick(async()=>{let i=await V(this.plugin);this.addCommand(i)})}).showAtMouseEvent(e)}),this.plugin.register(()=>this.addBtn.remove()),(0,de.setIcon)(this.addBtn,"plus",12),this.addBtn.onclick=async()=>{let e=await V(this.plugin);this.addCommand(e),this.reorder()},this.plugin.settings.showAddCommand&&this.container.prepend(this.addBtn)})}reorder(){this.addBtn.remove(),this.actions.forEach((e,n)=>this.removeAction(n,!0)),this.init()}async addCommand(e){this.pairs.push(e),this.addAction(e),await this.plugin.saveSettings()}async removeCommand(e){this.pairs.remove(e),this.removeAction(e),await this.plugin.saveSettings()}addAction(e){let n=createDiv({cls:"cmdr status-bar-item clickable-icon",attr:{"aria-label-position":"top","aria-label":e.name}});this.actions.set(e,n),n.style.color=e.color==="#000000"||e.color===void 0?"inherit":e.color;let i=!1,r=()=>{n.empty(),(0,de.setIcon)(n,e.icon,12),n.onclick=()=>app.commands.executeCommandById(e.id)},c=()=>{n.empty(),(0,de.setIcon)(n,"trash",12),n.onclick=async()=>{(!this.plugin.settings.confirmDeletion||await new H(this.plugin).didChooseRemove())&&this.removeCommand(e)}};n.addEventListener("mouseleave",()=>{r(),i=!1}),n.addEventListener("mousemove",u=>{u.preventDefault(),u.stopImmediatePropagation(),u.shiftKey&&(i||c(),i=!0)}),n.addEventListener("contextmenu",u=>{u.stopImmediatePropagation(),new de.Menu().addItem(l=>{l.setTitle(m("Add command")).setIcon("command").onClick(async()=>{let h=await V(this.plugin);this.addCommand(h)})}).addSeparator().addItem(l=>{l.setTitle(m("Change Icon")).setIcon("box").onClick(async()=>{let h=await new D(this.plugin).awaitSelection();h&&h!==e.icon&&(e.icon=h,await this.plugin.saveSettings(),this.reorder())})}).addItem(l=>{l.setTitle(m("Rename")).setIcon("text-cursor-input").onClick(async()=>{let h=await new q(e.name).awaitSelection();h&&h!==e.name&&(e.name=h,await this.plugin.saveSettings(),this.reorder())})}).addItem(l=>{l.dom.addClass("is-warning"),l.setTitle(m("Delete")).setIcon("lucide-trash").onClick(async()=>{(!this.plugin.settings.confirmDeletion||await new H(this.plugin).didChooseRemove())&&this.removeCommand(e)})}).showAtMouseEvent(u)}),r(),this.container.prepend(n)}removeAction(e,n=!1){let i=this.actions.get(e);if(!!i){if(n){i.remove(),this.actions.delete(e);return}i.addClass("cmdr-ribbon-removing"),i.addEventListener("transitionend",async()=>{i.remove(),this.actions.delete(e)})}}};var Zo=require("obsidian");var rt=require("obsidian");var Y=require("obsidian");var xt=require("obsidian");function It(){return a("div",{className:"cmdr-credits"},a("span",null,m("By Johnny\u2728 and phibr0")))}var $o='<svg viewbox="0 0 118 105" width="118" xmlns="http://www.w3.org/2000/svg" height="105" style="-webkit-print-color-adjust:exact" fill="none"><defs><clipPath id="a" class="frame-clip"><rect rx="0" ry="0" width="118" height="105"/></clipPath></defs><g clip-path="url(#a)"><rect rx="0" ry="0" width="118" height="105" class="frame-background"/><g class="frame-children"><g class="any-key" style="fill:#000"><path d="M35.2 1C25.7 1 18 8.7 18 18.2v51.6C18 79.3 25.7 87 35.2 87h45.6C90.3 87 98 79.3 98 69.8V18.2C98 8.7 90.3 1 80.8 1H35.2Zm0 4h45.6C88.1 5 94 10.9 94 18.2v37.6C94 63.1 88.1 69 80.8 69H35.2C27.9 69 22 63.1 22 55.8V18.2C22 10.9 27.9 5 35.2 5ZM56 19v14.5L43.6 26l-2.1 3.4L54.1 37l-12.6 7.6 2.1 3.4L56 40.5V55h4V40.5L72.4 48l2.1-3.4L61.9 37l12.6-7.6-2.1-3.4L60 33.5V19h-4ZM22 66.8c3.2 3.8 7.9 6.2 13.2 6.2h45.6c5.3 0 10-2.4 13.2-6.2v3C94 77.1 88.1 83 80.8 83H35.2C27.9 83 22 77.1 22 69.8v-3Z" style="fill:var(--text-accent);fill-opacity:1"/><path d="M35.2 1C25.7 1 18 8.7 18 18.2v51.6C18 79.3 25.7 87 35.2 87h45.6C90.3 87 98 79.3 98 69.8V18.2C98 8.7 90.3 1 80.8 1H35.2Zm0 4h45.6C88.1 5 94 10.9 94 18.2v37.6C94 63.1 88.1 69 80.8 69H35.2C27.9 69 22 63.1 22 55.8V18.2C22 10.9 27.9 5 35.2 5ZM56 19v14.5L43.6 26l-2.1 3.4L54.1 37l-12.6 7.6 2.1 3.4L56 40.5V55h4V40.5L72.4 48l2.1-3.4L61.9 37l12.6-7.6-2.1-3.4L60 33.5V19h-4ZM22 66.8c3.2 3.8 7.9 6.2 13.2 6.2h45.6c5.3 0 10-2.4 13.2-6.2v3C94 77.1 88.1 83 80.8 83H35.2C27.9 83 22 77.1 22 69.8v-3Z" style="fill:none;stroke-width:1;stroke:var(--text-accent);stroke-opacity:1" class="stroke-shape"/></g><path d="M20.11 53.587 3 63.9"/><g class="stroke-shape"><defs><marker refX="3" fill-opacity="1" orient="auto-start-reverse" id="b" viewBox="0 0 6 6" fill="var(--text-accent)" refY="3" markerWidth="6" markerHeight="6"><path d="M3 2.5a.5.5 0 0 1 0 1"/></marker></defs><path d="M20.11 53.587 3 63.9" style="fill:none;stroke-width:5;stroke:var(--text-accent);stroke-opacity:1;marker-end:url(#b)"/></g><path d="m96 53.567 19.161-11.55"/><g class="stroke-shape"><defs><marker refX="3" fill-opacity="1" orient="auto-start-reverse" id="c" viewBox="0 0 6 6" fill="var(--text-accent)" refY="3" markerWidth="6" markerHeight="6"><path d="M3 2.5a.5.5 0 0 1 0 1"/></marker></defs><path d="m96 53.567 19.161-11.55" style="fill:none;stroke-width:5;stroke:var(--text-accent);stroke-opacity:1;marker-end:url(#c)"/></g><path d="M20.11 53.587 3 63.9"/><g class="stroke-shape"><defs><marker refX="3" fill-opacity="1" orient="auto-start-reverse" id="d" viewBox="0 0 6 6" fill="var(--text-accent)" refY="3" markerWidth="6" markerHeight="6"><path d="M3 2.5a.5.5 0 0 1 0 1"/></marker></defs><path d="M20.11 53.587 3 63.9" style="fill:none;stroke-width:5;stroke:var(--text-accent);stroke-opacity:1;marker-end:url(#d)"/></g><path d="M42 84v18h12"/><g class="stroke-shape"><defs><marker refX="3" fill-opacity="1" orient="auto-start-reverse" id="e" viewBox="0 0 6 6" fill="var(--text-accent)" refY="3" markerWidth="6" markerHeight="6"><path d="M3 2.5a.5.5 0 0 1 0 1"/></marker></defs><path d="M42 84v18h12" style="fill:none;stroke-width:5;stroke:var(--text-accent);stroke-opacity:1;marker-end:url(#e)"/></g><path d="M74 84v18h12"/><g class="stroke-shape"><defs><marker refX="3" fill-opacity="1" orient="auto-start-reverse" id="f" viewBox="0 0 6 6" fill="var(--text-accent)" refY="3" markerWidth="6" markerHeight="6"><path d="M3 2.5a.5.5 0 0 1 0 1"/></marker></defs><path d="M74 84v18h12" style="fill:none;stroke-width:5;stroke:var(--text-accent);stroke-opacity:1;marker-end:url(#f)"/></g><path d="m96 53.567 19.161-11.55"/><g class="stroke-shape"><defs><marker refX="3" fill-opacity="1" orient="auto-start-reverse" id="g" viewBox="0 0 6 6" fill="var(--text-accent)" refY="3" markerWidth="6" markerHeight="6"><path d="M3 2.5a.5.5 0 0 1 0 1"/></marker></defs><path d="m96 53.567 19.161-11.55" style="fill:none;stroke-width:5;stroke:var(--text-accent);stroke-opacity:1;marker-end:url(#g)"/></g><path d="M42 84v18h12"/><g class="stroke-shape"><defs><marker refX="3" fill-opacity="1" orient="auto-start-reverse" id="h" viewBox="0 0 6 6" fill="var(--text-accent)" refY="3" markerWidth="6" markerHeight="6"><path d="M3 2.5a.5.5 0 0 1 0 1"/></marker></defs><path d="M42 84v18h12" style="fill:none;stroke-width:5;stroke:var(--text-accent);stroke-opacity:1;marker-end:url(#h)"/></g><path d="M74 84v18h12"/><g class="stroke-shape"><defs><marker refX="3" fill-opacity="1" orient="auto-start-reverse" id="i" viewBox="0 0 6 6" fill="var(--text-accent)" refY="3" markerWidth="6" markerHeight="6"><path d="M3 2.5a.5.5 0 0 1 0 1"/></marker></defs><path d="M74 84v18h12" style="fill:none;stroke-width:5;stroke:var(--text-accent);stroke-opacity:1;marker-end:url(#i)"/></g></g></g></svg>';function me(){return a("div",{class:"cmdr-icon-wrapper",dangerouslySetInnerHTML:{__html:$o}})}function St({manifest:t}){let o=a("button",{className:"mod-cta",onClick:n=>{Mt(n),setTimeout(()=>location.replace("https://forms.gle/hPjn61G9bqqFb3256"),Math.random()*800+500)}},a(y,{icon:"message-square",size:20}),m("Leave feedback")),e=a("button",{className:"mod-cta",onClick:n=>{Mt(n),setTimeout(()=>location.replace("https://ko-fi.com/phibr0"),Math.random()*800+500)}},a(y,{icon:"coffee",size:20}),m("Support development"));return a("div",{className:"cmdr-about"},xt.Platform.isMobile&&[a("hr",null),o,e],xt.Platform.isDesktop&&[a("div",{className:"setting-item mod-toggle",style:{width:"100%",borderTop:"1px solid var(--background-modifier-border)",paddingTop:"18px"}},a("div",{className:"setting-item-info"},a("div",{className:"setting-item-name"},m("Leave feedback")),a("div",{className:"setting-item-description"},m("Share feedback, issues, and ideas with our feedback form."))),a("div",{className:"setting-item-control"},o)),a("div",{className:"setting-item mod-toggle",style:{width:"100%"}},a("div",{className:"setting-item-info"},a("div",{className:"setting-item-name"},m("Donate")),a("div",{className:"setting-item-description"},m("Consider donating to support development."))),a("div",{className:"setting-item-control"},e)),a("hr",null)],a(me,null),a("b",null,t.name),a(It,null),a("a",{className:"cmdr-version",href:"https://github.com/phibr0/obsidian-commander/releases/tag/"+t.version},t.version))}var U=require("obsidian");function Pt(t,o){if(t.empty(),new U.Setting(t).setName("Toolbar Row Count").setDesc("Set how many Rows the Mobile Toolbar should have. Set this to 0 to remove the Toolbar.").addSlider(n=>n.setLimits(0,5,1).setValue(o.settings.advancedToolbar.rowCount).setDynamicTooltip().onChange(async i=>{o.settings.advancedToolbar.rowCount=i,await o.saveSettings(),oe(o.settings.advancedToolbar)})),new U.Setting(t).setName("Column Layout").setDesc("Use a column based layout instead of the default row. This makes it easier to arrange the Commands.").addToggle(n=>n.setValue(o.settings.advancedToolbar.columnLayout).onChange(async i=>{o.settings.advancedToolbar.columnLayout=i,await o.saveSettings(),oe(o.settings.advancedToolbar)})),new U.Setting(t).setName("Bottom Offset").setDesc("Offset the Toolbar from the Bottom of the Screen. This is useful if the toolbar is partially obscured by other UI Elements.").addSlider(n=>n.setLimits(0,32,1).setValue(o.settings.advancedToolbar.heightOffset).setDynamicTooltip().onChange(async i=>{o.settings.advancedToolbar.heightOffset=i,await o.saveSettings(),oe(o.settings.advancedToolbar)})),U.Platform.isMobile){let n=document.createDocumentFragment();n.appendChild(createEl("h3",{text:"Custom Icons"})),t.appendChild(n),o.getCommandsWithoutIcons().forEach(i=>{new U.Setting(t).setName(i.name).setDesc(`ID: ${i.id}`).addButton(r=>{var u;let c=r.buttonEl.createDiv({cls:"AT-settings-icon"});if(i.icon)(0,U.setIcon)(c,i.icon,20);else{let l=(u=o.settings.advancedToolbar.mappedIcons.find(h=>h.commandID===i.id))==null?void 0:u.iconID;l?(0,U.setIcon)(c,l,20):r.setButtonText("No Icon")}r.onClick(async()=>{let l=await new D(o).awaitSelection(),h=o.settings.advancedToolbar.mappedIcons.find(s=>s.commandID===i.id);h?h.iconID=l:o.settings.advancedToolbar.mappedIcons.push({commandID:i.id,iconID:l}),await o.saveSettings(),et(o.settings.advancedToolbar),Pt(t,o)})}).addExtraButton(r=>{r.setIcon("reset").setTooltip("Reset to default - Requires a restart").onClick(async()=>{o.settings.advancedToolbar.mappedIcons=o.settings.advancedToolbar.mappedIcons.filter(c=>c.commandID!==i.id),delete i.icon,delete app.commands.commands[i.id].icon,await o.saveSettings(),Pt(t,o),new U.Notice("If the default Icon doesn't appear, you might have to restart Obsidian.")})})})}let e=t.appendChild(createEl("div",{cls:"cmdr-sep-con",attr:{style:"margin-top: 64px"}}));e.appendChild(createEl("div",{text:"Advanced Settings",attr:{style:"margin-bottom: 8px; font-weight: bold"}})),new U.Setting(e).setName("Button Height").setDesc("Change the Height of each Button inside the Mobile Toolbar (in px).").addText(n=>{var i,r;return n.setValue((r=(i=o.settings.advancedToolbar.rowHeight)==null?void 0:i.toString())!=null?r:"48").setPlaceholder("48").onChange(async c=>{let u=Number(c),l=isNaN(u);n.inputEl.toggleClass("is-invalid",l),l||(o.settings.advancedToolbar.rowHeight=u,await o.saveSettings(),oe(o.settings.advancedToolbar))})}),new U.Setting(e).setName("Button Width").setDesc("Change the Width of each Button inside the Mobile Toolbar (in px).").addText(n=>{var i,r;return n.setValue((r=(i=o.settings.advancedToolbar.buttonWidth)==null?void 0:i.toString())!=null?r:"48").setPlaceholder("48").onChange(async c=>{let u=Number(c),l=isNaN(u);n.inputEl.toggleClass("is-invalid",l),l||(o.settings.advancedToolbar.buttonWidth=u,await o.saveSettings(),oe(o.settings.advancedToolbar))})}),new U.Setting(e).setName("Toolbar Extra Spacing").setDesc("Some Themes need extra spacing in the toolbar. If your Toolbar doesn't wrap properly, try increasing this value.").addSlider(n=>n.setLimits(0,64,1).setValue(o.settings.advancedToolbar.spacing).setDynamicTooltip().onChange(async i=>{o.settings.advancedToolbar.spacing=i,await o.saveSettings(),oe(o.settings.advancedToolbar)}))}function Et({plugin:t}){let o=ee(null);return W(()=>{Pt(o.current,t)},[]),a(R,null,a("div",{className:"cmdr-sep-con callout","data-callout":"info"},a("span",{className:"cmdr-callout-warning"},a(y,{icon:"alert-circle"})," ","Info"),a("p",{className:"cmdr-warning-description"},"The Toolbar is only available in Obsidian Mobile. ",U.Platform.isMobile&&a(R,null,"To configure which Commands show up in the Toolbar, open the Mobile Settings.")),U.Platform.isMobile&&a("button",{onClick:()=>{app.setting.openTabById("mobile")},className:"mod-cta"},"Open Mobile Settings")),a("div",{ref:o,style:{paddingBottom:"256px"}}))}var ue=require("obsidian");var Ko=require("obsidian");var Go=require("obsidian");var ot=({initialColor:t,onChange:o})=>{let e=ee(null);return W(()=>(e.current&&new Go.ColorComponent(e.current).setValue(t).onChange(o),()=>{var n,i;return(i=(n=e.current)==null?void 0:n.empty)==null?void 0:i.call(n)}),[o,t]),a("div",{ref:e,className:"cmdr-flex cmdr-items-center"})};function Tt({modal:t}){var o;return W(()=>{let e=()=>{this.forceUpdate()};return addEventListener("cmdr-icon-changed",e),()=>removeEventListener("cmdr-icon-changed",e)},[]),a("div",{className:"cmdr-mobile-modify-grid"},a("div",{className:"cmdr-mobile-modify-option",onClick:t.handleNewIcon},a("span",null,m("Icon")),a("span",{className:"cmdr-flex cmdr-gap-1"},a(y,{icon:t.pair.icon,size:20,className:"clickable-icon",style:{marginRight:"0px"}}),a(ot,{initialColor:(o=t.pair.color)!=null?o:"#000",onChange:t.handleColorChange}))),a("div",{className:"cmdr-mobile-modify-option"},a("span",null,m("Name")),a("input",{onBlur:({currentTarget:e})=>t.handleRename(e.value),type:"text",placeholder:m("Custom Name"),value:t.pair.name})),a("div",{className:"cmdr-mobile-modify-option"},a("select",{className:"dropdown",value:t.pair.mode,onChange:({currentTarget:e})=>t.handleModeChange(e.value)},a("option",{value:"any"},m("Add command to all devices")),a("option",{value:"mobile"},m("Add command only to mobile devices")),a("option",{value:"desktop"},m("Add command only to desktop devices")),a("option",{value:app.appId},m("Add command only to this device")))),a("div",{className:"modal-button-container"},a("button",{className:"mod-cta",onClick:()=>t.close()},m("Done"))))}var le=class extends Ko.Modal{constructor(e,n,i,r,c){super(app);this.pair=e;this.handleRename=n;this.handleNewIcon=i;this.handleModeChange=r;this.handleColorChange=c}async onOpen(){this.titleEl.innerText=this.pair.name,this.reactComponent=a(Tt,{modal:this}),X(this.reactComponent,this.contentEl)}onClose(){X(null,this.contentEl)}};function Te({value:t,handleChange:o,ariaLabel:e}){let[n,i]=F(!1),r=ee(null),[c,u]=F(0);return W(()=>{var l,h;(l=r==null?void 0:r.current)==null||l.select(),(h=r==null?void 0:r.current)==null||h.focus()}),a("div",{class:"cmdr-editable"},n?a("input",{type:"text",value:t,style:{width:c+25+"px"},onKeyDown:l=>{l.key==="Enter"&&l.target.value.length>0&&(i(!1),o(l))},onBlur:()=>i(!1),ref:r}):a("span",{onDblClick:({target:l})=>{u(l==null?void 0:l.offsetWidth),i(!0)},"aria-label":e},t))}function At({pair:t,handleRemove:o,handleDown:e,handleUp:n,handleNewIcon:i,handleRename:r,handleModeChange:c,handleColorChange:u}){var S;let l=G(t.id);if(!l)return a(R,null,ue.Platform.isDesktop&&a("div",{className:"setting-item mod-toggle"},a(y,{icon:"alert-triangle",size:20,className:"cmdr-icon clickable-icon mod-warning"}),a("div",{className:"setting-item-info"},a("div",{className:"setting-item-name"},t.name),a("div",{className:"setting-item-description"},m("This Command is not available on this device."))),a("div",{className:"setting-item-control"},a("button",{className:"mod-warning",style:"display: flex",onClick:o,"aria-label":m("Delete")},a(y,{icon:"lucide-trash"})))),ue.Platform.isMobile&&a("div",{className:"mobile-option-setting-item",onClick:()=>{new ue.Notice(m("This Command is not available on this device."))}},a("span",{className:"mobile-option-setting-item-remove-icon",onClick:o},a(y,{icon:"minus-with-circle",size:22,style:{color:"var(--text-error)"}})),a("span",{className:"mobile-option-setting-item-option-icon mod-warning"},a(y,{icon:"alert-triangle",size:22})),a("span",{className:"mobile-option-setting-item-name"},t.name)));let h=l.id.split(":").first(),s=app.plugins.manifests[h],g=!s,v=l.hasOwnProperty("checkCallback")||l.hasOwnProperty("editorCheckCallback"),f=oi(t.mode),b=t.mode.match(/desktop|mobile|any/)?t.mode[0].toUpperCase()+t.mode.substring(1):m("This device");return a(R,null,ue.Platform.isDesktop&&a("div",{className:"setting-item mod-toggle"},a(y,{icon:t.icon,size:20,"aria-label":m("Choose new"),onClick:i,className:"cmdr-icon clickable-icon"}),a("div",{className:"setting-item-info"},a("div",{className:"setting-item-name"},a(Te,{ariaLabel:m("Double click to rename"),handleChange:({target:C})=>{r(C==null?void 0:C.value)},value:t.name}),t.name!==l.name&&a("span",{style:"margin-left: .8ex"},"(",l.name,")")),a("div",{className:"setting-item-description"},m("Added by {{plugin_name}}.".replace("{{plugin_name}}",g?"Obsidian":s.name))," ",v?m("Warning: This is a checked Command, meaning it might not run under every circumstance."):"")),a("div",{className:"setting-item-control"},a(ot,{initialColor:(S=t.color)!=null?S:"#000",onChange:u}),a(y,{icon:"arrow-down",className:"setting-editor-extra-setting-button clickable-icon",onClick:e,"aria-label":m("Move down")}),a(y,{icon:"arrow-up",className:"setting-editor-extra-setting-button clickable-icon",onClick:n,"aria-label":m("Move up")}),a(y,{icon:f,className:"setting-editor-extra-setting-button clickable-icon",onClick:()=>c(),"aria-label":m("Change Mode (Currently: {{current_mode}})").replace("{{current_mode}}",b)}),a("button",{className:"mod-warning",style:"display: flex",onClick:o,"aria-label":m("Delete")},a(y,{icon:"lucide-trash"})))),ue.Platform.isMobile&&a("div",{className:"mobile-option-setting-item"},a("span",{className:"mobile-option-setting-item-remove-icon",onClick:o},a(y,{icon:"minus-with-circle",size:22,style:{color:"var(--text-error)"}})),a("span",{className:"mobile-option-setting-item-option-icon"},a(y,{icon:t.icon,size:22,onClick:()=>{new le(t,r,i,c,u).open()}})),a("span",{className:"mobile-option-setting-item-name",onClick:()=>{new le(t,r,i,c,u).open()}},t.name,t.name!==l.name&&a("span",{className:"cmdr-option-setting-name"},"(",l.name,")")),a("span",{className:"mobile-option-setting-item-option-icon"},a(y,{icon:"arrow-down",className:"clickable-icon",onClick:e}),a(y,{icon:"arrow-up",className:"clickable-icon",onClick:n}),a(y,{icon:"three-horizontal-bars",className:"clickable-icon",onClick:()=>{new le(t,r,i,c,u).open()}}))))}function oi(t){return t==="mobile"?"smartphone":t==="desktop"?"monitor":t==="any"?"cmdr-all-devices":"airplay"}function Nt(t,o,e){let n=o<0?t.length+o:o;if(n>=0&&n<t.length){let i=e<0?t.length+e:e,[r]=t.splice(o,1);t.splice(i,0,r)}}var Qo=require("obsidian");var ni=Bo(null);function ae({manager:t,plugin:o,children:e}){return a(R,null,a(ni.Provider,{value:t},a("div",{className:"cmdr-sep-con"},t.pairs.map((n,i)=>{if(n.mode.match(/desktop|mobile|any/)||n.mode===app.appId)return a(At,{key:n.id,pair:n,handleRemove:async()=>{(!o.settings.confirmDeletion||await new H(o).didChooseRemove())&&(await t.removeCommand(n),this.forceUpdate())},handleUp:()=>{Nt(t.pairs,i,i-1),t.reorder(),this.forceUpdate()},handleDown:()=>{Nt(t.pairs,i,i+1),t.reorder(),this.forceUpdate()},handleRename:async r=>{n.name=r,await o.saveSettings(),t.reorder(),this.forceUpdate()},handleNewIcon:async()=>{let r=await new D(o).awaitSelection();r&&r!==n.icon&&(n.icon=r,await o.saveSettings(),t.reorder(),this.forceUpdate()),dispatchEvent(new Event("cmdr-icon-changed"))},handleModeChange:async r=>{let c=["any","desktop","mobile",app.appId],u=c.indexOf(n.mode);u===3&&(u=-1),n.mode=r||c[u+1],await o.saveSettings(),t.reorder(),this.forceUpdate()},handleColorChange:async r=>{n.color=r,await o.saveSettings(),t.reorder()}})})),!t.pairs.some(n=>Z(n.mode)||n.mode.match(/mobile|desktop/))&&a("div",{class:"cmdr-commands-empty"},a(me,null),a("h3",null,m("No commands here!")),a("span",null,m("Would you like to add one now?"))),Qo.Platform.isMobile&&a("hr",null),a("div",{className:"cmdr-add-new-wrapper"},a("button",{className:"mod-cta",onClick:async()=>{let n=await V(o);await t.addCommand(n),t.reorder(),this.forceUpdate()}},m("Add command")))),e)}function nt({title:t,children:o}){let[e,n]=F(!1);return a("div",{className:"cmdr-accordion cmdr-sep-con","aria-expanded":e},a("div",{className:"cmdr-accordion-header",onClick:()=>{n(!e)}},a(y,{className:"cmdr-accordion-chevron clickable-icon",icon:"chevron-down",size:24}),a("span",null,t)),a("div",{className:"cmdr-accordion-content",style:{maxHeight:[o].flat().length*120+"px"}},o))}function Lt({name:t,description:o,children:e,className:n}){return a("div",{className:`setting-item ${n}`},a("div",{className:"setting-item-info"},a("div",{className:"setting-item-name"},t),a("div",{className:"setting-item-description"},o)),a("div",{className:"setting-item-control"},e))}function it(t){let[o,e]=F(t.value);return a(Lt,{name:t.name,description:t.description,className:"mod-toggle"},a("div",{className:`checkbox-container ${o?"is-enabled":""}`,onClick:()=>{e(!o),t.changeHandler(o)}}))}function Bt({name:t,description:o,changeHandler:e,value:n,hideLabel:i,showLabel:r}){let[c,u]=F(n);return a(Lt,{name:t,description:o,className:"mod-toggle"},a(y,{"aria-label":c?r:i,icon:c?"eye-off":"eye",size:20,className:"clickable-icon",onClick:()=>{u(!c),e(c)}}))}function at(t){var n,i,r;let[o,e]=F(t.value);return a(Lt,{description:t.description,name:t.name,className:"cmdr-slider"},a("div",null,a(Te,{ariaLabel:m("Double click to enter custom value"),value:o.toString(),handleChange:({target:c})=>{let u=Number(c.value);!isNaN(u)&&o!==u&&(e(u),t.changeHandler(u))}}),a("input",{class:"slider",type:"range",min:(n=t.min)!=null?n:"0",max:(i=t.max)!=null?i:"32",step:(r=t.step)!=null?r:"1",value:o,onPointerMove:({target:c})=>{o!==c.value&&(e(c.value),t.changeHandler(c.value))}})))}function en({plugin:t}){let[o,e]=F([]),n=t.settings.hide.leftRibbon;return W(()=>{e([...app.workspace.leftRibbon.ribbonActionsEl.children].filter(i=>!i.hasClass("cmdr")).map(i=>({name:i.getAttribute("aria-label"),icon:i.firstElementChild.className})))},[]),a(R,null,a("hr",null),a(nt,{title:m("Hide other Commands")},o.map(i=>a(Bt,{name:i.name,description:"",hideLabel:m("Hide"),showLabel:m("Show"),changeHandler:async r=>{r?n.contains(i.name)&&n.remove(i.name):n.push(i.name),Ie(t.settings),await t.saveSettings()},value:n.contains(i.name)}))))}function tn({plugin:t}){let o=t.settings.hide.statusbar,[e,n]=F([]);return W(()=>{let r=[...app.statusBar.containerEl.getElementsByClassName("status-bar-item")].map(c=>[...c.classList].find(u=>u.startsWith("plugin-"))).filter(c=>c).map(c=>c.substring(7));n(r.map(c=>app.plugins.manifests[c]||{id:c,name:c.replace(/-/g," ").replace(/(^\w{1})|(\s+\w{1})/g,u=>u.toUpperCase()),description:"Core Plugin"}))},[]),a(R,null,a("hr",null),a(nt,{title:m("Hide other Commands")},e.map(i=>a(Bt,{name:i.name,description:i.description,value:o.contains(i.id),hideLabel:m("Hide"),showLabel:m("Show"),changeHandler:async r=>{r?o.contains(i.id)&&o.remove(i.id):o.push(i.id),Ie(t.settings),await t.saveSettings()}}))))}var an=require("obsidian");var nn=require("obsidian");function on({plugin:t,macro:o,onSave:e,onCancel:n}){let[i,r]=F(o.name||"Macro Name"),[c,u]=F(o.icon||"star"),[l,h]=F(o.startup||!1),[s,g]=F(JSON.parse(JSON.stringify(o.macro))||[]),v=this.forceUpdate.bind(this),f=async()=>{let C=await new ne(t).awaitSelection();C&&g([...s,{action:0,commandId:C.id}])},b=async()=>{g([...s,{action:1,delay:250}])},S=async()=>{};return a("div",null,a("div",{class:"setting-item cmdr-mm-item"},a("div",null,a("span",null,"Name"),a("input",{type:"text",placeholder:"Macro Name",value:i,onChange:C=>r(C.currentTarget.value),width:"100%"})),a("div",null,a("span",null,"Icon"),a("button",{onClick:async()=>u(await new D(t).awaitSelection())},a(y,{icon:c})))),s.map((C,_)=>{switch(C.action){case 0:let z=G(C.commandId);return a("div",{class:"setting-item cmdr-mm-item"},a("div",null,a("button",{onClick:async()=>{let k=await new ne(t).awaitSelection();g(s.map((L,pe)=>pe===_?Xt(Fe({},L),{commandId:k.id}):L))}},(z==null?void 0:z.name)||"Cannot find Command")),a("div",null,a("div",{class:"cmdr-mm-action-options"},a(y,{class:"clickable-icon",icon:"arrow-down",onClick:()=>{if(_===s.length-1)return;let k=[...s],L=k[_];k[_]=k[_+1],k[_+1]=L,g(k)}}),a(y,{class:"clickable-icon",icon:"arrow-up",onClick:()=>{if(_===0)return;let k=[...s],L=k[_];k[_]=k[_-1],k[_-1]=L,g(k)}}),a(y,{class:"clickable-icon",icon:"cross",onClick:()=>{g(s.filter((k,L)=>L!==_))}}))));case 1:return a("div",{class:"setting-item cmdr-mm-item"},a("div",null,a(at,{name:"Delay",min:0,max:1e4,step:50,description:"Delay in milliseconds",value:C.delay,changeHandler:k=>C.delay=k})),a("div",null,a("div",{class:"cmdr-mm-action-options"},a(y,{class:"clickable-icon",icon:"arrow-down",onClick:()=>{if(_===s.length-1)return;let k=[...s],L=k[_];k[_]=k[_+1],k[_+1]=L,g(k)}}),a(y,{class:"clickable-icon",icon:"arrow-up",onClick:()=>{if(_===0)return;let k=[...s],L=k[_];k[_]=k[_-1],k[_-1]=L,g(k)}}),a(y,{class:"clickable-icon",icon:"cross",onClick:()=>{g(s.filter((k,L)=>L!==_))}}))));case 2:return a("div",null,"Editor: ",C.action);case 3:return a("div",null,"Loop: ",C.times)}}),a("div",{className:"setting-item cmdr-mm-actions cmdr-justify-between"},a("div",{className:"cmdr-flex cmdr-items-center cmdr-justify-self-start"},a("input",{type:"checkbox",id:"checkbox",checked:l,onChange:({target:C})=>{var _;h((_=C==null?void 0:C.checked)!=null?_:!1)}}),a("label",{htmlFor:"checkbox"},"Auto-Run on Startup")),a("div",null,a("button",{onClick:f},"Add Command"),a("button",{onClick:b},"Add Delay"))),a("div",{className:"cmdr-mm-control"},a("button",{class:s.length===0?"disabled":"mod-cta",disabled:s.length===0,onClick:()=>s.length&&e({macro:s,name:i,icon:c,startup:l})},"Save"),a("button",{onClick:n},"Cancel")))}var Ae=class extends nn.Modal{constructor(e,n,i){super(app);this.macro=n,this.plugin=e,this.onSave=i}onOpen(){this.titleEl.setText("Macro Builder"),X(a(on,{plugin:this.plugin,macro:this.macro,onSave:this.onSave,onCancel:this.close.bind(this)}),this.contentEl)}onClose(){X(null,this.contentEl)}};function Dt({plugin:t,macros:o}){let e=(i,r)=>{let c=l=>{o.splice(r!==void 0?r:o.length,r!==void 0?1:0,l),t.saveSettings(),this.forceUpdate(),xe(t),u.close()},u=new Ae(t,i,c);u.open()},n=i=>{o.splice(i,1),t.saveSettings(),this.forceUpdate(),xe(t)};return a(R,null,a("div",{className:"cmdr-sep-con"},o.map((i,r)=>a("div",{class:"setting-item mod-toggle"},a("div",{className:"setting-item-info"},a("div",{className:"setting-item-name"},i.name),a("div",{className:"setting-item-description"},i.macro.length," Actions")),a("div",{className:"setting-item-control"},a("button",{"aria-label":"Edit Macro",onClick:()=>e(i,r)},a(y,{icon:"lucide-pencil"})),a("button",{"aria-label":"Delete",class:"mod-warning",onClick:async()=>{(!t.settings.confirmDeletion||await new H(t).didChooseRemove())&&n(r)}},a(y,{icon:"trash"})))))),!o.length&&a("div",{class:"cmdr-commands-empty"},a(me,null),a("h3",null,"No Macros yet!"),a("span",null,m("Would you like to add one now?"))),an.Platform.isMobile&&a("hr",null),a("div",{className:"cmdr-add-new-wrapper"},a("button",{class:"mod-cta",onClick:()=>e({name:"",macro:[],icon:"star"})},"Add Macro")))}function Ne({plugin:t,mobileMode:o}){let[e,n]=F(0),[i,r]=F(!0),c=({key:l,shiftKey:h})=>{h&&l==="Tab"?e>0?n((e-1)%u.length):n(u.length-1):l==="Tab"&&n((e+1)%u.length)};W(()=>(addEventListener("keydown",c),()=>removeEventListener("keydown",c)),[e]),Y.Platform.isMobile&&W(()=>{let l=document.querySelector(".modal-setting-back-button"),h=l.cloneNode(!0);l.parentNode.replaceChild(h,l),r(!0)},[]),W(()=>{let l=document.querySelector(".modal-setting-back-button");!l||(i?(l.parentElement.lastChild.textContent="Commander",l.onclick=()=>app.setting.closeActiveTab()):(l.parentElement.lastChild.textContent=u[e].name,l.onclick=()=>r(!0)))},[i]);let u=wt(()=>[{name:m("General"),tab:a(R,null,a(it,{name:m("Always ask before removing?"),description:m("Always show a Popup to confirm deletion of a Command."),value:t.settings.confirmDeletion,changeHandler:async l=>{t.settings.confirmDeletion=!l,await t.saveSettings()}}),a(it,{value:t.settings.showAddCommand,name:m('Show "Add Command" Button'),description:m('Show the "Add Command" Button in every Menu.'),changeHandler:async l=>{t.settings.showAddCommand=!l,t.manager.pageHeader.reorder(),await t.saveSettings()}}),a(it,{value:t.settings.debug,name:m("Enable debugging"),description:m("Enable console output."),changeHandler:async l=>{t.settings.debug=!l,await t.saveSettings()}}),a(at,{value:t.settings.spacing,name:m("Choose custom spacing for Command Buttons"),description:m("Change the spacing between commands. You can set different values on mobile and desktop."),changeHandler:async l=>{Qe(l),t.settings.spacing=l,await t.saveSettings()}}))},{name:m("Left Ribbon"),tab:a(ae,{manager:t.manager.leftRibbon,plugin:t},a(en,{plugin:t}))},{name:m("Page Header"),tab:a(ae,{manager:t.manager.pageHeader,plugin:t},a("hr",null),a("div",{className:"cmdr-sep-con callout","data-callout":"warning"},a("span",{className:"cmdr-callout-warning"},a(y,{icon:"alert-triangle"})," ",m("Warning")),a("p",{className:"cmdr-warning-description"},m("As of Obsidian 0.16.0 you need to explicitly enable the View Header.")),a("button",{onClick:()=>{app.setting.openTabById("appearance"),setTimeout(()=>{var l,h,s;app.setting.activeTab.containerEl.scroll({behavior:"smooth",top:250}),(s=(h=(l=app.setting.activeTab.containerEl.querySelectorAll(".setting-item-heading")[1].nextSibling)==null?void 0:l.nextSibling)==null?void 0:h.nextSibling)==null||s.addClass("cmdr-cta")},50)},className:"mod-cta"},m("Open Appearance Settings"))))},{name:m("Statusbar"),tab:a(ae,{manager:t.manager.statusBar,plugin:t},a(tn,{plugin:t}))},{name:m("Editor Menu"),tab:a(ae,{manager:t.manager.editorMenu,plugin:t})},{name:m("File Menu"),tab:a(ae,{manager:t.manager.fileMenu,plugin:t})},{name:m("Explorer"),tab:a(ae,{manager:t.manager.explorerManager,plugin:t},a("hr",null),a("div",{className:"cmdr-sep-con callout","data-callout":"warning"},a("span",{className:"cmdr-callout-warning"},a(y,{icon:"alert-triangle"})," ",m("Warning")),a("p",{className:"cmdr-warning-description"},"When clicking on a Command in the Explorer, the Explorer view will become focused. This might interfere with Commands that are supposed to be executed on an active File/Explorer.")))},{name:Y.Platform.isMobile?"Mobile Toolbar":"Toolbar",tab:a(Et,{plugin:t})},{name:"Macros",tab:a(Dt,{plugin:t,macros:t.settings.macros})}],[]);return a(R,null,Y.Platform.isDesktop&&a("div",{className:"cmdr-setting-title"},a("h1",null,t.manifest.name)),(Y.Platform.isDesktop||i)&&a(ai,{tabs:u,activeTab:e,setActiveTab:n,setOpen:r}),a("div",{class:`cmdr-setting-content ${o?"cmdr-mobile":""}`},(Y.Platform.isDesktop||!i)&&u[e].tab,(Y.Platform.isMobile&&i||Y.Platform.isDesktop&&e===0)&&a(St,{manifest:t.manifest})))}function ai({tabs:t,activeTab:o,setActiveTab:e,setOpen:n}){let i=ee(null),r=c=>{var u;c.preventDefault(),(u=i.current)==null||u.scrollBy({left:c.deltaY>0?16:-16})};return W(()=>{let c=i.current;if(!(!c||Y.Platform.isMobile))return c.addEventListener("wheel",r),()=>c.removeEventListener("wheel",r)},[]),W(()=>{var c;return(c=document.querySelector(".cmdr-tab-active"))==null?void 0:c.scrollIntoView({behavior:"smooth",block:"nearest"})},[o]),a("nav",{class:`cmdr-setting-header ${Y.Platform.isMobile?"cmdr-mobile":""}`,ref:i},a("div",{class:`cmdr-setting-tab-group ${Y.Platform.isMobile?"vertical-tab-header-group-items":""}`},t.map((c,u)=>a("div",{className:`cmdr-tab ${o===u?"cmdr-tab-active":""} ${Y.Platform.isMobile?"vertical-tab-nav-item":""}`,onClick:()=>{e(u),n(!1)}},c.name,Y.Platform.isMobile&&a(y,{className:"vertical-tab-nav-item-chevron cmdr-block",icon:"chevron-right",size:24})))),Y.Platform.isDesktop&&a("div",{className:"cmdr-fill"}))}var Le=class extends rt.PluginSettingTab{constructor(e){super(app,e);this.plugin=e}display(){X(a(Ne,{plugin:this.plugin,mobileMode:rt.Platform.isMobile}),this.containerEl)}hide(){X(null,this.containerEl)}};var st=require("obsidian");var Be=class extends st.Modal{constructor(e){super(app);this.plugin=e,this.containerEl.addClass("cmdr-setting-modal")}onOpen(){let e=st.Platform.isMobile;X(a(Ne,{plugin:this.plugin,mobileMode:e}),this.contentEl)}onClose(){X(null,this.contentEl)}};var rn=require("obsidian");function Rt(){(0,rn.addIcon)("cmdr-all-devices",'<g style="fill: currentColor;"><path d="M 12.5 16.667969 L 83.332031 16.667969 C 87.9375 16.667969 91.667969 20.398438 91.667969 25 L 91.667969 33.332031 L 75 33.332031 L 75 25 L 20.832031 25 L 20.832031 75 L 58.332031 75 L 58.332031 83.332031 L 12.5 83.332031 C 7.898438 83.332031 4.167969 79.601562 4.167969 75 L 4.167969 25 C 4.167969 20.398438 7.898438 16.667969 12.5 16.667969 M 70.832031 41.667969 L 95.832031 41.667969 C 98.132812 41.667969 100 43.53125 100 45.832031 L 100 87.5 C 100 89.800781 98.132812 91.667969 95.832031 91.667969 L 70.832031 91.667969 C 68.53125 91.667969 66.667969 89.800781 66.667969 87.5 L 66.667969 45.832031 C 66.667969 43.53125 68.53125 41.667969 70.832031 41.667969 M 75 50 L 75 79.167969 L 91.667969 79.167969 L 91.667969 50 Z M 75 50 "/></g>')}var ct=class extends sn.Plugin{async executeStartupMacros(){let e=setTimeout(()=>{this.settings.macros.forEach((n,i)=>{n.startup&&this.executeMacro(i)})},1e3);this.register(()=>clearTimeout(e))}async executeMacro(e){let n=this.settings.macros[e];if(!n)throw new Error("Macro not found");for(let i of n.macro)switch(i.action){case 0:{await app.commands.executeCommandById(i.commandId);continue}case 1:{await new Promise(r=>setTimeout(r,i.delay));continue}case 2:continue;case 3:{for(let r=0;r<i.times;r++)await app.commands.executeCommandById(i.commandId);continue}}}async onload(){await this.loadSettings(),Rt(),this.manager={editorMenu:new Pe(this,this.settings.editorMenu),fileMenu:new Ee(this,this.settings.fileMenu),leftRibbon:new _e("left",this),statusBar:new we(this,this.settings.statusBar),pageHeader:new Ce(this,this.settings.pageHeader),explorerManager:new be(this,this.settings.explorer)},this.addSettingTab(new Le(this)),this.addCommand({name:m("Open Commander Settings"),id:"open-commander-settings",callback:()=>new Be(this).open()}),this.registerEvent(app.workspace.on("editor-menu",this.manager.editorMenu.applyEditorMenuCommands(this))),this.registerEvent(app.workspace.on("file-menu",this.manager.fileMenu.applyFileMenuCommands(this))),app.workspace.onLayoutReady(()=>{Ie(this.settings),xe(this),Qe(this.settings.spacing),oe(this.settings.advancedToolbar),et(this.settings.advancedToolbar),this.executeStartupMacros()})}onunload(){var e;(e=document.head.querySelector("style#cmdr"))==null||e.remove(),Jo()}async loadSettings(){let e=Object.assign({},vo,await this.loadData());this.settings=e}async saveSettings(){await this.saveData(this.settings)}listActiveToolbarCommands(){return this.app.vault.getConfig("mobileToolbarCommands")}getCommands(){let e=[];return this.listActiveToolbarCommands().forEach(n=>{let i=this.app.commands.commands[n];i&&e.push(i)}),e}getCommandsWithoutIcons(e=!0){let n=[];return this.getCommands().forEach(i=>{i&&!i.icon&&n.push(i)}),e&&this.getCommands().forEach(i=>{this.settings.advancedToolbar.mappedIcons.find(r=>r.commandID===i.id)&&n.push(i)}),n}};
|
|
|
|
/* by phibr0 */
|