2023-06-29 11:55:02 +08:00

14 lines
78 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 ln=Object.create;var Le=Object.defineProperty;var cn=Object.getOwnPropertyDescriptor;var un=Object.getOwnPropertyNames,rr=Object.getOwnPropertySymbols,hn=Object.getPrototypeOf,nr=Object.prototype.hasOwnProperty,dn=Object.prototype.propertyIsEnumerable;var ir=(n,e,t)=>e in n?Le(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,he=(n,e)=>{for(var t in e||(e={}))nr.call(e,t)&&ir(n,t,e[t]);if(rr)for(var t of rr(e))dn.call(e,t)&&ir(n,t,e[t]);return n};var or=n=>Le(n,"__esModule",{value:!0});var fn=(n,e)=>{or(n);for(var t in e)Le(n,t,{get:e[t],enumerable:!0})},pn=(n,e,t)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of un(e))!nr.call(n,r)&&r!=="default"&&Le(n,r,{get:()=>e[r],enumerable:!(t=cn(e,r))||t.enumerable});return n},Tt=n=>pn(or(Le(n!=null?ln(hn(n)):{},"default",n&&n.__esModule&&"default"in n?{get:()=>n.default,enumerable:!0}:{value:n,enumerable:!0})),n);var ye=(n,e,t)=>new Promise((r,i)=>{var o=l=>{try{a(t.next(l))}catch(c){i(c)}},s=l=>{try{a(t.throw(l))}catch(c){i(c)}},a=l=>l.done?r(l.value):Promise.resolve(l.value).then(o,s);a((t=t.apply(n,e)).next())});fn(exports,{default:()=>er});function de(n){return Array.isArray?Array.isArray(n):lr(n)==="[object Array]"}var gn=1/0;function mn(n){if(typeof n=="string")return n;let e=n+"";return e=="0"&&1/n==-gn?"-0":e}function bn(n){return n==null?"":mn(n)}function fe(n){return typeof n=="string"}function sr(n){return typeof n=="number"}function vn(n){return n===!0||n===!1||yn(n)&&lr(n)=="[object Boolean]"}function ar(n){return typeof n=="object"}function yn(n){return ar(n)&&n!==null}function U(n){return n!=null}function Dt(n){return!n.trim().length}function lr(n){return n==null?n===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(n)}var En="Incorrect 'index' type",Sn=n=>`Invalid value for key ${n}`,wn=n=>`Pattern length exceeds max of ${n}.`,Tn=n=>`Missing ${n} property in key`,Dn=n=>`Property 'weight' in key '${n}' must be a positive integer`,cr=Object.prototype.hasOwnProperty,ur=class{constructor(e){this._keys=[],this._keyMap={};let t=0;e.forEach(r=>{let i=hr(r);t+=i.weight,this._keys.push(i),this._keyMap[i.id]=i,t+=i.weight}),this._keys.forEach(r=>{r.weight/=t})}get(e){return this._keyMap[e]}keys(){return this._keys}toJSON(){return JSON.stringify(this._keys)}};function hr(n){let e=null,t=null,r=null,i=1;if(fe(n)||de(n))r=n,e=dr(n),t=Ct(n);else{if(!cr.call(n,"name"))throw new Error(Tn("name"));let o=n.name;if(r=o,cr.call(n,"weight")&&(i=n.weight,i<=0))throw new Error(Dn(o));e=dr(o),t=Ct(o)}return{path:e,id:t,weight:i,src:r}}function dr(n){return de(n)?n:n.split(".")}function Ct(n){return de(n)?n.join("."):n}function Cn(n,e){let t=[],r=!1,i=(o,s,a)=>{if(!!U(o))if(!s[a])t.push(o);else{let l=s[a],c=o[l];if(!U(c))return;if(a===s.length-1&&(fe(c)||sr(c)||vn(c)))t.push(bn(c));else if(de(c)){r=!0;for(let u=0,h=c.length;u<h;u+=1)i(c[u],s,a+1)}else s.length&&i(c,s,a+1)}};return i(n,fe(e)?e.split("."):e,0),r?t:t[0]}var xn={includeMatches:!1,findAllMatches:!1,minMatchCharLength:1},_n={isCaseSensitive:!1,includeScore:!1,keys:[],shouldSort:!0,sortFn:(n,e)=>n.score===e.score?n.idx<e.idx?-1:1:n.score<e.score?-1:1},In={location:0,threshold:.6,distance:100},Mn={useExtendedSearch:!1,getFn:Cn,ignoreLocation:!1,ignoreFieldNorm:!1,fieldNormWeight:1},y=he(he(he(he({},_n),xn),In),Mn),An=/[^ ]+/g;function On(n=1,e=3){let t=new Map,r=Math.pow(10,e);return{get(i){let o=i.match(An).length;if(t.has(o))return t.get(o);let s=1/Math.pow(o,.5*n),a=parseFloat(Math.round(s*r)/r);return t.set(o,a),a},clear(){t.clear()}}}var tt=class{constructor({getFn:e=y.getFn,fieldNormWeight:t=y.fieldNormWeight}={}){this.norm=On(t,3),this.getFn=e,this.isCreated=!1,this.setIndexRecords()}setSources(e=[]){this.docs=e}setIndexRecords(e=[]){this.records=e}setKeys(e=[]){this.keys=e,this._keysMap={},e.forEach((t,r)=>{this._keysMap[t.id]=r})}create(){this.isCreated||!this.docs.length||(this.isCreated=!0,fe(this.docs[0])?this.docs.forEach((e,t)=>{this._addString(e,t)}):this.docs.forEach((e,t)=>{this._addObject(e,t)}),this.norm.clear())}add(e){let t=this.size();fe(e)?this._addString(e,t):this._addObject(e,t)}removeAt(e){this.records.splice(e,1);for(let t=e,r=this.size();t<r;t+=1)this.records[t].i-=1}getValueForItemAtKeyId(e,t){return e[this._keysMap[t]]}size(){return this.records.length}_addString(e,t){if(!U(e)||Dt(e))return;let r={v:e,i:t,n:this.norm.get(e)};this.records.push(r)}_addObject(e,t){let r={i:t,$:{}};this.keys.forEach((i,o)=>{let s=this.getFn(e,i.path);if(!!U(s)){if(de(s)){let a=[],l=[{nestedArrIndex:-1,value:s}];for(;l.length;){let{nestedArrIndex:c,value:u}=l.pop();if(!!U(u))if(fe(u)&&!Dt(u)){let h={v:u,i:c,n:this.norm.get(u)};a.push(h)}else de(u)&&u.forEach((h,d)=>{l.push({nestedArrIndex:d,value:h})})}r.$[o]=a}else if(!Dt(s)){let a={v:s,n:this.norm.get(s)};r.$[o]=a}}}),this.records.push(r)}toJSON(){return{keys:this.keys,records:this.records}}};function fr(n,e,{getFn:t=y.getFn,fieldNormWeight:r=y.fieldNormWeight}={}){let i=new tt({getFn:t,fieldNormWeight:r});return i.setKeys(n.map(hr)),i.setSources(e),i.create(),i}function Fn(n,{getFn:e=y.getFn,fieldNormWeight:t=y.fieldNormWeight}={}){let{keys:r,records:i}=n,o=new tt({getFn:e,fieldNormWeight:t});return o.setKeys(r),o.setIndexRecords(i),o}function rt(n,{errors:e=0,currentLocation:t=0,expectedLocation:r=0,distance:i=y.distance,ignoreLocation:o=y.ignoreLocation}={}){let s=e/n.length;if(o)return s;let a=Math.abs(r-t);return i?s+a/i:a?1:s}function Nn(n=[],e=y.minMatchCharLength){let t=[],r=-1,i=-1,o=0;for(let s=n.length;o<s;o+=1){let a=n[o];a&&r===-1?r=o:!a&&r!==-1&&(i=o-1,i-r+1>=e&&t.push([r,i]),r=-1)}return n[o-1]&&o-r>=e&&t.push([r,o-1]),t}var Te=32;function kn(n,e,t,{location:r=y.location,distance:i=y.distance,threshold:o=y.threshold,findAllMatches:s=y.findAllMatches,minMatchCharLength:a=y.minMatchCharLength,includeMatches:l=y.includeMatches,ignoreLocation:c=y.ignoreLocation}={}){if(e.length>Te)throw new Error(wn(Te));let u=e.length,h=n.length,d=Math.max(0,Math.min(r,h)),p=o,g=d,b=a>1||l,C=b?Array(h):[],O;for(;(O=n.indexOf(e,g))>-1;){let R=rt(e,{currentLocation:O,expectedLocation:d,distance:i,ignoreLocation:c});if(p=Math.min(R,p),g=O+u,b){let V=0;for(;V<u;)C[O+V]=1,V+=1}}g=-1;let _=[],F=1,D=u+h,J=1<<u-1;for(let R=0;R<u;R+=1){let V=0,N=D;for(;V<N;)rt(e,{errors:R,currentLocation:d+N,expectedLocation:d,distance:i,ignoreLocation:c})<=p?V=N:D=N,N=Math.floor((D-V)/2+V);D=N;let ve=Math.max(1,d-N+1),Z=s?h:Math.min(d+N,h)+u,ee=Array(Z+2);ee[Z+1]=(1<<R)-1;for(let W=Z;W>=ve;W-=1){let ae=W-1,te=t[n.charAt(ae)];if(b&&(C[ae]=+!!te),ee[W]=(ee[W+1]<<1|1)&te,R&&(ee[W]|=(_[W+1]|_[W])<<1|1|_[W+1]),ee[W]&J&&(F=rt(e,{errors:R,currentLocation:ae,expectedLocation:d,distance:i,ignoreLocation:c}),F<=p)){if(p=F,g=ae,g<=d)break;ve=Math.max(1,2*d-g)}}if(rt(e,{errors:R+1,currentLocation:d,expectedLocation:d,distance:i,ignoreLocation:c})>p)break;_=ee}let X={isMatch:g>=0,score:Math.max(.001,F)};if(b){let R=Nn(C,a);R.length?l&&(X.indices=R):X.isMatch=!1}return X}function Pn(n){let e={};for(let t=0,r=n.length;t<r;t+=1){let i=n.charAt(t);e[i]=(e[i]||0)|1<<r-t-1}return e}var xt=class{constructor(e,{location:t=y.location,threshold:r=y.threshold,distance:i=y.distance,includeMatches:o=y.includeMatches,findAllMatches:s=y.findAllMatches,minMatchCharLength:a=y.minMatchCharLength,isCaseSensitive:l=y.isCaseSensitive,ignoreLocation:c=y.ignoreLocation}={}){if(this.options={location:t,threshold:r,distance:i,includeMatches:o,findAllMatches:s,minMatchCharLength:a,isCaseSensitive:l,ignoreLocation:c},this.pattern=l?e:e.toLowerCase(),this.chunks=[],!this.pattern.length)return;let u=(d,p)=>{this.chunks.push({pattern:d,alphabet:Pn(d),startIndex:p})},h=this.pattern.length;if(h>Te){let d=0,p=h%Te,g=h-p;for(;d<g;)u(this.pattern.substr(d,Te),d),d+=Te;if(p){let b=h-Te;u(this.pattern.substr(b),b)}}else u(this.pattern,0)}searchIn(e){let{isCaseSensitive:t,includeMatches:r}=this.options;if(t||(e=e.toLowerCase()),this.pattern===e){let g={isMatch:!0,score:0};return r&&(g.indices=[[0,e.length-1]]),g}let{location:i,distance:o,threshold:s,findAllMatches:a,minMatchCharLength:l,ignoreLocation:c}=this.options,u=[],h=0,d=!1;this.chunks.forEach(({pattern:g,alphabet:b,startIndex:C})=>{let{isMatch:O,score:_,indices:F}=kn(e,g,b,{location:i+C,distance:o,threshold:s,findAllMatches:a,minMatchCharLength:l,includeMatches:r,ignoreLocation:c});O&&(d=!0),h+=_,O&&F&&(u=[...u,...F])});let p={isMatch:d,score:d?h/this.chunks.length:1};return d&&r&&(p.indices=u),p}},pe=class{constructor(e){this.pattern=e}static isMultiMatch(e){return pr(e,this.multiRegex)}static isSingleMatch(e){return pr(e,this.singleRegex)}search(){}};function pr(n,e){let t=n.match(e);return t?t[1]:null}var gr=class extends pe{constructor(e){super(e)}static get type(){return"exact"}static get multiRegex(){return/^="(.*)"$/}static get singleRegex(){return/^=(.*)$/}search(e){let t=e===this.pattern;return{isMatch:t,score:t?0:1,indices:[0,this.pattern.length-1]}}},mr=class extends pe{constructor(e){super(e)}static get type(){return"inverse-exact"}static get multiRegex(){return/^!"(.*)"$/}static get singleRegex(){return/^!(.*)$/}search(e){let r=e.indexOf(this.pattern)===-1;return{isMatch:r,score:r?0:1,indices:[0,e.length-1]}}},br=class extends pe{constructor(e){super(e)}static get type(){return"prefix-exact"}static get multiRegex(){return/^\^"(.*)"$/}static get singleRegex(){return/^\^(.*)$/}search(e){let t=e.startsWith(this.pattern);return{isMatch:t,score:t?0:1,indices:[0,this.pattern.length-1]}}},vr=class extends pe{constructor(e){super(e)}static get type(){return"inverse-prefix-exact"}static get multiRegex(){return/^!\^"(.*)"$/}static get singleRegex(){return/^!\^(.*)$/}search(e){let t=!e.startsWith(this.pattern);return{isMatch:t,score:t?0:1,indices:[0,e.length-1]}}},yr=class extends pe{constructor(e){super(e)}static get type(){return"suffix-exact"}static get multiRegex(){return/^"(.*)"\$$/}static get singleRegex(){return/^(.*)\$$/}search(e){let t=e.endsWith(this.pattern);return{isMatch:t,score:t?0:1,indices:[e.length-this.pattern.length,e.length-1]}}},Er=class extends pe{constructor(e){super(e)}static get type(){return"inverse-suffix-exact"}static get multiRegex(){return/^!"(.*)"\$$/}static get singleRegex(){return/^!(.*)\$$/}search(e){let t=!e.endsWith(this.pattern);return{isMatch:t,score:t?0:1,indices:[0,e.length-1]}}},_t=class extends pe{constructor(e,{location:t=y.location,threshold:r=y.threshold,distance:i=y.distance,includeMatches:o=y.includeMatches,findAllMatches:s=y.findAllMatches,minMatchCharLength:a=y.minMatchCharLength,isCaseSensitive:l=y.isCaseSensitive,ignoreLocation:c=y.ignoreLocation}={}){super(e);this._bitapSearch=new xt(e,{location:t,threshold:r,distance:i,includeMatches:o,findAllMatches:s,minMatchCharLength:a,isCaseSensitive:l,ignoreLocation:c})}static get type(){return"fuzzy"}static get multiRegex(){return/^"(.*)"$/}static get singleRegex(){return/^(.*)$/}search(e){return this._bitapSearch.searchIn(e)}},It=class extends pe{constructor(e){super(e)}static get type(){return"include"}static get multiRegex(){return/^'"(.*)"$/}static get singleRegex(){return/^'(.*)$/}search(e){let t=0,r,i=[],o=this.pattern.length;for(;(r=e.indexOf(this.pattern,t))>-1;)t=r+o,i.push([r,t-1]);let s=!!i.length;return{isMatch:s,score:s?0:1,indices:i}}},Mt=[gr,It,br,vr,Er,yr,mr,_t],Sr=Mt.length,Rn=/ +(?=([^\"]*\"[^\"]*\")*[^\"]*$)/,Ln="|";function Bn(n,e={}){return n.split(Ln).map(t=>{let r=t.trim().split(Rn).filter(o=>o&&!!o.trim()),i=[];for(let o=0,s=r.length;o<s;o+=1){let a=r[o],l=!1,c=-1;for(;!l&&++c<Sr;){let u=Mt[c],h=u.isMultiMatch(a);h&&(i.push(new u(h,e)),l=!0)}if(!l)for(c=-1;++c<Sr;){let u=Mt[c],h=u.isSingleMatch(a);if(h){i.push(new u(h,e));break}}}return i})}var Hn=new Set([_t.type,It.type]),wr=class{constructor(e,{isCaseSensitive:t=y.isCaseSensitive,includeMatches:r=y.includeMatches,minMatchCharLength:i=y.minMatchCharLength,ignoreLocation:o=y.ignoreLocation,findAllMatches:s=y.findAllMatches,location:a=y.location,threshold:l=y.threshold,distance:c=y.distance}={}){this.query=null,this.options={isCaseSensitive:t,includeMatches:r,minMatchCharLength:i,findAllMatches:s,ignoreLocation:o,location:a,threshold:l,distance:c},this.pattern=t?e:e.toLowerCase(),this.query=Bn(this.pattern,this.options)}static condition(e,t){return t.useExtendedSearch}searchIn(e){let t=this.query;if(!t)return{isMatch:!1,score:1};let{includeMatches:r,isCaseSensitive:i}=this.options;e=i?e:e.toLowerCase();let o=0,s=[],a=0;for(let l=0,c=t.length;l<c;l+=1){let u=t[l];s.length=0,o=0;for(let h=0,d=u.length;h<d;h+=1){let p=u[h],{isMatch:g,indices:b,score:C}=p.search(e);if(g){if(o+=1,a+=C,r){let O=p.constructor.type;Hn.has(O)?s=[...s,...b]:s.push(b)}}else{a=0,o=0,s.length=0;break}}if(o){let h={isMatch:!0,score:a/o};return r&&(h.indices=s),h}}return{isMatch:!1,score:1}}},At=[];function Wn(...n){At.push(...n)}function Ot(n,e){for(let t=0,r=At.length;t<r;t+=1){let i=At[t];if(i.condition(n,e))return new i(n,e)}return new xt(n,e)}var nt={AND:"$and",OR:"$or"},Ft={PATH:"$path",PATTERN:"$val"},Nt=n=>!!(n[nt.AND]||n[nt.OR]),jn=n=>!!n[Ft.PATH],$n=n=>!de(n)&&ar(n)&&!Nt(n),Tr=n=>({[nt.AND]:Object.keys(n).map(e=>({[e]:n[e]}))});function Dr(n,e,{auto:t=!0}={}){let r=i=>{let o=Object.keys(i),s=jn(i);if(!s&&o.length>1&&!Nt(i))return r(Tr(i));if($n(i)){let l=s?i[Ft.PATH]:o[0],c=s?i[Ft.PATTERN]:i[l];if(!fe(c))throw new Error(Sn(l));let u={keyId:Ct(l),pattern:c};return t&&(u.searcher=Ot(c,e)),u}let a={children:[],operator:o[0]};return o.forEach(l=>{let c=i[l];de(c)&&c.forEach(u=>{a.children.push(r(u))})}),a};return Nt(n)||(n=Tr(n)),r(n)}function Gn(n,{ignoreFieldNorm:e=y.ignoreFieldNorm}){n.forEach(t=>{let r=1;t.matches.forEach(({key:i,norm:o,score:s})=>{let a=i?i.weight:null;r*=Math.pow(s===0&&a?Number.EPSILON:s,(a||1)*(e?1:o))}),t.score=r})}function Yn(n,e){let t=n.matches;e.matches=[],!!U(t)&&t.forEach(r=>{if(!U(r.indices)||!r.indices.length)return;let{indices:i,value:o}=r,s={indices:i,value:o};r.key&&(s.key=r.key.src),r.idx>-1&&(s.refIndex=r.idx),e.matches.push(s)})}function Xn(n,e){e.score=n.score}function Vn(n,e,{includeMatches:t=y.includeMatches,includeScore:r=y.includeScore}={}){let i=[];return t&&i.push(Yn),r&&i.push(Xn),n.map(o=>{let{idx:s}=o,a={item:e[s],refIndex:s};return i.length&&i.forEach(l=>{l(o,a)}),a})}var le=class{constructor(e,t={},r){this.options=he(he({},y),t),this.options.useExtendedSearch,this._keyStore=new ur(this.options.keys),this.setCollection(e,r)}setCollection(e,t){if(this._docs=e,t&&!(t instanceof tt))throw new Error(En);this._myIndex=t||fr(this.options.keys,this._docs,{getFn:this.options.getFn,fieldNormWeight:this.options.fieldNormWeight})}add(e){!U(e)||(this._docs.push(e),this._myIndex.add(e))}remove(e=()=>!1){let t=[];for(let r=0,i=this._docs.length;r<i;r+=1){let o=this._docs[r];e(o,r)&&(this.removeAt(r),r-=1,i-=1,t.push(o))}return t}removeAt(e){this._docs.splice(e,1),this._myIndex.removeAt(e)}getIndex(){return this._myIndex}search(e,{limit:t=-1}={}){let{includeMatches:r,includeScore:i,shouldSort:o,sortFn:s,ignoreFieldNorm:a}=this.options,l=fe(e)?fe(this._docs[0])?this._searchStringList(e):this._searchObjectList(e):this._searchLogical(e);return Gn(l,{ignoreFieldNorm:a}),o&&l.sort(s),sr(t)&&t>-1&&(l=l.slice(0,t)),Vn(l,this._docs,{includeMatches:r,includeScore:i})}_searchStringList(e){let t=Ot(e,this.options),{records:r}=this._myIndex,i=[];return r.forEach(({v:o,i:s,n:a})=>{if(!U(o))return;let{isMatch:l,score:c,indices:u}=t.searchIn(o);l&&i.push({item:o,idx:s,matches:[{score:c,value:o,norm:a,indices:u}]})}),i}_searchLogical(e){let t=Dr(e,this.options),r=(a,l,c)=>{if(!a.children){let{keyId:h,searcher:d}=a,p=this._findMatches({key:this._keyStore.get(h),value:this._myIndex.getValueForItemAtKeyId(l,h),searcher:d});return p&&p.length?[{idx:c,item:l,matches:p}]:[]}let u=[];for(let h=0,d=a.children.length;h<d;h+=1){let p=a.children[h],g=r(p,l,c);if(g.length)u.push(...g);else if(a.operator===nt.AND)return[]}return u},i=this._myIndex.records,o={},s=[];return i.forEach(({$:a,i:l})=>{if(U(a)){let c=r(t,a,l);c.length&&(o[l]||(o[l]={idx:l,item:a,matches:[]},s.push(o[l])),c.forEach(({matches:u})=>{o[l].matches.push(...u)}))}}),s}_searchObjectList(e){let t=Ot(e,this.options),{keys:r,records:i}=this._myIndex,o=[];return i.forEach(({$:s,i:a})=>{if(!U(s))return;let l=[];r.forEach((c,u)=>{l.push(...this._findMatches({key:c,value:s[u],searcher:t}))}),l.length&&o.push({idx:a,item:s,matches:l})}),o}_findMatches({key:e,value:t,searcher:r}){if(!U(t))return[];let i=[];if(de(t))t.forEach(({v:o,i:s,n:a})=>{if(!U(o))return;let{isMatch:l,score:c,indices:u}=r.searchIn(o);l&&i.push({score:c,key:e,value:o,idx:s,norm:a,indices:u})});else{let{v:o,n:s}=t,{isMatch:a,score:l,indices:c}=r.searchIn(o);a&&i.push({score:l,key:e,value:o,norm:s,indices:c})}return i}};le.version="6.5.3";le.createIndex=fr;le.parseIndex=Fn;le.config=y;le.parseQuery=Dr;Wn(wr);function ge(n,e){let t=Object.keys(e).map(r=>Kn(n,r,e[r]));return t.length===1?t[0]:function(){t.forEach(r=>r())}}function Kn(n,e,t){let r=n[e],i=n.hasOwnProperty(e),o=t(r);return r&&Object.setPrototypeOf(o,r),Object.setPrototypeOf(s,o),n[e]=s,a;function s(...l){return o===r&&n[e]===s&&a(),o.apply(this,l)}function a(){n[e]===s&&(i?n[e]=r:delete n[e]),o!==r&&(o=r,Object.setPrototypeOf(s,r||Function))}}var x=Tt(require("obsidian"));function Cr(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function ce(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Cr(Object(t),!0).forEach(function(r){zn(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Cr(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function it(n){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?it=function(e){return typeof e}:it=function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},it(n)}function zn(n,e,t){return e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function re(){return re=Object.assign||function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r])}return n},re.apply(this,arguments)}function Un(n,e){if(n==null)return{};var t={},r=Object.keys(n),i,o;for(o=0;o<r.length;o++)i=r[o],!(e.indexOf(i)>=0)&&(t[i]=n[i]);return t}function qn(n,e){if(n==null)return{};var t=Un(n,e),r,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(n);for(i=0;i<o.length;i++)r=o[i],!(e.indexOf(r)>=0)&&(!Object.prototype.propertyIsEnumerable.call(n,r)||(t[r]=n[r]))}return t}function Qn(n){return Jn(n)||Zn(n)||ei(n)||ti()}function Jn(n){if(Array.isArray(n))return kt(n)}function Zn(n){if(typeof Symbol!="undefined"&&n[Symbol.iterator]!=null||n["@@iterator"]!=null)return Array.from(n)}function ei(n,e){if(!!n){if(typeof n=="string")return kt(n,e);var t=Object.prototype.toString.call(n).slice(8,-1);if(t==="Object"&&n.constructor&&(t=n.constructor.name),t==="Map"||t==="Set")return Array.from(n);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return kt(n,e)}}function kt(n,e){(e==null||e>n.length)&&(e=n.length);for(var t=0,r=new Array(e);t<e;t++)r[t]=n[t];return r}function ti(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var ri="1.14.0";function me(n){if(typeof window!="undefined"&&window.navigator)return!!navigator.userAgent.match(n)}var be=me(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),Be=me(/Edge/i),xr=me(/firefox/i),He=me(/safari/i)&&!me(/chrome/i)&&!me(/android/i),_r=me(/iP(ad|od|hone)/i),ni=me(/chrome/i)&&me(/android/i),Ir={capture:!1,passive:!1};function T(n,e,t){n.addEventListener(e,t,!be&&Ir)}function w(n,e,t){n.removeEventListener(e,t,!be&&Ir)}function ot(n,e){if(!!e){if(e[0]===">"&&(e=e.substring(1)),n)try{if(n.matches)return n.matches(e);if(n.msMatchesSelector)return n.msMatchesSelector(e);if(n.webkitMatchesSelector)return n.webkitMatchesSelector(e)}catch(t){return!1}return!1}}function ii(n){return n.host&&n!==document&&n.host.nodeType?n.host:n.parentNode}function ne(n,e,t,r){if(n){t=t||document;do{if(e!=null&&(e[0]===">"?n.parentNode===t&&ot(n,e):ot(n,e))||r&&n===t)return n;if(n===t)break}while(n=ii(n))}return null}var Mr=/\s+/g;function L(n,e,t){if(n&&e)if(n.classList)n.classList[t?"add":"remove"](e);else{var r=(" "+n.className+" ").replace(Mr," ").replace(" "+e+" "," ");n.className=(r+(t?" "+e:"")).replace(Mr," ")}}function m(n,e,t){var r=n&&n.style;if(r){if(t===void 0)return document.defaultView&&document.defaultView.getComputedStyle?t=document.defaultView.getComputedStyle(n,""):n.currentStyle&&(t=n.currentStyle),e===void 0?t:t[e];!(e in r)&&e.indexOf("webkit")===-1&&(e="-webkit-"+e),r[e]=t+(typeof t=="string"?"":"px")}}function De(n,e){var t="";if(typeof n=="string")t=n;else do{var r=m(n,"transform");r&&r!=="none"&&(t=r+" "+t)}while(!e&&(n=n.parentNode));var i=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return i&&new i(t)}function Ar(n,e,t){if(n){var r=n.getElementsByTagName(e),i=0,o=r.length;if(t)for(;i<o;i++)t(r[i],i);return r}return[]}function ue(){var n=document.scrollingElement;return n||document.documentElement}function M(n,e,t,r,i){if(!(!n.getBoundingClientRect&&n!==window)){var o,s,a,l,c,u,h;if(n!==window&&n.parentNode&&n!==ue()?(o=n.getBoundingClientRect(),s=o.top,a=o.left,l=o.bottom,c=o.right,u=o.height,h=o.width):(s=0,a=0,l=window.innerHeight,c=window.innerWidth,u=window.innerHeight,h=window.innerWidth),(e||t)&&n!==window&&(i=i||n.parentNode,!be))do if(i&&i.getBoundingClientRect&&(m(i,"transform")!=="none"||t&&m(i,"position")!=="static")){var d=i.getBoundingClientRect();s-=d.top+parseInt(m(i,"border-top-width")),a-=d.left+parseInt(m(i,"border-left-width")),l=s+o.height,c=a+o.width;break}while(i=i.parentNode);if(r&&n!==window){var p=De(i||n),g=p&&p.a,b=p&&p.d;p&&(s/=b,a/=g,h/=g,u/=b,l=s+u,c=a+h)}return{top:s,left:a,bottom:l,right:c,width:h,height:u}}}function Or(n,e,t){for(var r=Ee(n,!0),i=M(n)[e];r;){var o=M(r)[t],s=void 0;if(t==="top"||t==="left"?s=i>=o:s=i<=o,!s)return r;if(r===ue())break;r=Ee(r,!1)}return!1}function Me(n,e,t,r){for(var i=0,o=0,s=n.children;o<s.length;){if(s[o].style.display!=="none"&&s[o]!==v.ghost&&(r||s[o]!==v.dragged)&&ne(s[o],t.draggable,n,!1)){if(i===e)return s[o];i++}o++}return null}function Pt(n,e){for(var t=n.lastElementChild;t&&(t===v.ghost||m(t,"display")==="none"||e&&!ot(t,e));)t=t.previousElementSibling;return t||null}function B(n,e){var t=0;if(!n||!n.parentNode)return-1;for(;n=n.previousElementSibling;)n.nodeName.toUpperCase()!=="TEMPLATE"&&n!==v.clone&&(!e||ot(n,e))&&t++;return t}function Fr(n){var e=0,t=0,r=ue();if(n)do{var i=De(n),o=i.a,s=i.d;e+=n.scrollLeft*o,t+=n.scrollTop*s}while(n!==r&&(n=n.parentNode));return[e,t]}function oi(n,e){for(var t in n)if(!!n.hasOwnProperty(t)){for(var r in e)if(e.hasOwnProperty(r)&&e[r]===n[t][r])return Number(t)}return-1}function Ee(n,e){if(!n||!n.getBoundingClientRect)return ue();var t=n,r=!1;do if(t.clientWidth<t.scrollWidth||t.clientHeight<t.scrollHeight){var i=m(t);if(t.clientWidth<t.scrollWidth&&(i.overflowX=="auto"||i.overflowX=="scroll")||t.clientHeight<t.scrollHeight&&(i.overflowY=="auto"||i.overflowY=="scroll")){if(!t.getBoundingClientRect||t===document.body)return ue();if(r||e)return t;r=!0}}while(t=t.parentNode);return ue()}function si(n,e){if(n&&e)for(var t in e)e.hasOwnProperty(t)&&(n[t]=e[t]);return n}function Rt(n,e){return Math.round(n.top)===Math.round(e.top)&&Math.round(n.left)===Math.round(e.left)&&Math.round(n.height)===Math.round(e.height)&&Math.round(n.width)===Math.round(e.width)}var We;function Nr(n,e){return function(){if(!We){var t=arguments,r=this;t.length===1?n.call(r,t[0]):n.apply(r,t),We=setTimeout(function(){We=void 0},e)}}}function ai(){clearTimeout(We),We=void 0}function kr(n,e,t){n.scrollLeft+=e,n.scrollTop+=t}function Lt(n){var e=window.Polymer,t=window.jQuery||window.Zepto;return e&&e.dom?e.dom(n).cloneNode(!0):t?t(n).clone(!0)[0]:n.cloneNode(!0)}function Pr(n,e){m(n,"position","absolute"),m(n,"top",e.top),m(n,"left",e.left),m(n,"width",e.width),m(n,"height",e.height)}function Bt(n){m(n,"position",""),m(n,"top",""),m(n,"left",""),m(n,"width",""),m(n,"height","")}var $="Sortable"+new Date().getTime();function li(){var n=[],e;return{captureAnimationState:function(){if(n=[],!!this.options.animation){var r=[].slice.call(this.el.children);r.forEach(function(i){if(!(m(i,"display")==="none"||i===v.ghost)){n.push({target:i,rect:M(i)});var o=ce({},n[n.length-1].rect);if(i.thisAnimationDuration){var s=De(i,!0);s&&(o.top-=s.f,o.left-=s.e)}i.fromRect=o}})}},addAnimationState:function(r){n.push(r)},removeAnimationState:function(r){n.splice(oi(n,{target:r}),1)},animateAll:function(r){var i=this;if(!this.options.animation){clearTimeout(e),typeof r=="function"&&r();return}var o=!1,s=0;n.forEach(function(a){var l=0,c=a.target,u=c.fromRect,h=M(c),d=c.prevFromRect,p=c.prevToRect,g=a.rect,b=De(c,!0);b&&(h.top-=b.f,h.left-=b.e),c.toRect=h,c.thisAnimationDuration&&Rt(d,h)&&!Rt(u,h)&&(g.top-h.top)/(g.left-h.left)==(u.top-h.top)/(u.left-h.left)&&(l=ui(g,d,p,i.options)),Rt(h,u)||(c.prevFromRect=u,c.prevToRect=h,l||(l=i.options.animation),i.animate(c,g,h,l)),l&&(o=!0,s=Math.max(s,l),clearTimeout(c.animationResetTimer),c.animationResetTimer=setTimeout(function(){c.animationTime=0,c.prevFromRect=null,c.fromRect=null,c.prevToRect=null,c.thisAnimationDuration=null},l),c.thisAnimationDuration=l)}),clearTimeout(e),o?e=setTimeout(function(){typeof r=="function"&&r()},s):typeof r=="function"&&r(),n=[]},animate:function(r,i,o,s){if(s){m(r,"transition",""),m(r,"transform","");var a=De(this.el),l=a&&a.a,c=a&&a.d,u=(i.left-o.left)/(l||1),h=(i.top-o.top)/(c||1);r.animatingX=!!u,r.animatingY=!!h,m(r,"transform","translate3d("+u+"px,"+h+"px,0)"),this.forRepaintDummy=ci(r),m(r,"transition","transform "+s+"ms"+(this.options.easing?" "+this.options.easing:"")),m(r,"transform","translate3d(0,0,0)"),typeof r.animated=="number"&&clearTimeout(r.animated),r.animated=setTimeout(function(){m(r,"transition",""),m(r,"transform",""),r.animated=!1,r.animatingX=!1,r.animatingY=!1},s)}}}}function ci(n){return n.offsetWidth}function ui(n,e,t,r){return Math.sqrt(Math.pow(e.top-n.top,2)+Math.pow(e.left-n.left,2))/Math.sqrt(Math.pow(e.top-t.top,2)+Math.pow(e.left-t.left,2))*r.animation}var Ae=[],Ht={initializeByDefault:!0},je={mount:function(e){for(var t in Ht)Ht.hasOwnProperty(t)&&!(t in e)&&(e[t]=Ht[t]);Ae.forEach(function(r){if(r.pluginName===e.pluginName)throw"Sortable: Cannot mount plugin ".concat(e.pluginName," more than once")}),Ae.push(e)},pluginEvent:function(e,t,r){var i=this;this.eventCanceled=!1,r.cancel=function(){i.eventCanceled=!0};var o=e+"Global";Ae.forEach(function(s){!t[s.pluginName]||(t[s.pluginName][o]&&t[s.pluginName][o](ce({sortable:t},r)),t.options[s.pluginName]&&t[s.pluginName][e]&&t[s.pluginName][e](ce({sortable:t},r)))})},initializePlugins:function(e,t,r,i){Ae.forEach(function(a){var l=a.pluginName;if(!(!e.options[l]&&!a.initializeByDefault)){var c=new a(e,t,e.options);c.sortable=e,c.options=e.options,e[l]=c,re(r,c.defaults)}});for(var o in e.options)if(!!e.options.hasOwnProperty(o)){var s=this.modifyOption(e,o,e.options[o]);typeof s!="undefined"&&(e.options[o]=s)}},getEventProperties:function(e,t){var r={};return Ae.forEach(function(i){typeof i.eventProperties=="function"&&re(r,i.eventProperties.call(t[i.pluginName],e))}),r},modifyOption:function(e,t,r){var i;return Ae.forEach(function(o){!e[o.pluginName]||o.optionListeners&&typeof o.optionListeners[t]=="function"&&(i=o.optionListeners[t].call(e[o.pluginName],r))}),i}};function $e(n){var e=n.sortable,t=n.rootEl,r=n.name,i=n.targetEl,o=n.cloneEl,s=n.toEl,a=n.fromEl,l=n.oldIndex,c=n.newIndex,u=n.oldDraggableIndex,h=n.newDraggableIndex,d=n.originalEvent,p=n.putSortable,g=n.extraEventProperties;if(e=e||t&&t[$],!!e){var b,C=e.options,O="on"+r.charAt(0).toUpperCase()+r.substr(1);window.CustomEvent&&!be&&!Be?b=new CustomEvent(r,{bubbles:!0,cancelable:!0}):(b=document.createEvent("Event"),b.initEvent(r,!0,!0)),b.to=s||t,b.from=a||t,b.item=i||t,b.clone=o,b.oldIndex=l,b.newIndex=c,b.oldDraggableIndex=u,b.newDraggableIndex=h,b.originalEvent=d,b.pullMode=p?p.lastPutMode:void 0;var _=ce(ce({},g),je.getEventProperties(r,e));for(var F in _)b[F]=_[F];t&&t.dispatchEvent(b),C[O]&&C[O].call(e,b)}}var hi=["evt"],K=function(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},i=r.evt,o=qn(r,hi);je.pluginEvent.bind(v)(e,t,ce({dragEl:f,parentEl:k,ghostEl:S,rootEl:A,nextEl:Ce,lastDownEl:st,cloneEl:P,cloneHidden:Se,dragStarted:Ye,putSortable:j,activeSortable:v.active,originalEvent:i,oldIndex:Oe,oldDraggableIndex:Ge,newIndex:q,newDraggableIndex:we,hideGhostForTarget:$r,unhideGhostForTarget:Gr,cloneNowHidden:function(){Se=!0},cloneNowShown:function(){Se=!1},dispatchSortableEvent:function(a){Y({sortable:t,name:a,originalEvent:i})}},o))};function Y(n){$e(ce({putSortable:j,cloneEl:P,targetEl:f,rootEl:A,oldIndex:Oe,oldDraggableIndex:Ge,newIndex:q,newDraggableIndex:we},n))}var f,k,S,A,Ce,st,P,Se,Oe,q,Ge,we,at,j,Fe=!1,lt=!1,ct=[],xe,ie,Wt,jt,Rr,Lr,Ye,Ne,Xe,Ve=!1,ut=!1,ht,G,$t=[],Gt=!1,dt=[],ft=typeof document!="undefined",pt=_r,Br=Be||be?"cssFloat":"float",di=ft&&!ni&&!_r&&"draggable"in document.createElement("div"),Hr=function(){if(!!ft){if(be)return!1;var n=document.createElement("x");return n.style.cssText="pointer-events:auto",n.style.pointerEvents==="auto"}}(),Wr=function(e,t){var r=m(e),i=parseInt(r.width)-parseInt(r.paddingLeft)-parseInt(r.paddingRight)-parseInt(r.borderLeftWidth)-parseInt(r.borderRightWidth),o=Me(e,0,t),s=Me(e,1,t),a=o&&m(o),l=s&&m(s),c=a&&parseInt(a.marginLeft)+parseInt(a.marginRight)+M(o).width,u=l&&parseInt(l.marginLeft)+parseInt(l.marginRight)+M(s).width;if(r.display==="flex")return r.flexDirection==="column"||r.flexDirection==="column-reverse"?"vertical":"horizontal";if(r.display==="grid")return r.gridTemplateColumns.split(" ").length<=1?"vertical":"horizontal";if(o&&a.float&&a.float!=="none"){var h=a.float==="left"?"left":"right";return s&&(l.clear==="both"||l.clear===h)?"vertical":"horizontal"}return o&&(a.display==="block"||a.display==="flex"||a.display==="table"||a.display==="grid"||c>=i&&r[Br]==="none"||s&&r[Br]==="none"&&c+u>i)?"vertical":"horizontal"},fi=function(e,t,r){var i=r?e.left:e.top,o=r?e.right:e.bottom,s=r?e.width:e.height,a=r?t.left:t.top,l=r?t.right:t.bottom,c=r?t.width:t.height;return i===a||o===l||i+s/2===a+c/2},pi=function(e,t){var r;return ct.some(function(i){var o=i[$].options.emptyInsertThreshold;if(!(!o||Pt(i))){var s=M(i),a=e>=s.left-o&&e<=s.right+o,l=t>=s.top-o&&t<=s.bottom+o;if(a&&l)return r=i}}),r},jr=function(e){function t(o,s){return function(a,l,c,u){var h=a.options.group.name&&l.options.group.name&&a.options.group.name===l.options.group.name;if(o==null&&(s||h))return!0;if(o==null||o===!1)return!1;if(s&&o==="clone")return o;if(typeof o=="function")return t(o(a,l,c,u),s)(a,l,c,u);var d=(s?a:l).options.group.name;return o===!0||typeof o=="string"&&o===d||o.join&&o.indexOf(d)>-1}}var r={},i=e.group;(!i||it(i)!="object")&&(i={name:i}),r.name=i.name,r.checkPull=t(i.pull,!0),r.checkPut=t(i.put),r.revertClone=i.revertClone,e.group=r},$r=function(){!Hr&&S&&m(S,"display","none")},Gr=function(){!Hr&&S&&m(S,"display","")};ft&&document.addEventListener("click",function(n){if(lt)return n.preventDefault(),n.stopPropagation&&n.stopPropagation(),n.stopImmediatePropagation&&n.stopImmediatePropagation(),lt=!1,!1},!0);var _e=function(e){if(f){e=e.touches?e.touches[0]:e;var t=pi(e.clientX,e.clientY);if(t){var r={};for(var i in e)e.hasOwnProperty(i)&&(r[i]=e[i]);r.target=r.rootEl=t,r.preventDefault=void 0,r.stopPropagation=void 0,t[$]._onDragOver(r)}}},gi=function(e){f&&f.parentNode[$]._isOutsideThisEl(e.target)};function v(n,e){if(!(n&&n.nodeType&&n.nodeType===1))throw"Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(n));this.el=n,this.options=e=re({},e),n[$]=this;var t={group:null,sort:!0,disabled:!1,store:null,handle:null,draggable:/^[uo]l$/i.test(n.nodeName)?">li":">*",swapThreshold:1,invertSwap:!1,invertedSwapThreshold:null,removeCloneOnHide:!0,direction:function(){return Wr(n,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,a){s.setData("Text",a.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:v.supportPointer!==!1&&"PointerEvent"in window&&!He,emptyInsertThreshold:5};je.initializePlugins(this,n,t);for(var r in t)!(r in e)&&(e[r]=t[r]);jr(e);for(var i in this)i.charAt(0)==="_"&&typeof this[i]=="function"&&(this[i]=this[i].bind(this));this.nativeDraggable=e.forceFallback?!1:di,this.nativeDraggable&&(this.options.touchStartThreshold=1),e.supportPointer?T(n,"pointerdown",this._onTapStart):(T(n,"mousedown",this._onTapStart),T(n,"touchstart",this._onTapStart)),this.nativeDraggable&&(T(n,"dragover",this),T(n,"dragenter",this)),ct.push(this.el),e.store&&e.store.get&&this.sort(e.store.get(this)||[]),re(this,li())}v.prototype={constructor:v,_isOutsideThisEl:function(e){!this.el.contains(e)&&e!==this.el&&(Ne=null)},_getDirection:function(e,t){return typeof this.options.direction=="function"?this.options.direction.call(this,e,t,f):this.options.direction},_onTapStart:function(e){if(!!e.cancelable){var t=this,r=this.el,i=this.options,o=i.preventOnFilter,s=e.type,a=e.touches&&e.touches[0]||e.pointerType&&e.pointerType==="touch"&&e,l=(a||e).target,c=e.target.shadowRoot&&(e.path&&e.path[0]||e.composedPath&&e.composedPath()[0])||l,u=i.filter;if(Ti(r),!f&&!(/mousedown|pointerdown/.test(s)&&e.button!==0||i.disabled)&&!c.isContentEditable&&!(!this.nativeDraggable&&He&&l&&l.tagName.toUpperCase()==="SELECT")&&(l=ne(l,i.draggable,r,!1),!(l&&l.animated)&&st!==l)){if(Oe=B(l),Ge=B(l,i.draggable),typeof u=="function"){if(u.call(this,e,l,this)){Y({sortable:t,rootEl:c,name:"filter",targetEl:l,toEl:r,fromEl:r}),K("filter",t,{evt:e}),o&&e.cancelable&&e.preventDefault();return}}else if(u&&(u=u.split(",").some(function(h){if(h=ne(c,h.trim(),r,!1),h)return Y({sortable:t,rootEl:h,name:"filter",targetEl:l,fromEl:r,toEl:r}),K("filter",t,{evt:e}),!0}),u)){o&&e.cancelable&&e.preventDefault();return}i.handle&&!ne(c,i.handle,r,!1)||this._prepareDragStart(e,a,l)}}},_prepareDragStart:function(e,t,r){var i=this,o=i.el,s=i.options,a=o.ownerDocument,l;if(r&&!f&&r.parentNode===o){var c=M(r);if(A=o,f=r,k=f.parentNode,Ce=f.nextSibling,st=r,at=s.group,v.dragged=f,xe={target:f,clientX:(t||e).clientX,clientY:(t||e).clientY},Rr=xe.clientX-c.left,Lr=xe.clientY-c.top,this._lastX=(t||e).clientX,this._lastY=(t||e).clientY,f.style["will-change"]="all",l=function(){if(K("delayEnded",i,{evt:e}),v.eventCanceled){i._onDrop();return}i._disableDelayedDragEvents(),!xr&&i.nativeDraggable&&(f.draggable=!0),i._triggerDragStart(e,t),Y({sortable:i,name:"choose",originalEvent:e}),L(f,s.chosenClass,!0)},s.ignore.split(",").forEach(function(u){Ar(f,u.trim(),Yt)}),T(a,"dragover",_e),T(a,"mousemove",_e),T(a,"touchmove",_e),T(a,"mouseup",i._onDrop),T(a,"touchend",i._onDrop),T(a,"touchcancel",i._onDrop),xr&&this.nativeDraggable&&(this.options.touchStartThreshold=4,f.draggable=!0),K("delayStart",this,{evt:e}),s.delay&&(!s.delayOnTouchOnly||t)&&(!this.nativeDraggable||!(Be||be))){if(v.eventCanceled){this._onDrop();return}T(a,"mouseup",i._disableDelayedDrag),T(a,"touchend",i._disableDelayedDrag),T(a,"touchcancel",i._disableDelayedDrag),T(a,"mousemove",i._delayedDragTouchMoveHandler),T(a,"touchmove",i._delayedDragTouchMoveHandler),s.supportPointer&&T(a,"pointermove",i._delayedDragTouchMoveHandler),i._dragStartTimer=setTimeout(l,s.delay)}else l()}},_delayedDragTouchMoveHandler:function(e){var t=e.touches?e.touches[0]:e;Math.max(Math.abs(t.clientX-this._lastX),Math.abs(t.clientY-this._lastY))>=Math.floor(this.options.touchStartThreshold/(this.nativeDraggable&&window.devicePixelRatio||1))&&this._disableDelayedDrag()},_disableDelayedDrag:function(){f&&Yt(f),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()},_disableDelayedDragEvents:function(){var e=this.el.ownerDocument;w(e,"mouseup",this._disableDelayedDrag),w(e,"touchend",this._disableDelayedDrag),w(e,"touchcancel",this._disableDelayedDrag),w(e,"mousemove",this._delayedDragTouchMoveHandler),w(e,"touchmove",this._delayedDragTouchMoveHandler),w(e,"pointermove",this._delayedDragTouchMoveHandler)},_triggerDragStart:function(e,t){t=t||e.pointerType=="touch"&&e,!this.nativeDraggable||t?this.options.supportPointer?T(document,"pointermove",this._onTouchMove):t?T(document,"touchmove",this._onTouchMove):T(document,"mousemove",this._onTouchMove):(T(f,"dragend",this),T(A,"dragstart",this._onDragStart));try{document.selection?mt(function(){document.selection.empty()}):window.getSelection().removeAllRanges()}catch(r){}},_dragStarted:function(e,t){if(Fe=!1,A&&f){K("dragStarted",this,{evt:t}),this.nativeDraggable&&T(document,"dragover",gi);var r=this.options;!e&&L(f,r.dragClass,!1),L(f,r.ghostClass,!0),v.active=this,e&&this._appendGhost(),Y({sortable:this,name:"start",originalEvent:t})}else this._nulling()},_emulateDragOver:function(){if(ie){this._lastX=ie.clientX,this._lastY=ie.clientY,$r();for(var e=document.elementFromPoint(ie.clientX,ie.clientY),t=e;e&&e.shadowRoot&&(e=e.shadowRoot.elementFromPoint(ie.clientX,ie.clientY),e!==t);)t=e;if(f.parentNode[$]._isOutsideThisEl(e),t)do{if(t[$]){var r=void 0;if(r=t[$]._onDragOver({clientX:ie.clientX,clientY:ie.clientY,target:e,rootEl:t}),r&&!this.options.dragoverBubble)break}e=t}while(t=t.parentNode);Gr()}},_onTouchMove:function(e){if(xe){var t=this.options,r=t.fallbackTolerance,i=t.fallbackOffset,o=e.touches?e.touches[0]:e,s=S&&De(S,!0),a=S&&s&&s.a,l=S&&s&&s.d,c=pt&&G&&Fr(G),u=(o.clientX-xe.clientX+i.x)/(a||1)+(c?c[0]-$t[0]:0)/(a||1),h=(o.clientY-xe.clientY+i.y)/(l||1)+(c?c[1]-$t[1]:0)/(l||1);if(!v.active&&!Fe){if(r&&Math.max(Math.abs(o.clientX-this._lastX),Math.abs(o.clientY-this._lastY))<r)return;this._onDragStart(e,!0)}if(S){s?(s.e+=u-(Wt||0),s.f+=h-(jt||0)):s={a:1,b:0,c:0,d:1,e:u,f:h};var d="matrix(".concat(s.a,",").concat(s.b,",").concat(s.c,",").concat(s.d,",").concat(s.e,",").concat(s.f,")");m(S,"webkitTransform",d),m(S,"mozTransform",d),m(S,"msTransform",d),m(S,"transform",d),Wt=u,jt=h,ie=o}e.cancelable&&e.preventDefault()}},_appendGhost:function(){if(!S){var e=this.options.fallbackOnBody?document.body:A,t=M(f,!0,pt,!0,e),r=this.options;if(pt){for(G=e;m(G,"position")==="static"&&m(G,"transform")==="none"&&G!==document;)G=G.parentNode;G!==document.body&&G!==document.documentElement?(G===document&&(G=ue()),t.top+=G.scrollTop,t.left+=G.scrollLeft):G=ue(),$t=Fr(G)}S=f.cloneNode(!0),L(S,r.ghostClass,!1),L(S,r.fallbackClass,!0),L(S,r.dragClass,!0),m(S,"transition",""),m(S,"transform",""),m(S,"box-sizing","border-box"),m(S,"margin",0),m(S,"top",t.top),m(S,"left",t.left),m(S,"width",t.width),m(S,"height",t.height),m(S,"opacity","0.8"),m(S,"position",pt?"absolute":"fixed"),m(S,"zIndex","100000"),m(S,"pointerEvents","none"),v.ghost=S,e.appendChild(S),m(S,"transform-origin",Rr/parseInt(S.style.width)*100+"% "+Lr/parseInt(S.style.height)*100+"%")}},_onDragStart:function(e,t){var r=this,i=e.dataTransfer,o=r.options;if(K("dragStart",this,{evt:e}),v.eventCanceled){this._onDrop();return}K("setupClone",this),v.eventCanceled||(P=Lt(f),P.draggable=!1,P.style["will-change"]="",this._hideClone(),L(P,this.options.chosenClass,!1),v.clone=P),r.cloneId=mt(function(){K("clone",r),!v.eventCanceled&&(r.options.removeCloneOnHide||A.insertBefore(P,f),r._hideClone(),Y({sortable:r,name:"clone"}))}),!t&&L(f,o.dragClass,!0),t?(lt=!0,r._loopId=setInterval(r._emulateDragOver,50)):(w(document,"mouseup",r._onDrop),w(document,"touchend",r._onDrop),w(document,"touchcancel",r._onDrop),i&&(i.effectAllowed="move",o.setData&&o.setData.call(r,i,f)),T(document,"drop",r),m(f,"transform","translateZ(0)")),Fe=!0,r._dragStartId=mt(r._dragStarted.bind(r,t,e)),T(document,"selectstart",r),Ye=!0,He&&m(document.body,"user-select","none")},_onDragOver:function(e){var t=this.el,r=e.target,i,o,s,a=this.options,l=a.group,c=v.active,u=at===l,h=a.sort,d=j||c,p,g=this,b=!1;if(Gt)return;function C(Re,sn){K(Re,g,ce({evt:e,isOwner:u,axis:p?"vertical":"horizontal",revert:s,dragRect:i,targetRect:o,canSort:h,fromSortable:d,target:r,completed:_,onMove:function(tr,an){return gt(A,t,f,i,tr,M(tr),e,an)},changed:F},sn))}function O(){C("dragOverAnimationCapture"),g.captureAnimationState(),g!==d&&d.captureAnimationState()}function _(Re){return C("dragOverCompleted",{insertion:Re}),Re&&(u?c._hideClone():c._showClone(g),g!==d&&(L(f,j?j.options.ghostClass:c.options.ghostClass,!1),L(f,a.ghostClass,!0)),j!==g&&g!==v.active?j=g:g===v.active&&j&&(j=null),d===g&&(g._ignoreWhileAnimating=r),g.animateAll(function(){C("dragOverAnimationComplete"),g._ignoreWhileAnimating=null}),g!==d&&(d.animateAll(),d._ignoreWhileAnimating=null)),(r===f&&!f.animated||r===t&&!r.animated)&&(Ne=null),!a.dragoverBubble&&!e.rootEl&&r!==document&&(f.parentNode[$]._isOutsideThisEl(e.target),!Re&&_e(e)),!a.dragoverBubble&&e.stopPropagation&&e.stopPropagation(),b=!0}function F(){q=B(f),we=B(f,a.draggable),Y({sortable:g,name:"change",toEl:t,newIndex:q,newDraggableIndex:we,originalEvent:e})}if(e.preventDefault!==void 0&&e.cancelable&&e.preventDefault(),r=ne(r,a.draggable,t,!0),C("dragOver"),v.eventCanceled)return b;if(f.contains(e.target)||r.animated&&r.animatingX&&r.animatingY||g._ignoreWhileAnimating===r)return _(!1);if(lt=!1,c&&!a.disabled&&(u?h||(s=k!==A):j===this||(this.lastPutMode=at.checkPull(this,c,f,e))&&l.checkPut(this,c,f,e))){if(p=this._getDirection(e,r)==="vertical",i=M(f),C("dragOverValid"),v.eventCanceled)return b;if(s)return k=A,O(),this._hideClone(),C("revert"),v.eventCanceled||(Ce?A.insertBefore(f,Ce):A.appendChild(f)),_(!0);var D=Pt(t,a.draggable);if(!D||yi(e,p,this)&&!D.animated){if(D===f)return _(!1);if(D&&t===e.target&&(r=D),r&&(o=M(r)),gt(A,t,f,i,r,o,e,!!r)!==!1)return O(),t.appendChild(f),k=t,F(),_(!0)}else if(D&&vi(e,p,this)){var J=Me(t,0,a,!0);if(J===f)return _(!1);if(r=J,o=M(r),gt(A,t,f,i,r,o,e,!1)!==!1)return O(),t.insertBefore(f,J),k=t,F(),_(!0)}else if(r.parentNode===t){o=M(r);var X=0,R,V=f.parentNode!==t,N=!fi(f.animated&&f.toRect||i,r.animated&&r.toRect||o,p),ve=p?"top":"left",Z=Or(r,"top","top")||Or(f,"top","top"),ee=Z?Z.scrollTop:void 0;Ne!==r&&(R=o[ve],Ve=!1,ut=!N&&a.invertSwap||V),X=Ei(e,r,o,p,N?1:a.swapThreshold,a.invertedSwapThreshold==null?a.swapThreshold:a.invertedSwapThreshold,ut,Ne===r);var se;if(X!==0){var W=B(f);do W-=X,se=k.children[W];while(se&&(m(se,"display")==="none"||se===S))}if(X===0||se===r)return _(!1);Ne=r,Xe=X;var ae=r.nextElementSibling,te=!1;te=X===1;var et=gt(A,t,f,i,r,o,e,te);if(et!==!1)return(et===1||et===-1)&&(te=et===1),Gt=!0,setTimeout(bi,30),O(),te&&!ae?t.appendChild(f):r.parentNode.insertBefore(f,te?ae:r),Z&&kr(Z,0,ee-Z.scrollTop),k=f.parentNode,R!==void 0&&!ut&&(ht=Math.abs(R-M(r)[ve])),F(),_(!0)}if(t.contains(f))return _(!1)}return!1},_ignoreWhileAnimating:null,_offMoveEvents:function(){w(document,"mousemove",this._onTouchMove),w(document,"touchmove",this._onTouchMove),w(document,"pointermove",this._onTouchMove),w(document,"dragover",_e),w(document,"mousemove",_e),w(document,"touchmove",_e)},_offUpEvents:function(){var e=this.el.ownerDocument;w(e,"mouseup",this._onDrop),w(e,"touchend",this._onDrop),w(e,"pointerup",this._onDrop),w(e,"touchcancel",this._onDrop),w(document,"selectstart",this)},_onDrop:function(e){var t=this.el,r=this.options;if(q=B(f),we=B(f,r.draggable),K("drop",this,{evt:e}),k=f&&f.parentNode,q=B(f),we=B(f,r.draggable),v.eventCanceled){this._nulling();return}Fe=!1,ut=!1,Ve=!1,clearInterval(this._loopId),clearTimeout(this._dragStartTimer),Xt(this.cloneId),Xt(this._dragStartId),this.nativeDraggable&&(w(document,"drop",this),w(t,"dragstart",this._onDragStart)),this._offMoveEvents(),this._offUpEvents(),He&&m(document.body,"user-select",""),m(f,"transform",""),e&&(Ye&&(e.cancelable&&e.preventDefault(),!r.dropBubble&&e.stopPropagation()),S&&S.parentNode&&S.parentNode.removeChild(S),(A===k||j&&j.lastPutMode!=="clone")&&P&&P.parentNode&&P.parentNode.removeChild(P),f&&(this.nativeDraggable&&w(f,"dragend",this),Yt(f),f.style["will-change"]="",Ye&&!Fe&&L(f,j?j.options.ghostClass:this.options.ghostClass,!1),L(f,this.options.chosenClass,!1),Y({sortable:this,name:"unchoose",toEl:k,newIndex:null,newDraggableIndex:null,originalEvent:e}),A!==k?(q>=0&&(Y({rootEl:k,name:"add",toEl:k,fromEl:A,originalEvent:e}),Y({sortable:this,name:"remove",toEl:k,originalEvent:e}),Y({rootEl:k,name:"sort",toEl:k,fromEl:A,originalEvent:e}),Y({sortable:this,name:"sort",toEl:k,originalEvent:e})),j&&j.save()):q!==Oe&&q>=0&&(Y({sortable:this,name:"update",toEl:k,originalEvent:e}),Y({sortable:this,name:"sort",toEl:k,originalEvent:e})),v.active&&((q==null||q===-1)&&(q=Oe,we=Ge),Y({sortable:this,name:"end",toEl:k,originalEvent:e}),this.save()))),this._nulling()},_nulling:function(){K("nulling",this),A=f=k=S=Ce=P=st=Se=xe=ie=Ye=q=we=Oe=Ge=Ne=Xe=j=at=v.dragged=v.ghost=v.clone=v.active=null,dt.forEach(function(e){e.checked=!0}),dt.length=Wt=jt=0},handleEvent:function(e){switch(e.type){case"drop":case"dragend":this._onDrop(e);break;case"dragenter":case"dragover":f&&(this._onDragOver(e),mi(e));break;case"selectstart":e.preventDefault();break}},toArray:function(){for(var e=[],t,r=this.el.children,i=0,o=r.length,s=this.options;i<o;i++)t=r[i],ne(t,s.draggable,this.el,!1)&&e.push(t.getAttribute(s.dataIdAttr)||wi(t));return e},sort:function(e,t){var r={},i=this.el;this.toArray().forEach(function(o,s){var a=i.children[s];ne(a,this.options.draggable,i,!1)&&(r[o]=a)},this),t&&this.captureAnimationState(),e.forEach(function(o){r[o]&&(i.removeChild(r[o]),i.appendChild(r[o]))}),t&&this.animateAll()},save:function(){var e=this.options.store;e&&e.set&&e.set(this)},closest:function(e,t){return ne(e,t||this.options.draggable,this.el,!1)},option:function(e,t){var r=this.options;if(t===void 0)return r[e];var i=je.modifyOption(this,e,t);typeof i!="undefined"?r[e]=i:r[e]=t,e==="group"&&jr(r)},destroy:function(){K("destroy",this);var e=this.el;e[$]=null,w(e,"mousedown",this._onTapStart),w(e,"touchstart",this._onTapStart),w(e,"pointerdown",this._onTapStart),this.nativeDraggable&&(w(e,"dragover",this),w(e,"dragenter",this)),Array.prototype.forEach.call(e.querySelectorAll("[draggable]"),function(t){t.removeAttribute("draggable")}),this._onDrop(),this._disableDelayedDragEvents(),ct.splice(ct.indexOf(this.el),1),this.el=e=null},_hideClone:function(){if(!Se){if(K("hideClone",this),v.eventCanceled)return;m(P,"display","none"),this.options.removeCloneOnHide&&P.parentNode&&P.parentNode.removeChild(P),Se=!0}},_showClone:function(e){if(e.lastPutMode!=="clone"){this._hideClone();return}if(Se){if(K("showClone",this),v.eventCanceled)return;f.parentNode==A&&!this.options.group.revertClone?A.insertBefore(P,f):Ce?A.insertBefore(P,Ce):A.appendChild(P),this.options.group.revertClone&&this.animate(f,P),m(P,"display",""),Se=!1}}};function mi(n){n.dataTransfer&&(n.dataTransfer.dropEffect="move"),n.cancelable&&n.preventDefault()}function gt(n,e,t,r,i,o,s,a){var l,c=n[$],u=c.options.onMove,h;return window.CustomEvent&&!be&&!Be?l=new CustomEvent("move",{bubbles:!0,cancelable:!0}):(l=document.createEvent("Event"),l.initEvent("move",!0,!0)),l.to=e,l.from=n,l.dragged=t,l.draggedRect=r,l.related=i||e,l.relatedRect=o||M(e),l.willInsertAfter=a,l.originalEvent=s,n.dispatchEvent(l),u&&(h=u.call(c,l,s)),h}function Yt(n){n.draggable=!1}function bi(){Gt=!1}function vi(n,e,t){var r=M(Me(t.el,0,t.options,!0)),i=10;return e?n.clientX<r.left-i||n.clientY<r.top&&n.clientX<r.right:n.clientY<r.top-i||n.clientY<r.bottom&&n.clientX<r.left}function yi(n,e,t){var r=M(Pt(t.el,t.options.draggable)),i=10;return e?n.clientX>r.right+i||n.clientX<=r.right&&n.clientY>r.bottom&&n.clientX>=r.left:n.clientX>r.right&&n.clientY>r.top||n.clientX<=r.right&&n.clientY>r.bottom+i}function Ei(n,e,t,r,i,o,s,a){var l=r?n.clientY:n.clientX,c=r?t.height:t.width,u=r?t.top:t.left,h=r?t.bottom:t.right,d=!1;if(!s){if(a&&ht<c*i){if(!Ve&&(Xe===1?l>u+c*o/2:l<h-c*o/2)&&(Ve=!0),Ve)d=!0;else if(Xe===1?l<u+ht:l>h-ht)return-Xe}else if(l>u+c*(1-i)/2&&l<h-c*(1-i)/2)return Si(e)}return d=d||s,d&&(l<u+c*o/2||l>h-c*o/2)?l>u+c/2?1:-1:0}function Si(n){return B(f)<B(n)?1:-1}function wi(n){for(var e=n.tagName+n.className+n.src+n.href+n.textContent,t=e.length,r=0;t--;)r+=e.charCodeAt(t);return r.toString(36)}function Ti(n){dt.length=0;for(var e=n.getElementsByTagName("input"),t=e.length;t--;){var r=e[t];r.checked&&dt.push(r)}}function mt(n){return setTimeout(n,0)}function Xt(n){return clearTimeout(n)}ft&&T(document,"touchmove",function(n){(v.active||Fe)&&n.cancelable&&n.preventDefault()});v.utils={on:T,off:w,css:m,find:Ar,is:function(e,t){return!!ne(e,t,e,!1)},extend:si,throttle:Nr,closest:ne,toggleClass:L,clone:Lt,index:B,nextTick:mt,cancelNextTick:Xt,detectDirection:Wr,getChild:Me};v.get=function(n){return n[$]};v.mount=function(){for(var n=arguments.length,e=new Array(n),t=0;t<n;t++)e[t]=arguments[t];e[0].constructor===Array&&(e=e[0]),e.forEach(function(r){if(!r.prototype||!r.prototype.constructor)throw"Sortable: Mounted plugin must be a constructor function, not ".concat({}.toString.call(r));r.utils&&(v.utils=ce(ce({},v.utils),r.utils)),je.mount(r)})};v.create=function(n,e){return new v(n,e)};v.version=ri;var H=[],Ke,Vt,Kt=!1,zt,Ut,bt,ze;function Di(){function n(){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 n.prototype={dragStarted:function(t){var r=t.originalEvent;this.sortable.nativeDraggable?T(document,"dragover",this._handleAutoScroll):this.options.supportPointer?T(document,"pointermove",this._handleFallbackAutoScroll):r.touches?T(document,"touchmove",this._handleFallbackAutoScroll):T(document,"mousemove",this._handleFallbackAutoScroll)},dragOverCompleted:function(t){var r=t.originalEvent;!this.options.dragOverBubble&&!r.rootEl&&this._handleAutoScroll(r)},drop:function(){this.sortable.nativeDraggable?w(document,"dragover",this._handleAutoScroll):(w(document,"pointermove",this._handleFallbackAutoScroll),w(document,"touchmove",this._handleFallbackAutoScroll),w(document,"mousemove",this._handleFallbackAutoScroll)),Yr(),vt(),ai()},nulling:function(){bt=Vt=Ke=Kt=ze=zt=Ut=null,H.length=0},_handleFallbackAutoScroll:function(t){this._handleAutoScroll(t,!0)},_handleAutoScroll:function(t,r){var i=this,o=(t.touches?t.touches[0]:t).clientX,s=(t.touches?t.touches[0]:t).clientY,a=document.elementFromPoint(o,s);if(bt=t,r||this.options.forceAutoScrollFallback||Be||be||He){qt(t,this.options,a,r);var l=Ee(a,!0);Kt&&(!ze||o!==zt||s!==Ut)&&(ze&&Yr(),ze=setInterval(function(){var c=Ee(document.elementFromPoint(o,s),!0);c!==l&&(l=c,vt()),qt(t,i.options,c,r)},10),zt=o,Ut=s)}else{if(!this.options.bubbleScroll||Ee(a,!0)===ue()){vt();return}qt(t,this.options,Ee(a,!1),!1)}}},re(n,{pluginName:"scroll",initializeByDefault:!0})}function vt(){H.forEach(function(n){clearInterval(n.pid)}),H=[]}function Yr(){clearInterval(ze)}var qt=Nr(function(n,e,t,r){if(!!e.scroll){var i=(n.touches?n.touches[0]:n).clientX,o=(n.touches?n.touches[0]:n).clientY,s=e.scrollSensitivity,a=e.scrollSpeed,l=ue(),c=!1,u;Vt!==t&&(Vt=t,vt(),Ke=e.scroll,u=e.scrollFn,Ke===!0&&(Ke=Ee(t,!0)));var h=0,d=Ke;do{var p=d,g=M(p),b=g.top,C=g.bottom,O=g.left,_=g.right,F=g.width,D=g.height,J=void 0,X=void 0,R=p.scrollWidth,V=p.scrollHeight,N=m(p),ve=p.scrollLeft,Z=p.scrollTop;p===l?(J=F<R&&(N.overflowX==="auto"||N.overflowX==="scroll"||N.overflowX==="visible"),X=D<V&&(N.overflowY==="auto"||N.overflowY==="scroll"||N.overflowY==="visible")):(J=F<R&&(N.overflowX==="auto"||N.overflowX==="scroll"),X=D<V&&(N.overflowY==="auto"||N.overflowY==="scroll"));var ee=J&&(Math.abs(_-i)<=s&&ve+F<R)-(Math.abs(O-i)<=s&&!!ve),se=X&&(Math.abs(C-o)<=s&&Z+D<V)-(Math.abs(b-o)<=s&&!!Z);if(!H[h])for(var W=0;W<=h;W++)H[W]||(H[W]={});(H[h].vx!=ee||H[h].vy!=se||H[h].el!==p)&&(H[h].el=p,H[h].vx=ee,H[h].vy=se,clearInterval(H[h].pid),(ee!=0||se!=0)&&(c=!0,H[h].pid=setInterval(function(){r&&this.layer===0&&v.active._onTouchMove(bt);var ae=H[this.layer].vy?H[this.layer].vy*a:0,te=H[this.layer].vx?H[this.layer].vx*a:0;typeof u=="function"&&u.call(v.dragged.parentNode[$],te,ae,n,bt,H[this.layer].el)!=="continue"||kr(H[this.layer].el,te,ae)}.bind({layer:h}),24))),h++}while(e.bubbleScroll&&d!==l&&(d=Ee(d,!1)));Kt=c}},30),Xr=function(e){var t=e.originalEvent,r=e.putSortable,i=e.dragEl,o=e.activeSortable,s=e.dispatchSortableEvent,a=e.hideGhostForTarget,l=e.unhideGhostForTarget;if(!!t){var c=r||o;a();var u=t.changedTouches&&t.changedTouches.length?t.changedTouches[0]:t,h=document.elementFromPoint(u.clientX,u.clientY);l(),c&&!c.el.contains(h)&&(s("spill"),this.onSpill({dragEl:i,putSortable:r}))}};function Qt(){}Qt.prototype={startIndex:null,dragStart:function(e){var t=e.oldDraggableIndex;this.startIndex=t},onSpill:function(e){var t=e.dragEl,r=e.putSortable;this.sortable.captureAnimationState(),r&&r.captureAnimationState();var i=Me(this.sortable.el,this.startIndex,this.options);i?this.sortable.el.insertBefore(t,i):this.sortable.el.appendChild(t),this.sortable.animateAll(),r&&r.animateAll()},drop:Xr};re(Qt,{pluginName:"revertOnSpill"});function Jt(){}Jt.prototype={onSpill:function(e){var t=e.dragEl,r=e.putSortable,i=r||this.sortable;i.captureAnimationState(),t.parentNode&&t.parentNode.removeChild(t),i.animateAll()},drop:Xr};re(Jt,{pluginName:"removeOnSpill"});var E=[],Q=[],Ue,oe,qe=!1,z=!1,ke=!1,I,Qe,yt;function Vr(){function n(e){for(var t in this)t.charAt(0)==="_"&&typeof this[t]=="function"&&(this[t]=this[t].bind(this));e.options.supportPointer?T(document,"pointerup",this._deselectMultiDrag):(T(document,"mouseup",this._deselectMultiDrag),T(document,"touchend",this._deselectMultiDrag)),T(document,"keydown",this._checkKeyDown),T(document,"keyup",this._checkKeyUp),this.defaults={selectedClass:"sortable-selected",multiDragKey:null,setData:function(i,o){var s="";E.length&&oe===e?E.forEach(function(a,l){s+=(l?", ":"")+a.textContent}):s=o.textContent,i.setData("Text",s)}}}return n.prototype={multiDragKeyDown:!1,isMultiDrag:!1,delayStartGlobal:function(t){var r=t.dragEl;I=r},delayEnded:function(){this.isMultiDrag=~E.indexOf(I)},setupClone:function(t){var r=t.sortable,i=t.cancel;if(!!this.isMultiDrag){for(var o=0;o<E.length;o++)Q.push(Lt(E[o])),Q[o].sortableIndex=E[o].sortableIndex,Q[o].draggable=!1,Q[o].style["will-change"]="",L(Q[o],this.options.selectedClass,!1),E[o]===I&&L(Q[o],this.options.chosenClass,!1);r._hideClone(),i()}},clone:function(t){var r=t.sortable,i=t.rootEl,o=t.dispatchSortableEvent,s=t.cancel;!this.isMultiDrag||this.options.removeCloneOnHide||E.length&&oe===r&&(Kr(!0,i),o("clone"),s())},showClone:function(t){var r=t.cloneNowShown,i=t.rootEl,o=t.cancel;!this.isMultiDrag||(Kr(!1,i),Q.forEach(function(s){m(s,"display","")}),r(),yt=!1,o())},hideClone:function(t){var r=this,i=t.sortable,o=t.cloneNowHidden,s=t.cancel;!this.isMultiDrag||(Q.forEach(function(a){m(a,"display","none"),r.options.removeCloneOnHide&&a.parentNode&&a.parentNode.removeChild(a)}),o(),yt=!0,s())},dragStartGlobal:function(t){var r=t.sortable;!this.isMultiDrag&&oe&&oe.multiDrag._deselectMultiDrag(),E.forEach(function(i){i.sortableIndex=B(i)}),E=E.sort(function(i,o){return i.sortableIndex-o.sortableIndex}),ke=!0},dragStarted:function(t){var r=this,i=t.sortable;if(!!this.isMultiDrag){if(this.options.sort&&(i.captureAnimationState(),this.options.animation)){E.forEach(function(s){s!==I&&m(s,"position","absolute")});var o=M(I,!1,!0,!0);E.forEach(function(s){s!==I&&Pr(s,o)}),z=!0,qe=!0}i.animateAll(function(){z=!1,qe=!1,r.options.animation&&E.forEach(function(s){Bt(s)}),r.options.sort&&Et()})}},dragOver:function(t){var r=t.target,i=t.completed,o=t.cancel;z&&~E.indexOf(r)&&(i(!1),o())},revert:function(t){var r=t.fromSortable,i=t.rootEl,o=t.sortable,s=t.dragRect;E.length>1&&(E.forEach(function(a){o.addAnimationState({target:a,rect:z?M(a):s}),Bt(a),a.fromRect=s,r.removeAnimationState(a)}),z=!1,Ci(!this.options.removeCloneOnHide,i))},dragOverCompleted:function(t){var r=t.sortable,i=t.isOwner,o=t.insertion,s=t.activeSortable,a=t.parentEl,l=t.putSortable,c=this.options;if(o){if(i&&s._hideClone(),qe=!1,c.animation&&E.length>1&&(z||!i&&!s.options.sort&&!l)){var u=M(I,!1,!0,!0);E.forEach(function(d){d!==I&&(Pr(d,u),a.appendChild(d))}),z=!0}if(!i)if(z||Et(),E.length>1){var h=yt;s._showClone(r),s.options.animation&&!yt&&h&&Q.forEach(function(d){s.addAnimationState({target:d,rect:Qe}),d.fromRect=Qe,d.thisAnimationDuration=null})}else s._showClone(r)}},dragOverAnimationCapture:function(t){var r=t.dragRect,i=t.isOwner,o=t.activeSortable;if(E.forEach(function(a){a.thisAnimationDuration=null}),o.options.animation&&!i&&o.multiDrag.isMultiDrag){Qe=re({},r);var s=De(I,!0);Qe.top-=s.f,Qe.left-=s.e}},dragOverAnimationComplete:function(){z&&(z=!1,Et())},drop:function(t){var r=t.originalEvent,i=t.rootEl,o=t.parentEl,s=t.sortable,a=t.dispatchSortableEvent,l=t.oldIndex,c=t.putSortable,u=c||this.sortable;if(!!r){var h=this.options,d=o.children;if(!ke)if(h.multiDragKey&&!this.multiDragKeyDown&&this._deselectMultiDrag(),L(I,h.selectedClass,!~E.indexOf(I)),~E.indexOf(I))E.splice(E.indexOf(I),1),Ue=null,$e({sortable:s,rootEl:i,name:"deselect",targetEl:I,originalEvt:r});else{if(E.push(I),$e({sortable:s,rootEl:i,name:"select",targetEl:I,originalEvt:r}),r.shiftKey&&Ue&&s.el.contains(Ue)){var p=B(Ue),g=B(I);if(~p&&~g&&p!==g){var b,C;for(g>p?(C=p,b=g):(C=g,b=p+1);C<b;C++)~E.indexOf(d[C])||(L(d[C],h.selectedClass,!0),E.push(d[C]),$e({sortable:s,rootEl:i,name:"select",targetEl:d[C],originalEvt:r}))}}else Ue=I;oe=u}if(ke&&this.isMultiDrag){if(z=!1,(o[$].options.sort||o!==i)&&E.length>1){var O=M(I),_=B(I,":not(."+this.options.selectedClass+")");if(!qe&&h.animation&&(I.thisAnimationDuration=null),u.captureAnimationState(),!qe&&(h.animation&&(I.fromRect=O,E.forEach(function(D){if(D.thisAnimationDuration=null,D!==I){var J=z?M(D):O;D.fromRect=J,u.addAnimationState({target:D,rect:J})}})),Et(),E.forEach(function(D){d[_]?o.insertBefore(D,d[_]):o.appendChild(D),_++}),l===B(I))){var F=!1;E.forEach(function(D){if(D.sortableIndex!==B(D)){F=!0;return}}),F&&a("update")}E.forEach(function(D){Bt(D)}),u.animateAll()}oe=u}(i===o||c&&c.lastPutMode!=="clone")&&Q.forEach(function(D){D.parentNode&&D.parentNode.removeChild(D)})}},nullingGlobal:function(){this.isMultiDrag=ke=!1,Q.length=0},destroyGlobal:function(){this._deselectMultiDrag(),w(document,"pointerup",this._deselectMultiDrag),w(document,"mouseup",this._deselectMultiDrag),w(document,"touchend",this._deselectMultiDrag),w(document,"keydown",this._checkKeyDown),w(document,"keyup",this._checkKeyUp)},_deselectMultiDrag:function(t){if(!(typeof ke!="undefined"&&ke)&&oe===this.sortable&&!(t&&ne(t.target,this.options.draggable,this.sortable.el,!1))&&!(t&&t.button!==0))for(;E.length;){var r=E[0];L(r,this.options.selectedClass,!1),E.shift(),$e({sortable:this.sortable,rootEl:this.sortable.el,name:"deselect",targetEl:r,originalEvt:t})}},_checkKeyDown:function(t){t.key===this.options.multiDragKey&&(this.multiDragKeyDown=!0)},_checkKeyUp:function(t){t.key===this.options.multiDragKey&&(this.multiDragKeyDown=!1)}},re(n,{pluginName:"multiDrag",utils:{select:function(t){var r=t.parentNode[$];!r||!r.options.multiDrag||~E.indexOf(t)||(oe&&oe!==r&&(oe.multiDrag._deselectMultiDrag(),oe=r),L(t,r.options.selectedClass,!0),E.push(t))},deselect:function(t){var r=t.parentNode[$],i=E.indexOf(t);!r||!r.options.multiDrag||!~i||(L(t,r.options.selectedClass,!1),E.splice(i,1))}},eventProperties:function(){var t=this,r=[],i=[];return E.forEach(function(o){r.push({multiDragElement:o,index:o.sortableIndex});var s;z&&o!==I?s=-1:z?s=B(o,":not(."+t.options.selectedClass+")"):s=B(o),i.push({multiDragElement:o,index:s})}),{items:Qn(E),clones:[].concat(Q),oldIndicies:r,newIndicies:i}},optionListeners:{multiDragKey:function(t){return t=t.toLowerCase(),t==="ctrl"?t="Control":t.length>1&&(t=t.charAt(0).toUpperCase()+t.substr(1)),t}}})}function Ci(n,e){E.forEach(function(t,r){var i=e.children[t.sortableIndex+(n?Number(r):0)];i?e.insertBefore(t,i):e.appendChild(t)})}function Kr(n,e){Q.forEach(function(t,r){var i=e.children[t.sortableIndex+(n?Number(r):0)];i?e.insertBefore(t,i):e.appendChild(t)})}function Et(){E.forEach(function(n){n!==I&&n.parentNode&&n.parentNode.removeChild(n)})}v.mount(new Di);v.mount(Jt,Qt);var Ie=v;var Je=Tt(require("obsidian")),zr=new Intl.Collator(void 0,{usage:"sort",sensitivity:"base",numeric:!0}).compare;var Ur=i18next.t.bind(i18next),xi="up-and-down-arrows",_i={alphabetical:"plugins.file-explorer.label-sort-a-to-z",alphabeticalReverse:"plugins.file-explorer.label-sort-z-to-a",byModifiedTime:"plugins.file-explorer.label-sort-new-to-old",byModifiedTimeReverse:"plugins.file-explorer.label-sort-old-to-new",byCreatedTime:"plugins.file-explorer.label-sort-created-new-to-old",byCreatedTimeReverse:"plugins.file-explorer.label-sort-created-old-to-new",custom:"Custom"},Ii=[["alphabetical","alphabeticalReverse"],["byModifiedTime","byModifiedTimeReverse"],["byCreatedTime","byCreatedTimeReverse"],["custom"]],qr=function(n,e){let t=this.fileExplorer,r=this.file.children.slice();r.sort(function(i,o){let s,a;if(e&&((s=i instanceof Je.TFolder)||(a=o instanceof Je.TFolder)))return s&&!a?1:a&&!s?-1:zr(i.name,o.name);{if(!n)return zr(i.name,o.name);let l=n.indexOf(i.path),c=n.indexOf(o.path);return(l>-1?l:1/0)-(c>-1?c:1/0)}}),this.children=r.map(i=>t.fileItems[i.path]).filter(i=>i)},Qr=function(n,e){let t=this,r=this.addNavButton(xi,Ur("plugins.file-explorer.action-change-sort"),function(i){i.preventDefault();let o=new Je.Menu(t.app);for(let s=e(),a=0,l=Ii;a<l.length;a++){for(let c=function(d){let p=Ur(_i[d]);o.addItem(function(g){return g.setTitle(p).setActive(d===s).onClick(function(){d!==s&&(r.setAttribute("data-sort-method",d),t.app.workspace.trigger("file-explorer-sort-change",d)),n(d)})})},u=0,h=l[a];u<h.length;u++)c(h[u]);o.addSeparator()}o.showAtMouseEvent(i)});return setTimeout(()=>{r.setAttribute("data-sort-method",e())},100),this.addNavButton("three-horizontal-bars","Drag to rearrange",function(i){i.preventDefault();let o=!this.hasClass("is-active");this.toggleClass("is-active",o),t.app.workspace.trigger("file-explorer-draggable-change",o)}).addClass("drag-to-rearrange"),this.addNavButton("search","Filter items",function(i){var a,l;i.preventDefault();let o=!this.hasClass("is-active");this.toggleClass("is-active",o);let s=document.body.querySelector('.workspace-leaf-content[data-type="file-explorer"] .search-input-container > input');s&&!o?((a=s.parentElement)==null||a.hide(),s.value="",s.dispatchEvent(new Event("input"))):((l=s==null?void 0:s.parentElement)==null||l.show(),s==null||s.focus()),t.app.workspace.trigger("file-explorer-draggable-change",o)}),r};var Pe=Tt(require("obsidian")),Jr={statusBarOrder:[],ribbonBarOrder:[],fileExplorerOrder:{},actionBarOrder:{},autoHide:!1,autoHideDelay:2e3,dragDelay:200},Zt=class extends Pe.PluginSettingTab{constructor(e,t){super(e,t);this.plugin=t}hide(){}display(){let{containerEl:e}=this;e.empty(),new Pe.Setting(e).setName("Auto Collapse").setDesc("Automatically hide ribbon and status bar items once your mouse leaves the icon container").addToggle(t=>t.setValue(this.plugin.settings.autoHide).onChange(r=>{this.plugin.settings.autoHide=r,this.plugin.saveSettings()})),new Pe.Setting(e).setName("Auto Collapse Delay").setDesc("How long to wait before auto collapsing hidden icons on the ribbon and status bar").addText(t=>{t.setPlaceholder(String(2e3)),t.inputEl.type="number",t.setValue(String(this.plugin.settings.autoHideDelay)),t.onChange(r=>ye(this,null,function*(){this.plugin.settings.autoHideDelay=Number(r),this.plugin.saveSettings()}))}),new Pe.Setting(e).setName("Drag Start Delay (ms)").setDesc("How long to wait before triggering the drag behavior after clicking. \u26A0\uFE0F Requires an app restart.").addText(t=>{t.setPlaceholder(String(200)),t.inputEl.type="number",t.setValue(String(this.plugin.settings.dragDelay)),t.onChange(r=>ye(this,null,function*(){this.plugin.settings.dragDelay=Number(r),this.plugin.saveSettings()}))})}};function Zr(n,e){for(var t=[];n=n.previousSibling;)n.nodeType!==3&&(!e||e(n))&&t.push(n);return t}function en(n,e){for(var t=[];n=n.nextSibling;)n.nodeType!==3&&(!e||e(n))&&t.push(n);return t}function tn(n,e){var i,o;let t=(e==null?void 0:e.useClass)?Array.from(n.classList).filter(s=>!s.startsWith("is-")).sort().join(" "):"",r=((e==null?void 0:e.useTag)?n.tagName:"")+((e==null?void 0:e.useClass)?t:"")+((e==null?void 0:e.useText)?n.textContent:"")+((e==null?void 0:e.useAria)?n.getAttr("aria-label"):"")+((e==null?void 0:e.useIcon)?(o=(i=n.querySelector("svg"))==null?void 0:i.className)==null?void 0:o.baseVal:"");return Mi(r)}var Mi=function(n,e=0){let t=3735928559^e,r=1103547991^e;for(let i=0,o;i<n.length;i++)o=n.charCodeAt(i),t=Math.imul(t^o,2654435761),r=Math.imul(r^o,1597334677);return t=Math.imul(t^t>>>16,2246822507)^Math.imul(r^r>>>13,3266489909),r=Math.imul(r^r>>>16,2246822507)^Math.imul(t^t>>>13,3266489909),4294967296*(2097151&r)+(t>>>0).toString()};function St(n,e,t,r=1){return n.splice(t,0,...n.splice(e,r)),n}var wt=n=>{let e=[];return n.reduce((t,r)=>(r.children?r.children.length&&(e=[...e,...r.children]):t.push(r),t),[]).concat(e.length?wt(e):e)},rn=(n,e="suggestion-highlight")=>{let t=(i,o,s)=>{let a=o.split("."),l;for(l=0;l<a.length-1;l++)i=i[a[l]];i[a[l]]=s},r=(i,o=[])=>o.reduce((a,[l,c])=>(a[l]=`<span class="${e}">${a[l]}`,a[c]=`${a[c]}</span>`,a),i.split("")).join("");return n.filter(({matches:i})=>i&&i.length).map(({item:i,matches:o})=>{let s=he({},i);return o.forEach(a=>{var l;s.titleInnerEl.origContent||(s.titleInnerEl.origContent=s.titleInnerEl.textContent),t(s,"titleInnerEl.innerHTML",r(a.value,a.indices)),(l=s.titleInnerEl)==null||l.addClass("has-matches")}),s})};function nn(n){return typeof n=="string"||n instanceof String?n.replace(/.md$/,""):n}function on(n,e){var t=le.config.getFn(n,e);return Array.isArray(t)?t.map(r=>nn(r)):nn(t)}Ie.mount(new Vr);var Ai="body > div.app-container div.status-bar",Oi="body > div.app-container div.side-dock-actions",so=(x.Platform.isMobile,200),Ze=500,er=class extends x.Plugin{constructor(){super(...arguments);this.fileExplorerFilter=function(){var t,r,i;if(!!((t=this==null?void 0:this.rootEl)==null?void 0:t.fileExplorer))if(((r=this.filter)==null?void 0:r.length)>=1){this.filtered||(this.rootEl._children=this.rootEl.children,this.filtered=!0);let o={includeScore:!0,includeMatches:!0,useExtendedSearch:!0,getFn:on,threshold:.1,ignoreLocation:!0,keys:["file.path"]},s=wt(this.rootEl._children),a=new le(s,o),l=200,c=a.search(this.filter).slice(0,l);this.rootEl.children=rn(c)}else((i=this.filter)==null?void 0:i.length)<1&&this.filtered&&(this.rootEl._children&&(this.rootEl.children=this.rootEl._children),wt(this.rootEl._children).map(s=>{s.titleInnerEl.origContent&&(s.titleInnerEl.setText(s.titleInnerEl.origContent),delete s.titleInnerEl.origContent,s.titleInnerEl.removeClass("has-matches"))}),this.filtered=!1)}}onload(){return ye(this,null,function*(){yield this.loadSettings(),this.registerMonkeyPatches(),this.registerEventHandlers(),this.registerSettingsTab(),this.initialize()})}loadSettings(){return ye(this,null,function*(){this.settings=Object.assign({},Jr,yield this.loadData())})}saveSettings(){return ye(this,null,function*(){yield this.saveData(this.settings)})}patchFileExplorerFolder(){let e=this,t=this.app.workspace.getLeaf(),r=this.app.viewRegistry.viewByType["file-explorer"](t),i=new x.TFolder(x.Vault,""),o=r.createFolderDom(i).constructor;this.register(ge(o.prototype,{sort(s){return function(...a){let l=e.settings.fileExplorerOrder[this.file.path];return this.fileExplorer.sortOrder==="custom"?qr.call(this,l,...a):s.call(this,...a)}}}))}initialize(){this.app.workspace.onLayoutReady(()=>{this.patchFileExplorerFolder(),setTimeout(()=>{if(x.Platform.isDesktop){this.insertSeparator(Ai,"status-bar-item",!0,16),this.setStatusBarSorter();let e=this.app.workspace.leftSplit.children,t=this.app.workspace.rightSplit.children;e.concat(t).forEach(r=>{r.hasOwnProperty("tabsInnerEl")&&!r.iconSorter&&(r.iconSorter=this.setTabBarSorter(r.tabsInnerEl,r))})}this.setFileExplorerSorter(),this.insertSeparator(Oi,"side-dock-ribbon-action",!1,18),this.setRibbonBarSorter(),this.app.workspace.iterateRootLeaves(e=>{var t,r;((t=e==null?void 0:e.view)==null?void 0:t.hasOwnProperty("actionsEl"))&&!((r=e==null?void 0:e.view)==null?void 0:r.hasOwnProperty("iconSorter"))&&(e.view.iconSorter=this.setViewActionSorter(e.view.actionsEl,e.view))})},x.Platform.isMobile?3e3:400)})}registerSettingsTab(){this.settingsTab=new Zt(this.app,this),this.addSettingTab(this.settingsTab)}clearFileExplorerFilter(){let e=this.getFileExplorer(),t=document.body.querySelector('.workspace-leaf-content[data-type="file-explorer"] .search-input-container > input');t&&(t.value=""),e.dom.infinityScroll.filter="",e.dom.infinityScroll.compute()}registerEventHandlers(){this.registerEvent(this.app.workspace.on("file-explorer-draggable-change",e=>{this.toggleFileExplorerSorters(e)})),this.registerEvent(this.app.workspace.on("file-explorer-sort-change",e=>{e==="custom"?setTimeout(()=>{this.setFileExplorerSorter()},10):this.cleanupFileExplorerSorters()})),this.registerEvent(this.app.workspace.on("file-explorer-load",e=>{setTimeout(()=>{this.setFileExplorerSorter(e)},1e3)})),this.registerEvent(this.app.workspace.on("bartender-leaf-split",(e,t)=>{let r=t.tabsInnerEl;t.type==="tabs"&&t instanceof x.WorkspaceTabs&&this.setTabBarSorter(r,t)})),this.registerEvent(this.app.workspace.on("ribbon-bar-updated",()=>{setTimeout(()=>{this.settings.ribbonBarOrder&&this.ribbonBarSorter&&(this.setElementIDs(this.ribbonBarSorter.el,{useClass:!0,useAria:!0,useIcon:!0}),this.ribbonBarSorter.sort(this.settings.ribbonBarOrder))},0)})),this.registerEvent(this.app.workspace.on("status-bar-updated",()=>{setTimeout(()=>{this.settings.statusBarOrder&&this.statusBarSorter&&(this.setElementIDs(this.statusBarSorter.el,{useClass:!0,useIcon:!0}),this.statusBarSorter.sort(this.settings.statusBarOrder))},0)}))}registerMonkeyPatches(){let e=this;if(this.register(ge(this.app.viewRegistry.constructor.prototype,{registerView(t){return function(r,i,...o){return e.app.workspace.trigger("view-registered",r,i),t.call(this,r,i,...o)}}})),this.app.workspace.layoutReady){let t=this.getFileExplorer();this.patchFileExplorer(t)}else{let t=this.app.workspace.on("view-registered",(r,i)=>{if(r!=="file-explorer")return;this.app.workspace.offref(t);let o=new x.WorkspaceLeaf(e.app),s=i(o);this.patchFileExplorer(s)})}this.register(ge(x.View.prototype,{onunload(t){return function(...r){try{this.iconSorter&&(this.iconSorter.destroy(),this.iconSorter=null)}catch(i){}return t.call(this,...r)}},onload(t){return function(...r){return setTimeout(()=>{if(this.app.workspace.layoutReady)try{this.leaf.parentSplit instanceof x.WorkspaceTabs||this.hasOwnProperty("actionsEl")&&!this.iconSorter&&(this.iconSorter=e.setViewActionSorter(this.actionsEl,this))}catch(i){}},200),t.call(this,...r)}}})),x.Platform.isDesktop&&this.register(ge(HTMLDivElement.prototype,{addEventListener(t){return function(r,i,o){if(r==="mousedown"&&i instanceof Function&&this.hasClass("workspace-tab-header")){let a=i;i=l=>{l instanceof MouseEvent&&((l==null?void 0:l.altKey)||(l==null?void 0:l.metaKey))||a(l)}}return t.call(this,r,i,o)}}})),this.register(ge(x.Workspace.prototype,{splitLeaf(t){return function(r,i,o,s,...a){let l=t.call(this,r,i,o,s,...a);return this.trigger("bartender-leaf-split",r,i),l}},changeLayout(t){return function(r,...i){return ye(this,null,function*(){let o=yield t.call(this,r,...i);return this.trigger("bartender-workspace-change"),o})}}})),this.register(ge(x.Plugin.prototype,{addStatusBarItem(t){return function(...r){let i=t.call(this,...r);return this.app.workspace.trigger("status-bar-updated"),i}},addRibbonIcon(t){return function(...r){let i=t.call(this,...r);return this.app.workspace.trigger("ribbon-bar-updated"),i}}}))}patchFileExplorer(e){let t=this;if(e){let r=e.dom.infinityScroll.constructor;this.register(()=>this.clearFileExplorerFilter()),this.register(ge(r.prototype,{compute(i){return function(...o){try{this.scrollEl.hasClass("nav-files-container")&&t.fileExplorerFilter.call(this)}catch(a){}return i.call(this,...o)}}})),this.register(ge(e.headerDom.constructor.prototype,{addSortButton(i){return function(...o){var s,a,l;return((l=(a=(s=this.navHeaderEl)==null?void 0:s.parentElement)==null?void 0:a.dataset)==null?void 0:l.type)==="file-explorer"?(t.setFileExplorerFilter(this),Qr.call(this,...o)):i.call(this,...o)}}}))}}insertSeparator(e,t,r,i=16){document.body.querySelectorAll(e).forEach(s=>{let a=r?Zr:en;if(s){let l=s.createDiv(`${t} separator`);r&&s.prepend(l);let c=l.createDiv("glyph");(0,x.setIcon)(c,"plus-with-circle",i),l.addClass("is-collapsed"),this.register(()=>l.detach());let h;l.onClickEvent(d=>{l.hasClass("is-collapsed")?(Array.from(s.children).forEach(p=>p.removeClass("is-hidden")),l.removeClass("is-collapsed")):(a(l).forEach(p=>p.addClass("is-hidden")),l.addClass("is-collapsed"))}),s.onmouseenter=d=>{h&&clearTimeout(h)},s.onmouseleave=d=>{this.settings.autoHide&&(h=setTimeout(()=>{a(l).forEach(p=>p.addClass("is-hidden")),l.addClass("is-collapsed")},this.settings.autoHideDelay))},setTimeout(()=>{a(l).forEach(d=>d.addClass("is-hidden")),l.addClass("is-collapsed")},0)}})}setElementIDs(e,t){Array.from(e.children).forEach(r=>{r instanceof HTMLElement&&(r.getAttribute("data-id")||r.setAttribute("data-id",tn(r,t)))})}setTabBarSorter(e,t){return this.setElementIDs(e,{useClass:!0,useIcon:!0}),Ie.create(e,{group:"leftTabBar",dataIdAttr:"data-id",delay:x.Platform.isMobile?200:this.settings.dragDelay,dropBubble:!1,dragoverBubble:!1,animation:Ze,onChoose:()=>{var i;return(i=e.parentElement)==null?void 0:i.addClass("is-dragging")},onUnchoose:()=>{var i;return(i=e.parentElement)==null?void 0:i.removeClass("is-dragging")},onStart:()=>{var i;document.body.addClass("is-dragging"),(i=e.querySelector(".separator"))==null||i.removeClass("is-collapsed"),Array.from(e.children).forEach(o=>o.removeClass("is-hidden"))},onEnd:i=>{document.body.removeClass("is-dragging"),i.oldIndex!==void 0&&i.newIndex!==void 0&&(St(t.children,i.oldIndex,i.newIndex),t.currentTab=i.newIndex,t.recomputeChildrenDimensions()),this.app.workspace.requestSaveLayout()}})}setStatusBarSorter(){let e=document.body.querySelector("body > div.app-container > div.status-bar");e&&(this.setElementIDs(e,{useClass:!0,useAria:!0,useIcon:!0}),this.statusBarSorter=Ie.create(e,{group:"statusBar",dataIdAttr:"data-id",delay:x.Platform.isMobile?200:this.settings.dragDelay,animation:Ze,onChoose:()=>{Array.from(e.children).forEach(t=>t.removeClass("is-hidden"))},onStart:()=>{var t;(t=e.querySelector(".separator"))==null||t.removeClass("is-collapsed"),Array.from(e.children).forEach(r=>r.removeClass("is-hidden"))},store:{get:t=>this.settings.statusBarOrder,set:t=>{this.settings.statusBarOrder=t.toArray(),this.saveSettings()}}}))}setViewActionSorter(e,t){if(this.setElementIDs(e,{useClass:!0,useIcon:!0}),Object.values(e).find(s=>s==null?void 0:s.hasOwnProperty("nativeDraggable")))return;let i=(t==null?void 0:t.getViewType())||"unknown";return new Ie(e,{group:"actionBar",dataIdAttr:"data-id",delay:x.Platform.isMobile?200:this.settings.dragDelay,sort:!0,animation:Ze,onStart:()=>{var s;(s=e.querySelector(".separator"))==null||s.removeClass("is-collapsed"),Array.from(e.children).forEach(a=>a.removeClass("is-hidden"))},store:{get:()=>this.settings.actionBarOrder[i],set:s=>{this.settings.actionBarOrder[i]=s.toArray(),this.saveSettings()}}})}setRibbonBarSorter(){let e=document.body.querySelector("body > div.app-container div.side-dock-actions");e&&(this.setElementIDs(e,{useClass:!0,useAria:!0,useIcon:!0}),this.ribbonBarSorter=Ie.create(e,{group:"ribbonBar",dataIdAttr:"data-id",delay:x.Platform.isMobile?200:this.settings.dragDelay,animation:Ze,onChoose:()=>{Array.from(e.children).forEach(t=>t.removeClass("is-hidden"))},onStart:()=>{var t;(t=e.querySelector(".separator"))==null||t.removeClass("is-collapsed"),Array.from(e.children).forEach(r=>r.removeClass("is-hidden"))},store:{get:t=>this.settings.ribbonBarOrder,set:t=>{this.settings.ribbonBarOrder=t.toArray(),this.saveSettings()}}}))}setFileExplorerFilter(e){let t=e.navHeaderEl;if(t){let r=t.createDiv("search-input-container");t.insertAdjacentElement("afterend",r);let i=r.createEl("input");i.placeholder="Type to filter...",i.type="text",r.hide(),i.oninput=s=>{let a=this.getFileExplorer();s.target instanceof HTMLInputElement&&(s.target.value.length?o.show():o.hide(),a.dom.infinityScroll.filter=s.target.value),a.dom.infinityScroll.compute()};let o=r.createDiv("search-input-clear-button",function(s){s.addEventListener("click",function(){i.value="",o.hide(),i.focus(),i.dispatchEvent(new Event("input"))}),s.hide()})}}setFileExplorerSorter(e){var r;if(e||(e=this.getFileExplorer()),!e||e.sortOrder!=="custom"||e.hasCustomSorter)return;let t=this.getRootFolders(e);if(!(!t||!t.length))for(let i of t){let o=i==null?void 0:i.childrenEl;if(!o)continue;let s;e.hasCustomSorter=!0;let a=!!((r=document.body.querySelector("div.nav-action-button.drag-to-rearrange"))==null?void 0:r.hasClass("is-active"));i.sorter=Ie.create(o,{group:"fileExplorer"+i.file.path,multiDrag:!0,multiDragKey:"alt",delay:x.Platform.isMobile?200:this.settings.dragDelay,sort:a,animation:Ze,onStart:l=>{l.items.length?s=l.items:s=[l.item]},onMove:l=>{if(!i.children||!(s==null?void 0:s.length))return;let c=i.children.map(b=>b.el),u=l.related,h=c.indexOf(u),d=s.first(),p=c.indexOf(d),g=s.slice();p>h&&g.reverse();for(let b of g){let C=c.indexOf(b);i.children=St(i.children,C,h),c=St(c,C,h)}this.settings.fileExplorerOrder[i.file.path]=i.children.map(b=>b.file.path),this.saveSettings()},onEnd:l=>{var c;s=[],(c=document.querySelector("body>div.drag-ghost"))==null||c.detach()}})}}getFileExplorer(){var t,r;return(r=(t=this.app.workspace.getLeavesOfType("file-explorer"))==null?void 0:t.first())==null?void 0:r.view}getRootFolders(e){var i,o;if(e||(e=this.getFileExplorer()),!e)return;let t=(o=(i=e.dom)==null?void 0:i.infinityScroll)==null?void 0:o.rootEl;return t&&this.traverseRoots(t)}traverseRoots(e,t){t||(t=[e]);for(let r of e.children||[])r.children&&t.push(r),this.traverseRoots(r,t);return t}toggleFileExplorerSorters(e){let t=this.getFileExplorer(),r=this.getRootFolders(t);if(r==null?void 0:r.length)for(let i of r)i.sorter&&i.sorter.option("sort",e)}cleanupFileExplorerSorters(){let e=this.getFileExplorer(),t=this.getRootFolders(e);if(t==null?void 0:t.length)for(let r of t)r.sorter&&(r.sorter.destroy(),delete r.sorter,Object.keys(r.childrenEl).forEach(i=>i.startsWith("Sortable")&&delete r.childrenEl[i]),r.childrenEl.querySelectorAll("div.nav-file-title").forEach(i=>i.draggable=!0),r.childrenEl.querySelectorAll("div.nav-folder-title").forEach(i=>i.draggable=!0));delete e.hasCustomSorter}onunload(){var e,t;(e=this.statusBarSorter)==null||e.destroy(),(t=this.ribbonBarSorter)==null||t.destroy(),this.app.workspace.iterateAllLeaves(r=>{var o,s,a;let i;if((i=(r==null?void 0:r.iconSorter)?r:!1)||(i=((o=r==null?void 0:r.view)==null?void 0:o.iconSorter)?r.view:!1)||(i=(r==null?void 0:r.parentSplit)instanceof x.WorkspaceTabs&&((s=r==null?void 0:r.parentSplit)==null?void 0:s.iconSorter)?r==null?void 0:r.parentSplit:!1))try{(a=i.iconSorter)==null||a.destroy()}catch(l){}finally{delete i.iconSorter}}),this.cleanupFileExplorerSorters()}};
/**!
* Sortable 1.14.0
* @author RubaXa <trash@rubaxa.org>
* @author owenm <owen23355@gmail.com>
* @license MIT
*/