@brftech/filex 0.7.6 → 0.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{ArchiveViewer-CRNYNvBQ.js → ArchiveViewer-dhyEJGoA.js} +2 -2
- package/dist/{ArchiveViewer-CRNYNvBQ.js.map → ArchiveViewer-dhyEJGoA.js.map} +1 -1
- package/dist/{CsvViewer-Xq5HT-xk.js → CsvViewer-CXNTcpS1.js} +2 -2
- package/dist/{CsvViewer-Xq5HT-xk.js.map → CsvViewer-CXNTcpS1.js.map} +1 -1
- package/dist/{DrawioViewer-BF1QfKNh.js → DrawioViewer-Qi79q1_e.js} +2 -2
- package/dist/{DrawioViewer-BF1QfKNh.js.map → DrawioViewer-Qi79q1_e.js.map} +1 -1
- package/dist/{EpubViewer-nUYQFSXO.js → EpubViewer-BYPM7kAx.js} +2 -2
- package/dist/{EpubViewer-nUYQFSXO.js.map → EpubViewer-BYPM7kAx.js.map} +1 -1
- package/dist/{IpynbViewer-VMWGdKRV.js → IpynbViewer-BdYRtrd1.js} +2 -2
- package/dist/{IpynbViewer-VMWGdKRV.js.map → IpynbViewer-BdYRtrd1.js.map} +1 -1
- package/dist/{MermaidViewer-uTQ8uD6s.js → MermaidViewer-B9sDQEEp.js} +2 -2
- package/dist/{MermaidViewer-uTQ8uD6s.js.map → MermaidViewer-B9sDQEEp.js.map} +1 -1
- package/dist/{PsdViewer-CP3Jb3Eq.js → PsdViewer-CuOyeBa8.js} +2 -2
- package/dist/{PsdViewer-CP3Jb3Eq.js.map → PsdViewer-CuOyeBa8.js.map} +1 -1
- package/dist/{TiffViewer-B6U7bc5d.js → TiffViewer-C006NhoB.js} +2 -2
- package/dist/{TiffViewer-B6U7bc5d.js.map → TiffViewer-C006NhoB.js.map} +1 -1
- package/dist/{Viewer3D-CcTHCVPD.js → Viewer3D-2DLrDPvE.js} +2 -2
- package/dist/{Viewer3D-CcTHCVPD.js.map → Viewer3D-2DLrDPvE.js.map} +1 -1
- package/dist/filex.js +1 -1
- package/dist/filex.umd.cjs +6 -6
- package/dist/filex.umd.cjs.map +1 -1
- package/dist/{index-CqPZUXjB.js → index-DKJAEESH.js} +495 -492
- package/dist/index-DKJAEESH.js.map +1 -0
- package/package.json +2 -2
- package/dist/index-CqPZUXjB.js.map +0 -1
package/dist/filex.umd.cjs
CHANGED
|
@@ -17,11 +17,11 @@
|
|
|
17
17
|
* @vue/runtime-dom v3.5.34
|
|
18
18
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
19
19
|
* @license MIT
|
|
20
|
-
**/let uf;const sv=typeof window<"u"&&window.trustedTypes;if(sv)try{uf=sv.createPolicy("vue",{createHTML:e=>e})}catch{}const lv=uf?e=>uf.createHTML(e):e=>e,D6="http://www.w3.org/2000/svg",z6="http://www.w3.org/1998/Math/MathML",Xa=typeof document<"u"?document:null,cv=Xa&&Xa.createElement("template"),I6={insert:(e,t,r)=>{t.insertBefore(e,r||null)},remove:e=>{const t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,r,n)=>{const a=t==="svg"?Xa.createElementNS(D6,e):t==="mathml"?Xa.createElementNS(z6,e):r?Xa.createElement(e,{is:r}):Xa.createElement(e);return e==="select"&&n&&n.multiple!=null&&a.setAttribute("multiple",n.multiple),a},createText:e=>Xa.createTextNode(e),createComment:e=>Xa.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>Xa.querySelector(e),setScopeId(e,t){e.setAttribute(t,"")},insertStaticContent(e,t,r,n,a,i){const o=r?r.previousSibling:t.lastChild;if(a&&(a===i||a.nextSibling))for(;t.insertBefore(a.cloneNode(!0),r),!(a===i||!(a=a.nextSibling)););else{cv.innerHTML=lv(n==="svg"?`<svg>${e}</svg>`:n==="mathml"?`<math>${e}</math>`:e);const s=cv.content;if(n==="svg"||n==="mathml"){const l=s.firstChild;for(;l.firstChild;)s.appendChild(l.firstChild);s.removeChild(l)}t.insertBefore(s,r)}return[o?o.nextSibling:t.firstChild,r?r.previousSibling:t.lastChild]}},Ci="transition",Qs="animation",el=Symbol("_vtc"),uv={name:String,type:String,css:{type:Boolean,default:!0},duration:[String,Number,Object],enterFromClass:String,enterActiveClass:String,enterToClass:String,appearFromClass:String,appearActiveClass:String,appearToClass:String,leaveFromClass:String,leaveActiveClass:String,leaveToClass:String},O6=kr({},c1,uv),Za=(e=>(e.displayName="Transition",e.props=O6,e))((e,{slots:t})=>ov(z_,P6(e),t)),io=(e,t=[])=>{kt(e)?e.forEach(r=>r(...t)):e&&e(...t)},fv=e=>e?kt(e)?e.some(t=>t.length>1):e.length>1:!1;function P6(e){const t={};for(const B in e)B in uv||(t[B]=e[B]);if(e.css===!1)return t;const{name:r="v",type:n,duration:a,enterFromClass:i=`${r}-enter-from`,enterActiveClass:o=`${r}-enter-active`,enterToClass:s=`${r}-enter-to`,appearFromClass:l=i,appearActiveClass:c=o,appearToClass:u=s,leaveFromClass:d=`${r}-leave-from`,leaveActiveClass:f=`${r}-leave-active`,leaveToClass:p=`${r}-leave-to`}=e,_=F6(a),h=_&&_[0],b=_&&_[1],{onBeforeEnter:v,onEnter:m,onEnterCancelled:y,onLeave:g,onLeaveCancelled:S,onBeforeAppear:M=v,onAppear:E=m,onAppearCancelled:w=y}=t,x=(B,F,K,te)=>{B._enterCancelled=te,oo(B,F?u:s),oo(B,F?c:o),K&&K()},C=(B,F)=>{B._isLeaving=!1,oo(B,d),oo(B,p),oo(B,f),F&&F()},D=B=>(F,K)=>{const te=B?E:m,J=()=>x(F,B,K);io(te,[F,J]),dv(()=>{oo(F,B?l:i),Ja(F,B?u:s),fv(te)||pv(F,n,h,J)})};return kr(t,{onBeforeEnter(B){io(v,[B]),Ja(B,i),Ja(B,o)},onBeforeAppear(B){io(M,[B]),Ja(B,l),Ja(B,c)},onEnter:D(!1),onAppear:D(!0),onLeave(B,F){B._isLeaving=!0;const K=()=>C(B,F);Ja(B,d),B._enterCancelled?(Ja(B,f),mv(B)):(mv(B),Ja(B,f)),dv(()=>{B._isLeaving&&(oo(B,d),Ja(B,p),fv(g)||pv(B,n,b,K))}),io(g,[B,K])},onEnterCancelled(B){x(B,!1,void 0,!0),io(y,[B])},onAppearCancelled(B){x(B,!0,void 0,!0),io(w,[B])},onLeaveCancelled(B){C(B),io(S,[B])}})}function F6(e){if(e==null)return null;if(sr(e))return[ff(e.enter),ff(e.leave)];{const t=ff(e);return[t,t]}}function ff(e){return Mu(e)}function Ja(e,t){t.split(/\s+/).forEach(r=>r&&e.classList.add(r)),(e[el]||(e[el]=new Set)).add(t)}function oo(e,t){t.split(/\s+/).forEach(n=>n&&e.classList.remove(n));const r=e[el];r&&(r.delete(t),r.size||(e[el]=void 0))}function dv(e){requestAnimationFrame(()=>{requestAnimationFrame(e)})}let R6=0;function pv(e,t,r,n){const a=e._endId=++R6,i=()=>{a===e._endId&&n()};if(r!=null)return setTimeout(i,r);const{type:o,timeout:s,propCount:l}=L6(e,t);if(!o)return n();const c=o+"end";let u=0;const d=()=>{e.removeEventListener(c,f),i()},f=p=>{p.target===e&&++u>=l&&d()};setTimeout(()=>{u<l&&d()},s+1),e.addEventListener(c,f)}function L6(e,t){const r=window.getComputedStyle(e),n=_=>(r[_]||"").split(", "),a=n(`${Ci}Delay`),i=n(`${Ci}Duration`),o=hv(a,i),s=n(`${Qs}Delay`),l=n(`${Qs}Duration`),c=hv(s,l);let u=null,d=0,f=0;t===Ci?o>0&&(u=Ci,d=o,f=i.length):t===Qs?c>0&&(u=Qs,d=c,f=l.length):(d=Math.max(o,c),u=d>0?o>c?Ci:Qs:null,f=u?u===Ci?i.length:l.length:0);const p=u===Ci&&/\b(?:transform|all)(?:,|$)/.test(n(`${Ci}Property`).toString());return{type:u,timeout:d,propCount:f,hasTransform:p}}function hv(e,t){for(;e.length<t.length;)e=e.concat(e);return Math.max(...t.map((r,n)=>vv(r)+vv(e[n])))}function vv(e){return e==="auto"?0:Number(e.slice(0,-1).replace(",","."))*1e3}function mv(e){return(e?e.ownerDocument:document).body.offsetHeight}function B6(e,t,r){const n=e[el];n&&(t=(t?[t,...n]:[...n]).join(" ")),t==null?e.removeAttribute("class"):r?e.setAttribute("class",t):e.className=t}const M0=Symbol("_vod"),gv=Symbol("_vsh"),df={name:"show",beforeMount(e,{value:t},{transition:r}){e[M0]=e.style.display==="none"?"":e.style.display,r&&t?r.beforeEnter(e):tl(e,t)},mounted(e,{value:t},{transition:r}){r&&t&&r.enter(e)},updated(e,{value:t,oldValue:r},{transition:n}){!t!=!r&&(n?t?(n.beforeEnter(e),tl(e,!0),n.enter(e)):n.leave(e,()=>{tl(e,!1)}):tl(e,t))},beforeUnmount(e,{value:t}){tl(e,t)}};function tl(e,t){e.style.display=t?e[M0]:"none",e[gv]=!t}const $6=Symbol(""),N6=/(?:^|;)\s*display\s*:/;function U6(e,t,r){const n=e.style,a=vr(r);let i=!1;if(r&&!a){if(t)if(vr(t))for(const o of t.split(";")){const s=o.slice(0,o.indexOf(":")).trim();r[s]==null&&rl(n,s,"")}else for(const o in t)r[o]==null&&rl(n,o,"");for(const o in r){o==="display"&&(i=!0);const s=r[o];s!=null?j6(e,o,!vr(t)&&t?t[o]:void 0,s)||rl(n,o,s):rl(n,o,"")}}else if(a){if(t!==r){const o=n[$6];o&&(r+=";"+o),n.cssText=r,i=N6.test(r)}}else t&&e.removeAttribute("style");M0 in e&&(e[M0]=i?n.display:"",e[gv]&&(n.display="none"))}const bv=/\s*!important$/;function rl(e,t,r){if(kt(r))r.forEach(n=>rl(e,t,n));else if(r==null&&(r=""),t.startsWith("--"))e.setProperty(t,r);else{const n=H6(e,t);bv.test(r)?e.setProperty(kn(n),r.replace(bv,""),"important"):e[n]=r}}const yv=["Webkit","Moz","ms"],pf={};function H6(e,t){const r=pf[t];if(r)return r;let n=jr(t);if(n!=="filter"&&n in e)return pf[t]=n;n=t0(n);for(let a=0;a<yv.length;a++){const i=yv[a]+n;if(i in e)return pf[t]=i}return t}function j6(e,t,r,n){return e.tagName==="TEXTAREA"&&(t==="width"||t==="height")&&vr(n)&&r===n}const _v="http://www.w3.org/1999/xlink";function xv(e,t,r,n,a,i=R5(t)){n&&t.startsWith("xlink:")?r==null?e.removeAttributeNS(_v,t.slice(6,t.length)):e.setAttributeNS(_v,t,r):r==null||i&&!Ch(r)?e.removeAttribute(t):e.setAttribute(t,i?"":ta(r)?String(r):r)}function wv(e,t,r,n,a){if(t==="innerHTML"||t==="textContent"){r!=null&&(e[t]=t==="innerHTML"?lv(r):r);return}const i=e.tagName;if(t==="value"&&i!=="PROGRESS"&&!i.includes("-")){const s=i==="OPTION"?e.getAttribute("value")||"":e.value,l=r==null?e.type==="checkbox"?"on":"":String(r);(s!==l||!("_value"in e))&&(e.value=l),r==null&&e.removeAttribute(t),e._value=r;return}let o=!1;if(r===""||r==null){const s=typeof e[t];s==="boolean"?r=Ch(r):r==null&&s==="string"?(r="",o=!0):s==="number"&&(r=0,o=!0)}try{e[t]=r}catch{}o&&e.removeAttribute(a||t)}function Ei(e,t,r,n){e.addEventListener(t,r,n)}function G6(e,t,r,n){e.removeEventListener(t,r,n)}const kv=Symbol("_vei");function V6(e,t,r,n,a=null){const i=e[kv]||(e[kv]={}),o=i[t];if(n&&o)o.value=n;else{const[s,l]=q6(t);if(n){const c=i[t]=Y6(n,a);Ei(e,s,c,l)}else o&&(G6(e,s,o,l),i[t]=void 0)}}const Sv=/(?:Once|Passive|Capture)$/;function q6(e){let t;if(Sv.test(e)){t={};let n;for(;n=e.match(Sv);)e=e.slice(0,e.length-n[0].length),t[n[0].toLowerCase()]=!0}return[e[2]===":"?e.slice(3):kn(e.slice(2)),t]}let hf=0;const K6=Promise.resolve(),W6=()=>hf||(K6.then(()=>hf=0),hf=Date.now());function Y6(e,t){const r=n=>{if(!n._vts)n._vts=Date.now();else if(n._vts<=r.attached)return;aa(X6(n,r.value),t,5,[n])};return r.value=e,r.attached=W6(),r}function X6(e,t){if(kt(t)){const r=e.stopImmediatePropagation;return e.stopImmediatePropagation=()=>{r.call(e),e._stopped=!0},t.map(n=>a=>!a._stopped&&n&&n(a))}else return t}const Cv=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123,Z6=(e,t,r,n,a,i)=>{const o=a==="svg";t==="class"?B6(e,n,o):t==="style"?U6(e,r,n):Zl(t)?Jl(t)||V6(e,t,r,n,i):(t[0]==="."?(t=t.slice(1),!0):t[0]==="^"?(t=t.slice(1),!1):J6(e,t,n,o))?(wv(e,t,n),!e.tagName.includes("-")&&(t==="value"||t==="checked"||t==="selected")&&xv(e,t,n,o,i,t!=="value")):e._isVueCE&&(Q6(e,t)||e._def.__asyncLoader&&(/[A-Z]/.test(t)||!vr(n)))?wv(e,jr(t),n,i,t):(t==="true-value"?e._trueValue=n:t==="false-value"&&(e._falseValue=n),xv(e,t,n,o))};function J6(e,t,r,n){if(n)return!!(t==="innerHTML"||t==="textContent"||t in e&&Cv(t)&&Mt(r));if(t==="spellcheck"||t==="draggable"||t==="translate"||t==="autocorrect"||t==="sandbox"&&e.tagName==="IFRAME"||t==="form"||t==="list"&&e.tagName==="INPUT"||t==="type"&&e.tagName==="TEXTAREA")return!1;if(t==="width"||t==="height"){const a=e.tagName;if(a==="IMG"||a==="VIDEO"||a==="CANVAS"||a==="SOURCE")return!1}return Cv(t)&&vr(r)?!1:t in e}function Q6(e,t){const r=e._def.props;if(!r)return!1;const n=jr(t);return Array.isArray(r)?r.some(a=>jr(a)===n):Object.keys(r).some(a=>jr(a)===n)}const Ev={};function ex(e,t,r){let n=Pt(e,t);Ql(n)&&(n=kr({},n,t));class a extends vf{constructor(o){super(n,o,r)}}return a.def=n,a}const tx=typeof HTMLElement<"u"?HTMLElement:class{};class vf extends tx{constructor(t,r={},n=Pv){super(),this._def=t,this._props=r,this._createApp=n,this._isVueCE=!0,this._instance=null,this._app=null,this._nonce=this._def.nonce,this._connected=!1,this._resolved=!1,this._patching=!1,this._dirty=!1,this._numberProps=null,this._styleChildren=new WeakSet,this._styleAnchors=new WeakMap,this._ob=null,this.shadowRoot&&n!==Pv?this._root=this.shadowRoot:t.shadowRoot!==!1?(this.attachShadow(kr({},t.shadowRootOptions,{mode:"open"})),this._root=this.shadowRoot):this._root=this}connectedCallback(){if(!this.isConnected)return;!this.shadowRoot&&!this._resolved&&this._parseSlots(),this._connected=!0;let t=this;for(;t=t&&(t.assignedSlot||t.parentNode||t.host);)if(t instanceof vf){this._parent=t;break}this._instance||(this._resolved?this._mount(this._def):t&&t._pendingResolve?this._pendingResolve=t._pendingResolve.then(()=>{this._pendingResolve=void 0,this._resolveDef()}):this._resolveDef())}_setParent(t=this._parent){t&&(this._instance.parent=t._instance,this._inheritParentContext(t))}_inheritParentContext(t=this._parent){t&&this._app&&Object.setPrototypeOf(this._app._context.provides,t._instance.provides)}disconnectedCallback(){this._connected=!1,Nr(()=>{this._connected||(this._ob&&(this._ob.disconnect(),this._ob=null),this._app&&this._app.unmount(),this._instance&&(this._instance.ce=void 0),this._app=this._instance=null,this._teleportTargets&&(this._teleportTargets.clear(),this._teleportTargets=void 0))})}_processMutations(t){for(const r of t)this._setAttr(r.attributeName)}_resolveDef(){if(this._pendingResolve)return;for(let n=0;n<this.attributes.length;n++)this._setAttr(this.attributes[n].name);this._ob=new MutationObserver(this._processMutations.bind(this)),this._ob.observe(this,{attributes:!0});const t=(n,a=!1)=>{this._resolved=!0,this._pendingResolve=void 0;const{props:i,styles:o}=n;let s;if(i&&!kt(i))for(const l in i){const c=i[l];(c===Number||c&&c.type===Number)&&(l in this._props&&(this._props[l]=Mu(this._props[l])),(s||(s=Object.create(null)))[jr(l)]=!0)}this._numberProps=s,this._resolveProps(n),this.shadowRoot&&this._applyStyles(o),this._mount(n)},r=this._def.__asyncLoader;r?this._pendingResolve=r().then(n=>{n.configureApp=this._def.configureApp,t(this._def=n,!0)}):t(this._def)}_mount(t){this._app=this._createApp(t),this._inheritParentContext(),t.configureApp&&t.configureApp(this._app),this._app._ceVNode=this._createVNode(),this._app.mount(this._root);const r=this._instance&&this._instance.exposed;if(r)for(const n in r)er(this,n)||Object.defineProperty(this,n,{get:()=>Y(r[n])})}_resolveProps(t){const{props:r}=t,n=kt(r)?r:Object.keys(r||{});for(const a of Object.keys(this))a[0]!=="_"&&n.includes(a)&&this._setProp(a,this[a]);for(const a of n.map(jr))Object.defineProperty(this,a,{get(){return this._getProp(a)},set(i){this._setProp(a,i,!0,!this._patching)}})}_setAttr(t){if(t.startsWith("data-v-"))return;const r=this.hasAttribute(t);let n=r?this.getAttribute(t):Ev;const a=jr(t);r&&this._numberProps&&this._numberProps[a]&&(n=Mu(n)),this._setProp(a,n,!1,!0)}_getProp(t){return this._props[t]}_setProp(t,r,n=!0,a=!1){if(r!==this._props[t]&&(this._dirty=!0,r===Ev?delete this._props[t]:(this._props[t]=r,t==="key"&&this._app&&(this._app._ceVNode.key=r)),a&&this._instance&&this._update(),n)){const i=this._ob;i&&(this._processMutations(i.takeRecords()),i.disconnect()),r===!0?this.setAttribute(kn(t),""):typeof r=="string"||typeof r=="number"?this.setAttribute(kn(t),r+""):r||this.removeAttribute(kn(t)),i&&i.observe(this,{attributes:!0})}}_update(){const t=this._createVNode();this._app&&(t.appContext=this._app._context),sx(t,this._root)}_createVNode(){const t={};this.shadowRoot||(t.onVnodeMounted=t.onVnodeUpdated=this._renderSlots.bind(this));const r=Dt(this._def,kr(t,this._props));return this._instance||(r.ce=n=>{this._instance=n,n.ce=this,n.isCE=!0;const a=(i,o)=>{this.dispatchEvent(new CustomEvent(i,Ql(o[0])?kr({detail:o},o[0]):{detail:o}))};n.emit=(i,...o)=>{a(i,o),kn(i)!==i&&a(kn(i),o)},this._setParent()}),r}_applyStyles(t,r,n){if(!t)return;if(r){if(r===this._def||this._styleChildren.has(r))return;this._styleChildren.add(r)}const a=this._nonce,i=this.shadowRoot,o=n?this._getStyleAnchor(n)||this._getStyleAnchor(this._def):this._getRootStyleInsertionAnchor(i);let s=null;for(let l=t.length-1;l>=0;l--){const c=document.createElement("style");a&&c.setAttribute("nonce",a),c.textContent=t[l],i.insertBefore(c,s||o),s=c,l===0&&(n||this._styleAnchors.set(this._def,c),r&&this._styleAnchors.set(r,c))}}_getStyleAnchor(t){if(!t)return null;const r=this._styleAnchors.get(t);return r&&r.parentNode===this.shadowRoot?r:(r&&this._styleAnchors.delete(t),null)}_getRootStyleInsertionAnchor(t){for(let r=0;r<t.childNodes.length;r++){const n=t.childNodes[r];if(!(n instanceof HTMLStyleElement))return n}return null}_parseSlots(){const t=this._slots={};let r;for(;r=this.firstChild;){const n=r.nodeType===1&&r.getAttribute("slot")||"default";(t[n]||(t[n]=[])).push(r),this.removeChild(r)}}_renderSlots(){const t=this._getSlots(),r=this._instance.type.__scopeId;for(let n=0;n<t.length;n++){const a=t[n],i=a.getAttribute("name")||"default",o=this._slots[i],s=a.parentNode;if(o)for(const l of o){if(r&&l.nodeType===1){const c=r+"-s",u=document.createTreeWalker(l,1);l.setAttribute(c,"");let d;for(;d=u.nextNode();)d.setAttribute(c,"")}s.insertBefore(l,a)}else for(;a.firstChild;)s.insertBefore(a.firstChild,a);s.removeChild(a)}}_getSlots(){const t=[this];this._teleportTargets&&t.push(...this._teleportTargets);const r=new Set;for(const n of t){const a=n.querySelectorAll("slot");for(let i=0;i<a.length;i++)r.add(a[i])}return Array.from(r)}_injectChildStyle(t,r){this._applyStyles(t.styles,t,r)}_beginPatch(){this._patching=!0,this._dirty=!1}_endPatch(){this._patching=!1,this._dirty&&this._instance&&this._update()}_hasShadowRoot(){return this._def.shadowRoot!==!1}_removeChildStyle(t){}}const $o=e=>{const t=e.props["onUpdate:modelValue"]||!1;return kt(t)?r=>r0(t,r):t};function rx(e){e.target.composing=!0}function Av(e){const t=e.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event("input")))}const Qa=Symbol("_assign");function Tv(e,t,r){return t&&(e=e.trim()),r&&(e=n0(e)),e}const Ir={created(e,{modifiers:{lazy:t,trim:r,number:n}},a){e[Qa]=$o(a);const i=n||a.props&&a.props.type==="number";Ei(e,t?"change":"input",o=>{o.target.composing||e[Qa](Tv(e.value,r,i))}),(r||i)&&Ei(e,"change",()=>{e.value=Tv(e.value,r,i)}),t||(Ei(e,"compositionstart",rx),Ei(e,"compositionend",Av),Ei(e,"change",Av))},mounted(e,{value:t}){e.value=t??""},beforeUpdate(e,{value:t,oldValue:r,modifiers:{lazy:n,trim:a,number:i}},o){if(e[Qa]=$o(o),e.composing)return;const s=(i||e.type==="number")&&!/^0\d/.test(e.value)?n0(e.value):e.value,l=t??"";if(s===l)return;const c=e.getRootNode();(c instanceof Document||c instanceof ShadowRoot)&&c.activeElement===e&&e.type!=="range"&&(n&&t===r||a&&e.value.trim()===l)||(e.value=l)}},No={deep:!0,created(e,t,r){e[Qa]=$o(r),Ei(e,"change",()=>{const n=e._modelValue,a=nl(e),i=e.checked,o=e[Qa];if(kt(n)){const s=Du(n,a),l=s!==-1;if(i&&!l)o(n.concat(a));else if(!i&&l){const c=[...n];c.splice(s,1),o(c)}}else if(Do(n)){const s=new Set(n);i?s.add(a):s.delete(a),o(s)}else o(zv(e,i))})},mounted:Mv,beforeUpdate(e,t,r){e[Qa]=$o(r),Mv(e,t,r)}};function Mv(e,{value:t,oldValue:r},n){e._modelValue=t;let a;if(kt(t))a=Du(t,n.props.value)>-1;else if(Do(t))a=t.has(n.props.value);else{if(t===r)return;a=zo(t,zv(e,!0))}e.checked!==a&&(e.checked=a)}const D0={deep:!0,created(e,{value:t,modifiers:{number:r}},n){const a=Do(t);Ei(e,"change",()=>{const i=Array.prototype.filter.call(e.options,o=>o.selected).map(o=>r?n0(nl(o)):nl(o));e[Qa](e.multiple?a?new Set(i):i:i[0]),e._assigning=!0,Nr(()=>{e._assigning=!1})}),e[Qa]=$o(n)},mounted(e,{value:t}){Dv(e,t)},beforeUpdate(e,t,r){e[Qa]=$o(r)},updated(e,{value:t}){e._assigning||Dv(e,t)}};function Dv(e,t){const r=e.multiple,n=kt(t);if(!(r&&!n&&!Do(t))){for(let a=0,i=e.options.length;a<i;a++){const o=e.options[a],s=nl(o);if(r)if(n){const l=typeof s;l==="string"||l==="number"?o.selected=t.some(c=>String(c)===String(s)):o.selected=Du(t,s)>-1}else o.selected=t.has(s);else if(zo(nl(o),t)){e.selectedIndex!==a&&(e.selectedIndex=a);return}}!r&&e.selectedIndex!==-1&&(e.selectedIndex=-1)}}function nl(e){return"_value"in e?e._value:e.value}function zv(e,t){const r=t?"_trueValue":"_falseValue";return r in e?e[r]:t}const nx=["ctrl","shift","alt","meta"],ax={stop:e=>e.stopPropagation(),prevent:e=>e.preventDefault(),self:e=>e.target!==e.currentTarget,ctrl:e=>!e.ctrlKey,shift:e=>!e.shiftKey,alt:e=>!e.altKey,meta:e=>!e.metaKey,left:e=>"button"in e&&e.button!==0,middle:e=>"button"in e&&e.button!==1,right:e=>"button"in e&&e.button!==2,exact:(e,t)=>nx.some(r=>e[`${r}Key`]&&!t.includes(r))},Ht=(e,t)=>{if(!e)return e;const r=e._withMods||(e._withMods={}),n=t.join(".");return r[n]||(r[n]=(a,...i)=>{for(let o=0;o<t.length;o++){const s=ax[t[o]];if(s&&s(a,t))return}return e(a,...i)})},ix={esc:"escape",space:" ",up:"arrow-up",left:"arrow-left",right:"arrow-right",down:"arrow-down",delete:"backspace"},un=(e,t)=>{const r=e._withKeys||(e._withKeys={}),n=t.join(".");return r[n]||(r[n]=a=>{if(!("key"in a))return;const i=kn(a.key);if(t.some(o=>o===i||ix[o]===i))return e(a)})},ox=kr({patchProp:Z6},I6);let Iv;function Ov(){return Iv||(Iv=f6(ox))}const sx=(...e)=>{Ov().render(...e)},Pv=(...e)=>{const t=Ov().createApp(...e),{mount:r}=t;return t.mount=n=>{const a=cx(n);if(!a)return;const i=t._component;!Mt(i)&&!i.render&&!i.template&&(i.template=a.innerHTML),a.nodeType===1&&(a.textContent="");const o=r(a,!1,lx(a));return a instanceof Element&&(a.removeAttribute("v-cloak"),a.setAttribute("data-v-app","")),o},t};function lx(e){if(e instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&e instanceof MathMLElement)return"mathml"}function cx(e){return vr(e)?document.querySelector(e):e}function Fv(e){return!!e&&e.enabled&&e.state==="ok"}function ux(e){const t=e.apiBase!=null?e.apiBase.replace(/\/+$/,""):null;function r(a,i){return a||(t===null?null:`${t}${i}`)}const n=e.endpoint??(t!==null?`${t}/api/files/manager`:null);if(!n)throw new Error("[@brftech/filex-core] config requires either `apiBase` or `endpoint`");return{manager:n,uploadInit:r(e.uploadInit,"/api/files/upload/init"),uploadFinalize:r(e.uploadFinalize,"/api/files/upload/finalize"),uploadAbort:r(e.uploadAbort,"/api/files/upload/abort"),shareCreate:r(e.shareCreate,"/api/files/share"),shareList:r(e.shareList,"/api/files/share"),shareDelete:r(e.shareDelete,"/api/files/share/{uuid}"),limits:r(e.limits,"/api/files/limits"),capabilities:r(e.capabilities,"/api/files/capabilities"),archiveList:r(e.archiveList,"/api/files/archive/list"),archiveExtract:r(e.archiveExtract,"/api/files/archive/extract"),archiveAdd:r(e.archiveAdd,"/api/files/archive/add"),copy:r(e.copy,"/api/files/copy"),moveAsync:r(e.moveAsync,"/api/files/move"),deleteAsync:r(e.deleteAsync,"/api/files/delete"),opsList:r(e.opsList,"/api/files/ops"),opsShow:r(e.opsShow,"/api/files/ops/{id}"),onlyOfficeConfig:r(e.onlyOfficeConfig,"/api/files/onlyoffice/config"),saveText:r(e.saveText,"/api/files/save-text"),restore:r(e.restore,"/api/files/restore"),trashList:r(e.trashList,"/api/files/manager/trash"),trashRestore:r(e.trashRestore,"/api/files/manager/restore")}}async function fx(e){if(typeof e=="function"){const t=e();return t instanceof Promise?await t:t}return e}function dx(e){return e?"kind"in e?e:e.type==="bearer"?{kind:"bearer",token:e.token}:e.type==="csrf"?{kind:"csrf",csrf:e.csrf}:{kind:"none"}:{kind:"none"}}function px(e){const t=ux(e),r=dx(e.auth);async function n(ee={}){const pe={Accept:"application/json",...ee};if(r.kind==="bearer"){const ve=await fx(r.token);ve&&(pe.Authorization=`Bearer ${ve}`)}else if(r.kind==="csrf")pe["X-CSRF-TOKEN"]=r.csrf,pe["X-Requested-With"]="XMLHttpRequest";else if(r.kind==="basic"){const ve=btoa(`${r.user}:${r.pass}`);pe.Authorization=`Basic ${ve}`}return pe}function a(ee={}){const pe={Accept:"application/json",...ee};if(r.kind==="bearer"&&typeof r.token=="string")pe.Authorization=`Bearer ${r.token}`;else if(r.kind==="csrf")pe["X-CSRF-TOKEN"]=r.csrf,pe["X-Requested-With"]="XMLHttpRequest";else if(r.kind==="basic"){const ve=btoa(`${r.user}:${r.pass}`);pe.Authorization=`Basic ${ve}`}return pe}function i(){return r.kind==="csrf"?"include":"same-origin"}function o(ee){const pe=(e.locale??"tr")!=="en",Pe={400:["Geçersiz istek","Bad request"],401:["Oturum gerekli, tekrar giriş yapın","Sign-in required"],403:["Bu işlem için yetkiniz yok","You are not allowed to do this"],404:["Bulunamadı","Not found"],409:["Zaten var / çakışma","Already exists / conflict"],413:["Dosya çok büyük","File too large"],415:["Bu dosya türü desteklenmiyor","Unsupported file type"],422:["Geçersiz veri","Invalid data"],429:["Çok fazla istek, biraz bekleyin","Too many requests"],500:["Sunucu hatası","Server error"],501:["Bu işlem desteklenmiyor","Not supported"],503:["Servis şu an kullanılamıyor","Service unavailable"]}[ee];return Pe?pe?Pe[0]:Pe[1]:pe?`Hata (${ee})`:`Error (${ee})`}async function s(ee,pe={}){const ve={...await n(),...pe.headers??{}},Pe=await fetch(ee,{...pe,headers:ve,credentials:i()});if(!Pe.ok){const Ge=await Pe.text().catch(()=>""),Ue=new Error(o(Pe.status));throw Ue.status=Pe.status,Ue.detail=Ge.slice(0,300),Ue}return Pe.json()}function l(ee=""){return t.manager.replace(/\/manager(\?.*)?$/,"/permissions")+ee}async function c(ee){return s(l()+"?path="+encodeURIComponent(ee))}async function u(ee){return s(l("/resolve")+"?email="+encodeURIComponent(ee))}async function d(ee){return s(l("/users")+"?q="+encodeURIComponent(ee))}async function f(ee){return s(l(),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(ee)})}async function p(ee,pe){return s(l("/"+ee),{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({level:pe})})}async function _(ee){return s(l("/"+ee),{method:"DELETE"})}async function h(ee){return s(l("/invite"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(ee)})}async function b(ee){return s(l("/share-mail"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(ee)})}function v(ee){const pe=new URLSearchParams;for(const[ve,Pe]of Object.entries(ee))Pe!=null&&pe.set(ve,String(Pe));return pe.toString()}function m(ee,pe={}){const ve=t.manager.includes("?")?"&":"?";return`${t.manager}${ve}${v({q:ee,action:ee,...pe})}`}async function y(ee){return s(m("index",{path:ee}))}async function g(ee,pe){return s(m("search",{path:ee,filter:pe}))}async function S(ee,pe={}){const ve=t.manager.replace(/\/manager(\?.*)?$/,"/search"),Pe=ve.includes("?")?"&":"?",Ge=`${ve}${Pe}${v({q:ee,limit:pe.limit,scope:pe.scope})}`,Ue=await s(Ge);return Array.isArray(Ue==null?void 0:Ue.results)?Ue.results:[]}async function M(ee){return s(m("subfolders",{path:ee}))}async function E(ee,pe){return s(m("newfolder"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:ee,name:pe})})}async function w(ee,pe,ve){return s(m("rename"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:ee,item:pe,name:ve})})}async function x(ee,pe,ve){return s(m("move"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:ee,item:ve,items:pe.map(Pe=>({path:Pe}))})})}async function C(ee,pe){return s(m("delete"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:ee,items:pe.map(ve=>({path:ve}))})})}async function D(ee,pe){if(!t.copy)throw new Error("copy endpoint not configured");return s(t.copy,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({source:ee,target:pe})})}async function B(ee,pe,ve){if(!t.moveAsync)throw new Error("moveAsync endpoint not configured");return s(t.moveAsync,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({source:ee,target:pe,sourceDir:ve})})}async function F(ee,pe){if(!t.deleteAsync)throw new Error("deleteAsync endpoint not configured");return s(t.deleteAsync,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({source:ee,sourceDir:pe})})}async function K(ee){if(!t.restore)throw new Error("restore endpoint not configured");return s(t.restore,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({source:ee})})}async function te(ee){if(!t.trashList)throw new Error("trashList endpoint not configured");const pe=t.trashList,ve=pe.includes("?")?"&":"?",Pe=ee?`${pe}${ve}storage=${encodeURIComponent(ee)}`:pe;return s(Pe)}async function J(ee){const pe=t.trashRestore;if(!pe)throw new Error("trashRestore endpoint not configured");let ve=0;for(const Pe of ee)try{await s(pe,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({node_id:Pe})}),ve++}catch{}return{restored:ve}}async function ne(ee,pe,ve){const Pe=new FormData;Pe.append("path",ee);for(const Ue of pe)Pe.append("file[]",Ue,Ue.name);const Ge=await n();return new Promise((Ue,We)=>{const rt=new XMLHttpRequest;rt.open("POST",m("upload"));for(const[lt,ft]of Object.entries(Ge))lt!=="Content-Type"&&rt.setRequestHeader(lt,ft);rt.withCredentials=i()==="include",rt.upload.onprogress=lt=>{ve&<.lengthComputable&&ve(Math.round(lt.loaded/lt.total*100))},rt.onload=()=>{if(rt.status>=200&&rt.status<300)try{Ue(JSON.parse(rt.responseText))}catch(lt){We(lt)}else We(new Error(`${rt.status} ${rt.statusText}: ${rt.responseText.slice(0,200)}`))},rt.onerror=()=>We(new Error("Network error")),rt.send(Pe)})}function le(ee){return m("download",{path:ee})}function q(ee){return m("preview",{path:ee})}async function j(ee){const pe=await n(),ve=await fetch(q(ee),{headers:pe,credentials:i()});if(!ve.ok){const We=await ve.text().catch(()=>"");throw new Error(`${ve.status} ${ve.statusText}${We?" — "+We.slice(0,200):""}`)}const Pe=await ve.blob(),Ge=Pe.type||ve.headers.get("content-type")||"";return{url:URL.createObjectURL(Pe),blob:Pe,mime:Ge}}async function P(ee){const pe=await n(),ve=await fetch(q(ee),{headers:pe,credentials:i()});if(!ve.ok){const Pe=await ve.text().catch(()=>"");throw new Error(`${ve.status} ${ve.statusText}${Pe?" — "+Pe.slice(0,200):""}`)}return ve.arrayBuffer()}async function N(){return t.limits?s(t.limits):{max_upload_mb:1024}}async function X(){return t.capabilities?s(t.capabilities):{ffmpeg:!1,ghostscript:!1,libreoffice:!1,max_chunk_mb:5,upload_limit_mb:1024,onlyoffice_url:e.onlyOfficeBase??null,drawio_url:e.drawioBase??null,convert_url:e.convertBase??null}}async function Ee(ee){if(!t.shareCreate)throw new Error("shareCreate endpoint not configured");return s(t.shareCreate,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(ee)})}async function Ae(ee){if(!t.shareList)return{shares:[]};const pe=t.shareList.includes("?")?"&":"?";return s(`${t.shareList}${pe}path=${encodeURIComponent(ee)}`)}async function ze(ee){if(!t.shareDelete)throw new Error("shareDelete endpoint not configured");const pe=t.shareDelete.replace("{uuid}",encodeURIComponent(ee));return s(pe,{method:"DELETE"})}async function Le(ee){if(!t.archiveList)throw new Error("archiveList endpoint not configured");return{entries:(await s(t.archiveList,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:ee})})).entries.map(ve=>({name:ve.name,size:ve.size,isDir:ve.is_dir,lastModified:ve.mtime}))}}async function he(ee,pe){if(!t.archiveExtract)throw new Error("archiveExtract endpoint not configured");return s(t.archiveExtract,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:ee,members:pe})})}async function Ie(ee,pe){if(!t.archiveAdd)throw new Error("archiveAdd endpoint not configured");return s(t.archiveAdd,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:ee,files:pe})})}function De(ee=""){return t.manager.replace(/\/manager(\?.*)?$/,"/versions")+ee}async function Be(ee){const pe=await s(De()+"?node_id="+encodeURIComponent(String(ee)));return Array.isArray(pe==null?void 0:pe.versions)?pe.versions:[]}async function Z(ee,pe,ve=!0){await s(De("/restore"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({node_id:ee,version_id:pe,snapshot_current:ve})})}async function se(ee){await s(De("/snapshot"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({node_id:ee})})}function we(ee=""){return t.manager.replace(/\/manager(\?.*)?$/,"/comments")+ee}async function Se(ee){const pe=await s(we()+"?node_id="+encodeURIComponent(String(ee)));return Array.isArray(pe==null?void 0:pe.comments)?pe.comments:[]}async function me(ee,pe){return(await s(we(),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({node_id:ee,body:pe})})).comment}async function ye(ee){await s(we("/"+encodeURIComponent(String(ee))),{method:"DELETE"})}async function xe(){const ee=t.manager.replace(/\/manager(\?.*)?$/,"/ws-ticket");try{return await s(ee,{method:"POST"})}catch{return null}}return{wsTicket:xe,index:y,search:g,globalSearch:S,subfolders:M,newFolder:E,rename:w,move:x,copy:D,moveAsync:B,deleteAsync:F,deleteItems:C,restore:K,listTrash:te,restoreIds:J,uploadMultipart:ne,downloadUrl:le,previewUrl:q,fetchBlob:j,fetchArrayBuffer:P,limits:N,capabilities:X,createShare:Ee,listShares:Ae,revokeShare:ze,archiveList:Le,archiveExtract:he,archiveAdd:Ie,listVersions:Be,restoreVersion:Z,snapshotVersion:se,listComments:Se,addComment:me,deleteComment:ye,listPermissions:c,resolveEmail:u,searchUsers:d,addPermission:f,updatePermission:p,deletePermission:_,invitePermission:h,shareMail:b,endpoints:t,authHeaders:n,authHeadersSync:a,credentialsMode:i,jsonFetch:s}}function hx(e,t){const r=e.chunkSize??5242880,n=Math.max(1,Math.min(8,e.parallelChunks??4));async function a(i){var f,p;const o=i.chunkSize??r,s=i.parallelChunks??n,l={id:crypto.randomUUID(),file:i.file,path:i.path,totalBytes:i.file.size,uploadedBytes:0,percent:0,status:"initializing",cancel:()=>{}};let c=!1;const u=[];l.cancel=()=>{c=!0;for(const _ of u)_.abort()};function d(){var _;l.percent=l.totalBytes>0?Math.min(100,Math.round(l.uploadedBytes/l.totalBytes*100)):0,(_=i.onProgress)==null||_.call(i,l)}try{if(!t.endpoints.uploadInit)throw new Error("uploadInit not configured");const _=await t.jsonFetch(t.endpoints.uploadInit,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:i.path,filename:i.file.name,size:i.file.size,mime:i.file.type||"application/octet-stream"})});l.uploadId=_.uploadId,l.status="uploading",d();const h=_.chunkBytes??o,b=new Map,v=[];let m=0;async function y(x){const D=(x.partNumber-1)*(_.chunkBytes??o),B=Math.min(D+(_.chunkBytes??o),i.file.size),F=i.file.slice(D,B),K=new AbortController;u.push(K),await new Promise((te,J)=>{const ne=new XMLHttpRequest;ne.open("PUT",x.presignedUrl),ne.upload.onprogress=le=>{if(le.lengthComputable){const q=b.get(x.partNumber)??0,j=le.loaded-q;b.set(x.partNumber,le.loaded),l.uploadedBytes+=j,d()}},ne.onload=()=>{if(ne.status>=200&&ne.status<300){const le=(ne.getResponseHeader("ETag")||ne.getResponseHeader("etag")||"").trim();if(!le){J(new Error("Missing ETag on S3 response"));return}const q=B-D,j=b.get(x.partNumber)??0;j<q&&(l.uploadedBytes+=q-j,b.set(x.partNumber,q)),v.push({partNumber:x.partNumber,etag:le}),te()}else J(new Error(`S3 PUT ${x.partNumber} → ${ne.status}: ${ne.responseText.slice(0,200)}`))},ne.onerror=()=>J(new Error(`S3 PUT ${x.partNumber} network error`)),ne.onabort=()=>J(new DOMException("Aborted","AbortError")),K.signal.addEventListener("abort",()=>ne.abort()),ne.send(F)})}const g=2;async function S(x,C=0){try{await y(x)}catch(D){if(c)throw D;const B=D instanceof Error?D:new Error(String(D));if(B.name==="AbortError"||C>=g)throw B;const F=b.get(x.partNumber)??0;F>0&&(l.uploadedBytes=Math.max(0,l.uploadedBytes-F),b.delete(x.partNumber),d());const K=500*(C+1)+Math.floor(Math.random()*250);return await new Promise(te=>setTimeout(te,K)),S(x,C+1)}}async function M(){for(;!c&&m<_.parts.length;){const x=_.parts[m++];await S(x)}}const E=[];for(let x=0;x<s;x++)E.push(M());if(await Promise.all(E),c)throw new DOMException("Aborted by user","AbortError");if(!t.endpoints.uploadFinalize)throw new Error("uploadFinalize not configured");l.status="finalizing",v.sort((x,C)=>x.partNumber-C.partNumber);const w=await t.jsonFetch(t.endpoints.uploadFinalize,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({uploadId:_.uploadId,parts:v})});return l.status="done",l.uploadedBytes=l.totalBytes,l.percent=100,d(),(f=i.onDone)==null||f.call(i,l,w),w}catch(_){const h=_ instanceof Error?_:new Error(String(_));if(l.status=h.name==="AbortError"?"aborted":"error",l.error=h.message,d(),l.uploadId&&t.endpoints.uploadAbort&&l.status==="aborted")try{await t.jsonFetch(t.endpoints.uploadAbort,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({uploadId:l.uploadId})})}catch{}throw(p=i.onError)==null||p.call(i,l,h),h}}return{uploadFile:a}}function vx(e){const t=re(new Set),r=re(null);function n(f,p={}){if(p.shift&&r.value){const _=e(),h=_.findIndex(g=>g.path===r.value),b=_.findIndex(g=>g.path===f);if(h===-1||b===-1){t.value=new Set([f]),r.value=f;return}const[v,m]=h<b?[h,b]:[b,h],y=new Set;for(let g=v;g<=m;g++)y.add(_[g].path);t.value=y;return}if(p.ctrl){const _=new Set(t.value);_.has(f)?_.delete(f):_.add(f),t.value=_,r.value=f;return}t.value=new Set([f]),r.value=f}function a(){t.value=new Set,r.value=null}function i(){t.value=new Set(e().map(f=>f.path))}function o(f){return t.value.has(f)}function s(f){const p=new Set(t.value);p.add(f),t.value=p}function l(f){const p=new Set(t.value);p.delete(f),t.value=p}const c=Fe(()=>t.value.size),u=Fe(()=>t.value.size===0),d=Fe(()=>e().filter(p=>t.value.has(p.path)));return{selected:t,anchor:r,click:n,clear:a,selectAll:i,has:o,add:s,remove:l,size:c,isEmpty:u,nodes:d}}const so=[{id:"palette",defaultCombo:"Ctrl+K",labelKey:"shortcuts.palette",groupKey:"shortcuts.group.nav"},{id:"search",defaultCombo:"/",labelKey:"shortcuts.search",groupKey:"shortcuts.group.nav"},{id:"go-up",defaultCombo:"Alt+↑",fixedCombos:["Backspace"],labelKey:"shortcuts.go_up",groupKey:"shortcuts.group.nav"},{id:"open",defaultCombo:"Enter",prevent:!1,labelKey:"shortcuts.open",groupKey:"shortcuts.group.nav"},{id:"quicklook",defaultCombo:"Space",labelKey:"shortcuts.quicklook",groupKey:"shortcuts.group.nav"},{id:"close",defaultCombo:"Esc",customizable:!1,prevent:!1,inForms:!0,labelKey:"shortcuts.close",groupKey:"shortcuts.group.nav"},{id:"inspector",defaultCombo:"I",labelKey:"shortcuts.inspector",groupKey:"shortcuts.group.nav"},{id:"help",defaultCombo:"?",labelKey:"shortcuts.help",groupKey:"shortcuts.group.nav"},{id:"select-all",defaultCombo:"Ctrl+A",labelKey:"shortcuts.select_all",groupKey:"shortcuts.group.selection"},{id:"rename",defaultCombo:"F2",labelKey:"shortcuts.rename",groupKey:"shortcuts.group.file"},{id:"delete",defaultCombo:"Del",labelKey:"shortcuts.delete",groupKey:"shortcuts.group.file"},{id:"cut",defaultCombo:"Ctrl+X",labelKey:"shortcuts.cut",groupKey:"shortcuts.group.file"},{id:"copy",defaultCombo:"Ctrl+C",labelKey:"shortcuts.copy",groupKey:"shortcuts.group.file"},{id:"paste",defaultCombo:"Ctrl+V",labelKey:"shortcuts.paste",groupKey:"shortcuts.group.file"},{id:"tab-new",defaultCombo:"Ctrl+T",labelKey:"shortcuts.tab_new",groupKey:"shortcuts.group.tabs"},{id:"tab-close",defaultCombo:"Ctrl+W",labelKey:"shortcuts.tab_close",groupKey:"shortcuts.group.tabs"},{id:"tab-next",defaultCombo:"Ctrl+Tab",labelKey:"shortcuts.tab_next",groupKey:"shortcuts.group.tabs"},{id:"tab-prev",defaultCombo:"Ctrl+Shift+Tab",labelKey:"shortcuts.tab_prev",groupKey:"shortcuts.group.tabs"}],mx={palette:"onPathJump",search:"onFocusSearch","go-up":"onGoUp",open:"onOpen",quicklook:"onQuickLook",close:"onClose",inspector:"onToggleInspector",help:"onShowHelp","select-all":"onSelectAll",rename:"onRename",delete:"onDelete",cut:"onCut",copy:"onCopy",paste:"onPaste","tab-new":"onTabNew","tab-close":"onTabClose","tab-next":"onTabNext","tab-prev":"onTabPrev"},mf="filex.shortcuts";function gx(){try{const e=localStorage.getItem(mf);if(!e)return{};const t=JSON.parse(e);if(!t||typeof t!="object")return{};const r={};for(const[n,a]of Object.entries(t))typeof a=="string"&&so.some(i=>i.id===n)&&(r[n]=a);return r}catch{return{}}}const Ea=re(gx());function gf(){try{Object.keys(Ea.value).length===0?localStorage.removeItem(mf):localStorage.setItem(mf,JSON.stringify(Ea.value))}catch{}}function Rv(e){return so.find(t=>t.id===e)}function z0(e){var r;const t=Ea.value[e];return t!==void 0?t:((r=Rv(e))==null?void 0:r.defaultCombo)??""}function bf(e,t){const r=Rv(e);if(!r||r.customizable===!1)return;const n={...Ea.value};t===r.defaultCombo?delete n[e]:n[e]=t,Ea.value=n,gf()}function bx(e){if(!(e in Ea.value))return;const t={...Ea.value};delete t[e],Ea.value=t,gf()}function yx(){Ea.value={},gf()}function _x(e,t){var r;if(!e)return null;for(const n of so)if(n.id!==t){if((r=n.fixedCombos)!=null&&r.includes(e))return{id:n.id,fixed:!0};if(z0(n.id)===e)return{id:n.id,fixed:n.customizable===!1}}return null}const xx={" ":"Space",Spacebar:"Space",Escape:"Esc",Delete:"Del",ArrowUp:"↑",ArrowDown:"↓",ArrowLeft:"←",ArrowRight:"→",PageUp:"PgUp",PageDown:"PgDn"},wx=new Set(["Control","Alt","Shift","Meta","AltGraph","CapsLock","NumLock","ScrollLock","Fn","Dead"]);function kx(e){const t=e.key;if(!t||wx.has(t))return null;const r=xx[t];return r||(t.length===1?t.toUpperCase():t)}function Lv(e){const t=kx(e);if(!t)return null;const r=[];(e.ctrlKey||e.metaKey)&&r.push("Ctrl"),e.altKey&&r.push("Alt");const n=t.length===1&&t.toUpperCase()===t.toLowerCase();return e.shiftKey&&!n&&r.push("Shift"),r.push(t),r.join("+")}function Bv(){return Fe(()=>so.map(e=>{const t=z0(e.id),r=e.fixedCombos??[];return{id:e.id,combo:t,fixedCombos:r,keys:[t,...r].filter(n=>!!n),labelKey:e.labelKey,groupKey:e.groupKey,customizable:e.customizable!==!1,overridden:Ea.value[e.id]!==void 0}}))}so.map(e=>({keys:[e.defaultCombo,...e.fixedCombos??[]].filter(t=>!!t),labelKey:e.labelKey,groupKey:e.groupKey}));function Sx(e,t){const r=Fe(()=>{const a=new Map;for(const i of so){const o=z0(i.id);o&&a.set(o,i)}return a});function n(a){var d;if(!e.value||a.key!=="Escape"&&document.querySelector(".fe-ctx-backdrop"))return;const o=a.target,s=!!(o&&(o.tagName==="INPUT"||o.tagName==="TEXTAREA"||o.tagName==="SELECT"||o.isContentEditable)),l=Lv(a);if(!l)return;if(l==="Backspace"){if(s)return;(d=t.hasSelection)!=null&&d.call(t)&&t.onDelete?(a.preventDefault(),t.onDelete()):t.onGoUp&&(a.preventDefault(),t.onGoUp());return}const c=r.value.get(l);if(!c||s&&!c.inForms||l==="Space"&&o&&typeof o.closest=="function"&&o.closest('button, a, select, summary, [role="button"], [role="menuitem"]'))return;const u=t[mx[c.id]];u&&(c.prevent!==!1&&a.preventDefault(),u())}Xt(()=>window.addEventListener("keydown",n)),tr(()=>window.removeEventListener("keydown",n))}const $v={tr:{"toolbar.new_folder":"Yeni Klasör","toolbar.upload":"Yükle","toolbar.search":"Ara","toolbar.search.placeholder":"Dosya adı…","toolbar.view.list":"Liste","toolbar.view.grid":"Izgara","toolbar.refresh":"Yenile","toolbar.go_up":"Üst Klasör","ctx.open":"Aç","ctx.preview":"Önizle","ctx.download":"İndir","ctx.convert":"Dönüştür","ctx.rename":"Yeniden Adlandır","ctx.delete":"Sil","ctx.delete_perm":"Kalıcı Olarak Sil","ctx.restore":"Geri Getir","ctx.share":"Paylaş","ctx.move":"Taşı","ctx.copy":"Kopyala","ctx.cut":"Kes","ctx.paste":"Yapıştır","ctx.info":"Bilgi","ctx.duplicate":"Kopyasını Oluştur","ctx.new_file":"Yeni Dosya","modal.delete.title":"Silinsin mi?","modal.delete.message":"{count} öğe çöpe atılacak.","modal.delete.confirm":"Çöpe At","modal.delete.cancel":"Vazgeç","modal.rename.title":"Yeniden Adlandır","modal.rename.save":"Kaydet","modal.rename.cancel":"Vazgeç","modal.newfolder.title":"Yeni Klasör","modal.newfolder.placeholder":"Klasör adı","modal.newfolder.create":"Oluştur","modal.newfolder.cancel":"Vazgeç","modal.share.title":"Paylaşım Linki","modal.share.pin":"PIN koruması","modal.share.expires":"Son kullanma","modal.share.max_downloads":"İndirme limiti","modal.share.create":"Paylaş","modal.share.cancel":"Vazgeç","modal.share.copy":"Kopyala","modal.share.url_copied":"Link kopyalandı","modal.share.pin_copied":"PIN kopyalandı","modal.share.cli_copied":"CLI komutu kopyalandı","upload.progress":"Yükleniyor","upload.done":"Tamamlandı","upload.error":"Hata","upload.aborted":"İptal edildi","upload.cancel":"İptal","empty.folder":"Bu klasör boş","empty.search":"Sonuç bulunamadı",loading:"Yükleniyor…","notFound.title":"Klasör bulunamadı","notFound.desc":"Bu klasör mevcut değil, taşınmış ya da erişim yetkiniz yok.","notFound.goRoot":"Kök klasöre dön","col.name":"Ad","col.size":"Boyut","col.modified":"Tarih","col.type":"Tür","unit.bytes":"B","unit.kb":"KB","unit.mb":"MB","unit.gb":"GB","unit.tb":"TB","breadcrumb.root":"Kök","breadcrumb.copy_path":"Yolu Kopyala","breadcrumb.go_to_path":"Yola Git","breadcrumb.path_placeholder":"fileman/foo/bar","ops.copy":"Kopyalanıyor","ops.move":"Taşınıyor","ops.delete":"Siliniyor","ops.queued":"sırada","ops.done":"tamamlandı","ops.error":"hata","node.trash":"Çöp Kutusu","viewer.open_in_new_tab":"Yeni Sekmede Aç","viewer.loading":"Yükleniyor…","viewer.failed_to_load":"Dosya yüklenemedi","viewer.peer_not_installed":"Bu dosya tipi için opsiyonel kütüphane kurulu değil. Peer dependency yükle veya İndir düğmesini kullan.","viewer.format_unsupported_3d":"Bu 3B format tarayıcı önizlemesinde desteklenmiyor (model-viewer yalnızca .glb / .gltf / .usdz okur). Lütfen indirip yerel bir araçta açın.","viewer.zoom_in":"Yakınlaştır","viewer.zoom_out":"Uzaklaştır","viewer.fit_width":"Sayfa genişliğine sığdır","viewer.next_page":"Sonraki sayfa","viewer.prev_page":"Önceki sayfa","viewer.page_n_of_m":"Sayfa {n} / {m}","viewer.tags":"Etiketler","viewer.layers":"Katmanlar","viewer.toc":"İçindekiler","viewer.font_smaller":"Yazıyı küçült","viewer.font_larger":"Yazıyı büyüt","viewer.search":"Ara","viewer.download":"İndir","viewer.saving":"Kaydediliyor…","viewer.save":"Kaydet (Ctrl+S)","viewer.saved":"Kaydedildi","viewer.save_error":"Hata","viewer.editor_loading":"Editör yükleniyor…","viewer.no_preview":"Bu dosya tipi için önizleme henüz yok.","viewer.edit":"Düzenle","viewer.close":"Kapat","presence.expand":"İsimleri göster","presence.collapse":"Küçült","viewer.save_annotations":"Açıklamaları kaydet","viewer.annotations_on":"Açıklamalar: açık","viewer.annotations_off":"Açıklamalar: kapalı","viewer.read_only":"Salt okunur","viewer.csv_first_row_header":"İlk satır başlık olsun","viewer.csv_filter":"Satır filtrele…","viewer.epub_prev":"Önceki","viewer.epub_next":"Sonraki","viewer.drawio.disabled":"diagrams.net editörü bu filex kurulumunda yapılandırılmamış — yönetici FILEX_DRAWIO_URL'yi ayarlamalı.","viewer.archive.entries":"{n} dosya","viewer.archive.empty":"Arşiv boş.","viewer.archive.error":"Arşiv okunamadı.","viewer.name":"Ad","viewer.size":"Boyut","col.sort":"Sırala","group.today":"Bugün","group.yesterday":"Dün","group.this_week":"Bu Hafta","group.this_month":"Bu Ay","group.no_date":"Tarihsiz","toolbar.density.compact":"Sıkışık görünüm","toolbar.density.comfortable":"Rahat görünüm","palette.placeholder":"Dosya, klasör veya komut ara…","palette.files":"Dosyalar","palette.commands":"Komutlar","palette.goto":"Yola git","palette.empty":"Sonuç bulunamadı","palette.hint":"↑↓ gezin · Enter seç · Esc kapat","cmd.view_toggle":"Görünümü değiştir (liste ⇄ ızgara)","cmd.trash":"Çöp kutusunu aç","shortcuts.title":"Klavye Kısayolları","shortcuts.group.nav":"Gezinme","shortcuts.group.selection":"Seçim","shortcuts.group.file":"Dosya işlemleri","shortcuts.palette":"Komut paleti","shortcuts.search":"Aramaya odaklan","shortcuts.go_up":"Üst klasöre çık","shortcuts.open":"Seçili öğeyi aç","shortcuts.close":"Kapat / vazgeç","shortcuts.help":"Bu yardım penceresi","shortcuts.select_all":"Tümünü seç","shortcuts.rename":"Yeniden adlandır","shortcuts.delete":"Sil","shortcuts.cut":"Kes","shortcuts.copy":"Kopyala","shortcuts.paste":"Yapıştır","breadcrumb.more":"Aradaki klasörler","empty.hint":"Dosyaları buraya sürükleyip bırakın","empty.upload":"Dosya yükle","empty.search.title":"Aramanla eşleşen dosya yok","empty.search.hint":"Farklı bir arama terimi deneyin","empty.trash.title":"Çöp kutusu boş","error.title":"Liste yüklenemedi","error.retry":"Yeniden dene","toast.undo":"Geri Al","toast.undone":"Geri alındı","toast.undo_failed":"Geri alınamadı","toast.renamed":"Yeniden adlandırıldı","toast.moved":"Taşındı","toast.trashed":"Çöpe taşındı","conn.offline":"Canlı bağlantı yok — değişiklikler gecikebilir","conn.tooltip":"Sunucuyla canlı bağlantı kurulamadı; liste belirli aralıklarla otomatik yenilenir. Bağlantı geri gelince bu uyarı kaybolur.","palette.everywhere":"Her yerde","palette.searching":"Aranıyor…","palette.saved":"Kayıtlı aramalar","palette.save":"Aramayı kaydet","palette.saved.delete":"Kayıtlı aramayı sil","search.in_content":"İçerikte","toolbar.more":"Diğer işlemler","toolbar.search.close":"Aramayı kapat","sheet.menu":"İşlemler","sheet.close":"Kapat","toolbar.inspector":"Ayrıntılar","ctx.details":"Ayrıntılar","shortcuts.inspector":"Ayrıntılar panelini aç/kapat","inspector.title":"Ayrıntılar","inspector.close":"Kapat","inspector.section.general":"Genel","inspector.section.versions":"Sürümler","inspector.section.permissions":"İzinler","inspector.section.shares":"Paylaşımlar","inspector.path":"Yol","inspector.size":"Boyut","inspector.modified":"Değiştirilme","inspector.mime":"MIME türü","inspector.etag":"ETag","inspector.copy":"Kopyala","inspector.copied":"Kopyalandı","inspector.error":"Yüklenemedi","inspector.items_summary":"{n} öğe, toplam {size}","inspector.folder_items":"{n} öğe","inspector.versions.empty":"Sürüm geçmişi yok","inspector.versions.v":"Sürüm {n}","inspector.versions.restore":"Geri yükle","inspector.versions.restore_confirm":"Bu sürüm geri yüklensin mi?","inspector.versions.snapshot_current":"Önce şimdiki halin sürümünü al","inspector.versions.confirm":"Onayla","inspector.versions.cancel":"Vazgeç","inspector.versions.take_snapshot":"Şimdiki halin sürümünü al","inspector.versions.restored":"Sürüm geri yüklendi","inspector.versions.snapshotted":"Sürüm alındı","inspector.versions.unsupported":"Sunucu bu işlemi desteklemiyor","inspector.perm.none":"Erişim yok","inspector.perm.viewer":"Görüntüleyen","inspector.perm.editor":"Düzenleyen","inspector.perm.owner":"Sahip","inspector.perm.manage":"İzinleri yönet","inspector.shares.empty":"Paylaşım linki yok","inspector.shares.copy":"Linki kopyala","theme.menu":"Tema","theme.title":"Tema Galerisi","theme.hint":"Tema yalnız renk paletini değiştirir; açık/koyu mod ayrı çalışmaya devam eder.","theme.reset":"Varsayılana dön","theme.close":"Kapat","theme.selected":"Seçili","theme.name.default":"Varsayılan","theme.name.night":"Gece Mavisi","theme.name.forest":"Orman","theme.name.amber":"Kehribar","theme.name.lilac":"Leylak","theme.name.contrast":"Yüksek Kontrast","theme.name.gray":"Yumuşak Gri","theme.name.terminal":"Terminal Yeşili","shortcuts.quicklook":"Hızlı bakış","shortcuts.customize":"Özelleştir","shortcuts.settings.menu":"Kısayollar","shortcuts.settings.title":"Kısayol Ayarları","shortcuts.settings.hint":'Bir kısayolu değiştirmek için "Değiştir"e basıp yeni tuş kombinasyonuna basın. Değişiklikler yalnızca bu tarayıcıda saklanır.',"shortcuts.settings.change":"Değiştir","shortcuts.settings.capture":"Tuşlara basın… (Esc iptal)","shortcuts.settings.reset":"Varsayılana dön","shortcuts.settings.reset_all":"Tümünü sıfırla","shortcuts.settings.unbound":"Atanmadı","shortcuts.settings.fixed":"Sabit","shortcuts.settings.customized":"Özelleştirildi","shortcuts.settings.conflict":'kombinasyonu "{name}" kısayolunda kullanılıyor.',"shortcuts.settings.conflict_fixed":'kombinasyonu "{name}" sabit kısayoluna ayrılmış — kullanılamaz.',"shortcuts.settings.conflict_take":"Eskisini boşa çıkar ve ata","shortcuts.settings.conflict_cancel":"Vazgeç","quicklook.hint_close":"kapat","quicklook.hint_nav":"önceki/sonraki","quicklook.hint_open":"aç","opc.title":"İşlemler","opc.aria_badge":"{n} işlem — işlem merkezini aç/kapat","opc.close":"Kapat","opc.active":"Sürüyor","opc.history":"Geçmiş","opc.clear":"Temizle","opc.empty":"İşlem yok","opc.cancel":"İptal","opc.retry":"Yeniden dene","opc.dismiss":"Kapat","opc.queued":"Sırada","opc.percent":"%{n}","opc.status.running":"Sürüyor","opc.status.done":"Bitti","opc.status.error":"Hata","opc.status.aborted":"İptal edildi","opc.kind.upload":"Yükleme","opc.kind.copy":"Kopyalama","opc.kind.move":"Taşıma","opc.kind.delete":"Silme","opc.kind.convert":"Dönüştürme","opc.kind.archive":"Arşiv","tour.aria":"Tanıtım turu","tour.restart":"Turu tekrar başlat","tour.skip":"Turu atla","tour.back":"Geri","tour.next":"İleri","tour.done":"Bitti","tour.progress":"{n} / {m}","tour.step.nav.title":"Depo ve klasörler","tour.step.nav.desc":"Bulunduğun konum burada görünür. Kırıntı çubuğundaki adımlara tıklayarak üst klasörlere ve depo köküne dönebilirsin.","tour.step.upload.title":"Dosya yükle","tour.step.upload.desc":"Bu düğmeyle dosya seçebilirsin; dosyaları doğrudan pencereye sürükleyip bırakmak da çalışır.","tour.step.search.title":"Arama","tour.step.search.desc":"Bu kutu bulunduğun klasörü filtreler. Ctrl+K komut paleti ile tüm depolarda arama yapabilir ve komut çalıştırabilirsin.","tour.step.view.title":"Görünümü değiştir","tour.step.view.desc":"Liste ve ızgara görünümü arasında geçiş yapabilirsin; seçimin hatırlanır.","tour.step.share.title":"Paylaşım","tour.step.share.desc":'Bir dosyaya sağ tıklayıp "Paylaş / İzinler" ile bağlantı oluşturabilir, PIN ve son kullanma süresi ekleyebilirsin.',"tour.step.help.title":"Kısayollar","tour.step.help.desc":'? tuşu kısayol kartını, Ctrl+K komut paletini açar. Bu turu menüdeki "Turu tekrar başlat" ile dilediğinde yeniden izleyebilirsin.',"error.hint":"Bağlantı ya da sunucu kaynaklı geçici bir sorun olabilir. Yeniden deneyin.","error.details":"Teknik ayrıntılar","col.star":"Yıldız","toolbar.view_label":"Görünüm","list.aria":"Dosya listesi","grid.aria":"Dosya ızgarası","tabs.strip":"Sekmeler","tabs.new":"Yeni sekme","tabs.close":"Sekmeyi kapat","tabs.split":"Görünümü böl","tabs.split_off":"Bölmeyi kapat","ctx.open_new_tab":"Yeni sekmede aç","shortcuts.group.tabs":"Sekmeler","shortcuts.tab_new":"Yeni sekme","shortcuts.tab_close":"Sekmeyi kapat","shortcuts.tab_next":"Sonraki sekme","shortcuts.tab_prev":"Önceki sekme","cmd.tab_new":"Yeni sekme aç","cmd.split_toggle":"Görünümü böl / birleştir","split.pane":"İkincil panel","split.close":"Yan paneli kapat","split.error":"Liste yüklenemedi","split.retry":"Yeniden dene","split.copy_queued":"Kopyalama kuyruğa alındı","split.cross_copy":"Depolar farklı — kopyalama kuyruğa alındı","split.cross_failed":"Depolar arası kopyalama bu sunucuda desteklenmiyor","toolbar.view.gallery":"Galeri","gallery.aria":"Dosya galerisi","inspector.section.comments":"Yorumlar","inspector.comments.empty":"Henüz yorum yok.","inspector.comments.placeholder":"Yorum yaz…","inspector.comments.send":"Gönder","inspector.comments.delete":"Yorumu sil","e2e.create.title":"Şifreli klasör oluştur","e2e.create.option":"Şifreli klasör oluştur…","e2e.create.pw_placeholder":"Klasör parolası (en az 8 karakter)","e2e.create.pw2_placeholder":"Parolayı tekrar girin","e2e.create.warn_title":"GERİ DÖNÜŞÜ YOK","e2e.create.warn_body":"Dosyalar yalnız bu parolayla açılır. Parola sunucuda TUTULMAZ; unutursanız içerik sonsuza dek kaybolur. Kurtarma yolu yoktur — yönetici dahil kimse açamaz.","e2e.create.ack":"Anladım: parolayı kaybedersem verilerim kurtarılamaz.","e2e.create.ack_required":"Devam etmek için uyarıyı onaylayın.","e2e.create.pw_short":"Parola en az 8 karakter olmalı.","e2e.create.pw_mismatch":"Parolalar birbirini tutmuyor.","e2e.create.bad_name":"Geçersiz klasör adı.","e2e.create.create":"Şifreli klasörü oluştur","e2e.create.busy":"Oluşturuluyor…","e2e.create.done":"Şifreli klasör oluşturuldu","e2e.create.failed":"Şifreli klasör oluşturulamadı","e2e.create.nested":"Şifreli klasörün içine ikinci bir şifreli klasör açılamaz.","e2e.locked.title":"Bu klasör uçtan uca şifreli","e2e.locked.hint":"İçeriği görmek için klasör parolasını girin. Parola yalnız bu sekmede, bellekte tutulur.","e2e.locked.pw_placeholder":"Klasör parolası","e2e.locked.unlock":"Kilidi aç","e2e.locked.busy":"Doğrulanıyor…","e2e.unlock.wrong":"Parola yanlış.","e2e.unlock.marker_missing":"Şifre dosyası (.filex-e2e.json) okunamadı.","e2e.strip.label":"Şifreli klasör — kilit açık","e2e.strip.lock":"Kilitle","e2e.locked_toast":"Klasör kilitlendi","e2e.upload.too_big":"200 MB üstü dosyalar şifreli klasöre yüklenemez (MVP sınırı)","e2e.upload.locked":"Önce klasörün kilidini açın","e2e.decrypting":"Çözülüyor…","e2e.decrypt_failed":"Dosya çözülemedi (parola değişmiş ya da dosya bozulmuş olabilir).","e2e.download.failed":"Şifreli dosya indirilemedi."},en:{"toolbar.new_folder":"New Folder","toolbar.upload":"Upload","toolbar.search":"Search","toolbar.search.placeholder":"File name…","toolbar.view.list":"List","toolbar.view.grid":"Grid","toolbar.refresh":"Refresh","toolbar.go_up":"Up one level","ctx.open":"Open","ctx.preview":"Preview","ctx.download":"Download","ctx.convert":"Convert","ctx.rename":"Rename","ctx.delete":"Delete","ctx.delete_perm":"Delete Permanently","ctx.restore":"Restore","ctx.share":"Share","ctx.move":"Move","ctx.copy":"Copy","ctx.cut":"Cut","ctx.paste":"Paste","ctx.info":"Info","ctx.duplicate":"Duplicate","ctx.new_file":"New File","modal.delete.title":"Delete?","modal.delete.message":"{count} item(s) will be moved to trash.","modal.delete.confirm":"Move to Trash","modal.delete.cancel":"Cancel","modal.rename.title":"Rename","modal.rename.save":"Save","modal.rename.cancel":"Cancel","modal.newfolder.title":"New Folder","modal.newfolder.placeholder":"Folder name","modal.newfolder.create":"Create","modal.newfolder.cancel":"Cancel","modal.share.title":"Share Link","modal.share.pin":"PIN protected","modal.share.expires":"Expires at","modal.share.max_downloads":"Download limit","modal.share.create":"Share","modal.share.cancel":"Cancel","modal.share.copy":"Copy","modal.share.url_copied":"Link copied","modal.share.pin_copied":"PIN copied","modal.share.cli_copied":"CLI command copied","upload.progress":"Uploading","upload.done":"Done","upload.error":"Error","upload.aborted":"Aborted","upload.cancel":"Cancel","empty.folder":"This folder is empty","empty.search":"No results",loading:"Loading…","notFound.title":"Folder not found","notFound.desc":"This folder does not exist, was moved, or you do not have access to it.","notFound.goRoot":"Go to root folder","col.name":"Name","col.size":"Size","col.modified":"Modified","col.type":"Type","unit.bytes":"B","unit.kb":"KB","unit.mb":"MB","unit.gb":"GB","unit.tb":"TB","breadcrumb.root":"Root","breadcrumb.copy_path":"Copy Path","breadcrumb.go_to_path":"Go To Path","breadcrumb.path_placeholder":"fileman/foo/bar","ops.copy":"Copying","ops.move":"Moving","ops.delete":"Deleting","ops.queued":"queued","ops.done":"done","ops.error":"error","node.trash":"Trash","viewer.open_in_new_tab":"Open in New Tab","viewer.loading":"Loading…","viewer.failed_to_load":"Failed to load file","viewer.peer_not_installed":"Optional viewer library is not installed. Install the peer dependency or use the download button.","viewer.format_unsupported_3d":"This 3D format is not supported in the browser preview (model-viewer only reads .glb / .gltf / .usdz). Please download and open with a local tool.","viewer.zoom_in":"Zoom in","viewer.zoom_out":"Zoom out","viewer.fit_width":"Fit width","viewer.next_page":"Next page","viewer.prev_page":"Previous page","viewer.page_n_of_m":"Page {n} of {m}","viewer.tags":"Tags","viewer.layers":"Layers","viewer.toc":"Contents","viewer.font_smaller":"Smaller text","viewer.font_larger":"Larger text","viewer.search":"Search","viewer.download":"Download","viewer.saving":"Saving…","viewer.save":"Save (Ctrl+S)","viewer.saved":"Saved","viewer.save_error":"Error","viewer.editor_loading":"Loading editor…","viewer.no_preview":"No preview for this file type yet.","viewer.edit":"Edit","viewer.close":"Close","presence.expand":"Show names","presence.collapse":"Collapse","viewer.save_annotations":"Save annotations","viewer.annotations_on":"Annotations: on","viewer.annotations_off":"Annotations: off","viewer.read_only":"Read only","viewer.csv_first_row_header":"First row as header","viewer.csv_filter":"Filter rows…","viewer.epub_prev":"Previous","viewer.epub_next":"Next","viewer.drawio.disabled":"diagrams.net embed is not configured for this filex instance — operator must wire FILEX_DRAWIO_URL to enable the editor.","viewer.archive.entries":"{n} files","viewer.archive.empty":"Archive is empty.","viewer.archive.error":"Could not read archive contents.","viewer.name":"Name","viewer.size":"Size","col.sort":"Sort","group.today":"Today","group.yesterday":"Yesterday","group.this_week":"This Week","group.this_month":"This Month","group.no_date":"No date","toolbar.density.compact":"Compact view","toolbar.density.comfortable":"Comfortable view","palette.placeholder":"Search files, folders or commands…","palette.files":"Files","palette.commands":"Commands","palette.goto":"Go to path","palette.empty":"No results","palette.hint":"↑↓ navigate · Enter select · Esc close","cmd.view_toggle":"Toggle view (list ⇄ grid)","cmd.trash":"Open trash","shortcuts.title":"Keyboard Shortcuts","shortcuts.group.nav":"Navigation","shortcuts.group.selection":"Selection","shortcuts.group.file":"File operations","shortcuts.palette":"Command palette","shortcuts.search":"Focus search","shortcuts.go_up":"Go up one level","shortcuts.open":"Open selected item","shortcuts.close":"Close / cancel","shortcuts.help":"This help dialog","shortcuts.select_all":"Select all","shortcuts.rename":"Rename","shortcuts.delete":"Delete","shortcuts.cut":"Cut","shortcuts.copy":"Copy","shortcuts.paste":"Paste","breadcrumb.more":"Hidden folders","empty.hint":"Drag and drop files here","empty.upload":"Upload files","empty.search.title":"No files match your search","empty.search.hint":"Try a different search term","empty.trash.title":"Trash is empty","error.title":"Could not load this folder","error.retry":"Try again","toast.undo":"Undo","toast.undone":"Undone","toast.undo_failed":"Could not undo","toast.renamed":"Renamed","toast.moved":"Moved","toast.trashed":"Moved to trash","conn.offline":"No live connection — changes may be delayed","conn.tooltip":"Live connection to the server is unavailable; the list refreshes periodically. This notice disappears once the connection is back.","palette.everywhere":"Everywhere","palette.searching":"Searching…","palette.saved":"Saved searches","palette.save":"Save search","palette.saved.delete":"Delete saved search","search.in_content":"In content","toolbar.more":"More actions","toolbar.search.close":"Close search","sheet.menu":"Actions","sheet.close":"Close","toolbar.inspector":"Details","ctx.details":"Details","shortcuts.inspector":"Toggle details panel","inspector.title":"Details","inspector.close":"Close","inspector.section.general":"General","inspector.section.versions":"Versions","inspector.section.permissions":"Permissions","inspector.section.shares":"Shares","inspector.path":"Path","inspector.size":"Size","inspector.modified":"Modified","inspector.mime":"MIME type","inspector.etag":"ETag","inspector.copy":"Copy","inspector.copied":"Copied","inspector.error":"Could not load","inspector.items_summary":"{n} items, {size} total","inspector.folder_items":"{n} items","inspector.versions.empty":"No version history","inspector.versions.v":"Version {n}","inspector.versions.restore":"Restore","inspector.versions.restore_confirm":"Restore this version?","inspector.versions.snapshot_current":"Snapshot the current state first","inspector.versions.confirm":"Confirm","inspector.versions.cancel":"Cancel","inspector.versions.take_snapshot":"Snapshot current state","inspector.versions.restored":"Version restored","inspector.versions.snapshotted":"Snapshot taken","inspector.versions.unsupported":"The server does not support this operation","inspector.perm.none":"No access","inspector.perm.viewer":"Viewer","inspector.perm.editor":"Editor","inspector.perm.owner":"Owner","inspector.perm.manage":"Manage permissions","inspector.shares.empty":"No share links","inspector.shares.copy":"Copy link","theme.menu":"Theme","theme.title":"Theme Gallery","theme.hint":"Themes only change the color palette; light/dark mode still applies separately.","theme.reset":"Reset to default","theme.close":"Close","theme.selected":"Selected","theme.name.default":"Default","theme.name.night":"Night Blue","theme.name.forest":"Forest","theme.name.amber":"Amber","theme.name.lilac":"Lilac","theme.name.contrast":"High Contrast","theme.name.gray":"Soft Gray","theme.name.terminal":"Terminal Green","shortcuts.quicklook":"Quick look","shortcuts.customize":"Customize","shortcuts.settings.menu":"Shortcuts","shortcuts.settings.title":"Shortcut Settings","shortcuts.settings.hint":'To remap a shortcut, press "Change" and then the new key combination. Changes are stored in this browser only.',"shortcuts.settings.change":"Change","shortcuts.settings.capture":"Press keys… (Esc cancels)","shortcuts.settings.reset":"Reset to default","shortcuts.settings.reset_all":"Reset all","shortcuts.settings.unbound":"Not set","shortcuts.settings.fixed":"Fixed","shortcuts.settings.customized":"Customized","shortcuts.settings.conflict":'is already used by "{name}".',"shortcuts.settings.conflict_fixed":'is reserved by the fixed shortcut "{name}" — it cannot be used.',"shortcuts.settings.conflict_take":"Unassign old and use here","shortcuts.settings.conflict_cancel":"Cancel","quicklook.hint_close":"close","quicklook.hint_nav":"previous/next","quicklook.hint_open":"open","opc.title":"Operations","opc.aria_badge":"{n} operations — toggle operations center","opc.close":"Close","opc.active":"In progress","opc.history":"History","opc.clear":"Clear","opc.empty":"No operations","opc.cancel":"Cancel","opc.retry":"Retry","opc.dismiss":"Dismiss","opc.queued":"Queued","opc.percent":"{n}%","opc.status.running":"In progress","opc.status.done":"Done","opc.status.error":"Failed","opc.status.aborted":"Cancelled","opc.kind.upload":"Upload","opc.kind.copy":"Copy","opc.kind.move":"Move","opc.kind.delete":"Delete","opc.kind.convert":"Convert","opc.kind.archive":"Archive","tour.aria":"Onboarding tour","tour.restart":"Restart the tour","tour.skip":"Skip tour","tour.back":"Back","tour.next":"Next","tour.done":"Done","tour.progress":"{n} / {m}","tour.step.nav.title":"Storages & folders","tour.step.nav.desc":"Your current location lives here. Click any crumb to jump back to parent folders or the storage root.","tour.step.upload.title":"Upload files","tour.step.upload.desc":"Pick files with this button — or simply drag & drop them anywhere in the window.","tour.step.search.title":"Search","tour.step.search.desc":"This box filters the current folder. The Ctrl+K command palette searches across all storages and runs commands.","tour.step.view.title":"Switch views","tour.step.view.desc":"Toggle between the list and grid layout; your choice is remembered.","tour.step.share.title":"Sharing","tour.step.share.desc":'Right-click any file and use "Share / Permissions" to create a link with an optional PIN and expiry.',"tour.step.help.title":"Shortcuts","tour.step.help.desc":'Press ? for the shortcut cheat-sheet and Ctrl+K for the command palette. Replay this tour any time via "Restart the tour" in the menu.',"error.hint":"This may be a temporary network or server problem. Please try again.","error.details":"Technical details","col.star":"Star","toolbar.view_label":"View","list.aria":"File list","grid.aria":"File grid","tabs.strip":"Tabs","tabs.new":"New tab","tabs.close":"Close tab","tabs.split":"Split view","tabs.split_off":"Close split","ctx.open_new_tab":"Open in new tab","shortcuts.group.tabs":"Tabs","shortcuts.tab_new":"New tab","shortcuts.tab_close":"Close tab","shortcuts.tab_next":"Next tab","shortcuts.tab_prev":"Previous tab","cmd.tab_new":"Open a new tab","cmd.split_toggle":"Toggle split view","split.pane":"Secondary pane","split.close":"Close the side pane","split.error":"Could not load the listing","split.retry":"Retry","split.copy_queued":"Copy queued","split.cross_copy":"Different storages — copy queued instead","split.cross_failed":"Cross-storage copy is not supported by this server","toolbar.view.gallery":"Gallery","gallery.aria":"File gallery","inspector.section.comments":"Comments","inspector.comments.empty":"No comments yet.","inspector.comments.placeholder":"Write a comment…","inspector.comments.send":"Send","inspector.comments.delete":"Delete comment","e2e.create.title":"Create encrypted folder","e2e.create.option":"Create encrypted folder…","e2e.create.pw_placeholder":"Folder password (min 8 characters)","e2e.create.pw2_placeholder":"Repeat the password","e2e.create.warn_title":"NO WAY BACK","e2e.create.warn_body":"Files open ONLY with this password. The password is NEVER stored on the server; if you forget it the content is lost forever. There is no recovery — not even an admin can open it.","e2e.create.ack":"I understand: if I lose the password my data cannot be recovered.","e2e.create.ack_required":"Please confirm the warning to continue.","e2e.create.pw_short":"Password must be at least 8 characters.","e2e.create.pw_mismatch":"Passwords do not match.","e2e.create.bad_name":"Invalid folder name.","e2e.create.create":"Create encrypted folder","e2e.create.busy":"Creating…","e2e.create.done":"Encrypted folder created","e2e.create.failed":"Could not create the encrypted folder","e2e.create.nested":"You cannot create an encrypted folder inside another one.","e2e.locked.title":"This folder is end-to-end encrypted","e2e.locked.hint":"Enter the folder password to see its contents. The password stays in this tab’s memory only.","e2e.locked.pw_placeholder":"Folder password","e2e.locked.unlock":"Unlock","e2e.locked.busy":"Verifying…","e2e.unlock.wrong":"Wrong password.","e2e.unlock.marker_missing":"Could not read the key file (.filex-e2e.json).","e2e.strip.label":"Encrypted folder — unlocked","e2e.strip.lock":"Lock","e2e.locked_toast":"Folder locked","e2e.upload.too_big":"Files over 200 MB cannot be uploaded to an encrypted folder (MVP limit)","e2e.upload.locked":"Unlock the folder first","e2e.decrypting":"Decrypting…","e2e.decrypt_failed":"Could not decrypt the file (password changed or file corrupted).","e2e.download.failed":"Could not download the encrypted file."}};function br(e){const t=Fe(()=>{const i=typeof e=="function"?e():e.value;return $v[i]??$v.tr});function r(i,o={}){const s=t.value[i]??i;return Object.entries(o).reduce((l,[c,u])=>l.replaceAll(`{${c}}`,String(u)),s)}function n(i){if(i==null||i<0)return"—";if(i===0)return`0 ${r("unit.bytes")}`;const o=[[1024**4,"unit.tb"],[1024**3,"unit.gb"],[1024**2,"unit.mb"],[1024,"unit.kb"],[1,"unit.bytes"]];for(const[s,l]of o)if(i>=s){const c=i/s;return`${c>=100?Math.round(c):c.toFixed(c>=10?1:2)} ${r(l)}`}return`${i} ${r("unit.bytes")}`}function a(i){if(i.basename===".trash")return r("node.trash");const o=i.basename.match(/^\d{8}-\d{6}-[A-Za-z0-9]+__(.+)$/);return o?o[1]:i.basename}return{t:r,formatSize:n,nodeDisplayName:a}}const Cx=2e3,Ex=8e3;function Nv(e){const t=(...s)=>{for(const l of s)if(typeof l=="number")return l;return 0},r=(...s)=>{for(const l of s)if(typeof l=="string"&&l!=="")return l;return null},n=String(e.status??"pending"),a=n==="ok"||n==="done"?"done":n==="failed"||n==="partial"||n==="error"?"error":n==="running"?"running":"pending",i=Array.isArray(e.sources)?e.sources:[],o=r(e.op_type,e.kind)??"delete";return{id:t(e.id),op_type:o==="copy"||o==="move"?o:"delete",status:a,progress_total:t(e.progress_total,e.total,i.length),progress_done:t(e.progress_done,e.done),target_path:r(e.target_path,e.dest),source_dir:r(e.source_dir),source_count:t(e.source_count,i.length),error_message:r(e.error_message,e.error),started_at:r(e.started_at),finished_at:r(e.finished_at),created_at:r(e.created_at)}}function Ax(e,t,r={}){const n=re([]),a=new Set,i=new Map;let o=!1;const s=Fe(()=>n.value.some(_=>_.status==="pending"||_.status==="running"));let l;function c(){l||t.endpoints.opsList&&(l=setInterval(()=>{d()},Cx),d())}function u(){l&&(clearInterval(l),l=void 0)}async function d(){var _;if(t.endpoints.opsList)try{const b=((await t.jsonFetch(t.endpoints.opsList)).ops||[]).map(Nv);for(const w of b)(w.status==="done"||w.status==="error")&&!a.has(w.id)&&(a.add(w.id),i.set(w.id,Date.now()),o&&((_=r.onSettled)==null||_.call(r,w)));const v=new Set(n.value.map(w=>w.id)),m=b.filter(w=>w.status==="pending"||w.status==="running"?!0:o?v.has(w.id):!1),y=new Set(m.map(w=>w.id)),g=n.value.filter(w=>!y.has(w.id)),S=[...m,...g];o=!0;const M=Date.now(),E=S.filter(w=>{if(w.status==="pending"||w.status==="running")return!0;const x=i.get(w.id);return x!==void 0&&M-x<Ex});n.value=E,!s.value&&E.length===0&&u()}catch(h){console.warn("[usePendingOps] poll failed:",h)}}function f(_){const h=Nv(_);n.value.some(v=>v.id===h.id)||(n.value=[h,...n.value]),c()}function p(_){n.value=n.value.filter(h=>h.id!==_),i.delete(_)}return tr(()=>{u()}),{ops:n,hasActive:s,register:f,dismiss:p,poll:d,startPolling:c,stopPolling:u}}const Tx=25e3,Mx=15e3,Dx=6;class zx{constructor(t){ma(this,"ws",null);ma(this,"opts");ma(this,"closed",!1);ma(this,"connecting",!1);ma(this,"retries",0);ma(this,"fallback",!1);ma(this,"pingTimer",null);ma(this,"reconnectTimer",null);ma(this,"currentPath",null);ma(this,"currentFocus",null);this.opts=t,this.connect()}subscribe(t){this.currentPath=t,this.currentFocus=null,t&&this.send({type:"subscribe",path:t})}setFocus(t){this.currentFocus=t,this.send({type:"focus",file:t})}close(){this.closed=!0,this.clearTimers(),this.dropSocket()}async connect(){if(this.closed||this.connecting||this.ws)return;this.connecting=!0;let t=null;try{t=await this.opts.getTicket()}catch{t=null}if(this.connecting=!1,this.closed)return;if(!t||!t.ticket||!t.ws_url){this.fail();return}const r=t.ws_url.includes("?")?"&":"?";let n;try{n=new WebSocket(`${t.ws_url}${r}ticket=${encodeURIComponent(t.ticket)}`)}catch{this.fail();return}this.ws=n,n.onopen=()=>{var a,i;this.retries=0,this.setFallback(!1),(i=(a=this.opts.handlers).onStatus)==null||i.call(a,!0),this.currentPath&&this.send({type:"subscribe",path:this.currentPath}),this.currentFocus!==null&&this.send({type:"focus",file:this.currentFocus}),this.startPing()},n.onmessage=a=>{var s,l,c,u;let i;try{i=JSON.parse(typeof a.data=="string"?a.data:"")}catch{return}const o=i;(o==null?void 0:o.type)==="change"?(l=(s=this.opts.handlers).onChange)==null||l.call(s,i):(o==null?void 0:o.type)==="presence"&&((u=(c=this.opts.handlers).onPresence)==null||u.call(c,i))},n.onerror=()=>{},n.onclose=()=>{var a,i;this.stopPing(),this.ws=null,(i=(a=this.opts.handlers).onStatus)==null||i.call(a,!1),this.fail()}}fail(){if(this.closed||this.reconnectTimer)return;if(this.retries>=Dx){this.setFallback(!0);return}const t=Math.min(1e3*2**this.retries,Mx);this.retries+=1,this.reconnectTimer=setTimeout(()=>{this.reconnectTimer=null,this.connect()},t)}setFallback(t){var r,n;this.fallback!==t&&(this.fallback=t,(n=(r=this.opts.handlers).onFallback)==null||n.call(r,t))}send(t){const r=this.ws;if(!(!r||r.readyState!==WebSocket.OPEN))try{r.send(JSON.stringify(t))}catch{}}startPing(){this.stopPing(),this.pingTimer=setInterval(()=>this.send({type:"ping"}),Tx)}stopPing(){this.pingTimer&&(clearInterval(this.pingTimer),this.pingTimer=null)}dropSocket(){if(this.ws){try{this.ws.onclose=null,this.ws.close()}catch{}this.ws=null}}clearTimers(){this.stopPing(),this.reconnectTimer&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null)}}const Ix=200,Ox=12e3;function Px(e,t){const r=re([]),n=re(!1),a=re(!1);let i=null,o=null,s=null,l=null;function c(){s&&clearTimeout(s),s=setTimeout(()=>{s=null,t.reload()},Ix)}function u(b){o&&b.path&&b.path!==o||(r.value=Array.isArray(b.users)?b.users:[])}function d(b){a.value=b,b?(r.value=[],l||(l=setInterval(()=>t.reload(),Ox))):l&&(clearInterval(l),l=null)}function f(){i||(i=new zx({getTicket:()=>e.wsTicket(),handlers:{onChange:c,onPresence:u,onFallback:d,onStatus:b=>{n.value=b}}}))}function p(b){r.value=[],o=b,i==null||i.subscribe(b)}function _(b){i==null||i.setFocus(b)}function h(){s&&(clearTimeout(s),s=null),l&&(clearInterval(l),l=null),i==null||i.close(),i=null,a.value=!1}return{presenceUsers:r,connected:n,degraded:a,start:f,subscribe:p,setFocus:_,stop:h}}const Fx=500;function Rx(e,t){const r=re({}),n=[],a=new Set,i=new Set;function o(c){if(/^https?:\/\//i.test(c))return c;const u=(e||"").replace(/\/+$/,"");return u&&c.startsWith("/")?u+c:c}function s(c){const u=c.thumb_url;if(!u)return null;const d=r.value[u];return d||(!a.has(u)&&!i.has(u)&&l(u),null)}async function l(c){i.add(c);try{const u=await fetch(o(c),{headers:await t.authHeaders({Accept:"*/*"}),credentials:t.credentialsMode()});if(!u.ok)throw new Error(String(u.status));const d=await u.blob();if(n.length>=Fx){const f=n.shift();if(f&&r.value[f]){URL.revokeObjectURL(r.value[f]);const p={...r.value};delete p[f],r.value=p}}n.push(c),r.value={...r.value,[c]:URL.createObjectURL(d)}}catch{a.add(c)}finally{i.delete(c)}}return{src:s}}let I0=null,O0=null,P0=null,yf=null;function _f(){I0||(I0=import("monaco-editor").then(e=>(P0=e.default??e,P0)).catch(()=>(P0=null,null))),O0||(O0=import("highlight.js").then(e=>(yf=e.default??e,yf)).catch(()=>(yf=null,null)))}async function Uv(){return I0||_f(),I0}async function Hv(){return O0||_f(),O0}function Lx(){return P0}const Bx={key:0,class:"fx-presence-chips"},$x=["title"],Nx={key:0,class:"fx-presence-dot","aria-hidden":"true"},Ux={class:"fx-presence-chip-name"},Hx={key:0,class:"fx-presence-chip-file"},jx=["title"],Gx=["title"],Vx={key:0,class:"fx-presence-dot","aria-hidden":"true"},qx={key:0,class:"fx-presence-more"},Kx=["title"],Wx={class:"fx-presence-file"},Yx=["title","aria-expanded"],jv="filex.presence.expanded",Xx=Pt({__name:"PresenceBar",props:{users:{},selfId:{},locale:{}},setup(e){const t=e,{t:r}=br(()=>t.locale??"tr"),n=Fe(()=>(t.users??[]).filter(u=>t.selfId==null||u.id!==t.selfId)),a=re((()=>{try{return localStorage.getItem(jv)==="1"}catch{return!1}})());function i(){a.value=!a.value;try{localStorage.setItem(jv,a.value?"1":"0")}catch{}}function o(u){return u.uid??String(u.id)}function s(u){const d=u.trim().split(/\s+/).filter(Boolean);return d.length===0?"?":d.length===1?d[0].slice(0,2).toUpperCase():(d[0][0]+d[d.length-1][0]).toUpperCase()}function l(u){const d=o(u);let f=0;for(let p=0;p<d.length;p++)f=f*31+d.charCodeAt(p)>>>0;return f%360}function c(u){return u.file?`${u.name} · ${u.file}`:u.name}return(u,d)=>n.value.length?(R(),$("div",{key:0,class:vt(["fx-presence",{"fx-presence--wide":a.value}])},[a.value?(R(),$("div",Bx,[(R(!0),$(qe,null,xt(n.value,f=>(R(),$("span",{key:o(f),class:"fx-presence-chip",title:c(f)},[T("span",{class:"fx-presence-avatar",style:Sn({backgroundColor:`hsl(${l(f)} 60% 45%)`})},[$t(V(s(f.name))+" ",1),f.file?(R(),$("span",Nx)):Te("",!0)],4),T("span",Ux,V(f.name),1),f.file?(R(),$("span",Hx,"· "+V(f.file),1)):Te("",!0)],8,$x))),128))])):(R(),$(qe,{key:1},[T("div",{class:"fx-presence-avatars",title:n.value.map(c).join(", ")},[(R(!0),$(qe,null,xt(n.value.slice(0,5),f=>(R(),$("span",{key:o(f),class:"fx-presence-avatar",style:Sn({backgroundColor:`hsl(${l(f)} 60% 45%)`}),title:c(f)},[$t(V(s(f.name))+" ",1),f.file?(R(),$("span",Vx)):Te("",!0)],12,Gx))),128)),n.value.length>5?(R(),$("span",qx,"+"+V(n.value.length-5),1)):Te("",!0)],8,jx),T("span",{class:"fx-presence-text",title:n.value.map(c).join(", ")},[$t(V(n.value.length===1?n.value[0].name:`${n.value.length} kişi`)+" ",1),n.value.length===1&&n.value[0].file?(R(),$(qe,{key:0},[d[0]||(d[0]=$t(" · ",-1)),T("span",Wx,V(n.value[0].file),1)],64)):Te("",!0)],8,Kx)],64)),T("button",{type:"button",class:"fx-presence-toggle",title:a.value?Y(r)("presence.collapse"):Y(r)("presence.expand"),"aria-expanded":a.value,onClick:i},V(a.value?"‹":"›"),9,Yx)],2)):Te("",!0)}}),fn=(e,t)=>{const r=e.__vccOpts||e;for(const[n,a]of t)r[n]=a;return r},Zx=fn(Xx,[["__scopeId","data-v-7e8c1920"]]),Jx=["data-prefers-dark"],Qx=["aria-label"],e8=["aria-label","onKeydown"],t8={class:"fe-sheet__items"},r8={key:0,class:"fe-ctx__sep",role:"separator"},n8=["disabled","onClick"],a8={key:0,class:"fe-ctx__icon","aria-hidden":"true"},i8={class:"fe-ctx__label"},o8=["aria-label"],s8={key:0,class:"fe-ctx__sep",role:"separator"},l8=["disabled","onClick"],c8={key:0,class:"fe-ctx__icon","aria-hidden":"true"},u8={class:"fe-ctx__label"},xf=Pt({__name:"ContextMenu",props:{locale:{},actions:{},theme:{},sheet:{type:Boolean}},emits:["select"],setup(e,{expose:t,emit:r}){const n=e,a=r,{t:i}=br(()=>n.locale),o=re(!1),s=re(0),l=re(0),c=re([]),u=re(null);let d=0,f=0,p=null;async function _(q,j){var P;if(p=document.activeElement??null,o.value=!0,s.value=q.clientX,l.value=q.clientY,d=q.clientX,f=q.clientY,c.value=j,await Nr(),n.sheet){(P=g.value)==null||P.focus();return}h(),m(0)}function h(){const q=u.value;if(!q||typeof window>"u")return;const j=q.getBoundingClientRect(),P=8,N=window.innerWidth,X=window.innerHeight;if(f+j.height>X-P){const Ee=f-j.height;l.value=Ee>=P?Ee:Math.max(P,X-j.height-P)}if(d+j.width>N-P){const Ee=d-j.width;s.value=Ee>=P?Ee:Math.max(P,N-j.width-P)}}function b(){var q;o.value=!1,S.value=!1,M.value=0,(q=p==null?void 0:p.focus)==null||q.call(p),p=null}function v(){const q=n.sheet?g.value:u.value;return q?Array.from(q.querySelectorAll(".fe-ctx__item:not(:disabled)")):[]}function m(q){var N;const j=v();if(j.length===0)return;const P=(q%j.length+j.length)%j.length;(N=j[P])==null||N.focus()}function y(q){const j=v();if(j.length===0)return;const P=document.activeElement,N=P?j.indexOf(P):-1;if(N===-1){m(q>0?0:j.length-1);return}m(N+q)}const g=re(null),S=re(!1),M=re(0);let E=0;function w(q){const j=q.touches[0];j&&(S.value=!0,E=j.clientY,M.value=0)}function x(q){if(!S.value)return;const j=q.touches[0];j&&(M.value=Math.max(0,j.clientY-E))}function C(){if(!S.value)return;const q=M.value>72;S.value=!1,q?b():M.value=0}const D=Fe(()=>M.value>0?{transform:`translateY(${M.value}px)`,transition:"none"}:void 0);function B(q){q.disabled||(a("select",q,c.value),b())}function F(q){if(q.key==="Escape"){q.stopPropagation(),b();return}if(q.key==="Enter"||q.key===" "){q.stopPropagation();return}q.key==="ArrowDown"?(q.preventDefault(),q.stopPropagation(),y(1)):q.key==="ArrowUp"?(q.preventDefault(),q.stopPropagation(),y(-1)):q.key==="Home"?(q.preventDefault(),m(0)):q.key==="End"?(q.preventDefault(),m(-1)):q.key==="Tab"&&(q.preventDefault(),b())}const K=Fe(()=>{const q=n.actions.filter(P=>!P.hidden),j=[];for(const P of q)P.divider&&(j.length===0||j[j.length-1].divider)||j.push(P);for(;j.length>0&&j[j.length-1].divider;)j.pop();return j}),te=re(!1);let J;function ne(q){te.value=!!(q&&"matches"in q&&q.matches)}Xt(()=>{var q;typeof window>"u"||(J=window.matchMedia("(prefers-color-scheme: dark)"),ne(J),(q=J.addEventListener)==null||q.call(J,"change",ne))}),tr(()=>{var q;(q=J==null?void 0:J.removeEventListener)==null||q.call(J,"change",ne)});const le=Fe(()=>`fe-ctx-backdrop--theme-${n.theme||"auto"}`);return t({show:_,hide:b}),(q,j)=>(R(),Zt(l1,{to:"body"},[Dt(Za,{name:e.sheet?"fe-sheet":"fe-ctx"},{default:ur(()=>[o.value?(R(),$("div",{key:0,class:vt(["fe-ctx-backdrop",[le.value,{"fe-ctx-backdrop--sheet":e.sheet}]]),"data-prefers-dark":te.value?"1":"0",onClick:b,onContextmenu:Ht(b,["prevent"]),onKeydown:F},[e.sheet?(R(),$("div",{key:0,ref_key:"sheetEl",ref:g,class:"fe-sheet",role:"menu","aria-label":Y(i)("sheet.menu"),tabindex:"-1",style:Sn(D.value),onClick:j[0]||(j[0]=Ht(()=>{},["stop"]))},[T("div",{class:"fe-sheet__handle",role:"button",tabindex:"0","aria-label":Y(i)("sheet.close"),onClick:b,onKeydown:un(Ht(b,["prevent"]),["enter"]),onTouchstartPassive:w,onTouchmovePassive:x,onTouchend:C,onTouchcancel:C},null,40,e8),T("div",t8,[(R(!0),$(qe,null,xt(K.value,(P,N)=>(R(),$(qe,{key:P.key||N},[P.divider?(R(),$("div",r8)):(R(),$("button",{key:1,type:"button",class:vt(["fe-ctx__item fe-sheet__item",{"is-danger":P.danger,"is-disabled":P.disabled}]),disabled:P.disabled,role:"menuitem",onClick:X=>B(P)},[P.icon?(R(),$("span",a8,V(P.icon),1)):Te("",!0),T("span",i8,V(P.label),1)],10,n8))],64))),128))])],12,Qx)):(R(),$("div",{key:1,ref_key:"menuEl",ref:u,class:"fe-ctx",role:"menu","aria-orientation":"vertical","aria-label":Y(i)("sheet.menu"),style:Sn({top:l.value+"px",left:s.value+"px"}),onClick:j[1]||(j[1]=Ht(()=>{},["stop"]))},[(R(!0),$(qe,null,xt(K.value,(P,N)=>(R(),$(qe,{key:P.key||N},[P.divider?(R(),$("div",s8)):(R(),$("button",{key:1,type:"button",class:vt(["fe-ctx__item",{"is-danger":P.danger,"is-disabled":P.disabled}]),disabled:P.disabled,role:"menuitem",onClick:X=>B(P)},[P.icon?(R(),$("span",c8,V(P.icon),1)):Te("",!0),T("span",u8,V(P.label),1)],10,l8))],64))),128))],12,o8))],42,Jx)):Te("",!0)]),_:1},8,["name"])]))}}),f8=["title","aria-label"],d8=["title"],p8={class:"fe-btn__label"},h8=["disabled","title","onClick"],v8={class:"fe-icon"},m8={class:"fe-btn__label"},g8=["title","aria-label"],b8={class:"fe-icon"},y8={class:"fe-btn__label"},_8=["title"],x8={class:"fe-btn__label"},w8={class:"fe-toolbar__search-group"},k8={class:"fe-search"},S8=["placeholder","value","aria-label"],C8=["title","aria-label"],E8=["title","aria-label"],A8=["aria-pressed","aria-label","title"],T8={key:0,class:"fe-ficon",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","aria-hidden":"true",focusable:"false"},M8={key:1,class:"fe-ficon",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","aria-hidden":"true",focusable:"false"},D8=["aria-pressed","title","aria-label"],z8=["title","aria-label"],I8=["aria-label"],O8=["aria-selected","title","aria-label"],P8=["aria-selected","title","aria-label"],F8=["aria-selected","title","aria-label"],R8={class:"fe-search fe-search--full"},L8=["placeholder","value","aria-label","onKeydown"],B8=["title","aria-label"],$8=["title","aria-label"],N8=["title","aria-label"],U8=["title","aria-label"],H8=["title","aria-label"],Gv="filex.density",j8=40,G8=Pt({__name:"Toolbar",props:{viewMode:{},searchQuery:{},trashActive:{type:Boolean},actions:{},selectionMode:{},pasteEnabled:{type:Boolean},convertEnabled:{type:Boolean},canGoUp:{type:Boolean},atVirtualRoot:{type:Boolean},canWrite:{type:Boolean},locale:{},narrow:{type:Boolean},theme:{},inspectorOpen:{type:Boolean}},emits:["update:viewMode","update:searchQuery","new-folder","upload","refresh","go-up","action","open-recents","update:density","toggle-inspector","open-theme","open-shortcut-settings"],setup(e,{expose:t,emit:r}){const n=e,a=r,i=re((()=>{try{return localStorage.getItem(Gv)==="compact"?"compact":"comfortable"}catch{return"comfortable"}})());Xt(()=>a("update:density",i.value));function o(){i.value=i.value==="compact"?"comfortable":"compact";try{localStorage.setItem(Gv,i.value)}catch{}a("update:density",i.value)}const{t:s}=br(()=>n.locale),l=re(null),c=re(n.searchQuery);At(()=>n.searchQuery,P=>{c.value=P});let u;function d(P){const N=P.target.value;c.value=N,u&&clearTimeout(u),u=setTimeout(()=>a("update:searchQuery",N),200)}async function f(){var P,N;n.narrow&&!C.value&&(C.value=!0,await Nr()),(P=l.value)==null||P.focus(),(N=l.value)==null||N.select()}t({focusSearch:f});const p=Fe(()=>n.selectionMode??"none"),_=Fe(()=>n.actions.filter(P=>!P.divider&&!P.hidden)),h=re(null),b=re(null),v=re(null),m=re(null),y=re(Number.MAX_SAFE_INTEGER),g=Fe(()=>_.value.slice(0,y.value)),S=Fe(()=>_.value.slice(y.value));function M(){if(n.narrow)return;const P=h.value,N=b.value;if(!P||!N){y.value=_.value.length;return}const X=parseFloat(getComputedStyle(P).gap)||8;let Ee=0;for(const De of Array.from(P.children))De===N||De===v.value||De.classList.contains("fe-btn--fold")||De.offsetWidth>0&&(Ee+=De.offsetWidth+X);const Ae=Array.from(N.children).map(De=>De.offsetWidth+X),ze=Ae.reduce((De,Be)=>De+Be,0),Le=P.clientWidth-Ee;if(ze<=Le){y.value=Ae.length;return}let he=j8+X,Ie=0;for(const De of Ae){if(he+De>Le)break;he+=De,Ie+=1}y.value=Ie}let E;Xt(()=>{typeof ResizeObserver<"u"&&h.value&&(E=new ResizeObserver(()=>M()),E.observe(h.value)),Nr(M)}),tr(()=>E==null?void 0:E.disconnect()),At(()=>[_.value,n.narrow,n.trashActive,p.value],()=>void Nr(M),{deep:!1});function w(){var N,X;const P=(N=v.value)==null?void 0:N.getBoundingClientRect();(X=m.value)==null||X.show({clientX:P?P.right:0,clientY:P?P.bottom+4:0},[])}function x(P){a("action",P)}const C=re(!1);At(()=>n.narrow,P=>{P||(C.value=!1)});async function D(){var P;C.value=!0,await Nr(),(P=l.value)==null||P.focus()}function B(){C.value=!1}const F=re(!1);let K;function te(P){F.value=!!(P&&"matches"in P&&P.matches)}Xt(()=>{var P;typeof window>"u"||!window.matchMedia||(K=window.matchMedia("(pointer: coarse)"),te(K),(P=K.addEventListener)==null||P.call(K,"change",te))}),tr(()=>{var P;(P=K==null?void 0:K.removeEventListener)==null||P.call(K,"change",te)});const J=re(null),ne=re(null),le=Fe(()=>{const P=[],N=!n.trashActive&&!n.atVirtualRoot&&n.canWrite!==!1;return p.value==="none"&&N&&(P.push({key:"new-folder",label:s("toolbar.new_folder"),icon:"📁"}),n.pasteEnabled&&P.push({key:"paste",label:s("ctx.paste"),icon:"📋"})),P.push(..._.value),P.length&&P.push({divider:!0,key:"bag-sep",label:""}),P.push({key:"refresh",label:s("toolbar.refresh"),icon:"↻"}),P.push({key:"density",label:i.value==="compact"?s("toolbar.density.comfortable"):s("toolbar.density.compact"),icon:"⇅"}),n.viewMode!=="list"&&P.push({key:"view-list",label:s("toolbar.view.list"),icon:"☰"}),n.viewMode!=="grid"&&P.push({key:"view-grid",label:s("toolbar.view.grid"),icon:"▦"}),n.viewMode!=="gallery"&&P.push({key:"view-gallery",label:s("toolbar.view.gallery"),icon:"▣"}),P.push({key:"inspector",label:s("toolbar.inspector"),icon:"ℹ"}),P.push({key:"theme",label:s("theme.menu"),icon:"🎨"}),P.push({key:"shortcut-settings",label:s("shortcuts.settings.menu"),icon:"⌨"}),P.push({key:"tour",label:s("tour.restart"),icon:"🎓"}),P});function q(){var N,X;const P=(N=J.value)==null?void 0:N.getBoundingClientRect();(X=ne.value)==null||X.show({clientX:P?P.right:0,clientY:P?P.bottom+4:0},[])}function j(P){var N;switch(P.key){case"new-folder":a("new-folder");break;case"refresh":a("refresh");break;case"density":o();break;case"view-list":a("update:viewMode","list");break;case"view-grid":a("update:viewMode","grid");break;case"view-gallery":a("update:viewMode","gallery");break;case"inspector":a("toggle-inspector");break;case"theme":a("open-theme");break;case"shortcut-settings":a("open-shortcut-settings");break;case"tour":(N=J.value)==null||N.dispatchEvent(new CustomEvent("fe:tour-restart",{bubbles:!0}));break;default:x(P.key)}}return(P,N)=>(R(),$("div",{class:vt(["fe-toolbar",{"fe-toolbar--narrow":e.narrow,"fe-toolbar--searching":e.narrow&&C.value}])},[e.narrow?(R(),$(qe,{key:1},[C.value?(R(),$(qe,{key:0},[T("div",R8,[T("input",{ref_key:"searchEl",ref:l,type:"search",class:"fe-search__input",placeholder:Y(s)("toolbar.search.placeholder"),value:c.value,"aria-label":Y(s)("toolbar.search"),onInput:d,onKeydown:un(Ht(B,["stop","prevent"]),["esc"])},null,40,L8)]),T("button",{type:"button",class:"fe-btn fe-btn--icon-only",title:Y(s)("toolbar.search.close"),"aria-label":Y(s)("toolbar.search.close"),onClick:B},[...N[27]||(N[27]=[T("span",{class:"fe-icon"},"✕",-1)])],8,B8)],64)):(R(),$(qe,{key:1},[e.canGoUp?(R(),$("button",{key:0,type:"button",class:"fe-btn fe-btn--icon-only",title:Y(s)("toolbar.go_up"),"aria-label":Y(s)("toolbar.go_up"),onClick:N[10]||(N[10]=X=>a("go-up"))},[...N[28]||(N[28]=[T("span",{class:"fe-icon"},"↑",-1)])],8,$8)):Te("",!0),N[32]||(N[32]=T("div",{class:"fe-toolbar__spacer"},null,-1)),T("button",{type:"button",class:vt(["fe-btn fe-btn--icon-only fe-toolbar__search-toggle",{"is-active":!!c.value}]),title:Y(s)("toolbar.search"),"aria-label":Y(s)("toolbar.search"),onClick:D},[...N[29]||(N[29]=[T("span",{class:"fe-icon"},"🔍",-1)])],10,N8),!e.atVirtualRoot&&e.canWrite!==!1?(R(),$("button",{key:1,type:"button",class:"fe-btn fe-btn--icon-only",title:Y(s)("toolbar.upload"),"aria-label":Y(s)("toolbar.upload"),onClick:N[11]||(N[11]=X=>a("upload"))},[...N[30]||(N[30]=[T("span",{class:"fe-icon"},"⬆",-1)])],8,U8)):Te("",!0),T("button",{ref_key:"moreBtnEl",ref:J,type:"button",class:"fe-btn fe-btn--icon-only fe-toolbar__more",title:Y(s)("toolbar.more"),"aria-label":Y(s)("toolbar.more"),"aria-haspopup":"menu",onClick:q},[...N[31]||(N[31]=[T("span",{class:"fe-icon"},"⋯",-1)])],8,H8)],64)),Dt(xf,{ref_key:"moreRef",ref:ne,locale:e.locale,theme:e.theme||"auto",sheet:F.value,actions:le.value,onSelect:j},null,8,["locale","theme","sheet","actions"])],64)):(R(),$(qe,{key:0},[T("div",{ref_key:"primaryEl",ref:h,class:"fe-toolbar__primary"},[e.canGoUp?(R(),$("button",{key:0,type:"button",class:"fe-btn fe-btn--icon-only",title:Y(s)("toolbar.go_up"),"aria-label":Y(s)("toolbar.go_up"),onClick:N[0]||(N[0]=X=>a("go-up"))},[...N[13]||(N[13]=[T("span",{class:"fe-icon"},"↑",-1)])],8,f8)):Te("",!0),p.value==="none"&&!e.trashActive&&!e.atVirtualRoot&&e.canWrite!==!1?(R(),$("button",{key:1,type:"button",class:"fe-btn fe-btn--primary",title:Y(s)("toolbar.new_folder"),onClick:N[1]||(N[1]=X=>a("new-folder"))},[N[14]||(N[14]=T("span",{class:"fe-icon"},"📁",-1)),T("span",p8,V(Y(s)("toolbar.new_folder")),1)],8,d8)):Te("",!0),(R(!0),$(qe,null,xt(g.value,X=>(R(),$("button",{key:X.key,type:"button",class:vt(["fe-btn fe-btn--fold",{"fe-btn--danger":X.danger,"is-disabled":X.disabled}]),disabled:X.disabled,title:X.label,onClick:Ee=>x(X.key)},[T("span",v8,V(X.icon),1),T("span",m8,V(X.label),1)],10,h8))),128)),S.value.length>0?(R(),$("button",{key:2,ref_key:"wideMoreBtnEl",ref:v,type:"button",class:"fe-btn fe-btn--icon-only",title:Y(s)("toolbar.more"),"aria-label":Y(s)("toolbar.more"),"aria-haspopup":"menu",onClick:w},[...N[15]||(N[15]=[T("span",{class:"fe-icon"},"⋯",-1)])],8,g8)):Te("",!0),T("div",{ref_key:"measureEl",ref:b,class:"fe-toolbar__measure","aria-hidden":"true"},[(R(!0),$(qe,null,xt(_.value,X=>(R(),$("button",{key:"m-"+X.key,type:"button",class:"fe-btn",tabindex:"-1"},[T("span",b8,V(X.icon),1),T("span",y8,V(X.label),1)]))),128))],512),e.pasteEnabled&&p.value==="none"&&!e.trashActive&&!e.atVirtualRoot&&e.canWrite!==!1?(R(),$("button",{key:3,type:"button",class:"fe-btn",title:Y(s)("ctx.paste"),onClick:N[2]||(N[2]=X=>x("paste"))},[N[16]||(N[16]=T("span",{class:"fe-icon"},"📋",-1)),T("span",x8,V(Y(s)("ctx.paste")),1)],8,_8)):Te("",!0)],512),N[26]||(N[26]=T("div",{class:"fe-toolbar__spacer"},null,-1)),T("div",w8,[T("div",k8,[T("input",{ref_key:"searchEl",ref:l,type:"search",class:"fe-search__input",placeholder:Y(s)("toolbar.search.placeholder"),value:c.value,"aria-label":Y(s)("toolbar.search"),onInput:d},null,40,S8)]),!e.atVirtualRoot&&e.canWrite!==!1?(R(),$("button",{key:0,type:"button",class:"fe-btn fe-btn--icon-only",title:Y(s)("toolbar.upload"),"aria-label":Y(s)("toolbar.upload"),onClick:N[3]||(N[3]=X=>a("upload"))},[...N[17]||(N[17]=[T("span",{class:"fe-icon","aria-hidden":"true"},"⬆",-1)])],8,C8)):Te("",!0),T("button",{type:"button",class:"fe-btn fe-btn--icon-only",title:Y(s)("toolbar.refresh"),"aria-label":Y(s)("toolbar.refresh"),onClick:N[4]||(N[4]=X=>a("refresh"))},[...N[18]||(N[18]=[T("span",{class:"fe-icon","aria-hidden":"true"},"↻",-1)])],8,E8)]),T("button",{type:"button",class:vt(["fe-btn fe-btn--icon-only fe-toolbar__density",{"is-active":i.value==="compact"}]),"aria-pressed":i.value==="compact","aria-label":i.value==="compact"?Y(s)("toolbar.density.comfortable"):Y(s)("toolbar.density.compact"),title:i.value==="compact"?Y(s)("toolbar.density.comfortable"):Y(s)("toolbar.density.compact"),onClick:o},[i.value==="compact"?(R(),$("svg",T8,[...N[19]||(N[19]=[T("path",{d:"M4 6.5h16M4 10.5h16M4 14.5h16M4 18.5h16"},null,-1)])])):(R(),$("svg",M8,[...N[20]||(N[20]=[T("path",{d:"M4 5.5h16M4 12h16M4 18.5h16"},null,-1)])]))],10,A8),T("button",{type:"button",class:vt(["fe-btn fe-btn--icon-only fe-toolbar__inspector",{"is-active":e.inspectorOpen}]),"aria-pressed":!!e.inspectorOpen,title:Y(s)("toolbar.inspector"),"aria-label":Y(s)("toolbar.inspector"),onClick:N[5]||(N[5]=X=>a("toggle-inspector"))},[...N[21]||(N[21]=[T("svg",{class:"fe-ficon",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","aria-hidden":"true",focusable:"false"},[T("circle",{cx:"12",cy:"12",r:"9"}),T("path",{d:"M12 11v5"}),T("circle",{cx:"12",cy:"7.6",r:"1",fill:"currentColor",stroke:"none"})],-1)])],10,D8),T("button",{type:"button",class:"fe-btn fe-btn--icon-only fe-toolbar__theme",title:Y(s)("theme.menu"),"aria-label":Y(s)("theme.menu"),onClick:N[6]||(N[6]=X=>a("open-theme"))},[...N[22]||(N[22]=[T("svg",{class:"fe-ficon",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true",focusable:"false"},[T("path",{d:"M12 3a9 9 0 1 0 0 18h1.4a2.1 2.1 0 0 0 1.5-3.6 2.1 2.1 0 0 1 1.5-3.6H19a2 2 0 0 0 2-2A9 9 0 0 0 12 3z"}),T("circle",{cx:"7.8",cy:"10.2",r:"1.15",fill:"currentColor",stroke:"none"}),T("circle",{cx:"11.6",cy:"7.2",r:"1.15",fill:"currentColor",stroke:"none"}),T("circle",{cx:"16",cy:"8.6",r:"1.15",fill:"currentColor",stroke:"none"})],-1)])],8,z8),T("div",{class:"fe-toolbar__view",role:"tablist","aria-label":Y(s)("toolbar.view_label")},[T("button",{type:"button",class:vt(["fe-btn fe-btn--icon-only",{"is-active":e.viewMode==="list"}]),role:"tab","aria-selected":e.viewMode==="list",title:Y(s)("toolbar.view.list"),"aria-label":Y(s)("toolbar.view.list"),onClick:N[7]||(N[7]=X=>a("update:viewMode","list"))},[...N[23]||(N[23]=[T("span",{class:"fe-icon","aria-hidden":"true"},"☰",-1)])],10,O8),T("button",{type:"button",class:vt(["fe-btn fe-btn--icon-only",{"is-active":e.viewMode==="grid"}]),role:"tab","aria-selected":e.viewMode==="grid",title:Y(s)("toolbar.view.grid"),"aria-label":Y(s)("toolbar.view.grid"),onClick:N[8]||(N[8]=X=>a("update:viewMode","grid"))},[...N[24]||(N[24]=[T("span",{class:"fe-icon","aria-hidden":"true"},"▦",-1)])],10,P8),T("button",{type:"button",class:vt(["fe-btn fe-btn--icon-only",{"is-active":e.viewMode==="gallery"}]),role:"tab","aria-selected":e.viewMode==="gallery",title:Y(s)("toolbar.view.gallery"),"aria-label":Y(s)("toolbar.view.gallery"),onClick:N[9]||(N[9]=X=>a("update:viewMode","gallery"))},[...N[25]||(N[25]=[T("span",{class:"fe-icon","aria-hidden":"true"},"▣",-1)])],10,F8)],8,I8)],64)),e.narrow?Te("",!0):(R(),Zt(xf,{key:2,ref_key:"wideMoreRef",ref:m,locale:e.locale,theme:e.theme||"auto",sheet:!1,actions:S.value,onSelect:N[12]||(N[12]=X=>x(X.key))},null,8,["locale","theme","actions"]))],2))}}),V8=["onClick"],q8=fn(Pt({__name:"TagPicker",props:{nodeId:{},apiBase:{},authHeaders:{type:Function},palette:{}},emits:["change","error"],setup(e,{emit:t}){const r=e,n=t,a=re([]),i=re(!1),o=re(!1),s=re(""),l=Fe(()=>r.palette??["#ef4444","#f59e0b","#10b981","#3b82f6","#8b5cf6","#ec4899","#14b8a6","#f97316"]);function c(h){let b=0;for(let m=0;m<h.length;m++)b=b*31+h.charCodeAt(m)|0;const v=l.value;return v[Math.abs(b)%v.length]}async function u(h={}){return{...await(r.authHeaders??(()=>({})))(),...h}}async function d(){i.value=!0;try{const h=r.apiBase??"",b=await fetch(`${h}/api/files/manager/tags?node_id=${r.nodeId}`,{headers:await u(),credentials:"include"});if(b.ok){const v=await b.json();a.value=Array.isArray(v.tags)?v.tags:[]}}catch(h){n("error",h instanceof Error?h.message:String(h))}finally{i.value=!1}}async function f(h){const b=[...a.value];a.value=h;try{const v=r.apiBase??"",m=await fetch(`${v}/api/files/manager/tags`,{method:"POST",headers:await u({"Content-Type":"application/json"}),credentials:"include",body:JSON.stringify({node_id:r.nodeId,tags:h})});if(!m.ok)throw new Error(`tag save failed: ${m.status}`);n("change",h)}catch(v){a.value=b,n("error",v instanceof Error?v.message:String(v))}}function p(){const h=s.value.trim();if(!h||a.value.includes(h)){s.value="",o.value=!1;return}f([...a.value,h]),s.value="",o.value=!1}function _(h){f(a.value.filter(b=>b!==h))}return Xt(d),At(()=>r.nodeId,d),(h,b)=>(R(),$("div",{class:vt(["filex-tag-picker",{"is-loading":i.value}])},[(R(!0),$(qe,null,xt(a.value,v=>(R(),$("span",{key:v,class:"filex-tag",style:Sn({"--filex-tag-color":c(v)})},[$t(V(v)+" ",1),T("button",{class:"filex-tag-x",type:"button",onClick:m=>_(v),"aria-label":"Remove tag"},"×",8,V8)],4))),128)),o.value?(R(),$("form",{key:0,class:"filex-tag-add",onSubmit:Ht(p,["prevent"])},[Yt(T("input",{"onUpdate:modelValue":b[0]||(b[0]=v=>s.value=v),autofocus:"",placeholder:"tag name",onBlur:p,onKeydown:b[1]||(b[1]=un(v=>{o.value=!1,s.value=""},["escape"]))},null,544),[[Ir,s.value]])],32)):(R(),$("button",{key:1,class:"filex-tag-add-btn",type:"button",onClick:b[2]||(b[2]=v=>o.value=!0)},"+ Add tag"))],2))}}),[["__scopeId","data-v-f2104118"]]),K8={class:"filex-recent"},W8=["disabled"],Y8={key:0},X8=["onClick"],Z8={class:"filex-recent-name"},J8={class:"filex-recent-meta"},Q8={key:1,class:"filex-recent-empty"},e7={key:2,class:"filex-recent-empty"},t7=fn(Pt({__name:"RecentlyOpened",props:{apiBase:{},authHeaders:{type:Function},limit:{},refreshKey:{}},emits:["open","error"],setup(e,{emit:t}){const r=e,n=t,a=re([]),i=re(!1);async function o(){i.value=!0;try{const l=await(r.authHeaders??(()=>({})))(),c=r.apiBase??"",u=r.limit??20,d=await fetch(`${c}/api/files/manager/recent?limit=${u}`,{headers:l,credentials:"include"});if(d.ok){const f=await d.json();a.value=Array.isArray(f.entries)?f.entries:Array.isArray(f)?f:[]}}catch(l){n("error",l instanceof Error?l.message:String(l))}finally{i.value=!1}}function s(l){if(!l)return"";const c=new Date(l).getTime();if(Number.isNaN(c))return"";const u=Date.now()-c;return u<6e4?"just now":u<36e5?`${Math.floor(u/6e4)}m ago`:u<864e5?`${Math.floor(u/36e5)}h ago`:`${Math.floor(u/864e5)}d ago`}return Xt(o),At(()=>r.refreshKey,o),(l,c)=>(R(),$("div",K8,[T("header",null,[c[0]||(c[0]=T("h3",null,"Recently opened",-1)),T("button",{class:"filex-recent-refresh",type:"button",onClick:o,disabled:i.value}," ↻ ",8,W8)]),a.value.length?(R(),$("ul",Y8,[(R(!0),$(qe,null,xt(a.value,u=>(R(),$("li",{key:u.id},[T("button",{type:"button",onClick:d=>n("open",u),class:"filex-recent-item"},[T("span",Z8,V(u.name),1),T("span",J8,V(s(u.last_opened)),1)],8,X8)]))),128))])):i.value?(R(),$("p",e7,"Loading…")):(R(),$("p",Q8,"Nothing here yet."))]))}}),[["__scopeId","data-v-ff50baed"]]),r7={class:"fe-breadcrumb","aria-label":"Breadcrumb"},n7=["aria-current","onClick","onContextmenu","onDrop"],a7={key:0,class:"fe-breadcrumb__sep","aria-hidden":"true"},i7=["aria-expanded","aria-label","title"],o7={key:0,class:"fe-breadcrumb__menu",role:"menu"},s7=["onClick"],l7=["aria-current","onClick","onContextmenu","onDrop"],c7={key:0,class:"fe-breadcrumb__sep","aria-hidden":"true"},u7=["title","aria-label"],f7=["placeholder","onKeydown"],d7=4,p7=Pt({__name:"Breadcrumb",props:{dirname:{},adapter:{},rootLabel:{},locale:{},multiStorageRoot:{type:Boolean},rootPath:{}},emits:["navigate","copy-path","crumb-context","crumb-drop"],setup(e,{emit:t}){const r=e,n=Fe(()=>{if(!r.rootPath)return"";const D=r.rootPath,B=D.indexOf("://");return(B>=0?D.slice(B+3):D).replace(/^\/+|\/+$/g,"")}),a=Fe(()=>{const D=n.value;if(!D)return r.rootLabel||r.adapter;const B=D.split("/");return B[B.length-1]||r.rootLabel||r.adapter}),{t:i}=br(()=>r.locale),o=t,s=Fe(()=>{const D=`${r.adapter}://`,B=r.dirname.startsWith(D)?r.dirname.slice(D.length):r.dirname,F=B.split("/").filter(Boolean),K=[];if(r.rootPath){const J=n.value,ne=B.replace(/^\/+|\/+$/g,""),le=J&&(ne===J||ne.startsWith(J+"/"))?ne.slice(J.length).replace(/^\/+/,""):"";K.push({label:a.value,adapterPath:r.rootPath});let q=J;for(const j of le.split("/").filter(Boolean))q=q?`${q}/${j}`:j,K.push({label:j===".trash"?i("node.trash"):j,adapterPath:`${D}${q}`});return K}r.multiStorageRoot?(K.push({label:"/",adapterPath:""}),r.adapter&&K.push({label:r.rootLabel||r.adapter,adapterPath:D})):K.push({label:r.rootLabel||r.adapter,adapterPath:D});let te="";for(const J of F){te=te?`${te}/${J}`:J;const ne=J===".trash"?i("node.trash"):J;K.push({label:ne,adapterPath:`${D}${te}`})}return K}),l=Fe(()=>s.value.length>d7),c=Fe(()=>l.value?s.value.slice(0,1):s.value),u=Fe(()=>l.value?s.value.slice(1,-2):[]),d=Fe(()=>l.value?s.value.slice(-2):[]),f=re(!1),p=re(null);function _(D){f.value=!1,o("navigate",D.adapterPath)}function h(D){const B=p.value;B&&D.target instanceof Node&&B.contains(D.target)||(f.value=!1)}function b(D){D.key==="Escape"&&(D.stopPropagation(),f.value=!1)}At(f,D=>{D?(document.addEventListener("click",h,!0),document.addEventListener("keydown",b,!0)):(document.removeEventListener("click",h,!0),document.removeEventListener("keydown",b,!0))}),At(s,()=>{f.value=!1}),tr(()=>{document.removeEventListener("click",h,!0),document.removeEventListener("keydown",b,!0)});function v(D){o("navigate",D.adapterPath)}function m(D,B){D.preventDefault(),D.stopPropagation(),o("crumb-context",{x:D.clientX,y:D.clientY,adapterPath:B.adapterPath,label:B.label})}function y(D){var B;(B=D.dataTransfer)!=null&&B.types.includes("application/x-brf-files")&&(D.preventDefault(),D.stopPropagation(),D.dataTransfer&&(D.dataTransfer.dropEffect="move"))}function g(D,B){var F;(F=D.dataTransfer)!=null&&F.types.includes("application/x-brf-files")&&(D.preventDefault(),D.stopPropagation(),o("crumb-drop",B.adapterPath,D))}const S=re(!1),M=re(""),E=re(null);function w(){const D=`${r.adapter}://`,B=r.dirname.startsWith(D)?r.dirname.slice(D.length):r.dirname;if(r.rootPath){const F=n.value,K=B.replace(/^\/+|\/+$/g,""),te=F&&(K===F||K.startsWith(F+"/"))?K.slice(F.length).replace(/^\/+/,""):"";M.value=te?`/${te}`:"/",S.value=!0,Nr(()=>{var J,ne;(J=E.value)==null||J.focus(),(ne=E.value)==null||ne.select()});return}if(r.multiStorageRoot)if(!r.adapter)M.value="/";else{const F=B.replace(/^\/+|\/+$/g,"");M.value=F?`/${r.adapter}/${F}`:`/${r.adapter}`}else M.value=B;S.value=!0,Nr(()=>{var F,K;(F=E.value)==null||F.focus(),(K=E.value)==null||K.select()})}function x(){const D=M.value.trim();if(S.value=!1,r.rootPath){const F=D.replace(/^\/+|\/+$/g,""),K=n.value,te=F?K?`${K}/${F}`:F:K;o("navigate",te?`${r.adapter}://${te}`:`${r.adapter}://`);return}if(r.multiStorageRoot){const F=D.replace(/^\/+|\/+$/g,"");if(!F){o("navigate","");return}const K=F.indexOf("/"),te=K===-1?F:F.slice(0,K),J=K===-1?"":F.slice(K+1);o("navigate",J?`${te}://${J}`:`${te}://`);return}const B=D.replace(/^\/+|\/+$/g,"");B&&o("navigate",`${r.adapter}://${B}`)}function C(){S.value=!1}return(D,B)=>(R(),$("nav",r7,[S.value?Yt((R(),$("input",{key:1,ref_key:"pathInput",ref:E,"onUpdate:modelValue":B[1]||(B[1]=F=>M.value=F),type:"text",class:"fe-breadcrumb__input",placeholder:Y(i)("breadcrumb.path_placeholder"),spellcheck:"false",autocomplete:"off",onKeydown:[un(Ht(x,["prevent"]),["enter"]),un(Ht(C,["prevent"]),["escape"])],onBlur:C},null,40,f7)),[[Ir,M.value]]):(R(),$(qe,{key:0},[(R(!0),$(qe,null,xt(c.value,(F,K)=>(R(),$("button",{key:F.adapterPath,class:vt(["fe-breadcrumb__crumb",{"is-last":!l.value&&K===c.value.length-1}]),type:"button","aria-current":!l.value&&K===c.value.length-1?"page":void 0,onClick:te=>v(F),onContextmenu:te=>m(te,F),onDragover:y,onDrop:te=>g(te,F)},[T("span",null,V(F.label),1),l.value||K<c.value.length-1?(R(),$("span",a7,"›")):Te("",!0)],42,n7))),128)),u.value.length?(R(),$("span",{key:0,ref_key:"moreWrapEl",ref:p,class:"fe-breadcrumb__more-wrap"},[T("button",{type:"button",class:"fe-breadcrumb__more","aria-haspopup":"menu","aria-expanded":f.value,"aria-label":Y(i)("breadcrumb.more"),title:Y(i)("breadcrumb.more"),onClick:B[0]||(B[0]=F=>f.value=!f.value)},"…",8,i7),B[2]||(B[2]=T("span",{class:"fe-breadcrumb__sep","aria-hidden":"true"},"›",-1)),f.value?(R(),$("div",o7,[(R(!0),$(qe,null,xt(u.value,F=>(R(),$("button",{key:F.adapterPath,type:"button",class:"fe-breadcrumb__menu-item",role:"menuitem",onClick:K=>_(F)},V(F.label),9,s7))),128))])):Te("",!0)],512)):Te("",!0),(R(!0),$(qe,null,xt(d.value,(F,K)=>(R(),$("button",{key:F.adapterPath,class:vt(["fe-breadcrumb__crumb",{"is-last":K===d.value.length-1}]),type:"button","aria-current":K===d.value.length-1?"page":void 0,onClick:te=>v(F),onContextmenu:te=>m(te,F),onDragover:y,onDrop:te=>g(te,F)},[T("span",null,V(F.label),1),K<d.value.length-1?(R(),$("span",c7,"›")):Te("",!0)],42,l7))),128)),T("button",{type:"button",class:"fe-breadcrumb__edit",title:Y(i)("breadcrumb.go_to_path"),"aria-label":Y(i)("breadcrumb.go_to_path"),onClick:w},"✏",8,u7)],64))]))}}),Vv={};function Aa(e,t){for(const r of t)Vv[r]=e}Aa("image",["jpg","jpeg","png","webp","gif","bmp","avif","heic","svg","ico","tiff","tif"]),Aa("video",["mp4","webm","mov","mkv","avi","ogv","m4v"]),Aa("audio",["mp3","wav","flac","ogg","m4a","aac","opus"]),Aa("pdf",["pdf"]),Aa("doc",["doc","docx","odt","rtf"]),Aa("sheet",["xls","xlsx","ods","csv"]),Aa("slides",["ppt","pptx","odp"]),Aa("archive",["zip","tar","gz","bz2","7z","rar","xz","zst"]),Aa("code",["js","ts","jsx","tsx","mjs","cjs","vue","py","go","rs","php","rb","java","kt","swift","c","cpp","h","hpp","cs","css","scss","less","html","htm","json","yml","yaml","xml","sh","bash","ps1","sql","toml"]),Aa("text",["txt","md","markdown","log","ini","conf","cfg","env"]);function h7(e){if(e.type==="dir")return"folder";const t=(e.extension||"").toLowerCase();return Vv[t]??"unknown"}const Ai='<path d="M6.5 3h7L18.5 8v11.5a1.5 1.5 0 0 1-1.5 1.5H6.5A1.5 1.5 0 0 1 5 19.5v-15A1.5 1.5 0 0 1 6.5 3z"/><path d="M13.5 3v5h5"/>',v7={folder:'<path d="M3 7a2 2 0 0 1 2-2h4.2l2 2.4H19a2 2 0 0 1 2 2V17a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z" fill="currentColor" fill-opacity="0.14"/>',image:'<rect x="3" y="5" width="18" height="14" rx="2"/><circle cx="8.6" cy="10" r="1.6"/><path d="M5.2 16.6l4.3-4.3 3 3 2.4-2.4 3.9 3.7"/>',video:'<rect x="3" y="5" width="18" height="14" rx="2"/><path d="M10.2 9.3v5.4l4.8-2.7z" fill="currentColor" stroke="none"/>',audio:'<path d="M9 17.5V7.2l9-2.2v10.4"/><circle cx="6.8" cy="17.6" r="2.2"/><circle cx="15.8" cy="15.5" r="2.2"/>',pdf:Ai+'<rect x="7.5" y="12" width="9" height="5" rx="1" fill="currentColor" fill-opacity="0.14"/>',doc:Ai+'<path d="M8.5 13h7M8.5 16h7"/>',sheet:Ai+'<path d="M8 12.5h8M8 15.5h8M8 18h8M12 12.5V18"/>',slides:Ai+'<rect x="8" y="12.5" width="8" height="5" rx="0.8"/>',archive:Ai+'<path d="M10 3v1.6M10 6.6v1.6M10 10.2v1.6"/><rect x="8.6" y="14" width="2.8" height="3.4" rx="0.8"/>',code:Ai+'<path d="M10.4 12.5L8.3 15l2.1 2.5M13.6 12.5l2.1 2.5-2.1 2.5"/>',text:Ai+'<path d="M8.5 12h7M8.5 15h7M8.5 18h4.5"/>',unknown:Ai+'<path d="M10.3 13.1a1.8 1.8 0 1 1 2.5 1.9c-.6.3-.8.7-.8 1.4"/><circle cx="12" cy="18.4" r="0.9" fill="currentColor" stroke="none"/>'},qv=new Map;function m7(e){let t=qv.get(e);return t||(t=`<svg class="fe-ficon fe-ficon--${e}" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false">${v7[e]}</svg>`,qv.set(e,t)),t}function Uo(e){return m7(h7(e))}function F0(e){const t=[];if(!e)return t;const r=/«([^«»]*)»/g;let n=0,a;for(;(a=r.exec(e))!==null;)a.index>n&&t.push({text:e.slice(n,a.index),match:!1}),a[1]&&t.push({text:a[1],match:!0}),n=a.index+a[0].length;return n<e.length&&t.push({text:e.slice(n),match:!1}),t}function Kv(e){return e==="content"||e==="both"}function wf(e,t,r){const n=e.dataTransfer;if(!(!n||typeof document>"u"||typeof n.setDragImage!="function"))try{const a=document.createElement("div");a.className="fe-dragghost";const i=document.createElement("span");if(i.className="fe-dragghost__name",i.textContent=t,a.appendChild(i),r>1){const o=document.createElement("span");o.className="fe-dragghost__badge",o.textContent=String(r),a.appendChild(o)}a.style.position="fixed",a.style.top="-1000px",a.style.left="-1000px",document.body.appendChild(a),n.setDragImage(a,14,14),setTimeout(()=>a.remove(),0)}catch{}}const g7=["aria-pressed","title"],b7={viewBox:"0 0 24 24",width:"16",height:"16","aria-hidden":"true"},y7=["fill"],_7={key:0,class:"filex-star-label"},x7=fn(Pt({__name:"StarButton",props:{starred:{type:Boolean},nodeId:{},apiBase:{},authHeaders:{type:Function},compact:{type:Boolean}},emits:["change","error"],setup(e,{emit:t}){const r=e,n=t,a=re(r.starred);At(()=>r.starred,o=>{a.value=o});async function i(){const o=!a.value;a.value=o;try{const s={"Content-Type":"application/json",...await(r.authHeaders??(()=>({})))()},l=r.apiBase??"",c=await fetch(`${l}/api/files/manager/star`,{method:"POST",headers:s,credentials:"include",body:JSON.stringify({node_id:r.nodeId,starred:o})});if(!c.ok)throw new Error(`star toggle failed: ${c.status}`);n("change",o)}catch(s){a.value=!o,n("error",s instanceof Error?s.message:String(s))}}return(o,s)=>(R(),$("button",{type:"button",class:vt(["filex-star-btn",{"is-starred":a.value,"is-compact":e.compact}]),"aria-pressed":a.value,title:a.value?"Unstar":"Star",onClick:Ht(i,["stop"])},[(R(),$("svg",b7,[T("path",{fill:a.value?"currentColor":"none",stroke:"currentColor","stroke-width":"2","stroke-linejoin":"round",d:"M12 2.5l3.09 6.26 6.91 1-5 4.87 1.18 6.87L12 18.27l-6.18 3.23L7 14.63 2 9.76l6.91-1z"},null,8,y7)])),e.compact?Te("",!0):(R(),$("span",_7,V(a.value?"Starred":"Star"),1))],10,g7))}}),[["__scopeId","data-v-1b788147"]]),w7=["aria-label","aria-busy"],k7={class:"fe-list__head",role:"row"},S7=["aria-label"],C7=["aria-sort"],E7=["title"],A7={key:0,class:"fe-list__sort-arrow","aria-hidden":"true"},T7=["aria-sort"],M7=["title"],D7={key:0,class:"fe-list__sort-arrow","aria-hidden":"true"},z7=["aria-sort"],I7=["title"],O7={key:0,class:"fe-list__sort-arrow","aria-hidden":"true"},P7={class:"fe-list__body",role:"rowgroup"},F7={key:0,class:"fe-list__group",role:"presentation"},R7=["aria-selected","aria-label","data-fe-path","onClick","onDblclick","onContextmenu","onDragstart","onDragover","onDragleave","onDrop","onTouchstartPassive"],L7={class:"fe-list__col fe-list__col--name",role:"gridcell"},B7={key:0,class:"fe-list__icon","aria-hidden":"true"},$7=["innerHTML"],N7={class:"fe-list__name-wrap"},U7=["title"],H7={key:0,class:"fe-list__badge"},j7=["title"],G7={key:1,class:"fe-list__snippet"},V7={key:0,class:"fe-list__mark"},q7={class:"fe-list__col fe-list__col--size",role:"gridcell"},K7={class:"fe-list__col fe-list__col--mod",role:"gridcell"},W7={key:0,class:"fe-list__empty"},Wv="filex.list-sort",Yv=Pt({__name:"ListView",props:{files:{},selected:{},clipped:{},showParentPath:{type:Boolean},locale:{},loading:{type:Boolean},starredIds:{},apiBase:{},authHeaders:{type:Function}},emits:["click-row","dbl-row","context-row","item-drag-start","item-drop-into","star-change"],setup(e,{emit:t}){const r=e,n=t,{t:a,formatSize:i,nodeDisplayName:o}=br(()=>r.locale);function s(j){return r.selected.has(j.path)}function l(j,P){n("click-row",j,{ctrl:P.ctrlKey||P.metaKey,shift:P.shiftKey})}function c(j){n("dbl-row",j)}function u(j,P){P.preventDefault(),P.stopPropagation(),n("context-row",j,P)}function d(j,P){wf(P,o(j),r.selected.has(j.path)?r.selected.size:1),n("item-drag-start",j,P)}const f=re(null);function p(j,P){var N;j.type==="dir"&&(N=P.dataTransfer)!=null&&N.types.includes("application/x-brf-files")&&(P.preventDefault(),P.stopPropagation(),P.dataTransfer&&(P.dataTransfer.dropEffect="move"),f.value=j.path)}function _(j){f.value===j.path&&(f.value=null)}function h(j,P){var N;f.value=null,j.type==="dir"&&(N=P.dataTransfer)!=null&&N.types.includes("application/x-brf-files")&&(P.preventDefault(),P.stopPropagation(),n("item-drop-into",j,P))}let b,v=null;function m(j,P){v=j,b&&clearTimeout(b),b=setTimeout(()=>{if(v){const N=P.touches[0];n("context-row",v,{clientX:N.clientX,clientY:N.clientY,preventDefault:()=>{}})}},500)}function y(){b&&clearTimeout(b),v=null}function g(j){return j.basename===".trash"?"🗑":j.mime_type==="inode/storage"?"💾":j.type==="dir"&&j.e2e===!0?"🔒":null}function S(j){return j.basename===".trash"||j.mime_type==="inode/storage"}function M(j){return j?new Date(j*(j<1e12?1e3:1)).toLocaleString():"—"}function E(j){const P=j.replace(/^[a-z][a-z0-9+.-]*:\/\//i,""),N=P.lastIndexOf("/");return N===-1?"":P.slice(0,N)}function w(j){const P=j.snippet;return typeof P=="string"?P:""}function x(j){return Kv(j.matched)}const C=re(null),D=re("asc");try{const j=localStorage.getItem(Wv);if(j){const P=JSON.parse(j);(P.key==="name"||P.key==="size"||P.key==="modified")&&(C.value=P.key),(P.dir==="asc"||P.dir==="desc")&&(D.value=P.dir)}}catch{}function B(j){return j==="modified"?"desc":"asc"}function F(j){C.value!==j?(C.value=j,D.value=B(j)):D.value===B(j)?D.value=D.value==="asc"?"desc":"asc":C.value=null;try{localStorage.setItem(Wv,JSON.stringify({key:C.value,dir:D.value}))}catch{}}function K(j){return C.value!==j?"none":D.value==="asc"?"ascending":"descending"}function te(j){const P=j.last_modified;return P?P*(P<1e12?1e3:1):null}const J=Fe(()=>{const j=C.value;if(!j)return r.files;const P=[],N=[];for(const Ee of r.files)(S(Ee)?P:N).push(Ee);const X=D.value==="asc"?1:-1;return N.sort((Ee,Ae)=>{if(j==="name")return X*Ee.basename.localeCompare(Ae.basename,void 0,{numeric:!0,sensitivity:"base"});if(j==="size")return X*((Ee.size??-1)-(Ae.size??-1));const ze=te(Ee),Le=te(Ae);return ze==null&&Le==null?0:ze==null?1:Le==null?-1:X*(ze-Le)}),[...P,...N]}),ne=Fe(()=>new Intl.DateTimeFormat(r.locale==="tr"?"tr-TR":"en-US",{month:"long",year:"numeric"}));function le(j){if(j==null)return{id:"none",label:a("group.no_date")};const P=new Date(j),N=new Date,X=Le=>new Date(Le.getFullYear(),Le.getMonth(),Le.getDate()).getTime(),Ee=X(N),Ae=X(P),ze=864e5;return Ae>=Ee?{id:"today",label:a("group.today")}:Ae===Ee-ze?{id:"yesterday",label:a("group.yesterday")}:Ae>Ee-7*ze?{id:"week",label:a("group.this_week")}:P.getFullYear()===N.getFullYear()&&P.getMonth()===N.getMonth()?{id:"month",label:a("group.this_month")}:{id:`m-${P.getFullYear()}-${P.getMonth()}`,label:ne.value.format(P)}}const q=Fe(()=>{const j=J.value;if(C.value!=="modified")return[{id:"all",label:null,nodes:j}];const P=[];let N=null;for(const X of j){const Ee=S(X)?{id:"pinned",label:null}:le(te(X));(!N||N.id!==Ee.id)&&(N={id:Ee.id,label:Ee.label,nodes:[]},P.push(N)),N.nodes.push(X)}return P});return(j,P)=>(R(),$("div",{class:vt(["fe-list",{"is-loading":e.loading,"has-star-col":!!e.apiBase||e.apiBase===""}]),role:"grid","aria-label":Y(a)("list.aria"),"aria-busy":e.loading?"true":void 0},[T("div",k7,[T("div",{class:"fe-list__col fe-list__col--star",role:"columnheader","aria-label":Y(a)("col.star")},null,8,S7),T("div",{class:"fe-list__col fe-list__col--name",role:"columnheader","aria-sort":K("name")},[T("button",{type:"button",class:"fe-list__sort",title:Y(a)("col.sort"),onClick:P[0]||(P[0]=N=>F("name"))},[$t(V(Y(a)("col.name"))+" ",1),C.value==="name"?(R(),$("span",A7,V(D.value==="asc"?"↑":"↓"),1)):Te("",!0)],8,E7)],8,C7),T("div",{class:"fe-list__col fe-list__col--size",role:"columnheader","aria-sort":K("size")},[T("button",{type:"button",class:"fe-list__sort",title:Y(a)("col.sort"),onClick:P[1]||(P[1]=N=>F("size"))},[$t(V(Y(a)("col.size"))+" ",1),C.value==="size"?(R(),$("span",D7,V(D.value==="asc"?"↑":"↓"),1)):Te("",!0)],8,M7)],8,T7),T("div",{class:"fe-list__col fe-list__col--mod",role:"columnheader","aria-sort":K("modified")},[T("button",{type:"button",class:"fe-list__sort",title:Y(a)("col.sort"),onClick:P[2]||(P[2]=N=>F("modified"))},[$t(V(Y(a)("col.modified"))+" ",1),C.value==="modified"?(R(),$("span",O7,V(D.value==="asc"?"↑":"↓"),1)):Te("",!0)],8,I7)],8,z7)]),T("div",P7,[(R(!0),$(qe,null,xt(q.value,N=>(R(),$(qe,{key:N.id},[N.label?(R(),$("div",F7,V(N.label),1)):Te("",!0),(R(!0),$(qe,null,xt(N.nodes,X=>{var Ee,Ae;return R(),$("div",{key:X.path,class:vt(["fe-list__row",{"is-selected":s(X),"is-dir":X.type==="dir","is-trash":X.trashed,"is-clipped":(Ee=e.clipped)==null?void 0:Ee.has(X.path),"is-droptarget":f.value===X.path}]),role:"row",tabindex:"0","aria-selected":s(X)?"true":"false","aria-label":Y(o)(X),"data-fe-path":X.path,draggable:"true",onClick:ze=>l(X,ze),onDblclick:ze=>c(X),onContextmenu:ze=>u(X,ze),onDragstart:ze=>d(X,ze),onDragover:ze=>p(X,ze),onDragleave:ze=>_(X),onDrop:ze=>h(X,ze),onTouchstartPassive:ze=>m(X,ze),onTouchend:y,onTouchmove:y},[T("div",{class:"fe-list__col fe-list__col--star",role:"gridcell",onClick:P[3]||(P[3]=Ht(()=>{},["stop"]))},[typeof X.id=="number"&&X.type==="file"?(R(),Zt(x7,{key:0,starred:!!((Ae=e.starredIds)!=null&&Ae.has(X.id)),"node-id":X.id,"api-base":e.apiBase,"auth-headers":e.authHeaders,compact:"",onChange:ze=>n("star-change",X,ze)},null,8,["starred","node-id","api-base","auth-headers","onChange"])):Te("",!0)]),T("div",L7,[g(X)?(R(),$("span",B7,V(g(X)),1)):(R(),$("span",{key:1,class:"fe-list__icon fe-list__icon--svg","aria-hidden":"true",innerHTML:Y(Uo)(X)},null,8,$7)),T("div",N7,[T("span",{class:"fe-list__name",title:X.basename},[$t(V(Y(o)(X))+" ",1),x(X)?(R(),$("span",H7,V(Y(a)("search.in_content")),1)):Te("",!0)],8,U7),e.showParentPath?(R(),$("span",{key:0,class:"fe-list__parent",title:E(X.path)},V(E(X.path)||"—"),9,j7)):Te("",!0),w(X)?(R(),$("span",G7,[(R(!0),$(qe,null,xt(Y(F0)(w(X)),(ze,Le)=>(R(),$(qe,{key:Le},[ze.match?(R(),$("mark",V7,V(ze.text),1)):(R(),$(qe,{key:1},[$t(V(ze.text),1)],64))],64))),128))])):Te("",!0)])]),T("div",q7,V(Y(i)(X.size)),1),T("div",K7,V(M(X.last_modified)),1)],42,R7)}),128))],64))),128)),!e.loading&&J.value.length===0?(R(),$("div",W7,V(Y(a)("empty.folder")),1)):Te("",!0)])],10,w7))}}),Y7=["aria-label","aria-busy"],X7=["aria-selected","aria-label","data-fe-path","onClick","onDblclick","onContextmenu","onDragstart","onDragover","onDragleave","onDrop","onTouchstartPassive"],Z7={class:"fe-grid__thumb"},J7=["src","alt"],Q7={key:1,class:"fe-grid__icon"},ew=["innerHTML"],tw=["title"],rw=["title"],nw={class:"fe-grid__meta"},aw=["title"],iw={key:0,class:"fe-grid__mark"},ow={key:0,class:"fe-grid__empty"},Xv=Pt({__name:"GridView",props:{files:{},selected:{},clipped:{},showParentPath:{type:Boolean},locale:{},loading:{type:Boolean},thumbSrc:{type:Function}},emits:["click-card","dbl-card","context-card","item-drag-start","item-drop-into"],setup(e,{emit:t}){const r=e,n=t,{t:a,formatSize:i,nodeDisplayName:o}=br(()=>r.locale);function s(x){return r.thumbSrc?r.thumbSrc(x):x.thumb_url??null}function l(x){return r.selected.has(x.path)}function c(x,C){n("click-card",x,{ctrl:C.ctrlKey||C.metaKey,shift:C.shiftKey})}function u(x){n("dbl-card",x)}function d(x,C){C.preventDefault(),C.stopPropagation(),n("context-card",x,C)}function f(x,C){wf(C,o(x),r.selected.has(x.path)?r.selected.size:1),n("item-drag-start",x,C)}const p=re(null);function _(x,C){var D;x.type==="dir"&&(D=C.dataTransfer)!=null&&D.types.includes("application/x-brf-files")&&(C.preventDefault(),C.stopPropagation(),C.dataTransfer&&(C.dataTransfer.dropEffect="move"),p.value=x.path)}function h(x){p.value===x.path&&(p.value=null)}function b(x,C){var D;p.value=null,x.type==="dir"&&(D=C.dataTransfer)!=null&&D.types.includes("application/x-brf-files")&&(C.preventDefault(),C.stopPropagation(),n("item-drop-into",x,C))}let v,m=null;function y(x,C){m=x,v&&clearTimeout(v),v=setTimeout(()=>{if(m){const D=C.touches[0];n("context-card",m,{clientX:D.clientX,clientY:D.clientY,preventDefault:()=>{}})}},500)}function g(){v&&clearTimeout(v),m=null}function S(x){const C=x.replace(/^[a-z][a-z0-9+.-]*:\/\//i,""),D=C.lastIndexOf("/");return D===-1?"":C.slice(0,D)}function M(x){return x.basename===".trash"?"🗑":x.mime_type==="inode/storage"?"💾":x.type==="dir"&&x.e2e===!0?"🔒":null}function E(x){const C=x.snippet;return typeof C=="string"?C:""}function w(x){return F0(x).map(C=>C.text).join("")}return(x,C)=>(R(),$("div",{class:vt(["fe-grid",{"is-loading":e.loading}]),role:"listbox","aria-multiselectable":"true","aria-label":Y(a)("grid.aria"),"aria-busy":e.loading?"true":void 0},[(R(!0),$(qe,null,xt(e.files,D=>{var B;return R(),$("div",{key:D.path,class:vt(["fe-grid__card",{"is-selected":l(D),"is-dir":D.type==="dir","is-trash":D.trashed,"is-clipped":(B=e.clipped)==null?void 0:B.has(D.path),"is-droptarget":p.value===D.path}]),tabindex:"0",role:"option","aria-selected":l(D)?"true":"false","aria-label":Y(o)(D),"data-fe-path":D.path,draggable:"true",onClick:F=>c(D,F),onDblclick:F=>u(D),onContextmenu:F=>d(D,F),onDragstart:F=>f(D,F),onDragover:F=>_(D,F),onDragleave:F=>h(D),onDrop:F=>b(D,F),onTouchstartPassive:F=>y(D,F),onTouchend:g,onTouchmove:g},[T("div",Z7,[s(D)?(R(),$("img",{key:0,src:s(D),alt:D.basename,loading:"lazy",draggable:"false"},null,8,J7)):M(D)?(R(),$("span",Q7,V(M(D)),1)):(R(),$("span",{key:2,class:"fe-grid__icon fe-grid__icon--svg",innerHTML:Y(Uo)(D)},null,8,ew))]),T("div",{class:"fe-grid__label",title:D.basename},V(Y(o)(D)),9,tw),e.showParentPath?(R(),$("div",{key:0,class:"fe-grid__parent",title:S(D.path)},V(S(D.path)||"—"),9,rw)):Te("",!0),T("div",nw,V(Y(i)(D.size)),1),E(D)?(R(),$("div",{key:1,class:"fe-grid__snippet",title:w(E(D))},[(R(!0),$(qe,null,xt(Y(F0)(E(D)),(F,K)=>(R(),$(qe,{key:K},[F.match?(R(),$("mark",iw,V(F.text),1)):(R(),$(qe,{key:1},[$t(V(F.text),1)],64))],64))),128))],8,aw)):Te("",!0)],42,X7)}),128)),!e.loading&&e.files.length===0?(R(),$("div",ow,V(Y(a)("empty.folder")),1)):Te("",!0)],10,Y7))}}),sw=["aria-label","aria-busy"],lw=["aria-selected","aria-label","onClick","onDblclick","onContextmenu","onDragstart","onDragover","onDragleave","onDrop","onTouchstartPassive"],cw={class:"fe-gal__thumb"},uw=["src","alt"],fw={key:1,class:"fe-gal__icon"},dw=["innerHTML"],pw={class:"fe-gal__meta","aria-hidden":"true"},hw={key:0,class:"fe-gal__meta-line"},vw=["title"],mw=["title"],gw={key:0,class:"fe-gal__empty"},Zv=Pt({__name:"GalleryView",props:{files:{},selected:{},clipped:{},showParentPath:{type:Boolean},locale:{},loading:{type:Boolean},thumbSrc:{type:Function}},emits:["click-card","dbl-card","context-card","item-drag-start","item-drop-into"],setup(e,{emit:t}){const r=e,n=t,{t:a,formatSize:i,nodeDisplayName:o}=br(()=>r.locale);function s(x){return r.thumbSrc?r.thumbSrc(x):x.thumb_url??null}function l(x){return r.selected.has(x.path)}function c(x,C){n("click-card",x,{ctrl:C.ctrlKey||C.metaKey,shift:C.shiftKey})}function u(x){n("dbl-card",x)}function d(x,C){C.preventDefault(),C.stopPropagation(),n("context-card",x,C)}function f(x,C){wf(C,o(x),r.selected.has(x.path)?r.selected.size:1),n("item-drag-start",x,C)}const p=re(null);function _(x,C){var D;x.type==="dir"&&(D=C.dataTransfer)!=null&&D.types.includes("application/x-brf-files")&&(C.preventDefault(),C.stopPropagation(),C.dataTransfer&&(C.dataTransfer.dropEffect="move"),p.value=x.path)}function h(x){p.value===x.path&&(p.value=null)}function b(x,C){var D;p.value=null,x.type==="dir"&&(D=C.dataTransfer)!=null&&D.types.includes("application/x-brf-files")&&(C.preventDefault(),C.stopPropagation(),n("item-drop-into",x,C))}let v,m=null;function y(x,C){m=x,v&&clearTimeout(v),v=setTimeout(()=>{if(m){const D=C.touches[0];n("context-card",m,{clientX:D.clientX,clientY:D.clientY,preventDefault:()=>{}})}},500)}function g(){v&&clearTimeout(v),m=null}function S(x){const C=x.replace(/^[a-z][a-z0-9+.-]*:\/\//i,""),D=C.lastIndexOf("/");return D===-1?"":C.slice(0,D)}function M(x){return x.basename===".trash"?"🗑":x.mime_type==="inode/storage"?"💾":x.type==="dir"&&x.e2e===!0?"🔒":null}function E(x){return x?new Date(x*(x<1e12?1e3:1)).toLocaleString():""}function w(x){const C=E(x.last_modified);return[x.type==="dir"?"":i(x.size),C].filter(B=>!!B).join(" · ")}return(x,C)=>(R(),$("div",{class:vt(["fe-gal",{"is-loading":e.loading}]),role:"listbox","aria-multiselectable":"true","aria-label":Y(a)("gallery.aria"),"aria-busy":e.loading?"true":void 0},[(R(!0),$(qe,null,xt(e.files,D=>{var B;return R(),$("div",{key:D.path,class:vt(["fe-gal__card",{"is-selected":l(D),"is-dir":D.type==="dir","is-trash":D.trashed,"is-clipped":(B=e.clipped)==null?void 0:B.has(D.path),"is-droptarget":p.value===D.path}]),tabindex:"0",role:"option","aria-selected":l(D)?"true":"false","aria-label":Y(o)(D),draggable:"true",onClick:F=>c(D,F),onDblclick:F=>u(D),onContextmenu:F=>d(D,F),onDragstart:F=>f(D,F),onDragover:F=>_(D,F),onDragleave:F=>h(D),onDrop:F=>b(D,F),onTouchstartPassive:F=>y(D,F),onTouchend:g,onTouchmove:g},[T("div",cw,[s(D)?(R(),$("img",{key:0,src:s(D),alt:D.basename,loading:"lazy",draggable:"false"},null,8,uw)):M(D)?(R(),$("span",fw,V(M(D)),1)):(R(),$("span",{key:2,class:"fe-gal__icon fe-gal__icon--svg",innerHTML:Y(Uo)(D)},null,8,dw)),T("div",pw,[w(D)?(R(),$("span",hw,V(w(D)),1)):Te("",!0),e.showParentPath&&S(D.path)?(R(),$("span",{key:1,class:"fe-gal__meta-line fe-gal__meta-line--path",title:S(D.path)},V(S(D.path)),9,vw)):Te("",!0)])]),T("div",{class:"fe-gal__label",title:D.basename},V(Y(o)(D)),9,mw)],42,lw)}),128)),!e.loading&&e.files.length===0?(R(),$("div",gw,V(Y(a)("empty.folder")),1)):Te("",!0)],10,sw))}}),bw=Pt({__name:"UploadProgress",props:{jobs:{},locale:{},center:{}},emits:["cancel","dismiss","retry"],setup(e,{emit:t}){const r=e,n=t;function a(i){return i==="done"?"done":i==="error"?"error":i==="aborted"?"aborted":"running"}return At(()=>r.jobs,i=>{r.center.sync("upload",i.map(o=>({input:{id:o.id,kind:"upload",name:o.file.name,percent:o.totalBytes>0||o.status==="done"?o.percent:null,status:a(o.status),error:o.error??null,uploadedBytes:o.uploadedBytes,totalBytes:o.totalBytes,cancellable:o.status==="uploading"||o.status==="initializing",retryable:o.status==="error"},actions:{cancel:()=>n("cancel",o),dismiss:()=>n("dismiss",o),retry:()=>n("retry",o)}})))},{immediate:!0}),(i,o)=>Te("",!0)}}),yw=Pt({__name:"PendingOpsTray",props:{ops:{},locale:{},center:{}},emits:["dismiss"],setup(e,{emit:t}){const r=e,n=t;function a(o){return o.status==="done"?"done":o.status==="error"?"error":"running"}function i(o){return o.status==="done"?100:o.progress_total<=0?null:Math.min(100,Math.round(o.progress_done/o.progress_total*100))}return At(()=>r.ops,o=>{r.center.sync("ops",o.map(s=>({input:{id:s.id,kind:s.op_type,name:s.target_path||s.source_dir||"",percent:i(s),status:a(s),error:s.error_message,queued:s.status==="pending",doneCount:s.progress_done,totalCount:s.progress_total,cancellable:!1,retryable:!1},actions:{dismiss:()=>n("dismiss",s.id)}})))},{immediate:!0}),(o,s)=>Te("",!0)}}),_w=["aria-label"],xw={class:"fe-inspector__head"},ww={class:"fe-inspector__title"},kw=["title","aria-label"],Sw={class:"fe-inspector__scroll"},Cw={class:"fe-inspector__section"},Ew={class:"fe-inspector__heading"},Aw={key:0,class:"fe-inspector__hero"},Tw=["innerHTML"],Mw={class:"fe-inspector__name"},Dw={class:"fe-inspector__hero"},zw=["src"],Iw=["innerHTML"],Ow=["title"],Pw={class:"fe-inspector__meta"},Fw={class:"fe-inspector__row"},Rw={class:"fe-inspector__pathcell"},Lw=["title"],Bw=["title","aria-label"],$w={key:0,class:"fe-inspector__row"},Nw={class:"fe-inspector__row"},Uw={key:1,class:"fe-inspector__row"},Hw={class:"fe-inspector__mime"},jw={key:2,class:"fe-inspector__row"},Gw={class:"fe-inspector__pathcell"},Vw=["title"],qw=["title","aria-label"],Kw={key:2,class:"fe-inspector__hero"},Ww=["innerHTML"],Yw=["title"],Xw={class:"fe-inspector__sub"},Zw={key:0,class:"fe-inspector__section"},Jw={class:"fe-inspector__heading"},Qw={key:0,class:"fe-inspector__empty"},e9={key:0,class:"fe-inspector__empty"},t9={key:1,class:"fe-inspector__versions"},r9={class:"fe-inspector__version-main"},n9={class:"fe-inspector__version-n"},a9={class:"fe-inspector__version-meta"},i9={key:0,class:"fe-inspector__confirm"},o9={class:"fe-inspector__confirm-q"},s9={class:"fe-inspector__check"},l9={class:"fe-inspector__confirm-actions"},c9=["disabled","onClick"],u9=["disabled"],f9=["disabled","onClick"],d9=["disabled"],p9={key:1,class:"fe-inspector__section"},h9={class:"fe-inspector__heading"},v9={class:"fe-inspector__permrow"},m9={key:2,class:"fe-inspector__section"},g9={class:"fe-inspector__heading"},b9={key:0,class:"fe-inspector__empty"},y9={key:1,class:"fe-inspector__shares"},_9=["title"],x9={key:0,class:"fe-inspector__badge fe-inspector__badge--pin"},w9={key:1,class:"fe-inspector__share-exp"},k9=["title","aria-label","onClick"],S9={key:3,class:"fe-inspector__section"},C9={class:"fe-inspector__heading"},E9={key:0,class:"fe-inspector__countbadge"},A9={key:0,class:"fe-inspector__empty"},T9={key:0,class:"fe-inspector__empty"},M9={key:1,class:"fe-inspector__comments"},D9={class:"fe-inspector__comment-top"},z9=["title"],I9=["title"],O9=["disabled","title","aria-label","onClick"],P9={class:"fe-inspector__comment-body"},F9=["placeholder","aria-label","disabled"],R9=["disabled"],L9=Pt({__name:"InspectorPanel",props:{api:{},nodes:{},dirLabel:{},dirCount:{},dirPerm:{},locale:{},narrow:{type:Boolean},thumbSrc:{type:Function}},emits:["close","manage-permissions","toast","changed"],setup(e,{emit:t}){const r=e,n=t,{t:a,formatSize:i,nodeDisplayName:o}=br(()=>r.locale),s=Fe(()=>r.nodes.length===1?r.nodes[0]:null),l=Fe(()=>r.nodes.length>1),c=Fe(()=>{var he;return((he=s.value)==null?void 0:he.type)==="file"}),u=Fe(()=>{var he;return typeof((he=s.value)==null?void 0:he.id)=="number"?s.value.id:null}),d=Fe(()=>r.nodes.reduce((he,Ie)=>he+(typeof Ie.size=="number"?Ie.size:0),0)),f=Fe(()=>{var Ie;const he=(Ie=s.value)==null?void 0:Ie.etag;return typeof he=="string"&&he!==""?he:null}),p=Fe(()=>s.value&&c.value&&r.thumbSrc?r.thumbSrc(s.value):null);function _(he){return he.length>12?`${he.slice(0,12)}…`:he}function h(he){if(!he)return"—";try{return new Date(he).toLocaleString(r.locale==="en"?"en-GB":"tr-TR",{dateStyle:"medium",timeStyle:"short"})}catch{return new Date(he).toISOString()}}function b(he){if(!he)return"—";const Ie=Date.parse(he);return Number.isNaN(Ie)?he:h(Ie)}async function v(he){try{await navigator.clipboard.writeText(he),n("toast",a("inspector.copied"))}catch{n("toast",he)}}const m=Fe(()=>{if(!s.value)return"";const he=s.value.perm;return typeof he=="string"&&he!==""?he:r.dirPerm||""}),y=Fe(()=>m.value==="editor"||m.value==="owner");function g(he){return a(`inspector.perm.${he}`)===`inspector.perm.${he}`?he:a(`inspector.perm.${he}`)}const S=re("idle"),M=re([]),E=re(null),w=re(!0),x=re(!1),C=re("idle"),D=re([]);let B=0;async function F(){const he=++B;if(E.value=null,M.value=[],D.value=[],s.value&&c.value&&u.value!=null?(S.value="loading",K(he)):S.value="hidden",s.value){C.value="loading";const Ie=s.value.path;try{const{shares:De}=await r.api.listShares(Ie);if(he!==B)return;D.value=Array.isArray(De)?De:[],C.value="ok"}catch{if(he!==B)return;C.value="hidden"}}else C.value="hidden"}async function K(he){const Ie=u.value;if(Ie!=null)try{const De=await r.api.listVersions(Ie);if(he!==B)return;M.value=De,S.value="ok"}catch(De){if(he!==B)return;const Be=De.status;Be===401||Be===403||Be===404?S.value="hidden":S.value="error"}}function te(he){E.value=he.id,w.value=!0}async function J(he){const Ie=u.value;if(!(Ie==null||x.value)){x.value=!0;try{await r.api.restoreVersion(Ie,he.id,w.value),n("toast",a("inspector.versions.restored")),E.value=null,n("changed"),await K(++B)}catch(De){n("toast",De.message)}finally{x.value=!1}}}async function ne(){const he=u.value;if(!(he==null||x.value)){x.value=!0;try{await r.api.snapshotVersion(he),n("toast",a("inspector.versions.snapshotted")),await K(++B)}catch(Ie){const De=Ie.status;De===404||De===405||De===501?n("toast",a("inspector.versions.unsupported")):n("toast",Ie.message)}finally{x.value=!1}}}At(()=>r.nodes.map(he=>he.path).join("\0"),()=>void F(),{immediate:!0});const le=re("hidden"),q=re([]),j=re(""),P=re(!1),N=Fe(()=>{var he;return typeof((he=s.value)==null?void 0:he.id)=="number"?s.value.id:null});let X=0;async function Ee(){const he=++X,Ie=N.value;if(Ie==null){le.value="hidden",q.value=[];return}le.value=q.value.length>0?"ok":"loading";try{const De=await r.api.listComments(Ie);if(he!==X)return;q.value=De,le.value="ok"}catch(De){if(he!==X)return;q.value=[];const Be=De.status;le.value=Be===401||Be===403||Be===404?"hidden":"error"}}async function Ae(){const he=N.value,Ie=j.value.trim();if(!(he==null||Ie===""||P.value)){P.value=!0;try{await r.api.addComment(he,Ie),j.value="",await Ee()}catch(De){n("toast",De.message)}finally{P.value=!1}}}async function ze(he){if(!P.value){P.value=!0;try{await r.api.deleteComment(he.id),await Ee()}catch(Ie){n("toast",Ie.message)}finally{P.value=!1}}}function Le(he){const Ie=Date.parse(he);if(Number.isNaN(Ie))return he;const De=Math.round((Ie-Date.now())/1e3),Be=Math.abs(De),Z=[["year",31536e3],["month",2592e3],["day",86400],["hour",3600],["minute",60]];try{const se=new Intl.RelativeTimeFormat(r.locale==="en"?"en":"tr",{numeric:"auto"});for(const[we,Se]of Z)if(Be>=Se)return se.format(Math.trunc(De/Se),we);return se.format(De,"second")}catch{return b(he)}}return At(()=>N.value,()=>{q.value=[],j.value="",Ee()},{immediate:!0}),(he,Ie)=>(R(),$("aside",{class:vt(["fe-inspector",{"fe-inspector--overlay":e.narrow}]),role:"complementary","aria-label":Y(a)("inspector.title")},[T("header",xw,[T("h2",ww,V(Y(a)("inspector.title")),1),T("button",{type:"button",class:"fe-inspector__close",title:Y(a)("inspector.close"),"aria-label":Y(a)("inspector.close"),onClick:Ie[0]||(Ie[0]=De=>n("close"))},"×",8,kw)]),T("div",Sw,[T("section",Cw,[T("h3",Ew,V(Y(a)("inspector.section.general")),1),l.value?(R(),$("div",Aw,[T("span",{class:"fe-inspector__bigicon",innerHTML:Y(Uo)({type:"dir"})},null,8,Tw),T("p",Mw,V(Y(a)("inspector.items_summary",{n:e.nodes.length,size:Y(i)(d.value)})),1)])):s.value?(R(),$(qe,{key:1},[T("div",Dw,[p.value?(R(),$("img",{key:0,class:"fe-inspector__thumb",src:p.value,alt:"","aria-hidden":"true"},null,8,zw)):(R(),$("span",{key:1,class:"fe-inspector__bigicon",innerHTML:Y(Uo)(s.value)},null,8,Iw)),T("p",{class:"fe-inspector__name",title:s.value.basename},V(Y(o)(s.value)),9,Ow)]),T("dl",Pw,[T("div",Fw,[T("dt",null,V(Y(a)("inspector.path")),1),T("dd",Rw,[T("span",{class:"fe-inspector__path",title:s.value.path},V(s.value.path),9,Lw),T("button",{type:"button",class:"fe-inspector__copy",title:Y(a)("inspector.copy"),"aria-label":Y(a)("inspector.copy"),onClick:Ie[1]||(Ie[1]=De=>v(s.value.path))},"⧉",8,Bw)])]),c.value?(R(),$("div",$w,[T("dt",null,V(Y(a)("inspector.size")),1),T("dd",null,V(Y(i)(typeof s.value.size=="number"?s.value.size:null)),1)])):Te("",!0),T("div",Nw,[T("dt",null,V(Y(a)("inspector.modified")),1),T("dd",null,V(h(s.value.last_modified)),1)]),c.value&&s.value.mime_type?(R(),$("div",Uw,[T("dt",null,V(Y(a)("inspector.mime")),1),T("dd",Hw,V(s.value.mime_type),1)])):Te("",!0),f.value?(R(),$("div",jw,[T("dt",null,V(Y(a)("inspector.etag")),1),T("dd",Gw,[T("span",{class:"fe-inspector__path",title:f.value},V(_(f.value)),9,Vw),T("button",{type:"button",class:"fe-inspector__copy",title:Y(a)("inspector.copy"),"aria-label":Y(a)("inspector.copy"),onClick:Ie[2]||(Ie[2]=De=>v(f.value))},"⧉",8,qw)])])):Te("",!0)])],64)):(R(),$("div",Kw,[T("span",{class:"fe-inspector__bigicon",innerHTML:Y(Uo)({type:"dir"})},null,8,Ww),T("p",{class:"fe-inspector__name",title:e.dirLabel},V(e.dirLabel),9,Yw),T("p",Xw,V(Y(a)("inspector.folder_items",{n:e.dirCount})),1)]))]),S.value==="ok"||S.value==="error"?(R(),$("section",Zw,[T("h3",Jw,V(Y(a)("inspector.section.versions")),1),S.value==="error"?(R(),$("p",Qw,V(Y(a)("inspector.error")),1)):(R(),$(qe,{key:1},[M.value.length===0?(R(),$("p",e9,V(Y(a)("inspector.versions.empty")),1)):(R(),$("ul",t9,[(R(!0),$(qe,null,xt(M.value,De=>(R(),$("li",{key:De.id,class:"fe-inspector__version"},[T("div",r9,[T("span",n9,V(Y(a)("inspector.versions.v",{n:De.version_n})),1),T("span",a9,V(b(De.created_at))+" · "+V(Y(i)(De.size)),1)]),E.value===De.id?(R(),$("div",i9,[T("p",o9,V(Y(a)("inspector.versions.restore_confirm")),1),T("label",s9,[Yt(T("input",{"onUpdate:modelValue":Ie[3]||(Ie[3]=Be=>w.value=Be),type:"checkbox"},null,512),[[No,w.value]]),$t(" "+V(Y(a)("inspector.versions.snapshot_current")),1)]),T("div",l9,[T("button",{type:"button",class:"fe-btn fe-btn--primary fe-btn--sm",disabled:x.value,onClick:Be=>J(De)},V(Y(a)("inspector.versions.confirm")),9,c9),T("button",{type:"button",class:"fe-btn fe-btn--sm",disabled:x.value,onClick:Ie[4]||(Ie[4]=Be=>E.value=null)},V(Y(a)("inspector.versions.cancel")),9,u9)])])):(R(),$("button",{key:1,type:"button",class:"fe-btn fe-btn--sm",disabled:x.value,onClick:Be=>te(De)},V(Y(a)("inspector.versions.restore")),9,f9))]))),128))])),T("button",{type:"button",class:"fe-btn fe-btn--sm fe-inspector__snapshot",disabled:x.value,onClick:ne},V(Y(a)("inspector.versions.take_snapshot")),9,d9)],64))])):Te("",!0),s.value&&m.value?(R(),$("section",p9,[T("h3",h9,V(Y(a)("inspector.section.permissions")),1),T("div",v9,[T("span",{class:vt(["fe-inspector__badge",`fe-inspector__badge--${m.value}`])},V(g(m.value)),3),y.value?(R(),$("button",{key:0,type:"button",class:"fe-btn fe-btn--sm",onClick:Ie[5]||(Ie[5]=De=>n("manage-permissions",s.value))},V(Y(a)("inspector.perm.manage")),1)):Te("",!0)])])):Te("",!0),C.value==="ok"?(R(),$("section",m9,[T("h3",g9,V(Y(a)("inspector.section.shares")),1),D.value.length===0?(R(),$("p",b9,V(Y(a)("inspector.shares.empty")),1)):(R(),$("ul",y9,[(R(!0),$(qe,null,xt(D.value,De=>(R(),$("li",{key:De.uuid,class:"fe-inspector__share"},[T("span",{class:"fe-inspector__share-url",title:De.url},V(De.url),9,_9),De.password_pin?(R(),$("span",x9,"PIN")):Te("",!0),De.expires_at?(R(),$("span",w9,V(b(De.expires_at)),1)):Te("",!0),T("button",{type:"button",class:"fe-inspector__copy",title:Y(a)("inspector.shares.copy"),"aria-label":Y(a)("inspector.shares.copy"),onClick:Be=>v(De.url)},"⧉",8,k9)]))),128))]))])):Te("",!0),le.value==="ok"||le.value==="error"?(R(),$("section",S9,[T("h3",C9,[$t(V(Y(a)("inspector.section.comments"))+" ",1),q.value.length>0?(R(),$("span",E9,V(q.value.length),1)):Te("",!0)]),le.value==="error"?(R(),$("p",A9,V(Y(a)("inspector.error")),1)):(R(),$(qe,{key:1},[q.value.length===0?(R(),$("p",T9,V(Y(a)("inspector.comments.empty")),1)):(R(),$("ul",M9,[(R(!0),$(qe,null,xt(q.value,De=>(R(),$("li",{key:De.id,class:"fe-inspector__comment"},[T("div",D9,[T("span",{class:"fe-inspector__comment-author",title:De.author_name},V(De.author_name||"—"),9,z9),T("span",{class:"fe-inspector__comment-time",title:b(De.created_at)},V(Le(De.created_at)),9,I9),De.can_delete?(R(),$("button",{key:0,type:"button",class:"fe-inspector__comment-del",disabled:P.value,title:Y(a)("inspector.comments.delete"),"aria-label":Y(a)("inspector.comments.delete"),onClick:Be=>ze(De)},"×",8,O9)):Te("",!0)]),T("p",P9,V(De.body),1)]))),128))])),T("form",{class:"fe-inspector__comment-form",onSubmit:Ht(Ae,["prevent"])},[Yt(T("input",{"onUpdate:modelValue":Ie[6]||(Ie[6]=De=>j.value=De),type:"text",class:"fe-inspector__comment-input",maxlength:"5000",placeholder:Y(a)("inspector.comments.placeholder"),"aria-label":Y(a)("inspector.comments.placeholder"),disabled:P.value},null,8,F9),[[Ir,j.value]]),T("button",{type:"submit",class:"fe-btn fe-btn--primary fe-btn--sm",disabled:P.value||j.value.trim()===""},V(Y(a)("inspector.comments.send")),9,R9)],32)],64))])):Te("",!0)])],10,_w))}}),B9=["aria-label"],$9={class:"fe-cmdp__inputwrap"},N9=["placeholder"],U9=["aria-selected","onMouseenter","onClick"],H9={class:"fe-cmdp__icon","aria-hidden":"true"},j9={class:"fe-cmdp__label"},G9={class:"fe-cmdp__group"},V9=["aria-selected","onMouseenter","onClick"],q9={class:"fe-cmdp__icon","aria-hidden":"true"},K9={class:"fe-cmdp__label"},W9={class:"fe-cmdp__group"},Y9={key:0,class:"fe-cmdp__loading"},X9=["aria-selected","onMouseenter","onClick"],Z9={class:"fe-cmdp__icon","aria-hidden":"true"},J9={class:"fe-cmdp__hitbody"},Q9={class:"fe-cmdp__hitline"},ek={class:"fe-cmdp__label"},tk={key:0,class:"fe-cmdp__badge"},rk=["title"],nk={key:1,class:"fe-cmdp__snippet"},ak={key:0,class:"fe-cmdp__mark"},ik={class:"fe-cmdp__group"},ok=["aria-selected","onMouseenter","onClick","onKeydown"],sk={class:"fe-cmdp__icon","aria-hidden":"true"},lk={class:"fe-cmdp__label"},ck=["title","aria-label","onClick"],uk={class:"fe-cmdp__group"},fk=["aria-selected","onMouseenter","onClick"],dk={class:"fe-cmdp__icon","aria-hidden":"true"},pk={class:"fe-cmdp__label"},hk={key:4,class:"fe-cmdp__empty"},vk={class:"fe-cmdp__hint"},mk=3,gk=8,bk=250,Jv="filex.saved-searches",Qv=10,yk=Pt({__name:"CommandPalette",props:{open:{type:Boolean},locale:{},files:{},viewMode:{},canWrite:{type:Boolean},canGoUp:{type:Boolean},globalSearch:{type:Function},splitEnabled:{type:Boolean}},emits:["close","open-node","navigate","new-folder","upload","toggle-view","open-trash","refresh","go-up","open-hit","open-theme","open-shortcut-settings","start-tour","tab-new","split-toggle"],setup(e,{emit:t}){const r=e,n=t,{t:a,nodeDisplayName:i}=br(()=>r.locale),o=re(""),s=re(0),l=re(null),c=re(null);function u(q,j){if(!j)return 0;const P=q.toLocaleLowerCase(),N=j.toLocaleLowerCase(),X=P.indexOf(N);if(X===-1)return-1;let Ee=100-Math.min(X,50);return X===0&&(Ee+=40),Ee-=Math.min(P.length,40)/4,Ee}const d=Fe(()=>{const q=o.value.trim();if(!q.includes("/"))return[];const j=q.replace(/^\/+|\/+$/g,"");return j?[{kind:"goto",id:`goto:${j}`,label:`${a("palette.goto")}: ${j}`,icon:"➜",path:j}]:[]}),f=Fe(()=>{const q=o.value.trim(),j=r.files.map(P=>({f:P,name:i(P),s:u(i(P),q)})).filter(P=>P.s>=0);return q&&j.sort((P,N)=>N.s-P.s),j.slice(0,8).map(P=>({kind:"file",id:`file:${P.f.path}`,label:P.name,icon:P.f.type==="dir"?"📁":"📄",node:P.f}))}),p=Fe(()=>{const q=o.value.trim();return[{command:"new-folder",label:a("toolbar.new_folder"),icon:"📁",enabled:r.canWrite!==!1},{command:"upload",label:a("toolbar.upload"),icon:"⬆",enabled:r.canWrite!==!1},{command:"toggle-view",label:a("cmd.view_toggle"),icon:r.viewMode==="list"?"▦":r.viewMode==="grid"?"▣":"☰",enabled:!0},{command:"open-trash",label:a("cmd.trash"),icon:"🗑",enabled:!0},{command:"refresh",label:a("toolbar.refresh"),icon:"⟳",enabled:!0},{command:"go-up",label:a("toolbar.go_up"),icon:"↑",enabled:r.canGoUp!==!1},{command:"open-theme",label:a("theme.menu"),icon:"🎨",enabled:!0},{command:"open-shortcut-settings",label:a("shortcuts.settings.menu"),icon:"⌨",enabled:!0},{command:"start-tour",label:a("tour.restart"),icon:"🎓",enabled:!0},{command:"tab-new",label:a("cmd.tab_new"),icon:"⧉",enabled:!0},{command:"split-toggle",label:a("cmd.split_toggle"),icon:"◫",enabled:r.splitEnabled!==!1}].filter(P=>P.enabled&&u(P.label,q)>=0).map(P=>({kind:"command",id:`cmd:${P.command}`,label:P.label,icon:P.icon,command:P.command}))}),_=re([]),h=re(!1);let b,v=0;function m(q){b&&clearTimeout(b);const j=r.globalSearch;if(!j||q.length<mk){_.value=[],h.value=!1;return}h.value=!0,b=setTimeout(async()=>{const P=++v;try{const N=await j(q);if(P!==v)return;_.value=Array.isArray(N)?N.slice(0,gk):[]}catch{P===v&&(_.value=[])}finally{P===v&&(h.value=!1)}},bk)}function y(q){const j=String(q.path??"").replace(/^\/+|\/+$/g,""),P=j.lastIndexOf("/"),N=P===-1?"":j.slice(0,P),X=typeof q.storage=="string"&&q.storage||typeof q.storage_name=="string"&&q.storage_name||"";return X&&N?`${X}/${N}`:X||N||"/"}const g=Fe(()=>_.value.map(q=>({kind:"hit",id:`hit:${q.storage_id??""}:${q.path??""}:${q.id??""}`,label:String(q.name??q.path??""),icon:q.type==="dir"?"📁":"📄",hit:q,crumb:y(q),inContent:Kv(q.matched),snippet:typeof q.snippet=="string"?q.snippet:""}))),S=re([]);function M(){try{const q=localStorage.getItem(Jv);if(!q)return[];const j=JSON.parse(q);return Array.isArray(j)?j.filter(P=>typeof P=="string"&&P.trim()!=="").slice(0,Qv):[]}catch{return[]}}function E(q){S.value=q.slice(0,Qv);try{localStorage.setItem(Jv,JSON.stringify(S.value))}catch{}}function w(q){const j=q.trim();if(!j)return;const P=S.value.filter(N=>N!==j);P.unshift(j),E(P)}function x(q){E(S.value.filter(j=>j!==q)),s.value>=D.value.length&&(s.value=Math.max(0,D.value.length-1))}const C=Fe(()=>{const q=o.value.trim(),j=[];q&&!S.value.includes(q)&&j.push({kind:"save",id:`save:${q}`,label:`${a("palette.save")}: ${q}`,icon:"💾",query:q});const P=S.value.map(N=>({s:N,sc:u(N,q)})).filter(N=>N.sc>=0||!q);for(const N of P)j.push({kind:"saved",id:`saved:${N.s}`,label:N.s,icon:"🔖",query:N.s});return j}),D=Fe(()=>[...d.value,...f.value,...g.value,...C.value,...p.value]),B=Fe(()=>d.value.length),F=Fe(()=>B.value+f.value.length),K=Fe(()=>F.value+g.value.length),te=Fe(()=>K.value+C.value.length);At(o,q=>{s.value=0,m(q.trim())});function J(q){const j=D.value.length;j&&(s.value=(s.value+q+j)%j,Nr(()=>{var P,N;(N=(P=c.value)==null?void 0:P.querySelector(".is-active"))==null||N.scrollIntoView({block:"nearest"})}))}function ne(q){const j=q??D.value[s.value];if(j){if(j.kind==="saved"){o.value=j.query,Nr(()=>{var P;return(P=l.value)==null?void 0:P.focus()});return}if(j.kind==="save"){w(j.query),Nr(()=>{var P;return(P=l.value)==null?void 0:P.focus()});return}if(n("close"),j.kind==="hit"){n("open-hit",j.hit);return}if(j.kind==="file")n("open-node",j.node);else if(j.kind==="goto")n("navigate",j.path);else switch(j.command){case"new-folder":n("new-folder");break;case"upload":n("upload");break;case"toggle-view":n("toggle-view");break;case"open-trash":n("open-trash");break;case"refresh":n("refresh");break;case"go-up":n("go-up");break;case"open-theme":n("open-theme");break;case"open-shortcut-settings":n("open-shortcut-settings");break;case"start-tour":n("start-tour");break;case"tab-new":n("tab-new");break;case"split-toggle":n("split-toggle");break}}}function le(q){if(r.open)switch(q.key){case"ArrowDown":q.preventDefault(),q.stopPropagation(),J(1);break;case"ArrowUp":q.preventDefault(),q.stopPropagation(),J(-1);break;case"Enter":q.preventDefault(),q.stopPropagation(),ne();break;case"Escape":q.preventDefault(),q.stopPropagation(),n("close");break}}return At(()=>r.open,q=>{q?(o.value="",s.value=0,_.value=[],h.value=!1,S.value=M(),document.addEventListener("keydown",le,!0),Nr(()=>{var j;return(j=l.value)==null?void 0:j.focus()})):(b&&clearTimeout(b),document.removeEventListener("keydown",le,!0))}),tr(()=>{b&&clearTimeout(b),document.removeEventListener("keydown",le,!0)}),(q,j)=>(R(),Zt(Za,{name:"fe-modal"},{default:ur(()=>[e.open?(R(),$("div",{key:0,class:"fe-modal__backdrop fe-cmdp__backdrop",role:"presentation",onClick:j[2]||(j[2]=P=>n("close"))},[T("div",{class:"fe-cmdp",role:"dialog","aria-modal":"true","aria-label":Y(a)("palette.placeholder"),onClick:j[1]||(j[1]=Ht(()=>{},["stop"]))},[T("div",$9,[j[3]||(j[3]=T("svg",{class:"fe-cmdp__glyph",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","aria-hidden":"true"},[T("circle",{cx:"7",cy:"7",r:"4.5"}),T("path",{d:"m10.5 10.5 3.5 3.5"})],-1)),Yt(T("input",{ref_key:"inputEl",ref:l,"onUpdate:modelValue":j[0]||(j[0]=P=>o.value=P),type:"text",class:"fe-cmdp__input",placeholder:Y(a)("palette.placeholder"),autocomplete:"off",spellcheck:"false"},null,8,N9),[[Ir,o.value]])]),T("div",{ref_key:"listEl",ref:c,class:"fe-cmdp__list",role:"listbox"},[(R(!0),$(qe,null,xt(d.value,(P,N)=>(R(),$("button",{key:P.id,type:"button",class:vt(["fe-cmdp__item",{"is-active":N===s.value}]),role:"option","aria-selected":N===s.value,onMouseenter:X=>s.value=N,onClick:X=>ne(P)},[T("span",H9,V(P.icon),1),T("span",j9,V(P.label),1)],42,U9))),128)),f.value.length?(R(),$(qe,{key:0},[T("div",G9,V(Y(a)("palette.files")),1),(R(!0),$(qe,null,xt(f.value,(P,N)=>(R(),$("button",{key:P.id,type:"button",class:vt(["fe-cmdp__item",{"is-active":B.value+N===s.value}]),role:"option","aria-selected":B.value+N===s.value,onMouseenter:X=>s.value=B.value+N,onClick:X=>ne(P)},[T("span",q9,V(P.icon),1),T("span",K9,V(P.label),1)],42,V9))),128))],64)):Te("",!0),g.value.length||h.value?(R(),$(qe,{key:1},[T("div",W9,V(Y(a)("palette.everywhere")),1),h.value&&!g.value.length?(R(),$("div",Y9,V(Y(a)("palette.searching")),1)):Te("",!0),(R(!0),$(qe,null,xt(g.value,(P,N)=>(R(),$("button",{key:P.id,type:"button",class:vt(["fe-cmdp__item fe-cmdp__item--hit",{"is-active":F.value+N===s.value}]),role:"option","aria-selected":F.value+N===s.value,onMouseenter:X=>s.value=F.value+N,onClick:X=>ne(P)},[T("span",Z9,V(P.icon),1),T("span",J9,[T("span",Q9,[T("span",ek,V(P.label),1),P.inContent?(R(),$("span",tk,V(Y(a)("search.in_content")),1)):Te("",!0)]),P.crumb?(R(),$("span",{key:0,class:"fe-cmdp__crumb",title:P.crumb},V(P.crumb),9,rk)):Te("",!0),P.snippet?(R(),$("span",nk,[(R(!0),$(qe,null,xt(Y(F0)(P.snippet),(X,Ee)=>(R(),$(qe,{key:Ee},[X.match?(R(),$("mark",ak,V(X.text),1)):(R(),$(qe,{key:1},[$t(V(X.text),1)],64))],64))),128))])):Te("",!0)])],42,X9))),128))],64)):Te("",!0),C.value.length?(R(),$(qe,{key:2},[T("div",ik,V(Y(a)("palette.saved")),1),(R(!0),$(qe,null,xt(C.value,(P,N)=>(R(),$("div",{key:P.id,class:vt(["fe-cmdp__item fe-cmdp__item--saved",{"is-active":K.value+N===s.value}]),role:"option","aria-selected":K.value+N===s.value,tabindex:"-1",onMouseenter:X=>s.value=K.value+N,onClick:X=>ne(P),onKeydown:un(Ht(X=>ne(P),["prevent"]),["enter"])},[T("span",sk,V(P.icon),1),T("span",lk,V(P.label),1),P.kind==="saved"?(R(),$("button",{key:0,type:"button",class:"fe-cmdp__del",title:Y(a)("palette.saved.delete"),"aria-label":Y(a)("palette.saved.delete"),onClick:Ht(X=>x(P.query),["stop"])},"🗑",8,ck)):Te("",!0)],42,ok))),128))],64)):Te("",!0),p.value.length?(R(),$(qe,{key:3},[T("div",uk,V(Y(a)("palette.commands")),1),(R(!0),$(qe,null,xt(p.value,(P,N)=>(R(),$("button",{key:P.id,type:"button",class:vt(["fe-cmdp__item",{"is-active":te.value+N===s.value}]),role:"option","aria-selected":te.value+N===s.value,onMouseenter:X=>s.value=te.value+N,onClick:X=>ne(P)},[T("span",dk,V(P.icon),1),T("span",pk,V(P.label),1)],42,fk))),128))],64)):Te("",!0),D.value.length===0&&!h.value?(R(),$("div",hk,V(Y(a)("palette.empty")),1)):Te("",!0)],512),T("div",vk,V(Y(a)("palette.hint")),1)],8,B9)])):Te("",!0)]),_:1}))}}),_k=["aria-labelledby","aria-label"],xk={key:0,class:"fe-modal__head"},wk={class:"fe-modal__body"},kk={key:1,class:"fe-modal__actions"},em='input:not([disabled]),select:not([disabled]),textarea:not([disabled]),button:not([disabled]),a[href],[tabindex]:not([tabindex="-1"])',ei=Pt({__name:"Modal",props:{open:{type:Boolean},title:{},size:{},closeOnBackdrop:{type:Boolean},chromeless:{type:Boolean},theme:{}},emits:["close"],setup(e,{emit:t}){const r=e,n=t,a=re(null);let i=0;const o=`fe-modal-title-${++i}-${Math.random().toString(36).slice(2,7)}`;let s=null;At(()=>r.open,u=>{var d;u?(s=document.activeElement??null,document.addEventListener("keydown",l),setTimeout(()=>{var p;const f=(p=a.value)==null?void 0:p.querySelector(em);f==null||f.focus()},30)):(document.removeEventListener("keydown",l),(d=s==null?void 0:s.focus)==null||d.call(s),s=null)}),tr(()=>document.removeEventListener("keydown",l));function l(u){if(u.key==="Escape"){n("close");return}if(u.key==="Tab"&&a.value){const d=Array.from(a.value.querySelectorAll(em)).filter(h=>h.offsetParent!==null||h===document.activeElement);if(d.length===0)return;const f=d[0],p=d[d.length-1],_=document.activeElement;u.shiftKey&&(_===f||!a.value.contains(_))?(u.preventDefault(),p.focus()):!u.shiftKey&&(_===p||!a.value.contains(_))&&(u.preventDefault(),f.focus())}}function c(){r.closeOnBackdrop!==!1&&n("close")}return(u,d)=>(R(),Zt(Za,{name:"fe-modal"},{default:ur(()=>[e.open?(R(),$("div",{key:0,class:vt(["fe fe-modal__backdrop",[{"fe-modal__backdrop--chromeless":e.chromeless},e.theme==="light"?"fe--theme-light":"",e.theme==="dark"?"fe--theme-dark":""]]),role:"presentation",onClick:c},[T("div",{ref_key:"cardEl",ref:a,class:vt(["fe-modal__card",[`fe-modal__card--${e.size||"md"}`,e.chromeless&&"fe-modal__card--chromeless"]]),role:"dialog","aria-modal":"true","aria-labelledby":e.title&&!e.chromeless?o:void 0,"aria-label":(!e.title||e.chromeless)&&e.title||void 0,onClick:d[1]||(d[1]=Ht(()=>{},["stop"]))},[e.title&&!e.chromeless?(R(),$("header",xk,[T("h2",{id:o,class:"fe-modal__title"},V(e.title),1),T("button",{type:"button",class:"fe-modal__close","aria-label":"Close",onClick:d[0]||(d[0]=f=>n("close"))},"×")])):Te("",!0),T("div",wk,[S1(u.$slots,"default")]),u.$slots.actions&&!e.chromeless?(R(),$("footer",kk,[S1(u.$slots,"actions")])):Te("",!0)],10,_k)],2)):Te("",!0)]),_:3}))}}),Sk={class:"fe-shortcuts"},Ck={class:"fe-shortcuts__heading"},Ek={class:"fe-shortcuts__table"},Ak={class:"fe-shortcuts__keys"},Tk={key:0,class:"fe-shortcuts__unbound"},Mk={class:"fe-kbd"},Dk={key:0,class:"fe-shortcuts__or","aria-hidden":"true"},zk={class:"fe-shortcuts__desc"},Ik=["title"],Ok=Pt({__name:"ShortcutsHelp",props:{open:{type:Boolean},locale:{}},emits:["close","customize"],setup(e,{emit:t}){const r=e,n=t,{t:a}=br(()=>r.locale),i=Bv(),o=Fe(()=>{const s=[],l=new Map;for(const c of i.value)l.has(c.groupKey)||(l.set(c.groupKey,[]),s.push(c.groupKey)),l.get(c.groupKey).push(c);return s.map(c=>({key:c,items:l.get(c)}))});return(s,l)=>(R(),Zt(ei,{open:e.open,title:Y(a)("shortcuts.title"),size:"md",onClose:l[2]||(l[2]=c=>n("close"))},{actions:ur(()=>[T("button",{type:"button",class:"fe-btn fe-btn--primary",onClick:l[0]||(l[0]=c=>n("customize"))}," ⌨ "+V(Y(a)("shortcuts.customize")),1),T("button",{type:"button",class:"fe-btn",onClick:l[1]||(l[1]=c=>n("close"))},V(Y(a)("viewer.close")),1)]),default:ur(()=>[T("div",Sk,[(R(!0),$(qe,null,xt(o.value,c=>(R(),$("section",{key:c.key,class:"fe-shortcuts__group"},[T("h3",Ck,V(Y(a)(c.key)),1),T("div",Ek,[(R(!0),$(qe,null,xt(c.items,u=>(R(),$("div",{key:u.id,class:"fe-shortcuts__row"},[T("span",Ak,[u.keys.length===0?(R(),$("span",Tk,V(Y(a)("shortcuts.settings.unbound")),1)):(R(!0),$(qe,{key:1},xt(u.keys,(d,f)=>(R(),$(qe,{key:d},[T("kbd",Mk,V(d),1),f<u.keys.length-1?(R(),$("span",Dk,"/")):Te("",!0)],64))),128))]),T("span",zk,[$t(V(Y(a)(u.labelKey))+" ",1),u.overridden?(R(),$("span",{key:0,class:"fe-shortcuts__custom",title:Y(a)("shortcuts.settings.customized")},"●",8,Ik)):Te("",!0)])]))),128))])]))),128))])]),_:1},8,["open","title"]))}}),R0="filex.theme",Ta="default",kf=[{id:Ta,nameKey:"theme.name.default",light:{"--fe-bg":"#ffffff","--fe-bg-elev":"#f7f8fa","--fe-bg-hover":"#edf0f5","--fe-bg-selected":"#dfe8ff","--fe-border":"#e2e6ed","--fe-border-strong":"#c7ced9","--fe-text":"#1a1e27","--fe-text-muted":"#5a6475","--fe-text-on-primary":"#ffffff","--fe-primary":"#3b82f6","--fe-primary-hover":"#2563eb","--fe-danger":"#dc2626","--fe-danger-hover":"#b91c1c"},dark:{"--fe-bg":"#0f1419","--fe-bg-elev":"#161c25","--fe-bg-hover":"#1f2733","--fe-bg-selected":"#23324a","--fe-border":"#2a323e","--fe-border-strong":"#3a4453","--fe-text":"#e5e9f0","--fe-text-muted":"#8b95a7","--fe-text-on-primary":"#ffffff","--fe-primary":"#60a5fa","--fe-primary-hover":"#3b82f6","--fe-danger":"#f87171","--fe-danger-hover":"#ef4444"}},{id:"night",nameKey:"theme.name.night",light:{"--fe-bg":"#f6f8fd","--fe-bg-elev":"#edf1fa","--fe-bg-hover":"#e2e9f7","--fe-bg-selected":"#d2ddf4","--fe-border":"#d6deee","--fe-border-strong":"#aebfda","--fe-text":"#151f38","--fe-text-muted":"#49587a","--fe-text-on-primary":"#ffffff","--fe-primary":"#2c4a9e","--fe-primary-hover":"#213a80","--fe-danger":"#c62828","--fe-danger-hover":"#a51f1f"},dark:{"--fe-bg":"#0a1024","--fe-bg-elev":"#111a35","--fe-bg-hover":"#1a2547","--fe-bg-selected":"#243665","--fe-border":"#26335a","--fe-border-strong":"#3c4e84","--fe-text":"#dfe6f7","--fe-text-muted":"#96a5cc","--fe-text-on-primary":"#050b26","--fe-primary":"#6d8dfc","--fe-primary-hover":"#5273f2","--fe-danger":"#f87171","--fe-danger-hover":"#ef4444"}},{id:"forest",nameKey:"theme.name.forest",light:{"--fe-bg":"#f5faf5","--fe-bg-elev":"#eaf3eb","--fe-bg-hover":"#dcecdf","--fe-bg-selected":"#c8e2ce","--fe-border":"#d2e2d4","--fe-border-strong":"#a2c3a8","--fe-text":"#182b1d","--fe-text-muted":"#42604a","--fe-text-on-primary":"#ffffff","--fe-primary":"#2b7a41","--fe-primary-hover":"#226334","--fe-danger":"#c62828","--fe-danger-hover":"#a51f1f"},dark:{"--fe-bg":"#0d1611","--fe-bg-elev":"#132019","--fe-bg-hover":"#1b2d23","--fe-bg-selected":"#264532","--fe-border":"#28402f","--fe-border-strong":"#3e5f49","--fe-text":"#dcebe0","--fe-text-muted":"#93b09b","--fe-text-on-primary":"#04180b","--fe-primary":"#54c17a","--fe-primary-hover":"#3fae66","--fe-danger":"#f87171","--fe-danger-hover":"#ef4444"}},{id:"amber",nameKey:"theme.name.amber",light:{"--fe-bg":"#fdf9f0","--fe-bg-elev":"#f7efdd","--fe-bg-hover":"#f0e3c8","--fe-bg-selected":"#ead6ab","--fe-border":"#e6dabf","--fe-border-strong":"#c6b184","--fe-text":"#33270f","--fe-text-muted":"#655631","--fe-text-on-primary":"#ffffff","--fe-primary":"#9a4b00","--fe-primary-hover":"#7c3c00","--fe-danger":"#c62828","--fe-danger-hover":"#a51f1f"},dark:{"--fe-bg":"#191307","--fe-bg-elev":"#231a0c","--fe-bg-hover":"#2f2312","--fe-bg-selected":"#44331b","--fe-border":"#3b2e17","--fe-border-strong":"#5b4a29","--fe-text":"#f2e7d4","--fe-text-muted":"#bda887","--fe-text-on-primary":"#2a1c02","--fe-primary":"#f5a524","--fe-primary-hover":"#ffb84d","--fe-danger":"#f87171","--fe-danger-hover":"#ef4444"}},{id:"lilac",nameKey:"theme.name.lilac",light:{"--fe-bg":"#faf7fd","--fe-bg-elev":"#f2ecfa","--fe-bg-hover":"#e8ddf5","--fe-bg-selected":"#dccaf0","--fe-border":"#e1d6ee","--fe-border-strong":"#bda6d9","--fe-text":"#241a33","--fe-text-muted":"#584871","--fe-text-on-primary":"#ffffff","--fe-primary":"#7231e0","--fe-primary-hover":"#5f21c4","--fe-danger":"#c62828","--fe-danger-hover":"#a51f1f"},dark:{"--fe-bg":"#130f1c","--fe-bg-elev":"#1b1527","--fe-bg-hover":"#261d37","--fe-bg-selected":"#37294f","--fe-border":"#302546","--fe-border-strong":"#4b3a6d","--fe-text":"#e9e2f5","--fe-text-muted":"#a999c5","--fe-text-on-primary":"#180d33","--fe-primary":"#b197fa","--fe-primary-hover":"#9c7cf4","--fe-danger":"#f87171","--fe-danger-hover":"#ef4444"}},{id:"contrast",nameKey:"theme.name.contrast",light:{"--fe-bg":"#ffffff","--fe-bg-elev":"#f2f2f2","--fe-bg-hover":"#e0e0e0","--fe-bg-selected":"#c9dcff","--fe-border":"#5c5c5c","--fe-border-strong":"#000000","--fe-text":"#000000","--fe-text-muted":"#3d3d3d","--fe-text-on-primary":"#ffffff","--fe-primary":"#003d99","--fe-primary-hover":"#002a6b","--fe-danger":"#a80000","--fe-danger-hover":"#7d0000","--fe-shadow":"0 0 0 1px #000000, 0 10px 32px rgba(0, 0, 0, 0.25)","--fe-shadow-sm":"0 0 0 1px #000000"},dark:{"--fe-bg":"#000000","--fe-bg-elev":"#0d0d0d","--fe-bg-hover":"#212121","--fe-bg-selected":"#003d80","--fe-border":"#8f8f8f","--fe-border-strong":"#ffffff","--fe-text":"#ffffff","--fe-text-muted":"#d6d6d6","--fe-text-on-primary":"#001430","--fe-primary":"#7ab8ff","--fe-primary-hover":"#9ccaff","--fe-danger":"#ff7575","--fe-danger-hover":"#ff9999","--fe-shadow":"0 0 0 1px #ffffff, 0 12px 32px rgba(0, 0, 0, 0.65)","--fe-shadow-sm":"0 0 0 1px #ffffff"}},{id:"gray",nameKey:"theme.name.gray",light:{"--fe-bg":"#f7f7f8","--fe-bg-elev":"#efeff1","--fe-bg-hover":"#e4e4e7","--fe-bg-selected":"#d6d7db","--fe-border":"#dfdfe2","--fe-border-strong":"#b9b9c0","--fe-text":"#26272b","--fe-text-muted":"#585a63","--fe-text-on-primary":"#ffffff","--fe-primary":"#4b4b54","--fe-primary-hover":"#38383f","--fe-danger":"#c62828","--fe-danger-hover":"#a51f1f"},dark:{"--fe-bg":"#131316","--fe-bg-elev":"#1b1b1f","--fe-bg-hover":"#26262b","--fe-bg-selected":"#35353c","--fe-border":"#2d2d33","--fe-border-strong":"#4a4a52","--fe-text":"#e6e6e9","--fe-text-muted":"#a4a4ad","--fe-text-on-primary":"#17171b","--fe-primary":"#b0b0ba","--fe-primary-hover":"#c4c4cd","--fe-danger":"#f87171","--fe-danger-hover":"#ef4444"}},{id:"terminal",nameKey:"theme.name.terminal",light:{"--fe-bg":"#f3f9f4","--fe-bg-elev":"#e5f2e8","--fe-bg-hover":"#d5ead9","--fe-bg-selected":"#bce3c6","--fe-border":"#cbe2d1","--fe-border-strong":"#94c2a0","--fe-text":"#0c2913","--fe-text-muted":"#31573c","--fe-text-on-primary":"#ffffff","--fe-primary":"#116b33","--fe-primary-hover":"#0c5427","--fe-danger":"#c62828","--fe-danger-hover":"#a51f1f","--fe-font":'ui-monospace, "SF Mono", Consolas, Menlo, monospace'},dark:{"--fe-bg":"#050d07","--fe-bg-elev":"#0a1710","--fe-bg-hover":"#112418","--fe-bg-selected":"#1a3a26","--fe-border":"#1c3a2a","--fe-border-strong":"#316144","--fe-text":"#4fdd8b","--fe-text-muted":"#38a668","--fe-text-on-primary":"#03180a","--fe-primary":"#25c95e","--fe-primary-hover":"#4fdd8b","--fe-danger":"#ff6b62","--fe-danger-hover":"#ff8d86","--fe-font":'ui-monospace, "SF Mono", Consolas, Menlo, monospace'}}];function al(e){return kf.find(t=>t.id===e)}const Pk=Array.from(new Set(kf.flatMap(e=>[...Object.keys(e.light),...Object.keys(e.dark)])));function Fk(){try{const e=localStorage.getItem(R0);return e&&al(e)?e:Ta}catch{return Ta}}const Sf=re(typeof window>"u"?Ta:Fk());function Rk(e){const t=al(e)?e:Ta;Sf.value=t;try{t===Ta?localStorage.removeItem(R0):localStorage.setItem(R0,t)}catch{}}function Lk(){return{themeId:Sf,setTheme:Rk}}if(typeof window<"u")try{window.addEventListener("storage",e=>{e.key===R0&&(Sf.value=e.newValue&&al(e.newValue)?e.newValue:Ta)})}catch{}function Bk(e,t,r){for(const i of Pk)e.style.removeProperty(i);if(t===Ta)return;const n=al(t);if(!n)return;const a=r?n.dark:n.light;for(const[i,o]of Object.entries(a))e.style.setProperty(i,o)}const tm="data-filex-theme";function rm(e){return Object.entries(e).map(([t,r])=>`${t}:${r};`).join("")}function $k(e){const t=rm(e.light),r=rm(e.dark),n=[".fe--theme-dark",":root[data-theme='dark'] .fe",".fe.fe--theme-dark",":root.dark",".dark",":root.dark .fe",".dark .fe",".fe-ctx-backdrop--theme-dark",".fe-ctx-backdrop--theme-auto[data-prefers-dark='1']"].join(","),a=[".fe:not(.fe--theme-light)",".fe-ctx-backdrop--theme-auto:not(.fe-ctx-backdrop--theme-light)"].join(",");return`/* filex theme: ${e.id} */:root,.fe{${t}}${n}{${r}}@media (prefers-color-scheme: dark){${a}{${r}}}`}function Nk(e){if(typeof document>"u")return;let t=document.head.querySelector(`style[${tm}]`);const r=e===Ta?void 0:al(e);if(!r){t&&(t.textContent="");return}t?t!==document.head.lastElementChild&&document.head.appendChild(t):(t=document.createElement("style"),t.setAttribute(tm,""),document.head.appendChild(t));const n=$k(r);t.textContent!==n&&(t.textContent=n)}const Uk={class:"fe-themes__hint"},Hk=["aria-label"],jk=["aria-selected","onClick"],Gk={class:"fe-themecard__name"},Vk=["title"],qk=["disabled"],Kk=Pt({__name:"ThemeGallery",props:{open:{type:Boolean},locale:{},theme:{},dark:{type:Boolean},current:{}},emits:["close","select"],setup(e,{emit:t}){const r=e,n=t,{t:a}=br(()=>r.locale);function i(s){return r.dark?s.dark:s.light}const o=Ta;return(s,l)=>(R(),Zt(ei,{open:e.open,title:Y(a)("theme.title"),size:"lg",theme:e.theme,onClose:l[2]||(l[2]=c=>n("close"))},{actions:ur(()=>[T("button",{type:"button",class:"fe-btn",disabled:e.current===Y(o),onClick:l[0]||(l[0]=c=>n("select",Y(o)))},V(Y(a)("theme.reset")),9,qk),T("button",{type:"button",class:"fe-btn fe-btn--primary",onClick:l[1]||(l[1]=c=>n("close"))},V(Y(a)("theme.close")),1)]),default:ur(()=>[T("p",Uk,V(Y(a)("theme.hint")),1),T("div",{class:"fe-themes",role:"listbox","aria-label":Y(a)("theme.title")},[(R(!0),$(qe,null,xt(Y(kf),c=>(R(),$("button",{key:c.id,type:"button",class:vt(["fe-themecard",{"is-selected":c.id===e.current}]),role:"option","aria-selected":c.id===e.current,style:Sn(i(c)),onClick:u=>n("select",c.id)},[l[3]||(l[3]=T("span",{class:"fe-themecard__preview","aria-hidden":"true"},[T("span",{class:"fe-themecard__topbar"},[T("span",{class:"fe-themecard__chip fe-themecard__chip--primary"}),T("span",{class:"fe-themecard__chip"}),T("span",{class:"fe-themecard__chip fe-themecard__chip--ghost"})]),T("span",{class:"fe-themecard__row"},[T("span",{class:"fe-themecard__dot"}),T("span",{class:"fe-themecard__line",style:{width:"62%"}})]),T("span",{class:"fe-themecard__row fe-themecard__row--selected"},[T("span",{class:"fe-themecard__dot fe-themecard__dot--primary"}),T("span",{class:"fe-themecard__line",style:{width:"44%"}})]),T("span",{class:"fe-themecard__row"},[T("span",{class:"fe-themecard__dot fe-themecard__dot--muted"}),T("span",{class:"fe-themecard__line fe-themecard__line--muted",style:{width:"74%"}})])],-1)),T("span",Gk,[$t(V(Y(a)(c.nameKey))+" ",1),c.id===e.current?(R(),$("span",{key:0,class:"fe-themecard__check",title:Y(a)("theme.selected")},"✓",8,Vk)):Te("",!0)])],14,jk))),128))],8,Hk)]),_:1},8,["open","title","theme"]))}}),Wk={class:"fe-shortset"},Yk={class:"fe-shortset__topbar"},Xk={class:"fe-shortset__hint"},Zk=["disabled"],Jk={class:"fe-shortcuts__heading"},Qk={class:"fe-shortset__row"},eS={class:"fe-shortset__label"},tS=["title"],rS={class:"fe-shortset__keys"},nS={key:0,class:"fe-shortset__capture",role:"status"},aS={key:0,class:"fe-shortcuts__unbound"},iS={class:"fe-kbd"},oS={key:0,class:"fe-shortcuts__or","aria-hidden":"true"},sS={class:"fe-shortset__actions"},lS=["onClick"],cS=["title","aria-label","onClick"],uS={key:1,class:"fe-shortset__fixed"},fS={key:0,class:"fe-shortset__conflict",role:"alert"},dS={class:"fe-shortset__conflict-msg"},pS={class:"fe-kbd"},hS={class:"fe-shortset__conflict-actions"},vS=Pt({__name:"ShortcutSettings",props:{open:{type:Boolean},locale:{},theme:{}},emits:["close"],setup(e,{emit:t}){const r=e,n=t,{t:a}=br(()=>r.locale),i=Bv(),o=Fe(()=>{const g=[],S=new Map;for(const M of i.value)S.has(M.groupKey)||(S.set(M.groupKey,[]),g.push(M.groupKey)),S.get(M.groupKey).push(M);return g.map(M=>({key:M,items:S.get(M)}))}),s=Fe(()=>i.value.some(g=>g.overridden)),l=re(null),c=re(null);function u(g){const S=so.find(M=>M.id===g);return S?a(S.labelKey):g}function d(g){c.value=null,l.value=g}function f(){l.value=null}function p(g,S){if(l.value=null,S===z0(g))return;const M=_x(S,g);if(M){c.value={id:g,combo:S,conflictId:M.id,fixed:M.fixed};return}bf(g,S)}function _(){const g=c.value;!g||g.fixed||(bf(g.conflictId,""),bf(g.id,g.combo),c.value=null)}function h(){c.value=null}function b(g){c.value=null,bx(g)}function v(){c.value=null,l.value=null,yx()}function m(g){if(l.value){if(g.preventDefault(),g.stopPropagation(),g.key==="Escape"){f();return}const S=Lv(g);if(!S)return;p(l.value,S);return}g.key==="Escape"||g.key==="Tab"||g.stopPropagation()}At(()=>r.open,g=>{g?window.addEventListener("keydown",m,!0):(window.removeEventListener("keydown",m,!0),l.value=null,c.value=null)}),tr(()=>window.removeEventListener("keydown",m,!0));function y(){if(l.value){f();return}n("close")}return(g,S)=>(R(),Zt(ei,{open:e.open,title:Y(a)("shortcuts.settings.title"),size:"lg",theme:e.theme,onClose:y},{actions:ur(()=>[T("button",{type:"button",class:"fe-btn",onClick:y},V(Y(a)("viewer.close")),1)]),default:ur(()=>[T("div",Wk,[T("div",Yk,[T("p",Xk,V(Y(a)("shortcuts.settings.hint")),1),T("button",{type:"button",class:"fe-btn fe-shortset__reset-all",disabled:!s.value,onClick:v}," ↺ "+V(Y(a)("shortcuts.settings.reset_all")),9,Zk)]),(R(!0),$(qe,null,xt(o.value,M=>(R(),$("section",{key:M.key,class:"fe-shortset__group"},[T("h3",Jk,V(Y(a)(M.key)),1),(R(!0),$(qe,null,xt(M.items,E=>{var w;return R(),$("div",{key:E.id,class:vt(["fe-shortset__item",{"is-capturing":l.value===E.id,"is-conflict":((w=c.value)==null?void 0:w.id)===E.id}])},[T("div",Qk,[T("span",eS,[$t(V(Y(a)(E.labelKey))+" ",1),E.overridden?(R(),$("span",{key:0,class:"fe-shortcuts__custom",title:Y(a)("shortcuts.settings.customized")},"●",8,tS)):Te("",!0)]),T("span",rS,[l.value===E.id?(R(),$("span",nS,V(Y(a)("shortcuts.settings.capture")),1)):(R(),$(qe,{key:1},[E.keys.length===0?(R(),$("span",aS,V(Y(a)("shortcuts.settings.unbound")),1)):(R(!0),$(qe,{key:1},xt(E.keys,(x,C)=>(R(),$(qe,{key:x},[T("kbd",iS,V(x),1),C<E.keys.length-1?(R(),$("span",oS,"/")):Te("",!0)],64))),128))],64))]),T("span",sS,[E.customizable?(R(),$(qe,{key:0},[l.value!==E.id?(R(),$("button",{key:0,type:"button",class:"fe-btn fe-shortset__btn",onClick:x=>d(E.id)},V(Y(a)("shortcuts.settings.change")),9,lS)):(R(),$("button",{key:1,type:"button",class:"fe-btn fe-shortset__btn",onClick:f},V(Y(a)("shortcuts.settings.conflict_cancel")),1)),E.overridden?(R(),$("button",{key:2,type:"button",class:"fe-btn fe-btn--icon-only fe-shortset__btn",title:Y(a)("shortcuts.settings.reset"),"aria-label":Y(a)("shortcuts.settings.reset"),onClick:x=>b(E.id)}," ↺ ",8,cS)):Te("",!0)],64)):(R(),$("span",uS,V(Y(a)("shortcuts.settings.fixed")),1))])]),c.value&&c.value.id===E.id?(R(),$("div",fS,[T("span",dS,[T("kbd",pS,V(c.value.combo),1),$t(" "+V(c.value.fixed?Y(a)("shortcuts.settings.conflict_fixed",{name:u(c.value.conflictId)}):Y(a)("shortcuts.settings.conflict",{name:u(c.value.conflictId)})),1)]),T("span",hS,[c.value.fixed?Te("",!0):(R(),$("button",{key:0,type:"button",class:"fe-btn fe-btn--danger fe-shortset__btn",onClick:_},V(Y(a)("shortcuts.settings.conflict_take")),1)),T("button",{type:"button",class:"fe-btn fe-shortset__btn",onClick:h},V(Y(a)("shortcuts.settings.conflict_cancel")),1)])])):Te("",!0)],2)}),128))]))),128))])]),_:1},8,["open","title","theme"]))}}),mS={key:0,class:"fe-preview"},gS=["src","alt"],bS=["src"],yS=["src"],_S=["data"],xS={class:"fe-preview__fallback"},wS=["href"],kS={key:0,class:"fe-preview__fallback"},SS={key:1,class:"fe-preview__fallback"},CS=["href"],ES={key:2,class:"fe-preview__md-split"},AS={class:"fe-preview__md-split-bar"},TS={key:0,class:"fe-preview__md-split-error"},MS=["disabled"],DS={class:"fe-preview__md-split-body"},zS=["onKeydown"],IS=["innerHTML"],OS={key:3,class:"fe-preview__fallback"},PS=["href"],FS=["innerHTML"],RS={key:5,class:"fe-preview__pre"},LS={key:0,class:"fe-preview__fallback"},BS=["href"],$S={key:1,class:"fe-preview__fallback"},NS={key:0,class:"fe-preview__fallback"},US={key:1,class:"fe-preview__fallback"},HS=["href"],jS={key:2,class:"fe-preview__fallback"},GS=["href"],VS={key:3,class:"fe-preview__code-wrap"},qS={class:"fe-preview__code-toolbar"},KS={class:"fe-preview__code-lang"},WS={key:0,class:"fe-preview__code-status"},YS={key:1,class:"fe-preview__code-status fe-preview__code-status--ok"},XS=["title"],ZS={key:3,class:"fe-preview__code-status"},JS=["disabled"],QS={key:0,class:"fe-preview__pre fe-preview__code hljs"},eC=["innerHTML"],tC=["data-lang"],rC={key:0,class:"fe-preview__fallback"},nC=["href"],aC={key:8,class:"fe-preview__fallback"},iC=["href"],oC=["href"],Cf=1e6,nm="fe-onlyoffice-api-js",am=Pt({__name:"PreviewModal",props:{open:{type:Boolean},locale:{},file:{},previewUrl:{type:Function},downloadUrl:{type:Function},onlyOfficeBase:{},onlyOfficeConfigEndpoint:{},saveTextEndpoint:{},openMode:{},authHeaders:{type:Function},authCredentials:{},drawioUrl:{},pdfWorkerUrl:{},pdfSaveUrl:{},viewerBaseUrl:{},newTabEnabled:{type:Boolean},chromeless:{type:Boolean},theme:{}},emits:["close"],setup(e,{emit:t}){const r=e,n=t,{t:a}=br(()=>r.locale);function i($e){return(($e==null?void 0:$e.extension)||"").toLowerCase()}const o=["jpg","jpeg","png","webp","gif","bmp","avif","svg","heic"],s=["mp4","webm","mov","mkv","m4v","ogv"],l=["mp3","wav","ogg","flac","m4a","aac","opus"],c={md:"markdown",markdown:"markdown",txt:"plaintext",log:"plaintext",js:"javascript",mjs:"javascript",cjs:"javascript",ts:"typescript",tsx:"typescript",jsx:"javascript",vue:"xml",svelte:"xml",html:"xml",htm:"xml",xml:"xml",svg:"xml",css:"css",scss:"scss",sass:"scss",less:"less",json:"json",jsonc:"json",yml:"yaml",yaml:"yaml",php:"php",py:"python",rb:"ruby",go:"go",rs:"rust",java:"java",kt:"kotlin",swift:"swift",cpp:"cpp",c:"c",h:"cpp",hpp:"cpp",cs:"csharp",dart:"dart",sh:"bash",bash:"bash",zsh:"bash",fish:"bash",sql:"sql",toml:"ini",ini:"ini",conf:"ini",env:"bash",cfg:"ini",dockerfile:"dockerfile",graphql:"graphql",gql:"graphql",diff:"diff",patch:"diff"},u=["txt","log"],d=["docx","doc","xlsx","xls","pptx","ppt","odt","ods","odp","rtf"],f={glb:()=>Promise.resolve().then(()=>jo),gltf:()=>Promise.resolve().then(()=>jo),obj:()=>Promise.resolve().then(()=>jo),stl:()=>Promise.resolve().then(()=>jo),fbx:()=>Promise.resolve().then(()=>jo),"3ds":()=>Promise.resolve().then(()=>jo),epub:()=>Promise.resolve().then(()=>uD),mmd:()=>Promise.resolve().then(()=>Tm),mermaid:()=>Promise.resolve().then(()=>Tm),drawio:()=>Promise.resolve().then(()=>Mm),dio:()=>Promise.resolve().then(()=>Mm),tif:()=>Promise.resolve().then(()=>Dm),tiff:()=>Promise.resolve().then(()=>Dm),psd:()=>Promise.resolve().then(()=>MD),ipynb:()=>Promise.resolve().then(()=>KD),csv:()=>Promise.resolve().then(()=>Im),tsv:()=>Promise.resolve().then(()=>Im),zip:()=>Promise.resolve().then(()=>vz)},p=Fe(()=>{const $e=i(r.file);if(!$e)return"other";if(o.includes($e))return"image";if(s.includes($e))return"video";if(l.includes($e))return"audio";if($e==="pdf")return"pdf";const L=r.openMode!=="view";return $e==="md"||$e==="markdown"?"markdown":$e in c?"code":$e in f?"viewer":d.includes($e)?"office":u.includes($e)?L?"code":"text":"other"}),_=o_(null),h=re(null),b=re(!1);async function v($e){_.value=null,h.value=null;const L=f[$e];if(L)try{const ge=await L();_.value=ge.default??ge}catch(ge){h.value=ge instanceof Error?ge.message:"viewer load failed",$e==="pdf"&&(b.value=!0)}}function m(){b.value=!0}const y=Fe(()=>{var ge;const $e=i(r.file),L={url:x.value,ext:$e,mime:(ge=r.file)==null?void 0:ge.mime_type,t:a,authHeaders:r.authHeaders,authCredentials:r.authCredentials};return r.file&&(L.filePath=D(r.file.path),($e==="zip"||$e==="rar"||$e==="7z"||$e==="tar"||$e==="gz"||$e==="tgz")&&(L.filePath=r.file.path)),($e==="drawio"||$e==="dio")&&(L.drawioUrl=r.drawioUrl??void 0,L.saveUrl=r.saveTextEndpoint??void 0,L.readOnly=r.openMode==="view"),$e==="pdf"&&(L.pdfWorkerUrl=r.pdfWorkerUrl??void 0,L.pdfSaveUrl=r.pdfSaveUrl??void 0),L});function g(){M(r.openMode||"edit")}function S(){M("edit")}function M($e){if(!r.file)return;const L=i(r.file),ge=r.viewerBaseUrl||"/files/edit",Oe=ge.includes("?")?"&":"?",He=`${ge}${Oe}path=${encodeURIComponent(r.file.path)}&type=${encodeURIComponent(L)}&mode=${encodeURIComponent($e)}`;window.open(He,"_blank","noopener")}const E=new Set(["docx","doc","xlsx","xls","pptx","ppt","odt","ods","odp","rtf","drawio","dio","mmd","mermaid","md","markdown","txt","log","json","jsonc","yaml","yml","xml","svg","html","htm","js","mjs","cjs","ts","tsx","jsx","vue","svelte","css","scss","sass","less","php","py","rb","go","rs","java","kt","swift","cpp","c","h","hpp","cs","dart","sh","bash","sql","toml","ini","conf","cfg","env","dockerfile","graphql","gql"]),w=Fe(()=>!!r.file&&E.has(i(r.file))),x=Fe(()=>r.file?r.previewUrl(r.file.path):""),C=Fe(()=>r.file?r.downloadUrl(r.file.path):"");function D($e){const L=$e.indexOf("://");return L===-1?$e:$e.slice(L+3)}const B=re(!1),F=re(null),K=re(""),te=re(!1),J=re(!1),ne=re(!1);let le,q;function j(){J.value=!0,le&&clearTimeout(le),le=setTimeout(()=>{Ae(K.value)},250),q&&clearTimeout(q),q=setTimeout(()=>{P()},1500)}async function P(){if(!(!r.saveTextEndpoint||!r.file||ne.value)){ne.value=!0,F.value=null;try{const $e={"Content-Type":"application/json",...await(r.authHeaders??(()=>({})))()},L=await fetch(r.saveTextEndpoint,{method:"POST",headers:$e,credentials:r.authCredentials||"same-origin",body:JSON.stringify({path:D(r.file.path),content:K.value})});if(!L.ok)throw new Error(`save failed: ${L.status} ${await L.text()}`);J.value=!1}catch($e){F.value=$e instanceof Error?$e.message:String($e)}finally{ne.value=!1}}}async function N($e){B.value=!0,F.value=null,K.value="",te.value=!1;try{const L={};r.authHeaders&&Object.assign(L,r.authHeaders());const ge=await fetch($e,{credentials:r.authCredentials||"include",headers:L});if(!ge.ok)throw new Error(`${ge.status} ${ge.statusText}`);if(Number(ge.headers.get("content-length")||"0")>Cf){te.value=!0;return}const He=await ge.text();He.length>Cf?(te.value=!0,K.value=He.slice(0,Cf)):K.value=He}catch(L){F.value=L instanceof Error?L.message:String(L)}finally{B.value=!1}}const X=re(""),Ee=re(null);async function Ae($e){try{const L=await import("markdown-it").catch(()=>null);if(!L){X.value="";return}const ge=L.default??L,He=new ge({html:!0,linkify:!0,breaks:!0,typographer:!0}).render($e);X.value=ze(He),await new Promise(de=>setTimeout(de,0)),await Le()}catch(L){X.value="",F.value=L instanceof Error?L.message:String(L)}}function ze($e){return $e.replace(/<\s*script\b[^<]*(?:(?!<\s*\/\s*script\s*>)<[^<]*)*<\s*\/\s*script\s*>/gi,"").replace(/<\s*iframe\b[\s\S]*?<\s*\/\s*iframe\s*>/gi,"").replace(/<\s*object\b[\s\S]*?<\s*\/\s*object\s*>/gi,"").replace(/<\s*embed\b[^>]*>/gi,"").replace(/\son\w+\s*=\s*(?:"[^"]*"|'[^']*'|[^\s>]+)/gi,"").replace(/(href|src|action|formaction|xlink:href)\s*=\s*(?:"\s*javascript:[^"]*"|'\s*javascript:[^']*')/gi,'$1="#"')}async function Le(){var He,de,Me;if(!Ee.value)return;const $e=Ee.value,L=Array.from($e.querySelectorAll("pre > code"));if(L.length===0)return;let ge,Oe;for(const G of L){const je=G.className||"",wt=/\blanguage-mermaid\b/.test(je)||/\blanguage-mmd\b/.test(je),A=/\blanguage-math\b/.test(je)||/\blanguage-latex\b/.test(je)||/\blanguage-tex\b/.test(je);if(wt){if(ge===void 0)try{const ie=await import("mermaid");ge=ie.default??ie,(He=ge.initialize)==null||He.call(ge,{startOnLoad:!1,securityLevel:"strict"})}catch{ge=null}if(!ge)continue;try{const ie=`filex-md-mermaid-${Math.random().toString(36).slice(2)}`,{svg:ae}=await ge.render(ie,G.textContent||""),U=document.createElement("div");U.className="fe-preview__md-mermaid",U.innerHTML=ae,(de=G.parentElement)==null||de.replaceWith(U)}catch{}}else if(A){if(Oe===void 0)try{const ie=await Promise.resolve().then(()=>QI);Oe=ie.default??ie}catch{Oe=null}if(!Oe)continue;try{const ie=Oe.renderToString(G.textContent||"",{displayMode:!0,throwOnError:!1}),ae=document.createElement("div");ae.className="fe-preview__md-math",ae.innerHTML=ie,(Me=G.parentElement)==null||Me.replaceWith(ae)}catch{}}}}const he=re("");async function Ie($e,L){try{const ge=await Hv();if(!ge){he.value="";return}const Oe=ge.default??ge;if(Oe.getLanguage(L)){const He=Oe.highlight($e,{language:L,ignoreIllegals:!0});he.value=He.value}else{const He=Oe.highlightAuto($e);he.value=He.value}}catch(ge){he.value="",F.value=ge instanceof Error?ge.message:String(ge)}}const De=re(null);let Be=null,Z;const se=re(!1),we=re(!1),Se=re(!1),me=re(null);function ye(){if(Be){try{Be.dispose()}catch{}Be=null}se.value=!1,Se.value=!1,me.value=null}function xe($e){return{js:"javascript",mjs:"javascript",cjs:"javascript",ts:"typescript",tsx:"typescript",jsx:"javascript",json:"json",jsonc:"json",css:"css",scss:"scss",sass:"scss",less:"less",html:"html",htm:"html",vue:"html",svelte:"html",xml:"xml",svg:"xml",md:"markdown",markdown:"markdown",php:"php",py:"python",yml:"yaml",yaml:"yaml",go:"go",rs:"rust",sql:"sql",cpp:"cpp",c:"c",h:"cpp",hpp:"cpp",sh:"shell",bash:"shell",dockerfile:"dockerfile",toml:"ini",ini:"ini",conf:"ini",cfg:"ini"}[$e]??"plaintext"}async function ee($e,L){var Oe;const ge=await Uv();if(!ge||!De.value)return!1;try{ye();const He=!!r.saveTextEndpoint&&r.openMode!=="view",de=r.theme==="dark"?!0:r.theme==="light"?!1:(Oe=window.matchMedia)==null?void 0:Oe.call(window,"(prefers-color-scheme: dark)").matches;return Be=ge.editor.create(De.value,{value:$e,language:xe(L),readOnly:!He,theme:de?"vs-dark":"vs",automaticLayout:!0,minimap:{enabled:!1},fontSize:13}),He&&(Be.addCommand(ge.KeyMod.CtrlCmd|ge.KeyCode.KeyS,()=>void pe()),Be.onDidChangeModelContent(()=>{Z&&clearTimeout(Z),Z=setTimeout(()=>{pe()},1500)})),se.value=!0,!0}catch(He){return F.value=`Monaco mount fail: ${He.message}`,!1}}async function pe(){if(!(!r.saveTextEndpoint||!r.file)&&r.openMode!=="view"&&!we.value){we.value=!0,Se.value=!1,me.value=null;try{const $e=Be?Be.getValue():"",L={"Content-Type":"application/json"};r.authHeaders&&Object.assign(L,r.authHeaders());const ge=await fetch(r.saveTextEndpoint,{method:"POST",headers:L,credentials:r.authCredentials||"same-origin",body:JSON.stringify({path:D(r.file.path),content:$e})});if(!ge.ok){const Oe=await ge.text().catch(()=>"");throw new Error(`${ge.status} ${ge.statusText}${Oe?" — "+Oe.slice(0,150):""}`)}Se.value=!0,setTimeout(()=>{Se.value=!1},2500)}catch($e){me.value=$e.message}finally{we.value=!1}}}async function ve($e,L,ge){if(K.value="",X.value="",he.value="",F.value=null,Ue.value=null,_.value=null,h.value=null,b.value=!1,lt(),ye(),!(!$e||!L)){if(ge==="viewer"){await v(i(r.file));return}if(ge==="markdown"||ge==="code"||ge==="text"){if(await N(L),te.value)return;if(ge==="markdown"){await Ae(K.value);return}const Oe=c[i(r.file)]||"";Lx()?(await new Promise(Me=>setTimeout(Me,0)),await ee(K.value,i(r.file))||await Ie(K.value,Oe)):(ge==="code"&&await Ie(K.value,Oe),Uv().then(async de=>{de&&r.open&&(await new Promise(Me=>setTimeout(Me,0)),await ee(K.value,i(r.file)))}))}else ge==="office"&&(await new Promise(Oe=>setTimeout(Oe,0)),await rt())}}At(()=>[r.open,x.value,p.value,r.openMode],([$e,L,ge])=>{ve($e,L,ge)}),Xt(()=>{Nr(()=>{r.open&&ve(r.open,x.value,p.value)})});const Pe=Fe(()=>c[i(r.file)]||"plaintext"),Ge=re(null),Ue=re(null);let We=null;async function rt(){if(Ue.value=null,!(!r.file||p.value!=="office")){if(!r.onlyOfficeConfigEndpoint){Ue.value="OnlyOffice yapılandırması yok";return}if(Ge.value)try{const $e={"Content-Type":"application/json"};r.authHeaders&&Object.assign($e,r.authHeaders());const L=await fetch(r.onlyOfficeConfigEndpoint,{method:"POST",headers:$e,credentials:r.authCredentials||"same-origin",body:JSON.stringify({path:r.file.path,mode:r.openMode||"edit"})});if(!L.ok)throw new Error(`Config fetch ${L.status}: ${(await L.text()).slice(0,200)}`);const{config:ge,documentServerUrl:Oe}=await L.json();await St(Oe),lt();const He="fe-onlyoffice-mount";Ge.value.id=He,ge.events={onError:Me=>{Ue.value=ft(Me)}};const de=window;if(!de.DocsAPI||!de.DocsAPI.DocEditor)throw new Error("DocsAPI not available after script load");We=new de.DocsAPI.DocEditor(He,ge)}catch($e){Ue.value=$e instanceof Error?$e.message:String($e)}}}function lt(){var $e;try{($e=We==null?void 0:We.destroyEditor)==null||$e.call(We)}catch{}We=null}tr(()=>{lt(),ye()});function ft($e){if(typeof $e=="string")return $e;const L=$e;if(L!=null&&L.data&&typeof L.data=="object"){const ge=L.data;if(typeof ge.errorDescription=="string")return ge.errorDescription;if(typeof ge.message=="string")return ge.message;if(ge.errorCode!==void 0)return`OnlyOffice error ${ge.errorCode}`}if(typeof(L==null?void 0:L.data)=="string")return L.data;if(typeof(L==null?void 0:L.errorDescription)=="string")return L.errorDescription;if(typeof(L==null?void 0:L.message)=="string")return L.message;try{return JSON.stringify($e)}catch{return"OnlyOffice error"}}function St($e){return new Promise((L,ge)=>{var de;if((de=window.DocsAPI)!=null&&de.DocEditor){L();return}const Oe=document.getElementById(nm);if(Oe){Oe.addEventListener("load",()=>L()),Oe.addEventListener("error",()=>ge(new Error("OnlyOffice api.js load failed")));return}const He=document.createElement("script");He.id=nm,He.src=`${$e.replace(/\/$/,"")}/web-apps/apps/api/documents/api.js`,He.async=!0,He.onload=()=>L(),He.onerror=()=>ge(new Error("OnlyOffice api.js load failed")),document.head.appendChild(He)})}return($e,L)=>{var ge;return R(),Zt(ei,{open:e.open,size:"xl",title:((ge=e.file)==null?void 0:ge.basename)||"",chromeless:e.chromeless,theme:e.theme,onClose:L[2]||(L[2]=Oe=>n("close"))},{actions:ur(()=>[e.file&&e.openMode==="view"&&w.value&&e.newTabEnabled!==!1?(R(),$("button",{key:0,type:"button",class:"fe-btn fe-btn--primary",onClick:S},"✏ "+V(Y(a)("viewer.edit")),1)):Te("",!0),e.file&&e.newTabEnabled!==!1?(R(),$("button",{key:1,type:"button",class:"fe-btn",onClick:g},"↗ "+V(Y(a)("viewer.open_in_new_tab")),1)):Te("",!0),e.file?(R(),$("a",{key:2,href:C.value,class:"fe-btn"},V(Y(a)("viewer.download")),9,oC)):Te("",!0),T("button",{type:"button",class:"fe-btn",onClick:L[1]||(L[1]=Oe=>n("close"))},V(Y(a)("viewer.close")),1)]),default:ur(()=>[e.file?(R(),$("div",mS,[p.value==="image"?(R(),$("img",{key:0,src:x.value,alt:e.file.basename,class:"fe-preview__image"},null,8,gS)):p.value==="video"?(R(),$("video",{key:1,src:x.value,controls:"",preload:"metadata",class:"fe-preview__video"},null,8,bS)):p.value==="audio"?(R(),$("audio",{key:2,src:x.value,controls:"",class:"fe-preview__audio"},null,8,yS)):p.value==="pdf"?(R(),$("object",{key:3,data:x.value,type:"application/pdf",class:"fe-preview__iframe"},[T("div",xS,[L[3]||(L[3]=T("span",{class:"fe-preview__fallback-icon"},"📕",-1)),L[4]||(L[4]=T("p",null,"Tarayıcı PDF'i inline açamadı.",-1)),T("a",{href:C.value,class:"fe-btn fe-btn--primary",target:"_blank",rel:"noopener"},"PDF'i Yeni Sekmede Aç",8,wS)])],8,_S)):p.value==="markdown"?(R(),$(qe,{key:4},[B.value?(R(),$("div",kS,V(Y(a)("viewer.loading")),1)):te.value?(R(),$("div",SS,[L[5]||(L[5]=$t(" Dosya çok büyük (>1 MB). ",-1)),T("a",{href:C.value,class:"fe-btn"},V(Y(a)("viewer.download")),9,CS)])):e.openMode==="edit"&&e.saveTextEndpoint?(R(),$("div",ES,[T("div",AS,[L[6]||(L[6]=T("span",{class:"fe-preview__md-split-label"},"MARKDOWN",-1)),F.value?(R(),$("span",TS,V(F.value),1)):Te("",!0),T("button",{type:"button",class:"fe-btn fe-btn--primary",disabled:!J.value||ne.value,onClick:P},V(ne.value?Y(a)("viewer.saving"):J.value?Y(a)("viewer.save"):Y(a)("viewer.saved")),9,MS)]),T("div",DS,[Yt(T("textarea",{class:"fe-preview__md-split-input","onUpdate:modelValue":L[0]||(L[0]=Oe=>K.value=Oe),onInput:j,onKeydown:[un(Ht(P,["ctrl","prevent"]),["s"]),un(Ht(P,["meta","prevent"]),["s"])],spellcheck:"false",placeholder:"# Markdown buraya…"},null,40,zS),[[Ir,K.value]]),T("div",{ref_key:"markdownEl",ref:Ee,class:"fe-preview__md-split-output fe-preview__md",innerHTML:X.value},null,8,IS)])])):F.value?(R(),$("div",OS,[T("p",null,V(F.value),1),T("a",{href:C.value,class:"fe-btn fe-btn--primary"},V(Y(a)("viewer.download")),9,PS)])):X.value?(R(),$("div",{key:4,ref_key:"markdownEl",ref:Ee,class:"fe-preview__md",innerHTML:X.value},null,8,FS)):(R(),$("pre",RS,V(K.value),1))],64)):p.value==="viewer"?(R(),$(qe,{key:5},[h.value&&!b.value?(R(),$("div",LS,[L[7]||(L[7]=T("span",{class:"fe-preview__fallback-icon"},"⚠️",-1)),T("p",null,V(h.value),1),T("a",{href:C.value,class:"fe-btn fe-btn--primary"},V(Y(a)("viewer.download")),9,BS)])):_.value?(R(),Zt(j_(_.value),J1({key:2},y.value,{class:"fe-preview__viewer",onFallback:m}),null,16)):(R(),$("div",$S,[L[8]||(L[8]=T("span",{class:"fe-preview__fallback-icon"},"⏳",-1)),T("p",null,V(Y(a)("viewer.loading")),1)]))],64)):p.value==="code"||p.value==="text"?(R(),$(qe,{key:6},[B.value?(R(),$("div",NS,V(Y(a)("viewer.loading")),1)):te.value?(R(),$("div",US,[L[9]||(L[9]=$t(" Dosya çok büyük (>1 MB). ",-1)),T("a",{href:C.value,class:"fe-btn"},V(Y(a)("viewer.download")),9,HS)])):F.value?(R(),$("div",jS,[T("p",null,V(F.value),1),T("a",{href:C.value,class:"fe-btn fe-btn--primary"},V(Y(a)("viewer.download")),9,GS)])):(R(),$("div",VS,[T("div",qS,[T("span",KS,V(Pe.value),1),!se.value&&he.value?(R(),$("span",WS,V(e.saveTextEndpoint?Y(a)("viewer.editor_loading"):Y(a)("viewer.read_only")),1)):Te("",!0),Se.value?(R(),$("span",YS,"✓ "+V(Y(a)("viewer.saved")),1)):Te("",!0),me.value?(R(),$("span",{key:2,class:"fe-preview__code-status fe-preview__code-status--err",title:me.value},"✗ "+V(Y(a)("viewer.save_error")),9,XS)):Te("",!0),e.openMode==="view"?(R(),$("span",ZS,V(Y(a)("viewer.read_only")),1)):e.saveTextEndpoint&&se.value?(R(),$("button",{key:4,type:"button",class:"fe-btn fe-btn--primary",disabled:we.value,onClick:pe},V(we.value?Y(a)("viewer.saving"):Y(a)("viewer.save")),9,JS)):Te("",!0)]),T("div",{ref_key:"monacoEl",ref:De,class:vt(["fe-preview__code-editor",{"is-hidden":!se.value}])},null,2),!se.value&&he.value?(R(),$("pre",QS,[T("code",{class:vt(`language-${Pe.value}`),innerHTML:he.value},null,10,eC)])):!se.value&&!he.value?(R(),$("pre",{key:1,class:"fe-preview__pre","data-lang":Pe.value},V(K.value),9,tC)):Te("",!0)]))],64)):p.value==="office"?(R(),$(qe,{key:7},[Ue.value?(R(),$("div",rC,[L[10]||(L[10]=T("span",{class:"fe-preview__fallback-icon"},"📄",-1)),T("p",null,V(Ue.value),1),T("a",{href:C.value,class:"fe-btn fe-btn--primary"},V(Y(a)("viewer.download")),9,nC)])):(R(),$("div",{key:1,ref_key:"officeEl",ref:Ge,class:"fe-preview__office"},null,512))],64)):(R(),$("div",aC,[L[11]||(L[11]=T("span",{class:"fe-preview__fallback-icon"},"📎",-1)),T("p",null,V(Y(a)("viewer.no_preview")),1),T("a",{href:C.value,class:"fe-btn fe-btn--primary"},V(Y(a)("viewer.download")),9,iC)]))])):Te("",!0)]),_:1},8,["open","title","chromeless","theme"])}}}),sC=Pt({__name:"QuickLook",props:{open:{type:Boolean},locale:{},file:{},previewUrl:{type:Function},downloadUrl:{type:Function},onlyOfficeBase:{},onlyOfficeConfigEndpoint:{},authHeaders:{type:Function},authCredentials:{},drawioUrl:{},pdfWorkerUrl:{},viewerBaseUrl:{},theme:{}},emits:["close","nav","open-full"],setup(e,{emit:t}){const r=e,n=t,{t:a}=br(()=>r.locale);function i(s){const l=s;return!!(l&&(l.tagName==="INPUT"||l.tagName==="TEXTAREA"||l.tagName==="SELECT"||l.isContentEditable))}function o(s){if(r.open&&!(s.ctrlKey||s.metaKey||s.altKey)&&!i(s.target))switch(s.key){case" ":s.preventDefault(),s.stopPropagation(),n("close");break;case"ArrowRight":case"ArrowDown":s.preventDefault(),s.stopPropagation(),n("nav",1);break;case"ArrowLeft":case"ArrowUp":s.preventDefault(),s.stopPropagation(),n("nav",-1);break;case"Enter":s.preventDefault(),s.stopPropagation(),n("open-full");break}}return At(()=>r.open,s=>{s?window.addEventListener("keydown",o,!0):window.removeEventListener("keydown",o,!0)},{immediate:!0}),tr(()=>window.removeEventListener("keydown",o,!0)),(s,l)=>(R(),$(qe,null,[Dt(am,{class:"fe-quicklook",open:e.open,locale:e.locale,file:e.file,theme:e.theme,"preview-url":e.previewUrl,"download-url":e.downloadUrl,"only-office-base":e.onlyOfficeBase,"only-office-config-endpoint":e.onlyOfficeConfigEndpoint,"open-mode":"view","auth-headers":e.authHeaders,"auth-credentials":e.authCredentials,"drawio-url":e.drawioUrl,"pdf-worker-url":e.pdfWorkerUrl,"viewer-base-url":e.viewerBaseUrl,onClose:l[0]||(l[0]=c=>n("close"))},null,8,["open","locale","file","theme","preview-url","download-url","only-office-base","only-office-config-endpoint","auth-headers","auth-credentials","drawio-url","pdf-worker-url","viewer-base-url"]),Dt(Za,{name:"fe-toast"},{default:ur(()=>[e.open?(R(),$("div",{key:0,class:vt(["fe fe-ql-hint",{"fe--theme-light":e.theme==="light","fe--theme-dark":e.theme==="dark"}]),"aria-hidden":"true"},[l[1]||(l[1]=T("kbd",{class:"fe-kbd"},"Space",-1)),$t(" "+V(Y(a)("quicklook.hint_close"))+" ",1),l[2]||(l[2]=T("span",{class:"fe-ql-hint__sep"},"·",-1)),l[3]||(l[3]=T("kbd",{class:"fe-kbd"},"↑",-1)),l[4]||(l[4]=T("kbd",{class:"fe-kbd"},"↓",-1)),$t(" "+V(Y(a)("quicklook.hint_nav"))+" ",1),l[5]||(l[5]=T("span",{class:"fe-ql-hint__sep"},"·",-1)),l[6]||(l[6]=T("kbd",{class:"fe-kbd"},"Enter",-1)),$t(" "+V(Y(a)("quicklook.hint_open")),1)],2)):Te("",!0)]),_:1})],64))}}),lC=["aria-label"],cC={class:"fe-opc__head"},uC=["aria-label"],fC={class:"fe-opc__body"},dC={key:0,class:"fe-opc__section","aria-live":"polite"},pC={class:"fe-opc__section-title"},hC={class:"fe-opc__list"},vC={class:"fe-opc__kicon",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true",focusable:"false"},mC=["d"],gC={class:"fe-opc__mid"},bC=["title"],yC={class:"fe-opc__sub"},_C={class:"fe-opc__kind"},xC={class:"fe-opc__state"},wC=["aria-valuenow"],kC={key:0,class:"fe-opc__spin","aria-hidden":"true"},SC={class:"fe-opc__acts"},CC=["onClick"],EC=["onClick"],AC=["aria-label","onClick"],TC={key:1,class:"fe-opc__section"},MC={class:"fe-opc__section-title"},DC={class:"fe-opc__list fe-opc__list--history"},zC={class:"fe-opc__kicon",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true",focusable:"false"},IC=["d"],OC={class:"fe-opc__mid"},PC=["title"],FC={key:0,class:"fe-opc__sub fe-opc__sub--err"},RC={key:2,class:"fe-opc__empty"},LC=["aria-expanded","aria-label"],BC=["stroke-dashoffset"],$C={class:"fe-opc__count"},NC={key:0,class:"fe-opc__pct"},Ef=8.5,UC=Pt({__name:"OperationsCenter",props:{center:{},locale:{},narrow:{type:Boolean}},setup(e){const t=e,{t:r,formatSize:n}=br(()=>t.locale),a=re(!1),i=re(null),o=Fe(()=>t.center.active.value),s=Fe(()=>t.center.history.value),l=Fe(()=>t.center.hasError.value),c=Fe(()=>t.center.overallPercent.value),u=Fe(()=>t.center.runningCount.value),d=Fe(()=>o.value.length>0||a.value&&s.value.length>0);At(d,w=>{w||(a.value=!1)});const f=2*Math.PI*Ef,p=Fe(()=>{const w=c.value;return w===null?f*.72:f*(1-Math.min(100,Math.max(0,w))/100)}),_=Fe(()=>c.value===null&&u.value>0),h=Fe(()=>u.value===0||c.value===null?"":r("opc.percent",{n:c.value})),b=Fe(()=>r("opc.aria_badge",{n:o.value.length})),v={upload:"M12 16V5M7 9.5 12 5l5 4.5M5 19h14",copy:"M9 9h11v11H9zM5 15V4h11",move:"M4 12h13M12 6l6 6-6 6",delete:"M5 7h14M9 7V5h6v2M8 7l1 13h6l1-13",convert:"M20 8A8 8 0 0 0 6 6L4 8M4 16a8 8 0 0 0 14 2l2-2M20 3v5h-5M4 21v-5h5",archive:"M4 8V5h16v3zM5 8h14v12H5zM10 12h4"};function m(w){return r(`opc.kind.${w.kind}`)}function y(w){return w.name||m(w)}function g(w){return w.status==="running"?w.queued?r("opc.queued"):w.totalBytes&&w.totalBytes>0?`${n(w.uploadedBytes??0)} / ${n(w.totalBytes)}`:w.totalCount&&w.totalCount>0?`${w.doneCount??0}/${w.totalCount}`:r("opc.status.running"):w.status==="done"?r("opc.status.done"):w.status==="aborted"?r("opc.status.aborted"):w.error||r("opc.status.error")}function S(w){return r(`opc.status.${w.status==="running"?"running":w.status}`)}function M(w){if(!a.value)return;const x=i.value;x&&w.target instanceof Node&&!x.contains(w.target)&&(a.value=!1)}function E(w){a.value&&w.key==="Escape"&&(a.value=!1)}return Xt(()=>{document.addEventListener("mousedown",M),document.addEventListener("keydown",E)}),tr(()=>{document.removeEventListener("mousedown",M),document.removeEventListener("keydown",E)}),(w,x)=>d.value?(R(),$("div",{key:0,ref_key:"rootEl",ref:i,class:vt(["fe-opc",{"fe-opc--narrow":e.narrow,"fe-opc--open":a.value}])},[Dt(Za,{name:"fe-opc-pop"},{default:ur(()=>[a.value?(R(),$("section",{key:0,class:"fe-opc__panel",role:"dialog","aria-label":Y(r)("opc.title")},[T("header",cC,[T("strong",null,V(Y(r)("opc.title")),1),T("button",{type:"button",class:"fe-opc__x","aria-label":Y(r)("opc.close"),onClick:x[0]||(x[0]=C=>a.value=!1)},"×",8,uC)]),T("div",fC,[o.value.length>0?(R(),$("div",dC,[T("h3",pC,V(Y(r)("opc.active")),1),T("ul",hC,[(R(!0),$(qe,null,xt(o.value,C=>(R(),$("li",{key:C.key,class:vt(["fe-opc__item",`is-${C.status}`])},[(R(),$("svg",vC,[T("path",{d:v[C.kind]},null,8,mC)])),T("div",gC,[T("div",{class:"fe-opc__name",title:y(C)},V(y(C)),9,bC),T("div",yC,[T("span",_C,V(m(C)),1),x[3]||(x[3]=T("span",{class:"fe-opc__dot","aria-hidden":"true"},"·",-1)),T("span",xC,V(g(C)),1)]),C.status==="running"&&C.percent!==null?(R(),$("div",{key:0,class:"fe-opc__bar",role:"progressbar","aria-valuenow":C.percent,"aria-valuemin":"0","aria-valuemax":"100"},[T("div",{class:"fe-opc__bar-fill",style:Sn({width:C.percent+"%"})},null,4)],8,wC)):Te("",!0)]),C.status==="running"&&C.percent===null&&!C.queued?(R(),$("span",kC)):Te("",!0),T("div",SC,[C.status==="running"&&C.cancellable?(R(),$("button",{key:0,type:"button",class:"fe-opc__act",onClick:D=>e.center.cancel(C.key)},V(Y(r)("opc.cancel")),9,CC)):Te("",!0),C.status==="error"&&C.retryable?(R(),$("button",{key:1,type:"button",class:"fe-opc__act fe-opc__act--retry",onClick:D=>e.center.retry(C.key)},V(Y(r)("opc.retry")),9,EC)):Te("",!0),C.status!=="running"?(R(),$("button",{key:2,type:"button",class:"fe-opc__x","aria-label":Y(r)("opc.dismiss"),onClick:D=>e.center.dismiss(C.key)},"×",8,AC)):Te("",!0)])],2))),128))])])):Te("",!0),s.value.length>0?(R(),$("div",TC,[T("h3",MC,[$t(V(Y(r)("opc.history"))+" ",1),T("button",{type:"button",class:"fe-opc__act",onClick:x[1]||(x[1]=C=>e.center.clearHistory())},V(Y(r)("opc.clear")),1)]),T("ul",DC,[(R(!0),$(qe,null,xt(s.value,C=>(R(),$("li",{key:"h-"+C.key,class:vt(["fe-opc__item fe-opc__item--history",`is-${C.status}`])},[(R(),$("svg",zC,[T("path",{d:v[C.kind]},null,8,IC)])),T("div",OC,[T("div",{class:"fe-opc__name",title:y(C)},V(y(C)),9,PC),C.status==="error"&&C.error?(R(),$("div",FC,V(C.error),1)):Te("",!0)]),T("span",{class:vt(["fe-opc__chip",`is-${C.status}`])},V(S(C)),3)],2))),128))])])):Te("",!0),o.value.length===0&&s.value.length===0?(R(),$("p",RC,V(Y(r)("opc.empty")),1)):Te("",!0)])],8,lC)):Te("",!0)]),_:1}),T("button",{type:"button",class:vt(["fe-opc__badge",{"is-error":l.value}]),"aria-expanded":a.value,"aria-label":b.value,onClick:x[2]||(x[2]=C=>a.value=!a.value)},[(R(),$("svg",{class:vt(["fe-opc__ring",{"fe-opc__ring--spin":_.value}]),viewBox:"0 0 22 22","aria-hidden":"true",focusable:"false"},[T("circle",{class:"fe-opc__ring-track",cx:"11",cy:"11",r:Ef,fill:"none","stroke-width":"2.5"}),T("circle",{class:"fe-opc__ring-fill",cx:"11",cy:"11",r:Ef,fill:"none","stroke-width":"2.5","stroke-linecap":"round","stroke-dasharray":f,"stroke-dashoffset":p.value,transform:"rotate(-90 11 11)"},null,8,BC)],2)),T("span",$C,V(o.value.length),1),h.value?(R(),$("span",NC,V(h.value),1)):Te("",!0)],10,LC)],2)):Te("",!0)}}),HC=4e3,im=50;function jC(e,t,r){const n=t.status!=="running";return{key:e,kind:t.kind,name:t.name,percent:t.percent,status:t.status,error:t.error??null,queued:t.queued??!1,doneCount:t.doneCount??null,totalCount:t.totalCount??null,uploadedBytes:t.uploadedBytes??null,totalBytes:t.totalBytes??null,cancellable:t.cancellable??!1,retryable:t.retryable??!1,startedAt:(r==null?void 0:r.startedAt)??Date.now(),settledAt:(r==null?void 0:r.settledAt)??(n?Date.now():null)}}function GC(){const e=re([]),t=re([]),r=new Map,n=new Set,a=new Map;function i(v){const m=a.get(v);m!==void 0&&(clearTimeout(m),a.delete(v))}function o(v,m={}){i(v);const y=e.value.findIndex(S=>S.key===v);if(y===-1)return;const[g]=e.value.splice(y,1);e.value=[...e.value],n.add(v),m.toHistory!==!1&&(t.value=[{...g,settledAt:g.settledAt??Date.now()},...t.value].slice(0,im))}function s(v){a.has(v)||a.set(v,setTimeout(()=>{var y;a.delete(v);const m=r.get(v);o(v),(y=m==null?void 0:m.dismiss)==null||y.call(m)},HC))}function l(v,m){const y=`${v}:`,g=new Set;let S=[...e.value],M=!1;for(const E of m){const w=`${v}:${E.input.id}`;if(g.add(w),E.actions&&r.set(w,E.actions),n.has(w))continue;const x=S.findIndex(D=>D.key===w),C=jC(w,E.input,x===-1?void 0:S[x]);x===-1?(S=[C,...S],M=!0):JSON.stringify(S[x])!==JSON.stringify(C)&&(S[x]=C,M=!0),(C.status==="done"||C.status==="aborted")&&s(w)}for(const E of[...S])!E.key.startsWith(y)||g.has(E.key)||E.status!=="error"&&(i(E.key),S=S.filter(w=>w.key!==E.key),M=!0,E.status!=="running"&&(n.add(E.key),t.value=[{...E,settledAt:E.settledAt??Date.now()},...t.value].slice(0,im)));for(const E of[...n])E.startsWith(y)&&!g.has(E)&&n.delete(E);for(const E of[...r.keys()])E.startsWith(y)&&!g.has(E)&&!e.value.some(w=>w.key===E)&&(S.some(w=>w.key===E)||r.delete(E));M&&(e.value=S)}function c(v){var m,y;(y=(m=r.get(v))==null?void 0:m.cancel)==null||y.call(m)}function u(v){var y,g;const m=r.get(v);o(v),(y=m==null?void 0:m.dismiss)==null||y.call(m),(g=m==null?void 0:m.retry)==null||g.call(m)}function d(v){var y;const m=r.get(v);o(v),(y=m==null?void 0:m.dismiss)==null||y.call(m)}function f(){t.value=[]}const p=Fe(()=>e.value.filter(v=>v.status==="running").length),_=Fe(()=>e.value.filter(v=>v.status==="error").length),h=Fe(()=>_.value>0),b=Fe(()=>{const v=e.value.filter(g=>g.status==="running");let m=0,y=0;for(const g of v){let S=null;g.totalBytes&&g.totalBytes>0?S=Math.min(1,(g.uploadedBytes??0)/g.totalBytes):g.totalCount&&g.totalCount>0?S=Math.min(1,(g.doneCount??0)/g.totalCount):g.percent!==null&&(S=Math.min(1,g.percent/100)),S!==null&&(m+=S,y+=1)}return y===0?null:Math.round(m/y*100)});return Th()&&$5(()=>{for(const v of a.values())clearTimeout(v);a.clear()}),{active:e,history:t,runningCount:p,errorCount:_,hasError:h,overallPercent:b,sync:l,cancel:c,retry:u,dismiss:d,clearHistory:f}}const VC=["data-prefers-dark","aria-label"],qC={key:1,class:"fe-tour__dim","aria-hidden":"true"},KC={class:"fe-tour__progress","aria-hidden":"true"},WC={class:"fe-tour__title"},YC={class:"fe-tour__desc"},XC={class:"fe-tour__dots","aria-hidden":"true"},ZC={class:"fe-tour__actions"},Ho=6,om=12,JC=Pt({__name:"OnboardingTour",props:{open:{type:Boolean},locale:{},root:{},theme:{}},emits:["close"],setup(e,{emit:t}){const r=e,n=t,{t:a}=br(()=>r.locale);function i(x,C){const D=x.querySelectorAll("button[title]");for(const B of Array.from(D))if(B.getAttribute("title")===C)return B;return null}const o=[{id:"nav",titleKey:"tour.step.nav.title",descKey:"tour.step.nav.desc",target:x=>x.querySelector(".fe-breadcrumb")},{id:"upload",titleKey:"tour.step.upload.title",descKey:"tour.step.upload.desc",target:x=>i(x,a("toolbar.upload"))||x.querySelector(".fe-fab")},{id:"search",titleKey:"tour.step.search.title",descKey:"tour.step.search.desc",target:x=>x.querySelector(".fe-search__input")||x.querySelector(".fe-toolbar__search-toggle")},{id:"view",titleKey:"tour.step.view.title",descKey:"tour.step.view.desc",target:x=>x.querySelector(".fe-toolbar__view")},{id:"share",titleKey:"tour.step.share.title",descKey:"tour.step.share.desc",target:x=>x.querySelector(".fe__body")},{id:"help",titleKey:"tour.step.help.title",descKey:"tour.step.help.desc",target:()=>null}],s=re([]),l=re(0),c=Fe(()=>s.value[l.value]??null),u=Fe(()=>s.value.length);function d(){const x=r.root;s.value=o.filter(C=>{if(C.id==="help")return!0;if(!x)return!1;const D=C.target(x);if(!D)return!1;const B=D.getBoundingClientRect();return B.width>0&&B.height>0})}const f=re(null),p=re({}),_=re(null);async function h(){var q;const x=c.value,C=r.root;if(!x)return;const D=C?x.target(C):null;if(!D){f.value=null,p.value={};return}const B=D.getBoundingClientRect();if(B.width<=0&&B.height<=0){f.value=null,p.value={};return}f.value={top:B.top-Ho,left:B.left-Ho,width:B.width+Ho*2,height:B.height+Ho*2},await Nr();const F=window.innerWidth,K=window.innerHeight,te=Math.min(340,F-24),J=((q=_.value)==null?void 0:q.offsetHeight)??160;let ne=B.bottom+Ho+om;ne+J>K-12&&(ne=Math.max(12,B.top-Ho-om-J));let le=B.left+B.width/2-te/2;le=Math.min(Math.max(12,le),F-te-12),p.value={top:`${Math.round(ne)}px`,left:`${Math.round(le)}px`,width:`${te}px`}}function b(){r.open&&h()}function v(){if(l.value>=u.value-1){n("close");return}l.value+=1}function m(){l.value>0&&(l.value-=1)}function y(){n("close")}function g(x){r.open&&(x.key==="Escape"?(x.stopPropagation(),y()):x.key==="ArrowRight"||x.key==="Enter"?(x.preventDefault(),v()):x.key==="ArrowLeft"&&(x.preventDefault(),m()))}At(()=>r.open,async x=>{var C;x&&(l.value=0,d(),await Nr(),await h(),(C=_.value)==null||C.focus())}),At(l,async()=>{var x;await h(),(x=_.value)==null||x.focus()}),Xt(()=>{window.addEventListener("resize",b),window.addEventListener("scroll",b,!0)}),tr(()=>{window.removeEventListener("resize",b),window.removeEventListener("scroll",b,!0)});const S=re(!1);let M;function E(x){S.value=!!(x&&"matches"in x&&x.matches)}Xt(()=>{var x;typeof window>"u"||(M=window.matchMedia("(prefers-color-scheme: dark)"),E(M),(x=M.addEventListener)==null||x.call(M,"change",E))}),tr(()=>{var x;(x=M==null?void 0:M.removeEventListener)==null||x.call(M,"change",E)});const w=Fe(()=>`fe-ctx-backdrop--theme-${r.theme||"auto"}`);return(x,C)=>(R(),Zt(l1,{to:"body"},[Dt(Za,{name:"fe-tour"},{default:ur(()=>[e.open&&c.value?(R(),$("div",{key:0,class:vt(["fe-tour",w.value]),"data-prefers-dark":S.value?"1":"0",role:"dialog","aria-modal":"true","aria-label":Y(a)("tour.aria"),onKeydown:g},[f.value?(R(),$("div",{key:0,class:"fe-tour__spot",style:Sn({top:f.value.top+"px",left:f.value.left+"px",width:f.value.width+"px",height:f.value.height+"px"}),"aria-hidden":"true"},null,4)):(R(),$("div",qC)),T("div",{ref_key:"cardEl",ref:_,class:vt(["fe-tour__card",{"fe-tour__card--center":!f.value}]),style:Sn(f.value?p.value:{}),tabindex:"-1"},[T("p",KC,V(Y(a)("tour.progress",{n:l.value+1,m:u.value})),1),T("h3",WC,V(Y(a)(c.value.titleKey)),1),T("p",YC,V(Y(a)(c.value.descKey)),1),T("div",XC,[(R(!0),$(qe,null,xt(s.value,(D,B)=>(R(),$("span",{key:D.id,class:vt(["fe-tour__dot",{"is-active":B===l.value}])},null,2))),128))]),T("div",ZC,[T("button",{type:"button",class:"fe-btn fe-tour__skip",onClick:y},V(Y(a)("tour.skip")),1),C[0]||(C[0]=T("span",{class:"fe-tour__actions-spacer"},null,-1)),l.value>0?(R(),$("button",{key:0,type:"button",class:"fe-btn",onClick:m},V(Y(a)("tour.back")),1)):Te("",!0),T("button",{type:"button",class:"fe-btn fe-btn--primary",onClick:v},V(l.value>=u.value-1?Y(a)("tour.done"):Y(a)("tour.next")),1)])],6)],42,VC)):Te("",!0)]),_:1})]))}}),QC=["aria-label"],eE={class:"fe-tabs__scroll"},tE=["aria-selected","title","onClick","onKeydown","onAuxclick","onDragstart","onDragover","onDragleave","onDrop"],rE={key:0,class:"fe-tabs__splitdot","aria-hidden":"true"},nE={class:"fe-tabs__label"},aE=["aria-label","title","onClick"],iE=["aria-label","title"],oE=["aria-label","title","aria-pressed"],sE=Pt({__name:"TabBar",props:{tabs:{},activeId:{},locale:{},splitEnabled:{type:Boolean},splitActive:{type:Boolean}},emits:["select","close","new","reorder","toggle-split"],setup(e,{emit:t}){const r=e,n=t,{t:a}=br(()=>r.locale),i=re(null),o=re(null);function s(_,h){var b;i.value=_,h.dataTransfer&&(h.dataTransfer.effectAllowed="move",h.dataTransfer.setData("text/plain",((b=r.tabs[_])==null?void 0:b.id)??""))}function l(_,h){i.value!==null&&(h.preventDefault(),h.stopPropagation(),h.dataTransfer&&(h.dataTransfer.dropEffect="move"),o.value=_)}function c(_){o.value===_&&(o.value=null)}function u(_,h){i.value!==null&&(h.preventDefault(),h.stopPropagation(),i.value!==_&&n("reorder",i.value,_),i.value=null,o.value=null)}function d(){i.value=null,o.value=null}function f(_){_.button===1&&_.preventDefault()}function p(_,h){h.button===1&&(h.preventDefault(),h.stopPropagation(),n("close",_))}return(_,h)=>(R(),$("div",{class:"fe-tabs",role:"tablist","aria-label":Y(a)("tabs.strip")},[T("div",eE,[(R(!0),$(qe,null,xt(e.tabs,(b,v)=>(R(),$("div",{key:b.id,class:vt(["fe-tabs__tab",{"is-active":b.id===e.activeId,"is-dragover":o.value===v&&i.value!==null&&i.value!==v}]),role:"tab","aria-selected":b.id===e.activeId?"true":"false",tabindex:"0",draggable:"true",title:b.label,onClick:m=>n("select",b.id),onKeydown:un(Ht(m=>n("select",b.id),["prevent"]),["enter"]),onMousedown:h[0]||(h[0]=m=>f(m)),onAuxclick:m=>p(b.id,m),onDragstart:m=>s(v,m),onDragover:m=>l(v,m),onDragleave:m=>c(v),onDrop:m=>u(v,m),onDragend:d},[b.split?(R(),$("span",rE)):Te("",!0),T("span",nE,V(b.label),1),T("button",{type:"button",class:"fe-tabs__close","aria-label":Y(a)("tabs.close"),title:Y(a)("tabs.close"),onClick:Ht(m=>n("close",b.id),["stop"])},"×",8,aE)],42,tE))),128)),T("button",{type:"button",class:"fe-tabs__new","aria-label":Y(a)("tabs.new"),title:Y(a)("tabs.new"),onClick:h[1]||(h[1]=b=>n("new"))},"+",8,iE)]),e.splitEnabled!==!1?(R(),$("button",{key:0,type:"button",class:vt(["fe-tabs__split",{"is-active":e.splitActive}]),"aria-label":e.splitActive?Y(a)("tabs.split_off"):Y(a)("tabs.split"),title:e.splitActive?Y(a)("tabs.split_off"):Y(a)("tabs.split"),"aria-pressed":e.splitActive?"true":"false",onClick:h[2]||(h[2]=b=>n("toggle-split"))},[...h[3]||(h[3]=[T("svg",{class:"fe-ficon",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true",focusable:"false"},[T("rect",{x:"3",y:"4",width:"18",height:"16",rx:"2"}),T("path",{d:"M12 4v16"})],-1)])],10,oE)):Te("",!0)],8,QC))}}),L0=".filex-e2e.json",lE="filexe2e",B0=1,cE=6e5,uE=6e5,sm=200*1024*1024,fE=8,lm="filex-e2e-verify-v1",$0=new TextEncoder().encode(lE),N0=97,Af=9,Tf=21,dE=48,Mf=69,Ma=12;class cm extends Error{constructor(t="e2e: decrypt failed"){super(t),this.name="E2eDecryptError"}}function um(e){let t="";for(let r=0;r<e.length;r++)t+=String.fromCharCode(e[r]);return btoa(t)}function fm(e){const t=atob(e),r=new Uint8Array(t.length);for(let n=0;n<t.length;n++)r[n]=t.charCodeAt(n);return r}async function dm(e,t,r){const n=await crypto.subtle.importKey("raw",new TextEncoder().encode(e),"PBKDF2",!1,["deriveKey"]);return crypto.subtle.deriveKey({name:"PBKDF2",salt:new Uint8Array(t).buffer,iterations:r,hash:"SHA-256"},n,{name:"AES-GCM",length:256},!1,["encrypt","decrypt"])}async function pE(e,t=cE){const r=Math.max(uE,t),n=crypto.getRandomValues(new Uint8Array(16)),a=await dm(e,n,r),i=crypto.getRandomValues(new Uint8Array(Ma)),o=new Uint8Array(await crypto.subtle.encrypt({name:"AES-GCM",iv:i.buffer},a,new TextEncoder().encode(lm))),s=new Uint8Array(Ma+o.length);return s.set(i,0),s.set(o,Ma),{marker:{v:B0,salt:um(n),iter:r,verify:um(s)},kek:a}}function hE(e){try{const t=JSON.parse(e);return!t||t.v!==B0||typeof t.salt!="string"||typeof t.verify!="string"||typeof t.iter!="number"||t.iter<1?null:t}catch{return null}}async function vE(e,t){const r=fm(e.salt),n=await dm(t,r,e.iter),a=fm(e.verify);if(a.length<=Ma)return null;try{const i=await crypto.subtle.decrypt({name:"AES-GCM",iv:a.slice(0,Ma).buffer},n,a.slice(Ma).buffer);return new TextDecoder().decode(i)!==lm?null:n}catch{return null}}function Df(e){const t=e instanceof Uint8Array?e:new Uint8Array(e);if(t.length<$0.length)return!1;for(let r=0;r<$0.length;r++)if(t[r]!==$0[r])return!1;return!0}async function mE(e,t){if(t.byteLength>sm)throw new Error("e2e: file exceeds the 200MB single-shot limit");const r=crypto.getRandomValues(new Uint8Array(32)),n=await crypto.subtle.importKey("raw",r.buffer,{name:"AES-GCM"},!1,["encrypt"]),a=crypto.getRandomValues(new Uint8Array(Ma)),i=crypto.getRandomValues(new Uint8Array(Ma)),o=new Uint8Array(await crypto.subtle.encrypt({name:"AES-GCM",iv:a.buffer},e,r.buffer)),s=new Uint8Array(await crypto.subtle.encrypt({name:"AES-GCM",iv:i.buffer},n,t));r.fill(0);const l=new Uint8Array(N0+s.length);return l.set($0,0),l[8]=B0,l.set(a,Af),l.set(o,Tf),l.set(i,Mf),l.set(s,N0),l.buffer}async function pm(e,t){const r=new Uint8Array(t);if(!Df(r)||r.length<N0)throw new Error("e2e: not an encrypted file");if(r[8]!==B0)throw new Error(`e2e: unsupported version ${r[8]}`);const n=r.slice(Af,Af+Ma),a=r.slice(Tf,Tf+dE),i=r.slice(Mf,Mf+Ma);let o;try{o=await crypto.subtle.decrypt({name:"AES-GCM",iv:n.buffer},e,a.buffer)}catch{throw new cm("e2e: DEK unwrap failed (wrong password?)")}const s=await crypto.subtle.importKey("raw",o,{name:"AES-GCM"},!1,["decrypt"]);try{return await crypto.subtle.decrypt({name:"AES-GCM",iv:i.buffer},s,r.slice(N0).buffer)}catch{throw new cm("e2e: content decrypt failed")}}function gE(){const e=new Map;return{get(t){return e.get(t)},set(t,r){e.set(t,r)},lock(t){e.delete(t)},has(t){return e.has(t)},clear(){e.clear()}}}function hm(e){const t=e.indexOf("://");return t===-1?e:e.slice(t+3)}function vm(e){return(e||[]).filter(t=>!(t.path.includes(".thumbs")||t.path.includes(".versions")||t.basename===".versions"||t.basename===".trash"||t.basename===".keepdir"||t.basename===L0))}function bE(e){const t=hm(e);return t==="fileman"||t===""}function yE(e){return hm(e).startsWith("fileman/.trash")}function _E(e){return{type:"dir",path:`${e}://fileman/.trash`,basename:".trash",extension:"",storage:e,visibility:"private",size:0,file_size:0,mime_type:"inode/directory",extra_metadata:{}}}function mm(e,t,r,n){return!n||yE(r)||!bE(r)?!1:(e.unshift(_E(t)),!0)}async function gm(e,t,r){try{const{entries:n}=await r.listTrash(t),a=e.find(s=>s.basename===".trash");if(!a)return;let i=0,o=0;for(const s of n){i+=s.size||0;const l=Date.parse(s.deleted_at);!Number.isNaN(l)&&l>o&&(o=l)}a.size=i,o>0&&(a.last_modified=o)}catch{}}const xE=["aria-label"],wE={class:"fe-split__crumbs"},kE=["title"],SE=["title","onClick"],CE=["aria-label","title"],EE={key:0,class:"fe-split__state",role:"status"},AE={key:1,class:"fe-split__state"},TE={key:2,class:"fe-split__state"},zf="application/x-brf-files",bm="application/x-brf-files-src",ME=Pt({__name:"SecondaryPane",props:{api:{},initialPath:{},locale:{},qualify:{type:Function},toUser:{type:Function},clamp:{type:Function},rootLabel:{},floor:{},multiRoot:{type:Boolean},virtualRows:{type:Function},active:{type:Boolean},viewMode:{},thumbSrc:{type:Function},trashVisible:{type:Boolean}},emits:["navigate","activate","close","open-tab","transfer","context","open-trash"],setup(e,{expose:t,emit:r}){const n=e,a=r,{t:i}=br(()=>n.locale),o=re(""),s=re([]),l=re(!1),c=re(""),u=re(new Set);function d(j){return j.mime_type==="inode/storage"}const f=Fe(()=>!!n.multiRoot&&!(o.value??"").replace(/^\/+|\/+$/g,""));async function p(j){const P=n.clamp(j??o.value??"");l.value=!0,c.value="";try{if(n.multiRoot&&!P){s.value=n.virtualRows?n.virtualRows():[],o.value="",u.value=new Set,a("navigate","");return}const N=await n.api.index(n.qualify(P));s.value=vm(N.files),mm(s.value,N.adapter,N.dirname,n.trashVisible!==!1)&&gm(s.value,N.adapter,n.api),o.value=n.toUser(N.dirname),u.value=new Set,a("navigate",o.value)}catch(N){c.value=N instanceof Error?N.message:String(N)}finally{l.value=!1}}p(n.initialPath??"");const _=Fe(()=>{const j=(o.value||"").replace(/^\/+|\/+$/g,""),P=j?j.split("/"):[],N=(n.floor||"").replace(/^\/+|\/+$/g,""),X=[];let Ee="";for(const Ae of P)Ee=Ee?`${Ee}/${Ae}`:Ae,!(N&&!(Ee===N||Ee.startsWith(N+"/")))&&X.push({label:Ae,target:Ee,last:!1});return X.length>0&&(X[X.length-1].last=!0),X}),h=Fe(()=>!n.floor);function b(j){a("activate"),p(j)}function v(j,P){a("activate");const N=P.ctrl||P.shift,X=new Set(N?u.value:[]);N&&X.has(j.path)?X.delete(j.path):X.add(j.path),u.value=X}function m(j,P){P.preventDefault(),P.stopPropagation(),a("activate"),u.value.has(j.path)||(u.value=new Set([j.path])),a("context",j,P)}function y(j){j.preventDefault(),j.stopPropagation(),a("activate"),u.value=new Set,a("context",null,j)}function g(j,P){w.value=!1,!(j.type!=="dir"||d(j))&&x(P)&&C(P,j.path)}function S(j){if(j.type==="dir"){if(j.basename===".trash"){a("activate"),a("open-trash");return}p(d(j)?j.path:n.toUser(j.path))}}function M(){u.value=new Set}function E(j,P){if(!P.dataTransfer)return;if(d(j)||f.value||j.basename===".trash"){P.preventDefault();return}u.value.has(j.path)||(u.value=new Set([j.path]));const N=s.value.filter(X=>u.value.has(X.path)&&!d(X)).map(X=>({path:X.path,basename:X.basename,type:X.type}));if(N.length===0){P.preventDefault();return}P.dataTransfer.setData(zf,JSON.stringify(N)),P.dataTransfer.setData(bm,n.qualify(o.value)),P.dataTransfer.setData("text/plain",N.map(X=>X.path).join(`
|
|
20
|
+
**/let uf;const sv=typeof window<"u"&&window.trustedTypes;if(sv)try{uf=sv.createPolicy("vue",{createHTML:e=>e})}catch{}const lv=uf?e=>uf.createHTML(e):e=>e,D6="http://www.w3.org/2000/svg",z6="http://www.w3.org/1998/Math/MathML",Xa=typeof document<"u"?document:null,cv=Xa&&Xa.createElement("template"),I6={insert:(e,t,r)=>{t.insertBefore(e,r||null)},remove:e=>{const t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,r,n)=>{const a=t==="svg"?Xa.createElementNS(D6,e):t==="mathml"?Xa.createElementNS(z6,e):r?Xa.createElement(e,{is:r}):Xa.createElement(e);return e==="select"&&n&&n.multiple!=null&&a.setAttribute("multiple",n.multiple),a},createText:e=>Xa.createTextNode(e),createComment:e=>Xa.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>Xa.querySelector(e),setScopeId(e,t){e.setAttribute(t,"")},insertStaticContent(e,t,r,n,a,i){const o=r?r.previousSibling:t.lastChild;if(a&&(a===i||a.nextSibling))for(;t.insertBefore(a.cloneNode(!0),r),!(a===i||!(a=a.nextSibling)););else{cv.innerHTML=lv(n==="svg"?`<svg>${e}</svg>`:n==="mathml"?`<math>${e}</math>`:e);const s=cv.content;if(n==="svg"||n==="mathml"){const l=s.firstChild;for(;l.firstChild;)s.appendChild(l.firstChild);s.removeChild(l)}t.insertBefore(s,r)}return[o?o.nextSibling:t.firstChild,r?r.previousSibling:t.lastChild]}},Ci="transition",Qs="animation",el=Symbol("_vtc"),uv={name:String,type:String,css:{type:Boolean,default:!0},duration:[String,Number,Object],enterFromClass:String,enterActiveClass:String,enterToClass:String,appearFromClass:String,appearActiveClass:String,appearToClass:String,leaveFromClass:String,leaveActiveClass:String,leaveToClass:String},O6=kr({},c1,uv),Za=(e=>(e.displayName="Transition",e.props=O6,e))((e,{slots:t})=>ov(z_,P6(e),t)),io=(e,t=[])=>{kt(e)?e.forEach(r=>r(...t)):e&&e(...t)},fv=e=>e?kt(e)?e.some(t=>t.length>1):e.length>1:!1;function P6(e){const t={};for(const B in e)B in uv||(t[B]=e[B]);if(e.css===!1)return t;const{name:r="v",type:n,duration:a,enterFromClass:i=`${r}-enter-from`,enterActiveClass:o=`${r}-enter-active`,enterToClass:s=`${r}-enter-to`,appearFromClass:l=i,appearActiveClass:c=o,appearToClass:u=s,leaveFromClass:d=`${r}-leave-from`,leaveActiveClass:f=`${r}-leave-active`,leaveToClass:p=`${r}-leave-to`}=e,_=F6(a),h=_&&_[0],b=_&&_[1],{onBeforeEnter:v,onEnter:m,onEnterCancelled:y,onLeave:g,onLeaveCancelled:S,onBeforeAppear:M=v,onAppear:E=m,onAppearCancelled:w=y}=t,x=(B,F,K,te)=>{B._enterCancelled=te,oo(B,F?u:s),oo(B,F?c:o),K&&K()},C=(B,F)=>{B._isLeaving=!1,oo(B,d),oo(B,p),oo(B,f),F&&F()},D=B=>(F,K)=>{const te=B?E:m,J=()=>x(F,B,K);io(te,[F,J]),dv(()=>{oo(F,B?l:i),Ja(F,B?u:s),fv(te)||pv(F,n,h,J)})};return kr(t,{onBeforeEnter(B){io(v,[B]),Ja(B,i),Ja(B,o)},onBeforeAppear(B){io(M,[B]),Ja(B,l),Ja(B,c)},onEnter:D(!1),onAppear:D(!0),onLeave(B,F){B._isLeaving=!0;const K=()=>C(B,F);Ja(B,d),B._enterCancelled?(Ja(B,f),mv(B)):(mv(B),Ja(B,f)),dv(()=>{B._isLeaving&&(oo(B,d),Ja(B,p),fv(g)||pv(B,n,b,K))}),io(g,[B,K])},onEnterCancelled(B){x(B,!1,void 0,!0),io(y,[B])},onAppearCancelled(B){x(B,!0,void 0,!0),io(w,[B])},onLeaveCancelled(B){C(B),io(S,[B])}})}function F6(e){if(e==null)return null;if(sr(e))return[ff(e.enter),ff(e.leave)];{const t=ff(e);return[t,t]}}function ff(e){return Mu(e)}function Ja(e,t){t.split(/\s+/).forEach(r=>r&&e.classList.add(r)),(e[el]||(e[el]=new Set)).add(t)}function oo(e,t){t.split(/\s+/).forEach(n=>n&&e.classList.remove(n));const r=e[el];r&&(r.delete(t),r.size||(e[el]=void 0))}function dv(e){requestAnimationFrame(()=>{requestAnimationFrame(e)})}let R6=0;function pv(e,t,r,n){const a=e._endId=++R6,i=()=>{a===e._endId&&n()};if(r!=null)return setTimeout(i,r);const{type:o,timeout:s,propCount:l}=L6(e,t);if(!o)return n();const c=o+"end";let u=0;const d=()=>{e.removeEventListener(c,f),i()},f=p=>{p.target===e&&++u>=l&&d()};setTimeout(()=>{u<l&&d()},s+1),e.addEventListener(c,f)}function L6(e,t){const r=window.getComputedStyle(e),n=_=>(r[_]||"").split(", "),a=n(`${Ci}Delay`),i=n(`${Ci}Duration`),o=hv(a,i),s=n(`${Qs}Delay`),l=n(`${Qs}Duration`),c=hv(s,l);let u=null,d=0,f=0;t===Ci?o>0&&(u=Ci,d=o,f=i.length):t===Qs?c>0&&(u=Qs,d=c,f=l.length):(d=Math.max(o,c),u=d>0?o>c?Ci:Qs:null,f=u?u===Ci?i.length:l.length:0);const p=u===Ci&&/\b(?:transform|all)(?:,|$)/.test(n(`${Ci}Property`).toString());return{type:u,timeout:d,propCount:f,hasTransform:p}}function hv(e,t){for(;e.length<t.length;)e=e.concat(e);return Math.max(...t.map((r,n)=>vv(r)+vv(e[n])))}function vv(e){return e==="auto"?0:Number(e.slice(0,-1).replace(",","."))*1e3}function mv(e){return(e?e.ownerDocument:document).body.offsetHeight}function B6(e,t,r){const n=e[el];n&&(t=(t?[t,...n]:[...n]).join(" ")),t==null?e.removeAttribute("class"):r?e.setAttribute("class",t):e.className=t}const M0=Symbol("_vod"),gv=Symbol("_vsh"),df={name:"show",beforeMount(e,{value:t},{transition:r}){e[M0]=e.style.display==="none"?"":e.style.display,r&&t?r.beforeEnter(e):tl(e,t)},mounted(e,{value:t},{transition:r}){r&&t&&r.enter(e)},updated(e,{value:t,oldValue:r},{transition:n}){!t!=!r&&(n?t?(n.beforeEnter(e),tl(e,!0),n.enter(e)):n.leave(e,()=>{tl(e,!1)}):tl(e,t))},beforeUnmount(e,{value:t}){tl(e,t)}};function tl(e,t){e.style.display=t?e[M0]:"none",e[gv]=!t}const $6=Symbol(""),N6=/(?:^|;)\s*display\s*:/;function U6(e,t,r){const n=e.style,a=vr(r);let i=!1;if(r&&!a){if(t)if(vr(t))for(const o of t.split(";")){const s=o.slice(0,o.indexOf(":")).trim();r[s]==null&&rl(n,s,"")}else for(const o in t)r[o]==null&&rl(n,o,"");for(const o in r){o==="display"&&(i=!0);const s=r[o];s!=null?j6(e,o,!vr(t)&&t?t[o]:void 0,s)||rl(n,o,s):rl(n,o,"")}}else if(a){if(t!==r){const o=n[$6];o&&(r+=";"+o),n.cssText=r,i=N6.test(r)}}else t&&e.removeAttribute("style");M0 in e&&(e[M0]=i?n.display:"",e[gv]&&(n.display="none"))}const bv=/\s*!important$/;function rl(e,t,r){if(kt(r))r.forEach(n=>rl(e,t,n));else if(r==null&&(r=""),t.startsWith("--"))e.setProperty(t,r);else{const n=H6(e,t);bv.test(r)?e.setProperty(kn(n),r.replace(bv,""),"important"):e[n]=r}}const yv=["Webkit","Moz","ms"],pf={};function H6(e,t){const r=pf[t];if(r)return r;let n=jr(t);if(n!=="filter"&&n in e)return pf[t]=n;n=t0(n);for(let a=0;a<yv.length;a++){const i=yv[a]+n;if(i in e)return pf[t]=i}return t}function j6(e,t,r,n){return e.tagName==="TEXTAREA"&&(t==="width"||t==="height")&&vr(n)&&r===n}const _v="http://www.w3.org/1999/xlink";function xv(e,t,r,n,a,i=R5(t)){n&&t.startsWith("xlink:")?r==null?e.removeAttributeNS(_v,t.slice(6,t.length)):e.setAttributeNS(_v,t,r):r==null||i&&!Ch(r)?e.removeAttribute(t):e.setAttribute(t,i?"":ta(r)?String(r):r)}function wv(e,t,r,n,a){if(t==="innerHTML"||t==="textContent"){r!=null&&(e[t]=t==="innerHTML"?lv(r):r);return}const i=e.tagName;if(t==="value"&&i!=="PROGRESS"&&!i.includes("-")){const s=i==="OPTION"?e.getAttribute("value")||"":e.value,l=r==null?e.type==="checkbox"?"on":"":String(r);(s!==l||!("_value"in e))&&(e.value=l),r==null&&e.removeAttribute(t),e._value=r;return}let o=!1;if(r===""||r==null){const s=typeof e[t];s==="boolean"?r=Ch(r):r==null&&s==="string"?(r="",o=!0):s==="number"&&(r=0,o=!0)}try{e[t]=r}catch{}o&&e.removeAttribute(a||t)}function Ei(e,t,r,n){e.addEventListener(t,r,n)}function G6(e,t,r,n){e.removeEventListener(t,r,n)}const kv=Symbol("_vei");function V6(e,t,r,n,a=null){const i=e[kv]||(e[kv]={}),o=i[t];if(n&&o)o.value=n;else{const[s,l]=q6(t);if(n){const c=i[t]=Y6(n,a);Ei(e,s,c,l)}else o&&(G6(e,s,o,l),i[t]=void 0)}}const Sv=/(?:Once|Passive|Capture)$/;function q6(e){let t;if(Sv.test(e)){t={};let n;for(;n=e.match(Sv);)e=e.slice(0,e.length-n[0].length),t[n[0].toLowerCase()]=!0}return[e[2]===":"?e.slice(3):kn(e.slice(2)),t]}let hf=0;const K6=Promise.resolve(),W6=()=>hf||(K6.then(()=>hf=0),hf=Date.now());function Y6(e,t){const r=n=>{if(!n._vts)n._vts=Date.now();else if(n._vts<=r.attached)return;aa(X6(n,r.value),t,5,[n])};return r.value=e,r.attached=W6(),r}function X6(e,t){if(kt(t)){const r=e.stopImmediatePropagation;return e.stopImmediatePropagation=()=>{r.call(e),e._stopped=!0},t.map(n=>a=>!a._stopped&&n&&n(a))}else return t}const Cv=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123,Z6=(e,t,r,n,a,i)=>{const o=a==="svg";t==="class"?B6(e,n,o):t==="style"?U6(e,r,n):Zl(t)?Jl(t)||V6(e,t,r,n,i):(t[0]==="."?(t=t.slice(1),!0):t[0]==="^"?(t=t.slice(1),!1):J6(e,t,n,o))?(wv(e,t,n),!e.tagName.includes("-")&&(t==="value"||t==="checked"||t==="selected")&&xv(e,t,n,o,i,t!=="value")):e._isVueCE&&(Q6(e,t)||e._def.__asyncLoader&&(/[A-Z]/.test(t)||!vr(n)))?wv(e,jr(t),n,i,t):(t==="true-value"?e._trueValue=n:t==="false-value"&&(e._falseValue=n),xv(e,t,n,o))};function J6(e,t,r,n){if(n)return!!(t==="innerHTML"||t==="textContent"||t in e&&Cv(t)&&Mt(r));if(t==="spellcheck"||t==="draggable"||t==="translate"||t==="autocorrect"||t==="sandbox"&&e.tagName==="IFRAME"||t==="form"||t==="list"&&e.tagName==="INPUT"||t==="type"&&e.tagName==="TEXTAREA")return!1;if(t==="width"||t==="height"){const a=e.tagName;if(a==="IMG"||a==="VIDEO"||a==="CANVAS"||a==="SOURCE")return!1}return Cv(t)&&vr(r)?!1:t in e}function Q6(e,t){const r=e._def.props;if(!r)return!1;const n=jr(t);return Array.isArray(r)?r.some(a=>jr(a)===n):Object.keys(r).some(a=>jr(a)===n)}const Ev={};function ex(e,t,r){let n=Pt(e,t);Ql(n)&&(n=kr({},n,t));class a extends vf{constructor(o){super(n,o,r)}}return a.def=n,a}const tx=typeof HTMLElement<"u"?HTMLElement:class{};class vf extends tx{constructor(t,r={},n=Pv){super(),this._def=t,this._props=r,this._createApp=n,this._isVueCE=!0,this._instance=null,this._app=null,this._nonce=this._def.nonce,this._connected=!1,this._resolved=!1,this._patching=!1,this._dirty=!1,this._numberProps=null,this._styleChildren=new WeakSet,this._styleAnchors=new WeakMap,this._ob=null,this.shadowRoot&&n!==Pv?this._root=this.shadowRoot:t.shadowRoot!==!1?(this.attachShadow(kr({},t.shadowRootOptions,{mode:"open"})),this._root=this.shadowRoot):this._root=this}connectedCallback(){if(!this.isConnected)return;!this.shadowRoot&&!this._resolved&&this._parseSlots(),this._connected=!0;let t=this;for(;t=t&&(t.assignedSlot||t.parentNode||t.host);)if(t instanceof vf){this._parent=t;break}this._instance||(this._resolved?this._mount(this._def):t&&t._pendingResolve?this._pendingResolve=t._pendingResolve.then(()=>{this._pendingResolve=void 0,this._resolveDef()}):this._resolveDef())}_setParent(t=this._parent){t&&(this._instance.parent=t._instance,this._inheritParentContext(t))}_inheritParentContext(t=this._parent){t&&this._app&&Object.setPrototypeOf(this._app._context.provides,t._instance.provides)}disconnectedCallback(){this._connected=!1,Nr(()=>{this._connected||(this._ob&&(this._ob.disconnect(),this._ob=null),this._app&&this._app.unmount(),this._instance&&(this._instance.ce=void 0),this._app=this._instance=null,this._teleportTargets&&(this._teleportTargets.clear(),this._teleportTargets=void 0))})}_processMutations(t){for(const r of t)this._setAttr(r.attributeName)}_resolveDef(){if(this._pendingResolve)return;for(let n=0;n<this.attributes.length;n++)this._setAttr(this.attributes[n].name);this._ob=new MutationObserver(this._processMutations.bind(this)),this._ob.observe(this,{attributes:!0});const t=(n,a=!1)=>{this._resolved=!0,this._pendingResolve=void 0;const{props:i,styles:o}=n;let s;if(i&&!kt(i))for(const l in i){const c=i[l];(c===Number||c&&c.type===Number)&&(l in this._props&&(this._props[l]=Mu(this._props[l])),(s||(s=Object.create(null)))[jr(l)]=!0)}this._numberProps=s,this._resolveProps(n),this.shadowRoot&&this._applyStyles(o),this._mount(n)},r=this._def.__asyncLoader;r?this._pendingResolve=r().then(n=>{n.configureApp=this._def.configureApp,t(this._def=n,!0)}):t(this._def)}_mount(t){this._app=this._createApp(t),this._inheritParentContext(),t.configureApp&&t.configureApp(this._app),this._app._ceVNode=this._createVNode(),this._app.mount(this._root);const r=this._instance&&this._instance.exposed;if(r)for(const n in r)er(this,n)||Object.defineProperty(this,n,{get:()=>Y(r[n])})}_resolveProps(t){const{props:r}=t,n=kt(r)?r:Object.keys(r||{});for(const a of Object.keys(this))a[0]!=="_"&&n.includes(a)&&this._setProp(a,this[a]);for(const a of n.map(jr))Object.defineProperty(this,a,{get(){return this._getProp(a)},set(i){this._setProp(a,i,!0,!this._patching)}})}_setAttr(t){if(t.startsWith("data-v-"))return;const r=this.hasAttribute(t);let n=r?this.getAttribute(t):Ev;const a=jr(t);r&&this._numberProps&&this._numberProps[a]&&(n=Mu(n)),this._setProp(a,n,!1,!0)}_getProp(t){return this._props[t]}_setProp(t,r,n=!0,a=!1){if(r!==this._props[t]&&(this._dirty=!0,r===Ev?delete this._props[t]:(this._props[t]=r,t==="key"&&this._app&&(this._app._ceVNode.key=r)),a&&this._instance&&this._update(),n)){const i=this._ob;i&&(this._processMutations(i.takeRecords()),i.disconnect()),r===!0?this.setAttribute(kn(t),""):typeof r=="string"||typeof r=="number"?this.setAttribute(kn(t),r+""):r||this.removeAttribute(kn(t)),i&&i.observe(this,{attributes:!0})}}_update(){const t=this._createVNode();this._app&&(t.appContext=this._app._context),sx(t,this._root)}_createVNode(){const t={};this.shadowRoot||(t.onVnodeMounted=t.onVnodeUpdated=this._renderSlots.bind(this));const r=Dt(this._def,kr(t,this._props));return this._instance||(r.ce=n=>{this._instance=n,n.ce=this,n.isCE=!0;const a=(i,o)=>{this.dispatchEvent(new CustomEvent(i,Ql(o[0])?kr({detail:o},o[0]):{detail:o}))};n.emit=(i,...o)=>{a(i,o),kn(i)!==i&&a(kn(i),o)},this._setParent()}),r}_applyStyles(t,r,n){if(!t)return;if(r){if(r===this._def||this._styleChildren.has(r))return;this._styleChildren.add(r)}const a=this._nonce,i=this.shadowRoot,o=n?this._getStyleAnchor(n)||this._getStyleAnchor(this._def):this._getRootStyleInsertionAnchor(i);let s=null;for(let l=t.length-1;l>=0;l--){const c=document.createElement("style");a&&c.setAttribute("nonce",a),c.textContent=t[l],i.insertBefore(c,s||o),s=c,l===0&&(n||this._styleAnchors.set(this._def,c),r&&this._styleAnchors.set(r,c))}}_getStyleAnchor(t){if(!t)return null;const r=this._styleAnchors.get(t);return r&&r.parentNode===this.shadowRoot?r:(r&&this._styleAnchors.delete(t),null)}_getRootStyleInsertionAnchor(t){for(let r=0;r<t.childNodes.length;r++){const n=t.childNodes[r];if(!(n instanceof HTMLStyleElement))return n}return null}_parseSlots(){const t=this._slots={};let r;for(;r=this.firstChild;){const n=r.nodeType===1&&r.getAttribute("slot")||"default";(t[n]||(t[n]=[])).push(r),this.removeChild(r)}}_renderSlots(){const t=this._getSlots(),r=this._instance.type.__scopeId;for(let n=0;n<t.length;n++){const a=t[n],i=a.getAttribute("name")||"default",o=this._slots[i],s=a.parentNode;if(o)for(const l of o){if(r&&l.nodeType===1){const c=r+"-s",u=document.createTreeWalker(l,1);l.setAttribute(c,"");let d;for(;d=u.nextNode();)d.setAttribute(c,"")}s.insertBefore(l,a)}else for(;a.firstChild;)s.insertBefore(a.firstChild,a);s.removeChild(a)}}_getSlots(){const t=[this];this._teleportTargets&&t.push(...this._teleportTargets);const r=new Set;for(const n of t){const a=n.querySelectorAll("slot");for(let i=0;i<a.length;i++)r.add(a[i])}return Array.from(r)}_injectChildStyle(t,r){this._applyStyles(t.styles,t,r)}_beginPatch(){this._patching=!0,this._dirty=!1}_endPatch(){this._patching=!1,this._dirty&&this._instance&&this._update()}_hasShadowRoot(){return this._def.shadowRoot!==!1}_removeChildStyle(t){}}const $o=e=>{const t=e.props["onUpdate:modelValue"]||!1;return kt(t)?r=>r0(t,r):t};function rx(e){e.target.composing=!0}function Av(e){const t=e.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event("input")))}const Qa=Symbol("_assign");function Tv(e,t,r){return t&&(e=e.trim()),r&&(e=n0(e)),e}const Ir={created(e,{modifiers:{lazy:t,trim:r,number:n}},a){e[Qa]=$o(a);const i=n||a.props&&a.props.type==="number";Ei(e,t?"change":"input",o=>{o.target.composing||e[Qa](Tv(e.value,r,i))}),(r||i)&&Ei(e,"change",()=>{e.value=Tv(e.value,r,i)}),t||(Ei(e,"compositionstart",rx),Ei(e,"compositionend",Av),Ei(e,"change",Av))},mounted(e,{value:t}){e.value=t??""},beforeUpdate(e,{value:t,oldValue:r,modifiers:{lazy:n,trim:a,number:i}},o){if(e[Qa]=$o(o),e.composing)return;const s=(i||e.type==="number")&&!/^0\d/.test(e.value)?n0(e.value):e.value,l=t??"";if(s===l)return;const c=e.getRootNode();(c instanceof Document||c instanceof ShadowRoot)&&c.activeElement===e&&e.type!=="range"&&(n&&t===r||a&&e.value.trim()===l)||(e.value=l)}},No={deep:!0,created(e,t,r){e[Qa]=$o(r),Ei(e,"change",()=>{const n=e._modelValue,a=nl(e),i=e.checked,o=e[Qa];if(kt(n)){const s=Du(n,a),l=s!==-1;if(i&&!l)o(n.concat(a));else if(!i&&l){const c=[...n];c.splice(s,1),o(c)}}else if(Do(n)){const s=new Set(n);i?s.add(a):s.delete(a),o(s)}else o(zv(e,i))})},mounted:Mv,beforeUpdate(e,t,r){e[Qa]=$o(r),Mv(e,t,r)}};function Mv(e,{value:t,oldValue:r},n){e._modelValue=t;let a;if(kt(t))a=Du(t,n.props.value)>-1;else if(Do(t))a=t.has(n.props.value);else{if(t===r)return;a=zo(t,zv(e,!0))}e.checked!==a&&(e.checked=a)}const D0={deep:!0,created(e,{value:t,modifiers:{number:r}},n){const a=Do(t);Ei(e,"change",()=>{const i=Array.prototype.filter.call(e.options,o=>o.selected).map(o=>r?n0(nl(o)):nl(o));e[Qa](e.multiple?a?new Set(i):i:i[0]),e._assigning=!0,Nr(()=>{e._assigning=!1})}),e[Qa]=$o(n)},mounted(e,{value:t}){Dv(e,t)},beforeUpdate(e,t,r){e[Qa]=$o(r)},updated(e,{value:t}){e._assigning||Dv(e,t)}};function Dv(e,t){const r=e.multiple,n=kt(t);if(!(r&&!n&&!Do(t))){for(let a=0,i=e.options.length;a<i;a++){const o=e.options[a],s=nl(o);if(r)if(n){const l=typeof s;l==="string"||l==="number"?o.selected=t.some(c=>String(c)===String(s)):o.selected=Du(t,s)>-1}else o.selected=t.has(s);else if(zo(nl(o),t)){e.selectedIndex!==a&&(e.selectedIndex=a);return}}!r&&e.selectedIndex!==-1&&(e.selectedIndex=-1)}}function nl(e){return"_value"in e?e._value:e.value}function zv(e,t){const r=t?"_trueValue":"_falseValue";return r in e?e[r]:t}const nx=["ctrl","shift","alt","meta"],ax={stop:e=>e.stopPropagation(),prevent:e=>e.preventDefault(),self:e=>e.target!==e.currentTarget,ctrl:e=>!e.ctrlKey,shift:e=>!e.shiftKey,alt:e=>!e.altKey,meta:e=>!e.metaKey,left:e=>"button"in e&&e.button!==0,middle:e=>"button"in e&&e.button!==1,right:e=>"button"in e&&e.button!==2,exact:(e,t)=>nx.some(r=>e[`${r}Key`]&&!t.includes(r))},Ht=(e,t)=>{if(!e)return e;const r=e._withMods||(e._withMods={}),n=t.join(".");return r[n]||(r[n]=(a,...i)=>{for(let o=0;o<t.length;o++){const s=ax[t[o]];if(s&&s(a,t))return}return e(a,...i)})},ix={esc:"escape",space:" ",up:"arrow-up",left:"arrow-left",right:"arrow-right",down:"arrow-down",delete:"backspace"},un=(e,t)=>{const r=e._withKeys||(e._withKeys={}),n=t.join(".");return r[n]||(r[n]=a=>{if(!("key"in a))return;const i=kn(a.key);if(t.some(o=>o===i||ix[o]===i))return e(a)})},ox=kr({patchProp:Z6},I6);let Iv;function Ov(){return Iv||(Iv=f6(ox))}const sx=(...e)=>{Ov().render(...e)},Pv=(...e)=>{const t=Ov().createApp(...e),{mount:r}=t;return t.mount=n=>{const a=cx(n);if(!a)return;const i=t._component;!Mt(i)&&!i.render&&!i.template&&(i.template=a.innerHTML),a.nodeType===1&&(a.textContent="");const o=r(a,!1,lx(a));return a instanceof Element&&(a.removeAttribute("v-cloak"),a.setAttribute("data-v-app","")),o},t};function lx(e){if(e instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&e instanceof MathMLElement)return"mathml"}function cx(e){return vr(e)?document.querySelector(e):e}function Fv(e){return!!e&&e.enabled&&e.state==="ok"}function ux(e){const t=e.apiBase!=null?e.apiBase.replace(/\/+$/,""):null;function r(a,i){return a||(t===null?null:`${t}${i}`)}const n=e.endpoint??(t!==null?`${t}/api/files/manager`:null);if(!n)throw new Error("[@brftech/filex-core] config requires either `apiBase` or `endpoint`");return{manager:n,uploadInit:r(e.uploadInit,"/api/files/upload/init"),uploadFinalize:r(e.uploadFinalize,"/api/files/upload/finalize"),uploadAbort:r(e.uploadAbort,"/api/files/upload/abort"),shareCreate:r(e.shareCreate,"/api/files/share"),shareList:r(e.shareList,"/api/files/share"),shareDelete:r(e.shareDelete,"/api/files/share/{uuid}"),limits:r(e.limits,"/api/files/limits"),capabilities:r(e.capabilities,"/api/files/capabilities"),archiveList:r(e.archiveList,"/api/files/archive/list"),archiveExtract:r(e.archiveExtract,"/api/files/archive/extract"),archiveAdd:r(e.archiveAdd,"/api/files/archive/add"),copy:r(e.copy,"/api/files/copy"),moveAsync:r(e.moveAsync,"/api/files/move"),deleteAsync:r(e.deleteAsync,"/api/files/delete"),opsList:r(e.opsList,"/api/files/ops"),opsShow:r(e.opsShow,"/api/files/ops/{id}"),onlyOfficeConfig:r(e.onlyOfficeConfig,"/api/files/onlyoffice/config"),saveText:r(e.saveText,"/api/files/save-text"),restore:r(e.restore,"/api/files/restore"),trashList:r(e.trashList,"/api/files/manager/trash"),trashRestore:r(e.trashRestore,"/api/files/manager/restore")}}async function fx(e){if(typeof e=="function"){const t=e();return t instanceof Promise?await t:t}return e}function dx(e){return e?"kind"in e?e:e.type==="bearer"?{kind:"bearer",token:e.token}:e.type==="csrf"?{kind:"csrf",csrf:e.csrf}:{kind:"none"}:{kind:"none"}}function px(e){const t=ux(e),r=dx(e.auth);async function n(ee={}){const pe={Accept:"application/json",...ee};if(r.kind==="bearer"){const ve=await fx(r.token);ve&&(pe.Authorization=`Bearer ${ve}`)}else if(r.kind==="csrf")pe["X-CSRF-TOKEN"]=r.csrf,pe["X-Requested-With"]="XMLHttpRequest";else if(r.kind==="basic"){const ve=btoa(`${r.user}:${r.pass}`);pe.Authorization=`Basic ${ve}`}return pe}function a(ee={}){const pe={Accept:"application/json",...ee};if(r.kind==="bearer"&&typeof r.token=="string")pe.Authorization=`Bearer ${r.token}`;else if(r.kind==="csrf")pe["X-CSRF-TOKEN"]=r.csrf,pe["X-Requested-With"]="XMLHttpRequest";else if(r.kind==="basic"){const ve=btoa(`${r.user}:${r.pass}`);pe.Authorization=`Basic ${ve}`}return pe}function i(){return r.kind==="csrf"?"include":"same-origin"}function o(ee){const pe=(e.locale??"tr")!=="en",Pe={400:["Geçersiz istek","Bad request"],401:["Oturum gerekli, tekrar giriş yapın","Sign-in required"],403:["Bu işlem için yetkiniz yok","You are not allowed to do this"],404:["Bulunamadı","Not found"],409:["Zaten var / çakışma","Already exists / conflict"],413:["Dosya çok büyük","File too large"],415:["Bu dosya türü desteklenmiyor","Unsupported file type"],422:["Geçersiz veri","Invalid data"],429:["Çok fazla istek, biraz bekleyin","Too many requests"],500:["Sunucu hatası","Server error"],501:["Bu işlem desteklenmiyor","Not supported"],503:["Servis şu an kullanılamıyor","Service unavailable"]}[ee];return Pe?pe?Pe[0]:Pe[1]:pe?`Hata (${ee})`:`Error (${ee})`}async function s(ee,pe={}){const ve={...await n(),...pe.headers??{}},Pe=await fetch(ee,{...pe,headers:ve,credentials:i()});if(!Pe.ok){const Ge=await Pe.text().catch(()=>""),Ue=new Error(o(Pe.status));throw Ue.status=Pe.status,Ue.detail=Ge.slice(0,300),Ue}return Pe.json()}function l(ee=""){return t.manager.replace(/\/manager(\?.*)?$/,"/permissions")+ee}async function c(ee){return s(l()+"?path="+encodeURIComponent(ee))}async function u(ee){return s(l("/resolve")+"?email="+encodeURIComponent(ee))}async function d(ee){return s(l("/users")+"?q="+encodeURIComponent(ee))}async function f(ee){return s(l(),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(ee)})}async function p(ee,pe){return s(l("/"+ee),{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({level:pe})})}async function _(ee){return s(l("/"+ee),{method:"DELETE"})}async function h(ee){return s(l("/invite"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(ee)})}async function b(ee){return s(l("/share-mail"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(ee)})}function v(ee){const pe=new URLSearchParams;for(const[ve,Pe]of Object.entries(ee))Pe!=null&&pe.set(ve,String(Pe));return pe.toString()}function m(ee,pe={}){const ve=t.manager.includes("?")?"&":"?";return`${t.manager}${ve}${v({q:ee,action:ee,...pe})}`}async function y(ee){return s(m("index",{path:ee}))}async function g(ee,pe){return s(m("search",{path:ee,filter:pe}))}async function S(ee,pe={}){const ve=t.manager.replace(/\/manager(\?.*)?$/,"/search"),Pe=ve.includes("?")?"&":"?",Ge=`${ve}${Pe}${v({q:ee,limit:pe.limit,scope:pe.scope})}`,Ue=await s(Ge);return Array.isArray(Ue==null?void 0:Ue.results)?Ue.results:[]}async function M(ee){return s(m("subfolders",{path:ee}))}async function E(ee,pe){return s(m("newfolder"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:ee,name:pe})})}async function w(ee,pe,ve){return s(m("rename"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:ee,item:pe,name:ve})})}async function x(ee,pe,ve){return s(m("move"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:ee,item:ve,items:pe.map(Pe=>({path:Pe}))})})}async function C(ee,pe){return s(m("delete"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:ee,items:pe.map(ve=>({path:ve}))})})}async function D(ee,pe){if(!t.copy)throw new Error("copy endpoint not configured");return s(t.copy,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({source:ee,target:pe})})}async function B(ee,pe,ve){if(!t.moveAsync)throw new Error("moveAsync endpoint not configured");return s(t.moveAsync,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({source:ee,target:pe,sourceDir:ve})})}async function F(ee,pe){if(!t.deleteAsync)throw new Error("deleteAsync endpoint not configured");return s(t.deleteAsync,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({source:ee,sourceDir:pe})})}async function K(ee){if(!t.restore)throw new Error("restore endpoint not configured");return s(t.restore,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({source:ee})})}async function te(ee){if(!t.trashList)throw new Error("trashList endpoint not configured");const pe=t.trashList,ve=pe.includes("?")?"&":"?",Pe=ee?`${pe}${ve}storage=${encodeURIComponent(ee)}`:pe;return s(Pe)}async function J(ee){const pe=t.trashRestore;if(!pe)throw new Error("trashRestore endpoint not configured");let ve=0;for(const Pe of ee)try{await s(pe,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({node_id:Pe})}),ve++}catch{}return{restored:ve}}async function ne(ee,pe,ve){const Pe=new FormData;Pe.append("path",ee);for(const Ue of pe)Pe.append("file[]",Ue,Ue.name);const Ge=await n();return new Promise((Ue,We)=>{const rt=new XMLHttpRequest;rt.open("POST",m("upload"));for(const[lt,ft]of Object.entries(Ge))lt!=="Content-Type"&&rt.setRequestHeader(lt,ft);rt.withCredentials=i()==="include",rt.upload.onprogress=lt=>{ve&<.lengthComputable&&ve(Math.round(lt.loaded/lt.total*100))},rt.onload=()=>{if(rt.status>=200&&rt.status<300)try{Ue(JSON.parse(rt.responseText))}catch(lt){We(lt)}else We(new Error(`${rt.status} ${rt.statusText}: ${rt.responseText.slice(0,200)}`))},rt.onerror=()=>We(new Error("Network error")),rt.send(Pe)})}function le(ee){return m("download",{path:ee})}function q(ee){return m("preview",{path:ee})}async function j(ee){const pe=await n(),ve=await fetch(q(ee),{headers:pe,credentials:i()});if(!ve.ok){const We=await ve.text().catch(()=>"");throw new Error(`${ve.status} ${ve.statusText}${We?" — "+We.slice(0,200):""}`)}const Pe=await ve.blob(),Ge=Pe.type||ve.headers.get("content-type")||"";return{url:URL.createObjectURL(Pe),blob:Pe,mime:Ge}}async function P(ee){const pe=await n(),ve=await fetch(q(ee),{headers:pe,credentials:i()});if(!ve.ok){const Pe=await ve.text().catch(()=>"");throw new Error(`${ve.status} ${ve.statusText}${Pe?" — "+Pe.slice(0,200):""}`)}return ve.arrayBuffer()}async function N(){return t.limits?s(t.limits):{max_upload_mb:1024}}async function X(){return t.capabilities?s(t.capabilities):{ffmpeg:!1,ghostscript:!1,libreoffice:!1,max_chunk_mb:5,upload_limit_mb:1024,onlyoffice_url:e.onlyOfficeBase??null,drawio_url:e.drawioBase??null,convert_url:e.convertBase??null}}async function Ee(ee){if(!t.shareCreate)throw new Error("shareCreate endpoint not configured");return s(t.shareCreate,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(ee)})}async function Ae(ee){if(!t.shareList)return{shares:[]};const pe=t.shareList.includes("?")?"&":"?";return s(`${t.shareList}${pe}path=${encodeURIComponent(ee)}`)}async function ze(ee){if(!t.shareDelete)throw new Error("shareDelete endpoint not configured");const pe=t.shareDelete.replace("{uuid}",encodeURIComponent(ee));return s(pe,{method:"DELETE"})}async function Le(ee){if(!t.archiveList)throw new Error("archiveList endpoint not configured");return{entries:(await s(t.archiveList,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:ee})})).entries.map(ve=>({name:ve.name,size:ve.size,isDir:ve.is_dir,lastModified:ve.mtime}))}}async function he(ee,pe){if(!t.archiveExtract)throw new Error("archiveExtract endpoint not configured");return s(t.archiveExtract,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:ee,members:pe})})}async function Ie(ee,pe){if(!t.archiveAdd)throw new Error("archiveAdd endpoint not configured");return s(t.archiveAdd,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:ee,files:pe})})}function De(ee=""){return t.manager.replace(/\/manager(\?.*)?$/,"/versions")+ee}async function Be(ee){const pe=await s(De()+"?node_id="+encodeURIComponent(String(ee)));return Array.isArray(pe==null?void 0:pe.versions)?pe.versions:[]}async function Z(ee,pe,ve=!0){await s(De("/restore"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({node_id:ee,version_id:pe,snapshot_current:ve})})}async function se(ee){await s(De("/snapshot"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({node_id:ee})})}function we(ee=""){return t.manager.replace(/\/manager(\?.*)?$/,"/comments")+ee}async function Se(ee){const pe=await s(we()+"?node_id="+encodeURIComponent(String(ee)));return Array.isArray(pe==null?void 0:pe.comments)?pe.comments:[]}async function me(ee,pe){return(await s(we(),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({node_id:ee,body:pe})})).comment}async function ye(ee){await s(we("/"+encodeURIComponent(String(ee))),{method:"DELETE"})}async function xe(){const ee=t.manager.replace(/\/manager(\?.*)?$/,"/ws-ticket");try{return await s(ee,{method:"POST"})}catch{return null}}return{wsTicket:xe,index:y,search:g,globalSearch:S,subfolders:M,newFolder:E,rename:w,move:x,copy:D,moveAsync:B,deleteAsync:F,deleteItems:C,restore:K,listTrash:te,restoreIds:J,uploadMultipart:ne,downloadUrl:le,previewUrl:q,fetchBlob:j,fetchArrayBuffer:P,limits:N,capabilities:X,createShare:Ee,listShares:Ae,revokeShare:ze,archiveList:Le,archiveExtract:he,archiveAdd:Ie,listVersions:Be,restoreVersion:Z,snapshotVersion:se,listComments:Se,addComment:me,deleteComment:ye,listPermissions:c,resolveEmail:u,searchUsers:d,addPermission:f,updatePermission:p,deletePermission:_,invitePermission:h,shareMail:b,endpoints:t,authHeaders:n,authHeadersSync:a,credentialsMode:i,jsonFetch:s}}function hx(e,t){const r=e.chunkSize??5242880,n=Math.max(1,Math.min(8,e.parallelChunks??4));async function a(i){var f,p;const o=i.chunkSize??r,s=i.parallelChunks??n,l={id:crypto.randomUUID(),file:i.file,path:i.path,totalBytes:i.file.size,uploadedBytes:0,percent:0,status:"initializing",cancel:()=>{}};let c=!1;const u=[];l.cancel=()=>{c=!0;for(const _ of u)_.abort()};function d(){var _;l.percent=l.totalBytes>0?Math.min(100,Math.round(l.uploadedBytes/l.totalBytes*100)):0,(_=i.onProgress)==null||_.call(i,l)}try{if(!t.endpoints.uploadInit)throw new Error("uploadInit not configured");const _=await t.jsonFetch(t.endpoints.uploadInit,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:i.path,filename:i.file.name,size:i.file.size,mime:i.file.type||"application/octet-stream"})});l.uploadId=_.uploadId,l.status="uploading",d();const h=_.chunkBytes??o,b=new Map,v=[];let m=0;async function y(x){const D=(x.partNumber-1)*(_.chunkBytes??o),B=Math.min(D+(_.chunkBytes??o),i.file.size),F=i.file.slice(D,B),K=new AbortController;u.push(K),await new Promise((te,J)=>{const ne=new XMLHttpRequest;ne.open("PUT",x.presignedUrl),ne.upload.onprogress=le=>{if(le.lengthComputable){const q=b.get(x.partNumber)??0,j=le.loaded-q;b.set(x.partNumber,le.loaded),l.uploadedBytes+=j,d()}},ne.onload=()=>{if(ne.status>=200&&ne.status<300){const le=(ne.getResponseHeader("ETag")||ne.getResponseHeader("etag")||"").trim();if(!le){J(new Error("Missing ETag on S3 response"));return}const q=B-D,j=b.get(x.partNumber)??0;j<q&&(l.uploadedBytes+=q-j,b.set(x.partNumber,q)),v.push({partNumber:x.partNumber,etag:le}),te()}else J(new Error(`S3 PUT ${x.partNumber} → ${ne.status}: ${ne.responseText.slice(0,200)}`))},ne.onerror=()=>J(new Error(`S3 PUT ${x.partNumber} network error`)),ne.onabort=()=>J(new DOMException("Aborted","AbortError")),K.signal.addEventListener("abort",()=>ne.abort()),ne.send(F)})}const g=2;async function S(x,C=0){try{await y(x)}catch(D){if(c)throw D;const B=D instanceof Error?D:new Error(String(D));if(B.name==="AbortError"||C>=g)throw B;const F=b.get(x.partNumber)??0;F>0&&(l.uploadedBytes=Math.max(0,l.uploadedBytes-F),b.delete(x.partNumber),d());const K=500*(C+1)+Math.floor(Math.random()*250);return await new Promise(te=>setTimeout(te,K)),S(x,C+1)}}async function M(){for(;!c&&m<_.parts.length;){const x=_.parts[m++];await S(x)}}const E=[];for(let x=0;x<s;x++)E.push(M());if(await Promise.all(E),c)throw new DOMException("Aborted by user","AbortError");if(!t.endpoints.uploadFinalize)throw new Error("uploadFinalize not configured");l.status="finalizing",v.sort((x,C)=>x.partNumber-C.partNumber);const w=await t.jsonFetch(t.endpoints.uploadFinalize,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({uploadId:_.uploadId,parts:v})});return l.status="done",l.uploadedBytes=l.totalBytes,l.percent=100,d(),(f=i.onDone)==null||f.call(i,l,w),w}catch(_){const h=_ instanceof Error?_:new Error(String(_));if(l.status=h.name==="AbortError"?"aborted":"error",l.error=h.message,d(),l.uploadId&&t.endpoints.uploadAbort&&l.status==="aborted")try{await t.jsonFetch(t.endpoints.uploadAbort,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({uploadId:l.uploadId})})}catch{}throw(p=i.onError)==null||p.call(i,l,h),h}}return{uploadFile:a}}function vx(e){const t=re(new Set),r=re(null);function n(f,p={}){if(p.shift&&r.value){const _=e(),h=_.findIndex(g=>g.path===r.value),b=_.findIndex(g=>g.path===f);if(h===-1||b===-1){t.value=new Set([f]),r.value=f;return}const[v,m]=h<b?[h,b]:[b,h],y=new Set;for(let g=v;g<=m;g++)y.add(_[g].path);t.value=y;return}if(p.ctrl){const _=new Set(t.value);_.has(f)?_.delete(f):_.add(f),t.value=_,r.value=f;return}t.value=new Set([f]),r.value=f}function a(){t.value=new Set,r.value=null}function i(){t.value=new Set(e().map(f=>f.path))}function o(f){return t.value.has(f)}function s(f){const p=new Set(t.value);p.add(f),t.value=p}function l(f){const p=new Set(t.value);p.delete(f),t.value=p}const c=Fe(()=>t.value.size),u=Fe(()=>t.value.size===0),d=Fe(()=>e().filter(p=>t.value.has(p.path)));return{selected:t,anchor:r,click:n,clear:a,selectAll:i,has:o,add:s,remove:l,size:c,isEmpty:u,nodes:d}}const so=[{id:"palette",defaultCombo:"Ctrl+K",labelKey:"shortcuts.palette",groupKey:"shortcuts.group.nav"},{id:"search",defaultCombo:"/",labelKey:"shortcuts.search",groupKey:"shortcuts.group.nav"},{id:"go-up",defaultCombo:"Alt+↑",fixedCombos:["Backspace"],labelKey:"shortcuts.go_up",groupKey:"shortcuts.group.nav"},{id:"open",defaultCombo:"Enter",prevent:!1,labelKey:"shortcuts.open",groupKey:"shortcuts.group.nav"},{id:"quicklook",defaultCombo:"Space",labelKey:"shortcuts.quicklook",groupKey:"shortcuts.group.nav"},{id:"close",defaultCombo:"Esc",customizable:!1,prevent:!1,inForms:!0,labelKey:"shortcuts.close",groupKey:"shortcuts.group.nav"},{id:"inspector",defaultCombo:"I",labelKey:"shortcuts.inspector",groupKey:"shortcuts.group.nav"},{id:"help",defaultCombo:"?",labelKey:"shortcuts.help",groupKey:"shortcuts.group.nav"},{id:"select-all",defaultCombo:"Ctrl+A",labelKey:"shortcuts.select_all",groupKey:"shortcuts.group.selection"},{id:"rename",defaultCombo:"F2",labelKey:"shortcuts.rename",groupKey:"shortcuts.group.file"},{id:"delete",defaultCombo:"Del",labelKey:"shortcuts.delete",groupKey:"shortcuts.group.file"},{id:"cut",defaultCombo:"Ctrl+X",labelKey:"shortcuts.cut",groupKey:"shortcuts.group.file"},{id:"copy",defaultCombo:"Ctrl+C",labelKey:"shortcuts.copy",groupKey:"shortcuts.group.file"},{id:"paste",defaultCombo:"Ctrl+V",labelKey:"shortcuts.paste",groupKey:"shortcuts.group.file"},{id:"tab-new",defaultCombo:"Ctrl+T",labelKey:"shortcuts.tab_new",groupKey:"shortcuts.group.tabs"},{id:"tab-close",defaultCombo:"Ctrl+W",labelKey:"shortcuts.tab_close",groupKey:"shortcuts.group.tabs"},{id:"tab-next",defaultCombo:"Ctrl+Tab",labelKey:"shortcuts.tab_next",groupKey:"shortcuts.group.tabs"},{id:"tab-prev",defaultCombo:"Ctrl+Shift+Tab",labelKey:"shortcuts.tab_prev",groupKey:"shortcuts.group.tabs"}],mx={palette:"onPathJump",search:"onFocusSearch","go-up":"onGoUp",open:"onOpen",quicklook:"onQuickLook",close:"onClose",inspector:"onToggleInspector",help:"onShowHelp","select-all":"onSelectAll",rename:"onRename",delete:"onDelete",cut:"onCut",copy:"onCopy",paste:"onPaste","tab-new":"onTabNew","tab-close":"onTabClose","tab-next":"onTabNext","tab-prev":"onTabPrev"},mf="filex.shortcuts";function gx(){try{const e=localStorage.getItem(mf);if(!e)return{};const t=JSON.parse(e);if(!t||typeof t!="object")return{};const r={};for(const[n,a]of Object.entries(t))typeof a=="string"&&so.some(i=>i.id===n)&&(r[n]=a);return r}catch{return{}}}const Ea=re(gx());function gf(){try{Object.keys(Ea.value).length===0?localStorage.removeItem(mf):localStorage.setItem(mf,JSON.stringify(Ea.value))}catch{}}function Rv(e){return so.find(t=>t.id===e)}function z0(e){var r;const t=Ea.value[e];return t!==void 0?t:((r=Rv(e))==null?void 0:r.defaultCombo)??""}function bf(e,t){const r=Rv(e);if(!r||r.customizable===!1)return;const n={...Ea.value};t===r.defaultCombo?delete n[e]:n[e]=t,Ea.value=n,gf()}function bx(e){if(!(e in Ea.value))return;const t={...Ea.value};delete t[e],Ea.value=t,gf()}function yx(){Ea.value={},gf()}function _x(e,t){var r;if(!e)return null;for(const n of so)if(n.id!==t){if((r=n.fixedCombos)!=null&&r.includes(e))return{id:n.id,fixed:!0};if(z0(n.id)===e)return{id:n.id,fixed:n.customizable===!1}}return null}const xx={" ":"Space",Spacebar:"Space",Escape:"Esc",Delete:"Del",ArrowUp:"↑",ArrowDown:"↓",ArrowLeft:"←",ArrowRight:"→",PageUp:"PgUp",PageDown:"PgDn"},wx=new Set(["Control","Alt","Shift","Meta","AltGraph","CapsLock","NumLock","ScrollLock","Fn","Dead"]);function kx(e){const t=e.key;if(!t||wx.has(t))return null;const r=xx[t];return r||(t.length===1?t.toUpperCase():t)}function Lv(e){const t=kx(e);if(!t)return null;const r=[];(e.ctrlKey||e.metaKey)&&r.push("Ctrl"),e.altKey&&r.push("Alt");const n=t.length===1&&t.toUpperCase()===t.toLowerCase();return e.shiftKey&&!n&&r.push("Shift"),r.push(t),r.join("+")}function Bv(){return Fe(()=>so.map(e=>{const t=z0(e.id),r=e.fixedCombos??[];return{id:e.id,combo:t,fixedCombos:r,keys:[t,...r].filter(n=>!!n),labelKey:e.labelKey,groupKey:e.groupKey,customizable:e.customizable!==!1,overridden:Ea.value[e.id]!==void 0}}))}so.map(e=>({keys:[e.defaultCombo,...e.fixedCombos??[]].filter(t=>!!t),labelKey:e.labelKey,groupKey:e.groupKey}));function Sx(e,t){const r=Fe(()=>{const a=new Map;for(const i of so){const o=z0(i.id);o&&a.set(o,i)}return a});function n(a){var d;if(!e.value||a.key!=="Escape"&&document.querySelector(".fe-ctx-backdrop"))return;const o=a.target,s=!!(o&&(o.tagName==="INPUT"||o.tagName==="TEXTAREA"||o.tagName==="SELECT"||o.isContentEditable)),l=Lv(a);if(!l)return;if(l==="Backspace"){if(s)return;(d=t.hasSelection)!=null&&d.call(t)&&t.onDelete?(a.preventDefault(),t.onDelete()):t.onGoUp&&(a.preventDefault(),t.onGoUp());return}const c=r.value.get(l);if(!c||s&&!c.inForms||l==="Space"&&o&&typeof o.closest=="function"&&o.closest('button, a, select, summary, [role="button"], [role="menuitem"]'))return;const u=t[mx[c.id]];u&&(c.prevent!==!1&&a.preventDefault(),u())}Xt(()=>window.addEventListener("keydown",n)),tr(()=>window.removeEventListener("keydown",n))}const $v={tr:{"toolbar.new_folder":"Yeni Klasör","toolbar.upload":"Yükle","toolbar.search":"Ara","toolbar.search.placeholder":"Dosya adı…","toolbar.view.list":"Liste","toolbar.view.grid":"Izgara","toolbar.refresh":"Yenile","toolbar.go_up":"Üst Klasör","ctx.open":"Aç","ctx.preview":"Önizle","ctx.download":"İndir","ctx.convert":"Dönüştür","ctx.rename":"Yeniden Adlandır","ctx.delete":"Sil","ctx.delete_perm":"Kalıcı Olarak Sil","ctx.restore":"Geri Getir","ctx.share":"Paylaş","ctx.move":"Taşı","ctx.copy":"Kopyala","ctx.cut":"Kes","ctx.paste":"Yapıştır","ctx.info":"Bilgi","ctx.duplicate":"Kopyasını Oluştur","ctx.new_file":"Yeni Dosya","modal.delete.title":"Silinsin mi?","modal.delete.message":"{count} öğe çöpe atılacak.","modal.delete.confirm":"Çöpe At","modal.delete.cancel":"Vazgeç","modal.rename.title":"Yeniden Adlandır","modal.rename.save":"Kaydet","modal.rename.cancel":"Vazgeç","modal.newfolder.title":"Yeni Klasör","modal.newfolder.placeholder":"Klasör adı","modal.newfolder.create":"Oluştur","modal.newfolder.cancel":"Vazgeç","modal.share.title":"Paylaşım Linki","modal.share.pin":"PIN koruması","modal.share.expires":"Son kullanma","modal.share.max_downloads":"İndirme limiti","modal.share.create":"Paylaş","modal.share.cancel":"Vazgeç","modal.share.copy":"Kopyala","modal.share.url_copied":"Link kopyalandı","modal.share.pin_copied":"PIN kopyalandı","modal.share.cli_copied":"CLI komutu kopyalandı","upload.progress":"Yükleniyor","upload.done":"Tamamlandı","upload.error":"Hata","upload.failed":"“{name}” yüklenemedi","upload.aborted":"İptal edildi","upload.cancel":"İptal","empty.folder":"Bu klasör boş","empty.search":"Sonuç bulunamadı",loading:"Yükleniyor…","notFound.title":"Klasör bulunamadı","notFound.desc":"Bu klasör mevcut değil, taşınmış ya da erişim yetkiniz yok.","notFound.goRoot":"Kök klasöre dön","col.name":"Ad","col.size":"Boyut","col.modified":"Tarih","col.type":"Tür","unit.bytes":"B","unit.kb":"KB","unit.mb":"MB","unit.gb":"GB","unit.tb":"TB","breadcrumb.root":"Kök","breadcrumb.copy_path":"Yolu Kopyala","breadcrumb.go_to_path":"Yola Git","breadcrumb.path_placeholder":"fileman/foo/bar","ops.copy":"Kopyalanıyor","ops.move":"Taşınıyor","ops.delete":"Siliniyor","ops.queued":"sırada","ops.done":"tamamlandı","ops.error":"hata","node.trash":"Çöp Kutusu","viewer.open_in_new_tab":"Yeni Sekmede Aç","viewer.loading":"Yükleniyor…","viewer.failed_to_load":"Dosya yüklenemedi","viewer.peer_not_installed":"Bu dosya tipi için opsiyonel kütüphane kurulu değil. Peer dependency yükle veya İndir düğmesini kullan.","viewer.format_unsupported_3d":"Bu 3B format tarayıcı önizlemesinde desteklenmiyor (model-viewer yalnızca .glb / .gltf / .usdz okur). Lütfen indirip yerel bir araçta açın.","viewer.zoom_in":"Yakınlaştır","viewer.zoom_out":"Uzaklaştır","viewer.fit_width":"Sayfa genişliğine sığdır","viewer.next_page":"Sonraki sayfa","viewer.prev_page":"Önceki sayfa","viewer.page_n_of_m":"Sayfa {n} / {m}","viewer.tags":"Etiketler","viewer.layers":"Katmanlar","viewer.toc":"İçindekiler","viewer.font_smaller":"Yazıyı küçült","viewer.font_larger":"Yazıyı büyüt","viewer.search":"Ara","viewer.download":"İndir","viewer.saving":"Kaydediliyor…","viewer.save":"Kaydet (Ctrl+S)","viewer.saved":"Kaydedildi","viewer.save_error":"Hata","viewer.editor_loading":"Editör yükleniyor…","viewer.no_preview":"Bu dosya tipi için önizleme henüz yok.","viewer.edit":"Düzenle","viewer.close":"Kapat","presence.expand":"İsimleri göster","presence.collapse":"Küçült","viewer.save_annotations":"Açıklamaları kaydet","viewer.annotations_on":"Açıklamalar: açık","viewer.annotations_off":"Açıklamalar: kapalı","viewer.read_only":"Salt okunur","viewer.csv_first_row_header":"İlk satır başlık olsun","viewer.csv_filter":"Satır filtrele…","viewer.epub_prev":"Önceki","viewer.epub_next":"Sonraki","viewer.drawio.disabled":"diagrams.net editörü bu filex kurulumunda yapılandırılmamış — yönetici FILEX_DRAWIO_URL'yi ayarlamalı.","viewer.archive.entries":"{n} dosya","viewer.archive.empty":"Arşiv boş.","viewer.archive.error":"Arşiv okunamadı.","viewer.name":"Ad","viewer.size":"Boyut","col.sort":"Sırala","group.today":"Bugün","group.yesterday":"Dün","group.this_week":"Bu Hafta","group.this_month":"Bu Ay","group.no_date":"Tarihsiz","toolbar.density.compact":"Sıkışık görünüm","toolbar.density.comfortable":"Rahat görünüm","palette.placeholder":"Dosya, klasör veya komut ara…","palette.files":"Dosyalar","palette.commands":"Komutlar","palette.goto":"Yola git","palette.empty":"Sonuç bulunamadı","palette.hint":"↑↓ gezin · Enter seç · Esc kapat","cmd.view_toggle":"Görünümü değiştir (liste ⇄ ızgara)","cmd.trash":"Çöp kutusunu aç","shortcuts.title":"Klavye Kısayolları","shortcuts.group.nav":"Gezinme","shortcuts.group.selection":"Seçim","shortcuts.group.file":"Dosya işlemleri","shortcuts.palette":"Komut paleti","shortcuts.search":"Aramaya odaklan","shortcuts.go_up":"Üst klasöre çık","shortcuts.open":"Seçili öğeyi aç","shortcuts.close":"Kapat / vazgeç","shortcuts.help":"Bu yardım penceresi","shortcuts.select_all":"Tümünü seç","shortcuts.rename":"Yeniden adlandır","shortcuts.delete":"Sil","shortcuts.cut":"Kes","shortcuts.copy":"Kopyala","shortcuts.paste":"Yapıştır","breadcrumb.more":"Aradaki klasörler","empty.hint":"Dosyaları buraya sürükleyip bırakın","empty.upload":"Dosya yükle","empty.search.title":"Aramanla eşleşen dosya yok","empty.search.hint":"Farklı bir arama terimi deneyin","empty.trash.title":"Çöp kutusu boş","error.title":"Liste yüklenemedi","error.retry":"Yeniden dene","toast.undo":"Geri Al","toast.undone":"Geri alındı","toast.undo_failed":"Geri alınamadı","toast.renamed":"Yeniden adlandırıldı","toast.moved":"Taşındı","toast.trashed":"Çöpe taşındı","conn.offline":"Canlı bağlantı yok — değişiklikler gecikebilir","conn.tooltip":"Sunucuyla canlı bağlantı kurulamadı; liste belirli aralıklarla otomatik yenilenir. Bağlantı geri gelince bu uyarı kaybolur.","palette.everywhere":"Her yerde","palette.searching":"Aranıyor…","palette.saved":"Kayıtlı aramalar","palette.save":"Aramayı kaydet","palette.saved.delete":"Kayıtlı aramayı sil","search.in_content":"İçerikte","toolbar.more":"Diğer işlemler","toolbar.search.close":"Aramayı kapat","sheet.menu":"İşlemler","sheet.close":"Kapat","toolbar.inspector":"Ayrıntılar","ctx.details":"Ayrıntılar","shortcuts.inspector":"Ayrıntılar panelini aç/kapat","inspector.title":"Ayrıntılar","inspector.close":"Kapat","inspector.section.general":"Genel","inspector.section.versions":"Sürümler","inspector.section.permissions":"İzinler","inspector.section.shares":"Paylaşımlar","inspector.path":"Yol","inspector.size":"Boyut","inspector.modified":"Değiştirilme","inspector.mime":"MIME türü","inspector.etag":"ETag","inspector.copy":"Kopyala","inspector.copied":"Kopyalandı","inspector.error":"Yüklenemedi","inspector.items_summary":"{n} öğe, toplam {size}","inspector.folder_items":"{n} öğe","inspector.versions.empty":"Sürüm geçmişi yok","inspector.versions.v":"Sürüm {n}","inspector.versions.restore":"Geri yükle","inspector.versions.restore_confirm":"Bu sürüm geri yüklensin mi?","inspector.versions.snapshot_current":"Önce şimdiki halin sürümünü al","inspector.versions.confirm":"Onayla","inspector.versions.cancel":"Vazgeç","inspector.versions.take_snapshot":"Şimdiki halin sürümünü al","inspector.versions.restored":"Sürüm geri yüklendi","inspector.versions.snapshotted":"Sürüm alındı","inspector.versions.unsupported":"Sunucu bu işlemi desteklemiyor","inspector.perm.none":"Erişim yok","inspector.perm.viewer":"Görüntüleyen","inspector.perm.editor":"Düzenleyen","inspector.perm.owner":"Sahip","inspector.perm.manage":"İzinleri yönet","inspector.shares.empty":"Paylaşım linki yok","inspector.shares.copy":"Linki kopyala","theme.menu":"Tema","theme.title":"Tema Galerisi","theme.hint":"Tema yalnız renk paletini değiştirir; açık/koyu mod ayrı çalışmaya devam eder.","theme.reset":"Varsayılana dön","theme.close":"Kapat","theme.selected":"Seçili","theme.name.default":"Varsayılan","theme.name.night":"Gece Mavisi","theme.name.forest":"Orman","theme.name.amber":"Kehribar","theme.name.lilac":"Leylak","theme.name.contrast":"Yüksek Kontrast","theme.name.gray":"Yumuşak Gri","theme.name.terminal":"Terminal Yeşili","shortcuts.quicklook":"Hızlı bakış","shortcuts.customize":"Özelleştir","shortcuts.settings.menu":"Kısayollar","shortcuts.settings.title":"Kısayol Ayarları","shortcuts.settings.hint":'Bir kısayolu değiştirmek için "Değiştir"e basıp yeni tuş kombinasyonuna basın. Değişiklikler yalnızca bu tarayıcıda saklanır.',"shortcuts.settings.change":"Değiştir","shortcuts.settings.capture":"Tuşlara basın… (Esc iptal)","shortcuts.settings.reset":"Varsayılana dön","shortcuts.settings.reset_all":"Tümünü sıfırla","shortcuts.settings.unbound":"Atanmadı","shortcuts.settings.fixed":"Sabit","shortcuts.settings.customized":"Özelleştirildi","shortcuts.settings.conflict":'kombinasyonu "{name}" kısayolunda kullanılıyor.',"shortcuts.settings.conflict_fixed":'kombinasyonu "{name}" sabit kısayoluna ayrılmış — kullanılamaz.',"shortcuts.settings.conflict_take":"Eskisini boşa çıkar ve ata","shortcuts.settings.conflict_cancel":"Vazgeç","quicklook.hint_close":"kapat","quicklook.hint_nav":"önceki/sonraki","quicklook.hint_open":"aç","opc.title":"İşlemler","opc.aria_badge":"{n} işlem — işlem merkezini aç/kapat","opc.close":"Kapat","opc.active":"Sürüyor","opc.history":"Geçmiş","opc.clear":"Temizle","opc.empty":"İşlem yok","opc.cancel":"İptal","opc.retry":"Yeniden dene","opc.dismiss":"Kapat","opc.queued":"Sırada","opc.percent":"%{n}","opc.status.running":"Sürüyor","opc.status.done":"Bitti","opc.status.error":"Hata","opc.status.aborted":"İptal edildi","opc.kind.upload":"Yükleme","opc.kind.copy":"Kopyalama","opc.kind.move":"Taşıma","opc.kind.delete":"Silme","opc.kind.convert":"Dönüştürme","opc.kind.archive":"Arşiv","tour.aria":"Tanıtım turu","tour.restart":"Turu tekrar başlat","tour.skip":"Turu atla","tour.back":"Geri","tour.next":"İleri","tour.done":"Bitti","tour.progress":"{n} / {m}","tour.step.nav.title":"Depo ve klasörler","tour.step.nav.desc":"Bulunduğun konum burada görünür. Kırıntı çubuğundaki adımlara tıklayarak üst klasörlere ve depo köküne dönebilirsin.","tour.step.upload.title":"Dosya yükle","tour.step.upload.desc":"Bu düğmeyle dosya seçebilirsin; dosyaları doğrudan pencereye sürükleyip bırakmak da çalışır.","tour.step.search.title":"Arama","tour.step.search.desc":"Bu kutu bulunduğun klasörü filtreler. Ctrl+K komut paleti ile tüm depolarda arama yapabilir ve komut çalıştırabilirsin.","tour.step.view.title":"Görünümü değiştir","tour.step.view.desc":"Liste ve ızgara görünümü arasında geçiş yapabilirsin; seçimin hatırlanır.","tour.step.share.title":"Paylaşım","tour.step.share.desc":'Bir dosyaya sağ tıklayıp "Paylaş / İzinler" ile bağlantı oluşturabilir, PIN ve son kullanma süresi ekleyebilirsin.',"tour.step.help.title":"Kısayollar","tour.step.help.desc":'? tuşu kısayol kartını, Ctrl+K komut paletini açar. Bu turu menüdeki "Turu tekrar başlat" ile dilediğinde yeniden izleyebilirsin.',"error.hint":"Bağlantı ya da sunucu kaynaklı geçici bir sorun olabilir. Yeniden deneyin.","error.details":"Teknik ayrıntılar","col.star":"Yıldız","toolbar.view_label":"Görünüm","list.aria":"Dosya listesi","grid.aria":"Dosya ızgarası","tabs.strip":"Sekmeler","tabs.new":"Yeni sekme","tabs.close":"Sekmeyi kapat","tabs.split":"Görünümü böl","tabs.split_off":"Bölmeyi kapat","ctx.open_new_tab":"Yeni sekmede aç","shortcuts.group.tabs":"Sekmeler","shortcuts.tab_new":"Yeni sekme","shortcuts.tab_close":"Sekmeyi kapat","shortcuts.tab_next":"Sonraki sekme","shortcuts.tab_prev":"Önceki sekme","cmd.tab_new":"Yeni sekme aç","cmd.split_toggle":"Görünümü böl / birleştir","split.pane":"İkincil panel","split.close":"Yan paneli kapat","split.error":"Liste yüklenemedi","split.retry":"Yeniden dene","split.copy_queued":"Kopyalama kuyruğa alındı","split.cross_copy":"Depolar farklı — kopyalama kuyruğa alındı","split.cross_failed":"Depolar arası kopyalama bu sunucuda desteklenmiyor","toolbar.view.gallery":"Galeri","gallery.aria":"Dosya galerisi","inspector.section.comments":"Yorumlar","inspector.comments.empty":"Henüz yorum yok.","inspector.comments.placeholder":"Yorum yaz…","inspector.comments.send":"Gönder","inspector.comments.delete":"Yorumu sil","e2e.create.title":"Şifreli klasör oluştur","e2e.create.option":"Şifreli klasör oluştur…","e2e.create.pw_placeholder":"Klasör parolası (en az 8 karakter)","e2e.create.pw2_placeholder":"Parolayı tekrar girin","e2e.create.warn_title":"GERİ DÖNÜŞÜ YOK","e2e.create.warn_body":"Dosyalar yalnız bu parolayla açılır. Parola sunucuda TUTULMAZ; unutursanız içerik sonsuza dek kaybolur. Kurtarma yolu yoktur — yönetici dahil kimse açamaz.","e2e.create.ack":"Anladım: parolayı kaybedersem verilerim kurtarılamaz.","e2e.create.ack_required":"Devam etmek için uyarıyı onaylayın.","e2e.create.pw_short":"Parola en az 8 karakter olmalı.","e2e.create.pw_mismatch":"Parolalar birbirini tutmuyor.","e2e.create.bad_name":"Geçersiz klasör adı.","e2e.create.create":"Şifreli klasörü oluştur","e2e.create.busy":"Oluşturuluyor…","e2e.create.done":"Şifreli klasör oluşturuldu","e2e.create.failed":"Şifreli klasör oluşturulamadı","e2e.create.nested":"Şifreli klasörün içine ikinci bir şifreli klasör açılamaz.","e2e.locked.title":"Bu klasör uçtan uca şifreli","e2e.locked.hint":"İçeriği görmek için klasör parolasını girin. Parola yalnız bu sekmede, bellekte tutulur.","e2e.locked.pw_placeholder":"Klasör parolası","e2e.locked.unlock":"Kilidi aç","e2e.locked.busy":"Doğrulanıyor…","e2e.unlock.wrong":"Parola yanlış.","e2e.unlock.marker_missing":"Şifre dosyası (.filex-e2e.json) okunamadı.","e2e.strip.label":"Şifreli klasör — kilit açık","e2e.strip.lock":"Kilitle","e2e.locked_toast":"Klasör kilitlendi","e2e.upload.too_big":"200 MB üstü dosyalar şifreli klasöre yüklenemez (MVP sınırı)","e2e.upload.locked":"Önce klasörün kilidini açın","e2e.decrypting":"Çözülüyor…","e2e.decrypt_failed":"Dosya çözülemedi (parola değişmiş ya da dosya bozulmuş olabilir).","e2e.download.failed":"Şifreli dosya indirilemedi."},en:{"toolbar.new_folder":"New Folder","toolbar.upload":"Upload","toolbar.search":"Search","toolbar.search.placeholder":"File name…","toolbar.view.list":"List","toolbar.view.grid":"Grid","toolbar.refresh":"Refresh","toolbar.go_up":"Up one level","ctx.open":"Open","ctx.preview":"Preview","ctx.download":"Download","ctx.convert":"Convert","ctx.rename":"Rename","ctx.delete":"Delete","ctx.delete_perm":"Delete Permanently","ctx.restore":"Restore","ctx.share":"Share","ctx.move":"Move","ctx.copy":"Copy","ctx.cut":"Cut","ctx.paste":"Paste","ctx.info":"Info","ctx.duplicate":"Duplicate","ctx.new_file":"New File","modal.delete.title":"Delete?","modal.delete.message":"{count} item(s) will be moved to trash.","modal.delete.confirm":"Move to Trash","modal.delete.cancel":"Cancel","modal.rename.title":"Rename","modal.rename.save":"Save","modal.rename.cancel":"Cancel","modal.newfolder.title":"New Folder","modal.newfolder.placeholder":"Folder name","modal.newfolder.create":"Create","modal.newfolder.cancel":"Cancel","modal.share.title":"Share Link","modal.share.pin":"PIN protected","modal.share.expires":"Expires at","modal.share.max_downloads":"Download limit","modal.share.create":"Share","modal.share.cancel":"Cancel","modal.share.copy":"Copy","modal.share.url_copied":"Link copied","modal.share.pin_copied":"PIN copied","modal.share.cli_copied":"CLI command copied","upload.progress":"Uploading","upload.done":"Done","upload.error":"Error","upload.failed":"Could not upload “{name}”","upload.aborted":"Aborted","upload.cancel":"Cancel","empty.folder":"This folder is empty","empty.search":"No results",loading:"Loading…","notFound.title":"Folder not found","notFound.desc":"This folder does not exist, was moved, or you do not have access to it.","notFound.goRoot":"Go to root folder","col.name":"Name","col.size":"Size","col.modified":"Modified","col.type":"Type","unit.bytes":"B","unit.kb":"KB","unit.mb":"MB","unit.gb":"GB","unit.tb":"TB","breadcrumb.root":"Root","breadcrumb.copy_path":"Copy Path","breadcrumb.go_to_path":"Go To Path","breadcrumb.path_placeholder":"fileman/foo/bar","ops.copy":"Copying","ops.move":"Moving","ops.delete":"Deleting","ops.queued":"queued","ops.done":"done","ops.error":"error","node.trash":"Trash","viewer.open_in_new_tab":"Open in New Tab","viewer.loading":"Loading…","viewer.failed_to_load":"Failed to load file","viewer.peer_not_installed":"Optional viewer library is not installed. Install the peer dependency or use the download button.","viewer.format_unsupported_3d":"This 3D format is not supported in the browser preview (model-viewer only reads .glb / .gltf / .usdz). Please download and open with a local tool.","viewer.zoom_in":"Zoom in","viewer.zoom_out":"Zoom out","viewer.fit_width":"Fit width","viewer.next_page":"Next page","viewer.prev_page":"Previous page","viewer.page_n_of_m":"Page {n} of {m}","viewer.tags":"Tags","viewer.layers":"Layers","viewer.toc":"Contents","viewer.font_smaller":"Smaller text","viewer.font_larger":"Larger text","viewer.search":"Search","viewer.download":"Download","viewer.saving":"Saving…","viewer.save":"Save (Ctrl+S)","viewer.saved":"Saved","viewer.save_error":"Error","viewer.editor_loading":"Loading editor…","viewer.no_preview":"No preview for this file type yet.","viewer.edit":"Edit","viewer.close":"Close","presence.expand":"Show names","presence.collapse":"Collapse","viewer.save_annotations":"Save annotations","viewer.annotations_on":"Annotations: on","viewer.annotations_off":"Annotations: off","viewer.read_only":"Read only","viewer.csv_first_row_header":"First row as header","viewer.csv_filter":"Filter rows…","viewer.epub_prev":"Previous","viewer.epub_next":"Next","viewer.drawio.disabled":"diagrams.net embed is not configured for this filex instance — operator must wire FILEX_DRAWIO_URL to enable the editor.","viewer.archive.entries":"{n} files","viewer.archive.empty":"Archive is empty.","viewer.archive.error":"Could not read archive contents.","viewer.name":"Name","viewer.size":"Size","col.sort":"Sort","group.today":"Today","group.yesterday":"Yesterday","group.this_week":"This Week","group.this_month":"This Month","group.no_date":"No date","toolbar.density.compact":"Compact view","toolbar.density.comfortable":"Comfortable view","palette.placeholder":"Search files, folders or commands…","palette.files":"Files","palette.commands":"Commands","palette.goto":"Go to path","palette.empty":"No results","palette.hint":"↑↓ navigate · Enter select · Esc close","cmd.view_toggle":"Toggle view (list ⇄ grid)","cmd.trash":"Open trash","shortcuts.title":"Keyboard Shortcuts","shortcuts.group.nav":"Navigation","shortcuts.group.selection":"Selection","shortcuts.group.file":"File operations","shortcuts.palette":"Command palette","shortcuts.search":"Focus search","shortcuts.go_up":"Go up one level","shortcuts.open":"Open selected item","shortcuts.close":"Close / cancel","shortcuts.help":"This help dialog","shortcuts.select_all":"Select all","shortcuts.rename":"Rename","shortcuts.delete":"Delete","shortcuts.cut":"Cut","shortcuts.copy":"Copy","shortcuts.paste":"Paste","breadcrumb.more":"Hidden folders","empty.hint":"Drag and drop files here","empty.upload":"Upload files","empty.search.title":"No files match your search","empty.search.hint":"Try a different search term","empty.trash.title":"Trash is empty","error.title":"Could not load this folder","error.retry":"Try again","toast.undo":"Undo","toast.undone":"Undone","toast.undo_failed":"Could not undo","toast.renamed":"Renamed","toast.moved":"Moved","toast.trashed":"Moved to trash","conn.offline":"No live connection — changes may be delayed","conn.tooltip":"Live connection to the server is unavailable; the list refreshes periodically. This notice disappears once the connection is back.","palette.everywhere":"Everywhere","palette.searching":"Searching…","palette.saved":"Saved searches","palette.save":"Save search","palette.saved.delete":"Delete saved search","search.in_content":"In content","toolbar.more":"More actions","toolbar.search.close":"Close search","sheet.menu":"Actions","sheet.close":"Close","toolbar.inspector":"Details","ctx.details":"Details","shortcuts.inspector":"Toggle details panel","inspector.title":"Details","inspector.close":"Close","inspector.section.general":"General","inspector.section.versions":"Versions","inspector.section.permissions":"Permissions","inspector.section.shares":"Shares","inspector.path":"Path","inspector.size":"Size","inspector.modified":"Modified","inspector.mime":"MIME type","inspector.etag":"ETag","inspector.copy":"Copy","inspector.copied":"Copied","inspector.error":"Could not load","inspector.items_summary":"{n} items, {size} total","inspector.folder_items":"{n} items","inspector.versions.empty":"No version history","inspector.versions.v":"Version {n}","inspector.versions.restore":"Restore","inspector.versions.restore_confirm":"Restore this version?","inspector.versions.snapshot_current":"Snapshot the current state first","inspector.versions.confirm":"Confirm","inspector.versions.cancel":"Cancel","inspector.versions.take_snapshot":"Snapshot current state","inspector.versions.restored":"Version restored","inspector.versions.snapshotted":"Snapshot taken","inspector.versions.unsupported":"The server does not support this operation","inspector.perm.none":"No access","inspector.perm.viewer":"Viewer","inspector.perm.editor":"Editor","inspector.perm.owner":"Owner","inspector.perm.manage":"Manage permissions","inspector.shares.empty":"No share links","inspector.shares.copy":"Copy link","theme.menu":"Theme","theme.title":"Theme Gallery","theme.hint":"Themes only change the color palette; light/dark mode still applies separately.","theme.reset":"Reset to default","theme.close":"Close","theme.selected":"Selected","theme.name.default":"Default","theme.name.night":"Night Blue","theme.name.forest":"Forest","theme.name.amber":"Amber","theme.name.lilac":"Lilac","theme.name.contrast":"High Contrast","theme.name.gray":"Soft Gray","theme.name.terminal":"Terminal Green","shortcuts.quicklook":"Quick look","shortcuts.customize":"Customize","shortcuts.settings.menu":"Shortcuts","shortcuts.settings.title":"Shortcut Settings","shortcuts.settings.hint":'To remap a shortcut, press "Change" and then the new key combination. Changes are stored in this browser only.',"shortcuts.settings.change":"Change","shortcuts.settings.capture":"Press keys… (Esc cancels)","shortcuts.settings.reset":"Reset to default","shortcuts.settings.reset_all":"Reset all","shortcuts.settings.unbound":"Not set","shortcuts.settings.fixed":"Fixed","shortcuts.settings.customized":"Customized","shortcuts.settings.conflict":'is already used by "{name}".',"shortcuts.settings.conflict_fixed":'is reserved by the fixed shortcut "{name}" — it cannot be used.',"shortcuts.settings.conflict_take":"Unassign old and use here","shortcuts.settings.conflict_cancel":"Cancel","quicklook.hint_close":"close","quicklook.hint_nav":"previous/next","quicklook.hint_open":"open","opc.title":"Operations","opc.aria_badge":"{n} operations — toggle operations center","opc.close":"Close","opc.active":"In progress","opc.history":"History","opc.clear":"Clear","opc.empty":"No operations","opc.cancel":"Cancel","opc.retry":"Retry","opc.dismiss":"Dismiss","opc.queued":"Queued","opc.percent":"{n}%","opc.status.running":"In progress","opc.status.done":"Done","opc.status.error":"Failed","opc.status.aborted":"Cancelled","opc.kind.upload":"Upload","opc.kind.copy":"Copy","opc.kind.move":"Move","opc.kind.delete":"Delete","opc.kind.convert":"Convert","opc.kind.archive":"Archive","tour.aria":"Onboarding tour","tour.restart":"Restart the tour","tour.skip":"Skip tour","tour.back":"Back","tour.next":"Next","tour.done":"Done","tour.progress":"{n} / {m}","tour.step.nav.title":"Storages & folders","tour.step.nav.desc":"Your current location lives here. Click any crumb to jump back to parent folders or the storage root.","tour.step.upload.title":"Upload files","tour.step.upload.desc":"Pick files with this button — or simply drag & drop them anywhere in the window.","tour.step.search.title":"Search","tour.step.search.desc":"This box filters the current folder. The Ctrl+K command palette searches across all storages and runs commands.","tour.step.view.title":"Switch views","tour.step.view.desc":"Toggle between the list and grid layout; your choice is remembered.","tour.step.share.title":"Sharing","tour.step.share.desc":'Right-click any file and use "Share / Permissions" to create a link with an optional PIN and expiry.',"tour.step.help.title":"Shortcuts","tour.step.help.desc":'Press ? for the shortcut cheat-sheet and Ctrl+K for the command palette. Replay this tour any time via "Restart the tour" in the menu.',"error.hint":"This may be a temporary network or server problem. Please try again.","error.details":"Technical details","col.star":"Star","toolbar.view_label":"View","list.aria":"File list","grid.aria":"File grid","tabs.strip":"Tabs","tabs.new":"New tab","tabs.close":"Close tab","tabs.split":"Split view","tabs.split_off":"Close split","ctx.open_new_tab":"Open in new tab","shortcuts.group.tabs":"Tabs","shortcuts.tab_new":"New tab","shortcuts.tab_close":"Close tab","shortcuts.tab_next":"Next tab","shortcuts.tab_prev":"Previous tab","cmd.tab_new":"Open a new tab","cmd.split_toggle":"Toggle split view","split.pane":"Secondary pane","split.close":"Close the side pane","split.error":"Could not load the listing","split.retry":"Retry","split.copy_queued":"Copy queued","split.cross_copy":"Different storages — copy queued instead","split.cross_failed":"Cross-storage copy is not supported by this server","toolbar.view.gallery":"Gallery","gallery.aria":"File gallery","inspector.section.comments":"Comments","inspector.comments.empty":"No comments yet.","inspector.comments.placeholder":"Write a comment…","inspector.comments.send":"Send","inspector.comments.delete":"Delete comment","e2e.create.title":"Create encrypted folder","e2e.create.option":"Create encrypted folder…","e2e.create.pw_placeholder":"Folder password (min 8 characters)","e2e.create.pw2_placeholder":"Repeat the password","e2e.create.warn_title":"NO WAY BACK","e2e.create.warn_body":"Files open ONLY with this password. The password is NEVER stored on the server; if you forget it the content is lost forever. There is no recovery — not even an admin can open it.","e2e.create.ack":"I understand: if I lose the password my data cannot be recovered.","e2e.create.ack_required":"Please confirm the warning to continue.","e2e.create.pw_short":"Password must be at least 8 characters.","e2e.create.pw_mismatch":"Passwords do not match.","e2e.create.bad_name":"Invalid folder name.","e2e.create.create":"Create encrypted folder","e2e.create.busy":"Creating…","e2e.create.done":"Encrypted folder created","e2e.create.failed":"Could not create the encrypted folder","e2e.create.nested":"You cannot create an encrypted folder inside another one.","e2e.locked.title":"This folder is end-to-end encrypted","e2e.locked.hint":"Enter the folder password to see its contents. The password stays in this tab’s memory only.","e2e.locked.pw_placeholder":"Folder password","e2e.locked.unlock":"Unlock","e2e.locked.busy":"Verifying…","e2e.unlock.wrong":"Wrong password.","e2e.unlock.marker_missing":"Could not read the key file (.filex-e2e.json).","e2e.strip.label":"Encrypted folder — unlocked","e2e.strip.lock":"Lock","e2e.locked_toast":"Folder locked","e2e.upload.too_big":"Files over 200 MB cannot be uploaded to an encrypted folder (MVP limit)","e2e.upload.locked":"Unlock the folder first","e2e.decrypting":"Decrypting…","e2e.decrypt_failed":"Could not decrypt the file (password changed or file corrupted).","e2e.download.failed":"Could not download the encrypted file."}};function br(e){const t=Fe(()=>{const i=typeof e=="function"?e():e.value;return $v[i]??$v.tr});function r(i,o={}){const s=t.value[i]??i;return Object.entries(o).reduce((l,[c,u])=>l.replaceAll(`{${c}}`,String(u)),s)}function n(i){if(i==null||i<0)return"—";if(i===0)return`0 ${r("unit.bytes")}`;const o=[[1024**4,"unit.tb"],[1024**3,"unit.gb"],[1024**2,"unit.mb"],[1024,"unit.kb"],[1,"unit.bytes"]];for(const[s,l]of o)if(i>=s){const c=i/s;return`${c>=100?Math.round(c):c.toFixed(c>=10?1:2)} ${r(l)}`}return`${i} ${r("unit.bytes")}`}function a(i){if(i.basename===".trash")return r("node.trash");const o=i.basename.match(/^\d{8}-\d{6}-[A-Za-z0-9]+__(.+)$/);return o?o[1]:i.basename}return{t:r,formatSize:n,nodeDisplayName:a}}const Cx=2e3,Ex=8e3;function Nv(e){const t=(...s)=>{for(const l of s)if(typeof l=="number")return l;return 0},r=(...s)=>{for(const l of s)if(typeof l=="string"&&l!=="")return l;return null},n=String(e.status??"pending"),a=n==="ok"||n==="done"?"done":n==="failed"||n==="partial"||n==="error"?"error":n==="running"?"running":"pending",i=Array.isArray(e.sources)?e.sources:[],o=r(e.op_type,e.kind)??"delete";return{id:t(e.id),op_type:o==="copy"||o==="move"?o:"delete",status:a,progress_total:t(e.progress_total,e.total,i.length),progress_done:t(e.progress_done,e.done),target_path:r(e.target_path,e.dest),source_dir:r(e.source_dir),source_count:t(e.source_count,i.length),error_message:r(e.error_message,e.error),started_at:r(e.started_at),finished_at:r(e.finished_at),created_at:r(e.created_at)}}function Ax(e,t,r={}){const n=re([]),a=new Set,i=new Map;let o=!1;const s=Fe(()=>n.value.some(_=>_.status==="pending"||_.status==="running"));let l;function c(){l||t.endpoints.opsList&&(l=setInterval(()=>{d()},Cx),d())}function u(){l&&(clearInterval(l),l=void 0)}async function d(){var _;if(t.endpoints.opsList)try{const b=((await t.jsonFetch(t.endpoints.opsList)).ops||[]).map(Nv);for(const w of b)(w.status==="done"||w.status==="error")&&!a.has(w.id)&&(a.add(w.id),i.set(w.id,Date.now()),o&&((_=r.onSettled)==null||_.call(r,w)));const v=new Set(n.value.map(w=>w.id)),m=b.filter(w=>w.status==="pending"||w.status==="running"?!0:o?v.has(w.id):!1),y=new Set(m.map(w=>w.id)),g=n.value.filter(w=>!y.has(w.id)),S=[...m,...g];o=!0;const M=Date.now(),E=S.filter(w=>{if(w.status==="pending"||w.status==="running")return!0;const x=i.get(w.id);return x!==void 0&&M-x<Ex});n.value=E,!s.value&&E.length===0&&u()}catch(h){console.warn("[usePendingOps] poll failed:",h)}}function f(_){const h=Nv(_);n.value.some(v=>v.id===h.id)||(n.value=[h,...n.value]),c()}function p(_){n.value=n.value.filter(h=>h.id!==_),i.delete(_)}return tr(()=>{u()}),{ops:n,hasActive:s,register:f,dismiss:p,poll:d,startPolling:c,stopPolling:u}}const Tx=25e3,Mx=15e3,Dx=6;class zx{constructor(t){ma(this,"ws",null);ma(this,"opts");ma(this,"closed",!1);ma(this,"connecting",!1);ma(this,"retries",0);ma(this,"fallback",!1);ma(this,"pingTimer",null);ma(this,"reconnectTimer",null);ma(this,"currentPath",null);ma(this,"currentFocus",null);this.opts=t,this.connect()}subscribe(t){this.currentPath=t,this.currentFocus=null,t&&this.send({type:"subscribe",path:t})}setFocus(t){this.currentFocus=t,this.send({type:"focus",file:t})}close(){this.closed=!0,this.clearTimers(),this.dropSocket()}async connect(){if(this.closed||this.connecting||this.ws)return;this.connecting=!0;let t=null;try{t=await this.opts.getTicket()}catch{t=null}if(this.connecting=!1,this.closed)return;if(!t||!t.ticket||!t.ws_url){this.fail();return}const r=t.ws_url.includes("?")?"&":"?";let n;try{n=new WebSocket(`${t.ws_url}${r}ticket=${encodeURIComponent(t.ticket)}`)}catch{this.fail();return}this.ws=n,n.onopen=()=>{var a,i;this.retries=0,this.setFallback(!1),(i=(a=this.opts.handlers).onStatus)==null||i.call(a,!0),this.currentPath&&this.send({type:"subscribe",path:this.currentPath}),this.currentFocus!==null&&this.send({type:"focus",file:this.currentFocus}),this.startPing()},n.onmessage=a=>{var s,l,c,u;let i;try{i=JSON.parse(typeof a.data=="string"?a.data:"")}catch{return}const o=i;(o==null?void 0:o.type)==="change"?(l=(s=this.opts.handlers).onChange)==null||l.call(s,i):(o==null?void 0:o.type)==="presence"&&((u=(c=this.opts.handlers).onPresence)==null||u.call(c,i))},n.onerror=()=>{},n.onclose=()=>{var a,i;this.stopPing(),this.ws=null,(i=(a=this.opts.handlers).onStatus)==null||i.call(a,!1),this.fail()}}fail(){if(this.closed||this.reconnectTimer)return;if(this.retries>=Dx){this.setFallback(!0);return}const t=Math.min(1e3*2**this.retries,Mx);this.retries+=1,this.reconnectTimer=setTimeout(()=>{this.reconnectTimer=null,this.connect()},t)}setFallback(t){var r,n;this.fallback!==t&&(this.fallback=t,(n=(r=this.opts.handlers).onFallback)==null||n.call(r,t))}send(t){const r=this.ws;if(!(!r||r.readyState!==WebSocket.OPEN))try{r.send(JSON.stringify(t))}catch{}}startPing(){this.stopPing(),this.pingTimer=setInterval(()=>this.send({type:"ping"}),Tx)}stopPing(){this.pingTimer&&(clearInterval(this.pingTimer),this.pingTimer=null)}dropSocket(){if(this.ws){try{this.ws.onclose=null,this.ws.close()}catch{}this.ws=null}}clearTimers(){this.stopPing(),this.reconnectTimer&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null)}}const Ix=200,Ox=12e3;function Px(e,t){const r=re([]),n=re(!1),a=re(!1);let i=null,o=null,s=null,l=null;function c(){s&&clearTimeout(s),s=setTimeout(()=>{s=null,t.reload()},Ix)}function u(b){o&&b.path&&b.path!==o||(r.value=Array.isArray(b.users)?b.users:[])}function d(b){a.value=b,b?(r.value=[],l||(l=setInterval(()=>t.reload(),Ox))):l&&(clearInterval(l),l=null)}function f(){i||(i=new zx({getTicket:()=>e.wsTicket(),handlers:{onChange:c,onPresence:u,onFallback:d,onStatus:b=>{n.value=b}}}))}function p(b){r.value=[],o=b,i==null||i.subscribe(b)}function _(b){i==null||i.setFocus(b)}function h(){s&&(clearTimeout(s),s=null),l&&(clearInterval(l),l=null),i==null||i.close(),i=null,a.value=!1}return{presenceUsers:r,connected:n,degraded:a,start:f,subscribe:p,setFocus:_,stop:h}}const Fx=500;function Rx(e,t){const r=re({}),n=[],a=new Set,i=new Set;function o(c){if(/^https?:\/\//i.test(c))return c;const u=(e||"").replace(/\/+$/,"");return u&&c.startsWith("/")?u+c:c}function s(c){const u=c.thumb_url;if(!u)return null;const d=r.value[u];return d||(!a.has(u)&&!i.has(u)&&l(u),null)}async function l(c){i.add(c);try{const u=await fetch(o(c),{headers:await t.authHeaders({Accept:"*/*"}),credentials:t.credentialsMode()});if(!u.ok)throw new Error(String(u.status));const d=await u.blob();if(n.length>=Fx){const f=n.shift();if(f&&r.value[f]){URL.revokeObjectURL(r.value[f]);const p={...r.value};delete p[f],r.value=p}}n.push(c),r.value={...r.value,[c]:URL.createObjectURL(d)}}catch{a.add(c)}finally{i.delete(c)}}return{src:s}}let I0=null,O0=null,P0=null,yf=null;function _f(){I0||(I0=import("monaco-editor").then(e=>(P0=e.default??e,P0)).catch(()=>(P0=null,null))),O0||(O0=import("highlight.js").then(e=>(yf=e.default??e,yf)).catch(()=>(yf=null,null)))}async function Uv(){return I0||_f(),I0}async function Hv(){return O0||_f(),O0}function Lx(){return P0}const Bx={key:0,class:"fx-presence-chips"},$x=["title"],Nx={key:0,class:"fx-presence-dot","aria-hidden":"true"},Ux={class:"fx-presence-chip-name"},Hx={key:0,class:"fx-presence-chip-file"},jx=["title"],Gx=["title"],Vx={key:0,class:"fx-presence-dot","aria-hidden":"true"},qx={key:0,class:"fx-presence-more"},Kx=["title"],Wx={class:"fx-presence-file"},Yx=["title","aria-expanded"],jv="filex.presence.expanded",Xx=Pt({__name:"PresenceBar",props:{users:{},selfId:{},locale:{}},setup(e){const t=e,{t:r}=br(()=>t.locale??"tr"),n=Fe(()=>(t.users??[]).filter(u=>t.selfId==null||u.id!==t.selfId)),a=re((()=>{try{return localStorage.getItem(jv)==="1"}catch{return!1}})());function i(){a.value=!a.value;try{localStorage.setItem(jv,a.value?"1":"0")}catch{}}function o(u){return u.uid??String(u.id)}function s(u){const d=u.trim().split(/\s+/).filter(Boolean);return d.length===0?"?":d.length===1?d[0].slice(0,2).toUpperCase():(d[0][0]+d[d.length-1][0]).toUpperCase()}function l(u){const d=o(u);let f=0;for(let p=0;p<d.length;p++)f=f*31+d.charCodeAt(p)>>>0;return f%360}function c(u){return u.file?`${u.name} · ${u.file}`:u.name}return(u,d)=>n.value.length?(R(),$("div",{key:0,class:vt(["fx-presence",{"fx-presence--wide":a.value}])},[a.value?(R(),$("div",Bx,[(R(!0),$(qe,null,xt(n.value,f=>(R(),$("span",{key:o(f),class:"fx-presence-chip",title:c(f)},[T("span",{class:"fx-presence-avatar",style:Sn({backgroundColor:`hsl(${l(f)} 60% 45%)`})},[$t(V(s(f.name))+" ",1),f.file?(R(),$("span",Nx)):Te("",!0)],4),T("span",Ux,V(f.name),1),f.file?(R(),$("span",Hx,"· "+V(f.file),1)):Te("",!0)],8,$x))),128))])):(R(),$(qe,{key:1},[T("div",{class:"fx-presence-avatars",title:n.value.map(c).join(", ")},[(R(!0),$(qe,null,xt(n.value.slice(0,5),f=>(R(),$("span",{key:o(f),class:"fx-presence-avatar",style:Sn({backgroundColor:`hsl(${l(f)} 60% 45%)`}),title:c(f)},[$t(V(s(f.name))+" ",1),f.file?(R(),$("span",Vx)):Te("",!0)],12,Gx))),128)),n.value.length>5?(R(),$("span",qx,"+"+V(n.value.length-5),1)):Te("",!0)],8,jx),T("span",{class:"fx-presence-text",title:n.value.map(c).join(", ")},[$t(V(n.value.length===1?n.value[0].name:`${n.value.length} kişi`)+" ",1),n.value.length===1&&n.value[0].file?(R(),$(qe,{key:0},[d[0]||(d[0]=$t(" · ",-1)),T("span",Wx,V(n.value[0].file),1)],64)):Te("",!0)],8,Kx)],64)),T("button",{type:"button",class:"fx-presence-toggle",title:a.value?Y(r)("presence.collapse"):Y(r)("presence.expand"),"aria-expanded":a.value,onClick:i},V(a.value?"‹":"›"),9,Yx)],2)):Te("",!0)}}),fn=(e,t)=>{const r=e.__vccOpts||e;for(const[n,a]of t)r[n]=a;return r},Zx=fn(Xx,[["__scopeId","data-v-7e8c1920"]]),Jx=["data-prefers-dark"],Qx=["aria-label"],e8=["aria-label","onKeydown"],t8={class:"fe-sheet__items"},r8={key:0,class:"fe-ctx__sep",role:"separator"},n8=["disabled","onClick"],a8={key:0,class:"fe-ctx__icon","aria-hidden":"true"},i8={class:"fe-ctx__label"},o8=["aria-label"],s8={key:0,class:"fe-ctx__sep",role:"separator"},l8=["disabled","onClick"],c8={key:0,class:"fe-ctx__icon","aria-hidden":"true"},u8={class:"fe-ctx__label"},xf=Pt({__name:"ContextMenu",props:{locale:{},actions:{},theme:{},sheet:{type:Boolean}},emits:["select"],setup(e,{expose:t,emit:r}){const n=e,a=r,{t:i}=br(()=>n.locale),o=re(!1),s=re(0),l=re(0),c=re([]),u=re(null);let d=0,f=0,p=null;async function _(q,j){var P;if(p=document.activeElement??null,o.value=!0,s.value=q.clientX,l.value=q.clientY,d=q.clientX,f=q.clientY,c.value=j,await Nr(),n.sheet){(P=g.value)==null||P.focus();return}h(),m(0)}function h(){const q=u.value;if(!q||typeof window>"u")return;const j=q.getBoundingClientRect(),P=8,N=window.innerWidth,X=window.innerHeight;if(f+j.height>X-P){const Ee=f-j.height;l.value=Ee>=P?Ee:Math.max(P,X-j.height-P)}if(d+j.width>N-P){const Ee=d-j.width;s.value=Ee>=P?Ee:Math.max(P,N-j.width-P)}}function b(){var q;o.value=!1,S.value=!1,M.value=0,(q=p==null?void 0:p.focus)==null||q.call(p),p=null}function v(){const q=n.sheet?g.value:u.value;return q?Array.from(q.querySelectorAll(".fe-ctx__item:not(:disabled)")):[]}function m(q){var N;const j=v();if(j.length===0)return;const P=(q%j.length+j.length)%j.length;(N=j[P])==null||N.focus()}function y(q){const j=v();if(j.length===0)return;const P=document.activeElement,N=P?j.indexOf(P):-1;if(N===-1){m(q>0?0:j.length-1);return}m(N+q)}const g=re(null),S=re(!1),M=re(0);let E=0;function w(q){const j=q.touches[0];j&&(S.value=!0,E=j.clientY,M.value=0)}function x(q){if(!S.value)return;const j=q.touches[0];j&&(M.value=Math.max(0,j.clientY-E))}function C(){if(!S.value)return;const q=M.value>72;S.value=!1,q?b():M.value=0}const D=Fe(()=>M.value>0?{transform:`translateY(${M.value}px)`,transition:"none"}:void 0);function B(q){q.disabled||(a("select",q,c.value),b())}function F(q){if(q.key==="Escape"){q.stopPropagation(),b();return}if(q.key==="Enter"||q.key===" "){q.stopPropagation();return}q.key==="ArrowDown"?(q.preventDefault(),q.stopPropagation(),y(1)):q.key==="ArrowUp"?(q.preventDefault(),q.stopPropagation(),y(-1)):q.key==="Home"?(q.preventDefault(),m(0)):q.key==="End"?(q.preventDefault(),m(-1)):q.key==="Tab"&&(q.preventDefault(),b())}const K=Fe(()=>{const q=n.actions.filter(P=>!P.hidden),j=[];for(const P of q)P.divider&&(j.length===0||j[j.length-1].divider)||j.push(P);for(;j.length>0&&j[j.length-1].divider;)j.pop();return j}),te=re(!1);let J;function ne(q){te.value=!!(q&&"matches"in q&&q.matches)}Xt(()=>{var q;typeof window>"u"||(J=window.matchMedia("(prefers-color-scheme: dark)"),ne(J),(q=J.addEventListener)==null||q.call(J,"change",ne))}),tr(()=>{var q;(q=J==null?void 0:J.removeEventListener)==null||q.call(J,"change",ne)});const le=Fe(()=>`fe-ctx-backdrop--theme-${n.theme||"auto"}`);return t({show:_,hide:b}),(q,j)=>(R(),Zt(l1,{to:"body"},[Dt(Za,{name:e.sheet?"fe-sheet":"fe-ctx"},{default:ur(()=>[o.value?(R(),$("div",{key:0,class:vt(["fe-ctx-backdrop",[le.value,{"fe-ctx-backdrop--sheet":e.sheet}]]),"data-prefers-dark":te.value?"1":"0",onClick:b,onContextmenu:Ht(b,["prevent"]),onKeydown:F},[e.sheet?(R(),$("div",{key:0,ref_key:"sheetEl",ref:g,class:"fe-sheet",role:"menu","aria-label":Y(i)("sheet.menu"),tabindex:"-1",style:Sn(D.value),onClick:j[0]||(j[0]=Ht(()=>{},["stop"]))},[T("div",{class:"fe-sheet__handle",role:"button",tabindex:"0","aria-label":Y(i)("sheet.close"),onClick:b,onKeydown:un(Ht(b,["prevent"]),["enter"]),onTouchstartPassive:w,onTouchmovePassive:x,onTouchend:C,onTouchcancel:C},null,40,e8),T("div",t8,[(R(!0),$(qe,null,xt(K.value,(P,N)=>(R(),$(qe,{key:P.key||N},[P.divider?(R(),$("div",r8)):(R(),$("button",{key:1,type:"button",class:vt(["fe-ctx__item fe-sheet__item",{"is-danger":P.danger,"is-disabled":P.disabled}]),disabled:P.disabled,role:"menuitem",onClick:X=>B(P)},[P.icon?(R(),$("span",a8,V(P.icon),1)):Te("",!0),T("span",i8,V(P.label),1)],10,n8))],64))),128))])],12,Qx)):(R(),$("div",{key:1,ref_key:"menuEl",ref:u,class:"fe-ctx",role:"menu","aria-orientation":"vertical","aria-label":Y(i)("sheet.menu"),style:Sn({top:l.value+"px",left:s.value+"px"}),onClick:j[1]||(j[1]=Ht(()=>{},["stop"]))},[(R(!0),$(qe,null,xt(K.value,(P,N)=>(R(),$(qe,{key:P.key||N},[P.divider?(R(),$("div",s8)):(R(),$("button",{key:1,type:"button",class:vt(["fe-ctx__item",{"is-danger":P.danger,"is-disabled":P.disabled}]),disabled:P.disabled,role:"menuitem",onClick:X=>B(P)},[P.icon?(R(),$("span",c8,V(P.icon),1)):Te("",!0),T("span",u8,V(P.label),1)],10,l8))],64))),128))],12,o8))],42,Jx)):Te("",!0)]),_:1},8,["name"])]))}}),f8=["title","aria-label"],d8=["title"],p8={class:"fe-btn__label"},h8=["disabled","title","onClick"],v8={class:"fe-icon"},m8={class:"fe-btn__label"},g8=["title","aria-label"],b8={class:"fe-icon"},y8={class:"fe-btn__label"},_8=["title"],x8={class:"fe-btn__label"},w8={class:"fe-toolbar__search-group"},k8={class:"fe-search"},S8=["placeholder","value","aria-label"],C8=["title","aria-label"],E8=["title","aria-label"],A8=["aria-pressed","aria-label","title"],T8={key:0,class:"fe-ficon",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","aria-hidden":"true",focusable:"false"},M8={key:1,class:"fe-ficon",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","aria-hidden":"true",focusable:"false"},D8=["aria-pressed","title","aria-label"],z8=["title","aria-label"],I8=["aria-label"],O8=["aria-selected","title","aria-label"],P8=["aria-selected","title","aria-label"],F8=["aria-selected","title","aria-label"],R8={class:"fe-search fe-search--full"},L8=["placeholder","value","aria-label","onKeydown"],B8=["title","aria-label"],$8=["title","aria-label"],N8=["title","aria-label"],U8=["title","aria-label"],H8=["title","aria-label"],Gv="filex.density",j8=40,G8=Pt({__name:"Toolbar",props:{viewMode:{},searchQuery:{},trashActive:{type:Boolean},actions:{},selectionMode:{},pasteEnabled:{type:Boolean},convertEnabled:{type:Boolean},canGoUp:{type:Boolean},atVirtualRoot:{type:Boolean},canWrite:{type:Boolean},locale:{},narrow:{type:Boolean},theme:{},inspectorOpen:{type:Boolean}},emits:["update:viewMode","update:searchQuery","new-folder","upload","refresh","go-up","action","open-recents","update:density","toggle-inspector","open-theme","open-shortcut-settings"],setup(e,{expose:t,emit:r}){const n=e,a=r,i=re((()=>{try{return localStorage.getItem(Gv)==="compact"?"compact":"comfortable"}catch{return"comfortable"}})());Xt(()=>a("update:density",i.value));function o(){i.value=i.value==="compact"?"comfortable":"compact";try{localStorage.setItem(Gv,i.value)}catch{}a("update:density",i.value)}const{t:s}=br(()=>n.locale),l=re(null),c=re(n.searchQuery);At(()=>n.searchQuery,P=>{c.value=P});let u;function d(P){const N=P.target.value;c.value=N,u&&clearTimeout(u),u=setTimeout(()=>a("update:searchQuery",N),200)}async function f(){var P,N;n.narrow&&!C.value&&(C.value=!0,await Nr()),(P=l.value)==null||P.focus(),(N=l.value)==null||N.select()}t({focusSearch:f});const p=Fe(()=>n.selectionMode??"none"),_=Fe(()=>n.actions.filter(P=>!P.divider&&!P.hidden)),h=re(null),b=re(null),v=re(null),m=re(null),y=re(Number.MAX_SAFE_INTEGER),g=Fe(()=>_.value.slice(0,y.value)),S=Fe(()=>_.value.slice(y.value));function M(){if(n.narrow)return;const P=h.value,N=b.value;if(!P||!N){y.value=_.value.length;return}const X=parseFloat(getComputedStyle(P).gap)||8;let Ee=0;for(const De of Array.from(P.children))De===N||De===v.value||De.classList.contains("fe-btn--fold")||De.offsetWidth>0&&(Ee+=De.offsetWidth+X);const Ae=Array.from(N.children).map(De=>De.offsetWidth+X),ze=Ae.reduce((De,Be)=>De+Be,0),Le=P.clientWidth-Ee;if(ze<=Le){y.value=Ae.length;return}let he=j8+X,Ie=0;for(const De of Ae){if(he+De>Le)break;he+=De,Ie+=1}y.value=Ie}let E;Xt(()=>{typeof ResizeObserver<"u"&&h.value&&(E=new ResizeObserver(()=>M()),E.observe(h.value)),Nr(M)}),tr(()=>E==null?void 0:E.disconnect()),At(()=>[_.value,n.narrow,n.trashActive,p.value],()=>void Nr(M),{deep:!1});function w(){var N,X;const P=(N=v.value)==null?void 0:N.getBoundingClientRect();(X=m.value)==null||X.show({clientX:P?P.right:0,clientY:P?P.bottom+4:0},[])}function x(P){a("action",P)}const C=re(!1);At(()=>n.narrow,P=>{P||(C.value=!1)});async function D(){var P;C.value=!0,await Nr(),(P=l.value)==null||P.focus()}function B(){C.value=!1}const F=re(!1);let K;function te(P){F.value=!!(P&&"matches"in P&&P.matches)}Xt(()=>{var P;typeof window>"u"||!window.matchMedia||(K=window.matchMedia("(pointer: coarse)"),te(K),(P=K.addEventListener)==null||P.call(K,"change",te))}),tr(()=>{var P;(P=K==null?void 0:K.removeEventListener)==null||P.call(K,"change",te)});const J=re(null),ne=re(null),le=Fe(()=>{const P=[],N=!n.trashActive&&!n.atVirtualRoot&&n.canWrite!==!1;return p.value==="none"&&N&&(P.push({key:"new-folder",label:s("toolbar.new_folder"),icon:"📁"}),n.pasteEnabled&&P.push({key:"paste",label:s("ctx.paste"),icon:"📋"})),P.push(..._.value),P.length&&P.push({divider:!0,key:"bag-sep",label:""}),P.push({key:"refresh",label:s("toolbar.refresh"),icon:"↻"}),P.push({key:"density",label:i.value==="compact"?s("toolbar.density.comfortable"):s("toolbar.density.compact"),icon:"⇅"}),n.viewMode!=="list"&&P.push({key:"view-list",label:s("toolbar.view.list"),icon:"☰"}),n.viewMode!=="grid"&&P.push({key:"view-grid",label:s("toolbar.view.grid"),icon:"▦"}),n.viewMode!=="gallery"&&P.push({key:"view-gallery",label:s("toolbar.view.gallery"),icon:"▣"}),P.push({key:"inspector",label:s("toolbar.inspector"),icon:"ℹ"}),P.push({key:"theme",label:s("theme.menu"),icon:"🎨"}),P.push({key:"shortcut-settings",label:s("shortcuts.settings.menu"),icon:"⌨"}),P.push({key:"tour",label:s("tour.restart"),icon:"🎓"}),P});function q(){var N,X;const P=(N=J.value)==null?void 0:N.getBoundingClientRect();(X=ne.value)==null||X.show({clientX:P?P.right:0,clientY:P?P.bottom+4:0},[])}function j(P){var N;switch(P.key){case"new-folder":a("new-folder");break;case"refresh":a("refresh");break;case"density":o();break;case"view-list":a("update:viewMode","list");break;case"view-grid":a("update:viewMode","grid");break;case"view-gallery":a("update:viewMode","gallery");break;case"inspector":a("toggle-inspector");break;case"theme":a("open-theme");break;case"shortcut-settings":a("open-shortcut-settings");break;case"tour":(N=J.value)==null||N.dispatchEvent(new CustomEvent("fe:tour-restart",{bubbles:!0}));break;default:x(P.key)}}return(P,N)=>(R(),$("div",{class:vt(["fe-toolbar",{"fe-toolbar--narrow":e.narrow,"fe-toolbar--searching":e.narrow&&C.value}])},[e.narrow?(R(),$(qe,{key:1},[C.value?(R(),$(qe,{key:0},[T("div",R8,[T("input",{ref_key:"searchEl",ref:l,type:"search",class:"fe-search__input",placeholder:Y(s)("toolbar.search.placeholder"),value:c.value,"aria-label":Y(s)("toolbar.search"),onInput:d,onKeydown:un(Ht(B,["stop","prevent"]),["esc"])},null,40,L8)]),T("button",{type:"button",class:"fe-btn fe-btn--icon-only",title:Y(s)("toolbar.search.close"),"aria-label":Y(s)("toolbar.search.close"),onClick:B},[...N[27]||(N[27]=[T("span",{class:"fe-icon"},"✕",-1)])],8,B8)],64)):(R(),$(qe,{key:1},[e.canGoUp?(R(),$("button",{key:0,type:"button",class:"fe-btn fe-btn--icon-only",title:Y(s)("toolbar.go_up"),"aria-label":Y(s)("toolbar.go_up"),onClick:N[10]||(N[10]=X=>a("go-up"))},[...N[28]||(N[28]=[T("span",{class:"fe-icon"},"↑",-1)])],8,$8)):Te("",!0),N[32]||(N[32]=T("div",{class:"fe-toolbar__spacer"},null,-1)),T("button",{type:"button",class:vt(["fe-btn fe-btn--icon-only fe-toolbar__search-toggle",{"is-active":!!c.value}]),title:Y(s)("toolbar.search"),"aria-label":Y(s)("toolbar.search"),onClick:D},[...N[29]||(N[29]=[T("span",{class:"fe-icon"},"🔍",-1)])],10,N8),!e.atVirtualRoot&&e.canWrite!==!1?(R(),$("button",{key:1,type:"button",class:"fe-btn fe-btn--icon-only",title:Y(s)("toolbar.upload"),"aria-label":Y(s)("toolbar.upload"),onClick:N[11]||(N[11]=X=>a("upload"))},[...N[30]||(N[30]=[T("span",{class:"fe-icon"},"⬆",-1)])],8,U8)):Te("",!0),T("button",{ref_key:"moreBtnEl",ref:J,type:"button",class:"fe-btn fe-btn--icon-only fe-toolbar__more",title:Y(s)("toolbar.more"),"aria-label":Y(s)("toolbar.more"),"aria-haspopup":"menu",onClick:q},[...N[31]||(N[31]=[T("span",{class:"fe-icon"},"⋯",-1)])],8,H8)],64)),Dt(xf,{ref_key:"moreRef",ref:ne,locale:e.locale,theme:e.theme||"auto",sheet:F.value,actions:le.value,onSelect:j},null,8,["locale","theme","sheet","actions"])],64)):(R(),$(qe,{key:0},[T("div",{ref_key:"primaryEl",ref:h,class:"fe-toolbar__primary"},[e.canGoUp?(R(),$("button",{key:0,type:"button",class:"fe-btn fe-btn--icon-only",title:Y(s)("toolbar.go_up"),"aria-label":Y(s)("toolbar.go_up"),onClick:N[0]||(N[0]=X=>a("go-up"))},[...N[13]||(N[13]=[T("span",{class:"fe-icon"},"↑",-1)])],8,f8)):Te("",!0),p.value==="none"&&!e.trashActive&&!e.atVirtualRoot&&e.canWrite!==!1?(R(),$("button",{key:1,type:"button",class:"fe-btn fe-btn--primary",title:Y(s)("toolbar.new_folder"),onClick:N[1]||(N[1]=X=>a("new-folder"))},[N[14]||(N[14]=T("span",{class:"fe-icon"},"📁",-1)),T("span",p8,V(Y(s)("toolbar.new_folder")),1)],8,d8)):Te("",!0),(R(!0),$(qe,null,xt(g.value,X=>(R(),$("button",{key:X.key,type:"button",class:vt(["fe-btn fe-btn--fold",{"fe-btn--danger":X.danger,"is-disabled":X.disabled}]),disabled:X.disabled,title:X.label,onClick:Ee=>x(X.key)},[T("span",v8,V(X.icon),1),T("span",m8,V(X.label),1)],10,h8))),128)),S.value.length>0?(R(),$("button",{key:2,ref_key:"wideMoreBtnEl",ref:v,type:"button",class:"fe-btn fe-btn--icon-only",title:Y(s)("toolbar.more"),"aria-label":Y(s)("toolbar.more"),"aria-haspopup":"menu",onClick:w},[...N[15]||(N[15]=[T("span",{class:"fe-icon"},"⋯",-1)])],8,g8)):Te("",!0),T("div",{ref_key:"measureEl",ref:b,class:"fe-toolbar__measure","aria-hidden":"true"},[(R(!0),$(qe,null,xt(_.value,X=>(R(),$("button",{key:"m-"+X.key,type:"button",class:"fe-btn",tabindex:"-1"},[T("span",b8,V(X.icon),1),T("span",y8,V(X.label),1)]))),128))],512),e.pasteEnabled&&p.value==="none"&&!e.trashActive&&!e.atVirtualRoot&&e.canWrite!==!1?(R(),$("button",{key:3,type:"button",class:"fe-btn",title:Y(s)("ctx.paste"),onClick:N[2]||(N[2]=X=>x("paste"))},[N[16]||(N[16]=T("span",{class:"fe-icon"},"📋",-1)),T("span",x8,V(Y(s)("ctx.paste")),1)],8,_8)):Te("",!0)],512),N[26]||(N[26]=T("div",{class:"fe-toolbar__spacer"},null,-1)),T("div",w8,[T("div",k8,[T("input",{ref_key:"searchEl",ref:l,type:"search",class:"fe-search__input",placeholder:Y(s)("toolbar.search.placeholder"),value:c.value,"aria-label":Y(s)("toolbar.search"),onInput:d},null,40,S8)]),!e.atVirtualRoot&&e.canWrite!==!1?(R(),$("button",{key:0,type:"button",class:"fe-btn fe-btn--icon-only",title:Y(s)("toolbar.upload"),"aria-label":Y(s)("toolbar.upload"),onClick:N[3]||(N[3]=X=>a("upload"))},[...N[17]||(N[17]=[T("span",{class:"fe-icon","aria-hidden":"true"},"⬆",-1)])],8,C8)):Te("",!0),T("button",{type:"button",class:"fe-btn fe-btn--icon-only",title:Y(s)("toolbar.refresh"),"aria-label":Y(s)("toolbar.refresh"),onClick:N[4]||(N[4]=X=>a("refresh"))},[...N[18]||(N[18]=[T("span",{class:"fe-icon","aria-hidden":"true"},"↻",-1)])],8,E8)]),T("button",{type:"button",class:vt(["fe-btn fe-btn--icon-only fe-toolbar__density",{"is-active":i.value==="compact"}]),"aria-pressed":i.value==="compact","aria-label":i.value==="compact"?Y(s)("toolbar.density.comfortable"):Y(s)("toolbar.density.compact"),title:i.value==="compact"?Y(s)("toolbar.density.comfortable"):Y(s)("toolbar.density.compact"),onClick:o},[i.value==="compact"?(R(),$("svg",T8,[...N[19]||(N[19]=[T("path",{d:"M4 6.5h16M4 10.5h16M4 14.5h16M4 18.5h16"},null,-1)])])):(R(),$("svg",M8,[...N[20]||(N[20]=[T("path",{d:"M4 5.5h16M4 12h16M4 18.5h16"},null,-1)])]))],10,A8),T("button",{type:"button",class:vt(["fe-btn fe-btn--icon-only fe-toolbar__inspector",{"is-active":e.inspectorOpen}]),"aria-pressed":!!e.inspectorOpen,title:Y(s)("toolbar.inspector"),"aria-label":Y(s)("toolbar.inspector"),onClick:N[5]||(N[5]=X=>a("toggle-inspector"))},[...N[21]||(N[21]=[T("svg",{class:"fe-ficon",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","aria-hidden":"true",focusable:"false"},[T("circle",{cx:"12",cy:"12",r:"9"}),T("path",{d:"M12 11v5"}),T("circle",{cx:"12",cy:"7.6",r:"1",fill:"currentColor",stroke:"none"})],-1)])],10,D8),T("button",{type:"button",class:"fe-btn fe-btn--icon-only fe-toolbar__theme",title:Y(s)("theme.menu"),"aria-label":Y(s)("theme.menu"),onClick:N[6]||(N[6]=X=>a("open-theme"))},[...N[22]||(N[22]=[T("svg",{class:"fe-ficon",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true",focusable:"false"},[T("path",{d:"M12 3a9 9 0 1 0 0 18h1.4a2.1 2.1 0 0 0 1.5-3.6 2.1 2.1 0 0 1 1.5-3.6H19a2 2 0 0 0 2-2A9 9 0 0 0 12 3z"}),T("circle",{cx:"7.8",cy:"10.2",r:"1.15",fill:"currentColor",stroke:"none"}),T("circle",{cx:"11.6",cy:"7.2",r:"1.15",fill:"currentColor",stroke:"none"}),T("circle",{cx:"16",cy:"8.6",r:"1.15",fill:"currentColor",stroke:"none"})],-1)])],8,z8),T("div",{class:"fe-toolbar__view",role:"tablist","aria-label":Y(s)("toolbar.view_label")},[T("button",{type:"button",class:vt(["fe-btn fe-btn--icon-only",{"is-active":e.viewMode==="list"}]),role:"tab","aria-selected":e.viewMode==="list",title:Y(s)("toolbar.view.list"),"aria-label":Y(s)("toolbar.view.list"),onClick:N[7]||(N[7]=X=>a("update:viewMode","list"))},[...N[23]||(N[23]=[T("span",{class:"fe-icon","aria-hidden":"true"},"☰",-1)])],10,O8),T("button",{type:"button",class:vt(["fe-btn fe-btn--icon-only",{"is-active":e.viewMode==="grid"}]),role:"tab","aria-selected":e.viewMode==="grid",title:Y(s)("toolbar.view.grid"),"aria-label":Y(s)("toolbar.view.grid"),onClick:N[8]||(N[8]=X=>a("update:viewMode","grid"))},[...N[24]||(N[24]=[T("span",{class:"fe-icon","aria-hidden":"true"},"▦",-1)])],10,P8),T("button",{type:"button",class:vt(["fe-btn fe-btn--icon-only",{"is-active":e.viewMode==="gallery"}]),role:"tab","aria-selected":e.viewMode==="gallery",title:Y(s)("toolbar.view.gallery"),"aria-label":Y(s)("toolbar.view.gallery"),onClick:N[9]||(N[9]=X=>a("update:viewMode","gallery"))},[...N[25]||(N[25]=[T("span",{class:"fe-icon","aria-hidden":"true"},"▣",-1)])],10,F8)],8,I8)],64)),e.narrow?Te("",!0):(R(),Zt(xf,{key:2,ref_key:"wideMoreRef",ref:m,locale:e.locale,theme:e.theme||"auto",sheet:!1,actions:S.value,onSelect:N[12]||(N[12]=X=>x(X.key))},null,8,["locale","theme","actions"]))],2))}}),V8=["onClick"],q8=fn(Pt({__name:"TagPicker",props:{nodeId:{},apiBase:{},authHeaders:{type:Function},palette:{}},emits:["change","error"],setup(e,{emit:t}){const r=e,n=t,a=re([]),i=re(!1),o=re(!1),s=re(""),l=Fe(()=>r.palette??["#ef4444","#f59e0b","#10b981","#3b82f6","#8b5cf6","#ec4899","#14b8a6","#f97316"]);function c(h){let b=0;for(let m=0;m<h.length;m++)b=b*31+h.charCodeAt(m)|0;const v=l.value;return v[Math.abs(b)%v.length]}async function u(h={}){return{...await(r.authHeaders??(()=>({})))(),...h}}async function d(){i.value=!0;try{const h=r.apiBase??"",b=await fetch(`${h}/api/files/manager/tags?node_id=${r.nodeId}`,{headers:await u(),credentials:"include"});if(b.ok){const v=await b.json();a.value=Array.isArray(v.tags)?v.tags:[]}}catch(h){n("error",h instanceof Error?h.message:String(h))}finally{i.value=!1}}async function f(h){const b=[...a.value];a.value=h;try{const v=r.apiBase??"",m=await fetch(`${v}/api/files/manager/tags`,{method:"POST",headers:await u({"Content-Type":"application/json"}),credentials:"include",body:JSON.stringify({node_id:r.nodeId,tags:h})});if(!m.ok)throw new Error(`tag save failed: ${m.status}`);n("change",h)}catch(v){a.value=b,n("error",v instanceof Error?v.message:String(v))}}function p(){const h=s.value.trim();if(!h||a.value.includes(h)){s.value="",o.value=!1;return}f([...a.value,h]),s.value="",o.value=!1}function _(h){f(a.value.filter(b=>b!==h))}return Xt(d),At(()=>r.nodeId,d),(h,b)=>(R(),$("div",{class:vt(["filex-tag-picker",{"is-loading":i.value}])},[(R(!0),$(qe,null,xt(a.value,v=>(R(),$("span",{key:v,class:"filex-tag",style:Sn({"--filex-tag-color":c(v)})},[$t(V(v)+" ",1),T("button",{class:"filex-tag-x",type:"button",onClick:m=>_(v),"aria-label":"Remove tag"},"×",8,V8)],4))),128)),o.value?(R(),$("form",{key:0,class:"filex-tag-add",onSubmit:Ht(p,["prevent"])},[Yt(T("input",{"onUpdate:modelValue":b[0]||(b[0]=v=>s.value=v),autofocus:"",placeholder:"tag name",onBlur:p,onKeydown:b[1]||(b[1]=un(v=>{o.value=!1,s.value=""},["escape"]))},null,544),[[Ir,s.value]])],32)):(R(),$("button",{key:1,class:"filex-tag-add-btn",type:"button",onClick:b[2]||(b[2]=v=>o.value=!0)},"+ Add tag"))],2))}}),[["__scopeId","data-v-f2104118"]]),K8={class:"filex-recent"},W8=["disabled"],Y8={key:0},X8=["onClick"],Z8={class:"filex-recent-name"},J8={class:"filex-recent-meta"},Q8={key:1,class:"filex-recent-empty"},e7={key:2,class:"filex-recent-empty"},t7=fn(Pt({__name:"RecentlyOpened",props:{apiBase:{},authHeaders:{type:Function},limit:{},refreshKey:{}},emits:["open","error"],setup(e,{emit:t}){const r=e,n=t,a=re([]),i=re(!1);async function o(){i.value=!0;try{const l=await(r.authHeaders??(()=>({})))(),c=r.apiBase??"",u=r.limit??20,d=await fetch(`${c}/api/files/manager/recent?limit=${u}`,{headers:l,credentials:"include"});if(d.ok){const f=await d.json();a.value=Array.isArray(f.entries)?f.entries:Array.isArray(f)?f:[]}}catch(l){n("error",l instanceof Error?l.message:String(l))}finally{i.value=!1}}function s(l){if(!l)return"";const c=new Date(l).getTime();if(Number.isNaN(c))return"";const u=Date.now()-c;return u<6e4?"just now":u<36e5?`${Math.floor(u/6e4)}m ago`:u<864e5?`${Math.floor(u/36e5)}h ago`:`${Math.floor(u/864e5)}d ago`}return Xt(o),At(()=>r.refreshKey,o),(l,c)=>(R(),$("div",K8,[T("header",null,[c[0]||(c[0]=T("h3",null,"Recently opened",-1)),T("button",{class:"filex-recent-refresh",type:"button",onClick:o,disabled:i.value}," ↻ ",8,W8)]),a.value.length?(R(),$("ul",Y8,[(R(!0),$(qe,null,xt(a.value,u=>(R(),$("li",{key:u.id},[T("button",{type:"button",onClick:d=>n("open",u),class:"filex-recent-item"},[T("span",Z8,V(u.name),1),T("span",J8,V(s(u.last_opened)),1)],8,X8)]))),128))])):i.value?(R(),$("p",e7,"Loading…")):(R(),$("p",Q8,"Nothing here yet."))]))}}),[["__scopeId","data-v-ff50baed"]]),r7={class:"fe-breadcrumb","aria-label":"Breadcrumb"},n7=["aria-current","onClick","onContextmenu","onDrop"],a7={key:0,class:"fe-breadcrumb__sep","aria-hidden":"true"},i7=["aria-expanded","aria-label","title"],o7={key:0,class:"fe-breadcrumb__menu",role:"menu"},s7=["onClick"],l7=["aria-current","onClick","onContextmenu","onDrop"],c7={key:0,class:"fe-breadcrumb__sep","aria-hidden":"true"},u7=["title","aria-label"],f7=["placeholder","onKeydown"],d7=4,p7=Pt({__name:"Breadcrumb",props:{dirname:{},adapter:{},rootLabel:{},locale:{},multiStorageRoot:{type:Boolean},rootPath:{}},emits:["navigate","copy-path","crumb-context","crumb-drop"],setup(e,{emit:t}){const r=e,n=Fe(()=>{if(!r.rootPath)return"";const D=r.rootPath,B=D.indexOf("://");return(B>=0?D.slice(B+3):D).replace(/^\/+|\/+$/g,"")}),a=Fe(()=>{const D=n.value;if(!D)return r.rootLabel||r.adapter;const B=D.split("/");return B[B.length-1]||r.rootLabel||r.adapter}),{t:i}=br(()=>r.locale),o=t,s=Fe(()=>{const D=`${r.adapter}://`,B=r.dirname.startsWith(D)?r.dirname.slice(D.length):r.dirname,F=B.split("/").filter(Boolean),K=[];if(r.rootPath){const J=n.value,ne=B.replace(/^\/+|\/+$/g,""),le=J&&(ne===J||ne.startsWith(J+"/"))?ne.slice(J.length).replace(/^\/+/,""):"";K.push({label:a.value,adapterPath:r.rootPath});let q=J;for(const j of le.split("/").filter(Boolean))q=q?`${q}/${j}`:j,K.push({label:j===".trash"?i("node.trash"):j,adapterPath:`${D}${q}`});return K}r.multiStorageRoot?(K.push({label:"/",adapterPath:""}),r.adapter&&K.push({label:r.rootLabel||r.adapter,adapterPath:D})):K.push({label:r.rootLabel||r.adapter,adapterPath:D});let te="";for(const J of F){te=te?`${te}/${J}`:J;const ne=J===".trash"?i("node.trash"):J;K.push({label:ne,adapterPath:`${D}${te}`})}return K}),l=Fe(()=>s.value.length>d7),c=Fe(()=>l.value?s.value.slice(0,1):s.value),u=Fe(()=>l.value?s.value.slice(1,-2):[]),d=Fe(()=>l.value?s.value.slice(-2):[]),f=re(!1),p=re(null);function _(D){f.value=!1,o("navigate",D.adapterPath)}function h(D){const B=p.value;B&&D.target instanceof Node&&B.contains(D.target)||(f.value=!1)}function b(D){D.key==="Escape"&&(D.stopPropagation(),f.value=!1)}At(f,D=>{D?(document.addEventListener("click",h,!0),document.addEventListener("keydown",b,!0)):(document.removeEventListener("click",h,!0),document.removeEventListener("keydown",b,!0))}),At(s,()=>{f.value=!1}),tr(()=>{document.removeEventListener("click",h,!0),document.removeEventListener("keydown",b,!0)});function v(D){o("navigate",D.adapterPath)}function m(D,B){D.preventDefault(),D.stopPropagation(),o("crumb-context",{x:D.clientX,y:D.clientY,adapterPath:B.adapterPath,label:B.label})}function y(D){var B;(B=D.dataTransfer)!=null&&B.types.includes("application/x-brf-files")&&(D.preventDefault(),D.stopPropagation(),D.dataTransfer&&(D.dataTransfer.dropEffect="move"))}function g(D,B){var F;(F=D.dataTransfer)!=null&&F.types.includes("application/x-brf-files")&&(D.preventDefault(),D.stopPropagation(),o("crumb-drop",B.adapterPath,D))}const S=re(!1),M=re(""),E=re(null);function w(){const D=`${r.adapter}://`,B=r.dirname.startsWith(D)?r.dirname.slice(D.length):r.dirname;if(r.rootPath){const F=n.value,K=B.replace(/^\/+|\/+$/g,""),te=F&&(K===F||K.startsWith(F+"/"))?K.slice(F.length).replace(/^\/+/,""):"";M.value=te?`/${te}`:"/",S.value=!0,Nr(()=>{var J,ne;(J=E.value)==null||J.focus(),(ne=E.value)==null||ne.select()});return}if(r.multiStorageRoot)if(!r.adapter)M.value="/";else{const F=B.replace(/^\/+|\/+$/g,"");M.value=F?`/${r.adapter}/${F}`:`/${r.adapter}`}else M.value=B;S.value=!0,Nr(()=>{var F,K;(F=E.value)==null||F.focus(),(K=E.value)==null||K.select()})}function x(){const D=M.value.trim();if(S.value=!1,r.rootPath){const F=D.replace(/^\/+|\/+$/g,""),K=n.value,te=F?K?`${K}/${F}`:F:K;o("navigate",te?`${r.adapter}://${te}`:`${r.adapter}://`);return}if(r.multiStorageRoot){const F=D.replace(/^\/+|\/+$/g,"");if(!F){o("navigate","");return}const K=F.indexOf("/"),te=K===-1?F:F.slice(0,K),J=K===-1?"":F.slice(K+1);o("navigate",J?`${te}://${J}`:`${te}://`);return}const B=D.replace(/^\/+|\/+$/g,"");B&&o("navigate",`${r.adapter}://${B}`)}function C(){S.value=!1}return(D,B)=>(R(),$("nav",r7,[S.value?Yt((R(),$("input",{key:1,ref_key:"pathInput",ref:E,"onUpdate:modelValue":B[1]||(B[1]=F=>M.value=F),type:"text",class:"fe-breadcrumb__input",placeholder:Y(i)("breadcrumb.path_placeholder"),spellcheck:"false",autocomplete:"off",onKeydown:[un(Ht(x,["prevent"]),["enter"]),un(Ht(C,["prevent"]),["escape"])],onBlur:C},null,40,f7)),[[Ir,M.value]]):(R(),$(qe,{key:0},[(R(!0),$(qe,null,xt(c.value,(F,K)=>(R(),$("button",{key:F.adapterPath,class:vt(["fe-breadcrumb__crumb",{"is-last":!l.value&&K===c.value.length-1}]),type:"button","aria-current":!l.value&&K===c.value.length-1?"page":void 0,onClick:te=>v(F),onContextmenu:te=>m(te,F),onDragover:y,onDrop:te=>g(te,F)},[T("span",null,V(F.label),1),l.value||K<c.value.length-1?(R(),$("span",a7,"›")):Te("",!0)],42,n7))),128)),u.value.length?(R(),$("span",{key:0,ref_key:"moreWrapEl",ref:p,class:"fe-breadcrumb__more-wrap"},[T("button",{type:"button",class:"fe-breadcrumb__more","aria-haspopup":"menu","aria-expanded":f.value,"aria-label":Y(i)("breadcrumb.more"),title:Y(i)("breadcrumb.more"),onClick:B[0]||(B[0]=F=>f.value=!f.value)},"…",8,i7),B[2]||(B[2]=T("span",{class:"fe-breadcrumb__sep","aria-hidden":"true"},"›",-1)),f.value?(R(),$("div",o7,[(R(!0),$(qe,null,xt(u.value,F=>(R(),$("button",{key:F.adapterPath,type:"button",class:"fe-breadcrumb__menu-item",role:"menuitem",onClick:K=>_(F)},V(F.label),9,s7))),128))])):Te("",!0)],512)):Te("",!0),(R(!0),$(qe,null,xt(d.value,(F,K)=>(R(),$("button",{key:F.adapterPath,class:vt(["fe-breadcrumb__crumb",{"is-last":K===d.value.length-1}]),type:"button","aria-current":K===d.value.length-1?"page":void 0,onClick:te=>v(F),onContextmenu:te=>m(te,F),onDragover:y,onDrop:te=>g(te,F)},[T("span",null,V(F.label),1),K<d.value.length-1?(R(),$("span",c7,"›")):Te("",!0)],42,l7))),128)),T("button",{type:"button",class:"fe-breadcrumb__edit",title:Y(i)("breadcrumb.go_to_path"),"aria-label":Y(i)("breadcrumb.go_to_path"),onClick:w},"✏",8,u7)],64))]))}}),Vv={};function Aa(e,t){for(const r of t)Vv[r]=e}Aa("image",["jpg","jpeg","png","webp","gif","bmp","avif","heic","svg","ico","tiff","tif"]),Aa("video",["mp4","webm","mov","mkv","avi","ogv","m4v"]),Aa("audio",["mp3","wav","flac","ogg","m4a","aac","opus"]),Aa("pdf",["pdf"]),Aa("doc",["doc","docx","odt","rtf"]),Aa("sheet",["xls","xlsx","ods","csv"]),Aa("slides",["ppt","pptx","odp"]),Aa("archive",["zip","tar","gz","bz2","7z","rar","xz","zst"]),Aa("code",["js","ts","jsx","tsx","mjs","cjs","vue","py","go","rs","php","rb","java","kt","swift","c","cpp","h","hpp","cs","css","scss","less","html","htm","json","yml","yaml","xml","sh","bash","ps1","sql","toml"]),Aa("text",["txt","md","markdown","log","ini","conf","cfg","env"]);function h7(e){if(e.type==="dir")return"folder";const t=(e.extension||"").toLowerCase();return Vv[t]??"unknown"}const Ai='<path d="M6.5 3h7L18.5 8v11.5a1.5 1.5 0 0 1-1.5 1.5H6.5A1.5 1.5 0 0 1 5 19.5v-15A1.5 1.5 0 0 1 6.5 3z"/><path d="M13.5 3v5h5"/>',v7={folder:'<path d="M3 7a2 2 0 0 1 2-2h4.2l2 2.4H19a2 2 0 0 1 2 2V17a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z" fill="currentColor" fill-opacity="0.14"/>',image:'<rect x="3" y="5" width="18" height="14" rx="2"/><circle cx="8.6" cy="10" r="1.6"/><path d="M5.2 16.6l4.3-4.3 3 3 2.4-2.4 3.9 3.7"/>',video:'<rect x="3" y="5" width="18" height="14" rx="2"/><path d="M10.2 9.3v5.4l4.8-2.7z" fill="currentColor" stroke="none"/>',audio:'<path d="M9 17.5V7.2l9-2.2v10.4"/><circle cx="6.8" cy="17.6" r="2.2"/><circle cx="15.8" cy="15.5" r="2.2"/>',pdf:Ai+'<rect x="7.5" y="12" width="9" height="5" rx="1" fill="currentColor" fill-opacity="0.14"/>',doc:Ai+'<path d="M8.5 13h7M8.5 16h7"/>',sheet:Ai+'<path d="M8 12.5h8M8 15.5h8M8 18h8M12 12.5V18"/>',slides:Ai+'<rect x="8" y="12.5" width="8" height="5" rx="0.8"/>',archive:Ai+'<path d="M10 3v1.6M10 6.6v1.6M10 10.2v1.6"/><rect x="8.6" y="14" width="2.8" height="3.4" rx="0.8"/>',code:Ai+'<path d="M10.4 12.5L8.3 15l2.1 2.5M13.6 12.5l2.1 2.5-2.1 2.5"/>',text:Ai+'<path d="M8.5 12h7M8.5 15h7M8.5 18h4.5"/>',unknown:Ai+'<path d="M10.3 13.1a1.8 1.8 0 1 1 2.5 1.9c-.6.3-.8.7-.8 1.4"/><circle cx="12" cy="18.4" r="0.9" fill="currentColor" stroke="none"/>'},qv=new Map;function m7(e){let t=qv.get(e);return t||(t=`<svg class="fe-ficon fe-ficon--${e}" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false">${v7[e]}</svg>`,qv.set(e,t)),t}function Uo(e){return m7(h7(e))}function F0(e){const t=[];if(!e)return t;const r=/«([^«»]*)»/g;let n=0,a;for(;(a=r.exec(e))!==null;)a.index>n&&t.push({text:e.slice(n,a.index),match:!1}),a[1]&&t.push({text:a[1],match:!0}),n=a.index+a[0].length;return n<e.length&&t.push({text:e.slice(n),match:!1}),t}function Kv(e){return e==="content"||e==="both"}function wf(e,t,r){const n=e.dataTransfer;if(!(!n||typeof document>"u"||typeof n.setDragImage!="function"))try{const a=document.createElement("div");a.className="fe-dragghost";const i=document.createElement("span");if(i.className="fe-dragghost__name",i.textContent=t,a.appendChild(i),r>1){const o=document.createElement("span");o.className="fe-dragghost__badge",o.textContent=String(r),a.appendChild(o)}a.style.position="fixed",a.style.top="-1000px",a.style.left="-1000px",document.body.appendChild(a),n.setDragImage(a,14,14),setTimeout(()=>a.remove(),0)}catch{}}const g7=["aria-pressed","title"],b7={viewBox:"0 0 24 24",width:"16",height:"16","aria-hidden":"true"},y7=["fill"],_7={key:0,class:"filex-star-label"},x7=fn(Pt({__name:"StarButton",props:{starred:{type:Boolean},nodeId:{},apiBase:{},authHeaders:{type:Function},compact:{type:Boolean}},emits:["change","error"],setup(e,{emit:t}){const r=e,n=t,a=re(r.starred);At(()=>r.starred,o=>{a.value=o});async function i(){const o=!a.value;a.value=o;try{const s={"Content-Type":"application/json",...await(r.authHeaders??(()=>({})))()},l=r.apiBase??"",c=await fetch(`${l}/api/files/manager/star`,{method:"POST",headers:s,credentials:"include",body:JSON.stringify({node_id:r.nodeId,starred:o})});if(!c.ok)throw new Error(`star toggle failed: ${c.status}`);n("change",o)}catch(s){a.value=!o,n("error",s instanceof Error?s.message:String(s))}}return(o,s)=>(R(),$("button",{type:"button",class:vt(["filex-star-btn",{"is-starred":a.value,"is-compact":e.compact}]),"aria-pressed":a.value,title:a.value?"Unstar":"Star",onClick:Ht(i,["stop"])},[(R(),$("svg",b7,[T("path",{fill:a.value?"currentColor":"none",stroke:"currentColor","stroke-width":"2","stroke-linejoin":"round",d:"M12 2.5l3.09 6.26 6.91 1-5 4.87 1.18 6.87L12 18.27l-6.18 3.23L7 14.63 2 9.76l6.91-1z"},null,8,y7)])),e.compact?Te("",!0):(R(),$("span",_7,V(a.value?"Starred":"Star"),1))],10,g7))}}),[["__scopeId","data-v-1b788147"]]),w7=["aria-label","aria-busy"],k7={class:"fe-list__head",role:"row"},S7=["aria-label"],C7=["aria-sort"],E7=["title"],A7={key:0,class:"fe-list__sort-arrow","aria-hidden":"true"},T7=["aria-sort"],M7=["title"],D7={key:0,class:"fe-list__sort-arrow","aria-hidden":"true"},z7=["aria-sort"],I7=["title"],O7={key:0,class:"fe-list__sort-arrow","aria-hidden":"true"},P7={class:"fe-list__body",role:"rowgroup"},F7={key:0,class:"fe-list__group",role:"presentation"},R7=["aria-selected","aria-label","data-fe-path","onClick","onDblclick","onContextmenu","onDragstart","onDragover","onDragleave","onDrop","onTouchstartPassive"],L7={class:"fe-list__col fe-list__col--name",role:"gridcell"},B7={key:0,class:"fe-list__icon","aria-hidden":"true"},$7=["innerHTML"],N7={class:"fe-list__name-wrap"},U7=["title"],H7={key:0,class:"fe-list__badge"},j7=["title"],G7={key:1,class:"fe-list__snippet"},V7={key:0,class:"fe-list__mark"},q7={class:"fe-list__col fe-list__col--size",role:"gridcell"},K7={class:"fe-list__col fe-list__col--mod",role:"gridcell"},W7={key:0,class:"fe-list__empty"},Wv="filex.list-sort",Yv=Pt({__name:"ListView",props:{files:{},selected:{},clipped:{},showParentPath:{type:Boolean},locale:{},loading:{type:Boolean},starredIds:{},apiBase:{},authHeaders:{type:Function}},emits:["click-row","dbl-row","context-row","item-drag-start","item-drop-into","star-change"],setup(e,{emit:t}){const r=e,n=t,{t:a,formatSize:i,nodeDisplayName:o}=br(()=>r.locale);function s(j){return r.selected.has(j.path)}function l(j,P){n("click-row",j,{ctrl:P.ctrlKey||P.metaKey,shift:P.shiftKey})}function c(j){n("dbl-row",j)}function u(j,P){P.preventDefault(),P.stopPropagation(),n("context-row",j,P)}function d(j,P){wf(P,o(j),r.selected.has(j.path)?r.selected.size:1),n("item-drag-start",j,P)}const f=re(null);function p(j,P){var N;j.type==="dir"&&(N=P.dataTransfer)!=null&&N.types.includes("application/x-brf-files")&&(P.preventDefault(),P.stopPropagation(),P.dataTransfer&&(P.dataTransfer.dropEffect="move"),f.value=j.path)}function _(j){f.value===j.path&&(f.value=null)}function h(j,P){var N;f.value=null,j.type==="dir"&&(N=P.dataTransfer)!=null&&N.types.includes("application/x-brf-files")&&(P.preventDefault(),P.stopPropagation(),n("item-drop-into",j,P))}let b,v=null;function m(j,P){v=j,b&&clearTimeout(b),b=setTimeout(()=>{if(v){const N=P.touches[0];n("context-row",v,{clientX:N.clientX,clientY:N.clientY,preventDefault:()=>{}})}},500)}function y(){b&&clearTimeout(b),v=null}function g(j){return j.basename===".trash"?"🗑":j.mime_type==="inode/storage"?"💾":j.type==="dir"&&j.e2e===!0?"🔒":null}function S(j){return j.basename===".trash"||j.mime_type==="inode/storage"}function M(j){return j?new Date(j*(j<1e12?1e3:1)).toLocaleString():"—"}function E(j){const P=j.replace(/^[a-z][a-z0-9+.-]*:\/\//i,""),N=P.lastIndexOf("/");return N===-1?"":P.slice(0,N)}function w(j){const P=j.snippet;return typeof P=="string"?P:""}function x(j){return Kv(j.matched)}const C=re(null),D=re("asc");try{const j=localStorage.getItem(Wv);if(j){const P=JSON.parse(j);(P.key==="name"||P.key==="size"||P.key==="modified")&&(C.value=P.key),(P.dir==="asc"||P.dir==="desc")&&(D.value=P.dir)}}catch{}function B(j){return j==="modified"?"desc":"asc"}function F(j){C.value!==j?(C.value=j,D.value=B(j)):D.value===B(j)?D.value=D.value==="asc"?"desc":"asc":C.value=null;try{localStorage.setItem(Wv,JSON.stringify({key:C.value,dir:D.value}))}catch{}}function K(j){return C.value!==j?"none":D.value==="asc"?"ascending":"descending"}function te(j){const P=j.last_modified;return P?P*(P<1e12?1e3:1):null}const J=Fe(()=>{const j=C.value;if(!j)return r.files;const P=[],N=[];for(const Ee of r.files)(S(Ee)?P:N).push(Ee);const X=D.value==="asc"?1:-1;return N.sort((Ee,Ae)=>{if(j==="name")return X*Ee.basename.localeCompare(Ae.basename,void 0,{numeric:!0,sensitivity:"base"});if(j==="size")return X*((Ee.size??-1)-(Ae.size??-1));const ze=te(Ee),Le=te(Ae);return ze==null&&Le==null?0:ze==null?1:Le==null?-1:X*(ze-Le)}),[...P,...N]}),ne=Fe(()=>new Intl.DateTimeFormat(r.locale==="tr"?"tr-TR":"en-US",{month:"long",year:"numeric"}));function le(j){if(j==null)return{id:"none",label:a("group.no_date")};const P=new Date(j),N=new Date,X=Le=>new Date(Le.getFullYear(),Le.getMonth(),Le.getDate()).getTime(),Ee=X(N),Ae=X(P),ze=864e5;return Ae>=Ee?{id:"today",label:a("group.today")}:Ae===Ee-ze?{id:"yesterday",label:a("group.yesterday")}:Ae>Ee-7*ze?{id:"week",label:a("group.this_week")}:P.getFullYear()===N.getFullYear()&&P.getMonth()===N.getMonth()?{id:"month",label:a("group.this_month")}:{id:`m-${P.getFullYear()}-${P.getMonth()}`,label:ne.value.format(P)}}const q=Fe(()=>{const j=J.value;if(C.value!=="modified")return[{id:"all",label:null,nodes:j}];const P=[];let N=null;for(const X of j){const Ee=S(X)?{id:"pinned",label:null}:le(te(X));(!N||N.id!==Ee.id)&&(N={id:Ee.id,label:Ee.label,nodes:[]},P.push(N)),N.nodes.push(X)}return P});return(j,P)=>(R(),$("div",{class:vt(["fe-list",{"is-loading":e.loading,"has-star-col":!!e.apiBase||e.apiBase===""}]),role:"grid","aria-label":Y(a)("list.aria"),"aria-busy":e.loading?"true":void 0},[T("div",k7,[T("div",{class:"fe-list__col fe-list__col--star",role:"columnheader","aria-label":Y(a)("col.star")},null,8,S7),T("div",{class:"fe-list__col fe-list__col--name",role:"columnheader","aria-sort":K("name")},[T("button",{type:"button",class:"fe-list__sort",title:Y(a)("col.sort"),onClick:P[0]||(P[0]=N=>F("name"))},[$t(V(Y(a)("col.name"))+" ",1),C.value==="name"?(R(),$("span",A7,V(D.value==="asc"?"↑":"↓"),1)):Te("",!0)],8,E7)],8,C7),T("div",{class:"fe-list__col fe-list__col--size",role:"columnheader","aria-sort":K("size")},[T("button",{type:"button",class:"fe-list__sort",title:Y(a)("col.sort"),onClick:P[1]||(P[1]=N=>F("size"))},[$t(V(Y(a)("col.size"))+" ",1),C.value==="size"?(R(),$("span",D7,V(D.value==="asc"?"↑":"↓"),1)):Te("",!0)],8,M7)],8,T7),T("div",{class:"fe-list__col fe-list__col--mod",role:"columnheader","aria-sort":K("modified")},[T("button",{type:"button",class:"fe-list__sort",title:Y(a)("col.sort"),onClick:P[2]||(P[2]=N=>F("modified"))},[$t(V(Y(a)("col.modified"))+" ",1),C.value==="modified"?(R(),$("span",O7,V(D.value==="asc"?"↑":"↓"),1)):Te("",!0)],8,I7)],8,z7)]),T("div",P7,[(R(!0),$(qe,null,xt(q.value,N=>(R(),$(qe,{key:N.id},[N.label?(R(),$("div",F7,V(N.label),1)):Te("",!0),(R(!0),$(qe,null,xt(N.nodes,X=>{var Ee,Ae;return R(),$("div",{key:X.path,class:vt(["fe-list__row",{"is-selected":s(X),"is-dir":X.type==="dir","is-trash":X.trashed,"is-clipped":(Ee=e.clipped)==null?void 0:Ee.has(X.path),"is-droptarget":f.value===X.path}]),role:"row",tabindex:"0","aria-selected":s(X)?"true":"false","aria-label":Y(o)(X),"data-fe-path":X.path,draggable:"true",onClick:ze=>l(X,ze),onDblclick:ze=>c(X),onContextmenu:ze=>u(X,ze),onDragstart:ze=>d(X,ze),onDragover:ze=>p(X,ze),onDragleave:ze=>_(X),onDrop:ze=>h(X,ze),onTouchstartPassive:ze=>m(X,ze),onTouchend:y,onTouchmove:y},[T("div",{class:"fe-list__col fe-list__col--star",role:"gridcell",onClick:P[3]||(P[3]=Ht(()=>{},["stop"]))},[typeof X.id=="number"&&X.type==="file"?(R(),Zt(x7,{key:0,starred:!!((Ae=e.starredIds)!=null&&Ae.has(X.id)),"node-id":X.id,"api-base":e.apiBase,"auth-headers":e.authHeaders,compact:"",onChange:ze=>n("star-change",X,ze)},null,8,["starred","node-id","api-base","auth-headers","onChange"])):Te("",!0)]),T("div",L7,[g(X)?(R(),$("span",B7,V(g(X)),1)):(R(),$("span",{key:1,class:"fe-list__icon fe-list__icon--svg","aria-hidden":"true",innerHTML:Y(Uo)(X)},null,8,$7)),T("div",N7,[T("span",{class:"fe-list__name",title:X.basename},[$t(V(Y(o)(X))+" ",1),x(X)?(R(),$("span",H7,V(Y(a)("search.in_content")),1)):Te("",!0)],8,U7),e.showParentPath?(R(),$("span",{key:0,class:"fe-list__parent",title:E(X.path)},V(E(X.path)||"—"),9,j7)):Te("",!0),w(X)?(R(),$("span",G7,[(R(!0),$(qe,null,xt(Y(F0)(w(X)),(ze,Le)=>(R(),$(qe,{key:Le},[ze.match?(R(),$("mark",V7,V(ze.text),1)):(R(),$(qe,{key:1},[$t(V(ze.text),1)],64))],64))),128))])):Te("",!0)])]),T("div",q7,V(Y(i)(X.size)),1),T("div",K7,V(M(X.last_modified)),1)],42,R7)}),128))],64))),128)),!e.loading&&J.value.length===0?(R(),$("div",W7,V(Y(a)("empty.folder")),1)):Te("",!0)])],10,w7))}}),Y7=["aria-label","aria-busy"],X7=["aria-selected","aria-label","data-fe-path","onClick","onDblclick","onContextmenu","onDragstart","onDragover","onDragleave","onDrop","onTouchstartPassive"],Z7={class:"fe-grid__thumb"},J7=["src","alt"],Q7={key:1,class:"fe-grid__icon"},ew=["innerHTML"],tw=["title"],rw=["title"],nw={class:"fe-grid__meta"},aw=["title"],iw={key:0,class:"fe-grid__mark"},ow={key:0,class:"fe-grid__empty"},Xv=Pt({__name:"GridView",props:{files:{},selected:{},clipped:{},showParentPath:{type:Boolean},locale:{},loading:{type:Boolean},thumbSrc:{type:Function}},emits:["click-card","dbl-card","context-card","item-drag-start","item-drop-into"],setup(e,{emit:t}){const r=e,n=t,{t:a,formatSize:i,nodeDisplayName:o}=br(()=>r.locale);function s(x){return r.thumbSrc?r.thumbSrc(x):x.thumb_url??null}function l(x){return r.selected.has(x.path)}function c(x,C){n("click-card",x,{ctrl:C.ctrlKey||C.metaKey,shift:C.shiftKey})}function u(x){n("dbl-card",x)}function d(x,C){C.preventDefault(),C.stopPropagation(),n("context-card",x,C)}function f(x,C){wf(C,o(x),r.selected.has(x.path)?r.selected.size:1),n("item-drag-start",x,C)}const p=re(null);function _(x,C){var D;x.type==="dir"&&(D=C.dataTransfer)!=null&&D.types.includes("application/x-brf-files")&&(C.preventDefault(),C.stopPropagation(),C.dataTransfer&&(C.dataTransfer.dropEffect="move"),p.value=x.path)}function h(x){p.value===x.path&&(p.value=null)}function b(x,C){var D;p.value=null,x.type==="dir"&&(D=C.dataTransfer)!=null&&D.types.includes("application/x-brf-files")&&(C.preventDefault(),C.stopPropagation(),n("item-drop-into",x,C))}let v,m=null;function y(x,C){m=x,v&&clearTimeout(v),v=setTimeout(()=>{if(m){const D=C.touches[0];n("context-card",m,{clientX:D.clientX,clientY:D.clientY,preventDefault:()=>{}})}},500)}function g(){v&&clearTimeout(v),m=null}function S(x){const C=x.replace(/^[a-z][a-z0-9+.-]*:\/\//i,""),D=C.lastIndexOf("/");return D===-1?"":C.slice(0,D)}function M(x){return x.basename===".trash"?"🗑":x.mime_type==="inode/storage"?"💾":x.type==="dir"&&x.e2e===!0?"🔒":null}function E(x){const C=x.snippet;return typeof C=="string"?C:""}function w(x){return F0(x).map(C=>C.text).join("")}return(x,C)=>(R(),$("div",{class:vt(["fe-grid",{"is-loading":e.loading}]),role:"listbox","aria-multiselectable":"true","aria-label":Y(a)("grid.aria"),"aria-busy":e.loading?"true":void 0},[(R(!0),$(qe,null,xt(e.files,D=>{var B;return R(),$("div",{key:D.path,class:vt(["fe-grid__card",{"is-selected":l(D),"is-dir":D.type==="dir","is-trash":D.trashed,"is-clipped":(B=e.clipped)==null?void 0:B.has(D.path),"is-droptarget":p.value===D.path}]),tabindex:"0",role:"option","aria-selected":l(D)?"true":"false","aria-label":Y(o)(D),"data-fe-path":D.path,draggable:"true",onClick:F=>c(D,F),onDblclick:F=>u(D),onContextmenu:F=>d(D,F),onDragstart:F=>f(D,F),onDragover:F=>_(D,F),onDragleave:F=>h(D),onDrop:F=>b(D,F),onTouchstartPassive:F=>y(D,F),onTouchend:g,onTouchmove:g},[T("div",Z7,[s(D)?(R(),$("img",{key:0,src:s(D),alt:D.basename,loading:"lazy",draggable:"false"},null,8,J7)):M(D)?(R(),$("span",Q7,V(M(D)),1)):(R(),$("span",{key:2,class:"fe-grid__icon fe-grid__icon--svg",innerHTML:Y(Uo)(D)},null,8,ew))]),T("div",{class:"fe-grid__label",title:D.basename},V(Y(o)(D)),9,tw),e.showParentPath?(R(),$("div",{key:0,class:"fe-grid__parent",title:S(D.path)},V(S(D.path)||"—"),9,rw)):Te("",!0),T("div",nw,V(Y(i)(D.size)),1),E(D)?(R(),$("div",{key:1,class:"fe-grid__snippet",title:w(E(D))},[(R(!0),$(qe,null,xt(Y(F0)(E(D)),(F,K)=>(R(),$(qe,{key:K},[F.match?(R(),$("mark",iw,V(F.text),1)):(R(),$(qe,{key:1},[$t(V(F.text),1)],64))],64))),128))],8,aw)):Te("",!0)],42,X7)}),128)),!e.loading&&e.files.length===0?(R(),$("div",ow,V(Y(a)("empty.folder")),1)):Te("",!0)],10,Y7))}}),sw=["aria-label","aria-busy"],lw=["aria-selected","aria-label","onClick","onDblclick","onContextmenu","onDragstart","onDragover","onDragleave","onDrop","onTouchstartPassive"],cw={class:"fe-gal__thumb"},uw=["src","alt"],fw={key:1,class:"fe-gal__icon"},dw=["innerHTML"],pw={class:"fe-gal__meta","aria-hidden":"true"},hw={key:0,class:"fe-gal__meta-line"},vw=["title"],mw=["title"],gw={key:0,class:"fe-gal__empty"},Zv=Pt({__name:"GalleryView",props:{files:{},selected:{},clipped:{},showParentPath:{type:Boolean},locale:{},loading:{type:Boolean},thumbSrc:{type:Function}},emits:["click-card","dbl-card","context-card","item-drag-start","item-drop-into"],setup(e,{emit:t}){const r=e,n=t,{t:a,formatSize:i,nodeDisplayName:o}=br(()=>r.locale);function s(x){return r.thumbSrc?r.thumbSrc(x):x.thumb_url??null}function l(x){return r.selected.has(x.path)}function c(x,C){n("click-card",x,{ctrl:C.ctrlKey||C.metaKey,shift:C.shiftKey})}function u(x){n("dbl-card",x)}function d(x,C){C.preventDefault(),C.stopPropagation(),n("context-card",x,C)}function f(x,C){wf(C,o(x),r.selected.has(x.path)?r.selected.size:1),n("item-drag-start",x,C)}const p=re(null);function _(x,C){var D;x.type==="dir"&&(D=C.dataTransfer)!=null&&D.types.includes("application/x-brf-files")&&(C.preventDefault(),C.stopPropagation(),C.dataTransfer&&(C.dataTransfer.dropEffect="move"),p.value=x.path)}function h(x){p.value===x.path&&(p.value=null)}function b(x,C){var D;p.value=null,x.type==="dir"&&(D=C.dataTransfer)!=null&&D.types.includes("application/x-brf-files")&&(C.preventDefault(),C.stopPropagation(),n("item-drop-into",x,C))}let v,m=null;function y(x,C){m=x,v&&clearTimeout(v),v=setTimeout(()=>{if(m){const D=C.touches[0];n("context-card",m,{clientX:D.clientX,clientY:D.clientY,preventDefault:()=>{}})}},500)}function g(){v&&clearTimeout(v),m=null}function S(x){const C=x.replace(/^[a-z][a-z0-9+.-]*:\/\//i,""),D=C.lastIndexOf("/");return D===-1?"":C.slice(0,D)}function M(x){return x.basename===".trash"?"🗑":x.mime_type==="inode/storage"?"💾":x.type==="dir"&&x.e2e===!0?"🔒":null}function E(x){return x?new Date(x*(x<1e12?1e3:1)).toLocaleString():""}function w(x){const C=E(x.last_modified);return[x.type==="dir"?"":i(x.size),C].filter(B=>!!B).join(" · ")}return(x,C)=>(R(),$("div",{class:vt(["fe-gal",{"is-loading":e.loading}]),role:"listbox","aria-multiselectable":"true","aria-label":Y(a)("gallery.aria"),"aria-busy":e.loading?"true":void 0},[(R(!0),$(qe,null,xt(e.files,D=>{var B;return R(),$("div",{key:D.path,class:vt(["fe-gal__card",{"is-selected":l(D),"is-dir":D.type==="dir","is-trash":D.trashed,"is-clipped":(B=e.clipped)==null?void 0:B.has(D.path),"is-droptarget":p.value===D.path}]),tabindex:"0",role:"option","aria-selected":l(D)?"true":"false","aria-label":Y(o)(D),draggable:"true",onClick:F=>c(D,F),onDblclick:F=>u(D),onContextmenu:F=>d(D,F),onDragstart:F=>f(D,F),onDragover:F=>_(D,F),onDragleave:F=>h(D),onDrop:F=>b(D,F),onTouchstartPassive:F=>y(D,F),onTouchend:g,onTouchmove:g},[T("div",cw,[s(D)?(R(),$("img",{key:0,src:s(D),alt:D.basename,loading:"lazy",draggable:"false"},null,8,uw)):M(D)?(R(),$("span",fw,V(M(D)),1)):(R(),$("span",{key:2,class:"fe-gal__icon fe-gal__icon--svg",innerHTML:Y(Uo)(D)},null,8,dw)),T("div",pw,[w(D)?(R(),$("span",hw,V(w(D)),1)):Te("",!0),e.showParentPath&&S(D.path)?(R(),$("span",{key:1,class:"fe-gal__meta-line fe-gal__meta-line--path",title:S(D.path)},V(S(D.path)),9,vw)):Te("",!0)])]),T("div",{class:"fe-gal__label",title:D.basename},V(Y(o)(D)),9,mw)],42,lw)}),128)),!e.loading&&e.files.length===0?(R(),$("div",gw,V(Y(a)("empty.folder")),1)):Te("",!0)],10,sw))}}),bw=Pt({__name:"UploadProgress",props:{jobs:{},locale:{},center:{}},emits:["cancel","dismiss","retry"],setup(e,{emit:t}){const r=e,n=t;function a(i){return i==="done"?"done":i==="error"?"error":i==="aborted"?"aborted":"running"}return At(()=>r.jobs,i=>{r.center.sync("upload",i.map(o=>({input:{id:o.id,kind:"upload",name:o.file.name,percent:o.totalBytes>0||o.status==="done"?o.percent:null,status:a(o.status),error:o.error??null,uploadedBytes:o.uploadedBytes,totalBytes:o.totalBytes,cancellable:o.status==="uploading"||o.status==="initializing",retryable:o.status==="error"},actions:{cancel:()=>n("cancel",o),dismiss:()=>n("dismiss",o),retry:()=>n("retry",o)}})))},{immediate:!0}),(i,o)=>Te("",!0)}}),yw=Pt({__name:"PendingOpsTray",props:{ops:{},locale:{},center:{}},emits:["dismiss"],setup(e,{emit:t}){const r=e,n=t;function a(o){return o.status==="done"?"done":o.status==="error"?"error":"running"}function i(o){return o.status==="done"?100:o.progress_total<=0?null:Math.min(100,Math.round(o.progress_done/o.progress_total*100))}return At(()=>r.ops,o=>{r.center.sync("ops",o.map(s=>({input:{id:s.id,kind:s.op_type,name:s.target_path||s.source_dir||"",percent:i(s),status:a(s),error:s.error_message,queued:s.status==="pending",doneCount:s.progress_done,totalCount:s.progress_total,cancellable:!1,retryable:!1},actions:{dismiss:()=>n("dismiss",s.id)}})))},{immediate:!0}),(o,s)=>Te("",!0)}}),_w=["aria-label"],xw={class:"fe-inspector__head"},ww={class:"fe-inspector__title"},kw=["title","aria-label"],Sw={class:"fe-inspector__scroll"},Cw={class:"fe-inspector__section"},Ew={class:"fe-inspector__heading"},Aw={key:0,class:"fe-inspector__hero"},Tw=["innerHTML"],Mw={class:"fe-inspector__name"},Dw={class:"fe-inspector__hero"},zw=["src"],Iw=["innerHTML"],Ow=["title"],Pw={class:"fe-inspector__meta"},Fw={class:"fe-inspector__row"},Rw={class:"fe-inspector__pathcell"},Lw=["title"],Bw=["title","aria-label"],$w={key:0,class:"fe-inspector__row"},Nw={class:"fe-inspector__row"},Uw={key:1,class:"fe-inspector__row"},Hw={class:"fe-inspector__mime"},jw={key:2,class:"fe-inspector__row"},Gw={class:"fe-inspector__pathcell"},Vw=["title"],qw=["title","aria-label"],Kw={key:2,class:"fe-inspector__hero"},Ww=["innerHTML"],Yw=["title"],Xw={class:"fe-inspector__sub"},Zw={key:0,class:"fe-inspector__section"},Jw={class:"fe-inspector__heading"},Qw={key:0,class:"fe-inspector__empty"},e9={key:0,class:"fe-inspector__empty"},t9={key:1,class:"fe-inspector__versions"},r9={class:"fe-inspector__version-main"},n9={class:"fe-inspector__version-n"},a9={class:"fe-inspector__version-meta"},i9={key:0,class:"fe-inspector__confirm"},o9={class:"fe-inspector__confirm-q"},s9={class:"fe-inspector__check"},l9={class:"fe-inspector__confirm-actions"},c9=["disabled","onClick"],u9=["disabled"],f9=["disabled","onClick"],d9=["disabled"],p9={key:1,class:"fe-inspector__section"},h9={class:"fe-inspector__heading"},v9={class:"fe-inspector__permrow"},m9={key:2,class:"fe-inspector__section"},g9={class:"fe-inspector__heading"},b9={key:0,class:"fe-inspector__empty"},y9={key:1,class:"fe-inspector__shares"},_9=["title"],x9={key:0,class:"fe-inspector__badge fe-inspector__badge--pin"},w9={key:1,class:"fe-inspector__share-exp"},k9=["title","aria-label","onClick"],S9={key:3,class:"fe-inspector__section"},C9={class:"fe-inspector__heading"},E9={key:0,class:"fe-inspector__countbadge"},A9={key:0,class:"fe-inspector__empty"},T9={key:0,class:"fe-inspector__empty"},M9={key:1,class:"fe-inspector__comments"},D9={class:"fe-inspector__comment-top"},z9=["title"],I9=["title"],O9=["disabled","title","aria-label","onClick"],P9={class:"fe-inspector__comment-body"},F9=["placeholder","aria-label","disabled"],R9=["disabled"],L9=Pt({__name:"InspectorPanel",props:{api:{},nodes:{},dirLabel:{},dirCount:{},dirPerm:{},locale:{},narrow:{type:Boolean},thumbSrc:{type:Function}},emits:["close","manage-permissions","toast","changed"],setup(e,{emit:t}){const r=e,n=t,{t:a,formatSize:i,nodeDisplayName:o}=br(()=>r.locale),s=Fe(()=>r.nodes.length===1?r.nodes[0]:null),l=Fe(()=>r.nodes.length>1),c=Fe(()=>{var he;return((he=s.value)==null?void 0:he.type)==="file"}),u=Fe(()=>{var he;return typeof((he=s.value)==null?void 0:he.id)=="number"?s.value.id:null}),d=Fe(()=>r.nodes.reduce((he,Ie)=>he+(typeof Ie.size=="number"?Ie.size:0),0)),f=Fe(()=>{var Ie;const he=(Ie=s.value)==null?void 0:Ie.etag;return typeof he=="string"&&he!==""?he:null}),p=Fe(()=>s.value&&c.value&&r.thumbSrc?r.thumbSrc(s.value):null);function _(he){return he.length>12?`${he.slice(0,12)}…`:he}function h(he){if(!he)return"—";try{return new Date(he).toLocaleString(r.locale==="en"?"en-GB":"tr-TR",{dateStyle:"medium",timeStyle:"short"})}catch{return new Date(he).toISOString()}}function b(he){if(!he)return"—";const Ie=Date.parse(he);return Number.isNaN(Ie)?he:h(Ie)}async function v(he){try{await navigator.clipboard.writeText(he),n("toast",a("inspector.copied"))}catch{n("toast",he)}}const m=Fe(()=>{if(!s.value)return"";const he=s.value.perm;return typeof he=="string"&&he!==""?he:r.dirPerm||""}),y=Fe(()=>m.value==="editor"||m.value==="owner");function g(he){return a(`inspector.perm.${he}`)===`inspector.perm.${he}`?he:a(`inspector.perm.${he}`)}const S=re("idle"),M=re([]),E=re(null),w=re(!0),x=re(!1),C=re("idle"),D=re([]);let B=0;async function F(){const he=++B;if(E.value=null,M.value=[],D.value=[],s.value&&c.value&&u.value!=null?(S.value="loading",K(he)):S.value="hidden",s.value){C.value="loading";const Ie=s.value.path;try{const{shares:De}=await r.api.listShares(Ie);if(he!==B)return;D.value=Array.isArray(De)?De:[],C.value="ok"}catch{if(he!==B)return;C.value="hidden"}}else C.value="hidden"}async function K(he){const Ie=u.value;if(Ie!=null)try{const De=await r.api.listVersions(Ie);if(he!==B)return;M.value=De,S.value="ok"}catch(De){if(he!==B)return;const Be=De.status;Be===401||Be===403||Be===404?S.value="hidden":S.value="error"}}function te(he){E.value=he.id,w.value=!0}async function J(he){const Ie=u.value;if(!(Ie==null||x.value)){x.value=!0;try{await r.api.restoreVersion(Ie,he.id,w.value),n("toast",a("inspector.versions.restored")),E.value=null,n("changed"),await K(++B)}catch(De){n("toast",De.message)}finally{x.value=!1}}}async function ne(){const he=u.value;if(!(he==null||x.value)){x.value=!0;try{await r.api.snapshotVersion(he),n("toast",a("inspector.versions.snapshotted")),await K(++B)}catch(Ie){const De=Ie.status;De===404||De===405||De===501?n("toast",a("inspector.versions.unsupported")):n("toast",Ie.message)}finally{x.value=!1}}}At(()=>r.nodes.map(he=>he.path).join("\0"),()=>void F(),{immediate:!0});const le=re("hidden"),q=re([]),j=re(""),P=re(!1),N=Fe(()=>{var he;return typeof((he=s.value)==null?void 0:he.id)=="number"?s.value.id:null});let X=0;async function Ee(){const he=++X,Ie=N.value;if(Ie==null){le.value="hidden",q.value=[];return}le.value=q.value.length>0?"ok":"loading";try{const De=await r.api.listComments(Ie);if(he!==X)return;q.value=De,le.value="ok"}catch(De){if(he!==X)return;q.value=[];const Be=De.status;le.value=Be===401||Be===403||Be===404?"hidden":"error"}}async function Ae(){const he=N.value,Ie=j.value.trim();if(!(he==null||Ie===""||P.value)){P.value=!0;try{await r.api.addComment(he,Ie),j.value="",await Ee()}catch(De){n("toast",De.message)}finally{P.value=!1}}}async function ze(he){if(!P.value){P.value=!0;try{await r.api.deleteComment(he.id),await Ee()}catch(Ie){n("toast",Ie.message)}finally{P.value=!1}}}function Le(he){const Ie=Date.parse(he);if(Number.isNaN(Ie))return he;const De=Math.round((Ie-Date.now())/1e3),Be=Math.abs(De),Z=[["year",31536e3],["month",2592e3],["day",86400],["hour",3600],["minute",60]];try{const se=new Intl.RelativeTimeFormat(r.locale==="en"?"en":"tr",{numeric:"auto"});for(const[we,Se]of Z)if(Be>=Se)return se.format(Math.trunc(De/Se),we);return se.format(De,"second")}catch{return b(he)}}return At(()=>N.value,()=>{q.value=[],j.value="",Ee()},{immediate:!0}),(he,Ie)=>(R(),$("aside",{class:vt(["fe-inspector",{"fe-inspector--overlay":e.narrow}]),role:"complementary","aria-label":Y(a)("inspector.title")},[T("header",xw,[T("h2",ww,V(Y(a)("inspector.title")),1),T("button",{type:"button",class:"fe-inspector__close",title:Y(a)("inspector.close"),"aria-label":Y(a)("inspector.close"),onClick:Ie[0]||(Ie[0]=De=>n("close"))},"×",8,kw)]),T("div",Sw,[T("section",Cw,[T("h3",Ew,V(Y(a)("inspector.section.general")),1),l.value?(R(),$("div",Aw,[T("span",{class:"fe-inspector__bigicon",innerHTML:Y(Uo)({type:"dir"})},null,8,Tw),T("p",Mw,V(Y(a)("inspector.items_summary",{n:e.nodes.length,size:Y(i)(d.value)})),1)])):s.value?(R(),$(qe,{key:1},[T("div",Dw,[p.value?(R(),$("img",{key:0,class:"fe-inspector__thumb",src:p.value,alt:"","aria-hidden":"true"},null,8,zw)):(R(),$("span",{key:1,class:"fe-inspector__bigicon",innerHTML:Y(Uo)(s.value)},null,8,Iw)),T("p",{class:"fe-inspector__name",title:s.value.basename},V(Y(o)(s.value)),9,Ow)]),T("dl",Pw,[T("div",Fw,[T("dt",null,V(Y(a)("inspector.path")),1),T("dd",Rw,[T("span",{class:"fe-inspector__path",title:s.value.path},V(s.value.path),9,Lw),T("button",{type:"button",class:"fe-inspector__copy",title:Y(a)("inspector.copy"),"aria-label":Y(a)("inspector.copy"),onClick:Ie[1]||(Ie[1]=De=>v(s.value.path))},"⧉",8,Bw)])]),c.value?(R(),$("div",$w,[T("dt",null,V(Y(a)("inspector.size")),1),T("dd",null,V(Y(i)(typeof s.value.size=="number"?s.value.size:null)),1)])):Te("",!0),T("div",Nw,[T("dt",null,V(Y(a)("inspector.modified")),1),T("dd",null,V(h(s.value.last_modified)),1)]),c.value&&s.value.mime_type?(R(),$("div",Uw,[T("dt",null,V(Y(a)("inspector.mime")),1),T("dd",Hw,V(s.value.mime_type),1)])):Te("",!0),f.value?(R(),$("div",jw,[T("dt",null,V(Y(a)("inspector.etag")),1),T("dd",Gw,[T("span",{class:"fe-inspector__path",title:f.value},V(_(f.value)),9,Vw),T("button",{type:"button",class:"fe-inspector__copy",title:Y(a)("inspector.copy"),"aria-label":Y(a)("inspector.copy"),onClick:Ie[2]||(Ie[2]=De=>v(f.value))},"⧉",8,qw)])])):Te("",!0)])],64)):(R(),$("div",Kw,[T("span",{class:"fe-inspector__bigicon",innerHTML:Y(Uo)({type:"dir"})},null,8,Ww),T("p",{class:"fe-inspector__name",title:e.dirLabel},V(e.dirLabel),9,Yw),T("p",Xw,V(Y(a)("inspector.folder_items",{n:e.dirCount})),1)]))]),S.value==="ok"||S.value==="error"?(R(),$("section",Zw,[T("h3",Jw,V(Y(a)("inspector.section.versions")),1),S.value==="error"?(R(),$("p",Qw,V(Y(a)("inspector.error")),1)):(R(),$(qe,{key:1},[M.value.length===0?(R(),$("p",e9,V(Y(a)("inspector.versions.empty")),1)):(R(),$("ul",t9,[(R(!0),$(qe,null,xt(M.value,De=>(R(),$("li",{key:De.id,class:"fe-inspector__version"},[T("div",r9,[T("span",n9,V(Y(a)("inspector.versions.v",{n:De.version_n})),1),T("span",a9,V(b(De.created_at))+" · "+V(Y(i)(De.size)),1)]),E.value===De.id?(R(),$("div",i9,[T("p",o9,V(Y(a)("inspector.versions.restore_confirm")),1),T("label",s9,[Yt(T("input",{"onUpdate:modelValue":Ie[3]||(Ie[3]=Be=>w.value=Be),type:"checkbox"},null,512),[[No,w.value]]),$t(" "+V(Y(a)("inspector.versions.snapshot_current")),1)]),T("div",l9,[T("button",{type:"button",class:"fe-btn fe-btn--primary fe-btn--sm",disabled:x.value,onClick:Be=>J(De)},V(Y(a)("inspector.versions.confirm")),9,c9),T("button",{type:"button",class:"fe-btn fe-btn--sm",disabled:x.value,onClick:Ie[4]||(Ie[4]=Be=>E.value=null)},V(Y(a)("inspector.versions.cancel")),9,u9)])])):(R(),$("button",{key:1,type:"button",class:"fe-btn fe-btn--sm",disabled:x.value,onClick:Be=>te(De)},V(Y(a)("inspector.versions.restore")),9,f9))]))),128))])),T("button",{type:"button",class:"fe-btn fe-btn--sm fe-inspector__snapshot",disabled:x.value,onClick:ne},V(Y(a)("inspector.versions.take_snapshot")),9,d9)],64))])):Te("",!0),s.value&&m.value?(R(),$("section",p9,[T("h3",h9,V(Y(a)("inspector.section.permissions")),1),T("div",v9,[T("span",{class:vt(["fe-inspector__badge",`fe-inspector__badge--${m.value}`])},V(g(m.value)),3),y.value?(R(),$("button",{key:0,type:"button",class:"fe-btn fe-btn--sm",onClick:Ie[5]||(Ie[5]=De=>n("manage-permissions",s.value))},V(Y(a)("inspector.perm.manage")),1)):Te("",!0)])])):Te("",!0),C.value==="ok"?(R(),$("section",m9,[T("h3",g9,V(Y(a)("inspector.section.shares")),1),D.value.length===0?(R(),$("p",b9,V(Y(a)("inspector.shares.empty")),1)):(R(),$("ul",y9,[(R(!0),$(qe,null,xt(D.value,De=>(R(),$("li",{key:De.uuid,class:"fe-inspector__share"},[T("span",{class:"fe-inspector__share-url",title:De.url},V(De.url),9,_9),De.password_pin?(R(),$("span",x9,"PIN")):Te("",!0),De.expires_at?(R(),$("span",w9,V(b(De.expires_at)),1)):Te("",!0),T("button",{type:"button",class:"fe-inspector__copy",title:Y(a)("inspector.shares.copy"),"aria-label":Y(a)("inspector.shares.copy"),onClick:Be=>v(De.url)},"⧉",8,k9)]))),128))]))])):Te("",!0),le.value==="ok"||le.value==="error"?(R(),$("section",S9,[T("h3",C9,[$t(V(Y(a)("inspector.section.comments"))+" ",1),q.value.length>0?(R(),$("span",E9,V(q.value.length),1)):Te("",!0)]),le.value==="error"?(R(),$("p",A9,V(Y(a)("inspector.error")),1)):(R(),$(qe,{key:1},[q.value.length===0?(R(),$("p",T9,V(Y(a)("inspector.comments.empty")),1)):(R(),$("ul",M9,[(R(!0),$(qe,null,xt(q.value,De=>(R(),$("li",{key:De.id,class:"fe-inspector__comment"},[T("div",D9,[T("span",{class:"fe-inspector__comment-author",title:De.author_name},V(De.author_name||"—"),9,z9),T("span",{class:"fe-inspector__comment-time",title:b(De.created_at)},V(Le(De.created_at)),9,I9),De.can_delete?(R(),$("button",{key:0,type:"button",class:"fe-inspector__comment-del",disabled:P.value,title:Y(a)("inspector.comments.delete"),"aria-label":Y(a)("inspector.comments.delete"),onClick:Be=>ze(De)},"×",8,O9)):Te("",!0)]),T("p",P9,V(De.body),1)]))),128))])),T("form",{class:"fe-inspector__comment-form",onSubmit:Ht(Ae,["prevent"])},[Yt(T("input",{"onUpdate:modelValue":Ie[6]||(Ie[6]=De=>j.value=De),type:"text",class:"fe-inspector__comment-input",maxlength:"5000",placeholder:Y(a)("inspector.comments.placeholder"),"aria-label":Y(a)("inspector.comments.placeholder"),disabled:P.value},null,8,F9),[[Ir,j.value]]),T("button",{type:"submit",class:"fe-btn fe-btn--primary fe-btn--sm",disabled:P.value||j.value.trim()===""},V(Y(a)("inspector.comments.send")),9,R9)],32)],64))])):Te("",!0)])],10,_w))}}),B9=["aria-label"],$9={class:"fe-cmdp__inputwrap"},N9=["placeholder"],U9=["aria-selected","onMouseenter","onClick"],H9={class:"fe-cmdp__icon","aria-hidden":"true"},j9={class:"fe-cmdp__label"},G9={class:"fe-cmdp__group"},V9=["aria-selected","onMouseenter","onClick"],q9={class:"fe-cmdp__icon","aria-hidden":"true"},K9={class:"fe-cmdp__label"},W9={class:"fe-cmdp__group"},Y9={key:0,class:"fe-cmdp__loading"},X9=["aria-selected","onMouseenter","onClick"],Z9={class:"fe-cmdp__icon","aria-hidden":"true"},J9={class:"fe-cmdp__hitbody"},Q9={class:"fe-cmdp__hitline"},ek={class:"fe-cmdp__label"},tk={key:0,class:"fe-cmdp__badge"},rk=["title"],nk={key:1,class:"fe-cmdp__snippet"},ak={key:0,class:"fe-cmdp__mark"},ik={class:"fe-cmdp__group"},ok=["aria-selected","onMouseenter","onClick","onKeydown"],sk={class:"fe-cmdp__icon","aria-hidden":"true"},lk={class:"fe-cmdp__label"},ck=["title","aria-label","onClick"],uk={class:"fe-cmdp__group"},fk=["aria-selected","onMouseenter","onClick"],dk={class:"fe-cmdp__icon","aria-hidden":"true"},pk={class:"fe-cmdp__label"},hk={key:4,class:"fe-cmdp__empty"},vk={class:"fe-cmdp__hint"},mk=3,gk=8,bk=250,Jv="filex.saved-searches",Qv=10,yk=Pt({__name:"CommandPalette",props:{open:{type:Boolean},locale:{},files:{},viewMode:{},canWrite:{type:Boolean},canGoUp:{type:Boolean},globalSearch:{type:Function},splitEnabled:{type:Boolean}},emits:["close","open-node","navigate","new-folder","upload","toggle-view","open-trash","refresh","go-up","open-hit","open-theme","open-shortcut-settings","start-tour","tab-new","split-toggle"],setup(e,{emit:t}){const r=e,n=t,{t:a,nodeDisplayName:i}=br(()=>r.locale),o=re(""),s=re(0),l=re(null),c=re(null);function u(q,j){if(!j)return 0;const P=q.toLocaleLowerCase(),N=j.toLocaleLowerCase(),X=P.indexOf(N);if(X===-1)return-1;let Ee=100-Math.min(X,50);return X===0&&(Ee+=40),Ee-=Math.min(P.length,40)/4,Ee}const d=Fe(()=>{const q=o.value.trim();if(!q.includes("/"))return[];const j=q.replace(/^\/+|\/+$/g,"");return j?[{kind:"goto",id:`goto:${j}`,label:`${a("palette.goto")}: ${j}`,icon:"➜",path:j}]:[]}),f=Fe(()=>{const q=o.value.trim(),j=r.files.map(P=>({f:P,name:i(P),s:u(i(P),q)})).filter(P=>P.s>=0);return q&&j.sort((P,N)=>N.s-P.s),j.slice(0,8).map(P=>({kind:"file",id:`file:${P.f.path}`,label:P.name,icon:P.f.type==="dir"?"📁":"📄",node:P.f}))}),p=Fe(()=>{const q=o.value.trim();return[{command:"new-folder",label:a("toolbar.new_folder"),icon:"📁",enabled:r.canWrite!==!1},{command:"upload",label:a("toolbar.upload"),icon:"⬆",enabled:r.canWrite!==!1},{command:"toggle-view",label:a("cmd.view_toggle"),icon:r.viewMode==="list"?"▦":r.viewMode==="grid"?"▣":"☰",enabled:!0},{command:"open-trash",label:a("cmd.trash"),icon:"🗑",enabled:!0},{command:"refresh",label:a("toolbar.refresh"),icon:"⟳",enabled:!0},{command:"go-up",label:a("toolbar.go_up"),icon:"↑",enabled:r.canGoUp!==!1},{command:"open-theme",label:a("theme.menu"),icon:"🎨",enabled:!0},{command:"open-shortcut-settings",label:a("shortcuts.settings.menu"),icon:"⌨",enabled:!0},{command:"start-tour",label:a("tour.restart"),icon:"🎓",enabled:!0},{command:"tab-new",label:a("cmd.tab_new"),icon:"⧉",enabled:!0},{command:"split-toggle",label:a("cmd.split_toggle"),icon:"◫",enabled:r.splitEnabled!==!1}].filter(P=>P.enabled&&u(P.label,q)>=0).map(P=>({kind:"command",id:`cmd:${P.command}`,label:P.label,icon:P.icon,command:P.command}))}),_=re([]),h=re(!1);let b,v=0;function m(q){b&&clearTimeout(b);const j=r.globalSearch;if(!j||q.length<mk){_.value=[],h.value=!1;return}h.value=!0,b=setTimeout(async()=>{const P=++v;try{const N=await j(q);if(P!==v)return;_.value=Array.isArray(N)?N.slice(0,gk):[]}catch{P===v&&(_.value=[])}finally{P===v&&(h.value=!1)}},bk)}function y(q){const j=String(q.path??"").replace(/^\/+|\/+$/g,""),P=j.lastIndexOf("/"),N=P===-1?"":j.slice(0,P),X=typeof q.storage=="string"&&q.storage||typeof q.storage_name=="string"&&q.storage_name||"";return X&&N?`${X}/${N}`:X||N||"/"}const g=Fe(()=>_.value.map(q=>({kind:"hit",id:`hit:${q.storage_id??""}:${q.path??""}:${q.id??""}`,label:String(q.name??q.path??""),icon:q.type==="dir"?"📁":"📄",hit:q,crumb:y(q),inContent:Kv(q.matched),snippet:typeof q.snippet=="string"?q.snippet:""}))),S=re([]);function M(){try{const q=localStorage.getItem(Jv);if(!q)return[];const j=JSON.parse(q);return Array.isArray(j)?j.filter(P=>typeof P=="string"&&P.trim()!=="").slice(0,Qv):[]}catch{return[]}}function E(q){S.value=q.slice(0,Qv);try{localStorage.setItem(Jv,JSON.stringify(S.value))}catch{}}function w(q){const j=q.trim();if(!j)return;const P=S.value.filter(N=>N!==j);P.unshift(j),E(P)}function x(q){E(S.value.filter(j=>j!==q)),s.value>=D.value.length&&(s.value=Math.max(0,D.value.length-1))}const C=Fe(()=>{const q=o.value.trim(),j=[];q&&!S.value.includes(q)&&j.push({kind:"save",id:`save:${q}`,label:`${a("palette.save")}: ${q}`,icon:"💾",query:q});const P=S.value.map(N=>({s:N,sc:u(N,q)})).filter(N=>N.sc>=0||!q);for(const N of P)j.push({kind:"saved",id:`saved:${N.s}`,label:N.s,icon:"🔖",query:N.s});return j}),D=Fe(()=>[...d.value,...f.value,...g.value,...C.value,...p.value]),B=Fe(()=>d.value.length),F=Fe(()=>B.value+f.value.length),K=Fe(()=>F.value+g.value.length),te=Fe(()=>K.value+C.value.length);At(o,q=>{s.value=0,m(q.trim())});function J(q){const j=D.value.length;j&&(s.value=(s.value+q+j)%j,Nr(()=>{var P,N;(N=(P=c.value)==null?void 0:P.querySelector(".is-active"))==null||N.scrollIntoView({block:"nearest"})}))}function ne(q){const j=q??D.value[s.value];if(j){if(j.kind==="saved"){o.value=j.query,Nr(()=>{var P;return(P=l.value)==null?void 0:P.focus()});return}if(j.kind==="save"){w(j.query),Nr(()=>{var P;return(P=l.value)==null?void 0:P.focus()});return}if(n("close"),j.kind==="hit"){n("open-hit",j.hit);return}if(j.kind==="file")n("open-node",j.node);else if(j.kind==="goto")n("navigate",j.path);else switch(j.command){case"new-folder":n("new-folder");break;case"upload":n("upload");break;case"toggle-view":n("toggle-view");break;case"open-trash":n("open-trash");break;case"refresh":n("refresh");break;case"go-up":n("go-up");break;case"open-theme":n("open-theme");break;case"open-shortcut-settings":n("open-shortcut-settings");break;case"start-tour":n("start-tour");break;case"tab-new":n("tab-new");break;case"split-toggle":n("split-toggle");break}}}function le(q){if(r.open)switch(q.key){case"ArrowDown":q.preventDefault(),q.stopPropagation(),J(1);break;case"ArrowUp":q.preventDefault(),q.stopPropagation(),J(-1);break;case"Enter":q.preventDefault(),q.stopPropagation(),ne();break;case"Escape":q.preventDefault(),q.stopPropagation(),n("close");break}}return At(()=>r.open,q=>{q?(o.value="",s.value=0,_.value=[],h.value=!1,S.value=M(),document.addEventListener("keydown",le,!0),Nr(()=>{var j;return(j=l.value)==null?void 0:j.focus()})):(b&&clearTimeout(b),document.removeEventListener("keydown",le,!0))}),tr(()=>{b&&clearTimeout(b),document.removeEventListener("keydown",le,!0)}),(q,j)=>(R(),Zt(Za,{name:"fe-modal"},{default:ur(()=>[e.open?(R(),$("div",{key:0,class:"fe-modal__backdrop fe-cmdp__backdrop",role:"presentation",onClick:j[2]||(j[2]=P=>n("close"))},[T("div",{class:"fe-cmdp",role:"dialog","aria-modal":"true","aria-label":Y(a)("palette.placeholder"),onClick:j[1]||(j[1]=Ht(()=>{},["stop"]))},[T("div",$9,[j[3]||(j[3]=T("svg",{class:"fe-cmdp__glyph",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","aria-hidden":"true"},[T("circle",{cx:"7",cy:"7",r:"4.5"}),T("path",{d:"m10.5 10.5 3.5 3.5"})],-1)),Yt(T("input",{ref_key:"inputEl",ref:l,"onUpdate:modelValue":j[0]||(j[0]=P=>o.value=P),type:"text",class:"fe-cmdp__input",placeholder:Y(a)("palette.placeholder"),autocomplete:"off",spellcheck:"false"},null,8,N9),[[Ir,o.value]])]),T("div",{ref_key:"listEl",ref:c,class:"fe-cmdp__list",role:"listbox"},[(R(!0),$(qe,null,xt(d.value,(P,N)=>(R(),$("button",{key:P.id,type:"button",class:vt(["fe-cmdp__item",{"is-active":N===s.value}]),role:"option","aria-selected":N===s.value,onMouseenter:X=>s.value=N,onClick:X=>ne(P)},[T("span",H9,V(P.icon),1),T("span",j9,V(P.label),1)],42,U9))),128)),f.value.length?(R(),$(qe,{key:0},[T("div",G9,V(Y(a)("palette.files")),1),(R(!0),$(qe,null,xt(f.value,(P,N)=>(R(),$("button",{key:P.id,type:"button",class:vt(["fe-cmdp__item",{"is-active":B.value+N===s.value}]),role:"option","aria-selected":B.value+N===s.value,onMouseenter:X=>s.value=B.value+N,onClick:X=>ne(P)},[T("span",q9,V(P.icon),1),T("span",K9,V(P.label),1)],42,V9))),128))],64)):Te("",!0),g.value.length||h.value?(R(),$(qe,{key:1},[T("div",W9,V(Y(a)("palette.everywhere")),1),h.value&&!g.value.length?(R(),$("div",Y9,V(Y(a)("palette.searching")),1)):Te("",!0),(R(!0),$(qe,null,xt(g.value,(P,N)=>(R(),$("button",{key:P.id,type:"button",class:vt(["fe-cmdp__item fe-cmdp__item--hit",{"is-active":F.value+N===s.value}]),role:"option","aria-selected":F.value+N===s.value,onMouseenter:X=>s.value=F.value+N,onClick:X=>ne(P)},[T("span",Z9,V(P.icon),1),T("span",J9,[T("span",Q9,[T("span",ek,V(P.label),1),P.inContent?(R(),$("span",tk,V(Y(a)("search.in_content")),1)):Te("",!0)]),P.crumb?(R(),$("span",{key:0,class:"fe-cmdp__crumb",title:P.crumb},V(P.crumb),9,rk)):Te("",!0),P.snippet?(R(),$("span",nk,[(R(!0),$(qe,null,xt(Y(F0)(P.snippet),(X,Ee)=>(R(),$(qe,{key:Ee},[X.match?(R(),$("mark",ak,V(X.text),1)):(R(),$(qe,{key:1},[$t(V(X.text),1)],64))],64))),128))])):Te("",!0)])],42,X9))),128))],64)):Te("",!0),C.value.length?(R(),$(qe,{key:2},[T("div",ik,V(Y(a)("palette.saved")),1),(R(!0),$(qe,null,xt(C.value,(P,N)=>(R(),$("div",{key:P.id,class:vt(["fe-cmdp__item fe-cmdp__item--saved",{"is-active":K.value+N===s.value}]),role:"option","aria-selected":K.value+N===s.value,tabindex:"-1",onMouseenter:X=>s.value=K.value+N,onClick:X=>ne(P),onKeydown:un(Ht(X=>ne(P),["prevent"]),["enter"])},[T("span",sk,V(P.icon),1),T("span",lk,V(P.label),1),P.kind==="saved"?(R(),$("button",{key:0,type:"button",class:"fe-cmdp__del",title:Y(a)("palette.saved.delete"),"aria-label":Y(a)("palette.saved.delete"),onClick:Ht(X=>x(P.query),["stop"])},"🗑",8,ck)):Te("",!0)],42,ok))),128))],64)):Te("",!0),p.value.length?(R(),$(qe,{key:3},[T("div",uk,V(Y(a)("palette.commands")),1),(R(!0),$(qe,null,xt(p.value,(P,N)=>(R(),$("button",{key:P.id,type:"button",class:vt(["fe-cmdp__item",{"is-active":te.value+N===s.value}]),role:"option","aria-selected":te.value+N===s.value,onMouseenter:X=>s.value=te.value+N,onClick:X=>ne(P)},[T("span",dk,V(P.icon),1),T("span",pk,V(P.label),1)],42,fk))),128))],64)):Te("",!0),D.value.length===0&&!h.value?(R(),$("div",hk,V(Y(a)("palette.empty")),1)):Te("",!0)],512),T("div",vk,V(Y(a)("palette.hint")),1)],8,B9)])):Te("",!0)]),_:1}))}}),_k=["aria-labelledby","aria-label"],xk={key:0,class:"fe-modal__head"},wk={class:"fe-modal__body"},kk={key:1,class:"fe-modal__actions"},em='input:not([disabled]),select:not([disabled]),textarea:not([disabled]),button:not([disabled]),a[href],[tabindex]:not([tabindex="-1"])',ei=Pt({__name:"Modal",props:{open:{type:Boolean},title:{},size:{},closeOnBackdrop:{type:Boolean},chromeless:{type:Boolean},theme:{}},emits:["close"],setup(e,{emit:t}){const r=e,n=t,a=re(null);let i=0;const o=`fe-modal-title-${++i}-${Math.random().toString(36).slice(2,7)}`;let s=null;At(()=>r.open,u=>{var d;u?(s=document.activeElement??null,document.addEventListener("keydown",l),setTimeout(()=>{var p;const f=(p=a.value)==null?void 0:p.querySelector(em);f==null||f.focus()},30)):(document.removeEventListener("keydown",l),(d=s==null?void 0:s.focus)==null||d.call(s),s=null)}),tr(()=>document.removeEventListener("keydown",l));function l(u){if(u.key==="Escape"){n("close");return}if(u.key==="Tab"&&a.value){const d=Array.from(a.value.querySelectorAll(em)).filter(h=>h.offsetParent!==null||h===document.activeElement);if(d.length===0)return;const f=d[0],p=d[d.length-1],_=document.activeElement;u.shiftKey&&(_===f||!a.value.contains(_))?(u.preventDefault(),p.focus()):!u.shiftKey&&(_===p||!a.value.contains(_))&&(u.preventDefault(),f.focus())}}function c(){r.closeOnBackdrop!==!1&&n("close")}return(u,d)=>(R(),Zt(Za,{name:"fe-modal"},{default:ur(()=>[e.open?(R(),$("div",{key:0,class:vt(["fe fe-modal__backdrop",[{"fe-modal__backdrop--chromeless":e.chromeless},e.theme==="light"?"fe--theme-light":"",e.theme==="dark"?"fe--theme-dark":""]]),role:"presentation",onClick:c},[T("div",{ref_key:"cardEl",ref:a,class:vt(["fe-modal__card",[`fe-modal__card--${e.size||"md"}`,e.chromeless&&"fe-modal__card--chromeless"]]),role:"dialog","aria-modal":"true","aria-labelledby":e.title&&!e.chromeless?o:void 0,"aria-label":(!e.title||e.chromeless)&&e.title||void 0,onClick:d[1]||(d[1]=Ht(()=>{},["stop"]))},[e.title&&!e.chromeless?(R(),$("header",xk,[T("h2",{id:o,class:"fe-modal__title"},V(e.title),1),T("button",{type:"button",class:"fe-modal__close","aria-label":"Close",onClick:d[0]||(d[0]=f=>n("close"))},"×")])):Te("",!0),T("div",wk,[S1(u.$slots,"default")]),u.$slots.actions&&!e.chromeless?(R(),$("footer",kk,[S1(u.$slots,"actions")])):Te("",!0)],10,_k)],2)):Te("",!0)]),_:3}))}}),Sk={class:"fe-shortcuts"},Ck={class:"fe-shortcuts__heading"},Ek={class:"fe-shortcuts__table"},Ak={class:"fe-shortcuts__keys"},Tk={key:0,class:"fe-shortcuts__unbound"},Mk={class:"fe-kbd"},Dk={key:0,class:"fe-shortcuts__or","aria-hidden":"true"},zk={class:"fe-shortcuts__desc"},Ik=["title"],Ok=Pt({__name:"ShortcutsHelp",props:{open:{type:Boolean},locale:{}},emits:["close","customize"],setup(e,{emit:t}){const r=e,n=t,{t:a}=br(()=>r.locale),i=Bv(),o=Fe(()=>{const s=[],l=new Map;for(const c of i.value)l.has(c.groupKey)||(l.set(c.groupKey,[]),s.push(c.groupKey)),l.get(c.groupKey).push(c);return s.map(c=>({key:c,items:l.get(c)}))});return(s,l)=>(R(),Zt(ei,{open:e.open,title:Y(a)("shortcuts.title"),size:"md",onClose:l[2]||(l[2]=c=>n("close"))},{actions:ur(()=>[T("button",{type:"button",class:"fe-btn fe-btn--primary",onClick:l[0]||(l[0]=c=>n("customize"))}," ⌨ "+V(Y(a)("shortcuts.customize")),1),T("button",{type:"button",class:"fe-btn",onClick:l[1]||(l[1]=c=>n("close"))},V(Y(a)("viewer.close")),1)]),default:ur(()=>[T("div",Sk,[(R(!0),$(qe,null,xt(o.value,c=>(R(),$("section",{key:c.key,class:"fe-shortcuts__group"},[T("h3",Ck,V(Y(a)(c.key)),1),T("div",Ek,[(R(!0),$(qe,null,xt(c.items,u=>(R(),$("div",{key:u.id,class:"fe-shortcuts__row"},[T("span",Ak,[u.keys.length===0?(R(),$("span",Tk,V(Y(a)("shortcuts.settings.unbound")),1)):(R(!0),$(qe,{key:1},xt(u.keys,(d,f)=>(R(),$(qe,{key:d},[T("kbd",Mk,V(d),1),f<u.keys.length-1?(R(),$("span",Dk,"/")):Te("",!0)],64))),128))]),T("span",zk,[$t(V(Y(a)(u.labelKey))+" ",1),u.overridden?(R(),$("span",{key:0,class:"fe-shortcuts__custom",title:Y(a)("shortcuts.settings.customized")},"●",8,Ik)):Te("",!0)])]))),128))])]))),128))])]),_:1},8,["open","title"]))}}),R0="filex.theme",Ta="default",kf=[{id:Ta,nameKey:"theme.name.default",light:{"--fe-bg":"#ffffff","--fe-bg-elev":"#f7f8fa","--fe-bg-hover":"#edf0f5","--fe-bg-selected":"#dfe8ff","--fe-border":"#e2e6ed","--fe-border-strong":"#c7ced9","--fe-text":"#1a1e27","--fe-text-muted":"#5a6475","--fe-text-on-primary":"#ffffff","--fe-primary":"#3b82f6","--fe-primary-hover":"#2563eb","--fe-danger":"#dc2626","--fe-danger-hover":"#b91c1c"},dark:{"--fe-bg":"#0f1419","--fe-bg-elev":"#161c25","--fe-bg-hover":"#1f2733","--fe-bg-selected":"#23324a","--fe-border":"#2a323e","--fe-border-strong":"#3a4453","--fe-text":"#e5e9f0","--fe-text-muted":"#8b95a7","--fe-text-on-primary":"#ffffff","--fe-primary":"#60a5fa","--fe-primary-hover":"#3b82f6","--fe-danger":"#f87171","--fe-danger-hover":"#ef4444"}},{id:"night",nameKey:"theme.name.night",light:{"--fe-bg":"#f6f8fd","--fe-bg-elev":"#edf1fa","--fe-bg-hover":"#e2e9f7","--fe-bg-selected":"#d2ddf4","--fe-border":"#d6deee","--fe-border-strong":"#aebfda","--fe-text":"#151f38","--fe-text-muted":"#49587a","--fe-text-on-primary":"#ffffff","--fe-primary":"#2c4a9e","--fe-primary-hover":"#213a80","--fe-danger":"#c62828","--fe-danger-hover":"#a51f1f"},dark:{"--fe-bg":"#0a1024","--fe-bg-elev":"#111a35","--fe-bg-hover":"#1a2547","--fe-bg-selected":"#243665","--fe-border":"#26335a","--fe-border-strong":"#3c4e84","--fe-text":"#dfe6f7","--fe-text-muted":"#96a5cc","--fe-text-on-primary":"#050b26","--fe-primary":"#6d8dfc","--fe-primary-hover":"#5273f2","--fe-danger":"#f87171","--fe-danger-hover":"#ef4444"}},{id:"forest",nameKey:"theme.name.forest",light:{"--fe-bg":"#f5faf5","--fe-bg-elev":"#eaf3eb","--fe-bg-hover":"#dcecdf","--fe-bg-selected":"#c8e2ce","--fe-border":"#d2e2d4","--fe-border-strong":"#a2c3a8","--fe-text":"#182b1d","--fe-text-muted":"#42604a","--fe-text-on-primary":"#ffffff","--fe-primary":"#2b7a41","--fe-primary-hover":"#226334","--fe-danger":"#c62828","--fe-danger-hover":"#a51f1f"},dark:{"--fe-bg":"#0d1611","--fe-bg-elev":"#132019","--fe-bg-hover":"#1b2d23","--fe-bg-selected":"#264532","--fe-border":"#28402f","--fe-border-strong":"#3e5f49","--fe-text":"#dcebe0","--fe-text-muted":"#93b09b","--fe-text-on-primary":"#04180b","--fe-primary":"#54c17a","--fe-primary-hover":"#3fae66","--fe-danger":"#f87171","--fe-danger-hover":"#ef4444"}},{id:"amber",nameKey:"theme.name.amber",light:{"--fe-bg":"#fdf9f0","--fe-bg-elev":"#f7efdd","--fe-bg-hover":"#f0e3c8","--fe-bg-selected":"#ead6ab","--fe-border":"#e6dabf","--fe-border-strong":"#c6b184","--fe-text":"#33270f","--fe-text-muted":"#655631","--fe-text-on-primary":"#ffffff","--fe-primary":"#9a4b00","--fe-primary-hover":"#7c3c00","--fe-danger":"#c62828","--fe-danger-hover":"#a51f1f"},dark:{"--fe-bg":"#191307","--fe-bg-elev":"#231a0c","--fe-bg-hover":"#2f2312","--fe-bg-selected":"#44331b","--fe-border":"#3b2e17","--fe-border-strong":"#5b4a29","--fe-text":"#f2e7d4","--fe-text-muted":"#bda887","--fe-text-on-primary":"#2a1c02","--fe-primary":"#f5a524","--fe-primary-hover":"#ffb84d","--fe-danger":"#f87171","--fe-danger-hover":"#ef4444"}},{id:"lilac",nameKey:"theme.name.lilac",light:{"--fe-bg":"#faf7fd","--fe-bg-elev":"#f2ecfa","--fe-bg-hover":"#e8ddf5","--fe-bg-selected":"#dccaf0","--fe-border":"#e1d6ee","--fe-border-strong":"#bda6d9","--fe-text":"#241a33","--fe-text-muted":"#584871","--fe-text-on-primary":"#ffffff","--fe-primary":"#7231e0","--fe-primary-hover":"#5f21c4","--fe-danger":"#c62828","--fe-danger-hover":"#a51f1f"},dark:{"--fe-bg":"#130f1c","--fe-bg-elev":"#1b1527","--fe-bg-hover":"#261d37","--fe-bg-selected":"#37294f","--fe-border":"#302546","--fe-border-strong":"#4b3a6d","--fe-text":"#e9e2f5","--fe-text-muted":"#a999c5","--fe-text-on-primary":"#180d33","--fe-primary":"#b197fa","--fe-primary-hover":"#9c7cf4","--fe-danger":"#f87171","--fe-danger-hover":"#ef4444"}},{id:"contrast",nameKey:"theme.name.contrast",light:{"--fe-bg":"#ffffff","--fe-bg-elev":"#f2f2f2","--fe-bg-hover":"#e0e0e0","--fe-bg-selected":"#c9dcff","--fe-border":"#5c5c5c","--fe-border-strong":"#000000","--fe-text":"#000000","--fe-text-muted":"#3d3d3d","--fe-text-on-primary":"#ffffff","--fe-primary":"#003d99","--fe-primary-hover":"#002a6b","--fe-danger":"#a80000","--fe-danger-hover":"#7d0000","--fe-shadow":"0 0 0 1px #000000, 0 10px 32px rgba(0, 0, 0, 0.25)","--fe-shadow-sm":"0 0 0 1px #000000"},dark:{"--fe-bg":"#000000","--fe-bg-elev":"#0d0d0d","--fe-bg-hover":"#212121","--fe-bg-selected":"#003d80","--fe-border":"#8f8f8f","--fe-border-strong":"#ffffff","--fe-text":"#ffffff","--fe-text-muted":"#d6d6d6","--fe-text-on-primary":"#001430","--fe-primary":"#7ab8ff","--fe-primary-hover":"#9ccaff","--fe-danger":"#ff7575","--fe-danger-hover":"#ff9999","--fe-shadow":"0 0 0 1px #ffffff, 0 12px 32px rgba(0, 0, 0, 0.65)","--fe-shadow-sm":"0 0 0 1px #ffffff"}},{id:"gray",nameKey:"theme.name.gray",light:{"--fe-bg":"#f7f7f8","--fe-bg-elev":"#efeff1","--fe-bg-hover":"#e4e4e7","--fe-bg-selected":"#d6d7db","--fe-border":"#dfdfe2","--fe-border-strong":"#b9b9c0","--fe-text":"#26272b","--fe-text-muted":"#585a63","--fe-text-on-primary":"#ffffff","--fe-primary":"#4b4b54","--fe-primary-hover":"#38383f","--fe-danger":"#c62828","--fe-danger-hover":"#a51f1f"},dark:{"--fe-bg":"#131316","--fe-bg-elev":"#1b1b1f","--fe-bg-hover":"#26262b","--fe-bg-selected":"#35353c","--fe-border":"#2d2d33","--fe-border-strong":"#4a4a52","--fe-text":"#e6e6e9","--fe-text-muted":"#a4a4ad","--fe-text-on-primary":"#17171b","--fe-primary":"#b0b0ba","--fe-primary-hover":"#c4c4cd","--fe-danger":"#f87171","--fe-danger-hover":"#ef4444"}},{id:"terminal",nameKey:"theme.name.terminal",light:{"--fe-bg":"#f3f9f4","--fe-bg-elev":"#e5f2e8","--fe-bg-hover":"#d5ead9","--fe-bg-selected":"#bce3c6","--fe-border":"#cbe2d1","--fe-border-strong":"#94c2a0","--fe-text":"#0c2913","--fe-text-muted":"#31573c","--fe-text-on-primary":"#ffffff","--fe-primary":"#116b33","--fe-primary-hover":"#0c5427","--fe-danger":"#c62828","--fe-danger-hover":"#a51f1f","--fe-font":'ui-monospace, "SF Mono", Consolas, Menlo, monospace'},dark:{"--fe-bg":"#050d07","--fe-bg-elev":"#0a1710","--fe-bg-hover":"#112418","--fe-bg-selected":"#1a3a26","--fe-border":"#1c3a2a","--fe-border-strong":"#316144","--fe-text":"#4fdd8b","--fe-text-muted":"#38a668","--fe-text-on-primary":"#03180a","--fe-primary":"#25c95e","--fe-primary-hover":"#4fdd8b","--fe-danger":"#ff6b62","--fe-danger-hover":"#ff8d86","--fe-font":'ui-monospace, "SF Mono", Consolas, Menlo, monospace'}}];function al(e){return kf.find(t=>t.id===e)}const Pk=Array.from(new Set(kf.flatMap(e=>[...Object.keys(e.light),...Object.keys(e.dark)])));function Fk(){try{const e=localStorage.getItem(R0);return e&&al(e)?e:Ta}catch{return Ta}}const Sf=re(typeof window>"u"?Ta:Fk());function Rk(e){const t=al(e)?e:Ta;Sf.value=t;try{t===Ta?localStorage.removeItem(R0):localStorage.setItem(R0,t)}catch{}}function Lk(){return{themeId:Sf,setTheme:Rk}}if(typeof window<"u")try{window.addEventListener("storage",e=>{e.key===R0&&(Sf.value=e.newValue&&al(e.newValue)?e.newValue:Ta)})}catch{}function Bk(e,t,r){for(const i of Pk)e.style.removeProperty(i);if(t===Ta)return;const n=al(t);if(!n)return;const a=r?n.dark:n.light;for(const[i,o]of Object.entries(a))e.style.setProperty(i,o)}const tm="data-filex-theme";function rm(e){return Object.entries(e).map(([t,r])=>`${t}:${r};`).join("")}function $k(e){const t=rm(e.light),r=rm(e.dark),n=[".fe--theme-dark",":root[data-theme='dark'] .fe",".fe.fe--theme-dark",":root.dark",".dark",":root.dark .fe",".dark .fe",".fe-ctx-backdrop--theme-dark",".fe-ctx-backdrop--theme-auto[data-prefers-dark='1']"].join(","),a=[".fe:not(.fe--theme-light)",".fe-ctx-backdrop--theme-auto:not(.fe-ctx-backdrop--theme-light)"].join(",");return`/* filex theme: ${e.id} */:root,.fe{${t}}${n}{${r}}@media (prefers-color-scheme: dark){${a}{${r}}}`}function Nk(e){if(typeof document>"u")return;let t=document.head.querySelector(`style[${tm}]`);const r=e===Ta?void 0:al(e);if(!r){t&&(t.textContent="");return}t?t!==document.head.lastElementChild&&document.head.appendChild(t):(t=document.createElement("style"),t.setAttribute(tm,""),document.head.appendChild(t));const n=$k(r);t.textContent!==n&&(t.textContent=n)}const Uk={class:"fe-themes__hint"},Hk=["aria-label"],jk=["aria-selected","onClick"],Gk={class:"fe-themecard__name"},Vk=["title"],qk=["disabled"],Kk=Pt({__name:"ThemeGallery",props:{open:{type:Boolean},locale:{},theme:{},dark:{type:Boolean},current:{}},emits:["close","select"],setup(e,{emit:t}){const r=e,n=t,{t:a}=br(()=>r.locale);function i(s){return r.dark?s.dark:s.light}const o=Ta;return(s,l)=>(R(),Zt(ei,{open:e.open,title:Y(a)("theme.title"),size:"lg",theme:e.theme,onClose:l[2]||(l[2]=c=>n("close"))},{actions:ur(()=>[T("button",{type:"button",class:"fe-btn",disabled:e.current===Y(o),onClick:l[0]||(l[0]=c=>n("select",Y(o)))},V(Y(a)("theme.reset")),9,qk),T("button",{type:"button",class:"fe-btn fe-btn--primary",onClick:l[1]||(l[1]=c=>n("close"))},V(Y(a)("theme.close")),1)]),default:ur(()=>[T("p",Uk,V(Y(a)("theme.hint")),1),T("div",{class:"fe-themes",role:"listbox","aria-label":Y(a)("theme.title")},[(R(!0),$(qe,null,xt(Y(kf),c=>(R(),$("button",{key:c.id,type:"button",class:vt(["fe-themecard",{"is-selected":c.id===e.current}]),role:"option","aria-selected":c.id===e.current,style:Sn(i(c)),onClick:u=>n("select",c.id)},[l[3]||(l[3]=T("span",{class:"fe-themecard__preview","aria-hidden":"true"},[T("span",{class:"fe-themecard__topbar"},[T("span",{class:"fe-themecard__chip fe-themecard__chip--primary"}),T("span",{class:"fe-themecard__chip"}),T("span",{class:"fe-themecard__chip fe-themecard__chip--ghost"})]),T("span",{class:"fe-themecard__row"},[T("span",{class:"fe-themecard__dot"}),T("span",{class:"fe-themecard__line",style:{width:"62%"}})]),T("span",{class:"fe-themecard__row fe-themecard__row--selected"},[T("span",{class:"fe-themecard__dot fe-themecard__dot--primary"}),T("span",{class:"fe-themecard__line",style:{width:"44%"}})]),T("span",{class:"fe-themecard__row"},[T("span",{class:"fe-themecard__dot fe-themecard__dot--muted"}),T("span",{class:"fe-themecard__line fe-themecard__line--muted",style:{width:"74%"}})])],-1)),T("span",Gk,[$t(V(Y(a)(c.nameKey))+" ",1),c.id===e.current?(R(),$("span",{key:0,class:"fe-themecard__check",title:Y(a)("theme.selected")},"✓",8,Vk)):Te("",!0)])],14,jk))),128))],8,Hk)]),_:1},8,["open","title","theme"]))}}),Wk={class:"fe-shortset"},Yk={class:"fe-shortset__topbar"},Xk={class:"fe-shortset__hint"},Zk=["disabled"],Jk={class:"fe-shortcuts__heading"},Qk={class:"fe-shortset__row"},eS={class:"fe-shortset__label"},tS=["title"],rS={class:"fe-shortset__keys"},nS={key:0,class:"fe-shortset__capture",role:"status"},aS={key:0,class:"fe-shortcuts__unbound"},iS={class:"fe-kbd"},oS={key:0,class:"fe-shortcuts__or","aria-hidden":"true"},sS={class:"fe-shortset__actions"},lS=["onClick"],cS=["title","aria-label","onClick"],uS={key:1,class:"fe-shortset__fixed"},fS={key:0,class:"fe-shortset__conflict",role:"alert"},dS={class:"fe-shortset__conflict-msg"},pS={class:"fe-kbd"},hS={class:"fe-shortset__conflict-actions"},vS=Pt({__name:"ShortcutSettings",props:{open:{type:Boolean},locale:{},theme:{}},emits:["close"],setup(e,{emit:t}){const r=e,n=t,{t:a}=br(()=>r.locale),i=Bv(),o=Fe(()=>{const g=[],S=new Map;for(const M of i.value)S.has(M.groupKey)||(S.set(M.groupKey,[]),g.push(M.groupKey)),S.get(M.groupKey).push(M);return g.map(M=>({key:M,items:S.get(M)}))}),s=Fe(()=>i.value.some(g=>g.overridden)),l=re(null),c=re(null);function u(g){const S=so.find(M=>M.id===g);return S?a(S.labelKey):g}function d(g){c.value=null,l.value=g}function f(){l.value=null}function p(g,S){if(l.value=null,S===z0(g))return;const M=_x(S,g);if(M){c.value={id:g,combo:S,conflictId:M.id,fixed:M.fixed};return}bf(g,S)}function _(){const g=c.value;!g||g.fixed||(bf(g.conflictId,""),bf(g.id,g.combo),c.value=null)}function h(){c.value=null}function b(g){c.value=null,bx(g)}function v(){c.value=null,l.value=null,yx()}function m(g){if(l.value){if(g.preventDefault(),g.stopPropagation(),g.key==="Escape"){f();return}const S=Lv(g);if(!S)return;p(l.value,S);return}g.key==="Escape"||g.key==="Tab"||g.stopPropagation()}At(()=>r.open,g=>{g?window.addEventListener("keydown",m,!0):(window.removeEventListener("keydown",m,!0),l.value=null,c.value=null)}),tr(()=>window.removeEventListener("keydown",m,!0));function y(){if(l.value){f();return}n("close")}return(g,S)=>(R(),Zt(ei,{open:e.open,title:Y(a)("shortcuts.settings.title"),size:"lg",theme:e.theme,onClose:y},{actions:ur(()=>[T("button",{type:"button",class:"fe-btn",onClick:y},V(Y(a)("viewer.close")),1)]),default:ur(()=>[T("div",Wk,[T("div",Yk,[T("p",Xk,V(Y(a)("shortcuts.settings.hint")),1),T("button",{type:"button",class:"fe-btn fe-shortset__reset-all",disabled:!s.value,onClick:v}," ↺ "+V(Y(a)("shortcuts.settings.reset_all")),9,Zk)]),(R(!0),$(qe,null,xt(o.value,M=>(R(),$("section",{key:M.key,class:"fe-shortset__group"},[T("h3",Jk,V(Y(a)(M.key)),1),(R(!0),$(qe,null,xt(M.items,E=>{var w;return R(),$("div",{key:E.id,class:vt(["fe-shortset__item",{"is-capturing":l.value===E.id,"is-conflict":((w=c.value)==null?void 0:w.id)===E.id}])},[T("div",Qk,[T("span",eS,[$t(V(Y(a)(E.labelKey))+" ",1),E.overridden?(R(),$("span",{key:0,class:"fe-shortcuts__custom",title:Y(a)("shortcuts.settings.customized")},"●",8,tS)):Te("",!0)]),T("span",rS,[l.value===E.id?(R(),$("span",nS,V(Y(a)("shortcuts.settings.capture")),1)):(R(),$(qe,{key:1},[E.keys.length===0?(R(),$("span",aS,V(Y(a)("shortcuts.settings.unbound")),1)):(R(!0),$(qe,{key:1},xt(E.keys,(x,C)=>(R(),$(qe,{key:x},[T("kbd",iS,V(x),1),C<E.keys.length-1?(R(),$("span",oS,"/")):Te("",!0)],64))),128))],64))]),T("span",sS,[E.customizable?(R(),$(qe,{key:0},[l.value!==E.id?(R(),$("button",{key:0,type:"button",class:"fe-btn fe-shortset__btn",onClick:x=>d(E.id)},V(Y(a)("shortcuts.settings.change")),9,lS)):(R(),$("button",{key:1,type:"button",class:"fe-btn fe-shortset__btn",onClick:f},V(Y(a)("shortcuts.settings.conflict_cancel")),1)),E.overridden?(R(),$("button",{key:2,type:"button",class:"fe-btn fe-btn--icon-only fe-shortset__btn",title:Y(a)("shortcuts.settings.reset"),"aria-label":Y(a)("shortcuts.settings.reset"),onClick:x=>b(E.id)}," ↺ ",8,cS)):Te("",!0)],64)):(R(),$("span",uS,V(Y(a)("shortcuts.settings.fixed")),1))])]),c.value&&c.value.id===E.id?(R(),$("div",fS,[T("span",dS,[T("kbd",pS,V(c.value.combo),1),$t(" "+V(c.value.fixed?Y(a)("shortcuts.settings.conflict_fixed",{name:u(c.value.conflictId)}):Y(a)("shortcuts.settings.conflict",{name:u(c.value.conflictId)})),1)]),T("span",hS,[c.value.fixed?Te("",!0):(R(),$("button",{key:0,type:"button",class:"fe-btn fe-btn--danger fe-shortset__btn",onClick:_},V(Y(a)("shortcuts.settings.conflict_take")),1)),T("button",{type:"button",class:"fe-btn fe-shortset__btn",onClick:h},V(Y(a)("shortcuts.settings.conflict_cancel")),1)])])):Te("",!0)],2)}),128))]))),128))])]),_:1},8,["open","title","theme"]))}}),mS={key:0,class:"fe-preview"},gS=["src","alt"],bS=["src"],yS=["src"],_S=["data"],xS={class:"fe-preview__fallback"},wS=["href"],kS={key:0,class:"fe-preview__fallback"},SS={key:1,class:"fe-preview__fallback"},CS=["href"],ES={key:2,class:"fe-preview__md-split"},AS={class:"fe-preview__md-split-bar"},TS={key:0,class:"fe-preview__md-split-error"},MS=["disabled"],DS={class:"fe-preview__md-split-body"},zS=["onKeydown"],IS=["innerHTML"],OS={key:3,class:"fe-preview__fallback"},PS=["href"],FS=["innerHTML"],RS={key:5,class:"fe-preview__pre"},LS={key:0,class:"fe-preview__fallback"},BS=["href"],$S={key:1,class:"fe-preview__fallback"},NS={key:0,class:"fe-preview__fallback"},US={key:1,class:"fe-preview__fallback"},HS=["href"],jS={key:2,class:"fe-preview__fallback"},GS=["href"],VS={key:3,class:"fe-preview__code-wrap"},qS={class:"fe-preview__code-toolbar"},KS={class:"fe-preview__code-lang"},WS={key:0,class:"fe-preview__code-status"},YS={key:1,class:"fe-preview__code-status fe-preview__code-status--ok"},XS=["title"],ZS={key:3,class:"fe-preview__code-status"},JS=["disabled"],QS={key:0,class:"fe-preview__pre fe-preview__code hljs"},eC=["innerHTML"],tC=["data-lang"],rC={key:0,class:"fe-preview__fallback"},nC=["href"],aC={key:8,class:"fe-preview__fallback"},iC=["href"],oC=["href"],Cf=1e6,nm="fe-onlyoffice-api-js",am=Pt({__name:"PreviewModal",props:{open:{type:Boolean},locale:{},file:{},previewUrl:{type:Function},downloadUrl:{type:Function},onlyOfficeBase:{},onlyOfficeConfigEndpoint:{},saveTextEndpoint:{},openMode:{},authHeaders:{type:Function},authCredentials:{},drawioUrl:{},pdfWorkerUrl:{},pdfSaveUrl:{},viewerBaseUrl:{},newTabEnabled:{type:Boolean},chromeless:{type:Boolean},theme:{}},emits:["close"],setup(e,{emit:t}){const r=e,n=t,{t:a}=br(()=>r.locale);function i($e){return(($e==null?void 0:$e.extension)||"").toLowerCase()}const o=["jpg","jpeg","png","webp","gif","bmp","avif","svg","heic"],s=["mp4","webm","mov","mkv","m4v","ogv"],l=["mp3","wav","ogg","flac","m4a","aac","opus"],c={md:"markdown",markdown:"markdown",txt:"plaintext",log:"plaintext",js:"javascript",mjs:"javascript",cjs:"javascript",ts:"typescript",tsx:"typescript",jsx:"javascript",vue:"xml",svelte:"xml",html:"xml",htm:"xml",xml:"xml",svg:"xml",css:"css",scss:"scss",sass:"scss",less:"less",json:"json",jsonc:"json",yml:"yaml",yaml:"yaml",php:"php",py:"python",rb:"ruby",go:"go",rs:"rust",java:"java",kt:"kotlin",swift:"swift",cpp:"cpp",c:"c",h:"cpp",hpp:"cpp",cs:"csharp",dart:"dart",sh:"bash",bash:"bash",zsh:"bash",fish:"bash",sql:"sql",toml:"ini",ini:"ini",conf:"ini",env:"bash",cfg:"ini",dockerfile:"dockerfile",graphql:"graphql",gql:"graphql",diff:"diff",patch:"diff"},u=["txt","log"],d=["docx","doc","xlsx","xls","pptx","ppt","odt","ods","odp","rtf"],f={glb:()=>Promise.resolve().then(()=>jo),gltf:()=>Promise.resolve().then(()=>jo),obj:()=>Promise.resolve().then(()=>jo),stl:()=>Promise.resolve().then(()=>jo),fbx:()=>Promise.resolve().then(()=>jo),"3ds":()=>Promise.resolve().then(()=>jo),epub:()=>Promise.resolve().then(()=>uD),mmd:()=>Promise.resolve().then(()=>Tm),mermaid:()=>Promise.resolve().then(()=>Tm),drawio:()=>Promise.resolve().then(()=>Mm),dio:()=>Promise.resolve().then(()=>Mm),tif:()=>Promise.resolve().then(()=>Dm),tiff:()=>Promise.resolve().then(()=>Dm),psd:()=>Promise.resolve().then(()=>MD),ipynb:()=>Promise.resolve().then(()=>KD),csv:()=>Promise.resolve().then(()=>Im),tsv:()=>Promise.resolve().then(()=>Im),zip:()=>Promise.resolve().then(()=>vz)},p=Fe(()=>{const $e=i(r.file);if(!$e)return"other";if(o.includes($e))return"image";if(s.includes($e))return"video";if(l.includes($e))return"audio";if($e==="pdf")return"pdf";const L=r.openMode!=="view";return $e==="md"||$e==="markdown"?"markdown":$e in c?"code":$e in f?"viewer":d.includes($e)?"office":u.includes($e)?L?"code":"text":"other"}),_=o_(null),h=re(null),b=re(!1);async function v($e){_.value=null,h.value=null;const L=f[$e];if(L)try{const ge=await L();_.value=ge.default??ge}catch(ge){h.value=ge instanceof Error?ge.message:"viewer load failed",$e==="pdf"&&(b.value=!0)}}function m(){b.value=!0}const y=Fe(()=>{var ge;const $e=i(r.file),L={url:x.value,ext:$e,mime:(ge=r.file)==null?void 0:ge.mime_type,t:a,authHeaders:r.authHeaders,authCredentials:r.authCredentials};return r.file&&(L.filePath=D(r.file.path),($e==="zip"||$e==="rar"||$e==="7z"||$e==="tar"||$e==="gz"||$e==="tgz")&&(L.filePath=r.file.path)),($e==="drawio"||$e==="dio")&&(L.drawioUrl=r.drawioUrl??void 0,L.saveUrl=r.saveTextEndpoint??void 0,L.readOnly=r.openMode==="view"),$e==="pdf"&&(L.pdfWorkerUrl=r.pdfWorkerUrl??void 0,L.pdfSaveUrl=r.pdfSaveUrl??void 0),L});function g(){M(r.openMode||"edit")}function S(){M("edit")}function M($e){if(!r.file)return;const L=i(r.file),ge=r.viewerBaseUrl||"/files/edit",Oe=ge.includes("?")?"&":"?",He=`${ge}${Oe}path=${encodeURIComponent(r.file.path)}&type=${encodeURIComponent(L)}&mode=${encodeURIComponent($e)}`;window.open(He,"_blank","noopener")}const E=new Set(["docx","doc","xlsx","xls","pptx","ppt","odt","ods","odp","rtf","drawio","dio","mmd","mermaid","md","markdown","txt","log","json","jsonc","yaml","yml","xml","svg","html","htm","js","mjs","cjs","ts","tsx","jsx","vue","svelte","css","scss","sass","less","php","py","rb","go","rs","java","kt","swift","cpp","c","h","hpp","cs","dart","sh","bash","sql","toml","ini","conf","cfg","env","dockerfile","graphql","gql"]),w=Fe(()=>!!r.file&&E.has(i(r.file))),x=Fe(()=>r.file?r.previewUrl(r.file.path):""),C=Fe(()=>r.file?r.downloadUrl(r.file.path):"");function D($e){const L=$e.indexOf("://");return L===-1?$e:$e.slice(L+3)}const B=re(!1),F=re(null),K=re(""),te=re(!1),J=re(!1),ne=re(!1);let le,q;function j(){J.value=!0,le&&clearTimeout(le),le=setTimeout(()=>{Ae(K.value)},250),q&&clearTimeout(q),q=setTimeout(()=>{P()},1500)}async function P(){if(!(!r.saveTextEndpoint||!r.file||ne.value)){ne.value=!0,F.value=null;try{const $e={"Content-Type":"application/json",...await(r.authHeaders??(()=>({})))()},L=await fetch(r.saveTextEndpoint,{method:"POST",headers:$e,credentials:r.authCredentials||"same-origin",body:JSON.stringify({path:D(r.file.path),content:K.value})});if(!L.ok)throw new Error(`save failed: ${L.status} ${await L.text()}`);J.value=!1}catch($e){F.value=$e instanceof Error?$e.message:String($e)}finally{ne.value=!1}}}async function N($e){B.value=!0,F.value=null,K.value="",te.value=!1;try{const L={};r.authHeaders&&Object.assign(L,r.authHeaders());const ge=await fetch($e,{credentials:r.authCredentials||"include",headers:L});if(!ge.ok)throw new Error(`${ge.status} ${ge.statusText}`);if(Number(ge.headers.get("content-length")||"0")>Cf){te.value=!0;return}const He=await ge.text();He.length>Cf?(te.value=!0,K.value=He.slice(0,Cf)):K.value=He}catch(L){F.value=L instanceof Error?L.message:String(L)}finally{B.value=!1}}const X=re(""),Ee=re(null);async function Ae($e){try{const L=await import("markdown-it").catch(()=>null);if(!L){X.value="";return}const ge=L.default??L,He=new ge({html:!0,linkify:!0,breaks:!0,typographer:!0}).render($e);X.value=ze(He),await new Promise(de=>setTimeout(de,0)),await Le()}catch(L){X.value="",F.value=L instanceof Error?L.message:String(L)}}function ze($e){return $e.replace(/<\s*script\b[^<]*(?:(?!<\s*\/\s*script\s*>)<[^<]*)*<\s*\/\s*script\s*>/gi,"").replace(/<\s*iframe\b[\s\S]*?<\s*\/\s*iframe\s*>/gi,"").replace(/<\s*object\b[\s\S]*?<\s*\/\s*object\s*>/gi,"").replace(/<\s*embed\b[^>]*>/gi,"").replace(/\son\w+\s*=\s*(?:"[^"]*"|'[^']*'|[^\s>]+)/gi,"").replace(/(href|src|action|formaction|xlink:href)\s*=\s*(?:"\s*javascript:[^"]*"|'\s*javascript:[^']*')/gi,'$1="#"')}async function Le(){var He,de,Me;if(!Ee.value)return;const $e=Ee.value,L=Array.from($e.querySelectorAll("pre > code"));if(L.length===0)return;let ge,Oe;for(const G of L){const je=G.className||"",wt=/\blanguage-mermaid\b/.test(je)||/\blanguage-mmd\b/.test(je),A=/\blanguage-math\b/.test(je)||/\blanguage-latex\b/.test(je)||/\blanguage-tex\b/.test(je);if(wt){if(ge===void 0)try{const ie=await import("mermaid");ge=ie.default??ie,(He=ge.initialize)==null||He.call(ge,{startOnLoad:!1,securityLevel:"strict"})}catch{ge=null}if(!ge)continue;try{const ie=`filex-md-mermaid-${Math.random().toString(36).slice(2)}`,{svg:ae}=await ge.render(ie,G.textContent||""),U=document.createElement("div");U.className="fe-preview__md-mermaid",U.innerHTML=ae,(de=G.parentElement)==null||de.replaceWith(U)}catch{}}else if(A){if(Oe===void 0)try{const ie=await Promise.resolve().then(()=>QI);Oe=ie.default??ie}catch{Oe=null}if(!Oe)continue;try{const ie=Oe.renderToString(G.textContent||"",{displayMode:!0,throwOnError:!1}),ae=document.createElement("div");ae.className="fe-preview__md-math",ae.innerHTML=ie,(Me=G.parentElement)==null||Me.replaceWith(ae)}catch{}}}}const he=re("");async function Ie($e,L){try{const ge=await Hv();if(!ge){he.value="";return}const Oe=ge.default??ge;if(Oe.getLanguage(L)){const He=Oe.highlight($e,{language:L,ignoreIllegals:!0});he.value=He.value}else{const He=Oe.highlightAuto($e);he.value=He.value}}catch(ge){he.value="",F.value=ge instanceof Error?ge.message:String(ge)}}const De=re(null);let Be=null,Z;const se=re(!1),we=re(!1),Se=re(!1),me=re(null);function ye(){if(Be){try{Be.dispose()}catch{}Be=null}se.value=!1,Se.value=!1,me.value=null}function xe($e){return{js:"javascript",mjs:"javascript",cjs:"javascript",ts:"typescript",tsx:"typescript",jsx:"javascript",json:"json",jsonc:"json",css:"css",scss:"scss",sass:"scss",less:"less",html:"html",htm:"html",vue:"html",svelte:"html",xml:"xml",svg:"xml",md:"markdown",markdown:"markdown",php:"php",py:"python",yml:"yaml",yaml:"yaml",go:"go",rs:"rust",sql:"sql",cpp:"cpp",c:"c",h:"cpp",hpp:"cpp",sh:"shell",bash:"shell",dockerfile:"dockerfile",toml:"ini",ini:"ini",conf:"ini",cfg:"ini"}[$e]??"plaintext"}async function ee($e,L){var Oe;const ge=await Uv();if(!ge||!De.value)return!1;try{ye();const He=!!r.saveTextEndpoint&&r.openMode!=="view",de=r.theme==="dark"?!0:r.theme==="light"?!1:(Oe=window.matchMedia)==null?void 0:Oe.call(window,"(prefers-color-scheme: dark)").matches;return Be=ge.editor.create(De.value,{value:$e,language:xe(L),readOnly:!He,theme:de?"vs-dark":"vs",automaticLayout:!0,minimap:{enabled:!1},fontSize:13}),He&&(Be.addCommand(ge.KeyMod.CtrlCmd|ge.KeyCode.KeyS,()=>void pe()),Be.onDidChangeModelContent(()=>{Z&&clearTimeout(Z),Z=setTimeout(()=>{pe()},1500)})),se.value=!0,!0}catch(He){return F.value=`Monaco mount fail: ${He.message}`,!1}}async function pe(){if(!(!r.saveTextEndpoint||!r.file)&&r.openMode!=="view"&&!we.value){we.value=!0,Se.value=!1,me.value=null;try{const $e=Be?Be.getValue():"",L={"Content-Type":"application/json"};r.authHeaders&&Object.assign(L,r.authHeaders());const ge=await fetch(r.saveTextEndpoint,{method:"POST",headers:L,credentials:r.authCredentials||"same-origin",body:JSON.stringify({path:D(r.file.path),content:$e})});if(!ge.ok){const Oe=await ge.text().catch(()=>"");throw new Error(`${ge.status} ${ge.statusText}${Oe?" — "+Oe.slice(0,150):""}`)}Se.value=!0,setTimeout(()=>{Se.value=!1},2500)}catch($e){me.value=$e.message}finally{we.value=!1}}}async function ve($e,L,ge){if(K.value="",X.value="",he.value="",F.value=null,Ue.value=null,_.value=null,h.value=null,b.value=!1,lt(),ye(),!(!$e||!L)){if(ge==="viewer"){await v(i(r.file));return}if(ge==="markdown"||ge==="code"||ge==="text"){if(await N(L),te.value)return;if(ge==="markdown"){await Ae(K.value);return}const Oe=c[i(r.file)]||"";Lx()?(await new Promise(Me=>setTimeout(Me,0)),await ee(K.value,i(r.file))||await Ie(K.value,Oe)):(ge==="code"&&await Ie(K.value,Oe),Uv().then(async de=>{de&&r.open&&(await new Promise(Me=>setTimeout(Me,0)),await ee(K.value,i(r.file)))}))}else ge==="office"&&(await new Promise(Oe=>setTimeout(Oe,0)),await rt())}}At(()=>[r.open,x.value,p.value,r.openMode],([$e,L,ge])=>{ve($e,L,ge)}),Xt(()=>{Nr(()=>{r.open&&ve(r.open,x.value,p.value)})});const Pe=Fe(()=>c[i(r.file)]||"plaintext"),Ge=re(null),Ue=re(null);let We=null;async function rt(){if(Ue.value=null,!(!r.file||p.value!=="office")){if(!r.onlyOfficeConfigEndpoint){Ue.value="OnlyOffice yapılandırması yok";return}if(Ge.value)try{const $e={"Content-Type":"application/json"};r.authHeaders&&Object.assign($e,r.authHeaders());const L=await fetch(r.onlyOfficeConfigEndpoint,{method:"POST",headers:$e,credentials:r.authCredentials||"same-origin",body:JSON.stringify({path:r.file.path,mode:r.openMode||"edit"})});if(!L.ok)throw new Error(`Config fetch ${L.status}: ${(await L.text()).slice(0,200)}`);const{config:ge,documentServerUrl:Oe}=await L.json();await St(Oe),lt();const He="fe-onlyoffice-mount";Ge.value.id=He,ge.events={onError:Me=>{Ue.value=ft(Me)}};const de=window;if(!de.DocsAPI||!de.DocsAPI.DocEditor)throw new Error("DocsAPI not available after script load");We=new de.DocsAPI.DocEditor(He,ge)}catch($e){Ue.value=$e instanceof Error?$e.message:String($e)}}}function lt(){var $e;try{($e=We==null?void 0:We.destroyEditor)==null||$e.call(We)}catch{}We=null}tr(()=>{lt(),ye()});function ft($e){if(typeof $e=="string")return $e;const L=$e;if(L!=null&&L.data&&typeof L.data=="object"){const ge=L.data;if(typeof ge.errorDescription=="string")return ge.errorDescription;if(typeof ge.message=="string")return ge.message;if(ge.errorCode!==void 0)return`OnlyOffice error ${ge.errorCode}`}if(typeof(L==null?void 0:L.data)=="string")return L.data;if(typeof(L==null?void 0:L.errorDescription)=="string")return L.errorDescription;if(typeof(L==null?void 0:L.message)=="string")return L.message;try{return JSON.stringify($e)}catch{return"OnlyOffice error"}}function St($e){return new Promise((L,ge)=>{var de;if((de=window.DocsAPI)!=null&&de.DocEditor){L();return}const Oe=document.getElementById(nm);if(Oe){Oe.addEventListener("load",()=>L()),Oe.addEventListener("error",()=>ge(new Error("OnlyOffice api.js load failed")));return}const He=document.createElement("script");He.id=nm,He.src=`${$e.replace(/\/$/,"")}/web-apps/apps/api/documents/api.js`,He.async=!0,He.onload=()=>L(),He.onerror=()=>ge(new Error("OnlyOffice api.js load failed")),document.head.appendChild(He)})}return($e,L)=>{var ge;return R(),Zt(ei,{open:e.open,size:"xl",title:((ge=e.file)==null?void 0:ge.basename)||"",chromeless:e.chromeless,theme:e.theme,onClose:L[2]||(L[2]=Oe=>n("close"))},{actions:ur(()=>[e.file&&e.openMode==="view"&&w.value&&e.newTabEnabled!==!1?(R(),$("button",{key:0,type:"button",class:"fe-btn fe-btn--primary",onClick:S},"✏ "+V(Y(a)("viewer.edit")),1)):Te("",!0),e.file&&e.newTabEnabled!==!1?(R(),$("button",{key:1,type:"button",class:"fe-btn",onClick:g},"↗ "+V(Y(a)("viewer.open_in_new_tab")),1)):Te("",!0),e.file?(R(),$("a",{key:2,href:C.value,class:"fe-btn"},V(Y(a)("viewer.download")),9,oC)):Te("",!0),T("button",{type:"button",class:"fe-btn",onClick:L[1]||(L[1]=Oe=>n("close"))},V(Y(a)("viewer.close")),1)]),default:ur(()=>[e.file?(R(),$("div",mS,[p.value==="image"?(R(),$("img",{key:0,src:x.value,alt:e.file.basename,class:"fe-preview__image"},null,8,gS)):p.value==="video"?(R(),$("video",{key:1,src:x.value,controls:"",preload:"metadata",class:"fe-preview__video"},null,8,bS)):p.value==="audio"?(R(),$("audio",{key:2,src:x.value,controls:"",class:"fe-preview__audio"},null,8,yS)):p.value==="pdf"?(R(),$("object",{key:3,data:x.value,type:"application/pdf",class:"fe-preview__iframe"},[T("div",xS,[L[3]||(L[3]=T("span",{class:"fe-preview__fallback-icon"},"📕",-1)),L[4]||(L[4]=T("p",null,"Tarayıcı PDF'i inline açamadı.",-1)),T("a",{href:C.value,class:"fe-btn fe-btn--primary",target:"_blank",rel:"noopener"},"PDF'i Yeni Sekmede Aç",8,wS)])],8,_S)):p.value==="markdown"?(R(),$(qe,{key:4},[B.value?(R(),$("div",kS,V(Y(a)("viewer.loading")),1)):te.value?(R(),$("div",SS,[L[5]||(L[5]=$t(" Dosya çok büyük (>1 MB). ",-1)),T("a",{href:C.value,class:"fe-btn"},V(Y(a)("viewer.download")),9,CS)])):e.openMode==="edit"&&e.saveTextEndpoint?(R(),$("div",ES,[T("div",AS,[L[6]||(L[6]=T("span",{class:"fe-preview__md-split-label"},"MARKDOWN",-1)),F.value?(R(),$("span",TS,V(F.value),1)):Te("",!0),T("button",{type:"button",class:"fe-btn fe-btn--primary",disabled:!J.value||ne.value,onClick:P},V(ne.value?Y(a)("viewer.saving"):J.value?Y(a)("viewer.save"):Y(a)("viewer.saved")),9,MS)]),T("div",DS,[Yt(T("textarea",{class:"fe-preview__md-split-input","onUpdate:modelValue":L[0]||(L[0]=Oe=>K.value=Oe),onInput:j,onKeydown:[un(Ht(P,["ctrl","prevent"]),["s"]),un(Ht(P,["meta","prevent"]),["s"])],spellcheck:"false",placeholder:"# Markdown buraya…"},null,40,zS),[[Ir,K.value]]),T("div",{ref_key:"markdownEl",ref:Ee,class:"fe-preview__md-split-output fe-preview__md",innerHTML:X.value},null,8,IS)])])):F.value?(R(),$("div",OS,[T("p",null,V(F.value),1),T("a",{href:C.value,class:"fe-btn fe-btn--primary"},V(Y(a)("viewer.download")),9,PS)])):X.value?(R(),$("div",{key:4,ref_key:"markdownEl",ref:Ee,class:"fe-preview__md",innerHTML:X.value},null,8,FS)):(R(),$("pre",RS,V(K.value),1))],64)):p.value==="viewer"?(R(),$(qe,{key:5},[h.value&&!b.value?(R(),$("div",LS,[L[7]||(L[7]=T("span",{class:"fe-preview__fallback-icon"},"⚠️",-1)),T("p",null,V(h.value),1),T("a",{href:C.value,class:"fe-btn fe-btn--primary"},V(Y(a)("viewer.download")),9,BS)])):_.value?(R(),Zt(j_(_.value),J1({key:2},y.value,{class:"fe-preview__viewer",onFallback:m}),null,16)):(R(),$("div",$S,[L[8]||(L[8]=T("span",{class:"fe-preview__fallback-icon"},"⏳",-1)),T("p",null,V(Y(a)("viewer.loading")),1)]))],64)):p.value==="code"||p.value==="text"?(R(),$(qe,{key:6},[B.value?(R(),$("div",NS,V(Y(a)("viewer.loading")),1)):te.value?(R(),$("div",US,[L[9]||(L[9]=$t(" Dosya çok büyük (>1 MB). ",-1)),T("a",{href:C.value,class:"fe-btn"},V(Y(a)("viewer.download")),9,HS)])):F.value?(R(),$("div",jS,[T("p",null,V(F.value),1),T("a",{href:C.value,class:"fe-btn fe-btn--primary"},V(Y(a)("viewer.download")),9,GS)])):(R(),$("div",VS,[T("div",qS,[T("span",KS,V(Pe.value),1),!se.value&&he.value?(R(),$("span",WS,V(e.saveTextEndpoint?Y(a)("viewer.editor_loading"):Y(a)("viewer.read_only")),1)):Te("",!0),Se.value?(R(),$("span",YS,"✓ "+V(Y(a)("viewer.saved")),1)):Te("",!0),me.value?(R(),$("span",{key:2,class:"fe-preview__code-status fe-preview__code-status--err",title:me.value},"✗ "+V(Y(a)("viewer.save_error")),9,XS)):Te("",!0),e.openMode==="view"?(R(),$("span",ZS,V(Y(a)("viewer.read_only")),1)):e.saveTextEndpoint&&se.value?(R(),$("button",{key:4,type:"button",class:"fe-btn fe-btn--primary",disabled:we.value,onClick:pe},V(we.value?Y(a)("viewer.saving"):Y(a)("viewer.save")),9,JS)):Te("",!0)]),T("div",{ref_key:"monacoEl",ref:De,class:vt(["fe-preview__code-editor",{"is-hidden":!se.value}])},null,2),!se.value&&he.value?(R(),$("pre",QS,[T("code",{class:vt(`language-${Pe.value}`),innerHTML:he.value},null,10,eC)])):!se.value&&!he.value?(R(),$("pre",{key:1,class:"fe-preview__pre","data-lang":Pe.value},V(K.value),9,tC)):Te("",!0)]))],64)):p.value==="office"?(R(),$(qe,{key:7},[Ue.value?(R(),$("div",rC,[L[10]||(L[10]=T("span",{class:"fe-preview__fallback-icon"},"📄",-1)),T("p",null,V(Ue.value),1),T("a",{href:C.value,class:"fe-btn fe-btn--primary"},V(Y(a)("viewer.download")),9,nC)])):(R(),$("div",{key:1,ref_key:"officeEl",ref:Ge,class:"fe-preview__office"},null,512))],64)):(R(),$("div",aC,[L[11]||(L[11]=T("span",{class:"fe-preview__fallback-icon"},"📎",-1)),T("p",null,V(Y(a)("viewer.no_preview")),1),T("a",{href:C.value,class:"fe-btn fe-btn--primary"},V(Y(a)("viewer.download")),9,iC)]))])):Te("",!0)]),_:1},8,["open","title","chromeless","theme"])}}}),sC=Pt({__name:"QuickLook",props:{open:{type:Boolean},locale:{},file:{},previewUrl:{type:Function},downloadUrl:{type:Function},onlyOfficeBase:{},onlyOfficeConfigEndpoint:{},authHeaders:{type:Function},authCredentials:{},drawioUrl:{},pdfWorkerUrl:{},viewerBaseUrl:{},theme:{}},emits:["close","nav","open-full"],setup(e,{emit:t}){const r=e,n=t,{t:a}=br(()=>r.locale);function i(s){const l=s;return!!(l&&(l.tagName==="INPUT"||l.tagName==="TEXTAREA"||l.tagName==="SELECT"||l.isContentEditable))}function o(s){if(r.open&&!(s.ctrlKey||s.metaKey||s.altKey)&&!i(s.target))switch(s.key){case" ":s.preventDefault(),s.stopPropagation(),n("close");break;case"ArrowRight":case"ArrowDown":s.preventDefault(),s.stopPropagation(),n("nav",1);break;case"ArrowLeft":case"ArrowUp":s.preventDefault(),s.stopPropagation(),n("nav",-1);break;case"Enter":s.preventDefault(),s.stopPropagation(),n("open-full");break}}return At(()=>r.open,s=>{s?window.addEventListener("keydown",o,!0):window.removeEventListener("keydown",o,!0)},{immediate:!0}),tr(()=>window.removeEventListener("keydown",o,!0)),(s,l)=>(R(),$(qe,null,[Dt(am,{class:"fe-quicklook",open:e.open,locale:e.locale,file:e.file,theme:e.theme,"preview-url":e.previewUrl,"download-url":e.downloadUrl,"only-office-base":e.onlyOfficeBase,"only-office-config-endpoint":e.onlyOfficeConfigEndpoint,"open-mode":"view","auth-headers":e.authHeaders,"auth-credentials":e.authCredentials,"drawio-url":e.drawioUrl,"pdf-worker-url":e.pdfWorkerUrl,"viewer-base-url":e.viewerBaseUrl,onClose:l[0]||(l[0]=c=>n("close"))},null,8,["open","locale","file","theme","preview-url","download-url","only-office-base","only-office-config-endpoint","auth-headers","auth-credentials","drawio-url","pdf-worker-url","viewer-base-url"]),Dt(Za,{name:"fe-toast"},{default:ur(()=>[e.open?(R(),$("div",{key:0,class:vt(["fe fe-ql-hint",{"fe--theme-light":e.theme==="light","fe--theme-dark":e.theme==="dark"}]),"aria-hidden":"true"},[l[1]||(l[1]=T("kbd",{class:"fe-kbd"},"Space",-1)),$t(" "+V(Y(a)("quicklook.hint_close"))+" ",1),l[2]||(l[2]=T("span",{class:"fe-ql-hint__sep"},"·",-1)),l[3]||(l[3]=T("kbd",{class:"fe-kbd"},"↑",-1)),l[4]||(l[4]=T("kbd",{class:"fe-kbd"},"↓",-1)),$t(" "+V(Y(a)("quicklook.hint_nav"))+" ",1),l[5]||(l[5]=T("span",{class:"fe-ql-hint__sep"},"·",-1)),l[6]||(l[6]=T("kbd",{class:"fe-kbd"},"Enter",-1)),$t(" "+V(Y(a)("quicklook.hint_open")),1)],2)):Te("",!0)]),_:1})],64))}}),lC=["aria-label"],cC={class:"fe-opc__head"},uC=["aria-label"],fC={class:"fe-opc__body"},dC={key:0,class:"fe-opc__section","aria-live":"polite"},pC={class:"fe-opc__section-title"},hC={class:"fe-opc__list"},vC={class:"fe-opc__kicon",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true",focusable:"false"},mC=["d"],gC={class:"fe-opc__mid"},bC=["title"],yC={class:"fe-opc__sub"},_C={class:"fe-opc__kind"},xC={class:"fe-opc__state"},wC=["aria-valuenow"],kC={key:0,class:"fe-opc__spin","aria-hidden":"true"},SC={class:"fe-opc__acts"},CC=["onClick"],EC=["onClick"],AC=["aria-label","onClick"],TC={key:1,class:"fe-opc__section"},MC={class:"fe-opc__section-title"},DC={class:"fe-opc__list fe-opc__list--history"},zC={class:"fe-opc__kicon",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true",focusable:"false"},IC=["d"],OC={class:"fe-opc__mid"},PC=["title"],FC={key:0,class:"fe-opc__sub fe-opc__sub--err"},RC={key:2,class:"fe-opc__empty"},LC=["aria-expanded","aria-label"],BC=["stroke-dashoffset"],$C={class:"fe-opc__count"},NC={key:0,class:"fe-opc__pct"},Ef=8.5,UC=Pt({__name:"OperationsCenter",props:{center:{},locale:{},narrow:{type:Boolean}},setup(e){const t=e,{t:r,formatSize:n}=br(()=>t.locale),a=re(!1),i=re(null),o=Fe(()=>t.center.active.value),s=Fe(()=>t.center.history.value),l=Fe(()=>t.center.hasError.value),c=Fe(()=>t.center.overallPercent.value),u=Fe(()=>t.center.runningCount.value),d=Fe(()=>o.value.length>0||a.value&&s.value.length>0);At(d,w=>{w||(a.value=!1)});const f=2*Math.PI*Ef,p=Fe(()=>{const w=c.value;return w===null?f*.72:f*(1-Math.min(100,Math.max(0,w))/100)}),_=Fe(()=>c.value===null&&u.value>0),h=Fe(()=>u.value===0||c.value===null?"":r("opc.percent",{n:c.value})),b=Fe(()=>r("opc.aria_badge",{n:o.value.length})),v={upload:"M12 16V5M7 9.5 12 5l5 4.5M5 19h14",copy:"M9 9h11v11H9zM5 15V4h11",move:"M4 12h13M12 6l6 6-6 6",delete:"M5 7h14M9 7V5h6v2M8 7l1 13h6l1-13",convert:"M20 8A8 8 0 0 0 6 6L4 8M4 16a8 8 0 0 0 14 2l2-2M20 3v5h-5M4 21v-5h5",archive:"M4 8V5h16v3zM5 8h14v12H5zM10 12h4"};function m(w){return r(`opc.kind.${w.kind}`)}function y(w){return w.name||m(w)}function g(w){return w.status==="running"?w.queued?r("opc.queued"):w.totalBytes&&w.totalBytes>0?`${n(w.uploadedBytes??0)} / ${n(w.totalBytes)}`:w.totalCount&&w.totalCount>0?`${w.doneCount??0}/${w.totalCount}`:r("opc.status.running"):w.status==="done"?r("opc.status.done"):w.status==="aborted"?r("opc.status.aborted"):w.error||r("opc.status.error")}function S(w){return r(`opc.status.${w.status==="running"?"running":w.status}`)}function M(w){if(!a.value)return;const x=i.value;x&&w.target instanceof Node&&!x.contains(w.target)&&(a.value=!1)}function E(w){a.value&&w.key==="Escape"&&(a.value=!1)}return Xt(()=>{document.addEventListener("mousedown",M),document.addEventListener("keydown",E)}),tr(()=>{document.removeEventListener("mousedown",M),document.removeEventListener("keydown",E)}),(w,x)=>d.value?(R(),$("div",{key:0,ref_key:"rootEl",ref:i,class:vt(["fe-opc",{"fe-opc--narrow":e.narrow,"fe-opc--open":a.value}])},[Dt(Za,{name:"fe-opc-pop"},{default:ur(()=>[a.value?(R(),$("section",{key:0,class:"fe-opc__panel",role:"dialog","aria-label":Y(r)("opc.title")},[T("header",cC,[T("strong",null,V(Y(r)("opc.title")),1),T("button",{type:"button",class:"fe-opc__x","aria-label":Y(r)("opc.close"),onClick:x[0]||(x[0]=C=>a.value=!1)},"×",8,uC)]),T("div",fC,[o.value.length>0?(R(),$("div",dC,[T("h3",pC,V(Y(r)("opc.active")),1),T("ul",hC,[(R(!0),$(qe,null,xt(o.value,C=>(R(),$("li",{key:C.key,class:vt(["fe-opc__item",`is-${C.status}`])},[(R(),$("svg",vC,[T("path",{d:v[C.kind]},null,8,mC)])),T("div",gC,[T("div",{class:"fe-opc__name",title:y(C)},V(y(C)),9,bC),T("div",yC,[T("span",_C,V(m(C)),1),x[3]||(x[3]=T("span",{class:"fe-opc__dot","aria-hidden":"true"},"·",-1)),T("span",xC,V(g(C)),1)]),C.status==="running"&&C.percent!==null?(R(),$("div",{key:0,class:"fe-opc__bar",role:"progressbar","aria-valuenow":C.percent,"aria-valuemin":"0","aria-valuemax":"100"},[T("div",{class:"fe-opc__bar-fill",style:Sn({width:C.percent+"%"})},null,4)],8,wC)):Te("",!0)]),C.status==="running"&&C.percent===null&&!C.queued?(R(),$("span",kC)):Te("",!0),T("div",SC,[C.status==="running"&&C.cancellable?(R(),$("button",{key:0,type:"button",class:"fe-opc__act",onClick:D=>e.center.cancel(C.key)},V(Y(r)("opc.cancel")),9,CC)):Te("",!0),C.status==="error"&&C.retryable?(R(),$("button",{key:1,type:"button",class:"fe-opc__act fe-opc__act--retry",onClick:D=>e.center.retry(C.key)},V(Y(r)("opc.retry")),9,EC)):Te("",!0),C.status!=="running"?(R(),$("button",{key:2,type:"button",class:"fe-opc__x","aria-label":Y(r)("opc.dismiss"),onClick:D=>e.center.dismiss(C.key)},"×",8,AC)):Te("",!0)])],2))),128))])])):Te("",!0),s.value.length>0?(R(),$("div",TC,[T("h3",MC,[$t(V(Y(r)("opc.history"))+" ",1),T("button",{type:"button",class:"fe-opc__act",onClick:x[1]||(x[1]=C=>e.center.clearHistory())},V(Y(r)("opc.clear")),1)]),T("ul",DC,[(R(!0),$(qe,null,xt(s.value,C=>(R(),$("li",{key:"h-"+C.key,class:vt(["fe-opc__item fe-opc__item--history",`is-${C.status}`])},[(R(),$("svg",zC,[T("path",{d:v[C.kind]},null,8,IC)])),T("div",OC,[T("div",{class:"fe-opc__name",title:y(C)},V(y(C)),9,PC),C.status==="error"&&C.error?(R(),$("div",FC,V(C.error),1)):Te("",!0)]),T("span",{class:vt(["fe-opc__chip",`is-${C.status}`])},V(S(C)),3)],2))),128))])])):Te("",!0),o.value.length===0&&s.value.length===0?(R(),$("p",RC,V(Y(r)("opc.empty")),1)):Te("",!0)])],8,lC)):Te("",!0)]),_:1}),T("button",{type:"button",class:vt(["fe-opc__badge",{"is-error":l.value}]),"aria-expanded":a.value,"aria-label":b.value,onClick:x[2]||(x[2]=C=>a.value=!a.value)},[(R(),$("svg",{class:vt(["fe-opc__ring",{"fe-opc__ring--spin":_.value}]),viewBox:"0 0 22 22","aria-hidden":"true",focusable:"false"},[T("circle",{class:"fe-opc__ring-track",cx:"11",cy:"11",r:Ef,fill:"none","stroke-width":"2.5"}),T("circle",{class:"fe-opc__ring-fill",cx:"11",cy:"11",r:Ef,fill:"none","stroke-width":"2.5","stroke-linecap":"round","stroke-dasharray":f,"stroke-dashoffset":p.value,transform:"rotate(-90 11 11)"},null,8,BC)],2)),T("span",$C,V(o.value.length),1),h.value?(R(),$("span",NC,V(h.value),1)):Te("",!0)],10,LC)],2)):Te("",!0)}}),HC=4e3,im=50;function jC(e,t,r){const n=t.status!=="running";return{key:e,kind:t.kind,name:t.name,percent:t.percent,status:t.status,error:t.error??null,queued:t.queued??!1,doneCount:t.doneCount??null,totalCount:t.totalCount??null,uploadedBytes:t.uploadedBytes??null,totalBytes:t.totalBytes??null,cancellable:t.cancellable??!1,retryable:t.retryable??!1,startedAt:(r==null?void 0:r.startedAt)??Date.now(),settledAt:(r==null?void 0:r.settledAt)??(n?Date.now():null)}}function GC(){const e=re([]),t=re([]),r=new Map,n=new Set,a=new Map;function i(v){const m=a.get(v);m!==void 0&&(clearTimeout(m),a.delete(v))}function o(v,m={}){i(v);const y=e.value.findIndex(S=>S.key===v);if(y===-1)return;const[g]=e.value.splice(y,1);e.value=[...e.value],n.add(v),m.toHistory!==!1&&(t.value=[{...g,settledAt:g.settledAt??Date.now()},...t.value].slice(0,im))}function s(v){a.has(v)||a.set(v,setTimeout(()=>{var y;a.delete(v);const m=r.get(v);o(v),(y=m==null?void 0:m.dismiss)==null||y.call(m)},HC))}function l(v,m){const y=`${v}:`,g=new Set;let S=[...e.value],M=!1;for(const E of m){const w=`${v}:${E.input.id}`;if(g.add(w),E.actions&&r.set(w,E.actions),n.has(w))continue;const x=S.findIndex(D=>D.key===w),C=jC(w,E.input,x===-1?void 0:S[x]);x===-1?(S=[C,...S],M=!0):JSON.stringify(S[x])!==JSON.stringify(C)&&(S[x]=C,M=!0),(C.status==="done"||C.status==="aborted")&&s(w)}for(const E of[...S])!E.key.startsWith(y)||g.has(E.key)||E.status!=="error"&&(i(E.key),S=S.filter(w=>w.key!==E.key),M=!0,E.status!=="running"&&(n.add(E.key),t.value=[{...E,settledAt:E.settledAt??Date.now()},...t.value].slice(0,im)));for(const E of[...n])E.startsWith(y)&&!g.has(E)&&n.delete(E);for(const E of[...r.keys()])E.startsWith(y)&&!g.has(E)&&!e.value.some(w=>w.key===E)&&(S.some(w=>w.key===E)||r.delete(E));M&&(e.value=S)}function c(v){var m,y;(y=(m=r.get(v))==null?void 0:m.cancel)==null||y.call(m)}function u(v){var y,g;const m=r.get(v);o(v),(y=m==null?void 0:m.dismiss)==null||y.call(m),(g=m==null?void 0:m.retry)==null||g.call(m)}function d(v){var y;const m=r.get(v);o(v),(y=m==null?void 0:m.dismiss)==null||y.call(m)}function f(){t.value=[]}const p=Fe(()=>e.value.filter(v=>v.status==="running").length),_=Fe(()=>e.value.filter(v=>v.status==="error").length),h=Fe(()=>_.value>0),b=Fe(()=>{const v=e.value.filter(g=>g.status==="running");let m=0,y=0;for(const g of v){let S=null;g.totalBytes&&g.totalBytes>0?S=Math.min(1,(g.uploadedBytes??0)/g.totalBytes):g.totalCount&&g.totalCount>0?S=Math.min(1,(g.doneCount??0)/g.totalCount):g.percent!==null&&(S=Math.min(1,g.percent/100)),S!==null&&(m+=S,y+=1)}return y===0?null:Math.round(m/y*100)});return Th()&&$5(()=>{for(const v of a.values())clearTimeout(v);a.clear()}),{active:e,history:t,runningCount:p,errorCount:_,hasError:h,overallPercent:b,sync:l,cancel:c,retry:u,dismiss:d,clearHistory:f}}const VC=["data-prefers-dark","aria-label"],qC={key:1,class:"fe-tour__dim","aria-hidden":"true"},KC={class:"fe-tour__progress","aria-hidden":"true"},WC={class:"fe-tour__title"},YC={class:"fe-tour__desc"},XC={class:"fe-tour__dots","aria-hidden":"true"},ZC={class:"fe-tour__actions"},Ho=6,om=12,JC=Pt({__name:"OnboardingTour",props:{open:{type:Boolean},locale:{},root:{},theme:{}},emits:["close"],setup(e,{emit:t}){const r=e,n=t,{t:a}=br(()=>r.locale);function i(x,C){const D=x.querySelectorAll("button[title]");for(const B of Array.from(D))if(B.getAttribute("title")===C)return B;return null}const o=[{id:"nav",titleKey:"tour.step.nav.title",descKey:"tour.step.nav.desc",target:x=>x.querySelector(".fe-breadcrumb")},{id:"upload",titleKey:"tour.step.upload.title",descKey:"tour.step.upload.desc",target:x=>i(x,a("toolbar.upload"))||x.querySelector(".fe-fab")},{id:"search",titleKey:"tour.step.search.title",descKey:"tour.step.search.desc",target:x=>x.querySelector(".fe-search__input")||x.querySelector(".fe-toolbar__search-toggle")},{id:"view",titleKey:"tour.step.view.title",descKey:"tour.step.view.desc",target:x=>x.querySelector(".fe-toolbar__view")},{id:"share",titleKey:"tour.step.share.title",descKey:"tour.step.share.desc",target:x=>x.querySelector(".fe__body")},{id:"help",titleKey:"tour.step.help.title",descKey:"tour.step.help.desc",target:()=>null}],s=re([]),l=re(0),c=Fe(()=>s.value[l.value]??null),u=Fe(()=>s.value.length);function d(){const x=r.root;s.value=o.filter(C=>{if(C.id==="help")return!0;if(!x)return!1;const D=C.target(x);if(!D)return!1;const B=D.getBoundingClientRect();return B.width>0&&B.height>0})}const f=re(null),p=re({}),_=re(null);async function h(){var q;const x=c.value,C=r.root;if(!x)return;const D=C?x.target(C):null;if(!D){f.value=null,p.value={};return}const B=D.getBoundingClientRect();if(B.width<=0&&B.height<=0){f.value=null,p.value={};return}f.value={top:B.top-Ho,left:B.left-Ho,width:B.width+Ho*2,height:B.height+Ho*2},await Nr();const F=window.innerWidth,K=window.innerHeight,te=Math.min(340,F-24),J=((q=_.value)==null?void 0:q.offsetHeight)??160;let ne=B.bottom+Ho+om;ne+J>K-12&&(ne=Math.max(12,B.top-Ho-om-J));let le=B.left+B.width/2-te/2;le=Math.min(Math.max(12,le),F-te-12),p.value={top:`${Math.round(ne)}px`,left:`${Math.round(le)}px`,width:`${te}px`}}function b(){r.open&&h()}function v(){if(l.value>=u.value-1){n("close");return}l.value+=1}function m(){l.value>0&&(l.value-=1)}function y(){n("close")}function g(x){r.open&&(x.key==="Escape"?(x.stopPropagation(),y()):x.key==="ArrowRight"||x.key==="Enter"?(x.preventDefault(),v()):x.key==="ArrowLeft"&&(x.preventDefault(),m()))}At(()=>r.open,async x=>{var C;x&&(l.value=0,d(),await Nr(),await h(),(C=_.value)==null||C.focus())}),At(l,async()=>{var x;await h(),(x=_.value)==null||x.focus()}),Xt(()=>{window.addEventListener("resize",b),window.addEventListener("scroll",b,!0)}),tr(()=>{window.removeEventListener("resize",b),window.removeEventListener("scroll",b,!0)});const S=re(!1);let M;function E(x){S.value=!!(x&&"matches"in x&&x.matches)}Xt(()=>{var x;typeof window>"u"||(M=window.matchMedia("(prefers-color-scheme: dark)"),E(M),(x=M.addEventListener)==null||x.call(M,"change",E))}),tr(()=>{var x;(x=M==null?void 0:M.removeEventListener)==null||x.call(M,"change",E)});const w=Fe(()=>`fe-ctx-backdrop--theme-${r.theme||"auto"}`);return(x,C)=>(R(),Zt(l1,{to:"body"},[Dt(Za,{name:"fe-tour"},{default:ur(()=>[e.open&&c.value?(R(),$("div",{key:0,class:vt(["fe-tour",w.value]),"data-prefers-dark":S.value?"1":"0",role:"dialog","aria-modal":"true","aria-label":Y(a)("tour.aria"),onKeydown:g},[f.value?(R(),$("div",{key:0,class:"fe-tour__spot",style:Sn({top:f.value.top+"px",left:f.value.left+"px",width:f.value.width+"px",height:f.value.height+"px"}),"aria-hidden":"true"},null,4)):(R(),$("div",qC)),T("div",{ref_key:"cardEl",ref:_,class:vt(["fe-tour__card",{"fe-tour__card--center":!f.value}]),style:Sn(f.value?p.value:{}),tabindex:"-1"},[T("p",KC,V(Y(a)("tour.progress",{n:l.value+1,m:u.value})),1),T("h3",WC,V(Y(a)(c.value.titleKey)),1),T("p",YC,V(Y(a)(c.value.descKey)),1),T("div",XC,[(R(!0),$(qe,null,xt(s.value,(D,B)=>(R(),$("span",{key:D.id,class:vt(["fe-tour__dot",{"is-active":B===l.value}])},null,2))),128))]),T("div",ZC,[T("button",{type:"button",class:"fe-btn fe-tour__skip",onClick:y},V(Y(a)("tour.skip")),1),C[0]||(C[0]=T("span",{class:"fe-tour__actions-spacer"},null,-1)),l.value>0?(R(),$("button",{key:0,type:"button",class:"fe-btn",onClick:m},V(Y(a)("tour.back")),1)):Te("",!0),T("button",{type:"button",class:"fe-btn fe-btn--primary",onClick:v},V(l.value>=u.value-1?Y(a)("tour.done"):Y(a)("tour.next")),1)])],6)],42,VC)):Te("",!0)]),_:1})]))}}),QC=["aria-label"],eE={class:"fe-tabs__scroll"},tE=["aria-selected","title","onClick","onKeydown","onAuxclick","onDragstart","onDragover","onDragleave","onDrop"],rE={key:0,class:"fe-tabs__splitdot","aria-hidden":"true"},nE={class:"fe-tabs__label"},aE=["aria-label","title","onClick"],iE=["aria-label","title"],oE=["aria-label","title","aria-pressed"],sE=Pt({__name:"TabBar",props:{tabs:{},activeId:{},locale:{},splitEnabled:{type:Boolean},splitActive:{type:Boolean}},emits:["select","close","new","reorder","toggle-split"],setup(e,{emit:t}){const r=e,n=t,{t:a}=br(()=>r.locale),i=re(null),o=re(null);function s(_,h){var b;i.value=_,h.dataTransfer&&(h.dataTransfer.effectAllowed="move",h.dataTransfer.setData("text/plain",((b=r.tabs[_])==null?void 0:b.id)??""))}function l(_,h){i.value!==null&&(h.preventDefault(),h.stopPropagation(),h.dataTransfer&&(h.dataTransfer.dropEffect="move"),o.value=_)}function c(_){o.value===_&&(o.value=null)}function u(_,h){i.value!==null&&(h.preventDefault(),h.stopPropagation(),i.value!==_&&n("reorder",i.value,_),i.value=null,o.value=null)}function d(){i.value=null,o.value=null}function f(_){_.button===1&&_.preventDefault()}function p(_,h){h.button===1&&(h.preventDefault(),h.stopPropagation(),n("close",_))}return(_,h)=>(R(),$("div",{class:"fe-tabs",role:"tablist","aria-label":Y(a)("tabs.strip")},[T("div",eE,[(R(!0),$(qe,null,xt(e.tabs,(b,v)=>(R(),$("div",{key:b.id,class:vt(["fe-tabs__tab",{"is-active":b.id===e.activeId,"is-dragover":o.value===v&&i.value!==null&&i.value!==v}]),role:"tab","aria-selected":b.id===e.activeId?"true":"false",tabindex:"0",draggable:"true",title:b.label,onClick:m=>n("select",b.id),onKeydown:un(Ht(m=>n("select",b.id),["prevent"]),["enter"]),onMousedown:h[0]||(h[0]=m=>f(m)),onAuxclick:m=>p(b.id,m),onDragstart:m=>s(v,m),onDragover:m=>l(v,m),onDragleave:m=>c(v),onDrop:m=>u(v,m),onDragend:d},[b.split?(R(),$("span",rE)):Te("",!0),T("span",nE,V(b.label),1),T("button",{type:"button",class:"fe-tabs__close","aria-label":Y(a)("tabs.close"),title:Y(a)("tabs.close"),onClick:Ht(m=>n("close",b.id),["stop"])},"×",8,aE)],42,tE))),128)),T("button",{type:"button",class:"fe-tabs__new","aria-label":Y(a)("tabs.new"),title:Y(a)("tabs.new"),onClick:h[1]||(h[1]=b=>n("new"))},"+",8,iE)]),e.splitEnabled!==!1?(R(),$("button",{key:0,type:"button",class:vt(["fe-tabs__split",{"is-active":e.splitActive}]),"aria-label":e.splitActive?Y(a)("tabs.split_off"):Y(a)("tabs.split"),title:e.splitActive?Y(a)("tabs.split_off"):Y(a)("tabs.split"),"aria-pressed":e.splitActive?"true":"false",onClick:h[2]||(h[2]=b=>n("toggle-split"))},[...h[3]||(h[3]=[T("svg",{class:"fe-ficon",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true",focusable:"false"},[T("rect",{x:"3",y:"4",width:"18",height:"16",rx:"2"}),T("path",{d:"M12 4v16"})],-1)])],10,oE)):Te("",!0)],8,QC))}}),L0=".filex-e2e.json",lE="filexe2e",B0=1,cE=6e5,uE=6e5,sm=200*1024*1024,fE=8,lm="filex-e2e-verify-v1",$0=new TextEncoder().encode(lE),N0=97,Af=9,Tf=21,dE=48,Mf=69,Ma=12;class cm extends Error{constructor(t="e2e: decrypt failed"){super(t),this.name="E2eDecryptError"}}function um(e){let t="";for(let r=0;r<e.length;r++)t+=String.fromCharCode(e[r]);return btoa(t)}function fm(e){const t=atob(e),r=new Uint8Array(t.length);for(let n=0;n<t.length;n++)r[n]=t.charCodeAt(n);return r}async function dm(e,t,r){const n=await crypto.subtle.importKey("raw",new TextEncoder().encode(e),"PBKDF2",!1,["deriveKey"]);return crypto.subtle.deriveKey({name:"PBKDF2",salt:new Uint8Array(t).buffer,iterations:r,hash:"SHA-256"},n,{name:"AES-GCM",length:256},!1,["encrypt","decrypt"])}async function pE(e,t=cE){const r=Math.max(uE,t),n=crypto.getRandomValues(new Uint8Array(16)),a=await dm(e,n,r),i=crypto.getRandomValues(new Uint8Array(Ma)),o=new Uint8Array(await crypto.subtle.encrypt({name:"AES-GCM",iv:i.buffer},a,new TextEncoder().encode(lm))),s=new Uint8Array(Ma+o.length);return s.set(i,0),s.set(o,Ma),{marker:{v:B0,salt:um(n),iter:r,verify:um(s)},kek:a}}function hE(e){try{const t=JSON.parse(e);return!t||t.v!==B0||typeof t.salt!="string"||typeof t.verify!="string"||typeof t.iter!="number"||t.iter<1?null:t}catch{return null}}async function vE(e,t){const r=fm(e.salt),n=await dm(t,r,e.iter),a=fm(e.verify);if(a.length<=Ma)return null;try{const i=await crypto.subtle.decrypt({name:"AES-GCM",iv:a.slice(0,Ma).buffer},n,a.slice(Ma).buffer);return new TextDecoder().decode(i)!==lm?null:n}catch{return null}}function Df(e){const t=e instanceof Uint8Array?e:new Uint8Array(e);if(t.length<$0.length)return!1;for(let r=0;r<$0.length;r++)if(t[r]!==$0[r])return!1;return!0}async function mE(e,t){if(t.byteLength>sm)throw new Error("e2e: file exceeds the 200MB single-shot limit");const r=crypto.getRandomValues(new Uint8Array(32)),n=await crypto.subtle.importKey("raw",r.buffer,{name:"AES-GCM"},!1,["encrypt"]),a=crypto.getRandomValues(new Uint8Array(Ma)),i=crypto.getRandomValues(new Uint8Array(Ma)),o=new Uint8Array(await crypto.subtle.encrypt({name:"AES-GCM",iv:a.buffer},e,r.buffer)),s=new Uint8Array(await crypto.subtle.encrypt({name:"AES-GCM",iv:i.buffer},n,t));r.fill(0);const l=new Uint8Array(N0+s.length);return l.set($0,0),l[8]=B0,l.set(a,Af),l.set(o,Tf),l.set(i,Mf),l.set(s,N0),l.buffer}async function pm(e,t){const r=new Uint8Array(t);if(!Df(r)||r.length<N0)throw new Error("e2e: not an encrypted file");if(r[8]!==B0)throw new Error(`e2e: unsupported version ${r[8]}`);const n=r.slice(Af,Af+Ma),a=r.slice(Tf,Tf+dE),i=r.slice(Mf,Mf+Ma);let o;try{o=await crypto.subtle.decrypt({name:"AES-GCM",iv:n.buffer},e,a.buffer)}catch{throw new cm("e2e: DEK unwrap failed (wrong password?)")}const s=await crypto.subtle.importKey("raw",o,{name:"AES-GCM"},!1,["decrypt"]);try{return await crypto.subtle.decrypt({name:"AES-GCM",iv:i.buffer},s,r.slice(N0).buffer)}catch{throw new cm("e2e: content decrypt failed")}}function gE(){const e=new Map;return{get(t){return e.get(t)},set(t,r){e.set(t,r)},lock(t){e.delete(t)},has(t){return e.has(t)},clear(){e.clear()}}}function hm(e){const t=e.indexOf("://");return t===-1?e:e.slice(t+3)}function vm(e){return(e||[]).filter(t=>!(t.path.includes(".thumbs")||t.path.includes(".versions")||t.basename===".versions"||t.basename===".trash"||t.basename===".keepdir"||t.basename===L0))}function bE(e){const t=hm(e);return t==="fileman"||t===""}function yE(e){return hm(e).startsWith("fileman/.trash")}function _E(e){return{type:"dir",path:`${e}://fileman/.trash`,basename:".trash",extension:"",storage:e,visibility:"private",size:0,file_size:0,mime_type:"inode/directory",extra_metadata:{}}}function mm(e,t,r,n){return!n||yE(r)||!bE(r)?!1:(e.unshift(_E(t)),!0)}async function gm(e,t,r){try{const{entries:n}=await r.listTrash(t),a=e.find(s=>s.basename===".trash");if(!a)return;let i=0,o=0;for(const s of n){i+=s.size||0;const l=Date.parse(s.deleted_at);!Number.isNaN(l)&&l>o&&(o=l)}a.size=i,o>0&&(a.last_modified=o)}catch{}}const xE=["aria-label"],wE={class:"fe-split__crumbs"},kE=["title"],SE=["title","onClick"],CE=["aria-label","title"],EE={key:0,class:"fe-split__state",role:"status"},AE={key:1,class:"fe-split__state"},TE={key:2,class:"fe-split__state"},zf="application/x-brf-files",bm="application/x-brf-files-src",ME=Pt({__name:"SecondaryPane",props:{api:{},initialPath:{},locale:{},qualify:{type:Function},toUser:{type:Function},clamp:{type:Function},rootLabel:{},floor:{},multiRoot:{type:Boolean},virtualRows:{type:Function},active:{type:Boolean},viewMode:{},thumbSrc:{type:Function},trashVisible:{type:Boolean}},emits:["navigate","activate","close","open-tab","transfer","context","open-trash"],setup(e,{expose:t,emit:r}){const n=e,a=r,{t:i}=br(()=>n.locale),o=re(""),s=re([]),l=re(!1),c=re(""),u=re(new Set);function d(j){return j.mime_type==="inode/storage"}const f=Fe(()=>!!n.multiRoot&&!(o.value??"").replace(/^\/+|\/+$/g,""));async function p(j){const P=n.clamp(j??o.value??"");l.value=!0,c.value="";try{if(n.multiRoot&&!P){s.value=n.virtualRows?n.virtualRows():[],o.value="",u.value=new Set,a("navigate","");return}const N=await n.api.index(n.qualify(P));s.value=vm(N.files),mm(s.value,N.adapter,N.dirname,n.trashVisible!==!1)&&gm(s.value,N.adapter,n.api),o.value=n.toUser(N.dirname),u.value=new Set,a("navigate",o.value)}catch(N){c.value=N instanceof Error?N.message:String(N)}finally{l.value=!1}}p(n.initialPath??"");const _=Fe(()=>{const j=(o.value||"").replace(/^\/+|\/+$/g,""),P=j?j.split("/"):[],N=(n.floor||"").replace(/^\/+|\/+$/g,""),X=[];let Ee="";for(const Ae of P)Ee=Ee?`${Ee}/${Ae}`:Ae,!(N&&!(Ee===N||Ee.startsWith(N+"/")))&&X.push({label:Ae,target:Ee,last:!1});return X.length>0&&(X[X.length-1].last=!0),X}),h=Fe(()=>!n.floor);function b(j){a("activate"),p(j)}function v(j,P){a("activate");const N=P.ctrl||P.shift,X=new Set(N?u.value:[]);N&&X.has(j.path)?X.delete(j.path):X.add(j.path),u.value=X}function m(j,P){P.preventDefault(),P.stopPropagation(),a("activate"),u.value.has(j.path)||(u.value=new Set([j.path])),a("context",j,P)}function y(j){j.preventDefault(),j.stopPropagation(),a("activate"),u.value=new Set,a("context",null,j)}function g(j,P){w.value=!1,!(j.type!=="dir"||d(j))&&x(P)&&C(P,j.path)}function S(j){if(j.type==="dir"){if(j.basename===".trash"){a("activate"),a("open-trash");return}p(d(j)?j.path:n.toUser(j.path))}}function M(){u.value=new Set}function E(j,P){if(!P.dataTransfer)return;if(d(j)||f.value||j.basename===".trash"){P.preventDefault();return}u.value.has(j.path)||(u.value=new Set([j.path]));const N=s.value.filter(X=>u.value.has(X.path)&&!d(X)).map(X=>({path:X.path,basename:X.basename,type:X.type}));if(N.length===0){P.preventDefault();return}P.dataTransfer.setData(zf,JSON.stringify(N)),P.dataTransfer.setData(bm,n.qualify(o.value)),P.dataTransfer.setData("text/plain",N.map(X=>X.path).join(`
|
|
21
21
|
`)),P.dataTransfer.effectAllowed="move"}const w=re(!1);function x(j){var P;return!!((P=j.dataTransfer)!=null&&P.types.includes(zf))}function C(j,P){var ze,Le;const N=(ze=j.dataTransfer)==null?void 0:ze.getData(zf);if(!N||!P)return;let X=[];try{X=JSON.parse(N)}catch{return}const Ee=((Le=j.dataTransfer)==null?void 0:Le.getData(bm))||void 0,Ae=X.map(he=>he.path).filter(he=>he&&he!==P&&!P.startsWith(he+"/"));Ae.length!==0&&(j.preventDefault(),j.stopPropagation(),a("transfer",{sources:Ae,targetWire:P,originWire:Ee}))}function D(j){!x(j)||f.value||(j.preventDefault(),j.stopPropagation(),j.dataTransfer&&(j.dataTransfer.dropEffect="move"),w.value=!0)}function B(){w.value=!1}function F(j){w.value=!1,!(!x(j)||f.value)&&C(j,n.qualify(o.value))}function K(){const j=(o.value??"").replace(/^\/+|\/+$/g,""),P=(n.floor||"").replace(/^\/+|\/+$/g,"");if(!j||j===P)return;const N=j.lastIndexOf("/");p(N===-1?"":j.slice(0,N))}function te(){u.value=new Set(s.value.filter(j=>!d(j)).map(j=>j.path))}function J(){return s.value.filter(j=>u.value.has(j.path))}function ne(){const j=J()[0];j&&j.type==="dir"&&S(j)}function le(){return p()}function q(){return o.value}return t({reload:le,goUp:K,selectAll:te,openSelected:ne,selectedNodes:J,getPath:q}),(j,P)=>(R(),$("section",{class:vt(["fe-split",{"fe-pane--focus":e.active}]),role:"region","aria-label":Y(i)("split.pane"),onPointerdown:P[3]||(P[3]=N=>a("activate"))},[T("header",wE,[h.value?(R(),$("button",{key:0,type:"button",class:vt(["fe-split__crumb",{"is-last":_.value.length===0}]),title:e.rootLabel,onClick:P[0]||(P[0]=N=>b(""))},V(e.rootLabel),11,kE)):Te("",!0),(R(!0),$(qe,null,xt(_.value,N=>(R(),$(qe,{key:N.target},[P[4]||(P[4]=T("span",{class:"fe-split__sep","aria-hidden":"true"},"›",-1)),T("button",{type:"button",class:vt(["fe-split__crumb",{"is-last":N.last}]),title:N.label,onClick:X=>b(N.target)},V(N.label),11,SE)],64))),128)),P[5]||(P[5]=T("span",{class:"fe-split__spacer"},null,-1)),T("button",{type:"button",class:"fe-split__closebtn","aria-label":Y(i)("split.close"),title:Y(i)("split.close"),onClick:P[1]||(P[1]=N=>a("close"))},"×",8,CE)]),T("div",{class:vt(["fe-split__body",{"is-dropover":w.value}]),onClick:Ht(M,["self"]),onContextmenu:y,onDragover:D,onDragleave:B,onDrop:F},[l.value&&s.value.length===0?(R(),$("div",EE,V(Y(i)("loading")),1)):c.value?(R(),$("div",AE,[T("span",null,V(Y(i)("split.error")),1),T("button",{type:"button",class:"fe-btn",onClick:P[2]||(P[2]=()=>p())},V(Y(i)("split.retry")),1)])):s.value.length===0?(R(),$("div",TE,V(Y(i)("empty.folder")),1)):(e.viewMode??"list")==="list"?(R(),Zt(Yv,{key:3,files:s.value,selected:u.value,locale:e.locale,loading:l.value,onClickRow:v,onDblRow:S,onContextRow:m,onItemDragStart:E,onItemDropInto:g},null,8,["files","selected","locale","loading"])):e.viewMode==="grid"?(R(),Zt(Xv,{key:4,files:s.value,selected:u.value,locale:e.locale,loading:l.value,"thumb-src":e.thumbSrc,onClickCard:v,onDblCard:S,onContextCard:m,onItemDragStart:E,onItemDropInto:g},null,8,["files","selected","locale","loading","thumb-src"])):(R(),Zt(Zv,{key:5,files:s.value,selected:u.value,locale:e.locale,loading:l.value,"thumb-src":e.thumbSrc,onClickCard:v,onDblCard:S,onContextCard:m,onItemDragStart:E,onItemDropInto:g},null,8,["files","selected","locale","loading","thumb-src"]))],34)],42,xE))}});function If(){try{return crypto.randomUUID()}catch{return`t${Date.now().toString(36)}-${Math.random().toString(36).slice(2,8)}`}}function DE(e){const t=re([]),r=re(""),n=Fe(()=>t.value.find(b=>b.id===r.value)??null),a=Fe(()=>t.value.findIndex(b=>b.id===r.value)),i=Fe(()=>t.value.length>1);function o(){if(!e.storageKey)return!1;try{const b=localStorage.getItem(e.storageKey);if(!b)return!1;const v=JSON.parse(b);if(!v||!Array.isArray(v.tabs)||v.tabs.length===0)return!1;const m=[];for(const y of v.tabs){if(!y||typeof y.path!="string")continue;const g=typeof y.viewMode=="string"&&y.viewMode?y.viewMode:"list",S=y.split,M=S&&typeof S=="object"&&typeof S.path=="string"?{path:S.path,viewMode:typeof S.viewMode=="string"&&S.viewMode?S.viewMode:void 0}:null;m.push({id:typeof y.id=="string"&&y.id?y.id:If(),path:y.path,viewMode:g,split:M})}return m.length===0?!1:(t.value=m,r.value=m.some(y=>y.id===v.active)?String(v.active):m[0].id,!0)}catch{return!1}}function s(){if(e.storageKey)try{localStorage.setItem(e.storageKey,JSON.stringify({v:1,active:r.value,tabs:t.value}))}catch{}}At([t,r],s,{deep:!0});function l(b,v){if(t.value.length>0)return;const m={id:If(),path:b,viewMode:v,split:null};t.value=[m],r.value=m.id}function c(b){const v=n.value;v&&(b.path!==void 0&&(v.path=b.path),b.viewMode!==void 0&&(v.viewMode=b.viewMode))}function u(b,v){const m={id:If(),path:b,viewMode:v.viewMode,split:v.split??null},y=a.value;return t.value.splice(y===-1?t.value.length:y+1,0,m),v.background||(r.value=m.id),m}function d(b){if(t.value.length<=1)return null;const v=t.value.findIndex(g=>g.id===b);if(v===-1)return null;const m=t.value[v].id===r.value;if(t.value.splice(v,1),!m)return null;const y=t.value[Math.min(v,t.value.length-1)];return r.value=y.id,y}function f(b){const v=t.value.find(m=>m.id===b);return!v||v.id===r.value?null:(r.value=v.id,v)}function p(b){if(t.value.length<2)return null;const v=a.value===-1?0:a.value,m=t.value[(v+b+t.value.length)%t.value.length];return f(m.id)}function _(b,v){if(b===v||b<0||v<0||b>=t.value.length||v>=t.value.length)return;const m=[...t.value],[y]=m.splice(b,1);m.splice(v,0,y),t.value=m}function h(b){const v=n.value;v&&(v.split=b)}return{tabs:t,activeId:r,activeTab:n,activeIndex:a,hasMultiple:i,restore:o,seed:l,syncActive:c,openTab:u,closeTab:d,activate:f,step:p,move:_,setSplit:h}}const zE=["placeholder","disabled"],IE=["placeholder","disabled"],OE=["placeholder","disabled","onKeydown"],PE={class:"fe-e2e-warn",role:"alert"},FE={class:"fe-e2e-ack"},RE=["disabled"],LE={key:0,class:"fe-form__error"},BE=["disabled"],$E=["disabled"],NE=Pt({__name:"EncryptedFolderModal",props:{open:{type:Boolean},locale:{},busy:{type:Boolean}},emits:["close","submit"],setup(e,{emit:t}){const r=e,n=t,{t:a}=br(()=>r.locale),i=re(""),o=re(""),s=re(""),l=re(!1),c=re(null);At(()=>r.open,d=>{d&&(i.value="",o.value="",s.value="",l.value=!1,c.value=null)});function u(){if(r.busy)return;const d=i.value.trim();if(!d){c.value=a("modal.newfolder.placeholder");return}if(/[\\/]/.test(d)||d==="."||d===".."||d.startsWith(".filex")){c.value=a("e2e.create.bad_name");return}if(o.value.length<fE){c.value=a("e2e.create.pw_short");return}if(o.value!==s.value){c.value=a("e2e.create.pw_mismatch");return}if(!l.value){c.value=a("e2e.create.ack_required");return}c.value=null,n("submit",{name:d,password:o.value})}return(d,f)=>(R(),Zt(ei,{open:e.open,title:Y(a)("e2e.create.title"),size:"sm",onClose:f[5]||(f[5]=p=>n("close"))},{actions:ur(()=>[T("button",{type:"button",class:"fe-btn",disabled:e.busy,onClick:f[4]||(f[4]=p=>n("close"))},V(Y(a)("modal.newfolder.cancel")),9,BE),T("button",{type:"button",class:"fe-btn fe-btn--primary",disabled:e.busy,onClick:u},V(e.busy?Y(a)("e2e.create.busy"):Y(a)("e2e.create.create")),9,$E)]),default:ur(()=>[T("form",{class:"fe-e2e-form",onSubmit:Ht(u,["prevent"])},[Yt(T("input",{"onUpdate:modelValue":f[0]||(f[0]=p=>i.value=p),type:"text",class:"fe-input",placeholder:Y(a)("modal.newfolder.placeholder"),autocomplete:"off",disabled:e.busy},null,8,zE),[[Ir,i.value]]),Yt(T("input",{"onUpdate:modelValue":f[1]||(f[1]=p=>o.value=p),type:"password",class:"fe-input",placeholder:Y(a)("e2e.create.pw_placeholder"),autocomplete:"new-password",disabled:e.busy},null,8,IE),[[Ir,o.value]]),Yt(T("input",{"onUpdate:modelValue":f[2]||(f[2]=p=>s.value=p),type:"password",class:"fe-input",placeholder:Y(a)("e2e.create.pw2_placeholder"),autocomplete:"new-password",disabled:e.busy,onKeydown:un(Ht(u,["prevent"]),["enter"])},null,40,OE),[[Ir,s.value]]),T("div",PE,[T("strong",null,V(Y(a)("e2e.create.warn_title")),1),T("p",null,V(Y(a)("e2e.create.warn_body")),1)]),T("label",FE,[Yt(T("input",{"onUpdate:modelValue":f[3]||(f[3]=p=>l.value=p),type:"checkbox",disabled:e.busy},null,8,RE),[[No,l.value]]),T("span",null,V(Y(a)("e2e.create.ack")),1)]),c.value?(R(),$("p",LE,V(c.value),1)):Te("",!0)],32)]),_:1},8,["open","title"]))}}),UE=["placeholder","onKeydown"],HE={key:0,class:"fe-form__error"},jE=Pt({__name:"NewFolderModal",props:{open:{type:Boolean},locale:{},encryptedOption:{type:Boolean}},emits:["close","submit","encrypted"],setup(e,{emit:t}){const r=e,n=t,{t:a}=br(()=>r.locale),i=re(""),o=re(null);At(()=>r.open,l=>{l&&(i.value="",o.value=null)});function s(){const l=i.value.trim();if(!l){o.value=a("modal.newfolder.placeholder");return}if(/[\\/]/.test(l)||l==="."||l===".."){o.value="Geçersiz karakter";return}n("submit",l)}return(l,c)=>(R(),Zt(ei,{open:e.open,title:Y(a)("modal.newfolder.title"),size:"sm",onClose:c[3]||(c[3]=u=>n("close"))},{actions:ur(()=>[T("button",{type:"button",class:"fe-btn",onClick:c[2]||(c[2]=u=>n("close"))},V(Y(a)("modal.newfolder.cancel")),1),T("button",{type:"button",class:"fe-btn fe-btn--primary",onClick:s},V(Y(a)("modal.newfolder.create")),1)]),default:ur(()=>[T("form",{onSubmit:Ht(s,["prevent"])},[Yt(T("input",{"onUpdate:modelValue":c[0]||(c[0]=u=>i.value=u),type:"text",class:"fe-input",placeholder:Y(a)("modal.newfolder.placeholder"),autocomplete:"off",onKeydown:un(Ht(s,["prevent"]),["enter"])},null,40,UE),[[Ir,i.value]]),o.value?(R(),$("p",HE,V(o.value),1)):Te("",!0),e.encryptedOption!==!1?(R(),$("button",{key:1,type:"button",class:"fe-e2e-optlink",onClick:c[1]||(c[1]=u=>n("encrypted"))}," 🔒 "+V(Y(a)("e2e.create.option")),1)):Te("",!0)],32)]),_:1},8,["open","title"]))}}),GE=["onKeydown"],VE=Pt({__name:"RenameModal",props:{open:{type:Boolean},locale:{},currentName:{}},emits:["close","submit"],setup(e,{emit:t}){const r=e,n=t,{t:a}=br(()=>r.locale),i=re("");At(()=>[r.open,r.currentName],([s,l])=>{s&&(i.value=l)});function o(){const s=i.value.trim();s&&(/[\\/]/.test(s)||s==="."||s===".."||n("submit",s))}return(s,l)=>(R(),Zt(ei,{open:e.open,title:Y(a)("modal.rename.title"),size:"sm",onClose:l[2]||(l[2]=c=>n("close"))},{actions:ur(()=>[T("button",{type:"button",class:"fe-btn",onClick:l[1]||(l[1]=c=>n("close"))},V(Y(a)("modal.rename.cancel")),1),T("button",{type:"button",class:"fe-btn fe-btn--primary",onClick:o},V(Y(a)("modal.rename.save")),1)]),default:ur(()=>[T("form",{onSubmit:Ht(o,["prevent"])},[Yt(T("input",{"onUpdate:modelValue":l[0]||(l[0]=c=>i.value=c),type:"text",class:"fe-input",autocomplete:"off",onKeydown:un(Ht(o,["prevent"]),["enter"])},null,40,GE),[[Ir,i.value]])],32)]),_:1},8,["open","title"]))}}),qE=Pt({__name:"DeleteConfirmModal",props:{open:{type:Boolean},locale:{},count:{}},emits:["close","confirm"],setup(e,{emit:t}){const r=e,n=t,{t:a}=br(()=>r.locale);return(i,o)=>(R(),Zt(ei,{open:e.open,title:Y(a)("modal.delete.title"),size:"sm",onClose:o[2]||(o[2]=s=>n("close"))},{actions:ur(()=>[T("button",{type:"button",class:"fe-btn",onClick:o[0]||(o[0]=s=>n("close"))},V(Y(a)("modal.delete.cancel")),1),T("button",{type:"button",class:"fe-btn fe-btn--danger",onClick:o[1]||(o[1]=s=>n("confirm"))},V(Y(a)("modal.delete.confirm")),1)]),default:ur(()=>[T("p",null,V(Y(a)("modal.delete.message",{count:e.count})),1)]),_:1},8,["open","title"]))}}),KE={class:"fe-form__row"},WE={class:"fe-form__row fe-form__row--stack"},YE={class:"fe-form__row fe-form__row--stack"},XE={key:1,class:"fe-share-result"},ZE={class:"fe-share-result__row"},JE={class:"fe-share-result__copy"},QE=["value"],eA={key:0,class:"fe-share-result__row"},tA={class:"fe-share-result__copy"},rA=["value"],nA={class:"fe-share-result__row"},aA={class:"fe-share-result__copy"},iA=["value"],oA=Pt({__name:"ShareModal",props:{open:{type:Boolean},locale:{},share:{}},emits:["close","submit","toast"],setup(e,{emit:t}){const r=e,n=t,{t:a}=br(()=>r.locale),i=re(!1),o=re(""),s=re("");At(()=>r.open,f=>{f&&(i.value=!1,o.value="",s.value="")});function l(){n("submit",{password:i.value,expires_at:o.value?new Date(o.value).toISOString():null,max_downloads:s.value?Number(s.value):null})}async function c(f,p){try{await navigator.clipboard.writeText(f),n("toast",p)}catch{}}function u(f){return`'${f.replace(/'/g,"'\\''")}'`}const d=Fe(()=>{const f=r.share;if(!f)return"";let p=f.url;return f.password_pin&&(p+=(p.includes("?")?"&":"?")+"pin="+encodeURIComponent(f.password_pin)),`curl -fSL ${f.filename?`-o ${u(f.filename)} `:"-OJ "}${u(p)}`});return(f,p)=>(R(),Zt(ei,{open:e.open,title:Y(a)("modal.share.title"),size:"md",onClose:p[7]||(p[7]=_=>n("close"))},{actions:ur(()=>[T("button",{type:"button",class:"fe-btn",onClick:p[6]||(p[6]=_=>n("close"))},V(e.share?"Kapat":Y(a)("modal.share.cancel")),1),e.share?Te("",!0):(R(),$("button",{key:0,type:"button",class:"fe-btn fe-btn--primary",onClick:l},V(Y(a)("modal.share.create")),1))]),default:ur(()=>[e.share?(R(),$("div",XE,[T("div",ZE,[p[8]||(p[8]=T("label",null,"Link",-1)),T("div",JE,[T("input",{value:e.share.url,readonly:"",class:"fe-input"},null,8,QE),T("button",{type:"button",class:"fe-btn",onClick:p[3]||(p[3]=_=>c(e.share.url,Y(a)("modal.share.url_copied")))},V(Y(a)("modal.share.copy")),1)])]),e.share.password_pin?(R(),$("div",eA,[p[9]||(p[9]=T("label",null,"PIN",-1)),T("div",tA,[T("input",{value:e.share.password_pin,readonly:"",class:"fe-input fe-input--mono"},null,8,rA),T("button",{type:"button",class:"fe-btn",onClick:p[4]||(p[4]=_=>c(e.share.password_pin,Y(a)("modal.share.pin_copied")))},V(Y(a)("modal.share.copy")),1)])])):Te("",!0),T("div",nA,[p[10]||(p[10]=T("label",null,"CLI",-1)),T("div",aA,[T("input",{value:d.value,readonly:"",class:"fe-input fe-input--mono"},null,8,iA),T("button",{type:"button",class:"fe-btn",onClick:p[5]||(p[5]=_=>c(d.value,Y(a)("modal.share.cli_copied")))},V(Y(a)("modal.share.copy")),1)])])])):(R(),$("form",{key:0,class:"fe-form",onSubmit:Ht(l,["prevent"])},[T("label",KE,[Yt(T("input",{"onUpdate:modelValue":p[0]||(p[0]=_=>i.value=_),type:"checkbox"},null,512),[[No,i.value]]),T("span",null,V(Y(a)("modal.share.pin")),1)]),T("label",WE,[T("span",null,V(Y(a)("modal.share.expires")),1),Yt(T("input",{"onUpdate:modelValue":p[1]||(p[1]=_=>o.value=_),type:"datetime-local",class:"fe-input"},null,512),[[Ir,o.value]])]),T("label",YE,[T("span",null,V(Y(a)("modal.share.max_downloads")),1),Yt(T("input",{"onUpdate:modelValue":p[2]||(p[2]=_=>s.value=_),type:"number",min:"1",class:"fe-input"},null,512),[[Ir,s.value]])])],32))]),_:1},8,["open","title"]))}}),sA={class:"filex-cv"},lA={class:"filex-cv__head"},cA={key:0,class:"filex-cv__msg"},uA={key:1,class:"filex-cv__msg filex-cv__ok"},fA={class:"filex-cv__src"},dA=["placeholder"],pA={class:"filex-cv__list"},hA=["onClick"],vA={key:0,class:"filex-cv__empty"},mA={key:0,class:"filex-cv__err"},gA={class:"filex-cv__foot"},bA=["disabled"],yA=["src"],_A=fn(Pt({__name:"ConvertModal",props:{convertUrl:{},fileName:{},fetchBytes:{type:Function},upload:{type:Function},t:{type:Function}},emits:["close","done"],setup(e,{emit:t}){const r=e,n=t,a=re(null),i=re("loading"),o=re(null),s=re([]),l=re(""),c=re(null),u=Fe(()=>(r.fileName.split(".").pop()||"").toLowerCase()),d=Fe(()=>{const S=s.value.filter(M=>M.from);return S.find(M=>(M.ext||"").toLowerCase()===u.value)||S.find(M=>(M.format||"").toLowerCase()===u.value)||null}),f=Fe(()=>{const S=l.value.trim().toLowerCase(),M=new Set,E=[];for(const w of s.value){if(!w.to)continue;const x=(w.ext||w.format||"").toLowerCase();!x||M.has(x)||(M.add(x),E.push(w))}return E.sort((w,x)=>(w.ext||w.format).localeCompare(x.ext||x.format)),S?E.filter(w=>(w.ext||"").toLowerCase().includes(S)||(w.format||"").toLowerCase().includes(S)||(w.name||"").toLowerCase().includes(S)||(w.mime||"").toLowerCase().includes(S)):E}),p=Fe(()=>`${r.convertUrl.replace(/\/$/,"")}/?embed=1`);let _=0;const h=new Map;function b(S,M={},E=[]){const w=++_;return new Promise((x,C)=>{var D,B;h.set(w,{resolve:x,reject:C}),(B=(D=a.value)==null?void 0:D.contentWindow)==null||B.postMessage({target:"convert-embed",id:w,cmd:S,...M},"*",E),setTimeout(()=>{h.has(w)&&(h.delete(w),C(new Error("convert timeout")))},18e4)})}function v(S){const M=S.data;if(!M||M.source!=="convert-embed")return;if(M.event==="ready"){m();return}const E=h.get(M.id);E&&(h.delete(M.id),M.ok?E.resolve(M):E.reject(new Error(M.error||"convert error")))}async function m(){try{const S=await b("listFormats");s.value=S.formats||[],i.value="ready",d.value||(o.value=g("convert.unsupportedInput","Bu dosya tipi için kaynak format bulunamadı."))}catch(S){o.value=S.message,i.value="error"}}async function y(){if(!(!c.value||!d.value)){i.value="converting",o.value=null;try{const S=await r.fetchBytes(),M=await b("convert",{name:r.fileName,bytes:S,fromIndex:d.value.index,toIndex:c.value.index},[S]),E=r.fileName.replace(/\.[^.]+$/,""),w=M.ext||c.value.ext||c.value.format,x=`${E}.${w}`,C=new File([M.bytes],x,{type:c.value.mime||"application/octet-stream"});await r.upload(C),i.value="done",n("done",x)}catch(S){o.value=S.message,i.value="error"}}}function g(S,M){return r.t?r.t(S,M):M}return Xt(()=>window.addEventListener("message",v)),tr(()=>window.removeEventListener("message",v)),(S,M)=>(R(),$("div",{class:"filex-cv__bg",onClick:M[3]||(M[3]=Ht(E=>n("close"),["self"]))},[T("div",sA,[T("header",lA,[T("h3",null,V(g("convert.title","Dönüştür"))+" — "+V(e.fileName),1),T("button",{class:"filex-cv__x",onClick:M[0]||(M[0]=E=>n("close"))},"✕")]),i.value==="loading"?(R(),$("div",cA,V(g("convert.loading","Dönüştürücü yükleniyor…")),1)):i.value==="done"?(R(),$("div",uA,[T("p",null,"✓ "+V(g("convert.done","Dönüştürüldü ve klasöre yüklendi.")),1),T("button",{class:"filex-cv__convert",onClick:M[1]||(M[1]=E=>n("close"))},V(g("convert.close","Kapat")),1)])):(R(),$(qe,{key:2},[T("p",fA,[$t(V(g("convert.from","Kaynak"))+": ",1),T("b",null,V(u.value||"?"),1)]),Yt(T("input",{"onUpdate:modelValue":M[2]||(M[2]=E=>l.value=E),class:"filex-cv__search",placeholder:g("convert.searchFmt","Hedef format ara (pdf, mp4, png…)")},null,8,dA),[[Ir,l.value]]),T("div",pA,[(R(!0),$(qe,null,xt(f.value,E=>{var w;return R(),$("button",{key:E.index,class:vt(["filex-cv__fmt",{"is-sel":((w=c.value)==null?void 0:w.index)===E.index}]),onClick:x=>c.value=E},[T("b",null,V((E.ext||E.format).toUpperCase()),1),T("small",null,V(E.name),1)],10,hA)}),128)),f.value.length===0?(R(),$("div",vA,V(g("convert.noFmt","Eşleşen format yok.")),1)):Te("",!0)]),o.value?(R(),$("div",mA,V(o.value),1)):Te("",!0),T("footer",gA,[T("button",{class:"filex-cv__convert",disabled:!c.value||!d.value||i.value==="converting",onClick:y},V(i.value==="converting"?g("convert.converting","Dönüştürülüyor…"):g("convert.convert","Dönüştür")),9,bA)])],64)),T("iframe",{ref_key:"iframeRef",ref:a,src:p.value,class:"filex-cv__frame",title:"converter"},null,8,yA)])]))}}),[["__scopeId","data-v-dfaf8d90"]]),xA={class:"fx-perm-modal"},wA={class:"fx-perm-head"},kA={class:"fx-perm-title"},SA={class:"fx-perm-ico","aria-hidden":"true"},CA={class:"fx-perm-titletext"},EA=["title"],AA={class:"fx-perm-subdim"},TA={class:"fx-perm-tabs"},MA={class:"fx-perm-body"},DA={key:0,class:"fx-perm-warn"},zA={key:1,class:"fx-perm-warn"},IA={key:2,class:"fx-perm-muted"},OA={class:"fx-perm-addcard"},PA={class:"fx-perm-add"},FA={class:"fx-perm-emailwrap"},RA=["placeholder"],LA={key:0,class:"fx-perm-suggest"},BA=["onMousedown"],$A={class:"fx-perm-suggest-av"},NA={class:"fx-perm-suggest-txt"},UA={class:"fx-perm-suggest-name"},HA={class:"fx-perm-suggest-meta"},jA=["title"],GA=["value"],VA=["disabled"],qA={key:0,class:"fx-perm-invite"},KA={class:"fx-perm-muted"},WA={class:"fx-perm-invite-actions"},YA={class:"fx-perm-invite-row"},XA={value:"user"},ZA={value:"viewer"},JA=["disabled"],QA=["disabled"],eT={key:1,class:"fx-perm-notice"},tT={key:2,class:"fx-perm-reveal"},rT={class:"fx-perm-section"},nT={key:0,class:"fx-perm-empty"},aT={class:"fx-perm-av"},iT=["title"],oT=["value","onChange"],sT=["value"],lT=["disabled","title","onClick"],cT={class:"fx-perm-av fx-perm-av--dim"},uT=["title"],fT={class:"fx-perm-badge"},dT=["title"],pT={class:"fx-perm-addcard"},hT={class:"fx-perm-share-opts"},vT={class:"fx-perm-check"},mT={class:"fx-perm-expiry"},gT={class:"fx-perm-muted"},bT=["value"],yT=["disabled"],_T={key:0,class:"fx-perm-warn"},xT={key:1,class:"fx-perm-result"},wT={class:"fx-perm-linkrow"},kT=["href"],ST={key:0,class:"fx-perm-pin"},CT={class:"fx-perm-mailrow"},ET=["placeholder"],AT=["disabled"],TT={key:1,class:"fx-perm-notice"},MT={key:2,class:"fx-perm-hint"},DT={class:"fx-perm-section"},zT={key:0,class:"fx-perm-empty"},IT=["title"],OT=["onClick"],PT=["disabled","title","onClick"],FT={key:2,class:"fx-perm-addcard"},RT={class:"fx-perm-muted fx-perm-dropintro"},LT={class:"fx-perm-share-opts"},BT={class:"fx-perm-check"},$T={class:"fx-perm-expiry"},NT={class:"fx-perm-muted"},UT=["value"],HT=["disabled"],jT={key:0,class:"fx-perm-adv"},GT={class:"fx-perm-adv-row"},VT={class:"fx-perm-muted"},qT={class:"fx-perm-adv-row"},KT={class:"fx-perm-muted"},WT={class:"fx-perm-adv-row"},YT={class:"fx-perm-muted"},XT=["placeholder"],ZT={class:"fx-perm-check"},JT={key:1,class:"fx-perm-warn"},QT={key:2,class:"fx-perm-result"},eM={class:"fx-perm-linkrow"},tM=["href"],rM={key:0,class:"fx-perm-pin"},nM={class:"fx-perm-mailrow"},aM=["placeholder"],iM=["disabled"],oM={key:1,class:"fx-perm-notice"},sM=fn(Pt({__name:"PermissionsModal",props:{api:{},path:{},isDir:{type:Boolean},size:{},locale:{}},emits:["close"],setup(e,{emit:t}){const r=e,n=t,a=Fe(()=>(r.locale??"tr")!=="en");function i(ie,ae){return a.value?ie:ae}const o=Fe(()=>{const ie=/^([^:]+):\/\/(.*)$/.exec(r.path),ae=ie?ie[1]:"",U=ie?ie[2]:r.path,fe=U.split("/").filter(Boolean);return{adapter:ae,name:fe.length?fe[fe.length-1]:ae,rel:U}}),s=re("perms"),l=re(!1),c=re(!0),u=re(""),d=re([]),f=re([]),p=re(!0),_=re(""),h=re("viewer"),b=re(!1),v=re(""),m=re(!1),y=re("user"),g=re(null),S=re([]),M=re(!1);let E;const w=[{v:"viewer",l:i("Görüntüleyen","Viewer"),d:i("görüntüle + indir","view + download")},{v:"editor",l:i("Düzenleyen","Editor"),d:i("oku + yaz + sil","read + write + delete")},{v:"owner",l:i("Sahip","Owner"),d:i("düzenle + izin yönet","edit + manage access")}];function x(ie){var ae;return((ae=w.find(U=>U.v===ie))==null?void 0:ae.l)??ie}const C=re([]),D=re(!1),B=re(!1),F=re(0),K=re(null),te=re(""),J=re(""),ne=re(""),le=re(!1),q=re(""),j=[{v:0,l:i("Süresiz","Never")},{v:1,l:i("1 gün","1 day")},{v:7,l:i("7 gün","7 days")},{v:30,l:i("30 gün","30 days")}],P=re(!1),N=re(0),X=re(!1),Ee=re(""),Ae=re(""),ze=re(""),Le=re(!0),he=re(!1),Ie=re(""),De=re(null),Be=re(""),Z=re(!1),se=re("");function we(ie){const ae=new Set,U=[];for(const fe of ie.split(/[,;\s]+/)){const oe=fe.trim().toLowerCase();oe&&oe.includes("@")&&!ae.has(oe)&&(ae.add(oe),U.push(oe))}return U}function Se(ie){var fe,oe;const ae=((fe=ie.sent)==null?void 0:fe.length)??0,U=((oe=ie.failed)==null?void 0:oe.length)??0;return U===0?i(`E-posta gönderildi ✓ (${ae})`,`Email sent ✓ (${ae})`):i(`${ae} gönderildi, ${U} başarısız`,`${ae} sent, ${U} failed`)}async function me(){c.value=!0,u.value="";try{const ie=await r.api.listPermissions(r.path);d.value=ie.direct??[],f.value=ie.inherited??[],p.value=ie.storage_rbac,l.value=!0}catch(ie){ie.status===403?(l.value=!1,s.value="share"):u.value=ie instanceof Error?ie.message:String(ie)}finally{c.value=!1}}async function ye(){try{const ie=await r.api.listShares(r.path);C.value=ie.shares??[]}catch{C.value=[]}}Xt(async()=>{await me(),await ye()}),tr(()=>{E&&clearTimeout(E)});function xe(){m.value=!1,g.value=null,v.value="";const ie=_.value.trim();if(E&&clearTimeout(E),ie.length<1){S.value=[],M.value=!1;return}E=setTimeout(async()=>{try{const ae=await r.api.searchUsers(ie);S.value=ae.users??[],M.value=S.value.length>0}catch{M.value=!1}},180)}async function ee(ie){M.value=!1,_.value=ie.email;let ae=h.value;ie.role==="viewer"&&ae!=="viewer"&&(ae="viewer"),b.value=!0,v.value="";try{await r.api.addPermission({path:r.path,user_id:ie.id,level:ae,is_dir:!!r.isDir}),_.value="",S.value=[],await me(),v.value=i("Yetki verildi.","Access granted.")}catch(U){v.value=U instanceof Error?U.message:String(U)}finally{b.value=!1}}async function pe(){const ie=_.value.trim().toLowerCase();if(!ie||!ie.includes("@")){v.value=i("Geçerli bir e-posta girin.","Enter a valid email.");return}M.value=!1,b.value=!0,v.value="",g.value=null;try{const ae=await r.api.resolveEmail(ie);if(ae.found&&ae.user){let U=h.value;ae.user.role==="viewer"&&U!=="viewer"&&(U="viewer"),await r.api.addPermission({path:r.path,user_id:ae.user.id,level:U,is_dir:!!r.isDir}),_.value="",await me(),v.value=i("Yetki verildi.","Access granted.")}else m.value=!0}catch(ae){v.value=ae instanceof Error?ae.message:String(ae)}finally{b.value=!1}}async function ve(){b.value=!0,v.value="";try{const ie=await r.api.invitePermission({path:r.path,email:_.value.trim().toLowerCase(),level:h.value,create_user:!0,role:y.value,is_dir:!!r.isDir,locale:r.locale??"tr"});g.value={tempPassword:ie.temp_password},v.value=ie.emailed?i("Kullanıcı açıldı, davet e-postası gönderildi.","User created, invite emailed."):i("Kullanıcı açıldı. Geçici parolayı iletin.","User created. Share the temp password."),m.value=!1,_.value="",await me()}catch(ie){v.value=ie instanceof Error?ie.message:String(ie)}finally{b.value=!1}}function Pe(){ne.value=_.value.trim().toLowerCase(),m.value=!1,v.value="",s.value="share"}async function Ge(ie,ae){if(ae!==ie.level){b.value=!0;try{await r.api.updatePermission(ie.id,ae),await me()}catch(U){v.value=U instanceof Error?U.message:String(U)}finally{b.value=!1}}}async function Ue(ie){b.value=!0;try{await r.api.deletePermission(ie.id),await me()}catch(ae){v.value=ae instanceof Error?ae.message:String(ae)}finally{b.value=!1}}function We(ie){return ie.user_display_name||ie.user_email||`#${ie.user_id}`}function rt(ie){return(ie.user_display_name||ie.user_email||"?").charAt(0).toUpperCase()}function lt(){return F.value?new Date(Date.now()+F.value*864e5).toISOString():null}async function ft(){D.value=!0,te.value="",K.value=null,q.value="";try{const ie=await r.api.createShare({path:r.path,password:B.value,expires_at:lt()});K.value={url:ie.share.url,pin:ie.share.password_pin??null},await ye()}catch(ie){te.value=ie instanceof Error?ie.message:String(ie)}finally{D.value=!1}}async function St(){var ae;const ie=we(ne.value);if(!ie.length){q.value=i("Geçerli bir e-posta girin.","Enter a valid email.");return}if((ae=K.value)!=null&&ae.url){le.value=!0,q.value="";try{const U=await r.api.shareMail({path:r.path,emails:ie,url:K.value.url,pin:K.value.pin??void 0,expires_days:F.value||void 0,locale:r.locale??"tr",is_dir:!!r.isDir,size:r.size});q.value=Se(U)}catch(U){const fe=U.detail??"";fe.includes("not_configured")?q.value=i("SMTP ayarlı/doğrulanmış değil — linki elle iletin.","SMTP not set up/verified — share the link manually."):fe.includes("send_failed")?q.value=i("Gönderilemedi (geçici hata) — tekrar deneyin.","Send failed (temporary) — please retry."):q.value=U instanceof Error?U.message:String(U)}finally{le.value=!1}}}function $e(){return N.value?new Date(Date.now()+N.value*864e5).toISOString():null}async function L(){he.value=!0,Ie.value="",De.value=null,se.value="";try{const ie={ask_name:Le.value};Ee.value&&(ie.max_files=Number(Ee.value)),Ae.value&&(ie.max_file_size_mb=Number(Ae.value));const ae=ze.value.split(/[,\s]+/).map(fe=>fe.trim().replace(/^\./,"")).filter(Boolean);ae.length&&(ie.allowed_ext=ae);const U=await r.api.createShare({path:r.path,kind:"drop",password:P.value,expires_at:$e(),drop_settings:ie});De.value={url:U.share.url,pin:U.share.password_pin??null}}catch(ie){Ie.value=ie instanceof Error?ie.message:String(ie)}finally{he.value=!1}}async function ge(){var ae;const ie=we(Be.value);if(!ie.length){se.value=i("Geçerli bir e-posta girin.","Enter a valid email.");return}if((ae=De.value)!=null&&ae.url){Z.value=!0,se.value="";try{const U=await r.api.shareMail({path:r.path,emails:ie,url:De.value.url,pin:De.value.pin??void 0,expires_days:N.value||void 0,locale:r.locale??"tr",is_dir:!0,mode:"drop"});se.value=Se(U)}catch(U){(U.detail??"").includes("not_configured")?se.value=i("SMTP ayarlı/doğrulanmış değil — linki elle iletin.","SMTP not set up/verified — share the link manually."):se.value=U instanceof Error?U.message:String(U)}finally{Z.value=!1}}}async function Oe(ie){D.value=!0;try{await r.api.revokeShare(ie.uuid),await ye()}catch(ae){te.value=ae instanceof Error?ae.message:String(ae)}finally{D.value=!1}}function He(ie,ae="url"){var U;(U=navigator.clipboard)==null||U.writeText(ie),J.value=ae,setTimeout(()=>{J.value===ae&&(J.value="")},1400)}const de=Fe(()=>typeof navigator<"u"&&typeof navigator.share=="function");function Me(ie){if(!ie||ie<=0)return"";const ae=1024;if(ie<ae)return`${ie} B`;const U=["K","M","G","T","P","E"];let fe=ae,oe=0;for(let tt=ie/ae;tt>=ae;tt/=ae)fe*=ae,oe++;return`${(ie/fe).toFixed(1)} ${U[oe]}B`}function G(ie){return ie>0?i(`Bu bağlantı ${ie} gün geçerlidir.`,`This link is valid for ${ie} day(s).`):i("Bu bağlantının süresi yoktur.","This link does not expire.")}function je(){var st,Ye;const ie=o.value.name,ae=((st=K.value)==null?void 0:st.url)??"",U=((Ye=K.value)==null?void 0:Ye.pin)??"",fe=r.isDir?i("klasör","folder"):i("dosya","file"),oe=a.value?`${ie} ${r.isDir?"klasörü":"dosyası"} sizinle paylaşıldı`:`${ie} has been shared with you`,tt=[];if(tt.push(i("Merhaba,","Hello,"),""),tt.push(i(`Sizinle bir ${fe} paylaşıldı:`,`A ${fe} has been shared with you:`),""),r.isDir)tt.push(i(`Klasör: ${ie}`,`Folder: ${ie}`));else{tt.push(i(`Dosya: ${ie}`,`File: ${ie}`));const It=Me(r.size);It&&tt.push(i(`Boyut: ${It}`,`Size: ${It}`))}return tt.push("",i("İndirmek için:","Download it here:"),ae),U&&tt.push("",i(`PIN (erişim kodu): ${U}`,`PIN (access code): ${U}`)),tt.push("",G(F.value)),{title:oe,text:tt.join(`
|
|
22
22
|
`)}}function wt(){var It,wr;const ie=o.value.name,ae=((It=De.value)==null?void 0:It.url)??"",U=((wr=De.value)==null?void 0:wr.pin)??"",fe=Number(Ee.value)||20,oe=Number(Ae.value)||500,tt=ze.value.split(/[,\s]+/).map(hr=>hr.trim().replace(/^\./,"")).filter(Boolean),st=i(`${ie} adlı klasöre dosya eklemeniz istendi`,`You've been asked to add files to ${ie}`),Ye=[];return Ye.push(i("Merhaba,","Hello,"),""),Ye.push(i("Dosya yüklemeniz istendi.","You've been invited to upload files."),""),Ye.push(i(`Klasör: ${ie}`,`Folder: ${ie}`)),Ye.push(i(`Sınır: en fazla ${fe} dosya, dosya başına ${oe} MB.`,`Limit: up to ${fe} file(s), ${oe} MB per file.`)),Ye.push(tt.length?i(`İzinli türler: ${tt.join(", ")}`,`Allowed types: ${tt.join(", ")}`):i("İzinli türler: tüm türler","Allowed types: all")),Ye.push("",i("Dosyalarınızı buradan yükleyebilirsiniz:","Upload your files here:"),ae),U&&Ye.push("",i(`PIN (erişim kodu): ${U}`,`PIN (access code): ${U}`)),Ye.push("",G(N.value)),{title:st,text:Ye.join(`
|
|
23
|
-
`)}}async function A(ie){if(de.value)try{await navigator.share(ie)}catch{}}return(ie,ae)=>{var U,fe;return R(),$("div",{class:"fx-perm-overlay",onClick:ae[24]||(ae[24]=Ht(oe=>n("close"),["self"]))},[T("div",xA,[T("header",wA,[T("div",kA,[T("span",SA,V(e.isDir?"📁":"📄"),1),T("div",CA,[T("h3",null,V(i("Paylaş / İzinler","Share / Permissions")),1),T("span",{class:"fx-perm-sub",title:e.path},[$t(V(o.value.name),1),T("span",AA," · "+V(o.value.adapter),1)],8,EA)])]),T("button",{class:"fx-perm-x",onClick:ae[0]||(ae[0]=oe=>n("close")),"aria-label":"close"},"✕")]),T("div",TA,[l.value?(R(),$("button",{key:0,class:vt(["fx-perm-tab",{"is-active":s.value==="perms"}]),onClick:ae[1]||(ae[1]=oe=>s.value="perms")},V(i("Kişiler","People")),3)):Te("",!0),T("button",{class:vt(["fx-perm-tab",{"is-active":s.value==="share"}]),onClick:ae[2]||(ae[2]=oe=>s.value="share")},V(i("Bağlantı","Link")),3),e.isDir?(R(),$("button",{key:1,class:vt(["fx-perm-tab",{"is-active":s.value==="drop"}]),onClick:ae[3]||(ae[3]=oe=>s.value="drop")},V(i("Dosya İste","Request files")),3)):Te("",!0)]),T("div",MA,[s.value==="perms"&&l.value?(R(),$(qe,{key:0},[p.value?Te("",!0):(R(),$("div",DA,V(i("Bu diskte RBAC kapalı — izinler yalnızca RBAC açık disklerde geçerli.","RBAC is off on this storage — grants only apply when RBAC is enabled.")),1)),u.value?(R(),$("div",zA,V(u.value),1)):Te("",!0),c.value?(R(),$("div",IA,V(i("Yükleniyor…","Loading…")),1)):(R(),$(qe,{key:3},[T("div",OA,[T("div",PA,[T("div",FA,[Yt(T("input",{"onUpdate:modelValue":ae[4]||(ae[4]=oe=>_.value=oe),type:"email",class:"fx-perm-input",autocomplete:"off",placeholder:i("İsim veya e-posta","Name or email"),onInput:xe,onKeyup:un(pe,["enter"]),onFocus:xe},null,40,RA),[[Ir,_.value]]),M.value?(R(),$("ul",LA,[(R(!0),$(qe,null,xt(S.value,oe=>(R(),$("li",{key:oe.id,onMousedown:Ht(tt=>ee(oe),["prevent"])},[T("span",$A,V((oe.display_name||oe.email).charAt(0).toUpperCase()),1),T("span",NA,[T("span",UA,V(oe.display_name||oe.email),1),T("span",HA,V(oe.email)+" · "+V(oe.role),1)])],40,BA))),128))])):Te("",!0)]),Yt(T("select",{"onUpdate:modelValue":ae[5]||(ae[5]=oe=>h.value=oe),class:"fx-perm-sel",title:(U=w.find(oe=>oe.v===h.value))==null?void 0:U.d},[(R(),$(qe,null,xt(w,oe=>T("option",{key:oe.v,value:oe.v},V(oe.l),9,GA)),64))],8,jA),[[D0,h.value]]),T("button",{class:"fx-perm-btn fx-perm-btn--primary",disabled:b.value,onClick:pe},V(i("Ekle","Add")),9,VA)]),m.value?(R(),$("div",qA,[T("p",KA,V(i("Bu e-postada hesap yok. Ne yapmak istersiniz?","No account for this email — what next?")),1),T("div",WA,[T("div",YA,[Yt(T("select",{"onUpdate:modelValue":ae[6]||(ae[6]=oe=>y.value=oe),class:"fx-perm-sel"},[T("option",XA,V(i("Kullanıcı","User")),1),T("option",ZA,V(i("Görüntüleyen","Viewer")),1)],512),[[D0,y.value]]),T("button",{class:"fx-perm-btn fx-perm-btn--primary",disabled:b.value,onClick:ve},V(i("Kullanıcı oluştur + yetki ver","Create user + grant")),9,JA)]),T("button",{class:"fx-perm-btn fx-perm-btn--ghost",disabled:b.value,onClick:Pe},V(i("Sadece paylaşım linki gönder →","Just send a share link →")),9,QA)])])):Te("",!0),v.value?(R(),$("div",eT,V(v.value),1)):Te("",!0),(fe=g.value)!=null&&fe.tempPassword?(R(),$("div",tT,[$t(V(i("Geçici parola:","Temp password:"))+" ",1),T("code",null,V(g.value.tempPassword),1)])):Te("",!0)]),T("div",rT,[T("h4",null,V(i("Erişimi olanlar","People with access")),1),!d.value.length&&!f.value.length?(R(),$("div",nT,V(i("Henüz kimseyle paylaşılmadı.","Not shared with anyone yet.")),1)):Te("",!0),(R(!0),$(qe,null,xt(d.value,oe=>(R(),$("div",{key:"d"+oe.id,class:"fx-perm-person"},[T("span",aT,V(rt(oe)),1),T("span",{class:"fx-perm-user",title:oe.user_email},V(We(oe)),9,iT),T("select",{class:"fx-perm-sel fx-perm-sel--sm",value:oe.level,onChange:tt=>Ge(oe,tt.target.value)},[(R(),$(qe,null,xt(w,tt=>T("option",{key:tt.v,value:tt.v},V(tt.l),9,sT)),64))],40,oT),T("button",{class:"fx-perm-del",disabled:b.value,title:i("Kaldır","Remove"),onClick:tt=>Ue(oe)},"✕",8,lT)]))),128)),(R(!0),$(qe,null,xt(f.value,oe=>(R(),$("div",{key:"i"+oe.id,class:"fx-perm-person fx-perm-inh"},[T("span",cT,V(rt(oe)),1),T("span",{class:"fx-perm-user",title:oe.user_email},V(We(oe)),9,uT),T("span",fT,V(x(oe.level)),1),T("span",{class:"fx-perm-from",title:i("Üst klasörden gelir","Inherited from")+": "+(oe.path_prefix||"/")}," ↳ "+V(oe.path_prefix||"/"),9,dT)]))),128))])],64))],64)):Te("",!0),s.value==="share"?(R(),$(qe,{key:1},[T("div",pT,[T("div",hT,[T("label",vT,[Yt(T("input",{type:"checkbox","onUpdate:modelValue":ae[7]||(ae[7]=oe=>B.value=oe)},null,512),[[No,B.value]]),$t(" "+V(i("PIN ile koru","Protect with a PIN")),1)]),T("label",mT,[T("span",gT,V(i("Süre","Expiry")),1),Yt(T("select",{"onUpdate:modelValue":ae[8]||(ae[8]=oe=>F.value=oe),class:"fx-perm-sel fx-perm-sel--sm"},[(R(),$(qe,null,xt(j,oe=>T("option",{key:oe.v,value:oe.v},V(oe.l),9,bT)),64))],512),[[D0,F.value,void 0,{number:!0}]])]),T("button",{class:"fx-perm-btn fx-perm-btn--primary",disabled:D.value,onClick:ft},V(i("Bağlantı oluştur","Create link")),9,yT)]),te.value?(R(),$("div",_T,V(te.value),1)):Te("",!0),K.value?(R(),$("div",xT,[T("div",wT,[T("a",{href:K.value.url,target:"_blank",rel:"noopener",class:"fx-perm-link"},V(K.value.url),9,kT),T("button",{class:"fx-perm-btn fx-perm-btn--sm",onClick:ae[9]||(ae[9]=oe=>He(K.value.url,"new"))},V(J.value==="new"?i("Kopyalandı ✓","Copied ✓"):i("Kopyala","Copy")),1)]),K.value.pin?(R(),$("div",ST,[T("span",null,[ae[25]||(ae[25]=$t("PIN: ",-1)),T("code",null,V(K.value.pin),1)]),T("button",{class:"fx-perm-btn fx-perm-btn--sm",onClick:ae[10]||(ae[10]=oe=>He(K.value.pin,"sharepin"))},V(J.value==="sharepin"?i("Kopyalandı ✓","Copied ✓"):i("Kopyala","Copy")),1)])):Te("",!0),T("div",CT,[Yt(T("input",{"onUpdate:modelValue":ae[11]||(ae[11]=oe=>ne.value=oe),type:"text",class:"fx-perm-input",autocomplete:"off",placeholder:i("e-posta(lar) — virgülle ayırın","email(s) — comma separated"),onKeyup:un(St,["enter"])},null,40,ET),[[Ir,ne.value]]),T("button",{class:"fx-perm-btn",disabled:le.value,onClick:St},V(i("Gönder","Send")),9,AT)]),q.value?(R(),$("div",TT,V(q.value),1)):Te("",!0),de.value?(R(),$("button",{key:2,type:"button",class:"fx-perm-btn fx-perm-btn--ghost fx-perm-sharebtn",onClick:ae[12]||(ae[12]=oe=>A(je()))},[ae[26]||(ae[26]=T("span",{"aria-hidden":"true"},"📤",-1)),$t(" "+V(i("Paylaş","Share")),1)])):Te("",!0)])):ne.value?(R(),$("p",MT,[$t(V(i("Aşağıdan bir bağlantı oluşturun, ardından","Create a link below, then it will be sent to"))+" ",1),T("strong",null,V(ne.value),1),$t(" "+V(i("adresine gönderin.",".")),1)])):Te("",!0)]),T("div",DT,[T("h4",null,V(i("Mevcut bağlantılar","Existing links")),1),C.value.length?Te("",!0):(R(),$("div",zT,V(i("Yok","None")),1)),(R(!0),$(qe,null,xt(C.value,oe=>(R(),$("div",{key:oe.uuid,class:"fx-perm-person"},[T("span",{class:"fx-perm-user fx-perm-link",title:oe.url},V(oe.url),9,IT),T("button",{class:"fx-perm-btn fx-perm-btn--sm",onClick:tt=>He(oe.url,oe.uuid)},V(J.value===oe.uuid?i("✓","✓"):i("Kopyala","Copy")),9,OT),T("button",{class:"fx-perm-del",disabled:D.value,title:i("İptal","Revoke"),onClick:tt=>Oe(oe)},"✕",8,PT)]))),128))])],64)):Te("",!0),s.value==="drop"?(R(),$("div",FT,[T("p",RT,V(i("Bu klasöre herkesin dosya YÜKLEYEBİLECEĞİ herkese açık bir bağlantı. Yükleyenler klasördeki mevcut dosyaları göremez.","A public link that lets anyone UPLOAD files into this folder. Uploaders never see the folder's existing files.")),1),T("div",LT,[T("label",BT,[Yt(T("input",{type:"checkbox","onUpdate:modelValue":ae[13]||(ae[13]=oe=>P.value=oe)},null,512),[[No,P.value]]),$t(" "+V(i("PIN ile koru","Protect with a PIN")),1)]),T("label",$T,[T("span",NT,V(i("Süre","Expiry")),1),Yt(T("select",{"onUpdate:modelValue":ae[14]||(ae[14]=oe=>N.value=oe),class:"fx-perm-sel fx-perm-sel--sm"},[(R(),$(qe,null,xt(j,oe=>T("option",{key:oe.v,value:oe.v},V(oe.l),9,UT)),64))],512),[[D0,N.value,void 0,{number:!0}]])]),T("button",{class:"fx-perm-btn fx-perm-btn--primary",disabled:he.value,onClick:L},V(i("Bağlantı oluştur","Create link")),9,HT)]),T("button",{type:"button",class:"fx-perm-btn fx-perm-btn--ghost fx-perm-advtoggle",onClick:ae[15]||(ae[15]=oe=>X.value=!X.value)},V(X.value?i("Gelişmiş ▲","Advanced ▲"):i("Gelişmiş ▼","Advanced ▼")),1),X.value?(R(),$("div",jT,[T("label",GT,[T("span",VT,V(i("En fazla dosya","Max files")),1),Yt(T("input",{"onUpdate:modelValue":ae[16]||(ae[16]=oe=>Ee.value=oe),type:"number",min:"1",class:"fx-perm-input fx-perm-input--sm",placeholder:"20"},null,512),[[Ir,Ee.value]])]),T("label",qT,[T("span",KT,V(i("Dosya başı MB","MB / file")),1),Yt(T("input",{"onUpdate:modelValue":ae[17]||(ae[17]=oe=>Ae.value=oe),type:"number",min:"1",class:"fx-perm-input fx-perm-input--sm",placeholder:"500"},null,512),[[Ir,Ae.value]])]),T("label",WT,[T("span",YT,V(i("İzinli türler","Allowed types")),1),Yt(T("input",{"onUpdate:modelValue":ae[18]||(ae[18]=oe=>ze.value=oe),type:"text",class:"fx-perm-input fx-perm-input--sm",placeholder:i("hepsi (örn. pdf, jpg)","all (e.g. pdf, jpg)")},null,8,XT),[[Ir,ze.value]])]),T("label",ZT,[Yt(T("input",{type:"checkbox","onUpdate:modelValue":ae[19]||(ae[19]=oe=>Le.value=oe)},null,512),[[No,Le.value]]),$t(" "+V(i("Yükleyenin adını sor","Ask uploader name")),1)])])):Te("",!0),Ie.value?(R(),$("div",JT,V(Ie.value),1)):Te("",!0),De.value?(R(),$("div",QT,[T("div",eM,[T("a",{href:De.value.url,target:"_blank",rel:"noopener",class:"fx-perm-link"},V(De.value.url),9,tM),T("button",{class:"fx-perm-btn fx-perm-btn--sm",onClick:ae[20]||(ae[20]=oe=>He(De.value.url,"drop"))},V(J.value==="drop"?i("Kopyalandı ✓","Copied ✓"):i("Kopyala","Copy")),1)]),De.value.pin?(R(),$("div",rM,[T("span",null,[ae[27]||(ae[27]=$t("PIN: ",-1)),T("code",null,V(De.value.pin),1)]),T("button",{class:"fx-perm-btn fx-perm-btn--sm",onClick:ae[21]||(ae[21]=oe=>He(De.value.pin,"droppin"))},V(J.value==="droppin"?i("Kopyalandı ✓","Copied ✓"):i("Kopyala","Copy")),1)])):Te("",!0),T("div",nM,[Yt(T("input",{"onUpdate:modelValue":ae[22]||(ae[22]=oe=>Be.value=oe),type:"text",class:"fx-perm-input",autocomplete:"off",placeholder:i("e-posta(lar) — virgülle ayırın","email(s) — comma separated"),onKeyup:un(ge,["enter"])},null,40,aM),[[Ir,Be.value]]),T("button",{class:"fx-perm-btn",disabled:Z.value,onClick:ge},V(i("Gönder","Send")),9,iM)]),se.value?(R(),$("div",oM,V(se.value),1)):Te("",!0),de.value?(R(),$("button",{key:2,type:"button",class:"fx-perm-btn fx-perm-btn--ghost fx-perm-sharebtn",onClick:ae[23]||(ae[23]=oe=>A(wt()))},[ae[28]||(ae[28]=T("span",{"aria-hidden":"true"},"📤",-1)),$t(" "+V(i("Paylaş","Share")),1)])):Te("",!0)])):Te("",!0)])):Te("",!0)])])])}}}),[["__scopeId","data-v-53f367d0"]]),lM={key:0,class:"fe__presence"},cM=["title"],uM={key:1,class:"fe-e2e-strip",role:"status"},fM={class:"fe-e2e-strip__label"},dM={key:0,class:"fe__skeleton",role:"status"},pM={class:"fe-sr-only"},hM={key:0,class:"fe-skel-grid","aria-hidden":"true"},vM={key:1,class:"fe-skel-list","aria-hidden":"true"},mM={key:1,class:"fe-state"},gM={class:"fe-state__title"},bM={class:"fe-state__path"},yM={class:"fe-state__hint"},_M={class:"fe-state__actions"},xM={key:2,class:"fe-state"},wM={class:"fe-state__title"},kM={class:"fe-state__hint"},SM={class:"fe-state__actions"},CM={class:"fe-state__details"},EM={class:"fe-state__details-summary"},AM={class:"fe-state__details-pre"},TM={key:3,class:"fe-state fe-e2e-lock"},MM={class:"fe-state__title"},DM={class:"fe-state__hint"},zM=["placeholder","disabled"],IM=["disabled"],OM={key:0,class:"fe-form__error",role:"alert"},PM={key:4,class:"fe-state"},FM={class:"fe-state__title"},RM={class:"fe-state__hint"},LM={key:5,class:"fe-state"},BM={class:"fe-state__title"},$M={key:6,class:"fe-state"},NM={class:"fe-state__art",viewBox:"0 0 120 100",width:"110",height:"92",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},UM={key:0},HM={class:"fe-state__title"},jM={key:0,class:"fe-state__hint"},GM={key:1,class:"fe-state__actions"},VM={key:1,class:"fe__dragover"},qM=["title","aria-label"],KM={class:"fe-recents__header"},WM={class:"fe-modal__head"},YM={class:"fe-modal__title"},XM={class:"fe-modal__body"},ZM={class:"fe-toast__msg"},ym="brf-file-explorer:view-mode",_m="filex.inspector",Of="brf-file-explorer:path",Ti="application/x-brf-files",xm="filex.tourDone",Pf="application/x-brf-files-src",wm="filex.tabs",JM=Pt({__name:"FileExplorer",props:{config:{}},emits:["share-created","file-opened","error","upload-progress","selection-change","navigate"],setup(e,{expose:t,emit:r}){const n=e,a=r,i=px(n.config),o=Fe(()=>n.config.locale||"tr"),{t:s}=br(o),l=Px(i,{reload:()=>Qt()}),c=l.presenceUsers,u=l.degraded;function d(I){const O=(I||"").replace(/^\/+|\/+$/g,"");if(O===".trash"||O.startsWith(".trash/"))return null;const be=Er(O);return!be||!be.includes("://")||be.startsWith("://")?null:be}Xt(()=>{l.start(),l.subscribe(d(g.value))}),tr(()=>l.stop());const f=Rx(n.config.apiBase,i),p=hx(n.config,i),_=new Map,h=Ax(n.config,i,{onSettled:I=>{var be;const O=_.get(I.id);if(_.delete(I.id),I.status==="error")bt(I.error_message||"İşlem başarısız");else if(O)Qr(`${O.message} (${I.progress_total})`,O.fn);else{const ke=I.op_type==="copy"?"Kopyalandı":I.op_type==="move"?"Taşındı":"Silindi";bt(`${ke} (${I.progress_total})`)}Qt(),(be=zr.value)==null||be.reload()}}),b=re(!1),v=(n.config.rootPath||"").trim(),m=v.replace("://","/").replace(/^\/+|\/+$/g,""),y=m||n.config.initialPath||"",g=re(y),S=re(n.config.defaultAdapter||"brf"),M=re(y),E=re([]),w=re(""),x=re(""),C=re("");let D;function B(){Qt(D)}const F=u_((I,O)=>{let be=(()=>{try{const ke=localStorage.getItem(ym);if(ke==="list"||ke==="grid"||ke==="gallery")return ke}catch{}return n.config.viewMode??"list"})();return{get(){return I(),be},set(ke){if(ke!==be){be=ke;try{localStorage.setItem(ym,ke)}catch{}O()}}}}),K=re("comfortable"),te=re(""),J=re(!1),ne=re(""),le=Fe(()=>J.value),q=Fe(()=>{const I=(g.value??"").replace(/^\/+|\/+$/g,"");return m&&I===m?!1:I.length>0}),j=Fe(()=>cr.value?!(g.value??"").replace(/^\/+|\/+$/g,""):!1);function P(){if(J.value){Qt(ne.value);return}const I=(g.value??"").replace(/^\/+|\/+$/g,"");if(!I||I===m)return;const O=I.lastIndexOf("/");let be=O===-1?"":I.slice(0,O);m&&!(be===m||be.startsWith(m+"/"))&&(be=m),Qt(be)}const N=vx(()=>E.value);At(()=>[...N.selected.value],()=>{a("selection-change",N.nodes.value.map(O=>({path:O.path,basename:O.basename,type:O.type})));const I=N.nodes.value.filter(O=>O.type==="file");l.setFocus(I.length===1?I[0].basename:null)});const X=re({mode:null,items:[],sourcePath:null}),Ee=re(null),Ae=re(new Set),ze=re(!1),Le=re(!1),he=re(null),Ie=re(0);async function De(){try{const I=await Ao(),O=n.config.apiBase??"",be=await fetch(`${O}/api/files/manager/star/list?limit=500`,{headers:I,credentials:"include"});if(!be.ok)return;const ke=await be.json(),Re=Array.isArray(ke)?ke:Array.isArray(ke==null?void 0:ke.entries)?ke.entries:Array.isArray(ke==null?void 0:ke.nodes)?ke.nodes:[];Ae.value=new Set(Re.map(Ce=>Ce.id).filter(Ce=>typeof Ce=="number"))}catch{}}function Be(I,O){if(typeof I.id!="number")return;const be=new Set(Ae.value);O?be.add(I.id):be.delete(I.id),Ae.value=be}async function Z(I){if(typeof I.id=="number")try{const O=n.config.apiBase??"";await fetch(`${O}/api/files/manager/recent`,{method:"POST",headers:await Ao({"Content-Type":"application/json"}),credentials:"include",body:JSON.stringify({node_id:I.id})}),Ie.value+=1}catch{}}function se(I){typeof I.id=="number"&&(he.value=I,Le.value=!0)}function we(I){const O={type:"file",path:I.path,basename:I.name,extension:(I.name.split(".").pop()||"").toLowerCase(),id:I.id};ze.value=!1,Ha(O)}const Se=Fe(()=>{var O,be,ke;if(n.config.onlyOfficeBase)return n.config.onlyOfficeBase;const I=(be=(O=Ee.value)==null?void 0:O.external)==null?void 0:be.onlyoffice;return I&&!Fv(I)?null:((ke=Ee.value)==null?void 0:ke.onlyoffice_url)||null}),me=Fe(()=>Se.value&&i.endpoints.onlyOfficeConfig||null),ye=Fe(()=>{var be,ke,Re;const I=n.config.drawioUrl||n.config.drawioBase;if(I)return I;const O=(ke=(be=Ee.value)==null?void 0:be.external)==null?void 0:ke.drawio;return O&&!Fv(O)?null:((Re=Ee.value)==null?void 0:Re.drawio_url)||null}),xe=Fe(()=>{var I;return n.config.convertBase||((I=Ee.value)==null?void 0:I.convert_url)||null}),ee=re([]),pe=re(null),ve=re(!1),Pe=re(!1),Ge=re(!1),Ue=re(!1),We=re(!1),rt=re(null),lt=re(!1),ft=re(null),St=re(null),$e=re(null),L=re("edit"),ge=re(!1),Oe=re(null),He=re(!1),de=re(null),Me=re((()=>{try{return localStorage.getItem(_m)==="1"}catch{return!1}})());function G(I){try{localStorage.setItem(_m,I?"1":"0")}catch{}}function je(){Me.value=!Me.value,G(Me.value)}function wt(){Me.value||(Me.value=!0,G(!0))}function A(){Me.value&&(Me.value=!1,G(!1))}const ie=Fe(()=>{if(J.value)return s("node.trash");const I=(g.value??"").replace(/^\/+|\/+$/g,"");return I?I.split("/").pop()||I:S.value||s("breadcrumb.root")});function ae(I){de.value=I,He.value=!0}function U(I){return I===void 0||I==="editor"||I==="owner"}function fe(I){var O;return I.length===1&&typeof((O=I[0])==null?void 0:O.perm)=="string"?I[0].perm:w.value}const oe=Fe(()=>U(w.value)),tt=Fe(()=>oe.value&&!j.value&&!J.value),st=re(null),Ye=re(null),It=re(null),wr=re(!1),hr=re(!1);let Bt,or;function Br(I){hr.value=!!(I&&"matches"in I&&I.matches)}Xt(()=>{var I;typeof ResizeObserver<"u"&&Ye.value&&(Bt=new ResizeObserver(O=>{var ke,Re,Ce;const be=((Re=(ke=O[0])==null?void 0:ke.contentRect)==null?void 0:Re.width)??((Ce=Ye.value)==null?void 0:Ce.clientWidth)??0;wr.value=be>0&&be<560}),Bt.observe(Ye.value)),typeof window<"u"&&window.matchMedia&&(or=window.matchMedia("(pointer: coarse)"),Br(or),(I=or.addEventListener)==null||I.call(or,"change",Br))}),tr(()=>{var I;Bt==null||Bt.disconnect(),Bt=void 0,(I=or==null?void 0:or.removeEventListener)==null||I.call(or,"change",Br),or=void 0});const gr=re(null);let ha;function Co(I,O){gr.value=I,ha&&clearTimeout(ha),ha=setTimeout(()=>gr.value=null,O)}function bt(I){Co({message:I},2500)}function Qr(I,O){Co({message:I,actionLabel:s("toast.undo"),action:O},8e3)}function Mr(){ha&&(clearTimeout(ha),ha=void 0),gr.value=null}async function va(){var O;const I=(O=gr.value)==null?void 0:O.action;if(Mr(),!!I)try{await I(),bt(s("toast.undone")),await Qt()}catch{bt(s("toast.undo_failed"))}}const cr=Fe(()=>n.config.multiStorageRoot===!0);function hu(I){const O=I.replace(/^\/+|\/+$/g,"");if(!O)return{adapter:"",rel:""};const be=O.indexOf("/");return be===-1?{adapter:O,rel:""}:{adapter:O.slice(0,be),rel:O.slice(be+1)}}function Zp(I){if(I.includes("://"))return I;const{adapter:O,rel:be}=hu(I);return O?be?`${O}://${be}`:`${O}://`:""}function As(I){const O=I.indexOf("://");if(O===-1)return I.replace(/^\/+|\/+$/g,"");const be=I.slice(0,O),ke=I.slice(O+3).replace(/^\/+|\/+$/g,"");return ke?`${be}/${ke}`:be}function W3(){return(n.config.storages??[]).map(O=>({type:"dir",path:O.name,basename:O.label||O.name,extension:"",storage:O.name,visibility:"private",file_size:0,mime_type:"inode/storage",extra_metadata:{driver:O.driver,readOnly:O.readOnly}}))}async function Qt(I){b.value=!0,J.value=!1;let O=I??g.value??"";try{if(x.value="",C.value="",m){const Re=String(O).replace(/^\/+|\/+$/g,"");(!Re||!(Re===m||Re.startsWith(m+"/")))&&(O=m)}if(cr.value&&!Zp(O)){g.value="",S.value="",M.value="",Nn.value="",E.value=W3();return}const be=cr.value?Zp(O):Er(O),ke=te.value?await i.search(be,te.value):await i.index(be);S.value=ke.adapter,M.value=ke.dirname,w.value=ke.perm||"",Nn.value=typeof ke.e2e_root=="string"?ke.e2e_root:"",E.value=vm(ke.files),mm(E.value,ke.adapter,ke.dirname,n.config.trashVisible!==!1)&&gm(E.value,ke.adapter,i),g.value=cr.value?As(ke.dirname):Eo(ke.dirname)}catch(be){const ke=be instanceof Error?be.message:String(be),Re=be.status;if(Re===404||Re===403){x.value=String(O),Nn.value="",E.value=[],a("error",{message:ke,context:{path:I}});return}C.value=ke,D=typeof O=="string"?O:void 0,a("error",{message:ke,context:{path:I}}),E.value.length>0&&bt(ke)}finally{b.value=!1}}function Eo(I){const O=I.indexOf("://");return O===-1?I:I.slice(O+3)}function zL(){x.value="",e5(""),Qt("")}async function Gl(){b.value=!0,ne.value=S.value||"",J.value=!0,Nn.value="",N.clear();try{const{entries:I}=await i.listTrash();E.value=I.map(O=>({type:"file",id:O.id,path:O.storage_name?`${O.storage_name}://${O.path}`:O.path,basename:O.name,extension:O.name.includes(".")&&O.name.split(".").pop()||"",storage:O.storage_name||"",visibility:"private",file_size:O.size,mime_type:O.mime||"",extra_metadata:{deleted_at:O.deleted_at,ttl_days:O.ttl_days??null}})),M.value=".trash",g.value=".trash"}catch(I){const O=I instanceof Error?I.message:String(I);a("error",{message:O,context:{op:"trash-list"}}),bt(O)}finally{b.value=!1}}function Er(I){if(I&&I.includes("://"))return I;if(cr.value){const O=Zp(I??"");return O||(S.value?`${S.value}://`:"")}return I?`${S.value}://${I.replace(/^\/+/,"")}`:`${S.value}://`}function Y3(I){const O=I.indexOf("://"),be=(O===-1?I:I.slice(O+3)).replace(/\/+$/,""),ke=be.lastIndexOf("/");return ke===-1?be:be.slice(ke+1)}function vu(I){const O=I.indexOf("://"),be=O===-1?"":I.slice(0,O+3),ke=(O===-1?I:I.slice(O+3)).replace(/\/+$/,""),Re=ke.lastIndexOf("/");return Re===-1?be:be+ke.slice(0,Re)}function Jp(I,O){const be=ke=>{const Re=ke.indexOf("://"),Ce=Re===-1?"":ke.slice(0,Re+3),Et=(Re===-1?ke:ke.slice(Re+3)).replace(/\/+$/,"");return Ce+Et};return be(I)===be(O)}function Vl(I,O){return I?I.endsWith("://")||I.endsWith("/")?I+O:`${I}/${O}`:O}function X3(I,O,be,ke){if(!ke||!be)return;const Re=O.map(Ce=>Vl(be,Y3(Ce)));Re.length!==0&&_.set(I,{message:s("toast.moved"),fn:async()=>{const{op:Ce}=await i.moveAsync(Re,ke,be);h.register(Ce)}})}At(()=>te.value,()=>void Qt());function mu(){return n.config.pathPersist??"hash"}function Z3(){const I=mu();return I==="hash"||I==="hash+localStorage"}function IL(I){try{return decodeURIComponent(I)}catch{return I}}function J3(){try{return localStorage.getItem(Of)||""}catch{return""}}function Q3(){const I=window.location.hash||"";return I.startsWith("#")?IL(I.slice(1)).replace(/^\/+|\/+$/g,""):""}function OL(){if(typeof window>"u")return"";const I=mu();if(I==="none")return"";if(I==="localStorage")return J3();const O=Q3();return O||I==="hash"?O:y?"":J3()}function e5(I){if(typeof window>"u")return;const O=mu();if(O==="none")return;if(O==="localStorage"||O==="hash+localStorage"){try{I?localStorage.setItem(Of,I):localStorage.removeItem(Of)}catch{}if(O==="localStorage")return}const be=I?I.split("/").map(encodeURIComponent).join("/"):"",ke=be?`#${be}`:"";(window.location.hash||"")!==ke&&history.replaceState(null,"",ke||window.location.pathname+window.location.search)}function t5(){if(!Z3())return;const I=Q3();I&&I!==g.value&&Qt(I)}At(g,I=>{e5(I),a("navigate",{path:I}),l.subscribe(d(I))}),t({reload:()=>Qt()}),Xt(async()=>{var O;_f();const I=OL();await Qt(I||void 0),await Nr(),(O=Ye.value)==null||O.focus(),De(),Z3()&&window.addEventListener("hashchange",t5),i.endpoints.opsList&&h.startPolling(),i.endpoints.capabilities&&i.capabilities().then(be=>{Ee.value=be}).catch(()=>{})});const Qp=re(!1),gu=re(!1);function PL(I){return i.globalSearch(I,{limit:8,scope:"all"})}async function FL(I){const O=String(I.path??"").replace(/^\/+|\/+$/g,"");if(!O)return;const be=I.type==="dir",ke=O.lastIndexOf("/"),Re=be?O:ke===-1?"":O.slice(0,ke);let Ce=Re;if(cr.value){const Kt=n.config.storages??[],Wr=typeof I.storage=="string"&&I.storage||typeof I.storage_name=="string"&&I.storage_name||(Kt.length===1?Kt[0].name:"")||S.value;if(!Wr)return;Ce=Re?`${Wr}/${Re}`:Wr}if(await Qt(Ce),be)return;const Et=String(I.name??O.slice(ke+1)),Ut=E.value.find(Kt=>Kt.type==="file"&&Kt.basename===Et);Ut&&(N.click(Ut.path),Ha(Ut))}Sx(Ye,{onDelete:()=>{var I;if(Qn.value){const O=((I=zr.value)==null?void 0:I.selectedNodes())??[];O.length&&(Ts.value=O,lt.value=!0,Ge.value=!0)}else N.isEmpty.value||(lt.value=!1,Ge.value=!0)},onRename:()=>{var I;if(Qn.value){const O=((I=zr.value)==null?void 0:I.selectedNodes())??[];O.length===1&&(rt.value=O[0],lt.value=!0,Pe.value=!0)}else N.nodes.value.length===1&&(rt.value=N.nodes.value[0],lt.value=!1,Pe.value=!0)},onSelectAll:()=>{var I;return Qn.value?(I=zr.value)==null?void 0:I.selectAll():N.selectAll()},onOpen:()=>{var O;if(Qn.value)return(O=zr.value)==null?void 0:O.openSelected();const I=N.nodes.value[0];I&&Ha(I)},onClose:()=>{var I;ve.value=!1,Pe.value=!1,Ge.value=!1,Ue.value=!1,We.value=!1,(I=st.value)==null||I.hide(),Mr(),wr.value&&A()},onFocusSearch:()=>{var I;return(I=It.value)==null?void 0:I.focusSearch()},onCut:()=>Qn.value?b5():XL(),onCopy:()=>Qn.value?y5():ZL(),onPaste:()=>Qn.value?void _5():void n5(),onGoUp:()=>{var I;return Qn.value?(I=zr.value)==null?void 0:I.goUp():P()},onPathJump:()=>{Qp.value=!0},onShowHelp:()=>{gu.value=!0},onQuickLook:()=>xB(),onToggleInspector:()=>je(),onTabNew:()=>dh(),onTabClose:()=>f5(fh.value),onTabNext:()=>OB(),onTabPrev:()=>PB(),hasSelection:()=>!N.isEmpty.value});const RL=new Set(["docx","xlsx","pptx","doc","xls","ppt","odt","ods","odp"]);function Ha(I){if(I.basename===".trash"){Gl();return}if(I.type==="dir"){const be=cr.value?As(I.path):Eo(I.path);Qt(be);return}if(ja.value&&I.type==="file"){bh(I);return}if(hh.value&&I.type==="file")return;const O=(I.extension||"").toLowerCase();L.value=U(I.perm??w.value)?BL(O):"view",$e.value=I,We.value=!0,a("file-opened",{path:I.path,basename:I.basename}),Z(I)}const LL=new Set([...RL,"drawio","dio","pdf","epub","ipynb","tiff","tif","psd","mmd","mermaid","glb","gltf","obj","stl","fbx","3ds","zip","rar","7z","tar","gz","tgz","jpg","jpeg","png","webp","gif","bmp","avif","svg","heic","mp4","webm","mov","mkv","m4v","ogv","mp3","wav","ogg","flac","m4a","aac","opus"]);function BL(I){return LL.has(I)?"view":"edit"}async function $L(I){const O=I??N.nodes.value;if(O.length!==0)try{if(J.value){const Re=O.map(Et=>Et.id).filter(Et=>typeof Et=="number"),{restored:Ce}=await i.restoreIds(Re);bt(`${Ce} öğe geri getirildi`),N.clear(),await Gl();return}if(!i.endpoints.restore)return;const be=O.map(Re=>Re.path),{restored:ke}=await i.restore(be);bt(`${ke} öğe geri getirildi`),N.clear(),await Qt()}catch(be){a("error",{message:be.message,context:{op:"restore"}})}}function r5(I){if(ja.value&&I.type==="file"){bh(I);return}L.value="view",$e.value=I,We.value=!0,Z(I)}function NL(I){if(I.type==="dir"){const Ce=cr.value?As(I.path):Eo(I.path);Qt(Ce);return}if(ea.value){ja.value&&bh(I);return}if(!U(I.perm??w.value)){r5(I);return}const O=(I.extension||"").toLowerCase(),be=n.config.openPageBase;if(!be){Ha(I);return}const ke=be.includes("?")?"&":"?",Re=`${be}${ke}path=${encodeURIComponent(I.path)}&type=${encodeURIComponent(O)}&mode=edit`;window.open(Re,"_blank","noopener"),a("file-opened",{path:I.path,basename:I.basename}),Z(I)}const wn=re("selection"),eh=re(""),Ts=re([]),UL=re(""),HL=Fe(()=>{const I=N.nodes.value;return I.length===0?"none":I.length===1?I[0].type==="dir"?"single-dir":"single-file":"multi"});async function jL(I){const O=N.nodes.value;if(I==="open"){O[0]&&Ha(O[0]);return}await nh(I,O)}async function th(I,O){var be;wn.value="selection",N.has(I.path)||(N.click(I.path),await Nr()),(be=st.value)==null||be.show({clientX:O.clientX,clientY:O.clientY},N.nodes.value)}function GL(I){var O;I.preventDefault(),wn.value="selection",N.clear(),(O=st.value)==null||O.show({clientX:I.clientX,clientY:I.clientY},[])}function VL(I){var O;wn.value="breadcrumb",eh.value=I.adapterPath,UL.value=I.label,(O=st.value)==null||O.show({clientX:I.x,clientY:I.y},[])}function qL(I,O){var ke,Re;_i.value="split";const be=((ke=zr.value)==null?void 0:ke.selectedNodes())??[];Ts.value=I?be.length>0?be:[I]:[],wn.value="pane",(Re=st.value)==null||Re.show({clientX:O.clientX,clientY:O.clientY},Ts.value)}const KL=Fe(()=>{if(wn.value==="breadcrumb")return[{key:"open",label:s("ctx.open"),icon:"↗"},{key:"copy-path",label:s("breadcrumb.copy_path"),icon:"📋"}];if(wn.value==="pane"){const Ce=Ts.value;return Ce.length===0?[{key:"new-folder",label:s("toolbar.new_folder"),icon:"📁"},{key:"paste",label:s("ctx.paste"),icon:"📋",disabled:!X.value.mode}]:rh(Ce)}const I=N.nodes.value,O=I.length>0,be=I.length===1;if(le.value)return O?[{key:"restore",label:s("ctx.restore"),icon:"↩"},{divider:!0,key:"sep1",label:""},{key:"delete",label:s("ctx.delete_perm"),icon:"🗑",danger:!0}]:[];const ke=(g.value??"").replace(/^\/+|\/+$/g,"");return cr.value&&ke===""?O?be?[{key:"open",label:s("ctx.open"),icon:"↗"},{key:"open-tab",label:s("ctx.open_new_tab"),icon:"⧉"}]:[]:[]:O?rh(I):U(w.value)?[{key:"new-folder",label:s("toolbar.new_folder"),icon:"📁"},{key:"paste",label:s("ctx.paste"),icon:"📋",disabled:!X.value.mode}]:[]});function rh(I){var C5,E5,A5;const O=I.length>0,be=I.length===1,ke=be&&((C5=I[0])==null?void 0:C5.type)==="file",Re=o.value==="en"?"Tags…":"Etiketler…",Ce=be&&typeof((E5=I[0])==null?void 0:E5.id)=="number",Et=o.value==="en"?"Copy node id":"Node id'yi kopyala",Ut=fe(I),Kt=U(Ut),Wr=o.value==="en"?"Share / Permissions":"Paylaş / İzinler";return[{key:"open",label:s("ctx.open"),icon:"↗",hidden:!be},{key:"open-tab",label:s("ctx.open_new_tab"),icon:"⧉",hidden:!be||((A5=I[0])==null?void 0:A5.type)!=="dir"},{key:"preview",label:s("ctx.preview"),icon:"👁",hidden:!be,disabled:!ke},{key:"download",label:s("ctx.download"),icon:"⬇",hidden:!be,disabled:!ke},{key:"convert",label:s("ctx.convert"),icon:"🔄",hidden:!be||!xe.value||!Kt||ea.value,disabled:!ke},{key:"access",label:Wr,icon:"🔗",hidden:!be||!Kt||ea.value},{key:"details",label:s("ctx.details"),icon:"ℹ",hidden:!O},{key:"copy-id",label:Et,icon:"🆔",hidden:!Ce,disabled:!Ce},{divider:!0,key:"sep1",label:"",hidden:!Kt},{key:"rename",label:s("ctx.rename"),icon:"✎",hidden:!be||!Kt,disabled:!be},{key:"cut",label:s("ctx.cut"),icon:"✂",hidden:!O||!Kt,disabled:!O},{key:"copy",label:s("ctx.copy"),icon:"❐",hidden:!O,disabled:!O},{key:"paste",label:s("ctx.paste"),icon:"📋",hidden:!Kt,disabled:!X.value.mode},{divider:!0,key:"sep-meta",label:"",hidden:!Ce},{key:"tags",label:Re,icon:"🏷",hidden:!Ce,disabled:!Ce},{divider:!0,key:"sep2",label:"",hidden:!Kt},{key:"delete",label:s("ctx.delete"),icon:"🗑",danger:!0,hidden:!O||!Kt,disabled:!O}]}const WL=Fe(()=>{const I=N.nodes.value;if(le.value)return I.length===0?[]:[{key:"restore",label:s("ctx.restore"),icon:"↩"},{key:"delete",label:s("ctx.delete_perm"),icon:"🗑",danger:!0}];const O=(g.value??"").replace(/^\/+|\/+$/g,"");return cr.value&&O===""?I.length===1?[{key:"open",label:s("ctx.open"),icon:"↗"}]:[]:I.length===0?[]:rh(I)});async function YL(I,O){if(wn.value==="breadcrumb"){I.key==="open"?Qt(Eo(eh.value)):I.key==="copy-path"&&await s5(eh.value);return}if(wn.value==="pane"){await nh(I.key,Ts.value);return}await nh(I.key,O)}async function nh(I,O){var be;switch(I){case"open":O[0]&&NL(O[0]);break;case"preview":O[0]&&r5(O[0]);break;case"download":O[0]&&QL(O[0]);break;case"convert":O[0]&&aB(O[0]);break;case"share":O[0]&&nB(O[0]);break;case"access":O[0]&&(de.value=O[0],He.value=!0);break;case"details":wt();break;case"copy-id":if(O[0]&&typeof O[0].id=="number"){const ke=O[0].id;(be=navigator.clipboard)==null||be.writeText(String(ke)).then(()=>bt(o.value==="en"?`Node id ${ke} copied`:`Node id ${ke} kopyalandı`),()=>bt(`#${ke}`))}break;case"tags":O[0]&&se(O[0]);break;case"rename":O[0]&&(rt.value=O[0],lt.value=wn.value==="pane",Pe.value=!0);break;case"cut":wn.value==="pane"?b5():(X.value={mode:"cut",items:O,sourcePath:g.value},bt("Kes → Yapıştır hazır"));break;case"copy":wn.value==="pane"?y5():(X.value={mode:"copy",items:O,sourcePath:g.value},bt("Kopyala → Yapıştır hazır"));break;case"paste":wn.value==="pane"||Qn.value?await _5():await n5();break;case"delete":lt.value=wn.value==="pane",Ge.value=!0;break;case"restore":O.length>0&&await $L(O);break;case"new-folder":lt.value=wn.value==="pane",ve.value=!0;break;case"duplicate":O[0]&&await JL(O[0]);break;case"open-tab":O[0]&&d5(O[0]);break}}function XL(){N.isEmpty.value||(X.value={mode:"cut",items:N.nodes.value,sourcePath:g.value},bt("Kesildi"))}function ZL(){N.isEmpty.value||(X.value={mode:"copy",items:N.nodes.value,sourcePath:g.value},bt("Kopyalandı"))}async function n5(){const I=X.value;if(!(!I.mode||I.items.length===0))try{const O=I.items.map(Re=>Re.path),be=I.sourcePath||"";if(I.mode==="cut"&&be===g.value){bt("Aynı klasöre kesilemez");return}if(I.mode==="cut"){const Re=Er(g.value),Ce=Er(be)||void 0,{op:Et}=await i.moveAsync(O,Re,Ce);X3(Et.id,O,Re,Ce),h.register(Et),bt("Taşıma kuyruğa alındı")}else{const{op:Re}=await i.copy(O,Er(g.value));h.register(Re),bt("Kopyalama kuyruğa alındı")}X.value={mode:null,items:[],sourcePath:null}}catch(O){a("error",{message:O.message,context:{op:"paste"}})}}async function JL(I){try{const{op:O}=await i.copy([I.path],Er(g.value));h.register(O)}catch(O){a("error",{message:O.message,context:{op:"duplicate"}})}}function QL(I){if(ja.value){KB(I);return}const O=i.downloadUrl(I.path);window.open(O,"_blank")}async function eB(I){var be,ke;const O=lt.value;try{const Re=Er(O?((be=zr.value)==null?void 0:be.getPath())??"":g.value);await i.newFolder(Re,I),ve.value=!1,O?await((ke=zr.value)==null?void 0:ke.reload()):await Qt()}catch(Re){a("error",{message:Re.message,context:{op:"newfolder"}})}}async function tB(I){var ke,Re;const O=rt.value;if(!O)return;const be=lt.value;try{const Ce=Er(be?((ke=zr.value)==null?void 0:ke.getPath())??"":g.value),Et=O.path,Ut=O.basename;if(await i.rename(Ce,Et,I),Pe.value=!1,rt.value=null,be?await((Re=zr.value)==null?void 0:Re.reload()):await Qt(),I&&I!==Ut){const Kt=Vl(vu(Et),I);Qr(s("toast.renamed"),async()=>{await i.rename(Ce,Kt,Ut)})}}catch(Ce){a("error",{message:Ce.message,context:{op:"rename"}})}}async function rB(){var Et,Ut,Kt;if(J.value){Ge.value=!1,bt("Çöpteki öğeler saklama süresi sonunda otomatik silinir. Kalıcı silme yönetici panelinden yapılır.");return}const I=lt.value,O=I?Ts.value:N.nodes.value,be=Er(I?((Et=zr.value)==null?void 0:Et.getPath())??"":g.value),ke=O.map(Wr=>Wr.path);if(ke.length===0){Ge.value=!1;return}const Re=O.map(Wr=>Wr.id).filter(Wr=>typeof Wr=="number"),Ce=i.endpoints.trashRestore&&Re.length===O.length?async()=>{const{restored:Wr}=await i.restoreIds(Re);if(Wr===0)throw new Error("restore failed")}:null;try{if(i.endpoints.deleteAsync){const{op:Wr}=await i.deleteAsync(ke,be);Ce&&_.set(Wr.id,{message:s("toast.trashed"),fn:Ce}),h.register(Wr),bt("Silme kuyruğa alındı")}else await i.deleteItems(be,ke),I?await((Ut=zr.value)==null?void 0:Ut.reload()):await Qt(),Ce&&Qr(s("toast.trashed"),Ce);Ge.value=!1,I?(Kt=zr.value)==null||Kt.reload():N.clear()}catch(Wr){a("error",{message:Wr.message,context:{op:"delete"}})}}function nB(I){ft.value=I,St.value=null,Ue.value=!0}function aB(I){Oe.value=I,ge.value=!0}function iB(I){bt(o.value==="en"?`Converted → ${I}`:`Dönüştürüldü → ${I}`),Qt()}async function oB(I){const O=ft.value;if(O)try{const{share:be}=await i.createShare({path:O.path,password:I.password,expires_at:I.expires_at,max_downloads:I.max_downloads});St.value=be,a("share-created",{path:O.path,url:be.url,pin:be.password_pin??null})}catch(be){a("error",{message:be.message,context:{op:"share"}})}}function sB(){Ue.value=!1,ft.value=null,St.value=null}function bu(){var I;if(!oe.value){bt(o.value==="en"?"Read-only here":"Burada yazma yetkiniz yok");return}(I=pe.value)==null||I.click()}function lB(I){const O=I.target,be=O.files?Array.from(O.files):[];O.value="",a5(be)}async function a5(I){if(I.length===0)return;if(hh.value){bt(s("e2e.upload.locked"));return}if(ja.value&&(I=await WB(I),I.length===0))return;const O=!!(i.endpoints.uploadInit&&i.endpoints.uploadFinalize);for(const be of I)O&&be.size>=10*1024*1024&&await uB(be)||await cB(be);await Qt()}async function cB(I){const O=crypto.randomUUID(),be=Er(g.value);ee.value=[...ee.value,{id:O,file:I,path:be,totalBytes:I.size,uploadedBytes:0,percent:0,status:"uploading",cancel(){}}];const ke=Re=>{const Ce=ee.value.findIndex(Ut=>Ut.id===O);if(Ce===-1)return;const Et=[...ee.value];Et[Ce]={...Et[Ce],...Re},ee.value=Et};try{await i.uploadMultipart(be,[I],Re=>{ke({percent:Re,uploadedBytes:Math.round(Re/100*I.size)}),a("upload-progress",{uploadId:O,percent:Re,done:Re>=100})}),ke({percent:100,uploadedBytes:I.size,status:"done"}),a("upload-progress",{uploadId:O,percent:100,done:!0})}catch(Re){ke({status:"error"}),a("error",{message:Re.message,context:{op:"upload",file:I.name}})}}async function uB(I){const O=crypto.randomUUID();let be=!1;try{return await p.uploadFile({path:Er(g.value),file:I,onProgress:ke=>{if(be){const Re=ee.value.findIndex(Ce=>Ce.id===O);if(Re!==-1){const Ce=[...ee.value];Ce[Re]={...ke,id:O},ee.value=Ce}}else{if(ke.status!=="uploading"&&ke.uploadedBytes<=0)return;ee.value=[...ee.value,{...ke,id:O}],be=!0}a("upload-progress",{uploadId:ke.uploadId??O,percent:ke.percent,done:ke.status==="done"})}}),!0}catch{return be&&(ee.value=ee.value.filter(ke=>ke.id!==O)),!1}}const Yi=re(0),Xi=re(!1);function ah(I){const O=I.dataTransfer;if(!O||O.types&&O.types.includes(Ti))return!1;if(O.items&&O.items.length>0){let be=!1;for(const ke of Array.from(O.items))if(ke.kind==="file"){be=!0;break}return be}return O.types?O.types.includes("Files"):!1}function fB(I){ah(I)&&(I.preventDefault(),Yi.value++,Xi.value=!0)}function dB(){Yi.value=Math.max(0,Yi.value-1),Yi.value===0&&(Xi.value=!1)}function pB(I){var O;if((O=I.dataTransfer)!=null&&O.types.includes(Ti)){I.preventDefault();return}ah(I)&&I.preventDefault()}function hB(I){var be,ke,Re;if((be=I.dataTransfer)!=null&&be.types.includes(Ti)){const Ce=I.dataTransfer.getData(Pf)||"",Et=Er(g.value);if(Ce&&Et&&Ce!==Et&&!J.value&&oe.value){I.preventDefault(),Yi.value=0,Xi.value=!1;try{const Ut=JSON.parse(I.dataTransfer.getData(Ti));Wl(Ut.map(Kt=>Kt.path),Et,Ce)}catch{}return}}if((ke=I.dataTransfer)!=null&&ke.types.includes(Ti)){Yi.value=0,Xi.value=!1;return}if(!ah(I)){Yi.value=0,Xi.value=!1;return}if(I.preventDefault(),Yi.value=0,Xi.value=!1,!oe.value){bt(o.value==="en"?"Read-only here":"Burada yazma yetkiniz yok");return}const O=(Re=I.dataTransfer)!=null&&Re.files?Array.from(I.dataTransfer.files):[];O.length!==0&&a5(O)}function i5(I){var O;(O=I.dataTransfer)!=null&&O.types.includes("Files")&&I.preventDefault()}function o5(I){const O=Ye.value,be=I.target;O&&be&&!O.contains(be)&&I.preventDefault()}Xt(()=>{window.addEventListener("dragover",i5),window.addEventListener("drop",o5)}),tr(()=>{window.removeEventListener("dragover",i5),window.removeEventListener("drop",o5),window.removeEventListener("hashchange",t5)});const yu=Fe(()=>X.value.mode!=="cut"?new Set:new Set(X.value.items.map(I=>I.path)));function ih(I,O){if(!O.dataTransfer)return;if(I.basename===".trash"){O.preventDefault();return}N.has(I.path)||N.click(I.path);const be=N.nodes.value.filter(ke=>!yu.value.has(ke.path)).filter(ke=>ke.basename!==".trash").map(ke=>({path:ke.path,basename:ke.basename,type:ke.type}));O.dataTransfer.setData(Ti,JSON.stringify(be)),O.dataTransfer.setData(Pf,Er(g.value)),O.dataTransfer.setData("text/plain",be.map(ke=>ke.path).join(`
|
|
24
|
-
`)),O.dataTransfer.effectAllowed="move"}async function vB(I,O,be,ke){try{const Re=ke??Er(g.value);if(i.endpoints.moveAsync){const{op:Ce}=await i.moveAsync(I,O,Re);X3(Ce.id,I,O,Re),h.register(Ce),bt("Taşıma kuyruğa alındı")}else{await i.move(Re,I,O),await Qt();const Ce=I.map(Et=>Vl(O,Y3(Et)));Qr(s("toast.moved"),async()=>{await i.move(O,Ce,Re)})}N.clear()}catch(Re){a("error",{message:Re.message,context:{op:be,targetDir:O}})}}async function oh(I,O){var Et;if(I.type!=="dir")return;const be=(Et=O.dataTransfer)==null?void 0:Et.getData(Ti);if(!be)return;let ke=[];try{ke=JSON.parse(be)}catch{return}if(ke.length===0)return;const Re=I.path,Ce=ke.map(Ut=>Ut.path).filter(Ut=>Ut&&Ut!==Re&&!Re.startsWith(Ut+"/")&&!Jp(vu(Ut),Re));Ce.length!==0&&await Wl(Ce,Re,w5(O))}async function mB(I,O){var Et;const be=(Et=O.dataTransfer)==null?void 0:Et.getData(Ti);if(!be)return;let ke=[];try{ke=JSON.parse(be)}catch{return}if(ke.length===0)return;const Re=I,Ce=ke.map(Ut=>Ut.path).filter(Ut=>Ut&&Ut!==Re&&!Re.startsWith(Ut+"/")&&!Jp(vu(Ut),Re));Ce.length!==0&&await Wl(Ce,Re,w5(O))}function gB(I){I.cancel()}function bB(I){ee.value=ee.value.filter(O=>O.id!==I.id)}function yB(I){if(cr.value&&!I){Qt("");return}if(cr.value){Qt(As(I));return}Qt(Eo(I))}async function s5(I){try{await navigator.clipboard.writeText(I),bt(s("breadcrumb.copy_path"))}catch{}}function Ao(I={}){return i.authHeadersSync({...I})}const _u=re(!1),{themeId:xu,setTheme:_B}=Lk(),$n=typeof window<"u"&&window.matchMedia?window.matchMedia("(prefers-color-scheme: dark)"):void 0,l5=re(!!($n!=null&&$n.matches));function c5(I){l5.value=I.matches}Xt(()=>{var I;return(I=$n==null?void 0:$n.addEventListener)==null?void 0:I.call($n,"change",c5)}),tr(()=>{var I;return(I=$n==null?void 0:$n.removeEventListener)==null?void 0:I.call($n,"change",c5)});const sh=Fe(()=>n.config.theme==="dark"||n.config.theme!=="light"&&l5.value);At([xu,sh,Ye],()=>{Nk(xu.value),Ye.value&&Bk(Ye.value,xu.value,sh.value)},{immediate:!0});const ql=re(!1),Zi=re(!1),bi=re(null);function xB(){if(Zi.value){Zi.value=!1;return}const I=N.nodes.value,O=I.length===1?I[0]:null;if(!(!O||O.type!=="file"||O.basename===".trash")){if(ea.value){if(!ja.value)return;(async()=>{try{await gh(O)}catch{bt(s("e2e.decrypt_failed"));return}bi.value=O,Zi.value=!0,Z(O)})();return}bi.value=O,Zi.value=!0,Z(O)}}function wB(I){const O=E.value.filter(Ce=>Ce.type==="file");if(O.length===0)return;const be=bi.value;let ke=be?O.findIndex(Ce=>Ce.path===be.path):-1;ke=ke===-1?I>0?0:O.length-1:(ke+I+O.length)%O.length;const Re=O[ke];!Re||Re.path===(be==null?void 0:be.path)||N.click(Re.path)}function kB(){const I=bi.value;Zi.value=!1,I&&Ha(I)}At(()=>N.nodes.value,I=>{var be,ke;if(!Zi.value)return;const O=I.length===1&&I[0].type==="file"?I[0]:null;if(O&&O.path!==((be=bi.value)==null?void 0:be.path)&&ja.value){(async()=>{try{await gh(O)}catch{}bi.value=O,Z(O)})();return}O&&O.path!==((ke=bi.value)==null?void 0:ke.path)&&(bi.value=O,Z(O))});const lh=GC();function SB(I){ee.value=ee.value.filter(Ce=>Ce.id!==I.id);const O=I.file,be=I.path||Er(g.value),ke=crypto.randomUUID();ee.value=[...ee.value,{id:ke,file:O,path:be,totalBytes:O.size,uploadedBytes:0,percent:0,status:"uploading",cancel(){}}];const Re=Ce=>{const Et=ee.value.findIndex(Kt=>Kt.id===ke);if(Et===-1)return;const Ut=[...ee.value];Ut[Et]={...Ut[Et],...Ce},ee.value=Ut};i.uploadMultipart(be,[O],Ce=>{Re({percent:Ce,uploadedBytes:Math.round(Ce/100*O.size)}),a("upload-progress",{uploadId:ke,percent:Ce,done:Ce>=100})}).then(()=>{Re({percent:100,uploadedBytes:O.size,status:"done"}),a("upload-progress",{uploadId:ke,percent:100,done:!0}),Qt()}).catch(Ce=>{Re({status:"error",error:Ce.message}),a("error",{message:Ce.message,context:{op:"upload-retry",file:O.name}})})}const wu=re(!1);let ch;function CB(){try{return localStorage.getItem(xm)==="1"}catch{return!0}}function uh(){wu.value=!0}function EB(){var I;wu.value=!1;try{localStorage.setItem(xm,"1")}catch{}(I=Ye.value)==null||I.focus()}function u5(){uh()}Xt(()=>{var I;(I=Ye.value)==null||I.addEventListener("fe:tour-restart",u5),CB()||(ch=setTimeout(()=>{wu.value||uh()},900))}),tr(()=>{var I;ch&&clearTimeout(ch),(I=Ye.value)==null||I.removeEventListener("fe:tour-restart",u5)});function AB(){return mu()==="none"?null:v?`${wm}:${v}`:wm}const Dr=DE({storageKey:AB()}),TB=Dr.restore(),fh=Dr.activeId,MB=Fe(()=>Dr.hasMultiple.value),yi=Fe(()=>{var I;return((I=Dr.activeTab.value)==null?void 0:I.split)??null});function DB(I){const O=(I||"").replace(/^\/+|\/+$/g,"");return O===".trash"?s("node.trash"):O?O.split("/").pop()||O:cr.value?s("breadcrumb.root"):S.value||s("breadcrumb.root")}const zB=Fe(()=>Dr.tabs.value.map(I=>({id:I.id,label:DB(I.path),split:!!I.split})));At(g,I=>Dr.syncActive({path:I})),At(F,I=>Dr.syncActive({viewMode:I})),Xt(()=>{TB||Dr.seed(g.value??"",F.value)});function ku(I){if(I.viewMode&&I.viewMode!==F.value&&(F.value=I.viewMode),I.path===".trash"){Gl();return}Qt(I.path)}function IB(I){const O=Dr.activate(I);O&&ku(O)}function dh(){Dr.openTab(g.value??"",{viewMode:F.value,background:!1})}function f5(I){const O=Dr.closeTab(I);O&&ku(O)}function OB(){const I=Dr.step(1);I&&ku(I)}function PB(){const I=Dr.step(-1);I&&ku(I)}function d5(I){if(I.type!=="dir"||I.basename===".trash")return;const O=cr.value?As(I.path):Eo(I.path);Dr.openTab(O,{viewMode:F.value,background:!0})}function p5(I){if(I.button!==1)return;const O=I.target,be=O&&typeof O.closest=="function"?O.closest("[data-fe-path]"):null,ke=be==null?void 0:be.getAttribute("data-fe-path");if(!ke)return;const Re=E.value.find(Ce=>Ce.path===ke);!Re||Re.type!=="dir"||Re.basename===".trash"||(I.preventDefault(),d5(Re))}function h5(I){if(I.button!==1)return;const O=I.target;O&&typeof O.closest=="function"&&O.closest("[data-fe-path]")&&I.preventDefault()}Xt(()=>{var I,O;(I=Ye.value)==null||I.addEventListener("auxclick",p5),(O=Ye.value)==null||O.addEventListener("mousedown",h5)}),tr(()=>{var I,O;(I=Ye.value)==null||I.removeEventListener("auxclick",p5),(O=Ye.value)==null||O.removeEventListener("mousedown",h5)});const zr=re(null),Kl=Fe(()=>!!yi.value&&!wr.value);function v5(){if(yi.value){Dr.setSplit(null),_i.value="main";return}wr.value||Dr.setSplit({path:g.value??"",viewMode:F.value})}function FB(){Dr.setSplit(null),_i.value="main"}function RB(I){Dr.setSplit({...yi.value??{},path:I})}function LB(){_i.value="main",Gl()}const m5=Fe(()=>{var I;return((I=yi.value)==null?void 0:I.viewMode)??F.value});function BB(I){yi.value&&Dr.setSplit({...yi.value,viewMode:I})}const ph=Fe(()=>Qn.value?m5.value:F.value);function g5(I){Qn.value?BB(I):F.value=I}const _i=re("main");function $B(){_i.value="main"}At(Kl,I=>{I||(_i.value="main")});const Qn=Fe(()=>_i.value==="split"&&Kl.value),NB=Fe(()=>Kl.value&&_i.value==="main");function UB(I){return cr.value?As(I):Eo(I)}function HB(I){const O=String(I??"").replace(/^\/+|\/+$/g,"");return m&&(!O||!(O===m||O.startsWith(m+"/")))?m:O}function b5(){var O,be;const I=((O=zr.value)==null?void 0:O.selectedNodes())??[];I.length!==0&&(X.value={mode:"cut",items:I,sourcePath:((be=zr.value)==null?void 0:be.getPath())??""},bt("Kesildi"))}function y5(){var O,be;const I=((O=zr.value)==null?void 0:O.selectedNodes())??[];I.length!==0&&(X.value={mode:"copy",items:I,sourcePath:((be=zr.value)==null?void 0:be.getPath())??""},bt("Kopyalandı"))}async function _5(){const I=X.value,O=zr.value;if(!I.mode||I.items.length===0||!O)return;const be=Er(O.getPath()??""),ke=Er(I.sourcePath||"")||void 0;if(I.mode==="cut"&&ke===be){bt("Aynı klasöre kesilemez");return}await Wl(I.items.map(Re=>Re.path),be,ke,I.mode==="copy"),X.value={mode:null,items:[],sourcePath:null}}function x5(I){const O=I.indexOf("://");return O===-1?"":I.slice(0,O)}function w5(I){var be;return((be=I.dataTransfer)==null?void 0:be.getData(Pf))||void 0}async function Wl(I,O,be,ke=!1){var Ut;const Re=I.filter(Kt=>Kt&&Kt!==O&&!O.startsWith(Kt+"/")&&!Jp(vu(Kt),O));if(Re.length===0||!O)return;const Ce=x5(O),Et=Re.some(Kt=>x5(Kt)!==Ce);if(Et||ke)try{const{op:Kt}=await i.copy(Re,O);h.register(Kt),bt(s(Et?"split.cross_copy":"split.copy_queued"))}catch(Kt){a("error",{message:Kt.message,context:{op:"transfer",targetWire:O}}),bt(Et?s("split.cross_failed"):Kt.message);return}else await vB(Re,O,"move-transfer",be);(Ut=zr.value)==null||Ut.reload()}function jB(I){Wl(I.sources,I.targetWire,I.originWire)}const Ms=gE(),Yl=re(0),Nn=re(""),Xl=new Map,ea=Fe(()=>!!Nn.value&&!J.value),ja=Fe(()=>(Yl.value,ea.value&&Ms.has(Nn.value))),hh=Fe(()=>(Yl.value,ea.value&&!Ms.has(Nn.value))),Ds=re(""),zs=re(!1),Is=re(""),Su=re(!1),vh=re(!1);function mh(){return Ms.get(Nn.value)??null}function k5(){for(const I of Xl.values())URL.revokeObjectURL(I);Xl.clear()}tr(k5);async function GB(){if(!(!Ds.value||zs.value||!Nn.value)){zs.value=!0,Is.value="";try{let I="";try{const{blob:ke,url:Re}=await i.fetchBlob(Vl(Nn.value,L0));URL.revokeObjectURL(Re),I=await ke.text()}catch{Is.value=s("e2e.unlock.marker_missing");return}const O=hE(I);if(!O){Is.value=s("e2e.unlock.marker_missing");return}const be=await vE(O,Ds.value);if(!be){Is.value=s("e2e.unlock.wrong");return}Ms.set(Nn.value,be),Yl.value++,Ds.value=""}finally{zs.value=!1}}}function VB(){Nn.value&&(Ms.lock(Nn.value),Yl.value++,k5(),bt(s("e2e.locked_toast")))}const qB={txt:"text/plain",md:"text/markdown",log:"text/plain",csv:"text/csv",json:"application/json",xml:"application/xml",html:"text/html",jpg:"image/jpeg",jpeg:"image/jpeg",png:"image/png",gif:"image/gif",webp:"image/webp",bmp:"image/bmp",avif:"image/avif",svg:"image/svg+xml",pdf:"application/pdf",mp4:"video/mp4",webm:"video/webm",mov:"video/quicktime",m4v:"video/mp4",mp3:"audio/mpeg",wav:"audio/wav",ogg:"audio/ogg",flac:"audio/flac",m4a:"audio/mp4",aac:"audio/aac",opus:"audio/opus"};function S5(I){const O=(I.extension||"").toLowerCase();return qB[O]||"application/octet-stream"}async function gh(I){const O=Xl.get(I.path);if(O)return O;const be=mh();if(!be)return null;const ke=await i.fetchArrayBuffer(I.path);if(!Df(ke))return null;const Re=await pm(be,ke),Ce=URL.createObjectURL(new Blob([Re],{type:S5(I)}));return Xl.set(I.path,Ce),Ce}function Cu(I){return Xl.get(I)??i.previewUrl(I)}async function bh(I){try{await gh(I)}catch{bt(s("e2e.decrypt_failed"));return}L.value="view",$e.value=I,We.value=!0,a("file-opened",{path:I.path,basename:I.basename}),Z(I)}async function KB(I){try{const O=await i.fetchArrayBuffer(I.path),be=mh();let ke=O;if(Df(O)){if(!be)throw new Error("locked");ke=await pm(be,O)}const Re=URL.createObjectURL(new Blob([ke],{type:S5(I)})),Ce=document.createElement("a");Ce.href=Re,Ce.download=I.basename,document.body.appendChild(Ce),Ce.click(),Ce.remove(),setTimeout(()=>URL.revokeObjectURL(Re),3e4)}catch{bt(s("e2e.download.failed"))}}async function WB(I){const O=mh();if(!O)return[];const be=[];for(const ke of I)if(ke.name!==L0){if(ke.size>sm){bt(s("e2e.upload.too_big"));continue}try{const Re=await mE(O,await ke.arrayBuffer());be.push(new File([Re],ke.name,{type:"application/octet-stream"}))}catch(Re){a("error",{message:Re.message,context:{op:"e2e-encrypt",file:ke.name}})}}return be}async function YB(I){if(ea.value){bt(s("e2e.create.nested"));return}vh.value=!0;try{const O=Er(g.value);await i.newFolder(O,I.name);const{marker:be,kek:ke}=await pE(I.password),Re=new File([JSON.stringify(be)],L0,{type:"application/json"}),Ce=Vl(O,I.name);await i.uploadMultipart(Ce,[Re]),Ms.set(Ce,ke),Yl.value++,Su.value=!1,bt(s("e2e.create.done")),await Qt()}catch(O){a("error",{message:O.message,context:{op:"e2e-create"}}),bt(s("e2e.create.failed"))}finally{vh.value=!1}}return(I,O)=>{var be,ke,Re;return R(),$("div",{ref_key:"rootEl",ref:Ye,class:vt(["fe",{"fe--theme-light":e.config.theme==="light","fe--theme-dark":e.config.theme==="dark","fe--is-dragover":Xi.value,"fe--density-compact":K.value==="compact","fe--narrow":wr.value}]),tabindex:"-1",onDragenter:fB,onDragover:pB,onDragleave:dB,onDrop:hB,onContextmenu:GL},[MB.value?(R(),Zt(sE,{key:0,tabs:zB.value,"active-id":Y(fh),locale:o.value,"split-enabled":!wr.value,"split-active":!!yi.value,onSelect:IB,onClose:f5,onNew:dh,onReorder:O[0]||(O[0]=(Ce,Et)=>Y(Dr).move(Ce,Et)),onToggleSplit:v5},null,8,["tabs","active-id","locale","split-enabled","split-active"])):Te("",!0),Dt(G8,{ref_key:"toolbarRef",ref:It,"view-mode":ph.value,"search-query":te.value,"trash-active":le.value,actions:WL.value,"selection-mode":HL.value,"paste-enabled":!!X.value.mode,"convert-enabled":!!xe.value,"can-go-up":q.value,"at-virtual-root":j.value,"can-write":oe.value,locale:o.value,narrow:wr.value,theme:e.config.theme||"auto","inspector-open":Me.value,onToggleInspector:je,onOpenTheme:O[1]||(O[1]=Ce=>_u.value=!0),"onUpdate:viewMode":O[2]||(O[2]=Ce=>g5(Ce)),"onUpdate:searchQuery":O[3]||(O[3]=Ce=>te.value=Ce),"onUpdate:density":O[4]||(O[4]=Ce=>K.value=Ce),onOpenShortcutSettings:O[5]||(O[5]=Ce=>ql.value=!0),onNewFolder:O[6]||(O[6]=Ce=>ve.value=!0),onUpload:bu,onRefresh:O[7]||(O[7]=()=>Qt()),onGoUp:P,onAction:jL,onOpenRecents:O[8]||(O[8]=Ce=>ze.value=!0)},null,8,["view-mode","search-query","trash-active","actions","selection-mode","paste-enabled","convert-enabled","can-go-up","at-virtual-root","can-write","locale","narrow","theme","inspector-open","onToggleInspector"]),T("div",{class:vt(["fe__main",{"fe__main--split":Kl.value}])},[T("div",{class:vt(["fe__primary",{"fe-pane--focus":NB.value}])},[Dt(p7,{dirname:M.value,adapter:S.value,"root-label":S.value,locale:o.value,"multi-storage-root":cr.value,"root-path":Y(v),onNavigate:yB,onCopyPath:s5,onCrumbContext:VL,onCrumbDrop:mB},null,8,["dirname","adapter","root-label","locale","multi-storage-root","root-path"]),Y(c).length||Y(u)?(R(),$("div",lM,[Y(c).length?(R(),Zt(Zx,{key:0,users:Y(c),locale:o.value},null,8,["users","locale"])):Te("",!0),Y(u)?(R(),$("span",{key:1,class:"fe-connbadge",role:"status",title:Y(s)("conn.tooltip")},[O[50]||(O[50]=T("span",{class:"fe-connbadge__dot","aria-hidden":"true"},null,-1)),$t(" "+V(Y(s)("conn.offline")),1)],8,cM)):Te("",!0)])):Te("",!0),ja.value?(R(),$("div",uM,[O[51]||(O[51]=T("span",{class:"fe-e2e-strip__icon","aria-hidden":"true"},"🔒",-1)),T("span",fM,V(Y(s)("e2e.strip.label")),1),T("button",{type:"button",class:"fe-btn fe-e2e-strip__btn",onClick:VB},V(Y(s)("e2e.strip.lock")),1)])):Te("",!0),T("div",{class:"fe__body",onPointerdownCapture:O[13]||(O[13]=Ce=>$B()),onClick:O[14]||(O[14]=Ht(Ce=>Y(N).clear(),["self"]))},[b.value&&E.value.length===0?(R(),$("div",dM,[T("span",pM,V(Y(s)("loading")),1),F.value!=="list"?(R(),$("div",hM,[(R(),$(qe,null,xt(8,Ce=>T("div",{key:Ce,class:"fe-skel-card"},[...O[52]||(O[52]=[T("div",{class:"fe-skel fe-skel--thumb"},null,-1),T("div",{class:"fe-skel fe-skel--label"},null,-1)])])),64))])):(R(),$("div",vM,[(R(),$(qe,null,xt(8,Ce=>T("div",{key:Ce,class:"fe-skel-row"},[...O[53]||(O[53]=[T("div",{class:"fe-skel fe-skel--icon"},null,-1),T("div",{class:"fe-skel fe-skel--name"},null,-1),T("div",{class:"fe-skel fe-skel--size"},null,-1),T("div",{class:"fe-skel fe-skel--date"},null,-1)])])),64))]))])):x.value?(R(),$("div",mM,[O[54]||(O[54]=T("svg",{class:"fe-state__art",viewBox:"0 0 120 100",width:"110",height:"92",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[T("path",{d:"M18 36v42a6 6 0 0 0 6 6h72a6 6 0 0 0 6-6V44a6 6 0 0 0-6-6H62l-9-10H24a6 6 0 0 0-6 6z"}),T("path",{d:"M52 55c0-4.6 3.6-8 8-8s8 3.4 8 8c0 5.5-8 4.8-8 11"}),T("circle",{cx:"60",cy:"73",r:"1.6",fill:"currentColor",stroke:"none"})],-1)),T("p",gM,V(Y(s)("notFound.title")),1),T("p",bM,V(x.value),1),T("p",yM,V(Y(s)("notFound.desc")),1),T("div",_M,[T("button",{type:"button",class:"fe-btn",onClick:zL},V(Y(s)("notFound.goRoot")),1)])])):C.value&&E.value.length===0?(R(),$("div",xM,[O[55]||(O[55]=sf('<svg class="fe-state__art" viewBox="0 0 120 100" width="110" height="92" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><circle cx="60" cy="50" r="28"></circle><path d="M60 36v18"></path><circle cx="60" cy="63" r="1.8" fill="currentColor" stroke="none"></circle><path d="M24 88h72" stroke-dasharray="3 5"></path></svg>',1)),T("p",wM,V(Y(s)("error.title")),1),T("p",kM,V(Y(s)("error.hint")),1),T("div",SM,[T("button",{type:"button",class:"fe-btn fe-btn--primary",onClick:B},V(Y(s)("error.retry")),1)]),T("details",CM,[T("summary",EM,V(Y(s)("error.details")),1),T("pre",AM,V(C.value),1)])])):hh.value?(R(),$("div",TM,[O[56]||(O[56]=sf('<svg class="fe-state__art" viewBox="0 0 120 100" width="110" height="92" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect x="38" y="44" width="44" height="34" rx="6"></rect><path d="M46 44v-8a14 14 0 0 1 28 0v8"></path><circle cx="60" cy="59" r="3" fill="currentColor" stroke="none"></circle><path d="M60 62v7"></path></svg>',1)),T("p",MM,V(Y(s)("e2e.locked.title")),1),T("p",DM,V(Y(s)("e2e.locked.hint")),1),T("form",{class:"fe-e2e-lock__form",onSubmit:Ht(GB,["prevent"])},[Yt(T("input",{"onUpdate:modelValue":O[9]||(O[9]=Ce=>Ds.value=Ce),type:"password",class:"fe-input fe-e2e-lock__input",placeholder:Y(s)("e2e.locked.pw_placeholder"),autocomplete:"current-password",disabled:zs.value},null,8,zM),[[Ir,Ds.value]]),T("button",{type:"submit",class:"fe-btn fe-btn--primary",disabled:zs.value||!Ds.value},V(zs.value?Y(s)("e2e.locked.busy"):Y(s)("e2e.locked.unlock")),9,IM)],32),Is.value?(R(),$("p",OM,V(Is.value),1)):Te("",!0)])):!b.value&&E.value.length===0&&te.value?(R(),$("div",PM,[O[57]||(O[57]=T("svg",{class:"fe-state__art",viewBox:"0 0 120 100",width:"110",height:"92",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[T("circle",{cx:"52",cy:"44",r:"22"}),T("path",{d:"M68 61l20 20"}),T("path",{d:"M46 38l12 12M58 38l-12 12"})],-1)),T("p",FM,V(Y(s)("empty.search.title")),1),T("p",RM,V(Y(s)("empty.search.hint")),1)])):!b.value&&E.value.length===0&&J.value?(R(),$("div",LM,[O[58]||(O[58]=sf('<svg class="fe-state__art" viewBox="0 0 120 100" width="110" height="92" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M38 34l4 48a6 6 0 0 0 6 5.6h24a6 6 0 0 0 6-5.6l4-48"></path><path d="M32 34h56"></path><path d="M50 34v-6a6 6 0 0 1 6-6h8a6 6 0 0 1 6 6v6"></path><path d="M52 44v32M60 44v32M68 44v32" opacity="0.5"></path></svg>',1)),T("p",BM,V(Y(s)("empty.trash.title")),1)])):!b.value&&E.value.length===0?(R(),$("div",$M,[(R(),$("svg",NM,[O[60]||(O[60]=T("path",{d:"M18 36v42a6 6 0 0 0 6 6h72a6 6 0 0 0 6-6V44a6 6 0 0 0-6-6H62l-9-10H24a6 6 0 0 0-6 6z"},null,-1)),tt.value?(R(),$("g",UM,[...O[59]||(O[59]=[T("path",{d:"M60 50v14","stroke-dasharray":"3 4"},null,-1),T("path",{d:"M53 59l7 8 7-8"},null,-1)])])):Te("",!0)])),T("p",HM,V(Y(s)("empty.folder")),1),tt.value?(R(),$("p",jM,V(Y(s)("empty.hint")),1)):Te("",!0),tt.value?(R(),$("div",GM,[T("button",{type:"button",class:"fe-btn fe-btn--primary",onClick:bu},V(Y(s)("empty.upload")),1)])):Te("",!0)])):F.value==="list"?(R(),Zt(Yv,{key:7,files:E.value,selected:Y(N).selected.value,clipped:yu.value,"show-parent-path":!!te.value,locale:o.value,loading:b.value,"starred-ids":Ae.value,"api-base":n.config.apiBase??"","auth-headers":()=>Ao(),onClickRow:O[10]||(O[10]=(Ce,Et)=>Y(N).click(Ce.path,Et)),onDblRow:Ha,onContextRow:th,onItemDragStart:ih,onItemDropInto:oh,onStarChange:Be},null,8,["files","selected","clipped","show-parent-path","locale","loading","starred-ids","api-base","auth-headers"])):F.value==="grid"?(R(),Zt(Xv,{key:8,files:E.value,selected:Y(N).selected.value,clipped:yu.value,"show-parent-path":!!te.value,locale:o.value,loading:b.value,"thumb-src":Y(f).src,onClickCard:O[11]||(O[11]=(Ce,Et)=>Y(N).click(Ce.path,Et)),onDblCard:Ha,onContextCard:th,onItemDragStart:ih,onItemDropInto:oh},null,8,["files","selected","clipped","show-parent-path","locale","loading","thumb-src"])):(R(),Zt(Zv,{key:9,files:E.value,selected:Y(N).selected.value,clipped:yu.value,"show-parent-path":!!te.value,locale:o.value,loading:b.value,"thumb-src":Y(f).src,onClickCard:O[12]||(O[12]=(Ce,Et)=>Y(N).click(Ce.path,Et)),onDblCard:Ha,onContextCard:th,onItemDragStart:ih,onItemDropInto:oh},null,8,["files","selected","clipped","show-parent-path","locale","loading","thumb-src"]))],32)],2),Kl.value&&yi.value?(R(),Zt(ME,{ref_key:"splitPaneRef",ref:zr,key:"split-"+Y(fh),api:Y(i),"initial-path":yi.value.path,locale:o.value,qualify:Er,"to-user":UB,clamp:HB,"root-label":cr.value?"/":S.value||Y(s)("breadcrumb.root"),floor:Y(m),"multi-root":cr.value,"virtual-rows":W3,active:Qn.value,"view-mode":m5.value,"thumb-src":Y(f).src,"trash-visible":e.config.trashVisible!==!1,onNavigate:RB,onActivate:O[15]||(O[15]=Ce=>_i.value="split"),onClose:FB,onOpenTab:O[16]||(O[16]=Ce=>Y(Dr).openTab(Ce,{viewMode:F.value,background:!0})),onTransfer:jB,onContext:qL,onOpenTrash:LB},null,8,["api","initial-path","locale","root-label","floor","multi-root","active","view-mode","thumb-src","trash-visible","onContext","onOpenTrash"])):Te("",!0),Me.value?(R(),Zt(L9,{key:1,api:Y(i),nodes:Y(N).nodes.value,"dir-label":ie.value,"dir-count":E.value.length,"dir-perm":w.value,locale:o.value,narrow:wr.value,"thumb-src":Y(f).src,onClose:A,onManagePermissions:ae,onToast:bt,onChanged:O[17]||(O[17]=()=>Qt())},null,8,["api","nodes","dir-label","dir-count","dir-perm","locale","narrow","thumb-src"])):Te("",!0)],2),Xi.value?(R(),$("div",VM,[...O[61]||(O[61]=[T("div",{class:"fe__dragover-card"},[T("span",{class:"fe-icon"},"⬆"),T("p",null,"Dosyaları buraya bırak")],-1)])])):Te("",!0),Dt(bw,{jobs:ee.value,locale:o.value,center:Y(lh),onCancel:gB,onDismiss:bB,onRetry:SB},null,8,["jobs","locale","center"]),Dt(yw,{ops:Y(h).ops.value,locale:o.value,center:Y(lh),onDismiss:O[18]||(O[18]=Ce=>Y(h).dismiss(Ce))},null,8,["ops","locale","center"]),Dt(UC,{center:Y(lh),locale:o.value,narrow:wr.value},null,8,["center","locale","narrow"]),wr.value&&tt.value?(R(),$("button",{key:2,type:"button",class:"fe-fab",title:Y(s)("toolbar.upload"),"aria-label":Y(s)("toolbar.upload"),onClick:bu},[...O[62]||(O[62]=[T("svg",{class:"fe-ficon",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2.2","stroke-linecap":"round","aria-hidden":"true",focusable:"false"},[T("path",{d:"M12 5v14M5 12h14"})],-1)])],8,qM)):Te("",!0),Dt(xf,{ref_key:"ctxRef",ref:st,locale:o.value,theme:e.config.theme||"auto",sheet:hr.value,actions:KL.value,onSelect:YL},null,8,["locale","theme","sheet","actions"]),Dt(jE,{open:ve.value,locale:o.value,"encrypted-option":!ea.value,onClose:O[19]||(O[19]=Ce=>ve.value=!1),onSubmit:eB,onEncrypted:O[20]||(O[20]=Ce=>{ve.value=!1,Su.value=!0})},null,8,["open","locale","encrypted-option"]),Dt(NE,{open:Su.value,locale:o.value,busy:vh.value,onClose:O[21]||(O[21]=Ce=>Su.value=!1),onSubmit:YB},null,8,["open","locale","busy"]),Dt(VE,{open:Pe.value,locale:o.value,"current-name":((be=rt.value)==null?void 0:be.basename)||"",onClose:O[22]||(O[22]=Ce=>Pe.value=!1),onSubmit:tB},null,8,["open","locale","current-name"]),Dt(qE,{open:Ge.value,locale:o.value,count:Y(N).size.value,onClose:O[23]||(O[23]=Ce=>Ge.value=!1),onConfirm:rB},null,8,["open","locale","count"]),Dt(oA,{open:Ue.value,locale:o.value,share:St.value,onClose:sB,onSubmit:oB,onToast:bt},null,8,["open","locale","share"]),Dt(am,{open:We.value,locale:o.value,file:$e.value,theme:e.config.theme||"auto","preview-url":Ce=>Cu(Ce),"download-url":Ce=>ja.value?Cu(Ce):Y(i).downloadUrl(Ce),"only-office-base":ea.value?null:Se.value,"only-office-config-endpoint":me.value,"new-tab-enabled":!ea.value,"save-text-endpoint":ea.value?null:Y(i).endpoints.saveText||null,"open-mode":L.value,"auth-headers":()=>Ao({"Content-Type":"application/json"}),"auth-credentials":Y(i).credentialsMode(),"drawio-url":ye.value,"pdf-worker-url":n.config.pdfWorkerUrl||null,"pdf-save-url":n.config.pdfSaveUrl||null,"viewer-base-url":n.config.viewerBaseUrl||null,onClose:O[24]||(O[24]=Ce=>We.value=!1)},null,8,["open","locale","file","theme","preview-url","download-url","only-office-base","only-office-config-endpoint","new-tab-enabled","save-text-endpoint","open-mode","auth-headers","auth-credentials","drawio-url","pdf-worker-url","pdf-save-url","viewer-base-url"]),ge.value&&Oe.value&&xe.value?(R(),Zt(_A,{key:3,"convert-url":xe.value,"file-name":((ke=Oe.value)==null?void 0:ke.basename)||((Re=Oe.value)==null?void 0:Re.path)||"","fetch-bytes":()=>{var Ce;return Y(i).fetchArrayBuffer(((Ce=Oe.value)==null?void 0:Ce.path)??"")},upload:Ce=>Y(i).uploadMultipart(Er(g.value),[Ce]).then(()=>{}),onClose:O[25]||(O[25]=Ce=>ge.value=!1),onDone:iB},null,8,["convert-url","file-name","fetch-bytes","upload"])):Te("",!0),He.value&&de.value?(R(),Zt(sM,{key:4,api:Y(i),path:de.value.path,"is-dir":de.value.type==="dir",size:typeof de.value.size=="number"?de.value.size:void 0,locale:o.value==="en"?"en":"tr",onClose:O[26]||(O[26]=Ce=>He.value=!1)},null,8,["api","path","is-dir","size","locale"])):Te("",!0),Dt(Za,{name:"fe-modal"},{default:ur(()=>[ze.value?(R(),$("div",{key:0,class:vt(["fe fe-modal__backdrop fe-recents__backdrop",{"fe--theme-light":e.config.theme==="light","fe--theme-dark":e.config.theme==="dark"}]),onClick:O[30]||(O[30]=Ce=>ze.value=!1)},[T("div",{class:"fe-recents__panel",onClick:O[29]||(O[29]=Ht(()=>{},["stop"]))},[T("div",KM,[T("strong",null,V(o.value==="en"?"Recently opened":"Son açılanlar"),1),T("button",{class:"fe-recents__close","aria-label":"Close",onClick:O[27]||(O[27]=Ce=>ze.value=!1)},"×")]),Dt(t7,{"api-base":n.config.apiBase??"","auth-headers":()=>Ao(),limit:20,"refresh-key":Ie.value,onOpen:we,onError:O[28]||(O[28]=Ce=>a("error",{message:Ce,context:{op:"recents"}}))},null,8,["api-base","auth-headers","refresh-key"])])],2)):Te("",!0)]),_:1}),Dt(Za,{name:"fe-modal"},{default:ur(()=>[Le.value&&he.value&&typeof he.value.id=="number"?(R(),$("div",{key:0,class:"fe-modal__backdrop",onClick:O[34]||(O[34]=Ce=>Le.value=!1)},[T("div",{class:"fe-modal__card fe-modal__card--md",onClick:O[33]||(O[33]=Ht(()=>{},["stop"]))},[T("header",WM,[T("h2",YM,V(o.value==="en"?"Tags":"Etiketler")+" — "+V(he.value.basename),1),T("button",{class:"fe-modal__close","aria-label":"Close",onClick:O[31]||(O[31]=Ce=>Le.value=!1)},"×")]),T("div",XM,[Dt(q8,{"node-id":he.value.id,"api-base":n.config.apiBase??"","auth-headers":()=>Ao(),onError:O[32]||(O[32]=Ce=>a("error",{message:Ce,context:{op:"tags"}}))},null,8,["node-id","api-base","auth-headers"])])])])):Te("",!0)]),_:1}),Dt(yk,{open:Qp.value,locale:o.value,files:E.value,"view-mode":F.value,"can-write":oe.value&&!j.value&&!le.value,"can-go-up":q.value,"global-search":PL,onClose:O[35]||(O[35]=Ce=>Qp.value=!1),onOpenHit:FL,onOpenNode:Ha,onNavigate:O[36]||(O[36]=Ce=>Qt(Ce)),onNewFolder:O[37]||(O[37]=Ce=>ve.value=!0),onUpload:bu,onToggleView:O[38]||(O[38]=Ce=>g5(ph.value==="list"?"grid":ph.value==="grid"?"gallery":"list")),onOpenTrash:Gl,onRefresh:O[39]||(O[39]=()=>Qt()),onGoUp:P,onOpenTheme:O[40]||(O[40]=Ce=>_u.value=!0),onOpenShortcutSettings:O[41]||(O[41]=Ce=>ql.value=!0),onStartTour:O[42]||(O[42]=Ce=>uh()),"split-enabled":!wr.value,onTabNew:O[43]||(O[43]=Ce=>dh()),onSplitToggle:O[44]||(O[44]=Ce=>v5())},null,8,["open","locale","files","view-mode","can-write","can-go-up","split-enabled"]),Dt(Ok,{open:gu.value,locale:o.value,onClose:O[45]||(O[45]=Ce=>gu.value=!1),onCustomize:O[46]||(O[46]=Ce=>{gu.value=!1,ql.value=!0})},null,8,["open","locale"]),Dt(Kk,{open:_u.value,locale:o.value,theme:e.config.theme||"auto",dark:sh.value,current:Y(xu),onClose:O[47]||(O[47]=Ce=>_u.value=!1),onSelect:Y(_B)},null,8,["open","locale","theme","dark","current","onSelect"]),T("input",{ref_key:"fileInputEl",ref:pe,type:"file",multiple:"",class:"fe__file-input",onChange:lB},null,544),Dt(Za,{name:"fe-toast"},{default:ur(()=>[gr.value?(R(),$("div",{key:0,class:vt(["fe-toast",{"fe-toast--action":!!gr.value.actionLabel}]),role:"status",onClick:Mr},[T("span",ZM,V(gr.value.message),1),gr.value.actionLabel&&gr.value.action?(R(),$("button",{key:0,type:"button",class:"fe-toast__action",onClick:Ht(va,["stop"])},V(gr.value.actionLabel),1)):Te("",!0)],2)):Te("",!0)]),_:1}),Dt(vS,{open:ql.value,locale:o.value,theme:e.config.theme||"auto",onClose:O[48]||(O[48]=Ce=>ql.value=!1)},null,8,["open","locale","theme"]),Dt(sC,{open:Zi.value,locale:o.value,file:bi.value,theme:e.config.theme||"auto","preview-url":Ce=>Cu(Ce),"download-url":Ce=>ja.value?Cu(Ce):Y(i).downloadUrl(Ce),"only-office-base":ea.value?null:Se.value,"only-office-config-endpoint":me.value,"auth-headers":()=>Ao({"Content-Type":"application/json"}),"auth-credentials":Y(i).credentialsMode(),"drawio-url":ye.value,"pdf-worker-url":n.config.pdfWorkerUrl||null,"viewer-base-url":n.config.viewerBaseUrl||null,onClose:O[49]||(O[49]=Ce=>Zi.value=!1),onNav:wB,onOpenFull:kB},null,8,["open","locale","file","theme","preview-url","download-url","only-office-base","only-office-config-endpoint","auth-headers","auth-credentials","drawio-url","pdf-worker-url","viewer-base-url"]),Dt(JC,{open:wu.value,locale:o.value,root:Ye.value,theme:e.config.theme||"auto",onClose:EB},null,8,["open","locale","root","theme"])],34)}}}),QM='.fx-presence[data-v-f9ddf216]{display:inline-flex;align-items:center;gap:.5rem;max-width:100%}.fx-presence-avatars[data-v-f9ddf216]{display:inline-flex;align-items:center}.fx-presence-avatar[data-v-f9ddf216]{position:relative;display:inline-flex;align-items:center;justify-content:center;width:1.5rem;height:1.5rem;margin-left:-.4rem;border-radius:9999px;border:2px solid var(--fx-presence-ring, #ffffff);color:#fff;font-size:.6rem;font-weight:600;line-height:1;-webkit-user-select:none;user-select:none}.fx-presence-avatar[data-v-f9ddf216]:first-child{margin-left:0}.fx-presence-dot[data-v-f9ddf216]{position:absolute;right:-1px;bottom:-1px;width:.5rem;height:.5rem;border-radius:9999px;background:#22c55e;border:1.5px solid var(--fx-presence-ring, #ffffff)}.fx-presence-more[data-v-f9ddf216]{margin-left:.15rem;font-size:.7rem;color:#71717a}.fx-presence--wide[data-v-f9ddf216]{flex:1 1 auto;min-width:0}.fx-presence-chips[data-v-f9ddf216]{display:flex;align-items:center;gap:.4rem;overflow-x:auto;min-width:0;padding-bottom:2px;scrollbar-width:thin}.fx-presence-chip[data-v-f9ddf216]{display:inline-flex;align-items:center;gap:.35rem;flex:0 0 auto;padding:.15rem .5rem .15rem .2rem;border-radius:9999px;background:#f4f4f5;font-size:.75rem;color:#3f3f46;white-space:nowrap}.fx-presence-chip .fx-presence-avatar[data-v-f9ddf216]{margin-left:0}.fx-presence-chip-name[data-v-f9ddf216]{font-weight:500}.fx-presence-chip-file[data-v-f9ddf216]{color:#71717a;max-width:12rem;overflow:hidden;text-overflow:ellipsis}.fx-presence-toggle[data-v-f9ddf216]{flex:0 0 auto;display:inline-flex;align-items:center;justify-content:center;width:1.25rem;height:1.25rem;border:none;border-radius:9999px;background:transparent;color:#71717a;font-size:.9rem;line-height:1;cursor:pointer}.fx-presence-toggle[data-v-f9ddf216]:hover{background:#e4e4e7;color:#3f3f46}.dark{background:#27272a;color:#d4d4d8}.fx-presence-text[data-v-f9ddf216]{font-size:.75rem;color:#71717a;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:14rem}.fx-presence-file[data-v-f9ddf216]{color:#52525b;font-weight:500}.dark{--fx-presence-ring: #18181b}.filex-tag-picker[data-v-7040583c]{display:flex;flex-wrap:wrap;gap:6px;align-items:center}.filex-tag-picker.is-loading[data-v-7040583c]{opacity:.6;pointer-events:none}.filex-tag[data-v-7040583c]{display:inline-flex;align-items:center;gap:4px;border-radius:999px;padding:2px 10px;font-size:12px;font-weight:500;color:#fff;background:var(--filex-tag-color)}.filex-tag-x[data-v-7040583c]{background:transparent;border:none;color:#ffffffd9;cursor:pointer;padding:0 2px;font-size:14px;line-height:1}.filex-tag-x[data-v-7040583c]:hover{color:#fff}.filex-tag-add input[data-v-7040583c]{border:1px solid var(--filex-border, #d1d5db);border-radius:12px;padding:2px 10px;font-size:12px;width:110px}.filex-tag-add-btn[data-v-7040583c]{border:1px dashed var(--filex-border, #d1d5db);background:transparent;border-radius:999px;padding:2px 10px;font-size:12px;color:var(--filex-text-muted, #6b7280);cursor:pointer}.filex-tag-add-btn[data-v-7040583c]:hover{border-color:var(--filex-accent, #6366f1);color:var(--filex-accent, #6366f1)}.filex-recent[data-v-559f2c71]{background:var(--fe-bg-elev, var(--filex-bg-card, #ffffff));border:1px solid var(--fe-border, var(--filex-border, #e5e7eb));border-radius:8px;padding:12px;font-size:13px}.filex-recent header[data-v-559f2c71]{display:flex;justify-content:space-between;align-items:center;margin-bottom:8px}.filex-recent h3[data-v-559f2c71]{margin:0;font-size:13px;font-weight:600;color:var(--fe-text, var(--filex-text, #111827))}.filex-recent-refresh[data-v-559f2c71]{background:transparent;border:none;color:var(--fe-text-muted, var(--filex-text-muted, #9ca3af));cursor:pointer;font-size:14px;padding:2px 6px}.filex-recent ul[data-v-559f2c71]{list-style:none;margin:0;padding:0}.filex-recent-item[data-v-559f2c71]{display:flex;justify-content:space-between;align-items:center;width:100%;background:transparent;border:none;padding:6px 8px;cursor:pointer;border-radius:4px;text-align:left}.filex-recent-item[data-v-559f2c71]:hover{background:var(--fe-bg-hover, var(--filex-bg-soft, #f3f4f6))}.filex-recent-name[data-v-559f2c71]{color:var(--fe-text, var(--filex-text, #111827));overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.filex-recent-meta[data-v-559f2c71]{color:var(--fe-text-muted, var(--filex-text-muted, #9ca3af));font-size:11px;margin-left:8px;flex-shrink:0}.filex-recent-empty[data-v-559f2c71]{color:var(--fe-text-muted, var(--filex-text-muted, #9ca3af));margin:4px 0 0}.filex-star-btn[data-v-12a2f9c5]{display:inline-flex;align-items:center;gap:6px;background:transparent;border:1px solid transparent;border-radius:6px;padding:4px 8px;color:var(--filex-text-muted, #9ca3af);cursor:pointer;transition:color .12s,background .12s}.filex-star-btn[data-v-12a2f9c5]:hover{color:var(--filex-accent-amber, #f59e0b);background:var(--filex-bg-soft, rgba(0, 0, 0, .04))}.filex-star-btn.is-starred[data-v-12a2f9c5]{color:var(--filex-accent-amber, #f59e0b)}.filex-star-btn.is-compact[data-v-12a2f9c5]{padding:4px}.filex-star-label[data-v-12a2f9c5]{font-size:13px}.fe-themes__hint{margin:0 0 12px;font-size:12.5px;color:var(--fe-text-muted)}.fe-themes{display:grid;grid-template-columns:repeat(auto-fill,minmax(150px,1fr));gap:12px}.fe-themecard{display:flex;flex-direction:column;padding:0;border:2px solid var(--fe-border-strong);border-radius:var(--fe-radius, 8px);background:var(--fe-bg);cursor:pointer;overflow:hidden;text-align:left;transition:transform .12s ease,box-shadow .12s ease;font:inherit}.fe-themecard:hover{transform:translateY(-2px);box-shadow:var(--fe-shadow-sm, 0 2px 6px rgba(15, 23, 42, .08))}.fe-themecard:focus-visible{outline:2px solid var(--fe-primary);outline-offset:2px}.fe-themecard.is-selected{border-color:var(--fe-primary);box-shadow:0 0 0 2px var(--fe-primary)}.fe-themecard__preview{display:flex;flex-direction:column;gap:6px;padding:10px;background:var(--fe-bg);border-bottom:1px solid var(--fe-border);min-height:84px}.fe-themecard__topbar{display:flex;gap:4px;margin-bottom:2px}.fe-themecard__chip{height:8px;width:22px;border-radius:4px;background:var(--fe-bg-hover);border:1px solid var(--fe-border)}.fe-themecard__chip--primary{background:var(--fe-primary);border-color:var(--fe-primary)}.fe-themecard__chip--ghost{background:var(--fe-bg-elev)}.fe-themecard__row{display:flex;align-items:center;gap:6px;padding:3px 4px;border-radius:4px}.fe-themecard__row--selected{background:var(--fe-bg-selected)}.fe-themecard__dot{width:8px;height:8px;border-radius:50%;background:var(--fe-text);opacity:.75;flex:none}.fe-themecard__dot--primary{background:var(--fe-primary);opacity:1}.fe-themecard__dot--muted{background:var(--fe-text-muted)}.fe-themecard__line{height:6px;border-radius:3px;background:var(--fe-text);opacity:.55}.fe-themecard__line--muted{background:var(--fe-text-muted)}.fe-themecard__name{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:8px 10px;font-size:12.5px;font-weight:600;color:var(--fe-text);background:var(--fe-bg-elev);font-family:var(--fe-font, inherit)}.fe-themecard__check{flex:none;width:18px;height:18px;display:inline-flex;align-items:center;justify-content:center;border-radius:50%;background:var(--fe-primary);color:var(--fe-text-on-primary);font-size:11px;line-height:1}.fe-preview__code-editor.is-hidden{display:none}.fe-preview__viewer{width:100%;height:100%;min-height:70vh;display:flex;flex-direction:column}.fe-preview .fe-preview__viewer{align-self:stretch}.fe-preview__md-mermaid{display:flex;justify-content:center;margin:16px 0}.fe-preview__md-mermaid svg{max-width:100%;height:auto}.fe-preview__md-math{margin:16px 0;text-align:center;overflow-x:auto}.filex-cv__bg[data-v-4363f1ac]{position:fixed;top:0;right:0;bottom:0;left:0;z-index:1000;background:#0000008c;display:flex;align-items:center;justify-content:center}.filex-cv[data-v-4363f1ac]{width:min(560px,92vw);max-height:80vh;overflow:hidden;display:flex;flex-direction:column;background:var(--fe-bg, #fff);color:var(--fe-text, #1a1f29);border:1px solid var(--fe-border, #e2e6ed);border-radius:12px;box-shadow:0 20px 60px #00000059}.filex-cv__head[data-v-4363f1ac]{display:flex;align-items:center;justify-content:space-between;padding:12px 16px;border-bottom:1px solid var(--fe-border, #e2e6ed)}.filex-cv__head h3[data-v-4363f1ac]{margin:0;font-size:14px;font-weight:600}.filex-cv__x[data-v-4363f1ac]{border:0;background:none;cursor:pointer;font-size:16px;color:var(--fe-text-muted, #5a6475)}.filex-cv__msg[data-v-4363f1ac]{padding:28px;text-align:center;color:var(--fe-text-muted, #5a6475)}.filex-cv__ok[data-v-4363f1ac]{color:#059669}.filex-cv__src[data-v-4363f1ac]{padding:12px 16px 0;font-size:13px;color:var(--fe-text-muted, #5a6475)}.filex-cv__search[data-v-4363f1ac]{margin:8px 16px;padding:8px 10px;border:1px solid var(--fe-border, #e2e6ed);border-radius:8px;background:var(--fe-bg-elev, #f7f8fa);color:inherit;font-size:13px}.filex-cv__list[data-v-4363f1ac]{flex:1;overflow-y:auto;padding:4px 12px 12px;display:grid;grid-template-columns:repeat(auto-fill,minmax(120px,1fr));gap:8px}.filex-cv__fmt[data-v-4363f1ac]{display:flex;flex-direction:column;gap:2px;align-items:flex-start;padding:8px 10px;cursor:pointer;text-align:left;border:1px solid var(--fe-border, #e2e6ed);border-radius:8px;background:var(--fe-bg-elev, #f7f8fa);color:inherit}.filex-cv__fmt small[data-v-4363f1ac]{color:var(--fe-text-muted, #5a6475);font-size:11px}.filex-cv__fmt.is-sel[data-v-4363f1ac]{border-color:#44c878;background:#44c8781f}.filex-cv__empty[data-v-4363f1ac]{grid-column:1 / -1;text-align:center;color:var(--fe-text-muted, #5a6475);padding:16px}.filex-cv__err[data-v-4363f1ac]{padding:0 16px;color:var(--fe-danger, #dc2626);font-size:13px}.filex-cv__foot[data-v-4363f1ac]{padding:12px 16px;border-top:1px solid var(--fe-border, #e2e6ed);text-align:right}.filex-cv__convert[data-v-4363f1ac]{padding:8px 18px;border:0;border-radius:8px;cursor:pointer;background:#44c878;color:#03200f;font-weight:600;font-size:13px}.filex-cv__convert[data-v-4363f1ac]:disabled{opacity:.5;cursor:default}.filex-cv__frame[data-v-4363f1ac]{position:absolute;width:0;height:0;border:0;left:-9999px}.fx-perm-overlay[data-v-23e7820c]{position:fixed;top:0;right:0;bottom:0;left:0;background:#00000080;display:flex;align-items:center;justify-content:center;z-index:10000;font-family:var(--fe-font)}.fx-perm-modal[data-v-23e7820c]{display:flex;flex-direction:column;background:var(--fe-bg);color:var(--fe-text);width:min(520px,94vw);max-height:86vh;border:1px solid var(--fe-border);border-radius:var(--fe-radius-lg, 14px);box-shadow:var(--fe-shadow);font-size:14px;overflow:hidden}.fx-perm-head[data-v-23e7820c]{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:16px 18px 12px;flex:none}.fx-perm-title[data-v-23e7820c]{display:flex;align-items:center;gap:10px;min-width:0}.fx-perm-ico[data-v-23e7820c]{font-size:22px;line-height:1}.fx-perm-titletext[data-v-23e7820c]{display:flex;flex-direction:column;min-width:0}.fx-perm-title h3[data-v-23e7820c]{margin:0;font-size:15px;font-weight:600;color:var(--fe-text)}.fx-perm-sub[data-v-23e7820c]{font-size:12px;color:var(--fe-text);max-width:340px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.fx-perm-subdim[data-v-23e7820c]{color:var(--fe-text-muted)}.fx-perm-x[data-v-23e7820c]{background:none;border:none;font-size:17px;cursor:pointer;color:var(--fe-text-muted);flex:none;line-height:1;padding:2px 4px;border-radius:6px}.fx-perm-x[data-v-23e7820c]:hover{color:var(--fe-text);background:var(--fe-bg-hover)}.fx-perm-tabs[data-v-23e7820c]{display:flex;gap:2px;padding:0 18px;border-bottom:1px solid var(--fe-border);flex:none}.fx-perm-tab[data-v-23e7820c]{background:none;border:none;border-bottom:2px solid transparent;padding:8px 12px;cursor:pointer;color:var(--fe-text-muted);font-size:13px;font-family:inherit;font-weight:500}.fx-perm-tab[data-v-23e7820c]:hover{color:var(--fe-text)}.fx-perm-tab.is-active[data-v-23e7820c]{color:var(--fe-primary);border-bottom-color:var(--fe-primary)}.fx-perm-body[data-v-23e7820c]{flex:1 1 auto;overflow-y:auto;padding:14px 18px 18px}.fx-perm-addcard[data-v-23e7820c]{padding:12px;border-radius:var(--fe-radius-md, 10px);background:var(--fe-bg-elev);border:1px solid var(--fe-border)}.fx-perm-section[data-v-23e7820c]{margin-top:16px}.fx-perm-section h4[data-v-23e7820c]{margin:0 0 8px;font-size:11px;text-transform:uppercase;letter-spacing:.05em;color:var(--fe-text-muted)}.fx-perm-empty[data-v-23e7820c]{color:var(--fe-text-muted);font-size:13px;padding:8px 2px}.fx-perm-person[data-v-23e7820c]{display:flex;align-items:center;gap:10px;padding:7px 2px}.fx-perm-person+.fx-perm-person[data-v-23e7820c]{border-top:1px solid var(--fe-border)}.fx-perm-inh[data-v-23e7820c]{color:var(--fe-text-muted)}.fx-perm-av[data-v-23e7820c]{width:28px;height:28px;flex:none;border-radius:50%;display:flex;align-items:center;justify-content:center;background:var(--fe-primary);color:var(--fe-text-on-primary, #fff);font-size:12px;font-weight:600}.fx-perm-av--dim[data-v-23e7820c]{background:var(--fe-bg-hover);color:var(--fe-text-muted)}.fx-perm-user[data-v-23e7820c]{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--fe-text);min-width:0}.fx-perm-from[data-v-23e7820c]{font-size:11px;color:var(--fe-text-muted);white-space:nowrap}.fx-perm-badge[data-v-23e7820c]{font-size:11px;padding:2px 9px;border-radius:999px;background:var(--fe-bg-hover);color:var(--fe-text)}.fx-perm-sel[data-v-23e7820c],.fx-perm-input[data-v-23e7820c]{padding:7px 9px;border-radius:var(--fe-radius-sm, 7px);border:1px solid var(--fe-border);background:var(--fe-bg);color:var(--fe-text);font-size:13px;font-family:inherit}.fx-perm-sel--sm[data-v-23e7820c]{padding:5px 7px;font-size:12px}.fx-perm-sel[data-v-23e7820c]:focus,.fx-perm-input[data-v-23e7820c]:focus{outline:none;border-color:var(--fe-primary)}.fx-perm-add[data-v-23e7820c]{display:flex;gap:8px;align-items:stretch}.fx-perm-emailwrap[data-v-23e7820c]{position:relative;flex:1;min-width:120px}.fx-perm-input[data-v-23e7820c]{width:100%;box-sizing:border-box}.fx-perm-suggest[data-v-23e7820c]{position:absolute;top:calc(100% + 3px);left:0;right:0;z-index:5;margin:0;padding:4px;list-style:none;background:var(--fe-bg);border:1px solid var(--fe-border);border-radius:var(--fe-radius-sm, 7px);box-shadow:var(--fe-shadow);max-height:210px;overflow:auto}.fx-perm-suggest li[data-v-23e7820c]{display:flex;align-items:center;gap:8px;padding:6px 8px;border-radius:6px;cursor:pointer}.fx-perm-suggest li[data-v-23e7820c]:hover{background:var(--fe-bg-hover)}.fx-perm-suggest-av[data-v-23e7820c]{width:24px;height:24px;flex:none;border-radius:50%;display:flex;align-items:center;justify-content:center;background:var(--fe-bg-hover);color:var(--fe-text);font-size:11px;font-weight:600}.fx-perm-suggest-txt[data-v-23e7820c]{display:flex;flex-direction:column;min-width:0}.fx-perm-suggest-name[data-v-23e7820c]{color:var(--fe-text);font-size:13px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.fx-perm-suggest-meta[data-v-23e7820c]{color:var(--fe-text-muted);font-size:11px}.fx-perm-check[data-v-23e7820c]{display:inline-flex;gap:6px;align-items:center;font-size:13px;color:var(--fe-text);cursor:pointer}.fx-perm-btn[data-v-23e7820c]{padding:7px 13px;border-radius:var(--fe-radius-sm, 7px);border:1px solid var(--fe-border);background:var(--fe-bg);color:var(--fe-text);font-size:13px;font-family:inherit;cursor:pointer;white-space:nowrap}.fx-perm-btn[data-v-23e7820c]:hover:not(:disabled){background:var(--fe-bg-hover)}.fx-perm-btn[data-v-23e7820c]:disabled{opacity:.55;cursor:default}.fx-perm-btn--sm[data-v-23e7820c]{padding:5px 10px;font-size:12px}.fx-perm-btn--primary[data-v-23e7820c]{background:var(--fe-primary);border-color:var(--fe-primary);color:var(--fe-text-on-primary, #fff)}.fx-perm-btn--primary[data-v-23e7820c]:hover:not(:disabled){background:var(--fe-primary-hover, var(--fe-primary));filter:brightness(1.05)}.fx-perm-btn--ghost[data-v-23e7820c]{background:none;border-color:transparent;color:var(--fe-primary);padding-left:2px}.fx-perm-btn--ghost[data-v-23e7820c]:hover:not(:disabled){background:none;text-decoration:underline}.fx-perm-del[data-v-23e7820c]{background:none;border:none;color:var(--fe-danger);cursor:pointer;font-size:14px;flex:none;padding:2px 4px}.fx-perm-del[data-v-23e7820c]:hover:not(:disabled){filter:brightness(1.15)}.fx-perm-invite[data-v-23e7820c]{margin-top:10px;padding-top:10px;border-top:1px dashed var(--fe-border)}.fx-perm-invite-actions[data-v-23e7820c]{display:flex;flex-direction:column;gap:8px;margin-top:6px}.fx-perm-invite-row[data-v-23e7820c]{display:flex;gap:8px;align-items:stretch}.fx-perm-invite-row .fx-perm-btn--primary[data-v-23e7820c]{flex:1}.fx-perm-share-opts[data-v-23e7820c]{display:flex;gap:12px;align-items:center;flex-wrap:wrap}.fx-perm-expiry[data-v-23e7820c]{display:inline-flex;gap:6px;align-items:center;font-size:13px}.fx-perm-share-opts .fx-perm-btn--primary[data-v-23e7820c]{margin-left:auto}.fx-perm-result[data-v-23e7820c]{margin-top:12px;padding-top:12px;border-top:1px solid var(--fe-border)}.fx-perm-linkrow[data-v-23e7820c]{display:flex;gap:8px;align-items:center}.fx-perm-link[data-v-23e7820c]{color:var(--fe-primary);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;flex:1;min-width:0;text-decoration:none}.fx-perm-link[data-v-23e7820c]:hover{text-decoration:underline}.fx-perm-pin[data-v-23e7820c]{margin:8px 0 0;font-size:13px;color:var(--fe-text);display:flex;align-items:center;gap:8px}.fx-perm-pin code[data-v-23e7820c],.fx-perm-reveal code[data-v-23e7820c]{font-family:var(--fe-font-mono, monospace);background:var(--fe-bg-hover);padding:1px 6px;border-radius:5px}.fx-perm-mailrow[data-v-23e7820c]{display:flex;gap:8px;margin-top:10px}.fx-perm-mailrow .fx-perm-input[data-v-23e7820c]{flex:1}.fx-perm-hint[data-v-23e7820c]{font-size:13px;color:var(--fe-text-muted);margin:10px 0 0}.fx-perm-sharebtn[data-v-23e7820c]{display:flex;width:100%;align-items:center;justify-content:center;gap:6px;margin-top:8px}.fx-perm-dropintro[data-v-23e7820c]{margin:0 0 12px;line-height:1.4}.fx-perm-advtoggle[data-v-23e7820c]{margin-top:10px;padding-left:2px}.fx-perm-adv[data-v-23e7820c]{margin-top:8px;padding-top:10px;border-top:1px dashed var(--fe-border);display:flex;flex-direction:column;gap:8px}.fx-perm-adv-row[data-v-23e7820c]{display:flex;align-items:center;justify-content:space-between;gap:10px;font-size:13px}.fx-perm-input--sm[data-v-23e7820c]{width:130px;padding:5px 8px;font-size:12px}.fx-perm-warn[data-v-23e7820c]{background:#f59e0b24;border:1px solid rgba(245,158,11,.4);border-radius:var(--fe-radius-sm, 7px);padding:8px 10px;font-size:13px;margin-bottom:10px;color:var(--fe-text)}.fx-perm-notice[data-v-23e7820c]{margin-top:8px;font-size:13px;color:var(--fe-text-muted)}.fx-perm-reveal[data-v-23e7820c]{margin-top:8px;font-size:13px;word-break:break-all;color:var(--fe-text)}.fx-perm-muted[data-v-23e7820c]{color:var(--fe-text-muted);font-size:13px}:root{--fe-bg: #ffffff;--fe-bg-elev: #f7f8fa;--fe-bg-hover: #edf0f5;--fe-bg-selected: #dfe8ff;--fe-border: #e2e6ed;--fe-border-strong: #c7ced9;--fe-text: #1a1e27;--fe-text-muted: #5a6475;--fe-text-on-primary: #ffffff;--fe-primary: #2f6fe0;--fe-primary-hover: #2563eb;--fe-danger: #dc2626;--fe-danger-hover: #b91c1c;--fe-shadow: 0 10px 32px rgba(15, 23, 42, .14);--fe-shadow-sm: 0 2px 6px rgba(15, 23, 42, .08);--fe-radius: 8px;--fe-radius-sm: 4px;--fe-radius-lg: 12px;--fe-font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;--fe-font-mono: ui-monospace, "SF Mono", Consolas, Menlo, monospace;--fe-gap: 12px}.fe--theme-dark,:root[data-theme=dark] .fe,.fe.fe--theme-dark,:root.dark,.dark,:root.dark .fe,.dark .fe,.fe-ctx-backdrop--theme-dark,.fe-ctx-backdrop--theme-auto[data-prefers-dark="1"]{--fe-bg: #0f1419;--fe-bg-elev: #161c25;--fe-bg-hover: #1f2733;--fe-bg-selected: #23324a;--fe-border: #2a323e;--fe-border-strong: #3a4453;--fe-text: #e5e9f0;--fe-text-muted: #8b95a7;--fe-primary: #60a5fa;--fe-primary-hover: #3b82f6;--fe-danger: #f87171;--fe-danger-hover: #ef4444;--fe-shadow: 0 12px 32px rgba(0, 0, 0, .45);--fe-shadow-sm: 0 2px 6px rgba(0, 0, 0, .25)}@media (prefers-color-scheme: dark){.fe:not(.fe--theme-light),.fe-ctx-backdrop--theme-auto:not(.fe-ctx-backdrop--theme-light){--fe-bg: #0f1419;--fe-bg-elev: #161c25;--fe-bg-hover: #1f2733;--fe-bg-selected: #23324a;--fe-border: #2a323e;--fe-border-strong: #3a4453;--fe-text: #e5e9f0;--fe-text-muted: #8b95a7;--fe-primary: #60a5fa;--fe-primary-hover: #3b82f6;--fe-danger: #f87171;--fe-danger-hover: #ef4444;--fe-shadow: 0 12px 32px rgba(0, 0, 0, .45);--fe-shadow-sm: 0 2px 6px rgba(0, 0, 0, .25)}}:root{--fe-icon-folder: #d97706;--fe-icon-image: #7c3aed;--fe-icon-video: #db2777;--fe-icon-audio: #0d9488;--fe-icon-pdf: #dc2626;--fe-icon-doc: #2563eb;--fe-icon-sheet: #16a34a;--fe-icon-slides: #ea580c;--fe-icon-archive: #78716c;--fe-icon-code: #4f46e5;--fe-icon-text: #64748b;--fe-icon-unknown: #64748b}.fe--theme-dark,:root[data-theme=dark] .fe,.fe.fe--theme-dark,:root.dark,.dark,:root.dark .fe,.dark .fe,.fe-ctx-backdrop--theme-dark,.fe-ctx-backdrop--theme-auto[data-prefers-dark="1"]{--fe-icon-folder: #fbbf24;--fe-icon-image: #a78bfa;--fe-icon-video: #f472b6;--fe-icon-audio: #2dd4bf;--fe-icon-pdf: #f87171;--fe-icon-doc: #60a5fa;--fe-icon-sheet: #4ade80;--fe-icon-slides: #fb923c;--fe-icon-archive: #a8a29e;--fe-icon-code: #818cf8;--fe-icon-text: #94a3b8;--fe-icon-unknown: #8b95a7}@media (prefers-color-scheme: dark){.fe:not(.fe--theme-light),.fe-ctx-backdrop--theme-auto:not(.fe-ctx-backdrop--theme-light){--fe-icon-folder: #fbbf24;--fe-icon-image: #a78bfa;--fe-icon-video: #f472b6;--fe-icon-audio: #2dd4bf;--fe-icon-pdf: #f87171;--fe-icon-doc: #60a5fa;--fe-icon-sheet: #4ade80;--fe-icon-slides: #fb923c;--fe-icon-archive: #a8a29e;--fe-icon-code: #818cf8;--fe-icon-text: #94a3b8;--fe-icon-unknown: #8b95a7}}:root,.fe--theme-dark,:root.dark,.dark{--fe-warning: #f59e0b}.fe{position:relative;display:flex;flex-direction:column;box-sizing:border-box;min-height:420px;height:100%;background:var(--fe-bg);color:var(--fe-text);font-family:var(--fe-font);font-size:14px;border:1px solid var(--fe-border);border-radius:var(--fe-radius);overflow:hidden;outline:none}.fe *{box-sizing:border-box}.fe__body{flex:1 1 auto;overflow:auto;min-height:0;background:var(--fe-bg)}filex-explorer{display:block;height:100%}.fe__presence{flex:0 0 auto;padding:.25rem .75rem;border-bottom:1px solid var(--fe-border, rgba(0, 0, 0, .06))}.fe__loading{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:14px;min-height:240px;height:100%;color:var(--fe-text-muted)}.fe__spinner{width:34px;height:34px;border-radius:50%;border:3px solid color-mix(in srgb,var(--fe-text-muted) 30%,transparent);border-top-color:var(--fe-primary);animation:fe-spin .7s linear infinite}.fe__loading-text{margin:0;font-size:13px}@keyframes fe-spin{to{transform:rotate(360deg)}}.fe__notfound{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:6px;min-height:240px;height:100%;color:var(--fe-text-muted);text-align:center;padding:24px}.fe__notfound-icon{font-size:40px;filter:grayscale(1);opacity:.6}.fe__notfound-title{margin:4px 0 0;font-size:15px;font-weight:600;color:var(--fe-text)}.fe__notfound-path{margin:0;font-size:12px;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;word-break:break-all;max-width:480px}.fe__notfound-desc{margin:0 0 10px;font-size:13px}.fe__file-input{position:absolute;left:-9999px;width:1px;height:1px;opacity:0}.fe-btn{display:inline-flex;align-items:center;gap:6px;padding:6px 12px;background:var(--fe-bg-elev);border:1px solid var(--fe-border);border-radius:var(--fe-radius-sm);color:var(--fe-text);font:inherit;cursor:pointer;transition:background .12s,border-color .12s;white-space:nowrap}.fe-btn:hover:not(:disabled){background:var(--fe-bg-hover);border-color:var(--fe-border-strong)}.fe-btn:disabled{opacity:.5;cursor:not-allowed}.fe-btn--primary{background:var(--fe-primary);border-color:var(--fe-primary);color:var(--fe-text-on-primary)}.fe-btn--primary:hover:not(:disabled){background:var(--fe-primary-hover);border-color:var(--fe-primary-hover)}.fe-btn--danger{background:var(--fe-danger);border-color:var(--fe-danger);color:var(--fe-text-on-primary)}.fe-btn--danger:hover:not(:disabled){background:var(--fe-danger-hover);border-color:var(--fe-danger-hover)}.fe-btn--icon-only{padding:6px 8px}.fe-btn.is-active{background:var(--fe-bg-selected);border-color:var(--fe-primary)}.fe-btn__label{line-height:1}.fe-icon{font-size:1.05em;line-height:1}.fe-toolbar{display:flex;align-items:center;gap:8px;padding:10px 12px;background:var(--fe-bg-elev);border-bottom:1px solid var(--fe-border);flex-wrap:wrap}.fe-toolbar__primary{display:inline-flex;align-items:center;gap:6px;flex-wrap:wrap}.fe-toolbar__spacer{flex:1 1 auto}.fe-toolbar__search-group{display:inline-flex;align-items:center;gap:4px;background:var(--fe-bg);border:1px solid var(--fe-border);border-radius:var(--fe-radius-sm);padding:2px}.fe-toolbar__search-group .fe-search__input{border:0;background:transparent;padding:4px 8px}.fe-toolbar__search-group .fe-btn{border:0;background:transparent;padding:4px 6px}.fe-toolbar__search-group .fe-btn:hover:not(:disabled){background:var(--fe-bg-hover)}.fe-toolbar__view{display:inline-flex;gap:2px;padding:2px;background:var(--fe-bg);border:1px solid var(--fe-border);border-radius:var(--fe-radius-sm)}.fe-toolbar__view .fe-btn{border:0;background:transparent}.fe-toolbar__view .fe-btn.is-active{background:var(--fe-bg-selected)}.fe-search{position:relative}.fe-search__input{background:var(--fe-bg);border:1px solid var(--fe-border);border-radius:var(--fe-radius-sm);padding:6px 10px;font:inherit;color:var(--fe-text);min-width:200px}.fe-search__input:focus-visible{outline:2px solid var(--fe-primary);outline-offset:1px}.fe-breadcrumb{display:flex;align-items:center;gap:4px;flex-wrap:wrap;padding:6px 12px;min-height:37px;background:var(--fe-bg);border-bottom:1px solid var(--fe-border);font-size:13px;color:var(--fe-text-muted)}.fe-breadcrumb__crumb{display:inline-flex;align-items:center;gap:4px;background:transparent;border:0;color:inherit;padding:2px 6px;border-radius:var(--fe-radius-sm);cursor:pointer;font:inherit}.fe-breadcrumb__crumb:hover{background:var(--fe-bg-hover);color:var(--fe-text)}.fe-breadcrumb__crumb.is-last{color:var(--fe-text);font-weight:600}.fe-breadcrumb__sep{color:var(--fe-text-muted)}.fe-breadcrumb__edit{margin-left:auto;background:none;border:1px solid transparent;color:var(--fe-text-muted);cursor:pointer;font-size:14px;line-height:1;padding:4px 8px;border-radius:4px}.fe-breadcrumb__edit:hover{background:var(--fe-bg-hover);color:var(--fe-text);border-color:var(--fe-border)}.fe-breadcrumb__input{flex:1;background:var(--fe-bg);color:var(--fe-text);border:1px solid var(--fe-accent, #2563eb);border-radius:4px;padding:4px 8px;font-family:var(--fe-mono, ui-monospace, SFMono-Regular, Menlo, Consolas, monospace);font-size:13px;outline:none}.fe-list{display:flex;flex-direction:column}.fe-list__head{display:grid;grid-template-columns:32px minmax(0,1fr) 120px 180px;gap:8px;padding:8px 12px;font-weight:600;color:var(--fe-text-muted);font-size:12px;text-transform:uppercase;letter-spacing:.04em;background:var(--fe-bg-elev);border-bottom:1px solid var(--fe-border)}.fe-list__body{display:flex;flex-direction:column}.fe-list__row{display:grid;grid-template-columns:32px minmax(0,1fr) 120px 180px;gap:8px;padding:8px 12px;align-items:center;cursor:pointer;border-bottom:1px solid var(--fe-border);transition:background .08s;-webkit-user-select:none;user-select:none}.fe-list__row:hover{background:var(--fe-bg-hover)}.fe-list__row.is-selected{background:var(--fe-bg-selected)}.fe-list__row.is-trash{opacity:.7}.fe-list__row.is-clipped,.fe-grid__card.is-clipped{opacity:.45;font-style:italic}.fe-list__row:focus-visible{outline:2px solid var(--fe-primary);outline-offset:-2px}.fe-list__col--star{display:flex;align-items:center;justify-content:center;opacity:0;transition:opacity .12s}.fe-list__row:hover .fe-list__col--star,.fe-list__row:focus-within .fe-list__col--star,.fe-list__col--star:has(.is-starred){opacity:1}.fe-list__col--star .filex-star-btn.is-starred{color:var(--fe-warning, #f59e0b)}.fe-list__col--name{display:flex;align-items:center;gap:8px;min-width:0}.fe-list__icon{flex-shrink:0;font-size:16px}.fe-list__name-wrap{display:flex;flex-direction:column;min-width:0;flex:1 1 auto}.fe-list__name{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.fe-list__parent{font-size:11px;color:var(--fe-text-muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;margin-top:2px}.fe-list__col--size,.fe-list__col--mod{color:var(--fe-text-muted);font-size:13px}.fe-list__empty{padding:40px 20px;text-align:center;color:var(--fe-text-muted)}.fe-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(140px,1fr));gap:var(--fe-gap);padding:var(--fe-gap)}.fe-grid__card{display:flex;flex-direction:column;align-items:stretch;padding:8px;border:1px solid var(--fe-border);border-radius:var(--fe-radius);background:var(--fe-bg-elev);cursor:pointer;transition:background .08s,border-color .08s;-webkit-user-select:none;user-select:none}.fe-grid__card:hover{background:var(--fe-bg-hover);border-color:var(--fe-border-strong)}.fe-grid__card.is-selected{background:var(--fe-bg-selected);border-color:var(--fe-primary)}.fe-grid__card.is-trash{opacity:.7}.fe-grid__thumb{display:flex;align-items:center;justify-content:center;aspect-ratio:1 / 1;background:var(--fe-bg);border-radius:var(--fe-radius-sm);margin-bottom:8px;overflow:hidden}.fe-grid__thumb img{width:100%;height:100%;object-fit:cover}.fe-grid__icon{font-size:32px}.fe-grid__label{font-size:13px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.fe-grid__meta{font-size:11px;color:var(--fe-text-muted);margin-top:2px}.fe-grid__parent{font-size:11px;color:var(--fe-text-muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;margin-top:2px;font-style:italic}.fe-grid__snippet{margin-top:2px;font-size:11px;line-height:1.35;color:var(--fe-text-muted);display:-webkit-box;-webkit-line-clamp:2;line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;overflow-wrap:anywhere;text-align:left}.fe-grid__empty{grid-column:1 / -1;padding:40px 20px;text-align:center;color:var(--fe-text-muted)}.fe__dragover{position:absolute;top:0;right:0;bottom:0;left:0;z-index:30;display:flex;align-items:center;justify-content:center;background:#3b82f61f;border:3px dashed var(--fe-primary);pointer-events:none}.fe__dragover-card{background:var(--fe-bg);border-radius:var(--fe-radius-lg);padding:24px 40px;box-shadow:var(--fe-shadow);text-align:center}.fe__dragover-card .fe-icon{font-size:32px;display:block;margin-bottom:8px}.fe-upload{position:absolute;right:16px;bottom:16px;width:min(360px,calc(100% - 32px));background:var(--fe-bg);border:1px solid var(--fe-border);border-radius:var(--fe-radius);box-shadow:var(--fe-shadow);z-index:40;max-height:40vh;display:flex;flex-direction:column;overflow:hidden}.fe-upload__header{display:flex;align-items:center;justify-content:space-between;padding:10px 14px;background:var(--fe-bg-elev);border-bottom:1px solid var(--fe-border);font-size:13px}.fe-upload__count{background:var(--fe-primary);color:var(--fe-text-on-primary);font-size:12px;padding:1px 7px;border-radius:999px}.fe-upload__list{list-style:none;padding:0;margin:0;overflow:auto}.fe-upload__item{padding:10px 14px;border-bottom:1px solid var(--fe-border)}.fe-upload__item:last-child{border-bottom:0}.fe-upload__name{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:13px;margin-bottom:4px}.fe-upload__bar{background:var(--fe-bg-elev);border-radius:99px;height:6px;overflow:hidden;margin-bottom:4px}.fe-upload__bar-fill{background:var(--fe-primary);height:100%;transition:width .2s}.fe-upload__item.is-error .fe-upload__bar-fill,.fe-upload__item.is-aborted .fe-upload__bar-fill{background:var(--fe-danger)}.fe-upload__item.is-done .fe-upload__bar-fill{background:#16a34a}.fe-upload__meta{display:flex;align-items:center;justify-content:space-between;gap:6px;font-size:11px;color:var(--fe-text-muted)}.fe-upload__cancel{background:transparent;border:0;color:var(--fe-primary);cursor:pointer;font:inherit}.fe-upload-slide-enter-active,.fe-upload-slide-leave-active{transition:transform .2s,opacity .2s}.fe-upload-slide-enter-from,.fe-upload-slide-leave-to{opacity:0;transform:translateY(10px)}.fe-ops{position:absolute;left:16px;bottom:16px;width:min(320px,calc(100% - 32px));display:flex;flex-direction:column;gap:8px;z-index:40}.fe-ops__item{background:var(--fe-bg);border:1px solid var(--fe-border);border-radius:var(--fe-radius);box-shadow:var(--fe-shadow);padding:10px 14px;font-size:13px}.fe-ops__item.is-done{border-color:#16a34a}.fe-ops__item.is-error{border-color:var(--fe-danger)}.fe-ops__row{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:6px}.fe-ops__title{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;flex:1 1 auto}.fe-ops__dismiss{background:transparent;border:0;color:var(--fe-text-muted);cursor:pointer;font-size:18px;line-height:1;padding:0 4px}.fe-ops__bar{background:var(--fe-bg-elev);border-radius:99px;height:6px;overflow:hidden}.fe-ops__bar-fill{background:var(--fe-primary);height:100%;transition:width .25s}.fe-ops__item.is-done .fe-ops__bar-fill{background:#16a34a}.fe-ops__item.is-error .fe-ops__bar-fill{background:var(--fe-danger)}.fe-ops__error{margin-top:6px;font-size:11px;color:var(--fe-danger)}.fe-ops-slide-enter-active,.fe-ops-slide-leave-active{transition:transform .2s,opacity .2s}.fe-ops-slide-enter-from,.fe-ops-slide-leave-to{opacity:0;transform:translateY(10px)}.fe-ctx-backdrop{position:fixed;top:0;right:0;bottom:0;left:0;z-index:80;color:var(--fe-text);font-family:var(--fe-font);font-size:14px}.fe-ctx{position:absolute;min-width:180px;background:var(--fe-bg);border:1px solid var(--fe-border);border-radius:var(--fe-radius);box-shadow:var(--fe-shadow);padding:4px;z-index:90;color:var(--fe-text)}.fe-ctx__item{display:flex;align-items:center;gap:8px;padding:6px 10px;border-radius:var(--fe-radius-sm);border:0;background:transparent;color:var(--fe-text);font:inherit;width:100%;text-align:left;cursor:pointer}.fe-ctx__item:hover:not(.is-disabled){background:var(--fe-bg-hover)}.fe-ctx__item.is-danger{color:var(--fe-danger)}.fe-ctx__item.is-disabled{opacity:.45;cursor:not-allowed}.fe-ctx__icon{width:1.2em;text-align:center}.fe-ctx__sep{height:1px;background:var(--fe-border);margin:4px 0}.fe-ctx-enter-active,.fe-ctx-leave-active{transition:opacity .1s}.fe-ctx-enter-from,.fe-ctx-leave-to{opacity:0}.fe-modal__backdrop{position:fixed;top:0;right:0;bottom:0;left:0;z-index:70;display:flex;align-items:center;justify-content:center;background:#0d131b7a;padding:16px}.fe-modal__card{background:var(--fe-bg);border-radius:var(--fe-radius);box-shadow:var(--fe-shadow);width:100%;max-height:calc(100vh - 32px);display:flex;flex-direction:column;overflow:hidden}.fe-modal__card--sm{max-width:420px}.fe-modal__card--md{max-width:560px}.fe-modal__card--lg{max-width:800px}.fe-modal__card--xl{max-width:1080px;height:calc(100vh - 64px)}.fe-recents__backdrop{align-items:flex-start!important;padding-top:60px}.fe-recents__panel{background:var(--fe-bg, #fff);border-radius:var(--fe-radius, 8px);box-shadow:var(--fe-shadow, 0 6px 24px rgba(0, 0, 0, .18));width:min(480px,calc(100vw - 32px));max-height:calc(100vh - 96px);display:flex;flex-direction:column;overflow:hidden}.fe-recents__header{display:flex;align-items:center;justify-content:space-between;padding:10px 14px;border-bottom:1px solid var(--fe-border, #e2e6ed)}.fe-recents__close{-webkit-appearance:none;-moz-appearance:none;appearance:none;background:transparent;border:0;font-size:22px;line-height:1;cursor:pointer;color:var(--fe-text-muted, #6b7280);padding:0 4px}.fe-recents__close:hover{color:var(--fe-text, #111)}.fe-preview__md-split{display:flex;flex-direction:column;height:100%;width:100%;min-height:0}.fe-preview__md-split-bar{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:8px 14px;background:var(--fe-bg-elev, #f6f7f9);border-bottom:1px solid var(--fe-border, #e2e6ed);flex:0 0 auto}.fe-preview__md-split-label{font-family:var(--fe-font-mono, ui-monospace, monospace);font-size:11px;letter-spacing:.06em;color:var(--fe-text-muted, #6b7280)}.fe-preview__md-split-error{flex:1 1 auto;font-size:12px;color:var(--fe-danger, #dc2626);text-align:center}.fe-preview__md-split-body{flex:1 1 auto;display:grid;grid-template-columns:1fr 1fr;min-height:0}.fe-preview__md-split-input{resize:none;border:0;outline:0;padding:16px 20px;font-family:var(--fe-font-mono, ui-monospace, monospace);font-size:13px;line-height:1.6;background:var(--fe-bg, #fff);color:var(--fe-text, #111);border-right:1px solid var(--fe-border, #e2e6ed);overflow:auto;-moz-tab-size:2;tab-size:2}.fe-preview__md-split-output{overflow:auto;padding:16px 24px;background:var(--fe-bg, #fff)}.fe-preview__md-split-output.fe-preview__md{max-height:none;min-height:0;height:100%}@media (max-width: 900px){.fe-preview__md-split-body{grid-template-columns:1fr;grid-template-rows:1fr 1fr}.fe-preview__md-split-input{border-right:0;border-bottom:1px solid var(--fe-border, #e2e6ed)}}.fe-modal__backdrop--chromeless{background:transparent;padding:0}.fe-modal__card--chromeless{max-width:none;width:100vw;height:100vh;max-height:100vh;border-radius:0;box-shadow:none}.fe-modal__card--chromeless .fe-modal__body{flex:1 1 auto;min-height:0;padding:0}.fe-modal__card--chromeless .fe-preview{align-items:stretch;justify-content:stretch;min-height:0;flex:1 1 auto}.fe-modal__card--chromeless .fe-preview>*{width:100%;height:100%}.fe-modal__head{display:flex;align-items:center;justify-content:space-between;padding:12px 16px;border-bottom:1px solid var(--fe-border)}.fe-modal__title{font-size:16px;font-weight:600;margin:0}.fe-modal__close{background:transparent;border:0;color:var(--fe-text-muted);font-size:22px;cursor:pointer;padding:0 4px;line-height:1}.fe-modal__body{padding:16px;overflow:auto;flex:1 1 auto}.fe-modal__actions{display:flex;justify-content:flex-end;gap:8px;padding:12px 16px;border-top:1px solid var(--fe-border);background:var(--fe-bg-elev)}.fe-modal-enter-active,.fe-modal-leave-active{transition:opacity .15s}.fe-modal-enter-from,.fe-modal-leave-to{opacity:0}.fe-input{width:100%;padding:8px 10px;background:var(--fe-bg);border:1px solid var(--fe-border);border-radius:var(--fe-radius-sm);font:inherit;color:var(--fe-text)}.fe-input:focus-visible{outline:2px solid var(--fe-primary);outline-offset:1px}.fe-input--mono{font-family:var(--fe-font-mono);letter-spacing:.1em}.fe-form{display:flex;flex-direction:column;gap:12px}.fe-form__row{display:flex;align-items:center;gap:8px}.fe-form__row--stack{flex-direction:column;align-items:stretch}.fe-form__error{color:var(--fe-danger);font-size:12px;margin:6px 0 0}.fe-share-result{display:flex;flex-direction:column;gap:12px}.fe-share-result__row label{display:block;font-size:12px;font-weight:600;color:var(--fe-text-muted);margin-bottom:4px}.fe-share-result__copy{display:flex;gap:6px}.fe-preview{display:flex;align-items:center;justify-content:center;width:100%;height:100%;min-height:50vh;background:var(--fe-bg-elev)}.fe-preview__image{max-width:100%;max-height:70vh;object-fit:contain}.fe-preview__video,.fe-preview__audio{max-width:100%;max-height:70vh}.fe-preview__iframe{width:100%;height:70vh;border:0;background:#fff}.fe-preview__office{width:100%;height:78vh;background:var(--fe-bg)}.fe-preview__code-wrap{display:flex;flex-direction:column;width:100%;height:78vh}.fe-preview__code-toolbar{display:flex;align-items:center;gap:12px;padding:8px 12px;background:var(--fe-bg-hover, #f3f4f6);border-bottom:1px solid var(--fe-border, #e5e7eb);font-size:12px}.fe-preview__code-lang{font-family:var(--fe-font-mono, ui-monospace, monospace);color:var(--fe-text-muted);text-transform:uppercase;letter-spacing:.04em}.fe-preview__code-toolbar>.fe-btn{margin-left:auto}.fe-preview__code-status{font-size:12px;font-weight:500}.fe-preview__code-status--ok{color:#059669}.fe-preview__code-status--err{color:#dc2626;cursor:help}.fe-preview__code-editor{flex:1;min-height:0;overflow:hidden}.fe-preview__code-editor .cm-editor{height:100%;font-size:13px}.fe-preview__code-editor .cm-scroller{font-family:var(--fe-font-mono, ui-monospace, SFMono-Regular, Menlo, Consolas, monospace)}.fe-preview__fallback{text-align:center;color:var(--fe-text-muted);padding:40px 20px}.fe-preview__fallback-icon{font-size:48px;display:block;margin-bottom:12px}.fe-preview__pre{margin:0;padding:16px;width:100%;max-height:70vh;overflow:auto;background:var(--fe-bg);color:var(--fe-text);font-family:var(--fe-font-mono);font-size:13px;line-height:1.5;white-space:pre-wrap;word-wrap:break-word}.fe-preview__code{white-space:pre;word-wrap:normal}.hljs{background:var(--fe-bg);color:var(--fe-text)}.hljs-comment,.hljs-quote{color:var(--fe-text-muted);font-style:italic}.hljs-keyword,.hljs-selector-tag,.hljs-built_in,.hljs-section,.hljs-meta{color:#c678dd}.hljs-string,.hljs-attr,.hljs-symbol,.hljs-bullet,.hljs-addition,.hljs-link{color:#98c379}.hljs-number,.hljs-literal,.hljs-deletion{color:#d19a66}.hljs-title,.hljs-name,.hljs-selector-id,.hljs-selector-class,.hljs-template-tag,.hljs-template-variable{color:#61aeee}.hljs-type,.hljs-tag{color:#e06c75}.hljs-variable,.hljs-attribute{color:#d19a66}.hljs-emphasis{font-style:italic}.hljs-strong{font-weight:700}.fe-preview__md{width:100%;max-height:70vh;overflow:auto;padding:24px 32px;background:var(--fe-bg);color:var(--fe-text);line-height:1.6;font-size:15px}.fe-preview__md h1,.fe-preview__md h2,.fe-preview__md h3,.fe-preview__md h4{margin:1.2em 0 .6em;font-weight:600}.fe-preview__md h1{font-size:1.8em;border-bottom:1px solid var(--fe-border);padding-bottom:.3em}.fe-preview__md h2{font-size:1.4em;border-bottom:1px solid var(--fe-border);padding-bottom:.3em}.fe-preview__md h3{font-size:1.2em}.fe-preview__md p{margin:.8em 0}.fe-preview__md a{color:var(--fe-primary);text-decoration:underline}.fe-preview__md code{font-family:var(--fe-font-mono);background:var(--fe-bg-elev);padding:1px 5px;border-radius:3px;font-size:.92em}.fe-preview__md pre{background:var(--fe-bg-elev);border:1px solid var(--fe-border);border-radius:var(--fe-radius-sm);padding:12px 16px;overflow:auto;font-size:.9em}.fe-preview__md pre code{background:transparent;padding:0}.fe-preview__md ul,.fe-preview__md ol{padding-left:2em;margin:.8em 0}.fe-preview__md li{margin:.3em 0}.fe-preview__md blockquote{border-left:3px solid var(--fe-border-strong);padding:0 1em;color:var(--fe-text-muted);margin:.8em 0}.fe-preview__md table{border-collapse:collapse;margin:1em 0;width:100%}.fe-preview__md th,.fe-preview__md td{border:1px solid var(--fe-border);padding:6px 10px;text-align:left}.fe-preview__md th{background:var(--fe-bg-elev)}.fe-preview__md img{max-width:100%}.fe-toast{position:absolute;bottom:24px;left:50%;transform:translate(-50%);background:var(--fe-text);color:var(--fe-bg);padding:8px 14px;border-radius:var(--fe-radius);font-size:13px;box-shadow:var(--fe-shadow-sm);z-index:95}.fe-toast-enter-active,.fe-toast-leave-active{transition:opacity .2s,transform .2s}.fe-toast-enter-from,.fe-toast-leave-to{opacity:0;transform:translate(-50%,10px)}@media (max-width: 640px){.fe-list__head,.fe-list__row{grid-template-columns:28px minmax(0,1fr) 90px}.fe-list__col--mod{display:none}.fe-toolbar{padding:8px}.fe-search__input{min-width:120px}}.fe-ficon{width:1em;height:1em;display:block;flex-shrink:0}.fe-ficon--folder{color:var(--fe-icon-folder)}.fe-ficon--image{color:var(--fe-icon-image)}.fe-ficon--video{color:var(--fe-icon-video)}.fe-ficon--audio{color:var(--fe-icon-audio)}.fe-ficon--pdf{color:var(--fe-icon-pdf)}.fe-ficon--doc{color:var(--fe-icon-doc)}.fe-ficon--sheet{color:var(--fe-icon-sheet)}.fe-ficon--slides{color:var(--fe-icon-slides)}.fe-ficon--archive{color:var(--fe-icon-archive)}.fe-ficon--code{color:var(--fe-icon-code)}.fe-ficon--text{color:var(--fe-icon-text)}.fe-ficon--unknown{color:var(--fe-icon-unknown)}.fe-grid__icon--svg{display:flex;align-items:center;justify-content:center}.fe-list__icon--svg{display:inline-flex;align-items:center}.fe-list__sort{display:inline-flex;align-items:center;gap:4px;background:transparent;border:0;padding:0;font:inherit;color:inherit;text-transform:inherit;letter-spacing:inherit;cursor:pointer}.fe-list__sort:hover{color:var(--fe-text)}.fe-list__sort:focus-visible{outline:2px solid var(--fe-primary);outline-offset:2px;border-radius:2px}.fe-list__sort-arrow{font-size:11px;color:var(--fe-primary)}.fe-list__group{padding:12px 12px 4px;font-size:11px;font-weight:600;text-transform:uppercase;letter-spacing:.05em;color:var(--fe-text-muted);-webkit-user-select:none;user-select:none}.fe--density-compact .fe-toolbar{padding:6px 8px;gap:6px}.fe--density-compact .fe-breadcrumb,.fe--density-compact .fe-list__head{padding:4px 12px}.fe--density-compact .fe-list__row{padding:3px 12px}.fe--density-compact .fe-list__icon{font-size:14px}.fe--density-compact .fe-list__group{padding:8px 12px 2px}.fe--density-compact .fe-grid{grid-template-columns:repeat(auto-fill,minmax(104px,1fr));gap:8px;padding:8px}.fe--density-compact .fe-grid__card{padding:6px}.fe--density-compact .fe-grid__icon{font-size:24px}.fe-cmdp__backdrop{align-items:flex-start;padding-top:min(18vh,160px)}.fe-cmdp{background:var(--fe-bg);border:1px solid var(--fe-border);border-radius:var(--fe-radius-lg);box-shadow:var(--fe-shadow);width:min(560px,calc(100vw - 32px));display:flex;flex-direction:column;overflow:hidden}.fe-cmdp__inputwrap{display:flex;align-items:center;gap:8px;padding:10px 14px;border-bottom:1px solid var(--fe-border);color:var(--fe-text-muted)}.fe-cmdp__glyph{flex:0 0 auto}.fe-cmdp__input{flex:1 1 auto;min-width:0;border:0;outline:none;background:transparent;color:var(--fe-text);font:inherit;font-size:15px}.fe-cmdp__input::placeholder{color:var(--fe-text-muted)}.fe-cmdp__list{max-height:min(48vh,380px);overflow-y:auto;padding:6px}.fe-cmdp__group{padding:8px 10px 4px;font-size:11px;font-weight:600;letter-spacing:.05em;text-transform:uppercase;color:var(--fe-text-muted)}.fe-cmdp__item{display:flex;align-items:center;gap:10px;width:100%;text-align:left;background:transparent;border:0;border-radius:var(--fe-radius-sm);padding:8px 10px;color:var(--fe-text);font:inherit;font-size:14px;cursor:pointer}.fe-cmdp__item.is-active{background:var(--fe-bg-selected)}.fe-cmdp__item:focus-visible{outline:2px solid var(--fe-primary);outline-offset:-2px}.fe-cmdp__icon{flex:0 0 auto;width:20px;text-align:center}.fe-cmdp__label{flex:1 1 auto;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.fe-cmdp__empty{padding:20px 12px;text-align:center;color:var(--fe-text-muted);font-size:13px}.fe-cmdp__hint{padding:8px 14px;border-top:1px solid var(--fe-border);background:var(--fe-bg-elev);font-size:11px;color:var(--fe-text-muted)}.fe-shortcuts{display:flex;flex-direction:column;gap:16px}.fe-shortcuts__heading{margin:0 0 6px;font-size:11px;font-weight:600;letter-spacing:.05em;text-transform:uppercase;color:var(--fe-text-muted)}.fe-shortcuts__table{display:flex;flex-direction:column}.fe-shortcuts__row{display:flex;align-items:center;gap:12px;padding:4px 0}.fe-shortcuts__keys{flex:0 0 40%;display:flex;align-items:center;gap:6px;flex-wrap:wrap}.fe-shortcuts__desc{flex:1 1 auto;font-size:13px;color:var(--fe-text)}.fe-shortcuts__or{color:var(--fe-text-muted);font-size:11px}.fe-kbd{display:inline-block;padding:2px 7px;border:1px solid var(--fe-border-strong);border-bottom-width:2px;border-radius:var(--fe-radius-sm);background:var(--fe-bg-elev);color:var(--fe-text);font-family:var(--fe-font-mono);font-size:11.5px;line-height:1.4}.fe-breadcrumb__more-wrap{position:relative;display:inline-flex;align-items:center;gap:4px}.fe-breadcrumb__more{background:transparent;border:0;color:inherit;padding:2px 8px;border-radius:var(--fe-radius-sm);cursor:pointer;font:inherit;line-height:1.2}.fe-breadcrumb__more:hover,.fe-breadcrumb__more[aria-expanded=true]{background:var(--fe-bg-hover);color:var(--fe-text)}.fe-breadcrumb__more:focus-visible{outline:2px solid var(--fe-primary);outline-offset:1px}.fe-breadcrumb__menu{position:absolute;top:calc(100% + 4px);left:0;z-index:80;min-width:160px;max-width:280px;max-height:40vh;overflow-y:auto;display:flex;flex-direction:column;padding:4px;background:var(--fe-bg);border:1px solid var(--fe-border);border-radius:var(--fe-radius);box-shadow:var(--fe-shadow)}.fe-breadcrumb__menu-item{text-align:left;background:transparent;border:0;padding:6px 10px;border-radius:var(--fe-radius-sm);color:var(--fe-text);font:inherit;font-size:13px;cursor:pointer;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.fe-breadcrumb__menu-item:hover,.fe-breadcrumb__menu-item:focus-visible{background:var(--fe-bg-hover)}.fe-breadcrumb__crumb>span:first-child{max-width:200px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}@media (max-width: 640px){.fe-breadcrumb__crumb>span:first-child{max-width:110px}}@media (prefers-reduced-motion: reduce){.fe-modal-enter-active,.fe-modal-leave-active{transition:none!important}}.fe-sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;border:0}.fe__skeleton{min-height:240px}.fe-skel{position:relative;overflow:hidden;border-radius:var(--fe-radius-sm);background:color-mix(in srgb,var(--fe-text-muted) 14%,transparent)}.fe-skel:after{content:"";position:absolute;top:0;right:0;bottom:0;left:0;transform:translate(-100%);background:linear-gradient(90deg,transparent,color-mix(in srgb,var(--fe-text-muted) 12%,transparent),transparent);animation:fe-skel-shimmer 1.4s ease-in-out infinite}@keyframes fe-skel-shimmer{to{transform:translate(100%)}}@media (prefers-reduced-motion: reduce){.fe-skel:after{animation:none;content:none}}.fe-skel-list{padding-top:2px}.fe-skel-row{display:grid;grid-template-columns:32px minmax(0,1fr) 120px 180px;gap:8px;align-items:center;padding:12px;border-bottom:1px solid var(--fe-border)}.fe-skel-row .fe-skel{height:12px}.fe-skel-row .fe-skel--icon{width:20px;height:20px;border-radius:6px}.fe-skel-row .fe-skel--name{width:55%}.fe-skel-row:nth-child(2n) .fe-skel--name{width:38%}.fe-skel-row:nth-child(3n) .fe-skel--name{width:70%}.fe-skel-row .fe-skel--size{width:56px;justify-self:start}.fe-skel-row .fe-skel--date{width:110px;justify-self:start}.fe-skel-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(140px,1fr));gap:var(--fe-gap);padding:var(--fe-gap)}.fe-skel-card{display:flex;flex-direction:column;gap:8px;padding:8px;border:1px solid var(--fe-border);border-radius:var(--fe-radius);background:var(--fe-bg-elev)}.fe-skel-card .fe-skel--thumb{aspect-ratio:1 / 1}.fe-skel-card .fe-skel--label{height:12px;width:70%}.fe-skel-card:nth-child(2n) .fe-skel--label{width:50%}.fe-skel-card:nth-child(3n) .fe-skel--label{width:85%}.fe-state{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:6px;min-height:240px;height:100%;padding:24px;text-align:center;color:var(--fe-text-muted)}.fe-state__art{color:var(--fe-text-muted);opacity:.7;margin-bottom:4px;flex:0 0 auto}.fe-state__title{margin:2px 0 0;font-size:15px;font-weight:600;color:var(--fe-text)}.fe-state__hint{margin:0;font-size:13px;max-width:420px}.fe-state__path{margin:0;font-size:12px;font-family:var(--fe-font-mono);word-break:break-all;max-width:480px}.fe-state__actions{margin-top:12px;display:flex;gap:8px}.fe-toast--action{display:flex;align-items:center;gap:14px;padding:8px 10px 8px 14px;cursor:pointer;max-width:min(480px,calc(100% - 32px))}.fe-toast__msg{min-width:0}.fe-toast__action{flex:0 0 auto;background:transparent;border:0;padding:4px 8px;border-radius:var(--fe-radius-sm);font:inherit;font-weight:600;color:color-mix(in srgb,var(--fe-primary) 70%,var(--fe-bg));cursor:pointer}.fe-toast__action:hover{background:color-mix(in srgb,var(--fe-bg) 14%,transparent)}.fe-toast__action:focus-visible{outline:2px solid var(--fe-bg);outline-offset:1px}.fe-connbadge{display:inline-flex;align-items:center;gap:6px;font-size:12px;line-height:1.4;color:var(--fe-text-muted);background:var(--fe-bg-elev);border:1px solid var(--fe-border);border-radius:999px;padding:2px 10px;cursor:help;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:100%}.fe-connbadge__dot{flex:0 0 auto;width:7px;height:7px;border-radius:50%;background:var(--fe-warning, #f59e0b)}.fe-cmdp__item--hit{align-items:flex-start}.fe-cmdp__item--hit .fe-cmdp__icon{margin-top:1px}.fe-cmdp__hitbody{flex:1 1 auto;min-width:0;display:flex;flex-direction:column;gap:2px}.fe-cmdp__hitline{display:flex;align-items:center;gap:8px;min-width:0}.fe-cmdp__badge,.fe-list__badge{flex:0 0 auto;display:inline-block;padding:1px 6px;border-radius:999px;border:1px solid color-mix(in srgb,var(--fe-primary) 35%,transparent);background:color-mix(in srgb,var(--fe-primary) 12%,transparent);color:var(--fe-primary);font-size:10px;font-weight:600;line-height:1.5;white-space:nowrap;vertical-align:middle}.fe-cmdp__crumb{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:11.5px;color:var(--fe-text-muted)}.fe-cmdp__snippet,.fe-list__snippet{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:12px;color:var(--fe-text-muted)}.fe-cmdp__mark,.fe-list__mark,.fe-grid__mark{background:color-mix(in srgb,var(--fe-primary) 22%,transparent);color:var(--fe-text);border-radius:2px;padding:0 1px;font-weight:600}.fe-cmdp__loading{padding:8px 12px;font-size:13px;color:var(--fe-text-muted)}.fe-cmdp__item--saved{-webkit-user-select:none;user-select:none}.fe-cmdp__del{flex:0 0 auto;background:transparent;border:0;border-radius:var(--fe-radius-sm);padding:2px 6px;font:inherit;font-size:13px;color:var(--fe-text-muted);cursor:pointer;opacity:.55}.fe-cmdp__item--saved:hover .fe-cmdp__del,.fe-cmdp__item--saved.is-active .fe-cmdp__del{opacity:1}.fe-cmdp__del:hover{background:var(--fe-bg-elev);color:var(--fe-danger, #dc2626)}.fe-cmdp__del:focus-visible{outline:2px solid var(--fe-primary);outline-offset:-2px}.fe-list__snippet{max-width:100%}.fe-toolbar--narrow{flex-wrap:nowrap;gap:6px}.fe-toolbar--narrow .fe-btn.is-active{background:var(--fe-bg-selected)}.fe-toolbar--narrow .fe-search--full{flex:1 1 auto;min-width:0}.fe-toolbar--narrow .fe-search--full .fe-search__input{width:100%;min-width:0}.fe-fab{position:absolute;right:16px;bottom:16px;width:56px;height:56px;border:0;border-radius:50%;background:var(--fe-primary);color:var(--fe-text-on-primary);font-size:24px;display:flex;align-items:center;justify-content:center;box-shadow:var(--fe-shadow);cursor:pointer;z-index:45;transition:background .15s,transform .15s}.fe-fab:hover{background:var(--fe-primary-hover)}.fe-fab:active{transform:scale(.94)}.fe-fab:focus-visible{outline:2px solid var(--fe-primary);outline-offset:3px}.fe--narrow .fe-upload,.fe--narrow .fe-ops{bottom:84px}.fe-ctx-backdrop--sheet{background:#0d131b6b}.fe-sheet{position:fixed;left:0;right:0;bottom:0;max-height:70vh;display:flex;flex-direction:column;background:var(--fe-bg);color:var(--fe-text);border:1px solid var(--fe-border);border-bottom:0;border-top-left-radius:var(--fe-radius-lg);border-top-right-radius:var(--fe-radius-lg);box-shadow:0 -10px 32px #0f172a47;padding:0 8px calc(8px + env(safe-area-inset-bottom,0px));outline:none;z-index:90}.fe-sheet__handle{flex:0 0 auto;display:flex;align-items:center;justify-content:center;padding:12px 0 8px;cursor:grab;touch-action:none}.fe-sheet__handle:before{content:"";width:40px;height:4px;border-radius:99px;background:var(--fe-border-strong)}.fe-sheet__items{overflow-y:auto;overscroll-behavior:contain;-webkit-overflow-scrolling:touch}.fe-sheet__item{min-height:44px;padding:10px 14px;font-size:15px;gap:12px}.fe-sheet-enter-active,.fe-sheet-leave-active{transition:opacity .18s ease}.fe-sheet-enter-active .fe-sheet,.fe-sheet-leave-active .fe-sheet{transition:transform .22s ease}.fe-sheet-enter-from,.fe-sheet-leave-to{opacity:0}.fe-sheet-enter-from .fe-sheet,.fe-sheet-leave-to .fe-sheet{transform:translateY(100%)}@media (prefers-reduced-motion: reduce){.fe-sheet-enter-active,.fe-sheet-leave-active,.fe-sheet-enter-active .fe-sheet,.fe-sheet-leave-active .fe-sheet,.fe-fab{transition:none}}.fe__main{display:flex;flex-direction:row;flex:1 1 auto;min-height:0}.fe__main>.fe__body{min-width:0;height:100%}.fe-inspector{flex:0 0 300px;width:300px;min-height:0;display:flex;flex-direction:column;border-left:1px solid var(--fe-border);background:var(--fe-bg);color:var(--fe-text)}.fe-inspector--overlay{position:absolute;top:0;right:0;bottom:0;left:0;z-index:60;width:auto;border-left:none}.fe-inspector__head{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:10px 12px;border-bottom:1px solid var(--fe-border);flex:0 0 auto}.fe-inspector__title{margin:0;font-size:13px;font-weight:600;letter-spacing:.02em}.fe-inspector__close{border:none;background:none;color:var(--fe-text-muted);font-size:18px;line-height:1;cursor:pointer;padding:2px 6px;border-radius:6px}.fe-inspector__close:hover{background:var(--fe-bg-hover);color:var(--fe-text)}.fe-inspector__scroll{flex:1 1 auto;min-height:0;overflow-y:auto;padding:12px}.fe-inspector__section{margin-bottom:18px}.fe-inspector__section:last-child{margin-bottom:0}.fe-inspector__heading{margin:0 0 8px;font-size:11px;font-weight:600;text-transform:uppercase;letter-spacing:.06em;color:var(--fe-text-muted)}.fe-inspector__hero{display:flex;flex-direction:column;align-items:center;gap:6px;text-align:center;padding:6px 0 4px}.fe-inspector__bigicon{display:inline-flex}.fe-inspector__bigicon .fe-ficon{width:56px;height:56px}.fe-inspector__thumb{width:96px;height:96px;object-fit:cover;border-radius:var(--fe-radius);border:1px solid var(--fe-border)}.fe-inspector__name{margin:0;font-size:13px;font-weight:600;word-break:break-word;max-width:100%}.fe-inspector__sub{margin:0;font-size:12px;color:var(--fe-text-muted)}.fe-inspector__meta{margin:8px 0 0;display:flex;flex-direction:column;gap:6px}.fe-inspector__row{display:flex;align-items:baseline;gap:8px;font-size:12px}.fe-inspector__row dt{flex:0 0 84px;color:var(--fe-text-muted)}.fe-inspector__row dd{margin:0;min-width:0;flex:1 1 auto;word-break:break-word}.fe-inspector__pathcell{display:flex;align-items:center;gap:4px}.fe-inspector__path{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;direction:rtl;text-align:left}.fe-inspector__mime{font-family:var(--fe-font-mono);font-size:11px}.fe-inspector__copy{flex:0 0 auto;border:none;background:none;color:var(--fe-text-muted);cursor:pointer;font-size:13px;line-height:1;padding:2px 4px;border-radius:4px}.fe-inspector__copy:hover{background:var(--fe-bg-hover);color:var(--fe-text)}.fe-inspector__empty{margin:0;font-size:12px;color:var(--fe-text-muted)}.fe-btn--sm{padding:3px 8px;font-size:12px}.fe-inspector__versions{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:8px}.fe-inspector__version{display:flex;flex-direction:column;gap:6px;padding:8px;border:1px solid var(--fe-border);border-radius:var(--fe-radius)}.fe-inspector__version-main{display:flex;flex-direction:column;gap:2px}.fe-inspector__version-n{font-size:12px;font-weight:600}.fe-inspector__version-meta{font-size:11px;color:var(--fe-text-muted)}.fe-inspector__confirm{display:flex;flex-direction:column;gap:6px}.fe-inspector__confirm-q{margin:0;font-size:12px}.fe-inspector__check{display:flex;align-items:center;gap:6px;font-size:11px;color:var(--fe-text-muted);cursor:pointer}.fe-inspector__confirm-actions{display:flex;gap:6px}.fe-inspector__snapshot{margin-top:8px;width:100%}.fe-inspector__permrow{display:flex;align-items:center;gap:8px;flex-wrap:wrap}.fe-inspector__badge{display:inline-flex;align-items:center;padding:2px 8px;border-radius:99px;font-size:11px;font-weight:600;border:1px solid var(--fe-border-strong);color:var(--fe-text);background:var(--fe-bg-hover)}.fe-inspector__badge--owner{border-color:var(--fe-primary);color:var(--fe-primary);background:transparent}.fe-inspector__badge--none{color:var(--fe-text-muted)}.fe-inspector__badge--pin{border-color:var(--fe-warning, #f59e0b);color:var(--fe-warning, #f59e0b);background:transparent}.fe-inspector__shares{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:6px}.fe-inspector__share{display:flex;align-items:center;gap:6px;font-size:12px;min-width:0}.fe-inspector__share-url{flex:1 1 auto;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.fe-inspector__share-exp{flex:0 0 auto;font-size:11px;color:var(--fe-text-muted)}@media (prefers-reduced-motion: no-preference){.fe-inspector{animation:fe-inspector-in .16s ease}@keyframes fe-inspector-in{0%{opacity:0;transform:translate(8px)}to{opacity:1;transform:none}}}.fe-shortcuts__unbound{font-size:12px;font-style:italic;color:var(--fe-text-muted)}.fe-shortcuts__custom{margin-left:4px;font-size:9px;vertical-align:2px;color:var(--fe-primary)}.fe-shortset{display:flex;flex-direction:column;gap:14px}.fe-shortset__topbar{display:flex;align-items:center;justify-content:space-between;gap:12px}.fe-shortset__hint{margin:0;font-size:12px;color:var(--fe-text-muted);flex:1 1 auto}.fe-shortset__reset-all{flex:0 0 auto}.fe-shortset__group{display:flex;flex-direction:column}.fe-shortset__item{border-radius:var(--fe-radius-sm);padding:2px 6px;margin:0 -6px}.fe-shortset__item.is-capturing{background:var(--fe-bg-hover);outline:1px dashed var(--fe-primary);outline-offset:-1px}.fe-shortset__item.is-conflict{background:color-mix(in srgb,var(--fe-danger) 8%,transparent);outline:1px solid var(--fe-danger);outline-offset:-1px}.fe-shortset__row{display:flex;align-items:center;gap:12px;padding:4px 0;min-height:34px}.fe-shortset__label{flex:1 1 auto;font-size:13px;color:var(--fe-text)}.fe-shortset__keys{flex:0 0 auto;display:flex;align-items:center;gap:6px;flex-wrap:wrap;justify-content:flex-end}.fe-shortset__capture{font-size:12px;color:var(--fe-primary);animation:fe-shortset-blink 1.1s ease-in-out infinite}@keyframes fe-shortset-blink{0%,to{opacity:1}50%{opacity:.45}}.fe-shortset__actions{flex:0 0 auto;display:flex;align-items:center;gap:6px;min-width:118px;justify-content:flex-end}.fe-shortset__btn{padding:3px 9px;font-size:12px}.fe-shortset__fixed{font-size:11px;text-transform:uppercase;letter-spacing:.04em;color:var(--fe-text-muted);border:1px solid var(--fe-border);border-radius:var(--fe-radius-sm);padding:2px 7px}.fe-shortset__conflict{display:flex;align-items:center;gap:10px;flex-wrap:wrap;padding:6px 2px 8px;font-size:12.5px;color:var(--fe-danger)}.fe-shortset__conflict-msg{flex:1 1 auto;display:inline-flex;align-items:center;gap:6px;min-width:200px}.fe-shortset__conflict-actions{flex:0 0 auto;display:flex;gap:6px}.fe-ql-hint{position:fixed;left:50%;bottom:14px;transform:translate(-50%);z-index:72;display:inline-flex;flex-direction:row;align-items:center;width:auto;height:auto;min-height:0;gap:6px;padding:6px 12px;border-radius:999px;border:1px solid var(--fe-border);background:var(--fe-bg-elev);color:var(--fe-text-muted);font-size:12px;box-shadow:var(--fe-shadow);pointer-events:none;white-space:nowrap}.fe-ql-hint .fe-kbd{font-size:10.5px;padding:1px 5px}.fe-ql-hint__sep{opacity:.5}.fe-opc{position:absolute;right:16px;bottom:16px;z-index:45;display:flex;flex-direction:column;align-items:flex-end;gap:10px;max-width:calc(100% - 32px)}.fe-opc__badge{display:flex;align-items:center;gap:8px;padding:8px 14px 8px 10px;border-radius:999px;border:1px solid var(--fe-border);background:var(--fe-bg);color:var(--fe-text);box-shadow:var(--fe-shadow);cursor:pointer;font:inherit;font-size:13px;line-height:1}.fe-opc__badge:hover{background:var(--fe-bg-hover)}.fe-opc__badge:focus-visible{outline:2px solid var(--fe-primary);outline-offset:2px}.fe-opc__badge.is-error{border-color:var(--fe-danger)}.fe-opc__badge.is-error .fe-opc__count{color:var(--fe-danger)}.fe-opc__ring{width:22px;height:22px;flex:0 0 auto}.fe-opc__ring-track{stroke:var(--fe-border-strong)}.fe-opc__ring-fill{stroke:var(--fe-primary);transition:stroke-dashoffset .25s}.fe-opc__badge.is-error .fe-opc__ring-fill{stroke:var(--fe-danger)}.fe-opc__ring--spin{animation:fe-opc-spin 1s linear infinite}@keyframes fe-opc-spin{to{transform:rotate(360deg)}}.fe-opc__count{font-weight:600}.fe-opc__pct{color:var(--fe-text-muted);font-size:12px}.fe-opc__panel{width:min(380px,calc(100vw - 32px));max-width:100%;max-height:min(420px,60vh);display:flex;flex-direction:column;overflow:hidden;background:var(--fe-bg);border:1px solid var(--fe-border);border-radius:var(--fe-radius-lg);box-shadow:var(--fe-shadow)}.fe-opc__head{display:flex;align-items:center;justify-content:space-between;padding:10px 14px;background:var(--fe-bg-elev);border-bottom:1px solid var(--fe-border);font-size:13px}.fe-opc__body{overflow:auto;padding:6px 0 8px}.fe-opc__section+.fe-opc__section{border-top:1px solid var(--fe-border);margin-top:6px}.fe-opc__section-title{display:flex;align-items:center;justify-content:space-between;margin:0;padding:8px 14px 4px;font-size:11px;font-weight:600;text-transform:uppercase;letter-spacing:.04em;color:var(--fe-text-muted)}.fe-opc__list{list-style:none;margin:0;padding:0}.fe-opc__item{display:flex;align-items:flex-start;gap:10px;padding:8px 14px}.fe-opc__item+.fe-opc__item{border-top:1px solid var(--fe-border)}.fe-opc__item.is-error{background:color-mix(in srgb,var(--fe-danger) 7%,transparent)}.fe-opc__kicon{width:18px;height:18px;flex:0 0 auto;margin-top:2px;color:var(--fe-text-muted)}.fe-opc__item.is-error .fe-opc__kicon{color:var(--fe-danger)}.fe-opc__mid{flex:1 1 auto;min-width:0}.fe-opc__name{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:13px}.fe-opc__sub{display:flex;align-items:baseline;gap:5px;font-size:11px;color:var(--fe-text-muted);margin-top:1px;min-width:0}.fe-opc__sub--err,.fe-opc__item.is-error .fe-opc__state{color:var(--fe-danger)}.fe-opc__state{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.fe-opc__bar{background:var(--fe-bg-elev);border-radius:99px;height:5px;overflow:hidden;margin-top:5px}.fe-opc__bar-fill{background:var(--fe-primary);height:100%;transition:width .2s}.fe-opc__spin{flex:0 0 auto;width:14px;height:14px;margin-top:4px;border-radius:50%;border:2px solid var(--fe-border-strong);border-top-color:var(--fe-primary);animation:fe-opc-spin .8s linear infinite}.fe-opc__acts{display:flex;align-items:center;gap:2px;flex:0 0 auto}.fe-opc__act{background:transparent;border:0;color:var(--fe-primary);cursor:pointer;font:inherit;font-size:12px;padding:2px 4px;border-radius:var(--fe-radius-sm)}.fe-opc__act:hover{background:var(--fe-bg-hover)}.fe-opc__act--retry{font-weight:600}.fe-opc__x{background:transparent;border:0;color:var(--fe-text-muted);cursor:pointer;font-size:16px;line-height:1;padding:0 4px;border-radius:var(--fe-radius-sm)}.fe-opc__x:hover{color:var(--fe-text)}.fe-opc__item--history .fe-opc__name{font-size:12px;color:var(--fe-text-muted)}.fe-opc__chip{flex:0 0 auto;font-size:10px;font-weight:600;padding:2px 7px;border-radius:999px;background:var(--fe-bg-elev);color:var(--fe-text-muted)}.fe-opc__chip.is-done{color:var(--fe-ok, #16a34a);background:color-mix(in srgb,var(--fe-ok, #16a34a) 12%,transparent)}.fe-opc__chip.is-error{color:var(--fe-danger);background:color-mix(in srgb,var(--fe-danger) 12%,transparent)}.fe-opc__item.is-done .fe-opc__bar-fill{background:var(--fe-ok, #16a34a)}.fe-opc__empty{margin:0;padding:16px 14px;font-size:12px;color:var(--fe-text-muted);text-align:center}.fe-opc-pop-enter-active,.fe-opc-pop-leave-active{transition:transform .16s ease,opacity .16s ease}.fe-opc-pop-enter-from,.fe-opc-pop-leave-to{opacity:0;transform:translateY(8px) scale(.98)}.fe--narrow .fe-opc{left:12px;right:12px;bottom:84px;max-width:none}.fe--narrow .fe-opc__panel{width:100%;max-height:50vh}@media (prefers-reduced-motion: reduce){.fe-opc__ring--spin,.fe-opc__spin{animation-duration:3s}.fe-opc-pop-enter-active,.fe-opc-pop-leave-active{transition:none}}======= .fe-grid__card:focus-visible{outline:2px solid var(--fe-primary);outline-offset:2px}.fe-ctx__item:focus-visible{outline:2px solid var(--fe-primary);outline-offset:-2px;background:var(--fe-bg-hover)}.fe-list__row.is-droptarget,.fe-grid__card.is-droptarget{outline:2px dashed var(--fe-primary);outline-offset:-2px;background:var(--fe-bg-selected)}.fe-grid__card.is-droptarget{border-color:var(--fe-primary)}.fe-dragghost{display:inline-flex;align-items:center;gap:8px;max-width:260px;padding:6px 10px;border:1px solid var(--fe-border-strong);border-radius:var(--fe-radius);background:var(--fe-bg-elev);color:var(--fe-text);font-family:var(--fe-font);font-size:13px;box-shadow:var(--fe-shadow-sm);pointer-events:none;z-index:96}.fe-dragghost__name{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.fe-dragghost__badge{flex:0 0 auto;min-width:20px;padding:1px 6px;border-radius:999px;background:var(--fe-primary);color:var(--fe-text-on-primary);font-size:12px;font-weight:600;text-align:center}.fe-state__details{margin-top:10px;max-width:480px;font-size:12px;text-align:left}.fe-state__details-summary{cursor:pointer;text-align:center;color:var(--fe-text-muted);-webkit-user-select:none;user-select:none}.fe-state__details-summary:focus-visible{outline:2px solid var(--fe-primary);outline-offset:2px}.fe-state__details-pre{margin:8px 0 0;padding:8px 10px;border:1px solid var(--fe-border);border-radius:var(--fe-radius-sm);background:var(--fe-bg-elev);font-family:var(--fe-font-mono);font-size:11px;white-space:pre-wrap;word-break:break-word;max-height:160px;overflow:auto}.fe-tour{position:fixed;top:0;right:0;bottom:0;left:0;z-index:96;color:var(--fe-text);font-family:var(--fe-font);font-size:14px}.fe-tour__spot{position:fixed;border-radius:10px;box-shadow:0 0 0 9999px #0d131b8c;border:2px solid var(--fe-primary);pointer-events:none}.fe-tour__dim{position:fixed;top:0;right:0;bottom:0;left:0;background:#0d131b8c;pointer-events:none}.fe-tour__card{position:fixed;display:flex;flex-direction:column;gap:6px;padding:14px 16px;border:1px solid var(--fe-border-strong);border-radius:var(--fe-radius-lg);background:var(--fe-bg);color:var(--fe-text);box-shadow:var(--fe-shadow);outline:none}.fe-tour__card--center{top:50%;left:50%;transform:translate(-50%,-50%);width:min(360px,calc(100vw - 24px))}.fe-tour__progress{margin:0;font-size:11px;font-weight:600;letter-spacing:.06em;color:var(--fe-text-muted)}.fe-tour__title{margin:0;font-size:15px;font-weight:700}.fe-tour__desc{margin:0;font-size:13px;line-height:1.5;color:var(--fe-text-muted)}.fe-tour__dots{display:flex;gap:5px;margin-top:4px}.fe-tour__dot{width:7px;height:7px;border-radius:50%;background:var(--fe-border-strong);transition:background .15s}.fe-tour__dot.is-active{background:var(--fe-primary)}.fe-tour__actions{display:flex;align-items:center;gap:8px;margin-top:8px}.fe-tour__actions-spacer{flex:1 1 auto}.fe-tour__skip{color:var(--fe-text-muted)}.fe-tour-enter-active,.fe-tour-leave-active{transition:opacity .16s ease}.fe-tour-enter-from,.fe-tour-leave-to{opacity:0}@media (prefers-reduced-motion: reduce){.fe-tour-enter-active,.fe-tour-leave-active,.fe-ctx-enter-active,.fe-ctx-leave-active,.fe-sheet-enter-active,.fe-sheet-leave-active,.fe-toast-enter-active,.fe-toast-leave-active,.fe-list__row,.fe-grid__card,.fe-tour__dot,.fe-list__col--star{transition:none!important}}.fe-tabs{display:flex;align-items:stretch;gap:4px;flex:0 0 auto;padding:4px 6px 0;background:var(--fe-bg-elev);border-bottom:1px solid var(--fe-border);-webkit-user-select:none;user-select:none}.fe-tabs__scroll{display:flex;align-items:stretch;gap:2px;flex:1 1 auto;min-width:0;overflow-x:auto;scrollbar-width:none}.fe-tabs__scroll::-webkit-scrollbar{display:none}.fe-tabs__tab{display:flex;align-items:center;gap:6px;max-width:180px;min-width:72px;padding:4px 6px 4px 10px;font-size:12px;color:var(--fe-text-muted);background:transparent;border:1px solid transparent;border-bottom:none;border-radius:8px 8px 0 0;cursor:pointer;white-space:nowrap;position:relative}.fe-tabs__tab:hover{background:var(--fe-bg-hover);color:var(--fe-text)}.fe-tabs__tab.is-active{background:var(--fe-bg);color:var(--fe-text);border-color:var(--fe-border)}.fe-tabs__tab.is-active:after{content:"";position:absolute;left:0;right:0;bottom:-1px;height:1px;background:var(--fe-bg)}.fe-tabs__tab.is-dragover{outline:1px dashed var(--fe-primary);outline-offset:-2px}.fe-tabs__tab:focus-visible{outline:2px solid var(--fe-primary);outline-offset:-2px}.fe-tabs__label{overflow:hidden;text-overflow:ellipsis;flex:1 1 auto;min-width:0}.fe-tabs__splitdot{width:6px;height:6px;border-radius:2px;background:var(--fe-primary);flex:0 0 auto}.fe-tabs__close{flex:0 0 auto;width:16px;height:16px;line-height:1;display:inline-flex;align-items:center;justify-content:center;border:none;border-radius:4px;background:transparent;color:inherit;font-size:13px;cursor:pointer;padding:0}.fe-tabs__close:hover{background:var(--fe-bg-hover)}.fe-tabs__new,.fe-tabs__split{flex:0 0 auto;align-self:center;width:22px;height:22px;display:inline-flex;align-items:center;justify-content:center;border:1px solid transparent;border-radius:6px;background:transparent;color:var(--fe-text-muted);font-size:15px;cursor:pointer;padding:0}.fe-tabs__split .fe-ficon{width:14px;height:14px}.fe-tabs__new:hover,.fe-tabs__split:hover{background:var(--fe-bg-hover);color:var(--fe-text)}.fe-tabs__split.is-active{background:var(--fe-bg-selected);color:var(--fe-primary);border-color:var(--fe-border)}.fe--narrow .fe-tabs__split{display:none}.fe__primary{display:flex;flex-direction:column;flex:1 1 auto;min-width:0;min-height:0}.fe__primary>.fe__body{min-width:0}.fe__main--split>.fe__primary{flex:1 1 50%}.fe-split{flex:1 1 50%;min-width:0;min-height:0;display:flex;flex-direction:column;border-left:1px solid var(--fe-border);background:var(--fe-bg);color:var(--fe-text)}.fe__main--split>.fe__primary,.fe-split{box-shadow:inset 0 2px 0 transparent}.fe__main--split>.fe__primary.fe-pane--focus,.fe-split.fe-pane--focus{box-shadow:inset 0 2px 0 var(--fe-primary)}.fe-split__crumbs{display:flex;align-items:center;gap:4px;flex:0 0 auto;padding:6px 12px;min-height:37px;border-bottom:1px solid var(--fe-border);font-size:13px;color:var(--fe-text-muted);overflow:hidden;white-space:nowrap}.fe-split__crumb{border:none;background:transparent;color:inherit;font:inherit;padding:2px 6px;border-radius:var(--fe-radius-sm);cursor:pointer;max-width:140px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.fe-split__crumb:hover{background:var(--fe-bg-hover);color:var(--fe-text)}.fe-split__crumb.is-last{color:var(--fe-text);font-weight:600}.fe-split__sep{opacity:.6;flex:0 0 auto}.fe-split__spacer{flex:1 1 auto}.fe-split__closebtn{flex:0 0 auto;width:20px;height:20px;display:inline-flex;align-items:center;justify-content:center;border:none;border-radius:5px;background:transparent;color:var(--fe-text-muted);font-size:14px;cursor:pointer;padding:0}.fe-split__closebtn:hover{background:var(--fe-bg-hover);color:var(--fe-text)}.fe-split__body{flex:1 1 auto;min-height:0;overflow:auto;position:relative}.fe-split__body.is-dropover{outline:2px dashed var(--fe-primary);outline-offset:-4px}.fe-split__list{padding:4px 0}.fe-split__row{display:flex;align-items:center;gap:8px;padding:5px 10px;font-size:13px;cursor:default}.fe-split__row:hover{background:var(--fe-bg-hover)}.fe-split__row.is-selected{background:var(--fe-bg-selected)}.fe-split__row.is-droptarget{outline:1.5px dashed var(--fe-primary);outline-offset:-2px;border-radius:6px}.fe-split__row:focus-visible{outline:2px solid var(--fe-primary);outline-offset:-2px}.fe-split__icon{flex:0 0 auto;width:18px;height:18px;display:inline-flex;align-items:center;justify-content:center;font-size:16px}.fe-split__icon .fe-ficon{width:16px;height:16px}.fe-split__name{flex:1 1 auto;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.fe-split__size{flex:0 0 auto;color:var(--fe-text-muted);font-size:11.5px}.fe-split__state{padding:24px 12px;text-align:center;color:var(--fe-text-muted);font-size:12.5px;display:flex;flex-direction:column;gap:10px;align-items:center}.fe-gal{display:grid;grid-template-columns:repeat(auto-fill,minmax(190px,1fr));gap:var(--fe-gap);padding:var(--fe-gap)}.fe-gal__card{display:flex;flex-direction:column;align-items:stretch;border:1px solid var(--fe-border);border-radius:var(--fe-radius);background:var(--fe-bg-elev);cursor:pointer;overflow:hidden;transition:background .08s,border-color .08s;-webkit-user-select:none;user-select:none}.fe-gal__card:hover{background:var(--fe-bg-hover);border-color:var(--fe-border-strong)}.fe-gal__card.is-selected{background:var(--fe-bg-selected);border-color:var(--fe-primary)}.fe-gal__card.is-trash{opacity:.7}.fe-gal__card.is-clipped{opacity:.55;border-style:dashed}.fe-gal__card:focus-visible{outline:2px solid var(--fe-primary);outline-offset:2px}.fe-gal__card.is-droptarget{outline:2px dashed var(--fe-primary);outline-offset:-2px;background:var(--fe-bg-selected);border-color:var(--fe-primary)}.fe-gal__thumb{position:relative;display:flex;align-items:center;justify-content:center;aspect-ratio:1 / 1;background:var(--fe-bg);overflow:hidden}.fe-gal__thumb img{width:100%;height:100%;object-fit:cover}.fe-gal__icon{font-size:44px}.fe-gal__icon--svg svg{width:64px;height:64px}.fe-gal__meta{position:absolute;left:0;right:0;bottom:0;display:flex;flex-direction:column;gap:1px;padding:6px 8px;font-size:11px;line-height:1.35;color:var(--fe-text);background:color-mix(in srgb,var(--fe-bg-elev) 88%,transparent);-webkit-backdrop-filter:blur(2px);backdrop-filter:blur(2px);opacity:0;transform:translateY(4px);transition:opacity .12s ease,transform .12s ease;pointer-events:none}.fe-gal__card:hover .fe-gal__meta,.fe-gal__card:focus-visible .fe-gal__meta{opacity:1;transform:translateY(0)}.fe-gal__meta-line{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.fe-gal__meta-line--path{color:var(--fe-text-muted);font-style:italic}.fe-gal__label{padding:7px 9px;font-size:13px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;text-align:center}.fe-gal__empty{grid-column:1 / -1;padding:40px 20px;text-align:center;color:var(--fe-text-muted)}.fe--narrow .fe-gal{grid-template-columns:repeat(auto-fill,minmax(130px,1fr))}.fe--density-compact .fe-gal{grid-template-columns:repeat(auto-fill,minmax(150px,1fr));gap:calc(var(--fe-gap) * .6)}.fe--density-compact .fe-gal__label{padding:5px 7px;font-size:12px}@media (prefers-reduced-motion: reduce){.fe-gal__card,.fe-gal__meta{transition:none!important;transform:none}}.fe-inspector__countbadge{display:inline-flex;align-items:center;justify-content:center;min-width:16px;height:16px;padding:0 4px;margin-left:6px;border-radius:8px;font-size:10px;font-weight:600;letter-spacing:0;background:var(--fe-bg-hover);color:var(--fe-text);vertical-align:middle}.fe-inspector__comments{list-style:none;margin:0 0 8px;padding:0;display:flex;flex-direction:column;gap:8px}.fe-inspector__comment{border:1px solid var(--fe-border);border-radius:8px;padding:6px 8px;background:var(--fe-bg)}.fe-inspector__comment-top{display:flex;align-items:baseline;gap:6px;min-width:0}.fe-inspector__comment-author{font-size:12px;font-weight:600;color:var(--fe-text);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:0}.fe-inspector__comment-time{font-size:11px;color:var(--fe-text-muted);flex:1 1 auto;white-space:nowrap}.fe-inspector__comment-del{border:none;background:none;color:var(--fe-text-muted);font-size:14px;line-height:1;cursor:pointer;padding:0 4px;border-radius:4px;flex:0 0 auto}.fe-inspector__comment-del:hover{background:var(--fe-bg-hover);color:var(--fe-danger)}.fe-inspector__comment-del:disabled{opacity:.5;cursor:default}.fe-inspector__comment-body{margin:4px 0 0;font-size:12px;line-height:1.45;color:var(--fe-text);overflow-wrap:anywhere;white-space:pre-wrap}.fe-inspector__comment-form{display:flex;gap:6px;align-items:center}.fe-inspector__comment-input{flex:1 1 auto;min-width:0;border:1px solid var(--fe-border);border-radius:8px;background:var(--fe-bg);color:var(--fe-text);font:inherit;font-size:12px;padding:6px 8px}.fe-inspector__comment-input:focus{outline:none;border-color:var(--fe-accent)}.fe-inspector__comment-input:disabled{opacity:.6}.fe-e2e-strip{display:flex;align-items:center;gap:8px;padding:4px 12px;font-size:12.5px;color:var(--fe-text-muted);border-bottom:1px solid var(--fe-border);background:var(--fe-bg-elev)}.fe-e2e-strip__icon{font-size:13px;line-height:1}.fe-e2e-strip__label{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.fe-e2e-strip__btn{padding:2px 10px;font-size:12px}.fe-e2e-lock__form{display:flex;gap:8px;align-items:stretch;margin-top:12px;width:min(340px,100%)}.fe-e2e-lock__input{flex:1;min-width:0}.fe-e2e-form{display:flex;flex-direction:column;gap:10px}.fe-e2e-warn{border:1px solid var(--fe-danger);border-radius:var(--fe-radius-sm);padding:8px 10px;font-size:12.5px;color:var(--fe-text);background:color-mix(in srgb,var(--fe-danger) 8%,transparent)}.fe-e2e-warn strong{display:block;color:var(--fe-danger);margin-bottom:2px}.fe-e2e-warn p{margin:0;color:var(--fe-text-muted)}.fe-e2e-ack{display:flex;align-items:flex-start;gap:8px;font-size:12.5px;color:var(--fe-text);cursor:pointer}.fe-e2e-ack input{margin-top:2px;accent-color:var(--fe-primary)}.fe-e2e-optlink{margin-top:10px;padding:0;border:none;background:none;font:inherit;font-size:12.5px;color:var(--fe-primary);cursor:pointer;text-align:left}.fe-e2e-optlink:hover{text-decoration:underline}.fe:not(.fe--narrow) .fe-toolbar{flex-wrap:nowrap}.fe:not(.fe--narrow) .fe-toolbar__primary{flex:1 1 auto;min-width:0;flex-wrap:nowrap;overflow:hidden;position:relative}.fe-toolbar__measure{position:absolute;visibility:hidden;pointer-events:none;height:0;overflow:hidden;display:flex;gap:8px;white-space:nowrap}.fe-toolbar__measure .fe-btn{flex:none}.filex-viewer-3d[data-v-f9492fd4]{width:100%;height:100%;min-height:480px;background:#1a1a1a;display:flex;align-items:center;justify-content:center}.filex-viewer-3d[data-v-f9492fd4] model-viewer{width:100%;height:100%;min-height:480px;background:#1a1a1a;display:block}.filex-viewer-fallback[data-v-f9492fd4]{text-align:center;color:#c8cdd6;padding:32px;max-width:480px}.filex-viewer-fallback__icon[data-v-f9492fd4]{font-size:48px;display:block;margin-bottom:12px}.filex-viewer-epub__nav[data-v-12eb7133]{position:absolute;bottom:12px;left:50%;transform:translate(-50%);display:flex;gap:8px;padding:4px 8px;background:var(--fe-bg-elev, rgba(255, 255, 255, .9));border:1px solid var(--fe-border, #e2e6ed);border-radius:6px;-webkit-backdrop-filter:blur(4px);backdrop-filter:blur(4px)}.filex-viewer-epub[data-v-12eb7133]{display:flex;flex-direction:column;width:100%;height:100%;min-height:70vh;background:var(--fe-bg, #fff);color:var(--fe-text, #1a1e27);position:relative}.filex-viewer-epub__bar[data-v-12eb7133]{display:flex;align-items:center;gap:6px;padding:8px 12px;background:var(--fe-bg-elev, #f7f8fa);border-bottom:1px solid var(--fe-border, #e2e6ed);font-size:13px}.filex-viewer-spacer[data-v-12eb7133]{flex:1}.filex-viewer-epub__fs[data-v-12eb7133]{display:inline-block;min-width:40px;text-align:center;font-variant-numeric:tabular-nums;font-size:12px;color:var(--fe-text-muted, #5a6475)}.filex-viewer-epub__main[data-v-12eb7133]{flex:1;min-height:0;display:flex}.filex-viewer-epub__rendition[data-v-12eb7133]{flex:1;min-height:0}.filex-viewer-epub__toc[data-v-12eb7133]{width:260px;border-right:1px solid var(--fe-border, #e2e6ed);overflow-y:auto;padding:12px 0;background:var(--fe-bg-elev, #f7f8fa)}.filex-viewer-epub__toc ul[data-v-12eb7133]{list-style:none;margin:0;padding:0}.filex-viewer-epub__toc-link[data-v-12eb7133]{display:block;width:100%;text-align:left;background:transparent;border:0;padding:6px 14px;font:inherit;color:inherit;cursor:pointer}.filex-viewer-epub__toc-link[data-v-12eb7133]:hover{background:var(--fe-bg-hover, #edf0f5)}.filex-viewer-epub__toc-link.is-child[data-v-12eb7133]{padding-left:28px;color:var(--fe-text-muted, #5a6475);font-size:12px}.filex-viewer-epub__loading[data-v-12eb7133]{position:absolute;inset:auto 0 0 0;text-align:center;padding:6px;background:#0000000d;font-size:12px;color:var(--fe-text-muted, #5a6475)}.filex-viewer-fallback[data-v-12eb7133]{text-align:center;padding:32px;color:var(--fe-text-muted, #5a6475)}.filex-viewer-fallback__icon[data-v-12eb7133]{font-size:48px;display:block;margin-bottom:12px}.filex-viewer-btn[data-v-12eb7133]{border:1px solid var(--fe-border, #e2e6ed);background:var(--fe-bg, #fff);color:var(--fe-text, #1a1e27);padding:4px 10px;border-radius:4px;cursor:pointer;font:inherit;font-size:12px}.filex-viewer-btn[data-v-12eb7133]:hover:not(:disabled){background:var(--fe-bg-hover, #edf0f5)}.filex-viewer-btn[data-v-12eb7133]:disabled{opacity:.5;cursor:not-allowed}.filex-viewer-mermaid[data-v-939eea2b]{display:flex;flex-direction:column;width:100%;height:100%;min-height:70vh;background:var(--fe-bg, #fff);color:var(--fe-text, #1a1e27)}.filex-viewer-mermaid__bar[data-v-939eea2b]{display:flex;align-items:center;gap:6px;padding:8px 12px;background:var(--fe-bg-elev, #f7f8fa);border-bottom:1px solid var(--fe-border, #e2e6ed);font-size:13px}.filex-viewer-mermaid__zoom[data-v-939eea2b]{min-width:50px;text-align:center;font-variant-numeric:tabular-nums;font-size:12px}.filex-viewer-mermaid__pane[data-v-939eea2b]{flex:1;overflow:hidden;position:relative;cursor:grab;background:var(--fe-bg-elev, #f7f8fa);touch-action:none}.filex-viewer-mermaid__pane[data-v-939eea2b]:active{cursor:grabbing}.filex-viewer-mermaid__surface[data-v-939eea2b]{position:absolute;top:0;right:0;bottom:0;left:0;display:flex;align-items:center;justify-content:center;transform-origin:center center;transition:transform .05s linear;-webkit-user-select:none;user-select:none}.filex-viewer-mermaid__surface[data-v-939eea2b] svg{max-width:90%;max-height:90%}.filex-viewer-fallback[data-v-939eea2b]{text-align:center;padding:32px;color:var(--fe-text-muted, #5a6475);width:100%;display:flex;flex-direction:column;align-items:center;justify-content:center}.filex-viewer-fallback__icon[data-v-939eea2b]{font-size:48px;display:block;margin-bottom:12px}.filex-viewer-btn[data-v-939eea2b]{border:1px solid var(--fe-border, #e2e6ed);background:var(--fe-bg, #fff);color:var(--fe-text, #1a1e27);padding:4px 10px;border-radius:4px;cursor:pointer;font:inherit;font-size:12px}.filex-viewer-btn[data-v-939eea2b]:hover:not(:disabled){background:var(--fe-bg-hover, #edf0f5)}.filex-viewer-drawio[data-v-2e4b5f3b]{display:flex;flex-direction:column;width:100%;height:100%;min-height:70vh;background:var(--fe-bg, #fff)}.filex-viewer-drawio__bar[data-v-2e4b5f3b]{display:flex;align-items:center;gap:12px;padding:6px 12px;background:var(--fe-bg-elev, #f7f8fa);border-bottom:1px solid var(--fe-border, #e2e6ed);font-size:12px;color:var(--fe-text-muted, #5a6475)}.filex-viewer-drawio__status[data-state=error][data-v-2e4b5f3b]{color:var(--fe-danger, #dc2626)}.filex-viewer-drawio__status[data-state=saved][data-v-2e4b5f3b]{color:#059669}.filex-viewer-drawio__readonly[data-v-2e4b5f3b]{font-style:italic;margin-left:auto}.filex-viewer-drawio__frame[data-v-2e4b5f3b]{flex:1;width:100%;border:0;background:#fafafa;min-height:0}.filex-viewer-fallback[data-v-2e4b5f3b]{text-align:center;padding:32px;color:var(--fe-text-muted, #5a6475)}.filex-viewer-fallback__icon[data-v-2e4b5f3b]{font-size:48px;display:block;margin-bottom:12px}.filex-viewer-tiff__pager[data-v-c6b84f5d]{position:absolute;bottom:12px;left:50%;transform:translate(-50%);display:flex;align-items:center;gap:8px;padding:4px 8px;background:var(--fe-bg-elev, rgba(255, 255, 255, .9));border:1px solid var(--fe-border, #e2e6ed);border-radius:6px;-webkit-backdrop-filter:blur(4px);backdrop-filter:blur(4px)}.filex-viewer-tiff__pages[data-v-c6b84f5d]{font-size:12px;font-variant-numeric:tabular-nums}.filex-viewer-tiff[data-v-c6b84f5d]{display:flex;flex-direction:column;width:100%;height:100%;min-height:70vh;background:var(--fe-bg, #fff)}.filex-viewer-tiff__bar[data-v-c6b84f5d]{display:flex;align-items:center;gap:6px;padding:8px 12px;background:var(--fe-bg-elev, #f7f8fa);border-bottom:1px solid var(--fe-border, #e2e6ed);font-size:13px}.filex-viewer-tiff__pages[data-v-c6b84f5d]{min-width:110px;text-align:center;font-variant-numeric:tabular-nums;font-size:12px}.filex-viewer-tiff__zoom[data-v-c6b84f5d]{min-width:50px;text-align:center;font-variant-numeric:tabular-nums;font-size:12px}.filex-viewer-spacer[data-v-c6b84f5d]{flex:1}.filex-viewer-tiff__pane[data-v-c6b84f5d]{flex:1;overflow:auto;padding:16px;background:#2a2d33;display:flex;align-items:flex-start;justify-content:flex-start}.filex-viewer-tiff__pane canvas[data-v-c6b84f5d]{background:#fff;box-shadow:0 4px 16px #0000004d}.filex-viewer-fallback[data-v-c6b84f5d]{text-align:center;padding:32px;color:#c8cdd6;margin:auto}.filex-viewer-fallback__icon[data-v-c6b84f5d]{font-size:48px;display:block;margin-bottom:12px}.filex-viewer-btn[data-v-c6b84f5d]{border:1px solid var(--fe-border, #e2e6ed);background:var(--fe-bg, #fff);color:var(--fe-text, #1a1e27);padding:4px 10px;border-radius:4px;cursor:pointer;font:inherit;font-size:12px}.filex-viewer-btn[data-v-c6b84f5d]:hover:not(:disabled){background:var(--fe-bg-hover, #edf0f5)}.filex-viewer-btn[data-v-c6b84f5d]:disabled{opacity:.4;cursor:not-allowed}.filex-viewer-psd[data-v-001123c3]{display:flex;flex-direction:column;width:100%;height:100%;min-height:70vh;background:var(--fe-bg, #fff)}.filex-viewer-psd__bar[data-v-001123c3]{display:flex;align-items:center;gap:6px;padding:8px 12px;background:var(--fe-bg-elev, #f7f8fa);border-bottom:1px solid var(--fe-border, #e2e6ed);font-size:13px}.filex-viewer-spacer[data-v-001123c3]{flex:1}.filex-viewer-psd__dim[data-v-001123c3]{font-size:12px;color:var(--fe-text-muted, #5a6475)}.filex-viewer-psd__zoom[data-v-001123c3]{min-width:50px;text-align:center;font-variant-numeric:tabular-nums;font-size:12px}.filex-viewer-psd__main[data-v-001123c3]{flex:1;display:flex;min-height:0}.filex-viewer-psd__layers[data-v-001123c3]{width:240px;border-right:1px solid var(--fe-border, #e2e6ed);overflow-y:auto;padding:8px 0;background:var(--fe-bg-elev, #f7f8fa)}.filex-viewer-psd__layers ul[data-v-001123c3]{list-style:none;margin:0;padding:0}.filex-viewer-psd__layers li[data-v-001123c3]{display:flex;align-items:center;gap:6px;padding:4px 12px;font-size:12px}.filex-viewer-psd__layer-vis[data-v-001123c3]{width:14px;text-align:center;color:var(--fe-text-muted, #5a6475)}.filex-viewer-psd__layer-vis[data-hidden="1"][data-v-001123c3]{color:var(--fe-border-strong, #c7ced9)}.filex-viewer-psd__layer-name[data-v-001123c3]{flex:1;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.filex-viewer-psd__pane[data-v-001123c3]{flex:1;overflow:auto;padding:16px;background:#2a2d33;display:flex;align-items:flex-start;justify-content:flex-start}.filex-viewer-psd__pane canvas[data-v-001123c3]{background:#fff repeating-conic-gradient(#e0e0e0 0% 25%,transparent 0% 50%) 50% / 16px 16px;box-shadow:0 4px 16px #0000004d}.filex-viewer-fallback[data-v-001123c3]{text-align:center;padding:32px;color:#c8cdd6;margin:auto}.filex-viewer-fallback__icon[data-v-001123c3]{font-size:48px;display:block;margin-bottom:12px}.filex-viewer-btn[data-v-001123c3]{border:1px solid var(--fe-border, #e2e6ed);background:var(--fe-bg, #fff);color:var(--fe-text, #1a1e27);padding:4px 10px;border-radius:4px;cursor:pointer;font:inherit;font-size:12px}.filex-viewer-btn[data-v-001123c3]:hover:not(:disabled){background:var(--fe-bg-hover, #edf0f5)}.filex-viewer-btn.is-active[data-v-001123c3]{background:var(--fe-bg-selected, #dfe8ff);border-color:var(--fe-primary, #3b82f6)}.filex-viewer-ipynb[data-v-eece712d]{display:flex;flex-direction:column;width:100%;height:100%;min-height:70vh;background:var(--fe-bg, #fff);color:var(--fe-text, #1a1e27)}.filex-viewer-ipynb__bar[data-v-eece712d]{display:flex;align-items:center;gap:12px;padding:8px 12px;background:var(--fe-bg-elev, #f7f8fa);border-bottom:1px solid var(--fe-border, #e2e6ed);font-size:12px;color:var(--fe-text-muted, #5a6475)}.filex-viewer-ipynb__lang[data-v-eece712d]{font-family:var(--fe-font-mono, monospace);text-transform:uppercase;letter-spacing:.04em}.filex-viewer-ipynb__pane[data-v-eece712d]{flex:1;overflow:auto;padding:16px 24px}.filex-viewer-ipynb__cell[data-v-eece712d]{border:1px solid var(--fe-border, #e2e6ed);border-radius:6px;margin-bottom:16px;overflow:hidden}.filex-viewer-ipynb__cell[data-type=code][data-v-eece712d]{background:var(--fe-bg-elev, #f7f8fa)}.filex-viewer-ipynb__exec[data-v-eece712d]{padding:4px 12px;font-family:var(--fe-font-mono, monospace);font-size:11px;color:var(--fe-text-muted, #5a6475);background:#0000000a}.filex-viewer-ipynb__src[data-v-eece712d]{margin:0;padding:12px;font-family:var(--fe-font-mono, monospace);font-size:12px;line-height:1.5;white-space:pre;overflow-x:auto}.filex-viewer-ipynb__outputs[data-v-eece712d]{border-top:1px dashed var(--fe-border, #e2e6ed);background:var(--fe-bg, #fff);padding:8px 12px}.filex-viewer-ipynb__out[data-v-eece712d]{margin:0;padding:4px 0;font-family:var(--fe-font-mono, monospace);font-size:12px;white-space:pre-wrap;word-wrap:break-word}.filex-viewer-ipynb__out[data-type=error][data-v-eece712d]{color:var(--fe-danger, #dc2626)}.filex-viewer-ipynb__img[data-v-eece712d]{display:block;max-width:100%;height:auto;margin:8px 0}.filex-viewer-ipynb__html[data-v-eece712d]{font-size:13px}.filex-viewer-ipynb__md[data-v-eece712d]{padding:12px 16px;font-size:14px;line-height:1.6}.filex-viewer-ipynb__md-raw[data-v-eece712d]{padding:12px;margin:0;font-family:var(--fe-font-mono, monospace);font-size:12px;white-space:pre-wrap}.filex-viewer-fallback[data-v-eece712d]{text-align:center;padding:32px;color:var(--fe-text-muted, #5a6475)}.filex-viewer-fallback__icon[data-v-eece712d]{font-size:48px;display:block;margin-bottom:12px}.filex-viewer-csv[data-v-db55a104]{display:flex;flex-direction:column;width:100%;height:100%;min-height:70vh;background:var(--fe-bg, #fff);color:var(--fe-text, #1a1e27)}.filex-viewer-csv__bar[data-v-db55a104]{display:flex;align-items:center;gap:12px;padding:8px 12px;background:var(--fe-bg-elev, #f7f8fa);border-bottom:1px solid var(--fe-border, #e2e6ed);font-size:12px}.filex-viewer-csv__check[data-v-db55a104]{display:flex;align-items:center;gap:4px;font-size:12px}.filex-viewer-csv__select[data-v-db55a104],.filex-viewer-csv__filter[data-v-db55a104]{border:1px solid var(--fe-border, #e2e6ed);background:var(--fe-bg, #fff);color:inherit;padding:4px 8px;border-radius:4px;font:inherit;font-size:12px}.filex-viewer-csv__filter[data-v-db55a104]{flex:0 1 240px}.filex-viewer-spacer[data-v-db55a104]{flex:1}.filex-viewer-csv__count[data-v-db55a104]{font-size:11px;color:var(--fe-text-muted, #5a6475);font-variant-numeric:tabular-nums}.filex-viewer-csv__pane[data-v-db55a104]{flex:1;overflow:auto}.filex-viewer-csv__table[data-v-db55a104]{border-collapse:collapse;width:max-content;min-width:100%;font-size:12px;font-family:var(--fe-font-mono, monospace)}.filex-viewer-csv__table th[data-v-db55a104],.filex-viewer-csv__table td[data-v-db55a104]{padding:4px 10px;border:1px solid var(--fe-border, #e2e6ed);white-space:nowrap;max-width:320px;overflow:hidden;text-overflow:ellipsis}.filex-viewer-csv__table th[data-v-db55a104]{background:var(--fe-bg-elev, #f7f8fa);position:sticky;top:0;font-weight:600;text-align:left}.filex-viewer-csv__table tbody tr[data-v-db55a104]:nth-child(2n){background:var(--fe-bg-hover, rgba(0, 0, 0, .02))}.filex-viewer-csv__rownum[data-v-db55a104]{color:var(--fe-text-muted, #5a6475);text-align:right;background:var(--fe-bg-elev, #f7f8fa);font-variant-numeric:tabular-nums;position:sticky;left:0}.filex-viewer-csv__pager[data-v-db55a104]{display:flex;justify-content:center;align-items:center;gap:8px;padding:6px;background:var(--fe-bg-elev, #f7f8fa);border-top:1px solid var(--fe-border, #e2e6ed);font-size:12px}.filex-viewer-csv__pageno[data-v-db55a104]{font-variant-numeric:tabular-nums;font-size:12px}.filex-viewer-fallback[data-v-db55a104]{text-align:center;padding:32px;color:var(--fe-text-muted, #5a6475)}.filex-viewer-fallback__icon[data-v-db55a104]{font-size:48px;display:block;margin-bottom:12px}.filex-viewer-btn[data-v-db55a104]{border:1px solid var(--fe-border, #e2e6ed);background:var(--fe-bg, #fff);color:var(--fe-text, #1a1e27);padding:4px 10px;border-radius:4px;cursor:pointer;font:inherit;font-size:12px}.filex-viewer-btn[data-v-db55a104]:hover:not(:disabled){background:var(--fe-bg-hover, #edf0f5)}.filex-viewer-btn[data-v-db55a104]:disabled{opacity:.4;cursor:not-allowed}.filex-viewer-archive[data-v-93df7b13]{display:flex;flex-direction:column;width:100%;height:100%;min-height:70vh;background:var(--fe-bg, #fff);color:var(--fe-text, #1a1e27)}.filex-viewer-archive__pane[data-v-93df7b13]{flex:1;overflow:auto;padding:16px 20px}.filex-viewer-archive__summary[data-v-93df7b13]{font-size:12px;color:var(--fe-text-muted, #5a6475);margin-bottom:12px;font-variant-numeric:tabular-nums}.filex-viewer-archive__table[data-v-93df7b13]{width:100%;border-collapse:collapse;font-size:13px;font-family:var(--fe-font-mono, monospace)}.filex-viewer-archive__table th[data-v-93df7b13],.filex-viewer-archive__table td[data-v-93df7b13]{padding:6px 12px;border-bottom:1px solid var(--fe-border, #e2e6ed);text-align:left}.filex-viewer-archive__table th[data-v-93df7b13]{background:var(--fe-bg-elev, #f7f8fa);font-weight:600;position:sticky;top:0}.filex-viewer-archive__size[data-v-93df7b13]{text-align:right;font-variant-numeric:tabular-nums;white-space:nowrap;color:var(--fe-text-muted, #5a6475)}.filex-viewer-archive__icon[data-v-93df7b13]{margin-right:6px}.filex-viewer-archive__table tr[data-dir="1"][data-v-93df7b13]{color:var(--fe-text-muted, #5a6475)}.filex-viewer-fallback[data-v-93df7b13]{text-align:center;padding:32px;color:var(--fe-text-muted, #5a6475)}.filex-viewer-fallback__icon[data-v-93df7b13]{font-size:48px;display:block;margin-bottom:12px}';let km=!1;function eD(){if(km||typeof document>"u")return;const e=document.createElement("style");e.setAttribute("data-filex",""),e.textContent=QM,document.head.appendChild(e),km=!0}function Sm(e,t){const r={};return e.apiBase&&(r.apiBase=e.apiBase),e.endpoint&&(r.endpoint=e.endpoint),(e.locale==="tr"||e.locale==="en")&&(r.locale=e.locale),(e.theme==="light"||e.theme==="dark"||e.theme==="auto")&&(r.theme=e.theme),e.trashVisible!==void 0&&(r.trashVisible=e.trashVisible===!0||e.trashVisible==="true"||e.trashVisible===""),{...r,...t??{}}}const Cm=ex({inheritAttrs:!1,props:{config:{type:Object,default:null},apiBase:{type:String,default:""},endpoint:{type:String,default:""},locale:{type:String,default:""},theme:{type:String,default:""},trashVisible:{type:[Boolean,String],default:void 0}},emits:["share-created","file-opened","error","upload-progress","selection-change"],setup(e,{emit:t}){eD();const r=re(Sm({apiBase:e.apiBase,endpoint:e.endpoint,locale:e.locale,theme:e.theme,trashVisible:e.trashVisible},e.config));return At(()=>[e.config,e.apiBase,e.endpoint,e.locale,e.theme,e.trashVisible],()=>{r.value=Sm({apiBase:e.apiBase,endpoint:e.endpoint,locale:e.locale,theme:e.theme,trashVisible:e.trashVisible},e.config)},{deep:!0}),()=>ov(JM,{config:r.value,onShareCreated:n=>t("share-created",n),onFileOpened:n=>t("file-opened",n),onError:n=>t("error",n),onUploadProgress:n=>t("upload-progress",n),onSelectionChange:n=>t("selection-change",n)})}},{shadowRoot:!1}),tD=Cm;typeof customElements<"u"&&!customElements.get("filex-explorer")&&customElements.define("filex-explorer",Cm);const rD={class:"filex-viewer-3d"},nD={key:1,class:"filex-viewer-fallback"},aD={key:2,class:"filex-viewer-fallback"},jo=Object.freeze(Object.defineProperty({__proto__:null,default:fn(Pt({__name:"Viewer3D",props:{url:{},mime:{},ext:{},t:{type:Function}},setup(e){const t=e,r=new Set(["glb","gltf","usdz"]),n=Fe(()=>r.has((t.ext||"").toLowerCase())),a=re(null),i=re(!1);async function o(){if(i.value=!1,a.value=null,!n.value){a.value=t.t?t.t("viewer.format_unsupported_3d"):`3D format ".${t.ext}" not supported in browser preview — please download.`;return}try{await import("@google/model-viewer"),i.value=!0}catch{a.value=t.t?t.t("viewer.peer_not_installed"):"3D viewer requires `@google/model-viewer` — install or use download."}}return Xt(o),At(()=>t.url,()=>{o()}),(s,l)=>{const c=H_("model-viewer");return R(),$("div",rD,[i.value&&!a.value?(R(),Zt(c,{key:0,src:e.url,"auto-rotate":"","camera-controls":"","touch-action":"pan-y","shadow-intensity":"1",alt:e.ext+" model",style:{width:"100%",height:"100%","min-height":"480px",display:"block"}},null,8,["src","alt"])):a.value?(R(),$("div",nD,[l[0]||(l[0]=T("span",{class:"filex-viewer-fallback__icon"},"📦",-1)),T("p",null,V(a.value),1)])):(R(),$("div",aD,[l[1]||(l[1]=T("span",{class:"filex-viewer-fallback__icon"},"⏳",-1)),T("p",null,V(e.t?e.t("viewer.loading"):"Loading…"),1)]))])}}}),[["__scopeId","data-v-299b3816"]])},Symbol.toStringTag,{value:"Module"})),iD={key:0,class:"filex-viewer-fallback"},oD={key:0,class:"filex-viewer-epub__nav"},sD=["disabled"],lD=["disabled"],cD={key:1,class:"filex-viewer-epub__loading"},uD=Object.freeze(Object.defineProperty({__proto__:null,default:fn(Pt({__name:"EpubViewer",props:{url:{},mime:{},ext:{},t:{type:Function},authHeaders:{type:Function},authCredentials:{}},setup(e){const t=e,r=re(null),n=re(null),a=re(null),i=re([]),o=re(100),s=re(!1),l=re(!0);let c=null,u=null;async function d(){l.value=!0,s.value=!1,a.value=null;let b=null;try{b=await import("epubjs")}catch{a.value=t.t?t.t("viewer.peer_not_installed"):"EPUB viewer requires `epubjs` — install or use download.",l.value=!1;return}try{const v=b.default??b;let m=t.url;if(t.authHeaders){const g=t.authHeaders(),S=await fetch(t.url,{headers:g,credentials:t.authCredentials||"same-origin"});if(!S.ok)throw new Error(`${S.status} ${S.statusText}`);m=await S.arrayBuffer()}if(c=v(m),!n.value)throw new Error("EPUB mount target missing");u=c.renderTo(n.value,{width:"100%",height:"100%",flow:"paginated",manager:"default"}),await u.display(),u.themes.fontSize(o.value+"%");const y=await c.loaded.navigation;i.value=(y==null?void 0:y.toc)??[],s.value=!0}catch(v){a.value=v instanceof Error?v.message:"EPUB load failed"}finally{l.value=!1}}function f(){var b;(b=u==null?void 0:u.next)==null||b.call(u)}function p(){var b;(b=u==null?void 0:u.prev)==null||b.call(u)}function _(b){b.key==="ArrowRight"||b.key==="PageDown"?f():(b.key==="ArrowLeft"||b.key==="PageUp")&&p()}Xt(()=>{d(),window.addEventListener("keydown",_)}),tr(()=>{var b,v;window.removeEventListener("keydown",_);try{(b=u==null?void 0:u.destroy)==null||b.call(u)}catch{}try{(v=c==null?void 0:c.destroy)==null||v.call(c)}catch{}u=null,c=null}),At(()=>t.url,()=>{if(u)try{u.destroy()}catch{}if(c)try{c.destroy()}catch{}c=null,u=null,d()});function h(b,v){return t.t?t.t(b):v}return(b,v)=>(R(),$("div",{ref_key:"root",ref:r,class:"filex-viewer-epub"},[a.value?(R(),$("div",iD,[v[0]||(v[0]=T("span",{class:"filex-viewer-fallback__icon"},"📖",-1)),T("p",null,V(a.value),1)])):(R(),$(qe,{key:1},[T("div",{ref_key:"containerRef",ref:n,class:"filex-viewer-epub__rendition"},null,512),s.value?(R(),$("div",oD,[T("button",{type:"button",class:"filex-viewer-btn",onClick:p,disabled:!s.value},"‹",8,sD),T("button",{type:"button",class:"filex-viewer-btn",onClick:f,disabled:!s.value},"›",8,lD)])):Te("",!0),l.value?(R(),$("div",cD,V(h("viewer.loading","Loading…")),1)):Te("",!0)],64))],512))}}),[["__scopeId","data-v-639afd99"]])},Symbol.toStringTag,{value:"Module"}));async function Em(e){const t=await fetch(e.url,{headers:e.headers??{},credentials:e.credentials??"same-origin",signal:e.signal});if(!t.ok){const r=await t.text().catch(()=>"");throw new Error(`${t.status} ${t.statusText}${r?" — "+r.slice(0,200):""}`)}return t}async function Am(e){return(await Em(e)).arrayBuffer()}async function U0(e){return(await Em(e)).text()}const fD={class:"filex-viewer-mermaid"},dD={key:0,class:"filex-viewer-fallback"},pD={key:1,class:"filex-viewer-fallback"},Tm=Object.freeze(Object.defineProperty({__proto__:null,default:fn(Pt({__name:"MermaidViewer",props:{url:{},mime:{},ext:{},t:{type:Function},authHeaders:{type:Function},authCredentials:{}},setup(e){const t=e,r=re(null),n=re(null),a=re(!0),i=re(1),o=re(0),s=re(0);let l=!1,c=null,u=0,d=null;async function f(){var y,g;if(d)return d;try{const S=await import("mermaid");return d=S.default??S,(g=d.initialize)==null||g.call(d,{startOnLoad:!1,securityLevel:"strict",theme:(y=window.matchMedia)!=null&&y.call(window,"(prefers-color-scheme: dark)").matches?"dark":"default"}),d}catch{return null}}async function p(){var M;a.value=!0,n.value=null;const y=++u,g=await f();if(y!==u)return;if(!g){n.value=t.t?t.t("viewer.peer_not_installed"):"Mermaid viewer requires `mermaid` — install or use download.",a.value=!1;return}let S;try{S=await U0({url:t.url,headers:((M=t.authHeaders)==null?void 0:M.call(t))??{},credentials:t.authCredentials})}catch(E){n.value=E instanceof Error?E.message:"fetch failed",a.value=!1;return}if(y===u)try{const E=`filex-mermaid-${Date.now()}`,{svg:w}=await g.render(E,S);if(y!==u)return;if(r.value){r.value.innerHTML=w;const x=r.value.querySelector("svg");x&&(x.style.maxWidth="100%",x.style.height="auto")}}catch(E){n.value=E instanceof Error?E.message:"render failed"}finally{a.value=!1}}function _(y){if(!y.ctrlKey&&!y.metaKey)return;y.preventDefault();const S=-y.deltaY>0?1.1:1/1.1;i.value=Math.max(.2,Math.min(8,i.value*S))}function h(y){var g,S;l=!0,c={x:y.clientX,y:y.clientY,tx:o.value,ty:s.value},(S=(g=y.target).setPointerCapture)==null||S.call(g,y.pointerId)}function b(y){!l||!c||(o.value=c.tx+(y.clientX-c.x),s.value=c.ty+(y.clientY-c.y))}function v(){l=!1,c=null}Xt(p),tr(()=>{u++});function m(y,g){return t.t?t.t(y):g}return(y,g)=>(R(),$("div",fD,[T("div",{class:"filex-viewer-mermaid__pane",onWheel:_,onPointerdown:h,onPointermove:b,onPointerup:v,onPointercancel:v},[n.value?(R(),$("div",dD,[g[0]||(g[0]=T("span",{class:"filex-viewer-fallback__icon"},"📊",-1)),T("p",null,V(n.value),1)])):a.value?(R(),$("div",pD,[g[1]||(g[1]=T("span",{class:"filex-viewer-fallback__icon"},"⏳",-1)),T("p",null,V(m("viewer.loading","Loading…")),1)])):Te("",!0),Yt(T("div",{ref_key:"surface",ref:r,class:"filex-viewer-mermaid__surface",style:Sn({transform:`translate(${o.value}px, ${s.value}px) scale(${i.value})`})},null,4),[[df,!a.value&&!n.value]])],32)]))}}),[["__scopeId","data-v-e19076c3"]])},Symbol.toStringTag,{value:"Module"})),hD={class:"filex-viewer-drawio"},vD={key:0,class:"filex-viewer-fallback"},mD=["src"],Mm=Object.freeze(Object.defineProperty({__proto__:null,default:fn(Pt({__name:"DrawioViewer",props:{url:{},filePath:{},ext:{},drawioUrl:{},saveUrl:{},readOnly:{type:Boolean},t:{type:Function},authHeaders:{type:Function},authCredentials:{}},setup(e){const t=e,r=re(null),n=re(null),a=re("loading"),i=re(!!t.readOnly||!t.saveUrl),o=Fe(()=>t.drawioUrl?t.drawioUrl.replace(/\/$/,""):null),s=Fe(()=>{if(!o.value)return"";const h=new URLSearchParams({embed:"1",proto:"json",spin:"1",saveAndExit:"0",noSaveBtn:i.value?"1":"0",noExitBtn:"1",ui:"kennedy",modified:"unsavedChanges"});return`${o.value}/?${h.toString()}`});let l="";async function c(){var h;a.value="loading",n.value=null;try{l=await U0({url:t.url,headers:((h=t.authHeaders)==null?void 0:h.call(t))??{},credentials:t.authCredentials})}catch(b){n.value=b instanceof Error?b.message:"fetch failed",a.value="error"}}function u(h){var b,v;(v=(b=r.value)==null?void 0:b.contentWindow)==null||v.postMessage(JSON.stringify(h),"*")}async function d(h){var b;if(t.saveUrl){a.value="saving";try{const v={"Content-Type":"application/json",...((b=t.authHeaders)==null?void 0:b.call(t))??{}},m=await fetch(t.saveUrl,{method:"POST",headers:v,credentials:t.authCredentials||"same-origin",body:JSON.stringify({path:t.filePath,content:h})});if(!m.ok)throw new Error(`${m.status} ${m.statusText}`);a.value="saved",setTimeout(()=>{a.value==="saved"&&(a.value="ready")},2500)}catch(v){n.value=v instanceof Error?v.message:"save failed",a.value="error"}}}function f(h){if(typeof h.data!="string"||h.data.length===0)return;const b=h.data[0];if(b!=="{"&&b!=="<")return;let v;try{v=JSON.parse(h.data)}catch{return}if(!(!v||typeof v!="object"))switch(v.event){case"init":u({action:"load",xml:l,autosave:0}),a.value="ready";break;case"save":typeof v.xml=="string"&&d(v.xml);break;case"export":break;case"autosave":typeof v.xml=="string"&&!i.value&&d(v.xml);break}}function p(){if(!o.value){n.value=_("viewer.drawio.disabled","Drawio (diagrams.net) yapılandırılmamış."),a.value="error";return}n.value===_("viewer.drawio.disabled","Drawio (diagrams.net) yapılandırılmamış.")&&(n.value=null,a.value="loading"),c()}Xt(()=>{window.addEventListener("message",f),p()}),At(()=>t.drawioUrl,p),tr(()=>{window.removeEventListener("message",f)});function _(h,b){return t.t?t.t(h):b}return(h,b)=>(R(),$("div",hD,[n.value?(R(),$("div",vD,[b[0]||(b[0]=T("span",{class:"filex-viewer-fallback__icon"},"📐",-1)),T("p",null,V(n.value),1)])):(R(),$("iframe",{key:1,ref_key:"iframeRef",ref:r,src:s.value,class:"filex-viewer-drawio__frame",title:"diagrams.net editor"},null,8,mD))]))}}),[["__scopeId","data-v-680c72a8"]])},Symbol.toStringTag,{value:"Module"})),gD={class:"filex-viewer-tiff"},bD={class:"filex-viewer-tiff__pane"},yD={key:0,class:"filex-viewer-fallback"},_D={key:1,class:"filex-viewer-fallback"},xD={key:2,class:"filex-viewer-tiff__pager"},wD=["disabled"],kD={class:"filex-viewer-tiff__pages"},SD=["disabled"],Dm=Object.freeze(Object.defineProperty({__proto__:null,default:fn(Pt({__name:"TiffViewer",props:{url:{},mime:{},ext:{},t:{type:Function},authHeaders:{type:Function},authCredentials:{}},setup(e){const t=e,r=re(null),n=re(null),a=re(!0),i=re(0),o=re(0),s=re({width:0,height:0});let l=null,c=null,u=0;async function d(){if(l)return l;try{const m=await Promise.resolve().then(()=>fO);return l=m.default??m,l}catch{return null}}async function f(){var g;a.value=!0,n.value=null,c=null,i.value=0,o.value=0;const m=++u,y=await d();if(m===u){if(!y){n.value=t.t?t.t("viewer.peer_not_installed"):"TIFF viewer requires `utif` — install or use download.",a.value=!1;return}try{const S=await Am({url:t.url,headers:((g=t.authHeaders)==null?void 0:g.call(t))??{},credentials:t.authCredentials});if(m!==u)return;if(c=y.decode(S),o.value=(c==null?void 0:c.length)??0,o.value===0)throw new Error("No pages decoded");p()}catch(S){n.value=S instanceof Error?S.message:"TIFF decode failed"}finally{a.value=!1}}}function p(){if(!l||!c||!r.value)return;const m=Math.max(0,Math.min(i.value,c.length-1)),y=c[m];try{l.decodeImage(void 0,y)}catch{}const g=l.toRGBA8(y),S=y.width,M=y.height;s.value={width:S,height:M};const E=r.value;E.width=S,E.height=M;const w=E.getContext("2d");if(!w)return;const x=w.createImageData(S,M);x.data.set(g),w.putImageData(x,0,0)}function _(){i.value<o.value-1&&(i.value++,p())}function h(){i.value>0&&(i.value--,p())}Xt(f),tr(()=>{u++,c=null}),At(()=>t.url,f);const b=Fe(()=>(t.t&&t.t("viewer.page_n_of_m")||"Page {n} of {m}").replace("{n}",String(i.value+1)).replace("{m}",String(o.value)));function v(m,y){return t.t?t.t(m):y}return(m,y)=>(R(),$("div",gD,[T("div",bD,[n.value?(R(),$("div",yD,[y[0]||(y[0]=T("span",{class:"filex-viewer-fallback__icon"},"🖼️",-1)),T("p",null,V(n.value),1)])):a.value?(R(),$("div",_D,[y[1]||(y[1]=T("span",{class:"filex-viewer-fallback__icon"},"⏳",-1)),T("p",null,V(v("viewer.loading","Loading…")),1)])):Te("",!0),Yt(T("canvas",{ref_key:"canvasEl",ref:r,style:{imageRendering:"pixelated"}},null,512),[[df,!a.value&&!n.value]]),!a.value&&!n.value&&o.value>1?(R(),$("div",xD,[T("button",{type:"button",class:"filex-viewer-btn",disabled:i.value===0,onClick:h},"‹",8,wD),T("span",kD,V(b.value),1),T("button",{type:"button",class:"filex-viewer-btn",disabled:i.value>=o.value-1,onClick:_},"›",8,SD)])):Te("",!0)])]))}}),[["__scopeId","data-v-11c3469a"]])},Symbol.toStringTag,{value:"Module"})),CD={class:"filex-viewer-psd"},ED={class:"filex-viewer-psd__pane"},AD={key:0,class:"filex-viewer-fallback"},TD={key:1,class:"filex-viewer-fallback"},MD=Object.freeze(Object.defineProperty({__proto__:null,default:fn(Pt({__name:"PsdViewer",props:{url:{},mime:{},ext:{},t:{type:Function},authHeaders:{type:Function},authCredentials:{}},setup(e){const t=e,r=re(null),n=re([]),a=re(null),i=re(!0),o=re({width:0,height:0});let s=0,l=null;async function c(){if(l)return l;try{return l=await Promise.resolve().then(()=>ML),l}catch{return null}}function u(p,_){if(p&&Array.isArray(p.children))for(const h of p.children)_.push({index:_.length,name:h.name??"(unnamed)",hidden:!!h.hidden}),h.children&&u(h,_)}async function d(){var h;i.value=!0,a.value=null,n.value=[];const p=++s,_=await c();if(p===s){if(!_){a.value=t.t?t.t("viewer.peer_not_installed"):"PSD viewer requires `ag-psd` — install or use download.",i.value=!1;return}try{const b=await Am({url:t.url,headers:((h=t.authHeaders)==null?void 0:h.call(t))??{},credentials:t.authCredentials});if(p!==s)return;const v=_.readPsd(b,{skipLayerImageData:!1,skipCompositeImageData:!1,skipThumbnail:!0});o.value={width:v.width,height:v.height};const m=v.canvas;if(m&&r.value){const g=r.value;g.width=v.width,g.height=v.height;const S=g.getContext("2d");S==null||S.drawImage(m,0,0)}else throw new Error("PSD has no composite image (skipCompositeImageData?)");const y=[];u(v,y),n.value=y}catch(b){a.value=b instanceof Error?b.message:"PSD decode failed"}finally{i.value=!1}}}Xt(d),tr(()=>{s++}),At(()=>t.url,d);function f(p,_){return t.t?t.t(p):_}return(p,_)=>(R(),$("div",CD,[T("div",ED,[a.value?(R(),$("div",AD,[_[0]||(_[0]=T("span",{class:"filex-viewer-fallback__icon"},"🎨",-1)),T("p",null,V(a.value),1)])):i.value?(R(),$("div",TD,[_[1]||(_[1]=T("span",{class:"filex-viewer-fallback__icon"},"⏳",-1)),T("p",null,V(f("viewer.loading","Loading…")),1)])):Te("",!0),Yt(T("canvas",{ref_key:"canvasEl",ref:r},null,512),[[df,!i.value&&!a.value]])])]))}}),[["__scopeId","data-v-46b5b3c2"]])},Symbol.toStringTag,{value:"Module"})),DD={class:"filex-viewer-ipynb"},zD={class:"filex-viewer-ipynb__pane"},ID={key:0,class:"filex-viewer-fallback"},OD={key:1,class:"filex-viewer-fallback"},PD={key:2},FD=["data-type"],RD={class:"filex-viewer-ipynb__exec"},LD={class:"filex-viewer-ipynb__src hljs"},BD=["innerHTML"],$D={key:1},ND={key:0,class:"filex-viewer-ipynb__outputs"},UD=["src","alt"],HD=["innerHTML"],jD=["data-type"],GD=["innerHTML"],VD={key:1,class:"filex-viewer-ipynb__md-raw"},qD={key:2,class:"filex-viewer-ipynb__src"},KD=Object.freeze(Object.defineProperty({__proto__:null,default:fn(Pt({__name:"IpynbViewer",props:{url:{},ext:{},t:{type:Function},authHeaders:{type:Function},authCredentials:{}},setup(e){const t=e,r=re([]),n=re("python"),a=re(null),i=re(!0),o=re(new Map),s=re(new Map);let l=0,c=null,u=null;async function d(){if(u!==null)return u||null;try{const m=await import("markdown-it"),y=m.default??m;return u=new y({html:!1,linkify:!0,breaks:!0}),u}catch{return u=!1,null}}function f(m){return Array.isArray(m)?m.join(""):m??""}async function p(){var M,E,w,x;i.value=!0,a.value=null,r.value=[],o.value=new Map,s.value=new Map;const m=++l;let y;try{y=await U0({url:t.url,headers:((M=t.authHeaders)==null?void 0:M.call(t))??{},credentials:t.authCredentials})}catch(C){a.value=C instanceof Error?C.message:"fetch failed",i.value=!1;return}if(m!==l)return;let g;try{g=JSON.parse(y)}catch{a.value="Invalid notebook JSON",i.value=!1;return}if(r.value=Array.isArray(g.cells)?g.cells:[],n.value=((w=(E=g.metadata)==null?void 0:E.kernelspec)==null?void 0:w.language)||"python",c=await Hv(),m!==l)return;if(c){const C=c.default??c,D=(x=C.getLanguage)!=null&&x.call(C,n.value)?n.value:null;r.value.forEach((B,F)=>{if(B.cell_type==="code"){const K=f(B.source);try{const te=D?C.highlight(K,{language:D,ignoreIllegals:!0}):C.highlightAuto(K);o.value.set(F,te.value)}catch{}}})}const S=await d();m===l&&(S&&r.value.forEach((C,D)=>{if(C.cell_type==="markdown")try{s.value.set(D,S.render(f(C.source)))}catch{}}),i.value=!1)}function _(m){var y;return m?m.output_type==="stream"?f(m.text):m.output_type==="error"?[m.ename,m.evalue,...m.traceback||[]].filter(Boolean).join(`
|
|
23
|
+
`)}}async function A(ie){if(de.value)try{await navigator.share(ie)}catch{}}return(ie,ae)=>{var U,fe;return R(),$("div",{class:"fx-perm-overlay",onClick:ae[24]||(ae[24]=Ht(oe=>n("close"),["self"]))},[T("div",xA,[T("header",wA,[T("div",kA,[T("span",SA,V(e.isDir?"📁":"📄"),1),T("div",CA,[T("h3",null,V(i("Paylaş / İzinler","Share / Permissions")),1),T("span",{class:"fx-perm-sub",title:e.path},[$t(V(o.value.name),1),T("span",AA," · "+V(o.value.adapter),1)],8,EA)])]),T("button",{class:"fx-perm-x",onClick:ae[0]||(ae[0]=oe=>n("close")),"aria-label":"close"},"✕")]),T("div",TA,[l.value?(R(),$("button",{key:0,class:vt(["fx-perm-tab",{"is-active":s.value==="perms"}]),onClick:ae[1]||(ae[1]=oe=>s.value="perms")},V(i("Kişiler","People")),3)):Te("",!0),T("button",{class:vt(["fx-perm-tab",{"is-active":s.value==="share"}]),onClick:ae[2]||(ae[2]=oe=>s.value="share")},V(i("Bağlantı","Link")),3),e.isDir?(R(),$("button",{key:1,class:vt(["fx-perm-tab",{"is-active":s.value==="drop"}]),onClick:ae[3]||(ae[3]=oe=>s.value="drop")},V(i("Dosya İste","Request files")),3)):Te("",!0)]),T("div",MA,[s.value==="perms"&&l.value?(R(),$(qe,{key:0},[p.value?Te("",!0):(R(),$("div",DA,V(i("Bu diskte RBAC kapalı — izinler yalnızca RBAC açık disklerde geçerli.","RBAC is off on this storage — grants only apply when RBAC is enabled.")),1)),u.value?(R(),$("div",zA,V(u.value),1)):Te("",!0),c.value?(R(),$("div",IA,V(i("Yükleniyor…","Loading…")),1)):(R(),$(qe,{key:3},[T("div",OA,[T("div",PA,[T("div",FA,[Yt(T("input",{"onUpdate:modelValue":ae[4]||(ae[4]=oe=>_.value=oe),type:"email",class:"fx-perm-input",autocomplete:"off",placeholder:i("İsim veya e-posta","Name or email"),onInput:xe,onKeyup:un(pe,["enter"]),onFocus:xe},null,40,RA),[[Ir,_.value]]),M.value?(R(),$("ul",LA,[(R(!0),$(qe,null,xt(S.value,oe=>(R(),$("li",{key:oe.id,onMousedown:Ht(tt=>ee(oe),["prevent"])},[T("span",$A,V((oe.display_name||oe.email).charAt(0).toUpperCase()),1),T("span",NA,[T("span",UA,V(oe.display_name||oe.email),1),T("span",HA,V(oe.email)+" · "+V(oe.role),1)])],40,BA))),128))])):Te("",!0)]),Yt(T("select",{"onUpdate:modelValue":ae[5]||(ae[5]=oe=>h.value=oe),class:"fx-perm-sel",title:(U=w.find(oe=>oe.v===h.value))==null?void 0:U.d},[(R(),$(qe,null,xt(w,oe=>T("option",{key:oe.v,value:oe.v},V(oe.l),9,GA)),64))],8,jA),[[D0,h.value]]),T("button",{class:"fx-perm-btn fx-perm-btn--primary",disabled:b.value,onClick:pe},V(i("Ekle","Add")),9,VA)]),m.value?(R(),$("div",qA,[T("p",KA,V(i("Bu e-postada hesap yok. Ne yapmak istersiniz?","No account for this email — what next?")),1),T("div",WA,[T("div",YA,[Yt(T("select",{"onUpdate:modelValue":ae[6]||(ae[6]=oe=>y.value=oe),class:"fx-perm-sel"},[T("option",XA,V(i("Kullanıcı","User")),1),T("option",ZA,V(i("Görüntüleyen","Viewer")),1)],512),[[D0,y.value]]),T("button",{class:"fx-perm-btn fx-perm-btn--primary",disabled:b.value,onClick:ve},V(i("Kullanıcı oluştur + yetki ver","Create user + grant")),9,JA)]),T("button",{class:"fx-perm-btn fx-perm-btn--ghost",disabled:b.value,onClick:Pe},V(i("Sadece paylaşım linki gönder →","Just send a share link →")),9,QA)])])):Te("",!0),v.value?(R(),$("div",eT,V(v.value),1)):Te("",!0),(fe=g.value)!=null&&fe.tempPassword?(R(),$("div",tT,[$t(V(i("Geçici parola:","Temp password:"))+" ",1),T("code",null,V(g.value.tempPassword),1)])):Te("",!0)]),T("div",rT,[T("h4",null,V(i("Erişimi olanlar","People with access")),1),!d.value.length&&!f.value.length?(R(),$("div",nT,V(i("Henüz kimseyle paylaşılmadı.","Not shared with anyone yet.")),1)):Te("",!0),(R(!0),$(qe,null,xt(d.value,oe=>(R(),$("div",{key:"d"+oe.id,class:"fx-perm-person"},[T("span",aT,V(rt(oe)),1),T("span",{class:"fx-perm-user",title:oe.user_email},V(We(oe)),9,iT),T("select",{class:"fx-perm-sel fx-perm-sel--sm",value:oe.level,onChange:tt=>Ge(oe,tt.target.value)},[(R(),$(qe,null,xt(w,tt=>T("option",{key:tt.v,value:tt.v},V(tt.l),9,sT)),64))],40,oT),T("button",{class:"fx-perm-del",disabled:b.value,title:i("Kaldır","Remove"),onClick:tt=>Ue(oe)},"✕",8,lT)]))),128)),(R(!0),$(qe,null,xt(f.value,oe=>(R(),$("div",{key:"i"+oe.id,class:"fx-perm-person fx-perm-inh"},[T("span",cT,V(rt(oe)),1),T("span",{class:"fx-perm-user",title:oe.user_email},V(We(oe)),9,uT),T("span",fT,V(x(oe.level)),1),T("span",{class:"fx-perm-from",title:i("Üst klasörden gelir","Inherited from")+": "+(oe.path_prefix||"/")}," ↳ "+V(oe.path_prefix||"/"),9,dT)]))),128))])],64))],64)):Te("",!0),s.value==="share"?(R(),$(qe,{key:1},[T("div",pT,[T("div",hT,[T("label",vT,[Yt(T("input",{type:"checkbox","onUpdate:modelValue":ae[7]||(ae[7]=oe=>B.value=oe)},null,512),[[No,B.value]]),$t(" "+V(i("PIN ile koru","Protect with a PIN")),1)]),T("label",mT,[T("span",gT,V(i("Süre","Expiry")),1),Yt(T("select",{"onUpdate:modelValue":ae[8]||(ae[8]=oe=>F.value=oe),class:"fx-perm-sel fx-perm-sel--sm"},[(R(),$(qe,null,xt(j,oe=>T("option",{key:oe.v,value:oe.v},V(oe.l),9,bT)),64))],512),[[D0,F.value,void 0,{number:!0}]])]),T("button",{class:"fx-perm-btn fx-perm-btn--primary",disabled:D.value,onClick:ft},V(i("Bağlantı oluştur","Create link")),9,yT)]),te.value?(R(),$("div",_T,V(te.value),1)):Te("",!0),K.value?(R(),$("div",xT,[T("div",wT,[T("a",{href:K.value.url,target:"_blank",rel:"noopener",class:"fx-perm-link"},V(K.value.url),9,kT),T("button",{class:"fx-perm-btn fx-perm-btn--sm",onClick:ae[9]||(ae[9]=oe=>He(K.value.url,"new"))},V(J.value==="new"?i("Kopyalandı ✓","Copied ✓"):i("Kopyala","Copy")),1)]),K.value.pin?(R(),$("div",ST,[T("span",null,[ae[25]||(ae[25]=$t("PIN: ",-1)),T("code",null,V(K.value.pin),1)]),T("button",{class:"fx-perm-btn fx-perm-btn--sm",onClick:ae[10]||(ae[10]=oe=>He(K.value.pin,"sharepin"))},V(J.value==="sharepin"?i("Kopyalandı ✓","Copied ✓"):i("Kopyala","Copy")),1)])):Te("",!0),T("div",CT,[Yt(T("input",{"onUpdate:modelValue":ae[11]||(ae[11]=oe=>ne.value=oe),type:"text",class:"fx-perm-input",autocomplete:"off",placeholder:i("e-posta(lar) — virgülle ayırın","email(s) — comma separated"),onKeyup:un(St,["enter"])},null,40,ET),[[Ir,ne.value]]),T("button",{class:"fx-perm-btn",disabled:le.value,onClick:St},V(i("Gönder","Send")),9,AT)]),q.value?(R(),$("div",TT,V(q.value),1)):Te("",!0),de.value?(R(),$("button",{key:2,type:"button",class:"fx-perm-btn fx-perm-btn--ghost fx-perm-sharebtn",onClick:ae[12]||(ae[12]=oe=>A(je()))},[ae[26]||(ae[26]=T("span",{"aria-hidden":"true"},"📤",-1)),$t(" "+V(i("Paylaş","Share")),1)])):Te("",!0)])):ne.value?(R(),$("p",MT,[$t(V(i("Aşağıdan bir bağlantı oluşturun, ardından","Create a link below, then it will be sent to"))+" ",1),T("strong",null,V(ne.value),1),$t(" "+V(i("adresine gönderin.",".")),1)])):Te("",!0)]),T("div",DT,[T("h4",null,V(i("Mevcut bağlantılar","Existing links")),1),C.value.length?Te("",!0):(R(),$("div",zT,V(i("Yok","None")),1)),(R(!0),$(qe,null,xt(C.value,oe=>(R(),$("div",{key:oe.uuid,class:"fx-perm-person"},[T("span",{class:"fx-perm-user fx-perm-link",title:oe.url},V(oe.url),9,IT),T("button",{class:"fx-perm-btn fx-perm-btn--sm",onClick:tt=>He(oe.url,oe.uuid)},V(J.value===oe.uuid?i("✓","✓"):i("Kopyala","Copy")),9,OT),T("button",{class:"fx-perm-del",disabled:D.value,title:i("İptal","Revoke"),onClick:tt=>Oe(oe)},"✕",8,PT)]))),128))])],64)):Te("",!0),s.value==="drop"?(R(),$("div",FT,[T("p",RT,V(i("Bu klasöre herkesin dosya YÜKLEYEBİLECEĞİ herkese açık bir bağlantı. Yükleyenler klasördeki mevcut dosyaları göremez.","A public link that lets anyone UPLOAD files into this folder. Uploaders never see the folder's existing files.")),1),T("div",LT,[T("label",BT,[Yt(T("input",{type:"checkbox","onUpdate:modelValue":ae[13]||(ae[13]=oe=>P.value=oe)},null,512),[[No,P.value]]),$t(" "+V(i("PIN ile koru","Protect with a PIN")),1)]),T("label",$T,[T("span",NT,V(i("Süre","Expiry")),1),Yt(T("select",{"onUpdate:modelValue":ae[14]||(ae[14]=oe=>N.value=oe),class:"fx-perm-sel fx-perm-sel--sm"},[(R(),$(qe,null,xt(j,oe=>T("option",{key:oe.v,value:oe.v},V(oe.l),9,UT)),64))],512),[[D0,N.value,void 0,{number:!0}]])]),T("button",{class:"fx-perm-btn fx-perm-btn--primary",disabled:he.value,onClick:L},V(i("Bağlantı oluştur","Create link")),9,HT)]),T("button",{type:"button",class:"fx-perm-btn fx-perm-btn--ghost fx-perm-advtoggle",onClick:ae[15]||(ae[15]=oe=>X.value=!X.value)},V(X.value?i("Gelişmiş ▲","Advanced ▲"):i("Gelişmiş ▼","Advanced ▼")),1),X.value?(R(),$("div",jT,[T("label",GT,[T("span",VT,V(i("En fazla dosya","Max files")),1),Yt(T("input",{"onUpdate:modelValue":ae[16]||(ae[16]=oe=>Ee.value=oe),type:"number",min:"1",class:"fx-perm-input fx-perm-input--sm",placeholder:"20"},null,512),[[Ir,Ee.value]])]),T("label",qT,[T("span",KT,V(i("Dosya başı MB","MB / file")),1),Yt(T("input",{"onUpdate:modelValue":ae[17]||(ae[17]=oe=>Ae.value=oe),type:"number",min:"1",class:"fx-perm-input fx-perm-input--sm",placeholder:"500"},null,512),[[Ir,Ae.value]])]),T("label",WT,[T("span",YT,V(i("İzinli türler","Allowed types")),1),Yt(T("input",{"onUpdate:modelValue":ae[18]||(ae[18]=oe=>ze.value=oe),type:"text",class:"fx-perm-input fx-perm-input--sm",placeholder:i("hepsi (örn. pdf, jpg)","all (e.g. pdf, jpg)")},null,8,XT),[[Ir,ze.value]])]),T("label",ZT,[Yt(T("input",{type:"checkbox","onUpdate:modelValue":ae[19]||(ae[19]=oe=>Le.value=oe)},null,512),[[No,Le.value]]),$t(" "+V(i("Yükleyenin adını sor","Ask uploader name")),1)])])):Te("",!0),Ie.value?(R(),$("div",JT,V(Ie.value),1)):Te("",!0),De.value?(R(),$("div",QT,[T("div",eM,[T("a",{href:De.value.url,target:"_blank",rel:"noopener",class:"fx-perm-link"},V(De.value.url),9,tM),T("button",{class:"fx-perm-btn fx-perm-btn--sm",onClick:ae[20]||(ae[20]=oe=>He(De.value.url,"drop"))},V(J.value==="drop"?i("Kopyalandı ✓","Copied ✓"):i("Kopyala","Copy")),1)]),De.value.pin?(R(),$("div",rM,[T("span",null,[ae[27]||(ae[27]=$t("PIN: ",-1)),T("code",null,V(De.value.pin),1)]),T("button",{class:"fx-perm-btn fx-perm-btn--sm",onClick:ae[21]||(ae[21]=oe=>He(De.value.pin,"droppin"))},V(J.value==="droppin"?i("Kopyalandı ✓","Copied ✓"):i("Kopyala","Copy")),1)])):Te("",!0),T("div",nM,[Yt(T("input",{"onUpdate:modelValue":ae[22]||(ae[22]=oe=>Be.value=oe),type:"text",class:"fx-perm-input",autocomplete:"off",placeholder:i("e-posta(lar) — virgülle ayırın","email(s) — comma separated"),onKeyup:un(ge,["enter"])},null,40,aM),[[Ir,Be.value]]),T("button",{class:"fx-perm-btn",disabled:Z.value,onClick:ge},V(i("Gönder","Send")),9,iM)]),se.value?(R(),$("div",oM,V(se.value),1)):Te("",!0),de.value?(R(),$("button",{key:2,type:"button",class:"fx-perm-btn fx-perm-btn--ghost fx-perm-sharebtn",onClick:ae[23]||(ae[23]=oe=>A(wt()))},[ae[28]||(ae[28]=T("span",{"aria-hidden":"true"},"📤",-1)),$t(" "+V(i("Paylaş","Share")),1)])):Te("",!0)])):Te("",!0)])):Te("",!0)])])])}}}),[["__scopeId","data-v-53f367d0"]]),lM={key:0,class:"fe__presence"},cM=["title"],uM={key:1,class:"fe-e2e-strip",role:"status"},fM={class:"fe-e2e-strip__label"},dM={key:0,class:"fe__skeleton",role:"status"},pM={class:"fe-sr-only"},hM={key:0,class:"fe-skel-grid","aria-hidden":"true"},vM={key:1,class:"fe-skel-list","aria-hidden":"true"},mM={key:1,class:"fe-state"},gM={class:"fe-state__title"},bM={class:"fe-state__path"},yM={class:"fe-state__hint"},_M={class:"fe-state__actions"},xM={key:2,class:"fe-state"},wM={class:"fe-state__title"},kM={class:"fe-state__hint"},SM={class:"fe-state__actions"},CM={class:"fe-state__details"},EM={class:"fe-state__details-summary"},AM={class:"fe-state__details-pre"},TM={key:3,class:"fe-state fe-e2e-lock"},MM={class:"fe-state__title"},DM={class:"fe-state__hint"},zM=["placeholder","disabled"],IM=["disabled"],OM={key:0,class:"fe-form__error",role:"alert"},PM={key:4,class:"fe-state"},FM={class:"fe-state__title"},RM={class:"fe-state__hint"},LM={key:5,class:"fe-state"},BM={class:"fe-state__title"},$M={key:6,class:"fe-state"},NM={class:"fe-state__art",viewBox:"0 0 120 100",width:"110",height:"92",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},UM={key:0},HM={class:"fe-state__title"},jM={key:0,class:"fe-state__hint"},GM={key:1,class:"fe-state__actions"},VM={key:1,class:"fe__dragover"},qM=["title","aria-label"],KM={class:"fe-recents__header"},WM={class:"fe-modal__head"},YM={class:"fe-modal__title"},XM={class:"fe-modal__body"},ZM={class:"fe-toast__msg"},ym="brf-file-explorer:view-mode",_m="filex.inspector",Of="brf-file-explorer:path",Ti="application/x-brf-files",xm="filex.tourDone",Pf="application/x-brf-files-src",wm="filex.tabs",JM=Pt({__name:"FileExplorer",props:{config:{}},emits:["share-created","file-opened","error","upload-progress","selection-change","navigate"],setup(e,{expose:t,emit:r}){const n=e,a=r,i=px(n.config),o=Fe(()=>n.config.locale||"tr"),{t:s}=br(o),l=Px(i,{reload:()=>Qt()}),c=l.presenceUsers,u=l.degraded;function d(I){const O=(I||"").replace(/^\/+|\/+$/g,"");if(O===".trash"||O.startsWith(".trash/"))return null;const be=Er(O);return!be||!be.includes("://")||be.startsWith("://")?null:be}Xt(()=>{l.start(),l.subscribe(d(g.value))}),tr(()=>l.stop());const f=Rx(n.config.apiBase,i),p=hx(n.config,i),_=new Map,h=Ax(n.config,i,{onSettled:I=>{var be;const O=_.get(I.id);if(_.delete(I.id),I.status==="error")mt(I.error_message||"İşlem başarısız");else if(O)Qr(`${O.message} (${I.progress_total})`,O.fn);else{const ke=I.op_type==="copy"?"Kopyalandı":I.op_type==="move"?"Taşındı":"Silindi";mt(`${ke} (${I.progress_total})`)}Qt(),(be=zr.value)==null||be.reload()}}),b=re(!1),v=(n.config.rootPath||"").trim(),m=v.replace("://","/").replace(/^\/+|\/+$/g,""),y=m||n.config.initialPath||"",g=re(y),S=re(n.config.defaultAdapter||"brf"),M=re(y),E=re([]),w=re(""),x=re(""),C=re("");let D;function B(){Qt(D)}const F=u_((I,O)=>{let be=(()=>{try{const ke=localStorage.getItem(ym);if(ke==="list"||ke==="grid"||ke==="gallery")return ke}catch{}return n.config.viewMode??"list"})();return{get(){return I(),be},set(ke){if(ke!==be){be=ke;try{localStorage.setItem(ym,ke)}catch{}O()}}}}),K=re("comfortable"),te=re(""),J=re(!1),ne=re(""),le=Fe(()=>J.value),q=Fe(()=>{const I=(g.value??"").replace(/^\/+|\/+$/g,"");return m&&I===m?!1:I.length>0}),j=Fe(()=>cr.value?!(g.value??"").replace(/^\/+|\/+$/g,""):!1);function P(){if(J.value){Qt(ne.value);return}const I=(g.value??"").replace(/^\/+|\/+$/g,"");if(!I||I===m)return;const O=I.lastIndexOf("/");let be=O===-1?"":I.slice(0,O);m&&!(be===m||be.startsWith(m+"/"))&&(be=m),Qt(be)}const N=vx(()=>E.value);At(()=>[...N.selected.value],()=>{a("selection-change",N.nodes.value.map(O=>({path:O.path,basename:O.basename,type:O.type})));const I=N.nodes.value.filter(O=>O.type==="file");l.setFocus(I.length===1?I[0].basename:null)});const X=re({mode:null,items:[],sourcePath:null}),Ee=re(null),Ae=re(new Set),ze=re(!1),Le=re(!1),he=re(null),Ie=re(0);async function De(){try{const I=await Ao(),O=n.config.apiBase??"",be=await fetch(`${O}/api/files/manager/star/list?limit=500`,{headers:I,credentials:"include"});if(!be.ok)return;const ke=await be.json(),Re=Array.isArray(ke)?ke:Array.isArray(ke==null?void 0:ke.entries)?ke.entries:Array.isArray(ke==null?void 0:ke.nodes)?ke.nodes:[];Ae.value=new Set(Re.map(Ce=>Ce.id).filter(Ce=>typeof Ce=="number"))}catch{}}function Be(I,O){if(typeof I.id!="number")return;const be=new Set(Ae.value);O?be.add(I.id):be.delete(I.id),Ae.value=be}async function Z(I){if(typeof I.id=="number")try{const O=n.config.apiBase??"";await fetch(`${O}/api/files/manager/recent`,{method:"POST",headers:await Ao({"Content-Type":"application/json"}),credentials:"include",body:JSON.stringify({node_id:I.id})}),Ie.value+=1}catch{}}function se(I){typeof I.id=="number"&&(he.value=I,Le.value=!0)}function we(I){const O={type:"file",path:I.path,basename:I.name,extension:(I.name.split(".").pop()||"").toLowerCase(),id:I.id};ze.value=!1,Ha(O)}const Se=Fe(()=>{var O,be,ke;if(n.config.onlyOfficeBase)return n.config.onlyOfficeBase;const I=(be=(O=Ee.value)==null?void 0:O.external)==null?void 0:be.onlyoffice;return I&&!Fv(I)?null:((ke=Ee.value)==null?void 0:ke.onlyoffice_url)||null}),me=Fe(()=>Se.value&&i.endpoints.onlyOfficeConfig||null),ye=Fe(()=>{var be,ke,Re;const I=n.config.drawioUrl||n.config.drawioBase;if(I)return I;const O=(ke=(be=Ee.value)==null?void 0:be.external)==null?void 0:ke.drawio;return O&&!Fv(O)?null:((Re=Ee.value)==null?void 0:Re.drawio_url)||null}),xe=Fe(()=>{var I;return n.config.convertBase||((I=Ee.value)==null?void 0:I.convert_url)||null}),ee=re([]),pe=re(null),ve=re(!1),Pe=re(!1),Ge=re(!1),Ue=re(!1),We=re(!1),rt=re(null),lt=re(!1),ft=re(null),St=re(null),$e=re(null),L=re("edit"),ge=re(!1),Oe=re(null),He=re(!1),de=re(null),Me=re((()=>{try{return localStorage.getItem(_m)==="1"}catch{return!1}})());function G(I){try{localStorage.setItem(_m,I?"1":"0")}catch{}}function je(){Me.value=!Me.value,G(Me.value)}function wt(){Me.value||(Me.value=!0,G(!0))}function A(){Me.value&&(Me.value=!1,G(!1))}const ie=Fe(()=>{if(J.value)return s("node.trash");const I=(g.value??"").replace(/^\/+|\/+$/g,"");return I?I.split("/").pop()||I:S.value||s("breadcrumb.root")});function ae(I){de.value=I,He.value=!0}function U(I){return I===void 0||I==="editor"||I==="owner"}function fe(I){var O;return I.length===1&&typeof((O=I[0])==null?void 0:O.perm)=="string"?I[0].perm:w.value}const oe=Fe(()=>U(w.value)),tt=Fe(()=>oe.value&&!j.value&&!J.value),st=re(null),Ye=re(null),It=re(null),wr=re(!1),hr=re(!1);let Bt,or;function Br(I){hr.value=!!(I&&"matches"in I&&I.matches)}Xt(()=>{var I;typeof ResizeObserver<"u"&&Ye.value&&(Bt=new ResizeObserver(O=>{var ke,Re,Ce;const be=((Re=(ke=O[0])==null?void 0:ke.contentRect)==null?void 0:Re.width)??((Ce=Ye.value)==null?void 0:Ce.clientWidth)??0;wr.value=be>0&&be<560}),Bt.observe(Ye.value)),typeof window<"u"&&window.matchMedia&&(or=window.matchMedia("(pointer: coarse)"),Br(or),(I=or.addEventListener)==null||I.call(or,"change",Br))}),tr(()=>{var I;Bt==null||Bt.disconnect(),Bt=void 0,(I=or==null?void 0:or.removeEventListener)==null||I.call(or,"change",Br),or=void 0});const gr=re(null);let ha;function Co(I,O){gr.value=I,ha&&clearTimeout(ha),ha=setTimeout(()=>gr.value=null,O)}function mt(I){Co({message:I},2500)}function Qr(I,O){Co({message:I,actionLabel:s("toast.undo"),action:O},8e3)}function Mr(){ha&&(clearTimeout(ha),ha=void 0),gr.value=null}async function va(){var O;const I=(O=gr.value)==null?void 0:O.action;if(Mr(),!!I)try{await I(),mt(s("toast.undone")),await Qt()}catch{mt(s("toast.undo_failed"))}}const cr=Fe(()=>n.config.multiStorageRoot===!0);function hu(I){const O=I.replace(/^\/+|\/+$/g,"");if(!O)return{adapter:"",rel:""};const be=O.indexOf("/");return be===-1?{adapter:O,rel:""}:{adapter:O.slice(0,be),rel:O.slice(be+1)}}function Zp(I){if(I.includes("://"))return I;const{adapter:O,rel:be}=hu(I);return O?be?`${O}://${be}`:`${O}://`:""}function As(I){const O=I.indexOf("://");if(O===-1)return I.replace(/^\/+|\/+$/g,"");const be=I.slice(0,O),ke=I.slice(O+3).replace(/^\/+|\/+$/g,"");return ke?`${be}/${ke}`:be}function W3(){return(n.config.storages??[]).map(O=>({type:"dir",path:O.name,basename:O.label||O.name,extension:"",storage:O.name,visibility:"private",file_size:0,mime_type:"inode/storage",extra_metadata:{driver:O.driver,readOnly:O.readOnly}}))}async function Qt(I){b.value=!0,J.value=!1;let O=I??g.value??"";try{if(x.value="",C.value="",m){const Re=String(O).replace(/^\/+|\/+$/g,"");(!Re||!(Re===m||Re.startsWith(m+"/")))&&(O=m)}if(cr.value&&!Zp(O)){g.value="",S.value="",M.value="",Nn.value="",E.value=W3();return}const be=cr.value?Zp(O):Er(O),ke=te.value?await i.search(be,te.value):await i.index(be);S.value=ke.adapter,M.value=ke.dirname,w.value=ke.perm||"",Nn.value=typeof ke.e2e_root=="string"?ke.e2e_root:"",E.value=vm(ke.files),mm(E.value,ke.adapter,ke.dirname,n.config.trashVisible!==!1)&&gm(E.value,ke.adapter,i),g.value=cr.value?As(ke.dirname):Eo(ke.dirname)}catch(be){const ke=be instanceof Error?be.message:String(be),Re=be.status;if(Re===404||Re===403){x.value=String(O),Nn.value="",E.value=[],a("error",{message:ke,context:{path:I}});return}C.value=ke,D=typeof O=="string"?O:void 0,a("error",{message:ke,context:{path:I}}),E.value.length>0&&mt(ke)}finally{b.value=!1}}function Eo(I){const O=I.indexOf("://");return O===-1?I:I.slice(O+3)}function zL(){x.value="",e5(""),Qt("")}async function Gl(){b.value=!0,ne.value=S.value||"",J.value=!0,Nn.value="",N.clear();try{const{entries:I}=await i.listTrash();E.value=I.map(O=>({type:"file",id:O.id,path:O.storage_name?`${O.storage_name}://${O.path}`:O.path,basename:O.name,extension:O.name.includes(".")&&O.name.split(".").pop()||"",storage:O.storage_name||"",visibility:"private",file_size:O.size,mime_type:O.mime||"",extra_metadata:{deleted_at:O.deleted_at,ttl_days:O.ttl_days??null}})),M.value=".trash",g.value=".trash"}catch(I){const O=I instanceof Error?I.message:String(I);a("error",{message:O,context:{op:"trash-list"}}),mt(O)}finally{b.value=!1}}function Er(I){if(I&&I.includes("://"))return I;if(cr.value){const O=Zp(I??"");return O||(S.value?`${S.value}://`:"")}return I?`${S.value}://${I.replace(/^\/+/,"")}`:`${S.value}://`}function Y3(I){const O=I.indexOf("://"),be=(O===-1?I:I.slice(O+3)).replace(/\/+$/,""),ke=be.lastIndexOf("/");return ke===-1?be:be.slice(ke+1)}function vu(I){const O=I.indexOf("://"),be=O===-1?"":I.slice(0,O+3),ke=(O===-1?I:I.slice(O+3)).replace(/\/+$/,""),Re=ke.lastIndexOf("/");return Re===-1?be:be+ke.slice(0,Re)}function Jp(I,O){const be=ke=>{const Re=ke.indexOf("://"),Ce=Re===-1?"":ke.slice(0,Re+3),Et=(Re===-1?ke:ke.slice(Re+3)).replace(/\/+$/,"");return Ce+Et};return be(I)===be(O)}function Vl(I,O){return I?I.endsWith("://")||I.endsWith("/")?I+O:`${I}/${O}`:O}function X3(I,O,be,ke){if(!ke||!be)return;const Re=O.map(Ce=>Vl(be,Y3(Ce)));Re.length!==0&&_.set(I,{message:s("toast.moved"),fn:async()=>{const{op:Ce}=await i.moveAsync(Re,ke,be);h.register(Ce)}})}At(()=>te.value,()=>void Qt());function mu(){return n.config.pathPersist??"hash"}function Z3(){const I=mu();return I==="hash"||I==="hash+localStorage"}function IL(I){try{return decodeURIComponent(I)}catch{return I}}function J3(){try{return localStorage.getItem(Of)||""}catch{return""}}function Q3(){const I=window.location.hash||"";return I.startsWith("#")?IL(I.slice(1)).replace(/^\/+|\/+$/g,""):""}function OL(){if(typeof window>"u")return"";const I=mu();if(I==="none")return"";if(I==="localStorage")return J3();const O=Q3();return O||I==="hash"?O:y?"":J3()}function e5(I){if(typeof window>"u")return;const O=mu();if(O==="none")return;if(O==="localStorage"||O==="hash+localStorage"){try{I?localStorage.setItem(Of,I):localStorage.removeItem(Of)}catch{}if(O==="localStorage")return}const be=I?I.split("/").map(encodeURIComponent).join("/"):"",ke=be?`#${be}`:"";(window.location.hash||"")!==ke&&history.replaceState(null,"",ke||window.location.pathname+window.location.search)}function t5(){if(!Z3())return;const I=Q3();I&&I!==g.value&&Qt(I)}At(g,I=>{e5(I),a("navigate",{path:I}),l.subscribe(d(I))}),t({reload:()=>Qt()}),Xt(async()=>{var O;_f();const I=OL();await Qt(I||void 0),await Nr(),(O=Ye.value)==null||O.focus(),De(),Z3()&&window.addEventListener("hashchange",t5),i.endpoints.opsList&&h.startPolling(),i.endpoints.capabilities&&i.capabilities().then(be=>{Ee.value=be}).catch(()=>{})});const Qp=re(!1),gu=re(!1);function PL(I){return i.globalSearch(I,{limit:8,scope:"all"})}async function FL(I){const O=String(I.path??"").replace(/^\/+|\/+$/g,"");if(!O)return;const be=I.type==="dir",ke=O.lastIndexOf("/"),Re=be?O:ke===-1?"":O.slice(0,ke);let Ce=Re;if(cr.value){const Kt=n.config.storages??[],Wr=typeof I.storage=="string"&&I.storage||typeof I.storage_name=="string"&&I.storage_name||(Kt.length===1?Kt[0].name:"")||S.value;if(!Wr)return;Ce=Re?`${Wr}/${Re}`:Wr}if(await Qt(Ce),be)return;const Et=String(I.name??O.slice(ke+1)),Ut=E.value.find(Kt=>Kt.type==="file"&&Kt.basename===Et);Ut&&(N.click(Ut.path),Ha(Ut))}Sx(Ye,{onDelete:()=>{var I;if(Qn.value){const O=((I=zr.value)==null?void 0:I.selectedNodes())??[];O.length&&(Ts.value=O,lt.value=!0,Ge.value=!0)}else N.isEmpty.value||(lt.value=!1,Ge.value=!0)},onRename:()=>{var I;if(Qn.value){const O=((I=zr.value)==null?void 0:I.selectedNodes())??[];O.length===1&&(rt.value=O[0],lt.value=!0,Pe.value=!0)}else N.nodes.value.length===1&&(rt.value=N.nodes.value[0],lt.value=!1,Pe.value=!0)},onSelectAll:()=>{var I;return Qn.value?(I=zr.value)==null?void 0:I.selectAll():N.selectAll()},onOpen:()=>{var O;if(Qn.value)return(O=zr.value)==null?void 0:O.openSelected();const I=N.nodes.value[0];I&&Ha(I)},onClose:()=>{var I;ve.value=!1,Pe.value=!1,Ge.value=!1,Ue.value=!1,We.value=!1,(I=st.value)==null||I.hide(),Mr(),wr.value&&A()},onFocusSearch:()=>{var I;return(I=It.value)==null?void 0:I.focusSearch()},onCut:()=>Qn.value?b5():XL(),onCopy:()=>Qn.value?y5():ZL(),onPaste:()=>Qn.value?void _5():void n5(),onGoUp:()=>{var I;return Qn.value?(I=zr.value)==null?void 0:I.goUp():P()},onPathJump:()=>{Qp.value=!0},onShowHelp:()=>{gu.value=!0},onQuickLook:()=>xB(),onToggleInspector:()=>je(),onTabNew:()=>dh(),onTabClose:()=>f5(fh.value),onTabNext:()=>OB(),onTabPrev:()=>PB(),hasSelection:()=>!N.isEmpty.value});const RL=new Set(["docx","xlsx","pptx","doc","xls","ppt","odt","ods","odp"]);function Ha(I){if(I.basename===".trash"){Gl();return}if(I.type==="dir"){const be=cr.value?As(I.path):Eo(I.path);Qt(be);return}if(ja.value&&I.type==="file"){bh(I);return}if(hh.value&&I.type==="file")return;const O=(I.extension||"").toLowerCase();L.value=U(I.perm??w.value)?BL(O):"view",$e.value=I,We.value=!0,a("file-opened",{path:I.path,basename:I.basename}),Z(I)}const LL=new Set([...RL,"drawio","dio","pdf","epub","ipynb","tiff","tif","psd","mmd","mermaid","glb","gltf","obj","stl","fbx","3ds","zip","rar","7z","tar","gz","tgz","jpg","jpeg","png","webp","gif","bmp","avif","svg","heic","mp4","webm","mov","mkv","m4v","ogv","mp3","wav","ogg","flac","m4a","aac","opus"]);function BL(I){return LL.has(I)?"view":"edit"}async function $L(I){const O=I??N.nodes.value;if(O.length!==0)try{if(J.value){const Re=O.map(Et=>Et.id).filter(Et=>typeof Et=="number"),{restored:Ce}=await i.restoreIds(Re);mt(`${Ce} öğe geri getirildi`),N.clear(),await Gl();return}if(!i.endpoints.restore)return;const be=O.map(Re=>Re.path),{restored:ke}=await i.restore(be);mt(`${ke} öğe geri getirildi`),N.clear(),await Qt()}catch(be){a("error",{message:be.message,context:{op:"restore"}})}}function r5(I){if(ja.value&&I.type==="file"){bh(I);return}L.value="view",$e.value=I,We.value=!0,Z(I)}function NL(I){if(I.type==="dir"){const Ce=cr.value?As(I.path):Eo(I.path);Qt(Ce);return}if(ea.value){ja.value&&bh(I);return}if(!U(I.perm??w.value)){r5(I);return}const O=(I.extension||"").toLowerCase(),be=n.config.openPageBase;if(!be){Ha(I);return}const ke=be.includes("?")?"&":"?",Re=`${be}${ke}path=${encodeURIComponent(I.path)}&type=${encodeURIComponent(O)}&mode=edit`;window.open(Re,"_blank","noopener"),a("file-opened",{path:I.path,basename:I.basename}),Z(I)}const wn=re("selection"),eh=re(""),Ts=re([]),UL=re(""),HL=Fe(()=>{const I=N.nodes.value;return I.length===0?"none":I.length===1?I[0].type==="dir"?"single-dir":"single-file":"multi"});async function jL(I){const O=N.nodes.value;if(I==="open"){O[0]&&Ha(O[0]);return}await nh(I,O)}async function th(I,O){var be;wn.value="selection",N.has(I.path)||(N.click(I.path),await Nr()),(be=st.value)==null||be.show({clientX:O.clientX,clientY:O.clientY},N.nodes.value)}function GL(I){var O;I.preventDefault(),wn.value="selection",N.clear(),(O=st.value)==null||O.show({clientX:I.clientX,clientY:I.clientY},[])}function VL(I){var O;wn.value="breadcrumb",eh.value=I.adapterPath,UL.value=I.label,(O=st.value)==null||O.show({clientX:I.x,clientY:I.y},[])}function qL(I,O){var ke,Re;_i.value="split";const be=((ke=zr.value)==null?void 0:ke.selectedNodes())??[];Ts.value=I?be.length>0?be:[I]:[],wn.value="pane",(Re=st.value)==null||Re.show({clientX:O.clientX,clientY:O.clientY},Ts.value)}const KL=Fe(()=>{if(wn.value==="breadcrumb")return[{key:"open",label:s("ctx.open"),icon:"↗"},{key:"copy-path",label:s("breadcrumb.copy_path"),icon:"📋"}];if(wn.value==="pane"){const Ce=Ts.value;return Ce.length===0?[{key:"new-folder",label:s("toolbar.new_folder"),icon:"📁"},{key:"paste",label:s("ctx.paste"),icon:"📋",disabled:!X.value.mode}]:rh(Ce)}const I=N.nodes.value,O=I.length>0,be=I.length===1;if(le.value)return O?[{key:"restore",label:s("ctx.restore"),icon:"↩"},{divider:!0,key:"sep1",label:""},{key:"delete",label:s("ctx.delete_perm"),icon:"🗑",danger:!0}]:[];const ke=(g.value??"").replace(/^\/+|\/+$/g,"");return cr.value&&ke===""?O?be?[{key:"open",label:s("ctx.open"),icon:"↗"},{key:"open-tab",label:s("ctx.open_new_tab"),icon:"⧉"}]:[]:[]:O?rh(I):U(w.value)?[{key:"new-folder",label:s("toolbar.new_folder"),icon:"📁"},{key:"paste",label:s("ctx.paste"),icon:"📋",disabled:!X.value.mode}]:[]});function rh(I){var C5,E5,A5;const O=I.length>0,be=I.length===1,ke=be&&((C5=I[0])==null?void 0:C5.type)==="file",Re=o.value==="en"?"Tags…":"Etiketler…",Ce=be&&typeof((E5=I[0])==null?void 0:E5.id)=="number",Et=o.value==="en"?"Copy node id":"Node id'yi kopyala",Ut=fe(I),Kt=U(Ut),Wr=o.value==="en"?"Share / Permissions":"Paylaş / İzinler";return[{key:"open",label:s("ctx.open"),icon:"↗",hidden:!be},{key:"open-tab",label:s("ctx.open_new_tab"),icon:"⧉",hidden:!be||((A5=I[0])==null?void 0:A5.type)!=="dir"},{key:"preview",label:s("ctx.preview"),icon:"👁",hidden:!be,disabled:!ke},{key:"download",label:s("ctx.download"),icon:"⬇",hidden:!be,disabled:!ke},{key:"convert",label:s("ctx.convert"),icon:"🔄",hidden:!be||!xe.value||!Kt||ea.value,disabled:!ke},{key:"access",label:Wr,icon:"🔗",hidden:!be||!Kt||ea.value},{key:"details",label:s("ctx.details"),icon:"ℹ",hidden:!O},{key:"copy-id",label:Et,icon:"🆔",hidden:!Ce,disabled:!Ce},{divider:!0,key:"sep1",label:"",hidden:!Kt},{key:"rename",label:s("ctx.rename"),icon:"✎",hidden:!be||!Kt,disabled:!be},{key:"cut",label:s("ctx.cut"),icon:"✂",hidden:!O||!Kt,disabled:!O},{key:"copy",label:s("ctx.copy"),icon:"❐",hidden:!O,disabled:!O},{key:"paste",label:s("ctx.paste"),icon:"📋",hidden:!Kt,disabled:!X.value.mode},{divider:!0,key:"sep-meta",label:"",hidden:!Ce},{key:"tags",label:Re,icon:"🏷",hidden:!Ce,disabled:!Ce},{divider:!0,key:"sep2",label:"",hidden:!Kt},{key:"delete",label:s("ctx.delete"),icon:"🗑",danger:!0,hidden:!O||!Kt,disabled:!O}]}const WL=Fe(()=>{const I=N.nodes.value;if(le.value)return I.length===0?[]:[{key:"restore",label:s("ctx.restore"),icon:"↩"},{key:"delete",label:s("ctx.delete_perm"),icon:"🗑",danger:!0}];const O=(g.value??"").replace(/^\/+|\/+$/g,"");return cr.value&&O===""?I.length===1?[{key:"open",label:s("ctx.open"),icon:"↗"}]:[]:I.length===0?[]:rh(I)});async function YL(I,O){if(wn.value==="breadcrumb"){I.key==="open"?Qt(Eo(eh.value)):I.key==="copy-path"&&await s5(eh.value);return}if(wn.value==="pane"){await nh(I.key,Ts.value);return}await nh(I.key,O)}async function nh(I,O){var be;switch(I){case"open":O[0]&&NL(O[0]);break;case"preview":O[0]&&r5(O[0]);break;case"download":O[0]&&QL(O[0]);break;case"convert":O[0]&&aB(O[0]);break;case"share":O[0]&&nB(O[0]);break;case"access":O[0]&&(de.value=O[0],He.value=!0);break;case"details":wt();break;case"copy-id":if(O[0]&&typeof O[0].id=="number"){const ke=O[0].id;(be=navigator.clipboard)==null||be.writeText(String(ke)).then(()=>mt(o.value==="en"?`Node id ${ke} copied`:`Node id ${ke} kopyalandı`),()=>mt(`#${ke}`))}break;case"tags":O[0]&&se(O[0]);break;case"rename":O[0]&&(rt.value=O[0],lt.value=wn.value==="pane",Pe.value=!0);break;case"cut":wn.value==="pane"?b5():(X.value={mode:"cut",items:O,sourcePath:g.value},mt("Kes → Yapıştır hazır"));break;case"copy":wn.value==="pane"?y5():(X.value={mode:"copy",items:O,sourcePath:g.value},mt("Kopyala → Yapıştır hazır"));break;case"paste":wn.value==="pane"||Qn.value?await _5():await n5();break;case"delete":lt.value=wn.value==="pane",Ge.value=!0;break;case"restore":O.length>0&&await $L(O);break;case"new-folder":lt.value=wn.value==="pane",ve.value=!0;break;case"duplicate":O[0]&&await JL(O[0]);break;case"open-tab":O[0]&&d5(O[0]);break}}function XL(){N.isEmpty.value||(X.value={mode:"cut",items:N.nodes.value,sourcePath:g.value},mt("Kesildi"))}function ZL(){N.isEmpty.value||(X.value={mode:"copy",items:N.nodes.value,sourcePath:g.value},mt("Kopyalandı"))}async function n5(){const I=X.value;if(!(!I.mode||I.items.length===0))try{const O=I.items.map(Re=>Re.path),be=I.sourcePath||"";if(I.mode==="cut"&&be===g.value){mt("Aynı klasöre kesilemez");return}if(I.mode==="cut"){const Re=Er(g.value),Ce=Er(be)||void 0,{op:Et}=await i.moveAsync(O,Re,Ce);X3(Et.id,O,Re,Ce),h.register(Et),mt("Taşıma kuyruğa alındı")}else{const{op:Re}=await i.copy(O,Er(g.value));h.register(Re),mt("Kopyalama kuyruğa alındı")}X.value={mode:null,items:[],sourcePath:null}}catch(O){a("error",{message:O.message,context:{op:"paste"}})}}async function JL(I){try{const{op:O}=await i.copy([I.path],Er(g.value));h.register(O)}catch(O){a("error",{message:O.message,context:{op:"duplicate"}})}}function QL(I){if(ja.value){KB(I);return}const O=i.downloadUrl(I.path);window.open(O,"_blank")}async function eB(I){var be,ke;const O=lt.value;try{const Re=Er(O?((be=zr.value)==null?void 0:be.getPath())??"":g.value);await i.newFolder(Re,I),ve.value=!1,O?await((ke=zr.value)==null?void 0:ke.reload()):await Qt()}catch(Re){a("error",{message:Re.message,context:{op:"newfolder"}})}}async function tB(I){var ke,Re;const O=rt.value;if(!O)return;const be=lt.value;try{const Ce=Er(be?((ke=zr.value)==null?void 0:ke.getPath())??"":g.value),Et=O.path,Ut=O.basename;if(await i.rename(Ce,Et,I),Pe.value=!1,rt.value=null,be?await((Re=zr.value)==null?void 0:Re.reload()):await Qt(),I&&I!==Ut){const Kt=Vl(vu(Et),I);Qr(s("toast.renamed"),async()=>{await i.rename(Ce,Kt,Ut)})}}catch(Ce){a("error",{message:Ce.message,context:{op:"rename"}})}}async function rB(){var Et,Ut,Kt;if(J.value){Ge.value=!1,mt("Çöpteki öğeler saklama süresi sonunda otomatik silinir. Kalıcı silme yönetici panelinden yapılır.");return}const I=lt.value,O=I?Ts.value:N.nodes.value,be=Er(I?((Et=zr.value)==null?void 0:Et.getPath())??"":g.value),ke=O.map(Wr=>Wr.path);if(ke.length===0){Ge.value=!1;return}const Re=O.map(Wr=>Wr.id).filter(Wr=>typeof Wr=="number"),Ce=i.endpoints.trashRestore&&Re.length===O.length?async()=>{const{restored:Wr}=await i.restoreIds(Re);if(Wr===0)throw new Error("restore failed")}:null;try{if(i.endpoints.deleteAsync){const{op:Wr}=await i.deleteAsync(ke,be);Ce&&_.set(Wr.id,{message:s("toast.trashed"),fn:Ce}),h.register(Wr),mt("Silme kuyruğa alındı")}else await i.deleteItems(be,ke),I?await((Ut=zr.value)==null?void 0:Ut.reload()):await Qt(),Ce&&Qr(s("toast.trashed"),Ce);Ge.value=!1,I?(Kt=zr.value)==null||Kt.reload():N.clear()}catch(Wr){a("error",{message:Wr.message,context:{op:"delete"}})}}function nB(I){ft.value=I,St.value=null,Ue.value=!0}function aB(I){Oe.value=I,ge.value=!0}function iB(I){mt(o.value==="en"?`Converted → ${I}`:`Dönüştürüldü → ${I}`),Qt()}async function oB(I){const O=ft.value;if(O)try{const{share:be}=await i.createShare({path:O.path,password:I.password,expires_at:I.expires_at,max_downloads:I.max_downloads});St.value=be,a("share-created",{path:O.path,url:be.url,pin:be.password_pin??null})}catch(be){a("error",{message:be.message,context:{op:"share"}})}}function sB(){Ue.value=!1,ft.value=null,St.value=null}function bu(){var I;if(!oe.value){mt(o.value==="en"?"Read-only here":"Burada yazma yetkiniz yok");return}(I=pe.value)==null||I.click()}function lB(I){const O=I.target,be=O.files?Array.from(O.files):[];O.value="",a5(be)}async function a5(I){if(I.length===0)return;if(hh.value){mt(s("e2e.upload.locked"));return}if(ja.value&&(I=await WB(I),I.length===0))return;const O=!!(i.endpoints.uploadInit&&i.endpoints.uploadFinalize);for(const be of I)O&&be.size>=10*1024*1024&&await uB(be)||await cB(be);await Qt()}async function cB(I){const O=crypto.randomUUID(),be=Er(g.value);ee.value=[...ee.value,{id:O,file:I,path:be,totalBytes:I.size,uploadedBytes:0,percent:0,status:"uploading",cancel(){}}];const ke=Re=>{const Ce=ee.value.findIndex(Ut=>Ut.id===O);if(Ce===-1)return;const Et=[...ee.value];Et[Ce]={...Et[Ce],...Re},ee.value=Et};try{await i.uploadMultipart(be,[I],Re=>{ke({percent:Re,uploadedBytes:Math.round(Re/100*I.size)}),a("upload-progress",{uploadId:O,percent:Re,done:Re>=100})}),ke({percent:100,uploadedBytes:I.size,status:"done"}),a("upload-progress",{uploadId:O,percent:100,done:!0})}catch(Re){const Ce=Re.message;ke({status:"error",error:Ce}),mt(s("upload.failed",{name:I.name})),a("error",{message:Ce,context:{op:"upload",file:I.name}})}}async function uB(I){const O=crypto.randomUUID();let be=!1;try{return await p.uploadFile({path:Er(g.value),file:I,onProgress:ke=>{if(be){const Re=ee.value.findIndex(Ce=>Ce.id===O);if(Re!==-1){const Ce=[...ee.value];Ce[Re]={...ke,id:O},ee.value=Ce}}else{if(ke.status!=="uploading"&&ke.uploadedBytes<=0)return;ee.value=[...ee.value,{...ke,id:O}],be=!0}a("upload-progress",{uploadId:ke.uploadId??O,percent:ke.percent,done:ke.status==="done"})}}),!0}catch{return be&&(ee.value=ee.value.filter(ke=>ke.id!==O)),!1}}const Yi=re(0),Xi=re(!1);function ah(I){const O=I.dataTransfer;if(!O||O.types&&O.types.includes(Ti))return!1;if(O.items&&O.items.length>0){let be=!1;for(const ke of Array.from(O.items))if(ke.kind==="file"){be=!0;break}return be}return O.types?O.types.includes("Files"):!1}function fB(I){ah(I)&&(I.preventDefault(),Yi.value++,Xi.value=!0)}function dB(){Yi.value=Math.max(0,Yi.value-1),Yi.value===0&&(Xi.value=!1)}function pB(I){var O;if((O=I.dataTransfer)!=null&&O.types.includes(Ti)){I.preventDefault();return}ah(I)&&I.preventDefault()}function hB(I){var be,ke,Re;if((be=I.dataTransfer)!=null&&be.types.includes(Ti)){const Ce=I.dataTransfer.getData(Pf)||"",Et=Er(g.value);if(Ce&&Et&&Ce!==Et&&!J.value&&oe.value){I.preventDefault(),Yi.value=0,Xi.value=!1;try{const Ut=JSON.parse(I.dataTransfer.getData(Ti));Wl(Ut.map(Kt=>Kt.path),Et,Ce)}catch{}return}}if((ke=I.dataTransfer)!=null&&ke.types.includes(Ti)){Yi.value=0,Xi.value=!1;return}if(!ah(I)){Yi.value=0,Xi.value=!1;return}if(I.preventDefault(),Yi.value=0,Xi.value=!1,!oe.value){mt(o.value==="en"?"Read-only here":"Burada yazma yetkiniz yok");return}const O=(Re=I.dataTransfer)!=null&&Re.files?Array.from(I.dataTransfer.files):[];O.length!==0&&a5(O)}function i5(I){var O;(O=I.dataTransfer)!=null&&O.types.includes("Files")&&I.preventDefault()}function o5(I){const O=Ye.value,be=I.target;O&&be&&!O.contains(be)&&I.preventDefault()}Xt(()=>{window.addEventListener("dragover",i5),window.addEventListener("drop",o5)}),tr(()=>{window.removeEventListener("dragover",i5),window.removeEventListener("drop",o5),window.removeEventListener("hashchange",t5)});const yu=Fe(()=>X.value.mode!=="cut"?new Set:new Set(X.value.items.map(I=>I.path)));function ih(I,O){if(!O.dataTransfer)return;if(I.basename===".trash"){O.preventDefault();return}N.has(I.path)||N.click(I.path);const be=N.nodes.value.filter(ke=>!yu.value.has(ke.path)).filter(ke=>ke.basename!==".trash").map(ke=>({path:ke.path,basename:ke.basename,type:ke.type}));O.dataTransfer.setData(Ti,JSON.stringify(be)),O.dataTransfer.setData(Pf,Er(g.value)),O.dataTransfer.setData("text/plain",be.map(ke=>ke.path).join(`
|
|
24
|
+
`)),O.dataTransfer.effectAllowed="move"}async function vB(I,O,be,ke){try{const Re=ke??Er(g.value);if(i.endpoints.moveAsync){const{op:Ce}=await i.moveAsync(I,O,Re);X3(Ce.id,I,O,Re),h.register(Ce),mt("Taşıma kuyruğa alındı")}else{await i.move(Re,I,O),await Qt();const Ce=I.map(Et=>Vl(O,Y3(Et)));Qr(s("toast.moved"),async()=>{await i.move(O,Ce,Re)})}N.clear()}catch(Re){a("error",{message:Re.message,context:{op:be,targetDir:O}})}}async function oh(I,O){var Et;if(I.type!=="dir")return;const be=(Et=O.dataTransfer)==null?void 0:Et.getData(Ti);if(!be)return;let ke=[];try{ke=JSON.parse(be)}catch{return}if(ke.length===0)return;const Re=I.path,Ce=ke.map(Ut=>Ut.path).filter(Ut=>Ut&&Ut!==Re&&!Re.startsWith(Ut+"/")&&!Jp(vu(Ut),Re));Ce.length!==0&&await Wl(Ce,Re,w5(O))}async function mB(I,O){var Et;const be=(Et=O.dataTransfer)==null?void 0:Et.getData(Ti);if(!be)return;let ke=[];try{ke=JSON.parse(be)}catch{return}if(ke.length===0)return;const Re=I,Ce=ke.map(Ut=>Ut.path).filter(Ut=>Ut&&Ut!==Re&&!Re.startsWith(Ut+"/")&&!Jp(vu(Ut),Re));Ce.length!==0&&await Wl(Ce,Re,w5(O))}function gB(I){I.cancel()}function bB(I){ee.value=ee.value.filter(O=>O.id!==I.id)}function yB(I){if(cr.value&&!I){Qt("");return}if(cr.value){Qt(As(I));return}Qt(Eo(I))}async function s5(I){try{await navigator.clipboard.writeText(I),mt(s("breadcrumb.copy_path"))}catch{}}function Ao(I={}){return i.authHeadersSync({...I})}const _u=re(!1),{themeId:xu,setTheme:_B}=Lk(),$n=typeof window<"u"&&window.matchMedia?window.matchMedia("(prefers-color-scheme: dark)"):void 0,l5=re(!!($n!=null&&$n.matches));function c5(I){l5.value=I.matches}Xt(()=>{var I;return(I=$n==null?void 0:$n.addEventListener)==null?void 0:I.call($n,"change",c5)}),tr(()=>{var I;return(I=$n==null?void 0:$n.removeEventListener)==null?void 0:I.call($n,"change",c5)});const sh=Fe(()=>n.config.theme==="dark"||n.config.theme!=="light"&&l5.value);At([xu,sh,Ye],()=>{Nk(xu.value),Ye.value&&Bk(Ye.value,xu.value,sh.value)},{immediate:!0});const ql=re(!1),Zi=re(!1),bi=re(null);function xB(){if(Zi.value){Zi.value=!1;return}const I=N.nodes.value,O=I.length===1?I[0]:null;if(!(!O||O.type!=="file"||O.basename===".trash")){if(ea.value){if(!ja.value)return;(async()=>{try{await gh(O)}catch{mt(s("e2e.decrypt_failed"));return}bi.value=O,Zi.value=!0,Z(O)})();return}bi.value=O,Zi.value=!0,Z(O)}}function wB(I){const O=E.value.filter(Ce=>Ce.type==="file");if(O.length===0)return;const be=bi.value;let ke=be?O.findIndex(Ce=>Ce.path===be.path):-1;ke=ke===-1?I>0?0:O.length-1:(ke+I+O.length)%O.length;const Re=O[ke];!Re||Re.path===(be==null?void 0:be.path)||N.click(Re.path)}function kB(){const I=bi.value;Zi.value=!1,I&&Ha(I)}At(()=>N.nodes.value,I=>{var be,ke;if(!Zi.value)return;const O=I.length===1&&I[0].type==="file"?I[0]:null;if(O&&O.path!==((be=bi.value)==null?void 0:be.path)&&ja.value){(async()=>{try{await gh(O)}catch{}bi.value=O,Z(O)})();return}O&&O.path!==((ke=bi.value)==null?void 0:ke.path)&&(bi.value=O,Z(O))});const lh=GC();function SB(I){ee.value=ee.value.filter(Ce=>Ce.id!==I.id);const O=I.file,be=I.path||Er(g.value),ke=crypto.randomUUID();ee.value=[...ee.value,{id:ke,file:O,path:be,totalBytes:O.size,uploadedBytes:0,percent:0,status:"uploading",cancel(){}}];const Re=Ce=>{const Et=ee.value.findIndex(Kt=>Kt.id===ke);if(Et===-1)return;const Ut=[...ee.value];Ut[Et]={...Ut[Et],...Ce},ee.value=Ut};i.uploadMultipart(be,[O],Ce=>{Re({percent:Ce,uploadedBytes:Math.round(Ce/100*O.size)}),a("upload-progress",{uploadId:ke,percent:Ce,done:Ce>=100})}).then(()=>{Re({percent:100,uploadedBytes:O.size,status:"done"}),a("upload-progress",{uploadId:ke,percent:100,done:!0}),Qt()}).catch(Ce=>{Re({status:"error",error:Ce.message}),mt(s("upload.failed",{name:O.name})),a("error",{message:Ce.message,context:{op:"upload-retry",file:O.name}})})}const wu=re(!1);let ch;function CB(){try{return localStorage.getItem(xm)==="1"}catch{return!0}}function uh(){wu.value=!0}function EB(){var I;wu.value=!1;try{localStorage.setItem(xm,"1")}catch{}(I=Ye.value)==null||I.focus()}function u5(){uh()}Xt(()=>{var I;(I=Ye.value)==null||I.addEventListener("fe:tour-restart",u5),CB()||(ch=setTimeout(()=>{wu.value||uh()},900))}),tr(()=>{var I;ch&&clearTimeout(ch),(I=Ye.value)==null||I.removeEventListener("fe:tour-restart",u5)});function AB(){return mu()==="none"?null:v?`${wm}:${v}`:wm}const Dr=DE({storageKey:AB()}),TB=Dr.restore(),fh=Dr.activeId,MB=Fe(()=>Dr.hasMultiple.value),yi=Fe(()=>{var I;return((I=Dr.activeTab.value)==null?void 0:I.split)??null});function DB(I){const O=(I||"").replace(/^\/+|\/+$/g,"");return O===".trash"?s("node.trash"):O?O.split("/").pop()||O:cr.value?s("breadcrumb.root"):S.value||s("breadcrumb.root")}const zB=Fe(()=>Dr.tabs.value.map(I=>({id:I.id,label:DB(I.path),split:!!I.split})));At(g,I=>Dr.syncActive({path:I})),At(F,I=>Dr.syncActive({viewMode:I})),Xt(()=>{TB||Dr.seed(g.value??"",F.value)});function ku(I){if(I.viewMode&&I.viewMode!==F.value&&(F.value=I.viewMode),I.path===".trash"){Gl();return}Qt(I.path)}function IB(I){const O=Dr.activate(I);O&&ku(O)}function dh(){Dr.openTab(g.value??"",{viewMode:F.value,background:!1})}function f5(I){const O=Dr.closeTab(I);O&&ku(O)}function OB(){const I=Dr.step(1);I&&ku(I)}function PB(){const I=Dr.step(-1);I&&ku(I)}function d5(I){if(I.type!=="dir"||I.basename===".trash")return;const O=cr.value?As(I.path):Eo(I.path);Dr.openTab(O,{viewMode:F.value,background:!0})}function p5(I){if(I.button!==1)return;const O=I.target,be=O&&typeof O.closest=="function"?O.closest("[data-fe-path]"):null,ke=be==null?void 0:be.getAttribute("data-fe-path");if(!ke)return;const Re=E.value.find(Ce=>Ce.path===ke);!Re||Re.type!=="dir"||Re.basename===".trash"||(I.preventDefault(),d5(Re))}function h5(I){if(I.button!==1)return;const O=I.target;O&&typeof O.closest=="function"&&O.closest("[data-fe-path]")&&I.preventDefault()}Xt(()=>{var I,O;(I=Ye.value)==null||I.addEventListener("auxclick",p5),(O=Ye.value)==null||O.addEventListener("mousedown",h5)}),tr(()=>{var I,O;(I=Ye.value)==null||I.removeEventListener("auxclick",p5),(O=Ye.value)==null||O.removeEventListener("mousedown",h5)});const zr=re(null),Kl=Fe(()=>!!yi.value&&!wr.value);function v5(){if(yi.value){Dr.setSplit(null),_i.value="main";return}wr.value||Dr.setSplit({path:g.value??"",viewMode:F.value})}function FB(){Dr.setSplit(null),_i.value="main"}function RB(I){Dr.setSplit({...yi.value??{},path:I})}function LB(){_i.value="main",Gl()}const m5=Fe(()=>{var I;return((I=yi.value)==null?void 0:I.viewMode)??F.value});function BB(I){yi.value&&Dr.setSplit({...yi.value,viewMode:I})}const ph=Fe(()=>Qn.value?m5.value:F.value);function g5(I){Qn.value?BB(I):F.value=I}const _i=re("main");function $B(){_i.value="main"}At(Kl,I=>{I||(_i.value="main")});const Qn=Fe(()=>_i.value==="split"&&Kl.value),NB=Fe(()=>Kl.value&&_i.value==="main");function UB(I){return cr.value?As(I):Eo(I)}function HB(I){const O=String(I??"").replace(/^\/+|\/+$/g,"");return m&&(!O||!(O===m||O.startsWith(m+"/")))?m:O}function b5(){var O,be;const I=((O=zr.value)==null?void 0:O.selectedNodes())??[];I.length!==0&&(X.value={mode:"cut",items:I,sourcePath:((be=zr.value)==null?void 0:be.getPath())??""},mt("Kesildi"))}function y5(){var O,be;const I=((O=zr.value)==null?void 0:O.selectedNodes())??[];I.length!==0&&(X.value={mode:"copy",items:I,sourcePath:((be=zr.value)==null?void 0:be.getPath())??""},mt("Kopyalandı"))}async function _5(){const I=X.value,O=zr.value;if(!I.mode||I.items.length===0||!O)return;const be=Er(O.getPath()??""),ke=Er(I.sourcePath||"")||void 0;if(I.mode==="cut"&&ke===be){mt("Aynı klasöre kesilemez");return}await Wl(I.items.map(Re=>Re.path),be,ke,I.mode==="copy"),X.value={mode:null,items:[],sourcePath:null}}function x5(I){const O=I.indexOf("://");return O===-1?"":I.slice(0,O)}function w5(I){var be;return((be=I.dataTransfer)==null?void 0:be.getData(Pf))||void 0}async function Wl(I,O,be,ke=!1){var Ut;const Re=I.filter(Kt=>Kt&&Kt!==O&&!O.startsWith(Kt+"/")&&!Jp(vu(Kt),O));if(Re.length===0||!O)return;const Ce=x5(O),Et=Re.some(Kt=>x5(Kt)!==Ce);if(Et||ke)try{const{op:Kt}=await i.copy(Re,O);h.register(Kt),mt(s(Et?"split.cross_copy":"split.copy_queued"))}catch(Kt){a("error",{message:Kt.message,context:{op:"transfer",targetWire:O}}),mt(Et?s("split.cross_failed"):Kt.message);return}else await vB(Re,O,"move-transfer",be);(Ut=zr.value)==null||Ut.reload()}function jB(I){Wl(I.sources,I.targetWire,I.originWire)}const Ms=gE(),Yl=re(0),Nn=re(""),Xl=new Map,ea=Fe(()=>!!Nn.value&&!J.value),ja=Fe(()=>(Yl.value,ea.value&&Ms.has(Nn.value))),hh=Fe(()=>(Yl.value,ea.value&&!Ms.has(Nn.value))),Ds=re(""),zs=re(!1),Is=re(""),Su=re(!1),vh=re(!1);function mh(){return Ms.get(Nn.value)??null}function k5(){for(const I of Xl.values())URL.revokeObjectURL(I);Xl.clear()}tr(k5);async function GB(){if(!(!Ds.value||zs.value||!Nn.value)){zs.value=!0,Is.value="";try{let I="";try{const{blob:ke,url:Re}=await i.fetchBlob(Vl(Nn.value,L0));URL.revokeObjectURL(Re),I=await ke.text()}catch{Is.value=s("e2e.unlock.marker_missing");return}const O=hE(I);if(!O){Is.value=s("e2e.unlock.marker_missing");return}const be=await vE(O,Ds.value);if(!be){Is.value=s("e2e.unlock.wrong");return}Ms.set(Nn.value,be),Yl.value++,Ds.value=""}finally{zs.value=!1}}}function VB(){Nn.value&&(Ms.lock(Nn.value),Yl.value++,k5(),mt(s("e2e.locked_toast")))}const qB={txt:"text/plain",md:"text/markdown",log:"text/plain",csv:"text/csv",json:"application/json",xml:"application/xml",html:"text/html",jpg:"image/jpeg",jpeg:"image/jpeg",png:"image/png",gif:"image/gif",webp:"image/webp",bmp:"image/bmp",avif:"image/avif",svg:"image/svg+xml",pdf:"application/pdf",mp4:"video/mp4",webm:"video/webm",mov:"video/quicktime",m4v:"video/mp4",mp3:"audio/mpeg",wav:"audio/wav",ogg:"audio/ogg",flac:"audio/flac",m4a:"audio/mp4",aac:"audio/aac",opus:"audio/opus"};function S5(I){const O=(I.extension||"").toLowerCase();return qB[O]||"application/octet-stream"}async function gh(I){const O=Xl.get(I.path);if(O)return O;const be=mh();if(!be)return null;const ke=await i.fetchArrayBuffer(I.path);if(!Df(ke))return null;const Re=await pm(be,ke),Ce=URL.createObjectURL(new Blob([Re],{type:S5(I)}));return Xl.set(I.path,Ce),Ce}function Cu(I){return Xl.get(I)??i.previewUrl(I)}async function bh(I){try{await gh(I)}catch{mt(s("e2e.decrypt_failed"));return}L.value="view",$e.value=I,We.value=!0,a("file-opened",{path:I.path,basename:I.basename}),Z(I)}async function KB(I){try{const O=await i.fetchArrayBuffer(I.path),be=mh();let ke=O;if(Df(O)){if(!be)throw new Error("locked");ke=await pm(be,O)}const Re=URL.createObjectURL(new Blob([ke],{type:S5(I)})),Ce=document.createElement("a");Ce.href=Re,Ce.download=I.basename,document.body.appendChild(Ce),Ce.click(),Ce.remove(),setTimeout(()=>URL.revokeObjectURL(Re),3e4)}catch{mt(s("e2e.download.failed"))}}async function WB(I){const O=mh();if(!O)return[];const be=[];for(const ke of I)if(ke.name!==L0){if(ke.size>sm){mt(s("e2e.upload.too_big"));continue}try{const Re=await mE(O,await ke.arrayBuffer());be.push(new File([Re],ke.name,{type:"application/octet-stream"}))}catch(Re){a("error",{message:Re.message,context:{op:"e2e-encrypt",file:ke.name}})}}return be}async function YB(I){if(ea.value){mt(s("e2e.create.nested"));return}vh.value=!0;try{const O=Er(g.value);await i.newFolder(O,I.name);const{marker:be,kek:ke}=await pE(I.password),Re=new File([JSON.stringify(be)],L0,{type:"application/json"}),Ce=Vl(O,I.name);await i.uploadMultipart(Ce,[Re]),Ms.set(Ce,ke),Yl.value++,Su.value=!1,mt(s("e2e.create.done")),await Qt()}catch(O){a("error",{message:O.message,context:{op:"e2e-create"}}),mt(s("e2e.create.failed"))}finally{vh.value=!1}}return(I,O)=>{var be,ke,Re;return R(),$("div",{ref_key:"rootEl",ref:Ye,class:vt(["fe",{"fe--theme-light":e.config.theme==="light","fe--theme-dark":e.config.theme==="dark","fe--is-dragover":Xi.value,"fe--density-compact":K.value==="compact","fe--narrow":wr.value}]),tabindex:"-1",onDragenter:fB,onDragover:pB,onDragleave:dB,onDrop:hB,onContextmenu:GL},[MB.value?(R(),Zt(sE,{key:0,tabs:zB.value,"active-id":Y(fh),locale:o.value,"split-enabled":!wr.value,"split-active":!!yi.value,onSelect:IB,onClose:f5,onNew:dh,onReorder:O[0]||(O[0]=(Ce,Et)=>Y(Dr).move(Ce,Et)),onToggleSplit:v5},null,8,["tabs","active-id","locale","split-enabled","split-active"])):Te("",!0),Dt(G8,{ref_key:"toolbarRef",ref:It,"view-mode":ph.value,"search-query":te.value,"trash-active":le.value,actions:WL.value,"selection-mode":HL.value,"paste-enabled":!!X.value.mode,"convert-enabled":!!xe.value,"can-go-up":q.value,"at-virtual-root":j.value,"can-write":oe.value,locale:o.value,narrow:wr.value,theme:e.config.theme||"auto","inspector-open":Me.value,onToggleInspector:je,onOpenTheme:O[1]||(O[1]=Ce=>_u.value=!0),"onUpdate:viewMode":O[2]||(O[2]=Ce=>g5(Ce)),"onUpdate:searchQuery":O[3]||(O[3]=Ce=>te.value=Ce),"onUpdate:density":O[4]||(O[4]=Ce=>K.value=Ce),onOpenShortcutSettings:O[5]||(O[5]=Ce=>ql.value=!0),onNewFolder:O[6]||(O[6]=Ce=>ve.value=!0),onUpload:bu,onRefresh:O[7]||(O[7]=()=>Qt()),onGoUp:P,onAction:jL,onOpenRecents:O[8]||(O[8]=Ce=>ze.value=!0)},null,8,["view-mode","search-query","trash-active","actions","selection-mode","paste-enabled","convert-enabled","can-go-up","at-virtual-root","can-write","locale","narrow","theme","inspector-open","onToggleInspector"]),T("div",{class:vt(["fe__main",{"fe__main--split":Kl.value}])},[T("div",{class:vt(["fe__primary",{"fe-pane--focus":NB.value}])},[Dt(p7,{dirname:M.value,adapter:S.value,"root-label":S.value,locale:o.value,"multi-storage-root":cr.value,"root-path":Y(v),onNavigate:yB,onCopyPath:s5,onCrumbContext:VL,onCrumbDrop:mB},null,8,["dirname","adapter","root-label","locale","multi-storage-root","root-path"]),Y(c).length||Y(u)?(R(),$("div",lM,[Y(c).length?(R(),Zt(Zx,{key:0,users:Y(c),locale:o.value},null,8,["users","locale"])):Te("",!0),Y(u)?(R(),$("span",{key:1,class:"fe-connbadge",role:"status",title:Y(s)("conn.tooltip")},[O[50]||(O[50]=T("span",{class:"fe-connbadge__dot","aria-hidden":"true"},null,-1)),$t(" "+V(Y(s)("conn.offline")),1)],8,cM)):Te("",!0)])):Te("",!0),ja.value?(R(),$("div",uM,[O[51]||(O[51]=T("span",{class:"fe-e2e-strip__icon","aria-hidden":"true"},"🔒",-1)),T("span",fM,V(Y(s)("e2e.strip.label")),1),T("button",{type:"button",class:"fe-btn fe-e2e-strip__btn",onClick:VB},V(Y(s)("e2e.strip.lock")),1)])):Te("",!0),T("div",{class:"fe__body",onPointerdownCapture:O[13]||(O[13]=Ce=>$B()),onClick:O[14]||(O[14]=Ht(Ce=>Y(N).clear(),["self"]))},[b.value&&E.value.length===0?(R(),$("div",dM,[T("span",pM,V(Y(s)("loading")),1),F.value!=="list"?(R(),$("div",hM,[(R(),$(qe,null,xt(8,Ce=>T("div",{key:Ce,class:"fe-skel-card"},[...O[52]||(O[52]=[T("div",{class:"fe-skel fe-skel--thumb"},null,-1),T("div",{class:"fe-skel fe-skel--label"},null,-1)])])),64))])):(R(),$("div",vM,[(R(),$(qe,null,xt(8,Ce=>T("div",{key:Ce,class:"fe-skel-row"},[...O[53]||(O[53]=[T("div",{class:"fe-skel fe-skel--icon"},null,-1),T("div",{class:"fe-skel fe-skel--name"},null,-1),T("div",{class:"fe-skel fe-skel--size"},null,-1),T("div",{class:"fe-skel fe-skel--date"},null,-1)])])),64))]))])):x.value?(R(),$("div",mM,[O[54]||(O[54]=T("svg",{class:"fe-state__art",viewBox:"0 0 120 100",width:"110",height:"92",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[T("path",{d:"M18 36v42a6 6 0 0 0 6 6h72a6 6 0 0 0 6-6V44a6 6 0 0 0-6-6H62l-9-10H24a6 6 0 0 0-6 6z"}),T("path",{d:"M52 55c0-4.6 3.6-8 8-8s8 3.4 8 8c0 5.5-8 4.8-8 11"}),T("circle",{cx:"60",cy:"73",r:"1.6",fill:"currentColor",stroke:"none"})],-1)),T("p",gM,V(Y(s)("notFound.title")),1),T("p",bM,V(x.value),1),T("p",yM,V(Y(s)("notFound.desc")),1),T("div",_M,[T("button",{type:"button",class:"fe-btn",onClick:zL},V(Y(s)("notFound.goRoot")),1)])])):C.value&&E.value.length===0?(R(),$("div",xM,[O[55]||(O[55]=sf('<svg class="fe-state__art" viewBox="0 0 120 100" width="110" height="92" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><circle cx="60" cy="50" r="28"></circle><path d="M60 36v18"></path><circle cx="60" cy="63" r="1.8" fill="currentColor" stroke="none"></circle><path d="M24 88h72" stroke-dasharray="3 5"></path></svg>',1)),T("p",wM,V(Y(s)("error.title")),1),T("p",kM,V(Y(s)("error.hint")),1),T("div",SM,[T("button",{type:"button",class:"fe-btn fe-btn--primary",onClick:B},V(Y(s)("error.retry")),1)]),T("details",CM,[T("summary",EM,V(Y(s)("error.details")),1),T("pre",AM,V(C.value),1)])])):hh.value?(R(),$("div",TM,[O[56]||(O[56]=sf('<svg class="fe-state__art" viewBox="0 0 120 100" width="110" height="92" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect x="38" y="44" width="44" height="34" rx="6"></rect><path d="M46 44v-8a14 14 0 0 1 28 0v8"></path><circle cx="60" cy="59" r="3" fill="currentColor" stroke="none"></circle><path d="M60 62v7"></path></svg>',1)),T("p",MM,V(Y(s)("e2e.locked.title")),1),T("p",DM,V(Y(s)("e2e.locked.hint")),1),T("form",{class:"fe-e2e-lock__form",onSubmit:Ht(GB,["prevent"])},[Yt(T("input",{"onUpdate:modelValue":O[9]||(O[9]=Ce=>Ds.value=Ce),type:"password",class:"fe-input fe-e2e-lock__input",placeholder:Y(s)("e2e.locked.pw_placeholder"),autocomplete:"current-password",disabled:zs.value},null,8,zM),[[Ir,Ds.value]]),T("button",{type:"submit",class:"fe-btn fe-btn--primary",disabled:zs.value||!Ds.value},V(zs.value?Y(s)("e2e.locked.busy"):Y(s)("e2e.locked.unlock")),9,IM)],32),Is.value?(R(),$("p",OM,V(Is.value),1)):Te("",!0)])):!b.value&&E.value.length===0&&te.value?(R(),$("div",PM,[O[57]||(O[57]=T("svg",{class:"fe-state__art",viewBox:"0 0 120 100",width:"110",height:"92",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[T("circle",{cx:"52",cy:"44",r:"22"}),T("path",{d:"M68 61l20 20"}),T("path",{d:"M46 38l12 12M58 38l-12 12"})],-1)),T("p",FM,V(Y(s)("empty.search.title")),1),T("p",RM,V(Y(s)("empty.search.hint")),1)])):!b.value&&E.value.length===0&&J.value?(R(),$("div",LM,[O[58]||(O[58]=sf('<svg class="fe-state__art" viewBox="0 0 120 100" width="110" height="92" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M38 34l4 48a6 6 0 0 0 6 5.6h24a6 6 0 0 0 6-5.6l4-48"></path><path d="M32 34h56"></path><path d="M50 34v-6a6 6 0 0 1 6-6h8a6 6 0 0 1 6 6v6"></path><path d="M52 44v32M60 44v32M68 44v32" opacity="0.5"></path></svg>',1)),T("p",BM,V(Y(s)("empty.trash.title")),1)])):!b.value&&E.value.length===0?(R(),$("div",$M,[(R(),$("svg",NM,[O[60]||(O[60]=T("path",{d:"M18 36v42a6 6 0 0 0 6 6h72a6 6 0 0 0 6-6V44a6 6 0 0 0-6-6H62l-9-10H24a6 6 0 0 0-6 6z"},null,-1)),tt.value?(R(),$("g",UM,[...O[59]||(O[59]=[T("path",{d:"M60 50v14","stroke-dasharray":"3 4"},null,-1),T("path",{d:"M53 59l7 8 7-8"},null,-1)])])):Te("",!0)])),T("p",HM,V(Y(s)("empty.folder")),1),tt.value?(R(),$("p",jM,V(Y(s)("empty.hint")),1)):Te("",!0),tt.value?(R(),$("div",GM,[T("button",{type:"button",class:"fe-btn fe-btn--primary",onClick:bu},V(Y(s)("empty.upload")),1)])):Te("",!0)])):F.value==="list"?(R(),Zt(Yv,{key:7,files:E.value,selected:Y(N).selected.value,clipped:yu.value,"show-parent-path":!!te.value,locale:o.value,loading:b.value,"starred-ids":Ae.value,"api-base":n.config.apiBase??"","auth-headers":()=>Ao(),onClickRow:O[10]||(O[10]=(Ce,Et)=>Y(N).click(Ce.path,Et)),onDblRow:Ha,onContextRow:th,onItemDragStart:ih,onItemDropInto:oh,onStarChange:Be},null,8,["files","selected","clipped","show-parent-path","locale","loading","starred-ids","api-base","auth-headers"])):F.value==="grid"?(R(),Zt(Xv,{key:8,files:E.value,selected:Y(N).selected.value,clipped:yu.value,"show-parent-path":!!te.value,locale:o.value,loading:b.value,"thumb-src":Y(f).src,onClickCard:O[11]||(O[11]=(Ce,Et)=>Y(N).click(Ce.path,Et)),onDblCard:Ha,onContextCard:th,onItemDragStart:ih,onItemDropInto:oh},null,8,["files","selected","clipped","show-parent-path","locale","loading","thumb-src"])):(R(),Zt(Zv,{key:9,files:E.value,selected:Y(N).selected.value,clipped:yu.value,"show-parent-path":!!te.value,locale:o.value,loading:b.value,"thumb-src":Y(f).src,onClickCard:O[12]||(O[12]=(Ce,Et)=>Y(N).click(Ce.path,Et)),onDblCard:Ha,onContextCard:th,onItemDragStart:ih,onItemDropInto:oh},null,8,["files","selected","clipped","show-parent-path","locale","loading","thumb-src"]))],32)],2),Kl.value&&yi.value?(R(),Zt(ME,{ref_key:"splitPaneRef",ref:zr,key:"split-"+Y(fh),api:Y(i),"initial-path":yi.value.path,locale:o.value,qualify:Er,"to-user":UB,clamp:HB,"root-label":cr.value?"/":S.value||Y(s)("breadcrumb.root"),floor:Y(m),"multi-root":cr.value,"virtual-rows":W3,active:Qn.value,"view-mode":m5.value,"thumb-src":Y(f).src,"trash-visible":e.config.trashVisible!==!1,onNavigate:RB,onActivate:O[15]||(O[15]=Ce=>_i.value="split"),onClose:FB,onOpenTab:O[16]||(O[16]=Ce=>Y(Dr).openTab(Ce,{viewMode:F.value,background:!0})),onTransfer:jB,onContext:qL,onOpenTrash:LB},null,8,["api","initial-path","locale","root-label","floor","multi-root","active","view-mode","thumb-src","trash-visible","onContext","onOpenTrash"])):Te("",!0),Me.value?(R(),Zt(L9,{key:1,api:Y(i),nodes:Y(N).nodes.value,"dir-label":ie.value,"dir-count":E.value.length,"dir-perm":w.value,locale:o.value,narrow:wr.value,"thumb-src":Y(f).src,onClose:A,onManagePermissions:ae,onToast:mt,onChanged:O[17]||(O[17]=()=>Qt())},null,8,["api","nodes","dir-label","dir-count","dir-perm","locale","narrow","thumb-src"])):Te("",!0)],2),Xi.value?(R(),$("div",VM,[...O[61]||(O[61]=[T("div",{class:"fe__dragover-card"},[T("span",{class:"fe-icon"},"⬆"),T("p",null,"Dosyaları buraya bırak")],-1)])])):Te("",!0),Dt(bw,{jobs:ee.value,locale:o.value,center:Y(lh),onCancel:gB,onDismiss:bB,onRetry:SB},null,8,["jobs","locale","center"]),Dt(yw,{ops:Y(h).ops.value,locale:o.value,center:Y(lh),onDismiss:O[18]||(O[18]=Ce=>Y(h).dismiss(Ce))},null,8,["ops","locale","center"]),Dt(UC,{center:Y(lh),locale:o.value,narrow:wr.value},null,8,["center","locale","narrow"]),wr.value&&tt.value?(R(),$("button",{key:2,type:"button",class:"fe-fab",title:Y(s)("toolbar.upload"),"aria-label":Y(s)("toolbar.upload"),onClick:bu},[...O[62]||(O[62]=[T("svg",{class:"fe-ficon",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2.2","stroke-linecap":"round","aria-hidden":"true",focusable:"false"},[T("path",{d:"M12 5v14M5 12h14"})],-1)])],8,qM)):Te("",!0),Dt(xf,{ref_key:"ctxRef",ref:st,locale:o.value,theme:e.config.theme||"auto",sheet:hr.value,actions:KL.value,onSelect:YL},null,8,["locale","theme","sheet","actions"]),Dt(jE,{open:ve.value,locale:o.value,"encrypted-option":!ea.value,onClose:O[19]||(O[19]=Ce=>ve.value=!1),onSubmit:eB,onEncrypted:O[20]||(O[20]=Ce=>{ve.value=!1,Su.value=!0})},null,8,["open","locale","encrypted-option"]),Dt(NE,{open:Su.value,locale:o.value,busy:vh.value,onClose:O[21]||(O[21]=Ce=>Su.value=!1),onSubmit:YB},null,8,["open","locale","busy"]),Dt(VE,{open:Pe.value,locale:o.value,"current-name":((be=rt.value)==null?void 0:be.basename)||"",onClose:O[22]||(O[22]=Ce=>Pe.value=!1),onSubmit:tB},null,8,["open","locale","current-name"]),Dt(qE,{open:Ge.value,locale:o.value,count:Y(N).size.value,onClose:O[23]||(O[23]=Ce=>Ge.value=!1),onConfirm:rB},null,8,["open","locale","count"]),Dt(oA,{open:Ue.value,locale:o.value,share:St.value,onClose:sB,onSubmit:oB,onToast:mt},null,8,["open","locale","share"]),Dt(am,{open:We.value,locale:o.value,file:$e.value,theme:e.config.theme||"auto","preview-url":Ce=>Cu(Ce),"download-url":Ce=>ja.value?Cu(Ce):Y(i).downloadUrl(Ce),"only-office-base":ea.value?null:Se.value,"only-office-config-endpoint":me.value,"new-tab-enabled":!ea.value,"save-text-endpoint":ea.value?null:Y(i).endpoints.saveText||null,"open-mode":L.value,"auth-headers":()=>Ao({"Content-Type":"application/json"}),"auth-credentials":Y(i).credentialsMode(),"drawio-url":ye.value,"pdf-worker-url":n.config.pdfWorkerUrl||null,"pdf-save-url":n.config.pdfSaveUrl||null,"viewer-base-url":n.config.viewerBaseUrl||null,onClose:O[24]||(O[24]=Ce=>We.value=!1)},null,8,["open","locale","file","theme","preview-url","download-url","only-office-base","only-office-config-endpoint","new-tab-enabled","save-text-endpoint","open-mode","auth-headers","auth-credentials","drawio-url","pdf-worker-url","pdf-save-url","viewer-base-url"]),ge.value&&Oe.value&&xe.value?(R(),Zt(_A,{key:3,"convert-url":xe.value,"file-name":((ke=Oe.value)==null?void 0:ke.basename)||((Re=Oe.value)==null?void 0:Re.path)||"","fetch-bytes":()=>{var Ce;return Y(i).fetchArrayBuffer(((Ce=Oe.value)==null?void 0:Ce.path)??"")},upload:Ce=>Y(i).uploadMultipart(Er(g.value),[Ce]).then(()=>{}),onClose:O[25]||(O[25]=Ce=>ge.value=!1),onDone:iB},null,8,["convert-url","file-name","fetch-bytes","upload"])):Te("",!0),He.value&&de.value?(R(),Zt(sM,{key:4,api:Y(i),path:de.value.path,"is-dir":de.value.type==="dir",size:typeof de.value.size=="number"?de.value.size:void 0,locale:o.value==="en"?"en":"tr",onClose:O[26]||(O[26]=Ce=>He.value=!1)},null,8,["api","path","is-dir","size","locale"])):Te("",!0),Dt(Za,{name:"fe-modal"},{default:ur(()=>[ze.value?(R(),$("div",{key:0,class:vt(["fe fe-modal__backdrop fe-recents__backdrop",{"fe--theme-light":e.config.theme==="light","fe--theme-dark":e.config.theme==="dark"}]),onClick:O[30]||(O[30]=Ce=>ze.value=!1)},[T("div",{class:"fe-recents__panel",onClick:O[29]||(O[29]=Ht(()=>{},["stop"]))},[T("div",KM,[T("strong",null,V(o.value==="en"?"Recently opened":"Son açılanlar"),1),T("button",{class:"fe-recents__close","aria-label":"Close",onClick:O[27]||(O[27]=Ce=>ze.value=!1)},"×")]),Dt(t7,{"api-base":n.config.apiBase??"","auth-headers":()=>Ao(),limit:20,"refresh-key":Ie.value,onOpen:we,onError:O[28]||(O[28]=Ce=>a("error",{message:Ce,context:{op:"recents"}}))},null,8,["api-base","auth-headers","refresh-key"])])],2)):Te("",!0)]),_:1}),Dt(Za,{name:"fe-modal"},{default:ur(()=>[Le.value&&he.value&&typeof he.value.id=="number"?(R(),$("div",{key:0,class:"fe-modal__backdrop",onClick:O[34]||(O[34]=Ce=>Le.value=!1)},[T("div",{class:"fe-modal__card fe-modal__card--md",onClick:O[33]||(O[33]=Ht(()=>{},["stop"]))},[T("header",WM,[T("h2",YM,V(o.value==="en"?"Tags":"Etiketler")+" — "+V(he.value.basename),1),T("button",{class:"fe-modal__close","aria-label":"Close",onClick:O[31]||(O[31]=Ce=>Le.value=!1)},"×")]),T("div",XM,[Dt(q8,{"node-id":he.value.id,"api-base":n.config.apiBase??"","auth-headers":()=>Ao(),onError:O[32]||(O[32]=Ce=>a("error",{message:Ce,context:{op:"tags"}}))},null,8,["node-id","api-base","auth-headers"])])])])):Te("",!0)]),_:1}),Dt(yk,{open:Qp.value,locale:o.value,files:E.value,"view-mode":F.value,"can-write":oe.value&&!j.value&&!le.value,"can-go-up":q.value,"global-search":PL,onClose:O[35]||(O[35]=Ce=>Qp.value=!1),onOpenHit:FL,onOpenNode:Ha,onNavigate:O[36]||(O[36]=Ce=>Qt(Ce)),onNewFolder:O[37]||(O[37]=Ce=>ve.value=!0),onUpload:bu,onToggleView:O[38]||(O[38]=Ce=>g5(ph.value==="list"?"grid":ph.value==="grid"?"gallery":"list")),onOpenTrash:Gl,onRefresh:O[39]||(O[39]=()=>Qt()),onGoUp:P,onOpenTheme:O[40]||(O[40]=Ce=>_u.value=!0),onOpenShortcutSettings:O[41]||(O[41]=Ce=>ql.value=!0),onStartTour:O[42]||(O[42]=Ce=>uh()),"split-enabled":!wr.value,onTabNew:O[43]||(O[43]=Ce=>dh()),onSplitToggle:O[44]||(O[44]=Ce=>v5())},null,8,["open","locale","files","view-mode","can-write","can-go-up","split-enabled"]),Dt(Ok,{open:gu.value,locale:o.value,onClose:O[45]||(O[45]=Ce=>gu.value=!1),onCustomize:O[46]||(O[46]=Ce=>{gu.value=!1,ql.value=!0})},null,8,["open","locale"]),Dt(Kk,{open:_u.value,locale:o.value,theme:e.config.theme||"auto",dark:sh.value,current:Y(xu),onClose:O[47]||(O[47]=Ce=>_u.value=!1),onSelect:Y(_B)},null,8,["open","locale","theme","dark","current","onSelect"]),T("input",{ref_key:"fileInputEl",ref:pe,type:"file",multiple:"",class:"fe__file-input",onChange:lB},null,544),Dt(Za,{name:"fe-toast"},{default:ur(()=>[gr.value?(R(),$("div",{key:0,class:vt(["fe-toast",{"fe-toast--action":!!gr.value.actionLabel}]),role:"status",onClick:Mr},[T("span",ZM,V(gr.value.message),1),gr.value.actionLabel&&gr.value.action?(R(),$("button",{key:0,type:"button",class:"fe-toast__action",onClick:Ht(va,["stop"])},V(gr.value.actionLabel),1)):Te("",!0)],2)):Te("",!0)]),_:1}),Dt(vS,{open:ql.value,locale:o.value,theme:e.config.theme||"auto",onClose:O[48]||(O[48]=Ce=>ql.value=!1)},null,8,["open","locale","theme"]),Dt(sC,{open:Zi.value,locale:o.value,file:bi.value,theme:e.config.theme||"auto","preview-url":Ce=>Cu(Ce),"download-url":Ce=>ja.value?Cu(Ce):Y(i).downloadUrl(Ce),"only-office-base":ea.value?null:Se.value,"only-office-config-endpoint":me.value,"auth-headers":()=>Ao({"Content-Type":"application/json"}),"auth-credentials":Y(i).credentialsMode(),"drawio-url":ye.value,"pdf-worker-url":n.config.pdfWorkerUrl||null,"viewer-base-url":n.config.viewerBaseUrl||null,onClose:O[49]||(O[49]=Ce=>Zi.value=!1),onNav:wB,onOpenFull:kB},null,8,["open","locale","file","theme","preview-url","download-url","only-office-base","only-office-config-endpoint","auth-headers","auth-credentials","drawio-url","pdf-worker-url","viewer-base-url"]),Dt(JC,{open:wu.value,locale:o.value,root:Ye.value,theme:e.config.theme||"auto",onClose:EB},null,8,["open","locale","root","theme"])],34)}}}),QM='.fx-presence[data-v-f9ddf216]{display:inline-flex;align-items:center;gap:.5rem;max-width:100%}.fx-presence-avatars[data-v-f9ddf216]{display:inline-flex;align-items:center}.fx-presence-avatar[data-v-f9ddf216]{position:relative;display:inline-flex;align-items:center;justify-content:center;width:1.5rem;height:1.5rem;margin-left:-.4rem;border-radius:9999px;border:2px solid var(--fx-presence-ring, #ffffff);color:#fff;font-size:.6rem;font-weight:600;line-height:1;-webkit-user-select:none;user-select:none}.fx-presence-avatar[data-v-f9ddf216]:first-child{margin-left:0}.fx-presence-dot[data-v-f9ddf216]{position:absolute;right:-1px;bottom:-1px;width:.5rem;height:.5rem;border-radius:9999px;background:#22c55e;border:1.5px solid var(--fx-presence-ring, #ffffff)}.fx-presence-more[data-v-f9ddf216]{margin-left:.15rem;font-size:.7rem;color:#71717a}.fx-presence--wide[data-v-f9ddf216]{flex:1 1 auto;min-width:0}.fx-presence-chips[data-v-f9ddf216]{display:flex;align-items:center;gap:.4rem;overflow-x:auto;min-width:0;padding-bottom:2px;scrollbar-width:thin}.fx-presence-chip[data-v-f9ddf216]{display:inline-flex;align-items:center;gap:.35rem;flex:0 0 auto;padding:.15rem .5rem .15rem .2rem;border-radius:9999px;background:#f4f4f5;font-size:.75rem;color:#3f3f46;white-space:nowrap}.fx-presence-chip .fx-presence-avatar[data-v-f9ddf216]{margin-left:0}.fx-presence-chip-name[data-v-f9ddf216]{font-weight:500}.fx-presence-chip-file[data-v-f9ddf216]{color:#71717a;max-width:12rem;overflow:hidden;text-overflow:ellipsis}.fx-presence-toggle[data-v-f9ddf216]{flex:0 0 auto;display:inline-flex;align-items:center;justify-content:center;width:1.25rem;height:1.25rem;border:none;border-radius:9999px;background:transparent;color:#71717a;font-size:.9rem;line-height:1;cursor:pointer}.fx-presence-toggle[data-v-f9ddf216]:hover{background:#e4e4e7;color:#3f3f46}.dark{background:#27272a;color:#d4d4d8}.fx-presence-text[data-v-f9ddf216]{font-size:.75rem;color:#71717a;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:14rem}.fx-presence-file[data-v-f9ddf216]{color:#52525b;font-weight:500}.dark{--fx-presence-ring: #18181b}.filex-tag-picker[data-v-7040583c]{display:flex;flex-wrap:wrap;gap:6px;align-items:center}.filex-tag-picker.is-loading[data-v-7040583c]{opacity:.6;pointer-events:none}.filex-tag[data-v-7040583c]{display:inline-flex;align-items:center;gap:4px;border-radius:999px;padding:2px 10px;font-size:12px;font-weight:500;color:#fff;background:var(--filex-tag-color)}.filex-tag-x[data-v-7040583c]{background:transparent;border:none;color:#ffffffd9;cursor:pointer;padding:0 2px;font-size:14px;line-height:1}.filex-tag-x[data-v-7040583c]:hover{color:#fff}.filex-tag-add input[data-v-7040583c]{border:1px solid var(--filex-border, #d1d5db);border-radius:12px;padding:2px 10px;font-size:12px;width:110px}.filex-tag-add-btn[data-v-7040583c]{border:1px dashed var(--filex-border, #d1d5db);background:transparent;border-radius:999px;padding:2px 10px;font-size:12px;color:var(--filex-text-muted, #6b7280);cursor:pointer}.filex-tag-add-btn[data-v-7040583c]:hover{border-color:var(--filex-accent, #6366f1);color:var(--filex-accent, #6366f1)}.filex-recent[data-v-559f2c71]{background:var(--fe-bg-elev, var(--filex-bg-card, #ffffff));border:1px solid var(--fe-border, var(--filex-border, #e5e7eb));border-radius:8px;padding:12px;font-size:13px}.filex-recent header[data-v-559f2c71]{display:flex;justify-content:space-between;align-items:center;margin-bottom:8px}.filex-recent h3[data-v-559f2c71]{margin:0;font-size:13px;font-weight:600;color:var(--fe-text, var(--filex-text, #111827))}.filex-recent-refresh[data-v-559f2c71]{background:transparent;border:none;color:var(--fe-text-muted, var(--filex-text-muted, #9ca3af));cursor:pointer;font-size:14px;padding:2px 6px}.filex-recent ul[data-v-559f2c71]{list-style:none;margin:0;padding:0}.filex-recent-item[data-v-559f2c71]{display:flex;justify-content:space-between;align-items:center;width:100%;background:transparent;border:none;padding:6px 8px;cursor:pointer;border-radius:4px;text-align:left}.filex-recent-item[data-v-559f2c71]:hover{background:var(--fe-bg-hover, var(--filex-bg-soft, #f3f4f6))}.filex-recent-name[data-v-559f2c71]{color:var(--fe-text, var(--filex-text, #111827));overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.filex-recent-meta[data-v-559f2c71]{color:var(--fe-text-muted, var(--filex-text-muted, #9ca3af));font-size:11px;margin-left:8px;flex-shrink:0}.filex-recent-empty[data-v-559f2c71]{color:var(--fe-text-muted, var(--filex-text-muted, #9ca3af));margin:4px 0 0}.filex-star-btn[data-v-12a2f9c5]{display:inline-flex;align-items:center;gap:6px;background:transparent;border:1px solid transparent;border-radius:6px;padding:4px 8px;color:var(--filex-text-muted, #9ca3af);cursor:pointer;transition:color .12s,background .12s}.filex-star-btn[data-v-12a2f9c5]:hover{color:var(--filex-accent-amber, #f59e0b);background:var(--filex-bg-soft, rgba(0, 0, 0, .04))}.filex-star-btn.is-starred[data-v-12a2f9c5]{color:var(--filex-accent-amber, #f59e0b)}.filex-star-btn.is-compact[data-v-12a2f9c5]{padding:4px}.filex-star-label[data-v-12a2f9c5]{font-size:13px}.fe-themes__hint{margin:0 0 12px;font-size:12.5px;color:var(--fe-text-muted)}.fe-themes{display:grid;grid-template-columns:repeat(auto-fill,minmax(150px,1fr));gap:12px}.fe-themecard{display:flex;flex-direction:column;padding:0;border:2px solid var(--fe-border-strong);border-radius:var(--fe-radius, 8px);background:var(--fe-bg);cursor:pointer;overflow:hidden;text-align:left;transition:transform .12s ease,box-shadow .12s ease;font:inherit}.fe-themecard:hover{transform:translateY(-2px);box-shadow:var(--fe-shadow-sm, 0 2px 6px rgba(15, 23, 42, .08))}.fe-themecard:focus-visible{outline:2px solid var(--fe-primary);outline-offset:2px}.fe-themecard.is-selected{border-color:var(--fe-primary);box-shadow:0 0 0 2px var(--fe-primary)}.fe-themecard__preview{display:flex;flex-direction:column;gap:6px;padding:10px;background:var(--fe-bg);border-bottom:1px solid var(--fe-border);min-height:84px}.fe-themecard__topbar{display:flex;gap:4px;margin-bottom:2px}.fe-themecard__chip{height:8px;width:22px;border-radius:4px;background:var(--fe-bg-hover);border:1px solid var(--fe-border)}.fe-themecard__chip--primary{background:var(--fe-primary);border-color:var(--fe-primary)}.fe-themecard__chip--ghost{background:var(--fe-bg-elev)}.fe-themecard__row{display:flex;align-items:center;gap:6px;padding:3px 4px;border-radius:4px}.fe-themecard__row--selected{background:var(--fe-bg-selected)}.fe-themecard__dot{width:8px;height:8px;border-radius:50%;background:var(--fe-text);opacity:.75;flex:none}.fe-themecard__dot--primary{background:var(--fe-primary);opacity:1}.fe-themecard__dot--muted{background:var(--fe-text-muted)}.fe-themecard__line{height:6px;border-radius:3px;background:var(--fe-text);opacity:.55}.fe-themecard__line--muted{background:var(--fe-text-muted)}.fe-themecard__name{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:8px 10px;font-size:12.5px;font-weight:600;color:var(--fe-text);background:var(--fe-bg-elev);font-family:var(--fe-font, inherit)}.fe-themecard__check{flex:none;width:18px;height:18px;display:inline-flex;align-items:center;justify-content:center;border-radius:50%;background:var(--fe-primary);color:var(--fe-text-on-primary);font-size:11px;line-height:1}.fe-preview__code-editor.is-hidden{display:none}.fe-preview__viewer{width:100%;height:100%;min-height:70vh;display:flex;flex-direction:column}.fe-preview .fe-preview__viewer{align-self:stretch}.fe-preview__md-mermaid{display:flex;justify-content:center;margin:16px 0}.fe-preview__md-mermaid svg{max-width:100%;height:auto}.fe-preview__md-math{margin:16px 0;text-align:center;overflow-x:auto}.filex-cv__bg[data-v-4363f1ac]{position:fixed;top:0;right:0;bottom:0;left:0;z-index:1000;background:#0000008c;display:flex;align-items:center;justify-content:center}.filex-cv[data-v-4363f1ac]{width:min(560px,92vw);max-height:80vh;overflow:hidden;display:flex;flex-direction:column;background:var(--fe-bg, #fff);color:var(--fe-text, #1a1f29);border:1px solid var(--fe-border, #e2e6ed);border-radius:12px;box-shadow:0 20px 60px #00000059}.filex-cv__head[data-v-4363f1ac]{display:flex;align-items:center;justify-content:space-between;padding:12px 16px;border-bottom:1px solid var(--fe-border, #e2e6ed)}.filex-cv__head h3[data-v-4363f1ac]{margin:0;font-size:14px;font-weight:600}.filex-cv__x[data-v-4363f1ac]{border:0;background:none;cursor:pointer;font-size:16px;color:var(--fe-text-muted, #5a6475)}.filex-cv__msg[data-v-4363f1ac]{padding:28px;text-align:center;color:var(--fe-text-muted, #5a6475)}.filex-cv__ok[data-v-4363f1ac]{color:#059669}.filex-cv__src[data-v-4363f1ac]{padding:12px 16px 0;font-size:13px;color:var(--fe-text-muted, #5a6475)}.filex-cv__search[data-v-4363f1ac]{margin:8px 16px;padding:8px 10px;border:1px solid var(--fe-border, #e2e6ed);border-radius:8px;background:var(--fe-bg-elev, #f7f8fa);color:inherit;font-size:13px}.filex-cv__list[data-v-4363f1ac]{flex:1;overflow-y:auto;padding:4px 12px 12px;display:grid;grid-template-columns:repeat(auto-fill,minmax(120px,1fr));gap:8px}.filex-cv__fmt[data-v-4363f1ac]{display:flex;flex-direction:column;gap:2px;align-items:flex-start;padding:8px 10px;cursor:pointer;text-align:left;border:1px solid var(--fe-border, #e2e6ed);border-radius:8px;background:var(--fe-bg-elev, #f7f8fa);color:inherit}.filex-cv__fmt small[data-v-4363f1ac]{color:var(--fe-text-muted, #5a6475);font-size:11px}.filex-cv__fmt.is-sel[data-v-4363f1ac]{border-color:#44c878;background:#44c8781f}.filex-cv__empty[data-v-4363f1ac]{grid-column:1 / -1;text-align:center;color:var(--fe-text-muted, #5a6475);padding:16px}.filex-cv__err[data-v-4363f1ac]{padding:0 16px;color:var(--fe-danger, #dc2626);font-size:13px}.filex-cv__foot[data-v-4363f1ac]{padding:12px 16px;border-top:1px solid var(--fe-border, #e2e6ed);text-align:right}.filex-cv__convert[data-v-4363f1ac]{padding:8px 18px;border:0;border-radius:8px;cursor:pointer;background:#44c878;color:#03200f;font-weight:600;font-size:13px}.filex-cv__convert[data-v-4363f1ac]:disabled{opacity:.5;cursor:default}.filex-cv__frame[data-v-4363f1ac]{position:absolute;width:0;height:0;border:0;left:-9999px}.fx-perm-overlay[data-v-23e7820c]{position:fixed;top:0;right:0;bottom:0;left:0;background:#00000080;display:flex;align-items:center;justify-content:center;z-index:10000;font-family:var(--fe-font)}.fx-perm-modal[data-v-23e7820c]{display:flex;flex-direction:column;background:var(--fe-bg);color:var(--fe-text);width:min(520px,94vw);max-height:86vh;border:1px solid var(--fe-border);border-radius:var(--fe-radius-lg, 14px);box-shadow:var(--fe-shadow);font-size:14px;overflow:hidden}.fx-perm-head[data-v-23e7820c]{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:16px 18px 12px;flex:none}.fx-perm-title[data-v-23e7820c]{display:flex;align-items:center;gap:10px;min-width:0}.fx-perm-ico[data-v-23e7820c]{font-size:22px;line-height:1}.fx-perm-titletext[data-v-23e7820c]{display:flex;flex-direction:column;min-width:0}.fx-perm-title h3[data-v-23e7820c]{margin:0;font-size:15px;font-weight:600;color:var(--fe-text)}.fx-perm-sub[data-v-23e7820c]{font-size:12px;color:var(--fe-text);max-width:340px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.fx-perm-subdim[data-v-23e7820c]{color:var(--fe-text-muted)}.fx-perm-x[data-v-23e7820c]{background:none;border:none;font-size:17px;cursor:pointer;color:var(--fe-text-muted);flex:none;line-height:1;padding:2px 4px;border-radius:6px}.fx-perm-x[data-v-23e7820c]:hover{color:var(--fe-text);background:var(--fe-bg-hover)}.fx-perm-tabs[data-v-23e7820c]{display:flex;gap:2px;padding:0 18px;border-bottom:1px solid var(--fe-border);flex:none}.fx-perm-tab[data-v-23e7820c]{background:none;border:none;border-bottom:2px solid transparent;padding:8px 12px;cursor:pointer;color:var(--fe-text-muted);font-size:13px;font-family:inherit;font-weight:500}.fx-perm-tab[data-v-23e7820c]:hover{color:var(--fe-text)}.fx-perm-tab.is-active[data-v-23e7820c]{color:var(--fe-primary);border-bottom-color:var(--fe-primary)}.fx-perm-body[data-v-23e7820c]{flex:1 1 auto;overflow-y:auto;padding:14px 18px 18px}.fx-perm-addcard[data-v-23e7820c]{padding:12px;border-radius:var(--fe-radius-md, 10px);background:var(--fe-bg-elev);border:1px solid var(--fe-border)}.fx-perm-section[data-v-23e7820c]{margin-top:16px}.fx-perm-section h4[data-v-23e7820c]{margin:0 0 8px;font-size:11px;text-transform:uppercase;letter-spacing:.05em;color:var(--fe-text-muted)}.fx-perm-empty[data-v-23e7820c]{color:var(--fe-text-muted);font-size:13px;padding:8px 2px}.fx-perm-person[data-v-23e7820c]{display:flex;align-items:center;gap:10px;padding:7px 2px}.fx-perm-person+.fx-perm-person[data-v-23e7820c]{border-top:1px solid var(--fe-border)}.fx-perm-inh[data-v-23e7820c]{color:var(--fe-text-muted)}.fx-perm-av[data-v-23e7820c]{width:28px;height:28px;flex:none;border-radius:50%;display:flex;align-items:center;justify-content:center;background:var(--fe-primary);color:var(--fe-text-on-primary, #fff);font-size:12px;font-weight:600}.fx-perm-av--dim[data-v-23e7820c]{background:var(--fe-bg-hover);color:var(--fe-text-muted)}.fx-perm-user[data-v-23e7820c]{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--fe-text);min-width:0}.fx-perm-from[data-v-23e7820c]{font-size:11px;color:var(--fe-text-muted);white-space:nowrap}.fx-perm-badge[data-v-23e7820c]{font-size:11px;padding:2px 9px;border-radius:999px;background:var(--fe-bg-hover);color:var(--fe-text)}.fx-perm-sel[data-v-23e7820c],.fx-perm-input[data-v-23e7820c]{padding:7px 9px;border-radius:var(--fe-radius-sm, 7px);border:1px solid var(--fe-border);background:var(--fe-bg);color:var(--fe-text);font-size:13px;font-family:inherit}.fx-perm-sel--sm[data-v-23e7820c]{padding:5px 7px;font-size:12px}.fx-perm-sel[data-v-23e7820c]:focus,.fx-perm-input[data-v-23e7820c]:focus{outline:none;border-color:var(--fe-primary)}.fx-perm-add[data-v-23e7820c]{display:flex;gap:8px;align-items:stretch}.fx-perm-emailwrap[data-v-23e7820c]{position:relative;flex:1;min-width:120px}.fx-perm-input[data-v-23e7820c]{width:100%;box-sizing:border-box}.fx-perm-suggest[data-v-23e7820c]{position:absolute;top:calc(100% + 3px);left:0;right:0;z-index:5;margin:0;padding:4px;list-style:none;background:var(--fe-bg);border:1px solid var(--fe-border);border-radius:var(--fe-radius-sm, 7px);box-shadow:var(--fe-shadow);max-height:210px;overflow:auto}.fx-perm-suggest li[data-v-23e7820c]{display:flex;align-items:center;gap:8px;padding:6px 8px;border-radius:6px;cursor:pointer}.fx-perm-suggest li[data-v-23e7820c]:hover{background:var(--fe-bg-hover)}.fx-perm-suggest-av[data-v-23e7820c]{width:24px;height:24px;flex:none;border-radius:50%;display:flex;align-items:center;justify-content:center;background:var(--fe-bg-hover);color:var(--fe-text);font-size:11px;font-weight:600}.fx-perm-suggest-txt[data-v-23e7820c]{display:flex;flex-direction:column;min-width:0}.fx-perm-suggest-name[data-v-23e7820c]{color:var(--fe-text);font-size:13px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.fx-perm-suggest-meta[data-v-23e7820c]{color:var(--fe-text-muted);font-size:11px}.fx-perm-check[data-v-23e7820c]{display:inline-flex;gap:6px;align-items:center;font-size:13px;color:var(--fe-text);cursor:pointer}.fx-perm-btn[data-v-23e7820c]{padding:7px 13px;border-radius:var(--fe-radius-sm, 7px);border:1px solid var(--fe-border);background:var(--fe-bg);color:var(--fe-text);font-size:13px;font-family:inherit;cursor:pointer;white-space:nowrap}.fx-perm-btn[data-v-23e7820c]:hover:not(:disabled){background:var(--fe-bg-hover)}.fx-perm-btn[data-v-23e7820c]:disabled{opacity:.55;cursor:default}.fx-perm-btn--sm[data-v-23e7820c]{padding:5px 10px;font-size:12px}.fx-perm-btn--primary[data-v-23e7820c]{background:var(--fe-primary);border-color:var(--fe-primary);color:var(--fe-text-on-primary, #fff)}.fx-perm-btn--primary[data-v-23e7820c]:hover:not(:disabled){background:var(--fe-primary-hover, var(--fe-primary));filter:brightness(1.05)}.fx-perm-btn--ghost[data-v-23e7820c]{background:none;border-color:transparent;color:var(--fe-primary);padding-left:2px}.fx-perm-btn--ghost[data-v-23e7820c]:hover:not(:disabled){background:none;text-decoration:underline}.fx-perm-del[data-v-23e7820c]{background:none;border:none;color:var(--fe-danger);cursor:pointer;font-size:14px;flex:none;padding:2px 4px}.fx-perm-del[data-v-23e7820c]:hover:not(:disabled){filter:brightness(1.15)}.fx-perm-invite[data-v-23e7820c]{margin-top:10px;padding-top:10px;border-top:1px dashed var(--fe-border)}.fx-perm-invite-actions[data-v-23e7820c]{display:flex;flex-direction:column;gap:8px;margin-top:6px}.fx-perm-invite-row[data-v-23e7820c]{display:flex;gap:8px;align-items:stretch}.fx-perm-invite-row .fx-perm-btn--primary[data-v-23e7820c]{flex:1}.fx-perm-share-opts[data-v-23e7820c]{display:flex;gap:12px;align-items:center;flex-wrap:wrap}.fx-perm-expiry[data-v-23e7820c]{display:inline-flex;gap:6px;align-items:center;font-size:13px}.fx-perm-share-opts .fx-perm-btn--primary[data-v-23e7820c]{margin-left:auto}.fx-perm-result[data-v-23e7820c]{margin-top:12px;padding-top:12px;border-top:1px solid var(--fe-border)}.fx-perm-linkrow[data-v-23e7820c]{display:flex;gap:8px;align-items:center}.fx-perm-link[data-v-23e7820c]{color:var(--fe-primary);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;flex:1;min-width:0;text-decoration:none}.fx-perm-link[data-v-23e7820c]:hover{text-decoration:underline}.fx-perm-pin[data-v-23e7820c]{margin:8px 0 0;font-size:13px;color:var(--fe-text);display:flex;align-items:center;gap:8px}.fx-perm-pin code[data-v-23e7820c],.fx-perm-reveal code[data-v-23e7820c]{font-family:var(--fe-font-mono, monospace);background:var(--fe-bg-hover);padding:1px 6px;border-radius:5px}.fx-perm-mailrow[data-v-23e7820c]{display:flex;gap:8px;margin-top:10px}.fx-perm-mailrow .fx-perm-input[data-v-23e7820c]{flex:1}.fx-perm-hint[data-v-23e7820c]{font-size:13px;color:var(--fe-text-muted);margin:10px 0 0}.fx-perm-sharebtn[data-v-23e7820c]{display:flex;width:100%;align-items:center;justify-content:center;gap:6px;margin-top:8px}.fx-perm-dropintro[data-v-23e7820c]{margin:0 0 12px;line-height:1.4}.fx-perm-advtoggle[data-v-23e7820c]{margin-top:10px;padding-left:2px}.fx-perm-adv[data-v-23e7820c]{margin-top:8px;padding-top:10px;border-top:1px dashed var(--fe-border);display:flex;flex-direction:column;gap:8px}.fx-perm-adv-row[data-v-23e7820c]{display:flex;align-items:center;justify-content:space-between;gap:10px;font-size:13px}.fx-perm-input--sm[data-v-23e7820c]{width:130px;padding:5px 8px;font-size:12px}.fx-perm-warn[data-v-23e7820c]{background:#f59e0b24;border:1px solid rgba(245,158,11,.4);border-radius:var(--fe-radius-sm, 7px);padding:8px 10px;font-size:13px;margin-bottom:10px;color:var(--fe-text)}.fx-perm-notice[data-v-23e7820c]{margin-top:8px;font-size:13px;color:var(--fe-text-muted)}.fx-perm-reveal[data-v-23e7820c]{margin-top:8px;font-size:13px;word-break:break-all;color:var(--fe-text)}.fx-perm-muted[data-v-23e7820c]{color:var(--fe-text-muted);font-size:13px}:root{--fe-bg: #ffffff;--fe-bg-elev: #f7f8fa;--fe-bg-hover: #edf0f5;--fe-bg-selected: #dfe8ff;--fe-border: #e2e6ed;--fe-border-strong: #c7ced9;--fe-text: #1a1e27;--fe-text-muted: #5a6475;--fe-text-on-primary: #ffffff;--fe-primary: #2f6fe0;--fe-primary-hover: #2563eb;--fe-danger: #dc2626;--fe-danger-hover: #b91c1c;--fe-shadow: 0 10px 32px rgba(15, 23, 42, .14);--fe-shadow-sm: 0 2px 6px rgba(15, 23, 42, .08);--fe-radius: 8px;--fe-radius-sm: 4px;--fe-radius-lg: 12px;--fe-font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;--fe-font-mono: ui-monospace, "SF Mono", Consolas, Menlo, monospace;--fe-gap: 12px}.fe--theme-dark,:root[data-theme=dark] .fe,.fe.fe--theme-dark,:root.dark,.dark,:root.dark .fe,.dark .fe,.fe-ctx-backdrop--theme-dark,.fe-ctx-backdrop--theme-auto[data-prefers-dark="1"]{--fe-bg: #0f1419;--fe-bg-elev: #161c25;--fe-bg-hover: #1f2733;--fe-bg-selected: #23324a;--fe-border: #2a323e;--fe-border-strong: #3a4453;--fe-text: #e5e9f0;--fe-text-muted: #8b95a7;--fe-primary: #60a5fa;--fe-primary-hover: #3b82f6;--fe-danger: #f87171;--fe-danger-hover: #ef4444;--fe-shadow: 0 12px 32px rgba(0, 0, 0, .45);--fe-shadow-sm: 0 2px 6px rgba(0, 0, 0, .25)}@media (prefers-color-scheme: dark){.fe:not(.fe--theme-light),.fe-ctx-backdrop--theme-auto:not(.fe-ctx-backdrop--theme-light){--fe-bg: #0f1419;--fe-bg-elev: #161c25;--fe-bg-hover: #1f2733;--fe-bg-selected: #23324a;--fe-border: #2a323e;--fe-border-strong: #3a4453;--fe-text: #e5e9f0;--fe-text-muted: #8b95a7;--fe-primary: #60a5fa;--fe-primary-hover: #3b82f6;--fe-danger: #f87171;--fe-danger-hover: #ef4444;--fe-shadow: 0 12px 32px rgba(0, 0, 0, .45);--fe-shadow-sm: 0 2px 6px rgba(0, 0, 0, .25)}}:root{--fe-icon-folder: #d97706;--fe-icon-image: #7c3aed;--fe-icon-video: #db2777;--fe-icon-audio: #0d9488;--fe-icon-pdf: #dc2626;--fe-icon-doc: #2563eb;--fe-icon-sheet: #16a34a;--fe-icon-slides: #ea580c;--fe-icon-archive: #78716c;--fe-icon-code: #4f46e5;--fe-icon-text: #64748b;--fe-icon-unknown: #64748b}.fe--theme-dark,:root[data-theme=dark] .fe,.fe.fe--theme-dark,:root.dark,.dark,:root.dark .fe,.dark .fe,.fe-ctx-backdrop--theme-dark,.fe-ctx-backdrop--theme-auto[data-prefers-dark="1"]{--fe-icon-folder: #fbbf24;--fe-icon-image: #a78bfa;--fe-icon-video: #f472b6;--fe-icon-audio: #2dd4bf;--fe-icon-pdf: #f87171;--fe-icon-doc: #60a5fa;--fe-icon-sheet: #4ade80;--fe-icon-slides: #fb923c;--fe-icon-archive: #a8a29e;--fe-icon-code: #818cf8;--fe-icon-text: #94a3b8;--fe-icon-unknown: #8b95a7}@media (prefers-color-scheme: dark){.fe:not(.fe--theme-light),.fe-ctx-backdrop--theme-auto:not(.fe-ctx-backdrop--theme-light){--fe-icon-folder: #fbbf24;--fe-icon-image: #a78bfa;--fe-icon-video: #f472b6;--fe-icon-audio: #2dd4bf;--fe-icon-pdf: #f87171;--fe-icon-doc: #60a5fa;--fe-icon-sheet: #4ade80;--fe-icon-slides: #fb923c;--fe-icon-archive: #a8a29e;--fe-icon-code: #818cf8;--fe-icon-text: #94a3b8;--fe-icon-unknown: #8b95a7}}:root,.fe--theme-dark,:root.dark,.dark{--fe-warning: #f59e0b}.fe{position:relative;display:flex;flex-direction:column;box-sizing:border-box;min-height:420px;height:100%;background:var(--fe-bg);color:var(--fe-text);font-family:var(--fe-font);font-size:14px;border:1px solid var(--fe-border);border-radius:var(--fe-radius);overflow:hidden;outline:none}.fe *{box-sizing:border-box}.fe__body{flex:1 1 auto;overflow:auto;min-height:0;background:var(--fe-bg)}filex-explorer{display:block;height:100%}.fe__presence{flex:0 0 auto;padding:.25rem .75rem;border-bottom:1px solid var(--fe-border, rgba(0, 0, 0, .06))}.fe__loading{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:14px;min-height:240px;height:100%;color:var(--fe-text-muted)}.fe__spinner{width:34px;height:34px;border-radius:50%;border:3px solid color-mix(in srgb,var(--fe-text-muted) 30%,transparent);border-top-color:var(--fe-primary);animation:fe-spin .7s linear infinite}.fe__loading-text{margin:0;font-size:13px}@keyframes fe-spin{to{transform:rotate(360deg)}}.fe__notfound{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:6px;min-height:240px;height:100%;color:var(--fe-text-muted);text-align:center;padding:24px}.fe__notfound-icon{font-size:40px;filter:grayscale(1);opacity:.6}.fe__notfound-title{margin:4px 0 0;font-size:15px;font-weight:600;color:var(--fe-text)}.fe__notfound-path{margin:0;font-size:12px;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;word-break:break-all;max-width:480px}.fe__notfound-desc{margin:0 0 10px;font-size:13px}.fe__file-input{position:absolute;left:-9999px;width:1px;height:1px;opacity:0}.fe-btn{display:inline-flex;align-items:center;gap:6px;padding:6px 12px;background:var(--fe-bg-elev);border:1px solid var(--fe-border);border-radius:var(--fe-radius-sm);color:var(--fe-text);font:inherit;cursor:pointer;transition:background .12s,border-color .12s;white-space:nowrap}.fe-btn:hover:not(:disabled){background:var(--fe-bg-hover);border-color:var(--fe-border-strong)}.fe-btn:disabled{opacity:.5;cursor:not-allowed}.fe-btn--primary{background:var(--fe-primary);border-color:var(--fe-primary);color:var(--fe-text-on-primary)}.fe-btn--primary:hover:not(:disabled){background:var(--fe-primary-hover);border-color:var(--fe-primary-hover)}.fe-btn--danger{background:var(--fe-danger);border-color:var(--fe-danger);color:var(--fe-text-on-primary)}.fe-btn--danger:hover:not(:disabled){background:var(--fe-danger-hover);border-color:var(--fe-danger-hover)}.fe-btn--icon-only{padding:6px 8px}.fe-btn.is-active{background:var(--fe-bg-selected);border-color:var(--fe-primary)}.fe-btn__label{line-height:1}.fe-icon{font-size:1.05em;line-height:1}.fe-toolbar{display:flex;align-items:center;gap:8px;padding:10px 12px;background:var(--fe-bg-elev);border-bottom:1px solid var(--fe-border);flex-wrap:wrap}.fe-toolbar__primary{display:inline-flex;align-items:center;gap:6px;flex-wrap:wrap}.fe-toolbar__spacer{flex:1 1 auto}.fe-toolbar__search-group{display:inline-flex;align-items:center;gap:4px;background:var(--fe-bg);border:1px solid var(--fe-border);border-radius:var(--fe-radius-sm);padding:2px}.fe-toolbar__search-group .fe-search__input{border:0;background:transparent;padding:4px 8px}.fe-toolbar__search-group .fe-btn{border:0;background:transparent;padding:4px 6px}.fe-toolbar__search-group .fe-btn:hover:not(:disabled){background:var(--fe-bg-hover)}.fe-toolbar__view{display:inline-flex;gap:2px;padding:2px;background:var(--fe-bg);border:1px solid var(--fe-border);border-radius:var(--fe-radius-sm)}.fe-toolbar__view .fe-btn{border:0;background:transparent}.fe-toolbar__view .fe-btn.is-active{background:var(--fe-bg-selected)}.fe-search{position:relative}.fe-search__input{background:var(--fe-bg);border:1px solid var(--fe-border);border-radius:var(--fe-radius-sm);padding:6px 10px;font:inherit;color:var(--fe-text);min-width:200px}.fe-search__input:focus-visible{outline:2px solid var(--fe-primary);outline-offset:1px}.fe-breadcrumb{display:flex;align-items:center;gap:4px;flex-wrap:wrap;padding:6px 12px;min-height:37px;background:var(--fe-bg);border-bottom:1px solid var(--fe-border);font-size:13px;color:var(--fe-text-muted)}.fe-breadcrumb__crumb{display:inline-flex;align-items:center;gap:4px;background:transparent;border:0;color:inherit;padding:2px 6px;border-radius:var(--fe-radius-sm);cursor:pointer;font:inherit}.fe-breadcrumb__crumb:hover{background:var(--fe-bg-hover);color:var(--fe-text)}.fe-breadcrumb__crumb.is-last{color:var(--fe-text);font-weight:600}.fe-breadcrumb__sep{color:var(--fe-text-muted)}.fe-breadcrumb__edit{margin-left:auto;background:none;border:1px solid transparent;color:var(--fe-text-muted);cursor:pointer;font-size:14px;line-height:1;padding:4px 8px;border-radius:4px}.fe-breadcrumb__edit:hover{background:var(--fe-bg-hover);color:var(--fe-text);border-color:var(--fe-border)}.fe-breadcrumb__input{flex:1;background:var(--fe-bg);color:var(--fe-text);border:1px solid var(--fe-accent, #2563eb);border-radius:4px;padding:4px 8px;font-family:var(--fe-mono, ui-monospace, SFMono-Regular, Menlo, Consolas, monospace);font-size:13px;outline:none}.fe-list{display:flex;flex-direction:column}.fe-list__head{display:grid;grid-template-columns:32px minmax(0,1fr) 120px 180px;gap:8px;padding:8px 12px;font-weight:600;color:var(--fe-text-muted);font-size:12px;text-transform:uppercase;letter-spacing:.04em;background:var(--fe-bg-elev);border-bottom:1px solid var(--fe-border)}.fe-list__body{display:flex;flex-direction:column}.fe-list__row{display:grid;grid-template-columns:32px minmax(0,1fr) 120px 180px;gap:8px;padding:8px 12px;align-items:center;cursor:pointer;border-bottom:1px solid var(--fe-border);transition:background .08s;-webkit-user-select:none;user-select:none}.fe-list__row:hover{background:var(--fe-bg-hover)}.fe-list__row.is-selected{background:var(--fe-bg-selected)}.fe-list__row.is-trash{opacity:.7}.fe-list__row.is-clipped,.fe-grid__card.is-clipped{opacity:.45;font-style:italic}.fe-list__row:focus-visible{outline:2px solid var(--fe-primary);outline-offset:-2px}.fe-list__col--star{display:flex;align-items:center;justify-content:center;opacity:0;transition:opacity .12s}.fe-list__row:hover .fe-list__col--star,.fe-list__row:focus-within .fe-list__col--star,.fe-list__col--star:has(.is-starred){opacity:1}.fe-list__col--star .filex-star-btn.is-starred{color:var(--fe-warning, #f59e0b)}.fe-list__col--name{display:flex;align-items:center;gap:8px;min-width:0}.fe-list__icon{flex-shrink:0;font-size:16px}.fe-list__name-wrap{display:flex;flex-direction:column;min-width:0;flex:1 1 auto}.fe-list__name{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.fe-list__parent{font-size:11px;color:var(--fe-text-muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;margin-top:2px}.fe-list__col--size,.fe-list__col--mod{color:var(--fe-text-muted);font-size:13px}.fe-list__empty{padding:40px 20px;text-align:center;color:var(--fe-text-muted)}.fe-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(140px,1fr));gap:var(--fe-gap);padding:var(--fe-gap)}.fe-grid__card{display:flex;flex-direction:column;align-items:stretch;padding:8px;border:1px solid var(--fe-border);border-radius:var(--fe-radius);background:var(--fe-bg-elev);cursor:pointer;transition:background .08s,border-color .08s;-webkit-user-select:none;user-select:none}.fe-grid__card:hover{background:var(--fe-bg-hover);border-color:var(--fe-border-strong)}.fe-grid__card.is-selected{background:var(--fe-bg-selected);border-color:var(--fe-primary)}.fe-grid__card.is-trash{opacity:.7}.fe-grid__thumb{display:flex;align-items:center;justify-content:center;aspect-ratio:1 / 1;background:var(--fe-bg);border-radius:var(--fe-radius-sm);margin-bottom:8px;overflow:hidden}.fe-grid__thumb img{width:100%;height:100%;object-fit:cover}.fe-grid__icon{font-size:32px}.fe-grid__label{font-size:13px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.fe-grid__meta{font-size:11px;color:var(--fe-text-muted);margin-top:2px}.fe-grid__parent{font-size:11px;color:var(--fe-text-muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;margin-top:2px;font-style:italic}.fe-grid__snippet{margin-top:2px;font-size:11px;line-height:1.35;color:var(--fe-text-muted);display:-webkit-box;-webkit-line-clamp:2;line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;overflow-wrap:anywhere;text-align:left}.fe-grid__empty{grid-column:1 / -1;padding:40px 20px;text-align:center;color:var(--fe-text-muted)}.fe__dragover{position:absolute;top:0;right:0;bottom:0;left:0;z-index:30;display:flex;align-items:center;justify-content:center;background:#3b82f61f;border:3px dashed var(--fe-primary);pointer-events:none}.fe__dragover-card{background:var(--fe-bg);border-radius:var(--fe-radius-lg);padding:24px 40px;box-shadow:var(--fe-shadow);text-align:center}.fe__dragover-card .fe-icon{font-size:32px;display:block;margin-bottom:8px}.fe-upload{position:absolute;right:16px;bottom:16px;width:min(360px,calc(100% - 32px));background:var(--fe-bg);border:1px solid var(--fe-border);border-radius:var(--fe-radius);box-shadow:var(--fe-shadow);z-index:40;max-height:40vh;display:flex;flex-direction:column;overflow:hidden}.fe-upload__header{display:flex;align-items:center;justify-content:space-between;padding:10px 14px;background:var(--fe-bg-elev);border-bottom:1px solid var(--fe-border);font-size:13px}.fe-upload__count{background:var(--fe-primary);color:var(--fe-text-on-primary);font-size:12px;padding:1px 7px;border-radius:999px}.fe-upload__list{list-style:none;padding:0;margin:0;overflow:auto}.fe-upload__item{padding:10px 14px;border-bottom:1px solid var(--fe-border)}.fe-upload__item:last-child{border-bottom:0}.fe-upload__name{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:13px;margin-bottom:4px}.fe-upload__bar{background:var(--fe-bg-elev);border-radius:99px;height:6px;overflow:hidden;margin-bottom:4px}.fe-upload__bar-fill{background:var(--fe-primary);height:100%;transition:width .2s}.fe-upload__item.is-error .fe-upload__bar-fill,.fe-upload__item.is-aborted .fe-upload__bar-fill{background:var(--fe-danger)}.fe-upload__item.is-done .fe-upload__bar-fill{background:#16a34a}.fe-upload__meta{display:flex;align-items:center;justify-content:space-between;gap:6px;font-size:11px;color:var(--fe-text-muted)}.fe-upload__cancel{background:transparent;border:0;color:var(--fe-primary);cursor:pointer;font:inherit}.fe-upload-slide-enter-active,.fe-upload-slide-leave-active{transition:transform .2s,opacity .2s}.fe-upload-slide-enter-from,.fe-upload-slide-leave-to{opacity:0;transform:translateY(10px)}.fe-ops{position:absolute;left:16px;bottom:16px;width:min(320px,calc(100% - 32px));display:flex;flex-direction:column;gap:8px;z-index:40}.fe-ops__item{background:var(--fe-bg);border:1px solid var(--fe-border);border-radius:var(--fe-radius);box-shadow:var(--fe-shadow);padding:10px 14px;font-size:13px}.fe-ops__item.is-done{border-color:#16a34a}.fe-ops__item.is-error{border-color:var(--fe-danger)}.fe-ops__row{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:6px}.fe-ops__title{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;flex:1 1 auto}.fe-ops__dismiss{background:transparent;border:0;color:var(--fe-text-muted);cursor:pointer;font-size:18px;line-height:1;padding:0 4px}.fe-ops__bar{background:var(--fe-bg-elev);border-radius:99px;height:6px;overflow:hidden}.fe-ops__bar-fill{background:var(--fe-primary);height:100%;transition:width .25s}.fe-ops__item.is-done .fe-ops__bar-fill{background:#16a34a}.fe-ops__item.is-error .fe-ops__bar-fill{background:var(--fe-danger)}.fe-ops__error{margin-top:6px;font-size:11px;color:var(--fe-danger)}.fe-ops-slide-enter-active,.fe-ops-slide-leave-active{transition:transform .2s,opacity .2s}.fe-ops-slide-enter-from,.fe-ops-slide-leave-to{opacity:0;transform:translateY(10px)}.fe-ctx-backdrop{position:fixed;top:0;right:0;bottom:0;left:0;z-index:80;color:var(--fe-text);font-family:var(--fe-font);font-size:14px}.fe-ctx{position:absolute;min-width:180px;background:var(--fe-bg);border:1px solid var(--fe-border);border-radius:var(--fe-radius);box-shadow:var(--fe-shadow);padding:4px;z-index:90;color:var(--fe-text)}.fe-ctx__item{display:flex;align-items:center;gap:8px;padding:6px 10px;border-radius:var(--fe-radius-sm);border:0;background:transparent;color:var(--fe-text);font:inherit;width:100%;text-align:left;cursor:pointer}.fe-ctx__item:hover:not(.is-disabled){background:var(--fe-bg-hover)}.fe-ctx__item.is-danger{color:var(--fe-danger)}.fe-ctx__item.is-disabled{opacity:.45;cursor:not-allowed}.fe-ctx__icon{width:1.2em;text-align:center}.fe-ctx__sep{height:1px;background:var(--fe-border);margin:4px 0}.fe-ctx-enter-active,.fe-ctx-leave-active{transition:opacity .1s}.fe-ctx-enter-from,.fe-ctx-leave-to{opacity:0}.fe-modal__backdrop{position:fixed;top:0;right:0;bottom:0;left:0;z-index:70;display:flex;align-items:center;justify-content:center;background:#0d131b7a;padding:16px}.fe-modal__card{background:var(--fe-bg);border-radius:var(--fe-radius);box-shadow:var(--fe-shadow);width:100%;max-height:calc(100vh - 32px);display:flex;flex-direction:column;overflow:hidden}.fe-modal__card--sm{max-width:420px}.fe-modal__card--md{max-width:560px}.fe-modal__card--lg{max-width:800px}.fe-modal__card--xl{max-width:1080px;height:calc(100vh - 64px)}.fe-recents__backdrop{align-items:flex-start!important;padding-top:60px}.fe-recents__panel{background:var(--fe-bg, #fff);border-radius:var(--fe-radius, 8px);box-shadow:var(--fe-shadow, 0 6px 24px rgba(0, 0, 0, .18));width:min(480px,calc(100vw - 32px));max-height:calc(100vh - 96px);display:flex;flex-direction:column;overflow:hidden}.fe-recents__header{display:flex;align-items:center;justify-content:space-between;padding:10px 14px;border-bottom:1px solid var(--fe-border, #e2e6ed)}.fe-recents__close{-webkit-appearance:none;-moz-appearance:none;appearance:none;background:transparent;border:0;font-size:22px;line-height:1;cursor:pointer;color:var(--fe-text-muted, #6b7280);padding:0 4px}.fe-recents__close:hover{color:var(--fe-text, #111)}.fe-preview__md-split{display:flex;flex-direction:column;height:100%;width:100%;min-height:0}.fe-preview__md-split-bar{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:8px 14px;background:var(--fe-bg-elev, #f6f7f9);border-bottom:1px solid var(--fe-border, #e2e6ed);flex:0 0 auto}.fe-preview__md-split-label{font-family:var(--fe-font-mono, ui-monospace, monospace);font-size:11px;letter-spacing:.06em;color:var(--fe-text-muted, #6b7280)}.fe-preview__md-split-error{flex:1 1 auto;font-size:12px;color:var(--fe-danger, #dc2626);text-align:center}.fe-preview__md-split-body{flex:1 1 auto;display:grid;grid-template-columns:1fr 1fr;min-height:0}.fe-preview__md-split-input{resize:none;border:0;outline:0;padding:16px 20px;font-family:var(--fe-font-mono, ui-monospace, monospace);font-size:13px;line-height:1.6;background:var(--fe-bg, #fff);color:var(--fe-text, #111);border-right:1px solid var(--fe-border, #e2e6ed);overflow:auto;-moz-tab-size:2;tab-size:2}.fe-preview__md-split-output{overflow:auto;padding:16px 24px;background:var(--fe-bg, #fff)}.fe-preview__md-split-output.fe-preview__md{max-height:none;min-height:0;height:100%}@media (max-width: 900px){.fe-preview__md-split-body{grid-template-columns:1fr;grid-template-rows:1fr 1fr}.fe-preview__md-split-input{border-right:0;border-bottom:1px solid var(--fe-border, #e2e6ed)}}.fe-modal__backdrop--chromeless{background:transparent;padding:0}.fe-modal__card--chromeless{max-width:none;width:100vw;height:100vh;max-height:100vh;border-radius:0;box-shadow:none}.fe-modal__card--chromeless .fe-modal__body{flex:1 1 auto;min-height:0;padding:0}.fe-modal__card--chromeless .fe-preview{align-items:stretch;justify-content:stretch;min-height:0;flex:1 1 auto}.fe-modal__card--chromeless .fe-preview>*{width:100%;height:100%}.fe-modal__head{display:flex;align-items:center;justify-content:space-between;padding:12px 16px;border-bottom:1px solid var(--fe-border)}.fe-modal__title{font-size:16px;font-weight:600;margin:0}.fe-modal__close{background:transparent;border:0;color:var(--fe-text-muted);font-size:22px;cursor:pointer;padding:0 4px;line-height:1}.fe-modal__body{padding:16px;overflow:auto;flex:1 1 auto}.fe-modal__actions{display:flex;justify-content:flex-end;gap:8px;padding:12px 16px;border-top:1px solid var(--fe-border);background:var(--fe-bg-elev)}.fe-modal-enter-active,.fe-modal-leave-active{transition:opacity .15s}.fe-modal-enter-from,.fe-modal-leave-to{opacity:0}.fe-input{width:100%;padding:8px 10px;background:var(--fe-bg);border:1px solid var(--fe-border);border-radius:var(--fe-radius-sm);font:inherit;color:var(--fe-text)}.fe-input:focus-visible{outline:2px solid var(--fe-primary);outline-offset:1px}.fe-input--mono{font-family:var(--fe-font-mono);letter-spacing:.1em}.fe-form{display:flex;flex-direction:column;gap:12px}.fe-form__row{display:flex;align-items:center;gap:8px}.fe-form__row--stack{flex-direction:column;align-items:stretch}.fe-form__error{color:var(--fe-danger);font-size:12px;margin:6px 0 0}.fe-share-result{display:flex;flex-direction:column;gap:12px}.fe-share-result__row label{display:block;font-size:12px;font-weight:600;color:var(--fe-text-muted);margin-bottom:4px}.fe-share-result__copy{display:flex;gap:6px}.fe-preview{display:flex;align-items:center;justify-content:center;width:100%;height:100%;min-height:50vh;background:var(--fe-bg-elev)}.fe-preview__image{max-width:100%;max-height:70vh;object-fit:contain}.fe-preview__video,.fe-preview__audio{max-width:100%;max-height:70vh}.fe-preview__iframe{width:100%;height:70vh;border:0;background:#fff}.fe-preview__office{width:100%;height:78vh;background:var(--fe-bg)}.fe-preview__code-wrap{display:flex;flex-direction:column;width:100%;height:78vh}.fe-preview__code-toolbar{display:flex;align-items:center;gap:12px;padding:8px 12px;background:var(--fe-bg-hover, #f3f4f6);border-bottom:1px solid var(--fe-border, #e5e7eb);font-size:12px}.fe-preview__code-lang{font-family:var(--fe-font-mono, ui-monospace, monospace);color:var(--fe-text-muted);text-transform:uppercase;letter-spacing:.04em}.fe-preview__code-toolbar>.fe-btn{margin-left:auto}.fe-preview__code-status{font-size:12px;font-weight:500}.fe-preview__code-status--ok{color:#059669}.fe-preview__code-status--err{color:#dc2626;cursor:help}.fe-preview__code-editor{flex:1;min-height:0;overflow:hidden}.fe-preview__code-editor .cm-editor{height:100%;font-size:13px}.fe-preview__code-editor .cm-scroller{font-family:var(--fe-font-mono, ui-monospace, SFMono-Regular, Menlo, Consolas, monospace)}.fe-preview__fallback{text-align:center;color:var(--fe-text-muted);padding:40px 20px}.fe-preview__fallback-icon{font-size:48px;display:block;margin-bottom:12px}.fe-preview__pre{margin:0;padding:16px;width:100%;max-height:70vh;overflow:auto;background:var(--fe-bg);color:var(--fe-text);font-family:var(--fe-font-mono);font-size:13px;line-height:1.5;white-space:pre-wrap;word-wrap:break-word}.fe-preview__code{white-space:pre;word-wrap:normal}.hljs{background:var(--fe-bg);color:var(--fe-text)}.hljs-comment,.hljs-quote{color:var(--fe-text-muted);font-style:italic}.hljs-keyword,.hljs-selector-tag,.hljs-built_in,.hljs-section,.hljs-meta{color:#c678dd}.hljs-string,.hljs-attr,.hljs-symbol,.hljs-bullet,.hljs-addition,.hljs-link{color:#98c379}.hljs-number,.hljs-literal,.hljs-deletion{color:#d19a66}.hljs-title,.hljs-name,.hljs-selector-id,.hljs-selector-class,.hljs-template-tag,.hljs-template-variable{color:#61aeee}.hljs-type,.hljs-tag{color:#e06c75}.hljs-variable,.hljs-attribute{color:#d19a66}.hljs-emphasis{font-style:italic}.hljs-strong{font-weight:700}.fe-preview__md{width:100%;max-height:70vh;overflow:auto;padding:24px 32px;background:var(--fe-bg);color:var(--fe-text);line-height:1.6;font-size:15px}.fe-preview__md h1,.fe-preview__md h2,.fe-preview__md h3,.fe-preview__md h4{margin:1.2em 0 .6em;font-weight:600}.fe-preview__md h1{font-size:1.8em;border-bottom:1px solid var(--fe-border);padding-bottom:.3em}.fe-preview__md h2{font-size:1.4em;border-bottom:1px solid var(--fe-border);padding-bottom:.3em}.fe-preview__md h3{font-size:1.2em}.fe-preview__md p{margin:.8em 0}.fe-preview__md a{color:var(--fe-primary);text-decoration:underline}.fe-preview__md code{font-family:var(--fe-font-mono);background:var(--fe-bg-elev);padding:1px 5px;border-radius:3px;font-size:.92em}.fe-preview__md pre{background:var(--fe-bg-elev);border:1px solid var(--fe-border);border-radius:var(--fe-radius-sm);padding:12px 16px;overflow:auto;font-size:.9em}.fe-preview__md pre code{background:transparent;padding:0}.fe-preview__md ul,.fe-preview__md ol{padding-left:2em;margin:.8em 0}.fe-preview__md li{margin:.3em 0}.fe-preview__md blockquote{border-left:3px solid var(--fe-border-strong);padding:0 1em;color:var(--fe-text-muted);margin:.8em 0}.fe-preview__md table{border-collapse:collapse;margin:1em 0;width:100%}.fe-preview__md th,.fe-preview__md td{border:1px solid var(--fe-border);padding:6px 10px;text-align:left}.fe-preview__md th{background:var(--fe-bg-elev)}.fe-preview__md img{max-width:100%}.fe-toast{position:absolute;bottom:24px;left:50%;transform:translate(-50%);background:var(--fe-text);color:var(--fe-bg);padding:8px 14px;border-radius:var(--fe-radius);font-size:13px;box-shadow:var(--fe-shadow-sm);z-index:95}.fe-toast-enter-active,.fe-toast-leave-active{transition:opacity .2s,transform .2s}.fe-toast-enter-from,.fe-toast-leave-to{opacity:0;transform:translate(-50%,10px)}@media (max-width: 640px){.fe-list__head,.fe-list__row{grid-template-columns:28px minmax(0,1fr) 90px}.fe-list__col--mod{display:none}.fe-toolbar{padding:8px}.fe-search__input{min-width:120px}}.fe-ficon{width:1em;height:1em;display:block;flex-shrink:0}.fe-ficon--folder{color:var(--fe-icon-folder)}.fe-ficon--image{color:var(--fe-icon-image)}.fe-ficon--video{color:var(--fe-icon-video)}.fe-ficon--audio{color:var(--fe-icon-audio)}.fe-ficon--pdf{color:var(--fe-icon-pdf)}.fe-ficon--doc{color:var(--fe-icon-doc)}.fe-ficon--sheet{color:var(--fe-icon-sheet)}.fe-ficon--slides{color:var(--fe-icon-slides)}.fe-ficon--archive{color:var(--fe-icon-archive)}.fe-ficon--code{color:var(--fe-icon-code)}.fe-ficon--text{color:var(--fe-icon-text)}.fe-ficon--unknown{color:var(--fe-icon-unknown)}.fe-grid__icon--svg{display:flex;align-items:center;justify-content:center}.fe-list__icon--svg{display:inline-flex;align-items:center}.fe-list__sort{display:inline-flex;align-items:center;gap:4px;background:transparent;border:0;padding:0;font:inherit;color:inherit;text-transform:inherit;letter-spacing:inherit;cursor:pointer}.fe-list__sort:hover{color:var(--fe-text)}.fe-list__sort:focus-visible{outline:2px solid var(--fe-primary);outline-offset:2px;border-radius:2px}.fe-list__sort-arrow{font-size:11px;color:var(--fe-primary)}.fe-list__group{padding:12px 12px 4px;font-size:11px;font-weight:600;text-transform:uppercase;letter-spacing:.05em;color:var(--fe-text-muted);-webkit-user-select:none;user-select:none}.fe--density-compact .fe-toolbar{padding:6px 8px;gap:6px}.fe--density-compact .fe-breadcrumb,.fe--density-compact .fe-list__head{padding:4px 12px}.fe--density-compact .fe-list__row{padding:3px 12px}.fe--density-compact .fe-list__icon{font-size:14px}.fe--density-compact .fe-list__group{padding:8px 12px 2px}.fe--density-compact .fe-grid{grid-template-columns:repeat(auto-fill,minmax(104px,1fr));gap:8px;padding:8px}.fe--density-compact .fe-grid__card{padding:6px}.fe--density-compact .fe-grid__icon{font-size:24px}.fe-cmdp__backdrop{align-items:flex-start;padding-top:min(18vh,160px)}.fe-cmdp{background:var(--fe-bg);border:1px solid var(--fe-border);border-radius:var(--fe-radius-lg);box-shadow:var(--fe-shadow);width:min(560px,calc(100vw - 32px));display:flex;flex-direction:column;overflow:hidden}.fe-cmdp__inputwrap{display:flex;align-items:center;gap:8px;padding:10px 14px;border-bottom:1px solid var(--fe-border);color:var(--fe-text-muted)}.fe-cmdp__glyph{flex:0 0 auto}.fe-cmdp__input{flex:1 1 auto;min-width:0;border:0;outline:none;background:transparent;color:var(--fe-text);font:inherit;font-size:15px}.fe-cmdp__input::placeholder{color:var(--fe-text-muted)}.fe-cmdp__list{max-height:min(48vh,380px);overflow-y:auto;padding:6px}.fe-cmdp__group{padding:8px 10px 4px;font-size:11px;font-weight:600;letter-spacing:.05em;text-transform:uppercase;color:var(--fe-text-muted)}.fe-cmdp__item{display:flex;align-items:center;gap:10px;width:100%;text-align:left;background:transparent;border:0;border-radius:var(--fe-radius-sm);padding:8px 10px;color:var(--fe-text);font:inherit;font-size:14px;cursor:pointer}.fe-cmdp__item.is-active{background:var(--fe-bg-selected)}.fe-cmdp__item:focus-visible{outline:2px solid var(--fe-primary);outline-offset:-2px}.fe-cmdp__icon{flex:0 0 auto;width:20px;text-align:center}.fe-cmdp__label{flex:1 1 auto;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.fe-cmdp__empty{padding:20px 12px;text-align:center;color:var(--fe-text-muted);font-size:13px}.fe-cmdp__hint{padding:8px 14px;border-top:1px solid var(--fe-border);background:var(--fe-bg-elev);font-size:11px;color:var(--fe-text-muted)}.fe-shortcuts{display:flex;flex-direction:column;gap:16px}.fe-shortcuts__heading{margin:0 0 6px;font-size:11px;font-weight:600;letter-spacing:.05em;text-transform:uppercase;color:var(--fe-text-muted)}.fe-shortcuts__table{display:flex;flex-direction:column}.fe-shortcuts__row{display:flex;align-items:center;gap:12px;padding:4px 0}.fe-shortcuts__keys{flex:0 0 40%;display:flex;align-items:center;gap:6px;flex-wrap:wrap}.fe-shortcuts__desc{flex:1 1 auto;font-size:13px;color:var(--fe-text)}.fe-shortcuts__or{color:var(--fe-text-muted);font-size:11px}.fe-kbd{display:inline-block;padding:2px 7px;border:1px solid var(--fe-border-strong);border-bottom-width:2px;border-radius:var(--fe-radius-sm);background:var(--fe-bg-elev);color:var(--fe-text);font-family:var(--fe-font-mono);font-size:11.5px;line-height:1.4}.fe-breadcrumb__more-wrap{position:relative;display:inline-flex;align-items:center;gap:4px}.fe-breadcrumb__more{background:transparent;border:0;color:inherit;padding:2px 8px;border-radius:var(--fe-radius-sm);cursor:pointer;font:inherit;line-height:1.2}.fe-breadcrumb__more:hover,.fe-breadcrumb__more[aria-expanded=true]{background:var(--fe-bg-hover);color:var(--fe-text)}.fe-breadcrumb__more:focus-visible{outline:2px solid var(--fe-primary);outline-offset:1px}.fe-breadcrumb__menu{position:absolute;top:calc(100% + 4px);left:0;z-index:80;min-width:160px;max-width:280px;max-height:40vh;overflow-y:auto;display:flex;flex-direction:column;padding:4px;background:var(--fe-bg);border:1px solid var(--fe-border);border-radius:var(--fe-radius);box-shadow:var(--fe-shadow)}.fe-breadcrumb__menu-item{text-align:left;background:transparent;border:0;padding:6px 10px;border-radius:var(--fe-radius-sm);color:var(--fe-text);font:inherit;font-size:13px;cursor:pointer;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.fe-breadcrumb__menu-item:hover,.fe-breadcrumb__menu-item:focus-visible{background:var(--fe-bg-hover)}.fe-breadcrumb__crumb>span:first-child{max-width:200px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}@media (max-width: 640px){.fe-breadcrumb__crumb>span:first-child{max-width:110px}}@media (prefers-reduced-motion: reduce){.fe-modal-enter-active,.fe-modal-leave-active{transition:none!important}}.fe-sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;border:0}.fe__skeleton{min-height:240px}.fe-skel{position:relative;overflow:hidden;border-radius:var(--fe-radius-sm);background:color-mix(in srgb,var(--fe-text-muted) 14%,transparent)}.fe-skel:after{content:"";position:absolute;top:0;right:0;bottom:0;left:0;transform:translate(-100%);background:linear-gradient(90deg,transparent,color-mix(in srgb,var(--fe-text-muted) 12%,transparent),transparent);animation:fe-skel-shimmer 1.4s ease-in-out infinite}@keyframes fe-skel-shimmer{to{transform:translate(100%)}}@media (prefers-reduced-motion: reduce){.fe-skel:after{animation:none;content:none}}.fe-skel-list{padding-top:2px}.fe-skel-row{display:grid;grid-template-columns:32px minmax(0,1fr) 120px 180px;gap:8px;align-items:center;padding:12px;border-bottom:1px solid var(--fe-border)}.fe-skel-row .fe-skel{height:12px}.fe-skel-row .fe-skel--icon{width:20px;height:20px;border-radius:6px}.fe-skel-row .fe-skel--name{width:55%}.fe-skel-row:nth-child(2n) .fe-skel--name{width:38%}.fe-skel-row:nth-child(3n) .fe-skel--name{width:70%}.fe-skel-row .fe-skel--size{width:56px;justify-self:start}.fe-skel-row .fe-skel--date{width:110px;justify-self:start}.fe-skel-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(140px,1fr));gap:var(--fe-gap);padding:var(--fe-gap)}.fe-skel-card{display:flex;flex-direction:column;gap:8px;padding:8px;border:1px solid var(--fe-border);border-radius:var(--fe-radius);background:var(--fe-bg-elev)}.fe-skel-card .fe-skel--thumb{aspect-ratio:1 / 1}.fe-skel-card .fe-skel--label{height:12px;width:70%}.fe-skel-card:nth-child(2n) .fe-skel--label{width:50%}.fe-skel-card:nth-child(3n) .fe-skel--label{width:85%}.fe-state{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:6px;min-height:240px;height:100%;padding:24px;text-align:center;color:var(--fe-text-muted)}.fe-state__art{color:var(--fe-text-muted);opacity:.7;margin-bottom:4px;flex:0 0 auto}.fe-state__title{margin:2px 0 0;font-size:15px;font-weight:600;color:var(--fe-text)}.fe-state__hint{margin:0;font-size:13px;max-width:420px}.fe-state__path{margin:0;font-size:12px;font-family:var(--fe-font-mono);word-break:break-all;max-width:480px}.fe-state__actions{margin-top:12px;display:flex;gap:8px}.fe-toast--action{display:flex;align-items:center;gap:14px;padding:8px 10px 8px 14px;cursor:pointer;max-width:min(480px,calc(100% - 32px))}.fe-toast__msg{min-width:0}.fe-toast__action{flex:0 0 auto;background:transparent;border:0;padding:4px 8px;border-radius:var(--fe-radius-sm);font:inherit;font-weight:600;color:color-mix(in srgb,var(--fe-primary) 70%,var(--fe-bg));cursor:pointer}.fe-toast__action:hover{background:color-mix(in srgb,var(--fe-bg) 14%,transparent)}.fe-toast__action:focus-visible{outline:2px solid var(--fe-bg);outline-offset:1px}.fe-connbadge{display:inline-flex;align-items:center;gap:6px;font-size:12px;line-height:1.4;color:var(--fe-text-muted);background:var(--fe-bg-elev);border:1px solid var(--fe-border);border-radius:999px;padding:2px 10px;cursor:help;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:100%}.fe-connbadge__dot{flex:0 0 auto;width:7px;height:7px;border-radius:50%;background:var(--fe-warning, #f59e0b)}.fe-cmdp__item--hit{align-items:flex-start}.fe-cmdp__item--hit .fe-cmdp__icon{margin-top:1px}.fe-cmdp__hitbody{flex:1 1 auto;min-width:0;display:flex;flex-direction:column;gap:2px}.fe-cmdp__hitline{display:flex;align-items:center;gap:8px;min-width:0}.fe-cmdp__badge,.fe-list__badge{flex:0 0 auto;display:inline-block;padding:1px 6px;border-radius:999px;border:1px solid color-mix(in srgb,var(--fe-primary) 35%,transparent);background:color-mix(in srgb,var(--fe-primary) 12%,transparent);color:var(--fe-primary);font-size:10px;font-weight:600;line-height:1.5;white-space:nowrap;vertical-align:middle}.fe-cmdp__crumb{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:11.5px;color:var(--fe-text-muted)}.fe-cmdp__snippet,.fe-list__snippet{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:12px;color:var(--fe-text-muted)}.fe-cmdp__mark,.fe-list__mark,.fe-grid__mark{background:color-mix(in srgb,var(--fe-primary) 22%,transparent);color:var(--fe-text);border-radius:2px;padding:0 1px;font-weight:600}.fe-cmdp__loading{padding:8px 12px;font-size:13px;color:var(--fe-text-muted)}.fe-cmdp__item--saved{-webkit-user-select:none;user-select:none}.fe-cmdp__del{flex:0 0 auto;background:transparent;border:0;border-radius:var(--fe-radius-sm);padding:2px 6px;font:inherit;font-size:13px;color:var(--fe-text-muted);cursor:pointer;opacity:.55}.fe-cmdp__item--saved:hover .fe-cmdp__del,.fe-cmdp__item--saved.is-active .fe-cmdp__del{opacity:1}.fe-cmdp__del:hover{background:var(--fe-bg-elev);color:var(--fe-danger, #dc2626)}.fe-cmdp__del:focus-visible{outline:2px solid var(--fe-primary);outline-offset:-2px}.fe-list__snippet{max-width:100%}.fe-toolbar--narrow{flex-wrap:nowrap;gap:6px}.fe-toolbar--narrow .fe-btn.is-active{background:var(--fe-bg-selected)}.fe-toolbar--narrow .fe-search--full{flex:1 1 auto;min-width:0}.fe-toolbar--narrow .fe-search--full .fe-search__input{width:100%;min-width:0}.fe-fab{position:absolute;right:16px;bottom:16px;width:56px;height:56px;border:0;border-radius:50%;background:var(--fe-primary);color:var(--fe-text-on-primary);font-size:24px;display:flex;align-items:center;justify-content:center;box-shadow:var(--fe-shadow);cursor:pointer;z-index:45;transition:background .15s,transform .15s}.fe-fab:hover{background:var(--fe-primary-hover)}.fe-fab:active{transform:scale(.94)}.fe-fab:focus-visible{outline:2px solid var(--fe-primary);outline-offset:3px}.fe--narrow .fe-upload,.fe--narrow .fe-ops{bottom:84px}.fe-ctx-backdrop--sheet{background:#0d131b6b}.fe-sheet{position:fixed;left:0;right:0;bottom:0;max-height:70vh;display:flex;flex-direction:column;background:var(--fe-bg);color:var(--fe-text);border:1px solid var(--fe-border);border-bottom:0;border-top-left-radius:var(--fe-radius-lg);border-top-right-radius:var(--fe-radius-lg);box-shadow:0 -10px 32px #0f172a47;padding:0 8px calc(8px + env(safe-area-inset-bottom,0px));outline:none;z-index:90}.fe-sheet__handle{flex:0 0 auto;display:flex;align-items:center;justify-content:center;padding:12px 0 8px;cursor:grab;touch-action:none}.fe-sheet__handle:before{content:"";width:40px;height:4px;border-radius:99px;background:var(--fe-border-strong)}.fe-sheet__items{overflow-y:auto;overscroll-behavior:contain;-webkit-overflow-scrolling:touch}.fe-sheet__item{min-height:44px;padding:10px 14px;font-size:15px;gap:12px}.fe-sheet-enter-active,.fe-sheet-leave-active{transition:opacity .18s ease}.fe-sheet-enter-active .fe-sheet,.fe-sheet-leave-active .fe-sheet{transition:transform .22s ease}.fe-sheet-enter-from,.fe-sheet-leave-to{opacity:0}.fe-sheet-enter-from .fe-sheet,.fe-sheet-leave-to .fe-sheet{transform:translateY(100%)}@media (prefers-reduced-motion: reduce){.fe-sheet-enter-active,.fe-sheet-leave-active,.fe-sheet-enter-active .fe-sheet,.fe-sheet-leave-active .fe-sheet,.fe-fab{transition:none}}.fe__main{display:flex;flex-direction:row;flex:1 1 auto;min-height:0}.fe__main>.fe__body{min-width:0;height:100%}.fe-inspector{flex:0 0 300px;width:300px;min-height:0;display:flex;flex-direction:column;border-left:1px solid var(--fe-border);background:var(--fe-bg);color:var(--fe-text)}.fe-inspector--overlay{position:absolute;top:0;right:0;bottom:0;left:0;z-index:60;width:auto;border-left:none}.fe-inspector__head{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:10px 12px;border-bottom:1px solid var(--fe-border);flex:0 0 auto}.fe-inspector__title{margin:0;font-size:13px;font-weight:600;letter-spacing:.02em}.fe-inspector__close{border:none;background:none;color:var(--fe-text-muted);font-size:18px;line-height:1;cursor:pointer;padding:2px 6px;border-radius:6px}.fe-inspector__close:hover{background:var(--fe-bg-hover);color:var(--fe-text)}.fe-inspector__scroll{flex:1 1 auto;min-height:0;overflow-y:auto;padding:12px}.fe-inspector__section{margin-bottom:18px}.fe-inspector__section:last-child{margin-bottom:0}.fe-inspector__heading{margin:0 0 8px;font-size:11px;font-weight:600;text-transform:uppercase;letter-spacing:.06em;color:var(--fe-text-muted)}.fe-inspector__hero{display:flex;flex-direction:column;align-items:center;gap:6px;text-align:center;padding:6px 0 4px}.fe-inspector__bigicon{display:inline-flex}.fe-inspector__bigicon .fe-ficon{width:56px;height:56px}.fe-inspector__thumb{width:96px;height:96px;object-fit:cover;border-radius:var(--fe-radius);border:1px solid var(--fe-border)}.fe-inspector__name{margin:0;font-size:13px;font-weight:600;word-break:break-word;max-width:100%}.fe-inspector__sub{margin:0;font-size:12px;color:var(--fe-text-muted)}.fe-inspector__meta{margin:8px 0 0;display:flex;flex-direction:column;gap:6px}.fe-inspector__row{display:flex;align-items:baseline;gap:8px;font-size:12px}.fe-inspector__row dt{flex:0 0 84px;color:var(--fe-text-muted)}.fe-inspector__row dd{margin:0;min-width:0;flex:1 1 auto;word-break:break-word}.fe-inspector__pathcell{display:flex;align-items:center;gap:4px}.fe-inspector__path{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;direction:rtl;text-align:left}.fe-inspector__mime{font-family:var(--fe-font-mono);font-size:11px}.fe-inspector__copy{flex:0 0 auto;border:none;background:none;color:var(--fe-text-muted);cursor:pointer;font-size:13px;line-height:1;padding:2px 4px;border-radius:4px}.fe-inspector__copy:hover{background:var(--fe-bg-hover);color:var(--fe-text)}.fe-inspector__empty{margin:0;font-size:12px;color:var(--fe-text-muted)}.fe-btn--sm{padding:3px 8px;font-size:12px}.fe-inspector__versions{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:8px}.fe-inspector__version{display:flex;flex-direction:column;gap:6px;padding:8px;border:1px solid var(--fe-border);border-radius:var(--fe-radius)}.fe-inspector__version-main{display:flex;flex-direction:column;gap:2px}.fe-inspector__version-n{font-size:12px;font-weight:600}.fe-inspector__version-meta{font-size:11px;color:var(--fe-text-muted)}.fe-inspector__confirm{display:flex;flex-direction:column;gap:6px}.fe-inspector__confirm-q{margin:0;font-size:12px}.fe-inspector__check{display:flex;align-items:center;gap:6px;font-size:11px;color:var(--fe-text-muted);cursor:pointer}.fe-inspector__confirm-actions{display:flex;gap:6px}.fe-inspector__snapshot{margin-top:8px;width:100%}.fe-inspector__permrow{display:flex;align-items:center;gap:8px;flex-wrap:wrap}.fe-inspector__badge{display:inline-flex;align-items:center;padding:2px 8px;border-radius:99px;font-size:11px;font-weight:600;border:1px solid var(--fe-border-strong);color:var(--fe-text);background:var(--fe-bg-hover)}.fe-inspector__badge--owner{border-color:var(--fe-primary);color:var(--fe-primary);background:transparent}.fe-inspector__badge--none{color:var(--fe-text-muted)}.fe-inspector__badge--pin{border-color:var(--fe-warning, #f59e0b);color:var(--fe-warning, #f59e0b);background:transparent}.fe-inspector__shares{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:6px}.fe-inspector__share{display:flex;align-items:center;gap:6px;font-size:12px;min-width:0}.fe-inspector__share-url{flex:1 1 auto;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.fe-inspector__share-exp{flex:0 0 auto;font-size:11px;color:var(--fe-text-muted)}@media (prefers-reduced-motion: no-preference){.fe-inspector{animation:fe-inspector-in .16s ease}@keyframes fe-inspector-in{0%{opacity:0;transform:translate(8px)}to{opacity:1;transform:none}}}.fe-shortcuts__unbound{font-size:12px;font-style:italic;color:var(--fe-text-muted)}.fe-shortcuts__custom{margin-left:4px;font-size:9px;vertical-align:2px;color:var(--fe-primary)}.fe-shortset{display:flex;flex-direction:column;gap:14px}.fe-shortset__topbar{display:flex;align-items:center;justify-content:space-between;gap:12px}.fe-shortset__hint{margin:0;font-size:12px;color:var(--fe-text-muted);flex:1 1 auto}.fe-shortset__reset-all{flex:0 0 auto}.fe-shortset__group{display:flex;flex-direction:column}.fe-shortset__item{border-radius:var(--fe-radius-sm);padding:2px 6px;margin:0 -6px}.fe-shortset__item.is-capturing{background:var(--fe-bg-hover);outline:1px dashed var(--fe-primary);outline-offset:-1px}.fe-shortset__item.is-conflict{background:color-mix(in srgb,var(--fe-danger) 8%,transparent);outline:1px solid var(--fe-danger);outline-offset:-1px}.fe-shortset__row{display:flex;align-items:center;gap:12px;padding:4px 0;min-height:34px}.fe-shortset__label{flex:1 1 auto;font-size:13px;color:var(--fe-text)}.fe-shortset__keys{flex:0 0 auto;display:flex;align-items:center;gap:6px;flex-wrap:wrap;justify-content:flex-end}.fe-shortset__capture{font-size:12px;color:var(--fe-primary);animation:fe-shortset-blink 1.1s ease-in-out infinite}@keyframes fe-shortset-blink{0%,to{opacity:1}50%{opacity:.45}}.fe-shortset__actions{flex:0 0 auto;display:flex;align-items:center;gap:6px;min-width:118px;justify-content:flex-end}.fe-shortset__btn{padding:3px 9px;font-size:12px}.fe-shortset__fixed{font-size:11px;text-transform:uppercase;letter-spacing:.04em;color:var(--fe-text-muted);border:1px solid var(--fe-border);border-radius:var(--fe-radius-sm);padding:2px 7px}.fe-shortset__conflict{display:flex;align-items:center;gap:10px;flex-wrap:wrap;padding:6px 2px 8px;font-size:12.5px;color:var(--fe-danger)}.fe-shortset__conflict-msg{flex:1 1 auto;display:inline-flex;align-items:center;gap:6px;min-width:200px}.fe-shortset__conflict-actions{flex:0 0 auto;display:flex;gap:6px}.fe-ql-hint{position:fixed;left:50%;bottom:14px;transform:translate(-50%);z-index:72;display:inline-flex;flex-direction:row;align-items:center;width:auto;height:auto;min-height:0;gap:6px;padding:6px 12px;border-radius:999px;border:1px solid var(--fe-border);background:var(--fe-bg-elev);color:var(--fe-text-muted);font-size:12px;box-shadow:var(--fe-shadow);pointer-events:none;white-space:nowrap}.fe-ql-hint .fe-kbd{font-size:10.5px;padding:1px 5px}.fe-ql-hint__sep{opacity:.5}.fe-opc{position:absolute;right:16px;bottom:16px;z-index:45;display:flex;flex-direction:column;align-items:flex-end;gap:10px;max-width:calc(100% - 32px)}.fe-opc__badge{display:flex;align-items:center;gap:8px;padding:8px 14px 8px 10px;border-radius:999px;border:1px solid var(--fe-border);background:var(--fe-bg);color:var(--fe-text);box-shadow:var(--fe-shadow);cursor:pointer;font:inherit;font-size:13px;line-height:1}.fe-opc__badge:hover{background:var(--fe-bg-hover)}.fe-opc__badge:focus-visible{outline:2px solid var(--fe-primary);outline-offset:2px}.fe-opc__badge.is-error{border-color:var(--fe-danger)}.fe-opc__badge.is-error .fe-opc__count{color:var(--fe-danger)}.fe-opc__ring{width:22px;height:22px;flex:0 0 auto}.fe-opc__ring-track{stroke:var(--fe-border-strong)}.fe-opc__ring-fill{stroke:var(--fe-primary);transition:stroke-dashoffset .25s}.fe-opc__badge.is-error .fe-opc__ring-fill{stroke:var(--fe-danger)}.fe-opc__ring--spin{animation:fe-opc-spin 1s linear infinite}@keyframes fe-opc-spin{to{transform:rotate(360deg)}}.fe-opc__count{font-weight:600}.fe-opc__pct{color:var(--fe-text-muted);font-size:12px}.fe-opc__panel{width:min(380px,calc(100vw - 32px));max-width:100%;max-height:min(420px,60vh);display:flex;flex-direction:column;overflow:hidden;background:var(--fe-bg);border:1px solid var(--fe-border);border-radius:var(--fe-radius-lg);box-shadow:var(--fe-shadow)}.fe-opc__head{display:flex;align-items:center;justify-content:space-between;padding:10px 14px;background:var(--fe-bg-elev);border-bottom:1px solid var(--fe-border);font-size:13px}.fe-opc__body{overflow:auto;padding:6px 0 8px}.fe-opc__section+.fe-opc__section{border-top:1px solid var(--fe-border);margin-top:6px}.fe-opc__section-title{display:flex;align-items:center;justify-content:space-between;margin:0;padding:8px 14px 4px;font-size:11px;font-weight:600;text-transform:uppercase;letter-spacing:.04em;color:var(--fe-text-muted)}.fe-opc__list{list-style:none;margin:0;padding:0}.fe-opc__item{display:flex;align-items:flex-start;gap:10px;padding:8px 14px}.fe-opc__item+.fe-opc__item{border-top:1px solid var(--fe-border)}.fe-opc__item.is-error{background:color-mix(in srgb,var(--fe-danger) 7%,transparent)}.fe-opc__kicon{width:18px;height:18px;flex:0 0 auto;margin-top:2px;color:var(--fe-text-muted)}.fe-opc__item.is-error .fe-opc__kicon{color:var(--fe-danger)}.fe-opc__mid{flex:1 1 auto;min-width:0}.fe-opc__name{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:13px}.fe-opc__sub{display:flex;align-items:baseline;gap:5px;font-size:11px;color:var(--fe-text-muted);margin-top:1px;min-width:0}.fe-opc__sub--err,.fe-opc__item.is-error .fe-opc__state{color:var(--fe-danger)}.fe-opc__state{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.fe-opc__bar{background:var(--fe-bg-elev);border-radius:99px;height:5px;overflow:hidden;margin-top:5px}.fe-opc__bar-fill{background:var(--fe-primary);height:100%;transition:width .2s}.fe-opc__spin{flex:0 0 auto;width:14px;height:14px;margin-top:4px;border-radius:50%;border:2px solid var(--fe-border-strong);border-top-color:var(--fe-primary);animation:fe-opc-spin .8s linear infinite}.fe-opc__acts{display:flex;align-items:center;gap:2px;flex:0 0 auto}.fe-opc__act{background:transparent;border:0;color:var(--fe-primary);cursor:pointer;font:inherit;font-size:12px;padding:2px 4px;border-radius:var(--fe-radius-sm)}.fe-opc__act:hover{background:var(--fe-bg-hover)}.fe-opc__act--retry{font-weight:600}.fe-opc__x{background:transparent;border:0;color:var(--fe-text-muted);cursor:pointer;font-size:16px;line-height:1;padding:0 4px;border-radius:var(--fe-radius-sm)}.fe-opc__x:hover{color:var(--fe-text)}.fe-opc__item--history .fe-opc__name{font-size:12px;color:var(--fe-text-muted)}.fe-opc__chip{flex:0 0 auto;font-size:10px;font-weight:600;padding:2px 7px;border-radius:999px;background:var(--fe-bg-elev);color:var(--fe-text-muted)}.fe-opc__chip.is-done{color:var(--fe-ok, #16a34a);background:color-mix(in srgb,var(--fe-ok, #16a34a) 12%,transparent)}.fe-opc__chip.is-error{color:var(--fe-danger);background:color-mix(in srgb,var(--fe-danger) 12%,transparent)}.fe-opc__item.is-done .fe-opc__bar-fill{background:var(--fe-ok, #16a34a)}.fe-opc__empty{margin:0;padding:16px 14px;font-size:12px;color:var(--fe-text-muted);text-align:center}.fe-opc-pop-enter-active,.fe-opc-pop-leave-active{transition:transform .16s ease,opacity .16s ease}.fe-opc-pop-enter-from,.fe-opc-pop-leave-to{opacity:0;transform:translateY(8px) scale(.98)}.fe--narrow .fe-opc{left:12px;right:12px;bottom:84px;max-width:none}.fe--narrow .fe-opc__panel{width:100%;max-height:50vh}@media (prefers-reduced-motion: reduce){.fe-opc__ring--spin,.fe-opc__spin{animation-duration:3s}.fe-opc-pop-enter-active,.fe-opc-pop-leave-active{transition:none}}======= .fe-grid__card:focus-visible{outline:2px solid var(--fe-primary);outline-offset:2px}.fe-ctx__item:focus-visible{outline:2px solid var(--fe-primary);outline-offset:-2px;background:var(--fe-bg-hover)}.fe-list__row.is-droptarget,.fe-grid__card.is-droptarget{outline:2px dashed var(--fe-primary);outline-offset:-2px;background:var(--fe-bg-selected)}.fe-grid__card.is-droptarget{border-color:var(--fe-primary)}.fe-dragghost{display:inline-flex;align-items:center;gap:8px;max-width:260px;padding:6px 10px;border:1px solid var(--fe-border-strong);border-radius:var(--fe-radius);background:var(--fe-bg-elev);color:var(--fe-text);font-family:var(--fe-font);font-size:13px;box-shadow:var(--fe-shadow-sm);pointer-events:none;z-index:96}.fe-dragghost__name{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.fe-dragghost__badge{flex:0 0 auto;min-width:20px;padding:1px 6px;border-radius:999px;background:var(--fe-primary);color:var(--fe-text-on-primary);font-size:12px;font-weight:600;text-align:center}.fe-state__details{margin-top:10px;max-width:480px;font-size:12px;text-align:left}.fe-state__details-summary{cursor:pointer;text-align:center;color:var(--fe-text-muted);-webkit-user-select:none;user-select:none}.fe-state__details-summary:focus-visible{outline:2px solid var(--fe-primary);outline-offset:2px}.fe-state__details-pre{margin:8px 0 0;padding:8px 10px;border:1px solid var(--fe-border);border-radius:var(--fe-radius-sm);background:var(--fe-bg-elev);font-family:var(--fe-font-mono);font-size:11px;white-space:pre-wrap;word-break:break-word;max-height:160px;overflow:auto}.fe-tour{position:fixed;top:0;right:0;bottom:0;left:0;z-index:96;color:var(--fe-text);font-family:var(--fe-font);font-size:14px}.fe-tour__spot{position:fixed;border-radius:10px;box-shadow:0 0 0 9999px #0d131b8c;border:2px solid var(--fe-primary);pointer-events:none}.fe-tour__dim{position:fixed;top:0;right:0;bottom:0;left:0;background:#0d131b8c;pointer-events:none}.fe-tour__card{position:fixed;display:flex;flex-direction:column;gap:6px;padding:14px 16px;border:1px solid var(--fe-border-strong);border-radius:var(--fe-radius-lg);background:var(--fe-bg);color:var(--fe-text);box-shadow:var(--fe-shadow);outline:none}.fe-tour__card--center{top:50%;left:50%;transform:translate(-50%,-50%);width:min(360px,calc(100vw - 24px))}.fe-tour__progress{margin:0;font-size:11px;font-weight:600;letter-spacing:.06em;color:var(--fe-text-muted)}.fe-tour__title{margin:0;font-size:15px;font-weight:700}.fe-tour__desc{margin:0;font-size:13px;line-height:1.5;color:var(--fe-text-muted)}.fe-tour__dots{display:flex;gap:5px;margin-top:4px}.fe-tour__dot{width:7px;height:7px;border-radius:50%;background:var(--fe-border-strong);transition:background .15s}.fe-tour__dot.is-active{background:var(--fe-primary)}.fe-tour__actions{display:flex;align-items:center;gap:8px;margin-top:8px}.fe-tour__actions-spacer{flex:1 1 auto}.fe-tour__skip{color:var(--fe-text-muted)}.fe-tour-enter-active,.fe-tour-leave-active{transition:opacity .16s ease}.fe-tour-enter-from,.fe-tour-leave-to{opacity:0}@media (prefers-reduced-motion: reduce){.fe-tour-enter-active,.fe-tour-leave-active,.fe-ctx-enter-active,.fe-ctx-leave-active,.fe-sheet-enter-active,.fe-sheet-leave-active,.fe-toast-enter-active,.fe-toast-leave-active,.fe-list__row,.fe-grid__card,.fe-tour__dot,.fe-list__col--star{transition:none!important}}.fe-tabs{display:flex;align-items:stretch;gap:4px;flex:0 0 auto;padding:4px 6px 0;background:var(--fe-bg-elev);border-bottom:1px solid var(--fe-border);-webkit-user-select:none;user-select:none}.fe-tabs__scroll{display:flex;align-items:stretch;gap:2px;flex:1 1 auto;min-width:0;overflow-x:auto;scrollbar-width:none}.fe-tabs__scroll::-webkit-scrollbar{display:none}.fe-tabs__tab{display:flex;align-items:center;gap:6px;max-width:180px;min-width:72px;padding:4px 6px 4px 10px;font-size:12px;color:var(--fe-text-muted);background:transparent;border:1px solid transparent;border-bottom:none;border-radius:8px 8px 0 0;cursor:pointer;white-space:nowrap;position:relative}.fe-tabs__tab:hover{background:var(--fe-bg-hover);color:var(--fe-text)}.fe-tabs__tab.is-active{background:var(--fe-bg);color:var(--fe-text);border-color:var(--fe-border)}.fe-tabs__tab.is-active:after{content:"";position:absolute;left:0;right:0;bottom:-1px;height:1px;background:var(--fe-bg)}.fe-tabs__tab.is-dragover{outline:1px dashed var(--fe-primary);outline-offset:-2px}.fe-tabs__tab:focus-visible{outline:2px solid var(--fe-primary);outline-offset:-2px}.fe-tabs__label{overflow:hidden;text-overflow:ellipsis;flex:1 1 auto;min-width:0}.fe-tabs__splitdot{width:6px;height:6px;border-radius:2px;background:var(--fe-primary);flex:0 0 auto}.fe-tabs__close{flex:0 0 auto;width:16px;height:16px;line-height:1;display:inline-flex;align-items:center;justify-content:center;border:none;border-radius:4px;background:transparent;color:inherit;font-size:13px;cursor:pointer;padding:0}.fe-tabs__close:hover{background:var(--fe-bg-hover)}.fe-tabs__new,.fe-tabs__split{flex:0 0 auto;align-self:center;width:22px;height:22px;display:inline-flex;align-items:center;justify-content:center;border:1px solid transparent;border-radius:6px;background:transparent;color:var(--fe-text-muted);font-size:15px;cursor:pointer;padding:0}.fe-tabs__split .fe-ficon{width:14px;height:14px}.fe-tabs__new:hover,.fe-tabs__split:hover{background:var(--fe-bg-hover);color:var(--fe-text)}.fe-tabs__split.is-active{background:var(--fe-bg-selected);color:var(--fe-primary);border-color:var(--fe-border)}.fe--narrow .fe-tabs__split{display:none}.fe__primary{display:flex;flex-direction:column;flex:1 1 auto;min-width:0;min-height:0}.fe__primary>.fe__body{min-width:0}.fe__main--split>.fe__primary{flex:1 1 50%}.fe-split{flex:1 1 50%;min-width:0;min-height:0;display:flex;flex-direction:column;border-left:1px solid var(--fe-border);background:var(--fe-bg);color:var(--fe-text)}.fe__main--split>.fe__primary,.fe-split{box-shadow:inset 0 2px 0 transparent}.fe__main--split>.fe__primary.fe-pane--focus,.fe-split.fe-pane--focus{box-shadow:inset 0 2px 0 var(--fe-primary)}.fe-split__crumbs{display:flex;align-items:center;gap:4px;flex:0 0 auto;padding:6px 12px;min-height:37px;border-bottom:1px solid var(--fe-border);font-size:13px;color:var(--fe-text-muted);overflow:hidden;white-space:nowrap}.fe-split__crumb{border:none;background:transparent;color:inherit;font:inherit;padding:2px 6px;border-radius:var(--fe-radius-sm);cursor:pointer;max-width:140px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.fe-split__crumb:hover{background:var(--fe-bg-hover);color:var(--fe-text)}.fe-split__crumb.is-last{color:var(--fe-text);font-weight:600}.fe-split__sep{opacity:.6;flex:0 0 auto}.fe-split__spacer{flex:1 1 auto}.fe-split__closebtn{flex:0 0 auto;width:20px;height:20px;display:inline-flex;align-items:center;justify-content:center;border:none;border-radius:5px;background:transparent;color:var(--fe-text-muted);font-size:14px;cursor:pointer;padding:0}.fe-split__closebtn:hover{background:var(--fe-bg-hover);color:var(--fe-text)}.fe-split__body{flex:1 1 auto;min-height:0;overflow:auto;position:relative}.fe-split__body.is-dropover{outline:2px dashed var(--fe-primary);outline-offset:-4px}.fe-split__list{padding:4px 0}.fe-split__row{display:flex;align-items:center;gap:8px;padding:5px 10px;font-size:13px;cursor:default}.fe-split__row:hover{background:var(--fe-bg-hover)}.fe-split__row.is-selected{background:var(--fe-bg-selected)}.fe-split__row.is-droptarget{outline:1.5px dashed var(--fe-primary);outline-offset:-2px;border-radius:6px}.fe-split__row:focus-visible{outline:2px solid var(--fe-primary);outline-offset:-2px}.fe-split__icon{flex:0 0 auto;width:18px;height:18px;display:inline-flex;align-items:center;justify-content:center;font-size:16px}.fe-split__icon .fe-ficon{width:16px;height:16px}.fe-split__name{flex:1 1 auto;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.fe-split__size{flex:0 0 auto;color:var(--fe-text-muted);font-size:11.5px}.fe-split__state{padding:24px 12px;text-align:center;color:var(--fe-text-muted);font-size:12.5px;display:flex;flex-direction:column;gap:10px;align-items:center}.fe-gal{display:grid;grid-template-columns:repeat(auto-fill,minmax(190px,1fr));gap:var(--fe-gap);padding:var(--fe-gap)}.fe-gal__card{display:flex;flex-direction:column;align-items:stretch;border:1px solid var(--fe-border);border-radius:var(--fe-radius);background:var(--fe-bg-elev);cursor:pointer;overflow:hidden;transition:background .08s,border-color .08s;-webkit-user-select:none;user-select:none}.fe-gal__card:hover{background:var(--fe-bg-hover);border-color:var(--fe-border-strong)}.fe-gal__card.is-selected{background:var(--fe-bg-selected);border-color:var(--fe-primary)}.fe-gal__card.is-trash{opacity:.7}.fe-gal__card.is-clipped{opacity:.55;border-style:dashed}.fe-gal__card:focus-visible{outline:2px solid var(--fe-primary);outline-offset:2px}.fe-gal__card.is-droptarget{outline:2px dashed var(--fe-primary);outline-offset:-2px;background:var(--fe-bg-selected);border-color:var(--fe-primary)}.fe-gal__thumb{position:relative;display:flex;align-items:center;justify-content:center;aspect-ratio:1 / 1;background:var(--fe-bg);overflow:hidden}.fe-gal__thumb img{width:100%;height:100%;object-fit:cover}.fe-gal__icon{font-size:44px}.fe-gal__icon--svg svg{width:64px;height:64px}.fe-gal__meta{position:absolute;left:0;right:0;bottom:0;display:flex;flex-direction:column;gap:1px;padding:6px 8px;font-size:11px;line-height:1.35;color:var(--fe-text);background:color-mix(in srgb,var(--fe-bg-elev) 88%,transparent);-webkit-backdrop-filter:blur(2px);backdrop-filter:blur(2px);opacity:0;transform:translateY(4px);transition:opacity .12s ease,transform .12s ease;pointer-events:none}.fe-gal__card:hover .fe-gal__meta,.fe-gal__card:focus-visible .fe-gal__meta{opacity:1;transform:translateY(0)}.fe-gal__meta-line{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.fe-gal__meta-line--path{color:var(--fe-text-muted);font-style:italic}.fe-gal__label{padding:7px 9px;font-size:13px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;text-align:center}.fe-gal__empty{grid-column:1 / -1;padding:40px 20px;text-align:center;color:var(--fe-text-muted)}.fe--narrow .fe-gal{grid-template-columns:repeat(auto-fill,minmax(130px,1fr))}.fe--density-compact .fe-gal{grid-template-columns:repeat(auto-fill,minmax(150px,1fr));gap:calc(var(--fe-gap) * .6)}.fe--density-compact .fe-gal__label{padding:5px 7px;font-size:12px}@media (prefers-reduced-motion: reduce){.fe-gal__card,.fe-gal__meta{transition:none!important;transform:none}}.fe-inspector__countbadge{display:inline-flex;align-items:center;justify-content:center;min-width:16px;height:16px;padding:0 4px;margin-left:6px;border-radius:8px;font-size:10px;font-weight:600;letter-spacing:0;background:var(--fe-bg-hover);color:var(--fe-text);vertical-align:middle}.fe-inspector__comments{list-style:none;margin:0 0 8px;padding:0;display:flex;flex-direction:column;gap:8px}.fe-inspector__comment{border:1px solid var(--fe-border);border-radius:8px;padding:6px 8px;background:var(--fe-bg)}.fe-inspector__comment-top{display:flex;align-items:baseline;gap:6px;min-width:0}.fe-inspector__comment-author{font-size:12px;font-weight:600;color:var(--fe-text);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:0}.fe-inspector__comment-time{font-size:11px;color:var(--fe-text-muted);flex:1 1 auto;white-space:nowrap}.fe-inspector__comment-del{border:none;background:none;color:var(--fe-text-muted);font-size:14px;line-height:1;cursor:pointer;padding:0 4px;border-radius:4px;flex:0 0 auto}.fe-inspector__comment-del:hover{background:var(--fe-bg-hover);color:var(--fe-danger)}.fe-inspector__comment-del:disabled{opacity:.5;cursor:default}.fe-inspector__comment-body{margin:4px 0 0;font-size:12px;line-height:1.45;color:var(--fe-text);overflow-wrap:anywhere;white-space:pre-wrap}.fe-inspector__comment-form{display:flex;gap:6px;align-items:center}.fe-inspector__comment-input{flex:1 1 auto;min-width:0;border:1px solid var(--fe-border);border-radius:8px;background:var(--fe-bg);color:var(--fe-text);font:inherit;font-size:12px;padding:6px 8px}.fe-inspector__comment-input:focus{outline:none;border-color:var(--fe-accent)}.fe-inspector__comment-input:disabled{opacity:.6}.fe-e2e-strip{display:flex;align-items:center;gap:8px;padding:4px 12px;font-size:12.5px;color:var(--fe-text-muted);border-bottom:1px solid var(--fe-border);background:var(--fe-bg-elev)}.fe-e2e-strip__icon{font-size:13px;line-height:1}.fe-e2e-strip__label{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.fe-e2e-strip__btn{padding:2px 10px;font-size:12px}.fe-e2e-lock__form{display:flex;gap:8px;align-items:stretch;margin-top:12px;width:min(340px,100%)}.fe-e2e-lock__input{flex:1;min-width:0}.fe-e2e-form{display:flex;flex-direction:column;gap:10px}.fe-e2e-warn{border:1px solid var(--fe-danger);border-radius:var(--fe-radius-sm);padding:8px 10px;font-size:12.5px;color:var(--fe-text);background:color-mix(in srgb,var(--fe-danger) 8%,transparent)}.fe-e2e-warn strong{display:block;color:var(--fe-danger);margin-bottom:2px}.fe-e2e-warn p{margin:0;color:var(--fe-text-muted)}.fe-e2e-ack{display:flex;align-items:flex-start;gap:8px;font-size:12.5px;color:var(--fe-text);cursor:pointer}.fe-e2e-ack input{margin-top:2px;accent-color:var(--fe-primary)}.fe-e2e-optlink{margin-top:10px;padding:0;border:none;background:none;font:inherit;font-size:12.5px;color:var(--fe-primary);cursor:pointer;text-align:left}.fe-e2e-optlink:hover{text-decoration:underline}.fe:not(.fe--narrow) .fe-toolbar{flex-wrap:nowrap}.fe:not(.fe--narrow) .fe-toolbar__primary{flex:1 1 auto;min-width:0;flex-wrap:nowrap;overflow:hidden;position:relative}.fe-toolbar__measure{position:absolute;visibility:hidden;pointer-events:none;height:0;overflow:hidden;display:flex;gap:8px;white-space:nowrap}.fe-toolbar__measure .fe-btn{flex:none}.filex-viewer-3d[data-v-f9492fd4]{width:100%;height:100%;min-height:480px;background:#1a1a1a;display:flex;align-items:center;justify-content:center}.filex-viewer-3d[data-v-f9492fd4] model-viewer{width:100%;height:100%;min-height:480px;background:#1a1a1a;display:block}.filex-viewer-fallback[data-v-f9492fd4]{text-align:center;color:#c8cdd6;padding:32px;max-width:480px}.filex-viewer-fallback__icon[data-v-f9492fd4]{font-size:48px;display:block;margin-bottom:12px}.filex-viewer-epub__nav[data-v-12eb7133]{position:absolute;bottom:12px;left:50%;transform:translate(-50%);display:flex;gap:8px;padding:4px 8px;background:var(--fe-bg-elev, rgba(255, 255, 255, .9));border:1px solid var(--fe-border, #e2e6ed);border-radius:6px;-webkit-backdrop-filter:blur(4px);backdrop-filter:blur(4px)}.filex-viewer-epub[data-v-12eb7133]{display:flex;flex-direction:column;width:100%;height:100%;min-height:70vh;background:var(--fe-bg, #fff);color:var(--fe-text, #1a1e27);position:relative}.filex-viewer-epub__bar[data-v-12eb7133]{display:flex;align-items:center;gap:6px;padding:8px 12px;background:var(--fe-bg-elev, #f7f8fa);border-bottom:1px solid var(--fe-border, #e2e6ed);font-size:13px}.filex-viewer-spacer[data-v-12eb7133]{flex:1}.filex-viewer-epub__fs[data-v-12eb7133]{display:inline-block;min-width:40px;text-align:center;font-variant-numeric:tabular-nums;font-size:12px;color:var(--fe-text-muted, #5a6475)}.filex-viewer-epub__main[data-v-12eb7133]{flex:1;min-height:0;display:flex}.filex-viewer-epub__rendition[data-v-12eb7133]{flex:1;min-height:0}.filex-viewer-epub__toc[data-v-12eb7133]{width:260px;border-right:1px solid var(--fe-border, #e2e6ed);overflow-y:auto;padding:12px 0;background:var(--fe-bg-elev, #f7f8fa)}.filex-viewer-epub__toc ul[data-v-12eb7133]{list-style:none;margin:0;padding:0}.filex-viewer-epub__toc-link[data-v-12eb7133]{display:block;width:100%;text-align:left;background:transparent;border:0;padding:6px 14px;font:inherit;color:inherit;cursor:pointer}.filex-viewer-epub__toc-link[data-v-12eb7133]:hover{background:var(--fe-bg-hover, #edf0f5)}.filex-viewer-epub__toc-link.is-child[data-v-12eb7133]{padding-left:28px;color:var(--fe-text-muted, #5a6475);font-size:12px}.filex-viewer-epub__loading[data-v-12eb7133]{position:absolute;inset:auto 0 0 0;text-align:center;padding:6px;background:#0000000d;font-size:12px;color:var(--fe-text-muted, #5a6475)}.filex-viewer-fallback[data-v-12eb7133]{text-align:center;padding:32px;color:var(--fe-text-muted, #5a6475)}.filex-viewer-fallback__icon[data-v-12eb7133]{font-size:48px;display:block;margin-bottom:12px}.filex-viewer-btn[data-v-12eb7133]{border:1px solid var(--fe-border, #e2e6ed);background:var(--fe-bg, #fff);color:var(--fe-text, #1a1e27);padding:4px 10px;border-radius:4px;cursor:pointer;font:inherit;font-size:12px}.filex-viewer-btn[data-v-12eb7133]:hover:not(:disabled){background:var(--fe-bg-hover, #edf0f5)}.filex-viewer-btn[data-v-12eb7133]:disabled{opacity:.5;cursor:not-allowed}.filex-viewer-mermaid[data-v-939eea2b]{display:flex;flex-direction:column;width:100%;height:100%;min-height:70vh;background:var(--fe-bg, #fff);color:var(--fe-text, #1a1e27)}.filex-viewer-mermaid__bar[data-v-939eea2b]{display:flex;align-items:center;gap:6px;padding:8px 12px;background:var(--fe-bg-elev, #f7f8fa);border-bottom:1px solid var(--fe-border, #e2e6ed);font-size:13px}.filex-viewer-mermaid__zoom[data-v-939eea2b]{min-width:50px;text-align:center;font-variant-numeric:tabular-nums;font-size:12px}.filex-viewer-mermaid__pane[data-v-939eea2b]{flex:1;overflow:hidden;position:relative;cursor:grab;background:var(--fe-bg-elev, #f7f8fa);touch-action:none}.filex-viewer-mermaid__pane[data-v-939eea2b]:active{cursor:grabbing}.filex-viewer-mermaid__surface[data-v-939eea2b]{position:absolute;top:0;right:0;bottom:0;left:0;display:flex;align-items:center;justify-content:center;transform-origin:center center;transition:transform .05s linear;-webkit-user-select:none;user-select:none}.filex-viewer-mermaid__surface[data-v-939eea2b] svg{max-width:90%;max-height:90%}.filex-viewer-fallback[data-v-939eea2b]{text-align:center;padding:32px;color:var(--fe-text-muted, #5a6475);width:100%;display:flex;flex-direction:column;align-items:center;justify-content:center}.filex-viewer-fallback__icon[data-v-939eea2b]{font-size:48px;display:block;margin-bottom:12px}.filex-viewer-btn[data-v-939eea2b]{border:1px solid var(--fe-border, #e2e6ed);background:var(--fe-bg, #fff);color:var(--fe-text, #1a1e27);padding:4px 10px;border-radius:4px;cursor:pointer;font:inherit;font-size:12px}.filex-viewer-btn[data-v-939eea2b]:hover:not(:disabled){background:var(--fe-bg-hover, #edf0f5)}.filex-viewer-drawio[data-v-2e4b5f3b]{display:flex;flex-direction:column;width:100%;height:100%;min-height:70vh;background:var(--fe-bg, #fff)}.filex-viewer-drawio__bar[data-v-2e4b5f3b]{display:flex;align-items:center;gap:12px;padding:6px 12px;background:var(--fe-bg-elev, #f7f8fa);border-bottom:1px solid var(--fe-border, #e2e6ed);font-size:12px;color:var(--fe-text-muted, #5a6475)}.filex-viewer-drawio__status[data-state=error][data-v-2e4b5f3b]{color:var(--fe-danger, #dc2626)}.filex-viewer-drawio__status[data-state=saved][data-v-2e4b5f3b]{color:#059669}.filex-viewer-drawio__readonly[data-v-2e4b5f3b]{font-style:italic;margin-left:auto}.filex-viewer-drawio__frame[data-v-2e4b5f3b]{flex:1;width:100%;border:0;background:#fafafa;min-height:0}.filex-viewer-fallback[data-v-2e4b5f3b]{text-align:center;padding:32px;color:var(--fe-text-muted, #5a6475)}.filex-viewer-fallback__icon[data-v-2e4b5f3b]{font-size:48px;display:block;margin-bottom:12px}.filex-viewer-tiff__pager[data-v-c6b84f5d]{position:absolute;bottom:12px;left:50%;transform:translate(-50%);display:flex;align-items:center;gap:8px;padding:4px 8px;background:var(--fe-bg-elev, rgba(255, 255, 255, .9));border:1px solid var(--fe-border, #e2e6ed);border-radius:6px;-webkit-backdrop-filter:blur(4px);backdrop-filter:blur(4px)}.filex-viewer-tiff__pages[data-v-c6b84f5d]{font-size:12px;font-variant-numeric:tabular-nums}.filex-viewer-tiff[data-v-c6b84f5d]{display:flex;flex-direction:column;width:100%;height:100%;min-height:70vh;background:var(--fe-bg, #fff)}.filex-viewer-tiff__bar[data-v-c6b84f5d]{display:flex;align-items:center;gap:6px;padding:8px 12px;background:var(--fe-bg-elev, #f7f8fa);border-bottom:1px solid var(--fe-border, #e2e6ed);font-size:13px}.filex-viewer-tiff__pages[data-v-c6b84f5d]{min-width:110px;text-align:center;font-variant-numeric:tabular-nums;font-size:12px}.filex-viewer-tiff__zoom[data-v-c6b84f5d]{min-width:50px;text-align:center;font-variant-numeric:tabular-nums;font-size:12px}.filex-viewer-spacer[data-v-c6b84f5d]{flex:1}.filex-viewer-tiff__pane[data-v-c6b84f5d]{flex:1;overflow:auto;padding:16px;background:#2a2d33;display:flex;align-items:flex-start;justify-content:flex-start}.filex-viewer-tiff__pane canvas[data-v-c6b84f5d]{background:#fff;box-shadow:0 4px 16px #0000004d}.filex-viewer-fallback[data-v-c6b84f5d]{text-align:center;padding:32px;color:#c8cdd6;margin:auto}.filex-viewer-fallback__icon[data-v-c6b84f5d]{font-size:48px;display:block;margin-bottom:12px}.filex-viewer-btn[data-v-c6b84f5d]{border:1px solid var(--fe-border, #e2e6ed);background:var(--fe-bg, #fff);color:var(--fe-text, #1a1e27);padding:4px 10px;border-radius:4px;cursor:pointer;font:inherit;font-size:12px}.filex-viewer-btn[data-v-c6b84f5d]:hover:not(:disabled){background:var(--fe-bg-hover, #edf0f5)}.filex-viewer-btn[data-v-c6b84f5d]:disabled{opacity:.4;cursor:not-allowed}.filex-viewer-psd[data-v-001123c3]{display:flex;flex-direction:column;width:100%;height:100%;min-height:70vh;background:var(--fe-bg, #fff)}.filex-viewer-psd__bar[data-v-001123c3]{display:flex;align-items:center;gap:6px;padding:8px 12px;background:var(--fe-bg-elev, #f7f8fa);border-bottom:1px solid var(--fe-border, #e2e6ed);font-size:13px}.filex-viewer-spacer[data-v-001123c3]{flex:1}.filex-viewer-psd__dim[data-v-001123c3]{font-size:12px;color:var(--fe-text-muted, #5a6475)}.filex-viewer-psd__zoom[data-v-001123c3]{min-width:50px;text-align:center;font-variant-numeric:tabular-nums;font-size:12px}.filex-viewer-psd__main[data-v-001123c3]{flex:1;display:flex;min-height:0}.filex-viewer-psd__layers[data-v-001123c3]{width:240px;border-right:1px solid var(--fe-border, #e2e6ed);overflow-y:auto;padding:8px 0;background:var(--fe-bg-elev, #f7f8fa)}.filex-viewer-psd__layers ul[data-v-001123c3]{list-style:none;margin:0;padding:0}.filex-viewer-psd__layers li[data-v-001123c3]{display:flex;align-items:center;gap:6px;padding:4px 12px;font-size:12px}.filex-viewer-psd__layer-vis[data-v-001123c3]{width:14px;text-align:center;color:var(--fe-text-muted, #5a6475)}.filex-viewer-psd__layer-vis[data-hidden="1"][data-v-001123c3]{color:var(--fe-border-strong, #c7ced9)}.filex-viewer-psd__layer-name[data-v-001123c3]{flex:1;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.filex-viewer-psd__pane[data-v-001123c3]{flex:1;overflow:auto;padding:16px;background:#2a2d33;display:flex;align-items:flex-start;justify-content:flex-start}.filex-viewer-psd__pane canvas[data-v-001123c3]{background:#fff repeating-conic-gradient(#e0e0e0 0% 25%,transparent 0% 50%) 50% / 16px 16px;box-shadow:0 4px 16px #0000004d}.filex-viewer-fallback[data-v-001123c3]{text-align:center;padding:32px;color:#c8cdd6;margin:auto}.filex-viewer-fallback__icon[data-v-001123c3]{font-size:48px;display:block;margin-bottom:12px}.filex-viewer-btn[data-v-001123c3]{border:1px solid var(--fe-border, #e2e6ed);background:var(--fe-bg, #fff);color:var(--fe-text, #1a1e27);padding:4px 10px;border-radius:4px;cursor:pointer;font:inherit;font-size:12px}.filex-viewer-btn[data-v-001123c3]:hover:not(:disabled){background:var(--fe-bg-hover, #edf0f5)}.filex-viewer-btn.is-active[data-v-001123c3]{background:var(--fe-bg-selected, #dfe8ff);border-color:var(--fe-primary, #3b82f6)}.filex-viewer-ipynb[data-v-eece712d]{display:flex;flex-direction:column;width:100%;height:100%;min-height:70vh;background:var(--fe-bg, #fff);color:var(--fe-text, #1a1e27)}.filex-viewer-ipynb__bar[data-v-eece712d]{display:flex;align-items:center;gap:12px;padding:8px 12px;background:var(--fe-bg-elev, #f7f8fa);border-bottom:1px solid var(--fe-border, #e2e6ed);font-size:12px;color:var(--fe-text-muted, #5a6475)}.filex-viewer-ipynb__lang[data-v-eece712d]{font-family:var(--fe-font-mono, monospace);text-transform:uppercase;letter-spacing:.04em}.filex-viewer-ipynb__pane[data-v-eece712d]{flex:1;overflow:auto;padding:16px 24px}.filex-viewer-ipynb__cell[data-v-eece712d]{border:1px solid var(--fe-border, #e2e6ed);border-radius:6px;margin-bottom:16px;overflow:hidden}.filex-viewer-ipynb__cell[data-type=code][data-v-eece712d]{background:var(--fe-bg-elev, #f7f8fa)}.filex-viewer-ipynb__exec[data-v-eece712d]{padding:4px 12px;font-family:var(--fe-font-mono, monospace);font-size:11px;color:var(--fe-text-muted, #5a6475);background:#0000000a}.filex-viewer-ipynb__src[data-v-eece712d]{margin:0;padding:12px;font-family:var(--fe-font-mono, monospace);font-size:12px;line-height:1.5;white-space:pre;overflow-x:auto}.filex-viewer-ipynb__outputs[data-v-eece712d]{border-top:1px dashed var(--fe-border, #e2e6ed);background:var(--fe-bg, #fff);padding:8px 12px}.filex-viewer-ipynb__out[data-v-eece712d]{margin:0;padding:4px 0;font-family:var(--fe-font-mono, monospace);font-size:12px;white-space:pre-wrap;word-wrap:break-word}.filex-viewer-ipynb__out[data-type=error][data-v-eece712d]{color:var(--fe-danger, #dc2626)}.filex-viewer-ipynb__img[data-v-eece712d]{display:block;max-width:100%;height:auto;margin:8px 0}.filex-viewer-ipynb__html[data-v-eece712d]{font-size:13px}.filex-viewer-ipynb__md[data-v-eece712d]{padding:12px 16px;font-size:14px;line-height:1.6}.filex-viewer-ipynb__md-raw[data-v-eece712d]{padding:12px;margin:0;font-family:var(--fe-font-mono, monospace);font-size:12px;white-space:pre-wrap}.filex-viewer-fallback[data-v-eece712d]{text-align:center;padding:32px;color:var(--fe-text-muted, #5a6475)}.filex-viewer-fallback__icon[data-v-eece712d]{font-size:48px;display:block;margin-bottom:12px}.filex-viewer-csv[data-v-db55a104]{display:flex;flex-direction:column;width:100%;height:100%;min-height:70vh;background:var(--fe-bg, #fff);color:var(--fe-text, #1a1e27)}.filex-viewer-csv__bar[data-v-db55a104]{display:flex;align-items:center;gap:12px;padding:8px 12px;background:var(--fe-bg-elev, #f7f8fa);border-bottom:1px solid var(--fe-border, #e2e6ed);font-size:12px}.filex-viewer-csv__check[data-v-db55a104]{display:flex;align-items:center;gap:4px;font-size:12px}.filex-viewer-csv__select[data-v-db55a104],.filex-viewer-csv__filter[data-v-db55a104]{border:1px solid var(--fe-border, #e2e6ed);background:var(--fe-bg, #fff);color:inherit;padding:4px 8px;border-radius:4px;font:inherit;font-size:12px}.filex-viewer-csv__filter[data-v-db55a104]{flex:0 1 240px}.filex-viewer-spacer[data-v-db55a104]{flex:1}.filex-viewer-csv__count[data-v-db55a104]{font-size:11px;color:var(--fe-text-muted, #5a6475);font-variant-numeric:tabular-nums}.filex-viewer-csv__pane[data-v-db55a104]{flex:1;overflow:auto}.filex-viewer-csv__table[data-v-db55a104]{border-collapse:collapse;width:max-content;min-width:100%;font-size:12px;font-family:var(--fe-font-mono, monospace)}.filex-viewer-csv__table th[data-v-db55a104],.filex-viewer-csv__table td[data-v-db55a104]{padding:4px 10px;border:1px solid var(--fe-border, #e2e6ed);white-space:nowrap;max-width:320px;overflow:hidden;text-overflow:ellipsis}.filex-viewer-csv__table th[data-v-db55a104]{background:var(--fe-bg-elev, #f7f8fa);position:sticky;top:0;font-weight:600;text-align:left}.filex-viewer-csv__table tbody tr[data-v-db55a104]:nth-child(2n){background:var(--fe-bg-hover, rgba(0, 0, 0, .02))}.filex-viewer-csv__rownum[data-v-db55a104]{color:var(--fe-text-muted, #5a6475);text-align:right;background:var(--fe-bg-elev, #f7f8fa);font-variant-numeric:tabular-nums;position:sticky;left:0}.filex-viewer-csv__pager[data-v-db55a104]{display:flex;justify-content:center;align-items:center;gap:8px;padding:6px;background:var(--fe-bg-elev, #f7f8fa);border-top:1px solid var(--fe-border, #e2e6ed);font-size:12px}.filex-viewer-csv__pageno[data-v-db55a104]{font-variant-numeric:tabular-nums;font-size:12px}.filex-viewer-fallback[data-v-db55a104]{text-align:center;padding:32px;color:var(--fe-text-muted, #5a6475)}.filex-viewer-fallback__icon[data-v-db55a104]{font-size:48px;display:block;margin-bottom:12px}.filex-viewer-btn[data-v-db55a104]{border:1px solid var(--fe-border, #e2e6ed);background:var(--fe-bg, #fff);color:var(--fe-text, #1a1e27);padding:4px 10px;border-radius:4px;cursor:pointer;font:inherit;font-size:12px}.filex-viewer-btn[data-v-db55a104]:hover:not(:disabled){background:var(--fe-bg-hover, #edf0f5)}.filex-viewer-btn[data-v-db55a104]:disabled{opacity:.4;cursor:not-allowed}.filex-viewer-archive[data-v-93df7b13]{display:flex;flex-direction:column;width:100%;height:100%;min-height:70vh;background:var(--fe-bg, #fff);color:var(--fe-text, #1a1e27)}.filex-viewer-archive__pane[data-v-93df7b13]{flex:1;overflow:auto;padding:16px 20px}.filex-viewer-archive__summary[data-v-93df7b13]{font-size:12px;color:var(--fe-text-muted, #5a6475);margin-bottom:12px;font-variant-numeric:tabular-nums}.filex-viewer-archive__table[data-v-93df7b13]{width:100%;border-collapse:collapse;font-size:13px;font-family:var(--fe-font-mono, monospace)}.filex-viewer-archive__table th[data-v-93df7b13],.filex-viewer-archive__table td[data-v-93df7b13]{padding:6px 12px;border-bottom:1px solid var(--fe-border, #e2e6ed);text-align:left}.filex-viewer-archive__table th[data-v-93df7b13]{background:var(--fe-bg-elev, #f7f8fa);font-weight:600;position:sticky;top:0}.filex-viewer-archive__size[data-v-93df7b13]{text-align:right;font-variant-numeric:tabular-nums;white-space:nowrap;color:var(--fe-text-muted, #5a6475)}.filex-viewer-archive__icon[data-v-93df7b13]{margin-right:6px}.filex-viewer-archive__table tr[data-dir="1"][data-v-93df7b13]{color:var(--fe-text-muted, #5a6475)}.filex-viewer-fallback[data-v-93df7b13]{text-align:center;padding:32px;color:var(--fe-text-muted, #5a6475)}.filex-viewer-fallback__icon[data-v-93df7b13]{font-size:48px;display:block;margin-bottom:12px}';let km=!1;function eD(){if(km||typeof document>"u")return;const e=document.createElement("style");e.setAttribute("data-filex",""),e.textContent=QM,document.head.appendChild(e),km=!0}function Sm(e,t){const r={};return e.apiBase&&(r.apiBase=e.apiBase),e.endpoint&&(r.endpoint=e.endpoint),(e.locale==="tr"||e.locale==="en")&&(r.locale=e.locale),(e.theme==="light"||e.theme==="dark"||e.theme==="auto")&&(r.theme=e.theme),e.trashVisible!==void 0&&(r.trashVisible=e.trashVisible===!0||e.trashVisible==="true"||e.trashVisible===""),{...r,...t??{}}}const Cm=ex({inheritAttrs:!1,props:{config:{type:Object,default:null},apiBase:{type:String,default:""},endpoint:{type:String,default:""},locale:{type:String,default:""},theme:{type:String,default:""},trashVisible:{type:[Boolean,String],default:void 0}},emits:["share-created","file-opened","error","upload-progress","selection-change"],setup(e,{emit:t}){eD();const r=re(Sm({apiBase:e.apiBase,endpoint:e.endpoint,locale:e.locale,theme:e.theme,trashVisible:e.trashVisible},e.config));return At(()=>[e.config,e.apiBase,e.endpoint,e.locale,e.theme,e.trashVisible],()=>{r.value=Sm({apiBase:e.apiBase,endpoint:e.endpoint,locale:e.locale,theme:e.theme,trashVisible:e.trashVisible},e.config)},{deep:!0}),()=>ov(JM,{config:r.value,onShareCreated:n=>t("share-created",n),onFileOpened:n=>t("file-opened",n),onError:n=>t("error",n),onUploadProgress:n=>t("upload-progress",n),onSelectionChange:n=>t("selection-change",n)})}},{shadowRoot:!1}),tD=Cm;typeof customElements<"u"&&!customElements.get("filex-explorer")&&customElements.define("filex-explorer",Cm);const rD={class:"filex-viewer-3d"},nD={key:1,class:"filex-viewer-fallback"},aD={key:2,class:"filex-viewer-fallback"},jo=Object.freeze(Object.defineProperty({__proto__:null,default:fn(Pt({__name:"Viewer3D",props:{url:{},mime:{},ext:{},t:{type:Function}},setup(e){const t=e,r=new Set(["glb","gltf","usdz"]),n=Fe(()=>r.has((t.ext||"").toLowerCase())),a=re(null),i=re(!1);async function o(){if(i.value=!1,a.value=null,!n.value){a.value=t.t?t.t("viewer.format_unsupported_3d"):`3D format ".${t.ext}" not supported in browser preview — please download.`;return}try{await import("@google/model-viewer"),i.value=!0}catch{a.value=t.t?t.t("viewer.peer_not_installed"):"3D viewer requires `@google/model-viewer` — install or use download."}}return Xt(o),At(()=>t.url,()=>{o()}),(s,l)=>{const c=H_("model-viewer");return R(),$("div",rD,[i.value&&!a.value?(R(),Zt(c,{key:0,src:e.url,"auto-rotate":"","camera-controls":"","touch-action":"pan-y","shadow-intensity":"1",alt:e.ext+" model",style:{width:"100%",height:"100%","min-height":"480px",display:"block"}},null,8,["src","alt"])):a.value?(R(),$("div",nD,[l[0]||(l[0]=T("span",{class:"filex-viewer-fallback__icon"},"📦",-1)),T("p",null,V(a.value),1)])):(R(),$("div",aD,[l[1]||(l[1]=T("span",{class:"filex-viewer-fallback__icon"},"⏳",-1)),T("p",null,V(e.t?e.t("viewer.loading"):"Loading…"),1)]))])}}}),[["__scopeId","data-v-299b3816"]])},Symbol.toStringTag,{value:"Module"})),iD={key:0,class:"filex-viewer-fallback"},oD={key:0,class:"filex-viewer-epub__nav"},sD=["disabled"],lD=["disabled"],cD={key:1,class:"filex-viewer-epub__loading"},uD=Object.freeze(Object.defineProperty({__proto__:null,default:fn(Pt({__name:"EpubViewer",props:{url:{},mime:{},ext:{},t:{type:Function},authHeaders:{type:Function},authCredentials:{}},setup(e){const t=e,r=re(null),n=re(null),a=re(null),i=re([]),o=re(100),s=re(!1),l=re(!0);let c=null,u=null;async function d(){l.value=!0,s.value=!1,a.value=null;let b=null;try{b=await import("epubjs")}catch{a.value=t.t?t.t("viewer.peer_not_installed"):"EPUB viewer requires `epubjs` — install or use download.",l.value=!1;return}try{const v=b.default??b;let m=t.url;if(t.authHeaders){const g=t.authHeaders(),S=await fetch(t.url,{headers:g,credentials:t.authCredentials||"same-origin"});if(!S.ok)throw new Error(`${S.status} ${S.statusText}`);m=await S.arrayBuffer()}if(c=v(m),!n.value)throw new Error("EPUB mount target missing");u=c.renderTo(n.value,{width:"100%",height:"100%",flow:"paginated",manager:"default"}),await u.display(),u.themes.fontSize(o.value+"%");const y=await c.loaded.navigation;i.value=(y==null?void 0:y.toc)??[],s.value=!0}catch(v){a.value=v instanceof Error?v.message:"EPUB load failed"}finally{l.value=!1}}function f(){var b;(b=u==null?void 0:u.next)==null||b.call(u)}function p(){var b;(b=u==null?void 0:u.prev)==null||b.call(u)}function _(b){b.key==="ArrowRight"||b.key==="PageDown"?f():(b.key==="ArrowLeft"||b.key==="PageUp")&&p()}Xt(()=>{d(),window.addEventListener("keydown",_)}),tr(()=>{var b,v;window.removeEventListener("keydown",_);try{(b=u==null?void 0:u.destroy)==null||b.call(u)}catch{}try{(v=c==null?void 0:c.destroy)==null||v.call(c)}catch{}u=null,c=null}),At(()=>t.url,()=>{if(u)try{u.destroy()}catch{}if(c)try{c.destroy()}catch{}c=null,u=null,d()});function h(b,v){return t.t?t.t(b):v}return(b,v)=>(R(),$("div",{ref_key:"root",ref:r,class:"filex-viewer-epub"},[a.value?(R(),$("div",iD,[v[0]||(v[0]=T("span",{class:"filex-viewer-fallback__icon"},"📖",-1)),T("p",null,V(a.value),1)])):(R(),$(qe,{key:1},[T("div",{ref_key:"containerRef",ref:n,class:"filex-viewer-epub__rendition"},null,512),s.value?(R(),$("div",oD,[T("button",{type:"button",class:"filex-viewer-btn",onClick:p,disabled:!s.value},"‹",8,sD),T("button",{type:"button",class:"filex-viewer-btn",onClick:f,disabled:!s.value},"›",8,lD)])):Te("",!0),l.value?(R(),$("div",cD,V(h("viewer.loading","Loading…")),1)):Te("",!0)],64))],512))}}),[["__scopeId","data-v-639afd99"]])},Symbol.toStringTag,{value:"Module"}));async function Em(e){const t=await fetch(e.url,{headers:e.headers??{},credentials:e.credentials??"same-origin",signal:e.signal});if(!t.ok){const r=await t.text().catch(()=>"");throw new Error(`${t.status} ${t.statusText}${r?" — "+r.slice(0,200):""}`)}return t}async function Am(e){return(await Em(e)).arrayBuffer()}async function U0(e){return(await Em(e)).text()}const fD={class:"filex-viewer-mermaid"},dD={key:0,class:"filex-viewer-fallback"},pD={key:1,class:"filex-viewer-fallback"},Tm=Object.freeze(Object.defineProperty({__proto__:null,default:fn(Pt({__name:"MermaidViewer",props:{url:{},mime:{},ext:{},t:{type:Function},authHeaders:{type:Function},authCredentials:{}},setup(e){const t=e,r=re(null),n=re(null),a=re(!0),i=re(1),o=re(0),s=re(0);let l=!1,c=null,u=0,d=null;async function f(){var y,g;if(d)return d;try{const S=await import("mermaid");return d=S.default??S,(g=d.initialize)==null||g.call(d,{startOnLoad:!1,securityLevel:"strict",theme:(y=window.matchMedia)!=null&&y.call(window,"(prefers-color-scheme: dark)").matches?"dark":"default"}),d}catch{return null}}async function p(){var M;a.value=!0,n.value=null;const y=++u,g=await f();if(y!==u)return;if(!g){n.value=t.t?t.t("viewer.peer_not_installed"):"Mermaid viewer requires `mermaid` — install or use download.",a.value=!1;return}let S;try{S=await U0({url:t.url,headers:((M=t.authHeaders)==null?void 0:M.call(t))??{},credentials:t.authCredentials})}catch(E){n.value=E instanceof Error?E.message:"fetch failed",a.value=!1;return}if(y===u)try{const E=`filex-mermaid-${Date.now()}`,{svg:w}=await g.render(E,S);if(y!==u)return;if(r.value){r.value.innerHTML=w;const x=r.value.querySelector("svg");x&&(x.style.maxWidth="100%",x.style.height="auto")}}catch(E){n.value=E instanceof Error?E.message:"render failed"}finally{a.value=!1}}function _(y){if(!y.ctrlKey&&!y.metaKey)return;y.preventDefault();const S=-y.deltaY>0?1.1:1/1.1;i.value=Math.max(.2,Math.min(8,i.value*S))}function h(y){var g,S;l=!0,c={x:y.clientX,y:y.clientY,tx:o.value,ty:s.value},(S=(g=y.target).setPointerCapture)==null||S.call(g,y.pointerId)}function b(y){!l||!c||(o.value=c.tx+(y.clientX-c.x),s.value=c.ty+(y.clientY-c.y))}function v(){l=!1,c=null}Xt(p),tr(()=>{u++});function m(y,g){return t.t?t.t(y):g}return(y,g)=>(R(),$("div",fD,[T("div",{class:"filex-viewer-mermaid__pane",onWheel:_,onPointerdown:h,onPointermove:b,onPointerup:v,onPointercancel:v},[n.value?(R(),$("div",dD,[g[0]||(g[0]=T("span",{class:"filex-viewer-fallback__icon"},"📊",-1)),T("p",null,V(n.value),1)])):a.value?(R(),$("div",pD,[g[1]||(g[1]=T("span",{class:"filex-viewer-fallback__icon"},"⏳",-1)),T("p",null,V(m("viewer.loading","Loading…")),1)])):Te("",!0),Yt(T("div",{ref_key:"surface",ref:r,class:"filex-viewer-mermaid__surface",style:Sn({transform:`translate(${o.value}px, ${s.value}px) scale(${i.value})`})},null,4),[[df,!a.value&&!n.value]])],32)]))}}),[["__scopeId","data-v-e19076c3"]])},Symbol.toStringTag,{value:"Module"})),hD={class:"filex-viewer-drawio"},vD={key:0,class:"filex-viewer-fallback"},mD=["src"],Mm=Object.freeze(Object.defineProperty({__proto__:null,default:fn(Pt({__name:"DrawioViewer",props:{url:{},filePath:{},ext:{},drawioUrl:{},saveUrl:{},readOnly:{type:Boolean},t:{type:Function},authHeaders:{type:Function},authCredentials:{}},setup(e){const t=e,r=re(null),n=re(null),a=re("loading"),i=re(!!t.readOnly||!t.saveUrl),o=Fe(()=>t.drawioUrl?t.drawioUrl.replace(/\/$/,""):null),s=Fe(()=>{if(!o.value)return"";const h=new URLSearchParams({embed:"1",proto:"json",spin:"1",saveAndExit:"0",noSaveBtn:i.value?"1":"0",noExitBtn:"1",ui:"kennedy",modified:"unsavedChanges"});return`${o.value}/?${h.toString()}`});let l="";async function c(){var h;a.value="loading",n.value=null;try{l=await U0({url:t.url,headers:((h=t.authHeaders)==null?void 0:h.call(t))??{},credentials:t.authCredentials})}catch(b){n.value=b instanceof Error?b.message:"fetch failed",a.value="error"}}function u(h){var b,v;(v=(b=r.value)==null?void 0:b.contentWindow)==null||v.postMessage(JSON.stringify(h),"*")}async function d(h){var b;if(t.saveUrl){a.value="saving";try{const v={"Content-Type":"application/json",...((b=t.authHeaders)==null?void 0:b.call(t))??{}},m=await fetch(t.saveUrl,{method:"POST",headers:v,credentials:t.authCredentials||"same-origin",body:JSON.stringify({path:t.filePath,content:h})});if(!m.ok)throw new Error(`${m.status} ${m.statusText}`);a.value="saved",setTimeout(()=>{a.value==="saved"&&(a.value="ready")},2500)}catch(v){n.value=v instanceof Error?v.message:"save failed",a.value="error"}}}function f(h){if(typeof h.data!="string"||h.data.length===0)return;const b=h.data[0];if(b!=="{"&&b!=="<")return;let v;try{v=JSON.parse(h.data)}catch{return}if(!(!v||typeof v!="object"))switch(v.event){case"init":u({action:"load",xml:l,autosave:0}),a.value="ready";break;case"save":typeof v.xml=="string"&&d(v.xml);break;case"export":break;case"autosave":typeof v.xml=="string"&&!i.value&&d(v.xml);break}}function p(){if(!o.value){n.value=_("viewer.drawio.disabled","Drawio (diagrams.net) yapılandırılmamış."),a.value="error";return}n.value===_("viewer.drawio.disabled","Drawio (diagrams.net) yapılandırılmamış.")&&(n.value=null,a.value="loading"),c()}Xt(()=>{window.addEventListener("message",f),p()}),At(()=>t.drawioUrl,p),tr(()=>{window.removeEventListener("message",f)});function _(h,b){return t.t?t.t(h):b}return(h,b)=>(R(),$("div",hD,[n.value?(R(),$("div",vD,[b[0]||(b[0]=T("span",{class:"filex-viewer-fallback__icon"},"📐",-1)),T("p",null,V(n.value),1)])):(R(),$("iframe",{key:1,ref_key:"iframeRef",ref:r,src:s.value,class:"filex-viewer-drawio__frame",title:"diagrams.net editor"},null,8,mD))]))}}),[["__scopeId","data-v-680c72a8"]])},Symbol.toStringTag,{value:"Module"})),gD={class:"filex-viewer-tiff"},bD={class:"filex-viewer-tiff__pane"},yD={key:0,class:"filex-viewer-fallback"},_D={key:1,class:"filex-viewer-fallback"},xD={key:2,class:"filex-viewer-tiff__pager"},wD=["disabled"],kD={class:"filex-viewer-tiff__pages"},SD=["disabled"],Dm=Object.freeze(Object.defineProperty({__proto__:null,default:fn(Pt({__name:"TiffViewer",props:{url:{},mime:{},ext:{},t:{type:Function},authHeaders:{type:Function},authCredentials:{}},setup(e){const t=e,r=re(null),n=re(null),a=re(!0),i=re(0),o=re(0),s=re({width:0,height:0});let l=null,c=null,u=0;async function d(){if(l)return l;try{const m=await Promise.resolve().then(()=>fO);return l=m.default??m,l}catch{return null}}async function f(){var g;a.value=!0,n.value=null,c=null,i.value=0,o.value=0;const m=++u,y=await d();if(m===u){if(!y){n.value=t.t?t.t("viewer.peer_not_installed"):"TIFF viewer requires `utif` — install or use download.",a.value=!1;return}try{const S=await Am({url:t.url,headers:((g=t.authHeaders)==null?void 0:g.call(t))??{},credentials:t.authCredentials});if(m!==u)return;if(c=y.decode(S),o.value=(c==null?void 0:c.length)??0,o.value===0)throw new Error("No pages decoded");p()}catch(S){n.value=S instanceof Error?S.message:"TIFF decode failed"}finally{a.value=!1}}}function p(){if(!l||!c||!r.value)return;const m=Math.max(0,Math.min(i.value,c.length-1)),y=c[m];try{l.decodeImage(void 0,y)}catch{}const g=l.toRGBA8(y),S=y.width,M=y.height;s.value={width:S,height:M};const E=r.value;E.width=S,E.height=M;const w=E.getContext("2d");if(!w)return;const x=w.createImageData(S,M);x.data.set(g),w.putImageData(x,0,0)}function _(){i.value<o.value-1&&(i.value++,p())}function h(){i.value>0&&(i.value--,p())}Xt(f),tr(()=>{u++,c=null}),At(()=>t.url,f);const b=Fe(()=>(t.t&&t.t("viewer.page_n_of_m")||"Page {n} of {m}").replace("{n}",String(i.value+1)).replace("{m}",String(o.value)));function v(m,y){return t.t?t.t(m):y}return(m,y)=>(R(),$("div",gD,[T("div",bD,[n.value?(R(),$("div",yD,[y[0]||(y[0]=T("span",{class:"filex-viewer-fallback__icon"},"🖼️",-1)),T("p",null,V(n.value),1)])):a.value?(R(),$("div",_D,[y[1]||(y[1]=T("span",{class:"filex-viewer-fallback__icon"},"⏳",-1)),T("p",null,V(v("viewer.loading","Loading…")),1)])):Te("",!0),Yt(T("canvas",{ref_key:"canvasEl",ref:r,style:{imageRendering:"pixelated"}},null,512),[[df,!a.value&&!n.value]]),!a.value&&!n.value&&o.value>1?(R(),$("div",xD,[T("button",{type:"button",class:"filex-viewer-btn",disabled:i.value===0,onClick:h},"‹",8,wD),T("span",kD,V(b.value),1),T("button",{type:"button",class:"filex-viewer-btn",disabled:i.value>=o.value-1,onClick:_},"›",8,SD)])):Te("",!0)])]))}}),[["__scopeId","data-v-11c3469a"]])},Symbol.toStringTag,{value:"Module"})),CD={class:"filex-viewer-psd"},ED={class:"filex-viewer-psd__pane"},AD={key:0,class:"filex-viewer-fallback"},TD={key:1,class:"filex-viewer-fallback"},MD=Object.freeze(Object.defineProperty({__proto__:null,default:fn(Pt({__name:"PsdViewer",props:{url:{},mime:{},ext:{},t:{type:Function},authHeaders:{type:Function},authCredentials:{}},setup(e){const t=e,r=re(null),n=re([]),a=re(null),i=re(!0),o=re({width:0,height:0});let s=0,l=null;async function c(){if(l)return l;try{return l=await Promise.resolve().then(()=>ML),l}catch{return null}}function u(p,_){if(p&&Array.isArray(p.children))for(const h of p.children)_.push({index:_.length,name:h.name??"(unnamed)",hidden:!!h.hidden}),h.children&&u(h,_)}async function d(){var h;i.value=!0,a.value=null,n.value=[];const p=++s,_=await c();if(p===s){if(!_){a.value=t.t?t.t("viewer.peer_not_installed"):"PSD viewer requires `ag-psd` — install or use download.",i.value=!1;return}try{const b=await Am({url:t.url,headers:((h=t.authHeaders)==null?void 0:h.call(t))??{},credentials:t.authCredentials});if(p!==s)return;const v=_.readPsd(b,{skipLayerImageData:!1,skipCompositeImageData:!1,skipThumbnail:!0});o.value={width:v.width,height:v.height};const m=v.canvas;if(m&&r.value){const g=r.value;g.width=v.width,g.height=v.height;const S=g.getContext("2d");S==null||S.drawImage(m,0,0)}else throw new Error("PSD has no composite image (skipCompositeImageData?)");const y=[];u(v,y),n.value=y}catch(b){a.value=b instanceof Error?b.message:"PSD decode failed"}finally{i.value=!1}}}Xt(d),tr(()=>{s++}),At(()=>t.url,d);function f(p,_){return t.t?t.t(p):_}return(p,_)=>(R(),$("div",CD,[T("div",ED,[a.value?(R(),$("div",AD,[_[0]||(_[0]=T("span",{class:"filex-viewer-fallback__icon"},"🎨",-1)),T("p",null,V(a.value),1)])):i.value?(R(),$("div",TD,[_[1]||(_[1]=T("span",{class:"filex-viewer-fallback__icon"},"⏳",-1)),T("p",null,V(f("viewer.loading","Loading…")),1)])):Te("",!0),Yt(T("canvas",{ref_key:"canvasEl",ref:r},null,512),[[df,!i.value&&!a.value]])])]))}}),[["__scopeId","data-v-46b5b3c2"]])},Symbol.toStringTag,{value:"Module"})),DD={class:"filex-viewer-ipynb"},zD={class:"filex-viewer-ipynb__pane"},ID={key:0,class:"filex-viewer-fallback"},OD={key:1,class:"filex-viewer-fallback"},PD={key:2},FD=["data-type"],RD={class:"filex-viewer-ipynb__exec"},LD={class:"filex-viewer-ipynb__src hljs"},BD=["innerHTML"],$D={key:1},ND={key:0,class:"filex-viewer-ipynb__outputs"},UD=["src","alt"],HD=["innerHTML"],jD=["data-type"],GD=["innerHTML"],VD={key:1,class:"filex-viewer-ipynb__md-raw"},qD={key:2,class:"filex-viewer-ipynb__src"},KD=Object.freeze(Object.defineProperty({__proto__:null,default:fn(Pt({__name:"IpynbViewer",props:{url:{},ext:{},t:{type:Function},authHeaders:{type:Function},authCredentials:{}},setup(e){const t=e,r=re([]),n=re("python"),a=re(null),i=re(!0),o=re(new Map),s=re(new Map);let l=0,c=null,u=null;async function d(){if(u!==null)return u||null;try{const m=await import("markdown-it"),y=m.default??m;return u=new y({html:!1,linkify:!0,breaks:!0}),u}catch{return u=!1,null}}function f(m){return Array.isArray(m)?m.join(""):m??""}async function p(){var M,E,w,x;i.value=!0,a.value=null,r.value=[],o.value=new Map,s.value=new Map;const m=++l;let y;try{y=await U0({url:t.url,headers:((M=t.authHeaders)==null?void 0:M.call(t))??{},credentials:t.authCredentials})}catch(C){a.value=C instanceof Error?C.message:"fetch failed",i.value=!1;return}if(m!==l)return;let g;try{g=JSON.parse(y)}catch{a.value="Invalid notebook JSON",i.value=!1;return}if(r.value=Array.isArray(g.cells)?g.cells:[],n.value=((w=(E=g.metadata)==null?void 0:E.kernelspec)==null?void 0:w.language)||"python",c=await Hv(),m!==l)return;if(c){const C=c.default??c,D=(x=C.getLanguage)!=null&&x.call(C,n.value)?n.value:null;r.value.forEach((B,F)=>{if(B.cell_type==="code"){const K=f(B.source);try{const te=D?C.highlight(K,{language:D,ignoreIllegals:!0}):C.highlightAuto(K);o.value.set(F,te.value)}catch{}}})}const S=await d();m===l&&(S&&r.value.forEach((C,D)=>{if(C.cell_type==="markdown")try{s.value.set(D,S.render(f(C.source)))}catch{}}),i.value=!1)}function _(m){var y;return m?m.output_type==="stream"?f(m.text):m.output_type==="error"?[m.ename,m.evalue,...m.traceback||[]].filter(Boolean).join(`
|
|
25
25
|
`):(m.output_type==="execute_result"||m.output_type==="display_data")&&(y=m.data)!=null&&y["text/plain"]?f(m.data["text/plain"]):null:null}function h(m){if(!(m!=null&&m.data))return null;if(m.data["image/png"])return`data:image/png;base64,${m.data["image/png"]}`;if(m.data["image/jpeg"])return`data:image/jpeg;base64,${m.data["image/jpeg"]}`;if(m.data["image/svg+xml"]){const y=f(m.data["image/svg+xml"]);return`data:image/svg+xml;utf8,${encodeURIComponent(y)}`}return null}function b(m){return m!=null&&m.data&&m.data["text/html"]?f(m.data["text/html"]).replace(/<script[\s\S]*?<\/script>/gi,""):null}Xt(p),tr(()=>{l++}),At(()=>t.url,p);function v(m,y){return t.t?t.t(m):y}return(m,y)=>(R(),$("div",DD,[T("div",zD,[a.value?(R(),$("div",ID,[y[0]||(y[0]=T("span",{class:"filex-viewer-fallback__icon"},"📓",-1)),T("p",null,V(a.value),1)])):i.value?(R(),$("div",OD,[y[1]||(y[1]=T("span",{class:"filex-viewer-fallback__icon"},"⏳",-1)),T("p",null,V(v("viewer.loading","Loading…")),1)])):(R(),$("div",PD,[(R(!0),$(qe,null,xt(r.value,(g,S)=>(R(),$("div",{key:S,class:"filex-viewer-ipynb__cell","data-type":g.cell_type},[g.cell_type==="code"?(R(),$(qe,{key:0},[T("div",RD," In ["+V(g.execution_count??" ")+"]: ",1),T("pre",LD,[o.value.get(S)?(R(),$("code",{key:0,innerHTML:o.value.get(S)},null,8,BD)):(R(),$("code",$D,V(f(g.source)),1))]),g.outputs&&g.outputs.length?(R(),$("div",ND,[(R(!0),$(qe,null,xt(g.outputs,(M,E)=>(R(),$(qe,{key:E},[h(M)?(R(),$("img",{key:0,src:h(M)||"",class:"filex-viewer-ipynb__img",alt:`output ${E}`},null,8,UD)):b(M)?(R(),$("div",{key:1,class:"filex-viewer-ipynb__html",innerHTML:b(M)},null,8,HD)):_(M)?(R(),$("pre",{key:2,class:"filex-viewer-ipynb__out","data-type":M.output_type},V(_(M)),9,jD)):Te("",!0)],64))),128))])):Te("",!0)],64)):g.cell_type==="markdown"?(R(),$(qe,{key:1},[s.value.get(S)?(R(),$("div",{key:0,class:"filex-viewer-ipynb__md",innerHTML:s.value.get(S)},null,8,GD)):(R(),$("pre",VD,V(f(g.source)),1))],64)):(R(),$("pre",qD,V(f(g.source)),1))],8,FD))),128))]))])]))}}),[["__scopeId","data-v-10bd637a"]])},Symbol.toStringTag,{value:"Module"})),WD={class:"filex-viewer-csv"},YD={class:"filex-viewer-csv__pane"},XD={key:0,class:"filex-viewer-fallback"},ZD={key:1,class:"filex-viewer-fallback"},JD={key:2,class:"filex-viewer-csv__table"},QD={class:"filex-viewer-csv__rownum"},ez={key:0,class:"filex-viewer-csv__pager"},tz=["disabled"],rz={class:"filex-viewer-csv__pageno"},nz=["disabled"],Ff=100,zm=1e3,Im=Object.freeze(Object.defineProperty({__proto__:null,default:fn(Pt({__name:"CsvViewer",props:{url:{},ext:{},t:{type:Function},authHeaders:{type:Function},authCredentials:{}},setup(e){const t=e,r=re([]),n=re(null),a=re(!0),i=re(!0),o=re(""),s=re(1),l=re(","),c=re("auto");let u=0;function d(g){const S=g.split(/\r?\n/).slice(0,5).join(`
|
|
26
26
|
`),M=(S.match(/\t/g)||[]).length,E=(S.match(/;/g)||[]).length,w=(S.match(/,/g)||[]).length;return M>w&&M>E?" ":E>w&&E>M?";":","}async function f(g,S){try{const M=await Promise.resolve().then(()=>DL);return(M.default??M).parse(g,{delimiter:S,skipEmptyLines:!0,header:!1}).data.slice(0,zm)}catch{return g.split(/\r?\n/).filter(M=>M.length>0).slice(0,zm).map(M=>M.split(S))}}async function p(){var E;a.value=!0,n.value=null,r.value=[],s.value=1;const g=++u;let S;try{S=await U0({url:t.url,headers:((E=t.authHeaders)==null?void 0:E.call(t))??{},credentials:t.authCredentials})}catch(w){n.value=w instanceof Error?w.message:"fetch failed",a.value=!1;return}if(g!==u)return;t.ext==="tsv"?l.value=" ":l.value=d(S.slice(0,4096));const M=c.value==="auto"?l.value:c.value;r.value=await f(S,M),a.value=!1}Xt(p),At(()=>t.url,p),At(()=>c.value,()=>{r.value.length!==0&&p()});const _=Fe(()=>!i.value||r.value.length===0?r.value.length===0?[]:r.value[0].map((g,S)=>`Col ${S+1}`):r.value[0]),h=Fe(()=>i.value?r.value.slice(1):r.value),b=Fe(()=>{const g=o.value.trim().toLowerCase();return g?h.value.filter(S=>S.some(M=>(M||"").toLowerCase().includes(g))):h.value}),v=Fe(()=>Math.max(1,Math.ceil(b.value.length/Ff))),m=Fe(()=>{const g=(s.value-1)*Ff;return b.value.slice(g,g+Ff)});At(o,()=>{s.value=1});function y(g,S){return t.t?t.t(g):S}return(g,S)=>(R(),$("div",WD,[T("div",YD,[n.value?(R(),$("div",XD,[S[2]||(S[2]=T("span",{class:"filex-viewer-fallback__icon"},"📊",-1)),T("p",null,V(n.value),1)])):a.value?(R(),$("div",ZD,[S[3]||(S[3]=T("span",{class:"filex-viewer-fallback__icon"},"⏳",-1)),T("p",null,V(y("viewer.loading","Loading…")),1)])):(R(),$("table",JD,[T("thead",null,[T("tr",null,[S[4]||(S[4]=T("th",{class:"filex-viewer-csv__rownum"},"#",-1)),(R(!0),$(qe,null,xt(_.value,(M,E)=>(R(),$("th",{key:E},V(M),1))),128))])]),T("tbody",null,[(R(!0),$(qe,null,xt(m.value,(M,E)=>(R(),$("tr",{key:E},[T("td",QD,V((s.value-1)*100+E+1),1),(R(!0),$(qe,null,xt(M,(w,x)=>(R(),$("td",{key:x},V(w),1))),128))]))),128))])]))]),!a.value&&!n.value&&v.value>1?(R(),$("div",ez,[T("button",{type:"button",class:"filex-viewer-btn",disabled:s.value<=1,onClick:S[0]||(S[0]=M=>s.value--)},"‹",8,tz),T("span",rz,V(s.value)+" / "+V(v.value)+" ("+V(b.value.length)+" satır)",1),T("button",{type:"button",class:"filex-viewer-btn",disabled:s.value>=v.value,onClick:S[1]||(S[1]=M=>s.value++)},"›",8,nz)])):Te("",!0)]))}}),[["__scopeId","data-v-1a0b9c8e"]])},Symbol.toStringTag,{value:"Module"})),az={class:"filex-viewer-archive"},iz={key:0,class:"filex-viewer-fallback"},oz={key:1,class:"filex-viewer-fallback"},sz={key:2,class:"filex-viewer-fallback"},lz={key:3,class:"filex-viewer-archive__pane"},cz={class:"filex-viewer-archive__summary"},uz={class:"filex-viewer-archive__table"},fz={class:"filex-viewer-archive__size"},dz=["data-dir"],pz={class:"filex-viewer-archive__icon"},hz={class:"filex-viewer-archive__size"},vz=Object.freeze(Object.defineProperty({__proto__:null,default:fn(Pt({__name:"ArchiveViewer",props:{url:{},filePath:{},ext:{},t:{type:Function},authHeaders:{type:Function},authCredentials:{}},setup(e){const t=e,r=re([]),n=re(!0),a=re(null);function i(u,d){return t.t?t.t(u):d}function o(u){return u<1024?`${u} B`:u<1024*1024?`${(u/1024).toFixed(1)} KB`:u<1024*1024*1024?`${(u/(1024*1024)).toFixed(1)} MB`:`${(u/(1024*1024*1024)).toFixed(2)} GB`}async function s(){if(n.value=!0,a.value=null,r.value=[],!t.filePath){a.value=i("viewer.archive.error","Could not read archive contents."),n.value=!1;return}try{const u=await fetch("/api/files/archive/list",{method:"POST",credentials:t.authCredentials||"include",headers:{"Content-Type":"application/json",...t.authHeaders?t.authHeaders():{}},body:JSON.stringify({path:t.filePath})});if(!u.ok)throw new Error(`${u.status} ${u.statusText}`);const d=await u.json();r.value=d.entries??[]}catch(u){a.value=u instanceof Error?u.message:i("viewer.archive.error","Could not read archive contents.")}finally{n.value=!1}}Xt(s),At(()=>t.filePath,s);const l=Fe(()=>r.value.reduce((u,d)=>u+(d.size||0),0)),c=Fe(()=>r.value.filter(u=>!u.is_dir).length);return(u,d)=>(R(),$("div",az,[a.value?(R(),$("div",iz,[d[0]||(d[0]=T("span",{class:"filex-viewer-fallback__icon"},"🗜️",-1)),T("p",null,V(a.value),1)])):n.value?(R(),$("div",oz,[d[1]||(d[1]=T("span",{class:"filex-viewer-fallback__icon"},"⏳",-1)),T("p",null,V(i("viewer.loading","Loading…")),1)])):r.value.length===0?(R(),$("div",sz,[d[2]||(d[2]=T("span",{class:"filex-viewer-fallback__icon"},"🗜️",-1)),T("p",null,V(i("viewer.archive.empty","Archive is empty.")),1)])):(R(),$("div",lz,[T("div",cz,V(c.value)+" "+V(i("viewer.archive.entries","{n} files").replace("{n}",String(c.value)))+" · "+V(o(l.value)),1),T("table",uz,[T("thead",null,[T("tr",null,[T("th",null,V(i("viewer.name","Name")),1),T("th",fz,V(i("viewer.size","Size")),1)])]),T("tbody",null,[(R(!0),$(qe,null,xt(r.value,(f,p)=>(R(),$("tr",{key:p,"data-dir":f.is_dir?"1":"0"},[T("td",null,[T("span",pz,V(f.is_dir?"📁":"📄"),1),$t(" "+V(f.name),1)]),T("td",hz,V(f.is_dir?"":o(f.size)),1)],8,dz))),128))])])]))]))}}),[["__scopeId","data-v-d3ad0fc4"]])},Symbol.toStringTag,{value:"Module"}));class Ze extends Error{constructor(t,r){var n="KaTeX parse error: "+t,a,i,o=r&&r.loc;if(o&&o.start<=o.end){var s=o.lexer.input;a=o.start,i=o.end,a===s.length?n+=" at end of input: ":n+=" at position "+(a+1)+": ";var l=s.slice(a,i).replace(/[^]/g,"$&̲"),c;a>15?c="…"+s.slice(a-15,a):c=s.slice(0,a);var u;i+15<s.length?u=s.slice(i,i+15)+"…":u=s.slice(i),n+=c+l+u}super(n),this.name="ParseError",Object.setPrototypeOf(this,Ze.prototype),this.position=a,a!=null&&i!=null&&(this.length=i-a),this.rawMessage=t}}var mz=/([A-Z])/g,Rf=e=>e.replace(mz,"-$1").toLowerCase(),gz={"&":"&",">":">","<":"<",'"':""","'":"'"},bz=/[&><"']/g,nn=e=>String(e).replace(bz,t=>gz[t]),H0=e=>e.type==="ordgroup"||e.type==="color"?e.body.length===1?H0(e.body[0]):e:e.type==="font"?H0(e.body):e,yz=new Set(["mathord","textord","atom"]),ti=e=>yz.has(H0(e).type),_z=e=>{var t=/^[\x00-\x20]*([^\\/#?]*?)(:|�*58|�*3a|&colon)/i.exec(e);return t?t[2]!==":"||!/^[a-zA-Z][a-zA-Z0-9+\-.]*$/.test(t[1])?null:t[1].toLowerCase():"_relative"},j0={displayMode:{type:"boolean",description:"Render math in display mode, which puts the math in display style (so \\int and \\sum are large, for example), and centers the math on the page on its own line.",cli:"-d, --display-mode"},output:{type:{enum:["htmlAndMathml","html","mathml"]},description:"Determines the markup language of the output.",cli:"-F, --format <type>"},leqno:{type:"boolean",description:"Render display math in leqno style (left-justified tags)."},fleqn:{type:"boolean",description:"Render display math flush left."},throwOnError:{type:"boolean",default:!0,cli:"-t, --no-throw-on-error",cliDescription:"Render errors (in the color given by --error-color) instead of throwing a ParseError exception when encountering an error."},errorColor:{type:"string",default:"#cc0000",cli:"-c, --error-color <color>",cliDescription:"A color string given in the format 'rgb' or 'rrggbb' (no #). This option determines the color of errors rendered by the -t option.",cliProcessor:e=>"#"+e},macros:{type:"object",cli:"-m, --macro <def>",cliDescription:"Define custom macro of the form '\\foo:expansion' (use multiple -m arguments for multiple macros).",cliDefault:[],cliProcessor:(e,t)=>(t.push(e),t)},minRuleThickness:{type:"number",description:"Specifies a minimum thickness, in ems, for fraction lines, `\\sqrt` top lines, `{array}` vertical lines, `\\hline`, `\\hdashline`, `\\underline`, `\\overline`, and the borders of `\\fbox`, `\\boxed`, and `\\fcolorbox`.",processor:e=>Math.max(0,e),cli:"--min-rule-thickness <size>",cliProcessor:parseFloat},colorIsTextColor:{type:"boolean",description:"Makes \\color behave like LaTeX's 2-argument \\textcolor, instead of LaTeX's one-argument \\color mode change.",cli:"-b, --color-is-text-color"},strict:{type:[{enum:["warn","ignore","error"]},"boolean","function"],description:"Turn on strict / LaTeX faithfulness mode, which throws an error if the input uses features that are not supported by LaTeX.",cli:"-S, --strict",cliDefault:!1},trust:{type:["boolean","function"],description:"Trust the input, enabling all HTML features such as \\url.",cli:"-T, --trust"},maxSize:{type:"number",default:1/0,description:"If non-zero, all user-specified sizes, e.g. in \\rule{500em}{500em}, will be capped to maxSize ems. Otherwise, elements and spaces can be arbitrarily large",processor:e=>Math.max(0,e),cli:"-s, --max-size <n>",cliProcessor:parseInt},maxExpand:{type:"number",default:1e3,description:"Limit the number of macro expansions to the specified number, to prevent e.g. infinite macro loops. If set to Infinity, the macro expander will try to fully expand as in LaTeX.",processor:e=>Math.max(0,e),cli:"-e, --max-expand <n>",cliProcessor:e=>e==="Infinity"?1/0:parseInt(e)},globalGroup:{type:"boolean",cli:!1}};function xz(e){if("default"in e)return e.default;var t=e.type,r=Array.isArray(t)?t[0]:t;if(typeof r!="string")return r.enum[0];switch(r){case"boolean":return!1;case"string":return"";case"number":return 0;case"object":return{}}}class Lf{constructor(t){t===void 0&&(t={}),t=t||{};for(var r of Object.keys(j0)){var n=j0[r],a=t[r];this[r]=a!==void 0?n.processor?n.processor(a):a:xz(n)}}reportNonstrict(t,r,n){var a=this.strict;if(typeof a=="function"&&(a=a(t,r,n)),!(!a||a==="ignore")){if(a===!0||a==="error")throw new Ze("LaTeX-incompatible input and strict mode is set to 'error': "+(r+" ["+t+"]"),n);a==="warn"?typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to 'warn': "+(r+" ["+t+"]")):typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to "+("unrecognized '"+a+"': "+r+" ["+t+"]"))}}useStrictBehavior(t,r,n){var a=this.strict;if(typeof a=="function")try{a=a(t,r,n)}catch{a="error"}return!a||a==="ignore"?!1:a===!0||a==="error"?!0:a==="warn"?(typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to 'warn': "+(r+" ["+t+"]")),!1):(typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to "+("unrecognized '"+a+"': "+r+" ["+t+"]")),!1)}isTrusted(t){if("url"in t&&t.url&&!t.protocol){var r=_z(t.url);if(r==null)return!1;t.protocol=r}var n=typeof this.trust=="function"?this.trust(t):this.trust;return!!n}}class Mi{constructor(t,r,n){this.id=t,this.size=r,this.cramped=n}sup(){return Da[wz[this.id]]}sub(){return Da[kz[this.id]]}fracNum(){return Da[Sz[this.id]]}fracDen(){return Da[Cz[this.id]]}cramp(){return Da[Ez[this.id]]}text(){return Da[Az[this.id]]}isTight(){return this.size>=2}}var Bf=0,G0=1,Go=2,ri=3,il=4,Gn=5,Vo=6,dn=7,Da=[new Mi(Bf,0,!1),new Mi(G0,0,!0),new Mi(Go,1,!1),new Mi(ri,1,!0),new Mi(il,2,!1),new Mi(Gn,2,!0),new Mi(Vo,3,!1),new Mi(dn,3,!0)],wz=[il,Gn,il,Gn,Vo,dn,Vo,dn],kz=[Gn,Gn,Gn,Gn,dn,dn,dn,dn],Sz=[Go,ri,il,Gn,Vo,dn,Vo,dn],Cz=[ri,ri,Gn,Gn,dn,dn,dn,dn],Ez=[G0,G0,ri,ri,Gn,Gn,dn,dn],Az=[Bf,G0,Go,ri,Go,ri,Go,ri],zt={DISPLAY:Da[Bf],TEXT:Da[Go],SCRIPT:Da[il],SCRIPTSCRIPT:Da[Vo]},$f=[{name:"latin",blocks:[[256,591],[768,879]]},{name:"cyrillic",blocks:[[1024,1279]]},{name:"armenian",blocks:[[1328,1423]]},{name:"brahmic",blocks:[[2304,4255]]},{name:"georgian",blocks:[[4256,4351]]},{name:"cjk",blocks:[[12288,12543],[19968,40879],[65280,65376]]},{name:"hangul",blocks:[[44032,55215]]}];function Tz(e){for(var t=0;t<$f.length;t++)for(var r=$f[t],n=0;n<r.blocks.length;n++){var a=r.blocks[n];if(e>=a[0]&&e<=a[1])return r.name}return null}var V0=[];$f.forEach(e=>e.blocks.forEach(t=>V0.push(...t)));function Om(e){for(var t=0;t<V0.length;t+=2)if(e>=V0[t]&&e<=V0[t+1])return!0;return!1}var Ur=e=>e+" "+e,qo=80,Mz=function(t,r){return"M95,"+(622+t+r)+`
|
|
27
27
|
c-2.7,0,-7.17,-2.7,-13.5,-8c-5.8,-5.3,-9.5,-10,-9.5,-14
|
|
@@ -279,7 +279,7 @@ l0,-`+(r+144)+`c-2,-159.3,-10,-310.7,-24,-454c-53.3,-528,-210,-949.7,
|
|
|
279
279
|
|[ \r ]+
|
|
280
280
|
?)[ \r ]*`,xd="[̀-ͯ]",qI=new RegExp(xd+"+$"),KI="("+Zg+"+)|"+(VI+"|")+"([!-\\[\\]-‧-豈-]"+(xd+"*")+"|[\uD800-\uDBFF][\uDC00-\uDFFF]"+(xd+"*")+"|\\\\verb\\*([^]).*?\\4|\\\\verb([^*a-zA-Z]).*?\\5"+("|"+GI)+("|"+jI+")");class Jg{constructor(t,r){this.input=t,this.settings=r,this.tokenRegex=new RegExp(KI,"g"),this.catcodes={"%":14,"~":13}}setCatcode(t,r){this.catcodes[t]=r}lex(){var t=this.input,r=this.tokenRegex.lastIndex;if(r===t.length)return new Mn("EOF",new _n(this,r,r));var n=this.tokenRegex.exec(t);if(n===null||n.index!==r)throw new Ze("Unexpected character: '"+t[r]+"'",new Mn(t[r],new _n(this,r,r+1)));var a=n[6]||n[3]||(n[2]?"\\ ":" ");if(this.catcodes[a]===14){var i=t.indexOf(`
|
|
281
281
|
`,this.tokenRegex.lastIndex);return i===-1?(this.tokenRegex.lastIndex=t.length,this.settings.reportNonstrict("commentAtEnd","% comment has no terminating newline; LaTeX would fail because of commenting the end of math mode (e.g. $)")):this.tokenRegex.lastIndex=i+1,this.lex()}return new Mn(a,new _n(this,r,this.tokenRegex.lastIndex))}}class WI{constructor(t,r){t===void 0&&(t={}),r===void 0&&(r={}),this.current=r,this.builtins=t,this.undefStack=[]}beginGroup(){this.undefStack.push({})}endGroup(){if(this.undefStack.length===0)throw new Ze("Unbalanced namespace destruction: attempt to pop global namespace; please report this as a bug");var t=this.undefStack.pop();for(var r in t)t.hasOwnProperty(r)&&(t[r]==null?delete this.current[r]:this.current[r]=t[r])}endGroups(){for(;this.undefStack.length>0;)this.endGroup()}has(t){return this.current.hasOwnProperty(t)||this.builtins.hasOwnProperty(t)}get(t){return this.current.hasOwnProperty(t)?this.current[t]:this.builtins[t]}set(t,r,n){if(n===void 0&&(n=!1),n){for(var a=0;a<this.undefStack.length;a++)delete this.undefStack[a][t];this.undefStack.length>0&&(this.undefStack[this.undefStack.length-1][t]=r)}else{var i=this.undefStack[this.undefStack.length-1];i&&!i.hasOwnProperty(t)&&(i[t]=this.current[t])}r==null?delete this.current[t]:this.current[t]=r}}var YI=Ag;W("\\noexpand",function(e){var t=e.popToken();return e.isExpandable(t.text)&&(t.noexpand=!0,t.treatAsRelax=!0),{tokens:[t],numArgs:0}}),W("\\expandafter",function(e){var t=e.popToken();return e.expandOnce(!0),{tokens:[t],numArgs:0}}),W("\\@firstoftwo",function(e){var t=e.consumeArgs(2);return{tokens:t[0],numArgs:0}}),W("\\@secondoftwo",function(e){var t=e.consumeArgs(2);return{tokens:t[1],numArgs:0}}),W("\\@ifnextchar",function(e){var t=e.consumeArgs(3);e.consumeSpaces();var r=e.future();return t[0].length===1&&t[0][0].text===r.text?{tokens:t[1],numArgs:0}:{tokens:t[2],numArgs:0}}),W("\\@ifstar","\\@ifnextchar *{\\@firstoftwo{#1}}"),W("\\TextOrMath",function(e){var t=e.consumeArgs(2);return e.mode==="text"?{tokens:t[0],numArgs:0}:{tokens:t[1],numArgs:0}});var Qg={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,a:10,A:10,b:11,B:11,c:12,C:12,d:13,D:13,e:14,E:14,f:15,F:15};W("\\char",function(e){var t=e.popToken(),r,n=0;if(t.text==="'")r=8,t=e.popToken();else if(t.text==='"')r=16,t=e.popToken();else if(t.text==="`")if(t=e.popToken(),t.text[0]==="\\")n=t.text.charCodeAt(1);else{if(t.text==="EOF")throw new Ze("\\char` missing argument");n=t.text.charCodeAt(0)}else r=10;if(r){if(n=Qg[t.text],n==null||n>=r)throw new Ze("Invalid base-"+r+" digit "+t.text);for(var a;(a=Qg[e.future().text])!=null&&a<r;)n*=r,n+=a,e.popToken()}return"\\@char{"+n+"}"});var wd=(e,t,r,n)=>{var a=e.consumeArg().tokens;if(a.length!==1)throw new Ze("\\newcommand's first argument must be a macro name");var i=a[0].text,o=e.isDefined(i);if(o&&!t)throw new Ze("\\newcommand{"+i+"} attempting to redefine "+(i+"; use \\renewcommand"));if(!o&&!r)throw new Ze("\\renewcommand{"+i+"} when command "+i+" does not yet exist; use \\newcommand");var s=0;if(a=e.consumeArg().tokens,a.length===1&&a[0].text==="["){for(var l="",c=e.expandNextToken();c.text!=="]"&&c.text!=="EOF";)l+=c.text,c=e.expandNextToken();if(!l.match(/^\s*[0-9]+\s*$/))throw new Ze("Invalid number of arguments: "+l);s=parseInt(l),a=e.consumeArg().tokens}return o&&n||e.macros.set(i,{tokens:a,numArgs:s}),""};W("\\newcommand",e=>wd(e,!1,!0,!1)),W("\\renewcommand",e=>wd(e,!0,!1,!1)),W("\\providecommand",e=>wd(e,!0,!0,!0)),W("\\message",e=>{var t=e.consumeArgs(1)[0];return console.log(t.reverse().map(r=>r.text).join("")),""}),W("\\errmessage",e=>{var t=e.consumeArgs(1)[0];return console.error(t.reverse().map(r=>r.text).join("")),""}),W("\\show",e=>{var t=e.popToken(),r=t.text;return console.log(t,e.macros.get(r),Ri[r],yr.math[r],yr.text[r]),""}),W("\\bgroup","{"),W("\\egroup","}"),W("~","\\nobreakspace"),W("\\lq","`"),W("\\rq","'"),W("\\aa","\\r a"),W("\\AA","\\r A"),W("\\textcopyright","\\html@mathml{\\textcircled{c}}{\\char`©}"),W("\\copyright","\\TextOrMath{\\textcopyright}{\\text{\\textcopyright}}"),W("\\textregistered","\\html@mathml{\\textcircled{\\scriptsize R}}{\\char`®}"),W("ℬ","\\mathscr{B}"),W("ℰ","\\mathscr{E}"),W("ℱ","\\mathscr{F}"),W("ℋ","\\mathscr{H}"),W("ℐ","\\mathscr{I}"),W("ℒ","\\mathscr{L}"),W("ℳ","\\mathscr{M}"),W("ℛ","\\mathscr{R}"),W("ℭ","\\mathfrak{C}"),W("ℌ","\\mathfrak{H}"),W("ℨ","\\mathfrak{Z}"),W("\\Bbbk","\\Bbb{k}"),W("\\llap","\\mathllap{\\textrm{#1}}"),W("\\rlap","\\mathrlap{\\textrm{#1}}"),W("\\clap","\\mathclap{\\textrm{#1}}"),W("\\mathstrut","\\vphantom{(}"),W("\\underbar","\\underline{\\text{#1}}"),W("\\not",'\\html@mathml{\\mathrel{\\mathrlap\\@not}\\nobreak}{\\char"338}'),W("\\neq","\\html@mathml{\\mathrel{\\not=}}{\\mathrel{\\char`≠}}"),W("\\ne","\\neq"),W("≠","\\neq"),W("\\notin","\\html@mathml{\\mathrel{{\\in}\\mathllap{/\\mskip1mu}}}{\\mathrel{\\char`∉}}"),W("∉","\\notin"),W("≘","\\html@mathml{\\mathrel{=\\kern{-1em}\\raisebox{0.4em}{$\\scriptsize\\frown$}}}{\\mathrel{\\char`≘}}"),W("≙","\\html@mathml{\\stackrel{\\tiny\\wedge}{=}}{\\mathrel{\\char`≘}}"),W("≚","\\html@mathml{\\stackrel{\\tiny\\vee}{=}}{\\mathrel{\\char`≚}}"),W("≛","\\html@mathml{\\stackrel{\\scriptsize\\star}{=}}{\\mathrel{\\char`≛}}"),W("≝","\\html@mathml{\\stackrel{\\tiny\\mathrm{def}}{=}}{\\mathrel{\\char`≝}}"),W("≞","\\html@mathml{\\stackrel{\\tiny\\mathrm{m}}{=}}{\\mathrel{\\char`≞}}"),W("≟","\\html@mathml{\\stackrel{\\tiny?}{=}}{\\mathrel{\\char`≟}}"),W("⟂","\\perp"),W("‼","\\mathclose{!\\mkern-0.8mu!}"),W("∌","\\notni"),W("⌜","\\ulcorner"),W("⌝","\\urcorner"),W("⌞","\\llcorner"),W("⌟","\\lrcorner"),W("©","\\copyright"),W("®","\\textregistered"),W("\\ulcorner",'\\html@mathml{\\@ulcorner}{\\mathop{\\char"231c}}'),W("\\urcorner",'\\html@mathml{\\@urcorner}{\\mathop{\\char"231d}}'),W("\\llcorner",'\\html@mathml{\\@llcorner}{\\mathop{\\char"231e}}'),W("\\lrcorner",'\\html@mathml{\\@lrcorner}{\\mathop{\\char"231f}}'),W("\\vdots","{\\varvdots\\rule{0pt}{15pt}}"),W("⋮","\\vdots"),W("\\varGamma","\\mathit{\\Gamma}"),W("\\varDelta","\\mathit{\\Delta}"),W("\\varTheta","\\mathit{\\Theta}"),W("\\varLambda","\\mathit{\\Lambda}"),W("\\varXi","\\mathit{\\Xi}"),W("\\varPi","\\mathit{\\Pi}"),W("\\varSigma","\\mathit{\\Sigma}"),W("\\varUpsilon","\\mathit{\\Upsilon}"),W("\\varPhi","\\mathit{\\Phi}"),W("\\varPsi","\\mathit{\\Psi}"),W("\\varOmega","\\mathit{\\Omega}"),W("\\substack","\\begin{subarray}{c}#1\\end{subarray}"),W("\\colon","\\nobreak\\mskip2mu\\mathpunct{}\\mathchoice{\\mkern-3mu}{\\mkern-3mu}{}{}{:}\\mskip6mu\\relax"),W("\\boxed","\\fbox{$\\displaystyle{#1}$}"),W("\\iff","\\DOTSB\\;\\Longleftrightarrow\\;"),W("\\implies","\\DOTSB\\;\\Longrightarrow\\;"),W("\\impliedby","\\DOTSB\\;\\Longleftarrow\\;"),W("\\dddot","{\\overset{\\raisebox{-0.1ex}{\\normalsize ...}}{#1}}"),W("\\ddddot","{\\overset{\\raisebox{-0.1ex}{\\normalsize ....}}{#1}}");var e2={",":"\\dotsc","\\not":"\\dotsb","+":"\\dotsb","=":"\\dotsb","<":"\\dotsb",">":"\\dotsb","-":"\\dotsb","*":"\\dotsb",":":"\\dotsb","\\DOTSB":"\\dotsb","\\coprod":"\\dotsb","\\bigvee":"\\dotsb","\\bigwedge":"\\dotsb","\\biguplus":"\\dotsb","\\bigcap":"\\dotsb","\\bigcup":"\\dotsb","\\prod":"\\dotsb","\\sum":"\\dotsb","\\bigotimes":"\\dotsb","\\bigoplus":"\\dotsb","\\bigodot":"\\dotsb","\\bigsqcup":"\\dotsb","\\And":"\\dotsb","\\longrightarrow":"\\dotsb","\\Longrightarrow":"\\dotsb","\\longleftarrow":"\\dotsb","\\Longleftarrow":"\\dotsb","\\longleftrightarrow":"\\dotsb","\\Longleftrightarrow":"\\dotsb","\\mapsto":"\\dotsb","\\longmapsto":"\\dotsb","\\hookrightarrow":"\\dotsb","\\doteq":"\\dotsb","\\mathbin":"\\dotsb","\\mathrel":"\\dotsb","\\relbar":"\\dotsb","\\Relbar":"\\dotsb","\\xrightarrow":"\\dotsb","\\xleftarrow":"\\dotsb","\\DOTSI":"\\dotsi","\\int":"\\dotsi","\\oint":"\\dotsi","\\iint":"\\dotsi","\\iiint":"\\dotsi","\\iiiint":"\\dotsi","\\idotsint":"\\dotsi","\\DOTSX":"\\dotsx"},XI=new Set(["bin","rel"]);W("\\dots",function(e){var t="\\dotso",r=e.expandAfterFuture().text;return r in e2?t=e2[r]:(r.slice(0,4)==="\\not"||r in yr.math&&XI.has(yr.math[r].group))&&(t="\\dotsb"),t});var kd={")":!0,"]":!0,"\\rbrack":!0,"\\}":!0,"\\rbrace":!0,"\\rangle":!0,"\\rceil":!0,"\\rfloor":!0,"\\rgroup":!0,"\\rmoustache":!0,"\\right":!0,"\\bigr":!0,"\\biggr":!0,"\\Bigr":!0,"\\Biggr":!0,$:!0,";":!0,".":!0,",":!0};W("\\dotso",function(e){var t=e.future().text;return t in kd?"\\ldots\\,":"\\ldots"}),W("\\dotsc",function(e){var t=e.future().text;return t in kd&&t!==","?"\\ldots\\,":"\\ldots"}),W("\\cdots",function(e){var t=e.future().text;return t in kd?"\\@cdots\\,":"\\@cdots"}),W("\\dotsb","\\cdots"),W("\\dotsm","\\cdots"),W("\\dotsi","\\!\\cdots"),W("\\dotsx","\\ldots\\,"),W("\\DOTSI","\\relax"),W("\\DOTSB","\\relax"),W("\\DOTSX","\\relax"),W("\\tmspace","\\TextOrMath{\\kern#1#3}{\\mskip#1#2}\\relax"),W("\\,","\\tmspace+{3mu}{.1667em}"),W("\\thinspace","\\,"),W("\\>","\\mskip{4mu}"),W("\\:","\\tmspace+{4mu}{.2222em}"),W("\\medspace","\\:"),W("\\;","\\tmspace+{5mu}{.2777em}"),W("\\thickspace","\\;"),W("\\!","\\tmspace-{3mu}{.1667em}"),W("\\negthinspace","\\!"),W("\\negmedspace","\\tmspace-{4mu}{.2222em}"),W("\\negthickspace","\\tmspace-{5mu}{.277em}"),W("\\enspace","\\kern.5em "),W("\\enskip","\\hskip.5em\\relax"),W("\\quad","\\hskip1em\\relax"),W("\\qquad","\\hskip2em\\relax"),W("\\tag","\\@ifstar\\tag@literal\\tag@paren"),W("\\tag@paren","\\tag@literal{({#1})}"),W("\\tag@literal",e=>{if(e.macros.get("\\df@tag"))throw new Ze("Multiple \\tag");return"\\gdef\\df@tag{\\text{#1}}"}),W("\\bmod","\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}\\mathbin{\\rm mod}\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}"),W("\\pod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern8mu}{\\mkern8mu}{\\mkern8mu}(#1)"),W("\\pmod","\\pod{{\\rm mod}\\mkern6mu#1}"),W("\\mod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern12mu}{\\mkern12mu}{\\mkern12mu}{\\rm mod}\\,\\,#1"),W("\\newline","\\\\\\relax"),W("\\TeX","\\textrm{\\html@mathml{T\\kern-.1667em\\raisebox{-.5ex}{E}\\kern-.125emX}{TeX}}");var t2=nt(za["Main-Regular"][84][1]-.7*za["Main-Regular"][65][1]);W("\\LaTeX","\\textrm{\\html@mathml{"+("L\\kern-.36em\\raisebox{"+t2+"}{\\scriptstyle A}")+"\\kern-.15em\\TeX}{LaTeX}}"),W("\\KaTeX","\\textrm{\\html@mathml{"+("K\\kern-.17em\\raisebox{"+t2+"}{\\scriptstyle A}")+"\\kern-.15em\\TeX}{KaTeX}}"),W("\\hspace","\\@ifstar\\@hspacer\\@hspace"),W("\\@hspace","\\hskip #1\\relax"),W("\\@hspacer","\\rule{0pt}{0pt}\\hskip #1\\relax"),W("\\ordinarycolon",":"),W("\\vcentcolon","\\mathrel{\\mathop\\ordinarycolon}"),W("\\dblcolon",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-.9mu}\\vcentcolon}}{\\mathop{\\char"2237}}'),W("\\coloneqq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2254}}'),W("\\Coloneqq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2237\\char"3d}}'),W("\\coloneq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"3a\\char"2212}}'),W("\\Coloneq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"2237\\char"2212}}'),W("\\eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2255}}'),W("\\Eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"3d\\char"2237}}'),W("\\eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2239}}'),W("\\Eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"2212\\char"2237}}'),W("\\colonapprox",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"3a\\char"2248}}'),W("\\Colonapprox",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"2237\\char"2248}}'),W("\\colonsim",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"3a\\char"223c}}'),W("\\Colonsim",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"2237\\char"223c}}'),W("∷","\\dblcolon"),W("∹","\\eqcolon"),W("≔","\\coloneqq"),W("≕","\\eqqcolon"),W("⩴","\\Coloneqq"),W("\\ratio","\\vcentcolon"),W("\\coloncolon","\\dblcolon"),W("\\colonequals","\\coloneqq"),W("\\coloncolonequals","\\Coloneqq"),W("\\equalscolon","\\eqqcolon"),W("\\equalscoloncolon","\\Eqqcolon"),W("\\colonminus","\\coloneq"),W("\\coloncolonminus","\\Coloneq"),W("\\minuscolon","\\eqcolon"),W("\\minuscoloncolon","\\Eqcolon"),W("\\coloncolonapprox","\\Colonapprox"),W("\\coloncolonsim","\\Colonsim"),W("\\simcolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\vcentcolon}"),W("\\simcoloncolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\dblcolon}"),W("\\approxcolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\vcentcolon}"),W("\\approxcoloncolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\dblcolon}"),W("\\notni","\\html@mathml{\\not\\ni}{\\mathrel{\\char`∌}}"),W("\\limsup","\\DOTSB\\operatorname*{lim\\,sup}"),W("\\liminf","\\DOTSB\\operatorname*{lim\\,inf}"),W("\\injlim","\\DOTSB\\operatorname*{inj\\,lim}"),W("\\projlim","\\DOTSB\\operatorname*{proj\\,lim}"),W("\\varlimsup","\\DOTSB\\operatorname*{\\overline{lim}}"),W("\\varliminf","\\DOTSB\\operatorname*{\\underline{lim}}"),W("\\varinjlim","\\DOTSB\\operatorname*{\\underrightarrow{lim}}"),W("\\varprojlim","\\DOTSB\\operatorname*{\\underleftarrow{lim}}"),W("\\gvertneqq","\\html@mathml{\\@gvertneqq}{≩}"),W("\\lvertneqq","\\html@mathml{\\@lvertneqq}{≨}"),W("\\ngeqq","\\html@mathml{\\@ngeqq}{≱}"),W("\\ngeqslant","\\html@mathml{\\@ngeqslant}{≱}"),W("\\nleqq","\\html@mathml{\\@nleqq}{≰}"),W("\\nleqslant","\\html@mathml{\\@nleqslant}{≰}"),W("\\nshortmid","\\html@mathml{\\@nshortmid}{∤}"),W("\\nshortparallel","\\html@mathml{\\@nshortparallel}{∦}"),W("\\nsubseteqq","\\html@mathml{\\@nsubseteqq}{⊈}"),W("\\nsupseteqq","\\html@mathml{\\@nsupseteqq}{⊉}"),W("\\varsubsetneq","\\html@mathml{\\@varsubsetneq}{⊊}"),W("\\varsubsetneqq","\\html@mathml{\\@varsubsetneqq}{⫋}"),W("\\varsupsetneq","\\html@mathml{\\@varsupsetneq}{⊋}"),W("\\varsupsetneqq","\\html@mathml{\\@varsupsetneqq}{⫌}"),W("\\imath","\\html@mathml{\\@imath}{ı}"),W("\\jmath","\\html@mathml{\\@jmath}{ȷ}"),W("\\llbracket","\\html@mathml{\\mathopen{[\\mkern-3.2mu[}}{\\mathopen{\\char`⟦}}"),W("\\rrbracket","\\html@mathml{\\mathclose{]\\mkern-3.2mu]}}{\\mathclose{\\char`⟧}}"),W("⟦","\\llbracket"),W("⟧","\\rrbracket"),W("\\lBrace","\\html@mathml{\\mathopen{\\{\\mkern-3.2mu[}}{\\mathopen{\\char`⦃}}"),W("\\rBrace","\\html@mathml{\\mathclose{]\\mkern-3.2mu\\}}}{\\mathclose{\\char`⦄}}"),W("⦃","\\lBrace"),W("⦄","\\rBrace"),W("\\minuso","\\mathbin{\\html@mathml{{\\mathrlap{\\mathchoice{\\kern{0.145em}}{\\kern{0.145em}}{\\kern{0.1015em}}{\\kern{0.0725em}}\\circ}{-}}}{\\char`⦵}}"),W("⦵","\\minuso"),W("\\darr","\\downarrow"),W("\\dArr","\\Downarrow"),W("\\Darr","\\Downarrow"),W("\\lang","\\langle"),W("\\rang","\\rangle"),W("\\uarr","\\uparrow"),W("\\uArr","\\Uparrow"),W("\\Uarr","\\Uparrow"),W("\\N","\\mathbb{N}"),W("\\R","\\mathbb{R}"),W("\\Z","\\mathbb{Z}"),W("\\alef","\\aleph"),W("\\alefsym","\\aleph"),W("\\Alpha","\\mathrm{A}"),W("\\Beta","\\mathrm{B}"),W("\\bull","\\bullet"),W("\\Chi","\\mathrm{X}"),W("\\clubs","\\clubsuit"),W("\\cnums","\\mathbb{C}"),W("\\Complex","\\mathbb{C}"),W("\\Dagger","\\ddagger"),W("\\diamonds","\\diamondsuit"),W("\\empty","\\emptyset"),W("\\Epsilon","\\mathrm{E}"),W("\\Eta","\\mathrm{H}"),W("\\exist","\\exists"),W("\\harr","\\leftrightarrow"),W("\\hArr","\\Leftrightarrow"),W("\\Harr","\\Leftrightarrow"),W("\\hearts","\\heartsuit"),W("\\image","\\Im"),W("\\infin","\\infty"),W("\\Iota","\\mathrm{I}"),W("\\isin","\\in"),W("\\Kappa","\\mathrm{K}"),W("\\larr","\\leftarrow"),W("\\lArr","\\Leftarrow"),W("\\Larr","\\Leftarrow"),W("\\lrarr","\\leftrightarrow"),W("\\lrArr","\\Leftrightarrow"),W("\\Lrarr","\\Leftrightarrow"),W("\\Mu","\\mathrm{M}"),W("\\natnums","\\mathbb{N}"),W("\\Nu","\\mathrm{N}"),W("\\Omicron","\\mathrm{O}"),W("\\plusmn","\\pm"),W("\\rarr","\\rightarrow"),W("\\rArr","\\Rightarrow"),W("\\Rarr","\\Rightarrow"),W("\\real","\\Re"),W("\\reals","\\mathbb{R}"),W("\\Reals","\\mathbb{R}"),W("\\Rho","\\mathrm{P}"),W("\\sdot","\\cdot"),W("\\sect","\\S"),W("\\spades","\\spadesuit"),W("\\sub","\\subset"),W("\\sube","\\subseteq"),W("\\supe","\\supseteq"),W("\\Tau","\\mathrm{T}"),W("\\thetasym","\\vartheta"),W("\\weierp","\\wp"),W("\\Zeta","\\mathrm{Z}"),W("\\argmin","\\DOTSB\\operatorname*{arg\\,min}"),W("\\argmax","\\DOTSB\\operatorname*{arg\\,max}"),W("\\plim","\\DOTSB\\mathop{\\operatorname{plim}}\\limits"),W("\\bra","\\mathinner{\\langle{#1}|}"),W("\\ket","\\mathinner{|{#1}\\rangle}"),W("\\braket","\\mathinner{\\langle{#1}\\rangle}"),W("\\Bra","\\left\\langle#1\\right|"),W("\\Ket","\\left|#1\\right\\rangle");var r2=e=>t=>{var r=t.consumeArg().tokens,n=t.consumeArg().tokens,a=t.consumeArg().tokens,i=t.consumeArg().tokens,o=t.macros.get("|"),s=t.macros.get("\\|");t.macros.beginGroup();var l=d=>f=>{e&&(f.macros.set("|",o),a.length&&f.macros.set("\\|",s));var p=d;if(!d&&a.length){var _=f.future();_.text==="|"&&(f.popToken(),p=!0)}return{tokens:p?a:n,numArgs:0}};t.macros.set("|",l(!1)),a.length&&t.macros.set("\\|",l(!0));var c=t.consumeArg().tokens,u=t.expandTokens([...i,...c,...r]);return t.macros.endGroup(),{tokens:u.reverse(),numArgs:0}};W("\\bra@ket",r2(!1)),W("\\bra@set",r2(!0)),W("\\Braket","\\bra@ket{\\left\\langle}{\\,\\middle\\vert\\,}{\\,\\middle\\vert\\,}{\\right\\rangle}"),W("\\Set","\\bra@set{\\left\\{\\:}{\\;\\middle\\vert\\;}{\\;\\middle\\Vert\\;}{\\:\\right\\}}"),W("\\set","\\bra@set{\\{\\,}{\\mid}{}{\\,\\}}"),W("\\angln","{\\angl n}"),W("\\blue","\\textcolor{##6495ed}{#1}"),W("\\orange","\\textcolor{##ffa500}{#1}"),W("\\pink","\\textcolor{##ff00af}{#1}"),W("\\red","\\textcolor{##df0030}{#1}"),W("\\green","\\textcolor{##28ae7b}{#1}"),W("\\gray","\\textcolor{gray}{#1}"),W("\\purple","\\textcolor{##9d38bd}{#1}"),W("\\blueA","\\textcolor{##ccfaff}{#1}"),W("\\blueB","\\textcolor{##80f6ff}{#1}"),W("\\blueC","\\textcolor{##63d9ea}{#1}"),W("\\blueD","\\textcolor{##11accd}{#1}"),W("\\blueE","\\textcolor{##0c7f99}{#1}"),W("\\tealA","\\textcolor{##94fff5}{#1}"),W("\\tealB","\\textcolor{##26edd5}{#1}"),W("\\tealC","\\textcolor{##01d1c1}{#1}"),W("\\tealD","\\textcolor{##01a995}{#1}"),W("\\tealE","\\textcolor{##208170}{#1}"),W("\\greenA","\\textcolor{##b6ffb0}{#1}"),W("\\greenB","\\textcolor{##8af281}{#1}"),W("\\greenC","\\textcolor{##74cf70}{#1}"),W("\\greenD","\\textcolor{##1fab54}{#1}"),W("\\greenE","\\textcolor{##0d923f}{#1}"),W("\\goldA","\\textcolor{##ffd0a9}{#1}"),W("\\goldB","\\textcolor{##ffbb71}{#1}"),W("\\goldC","\\textcolor{##ff9c39}{#1}"),W("\\goldD","\\textcolor{##e07d10}{#1}"),W("\\goldE","\\textcolor{##a75a05}{#1}"),W("\\redA","\\textcolor{##fca9a9}{#1}"),W("\\redB","\\textcolor{##ff8482}{#1}"),W("\\redC","\\textcolor{##f9685d}{#1}"),W("\\redD","\\textcolor{##e84d39}{#1}"),W("\\redE","\\textcolor{##bc2612}{#1}"),W("\\maroonA","\\textcolor{##ffbde0}{#1}"),W("\\maroonB","\\textcolor{##ff92c6}{#1}"),W("\\maroonC","\\textcolor{##ed5fa6}{#1}"),W("\\maroonD","\\textcolor{##ca337c}{#1}"),W("\\maroonE","\\textcolor{##9e034e}{#1}"),W("\\purpleA","\\textcolor{##ddd7ff}{#1}"),W("\\purpleB","\\textcolor{##c6b9fc}{#1}"),W("\\purpleC","\\textcolor{##aa87ff}{#1}"),W("\\purpleD","\\textcolor{##7854ab}{#1}"),W("\\purpleE","\\textcolor{##543b78}{#1}"),W("\\mintA","\\textcolor{##f5f9e8}{#1}"),W("\\mintB","\\textcolor{##edf2df}{#1}"),W("\\mintC","\\textcolor{##e0e5cc}{#1}"),W("\\grayA","\\textcolor{##f6f7f7}{#1}"),W("\\grayB","\\textcolor{##f0f1f2}{#1}"),W("\\grayC","\\textcolor{##e3e5e6}{#1}"),W("\\grayD","\\textcolor{##d6d8da}{#1}"),W("\\grayE","\\textcolor{##babec2}{#1}"),W("\\grayF","\\textcolor{##888d93}{#1}"),W("\\grayG","\\textcolor{##626569}{#1}"),W("\\grayH","\\textcolor{##3b3e40}{#1}"),W("\\grayI","\\textcolor{##21242c}{#1}"),W("\\kaBlue","\\textcolor{##314453}{#1}"),W("\\kaGreen","\\textcolor{##71B307}{#1}");var n2={"^":!0,_:!0,"\\limits":!0,"\\nolimits":!0};class ZI{constructor(t,r,n){this.settings=r,this.expansionCount=0,this.feed(t),this.macros=new WI(YI,r.macros),this.mode=n,this.stack=[]}feed(t){this.lexer=new Jg(t,this.settings)}switchMode(t){this.mode=t}beginGroup(){this.macros.beginGroup()}endGroup(){this.macros.endGroup()}endGroups(){this.macros.endGroups()}future(){return this.stack.length===0&&this.pushToken(this.lexer.lex()),this.stack[this.stack.length-1]}popToken(){return this.future(),this.stack.pop()}pushToken(t){this.stack.push(t)}pushTokens(t){this.stack.push(...t)}scanArgument(t){var r,n,a;if(t){if(this.consumeSpaces(),this.future().text!=="[")return null;r=this.popToken(),{tokens:a,end:n}=this.consumeArg(["]"])}else({tokens:a,start:r,end:n}=this.consumeArg());return this.pushToken(new Mn("EOF",n.loc)),this.pushTokens(a),new Mn("",_n.range(r,n))}consumeSpaces(){for(;;){var t=this.future();if(t.text===" ")this.stack.pop();else break}}consumeArg(t){var r=[],n=t&&t.length>0;n||this.consumeSpaces();var a=this.future(),i,o=0,s=0;do{if(i=this.popToken(),r.push(i),i.text==="{")++o;else if(i.text==="}"){if(--o,o===-1)throw new Ze("Extra }",i)}else if(i.text==="EOF")throw new Ze("Unexpected end of input in a macro argument, expected '"+(t&&n?t[s]:"}")+"'",i);if(t&&n)if((o===0||o===1&&t[s]==="{")&&i.text===t[s]){if(++s,s===t.length){r.splice(-s,s);break}}else s=0}while(o!==0||n);return a.text==="{"&&r[r.length-1].text==="}"&&(r.pop(),r.shift()),r.reverse(),{tokens:r,start:a,end:i}}consumeArgs(t,r){if(r){if(r.length!==t+1)throw new Ze("The length of delimiters doesn't match the number of args!");for(var n=r[0],a=0;a<n.length;a++){var i=this.popToken();if(n[a]!==i.text)throw new Ze("Use of the macro doesn't match its definition",i)}}for(var o=[],s=0;s<t;s++)o.push(this.consumeArg(r&&r[s+1]).tokens);return o}countExpansion(t){if(this.expansionCount+=t,this.expansionCount>this.settings.maxExpand)throw new Ze("Too many expansions: infinite loop or need to increase maxExpand setting")}expandOnce(t){var r=this.popToken(),n=r.text,a=r.noexpand?null:this._getExpansion(n);if(a==null||t&&a.unexpandable){if(t&&a==null&&n[0]==="\\"&&!this.isDefined(n))throw new Ze("Undefined control sequence: "+n);return this.pushToken(r),!1}this.countExpansion(1);var i=a.tokens,o=this.consumeArgs(a.numArgs,a.delimiters);if(a.numArgs){i=i.slice();for(var s=i.length-1;s>=0;--s){var l=i[s];if(l.text==="#"){if(s===0)throw new Ze("Incomplete placeholder at end of macro body",l);if(l=i[--s],l.text==="#")i.splice(s+1,1);else if(/^[1-9]$/.test(l.text))i.splice(s,2,...o[+l.text-1]);else throw new Ze("Not a valid argument number",l)}}}return this.pushTokens(i),i.length}expandAfterFuture(){return this.expandOnce(),this.future()}expandNextToken(){for(;;)if(this.expandOnce()===!1){var t=this.stack.pop();return t.treatAsRelax&&(t.text="\\relax"),t}}expandMacro(t){return this.macros.has(t)?this.expandTokens([new Mn(t)]):void 0}expandTokens(t){var r=[],n=this.stack.length;for(this.pushTokens(t);this.stack.length>n;)if(this.expandOnce(!0)===!1){var a=this.stack.pop();a.treatAsRelax&&(a.noexpand=!1,a.treatAsRelax=!1),r.push(a)}return this.countExpansion(r.length),r}expandMacroAsText(t){var r=this.expandMacro(t);return r&&r.map(n=>n.text).join("")}_getExpansion(t){var r=this.macros.get(t);if(r==null)return r;if(t.length===1){var n=this.lexer.catcodes[t];if(n!=null&&n!==13)return}var a=typeof r=="function"?r(this):r;if(typeof a=="string"){var i=0;if(a.includes("#"))for(var o=a.replace(/##/g,"");o.includes("#"+(i+1));)++i;for(var s=new Jg(a,this.settings),l=[],c=s.lex();c.text!=="EOF";)l.push(c),c=s.lex();l.reverse();var u={tokens:l,numArgs:i};return u}return a}isDefined(t){return this.macros.has(t)||Ri.hasOwnProperty(t)||yr.math.hasOwnProperty(t)||yr.text.hasOwnProperty(t)||n2.hasOwnProperty(t)}isExpandable(t){var r=this.macros.get(t);return r!=null?typeof r=="string"||typeof r=="function"||!r.unexpandable:Ri.hasOwnProperty(t)&&!Ri[t].primitive}}var a2=/^[₊₋₌₍₎₀₁₂₃₄₅₆₇₈₉ₐₑₕᵢⱼₖₗₘₙₒₚᵣₛₜᵤᵥₓᵦᵧᵨᵩᵪ]/,mc=Object.freeze({"₊":"+","₋":"-","₌":"=","₍":"(","₎":")","₀":"0","₁":"1","₂":"2","₃":"3","₄":"4","₅":"5","₆":"6","₇":"7","₈":"8","₉":"9","ₐ":"a","ₑ":"e","ₕ":"h","ᵢ":"i","ⱼ":"j","ₖ":"k","ₗ":"l","ₘ":"m","ₙ":"n","ₒ":"o","ₚ":"p","ᵣ":"r","ₛ":"s","ₜ":"t","ᵤ":"u","ᵥ":"v","ₓ":"x","ᵦ":"β","ᵧ":"γ","ᵨ":"ρ","ᵩ":"ϕ","ᵪ":"χ","⁺":"+","⁻":"-","⁼":"=","⁽":"(","⁾":")","⁰":"0","¹":"1","²":"2","³":"3","⁴":"4","⁵":"5","⁶":"6","⁷":"7","⁸":"8","⁹":"9","ᴬ":"A","ᴮ":"B","ᴰ":"D","ᴱ":"E","ᴳ":"G","ᴴ":"H","ᴵ":"I","ᴶ":"J","ᴷ":"K","ᴸ":"L","ᴹ":"M","ᴺ":"N","ᴼ":"O","ᴾ":"P","ᴿ":"R","ᵀ":"T","ᵁ":"U","ⱽ":"V","ᵂ":"W","ᵃ":"a","ᵇ":"b","ᶜ":"c","ᵈ":"d","ᵉ":"e","ᶠ":"f","ᵍ":"g",ʰ:"h","ⁱ":"i",ʲ:"j","ᵏ":"k",ˡ:"l","ᵐ":"m",ⁿ:"n","ᵒ":"o","ᵖ":"p",ʳ:"r",ˢ:"s","ᵗ":"t","ᵘ":"u","ᵛ":"v",ʷ:"w",ˣ:"x",ʸ:"y","ᶻ":"z","ᵝ":"β","ᵞ":"γ","ᵟ":"δ","ᵠ":"ϕ","ᵡ":"χ","ᶿ":"θ"}),Sd={"́":{text:"\\'",math:"\\acute"},"̀":{text:"\\`",math:"\\grave"},"̈":{text:'\\"',math:"\\ddot"},"̃":{text:"\\~",math:"\\tilde"},"̄":{text:"\\=",math:"\\bar"},"̆":{text:"\\u",math:"\\breve"},"̌":{text:"\\v",math:"\\check"},"̂":{text:"\\^",math:"\\hat"},"̇":{text:"\\.",math:"\\dot"},"̊":{text:"\\r",math:"\\mathring"},"̋":{text:"\\H"},"̧":{text:"\\c"}},i2={á:"á",à:"à",ä:"ä",ǟ:"ǟ",ã:"ã",ā:"ā",ă:"ă",ắ:"ắ",ằ:"ằ",ẵ:"ẵ",ǎ:"ǎ",â:"â",ấ:"ấ",ầ:"ầ",ẫ:"ẫ",ȧ:"ȧ",ǡ:"ǡ",å:"å",ǻ:"ǻ",ḃ:"ḃ",ć:"ć",ḉ:"ḉ",č:"č",ĉ:"ĉ",ċ:"ċ",ç:"ç",ď:"ď",ḋ:"ḋ",ḑ:"ḑ",é:"é",è:"è",ë:"ë",ẽ:"ẽ",ē:"ē",ḗ:"ḗ",ḕ:"ḕ",ĕ:"ĕ",ḝ:"ḝ",ě:"ě",ê:"ê",ế:"ế",ề:"ề",ễ:"ễ",ė:"ė",ȩ:"ȩ",ḟ:"ḟ",ǵ:"ǵ",ḡ:"ḡ",ğ:"ğ",ǧ:"ǧ",ĝ:"ĝ",ġ:"ġ",ģ:"ģ",ḧ:"ḧ",ȟ:"ȟ",ĥ:"ĥ",ḣ:"ḣ",ḩ:"ḩ",í:"í",ì:"ì",ï:"ï",ḯ:"ḯ",ĩ:"ĩ",ī:"ī",ĭ:"ĭ",ǐ:"ǐ",î:"î",ǰ:"ǰ",ĵ:"ĵ",ḱ:"ḱ",ǩ:"ǩ",ķ:"ķ",ĺ:"ĺ",ľ:"ľ",ļ:"ļ",ḿ:"ḿ",ṁ:"ṁ",ń:"ń",ǹ:"ǹ",ñ:"ñ",ň:"ň",ṅ:"ṅ",ņ:"ņ",ó:"ó",ò:"ò",ö:"ö",ȫ:"ȫ",õ:"õ",ṍ:"ṍ",ṏ:"ṏ",ȭ:"ȭ",ō:"ō",ṓ:"ṓ",ṑ:"ṑ",ŏ:"ŏ",ǒ:"ǒ",ô:"ô",ố:"ố",ồ:"ồ",ỗ:"ỗ",ȯ:"ȯ",ȱ:"ȱ",ő:"ő",ṕ:"ṕ",ṗ:"ṗ",ŕ:"ŕ",ř:"ř",ṙ:"ṙ",ŗ:"ŗ",ś:"ś",ṥ:"ṥ",š:"š",ṧ:"ṧ",ŝ:"ŝ",ṡ:"ṡ",ş:"ş",ẗ:"ẗ",ť:"ť",ṫ:"ṫ",ţ:"ţ",ú:"ú",ù:"ù",ü:"ü",ǘ:"ǘ",ǜ:"ǜ",ǖ:"ǖ",ǚ:"ǚ",ũ:"ũ",ṹ:"ṹ",ū:"ū",ṻ:"ṻ",ŭ:"ŭ",ǔ:"ǔ",û:"û",ů:"ů",ű:"ű",ṽ:"ṽ",ẃ:"ẃ",ẁ:"ẁ",ẅ:"ẅ",ŵ:"ŵ",ẇ:"ẇ",ẘ:"ẘ",ẍ:"ẍ",ẋ:"ẋ",ý:"ý",ỳ:"ỳ",ÿ:"ÿ",ỹ:"ỹ",ȳ:"ȳ",ŷ:"ŷ",ẏ:"ẏ",ẙ:"ẙ",ź:"ź",ž:"ž",ẑ:"ẑ",ż:"ż",Á:"Á",À:"À",Ä:"Ä",Ǟ:"Ǟ",Ã:"Ã",Ā:"Ā",Ă:"Ă",Ắ:"Ắ",Ằ:"Ằ",Ẵ:"Ẵ",Ǎ:"Ǎ",Â:"Â",Ấ:"Ấ",Ầ:"Ầ",Ẫ:"Ẫ",Ȧ:"Ȧ",Ǡ:"Ǡ",Å:"Å",Ǻ:"Ǻ",Ḃ:"Ḃ",Ć:"Ć",Ḉ:"Ḉ",Č:"Č",Ĉ:"Ĉ",Ċ:"Ċ",Ç:"Ç",Ď:"Ď",Ḋ:"Ḋ",Ḑ:"Ḑ",É:"É",È:"È",Ë:"Ë",Ẽ:"Ẽ",Ē:"Ē",Ḗ:"Ḗ",Ḕ:"Ḕ",Ĕ:"Ĕ",Ḝ:"Ḝ",Ě:"Ě",Ê:"Ê",Ế:"Ế",Ề:"Ề",Ễ:"Ễ",Ė:"Ė",Ȩ:"Ȩ",Ḟ:"Ḟ",Ǵ:"Ǵ",Ḡ:"Ḡ",Ğ:"Ğ",Ǧ:"Ǧ",Ĝ:"Ĝ",Ġ:"Ġ",Ģ:"Ģ",Ḧ:"Ḧ",Ȟ:"Ȟ",Ĥ:"Ĥ",Ḣ:"Ḣ",Ḩ:"Ḩ",Í:"Í",Ì:"Ì",Ï:"Ï",Ḯ:"Ḯ",Ĩ:"Ĩ",Ī:"Ī",Ĭ:"Ĭ",Ǐ:"Ǐ",Î:"Î",İ:"İ",Ĵ:"Ĵ",Ḱ:"Ḱ",Ǩ:"Ǩ",Ķ:"Ķ",Ĺ:"Ĺ",Ľ:"Ľ",Ļ:"Ļ",Ḿ:"Ḿ",Ṁ:"Ṁ",Ń:"Ń",Ǹ:"Ǹ",Ñ:"Ñ",Ň:"Ň",Ṅ:"Ṅ",Ņ:"Ņ",Ó:"Ó",Ò:"Ò",Ö:"Ö",Ȫ:"Ȫ",Õ:"Õ",Ṍ:"Ṍ",Ṏ:"Ṏ",Ȭ:"Ȭ",Ō:"Ō",Ṓ:"Ṓ",Ṑ:"Ṑ",Ŏ:"Ŏ",Ǒ:"Ǒ",Ô:"Ô",Ố:"Ố",Ồ:"Ồ",Ỗ:"Ỗ",Ȯ:"Ȯ",Ȱ:"Ȱ",Ő:"Ő",Ṕ:"Ṕ",Ṗ:"Ṗ",Ŕ:"Ŕ",Ř:"Ř",Ṙ:"Ṙ",Ŗ:"Ŗ",Ś:"Ś",Ṥ:"Ṥ",Š:"Š",Ṧ:"Ṧ",Ŝ:"Ŝ",Ṡ:"Ṡ",Ş:"Ş",Ť:"Ť",Ṫ:"Ṫ",Ţ:"Ţ",Ú:"Ú",Ù:"Ù",Ü:"Ü",Ǘ:"Ǘ",Ǜ:"Ǜ",Ǖ:"Ǖ",Ǚ:"Ǚ",Ũ:"Ũ",Ṹ:"Ṹ",Ū:"Ū",Ṻ:"Ṻ",Ŭ:"Ŭ",Ǔ:"Ǔ",Û:"Û",Ů:"Ů",Ű:"Ű",Ṽ:"Ṽ",Ẃ:"Ẃ",Ẁ:"Ẁ",Ẅ:"Ẅ",Ŵ:"Ŵ",Ẇ:"Ẇ",Ẍ:"Ẍ",Ẋ:"Ẋ",Ý:"Ý",Ỳ:"Ỳ",Ÿ:"Ÿ",Ỹ:"Ỹ",Ȳ:"Ȳ",Ŷ:"Ŷ",Ẏ:"Ẏ",Ź:"Ź",Ž:"Ž",Ẑ:"Ẑ",Ż:"Ż",ά:"ά",ὰ:"ὰ",ᾱ:"ᾱ",ᾰ:"ᾰ",έ:"έ",ὲ:"ὲ",ή:"ή",ὴ:"ὴ",ί:"ί",ὶ:"ὶ",ϊ:"ϊ",ΐ:"ΐ",ῒ:"ῒ",ῑ:"ῑ",ῐ:"ῐ",ό:"ό",ὸ:"ὸ",ύ:"ύ",ὺ:"ὺ",ϋ:"ϋ",ΰ:"ΰ",ῢ:"ῢ",ῡ:"ῡ",ῠ:"ῠ",ώ:"ώ",ὼ:"ὼ",Ύ:"Ύ",Ὺ:"Ὺ",Ϋ:"Ϋ",Ῡ:"Ῡ",Ῠ:"Ῠ",Ώ:"Ώ",Ὼ:"Ὼ"};class gc{constructor(t,r){this.mode="math",this.gullet=new ZI(t,r,this.mode),this.settings=r,this.leftrightDepth=0,this.nextToken=null}expect(t,r){if(r===void 0&&(r=!0),this.fetch().text!==t)throw new Ze("Expected '"+t+"', got '"+this.fetch().text+"'",this.fetch());r&&this.consume()}consume(){this.nextToken=null}fetch(){return this.nextToken==null&&(this.nextToken=this.gullet.expandNextToken()),this.nextToken}switchMode(t){this.mode=t,this.gullet.switchMode(t)}parse(){this.settings.globalGroup||this.gullet.beginGroup(),this.settings.colorIsTextColor&&this.gullet.macros.set("\\color","\\textcolor");try{var t=this.parseExpression(!1);return this.expect("EOF"),this.settings.globalGroup||this.gullet.endGroup(),t}finally{this.gullet.endGroups()}}subparse(t){var r=this.nextToken;this.consume(),this.gullet.pushToken(new Mn("}")),this.gullet.pushTokens(t);var n=this.parseExpression(!1);return this.expect("}"),this.nextToken=r,n}parseExpression(t,r){for(var n=[];;){this.mode==="math"&&this.consumeSpaces();var a=this.fetch();if(gc.endOfExpression.has(a.text)||r&&a.text===r||t&&Ri[a.text]&&Ri[a.text].infix)break;var i=this.parseAtom(r);if(i){if(i.type==="internal")continue}else break;n.push(i)}return this.mode==="text"&&this.formLigatures(n),this.handleInfixNodes(n)}handleInfixNodes(t){for(var r=-1,n,a=0;a<t.length;a++){var i=t[a];if(i.type==="infix"){if(r!==-1)throw new Ze("only one infix operator per group",i.token);r=a,n=i.replaceWith}}if(r!==-1&&n){var o,s,l=t.slice(0,r),c=t.slice(r+1);l.length===1&&l[0].type==="ordgroup"?o=l[0]:o={type:"ordgroup",mode:this.mode,body:l},c.length===1&&c[0].type==="ordgroup"?s=c[0]:s={type:"ordgroup",mode:this.mode,body:c};var u;return n==="\\\\abovefrac"?u=this.callFunction(n,[o,t[r],s],[]):u=this.callFunction(n,[o,s],[]),[u]}else return t}handleSupSubscript(t){var r=this.fetch(),n=r.text;this.consume(),this.consumeSpaces();var a;do{var i;a=this.parseGroup(t)}while(((i=a)==null?void 0:i.type)==="internal");if(!a)throw new Ze("Expected group after '"+n+"'",r);return a}formatUnsupportedCmd(t){for(var r=[],n=0;n<t.length;n++)r.push({type:"textord",mode:"text",text:t[n]});var a={type:"text",mode:this.mode,body:r},i={type:"color",mode:this.mode,color:this.settings.errorColor,body:[a]};return i}parseAtom(t){var r=this.parseGroup("atom",t);if((r==null?void 0:r.type)==="internal"||this.mode==="text")return r;for(var n,a;;){this.consumeSpaces();var i=this.fetch();if(i.text==="\\limits"||i.text==="\\nolimits"){if(r&&r.type==="op"){var o=i.text==="\\limits";r.limits=o,r.alwaysHandleSupSub=!0}else if(r&&r.type==="operatorname")r.alwaysHandleSupSub&&(r.limits=i.text==="\\limits");else throw new Ze("Limit controls must follow a math operator",i);this.consume()}else if(i.text==="^"){if(n)throw new Ze("Double superscript",i);n=this.handleSupSubscript("superscript")}else if(i.text==="_"){if(a)throw new Ze("Double subscript",i);a=this.handleSupSubscript("subscript")}else if(i.text==="'"){if(n)throw new Ze("Double superscript",i);var s={type:"textord",mode:this.mode,text:"\\prime"},l=[s];for(this.consume();this.fetch().text==="'";)l.push(s),this.consume();this.fetch().text==="^"&&l.push(this.handleSupSubscript("superscript")),n={type:"ordgroup",mode:this.mode,body:l}}else if(mc[i.text]){var c=a2.test(i.text),u=[];for(u.push(new Mn(mc[i.text])),this.consume();;){var d=this.fetch().text;if(!mc[d]||a2.test(d)!==c)break;u.unshift(new Mn(mc[d])),this.consume()}var f=this.subparse(u);c?a={type:"ordgroup",mode:"math",body:f}:n={type:"ordgroup",mode:"math",body:f}}else break}return n||a?{type:"supsub",mode:this.mode,base:r,sup:n,sub:a}:r}parseFunction(t,r){var n=this.fetch(),a=n.text,i=Ri[a];if(!i)return null;if(this.consume(),r&&r!=="atom"&&!i.allowedInArgument)throw new Ze("Got function '"+a+"' with no arguments"+(r?" as "+r:""),n);if(this.mode==="text"&&!i.allowedInText)throw new Ze("Can't use function '"+a+"' in text mode",n);if(this.mode==="math"&&i.allowedInMath===!1)throw new Ze("Can't use function '"+a+"' in math mode",n);var{args:o,optArgs:s}=this.parseArguments(a,i);return this.callFunction(a,o,s,n,t)}callFunction(t,r,n,a,i){var o={funcName:t,parser:this,token:a,breakOnTokenText:i},s=Ri[t];if(s&&s.handler)return s.handler(o,r,n);throw new Ze("No function handler for "+t)}parseArguments(t,r){var n=r.numArgs+r.numOptionalArgs;if(n===0)return{args:[],optArgs:[]};for(var a=[],i=[],o=0;o<n;o++){var s=r.argTypes&&r.argTypes[o],l=o<r.numOptionalArgs;("primitive"in r&&r.primitive&&s==null||r.type==="sqrt"&&o===1&&i[0]==null)&&(s="primitive");var c=this.parseGroupOfType("argument to '"+t+"'",s,l);if(l)i.push(c);else if(c!=null)a.push(c);else throw new Ze("Null argument, please report this as a bug")}return{args:a,optArgs:i}}parseGroupOfType(t,r,n){switch(r){case"color":return this.parseColorGroup(n);case"size":return this.parseSizeGroup(n);case"url":return this.parseUrlGroup(n);case"math":case"text":return this.parseArgumentGroup(n,r);case"hbox":{var a=this.parseArgumentGroup(n,"text");return a!=null?{type:"styling",mode:a.mode,body:[a],style:"text"}:null}case"raw":{var i=this.parseStringGroup("raw",n);return i!=null?{type:"raw",mode:"text",string:i.text}:null}case"primitive":{if(n)throw new Ze("A primitive argument cannot be optional");var o=this.parseGroup(t);if(o==null)throw new Ze("Expected group as "+t,this.fetch());return o}case"original":case null:case void 0:return this.parseArgumentGroup(n);default:throw new Ze("Unknown group type as "+t,this.fetch())}}consumeSpaces(){for(;this.fetch().text===" ";)this.consume()}parseStringGroup(t,r){var n=this.gullet.scanArgument(r);if(n==null)return null;for(var a="",i;(i=this.fetch()).text!=="EOF";)a+=i.text,this.consume();return this.consume(),n.text=a,n}parseRegexGroup(t,r){for(var n=this.fetch(),a=n,i="",o;(o=this.fetch()).text!=="EOF"&&t.test(i+o.text);)a=o,i+=a.text,this.consume();if(i==="")throw new Ze("Invalid "+r+": '"+n.text+"'",n);return n.range(a,i)}parseColorGroup(t){var r=this.parseStringGroup("color",t);if(r==null)return null;var n=/^(#[a-f0-9]{3,4}|#[a-f0-9]{6}|#[a-f0-9]{8}|[a-f0-9]{6}|[a-z]+)$/i.exec(r.text);if(!n)throw new Ze("Invalid color: '"+r.text+"'",r);var a=n[0];return/^[0-9a-f]{6}$/i.test(a)&&(a="#"+a),{type:"color-token",mode:this.mode,color:a}}parseSizeGroup(t){var r,n=!1;if(this.gullet.consumeSpaces(),!t&&this.gullet.future().text!=="{"?r=this.parseRegexGroup(/^[-+]? *(?:$|\d+|\d+\.\d*|\.\d*) *[a-z]{0,2} *$/,"size"):r=this.parseStringGroup("size",t),!r)return null;!t&&r.text.length===0&&(r.text="0pt",n=!0);var a=/([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(r.text);if(!a)throw new Ze("Invalid size: '"+r.text+"'",r);var i={number:+(a[1]+a[2]),unit:a[3]};if(!Fm(i))throw new Ze("Invalid unit: '"+i.unit+"'",r);return{type:"size",mode:this.mode,value:i,isBlank:n}}parseUrlGroup(t){this.gullet.lexer.setCatcode("%",13),this.gullet.lexer.setCatcode("~",12);var r=this.parseStringGroup("url",t);if(this.gullet.lexer.setCatcode("%",14),this.gullet.lexer.setCatcode("~",13),r==null)return null;var n=r.text.replace(/\\([#$%&~_^{}])/g,"$1");return{type:"url",mode:this.mode,url:n}}parseArgumentGroup(t,r){var n=this.gullet.scanArgument(t);if(n==null)return null;var a=this.mode;r&&this.switchMode(r),this.gullet.beginGroup();var i=this.parseExpression(!1,"EOF");this.expect("EOF"),this.gullet.endGroup();var o={type:"ordgroup",mode:this.mode,loc:n.loc,body:i};return r&&this.switchMode(a),o}parseGroup(t,r){var n=this.fetch(),a=n.text,i;if(a==="{"||a==="\\begingroup"){this.consume();var o=a==="{"?"}":"\\endgroup";this.gullet.beginGroup();var s=this.parseExpression(!1,o),l=this.fetch();this.expect(o),this.gullet.endGroup(),i={type:"ordgroup",mode:this.mode,loc:_n.range(n,l),body:s,semisimple:a==="\\begingroup"||void 0}}else if(i=this.parseFunction(r,t)||this.parseSymbol(),i==null&&a[0]==="\\"&&!n2.hasOwnProperty(a)){if(this.settings.throwOnError)throw new Ze("Undefined control sequence: "+a,n);i=this.formatUnsupportedCmd(a),this.consume()}return i}formLigatures(t){for(var r=t.length-1,n=0;n<r;++n){var a=t[n];if(a.type==="textord"){var i=a.text,o=t[n+1];if(!(!o||o.type!=="textord")){if(i==="-"&&o.text==="-"){var s=t[n+2];n+1<r&&s&&s.type==="textord"&&s.text==="-"?(t.splice(n,3,{type:"textord",mode:"text",loc:_n.range(a,s),text:"---"}),r-=2):(t.splice(n,2,{type:"textord",mode:"text",loc:_n.range(a,o),text:"--"}),r-=1)}(i==="'"||i==="`")&&o.text===i&&(t.splice(n,2,{type:"textord",mode:"text",loc:_n.range(a,o),text:i+i}),r-=1)}}}}parseSymbol(){var t=this.fetch(),r=t.text;if(/^\\verb[^a-zA-Z]/.test(r)){this.consume();var n=r.slice(5),a=n.charAt(0)==="*";if(a&&(n=n.slice(1)),n.length<2||n.charAt(0)!==n.slice(-1))throw new Ze(`\\verb assertion failed --
|
|
282
|
-
please report what input caused this bug`);return n=n.slice(1,-1),{type:"verb",mode:"text",body:n,star:a}}i2.hasOwnProperty(r[0])&&!yr[this.mode][r[0]]&&(this.settings.strict&&this.mode==="math"&&this.settings.reportNonstrict("unicodeTextInMathMode",'Accented Unicode text character "'+r[0]+'" used in math mode',t),r=i2[r[0]]+r.slice(1));var i=qI.exec(r);i&&(r=r.substring(0,i.index),r==="i"?r="ı":r==="j"&&(r="ȷ"));var o;if(yr[this.mode][r]){this.settings.strict&&this.mode==="math"&&Kf.includes(r)&&this.settings.reportNonstrict("unicodeTextInMathMode",'Latin-1/Unicode text character "'+r[0]+'" used in math mode',t);var s=yr[this.mode][r].group,l=_n.range(t),c;if(Kz.hasOwnProperty(s)){var u=s;c={type:"atom",mode:this.mode,family:u,loc:l,text:r}}else c={type:s,mode:this.mode,loc:l,text:r};o=c}else if(r.charCodeAt(0)>=128)this.settings.strict&&(Om(r.charCodeAt(0))?this.mode==="math"&&this.settings.reportNonstrict("unicodeTextInMathMode",'Unicode text character "'+r[0]+'" used in math mode',t):this.settings.reportNonstrict("unknownSymbol",'Unrecognized Unicode character "'+r[0]+'"'+(" ("+r.charCodeAt(0)+")"),t)),o={type:"textord",mode:"text",loc:_n.range(t),text:r};else return null;if(this.consume(),i)for(var d=0;d<i[0].length;d++){var f=i[0][d];if(!Sd[f])throw new Ze("Unknown accent ' "+f+"'",t);var p=Sd[f][this.mode]||Sd[f].text;if(!p)throw new Ze("Accent "+f+" unsupported in "+this.mode+" mode",t);o={type:"accent",mode:this.mode,loc:_n.range(t),label:p,isStretchy:!1,isShifty:!0,base:o}}return o}}gc.endOfExpression=new Set(["}","\\endgroup","\\end","\\right","&"]);var Cd=function(t,r){if(!(typeof t=="string"||t instanceof String))throw new TypeError("KaTeX can only parse string typed expression");var n=new gc(t,r);delete n.gullet.macros.current["\\df@tag"];var a=n.parse();if(delete n.gullet.macros.current["\\current@color"],delete n.gullet.macros.current["\\color"],n.gullet.macros.get("\\df@tag")){if(!r.displayMode)throw new Ze("\\tag works only in display equations");a=[{type:"tag",mode:"text",body:a,tag:n.subparse([new Mn("\\df@tag")])}]}return a},Ed=function(t,r,n){r.textContent="";var a=bc(t,n).toNode();r.appendChild(a)};typeof document<"u"&&document.compatMode!=="CSS1Compat"&&(typeof console<"u"&&console.warn("Warning: KaTeX doesn't work in quirks mode. Make sure your website has a suitable doctype."),Ed=function(){throw new Ze("KaTeX doesn't work in quirks mode.")});var o2=function(t,r){var n=bc(t,r).toMarkup();return n},s2=function(t,r){var n=new Lf(r);return Cd(t,n)},l2=function(t,r,n){if(n.throwOnError||!(t instanceof Ze))throw t;var a=Xe(["katex-error"],[new En(r)]);return a.setAttribute("title",t.toString()),a.setAttribute("style","color:"+n.errorColor),a},bc=function(t,r){var n=new Lf(r);try{var a=Cd(t,n);return cI(a,t,n)}catch(i){return l2(i,t,n)}},c2=function(t,r){var n=new Lf(r);try{var a=Cd(t,n);return uI(a,t,n)}catch(i){return l2(i,t,n)}},u2="0.16.45",f2={Span:Wo,Anchor:q0,SymbolNode:En,SvgNode:ni,PathNode:zi,LineNode:Uf},JI={version:u2,render:Ed,renderToString:o2,ParseError:Ze,SETTINGS_SCHEMA:j0,__parse:s2,__renderToDomTree:bc,__renderToHTMLTree:c2,__setFontMetrics:Nm,__defineSymbol:k,__defineFunction:ut,__defineMacro:W,__domTree:f2};const QI=Object.freeze(Object.defineProperty({__proto__:null,ParseError:Ze,SETTINGS_SCHEMA:j0,__defineFunction:ut,__defineMacro:W,__defineSymbol:k,__domTree:f2,__parse:s2,__renderToDomTree:bc,__renderToHTMLTree:c2,__setFontMetrics:Nm,default:JI,get render(){return Ed},renderToString:o2,version:u2},Symbol.toStringTag,{value:"Module"}));var eO=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function d2(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function tO(e){throw new Error('Could not dynamically require "'+e+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var p2={exports:{}},Ad={},h2;function Li(){return h2||(h2=1,function(e){var t=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Int32Array<"u";function r(i,o){return Object.prototype.hasOwnProperty.call(i,o)}e.assign=function(i){for(var o=Array.prototype.slice.call(arguments,1);o.length;){var s=o.shift();if(s){if(typeof s!="object")throw new TypeError(s+"must be non-object");for(var l in s)r(s,l)&&(i[l]=s[l])}}return i},e.shrinkBuf=function(i,o){return i.length===o?i:i.subarray?i.subarray(0,o):(i.length=o,i)};var n={arraySet:function(i,o,s,l,c){if(o.subarray&&i.subarray){i.set(o.subarray(s,s+l),c);return}for(var u=0;u<l;u++)i[c+u]=o[s+u]},flattenChunks:function(i){var o,s,l,c,u,d;for(l=0,o=0,s=i.length;o<s;o++)l+=i[o].length;for(d=new Uint8Array(l),c=0,o=0,s=i.length;o<s;o++)u=i[o],d.set(u,c),c+=u.length;return d}},a={arraySet:function(i,o,s,l,c){for(var u=0;u<l;u++)i[c+u]=o[s+u]},flattenChunks:function(i){return[].concat.apply([],i)}};e.setTyped=function(i){i?(e.Buf8=Uint8Array,e.Buf16=Uint16Array,e.Buf32=Int32Array,e.assign(e,n)):(e.Buf8=Array,e.Buf16=Array,e.Buf32=Array,e.assign(e,a))},e.setTyped(t)}(Ad)),Ad}var Qo={},ia={},fo={},v2;function rO(){if(v2)return fo;v2=1;var e=Li(),t=4,r=0,n=1,a=2;function i(L){for(var ge=L.length;--ge>=0;)L[ge]=0}var o=0,s=1,l=2,c=3,u=258,d=29,f=256,p=f+1+d,_=30,h=19,b=2*p+1,v=15,m=16,y=7,g=256,S=16,M=17,E=18,w=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],x=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],C=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],D=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],B=512,F=new Array((p+2)*2);i(F);var K=new Array(_*2);i(K);var te=new Array(B);i(te);var J=new Array(u-c+1);i(J);var ne=new Array(d);i(ne);var le=new Array(_);i(le);function q(L,ge,Oe,He,de){this.static_tree=L,this.extra_bits=ge,this.extra_base=Oe,this.elems=He,this.max_length=de,this.has_stree=L&&L.length}var j,P,N;function X(L,ge){this.dyn_tree=L,this.max_code=0,this.stat_desc=ge}function Ee(L){return L<256?te[L]:te[256+(L>>>7)]}function Ae(L,ge){L.pending_buf[L.pending++]=ge&255,L.pending_buf[L.pending++]=ge>>>8&255}function ze(L,ge,Oe){L.bi_valid>m-Oe?(L.bi_buf|=ge<<L.bi_valid&65535,Ae(L,L.bi_buf),L.bi_buf=ge>>m-L.bi_valid,L.bi_valid+=Oe-m):(L.bi_buf|=ge<<L.bi_valid&65535,L.bi_valid+=Oe)}function Le(L,ge,Oe){ze(L,Oe[ge*2],Oe[ge*2+1])}function he(L,ge){var Oe=0;do Oe|=L&1,L>>>=1,Oe<<=1;while(--ge>0);return Oe>>>1}function Ie(L){L.bi_valid===16?(Ae(L,L.bi_buf),L.bi_buf=0,L.bi_valid=0):L.bi_valid>=8&&(L.pending_buf[L.pending++]=L.bi_buf&255,L.bi_buf>>=8,L.bi_valid-=8)}function De(L,ge){var Oe=ge.dyn_tree,He=ge.max_code,de=ge.stat_desc.static_tree,Me=ge.stat_desc.has_stree,G=ge.stat_desc.extra_bits,je=ge.stat_desc.extra_base,wt=ge.stat_desc.max_length,A,ie,ae,U,fe,oe,tt=0;for(U=0;U<=v;U++)L.bl_count[U]=0;for(Oe[L.heap[L.heap_max]*2+1]=0,A=L.heap_max+1;A<b;A++)ie=L.heap[A],U=Oe[Oe[ie*2+1]*2+1]+1,U>wt&&(U=wt,tt++),Oe[ie*2+1]=U,!(ie>He)&&(L.bl_count[U]++,fe=0,ie>=je&&(fe=G[ie-je]),oe=Oe[ie*2],L.opt_len+=oe*(U+fe),Me&&(L.static_len+=oe*(de[ie*2+1]+fe)));if(tt!==0){do{for(U=wt-1;L.bl_count[U]===0;)U--;L.bl_count[U]--,L.bl_count[U+1]+=2,L.bl_count[wt]--,tt-=2}while(tt>0);for(U=wt;U!==0;U--)for(ie=L.bl_count[U];ie!==0;)ae=L.heap[--A],!(ae>He)&&(Oe[ae*2+1]!==U&&(L.opt_len+=(U-Oe[ae*2+1])*Oe[ae*2],Oe[ae*2+1]=U),ie--)}}function Be(L,ge,Oe){var He=new Array(v+1),de=0,Me,G;for(Me=1;Me<=v;Me++)He[Me]=de=de+Oe[Me-1]<<1;for(G=0;G<=ge;G++){var je=L[G*2+1];je!==0&&(L[G*2]=he(He[je]++,je))}}function Z(){var L,ge,Oe,He,de,Me=new Array(v+1);for(Oe=0,He=0;He<d-1;He++)for(ne[He]=Oe,L=0;L<1<<w[He];L++)J[Oe++]=He;for(J[Oe-1]=He,de=0,He=0;He<16;He++)for(le[He]=de,L=0;L<1<<x[He];L++)te[de++]=He;for(de>>=7;He<_;He++)for(le[He]=de<<7,L=0;L<1<<x[He]-7;L++)te[256+de++]=He;for(ge=0;ge<=v;ge++)Me[ge]=0;for(L=0;L<=143;)F[L*2+1]=8,L++,Me[8]++;for(;L<=255;)F[L*2+1]=9,L++,Me[9]++;for(;L<=279;)F[L*2+1]=7,L++,Me[7]++;for(;L<=287;)F[L*2+1]=8,L++,Me[8]++;for(Be(F,p+1,Me),L=0;L<_;L++)K[L*2+1]=5,K[L*2]=he(L,5);j=new q(F,w,f+1,p,v),P=new q(K,x,0,_,v),N=new q(new Array(0),C,0,h,y)}function se(L){var ge;for(ge=0;ge<p;ge++)L.dyn_ltree[ge*2]=0;for(ge=0;ge<_;ge++)L.dyn_dtree[ge*2]=0;for(ge=0;ge<h;ge++)L.bl_tree[ge*2]=0;L.dyn_ltree[g*2]=1,L.opt_len=L.static_len=0,L.last_lit=L.matches=0}function we(L){L.bi_valid>8?Ae(L,L.bi_buf):L.bi_valid>0&&(L.pending_buf[L.pending++]=L.bi_buf),L.bi_buf=0,L.bi_valid=0}function Se(L,ge,Oe,He){we(L),Ae(L,Oe),Ae(L,~Oe),e.arraySet(L.pending_buf,L.window,ge,Oe,L.pending),L.pending+=Oe}function me(L,ge,Oe,He){var de=ge*2,Me=Oe*2;return L[de]<L[Me]||L[de]===L[Me]&&He[ge]<=He[Oe]}function ye(L,ge,Oe){for(var He=L.heap[Oe],de=Oe<<1;de<=L.heap_len&&(de<L.heap_len&&me(ge,L.heap[de+1],L.heap[de],L.depth)&&de++,!me(ge,He,L.heap[de],L.depth));)L.heap[Oe]=L.heap[de],Oe=de,de<<=1;L.heap[Oe]=He}function xe(L,ge,Oe){var He,de,Me=0,G,je;if(L.last_lit!==0)do He=L.pending_buf[L.d_buf+Me*2]<<8|L.pending_buf[L.d_buf+Me*2+1],de=L.pending_buf[L.l_buf+Me],Me++,He===0?Le(L,de,ge):(G=J[de],Le(L,G+f+1,ge),je=w[G],je!==0&&(de-=ne[G],ze(L,de,je)),He--,G=Ee(He),Le(L,G,Oe),je=x[G],je!==0&&(He-=le[G],ze(L,He,je)));while(Me<L.last_lit);Le(L,g,ge)}function ee(L,ge){var Oe=ge.dyn_tree,He=ge.stat_desc.static_tree,de=ge.stat_desc.has_stree,Me=ge.stat_desc.elems,G,je,wt=-1,A;for(L.heap_len=0,L.heap_max=b,G=0;G<Me;G++)Oe[G*2]!==0?(L.heap[++L.heap_len]=wt=G,L.depth[G]=0):Oe[G*2+1]=0;for(;L.heap_len<2;)A=L.heap[++L.heap_len]=wt<2?++wt:0,Oe[A*2]=1,L.depth[A]=0,L.opt_len--,de&&(L.static_len-=He[A*2+1]);for(ge.max_code=wt,G=L.heap_len>>1;G>=1;G--)ye(L,Oe,G);A=Me;do G=L.heap[1],L.heap[1]=L.heap[L.heap_len--],ye(L,Oe,1),je=L.heap[1],L.heap[--L.heap_max]=G,L.heap[--L.heap_max]=je,Oe[A*2]=Oe[G*2]+Oe[je*2],L.depth[A]=(L.depth[G]>=L.depth[je]?L.depth[G]:L.depth[je])+1,Oe[G*2+1]=Oe[je*2+1]=A,L.heap[1]=A++,ye(L,Oe,1);while(L.heap_len>=2);L.heap[--L.heap_max]=L.heap[1],De(L,ge),Be(Oe,wt,L.bl_count)}function pe(L,ge,Oe){var He,de=-1,Me,G=ge[0*2+1],je=0,wt=7,A=4;for(G===0&&(wt=138,A=3),ge[(Oe+1)*2+1]=65535,He=0;He<=Oe;He++)Me=G,G=ge[(He+1)*2+1],!(++je<wt&&Me===G)&&(je<A?L.bl_tree[Me*2]+=je:Me!==0?(Me!==de&&L.bl_tree[Me*2]++,L.bl_tree[S*2]++):je<=10?L.bl_tree[M*2]++:L.bl_tree[E*2]++,je=0,de=Me,G===0?(wt=138,A=3):Me===G?(wt=6,A=3):(wt=7,A=4))}function ve(L,ge,Oe){var He,de=-1,Me,G=ge[0*2+1],je=0,wt=7,A=4;for(G===0&&(wt=138,A=3),He=0;He<=Oe;He++)if(Me=G,G=ge[(He+1)*2+1],!(++je<wt&&Me===G)){if(je<A)do Le(L,Me,L.bl_tree);while(--je!==0);else Me!==0?(Me!==de&&(Le(L,Me,L.bl_tree),je--),Le(L,S,L.bl_tree),ze(L,je-3,2)):je<=10?(Le(L,M,L.bl_tree),ze(L,je-3,3)):(Le(L,E,L.bl_tree),ze(L,je-11,7));je=0,de=Me,G===0?(wt=138,A=3):Me===G?(wt=6,A=3):(wt=7,A=4)}}function Pe(L){var ge;for(pe(L,L.dyn_ltree,L.l_desc.max_code),pe(L,L.dyn_dtree,L.d_desc.max_code),ee(L,L.bl_desc),ge=h-1;ge>=3&&L.bl_tree[D[ge]*2+1]===0;ge--);return L.opt_len+=3*(ge+1)+5+5+4,ge}function Ge(L,ge,Oe,He){var de;for(ze(L,ge-257,5),ze(L,Oe-1,5),ze(L,He-4,4),de=0;de<He;de++)ze(L,L.bl_tree[D[de]*2+1],3);ve(L,L.dyn_ltree,ge-1),ve(L,L.dyn_dtree,Oe-1)}function Ue(L){var ge=4093624447,Oe;for(Oe=0;Oe<=31;Oe++,ge>>>=1)if(ge&1&&L.dyn_ltree[Oe*2]!==0)return r;if(L.dyn_ltree[9*2]!==0||L.dyn_ltree[10*2]!==0||L.dyn_ltree[13*2]!==0)return n;for(Oe=32;Oe<f;Oe++)if(L.dyn_ltree[Oe*2]!==0)return n;return r}var We=!1;function rt(L){We||(Z(),We=!0),L.l_desc=new X(L.dyn_ltree,j),L.d_desc=new X(L.dyn_dtree,P),L.bl_desc=new X(L.bl_tree,N),L.bi_buf=0,L.bi_valid=0,se(L)}function lt(L,ge,Oe,He){ze(L,(o<<1)+(He?1:0),3),Se(L,ge,Oe)}function ft(L){ze(L,s<<1,3),Le(L,g,F),Ie(L)}function St(L,ge,Oe,He){var de,Me,G=0;L.level>0?(L.strm.data_type===a&&(L.strm.data_type=Ue(L)),ee(L,L.l_desc),ee(L,L.d_desc),G=Pe(L),de=L.opt_len+3+7>>>3,Me=L.static_len+3+7>>>3,Me<=de&&(de=Me)):de=Me=Oe+5,Oe+4<=de&&ge!==-1?lt(L,ge,Oe,He):L.strategy===t||Me===de?(ze(L,(s<<1)+(He?1:0),3),xe(L,F,K)):(ze(L,(l<<1)+(He?1:0),3),Ge(L,L.l_desc.max_code+1,L.d_desc.max_code+1,G+1),xe(L,L.dyn_ltree,L.dyn_dtree)),se(L),He&&we(L)}function $e(L,ge,Oe){return L.pending_buf[L.d_buf+L.last_lit*2]=ge>>>8&255,L.pending_buf[L.d_buf+L.last_lit*2+1]=ge&255,L.pending_buf[L.l_buf+L.last_lit]=Oe&255,L.last_lit++,ge===0?L.dyn_ltree[Oe*2]++:(L.matches++,ge--,L.dyn_ltree[(J[Oe]+f+1)*2]++,L.dyn_dtree[Ee(ge)*2]++),L.last_lit===L.lit_bufsize-1}return fo._tr_init=rt,fo._tr_stored_block=lt,fo._tr_flush_block=St,fo._tr_tally=$e,fo._tr_align=ft,fo}var Td,m2;function g2(){if(m2)return Td;m2=1;function e(t,r,n,a){for(var i=t&65535|0,o=t>>>16&65535|0,s=0;n!==0;){s=n>2e3?2e3:n,n-=s;do i=i+r[a++]|0,o=o+i|0;while(--s);i%=65521,o%=65521}return i|o<<16|0}return Td=e,Td}var Md,b2;function y2(){if(b2)return Md;b2=1;function e(){for(var n,a=[],i=0;i<256;i++){n=i;for(var o=0;o<8;o++)n=n&1?3988292384^n>>>1:n>>>1;a[i]=n}return a}var t=e();function r(n,a,i,o){var s=t,l=o+i;n^=-1;for(var c=o;c<l;c++)n=n>>>8^s[(n^a[c])&255];return n^-1}return Md=r,Md}var Dd,_2;function zd(){return _2||(_2=1,Dd={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}),Dd}var x2;function nO(){if(x2)return ia;x2=1;var e=Li(),t=rO(),r=g2(),n=y2(),a=zd(),i=0,o=1,s=3,l=4,c=5,u=0,d=1,f=-2,p=-3,_=-5,h=-1,b=1,v=2,m=3,y=4,g=0,S=2,M=8,E=9,w=15,x=8,C=29,D=256,B=D+1+C,F=30,K=19,te=2*B+1,J=15,ne=3,le=258,q=le+ne+1,j=32,P=42,N=69,X=73,Ee=91,Ae=103,ze=113,Le=666,he=1,Ie=2,De=3,Be=4,Z=3;function se(A,ie){return A.msg=a[ie],ie}function we(A){return(A<<1)-(A>4?9:0)}function Se(A){for(var ie=A.length;--ie>=0;)A[ie]=0}function me(A){var ie=A.state,ae=ie.pending;ae>A.avail_out&&(ae=A.avail_out),ae!==0&&(e.arraySet(A.output,ie.pending_buf,ie.pending_out,ae,A.next_out),A.next_out+=ae,ie.pending_out+=ae,A.total_out+=ae,A.avail_out-=ae,ie.pending-=ae,ie.pending===0&&(ie.pending_out=0))}function ye(A,ie){t._tr_flush_block(A,A.block_start>=0?A.block_start:-1,A.strstart-A.block_start,ie),A.block_start=A.strstart,me(A.strm)}function xe(A,ie){A.pending_buf[A.pending++]=ie}function ee(A,ie){A.pending_buf[A.pending++]=ie>>>8&255,A.pending_buf[A.pending++]=ie&255}function pe(A,ie,ae,U){var fe=A.avail_in;return fe>U&&(fe=U),fe===0?0:(A.avail_in-=fe,e.arraySet(ie,A.input,A.next_in,fe,ae),A.state.wrap===1?A.adler=r(A.adler,ie,fe,ae):A.state.wrap===2&&(A.adler=n(A.adler,ie,fe,ae)),A.next_in+=fe,A.total_in+=fe,fe)}function ve(A,ie){var ae=A.max_chain_length,U=A.strstart,fe,oe,tt=A.prev_length,st=A.nice_match,Ye=A.strstart>A.w_size-q?A.strstart-(A.w_size-q):0,It=A.window,wr=A.w_mask,hr=A.prev,Bt=A.strstart+le,or=It[U+tt-1],Br=It[U+tt];A.prev_length>=A.good_match&&(ae>>=2),st>A.lookahead&&(st=A.lookahead);do if(fe=ie,!(It[fe+tt]!==Br||It[fe+tt-1]!==or||It[fe]!==It[U]||It[++fe]!==It[U+1])){U+=2,fe++;do;while(It[++U]===It[++fe]&&It[++U]===It[++fe]&&It[++U]===It[++fe]&&It[++U]===It[++fe]&&It[++U]===It[++fe]&&It[++U]===It[++fe]&&It[++U]===It[++fe]&&It[++U]===It[++fe]&&U<Bt);if(oe=le-(Bt-U),U=Bt-le,oe>tt){if(A.match_start=ie,tt=oe,oe>=st)break;or=It[U+tt-1],Br=It[U+tt]}}while((ie=hr[ie&wr])>Ye&&--ae!==0);return tt<=A.lookahead?tt:A.lookahead}function Pe(A){var ie=A.w_size,ae,U,fe,oe,tt;do{if(oe=A.window_size-A.lookahead-A.strstart,A.strstart>=ie+(ie-q)){e.arraySet(A.window,A.window,ie,ie,0),A.match_start-=ie,A.strstart-=ie,A.block_start-=ie,U=A.hash_size,ae=U;do fe=A.head[--ae],A.head[ae]=fe>=ie?fe-ie:0;while(--U);U=ie,ae=U;do fe=A.prev[--ae],A.prev[ae]=fe>=ie?fe-ie:0;while(--U);oe+=ie}if(A.strm.avail_in===0)break;if(U=pe(A.strm,A.window,A.strstart+A.lookahead,oe),A.lookahead+=U,A.lookahead+A.insert>=ne)for(tt=A.strstart-A.insert,A.ins_h=A.window[tt],A.ins_h=(A.ins_h<<A.hash_shift^A.window[tt+1])&A.hash_mask;A.insert&&(A.ins_h=(A.ins_h<<A.hash_shift^A.window[tt+ne-1])&A.hash_mask,A.prev[tt&A.w_mask]=A.head[A.ins_h],A.head[A.ins_h]=tt,tt++,A.insert--,!(A.lookahead+A.insert<ne)););}while(A.lookahead<q&&A.strm.avail_in!==0)}function Ge(A,ie){var ae=65535;for(ae>A.pending_buf_size-5&&(ae=A.pending_buf_size-5);;){if(A.lookahead<=1){if(Pe(A),A.lookahead===0&&ie===i)return he;if(A.lookahead===0)break}A.strstart+=A.lookahead,A.lookahead=0;var U=A.block_start+ae;if((A.strstart===0||A.strstart>=U)&&(A.lookahead=A.strstart-U,A.strstart=U,ye(A,!1),A.strm.avail_out===0)||A.strstart-A.block_start>=A.w_size-q&&(ye(A,!1),A.strm.avail_out===0))return he}return A.insert=0,ie===l?(ye(A,!0),A.strm.avail_out===0?De:Be):(A.strstart>A.block_start&&(ye(A,!1),A.strm.avail_out===0),he)}function Ue(A,ie){for(var ae,U;;){if(A.lookahead<q){if(Pe(A),A.lookahead<q&&ie===i)return he;if(A.lookahead===0)break}if(ae=0,A.lookahead>=ne&&(A.ins_h=(A.ins_h<<A.hash_shift^A.window[A.strstart+ne-1])&A.hash_mask,ae=A.prev[A.strstart&A.w_mask]=A.head[A.ins_h],A.head[A.ins_h]=A.strstart),ae!==0&&A.strstart-ae<=A.w_size-q&&(A.match_length=ve(A,ae)),A.match_length>=ne)if(U=t._tr_tally(A,A.strstart-A.match_start,A.match_length-ne),A.lookahead-=A.match_length,A.match_length<=A.max_lazy_match&&A.lookahead>=ne){A.match_length--;do A.strstart++,A.ins_h=(A.ins_h<<A.hash_shift^A.window[A.strstart+ne-1])&A.hash_mask,ae=A.prev[A.strstart&A.w_mask]=A.head[A.ins_h],A.head[A.ins_h]=A.strstart;while(--A.match_length!==0);A.strstart++}else A.strstart+=A.match_length,A.match_length=0,A.ins_h=A.window[A.strstart],A.ins_h=(A.ins_h<<A.hash_shift^A.window[A.strstart+1])&A.hash_mask;else U=t._tr_tally(A,0,A.window[A.strstart]),A.lookahead--,A.strstart++;if(U&&(ye(A,!1),A.strm.avail_out===0))return he}return A.insert=A.strstart<ne-1?A.strstart:ne-1,ie===l?(ye(A,!0),A.strm.avail_out===0?De:Be):A.last_lit&&(ye(A,!1),A.strm.avail_out===0)?he:Ie}function We(A,ie){for(var ae,U,fe;;){if(A.lookahead<q){if(Pe(A),A.lookahead<q&&ie===i)return he;if(A.lookahead===0)break}if(ae=0,A.lookahead>=ne&&(A.ins_h=(A.ins_h<<A.hash_shift^A.window[A.strstart+ne-1])&A.hash_mask,ae=A.prev[A.strstart&A.w_mask]=A.head[A.ins_h],A.head[A.ins_h]=A.strstart),A.prev_length=A.match_length,A.prev_match=A.match_start,A.match_length=ne-1,ae!==0&&A.prev_length<A.max_lazy_match&&A.strstart-ae<=A.w_size-q&&(A.match_length=ve(A,ae),A.match_length<=5&&(A.strategy===b||A.match_length===ne&&A.strstart-A.match_start>4096)&&(A.match_length=ne-1)),A.prev_length>=ne&&A.match_length<=A.prev_length){fe=A.strstart+A.lookahead-ne,U=t._tr_tally(A,A.strstart-1-A.prev_match,A.prev_length-ne),A.lookahead-=A.prev_length-1,A.prev_length-=2;do++A.strstart<=fe&&(A.ins_h=(A.ins_h<<A.hash_shift^A.window[A.strstart+ne-1])&A.hash_mask,ae=A.prev[A.strstart&A.w_mask]=A.head[A.ins_h],A.head[A.ins_h]=A.strstart);while(--A.prev_length!==0);if(A.match_available=0,A.match_length=ne-1,A.strstart++,U&&(ye(A,!1),A.strm.avail_out===0))return he}else if(A.match_available){if(U=t._tr_tally(A,0,A.window[A.strstart-1]),U&&ye(A,!1),A.strstart++,A.lookahead--,A.strm.avail_out===0)return he}else A.match_available=1,A.strstart++,A.lookahead--}return A.match_available&&(U=t._tr_tally(A,0,A.window[A.strstart-1]),A.match_available=0),A.insert=A.strstart<ne-1?A.strstart:ne-1,ie===l?(ye(A,!0),A.strm.avail_out===0?De:Be):A.last_lit&&(ye(A,!1),A.strm.avail_out===0)?he:Ie}function rt(A,ie){for(var ae,U,fe,oe,tt=A.window;;){if(A.lookahead<=le){if(Pe(A),A.lookahead<=le&&ie===i)return he;if(A.lookahead===0)break}if(A.match_length=0,A.lookahead>=ne&&A.strstart>0&&(fe=A.strstart-1,U=tt[fe],U===tt[++fe]&&U===tt[++fe]&&U===tt[++fe])){oe=A.strstart+le;do;while(U===tt[++fe]&&U===tt[++fe]&&U===tt[++fe]&&U===tt[++fe]&&U===tt[++fe]&&U===tt[++fe]&&U===tt[++fe]&&U===tt[++fe]&&fe<oe);A.match_length=le-(oe-fe),A.match_length>A.lookahead&&(A.match_length=A.lookahead)}if(A.match_length>=ne?(ae=t._tr_tally(A,1,A.match_length-ne),A.lookahead-=A.match_length,A.strstart+=A.match_length,A.match_length=0):(ae=t._tr_tally(A,0,A.window[A.strstart]),A.lookahead--,A.strstart++),ae&&(ye(A,!1),A.strm.avail_out===0))return he}return A.insert=0,ie===l?(ye(A,!0),A.strm.avail_out===0?De:Be):A.last_lit&&(ye(A,!1),A.strm.avail_out===0)?he:Ie}function lt(A,ie){for(var ae;;){if(A.lookahead===0&&(Pe(A),A.lookahead===0)){if(ie===i)return he;break}if(A.match_length=0,ae=t._tr_tally(A,0,A.window[A.strstart]),A.lookahead--,A.strstart++,ae&&(ye(A,!1),A.strm.avail_out===0))return he}return A.insert=0,ie===l?(ye(A,!0),A.strm.avail_out===0?De:Be):A.last_lit&&(ye(A,!1),A.strm.avail_out===0)?he:Ie}function ft(A,ie,ae,U,fe){this.good_length=A,this.max_lazy=ie,this.nice_length=ae,this.max_chain=U,this.func=fe}var St;St=[new ft(0,0,0,0,Ge),new ft(4,4,8,4,Ue),new ft(4,5,16,8,Ue),new ft(4,6,32,32,Ue),new ft(4,4,16,16,We),new ft(8,16,32,32,We),new ft(8,16,128,128,We),new ft(8,32,128,256,We),new ft(32,128,258,1024,We),new ft(32,258,258,4096,We)];function $e(A){A.window_size=2*A.w_size,Se(A.head),A.max_lazy_match=St[A.level].max_lazy,A.good_match=St[A.level].good_length,A.nice_match=St[A.level].nice_length,A.max_chain_length=St[A.level].max_chain,A.strstart=0,A.block_start=0,A.lookahead=0,A.insert=0,A.match_length=A.prev_length=ne-1,A.match_available=0,A.ins_h=0}function L(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=M,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new e.Buf16(te*2),this.dyn_dtree=new e.Buf16((2*F+1)*2),this.bl_tree=new e.Buf16((2*K+1)*2),Se(this.dyn_ltree),Se(this.dyn_dtree),Se(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new e.Buf16(J+1),this.heap=new e.Buf16(2*B+1),Se(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new e.Buf16(2*B+1),Se(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function ge(A){var ie;return!A||!A.state?se(A,f):(A.total_in=A.total_out=0,A.data_type=S,ie=A.state,ie.pending=0,ie.pending_out=0,ie.wrap<0&&(ie.wrap=-ie.wrap),ie.status=ie.wrap?P:ze,A.adler=ie.wrap===2?0:1,ie.last_flush=i,t._tr_init(ie),u)}function Oe(A){var ie=ge(A);return ie===u&&$e(A.state),ie}function He(A,ie){return!A||!A.state||A.state.wrap!==2?f:(A.state.gzhead=ie,u)}function de(A,ie,ae,U,fe,oe){if(!A)return f;var tt=1;if(ie===h&&(ie=6),U<0?(tt=0,U=-U):U>15&&(tt=2,U-=16),fe<1||fe>E||ae!==M||U<8||U>15||ie<0||ie>9||oe<0||oe>y)return se(A,f);U===8&&(U=9);var st=new L;return A.state=st,st.strm=A,st.wrap=tt,st.gzhead=null,st.w_bits=U,st.w_size=1<<st.w_bits,st.w_mask=st.w_size-1,st.hash_bits=fe+7,st.hash_size=1<<st.hash_bits,st.hash_mask=st.hash_size-1,st.hash_shift=~~((st.hash_bits+ne-1)/ne),st.window=new e.Buf8(st.w_size*2),st.head=new e.Buf16(st.hash_size),st.prev=new e.Buf16(st.w_size),st.lit_bufsize=1<<fe+6,st.pending_buf_size=st.lit_bufsize*4,st.pending_buf=new e.Buf8(st.pending_buf_size),st.d_buf=1*st.lit_bufsize,st.l_buf=3*st.lit_bufsize,st.level=ie,st.strategy=oe,st.method=ae,Oe(A)}function Me(A,ie){return de(A,ie,M,w,x,g)}function G(A,ie){var ae,U,fe,oe;if(!A||!A.state||ie>c||ie<0)return A?se(A,f):f;if(U=A.state,!A.output||!A.input&&A.avail_in!==0||U.status===Le&&ie!==l)return se(A,A.avail_out===0?_:f);if(U.strm=A,ae=U.last_flush,U.last_flush=ie,U.status===P)if(U.wrap===2)A.adler=0,xe(U,31),xe(U,139),xe(U,8),U.gzhead?(xe(U,(U.gzhead.text?1:0)+(U.gzhead.hcrc?2:0)+(U.gzhead.extra?4:0)+(U.gzhead.name?8:0)+(U.gzhead.comment?16:0)),xe(U,U.gzhead.time&255),xe(U,U.gzhead.time>>8&255),xe(U,U.gzhead.time>>16&255),xe(U,U.gzhead.time>>24&255),xe(U,U.level===9?2:U.strategy>=v||U.level<2?4:0),xe(U,U.gzhead.os&255),U.gzhead.extra&&U.gzhead.extra.length&&(xe(U,U.gzhead.extra.length&255),xe(U,U.gzhead.extra.length>>8&255)),U.gzhead.hcrc&&(A.adler=n(A.adler,U.pending_buf,U.pending,0)),U.gzindex=0,U.status=N):(xe(U,0),xe(U,0),xe(U,0),xe(U,0),xe(U,0),xe(U,U.level===9?2:U.strategy>=v||U.level<2?4:0),xe(U,Z),U.status=ze);else{var tt=M+(U.w_bits-8<<4)<<8,st=-1;U.strategy>=v||U.level<2?st=0:U.level<6?st=1:U.level===6?st=2:st=3,tt|=st<<6,U.strstart!==0&&(tt|=j),tt+=31-tt%31,U.status=ze,ee(U,tt),U.strstart!==0&&(ee(U,A.adler>>>16),ee(U,A.adler&65535)),A.adler=1}if(U.status===N)if(U.gzhead.extra){for(fe=U.pending;U.gzindex<(U.gzhead.extra.length&65535)&&!(U.pending===U.pending_buf_size&&(U.gzhead.hcrc&&U.pending>fe&&(A.adler=n(A.adler,U.pending_buf,U.pending-fe,fe)),me(A),fe=U.pending,U.pending===U.pending_buf_size));)xe(U,U.gzhead.extra[U.gzindex]&255),U.gzindex++;U.gzhead.hcrc&&U.pending>fe&&(A.adler=n(A.adler,U.pending_buf,U.pending-fe,fe)),U.gzindex===U.gzhead.extra.length&&(U.gzindex=0,U.status=X)}else U.status=X;if(U.status===X)if(U.gzhead.name){fe=U.pending;do{if(U.pending===U.pending_buf_size&&(U.gzhead.hcrc&&U.pending>fe&&(A.adler=n(A.adler,U.pending_buf,U.pending-fe,fe)),me(A),fe=U.pending,U.pending===U.pending_buf_size)){oe=1;break}U.gzindex<U.gzhead.name.length?oe=U.gzhead.name.charCodeAt(U.gzindex++)&255:oe=0,xe(U,oe)}while(oe!==0);U.gzhead.hcrc&&U.pending>fe&&(A.adler=n(A.adler,U.pending_buf,U.pending-fe,fe)),oe===0&&(U.gzindex=0,U.status=Ee)}else U.status=Ee;if(U.status===Ee)if(U.gzhead.comment){fe=U.pending;do{if(U.pending===U.pending_buf_size&&(U.gzhead.hcrc&&U.pending>fe&&(A.adler=n(A.adler,U.pending_buf,U.pending-fe,fe)),me(A),fe=U.pending,U.pending===U.pending_buf_size)){oe=1;break}U.gzindex<U.gzhead.comment.length?oe=U.gzhead.comment.charCodeAt(U.gzindex++)&255:oe=0,xe(U,oe)}while(oe!==0);U.gzhead.hcrc&&U.pending>fe&&(A.adler=n(A.adler,U.pending_buf,U.pending-fe,fe)),oe===0&&(U.status=Ae)}else U.status=Ae;if(U.status===Ae&&(U.gzhead.hcrc?(U.pending+2>U.pending_buf_size&&me(A),U.pending+2<=U.pending_buf_size&&(xe(U,A.adler&255),xe(U,A.adler>>8&255),A.adler=0,U.status=ze)):U.status=ze),U.pending!==0){if(me(A),A.avail_out===0)return U.last_flush=-1,u}else if(A.avail_in===0&&we(ie)<=we(ae)&&ie!==l)return se(A,_);if(U.status===Le&&A.avail_in!==0)return se(A,_);if(A.avail_in!==0||U.lookahead!==0||ie!==i&&U.status!==Le){var Ye=U.strategy===v?lt(U,ie):U.strategy===m?rt(U,ie):St[U.level].func(U,ie);if((Ye===De||Ye===Be)&&(U.status=Le),Ye===he||Ye===De)return A.avail_out===0&&(U.last_flush=-1),u;if(Ye===Ie&&(ie===o?t._tr_align(U):ie!==c&&(t._tr_stored_block(U,0,0,!1),ie===s&&(Se(U.head),U.lookahead===0&&(U.strstart=0,U.block_start=0,U.insert=0))),me(A),A.avail_out===0))return U.last_flush=-1,u}return ie!==l?u:U.wrap<=0?d:(U.wrap===2?(xe(U,A.adler&255),xe(U,A.adler>>8&255),xe(U,A.adler>>16&255),xe(U,A.adler>>24&255),xe(U,A.total_in&255),xe(U,A.total_in>>8&255),xe(U,A.total_in>>16&255),xe(U,A.total_in>>24&255)):(ee(U,A.adler>>>16),ee(U,A.adler&65535)),me(A),U.wrap>0&&(U.wrap=-U.wrap),U.pending!==0?u:d)}function je(A){var ie;return!A||!A.state?f:(ie=A.state.status,ie!==P&&ie!==N&&ie!==X&&ie!==Ee&&ie!==Ae&&ie!==ze&&ie!==Le?se(A,f):(A.state=null,ie===ze?se(A,p):u))}function wt(A,ie){var ae=ie.length,U,fe,oe,tt,st,Ye,It,wr;if(!A||!A.state||(U=A.state,tt=U.wrap,tt===2||tt===1&&U.status!==P||U.lookahead))return f;for(tt===1&&(A.adler=r(A.adler,ie,ae,0)),U.wrap=0,ae>=U.w_size&&(tt===0&&(Se(U.head),U.strstart=0,U.block_start=0,U.insert=0),wr=new e.Buf8(U.w_size),e.arraySet(wr,ie,ae-U.w_size,U.w_size,0),ie=wr,ae=U.w_size),st=A.avail_in,Ye=A.next_in,It=A.input,A.avail_in=ae,A.next_in=0,A.input=ie,Pe(U);U.lookahead>=ne;){fe=U.strstart,oe=U.lookahead-(ne-1);do U.ins_h=(U.ins_h<<U.hash_shift^U.window[fe+ne-1])&U.hash_mask,U.prev[fe&U.w_mask]=U.head[U.ins_h],U.head[U.ins_h]=fe,fe++;while(--oe);U.strstart=fe,U.lookahead=ne-1,Pe(U)}return U.strstart+=U.lookahead,U.block_start=U.strstart,U.insert=U.lookahead,U.lookahead=0,U.match_length=U.prev_length=ne-1,U.match_available=0,A.next_in=Ye,A.input=It,A.avail_in=st,U.wrap=tt,u}return ia.deflateInit=Me,ia.deflateInit2=de,ia.deflateReset=Oe,ia.deflateResetKeep=ge,ia.deflateSetHeader=He,ia.deflate=G,ia.deflateEnd=je,ia.deflateSetDictionary=wt,ia.deflateInfo="pako deflate (from Nodeca project)",ia}var po={},w2;function k2(){if(w2)return po;w2=1;var e=Li(),t=!0,r=!0;try{String.fromCharCode.apply(null,[0])}catch{t=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{r=!1}for(var n=new e.Buf8(256),a=0;a<256;a++)n[a]=a>=252?6:a>=248?5:a>=240?4:a>=224?3:a>=192?2:1;n[254]=n[254]=1,po.string2buf=function(o){var s,l,c,u,d,f=o.length,p=0;for(u=0;u<f;u++)l=o.charCodeAt(u),(l&64512)===55296&&u+1<f&&(c=o.charCodeAt(u+1),(c&64512)===56320&&(l=65536+(l-55296<<10)+(c-56320),u++)),p+=l<128?1:l<2048?2:l<65536?3:4;for(s=new e.Buf8(p),d=0,u=0;d<p;u++)l=o.charCodeAt(u),(l&64512)===55296&&u+1<f&&(c=o.charCodeAt(u+1),(c&64512)===56320&&(l=65536+(l-55296<<10)+(c-56320),u++)),l<128?s[d++]=l:l<2048?(s[d++]=192|l>>>6,s[d++]=128|l&63):l<65536?(s[d++]=224|l>>>12,s[d++]=128|l>>>6&63,s[d++]=128|l&63):(s[d++]=240|l>>>18,s[d++]=128|l>>>12&63,s[d++]=128|l>>>6&63,s[d++]=128|l&63);return s};function i(o,s){if(s<65534&&(o.subarray&&r||!o.subarray&&t))return String.fromCharCode.apply(null,e.shrinkBuf(o,s));for(var l="",c=0;c<s;c++)l+=String.fromCharCode(o[c]);return l}return po.buf2binstring=function(o){return i(o,o.length)},po.binstring2buf=function(o){for(var s=new e.Buf8(o.length),l=0,c=s.length;l<c;l++)s[l]=o.charCodeAt(l);return s},po.buf2string=function(o,s){var l,c,u,d,f=s||o.length,p=new Array(f*2);for(c=0,l=0;l<f;){if(u=o[l++],u<128){p[c++]=u;continue}if(d=n[u],d>4){p[c++]=65533,l+=d-1;continue}for(u&=d===2?31:d===3?15:7;d>1&&l<f;)u=u<<6|o[l++]&63,d--;if(d>1){p[c++]=65533;continue}u<65536?p[c++]=u:(u-=65536,p[c++]=55296|u>>10&1023,p[c++]=56320|u&1023)}return i(p,c)},po.utf8border=function(o,s){var l;for(s=s||o.length,s>o.length&&(s=o.length),l=s-1;l>=0&&(o[l]&192)===128;)l--;return l<0||l===0?s:l+n[o[l]]>s?l:s},po}var Id,S2;function C2(){if(S2)return Id;S2=1;function e(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}return Id=e,Id}var E2;function aO(){if(E2)return Qo;E2=1;var e=nO(),t=Li(),r=k2(),n=zd(),a=C2(),i=Object.prototype.toString,o=0,s=4,l=0,c=1,u=2,d=-1,f=0,p=8;function _(m){if(!(this instanceof _))return new _(m);this.options=t.assign({level:d,method:p,chunkSize:16384,windowBits:15,memLevel:8,strategy:f,to:""},m||{});var y=this.options;y.raw&&y.windowBits>0?y.windowBits=-y.windowBits:y.gzip&&y.windowBits>0&&y.windowBits<16&&(y.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new a,this.strm.avail_out=0;var g=e.deflateInit2(this.strm,y.level,y.method,y.windowBits,y.memLevel,y.strategy);if(g!==l)throw new Error(n[g]);if(y.header&&e.deflateSetHeader(this.strm,y.header),y.dictionary){var S;if(typeof y.dictionary=="string"?S=r.string2buf(y.dictionary):i.call(y.dictionary)==="[object ArrayBuffer]"?S=new Uint8Array(y.dictionary):S=y.dictionary,g=e.deflateSetDictionary(this.strm,S),g!==l)throw new Error(n[g]);this._dict_set=!0}}_.prototype.push=function(m,y){var g=this.strm,S=this.options.chunkSize,M,E;if(this.ended)return!1;E=y===~~y?y:y===!0?s:o,typeof m=="string"?g.input=r.string2buf(m):i.call(m)==="[object ArrayBuffer]"?g.input=new Uint8Array(m):g.input=m,g.next_in=0,g.avail_in=g.input.length;do{if(g.avail_out===0&&(g.output=new t.Buf8(S),g.next_out=0,g.avail_out=S),M=e.deflate(g,E),M!==c&&M!==l)return this.onEnd(M),this.ended=!0,!1;(g.avail_out===0||g.avail_in===0&&(E===s||E===u))&&(this.options.to==="string"?this.onData(r.buf2binstring(t.shrinkBuf(g.output,g.next_out))):this.onData(t.shrinkBuf(g.output,g.next_out)))}while((g.avail_in>0||g.avail_out===0)&&M!==c);return E===s?(M=e.deflateEnd(this.strm),this.onEnd(M),this.ended=!0,M===l):(E===u&&(this.onEnd(l),g.avail_out=0),!0)},_.prototype.onData=function(m){this.chunks.push(m)},_.prototype.onEnd=function(m){m===l&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=t.flattenChunks(this.chunks)),this.chunks=[],this.err=m,this.msg=this.strm.msg};function h(m,y){var g=new _(y);if(g.push(m,!0),g.err)throw g.msg||n[g.err];return g.result}function b(m,y){return y=y||{},y.raw=!0,h(m,y)}function v(m,y){return y=y||{},y.gzip=!0,h(m,y)}return Qo.Deflate=_,Qo.deflate=h,Qo.deflateRaw=b,Qo.gzip=v,Qo}var es={},qn={},Od,A2;function iO(){if(A2)return Od;A2=1;var e=30,t=12;return Od=function(n,a){var i,o,s,l,c,u,d,f,p,_,h,b,v,m,y,g,S,M,E,w,x,C,D,B,F;i=n.state,o=n.next_in,B=n.input,s=o+(n.avail_in-5),l=n.next_out,F=n.output,c=l-(a-n.avail_out),u=l+(n.avail_out-257),d=i.dmax,f=i.wsize,p=i.whave,_=i.wnext,h=i.window,b=i.hold,v=i.bits,m=i.lencode,y=i.distcode,g=(1<<i.lenbits)-1,S=(1<<i.distbits)-1;e:do{v<15&&(b+=B[o++]<<v,v+=8,b+=B[o++]<<v,v+=8),M=m[b&g];t:for(;;){if(E=M>>>24,b>>>=E,v-=E,E=M>>>16&255,E===0)F[l++]=M&65535;else if(E&16){w=M&65535,E&=15,E&&(v<E&&(b+=B[o++]<<v,v+=8),w+=b&(1<<E)-1,b>>>=E,v-=E),v<15&&(b+=B[o++]<<v,v+=8,b+=B[o++]<<v,v+=8),M=y[b&S];r:for(;;){if(E=M>>>24,b>>>=E,v-=E,E=M>>>16&255,E&16){if(x=M&65535,E&=15,v<E&&(b+=B[o++]<<v,v+=8,v<E&&(b+=B[o++]<<v,v+=8)),x+=b&(1<<E)-1,x>d){n.msg="invalid distance too far back",i.mode=e;break e}if(b>>>=E,v-=E,E=l-c,x>E){if(E=x-E,E>p&&i.sane){n.msg="invalid distance too far back",i.mode=e;break e}if(C=0,D=h,_===0){if(C+=f-E,E<w){w-=E;do F[l++]=h[C++];while(--E);C=l-x,D=F}}else if(_<E){if(C+=f+_-E,E-=_,E<w){w-=E;do F[l++]=h[C++];while(--E);if(C=0,_<w){E=_,w-=E;do F[l++]=h[C++];while(--E);C=l-x,D=F}}}else if(C+=_-E,E<w){w-=E;do F[l++]=h[C++];while(--E);C=l-x,D=F}for(;w>2;)F[l++]=D[C++],F[l++]=D[C++],F[l++]=D[C++],w-=3;w&&(F[l++]=D[C++],w>1&&(F[l++]=D[C++]))}else{C=l-x;do F[l++]=F[C++],F[l++]=F[C++],F[l++]=F[C++],w-=3;while(w>2);w&&(F[l++]=F[C++],w>1&&(F[l++]=F[C++]))}}else if(E&64){n.msg="invalid distance code",i.mode=e;break e}else{M=y[(M&65535)+(b&(1<<E)-1)];continue r}break}}else if(E&64)if(E&32){i.mode=t;break e}else{n.msg="invalid literal/length code",i.mode=e;break e}else{M=m[(M&65535)+(b&(1<<E)-1)];continue t}break}}while(o<s&&l<u);w=v>>3,o-=w,v-=w<<3,b&=(1<<v)-1,n.next_in=o,n.next_out=l,n.avail_in=o<s?5+(s-o):5-(o-s),n.avail_out=l<u?257+(u-l):257-(l-u),i.hold=b,i.bits=v},Od}var Pd,T2;function oO(){if(T2)return Pd;T2=1;var e=Li(),t=15,r=852,n=592,a=0,i=1,o=2,s=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],l=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],c=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],u=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];return Pd=function(f,p,_,h,b,v,m,y){var g=y.bits,S=0,M=0,E=0,w=0,x=0,C=0,D=0,B=0,F=0,K=0,te,J,ne,le,q,j=null,P=0,N,X=new e.Buf16(t+1),Ee=new e.Buf16(t+1),Ae=null,ze=0,Le,he,Ie;for(S=0;S<=t;S++)X[S]=0;for(M=0;M<h;M++)X[p[_+M]]++;for(x=g,w=t;w>=1&&X[w]===0;w--);if(x>w&&(x=w),w===0)return b[v++]=1<<24|64<<16|0,b[v++]=1<<24|64<<16|0,y.bits=1,0;for(E=1;E<w&&X[E]===0;E++);for(x<E&&(x=E),B=1,S=1;S<=t;S++)if(B<<=1,B-=X[S],B<0)return-1;if(B>0&&(f===a||w!==1))return-1;for(Ee[1]=0,S=1;S<t;S++)Ee[S+1]=Ee[S]+X[S];for(M=0;M<h;M++)p[_+M]!==0&&(m[Ee[p[_+M]]++]=M);if(f===a?(j=Ae=m,N=19):f===i?(j=s,P-=257,Ae=l,ze-=257,N=256):(j=c,Ae=u,N=-1),K=0,M=0,S=E,q=v,C=x,D=0,ne=-1,F=1<<x,le=F-1,f===i&&F>r||f===o&&F>n)return 1;for(;;){Le=S-D,m[M]<N?(he=0,Ie=m[M]):m[M]>N?(he=Ae[ze+m[M]],Ie=j[P+m[M]]):(he=96,Ie=0),te=1<<S-D,J=1<<C,E=J;do J-=te,b[q+(K>>D)+J]=Le<<24|he<<16|Ie|0;while(J!==0);for(te=1<<S-1;K&te;)te>>=1;if(te!==0?(K&=te-1,K+=te):K=0,M++,--X[S]===0){if(S===w)break;S=p[_+m[M]]}if(S>x&&(K&le)!==ne){for(D===0&&(D=x),q+=E,C=S-D,B=1<<C;C+D<w&&(B-=X[C+D],!(B<=0));)C++,B<<=1;if(F+=1<<C,f===i&&F>r||f===o&&F>n)return 1;ne=K&le,b[ne]=x<<24|C<<16|q-v|0}}return K!==0&&(b[q+K]=S-D<<24|64<<16|0),y.bits=x,0},Pd}var M2;function sO(){if(M2)return qn;M2=1;var e=Li(),t=g2(),r=y2(),n=iO(),a=oO(),i=0,o=1,s=2,l=4,c=5,u=6,d=0,f=1,p=2,_=-2,h=-3,b=-4,v=-5,m=8,y=1,g=2,S=3,M=4,E=5,w=6,x=7,C=8,D=9,B=10,F=11,K=12,te=13,J=14,ne=15,le=16,q=17,j=18,P=19,N=20,X=21,Ee=22,Ae=23,ze=24,Le=25,he=26,Ie=27,De=28,Be=29,Z=30,se=31,we=32,Se=852,me=592,ye=15,xe=ye;function ee(de){return(de>>>24&255)+(de>>>8&65280)+((de&65280)<<8)+((de&255)<<24)}function pe(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new e.Buf16(320),this.work=new e.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function ve(de){var Me;return!de||!de.state?_:(Me=de.state,de.total_in=de.total_out=Me.total=0,de.msg="",Me.wrap&&(de.adler=Me.wrap&1),Me.mode=y,Me.last=0,Me.havedict=0,Me.dmax=32768,Me.head=null,Me.hold=0,Me.bits=0,Me.lencode=Me.lendyn=new e.Buf32(Se),Me.distcode=Me.distdyn=new e.Buf32(me),Me.sane=1,Me.back=-1,d)}function Pe(de){var Me;return!de||!de.state?_:(Me=de.state,Me.wsize=0,Me.whave=0,Me.wnext=0,ve(de))}function Ge(de,Me){var G,je;return!de||!de.state||(je=de.state,Me<0?(G=0,Me=-Me):(G=(Me>>4)+1,Me<48&&(Me&=15)),Me&&(Me<8||Me>15))?_:(je.window!==null&&je.wbits!==Me&&(je.window=null),je.wrap=G,je.wbits=Me,Pe(de))}function Ue(de,Me){var G,je;return de?(je=new pe,de.state=je,je.window=null,G=Ge(de,Me),G!==d&&(de.state=null),G):_}function We(de){return Ue(de,xe)}var rt=!0,lt,ft;function St(de){if(rt){var Me;for(lt=new e.Buf32(512),ft=new e.Buf32(32),Me=0;Me<144;)de.lens[Me++]=8;for(;Me<256;)de.lens[Me++]=9;for(;Me<280;)de.lens[Me++]=7;for(;Me<288;)de.lens[Me++]=8;for(a(o,de.lens,0,288,lt,0,de.work,{bits:9}),Me=0;Me<32;)de.lens[Me++]=5;a(s,de.lens,0,32,ft,0,de.work,{bits:5}),rt=!1}de.lencode=lt,de.lenbits=9,de.distcode=ft,de.distbits=5}function $e(de,Me,G,je){var wt,A=de.state;return A.window===null&&(A.wsize=1<<A.wbits,A.wnext=0,A.whave=0,A.window=new e.Buf8(A.wsize)),je>=A.wsize?(e.arraySet(A.window,Me,G-A.wsize,A.wsize,0),A.wnext=0,A.whave=A.wsize):(wt=A.wsize-A.wnext,wt>je&&(wt=je),e.arraySet(A.window,Me,G-je,wt,A.wnext),je-=wt,je?(e.arraySet(A.window,Me,G-je,je,0),A.wnext=je,A.whave=A.wsize):(A.wnext+=wt,A.wnext===A.wsize&&(A.wnext=0),A.whave<A.wsize&&(A.whave+=wt))),0}function L(de,Me){var G,je,wt,A,ie,ae,U,fe,oe,tt,st,Ye,It,wr,hr=0,Bt,or,Br,gr,ha,Co,bt,Qr,Mr=new e.Buf8(4),va,cr,hu=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!de||!de.state||!de.output||!de.input&&de.avail_in!==0)return _;G=de.state,G.mode===K&&(G.mode=te),ie=de.next_out,wt=de.output,U=de.avail_out,A=de.next_in,je=de.input,ae=de.avail_in,fe=G.hold,oe=G.bits,tt=ae,st=U,Qr=d;e:for(;;)switch(G.mode){case y:if(G.wrap===0){G.mode=te;break}for(;oe<16;){if(ae===0)break e;ae--,fe+=je[A++]<<oe,oe+=8}if(G.wrap&2&&fe===35615){G.check=0,Mr[0]=fe&255,Mr[1]=fe>>>8&255,G.check=r(G.check,Mr,2,0),fe=0,oe=0,G.mode=g;break}if(G.flags=0,G.head&&(G.head.done=!1),!(G.wrap&1)||(((fe&255)<<8)+(fe>>8))%31){de.msg="incorrect header check",G.mode=Z;break}if((fe&15)!==m){de.msg="unknown compression method",G.mode=Z;break}if(fe>>>=4,oe-=4,bt=(fe&15)+8,G.wbits===0)G.wbits=bt;else if(bt>G.wbits){de.msg="invalid window size",G.mode=Z;break}G.dmax=1<<bt,de.adler=G.check=1,G.mode=fe&512?B:K,fe=0,oe=0;break;case g:for(;oe<16;){if(ae===0)break e;ae--,fe+=je[A++]<<oe,oe+=8}if(G.flags=fe,(G.flags&255)!==m){de.msg="unknown compression method",G.mode=Z;break}if(G.flags&57344){de.msg="unknown header flags set",G.mode=Z;break}G.head&&(G.head.text=fe>>8&1),G.flags&512&&(Mr[0]=fe&255,Mr[1]=fe>>>8&255,G.check=r(G.check,Mr,2,0)),fe=0,oe=0,G.mode=S;case S:for(;oe<32;){if(ae===0)break e;ae--,fe+=je[A++]<<oe,oe+=8}G.head&&(G.head.time=fe),G.flags&512&&(Mr[0]=fe&255,Mr[1]=fe>>>8&255,Mr[2]=fe>>>16&255,Mr[3]=fe>>>24&255,G.check=r(G.check,Mr,4,0)),fe=0,oe=0,G.mode=M;case M:for(;oe<16;){if(ae===0)break e;ae--,fe+=je[A++]<<oe,oe+=8}G.head&&(G.head.xflags=fe&255,G.head.os=fe>>8),G.flags&512&&(Mr[0]=fe&255,Mr[1]=fe>>>8&255,G.check=r(G.check,Mr,2,0)),fe=0,oe=0,G.mode=E;case E:if(G.flags&1024){for(;oe<16;){if(ae===0)break e;ae--,fe+=je[A++]<<oe,oe+=8}G.length=fe,G.head&&(G.head.extra_len=fe),G.flags&512&&(Mr[0]=fe&255,Mr[1]=fe>>>8&255,G.check=r(G.check,Mr,2,0)),fe=0,oe=0}else G.head&&(G.head.extra=null);G.mode=w;case w:if(G.flags&1024&&(Ye=G.length,Ye>ae&&(Ye=ae),Ye&&(G.head&&(bt=G.head.extra_len-G.length,G.head.extra||(G.head.extra=new Array(G.head.extra_len)),e.arraySet(G.head.extra,je,A,Ye,bt)),G.flags&512&&(G.check=r(G.check,je,Ye,A)),ae-=Ye,A+=Ye,G.length-=Ye),G.length))break e;G.length=0,G.mode=x;case x:if(G.flags&2048){if(ae===0)break e;Ye=0;do bt=je[A+Ye++],G.head&&bt&&G.length<65536&&(G.head.name+=String.fromCharCode(bt));while(bt&&Ye<ae);if(G.flags&512&&(G.check=r(G.check,je,Ye,A)),ae-=Ye,A+=Ye,bt)break e}else G.head&&(G.head.name=null);G.length=0,G.mode=C;case C:if(G.flags&4096){if(ae===0)break e;Ye=0;do bt=je[A+Ye++],G.head&&bt&&G.length<65536&&(G.head.comment+=String.fromCharCode(bt));while(bt&&Ye<ae);if(G.flags&512&&(G.check=r(G.check,je,Ye,A)),ae-=Ye,A+=Ye,bt)break e}else G.head&&(G.head.comment=null);G.mode=D;case D:if(G.flags&512){for(;oe<16;){if(ae===0)break e;ae--,fe+=je[A++]<<oe,oe+=8}if(fe!==(G.check&65535)){de.msg="header crc mismatch",G.mode=Z;break}fe=0,oe=0}G.head&&(G.head.hcrc=G.flags>>9&1,G.head.done=!0),de.adler=G.check=0,G.mode=K;break;case B:for(;oe<32;){if(ae===0)break e;ae--,fe+=je[A++]<<oe,oe+=8}de.adler=G.check=ee(fe),fe=0,oe=0,G.mode=F;case F:if(G.havedict===0)return de.next_out=ie,de.avail_out=U,de.next_in=A,de.avail_in=ae,G.hold=fe,G.bits=oe,p;de.adler=G.check=1,G.mode=K;case K:if(Me===c||Me===u)break e;case te:if(G.last){fe>>>=oe&7,oe-=oe&7,G.mode=Ie;break}for(;oe<3;){if(ae===0)break e;ae--,fe+=je[A++]<<oe,oe+=8}switch(G.last=fe&1,fe>>>=1,oe-=1,fe&3){case 0:G.mode=J;break;case 1:if(St(G),G.mode=N,Me===u){fe>>>=2,oe-=2;break e}break;case 2:G.mode=q;break;case 3:de.msg="invalid block type",G.mode=Z}fe>>>=2,oe-=2;break;case J:for(fe>>>=oe&7,oe-=oe&7;oe<32;){if(ae===0)break e;ae--,fe+=je[A++]<<oe,oe+=8}if((fe&65535)!==(fe>>>16^65535)){de.msg="invalid stored block lengths",G.mode=Z;break}if(G.length=fe&65535,fe=0,oe=0,G.mode=ne,Me===u)break e;case ne:G.mode=le;case le:if(Ye=G.length,Ye){if(Ye>ae&&(Ye=ae),Ye>U&&(Ye=U),Ye===0)break e;e.arraySet(wt,je,A,Ye,ie),ae-=Ye,A+=Ye,U-=Ye,ie+=Ye,G.length-=Ye;break}G.mode=K;break;case q:for(;oe<14;){if(ae===0)break e;ae--,fe+=je[A++]<<oe,oe+=8}if(G.nlen=(fe&31)+257,fe>>>=5,oe-=5,G.ndist=(fe&31)+1,fe>>>=5,oe-=5,G.ncode=(fe&15)+4,fe>>>=4,oe-=4,G.nlen>286||G.ndist>30){de.msg="too many length or distance symbols",G.mode=Z;break}G.have=0,G.mode=j;case j:for(;G.have<G.ncode;){for(;oe<3;){if(ae===0)break e;ae--,fe+=je[A++]<<oe,oe+=8}G.lens[hu[G.have++]]=fe&7,fe>>>=3,oe-=3}for(;G.have<19;)G.lens[hu[G.have++]]=0;if(G.lencode=G.lendyn,G.lenbits=7,va={bits:G.lenbits},Qr=a(i,G.lens,0,19,G.lencode,0,G.work,va),G.lenbits=va.bits,Qr){de.msg="invalid code lengths set",G.mode=Z;break}G.have=0,G.mode=P;case P:for(;G.have<G.nlen+G.ndist;){for(;hr=G.lencode[fe&(1<<G.lenbits)-1],Bt=hr>>>24,or=hr>>>16&255,Br=hr&65535,!(Bt<=oe);){if(ae===0)break e;ae--,fe+=je[A++]<<oe,oe+=8}if(Br<16)fe>>>=Bt,oe-=Bt,G.lens[G.have++]=Br;else{if(Br===16){for(cr=Bt+2;oe<cr;){if(ae===0)break e;ae--,fe+=je[A++]<<oe,oe+=8}if(fe>>>=Bt,oe-=Bt,G.have===0){de.msg="invalid bit length repeat",G.mode=Z;break}bt=G.lens[G.have-1],Ye=3+(fe&3),fe>>>=2,oe-=2}else if(Br===17){for(cr=Bt+3;oe<cr;){if(ae===0)break e;ae--,fe+=je[A++]<<oe,oe+=8}fe>>>=Bt,oe-=Bt,bt=0,Ye=3+(fe&7),fe>>>=3,oe-=3}else{for(cr=Bt+7;oe<cr;){if(ae===0)break e;ae--,fe+=je[A++]<<oe,oe+=8}fe>>>=Bt,oe-=Bt,bt=0,Ye=11+(fe&127),fe>>>=7,oe-=7}if(G.have+Ye>G.nlen+G.ndist){de.msg="invalid bit length repeat",G.mode=Z;break}for(;Ye--;)G.lens[G.have++]=bt}}if(G.mode===Z)break;if(G.lens[256]===0){de.msg="invalid code -- missing end-of-block",G.mode=Z;break}if(G.lenbits=9,va={bits:G.lenbits},Qr=a(o,G.lens,0,G.nlen,G.lencode,0,G.work,va),G.lenbits=va.bits,Qr){de.msg="invalid literal/lengths set",G.mode=Z;break}if(G.distbits=6,G.distcode=G.distdyn,va={bits:G.distbits},Qr=a(s,G.lens,G.nlen,G.ndist,G.distcode,0,G.work,va),G.distbits=va.bits,Qr){de.msg="invalid distances set",G.mode=Z;break}if(G.mode=N,Me===u)break e;case N:G.mode=X;case X:if(ae>=6&&U>=258){de.next_out=ie,de.avail_out=U,de.next_in=A,de.avail_in=ae,G.hold=fe,G.bits=oe,n(de,st),ie=de.next_out,wt=de.output,U=de.avail_out,A=de.next_in,je=de.input,ae=de.avail_in,fe=G.hold,oe=G.bits,G.mode===K&&(G.back=-1);break}for(G.back=0;hr=G.lencode[fe&(1<<G.lenbits)-1],Bt=hr>>>24,or=hr>>>16&255,Br=hr&65535,!(Bt<=oe);){if(ae===0)break e;ae--,fe+=je[A++]<<oe,oe+=8}if(or&&!(or&240)){for(gr=Bt,ha=or,Co=Br;hr=G.lencode[Co+((fe&(1<<gr+ha)-1)>>gr)],Bt=hr>>>24,or=hr>>>16&255,Br=hr&65535,!(gr+Bt<=oe);){if(ae===0)break e;ae--,fe+=je[A++]<<oe,oe+=8}fe>>>=gr,oe-=gr,G.back+=gr}if(fe>>>=Bt,oe-=Bt,G.back+=Bt,G.length=Br,or===0){G.mode=he;break}if(or&32){G.back=-1,G.mode=K;break}if(or&64){de.msg="invalid literal/length code",G.mode=Z;break}G.extra=or&15,G.mode=Ee;case Ee:if(G.extra){for(cr=G.extra;oe<cr;){if(ae===0)break e;ae--,fe+=je[A++]<<oe,oe+=8}G.length+=fe&(1<<G.extra)-1,fe>>>=G.extra,oe-=G.extra,G.back+=G.extra}G.was=G.length,G.mode=Ae;case Ae:for(;hr=G.distcode[fe&(1<<G.distbits)-1],Bt=hr>>>24,or=hr>>>16&255,Br=hr&65535,!(Bt<=oe);){if(ae===0)break e;ae--,fe+=je[A++]<<oe,oe+=8}if(!(or&240)){for(gr=Bt,ha=or,Co=Br;hr=G.distcode[Co+((fe&(1<<gr+ha)-1)>>gr)],Bt=hr>>>24,or=hr>>>16&255,Br=hr&65535,!(gr+Bt<=oe);){if(ae===0)break e;ae--,fe+=je[A++]<<oe,oe+=8}fe>>>=gr,oe-=gr,G.back+=gr}if(fe>>>=Bt,oe-=Bt,G.back+=Bt,or&64){de.msg="invalid distance code",G.mode=Z;break}G.offset=Br,G.extra=or&15,G.mode=ze;case ze:if(G.extra){for(cr=G.extra;oe<cr;){if(ae===0)break e;ae--,fe+=je[A++]<<oe,oe+=8}G.offset+=fe&(1<<G.extra)-1,fe>>>=G.extra,oe-=G.extra,G.back+=G.extra}if(G.offset>G.dmax){de.msg="invalid distance too far back",G.mode=Z;break}G.mode=Le;case Le:if(U===0)break e;if(Ye=st-U,G.offset>Ye){if(Ye=G.offset-Ye,Ye>G.whave&&G.sane){de.msg="invalid distance too far back",G.mode=Z;break}Ye>G.wnext?(Ye-=G.wnext,It=G.wsize-Ye):It=G.wnext-Ye,Ye>G.length&&(Ye=G.length),wr=G.window}else wr=wt,It=ie-G.offset,Ye=G.length;Ye>U&&(Ye=U),U-=Ye,G.length-=Ye;do wt[ie++]=wr[It++];while(--Ye);G.length===0&&(G.mode=X);break;case he:if(U===0)break e;wt[ie++]=G.length,U--,G.mode=X;break;case Ie:if(G.wrap){for(;oe<32;){if(ae===0)break e;ae--,fe|=je[A++]<<oe,oe+=8}if(st-=U,de.total_out+=st,G.total+=st,st&&(de.adler=G.check=G.flags?r(G.check,wt,st,ie-st):t(G.check,wt,st,ie-st)),st=U,(G.flags?fe:ee(fe))!==G.check){de.msg="incorrect data check",G.mode=Z;break}fe=0,oe=0}G.mode=De;case De:if(G.wrap&&G.flags){for(;oe<32;){if(ae===0)break e;ae--,fe+=je[A++]<<oe,oe+=8}if(fe!==(G.total&4294967295)){de.msg="incorrect length check",G.mode=Z;break}fe=0,oe=0}G.mode=Be;case Be:Qr=f;break e;case Z:Qr=h;break e;case se:return b;case we:default:return _}return de.next_out=ie,de.avail_out=U,de.next_in=A,de.avail_in=ae,G.hold=fe,G.bits=oe,(G.wsize||st!==de.avail_out&&G.mode<Z&&(G.mode<Ie||Me!==l))&&$e(de,de.output,de.next_out,st-de.avail_out),tt-=de.avail_in,st-=de.avail_out,de.total_in+=tt,de.total_out+=st,G.total+=st,G.wrap&&st&&(de.adler=G.check=G.flags?r(G.check,wt,st,de.next_out-st):t(G.check,wt,st,de.next_out-st)),de.data_type=G.bits+(G.last?64:0)+(G.mode===K?128:0)+(G.mode===N||G.mode===ne?256:0),(tt===0&&st===0||Me===l)&&Qr===d&&(Qr=v),Qr}function ge(de){if(!de||!de.state)return _;var Me=de.state;return Me.window&&(Me.window=null),de.state=null,d}function Oe(de,Me){var G;return!de||!de.state||(G=de.state,!(G.wrap&2))?_:(G.head=Me,Me.done=!1,d)}function He(de,Me){var G=Me.length,je,wt,A;return!de||!de.state||(je=de.state,je.wrap!==0&&je.mode!==F)?_:je.mode===F&&(wt=1,wt=t(wt,Me,G,0),wt!==je.check)?h:(A=$e(de,Me,G,G),A?(je.mode=se,b):(je.havedict=1,d))}return qn.inflateReset=Pe,qn.inflateReset2=Ge,qn.inflateResetKeep=ve,qn.inflateInit=We,qn.inflateInit2=Ue,qn.inflate=L,qn.inflateEnd=ge,qn.inflateGetHeader=Oe,qn.inflateSetDictionary=He,qn.inflateInfo="pako inflate (from Nodeca project)",qn}var Fd,D2;function z2(){return D2||(D2=1,Fd={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}),Fd}var Rd,I2;function lO(){if(I2)return Rd;I2=1;function e(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}return Rd=e,Rd}var O2;function cO(){if(O2)return es;O2=1;var e=sO(),t=Li(),r=k2(),n=z2(),a=zd(),i=C2(),o=lO(),s=Object.prototype.toString;function l(d){if(!(this instanceof l))return new l(d);this.options=t.assign({chunkSize:16384,windowBits:0,to:""},d||{});var f=this.options;f.raw&&f.windowBits>=0&&f.windowBits<16&&(f.windowBits=-f.windowBits,f.windowBits===0&&(f.windowBits=-15)),f.windowBits>=0&&f.windowBits<16&&!(d&&d.windowBits)&&(f.windowBits+=32),f.windowBits>15&&f.windowBits<48&&(f.windowBits&15||(f.windowBits|=15)),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new i,this.strm.avail_out=0;var p=e.inflateInit2(this.strm,f.windowBits);if(p!==n.Z_OK)throw new Error(a[p]);if(this.header=new o,e.inflateGetHeader(this.strm,this.header),f.dictionary&&(typeof f.dictionary=="string"?f.dictionary=r.string2buf(f.dictionary):s.call(f.dictionary)==="[object ArrayBuffer]"&&(f.dictionary=new Uint8Array(f.dictionary)),f.raw&&(p=e.inflateSetDictionary(this.strm,f.dictionary),p!==n.Z_OK)))throw new Error(a[p])}l.prototype.push=function(d,f){var p=this.strm,_=this.options.chunkSize,h=this.options.dictionary,b,v,m,y,g,S=!1;if(this.ended)return!1;v=f===~~f?f:f===!0?n.Z_FINISH:n.Z_NO_FLUSH,typeof d=="string"?p.input=r.binstring2buf(d):s.call(d)==="[object ArrayBuffer]"?p.input=new Uint8Array(d):p.input=d,p.next_in=0,p.avail_in=p.input.length;do{if(p.avail_out===0&&(p.output=new t.Buf8(_),p.next_out=0,p.avail_out=_),b=e.inflate(p,n.Z_NO_FLUSH),b===n.Z_NEED_DICT&&h&&(b=e.inflateSetDictionary(this.strm,h)),b===n.Z_BUF_ERROR&&S===!0&&(b=n.Z_OK,S=!1),b!==n.Z_STREAM_END&&b!==n.Z_OK)return this.onEnd(b),this.ended=!0,!1;p.next_out&&(p.avail_out===0||b===n.Z_STREAM_END||p.avail_in===0&&(v===n.Z_FINISH||v===n.Z_SYNC_FLUSH))&&(this.options.to==="string"?(m=r.utf8border(p.output,p.next_out),y=p.next_out-m,g=r.buf2string(p.output,m),p.next_out=y,p.avail_out=_-y,y&&t.arraySet(p.output,p.output,m,y,0),this.onData(g)):this.onData(t.shrinkBuf(p.output,p.next_out))),p.avail_in===0&&p.avail_out===0&&(S=!0)}while((p.avail_in>0||p.avail_out===0)&&b!==n.Z_STREAM_END);return b===n.Z_STREAM_END&&(v=n.Z_FINISH),v===n.Z_FINISH?(b=e.inflateEnd(this.strm),this.onEnd(b),this.ended=!0,b===n.Z_OK):(v===n.Z_SYNC_FLUSH&&(this.onEnd(n.Z_OK),p.avail_out=0),!0)},l.prototype.onData=function(d){this.chunks.push(d)},l.prototype.onEnd=function(d){d===n.Z_OK&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=t.flattenChunks(this.chunks)),this.chunks=[],this.err=d,this.msg=this.strm.msg};function c(d,f){var p=new l(f);if(p.push(d,!0),p.err)throw p.msg||a[p.err];return p.result}function u(d,f){return f=f||{},f.raw=!0,c(d,f)}return es.Inflate=l,es.inflate=c,es.inflateRaw=u,es.ungzip=c,es}var Ld,P2;function uO(){if(P2)return Ld;P2=1;var e=Li().assign,t=aO(),r=cO(),n=z2(),a={};return e(a,t,r,n),Ld=a,Ld}(function(e){(function(){var t={};e.exports=t;var r;typeof tO=="function"?r=uO():r=self.pako;function n(){typeof process>"u"&&console.log.apply(console,arguments)}(function(a,i){(function(){var o=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(c){return typeof c}:function(c){return c&&typeof Symbol=="function"&&c.constructor===Symbol&&c!==Symbol.prototype?"symbol":typeof c},s=function(){function c(u){this.message="JPEG error: "+u}return c.prototype=Error(),c.prototype.name="JpegError",c.constructor=c}(),l=function(){function c(u,d){this.message=u,this.g=d}return c.prototype=Error(),c.prototype.name="DNLMarkerError",c.constructor=c}();(function(){function c(){this.M=null,this.B=-1}function u(h,b){for(var v=0,m=[],y,g,S=16;0<S&&!h[S-1];)S--;m.push({children:[],index:0});var M=m[0],E;for(y=0;y<S;y++){for(g=0;g<h[y];g++){for(M=m.pop(),M.children[M.index]=b[v];0<M.index;)M=m.pop();for(M.index++,m.push(M);m.length<=y;)m.push(E={children:[],index:0}),M.children[M.index]=E.children,M=E;v++}y+1<S&&(m.push(E={children:[],index:0}),M.children[M.index]=E.children,M=E)}return m[0].children}function d(h,b,v,m,y,g,S,M,E){function w(){if(0<P)return P--,j>>P&1;if(j=h[b++],j===255){var ye=h[b++];if(ye){if(ye===220&&ne){b+=2;var xe=h[b++]<<8|h[b++];if(0<xe&&xe!==v.g)throw new l("Found DNL marker (0xFFDC) while parsing scan data",xe)}throw new s("unexpected marker "+(j<<8|ye).toString(16))}}return P=7,j>>>7}function x(ye){for(;;){if(ye=ye[w()],typeof ye=="number")return ye;if((typeof ye>"u"?"undefined":o(ye))!=="object")throw new s("invalid huffman sequence")}}function C(ye){for(var xe=0;0<ye;)xe=xe<<1|w(),ye--;return xe}function D(ye){if(ye===1)return w()===1?1:-1;var xe=C(ye);return xe>=1<<ye-1?xe:xe+(-1<<ye)+1}function B(ye,xe){var ee=x(ye.D);for(ee=ee===0?0:D(ee),ye.a[xe]=ye.m+=ee,ee=1;64>ee;){var pe=x(ye.o),ve=pe&15;if(pe>>=4,ve===0){if(15>pe)break;ee+=16}else ee+=pe,ye.a[xe+_[ee]]=D(ve),ee++}}function F(ye,xe){var ee=x(ye.D);ee=ee===0?0:D(ee)<<E,ye.a[xe]=ye.m+=ee}function K(ye,xe){ye.a[xe]|=w()<<E}function te(ye,xe){if(0<N)N--;else for(var ee=g;ee<=S;){var pe=x(ye.o),ve=pe&15;if(pe>>=4,ve===0){if(15>pe){N=C(pe)+(1<<pe)-1;break}ee+=16}else ee+=pe,ye.a[xe+_[ee]]=D(ve)*(1<<E),ee++}}function J(ye,xe){for(var ee=g,pe=0,ve;ee<=S;){ve=xe+_[ee];var Pe=0>ye.a[ve]?-1:1;switch(X){case 0:if(pe=x(ye.o),ve=pe&15,pe>>=4,ve===0)15>pe?(N=C(pe)+(1<<pe),X=4):(pe=16,X=1);else{if(ve!==1)throw new s("invalid ACn encoding");Ee=D(ve),X=pe?2:3}continue;case 1:case 2:ye.a[ve]?ye.a[ve]+=Pe*(w()<<E):(pe--,pe===0&&(X=X===2?3:0));break;case 3:ye.a[ve]?ye.a[ve]+=Pe*(w()<<E):(ye.a[ve]=Ee<<E,X=0);break;case 4:ye.a[ve]&&(ye.a[ve]+=Pe*(w()<<E))}ee++}X===4&&(N--,N===0&&(X=0))}for(var ne=9<arguments.length&&arguments[9]!==void 0?arguments[9]:!1,le=v.P,q=b,j=0,P=0,N=0,X=0,Ee,Ae=m.length,ze,Le,he,Ie,De=v.S?g===0?M===0?F:K:M===0?te:J:B,Be=0,Z=Ae===1?m[0].c*m[0].l:le*v.O,se,we;Be<Z;){var Se=y?Math.min(Z-Be,y):Z;for(ze=0;ze<Ae;ze++)m[ze].m=0;if(N=0,Ae===1){var me=m[0];for(Ie=0;Ie<Se;Ie++)De(me,64*((me.c+1)*(Be/me.c|0)+Be%me.c)),Be++}else for(Ie=0;Ie<Se;Ie++){for(ze=0;ze<Ae;ze++)for(me=m[ze],se=me.h,we=me.j,Le=0;Le<we;Le++)for(he=0;he<se;he++)De(me,64*((me.c+1)*((Be/le|0)*me.j+Le)+(Be%le*me.h+he)));Be++}if(P=0,(me=p(h,b))&&me.f&&((0,_util.warn)("decodeScan - unexpected MCU data, current marker is: "+me.f),b=me.offset),me=me&&me.F,!me||65280>=me)throw new s("marker was not found");if(65488<=me&&65495>=me)b+=2;else break}return(me=p(h,b))&&me.f&&((0,_util.warn)("decodeScan - unexpected Scan data, current marker is: "+me.f),b=me.offset),b-q}function f(h,b){for(var v=b.c,m=b.l,y=new Int16Array(64),g=0;g<m;g++)for(var S=0;S<v;S++){var M=64*((b.c+1)*g+S),E=y,w=b.G,x=b.a;if(!w)throw new s("missing required Quantization Table.");for(var C=0;64>C;C+=8){var D=x[M+C],B=x[M+C+1],F=x[M+C+2],K=x[M+C+3],te=x[M+C+4],J=x[M+C+5],ne=x[M+C+6],le=x[M+C+7];if(D*=w[C],!(B|F|K|te|J|ne|le))D=5793*D+512>>10,E[C]=D,E[C+1]=D,E[C+2]=D,E[C+3]=D,E[C+4]=D,E[C+5]=D,E[C+6]=D,E[C+7]=D;else{B*=w[C+1],F*=w[C+2],K*=w[C+3],te*=w[C+4],J*=w[C+5],ne*=w[C+6],le*=w[C+7];var q=5793*D+128>>8,j=5793*te+128>>8,P=F,N=ne;te=2896*(B-le)+128>>8,le=2896*(B+le)+128>>8,K<<=4,J<<=4,q=q+j+1>>1,j=q-j,D=3784*P+1567*N+128>>8,P=1567*P-3784*N+128>>8,N=D,te=te+J+1>>1,J=te-J,le=le+K+1>>1,K=le-K,q=q+N+1>>1,N=q-N,j=j+P+1>>1,P=j-P,D=2276*te+3406*le+2048>>12,te=3406*te-2276*le+2048>>12,le=D,D=799*K+4017*J+2048>>12,K=4017*K-799*J+2048>>12,J=D,E[C]=q+le,E[C+7]=q-le,E[C+1]=j+J,E[C+6]=j-J,E[C+2]=P+K,E[C+5]=P-K,E[C+3]=N+te,E[C+4]=N-te}}for(w=0;8>w;++w)D=E[w],B=E[w+8],F=E[w+16],K=E[w+24],te=E[w+32],J=E[w+40],ne=E[w+48],le=E[w+56],B|F|K|te|J|ne|le?(q=5793*D+2048>>12,j=5793*te+2048>>12,P=F,N=ne,te=2896*(B-le)+2048>>12,le=2896*(B+le)+2048>>12,q=(q+j+1>>1)+4112,j=q-j,D=3784*P+1567*N+2048>>12,P=1567*P-3784*N+2048>>12,N=D,te=te+J+1>>1,J=te-J,le=le+K+1>>1,K=le-K,q=q+N+1>>1,N=q-N,j=j+P+1>>1,P=j-P,D=2276*te+3406*le+2048>>12,te=3406*te-2276*le+2048>>12,le=D,D=799*K+4017*J+2048>>12,K=4017*K-799*J+2048>>12,J=D,D=q+le,le=q-le,B=j+J,ne=j-J,F=P+K,J=P-K,K=N+te,te=N-te,D=16>D?0:4080<=D?255:D>>4,B=16>B?0:4080<=B?255:B>>4,F=16>F?0:4080<=F?255:F>>4,K=16>K?0:4080<=K?255:K>>4,te=16>te?0:4080<=te?255:te>>4,J=16>J?0:4080<=J?255:J>>4,ne=16>ne?0:4080<=ne?255:ne>>4,le=16>le?0:4080<=le?255:le>>4,x[M+w]=D,x[M+w+8]=B,x[M+w+16]=F,x[M+w+24]=K,x[M+w+32]=te,x[M+w+40]=J,x[M+w+48]=ne,x[M+w+56]=le):(D=5793*D+8192>>14,D=-2040>D?0:2024<=D?255:D+2056>>4,x[M+w]=D,x[M+w+8]=D,x[M+w+16]=D,x[M+w+24]=D,x[M+w+32]=D,x[M+w+40]=D,x[M+w+48]=D,x[M+w+56]=D)}return b.a}function p(h,b){var v=2<arguments.length&&arguments[2]!==void 0?arguments[2]:b,m=h.length-1;if(v=v<b?v:b,b>=m)return null;var y=h[b]<<8|h[b+1];if(65472<=y&&65534>=y)return{f:null,F:y,offset:b};for(var g=h[v]<<8|h[v+1];!(65472<=g&&65534>=g);){if(++v>=m)return null;g=h[v]<<8|h[v+1]}return{f:y.toString(16),F:g,offset:v}}var _=new Uint8Array([0,1,8,16,9,2,3,10,17,24,32,25,18,11,4,5,12,19,26,33,40,48,41,34,27,20,13,6,7,14,21,28,35,42,49,56,57,50,43,36,29,22,15,23,30,37,44,51,58,59,52,45,38,31,39,46,53,60,61,54,47,55,62,63]);c.prototype={parse:function(h){function b(){var P=h[S]<<8|h[S+1];return S+=2,P}function v(){var P=b();P=S+P-2;var N=p(h,P,S);return N&&N.f&&((0,_util.warn)("readDataBlock - incorrect length, current marker is: "+N.f),P=N.offset),P=h.subarray(S,P),S+=P.length,P}function m(P){for(var N=Math.ceil(P.v/8/P.s),X=Math.ceil(P.g/8/P.u),Ee=0;Ee<P.b.length;Ee++){q=P.b[Ee];var Ae=Math.ceil(Math.ceil(P.v/8)*q.h/P.s),ze=Math.ceil(Math.ceil(P.g/8)*q.j/P.u);q.a=new Int16Array(64*X*q.j*(N*q.h+1)),q.c=Ae,q.l=ze}P.P=N,P.O=X}var y=(1<arguments.length&&arguments[1]!==void 0?arguments[1]:{}).N,g=y===void 0?null:y,S=0,M=null,E=0;y=[];var w=[],x=[],C=b();if(C!==65496)throw new s("SOI not found");for(C=b();C!==65497;){switch(C){case 65504:case 65505:case 65506:case 65507:case 65508:case 65509:case 65510:case 65511:case 65512:case 65513:case 65514:case 65515:case 65516:case 65517:case 65518:case 65519:case 65534:var D=v();C===65518&&D[0]===65&&D[1]===100&&D[2]===111&&D[3]===98&&D[4]===101&&(M={version:D[5]<<8|D[6],Y:D[7]<<8|D[8],Z:D[9]<<8|D[10],W:D[11]});break;case 65499:C=b()+S-2;for(var B;S<C;){var F=h[S++],K=new Uint16Array(64);if(F>>4)if(F>>4===1)for(D=0;64>D;D++)B=_[D],K[B]=b();else throw new s("DQT - invalid table spec");else for(D=0;64>D;D++)B=_[D],K[B]=h[S++];y[F&15]=K}break;case 65472:case 65473:case 65474:if(te)throw new s("Only single frame JPEGs supported");b();var te={};for(te.X=C===65473,te.S=C===65474,te.precision=h[S++],C=b(),te.g=g||C,te.v=b(),te.b=[],te.C={},D=h[S++],C=K=F=0;C<D;C++){B=h[S];var J=h[S+1]>>4,ne=h[S+1]&15;F<J&&(F=J),K<ne&&(K=ne),J=te.b.push({h:J,j:ne,T:h[S+2],G:null}),te.C[B]=J-1,S+=3}te.s=F,te.u=K,m(te);break;case 65476:for(B=b(),C=2;C<B;){for(F=h[S++],K=new Uint8Array(16),D=J=0;16>D;D++,S++)J+=K[D]=h[S];for(ne=new Uint8Array(J),D=0;D<J;D++,S++)ne[D]=h[S];C+=17+J,(F>>4?w:x)[F&15]=u(K,ne)}break;case 65501:b();var le=b();break;case 65498:for(D=++E===1&&!g,b(),F=h[S++],B=[],C=0;C<F;C++){K=te.C[h[S++]];var q=te.b[K];K=h[S++],q.D=x[K>>4],q.o=w[K&15],B.push(q)}C=h[S++],F=h[S++],K=h[S++];try{var j=d(h,S,te,B,le,C,F,K>>4,K&15,D);S+=j}catch(P){if(P instanceof l)return(0,_util.warn)('Attempting to re-parse JPEG image using "scanLines" parameter found in DNL marker (0xFFDC) segment.'),this.parse(h,{N:P.g});throw P}break;case 65500:S+=4;break;case 65535:h[S]!==255&&S--;break;default:if(h[S-3]===255&&192<=h[S-2]&&254>=h[S-2])S-=3;else if((D=p(h,S-2))&&D.f)(0,_util.warn)("JpegImage.parse - unexpected data, current marker is: "+D.f),S=D.offset;else throw new s("unknown marker "+C.toString(16))}C=b()}for(this.width=te.v,this.height=te.g,this.A=M,this.b=[],C=0;C<te.b.length;C++)q=te.b[C],(le=y[q.T])&&(q.G=le),this.b.push({R:f(te,q),U:q.h/te.s,V:q.j/te.u,c:q.c,l:q.l});this.i=this.b.length},L:function(h,b){var v=this.width/h,m=this.height/b,y,g,S=this.b.length,M=h*b*S,E=new Uint8ClampedArray(M),w=new Uint32Array(h);for(g=0;g<S;g++){var x=this.b[g],C=x.U*v,D=x.V*m,B=g,F=x.R,K=x.c+1<<3;for(y=0;y<h;y++)x=0|y*C,w[y]=(x&4294967288)<<3|x&7;for(C=0;C<b;C++)for(x=0|C*D,x=K*(x&4294967288)|(x&7)<<3,y=0;y<h;y++)E[B]=F[x+w[y]],B+=S}if(m=this.M)for(g=0;g<M;)for(v=x=0;x<S;x++,g++,v+=2)E[g]=(E[g]*m[v]>>8)+m[v+1];return E},w:function(){return this.A?!!this.A.W:this.i===3?this.B!==0:this.B===1},I:function(h){for(var b,v,m,y=0,g=h.length;y<g;y+=3)b=h[y],v=h[y+1],m=h[y+2],h[y]=b-179.456+1.402*m,h[y+1]=b+135.459-.344*v-.714*m,h[y+2]=b-226.816+1.772*v;return h},K:function(h){for(var b,v,m,y,g=0,S=0,M=h.length;S<M;S+=4)b=h[S],v=h[S+1],m=h[S+2],y=h[S+3],h[g++]=-122.67195406894+v*(-660635669420364e-19*v+.000437130475926232*m-54080610064599e-18*b+.00048449797120281*y-.154362151871126)+m*(-.000957964378445773*m+.000817076911346625*b-.00477271405408747*y+1.53380253221734)+b*(.000961250184130688*b-.00266257332283933*y+.48357088451265)+y*(-.000336197177618394*y+.484791561490776),h[g++]=107.268039397724+v*(219927104525741e-19*v-.000640992018297945*m+.000659397001245577*b+.000426105652938837*y-.176491792462875)+m*(-.000778269941513683*m+.00130872261408275*b+.000770482631801132*y-.151051492775562)+b*(.00126935368114843*b-.00265090189010898*y+.25802910206845)+y*(-.000318913117588328*y-.213742400323665),h[g++]=-20.810012546947+v*(-.000570115196973677*v-263409051004589e-19*m+.0020741088115012*b-.00288260236853442*y+.814272968359295)+m*(-153496057440975e-19*m-.000132689043961446*b+.000560833691242812*y-.195152027534049)+b*(.00174418132927582*b-.00255243321439347*y+.116935020465145)+y*(-.000343531996510555*y+.24165260232407);return h.subarray(0,g)},J:function(h){for(var b,v,m,y=0,g=h.length;y<g;y+=4)b=h[y],v=h[y+1],m=h[y+2],h[y]=434.456-b-1.402*m,h[y+1]=119.541-b+.344*v+.714*m,h[y+2]=481.816-b-1.772*v;return h},H:function(h){for(var b,v,m,y,g=0,S=1/255,M=0,E=h.length;M<E;M+=4)b=h[M]*S,v=h[M+1]*S,m=h[M+2]*S,y=h[M+3]*S,h[g++]=255+b*(-4.387332384609988*b+54.48615194189176*v+18.82290502165302*m+212.25662451639585*y-285.2331026137004)+v*(1.7149763477362134*v-5.6096736904047315*m-17.873870861415444*y-5.497006427196366)+m*(-2.5217340131683033*m-21.248923337353073*y+17.5119270841813)-y*(21.86122147463605*y+189.48180835922747),h[g++]=255+b*(8.841041422036149*b+60.118027045597366*v+6.871425592049007*m+31.159100130055922*y-79.2970844816548)+v*(-15.310361306967817*v+17.575251261109482*m+131.35250912493976*y-190.9453302588951)+m*(4.444339102852739*m+9.8632861493405*y-24.86741582555878)-y*(20.737325471181034*y+187.80453709719578),h[g++]=255+b*(.8842522430003296*b+8.078677503112928*v+30.89978309703729*m-.23883238689178934*y-14.183576799673286)+v*(10.49593273432072*v+63.02378494754052*m+50.606957656360734*y-112.23884253719248)+m*(.03296041114873217*m+115.60384449646641*y-193.58209356861505)-y*(22.33816807309886*y+180.12613974708367);return h.subarray(0,g)},getData:function(h,b,v){if(4<this.i)throw new s("Unsupported color mode");if(h=this.L(h,b),this.i===1&&v){v=h.length,b=new Uint8ClampedArray(3*v);for(var m=0,y=0;y<v;y++){var g=h[y];b[m++]=g,b[m++]=g,b[m++]=g}return b}if(this.i===3&&this.w())return this.I(h);if(this.i===4){if(this.w())return v?this.K(h):this.J(h);if(v)return this.H(h)}return h}},a.JpegDecoder=c})()})(),a.encodeImage=function(o,s,l,c){var u={t256:[s],t257:[l],t258:[8,8,8,8],t259:[1],t262:[2],t273:[1e3],t277:[4],t278:[l],t279:[s*l*4],t282:[1],t283:[1],t284:[1],t286:[0],t287:[0],t296:[1],t305:["Photopea (UTIF.js)"],t338:[1]};if(c)for(var d in c)u[d]=c[d];for(var f=new Uint8Array(a.encode([u])),p=new Uint8Array(o),_=new Uint8Array(1e3+s*l*4),d=0;d<f.length;d++)_[d]=f[d];for(var d=0;d<p.length;d++)_[1e3+d]=p[d];return _.buffer},a.encode=function(o){var s=new Uint8Array(2e4),l=4,c=a._binBE;s[0]=77,s[1]=77,s[3]=42;var u=8;c.writeUint(s,l,u),l+=4;for(var d=0;d<o.length;d++){var f=a._writeIFD(c,s,u,o[d]);u=f[1],d<o.length-1&&c.writeUint(s,f[0],u)}return s.slice(0,u).buffer},a.decode=function(o){a.decode._decodeG3.allow2D=null;var s=new Uint8Array(o),l=0,c=a._binBE.readASCII(s,l,2);l+=2;var u=c=="II"?a._binLE:a._binBE;u.readUshort(s,l),l+=2;var d=u.readUint(s,l);l+=4;for(var f=[];;){var p=a._readIFD(u,s,d,f,0,!1);if(d=u.readUint(s,p),d==0)break}return f},a.decodeImage=function(o,s,l){var c=new Uint8Array(o),u=a._binBE.readASCII(c,0,2);if(s.t256!=null){s.isLE=u=="II",s.width=s.t256[0],s.height=s.t257[0];var d=s.t259?s.t259[0]:1,f=s.t266?s.t266[0]:1;s.t284&&s.t284[0]==2&&n("PlanarConfiguration 2 should not be used!");var p;s.t258?p=Math.min(32,s.t258[0])*s.t258.length:p=s.t277?s.t277[0]:1,d==1&&s.t279!=null&&s.t278&&s.t262[0]==32803&&(p=Math.round(s.t279[0]*8/(s.width*s.t278[0])));var _=Math.ceil(s.width*p/8)*8,h=s.t273;h==null&&(h=s.t324);var b=s.t279;d==1&&h.length==1&&(b=[s.height*(_>>>3)]),b==null&&(b=s.t325);var v=new Uint8Array(s.height*(_>>>3)),m=0;if(s.t322!=null){for(var y=s.t322[0],g=s.t323[0],S=Math.floor((s.width+y-1)/y),M=Math.floor((s.height+g-1)/g),E=new Uint8Array(Math.ceil(y*g*p/8)|0),w=0;w<M;w++)for(var x=0;x<S;x++){for(var C=w*S+x,D=0;D<E.length;D++)E[D]=0;a.decode._decompress(s,l,c,h[C],b[C],d,E,0,f),d==6?v=E:a._copyTile(E,Math.ceil(y*p/8)|0,g,v,Math.ceil(s.width*p/8)|0,s.height,Math.ceil(x*y*p/8)|0,w*g)}m=v.length*8}else{var B=s.t278?s.t278[0]:s.height;B=Math.min(B,s.height);for(var C=0;C<h.length;C++)a.decode._decompress(s,l,c,h[C],b[C],d,v,Math.ceil(m/8)|0,f),m+=_*B;m=Math.min(m,v.length*8)}s.data=new Uint8Array(v.buffer,0,Math.ceil(m/8)|0)}},a.decode._decompress=function(o,s,l,c,u,d,f,p,_){if(d==1||u==f.length&&d!=32767)for(var h=0;h<u;h++)f[p+h]=l[c+h];else if(d==3)a.decode._decodeG3(l,c,u,f,p,o.width,_);else if(d==4)a.decode._decodeG4(l,c,u,f,p,o.width,_);else if(d==5)a.decode._decodeLZW(l,c,f,p);else if(d==6)a.decode._decodeOldJPEG(o,l,c,u,f,p);else if(d==7)a.decode._decodeNewJPEG(o,l,c,u,f,p);else if(d==8)for(var b=new Uint8Array(l.buffer,c,u),v=i.inflate(b),m=0;m<v.length;m++)f[p+m]=v[m];else d==32767?a.decode._decodeARW(o,l,c,u,f,p):d==32773?a.decode._decodePackBits(l,c,u,f,p):d==32809?a.decode._decodeThunder(l,c,u,f,p):d==34713?a.decode._decodeNikon(o,s,l,c,u,f,p):n("Unknown compression",d);var y=o.t258?Math.min(32,o.t258[0]):1,g=o.t277?o.t277[0]:1,S=y*g>>>3,M=o.t278?o.t278[0]:o.height,E=Math.ceil(y*g*o.width/8);if(y==16&&!o.isLE&&o.t33422==null)for(var w=0;w<M;w++)for(var x=p+w*E,C=1;C<E;C+=2){var D=f[x+C];f[x+C]=f[x+C-1],f[x+C-1]=D}if(o.t317&&o.t317[0]==2)for(var w=0;w<M;w++){var B=p+w*E;if(y==16)for(var h=S;h<E;h+=2){var F=(f[B+h+1]<<8|f[B+h])+(f[B+h-S+1]<<8|f[B+h-S]);f[B+h]=F&255,f[B+h+1]=F>>>8&255}else if(g==3)for(var h=3;h<E;h+=3)f[B+h]=f[B+h]+f[B+h-3]&255,f[B+h+1]=f[B+h+1]+f[B+h-2]&255,f[B+h+2]=f[B+h+2]+f[B+h-1]&255;else for(var h=S;h<E;h++)f[B+h]=f[B+h]+f[B+h-S]&255}},a.decode._ljpeg_diff=function(o,s,l){var c=a.decode._getbithuff,u,d;return u=c(o,s,l[0],l),d=c(o,s,u,0),d&1<<u-1||(d-=(1<<u)-1),d},a.decode._decodeARW=function(o,s,l,c,u,d){var f=o.t256[0],p=o.t257[0],_=o.t258[0],h=o.isLE?a._binLE:a._binBE,b=f*p==c||f*p*1.5==c;if(!b){p+=8;var v=[l,0,0,0],m=new Uint16Array(32770),y=[3857,3856,3599,3342,3085,2828,2571,2314,2057,1800,1543,1286,1029,772,771,768,514,513],X,g,S,te,K,M=0,E=a.decode._ljpeg_diff;for(m[0]=15,S=X=0;X<18;X++)for(var w=32768>>>(y[X]>>>8),g=0;g<w;g++)m[++S]=y[X];for(te=f;te--;)for(K=0;K<p+1;K+=2)if(K==p&&(K=1),M+=E(s,v,m),K<p){var x=M&4095;a.decode._putsF(u,(K*f+te)*_,x<<16-_)}return}if(f*p*1.5==c){for(var X=0;X<c;X+=3){var C=s[l+X+0],D=s[l+X+1],B=s[l+X+2];u[d+X]=D<<4|C>>>4,u[d+X+1]=C<<4|B>>>4,u[d+X+2]=B<<4|D>>>4}return}var F=new Uint16Array(16),K,te,J,ne,le,q,j,P,N,X,Ee,Ae=new Uint8Array(f+1);for(K=0;K<p;K++){for(var ze=0;ze<f;ze++)Ae[ze]=s[l++];for(Ee=0,te=0;te<f-30;Ee+=16){for(ne=2047&(J=h.readUint(Ae,Ee)),le=2047&J>>>11,q=15&J>>>22,j=15&J>>>26,P=0;P<4&&128<<P<=ne-le;P++);for(N=30,X=0;X<16;X++)X==q?F[X]=ne:X==j?F[X]=le:(F[X]=((h.readUshort(Ae,Ee+(N>>3))>>>(N&7)&127)<<P)+le,F[X]>2047&&(F[X]=2047),N+=7);for(X=0;X<16;X++,te+=2){var x=F[X]<<1;a.decode._putsF(u,(K*f+te)*_,x<<16-_)}te-=te&1?1:31}}},a.decode._decodeNikon=function(o,s,l,c,u,d,f){var p=[[0,0,1,5,1,1,1,1,1,1,2,0,0,0,0,0,0,5,4,3,6,2,7,1,0,8,9,11,10,12],[0,0,1,5,1,1,1,1,1,1,2,0,0,0,0,0,0,57,90,56,39,22,5,4,3,2,1,0,11,12,12],[0,0,1,4,2,3,1,2,0,0,0,0,0,0,0,0,0,5,4,6,3,7,2,8,1,9,0,10,11,12],[0,0,1,4,3,1,1,1,1,1,2,0,0,0,0,0,0,5,6,4,7,8,3,9,2,1,0,10,11,12,13,14],[0,0,1,5,1,1,1,1,1,1,1,2,0,0,0,0,0,8,92,75,58,41,7,6,5,4,3,2,1,0,13,14],[0,0,1,4,2,2,3,1,2,0,0,0,0,0,0,0,0,7,6,8,5,9,4,10,3,11,12,2,0,1,13,14]],_=o.t256[0],h=o.t257[0],b=o.t258[0],v=0,m=0,y=a.decode._make_decoder,g=a.decode._getbithuff,S=s[0].exifIFD.makerNote,M=S.t150?S.t150:S.t140,E=0,w=M[E++],x=M[E++];(w==73||x==88)&&(E+=2110),w==70&&(v=2),b==14&&(v+=3);for(var C=[[0,0],[0,0]],D=o.isLE?a._binLE:a._binBE,J=0;J<2;J++)for(var B=0;B<2;B++)C[J][B]=D.readShort(M,E),E+=2;var F=1<<b&32767,K=0,te=D.readShort(M,E);E+=2,te>1&&(K=Math.floor(F/(te-1))),w==68&&x==32&&K>0&&(m=D.readShort(M,562));var J,ne,le,q,j,P,N=[0,0],X=y(p[v]),Ee=[c,0,0,0];for(ne=0;ne<h;ne++)for(m&&ne==m&&(X=y(p[v+1])),le=0;le<_;le++){J=g(l,Ee,X[0],X),q=J&15,j=J>>>4,P=(g(l,Ee,q-j,0)<<1)+1<<j>>>1,P&1<<q-1||(P-=(1<<q)-(j==0?1:0)),le<2?N[le]=C[ne&1][le]+=P:N[le&1]+=P;var Ae=Math.min(Math.max(N[le&1],0),(1<<b)-1),ze=(ne*_+le)*b;a.decode._putsF(d,ze,Ae<<16-b)}},a.decode._putsF=function(o,s,l){l=l<<8-(s&7);var c=s>>>3;o[c]|=l>>>16,o[c+1]|=l>>>8,o[c+2]|=l},a.decode._getbithuff=function(o,s,l,c){var u=0;a.decode._get_byte;var d,f=s[0],p=s[1],_=s[2],h=s[3];if(l==0||_<0)return 0;for(;!h&&_<l&&(d=o[f++])!=-1&&!(h=u);)p=(p<<8)+d,_+=8;if(d=p<<32-_>>>32-l,c?(_-=c[d+1]>>>8,d=c[d+1]&255):_-=l,_<0)throw"e";return s[0]=f,s[1]=p,s[2]=_,s[3]=h,d},a.decode._make_decoder=function(o){var s,l,c,u,d,f=[];for(s=16;s!=0&&!o[s];s--);var p=17;for(f[0]=s,c=l=1;l<=s;l++)for(u=0;u<o[l];u++,++p)for(d=0;d<1<<s-l;d++)c<=1<<s&&(f[c++]=l<<8|o[p]);return f},a.decode._decodeNewJPEG=function(o,s,l,c,u,d){var f=o.t347,p=f?f.length:0,_=new Uint8Array(p+c);if(f){for(var h=216,b=217,v=0,m=0;m<p-1&&!(f[m]==255&&f[m+1]==b);m++)_[v++]=f[m];var y=s[l],g=s[l+1];(y!=255||g!=h)&&(_[v++]=y,_[v++]=g);for(var m=2;m<c;m++)_[v++]=s[l+m]}else for(var m=0;m<c;m++)_[m]=s[l+m];if(o.t262[0]==32803||o.t262[0]==34892){var S=o.t258[0],M=a.LosslessJpegDecode(_),E=M.length;if(S==16)if(o.isLE)for(var m=0;m<E;m++)u[d+(m<<1)]=M[m]&255,u[d+(m<<1)+1]=M[m]>>>8;else for(var m=0;m<E;m++)u[d+(m<<1)]=M[m]>>>8,u[d+(m<<1)+1]=M[m]&255;else if(S==14||S==12)for(var w=16-S,m=0;m<E;m++)a.decode._putsF(u,m*S,M[m]<<w);else throw new Error("unsupported bit depth "+S)}else{var x=new a.JpegDecoder;x.parse(_);for(var C=x.getData(x.width,x.height),m=0;m<C.length;m++)u[d+m]=C[m]}o.t262[0]==6&&(o.t262[0]=2)},a.decode._decodeOldJPEGInit=function(o,s,l,c){var u=216,d=219,f=196,p=221,_=192,h=218,b=0,v=0,m,y,g=!1,S,M,E,w=o.t513,x=w?w[0]:0,C=o.t514,D=C?C[0]:0,B=o.t324||o.t273||w,F=o.t530,K=0,te=0,J=o.t277?o.t277[0]:1,ne=o.t515;if(B&&(v=B[0],g=B.length>1),!g){if(s[l]==255&&s[l+1]==u)return{jpegOffset:l};if(w!=null&&(s[l+x]==255&&s[l+x+1]==u?b=l+x:n("JPEGInterchangeFormat does not point to SOI"),C==null?n("JPEGInterchangeFormatLength field is missing"):(x>=v||x+D<=v)&&n("JPEGInterchangeFormatLength field value is invalid"),b!=null))return{jpegOffset:b}}if(F!=null&&(K=F[0],te=F[1]),w!=null&&C!=null)if(D>=2&&x+D<=v){for(s[l+x+D-2]==255&&s[l+x+D-1]==u?m=new Uint8Array(D-2):m=new Uint8Array(D),S=0;S<m.length;S++)m[S]=s[l+x+S];n("Incorrect JPEG interchange format: using JPEGInterchangeFormat offset to derive tables")}else n("JPEGInterchangeFormat+JPEGInterchangeFormatLength > offset to first strip or tile");if(m==null){var le=0,q=[];q[le++]=255,q[le++]=u;var j=o.t519;if(j==null)throw new Error("JPEGQTables tag is missing");for(S=0;S<j.length;S++)for(q[le++]=255,q[le++]=d,q[le++]=0,q[le++]=67,q[le++]=S,M=0;M<64;M++)q[le++]=s[l+j[S]+M];for(E=0;E<2;E++){var P=o[E==0?"t520":"t521"];if(P==null)throw new Error((E==0?"JPEGDCTables":"JPEGACTables")+" tag is missing");for(S=0;S<P.length;S++){q[le++]=255,q[le++]=f;var N=19;for(M=0;M<16;M++)N+=s[l+P[S]+M];for(q[le++]=N>>>8,q[le++]=N&255,q[le++]=S|E<<4,M=0;M<16;M++)q[le++]=s[l+P[S]+M];for(M=0;M<N;M++)q[le++]=s[l+P[S]+16+M]}}if(q[le++]=255,q[le++]=_,q[le++]=0,q[le++]=8+3*J,q[le++]=8,q[le++]=o.height>>>8&255,q[le++]=o.height&255,q[le++]=o.width>>>8&255,q[le++]=o.width&255,q[le++]=J,J==1)q[le++]=1,q[le++]=17,q[le++]=0;else for(S=0;S<3;S++)q[le++]=S+1,q[le++]=S!=0?17:(K&15)<<4|te&15,q[le++]=S;ne!=null&&ne[0]!=0&&(q[le++]=255,q[le++]=p,q[le++]=0,q[le++]=4,q[le++]=ne[0]>>>8&255,q[le++]=ne[0]&255),m=new Uint8Array(q)}var X=-1;for(S=0;S<m.length-1;){if(m[S]==255&&m[S+1]==_){X=S;break}S++}if(X==-1){var Ee=new Uint8Array(m.length+10+3*J);Ee.set(m);var Ae=m.length;if(X=m.length,m=Ee,m[Ae++]=255,m[Ae++]=_,m[Ae++]=0,m[Ae++]=8+3*J,m[Ae++]=8,m[Ae++]=o.height>>>8&255,m[Ae++]=o.height&255,m[Ae++]=o.width>>>8&255,m[Ae++]=o.width&255,m[Ae++]=J,J==1)m[Ae++]=1,m[Ae++]=17,m[Ae++]=0;else for(S=0;S<3;S++)m[Ae++]=S+1,m[Ae++]=S!=0?17:(K&15)<<4|te&15,m[Ae++]=S}if(s[v]==255&&s[v+1]==h){var ze=s[v+2]<<8|s[v+3];for(y=new Uint8Array(ze+2),y[0]=s[v],y[1]=s[v+1],y[2]=s[v+2],y[3]=s[v+3],S=0;S<ze-2;S++)y[S+4]=s[v+S+4]}else{y=new Uint8Array(8+2*J);var Le=0;if(y[Le++]=255,y[Le++]=h,y[Le++]=0,y[Le++]=6+2*J,y[Le++]=J,J==1)y[Le++]=1,y[Le++]=0;else for(S=0;S<3;S++)y[Le++]=S+1,y[Le++]=S<<4|S;y[Le++]=0,y[Le++]=63,y[Le++]=0}return{jpegOffset:l,tables:m,sosMarker:y,sofPosition:X}},a.decode._decodeOldJPEG=function(o,s,l,c,u,d){var f,p,_,h,b,v=a.decode._decodeOldJPEGInit(o,s,l,c);if(v.jpegOffset!=null)for(p=l+c-v.jpegOffset,h=new Uint8Array(p),f=0;f<p;f++)h[f]=s[v.jpegOffset+f];else{for(_=v.tables.length,h=new Uint8Array(_+v.sosMarker.length+c+2),h.set(v.tables),b=_,h[v.sofPosition+5]=o.height>>>8&255,h[v.sofPosition+6]=o.height&255,h[v.sofPosition+7]=o.width>>>8&255,h[v.sofPosition+8]=o.width&255,(s[l]!=255||s[l+1]!=SOS)&&(h.set(v.sosMarker,b),b+=sosMarker.length),f=0;f<c;f++)h[b++]=s[l+f];h[b++]=255,h[b++]=EOI}var m=new a.JpegDecoder;m.parse(h);for(var y=m.getData(m.width,m.height),f=0;f<y.length;f++)u[d+f]=y[f];o.t262&&o.t262[0]==6&&(o.t262[0]=2)},a.decode._decodePackBits=function(o,s,l,c,u){for(var d=new Int8Array(o.buffer),f=new Int8Array(c.buffer),p=s+l;s<p;){var _=d[s];if(s++,_>=0&&_<128)for(var h=0;h<_+1;h++)f[u]=d[s],u++,s++;if(_>=-127&&_<0){for(var h=0;h<-_+1;h++)f[u]=d[s],u++;s++}}},a.decode._decodeThunder=function(o,s,l,c,u){for(var d=[0,1,0,-1],f=[0,1,2,3,0,-3,-2,-1],p=s+l,_=u*2,h=0;s<p;){var b=o[s],v=b>>>6,m=b&63;if(s++,v==3&&(h=m&15,c[_>>>1]|=h<<4*(1-_&1),_++),v==0)for(var y=0;y<m;y++)c[_>>>1]|=h<<4*(1-_&1),_++;if(v==2)for(var y=0;y<2;y++){var g=m>>>3*(1-y)&7;g!=4&&(h+=f[g],c[_>>>1]|=h<<4*(1-_&1),_++)}if(v==1)for(var y=0;y<3;y++){var g=m>>>2*(2-y)&3;g!=2&&(h+=d[g],c[_>>>1]|=h<<4*(1-_&1),_++)}}},a.decode._dmap={1:0,"011":1,"000011":2,"0000011":3,"010":-1,"000010":-2,"0000010":-3},a.decode._lens=function(){var o=function(_,h,b,v){for(var m=0;m<h.length;m++)_[h[m]]=b+m*v},s="00110101,000111,0111,1000,1011,1100,1110,1111,10011,10100,00111,01000,001000,000011,110100,110101,101010,101011,0100111,0001100,0001000,0010111,0000011,0000100,0101000,0101011,0010011,0100100,0011000,00000010,00000011,00011010,00011011,00010010,00010011,00010100,00010101,00010110,00010111,00101000,00101001,00101010,00101011,00101100,00101101,00000100,00000101,00001010,00001011,01010010,01010011,01010100,01010101,00100100,00100101,01011000,01011001,01011010,01011011,01001010,01001011,00110010,00110011,00110100",l="0000110111,010,11,10,011,0011,0010,00011,000101,000100,0000100,0000101,0000111,00000100,00000111,000011000,0000010111,0000011000,0000001000,00001100111,00001101000,00001101100,00000110111,00000101000,00000010111,00000011000,000011001010,000011001011,000011001100,000011001101,000001101000,000001101001,000001101010,000001101011,000011010010,000011010011,000011010100,000011010101,000011010110,000011010111,000001101100,000001101101,000011011010,000011011011,000001010100,000001010101,000001010110,000001010111,000001100100,000001100101,000001010010,000001010011,000000100100,000000110111,000000111000,000000100111,000000101000,000001011000,000001011001,000000101011,000000101100,000001011010,000001100110,000001100111",c="11011,10010,010111,0110111,00110110,00110111,01100100,01100101,01101000,01100111,011001100,011001101,011010010,011010011,011010100,011010101,011010110,011010111,011011000,011011001,011011010,011011011,010011000,010011001,010011010,011000,010011011",u="0000001111,000011001000,000011001001,000001011011,000000110011,000000110100,000000110101,0000001101100,0000001101101,0000001001010,0000001001011,0000001001100,0000001001101,0000001110010,0000001110011,0000001110100,0000001110101,0000001110110,0000001110111,0000001010010,0000001010011,0000001010100,0000001010101,0000001011010,0000001011011,0000001100100,0000001100101",d="00000001000,00000001100,00000001101,000000010010,000000010011,000000010100,000000010101,000000010110,000000010111,000000011100,000000011101,000000011110,000000011111";s=s.split(","),l=l.split(","),c=c.split(","),u=u.split(","),d=d.split(",");var f={},p={};return o(f,s,0,1),o(f,c,64,64),o(f,d,1792,64),o(p,l,0,1),o(p,u,64,64),o(p,d,1792,64),[f,p]}(),a.decode._decodeG4=function(o,s,l,c,u,d,f){for(var p=a.decode,_=s<<3,h=0,b="",v=[],m=[],y=0;y<d;y++)m.push(0);m=p._makeDiff(m);for(var g=0,S=0,M=0,E=0,w=0,x=0,C="",D=0,B=Math.ceil(d/8)*8;_>>>3<s+l;){M=p._findDiff(m,g+(g==0?0:1),1-w),E=p._findDiff(m,M,w);var F=0;if(f==1&&(F=o[_>>>3]>>>7-(_&7)&1),f==2&&(F=o[_>>>3]>>>(_&7)&1),_++,b+=F,C=="H"){if(p._lens[w][b]!=null){var K=p._lens[w][b];b="",h+=K,K<64&&(p._addNtimes(v,h,w),g+=h,w=1-w,h=0,D--,D==0&&(C=""))}}else b=="0001"&&(b="",p._addNtimes(v,E-g,w),g=E),b=="001"&&(b="",C="H",D=2),p._dmap[b]!=null&&(S=M+p._dmap[b],p._addNtimes(v,S-g,w),g=S,b="",w=1-w);v.length==d&&C==""&&(p._writeBits(v,c,u*8+x*B),w=0,x++,g=0,m=p._makeDiff(v),v=[])}},a.decode._findDiff=function(o,s,l){for(var c=0;c<o.length;c+=2)if(o[c]>=s&&o[c+1]==l)return o[c]},a.decode._makeDiff=function(o){var s=[];o[0]==1&&s.push(0,1);for(var l=1;l<o.length;l++)o[l-1]!=o[l]&&s.push(l,o[l]);return s.push(o.length,0,o.length,1),s},a.decode._decodeG3=function(o,s,l,c,u,d,f){for(var p=a.decode,_=s<<3,h=0,b="",v=[],m=[],y=0;y<d;y++)v.push(0);for(var g=0,S=0,M=0,E=0,w=0,x=-1,C="",D=0,B=!1,F=Math.ceil(d/8)*8;_>>>3<s+l;){M=p._findDiff(m,g+(g==0?0:1),1-w),E=p._findDiff(m,M,w);var K=0;if(f==1&&(K=o[_>>>3]>>>7-(_&7)&1),f==2&&(K=o[_>>>3]>>>(_&7)&1),_++,b+=K,B){if(p._lens[w][b]!=null){var te=p._lens[w][b];b="",h+=te,te<64&&(p._addNtimes(v,h,w),w=1-w,h=0)}}else if(C=="H"){if(p._lens[w][b]!=null){var te=p._lens[w][b];b="",h+=te,te<64&&(p._addNtimes(v,h,w),g+=h,w=1-w,h=0,D--,D==0&&(C=""))}}else b=="0001"&&(b="",p._addNtimes(v,E-g,w),g=E),b=="001"&&(b="",C="H",D=2),p._dmap[b]!=null&&(S=M+p._dmap[b],p._addNtimes(v,S-g,w),g=S,b="",w=1-w);b.endsWith("000000000001")&&(x>=0&&p._writeBits(v,c,u*8+x*F),f==1&&(B=(o[_>>>3]>>>7-(_&7)&1)==1),f==2&&(B=(o[_>>>3]>>>(_&7)&1)==1),_++,p._decodeG3.allow2D==null&&(p._decodeG3.allow2D=B),p._decodeG3.allow2D||(B=!0,_--),b="",w=0,x++,g=0,m=p._makeDiff(v),v=[])}v.length==d&&p._writeBits(v,c,u*8+x*F)},a.decode._addNtimes=function(o,s,l){for(var c=0;c<s;c++)o.push(l)},a.decode._writeBits=function(o,s,l){for(var c=0;c<o.length;c++)s[l+c>>>3]|=o[c]<<7-(l+c&7)},a.decode._decodeLZW=function(o,s,l,c){if(a.decode._lzwTab==null){for(var u=new Uint32Array(65535),d=new Uint16Array(65535),b=new Uint8Array(2e6),f=0;f<256;f++)b[f<<2]=f,u[f]=f<<2,d[f]=1;a.decode._lzwTab=[u,d,b]}for(var p=a.decode._copyData,_=a.decode._lzwTab[0],h=a.decode._lzwTab[1],b=a.decode._lzwTab[2],v=258,m=1032,y=9,g=s<<3,S=256,M=257,E=0,w=0,x=0;E=o[g>>>3]<<16|o[g+8>>>3]<<8|o[g+16>>>3],w=E>>24-(g&7)-y&(1<<y)-1,g+=y,w!=M;){if(w==S){if(y=9,v=258,m=1032,E=o[g>>>3]<<16|o[g+8>>>3]<<8|o[g+16>>>3],w=E>>24-(g&7)-y&(1<<y)-1,g+=y,w==M)break;l[c]=w,c++}else if(w<v){var C=_[w],D=h[w];if(p(b,C,l,c,D),c+=D,x>=v)_[v]=m,b[_[v]]=C[0],h[v]=1,m=m+1+3&-4,v++;else{_[v]=m;var B=_[x],F=h[x];p(b,B,b,m,F),b[m+F]=b[C],F++,h[v]=F,v++,m=m+F+3&-4}v+1==1<<y&&y++}else{if(x>=v)_[v]=m,h[v]=0,v++;else{_[v]=m;var B=_[x],F=h[x];p(b,B,b,m,F),b[m+F]=b[m],F++,h[v]=F,v++,p(b,m,l,c,F),c+=F,m=m+F+3&-4}v+1==1<<y&&y++}x=w}},a.decode._copyData=function(o,s,l,c,u){for(var d=0;d<u;d+=4)l[c+d]=o[s+d],l[c+d+1]=o[s+d+1],l[c+d+2]=o[s+d+2],l[c+d+3]=o[s+d+3]},a.tags={},a.ttypes={256:3,257:3,258:3,259:3,262:3,273:4,274:3,277:3,278:4,279:4,282:5,283:5,284:3,286:5,287:5,296:3,305:2,306:2,338:3,513:4,514:4,34665:4},a._readIFD=function(o,s,l,c,u,d){var f=o.readUshort(s,l);l+=2;var p={};c.push(p),d&&n(" ".repeat(u),c.length-1,">>>----------------");for(var _=0;_<f;_++){var h=o.readUshort(s,l);l+=2;var b=o.readUshort(s,l);l+=2;var v=o.readUint(s,l);l+=4;var m=o.readUint(s,l);l+=4;var y=[];if((b==1||b==7)&&(y=new Uint8Array(s.buffer,v<5?l-4:m,v)),b==2){var g=v<5?l-4:m,S=s[g];S<128?y.push(o.readASCII(s,g,v-1)):y=new Uint8Array(s.buffer,g,v-1)}if(b==3)for(var M=0;M<v;M++)y.push(o.readUshort(s,(v<3?l-4:m)+2*M));if(b==4)for(var M=0;M<v;M++)y.push(o.readUint(s,(v<2?l-4:m)+4*M));if(b==5)for(var M=0;M<v;M++)y.push(o.readUint(s,m+M*8)/o.readUint(s,m+M*8+4));if(b==8)for(var M=0;M<v;M++)y.push(o.readShort(s,(v<3?l-4:m)+2*M));if(b==9)for(var M=0;M<v;M++)y.push(o.readInt(s,(v<2?l-4:m)+4*M));if(b==10)for(var M=0;M<v;M++)y.push(o.readInt(s,m+M*8)/o.readInt(s,m+M*8+4));if(b==11)for(var M=0;M<v;M++)y.push(o.readFloat(s,m+M*4));if(b==12)for(var M=0;M<v;M++)y.push(o.readDouble(s,m+M*8));if(p["t"+h]=y,v!=0&&y.length==0&&n("unknown TIFF tag type: ",b,"num:",v),d&&n(" ".repeat(u),h,b,a.tags[h],y),!(h==330&&p.t272&&p.t272[0]=="DSLR-A100")){if(h==330||h==34665||h==50740&&o.readUshort(s,o.readUint(y,0))<300){for(var E=h==50740?[o.readUint(y,0)]:y,w=[],M=0;M<E.length;M++)a._readIFD(o,s,E[M],w,u+1,d);h==330&&(p.subIFD=w),h==34665&&(p.exifIFD=w[0]),h==50740&&(p.dngPrvt=w[0])}}if(h==37500){var x=y;if(o.readASCII(x,0,5)=="Nikon")p.makerNote=a.decode(x.slice(10).buffer)[0];else if(o.readUshort(s,m)<300){var C=[];a._readIFD(o,s,m,C,u+1,d),p.makerNote=C[0]}}}return d&&n(" ".repeat(u),"<<<---------------"),l},a._writeIFD=function(o,s,l,c){var u=Object.keys(c);o.writeUshort(s,l,u.length),l+=2;for(var d=l+u.length*12+4,f=0;f<u.length;f++){var p=u[f],_=parseInt(p.slice(1)),h=a.ttypes[_];if(h==null)throw new Error("unknown type of tag: "+_);var b=c[p];h==2&&(b=b[0]+"\0");var v=b.length;o.writeUshort(s,l,_),l+=2,o.writeUshort(s,l,h),l+=2,o.writeUint(s,l,v),l+=4;var m=[-1,1,1,2,4,8,0,0,0,0,0,0,8][h]*v,y=l;if(m>4&&(o.writeUint(s,l,d),y=d),h==2&&o.writeASCII(s,y,b),h==3)for(var g=0;g<v;g++)o.writeUshort(s,y+2*g,b[g]);if(h==4)for(var g=0;g<v;g++)o.writeUint(s,y+4*g,b[g]);if(h==5)for(var g=0;g<v;g++)o.writeUint(s,y+8*g,Math.round(b[g]*1e4)),o.writeUint(s,y+8*g+4,1e4);if(h==12)for(var g=0;g<v;g++)o.writeDouble(s,y+8*g,b[g]);m>4&&(m+=m&1,d+=m),l+=4}return[l,d]},a.toRGBA8=function(o){var s=o.width,l=o.height,c=s*l,u=c*4,d=o.data,f=new Uint8Array(c*4),p=o.t262?o.t262[0]:2,_=o.t258?Math.min(32,o.t258[0]):1;if(p==0)for(var h=Math.ceil(_*s/8),b=0;b<l;b++){var v=b*h,m=b*s;if(_==1)for(var y=0;y<s;y++){var g=m+y<<2,S=d[v+(y>>3)]>>7-(y&7)&1;f[g]=f[g+1]=f[g+2]=(1-S)*255,f[g+3]=255}if(_==4)for(var y=0;y<s;y++){var g=m+y<<2,S=d[v+(y>>1)]>>4-4*(y&1)&15;f[g]=f[g+1]=f[g+2]=(15-S)*17,f[g+3]=255}if(_==8)for(var y=0;y<s;y++){var g=m+y<<2,S=d[v+y];f[g]=f[g+1]=f[g+2]=255-S,f[g+3]=255}}else if(p==1)for(var h=Math.ceil(_*s/8),b=0;b<l;b++){var v=b*h,m=b*s;if(_==1)for(var y=0;y<s;y++){var g=m+y<<2,S=d[v+(y>>3)]>>7-(y&7)&1;f[g]=f[g+1]=f[g+2]=S*255,f[g+3]=255}if(_==2)for(var y=0;y<s;y++){var g=m+y<<2,S=d[v+(y>>2)]>>6-2*(y&3)&3;f[g]=f[g+1]=f[g+2]=S*85,f[g+3]=255}if(_==8)for(var y=0;y<s;y++){var g=m+y<<2,S=d[v+y];f[g]=f[g+1]=f[g+2]=S,f[g+3]=255}if(_==16)for(var y=0;y<s;y++){var g=m+y<<2,S=d[v+(2*y+1)];f[g]=f[g+1]=f[g+2]=Math.min(255,S),f[g+3]=255}}else if(p==2){var M=o.t258?o.t258.length:3;if(_==8){if(M==4)for(var y=0;y<u;y++)f[y]=d[y];if(M==3)for(var y=0;y<c;y++){var g=y<<2,E=y*3;f[g]=d[E],f[g+1]=d[E+1],f[g+2]=d[E+2],f[g+3]=255}}else{if(M==4)for(var y=0;y<c;y++){var g=y<<2,E=y*8+1;f[g]=d[E],f[g+1]=d[E+2],f[g+2]=d[E+4],f[g+3]=d[E+6]}if(M==3)for(var y=0;y<c;y++){var g=y<<2,E=y*6+1;f[g]=d[E],f[g+1]=d[E+2],f[g+2]=d[E+4],f[g+3]=255}}}else if(p==3)for(var w=o.t320,y=0;y<c;y++){var g=y<<2,x=d[y];f[g]=w[x]>>8,f[g+1]=w[256+x]>>8,f[g+2]=w[512+x]>>8,f[g+3]=255}else if(p==5)for(var M=o.t258?o.t258.length:4,C=M>4?1:0,y=0;y<c;y++){var g=y<<2,D=y*M,B=255-d[D],F=255-d[D+1],K=255-d[D+2],te=(255-d[D+3])*(1/255);f[g]=~~(B*te+.5),f[g+1]=~~(F*te+.5),f[g+2]=~~(K*te+.5),f[g+3]=255*(1-C)+d[D+4]*C}else n("Unknown Photometric interpretation: "+p);return f},a.replaceIMG=function(o){o==null&&(o=document.getElementsByTagName("img"));for(var s=["tif","tiff","dng","cr2","nef"],l=0;l<o.length;l++){var c=o[l],u=c.getAttribute("src");if(u!=null){var d=u.split(".").pop().toLowerCase();if(s.indexOf(d)!=-1){var f=new XMLHttpRequest;a._xhrs.push(f),a._imgs.push(c),f.open("GET",u),f.responseType="arraybuffer",f.onload=a._imgLoaded,f.send()}}}},a._xhrs=[],a._imgs=[],a._imgLoaded=function(o){var s=o.target.response,l=a.decode(s),c=l,u=0,d=c[0];l[0].subIFD&&(c=c.concat(l[0].subIFD));for(var f=0;f<c.length;f++){var m=c[f];if(!(m.t258==null||m.t258.length<3)){var p=m.t256*m.t257;p>u&&(u=p,d=m)}}a.decodeImage(s,d,l);var _=a.toRGBA8(d),h=d.width,b=d.height,v=a._xhrs.indexOf(o.target),m=a._imgs[v];a._xhrs.splice(v,1),a._imgs.splice(v,1);var y=document.createElement("canvas");y.width=h,y.height=b;for(var g=y.getContext("2d"),S=g.createImageData(h,b),f=0;f<_.length;f++)S.data[f]=_[f];g.putImageData(S,0,0),m.setAttribute("src",y.toDataURL())},a._binBE={nextZero:function(o,s){for(;o[s]!=0;)s++;return s},readUshort:function(o,s){return o[s]<<8|o[s+1]},readShort:function(o,s){var l=a._binBE.ui8;return l[0]=o[s+1],l[1]=o[s+0],a._binBE.i16[0]},readInt:function(o,s){var l=a._binBE.ui8;return l[0]=o[s+3],l[1]=o[s+2],l[2]=o[s+1],l[3]=o[s+0],a._binBE.i32[0]},readUint:function(o,s){var l=a._binBE.ui8;return l[0]=o[s+3],l[1]=o[s+2],l[2]=o[s+1],l[3]=o[s+0],a._binBE.ui32[0]},readASCII:function(o,s,l){for(var c="",u=0;u<l;u++)c+=String.fromCharCode(o[s+u]);return c},readFloat:function(o,s){for(var l=a._binBE.ui8,c=0;c<4;c++)l[c]=o[s+3-c];return a._binBE.fl32[0]},readDouble:function(o,s){for(var l=a._binBE.ui8,c=0;c<8;c++)l[c]=o[s+7-c];return a._binBE.fl64[0]},writeUshort:function(o,s,l){o[s]=l>>8&255,o[s+1]=l&255},writeUint:function(o,s,l){o[s]=l>>24&255,o[s+1]=l>>16&255,o[s+2]=l>>8&255,o[s+3]=l>>0&255},writeASCII:function(o,s,l){for(var c=0;c<l.length;c++)o[s+c]=l.charCodeAt(c)},writeDouble:function(o,s,l){a._binBE.fl64[0]=l;for(var c=0;c<8;c++)o[s+c]=a._binBE.ui8[7-c]}},a._binBE.ui8=new Uint8Array(8),a._binBE.i16=new Int16Array(a._binBE.ui8.buffer),a._binBE.i32=new Int32Array(a._binBE.ui8.buffer),a._binBE.ui32=new Uint32Array(a._binBE.ui8.buffer),a._binBE.fl32=new Float32Array(a._binBE.ui8.buffer),a._binBE.fl64=new Float64Array(a._binBE.ui8.buffer),a._binLE={nextZero:a._binBE.nextZero,readUshort:function(o,s){return o[s+1]<<8|o[s]},readShort:function(o,s){var l=a._binBE.ui8;return l[0]=o[s+0],l[1]=o[s+1],a._binBE.i16[0]},readInt:function(o,s){var l=a._binBE.ui8;return l[0]=o[s+0],l[1]=o[s+1],l[2]=o[s+2],l[3]=o[s+3],a._binBE.i32[0]},readUint:function(o,s){var l=a._binBE.ui8;return l[0]=o[s+0],l[1]=o[s+1],l[2]=o[s+2],l[3]=o[s+3],a._binBE.ui32[0]},readASCII:a._binBE.readASCII,readFloat:function(o,s){for(var l=a._binBE.ui8,c=0;c<4;c++)l[c]=o[s+c];return a._binBE.fl32[0]},readDouble:function(o,s){for(var l=a._binBE.ui8,c=0;c<8;c++)l[c]=o[s+c];return a._binBE.fl64[0]}},a._copyTile=function(o,s,l,c,u,d,f,p){for(var _=Math.min(s,u-f),h=Math.min(l,d-p),b=0;b<h;b++)for(var v=(p+b)*u+f,m=b*s,y=0;y<_;y++)c[v+y]=o[m+y]},a.LosslessJpegDecode=function(){function o(u){this.w=u,this.N=0,this._=0,this.G=0}o.prototype={t:function(u){this.N=Math.max(0,Math.min(this.w.length,u))},i:function(){return this.w[this.N++]},l:function(){var u=this.N;return this.N+=2,this.w[u]<<8|this.w[u+1]},J:function(){return this._==0&&(this.G=this.w[this.N],this.N+=1+(this.G+1>>>8),this._=8),this.G>>>--this._&1},Z:function(u){var d=this._,f=this.G,p=Math.min(d,u);u-=p,d-=p;for(var _=f>>>d&(1<<p)-1;u>0;)f=this.w[this.N],this.N+=1+(f+1>>>8),p=Math.min(8,u),u-=p,d=8-p,_<<=p,_|=f>>>d&(1<<p)-1;return this._=d,this.G=f,_}};var s={};s.X=function(){return[0,0,-1]},s.s=function(u,d,f){u[s.Y(u,0,f)+2]=d},s.Y=function(u,d,f){if(u[d+2]!=-1)return 0;if(f==0)return d;for(var p=0;p<2;p++){u[d+p]==0&&(u[d+p]=u.length,u.push(0),u.push(0),u.push(-1));var _=s.Y(u,u[d+p],f-1);if(_!=0)return _}return 0},s.B=function(u,d){for(var f=0,p=0,_=0,h=d._,b=d.G,v=d.N;;)if(h==0&&(b=d.w[v],v+=1+(b+1>>>8),h=8),_=b>>>--h&1,f=u[f+_],p=u[f+2],p!=-1)return d._=h,d.G=b,d.N=v,p;return-1};function l(u){this.z=new o(u),this.D(this.z)}l.prototype={$:function(u,d){this.Q=u.i(),this.F=u.l(),this.o=u.l();var f=this.O=u.i();this.L=[];for(var p=0;p<f;p++){var _=u.i();u.i(),u.i(),this.L[_]=p}u.t(u.N+d-(6+f*3))},e:function(){var u=0,d=this.z.i();this.H==null&&(this.H={});for(var f=this.H[d]=s.X(),p=[],_=0;_<16;_++)p[_]=this.z.i(),u+=p[_];for(var _=0;_<16;_++)for(var h=0;h<p[_];h++)s.s(f,this.z.i(),_+1);return u+17},W:function(u){for(;u>0;)u-=this.e()},p:function(u,d){var f=u.i();this.U||(this.U=[]);for(var p=0;p<f;p++){var _=u.i(),h=u.i();this.U[this.L[_]]=this.H[h>>>4]}this.g=u.i(),u.t(u.N+d-(2+f*2))},D:function(u){var d=!1,f=u.l();if(f===l.q)do{var f=u.l(),p=u.l()-2;switch(f){case l.m:this.$(u,p);break;case l.K:this.W(p);break;case l.V:this.p(u,p),d=!0;break;default:u.t(u.N+p);break}}while(!d)},I:function(u,d){var f=s.B(d,u);if(f==16)return-32768;var p=u.Z(f);return p&1<<f-1||(p-=(1<<f)-1),p},B:function(u,d){for(var f=this.z,p=this.O,_=this.F,h=this.I,b=this.g,v=this.o*p,m=this.U,y=0;y<p;y++)u[y]=h(f,m[y])+(1<<this.Q-1);for(var g=p;g<v;g+=p)for(var y=0;y<p;y++)u[g+y]=h(f,m[y])+u[g+y-p];for(var S=d,M=1;M<_;M++){for(var y=0;y<p;y++)u[S+y]=h(f,m[y])+u[S+y-d];for(var g=p;g<v;g+=p)for(var y=0;y<p;y++){var E=S+g+y,w=u[E-p];b==6&&(w=u[E-d]+(w-u[E-p-d]>>>1)),u[E]=w+h(f,m[y])}S+=d}}},l.m=65475,l.K=65476,l.q=65496,l.V=65498;function c(u){var d=new l(u),f=d.Q>8?Uint16Array:Uint8Array,p=new f(d.o*d.F*d.O),_=d.o*d.O;return d.B(p,_),p}return c}()})(t,r)})()})(p2);var F2=p2.exports;const fO=yn({__proto__:null,default:d2(F2)},[F2]);/*! pako 2.1.0 https://github.com/nodeca/pako @license (MIT AND Zlib) */const dO=4,R2=0,L2=1,pO=2;function ts(e){let t=e.length;for(;--t>=0;)e[t]=0}const hO=0,B2=1,vO=2,mO=3,gO=258,Bd=29,fl=256,dl=fl+1+Bd,rs=30,$d=19,$2=2*dl+1,ho=15,Nd=16,bO=7,Ud=256,N2=16,U2=17,H2=18,Hd=new Uint8Array([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0]),yc=new Uint8Array([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13]),yO=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),j2=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),_O=512,li=new Array((dl+2)*2);ts(li);const pl=new Array(rs*2);ts(pl);const hl=new Array(_O);ts(hl);const vl=new Array(gO-mO+1);ts(vl);const jd=new Array(Bd);ts(jd);const _c=new Array(rs);ts(_c);function Gd(e,t,r,n,a){this.static_tree=e,this.extra_bits=t,this.extra_base=r,this.elems=n,this.max_length=a,this.has_stree=e&&e.length}let G2,V2,q2;function Vd(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}const K2=e=>e<256?hl[e]:hl[256+(e>>>7)],ml=(e,t)=>{e.pending_buf[e.pending++]=t&255,e.pending_buf[e.pending++]=t>>>8&255},xn=(e,t,r)=>{e.bi_valid>Nd-r?(e.bi_buf|=t<<e.bi_valid&65535,ml(e,e.bi_buf),e.bi_buf=t>>Nd-e.bi_valid,e.bi_valid+=r-Nd):(e.bi_buf|=t<<e.bi_valid&65535,e.bi_valid+=r)},Fa=(e,t,r)=>{xn(e,r[t*2],r[t*2+1])},W2=(e,t)=>{let r=0;do r|=e&1,e>>>=1,r<<=1;while(--t>0);return r>>>1},xO=e=>{e.bi_valid===16?(ml(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):e.bi_valid>=8&&(e.pending_buf[e.pending++]=e.bi_buf&255,e.bi_buf>>=8,e.bi_valid-=8)},wO=(e,t)=>{const r=t.dyn_tree,n=t.max_code,a=t.stat_desc.static_tree,i=t.stat_desc.has_stree,o=t.stat_desc.extra_bits,s=t.stat_desc.extra_base,l=t.stat_desc.max_length;let c,u,d,f,p,_,h=0;for(f=0;f<=ho;f++)e.bl_count[f]=0;for(r[e.heap[e.heap_max]*2+1]=0,c=e.heap_max+1;c<$2;c++)u=e.heap[c],f=r[r[u*2+1]*2+1]+1,f>l&&(f=l,h++),r[u*2+1]=f,!(u>n)&&(e.bl_count[f]++,p=0,u>=s&&(p=o[u-s]),_=r[u*2],e.opt_len+=_*(f+p),i&&(e.static_len+=_*(a[u*2+1]+p)));if(h!==0){do{for(f=l-1;e.bl_count[f]===0;)f--;e.bl_count[f]--,e.bl_count[f+1]+=2,e.bl_count[l]--,h-=2}while(h>0);for(f=l;f!==0;f--)for(u=e.bl_count[f];u!==0;)d=e.heap[--c],!(d>n)&&(r[d*2+1]!==f&&(e.opt_len+=(f-r[d*2+1])*r[d*2],r[d*2+1]=f),u--)}},Y2=(e,t,r)=>{const n=new Array(ho+1);let a=0,i,o;for(i=1;i<=ho;i++)a=a+r[i-1]<<1,n[i]=a;for(o=0;o<=t;o++){let s=e[o*2+1];s!==0&&(e[o*2]=W2(n[s]++,s))}},kO=()=>{let e,t,r,n,a;const i=new Array(ho+1);for(r=0,n=0;n<Bd-1;n++)for(jd[n]=r,e=0;e<1<<Hd[n];e++)vl[r++]=n;for(vl[r-1]=n,a=0,n=0;n<16;n++)for(_c[n]=a,e=0;e<1<<yc[n];e++)hl[a++]=n;for(a>>=7;n<rs;n++)for(_c[n]=a<<7,e=0;e<1<<yc[n]-7;e++)hl[256+a++]=n;for(t=0;t<=ho;t++)i[t]=0;for(e=0;e<=143;)li[e*2+1]=8,e++,i[8]++;for(;e<=255;)li[e*2+1]=9,e++,i[9]++;for(;e<=279;)li[e*2+1]=7,e++,i[7]++;for(;e<=287;)li[e*2+1]=8,e++,i[8]++;for(Y2(li,dl+1,i),e=0;e<rs;e++)pl[e*2+1]=5,pl[e*2]=W2(e,5);G2=new Gd(li,Hd,fl+1,dl,ho),V2=new Gd(pl,yc,0,rs,ho),q2=new Gd(new Array(0),yO,0,$d,bO)},X2=e=>{let t;for(t=0;t<dl;t++)e.dyn_ltree[t*2]=0;for(t=0;t<rs;t++)e.dyn_dtree[t*2]=0;for(t=0;t<$d;t++)e.bl_tree[t*2]=0;e.dyn_ltree[Ud*2]=1,e.opt_len=e.static_len=0,e.sym_next=e.matches=0},Z2=e=>{e.bi_valid>8?ml(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0},J2=(e,t,r,n)=>{const a=t*2,i=r*2;return e[a]<e[i]||e[a]===e[i]&&n[t]<=n[r]},qd=(e,t,r)=>{const n=e.heap[r];let a=r<<1;for(;a<=e.heap_len&&(a<e.heap_len&&J2(t,e.heap[a+1],e.heap[a],e.depth)&&a++,!J2(t,n,e.heap[a],e.depth));)e.heap[r]=e.heap[a],r=a,a<<=1;e.heap[r]=n},Q2=(e,t,r)=>{let n,a,i=0,o,s;if(e.sym_next!==0)do n=e.pending_buf[e.sym_buf+i++]&255,n+=(e.pending_buf[e.sym_buf+i++]&255)<<8,a=e.pending_buf[e.sym_buf+i++],n===0?Fa(e,a,t):(o=vl[a],Fa(e,o+fl+1,t),s=Hd[o],s!==0&&(a-=jd[o],xn(e,a,s)),n--,o=K2(n),Fa(e,o,r),s=yc[o],s!==0&&(n-=_c[o],xn(e,n,s)));while(i<e.sym_next);Fa(e,Ud,t)},Kd=(e,t)=>{const r=t.dyn_tree,n=t.stat_desc.static_tree,a=t.stat_desc.has_stree,i=t.stat_desc.elems;let o,s,l=-1,c;for(e.heap_len=0,e.heap_max=$2,o=0;o<i;o++)r[o*2]!==0?(e.heap[++e.heap_len]=l=o,e.depth[o]=0):r[o*2+1]=0;for(;e.heap_len<2;)c=e.heap[++e.heap_len]=l<2?++l:0,r[c*2]=1,e.depth[c]=0,e.opt_len--,a&&(e.static_len-=n[c*2+1]);for(t.max_code=l,o=e.heap_len>>1;o>=1;o--)qd(e,r,o);c=i;do o=e.heap[1],e.heap[1]=e.heap[e.heap_len--],qd(e,r,1),s=e.heap[1],e.heap[--e.heap_max]=o,e.heap[--e.heap_max]=s,r[c*2]=r[o*2]+r[s*2],e.depth[c]=(e.depth[o]>=e.depth[s]?e.depth[o]:e.depth[s])+1,r[o*2+1]=r[s*2+1]=c,e.heap[1]=c++,qd(e,r,1);while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],wO(e,t),Y2(r,l,e.bl_count)},eb=(e,t,r)=>{let n,a=-1,i,o=t[0*2+1],s=0,l=7,c=4;for(o===0&&(l=138,c=3),t[(r+1)*2+1]=65535,n=0;n<=r;n++)i=o,o=t[(n+1)*2+1],!(++s<l&&i===o)&&(s<c?e.bl_tree[i*2]+=s:i!==0?(i!==a&&e.bl_tree[i*2]++,e.bl_tree[N2*2]++):s<=10?e.bl_tree[U2*2]++:e.bl_tree[H2*2]++,s=0,a=i,o===0?(l=138,c=3):i===o?(l=6,c=3):(l=7,c=4))},tb=(e,t,r)=>{let n,a=-1,i,o=t[0*2+1],s=0,l=7,c=4;for(o===0&&(l=138,c=3),n=0;n<=r;n++)if(i=o,o=t[(n+1)*2+1],!(++s<l&&i===o)){if(s<c)do Fa(e,i,e.bl_tree);while(--s!==0);else i!==0?(i!==a&&(Fa(e,i,e.bl_tree),s--),Fa(e,N2,e.bl_tree),xn(e,s-3,2)):s<=10?(Fa(e,U2,e.bl_tree),xn(e,s-3,3)):(Fa(e,H2,e.bl_tree),xn(e,s-11,7));s=0,a=i,o===0?(l=138,c=3):i===o?(l=6,c=3):(l=7,c=4)}},SO=e=>{let t;for(eb(e,e.dyn_ltree,e.l_desc.max_code),eb(e,e.dyn_dtree,e.d_desc.max_code),Kd(e,e.bl_desc),t=$d-1;t>=3&&e.bl_tree[j2[t]*2+1]===0;t--);return e.opt_len+=3*(t+1)+5+5+4,t},CO=(e,t,r,n)=>{let a;for(xn(e,t-257,5),xn(e,r-1,5),xn(e,n-4,4),a=0;a<n;a++)xn(e,e.bl_tree[j2[a]*2+1],3);tb(e,e.dyn_ltree,t-1),tb(e,e.dyn_dtree,r-1)},EO=e=>{let t=4093624447,r;for(r=0;r<=31;r++,t>>>=1)if(t&1&&e.dyn_ltree[r*2]!==0)return R2;if(e.dyn_ltree[9*2]!==0||e.dyn_ltree[10*2]!==0||e.dyn_ltree[13*2]!==0)return L2;for(r=32;r<fl;r++)if(e.dyn_ltree[r*2]!==0)return L2;return R2};let rb=!1;const AO=e=>{rb||(kO(),rb=!0),e.l_desc=new Vd(e.dyn_ltree,G2),e.d_desc=new Vd(e.dyn_dtree,V2),e.bl_desc=new Vd(e.bl_tree,q2),e.bi_buf=0,e.bi_valid=0,X2(e)},nb=(e,t,r,n)=>{xn(e,(hO<<1)+(n?1:0),3),Z2(e),ml(e,r),ml(e,~r),r&&e.pending_buf.set(e.window.subarray(t,t+r),e.pending),e.pending+=r},TO=e=>{xn(e,B2<<1,3),Fa(e,Ud,li),xO(e)},MO=(e,t,r,n)=>{let a,i,o=0;e.level>0?(e.strm.data_type===pO&&(e.strm.data_type=EO(e)),Kd(e,e.l_desc),Kd(e,e.d_desc),o=SO(e),a=e.opt_len+3+7>>>3,i=e.static_len+3+7>>>3,i<=a&&(a=i)):a=i=r+5,r+4<=a&&t!==-1?nb(e,t,r,n):e.strategy===dO||i===a?(xn(e,(B2<<1)+(n?1:0),3),Q2(e,li,pl)):(xn(e,(vO<<1)+(n?1:0),3),CO(e,e.l_desc.max_code+1,e.d_desc.max_code+1,o+1),Q2(e,e.dyn_ltree,e.dyn_dtree)),X2(e),n&&Z2(e)},DO=(e,t,r)=>(e.pending_buf[e.sym_buf+e.sym_next++]=t,e.pending_buf[e.sym_buf+e.sym_next++]=t>>8,e.pending_buf[e.sym_buf+e.sym_next++]=r,t===0?e.dyn_ltree[r*2]++:(e.matches++,t--,e.dyn_ltree[(vl[r]+fl+1)*2]++,e.dyn_dtree[K2(t)*2]++),e.sym_next===e.sym_end);var zO=AO,IO=nb,OO=MO,PO=DO,FO=TO,RO={_tr_init:zO,_tr_stored_block:IO,_tr_flush_block:OO,_tr_tally:PO,_tr_align:FO},gl=(e,t,r,n)=>{let a=e&65535|0,i=e>>>16&65535|0,o=0;for(;r!==0;){o=r>2e3?2e3:r,r-=o;do a=a+t[n++]|0,i=i+a|0;while(--o);a%=65521,i%=65521}return a|i<<16|0};const LO=()=>{let e,t=[];for(var r=0;r<256;r++){e=r;for(var n=0;n<8;n++)e=e&1?3988292384^e>>>1:e>>>1;t[r]=e}return t},BO=new Uint32Array(LO());var Gr=(e,t,r,n)=>{const a=BO,i=n+r;e^=-1;for(let o=n;o<i;o++)e=e>>>8^a[(e^t[o])&255];return e^-1},vo={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},xc={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_UNKNOWN:2,Z_DEFLATED:8};const{_tr_init:$O,_tr_stored_block:Wd,_tr_flush_block:NO,_tr_tally:Bi,_tr_align:UO}=RO,{Z_NO_FLUSH:$i,Z_PARTIAL_FLUSH:HO,Z_FULL_FLUSH:jO,Z_FINISH:Kn,Z_BLOCK:ab,Z_OK:Zr,Z_STREAM_END:ib,Z_STREAM_ERROR:Ra,Z_DATA_ERROR:GO,Z_BUF_ERROR:Yd,Z_DEFAULT_COMPRESSION:VO,Z_FILTERED:qO,Z_HUFFMAN_ONLY:wc,Z_RLE:KO,Z_FIXED:WO,Z_DEFAULT_STRATEGY:YO,Z_UNKNOWN:XO,Z_DEFLATED:kc}=xc,ZO=9,JO=15,QO=8,Xd=256+1+29,eP=30,tP=19,rP=2*Xd+1,nP=15,jt=3,Ni=258,La=Ni+jt+1,aP=32,ns=42,Zd=57,Jd=69,Qd=73,ep=91,tp=103,mo=113,bl=666,mn=1,as=2,go=3,is=4,iP=3,bo=(e,t)=>(e.msg=vo[t],t),ob=e=>e*2-(e>4?9:0),Ui=e=>{let t=e.length;for(;--t>=0;)e[t]=0},oP=e=>{let t,r,n,a=e.w_size;t=e.hash_size,n=t;do r=e.head[--n],e.head[n]=r>=a?r-a:0;while(--t);t=a,n=t;do r=e.prev[--n],e.prev[n]=r>=a?r-a:0;while(--t)};let Hi=(e,t,r)=>(t<<e.hash_shift^r)&e.hash_mask;const Dn=e=>{const t=e.state;let r=t.pending;r>e.avail_out&&(r=e.avail_out),r!==0&&(e.output.set(t.pending_buf.subarray(t.pending_out,t.pending_out+r),e.next_out),e.next_out+=r,t.pending_out+=r,e.total_out+=r,e.avail_out-=r,t.pending-=r,t.pending===0&&(t.pending_out=0))},zn=(e,t)=>{NO(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,Dn(e.strm)},ar=(e,t)=>{e.pending_buf[e.pending++]=t},yl=(e,t)=>{e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=t&255},rp=(e,t,r,n)=>{let a=e.avail_in;return a>n&&(a=n),a===0?0:(e.avail_in-=a,t.set(e.input.subarray(e.next_in,e.next_in+a),r),e.state.wrap===1?e.adler=gl(e.adler,t,a,r):e.state.wrap===2&&(e.adler=Gr(e.adler,t,a,r)),e.next_in+=a,e.total_in+=a,a)},sb=(e,t)=>{let r=e.max_chain_length,n=e.strstart,a,i,o=e.prev_length,s=e.nice_match;const l=e.strstart>e.w_size-La?e.strstart-(e.w_size-La):0,c=e.window,u=e.w_mask,d=e.prev,f=e.strstart+Ni;let p=c[n+o-1],_=c[n+o];e.prev_length>=e.good_match&&(r>>=2),s>e.lookahead&&(s=e.lookahead);do if(a=t,!(c[a+o]!==_||c[a+o-1]!==p||c[a]!==c[n]||c[++a]!==c[n+1])){n+=2,a++;do;while(c[++n]===c[++a]&&c[++n]===c[++a]&&c[++n]===c[++a]&&c[++n]===c[++a]&&c[++n]===c[++a]&&c[++n]===c[++a]&&c[++n]===c[++a]&&c[++n]===c[++a]&&n<f);if(i=Ni-(f-n),n=f-Ni,i>o){if(e.match_start=t,o=i,i>=s)break;p=c[n+o-1],_=c[n+o]}}while((t=d[t&u])>l&&--r!==0);return o<=e.lookahead?o:e.lookahead},os=e=>{const t=e.w_size;let r,n,a;do{if(n=e.window_size-e.lookahead-e.strstart,e.strstart>=t+(t-La)&&(e.window.set(e.window.subarray(t,t+t-n),0),e.match_start-=t,e.strstart-=t,e.block_start-=t,e.insert>e.strstart&&(e.insert=e.strstart),oP(e),n+=t),e.strm.avail_in===0)break;if(r=rp(e.strm,e.window,e.strstart+e.lookahead,n),e.lookahead+=r,e.lookahead+e.insert>=jt)for(a=e.strstart-e.insert,e.ins_h=e.window[a],e.ins_h=Hi(e,e.ins_h,e.window[a+1]);e.insert&&(e.ins_h=Hi(e,e.ins_h,e.window[a+jt-1]),e.prev[a&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=a,a++,e.insert--,!(e.lookahead+e.insert<jt)););}while(e.lookahead<La&&e.strm.avail_in!==0)},lb=(e,t)=>{let r=e.pending_buf_size-5>e.w_size?e.w_size:e.pending_buf_size-5,n,a,i,o=0,s=e.strm.avail_in;do{if(n=65535,i=e.bi_valid+42>>3,e.strm.avail_out<i||(i=e.strm.avail_out-i,a=e.strstart-e.block_start,n>a+e.strm.avail_in&&(n=a+e.strm.avail_in),n>i&&(n=i),n<r&&(n===0&&t!==Kn||t===$i||n!==a+e.strm.avail_in)))break;o=t===Kn&&n===a+e.strm.avail_in?1:0,Wd(e,0,0,o),e.pending_buf[e.pending-4]=n,e.pending_buf[e.pending-3]=n>>8,e.pending_buf[e.pending-2]=~n,e.pending_buf[e.pending-1]=~n>>8,Dn(e.strm),a&&(a>n&&(a=n),e.strm.output.set(e.window.subarray(e.block_start,e.block_start+a),e.strm.next_out),e.strm.next_out+=a,e.strm.avail_out-=a,e.strm.total_out+=a,e.block_start+=a,n-=a),n&&(rp(e.strm,e.strm.output,e.strm.next_out,n),e.strm.next_out+=n,e.strm.avail_out-=n,e.strm.total_out+=n)}while(o===0);return s-=e.strm.avail_in,s&&(s>=e.w_size?(e.matches=2,e.window.set(e.strm.input.subarray(e.strm.next_in-e.w_size,e.strm.next_in),0),e.strstart=e.w_size,e.insert=e.strstart):(e.window_size-e.strstart<=s&&(e.strstart-=e.w_size,e.window.set(e.window.subarray(e.w_size,e.w_size+e.strstart),0),e.matches<2&&e.matches++,e.insert>e.strstart&&(e.insert=e.strstart)),e.window.set(e.strm.input.subarray(e.strm.next_in-s,e.strm.next_in),e.strstart),e.strstart+=s,e.insert+=s>e.w_size-e.insert?e.w_size-e.insert:s),e.block_start=e.strstart),e.high_water<e.strstart&&(e.high_water=e.strstart),o?is:t!==$i&&t!==Kn&&e.strm.avail_in===0&&e.strstart===e.block_start?as:(i=e.window_size-e.strstart,e.strm.avail_in>i&&e.block_start>=e.w_size&&(e.block_start-=e.w_size,e.strstart-=e.w_size,e.window.set(e.window.subarray(e.w_size,e.w_size+e.strstart),0),e.matches<2&&e.matches++,i+=e.w_size,e.insert>e.strstart&&(e.insert=e.strstart)),i>e.strm.avail_in&&(i=e.strm.avail_in),i&&(rp(e.strm,e.window,e.strstart,i),e.strstart+=i,e.insert+=i>e.w_size-e.insert?e.w_size-e.insert:i),e.high_water<e.strstart&&(e.high_water=e.strstart),i=e.bi_valid+42>>3,i=e.pending_buf_size-i>65535?65535:e.pending_buf_size-i,r=i>e.w_size?e.w_size:i,a=e.strstart-e.block_start,(a>=r||(a||t===Kn)&&t!==$i&&e.strm.avail_in===0&&a<=i)&&(n=a>i?i:a,o=t===Kn&&e.strm.avail_in===0&&n===a?1:0,Wd(e,e.block_start,n,o),e.block_start+=n,Dn(e.strm)),o?go:mn)},np=(e,t)=>{let r,n;for(;;){if(e.lookahead<La){if(os(e),e.lookahead<La&&t===$i)return mn;if(e.lookahead===0)break}if(r=0,e.lookahead>=jt&&(e.ins_h=Hi(e,e.ins_h,e.window[e.strstart+jt-1]),r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),r!==0&&e.strstart-r<=e.w_size-La&&(e.match_length=sb(e,r)),e.match_length>=jt)if(n=Bi(e,e.strstart-e.match_start,e.match_length-jt),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=jt){e.match_length--;do e.strstart++,e.ins_h=Hi(e,e.ins_h,e.window[e.strstart+jt-1]),r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart;while(--e.match_length!==0);e.strstart++}else e.strstart+=e.match_length,e.match_length=0,e.ins_h=e.window[e.strstart],e.ins_h=Hi(e,e.ins_h,e.window[e.strstart+1]);else n=Bi(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++;if(n&&(zn(e,!1),e.strm.avail_out===0))return mn}return e.insert=e.strstart<jt-1?e.strstart:jt-1,t===Kn?(zn(e,!0),e.strm.avail_out===0?go:is):e.sym_next&&(zn(e,!1),e.strm.avail_out===0)?mn:as},ss=(e,t)=>{let r,n,a;for(;;){if(e.lookahead<La){if(os(e),e.lookahead<La&&t===$i)return mn;if(e.lookahead===0)break}if(r=0,e.lookahead>=jt&&(e.ins_h=Hi(e,e.ins_h,e.window[e.strstart+jt-1]),r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),e.prev_length=e.match_length,e.prev_match=e.match_start,e.match_length=jt-1,r!==0&&e.prev_length<e.max_lazy_match&&e.strstart-r<=e.w_size-La&&(e.match_length=sb(e,r),e.match_length<=5&&(e.strategy===qO||e.match_length===jt&&e.strstart-e.match_start>4096)&&(e.match_length=jt-1)),e.prev_length>=jt&&e.match_length<=e.prev_length){a=e.strstart+e.lookahead-jt,n=Bi(e,e.strstart-1-e.prev_match,e.prev_length-jt),e.lookahead-=e.prev_length-1,e.prev_length-=2;do++e.strstart<=a&&(e.ins_h=Hi(e,e.ins_h,e.window[e.strstart+jt-1]),r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart);while(--e.prev_length!==0);if(e.match_available=0,e.match_length=jt-1,e.strstart++,n&&(zn(e,!1),e.strm.avail_out===0))return mn}else if(e.match_available){if(n=Bi(e,0,e.window[e.strstart-1]),n&&zn(e,!1),e.strstart++,e.lookahead--,e.strm.avail_out===0)return mn}else e.match_available=1,e.strstart++,e.lookahead--}return e.match_available&&(n=Bi(e,0,e.window[e.strstart-1]),e.match_available=0),e.insert=e.strstart<jt-1?e.strstart:jt-1,t===Kn?(zn(e,!0),e.strm.avail_out===0?go:is):e.sym_next&&(zn(e,!1),e.strm.avail_out===0)?mn:as},sP=(e,t)=>{let r,n,a,i;const o=e.window;for(;;){if(e.lookahead<=Ni){if(os(e),e.lookahead<=Ni&&t===$i)return mn;if(e.lookahead===0)break}if(e.match_length=0,e.lookahead>=jt&&e.strstart>0&&(a=e.strstart-1,n=o[a],n===o[++a]&&n===o[++a]&&n===o[++a])){i=e.strstart+Ni;do;while(n===o[++a]&&n===o[++a]&&n===o[++a]&&n===o[++a]&&n===o[++a]&&n===o[++a]&&n===o[++a]&&n===o[++a]&&a<i);e.match_length=Ni-(i-a),e.match_length>e.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=jt?(r=Bi(e,1,e.match_length-jt),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(r=Bi(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),r&&(zn(e,!1),e.strm.avail_out===0))return mn}return e.insert=0,t===Kn?(zn(e,!0),e.strm.avail_out===0?go:is):e.sym_next&&(zn(e,!1),e.strm.avail_out===0)?mn:as},lP=(e,t)=>{let r;for(;;){if(e.lookahead===0&&(os(e),e.lookahead===0)){if(t===$i)return mn;break}if(e.match_length=0,r=Bi(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,r&&(zn(e,!1),e.strm.avail_out===0))return mn}return e.insert=0,t===Kn?(zn(e,!0),e.strm.avail_out===0?go:is):e.sym_next&&(zn(e,!1),e.strm.avail_out===0)?mn:as};function Ba(e,t,r,n,a){this.good_length=e,this.max_lazy=t,this.nice_length=r,this.max_chain=n,this.func=a}const _l=[new Ba(0,0,0,0,lb),new Ba(4,4,8,4,np),new Ba(4,5,16,8,np),new Ba(4,6,32,32,np),new Ba(4,4,16,16,ss),new Ba(8,16,32,32,ss),new Ba(8,16,128,128,ss),new Ba(8,32,128,256,ss),new Ba(32,128,258,1024,ss),new Ba(32,258,258,4096,ss)],cP=e=>{e.window_size=2*e.w_size,Ui(e.head),e.max_lazy_match=_l[e.level].max_lazy,e.good_match=_l[e.level].good_length,e.nice_match=_l[e.level].nice_length,e.max_chain_length=_l[e.level].max_chain,e.strstart=0,e.block_start=0,e.lookahead=0,e.insert=0,e.match_length=e.prev_length=jt-1,e.match_available=0,e.ins_h=0};function uP(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=kc,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Uint16Array(rP*2),this.dyn_dtree=new Uint16Array((2*eP+1)*2),this.bl_tree=new Uint16Array((2*tP+1)*2),Ui(this.dyn_ltree),Ui(this.dyn_dtree),Ui(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(nP+1),this.heap=new Uint16Array(2*Xd+1),Ui(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(2*Xd+1),Ui(this.depth),this.sym_buf=0,this.lit_bufsize=0,this.sym_next=0,this.sym_end=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}const xl=e=>{if(!e)return 1;const t=e.state;return!t||t.strm!==e||t.status!==ns&&t.status!==Zd&&t.status!==Jd&&t.status!==Qd&&t.status!==ep&&t.status!==tp&&t.status!==mo&&t.status!==bl?1:0},cb=e=>{if(xl(e))return bo(e,Ra);e.total_in=e.total_out=0,e.data_type=XO;const t=e.state;return t.pending=0,t.pending_out=0,t.wrap<0&&(t.wrap=-t.wrap),t.status=t.wrap===2?Zd:t.wrap?ns:mo,e.adler=t.wrap===2?0:1,t.last_flush=-2,$O(t),Zr},ub=e=>{const t=cb(e);return t===Zr&&cP(e.state),t},fP=(e,t)=>xl(e)||e.state.wrap!==2?Ra:(e.state.gzhead=t,Zr),fb=(e,t,r,n,a,i)=>{if(!e)return Ra;let o=1;if(t===VO&&(t=6),n<0?(o=0,n=-n):n>15&&(o=2,n-=16),a<1||a>ZO||r!==kc||n<8||n>15||t<0||t>9||i<0||i>WO||n===8&&o!==1)return bo(e,Ra);n===8&&(n=9);const s=new uP;return e.state=s,s.strm=e,s.status=ns,s.wrap=o,s.gzhead=null,s.w_bits=n,s.w_size=1<<s.w_bits,s.w_mask=s.w_size-1,s.hash_bits=a+7,s.hash_size=1<<s.hash_bits,s.hash_mask=s.hash_size-1,s.hash_shift=~~((s.hash_bits+jt-1)/jt),s.window=new Uint8Array(s.w_size*2),s.head=new Uint16Array(s.hash_size),s.prev=new Uint16Array(s.w_size),s.lit_bufsize=1<<a+6,s.pending_buf_size=s.lit_bufsize*4,s.pending_buf=new Uint8Array(s.pending_buf_size),s.sym_buf=s.lit_bufsize,s.sym_end=(s.lit_bufsize-1)*3,s.level=t,s.strategy=i,s.method=r,ub(e)},dP=(e,t)=>fb(e,t,kc,JO,QO,YO),pP=(e,t)=>{if(xl(e)||t>ab||t<0)return e?bo(e,Ra):Ra;const r=e.state;if(!e.output||e.avail_in!==0&&!e.input||r.status===bl&&t!==Kn)return bo(e,e.avail_out===0?Yd:Ra);const n=r.last_flush;if(r.last_flush=t,r.pending!==0){if(Dn(e),e.avail_out===0)return r.last_flush=-1,Zr}else if(e.avail_in===0&&ob(t)<=ob(n)&&t!==Kn)return bo(e,Yd);if(r.status===bl&&e.avail_in!==0)return bo(e,Yd);if(r.status===ns&&r.wrap===0&&(r.status=mo),r.status===ns){let a=kc+(r.w_bits-8<<4)<<8,i=-1;if(r.strategy>=wc||r.level<2?i=0:r.level<6?i=1:r.level===6?i=2:i=3,a|=i<<6,r.strstart!==0&&(a|=aP),a+=31-a%31,yl(r,a),r.strstart!==0&&(yl(r,e.adler>>>16),yl(r,e.adler&65535)),e.adler=1,r.status=mo,Dn(e),r.pending!==0)return r.last_flush=-1,Zr}if(r.status===Zd){if(e.adler=0,ar(r,31),ar(r,139),ar(r,8),r.gzhead)ar(r,(r.gzhead.text?1:0)+(r.gzhead.hcrc?2:0)+(r.gzhead.extra?4:0)+(r.gzhead.name?8:0)+(r.gzhead.comment?16:0)),ar(r,r.gzhead.time&255),ar(r,r.gzhead.time>>8&255),ar(r,r.gzhead.time>>16&255),ar(r,r.gzhead.time>>24&255),ar(r,r.level===9?2:r.strategy>=wc||r.level<2?4:0),ar(r,r.gzhead.os&255),r.gzhead.extra&&r.gzhead.extra.length&&(ar(r,r.gzhead.extra.length&255),ar(r,r.gzhead.extra.length>>8&255)),r.gzhead.hcrc&&(e.adler=Gr(e.adler,r.pending_buf,r.pending,0)),r.gzindex=0,r.status=Jd;else if(ar(r,0),ar(r,0),ar(r,0),ar(r,0),ar(r,0),ar(r,r.level===9?2:r.strategy>=wc||r.level<2?4:0),ar(r,iP),r.status=mo,Dn(e),r.pending!==0)return r.last_flush=-1,Zr}if(r.status===Jd){if(r.gzhead.extra){let a=r.pending,i=(r.gzhead.extra.length&65535)-r.gzindex;for(;r.pending+i>r.pending_buf_size;){let s=r.pending_buf_size-r.pending;if(r.pending_buf.set(r.gzhead.extra.subarray(r.gzindex,r.gzindex+s),r.pending),r.pending=r.pending_buf_size,r.gzhead.hcrc&&r.pending>a&&(e.adler=Gr(e.adler,r.pending_buf,r.pending-a,a)),r.gzindex+=s,Dn(e),r.pending!==0)return r.last_flush=-1,Zr;a=0,i-=s}let o=new Uint8Array(r.gzhead.extra);r.pending_buf.set(o.subarray(r.gzindex,r.gzindex+i),r.pending),r.pending+=i,r.gzhead.hcrc&&r.pending>a&&(e.adler=Gr(e.adler,r.pending_buf,r.pending-a,a)),r.gzindex=0}r.status=Qd}if(r.status===Qd){if(r.gzhead.name){let a=r.pending,i;do{if(r.pending===r.pending_buf_size){if(r.gzhead.hcrc&&r.pending>a&&(e.adler=Gr(e.adler,r.pending_buf,r.pending-a,a)),Dn(e),r.pending!==0)return r.last_flush=-1,Zr;a=0}r.gzindex<r.gzhead.name.length?i=r.gzhead.name.charCodeAt(r.gzindex++)&255:i=0,ar(r,i)}while(i!==0);r.gzhead.hcrc&&r.pending>a&&(e.adler=Gr(e.adler,r.pending_buf,r.pending-a,a)),r.gzindex=0}r.status=ep}if(r.status===ep){if(r.gzhead.comment){let a=r.pending,i;do{if(r.pending===r.pending_buf_size){if(r.gzhead.hcrc&&r.pending>a&&(e.adler=Gr(e.adler,r.pending_buf,r.pending-a,a)),Dn(e),r.pending!==0)return r.last_flush=-1,Zr;a=0}r.gzindex<r.gzhead.comment.length?i=r.gzhead.comment.charCodeAt(r.gzindex++)&255:i=0,ar(r,i)}while(i!==0);r.gzhead.hcrc&&r.pending>a&&(e.adler=Gr(e.adler,r.pending_buf,r.pending-a,a))}r.status=tp}if(r.status===tp){if(r.gzhead.hcrc){if(r.pending+2>r.pending_buf_size&&(Dn(e),r.pending!==0))return r.last_flush=-1,Zr;ar(r,e.adler&255),ar(r,e.adler>>8&255),e.adler=0}if(r.status=mo,Dn(e),r.pending!==0)return r.last_flush=-1,Zr}if(e.avail_in!==0||r.lookahead!==0||t!==$i&&r.status!==bl){let a=r.level===0?lb(r,t):r.strategy===wc?lP(r,t):r.strategy===KO?sP(r,t):_l[r.level].func(r,t);if((a===go||a===is)&&(r.status=bl),a===mn||a===go)return e.avail_out===0&&(r.last_flush=-1),Zr;if(a===as&&(t===HO?UO(r):t!==ab&&(Wd(r,0,0,!1),t===jO&&(Ui(r.head),r.lookahead===0&&(r.strstart=0,r.block_start=0,r.insert=0))),Dn(e),e.avail_out===0))return r.last_flush=-1,Zr}return t!==Kn?Zr:r.wrap<=0?ib:(r.wrap===2?(ar(r,e.adler&255),ar(r,e.adler>>8&255),ar(r,e.adler>>16&255),ar(r,e.adler>>24&255),ar(r,e.total_in&255),ar(r,e.total_in>>8&255),ar(r,e.total_in>>16&255),ar(r,e.total_in>>24&255)):(yl(r,e.adler>>>16),yl(r,e.adler&65535)),Dn(e),r.wrap>0&&(r.wrap=-r.wrap),r.pending!==0?Zr:ib)},hP=e=>{if(xl(e))return Ra;const t=e.state.status;return e.state=null,t===mo?bo(e,GO):Zr},vP=(e,t)=>{let r=t.length;if(xl(e))return Ra;const n=e.state,a=n.wrap;if(a===2||a===1&&n.status!==ns||n.lookahead)return Ra;if(a===1&&(e.adler=gl(e.adler,t,r,0)),n.wrap=0,r>=n.w_size){a===0&&(Ui(n.head),n.strstart=0,n.block_start=0,n.insert=0);let l=new Uint8Array(n.w_size);l.set(t.subarray(r-n.w_size,r),0),t=l,r=n.w_size}const i=e.avail_in,o=e.next_in,s=e.input;for(e.avail_in=r,e.next_in=0,e.input=t,os(n);n.lookahead>=jt;){let l=n.strstart,c=n.lookahead-(jt-1);do n.ins_h=Hi(n,n.ins_h,n.window[l+jt-1]),n.prev[l&n.w_mask]=n.head[n.ins_h],n.head[n.ins_h]=l,l++;while(--c);n.strstart=l,n.lookahead=jt-1,os(n)}return n.strstart+=n.lookahead,n.block_start=n.strstart,n.insert=n.lookahead,n.lookahead=0,n.match_length=n.prev_length=jt-1,n.match_available=0,e.next_in=o,e.input=s,e.avail_in=i,n.wrap=a,Zr};var mP=dP,gP=fb,bP=ub,yP=cb,_P=fP,xP=pP,wP=hP,kP=vP,SP="pako deflate (from Nodeca project)",wl={deflateInit:mP,deflateInit2:gP,deflateReset:bP,deflateResetKeep:yP,deflateSetHeader:_P,deflate:xP,deflateEnd:wP,deflateSetDictionary:kP,deflateInfo:SP};const CP=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var EP=function(e){const t=Array.prototype.slice.call(arguments,1);for(;t.length;){const r=t.shift();if(r){if(typeof r!="object")throw new TypeError(r+"must be non-object");for(const n in r)CP(r,n)&&(e[n]=r[n])}}return e},AP=e=>{let t=0;for(let n=0,a=e.length;n<a;n++)t+=e[n].length;const r=new Uint8Array(t);for(let n=0,a=0,i=e.length;n<i;n++){let o=e[n];r.set(o,a),a+=o.length}return r},Sc={assign:EP,flattenChunks:AP};let db=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{db=!1}const kl=new Uint8Array(256);for(let e=0;e<256;e++)kl[e]=e>=252?6:e>=248?5:e>=240?4:e>=224?3:e>=192?2:1;kl[254]=kl[254]=1;var TP=e=>{if(typeof TextEncoder=="function"&&TextEncoder.prototype.encode)return new TextEncoder().encode(e);let t,r,n,a,i,o=e.length,s=0;for(a=0;a<o;a++)r=e.charCodeAt(a),(r&64512)===55296&&a+1<o&&(n=e.charCodeAt(a+1),(n&64512)===56320&&(r=65536+(r-55296<<10)+(n-56320),a++)),s+=r<128?1:r<2048?2:r<65536?3:4;for(t=new Uint8Array(s),i=0,a=0;i<s;a++)r=e.charCodeAt(a),(r&64512)===55296&&a+1<o&&(n=e.charCodeAt(a+1),(n&64512)===56320&&(r=65536+(r-55296<<10)+(n-56320),a++)),r<128?t[i++]=r:r<2048?(t[i++]=192|r>>>6,t[i++]=128|r&63):r<65536?(t[i++]=224|r>>>12,t[i++]=128|r>>>6&63,t[i++]=128|r&63):(t[i++]=240|r>>>18,t[i++]=128|r>>>12&63,t[i++]=128|r>>>6&63,t[i++]=128|r&63);return t};const MP=(e,t)=>{if(t<65534&&e.subarray&&db)return String.fromCharCode.apply(null,e.length===t?e:e.subarray(0,t));let r="";for(let n=0;n<t;n++)r+=String.fromCharCode(e[n]);return r};var DP=(e,t)=>{const r=t||e.length;if(typeof TextDecoder=="function"&&TextDecoder.prototype.decode)return new TextDecoder().decode(e.subarray(0,t));let n,a;const i=new Array(r*2);for(a=0,n=0;n<r;){let o=e[n++];if(o<128){i[a++]=o;continue}let s=kl[o];if(s>4){i[a++]=65533,n+=s-1;continue}for(o&=s===2?31:s===3?15:7;s>1&&n<r;)o=o<<6|e[n++]&63,s--;if(s>1){i[a++]=65533;continue}o<65536?i[a++]=o:(o-=65536,i[a++]=55296|o>>10&1023,i[a++]=56320|o&1023)}return MP(i,a)},zP=(e,t)=>{t=t||e.length,t>e.length&&(t=e.length);let r=t-1;for(;r>=0&&(e[r]&192)===128;)r--;return r<0||r===0?t:r+kl[e[r]]>t?r:t},Sl={string2buf:TP,buf2string:DP,utf8border:zP};function IP(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}var pb=IP;const hb=Object.prototype.toString,{Z_NO_FLUSH:OP,Z_SYNC_FLUSH:PP,Z_FULL_FLUSH:FP,Z_FINISH:RP,Z_OK:Cc,Z_STREAM_END:LP,Z_DEFAULT_COMPRESSION:BP,Z_DEFAULT_STRATEGY:$P,Z_DEFLATED:NP}=xc;function Ec(e){this.options=Sc.assign({level:BP,method:NP,chunkSize:16384,windowBits:15,memLevel:8,strategy:$P},e||{});let t=this.options;t.raw&&t.windowBits>0?t.windowBits=-t.windowBits:t.gzip&&t.windowBits>0&&t.windowBits<16&&(t.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new pb,this.strm.avail_out=0;let r=wl.deflateInit2(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy);if(r!==Cc)throw new Error(vo[r]);if(t.header&&wl.deflateSetHeader(this.strm,t.header),t.dictionary){let n;if(typeof t.dictionary=="string"?n=Sl.string2buf(t.dictionary):hb.call(t.dictionary)==="[object ArrayBuffer]"?n=new Uint8Array(t.dictionary):n=t.dictionary,r=wl.deflateSetDictionary(this.strm,n),r!==Cc)throw new Error(vo[r]);this._dict_set=!0}}Ec.prototype.push=function(e,t){const r=this.strm,n=this.options.chunkSize;let a,i;if(this.ended)return!1;for(t===~~t?i=t:i=t===!0?RP:OP,typeof e=="string"?r.input=Sl.string2buf(e):hb.call(e)==="[object ArrayBuffer]"?r.input=new Uint8Array(e):r.input=e,r.next_in=0,r.avail_in=r.input.length;;){if(r.avail_out===0&&(r.output=new Uint8Array(n),r.next_out=0,r.avail_out=n),(i===PP||i===FP)&&r.avail_out<=6){this.onData(r.output.subarray(0,r.next_out)),r.avail_out=0;continue}if(a=wl.deflate(r,i),a===LP)return r.next_out>0&&this.onData(r.output.subarray(0,r.next_out)),a=wl.deflateEnd(this.strm),this.onEnd(a),this.ended=!0,a===Cc;if(r.avail_out===0){this.onData(r.output);continue}if(i>0&&r.next_out>0){this.onData(r.output.subarray(0,r.next_out)),r.avail_out=0;continue}if(r.avail_in===0)break}return!0},Ec.prototype.onData=function(e){this.chunks.push(e)},Ec.prototype.onEnd=function(e){e===Cc&&(this.result=Sc.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};function UP(e,t){const r=new Ec(t);if(r.push(e,!0),r.err)throw r.msg||vo[r.err];return r.result}var HP=UP,jP={deflate:HP};const Ac=16209,GP=16191;var VP=function(t,r){let n,a,i,o,s,l,c,u,d,f,p,_,h,b,v,m,y,g,S,M,E,w,x,C;const D=t.state;n=t.next_in,x=t.input,a=n+(t.avail_in-5),i=t.next_out,C=t.output,o=i-(r-t.avail_out),s=i+(t.avail_out-257),l=D.dmax,c=D.wsize,u=D.whave,d=D.wnext,f=D.window,p=D.hold,_=D.bits,h=D.lencode,b=D.distcode,v=(1<<D.lenbits)-1,m=(1<<D.distbits)-1;e:do{_<15&&(p+=x[n++]<<_,_+=8,p+=x[n++]<<_,_+=8),y=h[p&v];t:for(;;){if(g=y>>>24,p>>>=g,_-=g,g=y>>>16&255,g===0)C[i++]=y&65535;else if(g&16){S=y&65535,g&=15,g&&(_<g&&(p+=x[n++]<<_,_+=8),S+=p&(1<<g)-1,p>>>=g,_-=g),_<15&&(p+=x[n++]<<_,_+=8,p+=x[n++]<<_,_+=8),y=b[p&m];r:for(;;){if(g=y>>>24,p>>>=g,_-=g,g=y>>>16&255,g&16){if(M=y&65535,g&=15,_<g&&(p+=x[n++]<<_,_+=8,_<g&&(p+=x[n++]<<_,_+=8)),M+=p&(1<<g)-1,M>l){t.msg="invalid distance too far back",D.mode=Ac;break e}if(p>>>=g,_-=g,g=i-o,M>g){if(g=M-g,g>u&&D.sane){t.msg="invalid distance too far back",D.mode=Ac;break e}if(E=0,w=f,d===0){if(E+=c-g,g<S){S-=g;do C[i++]=f[E++];while(--g);E=i-M,w=C}}else if(d<g){if(E+=c+d-g,g-=d,g<S){S-=g;do C[i++]=f[E++];while(--g);if(E=0,d<S){g=d,S-=g;do C[i++]=f[E++];while(--g);E=i-M,w=C}}}else if(E+=d-g,g<S){S-=g;do C[i++]=f[E++];while(--g);E=i-M,w=C}for(;S>2;)C[i++]=w[E++],C[i++]=w[E++],C[i++]=w[E++],S-=3;S&&(C[i++]=w[E++],S>1&&(C[i++]=w[E++]))}else{E=i-M;do C[i++]=C[E++],C[i++]=C[E++],C[i++]=C[E++],S-=3;while(S>2);S&&(C[i++]=C[E++],S>1&&(C[i++]=C[E++]))}}else if(g&64){t.msg="invalid distance code",D.mode=Ac;break e}else{y=b[(y&65535)+(p&(1<<g)-1)];continue r}break}}else if(g&64)if(g&32){D.mode=GP;break e}else{t.msg="invalid literal/length code",D.mode=Ac;break e}else{y=h[(y&65535)+(p&(1<<g)-1)];continue t}break}}while(n<a&&i<s);S=_>>3,n-=S,_-=S<<3,p&=(1<<_)-1,t.next_in=n,t.next_out=i,t.avail_in=n<a?5+(a-n):5-(n-a),t.avail_out=i<s?257+(s-i):257-(i-s),D.hold=p,D.bits=_};const ls=15,vb=852,mb=592,gb=0,ap=1,bb=2,qP=new Uint16Array([3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0]),KP=new Uint8Array([16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78]),WP=new Uint16Array([1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0]),YP=new Uint8Array([16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64]);var Cl=(e,t,r,n,a,i,o,s)=>{const l=s.bits;let c=0,u=0,d=0,f=0,p=0,_=0,h=0,b=0,v=0,m=0,y,g,S,M,E,w=null,x;const C=new Uint16Array(ls+1),D=new Uint16Array(ls+1);let B=null,F,K,te;for(c=0;c<=ls;c++)C[c]=0;for(u=0;u<n;u++)C[t[r+u]]++;for(p=l,f=ls;f>=1&&C[f]===0;f--);if(p>f&&(p=f),f===0)return a[i++]=1<<24|64<<16|0,a[i++]=1<<24|64<<16|0,s.bits=1,0;for(d=1;d<f&&C[d]===0;d++);for(p<d&&(p=d),b=1,c=1;c<=ls;c++)if(b<<=1,b-=C[c],b<0)return-1;if(b>0&&(e===gb||f!==1))return-1;for(D[1]=0,c=1;c<ls;c++)D[c+1]=D[c]+C[c];for(u=0;u<n;u++)t[r+u]!==0&&(o[D[t[r+u]]++]=u);if(e===gb?(w=B=o,x=20):e===ap?(w=qP,B=KP,x=257):(w=WP,B=YP,x=0),m=0,u=0,c=d,E=i,_=p,h=0,S=-1,v=1<<p,M=v-1,e===ap&&v>vb||e===bb&&v>mb)return 1;for(;;){F=c-h,o[u]+1<x?(K=0,te=o[u]):o[u]>=x?(K=B[o[u]-x],te=w[o[u]-x]):(K=96,te=0),y=1<<c-h,g=1<<_,d=g;do g-=y,a[E+(m>>h)+g]=F<<24|K<<16|te|0;while(g!==0);for(y=1<<c-1;m&y;)y>>=1;if(y!==0?(m&=y-1,m+=y):m=0,u++,--C[c]===0){if(c===f)break;c=t[r+o[u]]}if(c>p&&(m&M)!==S){for(h===0&&(h=p),E+=d,_=c-h,b=1<<_;_+h<f&&(b-=C[_+h],!(b<=0));)_++,b<<=1;if(v+=1<<_,e===ap&&v>vb||e===bb&&v>mb)return 1;S=m&M,a[S]=p<<24|_<<16|E-i|0}}return m!==0&&(a[E+m]=c-h<<24|64<<16|0),s.bits=p,0};const XP=0,yb=1,_b=2,{Z_FINISH:xb,Z_BLOCK:ZP,Z_TREES:Tc,Z_OK:yo,Z_STREAM_END:JP,Z_NEED_DICT:QP,Z_STREAM_ERROR:Wn,Z_DATA_ERROR:wb,Z_MEM_ERROR:kb,Z_BUF_ERROR:eF,Z_DEFLATED:Sb}=xc,Mc=16180,Cb=16181,Eb=16182,Ab=16183,Tb=16184,Mb=16185,Db=16186,zb=16187,Ib=16188,Ob=16189,Dc=16190,ci=16191,ip=16192,Pb=16193,op=16194,Fb=16195,Rb=16196,Lb=16197,Bb=16198,zc=16199,Ic=16200,$b=16201,Nb=16202,Ub=16203,Hb=16204,jb=16205,sp=16206,Gb=16207,Vb=16208,xr=16209,qb=16210,Kb=16211,tF=852,rF=592,nF=15,Wb=e=>(e>>>24&255)+(e>>>8&65280)+((e&65280)<<8)+((e&255)<<24);function aF(){this.strm=null,this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}const _o=e=>{if(!e)return 1;const t=e.state;return!t||t.strm!==e||t.mode<Mc||t.mode>Kb?1:0},Yb=e=>{if(_o(e))return Wn;const t=e.state;return e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=t.wrap&1),t.mode=Mc,t.last=0,t.havedict=0,t.flags=-1,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new Int32Array(tF),t.distcode=t.distdyn=new Int32Array(rF),t.sane=1,t.back=-1,yo},Xb=e=>{if(_o(e))return Wn;const t=e.state;return t.wsize=0,t.whave=0,t.wnext=0,Yb(e)},Zb=(e,t)=>{let r;if(_o(e))return Wn;const n=e.state;return t<0?(r=0,t=-t):(r=(t>>4)+5,t<48&&(t&=15)),t&&(t<8||t>15)?Wn:(n.window!==null&&n.wbits!==t&&(n.window=null),n.wrap=r,n.wbits=t,Xb(e))},Jb=(e,t)=>{if(!e)return Wn;const r=new aF;e.state=r,r.strm=e,r.window=null,r.mode=Mc;const n=Zb(e,t);return n!==yo&&(e.state=null),n},iF=e=>Jb(e,nF);let Qb=!0,lp,cp;const oF=e=>{if(Qb){lp=new Int32Array(512),cp=new Int32Array(32);let t=0;for(;t<144;)e.lens[t++]=8;for(;t<256;)e.lens[t++]=9;for(;t<280;)e.lens[t++]=7;for(;t<288;)e.lens[t++]=8;for(Cl(yb,e.lens,0,288,lp,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;Cl(_b,e.lens,0,32,cp,0,e.work,{bits:5}),Qb=!1}e.lencode=lp,e.lenbits=9,e.distcode=cp,e.distbits=5},e4=(e,t,r,n)=>{let a;const i=e.state;return i.window===null&&(i.wsize=1<<i.wbits,i.wnext=0,i.whave=0,i.window=new Uint8Array(i.wsize)),n>=i.wsize?(i.window.set(t.subarray(r-i.wsize,r),0),i.wnext=0,i.whave=i.wsize):(a=i.wsize-i.wnext,a>n&&(a=n),i.window.set(t.subarray(r-n,r-n+a),i.wnext),n-=a,n?(i.window.set(t.subarray(r-n,r),0),i.wnext=n,i.whave=i.wsize):(i.wnext+=a,i.wnext===i.wsize&&(i.wnext=0),i.whave<i.wsize&&(i.whave+=a))),0},sF=(e,t)=>{let r,n,a,i,o,s,l,c,u,d,f,p,_,h,b=0,v,m,y,g,S,M,E,w;const x=new Uint8Array(4);let C,D;const B=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(_o(e)||!e.output||!e.input&&e.avail_in!==0)return Wn;r=e.state,r.mode===ci&&(r.mode=ip),o=e.next_out,a=e.output,l=e.avail_out,i=e.next_in,n=e.input,s=e.avail_in,c=r.hold,u=r.bits,d=s,f=l,w=yo;e:for(;;)switch(r.mode){case Mc:if(r.wrap===0){r.mode=ip;break}for(;u<16;){if(s===0)break e;s--,c+=n[i++]<<u,u+=8}if(r.wrap&2&&c===35615){r.wbits===0&&(r.wbits=15),r.check=0,x[0]=c&255,x[1]=c>>>8&255,r.check=Gr(r.check,x,2,0),c=0,u=0,r.mode=Cb;break}if(r.head&&(r.head.done=!1),!(r.wrap&1)||(((c&255)<<8)+(c>>8))%31){e.msg="incorrect header check",r.mode=xr;break}if((c&15)!==Sb){e.msg="unknown compression method",r.mode=xr;break}if(c>>>=4,u-=4,E=(c&15)+8,r.wbits===0&&(r.wbits=E),E>15||E>r.wbits){e.msg="invalid window size",r.mode=xr;break}r.dmax=1<<r.wbits,r.flags=0,e.adler=r.check=1,r.mode=c&512?Ob:ci,c=0,u=0;break;case Cb:for(;u<16;){if(s===0)break e;s--,c+=n[i++]<<u,u+=8}if(r.flags=c,(r.flags&255)!==Sb){e.msg="unknown compression method",r.mode=xr;break}if(r.flags&57344){e.msg="unknown header flags set",r.mode=xr;break}r.head&&(r.head.text=c>>8&1),r.flags&512&&r.wrap&4&&(x[0]=c&255,x[1]=c>>>8&255,r.check=Gr(r.check,x,2,0)),c=0,u=0,r.mode=Eb;case Eb:for(;u<32;){if(s===0)break e;s--,c+=n[i++]<<u,u+=8}r.head&&(r.head.time=c),r.flags&512&&r.wrap&4&&(x[0]=c&255,x[1]=c>>>8&255,x[2]=c>>>16&255,x[3]=c>>>24&255,r.check=Gr(r.check,x,4,0)),c=0,u=0,r.mode=Ab;case Ab:for(;u<16;){if(s===0)break e;s--,c+=n[i++]<<u,u+=8}r.head&&(r.head.xflags=c&255,r.head.os=c>>8),r.flags&512&&r.wrap&4&&(x[0]=c&255,x[1]=c>>>8&255,r.check=Gr(r.check,x,2,0)),c=0,u=0,r.mode=Tb;case Tb:if(r.flags&1024){for(;u<16;){if(s===0)break e;s--,c+=n[i++]<<u,u+=8}r.length=c,r.head&&(r.head.extra_len=c),r.flags&512&&r.wrap&4&&(x[0]=c&255,x[1]=c>>>8&255,r.check=Gr(r.check,x,2,0)),c=0,u=0}else r.head&&(r.head.extra=null);r.mode=Mb;case Mb:if(r.flags&1024&&(p=r.length,p>s&&(p=s),p&&(r.head&&(E=r.head.extra_len-r.length,r.head.extra||(r.head.extra=new Uint8Array(r.head.extra_len)),r.head.extra.set(n.subarray(i,i+p),E)),r.flags&512&&r.wrap&4&&(r.check=Gr(r.check,n,p,i)),s-=p,i+=p,r.length-=p),r.length))break e;r.length=0,r.mode=Db;case Db:if(r.flags&2048){if(s===0)break e;p=0;do E=n[i+p++],r.head&&E&&r.length<65536&&(r.head.name+=String.fromCharCode(E));while(E&&p<s);if(r.flags&512&&r.wrap&4&&(r.check=Gr(r.check,n,p,i)),s-=p,i+=p,E)break e}else r.head&&(r.head.name=null);r.length=0,r.mode=zb;case zb:if(r.flags&4096){if(s===0)break e;p=0;do E=n[i+p++],r.head&&E&&r.length<65536&&(r.head.comment+=String.fromCharCode(E));while(E&&p<s);if(r.flags&512&&r.wrap&4&&(r.check=Gr(r.check,n,p,i)),s-=p,i+=p,E)break e}else r.head&&(r.head.comment=null);r.mode=Ib;case Ib:if(r.flags&512){for(;u<16;){if(s===0)break e;s--,c+=n[i++]<<u,u+=8}if(r.wrap&4&&c!==(r.check&65535)){e.msg="header crc mismatch",r.mode=xr;break}c=0,u=0}r.head&&(r.head.hcrc=r.flags>>9&1,r.head.done=!0),e.adler=r.check=0,r.mode=ci;break;case Ob:for(;u<32;){if(s===0)break e;s--,c+=n[i++]<<u,u+=8}e.adler=r.check=Wb(c),c=0,u=0,r.mode=Dc;case Dc:if(r.havedict===0)return e.next_out=o,e.avail_out=l,e.next_in=i,e.avail_in=s,r.hold=c,r.bits=u,QP;e.adler=r.check=1,r.mode=ci;case ci:if(t===ZP||t===Tc)break e;case ip:if(r.last){c>>>=u&7,u-=u&7,r.mode=sp;break}for(;u<3;){if(s===0)break e;s--,c+=n[i++]<<u,u+=8}switch(r.last=c&1,c>>>=1,u-=1,c&3){case 0:r.mode=Pb;break;case 1:if(oF(r),r.mode=zc,t===Tc){c>>>=2,u-=2;break e}break;case 2:r.mode=Rb;break;case 3:e.msg="invalid block type",r.mode=xr}c>>>=2,u-=2;break;case Pb:for(c>>>=u&7,u-=u&7;u<32;){if(s===0)break e;s--,c+=n[i++]<<u,u+=8}if((c&65535)!==(c>>>16^65535)){e.msg="invalid stored block lengths",r.mode=xr;break}if(r.length=c&65535,c=0,u=0,r.mode=op,t===Tc)break e;case op:r.mode=Fb;case Fb:if(p=r.length,p){if(p>s&&(p=s),p>l&&(p=l),p===0)break e;a.set(n.subarray(i,i+p),o),s-=p,i+=p,l-=p,o+=p,r.length-=p;break}r.mode=ci;break;case Rb:for(;u<14;){if(s===0)break e;s--,c+=n[i++]<<u,u+=8}if(r.nlen=(c&31)+257,c>>>=5,u-=5,r.ndist=(c&31)+1,c>>>=5,u-=5,r.ncode=(c&15)+4,c>>>=4,u-=4,r.nlen>286||r.ndist>30){e.msg="too many length or distance symbols",r.mode=xr;break}r.have=0,r.mode=Lb;case Lb:for(;r.have<r.ncode;){for(;u<3;){if(s===0)break e;s--,c+=n[i++]<<u,u+=8}r.lens[B[r.have++]]=c&7,c>>>=3,u-=3}for(;r.have<19;)r.lens[B[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,C={bits:r.lenbits},w=Cl(XP,r.lens,0,19,r.lencode,0,r.work,C),r.lenbits=C.bits,w){e.msg="invalid code lengths set",r.mode=xr;break}r.have=0,r.mode=Bb;case Bb:for(;r.have<r.nlen+r.ndist;){for(;b=r.lencode[c&(1<<r.lenbits)-1],v=b>>>24,m=b>>>16&255,y=b&65535,!(v<=u);){if(s===0)break e;s--,c+=n[i++]<<u,u+=8}if(y<16)c>>>=v,u-=v,r.lens[r.have++]=y;else{if(y===16){for(D=v+2;u<D;){if(s===0)break e;s--,c+=n[i++]<<u,u+=8}if(c>>>=v,u-=v,r.have===0){e.msg="invalid bit length repeat",r.mode=xr;break}E=r.lens[r.have-1],p=3+(c&3),c>>>=2,u-=2}else if(y===17){for(D=v+3;u<D;){if(s===0)break e;s--,c+=n[i++]<<u,u+=8}c>>>=v,u-=v,E=0,p=3+(c&7),c>>>=3,u-=3}else{for(D=v+7;u<D;){if(s===0)break e;s--,c+=n[i++]<<u,u+=8}c>>>=v,u-=v,E=0,p=11+(c&127),c>>>=7,u-=7}if(r.have+p>r.nlen+r.ndist){e.msg="invalid bit length repeat",r.mode=xr;break}for(;p--;)r.lens[r.have++]=E}}if(r.mode===xr)break;if(r.lens[256]===0){e.msg="invalid code -- missing end-of-block",r.mode=xr;break}if(r.lenbits=9,C={bits:r.lenbits},w=Cl(yb,r.lens,0,r.nlen,r.lencode,0,r.work,C),r.lenbits=C.bits,w){e.msg="invalid literal/lengths set",r.mode=xr;break}if(r.distbits=6,r.distcode=r.distdyn,C={bits:r.distbits},w=Cl(_b,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,C),r.distbits=C.bits,w){e.msg="invalid distances set",r.mode=xr;break}if(r.mode=zc,t===Tc)break e;case zc:r.mode=Ic;case Ic:if(s>=6&&l>=258){e.next_out=o,e.avail_out=l,e.next_in=i,e.avail_in=s,r.hold=c,r.bits=u,VP(e,f),o=e.next_out,a=e.output,l=e.avail_out,i=e.next_in,n=e.input,s=e.avail_in,c=r.hold,u=r.bits,r.mode===ci&&(r.back=-1);break}for(r.back=0;b=r.lencode[c&(1<<r.lenbits)-1],v=b>>>24,m=b>>>16&255,y=b&65535,!(v<=u);){if(s===0)break e;s--,c+=n[i++]<<u,u+=8}if(m&&!(m&240)){for(g=v,S=m,M=y;b=r.lencode[M+((c&(1<<g+S)-1)>>g)],v=b>>>24,m=b>>>16&255,y=b&65535,!(g+v<=u);){if(s===0)break e;s--,c+=n[i++]<<u,u+=8}c>>>=g,u-=g,r.back+=g}if(c>>>=v,u-=v,r.back+=v,r.length=y,m===0){r.mode=jb;break}if(m&32){r.back=-1,r.mode=ci;break}if(m&64){e.msg="invalid literal/length code",r.mode=xr;break}r.extra=m&15,r.mode=$b;case $b:if(r.extra){for(D=r.extra;u<D;){if(s===0)break e;s--,c+=n[i++]<<u,u+=8}r.length+=c&(1<<r.extra)-1,c>>>=r.extra,u-=r.extra,r.back+=r.extra}r.was=r.length,r.mode=Nb;case Nb:for(;b=r.distcode[c&(1<<r.distbits)-1],v=b>>>24,m=b>>>16&255,y=b&65535,!(v<=u);){if(s===0)break e;s--,c+=n[i++]<<u,u+=8}if(!(m&240)){for(g=v,S=m,M=y;b=r.distcode[M+((c&(1<<g+S)-1)>>g)],v=b>>>24,m=b>>>16&255,y=b&65535,!(g+v<=u);){if(s===0)break e;s--,c+=n[i++]<<u,u+=8}c>>>=g,u-=g,r.back+=g}if(c>>>=v,u-=v,r.back+=v,m&64){e.msg="invalid distance code",r.mode=xr;break}r.offset=y,r.extra=m&15,r.mode=Ub;case Ub:if(r.extra){for(D=r.extra;u<D;){if(s===0)break e;s--,c+=n[i++]<<u,u+=8}r.offset+=c&(1<<r.extra)-1,c>>>=r.extra,u-=r.extra,r.back+=r.extra}if(r.offset>r.dmax){e.msg="invalid distance too far back",r.mode=xr;break}r.mode=Hb;case Hb:if(l===0)break e;if(p=f-l,r.offset>p){if(p=r.offset-p,p>r.whave&&r.sane){e.msg="invalid distance too far back",r.mode=xr;break}p>r.wnext?(p-=r.wnext,_=r.wsize-p):_=r.wnext-p,p>r.length&&(p=r.length),h=r.window}else h=a,_=o-r.offset,p=r.length;p>l&&(p=l),l-=p,r.length-=p;do a[o++]=h[_++];while(--p);r.length===0&&(r.mode=Ic);break;case jb:if(l===0)break e;a[o++]=r.length,l--,r.mode=Ic;break;case sp:if(r.wrap){for(;u<32;){if(s===0)break e;s--,c|=n[i++]<<u,u+=8}if(f-=l,e.total_out+=f,r.total+=f,r.wrap&4&&f&&(e.adler=r.check=r.flags?Gr(r.check,a,f,o-f):gl(r.check,a,f,o-f)),f=l,r.wrap&4&&(r.flags?c:Wb(c))!==r.check){e.msg="incorrect data check",r.mode=xr;break}c=0,u=0}r.mode=Gb;case Gb:if(r.wrap&&r.flags){for(;u<32;){if(s===0)break e;s--,c+=n[i++]<<u,u+=8}if(r.wrap&4&&c!==(r.total&4294967295)){e.msg="incorrect length check",r.mode=xr;break}c=0,u=0}r.mode=Vb;case Vb:w=JP;break e;case xr:w=wb;break e;case qb:return kb;case Kb:default:return Wn}return e.next_out=o,e.avail_out=l,e.next_in=i,e.avail_in=s,r.hold=c,r.bits=u,(r.wsize||f!==e.avail_out&&r.mode<xr&&(r.mode<sp||t!==xb))&&e4(e,e.output,e.next_out,f-e.avail_out),d-=e.avail_in,f-=e.avail_out,e.total_in+=d,e.total_out+=f,r.total+=f,r.wrap&4&&f&&(e.adler=r.check=r.flags?Gr(r.check,a,f,e.next_out-f):gl(r.check,a,f,e.next_out-f)),e.data_type=r.bits+(r.last?64:0)+(r.mode===ci?128:0)+(r.mode===zc||r.mode===op?256:0),(d===0&&f===0||t===xb)&&w===yo&&(w=eF),w},lF=e=>{if(_o(e))return Wn;let t=e.state;return t.window&&(t.window=null),e.state=null,yo},cF=(e,t)=>{if(_o(e))return Wn;const r=e.state;return r.wrap&2?(r.head=t,t.done=!1,yo):Wn},uF=(e,t)=>{const r=t.length;let n,a,i;return _o(e)||(n=e.state,n.wrap!==0&&n.mode!==Dc)?Wn:n.mode===Dc&&(a=1,a=gl(a,t,r,0),a!==n.check)?wb:(i=e4(e,t,r,r),i?(n.mode=qb,kb):(n.havedict=1,yo))};var fF=Xb,dF=Zb,pF=Yb,hF=iF,vF=Jb,mF=sF,gF=lF,bF=cF,yF=uF,_F="pako inflate (from Nodeca project)",ui={inflateReset:fF,inflateReset2:dF,inflateResetKeep:pF,inflateInit:hF,inflateInit2:vF,inflate:mF,inflateEnd:gF,inflateGetHeader:bF,inflateSetDictionary:yF,inflateInfo:_F};function xF(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}var wF=xF;const t4=Object.prototype.toString,{Z_NO_FLUSH:kF,Z_FINISH:SF,Z_OK:El,Z_STREAM_END:up,Z_NEED_DICT:fp,Z_STREAM_ERROR:CF,Z_DATA_ERROR:r4,Z_MEM_ERROR:EF}=xc;function Oc(e){this.options=Sc.assign({chunkSize:1024*64,windowBits:15,to:""},e||{});const t=this.options;t.raw&&t.windowBits>=0&&t.windowBits<16&&(t.windowBits=-t.windowBits,t.windowBits===0&&(t.windowBits=-15)),t.windowBits>=0&&t.windowBits<16&&!(e&&e.windowBits)&&(t.windowBits+=32),t.windowBits>15&&t.windowBits<48&&(t.windowBits&15||(t.windowBits|=15)),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new pb,this.strm.avail_out=0;let r=ui.inflateInit2(this.strm,t.windowBits);if(r!==El)throw new Error(vo[r]);if(this.header=new wF,ui.inflateGetHeader(this.strm,this.header),t.dictionary&&(typeof t.dictionary=="string"?t.dictionary=Sl.string2buf(t.dictionary):t4.call(t.dictionary)==="[object ArrayBuffer]"&&(t.dictionary=new Uint8Array(t.dictionary)),t.raw&&(r=ui.inflateSetDictionary(this.strm,t.dictionary),r!==El)))throw new Error(vo[r])}Oc.prototype.push=function(e,t){const r=this.strm,n=this.options.chunkSize,a=this.options.dictionary;let i,o,s;if(this.ended)return!1;for(t===~~t?o=t:o=t===!0?SF:kF,t4.call(e)==="[object ArrayBuffer]"?r.input=new Uint8Array(e):r.input=e,r.next_in=0,r.avail_in=r.input.length;;){for(r.avail_out===0&&(r.output=new Uint8Array(n),r.next_out=0,r.avail_out=n),i=ui.inflate(r,o),i===fp&&a&&(i=ui.inflateSetDictionary(r,a),i===El?i=ui.inflate(r,o):i===r4&&(i=fp));r.avail_in>0&&i===up&&r.state.wrap>0&&e[r.next_in]!==0;)ui.inflateReset(r),i=ui.inflate(r,o);switch(i){case CF:case r4:case fp:case EF:return this.onEnd(i),this.ended=!0,!1}if(s=r.avail_out,r.next_out&&(r.avail_out===0||i===up))if(this.options.to==="string"){let l=Sl.utf8border(r.output,r.next_out),c=r.next_out-l,u=Sl.buf2string(r.output,l);r.next_out=c,r.avail_out=n-c,c&&r.output.set(r.output.subarray(l,l+c),0),this.onData(u)}else this.onData(r.output.length===r.next_out?r.output:r.output.subarray(0,r.next_out));if(!(i===El&&s===0)){if(i===up)return i=ui.inflateEnd(this.strm),this.onEnd(i),this.ended=!0,!0;if(r.avail_in===0)break}}return!0},Oc.prototype.onData=function(e){this.chunks.push(e)},Oc.prototype.onEnd=function(e){e===El&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=Sc.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};function AF(e,t){const r=new Oc(t);if(r.push(e),r.err)throw r.msg||vo[r.err];return r.result}var TF=AF,MF={inflate:TF};const{deflate:DF}=jP,{inflate:zF}=MF;var IF=DF,OF=zF,Al=new Int32Array([0,1,8,16,9,2,3,10,17,24,32,25,18,11,4,5,12,19,26,33,40,48,41,34,27,20,13,6,7,14,21,28,35,42,49,56,57,50,43,36,29,22,15,23,30,37,44,51,58,59,52,45,38,31,39,46,53,60,61,54,47,55,62,63]),Pc=4017,Fc=799,Rc=3406,Lc=2276,Bc=1567,$c=3784,cs=5793,Nc=2896,PF=100,n4=64*1024*1024,dp=0;function us(e){var t=dp+e;if(t>n4){var r=Math.ceil((t-n4)/1024/1024);throw new Error("Max memory limit exceeded by at least ".concat(r,"MB"))}dp=t}function FF(e,t){for(var r=16;r>0&&!e[r-1];)r--;for(var n=[{children:[],index:0}],a=0,i=n[0],o=0;o<r;o++){for(var s=0;s<e[o];s++){for(i=n.pop(),i.children[i.index]=t[a];i.index>0;){if(n.length===0)throw new Error("Could not recreate Huffman Table");i=n.pop()}for(i.index++,n.push(i);n.length<=o;){var l={children:[],index:0};n.push(l),i.children[i.index]=l.children,i=l}a++}if(o+1<r){var l={children:[],index:0};n.push(l),i.children[i.index]=l.children,i=l}}return n[0].children}function RF(e,t,r,n,a,i,o,s,l){var c=r.mcusPerLine,u=r.progressive,d=t,f=0,p=0;function _(){if(p>0)return p--,f>>p&1;if(f=e[t++],f==255){var Ee=e[t++];if(Ee)throw new Error("unexpected marker: ".concat((f<<8|Ee).toString(16)))}return p=7,f>>>7}function h(Ee){for(var Ae=Ee;;){if(Ae=Ae[_()],typeof Ae=="number")return Ae;if(Ae===void 0)throw new Error("invalid huffman sequence")}}function b(Ee){for(var Ae=0;Ee>0;)Ae=Ae<<1|_(),Ee--;return Ae}function v(Ee){var Ae=b(Ee);return Ae>=1<<Ee-1?Ae:Ae+(-1<<Ee)+1}function m(Ee,Ae){var ze=h(Ee.huffmanTableDC),Le=ze===0?0:v(ze);Ae[0]=Ee.pred+=Le;for(var he=1;he<64;){var Ie=h(Ee.huffmanTableAC),De=Ie&15,Be=Ie>>4;if(De===0){if(Be<15)break;he+=16;continue}he+=Be;var Z=Al[he];Ae[Z]=v(De),he++}}function y(Ee,Ae){var ze=h(Ee.huffmanTableDC),Le=ze===0?0:v(ze)<<l;Ae[0]=Ee.pred+=Le}function g(Ee,Ae){Ae[0]|=_()<<l}var S=0;function M(Ee,Ae){if(S>0){S--;return}for(var ze=i,Le=o;ze<=Le;){var he=h(Ee.huffmanTableAC),Ie=he&15,De=he>>4;if(Ie===0){if(De<15){S=b(De)+(1<<De)-1;break}ze+=16;continue}ze+=De;var Be=Al[ze];Ae[Be]=v(Ie)*(1<<l),ze++}}var E=0,w=0;function x(Ee,Ae){for(var ze=i,Le=o,he=0;ze<=Le;){var Ie=Al[ze],De=Ae[Ie]<0?-1:1;switch(E){case 0:var Be=h(Ee.huffmanTableAC),Z=Be&15;if(he=Be>>4,Z===0)he<15?(S=b(he)+(1<<he),E=4):(he=16,E=1);else{if(Z!==1)throw new Error("invalid ACn encoding");w=v(Z),E=he?2:3}continue;case 1:case 2:Ae[Ie]?Ae[Ie]+=(_()<<l)*De:(he--,he===0&&(E=E==2?3:0));break;case 3:Ae[Ie]?Ae[Ie]+=(_()<<l)*De:(Ae[Ie]=w<<l,E=0);break;case 4:Ae[Ie]&&(Ae[Ie]+=(_()<<l)*De);break}ze++}E===4&&(S--,S===0&&(E=0))}function C(Ee,Ae,ze,Le,he){var Ie=ze/c|0,De=ze%c,Be=Ie*Ee.v+Le,Z=De*Ee.h+he;Ee.blocks[Be]!==void 0&&Ae(Ee,Ee.blocks[Be][Z])}function D(Ee,Ae,ze){var Le=ze/Ee.blocksPerLine|0,he=ze%Ee.blocksPerLine;Ee.blocks[Le]!==void 0&&Ae(Ee,Ee.blocks[Le][he])}var B=n.length,F,K;u?i===0?K=s===0?y:g:K=s===0?M:x:K=m;var te=0,J;B==1?J=n[0].blocksPerLine*n[0].blocksPerColumn:J=c*r.mcusPerColumn,a||(a=J);for(var ne,le,q;te<J;){for(var j=0;j<B;j++)n[j].pred=0;if(S=0,B==1){F=n[0];for(var P=0;P<a;P++)D(F,K,te),te++}else for(var P=0;P<a;P++){for(var j=0;j<B;j++){F=n[j],ne=F.h,le=F.v;for(var N=0;N<le;N++)for(var X=0;X<ne;X++)C(F,K,te,N,X)}if(te++,te===J)break}if(te===J)do{if(e[t]===255&&e[t+1]!==0)break;t+=1}while(t<e.length-2);if(p=0,q=e[t]<<8|e[t+1],q<65280)throw new Error("marker was not found");if(q>=65488&&q<=65495)t+=2;else break}return t-d}function LF(e){var t=[],r=e.blocksPerLine,n=e.blocksPerColumn,a=r<<3,i=new Int32Array(64),o=new Uint8Array(64);function s(b,v,m){for(var y=e.quantizationTable,g=m,S=0;S<64;S++)g[S]=b[S]*y[S];for(var S=0;S<8;++S){var M=8*S;if(g[1+M]==0&&g[2+M]==0&&g[3+M]==0&&g[4+M]==0&&g[5+M]==0&&g[6+M]==0&&g[7+M]==0){var E=cs*g[0+M]+512>>10;g[0+M]=E,g[1+M]=E,g[2+M]=E,g[3+M]=E,g[4+M]=E,g[5+M]=E,g[6+M]=E,g[7+M]=E;continue}var w=cs*g[0+M]+128>>8,x=cs*g[4+M]+128>>8,C=g[2+M],D=g[6+M],B=Nc*(g[1+M]-g[7+M])+128>>8,F=Nc*(g[1+M]+g[7+M])+128>>8,K=g[3+M]<<4,te=g[5+M]<<4,J=w-x+1>>1;w=w+x+1>>1,x=J,J=C*$c+D*Bc+128>>8,C=C*Bc-D*$c+128>>8,D=J,J=B-te+1>>1,B=B+te+1>>1,te=J,J=F+K+1>>1,K=F-K+1>>1,F=J,J=w-D+1>>1,w=w+D+1>>1,D=J,J=x-C+1>>1,x=x+C+1>>1,C=J,J=B*Lc+F*Rc+2048>>12,B=B*Rc-F*Lc+2048>>12,F=J,J=K*Fc+te*Pc+2048>>12,K=K*Pc-te*Fc+2048>>12,te=J,g[0+M]=w+F,g[7+M]=w-F,g[1+M]=x+te,g[6+M]=x-te,g[2+M]=C+K,g[5+M]=C-K,g[3+M]=D+B,g[4+M]=D-B}for(var S=0;S<8;++S){var ne=S;if(g[1*8+ne]==0&&g[2*8+ne]==0&&g[3*8+ne]==0&&g[4*8+ne]==0&&g[5*8+ne]==0&&g[6*8+ne]==0&&g[7*8+ne]==0){var le=cs*m[S+0]+8192>>14;g[0*8+ne]=le,g[1*8+ne]=le,g[2*8+ne]=le,g[3*8+ne]=le,g[4*8+ne]=le,g[5*8+ne]=le,g[6*8+ne]=le,g[7*8+ne]=le;continue}var w=cs*g[0*8+ne]+2048>>12,x=cs*g[4*8+ne]+2048>>12,C=g[2*8+ne],D=g[6*8+ne],B=Nc*(g[1*8+ne]-g[7*8+ne])+2048>>12,F=Nc*(g[1*8+ne]+g[7*8+ne])+2048>>12,K=g[3*8+ne],te=g[5*8+ne],J=w-x+1>>1;w=w+x+1>>1,x=J,J=C*$c+D*Bc+2048>>12,C=C*Bc-D*$c+2048>>12,D=J,J=B-te+1>>1,B=B+te+1>>1,te=J,J=F+K+1>>1,K=F-K+1>>1,F=J,J=w-D+1>>1,w=w+D+1>>1,D=J,J=x-C+1>>1,x=x+C+1>>1,C=J,J=B*Lc+F*Rc+2048>>12,B=B*Rc-F*Lc+2048>>12,F=J,J=K*Fc+te*Pc+2048>>12,K=K*Pc-te*Fc+2048>>12,te=J,g[0*8+ne]=w+F,g[7*8+ne]=w-F,g[1*8+ne]=x+te,g[6*8+ne]=x-te,g[2*8+ne]=C+K,g[5*8+ne]=C-K,g[3*8+ne]=D+B,g[4*8+ne]=D-B}for(var S=0;S<64;++S){var q=128+(g[S]+8>>4);v[S]=q<0?0:q>255?255:q}}us(a*n*8);for(var l=0;l<n;l++){for(var c=l<<3,u=0;u<8;u++)t.push(new Uint8Array(a));for(var d=0;d<r;d++){s(e.blocks[l][d],o,i);for(var f=0,p=d<<3,_=0;_<8;_++)for(var h=t[c+_],u=0;u<8;u++)h[p+u]=o[f++]}}return t}function fi(e){return e<0?0:e>255?255:e}function BF(e){var t={width:0,height:0,comments:[],adobe:void 0,components:[],exifBuffer:void 0,jfif:void 0},r=PF*1e3*1e3,n=0;function a(){var Se=e[n]<<8|e[n+1];return n+=2,Se}function i(){var Se=a(),me=e.subarray(n,n+Se-2);return n+=me.length,me}function o(Se){var me=0,ye=0;for(var xe in Se.components)if(Se.components.hasOwnProperty(xe)){var ee=Se.components[xe];me<ee.h&&(me=ee.h),ye<ee.v&&(ye=ee.v)}var pe=Math.ceil(Se.samplesPerLine/8/me),ve=Math.ceil(Se.scanLines/8/ye);for(var xe in Se.components)if(Se.components.hasOwnProperty(xe)){var ee=Se.components[xe],Pe=Math.ceil(Math.ceil(Se.samplesPerLine/8)*ee.h/me),Ge=Math.ceil(Math.ceil(Se.scanLines/8)*ee.v/ye),Ue=pe*ee.h,We=ve*ee.v,rt=We*Ue,lt=[];us(rt*256);for(var ft=0;ft<We;ft++){for(var St=[],$e=0;$e<Ue;$e++)St.push(new Int32Array(64));lt.push(St)}ee.blocksPerLine=Pe,ee.blocksPerColumn=Ge,ee.blocks=lt}Se.maxH=me,Se.maxV=ye,Se.mcusPerLine=pe,Se.mcusPerColumn=ve}var s=null,l=null,c=void 0,u=0,d=[],f=[],p=[],_=[],h=a(),b=-1;if(h!=65496)throw new Error("SOI not found");for(h=a();h!=65497;){switch(h){case 65280:break;case 65504:case 65505:case 65506:case 65507:case 65508:case 65509:case 65510:case 65511:case 65512:case 65513:case 65514:case 65515:case 65516:case 65517:case 65518:case 65519:case 65534:{var v=i();if(h===65534){for(var m="",y=0;y<v.byteLength;y++)m+=String.fromCharCode(v[y]);t.comments.push(m)}h===65504&&v[0]===74&&v[1]===70&&v[2]===73&&v[3]===70&&v[4]===0&&(s={version:{major:v[5],minor:v[6]},densityUnits:v[7],xDensity:v[8]<<8|v[9],yDensity:v[10]<<8|v[11],thumbWidth:v[12],thumbHeight:v[13],thumbData:v.subarray(14,14+3*v[12]*v[13])}),h===65505&&v[0]===69&&v[1]===120&&v[2]===105&&v[3]===102&&v[4]===0&&(t.exifBuffer=v.subarray(5,v.length)),h===65518&&v[0]===65&&v[1]===100&&v[2]===111&&v[3]===98&&v[4]===101&&v[5]===0&&(l={version:v[6],flags0:v[7]<<8|v[8],flags1:v[9]<<8|v[10],transformCode:v[11]});break}case 65499:{for(var g=a(),S=g+n-2;n<S;){var M=e[n++];us(64*4);var E=new Int32Array(64);if(M>>4)if(M>>4===1)for(var w=0;w<64;w++){var x=Al[w];E[x]=a()}else throw new Error("DQT: invalid table spec");else for(var w=0;w<64;w++){var x=Al[w];E[x]=e[n++]}d[M&15]=E}break}case 65472:case 65473:case 65474:{a(),c={extended:h===65473,progressive:h===65474,precision:e[n++],scanLines:a(),samplesPerLine:a(),components:{},componentsOrder:[],maxH:0,maxV:0,mcusPerLine:0,mcusPerColumn:0};var C=c.scanLines*c.samplesPerLine;if(C>r){var D=Math.ceil((C-r)/1e6);throw new Error("maxResolutionInMP limit exceeded by ".concat(D,"MP"))}for(var B=e[n++],F=0;F<B;F++){var K=e[n],te=e[n+1]>>4,J=e[n+1]&15,ne=e[n+2];c.componentsOrder.push(K),c.components[K]={h:te,v:J,quantizationIdx:ne,blocksPerColumn:0,blocksPerLine:0,blocks:[],pred:0},n+=3}o(c),f.push(c);break}case 65476:{for(var le=a(),F=2;F<le;){for(var q=e[n++],j=new Uint8Array(16),P=0,w=0;w<16;w++,n++)P+=j[w]=e[n];us(16+P);for(var N=new Uint8Array(P),w=0;w<P;w++,n++)N[w]=e[n];F+=17+P;var X=q&15,Ee=q>>4?p:_;Ee[X]=FF(j,N)}break}case 65501:a(),u=a();break;case 65500:a(),a();break;case 65498:{a();for(var Ae=e[n++],ze=[],F=0;F<Ae;F++){var Le=c.components[e[n++]],he=e[n++];Le.huffmanTableDC=_[he>>4],Le.huffmanTableAC=p[he&15],ze.push(Le)}var Ie=e[n++],De=e[n++],Be=e[n++],Z=RF(e,n,c,ze,u,Ie,De,Be>>4,Be&15);n+=Z;break}case 65535:e[n]!==255&&n--;break;default:{if(e[n-3]==255&&e[n-2]>=192&&e[n-2]<=254){n-=3;break}else if(h===224||h==225){if(b!==-1)throw new Error("first unknown JPEG marker at offset ".concat(b.toString(16),", second unknown JPEG marker ").concat(h.toString(16)," at offset ").concat((n-1).toString(16)));b=n-1;var se=a();if(e[n+se-2]===255){n+=se-2;break}}throw new Error("unknown JPEG marker "+h.toString(16))}}h=a()}if(f.length!=1)throw new Error("only single frame JPEGs supported");for(var F=0;F<f.length;F++){var we=f[F].components;for(var w in we)we[w].quantizationTable=d[we[w].quantizationIdx],delete we[w].quantizationIdx}t.width=c.samplesPerLine,t.height=c.scanLines,t.jfif=s,t.adobe=l,t.components=[];for(var F=0;F<c.componentsOrder.length;F++){var Le=c.components[c.componentsOrder[F]];t.components.push({lines:LF(Le),scaleX:Le.h/c.maxH,scaleY:Le.v/c.maxV})}return t}function $F(e){var t=0,r=!1,n=e.width,a=e.height,i=n*a*e.components.length;us(i);var o=new Uint8Array(i);switch(e.components.length){case 1:{for(var s=e.components[0],l=0;l<a;l++)for(var c=s.lines[0|l*s.scaleY],u=0;u<n;u++){var d=c[0|u*s.scaleX];o[t++]=d}break}case 2:{for(var s=e.components[0],f=e.components[1],l=0;l<a;l++)for(var c=s.lines[0|l*s.scaleY],p=f.lines[0|l*f.scaleY],u=0;u<n;u++){var _=c[0|u*s.scaleX];o[t++]=_;var h=p[0|u*f.scaleX];o[t++]=h}break}case 3:{r=!0,e.adobe&&e.adobe.transformCode&&(r=!0);for(var s=e.components[0],f=e.components[1],b=e.components[2],l=0;l<a;l++)for(var c=s.lines[0|l*s.scaleY],p=f.lines[0|l*f.scaleY],v=b.lines[0|l*b.scaleY],u=0;u<n;u++){var d=void 0,m=void 0,y=void 0,g=void 0,S=void 0,M=void 0;r?(d=c[0|u*s.scaleX],m=p[0|u*f.scaleX],y=v[0|u*b.scaleX],g=fi(d+1.402*(y-128)),S=fi(d-.3441363*(m-128)-.71413636*(y-128)),M=fi(d+1.772*(m-128))):(g=c[0|u*s.scaleX],S=p[0|u*f.scaleX],M=v[0|u*b.scaleX]),o[t++]=g,o[t++]=S,o[t++]=M}break}case 4:{if(!e.adobe)throw new Error("Unsupported color mode (4 components)");r=!1,e.adobe&&e.adobe.transformCode&&(r=!0);for(var s=e.components[0],f=e.components[1],b=e.components[2],E=e.components[3],l=0;l<a;l++)for(var c=s.lines[0|l*s.scaleY],p=f.lines[0|l*f.scaleY],v=b.lines[0|l*b.scaleY],w=E.lines[0|l*E.scaleY],u=0;u<n;u++){var d=void 0,m=void 0,y=void 0,x=void 0,C=void 0,D=void 0,B=void 0;r?(d=c[0|u*s.scaleX],m=p[0|u*f.scaleX],y=v[0|u*b.scaleX],x=w[0|u*E.scaleX],C=255-fi(d+1.402*(y-128)),D=255-fi(d-.3441363*(m-128)-.71413636*(y-128)),B=255-fi(d+1.772*(m-128))):(C=c[0|u*s.scaleX],D=p[0|u*f.scaleX],B=v[0|u*b.scaleX],x=w[0|u*E.scaleX]),o[t++]=255-C,o[t++]=255-D,o[t++]=255-B,o[t++]=255-x}break}default:throw new Error("Unsupported color mode")}return o}function NF(e,t){if(dp=0,e.length===0)throw new Error("Empty jpeg buffer");var r=BF(e);us(r.width*r.height*4);var n=$F(r),a=t(r.width,r.height),i=a.width,o=a.height,s=a.data,l=0,c=0;switch(r.components.length){case 1:for(var u=0;u<o;u++)for(var d=0;d<i;d++){var f=n[l++];s[c++]=f,s[c++]=f,s[c++]=f,s[c++]=255}break;case 3:for(var u=0;u<o;u++)for(var d=0;d<i;d++){var p=n[l++],_=n[l++],h=n[l++];s[c++]=p,s[c++]=_,s[c++]=h,s[c++]=255}break;case 4:for(var u=0;u<o;u++)for(var d=0;d<i;d++){var b=n[l++],v=n[l++],f=n[l++],m=n[l++],p=255-fi(b*(1-m/255)+m),_=255-fi(v*(1-m/255)+m),h=255-fi(f*(1-m/255)+m);s[c++]=p,s[c++]=_,s[c++]=h,s[c++]=255}break;default:throw new Error("Unsupported color mode")}return a}var UF=!1,Uc={},fs={pass:"pass through",norm:"normal",diss:"dissolve",dark:"darken","mul ":"multiply",idiv:"color burn",lbrn:"linear burn",dkCl:"darker color",lite:"lighten",scrn:"screen","div ":"color dodge",lddg:"linear dodge",lgCl:"lighter color",over:"overlay",sLit:"soft light",hLit:"hard light",vLit:"vivid light",lLit:"linear light",pLit:"pin light",hMix:"hard mix",diff:"difference",smud:"exclusion",fsub:"subtract",fdiv:"divide","hue ":"hue","sat ":"saturation",colr:"color","lum ":"luminosity"};Object.keys(fs).forEach(function(e){return Uc[fs[e]]=e});var a4=["none","red","orange","yellow","green","blue","violet","gray"],i4=["LMsk","Lr16","Lr32","Layr","Mt16","Mt32","Mtrn","Alph","FMsk","lnk2","FEid","FXid","PxSD","cinf"];function HF(e){var t={};return Object.keys(e).forEach(function(r){return t[e[r]]=r}),t}function _t(e,t,r){var n=HF(r),a=function(o){var s=o.split(".")[1];if(s&&!n[s])throw new Error("Unrecognized value for enum: '".concat(o,"'"));return n[s]||t},i=function(o){if(o&&!r[o])throw new Error("Invalid value for enum: '".concat(o,"'"));return"".concat(e,".").concat(r[o]||r[t])};return{decode:a,encode:i}}var o4;(function(e){e[e.RGB=0]="RGB",e[e.HSB=1]="HSB",e[e.CMYK=2]="CMYK",e[e.Lab=7]="Lab",e[e.Grayscale=8]="Grayscale"})(o4||(o4={}));var s4;(function(e){e[e.PositionRelativeToLayer=1]="PositionRelativeToLayer",e[e.LayerMaskDisabled=2]="LayerMaskDisabled",e[e.InvertLayerMaskWhenBlending=4]="InvertLayerMaskWhenBlending",e[e.LayerMaskFromRenderingOtherData=8]="LayerMaskFromRenderingOtherData",e[e.MaskHasParametersAppliedToIt=16]="MaskHasParametersAppliedToIt"})(s4||(s4={}));var l4;(function(e){e[e.UserMaskDensity=1]="UserMaskDensity",e[e.UserMaskFeather=2]="UserMaskFeather",e[e.VectorMaskDensity=4]="VectorMaskDensity",e[e.VectorMaskFeather=8]="VectorMaskFeather"})(l4||(l4={}));function c4(e,t){switch(e){case 0:return 0;case 1:return 1;case 2:return 2;case 3:return t?3:e+1;case-1:return t?4:3;default:return e+1}}function pp(e,t,r){return e<t?t:e>r?r:e}function u4(e){for(var t=e.width*e.height*4,r=3;r<t;r+=4)if(e.data[r]!==255)return!0;return!1}function jF(e){for(var t=e.data,r=t instanceof Float32Array?1:t instanceof Uint16Array?65535:255,n=0,a=t.length|0;n<a;n=n+4|0)t[n+0]=0,t[n+1]=0,t[n+2]=0,t[n+3]=r}function Hc(e){var t=ds(e.width,e.height),r;if(e.data instanceof Uint8ClampedArray)r=e;else{r=ps(e.width,e.height);var n=e.data,a=r.data;if(n instanceof Float32Array)for(var i=0,o=n.length;i<o;i+=4)a[i+0]=Math.round(Math.pow(n[i+0],1/2.2)*255),a[i+1]=Math.round(Math.pow(n[i+1],1/2.2)*255),a[i+2]=Math.round(Math.pow(n[i+2],1/2.2)*255),a[i+3]=Math.round(n[i+3]*255);else for(var s=n instanceof Uint16Array?8:0,i=0,o=n.length;i<o;i++)a[i]=n[i]>>>s}return t.getContext("2d").putImageData(r,0,0),t}function GF(e,t,r,n){if(!(e instanceof Uint8Array||e instanceof Uint8ClampedArray))throw new Error("Invalid bit depth");for(var a=0,i=0,o=0;a<n;a++)for(var s=0;s<r;)for(var l=e[o++],c=0;c<8&&s<r;c++,s++,i+=4){var u=l&128?0:255;l=l<<1,t[i+0]=u,t[i+1]=u,t[i+2]=u,t[i+3]=255}}function hp(e,t,r,n){var a=t.data,i=t.width,o=t.height;if(!(!i||!o)){for(var s=4*i|0,l=0,c=r.length*(n?4:2)*o|0,u=0,d=r;u<d.length;u++)for(var f=d[u],p=0,_=f|0;p<o;p++){var h=p*s|0,b=h+s|0,v=b+f-4|0,m=v-4|0,y=c;for(_=h+f|0;_<b;_=_+4|0)if(_<m){var g=a[_];_=_+4|0;var S=a[_];_=_+4|0;var M=a[_];if(g===S&&g===M){for(var E=3;E<128&&_<v&&a[_+4|0]===g;)E=E+1|0,_=_+4|0;e[c++]=1-E,e[c++]=g}else{var w=c,x=!0,E=1;for(e[c++]=0,e[c++]=g;_<v&&E<128;)if(_=_+4|0,g=S,S=M,M=a[_],g===S&&g===M){_=_-12|0,x=!1;break}else E++,e[c++]=g;x&&(E<127?(e[c++]=S,e[c++]=M,E+=2):E<128?(e[c++]=S,E++,_=_-4|0):_=_-8|0),e[w]=E-1}}else _===v?(e[c++]=0,e[c++]=a[_]):(e[c++]=1,e[c++]=a[_],_=_+4|0,e[c++]=a[_]);var C=c-y;n&&(e[l++]=C>>24&255,e[l++]=C>>16&255),e[l++]=C>>8&255,e[l++]=C&255}return e.slice(0,c)}}function f4(e,t){for(var r=e.data,n=e.width,a=e.height,i=n*a,o=new Uint8Array(i),s=[],l=0,c=0,u=t;c<u.length;c++){for(var d=u[c],f=0,p=d;f<i;f++,p+=4)o[f]=r[p];var _=IF(o);s.push(_),l+=_.byteLength}if(s.length>0){for(var _=new Uint8Array(l),d=0,h=0,b=s;h<b.length;h++){var v=b[h];_.set(v,d),d+=v.byteLength}return _}else return s[0]}function VF(e){var t=ds(100,100);try{var r=t.getContext("2d"),n=NF(e,function(a,i){return r.createImageData(a,i)});t.width=n.width,t.height=n.height,r.putImageData(n,0,0)}catch(a){console.error("JPEG decompression error",a.message)}return t}var ds=function(){throw new Error("Canvas not initialized, use initializeCanvas method to set up createCanvas method")},vp=void 0,ps=function(e,t){return vp||(vp=ds(1,1)),vp.getContext("2d").createImageData(e,t)};typeof document<"u"&&(ds=function(e,t){var r=document.createElement("canvas");return r.width=e,r.height=t,r});function qF(e,t){ds=e,ps=t||ps}for(var d4=ZF,p4=eR,$a=[],Yn=[],KF=typeof Uint8Array<"u"?Uint8Array:Array,mp="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",hs=0,WF=mp.length;hs<WF;++hs)$a[hs]=mp[hs],Yn[mp.charCodeAt(hs)]=hs;Yn[45]=62,Yn[95]=63;function YF(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");r===-1&&(r=t);var n=r===t?0:4-r%4;return[r,n]}function XF(e,t,r){return(t+r)*3/4-r}function ZF(e){var t,r=YF(e),n=r[0],a=r[1],i=new KF(XF(e,n,a)),o=0,s=a>0?n-4:n,l;for(l=0;l<s;l+=4)t=Yn[e.charCodeAt(l)]<<18|Yn[e.charCodeAt(l+1)]<<12|Yn[e.charCodeAt(l+2)]<<6|Yn[e.charCodeAt(l+3)],i[o++]=t>>16&255,i[o++]=t>>8&255,i[o++]=t&255;return a===2&&(t=Yn[e.charCodeAt(l)]<<2|Yn[e.charCodeAt(l+1)]>>4,i[o++]=t&255),a===1&&(t=Yn[e.charCodeAt(l)]<<10|Yn[e.charCodeAt(l+1)]<<4|Yn[e.charCodeAt(l+2)]>>2,i[o++]=t>>8&255,i[o++]=t&255),i}function JF(e){return $a[e>>18&63]+$a[e>>12&63]+$a[e>>6&63]+$a[e&63]}function QF(e,t,r){for(var n,a=[],i=t;i<r;i+=3)n=(e[i]<<16&16711680)+(e[i+1]<<8&65280)+(e[i+2]&255),a.push(JF(n));return a.join("")}function eR(e){for(var t,r=e.length,n=r%3,a=[],i=16383,o=0,s=r-n;o<s;o+=i)a.push(QF(e,o,o+i>s?s:o+i));return n===1?(t=e[r-1],a.push($a[t>>2]+$a[t<<4&63]+"==")):n===2&&(t=(e[r-2]<<8)+e[r-1],a.push($a[t>>10]+$a[t>>4&63]+$a[t<<2&63]+"=")),a.join("")}function gp(e){return e&4294967168?e&4294965248?e&4294901760?4:3:2:1}function tR(e){for(var t=0,r=0;r<e.length;r++){var n=e.charCodeAt(r);if(n>=55296&&n<=56319){if(r+1<e.length){var a=e.charCodeAt(r+1);(a&64512)===56320&&(r++,t+=gp(((n&1023)<<10)+(a&1023)+65536))}}else t+=gp(n)}return t}function h4(e,t,r){var n=gp(r);switch(n){case 1:e[t]=r;break;case 2:e[t]=r>>6&31|192,e[t+1]=r&63|128;break;case 3:e[t]=r>>12&15|224,e[t+1]=r>>6&63|128,e[t+2]=r&63|128;break;default:e[t]=r>>18&7|240,e[t+1]=r>>12&63|128,e[t+2]=r>>6&63|128,e[t+3]=r&63|128;break}return n}function rR(e,t,r){for(var n=0;n<r.length;n++){var a=r.charCodeAt(n);if(a>=55296&&a<=56319){if(n+1<r.length){var i=r.charCodeAt(n+1);if((i&64512)===56320){n++;var o=((a&1023)<<10)+(i&1023)+65536;t+=h4(e,t,o)}}}else t+=h4(e,t,a)}return t}function v4(e){if(e.length>1e3&&typeof TextEncoder<"u")return new TextEncoder().encode(e);var t=new Uint8Array(tR(e));return rR(t,0,e),t}function vs(e,t){if(t>=e.length)throw Error("Invalid byte index");var r=e[t];if((r&192)===128)return r&63;throw Error("Invalid continuation byte")}function m4(e){if(e.byteLength>1e3&&typeof TextDecoder<"u")return new TextDecoder().decode(e);for(var t=[],r=0;r<e.length;){var n=e[r++],a=void 0;if(!(n&128))a=n;else if((n&224)===192){var i=vs(e,r++);if(a=(n&31)<<6|i,a<128)throw Error("Invalid continuation byte")}else if((n&240)===224){var i=vs(e,r++),o=vs(e,r++);if(a=(n&15)<<12|i<<6|o,a<2048)throw Error("Invalid continuation byte");if(a>=55296&&a<=57343)throw Error("Lone surrogate U+".concat(a.toString(16).toUpperCase()," is not a scalar value"))}else if((n&248)===240){var i=vs(e,r++),o=vs(e,r++),s=vs(e,r++);if(a=(n&15)<<18|i<<12|o<<6|s,a<65536||a>1114111)throw Error("Invalid continuation byte")}else throw Error("Invalid UTF-8 detected");a>65535&&(a-=65536,t.push(String.fromCharCode(a>>>10&1023|55296)),a=56320|a&1023),t.push(String.fromCharCode(a))}return t.join("")}var di=function(){return di=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++){t=arguments[r];for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a])}return e},di.apply(this,arguments)},nR=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,n=Object.getOwnPropertySymbols(e);a<n.length;a++)t.indexOf(n[a])<0&&Object.prototype.propertyIsEnumerable.call(e,n[a])&&(r[n[a]]=e[n[a]]);return r};function aR(e){var t={};return Object.keys(e).forEach(function(r){return t[e[r]]=r}),t}var Tl={"#Ang":"Angle","#Rsl":"Density","#Rlt":"Distance","#Nne":"None","#Prc":"Percent","#Pxl":"Pixels","#Mlm":"Millimeters","#Pnt":"Points",RrPi:"Picas",RrIn:"Inches",RrCm:"Centimeters"},jc=aR(Tl);function ot(e,t){return{name:e,classID:t}}for(var Nt=ot("","null"),g4={strokeStyleContent:ot("","solidColorLayer"),printProofSetup:ot("Proof Setup","proofSetup"),Grad:ot("Gradient","Grdn"),Trnf:ot("Transform","Trnf"),patternFill:ot("","patternFill"),ebbl:ot("","ebbl"),SoFi:ot("","SoFi"),GrFl:ot("","GrFl"),sdwC:ot("","RGBC"),hglC:ot("","RGBC"),"Clr ":ot("","RGBC"),tintColor:ot("","RGBC"),Ofst:ot("","Pnt "),ChFX:ot("","ChFX"),MpgS:ot("","ShpC"),DrSh:ot("","DrSh"),IrSh:ot("","IrSh"),OrGl:ot("","OrGl"),IrGl:ot("","IrGl"),TrnS:ot("","ShpC"),Ptrn:ot("","Ptrn"),FrFX:ot("","FrFX"),phase:ot("","Pnt "),frameStep:Nt,duration:Nt,workInTime:Nt,workOutTime:Nt,audioClipGroupList:Nt,bounds:ot("","Rctn"),customEnvelopeWarp:ot("","customEnvelopeWarp"),warp:ot("","warp"),"Sz ":ot("","Pnt "),origin:ot("","Pnt "),autoExpandOffset:ot("","Pnt "),keyOriginShapeBBox:ot("","unitRect"),Vrsn:Nt,psVersion:Nt,docDefaultNewArtboardBackgroundColor:ot("","RGBC"),artboardRect:ot("","classFloatRect"),keyOriginRRectRadii:ot("","radii"),keyOriginBoxCorners:Nt,rectangleCornerA:ot("","Pnt "),rectangleCornerB:ot("","Pnt "),rectangleCornerC:ot("","Pnt "),rectangleCornerD:ot("","Pnt "),compInfo:Nt,quiltWarp:ot("","quiltWarp"),generatorSettings:Nt,crema:Nt,FrIn:Nt,blendOptions:Nt,FXRf:Nt,Lefx:Nt,time:Nt,animKey:Nt,timeScope:Nt,inTime:Nt,outTime:Nt,sheetStyle:Nt,translation:Nt,Skew:Nt,boundingBox:ot("","boundingBox"),"Lnk ":ot("","ExternalFileLink"),frameReader:ot("","FrameReader"),effectParams:ot("","motionTrackEffectParams"),Impr:ot("None","none"),Anch:ot("","Pnt "),"Fwd ":ot("","Pnt "),"Bwd ":ot("","Pnt "),FlrC:ot("","Pnt "),meshBoundaryPath:ot("","pathClass"),filterFX:ot("","filterFXStyle"),Fltr:ot("","rigidTransform"),FrgC:ot("","RGBC"),BckC:ot("","RGBC"),sdwM:ot("Parameters","adaptCorrectTones"),hglM:ot("Parameters","adaptCorrectTones"),customShape:ot("","customShape"),origFXRefPoint:Nt,FXRefPoint:Nt,ClMg:ot("","ClMg")},b4={"Crv ":ot("","CrPt"),Clrs:ot("","Clrt"),Trns:ot("","TrnS"),keyDescriptorList:Nt,solidFillMulti:ot("","SoFi"),gradientFillMulti:ot("","GrFl"),dropShadowMulti:ot("","DrSh"),innerShadowMulti:ot("","IrSh"),frameFXMulti:ot("","FrFX"),FrIn:Nt,FSts:Nt,LaSt:Nt,sheetTimelineOptions:Nt,trackList:ot("","animationTrack"),globalTrackList:ot("","animationTrack"),keyList:Nt,audioClipGroupList:Nt,audioClipList:Nt,countObjectList:ot("","countObject"),countGroupList:ot("","countGroup"),slices:ot("","slice"),"Pts ":ot("","Pthp"),SbpL:ot("","SbpL"),pathComponents:ot("","PaCm"),filterFXList:ot("","filterFX"),puppetShapeList:ot("","puppetShape"),channelDenoise:ot("","channelDenoiseParams"),ShrP:ot("","Pnt "),layerSettings:Nt,list:Nt,Adjs:ot("","CrvA")},y4={TEXT:["Txt ","printerName","Nm ","Idnt","blackAndWhitePresetFileName","LUT3DFileName","presetFileName","curvesPresetFileName","mixerPresetFileName","placed","description","reason","artboardPresetName","json","clipID","relPath","fullPath","mediaDescriptor","Msge","altTag","url","cellText","preset","KnNm","FPth","comment","originalPath"],tdta:["EngineData","LUT3DFileData","indexArray","originalVertexArray","deformedVertexArray","LqMe"],long:["TextIndex","RndS","Mdpn","Smth","Lctn","strokeStyleVersion","LaID","Vrsn","Cnt ","Brgh","Cntr","means","vibrance","Strt","bwPresetKind","comp","compID","originalCompID","curvesPresetKind","mixerPresetKind","uOrder","vOrder","PgNm","totalPages","Crop","numerator","denominator","frameCount","Annt","keyOriginType","unitValueQuadVersion","keyOriginIndex","major","minor","fix","docDefaultNewArtboardBackgroundType","artboardBackgroundType","numModifyingFX","deformNumRows","deformNumCols","FrID","FrDl","FsID","LCnt","AFrm","AFSt","numBefore","numAfter","Spcn","minOpacity","maxOpacity","BlnM","sheetID","gblA","globalAltitude","descVersion","frameReaderType","LyrI","zoomOrigin","fontSize","Rds ","sliceID","topOutset","leftOutset","bottomOutset","rightOutset","filterID","meshQuality","meshExpansion","meshRigidity","VrsM","VrsN","NmbG","WLMn","WLMx","AmMn","AmMx","SclH","SclV","Lvl ","TlNm","TlOf","FlRs","Thsh","ShrS","ShrE","FlRs","Vrnc","Strg","ExtS","ExtD","HrzS","VrtS","NmbR","EdgF","Ang1","Ang2","Ang3","Ang4","lastAppliedComp","capturedInfo"],enum:["textGridding","Ornt","warpStyle","warpRotate","Inte","Bltn","ClrS","BlrQ","bvlT","bvlS","bvlD","Md ","glwS","GrdF","GlwT","RplS","BlrM","SmBM","strokeStyleLineCapType","strokeStyleLineJoinType","strokeStyleLineAlignment","strokeStyleBlendMode","PntT","Styl","lookupType","LUTFormat","dataOrder","tableOrder","enableCompCore","enableCompCoreGPU","compCoreSupport","compCoreGPUSupport","Engn","enableCompCoreThreads","gs99","FrDs","trackID","animInterpStyle","horzAlign","vertAlign","bgColorType","shapeOperation","UndA","Wvtp","Drct","WndM","Edg ","FlCl","IntE","IntC","Cnvr","Fl ","Dstr","MztT","Lns ","ExtT","DspM","ExtR","ZZTy","SphM","SmBQ","placedLayerOCIOConversion","gradientsInterpolationMethod"],bool:["PstS","printSixteenBit","masterFXSwitch","enab","uglg","antialiasGloss","useShape","useTexture","uglg","antialiasGloss","useShape","Vsbl","useTexture","Algn","Rvrs","Dthr","Invr","VctC","ShTr","layerConceals","strokeEnabled","fillEnabled","strokeStyleScaleLock","strokeStyleStrokeAdjust","hardProof","MpBl","paperWhite","useLegacy","Auto","Lab ","useTint","keyShapeInvalidated","autoExpandEnabled","autoNestEnabled","autoPositionEnabled","shrinkwrapOnSaveEnabled","present","showInDialog","overprint","sheetDisclosed","lightsDisclosed","meshesDisclosed","materialsDisclosed","hasMotion","muted","Effc","selected","autoScope","fillCanvas","cellTextIsHTML","Smoo","Clsp","validAtPosition","rigidType","hasoptions","filterMaskEnable","filterMaskLinked","filterMaskExtendWithWhite","removeJPEGArtifact","Mnch","ExtF","ExtM","moreAccurate","GpuY","LIWy","Cnty"],doub:["warpValue","warpPerspective","warpPerspectiveOther","Intr","Wdth","Hght","strokeStyleMiterLimit","strokeStyleResolution","layerTime","keyOriginResolution","xx","xy","yx","yy","tx","ty","FrGA","frameRate","audioLevel","rotation","X ","Y ","redFloat","greenFloat","blueFloat","imageResolution","PuX0","PuX1","PuX2","PuX3","PuY0","PuY1","PuY2","PuY3"],UntF:["sdwO","hglO","lagl","Lald","srgR","blur","Sftn","Opct","Dstn","Angl","Ckmt","Nose","Inpr","ShdN","strokeStyleLineWidth","strokeStyleLineDashOffset","strokeStyleOpacity","H ","Top ","Left","Btom","Rght","Rslt","topRight","topLeft","bottomLeft","bottomRight","ClNs","Shrp"],VlLs:["Crv ","Clrs","Mnm ","Mxm ","Trns","pathList","strokeStyleLineDashSet","FrLs","slices","LaSt","Trnf","nonAffineTransform","keyDescriptorList","guideIndeces","gradientFillMulti","solidFillMulti","frameFXMulti","innerShadowMulti","dropShadowMulti","FrIn","FSts","FsFr","sheetTimelineOptions","audioClipList","trackList","globalTrackList","keyList","audioClipList","warpValues","selectedPin","Pts ","SbpL","pathComponents","pinOffsets","posFinalPins","pinVertexIndices","PinP","PnRt","PnOv","PnDp","filterFXList","puppetShapeList","ShrP","channelDenoise","Mtrx","layerSettings","list","compList","Adjs"],ObAr:["meshPoints","quiltSliceX","quiltSliceY"],"obj ":["null","Chnl"],"Pth ":["DspF"]},iR=["Rd ","Grn ","Bl ","Yllw","Ylw ","Cyn ","Mgnt","Blck","Gry ","Lmnc","A ","B "],_4={"Mnm ":"long","Mxm ":"long",FrLs:"long",strokeStyleLineDashSet:"UntF",Trnf:"doub",nonAffineTransform:"doub",keyDescriptorList:"Objc",gradientFillMulti:"Objc",solidFillMulti:"Objc",frameFXMulti:"Objc",innerShadowMulti:"Objc",dropShadowMulti:"Objc",LaSt:"Objc",FrIn:"Objc",FSts:"Objc",FsFr:"long",blendOptions:"Objc",sheetTimelineOptions:"Objc",keyList:"Objc",warpValues:"doub",selectedPin:"long","Pts ":"Objc",SbpL:"Objc",pathComponents:"Objc",pinOffsets:"doub",posFinalPins:"doub",pinVertexIndices:"long",PinP:"doub",PnRt:"long",PnOv:"bool",PnDp:"doub",filterFXList:"Objc",puppetShapeList:"Objc",ShrP:"Objc",channelDenoise:"Objc",Mtrx:"long",compList:"long",Chnl:"enum"},Gc={},bp=0,x4=Object.keys(y4);bp<x4.length;bp++)for(var w4=x4[bp],yp=0,k4=y4[w4];yp<k4.length;yp++){var ms=k4[yp];Gc[ms]=w4}for(var _p=0,S4=Object.keys(g4);_p<S4.length;_p++){var ms=S4[_p];Gc[ms]||(Gc[ms]="Objc")}for(var xp=0,C4=Object.keys(b4);xp<C4.length;xp++){var ms=C4[xp];_4[ms]="Objc"}function oR(e,t,r,n){return e==="presetKind"?typeof t=="string"?"enum":"long":e==="null"&&r==="slices"?"TEXT":e==="groupID"?r==="slices"?"long":"TEXT":e==="Sz "?"Wdth"in t?"Objc":"units"in t?"UntF":"doub":e==="Type"?typeof t=="string"?"enum":"long":e==="AntA"?typeof t=="string"?"enum":"bool":(e==="Hrzn"||e==="Vrtc")&&(n.Type==="keyType.Pstn"||n._classID==="Ofst")?"long":e==="Hrzn"||e==="Vrtc"||e==="Top "||e==="Left"||e==="Btom"||e==="Rght"?r==="slices"?"long":typeof t=="number"?"doub":"UntF":e==="Vrsn"?typeof t=="number"?"long":"Objc":e==="Rd "||e==="Grn "||e==="Bl "?r==="artd"?"long":"doub":e==="Trnf"?Array.isArray(t)?"VlLs":"Objc":Gc[e]}function pi(e){var t=dt(e);return tu(e,t||4)}function hi(e,t){if(t.length===4&&t!=="warp"&&t!=="time"&&t!=="hold"&&t!=="list")gt(e,0),yt(e,t);else{gt(e,t.length);for(var r=0;r<t.length;r++)Qe(e,t.charCodeAt(r))}}function E4(e,t){for(var r=xo(e),n=t?{_name:r.name,_classID:r.classID}:{},a=Ne(e),i=0;i<a;i++){var o=pi(e),s=lr(e),l=T4(e,s,t);n[o]=l}return n}function A4(e,t,r,n,a){So(e,t),hi(e,r);var i=Object.keys(n),o=i.length;"_name"in n&&o--,"_classID"in n&&o--,it(e,o);for(var s=0,l=i;s<l.length;s++){var c=l[s];if(!(c==="_name"||c==="_classID")){var u=oR(c,n[c],a,n),d=g4[c];c==="bounds"&&a==="text"?d=ot("","bounds"):c==="origin"?u=a==="slices"?"enum":"Objc":(c==="Cyn "||c==="Mgnt"||c==="Ylw "||c==="Blck")&&n._classID==="CMYC"?u="doub":/^PN[a-z][a-z]$/.test(c)?u="TEXT":/^PT[a-z][a-z]$/.test(c)?u="long":/^PF[a-z][a-z]$/.test(c)||(c==="Rds "||c==="Thsh")&&typeof n[c]=="number"&&n._classID==="SmrB"?u="doub":c==="ClSz"||c==="Rds "||c==="Amnt"?u=typeof n[c]=="number"?"long":"UntF":(c==="sdwM"||c==="hglM")&&typeof n[c]=="string"||c==="blur"&&typeof n[c]=="string"?u="enum":c==="Hght"&&typeof n[c]=="number"&&n._classID==="Embs"||c==="Angl"&&typeof n[c]=="number"&&(n._classID==="Embs"||n._classID==="smartSharpen"||n._classID==="Twrl"||n._classID==="MtnB")?u="long":c==="Angl"&&typeof n[c]=="number"?u="doub":c==="bounds"&&a==="slices"?(u="Objc",d=ot("","Rct1")):c==="Scl "?typeof n[c]=="object"&&"Hrzn"in n[c]?(u="Objc",d=Nt):typeof n[c]=="number"?u="long":u="UntF":c==="audioClipGroupList"&&i.length===1?u="VlLs":(c==="Strt"||c==="Brgh")&&"H "in n?u="doub":c==="Wdth"&&typeof n[c]=="object"?u="UntF":c==="Ofst"&&typeof n[c]=="number"?u="long":c==="Strt"&&typeof n[c]=="object"?(u="Objc",d=Nt):iR.indexOf(c)!==-1?u=r==="RGBC"&&a!=="artd"?"doub":"long":c==="profile"?u=r==="printOutput"?"TEXT":"tdta":c==="strokeStyleContent"?n[c]["Clr "]?d=ot("","solidColorLayer"):n[c].Grad?d=ot("","gradientLayer"):n[c].Ptrn&&(d=ot("","patternLayer")):c==="bounds"&&a==="quiltWarp"&&(d=ot("","classFloatRect")),d&&d.classID==="RGBC"&&"H "in n[c]&&(d={classID:"HSBC",name:""}),hi(e,c),yt(e,u||"long"),M4(e,u||"long",n[c],c,d,a)}}}function T4(e,t,r){switch(t){case"obj ":return lR(e);case"Objc":case"GlbO":return E4(e,r);case"VlLs":{for(var n=dt(e),a=[],i=0;i<n;i++){var o=lr(e);a.push(T4(e,o,r))}return a}case"doub":return Zn(e);case"UntF":{var s=lr(e),l=Zn(e);if(!Tl[s])throw new Error("Invalid units: ".concat(s));return{units:Tl[s],value:l}}case"UnFl":{var s=lr(e),l=la(e);if(!Tl[s])throw new Error("Invalid units: ".concat(s));return{units:Tl[s],value:l}}case"TEXT":return Rr(e);case"enum":{var c=pi(e),l=pi(e);return"".concat(c,".").concat(l)}case"long":return dt(e);case"comp":{var u=Ne(e),d=Ne(e);return{low:u,high:d}}case"bool":return!!at(e);case"type":case"GlbC":return xo(e);case"alis":{var f=dt(e);return tu(e,f)}case"tdta":{var p=dt(e);return Tr(e,p)}case"ObAr":{dt(e),Rr(e),pi(e);for(var _=dt(e),a=[],i=0;i<_;i++){var h=pi(e);lr(e),lr(e);for(var b=dt(e),v=[],m=0;m<b;m++)v.push(Zn(e));a.push({type:h,values:v})}return a}case"Pth ":{dt(e);var y=lr(e);qy(e);var g=qy(e),S=yR(e,g);return{sig:y,path:S}}default:throw new Error("Invalid TySh descriptor OSType: ".concat(t," at ").concat(e.offset.toString(16)))}}var sR={meshPoints:"rationalPoint",quiltSliceX:"UntF",quiltSliceY:"UntF"};function M4(e,t,r,n,a,i){switch(t){case"obj ":cR(e,n,r);break;case"Objc":case"GlbO":{if(typeof r!="object")throw new Error("Invalid struct value: ".concat(JSON.stringify(r),", key: ").concat(n));if(!a)throw new Error("Missing ext type for: '".concat(n,"' (").concat(JSON.stringify(r),")"));var o=r._name||a.name,s=r._classID||a.classID;A4(e,o,s,r,i);break}case"VlLs":if(!Array.isArray(r))throw new Error("Invalid list value: ".concat(JSON.stringify(r),", key: ").concat(n));gt(e,r.length);for(var l=0;l<r.length;l++){var c=_4[n];yt(e,c||"long"),M4(e,c||"long",r[l],"".concat(n,"[]"),b4[n],i)}break;case"doub":if(typeof r!="number")throw new Error("Invalid number value: ".concat(JSON.stringify(r),", key: ").concat(n));Jn(e,r);break;case"UntF":if(!jc[r.units])throw new Error("Invalid units: ".concat(r.units," in ").concat(n));yt(e,jc[r.units]),Jn(e,r.value);break;case"UnFl":if(!jc[r.units])throw new Error("Invalid units: ".concat(r.units," in ").concat(n));yt(e,jc[r.units]),fa(e,r.value);break;case"TEXT":So(e,r);break;case"enum":{if(typeof r!="string")throw new Error("Invalid enum value: ".concat(JSON.stringify(r),", key: ").concat(n));var u=r.split("."),d=u[0],f=u[1];hi(e,d),hi(e,f);break}case"long":if(typeof r!="number")throw new Error("Invalid integer value: ".concat(JSON.stringify(r),", key: ").concat(n));gt(e,r);break;case"bool":if(typeof r!="boolean")throw new Error("Invalid boolean value: ".concat(JSON.stringify(r),", key: ").concat(n));Qe(e,r?1:0);break;case"tdta":gt(e,r.byteLength),pa(e,r);break;case"ObAr":{gt(e,16),So(e,"");var p=sR[n];if(!p)throw new Error("Not implemented ObArType for: ".concat(n));hi(e,p),gt(e,r.length);for(var l=0;l<r.length;l++){hi(e,r[l].type),yt(e,"UnFl"),yt(e,"#Pxl"),gt(e,r[l].values.length);for(var _=0;_<r[l].values.length;_++)Jn(e,r[l].values[_])}break}case"Pth ":{var h=12+r.path.length*2;gt(e,h),yt(e,r.sig),O3(e,h),O3(e,r.path.length),sL(e,r.path);break}default:throw new Error("Not implemented descriptor OSType: ".concat(t))}}function lR(e){for(var t=dt(e),r=[],n=0;n<t;n++){var a=lr(e);switch(a){case"prop":{xo(e);var i=pi(e);r.push(i);break}case"Clss":r.push(xo(e));break;case"Enmr":{xo(e);var o=pi(e),s=pi(e);r.push("".concat(o,".").concat(s));break}case"rele":{xo(e),r.push(Ne(e));break}case"Idnt":r.push(dt(e));break;case"indx":r.push(dt(e));break;case"name":{xo(e),r.push(Rr(e));break}default:throw new Error("Invalid descriptor reference type: ".concat(a))}}return r}function cR(e,t,r){gt(e,r.length);for(var n=0;n<r.length;n++){var a=r[n],i="unknown";switch(typeof a=="string"&&(/^[a-z ]+\.[a-z ]+$/i.test(a)?i="Enmr":i="name"),yt(e,i),i){case"Enmr":{var o=a.split("."),s=o[0],l=o[1];D4(e,"\0",s),hi(e,s),hi(e,l);break}case"name":{D4(e,"\0","Lyr "),Bn(e,a+"\0");break}default:throw new Error("Invalid descriptor reference type: ".concat(i))}}return r}function xo(e){var t=Rr(e),r=pi(e);return{name:t,classID:r}}function D4(e,t,r){Bn(e,t),hi(e,r)}function Ft(e,t){t===void 0&&(t=!1);var r=Ne(e);if(r!==16)throw new Error("Invalid descriptor version: ".concat(r));var n=E4(e,t);return n}function Lt(e,t,r,n,a){a===void 0&&(a=""),it(e,16),A4(e,t,r,n,a)}function Ml(e){return{x:e.Hrzn,y:e.Vrtc}}function Dl(e){return{Hrzn:e.x,Vrtc:e.y}}function z4(e){return{top:Jt(e["Top "]),left:Jt(e.Left),right:Jt(e.Rght),bottom:Jt(e.Btom)}}function I4(e){var t;return t={Left:pr(e.left,"bounds.left")},t["Top "]=pr(e.top,"bounds.top"),t.Rght=pr(e.right,"bounds.right"),t.Btom=pr(e.bottom,"bounds.bottom"),t}function O4(e){var t={enabled:!!e.enab,position:Wc.decode(e.Styl),fillType:ey.decode(e.PntT),blendMode:bn.decode(e["Md "]),opacity:mt(e.Opct),size:Jt(e["Sz "])};return e.present!==void 0&&(t.present=e.present),e.showInDialog!==void 0&&(t.showInDialog=e.showInDialog),e.overprint!==void 0&&(t.overprint=e.overprint),e["Clr "]&&(t.color=oa(e["Clr "])),e.Grad&&(t.gradient=U4(e)),e.Ptrn&&(t.pattern=H4(e)),t}function P4(e){var t={};return t.enab=!!e.enabled,e.present!==void 0&&(t.present=!!e.present),e.showInDialog!==void 0&&(t.showInDialog=!!e.showInDialog),t.Styl=Wc.encode(e.position),t.PntT=ey.encode(e.fillType),t["Md "]=bn.encode(e.blendMode),t.Opct=Vr(e.opacity),t["Sz "]=pr(e.size,"size"),e.color&&(t["Clr "]=sa(e.color)),e.gradient&&(t=di(di({},t),j4(e.gradient))),e.pattern&&(t=di(di({},t),G4(e.pattern))),e.overprint!==void 0&&(t.overprint=!!e.overprint),t}function zl(e,t,r){for(var n,a,i,o=r?{"Scl ":Xn((n=e.scale)!==null&&n!==void 0?n:1),masterFXSwitch:!e.disabled}:{masterFXSwitch:!e.disabled,"Scl ":Xn((a=e.scale)!==null&&a!==void 0?a:1)},s=["dropShadow","innerShadow","solidFill","gradientOverlay","stroke"],l=0,c=s;l<c.length;l++){var u=c[l];if(e[u]&&!Array.isArray(e[u]))throw new Error("".concat(u," should be an array"))}var d=function(y){return!!y&&y.length>1&&r},f=function(y){return!!y&&y.length>=1&&(!r||y.length===1)};if(f(e.dropShadow)&&(o.DrSh=On(e.dropShadow[0],"dropShadow",t)),d(e.dropShadow)&&(o.dropShadowMulti=e.dropShadow.map(function(y){return On(y,"dropShadow",t)})),f(e.innerShadow)&&(o.IrSh=On(e.innerShadow[0],"innerShadow",t)),d(e.innerShadow)&&(o.innerShadowMulti=e.innerShadow.map(function(y){return On(y,"innerShadow",t)})),e.outerGlow&&(o.OrGl=On(e.outerGlow,"outerGlow",t)),d(e.solidFill)&&(o.solidFillMulti=e.solidFill.map(function(y){return On(y,"solidFill",t)})),d(e.gradientOverlay)&&(o.gradientFillMulti=e.gradientOverlay.map(function(y){return On(y,"gradientOverlay",t)})),d(e.stroke)&&(o.frameFXMulti=e.stroke.map(function(y){return P4(y)})),e.innerGlow&&(o.IrGl=On(e.innerGlow,"innerGlow",t)),e.bevel&&(o.ebbl=On(e.bevel,"bevel",t)),f(e.solidFill)&&(o.SoFi=On(e.solidFill[0],"solidFill",t)),e.patternOverlay&&(o.patternFill=On(e.patternOverlay,"patternOverlay",t)),f(e.gradientOverlay)&&(o.GrFl=On(e.gradientOverlay[0],"gradientOverlay",t)),e.satin&&(o.ChFX=On(e.satin,"satin",t)),f(e.stroke)&&(o.FrFX=P4((i=e.stroke)===null||i===void 0?void 0:i[0])),r){o.numModifyingFX=0;for(var p=0,_=Object.keys(e);p<_.length;p++){var u=_[p],h=e[u];if(Array.isArray(h))for(var b=0,v=h;b<v.length;b++){var m=v[b];m.enabled&&o.numModifyingFX++}else h.enabled&&o.numModifyingFX++}}return o}function Il(e,t){var r={},n=e.masterFXSwitch,a=e.DrSh,i=e.dropShadowMulti,o=e.IrSh,s=e.innerShadowMulti,l=e.OrGl,c=e.IrGl,u=e.ebbl,d=e.SoFi,f=e.solidFillMulti,p=e.patternFill,_=e.GrFl,h=e.gradientFillMulti,b=e.ChFX,v=e.FrFX,m=e.frameFXMulti;e.numModifyingFX;var y=nR(e,["masterFXSwitch","DrSh","dropShadowMulti","IrSh","innerShadowMulti","OrGl","IrGl","ebbl","SoFi","solidFillMulti","patternFill","GrFl","gradientFillMulti","ChFX","FrFX","frameFXMulti","numModifyingFX"]);return n||(r.disabled=!0),e["Scl "]&&(r.scale=mt(e["Scl "])),a&&(r.dropShadow=[In(a,t)]),i&&(r.dropShadow=i.map(function(g){return In(g,t)})),o&&(r.innerShadow=[In(o,t)]),s&&(r.innerShadow=s.map(function(g){return In(g,t)})),l&&(r.outerGlow=In(l,t)),c&&(r.innerGlow=In(c,t)),u&&(r.bevel=In(u,t)),d&&(r.solidFill=[In(d,t)]),f&&(r.solidFill=f.map(function(g){return In(g,t)})),p&&(r.patternOverlay=In(p,t)),_&&(r.gradientOverlay=[In(_,t)]),h&&(r.gradientOverlay=h.map(function(g){return In(g,t)})),b&&(r.satin=In(b,t)),v&&(r.stroke=[O4(v)]),m&&(r.stroke=m.map(function(g){return O4(g)})),t&&Object.keys(y).length>1&&console.log("Unhandled effect keys:",y),r}function F4(e,t){for(var r=[],n=0;n<e.length;n++){var a=e[n],i=a.time,o=i.denominator,s=i.numerator,l=a.selected,c=a.animKey,u={numerator:s,denominator:o},d=J4.decode(a.animInterpStyle);switch(c.Type){case"keyType.Opct":r.push({interpolation:d,time:u,selected:l,type:"opacity",value:mt(c.Opct)});break;case"keyType.Pstn":r.push({interpolation:d,time:u,selected:l,type:"position",x:c.Hrzn,y:c.Vrtc});break;case"keyType.Trnf":r.push({interpolation:d,time:u,selected:l,type:"transform",scale:Ml(c["Scl "]),skew:Ml(c.Skew),rotation:c.rotation,translation:Ml(c.translation)});break;case"keyType.sheetStyle":{var f={interpolation:d,time:u,selected:l,type:"style"};c.sheetStyle.Lefx&&(f.style=Il(c.sheetStyle.Lefx,t)),r.push(f);break}case"keyType.globalLighting":{r.push({interpolation:d,time:u,selected:l,type:"globalLighting",globalAngle:c.gblA,globalAltitude:c.globalAltitude});break}default:throw new Error("Unsupported keyType value")}}return r}function R4(e){for(var t=[],r=0;r<e.length;r++){var n=e[r],a=n.time,i=n.selected,o=i===void 0?!1:i,s=n.interpolation,l=J4.encode(s),c=void 0;switch(n.type){case"opacity":c={Type:"keyType.Opct",Opct:Vr(n.value)};break;case"position":c={Type:"keyType.Pstn",Hrzn:n.x,Vrtc:n.y};break;case"transform":c={Type:"keyType.Trnf","Scl ":Dl(n.scale),Skew:Dl(n.skew),rotation:n.rotation,translation:Dl(n.translation)};break;case"style":c={Type:"keyType.sheetStyle",sheetStyle:{Vrsn:1,blendOptions:{}}},n.style&&(c.sheetStyle={Vrsn:1,Lefx:zl(n.style,!1,!1),blendOptions:{}});break;case"globalLighting":{c={Type:"keyType.globalLighting",gblA:n.globalAngle,globalAltitude:n.globalAltitude};break}default:throw new Error("Unsupported keyType value")}t.push({Vrsn:1,animInterpStyle:l,time:a,animKey:c,selected:o})}return t}function L4(e,t){for(var r=[],n=0;n<e.length;n++){var a=e[n],i={type:Q4.decode(a.trackID),enabled:a.enab,keys:F4(a.keyList,t)};a.effectParams&&(i.effectParams={fillCanvas:a.effectParams.fillCanvas,zoomOrigin:a.effectParams.zoomOrigin,keys:F4(a.effectParams.keyList,t)}),r.push(i)}return r}function B4(e){for(var t=[],r=0;r<e.length;r++){var n=e[r];t.push(di(di({trackID:Q4.encode(n.type),Vrsn:1,enab:!!n.enabled,Effc:!!n.effectParams},n.effectParams?{effectParams:{keyList:R4(n.keys),fillCanvas:n.effectParams.fillCanvas,zoomOrigin:n.effectParams.zoomOrigin}}:{}),{keyList:R4(n.keys)}))}return t}function In(e,t){for(var r={},n=0,a=Object.keys(e);n<a.length;n++){var i=a[n],o=e[i];switch(i){case"enab":r.enabled=!!o;break;case"uglg":r.useGlobalLight=!!o;break;case"AntA":r.antialiased=!!o;break;case"Algn":r.align=!!o;break;case"Dthr":r.dither=!!o;break;case"Invr":r.invert=!!o;break;case"Rvrs":r.reverse=!!o;break;case"Clr ":r.color=oa(o);break;case"hglC":r.highlightColor=oa(o);break;case"sdwC":r.shadowColor=oa(o);break;case"Styl":r.position=Wc.decode(o);break;case"Md ":r.blendMode=bn.decode(o);break;case"hglM":r.highlightBlendMode=bn.decode(o);break;case"sdwM":r.shadowBlendMode=bn.decode(o);break;case"bvlS":r.style=K4.decode(o);break;case"bvlD":r.direction=Y4.decode(o);break;case"bvlT":r.technique=W4.decode(o);break;case"GlwT":r.technique=X4.decode(o);break;case"glwS":r.source=Z4.decode(o);break;case"Type":r.type=qc.decode(o);break;case"gs99":r.interpolationMethod=gs.decode(o);break;case"Opct":r.opacity=mt(o);break;case"hglO":r.highlightOpacity=mt(o);break;case"sdwO":r.shadowOpacity=mt(o);break;case"lagl":r.angle=ji(o);break;case"Angl":r.angle=ji(o);break;case"Lald":r.altitude=ji(o);break;case"Sftn":r.soften=Jt(o);break;case"srgR":r.strength=mt(o);break;case"blur":r.size=Jt(o);break;case"Nose":r.noise=mt(o);break;case"Inpr":r.range=mt(o);break;case"Ckmt":r.choke=Jt(o);break;case"ShdN":r.jitter=mt(o);break;case"Dstn":r.distance=Jt(o);break;case"Scl ":r.scale=mt(o);break;case"Ptrn":r.pattern={name:o["Nm "],id:o.Idnt};break;case"phase":r.phase={x:o.Hrzn,y:o.Vrtc};break;case"Ofst":r.offset={x:mt(o.Hrzn),y:mt(o.Vrtc)};break;case"MpgS":case"TrnS":r.contour={name:o["Nm "],curve:o["Crv "].map(function(s){return{x:s.Hrzn,y:s.Vrtc}})};break;case"Grad":r.gradient=$4(o);break;case"useTexture":case"useShape":case"layerConceals":case"present":case"showInDialog":case"antialiasGloss":r[i]=o;break;case"_name":case"_classID":break;default:t&&console.log("Invalid effect key: '".concat(i,"', value:"),o)}}return r}function On(e,t,r){var n={enab:!1};t==="dropShadow"&&(n.TrnS={"Nm ":"","Crv ":[]});for(var a=0,i=Object.keys(e);a<i.length;a++){var o=i[a],s=o,l=e[s];switch(s){case"enabled":n.enab=!!l;break;case"useGlobalLight":n.uglg=!!l;break;case"antialiased":n.AntA=!!l;break;case"align":n.Algn=!!l;break;case"dither":n.Dthr=!!l;break;case"invert":n.Invr=!!l;break;case"reverse":n.Rvrs=!!l;break;case"color":n["Clr "]=sa(l);break;case"highlightColor":n.hglC=sa(l);break;case"shadowColor":n.sdwC=sa(l);break;case"position":n.Styl=Wc.encode(l);break;case"blendMode":n["Md "]=bn.encode(l);break;case"highlightBlendMode":n.hglM=bn.encode(l);break;case"shadowBlendMode":n.sdwM=bn.encode(l);break;case"style":n.bvlS=K4.encode(l);break;case"direction":n.bvlD=Y4.encode(l);break;case"technique":t==="bevel"?n.bvlT=W4.encode(l):n.GlwT=X4.encode(l);break;case"source":n.glwS=Z4.encode(l);break;case"type":n.Type=qc.encode(l);break;case"interpolationMethod":n.gs99=gs.encode(l);break;case"opacity":n.Opct=Vr(l);break;case"highlightOpacity":n.hglO=Vr(l);break;case"shadowOpacity":n.sdwO=Vr(l);break;case"angle":t==="gradientOverlay"||t==="patternFill"?n.Angl=Fl(l):n.lagl=Fl(l);break;case"altitude":n.Lald=Fl(l);break;case"soften":n.Sftn=pr(l,s);break;case"strength":n.srgR=Vr(l);break;case"size":n.blur=pr(l,s);break;case"noise":n.Nose=Vr(l);break;case"range":n.Inpr=Vr(l);break;case"choke":n.Ckmt=pr(l,s);break;case"jitter":n.ShdN=Vr(l);break;case"distance":n.Dstn=pr(l,s);break;case"scale":n["Scl "]=Vr(l);break;case"pattern":n.Ptrn={"Nm ":l.name,Idnt:l.id};break;case"phase":n.phase={Hrzn:l.x,Vrtc:l.y};break;case"offset":n.Ofst={Hrzn:Vr(l.x),Vrtc:Vr(l.y)};break;case"contour":{n[t==="satin"?"MpgS":"TrnS"]={"Nm ":l.name,"Crv ":l.curve.map(function(c){return{Hrzn:c.x,Vrtc:c.y}})};break}case"gradient":n.Grad=N4(l);break;case"useTexture":case"useShape":case"layerConceals":case"present":case"showInDialog":case"antialiasGloss":n[s]=l;break;default:r&&console.log("Invalid effect key: '".concat(s,"', value:"),l)}}return n}function $4(e){if(e.GrdF==="GrdF.CstS"){var t=e.Intr||4096;return{type:"solid",name:e["Nm "],smoothness:e.Intr/4096,colorStops:e.Clrs.map(function(r){return{color:oa(r["Clr "]),location:r.Lctn/t,midpoint:r.Mdpn/100}}),opacityStops:e.Trns.map(function(r){return{opacity:mt(r.Opct),location:r.Lctn/t,midpoint:r.Mdpn/100}})}}else return{type:"noise",name:e["Nm "],roughness:e.Smth/4096,colorModel:Kc.decode(e.ClrS),randomSeed:e.RndS,restrictColors:!!e.VctC,addTransparency:!!e.ShTr,min:e["Mnm "].map(function(r){return r/100}),max:e["Mxm "].map(function(r){return r/100})}}function N4(e){var t,r;if(e.type==="solid"){var n=Math.round(((t=e.smoothness)!==null&&t!==void 0?t:1)*4096);return{"Nm ":e.name||"",GrdF:"GrdF.CstS",Intr:n,Clrs:e.colorStops.map(function(a){var i;return{"Clr ":sa(a.color),Type:"Clry.UsrS",Lctn:Math.round(a.location*n),Mdpn:Math.round(((i=a.midpoint)!==null&&i!==void 0?i:.5)*100)}}),Trns:e.opacityStops.map(function(a){var i;return{Opct:Vr(a.opacity),Lctn:Math.round(a.location*n),Mdpn:Math.round(((i=a.midpoint)!==null&&i!==void 0?i:.5)*100)}})}}else return{GrdF:"GrdF.ClNs","Nm ":e.name||"",ShTr:!!e.addTransparency,VctC:!!e.restrictColors,ClrS:Kc.encode(e.colorModel),RndS:e.randomSeed||0,Smth:Math.round(((r=e.roughness)!==null&&r!==void 0?r:1)*4096),"Mnm ":(e.min||[0,0,0,0]).map(function(a){return a*100}),"Mxm ":(e.max||[1,1,1,1]).map(function(a){return a*100})}}function U4(e){var t=$4(e.Grad);return t.style=qc.decode(e.Type),e.Dthr!==void 0&&(t.dither=e.Dthr),e.gradientsInterpolationMethod!==void 0&&(t.interpolationMethod=gs.decode(e.gradientsInterpolationMethod)),e.Rvrs!==void 0&&(t.reverse=e.Rvrs),e.Angl!==void 0&&(t.angle=ji(e.Angl)),e["Scl "]!==void 0&&(t.scale=mt(e["Scl "])),e.Algn!==void 0&&(t.align=e.Algn),e.Ofst!==void 0&&(t.offset={x:mt(e.Ofst.Hrzn),y:mt(e.Ofst.Vrtc)}),t}function H4(e){var t={name:e.Ptrn["Nm "],id:e.Ptrn.Idnt};return e.Lnkd!==void 0&&(t.linked=e.Lnkd),e.phase!==void 0&&(t.phase={x:e.phase.Hrzn,y:e.phase.Vrtc}),t}function Ol(e){if("Grad"in e)return U4(e);if("Ptrn"in e)return di({type:"pattern"},H4(e));if("Clr "in e)return{type:"color",color:oa(e["Clr "])};throw new Error("Invalid vector content")}function j4(e){var t={};return e.dither!==void 0&&(t.Dthr=e.dither),e.interpolationMethod!==void 0&&(t.gradientsInterpolationMethod=gs.encode(e.interpolationMethod)),e.reverse!==void 0&&(t.Rvrs=e.reverse),e.angle!==void 0&&(t.Angl=Fl(e.angle)),t.Type=qc.encode(e.style),e.align!==void 0&&(t.Algn=e.align),e.scale!==void 0&&(t["Scl "]=Vr(e.scale)),e.offset&&(t.Ofst={Hrzn:Vr(e.offset.x),Vrtc:Vr(e.offset.y)}),t.Grad=N4(e),t}function G4(e){var t={Ptrn:{"Nm ":e.name||"",Idnt:e.id||""}};return e.linked!==void 0&&(t.Lnkd=!!e.linked),e.phase!==void 0&&(t.phase={Hrzn:e.phase.x,Vrtc:e.phase.y}),t}function Pl(e){return e.type==="color"?{key:"SoCo",descriptor:{"Clr ":sa(e.color)}}:e.type==="pattern"?{key:"PtFl",descriptor:G4(e)}:{key:"GdFl",descriptor:j4(e)}}function oa(e){if("H "in e)return{h:uR(e["H "]),s:e.Strt,b:e.Brgh};if("Rd "in e)return{r:e["Rd "],g:e["Grn "],b:e["Bl "]};if("Cyn "in e)return{c:e["Cyn "],m:e.Mgnt,y:e["Ylw "],k:e.Blck};if("Gry "in e)return{k:e["Gry "]};if("Lmnc"in e)return{l:e.Lmnc,a:e["A "],b:e["B "]};if("redFloat"in e)return{fr:e.redFloat,fg:e.greenFloat,fb:e.blueFloat};throw new Error("Unsupported color descriptor")}function sa(e){if(e){if("r"in e)return{_name:"",_classID:"RGBC","Rd ":e.r||0,"Grn ":e.g||0,"Bl ":e.b||0};if("fr"in e)return{_name:"",_classID:"RGBC",redFloat:e.fr,greenFloat:e.fg,blueFloat:e.fb};if("h"in e)return{_name:"",_classID:"HSBC","H ":Fl(e.h*360),Strt:e.s||0,Brgh:e.b||0};if("c"in e)return{_name:"",_classID:"CMYC","Cyn ":e.c||0,Mgnt:e.m||0,"Ylw ":e.y||0,Blck:e.k||0};if("l"in e)return{_name:"",_classID:"LABC",Lmnc:e.l||0,"A ":e.a||0,"B ":e.b||0};if("k"in e)return{_name:"",_classID:"GRYC","Gry ":e.k};throw new Error("Invalid color value")}else return{_name:"",_classID:"RGBC","Rd ":0,"Grn ":0,"Bl ":0}}function ji(e){if(e===void 0)return 0;if(e.units!=="Angle")throw new Error("Invalid units: ".concat(e.units));return e.value}function mt(e){if(e===void 0)return 1;if(e.units!=="Percent")throw new Error("Invalid units: ".concat(e.units));return e.value/100}function uR(e){if(e===void 0)return 1;if(e.units==="Percent")return e.value/100;if(e.units==="Angle")return e.value/360;throw new Error("Invalid units: ".concat(e.units))}function Jt(e){var t=e.units,r=e.value;if(t!=="Pixels"&&t!=="Millimeters"&&t!=="Points"&&t!=="None"&&t!=="Picas"&&t!=="Inches"&&t!=="Centimeters"&&t!=="Density")throw new Error("Invalid units: ".concat(JSON.stringify({units:t,value:r})));return{value:r,units:t}}function Gi(e,t){return t===void 0&&(t="Pixels"),typeof e=="number"?{value:e,units:t}:Jt(e)}function Vc(e,t){var r=e.units,n=e.value;if(r!==t)throw new Error("Invalid units: ".concat(JSON.stringify({units:r,value:n})));return n}function Fl(e){return{units:"Angle",value:e||0}}function Vr(e){return{units:"Percent",value:Math.round((e||0)*100)}}function Xn(e){return{units:"Percent",value:(e||0)*100}}function pr(e,t){if(e==null)return{units:"Pixels",value:0};if(typeof e!="object")throw new Error("Invalid value: ".concat(JSON.stringify(e)," (key: ").concat(t,") (should have value and units)"));var r=e.units,n=e.value;if(typeof n!="number")throw new Error("Invalid value in ".concat(JSON.stringify(e)," (key: ").concat(t,")"));if(r!=="Pixels"&&r!=="Millimeters"&&r!=="Points"&&r!=="None"&&r!=="Picas"&&r!=="Inches"&&r!=="Centimeters"&&r!=="Density")throw new Error("Invalid units in ".concat(JSON.stringify(e)," (key: ").concat(t,")"));return{units:r,value:n}}function gn(e){var t=e.numerator,r=e.denominator;return{numerator:t,denominator:r}}var V4=_t("textGridding","none",{none:"None",round:"Rnd "}),Rl=_t("Ornt","horizontal",{horizontal:"Hrzn",vertical:"Vrtc"}),q4=_t("Annt","sharp",{none:"Anno",sharp:"antiAliasSharp",crisp:"AnCr",strong:"AnSt",smooth:"AnSm",platform:"antiAliasPlatformGray",platformLCD:"antiAliasPlatformLCD"}),wp=_t("warpStyle","none",{none:"warpNone",arc:"warpArc",arcLower:"warpArcLower",arcUpper:"warpArcUpper",arch:"warpArch",bulge:"warpBulge",shellLower:"warpShellLower",shellUpper:"warpShellUpper",flag:"warpFlag",wave:"warpWave",fish:"warpFish",rise:"warpRise",fisheye:"warpFisheye",inflate:"warpInflate",squeeze:"warpSqueeze",twist:"warpTwist",cylinder:"warpCylinder",custom:"warpCustom"}),bn=_t("BlnM","normal",{normal:"Nrml",dissolve:"Dslv",darken:"Drkn",multiply:"Mltp","color burn":"CBrn","linear burn":"linearBurn","darker color":"darkerColor",lighten:"Lghn",screen:"Scrn","color dodge":"CDdg","linear dodge":"linearDodge","lighter color":"lighterColor",overlay:"Ovrl","soft light":"SftL","hard light":"HrdL","vivid light":"vividLight","linear light":"linearLight","pin light":"pinLight","hard mix":"hardMix",difference:"Dfrn",exclusion:"Xclu",subtract:"blendSubtraction",divide:"blendDivide",hue:"H ",saturation:"Strt",color:"Clr ",luminosity:"Lmns","linear height":"linearHeight",height:"Hght",subtraction:"Sbtr"}),K4=_t("BESl","inner bevel",{"inner bevel":"InrB","outer bevel":"OtrB",emboss:"Embs","pillow emboss":"PlEb","stroke emboss":"strokeEmboss"}),W4=_t("bvlT","smooth",{smooth:"SfBL","chisel hard":"PrBL","chisel soft":"Slmt"}),Y4=_t("BESs","up",{up:"In ",down:"Out "}),X4=_t("BETE","softer",{softer:"SfBL",precise:"PrBL"}),Z4=_t("IGSr","edge",{edge:"SrcE",center:"SrcC"}),qc=_t("GrdT","linear",{linear:"Lnr ",radial:"Rdl ",angle:"Angl",reflected:"Rflc",diamond:"Dmnd"}),J4=_t("animInterpStyle","linear",{linear:"Lnr ",hold:"hold"}),Q4=_t("stdTrackID","opacity",{opacity:"opacityTrack",style:"styleTrack",sheetTransform:"sheetTransformTrack",sheetPosition:"sheetPositionTrack",globalLighting:"globalLightingTrack"}),gs=_t("gradientInterpolationMethodType","perceptual",{perceptual:"Perc",linear:"Lnr ",classic:"Gcls",smooth:"Smoo"}),Kc=_t("ClrS","rgb",{rgb:"RGBC",hsb:"HSBl",lab:"LbCl",hsl:"HSLC"}),Wc=_t("FStl","outside",{outside:"OutF",center:"CtrF",inside:"InsF"}),ey=_t("FrFl","color",{color:"SClr",gradient:"GrFl",pattern:"Ptrn"}),ty=_t("ESliceType","image",{image:"Img ",noImage:"noImage"}),ry=_t("ESliceHorzAlign","default",{default:"default"}),ny=_t("ESliceVertAlign","default",{default:"default"}),ay=_t("ESliceOrigin","userGenerated",{userGenerated:"userGenerated",autoGenerated:"autoGenerated",layer:"layer"}),iy=_t("ESliceBGColorType","none",{none:"None",matte:"matte",color:"Clr "}),oy=_t("strokeStyleLineCapType","butt",{butt:"strokeStyleButtCap",round:"strokeStyleRoundCap",square:"strokeStyleSquareCap"}),sy=_t("strokeStyleLineJoinType","miter",{miter:"strokeStyleMiterJoin",round:"strokeStyleRoundJoin",bevel:"strokeStyleBevelJoin"}),ly=_t("strokeStyleLineAlignment","inside",{inside:"strokeStyleAlignInside",center:"strokeStyleAlignCenter",outside:"strokeStyleAlignOutside"}),cy=_t("BlrM","ispinmage",{spin:"Spn ",zoom:"Zm "}),uy=_t("BlrQ","good",{draft:"Drft",good:"Gd ",best:"Bst "}),fy=_t("SmBM","normal",{normal:"SBMN","edge only":"SBME","overlay edge":"SBMO"}),dy=_t("SmBQ","medium",{low:"SBQL",medium:"SBQM",high:"SBQH"}),py=_t("DspM","stretch to fit",{"stretch to fit":"StrF",tile:"Tile"}),bs=_t("UndA","repeat edge pixels",{"wrap around":"WrpA","repeat edge pixels":"RptE"}),hy=_t("Cnvr","rectangular to polar",{"rectangular to polar":"RctP","polar to rectangular":"PlrR"}),vy=_t("RplS","medium",{small:"Sml ",medium:"Mdm ",large:"Lrg "}),my=_t("SphM","normal",{normal:"Nrml","horizontal only":"HrzO","vertical only":"VrtO"}),gy=_t("Wvtp","sine",{sine:"WvSn",triangle:"WvTr",square:"WvSq"}),by=_t("ZZTy","pond ripples",{"around center":"ArnC","out from center":"OtFr","pond ripples":"PndR"}),yy=_t("Dstr","uniform",{uniform:"Unfr",gaussian:"Gsn "}),Ll=_t("Chnl","composite",{red:"Rd ",green:"Grn ",blue:"Bl ",composite:"Cmps"}),_y=_t("MztT","fine dots",{"fine dots":"FnDt","medium dots":"MdmD","grainy dots":"GrnD","coarse dots":"CrsD","short lines":"ShrL","medium lines":"MdmL","long lines":"LngL","short strokes":"ShSt","medium strokes":"MdmS","long strokes":"LngS"}),xy=_t("Lns ","50-300mm zoom",{"50-300mm zoom":"Zm ","32mm prime":"Nkn ","105mm prime":"Nkn1","movie prime":"PnVs"}),wy=_t("blurType","gaussian blur",{"gaussian blur":"GsnB","lens blur":"lensBlur","motion blur":"MtnB"}),ky=_t("DfsM","normal",{normal:"Nrml","darken only":"DrkO","lighten only":"LghO",anisotropic:"anisotropic"}),Sy=_t("ExtT","blocks",{blocks:"Blks",pyramids:"Pyrm"}),Cy=_t("ExtR","random",{random:"Rndm","level-based":"LvlB"}),Ey=_t("FlCl","background color",{"background color":"FlBc","foreground color":"FlFr","inverse image":"FlIn","unaltered image":"FlSm"}),Ay=_t("CntE","upper",{lower:"Lwr ",upper:"Upr "}),Ty=_t("WndM","wind",{wind:"Wnd ",blast:"Blst",stagger:"Stgr"}),My=_t("Drct","from the right",{left:"Left",right:"Rght"}),Dy=_t("IntE","odd lines",{"odd lines":"ElmO","even lines":"ElmE"}),zy=_t("IntC","interpolation",{duplication:"CrtD",interpolation:"CrtI"}),Iy=_t("FlMd","wrap around",{"set to transparent":"Bckg","repeat edge pixels":"Rpt ","wrap around":"Wrp "});_t("prjM","fisheye",{fisheye:"fisP",perspective:"perP",auto:"auto","full spherical":"fusP"});var Oy=_t("presetKindType","presetKindCustom",{custom:"presetKindCustom",default:"presetKindDefault"}),ys=function(){return ys=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++){t=arguments[r];for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a])}return e},ys.apply(this,arguments)},Py=[],Fy={};function Gt(e,t,r,n){var a={key:e,has:t,read:r,write:n};Py.push(a),Fy[a.key]=a}var Yc=[void 0,"PPI","PPCM"],Xc=[void 0,"Inches","Centimeters","Points","Picas","Columns"],Ry="0123456789abcdef";function Ly(e){return e<=57?e-48:e-87}function fR(e,t){return Ly(e.charCodeAt(t))<<4|Ly(e.charCodeAt(t+1))}function kp(e,t){var r=Tr(e,t);return m4(r)}function Sp(e,t){var r=v4(t);pa(e,r)}function dR(e){for(var t=at(e),r=Tr(e,t),n=!1,a=0;a<r.byteLength;a++)if(r[a]&128){n=!0;break}if(n){var i=new TextDecoder("gbk");return i.decode(r)}else return m4(r)}function pR(e,t){for(var r="",n=0,a=t.codePointAt(n++);a!==void 0;a=t.codePointAt(n++))r+=a>127?"?":String.fromCodePoint(a);var i=v4(r);Qe(e,i.byteLength),pa(e,i)}Gt(1061,function(e){return e.captionDigest!==void 0},function(e,t){for(var r="",n=0;n<16;n++){var a=at(e);r+=Ry[a>>4],r+=Ry[a&15]}t.captionDigest=r},function(e,t){for(var r=0;r<16;r++)Qe(e,fR(t.captionDigest,r*2))}),Gt(1060,function(e){return e.xmpMetadata!==void 0},function(e,t,r){t.xmpMetadata=kp(e,r())},function(e,t){Sp(e,t.xmpMetadata)});var Zc=_t("Inte","perceptual",{perceptual:"Img ",saturation:"Grp ","relative colorimetric":"Clrm","absolute colorimetric":"AClr"});Gt(1082,function(e){return e.printInformation!==void 0},function(e,t){var r,n,a=Ft(e);t.printInformation={printerName:a.printerName||"",renderingIntent:Zc.decode((r=a.Inte)!==null&&r!==void 0?r:"Inte.Img ")};var i=t.printInformation;a.PstS!==void 0&&(i.printerManagesColors=a.PstS),a["Nm "]!==void 0&&(i.printerProfile=a["Nm "]),a.MpBl!==void 0&&(i.blackPointCompensation=a.MpBl),a.printSixteenBit!==void 0&&(i.printSixteenBit=a.printSixteenBit),a.hardProof!==void 0&&(i.hardProof=a.hardProof),a.printProofSetup&&("Bltn"in a.printProofSetup?i.proofSetup={builtin:a.printProofSetup.Bltn.split(".")[1]}:i.proofSetup={profile:a.printProofSetup.profile,renderingIntent:Zc.decode((n=a.printProofSetup.Inte)!==null&&n!==void 0?n:"Inte.Img "),blackPointCompensation:!!a.printProofSetup.MpBl,paperWhite:!!a.printProofSetup.paperWhite})},function(e,t){var r,n,a=t.printInformation,i={};a.printerManagesColors?i.PstS=!0:(a.hardProof!==void 0&&(i.hardProof=!!a.hardProof),i.ClrS="ClrS.RGBC",i["Nm "]=(r=a.printerProfile)!==null&&r!==void 0?r:"CIE RGB"),i.Inte=Zc.encode(a.renderingIntent),a.printerManagesColors||(i.MpBl=!!a.blackPointCompensation),i.printSixteenBit=!!a.printSixteenBit,i.printerName=a.printerName||"",a.proofSetup&&"profile"in a.proofSetup?i.printProofSetup={profile:a.proofSetup.profile||"",Inte:Zc.encode(a.proofSetup.renderingIntent),MpBl:!!a.proofSetup.blackPointCompensation,paperWhite:!!a.proofSetup.paperWhite}:i.printProofSetup={Bltn:!((n=a.proofSetup)===null||n===void 0)&&n.builtin?"builtinProof.".concat(a.proofSetup.builtin):"builtinProof.proofCMYK"},Lt(e,"","printOutput",i)}),Gt(1005,function(e){return e.resolutionInfo!==void 0},function(e,t){var r=Pn(e),n=et(e),a=et(e),i=Pn(e),o=et(e),s=et(e);t.resolutionInfo={horizontalResolution:r,horizontalResolutionUnit:Yc[n]||"PPI",widthUnit:Xc[a]||"Inches",verticalResolution:i,verticalResolutionUnit:Yc[o]||"PPI",heightUnit:Xc[s]||"Inches"}},function(e,t){var r=t.resolutionInfo;Ln(e,r.horizontalResolution||0),Ve(e,Math.max(1,Yc.indexOf(r.horizontalResolutionUnit))),Ve(e,Math.max(1,Xc.indexOf(r.widthUnit))),Ln(e,r.verticalResolution||0),Ve(e,Math.max(1,Yc.indexOf(r.verticalResolutionUnit))),Ve(e,Math.max(1,Xc.indexOf(r.heightUnit)))});var By=["centered","size to fit","user defined"];Gt(1062,function(e){return e.printScale!==void 0},function(e,t){t.printScale={style:By[Ot(e)],x:la(e),y:la(e),scale:la(e)}},function(e,t){var r=t.printScale,n=r.style,a=r.x,i=r.y,o=r.scale;Vt(e,Math.max(0,By.indexOf(n))),fa(e,a||0),fa(e,i||0),fa(e,o||0)}),Gt(1006,function(e){return e.alphaChannelNames!==void 0},function(e,t,r){if(t.alphaChannelNames)ct(e,r());else for(t.alphaChannelNames=[];r()>0;){var n=dR(e);t.alphaChannelNames.push(n)}},function(e,t){for(var r=0,n=t.alphaChannelNames;r<n.length;r++){var a=n[r];pR(e,a)}}),Gt(1045,function(e){return e.alphaChannelNames!==void 0},function(e,t,r){for(t.alphaChannelNames=[];r()>0;)t.alphaChannelNames.push(Rr(e))},function(e,t){for(var r=0,n=t.alphaChannelNames;r<n.length;r++){var a=n[r];So(e,a)}}),Gt(1053,function(e){return e.alphaIdentifiers!==void 0},function(e,t,r){for(t.alphaIdentifiers=[];r()>=4;)t.alphaIdentifiers.push(Ne(e))},function(e,t){for(var r=0,n=t.alphaIdentifiers;r<n.length;r++){var a=n[r];it(e,a)}}),Gt(1010,function(e){return e.backgroundColor!==void 0},function(e,t){return t.backgroundColor=qr(e)},function(e,t){return Kr(e,t.backgroundColor)}),Gt(1037,function(e){return e.globalAngle!==void 0},function(e,t){return t.globalAngle=dt(e)},function(e,t){return gt(e,t.globalAngle)}),Gt(1049,function(e){return e.globalAltitude!==void 0},function(e,t){return t.globalAltitude=Ne(e)},function(e,t){return it(e,t.globalAltitude)}),Gt(1011,function(e){return e.printFlags!==void 0},function(e,t){t.printFlags={labels:!!at(e),cropMarks:!!at(e),colorBars:!!at(e),registrationMarks:!!at(e),negative:!!at(e),flip:!!at(e),interpolate:!!at(e),caption:!!at(e),printFlags:!!at(e)}},function(e,t){var r=t.printFlags;Qe(e,r.labels?1:0),Qe(e,r.cropMarks?1:0),Qe(e,r.colorBars?1:0),Qe(e,r.registrationMarks?1:0),Qe(e,r.negative?1:0),Qe(e,r.flip?1:0),Qe(e,r.interpolate?1:0),Qe(e,r.caption?1:0),Qe(e,r.printFlags?1:0)}),Gt(1034,function(e){return e.copyrighted!==void 0},function(e,t){t.copyrighted=!!at(e)},function(e,t){Qe(e,t.copyrighted?1:0)}),Gt(1035,function(e){return e.url!==void 0},function(e,t,r){t.url=tu(e,r())},function(e,t){iL(e,t.url)}),Gt(1080,function(e){return e.countInformation!==void 0},function(e,t){var r=Ft(e);t.countInformation=r.countGroupList.map(function(n){return{color:{r:n["Rd "],g:n["Grn "],b:n["Bl "]},name:n["Nm "],size:n["Rds "],fontSize:n.fontSize,visible:n.Vsbl,points:n.countObjectList.map(function(a){return{x:a["X "],y:a["Y "]}})}})},function(e,t){var r={Vrsn:1,countGroupList:t.countInformation.map(function(n){return{"Rd ":n.color.r,"Grn ":n.color.g,"Bl ":n.color.b,"Nm ":n.name,"Rds ":n.size,fontSize:n.fontSize,Vsbl:n.visible,countObjectList:n.points.map(function(a){return{"X ":a.x,"Y ":a.y}})}})};Lt(e,"","Cnt ",r)}),Gt(1024,function(e){return e.layerState!==void 0},function(e,t){return t.layerState=et(e)},function(e,t){return Ve(e,t.layerState)}),Gt(1026,function(e){return e.layersGroup!==void 0},function(e,t,r){for(t.layersGroup=[];r()>0;)t.layersGroup.push(et(e))},function(e,t){for(var r=0,n=t.layersGroup;r<n.length;r++){var a=n[r];Ve(e,a)}}),Gt(1072,function(e){return e.layerGroupsEnabledId!==void 0},function(e,t,r){for(t.layerGroupsEnabledId=[];r()>0;)t.layerGroupsEnabledId.push(at(e))},function(e,t){for(var r=0,n=t.layerGroupsEnabledId;r<n.length;r++){var a=n[r];Qe(e,a)}}),Gt(1069,function(e){return e.layerSelectionIds!==void 0},function(e,t){var r=et(e);for(t.layerSelectionIds=[];r--;)t.layerSelectionIds.push(Ne(e))},function(e,t){Ve(e,t.layerSelectionIds.length);for(var r=0,n=t.layerSelectionIds;r<n.length;r++){var a=n[r];it(e,a)}}),Gt(1032,function(e){return e.gridAndGuidesInformation!==void 0},function(e,t){var r=Ne(e),n=Ne(e),a=Ne(e),i=Ne(e);if(r!==1)throw new Error("Invalid 1032 resource version: ".concat(r));t.gridAndGuidesInformation={grid:{horizontal:n,vertical:a},guides:[]};for(var o=0;o<i;o++)t.gridAndGuidesInformation.guides.push({location:Ne(e)/32,direction:at(e)?"horizontal":"vertical"})},function(e,t){var r=t.gridAndGuidesInformation,n=r.grid||{horizontal:18*32,vertical:18*32},a=r.guides||[];it(e,1),it(e,n.horizontal),it(e,n.vertical),it(e,a.length);for(var i=0,o=a;i<o.length;i++){var s=o[i];it(e,s.location*32),Qe(e,s.direction==="horizontal"?1:0)}}),Gt(1065,function(e){return e.layerComps!==void 0},function(e,t){var r=Ft(e,!0);t.layerComps={list:[]};for(var n=0,a=r.list;n<a.length;n++){var i=a[n];t.layerComps.list.push({id:i.compID,name:i["Nm "],capturedInfo:i.capturedInfo}),"comment"in i&&(t.layerComps.list[t.layerComps.list.length-1].comment=i.comment)}"lastAppliedComp"in r&&(t.layerComps.lastApplied=r.lastAppliedComp)},function(e,t){for(var r=t.layerComps,n={list:[]},a=0,i=r.list;a<i.length;a++){var o=i[a],s={};s._classID="Comp",s["Nm "]=o.name,"comment"in o&&(s.comment=o.comment),s.compID=o.id,s.capturedInfo=o.capturedInfo,n.list.push(s)}"lastApplied"in r&&(n.lastAppliedComp=r.lastApplied),Lt(e,"","CompList",n)});var $y=["normal",void 0,void 0,void 0,void 0,void 0,void 0,"multiply","screen",void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,"difference"];Gt(1078,function(e){return e.onionSkins!==void 0},function(e,t){var r=Ft(e);t.onionSkins={enabled:r.enab,framesBefore:r.numBefore,framesAfter:r.numAfter,frameSpacing:r.Spcn,minOpacity:r.minOpacity/100,maxOpacity:r.maxOpacity/100,blendMode:$y[r.BlnM]||"normal"}},function(e,t){var r=t.onionSkins,n={Vrsn:1,enab:r.enabled,numBefore:r.framesBefore,numAfter:r.framesAfter,Spcn:r.frameSpacing,minOpacity:r.minOpacity*100|0,maxOpacity:r.maxOpacity*100|0,BlnM:Math.max(0,$y.indexOf(r.blendMode))};Lt(e,"","null",n)}),Gt(1075,function(e){return e.timelineInformation!==void 0},function(e,t){var r,n,a=Ft(e);t.timelineInformation={enabled:a.enab,frameStep:gn(a.frameStep),frameRate:a.frameRate,time:gn(a.time),duration:gn(a.duration),workInTime:gn(a.workInTime),workOutTime:gn(a.workOutTime),repeats:a.LCnt,hasMotion:a.hasMotion,globalTracks:L4(a.globalTrackList,!!e.logMissingFeatures)},!((n=(r=a.audioClipGroupList)===null||r===void 0?void 0:r.audioClipGroupList)===null||n===void 0)&&n.length&&(t.timelineInformation.audioClipGroups=a.audioClipGroupList.audioClipGroupList.map(function(i){return{id:i.groupID,muted:i.muted,audioClips:i.audioClipList.map(function(o){var s=o.clipID,l=o.timeScope,c=o.muted,u=o.audioLevel,d=o.frameReader;return{id:s,start:gn(l.Strt),duration:gn(l.duration),inTime:gn(l.inTime),outTime:gn(l.outTime),muted:c,audioLevel:u,frameReader:{type:d.frameReaderType,mediaDescriptor:d.mediaDescriptor,link:{name:d["Lnk "]["Nm "],fullPath:d["Lnk "].fullPath,relativePath:d["Lnk "].relPath}}}})}}))},function(e,t){var r,n=t.timelineInformation,a={Vrsn:1,enab:n.enabled,frameStep:n.frameStep,frameRate:n.frameRate,time:n.time,duration:n.duration,workInTime:n.workInTime,workOutTime:n.workOutTime,LCnt:n.repeats,globalTrackList:B4(n.globalTracks),audioClipGroupList:{audioClipGroupList:(r=n.audioClipGroups)===null||r===void 0?void 0:r.map(function(i){return{groupID:i.id,muted:i.muted,audioClipList:i.audioClips.map(function(o){return{clipID:o.id,timeScope:{Vrsn:1,Strt:o.start,duration:o.duration,inTime:o.inTime,outTime:o.outTime},frameReader:{frameReaderType:o.frameReader.type,descVersion:1,"Lnk ":{descVersion:1,"Nm ":o.frameReader.link.name,fullPath:o.frameReader.link.fullPath,relPath:o.frameReader.link.relativePath},mediaDescriptor:o.frameReader.mediaDescriptor},muted:o.muted,audioLevel:o.audioLevel}})}})},hasMotion:n.hasMotion};Lt(e,"","null",a,"anim")}),Gt(1076,function(e){return e.sheetDisclosure!==void 0},function(e,t){var r=Ft(e);t.sheetDisclosure={},r.sheetTimelineOptions&&(t.sheetDisclosure.sheetTimelineOptions=r.sheetTimelineOptions.map(function(n){return{sheetID:n.sheetID,sheetDisclosed:n.sheetDisclosed,lightsDisclosed:n.lightsDisclosed,meshesDisclosed:n.meshesDisclosed,materialsDisclosed:n.materialsDisclosed}}))},function(e,t){var r=t.sheetDisclosure,n={Vrsn:1};r.sheetTimelineOptions&&(n.sheetTimelineOptions=r.sheetTimelineOptions.map(function(a){return{Vrsn:2,sheetID:a.sheetID,sheetDisclosed:a.sheetDisclosed,lightsDisclosed:a.lightsDisclosed,meshesDisclosed:a.meshesDisclosed,materialsDisclosed:a.materialsDisclosed}})),Lt(e,"","null",n)}),Gt(1054,function(e){return e.urlsList!==void 0},function(e,t){var r=Ne(e);t.urlsList=[];for(var n=0;n<r;n++){var a=lr(e);if(a!=="slic"&&e.throwForMissingFeatures)throw new Error("Unknown long");var i=Ne(e),o=Rr(e);t.urlsList.push({id:i,url:o,ref:"slice"})}},function(e,t){var r=t.urlsList;it(e,r.length);for(var n=0;n<r.length;n++)yt(e,"slic"),it(e,r[n].id),Bn(e,r[n].url)});function Ny(e){return{"Top ":e.top,Left:e.left,Btom:e.bottom,Rght:e.right}}function Uy(e){return{top:e["Top "],left:e.Left,bottom:e.Btom,right:e.Rght}}function Jc(e,t){return e[Math.max(0,Math.min(e.length-1,t))]}var Hy=["autoGenerated","layer","userGenerated"],jy=["noImage","image"],Qc=["default"];Gt(1050,function(e){return e.slices?e.slices.length:0},function(e,t){var r=Ne(e);if(r===6){t.slices||(t.slices=[]);var n=dt(e),a=dt(e),i=dt(e),o=dt(e),s=Rr(e),l=Ne(e);t.slices.push({bounds:{top:n,left:a,bottom:i,right:o},groupName:s,slices:[]});for(var c=t.slices[t.slices.length-1].slices,u=0;u<l;u++){var d=Ne(e),f=Ne(e),p=Jc(Hy,Ne(e)),_=p=="layer"?Ne(e):0,h=Rr(e),b=Jc(jy,Ne(e)),v=dt(e),m=dt(e),y=dt(e),g=dt(e),S=Rr(e),M=Rr(e),E=Rr(e),w=Rr(e),x=!!at(e),C=Rr(e),D=Jc(Qc,Ne(e)),B=Jc(Qc,Ne(e)),F=at(e),K=at(e),te=at(e),J=at(e),ne=F+K+te+J===0?"none":F===0?"matte":"color";c.push({id:d,groupId:f,origin:p,associatedLayerId:_,name:h,target:M,message:E,altTag:w,cellTextIsHTML:x,cellText:C,horizontalAlignment:D,verticalAlignment:B,type:b,url:S,bounds:{top:m,left:v,bottom:g,right:y},backgroundColorType:ne,backgroundColor:{r:K,g:te,b:J,a:F}})}var le=Ft(e);le.slices.forEach(function(q){var j=c.find(function(P){return q.sliceID==P.id});j&&(j.topOutset=q.topOutset,j.leftOutset=q.leftOutset,j.bottomOutset=q.bottomOutset,j.rightOutset=q.rightOutset)})}else if(r===7||r===8){var le=Ft(e);t.slices||(t.slices=[]),t.slices.push({groupName:le.baseName,bounds:Uy(le.bounds),slices:le.slices.map(function(j){return ys(ys({},j["Nm "]?{name:j["Nm "]}:{}),{id:j.sliceID,groupId:j.groupID,associatedLayerId:0,origin:ay.decode(j.origin),type:ty.decode(j.Type),bounds:Uy(j.bounds),url:j.url,target:j.null,message:j.Msge,altTag:j.altTag,cellTextIsHTML:j.cellTextIsHTML,cellText:j.cellText,horizontalAlignment:ry.decode(j.horzAlign),verticalAlignment:ny.decode(j.vertAlign),backgroundColorType:iy.decode(j.bgColorType),backgroundColor:j.bgColor?{r:j.bgColor["Rd "],g:j.bgColor["Grn "],b:j.bgColor["Bl "],a:j.bgColor.alpha}:{r:0,g:0,b:0,a:0},topOutset:j.topOutset||0,leftOutset:j.leftOutset||0,bottomOutset:j.bottomOutset||0,rightOutset:j.rightOutset||0})})})}else throw new Error("Invalid slices version (".concat(r,")"))},function(e,t,r){var n=t.slices[r],a=n.bounds,i=n.groupName,o=n.slices;it(e,6),gt(e,a.top),gt(e,a.left),gt(e,a.bottom),gt(e,a.right),Bn(e,i),it(e,o.length);for(var s=0;s<o.length;s++){var l=o[s],c=l.backgroundColor,u=c.a,d=c.r,f=c.g,p=c.b;l.backgroundColorType==="none"?u=d=f=p=0:l.backgroundColorType==="matte"&&(u=0,d=f=p=255),it(e,l.id),it(e,l.groupId),it(e,Hy.indexOf(l.origin)),l.origin==="layer"&&it(e,l.associatedLayerId),Bn(e,l.name||""),it(e,jy.indexOf(l.type)),gt(e,l.bounds.left),gt(e,l.bounds.top),gt(e,l.bounds.right),gt(e,l.bounds.bottom),Bn(e,l.url),Bn(e,l.target),Bn(e,l.message),Bn(e,l.altTag),Qe(e,l.cellTextIsHTML?1:0),Bn(e,l.cellText),it(e,Qc.indexOf(l.horizontalAlignment)),it(e,Qc.indexOf(l.verticalAlignment)),Qe(e,u),Qe(e,d),Qe(e,f),Qe(e,p)}var _={bounds:Ny(a),slices:[]};o.forEach(function(h){var b=ys(ys({sliceID:h.id,groupID:h.groupId,origin:ay.encode(h.origin),Type:ty.encode(h.type),bounds:Ny(h.bounds)},h.name?{"Nm ":h.name}:{}),{url:h.url,null:h.target,Msge:h.message,altTag:h.altTag,cellTextIsHTML:h.cellTextIsHTML,cellText:h.cellText,horzAlign:ry.encode(h.horizontalAlignment),vertAlign:ny.encode(h.verticalAlignment),bgColorType:iy.encode(h.backgroundColorType)});if(h.backgroundColorType==="color"){var v=h.backgroundColor,m=v.r,y=v.g,g=v.b,S=v.a;b.bgColor={"Rd ":m,"Grn ":y,"Bl ":g,alpha:S}}b.topOutset=h.topOutset||0,b.leftOutset=h.leftOutset||0,b.bottomOutset=h.bottomOutset||0,b.rightOutset=h.rightOutset||0,_.slices.push(b)}),Lt(e,"","null",_,"slices")}),Gt(1064,function(e){return e.pixelAspectRatio!==void 0},function(e,t){if(Ne(e)>2)throw new Error("Invalid pixelAspectRatio version");t.pixelAspectRatio={aspect:Zn(e)}},function(e,t){it(e,2),Jn(e,t.pixelAspectRatio.aspect)}),Gt(1041,function(e){return e.iccUntaggedProfile!==void 0},function(e,t){t.iccUntaggedProfile=!!at(e)},function(e,t){Qe(e,t.iccUntaggedProfile?1:0)}),Gt(1044,function(e){return e.idsSeedNumber!==void 0},function(e,t){return t.idsSeedNumber=Ne(e)},function(e,t){return it(e,t.idsSeedNumber)}),Gt(1036,function(e){return e.thumbnail!==void 0||e.thumbnailRaw!==void 0},function(e,t,r){var n=Ne(e),a=Ne(e),i=Ne(e);Ne(e),Ne(e),Ne(e);var o=et(e),s=et(e);if(n!==1||o!==24||s!==1){e.logMissingFeatures&&e.log("Invalid thumbnail data (format: ".concat(n,", bitsPerPixel: ").concat(o,", planes: ").concat(s,")")),ct(e,r());return}var l=r(),c=Tr(e,l);e.useRawThumbnail?t.thumbnailRaw={width:a,height:i,data:c}:c.byteLength&&(t.thumbnail=VF(c))},function(e,t){var r,n=0,a=0,i=new Uint8Array(0);if(t.thumbnailRaw)n=t.thumbnailRaw.width,a=t.thumbnailRaw.height,i=t.thumbnailRaw.data;else try{var o=(r=t.thumbnail.toDataURL("image/jpeg",1))===null||r===void 0?void 0:r.substring(23);o&&(i=d4(o),n=t.thumbnail.width,a=t.thumbnail.height)}catch{}var s=24,l=Math.floor((n*s+31)/32)*4,c=1,u=l*a*c,d=i.length;it(e,1),it(e,n),it(e,a),it(e,l),it(e,u),it(e,d),Ve(e,s),Ve(e,c),pa(e,i)}),Gt(1057,function(e){return e.versionInfo!==void 0},function(e,t,r){var n=Ne(e);if(n!==1)throw new Error("Invalid versionInfo version");t.versionInfo={hasRealMergedData:!!at(e),writerName:Rr(e),readerName:Rr(e),fileVersion:Ne(e)},ct(e,r())},function(e,t){var r=t.versionInfo;it(e,1),Qe(e,r.hasRealMergedData?1:0),Bn(e,r.writerName),Bn(e,r.readerName),it(e,r.fileVersion)}),Gt(7e3,function(e){return e.imageReadyVariables!==void 0},function(e,t,r){t.imageReadyVariables=kp(e,r())},function(e,t){Sp(e,t.imageReadyVariables)}),Gt(7001,function(e){return e.imageReadyDataSets!==void 0},function(e,t,r){t.imageReadyDataSets=kp(e,r())},function(e,t){Sp(e,t.imageReadyDataSets)}),Gt(1088,function(e){return e.pathSelectionState!==void 0},function(e,t,r){var n=Ft(e);t.pathSelectionState=n.null},function(e,t){var r={null:t.pathSelectionState};Lt(e,"","null",r)});var Gy=_t("FrmD","",{auto:"Auto",none:"None",dispose:"Disp"});Gt(4e3,function(e){return e.animations!==void 0},function(e,t,r){var n=lr(e);if(n==="mani")Na(e,"IRFR"),Fn(e,1,function(i){for(var o=function(){Na(e,"8BIM");var s=lr(e);Fn(e,1,function(l){if(s==="AnDs"){var c=Ft(e);t.animations={frames:c.FrIn.map(function(d){return{id:d.FrID,delay:(d.FrDl||0)/100,dispose:d.FrDs?Gy.decode(d.FrDs):"auto"}}),animations:c.FSts.map(function(d){return{id:d.FsID,frames:d.FsFr,repeats:d.LCnt,activeFrame:d.AFrm||0}})}}else if(s==="Roll"){var u=Tr(e,l());e.logDevFeatures&&e.log("#4000 Roll",u)}else e.logMissingFeatures&&e.log("Unhandled subsection in #4000",s)})};i()>0;)o()});else if(n==="mopt"){var a=Tr(e,r());e.logDevFeatures&&e.log("#4000 mopt",a)}else e.logMissingFeatures&&e.log("Unhandled key in #4000:",n)},function(e,t){t.animations&&(yt(e,"mani"),yt(e,"IRFR"),Jr(e,1,function(){yt(e,"8BIM"),yt(e,"AnDs"),Jr(e,1,function(){for(var r={FrIn:[],FSts:[]},n=0;n<t.animations.frames.length;n++){var a=t.animations.frames[n],i={FrID:a.id};a.delay&&(i.FrDl=a.delay*100|0),i.FrDs=Gy.encode(a.dispose),r.FrIn.push(i)}for(var n=0;n<t.animations.animations.length;n++){var o=t.animations.animations[n],s={FsID:o.id,AFrm:o.activeFrame|0,FsFr:o.frames,LCnt:o.repeats|0};r.FSts.push(s)}Lt(e,"","null",r)})}))});var hR=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,n=Object.getOwnPropertySymbols(e);a<n.length;a++)t.indexOf(n[a])<0&&Object.prototype.propertyIsEnumerable.call(e,n[a])&&(r[n[a]]=e[n[a]]);return r},Vy=[0,1,3,2],vR=["bitmap","grayscale","indexed","RGB","CMYK","multichannel","duotone","lab"];function eu(e){for(var t=e.width*e.height*4,r=0;r<t;r+=4){var n=e.data[r];e.data[r+1]=n,e.data[r+2]=n}}function _s(e,t,r){var n=new DataView(e,t,r);return{view:n,offset:0,strict:!1,debug:!1,large:!1,globalAlpha:!1,log:console.log}}function Cp(e,t){if(e.strict)throw new Error(t);e.debug&&e.log(t)}function at(e){return e.offset+=1,e.view.getUint8(e.offset-1)}function mR(e){return e.view.getUint8(e.offset)}function Ot(e){return e.offset+=2,e.view.getInt16(e.offset-2,!1)}function et(e){return e.offset+=2,e.view.getUint16(e.offset-2,!1)}function gR(e){return e.offset+=2,e.view.getUint16(e.offset-2,!0)}function dt(e){return e.offset+=4,e.view.getInt32(e.offset-4,!1)}function qy(e){return e.offset+=4,e.view.getInt32(e.offset-4,!0)}function Ne(e){return e.offset+=4,e.view.getUint32(e.offset-4,!1)}function la(e){return e.offset+=4,e.view.getFloat32(e.offset-4,!1)}function Zn(e){return e.offset+=8,e.view.getFloat64(e.offset-8,!1)}function Pn(e){return dt(e)/65536}function ca(e){return dt(e)/(1<<24)}function Tr(e,t){var r=e.view.byteOffset+e.offset;if(e.offset+=t,r+t>e.view.buffer.byteLength){if(Cp(e,"Reading bytes exceeding buffer length"),t>100*1024*1024)throw new Error("Reading past end of file");var n=new Uint8Array(t),a=Math.min(t,e.view.byteLength-r);return a>0&&n.set(new Uint8Array(e.view.buffer,r,a)),n}else return new Uint8Array(e.view.buffer,r,t)}function lr(e){return Ky(e,4)}function bR(e,t){var r=String.fromCharCode(e.view.getUint8(t))+String.fromCharCode(e.view.getUint8(t+1))+String.fromCharCode(e.view.getUint8(t+2))+String.fromCharCode(e.view.getUint8(t+3));return r=="8BIM"||r=="8B64"}function ua(e,t){for(var r=at(e),n=r?Ky(e,r):"";++r%t;)e.offset++;return n}function Rr(e){var t=Ne(e);return Ep(e,t)}function Ep(e,t){for(var r="";t--;){var n=et(e);(n||t>0)&&(r+=String.fromCharCode(n))}return r}function yR(e,t){for(var r="";t--;){var n=gR(e);(n||t>0)&&(r+=String.fromCharCode(n))}return r}function tu(e,t){for(var r="";t--;)r+=String.fromCharCode(at(e));return r}function ct(e,t){e.offset+=t}function Na(e,t,r){var n=e.offset,a=lr(e);if(a!==t&&a!==r)throw new Error("Invalid signature: '".concat(a,"' at 0x").concat(n.toString(16)))}function Ky(e,t){for(var r=Tr(e,t),n="",a=0;a<r.length;a++)n+=String.fromCharCode(r[a]);return n}function _R(e){return e==="8BIM"||e==="MeSa"||e==="AgHg"||e==="PHUT"||e==="DCSR"}function xR(e,t){var r;t===void 0&&(t={}),Na(e,"8BPS");var n=et(e);if(n!==1&&n!==2)throw new Error("Invalid PSD file version: ".concat(n));ct(e,6);var a=et(e),i=Ne(e),o=Ne(e),s=et(e),l=et(e),c=n===1?3e4:3e5;if(o>c||i>c)throw new Error("Invalid size: ".concat(o,"x").concat(i));if(a>16)throw new Error("Invalid channel count: ".concat(a));if(![1,8,16,32].includes(s))throw new Error("Invalid bitsPerChannel: ".concat(s));if(Vy.indexOf(l)===-1)throw new Error("Color mode not supported: ".concat((r=vR[l])!==null&&r!==void 0?r:l));var u={width:o,height:i,channels:a,bitsPerChannel:s,colorMode:l};Object.assign(e,t),e.large=n===2,e.globalAlpha=!1,Fn(e,1,function(h){if(h()){if(l===2){if(h()!=768)throw new Error("Invalid color palette size");u.palette=[];for(var b=0;b<256;b++)u.palette.push({r:at(e),g:0,b:0});for(var b=0;b<256;b++)u.palette[b].g=at(e);for(var b=0;b<256;b++)u.palette[b].b=at(e)}ct(e,h())}});var d={};Fn(e,1,function(h){for(var b=function(){Zy(e,_R);var v=et(e);ua(e,2),Fn(e,2,function(m){var y=Fy[v],g=v===1036&&!!e.skipThumbnail;if(y&&!g)try{y.read(e,d,m)}catch(S){if(e.throwForMissingFeatures)throw S;ct(e,m())}else ct(e,m())})};h()>0;)b()}),d.layersGroup,d.layerGroupsEnabledId;var f=hR(d,["layersGroup","layerGroupsEnabledId"]);Object.keys(f)&&(u.imageResources=f),Fn(e,1,function(h){if(Fn(e,2,function(v){Ap(e,u,d),ct(e,v())},void 0,e.large),h()>0){var b=ER(e);b&&(u.globalLayerMaskInfo=b)}else ct(e,h());for(;h()>0;){for(;h()&&mR(e)===0;)ct(e,1);h()>=12?Jy(e,u,u,d):ct(e,h())}},void 0,e.large);var p=u.children&&u.children.length,_=e.skipCompositeImageData&&(e.skipLayerImageData||p);return _||MR(e,u),u}function Ap(e,t,r){var n,a,i=r.layersGroup,o=i===void 0?[]:i,s=r.layerGroupsEnabledId,l=s===void 0?[]:s,c=Ot(e);c<0&&(e.globalAlpha=!0,c=-c);for(var u=[],d=[],f=0;f<c;f++){var p=wR(e,t,r),_=p.layer,h=p.channels;o[f]!==void 0&&(_.linkGroup=o[f]),l[f]!==void 0&&(_.linkGroupEnabled=!!l[f]),u.push(_),d.push(h)}for(var f=0;f<c;f++)CR(e,t,u[f],d[f]);t.children||(t.children=[]);for(var b=[t],f=u.length-1;f>=0;f--){var v=u[f],m=v.sectionDivider?v.sectionDivider.type:0;m===1||m===2?(v.opened=m===1,v.children=[],!((n=v.sectionDivider)===null||n===void 0)&&n.key&&(v.blendMode=(a=fs[v.sectionDivider.key])!==null&&a!==void 0?a:v.blendMode),b[b.length-1].children.unshift(v),b.push(v)):m===3?b.pop():b[b.length-1].children.unshift(v)}}function wR(e,t,r){var n={};n.top=dt(e),n.left=dt(e),n.bottom=dt(e),n.right=dt(e);for(var a=et(e),i=[],o=0;o<a;o++){var s=Ot(e),l=Ne(e);if(e.large){if(l!==0)throw new Error("Sizes larger than 4GB are not supported");l=Ne(e)}i.push({id:s,length:l})}Na(e,"8BIM");var c=lr(e);if(!fs[c])throw new Error("Invalid blend mode: '".concat(c,"'"));n.blendMode=fs[c],n.opacity=at(e)/255,n.clipping=at(e)===1;var u=at(e);return n.transparencyProtected=(u&1)!==0,n.hidden=(u&2)!==0,u&32&&(n.effectsOpen=!0),ct(e,1),Fn(e,1,function(d){kR(e,n);var f=SR(e);for(f&&(n.blendingRanges=f),n.name=ua(e,1);d()>4&&!bR(e,e.offset);)e.offset++;for(;d()>=12;)Jy(e,n,t,r);ct(e,d())}),{layer:n,channels:i}}function kR(e,t){return Fn(e,1,function(r){if(r()){var n={};t.mask=n,n.top=dt(e),n.left=dt(e),n.bottom=dt(e),n.right=dt(e),n.defaultColor=at(e);var a=at(e);if(n.positionRelativeToLayer=(a&1)!==0,n.disabled=(a&2)!==0,n.fromVectorData=(a&8)!==0,r()>=18){var i={};t.realMask=i;var o=at(e);i.positionRelativeToLayer=(o&1)!==0,i.disabled=(o&2)!==0,i.fromVectorData=(o&8)!==0,i.defaultColor=at(e),i.top=dt(e),i.left=dt(e),i.bottom=dt(e),i.right=dt(e)}if(a&16){var s=at(e);s&1&&(n.userMaskDensity=at(e)/255),s&2&&(n.userMaskFeather=Zn(e)),s&4&&(n.vectorMaskDensity=at(e)/255),s&8&&(n.vectorMaskFeather=Zn(e))}ct(e,r())}})}function ru(e){return[at(e),at(e),at(e),at(e)]}function SR(e){return Fn(e,1,function(t){for(var r=ru(e),n=ru(e),a=[];t()>0;){var i=ru(e),o=ru(e);a.push({sourceRange:i,destRange:o})}return{compositeGrayBlendSource:r,compositeGraphBlendDestinationRange:n,ranges:a}})}function CR(e,t,r,n){if(!e.skipLayerImageData){var a=t.colorMode,i=a===void 0?3:a,o=t.bitsPerChannel,s=o===void 0?8:o;r.rawData={colorMode:i,bitsPerChannel:s,channels:[],large:e.large};for(var l=0,c=n;l<c.length;l++){var u=c[l],d=e.offset,f=0,p=void 0;if(u.length===1)throw new Error("Invalid channel length");if(u.length){if(f=et(e),f>3&&(e.offset-=1,f=et(e)),f>3&&(e.offset-=3,f=et(e)),f>3)throw new Error("Invalid compression: ".concat(f));u.length>2&&(p=Tr(e,u.length-2))}e.offset=d+u.length,r.rawData.channels.push({id:u.id,compression:f,data:p})}e.useRawData||Yy(r,!!e.useImageData,!!e.throwForMissingFeatures)}}function Wy(e,t){for(var r=e.data,n=r instanceof Float32Array?1:r instanceof Uint16Array?65535:255,a=(t?4:3)|0,i=r.length|0,o=(t?5:4)|0,s=a;s<i;s=s+o|0)r[s]=n}function Yy(e,t,r){if(e.rawData){var n=e.rawData,a=n.colorMode,i=n.bitsPerChannel,o=n.channels,s=n.large,l=(e.right||0)-(e.left||0),c=(e.bottom||0)-(e.top||0),u=a===4,d,f=!1;if(l&&c)if(u){if(i!==8)throw new Error("bitsPerChannel Not supproted");d={width:l,height:c,data:new Uint8ClampedArray(l*c*5)}}else d=Tp(l,c,i);for(var p=0,_=o;p<_.length;p++){var h=_[p],b=h.id,v=h.compression,m=h.data;if(m){var y=_s(m.buffer,m.byteOffset,m.byteLength);if(b===-2||b===-3){var g=b===-2?e.mask:e.realMask;if(!g)throw new Error("Missing layer ".concat(b===-2?"mask":"real mask"," data"));var S=(g.right||0)-(g.left||0),M=(g.bottom||0)-(g.top||0);if(S<0||M<0||S>3e4||M>3e4)throw new Error("Invalid mask size");if(S&&M){var E=Tp(S,M,i);Xy(y,m.byteLength,E,v,S,M,i,0,s,4),eu(E),Wy(E,!1),t?g.imageData=E:g.canvas=Hc(E)}}else{var w=c4(b,u),x=d;if(w<0&&(x=void 0,r))throw new Error("Channel not supported: ".concat(b));Xy(y,m.byteLength,x,v,l,c,i,w,s,u?5:4),x&&a===1&&eu(x)}b===-1&&(f=!0)}}if(d){if(f||Wy(d,u),u){var C=d;d=ps(C.width,C.height),Qy(C,d,!1)}t?e.imageData=d:e.canvas=Hc(d)}delete e.rawData}}function Xy(e,t,r,n,a,i,o,s,l,c){if(t)if(n===0){t!==a*i*Math.floor(o/8)&&e.log("Invalid length (".concat(t,", ").concat(a*i*Math.floor(o/8),")"));var u=Tr(e,t);t3(u,r,o,c,s)}else if(n===1)Vi(e,r,a,i,o,c,[s],l);else if(n===2){var u=Tr(e,t);r3(u,r,a,i,o,c,s,!1)}else if(n===3){var u=Tr(e,t);r3(u,r,a,i,o,c,s,!0)}else throw new Error("Invalid Compression type: ".concat(n))}function ER(e){return Fn(e,1,function(t){if(t()){var r=et(e),n=et(e),a=et(e),i=et(e),o=et(e),s=et(e)/255,l=at(e);return ct(e,t()),{overlayColorSpace:r,colorSpace1:n,colorSpace2:a,colorSpace3:i,colorSpace4:o,opacity:s,kind:l}}})}var AR=[0,1,-1,2,-2,3,-3,4,-4];function Zy(e,t){for(var r=e.offset,n="",a=0,i=AR;a<i.length;a++){var o=i[a];try{e.offset=r+o,n=lr(e)}catch{}if(t(n))break}if(!t(n))throw new Error("Invalid signature: '".concat(n,"' at 0x").concat(r.toString(16)));return n}function TR(e){return e==="8BIM"||e==="8B64"}function Jy(e,t,r,n){var a=Zy(e,TR),i=lr(e),o=a==="8B64"||e.large&&i4.indexOf(i)!==-1;Fn(e,2,function(s){var l=iu[i];if(l)try{l.read(e,t,s,r,n)}catch(c){if(e.throwForMissingFeatures)throw c}else e.logMissingFeatures&&e.log("Unhandled additional info: ".concat(i)),ct(e,s());s()&&(e.logMissingFeatures&&e.log("Unread ".concat(s()," bytes left for additional info: ").concat(i)),ct(e,s()))},!1,o)}function Tp(e,t,r,n){if(n===void 0&&(n=4),r===1||r===8)return n===4?ps(e,t):{width:e,height:t,data:new Uint8ClampedArray(e*t*n)};if(r===16)return{width:e,height:t,data:new Uint16Array(e*t*n)};if(r===32)return{width:e,height:t,data:new Float32Array(e*t*n)};throw new Error("Invalid bitDepth (".concat(r,")"))}function MR(e,t){var r,n=et(e),a=(r=t.bitsPerChannel)!==null&&r!==void 0?r:8;if(Vy.indexOf(t.colorMode)===-1)throw new Error("Color mode not supported: ".concat(t.colorMode));if(n!==0&&n!==1)throw new Error("Compression type not supported: ".concat(n));var i=Tp(t.width,t.height,a);switch(jF(i),t.colorMode){case 0:{if(a!==1)throw new Error("Invalid bitsPerChannel for bitmap color mode");var o=void 0;if(n===0)o=Tr(e,Math.ceil(t.width/8)*t.height);else if(n===1)o=new Uint8Array(t.width*t.height),Vi(e,{data:o,width:t.width,height:t.height},t.width,t.height,8,1,[0],e.large);else throw new Error("Bitmap compression not supported: ".concat(n));GF(o,i.data,t.width,t.height);break}case 3:case 1:{var s=t.colorMode===1?[0]:[0,1,2];if(t.channels&&t.channels>3)for(var l=3;l<t.channels;l++)s.push(l);else e.globalAlpha&&s.push(3);if(n===0)for(var l=0;l<s.length;l++){var c=Tr(e,t.width*t.height*Math.floor(a/8));t3(c,i,a,4,s[l])}else n===1&&(e.offset,Vi(e,i,t.width,t.height,a,4,s,e.large));t.colorMode===1&&eu(i);break}case 2:{if(a!==8)throw new Error("bitsPerChannel Not supproted");if(t.channels!==1)throw new Error("Invalid channel count");if(!t.palette)throw new Error("Missing color palette");if(n===0)throw new Error("Not implemented");if(n===1){var u={width:i.width,height:i.height,data:new Uint8Array(i.width*i.height)};Vi(e,u,t.width,t.height,a,1,[0],e.large),DR(u,i,t.palette)}else throw new Error("Not implemented");break}case 4:{if(a!==8)throw new Error("bitsPerChannel Not supproted");if(t.channels!==4)throw new Error("Invalid channel count");var s=[0,1,2,3];if(e.globalAlpha&&s.push(4),n===0)throw new Error("Not implemented");if(n===1){var d={width:i.width,height:i.height,data:new Uint8Array(i.width*i.height*5)};e.offset,Vi(e,d,t.width,t.height,a,5,s,e.large),Qy(d,i,!0)}else throw new Error("Not implemented");break}default:throw new Error("Color mode not supported: ".concat(t.colorMode))}if(e.globalAlpha){if(t.bitsPerChannel!==8)throw new Error("bitsPerChannel Not supproted");for(var f=i.data,p=i.width*i.height*4,l=0;l<p;l+=4){var _=f[l+3];if(_!=0&&_!=255){var h=_/255,b=1/h,v=255*(1-b);f[l+0]=f[l+0]*b+v,f[l+1]=f[l+1]*b+v,f[l+2]=f[l+2]*b+v}}}e.useImageData?t.imageData=i:t.canvas=Hc(i)}function Qy(e,t,r){for(var n=t.width*t.height*4,a=e.data,i=t.data,o=0,s=0;s<n;o+=5,s+=4){var l=a[o],c=a[o+1],u=a[o+2],d=a[o+3];i[s]=(l*d|0)/255|0,i[s+1]=(c*d|0)/255|0,i[s+2]=(u*d|0)/255|0,i[s+3]=r?255-a[o+4]:a[o+4]}}function DR(e,t,r){for(var n=e.width*e.height,a=e.data,i=t.data,o=0,s=0;o<n;o++,s+=4){var l=r[a[o]];i[s+0]=l.r,i[s+1]=l.g,i[s+2]=l.b,i[s+3]=255}}function zR(e,t){if(e.byteLength/e.length!==t.byteLength/t.length)throw new Error("Invalid array types")}function e3(e,t){if(t===8)return e;if(t===16){for(var r=0;r<e.byteLength;r+=2){var n=e[r];e[r]=e[r+1],e[r+1]=n}if(e.byteOffset%2){var a=new Uint16Array(e.byteLength/2);return new Uint8Array(a.buffer,a.byteOffset,a.byteLength).set(e),a}else return new Uint16Array(e.buffer,e.byteOffset,e.byteLength/2)}else if(t===32)if(e.byteOffset%4){var a=new Float32Array(e.byteLength/4);return new Uint8Array(a.buffer,a.byteOffset,a.byteLength).set(e),a}else return new Float32Array(e.buffer,e.byteOffset,e.byteLength/4);else throw new Error("Invalid bitDepth (".concat(t,")"))}function Mp(e,t,r,n){zR(e.data,t);for(var a=e.width*e.height,i=e.data,o=0,s=r|0;o<a;o++,s=s+n|0)i[s]=t[o]}function t3(e,t,r,n,a){if(r==32)for(var i=0;i<e.byteLength;i+=4){var o=e[i+0],s=e[i+1],l=e[i+2],c=e[i+3];e[i+0]=c,e[i+1]=l,e[i+2]=s,e[i+3]=o}var u=e3(e,r);t&&a<n&&Mp(t,u,a,n)}function Dp(e,t,r,n){for(var a=0;a<r;a++)for(var i=a*t,o=1,s=i+1;o<t;o++,s++)e[s]=(e[s-1]+e[s])%n}function r3(e,t,r,n,a,i,o,s){var l=OF(e);if(t&&o<i){var c=e3(l,a);if(a===8)s&&Dp(l,r,n,256),Mp(t,l,o,i);else if(a===16)s&&Dp(c,r,n,65536),Mp(t,c,o,i);else if(a===32){s&&Dp(l,r*4,n,256);for(var u=o,d=new Uint32Array(t.data.buffer,t.data.byteOffset,t.data.length),f=0;f<n;f++)for(var p=r*4*f,_=0;_<r;_++,p++,u+=i){var h=p+r,b=h+r,v=b+r;d[u]=(l[p]<<24|l[h]<<16|l[b]<<8|l[v])>>>0}}else throw new Error("Invalid bitDepth")}}function Vi(e,t,r,n,a,i,o,s){var l=t&&t.data,c;if(s){c=new Uint32Array(o.length*n);for(var u=0,d=0;u<o.length;u++)for(var f=0;f<n;f++,d++)c[d]=Ne(e)}else{c=new Uint16Array(o.length*n);for(var u=0,d=0;u<o.length;u++)for(var f=0;f<n;f++,d++)c[d]=et(e)}for(var p=i-1|0,_=0,d=0;_<o.length;_++){var h=o[_]|0,b=_>p||h>p;if(!l||b)for(var f=0;f<n;f++,d++)ct(e,c[d]);else for(var f=0,v=h|0;f<n;f++,d++)for(var m=c[d],y=Tr(e,m),g=0,S=0;g<m;g++){var M=y[g];if(M>128){var E=y[++g];M=256-M|0;for(var w=0;w<=M&&S<r;w=w+1|0,S=S+1|0)l[v]=E,v=v+i|0}else if(M<128)for(var w=0;w<=M&&S<r;w=w+1|0,S=S+1|0)l[v]=y[++g],v=v+i|0}}}function Fn(e,t,r,n,a){n===void 0&&(n=!0),a===void 0&&(a=!1);var i=Ne(e);if(a){if(i!==0)throw new Error("Sizes larger than 4GB are not supported");i=Ne(e)}if(!(i<=0&&n)){var o=e.offset+i;if(o>e.view.byteLength)throw new Error("Section exceeds file size");var s=r(function(){return o-e.offset});for(e.offset!==o&&(e.offset>o?Cp(e,"Exceeded section limits"):Cp(e,"Unread section data"));i%t;)i++,o++;return e.offset=o,s}}function qr(e){var t=et(e);switch(t){case 0:{var r=et(e)/257,n=et(e)/257,a=et(e)/257;return ct(e,2),{r,g:n,b:a}}case 1:{var i=et(e)/65535,o=et(e)/65535,a=et(e)/65535;return ct(e,2),{h:i,s:o,b:a}}case 2:{var s=et(e)/257,l=et(e)/257,c=et(e)/257,u=et(e)/257;return{c:s,m:l,y:c,k:u}}case 7:{var d=Ot(e)/1e4,f=Ot(e),p=Ot(e),_=f<0?f/12800:f/12700,a=p<0?p/12800:p/12700;return ct(e,2),{l:d,a:_,b:a}}case 8:{var u=et(e)*255/1e4;return ct(e,6),{k:u}}default:throw new Error("Invalid color space")}}function IR(e){for(var t=Ne(e);t%4;)t++;var r=e.offset+t,n=Ne(e);if(n!==1)throw new Error("Invalid pattern version: ".concat(n));var a=Ne(e),i=Ot(e),o=Ot(e);if(a!==3&&a!==1&&a!==2)throw new Error("Unsupported pattern color mode: ".concat(a));var s=Rr(e),l=ua(e,1),c=[];if(a===2){for(var u=0;u<256;u++)c.push({r:at(e),g:at(e),b:at(e)});ct(e,4)}var d=Ne(e);if(d!==3)throw new Error("Invalid pattern VMAL version: ".concat(d));Ne(e);for(var f=Ne(e),p=Ne(e),_=Ne(e),h=Ne(e),b=Ne(e),v=h-p,m=_-f,y=new Uint8Array(v*m*4),u=3;u<y.byteLength;u+=4)y[u]=255;for(var u=0,g=0;u<b+2;u++){var S=Ne(e);if(S){var M=Ne(e),E=Ne(e),w=Ne(e),x=Ne(e),C=Ne(e),D=Ne(e),B=et(e),F=at(e),K=M-23,te=Tr(e,K);if(E!==8||B!==8)throw new Error("16bit pixel depth not supported for patterns");var J=D-x,ne=C-w,le=x-p,q=w-f;if(F===0){if(a===3&&g<3)for(var j=0;j<ne;j++)for(var P=0;P<J;P++){var N=P+j*J,X=(le+P+(j+q)*v)*4;y[X+g]=te[N]}if(a===1&&g<1)for(var Ee=0;Ee<ne;Ee++)for(var Ae=0;Ae<J;Ae++){var N=Ae+Ee*J,X=(le+Ae+(Ee+q)*v)*4,ze=te[N];y[X+0]=ze,y[X+1]=ze,y[X+2]=ze}if(a===2)throw new Error("Indexed pattern color mode not implemented")}else if(F===1){var Le={data:y,width:v,height:m},he={data:new Uint8Array(J*ne),width:J,height:ne},Ie=_s(te.buffer,te.byteOffset,te.byteLength);if(a===3&&g<3&&(Vi(Ie,he,J,ne,8,1,[0],!1),n3(he,Le,le,q,g)),a===1&&g<1&&(Vi(Ie,he,J,ne,8,1,[0],!1),n3(he,Le,le,q,0),eu(Le)),a===2)throw new Error("Indexed pattern color mode not implemented")}else throw new Error("Invalid pattern compression mode");g++}}return e.offset=r,{id:l,name:s,x:i,y:o,bounds:{x:p,y:f,w:v,h:m},data:y}}function n3(e,t,r,n,a){for(var i=e.width,o=e.height,s=t.width,l=0;l<o;l++)for(var c=0;c<i;c++){var u=c+l*i,d=(r+c+(l+n)*s)*4,f=e.data[u];t.data[d+a]=f}}var a3=[void 0,"outer bevel","inner bevel","emboss","pillow emboss","stroke emboss"];function xs(e){return Na(e,"8BIM"),fs[lr(e)]||"normal"}function ws(e,t){yt(e,"8BIM"),yt(e,Uc[t]||"norm")}function ks(e){return at(e)/255}function Ss(e,t){Qe(e,Math.round(t*255)|0)}function OR(e){var t=et(e);if(t!==0)throw new Error("Invalid effects layer version: ".concat(t));for(var r=et(e),n={},a=0;a<r;a++){Na(e,"8BIM");var i=lr(e);switch(i){case"cmnS":{var o=Ne(e),s=Ne(e),l=!!at(e);if(ct(e,2),o!==7||s!==0||!l)throw new Error("Invalid effects common state");break}case"dsdw":case"isdw":{var c=Ne(e),u=Ne(e);if(c!==41&&c!==51)throw new Error("Invalid shadow size: ".concat(c));if(u!==0&&u!==2)throw new Error("Invalid shadow version: ".concat(u));var o=Pn(e);Pn(e);var d=Pn(e),f=Pn(e),p=qr(e),_=xs(e),h=!!at(e),b=!!at(e),v=ks(e);c>=51&&qr(e);var m={size:{units:"Pixels",value:o},distance:{units:"Pixels",value:f},angle:d,color:p,blendMode:_,enabled:h,useGlobalLight:b,opacity:v};i==="dsdw"?n.dropShadow=[m]:n.innerShadow=[m];break}case"oglw":{var c=Ne(e),y=Ne(e);if(c!==32&&c!==42)throw new Error("Invalid outer glow size: ".concat(c));if(y!==0&&y!==2)throw new Error("Invalid outer glow version: ".concat(y));var o=Pn(e);Pn(e);var p=qr(e),_=xs(e),h=!!at(e),v=ks(e);c>=42&&qr(e),n.outerGlow={size:{units:"Pixels",value:o},color:p,blendMode:_,enabled:h,opacity:v};break}case"iglw":{var c=Ne(e),g=Ne(e);if(c!==32&&c!==43)throw new Error("Invalid inner glow size: ".concat(c));if(g!==0&&g!==2)throw new Error("Invalid inner glow version: ".concat(g));var o=Pn(e);Pn(e);var p=qr(e),_=xs(e),h=!!at(e),v=ks(e);c>=43&&(at(e),qr(e)),n.innerGlow={size:{units:"Pixels",value:o},color:p,blendMode:_,enabled:h,opacity:v};break}case"bevl":{var c=Ne(e),S=Ne(e);if(c!==58&&c!==78)throw new Error("Invalid bevel size: ".concat(c));if(S!==0&&S!==2)throw new Error("Invalid bevel version: ".concat(S));var d=Pn(e),M=Pn(e),o=Pn(e),E=xs(e),w=xs(e),x=qr(e),C=qr(e),D=a3[at(e)]||"inner bevel",B=ks(e),F=ks(e),h=!!at(e),b=!!at(e),K=at(e)?"down":"up";c>=78&&(qr(e),qr(e)),n.bevel={size:{units:"Pixels",value:o},angle:d,strength:M,highlightBlendMode:E,shadowBlendMode:w,highlightColor:x,shadowColor:C,style:D,highlightOpacity:B,shadowOpacity:F,enabled:h,useGlobalLight:b,direction:K};break}case"sofi":{var o=Ne(e),te=Ne(e);if(o!==34)throw new Error("Invalid effects solid fill info size: ".concat(o));if(te!==2)throw new Error("Invalid effects solid fill info version: ".concat(te));var _=xs(e),p=qr(e),v=ks(e),h=!!at(e);qr(e),n.solidFill=[{blendMode:_,color:p,opacity:v,enabled:h}];break}default:throw new Error("Invalid effect type: '".concat(i,"'"))}}return n}function i3(e,t){var r;it(e,51),it(e,2),Ln(e,t.size&&t.size.value||0),Ln(e,0),Ln(e,t.angle||0),Ln(e,t.distance&&t.distance.value||0),Kr(e,t.color),ws(e,t.blendMode),Qe(e,t.enabled?1:0),Qe(e,t.useGlobalLight?1:0),Ss(e,(r=t.opacity)!==null&&r!==void 0?r:1),Kr(e,t.color)}function PR(e,t){var r,n,a,i,o,s,l=(r=t.dropShadow)===null||r===void 0?void 0:r[0],c=(n=t.innerShadow)===null||n===void 0?void 0:n[0],u=t.outerGlow,d=t.innerGlow,f=t.bevel,p=(a=t.solidFill)===null||a===void 0?void 0:a[0],_=1;if(l&&_++,c&&_++,u&&_++,d&&_++,f&&_++,p&&_++,Ve(e,0),Ve(e,_),yt(e,"8BIM"),yt(e,"cmnS"),it(e,7),it(e,0),Qe(e,1),qt(e,2),l&&(yt(e,"8BIM"),yt(e,"dsdw"),i3(e,l)),c&&(yt(e,"8BIM"),yt(e,"isdw"),i3(e,c)),u&&(yt(e,"8BIM"),yt(e,"oglw"),it(e,42),it(e,2),Ln(e,((i=u.size)===null||i===void 0?void 0:i.value)||0),Ln(e,0),Kr(e,u.color),ws(e,u.blendMode),Qe(e,u.enabled?1:0),Ss(e,u.opacity||0),Kr(e,u.color)),d&&(yt(e,"8BIM"),yt(e,"iglw"),it(e,43),it(e,2),Ln(e,((o=d.size)===null||o===void 0?void 0:o.value)||0),Ln(e,0),Kr(e,d.color),ws(e,d.blendMode),Qe(e,d.enabled?1:0),Ss(e,d.opacity||0),Qe(e,0),Kr(e,d.color)),f){yt(e,"8BIM"),yt(e,"bevl"),it(e,78),it(e,2),Ln(e,f.angle||0),Ln(e,f.strength||0),Ln(e,((s=f.size)===null||s===void 0?void 0:s.value)||0),ws(e,f.highlightBlendMode),ws(e,f.shadowBlendMode),Kr(e,f.highlightColor),Kr(e,f.shadowColor);var h=a3.indexOf(f.style);Qe(e,h<=0?1:h),Ss(e,f.highlightOpacity||0),Ss(e,f.shadowOpacity||0),Qe(e,f.enabled?1:0),Qe(e,f.useGlobalLight?1:0),Qe(e,f.direction==="down"?1:0),Kr(e,f.highlightColor),Kr(e,f.shadowColor)}p&&(yt(e,"8BIM"),yt(e,"sofi"),it(e,34),it(e,2),ws(e,p.blendMode),Kr(e,p.color),Ss(e,p.opacity||0),Qe(e,p.enabled?1:0),Kr(e,p.color))}function o3(e){return e===32||e===10||e===13||e===9}function s3(e){return e>=48&&e<=57||e===46||e===45}function l3(e){var t=0;function r(){for(;t<e.length&&o3(e[t]);)t++}function n(){var m=e[t];return t++,m===92&&(m=e[t],t++),m}function a(){var m="";if(e[t]===41)return t++,m;if(e[t]!==254||e[t+1]!==255)throw new Error("Invalid utf-16 BOM");for(t+=2;t<e.length&&e[t]!==41;){var y=n(),g=n(),S=y<<8|g;m+=String.fromCharCode(S)}return t++,m}var i=null,o=[];function s(m){o.length?(l(m),o.push(m)):(o.push(m),i=m)}function l(m){if(!o.length)throw new Error("Invalid data");var y=o[o.length-1];if(typeof y=="string")o[o.length-2][y]=m,u();else if(Array.isArray(y))y.push(m);else throw new Error("Invalid data")}function c(m){o.length||s({});var y=o[o.length-1];if(y&&typeof y=="string")l(m==="nil"?null:"/".concat(m));else if(y&&typeof y=="object")o.push(m);else throw new Error("Invalid data")}function u(){if(!o.length)throw new Error("Invalid data");o.pop()}r();for(var d=e.length;d>0&&e[d-1]===0;)d--;for(;t<d;){var f=t,p=e[f];if(p===60&&e[f+1]===60)t+=2,s({});else if(p===62&&e[f+1]===62)t+=2,u();else if(p===47){t+=1;for(var _=t;t<e.length&&!o3(e[t]);)t++;for(var h="",b=_;b<t;b++)h+=String.fromCharCode(e[b]);c(h)}else if(p===40)t+=1,l(a());else if(p===91)t+=1,s([]);else if(p===93)t+=1,u();else if(p===110&&e[f+1]===117&&e[f+2]===108&&e[f+3]===108)t+=4,l(null);else if(p===116&&e[f+1]===114&&e[f+2]===117&&e[f+3]===101)t+=4,l(!0);else if(p===102&&e[f+1]===97&&e[f+2]===108&&e[f+3]===115&&e[f+4]===101)t+=5,l(!1);else if(s3(p)){for(var v="";t<e.length&&s3(e[t]);)v+=String.fromCharCode(e[t]),t++;l(parseFloat(v))}else t+=1,console.log("Invalid token '".concat(String.fromCharCode(p),"' (").concat(p,") at ").concat(t));r()}return i}var FR=["Axis","XY","Zone","WordSpacing","FirstLineIndent","GlyphSpacing","StartIndent","EndIndent","SpaceBefore","SpaceAfter","LetterSpacing","Values","GridSize","GridLeading","PointBase","BoxBounds","TransformPoint0","TransformPoint1","TransformPoint2","FontSize","Leading","HorizontalScale","VerticalScale","BaselineShift","Tsume","OutlineWidth","AutoLeading"],RR=["RunLengthArray"];function LR(e,t){t===void 0&&(t=!1);var r=new Uint8Array(1024),n=0,a=0;function i(m){if(n>=r.length){var y=new Uint8Array(r.length*2);y.set(r),r=y}r[n]=m,n++}function o(m){for(var y=0;y<m.length;y++)i(m.charCodeAt(y))}function s(){if(t)o(" ");else for(var m=0;m<a;m++)o(" ")}function l(m,y){s(),o("/".concat(m)),_(y,m,!0),t||o(`
|
|
282
|
+
please report what input caused this bug`);return n=n.slice(1,-1),{type:"verb",mode:"text",body:n,star:a}}i2.hasOwnProperty(r[0])&&!yr[this.mode][r[0]]&&(this.settings.strict&&this.mode==="math"&&this.settings.reportNonstrict("unicodeTextInMathMode",'Accented Unicode text character "'+r[0]+'" used in math mode',t),r=i2[r[0]]+r.slice(1));var i=qI.exec(r);i&&(r=r.substring(0,i.index),r==="i"?r="ı":r==="j"&&(r="ȷ"));var o;if(yr[this.mode][r]){this.settings.strict&&this.mode==="math"&&Kf.includes(r)&&this.settings.reportNonstrict("unicodeTextInMathMode",'Latin-1/Unicode text character "'+r[0]+'" used in math mode',t);var s=yr[this.mode][r].group,l=_n.range(t),c;if(Kz.hasOwnProperty(s)){var u=s;c={type:"atom",mode:this.mode,family:u,loc:l,text:r}}else c={type:s,mode:this.mode,loc:l,text:r};o=c}else if(r.charCodeAt(0)>=128)this.settings.strict&&(Om(r.charCodeAt(0))?this.mode==="math"&&this.settings.reportNonstrict("unicodeTextInMathMode",'Unicode text character "'+r[0]+'" used in math mode',t):this.settings.reportNonstrict("unknownSymbol",'Unrecognized Unicode character "'+r[0]+'"'+(" ("+r.charCodeAt(0)+")"),t)),o={type:"textord",mode:"text",loc:_n.range(t),text:r};else return null;if(this.consume(),i)for(var d=0;d<i[0].length;d++){var f=i[0][d];if(!Sd[f])throw new Ze("Unknown accent ' "+f+"'",t);var p=Sd[f][this.mode]||Sd[f].text;if(!p)throw new Ze("Accent "+f+" unsupported in "+this.mode+" mode",t);o={type:"accent",mode:this.mode,loc:_n.range(t),label:p,isStretchy:!1,isShifty:!0,base:o}}return o}}gc.endOfExpression=new Set(["}","\\endgroup","\\end","\\right","&"]);var Cd=function(t,r){if(!(typeof t=="string"||t instanceof String))throw new TypeError("KaTeX can only parse string typed expression");var n=new gc(t,r);delete n.gullet.macros.current["\\df@tag"];var a=n.parse();if(delete n.gullet.macros.current["\\current@color"],delete n.gullet.macros.current["\\color"],n.gullet.macros.get("\\df@tag")){if(!r.displayMode)throw new Ze("\\tag works only in display equations");a=[{type:"tag",mode:"text",body:a,tag:n.subparse([new Mn("\\df@tag")])}]}return a},Ed=function(t,r,n){r.textContent="";var a=bc(t,n).toNode();r.appendChild(a)};typeof document<"u"&&document.compatMode!=="CSS1Compat"&&(typeof console<"u"&&console.warn("Warning: KaTeX doesn't work in quirks mode. Make sure your website has a suitable doctype."),Ed=function(){throw new Ze("KaTeX doesn't work in quirks mode.")});var o2=function(t,r){var n=bc(t,r).toMarkup();return n},s2=function(t,r){var n=new Lf(r);return Cd(t,n)},l2=function(t,r,n){if(n.throwOnError||!(t instanceof Ze))throw t;var a=Xe(["katex-error"],[new En(r)]);return a.setAttribute("title",t.toString()),a.setAttribute("style","color:"+n.errorColor),a},bc=function(t,r){var n=new Lf(r);try{var a=Cd(t,n);return cI(a,t,n)}catch(i){return l2(i,t,n)}},c2=function(t,r){var n=new Lf(r);try{var a=Cd(t,n);return uI(a,t,n)}catch(i){return l2(i,t,n)}},u2="0.16.45",f2={Span:Wo,Anchor:q0,SymbolNode:En,SvgNode:ni,PathNode:zi,LineNode:Uf},JI={version:u2,render:Ed,renderToString:o2,ParseError:Ze,SETTINGS_SCHEMA:j0,__parse:s2,__renderToDomTree:bc,__renderToHTMLTree:c2,__setFontMetrics:Nm,__defineSymbol:k,__defineFunction:ut,__defineMacro:W,__domTree:f2};const QI=Object.freeze(Object.defineProperty({__proto__:null,ParseError:Ze,SETTINGS_SCHEMA:j0,__defineFunction:ut,__defineMacro:W,__defineSymbol:k,__domTree:f2,__parse:s2,__renderToDomTree:bc,__renderToHTMLTree:c2,__setFontMetrics:Nm,default:JI,get render(){return Ed},renderToString:o2,version:u2},Symbol.toStringTag,{value:"Module"}));var eO=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function d2(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function tO(e){throw new Error('Could not dynamically require "'+e+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var p2={exports:{}},Ad={},h2;function Li(){return h2||(h2=1,function(e){var t=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Int32Array<"u";function r(i,o){return Object.prototype.hasOwnProperty.call(i,o)}e.assign=function(i){for(var o=Array.prototype.slice.call(arguments,1);o.length;){var s=o.shift();if(s){if(typeof s!="object")throw new TypeError(s+"must be non-object");for(var l in s)r(s,l)&&(i[l]=s[l])}}return i},e.shrinkBuf=function(i,o){return i.length===o?i:i.subarray?i.subarray(0,o):(i.length=o,i)};var n={arraySet:function(i,o,s,l,c){if(o.subarray&&i.subarray){i.set(o.subarray(s,s+l),c);return}for(var u=0;u<l;u++)i[c+u]=o[s+u]},flattenChunks:function(i){var o,s,l,c,u,d;for(l=0,o=0,s=i.length;o<s;o++)l+=i[o].length;for(d=new Uint8Array(l),c=0,o=0,s=i.length;o<s;o++)u=i[o],d.set(u,c),c+=u.length;return d}},a={arraySet:function(i,o,s,l,c){for(var u=0;u<l;u++)i[c+u]=o[s+u]},flattenChunks:function(i){return[].concat.apply([],i)}};e.setTyped=function(i){i?(e.Buf8=Uint8Array,e.Buf16=Uint16Array,e.Buf32=Int32Array,e.assign(e,n)):(e.Buf8=Array,e.Buf16=Array,e.Buf32=Array,e.assign(e,a))},e.setTyped(t)}(Ad)),Ad}var Qo={},ia={},fo={},v2;function rO(){if(v2)return fo;v2=1;var e=Li(),t=4,r=0,n=1,a=2;function i(L){for(var ge=L.length;--ge>=0;)L[ge]=0}var o=0,s=1,l=2,c=3,u=258,d=29,f=256,p=f+1+d,_=30,h=19,b=2*p+1,v=15,m=16,y=7,g=256,S=16,M=17,E=18,w=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],x=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],C=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],D=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],B=512,F=new Array((p+2)*2);i(F);var K=new Array(_*2);i(K);var te=new Array(B);i(te);var J=new Array(u-c+1);i(J);var ne=new Array(d);i(ne);var le=new Array(_);i(le);function q(L,ge,Oe,He,de){this.static_tree=L,this.extra_bits=ge,this.extra_base=Oe,this.elems=He,this.max_length=de,this.has_stree=L&&L.length}var j,P,N;function X(L,ge){this.dyn_tree=L,this.max_code=0,this.stat_desc=ge}function Ee(L){return L<256?te[L]:te[256+(L>>>7)]}function Ae(L,ge){L.pending_buf[L.pending++]=ge&255,L.pending_buf[L.pending++]=ge>>>8&255}function ze(L,ge,Oe){L.bi_valid>m-Oe?(L.bi_buf|=ge<<L.bi_valid&65535,Ae(L,L.bi_buf),L.bi_buf=ge>>m-L.bi_valid,L.bi_valid+=Oe-m):(L.bi_buf|=ge<<L.bi_valid&65535,L.bi_valid+=Oe)}function Le(L,ge,Oe){ze(L,Oe[ge*2],Oe[ge*2+1])}function he(L,ge){var Oe=0;do Oe|=L&1,L>>>=1,Oe<<=1;while(--ge>0);return Oe>>>1}function Ie(L){L.bi_valid===16?(Ae(L,L.bi_buf),L.bi_buf=0,L.bi_valid=0):L.bi_valid>=8&&(L.pending_buf[L.pending++]=L.bi_buf&255,L.bi_buf>>=8,L.bi_valid-=8)}function De(L,ge){var Oe=ge.dyn_tree,He=ge.max_code,de=ge.stat_desc.static_tree,Me=ge.stat_desc.has_stree,G=ge.stat_desc.extra_bits,je=ge.stat_desc.extra_base,wt=ge.stat_desc.max_length,A,ie,ae,U,fe,oe,tt=0;for(U=0;U<=v;U++)L.bl_count[U]=0;for(Oe[L.heap[L.heap_max]*2+1]=0,A=L.heap_max+1;A<b;A++)ie=L.heap[A],U=Oe[Oe[ie*2+1]*2+1]+1,U>wt&&(U=wt,tt++),Oe[ie*2+1]=U,!(ie>He)&&(L.bl_count[U]++,fe=0,ie>=je&&(fe=G[ie-je]),oe=Oe[ie*2],L.opt_len+=oe*(U+fe),Me&&(L.static_len+=oe*(de[ie*2+1]+fe)));if(tt!==0){do{for(U=wt-1;L.bl_count[U]===0;)U--;L.bl_count[U]--,L.bl_count[U+1]+=2,L.bl_count[wt]--,tt-=2}while(tt>0);for(U=wt;U!==0;U--)for(ie=L.bl_count[U];ie!==0;)ae=L.heap[--A],!(ae>He)&&(Oe[ae*2+1]!==U&&(L.opt_len+=(U-Oe[ae*2+1])*Oe[ae*2],Oe[ae*2+1]=U),ie--)}}function Be(L,ge,Oe){var He=new Array(v+1),de=0,Me,G;for(Me=1;Me<=v;Me++)He[Me]=de=de+Oe[Me-1]<<1;for(G=0;G<=ge;G++){var je=L[G*2+1];je!==0&&(L[G*2]=he(He[je]++,je))}}function Z(){var L,ge,Oe,He,de,Me=new Array(v+1);for(Oe=0,He=0;He<d-1;He++)for(ne[He]=Oe,L=0;L<1<<w[He];L++)J[Oe++]=He;for(J[Oe-1]=He,de=0,He=0;He<16;He++)for(le[He]=de,L=0;L<1<<x[He];L++)te[de++]=He;for(de>>=7;He<_;He++)for(le[He]=de<<7,L=0;L<1<<x[He]-7;L++)te[256+de++]=He;for(ge=0;ge<=v;ge++)Me[ge]=0;for(L=0;L<=143;)F[L*2+1]=8,L++,Me[8]++;for(;L<=255;)F[L*2+1]=9,L++,Me[9]++;for(;L<=279;)F[L*2+1]=7,L++,Me[7]++;for(;L<=287;)F[L*2+1]=8,L++,Me[8]++;for(Be(F,p+1,Me),L=0;L<_;L++)K[L*2+1]=5,K[L*2]=he(L,5);j=new q(F,w,f+1,p,v),P=new q(K,x,0,_,v),N=new q(new Array(0),C,0,h,y)}function se(L){var ge;for(ge=0;ge<p;ge++)L.dyn_ltree[ge*2]=0;for(ge=0;ge<_;ge++)L.dyn_dtree[ge*2]=0;for(ge=0;ge<h;ge++)L.bl_tree[ge*2]=0;L.dyn_ltree[g*2]=1,L.opt_len=L.static_len=0,L.last_lit=L.matches=0}function we(L){L.bi_valid>8?Ae(L,L.bi_buf):L.bi_valid>0&&(L.pending_buf[L.pending++]=L.bi_buf),L.bi_buf=0,L.bi_valid=0}function Se(L,ge,Oe,He){we(L),Ae(L,Oe),Ae(L,~Oe),e.arraySet(L.pending_buf,L.window,ge,Oe,L.pending),L.pending+=Oe}function me(L,ge,Oe,He){var de=ge*2,Me=Oe*2;return L[de]<L[Me]||L[de]===L[Me]&&He[ge]<=He[Oe]}function ye(L,ge,Oe){for(var He=L.heap[Oe],de=Oe<<1;de<=L.heap_len&&(de<L.heap_len&&me(ge,L.heap[de+1],L.heap[de],L.depth)&&de++,!me(ge,He,L.heap[de],L.depth));)L.heap[Oe]=L.heap[de],Oe=de,de<<=1;L.heap[Oe]=He}function xe(L,ge,Oe){var He,de,Me=0,G,je;if(L.last_lit!==0)do He=L.pending_buf[L.d_buf+Me*2]<<8|L.pending_buf[L.d_buf+Me*2+1],de=L.pending_buf[L.l_buf+Me],Me++,He===0?Le(L,de,ge):(G=J[de],Le(L,G+f+1,ge),je=w[G],je!==0&&(de-=ne[G],ze(L,de,je)),He--,G=Ee(He),Le(L,G,Oe),je=x[G],je!==0&&(He-=le[G],ze(L,He,je)));while(Me<L.last_lit);Le(L,g,ge)}function ee(L,ge){var Oe=ge.dyn_tree,He=ge.stat_desc.static_tree,de=ge.stat_desc.has_stree,Me=ge.stat_desc.elems,G,je,wt=-1,A;for(L.heap_len=0,L.heap_max=b,G=0;G<Me;G++)Oe[G*2]!==0?(L.heap[++L.heap_len]=wt=G,L.depth[G]=0):Oe[G*2+1]=0;for(;L.heap_len<2;)A=L.heap[++L.heap_len]=wt<2?++wt:0,Oe[A*2]=1,L.depth[A]=0,L.opt_len--,de&&(L.static_len-=He[A*2+1]);for(ge.max_code=wt,G=L.heap_len>>1;G>=1;G--)ye(L,Oe,G);A=Me;do G=L.heap[1],L.heap[1]=L.heap[L.heap_len--],ye(L,Oe,1),je=L.heap[1],L.heap[--L.heap_max]=G,L.heap[--L.heap_max]=je,Oe[A*2]=Oe[G*2]+Oe[je*2],L.depth[A]=(L.depth[G]>=L.depth[je]?L.depth[G]:L.depth[je])+1,Oe[G*2+1]=Oe[je*2+1]=A,L.heap[1]=A++,ye(L,Oe,1);while(L.heap_len>=2);L.heap[--L.heap_max]=L.heap[1],De(L,ge),Be(Oe,wt,L.bl_count)}function pe(L,ge,Oe){var He,de=-1,Me,G=ge[0*2+1],je=0,wt=7,A=4;for(G===0&&(wt=138,A=3),ge[(Oe+1)*2+1]=65535,He=0;He<=Oe;He++)Me=G,G=ge[(He+1)*2+1],!(++je<wt&&Me===G)&&(je<A?L.bl_tree[Me*2]+=je:Me!==0?(Me!==de&&L.bl_tree[Me*2]++,L.bl_tree[S*2]++):je<=10?L.bl_tree[M*2]++:L.bl_tree[E*2]++,je=0,de=Me,G===0?(wt=138,A=3):Me===G?(wt=6,A=3):(wt=7,A=4))}function ve(L,ge,Oe){var He,de=-1,Me,G=ge[0*2+1],je=0,wt=7,A=4;for(G===0&&(wt=138,A=3),He=0;He<=Oe;He++)if(Me=G,G=ge[(He+1)*2+1],!(++je<wt&&Me===G)){if(je<A)do Le(L,Me,L.bl_tree);while(--je!==0);else Me!==0?(Me!==de&&(Le(L,Me,L.bl_tree),je--),Le(L,S,L.bl_tree),ze(L,je-3,2)):je<=10?(Le(L,M,L.bl_tree),ze(L,je-3,3)):(Le(L,E,L.bl_tree),ze(L,je-11,7));je=0,de=Me,G===0?(wt=138,A=3):Me===G?(wt=6,A=3):(wt=7,A=4)}}function Pe(L){var ge;for(pe(L,L.dyn_ltree,L.l_desc.max_code),pe(L,L.dyn_dtree,L.d_desc.max_code),ee(L,L.bl_desc),ge=h-1;ge>=3&&L.bl_tree[D[ge]*2+1]===0;ge--);return L.opt_len+=3*(ge+1)+5+5+4,ge}function Ge(L,ge,Oe,He){var de;for(ze(L,ge-257,5),ze(L,Oe-1,5),ze(L,He-4,4),de=0;de<He;de++)ze(L,L.bl_tree[D[de]*2+1],3);ve(L,L.dyn_ltree,ge-1),ve(L,L.dyn_dtree,Oe-1)}function Ue(L){var ge=4093624447,Oe;for(Oe=0;Oe<=31;Oe++,ge>>>=1)if(ge&1&&L.dyn_ltree[Oe*2]!==0)return r;if(L.dyn_ltree[9*2]!==0||L.dyn_ltree[10*2]!==0||L.dyn_ltree[13*2]!==0)return n;for(Oe=32;Oe<f;Oe++)if(L.dyn_ltree[Oe*2]!==0)return n;return r}var We=!1;function rt(L){We||(Z(),We=!0),L.l_desc=new X(L.dyn_ltree,j),L.d_desc=new X(L.dyn_dtree,P),L.bl_desc=new X(L.bl_tree,N),L.bi_buf=0,L.bi_valid=0,se(L)}function lt(L,ge,Oe,He){ze(L,(o<<1)+(He?1:0),3),Se(L,ge,Oe)}function ft(L){ze(L,s<<1,3),Le(L,g,F),Ie(L)}function St(L,ge,Oe,He){var de,Me,G=0;L.level>0?(L.strm.data_type===a&&(L.strm.data_type=Ue(L)),ee(L,L.l_desc),ee(L,L.d_desc),G=Pe(L),de=L.opt_len+3+7>>>3,Me=L.static_len+3+7>>>3,Me<=de&&(de=Me)):de=Me=Oe+5,Oe+4<=de&&ge!==-1?lt(L,ge,Oe,He):L.strategy===t||Me===de?(ze(L,(s<<1)+(He?1:0),3),xe(L,F,K)):(ze(L,(l<<1)+(He?1:0),3),Ge(L,L.l_desc.max_code+1,L.d_desc.max_code+1,G+1),xe(L,L.dyn_ltree,L.dyn_dtree)),se(L),He&&we(L)}function $e(L,ge,Oe){return L.pending_buf[L.d_buf+L.last_lit*2]=ge>>>8&255,L.pending_buf[L.d_buf+L.last_lit*2+1]=ge&255,L.pending_buf[L.l_buf+L.last_lit]=Oe&255,L.last_lit++,ge===0?L.dyn_ltree[Oe*2]++:(L.matches++,ge--,L.dyn_ltree[(J[Oe]+f+1)*2]++,L.dyn_dtree[Ee(ge)*2]++),L.last_lit===L.lit_bufsize-1}return fo._tr_init=rt,fo._tr_stored_block=lt,fo._tr_flush_block=St,fo._tr_tally=$e,fo._tr_align=ft,fo}var Td,m2;function g2(){if(m2)return Td;m2=1;function e(t,r,n,a){for(var i=t&65535|0,o=t>>>16&65535|0,s=0;n!==0;){s=n>2e3?2e3:n,n-=s;do i=i+r[a++]|0,o=o+i|0;while(--s);i%=65521,o%=65521}return i|o<<16|0}return Td=e,Td}var Md,b2;function y2(){if(b2)return Md;b2=1;function e(){for(var n,a=[],i=0;i<256;i++){n=i;for(var o=0;o<8;o++)n=n&1?3988292384^n>>>1:n>>>1;a[i]=n}return a}var t=e();function r(n,a,i,o){var s=t,l=o+i;n^=-1;for(var c=o;c<l;c++)n=n>>>8^s[(n^a[c])&255];return n^-1}return Md=r,Md}var Dd,_2;function zd(){return _2||(_2=1,Dd={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}),Dd}var x2;function nO(){if(x2)return ia;x2=1;var e=Li(),t=rO(),r=g2(),n=y2(),a=zd(),i=0,o=1,s=3,l=4,c=5,u=0,d=1,f=-2,p=-3,_=-5,h=-1,b=1,v=2,m=3,y=4,g=0,S=2,M=8,E=9,w=15,x=8,C=29,D=256,B=D+1+C,F=30,K=19,te=2*B+1,J=15,ne=3,le=258,q=le+ne+1,j=32,P=42,N=69,X=73,Ee=91,Ae=103,ze=113,Le=666,he=1,Ie=2,De=3,Be=4,Z=3;function se(A,ie){return A.msg=a[ie],ie}function we(A){return(A<<1)-(A>4?9:0)}function Se(A){for(var ie=A.length;--ie>=0;)A[ie]=0}function me(A){var ie=A.state,ae=ie.pending;ae>A.avail_out&&(ae=A.avail_out),ae!==0&&(e.arraySet(A.output,ie.pending_buf,ie.pending_out,ae,A.next_out),A.next_out+=ae,ie.pending_out+=ae,A.total_out+=ae,A.avail_out-=ae,ie.pending-=ae,ie.pending===0&&(ie.pending_out=0))}function ye(A,ie){t._tr_flush_block(A,A.block_start>=0?A.block_start:-1,A.strstart-A.block_start,ie),A.block_start=A.strstart,me(A.strm)}function xe(A,ie){A.pending_buf[A.pending++]=ie}function ee(A,ie){A.pending_buf[A.pending++]=ie>>>8&255,A.pending_buf[A.pending++]=ie&255}function pe(A,ie,ae,U){var fe=A.avail_in;return fe>U&&(fe=U),fe===0?0:(A.avail_in-=fe,e.arraySet(ie,A.input,A.next_in,fe,ae),A.state.wrap===1?A.adler=r(A.adler,ie,fe,ae):A.state.wrap===2&&(A.adler=n(A.adler,ie,fe,ae)),A.next_in+=fe,A.total_in+=fe,fe)}function ve(A,ie){var ae=A.max_chain_length,U=A.strstart,fe,oe,tt=A.prev_length,st=A.nice_match,Ye=A.strstart>A.w_size-q?A.strstart-(A.w_size-q):0,It=A.window,wr=A.w_mask,hr=A.prev,Bt=A.strstart+le,or=It[U+tt-1],Br=It[U+tt];A.prev_length>=A.good_match&&(ae>>=2),st>A.lookahead&&(st=A.lookahead);do if(fe=ie,!(It[fe+tt]!==Br||It[fe+tt-1]!==or||It[fe]!==It[U]||It[++fe]!==It[U+1])){U+=2,fe++;do;while(It[++U]===It[++fe]&&It[++U]===It[++fe]&&It[++U]===It[++fe]&&It[++U]===It[++fe]&&It[++U]===It[++fe]&&It[++U]===It[++fe]&&It[++U]===It[++fe]&&It[++U]===It[++fe]&&U<Bt);if(oe=le-(Bt-U),U=Bt-le,oe>tt){if(A.match_start=ie,tt=oe,oe>=st)break;or=It[U+tt-1],Br=It[U+tt]}}while((ie=hr[ie&wr])>Ye&&--ae!==0);return tt<=A.lookahead?tt:A.lookahead}function Pe(A){var ie=A.w_size,ae,U,fe,oe,tt;do{if(oe=A.window_size-A.lookahead-A.strstart,A.strstart>=ie+(ie-q)){e.arraySet(A.window,A.window,ie,ie,0),A.match_start-=ie,A.strstart-=ie,A.block_start-=ie,U=A.hash_size,ae=U;do fe=A.head[--ae],A.head[ae]=fe>=ie?fe-ie:0;while(--U);U=ie,ae=U;do fe=A.prev[--ae],A.prev[ae]=fe>=ie?fe-ie:0;while(--U);oe+=ie}if(A.strm.avail_in===0)break;if(U=pe(A.strm,A.window,A.strstart+A.lookahead,oe),A.lookahead+=U,A.lookahead+A.insert>=ne)for(tt=A.strstart-A.insert,A.ins_h=A.window[tt],A.ins_h=(A.ins_h<<A.hash_shift^A.window[tt+1])&A.hash_mask;A.insert&&(A.ins_h=(A.ins_h<<A.hash_shift^A.window[tt+ne-1])&A.hash_mask,A.prev[tt&A.w_mask]=A.head[A.ins_h],A.head[A.ins_h]=tt,tt++,A.insert--,!(A.lookahead+A.insert<ne)););}while(A.lookahead<q&&A.strm.avail_in!==0)}function Ge(A,ie){var ae=65535;for(ae>A.pending_buf_size-5&&(ae=A.pending_buf_size-5);;){if(A.lookahead<=1){if(Pe(A),A.lookahead===0&&ie===i)return he;if(A.lookahead===0)break}A.strstart+=A.lookahead,A.lookahead=0;var U=A.block_start+ae;if((A.strstart===0||A.strstart>=U)&&(A.lookahead=A.strstart-U,A.strstart=U,ye(A,!1),A.strm.avail_out===0)||A.strstart-A.block_start>=A.w_size-q&&(ye(A,!1),A.strm.avail_out===0))return he}return A.insert=0,ie===l?(ye(A,!0),A.strm.avail_out===0?De:Be):(A.strstart>A.block_start&&(ye(A,!1),A.strm.avail_out===0),he)}function Ue(A,ie){for(var ae,U;;){if(A.lookahead<q){if(Pe(A),A.lookahead<q&&ie===i)return he;if(A.lookahead===0)break}if(ae=0,A.lookahead>=ne&&(A.ins_h=(A.ins_h<<A.hash_shift^A.window[A.strstart+ne-1])&A.hash_mask,ae=A.prev[A.strstart&A.w_mask]=A.head[A.ins_h],A.head[A.ins_h]=A.strstart),ae!==0&&A.strstart-ae<=A.w_size-q&&(A.match_length=ve(A,ae)),A.match_length>=ne)if(U=t._tr_tally(A,A.strstart-A.match_start,A.match_length-ne),A.lookahead-=A.match_length,A.match_length<=A.max_lazy_match&&A.lookahead>=ne){A.match_length--;do A.strstart++,A.ins_h=(A.ins_h<<A.hash_shift^A.window[A.strstart+ne-1])&A.hash_mask,ae=A.prev[A.strstart&A.w_mask]=A.head[A.ins_h],A.head[A.ins_h]=A.strstart;while(--A.match_length!==0);A.strstart++}else A.strstart+=A.match_length,A.match_length=0,A.ins_h=A.window[A.strstart],A.ins_h=(A.ins_h<<A.hash_shift^A.window[A.strstart+1])&A.hash_mask;else U=t._tr_tally(A,0,A.window[A.strstart]),A.lookahead--,A.strstart++;if(U&&(ye(A,!1),A.strm.avail_out===0))return he}return A.insert=A.strstart<ne-1?A.strstart:ne-1,ie===l?(ye(A,!0),A.strm.avail_out===0?De:Be):A.last_lit&&(ye(A,!1),A.strm.avail_out===0)?he:Ie}function We(A,ie){for(var ae,U,fe;;){if(A.lookahead<q){if(Pe(A),A.lookahead<q&&ie===i)return he;if(A.lookahead===0)break}if(ae=0,A.lookahead>=ne&&(A.ins_h=(A.ins_h<<A.hash_shift^A.window[A.strstart+ne-1])&A.hash_mask,ae=A.prev[A.strstart&A.w_mask]=A.head[A.ins_h],A.head[A.ins_h]=A.strstart),A.prev_length=A.match_length,A.prev_match=A.match_start,A.match_length=ne-1,ae!==0&&A.prev_length<A.max_lazy_match&&A.strstart-ae<=A.w_size-q&&(A.match_length=ve(A,ae),A.match_length<=5&&(A.strategy===b||A.match_length===ne&&A.strstart-A.match_start>4096)&&(A.match_length=ne-1)),A.prev_length>=ne&&A.match_length<=A.prev_length){fe=A.strstart+A.lookahead-ne,U=t._tr_tally(A,A.strstart-1-A.prev_match,A.prev_length-ne),A.lookahead-=A.prev_length-1,A.prev_length-=2;do++A.strstart<=fe&&(A.ins_h=(A.ins_h<<A.hash_shift^A.window[A.strstart+ne-1])&A.hash_mask,ae=A.prev[A.strstart&A.w_mask]=A.head[A.ins_h],A.head[A.ins_h]=A.strstart);while(--A.prev_length!==0);if(A.match_available=0,A.match_length=ne-1,A.strstart++,U&&(ye(A,!1),A.strm.avail_out===0))return he}else if(A.match_available){if(U=t._tr_tally(A,0,A.window[A.strstart-1]),U&&ye(A,!1),A.strstart++,A.lookahead--,A.strm.avail_out===0)return he}else A.match_available=1,A.strstart++,A.lookahead--}return A.match_available&&(U=t._tr_tally(A,0,A.window[A.strstart-1]),A.match_available=0),A.insert=A.strstart<ne-1?A.strstart:ne-1,ie===l?(ye(A,!0),A.strm.avail_out===0?De:Be):A.last_lit&&(ye(A,!1),A.strm.avail_out===0)?he:Ie}function rt(A,ie){for(var ae,U,fe,oe,tt=A.window;;){if(A.lookahead<=le){if(Pe(A),A.lookahead<=le&&ie===i)return he;if(A.lookahead===0)break}if(A.match_length=0,A.lookahead>=ne&&A.strstart>0&&(fe=A.strstart-1,U=tt[fe],U===tt[++fe]&&U===tt[++fe]&&U===tt[++fe])){oe=A.strstart+le;do;while(U===tt[++fe]&&U===tt[++fe]&&U===tt[++fe]&&U===tt[++fe]&&U===tt[++fe]&&U===tt[++fe]&&U===tt[++fe]&&U===tt[++fe]&&fe<oe);A.match_length=le-(oe-fe),A.match_length>A.lookahead&&(A.match_length=A.lookahead)}if(A.match_length>=ne?(ae=t._tr_tally(A,1,A.match_length-ne),A.lookahead-=A.match_length,A.strstart+=A.match_length,A.match_length=0):(ae=t._tr_tally(A,0,A.window[A.strstart]),A.lookahead--,A.strstart++),ae&&(ye(A,!1),A.strm.avail_out===0))return he}return A.insert=0,ie===l?(ye(A,!0),A.strm.avail_out===0?De:Be):A.last_lit&&(ye(A,!1),A.strm.avail_out===0)?he:Ie}function lt(A,ie){for(var ae;;){if(A.lookahead===0&&(Pe(A),A.lookahead===0)){if(ie===i)return he;break}if(A.match_length=0,ae=t._tr_tally(A,0,A.window[A.strstart]),A.lookahead--,A.strstart++,ae&&(ye(A,!1),A.strm.avail_out===0))return he}return A.insert=0,ie===l?(ye(A,!0),A.strm.avail_out===0?De:Be):A.last_lit&&(ye(A,!1),A.strm.avail_out===0)?he:Ie}function ft(A,ie,ae,U,fe){this.good_length=A,this.max_lazy=ie,this.nice_length=ae,this.max_chain=U,this.func=fe}var St;St=[new ft(0,0,0,0,Ge),new ft(4,4,8,4,Ue),new ft(4,5,16,8,Ue),new ft(4,6,32,32,Ue),new ft(4,4,16,16,We),new ft(8,16,32,32,We),new ft(8,16,128,128,We),new ft(8,32,128,256,We),new ft(32,128,258,1024,We),new ft(32,258,258,4096,We)];function $e(A){A.window_size=2*A.w_size,Se(A.head),A.max_lazy_match=St[A.level].max_lazy,A.good_match=St[A.level].good_length,A.nice_match=St[A.level].nice_length,A.max_chain_length=St[A.level].max_chain,A.strstart=0,A.block_start=0,A.lookahead=0,A.insert=0,A.match_length=A.prev_length=ne-1,A.match_available=0,A.ins_h=0}function L(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=M,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new e.Buf16(te*2),this.dyn_dtree=new e.Buf16((2*F+1)*2),this.bl_tree=new e.Buf16((2*K+1)*2),Se(this.dyn_ltree),Se(this.dyn_dtree),Se(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new e.Buf16(J+1),this.heap=new e.Buf16(2*B+1),Se(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new e.Buf16(2*B+1),Se(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function ge(A){var ie;return!A||!A.state?se(A,f):(A.total_in=A.total_out=0,A.data_type=S,ie=A.state,ie.pending=0,ie.pending_out=0,ie.wrap<0&&(ie.wrap=-ie.wrap),ie.status=ie.wrap?P:ze,A.adler=ie.wrap===2?0:1,ie.last_flush=i,t._tr_init(ie),u)}function Oe(A){var ie=ge(A);return ie===u&&$e(A.state),ie}function He(A,ie){return!A||!A.state||A.state.wrap!==2?f:(A.state.gzhead=ie,u)}function de(A,ie,ae,U,fe,oe){if(!A)return f;var tt=1;if(ie===h&&(ie=6),U<0?(tt=0,U=-U):U>15&&(tt=2,U-=16),fe<1||fe>E||ae!==M||U<8||U>15||ie<0||ie>9||oe<0||oe>y)return se(A,f);U===8&&(U=9);var st=new L;return A.state=st,st.strm=A,st.wrap=tt,st.gzhead=null,st.w_bits=U,st.w_size=1<<st.w_bits,st.w_mask=st.w_size-1,st.hash_bits=fe+7,st.hash_size=1<<st.hash_bits,st.hash_mask=st.hash_size-1,st.hash_shift=~~((st.hash_bits+ne-1)/ne),st.window=new e.Buf8(st.w_size*2),st.head=new e.Buf16(st.hash_size),st.prev=new e.Buf16(st.w_size),st.lit_bufsize=1<<fe+6,st.pending_buf_size=st.lit_bufsize*4,st.pending_buf=new e.Buf8(st.pending_buf_size),st.d_buf=1*st.lit_bufsize,st.l_buf=3*st.lit_bufsize,st.level=ie,st.strategy=oe,st.method=ae,Oe(A)}function Me(A,ie){return de(A,ie,M,w,x,g)}function G(A,ie){var ae,U,fe,oe;if(!A||!A.state||ie>c||ie<0)return A?se(A,f):f;if(U=A.state,!A.output||!A.input&&A.avail_in!==0||U.status===Le&&ie!==l)return se(A,A.avail_out===0?_:f);if(U.strm=A,ae=U.last_flush,U.last_flush=ie,U.status===P)if(U.wrap===2)A.adler=0,xe(U,31),xe(U,139),xe(U,8),U.gzhead?(xe(U,(U.gzhead.text?1:0)+(U.gzhead.hcrc?2:0)+(U.gzhead.extra?4:0)+(U.gzhead.name?8:0)+(U.gzhead.comment?16:0)),xe(U,U.gzhead.time&255),xe(U,U.gzhead.time>>8&255),xe(U,U.gzhead.time>>16&255),xe(U,U.gzhead.time>>24&255),xe(U,U.level===9?2:U.strategy>=v||U.level<2?4:0),xe(U,U.gzhead.os&255),U.gzhead.extra&&U.gzhead.extra.length&&(xe(U,U.gzhead.extra.length&255),xe(U,U.gzhead.extra.length>>8&255)),U.gzhead.hcrc&&(A.adler=n(A.adler,U.pending_buf,U.pending,0)),U.gzindex=0,U.status=N):(xe(U,0),xe(U,0),xe(U,0),xe(U,0),xe(U,0),xe(U,U.level===9?2:U.strategy>=v||U.level<2?4:0),xe(U,Z),U.status=ze);else{var tt=M+(U.w_bits-8<<4)<<8,st=-1;U.strategy>=v||U.level<2?st=0:U.level<6?st=1:U.level===6?st=2:st=3,tt|=st<<6,U.strstart!==0&&(tt|=j),tt+=31-tt%31,U.status=ze,ee(U,tt),U.strstart!==0&&(ee(U,A.adler>>>16),ee(U,A.adler&65535)),A.adler=1}if(U.status===N)if(U.gzhead.extra){for(fe=U.pending;U.gzindex<(U.gzhead.extra.length&65535)&&!(U.pending===U.pending_buf_size&&(U.gzhead.hcrc&&U.pending>fe&&(A.adler=n(A.adler,U.pending_buf,U.pending-fe,fe)),me(A),fe=U.pending,U.pending===U.pending_buf_size));)xe(U,U.gzhead.extra[U.gzindex]&255),U.gzindex++;U.gzhead.hcrc&&U.pending>fe&&(A.adler=n(A.adler,U.pending_buf,U.pending-fe,fe)),U.gzindex===U.gzhead.extra.length&&(U.gzindex=0,U.status=X)}else U.status=X;if(U.status===X)if(U.gzhead.name){fe=U.pending;do{if(U.pending===U.pending_buf_size&&(U.gzhead.hcrc&&U.pending>fe&&(A.adler=n(A.adler,U.pending_buf,U.pending-fe,fe)),me(A),fe=U.pending,U.pending===U.pending_buf_size)){oe=1;break}U.gzindex<U.gzhead.name.length?oe=U.gzhead.name.charCodeAt(U.gzindex++)&255:oe=0,xe(U,oe)}while(oe!==0);U.gzhead.hcrc&&U.pending>fe&&(A.adler=n(A.adler,U.pending_buf,U.pending-fe,fe)),oe===0&&(U.gzindex=0,U.status=Ee)}else U.status=Ee;if(U.status===Ee)if(U.gzhead.comment){fe=U.pending;do{if(U.pending===U.pending_buf_size&&(U.gzhead.hcrc&&U.pending>fe&&(A.adler=n(A.adler,U.pending_buf,U.pending-fe,fe)),me(A),fe=U.pending,U.pending===U.pending_buf_size)){oe=1;break}U.gzindex<U.gzhead.comment.length?oe=U.gzhead.comment.charCodeAt(U.gzindex++)&255:oe=0,xe(U,oe)}while(oe!==0);U.gzhead.hcrc&&U.pending>fe&&(A.adler=n(A.adler,U.pending_buf,U.pending-fe,fe)),oe===0&&(U.status=Ae)}else U.status=Ae;if(U.status===Ae&&(U.gzhead.hcrc?(U.pending+2>U.pending_buf_size&&me(A),U.pending+2<=U.pending_buf_size&&(xe(U,A.adler&255),xe(U,A.adler>>8&255),A.adler=0,U.status=ze)):U.status=ze),U.pending!==0){if(me(A),A.avail_out===0)return U.last_flush=-1,u}else if(A.avail_in===0&&we(ie)<=we(ae)&&ie!==l)return se(A,_);if(U.status===Le&&A.avail_in!==0)return se(A,_);if(A.avail_in!==0||U.lookahead!==0||ie!==i&&U.status!==Le){var Ye=U.strategy===v?lt(U,ie):U.strategy===m?rt(U,ie):St[U.level].func(U,ie);if((Ye===De||Ye===Be)&&(U.status=Le),Ye===he||Ye===De)return A.avail_out===0&&(U.last_flush=-1),u;if(Ye===Ie&&(ie===o?t._tr_align(U):ie!==c&&(t._tr_stored_block(U,0,0,!1),ie===s&&(Se(U.head),U.lookahead===0&&(U.strstart=0,U.block_start=0,U.insert=0))),me(A),A.avail_out===0))return U.last_flush=-1,u}return ie!==l?u:U.wrap<=0?d:(U.wrap===2?(xe(U,A.adler&255),xe(U,A.adler>>8&255),xe(U,A.adler>>16&255),xe(U,A.adler>>24&255),xe(U,A.total_in&255),xe(U,A.total_in>>8&255),xe(U,A.total_in>>16&255),xe(U,A.total_in>>24&255)):(ee(U,A.adler>>>16),ee(U,A.adler&65535)),me(A),U.wrap>0&&(U.wrap=-U.wrap),U.pending!==0?u:d)}function je(A){var ie;return!A||!A.state?f:(ie=A.state.status,ie!==P&&ie!==N&&ie!==X&&ie!==Ee&&ie!==Ae&&ie!==ze&&ie!==Le?se(A,f):(A.state=null,ie===ze?se(A,p):u))}function wt(A,ie){var ae=ie.length,U,fe,oe,tt,st,Ye,It,wr;if(!A||!A.state||(U=A.state,tt=U.wrap,tt===2||tt===1&&U.status!==P||U.lookahead))return f;for(tt===1&&(A.adler=r(A.adler,ie,ae,0)),U.wrap=0,ae>=U.w_size&&(tt===0&&(Se(U.head),U.strstart=0,U.block_start=0,U.insert=0),wr=new e.Buf8(U.w_size),e.arraySet(wr,ie,ae-U.w_size,U.w_size,0),ie=wr,ae=U.w_size),st=A.avail_in,Ye=A.next_in,It=A.input,A.avail_in=ae,A.next_in=0,A.input=ie,Pe(U);U.lookahead>=ne;){fe=U.strstart,oe=U.lookahead-(ne-1);do U.ins_h=(U.ins_h<<U.hash_shift^U.window[fe+ne-1])&U.hash_mask,U.prev[fe&U.w_mask]=U.head[U.ins_h],U.head[U.ins_h]=fe,fe++;while(--oe);U.strstart=fe,U.lookahead=ne-1,Pe(U)}return U.strstart+=U.lookahead,U.block_start=U.strstart,U.insert=U.lookahead,U.lookahead=0,U.match_length=U.prev_length=ne-1,U.match_available=0,A.next_in=Ye,A.input=It,A.avail_in=st,U.wrap=tt,u}return ia.deflateInit=Me,ia.deflateInit2=de,ia.deflateReset=Oe,ia.deflateResetKeep=ge,ia.deflateSetHeader=He,ia.deflate=G,ia.deflateEnd=je,ia.deflateSetDictionary=wt,ia.deflateInfo="pako deflate (from Nodeca project)",ia}var po={},w2;function k2(){if(w2)return po;w2=1;var e=Li(),t=!0,r=!0;try{String.fromCharCode.apply(null,[0])}catch{t=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{r=!1}for(var n=new e.Buf8(256),a=0;a<256;a++)n[a]=a>=252?6:a>=248?5:a>=240?4:a>=224?3:a>=192?2:1;n[254]=n[254]=1,po.string2buf=function(o){var s,l,c,u,d,f=o.length,p=0;for(u=0;u<f;u++)l=o.charCodeAt(u),(l&64512)===55296&&u+1<f&&(c=o.charCodeAt(u+1),(c&64512)===56320&&(l=65536+(l-55296<<10)+(c-56320),u++)),p+=l<128?1:l<2048?2:l<65536?3:4;for(s=new e.Buf8(p),d=0,u=0;d<p;u++)l=o.charCodeAt(u),(l&64512)===55296&&u+1<f&&(c=o.charCodeAt(u+1),(c&64512)===56320&&(l=65536+(l-55296<<10)+(c-56320),u++)),l<128?s[d++]=l:l<2048?(s[d++]=192|l>>>6,s[d++]=128|l&63):l<65536?(s[d++]=224|l>>>12,s[d++]=128|l>>>6&63,s[d++]=128|l&63):(s[d++]=240|l>>>18,s[d++]=128|l>>>12&63,s[d++]=128|l>>>6&63,s[d++]=128|l&63);return s};function i(o,s){if(s<65534&&(o.subarray&&r||!o.subarray&&t))return String.fromCharCode.apply(null,e.shrinkBuf(o,s));for(var l="",c=0;c<s;c++)l+=String.fromCharCode(o[c]);return l}return po.buf2binstring=function(o){return i(o,o.length)},po.binstring2buf=function(o){for(var s=new e.Buf8(o.length),l=0,c=s.length;l<c;l++)s[l]=o.charCodeAt(l);return s},po.buf2string=function(o,s){var l,c,u,d,f=s||o.length,p=new Array(f*2);for(c=0,l=0;l<f;){if(u=o[l++],u<128){p[c++]=u;continue}if(d=n[u],d>4){p[c++]=65533,l+=d-1;continue}for(u&=d===2?31:d===3?15:7;d>1&&l<f;)u=u<<6|o[l++]&63,d--;if(d>1){p[c++]=65533;continue}u<65536?p[c++]=u:(u-=65536,p[c++]=55296|u>>10&1023,p[c++]=56320|u&1023)}return i(p,c)},po.utf8border=function(o,s){var l;for(s=s||o.length,s>o.length&&(s=o.length),l=s-1;l>=0&&(o[l]&192)===128;)l--;return l<0||l===0?s:l+n[o[l]]>s?l:s},po}var Id,S2;function C2(){if(S2)return Id;S2=1;function e(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}return Id=e,Id}var E2;function aO(){if(E2)return Qo;E2=1;var e=nO(),t=Li(),r=k2(),n=zd(),a=C2(),i=Object.prototype.toString,o=0,s=4,l=0,c=1,u=2,d=-1,f=0,p=8;function _(m){if(!(this instanceof _))return new _(m);this.options=t.assign({level:d,method:p,chunkSize:16384,windowBits:15,memLevel:8,strategy:f,to:""},m||{});var y=this.options;y.raw&&y.windowBits>0?y.windowBits=-y.windowBits:y.gzip&&y.windowBits>0&&y.windowBits<16&&(y.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new a,this.strm.avail_out=0;var g=e.deflateInit2(this.strm,y.level,y.method,y.windowBits,y.memLevel,y.strategy);if(g!==l)throw new Error(n[g]);if(y.header&&e.deflateSetHeader(this.strm,y.header),y.dictionary){var S;if(typeof y.dictionary=="string"?S=r.string2buf(y.dictionary):i.call(y.dictionary)==="[object ArrayBuffer]"?S=new Uint8Array(y.dictionary):S=y.dictionary,g=e.deflateSetDictionary(this.strm,S),g!==l)throw new Error(n[g]);this._dict_set=!0}}_.prototype.push=function(m,y){var g=this.strm,S=this.options.chunkSize,M,E;if(this.ended)return!1;E=y===~~y?y:y===!0?s:o,typeof m=="string"?g.input=r.string2buf(m):i.call(m)==="[object ArrayBuffer]"?g.input=new Uint8Array(m):g.input=m,g.next_in=0,g.avail_in=g.input.length;do{if(g.avail_out===0&&(g.output=new t.Buf8(S),g.next_out=0,g.avail_out=S),M=e.deflate(g,E),M!==c&&M!==l)return this.onEnd(M),this.ended=!0,!1;(g.avail_out===0||g.avail_in===0&&(E===s||E===u))&&(this.options.to==="string"?this.onData(r.buf2binstring(t.shrinkBuf(g.output,g.next_out))):this.onData(t.shrinkBuf(g.output,g.next_out)))}while((g.avail_in>0||g.avail_out===0)&&M!==c);return E===s?(M=e.deflateEnd(this.strm),this.onEnd(M),this.ended=!0,M===l):(E===u&&(this.onEnd(l),g.avail_out=0),!0)},_.prototype.onData=function(m){this.chunks.push(m)},_.prototype.onEnd=function(m){m===l&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=t.flattenChunks(this.chunks)),this.chunks=[],this.err=m,this.msg=this.strm.msg};function h(m,y){var g=new _(y);if(g.push(m,!0),g.err)throw g.msg||n[g.err];return g.result}function b(m,y){return y=y||{},y.raw=!0,h(m,y)}function v(m,y){return y=y||{},y.gzip=!0,h(m,y)}return Qo.Deflate=_,Qo.deflate=h,Qo.deflateRaw=b,Qo.gzip=v,Qo}var es={},qn={},Od,A2;function iO(){if(A2)return Od;A2=1;var e=30,t=12;return Od=function(n,a){var i,o,s,l,c,u,d,f,p,_,h,b,v,m,y,g,S,M,E,w,x,C,D,B,F;i=n.state,o=n.next_in,B=n.input,s=o+(n.avail_in-5),l=n.next_out,F=n.output,c=l-(a-n.avail_out),u=l+(n.avail_out-257),d=i.dmax,f=i.wsize,p=i.whave,_=i.wnext,h=i.window,b=i.hold,v=i.bits,m=i.lencode,y=i.distcode,g=(1<<i.lenbits)-1,S=(1<<i.distbits)-1;e:do{v<15&&(b+=B[o++]<<v,v+=8,b+=B[o++]<<v,v+=8),M=m[b&g];t:for(;;){if(E=M>>>24,b>>>=E,v-=E,E=M>>>16&255,E===0)F[l++]=M&65535;else if(E&16){w=M&65535,E&=15,E&&(v<E&&(b+=B[o++]<<v,v+=8),w+=b&(1<<E)-1,b>>>=E,v-=E),v<15&&(b+=B[o++]<<v,v+=8,b+=B[o++]<<v,v+=8),M=y[b&S];r:for(;;){if(E=M>>>24,b>>>=E,v-=E,E=M>>>16&255,E&16){if(x=M&65535,E&=15,v<E&&(b+=B[o++]<<v,v+=8,v<E&&(b+=B[o++]<<v,v+=8)),x+=b&(1<<E)-1,x>d){n.msg="invalid distance too far back",i.mode=e;break e}if(b>>>=E,v-=E,E=l-c,x>E){if(E=x-E,E>p&&i.sane){n.msg="invalid distance too far back",i.mode=e;break e}if(C=0,D=h,_===0){if(C+=f-E,E<w){w-=E;do F[l++]=h[C++];while(--E);C=l-x,D=F}}else if(_<E){if(C+=f+_-E,E-=_,E<w){w-=E;do F[l++]=h[C++];while(--E);if(C=0,_<w){E=_,w-=E;do F[l++]=h[C++];while(--E);C=l-x,D=F}}}else if(C+=_-E,E<w){w-=E;do F[l++]=h[C++];while(--E);C=l-x,D=F}for(;w>2;)F[l++]=D[C++],F[l++]=D[C++],F[l++]=D[C++],w-=3;w&&(F[l++]=D[C++],w>1&&(F[l++]=D[C++]))}else{C=l-x;do F[l++]=F[C++],F[l++]=F[C++],F[l++]=F[C++],w-=3;while(w>2);w&&(F[l++]=F[C++],w>1&&(F[l++]=F[C++]))}}else if(E&64){n.msg="invalid distance code",i.mode=e;break e}else{M=y[(M&65535)+(b&(1<<E)-1)];continue r}break}}else if(E&64)if(E&32){i.mode=t;break e}else{n.msg="invalid literal/length code",i.mode=e;break e}else{M=m[(M&65535)+(b&(1<<E)-1)];continue t}break}}while(o<s&&l<u);w=v>>3,o-=w,v-=w<<3,b&=(1<<v)-1,n.next_in=o,n.next_out=l,n.avail_in=o<s?5+(s-o):5-(o-s),n.avail_out=l<u?257+(u-l):257-(l-u),i.hold=b,i.bits=v},Od}var Pd,T2;function oO(){if(T2)return Pd;T2=1;var e=Li(),t=15,r=852,n=592,a=0,i=1,o=2,s=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],l=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],c=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],u=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];return Pd=function(f,p,_,h,b,v,m,y){var g=y.bits,S=0,M=0,E=0,w=0,x=0,C=0,D=0,B=0,F=0,K=0,te,J,ne,le,q,j=null,P=0,N,X=new e.Buf16(t+1),Ee=new e.Buf16(t+1),Ae=null,ze=0,Le,he,Ie;for(S=0;S<=t;S++)X[S]=0;for(M=0;M<h;M++)X[p[_+M]]++;for(x=g,w=t;w>=1&&X[w]===0;w--);if(x>w&&(x=w),w===0)return b[v++]=1<<24|64<<16|0,b[v++]=1<<24|64<<16|0,y.bits=1,0;for(E=1;E<w&&X[E]===0;E++);for(x<E&&(x=E),B=1,S=1;S<=t;S++)if(B<<=1,B-=X[S],B<0)return-1;if(B>0&&(f===a||w!==1))return-1;for(Ee[1]=0,S=1;S<t;S++)Ee[S+1]=Ee[S]+X[S];for(M=0;M<h;M++)p[_+M]!==0&&(m[Ee[p[_+M]]++]=M);if(f===a?(j=Ae=m,N=19):f===i?(j=s,P-=257,Ae=l,ze-=257,N=256):(j=c,Ae=u,N=-1),K=0,M=0,S=E,q=v,C=x,D=0,ne=-1,F=1<<x,le=F-1,f===i&&F>r||f===o&&F>n)return 1;for(;;){Le=S-D,m[M]<N?(he=0,Ie=m[M]):m[M]>N?(he=Ae[ze+m[M]],Ie=j[P+m[M]]):(he=96,Ie=0),te=1<<S-D,J=1<<C,E=J;do J-=te,b[q+(K>>D)+J]=Le<<24|he<<16|Ie|0;while(J!==0);for(te=1<<S-1;K&te;)te>>=1;if(te!==0?(K&=te-1,K+=te):K=0,M++,--X[S]===0){if(S===w)break;S=p[_+m[M]]}if(S>x&&(K&le)!==ne){for(D===0&&(D=x),q+=E,C=S-D,B=1<<C;C+D<w&&(B-=X[C+D],!(B<=0));)C++,B<<=1;if(F+=1<<C,f===i&&F>r||f===o&&F>n)return 1;ne=K&le,b[ne]=x<<24|C<<16|q-v|0}}return K!==0&&(b[q+K]=S-D<<24|64<<16|0),y.bits=x,0},Pd}var M2;function sO(){if(M2)return qn;M2=1;var e=Li(),t=g2(),r=y2(),n=iO(),a=oO(),i=0,o=1,s=2,l=4,c=5,u=6,d=0,f=1,p=2,_=-2,h=-3,b=-4,v=-5,m=8,y=1,g=2,S=3,M=4,E=5,w=6,x=7,C=8,D=9,B=10,F=11,K=12,te=13,J=14,ne=15,le=16,q=17,j=18,P=19,N=20,X=21,Ee=22,Ae=23,ze=24,Le=25,he=26,Ie=27,De=28,Be=29,Z=30,se=31,we=32,Se=852,me=592,ye=15,xe=ye;function ee(de){return(de>>>24&255)+(de>>>8&65280)+((de&65280)<<8)+((de&255)<<24)}function pe(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new e.Buf16(320),this.work=new e.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function ve(de){var Me;return!de||!de.state?_:(Me=de.state,de.total_in=de.total_out=Me.total=0,de.msg="",Me.wrap&&(de.adler=Me.wrap&1),Me.mode=y,Me.last=0,Me.havedict=0,Me.dmax=32768,Me.head=null,Me.hold=0,Me.bits=0,Me.lencode=Me.lendyn=new e.Buf32(Se),Me.distcode=Me.distdyn=new e.Buf32(me),Me.sane=1,Me.back=-1,d)}function Pe(de){var Me;return!de||!de.state?_:(Me=de.state,Me.wsize=0,Me.whave=0,Me.wnext=0,ve(de))}function Ge(de,Me){var G,je;return!de||!de.state||(je=de.state,Me<0?(G=0,Me=-Me):(G=(Me>>4)+1,Me<48&&(Me&=15)),Me&&(Me<8||Me>15))?_:(je.window!==null&&je.wbits!==Me&&(je.window=null),je.wrap=G,je.wbits=Me,Pe(de))}function Ue(de,Me){var G,je;return de?(je=new pe,de.state=je,je.window=null,G=Ge(de,Me),G!==d&&(de.state=null),G):_}function We(de){return Ue(de,xe)}var rt=!0,lt,ft;function St(de){if(rt){var Me;for(lt=new e.Buf32(512),ft=new e.Buf32(32),Me=0;Me<144;)de.lens[Me++]=8;for(;Me<256;)de.lens[Me++]=9;for(;Me<280;)de.lens[Me++]=7;for(;Me<288;)de.lens[Me++]=8;for(a(o,de.lens,0,288,lt,0,de.work,{bits:9}),Me=0;Me<32;)de.lens[Me++]=5;a(s,de.lens,0,32,ft,0,de.work,{bits:5}),rt=!1}de.lencode=lt,de.lenbits=9,de.distcode=ft,de.distbits=5}function $e(de,Me,G,je){var wt,A=de.state;return A.window===null&&(A.wsize=1<<A.wbits,A.wnext=0,A.whave=0,A.window=new e.Buf8(A.wsize)),je>=A.wsize?(e.arraySet(A.window,Me,G-A.wsize,A.wsize,0),A.wnext=0,A.whave=A.wsize):(wt=A.wsize-A.wnext,wt>je&&(wt=je),e.arraySet(A.window,Me,G-je,wt,A.wnext),je-=wt,je?(e.arraySet(A.window,Me,G-je,je,0),A.wnext=je,A.whave=A.wsize):(A.wnext+=wt,A.wnext===A.wsize&&(A.wnext=0),A.whave<A.wsize&&(A.whave+=wt))),0}function L(de,Me){var G,je,wt,A,ie,ae,U,fe,oe,tt,st,Ye,It,wr,hr=0,Bt,or,Br,gr,ha,Co,mt,Qr,Mr=new e.Buf8(4),va,cr,hu=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!de||!de.state||!de.output||!de.input&&de.avail_in!==0)return _;G=de.state,G.mode===K&&(G.mode=te),ie=de.next_out,wt=de.output,U=de.avail_out,A=de.next_in,je=de.input,ae=de.avail_in,fe=G.hold,oe=G.bits,tt=ae,st=U,Qr=d;e:for(;;)switch(G.mode){case y:if(G.wrap===0){G.mode=te;break}for(;oe<16;){if(ae===0)break e;ae--,fe+=je[A++]<<oe,oe+=8}if(G.wrap&2&&fe===35615){G.check=0,Mr[0]=fe&255,Mr[1]=fe>>>8&255,G.check=r(G.check,Mr,2,0),fe=0,oe=0,G.mode=g;break}if(G.flags=0,G.head&&(G.head.done=!1),!(G.wrap&1)||(((fe&255)<<8)+(fe>>8))%31){de.msg="incorrect header check",G.mode=Z;break}if((fe&15)!==m){de.msg="unknown compression method",G.mode=Z;break}if(fe>>>=4,oe-=4,mt=(fe&15)+8,G.wbits===0)G.wbits=mt;else if(mt>G.wbits){de.msg="invalid window size",G.mode=Z;break}G.dmax=1<<mt,de.adler=G.check=1,G.mode=fe&512?B:K,fe=0,oe=0;break;case g:for(;oe<16;){if(ae===0)break e;ae--,fe+=je[A++]<<oe,oe+=8}if(G.flags=fe,(G.flags&255)!==m){de.msg="unknown compression method",G.mode=Z;break}if(G.flags&57344){de.msg="unknown header flags set",G.mode=Z;break}G.head&&(G.head.text=fe>>8&1),G.flags&512&&(Mr[0]=fe&255,Mr[1]=fe>>>8&255,G.check=r(G.check,Mr,2,0)),fe=0,oe=0,G.mode=S;case S:for(;oe<32;){if(ae===0)break e;ae--,fe+=je[A++]<<oe,oe+=8}G.head&&(G.head.time=fe),G.flags&512&&(Mr[0]=fe&255,Mr[1]=fe>>>8&255,Mr[2]=fe>>>16&255,Mr[3]=fe>>>24&255,G.check=r(G.check,Mr,4,0)),fe=0,oe=0,G.mode=M;case M:for(;oe<16;){if(ae===0)break e;ae--,fe+=je[A++]<<oe,oe+=8}G.head&&(G.head.xflags=fe&255,G.head.os=fe>>8),G.flags&512&&(Mr[0]=fe&255,Mr[1]=fe>>>8&255,G.check=r(G.check,Mr,2,0)),fe=0,oe=0,G.mode=E;case E:if(G.flags&1024){for(;oe<16;){if(ae===0)break e;ae--,fe+=je[A++]<<oe,oe+=8}G.length=fe,G.head&&(G.head.extra_len=fe),G.flags&512&&(Mr[0]=fe&255,Mr[1]=fe>>>8&255,G.check=r(G.check,Mr,2,0)),fe=0,oe=0}else G.head&&(G.head.extra=null);G.mode=w;case w:if(G.flags&1024&&(Ye=G.length,Ye>ae&&(Ye=ae),Ye&&(G.head&&(mt=G.head.extra_len-G.length,G.head.extra||(G.head.extra=new Array(G.head.extra_len)),e.arraySet(G.head.extra,je,A,Ye,mt)),G.flags&512&&(G.check=r(G.check,je,Ye,A)),ae-=Ye,A+=Ye,G.length-=Ye),G.length))break e;G.length=0,G.mode=x;case x:if(G.flags&2048){if(ae===0)break e;Ye=0;do mt=je[A+Ye++],G.head&&mt&&G.length<65536&&(G.head.name+=String.fromCharCode(mt));while(mt&&Ye<ae);if(G.flags&512&&(G.check=r(G.check,je,Ye,A)),ae-=Ye,A+=Ye,mt)break e}else G.head&&(G.head.name=null);G.length=0,G.mode=C;case C:if(G.flags&4096){if(ae===0)break e;Ye=0;do mt=je[A+Ye++],G.head&&mt&&G.length<65536&&(G.head.comment+=String.fromCharCode(mt));while(mt&&Ye<ae);if(G.flags&512&&(G.check=r(G.check,je,Ye,A)),ae-=Ye,A+=Ye,mt)break e}else G.head&&(G.head.comment=null);G.mode=D;case D:if(G.flags&512){for(;oe<16;){if(ae===0)break e;ae--,fe+=je[A++]<<oe,oe+=8}if(fe!==(G.check&65535)){de.msg="header crc mismatch",G.mode=Z;break}fe=0,oe=0}G.head&&(G.head.hcrc=G.flags>>9&1,G.head.done=!0),de.adler=G.check=0,G.mode=K;break;case B:for(;oe<32;){if(ae===0)break e;ae--,fe+=je[A++]<<oe,oe+=8}de.adler=G.check=ee(fe),fe=0,oe=0,G.mode=F;case F:if(G.havedict===0)return de.next_out=ie,de.avail_out=U,de.next_in=A,de.avail_in=ae,G.hold=fe,G.bits=oe,p;de.adler=G.check=1,G.mode=K;case K:if(Me===c||Me===u)break e;case te:if(G.last){fe>>>=oe&7,oe-=oe&7,G.mode=Ie;break}for(;oe<3;){if(ae===0)break e;ae--,fe+=je[A++]<<oe,oe+=8}switch(G.last=fe&1,fe>>>=1,oe-=1,fe&3){case 0:G.mode=J;break;case 1:if(St(G),G.mode=N,Me===u){fe>>>=2,oe-=2;break e}break;case 2:G.mode=q;break;case 3:de.msg="invalid block type",G.mode=Z}fe>>>=2,oe-=2;break;case J:for(fe>>>=oe&7,oe-=oe&7;oe<32;){if(ae===0)break e;ae--,fe+=je[A++]<<oe,oe+=8}if((fe&65535)!==(fe>>>16^65535)){de.msg="invalid stored block lengths",G.mode=Z;break}if(G.length=fe&65535,fe=0,oe=0,G.mode=ne,Me===u)break e;case ne:G.mode=le;case le:if(Ye=G.length,Ye){if(Ye>ae&&(Ye=ae),Ye>U&&(Ye=U),Ye===0)break e;e.arraySet(wt,je,A,Ye,ie),ae-=Ye,A+=Ye,U-=Ye,ie+=Ye,G.length-=Ye;break}G.mode=K;break;case q:for(;oe<14;){if(ae===0)break e;ae--,fe+=je[A++]<<oe,oe+=8}if(G.nlen=(fe&31)+257,fe>>>=5,oe-=5,G.ndist=(fe&31)+1,fe>>>=5,oe-=5,G.ncode=(fe&15)+4,fe>>>=4,oe-=4,G.nlen>286||G.ndist>30){de.msg="too many length or distance symbols",G.mode=Z;break}G.have=0,G.mode=j;case j:for(;G.have<G.ncode;){for(;oe<3;){if(ae===0)break e;ae--,fe+=je[A++]<<oe,oe+=8}G.lens[hu[G.have++]]=fe&7,fe>>>=3,oe-=3}for(;G.have<19;)G.lens[hu[G.have++]]=0;if(G.lencode=G.lendyn,G.lenbits=7,va={bits:G.lenbits},Qr=a(i,G.lens,0,19,G.lencode,0,G.work,va),G.lenbits=va.bits,Qr){de.msg="invalid code lengths set",G.mode=Z;break}G.have=0,G.mode=P;case P:for(;G.have<G.nlen+G.ndist;){for(;hr=G.lencode[fe&(1<<G.lenbits)-1],Bt=hr>>>24,or=hr>>>16&255,Br=hr&65535,!(Bt<=oe);){if(ae===0)break e;ae--,fe+=je[A++]<<oe,oe+=8}if(Br<16)fe>>>=Bt,oe-=Bt,G.lens[G.have++]=Br;else{if(Br===16){for(cr=Bt+2;oe<cr;){if(ae===0)break e;ae--,fe+=je[A++]<<oe,oe+=8}if(fe>>>=Bt,oe-=Bt,G.have===0){de.msg="invalid bit length repeat",G.mode=Z;break}mt=G.lens[G.have-1],Ye=3+(fe&3),fe>>>=2,oe-=2}else if(Br===17){for(cr=Bt+3;oe<cr;){if(ae===0)break e;ae--,fe+=je[A++]<<oe,oe+=8}fe>>>=Bt,oe-=Bt,mt=0,Ye=3+(fe&7),fe>>>=3,oe-=3}else{for(cr=Bt+7;oe<cr;){if(ae===0)break e;ae--,fe+=je[A++]<<oe,oe+=8}fe>>>=Bt,oe-=Bt,mt=0,Ye=11+(fe&127),fe>>>=7,oe-=7}if(G.have+Ye>G.nlen+G.ndist){de.msg="invalid bit length repeat",G.mode=Z;break}for(;Ye--;)G.lens[G.have++]=mt}}if(G.mode===Z)break;if(G.lens[256]===0){de.msg="invalid code -- missing end-of-block",G.mode=Z;break}if(G.lenbits=9,va={bits:G.lenbits},Qr=a(o,G.lens,0,G.nlen,G.lencode,0,G.work,va),G.lenbits=va.bits,Qr){de.msg="invalid literal/lengths set",G.mode=Z;break}if(G.distbits=6,G.distcode=G.distdyn,va={bits:G.distbits},Qr=a(s,G.lens,G.nlen,G.ndist,G.distcode,0,G.work,va),G.distbits=va.bits,Qr){de.msg="invalid distances set",G.mode=Z;break}if(G.mode=N,Me===u)break e;case N:G.mode=X;case X:if(ae>=6&&U>=258){de.next_out=ie,de.avail_out=U,de.next_in=A,de.avail_in=ae,G.hold=fe,G.bits=oe,n(de,st),ie=de.next_out,wt=de.output,U=de.avail_out,A=de.next_in,je=de.input,ae=de.avail_in,fe=G.hold,oe=G.bits,G.mode===K&&(G.back=-1);break}for(G.back=0;hr=G.lencode[fe&(1<<G.lenbits)-1],Bt=hr>>>24,or=hr>>>16&255,Br=hr&65535,!(Bt<=oe);){if(ae===0)break e;ae--,fe+=je[A++]<<oe,oe+=8}if(or&&!(or&240)){for(gr=Bt,ha=or,Co=Br;hr=G.lencode[Co+((fe&(1<<gr+ha)-1)>>gr)],Bt=hr>>>24,or=hr>>>16&255,Br=hr&65535,!(gr+Bt<=oe);){if(ae===0)break e;ae--,fe+=je[A++]<<oe,oe+=8}fe>>>=gr,oe-=gr,G.back+=gr}if(fe>>>=Bt,oe-=Bt,G.back+=Bt,G.length=Br,or===0){G.mode=he;break}if(or&32){G.back=-1,G.mode=K;break}if(or&64){de.msg="invalid literal/length code",G.mode=Z;break}G.extra=or&15,G.mode=Ee;case Ee:if(G.extra){for(cr=G.extra;oe<cr;){if(ae===0)break e;ae--,fe+=je[A++]<<oe,oe+=8}G.length+=fe&(1<<G.extra)-1,fe>>>=G.extra,oe-=G.extra,G.back+=G.extra}G.was=G.length,G.mode=Ae;case Ae:for(;hr=G.distcode[fe&(1<<G.distbits)-1],Bt=hr>>>24,or=hr>>>16&255,Br=hr&65535,!(Bt<=oe);){if(ae===0)break e;ae--,fe+=je[A++]<<oe,oe+=8}if(!(or&240)){for(gr=Bt,ha=or,Co=Br;hr=G.distcode[Co+((fe&(1<<gr+ha)-1)>>gr)],Bt=hr>>>24,or=hr>>>16&255,Br=hr&65535,!(gr+Bt<=oe);){if(ae===0)break e;ae--,fe+=je[A++]<<oe,oe+=8}fe>>>=gr,oe-=gr,G.back+=gr}if(fe>>>=Bt,oe-=Bt,G.back+=Bt,or&64){de.msg="invalid distance code",G.mode=Z;break}G.offset=Br,G.extra=or&15,G.mode=ze;case ze:if(G.extra){for(cr=G.extra;oe<cr;){if(ae===0)break e;ae--,fe+=je[A++]<<oe,oe+=8}G.offset+=fe&(1<<G.extra)-1,fe>>>=G.extra,oe-=G.extra,G.back+=G.extra}if(G.offset>G.dmax){de.msg="invalid distance too far back",G.mode=Z;break}G.mode=Le;case Le:if(U===0)break e;if(Ye=st-U,G.offset>Ye){if(Ye=G.offset-Ye,Ye>G.whave&&G.sane){de.msg="invalid distance too far back",G.mode=Z;break}Ye>G.wnext?(Ye-=G.wnext,It=G.wsize-Ye):It=G.wnext-Ye,Ye>G.length&&(Ye=G.length),wr=G.window}else wr=wt,It=ie-G.offset,Ye=G.length;Ye>U&&(Ye=U),U-=Ye,G.length-=Ye;do wt[ie++]=wr[It++];while(--Ye);G.length===0&&(G.mode=X);break;case he:if(U===0)break e;wt[ie++]=G.length,U--,G.mode=X;break;case Ie:if(G.wrap){for(;oe<32;){if(ae===0)break e;ae--,fe|=je[A++]<<oe,oe+=8}if(st-=U,de.total_out+=st,G.total+=st,st&&(de.adler=G.check=G.flags?r(G.check,wt,st,ie-st):t(G.check,wt,st,ie-st)),st=U,(G.flags?fe:ee(fe))!==G.check){de.msg="incorrect data check",G.mode=Z;break}fe=0,oe=0}G.mode=De;case De:if(G.wrap&&G.flags){for(;oe<32;){if(ae===0)break e;ae--,fe+=je[A++]<<oe,oe+=8}if(fe!==(G.total&4294967295)){de.msg="incorrect length check",G.mode=Z;break}fe=0,oe=0}G.mode=Be;case Be:Qr=f;break e;case Z:Qr=h;break e;case se:return b;case we:default:return _}return de.next_out=ie,de.avail_out=U,de.next_in=A,de.avail_in=ae,G.hold=fe,G.bits=oe,(G.wsize||st!==de.avail_out&&G.mode<Z&&(G.mode<Ie||Me!==l))&&$e(de,de.output,de.next_out,st-de.avail_out),tt-=de.avail_in,st-=de.avail_out,de.total_in+=tt,de.total_out+=st,G.total+=st,G.wrap&&st&&(de.adler=G.check=G.flags?r(G.check,wt,st,de.next_out-st):t(G.check,wt,st,de.next_out-st)),de.data_type=G.bits+(G.last?64:0)+(G.mode===K?128:0)+(G.mode===N||G.mode===ne?256:0),(tt===0&&st===0||Me===l)&&Qr===d&&(Qr=v),Qr}function ge(de){if(!de||!de.state)return _;var Me=de.state;return Me.window&&(Me.window=null),de.state=null,d}function Oe(de,Me){var G;return!de||!de.state||(G=de.state,!(G.wrap&2))?_:(G.head=Me,Me.done=!1,d)}function He(de,Me){var G=Me.length,je,wt,A;return!de||!de.state||(je=de.state,je.wrap!==0&&je.mode!==F)?_:je.mode===F&&(wt=1,wt=t(wt,Me,G,0),wt!==je.check)?h:(A=$e(de,Me,G,G),A?(je.mode=se,b):(je.havedict=1,d))}return qn.inflateReset=Pe,qn.inflateReset2=Ge,qn.inflateResetKeep=ve,qn.inflateInit=We,qn.inflateInit2=Ue,qn.inflate=L,qn.inflateEnd=ge,qn.inflateGetHeader=Oe,qn.inflateSetDictionary=He,qn.inflateInfo="pako inflate (from Nodeca project)",qn}var Fd,D2;function z2(){return D2||(D2=1,Fd={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}),Fd}var Rd,I2;function lO(){if(I2)return Rd;I2=1;function e(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}return Rd=e,Rd}var O2;function cO(){if(O2)return es;O2=1;var e=sO(),t=Li(),r=k2(),n=z2(),a=zd(),i=C2(),o=lO(),s=Object.prototype.toString;function l(d){if(!(this instanceof l))return new l(d);this.options=t.assign({chunkSize:16384,windowBits:0,to:""},d||{});var f=this.options;f.raw&&f.windowBits>=0&&f.windowBits<16&&(f.windowBits=-f.windowBits,f.windowBits===0&&(f.windowBits=-15)),f.windowBits>=0&&f.windowBits<16&&!(d&&d.windowBits)&&(f.windowBits+=32),f.windowBits>15&&f.windowBits<48&&(f.windowBits&15||(f.windowBits|=15)),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new i,this.strm.avail_out=0;var p=e.inflateInit2(this.strm,f.windowBits);if(p!==n.Z_OK)throw new Error(a[p]);if(this.header=new o,e.inflateGetHeader(this.strm,this.header),f.dictionary&&(typeof f.dictionary=="string"?f.dictionary=r.string2buf(f.dictionary):s.call(f.dictionary)==="[object ArrayBuffer]"&&(f.dictionary=new Uint8Array(f.dictionary)),f.raw&&(p=e.inflateSetDictionary(this.strm,f.dictionary),p!==n.Z_OK)))throw new Error(a[p])}l.prototype.push=function(d,f){var p=this.strm,_=this.options.chunkSize,h=this.options.dictionary,b,v,m,y,g,S=!1;if(this.ended)return!1;v=f===~~f?f:f===!0?n.Z_FINISH:n.Z_NO_FLUSH,typeof d=="string"?p.input=r.binstring2buf(d):s.call(d)==="[object ArrayBuffer]"?p.input=new Uint8Array(d):p.input=d,p.next_in=0,p.avail_in=p.input.length;do{if(p.avail_out===0&&(p.output=new t.Buf8(_),p.next_out=0,p.avail_out=_),b=e.inflate(p,n.Z_NO_FLUSH),b===n.Z_NEED_DICT&&h&&(b=e.inflateSetDictionary(this.strm,h)),b===n.Z_BUF_ERROR&&S===!0&&(b=n.Z_OK,S=!1),b!==n.Z_STREAM_END&&b!==n.Z_OK)return this.onEnd(b),this.ended=!0,!1;p.next_out&&(p.avail_out===0||b===n.Z_STREAM_END||p.avail_in===0&&(v===n.Z_FINISH||v===n.Z_SYNC_FLUSH))&&(this.options.to==="string"?(m=r.utf8border(p.output,p.next_out),y=p.next_out-m,g=r.buf2string(p.output,m),p.next_out=y,p.avail_out=_-y,y&&t.arraySet(p.output,p.output,m,y,0),this.onData(g)):this.onData(t.shrinkBuf(p.output,p.next_out))),p.avail_in===0&&p.avail_out===0&&(S=!0)}while((p.avail_in>0||p.avail_out===0)&&b!==n.Z_STREAM_END);return b===n.Z_STREAM_END&&(v=n.Z_FINISH),v===n.Z_FINISH?(b=e.inflateEnd(this.strm),this.onEnd(b),this.ended=!0,b===n.Z_OK):(v===n.Z_SYNC_FLUSH&&(this.onEnd(n.Z_OK),p.avail_out=0),!0)},l.prototype.onData=function(d){this.chunks.push(d)},l.prototype.onEnd=function(d){d===n.Z_OK&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=t.flattenChunks(this.chunks)),this.chunks=[],this.err=d,this.msg=this.strm.msg};function c(d,f){var p=new l(f);if(p.push(d,!0),p.err)throw p.msg||a[p.err];return p.result}function u(d,f){return f=f||{},f.raw=!0,c(d,f)}return es.Inflate=l,es.inflate=c,es.inflateRaw=u,es.ungzip=c,es}var Ld,P2;function uO(){if(P2)return Ld;P2=1;var e=Li().assign,t=aO(),r=cO(),n=z2(),a={};return e(a,t,r,n),Ld=a,Ld}(function(e){(function(){var t={};e.exports=t;var r;typeof tO=="function"?r=uO():r=self.pako;function n(){typeof process>"u"&&console.log.apply(console,arguments)}(function(a,i){(function(){var o=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(c){return typeof c}:function(c){return c&&typeof Symbol=="function"&&c.constructor===Symbol&&c!==Symbol.prototype?"symbol":typeof c},s=function(){function c(u){this.message="JPEG error: "+u}return c.prototype=Error(),c.prototype.name="JpegError",c.constructor=c}(),l=function(){function c(u,d){this.message=u,this.g=d}return c.prototype=Error(),c.prototype.name="DNLMarkerError",c.constructor=c}();(function(){function c(){this.M=null,this.B=-1}function u(h,b){for(var v=0,m=[],y,g,S=16;0<S&&!h[S-1];)S--;m.push({children:[],index:0});var M=m[0],E;for(y=0;y<S;y++){for(g=0;g<h[y];g++){for(M=m.pop(),M.children[M.index]=b[v];0<M.index;)M=m.pop();for(M.index++,m.push(M);m.length<=y;)m.push(E={children:[],index:0}),M.children[M.index]=E.children,M=E;v++}y+1<S&&(m.push(E={children:[],index:0}),M.children[M.index]=E.children,M=E)}return m[0].children}function d(h,b,v,m,y,g,S,M,E){function w(){if(0<P)return P--,j>>P&1;if(j=h[b++],j===255){var ye=h[b++];if(ye){if(ye===220&&ne){b+=2;var xe=h[b++]<<8|h[b++];if(0<xe&&xe!==v.g)throw new l("Found DNL marker (0xFFDC) while parsing scan data",xe)}throw new s("unexpected marker "+(j<<8|ye).toString(16))}}return P=7,j>>>7}function x(ye){for(;;){if(ye=ye[w()],typeof ye=="number")return ye;if((typeof ye>"u"?"undefined":o(ye))!=="object")throw new s("invalid huffman sequence")}}function C(ye){for(var xe=0;0<ye;)xe=xe<<1|w(),ye--;return xe}function D(ye){if(ye===1)return w()===1?1:-1;var xe=C(ye);return xe>=1<<ye-1?xe:xe+(-1<<ye)+1}function B(ye,xe){var ee=x(ye.D);for(ee=ee===0?0:D(ee),ye.a[xe]=ye.m+=ee,ee=1;64>ee;){var pe=x(ye.o),ve=pe&15;if(pe>>=4,ve===0){if(15>pe)break;ee+=16}else ee+=pe,ye.a[xe+_[ee]]=D(ve),ee++}}function F(ye,xe){var ee=x(ye.D);ee=ee===0?0:D(ee)<<E,ye.a[xe]=ye.m+=ee}function K(ye,xe){ye.a[xe]|=w()<<E}function te(ye,xe){if(0<N)N--;else for(var ee=g;ee<=S;){var pe=x(ye.o),ve=pe&15;if(pe>>=4,ve===0){if(15>pe){N=C(pe)+(1<<pe)-1;break}ee+=16}else ee+=pe,ye.a[xe+_[ee]]=D(ve)*(1<<E),ee++}}function J(ye,xe){for(var ee=g,pe=0,ve;ee<=S;){ve=xe+_[ee];var Pe=0>ye.a[ve]?-1:1;switch(X){case 0:if(pe=x(ye.o),ve=pe&15,pe>>=4,ve===0)15>pe?(N=C(pe)+(1<<pe),X=4):(pe=16,X=1);else{if(ve!==1)throw new s("invalid ACn encoding");Ee=D(ve),X=pe?2:3}continue;case 1:case 2:ye.a[ve]?ye.a[ve]+=Pe*(w()<<E):(pe--,pe===0&&(X=X===2?3:0));break;case 3:ye.a[ve]?ye.a[ve]+=Pe*(w()<<E):(ye.a[ve]=Ee<<E,X=0);break;case 4:ye.a[ve]&&(ye.a[ve]+=Pe*(w()<<E))}ee++}X===4&&(N--,N===0&&(X=0))}for(var ne=9<arguments.length&&arguments[9]!==void 0?arguments[9]:!1,le=v.P,q=b,j=0,P=0,N=0,X=0,Ee,Ae=m.length,ze,Le,he,Ie,De=v.S?g===0?M===0?F:K:M===0?te:J:B,Be=0,Z=Ae===1?m[0].c*m[0].l:le*v.O,se,we;Be<Z;){var Se=y?Math.min(Z-Be,y):Z;for(ze=0;ze<Ae;ze++)m[ze].m=0;if(N=0,Ae===1){var me=m[0];for(Ie=0;Ie<Se;Ie++)De(me,64*((me.c+1)*(Be/me.c|0)+Be%me.c)),Be++}else for(Ie=0;Ie<Se;Ie++){for(ze=0;ze<Ae;ze++)for(me=m[ze],se=me.h,we=me.j,Le=0;Le<we;Le++)for(he=0;he<se;he++)De(me,64*((me.c+1)*((Be/le|0)*me.j+Le)+(Be%le*me.h+he)));Be++}if(P=0,(me=p(h,b))&&me.f&&((0,_util.warn)("decodeScan - unexpected MCU data, current marker is: "+me.f),b=me.offset),me=me&&me.F,!me||65280>=me)throw new s("marker was not found");if(65488<=me&&65495>=me)b+=2;else break}return(me=p(h,b))&&me.f&&((0,_util.warn)("decodeScan - unexpected Scan data, current marker is: "+me.f),b=me.offset),b-q}function f(h,b){for(var v=b.c,m=b.l,y=new Int16Array(64),g=0;g<m;g++)for(var S=0;S<v;S++){var M=64*((b.c+1)*g+S),E=y,w=b.G,x=b.a;if(!w)throw new s("missing required Quantization Table.");for(var C=0;64>C;C+=8){var D=x[M+C],B=x[M+C+1],F=x[M+C+2],K=x[M+C+3],te=x[M+C+4],J=x[M+C+5],ne=x[M+C+6],le=x[M+C+7];if(D*=w[C],!(B|F|K|te|J|ne|le))D=5793*D+512>>10,E[C]=D,E[C+1]=D,E[C+2]=D,E[C+3]=D,E[C+4]=D,E[C+5]=D,E[C+6]=D,E[C+7]=D;else{B*=w[C+1],F*=w[C+2],K*=w[C+3],te*=w[C+4],J*=w[C+5],ne*=w[C+6],le*=w[C+7];var q=5793*D+128>>8,j=5793*te+128>>8,P=F,N=ne;te=2896*(B-le)+128>>8,le=2896*(B+le)+128>>8,K<<=4,J<<=4,q=q+j+1>>1,j=q-j,D=3784*P+1567*N+128>>8,P=1567*P-3784*N+128>>8,N=D,te=te+J+1>>1,J=te-J,le=le+K+1>>1,K=le-K,q=q+N+1>>1,N=q-N,j=j+P+1>>1,P=j-P,D=2276*te+3406*le+2048>>12,te=3406*te-2276*le+2048>>12,le=D,D=799*K+4017*J+2048>>12,K=4017*K-799*J+2048>>12,J=D,E[C]=q+le,E[C+7]=q-le,E[C+1]=j+J,E[C+6]=j-J,E[C+2]=P+K,E[C+5]=P-K,E[C+3]=N+te,E[C+4]=N-te}}for(w=0;8>w;++w)D=E[w],B=E[w+8],F=E[w+16],K=E[w+24],te=E[w+32],J=E[w+40],ne=E[w+48],le=E[w+56],B|F|K|te|J|ne|le?(q=5793*D+2048>>12,j=5793*te+2048>>12,P=F,N=ne,te=2896*(B-le)+2048>>12,le=2896*(B+le)+2048>>12,q=(q+j+1>>1)+4112,j=q-j,D=3784*P+1567*N+2048>>12,P=1567*P-3784*N+2048>>12,N=D,te=te+J+1>>1,J=te-J,le=le+K+1>>1,K=le-K,q=q+N+1>>1,N=q-N,j=j+P+1>>1,P=j-P,D=2276*te+3406*le+2048>>12,te=3406*te-2276*le+2048>>12,le=D,D=799*K+4017*J+2048>>12,K=4017*K-799*J+2048>>12,J=D,D=q+le,le=q-le,B=j+J,ne=j-J,F=P+K,J=P-K,K=N+te,te=N-te,D=16>D?0:4080<=D?255:D>>4,B=16>B?0:4080<=B?255:B>>4,F=16>F?0:4080<=F?255:F>>4,K=16>K?0:4080<=K?255:K>>4,te=16>te?0:4080<=te?255:te>>4,J=16>J?0:4080<=J?255:J>>4,ne=16>ne?0:4080<=ne?255:ne>>4,le=16>le?0:4080<=le?255:le>>4,x[M+w]=D,x[M+w+8]=B,x[M+w+16]=F,x[M+w+24]=K,x[M+w+32]=te,x[M+w+40]=J,x[M+w+48]=ne,x[M+w+56]=le):(D=5793*D+8192>>14,D=-2040>D?0:2024<=D?255:D+2056>>4,x[M+w]=D,x[M+w+8]=D,x[M+w+16]=D,x[M+w+24]=D,x[M+w+32]=D,x[M+w+40]=D,x[M+w+48]=D,x[M+w+56]=D)}return b.a}function p(h,b){var v=2<arguments.length&&arguments[2]!==void 0?arguments[2]:b,m=h.length-1;if(v=v<b?v:b,b>=m)return null;var y=h[b]<<8|h[b+1];if(65472<=y&&65534>=y)return{f:null,F:y,offset:b};for(var g=h[v]<<8|h[v+1];!(65472<=g&&65534>=g);){if(++v>=m)return null;g=h[v]<<8|h[v+1]}return{f:y.toString(16),F:g,offset:v}}var _=new Uint8Array([0,1,8,16,9,2,3,10,17,24,32,25,18,11,4,5,12,19,26,33,40,48,41,34,27,20,13,6,7,14,21,28,35,42,49,56,57,50,43,36,29,22,15,23,30,37,44,51,58,59,52,45,38,31,39,46,53,60,61,54,47,55,62,63]);c.prototype={parse:function(h){function b(){var P=h[S]<<8|h[S+1];return S+=2,P}function v(){var P=b();P=S+P-2;var N=p(h,P,S);return N&&N.f&&((0,_util.warn)("readDataBlock - incorrect length, current marker is: "+N.f),P=N.offset),P=h.subarray(S,P),S+=P.length,P}function m(P){for(var N=Math.ceil(P.v/8/P.s),X=Math.ceil(P.g/8/P.u),Ee=0;Ee<P.b.length;Ee++){q=P.b[Ee];var Ae=Math.ceil(Math.ceil(P.v/8)*q.h/P.s),ze=Math.ceil(Math.ceil(P.g/8)*q.j/P.u);q.a=new Int16Array(64*X*q.j*(N*q.h+1)),q.c=Ae,q.l=ze}P.P=N,P.O=X}var y=(1<arguments.length&&arguments[1]!==void 0?arguments[1]:{}).N,g=y===void 0?null:y,S=0,M=null,E=0;y=[];var w=[],x=[],C=b();if(C!==65496)throw new s("SOI not found");for(C=b();C!==65497;){switch(C){case 65504:case 65505:case 65506:case 65507:case 65508:case 65509:case 65510:case 65511:case 65512:case 65513:case 65514:case 65515:case 65516:case 65517:case 65518:case 65519:case 65534:var D=v();C===65518&&D[0]===65&&D[1]===100&&D[2]===111&&D[3]===98&&D[4]===101&&(M={version:D[5]<<8|D[6],Y:D[7]<<8|D[8],Z:D[9]<<8|D[10],W:D[11]});break;case 65499:C=b()+S-2;for(var B;S<C;){var F=h[S++],K=new Uint16Array(64);if(F>>4)if(F>>4===1)for(D=0;64>D;D++)B=_[D],K[B]=b();else throw new s("DQT - invalid table spec");else for(D=0;64>D;D++)B=_[D],K[B]=h[S++];y[F&15]=K}break;case 65472:case 65473:case 65474:if(te)throw new s("Only single frame JPEGs supported");b();var te={};for(te.X=C===65473,te.S=C===65474,te.precision=h[S++],C=b(),te.g=g||C,te.v=b(),te.b=[],te.C={},D=h[S++],C=K=F=0;C<D;C++){B=h[S];var J=h[S+1]>>4,ne=h[S+1]&15;F<J&&(F=J),K<ne&&(K=ne),J=te.b.push({h:J,j:ne,T:h[S+2],G:null}),te.C[B]=J-1,S+=3}te.s=F,te.u=K,m(te);break;case 65476:for(B=b(),C=2;C<B;){for(F=h[S++],K=new Uint8Array(16),D=J=0;16>D;D++,S++)J+=K[D]=h[S];for(ne=new Uint8Array(J),D=0;D<J;D++,S++)ne[D]=h[S];C+=17+J,(F>>4?w:x)[F&15]=u(K,ne)}break;case 65501:b();var le=b();break;case 65498:for(D=++E===1&&!g,b(),F=h[S++],B=[],C=0;C<F;C++){K=te.C[h[S++]];var q=te.b[K];K=h[S++],q.D=x[K>>4],q.o=w[K&15],B.push(q)}C=h[S++],F=h[S++],K=h[S++];try{var j=d(h,S,te,B,le,C,F,K>>4,K&15,D);S+=j}catch(P){if(P instanceof l)return(0,_util.warn)('Attempting to re-parse JPEG image using "scanLines" parameter found in DNL marker (0xFFDC) segment.'),this.parse(h,{N:P.g});throw P}break;case 65500:S+=4;break;case 65535:h[S]!==255&&S--;break;default:if(h[S-3]===255&&192<=h[S-2]&&254>=h[S-2])S-=3;else if((D=p(h,S-2))&&D.f)(0,_util.warn)("JpegImage.parse - unexpected data, current marker is: "+D.f),S=D.offset;else throw new s("unknown marker "+C.toString(16))}C=b()}for(this.width=te.v,this.height=te.g,this.A=M,this.b=[],C=0;C<te.b.length;C++)q=te.b[C],(le=y[q.T])&&(q.G=le),this.b.push({R:f(te,q),U:q.h/te.s,V:q.j/te.u,c:q.c,l:q.l});this.i=this.b.length},L:function(h,b){var v=this.width/h,m=this.height/b,y,g,S=this.b.length,M=h*b*S,E=new Uint8ClampedArray(M),w=new Uint32Array(h);for(g=0;g<S;g++){var x=this.b[g],C=x.U*v,D=x.V*m,B=g,F=x.R,K=x.c+1<<3;for(y=0;y<h;y++)x=0|y*C,w[y]=(x&4294967288)<<3|x&7;for(C=0;C<b;C++)for(x=0|C*D,x=K*(x&4294967288)|(x&7)<<3,y=0;y<h;y++)E[B]=F[x+w[y]],B+=S}if(m=this.M)for(g=0;g<M;)for(v=x=0;x<S;x++,g++,v+=2)E[g]=(E[g]*m[v]>>8)+m[v+1];return E},w:function(){return this.A?!!this.A.W:this.i===3?this.B!==0:this.B===1},I:function(h){for(var b,v,m,y=0,g=h.length;y<g;y+=3)b=h[y],v=h[y+1],m=h[y+2],h[y]=b-179.456+1.402*m,h[y+1]=b+135.459-.344*v-.714*m,h[y+2]=b-226.816+1.772*v;return h},K:function(h){for(var b,v,m,y,g=0,S=0,M=h.length;S<M;S+=4)b=h[S],v=h[S+1],m=h[S+2],y=h[S+3],h[g++]=-122.67195406894+v*(-660635669420364e-19*v+.000437130475926232*m-54080610064599e-18*b+.00048449797120281*y-.154362151871126)+m*(-.000957964378445773*m+.000817076911346625*b-.00477271405408747*y+1.53380253221734)+b*(.000961250184130688*b-.00266257332283933*y+.48357088451265)+y*(-.000336197177618394*y+.484791561490776),h[g++]=107.268039397724+v*(219927104525741e-19*v-.000640992018297945*m+.000659397001245577*b+.000426105652938837*y-.176491792462875)+m*(-.000778269941513683*m+.00130872261408275*b+.000770482631801132*y-.151051492775562)+b*(.00126935368114843*b-.00265090189010898*y+.25802910206845)+y*(-.000318913117588328*y-.213742400323665),h[g++]=-20.810012546947+v*(-.000570115196973677*v-263409051004589e-19*m+.0020741088115012*b-.00288260236853442*y+.814272968359295)+m*(-153496057440975e-19*m-.000132689043961446*b+.000560833691242812*y-.195152027534049)+b*(.00174418132927582*b-.00255243321439347*y+.116935020465145)+y*(-.000343531996510555*y+.24165260232407);return h.subarray(0,g)},J:function(h){for(var b,v,m,y=0,g=h.length;y<g;y+=4)b=h[y],v=h[y+1],m=h[y+2],h[y]=434.456-b-1.402*m,h[y+1]=119.541-b+.344*v+.714*m,h[y+2]=481.816-b-1.772*v;return h},H:function(h){for(var b,v,m,y,g=0,S=1/255,M=0,E=h.length;M<E;M+=4)b=h[M]*S,v=h[M+1]*S,m=h[M+2]*S,y=h[M+3]*S,h[g++]=255+b*(-4.387332384609988*b+54.48615194189176*v+18.82290502165302*m+212.25662451639585*y-285.2331026137004)+v*(1.7149763477362134*v-5.6096736904047315*m-17.873870861415444*y-5.497006427196366)+m*(-2.5217340131683033*m-21.248923337353073*y+17.5119270841813)-y*(21.86122147463605*y+189.48180835922747),h[g++]=255+b*(8.841041422036149*b+60.118027045597366*v+6.871425592049007*m+31.159100130055922*y-79.2970844816548)+v*(-15.310361306967817*v+17.575251261109482*m+131.35250912493976*y-190.9453302588951)+m*(4.444339102852739*m+9.8632861493405*y-24.86741582555878)-y*(20.737325471181034*y+187.80453709719578),h[g++]=255+b*(.8842522430003296*b+8.078677503112928*v+30.89978309703729*m-.23883238689178934*y-14.183576799673286)+v*(10.49593273432072*v+63.02378494754052*m+50.606957656360734*y-112.23884253719248)+m*(.03296041114873217*m+115.60384449646641*y-193.58209356861505)-y*(22.33816807309886*y+180.12613974708367);return h.subarray(0,g)},getData:function(h,b,v){if(4<this.i)throw new s("Unsupported color mode");if(h=this.L(h,b),this.i===1&&v){v=h.length,b=new Uint8ClampedArray(3*v);for(var m=0,y=0;y<v;y++){var g=h[y];b[m++]=g,b[m++]=g,b[m++]=g}return b}if(this.i===3&&this.w())return this.I(h);if(this.i===4){if(this.w())return v?this.K(h):this.J(h);if(v)return this.H(h)}return h}},a.JpegDecoder=c})()})(),a.encodeImage=function(o,s,l,c){var u={t256:[s],t257:[l],t258:[8,8,8,8],t259:[1],t262:[2],t273:[1e3],t277:[4],t278:[l],t279:[s*l*4],t282:[1],t283:[1],t284:[1],t286:[0],t287:[0],t296:[1],t305:["Photopea (UTIF.js)"],t338:[1]};if(c)for(var d in c)u[d]=c[d];for(var f=new Uint8Array(a.encode([u])),p=new Uint8Array(o),_=new Uint8Array(1e3+s*l*4),d=0;d<f.length;d++)_[d]=f[d];for(var d=0;d<p.length;d++)_[1e3+d]=p[d];return _.buffer},a.encode=function(o){var s=new Uint8Array(2e4),l=4,c=a._binBE;s[0]=77,s[1]=77,s[3]=42;var u=8;c.writeUint(s,l,u),l+=4;for(var d=0;d<o.length;d++){var f=a._writeIFD(c,s,u,o[d]);u=f[1],d<o.length-1&&c.writeUint(s,f[0],u)}return s.slice(0,u).buffer},a.decode=function(o){a.decode._decodeG3.allow2D=null;var s=new Uint8Array(o),l=0,c=a._binBE.readASCII(s,l,2);l+=2;var u=c=="II"?a._binLE:a._binBE;u.readUshort(s,l),l+=2;var d=u.readUint(s,l);l+=4;for(var f=[];;){var p=a._readIFD(u,s,d,f,0,!1);if(d=u.readUint(s,p),d==0)break}return f},a.decodeImage=function(o,s,l){var c=new Uint8Array(o),u=a._binBE.readASCII(c,0,2);if(s.t256!=null){s.isLE=u=="II",s.width=s.t256[0],s.height=s.t257[0];var d=s.t259?s.t259[0]:1,f=s.t266?s.t266[0]:1;s.t284&&s.t284[0]==2&&n("PlanarConfiguration 2 should not be used!");var p;s.t258?p=Math.min(32,s.t258[0])*s.t258.length:p=s.t277?s.t277[0]:1,d==1&&s.t279!=null&&s.t278&&s.t262[0]==32803&&(p=Math.round(s.t279[0]*8/(s.width*s.t278[0])));var _=Math.ceil(s.width*p/8)*8,h=s.t273;h==null&&(h=s.t324);var b=s.t279;d==1&&h.length==1&&(b=[s.height*(_>>>3)]),b==null&&(b=s.t325);var v=new Uint8Array(s.height*(_>>>3)),m=0;if(s.t322!=null){for(var y=s.t322[0],g=s.t323[0],S=Math.floor((s.width+y-1)/y),M=Math.floor((s.height+g-1)/g),E=new Uint8Array(Math.ceil(y*g*p/8)|0),w=0;w<M;w++)for(var x=0;x<S;x++){for(var C=w*S+x,D=0;D<E.length;D++)E[D]=0;a.decode._decompress(s,l,c,h[C],b[C],d,E,0,f),d==6?v=E:a._copyTile(E,Math.ceil(y*p/8)|0,g,v,Math.ceil(s.width*p/8)|0,s.height,Math.ceil(x*y*p/8)|0,w*g)}m=v.length*8}else{var B=s.t278?s.t278[0]:s.height;B=Math.min(B,s.height);for(var C=0;C<h.length;C++)a.decode._decompress(s,l,c,h[C],b[C],d,v,Math.ceil(m/8)|0,f),m+=_*B;m=Math.min(m,v.length*8)}s.data=new Uint8Array(v.buffer,0,Math.ceil(m/8)|0)}},a.decode._decompress=function(o,s,l,c,u,d,f,p,_){if(d==1||u==f.length&&d!=32767)for(var h=0;h<u;h++)f[p+h]=l[c+h];else if(d==3)a.decode._decodeG3(l,c,u,f,p,o.width,_);else if(d==4)a.decode._decodeG4(l,c,u,f,p,o.width,_);else if(d==5)a.decode._decodeLZW(l,c,f,p);else if(d==6)a.decode._decodeOldJPEG(o,l,c,u,f,p);else if(d==7)a.decode._decodeNewJPEG(o,l,c,u,f,p);else if(d==8)for(var b=new Uint8Array(l.buffer,c,u),v=i.inflate(b),m=0;m<v.length;m++)f[p+m]=v[m];else d==32767?a.decode._decodeARW(o,l,c,u,f,p):d==32773?a.decode._decodePackBits(l,c,u,f,p):d==32809?a.decode._decodeThunder(l,c,u,f,p):d==34713?a.decode._decodeNikon(o,s,l,c,u,f,p):n("Unknown compression",d);var y=o.t258?Math.min(32,o.t258[0]):1,g=o.t277?o.t277[0]:1,S=y*g>>>3,M=o.t278?o.t278[0]:o.height,E=Math.ceil(y*g*o.width/8);if(y==16&&!o.isLE&&o.t33422==null)for(var w=0;w<M;w++)for(var x=p+w*E,C=1;C<E;C+=2){var D=f[x+C];f[x+C]=f[x+C-1],f[x+C-1]=D}if(o.t317&&o.t317[0]==2)for(var w=0;w<M;w++){var B=p+w*E;if(y==16)for(var h=S;h<E;h+=2){var F=(f[B+h+1]<<8|f[B+h])+(f[B+h-S+1]<<8|f[B+h-S]);f[B+h]=F&255,f[B+h+1]=F>>>8&255}else if(g==3)for(var h=3;h<E;h+=3)f[B+h]=f[B+h]+f[B+h-3]&255,f[B+h+1]=f[B+h+1]+f[B+h-2]&255,f[B+h+2]=f[B+h+2]+f[B+h-1]&255;else for(var h=S;h<E;h++)f[B+h]=f[B+h]+f[B+h-S]&255}},a.decode._ljpeg_diff=function(o,s,l){var c=a.decode._getbithuff,u,d;return u=c(o,s,l[0],l),d=c(o,s,u,0),d&1<<u-1||(d-=(1<<u)-1),d},a.decode._decodeARW=function(o,s,l,c,u,d){var f=o.t256[0],p=o.t257[0],_=o.t258[0],h=o.isLE?a._binLE:a._binBE,b=f*p==c||f*p*1.5==c;if(!b){p+=8;var v=[l,0,0,0],m=new Uint16Array(32770),y=[3857,3856,3599,3342,3085,2828,2571,2314,2057,1800,1543,1286,1029,772,771,768,514,513],X,g,S,te,K,M=0,E=a.decode._ljpeg_diff;for(m[0]=15,S=X=0;X<18;X++)for(var w=32768>>>(y[X]>>>8),g=0;g<w;g++)m[++S]=y[X];for(te=f;te--;)for(K=0;K<p+1;K+=2)if(K==p&&(K=1),M+=E(s,v,m),K<p){var x=M&4095;a.decode._putsF(u,(K*f+te)*_,x<<16-_)}return}if(f*p*1.5==c){for(var X=0;X<c;X+=3){var C=s[l+X+0],D=s[l+X+1],B=s[l+X+2];u[d+X]=D<<4|C>>>4,u[d+X+1]=C<<4|B>>>4,u[d+X+2]=B<<4|D>>>4}return}var F=new Uint16Array(16),K,te,J,ne,le,q,j,P,N,X,Ee,Ae=new Uint8Array(f+1);for(K=0;K<p;K++){for(var ze=0;ze<f;ze++)Ae[ze]=s[l++];for(Ee=0,te=0;te<f-30;Ee+=16){for(ne=2047&(J=h.readUint(Ae,Ee)),le=2047&J>>>11,q=15&J>>>22,j=15&J>>>26,P=0;P<4&&128<<P<=ne-le;P++);for(N=30,X=0;X<16;X++)X==q?F[X]=ne:X==j?F[X]=le:(F[X]=((h.readUshort(Ae,Ee+(N>>3))>>>(N&7)&127)<<P)+le,F[X]>2047&&(F[X]=2047),N+=7);for(X=0;X<16;X++,te+=2){var x=F[X]<<1;a.decode._putsF(u,(K*f+te)*_,x<<16-_)}te-=te&1?1:31}}},a.decode._decodeNikon=function(o,s,l,c,u,d,f){var p=[[0,0,1,5,1,1,1,1,1,1,2,0,0,0,0,0,0,5,4,3,6,2,7,1,0,8,9,11,10,12],[0,0,1,5,1,1,1,1,1,1,2,0,0,0,0,0,0,57,90,56,39,22,5,4,3,2,1,0,11,12,12],[0,0,1,4,2,3,1,2,0,0,0,0,0,0,0,0,0,5,4,6,3,7,2,8,1,9,0,10,11,12],[0,0,1,4,3,1,1,1,1,1,2,0,0,0,0,0,0,5,6,4,7,8,3,9,2,1,0,10,11,12,13,14],[0,0,1,5,1,1,1,1,1,1,1,2,0,0,0,0,0,8,92,75,58,41,7,6,5,4,3,2,1,0,13,14],[0,0,1,4,2,2,3,1,2,0,0,0,0,0,0,0,0,7,6,8,5,9,4,10,3,11,12,2,0,1,13,14]],_=o.t256[0],h=o.t257[0],b=o.t258[0],v=0,m=0,y=a.decode._make_decoder,g=a.decode._getbithuff,S=s[0].exifIFD.makerNote,M=S.t150?S.t150:S.t140,E=0,w=M[E++],x=M[E++];(w==73||x==88)&&(E+=2110),w==70&&(v=2),b==14&&(v+=3);for(var C=[[0,0],[0,0]],D=o.isLE?a._binLE:a._binBE,J=0;J<2;J++)for(var B=0;B<2;B++)C[J][B]=D.readShort(M,E),E+=2;var F=1<<b&32767,K=0,te=D.readShort(M,E);E+=2,te>1&&(K=Math.floor(F/(te-1))),w==68&&x==32&&K>0&&(m=D.readShort(M,562));var J,ne,le,q,j,P,N=[0,0],X=y(p[v]),Ee=[c,0,0,0];for(ne=0;ne<h;ne++)for(m&&ne==m&&(X=y(p[v+1])),le=0;le<_;le++){J=g(l,Ee,X[0],X),q=J&15,j=J>>>4,P=(g(l,Ee,q-j,0)<<1)+1<<j>>>1,P&1<<q-1||(P-=(1<<q)-(j==0?1:0)),le<2?N[le]=C[ne&1][le]+=P:N[le&1]+=P;var Ae=Math.min(Math.max(N[le&1],0),(1<<b)-1),ze=(ne*_+le)*b;a.decode._putsF(d,ze,Ae<<16-b)}},a.decode._putsF=function(o,s,l){l=l<<8-(s&7);var c=s>>>3;o[c]|=l>>>16,o[c+1]|=l>>>8,o[c+2]|=l},a.decode._getbithuff=function(o,s,l,c){var u=0;a.decode._get_byte;var d,f=s[0],p=s[1],_=s[2],h=s[3];if(l==0||_<0)return 0;for(;!h&&_<l&&(d=o[f++])!=-1&&!(h=u);)p=(p<<8)+d,_+=8;if(d=p<<32-_>>>32-l,c?(_-=c[d+1]>>>8,d=c[d+1]&255):_-=l,_<0)throw"e";return s[0]=f,s[1]=p,s[2]=_,s[3]=h,d},a.decode._make_decoder=function(o){var s,l,c,u,d,f=[];for(s=16;s!=0&&!o[s];s--);var p=17;for(f[0]=s,c=l=1;l<=s;l++)for(u=0;u<o[l];u++,++p)for(d=0;d<1<<s-l;d++)c<=1<<s&&(f[c++]=l<<8|o[p]);return f},a.decode._decodeNewJPEG=function(o,s,l,c,u,d){var f=o.t347,p=f?f.length:0,_=new Uint8Array(p+c);if(f){for(var h=216,b=217,v=0,m=0;m<p-1&&!(f[m]==255&&f[m+1]==b);m++)_[v++]=f[m];var y=s[l],g=s[l+1];(y!=255||g!=h)&&(_[v++]=y,_[v++]=g);for(var m=2;m<c;m++)_[v++]=s[l+m]}else for(var m=0;m<c;m++)_[m]=s[l+m];if(o.t262[0]==32803||o.t262[0]==34892){var S=o.t258[0],M=a.LosslessJpegDecode(_),E=M.length;if(S==16)if(o.isLE)for(var m=0;m<E;m++)u[d+(m<<1)]=M[m]&255,u[d+(m<<1)+1]=M[m]>>>8;else for(var m=0;m<E;m++)u[d+(m<<1)]=M[m]>>>8,u[d+(m<<1)+1]=M[m]&255;else if(S==14||S==12)for(var w=16-S,m=0;m<E;m++)a.decode._putsF(u,m*S,M[m]<<w);else throw new Error("unsupported bit depth "+S)}else{var x=new a.JpegDecoder;x.parse(_);for(var C=x.getData(x.width,x.height),m=0;m<C.length;m++)u[d+m]=C[m]}o.t262[0]==6&&(o.t262[0]=2)},a.decode._decodeOldJPEGInit=function(o,s,l,c){var u=216,d=219,f=196,p=221,_=192,h=218,b=0,v=0,m,y,g=!1,S,M,E,w=o.t513,x=w?w[0]:0,C=o.t514,D=C?C[0]:0,B=o.t324||o.t273||w,F=o.t530,K=0,te=0,J=o.t277?o.t277[0]:1,ne=o.t515;if(B&&(v=B[0],g=B.length>1),!g){if(s[l]==255&&s[l+1]==u)return{jpegOffset:l};if(w!=null&&(s[l+x]==255&&s[l+x+1]==u?b=l+x:n("JPEGInterchangeFormat does not point to SOI"),C==null?n("JPEGInterchangeFormatLength field is missing"):(x>=v||x+D<=v)&&n("JPEGInterchangeFormatLength field value is invalid"),b!=null))return{jpegOffset:b}}if(F!=null&&(K=F[0],te=F[1]),w!=null&&C!=null)if(D>=2&&x+D<=v){for(s[l+x+D-2]==255&&s[l+x+D-1]==u?m=new Uint8Array(D-2):m=new Uint8Array(D),S=0;S<m.length;S++)m[S]=s[l+x+S];n("Incorrect JPEG interchange format: using JPEGInterchangeFormat offset to derive tables")}else n("JPEGInterchangeFormat+JPEGInterchangeFormatLength > offset to first strip or tile");if(m==null){var le=0,q=[];q[le++]=255,q[le++]=u;var j=o.t519;if(j==null)throw new Error("JPEGQTables tag is missing");for(S=0;S<j.length;S++)for(q[le++]=255,q[le++]=d,q[le++]=0,q[le++]=67,q[le++]=S,M=0;M<64;M++)q[le++]=s[l+j[S]+M];for(E=0;E<2;E++){var P=o[E==0?"t520":"t521"];if(P==null)throw new Error((E==0?"JPEGDCTables":"JPEGACTables")+" tag is missing");for(S=0;S<P.length;S++){q[le++]=255,q[le++]=f;var N=19;for(M=0;M<16;M++)N+=s[l+P[S]+M];for(q[le++]=N>>>8,q[le++]=N&255,q[le++]=S|E<<4,M=0;M<16;M++)q[le++]=s[l+P[S]+M];for(M=0;M<N;M++)q[le++]=s[l+P[S]+16+M]}}if(q[le++]=255,q[le++]=_,q[le++]=0,q[le++]=8+3*J,q[le++]=8,q[le++]=o.height>>>8&255,q[le++]=o.height&255,q[le++]=o.width>>>8&255,q[le++]=o.width&255,q[le++]=J,J==1)q[le++]=1,q[le++]=17,q[le++]=0;else for(S=0;S<3;S++)q[le++]=S+1,q[le++]=S!=0?17:(K&15)<<4|te&15,q[le++]=S;ne!=null&&ne[0]!=0&&(q[le++]=255,q[le++]=p,q[le++]=0,q[le++]=4,q[le++]=ne[0]>>>8&255,q[le++]=ne[0]&255),m=new Uint8Array(q)}var X=-1;for(S=0;S<m.length-1;){if(m[S]==255&&m[S+1]==_){X=S;break}S++}if(X==-1){var Ee=new Uint8Array(m.length+10+3*J);Ee.set(m);var Ae=m.length;if(X=m.length,m=Ee,m[Ae++]=255,m[Ae++]=_,m[Ae++]=0,m[Ae++]=8+3*J,m[Ae++]=8,m[Ae++]=o.height>>>8&255,m[Ae++]=o.height&255,m[Ae++]=o.width>>>8&255,m[Ae++]=o.width&255,m[Ae++]=J,J==1)m[Ae++]=1,m[Ae++]=17,m[Ae++]=0;else for(S=0;S<3;S++)m[Ae++]=S+1,m[Ae++]=S!=0?17:(K&15)<<4|te&15,m[Ae++]=S}if(s[v]==255&&s[v+1]==h){var ze=s[v+2]<<8|s[v+3];for(y=new Uint8Array(ze+2),y[0]=s[v],y[1]=s[v+1],y[2]=s[v+2],y[3]=s[v+3],S=0;S<ze-2;S++)y[S+4]=s[v+S+4]}else{y=new Uint8Array(8+2*J);var Le=0;if(y[Le++]=255,y[Le++]=h,y[Le++]=0,y[Le++]=6+2*J,y[Le++]=J,J==1)y[Le++]=1,y[Le++]=0;else for(S=0;S<3;S++)y[Le++]=S+1,y[Le++]=S<<4|S;y[Le++]=0,y[Le++]=63,y[Le++]=0}return{jpegOffset:l,tables:m,sosMarker:y,sofPosition:X}},a.decode._decodeOldJPEG=function(o,s,l,c,u,d){var f,p,_,h,b,v=a.decode._decodeOldJPEGInit(o,s,l,c);if(v.jpegOffset!=null)for(p=l+c-v.jpegOffset,h=new Uint8Array(p),f=0;f<p;f++)h[f]=s[v.jpegOffset+f];else{for(_=v.tables.length,h=new Uint8Array(_+v.sosMarker.length+c+2),h.set(v.tables),b=_,h[v.sofPosition+5]=o.height>>>8&255,h[v.sofPosition+6]=o.height&255,h[v.sofPosition+7]=o.width>>>8&255,h[v.sofPosition+8]=o.width&255,(s[l]!=255||s[l+1]!=SOS)&&(h.set(v.sosMarker,b),b+=sosMarker.length),f=0;f<c;f++)h[b++]=s[l+f];h[b++]=255,h[b++]=EOI}var m=new a.JpegDecoder;m.parse(h);for(var y=m.getData(m.width,m.height),f=0;f<y.length;f++)u[d+f]=y[f];o.t262&&o.t262[0]==6&&(o.t262[0]=2)},a.decode._decodePackBits=function(o,s,l,c,u){for(var d=new Int8Array(o.buffer),f=new Int8Array(c.buffer),p=s+l;s<p;){var _=d[s];if(s++,_>=0&&_<128)for(var h=0;h<_+1;h++)f[u]=d[s],u++,s++;if(_>=-127&&_<0){for(var h=0;h<-_+1;h++)f[u]=d[s],u++;s++}}},a.decode._decodeThunder=function(o,s,l,c,u){for(var d=[0,1,0,-1],f=[0,1,2,3,0,-3,-2,-1],p=s+l,_=u*2,h=0;s<p;){var b=o[s],v=b>>>6,m=b&63;if(s++,v==3&&(h=m&15,c[_>>>1]|=h<<4*(1-_&1),_++),v==0)for(var y=0;y<m;y++)c[_>>>1]|=h<<4*(1-_&1),_++;if(v==2)for(var y=0;y<2;y++){var g=m>>>3*(1-y)&7;g!=4&&(h+=f[g],c[_>>>1]|=h<<4*(1-_&1),_++)}if(v==1)for(var y=0;y<3;y++){var g=m>>>2*(2-y)&3;g!=2&&(h+=d[g],c[_>>>1]|=h<<4*(1-_&1),_++)}}},a.decode._dmap={1:0,"011":1,"000011":2,"0000011":3,"010":-1,"000010":-2,"0000010":-3},a.decode._lens=function(){var o=function(_,h,b,v){for(var m=0;m<h.length;m++)_[h[m]]=b+m*v},s="00110101,000111,0111,1000,1011,1100,1110,1111,10011,10100,00111,01000,001000,000011,110100,110101,101010,101011,0100111,0001100,0001000,0010111,0000011,0000100,0101000,0101011,0010011,0100100,0011000,00000010,00000011,00011010,00011011,00010010,00010011,00010100,00010101,00010110,00010111,00101000,00101001,00101010,00101011,00101100,00101101,00000100,00000101,00001010,00001011,01010010,01010011,01010100,01010101,00100100,00100101,01011000,01011001,01011010,01011011,01001010,01001011,00110010,00110011,00110100",l="0000110111,010,11,10,011,0011,0010,00011,000101,000100,0000100,0000101,0000111,00000100,00000111,000011000,0000010111,0000011000,0000001000,00001100111,00001101000,00001101100,00000110111,00000101000,00000010111,00000011000,000011001010,000011001011,000011001100,000011001101,000001101000,000001101001,000001101010,000001101011,000011010010,000011010011,000011010100,000011010101,000011010110,000011010111,000001101100,000001101101,000011011010,000011011011,000001010100,000001010101,000001010110,000001010111,000001100100,000001100101,000001010010,000001010011,000000100100,000000110111,000000111000,000000100111,000000101000,000001011000,000001011001,000000101011,000000101100,000001011010,000001100110,000001100111",c="11011,10010,010111,0110111,00110110,00110111,01100100,01100101,01101000,01100111,011001100,011001101,011010010,011010011,011010100,011010101,011010110,011010111,011011000,011011001,011011010,011011011,010011000,010011001,010011010,011000,010011011",u="0000001111,000011001000,000011001001,000001011011,000000110011,000000110100,000000110101,0000001101100,0000001101101,0000001001010,0000001001011,0000001001100,0000001001101,0000001110010,0000001110011,0000001110100,0000001110101,0000001110110,0000001110111,0000001010010,0000001010011,0000001010100,0000001010101,0000001011010,0000001011011,0000001100100,0000001100101",d="00000001000,00000001100,00000001101,000000010010,000000010011,000000010100,000000010101,000000010110,000000010111,000000011100,000000011101,000000011110,000000011111";s=s.split(","),l=l.split(","),c=c.split(","),u=u.split(","),d=d.split(",");var f={},p={};return o(f,s,0,1),o(f,c,64,64),o(f,d,1792,64),o(p,l,0,1),o(p,u,64,64),o(p,d,1792,64),[f,p]}(),a.decode._decodeG4=function(o,s,l,c,u,d,f){for(var p=a.decode,_=s<<3,h=0,b="",v=[],m=[],y=0;y<d;y++)m.push(0);m=p._makeDiff(m);for(var g=0,S=0,M=0,E=0,w=0,x=0,C="",D=0,B=Math.ceil(d/8)*8;_>>>3<s+l;){M=p._findDiff(m,g+(g==0?0:1),1-w),E=p._findDiff(m,M,w);var F=0;if(f==1&&(F=o[_>>>3]>>>7-(_&7)&1),f==2&&(F=o[_>>>3]>>>(_&7)&1),_++,b+=F,C=="H"){if(p._lens[w][b]!=null){var K=p._lens[w][b];b="",h+=K,K<64&&(p._addNtimes(v,h,w),g+=h,w=1-w,h=0,D--,D==0&&(C=""))}}else b=="0001"&&(b="",p._addNtimes(v,E-g,w),g=E),b=="001"&&(b="",C="H",D=2),p._dmap[b]!=null&&(S=M+p._dmap[b],p._addNtimes(v,S-g,w),g=S,b="",w=1-w);v.length==d&&C==""&&(p._writeBits(v,c,u*8+x*B),w=0,x++,g=0,m=p._makeDiff(v),v=[])}},a.decode._findDiff=function(o,s,l){for(var c=0;c<o.length;c+=2)if(o[c]>=s&&o[c+1]==l)return o[c]},a.decode._makeDiff=function(o){var s=[];o[0]==1&&s.push(0,1);for(var l=1;l<o.length;l++)o[l-1]!=o[l]&&s.push(l,o[l]);return s.push(o.length,0,o.length,1),s},a.decode._decodeG3=function(o,s,l,c,u,d,f){for(var p=a.decode,_=s<<3,h=0,b="",v=[],m=[],y=0;y<d;y++)v.push(0);for(var g=0,S=0,M=0,E=0,w=0,x=-1,C="",D=0,B=!1,F=Math.ceil(d/8)*8;_>>>3<s+l;){M=p._findDiff(m,g+(g==0?0:1),1-w),E=p._findDiff(m,M,w);var K=0;if(f==1&&(K=o[_>>>3]>>>7-(_&7)&1),f==2&&(K=o[_>>>3]>>>(_&7)&1),_++,b+=K,B){if(p._lens[w][b]!=null){var te=p._lens[w][b];b="",h+=te,te<64&&(p._addNtimes(v,h,w),w=1-w,h=0)}}else if(C=="H"){if(p._lens[w][b]!=null){var te=p._lens[w][b];b="",h+=te,te<64&&(p._addNtimes(v,h,w),g+=h,w=1-w,h=0,D--,D==0&&(C=""))}}else b=="0001"&&(b="",p._addNtimes(v,E-g,w),g=E),b=="001"&&(b="",C="H",D=2),p._dmap[b]!=null&&(S=M+p._dmap[b],p._addNtimes(v,S-g,w),g=S,b="",w=1-w);b.endsWith("000000000001")&&(x>=0&&p._writeBits(v,c,u*8+x*F),f==1&&(B=(o[_>>>3]>>>7-(_&7)&1)==1),f==2&&(B=(o[_>>>3]>>>(_&7)&1)==1),_++,p._decodeG3.allow2D==null&&(p._decodeG3.allow2D=B),p._decodeG3.allow2D||(B=!0,_--),b="",w=0,x++,g=0,m=p._makeDiff(v),v=[])}v.length==d&&p._writeBits(v,c,u*8+x*F)},a.decode._addNtimes=function(o,s,l){for(var c=0;c<s;c++)o.push(l)},a.decode._writeBits=function(o,s,l){for(var c=0;c<o.length;c++)s[l+c>>>3]|=o[c]<<7-(l+c&7)},a.decode._decodeLZW=function(o,s,l,c){if(a.decode._lzwTab==null){for(var u=new Uint32Array(65535),d=new Uint16Array(65535),b=new Uint8Array(2e6),f=0;f<256;f++)b[f<<2]=f,u[f]=f<<2,d[f]=1;a.decode._lzwTab=[u,d,b]}for(var p=a.decode._copyData,_=a.decode._lzwTab[0],h=a.decode._lzwTab[1],b=a.decode._lzwTab[2],v=258,m=1032,y=9,g=s<<3,S=256,M=257,E=0,w=0,x=0;E=o[g>>>3]<<16|o[g+8>>>3]<<8|o[g+16>>>3],w=E>>24-(g&7)-y&(1<<y)-1,g+=y,w!=M;){if(w==S){if(y=9,v=258,m=1032,E=o[g>>>3]<<16|o[g+8>>>3]<<8|o[g+16>>>3],w=E>>24-(g&7)-y&(1<<y)-1,g+=y,w==M)break;l[c]=w,c++}else if(w<v){var C=_[w],D=h[w];if(p(b,C,l,c,D),c+=D,x>=v)_[v]=m,b[_[v]]=C[0],h[v]=1,m=m+1+3&-4,v++;else{_[v]=m;var B=_[x],F=h[x];p(b,B,b,m,F),b[m+F]=b[C],F++,h[v]=F,v++,m=m+F+3&-4}v+1==1<<y&&y++}else{if(x>=v)_[v]=m,h[v]=0,v++;else{_[v]=m;var B=_[x],F=h[x];p(b,B,b,m,F),b[m+F]=b[m],F++,h[v]=F,v++,p(b,m,l,c,F),c+=F,m=m+F+3&-4}v+1==1<<y&&y++}x=w}},a.decode._copyData=function(o,s,l,c,u){for(var d=0;d<u;d+=4)l[c+d]=o[s+d],l[c+d+1]=o[s+d+1],l[c+d+2]=o[s+d+2],l[c+d+3]=o[s+d+3]},a.tags={},a.ttypes={256:3,257:3,258:3,259:3,262:3,273:4,274:3,277:3,278:4,279:4,282:5,283:5,284:3,286:5,287:5,296:3,305:2,306:2,338:3,513:4,514:4,34665:4},a._readIFD=function(o,s,l,c,u,d){var f=o.readUshort(s,l);l+=2;var p={};c.push(p),d&&n(" ".repeat(u),c.length-1,">>>----------------");for(var _=0;_<f;_++){var h=o.readUshort(s,l);l+=2;var b=o.readUshort(s,l);l+=2;var v=o.readUint(s,l);l+=4;var m=o.readUint(s,l);l+=4;var y=[];if((b==1||b==7)&&(y=new Uint8Array(s.buffer,v<5?l-4:m,v)),b==2){var g=v<5?l-4:m,S=s[g];S<128?y.push(o.readASCII(s,g,v-1)):y=new Uint8Array(s.buffer,g,v-1)}if(b==3)for(var M=0;M<v;M++)y.push(o.readUshort(s,(v<3?l-4:m)+2*M));if(b==4)for(var M=0;M<v;M++)y.push(o.readUint(s,(v<2?l-4:m)+4*M));if(b==5)for(var M=0;M<v;M++)y.push(o.readUint(s,m+M*8)/o.readUint(s,m+M*8+4));if(b==8)for(var M=0;M<v;M++)y.push(o.readShort(s,(v<3?l-4:m)+2*M));if(b==9)for(var M=0;M<v;M++)y.push(o.readInt(s,(v<2?l-4:m)+4*M));if(b==10)for(var M=0;M<v;M++)y.push(o.readInt(s,m+M*8)/o.readInt(s,m+M*8+4));if(b==11)for(var M=0;M<v;M++)y.push(o.readFloat(s,m+M*4));if(b==12)for(var M=0;M<v;M++)y.push(o.readDouble(s,m+M*8));if(p["t"+h]=y,v!=0&&y.length==0&&n("unknown TIFF tag type: ",b,"num:",v),d&&n(" ".repeat(u),h,b,a.tags[h],y),!(h==330&&p.t272&&p.t272[0]=="DSLR-A100")){if(h==330||h==34665||h==50740&&o.readUshort(s,o.readUint(y,0))<300){for(var E=h==50740?[o.readUint(y,0)]:y,w=[],M=0;M<E.length;M++)a._readIFD(o,s,E[M],w,u+1,d);h==330&&(p.subIFD=w),h==34665&&(p.exifIFD=w[0]),h==50740&&(p.dngPrvt=w[0])}}if(h==37500){var x=y;if(o.readASCII(x,0,5)=="Nikon")p.makerNote=a.decode(x.slice(10).buffer)[0];else if(o.readUshort(s,m)<300){var C=[];a._readIFD(o,s,m,C,u+1,d),p.makerNote=C[0]}}}return d&&n(" ".repeat(u),"<<<---------------"),l},a._writeIFD=function(o,s,l,c){var u=Object.keys(c);o.writeUshort(s,l,u.length),l+=2;for(var d=l+u.length*12+4,f=0;f<u.length;f++){var p=u[f],_=parseInt(p.slice(1)),h=a.ttypes[_];if(h==null)throw new Error("unknown type of tag: "+_);var b=c[p];h==2&&(b=b[0]+"\0");var v=b.length;o.writeUshort(s,l,_),l+=2,o.writeUshort(s,l,h),l+=2,o.writeUint(s,l,v),l+=4;var m=[-1,1,1,2,4,8,0,0,0,0,0,0,8][h]*v,y=l;if(m>4&&(o.writeUint(s,l,d),y=d),h==2&&o.writeASCII(s,y,b),h==3)for(var g=0;g<v;g++)o.writeUshort(s,y+2*g,b[g]);if(h==4)for(var g=0;g<v;g++)o.writeUint(s,y+4*g,b[g]);if(h==5)for(var g=0;g<v;g++)o.writeUint(s,y+8*g,Math.round(b[g]*1e4)),o.writeUint(s,y+8*g+4,1e4);if(h==12)for(var g=0;g<v;g++)o.writeDouble(s,y+8*g,b[g]);m>4&&(m+=m&1,d+=m),l+=4}return[l,d]},a.toRGBA8=function(o){var s=o.width,l=o.height,c=s*l,u=c*4,d=o.data,f=new Uint8Array(c*4),p=o.t262?o.t262[0]:2,_=o.t258?Math.min(32,o.t258[0]):1;if(p==0)for(var h=Math.ceil(_*s/8),b=0;b<l;b++){var v=b*h,m=b*s;if(_==1)for(var y=0;y<s;y++){var g=m+y<<2,S=d[v+(y>>3)]>>7-(y&7)&1;f[g]=f[g+1]=f[g+2]=(1-S)*255,f[g+3]=255}if(_==4)for(var y=0;y<s;y++){var g=m+y<<2,S=d[v+(y>>1)]>>4-4*(y&1)&15;f[g]=f[g+1]=f[g+2]=(15-S)*17,f[g+3]=255}if(_==8)for(var y=0;y<s;y++){var g=m+y<<2,S=d[v+y];f[g]=f[g+1]=f[g+2]=255-S,f[g+3]=255}}else if(p==1)for(var h=Math.ceil(_*s/8),b=0;b<l;b++){var v=b*h,m=b*s;if(_==1)for(var y=0;y<s;y++){var g=m+y<<2,S=d[v+(y>>3)]>>7-(y&7)&1;f[g]=f[g+1]=f[g+2]=S*255,f[g+3]=255}if(_==2)for(var y=0;y<s;y++){var g=m+y<<2,S=d[v+(y>>2)]>>6-2*(y&3)&3;f[g]=f[g+1]=f[g+2]=S*85,f[g+3]=255}if(_==8)for(var y=0;y<s;y++){var g=m+y<<2,S=d[v+y];f[g]=f[g+1]=f[g+2]=S,f[g+3]=255}if(_==16)for(var y=0;y<s;y++){var g=m+y<<2,S=d[v+(2*y+1)];f[g]=f[g+1]=f[g+2]=Math.min(255,S),f[g+3]=255}}else if(p==2){var M=o.t258?o.t258.length:3;if(_==8){if(M==4)for(var y=0;y<u;y++)f[y]=d[y];if(M==3)for(var y=0;y<c;y++){var g=y<<2,E=y*3;f[g]=d[E],f[g+1]=d[E+1],f[g+2]=d[E+2],f[g+3]=255}}else{if(M==4)for(var y=0;y<c;y++){var g=y<<2,E=y*8+1;f[g]=d[E],f[g+1]=d[E+2],f[g+2]=d[E+4],f[g+3]=d[E+6]}if(M==3)for(var y=0;y<c;y++){var g=y<<2,E=y*6+1;f[g]=d[E],f[g+1]=d[E+2],f[g+2]=d[E+4],f[g+3]=255}}}else if(p==3)for(var w=o.t320,y=0;y<c;y++){var g=y<<2,x=d[y];f[g]=w[x]>>8,f[g+1]=w[256+x]>>8,f[g+2]=w[512+x]>>8,f[g+3]=255}else if(p==5)for(var M=o.t258?o.t258.length:4,C=M>4?1:0,y=0;y<c;y++){var g=y<<2,D=y*M,B=255-d[D],F=255-d[D+1],K=255-d[D+2],te=(255-d[D+3])*(1/255);f[g]=~~(B*te+.5),f[g+1]=~~(F*te+.5),f[g+2]=~~(K*te+.5),f[g+3]=255*(1-C)+d[D+4]*C}else n("Unknown Photometric interpretation: "+p);return f},a.replaceIMG=function(o){o==null&&(o=document.getElementsByTagName("img"));for(var s=["tif","tiff","dng","cr2","nef"],l=0;l<o.length;l++){var c=o[l],u=c.getAttribute("src");if(u!=null){var d=u.split(".").pop().toLowerCase();if(s.indexOf(d)!=-1){var f=new XMLHttpRequest;a._xhrs.push(f),a._imgs.push(c),f.open("GET",u),f.responseType="arraybuffer",f.onload=a._imgLoaded,f.send()}}}},a._xhrs=[],a._imgs=[],a._imgLoaded=function(o){var s=o.target.response,l=a.decode(s),c=l,u=0,d=c[0];l[0].subIFD&&(c=c.concat(l[0].subIFD));for(var f=0;f<c.length;f++){var m=c[f];if(!(m.t258==null||m.t258.length<3)){var p=m.t256*m.t257;p>u&&(u=p,d=m)}}a.decodeImage(s,d,l);var _=a.toRGBA8(d),h=d.width,b=d.height,v=a._xhrs.indexOf(o.target),m=a._imgs[v];a._xhrs.splice(v,1),a._imgs.splice(v,1);var y=document.createElement("canvas");y.width=h,y.height=b;for(var g=y.getContext("2d"),S=g.createImageData(h,b),f=0;f<_.length;f++)S.data[f]=_[f];g.putImageData(S,0,0),m.setAttribute("src",y.toDataURL())},a._binBE={nextZero:function(o,s){for(;o[s]!=0;)s++;return s},readUshort:function(o,s){return o[s]<<8|o[s+1]},readShort:function(o,s){var l=a._binBE.ui8;return l[0]=o[s+1],l[1]=o[s+0],a._binBE.i16[0]},readInt:function(o,s){var l=a._binBE.ui8;return l[0]=o[s+3],l[1]=o[s+2],l[2]=o[s+1],l[3]=o[s+0],a._binBE.i32[0]},readUint:function(o,s){var l=a._binBE.ui8;return l[0]=o[s+3],l[1]=o[s+2],l[2]=o[s+1],l[3]=o[s+0],a._binBE.ui32[0]},readASCII:function(o,s,l){for(var c="",u=0;u<l;u++)c+=String.fromCharCode(o[s+u]);return c},readFloat:function(o,s){for(var l=a._binBE.ui8,c=0;c<4;c++)l[c]=o[s+3-c];return a._binBE.fl32[0]},readDouble:function(o,s){for(var l=a._binBE.ui8,c=0;c<8;c++)l[c]=o[s+7-c];return a._binBE.fl64[0]},writeUshort:function(o,s,l){o[s]=l>>8&255,o[s+1]=l&255},writeUint:function(o,s,l){o[s]=l>>24&255,o[s+1]=l>>16&255,o[s+2]=l>>8&255,o[s+3]=l>>0&255},writeASCII:function(o,s,l){for(var c=0;c<l.length;c++)o[s+c]=l.charCodeAt(c)},writeDouble:function(o,s,l){a._binBE.fl64[0]=l;for(var c=0;c<8;c++)o[s+c]=a._binBE.ui8[7-c]}},a._binBE.ui8=new Uint8Array(8),a._binBE.i16=new Int16Array(a._binBE.ui8.buffer),a._binBE.i32=new Int32Array(a._binBE.ui8.buffer),a._binBE.ui32=new Uint32Array(a._binBE.ui8.buffer),a._binBE.fl32=new Float32Array(a._binBE.ui8.buffer),a._binBE.fl64=new Float64Array(a._binBE.ui8.buffer),a._binLE={nextZero:a._binBE.nextZero,readUshort:function(o,s){return o[s+1]<<8|o[s]},readShort:function(o,s){var l=a._binBE.ui8;return l[0]=o[s+0],l[1]=o[s+1],a._binBE.i16[0]},readInt:function(o,s){var l=a._binBE.ui8;return l[0]=o[s+0],l[1]=o[s+1],l[2]=o[s+2],l[3]=o[s+3],a._binBE.i32[0]},readUint:function(o,s){var l=a._binBE.ui8;return l[0]=o[s+0],l[1]=o[s+1],l[2]=o[s+2],l[3]=o[s+3],a._binBE.ui32[0]},readASCII:a._binBE.readASCII,readFloat:function(o,s){for(var l=a._binBE.ui8,c=0;c<4;c++)l[c]=o[s+c];return a._binBE.fl32[0]},readDouble:function(o,s){for(var l=a._binBE.ui8,c=0;c<8;c++)l[c]=o[s+c];return a._binBE.fl64[0]}},a._copyTile=function(o,s,l,c,u,d,f,p){for(var _=Math.min(s,u-f),h=Math.min(l,d-p),b=0;b<h;b++)for(var v=(p+b)*u+f,m=b*s,y=0;y<_;y++)c[v+y]=o[m+y]},a.LosslessJpegDecode=function(){function o(u){this.w=u,this.N=0,this._=0,this.G=0}o.prototype={t:function(u){this.N=Math.max(0,Math.min(this.w.length,u))},i:function(){return this.w[this.N++]},l:function(){var u=this.N;return this.N+=2,this.w[u]<<8|this.w[u+1]},J:function(){return this._==0&&(this.G=this.w[this.N],this.N+=1+(this.G+1>>>8),this._=8),this.G>>>--this._&1},Z:function(u){var d=this._,f=this.G,p=Math.min(d,u);u-=p,d-=p;for(var _=f>>>d&(1<<p)-1;u>0;)f=this.w[this.N],this.N+=1+(f+1>>>8),p=Math.min(8,u),u-=p,d=8-p,_<<=p,_|=f>>>d&(1<<p)-1;return this._=d,this.G=f,_}};var s={};s.X=function(){return[0,0,-1]},s.s=function(u,d,f){u[s.Y(u,0,f)+2]=d},s.Y=function(u,d,f){if(u[d+2]!=-1)return 0;if(f==0)return d;for(var p=0;p<2;p++){u[d+p]==0&&(u[d+p]=u.length,u.push(0),u.push(0),u.push(-1));var _=s.Y(u,u[d+p],f-1);if(_!=0)return _}return 0},s.B=function(u,d){for(var f=0,p=0,_=0,h=d._,b=d.G,v=d.N;;)if(h==0&&(b=d.w[v],v+=1+(b+1>>>8),h=8),_=b>>>--h&1,f=u[f+_],p=u[f+2],p!=-1)return d._=h,d.G=b,d.N=v,p;return-1};function l(u){this.z=new o(u),this.D(this.z)}l.prototype={$:function(u,d){this.Q=u.i(),this.F=u.l(),this.o=u.l();var f=this.O=u.i();this.L=[];for(var p=0;p<f;p++){var _=u.i();u.i(),u.i(),this.L[_]=p}u.t(u.N+d-(6+f*3))},e:function(){var u=0,d=this.z.i();this.H==null&&(this.H={});for(var f=this.H[d]=s.X(),p=[],_=0;_<16;_++)p[_]=this.z.i(),u+=p[_];for(var _=0;_<16;_++)for(var h=0;h<p[_];h++)s.s(f,this.z.i(),_+1);return u+17},W:function(u){for(;u>0;)u-=this.e()},p:function(u,d){var f=u.i();this.U||(this.U=[]);for(var p=0;p<f;p++){var _=u.i(),h=u.i();this.U[this.L[_]]=this.H[h>>>4]}this.g=u.i(),u.t(u.N+d-(2+f*2))},D:function(u){var d=!1,f=u.l();if(f===l.q)do{var f=u.l(),p=u.l()-2;switch(f){case l.m:this.$(u,p);break;case l.K:this.W(p);break;case l.V:this.p(u,p),d=!0;break;default:u.t(u.N+p);break}}while(!d)},I:function(u,d){var f=s.B(d,u);if(f==16)return-32768;var p=u.Z(f);return p&1<<f-1||(p-=(1<<f)-1),p},B:function(u,d){for(var f=this.z,p=this.O,_=this.F,h=this.I,b=this.g,v=this.o*p,m=this.U,y=0;y<p;y++)u[y]=h(f,m[y])+(1<<this.Q-1);for(var g=p;g<v;g+=p)for(var y=0;y<p;y++)u[g+y]=h(f,m[y])+u[g+y-p];for(var S=d,M=1;M<_;M++){for(var y=0;y<p;y++)u[S+y]=h(f,m[y])+u[S+y-d];for(var g=p;g<v;g+=p)for(var y=0;y<p;y++){var E=S+g+y,w=u[E-p];b==6&&(w=u[E-d]+(w-u[E-p-d]>>>1)),u[E]=w+h(f,m[y])}S+=d}}},l.m=65475,l.K=65476,l.q=65496,l.V=65498;function c(u){var d=new l(u),f=d.Q>8?Uint16Array:Uint8Array,p=new f(d.o*d.F*d.O),_=d.o*d.O;return d.B(p,_),p}return c}()})(t,r)})()})(p2);var F2=p2.exports;const fO=yn({__proto__:null,default:d2(F2)},[F2]);/*! pako 2.1.0 https://github.com/nodeca/pako @license (MIT AND Zlib) */const dO=4,R2=0,L2=1,pO=2;function ts(e){let t=e.length;for(;--t>=0;)e[t]=0}const hO=0,B2=1,vO=2,mO=3,gO=258,Bd=29,fl=256,dl=fl+1+Bd,rs=30,$d=19,$2=2*dl+1,ho=15,Nd=16,bO=7,Ud=256,N2=16,U2=17,H2=18,Hd=new Uint8Array([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0]),yc=new Uint8Array([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13]),yO=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),j2=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),_O=512,li=new Array((dl+2)*2);ts(li);const pl=new Array(rs*2);ts(pl);const hl=new Array(_O);ts(hl);const vl=new Array(gO-mO+1);ts(vl);const jd=new Array(Bd);ts(jd);const _c=new Array(rs);ts(_c);function Gd(e,t,r,n,a){this.static_tree=e,this.extra_bits=t,this.extra_base=r,this.elems=n,this.max_length=a,this.has_stree=e&&e.length}let G2,V2,q2;function Vd(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}const K2=e=>e<256?hl[e]:hl[256+(e>>>7)],ml=(e,t)=>{e.pending_buf[e.pending++]=t&255,e.pending_buf[e.pending++]=t>>>8&255},xn=(e,t,r)=>{e.bi_valid>Nd-r?(e.bi_buf|=t<<e.bi_valid&65535,ml(e,e.bi_buf),e.bi_buf=t>>Nd-e.bi_valid,e.bi_valid+=r-Nd):(e.bi_buf|=t<<e.bi_valid&65535,e.bi_valid+=r)},Fa=(e,t,r)=>{xn(e,r[t*2],r[t*2+1])},W2=(e,t)=>{let r=0;do r|=e&1,e>>>=1,r<<=1;while(--t>0);return r>>>1},xO=e=>{e.bi_valid===16?(ml(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):e.bi_valid>=8&&(e.pending_buf[e.pending++]=e.bi_buf&255,e.bi_buf>>=8,e.bi_valid-=8)},wO=(e,t)=>{const r=t.dyn_tree,n=t.max_code,a=t.stat_desc.static_tree,i=t.stat_desc.has_stree,o=t.stat_desc.extra_bits,s=t.stat_desc.extra_base,l=t.stat_desc.max_length;let c,u,d,f,p,_,h=0;for(f=0;f<=ho;f++)e.bl_count[f]=0;for(r[e.heap[e.heap_max]*2+1]=0,c=e.heap_max+1;c<$2;c++)u=e.heap[c],f=r[r[u*2+1]*2+1]+1,f>l&&(f=l,h++),r[u*2+1]=f,!(u>n)&&(e.bl_count[f]++,p=0,u>=s&&(p=o[u-s]),_=r[u*2],e.opt_len+=_*(f+p),i&&(e.static_len+=_*(a[u*2+1]+p)));if(h!==0){do{for(f=l-1;e.bl_count[f]===0;)f--;e.bl_count[f]--,e.bl_count[f+1]+=2,e.bl_count[l]--,h-=2}while(h>0);for(f=l;f!==0;f--)for(u=e.bl_count[f];u!==0;)d=e.heap[--c],!(d>n)&&(r[d*2+1]!==f&&(e.opt_len+=(f-r[d*2+1])*r[d*2],r[d*2+1]=f),u--)}},Y2=(e,t,r)=>{const n=new Array(ho+1);let a=0,i,o;for(i=1;i<=ho;i++)a=a+r[i-1]<<1,n[i]=a;for(o=0;o<=t;o++){let s=e[o*2+1];s!==0&&(e[o*2]=W2(n[s]++,s))}},kO=()=>{let e,t,r,n,a;const i=new Array(ho+1);for(r=0,n=0;n<Bd-1;n++)for(jd[n]=r,e=0;e<1<<Hd[n];e++)vl[r++]=n;for(vl[r-1]=n,a=0,n=0;n<16;n++)for(_c[n]=a,e=0;e<1<<yc[n];e++)hl[a++]=n;for(a>>=7;n<rs;n++)for(_c[n]=a<<7,e=0;e<1<<yc[n]-7;e++)hl[256+a++]=n;for(t=0;t<=ho;t++)i[t]=0;for(e=0;e<=143;)li[e*2+1]=8,e++,i[8]++;for(;e<=255;)li[e*2+1]=9,e++,i[9]++;for(;e<=279;)li[e*2+1]=7,e++,i[7]++;for(;e<=287;)li[e*2+1]=8,e++,i[8]++;for(Y2(li,dl+1,i),e=0;e<rs;e++)pl[e*2+1]=5,pl[e*2]=W2(e,5);G2=new Gd(li,Hd,fl+1,dl,ho),V2=new Gd(pl,yc,0,rs,ho),q2=new Gd(new Array(0),yO,0,$d,bO)},X2=e=>{let t;for(t=0;t<dl;t++)e.dyn_ltree[t*2]=0;for(t=0;t<rs;t++)e.dyn_dtree[t*2]=0;for(t=0;t<$d;t++)e.bl_tree[t*2]=0;e.dyn_ltree[Ud*2]=1,e.opt_len=e.static_len=0,e.sym_next=e.matches=0},Z2=e=>{e.bi_valid>8?ml(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0},J2=(e,t,r,n)=>{const a=t*2,i=r*2;return e[a]<e[i]||e[a]===e[i]&&n[t]<=n[r]},qd=(e,t,r)=>{const n=e.heap[r];let a=r<<1;for(;a<=e.heap_len&&(a<e.heap_len&&J2(t,e.heap[a+1],e.heap[a],e.depth)&&a++,!J2(t,n,e.heap[a],e.depth));)e.heap[r]=e.heap[a],r=a,a<<=1;e.heap[r]=n},Q2=(e,t,r)=>{let n,a,i=0,o,s;if(e.sym_next!==0)do n=e.pending_buf[e.sym_buf+i++]&255,n+=(e.pending_buf[e.sym_buf+i++]&255)<<8,a=e.pending_buf[e.sym_buf+i++],n===0?Fa(e,a,t):(o=vl[a],Fa(e,o+fl+1,t),s=Hd[o],s!==0&&(a-=jd[o],xn(e,a,s)),n--,o=K2(n),Fa(e,o,r),s=yc[o],s!==0&&(n-=_c[o],xn(e,n,s)));while(i<e.sym_next);Fa(e,Ud,t)},Kd=(e,t)=>{const r=t.dyn_tree,n=t.stat_desc.static_tree,a=t.stat_desc.has_stree,i=t.stat_desc.elems;let o,s,l=-1,c;for(e.heap_len=0,e.heap_max=$2,o=0;o<i;o++)r[o*2]!==0?(e.heap[++e.heap_len]=l=o,e.depth[o]=0):r[o*2+1]=0;for(;e.heap_len<2;)c=e.heap[++e.heap_len]=l<2?++l:0,r[c*2]=1,e.depth[c]=0,e.opt_len--,a&&(e.static_len-=n[c*2+1]);for(t.max_code=l,o=e.heap_len>>1;o>=1;o--)qd(e,r,o);c=i;do o=e.heap[1],e.heap[1]=e.heap[e.heap_len--],qd(e,r,1),s=e.heap[1],e.heap[--e.heap_max]=o,e.heap[--e.heap_max]=s,r[c*2]=r[o*2]+r[s*2],e.depth[c]=(e.depth[o]>=e.depth[s]?e.depth[o]:e.depth[s])+1,r[o*2+1]=r[s*2+1]=c,e.heap[1]=c++,qd(e,r,1);while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],wO(e,t),Y2(r,l,e.bl_count)},eb=(e,t,r)=>{let n,a=-1,i,o=t[0*2+1],s=0,l=7,c=4;for(o===0&&(l=138,c=3),t[(r+1)*2+1]=65535,n=0;n<=r;n++)i=o,o=t[(n+1)*2+1],!(++s<l&&i===o)&&(s<c?e.bl_tree[i*2]+=s:i!==0?(i!==a&&e.bl_tree[i*2]++,e.bl_tree[N2*2]++):s<=10?e.bl_tree[U2*2]++:e.bl_tree[H2*2]++,s=0,a=i,o===0?(l=138,c=3):i===o?(l=6,c=3):(l=7,c=4))},tb=(e,t,r)=>{let n,a=-1,i,o=t[0*2+1],s=0,l=7,c=4;for(o===0&&(l=138,c=3),n=0;n<=r;n++)if(i=o,o=t[(n+1)*2+1],!(++s<l&&i===o)){if(s<c)do Fa(e,i,e.bl_tree);while(--s!==0);else i!==0?(i!==a&&(Fa(e,i,e.bl_tree),s--),Fa(e,N2,e.bl_tree),xn(e,s-3,2)):s<=10?(Fa(e,U2,e.bl_tree),xn(e,s-3,3)):(Fa(e,H2,e.bl_tree),xn(e,s-11,7));s=0,a=i,o===0?(l=138,c=3):i===o?(l=6,c=3):(l=7,c=4)}},SO=e=>{let t;for(eb(e,e.dyn_ltree,e.l_desc.max_code),eb(e,e.dyn_dtree,e.d_desc.max_code),Kd(e,e.bl_desc),t=$d-1;t>=3&&e.bl_tree[j2[t]*2+1]===0;t--);return e.opt_len+=3*(t+1)+5+5+4,t},CO=(e,t,r,n)=>{let a;for(xn(e,t-257,5),xn(e,r-1,5),xn(e,n-4,4),a=0;a<n;a++)xn(e,e.bl_tree[j2[a]*2+1],3);tb(e,e.dyn_ltree,t-1),tb(e,e.dyn_dtree,r-1)},EO=e=>{let t=4093624447,r;for(r=0;r<=31;r++,t>>>=1)if(t&1&&e.dyn_ltree[r*2]!==0)return R2;if(e.dyn_ltree[9*2]!==0||e.dyn_ltree[10*2]!==0||e.dyn_ltree[13*2]!==0)return L2;for(r=32;r<fl;r++)if(e.dyn_ltree[r*2]!==0)return L2;return R2};let rb=!1;const AO=e=>{rb||(kO(),rb=!0),e.l_desc=new Vd(e.dyn_ltree,G2),e.d_desc=new Vd(e.dyn_dtree,V2),e.bl_desc=new Vd(e.bl_tree,q2),e.bi_buf=0,e.bi_valid=0,X2(e)},nb=(e,t,r,n)=>{xn(e,(hO<<1)+(n?1:0),3),Z2(e),ml(e,r),ml(e,~r),r&&e.pending_buf.set(e.window.subarray(t,t+r),e.pending),e.pending+=r},TO=e=>{xn(e,B2<<1,3),Fa(e,Ud,li),xO(e)},MO=(e,t,r,n)=>{let a,i,o=0;e.level>0?(e.strm.data_type===pO&&(e.strm.data_type=EO(e)),Kd(e,e.l_desc),Kd(e,e.d_desc),o=SO(e),a=e.opt_len+3+7>>>3,i=e.static_len+3+7>>>3,i<=a&&(a=i)):a=i=r+5,r+4<=a&&t!==-1?nb(e,t,r,n):e.strategy===dO||i===a?(xn(e,(B2<<1)+(n?1:0),3),Q2(e,li,pl)):(xn(e,(vO<<1)+(n?1:0),3),CO(e,e.l_desc.max_code+1,e.d_desc.max_code+1,o+1),Q2(e,e.dyn_ltree,e.dyn_dtree)),X2(e),n&&Z2(e)},DO=(e,t,r)=>(e.pending_buf[e.sym_buf+e.sym_next++]=t,e.pending_buf[e.sym_buf+e.sym_next++]=t>>8,e.pending_buf[e.sym_buf+e.sym_next++]=r,t===0?e.dyn_ltree[r*2]++:(e.matches++,t--,e.dyn_ltree[(vl[r]+fl+1)*2]++,e.dyn_dtree[K2(t)*2]++),e.sym_next===e.sym_end);var zO=AO,IO=nb,OO=MO,PO=DO,FO=TO,RO={_tr_init:zO,_tr_stored_block:IO,_tr_flush_block:OO,_tr_tally:PO,_tr_align:FO},gl=(e,t,r,n)=>{let a=e&65535|0,i=e>>>16&65535|0,o=0;for(;r!==0;){o=r>2e3?2e3:r,r-=o;do a=a+t[n++]|0,i=i+a|0;while(--o);a%=65521,i%=65521}return a|i<<16|0};const LO=()=>{let e,t=[];for(var r=0;r<256;r++){e=r;for(var n=0;n<8;n++)e=e&1?3988292384^e>>>1:e>>>1;t[r]=e}return t},BO=new Uint32Array(LO());var Gr=(e,t,r,n)=>{const a=BO,i=n+r;e^=-1;for(let o=n;o<i;o++)e=e>>>8^a[(e^t[o])&255];return e^-1},vo={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},xc={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_UNKNOWN:2,Z_DEFLATED:8};const{_tr_init:$O,_tr_stored_block:Wd,_tr_flush_block:NO,_tr_tally:Bi,_tr_align:UO}=RO,{Z_NO_FLUSH:$i,Z_PARTIAL_FLUSH:HO,Z_FULL_FLUSH:jO,Z_FINISH:Kn,Z_BLOCK:ab,Z_OK:Zr,Z_STREAM_END:ib,Z_STREAM_ERROR:Ra,Z_DATA_ERROR:GO,Z_BUF_ERROR:Yd,Z_DEFAULT_COMPRESSION:VO,Z_FILTERED:qO,Z_HUFFMAN_ONLY:wc,Z_RLE:KO,Z_FIXED:WO,Z_DEFAULT_STRATEGY:YO,Z_UNKNOWN:XO,Z_DEFLATED:kc}=xc,ZO=9,JO=15,QO=8,Xd=256+1+29,eP=30,tP=19,rP=2*Xd+1,nP=15,jt=3,Ni=258,La=Ni+jt+1,aP=32,ns=42,Zd=57,Jd=69,Qd=73,ep=91,tp=103,mo=113,bl=666,mn=1,as=2,go=3,is=4,iP=3,bo=(e,t)=>(e.msg=vo[t],t),ob=e=>e*2-(e>4?9:0),Ui=e=>{let t=e.length;for(;--t>=0;)e[t]=0},oP=e=>{let t,r,n,a=e.w_size;t=e.hash_size,n=t;do r=e.head[--n],e.head[n]=r>=a?r-a:0;while(--t);t=a,n=t;do r=e.prev[--n],e.prev[n]=r>=a?r-a:0;while(--t)};let Hi=(e,t,r)=>(t<<e.hash_shift^r)&e.hash_mask;const Dn=e=>{const t=e.state;let r=t.pending;r>e.avail_out&&(r=e.avail_out),r!==0&&(e.output.set(t.pending_buf.subarray(t.pending_out,t.pending_out+r),e.next_out),e.next_out+=r,t.pending_out+=r,e.total_out+=r,e.avail_out-=r,t.pending-=r,t.pending===0&&(t.pending_out=0))},zn=(e,t)=>{NO(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,Dn(e.strm)},ar=(e,t)=>{e.pending_buf[e.pending++]=t},yl=(e,t)=>{e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=t&255},rp=(e,t,r,n)=>{let a=e.avail_in;return a>n&&(a=n),a===0?0:(e.avail_in-=a,t.set(e.input.subarray(e.next_in,e.next_in+a),r),e.state.wrap===1?e.adler=gl(e.adler,t,a,r):e.state.wrap===2&&(e.adler=Gr(e.adler,t,a,r)),e.next_in+=a,e.total_in+=a,a)},sb=(e,t)=>{let r=e.max_chain_length,n=e.strstart,a,i,o=e.prev_length,s=e.nice_match;const l=e.strstart>e.w_size-La?e.strstart-(e.w_size-La):0,c=e.window,u=e.w_mask,d=e.prev,f=e.strstart+Ni;let p=c[n+o-1],_=c[n+o];e.prev_length>=e.good_match&&(r>>=2),s>e.lookahead&&(s=e.lookahead);do if(a=t,!(c[a+o]!==_||c[a+o-1]!==p||c[a]!==c[n]||c[++a]!==c[n+1])){n+=2,a++;do;while(c[++n]===c[++a]&&c[++n]===c[++a]&&c[++n]===c[++a]&&c[++n]===c[++a]&&c[++n]===c[++a]&&c[++n]===c[++a]&&c[++n]===c[++a]&&c[++n]===c[++a]&&n<f);if(i=Ni-(f-n),n=f-Ni,i>o){if(e.match_start=t,o=i,i>=s)break;p=c[n+o-1],_=c[n+o]}}while((t=d[t&u])>l&&--r!==0);return o<=e.lookahead?o:e.lookahead},os=e=>{const t=e.w_size;let r,n,a;do{if(n=e.window_size-e.lookahead-e.strstart,e.strstart>=t+(t-La)&&(e.window.set(e.window.subarray(t,t+t-n),0),e.match_start-=t,e.strstart-=t,e.block_start-=t,e.insert>e.strstart&&(e.insert=e.strstart),oP(e),n+=t),e.strm.avail_in===0)break;if(r=rp(e.strm,e.window,e.strstart+e.lookahead,n),e.lookahead+=r,e.lookahead+e.insert>=jt)for(a=e.strstart-e.insert,e.ins_h=e.window[a],e.ins_h=Hi(e,e.ins_h,e.window[a+1]);e.insert&&(e.ins_h=Hi(e,e.ins_h,e.window[a+jt-1]),e.prev[a&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=a,a++,e.insert--,!(e.lookahead+e.insert<jt)););}while(e.lookahead<La&&e.strm.avail_in!==0)},lb=(e,t)=>{let r=e.pending_buf_size-5>e.w_size?e.w_size:e.pending_buf_size-5,n,a,i,o=0,s=e.strm.avail_in;do{if(n=65535,i=e.bi_valid+42>>3,e.strm.avail_out<i||(i=e.strm.avail_out-i,a=e.strstart-e.block_start,n>a+e.strm.avail_in&&(n=a+e.strm.avail_in),n>i&&(n=i),n<r&&(n===0&&t!==Kn||t===$i||n!==a+e.strm.avail_in)))break;o=t===Kn&&n===a+e.strm.avail_in?1:0,Wd(e,0,0,o),e.pending_buf[e.pending-4]=n,e.pending_buf[e.pending-3]=n>>8,e.pending_buf[e.pending-2]=~n,e.pending_buf[e.pending-1]=~n>>8,Dn(e.strm),a&&(a>n&&(a=n),e.strm.output.set(e.window.subarray(e.block_start,e.block_start+a),e.strm.next_out),e.strm.next_out+=a,e.strm.avail_out-=a,e.strm.total_out+=a,e.block_start+=a,n-=a),n&&(rp(e.strm,e.strm.output,e.strm.next_out,n),e.strm.next_out+=n,e.strm.avail_out-=n,e.strm.total_out+=n)}while(o===0);return s-=e.strm.avail_in,s&&(s>=e.w_size?(e.matches=2,e.window.set(e.strm.input.subarray(e.strm.next_in-e.w_size,e.strm.next_in),0),e.strstart=e.w_size,e.insert=e.strstart):(e.window_size-e.strstart<=s&&(e.strstart-=e.w_size,e.window.set(e.window.subarray(e.w_size,e.w_size+e.strstart),0),e.matches<2&&e.matches++,e.insert>e.strstart&&(e.insert=e.strstart)),e.window.set(e.strm.input.subarray(e.strm.next_in-s,e.strm.next_in),e.strstart),e.strstart+=s,e.insert+=s>e.w_size-e.insert?e.w_size-e.insert:s),e.block_start=e.strstart),e.high_water<e.strstart&&(e.high_water=e.strstart),o?is:t!==$i&&t!==Kn&&e.strm.avail_in===0&&e.strstart===e.block_start?as:(i=e.window_size-e.strstart,e.strm.avail_in>i&&e.block_start>=e.w_size&&(e.block_start-=e.w_size,e.strstart-=e.w_size,e.window.set(e.window.subarray(e.w_size,e.w_size+e.strstart),0),e.matches<2&&e.matches++,i+=e.w_size,e.insert>e.strstart&&(e.insert=e.strstart)),i>e.strm.avail_in&&(i=e.strm.avail_in),i&&(rp(e.strm,e.window,e.strstart,i),e.strstart+=i,e.insert+=i>e.w_size-e.insert?e.w_size-e.insert:i),e.high_water<e.strstart&&(e.high_water=e.strstart),i=e.bi_valid+42>>3,i=e.pending_buf_size-i>65535?65535:e.pending_buf_size-i,r=i>e.w_size?e.w_size:i,a=e.strstart-e.block_start,(a>=r||(a||t===Kn)&&t!==$i&&e.strm.avail_in===0&&a<=i)&&(n=a>i?i:a,o=t===Kn&&e.strm.avail_in===0&&n===a?1:0,Wd(e,e.block_start,n,o),e.block_start+=n,Dn(e.strm)),o?go:mn)},np=(e,t)=>{let r,n;for(;;){if(e.lookahead<La){if(os(e),e.lookahead<La&&t===$i)return mn;if(e.lookahead===0)break}if(r=0,e.lookahead>=jt&&(e.ins_h=Hi(e,e.ins_h,e.window[e.strstart+jt-1]),r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),r!==0&&e.strstart-r<=e.w_size-La&&(e.match_length=sb(e,r)),e.match_length>=jt)if(n=Bi(e,e.strstart-e.match_start,e.match_length-jt),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=jt){e.match_length--;do e.strstart++,e.ins_h=Hi(e,e.ins_h,e.window[e.strstart+jt-1]),r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart;while(--e.match_length!==0);e.strstart++}else e.strstart+=e.match_length,e.match_length=0,e.ins_h=e.window[e.strstart],e.ins_h=Hi(e,e.ins_h,e.window[e.strstart+1]);else n=Bi(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++;if(n&&(zn(e,!1),e.strm.avail_out===0))return mn}return e.insert=e.strstart<jt-1?e.strstart:jt-1,t===Kn?(zn(e,!0),e.strm.avail_out===0?go:is):e.sym_next&&(zn(e,!1),e.strm.avail_out===0)?mn:as},ss=(e,t)=>{let r,n,a;for(;;){if(e.lookahead<La){if(os(e),e.lookahead<La&&t===$i)return mn;if(e.lookahead===0)break}if(r=0,e.lookahead>=jt&&(e.ins_h=Hi(e,e.ins_h,e.window[e.strstart+jt-1]),r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),e.prev_length=e.match_length,e.prev_match=e.match_start,e.match_length=jt-1,r!==0&&e.prev_length<e.max_lazy_match&&e.strstart-r<=e.w_size-La&&(e.match_length=sb(e,r),e.match_length<=5&&(e.strategy===qO||e.match_length===jt&&e.strstart-e.match_start>4096)&&(e.match_length=jt-1)),e.prev_length>=jt&&e.match_length<=e.prev_length){a=e.strstart+e.lookahead-jt,n=Bi(e,e.strstart-1-e.prev_match,e.prev_length-jt),e.lookahead-=e.prev_length-1,e.prev_length-=2;do++e.strstart<=a&&(e.ins_h=Hi(e,e.ins_h,e.window[e.strstart+jt-1]),r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart);while(--e.prev_length!==0);if(e.match_available=0,e.match_length=jt-1,e.strstart++,n&&(zn(e,!1),e.strm.avail_out===0))return mn}else if(e.match_available){if(n=Bi(e,0,e.window[e.strstart-1]),n&&zn(e,!1),e.strstart++,e.lookahead--,e.strm.avail_out===0)return mn}else e.match_available=1,e.strstart++,e.lookahead--}return e.match_available&&(n=Bi(e,0,e.window[e.strstart-1]),e.match_available=0),e.insert=e.strstart<jt-1?e.strstart:jt-1,t===Kn?(zn(e,!0),e.strm.avail_out===0?go:is):e.sym_next&&(zn(e,!1),e.strm.avail_out===0)?mn:as},sP=(e,t)=>{let r,n,a,i;const o=e.window;for(;;){if(e.lookahead<=Ni){if(os(e),e.lookahead<=Ni&&t===$i)return mn;if(e.lookahead===0)break}if(e.match_length=0,e.lookahead>=jt&&e.strstart>0&&(a=e.strstart-1,n=o[a],n===o[++a]&&n===o[++a]&&n===o[++a])){i=e.strstart+Ni;do;while(n===o[++a]&&n===o[++a]&&n===o[++a]&&n===o[++a]&&n===o[++a]&&n===o[++a]&&n===o[++a]&&n===o[++a]&&a<i);e.match_length=Ni-(i-a),e.match_length>e.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=jt?(r=Bi(e,1,e.match_length-jt),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(r=Bi(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),r&&(zn(e,!1),e.strm.avail_out===0))return mn}return e.insert=0,t===Kn?(zn(e,!0),e.strm.avail_out===0?go:is):e.sym_next&&(zn(e,!1),e.strm.avail_out===0)?mn:as},lP=(e,t)=>{let r;for(;;){if(e.lookahead===0&&(os(e),e.lookahead===0)){if(t===$i)return mn;break}if(e.match_length=0,r=Bi(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,r&&(zn(e,!1),e.strm.avail_out===0))return mn}return e.insert=0,t===Kn?(zn(e,!0),e.strm.avail_out===0?go:is):e.sym_next&&(zn(e,!1),e.strm.avail_out===0)?mn:as};function Ba(e,t,r,n,a){this.good_length=e,this.max_lazy=t,this.nice_length=r,this.max_chain=n,this.func=a}const _l=[new Ba(0,0,0,0,lb),new Ba(4,4,8,4,np),new Ba(4,5,16,8,np),new Ba(4,6,32,32,np),new Ba(4,4,16,16,ss),new Ba(8,16,32,32,ss),new Ba(8,16,128,128,ss),new Ba(8,32,128,256,ss),new Ba(32,128,258,1024,ss),new Ba(32,258,258,4096,ss)],cP=e=>{e.window_size=2*e.w_size,Ui(e.head),e.max_lazy_match=_l[e.level].max_lazy,e.good_match=_l[e.level].good_length,e.nice_match=_l[e.level].nice_length,e.max_chain_length=_l[e.level].max_chain,e.strstart=0,e.block_start=0,e.lookahead=0,e.insert=0,e.match_length=e.prev_length=jt-1,e.match_available=0,e.ins_h=0};function uP(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=kc,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Uint16Array(rP*2),this.dyn_dtree=new Uint16Array((2*eP+1)*2),this.bl_tree=new Uint16Array((2*tP+1)*2),Ui(this.dyn_ltree),Ui(this.dyn_dtree),Ui(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(nP+1),this.heap=new Uint16Array(2*Xd+1),Ui(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(2*Xd+1),Ui(this.depth),this.sym_buf=0,this.lit_bufsize=0,this.sym_next=0,this.sym_end=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}const xl=e=>{if(!e)return 1;const t=e.state;return!t||t.strm!==e||t.status!==ns&&t.status!==Zd&&t.status!==Jd&&t.status!==Qd&&t.status!==ep&&t.status!==tp&&t.status!==mo&&t.status!==bl?1:0},cb=e=>{if(xl(e))return bo(e,Ra);e.total_in=e.total_out=0,e.data_type=XO;const t=e.state;return t.pending=0,t.pending_out=0,t.wrap<0&&(t.wrap=-t.wrap),t.status=t.wrap===2?Zd:t.wrap?ns:mo,e.adler=t.wrap===2?0:1,t.last_flush=-2,$O(t),Zr},ub=e=>{const t=cb(e);return t===Zr&&cP(e.state),t},fP=(e,t)=>xl(e)||e.state.wrap!==2?Ra:(e.state.gzhead=t,Zr),fb=(e,t,r,n,a,i)=>{if(!e)return Ra;let o=1;if(t===VO&&(t=6),n<0?(o=0,n=-n):n>15&&(o=2,n-=16),a<1||a>ZO||r!==kc||n<8||n>15||t<0||t>9||i<0||i>WO||n===8&&o!==1)return bo(e,Ra);n===8&&(n=9);const s=new uP;return e.state=s,s.strm=e,s.status=ns,s.wrap=o,s.gzhead=null,s.w_bits=n,s.w_size=1<<s.w_bits,s.w_mask=s.w_size-1,s.hash_bits=a+7,s.hash_size=1<<s.hash_bits,s.hash_mask=s.hash_size-1,s.hash_shift=~~((s.hash_bits+jt-1)/jt),s.window=new Uint8Array(s.w_size*2),s.head=new Uint16Array(s.hash_size),s.prev=new Uint16Array(s.w_size),s.lit_bufsize=1<<a+6,s.pending_buf_size=s.lit_bufsize*4,s.pending_buf=new Uint8Array(s.pending_buf_size),s.sym_buf=s.lit_bufsize,s.sym_end=(s.lit_bufsize-1)*3,s.level=t,s.strategy=i,s.method=r,ub(e)},dP=(e,t)=>fb(e,t,kc,JO,QO,YO),pP=(e,t)=>{if(xl(e)||t>ab||t<0)return e?bo(e,Ra):Ra;const r=e.state;if(!e.output||e.avail_in!==0&&!e.input||r.status===bl&&t!==Kn)return bo(e,e.avail_out===0?Yd:Ra);const n=r.last_flush;if(r.last_flush=t,r.pending!==0){if(Dn(e),e.avail_out===0)return r.last_flush=-1,Zr}else if(e.avail_in===0&&ob(t)<=ob(n)&&t!==Kn)return bo(e,Yd);if(r.status===bl&&e.avail_in!==0)return bo(e,Yd);if(r.status===ns&&r.wrap===0&&(r.status=mo),r.status===ns){let a=kc+(r.w_bits-8<<4)<<8,i=-1;if(r.strategy>=wc||r.level<2?i=0:r.level<6?i=1:r.level===6?i=2:i=3,a|=i<<6,r.strstart!==0&&(a|=aP),a+=31-a%31,yl(r,a),r.strstart!==0&&(yl(r,e.adler>>>16),yl(r,e.adler&65535)),e.adler=1,r.status=mo,Dn(e),r.pending!==0)return r.last_flush=-1,Zr}if(r.status===Zd){if(e.adler=0,ar(r,31),ar(r,139),ar(r,8),r.gzhead)ar(r,(r.gzhead.text?1:0)+(r.gzhead.hcrc?2:0)+(r.gzhead.extra?4:0)+(r.gzhead.name?8:0)+(r.gzhead.comment?16:0)),ar(r,r.gzhead.time&255),ar(r,r.gzhead.time>>8&255),ar(r,r.gzhead.time>>16&255),ar(r,r.gzhead.time>>24&255),ar(r,r.level===9?2:r.strategy>=wc||r.level<2?4:0),ar(r,r.gzhead.os&255),r.gzhead.extra&&r.gzhead.extra.length&&(ar(r,r.gzhead.extra.length&255),ar(r,r.gzhead.extra.length>>8&255)),r.gzhead.hcrc&&(e.adler=Gr(e.adler,r.pending_buf,r.pending,0)),r.gzindex=0,r.status=Jd;else if(ar(r,0),ar(r,0),ar(r,0),ar(r,0),ar(r,0),ar(r,r.level===9?2:r.strategy>=wc||r.level<2?4:0),ar(r,iP),r.status=mo,Dn(e),r.pending!==0)return r.last_flush=-1,Zr}if(r.status===Jd){if(r.gzhead.extra){let a=r.pending,i=(r.gzhead.extra.length&65535)-r.gzindex;for(;r.pending+i>r.pending_buf_size;){let s=r.pending_buf_size-r.pending;if(r.pending_buf.set(r.gzhead.extra.subarray(r.gzindex,r.gzindex+s),r.pending),r.pending=r.pending_buf_size,r.gzhead.hcrc&&r.pending>a&&(e.adler=Gr(e.adler,r.pending_buf,r.pending-a,a)),r.gzindex+=s,Dn(e),r.pending!==0)return r.last_flush=-1,Zr;a=0,i-=s}let o=new Uint8Array(r.gzhead.extra);r.pending_buf.set(o.subarray(r.gzindex,r.gzindex+i),r.pending),r.pending+=i,r.gzhead.hcrc&&r.pending>a&&(e.adler=Gr(e.adler,r.pending_buf,r.pending-a,a)),r.gzindex=0}r.status=Qd}if(r.status===Qd){if(r.gzhead.name){let a=r.pending,i;do{if(r.pending===r.pending_buf_size){if(r.gzhead.hcrc&&r.pending>a&&(e.adler=Gr(e.adler,r.pending_buf,r.pending-a,a)),Dn(e),r.pending!==0)return r.last_flush=-1,Zr;a=0}r.gzindex<r.gzhead.name.length?i=r.gzhead.name.charCodeAt(r.gzindex++)&255:i=0,ar(r,i)}while(i!==0);r.gzhead.hcrc&&r.pending>a&&(e.adler=Gr(e.adler,r.pending_buf,r.pending-a,a)),r.gzindex=0}r.status=ep}if(r.status===ep){if(r.gzhead.comment){let a=r.pending,i;do{if(r.pending===r.pending_buf_size){if(r.gzhead.hcrc&&r.pending>a&&(e.adler=Gr(e.adler,r.pending_buf,r.pending-a,a)),Dn(e),r.pending!==0)return r.last_flush=-1,Zr;a=0}r.gzindex<r.gzhead.comment.length?i=r.gzhead.comment.charCodeAt(r.gzindex++)&255:i=0,ar(r,i)}while(i!==0);r.gzhead.hcrc&&r.pending>a&&(e.adler=Gr(e.adler,r.pending_buf,r.pending-a,a))}r.status=tp}if(r.status===tp){if(r.gzhead.hcrc){if(r.pending+2>r.pending_buf_size&&(Dn(e),r.pending!==0))return r.last_flush=-1,Zr;ar(r,e.adler&255),ar(r,e.adler>>8&255),e.adler=0}if(r.status=mo,Dn(e),r.pending!==0)return r.last_flush=-1,Zr}if(e.avail_in!==0||r.lookahead!==0||t!==$i&&r.status!==bl){let a=r.level===0?lb(r,t):r.strategy===wc?lP(r,t):r.strategy===KO?sP(r,t):_l[r.level].func(r,t);if((a===go||a===is)&&(r.status=bl),a===mn||a===go)return e.avail_out===0&&(r.last_flush=-1),Zr;if(a===as&&(t===HO?UO(r):t!==ab&&(Wd(r,0,0,!1),t===jO&&(Ui(r.head),r.lookahead===0&&(r.strstart=0,r.block_start=0,r.insert=0))),Dn(e),e.avail_out===0))return r.last_flush=-1,Zr}return t!==Kn?Zr:r.wrap<=0?ib:(r.wrap===2?(ar(r,e.adler&255),ar(r,e.adler>>8&255),ar(r,e.adler>>16&255),ar(r,e.adler>>24&255),ar(r,e.total_in&255),ar(r,e.total_in>>8&255),ar(r,e.total_in>>16&255),ar(r,e.total_in>>24&255)):(yl(r,e.adler>>>16),yl(r,e.adler&65535)),Dn(e),r.wrap>0&&(r.wrap=-r.wrap),r.pending!==0?Zr:ib)},hP=e=>{if(xl(e))return Ra;const t=e.state.status;return e.state=null,t===mo?bo(e,GO):Zr},vP=(e,t)=>{let r=t.length;if(xl(e))return Ra;const n=e.state,a=n.wrap;if(a===2||a===1&&n.status!==ns||n.lookahead)return Ra;if(a===1&&(e.adler=gl(e.adler,t,r,0)),n.wrap=0,r>=n.w_size){a===0&&(Ui(n.head),n.strstart=0,n.block_start=0,n.insert=0);let l=new Uint8Array(n.w_size);l.set(t.subarray(r-n.w_size,r),0),t=l,r=n.w_size}const i=e.avail_in,o=e.next_in,s=e.input;for(e.avail_in=r,e.next_in=0,e.input=t,os(n);n.lookahead>=jt;){let l=n.strstart,c=n.lookahead-(jt-1);do n.ins_h=Hi(n,n.ins_h,n.window[l+jt-1]),n.prev[l&n.w_mask]=n.head[n.ins_h],n.head[n.ins_h]=l,l++;while(--c);n.strstart=l,n.lookahead=jt-1,os(n)}return n.strstart+=n.lookahead,n.block_start=n.strstart,n.insert=n.lookahead,n.lookahead=0,n.match_length=n.prev_length=jt-1,n.match_available=0,e.next_in=o,e.input=s,e.avail_in=i,n.wrap=a,Zr};var mP=dP,gP=fb,bP=ub,yP=cb,_P=fP,xP=pP,wP=hP,kP=vP,SP="pako deflate (from Nodeca project)",wl={deflateInit:mP,deflateInit2:gP,deflateReset:bP,deflateResetKeep:yP,deflateSetHeader:_P,deflate:xP,deflateEnd:wP,deflateSetDictionary:kP,deflateInfo:SP};const CP=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var EP=function(e){const t=Array.prototype.slice.call(arguments,1);for(;t.length;){const r=t.shift();if(r){if(typeof r!="object")throw new TypeError(r+"must be non-object");for(const n in r)CP(r,n)&&(e[n]=r[n])}}return e},AP=e=>{let t=0;for(let n=0,a=e.length;n<a;n++)t+=e[n].length;const r=new Uint8Array(t);for(let n=0,a=0,i=e.length;n<i;n++){let o=e[n];r.set(o,a),a+=o.length}return r},Sc={assign:EP,flattenChunks:AP};let db=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{db=!1}const kl=new Uint8Array(256);for(let e=0;e<256;e++)kl[e]=e>=252?6:e>=248?5:e>=240?4:e>=224?3:e>=192?2:1;kl[254]=kl[254]=1;var TP=e=>{if(typeof TextEncoder=="function"&&TextEncoder.prototype.encode)return new TextEncoder().encode(e);let t,r,n,a,i,o=e.length,s=0;for(a=0;a<o;a++)r=e.charCodeAt(a),(r&64512)===55296&&a+1<o&&(n=e.charCodeAt(a+1),(n&64512)===56320&&(r=65536+(r-55296<<10)+(n-56320),a++)),s+=r<128?1:r<2048?2:r<65536?3:4;for(t=new Uint8Array(s),i=0,a=0;i<s;a++)r=e.charCodeAt(a),(r&64512)===55296&&a+1<o&&(n=e.charCodeAt(a+1),(n&64512)===56320&&(r=65536+(r-55296<<10)+(n-56320),a++)),r<128?t[i++]=r:r<2048?(t[i++]=192|r>>>6,t[i++]=128|r&63):r<65536?(t[i++]=224|r>>>12,t[i++]=128|r>>>6&63,t[i++]=128|r&63):(t[i++]=240|r>>>18,t[i++]=128|r>>>12&63,t[i++]=128|r>>>6&63,t[i++]=128|r&63);return t};const MP=(e,t)=>{if(t<65534&&e.subarray&&db)return String.fromCharCode.apply(null,e.length===t?e:e.subarray(0,t));let r="";for(let n=0;n<t;n++)r+=String.fromCharCode(e[n]);return r};var DP=(e,t)=>{const r=t||e.length;if(typeof TextDecoder=="function"&&TextDecoder.prototype.decode)return new TextDecoder().decode(e.subarray(0,t));let n,a;const i=new Array(r*2);for(a=0,n=0;n<r;){let o=e[n++];if(o<128){i[a++]=o;continue}let s=kl[o];if(s>4){i[a++]=65533,n+=s-1;continue}for(o&=s===2?31:s===3?15:7;s>1&&n<r;)o=o<<6|e[n++]&63,s--;if(s>1){i[a++]=65533;continue}o<65536?i[a++]=o:(o-=65536,i[a++]=55296|o>>10&1023,i[a++]=56320|o&1023)}return MP(i,a)},zP=(e,t)=>{t=t||e.length,t>e.length&&(t=e.length);let r=t-1;for(;r>=0&&(e[r]&192)===128;)r--;return r<0||r===0?t:r+kl[e[r]]>t?r:t},Sl={string2buf:TP,buf2string:DP,utf8border:zP};function IP(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}var pb=IP;const hb=Object.prototype.toString,{Z_NO_FLUSH:OP,Z_SYNC_FLUSH:PP,Z_FULL_FLUSH:FP,Z_FINISH:RP,Z_OK:Cc,Z_STREAM_END:LP,Z_DEFAULT_COMPRESSION:BP,Z_DEFAULT_STRATEGY:$P,Z_DEFLATED:NP}=xc;function Ec(e){this.options=Sc.assign({level:BP,method:NP,chunkSize:16384,windowBits:15,memLevel:8,strategy:$P},e||{});let t=this.options;t.raw&&t.windowBits>0?t.windowBits=-t.windowBits:t.gzip&&t.windowBits>0&&t.windowBits<16&&(t.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new pb,this.strm.avail_out=0;let r=wl.deflateInit2(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy);if(r!==Cc)throw new Error(vo[r]);if(t.header&&wl.deflateSetHeader(this.strm,t.header),t.dictionary){let n;if(typeof t.dictionary=="string"?n=Sl.string2buf(t.dictionary):hb.call(t.dictionary)==="[object ArrayBuffer]"?n=new Uint8Array(t.dictionary):n=t.dictionary,r=wl.deflateSetDictionary(this.strm,n),r!==Cc)throw new Error(vo[r]);this._dict_set=!0}}Ec.prototype.push=function(e,t){const r=this.strm,n=this.options.chunkSize;let a,i;if(this.ended)return!1;for(t===~~t?i=t:i=t===!0?RP:OP,typeof e=="string"?r.input=Sl.string2buf(e):hb.call(e)==="[object ArrayBuffer]"?r.input=new Uint8Array(e):r.input=e,r.next_in=0,r.avail_in=r.input.length;;){if(r.avail_out===0&&(r.output=new Uint8Array(n),r.next_out=0,r.avail_out=n),(i===PP||i===FP)&&r.avail_out<=6){this.onData(r.output.subarray(0,r.next_out)),r.avail_out=0;continue}if(a=wl.deflate(r,i),a===LP)return r.next_out>0&&this.onData(r.output.subarray(0,r.next_out)),a=wl.deflateEnd(this.strm),this.onEnd(a),this.ended=!0,a===Cc;if(r.avail_out===0){this.onData(r.output);continue}if(i>0&&r.next_out>0){this.onData(r.output.subarray(0,r.next_out)),r.avail_out=0;continue}if(r.avail_in===0)break}return!0},Ec.prototype.onData=function(e){this.chunks.push(e)},Ec.prototype.onEnd=function(e){e===Cc&&(this.result=Sc.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};function UP(e,t){const r=new Ec(t);if(r.push(e,!0),r.err)throw r.msg||vo[r.err];return r.result}var HP=UP,jP={deflate:HP};const Ac=16209,GP=16191;var VP=function(t,r){let n,a,i,o,s,l,c,u,d,f,p,_,h,b,v,m,y,g,S,M,E,w,x,C;const D=t.state;n=t.next_in,x=t.input,a=n+(t.avail_in-5),i=t.next_out,C=t.output,o=i-(r-t.avail_out),s=i+(t.avail_out-257),l=D.dmax,c=D.wsize,u=D.whave,d=D.wnext,f=D.window,p=D.hold,_=D.bits,h=D.lencode,b=D.distcode,v=(1<<D.lenbits)-1,m=(1<<D.distbits)-1;e:do{_<15&&(p+=x[n++]<<_,_+=8,p+=x[n++]<<_,_+=8),y=h[p&v];t:for(;;){if(g=y>>>24,p>>>=g,_-=g,g=y>>>16&255,g===0)C[i++]=y&65535;else if(g&16){S=y&65535,g&=15,g&&(_<g&&(p+=x[n++]<<_,_+=8),S+=p&(1<<g)-1,p>>>=g,_-=g),_<15&&(p+=x[n++]<<_,_+=8,p+=x[n++]<<_,_+=8),y=b[p&m];r:for(;;){if(g=y>>>24,p>>>=g,_-=g,g=y>>>16&255,g&16){if(M=y&65535,g&=15,_<g&&(p+=x[n++]<<_,_+=8,_<g&&(p+=x[n++]<<_,_+=8)),M+=p&(1<<g)-1,M>l){t.msg="invalid distance too far back",D.mode=Ac;break e}if(p>>>=g,_-=g,g=i-o,M>g){if(g=M-g,g>u&&D.sane){t.msg="invalid distance too far back",D.mode=Ac;break e}if(E=0,w=f,d===0){if(E+=c-g,g<S){S-=g;do C[i++]=f[E++];while(--g);E=i-M,w=C}}else if(d<g){if(E+=c+d-g,g-=d,g<S){S-=g;do C[i++]=f[E++];while(--g);if(E=0,d<S){g=d,S-=g;do C[i++]=f[E++];while(--g);E=i-M,w=C}}}else if(E+=d-g,g<S){S-=g;do C[i++]=f[E++];while(--g);E=i-M,w=C}for(;S>2;)C[i++]=w[E++],C[i++]=w[E++],C[i++]=w[E++],S-=3;S&&(C[i++]=w[E++],S>1&&(C[i++]=w[E++]))}else{E=i-M;do C[i++]=C[E++],C[i++]=C[E++],C[i++]=C[E++],S-=3;while(S>2);S&&(C[i++]=C[E++],S>1&&(C[i++]=C[E++]))}}else if(g&64){t.msg="invalid distance code",D.mode=Ac;break e}else{y=b[(y&65535)+(p&(1<<g)-1)];continue r}break}}else if(g&64)if(g&32){D.mode=GP;break e}else{t.msg="invalid literal/length code",D.mode=Ac;break e}else{y=h[(y&65535)+(p&(1<<g)-1)];continue t}break}}while(n<a&&i<s);S=_>>3,n-=S,_-=S<<3,p&=(1<<_)-1,t.next_in=n,t.next_out=i,t.avail_in=n<a?5+(a-n):5-(n-a),t.avail_out=i<s?257+(s-i):257-(i-s),D.hold=p,D.bits=_};const ls=15,vb=852,mb=592,gb=0,ap=1,bb=2,qP=new Uint16Array([3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0]),KP=new Uint8Array([16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78]),WP=new Uint16Array([1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0]),YP=new Uint8Array([16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64]);var Cl=(e,t,r,n,a,i,o,s)=>{const l=s.bits;let c=0,u=0,d=0,f=0,p=0,_=0,h=0,b=0,v=0,m=0,y,g,S,M,E,w=null,x;const C=new Uint16Array(ls+1),D=new Uint16Array(ls+1);let B=null,F,K,te;for(c=0;c<=ls;c++)C[c]=0;for(u=0;u<n;u++)C[t[r+u]]++;for(p=l,f=ls;f>=1&&C[f]===0;f--);if(p>f&&(p=f),f===0)return a[i++]=1<<24|64<<16|0,a[i++]=1<<24|64<<16|0,s.bits=1,0;for(d=1;d<f&&C[d]===0;d++);for(p<d&&(p=d),b=1,c=1;c<=ls;c++)if(b<<=1,b-=C[c],b<0)return-1;if(b>0&&(e===gb||f!==1))return-1;for(D[1]=0,c=1;c<ls;c++)D[c+1]=D[c]+C[c];for(u=0;u<n;u++)t[r+u]!==0&&(o[D[t[r+u]]++]=u);if(e===gb?(w=B=o,x=20):e===ap?(w=qP,B=KP,x=257):(w=WP,B=YP,x=0),m=0,u=0,c=d,E=i,_=p,h=0,S=-1,v=1<<p,M=v-1,e===ap&&v>vb||e===bb&&v>mb)return 1;for(;;){F=c-h,o[u]+1<x?(K=0,te=o[u]):o[u]>=x?(K=B[o[u]-x],te=w[o[u]-x]):(K=96,te=0),y=1<<c-h,g=1<<_,d=g;do g-=y,a[E+(m>>h)+g]=F<<24|K<<16|te|0;while(g!==0);for(y=1<<c-1;m&y;)y>>=1;if(y!==0?(m&=y-1,m+=y):m=0,u++,--C[c]===0){if(c===f)break;c=t[r+o[u]]}if(c>p&&(m&M)!==S){for(h===0&&(h=p),E+=d,_=c-h,b=1<<_;_+h<f&&(b-=C[_+h],!(b<=0));)_++,b<<=1;if(v+=1<<_,e===ap&&v>vb||e===bb&&v>mb)return 1;S=m&M,a[S]=p<<24|_<<16|E-i|0}}return m!==0&&(a[E+m]=c-h<<24|64<<16|0),s.bits=p,0};const XP=0,yb=1,_b=2,{Z_FINISH:xb,Z_BLOCK:ZP,Z_TREES:Tc,Z_OK:yo,Z_STREAM_END:JP,Z_NEED_DICT:QP,Z_STREAM_ERROR:Wn,Z_DATA_ERROR:wb,Z_MEM_ERROR:kb,Z_BUF_ERROR:eF,Z_DEFLATED:Sb}=xc,Mc=16180,Cb=16181,Eb=16182,Ab=16183,Tb=16184,Mb=16185,Db=16186,zb=16187,Ib=16188,Ob=16189,Dc=16190,ci=16191,ip=16192,Pb=16193,op=16194,Fb=16195,Rb=16196,Lb=16197,Bb=16198,zc=16199,Ic=16200,$b=16201,Nb=16202,Ub=16203,Hb=16204,jb=16205,sp=16206,Gb=16207,Vb=16208,xr=16209,qb=16210,Kb=16211,tF=852,rF=592,nF=15,Wb=e=>(e>>>24&255)+(e>>>8&65280)+((e&65280)<<8)+((e&255)<<24);function aF(){this.strm=null,this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}const _o=e=>{if(!e)return 1;const t=e.state;return!t||t.strm!==e||t.mode<Mc||t.mode>Kb?1:0},Yb=e=>{if(_o(e))return Wn;const t=e.state;return e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=t.wrap&1),t.mode=Mc,t.last=0,t.havedict=0,t.flags=-1,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new Int32Array(tF),t.distcode=t.distdyn=new Int32Array(rF),t.sane=1,t.back=-1,yo},Xb=e=>{if(_o(e))return Wn;const t=e.state;return t.wsize=0,t.whave=0,t.wnext=0,Yb(e)},Zb=(e,t)=>{let r;if(_o(e))return Wn;const n=e.state;return t<0?(r=0,t=-t):(r=(t>>4)+5,t<48&&(t&=15)),t&&(t<8||t>15)?Wn:(n.window!==null&&n.wbits!==t&&(n.window=null),n.wrap=r,n.wbits=t,Xb(e))},Jb=(e,t)=>{if(!e)return Wn;const r=new aF;e.state=r,r.strm=e,r.window=null,r.mode=Mc;const n=Zb(e,t);return n!==yo&&(e.state=null),n},iF=e=>Jb(e,nF);let Qb=!0,lp,cp;const oF=e=>{if(Qb){lp=new Int32Array(512),cp=new Int32Array(32);let t=0;for(;t<144;)e.lens[t++]=8;for(;t<256;)e.lens[t++]=9;for(;t<280;)e.lens[t++]=7;for(;t<288;)e.lens[t++]=8;for(Cl(yb,e.lens,0,288,lp,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;Cl(_b,e.lens,0,32,cp,0,e.work,{bits:5}),Qb=!1}e.lencode=lp,e.lenbits=9,e.distcode=cp,e.distbits=5},e4=(e,t,r,n)=>{let a;const i=e.state;return i.window===null&&(i.wsize=1<<i.wbits,i.wnext=0,i.whave=0,i.window=new Uint8Array(i.wsize)),n>=i.wsize?(i.window.set(t.subarray(r-i.wsize,r),0),i.wnext=0,i.whave=i.wsize):(a=i.wsize-i.wnext,a>n&&(a=n),i.window.set(t.subarray(r-n,r-n+a),i.wnext),n-=a,n?(i.window.set(t.subarray(r-n,r),0),i.wnext=n,i.whave=i.wsize):(i.wnext+=a,i.wnext===i.wsize&&(i.wnext=0),i.whave<i.wsize&&(i.whave+=a))),0},sF=(e,t)=>{let r,n,a,i,o,s,l,c,u,d,f,p,_,h,b=0,v,m,y,g,S,M,E,w;const x=new Uint8Array(4);let C,D;const B=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(_o(e)||!e.output||!e.input&&e.avail_in!==0)return Wn;r=e.state,r.mode===ci&&(r.mode=ip),o=e.next_out,a=e.output,l=e.avail_out,i=e.next_in,n=e.input,s=e.avail_in,c=r.hold,u=r.bits,d=s,f=l,w=yo;e:for(;;)switch(r.mode){case Mc:if(r.wrap===0){r.mode=ip;break}for(;u<16;){if(s===0)break e;s--,c+=n[i++]<<u,u+=8}if(r.wrap&2&&c===35615){r.wbits===0&&(r.wbits=15),r.check=0,x[0]=c&255,x[1]=c>>>8&255,r.check=Gr(r.check,x,2,0),c=0,u=0,r.mode=Cb;break}if(r.head&&(r.head.done=!1),!(r.wrap&1)||(((c&255)<<8)+(c>>8))%31){e.msg="incorrect header check",r.mode=xr;break}if((c&15)!==Sb){e.msg="unknown compression method",r.mode=xr;break}if(c>>>=4,u-=4,E=(c&15)+8,r.wbits===0&&(r.wbits=E),E>15||E>r.wbits){e.msg="invalid window size",r.mode=xr;break}r.dmax=1<<r.wbits,r.flags=0,e.adler=r.check=1,r.mode=c&512?Ob:ci,c=0,u=0;break;case Cb:for(;u<16;){if(s===0)break e;s--,c+=n[i++]<<u,u+=8}if(r.flags=c,(r.flags&255)!==Sb){e.msg="unknown compression method",r.mode=xr;break}if(r.flags&57344){e.msg="unknown header flags set",r.mode=xr;break}r.head&&(r.head.text=c>>8&1),r.flags&512&&r.wrap&4&&(x[0]=c&255,x[1]=c>>>8&255,r.check=Gr(r.check,x,2,0)),c=0,u=0,r.mode=Eb;case Eb:for(;u<32;){if(s===0)break e;s--,c+=n[i++]<<u,u+=8}r.head&&(r.head.time=c),r.flags&512&&r.wrap&4&&(x[0]=c&255,x[1]=c>>>8&255,x[2]=c>>>16&255,x[3]=c>>>24&255,r.check=Gr(r.check,x,4,0)),c=0,u=0,r.mode=Ab;case Ab:for(;u<16;){if(s===0)break e;s--,c+=n[i++]<<u,u+=8}r.head&&(r.head.xflags=c&255,r.head.os=c>>8),r.flags&512&&r.wrap&4&&(x[0]=c&255,x[1]=c>>>8&255,r.check=Gr(r.check,x,2,0)),c=0,u=0,r.mode=Tb;case Tb:if(r.flags&1024){for(;u<16;){if(s===0)break e;s--,c+=n[i++]<<u,u+=8}r.length=c,r.head&&(r.head.extra_len=c),r.flags&512&&r.wrap&4&&(x[0]=c&255,x[1]=c>>>8&255,r.check=Gr(r.check,x,2,0)),c=0,u=0}else r.head&&(r.head.extra=null);r.mode=Mb;case Mb:if(r.flags&1024&&(p=r.length,p>s&&(p=s),p&&(r.head&&(E=r.head.extra_len-r.length,r.head.extra||(r.head.extra=new Uint8Array(r.head.extra_len)),r.head.extra.set(n.subarray(i,i+p),E)),r.flags&512&&r.wrap&4&&(r.check=Gr(r.check,n,p,i)),s-=p,i+=p,r.length-=p),r.length))break e;r.length=0,r.mode=Db;case Db:if(r.flags&2048){if(s===0)break e;p=0;do E=n[i+p++],r.head&&E&&r.length<65536&&(r.head.name+=String.fromCharCode(E));while(E&&p<s);if(r.flags&512&&r.wrap&4&&(r.check=Gr(r.check,n,p,i)),s-=p,i+=p,E)break e}else r.head&&(r.head.name=null);r.length=0,r.mode=zb;case zb:if(r.flags&4096){if(s===0)break e;p=0;do E=n[i+p++],r.head&&E&&r.length<65536&&(r.head.comment+=String.fromCharCode(E));while(E&&p<s);if(r.flags&512&&r.wrap&4&&(r.check=Gr(r.check,n,p,i)),s-=p,i+=p,E)break e}else r.head&&(r.head.comment=null);r.mode=Ib;case Ib:if(r.flags&512){for(;u<16;){if(s===0)break e;s--,c+=n[i++]<<u,u+=8}if(r.wrap&4&&c!==(r.check&65535)){e.msg="header crc mismatch",r.mode=xr;break}c=0,u=0}r.head&&(r.head.hcrc=r.flags>>9&1,r.head.done=!0),e.adler=r.check=0,r.mode=ci;break;case Ob:for(;u<32;){if(s===0)break e;s--,c+=n[i++]<<u,u+=8}e.adler=r.check=Wb(c),c=0,u=0,r.mode=Dc;case Dc:if(r.havedict===0)return e.next_out=o,e.avail_out=l,e.next_in=i,e.avail_in=s,r.hold=c,r.bits=u,QP;e.adler=r.check=1,r.mode=ci;case ci:if(t===ZP||t===Tc)break e;case ip:if(r.last){c>>>=u&7,u-=u&7,r.mode=sp;break}for(;u<3;){if(s===0)break e;s--,c+=n[i++]<<u,u+=8}switch(r.last=c&1,c>>>=1,u-=1,c&3){case 0:r.mode=Pb;break;case 1:if(oF(r),r.mode=zc,t===Tc){c>>>=2,u-=2;break e}break;case 2:r.mode=Rb;break;case 3:e.msg="invalid block type",r.mode=xr}c>>>=2,u-=2;break;case Pb:for(c>>>=u&7,u-=u&7;u<32;){if(s===0)break e;s--,c+=n[i++]<<u,u+=8}if((c&65535)!==(c>>>16^65535)){e.msg="invalid stored block lengths",r.mode=xr;break}if(r.length=c&65535,c=0,u=0,r.mode=op,t===Tc)break e;case op:r.mode=Fb;case Fb:if(p=r.length,p){if(p>s&&(p=s),p>l&&(p=l),p===0)break e;a.set(n.subarray(i,i+p),o),s-=p,i+=p,l-=p,o+=p,r.length-=p;break}r.mode=ci;break;case Rb:for(;u<14;){if(s===0)break e;s--,c+=n[i++]<<u,u+=8}if(r.nlen=(c&31)+257,c>>>=5,u-=5,r.ndist=(c&31)+1,c>>>=5,u-=5,r.ncode=(c&15)+4,c>>>=4,u-=4,r.nlen>286||r.ndist>30){e.msg="too many length or distance symbols",r.mode=xr;break}r.have=0,r.mode=Lb;case Lb:for(;r.have<r.ncode;){for(;u<3;){if(s===0)break e;s--,c+=n[i++]<<u,u+=8}r.lens[B[r.have++]]=c&7,c>>>=3,u-=3}for(;r.have<19;)r.lens[B[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,C={bits:r.lenbits},w=Cl(XP,r.lens,0,19,r.lencode,0,r.work,C),r.lenbits=C.bits,w){e.msg="invalid code lengths set",r.mode=xr;break}r.have=0,r.mode=Bb;case Bb:for(;r.have<r.nlen+r.ndist;){for(;b=r.lencode[c&(1<<r.lenbits)-1],v=b>>>24,m=b>>>16&255,y=b&65535,!(v<=u);){if(s===0)break e;s--,c+=n[i++]<<u,u+=8}if(y<16)c>>>=v,u-=v,r.lens[r.have++]=y;else{if(y===16){for(D=v+2;u<D;){if(s===0)break e;s--,c+=n[i++]<<u,u+=8}if(c>>>=v,u-=v,r.have===0){e.msg="invalid bit length repeat",r.mode=xr;break}E=r.lens[r.have-1],p=3+(c&3),c>>>=2,u-=2}else if(y===17){for(D=v+3;u<D;){if(s===0)break e;s--,c+=n[i++]<<u,u+=8}c>>>=v,u-=v,E=0,p=3+(c&7),c>>>=3,u-=3}else{for(D=v+7;u<D;){if(s===0)break e;s--,c+=n[i++]<<u,u+=8}c>>>=v,u-=v,E=0,p=11+(c&127),c>>>=7,u-=7}if(r.have+p>r.nlen+r.ndist){e.msg="invalid bit length repeat",r.mode=xr;break}for(;p--;)r.lens[r.have++]=E}}if(r.mode===xr)break;if(r.lens[256]===0){e.msg="invalid code -- missing end-of-block",r.mode=xr;break}if(r.lenbits=9,C={bits:r.lenbits},w=Cl(yb,r.lens,0,r.nlen,r.lencode,0,r.work,C),r.lenbits=C.bits,w){e.msg="invalid literal/lengths set",r.mode=xr;break}if(r.distbits=6,r.distcode=r.distdyn,C={bits:r.distbits},w=Cl(_b,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,C),r.distbits=C.bits,w){e.msg="invalid distances set",r.mode=xr;break}if(r.mode=zc,t===Tc)break e;case zc:r.mode=Ic;case Ic:if(s>=6&&l>=258){e.next_out=o,e.avail_out=l,e.next_in=i,e.avail_in=s,r.hold=c,r.bits=u,VP(e,f),o=e.next_out,a=e.output,l=e.avail_out,i=e.next_in,n=e.input,s=e.avail_in,c=r.hold,u=r.bits,r.mode===ci&&(r.back=-1);break}for(r.back=0;b=r.lencode[c&(1<<r.lenbits)-1],v=b>>>24,m=b>>>16&255,y=b&65535,!(v<=u);){if(s===0)break e;s--,c+=n[i++]<<u,u+=8}if(m&&!(m&240)){for(g=v,S=m,M=y;b=r.lencode[M+((c&(1<<g+S)-1)>>g)],v=b>>>24,m=b>>>16&255,y=b&65535,!(g+v<=u);){if(s===0)break e;s--,c+=n[i++]<<u,u+=8}c>>>=g,u-=g,r.back+=g}if(c>>>=v,u-=v,r.back+=v,r.length=y,m===0){r.mode=jb;break}if(m&32){r.back=-1,r.mode=ci;break}if(m&64){e.msg="invalid literal/length code",r.mode=xr;break}r.extra=m&15,r.mode=$b;case $b:if(r.extra){for(D=r.extra;u<D;){if(s===0)break e;s--,c+=n[i++]<<u,u+=8}r.length+=c&(1<<r.extra)-1,c>>>=r.extra,u-=r.extra,r.back+=r.extra}r.was=r.length,r.mode=Nb;case Nb:for(;b=r.distcode[c&(1<<r.distbits)-1],v=b>>>24,m=b>>>16&255,y=b&65535,!(v<=u);){if(s===0)break e;s--,c+=n[i++]<<u,u+=8}if(!(m&240)){for(g=v,S=m,M=y;b=r.distcode[M+((c&(1<<g+S)-1)>>g)],v=b>>>24,m=b>>>16&255,y=b&65535,!(g+v<=u);){if(s===0)break e;s--,c+=n[i++]<<u,u+=8}c>>>=g,u-=g,r.back+=g}if(c>>>=v,u-=v,r.back+=v,m&64){e.msg="invalid distance code",r.mode=xr;break}r.offset=y,r.extra=m&15,r.mode=Ub;case Ub:if(r.extra){for(D=r.extra;u<D;){if(s===0)break e;s--,c+=n[i++]<<u,u+=8}r.offset+=c&(1<<r.extra)-1,c>>>=r.extra,u-=r.extra,r.back+=r.extra}if(r.offset>r.dmax){e.msg="invalid distance too far back",r.mode=xr;break}r.mode=Hb;case Hb:if(l===0)break e;if(p=f-l,r.offset>p){if(p=r.offset-p,p>r.whave&&r.sane){e.msg="invalid distance too far back",r.mode=xr;break}p>r.wnext?(p-=r.wnext,_=r.wsize-p):_=r.wnext-p,p>r.length&&(p=r.length),h=r.window}else h=a,_=o-r.offset,p=r.length;p>l&&(p=l),l-=p,r.length-=p;do a[o++]=h[_++];while(--p);r.length===0&&(r.mode=Ic);break;case jb:if(l===0)break e;a[o++]=r.length,l--,r.mode=Ic;break;case sp:if(r.wrap){for(;u<32;){if(s===0)break e;s--,c|=n[i++]<<u,u+=8}if(f-=l,e.total_out+=f,r.total+=f,r.wrap&4&&f&&(e.adler=r.check=r.flags?Gr(r.check,a,f,o-f):gl(r.check,a,f,o-f)),f=l,r.wrap&4&&(r.flags?c:Wb(c))!==r.check){e.msg="incorrect data check",r.mode=xr;break}c=0,u=0}r.mode=Gb;case Gb:if(r.wrap&&r.flags){for(;u<32;){if(s===0)break e;s--,c+=n[i++]<<u,u+=8}if(r.wrap&4&&c!==(r.total&4294967295)){e.msg="incorrect length check",r.mode=xr;break}c=0,u=0}r.mode=Vb;case Vb:w=JP;break e;case xr:w=wb;break e;case qb:return kb;case Kb:default:return Wn}return e.next_out=o,e.avail_out=l,e.next_in=i,e.avail_in=s,r.hold=c,r.bits=u,(r.wsize||f!==e.avail_out&&r.mode<xr&&(r.mode<sp||t!==xb))&&e4(e,e.output,e.next_out,f-e.avail_out),d-=e.avail_in,f-=e.avail_out,e.total_in+=d,e.total_out+=f,r.total+=f,r.wrap&4&&f&&(e.adler=r.check=r.flags?Gr(r.check,a,f,e.next_out-f):gl(r.check,a,f,e.next_out-f)),e.data_type=r.bits+(r.last?64:0)+(r.mode===ci?128:0)+(r.mode===zc||r.mode===op?256:0),(d===0&&f===0||t===xb)&&w===yo&&(w=eF),w},lF=e=>{if(_o(e))return Wn;let t=e.state;return t.window&&(t.window=null),e.state=null,yo},cF=(e,t)=>{if(_o(e))return Wn;const r=e.state;return r.wrap&2?(r.head=t,t.done=!1,yo):Wn},uF=(e,t)=>{const r=t.length;let n,a,i;return _o(e)||(n=e.state,n.wrap!==0&&n.mode!==Dc)?Wn:n.mode===Dc&&(a=1,a=gl(a,t,r,0),a!==n.check)?wb:(i=e4(e,t,r,r),i?(n.mode=qb,kb):(n.havedict=1,yo))};var fF=Xb,dF=Zb,pF=Yb,hF=iF,vF=Jb,mF=sF,gF=lF,bF=cF,yF=uF,_F="pako inflate (from Nodeca project)",ui={inflateReset:fF,inflateReset2:dF,inflateResetKeep:pF,inflateInit:hF,inflateInit2:vF,inflate:mF,inflateEnd:gF,inflateGetHeader:bF,inflateSetDictionary:yF,inflateInfo:_F};function xF(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}var wF=xF;const t4=Object.prototype.toString,{Z_NO_FLUSH:kF,Z_FINISH:SF,Z_OK:El,Z_STREAM_END:up,Z_NEED_DICT:fp,Z_STREAM_ERROR:CF,Z_DATA_ERROR:r4,Z_MEM_ERROR:EF}=xc;function Oc(e){this.options=Sc.assign({chunkSize:1024*64,windowBits:15,to:""},e||{});const t=this.options;t.raw&&t.windowBits>=0&&t.windowBits<16&&(t.windowBits=-t.windowBits,t.windowBits===0&&(t.windowBits=-15)),t.windowBits>=0&&t.windowBits<16&&!(e&&e.windowBits)&&(t.windowBits+=32),t.windowBits>15&&t.windowBits<48&&(t.windowBits&15||(t.windowBits|=15)),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new pb,this.strm.avail_out=0;let r=ui.inflateInit2(this.strm,t.windowBits);if(r!==El)throw new Error(vo[r]);if(this.header=new wF,ui.inflateGetHeader(this.strm,this.header),t.dictionary&&(typeof t.dictionary=="string"?t.dictionary=Sl.string2buf(t.dictionary):t4.call(t.dictionary)==="[object ArrayBuffer]"&&(t.dictionary=new Uint8Array(t.dictionary)),t.raw&&(r=ui.inflateSetDictionary(this.strm,t.dictionary),r!==El)))throw new Error(vo[r])}Oc.prototype.push=function(e,t){const r=this.strm,n=this.options.chunkSize,a=this.options.dictionary;let i,o,s;if(this.ended)return!1;for(t===~~t?o=t:o=t===!0?SF:kF,t4.call(e)==="[object ArrayBuffer]"?r.input=new Uint8Array(e):r.input=e,r.next_in=0,r.avail_in=r.input.length;;){for(r.avail_out===0&&(r.output=new Uint8Array(n),r.next_out=0,r.avail_out=n),i=ui.inflate(r,o),i===fp&&a&&(i=ui.inflateSetDictionary(r,a),i===El?i=ui.inflate(r,o):i===r4&&(i=fp));r.avail_in>0&&i===up&&r.state.wrap>0&&e[r.next_in]!==0;)ui.inflateReset(r),i=ui.inflate(r,o);switch(i){case CF:case r4:case fp:case EF:return this.onEnd(i),this.ended=!0,!1}if(s=r.avail_out,r.next_out&&(r.avail_out===0||i===up))if(this.options.to==="string"){let l=Sl.utf8border(r.output,r.next_out),c=r.next_out-l,u=Sl.buf2string(r.output,l);r.next_out=c,r.avail_out=n-c,c&&r.output.set(r.output.subarray(l,l+c),0),this.onData(u)}else this.onData(r.output.length===r.next_out?r.output:r.output.subarray(0,r.next_out));if(!(i===El&&s===0)){if(i===up)return i=ui.inflateEnd(this.strm),this.onEnd(i),this.ended=!0,!0;if(r.avail_in===0)break}}return!0},Oc.prototype.onData=function(e){this.chunks.push(e)},Oc.prototype.onEnd=function(e){e===El&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=Sc.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};function AF(e,t){const r=new Oc(t);if(r.push(e),r.err)throw r.msg||vo[r.err];return r.result}var TF=AF,MF={inflate:TF};const{deflate:DF}=jP,{inflate:zF}=MF;var IF=DF,OF=zF,Al=new Int32Array([0,1,8,16,9,2,3,10,17,24,32,25,18,11,4,5,12,19,26,33,40,48,41,34,27,20,13,6,7,14,21,28,35,42,49,56,57,50,43,36,29,22,15,23,30,37,44,51,58,59,52,45,38,31,39,46,53,60,61,54,47,55,62,63]),Pc=4017,Fc=799,Rc=3406,Lc=2276,Bc=1567,$c=3784,cs=5793,Nc=2896,PF=100,n4=64*1024*1024,dp=0;function us(e){var t=dp+e;if(t>n4){var r=Math.ceil((t-n4)/1024/1024);throw new Error("Max memory limit exceeded by at least ".concat(r,"MB"))}dp=t}function FF(e,t){for(var r=16;r>0&&!e[r-1];)r--;for(var n=[{children:[],index:0}],a=0,i=n[0],o=0;o<r;o++){for(var s=0;s<e[o];s++){for(i=n.pop(),i.children[i.index]=t[a];i.index>0;){if(n.length===0)throw new Error("Could not recreate Huffman Table");i=n.pop()}for(i.index++,n.push(i);n.length<=o;){var l={children:[],index:0};n.push(l),i.children[i.index]=l.children,i=l}a++}if(o+1<r){var l={children:[],index:0};n.push(l),i.children[i.index]=l.children,i=l}}return n[0].children}function RF(e,t,r,n,a,i,o,s,l){var c=r.mcusPerLine,u=r.progressive,d=t,f=0,p=0;function _(){if(p>0)return p--,f>>p&1;if(f=e[t++],f==255){var Ee=e[t++];if(Ee)throw new Error("unexpected marker: ".concat((f<<8|Ee).toString(16)))}return p=7,f>>>7}function h(Ee){for(var Ae=Ee;;){if(Ae=Ae[_()],typeof Ae=="number")return Ae;if(Ae===void 0)throw new Error("invalid huffman sequence")}}function b(Ee){for(var Ae=0;Ee>0;)Ae=Ae<<1|_(),Ee--;return Ae}function v(Ee){var Ae=b(Ee);return Ae>=1<<Ee-1?Ae:Ae+(-1<<Ee)+1}function m(Ee,Ae){var ze=h(Ee.huffmanTableDC),Le=ze===0?0:v(ze);Ae[0]=Ee.pred+=Le;for(var he=1;he<64;){var Ie=h(Ee.huffmanTableAC),De=Ie&15,Be=Ie>>4;if(De===0){if(Be<15)break;he+=16;continue}he+=Be;var Z=Al[he];Ae[Z]=v(De),he++}}function y(Ee,Ae){var ze=h(Ee.huffmanTableDC),Le=ze===0?0:v(ze)<<l;Ae[0]=Ee.pred+=Le}function g(Ee,Ae){Ae[0]|=_()<<l}var S=0;function M(Ee,Ae){if(S>0){S--;return}for(var ze=i,Le=o;ze<=Le;){var he=h(Ee.huffmanTableAC),Ie=he&15,De=he>>4;if(Ie===0){if(De<15){S=b(De)+(1<<De)-1;break}ze+=16;continue}ze+=De;var Be=Al[ze];Ae[Be]=v(Ie)*(1<<l),ze++}}var E=0,w=0;function x(Ee,Ae){for(var ze=i,Le=o,he=0;ze<=Le;){var Ie=Al[ze],De=Ae[Ie]<0?-1:1;switch(E){case 0:var Be=h(Ee.huffmanTableAC),Z=Be&15;if(he=Be>>4,Z===0)he<15?(S=b(he)+(1<<he),E=4):(he=16,E=1);else{if(Z!==1)throw new Error("invalid ACn encoding");w=v(Z),E=he?2:3}continue;case 1:case 2:Ae[Ie]?Ae[Ie]+=(_()<<l)*De:(he--,he===0&&(E=E==2?3:0));break;case 3:Ae[Ie]?Ae[Ie]+=(_()<<l)*De:(Ae[Ie]=w<<l,E=0);break;case 4:Ae[Ie]&&(Ae[Ie]+=(_()<<l)*De);break}ze++}E===4&&(S--,S===0&&(E=0))}function C(Ee,Ae,ze,Le,he){var Ie=ze/c|0,De=ze%c,Be=Ie*Ee.v+Le,Z=De*Ee.h+he;Ee.blocks[Be]!==void 0&&Ae(Ee,Ee.blocks[Be][Z])}function D(Ee,Ae,ze){var Le=ze/Ee.blocksPerLine|0,he=ze%Ee.blocksPerLine;Ee.blocks[Le]!==void 0&&Ae(Ee,Ee.blocks[Le][he])}var B=n.length,F,K;u?i===0?K=s===0?y:g:K=s===0?M:x:K=m;var te=0,J;B==1?J=n[0].blocksPerLine*n[0].blocksPerColumn:J=c*r.mcusPerColumn,a||(a=J);for(var ne,le,q;te<J;){for(var j=0;j<B;j++)n[j].pred=0;if(S=0,B==1){F=n[0];for(var P=0;P<a;P++)D(F,K,te),te++}else for(var P=0;P<a;P++){for(var j=0;j<B;j++){F=n[j],ne=F.h,le=F.v;for(var N=0;N<le;N++)for(var X=0;X<ne;X++)C(F,K,te,N,X)}if(te++,te===J)break}if(te===J)do{if(e[t]===255&&e[t+1]!==0)break;t+=1}while(t<e.length-2);if(p=0,q=e[t]<<8|e[t+1],q<65280)throw new Error("marker was not found");if(q>=65488&&q<=65495)t+=2;else break}return t-d}function LF(e){var t=[],r=e.blocksPerLine,n=e.blocksPerColumn,a=r<<3,i=new Int32Array(64),o=new Uint8Array(64);function s(b,v,m){for(var y=e.quantizationTable,g=m,S=0;S<64;S++)g[S]=b[S]*y[S];for(var S=0;S<8;++S){var M=8*S;if(g[1+M]==0&&g[2+M]==0&&g[3+M]==0&&g[4+M]==0&&g[5+M]==0&&g[6+M]==0&&g[7+M]==0){var E=cs*g[0+M]+512>>10;g[0+M]=E,g[1+M]=E,g[2+M]=E,g[3+M]=E,g[4+M]=E,g[5+M]=E,g[6+M]=E,g[7+M]=E;continue}var w=cs*g[0+M]+128>>8,x=cs*g[4+M]+128>>8,C=g[2+M],D=g[6+M],B=Nc*(g[1+M]-g[7+M])+128>>8,F=Nc*(g[1+M]+g[7+M])+128>>8,K=g[3+M]<<4,te=g[5+M]<<4,J=w-x+1>>1;w=w+x+1>>1,x=J,J=C*$c+D*Bc+128>>8,C=C*Bc-D*$c+128>>8,D=J,J=B-te+1>>1,B=B+te+1>>1,te=J,J=F+K+1>>1,K=F-K+1>>1,F=J,J=w-D+1>>1,w=w+D+1>>1,D=J,J=x-C+1>>1,x=x+C+1>>1,C=J,J=B*Lc+F*Rc+2048>>12,B=B*Rc-F*Lc+2048>>12,F=J,J=K*Fc+te*Pc+2048>>12,K=K*Pc-te*Fc+2048>>12,te=J,g[0+M]=w+F,g[7+M]=w-F,g[1+M]=x+te,g[6+M]=x-te,g[2+M]=C+K,g[5+M]=C-K,g[3+M]=D+B,g[4+M]=D-B}for(var S=0;S<8;++S){var ne=S;if(g[1*8+ne]==0&&g[2*8+ne]==0&&g[3*8+ne]==0&&g[4*8+ne]==0&&g[5*8+ne]==0&&g[6*8+ne]==0&&g[7*8+ne]==0){var le=cs*m[S+0]+8192>>14;g[0*8+ne]=le,g[1*8+ne]=le,g[2*8+ne]=le,g[3*8+ne]=le,g[4*8+ne]=le,g[5*8+ne]=le,g[6*8+ne]=le,g[7*8+ne]=le;continue}var w=cs*g[0*8+ne]+2048>>12,x=cs*g[4*8+ne]+2048>>12,C=g[2*8+ne],D=g[6*8+ne],B=Nc*(g[1*8+ne]-g[7*8+ne])+2048>>12,F=Nc*(g[1*8+ne]+g[7*8+ne])+2048>>12,K=g[3*8+ne],te=g[5*8+ne],J=w-x+1>>1;w=w+x+1>>1,x=J,J=C*$c+D*Bc+2048>>12,C=C*Bc-D*$c+2048>>12,D=J,J=B-te+1>>1,B=B+te+1>>1,te=J,J=F+K+1>>1,K=F-K+1>>1,F=J,J=w-D+1>>1,w=w+D+1>>1,D=J,J=x-C+1>>1,x=x+C+1>>1,C=J,J=B*Lc+F*Rc+2048>>12,B=B*Rc-F*Lc+2048>>12,F=J,J=K*Fc+te*Pc+2048>>12,K=K*Pc-te*Fc+2048>>12,te=J,g[0*8+ne]=w+F,g[7*8+ne]=w-F,g[1*8+ne]=x+te,g[6*8+ne]=x-te,g[2*8+ne]=C+K,g[5*8+ne]=C-K,g[3*8+ne]=D+B,g[4*8+ne]=D-B}for(var S=0;S<64;++S){var q=128+(g[S]+8>>4);v[S]=q<0?0:q>255?255:q}}us(a*n*8);for(var l=0;l<n;l++){for(var c=l<<3,u=0;u<8;u++)t.push(new Uint8Array(a));for(var d=0;d<r;d++){s(e.blocks[l][d],o,i);for(var f=0,p=d<<3,_=0;_<8;_++)for(var h=t[c+_],u=0;u<8;u++)h[p+u]=o[f++]}}return t}function fi(e){return e<0?0:e>255?255:e}function BF(e){var t={width:0,height:0,comments:[],adobe:void 0,components:[],exifBuffer:void 0,jfif:void 0},r=PF*1e3*1e3,n=0;function a(){var Se=e[n]<<8|e[n+1];return n+=2,Se}function i(){var Se=a(),me=e.subarray(n,n+Se-2);return n+=me.length,me}function o(Se){var me=0,ye=0;for(var xe in Se.components)if(Se.components.hasOwnProperty(xe)){var ee=Se.components[xe];me<ee.h&&(me=ee.h),ye<ee.v&&(ye=ee.v)}var pe=Math.ceil(Se.samplesPerLine/8/me),ve=Math.ceil(Se.scanLines/8/ye);for(var xe in Se.components)if(Se.components.hasOwnProperty(xe)){var ee=Se.components[xe],Pe=Math.ceil(Math.ceil(Se.samplesPerLine/8)*ee.h/me),Ge=Math.ceil(Math.ceil(Se.scanLines/8)*ee.v/ye),Ue=pe*ee.h,We=ve*ee.v,rt=We*Ue,lt=[];us(rt*256);for(var ft=0;ft<We;ft++){for(var St=[],$e=0;$e<Ue;$e++)St.push(new Int32Array(64));lt.push(St)}ee.blocksPerLine=Pe,ee.blocksPerColumn=Ge,ee.blocks=lt}Se.maxH=me,Se.maxV=ye,Se.mcusPerLine=pe,Se.mcusPerColumn=ve}var s=null,l=null,c=void 0,u=0,d=[],f=[],p=[],_=[],h=a(),b=-1;if(h!=65496)throw new Error("SOI not found");for(h=a();h!=65497;){switch(h){case 65280:break;case 65504:case 65505:case 65506:case 65507:case 65508:case 65509:case 65510:case 65511:case 65512:case 65513:case 65514:case 65515:case 65516:case 65517:case 65518:case 65519:case 65534:{var v=i();if(h===65534){for(var m="",y=0;y<v.byteLength;y++)m+=String.fromCharCode(v[y]);t.comments.push(m)}h===65504&&v[0]===74&&v[1]===70&&v[2]===73&&v[3]===70&&v[4]===0&&(s={version:{major:v[5],minor:v[6]},densityUnits:v[7],xDensity:v[8]<<8|v[9],yDensity:v[10]<<8|v[11],thumbWidth:v[12],thumbHeight:v[13],thumbData:v.subarray(14,14+3*v[12]*v[13])}),h===65505&&v[0]===69&&v[1]===120&&v[2]===105&&v[3]===102&&v[4]===0&&(t.exifBuffer=v.subarray(5,v.length)),h===65518&&v[0]===65&&v[1]===100&&v[2]===111&&v[3]===98&&v[4]===101&&v[5]===0&&(l={version:v[6],flags0:v[7]<<8|v[8],flags1:v[9]<<8|v[10],transformCode:v[11]});break}case 65499:{for(var g=a(),S=g+n-2;n<S;){var M=e[n++];us(64*4);var E=new Int32Array(64);if(M>>4)if(M>>4===1)for(var w=0;w<64;w++){var x=Al[w];E[x]=a()}else throw new Error("DQT: invalid table spec");else for(var w=0;w<64;w++){var x=Al[w];E[x]=e[n++]}d[M&15]=E}break}case 65472:case 65473:case 65474:{a(),c={extended:h===65473,progressive:h===65474,precision:e[n++],scanLines:a(),samplesPerLine:a(),components:{},componentsOrder:[],maxH:0,maxV:0,mcusPerLine:0,mcusPerColumn:0};var C=c.scanLines*c.samplesPerLine;if(C>r){var D=Math.ceil((C-r)/1e6);throw new Error("maxResolutionInMP limit exceeded by ".concat(D,"MP"))}for(var B=e[n++],F=0;F<B;F++){var K=e[n],te=e[n+1]>>4,J=e[n+1]&15,ne=e[n+2];c.componentsOrder.push(K),c.components[K]={h:te,v:J,quantizationIdx:ne,blocksPerColumn:0,blocksPerLine:0,blocks:[],pred:0},n+=3}o(c),f.push(c);break}case 65476:{for(var le=a(),F=2;F<le;){for(var q=e[n++],j=new Uint8Array(16),P=0,w=0;w<16;w++,n++)P+=j[w]=e[n];us(16+P);for(var N=new Uint8Array(P),w=0;w<P;w++,n++)N[w]=e[n];F+=17+P;var X=q&15,Ee=q>>4?p:_;Ee[X]=FF(j,N)}break}case 65501:a(),u=a();break;case 65500:a(),a();break;case 65498:{a();for(var Ae=e[n++],ze=[],F=0;F<Ae;F++){var Le=c.components[e[n++]],he=e[n++];Le.huffmanTableDC=_[he>>4],Le.huffmanTableAC=p[he&15],ze.push(Le)}var Ie=e[n++],De=e[n++],Be=e[n++],Z=RF(e,n,c,ze,u,Ie,De,Be>>4,Be&15);n+=Z;break}case 65535:e[n]!==255&&n--;break;default:{if(e[n-3]==255&&e[n-2]>=192&&e[n-2]<=254){n-=3;break}else if(h===224||h==225){if(b!==-1)throw new Error("first unknown JPEG marker at offset ".concat(b.toString(16),", second unknown JPEG marker ").concat(h.toString(16)," at offset ").concat((n-1).toString(16)));b=n-1;var se=a();if(e[n+se-2]===255){n+=se-2;break}}throw new Error("unknown JPEG marker "+h.toString(16))}}h=a()}if(f.length!=1)throw new Error("only single frame JPEGs supported");for(var F=0;F<f.length;F++){var we=f[F].components;for(var w in we)we[w].quantizationTable=d[we[w].quantizationIdx],delete we[w].quantizationIdx}t.width=c.samplesPerLine,t.height=c.scanLines,t.jfif=s,t.adobe=l,t.components=[];for(var F=0;F<c.componentsOrder.length;F++){var Le=c.components[c.componentsOrder[F]];t.components.push({lines:LF(Le),scaleX:Le.h/c.maxH,scaleY:Le.v/c.maxV})}return t}function $F(e){var t=0,r=!1,n=e.width,a=e.height,i=n*a*e.components.length;us(i);var o=new Uint8Array(i);switch(e.components.length){case 1:{for(var s=e.components[0],l=0;l<a;l++)for(var c=s.lines[0|l*s.scaleY],u=0;u<n;u++){var d=c[0|u*s.scaleX];o[t++]=d}break}case 2:{for(var s=e.components[0],f=e.components[1],l=0;l<a;l++)for(var c=s.lines[0|l*s.scaleY],p=f.lines[0|l*f.scaleY],u=0;u<n;u++){var _=c[0|u*s.scaleX];o[t++]=_;var h=p[0|u*f.scaleX];o[t++]=h}break}case 3:{r=!0,e.adobe&&e.adobe.transformCode&&(r=!0);for(var s=e.components[0],f=e.components[1],b=e.components[2],l=0;l<a;l++)for(var c=s.lines[0|l*s.scaleY],p=f.lines[0|l*f.scaleY],v=b.lines[0|l*b.scaleY],u=0;u<n;u++){var d=void 0,m=void 0,y=void 0,g=void 0,S=void 0,M=void 0;r?(d=c[0|u*s.scaleX],m=p[0|u*f.scaleX],y=v[0|u*b.scaleX],g=fi(d+1.402*(y-128)),S=fi(d-.3441363*(m-128)-.71413636*(y-128)),M=fi(d+1.772*(m-128))):(g=c[0|u*s.scaleX],S=p[0|u*f.scaleX],M=v[0|u*b.scaleX]),o[t++]=g,o[t++]=S,o[t++]=M}break}case 4:{if(!e.adobe)throw new Error("Unsupported color mode (4 components)");r=!1,e.adobe&&e.adobe.transformCode&&(r=!0);for(var s=e.components[0],f=e.components[1],b=e.components[2],E=e.components[3],l=0;l<a;l++)for(var c=s.lines[0|l*s.scaleY],p=f.lines[0|l*f.scaleY],v=b.lines[0|l*b.scaleY],w=E.lines[0|l*E.scaleY],u=0;u<n;u++){var d=void 0,m=void 0,y=void 0,x=void 0,C=void 0,D=void 0,B=void 0;r?(d=c[0|u*s.scaleX],m=p[0|u*f.scaleX],y=v[0|u*b.scaleX],x=w[0|u*E.scaleX],C=255-fi(d+1.402*(y-128)),D=255-fi(d-.3441363*(m-128)-.71413636*(y-128)),B=255-fi(d+1.772*(m-128))):(C=c[0|u*s.scaleX],D=p[0|u*f.scaleX],B=v[0|u*b.scaleX],x=w[0|u*E.scaleX]),o[t++]=255-C,o[t++]=255-D,o[t++]=255-B,o[t++]=255-x}break}default:throw new Error("Unsupported color mode")}return o}function NF(e,t){if(dp=0,e.length===0)throw new Error("Empty jpeg buffer");var r=BF(e);us(r.width*r.height*4);var n=$F(r),a=t(r.width,r.height),i=a.width,o=a.height,s=a.data,l=0,c=0;switch(r.components.length){case 1:for(var u=0;u<o;u++)for(var d=0;d<i;d++){var f=n[l++];s[c++]=f,s[c++]=f,s[c++]=f,s[c++]=255}break;case 3:for(var u=0;u<o;u++)for(var d=0;d<i;d++){var p=n[l++],_=n[l++],h=n[l++];s[c++]=p,s[c++]=_,s[c++]=h,s[c++]=255}break;case 4:for(var u=0;u<o;u++)for(var d=0;d<i;d++){var b=n[l++],v=n[l++],f=n[l++],m=n[l++],p=255-fi(b*(1-m/255)+m),_=255-fi(v*(1-m/255)+m),h=255-fi(f*(1-m/255)+m);s[c++]=p,s[c++]=_,s[c++]=h,s[c++]=255}break;default:throw new Error("Unsupported color mode")}return a}var UF=!1,Uc={},fs={pass:"pass through",norm:"normal",diss:"dissolve",dark:"darken","mul ":"multiply",idiv:"color burn",lbrn:"linear burn",dkCl:"darker color",lite:"lighten",scrn:"screen","div ":"color dodge",lddg:"linear dodge",lgCl:"lighter color",over:"overlay",sLit:"soft light",hLit:"hard light",vLit:"vivid light",lLit:"linear light",pLit:"pin light",hMix:"hard mix",diff:"difference",smud:"exclusion",fsub:"subtract",fdiv:"divide","hue ":"hue","sat ":"saturation",colr:"color","lum ":"luminosity"};Object.keys(fs).forEach(function(e){return Uc[fs[e]]=e});var a4=["none","red","orange","yellow","green","blue","violet","gray"],i4=["LMsk","Lr16","Lr32","Layr","Mt16","Mt32","Mtrn","Alph","FMsk","lnk2","FEid","FXid","PxSD","cinf"];function HF(e){var t={};return Object.keys(e).forEach(function(r){return t[e[r]]=r}),t}function _t(e,t,r){var n=HF(r),a=function(o){var s=o.split(".")[1];if(s&&!n[s])throw new Error("Unrecognized value for enum: '".concat(o,"'"));return n[s]||t},i=function(o){if(o&&!r[o])throw new Error("Invalid value for enum: '".concat(o,"'"));return"".concat(e,".").concat(r[o]||r[t])};return{decode:a,encode:i}}var o4;(function(e){e[e.RGB=0]="RGB",e[e.HSB=1]="HSB",e[e.CMYK=2]="CMYK",e[e.Lab=7]="Lab",e[e.Grayscale=8]="Grayscale"})(o4||(o4={}));var s4;(function(e){e[e.PositionRelativeToLayer=1]="PositionRelativeToLayer",e[e.LayerMaskDisabled=2]="LayerMaskDisabled",e[e.InvertLayerMaskWhenBlending=4]="InvertLayerMaskWhenBlending",e[e.LayerMaskFromRenderingOtherData=8]="LayerMaskFromRenderingOtherData",e[e.MaskHasParametersAppliedToIt=16]="MaskHasParametersAppliedToIt"})(s4||(s4={}));var l4;(function(e){e[e.UserMaskDensity=1]="UserMaskDensity",e[e.UserMaskFeather=2]="UserMaskFeather",e[e.VectorMaskDensity=4]="VectorMaskDensity",e[e.VectorMaskFeather=8]="VectorMaskFeather"})(l4||(l4={}));function c4(e,t){switch(e){case 0:return 0;case 1:return 1;case 2:return 2;case 3:return t?3:e+1;case-1:return t?4:3;default:return e+1}}function pp(e,t,r){return e<t?t:e>r?r:e}function u4(e){for(var t=e.width*e.height*4,r=3;r<t;r+=4)if(e.data[r]!==255)return!0;return!1}function jF(e){for(var t=e.data,r=t instanceof Float32Array?1:t instanceof Uint16Array?65535:255,n=0,a=t.length|0;n<a;n=n+4|0)t[n+0]=0,t[n+1]=0,t[n+2]=0,t[n+3]=r}function Hc(e){var t=ds(e.width,e.height),r;if(e.data instanceof Uint8ClampedArray)r=e;else{r=ps(e.width,e.height);var n=e.data,a=r.data;if(n instanceof Float32Array)for(var i=0,o=n.length;i<o;i+=4)a[i+0]=Math.round(Math.pow(n[i+0],1/2.2)*255),a[i+1]=Math.round(Math.pow(n[i+1],1/2.2)*255),a[i+2]=Math.round(Math.pow(n[i+2],1/2.2)*255),a[i+3]=Math.round(n[i+3]*255);else for(var s=n instanceof Uint16Array?8:0,i=0,o=n.length;i<o;i++)a[i]=n[i]>>>s}return t.getContext("2d").putImageData(r,0,0),t}function GF(e,t,r,n){if(!(e instanceof Uint8Array||e instanceof Uint8ClampedArray))throw new Error("Invalid bit depth");for(var a=0,i=0,o=0;a<n;a++)for(var s=0;s<r;)for(var l=e[o++],c=0;c<8&&s<r;c++,s++,i+=4){var u=l&128?0:255;l=l<<1,t[i+0]=u,t[i+1]=u,t[i+2]=u,t[i+3]=255}}function hp(e,t,r,n){var a=t.data,i=t.width,o=t.height;if(!(!i||!o)){for(var s=4*i|0,l=0,c=r.length*(n?4:2)*o|0,u=0,d=r;u<d.length;u++)for(var f=d[u],p=0,_=f|0;p<o;p++){var h=p*s|0,b=h+s|0,v=b+f-4|0,m=v-4|0,y=c;for(_=h+f|0;_<b;_=_+4|0)if(_<m){var g=a[_];_=_+4|0;var S=a[_];_=_+4|0;var M=a[_];if(g===S&&g===M){for(var E=3;E<128&&_<v&&a[_+4|0]===g;)E=E+1|0,_=_+4|0;e[c++]=1-E,e[c++]=g}else{var w=c,x=!0,E=1;for(e[c++]=0,e[c++]=g;_<v&&E<128;)if(_=_+4|0,g=S,S=M,M=a[_],g===S&&g===M){_=_-12|0,x=!1;break}else E++,e[c++]=g;x&&(E<127?(e[c++]=S,e[c++]=M,E+=2):E<128?(e[c++]=S,E++,_=_-4|0):_=_-8|0),e[w]=E-1}}else _===v?(e[c++]=0,e[c++]=a[_]):(e[c++]=1,e[c++]=a[_],_=_+4|0,e[c++]=a[_]);var C=c-y;n&&(e[l++]=C>>24&255,e[l++]=C>>16&255),e[l++]=C>>8&255,e[l++]=C&255}return e.slice(0,c)}}function f4(e,t){for(var r=e.data,n=e.width,a=e.height,i=n*a,o=new Uint8Array(i),s=[],l=0,c=0,u=t;c<u.length;c++){for(var d=u[c],f=0,p=d;f<i;f++,p+=4)o[f]=r[p];var _=IF(o);s.push(_),l+=_.byteLength}if(s.length>0){for(var _=new Uint8Array(l),d=0,h=0,b=s;h<b.length;h++){var v=b[h];_.set(v,d),d+=v.byteLength}return _}else return s[0]}function VF(e){var t=ds(100,100);try{var r=t.getContext("2d"),n=NF(e,function(a,i){return r.createImageData(a,i)});t.width=n.width,t.height=n.height,r.putImageData(n,0,0)}catch(a){console.error("JPEG decompression error",a.message)}return t}var ds=function(){throw new Error("Canvas not initialized, use initializeCanvas method to set up createCanvas method")},vp=void 0,ps=function(e,t){return vp||(vp=ds(1,1)),vp.getContext("2d").createImageData(e,t)};typeof document<"u"&&(ds=function(e,t){var r=document.createElement("canvas");return r.width=e,r.height=t,r});function qF(e,t){ds=e,ps=t||ps}for(var d4=ZF,p4=eR,$a=[],Yn=[],KF=typeof Uint8Array<"u"?Uint8Array:Array,mp="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",hs=0,WF=mp.length;hs<WF;++hs)$a[hs]=mp[hs],Yn[mp.charCodeAt(hs)]=hs;Yn[45]=62,Yn[95]=63;function YF(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");r===-1&&(r=t);var n=r===t?0:4-r%4;return[r,n]}function XF(e,t,r){return(t+r)*3/4-r}function ZF(e){var t,r=YF(e),n=r[0],a=r[1],i=new KF(XF(e,n,a)),o=0,s=a>0?n-4:n,l;for(l=0;l<s;l+=4)t=Yn[e.charCodeAt(l)]<<18|Yn[e.charCodeAt(l+1)]<<12|Yn[e.charCodeAt(l+2)]<<6|Yn[e.charCodeAt(l+3)],i[o++]=t>>16&255,i[o++]=t>>8&255,i[o++]=t&255;return a===2&&(t=Yn[e.charCodeAt(l)]<<2|Yn[e.charCodeAt(l+1)]>>4,i[o++]=t&255),a===1&&(t=Yn[e.charCodeAt(l)]<<10|Yn[e.charCodeAt(l+1)]<<4|Yn[e.charCodeAt(l+2)]>>2,i[o++]=t>>8&255,i[o++]=t&255),i}function JF(e){return $a[e>>18&63]+$a[e>>12&63]+$a[e>>6&63]+$a[e&63]}function QF(e,t,r){for(var n,a=[],i=t;i<r;i+=3)n=(e[i]<<16&16711680)+(e[i+1]<<8&65280)+(e[i+2]&255),a.push(JF(n));return a.join("")}function eR(e){for(var t,r=e.length,n=r%3,a=[],i=16383,o=0,s=r-n;o<s;o+=i)a.push(QF(e,o,o+i>s?s:o+i));return n===1?(t=e[r-1],a.push($a[t>>2]+$a[t<<4&63]+"==")):n===2&&(t=(e[r-2]<<8)+e[r-1],a.push($a[t>>10]+$a[t>>4&63]+$a[t<<2&63]+"=")),a.join("")}function gp(e){return e&4294967168?e&4294965248?e&4294901760?4:3:2:1}function tR(e){for(var t=0,r=0;r<e.length;r++){var n=e.charCodeAt(r);if(n>=55296&&n<=56319){if(r+1<e.length){var a=e.charCodeAt(r+1);(a&64512)===56320&&(r++,t+=gp(((n&1023)<<10)+(a&1023)+65536))}}else t+=gp(n)}return t}function h4(e,t,r){var n=gp(r);switch(n){case 1:e[t]=r;break;case 2:e[t]=r>>6&31|192,e[t+1]=r&63|128;break;case 3:e[t]=r>>12&15|224,e[t+1]=r>>6&63|128,e[t+2]=r&63|128;break;default:e[t]=r>>18&7|240,e[t+1]=r>>12&63|128,e[t+2]=r>>6&63|128,e[t+3]=r&63|128;break}return n}function rR(e,t,r){for(var n=0;n<r.length;n++){var a=r.charCodeAt(n);if(a>=55296&&a<=56319){if(n+1<r.length){var i=r.charCodeAt(n+1);if((i&64512)===56320){n++;var o=((a&1023)<<10)+(i&1023)+65536;t+=h4(e,t,o)}}}else t+=h4(e,t,a)}return t}function v4(e){if(e.length>1e3&&typeof TextEncoder<"u")return new TextEncoder().encode(e);var t=new Uint8Array(tR(e));return rR(t,0,e),t}function vs(e,t){if(t>=e.length)throw Error("Invalid byte index");var r=e[t];if((r&192)===128)return r&63;throw Error("Invalid continuation byte")}function m4(e){if(e.byteLength>1e3&&typeof TextDecoder<"u")return new TextDecoder().decode(e);for(var t=[],r=0;r<e.length;){var n=e[r++],a=void 0;if(!(n&128))a=n;else if((n&224)===192){var i=vs(e,r++);if(a=(n&31)<<6|i,a<128)throw Error("Invalid continuation byte")}else if((n&240)===224){var i=vs(e,r++),o=vs(e,r++);if(a=(n&15)<<12|i<<6|o,a<2048)throw Error("Invalid continuation byte");if(a>=55296&&a<=57343)throw Error("Lone surrogate U+".concat(a.toString(16).toUpperCase()," is not a scalar value"))}else if((n&248)===240){var i=vs(e,r++),o=vs(e,r++),s=vs(e,r++);if(a=(n&15)<<18|i<<12|o<<6|s,a<65536||a>1114111)throw Error("Invalid continuation byte")}else throw Error("Invalid UTF-8 detected");a>65535&&(a-=65536,t.push(String.fromCharCode(a>>>10&1023|55296)),a=56320|a&1023),t.push(String.fromCharCode(a))}return t.join("")}var di=function(){return di=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++){t=arguments[r];for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a])}return e},di.apply(this,arguments)},nR=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,n=Object.getOwnPropertySymbols(e);a<n.length;a++)t.indexOf(n[a])<0&&Object.prototype.propertyIsEnumerable.call(e,n[a])&&(r[n[a]]=e[n[a]]);return r};function aR(e){var t={};return Object.keys(e).forEach(function(r){return t[e[r]]=r}),t}var Tl={"#Ang":"Angle","#Rsl":"Density","#Rlt":"Distance","#Nne":"None","#Prc":"Percent","#Pxl":"Pixels","#Mlm":"Millimeters","#Pnt":"Points",RrPi:"Picas",RrIn:"Inches",RrCm:"Centimeters"},jc=aR(Tl);function ot(e,t){return{name:e,classID:t}}for(var Nt=ot("","null"),g4={strokeStyleContent:ot("","solidColorLayer"),printProofSetup:ot("Proof Setup","proofSetup"),Grad:ot("Gradient","Grdn"),Trnf:ot("Transform","Trnf"),patternFill:ot("","patternFill"),ebbl:ot("","ebbl"),SoFi:ot("","SoFi"),GrFl:ot("","GrFl"),sdwC:ot("","RGBC"),hglC:ot("","RGBC"),"Clr ":ot("","RGBC"),tintColor:ot("","RGBC"),Ofst:ot("","Pnt "),ChFX:ot("","ChFX"),MpgS:ot("","ShpC"),DrSh:ot("","DrSh"),IrSh:ot("","IrSh"),OrGl:ot("","OrGl"),IrGl:ot("","IrGl"),TrnS:ot("","ShpC"),Ptrn:ot("","Ptrn"),FrFX:ot("","FrFX"),phase:ot("","Pnt "),frameStep:Nt,duration:Nt,workInTime:Nt,workOutTime:Nt,audioClipGroupList:Nt,bounds:ot("","Rctn"),customEnvelopeWarp:ot("","customEnvelopeWarp"),warp:ot("","warp"),"Sz ":ot("","Pnt "),origin:ot("","Pnt "),autoExpandOffset:ot("","Pnt "),keyOriginShapeBBox:ot("","unitRect"),Vrsn:Nt,psVersion:Nt,docDefaultNewArtboardBackgroundColor:ot("","RGBC"),artboardRect:ot("","classFloatRect"),keyOriginRRectRadii:ot("","radii"),keyOriginBoxCorners:Nt,rectangleCornerA:ot("","Pnt "),rectangleCornerB:ot("","Pnt "),rectangleCornerC:ot("","Pnt "),rectangleCornerD:ot("","Pnt "),compInfo:Nt,quiltWarp:ot("","quiltWarp"),generatorSettings:Nt,crema:Nt,FrIn:Nt,blendOptions:Nt,FXRf:Nt,Lefx:Nt,time:Nt,animKey:Nt,timeScope:Nt,inTime:Nt,outTime:Nt,sheetStyle:Nt,translation:Nt,Skew:Nt,boundingBox:ot("","boundingBox"),"Lnk ":ot("","ExternalFileLink"),frameReader:ot("","FrameReader"),effectParams:ot("","motionTrackEffectParams"),Impr:ot("None","none"),Anch:ot("","Pnt "),"Fwd ":ot("","Pnt "),"Bwd ":ot("","Pnt "),FlrC:ot("","Pnt "),meshBoundaryPath:ot("","pathClass"),filterFX:ot("","filterFXStyle"),Fltr:ot("","rigidTransform"),FrgC:ot("","RGBC"),BckC:ot("","RGBC"),sdwM:ot("Parameters","adaptCorrectTones"),hglM:ot("Parameters","adaptCorrectTones"),customShape:ot("","customShape"),origFXRefPoint:Nt,FXRefPoint:Nt,ClMg:ot("","ClMg")},b4={"Crv ":ot("","CrPt"),Clrs:ot("","Clrt"),Trns:ot("","TrnS"),keyDescriptorList:Nt,solidFillMulti:ot("","SoFi"),gradientFillMulti:ot("","GrFl"),dropShadowMulti:ot("","DrSh"),innerShadowMulti:ot("","IrSh"),frameFXMulti:ot("","FrFX"),FrIn:Nt,FSts:Nt,LaSt:Nt,sheetTimelineOptions:Nt,trackList:ot("","animationTrack"),globalTrackList:ot("","animationTrack"),keyList:Nt,audioClipGroupList:Nt,audioClipList:Nt,countObjectList:ot("","countObject"),countGroupList:ot("","countGroup"),slices:ot("","slice"),"Pts ":ot("","Pthp"),SbpL:ot("","SbpL"),pathComponents:ot("","PaCm"),filterFXList:ot("","filterFX"),puppetShapeList:ot("","puppetShape"),channelDenoise:ot("","channelDenoiseParams"),ShrP:ot("","Pnt "),layerSettings:Nt,list:Nt,Adjs:ot("","CrvA")},y4={TEXT:["Txt ","printerName","Nm ","Idnt","blackAndWhitePresetFileName","LUT3DFileName","presetFileName","curvesPresetFileName","mixerPresetFileName","placed","description","reason","artboardPresetName","json","clipID","relPath","fullPath","mediaDescriptor","Msge","altTag","url","cellText","preset","KnNm","FPth","comment","originalPath"],tdta:["EngineData","LUT3DFileData","indexArray","originalVertexArray","deformedVertexArray","LqMe"],long:["TextIndex","RndS","Mdpn","Smth","Lctn","strokeStyleVersion","LaID","Vrsn","Cnt ","Brgh","Cntr","means","vibrance","Strt","bwPresetKind","comp","compID","originalCompID","curvesPresetKind","mixerPresetKind","uOrder","vOrder","PgNm","totalPages","Crop","numerator","denominator","frameCount","Annt","keyOriginType","unitValueQuadVersion","keyOriginIndex","major","minor","fix","docDefaultNewArtboardBackgroundType","artboardBackgroundType","numModifyingFX","deformNumRows","deformNumCols","FrID","FrDl","FsID","LCnt","AFrm","AFSt","numBefore","numAfter","Spcn","minOpacity","maxOpacity","BlnM","sheetID","gblA","globalAltitude","descVersion","frameReaderType","LyrI","zoomOrigin","fontSize","Rds ","sliceID","topOutset","leftOutset","bottomOutset","rightOutset","filterID","meshQuality","meshExpansion","meshRigidity","VrsM","VrsN","NmbG","WLMn","WLMx","AmMn","AmMx","SclH","SclV","Lvl ","TlNm","TlOf","FlRs","Thsh","ShrS","ShrE","FlRs","Vrnc","Strg","ExtS","ExtD","HrzS","VrtS","NmbR","EdgF","Ang1","Ang2","Ang3","Ang4","lastAppliedComp","capturedInfo"],enum:["textGridding","Ornt","warpStyle","warpRotate","Inte","Bltn","ClrS","BlrQ","bvlT","bvlS","bvlD","Md ","glwS","GrdF","GlwT","RplS","BlrM","SmBM","strokeStyleLineCapType","strokeStyleLineJoinType","strokeStyleLineAlignment","strokeStyleBlendMode","PntT","Styl","lookupType","LUTFormat","dataOrder","tableOrder","enableCompCore","enableCompCoreGPU","compCoreSupport","compCoreGPUSupport","Engn","enableCompCoreThreads","gs99","FrDs","trackID","animInterpStyle","horzAlign","vertAlign","bgColorType","shapeOperation","UndA","Wvtp","Drct","WndM","Edg ","FlCl","IntE","IntC","Cnvr","Fl ","Dstr","MztT","Lns ","ExtT","DspM","ExtR","ZZTy","SphM","SmBQ","placedLayerOCIOConversion","gradientsInterpolationMethod"],bool:["PstS","printSixteenBit","masterFXSwitch","enab","uglg","antialiasGloss","useShape","useTexture","uglg","antialiasGloss","useShape","Vsbl","useTexture","Algn","Rvrs","Dthr","Invr","VctC","ShTr","layerConceals","strokeEnabled","fillEnabled","strokeStyleScaleLock","strokeStyleStrokeAdjust","hardProof","MpBl","paperWhite","useLegacy","Auto","Lab ","useTint","keyShapeInvalidated","autoExpandEnabled","autoNestEnabled","autoPositionEnabled","shrinkwrapOnSaveEnabled","present","showInDialog","overprint","sheetDisclosed","lightsDisclosed","meshesDisclosed","materialsDisclosed","hasMotion","muted","Effc","selected","autoScope","fillCanvas","cellTextIsHTML","Smoo","Clsp","validAtPosition","rigidType","hasoptions","filterMaskEnable","filterMaskLinked","filterMaskExtendWithWhite","removeJPEGArtifact","Mnch","ExtF","ExtM","moreAccurate","GpuY","LIWy","Cnty"],doub:["warpValue","warpPerspective","warpPerspectiveOther","Intr","Wdth","Hght","strokeStyleMiterLimit","strokeStyleResolution","layerTime","keyOriginResolution","xx","xy","yx","yy","tx","ty","FrGA","frameRate","audioLevel","rotation","X ","Y ","redFloat","greenFloat","blueFloat","imageResolution","PuX0","PuX1","PuX2","PuX3","PuY0","PuY1","PuY2","PuY3"],UntF:["sdwO","hglO","lagl","Lald","srgR","blur","Sftn","Opct","Dstn","Angl","Ckmt","Nose","Inpr","ShdN","strokeStyleLineWidth","strokeStyleLineDashOffset","strokeStyleOpacity","H ","Top ","Left","Btom","Rght","Rslt","topRight","topLeft","bottomLeft","bottomRight","ClNs","Shrp"],VlLs:["Crv ","Clrs","Mnm ","Mxm ","Trns","pathList","strokeStyleLineDashSet","FrLs","slices","LaSt","Trnf","nonAffineTransform","keyDescriptorList","guideIndeces","gradientFillMulti","solidFillMulti","frameFXMulti","innerShadowMulti","dropShadowMulti","FrIn","FSts","FsFr","sheetTimelineOptions","audioClipList","trackList","globalTrackList","keyList","audioClipList","warpValues","selectedPin","Pts ","SbpL","pathComponents","pinOffsets","posFinalPins","pinVertexIndices","PinP","PnRt","PnOv","PnDp","filterFXList","puppetShapeList","ShrP","channelDenoise","Mtrx","layerSettings","list","compList","Adjs"],ObAr:["meshPoints","quiltSliceX","quiltSliceY"],"obj ":["null","Chnl"],"Pth ":["DspF"]},iR=["Rd ","Grn ","Bl ","Yllw","Ylw ","Cyn ","Mgnt","Blck","Gry ","Lmnc","A ","B "],_4={"Mnm ":"long","Mxm ":"long",FrLs:"long",strokeStyleLineDashSet:"UntF",Trnf:"doub",nonAffineTransform:"doub",keyDescriptorList:"Objc",gradientFillMulti:"Objc",solidFillMulti:"Objc",frameFXMulti:"Objc",innerShadowMulti:"Objc",dropShadowMulti:"Objc",LaSt:"Objc",FrIn:"Objc",FSts:"Objc",FsFr:"long",blendOptions:"Objc",sheetTimelineOptions:"Objc",keyList:"Objc",warpValues:"doub",selectedPin:"long","Pts ":"Objc",SbpL:"Objc",pathComponents:"Objc",pinOffsets:"doub",posFinalPins:"doub",pinVertexIndices:"long",PinP:"doub",PnRt:"long",PnOv:"bool",PnDp:"doub",filterFXList:"Objc",puppetShapeList:"Objc",ShrP:"Objc",channelDenoise:"Objc",Mtrx:"long",compList:"long",Chnl:"enum"},Gc={},bp=0,x4=Object.keys(y4);bp<x4.length;bp++)for(var w4=x4[bp],yp=0,k4=y4[w4];yp<k4.length;yp++){var ms=k4[yp];Gc[ms]=w4}for(var _p=0,S4=Object.keys(g4);_p<S4.length;_p++){var ms=S4[_p];Gc[ms]||(Gc[ms]="Objc")}for(var xp=0,C4=Object.keys(b4);xp<C4.length;xp++){var ms=C4[xp];_4[ms]="Objc"}function oR(e,t,r,n){return e==="presetKind"?typeof t=="string"?"enum":"long":e==="null"&&r==="slices"?"TEXT":e==="groupID"?r==="slices"?"long":"TEXT":e==="Sz "?"Wdth"in t?"Objc":"units"in t?"UntF":"doub":e==="Type"?typeof t=="string"?"enum":"long":e==="AntA"?typeof t=="string"?"enum":"bool":(e==="Hrzn"||e==="Vrtc")&&(n.Type==="keyType.Pstn"||n._classID==="Ofst")?"long":e==="Hrzn"||e==="Vrtc"||e==="Top "||e==="Left"||e==="Btom"||e==="Rght"?r==="slices"?"long":typeof t=="number"?"doub":"UntF":e==="Vrsn"?typeof t=="number"?"long":"Objc":e==="Rd "||e==="Grn "||e==="Bl "?r==="artd"?"long":"doub":e==="Trnf"?Array.isArray(t)?"VlLs":"Objc":Gc[e]}function pi(e){var t=dt(e);return tu(e,t||4)}function hi(e,t){if(t.length===4&&t!=="warp"&&t!=="time"&&t!=="hold"&&t!=="list")bt(e,0),yt(e,t);else{bt(e,t.length);for(var r=0;r<t.length;r++)Qe(e,t.charCodeAt(r))}}function E4(e,t){for(var r=xo(e),n=t?{_name:r.name,_classID:r.classID}:{},a=Ne(e),i=0;i<a;i++){var o=pi(e),s=lr(e),l=T4(e,s,t);n[o]=l}return n}function A4(e,t,r,n,a){So(e,t),hi(e,r);var i=Object.keys(n),o=i.length;"_name"in n&&o--,"_classID"in n&&o--,it(e,o);for(var s=0,l=i;s<l.length;s++){var c=l[s];if(!(c==="_name"||c==="_classID")){var u=oR(c,n[c],a,n),d=g4[c];c==="bounds"&&a==="text"?d=ot("","bounds"):c==="origin"?u=a==="slices"?"enum":"Objc":(c==="Cyn "||c==="Mgnt"||c==="Ylw "||c==="Blck")&&n._classID==="CMYC"?u="doub":/^PN[a-z][a-z]$/.test(c)?u="TEXT":/^PT[a-z][a-z]$/.test(c)?u="long":/^PF[a-z][a-z]$/.test(c)||(c==="Rds "||c==="Thsh")&&typeof n[c]=="number"&&n._classID==="SmrB"?u="doub":c==="ClSz"||c==="Rds "||c==="Amnt"?u=typeof n[c]=="number"?"long":"UntF":(c==="sdwM"||c==="hglM")&&typeof n[c]=="string"||c==="blur"&&typeof n[c]=="string"?u="enum":c==="Hght"&&typeof n[c]=="number"&&n._classID==="Embs"||c==="Angl"&&typeof n[c]=="number"&&(n._classID==="Embs"||n._classID==="smartSharpen"||n._classID==="Twrl"||n._classID==="MtnB")?u="long":c==="Angl"&&typeof n[c]=="number"?u="doub":c==="bounds"&&a==="slices"?(u="Objc",d=ot("","Rct1")):c==="Scl "?typeof n[c]=="object"&&"Hrzn"in n[c]?(u="Objc",d=Nt):typeof n[c]=="number"?u="long":u="UntF":c==="audioClipGroupList"&&i.length===1?u="VlLs":(c==="Strt"||c==="Brgh")&&"H "in n?u="doub":c==="Wdth"&&typeof n[c]=="object"?u="UntF":c==="Ofst"&&typeof n[c]=="number"?u="long":c==="Strt"&&typeof n[c]=="object"?(u="Objc",d=Nt):iR.indexOf(c)!==-1?u=r==="RGBC"&&a!=="artd"?"doub":"long":c==="profile"?u=r==="printOutput"?"TEXT":"tdta":c==="strokeStyleContent"?n[c]["Clr "]?d=ot("","solidColorLayer"):n[c].Grad?d=ot("","gradientLayer"):n[c].Ptrn&&(d=ot("","patternLayer")):c==="bounds"&&a==="quiltWarp"&&(d=ot("","classFloatRect")),d&&d.classID==="RGBC"&&"H "in n[c]&&(d={classID:"HSBC",name:""}),hi(e,c),yt(e,u||"long"),M4(e,u||"long",n[c],c,d,a)}}}function T4(e,t,r){switch(t){case"obj ":return lR(e);case"Objc":case"GlbO":return E4(e,r);case"VlLs":{for(var n=dt(e),a=[],i=0;i<n;i++){var o=lr(e);a.push(T4(e,o,r))}return a}case"doub":return Zn(e);case"UntF":{var s=lr(e),l=Zn(e);if(!Tl[s])throw new Error("Invalid units: ".concat(s));return{units:Tl[s],value:l}}case"UnFl":{var s=lr(e),l=la(e);if(!Tl[s])throw new Error("Invalid units: ".concat(s));return{units:Tl[s],value:l}}case"TEXT":return Rr(e);case"enum":{var c=pi(e),l=pi(e);return"".concat(c,".").concat(l)}case"long":return dt(e);case"comp":{var u=Ne(e),d=Ne(e);return{low:u,high:d}}case"bool":return!!at(e);case"type":case"GlbC":return xo(e);case"alis":{var f=dt(e);return tu(e,f)}case"tdta":{var p=dt(e);return Tr(e,p)}case"ObAr":{dt(e),Rr(e),pi(e);for(var _=dt(e),a=[],i=0;i<_;i++){var h=pi(e);lr(e),lr(e);for(var b=dt(e),v=[],m=0;m<b;m++)v.push(Zn(e));a.push({type:h,values:v})}return a}case"Pth ":{dt(e);var y=lr(e);qy(e);var g=qy(e),S=yR(e,g);return{sig:y,path:S}}default:throw new Error("Invalid TySh descriptor OSType: ".concat(t," at ").concat(e.offset.toString(16)))}}var sR={meshPoints:"rationalPoint",quiltSliceX:"UntF",quiltSliceY:"UntF"};function M4(e,t,r,n,a,i){switch(t){case"obj ":cR(e,n,r);break;case"Objc":case"GlbO":{if(typeof r!="object")throw new Error("Invalid struct value: ".concat(JSON.stringify(r),", key: ").concat(n));if(!a)throw new Error("Missing ext type for: '".concat(n,"' (").concat(JSON.stringify(r),")"));var o=r._name||a.name,s=r._classID||a.classID;A4(e,o,s,r,i);break}case"VlLs":if(!Array.isArray(r))throw new Error("Invalid list value: ".concat(JSON.stringify(r),", key: ").concat(n));bt(e,r.length);for(var l=0;l<r.length;l++){var c=_4[n];yt(e,c||"long"),M4(e,c||"long",r[l],"".concat(n,"[]"),b4[n],i)}break;case"doub":if(typeof r!="number")throw new Error("Invalid number value: ".concat(JSON.stringify(r),", key: ").concat(n));Jn(e,r);break;case"UntF":if(!jc[r.units])throw new Error("Invalid units: ".concat(r.units," in ").concat(n));yt(e,jc[r.units]),Jn(e,r.value);break;case"UnFl":if(!jc[r.units])throw new Error("Invalid units: ".concat(r.units," in ").concat(n));yt(e,jc[r.units]),fa(e,r.value);break;case"TEXT":So(e,r);break;case"enum":{if(typeof r!="string")throw new Error("Invalid enum value: ".concat(JSON.stringify(r),", key: ").concat(n));var u=r.split("."),d=u[0],f=u[1];hi(e,d),hi(e,f);break}case"long":if(typeof r!="number")throw new Error("Invalid integer value: ".concat(JSON.stringify(r),", key: ").concat(n));bt(e,r);break;case"bool":if(typeof r!="boolean")throw new Error("Invalid boolean value: ".concat(JSON.stringify(r),", key: ").concat(n));Qe(e,r?1:0);break;case"tdta":bt(e,r.byteLength),pa(e,r);break;case"ObAr":{bt(e,16),So(e,"");var p=sR[n];if(!p)throw new Error("Not implemented ObArType for: ".concat(n));hi(e,p),bt(e,r.length);for(var l=0;l<r.length;l++){hi(e,r[l].type),yt(e,"UnFl"),yt(e,"#Pxl"),bt(e,r[l].values.length);for(var _=0;_<r[l].values.length;_++)Jn(e,r[l].values[_])}break}case"Pth ":{var h=12+r.path.length*2;bt(e,h),yt(e,r.sig),O3(e,h),O3(e,r.path.length),sL(e,r.path);break}default:throw new Error("Not implemented descriptor OSType: ".concat(t))}}function lR(e){for(var t=dt(e),r=[],n=0;n<t;n++){var a=lr(e);switch(a){case"prop":{xo(e);var i=pi(e);r.push(i);break}case"Clss":r.push(xo(e));break;case"Enmr":{xo(e);var o=pi(e),s=pi(e);r.push("".concat(o,".").concat(s));break}case"rele":{xo(e),r.push(Ne(e));break}case"Idnt":r.push(dt(e));break;case"indx":r.push(dt(e));break;case"name":{xo(e),r.push(Rr(e));break}default:throw new Error("Invalid descriptor reference type: ".concat(a))}}return r}function cR(e,t,r){bt(e,r.length);for(var n=0;n<r.length;n++){var a=r[n],i="unknown";switch(typeof a=="string"&&(/^[a-z ]+\.[a-z ]+$/i.test(a)?i="Enmr":i="name"),yt(e,i),i){case"Enmr":{var o=a.split("."),s=o[0],l=o[1];D4(e,"\0",s),hi(e,s),hi(e,l);break}case"name":{D4(e,"\0","Lyr "),Bn(e,a+"\0");break}default:throw new Error("Invalid descriptor reference type: ".concat(i))}}return r}function xo(e){var t=Rr(e),r=pi(e);return{name:t,classID:r}}function D4(e,t,r){Bn(e,t),hi(e,r)}function Ft(e,t){t===void 0&&(t=!1);var r=Ne(e);if(r!==16)throw new Error("Invalid descriptor version: ".concat(r));var n=E4(e,t);return n}function Lt(e,t,r,n,a){a===void 0&&(a=""),it(e,16),A4(e,t,r,n,a)}function Ml(e){return{x:e.Hrzn,y:e.Vrtc}}function Dl(e){return{Hrzn:e.x,Vrtc:e.y}}function z4(e){return{top:Jt(e["Top "]),left:Jt(e.Left),right:Jt(e.Rght),bottom:Jt(e.Btom)}}function I4(e){var t;return t={Left:pr(e.left,"bounds.left")},t["Top "]=pr(e.top,"bounds.top"),t.Rght=pr(e.right,"bounds.right"),t.Btom=pr(e.bottom,"bounds.bottom"),t}function O4(e){var t={enabled:!!e.enab,position:Wc.decode(e.Styl),fillType:ey.decode(e.PntT),blendMode:bn.decode(e["Md "]),opacity:gt(e.Opct),size:Jt(e["Sz "])};return e.present!==void 0&&(t.present=e.present),e.showInDialog!==void 0&&(t.showInDialog=e.showInDialog),e.overprint!==void 0&&(t.overprint=e.overprint),e["Clr "]&&(t.color=oa(e["Clr "])),e.Grad&&(t.gradient=U4(e)),e.Ptrn&&(t.pattern=H4(e)),t}function P4(e){var t={};return t.enab=!!e.enabled,e.present!==void 0&&(t.present=!!e.present),e.showInDialog!==void 0&&(t.showInDialog=!!e.showInDialog),t.Styl=Wc.encode(e.position),t.PntT=ey.encode(e.fillType),t["Md "]=bn.encode(e.blendMode),t.Opct=Vr(e.opacity),t["Sz "]=pr(e.size,"size"),e.color&&(t["Clr "]=sa(e.color)),e.gradient&&(t=di(di({},t),j4(e.gradient))),e.pattern&&(t=di(di({},t),G4(e.pattern))),e.overprint!==void 0&&(t.overprint=!!e.overprint),t}function zl(e,t,r){for(var n,a,i,o=r?{"Scl ":Xn((n=e.scale)!==null&&n!==void 0?n:1),masterFXSwitch:!e.disabled}:{masterFXSwitch:!e.disabled,"Scl ":Xn((a=e.scale)!==null&&a!==void 0?a:1)},s=["dropShadow","innerShadow","solidFill","gradientOverlay","stroke"],l=0,c=s;l<c.length;l++){var u=c[l];if(e[u]&&!Array.isArray(e[u]))throw new Error("".concat(u," should be an array"))}var d=function(y){return!!y&&y.length>1&&r},f=function(y){return!!y&&y.length>=1&&(!r||y.length===1)};if(f(e.dropShadow)&&(o.DrSh=On(e.dropShadow[0],"dropShadow",t)),d(e.dropShadow)&&(o.dropShadowMulti=e.dropShadow.map(function(y){return On(y,"dropShadow",t)})),f(e.innerShadow)&&(o.IrSh=On(e.innerShadow[0],"innerShadow",t)),d(e.innerShadow)&&(o.innerShadowMulti=e.innerShadow.map(function(y){return On(y,"innerShadow",t)})),e.outerGlow&&(o.OrGl=On(e.outerGlow,"outerGlow",t)),d(e.solidFill)&&(o.solidFillMulti=e.solidFill.map(function(y){return On(y,"solidFill",t)})),d(e.gradientOverlay)&&(o.gradientFillMulti=e.gradientOverlay.map(function(y){return On(y,"gradientOverlay",t)})),d(e.stroke)&&(o.frameFXMulti=e.stroke.map(function(y){return P4(y)})),e.innerGlow&&(o.IrGl=On(e.innerGlow,"innerGlow",t)),e.bevel&&(o.ebbl=On(e.bevel,"bevel",t)),f(e.solidFill)&&(o.SoFi=On(e.solidFill[0],"solidFill",t)),e.patternOverlay&&(o.patternFill=On(e.patternOverlay,"patternOverlay",t)),f(e.gradientOverlay)&&(o.GrFl=On(e.gradientOverlay[0],"gradientOverlay",t)),e.satin&&(o.ChFX=On(e.satin,"satin",t)),f(e.stroke)&&(o.FrFX=P4((i=e.stroke)===null||i===void 0?void 0:i[0])),r){o.numModifyingFX=0;for(var p=0,_=Object.keys(e);p<_.length;p++){var u=_[p],h=e[u];if(Array.isArray(h))for(var b=0,v=h;b<v.length;b++){var m=v[b];m.enabled&&o.numModifyingFX++}else h.enabled&&o.numModifyingFX++}}return o}function Il(e,t){var r={},n=e.masterFXSwitch,a=e.DrSh,i=e.dropShadowMulti,o=e.IrSh,s=e.innerShadowMulti,l=e.OrGl,c=e.IrGl,u=e.ebbl,d=e.SoFi,f=e.solidFillMulti,p=e.patternFill,_=e.GrFl,h=e.gradientFillMulti,b=e.ChFX,v=e.FrFX,m=e.frameFXMulti;e.numModifyingFX;var y=nR(e,["masterFXSwitch","DrSh","dropShadowMulti","IrSh","innerShadowMulti","OrGl","IrGl","ebbl","SoFi","solidFillMulti","patternFill","GrFl","gradientFillMulti","ChFX","FrFX","frameFXMulti","numModifyingFX"]);return n||(r.disabled=!0),e["Scl "]&&(r.scale=gt(e["Scl "])),a&&(r.dropShadow=[In(a,t)]),i&&(r.dropShadow=i.map(function(g){return In(g,t)})),o&&(r.innerShadow=[In(o,t)]),s&&(r.innerShadow=s.map(function(g){return In(g,t)})),l&&(r.outerGlow=In(l,t)),c&&(r.innerGlow=In(c,t)),u&&(r.bevel=In(u,t)),d&&(r.solidFill=[In(d,t)]),f&&(r.solidFill=f.map(function(g){return In(g,t)})),p&&(r.patternOverlay=In(p,t)),_&&(r.gradientOverlay=[In(_,t)]),h&&(r.gradientOverlay=h.map(function(g){return In(g,t)})),b&&(r.satin=In(b,t)),v&&(r.stroke=[O4(v)]),m&&(r.stroke=m.map(function(g){return O4(g)})),t&&Object.keys(y).length>1&&console.log("Unhandled effect keys:",y),r}function F4(e,t){for(var r=[],n=0;n<e.length;n++){var a=e[n],i=a.time,o=i.denominator,s=i.numerator,l=a.selected,c=a.animKey,u={numerator:s,denominator:o},d=J4.decode(a.animInterpStyle);switch(c.Type){case"keyType.Opct":r.push({interpolation:d,time:u,selected:l,type:"opacity",value:gt(c.Opct)});break;case"keyType.Pstn":r.push({interpolation:d,time:u,selected:l,type:"position",x:c.Hrzn,y:c.Vrtc});break;case"keyType.Trnf":r.push({interpolation:d,time:u,selected:l,type:"transform",scale:Ml(c["Scl "]),skew:Ml(c.Skew),rotation:c.rotation,translation:Ml(c.translation)});break;case"keyType.sheetStyle":{var f={interpolation:d,time:u,selected:l,type:"style"};c.sheetStyle.Lefx&&(f.style=Il(c.sheetStyle.Lefx,t)),r.push(f);break}case"keyType.globalLighting":{r.push({interpolation:d,time:u,selected:l,type:"globalLighting",globalAngle:c.gblA,globalAltitude:c.globalAltitude});break}default:throw new Error("Unsupported keyType value")}}return r}function R4(e){for(var t=[],r=0;r<e.length;r++){var n=e[r],a=n.time,i=n.selected,o=i===void 0?!1:i,s=n.interpolation,l=J4.encode(s),c=void 0;switch(n.type){case"opacity":c={Type:"keyType.Opct",Opct:Vr(n.value)};break;case"position":c={Type:"keyType.Pstn",Hrzn:n.x,Vrtc:n.y};break;case"transform":c={Type:"keyType.Trnf","Scl ":Dl(n.scale),Skew:Dl(n.skew),rotation:n.rotation,translation:Dl(n.translation)};break;case"style":c={Type:"keyType.sheetStyle",sheetStyle:{Vrsn:1,blendOptions:{}}},n.style&&(c.sheetStyle={Vrsn:1,Lefx:zl(n.style,!1,!1),blendOptions:{}});break;case"globalLighting":{c={Type:"keyType.globalLighting",gblA:n.globalAngle,globalAltitude:n.globalAltitude};break}default:throw new Error("Unsupported keyType value")}t.push({Vrsn:1,animInterpStyle:l,time:a,animKey:c,selected:o})}return t}function L4(e,t){for(var r=[],n=0;n<e.length;n++){var a=e[n],i={type:Q4.decode(a.trackID),enabled:a.enab,keys:F4(a.keyList,t)};a.effectParams&&(i.effectParams={fillCanvas:a.effectParams.fillCanvas,zoomOrigin:a.effectParams.zoomOrigin,keys:F4(a.effectParams.keyList,t)}),r.push(i)}return r}function B4(e){for(var t=[],r=0;r<e.length;r++){var n=e[r];t.push(di(di({trackID:Q4.encode(n.type),Vrsn:1,enab:!!n.enabled,Effc:!!n.effectParams},n.effectParams?{effectParams:{keyList:R4(n.keys),fillCanvas:n.effectParams.fillCanvas,zoomOrigin:n.effectParams.zoomOrigin}}:{}),{keyList:R4(n.keys)}))}return t}function In(e,t){for(var r={},n=0,a=Object.keys(e);n<a.length;n++){var i=a[n],o=e[i];switch(i){case"enab":r.enabled=!!o;break;case"uglg":r.useGlobalLight=!!o;break;case"AntA":r.antialiased=!!o;break;case"Algn":r.align=!!o;break;case"Dthr":r.dither=!!o;break;case"Invr":r.invert=!!o;break;case"Rvrs":r.reverse=!!o;break;case"Clr ":r.color=oa(o);break;case"hglC":r.highlightColor=oa(o);break;case"sdwC":r.shadowColor=oa(o);break;case"Styl":r.position=Wc.decode(o);break;case"Md ":r.blendMode=bn.decode(o);break;case"hglM":r.highlightBlendMode=bn.decode(o);break;case"sdwM":r.shadowBlendMode=bn.decode(o);break;case"bvlS":r.style=K4.decode(o);break;case"bvlD":r.direction=Y4.decode(o);break;case"bvlT":r.technique=W4.decode(o);break;case"GlwT":r.technique=X4.decode(o);break;case"glwS":r.source=Z4.decode(o);break;case"Type":r.type=qc.decode(o);break;case"gs99":r.interpolationMethod=gs.decode(o);break;case"Opct":r.opacity=gt(o);break;case"hglO":r.highlightOpacity=gt(o);break;case"sdwO":r.shadowOpacity=gt(o);break;case"lagl":r.angle=ji(o);break;case"Angl":r.angle=ji(o);break;case"Lald":r.altitude=ji(o);break;case"Sftn":r.soften=Jt(o);break;case"srgR":r.strength=gt(o);break;case"blur":r.size=Jt(o);break;case"Nose":r.noise=gt(o);break;case"Inpr":r.range=gt(o);break;case"Ckmt":r.choke=Jt(o);break;case"ShdN":r.jitter=gt(o);break;case"Dstn":r.distance=Jt(o);break;case"Scl ":r.scale=gt(o);break;case"Ptrn":r.pattern={name:o["Nm "],id:o.Idnt};break;case"phase":r.phase={x:o.Hrzn,y:o.Vrtc};break;case"Ofst":r.offset={x:gt(o.Hrzn),y:gt(o.Vrtc)};break;case"MpgS":case"TrnS":r.contour={name:o["Nm "],curve:o["Crv "].map(function(s){return{x:s.Hrzn,y:s.Vrtc}})};break;case"Grad":r.gradient=$4(o);break;case"useTexture":case"useShape":case"layerConceals":case"present":case"showInDialog":case"antialiasGloss":r[i]=o;break;case"_name":case"_classID":break;default:t&&console.log("Invalid effect key: '".concat(i,"', value:"),o)}}return r}function On(e,t,r){var n={enab:!1};t==="dropShadow"&&(n.TrnS={"Nm ":"","Crv ":[]});for(var a=0,i=Object.keys(e);a<i.length;a++){var o=i[a],s=o,l=e[s];switch(s){case"enabled":n.enab=!!l;break;case"useGlobalLight":n.uglg=!!l;break;case"antialiased":n.AntA=!!l;break;case"align":n.Algn=!!l;break;case"dither":n.Dthr=!!l;break;case"invert":n.Invr=!!l;break;case"reverse":n.Rvrs=!!l;break;case"color":n["Clr "]=sa(l);break;case"highlightColor":n.hglC=sa(l);break;case"shadowColor":n.sdwC=sa(l);break;case"position":n.Styl=Wc.encode(l);break;case"blendMode":n["Md "]=bn.encode(l);break;case"highlightBlendMode":n.hglM=bn.encode(l);break;case"shadowBlendMode":n.sdwM=bn.encode(l);break;case"style":n.bvlS=K4.encode(l);break;case"direction":n.bvlD=Y4.encode(l);break;case"technique":t==="bevel"?n.bvlT=W4.encode(l):n.GlwT=X4.encode(l);break;case"source":n.glwS=Z4.encode(l);break;case"type":n.Type=qc.encode(l);break;case"interpolationMethod":n.gs99=gs.encode(l);break;case"opacity":n.Opct=Vr(l);break;case"highlightOpacity":n.hglO=Vr(l);break;case"shadowOpacity":n.sdwO=Vr(l);break;case"angle":t==="gradientOverlay"||t==="patternFill"?n.Angl=Fl(l):n.lagl=Fl(l);break;case"altitude":n.Lald=Fl(l);break;case"soften":n.Sftn=pr(l,s);break;case"strength":n.srgR=Vr(l);break;case"size":n.blur=pr(l,s);break;case"noise":n.Nose=Vr(l);break;case"range":n.Inpr=Vr(l);break;case"choke":n.Ckmt=pr(l,s);break;case"jitter":n.ShdN=Vr(l);break;case"distance":n.Dstn=pr(l,s);break;case"scale":n["Scl "]=Vr(l);break;case"pattern":n.Ptrn={"Nm ":l.name,Idnt:l.id};break;case"phase":n.phase={Hrzn:l.x,Vrtc:l.y};break;case"offset":n.Ofst={Hrzn:Vr(l.x),Vrtc:Vr(l.y)};break;case"contour":{n[t==="satin"?"MpgS":"TrnS"]={"Nm ":l.name,"Crv ":l.curve.map(function(c){return{Hrzn:c.x,Vrtc:c.y}})};break}case"gradient":n.Grad=N4(l);break;case"useTexture":case"useShape":case"layerConceals":case"present":case"showInDialog":case"antialiasGloss":n[s]=l;break;default:r&&console.log("Invalid effect key: '".concat(s,"', value:"),l)}}return n}function $4(e){if(e.GrdF==="GrdF.CstS"){var t=e.Intr||4096;return{type:"solid",name:e["Nm "],smoothness:e.Intr/4096,colorStops:e.Clrs.map(function(r){return{color:oa(r["Clr "]),location:r.Lctn/t,midpoint:r.Mdpn/100}}),opacityStops:e.Trns.map(function(r){return{opacity:gt(r.Opct),location:r.Lctn/t,midpoint:r.Mdpn/100}})}}else return{type:"noise",name:e["Nm "],roughness:e.Smth/4096,colorModel:Kc.decode(e.ClrS),randomSeed:e.RndS,restrictColors:!!e.VctC,addTransparency:!!e.ShTr,min:e["Mnm "].map(function(r){return r/100}),max:e["Mxm "].map(function(r){return r/100})}}function N4(e){var t,r;if(e.type==="solid"){var n=Math.round(((t=e.smoothness)!==null&&t!==void 0?t:1)*4096);return{"Nm ":e.name||"",GrdF:"GrdF.CstS",Intr:n,Clrs:e.colorStops.map(function(a){var i;return{"Clr ":sa(a.color),Type:"Clry.UsrS",Lctn:Math.round(a.location*n),Mdpn:Math.round(((i=a.midpoint)!==null&&i!==void 0?i:.5)*100)}}),Trns:e.opacityStops.map(function(a){var i;return{Opct:Vr(a.opacity),Lctn:Math.round(a.location*n),Mdpn:Math.round(((i=a.midpoint)!==null&&i!==void 0?i:.5)*100)}})}}else return{GrdF:"GrdF.ClNs","Nm ":e.name||"",ShTr:!!e.addTransparency,VctC:!!e.restrictColors,ClrS:Kc.encode(e.colorModel),RndS:e.randomSeed||0,Smth:Math.round(((r=e.roughness)!==null&&r!==void 0?r:1)*4096),"Mnm ":(e.min||[0,0,0,0]).map(function(a){return a*100}),"Mxm ":(e.max||[1,1,1,1]).map(function(a){return a*100})}}function U4(e){var t=$4(e.Grad);return t.style=qc.decode(e.Type),e.Dthr!==void 0&&(t.dither=e.Dthr),e.gradientsInterpolationMethod!==void 0&&(t.interpolationMethod=gs.decode(e.gradientsInterpolationMethod)),e.Rvrs!==void 0&&(t.reverse=e.Rvrs),e.Angl!==void 0&&(t.angle=ji(e.Angl)),e["Scl "]!==void 0&&(t.scale=gt(e["Scl "])),e.Algn!==void 0&&(t.align=e.Algn),e.Ofst!==void 0&&(t.offset={x:gt(e.Ofst.Hrzn),y:gt(e.Ofst.Vrtc)}),t}function H4(e){var t={name:e.Ptrn["Nm "],id:e.Ptrn.Idnt};return e.Lnkd!==void 0&&(t.linked=e.Lnkd),e.phase!==void 0&&(t.phase={x:e.phase.Hrzn,y:e.phase.Vrtc}),t}function Ol(e){if("Grad"in e)return U4(e);if("Ptrn"in e)return di({type:"pattern"},H4(e));if("Clr "in e)return{type:"color",color:oa(e["Clr "])};throw new Error("Invalid vector content")}function j4(e){var t={};return e.dither!==void 0&&(t.Dthr=e.dither),e.interpolationMethod!==void 0&&(t.gradientsInterpolationMethod=gs.encode(e.interpolationMethod)),e.reverse!==void 0&&(t.Rvrs=e.reverse),e.angle!==void 0&&(t.Angl=Fl(e.angle)),t.Type=qc.encode(e.style),e.align!==void 0&&(t.Algn=e.align),e.scale!==void 0&&(t["Scl "]=Vr(e.scale)),e.offset&&(t.Ofst={Hrzn:Vr(e.offset.x),Vrtc:Vr(e.offset.y)}),t.Grad=N4(e),t}function G4(e){var t={Ptrn:{"Nm ":e.name||"",Idnt:e.id||""}};return e.linked!==void 0&&(t.Lnkd=!!e.linked),e.phase!==void 0&&(t.phase={Hrzn:e.phase.x,Vrtc:e.phase.y}),t}function Pl(e){return e.type==="color"?{key:"SoCo",descriptor:{"Clr ":sa(e.color)}}:e.type==="pattern"?{key:"PtFl",descriptor:G4(e)}:{key:"GdFl",descriptor:j4(e)}}function oa(e){if("H "in e)return{h:uR(e["H "]),s:e.Strt,b:e.Brgh};if("Rd "in e)return{r:e["Rd "],g:e["Grn "],b:e["Bl "]};if("Cyn "in e)return{c:e["Cyn "],m:e.Mgnt,y:e["Ylw "],k:e.Blck};if("Gry "in e)return{k:e["Gry "]};if("Lmnc"in e)return{l:e.Lmnc,a:e["A "],b:e["B "]};if("redFloat"in e)return{fr:e.redFloat,fg:e.greenFloat,fb:e.blueFloat};throw new Error("Unsupported color descriptor")}function sa(e){if(e){if("r"in e)return{_name:"",_classID:"RGBC","Rd ":e.r||0,"Grn ":e.g||0,"Bl ":e.b||0};if("fr"in e)return{_name:"",_classID:"RGBC",redFloat:e.fr,greenFloat:e.fg,blueFloat:e.fb};if("h"in e)return{_name:"",_classID:"HSBC","H ":Fl(e.h*360),Strt:e.s||0,Brgh:e.b||0};if("c"in e)return{_name:"",_classID:"CMYC","Cyn ":e.c||0,Mgnt:e.m||0,"Ylw ":e.y||0,Blck:e.k||0};if("l"in e)return{_name:"",_classID:"LABC",Lmnc:e.l||0,"A ":e.a||0,"B ":e.b||0};if("k"in e)return{_name:"",_classID:"GRYC","Gry ":e.k};throw new Error("Invalid color value")}else return{_name:"",_classID:"RGBC","Rd ":0,"Grn ":0,"Bl ":0}}function ji(e){if(e===void 0)return 0;if(e.units!=="Angle")throw new Error("Invalid units: ".concat(e.units));return e.value}function gt(e){if(e===void 0)return 1;if(e.units!=="Percent")throw new Error("Invalid units: ".concat(e.units));return e.value/100}function uR(e){if(e===void 0)return 1;if(e.units==="Percent")return e.value/100;if(e.units==="Angle")return e.value/360;throw new Error("Invalid units: ".concat(e.units))}function Jt(e){var t=e.units,r=e.value;if(t!=="Pixels"&&t!=="Millimeters"&&t!=="Points"&&t!=="None"&&t!=="Picas"&&t!=="Inches"&&t!=="Centimeters"&&t!=="Density")throw new Error("Invalid units: ".concat(JSON.stringify({units:t,value:r})));return{value:r,units:t}}function Gi(e,t){return t===void 0&&(t="Pixels"),typeof e=="number"?{value:e,units:t}:Jt(e)}function Vc(e,t){var r=e.units,n=e.value;if(r!==t)throw new Error("Invalid units: ".concat(JSON.stringify({units:r,value:n})));return n}function Fl(e){return{units:"Angle",value:e||0}}function Vr(e){return{units:"Percent",value:Math.round((e||0)*100)}}function Xn(e){return{units:"Percent",value:(e||0)*100}}function pr(e,t){if(e==null)return{units:"Pixels",value:0};if(typeof e!="object")throw new Error("Invalid value: ".concat(JSON.stringify(e)," (key: ").concat(t,") (should have value and units)"));var r=e.units,n=e.value;if(typeof n!="number")throw new Error("Invalid value in ".concat(JSON.stringify(e)," (key: ").concat(t,")"));if(r!=="Pixels"&&r!=="Millimeters"&&r!=="Points"&&r!=="None"&&r!=="Picas"&&r!=="Inches"&&r!=="Centimeters"&&r!=="Density")throw new Error("Invalid units in ".concat(JSON.stringify(e)," (key: ").concat(t,")"));return{units:r,value:n}}function gn(e){var t=e.numerator,r=e.denominator;return{numerator:t,denominator:r}}var V4=_t("textGridding","none",{none:"None",round:"Rnd "}),Rl=_t("Ornt","horizontal",{horizontal:"Hrzn",vertical:"Vrtc"}),q4=_t("Annt","sharp",{none:"Anno",sharp:"antiAliasSharp",crisp:"AnCr",strong:"AnSt",smooth:"AnSm",platform:"antiAliasPlatformGray",platformLCD:"antiAliasPlatformLCD"}),wp=_t("warpStyle","none",{none:"warpNone",arc:"warpArc",arcLower:"warpArcLower",arcUpper:"warpArcUpper",arch:"warpArch",bulge:"warpBulge",shellLower:"warpShellLower",shellUpper:"warpShellUpper",flag:"warpFlag",wave:"warpWave",fish:"warpFish",rise:"warpRise",fisheye:"warpFisheye",inflate:"warpInflate",squeeze:"warpSqueeze",twist:"warpTwist",cylinder:"warpCylinder",custom:"warpCustom"}),bn=_t("BlnM","normal",{normal:"Nrml",dissolve:"Dslv",darken:"Drkn",multiply:"Mltp","color burn":"CBrn","linear burn":"linearBurn","darker color":"darkerColor",lighten:"Lghn",screen:"Scrn","color dodge":"CDdg","linear dodge":"linearDodge","lighter color":"lighterColor",overlay:"Ovrl","soft light":"SftL","hard light":"HrdL","vivid light":"vividLight","linear light":"linearLight","pin light":"pinLight","hard mix":"hardMix",difference:"Dfrn",exclusion:"Xclu",subtract:"blendSubtraction",divide:"blendDivide",hue:"H ",saturation:"Strt",color:"Clr ",luminosity:"Lmns","linear height":"linearHeight",height:"Hght",subtraction:"Sbtr"}),K4=_t("BESl","inner bevel",{"inner bevel":"InrB","outer bevel":"OtrB",emboss:"Embs","pillow emboss":"PlEb","stroke emboss":"strokeEmboss"}),W4=_t("bvlT","smooth",{smooth:"SfBL","chisel hard":"PrBL","chisel soft":"Slmt"}),Y4=_t("BESs","up",{up:"In ",down:"Out "}),X4=_t("BETE","softer",{softer:"SfBL",precise:"PrBL"}),Z4=_t("IGSr","edge",{edge:"SrcE",center:"SrcC"}),qc=_t("GrdT","linear",{linear:"Lnr ",radial:"Rdl ",angle:"Angl",reflected:"Rflc",diamond:"Dmnd"}),J4=_t("animInterpStyle","linear",{linear:"Lnr ",hold:"hold"}),Q4=_t("stdTrackID","opacity",{opacity:"opacityTrack",style:"styleTrack",sheetTransform:"sheetTransformTrack",sheetPosition:"sheetPositionTrack",globalLighting:"globalLightingTrack"}),gs=_t("gradientInterpolationMethodType","perceptual",{perceptual:"Perc",linear:"Lnr ",classic:"Gcls",smooth:"Smoo"}),Kc=_t("ClrS","rgb",{rgb:"RGBC",hsb:"HSBl",lab:"LbCl",hsl:"HSLC"}),Wc=_t("FStl","outside",{outside:"OutF",center:"CtrF",inside:"InsF"}),ey=_t("FrFl","color",{color:"SClr",gradient:"GrFl",pattern:"Ptrn"}),ty=_t("ESliceType","image",{image:"Img ",noImage:"noImage"}),ry=_t("ESliceHorzAlign","default",{default:"default"}),ny=_t("ESliceVertAlign","default",{default:"default"}),ay=_t("ESliceOrigin","userGenerated",{userGenerated:"userGenerated",autoGenerated:"autoGenerated",layer:"layer"}),iy=_t("ESliceBGColorType","none",{none:"None",matte:"matte",color:"Clr "}),oy=_t("strokeStyleLineCapType","butt",{butt:"strokeStyleButtCap",round:"strokeStyleRoundCap",square:"strokeStyleSquareCap"}),sy=_t("strokeStyleLineJoinType","miter",{miter:"strokeStyleMiterJoin",round:"strokeStyleRoundJoin",bevel:"strokeStyleBevelJoin"}),ly=_t("strokeStyleLineAlignment","inside",{inside:"strokeStyleAlignInside",center:"strokeStyleAlignCenter",outside:"strokeStyleAlignOutside"}),cy=_t("BlrM","ispinmage",{spin:"Spn ",zoom:"Zm "}),uy=_t("BlrQ","good",{draft:"Drft",good:"Gd ",best:"Bst "}),fy=_t("SmBM","normal",{normal:"SBMN","edge only":"SBME","overlay edge":"SBMO"}),dy=_t("SmBQ","medium",{low:"SBQL",medium:"SBQM",high:"SBQH"}),py=_t("DspM","stretch to fit",{"stretch to fit":"StrF",tile:"Tile"}),bs=_t("UndA","repeat edge pixels",{"wrap around":"WrpA","repeat edge pixels":"RptE"}),hy=_t("Cnvr","rectangular to polar",{"rectangular to polar":"RctP","polar to rectangular":"PlrR"}),vy=_t("RplS","medium",{small:"Sml ",medium:"Mdm ",large:"Lrg "}),my=_t("SphM","normal",{normal:"Nrml","horizontal only":"HrzO","vertical only":"VrtO"}),gy=_t("Wvtp","sine",{sine:"WvSn",triangle:"WvTr",square:"WvSq"}),by=_t("ZZTy","pond ripples",{"around center":"ArnC","out from center":"OtFr","pond ripples":"PndR"}),yy=_t("Dstr","uniform",{uniform:"Unfr",gaussian:"Gsn "}),Ll=_t("Chnl","composite",{red:"Rd ",green:"Grn ",blue:"Bl ",composite:"Cmps"}),_y=_t("MztT","fine dots",{"fine dots":"FnDt","medium dots":"MdmD","grainy dots":"GrnD","coarse dots":"CrsD","short lines":"ShrL","medium lines":"MdmL","long lines":"LngL","short strokes":"ShSt","medium strokes":"MdmS","long strokes":"LngS"}),xy=_t("Lns ","50-300mm zoom",{"50-300mm zoom":"Zm ","32mm prime":"Nkn ","105mm prime":"Nkn1","movie prime":"PnVs"}),wy=_t("blurType","gaussian blur",{"gaussian blur":"GsnB","lens blur":"lensBlur","motion blur":"MtnB"}),ky=_t("DfsM","normal",{normal:"Nrml","darken only":"DrkO","lighten only":"LghO",anisotropic:"anisotropic"}),Sy=_t("ExtT","blocks",{blocks:"Blks",pyramids:"Pyrm"}),Cy=_t("ExtR","random",{random:"Rndm","level-based":"LvlB"}),Ey=_t("FlCl","background color",{"background color":"FlBc","foreground color":"FlFr","inverse image":"FlIn","unaltered image":"FlSm"}),Ay=_t("CntE","upper",{lower:"Lwr ",upper:"Upr "}),Ty=_t("WndM","wind",{wind:"Wnd ",blast:"Blst",stagger:"Stgr"}),My=_t("Drct","from the right",{left:"Left",right:"Rght"}),Dy=_t("IntE","odd lines",{"odd lines":"ElmO","even lines":"ElmE"}),zy=_t("IntC","interpolation",{duplication:"CrtD",interpolation:"CrtI"}),Iy=_t("FlMd","wrap around",{"set to transparent":"Bckg","repeat edge pixels":"Rpt ","wrap around":"Wrp "});_t("prjM","fisheye",{fisheye:"fisP",perspective:"perP",auto:"auto","full spherical":"fusP"});var Oy=_t("presetKindType","presetKindCustom",{custom:"presetKindCustom",default:"presetKindDefault"}),ys=function(){return ys=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++){t=arguments[r];for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a])}return e},ys.apply(this,arguments)},Py=[],Fy={};function Gt(e,t,r,n){var a={key:e,has:t,read:r,write:n};Py.push(a),Fy[a.key]=a}var Yc=[void 0,"PPI","PPCM"],Xc=[void 0,"Inches","Centimeters","Points","Picas","Columns"],Ry="0123456789abcdef";function Ly(e){return e<=57?e-48:e-87}function fR(e,t){return Ly(e.charCodeAt(t))<<4|Ly(e.charCodeAt(t+1))}function kp(e,t){var r=Tr(e,t);return m4(r)}function Sp(e,t){var r=v4(t);pa(e,r)}function dR(e){for(var t=at(e),r=Tr(e,t),n=!1,a=0;a<r.byteLength;a++)if(r[a]&128){n=!0;break}if(n){var i=new TextDecoder("gbk");return i.decode(r)}else return m4(r)}function pR(e,t){for(var r="",n=0,a=t.codePointAt(n++);a!==void 0;a=t.codePointAt(n++))r+=a>127?"?":String.fromCodePoint(a);var i=v4(r);Qe(e,i.byteLength),pa(e,i)}Gt(1061,function(e){return e.captionDigest!==void 0},function(e,t){for(var r="",n=0;n<16;n++){var a=at(e);r+=Ry[a>>4],r+=Ry[a&15]}t.captionDigest=r},function(e,t){for(var r=0;r<16;r++)Qe(e,fR(t.captionDigest,r*2))}),Gt(1060,function(e){return e.xmpMetadata!==void 0},function(e,t,r){t.xmpMetadata=kp(e,r())},function(e,t){Sp(e,t.xmpMetadata)});var Zc=_t("Inte","perceptual",{perceptual:"Img ",saturation:"Grp ","relative colorimetric":"Clrm","absolute colorimetric":"AClr"});Gt(1082,function(e){return e.printInformation!==void 0},function(e,t){var r,n,a=Ft(e);t.printInformation={printerName:a.printerName||"",renderingIntent:Zc.decode((r=a.Inte)!==null&&r!==void 0?r:"Inte.Img ")};var i=t.printInformation;a.PstS!==void 0&&(i.printerManagesColors=a.PstS),a["Nm "]!==void 0&&(i.printerProfile=a["Nm "]),a.MpBl!==void 0&&(i.blackPointCompensation=a.MpBl),a.printSixteenBit!==void 0&&(i.printSixteenBit=a.printSixteenBit),a.hardProof!==void 0&&(i.hardProof=a.hardProof),a.printProofSetup&&("Bltn"in a.printProofSetup?i.proofSetup={builtin:a.printProofSetup.Bltn.split(".")[1]}:i.proofSetup={profile:a.printProofSetup.profile,renderingIntent:Zc.decode((n=a.printProofSetup.Inte)!==null&&n!==void 0?n:"Inte.Img "),blackPointCompensation:!!a.printProofSetup.MpBl,paperWhite:!!a.printProofSetup.paperWhite})},function(e,t){var r,n,a=t.printInformation,i={};a.printerManagesColors?i.PstS=!0:(a.hardProof!==void 0&&(i.hardProof=!!a.hardProof),i.ClrS="ClrS.RGBC",i["Nm "]=(r=a.printerProfile)!==null&&r!==void 0?r:"CIE RGB"),i.Inte=Zc.encode(a.renderingIntent),a.printerManagesColors||(i.MpBl=!!a.blackPointCompensation),i.printSixteenBit=!!a.printSixteenBit,i.printerName=a.printerName||"",a.proofSetup&&"profile"in a.proofSetup?i.printProofSetup={profile:a.proofSetup.profile||"",Inte:Zc.encode(a.proofSetup.renderingIntent),MpBl:!!a.proofSetup.blackPointCompensation,paperWhite:!!a.proofSetup.paperWhite}:i.printProofSetup={Bltn:!((n=a.proofSetup)===null||n===void 0)&&n.builtin?"builtinProof.".concat(a.proofSetup.builtin):"builtinProof.proofCMYK"},Lt(e,"","printOutput",i)}),Gt(1005,function(e){return e.resolutionInfo!==void 0},function(e,t){var r=Pn(e),n=et(e),a=et(e),i=Pn(e),o=et(e),s=et(e);t.resolutionInfo={horizontalResolution:r,horizontalResolutionUnit:Yc[n]||"PPI",widthUnit:Xc[a]||"Inches",verticalResolution:i,verticalResolutionUnit:Yc[o]||"PPI",heightUnit:Xc[s]||"Inches"}},function(e,t){var r=t.resolutionInfo;Ln(e,r.horizontalResolution||0),Ve(e,Math.max(1,Yc.indexOf(r.horizontalResolutionUnit))),Ve(e,Math.max(1,Xc.indexOf(r.widthUnit))),Ln(e,r.verticalResolution||0),Ve(e,Math.max(1,Yc.indexOf(r.verticalResolutionUnit))),Ve(e,Math.max(1,Xc.indexOf(r.heightUnit)))});var By=["centered","size to fit","user defined"];Gt(1062,function(e){return e.printScale!==void 0},function(e,t){t.printScale={style:By[Ot(e)],x:la(e),y:la(e),scale:la(e)}},function(e,t){var r=t.printScale,n=r.style,a=r.x,i=r.y,o=r.scale;Vt(e,Math.max(0,By.indexOf(n))),fa(e,a||0),fa(e,i||0),fa(e,o||0)}),Gt(1006,function(e){return e.alphaChannelNames!==void 0},function(e,t,r){if(t.alphaChannelNames)ct(e,r());else for(t.alphaChannelNames=[];r()>0;){var n=dR(e);t.alphaChannelNames.push(n)}},function(e,t){for(var r=0,n=t.alphaChannelNames;r<n.length;r++){var a=n[r];pR(e,a)}}),Gt(1045,function(e){return e.alphaChannelNames!==void 0},function(e,t,r){for(t.alphaChannelNames=[];r()>0;)t.alphaChannelNames.push(Rr(e))},function(e,t){for(var r=0,n=t.alphaChannelNames;r<n.length;r++){var a=n[r];So(e,a)}}),Gt(1053,function(e){return e.alphaIdentifiers!==void 0},function(e,t,r){for(t.alphaIdentifiers=[];r()>=4;)t.alphaIdentifiers.push(Ne(e))},function(e,t){for(var r=0,n=t.alphaIdentifiers;r<n.length;r++){var a=n[r];it(e,a)}}),Gt(1010,function(e){return e.backgroundColor!==void 0},function(e,t){return t.backgroundColor=qr(e)},function(e,t){return Kr(e,t.backgroundColor)}),Gt(1037,function(e){return e.globalAngle!==void 0},function(e,t){return t.globalAngle=dt(e)},function(e,t){return bt(e,t.globalAngle)}),Gt(1049,function(e){return e.globalAltitude!==void 0},function(e,t){return t.globalAltitude=Ne(e)},function(e,t){return it(e,t.globalAltitude)}),Gt(1011,function(e){return e.printFlags!==void 0},function(e,t){t.printFlags={labels:!!at(e),cropMarks:!!at(e),colorBars:!!at(e),registrationMarks:!!at(e),negative:!!at(e),flip:!!at(e),interpolate:!!at(e),caption:!!at(e),printFlags:!!at(e)}},function(e,t){var r=t.printFlags;Qe(e,r.labels?1:0),Qe(e,r.cropMarks?1:0),Qe(e,r.colorBars?1:0),Qe(e,r.registrationMarks?1:0),Qe(e,r.negative?1:0),Qe(e,r.flip?1:0),Qe(e,r.interpolate?1:0),Qe(e,r.caption?1:0),Qe(e,r.printFlags?1:0)}),Gt(1034,function(e){return e.copyrighted!==void 0},function(e,t){t.copyrighted=!!at(e)},function(e,t){Qe(e,t.copyrighted?1:0)}),Gt(1035,function(e){return e.url!==void 0},function(e,t,r){t.url=tu(e,r())},function(e,t){iL(e,t.url)}),Gt(1080,function(e){return e.countInformation!==void 0},function(e,t){var r=Ft(e);t.countInformation=r.countGroupList.map(function(n){return{color:{r:n["Rd "],g:n["Grn "],b:n["Bl "]},name:n["Nm "],size:n["Rds "],fontSize:n.fontSize,visible:n.Vsbl,points:n.countObjectList.map(function(a){return{x:a["X "],y:a["Y "]}})}})},function(e,t){var r={Vrsn:1,countGroupList:t.countInformation.map(function(n){return{"Rd ":n.color.r,"Grn ":n.color.g,"Bl ":n.color.b,"Nm ":n.name,"Rds ":n.size,fontSize:n.fontSize,Vsbl:n.visible,countObjectList:n.points.map(function(a){return{"X ":a.x,"Y ":a.y}})}})};Lt(e,"","Cnt ",r)}),Gt(1024,function(e){return e.layerState!==void 0},function(e,t){return t.layerState=et(e)},function(e,t){return Ve(e,t.layerState)}),Gt(1026,function(e){return e.layersGroup!==void 0},function(e,t,r){for(t.layersGroup=[];r()>0;)t.layersGroup.push(et(e))},function(e,t){for(var r=0,n=t.layersGroup;r<n.length;r++){var a=n[r];Ve(e,a)}}),Gt(1072,function(e){return e.layerGroupsEnabledId!==void 0},function(e,t,r){for(t.layerGroupsEnabledId=[];r()>0;)t.layerGroupsEnabledId.push(at(e))},function(e,t){for(var r=0,n=t.layerGroupsEnabledId;r<n.length;r++){var a=n[r];Qe(e,a)}}),Gt(1069,function(e){return e.layerSelectionIds!==void 0},function(e,t){var r=et(e);for(t.layerSelectionIds=[];r--;)t.layerSelectionIds.push(Ne(e))},function(e,t){Ve(e,t.layerSelectionIds.length);for(var r=0,n=t.layerSelectionIds;r<n.length;r++){var a=n[r];it(e,a)}}),Gt(1032,function(e){return e.gridAndGuidesInformation!==void 0},function(e,t){var r=Ne(e),n=Ne(e),a=Ne(e),i=Ne(e);if(r!==1)throw new Error("Invalid 1032 resource version: ".concat(r));t.gridAndGuidesInformation={grid:{horizontal:n,vertical:a},guides:[]};for(var o=0;o<i;o++)t.gridAndGuidesInformation.guides.push({location:Ne(e)/32,direction:at(e)?"horizontal":"vertical"})},function(e,t){var r=t.gridAndGuidesInformation,n=r.grid||{horizontal:18*32,vertical:18*32},a=r.guides||[];it(e,1),it(e,n.horizontal),it(e,n.vertical),it(e,a.length);for(var i=0,o=a;i<o.length;i++){var s=o[i];it(e,s.location*32),Qe(e,s.direction==="horizontal"?1:0)}}),Gt(1065,function(e){return e.layerComps!==void 0},function(e,t){var r=Ft(e,!0);t.layerComps={list:[]};for(var n=0,a=r.list;n<a.length;n++){var i=a[n];t.layerComps.list.push({id:i.compID,name:i["Nm "],capturedInfo:i.capturedInfo}),"comment"in i&&(t.layerComps.list[t.layerComps.list.length-1].comment=i.comment)}"lastAppliedComp"in r&&(t.layerComps.lastApplied=r.lastAppliedComp)},function(e,t){for(var r=t.layerComps,n={list:[]},a=0,i=r.list;a<i.length;a++){var o=i[a],s={};s._classID="Comp",s["Nm "]=o.name,"comment"in o&&(s.comment=o.comment),s.compID=o.id,s.capturedInfo=o.capturedInfo,n.list.push(s)}"lastApplied"in r&&(n.lastAppliedComp=r.lastApplied),Lt(e,"","CompList",n)});var $y=["normal",void 0,void 0,void 0,void 0,void 0,void 0,"multiply","screen",void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,"difference"];Gt(1078,function(e){return e.onionSkins!==void 0},function(e,t){var r=Ft(e);t.onionSkins={enabled:r.enab,framesBefore:r.numBefore,framesAfter:r.numAfter,frameSpacing:r.Spcn,minOpacity:r.minOpacity/100,maxOpacity:r.maxOpacity/100,blendMode:$y[r.BlnM]||"normal"}},function(e,t){var r=t.onionSkins,n={Vrsn:1,enab:r.enabled,numBefore:r.framesBefore,numAfter:r.framesAfter,Spcn:r.frameSpacing,minOpacity:r.minOpacity*100|0,maxOpacity:r.maxOpacity*100|0,BlnM:Math.max(0,$y.indexOf(r.blendMode))};Lt(e,"","null",n)}),Gt(1075,function(e){return e.timelineInformation!==void 0},function(e,t){var r,n,a=Ft(e);t.timelineInformation={enabled:a.enab,frameStep:gn(a.frameStep),frameRate:a.frameRate,time:gn(a.time),duration:gn(a.duration),workInTime:gn(a.workInTime),workOutTime:gn(a.workOutTime),repeats:a.LCnt,hasMotion:a.hasMotion,globalTracks:L4(a.globalTrackList,!!e.logMissingFeatures)},!((n=(r=a.audioClipGroupList)===null||r===void 0?void 0:r.audioClipGroupList)===null||n===void 0)&&n.length&&(t.timelineInformation.audioClipGroups=a.audioClipGroupList.audioClipGroupList.map(function(i){return{id:i.groupID,muted:i.muted,audioClips:i.audioClipList.map(function(o){var s=o.clipID,l=o.timeScope,c=o.muted,u=o.audioLevel,d=o.frameReader;return{id:s,start:gn(l.Strt),duration:gn(l.duration),inTime:gn(l.inTime),outTime:gn(l.outTime),muted:c,audioLevel:u,frameReader:{type:d.frameReaderType,mediaDescriptor:d.mediaDescriptor,link:{name:d["Lnk "]["Nm "],fullPath:d["Lnk "].fullPath,relativePath:d["Lnk "].relPath}}}})}}))},function(e,t){var r,n=t.timelineInformation,a={Vrsn:1,enab:n.enabled,frameStep:n.frameStep,frameRate:n.frameRate,time:n.time,duration:n.duration,workInTime:n.workInTime,workOutTime:n.workOutTime,LCnt:n.repeats,globalTrackList:B4(n.globalTracks),audioClipGroupList:{audioClipGroupList:(r=n.audioClipGroups)===null||r===void 0?void 0:r.map(function(i){return{groupID:i.id,muted:i.muted,audioClipList:i.audioClips.map(function(o){return{clipID:o.id,timeScope:{Vrsn:1,Strt:o.start,duration:o.duration,inTime:o.inTime,outTime:o.outTime},frameReader:{frameReaderType:o.frameReader.type,descVersion:1,"Lnk ":{descVersion:1,"Nm ":o.frameReader.link.name,fullPath:o.frameReader.link.fullPath,relPath:o.frameReader.link.relativePath},mediaDescriptor:o.frameReader.mediaDescriptor},muted:o.muted,audioLevel:o.audioLevel}})}})},hasMotion:n.hasMotion};Lt(e,"","null",a,"anim")}),Gt(1076,function(e){return e.sheetDisclosure!==void 0},function(e,t){var r=Ft(e);t.sheetDisclosure={},r.sheetTimelineOptions&&(t.sheetDisclosure.sheetTimelineOptions=r.sheetTimelineOptions.map(function(n){return{sheetID:n.sheetID,sheetDisclosed:n.sheetDisclosed,lightsDisclosed:n.lightsDisclosed,meshesDisclosed:n.meshesDisclosed,materialsDisclosed:n.materialsDisclosed}}))},function(e,t){var r=t.sheetDisclosure,n={Vrsn:1};r.sheetTimelineOptions&&(n.sheetTimelineOptions=r.sheetTimelineOptions.map(function(a){return{Vrsn:2,sheetID:a.sheetID,sheetDisclosed:a.sheetDisclosed,lightsDisclosed:a.lightsDisclosed,meshesDisclosed:a.meshesDisclosed,materialsDisclosed:a.materialsDisclosed}})),Lt(e,"","null",n)}),Gt(1054,function(e){return e.urlsList!==void 0},function(e,t){var r=Ne(e);t.urlsList=[];for(var n=0;n<r;n++){var a=lr(e);if(a!=="slic"&&e.throwForMissingFeatures)throw new Error("Unknown long");var i=Ne(e),o=Rr(e);t.urlsList.push({id:i,url:o,ref:"slice"})}},function(e,t){var r=t.urlsList;it(e,r.length);for(var n=0;n<r.length;n++)yt(e,"slic"),it(e,r[n].id),Bn(e,r[n].url)});function Ny(e){return{"Top ":e.top,Left:e.left,Btom:e.bottom,Rght:e.right}}function Uy(e){return{top:e["Top "],left:e.Left,bottom:e.Btom,right:e.Rght}}function Jc(e,t){return e[Math.max(0,Math.min(e.length-1,t))]}var Hy=["autoGenerated","layer","userGenerated"],jy=["noImage","image"],Qc=["default"];Gt(1050,function(e){return e.slices?e.slices.length:0},function(e,t){var r=Ne(e);if(r===6){t.slices||(t.slices=[]);var n=dt(e),a=dt(e),i=dt(e),o=dt(e),s=Rr(e),l=Ne(e);t.slices.push({bounds:{top:n,left:a,bottom:i,right:o},groupName:s,slices:[]});for(var c=t.slices[t.slices.length-1].slices,u=0;u<l;u++){var d=Ne(e),f=Ne(e),p=Jc(Hy,Ne(e)),_=p=="layer"?Ne(e):0,h=Rr(e),b=Jc(jy,Ne(e)),v=dt(e),m=dt(e),y=dt(e),g=dt(e),S=Rr(e),M=Rr(e),E=Rr(e),w=Rr(e),x=!!at(e),C=Rr(e),D=Jc(Qc,Ne(e)),B=Jc(Qc,Ne(e)),F=at(e),K=at(e),te=at(e),J=at(e),ne=F+K+te+J===0?"none":F===0?"matte":"color";c.push({id:d,groupId:f,origin:p,associatedLayerId:_,name:h,target:M,message:E,altTag:w,cellTextIsHTML:x,cellText:C,horizontalAlignment:D,verticalAlignment:B,type:b,url:S,bounds:{top:m,left:v,bottom:g,right:y},backgroundColorType:ne,backgroundColor:{r:K,g:te,b:J,a:F}})}var le=Ft(e);le.slices.forEach(function(q){var j=c.find(function(P){return q.sliceID==P.id});j&&(j.topOutset=q.topOutset,j.leftOutset=q.leftOutset,j.bottomOutset=q.bottomOutset,j.rightOutset=q.rightOutset)})}else if(r===7||r===8){var le=Ft(e);t.slices||(t.slices=[]),t.slices.push({groupName:le.baseName,bounds:Uy(le.bounds),slices:le.slices.map(function(j){return ys(ys({},j["Nm "]?{name:j["Nm "]}:{}),{id:j.sliceID,groupId:j.groupID,associatedLayerId:0,origin:ay.decode(j.origin),type:ty.decode(j.Type),bounds:Uy(j.bounds),url:j.url,target:j.null,message:j.Msge,altTag:j.altTag,cellTextIsHTML:j.cellTextIsHTML,cellText:j.cellText,horizontalAlignment:ry.decode(j.horzAlign),verticalAlignment:ny.decode(j.vertAlign),backgroundColorType:iy.decode(j.bgColorType),backgroundColor:j.bgColor?{r:j.bgColor["Rd "],g:j.bgColor["Grn "],b:j.bgColor["Bl "],a:j.bgColor.alpha}:{r:0,g:0,b:0,a:0},topOutset:j.topOutset||0,leftOutset:j.leftOutset||0,bottomOutset:j.bottomOutset||0,rightOutset:j.rightOutset||0})})})}else throw new Error("Invalid slices version (".concat(r,")"))},function(e,t,r){var n=t.slices[r],a=n.bounds,i=n.groupName,o=n.slices;it(e,6),bt(e,a.top),bt(e,a.left),bt(e,a.bottom),bt(e,a.right),Bn(e,i),it(e,o.length);for(var s=0;s<o.length;s++){var l=o[s],c=l.backgroundColor,u=c.a,d=c.r,f=c.g,p=c.b;l.backgroundColorType==="none"?u=d=f=p=0:l.backgroundColorType==="matte"&&(u=0,d=f=p=255),it(e,l.id),it(e,l.groupId),it(e,Hy.indexOf(l.origin)),l.origin==="layer"&&it(e,l.associatedLayerId),Bn(e,l.name||""),it(e,jy.indexOf(l.type)),bt(e,l.bounds.left),bt(e,l.bounds.top),bt(e,l.bounds.right),bt(e,l.bounds.bottom),Bn(e,l.url),Bn(e,l.target),Bn(e,l.message),Bn(e,l.altTag),Qe(e,l.cellTextIsHTML?1:0),Bn(e,l.cellText),it(e,Qc.indexOf(l.horizontalAlignment)),it(e,Qc.indexOf(l.verticalAlignment)),Qe(e,u),Qe(e,d),Qe(e,f),Qe(e,p)}var _={bounds:Ny(a),slices:[]};o.forEach(function(h){var b=ys(ys({sliceID:h.id,groupID:h.groupId,origin:ay.encode(h.origin),Type:ty.encode(h.type),bounds:Ny(h.bounds)},h.name?{"Nm ":h.name}:{}),{url:h.url,null:h.target,Msge:h.message,altTag:h.altTag,cellTextIsHTML:h.cellTextIsHTML,cellText:h.cellText,horzAlign:ry.encode(h.horizontalAlignment),vertAlign:ny.encode(h.verticalAlignment),bgColorType:iy.encode(h.backgroundColorType)});if(h.backgroundColorType==="color"){var v=h.backgroundColor,m=v.r,y=v.g,g=v.b,S=v.a;b.bgColor={"Rd ":m,"Grn ":y,"Bl ":g,alpha:S}}b.topOutset=h.topOutset||0,b.leftOutset=h.leftOutset||0,b.bottomOutset=h.bottomOutset||0,b.rightOutset=h.rightOutset||0,_.slices.push(b)}),Lt(e,"","null",_,"slices")}),Gt(1064,function(e){return e.pixelAspectRatio!==void 0},function(e,t){if(Ne(e)>2)throw new Error("Invalid pixelAspectRatio version");t.pixelAspectRatio={aspect:Zn(e)}},function(e,t){it(e,2),Jn(e,t.pixelAspectRatio.aspect)}),Gt(1041,function(e){return e.iccUntaggedProfile!==void 0},function(e,t){t.iccUntaggedProfile=!!at(e)},function(e,t){Qe(e,t.iccUntaggedProfile?1:0)}),Gt(1044,function(e){return e.idsSeedNumber!==void 0},function(e,t){return t.idsSeedNumber=Ne(e)},function(e,t){return it(e,t.idsSeedNumber)}),Gt(1036,function(e){return e.thumbnail!==void 0||e.thumbnailRaw!==void 0},function(e,t,r){var n=Ne(e),a=Ne(e),i=Ne(e);Ne(e),Ne(e),Ne(e);var o=et(e),s=et(e);if(n!==1||o!==24||s!==1){e.logMissingFeatures&&e.log("Invalid thumbnail data (format: ".concat(n,", bitsPerPixel: ").concat(o,", planes: ").concat(s,")")),ct(e,r());return}var l=r(),c=Tr(e,l);e.useRawThumbnail?t.thumbnailRaw={width:a,height:i,data:c}:c.byteLength&&(t.thumbnail=VF(c))},function(e,t){var r,n=0,a=0,i=new Uint8Array(0);if(t.thumbnailRaw)n=t.thumbnailRaw.width,a=t.thumbnailRaw.height,i=t.thumbnailRaw.data;else try{var o=(r=t.thumbnail.toDataURL("image/jpeg",1))===null||r===void 0?void 0:r.substring(23);o&&(i=d4(o),n=t.thumbnail.width,a=t.thumbnail.height)}catch{}var s=24,l=Math.floor((n*s+31)/32)*4,c=1,u=l*a*c,d=i.length;it(e,1),it(e,n),it(e,a),it(e,l),it(e,u),it(e,d),Ve(e,s),Ve(e,c),pa(e,i)}),Gt(1057,function(e){return e.versionInfo!==void 0},function(e,t,r){var n=Ne(e);if(n!==1)throw new Error("Invalid versionInfo version");t.versionInfo={hasRealMergedData:!!at(e),writerName:Rr(e),readerName:Rr(e),fileVersion:Ne(e)},ct(e,r())},function(e,t){var r=t.versionInfo;it(e,1),Qe(e,r.hasRealMergedData?1:0),Bn(e,r.writerName),Bn(e,r.readerName),it(e,r.fileVersion)}),Gt(7e3,function(e){return e.imageReadyVariables!==void 0},function(e,t,r){t.imageReadyVariables=kp(e,r())},function(e,t){Sp(e,t.imageReadyVariables)}),Gt(7001,function(e){return e.imageReadyDataSets!==void 0},function(e,t,r){t.imageReadyDataSets=kp(e,r())},function(e,t){Sp(e,t.imageReadyDataSets)}),Gt(1088,function(e){return e.pathSelectionState!==void 0},function(e,t,r){var n=Ft(e);t.pathSelectionState=n.null},function(e,t){var r={null:t.pathSelectionState};Lt(e,"","null",r)});var Gy=_t("FrmD","",{auto:"Auto",none:"None",dispose:"Disp"});Gt(4e3,function(e){return e.animations!==void 0},function(e,t,r){var n=lr(e);if(n==="mani")Na(e,"IRFR"),Fn(e,1,function(i){for(var o=function(){Na(e,"8BIM");var s=lr(e);Fn(e,1,function(l){if(s==="AnDs"){var c=Ft(e);t.animations={frames:c.FrIn.map(function(d){return{id:d.FrID,delay:(d.FrDl||0)/100,dispose:d.FrDs?Gy.decode(d.FrDs):"auto"}}),animations:c.FSts.map(function(d){return{id:d.FsID,frames:d.FsFr,repeats:d.LCnt,activeFrame:d.AFrm||0}})}}else if(s==="Roll"){var u=Tr(e,l());e.logDevFeatures&&e.log("#4000 Roll",u)}else e.logMissingFeatures&&e.log("Unhandled subsection in #4000",s)})};i()>0;)o()});else if(n==="mopt"){var a=Tr(e,r());e.logDevFeatures&&e.log("#4000 mopt",a)}else e.logMissingFeatures&&e.log("Unhandled key in #4000:",n)},function(e,t){t.animations&&(yt(e,"mani"),yt(e,"IRFR"),Jr(e,1,function(){yt(e,"8BIM"),yt(e,"AnDs"),Jr(e,1,function(){for(var r={FrIn:[],FSts:[]},n=0;n<t.animations.frames.length;n++){var a=t.animations.frames[n],i={FrID:a.id};a.delay&&(i.FrDl=a.delay*100|0),i.FrDs=Gy.encode(a.dispose),r.FrIn.push(i)}for(var n=0;n<t.animations.animations.length;n++){var o=t.animations.animations[n],s={FsID:o.id,AFrm:o.activeFrame|0,FsFr:o.frames,LCnt:o.repeats|0};r.FSts.push(s)}Lt(e,"","null",r)})}))});var hR=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,n=Object.getOwnPropertySymbols(e);a<n.length;a++)t.indexOf(n[a])<0&&Object.prototype.propertyIsEnumerable.call(e,n[a])&&(r[n[a]]=e[n[a]]);return r},Vy=[0,1,3,2],vR=["bitmap","grayscale","indexed","RGB","CMYK","multichannel","duotone","lab"];function eu(e){for(var t=e.width*e.height*4,r=0;r<t;r+=4){var n=e.data[r];e.data[r+1]=n,e.data[r+2]=n}}function _s(e,t,r){var n=new DataView(e,t,r);return{view:n,offset:0,strict:!1,debug:!1,large:!1,globalAlpha:!1,log:console.log}}function Cp(e,t){if(e.strict)throw new Error(t);e.debug&&e.log(t)}function at(e){return e.offset+=1,e.view.getUint8(e.offset-1)}function mR(e){return e.view.getUint8(e.offset)}function Ot(e){return e.offset+=2,e.view.getInt16(e.offset-2,!1)}function et(e){return e.offset+=2,e.view.getUint16(e.offset-2,!1)}function gR(e){return e.offset+=2,e.view.getUint16(e.offset-2,!0)}function dt(e){return e.offset+=4,e.view.getInt32(e.offset-4,!1)}function qy(e){return e.offset+=4,e.view.getInt32(e.offset-4,!0)}function Ne(e){return e.offset+=4,e.view.getUint32(e.offset-4,!1)}function la(e){return e.offset+=4,e.view.getFloat32(e.offset-4,!1)}function Zn(e){return e.offset+=8,e.view.getFloat64(e.offset-8,!1)}function Pn(e){return dt(e)/65536}function ca(e){return dt(e)/(1<<24)}function Tr(e,t){var r=e.view.byteOffset+e.offset;if(e.offset+=t,r+t>e.view.buffer.byteLength){if(Cp(e,"Reading bytes exceeding buffer length"),t>100*1024*1024)throw new Error("Reading past end of file");var n=new Uint8Array(t),a=Math.min(t,e.view.byteLength-r);return a>0&&n.set(new Uint8Array(e.view.buffer,r,a)),n}else return new Uint8Array(e.view.buffer,r,t)}function lr(e){return Ky(e,4)}function bR(e,t){var r=String.fromCharCode(e.view.getUint8(t))+String.fromCharCode(e.view.getUint8(t+1))+String.fromCharCode(e.view.getUint8(t+2))+String.fromCharCode(e.view.getUint8(t+3));return r=="8BIM"||r=="8B64"}function ua(e,t){for(var r=at(e),n=r?Ky(e,r):"";++r%t;)e.offset++;return n}function Rr(e){var t=Ne(e);return Ep(e,t)}function Ep(e,t){for(var r="";t--;){var n=et(e);(n||t>0)&&(r+=String.fromCharCode(n))}return r}function yR(e,t){for(var r="";t--;){var n=gR(e);(n||t>0)&&(r+=String.fromCharCode(n))}return r}function tu(e,t){for(var r="";t--;)r+=String.fromCharCode(at(e));return r}function ct(e,t){e.offset+=t}function Na(e,t,r){var n=e.offset,a=lr(e);if(a!==t&&a!==r)throw new Error("Invalid signature: '".concat(a,"' at 0x").concat(n.toString(16)))}function Ky(e,t){for(var r=Tr(e,t),n="",a=0;a<r.length;a++)n+=String.fromCharCode(r[a]);return n}function _R(e){return e==="8BIM"||e==="MeSa"||e==="AgHg"||e==="PHUT"||e==="DCSR"}function xR(e,t){var r;t===void 0&&(t={}),Na(e,"8BPS");var n=et(e);if(n!==1&&n!==2)throw new Error("Invalid PSD file version: ".concat(n));ct(e,6);var a=et(e),i=Ne(e),o=Ne(e),s=et(e),l=et(e),c=n===1?3e4:3e5;if(o>c||i>c)throw new Error("Invalid size: ".concat(o,"x").concat(i));if(a>16)throw new Error("Invalid channel count: ".concat(a));if(![1,8,16,32].includes(s))throw new Error("Invalid bitsPerChannel: ".concat(s));if(Vy.indexOf(l)===-1)throw new Error("Color mode not supported: ".concat((r=vR[l])!==null&&r!==void 0?r:l));var u={width:o,height:i,channels:a,bitsPerChannel:s,colorMode:l};Object.assign(e,t),e.large=n===2,e.globalAlpha=!1,Fn(e,1,function(h){if(h()){if(l===2){if(h()!=768)throw new Error("Invalid color palette size");u.palette=[];for(var b=0;b<256;b++)u.palette.push({r:at(e),g:0,b:0});for(var b=0;b<256;b++)u.palette[b].g=at(e);for(var b=0;b<256;b++)u.palette[b].b=at(e)}ct(e,h())}});var d={};Fn(e,1,function(h){for(var b=function(){Zy(e,_R);var v=et(e);ua(e,2),Fn(e,2,function(m){var y=Fy[v],g=v===1036&&!!e.skipThumbnail;if(y&&!g)try{y.read(e,d,m)}catch(S){if(e.throwForMissingFeatures)throw S;ct(e,m())}else ct(e,m())})};h()>0;)b()}),d.layersGroup,d.layerGroupsEnabledId;var f=hR(d,["layersGroup","layerGroupsEnabledId"]);Object.keys(f)&&(u.imageResources=f),Fn(e,1,function(h){if(Fn(e,2,function(v){Ap(e,u,d),ct(e,v())},void 0,e.large),h()>0){var b=ER(e);b&&(u.globalLayerMaskInfo=b)}else ct(e,h());for(;h()>0;){for(;h()&&mR(e)===0;)ct(e,1);h()>=12?Jy(e,u,u,d):ct(e,h())}},void 0,e.large);var p=u.children&&u.children.length,_=e.skipCompositeImageData&&(e.skipLayerImageData||p);return _||MR(e,u),u}function Ap(e,t,r){var n,a,i=r.layersGroup,o=i===void 0?[]:i,s=r.layerGroupsEnabledId,l=s===void 0?[]:s,c=Ot(e);c<0&&(e.globalAlpha=!0,c=-c);for(var u=[],d=[],f=0;f<c;f++){var p=wR(e,t,r),_=p.layer,h=p.channels;o[f]!==void 0&&(_.linkGroup=o[f]),l[f]!==void 0&&(_.linkGroupEnabled=!!l[f]),u.push(_),d.push(h)}for(var f=0;f<c;f++)CR(e,t,u[f],d[f]);t.children||(t.children=[]);for(var b=[t],f=u.length-1;f>=0;f--){var v=u[f],m=v.sectionDivider?v.sectionDivider.type:0;m===1||m===2?(v.opened=m===1,v.children=[],!((n=v.sectionDivider)===null||n===void 0)&&n.key&&(v.blendMode=(a=fs[v.sectionDivider.key])!==null&&a!==void 0?a:v.blendMode),b[b.length-1].children.unshift(v),b.push(v)):m===3?b.pop():b[b.length-1].children.unshift(v)}}function wR(e,t,r){var n={};n.top=dt(e),n.left=dt(e),n.bottom=dt(e),n.right=dt(e);for(var a=et(e),i=[],o=0;o<a;o++){var s=Ot(e),l=Ne(e);if(e.large){if(l!==0)throw new Error("Sizes larger than 4GB are not supported");l=Ne(e)}i.push({id:s,length:l})}Na(e,"8BIM");var c=lr(e);if(!fs[c])throw new Error("Invalid blend mode: '".concat(c,"'"));n.blendMode=fs[c],n.opacity=at(e)/255,n.clipping=at(e)===1;var u=at(e);return n.transparencyProtected=(u&1)!==0,n.hidden=(u&2)!==0,u&32&&(n.effectsOpen=!0),ct(e,1),Fn(e,1,function(d){kR(e,n);var f=SR(e);for(f&&(n.blendingRanges=f),n.name=ua(e,1);d()>4&&!bR(e,e.offset);)e.offset++;for(;d()>=12;)Jy(e,n,t,r);ct(e,d())}),{layer:n,channels:i}}function kR(e,t){return Fn(e,1,function(r){if(r()){var n={};t.mask=n,n.top=dt(e),n.left=dt(e),n.bottom=dt(e),n.right=dt(e),n.defaultColor=at(e);var a=at(e);if(n.positionRelativeToLayer=(a&1)!==0,n.disabled=(a&2)!==0,n.fromVectorData=(a&8)!==0,r()>=18){var i={};t.realMask=i;var o=at(e);i.positionRelativeToLayer=(o&1)!==0,i.disabled=(o&2)!==0,i.fromVectorData=(o&8)!==0,i.defaultColor=at(e),i.top=dt(e),i.left=dt(e),i.bottom=dt(e),i.right=dt(e)}if(a&16){var s=at(e);s&1&&(n.userMaskDensity=at(e)/255),s&2&&(n.userMaskFeather=Zn(e)),s&4&&(n.vectorMaskDensity=at(e)/255),s&8&&(n.vectorMaskFeather=Zn(e))}ct(e,r())}})}function ru(e){return[at(e),at(e),at(e),at(e)]}function SR(e){return Fn(e,1,function(t){for(var r=ru(e),n=ru(e),a=[];t()>0;){var i=ru(e),o=ru(e);a.push({sourceRange:i,destRange:o})}return{compositeGrayBlendSource:r,compositeGraphBlendDestinationRange:n,ranges:a}})}function CR(e,t,r,n){if(!e.skipLayerImageData){var a=t.colorMode,i=a===void 0?3:a,o=t.bitsPerChannel,s=o===void 0?8:o;r.rawData={colorMode:i,bitsPerChannel:s,channels:[],large:e.large};for(var l=0,c=n;l<c.length;l++){var u=c[l],d=e.offset,f=0,p=void 0;if(u.length===1)throw new Error("Invalid channel length");if(u.length){if(f=et(e),f>3&&(e.offset-=1,f=et(e)),f>3&&(e.offset-=3,f=et(e)),f>3)throw new Error("Invalid compression: ".concat(f));u.length>2&&(p=Tr(e,u.length-2))}e.offset=d+u.length,r.rawData.channels.push({id:u.id,compression:f,data:p})}e.useRawData||Yy(r,!!e.useImageData,!!e.throwForMissingFeatures)}}function Wy(e,t){for(var r=e.data,n=r instanceof Float32Array?1:r instanceof Uint16Array?65535:255,a=(t?4:3)|0,i=r.length|0,o=(t?5:4)|0,s=a;s<i;s=s+o|0)r[s]=n}function Yy(e,t,r){if(e.rawData){var n=e.rawData,a=n.colorMode,i=n.bitsPerChannel,o=n.channels,s=n.large,l=(e.right||0)-(e.left||0),c=(e.bottom||0)-(e.top||0),u=a===4,d,f=!1;if(l&&c)if(u){if(i!==8)throw new Error("bitsPerChannel Not supproted");d={width:l,height:c,data:new Uint8ClampedArray(l*c*5)}}else d=Tp(l,c,i);for(var p=0,_=o;p<_.length;p++){var h=_[p],b=h.id,v=h.compression,m=h.data;if(m){var y=_s(m.buffer,m.byteOffset,m.byteLength);if(b===-2||b===-3){var g=b===-2?e.mask:e.realMask;if(!g)throw new Error("Missing layer ".concat(b===-2?"mask":"real mask"," data"));var S=(g.right||0)-(g.left||0),M=(g.bottom||0)-(g.top||0);if(S<0||M<0||S>3e4||M>3e4)throw new Error("Invalid mask size");if(S&&M){var E=Tp(S,M,i);Xy(y,m.byteLength,E,v,S,M,i,0,s,4),eu(E),Wy(E,!1),t?g.imageData=E:g.canvas=Hc(E)}}else{var w=c4(b,u),x=d;if(w<0&&(x=void 0,r))throw new Error("Channel not supported: ".concat(b));Xy(y,m.byteLength,x,v,l,c,i,w,s,u?5:4),x&&a===1&&eu(x)}b===-1&&(f=!0)}}if(d){if(f||Wy(d,u),u){var C=d;d=ps(C.width,C.height),Qy(C,d,!1)}t?e.imageData=d:e.canvas=Hc(d)}delete e.rawData}}function Xy(e,t,r,n,a,i,o,s,l,c){if(t)if(n===0){t!==a*i*Math.floor(o/8)&&e.log("Invalid length (".concat(t,", ").concat(a*i*Math.floor(o/8),")"));var u=Tr(e,t);t3(u,r,o,c,s)}else if(n===1)Vi(e,r,a,i,o,c,[s],l);else if(n===2){var u=Tr(e,t);r3(u,r,a,i,o,c,s,!1)}else if(n===3){var u=Tr(e,t);r3(u,r,a,i,o,c,s,!0)}else throw new Error("Invalid Compression type: ".concat(n))}function ER(e){return Fn(e,1,function(t){if(t()){var r=et(e),n=et(e),a=et(e),i=et(e),o=et(e),s=et(e)/255,l=at(e);return ct(e,t()),{overlayColorSpace:r,colorSpace1:n,colorSpace2:a,colorSpace3:i,colorSpace4:o,opacity:s,kind:l}}})}var AR=[0,1,-1,2,-2,3,-3,4,-4];function Zy(e,t){for(var r=e.offset,n="",a=0,i=AR;a<i.length;a++){var o=i[a];try{e.offset=r+o,n=lr(e)}catch{}if(t(n))break}if(!t(n))throw new Error("Invalid signature: '".concat(n,"' at 0x").concat(r.toString(16)));return n}function TR(e){return e==="8BIM"||e==="8B64"}function Jy(e,t,r,n){var a=Zy(e,TR),i=lr(e),o=a==="8B64"||e.large&&i4.indexOf(i)!==-1;Fn(e,2,function(s){var l=iu[i];if(l)try{l.read(e,t,s,r,n)}catch(c){if(e.throwForMissingFeatures)throw c}else e.logMissingFeatures&&e.log("Unhandled additional info: ".concat(i)),ct(e,s());s()&&(e.logMissingFeatures&&e.log("Unread ".concat(s()," bytes left for additional info: ").concat(i)),ct(e,s()))},!1,o)}function Tp(e,t,r,n){if(n===void 0&&(n=4),r===1||r===8)return n===4?ps(e,t):{width:e,height:t,data:new Uint8ClampedArray(e*t*n)};if(r===16)return{width:e,height:t,data:new Uint16Array(e*t*n)};if(r===32)return{width:e,height:t,data:new Float32Array(e*t*n)};throw new Error("Invalid bitDepth (".concat(r,")"))}function MR(e,t){var r,n=et(e),a=(r=t.bitsPerChannel)!==null&&r!==void 0?r:8;if(Vy.indexOf(t.colorMode)===-1)throw new Error("Color mode not supported: ".concat(t.colorMode));if(n!==0&&n!==1)throw new Error("Compression type not supported: ".concat(n));var i=Tp(t.width,t.height,a);switch(jF(i),t.colorMode){case 0:{if(a!==1)throw new Error("Invalid bitsPerChannel for bitmap color mode");var o=void 0;if(n===0)o=Tr(e,Math.ceil(t.width/8)*t.height);else if(n===1)o=new Uint8Array(t.width*t.height),Vi(e,{data:o,width:t.width,height:t.height},t.width,t.height,8,1,[0],e.large);else throw new Error("Bitmap compression not supported: ".concat(n));GF(o,i.data,t.width,t.height);break}case 3:case 1:{var s=t.colorMode===1?[0]:[0,1,2];if(t.channels&&t.channels>3)for(var l=3;l<t.channels;l++)s.push(l);else e.globalAlpha&&s.push(3);if(n===0)for(var l=0;l<s.length;l++){var c=Tr(e,t.width*t.height*Math.floor(a/8));t3(c,i,a,4,s[l])}else n===1&&(e.offset,Vi(e,i,t.width,t.height,a,4,s,e.large));t.colorMode===1&&eu(i);break}case 2:{if(a!==8)throw new Error("bitsPerChannel Not supproted");if(t.channels!==1)throw new Error("Invalid channel count");if(!t.palette)throw new Error("Missing color palette");if(n===0)throw new Error("Not implemented");if(n===1){var u={width:i.width,height:i.height,data:new Uint8Array(i.width*i.height)};Vi(e,u,t.width,t.height,a,1,[0],e.large),DR(u,i,t.palette)}else throw new Error("Not implemented");break}case 4:{if(a!==8)throw new Error("bitsPerChannel Not supproted");if(t.channels!==4)throw new Error("Invalid channel count");var s=[0,1,2,3];if(e.globalAlpha&&s.push(4),n===0)throw new Error("Not implemented");if(n===1){var d={width:i.width,height:i.height,data:new Uint8Array(i.width*i.height*5)};e.offset,Vi(e,d,t.width,t.height,a,5,s,e.large),Qy(d,i,!0)}else throw new Error("Not implemented");break}default:throw new Error("Color mode not supported: ".concat(t.colorMode))}if(e.globalAlpha){if(t.bitsPerChannel!==8)throw new Error("bitsPerChannel Not supproted");for(var f=i.data,p=i.width*i.height*4,l=0;l<p;l+=4){var _=f[l+3];if(_!=0&&_!=255){var h=_/255,b=1/h,v=255*(1-b);f[l+0]=f[l+0]*b+v,f[l+1]=f[l+1]*b+v,f[l+2]=f[l+2]*b+v}}}e.useImageData?t.imageData=i:t.canvas=Hc(i)}function Qy(e,t,r){for(var n=t.width*t.height*4,a=e.data,i=t.data,o=0,s=0;s<n;o+=5,s+=4){var l=a[o],c=a[o+1],u=a[o+2],d=a[o+3];i[s]=(l*d|0)/255|0,i[s+1]=(c*d|0)/255|0,i[s+2]=(u*d|0)/255|0,i[s+3]=r?255-a[o+4]:a[o+4]}}function DR(e,t,r){for(var n=e.width*e.height,a=e.data,i=t.data,o=0,s=0;o<n;o++,s+=4){var l=r[a[o]];i[s+0]=l.r,i[s+1]=l.g,i[s+2]=l.b,i[s+3]=255}}function zR(e,t){if(e.byteLength/e.length!==t.byteLength/t.length)throw new Error("Invalid array types")}function e3(e,t){if(t===8)return e;if(t===16){for(var r=0;r<e.byteLength;r+=2){var n=e[r];e[r]=e[r+1],e[r+1]=n}if(e.byteOffset%2){var a=new Uint16Array(e.byteLength/2);return new Uint8Array(a.buffer,a.byteOffset,a.byteLength).set(e),a}else return new Uint16Array(e.buffer,e.byteOffset,e.byteLength/2)}else if(t===32)if(e.byteOffset%4){var a=new Float32Array(e.byteLength/4);return new Uint8Array(a.buffer,a.byteOffset,a.byteLength).set(e),a}else return new Float32Array(e.buffer,e.byteOffset,e.byteLength/4);else throw new Error("Invalid bitDepth (".concat(t,")"))}function Mp(e,t,r,n){zR(e.data,t);for(var a=e.width*e.height,i=e.data,o=0,s=r|0;o<a;o++,s=s+n|0)i[s]=t[o]}function t3(e,t,r,n,a){if(r==32)for(var i=0;i<e.byteLength;i+=4){var o=e[i+0],s=e[i+1],l=e[i+2],c=e[i+3];e[i+0]=c,e[i+1]=l,e[i+2]=s,e[i+3]=o}var u=e3(e,r);t&&a<n&&Mp(t,u,a,n)}function Dp(e,t,r,n){for(var a=0;a<r;a++)for(var i=a*t,o=1,s=i+1;o<t;o++,s++)e[s]=(e[s-1]+e[s])%n}function r3(e,t,r,n,a,i,o,s){var l=OF(e);if(t&&o<i){var c=e3(l,a);if(a===8)s&&Dp(l,r,n,256),Mp(t,l,o,i);else if(a===16)s&&Dp(c,r,n,65536),Mp(t,c,o,i);else if(a===32){s&&Dp(l,r*4,n,256);for(var u=o,d=new Uint32Array(t.data.buffer,t.data.byteOffset,t.data.length),f=0;f<n;f++)for(var p=r*4*f,_=0;_<r;_++,p++,u+=i){var h=p+r,b=h+r,v=b+r;d[u]=(l[p]<<24|l[h]<<16|l[b]<<8|l[v])>>>0}}else throw new Error("Invalid bitDepth")}}function Vi(e,t,r,n,a,i,o,s){var l=t&&t.data,c;if(s){c=new Uint32Array(o.length*n);for(var u=0,d=0;u<o.length;u++)for(var f=0;f<n;f++,d++)c[d]=Ne(e)}else{c=new Uint16Array(o.length*n);for(var u=0,d=0;u<o.length;u++)for(var f=0;f<n;f++,d++)c[d]=et(e)}for(var p=i-1|0,_=0,d=0;_<o.length;_++){var h=o[_]|0,b=_>p||h>p;if(!l||b)for(var f=0;f<n;f++,d++)ct(e,c[d]);else for(var f=0,v=h|0;f<n;f++,d++)for(var m=c[d],y=Tr(e,m),g=0,S=0;g<m;g++){var M=y[g];if(M>128){var E=y[++g];M=256-M|0;for(var w=0;w<=M&&S<r;w=w+1|0,S=S+1|0)l[v]=E,v=v+i|0}else if(M<128)for(var w=0;w<=M&&S<r;w=w+1|0,S=S+1|0)l[v]=y[++g],v=v+i|0}}}function Fn(e,t,r,n,a){n===void 0&&(n=!0),a===void 0&&(a=!1);var i=Ne(e);if(a){if(i!==0)throw new Error("Sizes larger than 4GB are not supported");i=Ne(e)}if(!(i<=0&&n)){var o=e.offset+i;if(o>e.view.byteLength)throw new Error("Section exceeds file size");var s=r(function(){return o-e.offset});for(e.offset!==o&&(e.offset>o?Cp(e,"Exceeded section limits"):Cp(e,"Unread section data"));i%t;)i++,o++;return e.offset=o,s}}function qr(e){var t=et(e);switch(t){case 0:{var r=et(e)/257,n=et(e)/257,a=et(e)/257;return ct(e,2),{r,g:n,b:a}}case 1:{var i=et(e)/65535,o=et(e)/65535,a=et(e)/65535;return ct(e,2),{h:i,s:o,b:a}}case 2:{var s=et(e)/257,l=et(e)/257,c=et(e)/257,u=et(e)/257;return{c:s,m:l,y:c,k:u}}case 7:{var d=Ot(e)/1e4,f=Ot(e),p=Ot(e),_=f<0?f/12800:f/12700,a=p<0?p/12800:p/12700;return ct(e,2),{l:d,a:_,b:a}}case 8:{var u=et(e)*255/1e4;return ct(e,6),{k:u}}default:throw new Error("Invalid color space")}}function IR(e){for(var t=Ne(e);t%4;)t++;var r=e.offset+t,n=Ne(e);if(n!==1)throw new Error("Invalid pattern version: ".concat(n));var a=Ne(e),i=Ot(e),o=Ot(e);if(a!==3&&a!==1&&a!==2)throw new Error("Unsupported pattern color mode: ".concat(a));var s=Rr(e),l=ua(e,1),c=[];if(a===2){for(var u=0;u<256;u++)c.push({r:at(e),g:at(e),b:at(e)});ct(e,4)}var d=Ne(e);if(d!==3)throw new Error("Invalid pattern VMAL version: ".concat(d));Ne(e);for(var f=Ne(e),p=Ne(e),_=Ne(e),h=Ne(e),b=Ne(e),v=h-p,m=_-f,y=new Uint8Array(v*m*4),u=3;u<y.byteLength;u+=4)y[u]=255;for(var u=0,g=0;u<b+2;u++){var S=Ne(e);if(S){var M=Ne(e),E=Ne(e),w=Ne(e),x=Ne(e),C=Ne(e),D=Ne(e),B=et(e),F=at(e),K=M-23,te=Tr(e,K);if(E!==8||B!==8)throw new Error("16bit pixel depth not supported for patterns");var J=D-x,ne=C-w,le=x-p,q=w-f;if(F===0){if(a===3&&g<3)for(var j=0;j<ne;j++)for(var P=0;P<J;P++){var N=P+j*J,X=(le+P+(j+q)*v)*4;y[X+g]=te[N]}if(a===1&&g<1)for(var Ee=0;Ee<ne;Ee++)for(var Ae=0;Ae<J;Ae++){var N=Ae+Ee*J,X=(le+Ae+(Ee+q)*v)*4,ze=te[N];y[X+0]=ze,y[X+1]=ze,y[X+2]=ze}if(a===2)throw new Error("Indexed pattern color mode not implemented")}else if(F===1){var Le={data:y,width:v,height:m},he={data:new Uint8Array(J*ne),width:J,height:ne},Ie=_s(te.buffer,te.byteOffset,te.byteLength);if(a===3&&g<3&&(Vi(Ie,he,J,ne,8,1,[0],!1),n3(he,Le,le,q,g)),a===1&&g<1&&(Vi(Ie,he,J,ne,8,1,[0],!1),n3(he,Le,le,q,0),eu(Le)),a===2)throw new Error("Indexed pattern color mode not implemented")}else throw new Error("Invalid pattern compression mode");g++}}return e.offset=r,{id:l,name:s,x:i,y:o,bounds:{x:p,y:f,w:v,h:m},data:y}}function n3(e,t,r,n,a){for(var i=e.width,o=e.height,s=t.width,l=0;l<o;l++)for(var c=0;c<i;c++){var u=c+l*i,d=(r+c+(l+n)*s)*4,f=e.data[u];t.data[d+a]=f}}var a3=[void 0,"outer bevel","inner bevel","emboss","pillow emboss","stroke emboss"];function xs(e){return Na(e,"8BIM"),fs[lr(e)]||"normal"}function ws(e,t){yt(e,"8BIM"),yt(e,Uc[t]||"norm")}function ks(e){return at(e)/255}function Ss(e,t){Qe(e,Math.round(t*255)|0)}function OR(e){var t=et(e);if(t!==0)throw new Error("Invalid effects layer version: ".concat(t));for(var r=et(e),n={},a=0;a<r;a++){Na(e,"8BIM");var i=lr(e);switch(i){case"cmnS":{var o=Ne(e),s=Ne(e),l=!!at(e);if(ct(e,2),o!==7||s!==0||!l)throw new Error("Invalid effects common state");break}case"dsdw":case"isdw":{var c=Ne(e),u=Ne(e);if(c!==41&&c!==51)throw new Error("Invalid shadow size: ".concat(c));if(u!==0&&u!==2)throw new Error("Invalid shadow version: ".concat(u));var o=Pn(e);Pn(e);var d=Pn(e),f=Pn(e),p=qr(e),_=xs(e),h=!!at(e),b=!!at(e),v=ks(e);c>=51&&qr(e);var m={size:{units:"Pixels",value:o},distance:{units:"Pixels",value:f},angle:d,color:p,blendMode:_,enabled:h,useGlobalLight:b,opacity:v};i==="dsdw"?n.dropShadow=[m]:n.innerShadow=[m];break}case"oglw":{var c=Ne(e),y=Ne(e);if(c!==32&&c!==42)throw new Error("Invalid outer glow size: ".concat(c));if(y!==0&&y!==2)throw new Error("Invalid outer glow version: ".concat(y));var o=Pn(e);Pn(e);var p=qr(e),_=xs(e),h=!!at(e),v=ks(e);c>=42&&qr(e),n.outerGlow={size:{units:"Pixels",value:o},color:p,blendMode:_,enabled:h,opacity:v};break}case"iglw":{var c=Ne(e),g=Ne(e);if(c!==32&&c!==43)throw new Error("Invalid inner glow size: ".concat(c));if(g!==0&&g!==2)throw new Error("Invalid inner glow version: ".concat(g));var o=Pn(e);Pn(e);var p=qr(e),_=xs(e),h=!!at(e),v=ks(e);c>=43&&(at(e),qr(e)),n.innerGlow={size:{units:"Pixels",value:o},color:p,blendMode:_,enabled:h,opacity:v};break}case"bevl":{var c=Ne(e),S=Ne(e);if(c!==58&&c!==78)throw new Error("Invalid bevel size: ".concat(c));if(S!==0&&S!==2)throw new Error("Invalid bevel version: ".concat(S));var d=Pn(e),M=Pn(e),o=Pn(e),E=xs(e),w=xs(e),x=qr(e),C=qr(e),D=a3[at(e)]||"inner bevel",B=ks(e),F=ks(e),h=!!at(e),b=!!at(e),K=at(e)?"down":"up";c>=78&&(qr(e),qr(e)),n.bevel={size:{units:"Pixels",value:o},angle:d,strength:M,highlightBlendMode:E,shadowBlendMode:w,highlightColor:x,shadowColor:C,style:D,highlightOpacity:B,shadowOpacity:F,enabled:h,useGlobalLight:b,direction:K};break}case"sofi":{var o=Ne(e),te=Ne(e);if(o!==34)throw new Error("Invalid effects solid fill info size: ".concat(o));if(te!==2)throw new Error("Invalid effects solid fill info version: ".concat(te));var _=xs(e),p=qr(e),v=ks(e),h=!!at(e);qr(e),n.solidFill=[{blendMode:_,color:p,opacity:v,enabled:h}];break}default:throw new Error("Invalid effect type: '".concat(i,"'"))}}return n}function i3(e,t){var r;it(e,51),it(e,2),Ln(e,t.size&&t.size.value||0),Ln(e,0),Ln(e,t.angle||0),Ln(e,t.distance&&t.distance.value||0),Kr(e,t.color),ws(e,t.blendMode),Qe(e,t.enabled?1:0),Qe(e,t.useGlobalLight?1:0),Ss(e,(r=t.opacity)!==null&&r!==void 0?r:1),Kr(e,t.color)}function PR(e,t){var r,n,a,i,o,s,l=(r=t.dropShadow)===null||r===void 0?void 0:r[0],c=(n=t.innerShadow)===null||n===void 0?void 0:n[0],u=t.outerGlow,d=t.innerGlow,f=t.bevel,p=(a=t.solidFill)===null||a===void 0?void 0:a[0],_=1;if(l&&_++,c&&_++,u&&_++,d&&_++,f&&_++,p&&_++,Ve(e,0),Ve(e,_),yt(e,"8BIM"),yt(e,"cmnS"),it(e,7),it(e,0),Qe(e,1),qt(e,2),l&&(yt(e,"8BIM"),yt(e,"dsdw"),i3(e,l)),c&&(yt(e,"8BIM"),yt(e,"isdw"),i3(e,c)),u&&(yt(e,"8BIM"),yt(e,"oglw"),it(e,42),it(e,2),Ln(e,((i=u.size)===null||i===void 0?void 0:i.value)||0),Ln(e,0),Kr(e,u.color),ws(e,u.blendMode),Qe(e,u.enabled?1:0),Ss(e,u.opacity||0),Kr(e,u.color)),d&&(yt(e,"8BIM"),yt(e,"iglw"),it(e,43),it(e,2),Ln(e,((o=d.size)===null||o===void 0?void 0:o.value)||0),Ln(e,0),Kr(e,d.color),ws(e,d.blendMode),Qe(e,d.enabled?1:0),Ss(e,d.opacity||0),Qe(e,0),Kr(e,d.color)),f){yt(e,"8BIM"),yt(e,"bevl"),it(e,78),it(e,2),Ln(e,f.angle||0),Ln(e,f.strength||0),Ln(e,((s=f.size)===null||s===void 0?void 0:s.value)||0),ws(e,f.highlightBlendMode),ws(e,f.shadowBlendMode),Kr(e,f.highlightColor),Kr(e,f.shadowColor);var h=a3.indexOf(f.style);Qe(e,h<=0?1:h),Ss(e,f.highlightOpacity||0),Ss(e,f.shadowOpacity||0),Qe(e,f.enabled?1:0),Qe(e,f.useGlobalLight?1:0),Qe(e,f.direction==="down"?1:0),Kr(e,f.highlightColor),Kr(e,f.shadowColor)}p&&(yt(e,"8BIM"),yt(e,"sofi"),it(e,34),it(e,2),ws(e,p.blendMode),Kr(e,p.color),Ss(e,p.opacity||0),Qe(e,p.enabled?1:0),Kr(e,p.color))}function o3(e){return e===32||e===10||e===13||e===9}function s3(e){return e>=48&&e<=57||e===46||e===45}function l3(e){var t=0;function r(){for(;t<e.length&&o3(e[t]);)t++}function n(){var m=e[t];return t++,m===92&&(m=e[t],t++),m}function a(){var m="";if(e[t]===41)return t++,m;if(e[t]!==254||e[t+1]!==255)throw new Error("Invalid utf-16 BOM");for(t+=2;t<e.length&&e[t]!==41;){var y=n(),g=n(),S=y<<8|g;m+=String.fromCharCode(S)}return t++,m}var i=null,o=[];function s(m){o.length?(l(m),o.push(m)):(o.push(m),i=m)}function l(m){if(!o.length)throw new Error("Invalid data");var y=o[o.length-1];if(typeof y=="string")o[o.length-2][y]=m,u();else if(Array.isArray(y))y.push(m);else throw new Error("Invalid data")}function c(m){o.length||s({});var y=o[o.length-1];if(y&&typeof y=="string")l(m==="nil"?null:"/".concat(m));else if(y&&typeof y=="object")o.push(m);else throw new Error("Invalid data")}function u(){if(!o.length)throw new Error("Invalid data");o.pop()}r();for(var d=e.length;d>0&&e[d-1]===0;)d--;for(;t<d;){var f=t,p=e[f];if(p===60&&e[f+1]===60)t+=2,s({});else if(p===62&&e[f+1]===62)t+=2,u();else if(p===47){t+=1;for(var _=t;t<e.length&&!o3(e[t]);)t++;for(var h="",b=_;b<t;b++)h+=String.fromCharCode(e[b]);c(h)}else if(p===40)t+=1,l(a());else if(p===91)t+=1,s([]);else if(p===93)t+=1,u();else if(p===110&&e[f+1]===117&&e[f+2]===108&&e[f+3]===108)t+=4,l(null);else if(p===116&&e[f+1]===114&&e[f+2]===117&&e[f+3]===101)t+=4,l(!0);else if(p===102&&e[f+1]===97&&e[f+2]===108&&e[f+3]===115&&e[f+4]===101)t+=5,l(!1);else if(s3(p)){for(var v="";t<e.length&&s3(e[t]);)v+=String.fromCharCode(e[t]),t++;l(parseFloat(v))}else t+=1,console.log("Invalid token '".concat(String.fromCharCode(p),"' (").concat(p,") at ").concat(t));r()}return i}var FR=["Axis","XY","Zone","WordSpacing","FirstLineIndent","GlyphSpacing","StartIndent","EndIndent","SpaceBefore","SpaceAfter","LetterSpacing","Values","GridSize","GridLeading","PointBase","BoxBounds","TransformPoint0","TransformPoint1","TransformPoint2","FontSize","Leading","HorizontalScale","VerticalScale","BaselineShift","Tsume","OutlineWidth","AutoLeading"],RR=["RunLengthArray"];function LR(e,t){t===void 0&&(t=!1);var r=new Uint8Array(1024),n=0,a=0;function i(m){if(n>=r.length){var y=new Uint8Array(r.length*2);y.set(r),r=y}r[n]=m,n++}function o(m){for(var y=0;y<m.length;y++)i(m.charCodeAt(y))}function s(){if(t)o(" ");else for(var m=0;m<a;m++)o(" ")}function l(m,y){s(),o("/".concat(m)),_(y,m,!0),t||o(`
|
|
283
283
|
`)}function c(m){return m.toString()}function u(m){return m.toFixed(5).replace(/(\d)0+$/g,"$1").replace(/^0+\.([1-9])/g,".$1").replace(/^-0+\.0(\d)/g,"-.0$1")}function d(m,y){var g=y&&FR.indexOf(y)!==-1||(m|0)!==m;return g?u(m):c(m)}function f(m){var y=Object.keys(m);return y.indexOf("98")!==-1&&y.unshift.apply(y,y.splice(y.indexOf("99"),1)),y.indexOf("99")!==-1&&y.unshift.apply(y,y.splice(y.indexOf("99"),1)),y}function p(m){(m===40||m===41||m===92)&&i(92),i(m)}function _(m,y,g){g===void 0&&(g=!1);function S(){g?o(" "):s()}if(m===null)S(),o(t?"/nil":"null");else if(typeof m=="number")S(),o(d(m,y));else if(typeof m=="boolean")S(),o(m?"true":"false");else if(typeof m=="string")if(S(),(y==="99"||y==="98")&&m.charAt(0)==="/")o(m);else{o("("),i(254),i(255);for(var M=0;M<m.length;M++){var E=m.charCodeAt(M);p(E>>8&255),p(E&255)}o(")")}else if(Array.isArray(m))if(S(),m.every(function(ne){return typeof ne=="number"})){o("[");for(var w=RR.indexOf(y)!==-1,x=0,C=m;x<C.length;x++){var D=C[x];o(" "),o(w?d(D):u(D))}o(" ]")}else{o("["),t||o(`
|
|
284
284
|
`);for(var B=0,F=m;B<F.length;B++){var D=F[B];_(D,y),t||o(`
|
|
285
285
|
`)}s(),o("]")}else if(typeof m=="object"){g&&!t&&o(`
|
|
@@ -288,8 +288,8 @@ l0,-`+(r+144)+`c-2,-159.3,-10,-310.7,-24,-454c-53.3,-528,-210,-949.7,
|
|
|
288
288
|
|
|
289
289
|
`),_(e);return r.slice(0,n)}var Lr=function(){return Lr=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++){t=arguments[r];for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a])}return e},Lr.apply(this,arguments)},c3={name:"MyriadPro-Regular",script:0,type:0,synthetic:0},nu={justification:"left",firstLineIndent:0,startIndent:0,endIndent:0,spaceBefore:0,spaceAfter:0,autoHyphenate:!0,hyphenatedWordSize:6,preHyphen:2,postHyphen:2,consecutiveHyphens:8,zone:36,wordSpacing:[.8,1,1.33],letterSpacing:[0,0,0],glyphSpacing:[1,1,1],autoLeading:1.2,leadingType:0,hanging:!1,burasagari:!1,kinsokuOrder:0,everyLineComposer:!1},BR={font:c3,fontSize:12,fauxBold:!1,fauxItalic:!1,autoLeading:!0,leading:0,horizontalScale:1,verticalScale:1,tracking:0,autoKerning:!0,kerning:0,baselineShift:0,fontCaps:0,fontBaseline:0,underline:!1,strikethrough:!1,ligatures:!0,dLigatures:!1,baselineDirection:2,tsume:0,styleRunAlignment:2,language:0,noBreak:!1,fillColor:{r:0,g:0,b:0},strokeColor:{r:0,g:0,b:0},fillFlag:!0,strokeFlag:!1,fillFirst:!0,yUnderline:1,outlineWidth:1,characterDirection:0,hindiNumbers:!1,kashida:1,diacriticPos:2},$R={isOn:!1,show:!1,size:18,leading:22,color:{r:0,g:0,b:255},leadingFillColor:{r:0,g:0,b:255},alignLineHeightToGridFlags:!1},zp=["justification","firstLineIndent","startIndent","endIndent","spaceBefore","spaceAfter","autoHyphenate","hyphenatedWordSize","preHyphen","postHyphen","consecutiveHyphens","zone","wordSpacing","letterSpacing","glyphSpacing","autoLeading","leadingType","hanging","burasagari","kinsokuOrder","everyLineComposer"],Ip=["font","fontSize","fauxBold","fauxItalic","autoLeading","leading","horizontalScale","verticalScale","tracking","autoKerning","kerning","baselineShift","fontCaps","fontBaseline","underline","strikethrough","ligatures","dLigatures","baselineDirection","tsume","styleRunAlignment","language","noBreak","fillColor","strokeColor","fillFlag","strokeFlag","fillFirst","yUnderline","outlineWidth","characterDirection","hindiNumbers","kashida","diacriticPos"],u3=["none","crisp","strong","smooth","sharp"],f3=["left","right","center","justify-left","justify-right","justify-center","justify-all"];function d3(e){return e.substring(0,1).toUpperCase()+e.substring(1)}function NR(e){var t=e.Values;switch(e.Type){case 0:return{k:t[1]*255};case 1:return t[0]===1?{r:t[1]*255,g:t[2]*255,b:t[3]*255}:{r:t[1]*255,g:t[2]*255,b:t[3]*255,a:t[0]*255};case 2:return{c:t[1]*255,m:t[2]*255,y:t[3]*255,k:t[4]*255};default:throw new Error("Unknown color type in text layer")}}function Op(e){if(e){if("r"in e)return{Type:1,Values:["a"in e?e.a/255:1,e.r/255,e.g/255,e.b/255]};if("c"in e)return{Type:2,Values:[1,e.c/255,e.m/255,e.y/255,e.k/255]};if("k"in e)return{Type:0,Values:[1,e.k/255]};throw new Error("Invalid color type in text layer")}else return{Type:1,Values:[0,0,0,0]}}function p3(e,t){if(!e||!t||e.length!==t.length)return!1;for(var r=0;r<e.length;r++)if(e[r]!==t[r])return!1;return!0}function h3(e,t){if(!e||!t)return!1;for(var r=0,n=Object.keys(e);r<n.length;r++){var a=n[r];if(e[a]!==t[a])return!1}for(var i=0,o=Object.keys(t);i<o.length;i++){var a=o[i];if(e[a]!==t[a])return!1}return!0}function UR(e,t){for(var r=0;r<e.length;r++)if(e[r].name===t.name)return r;return e.push(t),e.length-1}function v3(e,t,r){for(var n={},a=0,i=t;a<i.length;a++){var o=i[a],s=d3(o);e[s]!==void 0&&(o==="justification"?n[o]=f3[e[s]]:o==="font"?n[o]=r[e[s]]:o==="fillColor"||o==="strokeColor"?n[o]=NR(e[s]):n[o]=e[s])}return n}function m3(e,t,r){for(var n,a={},i=0,o=t;i<o.length;i++){var s=o[i],l=d3(s);e[s]!==void 0&&(s==="justification"?a[l]=f3.indexOf((n=e[s])!==null&&n!==void 0?n:"left"):s==="font"?a[l]=UR(r,e[s]):s==="fillColor"||s==="strokeColor"?a[l]=Op(e[s]):a[l]=e[s])}return a}function HR(e,t){return v3(e,zp,t)}function jR(e,t){return v3(e,Ip,t)}function au(e,t){return m3(e,zp,t)}function Pp(e,t){return m3(e,Ip,t)}function g3(e,t,r){if(t.length){for(var n=function(s){var l=t[0].style[s];if(l!==void 0){var c=!1;Array.isArray(l)?c=t.every(function(h){return p3(h.style[s],l)}):typeof l=="object"?c=t.every(function(h){return h3(h.style[s],l)}):c=t.every(function(h){return h.style[s]===l}),c&&(e[s]=l)}var u=e[s];if(u!==void 0)for(var d=0,f=t;d<f.length;d++){var p=f[d],_=!1;Array.isArray(l)?_=p3(p.style[s],l):typeof l=="object"?_=h3(p.style[s],l):_=p.style[s]===l,_&&delete p.style[s]}},a=0,i=r;a<i.length;a++){var o=i[a];n(o)}t.every(function(s){return Object.keys(s.style).length===0})&&(t.length=0)}}function GR(e){for(var t,r,n,a,i,o,s=e.EngineDict,l=e.ResourceDict,c=l.FontSet.map(function(M){return{name:M.Name,script:M.Script,type:M.FontType,synthetic:M.Synthetic}}),u=s.Editor.Text.replace(/\r/g,`
|
|
290
290
|
`),d=0;/\n$/.test(u);)u=u.substring(0,u.length-1),d++;var f={text:u,antiAlias:(t=u3[s.AntiAlias])!==null&&t!==void 0?t:"smooth",useFractionalGlyphWidths:!!s.UseFractionalGlyphWidths,superscriptSize:l.SuperscriptSize,superscriptPosition:l.SuperscriptPosition,subscriptSize:l.SubscriptSize,subscriptPosition:l.SubscriptPosition,smallCapSize:l.SmallCapSize},p=(o=(i=(a=(n=(r=s.Rendered)===null||r===void 0?void 0:r.Shapes)===null||n===void 0?void 0:n.Children)===null||a===void 0?void 0:a[0])===null||i===void 0?void 0:i.Cookie)===null||o===void 0?void 0:o.Photoshop;p&&(f.shapeType=p.ShapeType===1?"box":"point",p.PointBase&&(f.pointBase=p.PointBase),p.BoxBounds&&(f.boxBounds=p.BoxBounds));var _=s.ParagraphRun;f.paragraphStyle={},f.paragraphStyleRuns=[];for(var h=0;h<_.RunArray.length;h++){var b=_.RunArray[h],v=_.RunLengthArray[h],m=HR(b.ParagraphSheet.Properties,c);f.paragraphStyleRuns.push({length:v,style:m})}for(var y=d;f.paragraphStyleRuns.length&&y>0;y--)--f.paragraphStyleRuns[f.paragraphStyleRuns.length-1].length===0&&f.paragraphStyleRuns.pop();g3(f.paragraphStyle,f.paragraphStyleRuns,zp),f.paragraphStyleRuns.length||delete f.paragraphStyleRuns;var g=s.StyleRun;f.style={},f.styleRuns=[];for(var h=0;h<g.RunArray.length;h++){var S=g.RunLengthArray[h],m=jR(g.RunArray[h].StyleSheet.StyleSheetData,c);m.font||(m.font=c[0]),f.styleRuns.push({length:S,style:m})}for(var y=d;f.styleRuns.length&&y>0;y--)--f.styleRuns[f.styleRuns.length-1].length===0&&f.styleRuns.pop();return g3(f.style,f.styleRuns,Ip),f.styleRuns.length||delete f.styleRuns,f}function VR(e){var t,r,n,a,i,o,s,l,c,u,d,f,p="".concat((e.text||"").replace(/\r?\n/g,"\r"),"\r"),_=[{name:"AdobeInvisFont",script:0,type:0,synthetic:0}],h=((t=e.style)===null||t===void 0?void 0:t.font)||((n=(r=e.styleRuns)===null||r===void 0?void 0:r.find(function(Ae){return Ae.style.font}))===null||n===void 0?void 0:n.style.font)||c3,b=[],v=[],m=e.paragraphStyleRuns;if(m&&m.length){for(var y=p.length,g=0,S=m;g<S.length;g++){var M=S[g],E=Math.min(M.length,y);y-=E,E&&(y===1&&M===m[m.length-1]&&(E++,y--),v.push(E),b.push({ParagraphSheet:{DefaultStyleSheet:0,Properties:au(Lr(Lr(Lr({},nu),e.paragraphStyle),M.style),_)},Adjustments:{Axis:[1,0,1],XY:[0,0]}}))}y&&(v.push(y),b.push({ParagraphSheet:{DefaultStyleSheet:0,Properties:au(Lr(Lr({},nu),e.paragraphStyle),_)},Adjustments:{Axis:[1,0,1],XY:[0,0]}}))}else for(var w=0,x=0;w<p.length;w++)p.charCodeAt(w)===13&&(v.push(w-x+1),b.push({ParagraphSheet:{DefaultStyleSheet:0,Properties:au(Lr(Lr({},nu),e.paragraphStyle),_)},Adjustments:{Axis:[1,0,1],XY:[0,0]}}),x=w+1);for(var C=Pp(Lr(Lr({},BR),{font:h}),_),D=e.styleRuns||[{length:p.length,style:e.style||{}}],B=[],F=[],K=p.length,te=0,J=D;te<J.length;te++){var ne=J[te],E=Math.min(ne.length,K);K-=E,E&&(K===1&&ne===D[D.length-1]&&(E++,K--),F.push(E),B.push({StyleSheet:{StyleSheetData:Pp(Lr(Lr({kerning:0,autoKerning:!0,fillColor:{r:0,g:0,b:0}},e.style),ne.style),_)}}))}K&&D.length&&(F.push(K),B.push({StyleSheet:{StyleSheetData:Pp(Lr({kerning:0,autoKerning:!0,fillColor:{r:0,g:0,b:0}},e.style),_)}}));var le=Lr(Lr({},$R),e.gridInfo),q=e.orientation==="vertical"?2:0,j=e.orientation==="vertical"?1:0,P=e.shapeType==="box"?1:0,N={ShapeType:P};P===0?N.PointBase=e.pointBase||[0,0]:N.BoxBounds=e.boxBounds||[0,0,0,0],N.Base={ShapeType:P,TransformPoint0:[1,0],TransformPoint1:[0,1],TransformPoint2:[0,0]};var X={KinsokuSet:[{Name:"PhotoshopKinsokuHard",NoStart:"、。,.・:;?!ー―’”)〕]}〉》」』】ヽヾゝゞ々ぁぃぅぇぉっゃゅょゎァィゥェォッャュョヮヵヶ゛゜?!)]},.:;℃℉¢%‰",NoEnd:"‘“(〔[{〈《「『【([{¥$£@§〒#",Keep:"―‥",Hanging:"、。.,"},{Name:"PhotoshopKinsokuSoft",NoStart:"、。,.・:;?!’”)〕]}〉》」』】ヽヾゝゞ々",NoEnd:"‘“(〔[{〈《「『【",Keep:"―‥",Hanging:"、。.,"}],MojiKumiSet:[{InternalName:"Photoshop6MojiKumiSet1"},{InternalName:"Photoshop6MojiKumiSet2"},{InternalName:"Photoshop6MojiKumiSet3"},{InternalName:"Photoshop6MojiKumiSet4"}],TheNormalStyleSheet:0,TheNormalParagraphSheet:0,ParagraphSheetSet:[{Name:"Normal RGB",DefaultStyleSheet:0,Properties:au(Lr(Lr({},nu),e.paragraphStyle),_)}],StyleSheetSet:[{Name:"Normal RGB",StyleSheetData:C}],FontSet:_.map(function(Ae){return{Name:Ae.name,Script:Ae.script||0,FontType:Ae.type||0,Synthetic:Ae.synthetic||0}}),SuperscriptSize:(a=e.superscriptSize)!==null&&a!==void 0?a:.583,SuperscriptPosition:(i=e.superscriptPosition)!==null&&i!==void 0?i:.333,SubscriptSize:(o=e.subscriptSize)!==null&&o!==void 0?o:.583,SubscriptPosition:(s=e.subscriptPosition)!==null&&s!==void 0?s:.333,SmallCapSize:(l=e.smallCapSize)!==null&&l!==void 0?l:.7},Ee={EngineDict:{Editor:{Text:p},ParagraphRun:{DefaultRunData:{ParagraphSheet:{DefaultStyleSheet:0,Properties:{}},Adjustments:{Axis:[1,0,1],XY:[0,0]}},RunArray:b,RunLengthArray:v,IsJoinable:1},StyleRun:{DefaultRunData:{StyleSheet:{StyleSheetData:{}}},RunArray:B,RunLengthArray:F,IsJoinable:2},GridInfo:{GridIsOn:!!le.isOn,ShowGrid:!!le.show,GridSize:(c=le.size)!==null&&c!==void 0?c:18,GridLeading:(u=le.leading)!==null&&u!==void 0?u:22,GridColor:Op(le.color),GridLeadingFillColor:Op(le.color),AlignLineHeightToGridFlags:!!le.alignLineHeightToGridFlags},AntiAlias:u3.indexOf((d=e.antiAlias)!==null&&d!==void 0?d:"sharp"),UseFractionalGlyphWidths:(f=e.useFractionalGlyphWidths)!==null&&f!==void 0?f:!0,Rendered:{Version:1,Shapes:{WritingDirection:q,Children:[{ShapeType:P,Procession:j,Lines:{WritingDirection:q,Children:[]},Cookie:{Photoshop:N}}]}}},ResourceDict:Lr({},X),DocumentResources:Lr({},X)};return Ee}var Fp={0:{uproot:!0,children:{0:{name:"Type"},1:{name:"Values"}}}},Rp={0:{name:"Font"},1:{name:"FontSize"},2:{name:"FauxBold"},3:{name:"FauxItalic"},4:{name:"AutoLeading"},5:{name:"Leading"},6:{name:"HorizontalScale"},7:{name:"VerticalScale"},8:{name:"Tracking"},9:{name:"BaselineShift"},11:{name:"Kerning?"},12:{name:"FontCaps"},13:{name:"FontBaseline"},15:{name:"Strikethrough?"},16:{name:"Underline?"},18:{name:"Ligatures"},19:{name:"DLigatures"},23:{name:"Fractions"},24:{name:"Ordinals"},28:{name:"StylisticAlternates"},30:{name:"OldStyle?"},35:{name:"BaselineDirection"},38:{name:"Language"},52:{name:"NoBreak"},53:{name:"FillColor",children:Fp},54:{name:"StrokeColor",children:Fp},55:{children:{99:{uproot:!0}}},79:{children:Fp}},Lp={0:{name:"Justification"},1:{name:"FirstLineIndent"},2:{name:"StartIndent"},3:{name:"EndIndent"},4:{name:"SpaceBefore"},5:{name:"SpaceAfter"},7:{name:"AutoLeading"},9:{name:"AutoHyphenate"},10:{name:"HyphenatedWordSize"},11:{name:"PreHyphen"},12:{name:"PostHyphen"},13:{name:"ConsecutiveHyphens?"},14:{name:"Zone"},15:{name:"HypenateCapitalizedWords"},17:{name:"WordSpacing"},18:{name:"LetterSpacing"},19:{name:"GlyphSpacing"},32:{name:"StyleSheet",children:Rp}},b3={name:"StyleSheetData",children:Rp},qR={0:{name:"ResourceDict",children:{1:{name:"FontSet",children:{0:{uproot:!0,children:{0:{uproot:!0,children:{0:{uproot:!0,children:{0:{name:"Name"},2:{name:"FontType"}}}}}}}}},2:{name:"2",children:{}},3:{name:"MojiKumiSet",children:{0:{uproot:!0,children:{0:{uproot:!0,children:{0:{name:"InternalName"}}}}}}},4:{name:"KinsokuSet",children:{0:{uproot:!0,children:{0:{uproot:!0,children:{0:{name:"Name"},5:{uproot:!0,children:{0:{name:"NoStart"},1:{name:"NoEnd"},2:{name:"Keep"},3:{name:"Hanging"},4:{name:"Name"}}}}}}}}},5:{name:"StyleSheetSet",children:{0:{uproot:!0,children:{0:{uproot:!0,children:{0:{name:"Name"},6:b3}}}}}},6:{name:"ParagraphSheetSet",children:{0:{uproot:!0,children:{0:{uproot:!0,children:{0:{name:"Name"},5:{name:"Properties",children:Lp},6:{name:"DefaultStyleSheet"}}}}}}},8:{name:"TextFrameSet",children:{0:{uproot:!0,children:{0:{name:"path",children:{0:{name:"name"},1:{name:"bezierCurve",children:{0:{name:"controlPoints"}}},2:{name:"data",children:{0:{name:"type"},1:{name:"orientation"},2:{name:"frameMatrix"},4:{name:"4"},6:{name:"textRange"},7:{name:"rowGutter"},8:{name:"columnGutter"},9:{name:"9"},10:{name:"baselineAlignment",children:{0:{name:"flag"},1:{name:"min"}}},11:{name:"pathData",children:{1:{name:"1"},0:{name:"reversed"},2:{name:"2"},3:{name:"3"},4:{name:"spacing"},5:{name:"5"},6:{name:"6"},7:{name:"7"},18:{name:"18"}}},12:{name:"12"},13:{name:"13"}}},3:{name:"3"},97:{name:"uuid"}}}}}}},9:{name:"Predefined",children:{0:{children:{0:{uproot:!0}}},1:{children:{0:{uproot:!0}}}}}}},1:{name:"EngineDict",children:{0:{name:"0",children:{3:{name:"SuperscriptSize"},4:{name:"SuperscriptPosition"},5:{name:"SubscriptSize"},6:{name:"SubscriptPosition"},7:{name:"SmallCapSize"},8:{name:"UseFractionalGlyphWidths"},15:{children:{0:{uproot:!0}}}}},1:{name:"Editors?",children:{0:{name:"Editor",children:{0:{name:"Text"},5:{name:"ParagraphRun",children:{0:{name:"RunArray",children:{0:{name:"ParagraphSheet",children:{0:{uproot:!0,children:{0:{name:"0"},5:{name:"5",children:Lp},6:{name:"6"}}}}},1:{name:"RunLength"}}}}},6:{name:"StyleRun",children:{0:{name:"RunArray",children:{0:{name:"StyleSheet",children:{0:{uproot:!0,children:{6:b3}}}},1:{name:"RunLength"}}}}}}},1:{name:"FontVectorData ???"}}},2:{name:"StyleSheet",children:Rp},3:{name:"ParagraphSheet",children:Lp}}}};function Bl(e,t){var r,n;if(e===null)return e;if(Array.isArray(e))return e.map(function(l){return Bl(l,t)});if(typeof e!="object")return e;for(var a={},i=0,o=Object.keys(e);i<o.length;i++){var s=o[i];if(t[s])if(t[s].uproot){s!=="99"&&(a=Bl(e[s],(r=t[s].children)!==null&&r!==void 0?r:{})),e[99]&&(a._type=e[99]);break}else a[t[s].name||s]=Bl(e[s],(n=t[s].children)!==null&&n!==void 0?n:{});else s==="99"?a._type=e[s]:a[s]=Bl(e[s],{})}return a}function KR(e){return Bl(e,qR)}var Q=function(){return Q=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++){t=arguments[r];for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a])}return e},Q.apply(this,arguments)},Rn="abcdefghijklmnopqrstuvwxyz",y3=[],iu={};function ht(e,t,r,n){var a={key:e,has:t,read:r,write:n};y3.push(a),iu[a.key]=a}function Cs(e,t){iu[e]=iu[t]}function ir(e){return function(t){return t[e]!==void 0}}function Bp(e){if(Ne(e))throw new Error("Resource size above 4 GB limit at ".concat(e.offset.toString(16)));return Ne(e)}function $p(e,t){it(e,0),it(e,t)}ht("TySh",ir("text"),function(e,t,r){if(Ot(e)!==1)throw new Error("Invalid TySh version");for(var n=[],a=0;a<6;a++)n.push(Zn(e));if(Ot(e)!==50)throw new Error("Invalid TySh text version");var i=Ft(e);if(Ot(e)!==1)throw new Error("Invalid TySh warp version");var o=Ft(e);if(t.text={transform:n,left:la(e),top:la(e),right:la(e),bottom:la(e),text:i["Txt "].replace(/\r/g,`
|
|
291
|
-
`),index:i.TextIndex||0,gridding:V4.decode(i.textGridding),antiAlias:q4.decode(i.AntA),orientation:Rl.decode(i.Ornt),warp:{style:wp.decode(o.warpStyle),value:o.warpValue||0,perspective:o.warpPerspective||0,perspectiveOther:o.warpPerspectiveOther||0,rotate:Rl.decode(o.warpRotate)}},i.bounds&&(t.text.bounds=z4(i.bounds)),i.boundingBox&&(t.text.boundingBox=z4(i.boundingBox)),i.EngineData){var s=l3(i.EngineData),l=GR(s);t.text=Q(Q({},t.text),l)}ct(e,r())},function(e,t){var r=t.text,n=r.warp||{},a=r.transform||[1,0,0,1,0,0],i=Q(Q(Q({"Txt ":(r.text||"").replace(/\r?\n/g,"\r"),textGridding:V4.encode(r.gridding),Ornt:Rl.encode(r.orientation),AntA:q4.encode(r.antiAlias)},r.bounds?{bounds:I4(r.bounds)}:{}),r.boundingBox?{boundingBox:I4(r.boundingBox)}:{}),{TextIndex:r.index||0,EngineData:LR(VR(r))});Vt(e,1);for(var o=0;o<6;o++)Jn(e,a[o]);Vt(e,50),Lt(e,"","TxLr",i,"text"),Vt(e,1),Lt(e,"","warp",ou(n)),fa(e,r.left),fa(e,r.top),fa(e,r.right),fa(e,r.bottom)}),ht("SoCo",function(e){return e.vectorFill!==void 0&&e.vectorStroke===void 0&&e.vectorFill.type==="color"},function(e,t){var r=Ft(e);t.vectorFill=Ol(r)},function(e,t){var r=Pl(t.vectorFill).descriptor;Lt(e,"","null",r)}),ht("GdFl",function(e){return e.vectorFill!==void 0&&e.vectorStroke===void 0&&(e.vectorFill.type==="solid"||e.vectorFill.type==="noise")},function(e,t,r){var n=Ft(e);t.vectorFill=Ol(n),ct(e,r())},function(e,t){var r=Pl(t.vectorFill).descriptor;Lt(e,"","null",r)}),ht("PtFl",function(e){return e.vectorFill!==void 0&&e.vectorStroke===void 0&&e.vectorFill.type==="pattern"},function(e,t){var r=Ft(e);t.vectorFill=Ol(r)},function(e,t){var r=Pl(t.vectorFill).descriptor;Lt(e,"","null",r)}),ht("vscg",function(e){return e.vectorFill!==void 0&&e.vectorStroke!==void 0},function(e,t,r){lr(e);var n=Ft(e);t.vectorFill=Ol(n),ct(e,r())},function(e,t){var r=Pl(t.vectorFill),n=r.descriptor,a=r.key;yt(e,a),Lt(e,"","null",n)});function WR(e,t,r){var n=ca(e)*r,a=ca(e)*t,i=ca(e)*r,o=ca(e)*t,s=ca(e)*r,l=ca(e)*t;return[a,n,o,i,l,s]}function YR(e,t,r,n){da(e,t[1]/n),da(e,t[0]/r),da(e,t[3]/n),da(e,t[2]/r),da(e,t[5]/n),da(e,t[4]/r)}var _3=["exclude","combine","subtract","intersect"];function x3(e,t,r,n,a){for(var i=e.offset+a,o=t.paths,s=void 0;i-e.offset>=26;){var l=et(e);switch(l){case 0:case 3:{et(e);var c=Ot(e),u=et(e);ct(e,18),s={open:l===3,knots:[],fillRule:u===2?"non-zero":"even-odd"},c!==-1&&(s.operation=_3[c]),o.push(s);break}case 1:case 2:case 4:case 5:s.knots.push({linked:l===1||l===4,points:WR(e,r,n)});break;case 6:ct(e,24);break;case 7:{var d=ca(e),f=ca(e),p=ca(e),_=ca(e),h=ca(e);ct(e,4),t.clipboard={top:d,left:f,bottom:p,right:_,resolution:h};break}case 8:t.fillStartsWithAllPixels=!!et(e),ct(e,22);break;default:throw new Error("Invalid vmsk section")}}return o}ht("vmsk",ir("vectorMask"),function(e,t,r,n){var a=n.width,i=n.height;if(Ne(e)!==3)throw new Error("Invalid vmsk version");t.vectorMask={paths:[]};var o=t.vectorMask,s=Ne(e);o.invert=(s&1)!==0,o.notLink=(s&2)!==0,o.disable=(s&4)!==0,x3(e,o,a,i,r()),ct(e,r())},function(e,t,r){var n=r.width,a=r.height,i=t.vectorMask,o=(i.invert?1:0)|(i.notLink?2:0)|(i.disable?4:0);it(e,3),it(e,o),Ve(e,6),qt(e,24);var s=i.clipboard;s&&(Ve(e,7),da(e,s.top),da(e,s.left),da(e,s.bottom),da(e,s.right),da(e,s.resolution),qt(e,4)),Ve(e,8),Ve(e,i.fillStartsWithAllPixels?1:0),qt(e,22);for(var l=0,c=i.paths;l<c.length;l++){var u=c[l];Ve(e,u.open?3:0),Ve(e,u.knots.length),Ve(e,u.operation?_3.indexOf(u.operation):-1),Ve(e,u.fillRule==="non-zero"?2:1),qt(e,18);for(var d=u.open?4:1,f=u.open?5:2,p=0,_=u.knots;p<_.length;p++){var h=_[p],b=h.linked,v=h.points;Ve(e,b?d:f),YR(e,v,n,a)}}}),Cs("vsms","vmsk"),ht("vowv",ir("vowv"),function(e,t){t.vowv=Ne(e)},function(e,t){it(e,t.vowv)}),ht("vogk",ir("vectorOrigination"),function(e,t,r){if(dt(e)!==1)throw new Error("Invalid vogk version");var n=Ft(e);t.vectorOrigination={keyDescriptorList:[]};for(var a=0,i=n.keyDescriptorList;a<i.length;a++){var o=i[a],s={};o.keyShapeInvalidated!=null&&(s.keyShapeInvalidated=o.keyShapeInvalidated),o.keyOriginType!=null&&(s.keyOriginType=o.keyOriginType),o.keyOriginResolution!=null&&(s.keyOriginResolution=o.keyOriginResolution),o.keyOriginShapeBBox&&(s.keyOriginShapeBoundingBox={top:Gi(o.keyOriginShapeBBox["Top "]),left:Gi(o.keyOriginShapeBBox.Left),bottom:Gi(o.keyOriginShapeBBox.Btom),right:Gi(o.keyOriginShapeBBox.Rght)});var l=o.keyOriginRRectRadii;l&&(s.keyOriginRRectRadii={topRight:Jt(l.topRight),topLeft:Jt(l.topLeft),bottomLeft:Jt(l.bottomLeft),bottomRight:Jt(l.bottomRight)});var c=o.keyOriginBoxCorners;c&&(s.keyOriginBoxCorners=[{x:c.rectangleCornerA.Hrzn,y:c.rectangleCornerA.Vrtc},{x:c.rectangleCornerB.Hrzn,y:c.rectangleCornerB.Vrtc},{x:c.rectangleCornerC.Hrzn,y:c.rectangleCornerC.Vrtc},{x:c.rectangleCornerD.Hrzn,y:c.rectangleCornerD.Vrtc}]);var u=o.Trnf;u&&(s.transform=[u.xx,u.xy,u.yx,u.yy,u.tx,u.ty]),t.vectorOrigination.keyDescriptorList.push(s)}ct(e,r())},function(e,t){for(var r=t.vectorOrigination,n={keyDescriptorList:[]},a=0;a<r.keyDescriptorList.length;a++){var i=r.keyDescriptorList[a];n.keyDescriptorList.push({});var o=n.keyDescriptorList[n.keyDescriptorList.length-1];i.keyOriginType!=null&&(o.keyOriginType=i.keyOriginType),i.keyOriginResolution!=null&&(o.keyOriginResolution=i.keyOriginResolution);var s=i.keyOriginRRectRadii;s&&(o.keyOriginRRectRadii={unitValueQuadVersion:1,topRight:pr(s.topRight,"topRight"),topLeft:pr(s.topLeft,"topLeft"),bottomLeft:pr(s.bottomLeft,"bottomLeft"),bottomRight:pr(s.bottomRight,"bottomRight")});var l=i.keyOriginShapeBoundingBox;l&&(o.keyOriginShapeBBox={unitValueQuadVersion:1,"Top ":pr(l.top,"top"),Left:pr(l.left,"left"),Btom:pr(l.bottom,"bottom"),Rght:pr(l.right,"right")});var c=i.keyOriginBoxCorners;c&&c.length===4&&(o.keyOriginBoxCorners={rectangleCornerA:{Hrzn:c[0].x,Vrtc:c[0].y},rectangleCornerB:{Hrzn:c[1].x,Vrtc:c[1].y},rectangleCornerC:{Hrzn:c[2].x,Vrtc:c[2].y},rectangleCornerD:{Hrzn:c[3].x,Vrtc:c[3].y}});var u=i.transform;u&&u.length===6&&(o.Trnf={xx:u[0],xy:u[1],yx:u[2],yy:u[3],tx:u[4],ty:u[5]}),i.keyShapeInvalidated!=null&&(o.keyShapeInvalidated=i.keyShapeInvalidated),o.keyOriginIndex=a}gt(e,1),Lt(e,"","null",n)}),ht("lmfx",function(e){return e.effects!==void 0&&z3(e.effects)},function(e,t,r){var n=Ne(e);if(n!==0)throw new Error("Invalid lmfx version");var a=Ft(e);t.effects=Il(a,!!e.logMissingFeatures),ct(e,r())},function(e,t,r,n){var a=zl(t.effects,!!n.logMissingFeatures,!0);it(e,0),Lt(e,"","null",a)}),ht("lrFX",ir("effects"),function(e,t,r){t.effects||(t.effects=OR(e)),ct(e,r())},function(e,t){PR(e,t.effects)}),ht("luni",ir("name"),function(e,t,r){if(r()>4){var n=Ne(e);r()>=n*2?t.name=Ep(e,n):e.logDevFeatures&&e.log("name in luni section is too long")}else e.logDevFeatures&&e.log("empty luni section");ct(e,r())},function(e,t){Bn(e,t.name)}),ht("lnsr",ir("nameSource"),function(e,t){return t.nameSource=lr(e)},function(e,t){return yt(e,t.nameSource)}),ht("lyid",ir("id"),function(e,t){t.id=Ne(e)},function(e,t,r,n){for(var a=t.id;n.layerIds.has(a);)a+=100;it(e,a),n.layerIds.add(a),n.layerToId.set(t,a)}),ht("lsct",ir("sectionDivider"),function(e,t,r){t.sectionDivider={type:Ne(e)},r()&&(Na(e,"8BIM"),t.sectionDivider.key=lr(e)),r()&&(t.sectionDivider.subType=Ne(e))},function(e,t){it(e,t.sectionDivider.type),t.sectionDivider.key&&(yt(e,"8BIM"),yt(e,t.sectionDivider.key),t.sectionDivider.subType!==void 0&&it(e,t.sectionDivider.subType))}),Cs("lsdk","lsct"),ht("clbl",ir("blendClippendElements"),function(e,t){t.blendClippendElements=!!at(e),ct(e,3)},function(e,t){Qe(e,t.blendClippendElements?1:0),qt(e,3)}),ht("infx",ir("blendInteriorElements"),function(e,t){t.blendInteriorElements=!!at(e),ct(e,3)},function(e,t){Qe(e,t.blendInteriorElements?1:0),qt(e,3)}),ht("knko",ir("knockout"),function(e,t){t.knockout=!!at(e),ct(e,3)},function(e,t){Qe(e,t.knockout?1:0),qt(e,3)}),ht("lmgm",ir("layerMaskAsGlobalMask"),function(e,t){t.layerMaskAsGlobalMask=!!at(e),ct(e,3)},function(e,t){Qe(e,t.layerMaskAsGlobalMask?1:0),qt(e,3)}),ht("lspf",ir("protected"),function(e,t){var r=Ne(e);t.protected={transparency:(r&1)!==0,composite:(r&2)!==0,position:(r&4)!==0},r&8&&(t.protected.artboards=!0)},function(e,t){var r=(t.protected.transparency?1:0)|(t.protected.composite?2:0)|(t.protected.position?4:0)|(t.protected.artboards?8:0);it(e,r)}),ht("lclr",ir("layerColor"),function(e,t){var r=et(e);ct(e,6),t.layerColor=a4[r]},function(e,t){var r=a4.indexOf(t.layerColor);Ve(e,r===-1?0:r),qt(e,6)}),ht("shmd",function(e){return e.timestamp!==void 0||e.animationFrames!==void 0||e.animationFrameFlags!==void 0||e.timeline!==void 0||e.comps!==void 0},function(e,t,r){for(var n=Ne(e),a=function(o){Na(e,"8BIM");var s=lr(e);at(e),ct(e,3),Fn(e,1,function(l){if(s==="cust"){var c=Ft(e);c.layerTime!==void 0&&(t.timestamp=c.layerTime)}else if(s==="mlst"){var c=Ft(e);t.animationFrames=[];for(var u=0;u<c.LaSt.length;u++){var d=c.LaSt[u],f={frames:d.FrLs};d.enab!==void 0&&(f.enable=d.enab),d.Ofst&&(f.offset=Ml(d.Ofst)),d.FXRf&&(f.referencePoint=Ml(d.FXRf)),d.Lefx&&(f.effects=Il(d.Lefx,!!e.logMissingFeatures)),d.blendOptions&&d.blendOptions.Opct&&(f.opacity=mt(d.blendOptions.Opct)),t.animationFrames.push(f)}}else if(s==="mdyn"){et(e);var p=at(e),_=at(e);t.animationFrameFlags={propagateFrameOne:!p,unifyLayerPosition:(_&1)!==0,unifyLayerStyle:(_&2)!==0,unifyLayerVisibility:(_&4)!==0}}else if(s==="tmln"){var c=Ft(e),h=c.timeScope,b={start:gn(h.Strt),duration:gn(h.duration),inTime:gn(h.inTime),outTime:gn(h.outTime),autoScope:c.autoScope,audioLevel:c.audioLevel};c.trackList&&(b.tracks=L4(c.trackList,!!e.logMissingFeatures)),t.timeline=b}else if(s==="cmls"){var c=Ft(e);t.comps={settings:[]},c.origFXRefPoint&&(t.comps.originalEffectsReferencePoint={x:c.origFXRefPoint.Hrzn,y:c.origFXRefPoint.Vrtc});for(var v=0,m=c.layerSettings;v<m.length;v++){var y=m[v];t.comps.settings.push({compList:y.compList});var g=t.comps.settings[t.comps.settings.length-1];"enab"in y&&(g.enabled=y.enab),y.Ofst&&(g.offset={x:y.Ofst.Hrzn,y:y.Ofst.Vrtc}),y.FXRefPoint&&(g.effectsReferencePoint={x:y.FXRefPoint.Hrzn,y:y.FXRefPoint.Vrtc})}}else if(s==="extn"){var c=Ft(e);e.logMissingFeatures&&e.log('Unhandled "shmd" section key',s)}else e.logMissingFeatures&&e.log('Unhandled "shmd" section key',s);ct(e,l())})},i=0;i<n;i++)a();ct(e,r())},function(e,t,r,n){var a=t.animationFrames,i=t.animationFrameFlags,o=t.timestamp,s=t.timeline,l=t.comps,c=0;a&&c++,i&&c++,s&&c++,o!==void 0&&c++,l&&c++,it(e,c),a&&(yt(e,"8BIM"),yt(e,"mlst"),Qe(e,0),qt(e,3),Jr(e,2,function(){for(var u,d={LaID:(u=t.id)!==null&&u!==void 0?u:0,LaSt:[]},f=0;f<a.length;f++){var p=a[f],_={};p.enable!==void 0&&(_.enab=p.enable),_.FrLs=p.frames,p.offset&&(_.Ofst=Dl(p.offset)),p.referencePoint&&(_.FXRf=Dl(p.referencePoint)),p.effects&&(_.Lefx=zl(p.effects,!1,!1)),p.opacity!==void 0&&(_.blendOptions={Opct:Vr(p.opacity)}),d.LaSt.push(_)}Lt(e,"","null",d)},!0)),i&&(yt(e,"8BIM"),yt(e,"mdyn"),Qe(e,0),qt(e,3),Jr(e,2,function(){Ve(e,0),Qe(e,i.propagateFrameOne?0:15),Qe(e,(i.unifyLayerPosition?1:0)|(i.unifyLayerStyle?2:0)|(i.unifyLayerVisibility?4:0))})),s&&(yt(e,"8BIM"),yt(e,"tmln"),Qe(e,0),qt(e,3),Jr(e,2,function(){var u={Vrsn:1,timeScope:{Vrsn:1,Strt:s.start,duration:s.duration,inTime:s.inTime,outTime:s.outTime},autoScope:s.autoScope,audioLevel:s.audioLevel};s.tracks&&(u.trackList=B4(s.tracks));var d=n.layerToId.get(t)||t.id;if(!d)throw new Error("You need to provide layer.id value whan writing document with animations");u.LyrI=d,Lt(e,"","null",u,"anim")},!0)),o!==void 0&&(yt(e,"8BIM"),yt(e,"cust"),Qe(e,0),qt(e,3),Jr(e,2,function(){var u={layerTime:o};Lt(e,"","metadata",u)},!0)),l&&(yt(e,"8BIM"),yt(e,"cmls"),Qe(e,0),qt(e,3),Jr(e,2,function(){var u=n.layerToId.get(t)||t.id;if(!u)throw new Error("You need to provide layer.id value whan writing document with layer comps");var d={};l.originalEffectsReferencePoint&&(d.origFXRefPoint={Hrzn:l.originalEffectsReferencePoint.x,Vrtc:l.originalEffectsReferencePoint.y}),d.LyrI=u,d.layerSettings=[];for(var f=0,p=l.settings;f<p.length;f++){var _=p[f],h={};_.enabled!==void 0&&(h.enab=_.enabled),_.offset&&(h.Ofst={Hrzn:_.offset.x,Vrtc:_.offset.y}),_.effectsReferencePoint&&(h.FXRefPoint={Hrzn:_.effectsReferencePoint.x,Vrtc:_.effectsReferencePoint.y}),h.compList=_.compList,d.layerSettings.push(h)}Lt(e,"","null",d)},!0))}),ht("PxSc",function(){return!1},function(e,t){var r=Ft(e,!0);r.pixelSourceType===1986285651?t.pixelSource={type:"vdPS",origin:{x:r.origin.Hrzn,y:r.origin.Vrtc},interpretation:{interpretAlpha:r.interpretation.interpretAlpha.split(".")[1],profile:r.interpretation.profile},frameReader:{type:"QTFR",link:{name:r.frameReader["Lnk "]["Nm "],fullPath:r.frameReader["Lnk "].fullPath,originalPath:r.frameReader["Lnk "].originalPath,relativePath:r.frameReader["Lnk "].relPath,alias:r.frameReader["Lnk "].alis},mediaDescriptor:r.frameReader.mediaDescriptor},showAlteredVideo:r.showAlteredVideo}:e.log("Unknown pixelSourceType")},function(e,t){var r=t.pixelSource,n={_name:"",_classID:"PixelSource",pixelSourceType:1986285651,descVersion:1,origin:{Hrzn:r.origin.x,Vrtc:r.origin.y},interpretation:{_name:"",_classID:"footageInterpretation",Vrsn:1,interpretAlpha:"alphaInterpretation.".concat(r.interpretation.interpretAlpha),profile:r.interpretation.profile},frameReader:{_name:"",_classID:"FrameReader",frameReaderType:1364477522,descVersion:1,"Lnk ":{_name:"",_classID:"ExternalFileLink",descVersion:2,"Nm ":r.frameReader.link.name,fullPath:r.frameReader.link.fullPath,originalPath:r.frameReader.link.originalPath,alis:r.frameReader.link.alias,relPath:r.frameReader.link.relativePath},mediaDescriptor:r.frameReader.mediaDescriptor},showAlteredVideo:r.showAlteredVideo};Lt(e,"","PixelSource",n)}),ht("vstk",ir("vectorStroke"),function(e,t,r){var n=Ft(e);t.vectorStroke={strokeEnabled:n.strokeEnabled,fillEnabled:n.fillEnabled,lineWidth:Jt(n.strokeStyleLineWidth),lineDashOffset:Jt(n.strokeStyleLineDashOffset),miterLimit:n.strokeStyleMiterLimit,lineCapType:oy.decode(n.strokeStyleLineCapType),lineJoinType:sy.decode(n.strokeStyleLineJoinType),lineAlignment:ly.decode(n.strokeStyleLineAlignment),scaleLock:n.strokeStyleScaleLock,strokeAdjust:n.strokeStyleStrokeAdjust,lineDashSet:n.strokeStyleLineDashSet.map(Jt),blendMode:bn.decode(n.strokeStyleBlendMode),opacity:mt(n.strokeStyleOpacity),content:Ol(n.strokeStyleContent),resolution:n.strokeStyleResolution},ct(e,r())},function(e,t){var r,n,a,i=t.vectorStroke,o={strokeStyleVersion:2,strokeEnabled:!!i.strokeEnabled,fillEnabled:!!i.fillEnabled,strokeStyleLineWidth:i.lineWidth||{value:3,units:"Points"},strokeStyleLineDashOffset:i.lineDashOffset||{value:0,units:"Points"},strokeStyleMiterLimit:(r=i.miterLimit)!==null&&r!==void 0?r:100,strokeStyleLineCapType:oy.encode(i.lineCapType),strokeStyleLineJoinType:sy.encode(i.lineJoinType),strokeStyleLineAlignment:ly.encode(i.lineAlignment),strokeStyleScaleLock:!!i.scaleLock,strokeStyleStrokeAdjust:!!i.strokeAdjust,strokeStyleLineDashSet:i.lineDashSet||[],strokeStyleBlendMode:bn.encode(i.blendMode),strokeStyleOpacity:Vr((n=i.opacity)!==null&&n!==void 0?n:1),strokeStyleContent:Pl(i.content||{type:"color",color:{r:0,g:0,b:0}}).descriptor,strokeStyleResolution:(a=i.resolution)!==null&&a!==void 0?a:72};Lt(e,"","strokeStyle",o)}),ht("artb",ir("artboard"),function(e,t,r){var n=Ft(e),a=n.artboardRect;t.artboard={rect:{top:a["Top "],left:a.Left,bottom:a.Btom,right:a.Rght},guideIndices:n.guideIndeces,presetName:n.artboardPresetName,color:oa(n["Clr "]),backgroundType:n.artboardBackgroundType},ct(e,r())},function(e,t){var r,n=t.artboard,a=n.rect,i={artboardRect:{"Top ":a.top,Left:a.left,Btom:a.bottom,Rght:a.right},guideIndeces:n.guideIndices||[],artboardPresetName:n.presetName||"","Clr ":sa(n.color),artboardBackgroundType:(r=n.backgroundType)!==null&&r!==void 0?r:1};Lt(e,"","artboard",i)}),ht("sn2P",ir("usingAlignedRendering"),function(e,t){return t.usingAlignedRendering=!!Ne(e)},function(e,t){return it(e,t.usingAlignedRendering?1:0)});var Es=["unknown","vector","raster","image stack"];function w3(e){var t,r,n,a,i,o,s=Q(Q({style:wp.decode(e.warpStyle)},e.warpValues?{values:e.warpValues}:{value:e.warpValue||0}),{perspective:e.warpPerspective||0,perspectiveOther:e.warpPerspectiveOther||0,rotate:Rl.decode(e.warpRotate),bounds:e.bounds&&{top:Gi(e.bounds["Top "]),left:Gi(e.bounds.Left),bottom:Gi(e.bounds.Btom),right:Gi(e.bounds.Rght)},uOrder:e.uOrder,vOrder:e.vOrder});(e.deformNumRows!=null||e.deformNumCols!=null)&&(s.deformNumRows=e.deformNumRows,s.deformNumCols=e.deformNumCols);var l=e.customEnvelopeWarp;if(l){s.customEnvelopeWarp={meshPoints:[]};for(var c=((t=l.meshPoints.find(function(f){return f.type==="Hrzn"}))===null||t===void 0?void 0:t.values)||[],u=((r=l.meshPoints.find(function(f){return f.type==="Vrtc"}))===null||r===void 0?void 0:r.values)||[],d=0;d<c.length;d++)s.customEnvelopeWarp.meshPoints.push({x:c[d],y:u[d]});(l.quiltSliceX||l.quiltSliceY)&&(s.customEnvelopeWarp.quiltSliceX=((a=(n=l.quiltSliceX)===null||n===void 0?void 0:n[0])===null||a===void 0?void 0:a.values)||[],s.customEnvelopeWarp.quiltSliceY=((o=(i=l.quiltSliceY)===null||i===void 0?void 0:i[0])===null||o===void 0?void 0:o.values)||[])}return s}function Np(e){var t,r;return e.deformNumCols!=null||e.deformNumRows!=null||((t=e.customEnvelopeWarp)===null||t===void 0?void 0:t.quiltSliceX)||((r=e.customEnvelopeWarp)===null||r===void 0?void 0:r.quiltSliceY)}function ou(e){var t=e.bounds,r=Q(Q({warpStyle:wp.encode(e.style)},e.values?{warpValues:e.values}:{warpValue:e.value||0}),{warpPerspective:e.perspective||0,warpPerspectiveOther:e.perspectiveOther||0,warpRotate:Rl.encode(e.rotate),bounds:{"Top ":pr(t&&t.top||{units:"Pixels",value:0},"bounds.top"),Left:pr(t&&t.left||{units:"Pixels",value:0},"bounds.left"),Btom:pr(t&&t.bottom||{units:"Pixels",value:0},"bounds.bottom"),Rght:pr(t&&t.right||{units:"Pixels",value:0},"bounds.right")},uOrder:e.uOrder||0,vOrder:e.vOrder||0}),n=Np(e);if(n){var a=r;a.deformNumRows=e.deformNumRows||0,a.deformNumCols=e.deformNumCols||0}var i=e.customEnvelopeWarp;if(i){var o=i.meshPoints||[];if(n){var a=r;a.customEnvelopeWarp={_name:"",_classID:"customEnvelopeWarp",quiltSliceX:[{type:"quiltSliceX",values:i.quiltSliceX||[]}],quiltSliceY:[{type:"quiltSliceY",values:i.quiltSliceY||[]}],meshPoints:[{type:"Hrzn",values:o.map(function(l){return l.x})},{type:"Vrtc",values:o.map(function(l){return l.y})}]}}else r.customEnvelopeWarp={_name:"",_classID:"customEnvelopeWarp",meshPoints:[{type:"Hrzn",values:o.map(function(s){return s.x})},{type:"Vrtc",values:o.map(function(s){return s.y})}]}}return r}ht("PlLd",ir("placedLayer"),function(e,t,r){if(lr(e)!=="plcL")throw new Error("Invalid PlLd signature");if(dt(e)!==3)throw new Error("Invalid PlLd version");var n=ua(e,1),a=dt(e),i=dt(e);dt(e);var o=dt(e);if(!Es[o])throw new Error("Invalid PlLd type");for(var s=[],l=0;l<8;l++)s.push(Zn(e));var c=dt(e);if(c!==0)throw new Error("Invalid Warp version ".concat(c));var u=Ft(e);t.placedLayer=t.placedLayer||{id:n,type:Es[o],pageNumber:a,totalPages:i,transform:s,warp:w3(u)},ct(e,r())},function(e,t){var r=t.placedLayer;if(yt(e,"plcL"),gt(e,3),!r.id||typeof r.id!="string"||!/^[0-9a-f]{8}-([0-9a-f]{4}-){3}[0-9a-f]{12}$/.test(r.id))throw new Error("Placed layer ID must be in a GUID format (example: 20953ddb-9391-11ec-b4f1-c15674f50bc4)");if(Wi(e,r.id,1),gt(e,1),gt(e,1),gt(e,16),Es.indexOf(r.type)===-1)throw new Error("Invalid placedLayer type");gt(e,Es.indexOf(r.type));for(var n=0;n<8;n++)Jn(e,r.transform[n]);gt(e,0);var a=S3(r),i=Np(a),o=i?"quiltWarp":"warp";Lt(e,"",o,ou(a),o)});function XR(e){return new Float32Array(e.buffer.slice(e.byteOffset),0,e.byteLength/4)}function ZR(e){return new Uint32Array(e.buffer.slice(e.byteOffset),0,e.byteLength/4)}function Up(e){return new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}function su(e){for(var t=[],r=0;r<e.length;r+=2)t.push({x:e[r],y:e[r+1]});return t}function $l(e){for(var t=[],r=0;r<e.length;r++)t.push(e[r].x,e[r].y);return t}function k3(e){return su(XR(e))}function Nl(e){return{x:Jt(e.Hrzn),y:Jt(e.Vrtc)}}function Ul(e){return{_name:"",_classID:"Pnt ",Hrzn:pr(e.x,"x"),Vrtc:pr(e.y,"y")}}function JR(e,t){var r={name:e["Nm "],opacity:mt(e.blendOptions.Opct),blendMode:bn.decode(e.blendOptions["Md "]),enabled:e.enab,hasOptions:e.hasoptions,foregroundColor:oa(e.FrgC),backgroundColor:oa(e.BckC)};if("Fltr"in e)switch(e.Fltr._classID){case"boxblur":return Q(Q({},r),{type:"box blur",filter:{radius:Jt(e.Fltr["Rds "])}});case"GsnB":return Q(Q({},r),{type:"gaussian blur",filter:{radius:Jt(e.Fltr["Rds "])}});case"MtnB":return Q(Q({},r),{type:"motion blur",filter:{angle:e.Fltr.Angl,distance:Jt(e.Fltr.Dstn)}});case"RdlB":return Q(Q({},r),{type:"radial blur",filter:{amount:e.Fltr.Amnt,method:cy.decode(e.Fltr.BlrM),quality:uy.decode(e.Fltr.BlrQ)}});case"shapeBlur":return Q(Q({},r),{type:"shape blur",filter:{radius:Jt(e.Fltr["Rds "]),customShape:{name:e.Fltr.customShape["Nm "],id:e.Fltr.customShape.Idnt}}});case"SmrB":return Q(Q({},r),{type:"smart blur",filter:{radius:e.Fltr["Rds "],threshold:e.Fltr.Thsh,quality:dy.decode(e.Fltr.SmBQ),mode:fy.decode(e.Fltr.SmBM)}});case"surfaceBlur":return Q(Q({},r),{type:"surface blur",filter:{radius:Jt(e.Fltr["Rds "]),threshold:e.Fltr.Thsh}});case"Dspl":return Q(Q({},r),{type:"displace",filter:{horizontalScale:e.Fltr.HrzS,verticalScale:e.Fltr.VrtS,displacementMap:py.decode(e.Fltr.DspM),undefinedAreas:bs.decode(e.Fltr.UndA),displacementFile:{signature:e.Fltr.DspF.sig,path:e.Fltr.DspF.path}}});case"Pnch":return Q(Q({},r),{type:"pinch",filter:{amount:e.Fltr.Amnt}});case"Plr ":return Q(Q({},r),{type:"polar coordinates",filter:{conversion:hy.decode(e.Fltr.Cnvr)}});case"Rple":return Q(Q({},r),{type:"ripple",filter:{amount:e.Fltr.Amnt,size:vy.decode(e.Fltr.RplS)}});case"Shr ":return Q(Q({},r),{type:"shear",filter:{shearPoints:e.Fltr.ShrP.map(function(s){return{x:s.Hrzn,y:s.Vrtc}}),shearStart:e.Fltr.ShrS,shearEnd:e.Fltr.ShrE,undefinedAreas:bs.decode(e.Fltr.UndA)}});case"Sphr":return Q(Q({},r),{type:"spherize",filter:{amount:e.Fltr.Amnt,mode:my.decode(e.Fltr.SphM)}});case"Twrl":return Q(Q({},r),{type:"twirl",filter:{angle:e.Fltr.Angl}});case"Wave":return Q(Q({},r),{type:"wave",filter:{numberOfGenerators:e.Fltr.NmbG,type:gy.decode(e.Fltr.Wvtp),wavelength:{min:e.Fltr.WLMn,max:e.Fltr.WLMx},amplitude:{min:e.Fltr.AmMn,max:e.Fltr.AmMx},scale:{x:e.Fltr.SclH,y:e.Fltr.SclV},randomSeed:e.Fltr.RndS,undefinedAreas:bs.decode(e.Fltr.UndA)}});case"ZgZg":return Q(Q({},r),{type:"zigzag",filter:{amount:e.Fltr.Amnt,ridges:e.Fltr.NmbR,style:by.decode(e.Fltr.ZZTy)}});case"AdNs":return Q(Q({},r),{type:"add noise",filter:{amount:mt(e.Fltr.Nose),distribution:yy.decode(e.Fltr.Dstr),monochromatic:e.Fltr.Mnch,randomSeed:e.Fltr.FlRs}});case"DstS":return Q(Q({},r),{type:"dust and scratches",filter:{radius:e.Fltr["Rds "],threshold:e.Fltr.Thsh}});case"Mdn ":return Q(Q({},r),{type:"median",filter:{radius:Jt(e.Fltr["Rds "])}});case"denoise":return Q(Q({},r),{type:"reduce noise",filter:{preset:e.Fltr.preset,removeJpegArtifact:e.Fltr.removeJPEGArtifact,reduceColorNoise:mt(e.Fltr.ClNs),sharpenDetails:mt(e.Fltr.Shrp),channelDenoise:e.Fltr.channelDenoise.map(function(s){return Q({channels:s.Chnl.map(Ll.decode),amount:s.Amnt},s.EdgF?{preserveDetails:s.EdgF}:{})})}});case"ClrH":return Q(Q({},r),{type:"color halftone",filter:{radius:e.Fltr["Rds "],angle1:e.Fltr.Ang1,angle2:e.Fltr.Ang2,angle3:e.Fltr.Ang3,angle4:e.Fltr.Ang4}});case"Crst":return Q(Q({},r),{type:"crystallize",filter:{cellSize:e.Fltr.ClSz,randomSeed:e.Fltr.FlRs}});case"Mztn":return Q(Q({},r),{type:"mezzotint",filter:{type:_y.decode(e.Fltr.MztT),randomSeed:e.Fltr.FlRs}});case"Msc ":return Q(Q({},r),{type:"mosaic",filter:{cellSize:Jt(e.Fltr.ClSz)}});case"Pntl":return Q(Q({},r),{type:"pointillize",filter:{cellSize:e.Fltr.ClSz,randomSeed:e.Fltr.FlRs}});case"Clds":return Q(Q({},r),{type:"clouds",filter:{randomSeed:e.Fltr.FlRs}});case"DfrC":return Q(Q({},r),{type:"difference clouds",filter:{randomSeed:e.Fltr.FlRs}});case"Fbrs":return Q(Q({},r),{type:"fibers",filter:{variance:e.Fltr.Vrnc,strength:e.Fltr.Strg,randomSeed:e.Fltr.RndS}});case"LnsF":return Q(Q({},r),{type:"lens flare",filter:{brightness:e.Fltr.Brgh,position:{x:e.Fltr.FlrC.Hrzn,y:e.Fltr.FlrC.Vrtc},lensType:xy.decode(e.Fltr["Lns "])}});case"smartSharpen":return Q(Q({},r),{type:"smart sharpen",filter:{amount:mt(e.Fltr.Amnt),radius:Jt(e.Fltr["Rds "]),threshold:e.Fltr.Thsh,angle:e.Fltr.Angl,moreAccurate:e.Fltr.moreAccurate,blur:wy.decode(e.Fltr.blur),preset:e.Fltr.preset,shadow:{fadeAmount:mt(e.Fltr.sdwM.Amnt),tonalWidth:mt(e.Fltr.sdwM.Wdth),radius:e.Fltr.sdwM["Rds "]},highlight:{fadeAmount:mt(e.Fltr.hglM.Amnt),tonalWidth:mt(e.Fltr.hglM.Wdth),radius:e.Fltr.hglM["Rds "]}}});case"UnsM":return Q(Q({},r),{type:"unsharp mask",filter:{amount:mt(e.Fltr.Amnt),radius:Jt(e.Fltr["Rds "]),threshold:e.Fltr.Thsh}});case"Dfs ":return Q(Q({},r),{type:"diffuse",filter:{mode:ky.decode(e.Fltr["Md "]),randomSeed:e.Fltr.FlRs}});case"Embs":return Q(Q({},r),{type:"emboss",filter:{angle:e.Fltr.Angl,height:e.Fltr.Hght,amount:e.Fltr.Amnt}});case"Extr":return Q(Q({},r),{type:"extrude",filter:{type:Sy.decode(e.Fltr.ExtT),size:e.Fltr.ExtS,depth:e.Fltr.ExtD,depthMode:Cy.decode(e.Fltr.ExtR),randomSeed:e.Fltr.FlRs,solidFrontFaces:e.Fltr.ExtF,maskIncompleteBlocks:e.Fltr.ExtM}});case"Tls ":return Q(Q({},r),{type:"tiles",filter:{numberOfTiles:e.Fltr.TlNm,maximumOffset:e.Fltr.TlOf,fillEmptyAreaWith:Ey.decode(e.Fltr.FlCl),randomSeed:e.Fltr.FlRs}});case"TrcC":return Q(Q({},r),{type:"trace contour",filter:{level:e.Fltr["Lvl "],edge:Ay.decode(e.Fltr["Edg "])}});case"Wnd ":return Q(Q({},r),{type:"wind",filter:{method:Ty.decode(e.Fltr.WndM),direction:My.decode(e.Fltr.Drct)}});case"Dntr":return Q(Q({},r),{type:"de-interlace",filter:{eliminate:Dy.decode(e.Fltr.IntE),newFieldsBy:zy.decode(e.Fltr.IntC)}});case"Cstm":return Q(Q({},r),{type:"custom",filter:{scale:e.Fltr["Scl "],offset:e.Fltr.Ofst,matrix:e.Fltr.Mtrx}});case"HghP":return Q(Q({},r),{type:"high pass",filter:{radius:Jt(e.Fltr["Rds "])}});case"Mxm ":return Q(Q({},r),{type:"maximum",filter:{radius:Jt(e.Fltr["Rds "])}});case"Mnm ":return Q(Q({},r),{type:"minimum",filter:{radius:Jt(e.Fltr["Rds "])}});case"Ofst":return Q(Q({},r),{type:"offset",filter:{horizontal:e.Fltr.Hrzn,vertical:e.Fltr.Vrtc,undefinedAreas:Iy.decode(e.Fltr["Fl "])}});case"rigidTransform":return Q(Q({},r),{type:"puppet",filter:{rigidType:e.Fltr.rigidType,bounds:[{x:e.Fltr.PuX0,y:e.Fltr.PuY0},{x:e.Fltr.PuX1,y:e.Fltr.PuY1},{x:e.Fltr.PuX2,y:e.Fltr.PuY2},{x:e.Fltr.PuX3,y:e.Fltr.PuY3}],puppetShapeList:e.Fltr.puppetShapeList.map(function(s){return{rigidType:s.rigidType,originalVertexArray:k3(s.originalVertexArray),deformedVertexArray:k3(s.deformedVertexArray),indexArray:Array.from(ZR(s.indexArray)),pinOffsets:su(s.pinOffsets),posFinalPins:su(s.posFinalPins),pinVertexIndices:s.pinVertexIndices,selectedPin:s.selectedPin,pinPosition:su(s.PinP),pinRotation:s.PnRt,pinOverlay:s.PnOv,pinDepth:s.PnDp,meshQuality:s.meshQuality,meshExpansion:s.meshExpansion,meshRigidity:s.meshRigidity,imageResolution:s.imageResolution,meshBoundaryPath:{pathComponents:s.meshBoundaryPath.pathComponents.map(function(l){return{shapeOperation:l.shapeOperation.split(".")[1],paths:l.SbpL.map(function(c){return{closed:c.Clsp,points:c["Pts "].map(function(u){return{anchor:Nl(u.Anch),forward:Nl(u["Fwd "]),backward:Nl(u["Bwd "]),smooth:u.Smoo}})}})}})}}})}});case"PbPl":{for(var n=[],a=e.Fltr,i=0;i<Rn.length&&a["PN".concat(Rn[i],"a")];i++)for(var o=0;o<Rn.length&&a["PN".concat(Rn[i]).concat(Rn[o])];o++)n.push({name:a["PN".concat(Rn[i]).concat(Rn[o])],value:a["PF".concat(Rn[i]).concat(Rn[o])]});return Q(Q({},r),{type:"oil paint plugin",filter:{name:e.Fltr.KnNm,gpu:e.Fltr.GpuY,lighting:e.Fltr.LIWy,parameters:n}})}case"HsbP":return Q(Q({},r),{type:"hsb/hsl",filter:{inputMode:Kc.decode(e.Fltr.Inpt),rowOrder:Kc.decode(e.Fltr.Otpt)}});case"oilPaint":return Q(Q({},r),{type:"oil paint",filter:{lightingOn:e.Fltr.lightingOn,stylization:e.Fltr.stylization,cleanliness:e.Fltr.cleanliness,brushScale:e.Fltr.brushScale,microBrush:e.Fltr.microBrush,lightDirection:e.Fltr.LghD,specularity:e.Fltr.specularity}});case"LqFy":return Q(Q({},r),{type:"liquify",filter:{liquifyMesh:e.Fltr.LqMe}});case"perspectiveWarpTransform":return Q(Q({},r),{type:"perspective warp",filter:{vertices:e.Fltr.vertices.map(Nl),warpedVertices:e.Fltr.warpedVertices.map(Nl),quads:e.Fltr.quads.map(function(s){return s.indices})}});case"Crvs":return Q(Q({},r),{type:"curves",filter:Q({presetKind:Oy.decode(e.Fltr.presetKind)},e.Fltr.Adjs?{adjustments:e.Fltr.Adjs.map(function(s){var l=s.Chnl.map(Ll.decode);if(s["Crv "])return{channels:l,curve:s["Crv "].map(function(c){var u={x:c.Hrzn,y:c.Vrtc};return c.Cnty&&(u.curved=!0),u})};if(s.Mpng)return{channels:l,values:s.Mpng};throw new Error("Unknown curve adjustment")})}:{})});case"BrgC":return Q(Q({},r),{type:"brightness/contrast",filter:{brightness:e.Fltr.Brgh,contrast:e.Fltr.Cntr,useLegacy:!!e.Fltr.useLegacy}});default:if(t.throwForMissingFeatures)throw new Error("Unknown filter classId: ".concat(e.Fltr._classID));return}else switch(e.filterID){case 1098281575:return Q(Q({},r),{type:"average"});case 1114403360:return Q(Q({},r),{type:"blur"});case 1114403405:return Q(Q({},r),{type:"blur more"});case 1148416099:return Q(Q({},r),{type:"despeckle"});case 1180922912:return Q(Q({},r),{type:"facet"});case 1181902701:return Q(Q({},r),{type:"fragment"});case 1399353968:return Q(Q({},r),{type:"sharpen"});case 1399353925:return Q(Q({},r),{type:"sharpen edges"});case 1399353933:return Q(Q({},r),{type:"sharpen more"});case 1181639749:return Q(Q({},r),{type:"find edges"});case 1399616122:return Q(Q({},r),{type:"solarize"});case 1314149187:return Q(Q({},r),{type:"ntsc colors"});case 1231976050:return Q(Q({},r),{type:"invert"});default:if(t.throwForMissingFeatures)throw new Error("Unknown filterID: ".concat(e.filterID))}}function QR(e,t){return{enabled:e.enab,validAtPosition:e.validAtPosition,maskEnabled:e.filterMaskEnable,maskLinked:e.filterMaskLinked,maskExtendWithWhite:e.filterMaskExtendWithWhite,list:e.filterFXList.map(function(r){return JR(r,t)}).filter(function(r){return!!r})}}function Ua(e){return pr(e.radius,"radius")}function eL(e){var t={_name:"",_classID:"filterFX","Nm ":e.name,blendOptions:{_name:"",_classID:"blendOptions",Opct:Xn(e.opacity),"Md ":bn.encode(e.blendMode)},enab:e.enabled,hasoptions:e.hasOptions,FrgC:sa(e.foregroundColor),BckC:sa(e.backgroundColor)};switch(e.type){case"average":return Q(Q({},t),{filterID:1098281575});case"blur":return Q(Q({},t),{filterID:1114403360});case"blur more":return Q(Q({},t),{filterID:1114403405});case"box blur":return Q(Q({},t),{Fltr:{_name:"Box Blur",_classID:"boxblur","Rds ":Ua(e.filter)},filterID:697});case"gaussian blur":return Q(Q({},t),{Fltr:{_name:"Gaussian Blur",_classID:"GsnB","Rds ":Ua(e.filter)},filterID:1198747202});case"motion blur":return Q(Q({},t),{Fltr:{_name:"Motion Blur",_classID:"MtnB",Angl:e.filter.angle,Dstn:pr(e.filter.distance,"distance")},filterID:1299476034});case"radial blur":return Q(Q({},t),{Fltr:{_name:"Radial Blur",_classID:"RdlB",Amnt:e.filter.amount,BlrM:cy.encode(e.filter.method),BlrQ:uy.encode(e.filter.quality)},filterID:1382313026});case"shape blur":return Q(Q({},t),{Fltr:{_name:"Shape Blur",_classID:"shapeBlur","Rds ":Ua(e.filter),customShape:{_name:"",_classID:"customShape","Nm ":e.filter.customShape.name,Idnt:e.filter.customShape.id}},filterID:702});case"smart blur":return Q(Q({},t),{Fltr:{_name:"Smart Blur",_classID:"SmrB","Rds ":e.filter.radius,Thsh:e.filter.threshold,SmBQ:dy.encode(e.filter.quality),SmBM:fy.encode(e.filter.mode)},filterID:1399681602});case"surface blur":return Q(Q({},t),{Fltr:{_name:"Surface Blur",_classID:"surfaceBlur","Rds ":Ua(e.filter),Thsh:e.filter.threshold},filterID:701});case"displace":return Q(Q({},t),{Fltr:{_name:"Displace",_classID:"Dspl",HrzS:e.filter.horizontalScale,VrtS:e.filter.verticalScale,DspM:py.encode(e.filter.displacementMap),UndA:bs.encode(e.filter.undefinedAreas),DspF:{sig:e.filter.displacementFile.signature,path:e.filter.displacementFile.path}},filterID:1148416108});case"pinch":return Q(Q({},t),{Fltr:{_name:"Pinch",_classID:"Pnch",Amnt:e.filter.amount},filterID:1349411688});case"polar coordinates":return Q(Q({},t),{Fltr:{_name:"Polar Coordinates",_classID:"Plr ",Cnvr:hy.encode(e.filter.conversion)},filterID:1349284384});case"ripple":return Q(Q({},t),{Fltr:{_name:"Ripple",_classID:"Rple",Amnt:e.filter.amount,RplS:vy.encode(e.filter.size)},filterID:1383099493});case"shear":return Q(Q({},t),{Fltr:{_name:"Shear",_classID:"Shr ",ShrP:e.filter.shearPoints.map(function(l){return{_name:"",_classID:"Pnt ",Hrzn:l.x,Vrtc:l.y}}),UndA:bs.encode(e.filter.undefinedAreas),ShrS:e.filter.shearStart,ShrE:e.filter.shearEnd},filterID:1399353888});case"spherize":return Q(Q({},t),{Fltr:{_name:"Spherize",_classID:"Sphr",Amnt:e.filter.amount,SphM:my.encode(e.filter.mode)},filterID:1399875698});case"twirl":return Q(Q({},t),{Fltr:{_name:"Twirl",_classID:"Twrl",Angl:e.filter.angle},filterID:1417114220});case"wave":return Q(Q({},t),{Fltr:{_name:"Wave",_classID:"Wave",Wvtp:gy.encode(e.filter.type),NmbG:e.filter.numberOfGenerators,WLMn:e.filter.wavelength.min,WLMx:e.filter.wavelength.max,AmMn:e.filter.amplitude.min,AmMx:e.filter.amplitude.max,SclH:e.filter.scale.x,SclV:e.filter.scale.y,UndA:bs.encode(e.filter.undefinedAreas),RndS:e.filter.randomSeed},filterID:1466005093});case"zigzag":return Q(Q({},t),{Fltr:{_name:"ZigZag",_classID:"ZgZg",Amnt:e.filter.amount,NmbR:e.filter.ridges,ZZTy:by.encode(e.filter.style)},filterID:1516722791});case"add noise":return Q(Q({},t),{Fltr:{_name:"Add Noise",_classID:"AdNs",Dstr:yy.encode(e.filter.distribution),Nose:Xn(e.filter.amount),Mnch:e.filter.monochromatic,FlRs:e.filter.randomSeed},filterID:1097092723});case"despeckle":return Q(Q({},t),{filterID:1148416099});case"dust and scratches":return Q(Q({},t),{Fltr:{_name:"Dust & Scratches",_classID:"DstS","Rds ":e.filter.radius,Thsh:e.filter.threshold},filterID:1148417107});case"median":return Q(Q({},t),{Fltr:{_name:"Median",_classID:"Mdn ","Rds ":Ua(e.filter)},filterID:1298427424});case"reduce noise":return Q(Q({},t),{Fltr:{_name:"Reduce Noise",_classID:"denoise",ClNs:Xn(e.filter.reduceColorNoise),Shrp:Xn(e.filter.sharpenDetails),removeJPEGArtifact:e.filter.removeJpegArtifact,channelDenoise:e.filter.channelDenoise.map(function(l){return Q({_name:"",_classID:"channelDenoiseParams",Chnl:l.channels.map(function(c){return Ll.encode(c)}),Amnt:l.amount},l.preserveDetails?{EdgF:l.preserveDetails}:{})}),preset:e.filter.preset},filterID:633});case"color halftone":return Q(Q({},t),{Fltr:{_name:"Color Halftone",_classID:"ClrH","Rds ":e.filter.radius,Ang1:e.filter.angle1,Ang2:e.filter.angle2,Ang3:e.filter.angle3,Ang4:e.filter.angle4},filterID:1131180616});case"crystallize":return Q(Q({},t),{Fltr:{_name:"Crystallize",_classID:"Crst",ClSz:e.filter.cellSize,FlRs:e.filter.randomSeed},filterID:1131574132});case"facet":return Q(Q({},t),{filterID:1180922912});case"fragment":return Q(Q({},t),{filterID:1181902701});case"mezzotint":return Q(Q({},t),{Fltr:{_name:"Mezzotint",_classID:"Mztn",MztT:_y.encode(e.filter.type),FlRs:e.filter.randomSeed},filterID:1299870830});case"mosaic":return Q(Q({},t),{Fltr:{_name:"Mosaic",_classID:"Msc ",ClSz:pr(e.filter.cellSize,"cellSize")},filterID:1299407648});case"pointillize":return Q(Q({},t),{Fltr:{_name:"Pointillize",_classID:"Pntl",ClSz:e.filter.cellSize,FlRs:e.filter.randomSeed},filterID:1349416044});case"clouds":return Q(Q({},t),{Fltr:{_name:"Clouds",_classID:"Clds",FlRs:e.filter.randomSeed},filterID:1131177075});case"difference clouds":return Q(Q({},t),{Fltr:{_name:"Difference Clouds",_classID:"DfrC",FlRs:e.filter.randomSeed},filterID:1147564611});case"fibers":return Q(Q({},t),{Fltr:{_name:"Fibers",_classID:"Fbrs",Vrnc:e.filter.variance,Strg:e.filter.strength,RndS:e.filter.randomSeed},filterID:1180856947});case"lens flare":return Q(Q({},t),{Fltr:{_name:"Lens Flare",_classID:"LnsF",Brgh:e.filter.brightness,FlrC:{_name:"",_classID:"Pnt ",Hrzn:e.filter.position.x,Vrtc:e.filter.position.y},"Lns ":xy.encode(e.filter.lensType)},filterID:1282306886});case"sharpen":return Q(Q({},t),{filterID:1399353968});case"sharpen edges":return Q(Q({},t),{filterID:1399353925});case"sharpen more":return Q(Q({},t),{filterID:1399353933});case"smart sharpen":return Q(Q({},t),{Fltr:{_name:"Smart Sharpen",_classID:"smartSharpen",Amnt:Xn(e.filter.amount),"Rds ":Ua(e.filter),Thsh:e.filter.threshold,Angl:e.filter.angle,moreAccurate:e.filter.moreAccurate,blur:wy.encode(e.filter.blur),preset:e.filter.preset,sdwM:{_name:"Parameters",_classID:"adaptCorrectTones",Amnt:Xn(e.filter.shadow.fadeAmount),Wdth:Xn(e.filter.shadow.tonalWidth),"Rds ":e.filter.shadow.radius},hglM:{_name:"Parameters",_classID:"adaptCorrectTones",Amnt:Xn(e.filter.highlight.fadeAmount),Wdth:Xn(e.filter.highlight.tonalWidth),"Rds ":e.filter.highlight.radius}},filterID:698});case"unsharp mask":return Q(Q({},t),{Fltr:{_name:"Unsharp Mask",_classID:"UnsM",Amnt:Xn(e.filter.amount),"Rds ":Ua(e.filter),Thsh:e.filter.threshold},filterID:1433301837});case"diffuse":return Q(Q({},t),{Fltr:{_name:"Diffuse",_classID:"Dfs ","Md ":ky.encode(e.filter.mode),FlRs:e.filter.randomSeed},filterID:1147564832});case"emboss":return Q(Q({},t),{Fltr:{_name:"Emboss",_classID:"Embs",Angl:e.filter.angle,Hght:e.filter.height,Amnt:e.filter.amount},filterID:1164796531});case"extrude":return Q(Q({},t),{Fltr:{_name:"Extrude",_classID:"Extr",ExtS:e.filter.size,ExtD:e.filter.depth,ExtF:e.filter.solidFrontFaces,ExtM:e.filter.maskIncompleteBlocks,ExtT:Sy.encode(e.filter.type),ExtR:Cy.encode(e.filter.depthMode),FlRs:e.filter.randomSeed},filterID:1165522034});case"find edges":return Q(Q({},t),{filterID:1181639749});case"solarize":return Q(Q({},t),{filterID:1399616122});case"tiles":return Q(Q({},t),{Fltr:{_name:"Tiles",_classID:"Tls ",TlNm:e.filter.numberOfTiles,TlOf:e.filter.maximumOffset,FlCl:Ey.encode(e.filter.fillEmptyAreaWith),FlRs:e.filter.randomSeed},filterID:1416393504});case"trace contour":return Q(Q({},t),{Fltr:{_name:"Trace Contour",_classID:"TrcC","Lvl ":e.filter.level,"Edg ":Ay.encode(e.filter.edge)},filterID:1416782659});case"wind":return Q(Q({},t),{Fltr:{_name:"Wind",_classID:"Wnd ",WndM:Ty.encode(e.filter.method),Drct:My.encode(e.filter.direction)},filterID:1466852384});case"de-interlace":return Q(Q({},t),{Fltr:{_name:"De-Interlace",_classID:"Dntr",IntE:Dy.encode(e.filter.eliminate),IntC:zy.encode(e.filter.newFieldsBy)},filterID:1148089458});case"ntsc colors":return Q(Q({},t),{filterID:1314149187});case"invert":return Q(Q({},t),{filterID:1231976050});case"custom":return Q(Q({},t),{Fltr:{_name:"Custom",_classID:"Cstm","Scl ":e.filter.scale,Ofst:e.filter.offset,Mtrx:e.filter.matrix},filterID:1131639917});case"high pass":return Q(Q({},t),{Fltr:{_name:"High Pass",_classID:"HghP","Rds ":Ua(e.filter)},filterID:1214736464});case"maximum":return Q(Q({},t),{Fltr:{_name:"Maximum",_classID:"Mxm ","Rds ":Ua(e.filter)},filterID:1299737888});case"minimum":return Q(Q({},t),{Fltr:{_name:"Minimum",_classID:"Mnm ","Rds ":Ua(e.filter)},filterID:1299082528});case"offset":return Q(Q({},t),{Fltr:{_name:"Offset",_classID:"Ofst",Hrzn:e.filter.horizontal,Vrtc:e.filter.vertical,"Fl ":Iy.encode(e.filter.undefinedAreas)},filterID:1332114292});case"puppet":return Q(Q({},t),{Fltr:{_name:"Rigid Transform",_classID:"rigidTransform",null:["Ordn.Trgt"],rigidType:e.filter.rigidType,puppetShapeList:e.filter.puppetShapeList.map(function(l){return{_name:"",_classID:"puppetShape",rigidType:l.rigidType,VrsM:1,VrsN:0,originalVertexArray:Up(new Float32Array($l(l.originalVertexArray))),deformedVertexArray:Up(new Float32Array($l(l.deformedVertexArray))),indexArray:Up(new Uint32Array(l.indexArray)),pinOffsets:$l(l.pinOffsets),posFinalPins:$l(l.posFinalPins),pinVertexIndices:l.pinVertexIndices,PinP:$l(l.pinPosition),PnRt:l.pinRotation,PnOv:l.pinOverlay,PnDp:l.pinDepth,meshQuality:l.meshQuality,meshExpansion:l.meshExpansion,meshRigidity:l.meshRigidity,imageResolution:l.imageResolution,meshBoundaryPath:{_name:"",_classID:"pathClass",pathComponents:l.meshBoundaryPath.pathComponents.map(function(c){return{_name:"",_classID:"PaCm",shapeOperation:"shapeOperation.".concat(c.shapeOperation),SbpL:c.paths.map(function(u){return{_name:"",_classID:"Sbpl",Clsp:u.closed,"Pts ":u.points.map(function(d){return{_name:"",_classID:"Pthp",Anch:Ul(d.anchor),"Fwd ":Ul(d.forward),"Bwd ":Ul(d.backward),Smoo:d.smooth}})}})}})},selectedPin:l.selectedPin}}),PuX0:e.filter.bounds[0].x,PuX1:e.filter.bounds[1].x,PuX2:e.filter.bounds[2].x,PuX3:e.filter.bounds[3].x,PuY0:e.filter.bounds[0].y,PuY1:e.filter.bounds[1].y,PuY2:e.filter.bounds[2].y,PuY3:e.filter.bounds[3].y},filterID:991});case"oil paint plugin":{for(var r={},n=0;n<e.filter.parameters.length;n++){var a=e.filter.parameters[n],i=a.name,o=a.value,s="".concat(Rn[Math.floor(n/Rn.length)]).concat(Rn[n%Rn.length]);r["PN".concat(s)]=i,r["PT".concat(s)]=0,r["PF".concat(s)]=o}return Q(Q({},t),{Fltr:Q({_name:"Oil Paint Plugin",_classID:"PbPl",KnNm:e.filter.name,GpuY:e.filter.gpu,LIWy:e.filter.lighting,FPth:"1"},r),filterID:1348620396})}case"oil paint":return Q(Q({},t),{Fltr:{_name:"Oil Paint",_classID:"oilPaint",lightingOn:e.filter.lightingOn,stylization:e.filter.stylization,cleanliness:e.filter.cleanliness,brushScale:e.filter.brushScale,microBrush:e.filter.microBrush,LghD:e.filter.lightDirection,specularity:e.filter.specularity},filterID:1122});case"liquify":return Q(Q({},t),{Fltr:{_name:"Liquify",_classID:"LqFy",LqMe:e.filter.liquifyMesh},filterID:1282492025});case"perspective warp":return Q(Q({},t),{Fltr:{_name:"Perspective Warp",_classID:"perspectiveWarpTransform",vertices:e.filter.vertices.map(Ul),warpedVertices:e.filter.warpedVertices.map(Ul),quads:e.filter.quads.map(function(l){return{indices:l}})},filterID:442});case"curves":return Q(Q({},t),{Fltr:Q({_name:"Curves",_classID:"Crvs",presetKind:Oy.encode(e.filter.presetKind)},e.filter.adjustments?{Adjs:e.filter.adjustments.map(function(l){return"curve"in l?{_name:"",_classID:"CrvA",Chnl:l.channels.map(Ll.encode),"Crv ":l.curve.map(function(c){return Q({_name:"",_classID:"Pnt ",Hrzn:c.x,Vrtc:c.y},c.curved?{Cnty:!0}:{})})}:{_name:"",_classID:"CrvA",Chnl:l.channels.map(Ll.encode),Mpng:l.values}})}:{}),filterID:1131574899});case"brightness/contrast":return Q(Q({},t),{Fltr:{_name:"Brightness/Contrast",_classID:"BrgC",Brgh:e.filter.brightness,Cntr:e.filter.contrast,useLegacy:!!e.filter.useLegacy},filterID:1114793795});default:throw new Error("Unknow filter type: ".concat(e.type))}}function S3(e){if(e.warp)return e.warp;if(!e.width||!e.height)throw new Error("You must provide width and height of the linked image in placedLayer");var t=e.width,r=e.height,n=0,a=t/3,i=t*2/3,o=t,s=0,l=r/3,c=r*2/3,u=r;return{style:"custom",value:0,perspective:0,perspectiveOther:0,rotate:"horizontal",bounds:{top:{value:0,units:"Pixels"},left:{value:0,units:"Pixels"},bottom:{value:r,units:"Pixels"},right:{value:t,units:"Pixels"}},uOrder:4,vOrder:4,customEnvelopeWarp:{meshPoints:[{x:n,y:s},{x:a,y:s},{x:i,y:s},{x:o,y:s},{x:n,y:l},{x:a,y:l},{x:i,y:l},{x:o,y:l},{x:n,y:c},{x:a,y:c},{x:i,y:c},{x:o,y:c},{x:n,y:u},{x:a,y:u},{x:i,y:u},{x:o,y:u}]}}}ht("SoLd",ir("placedLayer"),function(e,t,r){if(lr(e)!=="soLD")throw new Error("Invalid SoLd type");var n=dt(e);if(n!==4&&n!==5)throw new Error("Invalid SoLd version");var a=Ft(e,!0);t.placedLayer={id:a.Idnt,placed:a.placed,type:Es[a.Type],pageNumber:a.PgNm,totalPages:a.totalPages,frameStep:gn(a.frameStep),duration:gn(a.duration),frameCount:a.frameCount,transform:a.Trnf,width:a["Sz "].Wdth,height:a["Sz "].Hght,resolution:Jt(a.Rslt),warp:w3(a.quiltWarp||a.warp)},a.nonAffineTransform&&a.nonAffineTransform.some(function(i,o){return i!==a.Trnf[o]})&&(t.placedLayer.nonAffineTransform=a.nonAffineTransform),a.Crop&&(t.placedLayer.crop=a.Crop),a.comp&&(t.placedLayer.comp=a.comp),a.compInfo&&(t.placedLayer.compInfo={compID:a.compInfo.compID,originalCompID:a.compInfo.originalCompID}),a.filterFX&&(t.placedLayer.filter=QR(a.filterFX,e)),ct(e,r())},function(e,t){var r,n;yt(e,"soLD"),gt(e,4);var a=t.placedLayer;if(!a.id||typeof a.id!="string"||!/^[0-9a-f]{8}-([0-9a-f]{4}-){3}[0-9a-f]{12}$/.test(a.id))throw new Error("Placed layer ID must be in a GUID format (example: 20953ddb-9391-11ec-b4f1-c15674f50bc4)");var i=Q(Q({Idnt:a.id,placed:(r=a.placed)!==null&&r!==void 0?r:a.id,PgNm:a.pageNumber||1,totalPages:a.totalPages||1},a.crop?{Crop:a.crop}:{}),{frameStep:a.frameStep||{numerator:0,denominator:600},duration:a.duration||{numerator:0,denominator:600},frameCount:a.frameCount||0,Annt:16,Type:Es.indexOf(a.type),Trnf:a.transform,nonAffineTransform:(n=a.nonAffineTransform)!==null&&n!==void 0?n:a.transform,warp:ou(S3(a)),"Sz ":{_name:"",_classID:"Pnt ",Wdth:a.width||0,Hght:a.height||0},Rslt:a.resolution?pr(a.resolution,"resolution"):{units:"Density",value:72}});if(a.filter&&(i.filterFX={_name:"",_classID:"filterFXStyle",enab:a.filter.enabled,validAtPosition:a.filter.validAtPosition,filterMaskEnable:a.filter.maskEnabled,filterMaskLinked:a.filter.maskLinked,filterMaskExtendWithWhite:a.filter.maskExtendWithWhite,filterFXList:a.filter.list.map(function(s){return eL(s)})}),a.warp&&Np(a.warp)){var o=ou(a.warp);i.quiltWarp=o,i.warp={warpStyle:"warpStyle.warpNone",warpValue:o.warpValue,warpPerspective:o.warpPerspective,warpPerspectiveOther:o.warpPerspectiveOther,warpRotate:o.warpRotate,bounds:o.bounds,uOrder:o.uOrder,vOrder:o.vOrder}}else delete i.quiltWarp;a.comp&&(i.comp=a.comp),a.compInfo&&(i.compInfo=a.compInfo),Lt(e,"","null",i,i.quiltWarp?"quiltWarp":"warp")}),Cs("SoLE","SoLd"),ht("fxrp",ir("referencePoint"),function(e,t){t.referencePoint={x:Zn(e),y:Zn(e)}},function(e,t){Jn(e,t.referencePoint.x),Jn(e,t.referencePoint.y)}),ht("Lr16",function(){return!1},function(e,t,r,n,a){Ap(e,n,a)},function(e,t){}),ht("Lr32",function(){return!1},function(e,t,r,n,a){Ap(e,n,a)},function(e,t){}),ht("LMsk",ir("userMask"),function(e,t){t.userMask={colorSpace:qr(e),opacity:et(e)/255};var r=at(e);if(r!==128)throw new Error("Invalid flag value");ct(e,1)},function(e,t){var r=t.userMask;Kr(e,r.colorSpace),Ve(e,pp(r.opacity,0,1)*255),Qe(e,128),qt(e,1)}),ht("Patt",function(e){return!e},function(e,t,r){r()&&ct(e,r())},function(e,t){});function C3(e){var t=dt(e),r=dt(e),n=dt(e),a=dt(e);return{top:t,left:r,bottom:n,right:a}}function E3(e,t){gt(e,t.top),gt(e,t.left),gt(e,t.bottom),gt(e,t.right)}ht("Anno",function(e){return e.annotations!==void 0},function(e,t,r){var n=et(e),a=et(e);if(n!==2||a!==1)throw new Error("Invalid Anno version");for(var i=Ne(e),o=[],s=0;s<i;s++){Ne(e);var l=lr(e),c=!!at(e);at(e),et(e);var u=C3(e),d=C3(e),f=qr(e),p=ua(e,2),_=ua(e,2),h=ua(e,2);Ne(e),lr(e);var b=Ne(e),v=void 0;if(l==="txtA")b>=2&&et(e)===65279?v=Ep(e,(b-2)/2):(e.offset-=2,v=tu(e,b)),v=v.replace(/\r/g,`
|
|
292
|
-
`);else if(l==="sndA")v=Tr(e,b);else throw new Error("Unknown annotation type");o.push({type:l==="txtA"?"text":"sound",open:c,iconLocation:u,popupLocation:d,color:f,author:p,name:_,date:h,data:v})}t.annotations=o,ct(e,r())},function(e,t){var r=t.annotations;Ve(e,2),Ve(e,1),it(e,r.length);for(var n=0,a=r;n<a.length;n++){var i=a[n],o=i.type==="sound";if(o&&!(i.data instanceof Uint8Array))throw new Error("Sound annotation data should be Uint8Array");if(!o&&typeof i.data!="string")throw new Error("Text annotation data should be string");var s=e.offset;it(e,0),yt(e,o?"sndA":"txtA"),Qe(e,i.open?1:0),Qe(e,28),Ve(e,1),E3(e,i.iconLocation),E3(e,i.popupLocation),Kr(e,i.color),Wi(e,i.author||"",2),Wi(e,i.name||"",2),Wi(e,i.date||"",2);var l=e.offset;it(e,0),yt(e,o?"sndM":"txtC"),it(e,0);var c=e.offset;if(o)pa(e,i.data);else{Ve(e,65279);for(var u=i.data.replace(/\n/g,"\r"),d=0;d<u.length;d++)Ve(e,u.charCodeAt(d))}e.view.setUint32(s,e.offset-s,!1),e.view.setUint32(l,e.offset-l,!1),e.view.setUint32(c-4,e.offset-c,!1)}});function A3(e){ht(e,function(t){var r=t;return!(!r.linkedFiles||!r.linkedFiles.length||e==="lnkE"&&!r.linkedFiles.some(function(n){return n.linkedFile}))},function(t,r,n,a){var i=r;for(i.linkedFiles=i.linkedFiles||[];n()>8;){var o=Bp(t),s=t.offset,l=lr(t),c=dt(t),u=ua(t,1),d=Rr(t),f=lr(t).trim(),p=lr(t).trim(),_=Bp(t),h=at(t),b=h?Ft(t):void 0,v=l==="liFE"?Ft(t):void 0,m={id:u,name:d};if(f&&(m.type=f),p&&(m.creator=p),b&&(m.descriptor={compInfo:{compID:b.compInfo.compID,originalCompID:b.compInfo.originalCompID}}),l==="liFE"&&c>3){var y=dt(t),g=at(t),S=at(t),M=at(t),E=at(t),w=Zn(t),x=Math.floor(w),C=(w-x)*1e3;m.time=new Date(Date.UTC(y,g,S,M,E,x,C)).toISOString()}var D=l==="liFE"?Bp(t):0;for(l==="liFA"&&ct(t,8),l==="liFD"&&(m.data=Tr(t,_)),c>=5&&(m.childDocumentID=Rr(t)),c>=6&&(m.assetModTime=Zn(t)),c>=7&&(m.assetLockedState=at(t)),l==="liFE"&&c===2&&(m.data=Tr(t,D)),t.skipLinkedFilesData&&(m.data=void 0),e==="lnkE"&&(m.linkedFile={fileSize:D,name:(v==null?void 0:v["Nm "])||"",fullPath:(v==null?void 0:v.fullPath)||"",originalPath:(v==null?void 0:v.originalPath)||"",relativePath:(v==null?void 0:v.relPath)||""}),i.linkedFiles.push(m);o%4;)o++;t.offset=s+o}ct(t,n())},function(t,r){for(var n,a,i,o,s,l,c,u,d,f=r,p=0,_=f.linkedFiles;p<_.length;p++){var h=_[p];if(e==="lnkE"==!!h.linkedFile){var b=2;h.assetLockedState!=null?b=7:h.assetModTime!=null?b=6:h.childDocumentID!=null?b=5:e==="lnkE"&&(b=3),$p(t,0);var v=t.offset;if(yt(t,e==="lnkE"?"liFE":h.data?"liFD":"liFA"),gt(t,b),!h.id||typeof h.id!="string"||!/^[0-9a-f]{8}-([0-9a-f]{4}-){3}[0-9a-f]{12}$/.test(h.id))throw new Error("Linked file ID must be in a GUID format (example: 20953ddb-9391-11ec-b4f1-c15674f50bc4)");if(Wi(t,h.id,1),So(t,h.name||""),yt(t,h.type?"".concat(h.type," ").substring(0,4):" "),yt(t,h.creator?"".concat(h.creator," ").substring(0,4):"\0\0\0\0"),$p(t,h.data?h.data.byteLength:0),h.descriptor&&h.descriptor.compInfo){var m={compInfo:{compID:h.descriptor.compInfo.compID,originalCompID:h.descriptor.compInfo.originalCompID}};Qe(t,1),Lt(t,"","null",m)}else Qe(t,0);if(e==="lnkE"){var m={descVersion:2,"Nm ":(a=(n=h.linkedFile)===null||n===void 0?void 0:n.name)!==null&&a!==void 0?a:"",fullPath:(o=(i=h.linkedFile)===null||i===void 0?void 0:i.fullPath)!==null&&o!==void 0?o:"",originalPath:(l=(s=h.linkedFile)===null||s===void 0?void 0:s.originalPath)!==null&&l!==void 0?l:"",relPath:(u=(c=h.linkedFile)===null||c===void 0?void 0:c.relativePath)!==null&&u!==void 0?u:""};Lt(t,"","ExternalFileLink",m);var y=h.time?new Date(h.time):new Date;gt(t,y.getUTCFullYear()),Qe(t,y.getUTCMonth()),Qe(t,y.getUTCDate()),Qe(t,y.getUTCHours()),Qe(t,y.getUTCMinutes()),Jn(t,y.getUTCSeconds()+y.getUTCMilliseconds()/1e3)}h.data?pa(t,h.data):$p(t,((d=h.linkedFile)===null||d===void 0?void 0:d.fileSize)||0),b>=5&&So(t,h.childDocumentID||""),b>=6&&Jn(t,h.assetModTime||0),b>=7&&Qe(t,h.assetLockedState||0);var g=t.offset-v;for(t.view.setUint32(v-4,g,!1);g%4;)g++,Qe(t,0)}}})}A3("lnk2"),A3("lnkE"),Cs("lnkD","lnk2"),Cs("lnk3","lnk2"),ht("pths",ir("pathList"),function(e,t){Ft(e,!0),t.pathList=[]},function(e,t){var r={pathList:[]};Lt(e,"","pathsDataClass",r)}),ht("lyvr",ir("version"),function(e,t){return t.version=Ne(e)},function(e,t){return it(e,t.version)}),ht("lfxs",function(){return!1},function(e,t,r){var n=Ne(e);if(n!==0)throw new Error("Invalid lfxs version");var a=Ft(e);t.effects=Il(a,!!e.logMissingFeatures),ct(e,r())},function(e,t,r,n){var a=zl(t.effects,!!n.logMissingFeatures,!0);it(e,0),Lt(e,"","null",a)});function an(e){return function(t){return!!t.adjustment&&t.adjustment.type===e}}ht("brit",an("brightness/contrast"),function(e,t,r){t.adjustment||(t.adjustment={type:"brightness/contrast",brightness:Ot(e),contrast:Ot(e),meanValue:Ot(e),labColorOnly:!!at(e),useLegacy:!0}),ct(e,r())},function(e,t){var r,n=t.adjustment;Vt(e,n.brightness||0),Vt(e,n.contrast||0),Vt(e,(r=n.meanValue)!==null&&r!==void 0?r:127),Qe(e,n.labColorOnly?1:0),qt(e,1)});function lu(e){var t=Ot(e),r=Ot(e),n=Ot(e),a=Ot(e),i=Ot(e)/100;return{shadowInput:t,highlightInput:r,shadowOutput:n,highlightOutput:a,midtoneInput:i}}function Hl(e,t){Vt(e,t.shadowInput),Vt(e,t.highlightInput),Vt(e,t.shadowOutput),Vt(e,t.highlightOutput),Vt(e,Math.round(t.midtoneInput*100))}ht("levl",an("levels"),function(e,t,r){if(et(e)!==2)throw new Error("Invalid levl version");t.adjustment=Q(Q({},t.adjustment),{type:"levels",rgb:lu(e),red:lu(e),green:lu(e),blue:lu(e)}),ct(e,r())},function(e,t){var r=t.adjustment,n={shadowInput:0,highlightInput:255,shadowOutput:0,highlightOutput:255,midtoneInput:1};Ve(e,2),Hl(e,r.rgb||n),Hl(e,r.red||n),Hl(e,r.blue||n),Hl(e,r.green||n);for(var a=0;a<59;a++)Hl(e,n)});function cu(e){for(var t=et(e),r=[],n=0;n<t;n++){var a=Ot(e),i=Ot(e);r.push({input:i,output:a})}return r}function qi(e,t){Ve(e,t.length);for(var r=0,n=t;r<n.length;r++){var a=n[r];Ve(e,a.output),Ve(e,a.input)}}ht("curv",an("curves"),function(e,t,r){if(at(e),et(e)!==1)throw new Error("Invalid curv version");et(e);var n=et(e),a={type:"curves"};n&1&&(a.rgb=cu(e)),n&2&&(a.red=cu(e)),n&4&&(a.green=cu(e)),n&8&&(a.blue=cu(e)),t.adjustment=Q(Q({},t.adjustment),a),ct(e,r())},function(e,t){var r=t.adjustment,n=r.rgb,a=r.red,i=r.green,o=r.blue,s=0,l=0;n&&n.length&&(s|=1,l++),a&&a.length&&(s|=2,l++),i&&i.length&&(s|=4,l++),o&&o.length&&(s|=8,l++),Qe(e,0),Ve(e,1),Ve(e,0),Ve(e,s),n&&n.length&&qi(e,n),a&&a.length&&qi(e,a),i&&i.length&&qi(e,i),o&&o.length&&qi(e,o),yt(e,"Crv "),Ve(e,4),Ve(e,0),Ve(e,l),n&&n.length&&(Ve(e,0),qi(e,n)),a&&a.length&&(Ve(e,1),qi(e,a)),i&&i.length&&(Ve(e,2),qi(e,i)),o&&o.length&&(Ve(e,3),qi(e,o))}),ht("expA",an("exposure"),function(e,t,r){if(et(e)!==1)throw new Error("Invalid expA version");t.adjustment=Q(Q({},t.adjustment),{type:"exposure",exposure:la(e),offset:la(e),gamma:la(e)}),ct(e,r())},function(e,t){var r=t.adjustment;Ve(e,1),fa(e,r.exposure),fa(e,r.offset),fa(e,r.gamma),qt(e,2)}),ht("vibA",an("vibrance"),function(e,t,r){var n=Ft(e);t.adjustment={type:"vibrance"},n.vibrance!==void 0&&(t.adjustment.vibrance=n.vibrance),n.Strt!==void 0&&(t.adjustment.saturation=n.Strt),ct(e,r())},function(e,t){var r=t.adjustment,n={};r.vibrance!==void 0&&(n.vibrance=r.vibrance),r.saturation!==void 0&&(n.Strt=r.saturation),Lt(e,"","null",n)});function wo(e){return{a:Ot(e),b:Ot(e),c:Ot(e),d:Ot(e),hue:Ot(e),saturation:Ot(e),lightness:Ot(e)}}function ko(e,t){var r=t||{};Vt(e,r.a||0),Vt(e,r.b||0),Vt(e,r.c||0),Vt(e,r.d||0),Vt(e,r.hue||0),Vt(e,r.saturation||0),Vt(e,r.lightness||0)}ht("hue2",an("hue/saturation"),function(e,t,r){if(et(e)!==2)throw new Error("Invalid hue2 version");t.adjustment=Q(Q({},t.adjustment),{type:"hue/saturation",master:wo(e),reds:wo(e),yellows:wo(e),greens:wo(e),cyans:wo(e),blues:wo(e),magentas:wo(e)}),ct(e,r())},function(e,t){var r=t.adjustment;Ve(e,2),ko(e,r.master),ko(e,r.reds),ko(e,r.yellows),ko(e,r.greens),ko(e,r.cyans),ko(e,r.blues),ko(e,r.magentas)});function Hp(e){return{cyanRed:Ot(e),magentaGreen:Ot(e),yellowBlue:Ot(e)}}function jp(e,t){Vt(e,t.cyanRed||0),Vt(e,t.magentaGreen||0),Vt(e,t.yellowBlue||0)}ht("blnc",an("color balance"),function(e,t,r){t.adjustment={type:"color balance",shadows:Hp(e),midtones:Hp(e),highlights:Hp(e),preserveLuminosity:!!at(e)},ct(e,r())},function(e,t){var r=t.adjustment;jp(e,r.shadows||{}),jp(e,r.midtones||{}),jp(e,r.highlights||{}),Qe(e,r.preserveLuminosity?1:0),qt(e,1)}),ht("blwh",an("black & white"),function(e,t,r){var n=Ft(e);t.adjustment={type:"black & white",reds:n["Rd "],yellows:n.Yllw,greens:n["Grn "],cyans:n["Cyn "],blues:n["Bl "],magentas:n.Mgnt,useTint:!!n.useTint,presetKind:n.bwPresetKind,presetFileName:n.blackAndWhitePresetFileName},n.tintColor!==void 0&&(t.adjustment.tintColor=oa(n.tintColor)),ct(e,r())},function(e,t){var r=t.adjustment,n={"Rd ":r.reds||0,Yllw:r.yellows||0,"Grn ":r.greens||0,"Cyn ":r.cyans||0,"Bl ":r.blues||0,Mgnt:r.magentas||0,useTint:!!r.useTint,tintColor:sa(r.tintColor),bwPresetKind:r.presetKind||0,blackAndWhitePresetFileName:r.presetFileName||""};Lt(e,"","null",n)}),ht("phfl",an("photo filter"),function(e,t,r){var n=et(e);if(n!==2&&n!==3)throw new Error("Invalid phfl version");var a;n===2?a=qr(e):a={l:dt(e)/100,a:dt(e)/100,b:dt(e)/100},t.adjustment={type:"photo filter",color:a,density:Ne(e)/100,preserveLuminosity:!!at(e)},ct(e,r())},function(e,t){var r=t.adjustment;Ve(e,2),Kr(e,r.color||{l:0,a:0,b:0}),it(e,(r.density||0)*100),Qe(e,r.preserveLuminosity?1:0),qt(e,3)});function uu(e){var t=Ot(e),r=Ot(e),n=Ot(e);ct(e,2);var a=Ot(e);return{red:t,green:r,blue:n,constant:a}}function jl(e,t){var r=t||{};Vt(e,r.red),Vt(e,r.green),Vt(e,r.blue),qt(e,2),Vt(e,r.constant)}ht("mixr",an("channel mixer"),function(e,t,r){if(et(e)!==1)throw new Error("Invalid mixr version");var n=t.adjustment=Q(Q({},t.adjustment),{type:"channel mixer",monochrome:!!et(e)});n.monochrome||(n.red=uu(e),n.green=uu(e),n.blue=uu(e)),n.gray=uu(e),ct(e,r())},function(e,t){var r=t.adjustment;Ve(e,1),Ve(e,r.monochrome?1:0),r.monochrome?(jl(e,r.gray),qt(e,3*5*2)):(jl(e,r.red),jl(e,r.green),jl(e,r.blue),jl(e,r.gray))});var T3=_t("colorLookupType","3DLUT",{"3dlut":"3DLUT",abstractProfile:"abstractProfile",deviceLinkProfile:"deviceLinkProfile"}),M3=_t("LUTFormatType","look",{look:"LUTFormatLOOK",cube:"LUTFormatCUBE","3dl":"LUTFormat3DL"}),fu=_t("colorLookupOrder","rgb",{rgb:"rgbOrder",bgr:"bgrOrder"});ht("clrL",an("color lookup"),function(e,t,r){if(et(e)!==1)throw new Error("Invalid clrL version");var n=Ft(e);t.adjustment={type:"color lookup"};var a=t.adjustment;n.lookupType!==void 0&&(a.lookupType=T3.decode(n.lookupType)),n["Nm "]!==void 0&&(a.name=n["Nm "]),n.Dthr!==void 0&&(a.dither=n.Dthr),n.profile!==void 0&&(a.profile=n.profile),n.LUTFormat!==void 0&&(a.lutFormat=M3.decode(n.LUTFormat)),n.dataOrder!==void 0&&(a.dataOrder=fu.decode(n.dataOrder)),n.tableOrder!==void 0&&(a.tableOrder=fu.decode(n.tableOrder)),n.LUT3DFileData!==void 0&&(a.lut3DFileData=n.LUT3DFileData),n.LUT3DFileName!==void 0&&(a.lut3DFileName=n.LUT3DFileName),ct(e,r())},function(e,t){var r=t.adjustment,n={};r.lookupType!==void 0&&(n.lookupType=T3.encode(r.lookupType)),r.name!==void 0&&(n["Nm "]=r.name),r.dither!==void 0&&(n.Dthr=r.dither),r.profile!==void 0&&(n.profile=r.profile),r.lutFormat!==void 0&&(n.LUTFormat=M3.encode(r.lutFormat)),r.dataOrder!==void 0&&(n.dataOrder=fu.encode(r.dataOrder)),r.tableOrder!==void 0&&(n.tableOrder=fu.encode(r.tableOrder)),r.lut3DFileData!==void 0&&(n.LUT3DFileData=r.lut3DFileData),r.lut3DFileName!==void 0&&(n.LUT3DFileName=r.lut3DFileName),Ve(e,1),Lt(e,"","null",n)}),ht("nvrt",an("invert"),function(e,t,r){t.adjustment={type:"invert"},ct(e,r())},function(){}),ht("post",an("posterize"),function(e,t,r){t.adjustment={type:"posterize",levels:et(e)},ct(e,r())},function(e,t){var r,n=t.adjustment;Ve(e,(r=n.levels)!==null&&r!==void 0?r:4),qt(e,2)}),ht("thrs",an("threshold"),function(e,t,r){t.adjustment={type:"threshold",level:et(e)},ct(e,r())},function(e,t){var r,n=t.adjustment;Ve(e,(r=n.level)!==null&&r!==void 0?r:128),qt(e,2)});var D3=["","","","rgb","hsb","","lab"];ht("grdm",an("gradient map"),function(e,t,r){var n=et(e);if(n!==1&&n!==3)throw new Error("Invalid grdm version");var a={type:"gradient map",gradientType:"solid"};a.reverse=!!at(e),a.dither=!!at(e);var i=!!at(e);if(e.offset--,i){var o=lr(e);a.method=gs.decode(o)}a.name=Rr(e),a.colorStops=[],a.opacityStops=[];for(var s=et(e),l=0;l<s;l++)a.colorStops.push({location:Ne(e),midpoint:Ne(e)/100,color:qr(e)}),ct(e,2);for(var c=et(e),l=0;l<c;l++)a.opacityStops.push({location:Ne(e),midpoint:Ne(e)/100,opacity:et(e)/255});var u=et(e);if(u!==2)throw new Error("Invalid grdm expansion count");var d=et(e);a.smoothness=d/4096;var f=et(e);if(f!==32)throw new Error("Invalid grdm length");a.gradientType=et(e)?"noise":"solid",a.randomSeed=Ne(e),a.addTransparency=!!et(e),a.restrictColors=!!et(e),a.roughness=Ne(e)/4096,a.colorModel=D3[et(e)]||"rgb",a.min=[et(e)/32768,et(e)/32768,et(e)/32768,et(e)/32768],a.max=[et(e)/32768,et(e)/32768,et(e)/32768,et(e)/32768],ct(e,r());for(var p=0,_=a.colorStops;p<_.length;p++){var h=_[p];h.location/=d}for(var b=0,v=a.opacityStops;b<v.length;b++){var h=v[b];h.location/=d}t.adjustment=a},function(e,t){var r,n,a,i=t.adjustment;Ve(e,i.method!==void 0?3:1),Qe(e,i.reverse?1:0),Qe(e,i.dither?1:0),i.method!==void 0&&yt(e,gs.encode(i.method)),So(e,i.name||""),Ve(e,i.colorStops&&i.colorStops.length||0);for(var o=Math.round(((r=i.smoothness)!==null&&r!==void 0?r:1)*4096),s=0,l=i.colorStops||[];s<l.length;s++){var c=l[s];it(e,Math.round(c.location*o)),it(e,Math.round(c.midpoint*100)),Kr(e,c.color),qt(e,2)}Ve(e,i.opacityStops&&i.opacityStops.length||0);for(var u=0,d=i.opacityStops||[];u<d.length;u++){var c=d[u];it(e,Math.round(c.location*o)),it(e,Math.round(c.midpoint*100)),Ve(e,Math.round(c.opacity*255))}Ve(e,2),Ve(e,o),Ve(e,32),Ve(e,i.gradientType==="noise"?1:0),it(e,i.randomSeed||0),Ve(e,i.addTransparency?1:0),Ve(e,i.restrictColors?1:0),it(e,Math.round(((n=i.roughness)!==null&&n!==void 0?n:1)*4096));var f=D3.indexOf((a=i.colorModel)!==null&&a!==void 0?a:"rgb");Ve(e,f===-1?3:f);for(var p=0;p<4;p++)Ve(e,Math.round((i.min&&i.min[p]||0)*32768));for(var p=0;p<4;p++)Ve(e,Math.round((i.max&&i.max[p]||0)*32768));qt(e,4)});function vi(e){return{c:Ot(e),m:Ot(e),y:Ot(e),k:Ot(e)}}function mi(e,t){var r=t||{};Vt(e,r.c),Vt(e,r.m),Vt(e,r.y),Vt(e,r.k)}ht("selc",an("selective color"),function(e,t){if(et(e)!==1)throw new Error("Invalid selc version");var r=et(e)?"absolute":"relative";ct(e,8),t.adjustment={type:"selective color",mode:r,reds:vi(e),yellows:vi(e),greens:vi(e),cyans:vi(e),blues:vi(e),magentas:vi(e),whites:vi(e),neutrals:vi(e),blacks:vi(e)}},function(e,t){var r=t.adjustment;Ve(e,1),Ve(e,r.mode==="absolute"?1:0),qt(e,8),mi(e,r.reds),mi(e,r.yellows),mi(e,r.greens),mi(e,r.cyans),mi(e,r.blues),mi(e,r.magentas),mi(e,r.whites),mi(e,r.neutrals),mi(e,r.blacks)}),ht("CgEd",function(e){var t=e.adjustment;return t?t.type==="brightness/contrast"&&!t.useLegacy||(t.type==="levels"||t.type==="curves"||t.type==="exposure"||t.type==="channel mixer"||t.type==="hue/saturation")&&t.presetFileName!==void 0:!1},function(e,t,r){var n=Ft(e);if(n.Vrsn!==1)throw new Error("Invalid CgEd version");"presetFileName"in n?t.adjustment=Q(Q({},t.adjustment),{presetKind:n.presetKind,presetFileName:n.presetFileName}):"curvesPresetFileName"in n?t.adjustment=Q(Q({},t.adjustment),{presetKind:n.curvesPresetKind,presetFileName:n.curvesPresetFileName}):"mixerPresetFileName"in n?t.adjustment=Q(Q({},t.adjustment),{presetKind:n.mixerPresetKind,presetFileName:n.mixerPresetFileName}):t.adjustment={type:"brightness/contrast",brightness:n.Brgh,contrast:n.Cntr,meanValue:n.means,useLegacy:!!n.useLegacy,labColorOnly:!!n["Lab "],auto:!!n.Auto},ct(e,r())},function(e,t){var r,n,a,i,o=t.adjustment;if(o.type==="levels"||o.type==="exposure"||o.type==="hue/saturation"){var s={Vrsn:1,presetKind:(r=o.presetKind)!==null&&r!==void 0?r:1,presetFileName:o.presetFileName||""};Lt(e,"","null",s)}else if(o.type==="curves"){var s={Vrsn:1,curvesPresetKind:(n=o.presetKind)!==null&&n!==void 0?n:1,curvesPresetFileName:o.presetFileName||""};Lt(e,"","null",s)}else if(o.type==="channel mixer"){var s={Vrsn:1,mixerPresetKind:(a=o.presetKind)!==null&&a!==void 0?a:1,mixerPresetFileName:o.presetFileName||""};Lt(e,"","null",s)}else if(o.type==="brightness/contrast"){var s={Vrsn:1,Brgh:o.brightness||0,Cntr:o.contrast||0,means:(i=o.meanValue)!==null&&i!==void 0?i:127,"Lab ":!!o.labColorOnly,useLegacy:!!o.useLegacy,Auto:!!o.auto};Lt(e,"","null",s)}else throw new Error("Unhandled CgEd case")});function tL(e){var t=[];function r(n){var a;if(n.children)for(var i=0,o=n.children;i<o.length;i++){var s=o[i];((a=s.text)===null||a===void 0?void 0:a.index)!==void 0&&(t[s.text.index]=s),r(s)}}return r(e),t}ht("Txt2",ir("engineData"),function(e,t,r,n){var a=Tr(e,r());t.engineData=p4(a);var i=tL(n),o=l3(a),s=KR(o),l=s.ResourceDict.TextFrameSet;if(l)for(var c=0;c<l.length;c++){var u=i[c];l[c].path&&(u!=null&&u.text)&&(u.text.textPath=l[c].path)}},function(e,t){var r=d4(t.engineData);pa(e,r)}),ht("FEid",ir("filterEffectsMasks"),function(e,t,r){var n=dt(e);if(n<1||n>3)throw new Error("Invalid filterEffects version ".concat(n));for(t.filterEffectsMasks=[];r()>8;){if(Ne(e))throw new Error("filterEffects: 64 bit length is not supported");var a=Ne(e),i=e.offset+a,o=ua(e,1),s=dt(e);if(s!==1)throw new Error("Invalid filterEffect version ".concat(s));if(Ne(e))throw new Error("filterEffect: 64 bit length is not supported");Ne(e);for(var l=dt(e),c=dt(e),u=dt(e),d=dt(e),f=dt(e),p=dt(e),_=[],h=0;h<p+2;h++){var b=dt(e);if(b){if(Ne(e))throw new Error("filterEffect: 64 bit length is not supported");var v=Ne(e);if(!v)throw new Error("filterEffect: Empty channel");var m=et(e),y=Tr(e,v-2);_.push({compressionMode:m,data:y})}else _.push(void 0)}if(t.filterEffectsMasks.push({id:o,top:l,left:c,bottom:u,right:d,depth:f,channels:_}),e.offset<i&&at(e)){var g=dt(e),S=dt(e),M=dt(e),E=dt(e);if(Ne(e))throw new Error("filterEffect: 64 bit length is not supported");var w=Ne(e),m=et(e),y=Tr(e,w-2);t.filterEffectsMasks[t.filterEffectsMasks.length-1].extra={top:g,left:S,bottom:M,right:E,compressionMode:m,data:y}}e.offset=i;for(var x=a;x%4;)e.offset++,x++}},function(e,t){var r;gt(e,3);for(var n=0,a=t.filterEffectsMasks;n<a.length;n++){var i=a[n];it(e,0),it(e,0);var o=e.offset;Wi(e,i.id,1),gt(e,1),it(e,0),it(e,0);var s=e.offset;gt(e,i.top),gt(e,i.left),gt(e,i.bottom),gt(e,i.right),gt(e,i.depth);var l=Math.max(0,i.channels.length-2);gt(e,l);for(var c=0;c<l+2;c++){var u=i.channels[c];gt(e,u?1:0),u&&(it(e,0),it(e,u.data.length+2),Ve(e,u.compressionMode),pa(e,u.data))}e.view.setUint32(s-4,e.offset-s,!1);var d=(r=t.filterEffectsMasks[t.filterEffectsMasks.length-1])===null||r===void 0?void 0:r.extra;d&&(Qe(e,1),gt(e,d.top),gt(e,d.left),gt(e,d.bottom),gt(e,d.right),it(e,0),it(e,d.data.byteLength+2),Ve(e,d.compressionMode),pa(e,d.data));var f=e.offset-o;for(e.view.setUint32(o-4,f,!1);f%4;)qt(e,1),f++}}),Cs("FXid","FEid"),ht("FMsk",ir("filterMask"),function(e,t){t.filterMask={colorSpace:qr(e),opacity:et(e)/255}},function(e,t){var r;Kr(e,t.filterMask.colorSpace),Ve(e,pp((r=t.filterMask.opacity)!==null&&r!==void 0?r:1,0,1)*255)}),ht("artd",function(e){return e.artboards!==void 0},function(e,t,r){var n=Ft(e);t.artboards={count:n["Cnt "],autoExpandOffset:{horizontal:n.autoExpandOffset.Hrzn,vertical:n.autoExpandOffset.Vrtc},origin:{horizontal:n.origin.Hrzn,vertical:n.origin.Vrtc},autoExpandEnabled:n.autoExpandEnabled,autoNestEnabled:n.autoNestEnabled,autoPositionEnabled:n.autoPositionEnabled,shrinkwrapOnSaveEnabled:!!n.shrinkwrapOnSaveEnabled,docDefaultNewArtboardBackgroundColor:oa(n.docDefaultNewArtboardBackgroundColor),docDefaultNewArtboardBackgroundType:n.docDefaultNewArtboardBackgroundType},ct(e,r())},function(e,t){var r,n,a,i,o,s=t.artboards,l={"Cnt ":s.count,autoExpandOffset:s.autoExpandOffset?{Hrzn:s.autoExpandOffset.horizontal,Vrtc:s.autoExpandOffset.vertical}:{Hrzn:0,Vrtc:0},origin:s.origin?{Hrzn:s.origin.horizontal,Vrtc:s.origin.vertical}:{Hrzn:0,Vrtc:0},autoExpandEnabled:(r=s.autoExpandEnabled)!==null&&r!==void 0?r:!0,autoNestEnabled:(n=s.autoNestEnabled)!==null&&n!==void 0?n:!0,autoPositionEnabled:(a=s.autoPositionEnabled)!==null&&a!==void 0?a:!0,shrinkwrapOnSaveEnabled:(i=s.shrinkwrapOnSaveEnabled)!==null&&i!==void 0?i:!0,docDefaultNewArtboardBackgroundColor:sa(s.docDefaultNewArtboardBackgroundColor),docDefaultNewArtboardBackgroundType:(o=s.docDefaultNewArtboardBackgroundType)!==null&&o!==void 0?o:1};Lt(e,"","null",l,"artd")});function z3(e){return Object.keys(e).map(function(t){return e[t]}).some(function(t){return Array.isArray(t)&&t.length>1})}ht("lfx2",function(e){return e.effects!==void 0&&!z3(e.effects)},function(e,t,r){var n=Ne(e);if(n!==0)throw new Error("Invalid lfx2 version");var a=Ft(e);t.effects=Il(a,!!e.logMissingFeatures),ct(e,r())},function(e,t,r,n){var a=zl(t.effects,!!n.logMissingFeatures,!0);it(e,0),Lt(e,"","null",a)}),ht("cinf",ir("compositorUsed"),function(e,t,r){var n=Ft(e);function a(i){return i.split(".")[1]}t.compositorUsed={description:n.description,reason:n.reason,engine:a(n.Engn)},n.Vrsn&&(t.compositorUsed.version=n.Vrsn),n.psVersion&&(t.compositorUsed.photoshopVersion=n.psVersion),n.enableCompCore&&(t.compositorUsed.enableCompCore=a(n.enableCompCore)),n.enableCompCoreGPU&&(t.compositorUsed.enableCompCoreGPU=a(n.enableCompCoreGPU)),n.enableCompCoreThreads&&(t.compositorUsed.enableCompCoreThreads=a(n.enableCompCoreThreads)),n.compCoreSupport&&(t.compositorUsed.compCoreSupport=a(n.compCoreSupport)),n.compCoreGPUSupport&&(t.compositorUsed.compCoreGPUSupport=a(n.compCoreGPUSupport)),ct(e,r())},function(e,t){var r=t.compositorUsed,n={Vrsn:r.version||{major:1,minor:0,fix:0}};r.photoshopVersion&&(n.psVersion=r.photoshopVersion),n.description=r.description,n.reason=r.reason,n.Engn="Engn.".concat(r.engine),r.enableCompCore&&(n.enableCompCore="enable.".concat(r.enableCompCore)),r.enableCompCoreGPU&&(n.enableCompCoreGPU="enable.".concat(r.enableCompCoreGPU)),r.enableCompCoreThreads&&(n.enableCompCoreThreads="enable.".concat(r.enableCompCoreThreads)),r.compCoreSupport&&(n.compCoreSupport="reason.".concat(r.compCoreSupport)),r.compCoreGPUSupport&&(n.compCoreGPUSupport="reason.".concat(r.compCoreGPUSupport)),Lt(e,"","null",n)}),ht("extn",function(e){return e._extn!==void 0},function(e,t){Ft(e)},function(e,t){}),ht("iOpa",ir("fillOpacity"),function(e,t){t.fillOpacity=at(e)/255,ct(e,3)},function(e,t){Qe(e,t.fillOpacity*255),qt(e,3)}),ht("brst",ir("channelBlendingRestrictions"),function(e,t,r){for(t.channelBlendingRestrictions=[];r()>4;)t.channelBlendingRestrictions.push(dt(e))},function(e,t){for(var r=0,n=t.channelBlendingRestrictions;r<n.length;r++){var a=n[r];gt(e,a)}}),ht("tsly",ir("transparencyShapesLayer"),function(e,t){t.transparencyShapesLayer=!!at(e),ct(e,3)},function(e,t){Qe(e,t.transparencyShapesLayer?1:0),qt(e,3)});var Ki=function(){return Ki=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++){t=arguments[r];for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a])}return e},Ki.apply(this,arguments)};function I3(e){e===void 0&&(e=4096);var t=new ArrayBuffer(e),r=new DataView(t),n=0;return{buffer:t,view:r,offset:n,tempBuffer:void 0}}function rL(e){return e.buffer.slice(0,e.offset)}function nL(e){return new Uint8Array(e.buffer,0,e.offset)}function Qe(e,t){var r=gi(e,1);e.view.setUint8(r,t)}function Vt(e,t){var r=gi(e,2);e.view.setInt16(r,t,!1)}function Ve(e,t){var r=gi(e,2);e.view.setUint16(r,t,!1)}function aL(e,t){var r=gi(e,2);e.view.setUint16(r,t,!0)}function gt(e,t){var r=gi(e,4);e.view.setInt32(r,t,!1)}function O3(e,t){var r=gi(e,4);e.view.setInt32(r,t,!0)}function it(e,t){var r=gi(e,4);e.view.setUint32(r,t,!1)}function fa(e,t){var r=gi(e,4);e.view.setFloat32(r,t,!1)}function Jn(e,t){var r=gi(e,8);e.view.setFloat64(r,t,!1)}function Ln(e,t){gt(e,t*65536)}function da(e,t){gt(e,t*(1<<24))}function pa(e,t){if(t){$3(e,e.offset+t.length);var r=new Uint8Array(e.buffer);r.set(t,e.offset),e.offset+=t.length}}function qt(e,t){for(var r=0;r<t;r++)Qe(e,0)}function yt(e,t){if(t.length!==4)throw new Error("Invalid signature: '".concat(t,"'"));for(var r=0;r<4;r++)Qe(e,t.charCodeAt(r))}function iL(e,t){for(var r=0;r<t.length;r++)Qe(e,t.charCodeAt(r))}function Wi(e,t,r){var n=t.length;if(n>255)throw new Error("String too long");Qe(e,n);for(var a=0;a<n;a++){var i=t.charCodeAt(a);Qe(e,i<128?i:63)}for(;++n%r;)Qe(e,0)}function oL(e,t){for(var r=0;r<t.length;r++)Ve(e,t.charCodeAt(r))}function sL(e,t){for(var r=0;r<t.length;r++)aL(e,t.charCodeAt(r))}function Bn(e,t){it(e,t.length),oL(e,t)}function So(e,t){it(e,t.length+1);for(var r=0;r<t.length;r++)Ve(e,t.charCodeAt(r));Ve(e,0)}function P3(e){e===void 0&&(e=[]);for(var t=0,r=0,n=e;r<n.length;r++){var a=n[r];if(a.canvas||a.imageData){var i=Gp(a),o=i.width,s=i.height;t=Math.max(t,2*s+2*o*s)}a.children&&(t=Math.max(t,P3(a.children)))}return t}function Jr(e,t,r,n,a){n===void 0&&(n=!1),a===void 0&&(a=!1),a&&it(e,0);var i=e.offset;it(e,0),r();for(var o=e.offset-i-4,s=o;s%t;)Qe(e,0),s++;n&&(o=s),e.view.setUint32(i,o,!1)}function F3(e){var t;(t=e.children)===null||t===void 0||t.forEach(F3);var r=e.imageData;if(r&&(r.data instanceof Uint32Array||r.data instanceof Uint16Array))throw new Error("imageData has incorrect bitDepth");if("mask"in e&&e.mask){var n=e.mask.imageData;if(n&&(n.data instanceof Uint32Array||n.data instanceof Uint16Array))throw new Error("mask imageData has incorrect bitDepth")}}function R3(e,t,r){var n;if(r===void 0&&(r={}),!(+t.width>0&&+t.height>0))throw new Error("Invalid document size");if((t.width>3e4||t.height>3e4)&&!r.psb)throw new Error("Document size is too large (max is 30000x30000, use PSB format instead)");var a=(n=t.bitsPerChannel)!==null&&n!==void 0?n:8;if(a!==8)throw new Error("bitsPerChannel other than 8 are not supported for writing");F3(t);var i=Ki({},t.imageResources),o=Ki(Ki({},r),{layerIds:new Set,layerToId:new Map});o.generateThumbnail&&(i.thumbnail=pL(t));var s=t.imageData;if(!s&&t.canvas&&(s=t.canvas.getContext("2d").getImageData(0,0,t.canvas.width,t.canvas.height)),s&&(t.width!==s.width||t.height!==s.height))throw new Error("Document canvas must have the same size as document");var l=!!s&&u4(s),c=Math.max(P3(t.children),4*2*t.width*t.height+2*t.height);e.tempBuffer=new Uint8Array(c),yt(e,"8BPS"),Ve(e,r.psb?2:1),qt(e,6),Ve(e,l?4:3),it(e,t.height),it(e,t.width),Ve(e,a),Ve(e,3),Jr(e,1,function(){var S,M,E;if(t.palette){for(var w=0;w<256;w++)Qe(e,((S=t.palette[w])===null||S===void 0?void 0:S.r)||0);for(var w=0;w<256;w++)Qe(e,((M=t.palette[w])===null||M===void 0?void 0:M.g)||0);for(var w=0;w<256;w++)Qe(e,((E=t.palette[w])===null||E===void 0?void 0:E.b)||0)}});var u=[];B3(u,t.children),u.length||u.push({}),i.layersGroup=u.map(function(S){return S.linkGroup||0}),i.layerGroupsEnabledId=u.map(function(S){return S.linkGroupEnabled==!1?0:1}),Jr(e,1,function(){for(var S=function(x){for(var C=x.has(i),D=C===!1?0:C===!0?1:C,B=function(K){yt(e,"8BIM"),Ve(e,x.key),Wi(e,"",2),Jr(e,2,function(){return x.write(e,i,K)})},F=0;F<D;F++)B(F)},M=0,E=Py;M<E.length;M++){var w=E[M];S(w)}}),Jr(e,2,function(){lL(e,u,t,l,o),fL(e,t.globalLayerMaskInfo),L3(e,t,t,o)},void 0,!!o.psb);var d=l?[0,1,2,3]:[0,1,2],f=s?s.width:t.width,p=s?s.height:t.height,_={data:new Uint8Array(f*p*4),width:f,height:p};Ve(e,1);{if(s&&_.data.set(new Uint8Array(s.data.buffer,s.data.byteOffset,s.data.byteLength)),l)for(var h=_.width*_.height*4,b=_.data,v=0;v<h;v+=4){var m=b[v+3];if(m!=0&&m!=255){var y=m/255,g=255*(1-y);b[v+0]=b[v+0]*y+g,b[v+1]=b[v+1]*y+g,b[v+2]=b[v+2]*y+g}}pa(e,hp(e.tempBuffer,_,d,!!r.psb))}}function lL(e,t,r,n,a){Jr(e,4,function(){var i;Vt(e,n?-t.length:t.length);for(var o=t.map(function(b,v){return hL(e.tempBuffer,b,v===0,a)}),s=function(b){var v=b.layer,m=b.top,y=b.left,g=b.bottom,S=b.right,M=b.channels;gt(e,m),gt(e,y),gt(e,g),gt(e,S),Ve(e,M.length);for(var E=0,w=M;E<w.length;E++){var x=w[E];Vt(e,x.channelId),a.psb&&it(e,0),it(e,x.length)}yt(e,"8BIM"),yt(e,Uc[v.blendMode]||"norm"),Qe(e,Math.round(pp((i=v.opacity)!==null&&i!==void 0?i:1,0,1)*255)),Qe(e,v.clipping?1:0);var C=8;v.transparencyProtected&&(C|=1),v.hidden&&(C|=2),(v.vectorMask||v.sectionDivider&&v.sectionDivider.type!==0||v.adjustment)&&(C|=16),v.effectsOpen&&(C|=32),Qe(e,C),Qe(e,0),Jr(e,1,function(){cL(e,v,b),uL(e,v),Wi(e,(v.name||"").substring(0,255),4),L3(e,v,r,a)})},l=0,c=o;l<c.length;l++){var u=c[l];s(u)}for(var d=0,f=o;d<f.length;d++)for(var u=f[d],p=0,_=u.channels;p<_.length;p++){var h=_[p];Ve(e,h.compression),h.buffer&&pa(e,h.buffer)}},!0,a.psb)}function cL(e,t,r){var n=t.mask,a=t.realMask;Jr(e,1,function(){if(!(!n&&!a)){var i=0,o=0,s=0;n&&(n.userMaskDensity!==void 0&&(i|=1),n.userMaskFeather!==void 0&&(i|=2),n.vectorMaskDensity!==void 0&&(i|=4),n.vectorMaskFeather!==void 0&&(i|=8),n.disabled&&(o|=2),n.positionRelativeToLayer&&(o|=1),n.fromVectorData&&(o|=8),i&&(o|=16));var l=r.mask||{};if(gt(e,l.top||0),gt(e,l.left||0),gt(e,l.bottom||0),gt(e,l.right||0),Qe(e,n&&n.defaultColor||0),Qe(e,o),a){a.disabled&&(s|=2),a.positionRelativeToLayer&&(s|=1),a.fromVectorData&&(s|=8);var c=r.realMask||{};Qe(e,s),Qe(e,a.defaultColor||0),gt(e,c.top||0),gt(e,c.left||0),gt(e,c.bottom||0),gt(e,c.right||0)}i&&n&&(Qe(e,i),n.userMaskDensity!==void 0&&Qe(e,Math.round(n.userMaskDensity*255)),n.userMaskFeather!==void 0&&Jn(e,n.userMaskFeather),n.vectorMaskDensity!==void 0&&Qe(e,Math.round(n.vectorMaskDensity*255)),n.vectorMaskFeather!==void 0&&Jn(e,n.vectorMaskFeather)),qt(e,2)}})}function du(e,t){Qe(e,t[0]),Qe(e,t[1]),Qe(e,t[2]),Qe(e,t[3])}function uL(e,t){Jr(e,1,function(){var r=t.blendingRanges;if(r){du(e,r.compositeGrayBlendSource),du(e,r.compositeGraphBlendDestinationRange);for(var n=0,a=r.ranges;n<a.length;n++){var i=a[n];du(e,i.sourceRange),du(e,i.destRange)}}})}function fL(e,t){Jr(e,1,function(){t&&(Ve(e,t.overlayColorSpace),Ve(e,t.colorSpace1),Ve(e,t.colorSpace2),Ve(e,t.colorSpace3),Ve(e,t.colorSpace4),Ve(e,t.opacity*255),Qe(e,t.kind),qt(e,3))})}function L3(e,t,r,n){for(var a=function(l){var c=l.key;if(c==="Txt2"&&n.invalidateTextLayers)return"continue";if(c==="vmsk"&&n.psb&&(c="vsms"),l.has(t)){var u=n.psb&&i4.indexOf(c)!==-1,d=c!=="Txt2"&&c!=="cinf"&&c!=="extn"&&c!=="CAI "&&c!=="OCIO",f=c==="Txt2"||c==="luni"||c==="vmsk"||c==="artb"||c==="artd"||c==="vogk"||c==="SoLd"||c==="lnk2"||c==="vscg"||c==="vsms"||c==="GdFl"||c==="lmfx"||c==="lrFX"||c==="cinf"||c==="PlLd"||c==="Anno"||c==="CAI "||c==="OCIO"||c==="GenI"||c==="FEid"||c==="curv"||c==="CgEd"||c==="vibA"||c==="blwh"||c==="grdm";yt(e,u?"8B64":"8BIM"),yt(e,c),Jr(e,f?4:2,function(){l.write(e,t,r,n)},d,u)}},i=0,o=y3;i<o.length;i++){var s=o[i];a(s)}}function B3(e,t){if(t)for(var r=0,n=t;r<n.length;r++){var a=n[r];if(a.children&&a.canvas)throw new Error("Invalid layer, cannot have both 'canvas' and 'children' properties");if(a.children&&a.imageData)throw new Error("Invalid layer, cannot have both 'imageData' and 'children' properties");a.children?(e.push({name:"</Layer group>",sectionDivider:{type:3}}),B3(e,a.children),e.push(Ki(Ki({},a),{blendMode:a.blendMode==="pass through"?"normal":a.blendMode,sectionDivider:{type:a.opened===!1?2:1,key:Uc[a.blendMode]||"pass",subType:0}}))):e.push(Ki({},a))}}function dL(e,t){var r=e.buffer.byteLength;do r*=2;while(t>r);var n=new ArrayBuffer(r),a=new Uint8Array(n),i=new Uint8Array(e.buffer);a.set(i),e.buffer=n,e.view=new DataView(e.buffer)}function $3(e,t){t>e.buffer.byteLength&&dL(e,t)}function gi(e,t){var r=e.offset;return $3(e,e.offset+=t),r}function pL(e){var t=ds(10,10),r=1;e.width>e.height?(t.width=160,t.height=Math.floor(e.height*(t.width/e.width)),r=t.width/e.width):(t.height=160,t.width=Math.floor(e.width*(t.height/e.height)),r=t.height/e.height);var n=t.getContext("2d");return n.scale(r,r),e.imageData?n.drawImage(Hc(e.imageData),0,0):e.canvas&&n.drawImage(e.canvas,0,0),t}function N3(e,t,r,n,a,i){var o=n.top|0,s=n.left|0,l=n.right|0,c=n.bottom|0,u=Gp(n),d=u.width,f=u.height,p=n.imageData;if(!p&&n.canvas&&d&&f&&(p=n.canvas.getContext("2d").getImageData(0,0,d,f)),p&&(p.width!==d||p.height!==f))throw new Error("Invalid imageData dimentions");l=s+d,c=o+f;var _,h;p?a.compress?(_=f4(p,[0]),h=2):(_=hp(e,p,[0],!!a.psb),h=1):(_=new Uint8Array(0),h=1),t.channels.push({channelId:i?-3:-2,compression:h,buffer:_,length:2+_.length}),t[i?"realMask":"mask"]={top:o,left:s,right:l,bottom:c}}function hL(e,t,r,n){var a=mL(e,t,r,n);return t.mask&&N3(e,a,t,t.mask,n,!1),t.realMask&&N3(e,a,t,t.realMask,n,!0),a}function Gp(e){var t,r,n,a,i=e.canvas,o=e.imageData,s=(r=(t=o==null?void 0:o.width)!==null&&t!==void 0?t:i==null?void 0:i.width)!==null&&r!==void 0?r:0,l=(a=(n=o==null?void 0:o.height)!==null&&n!==void 0?n:i==null?void 0:i.height)!==null&&a!==void 0?a:0;return{width:s,height:l}}function vL(e,t,r,n,a){if(e.data instanceof Uint32Array||e.data instanceof Uint16Array)throw new Error("imageData has incorrect bit depth");for(var i=ps(n,a),o=e.data,s=i.data,l=0;l<a;l++)for(var c=0;c<n;c++){var u=(c+t+(l+r)*e.width)*4,d=(c+l*n)*4;s[d]=o[u],s[d+1]=o[u+1],s[d+2]=o[u+2],s[d+3]=o[u+3]}return i}function mL(e,t,r,n){var a=t.top|0,i=t.left|0,o=t.right|0,s=t.bottom|0,l=[{channelId:-1,compression:0,buffer:void 0,length:2},{channelId:0,compression:0,buffer:void 0,length:2},{channelId:1,compression:0,buffer:void 0,length:2},{channelId:2,compression:0,buffer:void 0,length:2}],c=Gp(t),u=c.width,d=c.height;if(!(t.canvas||t.imageData)||!u||!d)return o=i,s=a,{layer:t,top:a,left:i,right:o,bottom:s,channels:l};o=i+u,s=a+d;var f=t.imageData||t.canvas.getContext("2d").getImageData(0,0,u,d);if(n.trimImageData){var p=gL(f);if(p.left!==0||p.top!==0||p.right!==f.width||p.bottom!==f.height){if(i+=p.left,a+=p.top,o-=f.width-p.right,s-=f.height-p.bottom,u=o-i,d=s-a,!u||!d)return{layer:t,top:a,left:i,right:o,bottom:s,channels:l};f=vL(f,p.left,p.top,u,d)}}var _=[0,1,2];return(!r||n.noBackground||t.mask||u4(f)||UF)&&_.unshift(-1),l=_.map(function(h){var b=c4(h,!1),v,m;return n.compress?(v=f4(f,[b]),m=2):(v=hp(e,f,[b],!!n.psb),m=1),{channelId:h,compression:m,buffer:v,length:2+v.length}}),{layer:t,top:a,left:i,right:o,bottom:s,channels:l}}function U3(e,t,r,n){for(var a=e.data,i=e.width,o=(t*i+r)*4+3|0,s=o+(n-r)*4|0,l=o;l<s;l=l+4|0)if(a[l]!==0)return!1;return!0}function H3(e,t,r,n){for(var a=e.data,i=e.width,o=i*4|0,s=r*o+t*4+3|0,l=r,c=s;l<n;l++,c=c+o|0)if(a[c]!==0)return!1;return!0}function gL(e){for(var t=0,r=0,n=e.width,a=e.height;t<a&&U3(e,t,r,n);)t++;for(;a>t&&U3(e,a-1,r,n);)a--;for(;r<n&&H3(e,r,t,a);)r++;for(;n>r&&H3(e,n-1,t,a);)n--;return{top:t,left:r,right:n,bottom:a}}function Kr(e,t){t?"r"in t?(Ve(e,0),Ve(e,Math.round(t.r*257)),Ve(e,Math.round(t.g*257)),Ve(e,Math.round(t.b*257)),Ve(e,0)):"fr"in t?(Ve(e,0),Ve(e,Math.round(t.fr*255*257)),Ve(e,Math.round(t.fg*255*257)),Ve(e,Math.round(t.fb*255*257)),Ve(e,0)):"l"in t?(Ve(e,7),Vt(e,Math.round(t.l*1e4)),Vt(e,Math.round(t.a<0?t.a*12800:t.a*12700)),Vt(e,Math.round(t.b<0?t.b*12800:t.b*12700)),Ve(e,0)):"h"in t?(Ve(e,1),Ve(e,Math.round(t.h*65535)),Ve(e,Math.round(t.s*65535)),Ve(e,Math.round(t.b*65535)),Ve(e,0)):"c"in t?(Ve(e,2),Ve(e,Math.round(t.c*257)),Ve(e,Math.round(t.m*257)),Ve(e,Math.round(t.y*257)),Ve(e,Math.round(t.k*257))):(Ve(e,8),Ve(e,Math.round(t.k*1e4/255)),qt(e,6)):(Ve(e,0),qt(e,8))}var pu=function(){return pu=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++){t=arguments[r];for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a])}return e},pu.apply(this,arguments)},bL=["off","fade","pen pressure","pen tilt","stylus wheel","initial direction","direction","initial rotation","rotation"],j3=["round point","round blunt","round curve","round angle","round fan","flat point","flat blunt","flat curve","flat angle","flat fan"],yL=["erodible point","erodible flat","erodible round","erodible square","erodible triangle","custom"],_L={_:"brush",MixB:"mixer brush",SmTl:"smudge brush"};function on(e){return{control:bL[e.bVTy],steps:e.fStp,jitter:mt(e.jitter),minimum:mt(e["Mnm "])}}function G3(e){switch(e._classID){case"computedBrush":return{type:"computed",size:Vc(e.Dmtr,"Pixels"),angle:ji(e.Angl),roundness:mt(e.Rndn),spacingOn:e.Intr,spacing:mt(e.Spcn),flipX:e.flipX,flipY:e.flipY,hardness:mt(e.Hrdn)};case"sampledBrush":return{type:"sampled",size:Vc(e.Dmtr,"Pixels"),angle:ji(e.Angl),roundness:mt(e.Rndn),spacingOn:e.Intr,spacing:mt(e.Spcn),flipX:e.flipX,flipY:e.flipY,name:e["Nm "],sampledData:e.sampledData};case"dBrush":return{type:"dynamic",shape:j3[e["Shp "]],angle:ji(e.Angl),size:Vc(e.Dmtr,"Pixels"),density:mt(e.Dnst),length:mt(e.Lngt),clumping:mt(e.clumping),thickness:mt(e.thickness),stiffness:mt(e.stiffness),physics:e.physics,spacing:mt(e.Spcn),spacingOn:e.Intr,flipX:e.flipX,flipY:e.flipY};case"dTips":return pu(pu({type:"tips",angle:ji(e.Angl),size:Vc(e.Dmtr,"Pixels"),shape:j3[e["Shp "]],physics:e.physics,spacing:mt(e.Spcn),spacingOn:e.Intr,flipX:e.flipX,flipY:e.flipY,tipsType:yL[e.dtipsType],tipsLengthRatio:mt(e.dtipsLengthRatio),tipsHardness:mt(e.dtipsHardness)},e.dtipsGridSize&&e.dtipsErodibleTipHeightMap?{tipsGridSize:e.dtipsGridSize,tipsErodibleTipHeightMap:xL(e.dtipsErodibleTipHeightMap)}:{}),{tipsAirbrushCutoffAngle:e.dtipsAirbrushCutoffAngle,tipsAirbrushGranularity:mt(e.dtipsAirbrushGranularity),tipsAirbrushStreakiness:mt(e.dtipsAirbrushStreakiness),tipsAirbrushSplatSize:mt(e.dtipsAirbrushSplatSize),tipsAirbrushSplatCount:e.dtipsAirbrushSplatCount});default:throw console.log(require("util").inspect(e,!1,99,!0)),new Error("Unknown brush classId: ".concat(e._classID))}}function xL(e){for(var t=[],r=0;r<e.byteLength;r++)t.push(e[r]);return t}function wL(e,t){var r,n,a,i;t===void 0&&(t={});var o=_s(e.buffer,e.byteOffset,e.byteLength),s=Ot(o),l=[],c=[],u=[];if(s===1||s===2)throw new Error("Unsupported ABR version (".concat(s,")"));if(s===6||s===7||s===9||s===10){var d=Ot(o);if(d!==1&&d!==2)throw new Error("Unsupported ABR minor version");for(;o.offset<o.view.byteLength;){Na(o,"8BIM");var f=lr(o),p=Ne(o),_=o.offset+p;switch(f){case"samp":{for(;o.offset<_;){for(var h=Ne(o);h&3;)h++;var b=o.offset+h,v=ua(o,1);ct(o,d===1?10:264);var m=dt(o),y=dt(o),g=dt(o)-m,S=dt(o)-y;if(S<=0||g<=0)throw new Error("Invalid bounds");var M=Ot(o),E=at(o),w=new Uint8Array(S*g);if(M===8)if(E===0)w.set(Tr(o,w.byteLength));else if(E===1)Vi(o,{width:S,height:g,data:w},S,g,M,1,[0],!1);else throw new Error("Invalid compression");else if(M===16)if(E===0)for(var x=0;x<w.byteLength;x++)w[x]=et(o)>>8;else throw E===1?new Error("not implemented (16bit RLE)"):new Error("Invalid compression");else throw new Error("Invalid depth");l.push({id:v,bounds:{x:y,y:m,w:S,h:g},alpha:w}),o.offset=b}break}case"desc":{for(var C=Ft(o,!0),D=0,B=C.Brsh;D<B.length;D++){var F=B[D],K={name:F["Nm "],shape:G3(F.Brsh),spacing:mt(F.Spcn),wetEdges:F.Wtdg,noise:F.Nose,useBrushSize:F.useBrushSize};F.interpretation!=null&&(K.interpretation=F.interpretation),F.protectTexture!=null&&(K.protectTexture=F.protectTexture),F.useTipDynamics&&(K.shapeDynamics={tiltScale:mt(F.tiltScale),sizeDynamics:on(F.szVr),angleDynamics:on(F.angleDynamics),roundnessDynamics:on(F.roundnessDynamics),flipX:F.flipX,flipY:F.flipY,brushProjection:F.brushProjection,minimumDiameter:mt(F.minimumDiameter),minimumRoundness:mt(F.minimumRoundness)}),F.useScatter&&(K.scatter={count:F["Cnt "],bothAxes:F.bothAxes,countDynamics:on(F.countDynamics),scatterDynamics:on(F.scatterDynamics)}),F.useTexture&&F.Txtr&&(K.texture={id:F.Txtr.Idnt,name:F.Txtr["Nm "],blendMode:bn.decode(F.textureBlendMode),depth:mt(F.textureDepth),depthMinimum:mt(F.minimumDepth),depthDynamics:on(F.textureDepthDynamics),scale:mt(F.textureScale),invert:F.InvT,brightness:F.textureBrightness,contrast:F.textureContrast,textureEachTip:!!F.TxtC});var te=F.dualBrush;te&&te.useDualBrush&&(K.dualBrush={flip:te.Flip,shape:G3(te.Brsh),blendMode:bn.decode(te.BlnM),useScatter:te.useScatter,spacing:mt(te.Spcn),count:te["Cnt "],bothAxes:te.bothAxes,countDynamics:on(te.countDynamics),scatterDynamics:on(te.scatterDynamics)}),F.useColorDynamics&&(K.colorDynamics={foregroundBackground:on(F.clVr),hue:mt(F["H "]),saturation:mt(F.Strt),brightness:mt(F.Brgh),purity:mt(F.purity),perTip:F.colorDynamicsPerTip}),F.usePaintDynamics&&(K.transfer={flowDynamics:on(F.prVr),opacityDynamics:on(F.opVr),wetnessDynamics:on(F.wtVr),mixDynamics:on(F.mxVr)}),F.useBrushPose&&(K.brushPose={overrideAngle:F.overridePoseAngle,overrideTiltX:F.overridePoseTiltX,overrideTiltY:F.overridePoseTiltY,overridePressure:F.overridePosePressure,pressure:mt(F.brushPosePressure),tiltX:F.brushPoseTiltX,tiltY:F.brushPoseTiltY,angle:F.brushPoseAngle});var J=F.toolOptions;J&&(K.toolOptions={type:_L[J._classID]||"brush",brushPreset:J.brushPreset,flow:(r=J.flow)!==null&&r!==void 0?r:100,smooth:(n=J.Smoo)!==null&&n!==void 0?n:0,mode:bn.decode(J["Md "]||"BlnM.Nrml"),opacity:(a=J.Opct)!==null&&a!==void 0?a:100,smoothing:!!J.smoothing,smoothingValue:J.smoothingValue||0,smoothingRadiusMode:!!J.smoothingRadiusMode,smoothingCatchup:!!J.smoothingCatchup,smoothingCatchupAtEnd:!!J.smoothingCatchupAtEnd,smoothingZoomCompensation:!!J.smoothingZoomCompensation,pressureSmoothing:!!J.pressureSmoothing,usePressureOverridesSize:!!J.usePressureOverridesSize,usePressureOverridesOpacity:!!J.usePressureOverridesOpacity,useLegacy:!!J.useLegacy},J.prVr&&(K.toolOptions.flowDynamics=on(J.prVr)),J.opVr&&(K.toolOptions.opacityDynamics=on(J.opVr)),J.szVr&&(K.toolOptions.sizeDynamics=on(J.szVr)),"wetness"in J&&(K.toolOptions.wetness=J.wetness),"dryness"in J&&(K.toolOptions.dryness=J.dryness),"mix"in J&&(K.toolOptions.mix=J.mix),"autoFill"in J&&(K.toolOptions.autoFill=J.autoFill),"autoClean"in J&&(K.toolOptions.autoClean=J.autoClean),"loadSolidColorOnly"in J&&(K.toolOptions.loadSolidColorOnly=J.loadSolidColorOnly),"sampleAllLayers"in J&&(K.toolOptions.sampleAllLayers=J.sampleAllLayers),"SmdF"in J&&(K.toolOptions.smudgeFingerPainting=J.SmdF),"SmdS"in J&&(K.toolOptions.smudgeSampleAllLayers=J.SmdS),"Prs "in J&&(K.toolOptions.strength=J["Prs "]),"SmdF"in J&&(K.toolOptions.smudgeFingerPainting=J.SmdF),"SmdS"in J&&(K.toolOptions.smudgeSampleAllLayers=J.SmdS)),c.push(K)}break}case"patt":{for(;o.offset<_;)u.push(IR(o));o.offset=_;break}case"phry":{var C=Ft(o);t.logMissingFeatures&&!((i=C.hierarchy)===null||i===void 0)&&i.length;break}default:throw new Error("Invalid brush type: ".concat(f))}for(;p%4;)o.offset++,p++}}else throw new Error("Unsupported ABR version (".concat(s,")"));return{samples:l,patterns:u,brushes:c}}var Vp=function(){return Vp=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++){t=arguments[r];for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a])}return e},Vp.apply(this,arguments)};function kL(e){var t=_s(e.buffer,e.byteOffset,e.byteLength),r={shapes:[]};if(Na(t,"cush"),Ne(t)!==2)throw new Error("Invalid version");for(var n=Ne(t),a=0;a<n;a++){for(var i=Rr(t);t.offset%4;)t.offset++;if(Ne(t)!==1)throw new Error("Invalid shape version");var o=Ne(t),s=t.offset+o,l=ua(t,1),c=Ne(t),u=Ne(t),d=Ne(t),f=Ne(t),p=f-u,_=d-c,h={paths:[]};x3(t,h,p,_,s-t.offset),r.shapes.push(Vp({name:i,id:l,width:p,height:_},h)),t.offset=s}return r}var qp;(function(e){e[e.Bitmap=0]="Bitmap",e[e.Grayscale=1]="Grayscale",e[e.Indexed=2]="Indexed",e[e.RGB=3]="RGB",e[e.CMYK=4]="CMYK",e[e.Multichannel=7]="Multichannel",e[e.Duotone=8]="Duotone",e[e.Lab=9]="Lab"})(qp||(qp={}));var Kp;(function(e){e[e.Other=0]="Other",e[e.OpenFolder=1]="OpenFolder",e[e.ClosedFolder=2]="ClosedFolder",e[e.BoundingSectionDivider=3]="BoundingSectionDivider"})(Kp||(Kp={}));var Wp;(function(e){e[e.None=0]="None",e[e.Visibility=1]="Visibility",e[e.Position=2]="Position",e[e.Appearance=4]="Appearance"})(Wp||(Wp={}));var Yp;(function(e){e[e.Color0=0]="Color0",e[e.Color1=1]="Color1",e[e.Color2=2]="Color2",e[e.Color3=3]="Color3",e[e.Transparency=-1]="Transparency",e[e.UserMask=-2]="UserMask",e[e.RealUserMask=-3]="RealUserMask"})(Yp||(Yp={}));var Xp;(function(e){e[e.RawData=0]="RawData",e[e.RleCompressed=1]="RleCompressed",e[e.ZipWithoutPrediction=2]="ZipWithoutPrediction",e[e.ZipWithPrediction=3]="ZipWithPrediction"})(Xp||(Xp={}));var SL=p4;function CL(e,t){var r="buffer"in e?_s(e.buffer,e.byteOffset,e.byteLength):_s(e);return xR(r,t)}function EL(e,t){var r=I3();return R3(r,e,t),rL(r)}function V3(e,t){var r=I3();return R3(r,e,t),nL(r)}function AL(e,t){if(typeof Buffer>"u")throw new Error("Buffer not supported on this platform");return Buffer.from(V3(e,t))}function TL(e,t){Yy(e,t)}const ML=Object.freeze(Object.defineProperty({__proto__:null,get ChannelID(){return Yp},get ColorMode(){return qp},get Compression(){return Xp},get LayerCompCapturedInfo(){return Wp},get SectionDividerType(){return Kp},byteArrayToBase64:SL,decodeLayerPixels:TL,initializeCanvas:qF,readAbr:wL,readCsh:kL,readPsd:CL,writePsd:EL,writePsdBuffer:AL,writePsdUint8Array:V3},Symbol.toStringTag,{value:"Module"}));var q3={exports:{}};/* @license
|
|
291
|
+
`),index:i.TextIndex||0,gridding:V4.decode(i.textGridding),antiAlias:q4.decode(i.AntA),orientation:Rl.decode(i.Ornt),warp:{style:wp.decode(o.warpStyle),value:o.warpValue||0,perspective:o.warpPerspective||0,perspectiveOther:o.warpPerspectiveOther||0,rotate:Rl.decode(o.warpRotate)}},i.bounds&&(t.text.bounds=z4(i.bounds)),i.boundingBox&&(t.text.boundingBox=z4(i.boundingBox)),i.EngineData){var s=l3(i.EngineData),l=GR(s);t.text=Q(Q({},t.text),l)}ct(e,r())},function(e,t){var r=t.text,n=r.warp||{},a=r.transform||[1,0,0,1,0,0],i=Q(Q(Q({"Txt ":(r.text||"").replace(/\r?\n/g,"\r"),textGridding:V4.encode(r.gridding),Ornt:Rl.encode(r.orientation),AntA:q4.encode(r.antiAlias)},r.bounds?{bounds:I4(r.bounds)}:{}),r.boundingBox?{boundingBox:I4(r.boundingBox)}:{}),{TextIndex:r.index||0,EngineData:LR(VR(r))});Vt(e,1);for(var o=0;o<6;o++)Jn(e,a[o]);Vt(e,50),Lt(e,"","TxLr",i,"text"),Vt(e,1),Lt(e,"","warp",ou(n)),fa(e,r.left),fa(e,r.top),fa(e,r.right),fa(e,r.bottom)}),ht("SoCo",function(e){return e.vectorFill!==void 0&&e.vectorStroke===void 0&&e.vectorFill.type==="color"},function(e,t){var r=Ft(e);t.vectorFill=Ol(r)},function(e,t){var r=Pl(t.vectorFill).descriptor;Lt(e,"","null",r)}),ht("GdFl",function(e){return e.vectorFill!==void 0&&e.vectorStroke===void 0&&(e.vectorFill.type==="solid"||e.vectorFill.type==="noise")},function(e,t,r){var n=Ft(e);t.vectorFill=Ol(n),ct(e,r())},function(e,t){var r=Pl(t.vectorFill).descriptor;Lt(e,"","null",r)}),ht("PtFl",function(e){return e.vectorFill!==void 0&&e.vectorStroke===void 0&&e.vectorFill.type==="pattern"},function(e,t){var r=Ft(e);t.vectorFill=Ol(r)},function(e,t){var r=Pl(t.vectorFill).descriptor;Lt(e,"","null",r)}),ht("vscg",function(e){return e.vectorFill!==void 0&&e.vectorStroke!==void 0},function(e,t,r){lr(e);var n=Ft(e);t.vectorFill=Ol(n),ct(e,r())},function(e,t){var r=Pl(t.vectorFill),n=r.descriptor,a=r.key;yt(e,a),Lt(e,"","null",n)});function WR(e,t,r){var n=ca(e)*r,a=ca(e)*t,i=ca(e)*r,o=ca(e)*t,s=ca(e)*r,l=ca(e)*t;return[a,n,o,i,l,s]}function YR(e,t,r,n){da(e,t[1]/n),da(e,t[0]/r),da(e,t[3]/n),da(e,t[2]/r),da(e,t[5]/n),da(e,t[4]/r)}var _3=["exclude","combine","subtract","intersect"];function x3(e,t,r,n,a){for(var i=e.offset+a,o=t.paths,s=void 0;i-e.offset>=26;){var l=et(e);switch(l){case 0:case 3:{et(e);var c=Ot(e),u=et(e);ct(e,18),s={open:l===3,knots:[],fillRule:u===2?"non-zero":"even-odd"},c!==-1&&(s.operation=_3[c]),o.push(s);break}case 1:case 2:case 4:case 5:s.knots.push({linked:l===1||l===4,points:WR(e,r,n)});break;case 6:ct(e,24);break;case 7:{var d=ca(e),f=ca(e),p=ca(e),_=ca(e),h=ca(e);ct(e,4),t.clipboard={top:d,left:f,bottom:p,right:_,resolution:h};break}case 8:t.fillStartsWithAllPixels=!!et(e),ct(e,22);break;default:throw new Error("Invalid vmsk section")}}return o}ht("vmsk",ir("vectorMask"),function(e,t,r,n){var a=n.width,i=n.height;if(Ne(e)!==3)throw new Error("Invalid vmsk version");t.vectorMask={paths:[]};var o=t.vectorMask,s=Ne(e);o.invert=(s&1)!==0,o.notLink=(s&2)!==0,o.disable=(s&4)!==0,x3(e,o,a,i,r()),ct(e,r())},function(e,t,r){var n=r.width,a=r.height,i=t.vectorMask,o=(i.invert?1:0)|(i.notLink?2:0)|(i.disable?4:0);it(e,3),it(e,o),Ve(e,6),qt(e,24);var s=i.clipboard;s&&(Ve(e,7),da(e,s.top),da(e,s.left),da(e,s.bottom),da(e,s.right),da(e,s.resolution),qt(e,4)),Ve(e,8),Ve(e,i.fillStartsWithAllPixels?1:0),qt(e,22);for(var l=0,c=i.paths;l<c.length;l++){var u=c[l];Ve(e,u.open?3:0),Ve(e,u.knots.length),Ve(e,u.operation?_3.indexOf(u.operation):-1),Ve(e,u.fillRule==="non-zero"?2:1),qt(e,18);for(var d=u.open?4:1,f=u.open?5:2,p=0,_=u.knots;p<_.length;p++){var h=_[p],b=h.linked,v=h.points;Ve(e,b?d:f),YR(e,v,n,a)}}}),Cs("vsms","vmsk"),ht("vowv",ir("vowv"),function(e,t){t.vowv=Ne(e)},function(e,t){it(e,t.vowv)}),ht("vogk",ir("vectorOrigination"),function(e,t,r){if(dt(e)!==1)throw new Error("Invalid vogk version");var n=Ft(e);t.vectorOrigination={keyDescriptorList:[]};for(var a=0,i=n.keyDescriptorList;a<i.length;a++){var o=i[a],s={};o.keyShapeInvalidated!=null&&(s.keyShapeInvalidated=o.keyShapeInvalidated),o.keyOriginType!=null&&(s.keyOriginType=o.keyOriginType),o.keyOriginResolution!=null&&(s.keyOriginResolution=o.keyOriginResolution),o.keyOriginShapeBBox&&(s.keyOriginShapeBoundingBox={top:Gi(o.keyOriginShapeBBox["Top "]),left:Gi(o.keyOriginShapeBBox.Left),bottom:Gi(o.keyOriginShapeBBox.Btom),right:Gi(o.keyOriginShapeBBox.Rght)});var l=o.keyOriginRRectRadii;l&&(s.keyOriginRRectRadii={topRight:Jt(l.topRight),topLeft:Jt(l.topLeft),bottomLeft:Jt(l.bottomLeft),bottomRight:Jt(l.bottomRight)});var c=o.keyOriginBoxCorners;c&&(s.keyOriginBoxCorners=[{x:c.rectangleCornerA.Hrzn,y:c.rectangleCornerA.Vrtc},{x:c.rectangleCornerB.Hrzn,y:c.rectangleCornerB.Vrtc},{x:c.rectangleCornerC.Hrzn,y:c.rectangleCornerC.Vrtc},{x:c.rectangleCornerD.Hrzn,y:c.rectangleCornerD.Vrtc}]);var u=o.Trnf;u&&(s.transform=[u.xx,u.xy,u.yx,u.yy,u.tx,u.ty]),t.vectorOrigination.keyDescriptorList.push(s)}ct(e,r())},function(e,t){for(var r=t.vectorOrigination,n={keyDescriptorList:[]},a=0;a<r.keyDescriptorList.length;a++){var i=r.keyDescriptorList[a];n.keyDescriptorList.push({});var o=n.keyDescriptorList[n.keyDescriptorList.length-1];i.keyOriginType!=null&&(o.keyOriginType=i.keyOriginType),i.keyOriginResolution!=null&&(o.keyOriginResolution=i.keyOriginResolution);var s=i.keyOriginRRectRadii;s&&(o.keyOriginRRectRadii={unitValueQuadVersion:1,topRight:pr(s.topRight,"topRight"),topLeft:pr(s.topLeft,"topLeft"),bottomLeft:pr(s.bottomLeft,"bottomLeft"),bottomRight:pr(s.bottomRight,"bottomRight")});var l=i.keyOriginShapeBoundingBox;l&&(o.keyOriginShapeBBox={unitValueQuadVersion:1,"Top ":pr(l.top,"top"),Left:pr(l.left,"left"),Btom:pr(l.bottom,"bottom"),Rght:pr(l.right,"right")});var c=i.keyOriginBoxCorners;c&&c.length===4&&(o.keyOriginBoxCorners={rectangleCornerA:{Hrzn:c[0].x,Vrtc:c[0].y},rectangleCornerB:{Hrzn:c[1].x,Vrtc:c[1].y},rectangleCornerC:{Hrzn:c[2].x,Vrtc:c[2].y},rectangleCornerD:{Hrzn:c[3].x,Vrtc:c[3].y}});var u=i.transform;u&&u.length===6&&(o.Trnf={xx:u[0],xy:u[1],yx:u[2],yy:u[3],tx:u[4],ty:u[5]}),i.keyShapeInvalidated!=null&&(o.keyShapeInvalidated=i.keyShapeInvalidated),o.keyOriginIndex=a}bt(e,1),Lt(e,"","null",n)}),ht("lmfx",function(e){return e.effects!==void 0&&z3(e.effects)},function(e,t,r){var n=Ne(e);if(n!==0)throw new Error("Invalid lmfx version");var a=Ft(e);t.effects=Il(a,!!e.logMissingFeatures),ct(e,r())},function(e,t,r,n){var a=zl(t.effects,!!n.logMissingFeatures,!0);it(e,0),Lt(e,"","null",a)}),ht("lrFX",ir("effects"),function(e,t,r){t.effects||(t.effects=OR(e)),ct(e,r())},function(e,t){PR(e,t.effects)}),ht("luni",ir("name"),function(e,t,r){if(r()>4){var n=Ne(e);r()>=n*2?t.name=Ep(e,n):e.logDevFeatures&&e.log("name in luni section is too long")}else e.logDevFeatures&&e.log("empty luni section");ct(e,r())},function(e,t){Bn(e,t.name)}),ht("lnsr",ir("nameSource"),function(e,t){return t.nameSource=lr(e)},function(e,t){return yt(e,t.nameSource)}),ht("lyid",ir("id"),function(e,t){t.id=Ne(e)},function(e,t,r,n){for(var a=t.id;n.layerIds.has(a);)a+=100;it(e,a),n.layerIds.add(a),n.layerToId.set(t,a)}),ht("lsct",ir("sectionDivider"),function(e,t,r){t.sectionDivider={type:Ne(e)},r()&&(Na(e,"8BIM"),t.sectionDivider.key=lr(e)),r()&&(t.sectionDivider.subType=Ne(e))},function(e,t){it(e,t.sectionDivider.type),t.sectionDivider.key&&(yt(e,"8BIM"),yt(e,t.sectionDivider.key),t.sectionDivider.subType!==void 0&&it(e,t.sectionDivider.subType))}),Cs("lsdk","lsct"),ht("clbl",ir("blendClippendElements"),function(e,t){t.blendClippendElements=!!at(e),ct(e,3)},function(e,t){Qe(e,t.blendClippendElements?1:0),qt(e,3)}),ht("infx",ir("blendInteriorElements"),function(e,t){t.blendInteriorElements=!!at(e),ct(e,3)},function(e,t){Qe(e,t.blendInteriorElements?1:0),qt(e,3)}),ht("knko",ir("knockout"),function(e,t){t.knockout=!!at(e),ct(e,3)},function(e,t){Qe(e,t.knockout?1:0),qt(e,3)}),ht("lmgm",ir("layerMaskAsGlobalMask"),function(e,t){t.layerMaskAsGlobalMask=!!at(e),ct(e,3)},function(e,t){Qe(e,t.layerMaskAsGlobalMask?1:0),qt(e,3)}),ht("lspf",ir("protected"),function(e,t){var r=Ne(e);t.protected={transparency:(r&1)!==0,composite:(r&2)!==0,position:(r&4)!==0},r&8&&(t.protected.artboards=!0)},function(e,t){var r=(t.protected.transparency?1:0)|(t.protected.composite?2:0)|(t.protected.position?4:0)|(t.protected.artboards?8:0);it(e,r)}),ht("lclr",ir("layerColor"),function(e,t){var r=et(e);ct(e,6),t.layerColor=a4[r]},function(e,t){var r=a4.indexOf(t.layerColor);Ve(e,r===-1?0:r),qt(e,6)}),ht("shmd",function(e){return e.timestamp!==void 0||e.animationFrames!==void 0||e.animationFrameFlags!==void 0||e.timeline!==void 0||e.comps!==void 0},function(e,t,r){for(var n=Ne(e),a=function(o){Na(e,"8BIM");var s=lr(e);at(e),ct(e,3),Fn(e,1,function(l){if(s==="cust"){var c=Ft(e);c.layerTime!==void 0&&(t.timestamp=c.layerTime)}else if(s==="mlst"){var c=Ft(e);t.animationFrames=[];for(var u=0;u<c.LaSt.length;u++){var d=c.LaSt[u],f={frames:d.FrLs};d.enab!==void 0&&(f.enable=d.enab),d.Ofst&&(f.offset=Ml(d.Ofst)),d.FXRf&&(f.referencePoint=Ml(d.FXRf)),d.Lefx&&(f.effects=Il(d.Lefx,!!e.logMissingFeatures)),d.blendOptions&&d.blendOptions.Opct&&(f.opacity=gt(d.blendOptions.Opct)),t.animationFrames.push(f)}}else if(s==="mdyn"){et(e);var p=at(e),_=at(e);t.animationFrameFlags={propagateFrameOne:!p,unifyLayerPosition:(_&1)!==0,unifyLayerStyle:(_&2)!==0,unifyLayerVisibility:(_&4)!==0}}else if(s==="tmln"){var c=Ft(e),h=c.timeScope,b={start:gn(h.Strt),duration:gn(h.duration),inTime:gn(h.inTime),outTime:gn(h.outTime),autoScope:c.autoScope,audioLevel:c.audioLevel};c.trackList&&(b.tracks=L4(c.trackList,!!e.logMissingFeatures)),t.timeline=b}else if(s==="cmls"){var c=Ft(e);t.comps={settings:[]},c.origFXRefPoint&&(t.comps.originalEffectsReferencePoint={x:c.origFXRefPoint.Hrzn,y:c.origFXRefPoint.Vrtc});for(var v=0,m=c.layerSettings;v<m.length;v++){var y=m[v];t.comps.settings.push({compList:y.compList});var g=t.comps.settings[t.comps.settings.length-1];"enab"in y&&(g.enabled=y.enab),y.Ofst&&(g.offset={x:y.Ofst.Hrzn,y:y.Ofst.Vrtc}),y.FXRefPoint&&(g.effectsReferencePoint={x:y.FXRefPoint.Hrzn,y:y.FXRefPoint.Vrtc})}}else if(s==="extn"){var c=Ft(e);e.logMissingFeatures&&e.log('Unhandled "shmd" section key',s)}else e.logMissingFeatures&&e.log('Unhandled "shmd" section key',s);ct(e,l())})},i=0;i<n;i++)a();ct(e,r())},function(e,t,r,n){var a=t.animationFrames,i=t.animationFrameFlags,o=t.timestamp,s=t.timeline,l=t.comps,c=0;a&&c++,i&&c++,s&&c++,o!==void 0&&c++,l&&c++,it(e,c),a&&(yt(e,"8BIM"),yt(e,"mlst"),Qe(e,0),qt(e,3),Jr(e,2,function(){for(var u,d={LaID:(u=t.id)!==null&&u!==void 0?u:0,LaSt:[]},f=0;f<a.length;f++){var p=a[f],_={};p.enable!==void 0&&(_.enab=p.enable),_.FrLs=p.frames,p.offset&&(_.Ofst=Dl(p.offset)),p.referencePoint&&(_.FXRf=Dl(p.referencePoint)),p.effects&&(_.Lefx=zl(p.effects,!1,!1)),p.opacity!==void 0&&(_.blendOptions={Opct:Vr(p.opacity)}),d.LaSt.push(_)}Lt(e,"","null",d)},!0)),i&&(yt(e,"8BIM"),yt(e,"mdyn"),Qe(e,0),qt(e,3),Jr(e,2,function(){Ve(e,0),Qe(e,i.propagateFrameOne?0:15),Qe(e,(i.unifyLayerPosition?1:0)|(i.unifyLayerStyle?2:0)|(i.unifyLayerVisibility?4:0))})),s&&(yt(e,"8BIM"),yt(e,"tmln"),Qe(e,0),qt(e,3),Jr(e,2,function(){var u={Vrsn:1,timeScope:{Vrsn:1,Strt:s.start,duration:s.duration,inTime:s.inTime,outTime:s.outTime},autoScope:s.autoScope,audioLevel:s.audioLevel};s.tracks&&(u.trackList=B4(s.tracks));var d=n.layerToId.get(t)||t.id;if(!d)throw new Error("You need to provide layer.id value whan writing document with animations");u.LyrI=d,Lt(e,"","null",u,"anim")},!0)),o!==void 0&&(yt(e,"8BIM"),yt(e,"cust"),Qe(e,0),qt(e,3),Jr(e,2,function(){var u={layerTime:o};Lt(e,"","metadata",u)},!0)),l&&(yt(e,"8BIM"),yt(e,"cmls"),Qe(e,0),qt(e,3),Jr(e,2,function(){var u=n.layerToId.get(t)||t.id;if(!u)throw new Error("You need to provide layer.id value whan writing document with layer comps");var d={};l.originalEffectsReferencePoint&&(d.origFXRefPoint={Hrzn:l.originalEffectsReferencePoint.x,Vrtc:l.originalEffectsReferencePoint.y}),d.LyrI=u,d.layerSettings=[];for(var f=0,p=l.settings;f<p.length;f++){var _=p[f],h={};_.enabled!==void 0&&(h.enab=_.enabled),_.offset&&(h.Ofst={Hrzn:_.offset.x,Vrtc:_.offset.y}),_.effectsReferencePoint&&(h.FXRefPoint={Hrzn:_.effectsReferencePoint.x,Vrtc:_.effectsReferencePoint.y}),h.compList=_.compList,d.layerSettings.push(h)}Lt(e,"","null",d)},!0))}),ht("PxSc",function(){return!1},function(e,t){var r=Ft(e,!0);r.pixelSourceType===1986285651?t.pixelSource={type:"vdPS",origin:{x:r.origin.Hrzn,y:r.origin.Vrtc},interpretation:{interpretAlpha:r.interpretation.interpretAlpha.split(".")[1],profile:r.interpretation.profile},frameReader:{type:"QTFR",link:{name:r.frameReader["Lnk "]["Nm "],fullPath:r.frameReader["Lnk "].fullPath,originalPath:r.frameReader["Lnk "].originalPath,relativePath:r.frameReader["Lnk "].relPath,alias:r.frameReader["Lnk "].alis},mediaDescriptor:r.frameReader.mediaDescriptor},showAlteredVideo:r.showAlteredVideo}:e.log("Unknown pixelSourceType")},function(e,t){var r=t.pixelSource,n={_name:"",_classID:"PixelSource",pixelSourceType:1986285651,descVersion:1,origin:{Hrzn:r.origin.x,Vrtc:r.origin.y},interpretation:{_name:"",_classID:"footageInterpretation",Vrsn:1,interpretAlpha:"alphaInterpretation.".concat(r.interpretation.interpretAlpha),profile:r.interpretation.profile},frameReader:{_name:"",_classID:"FrameReader",frameReaderType:1364477522,descVersion:1,"Lnk ":{_name:"",_classID:"ExternalFileLink",descVersion:2,"Nm ":r.frameReader.link.name,fullPath:r.frameReader.link.fullPath,originalPath:r.frameReader.link.originalPath,alis:r.frameReader.link.alias,relPath:r.frameReader.link.relativePath},mediaDescriptor:r.frameReader.mediaDescriptor},showAlteredVideo:r.showAlteredVideo};Lt(e,"","PixelSource",n)}),ht("vstk",ir("vectorStroke"),function(e,t,r){var n=Ft(e);t.vectorStroke={strokeEnabled:n.strokeEnabled,fillEnabled:n.fillEnabled,lineWidth:Jt(n.strokeStyleLineWidth),lineDashOffset:Jt(n.strokeStyleLineDashOffset),miterLimit:n.strokeStyleMiterLimit,lineCapType:oy.decode(n.strokeStyleLineCapType),lineJoinType:sy.decode(n.strokeStyleLineJoinType),lineAlignment:ly.decode(n.strokeStyleLineAlignment),scaleLock:n.strokeStyleScaleLock,strokeAdjust:n.strokeStyleStrokeAdjust,lineDashSet:n.strokeStyleLineDashSet.map(Jt),blendMode:bn.decode(n.strokeStyleBlendMode),opacity:gt(n.strokeStyleOpacity),content:Ol(n.strokeStyleContent),resolution:n.strokeStyleResolution},ct(e,r())},function(e,t){var r,n,a,i=t.vectorStroke,o={strokeStyleVersion:2,strokeEnabled:!!i.strokeEnabled,fillEnabled:!!i.fillEnabled,strokeStyleLineWidth:i.lineWidth||{value:3,units:"Points"},strokeStyleLineDashOffset:i.lineDashOffset||{value:0,units:"Points"},strokeStyleMiterLimit:(r=i.miterLimit)!==null&&r!==void 0?r:100,strokeStyleLineCapType:oy.encode(i.lineCapType),strokeStyleLineJoinType:sy.encode(i.lineJoinType),strokeStyleLineAlignment:ly.encode(i.lineAlignment),strokeStyleScaleLock:!!i.scaleLock,strokeStyleStrokeAdjust:!!i.strokeAdjust,strokeStyleLineDashSet:i.lineDashSet||[],strokeStyleBlendMode:bn.encode(i.blendMode),strokeStyleOpacity:Vr((n=i.opacity)!==null&&n!==void 0?n:1),strokeStyleContent:Pl(i.content||{type:"color",color:{r:0,g:0,b:0}}).descriptor,strokeStyleResolution:(a=i.resolution)!==null&&a!==void 0?a:72};Lt(e,"","strokeStyle",o)}),ht("artb",ir("artboard"),function(e,t,r){var n=Ft(e),a=n.artboardRect;t.artboard={rect:{top:a["Top "],left:a.Left,bottom:a.Btom,right:a.Rght},guideIndices:n.guideIndeces,presetName:n.artboardPresetName,color:oa(n["Clr "]),backgroundType:n.artboardBackgroundType},ct(e,r())},function(e,t){var r,n=t.artboard,a=n.rect,i={artboardRect:{"Top ":a.top,Left:a.left,Btom:a.bottom,Rght:a.right},guideIndeces:n.guideIndices||[],artboardPresetName:n.presetName||"","Clr ":sa(n.color),artboardBackgroundType:(r=n.backgroundType)!==null&&r!==void 0?r:1};Lt(e,"","artboard",i)}),ht("sn2P",ir("usingAlignedRendering"),function(e,t){return t.usingAlignedRendering=!!Ne(e)},function(e,t){return it(e,t.usingAlignedRendering?1:0)});var Es=["unknown","vector","raster","image stack"];function w3(e){var t,r,n,a,i,o,s=Q(Q({style:wp.decode(e.warpStyle)},e.warpValues?{values:e.warpValues}:{value:e.warpValue||0}),{perspective:e.warpPerspective||0,perspectiveOther:e.warpPerspectiveOther||0,rotate:Rl.decode(e.warpRotate),bounds:e.bounds&&{top:Gi(e.bounds["Top "]),left:Gi(e.bounds.Left),bottom:Gi(e.bounds.Btom),right:Gi(e.bounds.Rght)},uOrder:e.uOrder,vOrder:e.vOrder});(e.deformNumRows!=null||e.deformNumCols!=null)&&(s.deformNumRows=e.deformNumRows,s.deformNumCols=e.deformNumCols);var l=e.customEnvelopeWarp;if(l){s.customEnvelopeWarp={meshPoints:[]};for(var c=((t=l.meshPoints.find(function(f){return f.type==="Hrzn"}))===null||t===void 0?void 0:t.values)||[],u=((r=l.meshPoints.find(function(f){return f.type==="Vrtc"}))===null||r===void 0?void 0:r.values)||[],d=0;d<c.length;d++)s.customEnvelopeWarp.meshPoints.push({x:c[d],y:u[d]});(l.quiltSliceX||l.quiltSliceY)&&(s.customEnvelopeWarp.quiltSliceX=((a=(n=l.quiltSliceX)===null||n===void 0?void 0:n[0])===null||a===void 0?void 0:a.values)||[],s.customEnvelopeWarp.quiltSliceY=((o=(i=l.quiltSliceY)===null||i===void 0?void 0:i[0])===null||o===void 0?void 0:o.values)||[])}return s}function Np(e){var t,r;return e.deformNumCols!=null||e.deformNumRows!=null||((t=e.customEnvelopeWarp)===null||t===void 0?void 0:t.quiltSliceX)||((r=e.customEnvelopeWarp)===null||r===void 0?void 0:r.quiltSliceY)}function ou(e){var t=e.bounds,r=Q(Q({warpStyle:wp.encode(e.style)},e.values?{warpValues:e.values}:{warpValue:e.value||0}),{warpPerspective:e.perspective||0,warpPerspectiveOther:e.perspectiveOther||0,warpRotate:Rl.encode(e.rotate),bounds:{"Top ":pr(t&&t.top||{units:"Pixels",value:0},"bounds.top"),Left:pr(t&&t.left||{units:"Pixels",value:0},"bounds.left"),Btom:pr(t&&t.bottom||{units:"Pixels",value:0},"bounds.bottom"),Rght:pr(t&&t.right||{units:"Pixels",value:0},"bounds.right")},uOrder:e.uOrder||0,vOrder:e.vOrder||0}),n=Np(e);if(n){var a=r;a.deformNumRows=e.deformNumRows||0,a.deformNumCols=e.deformNumCols||0}var i=e.customEnvelopeWarp;if(i){var o=i.meshPoints||[];if(n){var a=r;a.customEnvelopeWarp={_name:"",_classID:"customEnvelopeWarp",quiltSliceX:[{type:"quiltSliceX",values:i.quiltSliceX||[]}],quiltSliceY:[{type:"quiltSliceY",values:i.quiltSliceY||[]}],meshPoints:[{type:"Hrzn",values:o.map(function(l){return l.x})},{type:"Vrtc",values:o.map(function(l){return l.y})}]}}else r.customEnvelopeWarp={_name:"",_classID:"customEnvelopeWarp",meshPoints:[{type:"Hrzn",values:o.map(function(s){return s.x})},{type:"Vrtc",values:o.map(function(s){return s.y})}]}}return r}ht("PlLd",ir("placedLayer"),function(e,t,r){if(lr(e)!=="plcL")throw new Error("Invalid PlLd signature");if(dt(e)!==3)throw new Error("Invalid PlLd version");var n=ua(e,1),a=dt(e),i=dt(e);dt(e);var o=dt(e);if(!Es[o])throw new Error("Invalid PlLd type");for(var s=[],l=0;l<8;l++)s.push(Zn(e));var c=dt(e);if(c!==0)throw new Error("Invalid Warp version ".concat(c));var u=Ft(e);t.placedLayer=t.placedLayer||{id:n,type:Es[o],pageNumber:a,totalPages:i,transform:s,warp:w3(u)},ct(e,r())},function(e,t){var r=t.placedLayer;if(yt(e,"plcL"),bt(e,3),!r.id||typeof r.id!="string"||!/^[0-9a-f]{8}-([0-9a-f]{4}-){3}[0-9a-f]{12}$/.test(r.id))throw new Error("Placed layer ID must be in a GUID format (example: 20953ddb-9391-11ec-b4f1-c15674f50bc4)");if(Wi(e,r.id,1),bt(e,1),bt(e,1),bt(e,16),Es.indexOf(r.type)===-1)throw new Error("Invalid placedLayer type");bt(e,Es.indexOf(r.type));for(var n=0;n<8;n++)Jn(e,r.transform[n]);bt(e,0);var a=S3(r),i=Np(a),o=i?"quiltWarp":"warp";Lt(e,"",o,ou(a),o)});function XR(e){return new Float32Array(e.buffer.slice(e.byteOffset),0,e.byteLength/4)}function ZR(e){return new Uint32Array(e.buffer.slice(e.byteOffset),0,e.byteLength/4)}function Up(e){return new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}function su(e){for(var t=[],r=0;r<e.length;r+=2)t.push({x:e[r],y:e[r+1]});return t}function $l(e){for(var t=[],r=0;r<e.length;r++)t.push(e[r].x,e[r].y);return t}function k3(e){return su(XR(e))}function Nl(e){return{x:Jt(e.Hrzn),y:Jt(e.Vrtc)}}function Ul(e){return{_name:"",_classID:"Pnt ",Hrzn:pr(e.x,"x"),Vrtc:pr(e.y,"y")}}function JR(e,t){var r={name:e["Nm "],opacity:gt(e.blendOptions.Opct),blendMode:bn.decode(e.blendOptions["Md "]),enabled:e.enab,hasOptions:e.hasoptions,foregroundColor:oa(e.FrgC),backgroundColor:oa(e.BckC)};if("Fltr"in e)switch(e.Fltr._classID){case"boxblur":return Q(Q({},r),{type:"box blur",filter:{radius:Jt(e.Fltr["Rds "])}});case"GsnB":return Q(Q({},r),{type:"gaussian blur",filter:{radius:Jt(e.Fltr["Rds "])}});case"MtnB":return Q(Q({},r),{type:"motion blur",filter:{angle:e.Fltr.Angl,distance:Jt(e.Fltr.Dstn)}});case"RdlB":return Q(Q({},r),{type:"radial blur",filter:{amount:e.Fltr.Amnt,method:cy.decode(e.Fltr.BlrM),quality:uy.decode(e.Fltr.BlrQ)}});case"shapeBlur":return Q(Q({},r),{type:"shape blur",filter:{radius:Jt(e.Fltr["Rds "]),customShape:{name:e.Fltr.customShape["Nm "],id:e.Fltr.customShape.Idnt}}});case"SmrB":return Q(Q({},r),{type:"smart blur",filter:{radius:e.Fltr["Rds "],threshold:e.Fltr.Thsh,quality:dy.decode(e.Fltr.SmBQ),mode:fy.decode(e.Fltr.SmBM)}});case"surfaceBlur":return Q(Q({},r),{type:"surface blur",filter:{radius:Jt(e.Fltr["Rds "]),threshold:e.Fltr.Thsh}});case"Dspl":return Q(Q({},r),{type:"displace",filter:{horizontalScale:e.Fltr.HrzS,verticalScale:e.Fltr.VrtS,displacementMap:py.decode(e.Fltr.DspM),undefinedAreas:bs.decode(e.Fltr.UndA),displacementFile:{signature:e.Fltr.DspF.sig,path:e.Fltr.DspF.path}}});case"Pnch":return Q(Q({},r),{type:"pinch",filter:{amount:e.Fltr.Amnt}});case"Plr ":return Q(Q({},r),{type:"polar coordinates",filter:{conversion:hy.decode(e.Fltr.Cnvr)}});case"Rple":return Q(Q({},r),{type:"ripple",filter:{amount:e.Fltr.Amnt,size:vy.decode(e.Fltr.RplS)}});case"Shr ":return Q(Q({},r),{type:"shear",filter:{shearPoints:e.Fltr.ShrP.map(function(s){return{x:s.Hrzn,y:s.Vrtc}}),shearStart:e.Fltr.ShrS,shearEnd:e.Fltr.ShrE,undefinedAreas:bs.decode(e.Fltr.UndA)}});case"Sphr":return Q(Q({},r),{type:"spherize",filter:{amount:e.Fltr.Amnt,mode:my.decode(e.Fltr.SphM)}});case"Twrl":return Q(Q({},r),{type:"twirl",filter:{angle:e.Fltr.Angl}});case"Wave":return Q(Q({},r),{type:"wave",filter:{numberOfGenerators:e.Fltr.NmbG,type:gy.decode(e.Fltr.Wvtp),wavelength:{min:e.Fltr.WLMn,max:e.Fltr.WLMx},amplitude:{min:e.Fltr.AmMn,max:e.Fltr.AmMx},scale:{x:e.Fltr.SclH,y:e.Fltr.SclV},randomSeed:e.Fltr.RndS,undefinedAreas:bs.decode(e.Fltr.UndA)}});case"ZgZg":return Q(Q({},r),{type:"zigzag",filter:{amount:e.Fltr.Amnt,ridges:e.Fltr.NmbR,style:by.decode(e.Fltr.ZZTy)}});case"AdNs":return Q(Q({},r),{type:"add noise",filter:{amount:gt(e.Fltr.Nose),distribution:yy.decode(e.Fltr.Dstr),monochromatic:e.Fltr.Mnch,randomSeed:e.Fltr.FlRs}});case"DstS":return Q(Q({},r),{type:"dust and scratches",filter:{radius:e.Fltr["Rds "],threshold:e.Fltr.Thsh}});case"Mdn ":return Q(Q({},r),{type:"median",filter:{radius:Jt(e.Fltr["Rds "])}});case"denoise":return Q(Q({},r),{type:"reduce noise",filter:{preset:e.Fltr.preset,removeJpegArtifact:e.Fltr.removeJPEGArtifact,reduceColorNoise:gt(e.Fltr.ClNs),sharpenDetails:gt(e.Fltr.Shrp),channelDenoise:e.Fltr.channelDenoise.map(function(s){return Q({channels:s.Chnl.map(Ll.decode),amount:s.Amnt},s.EdgF?{preserveDetails:s.EdgF}:{})})}});case"ClrH":return Q(Q({},r),{type:"color halftone",filter:{radius:e.Fltr["Rds "],angle1:e.Fltr.Ang1,angle2:e.Fltr.Ang2,angle3:e.Fltr.Ang3,angle4:e.Fltr.Ang4}});case"Crst":return Q(Q({},r),{type:"crystallize",filter:{cellSize:e.Fltr.ClSz,randomSeed:e.Fltr.FlRs}});case"Mztn":return Q(Q({},r),{type:"mezzotint",filter:{type:_y.decode(e.Fltr.MztT),randomSeed:e.Fltr.FlRs}});case"Msc ":return Q(Q({},r),{type:"mosaic",filter:{cellSize:Jt(e.Fltr.ClSz)}});case"Pntl":return Q(Q({},r),{type:"pointillize",filter:{cellSize:e.Fltr.ClSz,randomSeed:e.Fltr.FlRs}});case"Clds":return Q(Q({},r),{type:"clouds",filter:{randomSeed:e.Fltr.FlRs}});case"DfrC":return Q(Q({},r),{type:"difference clouds",filter:{randomSeed:e.Fltr.FlRs}});case"Fbrs":return Q(Q({},r),{type:"fibers",filter:{variance:e.Fltr.Vrnc,strength:e.Fltr.Strg,randomSeed:e.Fltr.RndS}});case"LnsF":return Q(Q({},r),{type:"lens flare",filter:{brightness:e.Fltr.Brgh,position:{x:e.Fltr.FlrC.Hrzn,y:e.Fltr.FlrC.Vrtc},lensType:xy.decode(e.Fltr["Lns "])}});case"smartSharpen":return Q(Q({},r),{type:"smart sharpen",filter:{amount:gt(e.Fltr.Amnt),radius:Jt(e.Fltr["Rds "]),threshold:e.Fltr.Thsh,angle:e.Fltr.Angl,moreAccurate:e.Fltr.moreAccurate,blur:wy.decode(e.Fltr.blur),preset:e.Fltr.preset,shadow:{fadeAmount:gt(e.Fltr.sdwM.Amnt),tonalWidth:gt(e.Fltr.sdwM.Wdth),radius:e.Fltr.sdwM["Rds "]},highlight:{fadeAmount:gt(e.Fltr.hglM.Amnt),tonalWidth:gt(e.Fltr.hglM.Wdth),radius:e.Fltr.hglM["Rds "]}}});case"UnsM":return Q(Q({},r),{type:"unsharp mask",filter:{amount:gt(e.Fltr.Amnt),radius:Jt(e.Fltr["Rds "]),threshold:e.Fltr.Thsh}});case"Dfs ":return Q(Q({},r),{type:"diffuse",filter:{mode:ky.decode(e.Fltr["Md "]),randomSeed:e.Fltr.FlRs}});case"Embs":return Q(Q({},r),{type:"emboss",filter:{angle:e.Fltr.Angl,height:e.Fltr.Hght,amount:e.Fltr.Amnt}});case"Extr":return Q(Q({},r),{type:"extrude",filter:{type:Sy.decode(e.Fltr.ExtT),size:e.Fltr.ExtS,depth:e.Fltr.ExtD,depthMode:Cy.decode(e.Fltr.ExtR),randomSeed:e.Fltr.FlRs,solidFrontFaces:e.Fltr.ExtF,maskIncompleteBlocks:e.Fltr.ExtM}});case"Tls ":return Q(Q({},r),{type:"tiles",filter:{numberOfTiles:e.Fltr.TlNm,maximumOffset:e.Fltr.TlOf,fillEmptyAreaWith:Ey.decode(e.Fltr.FlCl),randomSeed:e.Fltr.FlRs}});case"TrcC":return Q(Q({},r),{type:"trace contour",filter:{level:e.Fltr["Lvl "],edge:Ay.decode(e.Fltr["Edg "])}});case"Wnd ":return Q(Q({},r),{type:"wind",filter:{method:Ty.decode(e.Fltr.WndM),direction:My.decode(e.Fltr.Drct)}});case"Dntr":return Q(Q({},r),{type:"de-interlace",filter:{eliminate:Dy.decode(e.Fltr.IntE),newFieldsBy:zy.decode(e.Fltr.IntC)}});case"Cstm":return Q(Q({},r),{type:"custom",filter:{scale:e.Fltr["Scl "],offset:e.Fltr.Ofst,matrix:e.Fltr.Mtrx}});case"HghP":return Q(Q({},r),{type:"high pass",filter:{radius:Jt(e.Fltr["Rds "])}});case"Mxm ":return Q(Q({},r),{type:"maximum",filter:{radius:Jt(e.Fltr["Rds "])}});case"Mnm ":return Q(Q({},r),{type:"minimum",filter:{radius:Jt(e.Fltr["Rds "])}});case"Ofst":return Q(Q({},r),{type:"offset",filter:{horizontal:e.Fltr.Hrzn,vertical:e.Fltr.Vrtc,undefinedAreas:Iy.decode(e.Fltr["Fl "])}});case"rigidTransform":return Q(Q({},r),{type:"puppet",filter:{rigidType:e.Fltr.rigidType,bounds:[{x:e.Fltr.PuX0,y:e.Fltr.PuY0},{x:e.Fltr.PuX1,y:e.Fltr.PuY1},{x:e.Fltr.PuX2,y:e.Fltr.PuY2},{x:e.Fltr.PuX3,y:e.Fltr.PuY3}],puppetShapeList:e.Fltr.puppetShapeList.map(function(s){return{rigidType:s.rigidType,originalVertexArray:k3(s.originalVertexArray),deformedVertexArray:k3(s.deformedVertexArray),indexArray:Array.from(ZR(s.indexArray)),pinOffsets:su(s.pinOffsets),posFinalPins:su(s.posFinalPins),pinVertexIndices:s.pinVertexIndices,selectedPin:s.selectedPin,pinPosition:su(s.PinP),pinRotation:s.PnRt,pinOverlay:s.PnOv,pinDepth:s.PnDp,meshQuality:s.meshQuality,meshExpansion:s.meshExpansion,meshRigidity:s.meshRigidity,imageResolution:s.imageResolution,meshBoundaryPath:{pathComponents:s.meshBoundaryPath.pathComponents.map(function(l){return{shapeOperation:l.shapeOperation.split(".")[1],paths:l.SbpL.map(function(c){return{closed:c.Clsp,points:c["Pts "].map(function(u){return{anchor:Nl(u.Anch),forward:Nl(u["Fwd "]),backward:Nl(u["Bwd "]),smooth:u.Smoo}})}})}})}}})}});case"PbPl":{for(var n=[],a=e.Fltr,i=0;i<Rn.length&&a["PN".concat(Rn[i],"a")];i++)for(var o=0;o<Rn.length&&a["PN".concat(Rn[i]).concat(Rn[o])];o++)n.push({name:a["PN".concat(Rn[i]).concat(Rn[o])],value:a["PF".concat(Rn[i]).concat(Rn[o])]});return Q(Q({},r),{type:"oil paint plugin",filter:{name:e.Fltr.KnNm,gpu:e.Fltr.GpuY,lighting:e.Fltr.LIWy,parameters:n}})}case"HsbP":return Q(Q({},r),{type:"hsb/hsl",filter:{inputMode:Kc.decode(e.Fltr.Inpt),rowOrder:Kc.decode(e.Fltr.Otpt)}});case"oilPaint":return Q(Q({},r),{type:"oil paint",filter:{lightingOn:e.Fltr.lightingOn,stylization:e.Fltr.stylization,cleanliness:e.Fltr.cleanliness,brushScale:e.Fltr.brushScale,microBrush:e.Fltr.microBrush,lightDirection:e.Fltr.LghD,specularity:e.Fltr.specularity}});case"LqFy":return Q(Q({},r),{type:"liquify",filter:{liquifyMesh:e.Fltr.LqMe}});case"perspectiveWarpTransform":return Q(Q({},r),{type:"perspective warp",filter:{vertices:e.Fltr.vertices.map(Nl),warpedVertices:e.Fltr.warpedVertices.map(Nl),quads:e.Fltr.quads.map(function(s){return s.indices})}});case"Crvs":return Q(Q({},r),{type:"curves",filter:Q({presetKind:Oy.decode(e.Fltr.presetKind)},e.Fltr.Adjs?{adjustments:e.Fltr.Adjs.map(function(s){var l=s.Chnl.map(Ll.decode);if(s["Crv "])return{channels:l,curve:s["Crv "].map(function(c){var u={x:c.Hrzn,y:c.Vrtc};return c.Cnty&&(u.curved=!0),u})};if(s.Mpng)return{channels:l,values:s.Mpng};throw new Error("Unknown curve adjustment")})}:{})});case"BrgC":return Q(Q({},r),{type:"brightness/contrast",filter:{brightness:e.Fltr.Brgh,contrast:e.Fltr.Cntr,useLegacy:!!e.Fltr.useLegacy}});default:if(t.throwForMissingFeatures)throw new Error("Unknown filter classId: ".concat(e.Fltr._classID));return}else switch(e.filterID){case 1098281575:return Q(Q({},r),{type:"average"});case 1114403360:return Q(Q({},r),{type:"blur"});case 1114403405:return Q(Q({},r),{type:"blur more"});case 1148416099:return Q(Q({},r),{type:"despeckle"});case 1180922912:return Q(Q({},r),{type:"facet"});case 1181902701:return Q(Q({},r),{type:"fragment"});case 1399353968:return Q(Q({},r),{type:"sharpen"});case 1399353925:return Q(Q({},r),{type:"sharpen edges"});case 1399353933:return Q(Q({},r),{type:"sharpen more"});case 1181639749:return Q(Q({},r),{type:"find edges"});case 1399616122:return Q(Q({},r),{type:"solarize"});case 1314149187:return Q(Q({},r),{type:"ntsc colors"});case 1231976050:return Q(Q({},r),{type:"invert"});default:if(t.throwForMissingFeatures)throw new Error("Unknown filterID: ".concat(e.filterID))}}function QR(e,t){return{enabled:e.enab,validAtPosition:e.validAtPosition,maskEnabled:e.filterMaskEnable,maskLinked:e.filterMaskLinked,maskExtendWithWhite:e.filterMaskExtendWithWhite,list:e.filterFXList.map(function(r){return JR(r,t)}).filter(function(r){return!!r})}}function Ua(e){return pr(e.radius,"radius")}function eL(e){var t={_name:"",_classID:"filterFX","Nm ":e.name,blendOptions:{_name:"",_classID:"blendOptions",Opct:Xn(e.opacity),"Md ":bn.encode(e.blendMode)},enab:e.enabled,hasoptions:e.hasOptions,FrgC:sa(e.foregroundColor),BckC:sa(e.backgroundColor)};switch(e.type){case"average":return Q(Q({},t),{filterID:1098281575});case"blur":return Q(Q({},t),{filterID:1114403360});case"blur more":return Q(Q({},t),{filterID:1114403405});case"box blur":return Q(Q({},t),{Fltr:{_name:"Box Blur",_classID:"boxblur","Rds ":Ua(e.filter)},filterID:697});case"gaussian blur":return Q(Q({},t),{Fltr:{_name:"Gaussian Blur",_classID:"GsnB","Rds ":Ua(e.filter)},filterID:1198747202});case"motion blur":return Q(Q({},t),{Fltr:{_name:"Motion Blur",_classID:"MtnB",Angl:e.filter.angle,Dstn:pr(e.filter.distance,"distance")},filterID:1299476034});case"radial blur":return Q(Q({},t),{Fltr:{_name:"Radial Blur",_classID:"RdlB",Amnt:e.filter.amount,BlrM:cy.encode(e.filter.method),BlrQ:uy.encode(e.filter.quality)},filterID:1382313026});case"shape blur":return Q(Q({},t),{Fltr:{_name:"Shape Blur",_classID:"shapeBlur","Rds ":Ua(e.filter),customShape:{_name:"",_classID:"customShape","Nm ":e.filter.customShape.name,Idnt:e.filter.customShape.id}},filterID:702});case"smart blur":return Q(Q({},t),{Fltr:{_name:"Smart Blur",_classID:"SmrB","Rds ":e.filter.radius,Thsh:e.filter.threshold,SmBQ:dy.encode(e.filter.quality),SmBM:fy.encode(e.filter.mode)},filterID:1399681602});case"surface blur":return Q(Q({},t),{Fltr:{_name:"Surface Blur",_classID:"surfaceBlur","Rds ":Ua(e.filter),Thsh:e.filter.threshold},filterID:701});case"displace":return Q(Q({},t),{Fltr:{_name:"Displace",_classID:"Dspl",HrzS:e.filter.horizontalScale,VrtS:e.filter.verticalScale,DspM:py.encode(e.filter.displacementMap),UndA:bs.encode(e.filter.undefinedAreas),DspF:{sig:e.filter.displacementFile.signature,path:e.filter.displacementFile.path}},filterID:1148416108});case"pinch":return Q(Q({},t),{Fltr:{_name:"Pinch",_classID:"Pnch",Amnt:e.filter.amount},filterID:1349411688});case"polar coordinates":return Q(Q({},t),{Fltr:{_name:"Polar Coordinates",_classID:"Plr ",Cnvr:hy.encode(e.filter.conversion)},filterID:1349284384});case"ripple":return Q(Q({},t),{Fltr:{_name:"Ripple",_classID:"Rple",Amnt:e.filter.amount,RplS:vy.encode(e.filter.size)},filterID:1383099493});case"shear":return Q(Q({},t),{Fltr:{_name:"Shear",_classID:"Shr ",ShrP:e.filter.shearPoints.map(function(l){return{_name:"",_classID:"Pnt ",Hrzn:l.x,Vrtc:l.y}}),UndA:bs.encode(e.filter.undefinedAreas),ShrS:e.filter.shearStart,ShrE:e.filter.shearEnd},filterID:1399353888});case"spherize":return Q(Q({},t),{Fltr:{_name:"Spherize",_classID:"Sphr",Amnt:e.filter.amount,SphM:my.encode(e.filter.mode)},filterID:1399875698});case"twirl":return Q(Q({},t),{Fltr:{_name:"Twirl",_classID:"Twrl",Angl:e.filter.angle},filterID:1417114220});case"wave":return Q(Q({},t),{Fltr:{_name:"Wave",_classID:"Wave",Wvtp:gy.encode(e.filter.type),NmbG:e.filter.numberOfGenerators,WLMn:e.filter.wavelength.min,WLMx:e.filter.wavelength.max,AmMn:e.filter.amplitude.min,AmMx:e.filter.amplitude.max,SclH:e.filter.scale.x,SclV:e.filter.scale.y,UndA:bs.encode(e.filter.undefinedAreas),RndS:e.filter.randomSeed},filterID:1466005093});case"zigzag":return Q(Q({},t),{Fltr:{_name:"ZigZag",_classID:"ZgZg",Amnt:e.filter.amount,NmbR:e.filter.ridges,ZZTy:by.encode(e.filter.style)},filterID:1516722791});case"add noise":return Q(Q({},t),{Fltr:{_name:"Add Noise",_classID:"AdNs",Dstr:yy.encode(e.filter.distribution),Nose:Xn(e.filter.amount),Mnch:e.filter.monochromatic,FlRs:e.filter.randomSeed},filterID:1097092723});case"despeckle":return Q(Q({},t),{filterID:1148416099});case"dust and scratches":return Q(Q({},t),{Fltr:{_name:"Dust & Scratches",_classID:"DstS","Rds ":e.filter.radius,Thsh:e.filter.threshold},filterID:1148417107});case"median":return Q(Q({},t),{Fltr:{_name:"Median",_classID:"Mdn ","Rds ":Ua(e.filter)},filterID:1298427424});case"reduce noise":return Q(Q({},t),{Fltr:{_name:"Reduce Noise",_classID:"denoise",ClNs:Xn(e.filter.reduceColorNoise),Shrp:Xn(e.filter.sharpenDetails),removeJPEGArtifact:e.filter.removeJpegArtifact,channelDenoise:e.filter.channelDenoise.map(function(l){return Q({_name:"",_classID:"channelDenoiseParams",Chnl:l.channels.map(function(c){return Ll.encode(c)}),Amnt:l.amount},l.preserveDetails?{EdgF:l.preserveDetails}:{})}),preset:e.filter.preset},filterID:633});case"color halftone":return Q(Q({},t),{Fltr:{_name:"Color Halftone",_classID:"ClrH","Rds ":e.filter.radius,Ang1:e.filter.angle1,Ang2:e.filter.angle2,Ang3:e.filter.angle3,Ang4:e.filter.angle4},filterID:1131180616});case"crystallize":return Q(Q({},t),{Fltr:{_name:"Crystallize",_classID:"Crst",ClSz:e.filter.cellSize,FlRs:e.filter.randomSeed},filterID:1131574132});case"facet":return Q(Q({},t),{filterID:1180922912});case"fragment":return Q(Q({},t),{filterID:1181902701});case"mezzotint":return Q(Q({},t),{Fltr:{_name:"Mezzotint",_classID:"Mztn",MztT:_y.encode(e.filter.type),FlRs:e.filter.randomSeed},filterID:1299870830});case"mosaic":return Q(Q({},t),{Fltr:{_name:"Mosaic",_classID:"Msc ",ClSz:pr(e.filter.cellSize,"cellSize")},filterID:1299407648});case"pointillize":return Q(Q({},t),{Fltr:{_name:"Pointillize",_classID:"Pntl",ClSz:e.filter.cellSize,FlRs:e.filter.randomSeed},filterID:1349416044});case"clouds":return Q(Q({},t),{Fltr:{_name:"Clouds",_classID:"Clds",FlRs:e.filter.randomSeed},filterID:1131177075});case"difference clouds":return Q(Q({},t),{Fltr:{_name:"Difference Clouds",_classID:"DfrC",FlRs:e.filter.randomSeed},filterID:1147564611});case"fibers":return Q(Q({},t),{Fltr:{_name:"Fibers",_classID:"Fbrs",Vrnc:e.filter.variance,Strg:e.filter.strength,RndS:e.filter.randomSeed},filterID:1180856947});case"lens flare":return Q(Q({},t),{Fltr:{_name:"Lens Flare",_classID:"LnsF",Brgh:e.filter.brightness,FlrC:{_name:"",_classID:"Pnt ",Hrzn:e.filter.position.x,Vrtc:e.filter.position.y},"Lns ":xy.encode(e.filter.lensType)},filterID:1282306886});case"sharpen":return Q(Q({},t),{filterID:1399353968});case"sharpen edges":return Q(Q({},t),{filterID:1399353925});case"sharpen more":return Q(Q({},t),{filterID:1399353933});case"smart sharpen":return Q(Q({},t),{Fltr:{_name:"Smart Sharpen",_classID:"smartSharpen",Amnt:Xn(e.filter.amount),"Rds ":Ua(e.filter),Thsh:e.filter.threshold,Angl:e.filter.angle,moreAccurate:e.filter.moreAccurate,blur:wy.encode(e.filter.blur),preset:e.filter.preset,sdwM:{_name:"Parameters",_classID:"adaptCorrectTones",Amnt:Xn(e.filter.shadow.fadeAmount),Wdth:Xn(e.filter.shadow.tonalWidth),"Rds ":e.filter.shadow.radius},hglM:{_name:"Parameters",_classID:"adaptCorrectTones",Amnt:Xn(e.filter.highlight.fadeAmount),Wdth:Xn(e.filter.highlight.tonalWidth),"Rds ":e.filter.highlight.radius}},filterID:698});case"unsharp mask":return Q(Q({},t),{Fltr:{_name:"Unsharp Mask",_classID:"UnsM",Amnt:Xn(e.filter.amount),"Rds ":Ua(e.filter),Thsh:e.filter.threshold},filterID:1433301837});case"diffuse":return Q(Q({},t),{Fltr:{_name:"Diffuse",_classID:"Dfs ","Md ":ky.encode(e.filter.mode),FlRs:e.filter.randomSeed},filterID:1147564832});case"emboss":return Q(Q({},t),{Fltr:{_name:"Emboss",_classID:"Embs",Angl:e.filter.angle,Hght:e.filter.height,Amnt:e.filter.amount},filterID:1164796531});case"extrude":return Q(Q({},t),{Fltr:{_name:"Extrude",_classID:"Extr",ExtS:e.filter.size,ExtD:e.filter.depth,ExtF:e.filter.solidFrontFaces,ExtM:e.filter.maskIncompleteBlocks,ExtT:Sy.encode(e.filter.type),ExtR:Cy.encode(e.filter.depthMode),FlRs:e.filter.randomSeed},filterID:1165522034});case"find edges":return Q(Q({},t),{filterID:1181639749});case"solarize":return Q(Q({},t),{filterID:1399616122});case"tiles":return Q(Q({},t),{Fltr:{_name:"Tiles",_classID:"Tls ",TlNm:e.filter.numberOfTiles,TlOf:e.filter.maximumOffset,FlCl:Ey.encode(e.filter.fillEmptyAreaWith),FlRs:e.filter.randomSeed},filterID:1416393504});case"trace contour":return Q(Q({},t),{Fltr:{_name:"Trace Contour",_classID:"TrcC","Lvl ":e.filter.level,"Edg ":Ay.encode(e.filter.edge)},filterID:1416782659});case"wind":return Q(Q({},t),{Fltr:{_name:"Wind",_classID:"Wnd ",WndM:Ty.encode(e.filter.method),Drct:My.encode(e.filter.direction)},filterID:1466852384});case"de-interlace":return Q(Q({},t),{Fltr:{_name:"De-Interlace",_classID:"Dntr",IntE:Dy.encode(e.filter.eliminate),IntC:zy.encode(e.filter.newFieldsBy)},filterID:1148089458});case"ntsc colors":return Q(Q({},t),{filterID:1314149187});case"invert":return Q(Q({},t),{filterID:1231976050});case"custom":return Q(Q({},t),{Fltr:{_name:"Custom",_classID:"Cstm","Scl ":e.filter.scale,Ofst:e.filter.offset,Mtrx:e.filter.matrix},filterID:1131639917});case"high pass":return Q(Q({},t),{Fltr:{_name:"High Pass",_classID:"HghP","Rds ":Ua(e.filter)},filterID:1214736464});case"maximum":return Q(Q({},t),{Fltr:{_name:"Maximum",_classID:"Mxm ","Rds ":Ua(e.filter)},filterID:1299737888});case"minimum":return Q(Q({},t),{Fltr:{_name:"Minimum",_classID:"Mnm ","Rds ":Ua(e.filter)},filterID:1299082528});case"offset":return Q(Q({},t),{Fltr:{_name:"Offset",_classID:"Ofst",Hrzn:e.filter.horizontal,Vrtc:e.filter.vertical,"Fl ":Iy.encode(e.filter.undefinedAreas)},filterID:1332114292});case"puppet":return Q(Q({},t),{Fltr:{_name:"Rigid Transform",_classID:"rigidTransform",null:["Ordn.Trgt"],rigidType:e.filter.rigidType,puppetShapeList:e.filter.puppetShapeList.map(function(l){return{_name:"",_classID:"puppetShape",rigidType:l.rigidType,VrsM:1,VrsN:0,originalVertexArray:Up(new Float32Array($l(l.originalVertexArray))),deformedVertexArray:Up(new Float32Array($l(l.deformedVertexArray))),indexArray:Up(new Uint32Array(l.indexArray)),pinOffsets:$l(l.pinOffsets),posFinalPins:$l(l.posFinalPins),pinVertexIndices:l.pinVertexIndices,PinP:$l(l.pinPosition),PnRt:l.pinRotation,PnOv:l.pinOverlay,PnDp:l.pinDepth,meshQuality:l.meshQuality,meshExpansion:l.meshExpansion,meshRigidity:l.meshRigidity,imageResolution:l.imageResolution,meshBoundaryPath:{_name:"",_classID:"pathClass",pathComponents:l.meshBoundaryPath.pathComponents.map(function(c){return{_name:"",_classID:"PaCm",shapeOperation:"shapeOperation.".concat(c.shapeOperation),SbpL:c.paths.map(function(u){return{_name:"",_classID:"Sbpl",Clsp:u.closed,"Pts ":u.points.map(function(d){return{_name:"",_classID:"Pthp",Anch:Ul(d.anchor),"Fwd ":Ul(d.forward),"Bwd ":Ul(d.backward),Smoo:d.smooth}})}})}})},selectedPin:l.selectedPin}}),PuX0:e.filter.bounds[0].x,PuX1:e.filter.bounds[1].x,PuX2:e.filter.bounds[2].x,PuX3:e.filter.bounds[3].x,PuY0:e.filter.bounds[0].y,PuY1:e.filter.bounds[1].y,PuY2:e.filter.bounds[2].y,PuY3:e.filter.bounds[3].y},filterID:991});case"oil paint plugin":{for(var r={},n=0;n<e.filter.parameters.length;n++){var a=e.filter.parameters[n],i=a.name,o=a.value,s="".concat(Rn[Math.floor(n/Rn.length)]).concat(Rn[n%Rn.length]);r["PN".concat(s)]=i,r["PT".concat(s)]=0,r["PF".concat(s)]=o}return Q(Q({},t),{Fltr:Q({_name:"Oil Paint Plugin",_classID:"PbPl",KnNm:e.filter.name,GpuY:e.filter.gpu,LIWy:e.filter.lighting,FPth:"1"},r),filterID:1348620396})}case"oil paint":return Q(Q({},t),{Fltr:{_name:"Oil Paint",_classID:"oilPaint",lightingOn:e.filter.lightingOn,stylization:e.filter.stylization,cleanliness:e.filter.cleanliness,brushScale:e.filter.brushScale,microBrush:e.filter.microBrush,LghD:e.filter.lightDirection,specularity:e.filter.specularity},filterID:1122});case"liquify":return Q(Q({},t),{Fltr:{_name:"Liquify",_classID:"LqFy",LqMe:e.filter.liquifyMesh},filterID:1282492025});case"perspective warp":return Q(Q({},t),{Fltr:{_name:"Perspective Warp",_classID:"perspectiveWarpTransform",vertices:e.filter.vertices.map(Ul),warpedVertices:e.filter.warpedVertices.map(Ul),quads:e.filter.quads.map(function(l){return{indices:l}})},filterID:442});case"curves":return Q(Q({},t),{Fltr:Q({_name:"Curves",_classID:"Crvs",presetKind:Oy.encode(e.filter.presetKind)},e.filter.adjustments?{Adjs:e.filter.adjustments.map(function(l){return"curve"in l?{_name:"",_classID:"CrvA",Chnl:l.channels.map(Ll.encode),"Crv ":l.curve.map(function(c){return Q({_name:"",_classID:"Pnt ",Hrzn:c.x,Vrtc:c.y},c.curved?{Cnty:!0}:{})})}:{_name:"",_classID:"CrvA",Chnl:l.channels.map(Ll.encode),Mpng:l.values}})}:{}),filterID:1131574899});case"brightness/contrast":return Q(Q({},t),{Fltr:{_name:"Brightness/Contrast",_classID:"BrgC",Brgh:e.filter.brightness,Cntr:e.filter.contrast,useLegacy:!!e.filter.useLegacy},filterID:1114793795});default:throw new Error("Unknow filter type: ".concat(e.type))}}function S3(e){if(e.warp)return e.warp;if(!e.width||!e.height)throw new Error("You must provide width and height of the linked image in placedLayer");var t=e.width,r=e.height,n=0,a=t/3,i=t*2/3,o=t,s=0,l=r/3,c=r*2/3,u=r;return{style:"custom",value:0,perspective:0,perspectiveOther:0,rotate:"horizontal",bounds:{top:{value:0,units:"Pixels"},left:{value:0,units:"Pixels"},bottom:{value:r,units:"Pixels"},right:{value:t,units:"Pixels"}},uOrder:4,vOrder:4,customEnvelopeWarp:{meshPoints:[{x:n,y:s},{x:a,y:s},{x:i,y:s},{x:o,y:s},{x:n,y:l},{x:a,y:l},{x:i,y:l},{x:o,y:l},{x:n,y:c},{x:a,y:c},{x:i,y:c},{x:o,y:c},{x:n,y:u},{x:a,y:u},{x:i,y:u},{x:o,y:u}]}}}ht("SoLd",ir("placedLayer"),function(e,t,r){if(lr(e)!=="soLD")throw new Error("Invalid SoLd type");var n=dt(e);if(n!==4&&n!==5)throw new Error("Invalid SoLd version");var a=Ft(e,!0);t.placedLayer={id:a.Idnt,placed:a.placed,type:Es[a.Type],pageNumber:a.PgNm,totalPages:a.totalPages,frameStep:gn(a.frameStep),duration:gn(a.duration),frameCount:a.frameCount,transform:a.Trnf,width:a["Sz "].Wdth,height:a["Sz "].Hght,resolution:Jt(a.Rslt),warp:w3(a.quiltWarp||a.warp)},a.nonAffineTransform&&a.nonAffineTransform.some(function(i,o){return i!==a.Trnf[o]})&&(t.placedLayer.nonAffineTransform=a.nonAffineTransform),a.Crop&&(t.placedLayer.crop=a.Crop),a.comp&&(t.placedLayer.comp=a.comp),a.compInfo&&(t.placedLayer.compInfo={compID:a.compInfo.compID,originalCompID:a.compInfo.originalCompID}),a.filterFX&&(t.placedLayer.filter=QR(a.filterFX,e)),ct(e,r())},function(e,t){var r,n;yt(e,"soLD"),bt(e,4);var a=t.placedLayer;if(!a.id||typeof a.id!="string"||!/^[0-9a-f]{8}-([0-9a-f]{4}-){3}[0-9a-f]{12}$/.test(a.id))throw new Error("Placed layer ID must be in a GUID format (example: 20953ddb-9391-11ec-b4f1-c15674f50bc4)");var i=Q(Q({Idnt:a.id,placed:(r=a.placed)!==null&&r!==void 0?r:a.id,PgNm:a.pageNumber||1,totalPages:a.totalPages||1},a.crop?{Crop:a.crop}:{}),{frameStep:a.frameStep||{numerator:0,denominator:600},duration:a.duration||{numerator:0,denominator:600},frameCount:a.frameCount||0,Annt:16,Type:Es.indexOf(a.type),Trnf:a.transform,nonAffineTransform:(n=a.nonAffineTransform)!==null&&n!==void 0?n:a.transform,warp:ou(S3(a)),"Sz ":{_name:"",_classID:"Pnt ",Wdth:a.width||0,Hght:a.height||0},Rslt:a.resolution?pr(a.resolution,"resolution"):{units:"Density",value:72}});if(a.filter&&(i.filterFX={_name:"",_classID:"filterFXStyle",enab:a.filter.enabled,validAtPosition:a.filter.validAtPosition,filterMaskEnable:a.filter.maskEnabled,filterMaskLinked:a.filter.maskLinked,filterMaskExtendWithWhite:a.filter.maskExtendWithWhite,filterFXList:a.filter.list.map(function(s){return eL(s)})}),a.warp&&Np(a.warp)){var o=ou(a.warp);i.quiltWarp=o,i.warp={warpStyle:"warpStyle.warpNone",warpValue:o.warpValue,warpPerspective:o.warpPerspective,warpPerspectiveOther:o.warpPerspectiveOther,warpRotate:o.warpRotate,bounds:o.bounds,uOrder:o.uOrder,vOrder:o.vOrder}}else delete i.quiltWarp;a.comp&&(i.comp=a.comp),a.compInfo&&(i.compInfo=a.compInfo),Lt(e,"","null",i,i.quiltWarp?"quiltWarp":"warp")}),Cs("SoLE","SoLd"),ht("fxrp",ir("referencePoint"),function(e,t){t.referencePoint={x:Zn(e),y:Zn(e)}},function(e,t){Jn(e,t.referencePoint.x),Jn(e,t.referencePoint.y)}),ht("Lr16",function(){return!1},function(e,t,r,n,a){Ap(e,n,a)},function(e,t){}),ht("Lr32",function(){return!1},function(e,t,r,n,a){Ap(e,n,a)},function(e,t){}),ht("LMsk",ir("userMask"),function(e,t){t.userMask={colorSpace:qr(e),opacity:et(e)/255};var r=at(e);if(r!==128)throw new Error("Invalid flag value");ct(e,1)},function(e,t){var r=t.userMask;Kr(e,r.colorSpace),Ve(e,pp(r.opacity,0,1)*255),Qe(e,128),qt(e,1)}),ht("Patt",function(e){return!e},function(e,t,r){r()&&ct(e,r())},function(e,t){});function C3(e){var t=dt(e),r=dt(e),n=dt(e),a=dt(e);return{top:t,left:r,bottom:n,right:a}}function E3(e,t){bt(e,t.top),bt(e,t.left),bt(e,t.bottom),bt(e,t.right)}ht("Anno",function(e){return e.annotations!==void 0},function(e,t,r){var n=et(e),a=et(e);if(n!==2||a!==1)throw new Error("Invalid Anno version");for(var i=Ne(e),o=[],s=0;s<i;s++){Ne(e);var l=lr(e),c=!!at(e);at(e),et(e);var u=C3(e),d=C3(e),f=qr(e),p=ua(e,2),_=ua(e,2),h=ua(e,2);Ne(e),lr(e);var b=Ne(e),v=void 0;if(l==="txtA")b>=2&&et(e)===65279?v=Ep(e,(b-2)/2):(e.offset-=2,v=tu(e,b)),v=v.replace(/\r/g,`
|
|
292
|
+
`);else if(l==="sndA")v=Tr(e,b);else throw new Error("Unknown annotation type");o.push({type:l==="txtA"?"text":"sound",open:c,iconLocation:u,popupLocation:d,color:f,author:p,name:_,date:h,data:v})}t.annotations=o,ct(e,r())},function(e,t){var r=t.annotations;Ve(e,2),Ve(e,1),it(e,r.length);for(var n=0,a=r;n<a.length;n++){var i=a[n],o=i.type==="sound";if(o&&!(i.data instanceof Uint8Array))throw new Error("Sound annotation data should be Uint8Array");if(!o&&typeof i.data!="string")throw new Error("Text annotation data should be string");var s=e.offset;it(e,0),yt(e,o?"sndA":"txtA"),Qe(e,i.open?1:0),Qe(e,28),Ve(e,1),E3(e,i.iconLocation),E3(e,i.popupLocation),Kr(e,i.color),Wi(e,i.author||"",2),Wi(e,i.name||"",2),Wi(e,i.date||"",2);var l=e.offset;it(e,0),yt(e,o?"sndM":"txtC"),it(e,0);var c=e.offset;if(o)pa(e,i.data);else{Ve(e,65279);for(var u=i.data.replace(/\n/g,"\r"),d=0;d<u.length;d++)Ve(e,u.charCodeAt(d))}e.view.setUint32(s,e.offset-s,!1),e.view.setUint32(l,e.offset-l,!1),e.view.setUint32(c-4,e.offset-c,!1)}});function A3(e){ht(e,function(t){var r=t;return!(!r.linkedFiles||!r.linkedFiles.length||e==="lnkE"&&!r.linkedFiles.some(function(n){return n.linkedFile}))},function(t,r,n,a){var i=r;for(i.linkedFiles=i.linkedFiles||[];n()>8;){var o=Bp(t),s=t.offset,l=lr(t),c=dt(t),u=ua(t,1),d=Rr(t),f=lr(t).trim(),p=lr(t).trim(),_=Bp(t),h=at(t),b=h?Ft(t):void 0,v=l==="liFE"?Ft(t):void 0,m={id:u,name:d};if(f&&(m.type=f),p&&(m.creator=p),b&&(m.descriptor={compInfo:{compID:b.compInfo.compID,originalCompID:b.compInfo.originalCompID}}),l==="liFE"&&c>3){var y=dt(t),g=at(t),S=at(t),M=at(t),E=at(t),w=Zn(t),x=Math.floor(w),C=(w-x)*1e3;m.time=new Date(Date.UTC(y,g,S,M,E,x,C)).toISOString()}var D=l==="liFE"?Bp(t):0;for(l==="liFA"&&ct(t,8),l==="liFD"&&(m.data=Tr(t,_)),c>=5&&(m.childDocumentID=Rr(t)),c>=6&&(m.assetModTime=Zn(t)),c>=7&&(m.assetLockedState=at(t)),l==="liFE"&&c===2&&(m.data=Tr(t,D)),t.skipLinkedFilesData&&(m.data=void 0),e==="lnkE"&&(m.linkedFile={fileSize:D,name:(v==null?void 0:v["Nm "])||"",fullPath:(v==null?void 0:v.fullPath)||"",originalPath:(v==null?void 0:v.originalPath)||"",relativePath:(v==null?void 0:v.relPath)||""}),i.linkedFiles.push(m);o%4;)o++;t.offset=s+o}ct(t,n())},function(t,r){for(var n,a,i,o,s,l,c,u,d,f=r,p=0,_=f.linkedFiles;p<_.length;p++){var h=_[p];if(e==="lnkE"==!!h.linkedFile){var b=2;h.assetLockedState!=null?b=7:h.assetModTime!=null?b=6:h.childDocumentID!=null?b=5:e==="lnkE"&&(b=3),$p(t,0);var v=t.offset;if(yt(t,e==="lnkE"?"liFE":h.data?"liFD":"liFA"),bt(t,b),!h.id||typeof h.id!="string"||!/^[0-9a-f]{8}-([0-9a-f]{4}-){3}[0-9a-f]{12}$/.test(h.id))throw new Error("Linked file ID must be in a GUID format (example: 20953ddb-9391-11ec-b4f1-c15674f50bc4)");if(Wi(t,h.id,1),So(t,h.name||""),yt(t,h.type?"".concat(h.type," ").substring(0,4):" "),yt(t,h.creator?"".concat(h.creator," ").substring(0,4):"\0\0\0\0"),$p(t,h.data?h.data.byteLength:0),h.descriptor&&h.descriptor.compInfo){var m={compInfo:{compID:h.descriptor.compInfo.compID,originalCompID:h.descriptor.compInfo.originalCompID}};Qe(t,1),Lt(t,"","null",m)}else Qe(t,0);if(e==="lnkE"){var m={descVersion:2,"Nm ":(a=(n=h.linkedFile)===null||n===void 0?void 0:n.name)!==null&&a!==void 0?a:"",fullPath:(o=(i=h.linkedFile)===null||i===void 0?void 0:i.fullPath)!==null&&o!==void 0?o:"",originalPath:(l=(s=h.linkedFile)===null||s===void 0?void 0:s.originalPath)!==null&&l!==void 0?l:"",relPath:(u=(c=h.linkedFile)===null||c===void 0?void 0:c.relativePath)!==null&&u!==void 0?u:""};Lt(t,"","ExternalFileLink",m);var y=h.time?new Date(h.time):new Date;bt(t,y.getUTCFullYear()),Qe(t,y.getUTCMonth()),Qe(t,y.getUTCDate()),Qe(t,y.getUTCHours()),Qe(t,y.getUTCMinutes()),Jn(t,y.getUTCSeconds()+y.getUTCMilliseconds()/1e3)}h.data?pa(t,h.data):$p(t,((d=h.linkedFile)===null||d===void 0?void 0:d.fileSize)||0),b>=5&&So(t,h.childDocumentID||""),b>=6&&Jn(t,h.assetModTime||0),b>=7&&Qe(t,h.assetLockedState||0);var g=t.offset-v;for(t.view.setUint32(v-4,g,!1);g%4;)g++,Qe(t,0)}}})}A3("lnk2"),A3("lnkE"),Cs("lnkD","lnk2"),Cs("lnk3","lnk2"),ht("pths",ir("pathList"),function(e,t){Ft(e,!0),t.pathList=[]},function(e,t){var r={pathList:[]};Lt(e,"","pathsDataClass",r)}),ht("lyvr",ir("version"),function(e,t){return t.version=Ne(e)},function(e,t){return it(e,t.version)}),ht("lfxs",function(){return!1},function(e,t,r){var n=Ne(e);if(n!==0)throw new Error("Invalid lfxs version");var a=Ft(e);t.effects=Il(a,!!e.logMissingFeatures),ct(e,r())},function(e,t,r,n){var a=zl(t.effects,!!n.logMissingFeatures,!0);it(e,0),Lt(e,"","null",a)});function an(e){return function(t){return!!t.adjustment&&t.adjustment.type===e}}ht("brit",an("brightness/contrast"),function(e,t,r){t.adjustment||(t.adjustment={type:"brightness/contrast",brightness:Ot(e),contrast:Ot(e),meanValue:Ot(e),labColorOnly:!!at(e),useLegacy:!0}),ct(e,r())},function(e,t){var r,n=t.adjustment;Vt(e,n.brightness||0),Vt(e,n.contrast||0),Vt(e,(r=n.meanValue)!==null&&r!==void 0?r:127),Qe(e,n.labColorOnly?1:0),qt(e,1)});function lu(e){var t=Ot(e),r=Ot(e),n=Ot(e),a=Ot(e),i=Ot(e)/100;return{shadowInput:t,highlightInput:r,shadowOutput:n,highlightOutput:a,midtoneInput:i}}function Hl(e,t){Vt(e,t.shadowInput),Vt(e,t.highlightInput),Vt(e,t.shadowOutput),Vt(e,t.highlightOutput),Vt(e,Math.round(t.midtoneInput*100))}ht("levl",an("levels"),function(e,t,r){if(et(e)!==2)throw new Error("Invalid levl version");t.adjustment=Q(Q({},t.adjustment),{type:"levels",rgb:lu(e),red:lu(e),green:lu(e),blue:lu(e)}),ct(e,r())},function(e,t){var r=t.adjustment,n={shadowInput:0,highlightInput:255,shadowOutput:0,highlightOutput:255,midtoneInput:1};Ve(e,2),Hl(e,r.rgb||n),Hl(e,r.red||n),Hl(e,r.blue||n),Hl(e,r.green||n);for(var a=0;a<59;a++)Hl(e,n)});function cu(e){for(var t=et(e),r=[],n=0;n<t;n++){var a=Ot(e),i=Ot(e);r.push({input:i,output:a})}return r}function qi(e,t){Ve(e,t.length);for(var r=0,n=t;r<n.length;r++){var a=n[r];Ve(e,a.output),Ve(e,a.input)}}ht("curv",an("curves"),function(e,t,r){if(at(e),et(e)!==1)throw new Error("Invalid curv version");et(e);var n=et(e),a={type:"curves"};n&1&&(a.rgb=cu(e)),n&2&&(a.red=cu(e)),n&4&&(a.green=cu(e)),n&8&&(a.blue=cu(e)),t.adjustment=Q(Q({},t.adjustment),a),ct(e,r())},function(e,t){var r=t.adjustment,n=r.rgb,a=r.red,i=r.green,o=r.blue,s=0,l=0;n&&n.length&&(s|=1,l++),a&&a.length&&(s|=2,l++),i&&i.length&&(s|=4,l++),o&&o.length&&(s|=8,l++),Qe(e,0),Ve(e,1),Ve(e,0),Ve(e,s),n&&n.length&&qi(e,n),a&&a.length&&qi(e,a),i&&i.length&&qi(e,i),o&&o.length&&qi(e,o),yt(e,"Crv "),Ve(e,4),Ve(e,0),Ve(e,l),n&&n.length&&(Ve(e,0),qi(e,n)),a&&a.length&&(Ve(e,1),qi(e,a)),i&&i.length&&(Ve(e,2),qi(e,i)),o&&o.length&&(Ve(e,3),qi(e,o))}),ht("expA",an("exposure"),function(e,t,r){if(et(e)!==1)throw new Error("Invalid expA version");t.adjustment=Q(Q({},t.adjustment),{type:"exposure",exposure:la(e),offset:la(e),gamma:la(e)}),ct(e,r())},function(e,t){var r=t.adjustment;Ve(e,1),fa(e,r.exposure),fa(e,r.offset),fa(e,r.gamma),qt(e,2)}),ht("vibA",an("vibrance"),function(e,t,r){var n=Ft(e);t.adjustment={type:"vibrance"},n.vibrance!==void 0&&(t.adjustment.vibrance=n.vibrance),n.Strt!==void 0&&(t.adjustment.saturation=n.Strt),ct(e,r())},function(e,t){var r=t.adjustment,n={};r.vibrance!==void 0&&(n.vibrance=r.vibrance),r.saturation!==void 0&&(n.Strt=r.saturation),Lt(e,"","null",n)});function wo(e){return{a:Ot(e),b:Ot(e),c:Ot(e),d:Ot(e),hue:Ot(e),saturation:Ot(e),lightness:Ot(e)}}function ko(e,t){var r=t||{};Vt(e,r.a||0),Vt(e,r.b||0),Vt(e,r.c||0),Vt(e,r.d||0),Vt(e,r.hue||0),Vt(e,r.saturation||0),Vt(e,r.lightness||0)}ht("hue2",an("hue/saturation"),function(e,t,r){if(et(e)!==2)throw new Error("Invalid hue2 version");t.adjustment=Q(Q({},t.adjustment),{type:"hue/saturation",master:wo(e),reds:wo(e),yellows:wo(e),greens:wo(e),cyans:wo(e),blues:wo(e),magentas:wo(e)}),ct(e,r())},function(e,t){var r=t.adjustment;Ve(e,2),ko(e,r.master),ko(e,r.reds),ko(e,r.yellows),ko(e,r.greens),ko(e,r.cyans),ko(e,r.blues),ko(e,r.magentas)});function Hp(e){return{cyanRed:Ot(e),magentaGreen:Ot(e),yellowBlue:Ot(e)}}function jp(e,t){Vt(e,t.cyanRed||0),Vt(e,t.magentaGreen||0),Vt(e,t.yellowBlue||0)}ht("blnc",an("color balance"),function(e,t,r){t.adjustment={type:"color balance",shadows:Hp(e),midtones:Hp(e),highlights:Hp(e),preserveLuminosity:!!at(e)},ct(e,r())},function(e,t){var r=t.adjustment;jp(e,r.shadows||{}),jp(e,r.midtones||{}),jp(e,r.highlights||{}),Qe(e,r.preserveLuminosity?1:0),qt(e,1)}),ht("blwh",an("black & white"),function(e,t,r){var n=Ft(e);t.adjustment={type:"black & white",reds:n["Rd "],yellows:n.Yllw,greens:n["Grn "],cyans:n["Cyn "],blues:n["Bl "],magentas:n.Mgnt,useTint:!!n.useTint,presetKind:n.bwPresetKind,presetFileName:n.blackAndWhitePresetFileName},n.tintColor!==void 0&&(t.adjustment.tintColor=oa(n.tintColor)),ct(e,r())},function(e,t){var r=t.adjustment,n={"Rd ":r.reds||0,Yllw:r.yellows||0,"Grn ":r.greens||0,"Cyn ":r.cyans||0,"Bl ":r.blues||0,Mgnt:r.magentas||0,useTint:!!r.useTint,tintColor:sa(r.tintColor),bwPresetKind:r.presetKind||0,blackAndWhitePresetFileName:r.presetFileName||""};Lt(e,"","null",n)}),ht("phfl",an("photo filter"),function(e,t,r){var n=et(e);if(n!==2&&n!==3)throw new Error("Invalid phfl version");var a;n===2?a=qr(e):a={l:dt(e)/100,a:dt(e)/100,b:dt(e)/100},t.adjustment={type:"photo filter",color:a,density:Ne(e)/100,preserveLuminosity:!!at(e)},ct(e,r())},function(e,t){var r=t.adjustment;Ve(e,2),Kr(e,r.color||{l:0,a:0,b:0}),it(e,(r.density||0)*100),Qe(e,r.preserveLuminosity?1:0),qt(e,3)});function uu(e){var t=Ot(e),r=Ot(e),n=Ot(e);ct(e,2);var a=Ot(e);return{red:t,green:r,blue:n,constant:a}}function jl(e,t){var r=t||{};Vt(e,r.red),Vt(e,r.green),Vt(e,r.blue),qt(e,2),Vt(e,r.constant)}ht("mixr",an("channel mixer"),function(e,t,r){if(et(e)!==1)throw new Error("Invalid mixr version");var n=t.adjustment=Q(Q({},t.adjustment),{type:"channel mixer",monochrome:!!et(e)});n.monochrome||(n.red=uu(e),n.green=uu(e),n.blue=uu(e)),n.gray=uu(e),ct(e,r())},function(e,t){var r=t.adjustment;Ve(e,1),Ve(e,r.monochrome?1:0),r.monochrome?(jl(e,r.gray),qt(e,3*5*2)):(jl(e,r.red),jl(e,r.green),jl(e,r.blue),jl(e,r.gray))});var T3=_t("colorLookupType","3DLUT",{"3dlut":"3DLUT",abstractProfile:"abstractProfile",deviceLinkProfile:"deviceLinkProfile"}),M3=_t("LUTFormatType","look",{look:"LUTFormatLOOK",cube:"LUTFormatCUBE","3dl":"LUTFormat3DL"}),fu=_t("colorLookupOrder","rgb",{rgb:"rgbOrder",bgr:"bgrOrder"});ht("clrL",an("color lookup"),function(e,t,r){if(et(e)!==1)throw new Error("Invalid clrL version");var n=Ft(e);t.adjustment={type:"color lookup"};var a=t.adjustment;n.lookupType!==void 0&&(a.lookupType=T3.decode(n.lookupType)),n["Nm "]!==void 0&&(a.name=n["Nm "]),n.Dthr!==void 0&&(a.dither=n.Dthr),n.profile!==void 0&&(a.profile=n.profile),n.LUTFormat!==void 0&&(a.lutFormat=M3.decode(n.LUTFormat)),n.dataOrder!==void 0&&(a.dataOrder=fu.decode(n.dataOrder)),n.tableOrder!==void 0&&(a.tableOrder=fu.decode(n.tableOrder)),n.LUT3DFileData!==void 0&&(a.lut3DFileData=n.LUT3DFileData),n.LUT3DFileName!==void 0&&(a.lut3DFileName=n.LUT3DFileName),ct(e,r())},function(e,t){var r=t.adjustment,n={};r.lookupType!==void 0&&(n.lookupType=T3.encode(r.lookupType)),r.name!==void 0&&(n["Nm "]=r.name),r.dither!==void 0&&(n.Dthr=r.dither),r.profile!==void 0&&(n.profile=r.profile),r.lutFormat!==void 0&&(n.LUTFormat=M3.encode(r.lutFormat)),r.dataOrder!==void 0&&(n.dataOrder=fu.encode(r.dataOrder)),r.tableOrder!==void 0&&(n.tableOrder=fu.encode(r.tableOrder)),r.lut3DFileData!==void 0&&(n.LUT3DFileData=r.lut3DFileData),r.lut3DFileName!==void 0&&(n.LUT3DFileName=r.lut3DFileName),Ve(e,1),Lt(e,"","null",n)}),ht("nvrt",an("invert"),function(e,t,r){t.adjustment={type:"invert"},ct(e,r())},function(){}),ht("post",an("posterize"),function(e,t,r){t.adjustment={type:"posterize",levels:et(e)},ct(e,r())},function(e,t){var r,n=t.adjustment;Ve(e,(r=n.levels)!==null&&r!==void 0?r:4),qt(e,2)}),ht("thrs",an("threshold"),function(e,t,r){t.adjustment={type:"threshold",level:et(e)},ct(e,r())},function(e,t){var r,n=t.adjustment;Ve(e,(r=n.level)!==null&&r!==void 0?r:128),qt(e,2)});var D3=["","","","rgb","hsb","","lab"];ht("grdm",an("gradient map"),function(e,t,r){var n=et(e);if(n!==1&&n!==3)throw new Error("Invalid grdm version");var a={type:"gradient map",gradientType:"solid"};a.reverse=!!at(e),a.dither=!!at(e);var i=!!at(e);if(e.offset--,i){var o=lr(e);a.method=gs.decode(o)}a.name=Rr(e),a.colorStops=[],a.opacityStops=[];for(var s=et(e),l=0;l<s;l++)a.colorStops.push({location:Ne(e),midpoint:Ne(e)/100,color:qr(e)}),ct(e,2);for(var c=et(e),l=0;l<c;l++)a.opacityStops.push({location:Ne(e),midpoint:Ne(e)/100,opacity:et(e)/255});var u=et(e);if(u!==2)throw new Error("Invalid grdm expansion count");var d=et(e);a.smoothness=d/4096;var f=et(e);if(f!==32)throw new Error("Invalid grdm length");a.gradientType=et(e)?"noise":"solid",a.randomSeed=Ne(e),a.addTransparency=!!et(e),a.restrictColors=!!et(e),a.roughness=Ne(e)/4096,a.colorModel=D3[et(e)]||"rgb",a.min=[et(e)/32768,et(e)/32768,et(e)/32768,et(e)/32768],a.max=[et(e)/32768,et(e)/32768,et(e)/32768,et(e)/32768],ct(e,r());for(var p=0,_=a.colorStops;p<_.length;p++){var h=_[p];h.location/=d}for(var b=0,v=a.opacityStops;b<v.length;b++){var h=v[b];h.location/=d}t.adjustment=a},function(e,t){var r,n,a,i=t.adjustment;Ve(e,i.method!==void 0?3:1),Qe(e,i.reverse?1:0),Qe(e,i.dither?1:0),i.method!==void 0&&yt(e,gs.encode(i.method)),So(e,i.name||""),Ve(e,i.colorStops&&i.colorStops.length||0);for(var o=Math.round(((r=i.smoothness)!==null&&r!==void 0?r:1)*4096),s=0,l=i.colorStops||[];s<l.length;s++){var c=l[s];it(e,Math.round(c.location*o)),it(e,Math.round(c.midpoint*100)),Kr(e,c.color),qt(e,2)}Ve(e,i.opacityStops&&i.opacityStops.length||0);for(var u=0,d=i.opacityStops||[];u<d.length;u++){var c=d[u];it(e,Math.round(c.location*o)),it(e,Math.round(c.midpoint*100)),Ve(e,Math.round(c.opacity*255))}Ve(e,2),Ve(e,o),Ve(e,32),Ve(e,i.gradientType==="noise"?1:0),it(e,i.randomSeed||0),Ve(e,i.addTransparency?1:0),Ve(e,i.restrictColors?1:0),it(e,Math.round(((n=i.roughness)!==null&&n!==void 0?n:1)*4096));var f=D3.indexOf((a=i.colorModel)!==null&&a!==void 0?a:"rgb");Ve(e,f===-1?3:f);for(var p=0;p<4;p++)Ve(e,Math.round((i.min&&i.min[p]||0)*32768));for(var p=0;p<4;p++)Ve(e,Math.round((i.max&&i.max[p]||0)*32768));qt(e,4)});function vi(e){return{c:Ot(e),m:Ot(e),y:Ot(e),k:Ot(e)}}function mi(e,t){var r=t||{};Vt(e,r.c),Vt(e,r.m),Vt(e,r.y),Vt(e,r.k)}ht("selc",an("selective color"),function(e,t){if(et(e)!==1)throw new Error("Invalid selc version");var r=et(e)?"absolute":"relative";ct(e,8),t.adjustment={type:"selective color",mode:r,reds:vi(e),yellows:vi(e),greens:vi(e),cyans:vi(e),blues:vi(e),magentas:vi(e),whites:vi(e),neutrals:vi(e),blacks:vi(e)}},function(e,t){var r=t.adjustment;Ve(e,1),Ve(e,r.mode==="absolute"?1:0),qt(e,8),mi(e,r.reds),mi(e,r.yellows),mi(e,r.greens),mi(e,r.cyans),mi(e,r.blues),mi(e,r.magentas),mi(e,r.whites),mi(e,r.neutrals),mi(e,r.blacks)}),ht("CgEd",function(e){var t=e.adjustment;return t?t.type==="brightness/contrast"&&!t.useLegacy||(t.type==="levels"||t.type==="curves"||t.type==="exposure"||t.type==="channel mixer"||t.type==="hue/saturation")&&t.presetFileName!==void 0:!1},function(e,t,r){var n=Ft(e);if(n.Vrsn!==1)throw new Error("Invalid CgEd version");"presetFileName"in n?t.adjustment=Q(Q({},t.adjustment),{presetKind:n.presetKind,presetFileName:n.presetFileName}):"curvesPresetFileName"in n?t.adjustment=Q(Q({},t.adjustment),{presetKind:n.curvesPresetKind,presetFileName:n.curvesPresetFileName}):"mixerPresetFileName"in n?t.adjustment=Q(Q({},t.adjustment),{presetKind:n.mixerPresetKind,presetFileName:n.mixerPresetFileName}):t.adjustment={type:"brightness/contrast",brightness:n.Brgh,contrast:n.Cntr,meanValue:n.means,useLegacy:!!n.useLegacy,labColorOnly:!!n["Lab "],auto:!!n.Auto},ct(e,r())},function(e,t){var r,n,a,i,o=t.adjustment;if(o.type==="levels"||o.type==="exposure"||o.type==="hue/saturation"){var s={Vrsn:1,presetKind:(r=o.presetKind)!==null&&r!==void 0?r:1,presetFileName:o.presetFileName||""};Lt(e,"","null",s)}else if(o.type==="curves"){var s={Vrsn:1,curvesPresetKind:(n=o.presetKind)!==null&&n!==void 0?n:1,curvesPresetFileName:o.presetFileName||""};Lt(e,"","null",s)}else if(o.type==="channel mixer"){var s={Vrsn:1,mixerPresetKind:(a=o.presetKind)!==null&&a!==void 0?a:1,mixerPresetFileName:o.presetFileName||""};Lt(e,"","null",s)}else if(o.type==="brightness/contrast"){var s={Vrsn:1,Brgh:o.brightness||0,Cntr:o.contrast||0,means:(i=o.meanValue)!==null&&i!==void 0?i:127,"Lab ":!!o.labColorOnly,useLegacy:!!o.useLegacy,Auto:!!o.auto};Lt(e,"","null",s)}else throw new Error("Unhandled CgEd case")});function tL(e){var t=[];function r(n){var a;if(n.children)for(var i=0,o=n.children;i<o.length;i++){var s=o[i];((a=s.text)===null||a===void 0?void 0:a.index)!==void 0&&(t[s.text.index]=s),r(s)}}return r(e),t}ht("Txt2",ir("engineData"),function(e,t,r,n){var a=Tr(e,r());t.engineData=p4(a);var i=tL(n),o=l3(a),s=KR(o),l=s.ResourceDict.TextFrameSet;if(l)for(var c=0;c<l.length;c++){var u=i[c];l[c].path&&(u!=null&&u.text)&&(u.text.textPath=l[c].path)}},function(e,t){var r=d4(t.engineData);pa(e,r)}),ht("FEid",ir("filterEffectsMasks"),function(e,t,r){var n=dt(e);if(n<1||n>3)throw new Error("Invalid filterEffects version ".concat(n));for(t.filterEffectsMasks=[];r()>8;){if(Ne(e))throw new Error("filterEffects: 64 bit length is not supported");var a=Ne(e),i=e.offset+a,o=ua(e,1),s=dt(e);if(s!==1)throw new Error("Invalid filterEffect version ".concat(s));if(Ne(e))throw new Error("filterEffect: 64 bit length is not supported");Ne(e);for(var l=dt(e),c=dt(e),u=dt(e),d=dt(e),f=dt(e),p=dt(e),_=[],h=0;h<p+2;h++){var b=dt(e);if(b){if(Ne(e))throw new Error("filterEffect: 64 bit length is not supported");var v=Ne(e);if(!v)throw new Error("filterEffect: Empty channel");var m=et(e),y=Tr(e,v-2);_.push({compressionMode:m,data:y})}else _.push(void 0)}if(t.filterEffectsMasks.push({id:o,top:l,left:c,bottom:u,right:d,depth:f,channels:_}),e.offset<i&&at(e)){var g=dt(e),S=dt(e),M=dt(e),E=dt(e);if(Ne(e))throw new Error("filterEffect: 64 bit length is not supported");var w=Ne(e),m=et(e),y=Tr(e,w-2);t.filterEffectsMasks[t.filterEffectsMasks.length-1].extra={top:g,left:S,bottom:M,right:E,compressionMode:m,data:y}}e.offset=i;for(var x=a;x%4;)e.offset++,x++}},function(e,t){var r;bt(e,3);for(var n=0,a=t.filterEffectsMasks;n<a.length;n++){var i=a[n];it(e,0),it(e,0);var o=e.offset;Wi(e,i.id,1),bt(e,1),it(e,0),it(e,0);var s=e.offset;bt(e,i.top),bt(e,i.left),bt(e,i.bottom),bt(e,i.right),bt(e,i.depth);var l=Math.max(0,i.channels.length-2);bt(e,l);for(var c=0;c<l+2;c++){var u=i.channels[c];bt(e,u?1:0),u&&(it(e,0),it(e,u.data.length+2),Ve(e,u.compressionMode),pa(e,u.data))}e.view.setUint32(s-4,e.offset-s,!1);var d=(r=t.filterEffectsMasks[t.filterEffectsMasks.length-1])===null||r===void 0?void 0:r.extra;d&&(Qe(e,1),bt(e,d.top),bt(e,d.left),bt(e,d.bottom),bt(e,d.right),it(e,0),it(e,d.data.byteLength+2),Ve(e,d.compressionMode),pa(e,d.data));var f=e.offset-o;for(e.view.setUint32(o-4,f,!1);f%4;)qt(e,1),f++}}),Cs("FXid","FEid"),ht("FMsk",ir("filterMask"),function(e,t){t.filterMask={colorSpace:qr(e),opacity:et(e)/255}},function(e,t){var r;Kr(e,t.filterMask.colorSpace),Ve(e,pp((r=t.filterMask.opacity)!==null&&r!==void 0?r:1,0,1)*255)}),ht("artd",function(e){return e.artboards!==void 0},function(e,t,r){var n=Ft(e);t.artboards={count:n["Cnt "],autoExpandOffset:{horizontal:n.autoExpandOffset.Hrzn,vertical:n.autoExpandOffset.Vrtc},origin:{horizontal:n.origin.Hrzn,vertical:n.origin.Vrtc},autoExpandEnabled:n.autoExpandEnabled,autoNestEnabled:n.autoNestEnabled,autoPositionEnabled:n.autoPositionEnabled,shrinkwrapOnSaveEnabled:!!n.shrinkwrapOnSaveEnabled,docDefaultNewArtboardBackgroundColor:oa(n.docDefaultNewArtboardBackgroundColor),docDefaultNewArtboardBackgroundType:n.docDefaultNewArtboardBackgroundType},ct(e,r())},function(e,t){var r,n,a,i,o,s=t.artboards,l={"Cnt ":s.count,autoExpandOffset:s.autoExpandOffset?{Hrzn:s.autoExpandOffset.horizontal,Vrtc:s.autoExpandOffset.vertical}:{Hrzn:0,Vrtc:0},origin:s.origin?{Hrzn:s.origin.horizontal,Vrtc:s.origin.vertical}:{Hrzn:0,Vrtc:0},autoExpandEnabled:(r=s.autoExpandEnabled)!==null&&r!==void 0?r:!0,autoNestEnabled:(n=s.autoNestEnabled)!==null&&n!==void 0?n:!0,autoPositionEnabled:(a=s.autoPositionEnabled)!==null&&a!==void 0?a:!0,shrinkwrapOnSaveEnabled:(i=s.shrinkwrapOnSaveEnabled)!==null&&i!==void 0?i:!0,docDefaultNewArtboardBackgroundColor:sa(s.docDefaultNewArtboardBackgroundColor),docDefaultNewArtboardBackgroundType:(o=s.docDefaultNewArtboardBackgroundType)!==null&&o!==void 0?o:1};Lt(e,"","null",l,"artd")});function z3(e){return Object.keys(e).map(function(t){return e[t]}).some(function(t){return Array.isArray(t)&&t.length>1})}ht("lfx2",function(e){return e.effects!==void 0&&!z3(e.effects)},function(e,t,r){var n=Ne(e);if(n!==0)throw new Error("Invalid lfx2 version");var a=Ft(e);t.effects=Il(a,!!e.logMissingFeatures),ct(e,r())},function(e,t,r,n){var a=zl(t.effects,!!n.logMissingFeatures,!0);it(e,0),Lt(e,"","null",a)}),ht("cinf",ir("compositorUsed"),function(e,t,r){var n=Ft(e);function a(i){return i.split(".")[1]}t.compositorUsed={description:n.description,reason:n.reason,engine:a(n.Engn)},n.Vrsn&&(t.compositorUsed.version=n.Vrsn),n.psVersion&&(t.compositorUsed.photoshopVersion=n.psVersion),n.enableCompCore&&(t.compositorUsed.enableCompCore=a(n.enableCompCore)),n.enableCompCoreGPU&&(t.compositorUsed.enableCompCoreGPU=a(n.enableCompCoreGPU)),n.enableCompCoreThreads&&(t.compositorUsed.enableCompCoreThreads=a(n.enableCompCoreThreads)),n.compCoreSupport&&(t.compositorUsed.compCoreSupport=a(n.compCoreSupport)),n.compCoreGPUSupport&&(t.compositorUsed.compCoreGPUSupport=a(n.compCoreGPUSupport)),ct(e,r())},function(e,t){var r=t.compositorUsed,n={Vrsn:r.version||{major:1,minor:0,fix:0}};r.photoshopVersion&&(n.psVersion=r.photoshopVersion),n.description=r.description,n.reason=r.reason,n.Engn="Engn.".concat(r.engine),r.enableCompCore&&(n.enableCompCore="enable.".concat(r.enableCompCore)),r.enableCompCoreGPU&&(n.enableCompCoreGPU="enable.".concat(r.enableCompCoreGPU)),r.enableCompCoreThreads&&(n.enableCompCoreThreads="enable.".concat(r.enableCompCoreThreads)),r.compCoreSupport&&(n.compCoreSupport="reason.".concat(r.compCoreSupport)),r.compCoreGPUSupport&&(n.compCoreGPUSupport="reason.".concat(r.compCoreGPUSupport)),Lt(e,"","null",n)}),ht("extn",function(e){return e._extn!==void 0},function(e,t){Ft(e)},function(e,t){}),ht("iOpa",ir("fillOpacity"),function(e,t){t.fillOpacity=at(e)/255,ct(e,3)},function(e,t){Qe(e,t.fillOpacity*255),qt(e,3)}),ht("brst",ir("channelBlendingRestrictions"),function(e,t,r){for(t.channelBlendingRestrictions=[];r()>4;)t.channelBlendingRestrictions.push(dt(e))},function(e,t){for(var r=0,n=t.channelBlendingRestrictions;r<n.length;r++){var a=n[r];bt(e,a)}}),ht("tsly",ir("transparencyShapesLayer"),function(e,t){t.transparencyShapesLayer=!!at(e),ct(e,3)},function(e,t){Qe(e,t.transparencyShapesLayer?1:0),qt(e,3)});var Ki=function(){return Ki=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++){t=arguments[r];for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a])}return e},Ki.apply(this,arguments)};function I3(e){e===void 0&&(e=4096);var t=new ArrayBuffer(e),r=new DataView(t),n=0;return{buffer:t,view:r,offset:n,tempBuffer:void 0}}function rL(e){return e.buffer.slice(0,e.offset)}function nL(e){return new Uint8Array(e.buffer,0,e.offset)}function Qe(e,t){var r=gi(e,1);e.view.setUint8(r,t)}function Vt(e,t){var r=gi(e,2);e.view.setInt16(r,t,!1)}function Ve(e,t){var r=gi(e,2);e.view.setUint16(r,t,!1)}function aL(e,t){var r=gi(e,2);e.view.setUint16(r,t,!0)}function bt(e,t){var r=gi(e,4);e.view.setInt32(r,t,!1)}function O3(e,t){var r=gi(e,4);e.view.setInt32(r,t,!0)}function it(e,t){var r=gi(e,4);e.view.setUint32(r,t,!1)}function fa(e,t){var r=gi(e,4);e.view.setFloat32(r,t,!1)}function Jn(e,t){var r=gi(e,8);e.view.setFloat64(r,t,!1)}function Ln(e,t){bt(e,t*65536)}function da(e,t){bt(e,t*(1<<24))}function pa(e,t){if(t){$3(e,e.offset+t.length);var r=new Uint8Array(e.buffer);r.set(t,e.offset),e.offset+=t.length}}function qt(e,t){for(var r=0;r<t;r++)Qe(e,0)}function yt(e,t){if(t.length!==4)throw new Error("Invalid signature: '".concat(t,"'"));for(var r=0;r<4;r++)Qe(e,t.charCodeAt(r))}function iL(e,t){for(var r=0;r<t.length;r++)Qe(e,t.charCodeAt(r))}function Wi(e,t,r){var n=t.length;if(n>255)throw new Error("String too long");Qe(e,n);for(var a=0;a<n;a++){var i=t.charCodeAt(a);Qe(e,i<128?i:63)}for(;++n%r;)Qe(e,0)}function oL(e,t){for(var r=0;r<t.length;r++)Ve(e,t.charCodeAt(r))}function sL(e,t){for(var r=0;r<t.length;r++)aL(e,t.charCodeAt(r))}function Bn(e,t){it(e,t.length),oL(e,t)}function So(e,t){it(e,t.length+1);for(var r=0;r<t.length;r++)Ve(e,t.charCodeAt(r));Ve(e,0)}function P3(e){e===void 0&&(e=[]);for(var t=0,r=0,n=e;r<n.length;r++){var a=n[r];if(a.canvas||a.imageData){var i=Gp(a),o=i.width,s=i.height;t=Math.max(t,2*s+2*o*s)}a.children&&(t=Math.max(t,P3(a.children)))}return t}function Jr(e,t,r,n,a){n===void 0&&(n=!1),a===void 0&&(a=!1),a&&it(e,0);var i=e.offset;it(e,0),r();for(var o=e.offset-i-4,s=o;s%t;)Qe(e,0),s++;n&&(o=s),e.view.setUint32(i,o,!1)}function F3(e){var t;(t=e.children)===null||t===void 0||t.forEach(F3);var r=e.imageData;if(r&&(r.data instanceof Uint32Array||r.data instanceof Uint16Array))throw new Error("imageData has incorrect bitDepth");if("mask"in e&&e.mask){var n=e.mask.imageData;if(n&&(n.data instanceof Uint32Array||n.data instanceof Uint16Array))throw new Error("mask imageData has incorrect bitDepth")}}function R3(e,t,r){var n;if(r===void 0&&(r={}),!(+t.width>0&&+t.height>0))throw new Error("Invalid document size");if((t.width>3e4||t.height>3e4)&&!r.psb)throw new Error("Document size is too large (max is 30000x30000, use PSB format instead)");var a=(n=t.bitsPerChannel)!==null&&n!==void 0?n:8;if(a!==8)throw new Error("bitsPerChannel other than 8 are not supported for writing");F3(t);var i=Ki({},t.imageResources),o=Ki(Ki({},r),{layerIds:new Set,layerToId:new Map});o.generateThumbnail&&(i.thumbnail=pL(t));var s=t.imageData;if(!s&&t.canvas&&(s=t.canvas.getContext("2d").getImageData(0,0,t.canvas.width,t.canvas.height)),s&&(t.width!==s.width||t.height!==s.height))throw new Error("Document canvas must have the same size as document");var l=!!s&&u4(s),c=Math.max(P3(t.children),4*2*t.width*t.height+2*t.height);e.tempBuffer=new Uint8Array(c),yt(e,"8BPS"),Ve(e,r.psb?2:1),qt(e,6),Ve(e,l?4:3),it(e,t.height),it(e,t.width),Ve(e,a),Ve(e,3),Jr(e,1,function(){var S,M,E;if(t.palette){for(var w=0;w<256;w++)Qe(e,((S=t.palette[w])===null||S===void 0?void 0:S.r)||0);for(var w=0;w<256;w++)Qe(e,((M=t.palette[w])===null||M===void 0?void 0:M.g)||0);for(var w=0;w<256;w++)Qe(e,((E=t.palette[w])===null||E===void 0?void 0:E.b)||0)}});var u=[];B3(u,t.children),u.length||u.push({}),i.layersGroup=u.map(function(S){return S.linkGroup||0}),i.layerGroupsEnabledId=u.map(function(S){return S.linkGroupEnabled==!1?0:1}),Jr(e,1,function(){for(var S=function(x){for(var C=x.has(i),D=C===!1?0:C===!0?1:C,B=function(K){yt(e,"8BIM"),Ve(e,x.key),Wi(e,"",2),Jr(e,2,function(){return x.write(e,i,K)})},F=0;F<D;F++)B(F)},M=0,E=Py;M<E.length;M++){var w=E[M];S(w)}}),Jr(e,2,function(){lL(e,u,t,l,o),fL(e,t.globalLayerMaskInfo),L3(e,t,t,o)},void 0,!!o.psb);var d=l?[0,1,2,3]:[0,1,2],f=s?s.width:t.width,p=s?s.height:t.height,_={data:new Uint8Array(f*p*4),width:f,height:p};Ve(e,1);{if(s&&_.data.set(new Uint8Array(s.data.buffer,s.data.byteOffset,s.data.byteLength)),l)for(var h=_.width*_.height*4,b=_.data,v=0;v<h;v+=4){var m=b[v+3];if(m!=0&&m!=255){var y=m/255,g=255*(1-y);b[v+0]=b[v+0]*y+g,b[v+1]=b[v+1]*y+g,b[v+2]=b[v+2]*y+g}}pa(e,hp(e.tempBuffer,_,d,!!r.psb))}}function lL(e,t,r,n,a){Jr(e,4,function(){var i;Vt(e,n?-t.length:t.length);for(var o=t.map(function(b,v){return hL(e.tempBuffer,b,v===0,a)}),s=function(b){var v=b.layer,m=b.top,y=b.left,g=b.bottom,S=b.right,M=b.channels;bt(e,m),bt(e,y),bt(e,g),bt(e,S),Ve(e,M.length);for(var E=0,w=M;E<w.length;E++){var x=w[E];Vt(e,x.channelId),a.psb&&it(e,0),it(e,x.length)}yt(e,"8BIM"),yt(e,Uc[v.blendMode]||"norm"),Qe(e,Math.round(pp((i=v.opacity)!==null&&i!==void 0?i:1,0,1)*255)),Qe(e,v.clipping?1:0);var C=8;v.transparencyProtected&&(C|=1),v.hidden&&(C|=2),(v.vectorMask||v.sectionDivider&&v.sectionDivider.type!==0||v.adjustment)&&(C|=16),v.effectsOpen&&(C|=32),Qe(e,C),Qe(e,0),Jr(e,1,function(){cL(e,v,b),uL(e,v),Wi(e,(v.name||"").substring(0,255),4),L3(e,v,r,a)})},l=0,c=o;l<c.length;l++){var u=c[l];s(u)}for(var d=0,f=o;d<f.length;d++)for(var u=f[d],p=0,_=u.channels;p<_.length;p++){var h=_[p];Ve(e,h.compression),h.buffer&&pa(e,h.buffer)}},!0,a.psb)}function cL(e,t,r){var n=t.mask,a=t.realMask;Jr(e,1,function(){if(!(!n&&!a)){var i=0,o=0,s=0;n&&(n.userMaskDensity!==void 0&&(i|=1),n.userMaskFeather!==void 0&&(i|=2),n.vectorMaskDensity!==void 0&&(i|=4),n.vectorMaskFeather!==void 0&&(i|=8),n.disabled&&(o|=2),n.positionRelativeToLayer&&(o|=1),n.fromVectorData&&(o|=8),i&&(o|=16));var l=r.mask||{};if(bt(e,l.top||0),bt(e,l.left||0),bt(e,l.bottom||0),bt(e,l.right||0),Qe(e,n&&n.defaultColor||0),Qe(e,o),a){a.disabled&&(s|=2),a.positionRelativeToLayer&&(s|=1),a.fromVectorData&&(s|=8);var c=r.realMask||{};Qe(e,s),Qe(e,a.defaultColor||0),bt(e,c.top||0),bt(e,c.left||0),bt(e,c.bottom||0),bt(e,c.right||0)}i&&n&&(Qe(e,i),n.userMaskDensity!==void 0&&Qe(e,Math.round(n.userMaskDensity*255)),n.userMaskFeather!==void 0&&Jn(e,n.userMaskFeather),n.vectorMaskDensity!==void 0&&Qe(e,Math.round(n.vectorMaskDensity*255)),n.vectorMaskFeather!==void 0&&Jn(e,n.vectorMaskFeather)),qt(e,2)}})}function du(e,t){Qe(e,t[0]),Qe(e,t[1]),Qe(e,t[2]),Qe(e,t[3])}function uL(e,t){Jr(e,1,function(){var r=t.blendingRanges;if(r){du(e,r.compositeGrayBlendSource),du(e,r.compositeGraphBlendDestinationRange);for(var n=0,a=r.ranges;n<a.length;n++){var i=a[n];du(e,i.sourceRange),du(e,i.destRange)}}})}function fL(e,t){Jr(e,1,function(){t&&(Ve(e,t.overlayColorSpace),Ve(e,t.colorSpace1),Ve(e,t.colorSpace2),Ve(e,t.colorSpace3),Ve(e,t.colorSpace4),Ve(e,t.opacity*255),Qe(e,t.kind),qt(e,3))})}function L3(e,t,r,n){for(var a=function(l){var c=l.key;if(c==="Txt2"&&n.invalidateTextLayers)return"continue";if(c==="vmsk"&&n.psb&&(c="vsms"),l.has(t)){var u=n.psb&&i4.indexOf(c)!==-1,d=c!=="Txt2"&&c!=="cinf"&&c!=="extn"&&c!=="CAI "&&c!=="OCIO",f=c==="Txt2"||c==="luni"||c==="vmsk"||c==="artb"||c==="artd"||c==="vogk"||c==="SoLd"||c==="lnk2"||c==="vscg"||c==="vsms"||c==="GdFl"||c==="lmfx"||c==="lrFX"||c==="cinf"||c==="PlLd"||c==="Anno"||c==="CAI "||c==="OCIO"||c==="GenI"||c==="FEid"||c==="curv"||c==="CgEd"||c==="vibA"||c==="blwh"||c==="grdm";yt(e,u?"8B64":"8BIM"),yt(e,c),Jr(e,f?4:2,function(){l.write(e,t,r,n)},d,u)}},i=0,o=y3;i<o.length;i++){var s=o[i];a(s)}}function B3(e,t){if(t)for(var r=0,n=t;r<n.length;r++){var a=n[r];if(a.children&&a.canvas)throw new Error("Invalid layer, cannot have both 'canvas' and 'children' properties");if(a.children&&a.imageData)throw new Error("Invalid layer, cannot have both 'imageData' and 'children' properties");a.children?(e.push({name:"</Layer group>",sectionDivider:{type:3}}),B3(e,a.children),e.push(Ki(Ki({},a),{blendMode:a.blendMode==="pass through"?"normal":a.blendMode,sectionDivider:{type:a.opened===!1?2:1,key:Uc[a.blendMode]||"pass",subType:0}}))):e.push(Ki({},a))}}function dL(e,t){var r=e.buffer.byteLength;do r*=2;while(t>r);var n=new ArrayBuffer(r),a=new Uint8Array(n),i=new Uint8Array(e.buffer);a.set(i),e.buffer=n,e.view=new DataView(e.buffer)}function $3(e,t){t>e.buffer.byteLength&&dL(e,t)}function gi(e,t){var r=e.offset;return $3(e,e.offset+=t),r}function pL(e){var t=ds(10,10),r=1;e.width>e.height?(t.width=160,t.height=Math.floor(e.height*(t.width/e.width)),r=t.width/e.width):(t.height=160,t.width=Math.floor(e.width*(t.height/e.height)),r=t.height/e.height);var n=t.getContext("2d");return n.scale(r,r),e.imageData?n.drawImage(Hc(e.imageData),0,0):e.canvas&&n.drawImage(e.canvas,0,0),t}function N3(e,t,r,n,a,i){var o=n.top|0,s=n.left|0,l=n.right|0,c=n.bottom|0,u=Gp(n),d=u.width,f=u.height,p=n.imageData;if(!p&&n.canvas&&d&&f&&(p=n.canvas.getContext("2d").getImageData(0,0,d,f)),p&&(p.width!==d||p.height!==f))throw new Error("Invalid imageData dimentions");l=s+d,c=o+f;var _,h;p?a.compress?(_=f4(p,[0]),h=2):(_=hp(e,p,[0],!!a.psb),h=1):(_=new Uint8Array(0),h=1),t.channels.push({channelId:i?-3:-2,compression:h,buffer:_,length:2+_.length}),t[i?"realMask":"mask"]={top:o,left:s,right:l,bottom:c}}function hL(e,t,r,n){var a=mL(e,t,r,n);return t.mask&&N3(e,a,t,t.mask,n,!1),t.realMask&&N3(e,a,t,t.realMask,n,!0),a}function Gp(e){var t,r,n,a,i=e.canvas,o=e.imageData,s=(r=(t=o==null?void 0:o.width)!==null&&t!==void 0?t:i==null?void 0:i.width)!==null&&r!==void 0?r:0,l=(a=(n=o==null?void 0:o.height)!==null&&n!==void 0?n:i==null?void 0:i.height)!==null&&a!==void 0?a:0;return{width:s,height:l}}function vL(e,t,r,n,a){if(e.data instanceof Uint32Array||e.data instanceof Uint16Array)throw new Error("imageData has incorrect bit depth");for(var i=ps(n,a),o=e.data,s=i.data,l=0;l<a;l++)for(var c=0;c<n;c++){var u=(c+t+(l+r)*e.width)*4,d=(c+l*n)*4;s[d]=o[u],s[d+1]=o[u+1],s[d+2]=o[u+2],s[d+3]=o[u+3]}return i}function mL(e,t,r,n){var a=t.top|0,i=t.left|0,o=t.right|0,s=t.bottom|0,l=[{channelId:-1,compression:0,buffer:void 0,length:2},{channelId:0,compression:0,buffer:void 0,length:2},{channelId:1,compression:0,buffer:void 0,length:2},{channelId:2,compression:0,buffer:void 0,length:2}],c=Gp(t),u=c.width,d=c.height;if(!(t.canvas||t.imageData)||!u||!d)return o=i,s=a,{layer:t,top:a,left:i,right:o,bottom:s,channels:l};o=i+u,s=a+d;var f=t.imageData||t.canvas.getContext("2d").getImageData(0,0,u,d);if(n.trimImageData){var p=gL(f);if(p.left!==0||p.top!==0||p.right!==f.width||p.bottom!==f.height){if(i+=p.left,a+=p.top,o-=f.width-p.right,s-=f.height-p.bottom,u=o-i,d=s-a,!u||!d)return{layer:t,top:a,left:i,right:o,bottom:s,channels:l};f=vL(f,p.left,p.top,u,d)}}var _=[0,1,2];return(!r||n.noBackground||t.mask||u4(f)||UF)&&_.unshift(-1),l=_.map(function(h){var b=c4(h,!1),v,m;return n.compress?(v=f4(f,[b]),m=2):(v=hp(e,f,[b],!!n.psb),m=1),{channelId:h,compression:m,buffer:v,length:2+v.length}}),{layer:t,top:a,left:i,right:o,bottom:s,channels:l}}function U3(e,t,r,n){for(var a=e.data,i=e.width,o=(t*i+r)*4+3|0,s=o+(n-r)*4|0,l=o;l<s;l=l+4|0)if(a[l]!==0)return!1;return!0}function H3(e,t,r,n){for(var a=e.data,i=e.width,o=i*4|0,s=r*o+t*4+3|0,l=r,c=s;l<n;l++,c=c+o|0)if(a[c]!==0)return!1;return!0}function gL(e){for(var t=0,r=0,n=e.width,a=e.height;t<a&&U3(e,t,r,n);)t++;for(;a>t&&U3(e,a-1,r,n);)a--;for(;r<n&&H3(e,r,t,a);)r++;for(;n>r&&H3(e,n-1,t,a);)n--;return{top:t,left:r,right:n,bottom:a}}function Kr(e,t){t?"r"in t?(Ve(e,0),Ve(e,Math.round(t.r*257)),Ve(e,Math.round(t.g*257)),Ve(e,Math.round(t.b*257)),Ve(e,0)):"fr"in t?(Ve(e,0),Ve(e,Math.round(t.fr*255*257)),Ve(e,Math.round(t.fg*255*257)),Ve(e,Math.round(t.fb*255*257)),Ve(e,0)):"l"in t?(Ve(e,7),Vt(e,Math.round(t.l*1e4)),Vt(e,Math.round(t.a<0?t.a*12800:t.a*12700)),Vt(e,Math.round(t.b<0?t.b*12800:t.b*12700)),Ve(e,0)):"h"in t?(Ve(e,1),Ve(e,Math.round(t.h*65535)),Ve(e,Math.round(t.s*65535)),Ve(e,Math.round(t.b*65535)),Ve(e,0)):"c"in t?(Ve(e,2),Ve(e,Math.round(t.c*257)),Ve(e,Math.round(t.m*257)),Ve(e,Math.round(t.y*257)),Ve(e,Math.round(t.k*257))):(Ve(e,8),Ve(e,Math.round(t.k*1e4/255)),qt(e,6)):(Ve(e,0),qt(e,8))}var pu=function(){return pu=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++){t=arguments[r];for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a])}return e},pu.apply(this,arguments)},bL=["off","fade","pen pressure","pen tilt","stylus wheel","initial direction","direction","initial rotation","rotation"],j3=["round point","round blunt","round curve","round angle","round fan","flat point","flat blunt","flat curve","flat angle","flat fan"],yL=["erodible point","erodible flat","erodible round","erodible square","erodible triangle","custom"],_L={_:"brush",MixB:"mixer brush",SmTl:"smudge brush"};function on(e){return{control:bL[e.bVTy],steps:e.fStp,jitter:gt(e.jitter),minimum:gt(e["Mnm "])}}function G3(e){switch(e._classID){case"computedBrush":return{type:"computed",size:Vc(e.Dmtr,"Pixels"),angle:ji(e.Angl),roundness:gt(e.Rndn),spacingOn:e.Intr,spacing:gt(e.Spcn),flipX:e.flipX,flipY:e.flipY,hardness:gt(e.Hrdn)};case"sampledBrush":return{type:"sampled",size:Vc(e.Dmtr,"Pixels"),angle:ji(e.Angl),roundness:gt(e.Rndn),spacingOn:e.Intr,spacing:gt(e.Spcn),flipX:e.flipX,flipY:e.flipY,name:e["Nm "],sampledData:e.sampledData};case"dBrush":return{type:"dynamic",shape:j3[e["Shp "]],angle:ji(e.Angl),size:Vc(e.Dmtr,"Pixels"),density:gt(e.Dnst),length:gt(e.Lngt),clumping:gt(e.clumping),thickness:gt(e.thickness),stiffness:gt(e.stiffness),physics:e.physics,spacing:gt(e.Spcn),spacingOn:e.Intr,flipX:e.flipX,flipY:e.flipY};case"dTips":return pu(pu({type:"tips",angle:ji(e.Angl),size:Vc(e.Dmtr,"Pixels"),shape:j3[e["Shp "]],physics:e.physics,spacing:gt(e.Spcn),spacingOn:e.Intr,flipX:e.flipX,flipY:e.flipY,tipsType:yL[e.dtipsType],tipsLengthRatio:gt(e.dtipsLengthRatio),tipsHardness:gt(e.dtipsHardness)},e.dtipsGridSize&&e.dtipsErodibleTipHeightMap?{tipsGridSize:e.dtipsGridSize,tipsErodibleTipHeightMap:xL(e.dtipsErodibleTipHeightMap)}:{}),{tipsAirbrushCutoffAngle:e.dtipsAirbrushCutoffAngle,tipsAirbrushGranularity:gt(e.dtipsAirbrushGranularity),tipsAirbrushStreakiness:gt(e.dtipsAirbrushStreakiness),tipsAirbrushSplatSize:gt(e.dtipsAirbrushSplatSize),tipsAirbrushSplatCount:e.dtipsAirbrushSplatCount});default:throw console.log(require("util").inspect(e,!1,99,!0)),new Error("Unknown brush classId: ".concat(e._classID))}}function xL(e){for(var t=[],r=0;r<e.byteLength;r++)t.push(e[r]);return t}function wL(e,t){var r,n,a,i;t===void 0&&(t={});var o=_s(e.buffer,e.byteOffset,e.byteLength),s=Ot(o),l=[],c=[],u=[];if(s===1||s===2)throw new Error("Unsupported ABR version (".concat(s,")"));if(s===6||s===7||s===9||s===10){var d=Ot(o);if(d!==1&&d!==2)throw new Error("Unsupported ABR minor version");for(;o.offset<o.view.byteLength;){Na(o,"8BIM");var f=lr(o),p=Ne(o),_=o.offset+p;switch(f){case"samp":{for(;o.offset<_;){for(var h=Ne(o);h&3;)h++;var b=o.offset+h,v=ua(o,1);ct(o,d===1?10:264);var m=dt(o),y=dt(o),g=dt(o)-m,S=dt(o)-y;if(S<=0||g<=0)throw new Error("Invalid bounds");var M=Ot(o),E=at(o),w=new Uint8Array(S*g);if(M===8)if(E===0)w.set(Tr(o,w.byteLength));else if(E===1)Vi(o,{width:S,height:g,data:w},S,g,M,1,[0],!1);else throw new Error("Invalid compression");else if(M===16)if(E===0)for(var x=0;x<w.byteLength;x++)w[x]=et(o)>>8;else throw E===1?new Error("not implemented (16bit RLE)"):new Error("Invalid compression");else throw new Error("Invalid depth");l.push({id:v,bounds:{x:y,y:m,w:S,h:g},alpha:w}),o.offset=b}break}case"desc":{for(var C=Ft(o,!0),D=0,B=C.Brsh;D<B.length;D++){var F=B[D],K={name:F["Nm "],shape:G3(F.Brsh),spacing:gt(F.Spcn),wetEdges:F.Wtdg,noise:F.Nose,useBrushSize:F.useBrushSize};F.interpretation!=null&&(K.interpretation=F.interpretation),F.protectTexture!=null&&(K.protectTexture=F.protectTexture),F.useTipDynamics&&(K.shapeDynamics={tiltScale:gt(F.tiltScale),sizeDynamics:on(F.szVr),angleDynamics:on(F.angleDynamics),roundnessDynamics:on(F.roundnessDynamics),flipX:F.flipX,flipY:F.flipY,brushProjection:F.brushProjection,minimumDiameter:gt(F.minimumDiameter),minimumRoundness:gt(F.minimumRoundness)}),F.useScatter&&(K.scatter={count:F["Cnt "],bothAxes:F.bothAxes,countDynamics:on(F.countDynamics),scatterDynamics:on(F.scatterDynamics)}),F.useTexture&&F.Txtr&&(K.texture={id:F.Txtr.Idnt,name:F.Txtr["Nm "],blendMode:bn.decode(F.textureBlendMode),depth:gt(F.textureDepth),depthMinimum:gt(F.minimumDepth),depthDynamics:on(F.textureDepthDynamics),scale:gt(F.textureScale),invert:F.InvT,brightness:F.textureBrightness,contrast:F.textureContrast,textureEachTip:!!F.TxtC});var te=F.dualBrush;te&&te.useDualBrush&&(K.dualBrush={flip:te.Flip,shape:G3(te.Brsh),blendMode:bn.decode(te.BlnM),useScatter:te.useScatter,spacing:gt(te.Spcn),count:te["Cnt "],bothAxes:te.bothAxes,countDynamics:on(te.countDynamics),scatterDynamics:on(te.scatterDynamics)}),F.useColorDynamics&&(K.colorDynamics={foregroundBackground:on(F.clVr),hue:gt(F["H "]),saturation:gt(F.Strt),brightness:gt(F.Brgh),purity:gt(F.purity),perTip:F.colorDynamicsPerTip}),F.usePaintDynamics&&(K.transfer={flowDynamics:on(F.prVr),opacityDynamics:on(F.opVr),wetnessDynamics:on(F.wtVr),mixDynamics:on(F.mxVr)}),F.useBrushPose&&(K.brushPose={overrideAngle:F.overridePoseAngle,overrideTiltX:F.overridePoseTiltX,overrideTiltY:F.overridePoseTiltY,overridePressure:F.overridePosePressure,pressure:gt(F.brushPosePressure),tiltX:F.brushPoseTiltX,tiltY:F.brushPoseTiltY,angle:F.brushPoseAngle});var J=F.toolOptions;J&&(K.toolOptions={type:_L[J._classID]||"brush",brushPreset:J.brushPreset,flow:(r=J.flow)!==null&&r!==void 0?r:100,smooth:(n=J.Smoo)!==null&&n!==void 0?n:0,mode:bn.decode(J["Md "]||"BlnM.Nrml"),opacity:(a=J.Opct)!==null&&a!==void 0?a:100,smoothing:!!J.smoothing,smoothingValue:J.smoothingValue||0,smoothingRadiusMode:!!J.smoothingRadiusMode,smoothingCatchup:!!J.smoothingCatchup,smoothingCatchupAtEnd:!!J.smoothingCatchupAtEnd,smoothingZoomCompensation:!!J.smoothingZoomCompensation,pressureSmoothing:!!J.pressureSmoothing,usePressureOverridesSize:!!J.usePressureOverridesSize,usePressureOverridesOpacity:!!J.usePressureOverridesOpacity,useLegacy:!!J.useLegacy},J.prVr&&(K.toolOptions.flowDynamics=on(J.prVr)),J.opVr&&(K.toolOptions.opacityDynamics=on(J.opVr)),J.szVr&&(K.toolOptions.sizeDynamics=on(J.szVr)),"wetness"in J&&(K.toolOptions.wetness=J.wetness),"dryness"in J&&(K.toolOptions.dryness=J.dryness),"mix"in J&&(K.toolOptions.mix=J.mix),"autoFill"in J&&(K.toolOptions.autoFill=J.autoFill),"autoClean"in J&&(K.toolOptions.autoClean=J.autoClean),"loadSolidColorOnly"in J&&(K.toolOptions.loadSolidColorOnly=J.loadSolidColorOnly),"sampleAllLayers"in J&&(K.toolOptions.sampleAllLayers=J.sampleAllLayers),"SmdF"in J&&(K.toolOptions.smudgeFingerPainting=J.SmdF),"SmdS"in J&&(K.toolOptions.smudgeSampleAllLayers=J.SmdS),"Prs "in J&&(K.toolOptions.strength=J["Prs "]),"SmdF"in J&&(K.toolOptions.smudgeFingerPainting=J.SmdF),"SmdS"in J&&(K.toolOptions.smudgeSampleAllLayers=J.SmdS)),c.push(K)}break}case"patt":{for(;o.offset<_;)u.push(IR(o));o.offset=_;break}case"phry":{var C=Ft(o);t.logMissingFeatures&&!((i=C.hierarchy)===null||i===void 0)&&i.length;break}default:throw new Error("Invalid brush type: ".concat(f))}for(;p%4;)o.offset++,p++}}else throw new Error("Unsupported ABR version (".concat(s,")"));return{samples:l,patterns:u,brushes:c}}var Vp=function(){return Vp=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++){t=arguments[r];for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a])}return e},Vp.apply(this,arguments)};function kL(e){var t=_s(e.buffer,e.byteOffset,e.byteLength),r={shapes:[]};if(Na(t,"cush"),Ne(t)!==2)throw new Error("Invalid version");for(var n=Ne(t),a=0;a<n;a++){for(var i=Rr(t);t.offset%4;)t.offset++;if(Ne(t)!==1)throw new Error("Invalid shape version");var o=Ne(t),s=t.offset+o,l=ua(t,1),c=Ne(t),u=Ne(t),d=Ne(t),f=Ne(t),p=f-u,_=d-c,h={paths:[]};x3(t,h,p,_,s-t.offset),r.shapes.push(Vp({name:i,id:l,width:p,height:_},h)),t.offset=s}return r}var qp;(function(e){e[e.Bitmap=0]="Bitmap",e[e.Grayscale=1]="Grayscale",e[e.Indexed=2]="Indexed",e[e.RGB=3]="RGB",e[e.CMYK=4]="CMYK",e[e.Multichannel=7]="Multichannel",e[e.Duotone=8]="Duotone",e[e.Lab=9]="Lab"})(qp||(qp={}));var Kp;(function(e){e[e.Other=0]="Other",e[e.OpenFolder=1]="OpenFolder",e[e.ClosedFolder=2]="ClosedFolder",e[e.BoundingSectionDivider=3]="BoundingSectionDivider"})(Kp||(Kp={}));var Wp;(function(e){e[e.None=0]="None",e[e.Visibility=1]="Visibility",e[e.Position=2]="Position",e[e.Appearance=4]="Appearance"})(Wp||(Wp={}));var Yp;(function(e){e[e.Color0=0]="Color0",e[e.Color1=1]="Color1",e[e.Color2=2]="Color2",e[e.Color3=3]="Color3",e[e.Transparency=-1]="Transparency",e[e.UserMask=-2]="UserMask",e[e.RealUserMask=-3]="RealUserMask"})(Yp||(Yp={}));var Xp;(function(e){e[e.RawData=0]="RawData",e[e.RleCompressed=1]="RleCompressed",e[e.ZipWithoutPrediction=2]="ZipWithoutPrediction",e[e.ZipWithPrediction=3]="ZipWithPrediction"})(Xp||(Xp={}));var SL=p4;function CL(e,t){var r="buffer"in e?_s(e.buffer,e.byteOffset,e.byteLength):_s(e);return xR(r,t)}function EL(e,t){var r=I3();return R3(r,e,t),rL(r)}function V3(e,t){var r=I3();return R3(r,e,t),nL(r)}function AL(e,t){if(typeof Buffer>"u")throw new Error("Buffer not supported on this platform");return Buffer.from(V3(e,t))}function TL(e,t){Yy(e,t)}const ML=Object.freeze(Object.defineProperty({__proto__:null,get ChannelID(){return Yp},get ColorMode(){return qp},get Compression(){return Xp},get LayerCompCapturedInfo(){return Wp},get SectionDividerType(){return Kp},byteArrayToBase64:SL,decodeLayerPixels:TL,initializeCanvas:qF,readAbr:wL,readCsh:kL,readPsd:CL,writePsd:EL,writePsdBuffer:AL,writePsdUint8Array:V3},Symbol.toStringTag,{value:"Module"}));var q3={exports:{}};/* @license
|
|
293
293
|
Papa Parse
|
|
294
294
|
v5.5.3
|
|
295
295
|
https://github.com/mholt/PapaParse
|