17 lines
72 KiB
JavaScript
17 lines
72 KiB
JavaScript
/*
|
|
THIS IS A GENERATED/BUNDLED FILE BY ESBUILD
|
|
if you want to view the source, please visit the github repository of this plugin
|
|
*/
|
|
|
|
var Pt=Object.defineProperty;var ar=Object.getOwnPropertyDescriptor;var or=Object.getOwnPropertyNames;var rr=Object.prototype.hasOwnProperty;var lr=(t,e,a)=>e in t?Pt(t,e,{enumerable:!0,configurable:!0,writable:!0,value:a}):t[e]=a;var sr=(t,e)=>{for(var a in e)Pt(t,a,{get:e[a],enumerable:!0})},nr=(t,e,a,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of or(e))!rr.call(t,r)&&r!==a&&Pt(t,r,{get:()=>e[r],enumerable:!(o=ar(e,r))||o.enumerable});return t};var ur=t=>nr(Pt({},"__esModule",{value:!0}),t);var $=(t,e,a)=>(lr(t,typeof e!="symbol"?e+"":e,a),a);var Cl={};sr(Cl,{default:()=>da});module.exports=ur(Cl);var tr=require("obsidian");var dr=require("obsidian");var Ya="obsidian-vertical-tabs-view";var Bt=t=>{console.log(`[${Ya}]: ${t}`)};var Y=require("obsidian");var Za={left:"left",right:"right"},pa={TARGET:{directory:"directory",title:"title"},CONDITION:{startsWith:"starts with",endsWith:"ends with",includes:"includes",equals:"equals",regexp:"regexp"}},ma={matchConfig:{target:"title",condition:"startsWith",value:""},priority:1,icon:"file"};var Et=require("obsidian"),Ja=(t,e,a,o,r)=>new Et.Setting(t).setName(e).setDesc(a).addText(l=>l.setValue(o).onChange(r)),ze=(t,e,a,o,r)=>new Et.Setting(t).setName(e).setDesc(a).addToggle(l=>l.setValue(o).onChange(r)),Qa=(t,e,a,o,r,l)=>new Et.Setting(t).setName(e).setDesc(a).addDropdown(s=>{s.addOptions(o).setValue(r).onChange(l)});var eo={defaultPosition:"left",showDirectory:!0,showCloseIcon:!0,showPinnedIcon:!0,showPinIconIfNotPinned:!0,showTabIcon:!0,defaultTabIcon:"file",tabIconRules:[]},Ot=class extends Y.PluginSettingTab{constructor(a,o){super(a,o);this.plugin=o,this.settings=structuredClone(o.settings)}save(){this.plugin.saveSettings(this.settings)}display(){let{containerEl:a}=this;if(a.empty(),Qa(a,"Default position","Default position of vertical tabs view opened",Za,this.settings.defaultPosition,o=>{this.settings.defaultPosition=o,this.save()}),ze(a,"Show directory","",this.settings.showDirectory,o=>{this.settings.showDirectory=o,this.save()}),ze(a,"Show close icon","",this.settings.showCloseIcon,o=>{this.settings.showCloseIcon=o,this.save()}),ze(a,"Show pinned icon","",this.settings.showPinnedIcon,o=>{this.settings.showPinnedIcon=o,this.save()}),ze(a,"Show pin icon if not pinned","",this.settings.showPinIconIfNotPinned,o=>{this.settings.showPinIconIfNotPinned=o,this.save()}),ze(a,"Show tab icon","",this.settings.showTabIcon,o=>{this.settings.showTabIcon=o,this.save(),this.display()}),this.settings.showTabIcon){let{previewIconWrapper:o,previewIcon:r,previewIconText:l}=this.createPreviewIcon(this.settings.defaultTabIcon);Ja(a,"Default tab icon","If you clear this field, icon will be hidden by default.",this.settings.defaultTabIcon,i=>{this.settings.defaultTabIcon=i,this.save(),(0,Y.setIcon)(r,i),r.children.length===0?l.innerText="Not found.":l.innerText="Preview: "}).setDesc("See https://lucide.dev/icons for available icons.").controlEl.prepend(o),new Y.Setting(a).setName("Icon rules for override icon");let n=a.createEl("div");n.className="vertical-tabs-view-settings-tab-icon-rules",this.settings.tabIconRules.length===0&&this.settings.tabIconRules.push(structuredClone(ma)),this.settings.tabIconRules.forEach((i,d)=>{this.addTabIconRule(n,i,d)}),new Y.Setting(n).addButton(i=>{i.setButtonText("Add").onClick(async()=>{this.settings.tabIconRules.push(structuredClone(ma)),this.display()})}).setClass("vertical-tabs-view-settings-tab-icon-rules-add-btn")}}createPreviewIcon(a){let o=document.createElement("div");o.className="vertical-tabs-view-settings-tab-preview-icon-wrapper";let r=document.createElement("div");r.className="vertical-tabs-view-settings-tab-preview-icon-text",r.innerText="Preview: ";let l=document.createElement("div");return(0,Y.setIcon)(l,a),l.children.length===0?r.innerText="Icon not found":r.innerText="Preview: ",o.setChildrenInPlace([r,l]),{previewIconWrapper:o,previewIcon:l,previewIconText:r}}addTabIconRule(a,o,r){let l=a.createEl("div");l.className="vertical-tabs-view-settings-tab-icon-rule-wrapper";let s=l.createEl("div");s.className="vertical-tabs-view-settings-tab-icon-rule-match-config-wrapper",new Y.Setting(s).addDropdown(f=>{f.addOptions(pa.TARGET).setValue(o.matchConfig.target).onChange(async x=>{o.matchConfig.target=x,this.save()})}).setName("Match target"),new Y.Setting(s).addDropdown(f=>{f.addOptions(pa.CONDITION).setValue(o.matchConfig.condition).onChange(async x=>{o.matchConfig.condition=x,this.save()})}).setName("Match condition"),new Y.Setting(s).addText(f=>{f.setValue(o.matchConfig.value).onChange(x=>{o.matchConfig.value=x,this.save()})}).setName("Match value").setDesc("For regexp, write like: /foo/i"),new Y.Setting(s).addSlider(f=>{f.setLimits(1,100,1).setValue(o.priority).onChange(x=>{o.priority=x,this.save()}).setDynamicTooltip()}).setName("Priority").setDesc("If there are multiple configs with the same priority, the one defined first will be prioritized.");let{previewIconWrapper:n,previewIcon:u,previewIconText:i}=this.createPreviewIcon(o.icon);new Y.Setting(s).addText(f=>{f.setValue(o.icon).onChange(x=>{o.icon=x,this.save(),(0,Y.setIcon)(u,x),u.children.length===0?i.innerText="Icon not found":i.innerText="Preview: "})}).setName("Icon").setDesc("See https://lucide.dev/icons for available icons.").controlEl.prepend(n);let c=l.createEl("div");c.className="vertical-tabs-view-settings-tab-icon-rule-remove-btn-wrapper";let h=c.createEl("button");h.setText("Remove"),h.onclick=()=>{this.settings.tabIconRules.splice(r,1),this.save(),this.display()}}};var Qo=require("obsidian");var ha=async(t,e)=>{t.workspace.setActiveLeaf(e,{focus:!0})},to=async(t,e)=>{let a=t.workspace.getLeafById(e);if(a)return await ha(t,a),a};function ce(){}function Z(t,e){for(let a in e)t[a]=e[a];return t}function ga(t){return t()}function Mt(){return Object.create(null)}function te(t){t.forEach(ga)}function dt(t){return typeof t=="function"}function pe(t,e){return t!=t?e==e:t!==e||t&&typeof t=="object"||typeof t=="function"}function ao(t){return Object.keys(t).length===0}function Xe(t,e,a,o){if(t){let r=oo(t,e,a,o);return t[0](r)}}function oo(t,e,a,o){return t[1]&&o?Z(a.ctx.slice(),t[1](o(e))):a.ctx}function je(t,e,a,o){if(t[2]&&o){let r=t[2](o(a));if(e.dirty===void 0)return r;if(typeof r=="object"){let l=[],s=Math.max(e.dirty.length,r.length);for(let n=0;n<s;n+=1)l[n]=e.dirty[n]|r[n];return l}return e.dirty|r}return e.dirty}function Ke(t,e,a,o,r,l){if(r){let s=oo(e,a,o,l);t.p(s,r)}}function Ye(t){if(t.ctx.length>32){let e=[],a=t.ctx.length/32;for(let o=0;o<a;o++)e[o]=-1;return e}return-1}function Se(t){let e={};for(let a in t)a[0]!=="$"&&(e[a]=t[a]);return e}function xa(t,e){let a={};e=new Set(e);for(let o in t)!e.has(o)&&o[0]!=="$"&&(a[o]=t[o]);return a}var La=typeof window!="undefined"?window:typeof globalThis!="undefined"?globalThis:global;var Ze=class{constructor(e){$(this,"_listeners","WeakMap"in La?new WeakMap:void 0);$(this,"_observer");$(this,"options");this.options=e}observe(e,a){return this._listeners.set(e,a),this._getObserver().observe(e,this.options),()=>{this._listeners.delete(e),this._observer.unobserve(e)}}_getObserver(){var e;return(e=this._observer)!=null?e:this._observer=new ResizeObserver(a=>{var o;for(let r of a)Ze.entries.set(r.target,r),(o=this._listeners.get(r.target))==null||o(r)})}};Ze.entries="WeakMap"in La?new WeakMap:void 0;var Rt=!1;function ro(){Rt=!0}function lo(){Rt=!1}function pr(t,e,a,o){for(;t<e;){let r=t+(e-t>>1);a(r)<=o?t=r+1:e=r}return t}function mr(t){if(t.hydrate_init)return;t.hydrate_init=!0;let e=t.childNodes;if(t.nodeName==="HEAD"){let u=[];for(let i=0;i<e.length;i++){let d=e[i];d.claim_order!==void 0&&u.push(d)}e=u}let a=new Int32Array(e.length+1),o=new Int32Array(e.length);a[0]=-1;let r=0;for(let u=0;u<e.length;u++){let i=e[u].claim_order,d=(r>0&&e[a[r]].claim_order<=i?r+1:pr(1,r,h=>e[a[h]].claim_order,i))-1;o[u]=a[d]+1;let c=d+1;a[c]=u,r=Math.max(c,r)}let l=[],s=[],n=e.length-1;for(let u=a[r]+1;u!=0;u=o[u-1]){for(l.push(e[u-1]);n>=u;n--)s.push(e[n]);n--}for(;n>=0;n--)s.push(e[n]);l.reverse(),s.sort((u,i)=>u.claim_order-i.claim_order);for(let u=0,i=0;u<s.length;u++){for(;i<l.length&&s[u].claim_order>=l[i].claim_order;)i++;let d=i<l.length?l[i]:null;t.insertBefore(s[u],d)}}function J(t,e){t.appendChild(e)}function so(t,e,a){let o=no(t);if(!o.getElementById(e)){let r=z("style");r.id=e,r.textContent=a,hr(o,r)}}function no(t){if(!t)return document;let e=t.getRootNode?t.getRootNode():t.ownerDocument;return e&&e.host?e:t.ownerDocument}function hr(t,e){return J(t.head||t,e),e.sheet}function Ut(t,e){if(Rt){for(mr(t),(t.actual_end_child===void 0||t.actual_end_child!==null&&t.actual_end_child.parentNode!==t)&&(t.actual_end_child=t.firstChild);t.actual_end_child!==null&&t.actual_end_child.claim_order===void 0;)t.actual_end_child=t.actual_end_child.nextSibling;e!==t.actual_end_child?(e.claim_order!==void 0||e.parentNode!==t)&&t.insertBefore(e,t.actual_end_child):t.actual_end_child=e.nextSibling}else(e.parentNode!==t||e.nextSibling!==null)&&t.appendChild(e)}function ue(t,e,a){t.insertBefore(e,a||null)}function ft(t,e,a){Rt&&!a?Ut(t,e):(e.parentNode!==t||e.nextSibling!=a)&&t.insertBefore(e,a||null)}function R(t){t.parentNode&&t.parentNode.removeChild(t)}function Ht(t,e){for(let a=0;a<t.length;a+=1)t[a]&&t[a].d(e)}function z(t){return document.createElement(t)}function Nt(t){return document.createElementNS("http://www.w3.org/2000/svg",t)}function ct(t){return document.createTextNode(t)}function Je(){return ct(" ")}function pt(){return ct("")}function Ue(t,e,a,o){return t.addEventListener(e,a,o),()=>t.removeEventListener(e,a,o)}function U(t,e,a){a==null?t.removeAttribute(e):t.getAttribute(e)!==a&&t.setAttribute(e,a)}function mt(t,e){for(let a in e)U(t,a,e[a])}function ht(t){return Array.from(t.childNodes)}function gr(t){t.claim_info===void 0&&(t.claim_info={last_index:0,total_claimed:0})}function xr(t,e,a,o,r=!1){gr(t);let l=(()=>{for(let s=t.claim_info.last_index;s<t.length;s++){let n=t[s];if(e(n)){let u=a(n);return u===void 0?t.splice(s,1):t[s]=u,r||(t.claim_info.last_index=s),n}}for(let s=t.claim_info.last_index-1;s>=0;s--){let n=t[s];if(e(n)){let u=a(n);return u===void 0?t.splice(s,1):t[s]=u,r?u===void 0&&t.claim_info.last_index--:t.claim_info.last_index=s,n}}return o()})();return l.claim_order=t.claim_info.total_claimed,t.claim_info.total_claimed+=1,l}function Lr(t,e,a,o){return xr(t,r=>r.nodeName===e,r=>{let l=[];for(let s=0;s<r.attributes.length;s++){let n=r.attributes[s];a[n.name]||l.push(n.name)}l.forEach(s=>r.removeAttribute(s))},()=>o(e))}function Ia(t,e,a){return Lr(t,e,a,Nt)}function Ca(t,e){e=""+e,t.data!==e&&(t.data=e)}function ba(t,e,a){t.classList.toggle(e,!!a)}function uo(t){let e={};return t.childNodes.forEach(a=>{e[a.slot||"default"]=!0}),e}var Fe;function we(t){Fe=t}function fo(){if(!Fe)throw new Error("Function called outside component initialization");return Fe}function Sa(t){fo().$$.on_mount.push(t)}var He=[];var qt=[],et=[],co=[],vr=Promise.resolve(),va=!1;function po(){va||(va=!0,vr.then(Vt))}function gt(t){et.push(t)}var wa=new Set,Qe=0;function Vt(){if(Qe!==0)return;let t=Fe;do{try{for(;Qe<He.length;){let e=He[Qe];Qe++,we(e),_r(e.$$)}}catch(e){throw He.length=0,Qe=0,e}for(we(null),He.length=0,Qe=0;qt.length;)qt.pop()();for(let e=0;e<et.length;e+=1){let a=et[e];wa.has(a)||(wa.add(a),a())}et.length=0}while(He.length);for(;co.length;)co.pop()();va=!1,wa.clear(),we(t)}function _r(t){if(t.fragment!==null){t.update(),te(t.before_update);let e=t.dirty;t.dirty=[-1],t.fragment&&t.fragment.p(t.ctx,e),t.after_update.forEach(gt)}}function mo(t){let e=[],a=[];et.forEach(o=>t.indexOf(o)===-1?e.push(o):a.push(o)),a.forEach(o=>o()),et=e}var $t=new Set,Ne;function xt(){Ne={r:0,c:[],p:Ne}}function Lt(){Ne.r||te(Ne.c),Ne=Ne.p}function A(t,e){t&&t.i&&($t.delete(t),t.i(e))}function H(t,e,a,o){if(t&&t.o){if($t.has(t))return;$t.add(t),Ne.c.push(()=>{$t.delete(t),o&&(a&&t.d(1),o())}),t.o(e)}else o&&o()}function Ae(t){return(t==null?void 0:t.length)!==void 0?t:Array.from(t)}function qe(t,e){let a={},o={},r={$$scope:1},l=t.length;for(;l--;){let s=t[l],n=e[l];if(n){for(let u in s)u in n||(o[u]=1);for(let u in n)r[u]||(a[u]=n[u],r[u]=1);t[l]=n}else for(let u in s)r[u]=1}for(let s in o)s in a||(a[s]=void 0);return a}function Gt(t){return typeof t=="object"&&t!==null?t:{}}var yr=["allowfullscreen","allowpaymentrequest","async","autofocus","autoplay","checked","controls","default","defer","disabled","formnovalidate","hidden","inert","ismap","loop","multiple","muted","nomodule","novalidate","open","playsinline","readonly","required","reversed","selected"],kr=new Set([...yr]);function Pe(t){t&&t.c()}function Wt(t,e){t&&t.l(e)}function ve(t,e,a){let{fragment:o,after_update:r}=t.$$;o&&o.m(e,a),gt(()=>{let l=t.$$.on_mount.map(ga).filter(dt);t.$$.on_destroy?t.$$.on_destroy.push(...l):te(l),t.$$.on_mount=[]}),r.forEach(gt)}function _e(t,e){let a=t.$$;a.fragment!==null&&(mo(a.after_update),te(a.on_destroy),a.fragment&&a.fragment.d(e),a.on_destroy=a.fragment=null,a.ctx=[])}function Tr(t,e){t.$$.dirty[0]===-1&&(He.push(t),po(),t.$$.dirty.fill(0)),t.$$.dirty[e/31|0]|=1<<e%31}function Be(t,e,a,o,r,l,s=null,n=[-1]){let u=Fe;we(t);let i=t.$$={fragment:null,ctx:[],props:l,update:ce,not_equal:r,bound:Mt(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(e.context||(u?u.$$.context:[])),callbacks:Mt(),dirty:n,skip_bound:!1,root:e.target||u.$$.root};s&&s(i.root);let d=!1;if(i.ctx=a?a(t,e.props||{},(c,h,...f)=>{let x=f.length?f[0]:h;return i.ctx&&r(i.ctx[c],i.ctx[c]=x)&&(!i.skip_bound&&i.bound[c]&&i.bound[c](x),d&&Tr(t,c)),h}):[],i.update(),d=!0,te(i.before_update),i.fragment=o?o(i.ctx):!1,e.target){if(e.hydrate){ro();let c=ht(e.target);i.fragment&&i.fragment.l(c),c.forEach(R)}else i.fragment&&i.fragment.c();e.intro&&A(t.$$.fragment),ve(t,e.target,e.anchor),lo(),Vt()}we(u)}var Fr;typeof HTMLElement=="function"&&(Fr=class extends HTMLElement{constructor(e,a,o){super();$(this,"$$ctor");$(this,"$$s");$(this,"$$c");$(this,"$$cn",!1);$(this,"$$d",{});$(this,"$$r",!1);$(this,"$$p_d",{});$(this,"$$l",{});$(this,"$$l_u",new Map);this.$$ctor=e,this.$$s=a,o&&this.attachShadow({mode:"open"})}addEventListener(e,a,o){if(this.$$l[e]=this.$$l[e]||[],this.$$l[e].push(a),this.$$c){let r=this.$$c.$on(e,a);this.$$l_u.set(a,r)}super.addEventListener(e,a,o)}removeEventListener(e,a,o){if(super.removeEventListener(e,a,o),this.$$c){let r=this.$$l_u.get(a);r&&(r(),this.$$l_u.delete(a))}}async connectedCallback(){if(this.$$cn=!0,!this.$$c){let e=function(l){return()=>{let s;return{c:function(){s=z("slot"),l!=="default"&&U(s,"name",l)},m:function(i,d){ue(i,s,d)},d:function(i){i&&R(s)}}}};if(await Promise.resolve(),!this.$$cn)return;let a={},o=uo(this);for(let l of this.$$s)l in o&&(a[l]=[e(l)]);for(let l of this.attributes){let s=this.$$g_p(l.name);s in this.$$d||(this.$$d[s]=_a(s,l.value,this.$$p_d,"toProp"))}this.$$c=new this.$$ctor({target:this.shadowRoot||this,props:{...this.$$d,$$slots:a,$$scope:{ctx:[]}}});let r=()=>{this.$$r=!0;for(let l in this.$$p_d)if(this.$$d[l]=this.$$c.$$.ctx[this.$$c.$$.props[l]],this.$$p_d[l].reflect){let s=_a(l,this.$$d[l],this.$$p_d,"toAttribute");s==null?this.removeAttribute(this.$$p_d[l].attribute||l):this.setAttribute(this.$$p_d[l].attribute||l,s)}this.$$r=!1};this.$$c.$$.after_update.push(r),r();for(let l in this.$$l)for(let s of this.$$l[l]){let n=this.$$c.$on(l,s);this.$$l_u.set(s,n)}this.$$l={}}}attributeChangedCallback(e,a,o){var r;this.$$r||(e=this.$$g_p(e),this.$$d[e]=_a(e,o,this.$$p_d,"toProp"),(r=this.$$c)==null||r.$set({[e]:this.$$d[e]}))}disconnectedCallback(){this.$$cn=!1,Promise.resolve().then(()=>{this.$$cn||(this.$$c.$destroy(),this.$$c=void 0)})}$$g_p(e){return Object.keys(this.$$p_d).find(a=>this.$$p_d[a].attribute===e||!this.$$p_d[a].attribute&&a.toLowerCase()===e)||e}});function _a(t,e,a,o){var l;let r=(l=a[t])==null?void 0:l.type;if(e=r==="Boolean"&&typeof e!="boolean"?e!=null:e,!o||!a[t])return e;if(o==="toAttribute")switch(r){case"Object":case"Array":return e==null?null:JSON.stringify(e);case"Boolean":return e?"":null;case"Number":return e==null?null:e;default:return e}else switch(r){case"Object":case"Array":return e&&JSON.parse(e);case"Boolean":return e;case"Number":return e!=null?+e:e;default:return e}}var me=class{constructor(){$(this,"$$");$(this,"$$set")}$destroy(){_e(this,1),this.$destroy=ce}$on(e,a){if(!dt(a))return ce;let o=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return o.push(a),()=>{let r=o.indexOf(a);r!==-1&&o.splice(r,1)}}$set(e){this.$$set&&!ao(e)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}};var ho="4";typeof window!="undefined"&&(window.__svelte||(window.__svelte={v:new Set})).v.add(ho);function It(t,e,a,o){function r(l){return l instanceof a?l:new a(function(s){s(l)})}return new(a||(a=Promise))(function(l,s){function n(d){try{i(o.next(d))}catch(c){s(c)}}function u(d){try{i(o.throw(d))}catch(c){s(c)}}function i(d){d.done?l(d.value):r(d.value).then(n,u)}i((o=o.apply(t,e||[])).next())})}var ge=require("obsidian");function go(t,e){var a=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),a.push.apply(a,o)}return a}function be(t){for(var e=1;e<arguments.length;e++){var a=arguments[e]!=null?arguments[e]:{};e%2?go(Object(a),!0).forEach(function(o){Ar(t,o,a[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):go(Object(a)).forEach(function(o){Object.defineProperty(t,o,Object.getOwnPropertyDescriptor(a,o))})}return t}function Yt(t){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Yt=function(e){return typeof e}:Yt=function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Yt(t)}function Ar(t,e,a){return e in t?Object.defineProperty(t,e,{value:a,enumerable:!0,configurable:!0,writable:!0}):t[e]=a,t}function ke(){return ke=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var a=arguments[e];for(var o in a)Object.prototype.hasOwnProperty.call(a,o)&&(t[o]=a[o])}return t},ke.apply(this,arguments)}function Pr(t,e){if(t==null)return{};var a={},o=Object.keys(t),r,l;for(l=0;l<o.length;l++)r=o[l],!(e.indexOf(r)>=0)&&(a[r]=t[r]);return a}function Br(t,e){if(t==null)return{};var a=Pr(t,e),o,r;if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(t);for(r=0;r<l.length;r++)o=l[r],!(e.indexOf(o)>=0)&&Object.prototype.propertyIsEnumerable.call(t,o)&&(a[o]=t[o])}return a}var Er="1.15.0";function ye(t){if(typeof window!="undefined"&&window.navigator)return!!navigator.userAgent.match(t)}var De=ye(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),Dt=ye(/Edge/i),xo=ye(/firefox/i),wt=ye(/safari/i)&&!ye(/chrome/i)&&!ye(/android/i),_o=ye(/iP(ad|od|hone)/i),yo=ye(/chrome/i)&&ye(/android/i),ko={capture:!1,passive:!1};function k(t,e,a){t.addEventListener(e,a,!De&&ko)}function _(t,e,a){t.removeEventListener(e,a,!De&&ko)}function ta(t,e){if(e){if(e[0]===">"&&(e=e.substring(1)),t)try{if(t.matches)return t.matches(e);if(t.msMatchesSelector)return t.msMatchesSelector(e);if(t.webkitMatchesSelector)return t.webkitMatchesSelector(e)}catch(a){return!1}return!1}}function Or(t){return t.host&&t!==document&&t.host.nodeType?t.host:t.parentNode}function Ie(t,e,a,o){if(t){a=a||document;do{if(e!=null&&(e[0]===">"?t.parentNode===a&&ta(t,e):ta(t,e))||o&&t===a)return t;if(t===a)break}while(t=Or(t))}return null}var Lo=/\s+/g;function ae(t,e,a){if(t&&e)if(t.classList)t.classList[a?"add":"remove"](e);else{var o=(" "+t.className+" ").replace(Lo," ").replace(" "+e+" "," ");t.className=(o+(a?" "+e:"")).replace(Lo," ")}}function b(t,e,a){var o=t&&t.style;if(o){if(a===void 0)return document.defaultView&&document.defaultView.getComputedStyle?a=document.defaultView.getComputedStyle(t,""):t.currentStyle&&(a=t.currentStyle),e===void 0?a:a[e];!(e in o)&&e.indexOf("webkit")===-1&&(e="-webkit-"+e),o[e]=a+(typeof a=="string"?"":"px")}}function lt(t,e){var a="";if(typeof t=="string")a=t;else do{var o=b(t,"transform");o&&o!=="none"&&(a=o+" "+a)}while(!e&&(t=t.parentNode));var r=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return r&&new r(a)}function Do(t,e,a){if(t){var o=t.getElementsByTagName(e),r=0,l=o.length;if(a)for(;r<l;r++)a(o[r],r);return o}return[]}function Ce(){var t=document.scrollingElement;return t||document.documentElement}function q(t,e,a,o,r){if(!(!t.getBoundingClientRect&&t!==window)){var l,s,n,u,i,d,c;if(t!==window&&t.parentNode&&t!==Ce()?(l=t.getBoundingClientRect(),s=l.top,n=l.left,u=l.bottom,i=l.right,d=l.height,c=l.width):(s=0,n=0,u=window.innerHeight,i=window.innerWidth,d=window.innerHeight,c=window.innerWidth),(e||a)&&t!==window&&(r=r||t.parentNode,!De))do if(r&&r.getBoundingClientRect&&(b(r,"transform")!=="none"||a&&b(r,"position")!=="static")){var h=r.getBoundingClientRect();s-=h.top+parseInt(b(r,"border-top-width")),n-=h.left+parseInt(b(r,"border-left-width")),u=s+l.height,i=n+l.width;break}while(r=r.parentNode);if(o&&t!==window){var f=lt(r||t),x=f&&f.a,C=f&&f.d;f&&(s/=C,n/=x,c/=x,d/=C,u=s+d,i=n+c)}return{top:s,left:n,bottom:u,right:i,width:c,height:d}}}function Io(t,e,a){for(var o=Me(t,!0),r=q(t)[e];o;){var l=q(o)[a],s=void 0;if(a==="top"||a==="left"?s=r>=l:s=r<=l,!s)return o;if(o===Ce())break;o=Me(o,!1)}return!1}function st(t,e,a,o){for(var r=0,l=0,s=t.children;l<s.length;){if(s[l].style.display!=="none"&&s[l]!==S.ghost&&(o||s[l]!==S.dragged)&&Ie(s[l],a.draggable,t,!1)){if(r===e)return s[l];r++}l++}return null}function Ha(t,e){for(var a=t.lastElementChild;a&&(a===S.ghost||b(a,"display")==="none"||e&&!ta(a,e));)a=a.previousElementSibling;return a||null}function ie(t,e){var a=0;if(!t||!t.parentNode)return-1;for(;t=t.previousElementSibling;)t.nodeName.toUpperCase()!=="TEMPLATE"&&t!==S.clone&&(!e||ta(t,e))&&a++;return a}function Co(t){var e=0,a=0,o=Ce();if(t)do{var r=lt(t),l=r.a,s=r.d;e+=t.scrollLeft*l,a+=t.scrollTop*s}while(t!==o&&(t=t.parentNode));return[e,a]}function Mr(t,e){for(var a in t)if(t.hasOwnProperty(a)){for(var o in e)if(e.hasOwnProperty(o)&&e[o]===t[a][o])return Number(a)}return-1}function Me(t,e){if(!t||!t.getBoundingClientRect)return Ce();var a=t,o=!1;do if(a.clientWidth<a.scrollWidth||a.clientHeight<a.scrollHeight){var r=b(a);if(a.clientWidth<a.scrollWidth&&(r.overflowX=="auto"||r.overflowX=="scroll")||a.clientHeight<a.scrollHeight&&(r.overflowY=="auto"||r.overflowY=="scroll")){if(!a.getBoundingClientRect||a===document.body)return Ce();if(o||e)return a;o=!0}}while(a=a.parentNode);return Ce()}function Rr(t,e){if(t&&e)for(var a in e)e.hasOwnProperty(a)&&(t[a]=e[a]);return t}function ya(t,e){return Math.round(t.top)===Math.round(e.top)&&Math.round(t.left)===Math.round(e.left)&&Math.round(t.height)===Math.round(e.height)&&Math.round(t.width)===Math.round(e.width)}var vt;function To(t,e){return function(){if(!vt){var a=arguments,o=this;a.length===1?t.call(o,a[0]):t.apply(o,a),vt=setTimeout(function(){vt=void 0},e)}}}function Ur(){clearTimeout(vt),vt=void 0}function Fo(t,e,a){t.scrollLeft+=e,t.scrollTop+=a}function Ao(t){var e=window.Polymer,a=window.jQuery||window.Zepto;return e&&e.dom?e.dom(t).cloneNode(!0):a?a(t).clone(!0)[0]:t.cloneNode(!0)}var re="Sortable"+new Date().getTime();function Hr(){var t=[],e;return{captureAnimationState:function(){if(t=[],!!this.options.animation){var o=[].slice.call(this.el.children);o.forEach(function(r){if(!(b(r,"display")==="none"||r===S.ghost)){t.push({target:r,rect:q(r)});var l=be({},t[t.length-1].rect);if(r.thisAnimationDuration){var s=lt(r,!0);s&&(l.top-=s.f,l.left-=s.e)}r.fromRect=l}})}},addAnimationState:function(o){t.push(o)},removeAnimationState:function(o){t.splice(Mr(t,{target:o}),1)},animateAll:function(o){var r=this;if(!this.options.animation){clearTimeout(e),typeof o=="function"&&o();return}var l=!1,s=0;t.forEach(function(n){var u=0,i=n.target,d=i.fromRect,c=q(i),h=i.prevFromRect,f=i.prevToRect,x=n.rect,C=lt(i,!0);C&&(c.top-=C.f,c.left-=C.e),i.toRect=c,i.thisAnimationDuration&&ya(h,c)&&!ya(d,c)&&(x.top-c.top)/(x.left-c.left)===(d.top-c.top)/(d.left-c.left)&&(u=qr(x,h,f,r.options)),ya(c,d)||(i.prevFromRect=d,i.prevToRect=c,u||(u=r.options.animation),r.animate(i,x,c,u)),u&&(l=!0,s=Math.max(s,u),clearTimeout(i.animationResetTimer),i.animationResetTimer=setTimeout(function(){i.animationTime=0,i.prevFromRect=null,i.fromRect=null,i.prevToRect=null,i.thisAnimationDuration=null},u),i.thisAnimationDuration=u)}),clearTimeout(e),l?e=setTimeout(function(){typeof o=="function"&&o()},s):typeof o=="function"&&o(),t=[]},animate:function(o,r,l,s){if(s){b(o,"transition",""),b(o,"transform","");var n=lt(this.el),u=n&&n.a,i=n&&n.d,d=(r.left-l.left)/(u||1),c=(r.top-l.top)/(i||1);o.animatingX=!!d,o.animatingY=!!c,b(o,"transform","translate3d("+d+"px,"+c+"px,0)"),this.forRepaintDummy=Nr(o),b(o,"transition","transform "+s+"ms"+(this.options.easing?" "+this.options.easing:"")),b(o,"transform","translate3d(0,0,0)"),typeof o.animated=="number"&&clearTimeout(o.animated),o.animated=setTimeout(function(){b(o,"transition",""),b(o,"transform",""),o.animated=!1,o.animatingX=!1,o.animatingY=!1},s)}}}}function Nr(t){return t.offsetWidth}function qr(t,e,a,o){return Math.sqrt(Math.pow(e.top-t.top,2)+Math.pow(e.left-t.left,2))/Math.sqrt(Math.pow(e.top-a.top,2)+Math.pow(e.left-a.left,2))*o.animation}var tt=[],ka={initializeByDefault:!0},Tt={mount:function(e){for(var a in ka)ka.hasOwnProperty(a)&&!(a in e)&&(e[a]=ka[a]);tt.forEach(function(o){if(o.pluginName===e.pluginName)throw"Sortable: Cannot mount plugin ".concat(e.pluginName," more than once")}),tt.push(e)},pluginEvent:function(e,a,o){var r=this;this.eventCanceled=!1,o.cancel=function(){r.eventCanceled=!0};var l=e+"Global";tt.forEach(function(s){a[s.pluginName]&&(a[s.pluginName][l]&&a[s.pluginName][l](be({sortable:a},o)),a.options[s.pluginName]&&a[s.pluginName][e]&&a[s.pluginName][e](be({sortable:a},o)))})},initializePlugins:function(e,a,o,r){tt.forEach(function(n){var u=n.pluginName;if(!(!e.options[u]&&!n.initializeByDefault)){var i=new n(e,a,e.options);i.sortable=e,i.options=e.options,e[u]=i,ke(o,i.defaults)}});for(var l in e.options)if(e.options.hasOwnProperty(l)){var s=this.modifyOption(e,l,e.options[l]);typeof s!="undefined"&&(e.options[l]=s)}},getEventProperties:function(e,a){var o={};return tt.forEach(function(r){typeof r.eventProperties=="function"&&ke(o,r.eventProperties.call(a[r.pluginName],e))}),o},modifyOption:function(e,a,o){var r;return tt.forEach(function(l){e[l.pluginName]&&l.optionListeners&&typeof l.optionListeners[a]=="function"&&(r=l.optionListeners[a].call(e[l.pluginName],o))}),r}};function Vr(t){var e=t.sortable,a=t.rootEl,o=t.name,r=t.targetEl,l=t.cloneEl,s=t.toEl,n=t.fromEl,u=t.oldIndex,i=t.newIndex,d=t.oldDraggableIndex,c=t.newDraggableIndex,h=t.originalEvent,f=t.putSortable,x=t.extraEventProperties;if(e=e||a&&a[re],!!e){var C,y=e.options,V="on"+o.charAt(0).toUpperCase()+o.substr(1);window.CustomEvent&&!De&&!Dt?C=new CustomEvent(o,{bubbles:!0,cancelable:!0}):(C=document.createEvent("Event"),C.initEvent(o,!0,!0)),C.to=s||a,C.from=n||a,C.item=r||a,C.clone=l,C.oldIndex=u,C.newIndex=i,C.oldDraggableIndex=d,C.newDraggableIndex=c,C.originalEvent=h,C.pullMode=f?f.lastPutMode:void 0;var v=be(be({},x),Tt.getEventProperties(o,e));for(var T in v)C[T]=v[T];a&&a.dispatchEvent(C),y[V]&&y[V].call(e,C)}}var $r=["evt"],Q=function(e,a){var o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},r=o.evt,l=Br(o,$r);Tt.pluginEvent.bind(S)(e,a,be({dragEl:m,parentEl:O,ghostEl:w,rootEl:P,nextEl:Ge,lastDownEl:Zt,cloneEl:E,cloneHidden:Oe,dragStarted:Ct,putSortable:W,activeSortable:S.active,originalEvent:r,oldIndex:rt,oldDraggableIndex:_t,newIndex:oe,newDraggableIndex:Ee,hideGhostForTarget:Oo,unhideGhostForTarget:Mo,cloneNowHidden:function(){Oe=!0},cloneNowShown:function(){Oe=!1},dispatchSortableEvent:function(n){j({sortable:a,name:n,originalEvent:r})}},l))};function j(t){Vr(be({putSortable:W,cloneEl:E,targetEl:m,rootEl:P,oldIndex:rt,oldDraggableIndex:_t,newIndex:oe,newDraggableIndex:Ee},t))}var m,O,w,P,Ge,Zt,E,Oe,rt,oe,_t,Ee,zt,W,ot=!1,aa=!1,oa=[],Ve,he,Da,Ta,bo,So,Ct,at,yt,kt=!1,Xt=!1,Jt,X,Fa=[],Oa=!1,ra=[],sa=typeof document!="undefined",jt=_o,wo=Dt||De?"cssFloat":"float",Gr=sa&&!yo&&!_o&&"draggable"in document.createElement("div"),Po=function(){if(sa){if(De)return!1;var t=document.createElement("x");return t.style.cssText="pointer-events:auto",t.style.pointerEvents==="auto"}}(),Bo=function(e,a){var o=b(e),r=parseInt(o.width)-parseInt(o.paddingLeft)-parseInt(o.paddingRight)-parseInt(o.borderLeftWidth)-parseInt(o.borderRightWidth),l=st(e,0,a),s=st(e,1,a),n=l&&b(l),u=s&&b(s),i=n&&parseInt(n.marginLeft)+parseInt(n.marginRight)+q(l).width,d=u&&parseInt(u.marginLeft)+parseInt(u.marginRight)+q(s).width;if(o.display==="flex")return o.flexDirection==="column"||o.flexDirection==="column-reverse"?"vertical":"horizontal";if(o.display==="grid")return o.gridTemplateColumns.split(" ").length<=1?"vertical":"horizontal";if(l&&n.float&&n.float!=="none"){var c=n.float==="left"?"left":"right";return s&&(u.clear==="both"||u.clear===c)?"vertical":"horizontal"}return l&&(n.display==="block"||n.display==="flex"||n.display==="table"||n.display==="grid"||i>=r&&o[wo]==="none"||s&&o[wo]==="none"&&i+d>r)?"vertical":"horizontal"},Wr=function(e,a,o){var r=o?e.left:e.top,l=o?e.right:e.bottom,s=o?e.width:e.height,n=o?a.left:a.top,u=o?a.right:a.bottom,i=o?a.width:a.height;return r===n||l===u||r+s/2===n+i/2},zr=function(e,a){var o;return oa.some(function(r){var l=r[re].options.emptyInsertThreshold;if(!(!l||Ha(r))){var s=q(r),n=e>=s.left-l&&e<=s.right+l,u=a>=s.top-l&&a<=s.bottom+l;if(n&&u)return o=r}}),o},Eo=function(e){function a(l,s){return function(n,u,i,d){var c=n.options.group.name&&u.options.group.name&&n.options.group.name===u.options.group.name;if(l==null&&(s||c))return!0;if(l==null||l===!1)return!1;if(s&&l==="clone")return l;if(typeof l=="function")return a(l(n,u,i,d),s)(n,u,i,d);var h=(s?n:u).options.group.name;return l===!0||typeof l=="string"&&l===h||l.join&&l.indexOf(h)>-1}}var o={},r=e.group;(!r||Yt(r)!="object")&&(r={name:r}),o.name=r.name,o.checkPull=a(r.pull,!0),o.checkPut=a(r.put),o.revertClone=r.revertClone,e.group=o},Oo=function(){!Po&&w&&b(w,"display","none")},Mo=function(){!Po&&w&&b(w,"display","")};sa&&!yo&&document.addEventListener("click",function(t){if(aa)return t.preventDefault(),t.stopPropagation&&t.stopPropagation(),t.stopImmediatePropagation&&t.stopImmediatePropagation(),aa=!1,!1},!0);var $e=function(e){if(m){e=e.touches?e.touches[0]:e;var a=zr(e.clientX,e.clientY);if(a){var o={};for(var r in e)e.hasOwnProperty(r)&&(o[r]=e[r]);o.target=o.rootEl=a,o.preventDefault=void 0,o.stopPropagation=void 0,a[re]._onDragOver(o)}}},Xr=function(e){m&&m.parentNode[re]._isOutsideThisEl(e.target)};function S(t,e){if(!(t&&t.nodeType&&t.nodeType===1))throw"Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(t));this.el=t,this.options=e=ke({},e),t[re]=this;var a={group:null,sort:!0,disabled:!1,store:null,handle:null,draggable:/^[uo]l$/i.test(t.nodeName)?">li":">*",swapThreshold:1,invertSwap:!1,invertedSwapThreshold:null,removeCloneOnHide:!0,direction:function(){return Bo(t,this.options)},ghostClass:"sortable-ghost",chosenClass:"sortable-chosen",dragClass:"sortable-drag",ignore:"a, img",filter:null,preventOnFilter:!0,animation:0,easing:null,setData:function(s,n){s.setData("Text",n.textContent)},dropBubble:!1,dragoverBubble:!1,dataIdAttr:"data-id",delay:0,delayOnTouchOnly:!1,touchStartThreshold:(Number.parseInt?Number:window).parseInt(window.devicePixelRatio,10)||1,forceFallback:!1,fallbackClass:"sortable-fallback",fallbackOnBody:!1,fallbackTolerance:0,fallbackOffset:{x:0,y:0},supportPointer:S.supportPointer!==!1&&"PointerEvent"in window&&!wt,emptyInsertThreshold:5};Tt.initializePlugins(this,t,a);for(var o in a)!(o in e)&&(e[o]=a[o]);Eo(e);for(var r in this)r.charAt(0)==="_"&&typeof this[r]=="function"&&(this[r]=this[r].bind(this));this.nativeDraggable=e.forceFallback?!1:Gr,this.nativeDraggable&&(this.options.touchStartThreshold=1),e.supportPointer?k(t,"pointerdown",this._onTapStart):(k(t,"mousedown",this._onTapStart),k(t,"touchstart",this._onTapStart)),this.nativeDraggable&&(k(t,"dragover",this),k(t,"dragenter",this)),oa.push(this.el),e.store&&e.store.get&&this.sort(e.store.get(this)||[]),ke(this,Hr())}S.prototype={constructor:S,_isOutsideThisEl:function(e){!this.el.contains(e)&&e!==this.el&&(at=null)},_getDirection:function(e,a){return typeof this.options.direction=="function"?this.options.direction.call(this,e,a,m):this.options.direction},_onTapStart:function(e){if(e.cancelable){var a=this,o=this.el,r=this.options,l=r.preventOnFilter,s=e.type,n=e.touches&&e.touches[0]||e.pointerType&&e.pointerType==="touch"&&e,u=(n||e).target,i=e.target.shadowRoot&&(e.path&&e.path[0]||e.composedPath&&e.composedPath()[0])||u,d=r.filter;if(tl(o),!m&&!(/mousedown|pointerdown/.test(s)&&e.button!==0||r.disabled)&&!i.isContentEditable&&!(!this.nativeDraggable&&wt&&u&&u.tagName.toUpperCase()==="SELECT")&&(u=Ie(u,r.draggable,o,!1),!(u&&u.animated)&&Zt!==u)){if(rt=ie(u),_t=ie(u,r.draggable),typeof d=="function"){if(d.call(this,e,u,this)){j({sortable:a,rootEl:i,name:"filter",targetEl:u,toEl:o,fromEl:o}),Q("filter",a,{evt:e}),l&&e.cancelable&&e.preventDefault();return}}else if(d&&(d=d.split(",").some(function(c){if(c=Ie(i,c.trim(),o,!1),c)return j({sortable:a,rootEl:c,name:"filter",targetEl:u,fromEl:o,toEl:o}),Q("filter",a,{evt:e}),!0}),d)){l&&e.cancelable&&e.preventDefault();return}r.handle&&!Ie(i,r.handle,o,!1)||this._prepareDragStart(e,n,u)}}},_prepareDragStart:function(e,a,o){var r=this,l=r.el,s=r.options,n=l.ownerDocument,u;if(o&&!m&&o.parentNode===l){var i=q(o);if(P=l,m=o,O=m.parentNode,Ge=m.nextSibling,Zt=o,zt=s.group,S.dragged=m,Ve={target:m,clientX:(a||e).clientX,clientY:(a||e).clientY},bo=Ve.clientX-i.left,So=Ve.clientY-i.top,this._lastX=(a||e).clientX,this._lastY=(a||e).clientY,m.style["will-change"]="all",u=function(){if(Q("delayEnded",r,{evt:e}),S.eventCanceled){r._onDrop();return}r._disableDelayedDragEvents(),!xo&&r.nativeDraggable&&(m.draggable=!0),r._triggerDragStart(e,a),j({sortable:r,name:"choose",originalEvent:e}),ae(m,s.chosenClass,!0)},s.ignore.split(",").forEach(function(d){Do(m,d.trim(),Aa)}),k(n,"dragover",$e),k(n,"mousemove",$e),k(n,"touchmove",$e),k(n,"mouseup",r._onDrop),k(n,"touchend",r._onDrop),k(n,"touchcancel",r._onDrop),xo&&this.nativeDraggable&&(this.options.touchStartThreshold=4,m.draggable=!0),Q("delayStart",this,{evt:e}),s.delay&&(!s.delayOnTouchOnly||a)&&(!this.nativeDraggable||!(Dt||De))){if(S.eventCanceled){this._onDrop();return}k(n,"mouseup",r._disableDelayedDrag),k(n,"touchend",r._disableDelayedDrag),k(n,"touchcancel",r._disableDelayedDrag),k(n,"mousemove",r._delayedDragTouchMoveHandler),k(n,"touchmove",r._delayedDragTouchMoveHandler),s.supportPointer&&k(n,"pointermove",r._delayedDragTouchMoveHandler),r._dragStartTimer=setTimeout(u,s.delay)}else u()}},_delayedDragTouchMoveHandler:function(e){var a=e.touches?e.touches[0]:e;Math.max(Math.abs(a.clientX-this._lastX),Math.abs(a.clientY-this._lastY))>=Math.floor(this.options.touchStartThreshold/(this.nativeDraggable&&window.devicePixelRatio||1))&&this._disableDelayedDrag()},_disableDelayedDrag:function(){m&&Aa(m),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()},_disableDelayedDragEvents:function(){var e=this.el.ownerDocument;_(e,"mouseup",this._disableDelayedDrag),_(e,"touchend",this._disableDelayedDrag),_(e,"touchcancel",this._disableDelayedDrag),_(e,"mousemove",this._delayedDragTouchMoveHandler),_(e,"touchmove",this._delayedDragTouchMoveHandler),_(e,"pointermove",this._delayedDragTouchMoveHandler)},_triggerDragStart:function(e,a){a=a||e.pointerType=="touch"&&e,!this.nativeDraggable||a?this.options.supportPointer?k(document,"pointermove",this._onTouchMove):a?k(document,"touchmove",this._onTouchMove):k(document,"mousemove",this._onTouchMove):(k(m,"dragend",this),k(P,"dragstart",this._onDragStart));try{document.selection?Qt(function(){document.selection.empty()}):window.getSelection().removeAllRanges()}catch(o){}},_dragStarted:function(e,a){if(ot=!1,P&&m){Q("dragStarted",this,{evt:a}),this.nativeDraggable&&k(document,"dragover",Xr);var o=this.options;!e&&ae(m,o.dragClass,!1),ae(m,o.ghostClass,!0),S.active=this,e&&this._appendGhost(),j({sortable:this,name:"start",originalEvent:a})}else this._nulling()},_emulateDragOver:function(){if(he){this._lastX=he.clientX,this._lastY=he.clientY,Oo();for(var e=document.elementFromPoint(he.clientX,he.clientY),a=e;e&&e.shadowRoot&&(e=e.shadowRoot.elementFromPoint(he.clientX,he.clientY),e!==a);)a=e;if(m.parentNode[re]._isOutsideThisEl(e),a)do{if(a[re]){var o=void 0;if(o=a[re]._onDragOver({clientX:he.clientX,clientY:he.clientY,target:e,rootEl:a}),o&&!this.options.dragoverBubble)break}e=a}while(a=a.parentNode);Mo()}},_onTouchMove:function(e){if(Ve){var a=this.options,o=a.fallbackTolerance,r=a.fallbackOffset,l=e.touches?e.touches[0]:e,s=w&<(w,!0),n=w&&s&&s.a,u=w&&s&&s.d,i=jt&&X&&Co(X),d=(l.clientX-Ve.clientX+r.x)/(n||1)+(i?i[0]-Fa[0]:0)/(n||1),c=(l.clientY-Ve.clientY+r.y)/(u||1)+(i?i[1]-Fa[1]:0)/(u||1);if(!S.active&&!ot){if(o&&Math.max(Math.abs(l.clientX-this._lastX),Math.abs(l.clientY-this._lastY))<o)return;this._onDragStart(e,!0)}if(w){s?(s.e+=d-(Da||0),s.f+=c-(Ta||0)):s={a:1,b:0,c:0,d:1,e:d,f:c};var h="matrix(".concat(s.a,",").concat(s.b,",").concat(s.c,",").concat(s.d,",").concat(s.e,",").concat(s.f,")");b(w,"webkitTransform",h),b(w,"mozTransform",h),b(w,"msTransform",h),b(w,"transform",h),Da=d,Ta=c,he=l}e.cancelable&&e.preventDefault()}},_appendGhost:function(){if(!w){var e=this.options.fallbackOnBody?document.body:P,a=q(m,!0,jt,!0,e),o=this.options;if(jt){for(X=e;b(X,"position")==="static"&&b(X,"transform")==="none"&&X!==document;)X=X.parentNode;X!==document.body&&X!==document.documentElement?(X===document&&(X=Ce()),a.top+=X.scrollTop,a.left+=X.scrollLeft):X=Ce(),Fa=Co(X)}w=m.cloneNode(!0),ae(w,o.ghostClass,!1),ae(w,o.fallbackClass,!0),ae(w,o.dragClass,!0),b(w,"transition",""),b(w,"transform",""),b(w,"box-sizing","border-box"),b(w,"margin",0),b(w,"top",a.top),b(w,"left",a.left),b(w,"width",a.width),b(w,"height",a.height),b(w,"opacity","0.8"),b(w,"position",jt?"absolute":"fixed"),b(w,"zIndex","100000"),b(w,"pointerEvents","none"),S.ghost=w,e.appendChild(w),b(w,"transform-origin",bo/parseInt(w.style.width)*100+"% "+So/parseInt(w.style.height)*100+"%")}},_onDragStart:function(e,a){var o=this,r=e.dataTransfer,l=o.options;if(Q("dragStart",this,{evt:e}),S.eventCanceled){this._onDrop();return}Q("setupClone",this),S.eventCanceled||(E=Ao(m),E.removeAttribute("id"),E.draggable=!1,E.style["will-change"]="",this._hideClone(),ae(E,this.options.chosenClass,!1),S.clone=E),o.cloneId=Qt(function(){Q("clone",o),!S.eventCanceled&&(o.options.removeCloneOnHide||P.insertBefore(E,m),o._hideClone(),j({sortable:o,name:"clone"}))}),!a&&ae(m,l.dragClass,!0),a?(aa=!0,o._loopId=setInterval(o._emulateDragOver,50)):(_(document,"mouseup",o._onDrop),_(document,"touchend",o._onDrop),_(document,"touchcancel",o._onDrop),r&&(r.effectAllowed="move",l.setData&&l.setData.call(o,r,m)),k(document,"drop",o),b(m,"transform","translateZ(0)")),ot=!0,o._dragStartId=Qt(o._dragStarted.bind(o,a,e)),k(document,"selectstart",o),Ct=!0,wt&&b(document.body,"user-select","none")},_onDragOver:function(e){var a=this.el,o=e.target,r,l,s,n=this.options,u=n.group,i=S.active,d=zt===u,c=n.sort,h=W||i,f,x=this,C=!1;if(Oa)return;function y(Re,fa){Q(Re,x,be({evt:e,isOwner:d,axis:f?"vertical":"horizontal",revert:s,dragRect:r,targetRect:l,canSort:c,fromSortable:h,target:o,completed:v,onMove:function(At,p){return Kt(P,a,m,r,At,q(At),e,p)},changed:T},fa))}function V(){y("dragOverAnimationCapture"),x.captureAnimationState(),x!==h&&h.captureAnimationState()}function v(Re){return y("dragOverCompleted",{insertion:Re}),Re&&(d?i._hideClone():i._showClone(x),x!==h&&(ae(m,W?W.options.ghostClass:i.options.ghostClass,!1),ae(m,n.ghostClass,!0)),W!==x&&x!==S.active?W=x:x===S.active&&W&&(W=null),h===x&&(x._ignoreWhileAnimating=o),x.animateAll(function(){y("dragOverAnimationComplete"),x._ignoreWhileAnimating=null}),x!==h&&(h.animateAll(),h._ignoreWhileAnimating=null)),(o===m&&!m.animated||o===a&&!o.animated)&&(at=null),!n.dragoverBubble&&!e.rootEl&&o!==document&&(m.parentNode[re]._isOutsideThisEl(e.target),!Re&&$e(e)),!n.dragoverBubble&&e.stopPropagation&&e.stopPropagation(),C=!0}function T(){oe=ie(m),Ee=ie(m,n.draggable),j({sortable:x,name:"change",toEl:a,newIndex:oe,newDraggableIndex:Ee,originalEvent:e})}if(e.preventDefault!==void 0&&e.cancelable&&e.preventDefault(),o=Ie(o,n.draggable,a,!0),y("dragOver"),S.eventCanceled)return C;if(m.contains(e.target)||o.animated&&o.animatingX&&o.animatingY||x._ignoreWhileAnimating===o)return v(!1);if(aa=!1,i&&!n.disabled&&(d?c||(s=O!==P):W===this||(this.lastPutMode=zt.checkPull(this,i,m,e))&&u.checkPut(this,i,m,e))){if(f=this._getDirection(e,o)==="vertical",r=q(m),y("dragOverValid"),S.eventCanceled)return C;if(s)return O=P,V(),this._hideClone(),y("revert"),S.eventCanceled||(Ge?P.insertBefore(m,Ge):P.appendChild(m)),v(!0);var D=Ha(a,n.draggable);if(!D||Zr(e,f,this)&&!D.animated){if(D===m)return v(!1);if(D&&a===e.target&&(o=D),o&&(l=q(o)),Kt(P,a,m,r,o,l,e,!!o)!==!1)return V(),D&&D.nextSibling?a.insertBefore(m,D.nextSibling):a.appendChild(m),O=a,T(),v(!0)}else if(D&&Yr(e,f,this)){var le=st(a,0,n,!0);if(le===m)return v(!1);if(o=le,l=q(o),Kt(P,a,m,r,o,l,e,!1)!==!1)return V(),a.insertBefore(m,le),O=a,T(),v(!0)}else if(o.parentNode===a){l=q(o);var M=0,K,de=m.parentNode!==a,G=!Wr(m.animated&&m.toRect||r,o.animated&&o.toRect||l,f),F=f?"top":"left",B=Io(o,"top","top")||Io(m,"top","top"),se=B?B.scrollTop:void 0;at!==o&&(K=l[F],kt=!1,Xt=!G&&n.invertSwap||de),M=Jr(e,o,l,f,G?1:n.swapThreshold,n.invertedSwapThreshold==null?n.swapThreshold:n.invertedSwapThreshold,Xt,at===o);var fe;if(M!==0){var xe=ie(m);do xe-=M,fe=O.children[xe];while(fe&&(b(fe,"display")==="none"||fe===w))}if(M===0||fe===o)return v(!1);at=o,yt=M;var Te=o.nextElementSibling,Le=!1;Le=M===1;var We=Kt(P,a,m,r,o,l,e,Le);if(We!==!1)return(We===1||We===-1)&&(Le=We===1),Oa=!0,setTimeout(Kr,30),V(),Le&&!Te?a.appendChild(m):o.parentNode.insertBefore(m,Le?Te:o),B&&Fo(B,0,se-B.scrollTop),O=m.parentNode,K!==void 0&&!Xt&&(Jt=Math.abs(K-q(o)[F])),T(),v(!0)}if(a.contains(m))return v(!1)}return!1},_ignoreWhileAnimating:null,_offMoveEvents:function(){_(document,"mousemove",this._onTouchMove),_(document,"touchmove",this._onTouchMove),_(document,"pointermove",this._onTouchMove),_(document,"dragover",$e),_(document,"mousemove",$e),_(document,"touchmove",$e)},_offUpEvents:function(){var e=this.el.ownerDocument;_(e,"mouseup",this._onDrop),_(e,"touchend",this._onDrop),_(e,"pointerup",this._onDrop),_(e,"touchcancel",this._onDrop),_(document,"selectstart",this)},_onDrop:function(e){var a=this.el,o=this.options;if(oe=ie(m),Ee=ie(m,o.draggable),Q("drop",this,{evt:e}),O=m&&m.parentNode,oe=ie(m),Ee=ie(m,o.draggable),S.eventCanceled){this._nulling();return}ot=!1,Xt=!1,kt=!1,clearInterval(this._loopId),clearTimeout(this._dragStartTimer),Ma(this.cloneId),Ma(this._dragStartId),this.nativeDraggable&&(_(document,"drop",this),_(a,"dragstart",this._onDragStart)),this._offMoveEvents(),this._offUpEvents(),wt&&b(document.body,"user-select",""),b(m,"transform",""),e&&(Ct&&(e.cancelable&&e.preventDefault(),!o.dropBubble&&e.stopPropagation()),w&&w.parentNode&&w.parentNode.removeChild(w),(P===O||W&&W.lastPutMode!=="clone")&&E&&E.parentNode&&E.parentNode.removeChild(E),m&&(this.nativeDraggable&&_(m,"dragend",this),Aa(m),m.style["will-change"]="",Ct&&!ot&&ae(m,W?W.options.ghostClass:this.options.ghostClass,!1),ae(m,this.options.chosenClass,!1),j({sortable:this,name:"unchoose",toEl:O,newIndex:null,newDraggableIndex:null,originalEvent:e}),P!==O?(oe>=0&&(j({rootEl:O,name:"add",toEl:O,fromEl:P,originalEvent:e}),j({sortable:this,name:"remove",toEl:O,originalEvent:e}),j({rootEl:O,name:"sort",toEl:O,fromEl:P,originalEvent:e}),j({sortable:this,name:"sort",toEl:O,originalEvent:e})),W&&W.save()):oe!==rt&&oe>=0&&(j({sortable:this,name:"update",toEl:O,originalEvent:e}),j({sortable:this,name:"sort",toEl:O,originalEvent:e})),S.active&&((oe==null||oe===-1)&&(oe=rt,Ee=_t),j({sortable:this,name:"end",toEl:O,originalEvent:e}),this.save()))),this._nulling()},_nulling:function(){Q("nulling",this),P=m=O=w=Ge=E=Zt=Oe=Ve=he=Ct=oe=Ee=rt=_t=at=yt=W=zt=S.dragged=S.ghost=S.clone=S.active=null,ra.forEach(function(e){e.checked=!0}),ra.length=Da=Ta=0},handleEvent:function(e){switch(e.type){case"drop":case"dragend":this._onDrop(e);break;case"dragenter":case"dragover":m&&(this._onDragOver(e),jr(e));break;case"selectstart":e.preventDefault();break}},toArray:function(){for(var e=[],a,o=this.el.children,r=0,l=o.length,s=this.options;r<l;r++)a=o[r],Ie(a,s.draggable,this.el,!1)&&e.push(a.getAttribute(s.dataIdAttr)||el(a));return e},sort:function(e,a){var o={},r=this.el;this.toArray().forEach(function(l,s){var n=r.children[s];Ie(n,this.options.draggable,r,!1)&&(o[l]=n)},this),a&&this.captureAnimationState(),e.forEach(function(l){o[l]&&(r.removeChild(o[l]),r.appendChild(o[l]))}),a&&this.animateAll()},save:function(){var e=this.options.store;e&&e.set&&e.set(this)},closest:function(e,a){return Ie(e,a||this.options.draggable,this.el,!1)},option:function(e,a){var o=this.options;if(a===void 0)return o[e];var r=Tt.modifyOption(this,e,a);typeof r!="undefined"?o[e]=r:o[e]=a,e==="group"&&Eo(o)},destroy:function(){Q("destroy",this);var e=this.el;e[re]=null,_(e,"mousedown",this._onTapStart),_(e,"touchstart",this._onTapStart),_(e,"pointerdown",this._onTapStart),this.nativeDraggable&&(_(e,"dragover",this),_(e,"dragenter",this)),Array.prototype.forEach.call(e.querySelectorAll("[draggable]"),function(a){a.removeAttribute("draggable")}),this._onDrop(),this._disableDelayedDragEvents(),oa.splice(oa.indexOf(this.el),1),this.el=e=null},_hideClone:function(){if(!Oe){if(Q("hideClone",this),S.eventCanceled)return;b(E,"display","none"),this.options.removeCloneOnHide&&E.parentNode&&E.parentNode.removeChild(E),Oe=!0}},_showClone:function(e){if(e.lastPutMode!=="clone"){this._hideClone();return}if(Oe){if(Q("showClone",this),S.eventCanceled)return;m.parentNode==P&&!this.options.group.revertClone?P.insertBefore(E,m):Ge?P.insertBefore(E,Ge):P.appendChild(E),this.options.group.revertClone&&this.animate(m,E),b(E,"display",""),Oe=!1}}};function jr(t){t.dataTransfer&&(t.dataTransfer.dropEffect="move"),t.cancelable&&t.preventDefault()}function Kt(t,e,a,o,r,l,s,n){var u,i=t[re],d=i.options.onMove,c;return window.CustomEvent&&!De&&!Dt?u=new CustomEvent("move",{bubbles:!0,cancelable:!0}):(u=document.createEvent("Event"),u.initEvent("move",!0,!0)),u.to=e,u.from=t,u.dragged=a,u.draggedRect=o,u.related=r||e,u.relatedRect=l||q(e),u.willInsertAfter=n,u.originalEvent=s,t.dispatchEvent(u),d&&(c=d.call(i,u,s)),c}function Aa(t){t.draggable=!1}function Kr(){Oa=!1}function Yr(t,e,a){var o=q(st(a.el,0,a.options,!0)),r=10;return e?t.clientX<o.left-r||t.clientY<o.top&&t.clientX<o.right:t.clientY<o.top-r||t.clientY<o.bottom&&t.clientX<o.left}function Zr(t,e,a){var o=q(Ha(a.el,a.options.draggable)),r=10;return e?t.clientX>o.right+r||t.clientX<=o.right&&t.clientY>o.bottom&&t.clientX>=o.left:t.clientX>o.right&&t.clientY>o.top||t.clientX<=o.right&&t.clientY>o.bottom+r}function Jr(t,e,a,o,r,l,s,n){var u=o?t.clientY:t.clientX,i=o?a.height:a.width,d=o?a.top:a.left,c=o?a.bottom:a.right,h=!1;if(!s){if(n&&Jt<i*r){if(!kt&&(yt===1?u>d+i*l/2:u<c-i*l/2)&&(kt=!0),kt)h=!0;else if(yt===1?u<d+Jt:u>c-Jt)return-yt}else if(u>d+i*(1-r)/2&&u<c-i*(1-r)/2)return Qr(e)}return h=h||s,h&&(u<d+i*l/2||u>c-i*l/2)?u>d+i/2?1:-1:0}function Qr(t){return ie(m)<ie(t)?1:-1}function el(t){for(var e=t.tagName+t.className+t.src+t.href+t.textContent,a=e.length,o=0;a--;)o+=e.charCodeAt(a);return o.toString(36)}function tl(t){ra.length=0;for(var e=t.getElementsByTagName("input"),a=e.length;a--;){var o=e[a];o.checked&&ra.push(o)}}function Qt(t){return setTimeout(t,0)}function Ma(t){return clearTimeout(t)}sa&&k(document,"touchmove",function(t){(S.active||ot)&&t.cancelable&&t.preventDefault()});S.utils={on:k,off:_,css:b,find:Do,is:function(e,a){return!!Ie(e,a,e,!1)},extend:Rr,throttle:To,closest:Ie,toggleClass:ae,clone:Ao,index:ie,nextTick:Qt,cancelNextTick:Ma,detectDirection:Bo,getChild:st};S.get=function(t){return t[re]};S.mount=function(){for(var t=arguments.length,e=new Array(t),a=0;a<t;a++)e[a]=arguments[a];e[0].constructor===Array&&(e=e[0]),e.forEach(function(o){if(!o.prototype||!o.prototype.constructor)throw"Sortable: Mounted plugin must be a constructor function, not ".concat({}.toString.call(o));o.utils&&(S.utils=be(be({},S.utils),o.utils)),Tt.mount(o)})};S.create=function(t,e){return new S(t,e)};S.version=Er;var N=[],bt,Ra,Ua=!1,Pa,Ba,la,St;function al(){function t(){this.defaults={scroll:!0,forceAutoScrollFallback:!1,scrollSensitivity:30,scrollSpeed:10,bubbleScroll:!0};for(var e in this)e.charAt(0)==="_"&&typeof this[e]=="function"&&(this[e]=this[e].bind(this))}return t.prototype={dragStarted:function(a){var o=a.originalEvent;this.sortable.nativeDraggable?k(document,"dragover",this._handleAutoScroll):this.options.supportPointer?k(document,"pointermove",this._handleFallbackAutoScroll):o.touches?k(document,"touchmove",this._handleFallbackAutoScroll):k(document,"mousemove",this._handleFallbackAutoScroll)},dragOverCompleted:function(a){var o=a.originalEvent;!this.options.dragOverBubble&&!o.rootEl&&this._handleAutoScroll(o)},drop:function(){this.sortable.nativeDraggable?_(document,"dragover",this._handleAutoScroll):(_(document,"pointermove",this._handleFallbackAutoScroll),_(document,"touchmove",this._handleFallbackAutoScroll),_(document,"mousemove",this._handleFallbackAutoScroll)),vo(),ea(),Ur()},nulling:function(){la=Ra=bt=Ua=St=Pa=Ba=null,N.length=0},_handleFallbackAutoScroll:function(a){this._handleAutoScroll(a,!0)},_handleAutoScroll:function(a,o){var r=this,l=(a.touches?a.touches[0]:a).clientX,s=(a.touches?a.touches[0]:a).clientY,n=document.elementFromPoint(l,s);if(la=a,o||this.options.forceAutoScrollFallback||Dt||De||wt){Ea(a,this.options,n,o);var u=Me(n,!0);Ua&&(!St||l!==Pa||s!==Ba)&&(St&&vo(),St=setInterval(function(){var i=Me(document.elementFromPoint(l,s),!0);i!==u&&(u=i,ea()),Ea(a,r.options,i,o)},10),Pa=l,Ba=s)}else{if(!this.options.bubbleScroll||Me(n,!0)===Ce()){ea();return}Ea(a,this.options,Me(n,!1),!1)}}},ke(t,{pluginName:"scroll",initializeByDefault:!0})}function ea(){N.forEach(function(t){clearInterval(t.pid)}),N=[]}function vo(){clearInterval(St)}var Ea=To(function(t,e,a,o){if(e.scroll){var r=(t.touches?t.touches[0]:t).clientX,l=(t.touches?t.touches[0]:t).clientY,s=e.scrollSensitivity,n=e.scrollSpeed,u=Ce(),i=!1,d;Ra!==a&&(Ra=a,ea(),bt=e.scroll,d=e.scrollFn,bt===!0&&(bt=Me(a,!0)));var c=0,h=bt;do{var f=h,x=q(f),C=x.top,y=x.bottom,V=x.left,v=x.right,T=x.width,D=x.height,le=void 0,M=void 0,K=f.scrollWidth,de=f.scrollHeight,G=b(f),F=f.scrollLeft,B=f.scrollTop;f===u?(le=T<K&&(G.overflowX==="auto"||G.overflowX==="scroll"||G.overflowX==="visible"),M=D<de&&(G.overflowY==="auto"||G.overflowY==="scroll"||G.overflowY==="visible")):(le=T<K&&(G.overflowX==="auto"||G.overflowX==="scroll"),M=D<de&&(G.overflowY==="auto"||G.overflowY==="scroll"));var se=le&&(Math.abs(v-r)<=s&&F+T<K)-(Math.abs(V-r)<=s&&!!F),fe=M&&(Math.abs(y-l)<=s&&B+D<de)-(Math.abs(C-l)<=s&&!!B);if(!N[c])for(var xe=0;xe<=c;xe++)N[xe]||(N[xe]={});(N[c].vx!=se||N[c].vy!=fe||N[c].el!==f)&&(N[c].el=f,N[c].vx=se,N[c].vy=fe,clearInterval(N[c].pid),(se!=0||fe!=0)&&(i=!0,N[c].pid=setInterval(function(){o&&this.layer===0&&S.active._onTouchMove(la);var Te=N[this.layer].vy?N[this.layer].vy*n:0,Le=N[this.layer].vx?N[this.layer].vx*n:0;typeof d=="function"&&d.call(S.dragged.parentNode[re],Le,Te,t,la,N[this.layer].el)!=="continue"||Fo(N[this.layer].el,Le,Te)}.bind({layer:c}),24))),c++}while(e.bubbleScroll&&h!==u&&(h=Me(h,!1)));Ua=i}},30),Ro=function(e){var a=e.originalEvent,o=e.putSortable,r=e.dragEl,l=e.activeSortable,s=e.dispatchSortableEvent,n=e.hideGhostForTarget,u=e.unhideGhostForTarget;if(a){var i=o||l;n();var d=a.changedTouches&&a.changedTouches.length?a.changedTouches[0]:a,c=document.elementFromPoint(d.clientX,d.clientY);u(),i&&!i.el.contains(c)&&(s("spill"),this.onSpill({dragEl:r,putSortable:o}))}};function Na(){}Na.prototype={startIndex:null,dragStart:function(e){var a=e.oldDraggableIndex;this.startIndex=a},onSpill:function(e){var a=e.dragEl,o=e.putSortable;this.sortable.captureAnimationState(),o&&o.captureAnimationState();var r=st(this.sortable.el,this.startIndex,this.options);r?this.sortable.el.insertBefore(a,r):this.sortable.el.appendChild(a),this.sortable.animateAll(),o&&o.animateAll()},drop:Ro};ke(Na,{pluginName:"revertOnSpill"});function qa(){}qa.prototype={onSpill:function(e){var a=e.dragEl,o=e.putSortable,r=o||this.sortable;r.captureAnimationState(),a.parentNode&&a.parentNode.removeChild(a),r.animateAll()},drop:Ro};ke(qa,{pluginName:"removeOnSpill"});S.mount(new al);S.mount(qa,Na);var Uo=S;var Va={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":2,"stroke-linecap":"round","stroke-linejoin":"round"};function Ho(t,e,a){let o=t.slice();return o[10]=e[a][0],o[11]=e[a][1],o}function $a(t){let e,a=[t[11]],o={};for(let r=0;r<a.length;r+=1)o=Z(o,a[r]);return{c(){e=Nt(t[10]),this.h()},l(r){e=Ia(r,t[10],{}),ht(e).forEach(R),this.h()},h(){mt(e,o)},m(r,l){ft(r,e,l)},p(r,l){mt(e,o=qe(a,[l&32&&r[11]]))},d(r){r&&R(e)}}}function No(t){let e=t[10],a,o=t[10]&&$a(t);return{c(){o&&o.c(),a=pt()},l(r){o&&o.l(r),a=pt()},m(r,l){o&&o.m(r,l),ft(r,a,l)},p(r,l){r[10]?e?pe(e,r[10])?(o.d(1),o=$a(r),e=r[10],o.c(),o.m(a.parentNode,a)):o.p(r,l):(o=$a(r),e=r[10],o.c(),o.m(a.parentNode,a)):e&&(o.d(1),o=null,e=r[10])},d(r){r&&R(a),o&&o.d(r)}}}function ol(t){var h;let e,a,o,r,l,s=Ae(t[5]),n=[];for(let f=0;f<s.length;f+=1)n[f]=No(Ho(t,s,f));let u=t[9].default,i=Xe(u,t,t[8],null),d=[Va,t[6],{width:t[2]},{height:t[2]},{stroke:t[1]},{"stroke-width":o=t[4]?Number(t[3])*24/Number(t[2]):t[3]},{class:r=`lucide-icon lucide lucide-${t[0]} ${(h=t[7].class)!=null?h:""}`}],c={};for(let f=0;f<d.length;f+=1)c=Z(c,d[f]);return{c(){e=Nt("svg");for(let f=0;f<n.length;f+=1)n[f].c();a=pt(),i&&i.c(),this.h()},l(f){e=Ia(f,"svg",{width:!0,height:!0,stroke:!0,"stroke-width":!0,class:!0});var x=ht(e);for(let C=0;C<n.length;C+=1)n[C].l(x);a=pt(),i&&i.l(x),x.forEach(R),this.h()},h(){mt(e,c)},m(f,x){ft(f,e,x);for(let C=0;C<n.length;C+=1)n[C]&&n[C].m(e,null);Ut(e,a),i&&i.m(e,null),l=!0},p(f,[x]){var C;if(x&32){s=Ae(f[5]);let y;for(y=0;y<s.length;y+=1){let V=Ho(f,s,y);n[y]?n[y].p(V,x):(n[y]=No(V),n[y].c(),n[y].m(e,a))}for(;y<n.length;y+=1)n[y].d(1);n.length=s.length}i&&i.p&&(!l||x&256)&&Ke(i,u,f,f[8],l?je(u,f[8],x,null):Ye(f[8]),null),mt(e,c=qe(d,[Va,x&64&&f[6],(!l||x&4)&&{width:f[2]},(!l||x&4)&&{height:f[2]},(!l||x&2)&&{stroke:f[1]},(!l||x&28&&o!==(o=f[4]?Number(f[3])*24/Number(f[2]):f[3]))&&{"stroke-width":o},(!l||x&129&&r!==(r=`lucide-icon lucide lucide-${f[0]} ${(C=f[7].class)!=null?C:""}`))&&{class:r}]))},i(f){l||(A(i,f),l=!0)},o(f){H(i,f),l=!1},d(f){f&&R(e),Ht(n,f),i&&i.d(f)}}}function rl(t,e,a){let o=["name","color","size","strokeWidth","absoluteStrokeWidth","iconNode"],r=xa(e,o),{$$slots:l={},$$scope:s}=e,{name:n}=e,{color:u="currentColor"}=e,{size:i=24}=e,{strokeWidth:d=2}=e,{absoluteStrokeWidth:c=!1}=e,{iconNode:h}=e;return t.$$set=f=>{a(7,e=Z(Z({},e),Se(f))),a(6,r=xa(e,o)),"name"in f&&a(0,n=f.name),"color"in f&&a(1,u=f.color),"size"in f&&a(2,i=f.size),"strokeWidth"in f&&a(3,d=f.strokeWidth),"absoluteStrokeWidth"in f&&a(4,c=f.absoluteStrokeWidth),"iconNode"in f&&a(5,h=f.iconNode),"$$scope"in f&&a(8,s=f.$$scope)},e=Se(e),[n,u,i,d,c,h,r,e,s,l]}var Ga=class extends me{constructor(e){super(),Be(this,e,rl,ol,pe,{name:0,color:1,size:2,strokeWidth:3,absoluteStrokeWidth:4,iconNode:5})}},na=Ga;function ll(t){let e,a=t[2].default,o=Xe(a,t,t[3],null);return{c(){o&&o.c()},l(r){o&&o.l(r)},m(r,l){o&&o.m(r,l),e=!0},p(r,l){o&&o.p&&(!e||l&8)&&Ke(o,a,r,r[3],e?je(a,r[3],l,null):Ye(r[3]),null)},i(r){e||(A(o,r),e=!0)},o(r){H(o,r),e=!1},d(r){o&&o.d(r)}}}function sl(t){let e,a,o=[{name:"pin"},t[1],{iconNode:t[0]}],r={$$slots:{default:[ll]},$$scope:{ctx:t}};for(let l=0;l<o.length;l+=1)r=Z(r,o[l]);return e=new na({props:r}),{c(){Pe(e.$$.fragment)},l(l){Wt(e.$$.fragment,l)},m(l,s){ve(e,l,s),a=!0},p(l,[s]){let n=s&3?qe(o,[o[0],s&2&&Gt(l[1]),s&1&&{iconNode:l[0]}]):{};s&8&&(n.$$scope={dirty:s,ctx:l}),e.$set(n)},i(l){a||(A(e.$$.fragment,l),a=!0)},o(l){H(e.$$.fragment,l),a=!1},d(l){_e(e,l)}}}function nl(t,e,a){let{$$slots:o={},$$scope:r}=e,l=[["line",{x1:"12",x2:"12",y1:"17",y2:"22"}],["path",{d:"M5 17h14v-1.76a2 2 0 0 0-1.11-1.79l-1.78-.9A2 2 0 0 1 15 10.76V6h1a2 2 0 0 0 0-4H8a2 2 0 0 0 0 4h1v4.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24Z"}]];return t.$$set=s=>{a(1,e=Z(Z({},e),Se(s))),"$$scope"in s&&a(3,r=s.$$scope)},e=Se(e),[l,e,o,r]}var Wa=class extends me{constructor(e){super(),Be(this,e,nl,sl,pe,{})}},nt=Wa;function ul(t){let e,a=t[2].default,o=Xe(a,t,t[3],null);return{c(){o&&o.c()},l(r){o&&o.l(r)},m(r,l){o&&o.m(r,l),e=!0},p(r,l){o&&o.p&&(!e||l&8)&&Ke(o,a,r,r[3],e?je(a,r[3],l,null):Ye(r[3]),null)},i(r){e||(A(o,r),e=!0)},o(r){H(o,r),e=!1},d(r){o&&o.d(r)}}}function il(t){let e,a,o=[{name:"x"},t[1],{iconNode:t[0]}],r={$$slots:{default:[ul]},$$scope:{ctx:t}};for(let l=0;l<o.length;l+=1)r=Z(r,o[l]);return e=new na({props:r}),{c(){Pe(e.$$.fragment)},l(l){Wt(e.$$.fragment,l)},m(l,s){ve(e,l,s),a=!0},p(l,[s]){let n=s&3?qe(o,[o[0],s&2&&Gt(l[1]),s&1&&{iconNode:l[0]}]):{};s&8&&(n.$$scope={dirty:s,ctx:l}),e.$set(n)},i(l){a||(A(e.$$.fragment,l),a=!0)},o(l){H(e.$$.fragment,l),a=!1},d(l){_e(e,l)}}}function dl(t,e,a){let{$$slots:o={},$$scope:r}=e,l=[["path",{d:"M18 6 6 18"}],["path",{d:"m6 6 12 12"}]];return t.$$set=s=>{a(1,e=Z(Z({},e),Se(s))),"$$scope"in s&&a(3,r=s.$$scope)},e=Se(e),[l,e,o,r]}var za=class extends me{constructor(e){super(),Be(this,e,dl,il,pe,{})}},Ft=za;var ut=[];function ua(t,e=ce){let a,o=new Set;function r(n){if(pe(t,n)&&(t=n,a)){let u=!ut.length;for(let i of o)i[1](),ut.push(i,t);if(u){for(let i=0;i<ut.length;i+=2)ut[i][0](ut[i+1]);ut.length=0}}}function l(n){r(n(t))}function s(n,u=ce){let i=[n,u];return o.add(i),o.size===1&&(a=e(r,l)||ce),n(t),()=>{o.delete(i),o.size===0&&a&&(a(),a=null)}}return{set:r,update:l,subscribe:s}}var fl=ua(),cl=ua([]),pl=ua(),ee={plugin:fl,leaves:cl,activeLeafId:pl};var qo=(t,e,a,o)=>{let r=s=>{if(o[s])return o[s];let[n,u,i]=s.split("/"),d=new RegExp(u,i);return o[s]=d,d},l=(s,n)=>{if(s.matchConfig.condition==="startsWith"&&n.startsWith(s.matchConfig.value)||s.matchConfig.condition==="endsWith"&&n.endsWith(s.matchConfig.value)||s.matchConfig.condition==="includes"&&n.includes(s.matchConfig.value)||s.matchConfig.condition==="equals"&&n===s.matchConfig.value||s.matchConfig.condition==="regexp"&&r(s.matchConfig.value).test(n))return!0};return t.find(s=>{if(s.matchConfig.target==="directory")return l(s,e);if(s.matchConfig.target==="title")return l(s,a)})};var Vo=(t,e)=>t.vault.getAbstractFileByPath(e),Xa=async(t,e,a)=>{let o=Vo(t,e);if(o)return await t.vault.trash(o,a)},$o=async(t,e)=>{let a=Vo(t,e);if(a)return await t.vault.delete(a)};function ml(t){so(t,"svelte-fthq2i",":root{--ctx-menu-font-size:0.9rem;--ctx-menu-margin:0.25rem 0;--ctx-menu-padding:0;--ctx-menu-item-padding:0 0.5rem;--ctx-menu-divider-margin:0.2rem 0}")}function Go(t,e,a){let o=t.slice();return o[35]=e[a],o}function Wo(t){let e,a,o,r,l;a=new Ft({props:{size:18,strokeWidth:2}});function s(...n){return t[15](t[35],...n)}return{c(){e=z("div"),Pe(a.$$.fragment),U(e,"class","vertical-tabs-view-list-item-close-btn vertical-tabs-view-list-item-icon")},m(n,u){ue(n,e,u),ve(a,e,null),o=!0,r||(l=Ue(e,"click",s),r=!0)},p(n,u){t=n},i(n){o||(A(a.$$.fragment,n),o=!0)},o(n){H(a.$$.fragment,n),o=!1},d(n){n&&R(e),_e(a),r=!1,l()}}}function zo(t){let e;return{c(){e=z("div"),U(e,"class","vertical-tabs-view-list-item-tab-icon vertical-tabs-view-list-item-icon")},m(a,o){ue(a,e,o)},d(a){a&&R(e)}}}function Xo(t){let e,a=t[4](t[35])+"",o;return{c(){e=z("span"),o=ct(a),U(e,"class","vertical-tabs-view-list-item-dirname")},m(r,l){ue(r,e,l),J(e,o)},p(r,l){l[0]&1&&a!==(a=r[4](r[35])+"")&&Ca(o,a)},d(r){r&&R(e)}}}function hl(t){let e,a,o,r,l;a=new nt({props:{size:20}});function s(...n){return t[17](t[35],...n)}return{c(){e=z("div"),Pe(a.$$.fragment),U(e,"class","vertical-tabs-view-list-item-icon vertical-tabs-view-list-item-icon-pinned vertical-tabs-view-list-item-pin-btn vertical-tabs-view-list-item-pin-btn-pin")},m(n,u){ue(n,e,u),ve(a,e,null),o=!0,r||(l=Ue(e,"click",s),r=!0)},p(n,u){t=n},i(n){o||(A(a.$$.fragment,n),o=!0)},o(n){H(a.$$.fragment,n),o=!1},d(n){n&&R(e),_e(a),r=!1,l()}}}function gl(t){let e,a,o,r,l;a=new nt({props:{size:20}});function s(...n){return t[16](t[35],...n)}return{c(){e=z("div"),Pe(a.$$.fragment),U(e,"class","vertical-tabs-view-list-item-icon vertical-tabs-view-list-item-pin-btn vertical-tabs-view-list-item-pin-btn-pin")},m(n,u){ue(n,e,u),ve(a,e,null),o=!0,r||(l=Ue(e,"click",s),r=!0)},p(n,u){t=n},i(n){o||(A(a.$$.fragment,n),o=!0)},o(n){H(a.$$.fragment,n),o=!1},d(n){n&&R(e),_e(a),r=!1,l()}}}function jo(t){let e,a,o,r,l,s,n,u=t[5](t[35])+"",i,d,c,h,f,x,C,y,V,v=t[2].settings.showCloseIcon&&Wo(t),T=t[2].settings.showTabIcon&&zo(t),D=t[2].settings.showDirectory&&Xo(t),le=[gl,hl],M=[];function K(F,B){return F[2].settings.showPinIconIfNotPinned&&!F[35].pinned?0:F[2].settings.showPinnedIcon&&F[35].pinned?1:-1}~(h=K(t,[-1,-1]))&&(f=M[h]=le[h](t));function de(...F){return t[18](t[35],...F)}function G(...F){return t[19](t[35],...F)}return{c(){e=z("li"),a=z("div"),v&&v.c(),o=Je(),T&&T.c(),r=Je(),l=z("div"),D&&D.c(),s=Je(),n=z("span"),i=ct(u),d=Je(),c=z("div"),f&&f.c(),U(n,"class","vertical-tabs-view-list-item-title"),U(l,"class","vertical-tabs-view-list-item-name-container"),U(a,"class","vertical-tabs-view-list-item-left-container"),U(c,"class","vertical-tabs-view-list-item-right-container"),U(e,"data-leaf-id",x=t[35].id),U(e,"class","vertical-tabs-view-list-item"),ba(e,"focused",t[35].id===t[1])},m(F,B){ue(F,e,B),J(e,a),v&&v.m(a,null),J(a,o),T&&T.m(a,null),J(a,r),J(a,l),D&&D.m(l,null),J(l,s),J(l,n),J(n,i),J(e,d),J(e,c),~h&&M[h].m(c,null),C=!0,y||(V=[Ue(e,"mousedown",de),Ue(e,"contextmenu",G)],y=!0)},p(F,B){t=F,t[2].settings.showCloseIcon?v?(v.p(t,B),B[0]&4&&A(v,1)):(v=Wo(t),v.c(),A(v,1),v.m(a,o)):v&&(xt(),H(v,1,1,()=>{v=null}),Lt()),t[2].settings.showTabIcon?T||(T=zo(t),T.c(),T.m(a,r)):T&&(T.d(1),T=null),t[2].settings.showDirectory?D?D.p(t,B):(D=Xo(t),D.c(),D.m(l,s)):D&&(D.d(1),D=null),(!C||B[0]&1)&&u!==(u=t[5](t[35])+"")&&Ca(i,u);let se=h;h=K(t,B),h===se?~h&&M[h].p(t,B):(f&&(xt(),H(M[se],1,1,()=>{M[se]=null}),Lt()),~h?(f=M[h],f?f.p(t,B):(f=M[h]=le[h](t),f.c()),A(f,1),f.m(c,null)):f=null),(!C||B[0]&1&&x!==(x=t[35].id))&&U(e,"data-leaf-id",x),(!C||B[0]&3)&&ba(e,"focused",t[35].id===t[1])},i(F){C||(A(v),A(f),C=!0)},o(F){H(v),H(f),C=!1},d(F){F&&R(e),v&&v.d(),T&&T.d(),D&&D.d(),~h&&M[h].d(),y=!1,te(V)}}}function Ko(t){let e;return{c(){e=z("div"),U(e,"class","vertical-tabs-view-list-mobile-margin-block")},m(a,o){ue(a,e,o)},d(a){a&&R(e)}}}function xl(t){let e,a,o,r=Ae(t[0]),l=[];for(let u=0;u<r.length;u+=1)l[u]=jo(Go(t,r,u));let s=u=>H(l[u],1,1,()=>{l[u]=null}),n=t[0].length>0&&ge.Platform.isMobile&&Ko(t);return{c(){e=z("ul");for(let u=0;u<l.length;u+=1)l[u].c();a=Je(),n&&n.c(),U(e,"id","vertical-tabs-view-list"),U(e,"class","vertical-tabs-view-list")},m(u,i){ue(u,e,i);for(let d=0;d<l.length;d+=1)l[d]&&l[d].m(e,null);J(e,a),n&&n.m(e,null),t[20](e),o=!0},p(u,i){if(i[0]&2039){r=Ae(u[0]);let d;for(d=0;d<r.length;d+=1){let c=Go(u,r,d);l[d]?(l[d].p(c,i),A(l[d],1)):(l[d]=jo(c),l[d].c(),A(l[d],1),l[d].m(e,a))}for(xt(),d=r.length;d<l.length;d+=1)s(d);Lt()}u[0].length>0&&ge.Platform.isMobile?n||(n=Ko(u),n.c(),n.m(e,null)):n&&(n.d(1),n=null)},i(u){if(!o){for(let i=0;i<r.length;i+=1)A(l[i]);o=!0}},o(u){l=l.filter(Boolean);for(let i=0;i<l.length;i+=1)H(l[i]);o=!1},d(u){u&&R(e),Ht(l,u),n&&n.d(),t[20](null)}}}var Yo="vertical-tabs-view";function Ll(t,e,a){let o=Yo+"-list-item-tab-icon",r={LIST_STATE:Yo+"list-state"},l,s,n;ee.plugin.subscribe(p=>{a(2,l=p)}),ee.leaves.subscribe(p=>{a(0,s=p)}),ee.activeLeafId.subscribe(p=>{a(1,n=p)});let{view:u}=e,{state:i={tabIdToIndex:{},sortedTabIds:[]}}=e,d,{viewContentId:c}=e,{updateView:h}=e,f=[],x=()=>l.settings.tabIconRules.sort((p,g)=>g.priority-p.priority),C={},y=p=>{let g=p.view.file;return g?g.parent.path:""},V=p=>{let g=p.view.file,I=p.view.titleContainerEl.querySelectorAll(`.${p.view.titleEl.className}`),L=Array.from(I).find(ne=>{if(!ne.hasAttribute("hidden"))return ne});return(L==null?void 0:L.getText())||g.name},v=(p,g)=>It(void 0,void 0,void 0,function*(){var I,L;p.stopPropagation(),p.button!==2&&(p.target instanceof SVGElement||(yield ha(l.app,g),a(1,n=g.id),l.app.isMobile&&(!((I=l.app.workspace.leftSplit)===null||I===void 0)&&I.collapsed||l.app.workspace.leftSplit.collapse(),!((L=l.app.workspace.rightSplit)===null||L===void 0)&&L.collapsed||l.app.workspace.rightSplit.collapse())))}),T=(p,g)=>{var I;if(g.detach(),g.id===n)if(g.id===s[0].id&&s[1])a(1,n=s[1].id);else if(g.id===((I=s.at(-1))===null||I===void 0?void 0:I.id)&&s.at(-2))a(1,n=s.at(-2).id);else{let L=i.tabIdToIndex[g.id];s[L-1]&&a(1,n=s[L-1].id)}},D=(p,g)=>{s.forEach(I=>{I.id!==g.id&&I.detach()}),a(1,n=g.id)},le=(p,g)=>{let I=i.tabIdToIndex[g.id],L=i.tabIdToIndex[n];0<=L&&L<I&&a(1,n=s[I+1].id),s.slice(0,I).forEach(ne=>{ne.detach()})},M=(p,g)=>{let I=i.tabIdToIndex[g.id],L=i.tabIdToIndex[n];I+1<=L&&L<=s.length-1&&a(1,n=s[I].id),s.slice(I+1,s.length).forEach(ne=>{ne.detach()})},K=(p,g)=>{g.setPinned(!0),h.bind(u)()},de=(p,g)=>{g.setPinned(!1),h.bind(u)()},G=(p,g)=>It(void 0,void 0,void 0,function*(){yield $o(l.app,g.view.file.path),h.bind(u)()}),F=(p,g)=>It(void 0,void 0,void 0,function*(){yield Xa(l.app,g.view.file.path,!0),h.bind(u)()}),B=(p,g)=>It(void 0,void 0,void 0,function*(){yield Xa(l.app,g.view.file.path,!1),h.bind(u)()});function se(){var p;let g=document.querySelector(`li[data-leaf-id="${n}"]`);if(!g)return;let I=g.getBoundingClientRect();if(!I)return;let L=(p=g.parentElement)===null||p===void 0?void 0:p.getBoundingClientRect();L&&(I.top>L.top||I.bottom<L.bottom)&&g.scrollIntoView({behavior:"smooth",block:"nearest"})}let fe=p=>{a(11,i.tabIdToIndex={},i),a(11,i.sortedTabIds=[],i),p.forEach((g,I)=>{a(11,i.tabIdToIndex[g.id]=I,i),i.sortedTabIds.push(g.id)}),localStorage.setItem(r.LIST_STATE,JSON.stringify(i))},xe=()=>{s.forEach(p=>{let g=`li[data-leaf-id="${p.id}"] .${o}`,I=document.querySelector(g);if(!I)return;let L=qo(f,y(p),V(p),C);L?(0,ge.setIcon)(I,L.icon):l.settings.defaultTabIcon?(0,ge.setIcon)(I,l.settings.defaultTabIcon):p.getViewState().type==="markdown"&&(0,ge.setIcon)(I,"")})};Sa(()=>{Uo.create(d,{group:"vertical-tabs-view-list",delay:100,delayOnTouchOnly:!0,touchStartThreshold:3,animation:150,draggable:".vertical-tabs-view-list-item",direction:"vertical",ghostClass:"vertical-tabs-view-list-item-ghost",chosenClass:"vertical-tabs-view-list-item-chosen",forceFallback:!ge.Platform.isDesktop,fallbackOnBody:!ge.Platform.isDesktop,onChange:p=>{let g=document.querySelector(`#${c}`);if(!g)return;let I=g.getBoundingClientRect(),L=p.item.getBoundingClientRect(),ne=L.height*2;L.top<ne?g.scrollBy({top:-ne,behavior:"smooth"}):I.height-L.top<ne&&g.scrollBy({top:ne,behavior:"smooth"})},onEnd:p=>{if(p.oldIndex==null||p.newIndex==null)return;let g=Math.min(p.oldIndex,p.newIndex),I=Math.max(p.oldIndex,p.newIndex);for(let L=g;L<=I;L++){let ca=d.children[L].getAttribute("data-leaf-id");ca&&(a(11,i.tabIdToIndex[ca]=L,i),a(11,i.sortedTabIds[L]=ca,i),localStorage.setItem(r.LIST_STATE,JSON.stringify(i)))}}}),xe(),se()});let Te=p=>{let g=new ge.Menu;return g.addItem(I=>I.setTitle("Close").setIcon("x").onClick(L=>{L.preventDefault(),T(L,p)})),g.addItem(I=>I.setTitle("Close others").setIcon("x").onClick(L=>{L.preventDefault(),D(L,p)})),g.addItem(I=>I.setTitle("Close to the top").setIcon("x").onClick(L=>{L.preventDefault(),le(L,p)})),g.addItem(I=>I.setTitle("Close to the bottom").setIcon("x").onClick(L=>{L.preventDefault(),M(L,p)})),g.addSeparator(),p&&!p.pinned&&g.addItem(I=>I.setTitle("Pin").setIcon("pin").onClick(L=>{L.preventDefault(),K(L,p)})),p&&p.pinned&&g.addItem(I=>I.setTitle("Unpin").setIcon("pin-off").onClick(L=>{L.preventDefault(),de(L,p)})),g.addSeparator(),g.addItem(I=>I.setTitle("Trach local").setIcon("trash").onClick(L=>{L.preventDefault(),B(L,p)})),g.addItem(I=>I.setTitle("Trach system").setIcon("trash").onClick(L=>{L.preventDefault(),F(L,p)})),g.addItem(I=>I.setTitle("Delete file").setIcon("trash-2").onClick(L=>{L.preventDefault(),G(L,p)})),g},Le=(p,g)=>T(g,p),We=(p,g)=>K(g,p),Re=(p,g)=>de(g,p),fa=(p,g)=>v(g,p),Ka=(p,g)=>{Te(p).showAtMouseEvent(g)};function At(p){qt[p?"unshift":"push"](()=>{d=p,a(3,d)})}t.$$set=p=>{"view"in p&&a(12,u=p.view),"state"in p&&a(11,i=p.state),"viewContentId"in p&&a(13,c=p.viewContentId),"updateView"in p&&a(14,h=p.updateView)},t.$$.update=()=>{if(t.$$.dirty[0]&1){e:fe(s),xe()}if(t.$$.dirty[0]&2){e:n&&se()}};e:f=x();return[s,n,l,d,y,V,v,T,K,de,Te,i,u,c,h,Le,We,Re,fa,Ka,At]}var ja=class extends me{constructor(e){super(),Be(this,e,Ll,xl,pe,{view:12,state:11,viewContentId:13,updateView:14},ml,[-1,-1])}},Zo=ja;var er="vertical-tabs-view",Jo=er+"-content",Il={LIST_STATE:er+"list-state"},it="vertical-tabs-view",ia=class extends Qo.ItemView{constructor(a,o){super(o);this.state={tabIdToIndex:{},sortedTabIds:[]};this.plugin=a,this.settings=a.settings;let r=localStorage.getItem(Il.LIST_STATE);if(r)try{this.state=JSON.parse(r)}catch(l){console.error(l)}this.registerEvent(this.app.workspace.on("layout-change",()=>{let l=this.getActiveLeaf();ee.activeLeafId.set(l.id),this.updateView()})),this.registerEvent(this.app.workspace.on("active-leaf-change",l=>{!l||l.getViewState().type===it||ee.activeLeafId.set(l.id)}))}setSettings(a){this.plugin.settings=a,ee.plugin.set(this.plugin),this.updateView()}getViewType(){return it}getIcon(){return"list"}getDisplayText(){return"Vertical Tabs"}async onClose(){this.Tabs.$destroy()}async onOpen(){ee.plugin.set(this.plugin),ee.leaves.set(this.getSortedLeaves()),ee.activeLeafId.set(this.getActiveLeaf().id);let a=this.contentEl;a.id=Jo,this.Tabs=new Zo({target:this.contentEl,props:{view:this,state:this.state,updateView:this.updateView,viewContentId:Jo}})}getActiveLeaf(){return this.app.workspace.getMostRecentLeaf()}async setActiveLeafById(a){await to(this.app,a),ee.activeLeafId.set(a)}updateView(){let a=this.getSortedLeaves();a.forEach(o=>{o.on("pinned-change",()=>{ee.leaves.set(a)})}),ee.leaves.set(a)}getActiveLeafIndex(){let a=this.getActiveLeaf();return a?this.state.tabIdToIndex[a.id]:0}async cycleNextTab(){let a=this.getActiveLeafIndex();if(a==null)return;let o=(a+1)%this.state.sortedTabIds.length;await this.setActiveLeafById(this.state.sortedTabIds[o])}async cyclePreviousTab(){let a=this.getActiveLeafIndex();if(a==null)return;let o=(a-1)%this.state.sortedTabIds.length;o<0&&(o+=this.state.sortedTabIds.length),await this.setActiveLeafById(this.state.sortedTabIds[o])}collectLeafIds(a,o=[]){return a.forEach(r=>{if(r.type==="leaf")o.push(r.id);else if("children"in r&&Array.isArray(r.children))return this.collectLeafIds(r.children,o)}),o}getLeaves(){let a=[],o=this.app.workspace.rootSplit,r=this.collectLeafIds(o.children);return this.app.workspace.iterateRootLeaves(l=>{r.includes(l.id)&&a.push(l)}),a}getSortedLeaves(){return this.getLeaves().slice().sort((a,o)=>{var s,n;let r=(s=this.state.tabIdToIndex[a.id])!=null?s:1/0,l=(n=this.state.tabIdToIndex[o.id])!=null?n:1/0;return r-l})}};var da=class extends tr.Plugin{async onload(){Bt("loading..."),await this.loadSettings(),this.addSettingTab(new Ot(this.app,this)),this.addCommands(),this.app.workspace.onLayoutReady(async()=>{this.registerViewExtension()}),Bt("loaded.")}onunload(){Bt("unloaded.")}async loadSettings(){this.settings=Object.assign({},eo,await this.loadData()),this.settings.tabIconRules.length===0&&"tabIconConfigs"in this.settings&&Array.isArray(this.settings.tabIconConfigs)&&this.settings.tabIconConfigs.length>0&&(this.settings.tabIconRules=structuredClone(this.settings.tabIconConfigs),delete this.settings.tabIconConfigs,this.saveSettings(this.settings))}async saveSettings(a){await this.saveData(a),this.settings=a;let o=this.getView();o&&o.updateView()}addCommands(){this.addCommand({id:"show-tabs-view",name:"Show vertical tabs view",callback:async()=>{this.openViewLeaf()}}),this.addCommand({id:"cycle-previous-tab",name:"Cycle previous tab",callback:async()=>{let a=this.getView();a&&await a.cyclePreviousTab()}}),this.addCommand({id:"cycle-next-tab",name:"Cycle next tab",callback:async()=>{let a=this.getView();a&&await a.cycleNextTab()}})}registerViewExtension(){this.registerView(it,a=>new ia(this,a))}getView(){let a=this.app.workspace.getLeavesOfType(it)[0];if(a)return a.view}async openViewLeaf(){let a=()=>this.settings.defaultPosition==="left"?this.app.workspace.getLeftLeaf(!1):this.settings.defaultPosition==="right"?this.app.workspace.getRightLeaf(!1):this.app.workspace.getLeftLeaf(!1),o=this.getView();if(o)return o.updateView(),this.app.workspace.revealLeaf(o.leaf);let r=a();await r.setViewState({type:it,active:!0}),this.app.workspace.revealLeaf(r)}};
|
|
/*! Bundled license information:
|
|
|
|
sortablejs/modular/sortable.esm.js:
|
|
(**!
|
|
* Sortable 1.15.0
|
|
* @author RubaXa <trash@rubaxa.org>
|
|
* @author owenm <owen23355@gmail.com>
|
|
* @license MIT
|
|
*)
|
|
*/
|