79 lines
113 KiB
JavaScript
79 lines
113 KiB
JavaScript
import{p as Et,g as pn,a as Jt,b as fn,o as dn}from"./index-CRQM6PVi.chunk.mjs";import{b as gn}from"./index-DxwFe63_.chunk.mjs";import{g as wt}from"./vue.runtime.esm-CLeelJur.chunk.mjs";import{p as ut}from"./NcNoteCard-Dz5-u2BY-S2qe9Sjm.chunk.mjs";function Me(e,t,n){const r=document.querySelector(`#initial-state-${e}-${t}`);if(r===null)return n;try{return JSON.parse(atob(r.value))}catch{throw new Error(`Could not parse initial state ${t} of ${e}`)}}function Kt(){return Me("files_sharing","isPublic",null)??document.querySelector('input#isPublic[type="hidden"][name="isPublic"][value="1"]')!==null}function mn(){return Me("files_sharing","sharingToken",null)??document.querySelector('input#sharingToken[type="hidden"]')?.value??null}function it(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ge(e,t,n){vn(e,t),t.set(e,n)}function vn(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function q(e,t){var n=Fe(e,t,"get");return yn(e,n)}function yn(e,t){return t.get?t.get.call(e):t.value}function me(e,t,n){var r=Fe(e,t,"set");return wn(e,r,n),n}function Fe(e,t,n){if(!t.has(e))throw new TypeError("attempted to "+n+" private field on non-instance");return t.get(e)}function wn(e,t,n){if(t.set)t.set.call(e,n);else{if(!t.writable)throw new TypeError("attempted to set read only private field");t.value=n}}var bn=typeof Symbol<"u"?Symbol.toStringTag:"@@toStringTag",W=new WeakMap,pt=new WeakMap;class Rt{constructor(t){var{executor:n=()=>{},internals:r=Qt(),promise:s=new Promise((i,c)=>n(i,c,u=>{r.onCancelList.push(u)}))}=t;ge(this,W,{writable:!0,value:void 0}),ge(this,pt,{writable:!0,value:void 0}),it(this,bn,"CancelablePromise"),this.cancel=this.cancel.bind(this),me(this,W,r),me(this,pt,s||new Promise((i,c)=>n(i,c,u=>{r.onCancelList.push(u)})))}then(t,n){return Nt(q(this,pt).then(bt(t,q(this,W)),bt(n,q(this,W))),q(this,W))}catch(t){return Nt(q(this,pt).catch(bt(t,q(this,W))),q(this,W))}finally(t,n){return n&&q(this,W).onCancelList.push(t),Nt(q(this,pt).finally(bt(()=>{if(t)return n&&(q(this,W).onCancelList=q(this,W).onCancelList.filter(r=>r!==t)),t()},q(this,W))),q(this,W))}cancel(){q(this,W).isCanceled=!0;var t=q(this,W).onCancelList;q(this,W).onCancelList=[];for(var n of t)if(typeof n=="function")try{n()}catch(r){console.error(r)}}isCanceled(){return q(this,W).isCanceled===!0}}class nt extends Rt{constructor(t){super({executor:t})}}it(nt,"all",function(e){return xt(e,Promise.all(e))}),it(nt,"allSettled",function(e){return xt(e,Promise.allSettled(e))}),it(nt,"any",function(e){return xt(e,Promise.any(e))}),it(nt,"race",function(e){return xt(e,Promise.race(e))}),it(nt,"resolve",function(e){return ve(Promise.resolve(e))}),it(nt,"reject",function(e){return ve(Promise.reject(e))}),it(nt,"isCancelable",Zt);function ve(e){return Nt(e,Qt())}function Zt(e){return e instanceof nt||e instanceof Rt}function bt(e,t){if(e)return n=>{if(!t.isCanceled){var r=e(n);return Zt(r)&&t.onCancelList.push(r.cancel),r}return n}}function Nt(e,t){return new Rt({internals:t,promise:e})}function xt(e,t){var n=Qt();return n.onCancelList.push(()=>{for(var r of e)Zt(r)&&r.cancel()}),new Rt({internals:n,promise:t})}function Qt(){return{isCanceled:!1,onCancelList:[]}}var Lt={},xn={2:e=>{function t(s,i,c){s instanceof RegExp&&(s=n(s,c)),i instanceof RegExp&&(i=n(i,c));var u=r(s,i,c);return u&&{start:u[0],end:u[1],pre:c.slice(0,u[0]),body:c.slice(u[0]+s.length,u[1]),post:c.slice(u[1]+i.length)}}function n(s,i){var c=i.match(s);return c?c[0]:null}function r(s,i,c){var u,m,h,o,l,a=c.indexOf(s),d=c.indexOf(i,a+1),f=a;if(a>=0&&d>0){for(u=[],h=c.length;f>=0&&!l;)f==a?(u.push(f),a=c.indexOf(s,f+1)):u.length==1?l=[u.pop(),d]:((m=u.pop())<h&&(h=m,o=d),d=c.indexOf(i,f+1)),f=a<d&&a>=0?a:d;u.length&&(l=[h,o])}return l}e.exports=t,t.range=r},101:function(e,t,n){var r;e=n.nmd(e),function(s){var i=(e&&e.exports,typeof wt=="object"&&wt);i.global!==i&&i.window;var c=function(l){this.message=l};(c.prototype=new Error).name="InvalidCharacterError";var u=function(l){throw new c(l)},m="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",h=/[\t\n\f\r ]/g,o={encode:function(l){l=String(l),/[^\0-\xFF]/.test(l)&&u("The string to be encoded contains characters outside of the Latin1 range.");for(var a,d,f,g,v=l.length%3,A="",p=-1,y=l.length-v;++p<y;)a=l.charCodeAt(p)<<16,d=l.charCodeAt(++p)<<8,f=l.charCodeAt(++p),A+=m.charAt((g=a+d+f)>>18&63)+m.charAt(g>>12&63)+m.charAt(g>>6&63)+m.charAt(63&g);return v==2?(a=l.charCodeAt(p)<<8,d=l.charCodeAt(++p),A+=m.charAt((g=a+d)>>10)+m.charAt(g>>4&63)+m.charAt(g<<2&63)+"="):v==1&&(g=l.charCodeAt(p),A+=m.charAt(g>>2)+m.charAt(g<<4&63)+"=="),A},decode:function(l){var a=(l=String(l).replace(h,"")).length;a%4==0&&(a=(l=l.replace(/==?$/,"")).length),(a%4==1||/[^+a-zA-Z0-9/]/.test(l))&&u("Invalid character: the string to be decoded is not correctly encoded.");for(var d,f,g=0,v="",A=-1;++A<a;)f=m.indexOf(l.charAt(A)),d=g%4?64*d+f:f,g++%4&&(v+=String.fromCharCode(255&d>>(-2*g&6)));return v},version:"1.0.0"};(r=function(){return o}.call(t,n,t,e))===void 0||(e.exports=r)}()},172:(e,t)=>{t.d=function(n){if(!n)return 0;for(var r=(n=n.toString()).length,s=n.length;s--;){var i=n.charCodeAt(s);56320<=i&&i<=57343&&s--,127<i&&i<=2047?r++:2047<i&&i<=65535&&(r+=2)}return r}},526:e=>{var t={utf8:{stringToBytes:function(n){return t.bin.stringToBytes(unescape(encodeURIComponent(n)))},bytesToString:function(n){return decodeURIComponent(escape(t.bin.bytesToString(n)))}},bin:{stringToBytes:function(n){for(var r=[],s=0;s<n.length;s++)r.push(255&n.charCodeAt(s));return r},bytesToString:function(n){for(var r=[],s=0;s<n.length;s++)r.push(String.fromCharCode(n[s]));return r.join("")}}};e.exports=t},298:e=>{var t,n;t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",n={rotl:function(r,s){return r<<s|r>>>32-s},rotr:function(r,s){return r<<32-s|r>>>s},endian:function(r){if(r.constructor==Number)return 16711935&n.rotl(r,8)|4278255360&n.rotl(r,24);for(var s=0;s<r.length;s++)r[s]=n.endian(r[s]);return r},randomBytes:function(r){for(var s=[];r>0;r--)s.push(Math.floor(256*Math.random()));return s},bytesToWords:function(r){for(var s=[],i=0,c=0;i<r.length;i++,c+=8)s[c>>>5]|=r[i]<<24-c%32;return s},wordsToBytes:function(r){for(var s=[],i=0;i<32*r.length;i+=8)s.push(r[i>>>5]>>>24-i%32&255);return s},bytesToHex:function(r){for(var s=[],i=0;i<r.length;i++)s.push((r[i]>>>4).toString(16)),s.push((15&r[i]).toString(16));return s.join("")},hexToBytes:function(r){for(var s=[],i=0;i<r.length;i+=2)s.push(parseInt(r.substr(i,2),16));return s},bytesToBase64:function(r){for(var s=[],i=0;i<r.length;i+=3)for(var c=r[i]<<16|r[i+1]<<8|r[i+2],u=0;u<4;u++)8*i+6*u<=8*r.length?s.push(t.charAt(c>>>6*(3-u)&63)):s.push("=");return s.join("")},base64ToBytes:function(r){r=r.replace(/[^A-Z0-9+\/]/gi,"");for(var s=[],i=0,c=0;i<r.length;c=++i%4)c!=0&&s.push((t.indexOf(r.charAt(i-1))&Math.pow(2,-2*c+8)-1)<<2*c|t.indexOf(r.charAt(i))>>>6-2*c);return s}},e.exports=n},635:(e,t,n)=>{const r=n(31),s=n(338),i=n(221);e.exports={XMLParser:s,XMLValidator:r,XMLBuilder:i}},118:e=>{e.exports=function(t){return typeof t=="function"?t:Array.isArray(t)?n=>{for(const r of t)if(typeof r=="string"&&n===r||r instanceof RegExp&&r.test(n))return!0}:()=>!1}},705:(e,t)=>{const n=":A-Za-z_\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD",r="["+n+"]["+n+"\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*",s=new RegExp("^"+r+"$");t.isExist=function(i){return i!==void 0},t.isEmptyObject=function(i){return Object.keys(i).length===0},t.merge=function(i,c,u){if(c){const m=Object.keys(c),h=m.length;for(let o=0;o<h;o++)i[m[o]]=u==="strict"?[c[m[o]]]:c[m[o]]}},t.getValue=function(i){return t.isExist(i)?i:""},t.isName=function(i){return s.exec(i)!=null},t.getAllMatches=function(i,c){const u=[];let m=c.exec(i);for(;m;){const h=[];h.startIndex=c.lastIndex-m[0].length;const o=m.length;for(let l=0;l<o;l++)h.push(m[l]);u.push(h),m=c.exec(i)}return u},t.nameRegexp=r},31:(e,t,n)=>{const r=n(705),s={allowBooleanAttributes:!1,unpairedTags:[]};function i(p){return p===" "||p===" "||p===`
|
|
`||p==="\r"}function c(p,y){const x=y;for(;y<p.length;y++)if(!(p[y]!="?"&&p[y]!=" ")){const E=p.substr(x,y-x);if(y>5&&E==="xml")return f("InvalidXml","XML declaration allowed only at the start of the document.",v(p,y));if(p[y]=="?"&&p[y+1]==">"){y++;break}}return y}function u(p,y){if(p.length>y+5&&p[y+1]==="-"&&p[y+2]==="-"){for(y+=3;y<p.length;y++)if(p[y]==="-"&&p[y+1]==="-"&&p[y+2]===">"){y+=2;break}}else if(p.length>y+8&&p[y+1]==="D"&&p[y+2]==="O"&&p[y+3]==="C"&&p[y+4]==="T"&&p[y+5]==="Y"&&p[y+6]==="P"&&p[y+7]==="E"){let x=1;for(y+=8;y<p.length;y++)if(p[y]==="<")x++;else if(p[y]===">"&&(x--,x===0))break}else if(p.length>y+9&&p[y+1]==="["&&p[y+2]==="C"&&p[y+3]==="D"&&p[y+4]==="A"&&p[y+5]==="T"&&p[y+6]==="A"&&p[y+7]==="["){for(y+=8;y<p.length;y++)if(p[y]==="]"&&p[y+1]==="]"&&p[y+2]===">"){y+=2;break}}return y}t.validate=function(p,y){y=Object.assign({},s,y);const x=[];let E=!1,w=!1;p[0]==="\uFEFF"&&(p=p.substr(1));for(let b=0;b<p.length;b++)if(p[b]==="<"&&p[b+1]==="?"){if(b+=2,b=c(p,b),b.err)return b}else{if(p[b]!=="<"){if(i(p[b]))continue;return f("InvalidChar","char '"+p[b]+"' is not expected.",v(p,b))}{let O=b;if(b++,p[b]==="!"){b=u(p,b);continue}{let T=!1;p[b]==="/"&&(T=!0,b++);let j="";for(;b<p.length&&p[b]!==">"&&p[b]!==" "&&p[b]!==" "&&p[b]!==`
|
|
`&&p[b]!=="\r";b++)j+=p[b];if(j=j.trim(),j[j.length-1]==="/"&&(j=j.substring(0,j.length-1),b--),P=j,!r.isName(P)){let $;return $=j.trim().length===0?"Invalid space after '<'.":"Tag '"+j+"' is an invalid name.",f("InvalidTag",$,v(p,b))}const S=o(p,b);if(S===!1)return f("InvalidAttr","Attributes for '"+j+"' have open quote.",v(p,b));let N=S.value;if(b=S.index,N[N.length-1]==="/"){const $=b-N.length;N=N.substring(0,N.length-1);const C=a(N,y);if(C!==!0)return f(C.err.code,C.err.msg,v(p,$+C.err.line));E=!0}else if(T){if(!S.tagClosed)return f("InvalidTag","Closing tag '"+j+"' doesn't have proper closing.",v(p,b));if(N.trim().length>0)return f("InvalidTag","Closing tag '"+j+"' can't have attributes or invalid starting.",v(p,O));if(x.length===0)return f("InvalidTag","Closing tag '"+j+"' has not been opened.",v(p,O));{const $=x.pop();if(j!==$.tagName){let C=v(p,$.tagStartPos);return f("InvalidTag","Expected closing tag '"+$.tagName+"' (opened in line "+C.line+", col "+C.col+") instead of closing tag '"+j+"'.",v(p,O))}x.length==0&&(w=!0)}}else{const $=a(N,y);if($!==!0)return f($.err.code,$.err.msg,v(p,b-N.length+$.err.line));if(w===!0)return f("InvalidXml","Multiple possible root nodes found.",v(p,b));y.unpairedTags.indexOf(j)!==-1||x.push({tagName:j,tagStartPos:O}),E=!0}for(b++;b<p.length;b++)if(p[b]==="<"){if(p[b+1]==="!"){b++,b=u(p,b);continue}if(p[b+1]!=="?")break;if(b=c(p,++b),b.err)return b}else if(p[b]==="&"){const $=d(p,b);if($==-1)return f("InvalidChar","char '&' is not expected.",v(p,b));b=$}else if(w===!0&&!i(p[b]))return f("InvalidXml","Extra text at the end",v(p,b));p[b]==="<"&&b--}}}var P;return E?x.length==1?f("InvalidTag","Unclosed tag '"+x[0].tagName+"'.",v(p,x[0].tagStartPos)):!(x.length>0)||f("InvalidXml","Invalid '"+JSON.stringify(x.map(b=>b.tagName),null,4).replace(/\r?\n/g,"")+"' found.",{line:1,col:1}):f("InvalidXml","Start tag expected.",1)};const m='"',h="'";function o(p,y){let x="",E="",w=!1;for(;y<p.length;y++){if(p[y]===m||p[y]===h)E===""?E=p[y]:E!==p[y]||(E="");else if(p[y]===">"&&E===""){w=!0;break}x+=p[y]}return E===""&&{value:x,index:y,tagClosed:w}}const l=new RegExp(`(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['"])(([\\s\\S])*?)\\5)?`,"g");function a(p,y){const x=r.getAllMatches(p,l),E={};for(let w=0;w<x.length;w++){if(x[w][1].length===0)return f("InvalidAttr","Attribute '"+x[w][2]+"' has no space in starting.",A(x[w]));if(x[w][3]!==void 0&&x[w][4]===void 0)return f("InvalidAttr","Attribute '"+x[w][2]+"' is without value.",A(x[w]));if(x[w][3]===void 0&&!y.allowBooleanAttributes)return f("InvalidAttr","boolean attribute '"+x[w][2]+"' is not allowed.",A(x[w]));const P=x[w][2];if(!g(P))return f("InvalidAttr","Attribute '"+P+"' is an invalid name.",A(x[w]));if(E.hasOwnProperty(P))return f("InvalidAttr","Attribute '"+P+"' is repeated.",A(x[w]));E[P]=1}return!0}function d(p,y){if(p[++y]===";")return-1;if(p[y]==="#")return function(E,w){let P=/\d/;for(E[w]==="x"&&(w++,P=/[\da-fA-F]/);w<E.length;w++){if(E[w]===";")return w;if(!E[w].match(P))break}return-1}(p,++y);let x=0;for(;y<p.length;y++,x++)if(!(p[y].match(/\w/)&&x<20)){if(p[y]===";")break;return-1}return y}function f(p,y,x){return{err:{code:p,msg:y,line:x.line||x,col:x.col}}}function g(p){return r.isName(p)}function v(p,y){const x=p.substring(0,y).split(/\r?\n/);return{line:x.length,col:x[x.length-1].length+1}}function A(p){return p.startIndex+p[1].length}},221:(e,t,n)=>{const r=n(87),s=n(118),i={attributeNamePrefix:"@_",attributesGroupName:!1,textNodeName:"#text",ignoreAttributes:!0,cdataPropName:!1,format:!1,indentBy:" ",suppressEmptyNode:!1,suppressUnpairedNode:!0,suppressBooleanAttributes:!0,tagValueProcessor:function(o,l){return l},attributeValueProcessor:function(o,l){return l},preserveOrder:!1,commentPropName:!1,unpairedTags:[],entities:[{regex:new RegExp("&","g"),val:"&"},{regex:new RegExp(">","g"),val:">"},{regex:new RegExp("<","g"),val:"<"},{regex:new RegExp("'","g"),val:"'"},{regex:new RegExp('"',"g"),val:"""}],processEntities:!0,stopNodes:[],oneListGroup:!1};function c(o){this.options=Object.assign({},i,o),this.options.ignoreAttributes===!0||this.options.attributesGroupName?this.isAttribute=function(){return!1}:(this.ignoreAttributesFn=s(this.options.ignoreAttributes),this.attrPrefixLen=this.options.attributeNamePrefix.length,this.isAttribute=h),this.processTextOrObjNode=u,this.options.format?(this.indentate=m,this.tagEndChar=`>
|
|
`,this.newLine=`
|
|
`):(this.indentate=function(){return""},this.tagEndChar=">",this.newLine="")}function u(o,l,a,d){const f=this.j2x(o,a+1,d.concat(l));return o[this.options.textNodeName]!==void 0&&Object.keys(o).length===1?this.buildTextValNode(o[this.options.textNodeName],l,f.attrStr,a):this.buildObjectNode(f.val,l,f.attrStr,a)}function m(o){return this.options.indentBy.repeat(o)}function h(o){return!(!o.startsWith(this.options.attributeNamePrefix)||o===this.options.textNodeName)&&o.substr(this.attrPrefixLen)}c.prototype.build=function(o){return this.options.preserveOrder?r(o,this.options):(Array.isArray(o)&&this.options.arrayNodeName&&this.options.arrayNodeName.length>1&&(o={[this.options.arrayNodeName]:o}),this.j2x(o,0,[]).val)},c.prototype.j2x=function(o,l,a){let d="",f="";const g=a.join(".");for(let v in o)if(Object.prototype.hasOwnProperty.call(o,v))if(o[v]===void 0)this.isAttribute(v)&&(f+="");else if(o[v]===null)this.isAttribute(v)?f+="":v[0]==="?"?f+=this.indentate(l)+"<"+v+"?"+this.tagEndChar:f+=this.indentate(l)+"<"+v+"/"+this.tagEndChar;else if(o[v]instanceof Date)f+=this.buildTextValNode(o[v],v,"",l);else if(typeof o[v]!="object"){const A=this.isAttribute(v);if(A&&!this.ignoreAttributesFn(A,g))d+=this.buildAttrPairStr(A,""+o[v]);else if(!A)if(v===this.options.textNodeName){let p=this.options.tagValueProcessor(v,""+o[v]);f+=this.replaceEntitiesValue(p)}else f+=this.buildTextValNode(o[v],v,"",l)}else if(Array.isArray(o[v])){const A=o[v].length;let p="",y="";for(let x=0;x<A;x++){const E=o[v][x];if(E!==void 0)if(E===null)v[0]==="?"?f+=this.indentate(l)+"<"+v+"?"+this.tagEndChar:f+=this.indentate(l)+"<"+v+"/"+this.tagEndChar;else if(typeof E=="object")if(this.options.oneListGroup){const w=this.j2x(E,l+1,a.concat(v));p+=w.val,this.options.attributesGroupName&&E.hasOwnProperty(this.options.attributesGroupName)&&(y+=w.attrStr)}else p+=this.processTextOrObjNode(E,v,l,a);else if(this.options.oneListGroup){let w=this.options.tagValueProcessor(v,E);w=this.replaceEntitiesValue(w),p+=w}else p+=this.buildTextValNode(E,v,"",l)}this.options.oneListGroup&&(p=this.buildObjectNode(p,v,y,l)),f+=p}else if(this.options.attributesGroupName&&v===this.options.attributesGroupName){const A=Object.keys(o[v]),p=A.length;for(let y=0;y<p;y++)d+=this.buildAttrPairStr(A[y],""+o[v][A[y]])}else f+=this.processTextOrObjNode(o[v],v,l,a);return{attrStr:d,val:f}},c.prototype.buildAttrPairStr=function(o,l){return l=this.options.attributeValueProcessor(o,""+l),l=this.replaceEntitiesValue(l),this.options.suppressBooleanAttributes&&l==="true"?" "+o:" "+o+'="'+l+'"'},c.prototype.buildObjectNode=function(o,l,a,d){if(o==="")return l[0]==="?"?this.indentate(d)+"<"+l+a+"?"+this.tagEndChar:this.indentate(d)+"<"+l+a+this.closeTag(l)+this.tagEndChar;{let f="</"+l+this.tagEndChar,g="";return l[0]==="?"&&(g="?",f=""),!a&&a!==""||o.indexOf("<")!==-1?this.options.commentPropName!==!1&&l===this.options.commentPropName&&g.length===0?this.indentate(d)+`<!--${o}-->`+this.newLine:this.indentate(d)+"<"+l+a+g+this.tagEndChar+o+this.indentate(d)+f:this.indentate(d)+"<"+l+a+g+">"+o+f}},c.prototype.closeTag=function(o){let l="";return this.options.unpairedTags.indexOf(o)!==-1?this.options.suppressUnpairedNode||(l="/"):l=this.options.suppressEmptyNode?"/":`></${o}`,l},c.prototype.buildTextValNode=function(o,l,a,d){if(this.options.cdataPropName!==!1&&l===this.options.cdataPropName)return this.indentate(d)+`<![CDATA[${o}]]>`+this.newLine;if(this.options.commentPropName!==!1&&l===this.options.commentPropName)return this.indentate(d)+`<!--${o}-->`+this.newLine;if(l[0]==="?")return this.indentate(d)+"<"+l+a+"?"+this.tagEndChar;{let f=this.options.tagValueProcessor(l,o);return f=this.replaceEntitiesValue(f),f===""?this.indentate(d)+"<"+l+a+this.closeTag(l)+this.tagEndChar:this.indentate(d)+"<"+l+a+">"+f+"</"+l+this.tagEndChar}},c.prototype.replaceEntitiesValue=function(o){if(o&&o.length>0&&this.options.processEntities)for(let l=0;l<this.options.entities.length;l++){const a=this.options.entities[l];o=o.replace(a.regex,a.val)}return o},e.exports=c},87:e=>{function t(c,u,m,h){let o="",l=!1;for(let a=0;a<c.length;a++){const d=c[a],f=n(d);if(f===void 0)continue;let g="";if(g=m.length===0?f:`${m}.${f}`,f===u.textNodeName){let y=d[f];s(g,u)||(y=u.tagValueProcessor(f,y),y=i(y,u)),l&&(o+=h),o+=y,l=!1;continue}if(f===u.cdataPropName){l&&(o+=h),o+=`<![CDATA[${d[f][0][u.textNodeName]}]]>`,l=!1;continue}if(f===u.commentPropName){o+=h+`<!--${d[f][0][u.textNodeName]}-->`,l=!0;continue}if(f[0]==="?"){const y=r(d[":@"],u),x=f==="?xml"?"":h;let E=d[f][0][u.textNodeName];E=E.length!==0?" "+E:"",o+=x+`<${f}${E}${y}?>`,l=!0;continue}let v=h;v!==""&&(v+=u.indentBy);const A=h+`<${f}${r(d[":@"],u)}`,p=t(d[f],u,g,v);u.unpairedTags.indexOf(f)!==-1?u.suppressUnpairedNode?o+=A+">":o+=A+"/>":p&&p.length!==0||!u.suppressEmptyNode?p&&p.endsWith(">")?o+=A+`>${p}${h}</${f}>`:(o+=A+">",p&&h!==""&&(p.includes("/>")||p.includes("</"))?o+=h+u.indentBy+p+h:o+=p,o+=`</${f}>`):o+=A+"/>",l=!0}return o}function n(c){const u=Object.keys(c);for(let m=0;m<u.length;m++){const h=u[m];if(c.hasOwnProperty(h)&&h!==":@")return h}}function r(c,u){let m="";if(c&&!u.ignoreAttributes)for(let h in c){if(!c.hasOwnProperty(h))continue;let o=u.attributeValueProcessor(h,c[h]);o=i(o,u),o===!0&&u.suppressBooleanAttributes?m+=` ${h.substr(u.attributeNamePrefix.length)}`:m+=` ${h.substr(u.attributeNamePrefix.length)}="${o}"`}return m}function s(c,u){let m=(c=c.substr(0,c.length-u.textNodeName.length-1)).substr(c.lastIndexOf(".")+1);for(let h in u.stopNodes)if(u.stopNodes[h]===c||u.stopNodes[h]==="*."+m)return!0;return!1}function i(c,u){if(c&&c.length>0&&u.processEntities)for(let m=0;m<u.entities.length;m++){const h=u.entities[m];c=c.replace(h.regex,h.val)}return c}e.exports=function(c,u){let m="";return u.format&&u.indentBy.length>0&&(m=`
|
|
`),t(c,u,"",m)}},193:(e,t,n)=>{const r=n(705);function s(l,a){let d="";for(;a<l.length&&l[a]!=="'"&&l[a]!=='"';a++)d+=l[a];if(d=d.trim(),d.indexOf(" ")!==-1)throw new Error("External entites are not supported");const f=l[a++];let g="";for(;a<l.length&&l[a]!==f;a++)g+=l[a];return[d,g,a]}function i(l,a){return l[a+1]==="!"&&l[a+2]==="-"&&l[a+3]==="-"}function c(l,a){return l[a+1]==="!"&&l[a+2]==="E"&&l[a+3]==="N"&&l[a+4]==="T"&&l[a+5]==="I"&&l[a+6]==="T"&&l[a+7]==="Y"}function u(l,a){return l[a+1]==="!"&&l[a+2]==="E"&&l[a+3]==="L"&&l[a+4]==="E"&&l[a+5]==="M"&&l[a+6]==="E"&&l[a+7]==="N"&&l[a+8]==="T"}function m(l,a){return l[a+1]==="!"&&l[a+2]==="A"&&l[a+3]==="T"&&l[a+4]==="T"&&l[a+5]==="L"&&l[a+6]==="I"&&l[a+7]==="S"&&l[a+8]==="T"}function h(l,a){return l[a+1]==="!"&&l[a+2]==="N"&&l[a+3]==="O"&&l[a+4]==="T"&&l[a+5]==="A"&&l[a+6]==="T"&&l[a+7]==="I"&&l[a+8]==="O"&&l[a+9]==="N"}function o(l){if(r.isName(l))return l;throw new Error(`Invalid entity name ${l}`)}e.exports=function(l,a){const d={};if(l[a+3]!=="O"||l[a+4]!=="C"||l[a+5]!=="T"||l[a+6]!=="Y"||l[a+7]!=="P"||l[a+8]!=="E")throw new Error("Invalid Tag instead of DOCTYPE");{a+=9;let f=1,g=!1,v=!1,A="";for(;a<l.length;a++)if(l[a]!=="<"||v)if(l[a]===">"){if(v?l[a-1]==="-"&&l[a-2]==="-"&&(v=!1,f--):f--,f===0)break}else l[a]==="["?g=!0:A+=l[a];else{if(g&&c(l,a)){let p,y;a+=7,[p,y,a]=s(l,a+1),y.indexOf("&")===-1&&(d[o(p)]={regx:RegExp(`&${p};`,"g"),val:y})}else if(g&&u(l,a))a+=8;else if(g&&m(l,a))a+=8;else if(g&&h(l,a))a+=9;else{if(!i)throw new Error("Invalid DOCTYPE");v=!0}f++,A=""}if(f!==0)throw new Error("Unclosed DOCTYPE")}return{entities:d,i:a}}},63:(e,t)=>{const n={preserveOrder:!1,attributeNamePrefix:"@_",attributesGroupName:!1,textNodeName:"#text",ignoreAttributes:!0,removeNSPrefix:!1,allowBooleanAttributes:!1,parseTagValue:!0,parseAttributeValue:!1,trimValues:!0,cdataPropName:!1,numberParseOptions:{hex:!0,leadingZeros:!0,eNotation:!0},tagValueProcessor:function(r,s){return s},attributeValueProcessor:function(r,s){return s},stopNodes:[],alwaysCreateTextNode:!1,isArray:()=>!1,commentPropName:!1,unpairedTags:[],processEntities:!0,htmlEntities:!1,ignoreDeclaration:!1,ignorePiTags:!1,transformTagName:!1,transformAttributeName:!1,updateTag:function(r,s,i){return r}};t.buildOptions=function(r){return Object.assign({},n,r)},t.defaultOptions=n},299:(e,t,n)=>{const r=n(705),s=n(365),i=n(193),c=n(494),u=n(118);function m(w){const P=Object.keys(w);for(let b=0;b<P.length;b++){const O=P[b];this.lastEntities[O]={regex:new RegExp("&"+O+";","g"),val:w[O]}}}function h(w,P,b,O,T,j,S){if(w!==void 0&&(this.options.trimValues&&!O&&(w=w.trim()),w.length>0)){S||(w=this.replaceEntitiesValue(w));const N=this.options.tagValueProcessor(P,w,b,T,j);return N==null?w:typeof N!=typeof w||N!==w?N:this.options.trimValues||w.trim()===w?E(w,this.options.parseTagValue,this.options.numberParseOptions):w}}function o(w){if(this.options.removeNSPrefix){const P=w.split(":"),b=w.charAt(0)==="/"?"/":"";if(P[0]==="xmlns")return"";P.length===2&&(w=b+P[1])}return w}const l=new RegExp(`([^\\s=]+)\\s*(=\\s*(['"])([\\s\\S]*?)\\3)?`,"gm");function a(w,P,b){if(this.options.ignoreAttributes!==!0&&typeof w=="string"){const O=r.getAllMatches(w,l),T=O.length,j={};for(let S=0;S<T;S++){const N=this.resolveNameSpace(O[S][1]);if(this.ignoreAttributesFn(N,P))continue;let $=O[S][4],C=this.options.attributeNamePrefix+N;if(N.length)if(this.options.transformAttributeName&&(C=this.options.transformAttributeName(C)),C==="__proto__"&&(C="#__proto__"),$!==void 0){this.options.trimValues&&($=$.trim()),$=this.replaceEntitiesValue($);const R=this.options.attributeValueProcessor(N,$,P);j[C]=R==null?$:typeof R!=typeof $||R!==$?R:E($,this.options.parseAttributeValue,this.options.numberParseOptions)}else this.options.allowBooleanAttributes&&(j[C]=!0)}if(!Object.keys(j).length)return;if(this.options.attributesGroupName){const S={};return S[this.options.attributesGroupName]=j,S}return j}}const d=function(w){w=w.replace(/\r\n?/g,`
|
|
`);const P=new s("!xml");let b=P,O="",T="";for(let j=0;j<w.length;j++)if(w[j]==="<")if(w[j+1]==="/"){const S=p(w,">",j,"Closing Tag is not closed.");let N=w.substring(j+2,S).trim();if(this.options.removeNSPrefix){const R=N.indexOf(":");R!==-1&&(N=N.substr(R+1))}this.options.transformTagName&&(N=this.options.transformTagName(N)),b&&(O=this.saveTextToParentTag(O,b,T));const $=T.substring(T.lastIndexOf(".")+1);if(N&&this.options.unpairedTags.indexOf(N)!==-1)throw new Error(`Unpaired tag can not be used as closing tag: </${N}>`);let C=0;$&&this.options.unpairedTags.indexOf($)!==-1?(C=T.lastIndexOf(".",T.lastIndexOf(".")-1),this.tagsNodeStack.pop()):C=T.lastIndexOf("."),T=T.substring(0,C),b=this.tagsNodeStack.pop(),O="",j=S}else if(w[j+1]==="?"){let S=y(w,j,!1,"?>");if(!S)throw new Error("Pi Tag is not closed.");if(O=this.saveTextToParentTag(O,b,T),!(this.options.ignoreDeclaration&&S.tagName==="?xml"||this.options.ignorePiTags)){const N=new s(S.tagName);N.add(this.options.textNodeName,""),S.tagName!==S.tagExp&&S.attrExpPresent&&(N[":@"]=this.buildAttributesMap(S.tagExp,T,S.tagName)),this.addChild(b,N,T)}j=S.closeIndex+1}else if(w.substr(j+1,3)==="!--"){const S=p(w,"-->",j+4,"Comment is not closed.");if(this.options.commentPropName){const N=w.substring(j+4,S-2);O=this.saveTextToParentTag(O,b,T),b.add(this.options.commentPropName,[{[this.options.textNodeName]:N}])}j=S}else if(w.substr(j+1,2)==="!D"){const S=i(w,j);this.docTypeEntities=S.entities,j=S.i}else if(w.substr(j+1,2)==="!["){const S=p(w,"]]>",j,"CDATA is not closed.")-2,N=w.substring(j+9,S);O=this.saveTextToParentTag(O,b,T);let $=this.parseTextData(N,b.tagname,T,!0,!1,!0,!0);$==null&&($=""),this.options.cdataPropName?b.add(this.options.cdataPropName,[{[this.options.textNodeName]:N}]):b.add(this.options.textNodeName,$),j=S+2}else{let S=y(w,j,this.options.removeNSPrefix),N=S.tagName;const $=S.rawTagName;let C=S.tagExp,R=S.attrExpPresent,V=S.closeIndex;this.options.transformTagName&&(N=this.options.transformTagName(N)),b&&O&&b.tagname!=="!xml"&&(O=this.saveTextToParentTag(O,b,T,!1));const M=b;if(M&&this.options.unpairedTags.indexOf(M.tagname)!==-1&&(b=this.tagsNodeStack.pop(),T=T.substring(0,T.lastIndexOf("."))),N!==P.tagname&&(T+=T?"."+N:N),this.isItStopNode(this.options.stopNodes,T,N)){let L="";if(C.length>0&&C.lastIndexOf("/")===C.length-1)N[N.length-1]==="/"?(N=N.substr(0,N.length-1),T=T.substr(0,T.length-1),C=N):C=C.substr(0,C.length-1),j=S.closeIndex;else if(this.options.unpairedTags.indexOf(N)!==-1)j=S.closeIndex;else{const D=this.readStopNodeData(w,$,V+1);if(!D)throw new Error(`Unexpected end of ${$}`);j=D.i,L=D.tagContent}const K=new s(N);N!==C&&R&&(K[":@"]=this.buildAttributesMap(C,T,N)),L&&(L=this.parseTextData(L,N,T,!0,R,!0,!0)),T=T.substr(0,T.lastIndexOf(".")),K.add(this.options.textNodeName,L),this.addChild(b,K,T)}else{if(C.length>0&&C.lastIndexOf("/")===C.length-1){N[N.length-1]==="/"?(N=N.substr(0,N.length-1),T=T.substr(0,T.length-1),C=N):C=C.substr(0,C.length-1),this.options.transformTagName&&(N=this.options.transformTagName(N));const L=new s(N);N!==C&&R&&(L[":@"]=this.buildAttributesMap(C,T,N)),this.addChild(b,L,T),T=T.substr(0,T.lastIndexOf("."))}else{const L=new s(N);this.tagsNodeStack.push(b),N!==C&&R&&(L[":@"]=this.buildAttributesMap(C,T,N)),this.addChild(b,L,T),b=L}O="",j=V}}else O+=w[j];return P.child};function f(w,P,b){const O=this.options.updateTag(P.tagname,b,P[":@"]);O===!1||(typeof O=="string"&&(P.tagname=O),w.addChild(P))}const g=function(w){if(this.options.processEntities){for(let P in this.docTypeEntities){const b=this.docTypeEntities[P];w=w.replace(b.regx,b.val)}for(let P in this.lastEntities){const b=this.lastEntities[P];w=w.replace(b.regex,b.val)}if(this.options.htmlEntities)for(let P in this.htmlEntities){const b=this.htmlEntities[P];w=w.replace(b.regex,b.val)}w=w.replace(this.ampEntity.regex,this.ampEntity.val)}return w};function v(w,P,b,O){return w&&(O===void 0&&(O=Object.keys(P.child).length===0),(w=this.parseTextData(w,P.tagname,b,!1,!!P[":@"]&&Object.keys(P[":@"]).length!==0,O))!==void 0&&w!==""&&P.add(this.options.textNodeName,w),w=""),w}function A(w,P,b){const O="*."+b;for(const T in w){const j=w[T];if(O===j||P===j)return!0}return!1}function p(w,P,b,O){const T=w.indexOf(P,b);if(T===-1)throw new Error(O);return T+P.length-1}function y(w,P,b){const O=function(R,V){let M,L=arguments.length>2&&arguments[2]!==void 0?arguments[2]:">",K="";for(let D=V;D<R.length;D++){let z=R[D];if(M)z===M&&(M="");else if(z==='"'||z==="'")M=z;else if(z===L[0]){if(!L[1])return{data:K,index:D};if(R[D+1]===L[1])return{data:K,index:D}}else z===" "&&(z=" ");K+=z}}(w,P+1,arguments.length>3&&arguments[3]!==void 0?arguments[3]:">");if(!O)return;let T=O.data;const j=O.index,S=T.search(/\s/);let N=T,$=!0;S!==-1&&(N=T.substring(0,S),T=T.substring(S+1).trimStart());const C=N;if(b){const R=N.indexOf(":");R!==-1&&(N=N.substr(R+1),$=N!==O.data.substr(R+1))}return{tagName:N,tagExp:T,closeIndex:j,attrExpPresent:$,rawTagName:C}}function x(w,P,b){const O=b;let T=1;for(;b<w.length;b++)if(w[b]==="<")if(w[b+1]==="/"){const j=p(w,">",b,`${P} is not closed`);if(w.substring(b+2,j).trim()===P&&(T--,T===0))return{tagContent:w.substring(O,b),i:j};b=j}else if(w[b+1]==="?")b=p(w,"?>",b+1,"StopNode is not closed.");else if(w.substr(b+1,3)==="!--")b=p(w,"-->",b+3,"StopNode is not closed.");else if(w.substr(b+1,2)==="![")b=p(w,"]]>",b,"StopNode is not closed.")-2;else{const j=y(w,b,">");j&&((j&&j.tagName)===P&&j.tagExp[j.tagExp.length-1]!=="/"&&T++,b=j.closeIndex)}}function E(w,P,b){if(P&&typeof w=="string"){const O=w.trim();return O==="true"||O!=="false"&&c(w,b)}return r.isExist(w)?w:""}e.exports=class{constructor(w){this.options=w,this.currentNode=null,this.tagsNodeStack=[],this.docTypeEntities={},this.lastEntities={apos:{regex:/&(apos|#39|#x27);/g,val:"'"},gt:{regex:/&(gt|#62|#x3E);/g,val:">"},lt:{regex:/&(lt|#60|#x3C);/g,val:"<"},quot:{regex:/&(quot|#34|#x22);/g,val:'"'}},this.ampEntity={regex:/&(amp|#38|#x26);/g,val:"&"},this.htmlEntities={space:{regex:/&(nbsp|#160);/g,val:" "},cent:{regex:/&(cent|#162);/g,val:"¢"},pound:{regex:/&(pound|#163);/g,val:"£"},yen:{regex:/&(yen|#165);/g,val:"¥"},euro:{regex:/&(euro|#8364);/g,val:"€"},copyright:{regex:/&(copy|#169);/g,val:"©"},reg:{regex:/&(reg|#174);/g,val:"®"},inr:{regex:/&(inr|#8377);/g,val:"₹"},num_dec:{regex:/&#([0-9]{1,7});/g,val:(P,b)=>String.fromCharCode(Number.parseInt(b,10))},num_hex:{regex:/&#x([0-9a-fA-F]{1,6});/g,val:(P,b)=>String.fromCharCode(Number.parseInt(b,16))}},this.addExternalEntities=m,this.parseXml=d,this.parseTextData=h,this.resolveNameSpace=o,this.buildAttributesMap=a,this.isItStopNode=A,this.replaceEntitiesValue=g,this.readStopNodeData=x,this.saveTextToParentTag=v,this.addChild=f,this.ignoreAttributesFn=u(this.options.ignoreAttributes)}}},338:(e,t,n)=>{const{buildOptions:r}=n(63),s=n(299),{prettify:i}=n(728),c=n(31);e.exports=class{constructor(u){this.externalEntities={},this.options=r(u)}parse(u,m){if(typeof u!="string"){if(!u.toString)throw new Error("XML data is accepted in String or Bytes[] form.");u=u.toString()}if(m){m===!0&&(m={});const l=c.validate(u,m);if(l!==!0)throw Error(`${l.err.msg}:${l.err.line}:${l.err.col}`)}const h=new s(this.options);h.addExternalEntities(this.externalEntities);const o=h.parseXml(u);return this.options.preserveOrder||o===void 0?o:i(o,this.options)}addEntity(u,m){if(m.indexOf("&")!==-1)throw new Error("Entity value can't have '&'");if(u.indexOf("&")!==-1||u.indexOf(";")!==-1)throw new Error("An entity must be set without '&' and ';'. Eg. use '#xD' for '
'");if(m==="&")throw new Error("An entity with value '&' is not permitted");this.externalEntities[u]=m}}},728:(e,t)=>{function n(c,u,m){let h;const o={};for(let l=0;l<c.length;l++){const a=c[l],d=r(a);let f="";if(f=m===void 0?d:m+"."+d,d===u.textNodeName)h===void 0?h=a[d]:h+=""+a[d];else{if(d===void 0)continue;if(a[d]){let g=n(a[d],u,f);const v=i(g,u);a[":@"]?s(g,a[":@"],f,u):Object.keys(g).length!==1||g[u.textNodeName]===void 0||u.alwaysCreateTextNode?Object.keys(g).length===0&&(u.alwaysCreateTextNode?g[u.textNodeName]="":g=""):g=g[u.textNodeName],o[d]!==void 0&&o.hasOwnProperty(d)?(Array.isArray(o[d])||(o[d]=[o[d]]),o[d].push(g)):u.isArray(d,f,v)?o[d]=[g]:o[d]=g}}}return typeof h=="string"?h.length>0&&(o[u.textNodeName]=h):h!==void 0&&(o[u.textNodeName]=h),o}function r(c){const u=Object.keys(c);for(let m=0;m<u.length;m++){const h=u[m];if(h!==":@")return h}}function s(c,u,m,h){if(u){const o=Object.keys(u),l=o.length;for(let a=0;a<l;a++){const d=o[a];h.isArray(d,m+"."+d,!0,!0)?c[d]=[u[d]]:c[d]=u[d]}}}function i(c,u){const{textNodeName:m}=u,h=Object.keys(c).length;return h===0||!(h!==1||!c[m]&&typeof c[m]!="boolean"&&c[m]!==0)}t.prettify=function(c,u){return n(c,u)}},365:e=>{e.exports=class{constructor(t){this.tagname=t,this.child=[],this[":@"]={}}add(t,n){t==="__proto__"&&(t="#__proto__"),this.child.push({[t]:n})}addChild(t){t.tagname==="__proto__"&&(t.tagname="#__proto__"),t[":@"]&&Object.keys(t[":@"]).length>0?this.child.push({[t.tagname]:t.child,":@":t[":@"]}):this.child.push({[t.tagname]:t.child})}}},135:e=>{function t(n){return!!n.constructor&&typeof n.constructor.isBuffer=="function"&&n.constructor.isBuffer(n)}e.exports=function(n){return n!=null&&(t(n)||function(r){return typeof r.readFloatLE=="function"&&typeof r.slice=="function"&&t(r.slice(0,0))}(n)||!!n._isBuffer)}},542:(e,t,n)=>{(function(){var r=n(298),s=n(526).utf8,i=n(135),c=n(526).bin,u=function(m,h){m.constructor==String?m=h&&h.encoding==="binary"?c.stringToBytes(m):s.stringToBytes(m):i(m)?m=Array.prototype.slice.call(m,0):Array.isArray(m)||m.constructor===Uint8Array||(m=m.toString());for(var o=r.bytesToWords(m),l=8*m.length,a=1732584193,d=-271733879,f=-1732584194,g=271733878,v=0;v<o.length;v++)o[v]=16711935&(o[v]<<8|o[v]>>>24)|4278255360&(o[v]<<24|o[v]>>>8);o[l>>>5]|=128<<l%32,o[14+(l+64>>>9<<4)]=l;var A=u._ff,p=u._gg,y=u._hh,x=u._ii;for(v=0;v<o.length;v+=16){var E=a,w=d,P=f,b=g;a=A(a,d,f,g,o[v+0],7,-680876936),g=A(g,a,d,f,o[v+1],12,-389564586),f=A(f,g,a,d,o[v+2],17,606105819),d=A(d,f,g,a,o[v+3],22,-1044525330),a=A(a,d,f,g,o[v+4],7,-176418897),g=A(g,a,d,f,o[v+5],12,1200080426),f=A(f,g,a,d,o[v+6],17,-1473231341),d=A(d,f,g,a,o[v+7],22,-45705983),a=A(a,d,f,g,o[v+8],7,1770035416),g=A(g,a,d,f,o[v+9],12,-1958414417),f=A(f,g,a,d,o[v+10],17,-42063),d=A(d,f,g,a,o[v+11],22,-1990404162),a=A(a,d,f,g,o[v+12],7,1804603682),g=A(g,a,d,f,o[v+13],12,-40341101),f=A(f,g,a,d,o[v+14],17,-1502002290),a=p(a,d=A(d,f,g,a,o[v+15],22,1236535329),f,g,o[v+1],5,-165796510),g=p(g,a,d,f,o[v+6],9,-1069501632),f=p(f,g,a,d,o[v+11],14,643717713),d=p(d,f,g,a,o[v+0],20,-373897302),a=p(a,d,f,g,o[v+5],5,-701558691),g=p(g,a,d,f,o[v+10],9,38016083),f=p(f,g,a,d,o[v+15],14,-660478335),d=p(d,f,g,a,o[v+4],20,-405537848),a=p(a,d,f,g,o[v+9],5,568446438),g=p(g,a,d,f,o[v+14],9,-1019803690),f=p(f,g,a,d,o[v+3],14,-187363961),d=p(d,f,g,a,o[v+8],20,1163531501),a=p(a,d,f,g,o[v+13],5,-1444681467),g=p(g,a,d,f,o[v+2],9,-51403784),f=p(f,g,a,d,o[v+7],14,1735328473),a=y(a,d=p(d,f,g,a,o[v+12],20,-1926607734),f,g,o[v+5],4,-378558),g=y(g,a,d,f,o[v+8],11,-2022574463),f=y(f,g,a,d,o[v+11],16,1839030562),d=y(d,f,g,a,o[v+14],23,-35309556),a=y(a,d,f,g,o[v+1],4,-1530992060),g=y(g,a,d,f,o[v+4],11,1272893353),f=y(f,g,a,d,o[v+7],16,-155497632),d=y(d,f,g,a,o[v+10],23,-1094730640),a=y(a,d,f,g,o[v+13],4,681279174),g=y(g,a,d,f,o[v+0],11,-358537222),f=y(f,g,a,d,o[v+3],16,-722521979),d=y(d,f,g,a,o[v+6],23,76029189),a=y(a,d,f,g,o[v+9],4,-640364487),g=y(g,a,d,f,o[v+12],11,-421815835),f=y(f,g,a,d,o[v+15],16,530742520),a=x(a,d=y(d,f,g,a,o[v+2],23,-995338651),f,g,o[v+0],6,-198630844),g=x(g,a,d,f,o[v+7],10,1126891415),f=x(f,g,a,d,o[v+14],15,-1416354905),d=x(d,f,g,a,o[v+5],21,-57434055),a=x(a,d,f,g,o[v+12],6,1700485571),g=x(g,a,d,f,o[v+3],10,-1894986606),f=x(f,g,a,d,o[v+10],15,-1051523),d=x(d,f,g,a,o[v+1],21,-2054922799),a=x(a,d,f,g,o[v+8],6,1873313359),g=x(g,a,d,f,o[v+15],10,-30611744),f=x(f,g,a,d,o[v+6],15,-1560198380),d=x(d,f,g,a,o[v+13],21,1309151649),a=x(a,d,f,g,o[v+4],6,-145523070),g=x(g,a,d,f,o[v+11],10,-1120210379),f=x(f,g,a,d,o[v+2],15,718787259),d=x(d,f,g,a,o[v+9],21,-343485551),a=a+E>>>0,d=d+w>>>0,f=f+P>>>0,g=g+b>>>0}return r.endian([a,d,f,g])};u._ff=function(m,h,o,l,a,d,f){var g=m+(h&o|~h&l)+(a>>>0)+f;return(g<<d|g>>>32-d)+h},u._gg=function(m,h,o,l,a,d,f){var g=m+(h&l|o&~l)+(a>>>0)+f;return(g<<d|g>>>32-d)+h},u._hh=function(m,h,o,l,a,d,f){var g=m+(h^o^l)+(a>>>0)+f;return(g<<d|g>>>32-d)+h},u._ii=function(m,h,o,l,a,d,f){var g=m+(o^(h|~l))+(a>>>0)+f;return(g<<d|g>>>32-d)+h},u._blocksize=16,u._digestsize=16,e.exports=function(m,h){if(m==null)throw new Error("Illegal argument "+m);var o=r.wordsToBytes(u(m,h));return h&&h.asBytes?o:h&&h.asString?c.bytesToString(o):r.bytesToHex(o)}})()},285:(e,t,n)=>{var r=n(2);e.exports=function(A){return A?(A.substr(0,2)==="{}"&&(A="\\{\\}"+A.substr(2)),v(function(p){return p.split("\\\\").join(s).split("\\{").join(i).split("\\}").join(c).split("\\,").join(u).split("\\.").join(m)}(A),!0).map(o)):[]};var s="\0SLASH"+Math.random()+"\0",i="\0OPEN"+Math.random()+"\0",c="\0CLOSE"+Math.random()+"\0",u="\0COMMA"+Math.random()+"\0",m="\0PERIOD"+Math.random()+"\0";function h(A){return parseInt(A,10)==A?parseInt(A,10):A.charCodeAt(0)}function o(A){return A.split(s).join("\\").split(i).join("{").split(c).join("}").split(u).join(",").split(m).join(".")}function l(A){if(!A)return[""];var p=[],y=r("{","}",A);if(!y)return A.split(",");var x=y.pre,E=y.body,w=y.post,P=x.split(",");P[P.length-1]+="{"+E+"}";var b=l(w);return w.length&&(P[P.length-1]+=b.shift(),P.push.apply(P,b)),p.push.apply(p,P),p}function a(A){return"{"+A+"}"}function d(A){return/^-?0\d/.test(A)}function f(A,p){return A<=p}function g(A,p){return A>=p}function v(A,p){var y=[],x=r("{","}",A);if(!x)return[A];var E=x.pre,w=x.post.length?v(x.post,!1):[""];if(/\$$/.test(x.pre))for(var P=0;P<w.length;P++){var b=E+"{"+x.body+"}"+w[P];y.push(b)}else{var O,T,j=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(x.body),S=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(x.body),N=j||S,$=x.body.indexOf(",")>=0;if(!N&&!$)return x.post.match(/,.*\}/)?v(A=x.pre+"{"+x.body+c+x.post):[A];if(N)O=x.body.split(/\.\./);else if((O=l(x.body)).length===1&&(O=v(O[0],!1).map(a)).length===1)return w.map(function(hn){return x.pre+O[0]+hn});if(N){var C=h(O[0]),R=h(O[1]),V=Math.max(O[0].length,O[1].length),M=O.length==3?Math.abs(h(O[2])):1,L=f;R<C&&(M*=-1,L=g);var K=O.some(d);T=[];for(var D=C;L(D,R);D+=M){var z;if(S)(z=String.fromCharCode(D))==="\\"&&(z="");else if(z=String(D),K){var fe=V-z.length;if(fe>0){var de=new Array(fe+1).join("0");z=D<0?"-"+de+z.slice(1):de+z}}T.push(z)}}else{T=[];for(var at=0;at<O.length;at++)T.push.apply(T,v(O[at],!1))}for(at=0;at<T.length;at++)for(P=0;P<w.length;P++)b=E+T[at]+w[P],(!p||N||b)&&y.push(b)}return y}},829:e=>{function t(h){return t=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(o){return typeof o}:function(o){return o&&typeof Symbol=="function"&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},t(h)}function n(h){var o=typeof Map=="function"?new Map:void 0;return n=function(l){if(l===null||(a=l,Function.toString.call(a).indexOf("[native code]")===-1))return l;var a;if(typeof l!="function")throw new TypeError("Super expression must either be null or a function");if(o!==void 0){if(o.has(l))return o.get(l);o.set(l,d)}function d(){return r(l,arguments,i(this).constructor)}return d.prototype=Object.create(l.prototype,{constructor:{value:d,enumerable:!1,writable:!0,configurable:!0}}),s(d,l)},n(h)}function r(h,o,l){return r=function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}()?Reflect.construct:function(a,d,f){var g=[null];g.push.apply(g,d);var v=new(Function.bind.apply(a,g));return f&&s(v,f.prototype),v},r.apply(null,arguments)}function s(h,o){return s=Object.setPrototypeOf||function(l,a){return l.__proto__=a,l},s(h,o)}function i(h){return i=Object.setPrototypeOf?Object.getPrototypeOf:function(o){return o.__proto__||Object.getPrototypeOf(o)},i(h)}var c=function(h){function o(l){var a;return function(d,f){if(!(d instanceof f))throw new TypeError("Cannot call a class as a function")}(this,o),(a=function(d,f){return!f||t(f)!=="object"&&typeof f!="function"?function(g){if(g===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return g}(d):f}(this,i(o).call(this,l))).name="ObjectPrototypeMutationError",a}return function(l,a){if(typeof a!="function"&&a!==null)throw new TypeError("Super expression must either be null or a function");l.prototype=Object.create(a&&a.prototype,{constructor:{value:l,writable:!0,configurable:!0}}),a&&s(l,a)}(o,h),o}(n(Error));function u(h,o){for(var l=arguments.length>2&&arguments[2]!==void 0?arguments[2]:function(){},a=o.split("."),d=a.length,f=function(A){var p=a[A];if(!h)return{v:void 0};if(p==="+"){if(Array.isArray(h))return{v:h.map(function(x,E){var w=a.slice(A+1);return w.length>0?u(x,w.join("."),l):l(h,E,a,A)})};var y=a.slice(0,A).join(".");throw new Error("Object at wildcard (".concat(y,") is not an array"))}h=l(h,p,a,A)},g=0;g<d;g++){var v=f(g);if(t(v)==="object")return v.v}return h}function m(h,o){return h.length===o+1}e.exports={set:function(h,o,l){if(t(h)!="object"||h===null||o===void 0)return h;if(typeof o=="number")return h[o]=l,h[o];try{return u(h,o,function(a,d,f,g){if(a===Reflect.getPrototypeOf({}))throw new c("Attempting to mutate Object.prototype");if(!a[d]){var v=Number.isInteger(Number(f[g+1])),A=f[g+1]==="+";a[d]=v||A?[]:{}}return m(f,g)&&(a[d]=l),a[d]})}catch(a){if(a instanceof c)throw a;return h}},get:function(h,o){if(t(h)!="object"||h===null||o===void 0)return h;if(typeof o=="number")return h[o];try{return u(h,o,function(l,a){return l[a]})}catch{return h}},has:function(h,o){var l=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(t(h)!="object"||h===null||o===void 0)return!1;if(typeof o=="number")return o in h;try{var a=!1;return u(h,o,function(d,f,g,v){if(!m(g,v))return d&&d[f];a=l.own?d.hasOwnProperty(f):f in d}),a}catch{return!1}},hasOwn:function(h,o,l){return this.has(h,o,l||{own:!0})},isIn:function(h,o,l){var a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};if(t(h)!="object"||h===null||o===void 0)return!1;try{var d=!1,f=!1;return u(h,o,function(g,v,A,p){return d=d||g===l||!!g&&g[v]===l,f=m(A,p)&&t(g)==="object"&&v in g,g&&g[v]}),a.validPath?d&&f:d}catch{return!1}},ObjectPrototypeMutationError:c}},47:(e,t,n)=>{var r=n(410),s=function(h){return typeof h=="string"};function i(h,o){for(var l=[],a=0;a<h.length;a++){var d=h[a];d&&d!=="."&&(d===".."?l.length&&l[l.length-1]!==".."?l.pop():o&&l.push(".."):l.push(d))}return l}var c=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/,u={};function m(h){return c.exec(h).slice(1)}u.resolve=function(){for(var h="",o=!1,l=arguments.length-1;l>=-1&&!o;l--){var a=l>=0?arguments[l]:Et.cwd();if(!s(a))throw new TypeError("Arguments to path.resolve must be strings");a&&(h=a+"/"+h,o=a.charAt(0)==="/")}return(o?"/":"")+(h=i(h.split("/"),!o).join("/"))||"."},u.normalize=function(h){var o=u.isAbsolute(h),l=h.substr(-1)==="/";return(h=i(h.split("/"),!o).join("/"))||o||(h="."),h&&l&&(h+="/"),(o?"/":"")+h},u.isAbsolute=function(h){return h.charAt(0)==="/"},u.join=function(){for(var h="",o=0;o<arguments.length;o++){var l=arguments[o];if(!s(l))throw new TypeError("Arguments to path.join must be strings");l&&(h+=h?"/"+l:l)}return u.normalize(h)},u.relative=function(h,o){function l(p){for(var y=0;y<p.length&&p[y]==="";y++);for(var x=p.length-1;x>=0&&p[x]==="";x--);return y>x?[]:p.slice(y,x+1)}h=u.resolve(h).substr(1),o=u.resolve(o).substr(1);for(var a=l(h.split("/")),d=l(o.split("/")),f=Math.min(a.length,d.length),g=f,v=0;v<f;v++)if(a[v]!==d[v]){g=v;break}var A=[];for(v=g;v<a.length;v++)A.push("..");return(A=A.concat(d.slice(g))).join("/")},u._makeLong=function(h){return h},u.dirname=function(h){var o=m(h),l=o[0],a=o[1];return l||a?(a&&(a=a.substr(0,a.length-1)),l+a):"."},u.basename=function(h,o){var l=m(h)[2];return o&&l.substr(-1*o.length)===o&&(l=l.substr(0,l.length-o.length)),l},u.extname=function(h){return m(h)[3]},u.format=function(h){if(!r.isObject(h))throw new TypeError("Parameter 'pathObject' must be an object, not "+typeof h);var o=h.root||"";if(!s(o))throw new TypeError("'pathObject.root' must be a string or undefined, not "+typeof h.root);return(h.dir?h.dir+u.sep:"")+(h.base||"")},u.parse=function(h){if(!s(h))throw new TypeError("Parameter 'pathString' must be a string, not "+typeof h);var o=m(h);if(!o||o.length!==4)throw new TypeError("Invalid path '"+h+"'");return o[1]=o[1]||"",o[2]=o[2]||"",o[3]=o[3]||"",{root:o[0],dir:o[0]+o[1].slice(0,o[1].length-1),base:o[2],ext:o[3],name:o[2].slice(0,o[2].length-o[3].length)}},u.sep="/",u.delimiter=":",e.exports=u},647:(e,t)=>{var n=Object.prototype.hasOwnProperty;function r(i){try{return decodeURIComponent(i.replace(/\+/g," "))}catch{return null}}function s(i){try{return encodeURIComponent(i)}catch{return null}}t.stringify=function(i,c){c=c||"";var u,m,h=[];for(m in typeof c!="string"&&(c="?"),i)if(n.call(i,m)){if((u=i[m])||u!=null&&!isNaN(u)||(u=""),m=s(m),u=s(u),m===null||u===null)continue;h.push(m+"="+u)}return h.length?c+h.join("&"):""},t.parse=function(i){for(var c,u=/([^=?#&]+)=?([^&]*)/g,m={};c=u.exec(i);){var h=r(c[1]),o=r(c[2]);h===null||o===null||h in m||(m[h]=o)}return m}},670:e=>{e.exports=function(t,n){if(n=n.split(":")[0],!(t=+t))return!1;switch(n){case"http":case"ws":return t!==80;case"https":case"wss":return t!==443;case"ftp":return t!==21;case"gopher":return t!==70;case"file":return!1}return t!==0}},494:e=>{const t=/^[-+]?0x[a-fA-F0-9]+$/,n=/^([\-\+])?(0*)(\.[0-9]+([eE]\-?[0-9]+)?|[0-9]+(\.[0-9]+([eE]\-?[0-9]+)?)?)$/;!Number.parseInt&&window.parseInt&&(Number.parseInt=window.parseInt),!Number.parseFloat&&window.parseFloat&&(Number.parseFloat=window.parseFloat);const r={hex:!0,leadingZeros:!0,decimalPoint:".",eNotation:!0};e.exports=function(s){let i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(i=Object.assign({},r,i),!s||typeof s!="string")return s;let c=s.trim();if(i.skipLike!==void 0&&i.skipLike.test(c))return s;if(i.hex&&t.test(c))return Number.parseInt(c,16);{const m=n.exec(c);if(m){const h=m[1],o=m[2];let l=((u=m[3])&&u.indexOf(".")!==-1&&((u=u.replace(/0+$/,""))==="."?u="0":u[0]==="."?u="0"+u:u[u.length-1]==="."&&(u=u.substr(0,u.length-1))),u);const a=m[4]||m[6];if(!i.leadingZeros&&o.length>0&&h&&c[2]!=="."||!i.leadingZeros&&o.length>0&&!h&&c[1]!==".")return s;{const d=Number(c),f=""+d;return f.search(/[eE]/)!==-1||a?i.eNotation?d:s:c.indexOf(".")!==-1?f==="0"&&l===""||f===l||h&&f==="-"+l?d:s:o?l===f||h+l===f?d:s:c===f||c===h+f?d:s}}return s}var u}},737:(e,t,n)=>{var r=n(670),s=n(647),i=/^[\x00-\x20\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]+/,c=/[\n\r\t]/g,u=/^[A-Za-z][A-Za-z0-9+-.]*:\/\//,m=/:\d+$/,h=/^([a-z][a-z0-9.+-]*:)?(\/\/)?([\\/]+)?([\S\s]*)/i,o=/^[a-zA-Z]:/;function l(p){return(p||"").toString().replace(i,"")}var a=[["#","hash"],["?","query"],function(p,y){return g(y.protocol)?p.replace(/\\/g,"/"):p},["/","pathname"],["@","auth",1],[NaN,"host",void 0,1,1],[/:(\d*)$/,"port",void 0,1],[NaN,"hostname",void 0,1,1]],d={hash:1,query:1};function f(p){var y,x=(typeof window<"u"?window:typeof wt<"u"?wt:typeof self<"u"?self:{}).location||{},E={},w=typeof(p=p||x);if(p.protocol==="blob:")E=new A(unescape(p.pathname),{});else if(w==="string")for(y in E=new A(p,{}),d)delete E[y];else if(w==="object"){for(y in p)y in d||(E[y]=p[y]);E.slashes===void 0&&(E.slashes=u.test(p.href))}return E}function g(p){return p==="file:"||p==="ftp:"||p==="http:"||p==="https:"||p==="ws:"||p==="wss:"}function v(p,y){p=(p=l(p)).replace(c,""),y=y||{};var x,E=h.exec(p),w=E[1]?E[1].toLowerCase():"",P=!!E[2],b=!!E[3],O=0;return P?b?(x=E[2]+E[3]+E[4],O=E[2].length+E[3].length):(x=E[2]+E[4],O=E[2].length):b?(x=E[3]+E[4],O=E[3].length):x=E[4],w==="file:"?O>=2&&(x=x.slice(2)):g(w)?x=E[4]:w?P&&(x=x.slice(2)):O>=2&&g(y.protocol)&&(x=E[4]),{protocol:w,slashes:P||g(w),slashesCount:O,rest:x}}function A(p,y,x){if(p=(p=l(p)).replace(c,""),!(this instanceof A))return new A(p,y,x);var E,w,P,b,O,T,j=a.slice(),S=typeof y,N=this,$=0;for(S!=="object"&&S!=="string"&&(x=y,y=null),x&&typeof x!="function"&&(x=s.parse),E=!(w=v(p||"",y=f(y))).protocol&&!w.slashes,N.slashes=w.slashes||E&&y.slashes,N.protocol=w.protocol||y.protocol||"",p=w.rest,(w.protocol==="file:"&&(w.slashesCount!==2||o.test(p))||!w.slashes&&(w.protocol||w.slashesCount<2||!g(N.protocol)))&&(j[3]=[/(.*)/,"pathname"]);$<j.length;$++)typeof(b=j[$])!="function"?(P=b[0],T=b[1],P!=P?N[T]=p:typeof P=="string"?~(O=P==="@"?p.lastIndexOf(P):p.indexOf(P))&&(typeof b[2]=="number"?(N[T]=p.slice(0,O),p=p.slice(O+b[2])):(N[T]=p.slice(O),p=p.slice(0,O))):(O=P.exec(p))&&(N[T]=O[1],p=p.slice(0,O.index)),N[T]=N[T]||E&&b[3]&&y[T]||"",b[4]&&(N[T]=N[T].toLowerCase())):p=b(p,N);x&&(N.query=x(N.query)),E&&y.slashes&&N.pathname.charAt(0)!=="/"&&(N.pathname!==""||y.pathname!=="")&&(N.pathname=function(C,R){if(C==="")return R;for(var V=(R||"/").split("/").slice(0,-1).concat(C.split("/")),M=V.length,L=V[M-1],K=!1,D=0;M--;)V[M]==="."?V.splice(M,1):V[M]===".."?(V.splice(M,1),D++):D&&(M===0&&(K=!0),V.splice(M,1),D--);return K&&V.unshift(""),L!=="."&&L!==".."||V.push(""),V.join("/")}(N.pathname,y.pathname)),N.pathname.charAt(0)!=="/"&&g(N.protocol)&&(N.pathname="/"+N.pathname),r(N.port,N.protocol)||(N.host=N.hostname,N.port=""),N.username=N.password="",N.auth&&(~(O=N.auth.indexOf(":"))?(N.username=N.auth.slice(0,O),N.username=encodeURIComponent(decodeURIComponent(N.username)),N.password=N.auth.slice(O+1),N.password=encodeURIComponent(decodeURIComponent(N.password))):N.username=encodeURIComponent(decodeURIComponent(N.auth)),N.auth=N.password?N.username+":"+N.password:N.username),N.origin=N.protocol!=="file:"&&g(N.protocol)&&N.host?N.protocol+"//"+N.host:"null",N.href=N.toString()}A.prototype={set:function(p,y,x){var E=this;switch(p){case"query":typeof y=="string"&&y.length&&(y=(x||s.parse)(y)),E[p]=y;break;case"port":E[p]=y,r(y,E.protocol)?y&&(E.host=E.hostname+":"+y):(E.host=E.hostname,E[p]="");break;case"hostname":E[p]=y,E.port&&(y+=":"+E.port),E.host=y;break;case"host":E[p]=y,m.test(y)?(y=y.split(":"),E.port=y.pop(),E.hostname=y.join(":")):(E.hostname=y,E.port="");break;case"protocol":E.protocol=y.toLowerCase(),E.slashes=!x;break;case"pathname":case"hash":if(y){var w=p==="pathname"?"/":"#";E[p]=y.charAt(0)!==w?w+y:y}else E[p]=y;break;case"username":case"password":E[p]=encodeURIComponent(y);break;case"auth":var P=y.indexOf(":");~P?(E.username=y.slice(0,P),E.username=encodeURIComponent(decodeURIComponent(E.username)),E.password=y.slice(P+1),E.password=encodeURIComponent(decodeURIComponent(E.password))):E.username=encodeURIComponent(decodeURIComponent(y))}for(var b=0;b<a.length;b++){var O=a[b];O[4]&&(E[O[1]]=E[O[1]].toLowerCase())}return E.auth=E.password?E.username+":"+E.password:E.username,E.origin=E.protocol!=="file:"&&g(E.protocol)&&E.host?E.protocol+"//"+E.host:"null",E.href=E.toString(),E},toString:function(p){p&&typeof p=="function"||(p=s.stringify);var y,x=this,E=x.host,w=x.protocol;w&&w.charAt(w.length-1)!==":"&&(w+=":");var P=w+(x.protocol&&x.slashes||g(x.protocol)?"//":"");return x.username?(P+=x.username,x.password&&(P+=":"+x.password),P+="@"):x.password?(P+=":"+x.password,P+="@"):x.protocol!=="file:"&&g(x.protocol)&&!E&&x.pathname!=="/"&&(P+="@"),(E[E.length-1]===":"||m.test(x.hostname)&&!x.port)&&(E+=":"),P+=E+x.pathname,(y=typeof x.query=="object"?p(x.query):x.query)&&(P+=y.charAt(0)!=="?"?"?"+y:y),x.hash&&(P+=x.hash),P}},A.extractProtocol=v,A.location=f,A.trimLeft=l,A.qs=s,e.exports=A},410:()=>{},388:()=>{},805:()=>{},345:()=>{},800:()=>{}},ye={};function _(e){var t=ye[e];if(t!==void 0)return t.exports;var n=ye[e]={id:e,loaded:!1,exports:{}};return xn[e].call(n.exports,n,n.exports,_),n.loaded=!0,n.exports}_.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return _.d(t,{a:t}),t},_.d=(e,t)=>{for(var n in t)_.o(t,n)&&!_.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},_.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),_.nmd=e=>(e.paths=[],e.children||(e.children=[]),e);var tt={};_.d(tt,{hT:()=>X,O4:()=>st,Kd:()=>Cn,YK:()=>$n,UU:()=>Dr,Gu:()=>ze,ky:()=>Ze,h4:()=>yt,ch:()=>It,hq:()=>ct,i5:()=>Qe});var An=_(737),En=_.n(An);function Dt(e){if(!Wt(e))throw new Error("Parameter was not an error")}function Wt(e){return!!e&&typeof e=="object"&&(t=e,Object.prototype.toString.call(t)==="[object Error]")||e instanceof Error;var t}class J extends Error{constructor(t,n){const r=[...arguments],{options:s,shortMessage:i}=function(u){let m,h="";if(u.length===0)m={};else if(Wt(u[0]))m={cause:u[0]},h=u.slice(1).join(" ")||"";else if(u[0]&&typeof u[0]=="object")m=Object.assign({},u[0]),h=u.slice(1).join(" ")||"";else{if(typeof u[0]!="string")throw new Error("Invalid arguments passed to Layerr");m={},h=h=u.join(" ")||""}return{options:m,shortMessage:h}}(r);let c=i;if(s.cause&&(c=`${c}: ${s.cause.message}`),super(c),this.message=c,s.name&&typeof s.name=="string"?this.name=s.name:this.name="Layerr",s.cause&&Object.defineProperty(this,"_cause",{value:s.cause}),Object.defineProperty(this,"_info",{value:{}}),s.info&&typeof s.info=="object"&&Object.assign(this._info,s.info),Error.captureStackTrace){const u=s.constructorOpt||this.constructor;Error.captureStackTrace(this,u)}}static cause(t){return Dt(t),t._cause&&Wt(t._cause)?t._cause:null}static fullStack(t){Dt(t);const n=J.cause(t);return n?`${t.stack}
|
|
caused by: ${J.fullStack(n)}`:t.stack??""}static info(t){Dt(t);const n={},r=J.cause(t);return r&&Object.assign(n,J.info(r)),t._info&&Object.assign(n,t._info),n}toString(){let t=this.name||this.constructor.name||this.constructor.prototype.name;return this.message&&(t=`${t}: ${this.message}`),t}}var Nn=_(47),Ot=_.n(Nn);const we="__PATH_SEPARATOR_POSIX__",be="__PATH_SEPARATOR_WINDOWS__";function I(e){try{const t=e.replace(/\//g,we).replace(/\\\\/g,be);return encodeURIComponent(t).split(be).join("\\\\").split(we).join("/")}catch(t){throw new J(t,"Failed encoding path")}}function xe(e){return e.startsWith("/")?e:"/"+e}function vt(e){let t=e;return t[0]!=="/"&&(t="/"+t),/^.+\/$/.test(t)&&(t=t.substr(0,t.length-1)),t}function Pn(e){let t=new(En())(e).pathname;return t.length<=0&&(t="/"),vt(t)}function k(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(){return function(r){var s=[];if(r.length===0)return"";if(typeof r[0]!="string")throw new TypeError("Url must be a string. Received "+r[0]);if(r[0].match(/^[^/:]+:\/*$/)&&r.length>1){var i=r.shift();r[0]=i+r[0]}r[0].match(/^file:\/\/\//)?r[0]=r[0].replace(/^([^/:]+):\/*/,"$1:///"):r[0]=r[0].replace(/^([^/:]+):\/*/,"$1://");for(var c=0;c<r.length;c++){var u=r[c];if(typeof u!="string")throw new TypeError("Url must be a string. Received "+u);u!==""&&(c>0&&(u=u.replace(/^[\/]+/,"")),u=c<r.length-1?u.replace(/[\/]+$/,""):u.replace(/[\/]+$/,"/"),s.push(u))}var m=s.join("/"),h=(m=m.replace(/\/(\?|&|#[^!])/g,"$1")).split("?");return h.shift()+(h.length>0?"?":"")+h.join("&")}(typeof arguments[0]=="object"?arguments[0]:[].slice.call(arguments))}(t.reduce((r,s,i)=>((i===0||s!=="/"||s==="/"&&r[r.length-1]!=="/")&&r.push(s),r),[]))}var On=_(542),ft=_.n(On);const Tn="abcdef0123456789";function Ae(e,t){const n=e.url.replace("//",""),r=n.indexOf("/")==-1?"/":n.slice(n.indexOf("/")),s=e.method?e.method.toUpperCase():"GET",i=!!/(^|,)\s*auth\s*($|,)/.test(t.qop)&&"auth",c=`00000000${t.nc}`.slice(-8),u=function(a,d,f,g,v,A,p){const y=p||ft()(`${d}:${f}:${g}`);return a&&a.toLowerCase()==="md5-sess"?ft()(`${y}:${v}:${A}`):y}(t.algorithm,t.username,t.realm,t.password,t.nonce,t.cnonce,t.ha1),m=ft()(`${s}:${r}`),h=i?ft()(`${u}:${t.nonce}:${c}:${t.cnonce}:${i}:${m}`):ft()(`${u}:${t.nonce}:${m}`),o={username:t.username,realm:t.realm,nonce:t.nonce,uri:r,qop:i,response:h,nc:c,cnonce:t.cnonce,algorithm:t.algorithm,opaque:t.opaque},l=[];for(const a in o)o[a]&&(a==="qop"||a==="nc"||a==="algorithm"?l.push(`${a}=${o[a]}`):l.push(`${a}="${o[a]}"`));return`Digest ${l.join(", ")}`}function Ue(e){return(e.headers&&e.headers.get("www-authenticate")||"").split(/\s/)[0].toLowerCase()==="digest"}var jn=_(101),Be=_.n(jn);function Ee(e){return Be().decode(e)}function Ne(e,t){var n;return`Basic ${n=`${e}:${t}`,Be().encode(n)}`}const Tt=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope?self:typeof window<"u"?window:globalThis,Sn=Tt.fetch.bind(Tt),Cn=Tt.Request,$n=Tt.Response;let X=function(e){return e.Auto="auto",e.Digest="digest",e.None="none",e.Password="password",e.Token="token",e}({}),st=function(e){return e.DataTypeNoLength="data-type-no-length",e.InvalidAuthType="invalid-auth-type",e.InvalidOutputFormat="invalid-output-format",e.LinkUnsupportedAuthType="link-unsupported-auth",e.InvalidUpdateRange="invalid-update-range",e.NotSupported="not-supported",e}({});function Ve(e,t,n,r,s){switch(e.authType){case X.Auto:t&&n&&(e.headers.Authorization=Ne(t,n));break;case X.Digest:e.digest=function(c,u,m){return{username:c,password:u,ha1:m,nc:0,algorithm:"md5",hasDigestAuth:!1}}(t,n,s);break;case X.None:break;case X.Password:e.headers.Authorization=Ne(t,n);break;case X.Token:e.headers.Authorization=`${(i=r).token_type} ${i.access_token}`;break;default:throw new J({info:{code:st.InvalidAuthType}},`Invalid auth type: ${e.authType}`)}var i}_(345),_(800);const Pe="@@HOTPATCHER",_n=()=>{};function Mt(e){return{original:e,methods:[e],final:!1}}class Rn{constructor(){this._configuration={registry:{},getEmptyAction:"null"},this.__type__=Pe}get configuration(){return this._configuration}get getEmptyAction(){return this.configuration.getEmptyAction}set getEmptyAction(t){this.configuration.getEmptyAction=t}control(t){let n=arguments.length>1&&arguments[1]!==void 0&&arguments[1];if(!t||t.__type__!==Pe)throw new Error("Failed taking control of target HotPatcher instance: Invalid type or object");return Object.keys(t.configuration.registry).forEach(r=>{this.configuration.registry.hasOwnProperty(r)?n&&(this.configuration.registry[r]=Object.assign({},t.configuration.registry[r])):this.configuration.registry[r]=Object.assign({},t.configuration.registry[r])}),t._configuration=this.configuration,this}execute(t){const n=this.get(t)||_n;for(var r=arguments.length,s=new Array(r>1?r-1:0),i=1;i<r;i++)s[i-1]=arguments[i];return n(...s)}get(t){const n=this.configuration.registry[t];if(!n)switch(this.getEmptyAction){case"null":return null;case"throw":throw new Error(`Failed handling method request: No method provided for override: ${t}`);default:throw new Error(`Failed handling request which resulted in an empty method: Invalid empty-action specified: ${this.getEmptyAction}`)}return function(){for(var r=arguments.length,s=new Array(r),i=0;i<r;i++)s[i]=arguments[i];if(s.length===0)throw new Error("Failed creating sequence: No functions provided");return function(){for(var c=arguments.length,u=new Array(c),m=0;m<c;m++)u[m]=arguments[m];let h=u;const o=this;for(;s.length>0;)h=[s.shift().apply(o,h)];return h[0]}}(...n.methods)}isPatched(t){return!!this.configuration.registry[t]}patch(t,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const{chain:s=!1}=r;if(this.configuration.registry[t]&&this.configuration.registry[t].final)throw new Error(`Failed patching '${t}': Method marked as being final`);if(typeof n!="function")throw new Error(`Failed patching '${t}': Provided method is not a function`);if(s)this.configuration.registry[t]?this.configuration.registry[t].methods.push(n):this.configuration.registry[t]=Mt(n);else if(this.isPatched(t)){const{original:i}=this.configuration.registry[t];this.configuration.registry[t]=Object.assign(Mt(n),{original:i})}else this.configuration.registry[t]=Mt(n);return this}patchInline(t,n){this.isPatched(t)||this.patch(t,n);for(var r=arguments.length,s=new Array(r>2?r-2:0),i=2;i<r;i++)s[i-2]=arguments[i];return this.execute(t,...s)}plugin(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),s=1;s<n;s++)r[s-1]=arguments[s];return r.forEach(i=>{this.patch(t,i,{chain:!0})}),this}restore(t){if(!this.isPatched(t))throw new Error(`Failed restoring method: No method present for key: ${t}`);if(typeof this.configuration.registry[t].original!="function")throw new Error(`Failed restoring method: Original method not found or of invalid type for key: ${t}`);return this.configuration.registry[t].methods=[this.configuration.registry[t].original],this}setFinal(t){if(!this.configuration.registry.hasOwnProperty(t))throw new Error(`Failed marking '${t}' as final: No method found for key`);return this.configuration.registry[t].final=!0,this}}let Ft=null;function ze(){return Ft||(Ft=new Rn),Ft}function jt(e){return function(t){if(typeof t!="object"||t===null||Object.prototype.toString.call(t)!="[object Object]")return!1;if(Object.getPrototypeOf(t)===null)return!0;let n=t;for(;Object.getPrototypeOf(n)!==null;)n=Object.getPrototypeOf(n);return Object.getPrototypeOf(t)===n}(e)?Object.assign({},e):Object.setPrototypeOf(Object.assign({},e),Object.getPrototypeOf(e))}function Oe(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];let r=null,s=[...t];for(;s.length>0;){const i=s.shift();r=r?qe(r,i):jt(i)}return r}function qe(e,t){const n=jt(e);return Object.keys(t).forEach(r=>{n.hasOwnProperty(r)?Array.isArray(t[r])?n[r]=Array.isArray(n[r])?[...n[r],...t[r]]:[...t[r]]:typeof t[r]=="object"&&t[r]?n[r]=typeof n[r]=="object"&&n[r]?qe(n[r],t[r]):jt(t[r]):n[r]=t[r]:n[r]=t[r]}),n}function In(e){const t={};for(const n of e.keys())t[n]=e.get(n);return t}function Gt(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];if(t.length===0)return{};const r={};return t.reduce((s,i)=>(Object.keys(i).forEach(c=>{const u=c.toLowerCase();r.hasOwnProperty(u)?s[r[u]]=i[c]:(r[u]=c,s[c]=i[c])}),s),{})}_(805);const kn=typeof ArrayBuffer=="function",{toString:Ln}=Object.prototype;function We(e){return kn&&(e instanceof ArrayBuffer||Ln.call(e)==="[object ArrayBuffer]")}function Ge(e){return e!=null&&e.constructor!=null&&typeof e.constructor.isBuffer=="function"&&e.constructor.isBuffer(e)}function te(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{return Promise.resolve(e.apply(this,t))}catch(r){return Promise.reject(r)}}}function Ht(e,t,n){return n?t?t(e):e:(e&&e.then||(e=Promise.resolve(e)),t?e.then(t):e)}const He=te(function(e){const t=e._digest;return delete e._digest,t.hasDigestAuth&&(e=Oe(e,{headers:{Authorization:Ae(e,t)}})),Ht(St(e),function(n){let r=!1;return s=function(c){return r?c:n},(i=function(){if(n.status==401)return t.hasDigestAuth=function(c,u){if(!Ue(c))return!1;const m=/([a-z0-9_-]+)=(?:"([^"]+)"|([a-z0-9_-]+))/gi;for(;;){const h=c.headers&&c.headers.get("www-authenticate")||"",o=m.exec(h);if(!o)break;u[o[1]]=o[2]||o[3]}return u.nc+=1,u.cnonce=function(){let h="";for(let o=0;o<32;++o)h=`${h}${Tn[Math.floor(16*Math.random())]}`;return h}(),!0}(n,t),function(){if(t.hasDigestAuth)return Ht(St(e=Oe(e,{headers:{Authorization:Ae(e,t)}})),function(c){return c.status==401?t.hasDigestAuth=!1:t.nc++,r=!0,c})}();t.nc++}())&&i.then?i.then(s):s(i);var s,i})}),Dn=te(function(e,t){return Ht(St(e),function(n){return n.ok?(t.authType=X.Password,n):n.status==401&&Ue(n)?(t.authType=X.Digest,Ve(t,t.username,t.password,void 0,void 0),e._digest=t.digest,He(e)):n})}),F=te(function(e,t){return t.authType===X.Auto?Dn(e,t):e._digest?He(e):St(e)});function U(e,t,n){const r=jt(e);return r.headers=Gt(t.headers,r.headers||{},n.headers||{}),n.data!==void 0&&(r.data=n.data),n.signal&&(r.signal=n.signal),t.httpAgent&&(r.httpAgent=t.httpAgent),t.httpsAgent&&(r.httpsAgent=t.httpsAgent),t.digest&&(r._digest=t.digest),typeof t.withCredentials=="boolean"&&(r.withCredentials=t.withCredentials),r}function St(e){const t=ze();return t.patchInline("request",n=>t.patchInline("fetch",Sn,n.url,function(r){let s={};const i={method:r.method};if(r.headers&&(s=Gt(s,r.headers)),r.data!==void 0){const[c,u]=function(m){if(typeof m=="string")return[m,{}];if(Ge(m))return[m,{}];if(We(m))return[m,{}];if(m&&typeof m=="object")return[JSON.stringify(m),{"content-type":"application/json"}];throw new Error("Unable to convert request body: Unexpected body type: "+typeof m)}(r.data);i.body=c,s=Gt(s,u)}return r.signal&&(i.signal=r.signal),r.withCredentials&&(i.credentials="include"),i.headers=s,i}(n)),e)}var Mn=_(285);const Ct=e=>{if(typeof e!="string")throw new TypeError("invalid pattern");if(e.length>65536)throw new TypeError("pattern is too long")},Fn={"[:alnum:]":["\\p{L}\\p{Nl}\\p{Nd}",!0],"[:alpha:]":["\\p{L}\\p{Nl}",!0],"[:ascii:]":["\\x00-\\x7f",!1],"[:blank:]":["\\p{Zs}\\t",!0],"[:cntrl:]":["\\p{Cc}",!0],"[:digit:]":["\\p{Nd}",!0],"[:graph:]":["\\p{Z}\\p{C}",!0,!0],"[:lower:]":["\\p{Ll}",!0],"[:print:]":["\\p{C}",!0],"[:punct:]":["\\p{P}",!0],"[:space:]":["\\p{Z}\\t\\r\\n\\v\\f",!0],"[:upper:]":["\\p{Lu}",!0],"[:word:]":["\\p{L}\\p{Nl}\\p{Nd}\\p{Pc}",!0],"[:xdigit:]":["A-Fa-f0-9",!1]},dt=e=>e.replace(/[[\]\\-]/g,"\\$&"),Te=e=>e.join(""),Un=(e,t)=>{const n=t;if(e.charAt(n)!=="[")throw new Error("not in a brace expression");const r=[],s=[];let i=n+1,c=!1,u=!1,m=!1,h=!1,o=n,l="";t:for(;i<e.length;){const g=e.charAt(i);if(g!=="!"&&g!=="^"||i!==n+1){if(g==="]"&&c&&!m){o=i+1;break}if(c=!0,g!=="\\"||m){if(g==="["&&!m){for(const[v,[A,p,y]]of Object.entries(Fn))if(e.startsWith(v,i)){if(l)return["$.",!1,e.length-n,!0];i+=v.length,y?s.push(A):r.push(A),u=u||p;continue t}}m=!1,l?(g>l?r.push(dt(l)+"-"+dt(g)):g===l&&r.push(dt(g)),l="",i++):e.startsWith("-]",i+1)?(r.push(dt(g+"-")),i+=2):e.startsWith("-",i+1)?(l=g,i+=2):(r.push(dt(g)),i++)}else m=!0,i++}else h=!0,i++}if(o<i)return["",!1,0,!1];if(!r.length&&!s.length)return["$.",!1,e.length-n,!0];if(s.length===0&&r.length===1&&/^\\?.$/.test(r[0])&&!h)return[(a=r[0].length===2?r[0].slice(-1):r[0],a.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")),!1,o-n,!1];var a;const d="["+(h?"^":"")+Te(r)+"]",f="["+(h?"":"^")+Te(s)+"]";return[r.length&&s.length?"("+d+"|"+f+")":r.length?d:f,u,o-n,!0]},gt=function(e){let{windowsPathsNoEscape:t=!1}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return t?e.replace(/\[([^\/\\])\]/g,"$1"):e.replace(/((?!\\).|^)\[([^\/\\])\]/g,"$1$2").replace(/\\([^\/])/g,"$1")},Bn=new Set(["!","?","+","*","@"]),je=e=>Bn.has(e),Ut="(?!\\.)",Vn=new Set(["[","."]),zn=new Set(["..","."]),qn=new Set("().*{}+?[]^$\\!"),ee="[^/]",Se=ee+"*?",Ce=ee+"+?";class H{type;#n;#r;#o=!1;#t=[];#e;#i;#u;#a=!1;#s;#c;#h=!1;constructor(t,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.type=t,t&&(this.#r=!0),this.#e=n,this.#n=this.#e?this.#e.#n:this,this.#s=this.#n===this?r:this.#n.#s,this.#u=this.#n===this?[]:this.#n.#u,t!=="!"||this.#n.#a||this.#u.push(this),this.#i=this.#e?this.#e.#t.length:0}get hasMagic(){if(this.#r!==void 0)return this.#r;for(const t of this.#t)if(typeof t!="string"&&(t.type||t.hasMagic))return this.#r=!0;return this.#r}toString(){return this.#c!==void 0?this.#c:this.type?this.#c=this.type+"("+this.#t.map(t=>String(t)).join("|")+")":this.#c=this.#t.map(t=>String(t)).join("")}#f(){if(this!==this.#n)throw new Error("should only call on root");if(this.#a)return this;let t;for(this.toString(),this.#a=!0;t=this.#u.pop();){if(t.type!=="!")continue;let n=t,r=n.#e;for(;r;){for(let s=n.#i+1;!r.type&&s<r.#t.length;s++)for(const i of t.#t){if(typeof i=="string")throw new Error("string part in extglob AST??");i.copyIn(r.#t[s])}n=r,r=n.#e}}return this}push(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];for(const s of n)if(s!==""){if(typeof s!="string"&&!(s instanceof H&&s.#e===this))throw new Error("invalid part: "+s);this.#t.push(s)}}toJSON(){const t=this.type===null?this.#t.slice().map(n=>typeof n=="string"?n:n.toJSON()):[this.type,...this.#t.map(n=>n.toJSON())];return this.isStart()&&!this.type&&t.unshift([]),this.isEnd()&&(this===this.#n||this.#n.#a&&this.#e?.type==="!")&&t.push({}),t}isStart(){if(this.#n===this)return!0;if(!this.#e?.isStart())return!1;if(this.#i===0)return!0;const t=this.#e;for(let n=0;n<this.#i;n++){const r=t.#t[n];if(!(r instanceof H&&r.type==="!"))return!1}return!0}isEnd(){if(this.#n===this||this.#e?.type==="!")return!0;if(!this.#e?.isEnd())return!1;if(!this.type)return this.#e?.isEnd();const t=this.#e?this.#e.#t.length:0;return this.#i===t-1}copyIn(t){typeof t=="string"?this.push(t):this.push(t.clone(this))}clone(t){const n=new H(this.type,t);for(const r of this.#t)n.copyIn(r);return n}static#l(t,n,r,s){let i=!1,c=!1,u=-1,m=!1;if(n.type===null){let d=r,f="";for(;d<t.length;){const g=t.charAt(d++);if(i||g==="\\")i=!i,f+=g;else if(c)d===u+1?g!=="^"&&g!=="!"||(m=!0):g!=="]"||d===u+2&&m||(c=!1),f+=g;else if(g!=="[")if(s.noext||!je(g)||t.charAt(d)!=="(")f+=g;else{n.push(f),f="";const v=new H(g,n);d=H.#l(t,v,d,s),n.push(v)}else c=!0,u=d,m=!1,f+=g}return n.push(f),d}let h=r+1,o=new H(null,n);const l=[];let a="";for(;h<t.length;){const d=t.charAt(h++);if(i||d==="\\")i=!i,a+=d;else if(c)h===u+1?d!=="^"&&d!=="!"||(m=!0):d!=="]"||h===u+2&&m||(c=!1),a+=d;else if(d!=="[")if(je(d)&&t.charAt(h)==="("){o.push(a),a="";const f=new H(d,o);o.push(f),h=H.#l(t,f,h,s)}else if(d!=="|"){if(d===")")return a===""&&n.#t.length===0&&(n.#h=!0),o.push(a),a="",n.push(...l,o),h;a+=d}else o.push(a),a="",l.push(o),o=new H(null,n);else c=!0,u=h,m=!1,a+=d}return n.type=null,n.#r=void 0,n.#t=[t.substring(r-1)],h}static fromGlob(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const r=new H(null,void 0,n);return H.#l(t,r,0,n),r}toMMPattern(){if(this!==this.#n)return this.#n.toMMPattern();const t=this.toString(),[n,r,s,i]=this.toRegExpSource();if(!(s||this.#r||this.#s.nocase&&!this.#s.nocaseMagicOnly&&t.toUpperCase()!==t.toLowerCase()))return r;const c=(this.#s.nocase?"i":"")+(i?"u":"");return Object.assign(new RegExp(`^${n}$`,c),{_src:n,_glob:t})}get options(){return this.#s}toRegExpSource(t){const n=t??!!this.#s.dot;if(this.#n===this&&this.#f(),!this.type){const m=this.isStart()&&this.isEnd(),h=this.#t.map(a=>{const[d,f,g,v]=typeof a=="string"?H.#d(a,this.#r,m):a.toRegExpSource(t);return this.#r=this.#r||g,this.#o=this.#o||v,d}).join("");let o="";if(this.isStart()&&typeof this.#t[0]=="string"&&(this.#t.length!==1||!zn.has(this.#t[0]))){const a=Vn,d=n&&a.has(h.charAt(0))||h.startsWith("\\.")&&a.has(h.charAt(2))||h.startsWith("\\.\\.")&&a.has(h.charAt(4)),f=!n&&!t&&a.has(h.charAt(0));o=d?"(?!(?:^|/)\\.\\.?(?:$|/))":f?Ut:""}let l="";return this.isEnd()&&this.#n.#a&&this.#e?.type==="!"&&(l="(?:$|\\/)"),[o+h+l,gt(h),this.#r=!!this.#r,this.#o]}const r=this.type==="*"||this.type==="+",s=this.type==="!"?"(?:(?!(?:":"(?:";let i=this.#p(n);if(this.isStart()&&this.isEnd()&&!i&&this.type!=="!"){const m=this.toString();return this.#t=[m],this.type=null,this.#r=void 0,[m,gt(this.toString()),!1,!1]}let c=!r||t||n?"":this.#p(!0);c===i&&(c=""),c&&(i=`(?:${i})(?:${c})*?`);let u="";return u=this.type==="!"&&this.#h?(this.isStart()&&!n?Ut:"")+Ce:s+i+(this.type==="!"?"))"+(!this.isStart()||n||t?"":Ut)+Se+")":this.type==="@"?")":this.type==="?"?")?":this.type==="+"&&c?")":this.type==="*"&&c?")?":`)${this.type}`),[u,gt(i),this.#r=!!this.#r,this.#o]}#p(t){return this.#t.map(n=>{if(typeof n=="string")throw new Error("string type in extglob ast??");const[r,s,i,c]=n.toRegExpSource(t);return this.#o=this.#o||c,r}).filter(n=>!(this.isStart()&&this.isEnd()&&!n)).join("|")}static#d(t,n){let r=arguments.length>2&&arguments[2]!==void 0&&arguments[2],s=!1,i="",c=!1;for(let u=0;u<t.length;u++){const m=t.charAt(u);if(s)s=!1,i+=(qn.has(m)?"\\":"")+m;else if(m!=="\\"){if(m==="["){const[h,o,l,a]=Un(t,u);if(l){i+=h,c=c||o,u+=l-1,n=n||a;continue}}m!=="*"?m!=="?"?i+=m.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"):(i+=ee,n=!0):(i+=r&&t==="*"?Ce:Se,n=!0)}else u===t.length-1?i+="\\\\":s=!0}return[i,gt(t),!!n,c]}}const G=function(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return Ct(t),!(!n.nocomment&&t.charAt(0)==="#")&&new $t(t,n).match(e)},Wn=/^\*+([^+@!?\*\[\(]*)$/,Gn=e=>t=>!t.startsWith(".")&&t.endsWith(e),Hn=e=>t=>t.endsWith(e),Xn=e=>(e=e.toLowerCase(),t=>!t.startsWith(".")&&t.toLowerCase().endsWith(e)),Yn=e=>(e=e.toLowerCase(),t=>t.toLowerCase().endsWith(e)),Jn=/^\*+\.\*+$/,Kn=e=>!e.startsWith(".")&&e.includes("."),Zn=e=>e!=="."&&e!==".."&&e.includes("."),Qn=/^\.\*+$/,tr=e=>e!=="."&&e!==".."&&e.startsWith("."),er=/^\*+$/,nr=e=>e.length!==0&&!e.startsWith("."),rr=e=>e.length!==0&&e!=="."&&e!=="..",sr=/^\?+([^+@!?\*\[\(]*)?$/,or=e=>{let[t,n=""]=e;const r=Xe([t]);return n?(n=n.toLowerCase(),s=>r(s)&&s.toLowerCase().endsWith(n)):r},ir=e=>{let[t,n=""]=e;const r=Ye([t]);return n?(n=n.toLowerCase(),s=>r(s)&&s.toLowerCase().endsWith(n)):r},ar=e=>{let[t,n=""]=e;const r=Ye([t]);return n?s=>r(s)&&s.endsWith(n):r},ur=e=>{let[t,n=""]=e;const r=Xe([t]);return n?s=>r(s)&&s.endsWith(n):r},Xe=e=>{let[t]=e;const n=t.length;return r=>r.length===n&&!r.startsWith(".")},Ye=e=>{let[t]=e;const n=t.length;return r=>r.length===n&&r!=="."&&r!==".."},Je=typeof Et=="object"&&Et?typeof Lt=="object"&&Lt&&Lt.__MINIMATCH_TESTING_PLATFORM__||Et.platform:"posix";G.sep=Je==="win32"?"\\":"/";const Q=Symbol("globstar **");G.GLOBSTAR=Q,G.filter=function(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return n=>G(n,e,t)};const Z=function(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return Object.assign({},e,t)};G.defaults=e=>{if(!e||typeof e!="object"||!Object.keys(e).length)return G;const t=G;return Object.assign(function(n,r){return t(n,r,Z(e,arguments.length>2&&arguments[2]!==void 0?arguments[2]:{}))},{Minimatch:class extends t.Minimatch{constructor(n){super(n,Z(e,arguments.length>1&&arguments[1]!==void 0?arguments[1]:{}))}static defaults(n){return t.defaults(Z(e,n)).Minimatch}},AST:class extends t.AST{constructor(n,r){super(n,r,Z(e,arguments.length>2&&arguments[2]!==void 0?arguments[2]:{}))}static fromGlob(n){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return t.AST.fromGlob(n,Z(e,r))}},unescape:function(n){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return t.unescape(n,Z(e,r))},escape:function(n){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return t.escape(n,Z(e,r))},filter:function(n){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return t.filter(n,Z(e,r))},defaults:n=>t.defaults(Z(e,n)),makeRe:function(n){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return t.makeRe(n,Z(e,r))},braceExpand:function(n){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return t.braceExpand(n,Z(e,r))},match:function(n,r){let s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return t.match(n,r,Z(e,s))},sep:t.sep,GLOBSTAR:Q})};const Ke=function(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return Ct(e),t.nobrace||!/\{(?:(?!\{).)*\}/.test(e)?[e]:Mn(e)};G.braceExpand=Ke,G.makeRe=function(e){return new $t(e,arguments.length>1&&arguments[1]!==void 0?arguments[1]:{}).makeRe()},G.match=function(e,t){const n=new $t(t,arguments.length>2&&arguments[2]!==void 0?arguments[2]:{});return e=e.filter(r=>n.match(r)),n.options.nonull&&!e.length&&e.push(t),e};const $e=/[?*]|[+@!]\(.*?\)|\[|\]/;class $t{options;set;pattern;windowsPathsNoEscape;nonegate;negate;comment;empty;preserveMultipleSlashes;partial;globSet;globParts;nocase;isWindows;platform;windowsNoMagicRoot;regexp;constructor(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};Ct(t),n=n||{},this.options=n,this.pattern=t,this.platform=n.platform||Je,this.isWindows=this.platform==="win32",this.windowsPathsNoEscape=!!n.windowsPathsNoEscape||n.allowWindowsEscape===!1,this.windowsPathsNoEscape&&(this.pattern=this.pattern.replace(/\\/g,"/")),this.preserveMultipleSlashes=!!n.preserveMultipleSlashes,this.regexp=null,this.negate=!1,this.nonegate=!!n.nonegate,this.comment=!1,this.empty=!1,this.partial=!!n.partial,this.nocase=!!this.options.nocase,this.windowsNoMagicRoot=n.windowsNoMagicRoot!==void 0?n.windowsNoMagicRoot:!(!this.isWindows||!this.nocase),this.globSet=[],this.globParts=[],this.set=[],this.make()}hasMagic(){if(this.options.magicalBraces&&this.set.length>1)return!0;for(const t of this.set)for(const n of t)if(typeof n!="string")return!0;return!1}debug(){}make(){const t=this.pattern,n=this.options;if(!n.nocomment&&t.charAt(0)==="#")return void(this.comment=!0);if(!t)return void(this.empty=!0);this.parseNegate(),this.globSet=[...new Set(this.braceExpand())],n.debug&&(this.debug=function(){return console.error(...arguments)}),this.debug(this.pattern,this.globSet);const r=this.globSet.map(i=>this.slashSplit(i));this.globParts=this.preprocess(r),this.debug(this.pattern,this.globParts);let s=this.globParts.map((i,c,u)=>{if(this.isWindows&&this.windowsNoMagicRoot){const m=!(i[0]!==""||i[1]!==""||i[2]!=="?"&&$e.test(i[2])||$e.test(i[3])),h=/^[a-z]:/i.test(i[0]);if(m)return[...i.slice(0,4),...i.slice(4).map(o=>this.parse(o))];if(h)return[i[0],...i.slice(1).map(o=>this.parse(o))]}return i.map(m=>this.parse(m))});if(this.debug(this.pattern,s),this.set=s.filter(i=>i.indexOf(!1)===-1),this.isWindows)for(let i=0;i<this.set.length;i++){const c=this.set[i];c[0]===""&&c[1]===""&&this.globParts[i][2]==="?"&&typeof c[3]=="string"&&/^[a-z]:$/i.test(c[3])&&(c[2]="?")}this.debug(this.pattern,this.set)}preprocess(t){if(this.options.noglobstar)for(let r=0;r<t.length;r++)for(let s=0;s<t[r].length;s++)t[r][s]==="**"&&(t[r][s]="*");const{optimizationLevel:n=1}=this.options;return n>=2?(t=this.firstPhasePreProcess(t),t=this.secondPhasePreProcess(t)):t=n>=1?this.levelOneOptimize(t):this.adjascentGlobstarOptimize(t),t}adjascentGlobstarOptimize(t){return t.map(n=>{let r=-1;for(;(r=n.indexOf("**",r+1))!==-1;){let s=r;for(;n[s+1]==="**";)s++;s!==r&&n.splice(r,s-r)}return n})}levelOneOptimize(t){return t.map(n=>(n=n.reduce((r,s)=>{const i=r[r.length-1];return s==="**"&&i==="**"?r:s===".."&&i&&i!==".."&&i!=="."&&i!=="**"?(r.pop(),r):(r.push(s),r)},[])).length===0?[""]:n)}levelTwoFileOptimize(t){Array.isArray(t)||(t=this.slashSplit(t));let n=!1;do{if(n=!1,!this.preserveMultipleSlashes){for(let s=1;s<t.length-1;s++){const i=t[s];s===1&&i===""&&t[0]===""||i!=="."&&i!==""||(n=!0,t.splice(s,1),s--)}t[0]!=="."||t.length!==2||t[1]!=="."&&t[1]!==""||(n=!0,t.pop())}let r=0;for(;(r=t.indexOf("..",r+1))!==-1;){const s=t[r-1];s&&s!=="."&&s!==".."&&s!=="**"&&(n=!0,t.splice(r-1,2),r-=2)}}while(n);return t.length===0?[""]:t}firstPhasePreProcess(t){let n=!1;do{n=!1;for(let r of t){let s=-1;for(;(s=r.indexOf("**",s+1))!==-1;){let c=s;for(;r[c+1]==="**";)c++;c>s&&r.splice(s+1,c-s);let u=r[s+1];const m=r[s+2],h=r[s+3];if(u!==".."||!m||m==="."||m===".."||!h||h==="."||h==="..")continue;n=!0,r.splice(s,1);const o=r.slice(0);o[s]="**",t.push(o),s--}if(!this.preserveMultipleSlashes){for(let c=1;c<r.length-1;c++){const u=r[c];c===1&&u===""&&r[0]===""||u!=="."&&u!==""||(n=!0,r.splice(c,1),c--)}r[0]!=="."||r.length!==2||r[1]!=="."&&r[1]!==""||(n=!0,r.pop())}let i=0;for(;(i=r.indexOf("..",i+1))!==-1;){const c=r[i-1];if(c&&c!=="."&&c!==".."&&c!=="**"){n=!0;const u=i===1&&r[i+1]==="**"?["."]:[];r.splice(i-1,2,...u),r.length===0&&r.push(""),i-=2}}}}while(n);return t}secondPhasePreProcess(t){for(let n=0;n<t.length-1;n++)for(let r=n+1;r<t.length;r++){const s=this.partsMatch(t[n],t[r],!this.preserveMultipleSlashes);if(s){t[n]=[],t[r]=s;break}}return t.filter(n=>n.length)}partsMatch(t,n){let r=arguments.length>2&&arguments[2]!==void 0&&arguments[2],s=0,i=0,c=[],u="";for(;s<t.length&&i<n.length;)if(t[s]===n[i])c.push(u==="b"?n[i]:t[s]),s++,i++;else if(r&&t[s]==="**"&&n[i]===t[s+1])c.push(t[s]),s++;else if(r&&n[i]==="**"&&t[s]===n[i+1])c.push(n[i]),i++;else if(t[s]!=="*"||!n[i]||!this.options.dot&&n[i].startsWith(".")||n[i]==="**"){if(n[i]!=="*"||!t[s]||!this.options.dot&&t[s].startsWith(".")||t[s]==="**"||u==="a")return!1;u="b",c.push(n[i]),s++,i++}else{if(u==="b")return!1;u="a",c.push(t[s]),s++,i++}return t.length===n.length&&c}parseNegate(){if(this.nonegate)return;const t=this.pattern;let n=!1,r=0;for(let s=0;s<t.length&&t.charAt(s)==="!";s++)n=!n,r++;r&&(this.pattern=t.slice(r)),this.negate=n}matchOne(t,n){let r=arguments.length>2&&arguments[2]!==void 0&&arguments[2];const s=this.options;if(this.isWindows){const g=typeof t[0]=="string"&&/^[a-z]:$/i.test(t[0]),v=!g&&t[0]===""&&t[1]===""&&t[2]==="?"&&/^[a-z]:$/i.test(t[3]),A=typeof n[0]=="string"&&/^[a-z]:$/i.test(n[0]),p=v?3:g?0:void 0,y=!A&&n[0]===""&&n[1]===""&&n[2]==="?"&&typeof n[3]=="string"&&/^[a-z]:$/i.test(n[3])?3:A?0:void 0;if(typeof p=="number"&&typeof y=="number"){const[x,E]=[t[p],n[y]];x.toLowerCase()===E.toLowerCase()&&(n[y]=x,y>p?n=n.slice(y):p>y&&(t=t.slice(p)))}}const{optimizationLevel:i=1}=this.options;i>=2&&(t=this.levelTwoFileOptimize(t)),this.debug("matchOne",this,{file:t,pattern:n}),this.debug("matchOne",t.length,n.length);for(var c=0,u=0,m=t.length,h=n.length;c<m&&u<h;c++,u++){this.debug("matchOne loop");var o=n[u],l=t[c];if(this.debug(n,o,l),o===!1)return!1;if(o===Q){this.debug("GLOBSTAR",[n,o,l]);var a=c,d=u+1;if(d===h){for(this.debug("** at the end");c<m;c++)if(t[c]==="."||t[c]===".."||!s.dot&&t[c].charAt(0)===".")return!1;return!0}for(;a<m;){var f=t[a];if(this.debug(`
|
|
globstar while`,t,a,n,d,f),this.matchOne(t.slice(a),n.slice(d),r))return this.debug("globstar found match!",a,m,f),!0;if(f==="."||f===".."||!s.dot&&f.charAt(0)==="."){this.debug("dot detected!",t,a,n,d);break}this.debug("globstar swallow a segment, and continue"),a++}return!(!r||(this.debug(`
|
|
>>> no match, partial?`,t,a,n,d),a!==m))}let g;if(typeof o=="string"?(g=l===o,this.debug("string match",o,l,g)):(g=o.test(l),this.debug("pattern match",o,l,g)),!g)return!1}if(c===m&&u===h)return!0;if(c===m)return r;if(u===h)return c===m-1&&t[c]==="";throw new Error("wtf?")}braceExpand(){return Ke(this.pattern,this.options)}parse(t){Ct(t);const n=this.options;if(t==="**")return Q;if(t==="")return"";let r,s=null;(r=t.match(er))?s=n.dot?rr:nr:(r=t.match(Wn))?s=(n.nocase?n.dot?Yn:Xn:n.dot?Hn:Gn)(r[1]):(r=t.match(sr))?s=(n.nocase?n.dot?ir:or:n.dot?ar:ur)(r):(r=t.match(Jn))?s=n.dot?Zn:Kn:(r=t.match(Qn))&&(s=tr);const i=H.fromGlob(t,this.options).toMMPattern();return s&&typeof i=="object"&&Reflect.defineProperty(i,"test",{value:s}),i}makeRe(){if(this.regexp||this.regexp===!1)return this.regexp;const t=this.set;if(!t.length)return this.regexp=!1,this.regexp;const n=this.options,r=n.noglobstar?"[^/]*?":n.dot?"(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?":"(?:(?!(?:\\/|^)\\.).)*?",s=new Set(n.nocase?["i"]:[]);let i=t.map(m=>{const h=m.map(o=>{if(o instanceof RegExp)for(const l of o.flags.split(""))s.add(l);return typeof o=="string"?o.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"):o===Q?Q:o._src});return h.forEach((o,l)=>{const a=h[l+1],d=h[l-1];o===Q&&d!==Q&&(d===void 0?a!==void 0&&a!==Q?h[l+1]="(?:\\/|"+r+"\\/)?"+a:h[l]=r:a===void 0?h[l-1]=d+"(?:\\/|"+r+")?":a!==Q&&(h[l-1]=d+"(?:\\/|\\/"+r+"\\/)"+a,h[l+1]=Q))}),h.filter(o=>o!==Q).join("/")}).join("|");const[c,u]=t.length>1?["(?:",")"]:["",""];i="^"+c+i+u+"$",this.negate&&(i="^(?!"+i+").+$");try{this.regexp=new RegExp(i,[...s].join(""))}catch{this.regexp=!1}return this.regexp}slashSplit(t){return this.preserveMultipleSlashes?t.split("/"):this.isWindows&&/^\/\/[^\/]+/.test(t)?["",...t.split(/\/+/)]:t.split(/\/+/)}match(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.partial;if(this.debug("match",t,this.pattern),this.comment)return!1;if(this.empty)return t==="";if(t==="/"&&n)return!0;const r=this.options;this.isWindows&&(t=t.split("\\").join("/"));const s=this.slashSplit(t);this.debug(this.pattern,"split",s);const i=this.set;this.debug(this.pattern,"set",i);let c=s[s.length-1];if(!c)for(let u=s.length-2;!c&&u>=0;u--)c=s[u];for(let u=0;u<i.length;u++){const m=i[u];let h=s;if(r.matchBase&&m.length===1&&(h=[c]),this.matchOne(h,m,n))return!!r.flipNegate||!this.negate}return!r.flipNegate&&this.negate}static defaults(t){return G.defaults(t).Minimatch}}function ne(e){const t=new Error(`${arguments.length>1&&arguments[1]!==void 0?arguments[1]:""}Invalid response: ${e.status} ${e.statusText}`);return t.status=e.status,t.response=e,t}function B(e,t){const{status:n}=t;if(n===401&&e.digest)return t;if(n>=400)throw ne(t);return t}function ct(e,t){return arguments.length>2&&arguments[2]!==void 0&&arguments[2]?{data:t,headers:e.headers?In(e.headers):{},status:e.status,statusText:e.statusText}:t}G.AST=H,G.Minimatch=$t,G.escape=function(e){let{windowsPathsNoEscape:t=!1}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return t?e.replace(/[?*()[\]]/g,"[$&]"):e.replace(/[?*()[\]\\]/g,"\\$&")},G.unescape=gt;const cr=(_e=function(e,t,n){let r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};const s=U({url:k(e.remoteURL,I(t)),method:"COPY",headers:{Destination:k(e.remoteURL,I(n)),Overwrite:r.overwrite===!1?"F":"T",Depth:r.shallow?"0":"infinity"}},e,r);return c=function(u){B(e,u)},(i=F(s,e))&&i.then||(i=Promise.resolve(i)),c?i.then(c):i;var i,c},function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];try{return Promise.resolve(_e.apply(this,e))}catch(n){return Promise.reject(n)}});var _e,re=_(635),lr=_(829),rt=_.n(lr),lt=function(e){return e.Array="array",e.Object="object",e.Original="original",e}(lt||{});function At(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:lt.Original;const r=rt().get(e,t);return n==="array"&&Array.isArray(r)===!1?[r]:n==="object"&&Array.isArray(r)?r[0]:r}function yt(e){return new Promise(t=>{t(function(n){const{multistatus:r}=n;if(r==="")return{multistatus:{response:[]}};if(!r)throw new Error("Invalid response: No root multistatus found");const s={multistatus:Array.isArray(r)?r[0]:r};return rt().set(s,"multistatus.response",At(s,"multistatus.response",lt.Array)),rt().set(s,"multistatus.response",rt().get(s,"multistatus.response").map(i=>function(c){const u=Object.assign({},c);return u.status?rt().set(u,"status",At(u,"status",lt.Object)):(rt().set(u,"propstat",At(u,"propstat",lt.Object)),rt().set(u,"propstat.prop",At(u,"propstat.prop",lt.Object))),u}(i))),s}(new re.XMLParser({allowBooleanAttributes:!0,attributeNamePrefix:"",textNodeName:"text",ignoreAttributes:!1,removeNSPrefix:!0,numberParseOptions:{hex:!0,leadingZeros:!1},attributeValueProcessor:(n,r,s)=>r==="true"||r==="false"?r==="true":r,tagValueProcessor(n,r,s){if(!s.endsWith("propstat.prop.displayname"))return r}}).parse(e)))})}function It(e,t){let n=arguments.length>2&&arguments[2]!==void 0&&arguments[2];const{getlastmodified:r=null,getcontentlength:s="0",resourcetype:i=null,getcontenttype:c=null,getetag:u=null}=e,m=i&&typeof i=="object"&&i.collection!==void 0?"directory":"file",h={filename:t,basename:Ot().basename(t),lastmod:r,size:parseInt(s,10),type:m,etag:typeof u=="string"?u.replace(/"/g,""):null};return m==="file"&&(h.mime=c&&typeof c=="string"?c.split(";")[0]:""),n&&(e.displayname!==void 0&&(e.displayname=String(e.displayname)),h.props=e),h}function Ze(e,t){let n=arguments.length>2&&arguments[2]!==void 0&&arguments[2],r=null;try{e.multistatus.response[0].propstat&&(r=e.multistatus.response[0])}catch{}if(!r)throw new Error("Failed getting item stat: bad response");const{propstat:{prop:s,status:i}}=r,[c,u,m]=i.split(" ",3),h=parseInt(u,10);if(h>=400){const o=new Error(`Invalid response: ${h} ${m}`);throw o.status=h,o}return It(s,vt(t),n)}function Qe(e){switch(String(e)){case"-3":return"unlimited";case"-2":case"-1":return"unknown";default:return parseInt(String(e),10)}}function Bt(e,t,n){return n?t?t(e):e:(e&&e.then||(e=Promise.resolve(e)),t?e.then(t):e)}const se=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{return Promise.resolve(e.apply(this,t))}catch(r){return Promise.reject(r)}}}(function(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const{details:r=!1}=n,s=U({url:k(e.remoteURL,I(t)),method:"PROPFIND",headers:{Accept:"text/plain,application/xml",Depth:"0"}},e,n);return Bt(F(s,e),function(i){return B(e,i),Bt(i.text(),function(c){return Bt(yt(c),function(u){const m=Ze(u,t,r);return ct(i,m,r)})})})});function tn(e,t,n){return n?t?t(e):e:(e&&e.then||(e=Promise.resolve(e)),t?e.then(t):e)}const hr=en(function(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const r=function(i){if(!i||i==="/")return[];let c=i;const u=[];do u.push(c),c=Ot().dirname(c);while(c&&c!=="/");return u}(vt(t));r.sort((i,c)=>i.length>c.length?1:c.length>i.length?-1:0);let s=!1;return function(i,c,u){if(typeof i[Ie]=="function"){let g=function(v){try{for(;!(m=l.next()).done;)if((v=c(m.value))&&v.then){if(!ke(v))return void v.then(g,o||(o=Y.bind(null,h=new ht,2)));v=v.v}h?Y(h,1,v):h=v}catch(A){Y(h||(h=new ht),2,A)}};var m,h,o,l=i[Ie]();if(g(),l.return){var a=function(v){try{m.done||l.return()}catch{}return v};if(h&&h.then)return h.then(a,function(v){throw a(v)});a()}return h}if(!("length"in i))throw new TypeError("Object is not iterable");for(var d=[],f=0;f<i.length;f++)d.push(i[f]);return function(g,v,A){var p,y,x=-1;return function E(w){try{for(;++x<g.length&&(!A||!A());)if((w=v(x))&&w.then){if(!ke(w))return void w.then(E,y||(y=Y.bind(null,p=new ht,2)));w=w.v}p?Y(p,1,w):p=w}catch(P){Y(p||(p=new ht),2,P)}}(),p}(d,function(g){return c(d[g])},u)}(r,function(i){return c=function(){return function(m,h){try{var o=tn(se(e,i),function(l){if(l.type!=="directory")throw new Error(`Path includes a file: ${t}`)})}catch(l){return h(l)}return o&&o.then?o.then(void 0,h):o}(0,function(m){const h=m;return function(){if(h.status===404)return s=!0,Re(Xt(e,i,{...n,recursive:!1}));throw m}()})},(u=function(){if(s)return Re(Xt(e,i,{...n,recursive:!1}))}())&&u.then?u.then(c):c();var c,u},function(){return!1})});function en(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{return Promise.resolve(e.apply(this,t))}catch(r){return Promise.reject(r)}}}function pr(){}function Re(e,t){return e&&e.then?e.then(pr):Promise.resolve()}const Ie=typeof Symbol<"u"?Symbol.iterator||(Symbol.iterator=Symbol("Symbol.iterator")):"@@iterator";function Y(e,t,n){if(!e.s){if(n instanceof ht){if(!n.s)return void(n.o=Y.bind(null,e,t));1&t&&(t=n.s),n=n.v}if(n&&n.then)return void n.then(Y.bind(null,e,t),Y.bind(null,e,2));e.s=t,e.v=n;const r=e.o;r&&r(e)}}const ht=function(){function e(){}return e.prototype.then=function(t,n){const r=new e,s=this.s;if(s){const i=1&s?t:n;if(i){try{Y(r,1,i(this.v))}catch(c){Y(r,2,c)}return r}return this}return this.o=function(i){try{const c=i.v;1&i.s?Y(r,1,t?t(c):c):n?Y(r,1,n(c)):Y(r,2,c)}catch(c){Y(r,2,c)}},r},e}();function ke(e){return e instanceof ht&&1&e.s}const Xt=en(function(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(n.recursive===!0)return hr(e,t,n);const r=U({url:k(e.remoteURL,(s=I(t),s.endsWith("/")?s:s+"/")),method:"MKCOL"},e,n);var s;return tn(F(r,e),function(i){B(e,i)})});var fr=_(388),Le=_.n(fr);const dr=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{return Promise.resolve(e.apply(this,t))}catch(r){return Promise.reject(r)}}}(function(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const r={};if(typeof n.range=="object"&&typeof n.range.start=="number"){let u=`bytes=${n.range.start}-`;typeof n.range.end=="number"&&(u=`${u}${n.range.end}`),r.Range=u}const s=U({url:k(e.remoteURL,I(t)),method:"GET",headers:r},e,n);return c=function(u){if(B(e,u),r.Range&&u.status!==206){const m=new Error(`Invalid response code for partial request: ${u.status}`);throw m.status=u.status,m}return n.callback&&setTimeout(()=>{n.callback(u)},0),u.body},(i=F(s,e))&&i.then||(i=Promise.resolve(i)),c?i.then(c):i;var i,c}),gr=()=>{},mr=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{return Promise.resolve(e.apply(this,t))}catch(r){return Promise.reject(r)}}}(function(e,t,n){n.url||(n.url=k(e.remoteURL,I(t)));const r=U(n,e,{});return i=function(c){return B(e,c),c},(s=F(r,e))&&s.then||(s=Promise.resolve(s)),i?s.then(i):s;var s,i}),vr=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{return Promise.resolve(e.apply(this,t))}catch(r){return Promise.reject(r)}}}(function(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const r=U({url:k(e.remoteURL,I(t)),method:"DELETE"},e,n);return i=function(c){B(e,c)},(s=F(r,e))&&s.then||(s=Promise.resolve(s)),i?s.then(i):s;var s,i}),yr=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{return Promise.resolve(e.apply(this,t))}catch(r){return Promise.reject(r)}}}(function(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return function(r,s){try{var i=(c=se(e,t,n),u=function(){return!0},m?u?u(c):c:(c&&c.then||(c=Promise.resolve(c)),u?c.then(u):c))}catch(h){return s(h)}var c,u,m;return i&&i.then?i.then(void 0,s):i}(0,function(r){if(r.status===404)return!1;throw r})});function Vt(e,t,n){return n?t?t(e):e:(e&&e.then||(e=Promise.resolve(e)),t?e.then(t):e)}const wr=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{return Promise.resolve(e.apply(this,t))}catch(r){return Promise.reject(r)}}}(function(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const r=U({url:k(e.remoteURL,I(t),"/"),method:"PROPFIND",headers:{Accept:"text/plain,application/xml",Depth:n.deep?"infinity":"1"}},e,n);return Vt(F(r,e),function(s){return B(e,s),Vt(s.text(),function(i){if(!i)throw new Error("Failed parsing directory contents: Empty response");return Vt(yt(i),function(c){const u=xe(t);let m=function(h,o,l){let a=arguments.length>3&&arguments[3]!==void 0&&arguments[3],d=arguments.length>4&&arguments[4]!==void 0&&arguments[4];const f=Ot().join(o,"/"),{multistatus:{response:g}}=h,v=g.map(A=>{const p=function(x){try{return x.replace(/^https?:\/\/[^\/]+/,"")}catch(E){throw new J(E,"Failed normalising HREF")}}(A.href),{propstat:{prop:y}}=A;return It(y,f==="/"?decodeURIComponent(vt(p)):vt(Ot().relative(decodeURIComponent(f),decodeURIComponent(p))),a)});return d?v:v.filter(A=>A.basename&&(A.type==="file"||A.filename!==l.replace(/\/$/,"")))}(c,xe(e.remoteBasePath||e.remotePath),u,n.details,n.includeSelf);return n.glob&&(m=function(h,o){return h.filter(l=>G(l.filename,o,{matchBase:!0}))}(m,n.glob)),ct(s,m,n.details)})})})});function oe(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{return Promise.resolve(e.apply(this,t))}catch(r){return Promise.reject(r)}}}const br=oe(function(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const r=U({url:k(e.remoteURL,I(t)),method:"GET",headers:{Accept:"text/plain"},transformResponse:[Er]},e,n);return _t(F(r,e),function(s){return B(e,s),_t(s.text(),function(i){return ct(s,i,n.details)})})});function _t(e,t,n){return n?t?t(e):e:(e&&e.then||(e=Promise.resolve(e)),t?e.then(t):e)}const xr=oe(function(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const r=U({url:k(e.remoteURL,I(t)),method:"GET"},e,n);return _t(F(r,e),function(s){let i;return B(e,s),function(c,u){var m=c();return m&&m.then?m.then(u):u()}(function(){return _t(s.arrayBuffer(),function(c){i=c})},function(){return ct(s,i,n.details)})})}),Ar=oe(function(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const{format:r="binary"}=n;if(r!=="binary"&&r!=="text")throw new J({info:{code:st.InvalidOutputFormat}},`Invalid output format: ${r}`);return r==="text"?br(e,t,n):xr(e,t,n)}),Er=e=>e;function Nr(e){return new re.XMLBuilder({attributeNamePrefix:"@_",format:!0,ignoreAttributes:!1,suppressEmptyNode:!0}).build(nn({lockinfo:{"@_xmlns:d":"DAV:",lockscope:{exclusive:{}},locktype:{write:{}},owner:{href:e}}},"d"))}function nn(e,t){const n={...e};for(const r in n)n.hasOwnProperty(r)&&(n[r]&&typeof n[r]=="object"&&r.indexOf(":")===-1?(n[`${t}:${r}`]=nn(n[r],t),delete n[r]):/^@_/.test(r)===!1&&(n[`${t}:${r}`]=n[r],delete n[r]));return n}function Yt(e,t,n){return n?t?t(e):e:(e&&e.then||(e=Promise.resolve(e)),t?e.then(t):e)}function rn(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{return Promise.resolve(e.apply(this,t))}catch(r){return Promise.reject(r)}}}const Pr=rn(function(e,t,n){let r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};const s=U({url:k(e.remoteURL,I(t)),method:"UNLOCK",headers:{"Lock-Token":n}},e,r);return Yt(F(s,e),function(i){if(B(e,i),i.status!==204&&i.status!==200)throw ne(i)})}),Or=rn(function(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const{refreshToken:r,timeout:s=Tr}=n,i={Accept:"text/plain,application/xml",Timeout:s};r&&(i.If=r);const c=U({url:k(e.remoteURL,I(t)),method:"LOCK",headers:i,data:Nr(e.contactHref)},e,n);return Yt(F(c,e),function(u){return B(e,u),Yt(u.text(),function(m){const h=(a=m,new re.XMLParser({removeNSPrefix:!0,parseAttributeValue:!0,parseTagValue:!0}).parse(a)),o=rt().get(h,"prop.lockdiscovery.activelock.locktoken.href"),l=rt().get(h,"prop.lockdiscovery.activelock.timeout");var a;if(!o)throw ne(u,"No lock token received: ");return{token:o,serverTimeout:l}})})}),Tr="Infinite, Second-4100000000";function zt(e,t,n){return n?t?t(e):e:(e&&e.then||(e=Promise.resolve(e)),t?e.then(t):e)}const jr=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{return Promise.resolve(e.apply(this,t))}catch(r){return Promise.reject(r)}}}(function(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const n=t.path||"/",r=U({url:k(e.remoteURL,n),method:"PROPFIND",headers:{Accept:"text/plain,application/xml",Depth:"0"}},e,t);return zt(F(r,e),function(s){return B(e,s),zt(s.text(),function(i){return zt(yt(i),function(c){const u=function(m){try{const[h]=m.multistatus.response,{propstat:{prop:{"quota-used-bytes":o,"quota-available-bytes":l}}}=h;return o!==void 0&&l!==void 0?{used:parseInt(String(o),10),available:Qe(l)}:null}catch{}return null}(c);return ct(s,u,t.details)})})})});function qt(e,t,n){return n?t?t(e):e:(e&&e.then||(e=Promise.resolve(e)),t?e.then(t):e)}const Sr=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{return Promise.resolve(e.apply(this,t))}catch(r){return Promise.reject(r)}}}(function(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const{details:r=!1}=n,s=U({url:k(e.remoteURL,I(t)),method:"SEARCH",headers:{Accept:"text/plain,application/xml","Content-Type":e.headers["Content-Type"]||"application/xml; charset=utf-8"}},e,n);return qt(F(s,e),function(i){return B(e,i),qt(i.text(),function(c){return qt(yt(c),function(u){const m=function(h,o,l){const a={truncated:!1,results:[]};return a.truncated=h.multistatus.response.some(d=>(d.status||d.propstat?.status).split(" ",3)?.[1]==="507"&&d.href.replace(/\/$/,"").endsWith(I(o).replace(/\/$/,""))),h.multistatus.response.forEach(d=>{if(d.propstat===void 0)return;const f=d.href.split("/").map(decodeURIComponent).join("/");a.results.push(It(d.propstat.prop,f,l))}),a}(u,t,r);return ct(i,m,r)})})})}),Cr=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{return Promise.resolve(e.apply(this,t))}catch(r){return Promise.reject(r)}}}(function(e,t,n){let r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};const s=U({url:k(e.remoteURL,I(t)),method:"MOVE",headers:{Destination:k(e.remoteURL,I(n)),Overwrite:r.overwrite===!1?"F":"T"}},e,r);return c=function(u){B(e,u)},(i=F(s,e))&&i.then||(i=Promise.resolve(i)),c?i.then(c):i;var i,c});var $r=_(172);const _r=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{return Promise.resolve(e.apply(this,t))}catch(r){return Promise.reject(r)}}}(function(e,t,n){let r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};const{contentLength:s=!0,overwrite:i=!0}=r,c={"Content-Type":"application/octet-stream"};s===!1||(c["Content-Length"]=typeof s=="number"?`${s}`:`${function(o){if(We(o))return o.byteLength;if(Ge(o))return o.length;if(typeof o=="string")return(0,$r.d)(o);throw new J({info:{code:st.DataTypeNoLength}},"Cannot calculate data length: Invalid type")}(n)}`),i||(c["If-None-Match"]="*");const u=U({url:k(e.remoteURL,I(t)),method:"PUT",headers:c,data:n},e,r);return h=function(o){try{B(e,o)}catch(l){const a=l;if(a.status!==412||i)throw a;return!1}return!0},(m=F(u,e))&&m.then||(m=Promise.resolve(m)),h?m.then(h):m;var m,h}),sn=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{return Promise.resolve(e.apply(this,t))}catch(r){return Promise.reject(r)}}}(function(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const r=U({url:k(e.remoteURL,I(t)),method:"OPTIONS"},e,n);return i=function(c){try{B(e,c)}catch(u){throw u}return{compliance:(c.headers.get("DAV")??"").split(",").map(u=>u.trim()),server:c.headers.get("Server")??""}},(s=F(r,e))&&s.then||(s=Promise.resolve(s)),i?s.then(i):s;var s,i});function mt(e,t,n){return n?t?t(e):e:(e&&e.then||(e=Promise.resolve(e)),t?e.then(t):e)}const Rr=ie(function(e,t,n,r,s){let i=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{};if(n>r||n<0)throw new J({info:{code:st.InvalidUpdateRange}},`Invalid update range ${n} for partial update`);const c={"Content-Type":"application/octet-stream","Content-Length":""+(r-n+1),"Content-Range":`bytes ${n}-${r}/*`},u=U({url:k(e.remoteURL,I(t)),method:"PUT",headers:c,data:s},e,i);return mt(F(u,e),function(m){B(e,m)})});function De(e,t){var n=e();return n&&n.then?n.then(t):t(n)}const Ir=ie(function(e,t,n,r,s){let i=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{};if(n>r||n<0)throw new J({info:{code:st.InvalidUpdateRange}},`Invalid update range ${n} for partial update`);const c={"Content-Type":"application/x-sabredav-partialupdate","Content-Length":""+(r-n+1),"X-Update-Range":`bytes=${n}-${r}`},u=U({url:k(e.remoteURL,I(t)),method:"PATCH",headers:c,data:s},e,i);return mt(F(u,e),function(m){B(e,m)})});function ie(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{return Promise.resolve(e.apply(this,t))}catch(r){return Promise.reject(r)}}}const kr=ie(function(e,t,n,r,s){let i=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{};return mt(sn(e,t,i),function(c){let u=!1;return De(function(){if(c.compliance.includes("sabredav-partialupdate"))return mt(Ir(e,t,n,r,s,i),function(m){return u=!0,m})},function(m){let h=!1;return u?m:De(function(){if(c.server.includes("Apache")&&c.compliance.includes("<http://apache.org/dav/propset/fs/1>"))return mt(Rr(e,t,n,r,s,i),function(o){return h=!0,o})},function(o){if(h)return o;throw new J({info:{code:st.NotSupported}},"Not supported")})})})}),Lr="https://github.com/perry-mitchell/webdav-client/blob/master/LOCK_CONTACT.md";function Dr(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const{authType:n=null,remoteBasePath:r,contactHref:s=Lr,ha1:i,headers:c={},httpAgent:u,httpsAgent:m,password:h,token:o,username:l,withCredentials:a}=t;let d=n;d||(d=l||h?X.Password:X.None);const f={authType:d,remoteBasePath:r,contactHref:s,ha1:i,headers:Object.assign({},c),httpAgent:u,httpsAgent:m,password:h,remotePath:Pn(e),remoteURL:e,token:o,username:l,withCredentials:a};return Ve(f,l,h,o,i),{copyFile:(g,v,A)=>cr(f,g,v,A),createDirectory:(g,v)=>Xt(f,g,v),createReadStream:(g,v)=>function(A,p){let y=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const x=new(Le()).PassThrough;return dr(A,p,y).then(E=>{E.pipe(x)}).catch(E=>{x.emit("error",E)}),x}(f,g,v),createWriteStream:(g,v,A)=>function(p,y){let x=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},E=arguments.length>3&&arguments[3]!==void 0?arguments[3]:gr;const w=new(Le()).PassThrough,P={};x.overwrite===!1&&(P["If-None-Match"]="*");const b=U({url:k(p.remoteURL,I(y)),method:"PUT",headers:P,data:w,maxRedirects:0},p,x);return F(b,p).then(O=>B(p,O)).then(O=>{setTimeout(()=>{E(O)},0)}).catch(O=>{w.emit("error",O)}),w}(f,g,v,A),customRequest:(g,v)=>mr(f,g,v),deleteFile:(g,v)=>vr(f,g,v),exists:(g,v)=>yr(f,g,v),getDirectoryContents:(g,v)=>wr(f,g,v),getFileContents:(g,v)=>Ar(f,g,v),getFileDownloadLink:g=>function(v,A){let p=k(v.remoteURL,I(A));const y=/^https:/i.test(p)?"https":"http";switch(v.authType){case X.None:break;case X.Password:{const x=Ee(v.headers.Authorization.replace(/^Basic /i,"").trim());p=p.replace(/^https?:\/\//,`${y}://${x}@`);break}default:throw new J({info:{code:st.LinkUnsupportedAuthType}},`Unsupported auth type for file link: ${v.authType}`)}return p}(f,g),getFileUploadLink:g=>function(v,A){let p=`${k(v.remoteURL,I(A))}?Content-Type=application/octet-stream`;const y=/^https:/i.test(p)?"https":"http";switch(v.authType){case X.None:break;case X.Password:{const x=Ee(v.headers.Authorization.replace(/^Basic /i,"").trim());p=p.replace(/^https?:\/\//,`${y}://${x}@`);break}default:throw new J({info:{code:st.LinkUnsupportedAuthType}},`Unsupported auth type for file link: ${v.authType}`)}return p}(f,g),getHeaders:()=>Object.assign({},f.headers),getQuota:g=>jr(f,g),lock:(g,v)=>Or(f,g,v),moveFile:(g,v,A)=>Cr(f,g,v,A),putFileContents:(g,v,A)=>_r(f,g,v,A),partialUpdateFileContents:(g,v,A,p,y)=>kr(f,g,v,A,p,y),getDAVCompliance:g=>sn(f,g),search:(g,v)=>Sr(f,g,v),setHeaders:g=>{f.headers=Object.assign({},g)},stat:(g,v)=>se(f,g,v),unlock:(g,v,A)=>Pr(f,g,v,A)}}tt.hT,tt.O4,tt.Kd,tt.YK;var Mr=tt.UU,Fr=tt.Gu;tt.ky,tt.h4,tt.ch,tt.hq,tt.i5;function Ur(e){return e&&e.split("/").map(encodeURIComponent).join("/")}const Pt=pn().setApp("@nextcloud/files").detectUser().build();var ae=(e=>(e.Folder="folder",e.File="file",e))(ae||{}),et=(e=>(e[e.NONE=0]="NONE",e[e.CREATE=4]="CREATE",e[e.READ=1]="READ",e[e.UPDATE=2]="UPDATE",e[e.DELETE=8]="DELETE",e[e.SHARE=16]="SHARE",e[e.ALL=31]="ALL",e))(et||{});const on=function(e,t){return e.match(t)!==null},ot=(e,t)=>{if(e.id&&typeof e.id!="number")throw new Error("Invalid id type of value");if(!e.source)throw new Error("Missing mandatory source");try{new URL(e.source)}catch{throw new Error("Invalid source format, source must be a valid URL")}if(!e.source.startsWith("http"))throw new Error("Invalid source format, only http(s) is supported");if(e.displayname&&typeof e.displayname!="string")throw new Error("Invalid displayname type");if(e.mtime&&!(e.mtime instanceof Date))throw new Error("Invalid mtime type");if(e.crtime&&!(e.crtime instanceof Date))throw new Error("Invalid crtime type");if(!e.mime||typeof e.mime!="string"||!e.mime.match(/^[-\w.]+\/[-+\w.]+$/gi))throw new Error("Missing or invalid mandatory mime");if("size"in e&&typeof e.size!="number"&&e.size!==void 0)throw new Error("Invalid size type");if("permissions"in e&&e.permissions!==void 0&&!(typeof e.permissions=="number"&&e.permissions>=et.NONE&&e.permissions<=et.ALL))throw new Error("Invalid permissions");if(e.owner&&e.owner!==null&&typeof e.owner!="string")throw new Error("Invalid owner type");if(e.attributes&&typeof e.attributes!="object")throw new Error("Invalid attributes type");if(e.root&&typeof e.root!="string")throw new Error("Invalid root type");if(e.root&&!e.root.startsWith("/"))throw new Error("Root must start with a leading slash");if(e.root&&!e.source.includes(e.root))throw new Error("Root must be part of the source");if(e.root&&on(e.source,t)){const n=e.source.match(t)[0];if(!e.source.includes(ut.join(n,e.root)))throw new Error("The root must be relative to the service. e.g /files/emma")}if(e.status&&!Object.values(ue).includes(e.status))throw new Error("Status must be a valid NodeStatus")};var ue=(e=>(e.NEW="new",e.FAILED="failed",e.LOADING="loading",e.LOCKED="locked",e))(ue||{});class kt{_data;_attributes;_knownDavService=/(remote|public)\.php\/(web)?dav/i;readonlyAttributes=Object.entries(Object.getOwnPropertyDescriptors(kt.prototype)).filter(t=>typeof t[1].get=="function"&&t[0]!=="__proto__").map(t=>t[0]);handler={set:(t,n,r)=>this.readonlyAttributes.includes(n)?!1:Reflect.set(t,n,r),deleteProperty:(t,n)=>this.readonlyAttributes.includes(n)?!1:Reflect.deleteProperty(t,n),get:(t,n,r)=>this.readonlyAttributes.includes(n)?(Pt.warn(`Accessing "Node.attributes.${n}" is deprecated, access it directly on the Node instance.`),Reflect.get(this,n)):Reflect.get(t,n,r)};constructor(t,n){t.mime||(t.mime="application/octet-stream"),ot(t,n||this._knownDavService),this._data={displayname:t.attributes?.displayname,...t,attributes:{}},this._attributes=new Proxy(this._data.attributes,this.handler),this.update(t.attributes??{}),n&&(this._knownDavService=n)}get source(){return this._data.source.replace(/\/$/i,"")}get encodedSource(){const{origin:t}=new URL(this.source);return t+Ur(this.source.slice(t.length))}get basename(){return ut.basename(this.source)}get displayname(){return this._data.displayname||this.basename}set displayname(t){ot({...this._data,displayname:t},this._knownDavService),this._data.displayname=t}get extension(){return ut.extname(this.source)}get dirname(){if(this.root){let n=this.source;this.isDavResource&&(n=n.split(this._knownDavService).pop());const r=n.indexOf(this.root),s=this.root.replace(/\/$/,"");return ut.dirname(n.slice(r+s.length)||"/")}const t=new URL(this.source);return ut.dirname(t.pathname)}get mime(){return this._data.mime||"application/octet-stream"}set mime(t){t??="application/octet-stream",ot({...this._data,mime:t},this._knownDavService),this._data.mime=t}get mtime(){return this._data.mtime}set mtime(t){ot({...this._data,mtime:t},this._knownDavService),this._data.mtime=t}get crtime(){return this._data.crtime}get size(){return this._data.size}set size(t){ot({...this._data,size:t},this._knownDavService),this.updateMtime(),this._data.size=t}get attributes(){return this._attributes}get permissions(){return this.owner===null&&!this.isDavResource?et.READ:this._data.permissions!==void 0?this._data.permissions:et.NONE}set permissions(t){ot({...this._data,permissions:t},this._knownDavService),this.updateMtime(),this._data.permissions=t}get owner(){return this.isDavResource?this._data.owner:null}get isDavResource(){return on(this.source,this._knownDavService)}get isDavRessource(){return this.isDavResource}get root(){return this._data.root?this._data.root.replace(/^(.+)\/$/,"$1"):this.isDavResource&&ut.dirname(this.source).split(this._knownDavService).pop()||null}get path(){if(this.root){let t=this.source;this.isDavResource&&(t=t.split(this._knownDavService).pop());const n=t.indexOf(this.root),r=this.root.replace(/\/$/,"");return t.slice(n+r.length)||"/"}return(this.dirname+"/"+this.basename).replace(/\/\//g,"/")}get fileid(){return this._data?.id}get status(){return this._data?.status}set status(t){ot({...this._data,status:t},this._knownDavService),this._data.status=t}get data(){return structuredClone(this._data)}move(t){ot({...this._data,source:t},this._knownDavService);const n=this.basename;this._data.source=t,this.displayname===n&&this.basename!==n&&(this.displayname=this.basename)}rename(t){if(t.includes("/"))throw new Error("Invalid basename");this.move(ut.dirname(this.source)+"/"+t)}updateMtime(){this._data.mtime&&(this._data.mtime=new Date)}update(t){for(const[n,r]of Object.entries(t))try{r===void 0?delete this.attributes[n]:this.attributes[n]=r}catch(s){if(s instanceof TypeError)continue;throw s}}}class ce extends kt{get type(){return ae.File}clone(){return new ce(this.data)}}class le extends kt{constructor(t){super({...t,mime:"httpd/unix-directory"})}get type(){return ae.Folder}get extension(){return null}get mime(){return"httpd/unix-directory"}clone(){return new le(this.data)}}const Br=function(e=""){let t=et.NONE;return e&&((e.includes("C")||e.includes("K"))&&(t|=et.CREATE),e.includes("G")&&(t|=et.READ),(e.includes("W")||e.includes("N")||e.includes("V"))&&(t|=et.UPDATE),e.includes("D")&&(t|=et.DELETE),e.includes("R")&&(t|=et.SHARE)),t},an=["d:getcontentlength","d:getcontenttype","d:getetag","d:getlastmodified","d:creationdate","d:displayname","d:quota-available-bytes","d:resourcetype","nc:has-preview","nc:is-encrypted","nc:mount-type","oc:comments-unread","oc:favorite","oc:fileid","oc:owner-display-name","oc:owner-id","oc:permissions","oc:size"],un={d:"DAV:",nc:"http://nextcloud.org/ns",oc:"http://owncloud.org/ns",ocs:"http://open-collaboration-services.org/ns"},Jr=function(e,t={nc:"http://nextcloud.org/ns"}){typeof window._nc_dav_properties>"u"&&(window._nc_dav_properties=[...an],window._nc_dav_namespaces={...un});const n={...window._nc_dav_namespaces,...t};if(window._nc_dav_properties.find(s=>s===e))return Pt.warn(`${e} already registered`,{prop:e}),!1;if(e.startsWith("<")||e.split(":").length!==2)return Pt.error(`${e} is not valid. See example: 'oc:fileid'`,{prop:e}),!1;const r=e.split(":")[0];return n[r]?(window._nc_dav_properties.push(e),window._nc_dav_namespaces=n,!0):(Pt.error(`${e} namespace unknown`,{prop:e,namespaces:n}),!1)},he=function(){return typeof window._nc_dav_properties>"u"&&(window._nc_dav_properties=[...an]),window._nc_dav_properties.map(e=>`<${e} />`).join(" ")},pe=function(){return typeof window._nc_dav_namespaces>"u"&&(window._nc_dav_namespaces={...un}),Object.keys(window._nc_dav_namespaces).map(e=>`xmlns:${e}="${window._nc_dav_namespaces?.[e]}"`).join(" ")},Kr=function(){return`<?xml version="1.0"?>
|
|
<d:propfind ${pe()}>
|
|
<d:prop>
|
|
${he()}
|
|
</d:prop>
|
|
</d:propfind>`},Vr=function(){return`<?xml version="1.0"?>
|
|
<oc:filter-files ${pe()}>
|
|
<d:prop>
|
|
${he()}
|
|
</d:prop>
|
|
<oc:filter-rules>
|
|
<oc:favorite>1</oc:favorite>
|
|
</oc:filter-rules>
|
|
</oc:filter-files>`},Zr=function(e){return`<?xml version="1.0" encoding="UTF-8"?>
|
|
<d:searchrequest ${pe()}
|
|
xmlns:ns="https://github.com/icewind1991/SearchDAV/ns">
|
|
<d:basicsearch>
|
|
<d:select>
|
|
<d:prop>
|
|
${he()}
|
|
</d:prop>
|
|
</d:select>
|
|
<d:from>
|
|
<d:scope>
|
|
<d:href>/files/${Jt()?.uid}/</d:href>
|
|
<d:depth>infinity</d:depth>
|
|
</d:scope>
|
|
</d:from>
|
|
<d:where>
|
|
<d:and>
|
|
<d:or>
|
|
<d:not>
|
|
<d:eq>
|
|
<d:prop>
|
|
<d:getcontenttype/>
|
|
</d:prop>
|
|
<d:literal>httpd/unix-directory</d:literal>
|
|
</d:eq>
|
|
</d:not>
|
|
<d:eq>
|
|
<d:prop>
|
|
<oc:size/>
|
|
</d:prop>
|
|
<d:literal>0</d:literal>
|
|
</d:eq>
|
|
</d:or>
|
|
<d:gt>
|
|
<d:prop>
|
|
<d:getlastmodified/>
|
|
</d:prop>
|
|
<d:literal>${e}</d:literal>
|
|
</d:gt>
|
|
</d:and>
|
|
</d:where>
|
|
<d:orderby>
|
|
<d:order>
|
|
<d:prop>
|
|
<d:getlastmodified/>
|
|
</d:prop>
|
|
<d:descending/>
|
|
</d:order>
|
|
</d:orderby>
|
|
<d:limit>
|
|
<d:nresults>100</d:nresults>
|
|
<ns:firstresult>0</ns:firstresult>
|
|
</d:limit>
|
|
</d:basicsearch>
|
|
</d:searchrequest>`};function zr(){return Kt()?`/files/${mn()}`:`/files/${Jt()?.uid}`}const cn=zr();function qr(){const e=gn("dav");return Kt()?e.replace("remote.php","public.php"):e}const ln=qr(),Qr=function(e=ln,t={}){const n=Mr(e,{headers:t});function r(s){n.setHeaders({...t,"X-Requested-With":"XMLHttpRequest",requesttoken:s??""})}return dn(r),r(fn()),Fr().patch("fetch",(s,i)=>{const c=i.headers;return c?.method&&(i.method=c.method,delete c.method),fetch(s,i)}),n},ts=(e,t="/",n=cn)=>{const r=new AbortController;return new nt(async(s,i,c)=>{c(()=>r.abort());try{const u=(await e.getDirectoryContents(`${n}${t}`,{signal:r.signal,details:!0,data:Vr(),headers:{method:"REPORT"},includeSelf:!0})).data.filter(m=>m.filename!==t).map(m=>Wr(m,n));s(u)}catch(u){i(u)}})},Wr=function(e,t=cn,n=ln){let r=Jt()?.uid;if(Kt())r=r??"anonymous";else if(!r)throw new Error("No user id found");const s=e.props,i=Br(s?.permissions),c=String(s?.["owner-id"]||r),u=s.fileid||0,m=new Date(Date.parse(e.lastmod)),h=new Date(Date.parse(s.creationdate)),o={id:u,source:`${n}${e.filename}`,mtime:!isNaN(m.getTime())&&m.getTime()!==0?m:void 0,crtime:!isNaN(h.getTime())&&h.getTime()!==0?h:void 0,mime:e.mime||"application/octet-stream",displayname:s.displayname!==void 0?String(s.displayname):void 0,size:s?.size||Number.parseInt(s.getcontentlength||"0"),status:u<0?ue.FAILED:void 0,permissions:i,owner:c,root:t,attributes:{...e,...s,hasPreview:s?.["has-preview"]}};return delete o.attributes?.props,e.type==="file"?new ce(o):new le(o)};export{nt as C,ce as F,et as P,zr as a,ts as b,ae as c,cn as d,Zr as e,Wr as f,Qr as g,Kr as h,Pt as l,Jr as r};
|
|
//# sourceMappingURL=dav-CQDyL7M_-DQpu_A9F.chunk.mjs.map
|