import{p as mt,g as be,o as fr,a as pr}from"./modulepreload-polyfill-DE-oIJqv.chunk.mjs";import{p as ut}from"./_plugin-vue2_normalizer-CQ6iBklL-hCHD4uyV.chunk.mjs";import{g as dr}from"./index-Bc2S5k6V.chunk.mjs";import{U as gr}from"./index-BGFdrNqh.chunk.mjs";import{g as wt}from"./vue.runtime.esm-DO2cz8pp.chunk.mjs";import{i as ye,d as mr,f as vr,g as jn}from"./public-BYOpgJit.chunk.mjs";function br(n){return n&&n.split("/").map(encodeURIComponent).join("/")}function st(n,t,e){return t in n?Object.defineProperty(n,t,{value:e,enumerable:!0,configurable:!0,writable:!0}):n[t]=e,n}function ke(n,t,e){yr(n,t),t.set(n,e)}function yr(n,t){if(t.has(n))throw new TypeError("Cannot initialize the same private elements twice on an object")}function X(n,t){var e=_n(n,t,"get");return wr(n,e)}function wr(n,t){return t.get?t.get.call(n):t.value}function Me(n,t,e){var r=_n(n,t,"set");return Er(n,r,e),e}function _n(n,t,e){if(!t.has(n))throw new TypeError("attempted to "+e+" private field on non-instance");return t.get(n)}function Er(n,t,e){if(t.set)t.set.call(n,e);else{if(!t.writable)throw new TypeError("attempted to set read only private field");t.value=e}}var xr=typeof Symbol<"u"?Symbol.toStringTag:"@@toStringTag",W=new WeakMap,ft=new WeakMap;class Lt{constructor(t){var{executor:e=()=>{},internals:r=Ee(),promise:l=new Promise((u,f)=>e(u,f,a=>{r.onCancelList.push(a)}))}=t;ke(this,W,{writable:!0,value:void 0}),ke(this,ft,{writable:!0,value:void 0}),st(this,xr,"CancelablePromise"),this.cancel=this.cancel.bind(this),Me(this,W,r),Me(this,ft,l||new Promise((u,f)=>e(u,f,a=>{r.onCancelList.push(a)})))}then(t,e){return Ot(X(this,ft).then(Et(t,X(this,W)),Et(e,X(this,W))),X(this,W))}catch(t){return Ot(X(this,ft).catch(Et(t,X(this,W))),X(this,W))}finally(t,e){return e&&X(this,W).onCancelList.push(t),Ot(X(this,ft).finally(Et(()=>{if(t)return e&&(X(this,W).onCancelList=X(this,W).onCancelList.filter(r=>r!==t)),t()},X(this,W))),X(this,W))}cancel(){X(this,W).isCanceled=!0;var t=X(this,W).onCancelList;X(this,W).onCancelList=[];for(var e of t)if(typeof e=="function")try{e()}catch(r){console.error(r)}}isCanceled(){return X(this,W).isCanceled===!0}}class nt extends Lt{constructor(t){super({executor:t})}}st(nt,"all",function(n){return xt(n,Promise.all(n))}),st(nt,"allSettled",function(n){return xt(n,Promise.allSettled(n))}),st(nt,"any",function(n){return xt(n,Promise.any(n))}),st(nt,"race",function(n){return xt(n,Promise.race(n))}),st(nt,"resolve",function(n){return Ue(Promise.resolve(n))}),st(nt,"reject",function(n){return Ue(Promise.reject(n))}),st(nt,"isCancelable",we);function Ue(n){return Ot(n,Ee())}function we(n){return n instanceof nt||n instanceof Lt}function Et(n,t){if(n)return e=>{if(!t.isCanceled){var r=n(e);return we(r)&&t.onCancelList.push(r.cancel),r}return e}}function Ot(n,t){return new Lt({internals:t,promise:n})}function xt(n,t){var e=Ee();return e.onCancelList.push(()=>{for(var r of n)we(r)&&r.cancel()}),new Lt({internals:e,promise:t})}function Ee(){return{isCanceled:!1,onCancelList:[]}}var Dt={},Nr={2:n=>{function t(l,u,f){l instanceof RegExp&&(l=e(l,f)),u instanceof RegExp&&(u=e(u,f));var a=r(l,u,f);return a&&{start:a[0],end:a[1],pre:f.slice(0,a[0]),body:f.slice(a[0]+l.length,a[1]),post:f.slice(a[1]+u.length)}}function e(l,u){var f=u.match(l);return f?f[0]:null}function r(l,u,f){var a,s,i,o,h,c=f.indexOf(l),g=f.indexOf(u,c+1),d=c;if(c>=0&&g>0){for(a=[],i=f.length;d>=0&&!h;)d==c?(a.push(d),c=f.indexOf(l,d+1)):a.length==1?h=[a.pop(),g]:((s=a.pop())=0?c:g;a.length&&(h=[i,o])}return h}n.exports=t,t.range=r},101:function(n,t,e){var r;n=e.nmd(n),function(l){var u=(n&&n.exports,typeof wt=="object"&&wt);u.global!==u&&u.window;var f=function(h){this.message=h};(f.prototype=new Error).name="InvalidCharacterError";var a=function(h){throw new f(h)},s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",i=/[\t\n\f\r ]/g,o={encode:function(h){h=String(h),/[^\0-\xFF]/.test(h)&&a("The string to be encoded contains characters outside of the Latin1 range.");for(var c,g,d,m,w=h.length%3,y="",p=-1,b=h.length-w;++p>18&63)+s.charAt(m>>12&63)+s.charAt(m>>6&63)+s.charAt(63&m);return w==2?(c=h.charCodeAt(p)<<8,g=h.charCodeAt(++p),y+=s.charAt((m=c+g)>>10)+s.charAt(m>>4&63)+s.charAt(m<<2&63)+"="):w==1&&(m=h.charCodeAt(p),y+=s.charAt(m>>2)+s.charAt(m<<4&63)+"=="),y},decode:function(h){var c=(h=String(h).replace(i,"")).length;c%4==0&&(c=(h=h.replace(/==?$/,"")).length),(c%4==1||/[^+a-zA-Z0-9/]/.test(h))&&a("Invalid character: the string to be decoded is not correctly encoded.");for(var g,d,m=0,w="",y=-1;++y>(-2*m&6)));return w},version:"1.0.0"};(r=function(){return o}.call(t,e,t,n))===void 0||(n.exports=r)}()},172:(n,t)=>{t.d=function(e){if(!e)return 0;for(var r=(e=e.toString()).length,l=e.length;l--;){var u=e.charCodeAt(l);56320<=u&&u<=57343&&l--,127{var t={utf8:{stringToBytes:function(e){return t.bin.stringToBytes(unescape(encodeURIComponent(e)))},bytesToString:function(e){return decodeURIComponent(escape(t.bin.bytesToString(e)))}},bin:{stringToBytes:function(e){for(var r=[],l=0;l{var t,e;t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",e={rotl:function(r,l){return r<>>32-l},rotr:function(r,l){return r<<32-l|r>>>l},endian:function(r){if(r.constructor==Number)return 16711935&e.rotl(r,8)|4278255360&e.rotl(r,24);for(var l=0;l0;r--)l.push(Math.floor(256*Math.random()));return l},bytesToWords:function(r){for(var l=[],u=0,f=0;u>>5]|=r[u]<<24-f%32;return l},wordsToBytes:function(r){for(var l=[],u=0;u<32*r.length;u+=8)l.push(r[u>>>5]>>>24-u%32&255);return l},bytesToHex:function(r){for(var l=[],u=0;u>>4).toString(16)),l.push((15&r[u]).toString(16));return l.join("")},hexToBytes:function(r){for(var l=[],u=0;u>>6*(3-a)&63)):l.push("=");return l.join("")},base64ToBytes:function(r){r=r.replace(/[^A-Z0-9+\/]/gi,"");for(var l=[],u=0,f=0;u>>6-2*f);return l}},n.exports=e},635:(n,t,e)=>{const r=e(31),l=e(338),u=e(221);n.exports={XMLParser:l,XMLValidator:r,XMLBuilder:u}},118:n=>{n.exports=function(t){return typeof t=="function"?t:Array.isArray(t)?e=>{for(const r of t)if(typeof r=="string"&&e===r||r instanceof RegExp&&r.test(e))return!0}:()=>!1}},705:(n,t)=>{const e=":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="["+e+"]["+e+"\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*",l=new RegExp("^"+r+"$");t.isExist=function(u){return u!==void 0},t.isEmptyObject=function(u){return Object.keys(u).length===0},t.merge=function(u,f,a){if(f){const s=Object.keys(f),i=s.length;for(let o=0;o{const r=e(705),l={allowBooleanAttributes:!1,unpairedTags:[]};function u(p){return p===" "||p===" "||p===` `||p==="\r"}function f(p,b){const A=b;for(;b5&&E==="xml")return d("InvalidXml","XML declaration allowed only at the start of the document.",w(p,b));if(p[b]=="?"&&p[b+1]==">"){b++;break}}return b}function a(p,b){if(p.length>b+5&&p[b+1]==="-"&&p[b+2]==="-"){for(b+=3;b"){b+=2;break}}else if(p.length>b+8&&p[b+1]==="D"&&p[b+2]==="O"&&p[b+3]==="C"&&p[b+4]==="T"&&p[b+5]==="Y"&&p[b+6]==="P"&&p[b+7]==="E"){let A=1;for(b+=8;b"&&(A--,A===0))break}else if(p.length>b+9&&p[b+1]==="["&&p[b+2]==="C"&&p[b+3]==="D"&&p[b+4]==="A"&&p[b+5]==="T"&&p[b+6]==="A"&&p[b+7]==="["){for(b+=8;b"){b+=2;break}}return b}t.validate=function(p,b){b=Object.assign({},l,b);const A=[];let E=!1,v=!1;p[0]==="\uFEFF"&&(p=p.substr(1));for(let x=0;x"&&p[x]!==" "&&p[x]!==" "&&p[x]!==` `&&p[x]!=="\r";x++)I+=p[x];if(I=I.trim(),I[I.length-1]==="/"&&(I=I.substring(0,I.length-1),x--),N=I,!r.isName(N)){let R;return R=I.trim().length===0?"Invalid space after '<'.":"Tag '"+I+"' is an invalid name.",d("InvalidTag",R,w(p,x))}const $=o(p,x);if($===!1)return d("InvalidAttr","Attributes for '"+I+"' have open quote.",w(p,x));let T=$.value;if(x=$.index,T[T.length-1]==="/"){const R=x-T.length;T=T.substring(0,T.length-1);const S=c(T,b);if(S!==!0)return d(S.err.code,S.err.msg,w(p,R+S.err.line));E=!0}else if(P){if(!$.tagClosed)return d("InvalidTag","Closing tag '"+I+"' doesn't have proper closing.",w(p,x));if(T.trim().length>0)return d("InvalidTag","Closing tag '"+I+"' can't have attributes or invalid starting.",w(p,O));if(A.length===0)return d("InvalidTag","Closing tag '"+I+"' has not been opened.",w(p,O));{const R=A.pop();if(I!==R.tagName){let S=w(p,R.tagStartPos);return d("InvalidTag","Expected closing tag '"+R.tagName+"' (opened in line "+S.line+", col "+S.col+") instead of closing tag '"+I+"'.",w(p,O))}A.length==0&&(v=!0)}}else{const R=c(T,b);if(R!==!0)return d(R.err.code,R.err.msg,w(p,x-T.length+R.err.line));if(v===!0)return d("InvalidXml","Multiple possible root nodes found.",w(p,x));b.unpairedTags.indexOf(I)!==-1||A.push({tagName:I,tagStartPos:O}),E=!0}for(x++;x0)||d("InvalidXml","Invalid '"+JSON.stringify(A.map(x=>x.tagName),null,4).replace(/\r?\n/g,"")+"' found.",{line:1,col:1}):d("InvalidXml","Start tag expected.",1)};const s='"',i="'";function o(p,b){let A="",E="",v=!1;for(;b"&&E===""){v=!0;break}A+=p[b]}return E===""&&{value:A,index:b,tagClosed:v}}const h=new RegExp(`(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['"])(([\\s\\S])*?)\\5)?`,"g");function c(p,b){const A=r.getAllMatches(p,h),E={};for(let v=0;v{const r=e(87),l=e(118),u={attributeNamePrefix:"@_",attributesGroupName:!1,textNodeName:"#text",ignoreAttributes:!0,cdataPropName:!1,format:!1,indentBy:" ",suppressEmptyNode:!1,suppressUnpairedNode:!0,suppressBooleanAttributes:!0,tagValueProcessor:function(o,h){return h},attributeValueProcessor:function(o,h){return h},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 f(o){this.options=Object.assign({},u,o),this.options.ignoreAttributes===!0||this.options.attributesGroupName?this.isAttribute=function(){return!1}:(this.ignoreAttributesFn=l(this.options.ignoreAttributes),this.attrPrefixLen=this.options.attributeNamePrefix.length,this.isAttribute=i),this.processTextOrObjNode=a,this.options.format?(this.indentate=s,this.tagEndChar=`> `,this.newLine=` `):(this.indentate=function(){return""},this.tagEndChar=">",this.newLine="")}function a(o,h,c,g){const d=this.j2x(o,c+1,g.concat(h));return o[this.options.textNodeName]!==void 0&&Object.keys(o).length===1?this.buildTextValNode(o[this.options.textNodeName],h,d.attrStr,c):this.buildObjectNode(d.val,h,d.attrStr,c)}function s(o){return this.options.indentBy.repeat(o)}function i(o){return!(!o.startsWith(this.options.attributeNamePrefix)||o===this.options.textNodeName)&&o.substr(this.attrPrefixLen)}f.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)},f.prototype.j2x=function(o,h,c){let g="",d="";const m=c.join(".");for(let w in o)if(Object.prototype.hasOwnProperty.call(o,w))if(o[w]===void 0)this.isAttribute(w)&&(d+="");else if(o[w]===null)this.isAttribute(w)?d+="":w[0]==="?"?d+=this.indentate(h)+"<"+w+"?"+this.tagEndChar:d+=this.indentate(h)+"<"+w+"/"+this.tagEndChar;else if(o[w]instanceof Date)d+=this.buildTextValNode(o[w],w,"",h);else if(typeof o[w]!="object"){const y=this.isAttribute(w);if(y&&!this.ignoreAttributesFn(y,m))g+=this.buildAttrPairStr(y,""+o[w]);else if(!y)if(w===this.options.textNodeName){let p=this.options.tagValueProcessor(w,""+o[w]);d+=this.replaceEntitiesValue(p)}else d+=this.buildTextValNode(o[w],w,"",h)}else if(Array.isArray(o[w])){const y=o[w].length;let p="",b="";for(let A=0;A`+this.newLine:this.indentate(g)+"<"+h+c+m+this.tagEndChar+o+this.indentate(g)+d:this.indentate(g)+"<"+h+c+m+">"+o+d}},f.prototype.closeTag=function(o){let h="";return this.options.unpairedTags.indexOf(o)!==-1?this.options.suppressUnpairedNode||(h="/"):h=this.options.suppressEmptyNode?"/":`>`+this.newLine;if(this.options.commentPropName!==!1&&h===this.options.commentPropName)return this.indentate(g)+``+this.newLine;if(h[0]==="?")return this.indentate(g)+"<"+h+c+"?"+this.tagEndChar;{let d=this.options.tagValueProcessor(h,o);return d=this.replaceEntitiesValue(d),d===""?this.indentate(g)+"<"+h+c+this.closeTag(h)+this.tagEndChar:this.indentate(g)+"<"+h+c+">"+d+"0&&this.options.processEntities)for(let h=0;h{function t(f,a,s,i){let o="",h=!1;for(let c=0;c`,h=!1;continue}if(d===a.commentPropName){o+=i+``,h=!0;continue}if(d[0]==="?"){const b=r(g[":@"],a),A=d==="?xml"?"":i;let E=g[d][0][a.textNodeName];E=E.length!==0?" "+E:"",o+=A+`<${d}${E}${b}?>`,h=!0;continue}let w=i;w!==""&&(w+=a.indentBy);const y=i+`<${d}${r(g[":@"],a)}`,p=t(g[d],a,m,w);a.unpairedTags.indexOf(d)!==-1?a.suppressUnpairedNode?o+=y+">":o+=y+"/>":p&&p.length!==0||!a.suppressEmptyNode?p&&p.endsWith(">")?o+=y+`>${p}${i}`:(o+=y+">",p&&i!==""&&(p.includes("/>")||p.includes("`):o+=y+"/>",h=!0}return o}function e(f){const a=Object.keys(f);for(let s=0;s0&&a.processEntities)for(let s=0;s0&&(s=` `),t(f,a,"",s)}},193:(n,t,e)=>{const r=e(705);function l(h,c){let g="";for(;c"){if(w?h[c-1]==="-"&&h[c-2]==="-"&&(w=!1,d--):d--,d===0)break}else h[c]==="["?m=!0:y+=h[c];else{if(m&&f(h,c)){let p,b;c+=7,[p,b,c]=l(h,c+1),b.indexOf("&")===-1&&(g[o(p)]={regx:RegExp(`&${p};`,"g"),val:b})}else if(m&&a(h,c))c+=8;else if(m&&s(h,c))c+=8;else if(m&&i(h,c))c+=9;else{if(!u)throw new Error("Invalid DOCTYPE");w=!0}d++,y=""}if(d!==0)throw new Error("Unclosed DOCTYPE")}return{entities:g,i:c}}},63:(n,t)=>{const e={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,l){return l},attributeValueProcessor:function(r,l){return l},stopNodes:[],alwaysCreateTextNode:!1,isArray:()=>!1,commentPropName:!1,unpairedTags:[],processEntities:!0,htmlEntities:!1,ignoreDeclaration:!1,ignorePiTags:!1,transformTagName:!1,transformAttributeName:!1,updateTag:function(r,l,u){return r}};t.buildOptions=function(r){return Object.assign({},e,r)},t.defaultOptions=e},299:(n,t,e)=>{const r=e(705),l=e(365),u=e(193),f=e(494),a=e(118);function s(v){const N=Object.keys(v);for(let x=0;x0)){$||(v=this.replaceEntitiesValue(v));const T=this.options.tagValueProcessor(N,v,x,P,I);return T==null?v:typeof T!=typeof v||T!==v?T:this.options.trimValues||v.trim()===v?E(v,this.options.parseTagValue,this.options.numberParseOptions):v}}function o(v){if(this.options.removeNSPrefix){const N=v.split(":"),x=v.charAt(0)==="/"?"/":"";if(N[0]==="xmlns")return"";N.length===2&&(v=x+N[1])}return v}const h=new RegExp(`([^\\s=]+)\\s*(=\\s*(['"])([\\s\\S]*?)\\3)?`,"gm");function c(v,N,x){if(this.options.ignoreAttributes!==!0&&typeof v=="string"){const O=r.getAllMatches(v,h),P=O.length,I={};for(let $=0;$",I,"Closing Tag is not closed.");let T=v.substring(I+2,$).trim();if(this.options.removeNSPrefix){const C=T.indexOf(":");C!==-1&&(T=T.substr(C+1))}this.options.transformTagName&&(T=this.options.transformTagName(T)),x&&(O=this.saveTextToParentTag(O,x,P));const R=P.substring(P.lastIndexOf(".")+1);if(T&&this.options.unpairedTags.indexOf(T)!==-1)throw new Error(`Unpaired tag can not be used as closing tag: `);let S=0;R&&this.options.unpairedTags.indexOf(R)!==-1?(S=P.lastIndexOf(".",P.lastIndexOf(".")-1),this.tagsNodeStack.pop()):S=P.lastIndexOf("."),P=P.substring(0,S),x=this.tagsNodeStack.pop(),O="",I=$}else if(v[I+1]==="?"){let $=b(v,I,!1,"?>");if(!$)throw new Error("Pi Tag is not closed.");if(O=this.saveTextToParentTag(O,x,P),!(this.options.ignoreDeclaration&&$.tagName==="?xml"||this.options.ignorePiTags)){const T=new l($.tagName);T.add(this.options.textNodeName,""),$.tagName!==$.tagExp&&$.attrExpPresent&&(T[":@"]=this.buildAttributesMap($.tagExp,P,$.tagName)),this.addChild(x,T,P)}I=$.closeIndex+1}else if(v.substr(I+1,3)==="!--"){const $=p(v,"-->",I+4,"Comment is not closed.");if(this.options.commentPropName){const T=v.substring(I+4,$-2);O=this.saveTextToParentTag(O,x,P),x.add(this.options.commentPropName,[{[this.options.textNodeName]:T}])}I=$}else if(v.substr(I+1,2)==="!D"){const $=u(v,I);this.docTypeEntities=$.entities,I=$.i}else if(v.substr(I+1,2)==="!["){const $=p(v,"]]>",I,"CDATA is not closed.")-2,T=v.substring(I+9,$);O=this.saveTextToParentTag(O,x,P);let R=this.parseTextData(T,x.tagname,P,!0,!1,!0,!0);R==null&&(R=""),this.options.cdataPropName?x.add(this.options.cdataPropName,[{[this.options.textNodeName]:T}]):x.add(this.options.textNodeName,R),I=$+2}else{let $=b(v,I,this.options.removeNSPrefix),T=$.tagName;const R=$.rawTagName;let S=$.tagExp,C=$.attrExpPresent,k=$.closeIndex;this.options.transformTagName&&(T=this.options.transformTagName(T)),x&&O&&x.tagname!=="!xml"&&(O=this.saveTextToParentTag(O,x,P,!1));const L=x;if(L&&this.options.unpairedTags.indexOf(L.tagname)!==-1&&(x=this.tagsNodeStack.pop(),P=P.substring(0,P.lastIndexOf("."))),T!==N.tagname&&(P+=P?"."+T:T),this.isItStopNode(this.options.stopNodes,P,T)){let _="";if(S.length>0&&S.lastIndexOf("/")===S.length-1)T[T.length-1]==="/"?(T=T.substr(0,T.length-1),P=P.substr(0,P.length-1),S=T):S=S.substr(0,S.length-1),I=$.closeIndex;else if(this.options.unpairedTags.indexOf(T)!==-1)I=$.closeIndex;else{const M=this.readStopNodeData(v,R,k+1);if(!M)throw new Error(`Unexpected end of ${R}`);I=M.i,_=M.tagContent}const z=new l(T);T!==S&&C&&(z[":@"]=this.buildAttributesMap(S,P,T)),_&&(_=this.parseTextData(_,T,P,!0,C,!0,!0)),P=P.substr(0,P.lastIndexOf(".")),z.add(this.options.textNodeName,_),this.addChild(x,z,P)}else{if(S.length>0&&S.lastIndexOf("/")===S.length-1){T[T.length-1]==="/"?(T=T.substr(0,T.length-1),P=P.substr(0,P.length-1),S=T):S=S.substr(0,S.length-1),this.options.transformTagName&&(T=this.options.transformTagName(T));const _=new l(T);T!==S&&C&&(_[":@"]=this.buildAttributesMap(S,P,T)),this.addChild(x,_,P),P=P.substr(0,P.lastIndexOf("."))}else{const _=new l(T);this.tagsNodeStack.push(x),T!==S&&C&&(_[":@"]=this.buildAttributesMap(S,P,T)),this.addChild(x,_,P),x=_}O="",I=k}}else O+=v[I];return N.child};function d(v,N,x){const O=this.options.updateTag(N.tagname,x,N[":@"]);O===!1||(typeof O=="string"&&(N.tagname=O),v.addChild(N))}const m=function(v){if(this.options.processEntities){for(let N in this.docTypeEntities){const x=this.docTypeEntities[N];v=v.replace(x.regx,x.val)}for(let N in this.lastEntities){const x=this.lastEntities[N];v=v.replace(x.regex,x.val)}if(this.options.htmlEntities)for(let N in this.htmlEntities){const x=this.htmlEntities[N];v=v.replace(x.regex,x.val)}v=v.replace(this.ampEntity.regex,this.ampEntity.val)}return v};function w(v,N,x,O){return v&&(O===void 0&&(O=Object.keys(N.child).length===0),(v=this.parseTextData(v,N.tagname,x,!1,!!N[":@"]&&Object.keys(N[":@"]).length!==0,O))!==void 0&&v!==""&&N.add(this.options.textNodeName,v),v=""),v}function y(v,N,x){const O="*."+x;for(const P in v){const I=v[P];if(O===I||N===I)return!0}return!1}function p(v,N,x,O){const P=v.indexOf(N,x);if(P===-1)throw new Error(O);return P+N.length-1}function b(v,N,x){const O=function(C,k){let L,_=arguments.length>2&&arguments[2]!==void 0?arguments[2]:">",z="";for(let M=k;M3&&arguments[3]!==void 0?arguments[3]:">");if(!O)return;let P=O.data;const I=O.index,$=P.search(/\s/);let T=P,R=!0;$!==-1&&(T=P.substring(0,$),P=P.substring($+1).trimStart());const S=T;if(x){const C=T.indexOf(":");C!==-1&&(T=T.substr(C+1),R=T!==O.data.substr(C+1))}return{tagName:T,tagExp:P,closeIndex:I,attrExpPresent:R,rawTagName:S}}function A(v,N,x){const O=x;let P=1;for(;x",x,`${N} is not closed`);if(v.substring(x+2,I).trim()===N&&(P--,P===0))return{tagContent:v.substring(O,x),i:I};x=I}else if(v[x+1]==="?")x=p(v,"?>",x+1,"StopNode is not closed.");else if(v.substr(x+1,3)==="!--")x=p(v,"-->",x+3,"StopNode is not closed.");else if(v.substr(x+1,2)==="![")x=p(v,"]]>",x,"StopNode is not closed.")-2;else{const I=b(v,x,">");I&&((I&&I.tagName)===N&&I.tagExp[I.tagExp.length-1]!=="/"&&P++,x=I.closeIndex)}}function E(v,N,x){if(N&&typeof v=="string"){const O=v.trim();return O==="true"||O!=="false"&&f(v,x)}return r.isExist(v)?v:""}n.exports=class{constructor(v){this.options=v,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:(N,x)=>String.fromCharCode(Number.parseInt(x,10))},num_hex:{regex:/&#x([0-9a-fA-F]{1,6});/g,val:(N,x)=>String.fromCharCode(Number.parseInt(x,16))}},this.addExternalEntities=s,this.parseXml=g,this.parseTextData=i,this.resolveNameSpace=o,this.buildAttributesMap=c,this.isItStopNode=y,this.replaceEntitiesValue=m,this.readStopNodeData=A,this.saveTextToParentTag=w,this.addChild=d,this.ignoreAttributesFn=a(this.options.ignoreAttributes)}}},338:(n,t,e)=>{const{buildOptions:r}=e(63),l=e(299),{prettify:u}=e(728),f=e(31);n.exports=class{constructor(a){this.externalEntities={},this.options=r(a)}parse(a,s){if(typeof a!="string"){if(!a.toString)throw new Error("XML data is accepted in String or Bytes[] form.");a=a.toString()}if(s){s===!0&&(s={});const h=f.validate(a,s);if(h!==!0)throw Error(`${h.err.msg}:${h.err.line}:${h.err.col}`)}const i=new l(this.options);i.addExternalEntities(this.externalEntities);const o=i.parseXml(a);return this.options.preserveOrder||o===void 0?o:u(o,this.options)}addEntity(a,s){if(s.indexOf("&")!==-1)throw new Error("Entity value can't have '&'");if(a.indexOf("&")!==-1||a.indexOf(";")!==-1)throw new Error("An entity must be set without '&' and ';'. Eg. use '#xD' for ' '");if(s==="&")throw new Error("An entity with value '&' is not permitted");this.externalEntities[a]=s}}},728:(n,t)=>{function e(f,a,s){let i;const o={};for(let h=0;h0&&(o[a.textNodeName]=i):i!==void 0&&(o[a.textNodeName]=i),o}function r(f){const a=Object.keys(f);for(let s=0;s{n.exports=class{constructor(t){this.tagname=t,this.child=[],this[":@"]={}}add(t,e){t==="__proto__"&&(t="#__proto__"),this.child.push({[t]:e})}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:n=>{function t(e){return!!e.constructor&&typeof e.constructor.isBuffer=="function"&&e.constructor.isBuffer(e)}n.exports=function(e){return e!=null&&(t(e)||function(r){return typeof r.readFloatLE=="function"&&typeof r.slice=="function"&&t(r.slice(0,0))}(e)||!!e._isBuffer)}},542:(n,t,e)=>{(function(){var r=e(298),l=e(526).utf8,u=e(135),f=e(526).bin,a=function(s,i){s.constructor==String?s=i&&i.encoding==="binary"?f.stringToBytes(s):l.stringToBytes(s):u(s)?s=Array.prototype.slice.call(s,0):Array.isArray(s)||s.constructor===Uint8Array||(s=s.toString());for(var o=r.bytesToWords(s),h=8*s.length,c=1732584193,g=-271733879,d=-1732584194,m=271733878,w=0;w>>24)|4278255360&(o[w]<<24|o[w]>>>8);o[h>>>5]|=128<>>9<<4)]=h;var y=a._ff,p=a._gg,b=a._hh,A=a._ii;for(w=0;w>>0,g=g+v>>>0,d=d+N>>>0,m=m+x>>>0}return r.endian([c,g,d,m])};a._ff=function(s,i,o,h,c,g,d){var m=s+(i&o|~i&h)+(c>>>0)+d;return(m<>>32-g)+i},a._gg=function(s,i,o,h,c,g,d){var m=s+(i&h|o&~h)+(c>>>0)+d;return(m<>>32-g)+i},a._hh=function(s,i,o,h,c,g,d){var m=s+(i^o^h)+(c>>>0)+d;return(m<>>32-g)+i},a._ii=function(s,i,o,h,c,g,d){var m=s+(o^(i|~h))+(c>>>0)+d;return(m<>>32-g)+i},a._blocksize=16,a._digestsize=16,n.exports=function(s,i){if(s==null)throw new Error("Illegal argument "+s);var o=r.wordsToBytes(a(s,i));return i&&i.asBytes?o:i&&i.asString?f.bytesToString(o):r.bytesToHex(o)}})()},285:(n,t,e)=>{var r=e(2);n.exports=function(y){return y?(y.substr(0,2)==="{}"&&(y="\\{\\}"+y.substr(2)),w(function(p){return p.split("\\\\").join(l).split("\\{").join(u).split("\\}").join(f).split("\\,").join(a).split("\\.").join(s)}(y),!0).map(o)):[]};var l="\0SLASH"+Math.random()+"\0",u="\0OPEN"+Math.random()+"\0",f="\0CLOSE"+Math.random()+"\0",a="\0COMMA"+Math.random()+"\0",s="\0PERIOD"+Math.random()+"\0";function i(y){return parseInt(y,10)==y?parseInt(y,10):y.charCodeAt(0)}function o(y){return y.split(l).join("\\").split(u).join("{").split(f).join("}").split(a).join(",").split(s).join(".")}function h(y){if(!y)return[""];var p=[],b=r("{","}",y);if(!b)return y.split(",");var A=b.pre,E=b.body,v=b.post,N=A.split(",");N[N.length-1]+="{"+E+"}";var x=h(v);return v.length&&(N[N.length-1]+=x.shift(),N.push.apply(N,x)),p.push.apply(p,N),p}function c(y){return"{"+y+"}"}function g(y){return/^-?0\d/.test(y)}function d(y,p){return y<=p}function m(y,p){return y>=p}function w(y,p){var b=[],A=r("{","}",y);if(!A)return[y];var E=A.pre,v=A.post.length?w(A.post,!1):[""];if(/\$$/.test(A.pre))for(var N=0;N=0;if(!T&&!R)return A.post.match(/,.*\}/)?w(y=A.pre+"{"+A.body+f+A.post):[y];if(T)O=A.body.split(/\.\./);else if((O=h(A.body)).length===1&&(O=w(O[0],!1).map(c)).length===1)return v.map(function(hr){return A.pre+O[0]+hr});if(T){var S=i(O[0]),C=i(O[1]),k=Math.max(O[0].length,O[1].length),L=O.length==3?Math.abs(i(O[2])):1,_=d;C0){var Fe=new Array(De+1).join("0");B=M<0?"-"+Fe+B.slice(1):Fe+B}}P.push(B)}}else{P=[];for(var at=0;at{function t(i){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(i)}function e(i){var o=typeof Map=="function"?new Map:void 0;return e=function(h){if(h===null||(c=h,Function.toString.call(c).indexOf("[native code]")===-1))return h;var c;if(typeof h!="function")throw new TypeError("Super expression must either be null or a function");if(o!==void 0){if(o.has(h))return o.get(h);o.set(h,g)}function g(){return r(h,arguments,u(this).constructor)}return g.prototype=Object.create(h.prototype,{constructor:{value:g,enumerable:!1,writable:!0,configurable:!0}}),l(g,h)},e(i)}function r(i,o,h){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(c,g,d){var m=[null];m.push.apply(m,g);var w=new(Function.bind.apply(c,m));return d&&l(w,d.prototype),w},r.apply(null,arguments)}function l(i,o){return l=Object.setPrototypeOf||function(h,c){return h.__proto__=c,h},l(i,o)}function u(i){return u=Object.setPrototypeOf?Object.getPrototypeOf:function(o){return o.__proto__||Object.getPrototypeOf(o)},u(i)}var f=function(i){function o(h){var c;return function(g,d){if(!(g instanceof d))throw new TypeError("Cannot call a class as a function")}(this,o),(c=function(g,d){return!d||t(d)!=="object"&&typeof d!="function"?function(m){if(m===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return m}(g):d}(this,u(o).call(this,h))).name="ObjectPrototypeMutationError",c}return function(h,c){if(typeof c!="function"&&c!==null)throw new TypeError("Super expression must either be null or a function");h.prototype=Object.create(c&&c.prototype,{constructor:{value:h,writable:!0,configurable:!0}}),c&&l(h,c)}(o,i),o}(e(Error));function a(i,o){for(var h=arguments.length>2&&arguments[2]!==void 0?arguments[2]:function(){},c=o.split("."),g=c.length,d=function(y){var p=c[y];if(!i)return{v:void 0};if(p==="+"){if(Array.isArray(i))return{v:i.map(function(A,E){var v=c.slice(y+1);return v.length>0?a(A,v.join("."),h):h(i,E,c,y)})};var b=c.slice(0,y).join(".");throw new Error("Object at wildcard (".concat(b,") is not an array"))}i=h(i,p,c,y)},m=0;m2&&arguments[2]!==void 0?arguments[2]:{};if(t(i)!="object"||i===null||o===void 0)return!1;if(typeof o=="number")return o in i;try{var c=!1;return a(i,o,function(g,d,m,w){if(!s(m,w))return g&&g[d];c=h.own?g.hasOwnProperty(d):d in g}),c}catch{return!1}},hasOwn:function(i,o,h){return this.has(i,o,h||{own:!0})},isIn:function(i,o,h){var c=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};if(t(i)!="object"||i===null||o===void 0)return!1;try{var g=!1,d=!1;return a(i,o,function(m,w,y,p){return g=g||m===h||!!m&&m[w]===h,d=s(y,p)&&t(m)==="object"&&w in m,m&&m[w]}),c.validPath?g&&d:g}catch{return!1}},ObjectPrototypeMutationError:f}},47:(n,t,e)=>{var r=e(410),l=function(i){return typeof i=="string"};function u(i,o){for(var h=[],c=0;c=-1&&!o;h--){var c=h>=0?arguments[h]:mt.cwd();if(!l(c))throw new TypeError("Arguments to path.resolve must be strings");c&&(i=c+"/"+i,o=c.charAt(0)==="/")}return(o?"/":"")+(i=u(i.split("/"),!o).join("/"))||"."},a.normalize=function(i){var o=a.isAbsolute(i),h=i.substr(-1)==="/";return(i=u(i.split("/"),!o).join("/"))||o||(i="."),i&&h&&(i+="/"),(o?"/":"")+i},a.isAbsolute=function(i){return i.charAt(0)==="/"},a.join=function(){for(var i="",o=0;o=0&&p[A]==="";A--);return b>A?[]:p.slice(b,A+1)}i=a.resolve(i).substr(1),o=a.resolve(o).substr(1);for(var c=h(i.split("/")),g=h(o.split("/")),d=Math.min(c.length,g.length),m=d,w=0;w{var e=Object.prototype.hasOwnProperty;function r(u){try{return decodeURIComponent(u.replace(/\+/g," "))}catch{return null}}function l(u){try{return encodeURIComponent(u)}catch{return null}}t.stringify=function(u,f){f=f||"";var a,s,i=[];for(s in typeof f!="string"&&(f="?"),u)if(e.call(u,s)){if((a=u[s])||a!=null&&!isNaN(a)||(a=""),s=l(s),a=l(a),s===null||a===null)continue;i.push(s+"="+a)}return i.length?f+i.join("&"):""},t.parse=function(u){for(var f,a=/([^=?#&]+)=?([^&]*)/g,s={};f=a.exec(u);){var i=r(f[1]),o=r(f[2]);i===null||o===null||i in s||(s[i]=o)}return s}},670:n=>{n.exports=function(t,e){if(e=e.split(":")[0],!(t=+t))return!1;switch(e){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:n=>{const t=/^[-+]?0x[a-fA-F0-9]+$/,e=/^([\-\+])?(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};n.exports=function(l){let u=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(u=Object.assign({},r,u),!l||typeof l!="string")return l;let f=l.trim();if(u.skipLike!==void 0&&u.skipLike.test(f))return l;if(u.hex&&t.test(f))return Number.parseInt(f,16);{const s=e.exec(f);if(s){const i=s[1],o=s[2];let h=((a=s[3])&&a.indexOf(".")!==-1&&((a=a.replace(/0+$/,""))==="."?a="0":a[0]==="."?a="0"+a:a[a.length-1]==="."&&(a=a.substr(0,a.length-1))),a);const c=s[4]||s[6];if(!u.leadingZeros&&o.length>0&&i&&f[2]!=="."||!u.leadingZeros&&o.length>0&&!i&&f[1]!==".")return l;{const g=Number(f),d=""+g;return d.search(/[eE]/)!==-1||c?u.eNotation?g:l:f.indexOf(".")!==-1?d==="0"&&h===""||d===h||i&&d==="-"+h?g:l:o?h===d||i+h===d?g:l:f===d||f===i+d?g:l}}return l}var a}},737:(n,t,e)=>{var r=e(670),l=e(647),u=/^[\x00-\x20\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]+/,f=/[\n\r\t]/g,a=/^[A-Za-z][A-Za-z0-9+-.]*:\/\//,s=/:\d+$/,i=/^([a-z][a-z0-9.+-]*:)?(\/\/)?([\\/]+)?([\S\s]*)/i,o=/^[a-zA-Z]:/;function h(p){return(p||"").toString().replace(u,"")}var c=[["#","hash"],["?","query"],function(p,b){return m(b.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]],g={hash:1,query:1};function d(p){var b,A=(typeof window<"u"?window:typeof wt<"u"?wt:typeof self<"u"?self:{}).location||{},E={},v=typeof(p=p||A);if(p.protocol==="blob:")E=new y(unescape(p.pathname),{});else if(v==="string")for(b in E=new y(p,{}),g)delete E[b];else if(v==="object"){for(b in p)b in g||(E[b]=p[b]);E.slashes===void 0&&(E.slashes=a.test(p.href))}return E}function m(p){return p==="file:"||p==="ftp:"||p==="http:"||p==="https:"||p==="ws:"||p==="wss:"}function w(p,b){p=(p=h(p)).replace(f,""),b=b||{};var A,E=i.exec(p),v=E[1]?E[1].toLowerCase():"",N=!!E[2],x=!!E[3],O=0;return N?x?(A=E[2]+E[3]+E[4],O=E[2].length+E[3].length):(A=E[2]+E[4],O=E[2].length):x?(A=E[3]+E[4],O=E[3].length):A=E[4],v==="file:"?O>=2&&(A=A.slice(2)):m(v)?A=E[4]:v?N&&(A=A.slice(2)):O>=2&&m(b.protocol)&&(A=E[4]),{protocol:v,slashes:N||m(v),slashesCount:O,rest:A}}function y(p,b,A){if(p=(p=h(p)).replace(f,""),!(this instanceof y))return new y(p,b,A);var E,v,N,x,O,P,I=c.slice(),$=typeof b,T=this,R=0;for($!=="object"&&$!=="string"&&(A=b,b=null),A&&typeof A!="function"&&(A=l.parse),E=!(v=w(p||"",b=d(b))).protocol&&!v.slashes,T.slashes=v.slashes||E&&b.slashes,T.protocol=v.protocol||b.protocol||"",p=v.rest,(v.protocol==="file:"&&(v.slashesCount!==2||o.test(p))||!v.slashes&&(v.protocol||v.slashesCount<2||!m(T.protocol)))&&(I[3]=[/(.*)/,"pathname"]);R{},388:()=>{},805:()=>{},345:()=>{},800:()=>{}},Ge={};function j(n){var t=Ge[n];if(t!==void 0)return t.exports;var e=Ge[n]={id:n,loaded:!1,exports:{}};return Nr[n].call(e.exports,e,e.exports,j),e.loaded=!0,e.exports}j.n=n=>{var t=n&&n.__esModule?()=>n.default:()=>n;return j.d(t,{a:t}),t},j.d=(n,t)=>{for(var e in t)j.o(t,e)&&!j.o(n,e)&&Object.defineProperty(n,e,{enumerable:!0,get:t[e]})},j.o=(n,t)=>Object.prototype.hasOwnProperty.call(n,t),j.nmd=n=>(n.paths=[],n.children||(n.children=[]),n);var tt={};j.d(tt,{hT:()=>Z,O4:()=>it,Kd:()=>Cr,YK:()=>Lr,UU:()=>Mi,Gu:()=>Mn,ky:()=>Hn,h4:()=>yt,ch:()=>jt,hq:()=>ct,i5:()=>Zn});var Ar=j(737),Or=j.n(Ar);function Ft(n){if(!pe(n))throw new Error("Parameter was not an error")}function pe(n){return!!n&&typeof n=="object"&&(t=n,Object.prototype.toString.call(t)==="[object Error]")||n instanceof Error;var t}class Y extends Error{constructor(t,e){const r=[...arguments],{options:l,shortMessage:u}=function(a){let s,i="";if(a.length===0)s={};else if(pe(a[0]))s={cause:a[0]},i=a.slice(1).join(" ")||"";else if(a[0]&&typeof a[0]=="object")s=Object.assign({},a[0]),i=a.slice(1).join(" ")||"";else{if(typeof a[0]!="string")throw new Error("Invalid arguments passed to Layerr");s={},i=i=a.join(" ")||""}return{options:s,shortMessage:i}}(r);let f=u;if(l.cause&&(f=`${f}: ${l.cause.message}`),super(f),this.message=f,l.name&&typeof l.name=="string"?this.name=l.name:this.name="Layerr",l.cause&&Object.defineProperty(this,"_cause",{value:l.cause}),Object.defineProperty(this,"_info",{value:{}}),l.info&&typeof l.info=="object"&&Object.assign(this._info,l.info),Error.captureStackTrace){const a=l.constructorOpt||this.constructor;Error.captureStackTrace(this,a)}}static cause(t){return Ft(t),t._cause&&pe(t._cause)?t._cause:null}static fullStack(t){Ft(t);const e=Y.cause(t);return e?`${t.stack} caused by: ${Y.fullStack(e)}`:t.stack??""}static info(t){Ft(t);const e={},r=Y.cause(t);return r&&Object.assign(e,Y.info(r)),t._info&&Object.assign(e,t._info),e}toString(){let t=this.name||this.constructor.name||this.constructor.prototype.name;return this.message&&(t=`${t}: ${this.message}`),t}}var Tr=j(47),Tt=j.n(Tr);const Ve="__PATH_SEPARATOR_POSIX__",Be="__PATH_SEPARATOR_WINDOWS__";function D(n){try{const t=n.replace(/\//g,Ve).replace(/\\\\/g,Be);return encodeURIComponent(t).split(Be).join("\\\\").split(Ve).join("/")}catch(t){throw new Y(t,"Failed encoding path")}}function Xe(n){return n.startsWith("/")?n:"/"+n}function bt(n){let t=n;return t[0]!=="/"&&(t="/"+t),/^.+\/$/.test(t)&&(t=t.substr(0,t.length-1)),t}function Pr(n){let t=new(Or())(n).pathname;return t.length<=0&&(t="/"),bt(t)}function F(){for(var n=arguments.length,t=new Array(n),e=0;e1){var u=r.shift();r[0]=u+r[0]}r[0].match(/^file:\/\/\//)?r[0]=r[0].replace(/^([^/:]+):\/*/,"$1:///"):r[0]=r[0].replace(/^([^/:]+):\/*/,"$1://");for(var f=0;f0&&(a=a.replace(/^[\/]+/,"")),a=f0?"?":"")+i.join("&")}(typeof arguments[0]=="object"?arguments[0]:[].slice.call(arguments))}(t.reduce((r,l,u)=>((u===0||l!=="/"||l==="/"&&r[r.length-1]!=="/")&&r.push(l),r),[]))}var Ir=j(542),pt=j.n(Ir);const $r="abcdef0123456789";function ze(n,t){const e=n.url.replace("//",""),r=e.indexOf("/")==-1?"/":e.slice(e.indexOf("/")),l=n.method?n.method.toUpperCase():"GET",u=!!/(^|,)\s*auth\s*($|,)/.test(t.qop)&&"auth",f=`00000000${t.nc}`.slice(-8),a=function(c,g,d,m,w,y,p){const b=p||pt()(`${g}:${d}:${m}`);return c&&c.toLowerCase()==="md5-sess"?pt()(`${b}:${w}:${y}`):b}(t.algorithm,t.username,t.realm,t.password,t.nonce,t.cnonce,t.ha1),s=pt()(`${l}:${r}`),i=u?pt()(`${a}:${t.nonce}:${f}:${t.cnonce}:${u}:${s}`):pt()(`${a}:${t.nonce}:${s}`),o={username:t.username,realm:t.realm,nonce:t.nonce,uri:r,qop:u,response:i,nc:f,cnonce:t.cnonce,algorithm:t.algorithm,opaque:t.opaque},h=[];for(const c in o)o[c]&&(c==="qop"||c==="nc"||c==="algorithm"?h.push(`${c}=${o[c]}`):h.push(`${c}="${o[c]}"`));return`Digest ${h.join(", ")}`}function Dn(n){return(n.headers&&n.headers.get("www-authenticate")||"").split(/\s/)[0].toLowerCase()==="digest"}var Rr=j(101),Fn=j.n(Rr);function We(n){return Fn().decode(n)}function qe(n,t){var e;return`Basic ${e=`${n}:${t}`,Fn().encode(e)}`}const Pt=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope?self:typeof window<"u"?window:globalThis,Sr=Pt.fetch.bind(Pt),Cr=Pt.Request,Lr=Pt.Response;let Z=function(n){return n.Auto="auto",n.Digest="digest",n.None="none",n.Password="password",n.Token="token",n}({}),it=function(n){return n.DataTypeNoLength="data-type-no-length",n.InvalidAuthType="invalid-auth-type",n.InvalidOutputFormat="invalid-output-format",n.LinkUnsupportedAuthType="link-unsupported-auth",n.InvalidUpdateRange="invalid-update-range",n.NotSupported="not-supported",n}({});function kn(n,t,e,r,l){switch(n.authType){case Z.Auto:t&&e&&(n.headers.Authorization=qe(t,e));break;case Z.Digest:n.digest=function(f,a,s){return{username:f,password:a,ha1:s,nc:0,algorithm:"md5",hasDigestAuth:!1}}(t,e,l);break;case Z.None:break;case Z.Password:n.headers.Authorization=qe(t,e);break;case Z.Token:n.headers.Authorization=`${(u=r).token_type} ${u.access_token}`;break;default:throw new Y({info:{code:it.InvalidAuthType}},`Invalid auth type: ${n.authType}`)}var u}j(345),j(800);const He="@@HOTPATCHER",jr=()=>{};function kt(n){return{original:n,methods:[n],final:!1}}class _r{constructor(){this._configuration={registry:{},getEmptyAction:"null"},this.__type__=He}get configuration(){return this._configuration}get getEmptyAction(){return this.configuration.getEmptyAction}set getEmptyAction(t){this.configuration.getEmptyAction=t}control(t){let e=arguments.length>1&&arguments[1]!==void 0&&arguments[1];if(!t||t.__type__!==He)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)?e&&(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 e=this.get(t)||jr;for(var r=arguments.length,l=new Array(r>1?r-1:0),u=1;u0;)i=[l.shift().apply(o,i)];return i[0]}}(...e.methods)}isPatched(t){return!!this.configuration.registry[t]}patch(t,e){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const{chain:l=!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 e!="function")throw new Error(`Failed patching '${t}': Provided method is not a function`);if(l)this.configuration.registry[t]?this.configuration.registry[t].methods.push(e):this.configuration.registry[t]=kt(e);else if(this.isPatched(t)){const{original:u}=this.configuration.registry[t];this.configuration.registry[t]=Object.assign(kt(e),{original:u})}else this.configuration.registry[t]=kt(e);return this}patchInline(t,e){this.isPatched(t)||this.patch(t,e);for(var r=arguments.length,l=new Array(r>2?r-2:0),u=2;u1?e-1:0),l=1;l{this.patch(t,u,{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 Mt=null;function Mn(){return Mt||(Mt=new _r),Mt}function It(n){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 e=t;for(;Object.getPrototypeOf(e)!==null;)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e}(n)?Object.assign({},n):Object.setPrototypeOf(Object.assign({},n),Object.getPrototypeOf(n))}function Ze(){for(var n=arguments.length,t=new Array(n),e=0;e0;){const u=l.shift();r=r?Un(r,u):It(u)}return r}function Un(n,t){const e=It(n);return Object.keys(t).forEach(r=>{e.hasOwnProperty(r)?Array.isArray(t[r])?e[r]=Array.isArray(e[r])?[...e[r],...t[r]]:[...t[r]]:typeof t[r]=="object"&&t[r]?e[r]=typeof e[r]=="object"&&e[r]?Un(e[r],t[r]):It(t[r]):e[r]=t[r]:e[r]=t[r]}),e}function Dr(n){const t={};for(const e of n.keys())t[e]=n.get(e);return t}function de(){for(var n=arguments.length,t=new Array(n),e=0;e(Object.keys(u).forEach(f=>{const a=f.toLowerCase();r.hasOwnProperty(a)?l[r[a]]=u[f]:(r[a]=f,l[f]=u[f])}),l),{})}j(805);const Fr=typeof ArrayBuffer=="function",{toString:kr}=Object.prototype;function Gn(n){return Fr&&(n instanceof ArrayBuffer||kr.call(n)==="[object ArrayBuffer]")}function Vn(n){return n!=null&&n.constructor!=null&&typeof n.constructor.isBuffer=="function"&&n.constructor.isBuffer(n)}function xe(n){return function(){for(var t=[],e=0;et.patchInline("fetch",Sr,e.url,function(r){let l={};const u={method:r.method};if(r.headers&&(l=de(l,r.headers)),r.data!==void 0){const[f,a]=function(s){if(typeof s=="string")return[s,{}];if(Vn(s))return[s,{}];if(Gn(s))return[s,{}];if(s&&typeof s=="object")return[JSON.stringify(s),{"content-type":"application/json"}];throw new Error("Unable to convert request body: Unexpected body type: "+typeof s)}(r.data);u.body=f,l=de(l,a)}return r.signal&&(u.signal=r.signal),r.withCredentials&&(u.credentials="include"),u.headers=l,u}(e)),n)}var Ur=j(285);const Rt=n=>{if(typeof n!="string")throw new TypeError("invalid pattern");if(n.length>65536)throw new TypeError("pattern is too long")},Gr={"[: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=n=>n.replace(/[[\]\\-]/g,"\\$&"),Ke=n=>n.join(""),Vr=(n,t)=>{const e=t;if(n.charAt(e)!=="[")throw new Error("not in a brace expression");const r=[],l=[];let u=e+1,f=!1,a=!1,s=!1,i=!1,o=e,h="";t:for(;uh?r.push(dt(h)+"-"+dt(m)):m===h&&r.push(dt(m)),h="",u++):n.startsWith("-]",u+1)?(r.push(dt(m+"-")),u+=2):n.startsWith("-",u+1)?(h=m,u+=2):(r.push(dt(m)),u++)}else s=!0,u++}else i=!0,u++}if(o1&&arguments[1]!==void 0?arguments[1]:{};return t?n.replace(/\[([^\/\\])\]/g,"$1"):n.replace(/((?!\\).|^)\[([^\/\\])\]/g,"$1$2").replace(/\\([^\/])/g,"$1")},Br=new Set(["!","?","+","*","@"]),Ye=n=>Br.has(n),Ut="(?!\\.)",Xr=new Set(["[","."]),zr=new Set(["..","."]),Wr=new Set("().*{}+?[]^$\\!"),Ne="[^/]",Je=Ne+"*?",Qe=Ne+"+?";class H{type;#n;#r;#s=!1;#t=[];#e;#o;#u;#a=!1;#i;#c;#h=!1;constructor(t,e){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.type=t,t&&(this.#r=!0),this.#e=e,this.#n=this.#e?this.#e.#n:this,this.#i=this.#n===this?r:this.#n.#i,this.#u=this.#n===this?[]:this.#n.#u,t!=="!"||this.#n.#a||this.#u.push(this),this.#o=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("")}#p(){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 e=t,r=e.#e;for(;r;){for(let l=e.#o+1;!r.type&&ltypeof e=="string"?e:e.toJSON()):[this.type,...this.#t.map(e=>e.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.#o===0)return!0;const t=this.#e;for(let e=0;e1&&arguments[1]!==void 0?arguments[1]:{};const r=new H(null,void 0,e);return H.#l(t,r,0,e),r}toMMPattern(){if(this!==this.#n)return this.#n.toMMPattern();const t=this.toString(),[e,r,l,u]=this.toRegExpSource();if(!(l||this.#r||this.#i.nocase&&!this.#i.nocaseMagicOnly&&t.toUpperCase()!==t.toLowerCase()))return r;const f=(this.#i.nocase?"i":"")+(u?"u":"");return Object.assign(new RegExp(`^${e}$`,f),{_src:e,_glob:t})}get options(){return this.#i}toRegExpSource(t){const e=t??!!this.#i.dot;if(this.#n===this&&this.#p(),!this.type){const s=this.isStart()&&this.isEnd(),i=this.#t.map(c=>{const[g,d,m,w]=typeof c=="string"?H.#d(c,this.#r,s):c.toRegExpSource(t);return this.#r=this.#r||m,this.#s=this.#s||w,g}).join("");let o="";if(this.isStart()&&typeof this.#t[0]=="string"&&(this.#t.length!==1||!zr.has(this.#t[0]))){const c=Xr,g=e&&c.has(i.charAt(0))||i.startsWith("\\.")&&c.has(i.charAt(2))||i.startsWith("\\.\\.")&&c.has(i.charAt(4)),d=!e&&!t&&c.has(i.charAt(0));o=g?"(?!(?:^|/)\\.\\.?(?:$|/))":d?Ut:""}let h="";return this.isEnd()&&this.#n.#a&&this.#e?.type==="!"&&(h="(?:$|\\/)"),[o+i+h,gt(i),this.#r=!!this.#r,this.#s]}const r=this.type==="*"||this.type==="+",l=this.type==="!"?"(?:(?!(?:":"(?:";let u=this.#f(e);if(this.isStart()&&this.isEnd()&&!u&&this.type!=="!"){const s=this.toString();return this.#t=[s],this.type=null,this.#r=void 0,[s,gt(this.toString()),!1,!1]}let f=!r||t||e?"":this.#f(!0);f===u&&(f=""),f&&(u=`(?:${u})(?:${f})*?`);let a="";return a=this.type==="!"&&this.#h?(this.isStart()&&!e?Ut:"")+Qe:l+u+(this.type==="!"?"))"+(!this.isStart()||e||t?"":Ut)+Je+")":this.type==="@"?")":this.type==="?"?")?":this.type==="+"&&f?")":this.type==="*"&&f?")?":`)${this.type}`),[a,gt(u),this.#r=!!this.#r,this.#s]}#f(t){return this.#t.map(e=>{if(typeof e=="string")throw new Error("string type in extglob ast??");const[r,l,u,f]=e.toRegExpSource(t);return this.#s=this.#s||f,r}).filter(e=>!(this.isStart()&&this.isEnd()&&!e)).join("|")}static#d(t,e){let r=arguments.length>2&&arguments[2]!==void 0&&arguments[2],l=!1,u="",f=!1;for(let a=0;a2&&arguments[2]!==void 0?arguments[2]:{};return Rt(t),!(!e.nocomment&&t.charAt(0)==="#")&&new St(t,e).match(n)},qr=/^\*+([^+@!?\*\[\(]*)$/,Hr=n=>t=>!t.startsWith(".")&&t.endsWith(n),Zr=n=>t=>t.endsWith(n),Kr=n=>(n=n.toLowerCase(),t=>!t.startsWith(".")&&t.toLowerCase().endsWith(n)),Yr=n=>(n=n.toLowerCase(),t=>t.toLowerCase().endsWith(n)),Jr=/^\*+\.\*+$/,Qr=n=>!n.startsWith(".")&&n.includes("."),ti=n=>n!=="."&&n!==".."&&n.includes("."),ei=/^\.\*+$/,ni=n=>n!=="."&&n!==".."&&n.startsWith("."),ri=/^\*+$/,ii=n=>n.length!==0&&!n.startsWith("."),si=n=>n.length!==0&&n!=="."&&n!=="..",oi=/^\?+([^+@!?\*\[\(]*)?$/,ai=n=>{let[t,e=""]=n;const r=Xn([t]);return e?(e=e.toLowerCase(),l=>r(l)&&l.toLowerCase().endsWith(e)):r},ui=n=>{let[t,e=""]=n;const r=zn([t]);return e?(e=e.toLowerCase(),l=>r(l)&&l.toLowerCase().endsWith(e)):r},ci=n=>{let[t,e=""]=n;const r=zn([t]);return e?l=>r(l)&&l.endsWith(e):r},li=n=>{let[t,e=""]=n;const r=Xn([t]);return e?l=>r(l)&&l.endsWith(e):r},Xn=n=>{let[t]=n;const e=t.length;return r=>r.length===e&&!r.startsWith(".")},zn=n=>{let[t]=n;const e=t.length;return r=>r.length===e&&r!=="."&&r!==".."},Wn=typeof mt=="object"&&mt?typeof Dt=="object"&&Dt&&Dt.__MINIMATCH_TESTING_PLATFORM__||mt.platform:"posix";q.sep=Wn==="win32"?"\\":"/";const Q=Symbol("globstar **");q.GLOBSTAR=Q,q.filter=function(n){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return e=>q(e,n,t)};const J=function(n){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return Object.assign({},n,t)};q.defaults=n=>{if(!n||typeof n!="object"||!Object.keys(n).length)return q;const t=q;return Object.assign(function(e,r){return t(e,r,J(n,arguments.length>2&&arguments[2]!==void 0?arguments[2]:{}))},{Minimatch:class extends t.Minimatch{constructor(e){super(e,J(n,arguments.length>1&&arguments[1]!==void 0?arguments[1]:{}))}static defaults(e){return t.defaults(J(n,e)).Minimatch}},AST:class extends t.AST{constructor(e,r){super(e,r,J(n,arguments.length>2&&arguments[2]!==void 0?arguments[2]:{}))}static fromGlob(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return t.AST.fromGlob(e,J(n,r))}},unescape:function(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return t.unescape(e,J(n,r))},escape:function(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return t.escape(e,J(n,r))},filter:function(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return t.filter(e,J(n,r))},defaults:e=>t.defaults(J(n,e)),makeRe:function(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return t.makeRe(e,J(n,r))},braceExpand:function(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return t.braceExpand(e,J(n,r))},match:function(e,r){let l=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return t.match(e,r,J(n,l))},sep:t.sep,GLOBSTAR:Q})};const qn=function(n){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return Rt(n),t.nobrace||!/\{(?:(?!\{).)*\}/.test(n)?[n]:Ur(n)};q.braceExpand=qn,q.makeRe=function(n){return new St(n,arguments.length>1&&arguments[1]!==void 0?arguments[1]:{}).makeRe()},q.match=function(n,t){const e=new St(t,arguments.length>2&&arguments[2]!==void 0?arguments[2]:{});return n=n.filter(r=>e.match(r)),e.options.nonull&&!n.length&&n.push(t),n};const tn=/[?*]|[+@!]\(.*?\)|\[|\]/;class St{options;set;pattern;windowsPathsNoEscape;nonegate;negate;comment;empty;preserveMultipleSlashes;partial;globSet;globParts;nocase;isWindows;platform;windowsNoMagicRoot;regexp;constructor(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};Rt(t),e=e||{},this.options=e,this.pattern=t,this.platform=e.platform||Wn,this.isWindows=this.platform==="win32",this.windowsPathsNoEscape=!!e.windowsPathsNoEscape||e.allowWindowsEscape===!1,this.windowsPathsNoEscape&&(this.pattern=this.pattern.replace(/\\/g,"/")),this.preserveMultipleSlashes=!!e.preserveMultipleSlashes,this.regexp=null,this.negate=!1,this.nonegate=!!e.nonegate,this.comment=!1,this.empty=!1,this.partial=!!e.partial,this.nocase=!!this.options.nocase,this.windowsNoMagicRoot=e.windowsNoMagicRoot!==void 0?e.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 e of t)if(typeof e!="string")return!0;return!1}debug(){}make(){const t=this.pattern,e=this.options;if(!e.nocomment&&t.charAt(0)==="#")return void(this.comment=!0);if(!t)return void(this.empty=!0);this.parseNegate(),this.globSet=[...new Set(this.braceExpand())],e.debug&&(this.debug=function(){return console.error(...arguments)}),this.debug(this.pattern,this.globSet);const r=this.globSet.map(u=>this.slashSplit(u));this.globParts=this.preprocess(r),this.debug(this.pattern,this.globParts);let l=this.globParts.map((u,f,a)=>{if(this.isWindows&&this.windowsNoMagicRoot){const s=!(u[0]!==""||u[1]!==""||u[2]!=="?"&&tn.test(u[2])||tn.test(u[3])),i=/^[a-z]:/i.test(u[0]);if(s)return[...u.slice(0,4),...u.slice(4).map(o=>this.parse(o))];if(i)return[u[0],...u.slice(1).map(o=>this.parse(o))]}return u.map(s=>this.parse(s))});if(this.debug(this.pattern,l),this.set=l.filter(u=>u.indexOf(!1)===-1),this.isWindows)for(let u=0;u=2?(t=this.firstPhasePreProcess(t),t=this.secondPhasePreProcess(t)):t=e>=1?this.levelOneOptimize(t):this.adjascentGlobstarOptimize(t),t}adjascentGlobstarOptimize(t){return t.map(e=>{let r=-1;for(;(r=e.indexOf("**",r+1))!==-1;){let l=r;for(;e[l+1]==="**";)l++;l!==r&&e.splice(r,l-r)}return e})}levelOneOptimize(t){return t.map(e=>(e=e.reduce((r,l)=>{const u=r[r.length-1];return l==="**"&&u==="**"?r:l===".."&&u&&u!==".."&&u!=="."&&u!=="**"?(r.pop(),r):(r.push(l),r)},[])).length===0?[""]:e)}levelTwoFileOptimize(t){Array.isArray(t)||(t=this.slashSplit(t));let e=!1;do{if(e=!1,!this.preserveMultipleSlashes){for(let l=1;ll&&r.splice(l+1,f-l);let a=r[l+1];const s=r[l+2],i=r[l+3];if(a!==".."||!s||s==="."||s===".."||!i||i==="."||i==="..")continue;e=!0,r.splice(l,1);const o=r.slice(0);o[l]="**",t.push(o),l--}if(!this.preserveMultipleSlashes){for(let f=1;fe.length)}partsMatch(t,e){let r=arguments.length>2&&arguments[2]!==void 0&&arguments[2],l=0,u=0,f=[],a="";for(;l2&&arguments[2]!==void 0&&arguments[2];const l=this.options;if(this.isWindows){const m=typeof t[0]=="string"&&/^[a-z]:$/i.test(t[0]),w=!m&&t[0]===""&&t[1]===""&&t[2]==="?"&&/^[a-z]:$/i.test(t[3]),y=typeof e[0]=="string"&&/^[a-z]:$/i.test(e[0]),p=w?3:m?0:void 0,b=!y&&e[0]===""&&e[1]===""&&e[2]==="?"&&typeof e[3]=="string"&&/^[a-z]:$/i.test(e[3])?3:y?0:void 0;if(typeof p=="number"&&typeof b=="number"){const[A,E]=[t[p],e[b]];A.toLowerCase()===E.toLowerCase()&&(e[b]=A,b>p?e=e.slice(b):p>b&&(t=t.slice(p)))}}const{optimizationLevel:u=1}=this.options;u>=2&&(t=this.levelTwoFileOptimize(t)),this.debug("matchOne",this,{file:t,pattern:e}),this.debug("matchOne",t.length,e.length);for(var f=0,a=0,s=t.length,i=e.length;f>> no match, partial?`,t,c,e,g),c!==s))}let m;if(typeof o=="string"?(m=h===o,this.debug("string match",o,h,m)):(m=o.test(h),this.debug("pattern match",o,h,m)),!m)return!1}if(f===s&&a===i)return!0;if(f===s)return r;if(a===i)return f===s-1&&t[f]==="";throw new Error("wtf?")}braceExpand(){return qn(this.pattern,this.options)}parse(t){Rt(t);const e=this.options;if(t==="**")return Q;if(t==="")return"";let r,l=null;(r=t.match(ri))?l=e.dot?si:ii:(r=t.match(qr))?l=(e.nocase?e.dot?Yr:Kr:e.dot?Zr:Hr)(r[1]):(r=t.match(oi))?l=(e.nocase?e.dot?ui:ai:e.dot?ci:li)(r):(r=t.match(Jr))?l=e.dot?ti:Qr:(r=t.match(ei))&&(l=ni);const u=H.fromGlob(t,this.options).toMMPattern();return l&&typeof u=="object"&&Reflect.defineProperty(u,"test",{value:l}),u}makeRe(){if(this.regexp||this.regexp===!1)return this.regexp;const t=this.set;if(!t.length)return this.regexp=!1,this.regexp;const e=this.options,r=e.noglobstar?"[^/]*?":e.dot?"(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?":"(?:(?!(?:\\/|^)\\.).)*?",l=new Set(e.nocase?["i"]:[]);let u=t.map(s=>{const i=s.map(o=>{if(o instanceof RegExp)for(const h of o.flags.split(""))l.add(h);return typeof o=="string"?o.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"):o===Q?Q:o._src});return i.forEach((o,h)=>{const c=i[h+1],g=i[h-1];o===Q&&g!==Q&&(g===void 0?c!==void 0&&c!==Q?i[h+1]="(?:\\/|"+r+"\\/)?"+c:i[h]=r:c===void 0?i[h-1]=g+"(?:\\/|"+r+")?":c!==Q&&(i[h-1]=g+"(?:\\/|\\/"+r+"\\/)"+c,i[h+1]=Q))}),i.filter(o=>o!==Q).join("/")}).join("|");const[f,a]=t.length>1?["(?:",")"]:["",""];u="^"+f+u+a+"$",this.negate&&(u="^(?!"+u+").+$");try{this.regexp=new RegExp(u,[...l].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 e=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==="/"&&e)return!0;const r=this.options;this.isWindows&&(t=t.split("\\").join("/"));const l=this.slashSplit(t);this.debug(this.pattern,"split",l);const u=this.set;this.debug(this.pattern,"set",u);let f=l[l.length-1];if(!f)for(let a=l.length-2;!f&&a>=0;a--)f=l[a];for(let a=0;a1&&arguments[1]!==void 0?arguments[1]:""}Invalid response: ${n.status} ${n.statusText}`);return t.status=n.status,t.response=n,t}function V(n,t){const{status:e}=t;if(e===401&&n.digest)return t;if(e>=400)throw Ae(t);return t}function ct(n,t){return arguments.length>2&&arguments[2]!==void 0&&arguments[2]?{data:t,headers:n.headers?Dr(n.headers):{},status:n.status,statusText:n.statusText}:t}q.AST=H,q.Minimatch=St,q.escape=function(n){let{windowsPathsNoEscape:t=!1}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return t?n.replace(/[?*()[\]]/g,"[$&]"):n.replace(/[?*()[\]\\]/g,"\\$&")},q.unescape=gt;const hi=(en=function(n,t,e){let r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};const l=G({url:F(n.remoteURL,D(t)),method:"COPY",headers:{Destination:F(n.remoteURL,D(e)),Overwrite:r.overwrite===!1?"F":"T",Depth:r.shallow?"0":"infinity"}},n,r);return f=function(a){V(n,a)},(u=U(l,n))&&u.then||(u=Promise.resolve(u)),f?u.then(f):u;var u,f},function(){for(var n=[],t=0;t2&&arguments[2]!==void 0?arguments[2]:lt.Original;const r=rt().get(n,t);return e==="array"&&Array.isArray(r)===!1?[r]:e==="object"&&Array.isArray(r)?r[0]:r}function yt(n){return new Promise(t=>{t(function(e){const{multistatus:r}=e;if(r==="")return{multistatus:{response:[]}};if(!r)throw new Error("Invalid response: No root multistatus found");const l={multistatus:Array.isArray(r)?r[0]:r};return rt().set(l,"multistatus.response",Nt(l,"multistatus.response",lt.Array)),rt().set(l,"multistatus.response",rt().get(l,"multistatus.response").map(u=>function(f){const a=Object.assign({},f);return a.status?rt().set(a,"status",Nt(a,"status",lt.Object)):(rt().set(a,"propstat",Nt(a,"propstat",lt.Object)),rt().set(a,"propstat.prop",Nt(a,"propstat.prop",lt.Object))),a}(u))),l}(new Oe.XMLParser({allowBooleanAttributes:!0,attributeNamePrefix:"",textNodeName:"text",ignoreAttributes:!1,removeNSPrefix:!0,numberParseOptions:{hex:!0,leadingZeros:!1},attributeValueProcessor:(e,r,l)=>r==="true"||r==="false"?r==="true":r,tagValueProcessor(e,r,l){if(!l.endsWith("propstat.prop.displayname"))return r}}).parse(n)))})}function jt(n,t){let e=arguments.length>2&&arguments[2]!==void 0&&arguments[2];const{getlastmodified:r=null,getcontentlength:l="0",resourcetype:u=null,getcontenttype:f=null,getetag:a=null}=n,s=u&&typeof u=="object"&&u.collection!==void 0?"directory":"file",i={filename:t,basename:Tt().basename(t),lastmod:r,size:parseInt(l,10),type:s,etag:typeof a=="string"?a.replace(/"/g,""):null};return s==="file"&&(i.mime=f&&typeof f=="string"?f.split(";")[0]:""),e&&(n.displayname!==void 0&&(n.displayname=String(n.displayname)),i.props=n),i}function Hn(n,t){let e=arguments.length>2&&arguments[2]!==void 0&&arguments[2],r=null;try{n.multistatus.response[0].propstat&&(r=n.multistatus.response[0])}catch{}if(!r)throw new Error("Failed getting item stat: bad response");const{propstat:{prop:l,status:u}}=r,[f,a,s]=u.split(" ",3),i=parseInt(a,10);if(i>=400){const o=new Error(`Invalid response: ${i} ${s}`);throw o.status=i,o}return jt(l,bt(t),e)}function Zn(n){switch(String(n)){case"-3":return"unlimited";case"-2":case"-1":return"unknown";default:return parseInt(String(n),10)}}function Gt(n,t,e){return n&&n.then||(n=Promise.resolve(n)),t?n.then(t):n}const Te=function(n){return function(){for(var t=[],e=0;e2&&arguments[2]!==void 0?arguments[2]:{};const{details:r=!1}=e,l=G({url:F(n.remoteURL,D(t)),method:"PROPFIND",headers:{Accept:"text/plain,application/xml",Depth:"0"}},n,e);return Gt(U(l,n),function(u){return V(n,u),Gt(u.text(),function(f){return Gt(yt(f),function(a){const s=Hn(a,t,r);return ct(u,s,r)})})})});function Kn(n,t,e){return n&&n.then||(n=Promise.resolve(n)),t?n.then(t):n}const pi=Yn(function(n,t){let e=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const r=function(u){if(!u||u==="/")return[];let f=u;const a=[];do a.push(f),f=Tt().dirname(f);while(f&&f!=="/");return a}(bt(t));r.sort((u,f)=>u.length>f.length?1:f.length>u.length?-1:0);let l=!1;return function(u,f,a){if(typeof u[rn]=="function"){let m=function(w){try{for(;!(s=h.next()).done;)if((w=f(s.value))&&w.then){if(!sn(w))return void w.then(m,o||(o=K.bind(null,i=new ht,2)));w=w.v}i?K(i,1,w):i=w}catch(y){K(i||(i=new ht),2,y)}};var s,i,o,h=u[rn]();if(m(),h.return){var c=function(w){try{s.done||h.return()}catch{}return w};if(i&&i.then)return i.then(c,function(w){throw c(w)});c()}return i}if(!("length"in u))throw new TypeError("Object is not iterable");for(var g=[],d=0;d2&&arguments[2]!==void 0?arguments[2]:{};if(e.recursive===!0)return pi(n,t,e);const r=G({url:F(n.remoteURL,(l=D(t),l.endsWith("/")?l:l+"/")),method:"MKCOL"},n,e);var l;return Kn(U(r,n),function(u){V(n,u)})});var gi=j(388),on=j.n(gi);const mi=function(n){return function(){for(var t=[],e=0;e2&&arguments[2]!==void 0?arguments[2]:{};const r={};if(typeof e.range=="object"&&typeof e.range.start=="number"){let a=`bytes=${e.range.start}-`;typeof e.range.end=="number"&&(a=`${a}${e.range.end}`),r.Range=a}const l=G({url:F(n.remoteURL,D(t)),method:"GET",headers:r},n,e);return f=function(a){if(V(n,a),r.Range&&a.status!==206){const s=new Error(`Invalid response code for partial request: ${a.status}`);throw s.status=a.status,s}return e.callback&&setTimeout(()=>{e.callback(a)},0),a.body},(u=U(l,n))&&u.then||(u=Promise.resolve(u)),f?u.then(f):u;var u,f}),vi=()=>{},bi=function(n){return function(){for(var t=[],e=0;e2&&arguments[2]!==void 0?arguments[2]:{};const r=G({url:F(n.remoteURL,D(t)),method:"DELETE"},n,e);return u=function(f){V(n,f)},(l=U(r,n))&&l.then||(l=Promise.resolve(l)),u?l.then(u):l;var l,u}),wi=function(n){return function(){for(var t=[],e=0;e2&&arguments[2]!==void 0?arguments[2]:{};return function(r,l){try{var u=(f=Te(n,t,e),a=function(){return!0},s?a?a(f):f:(f&&f.then||(f=Promise.resolve(f)),a?f.then(a):f))}catch(i){return l(i)}var f,a,s;return u&&u.then?u.then(void 0,l):u}(0,function(r){if(r.status===404)return!1;throw r})});function Vt(n,t,e){return n&&n.then||(n=Promise.resolve(n)),t?n.then(t):n}const Ei=function(n){return function(){for(var t=[],e=0;e2&&arguments[2]!==void 0?arguments[2]:{};const r=G({url:F(n.remoteURL,D(t),"/"),method:"PROPFIND",headers:{Accept:"text/plain,application/xml",Depth:e.deep?"infinity":"1"}},n,e);return Vt(U(r,n),function(l){return V(n,l),Vt(l.text(),function(u){if(!u)throw new Error("Failed parsing directory contents: Empty response");return Vt(yt(u),function(f){const a=Xe(t);let s=function(i,o,h){let c=arguments.length>3&&arguments[3]!==void 0&&arguments[3],g=arguments.length>4&&arguments[4]!==void 0&&arguments[4];const d=Tt().join(o,"/"),{multistatus:{response:m}}=i,w=m.map(y=>{const p=function(A){try{return A.replace(/^https?:\/\/[^\/]+/,"")}catch(E){throw new Y(E,"Failed normalising HREF")}}(y.href),{propstat:{prop:b}}=y;return jt(b,d==="/"?decodeURIComponent(bt(p)):bt(Tt().relative(decodeURIComponent(d),decodeURIComponent(p))),c)});return g?w:w.filter(y=>y.basename&&(y.type==="file"||y.filename!==h.replace(/\/$/,"")))}(f,Xe(n.remoteBasePath||n.remotePath),a,e.details,e.includeSelf);return e.glob&&(s=function(i,o){return i.filter(h=>q(h.filename,o,{matchBase:!0}))}(s,e.glob)),ct(l,s,e.details)})})})});function Pe(n){return function(){for(var t=[],e=0;e2&&arguments[2]!==void 0?arguments[2]:{};const r=G({url:F(n.remoteURL,D(t)),method:"GET",headers:{Accept:"text/plain"},transformResponse:[Oi]},n,e);return Ct(U(r,n),function(l){return V(n,l),Ct(l.text(),function(u){return ct(l,u,e.details)})})});function Ct(n,t,e){return n&&n.then||(n=Promise.resolve(n)),t?n.then(t):n}const Ni=Pe(function(n,t){let e=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const r=G({url:F(n.remoteURL,D(t)),method:"GET"},n,e);return Ct(U(r,n),function(l){let u;return V(n,l),function(f,a){var s=f();return s&&s.then?s.then(a):a()}(function(){return Ct(l.arrayBuffer(),function(f){u=f})},function(){return ct(l,u,e.details)})})}),Ai=Pe(function(n,t){let e=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const{format:r="binary"}=e;if(r!=="binary"&&r!=="text")throw new Y({info:{code:it.InvalidOutputFormat}},`Invalid output format: ${r}`);return r==="text"?xi(n,t,e):Ni(n,t,e)}),Oi=n=>n;function Ti(n){return new Oe.XMLBuilder({attributeNamePrefix:"@_",format:!0,ignoreAttributes:!1,suppressEmptyNode:!0}).build(Jn({lockinfo:{"@_xmlns:d":"DAV:",lockscope:{exclusive:{}},locktype:{write:{}},owner:{href:n}}},"d"))}function Jn(n,t){const e={...n};for(const r in e)e.hasOwnProperty(r)&&(e[r]&&typeof e[r]=="object"&&r.indexOf(":")===-1?(e[`${t}:${r}`]=Jn(e[r],t),delete e[r]):/^@_/.test(r)===!1&&(e[`${t}:${r}`]=e[r],delete e[r]));return e}function ve(n,t,e){return n&&n.then||(n=Promise.resolve(n)),t?n.then(t):n}function Qn(n){return function(){for(var t=[],e=0;e3&&arguments[3]!==void 0?arguments[3]:{};const l=G({url:F(n.remoteURL,D(t)),method:"UNLOCK",headers:{"Lock-Token":e}},n,r);return ve(U(l,n),function(u){if(V(n,u),u.status!==204&&u.status!==200)throw Ae(u)})}),Ii=Qn(function(n,t){let e=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const{refreshToken:r,timeout:l=$i}=e,u={Accept:"text/plain,application/xml",Timeout:l};r&&(u.If=r);const f=G({url:F(n.remoteURL,D(t)),method:"LOCK",headers:u,data:Ti(n.contactHref)},n,e);return ve(U(f,n),function(a){return V(n,a),ve(a.text(),function(s){const i=(c=s,new Oe.XMLParser({removeNSPrefix:!0,parseAttributeValue:!0,parseTagValue:!0}).parse(c)),o=rt().get(i,"prop.lockdiscovery.activelock.locktoken.href"),h=rt().get(i,"prop.lockdiscovery.activelock.timeout");var c;if(!o)throw Ae(a,"No lock token received: ");return{token:o,serverTimeout:h}})})}),$i="Infinite, Second-4100000000";function Bt(n,t,e){return n&&n.then||(n=Promise.resolve(n)),t?n.then(t):n}const Ri=function(n){return function(){for(var t=[],e=0;e1&&arguments[1]!==void 0?arguments[1]:{};const e=t.path||"/",r=G({url:F(n.remoteURL,e),method:"PROPFIND",headers:{Accept:"text/plain,application/xml",Depth:"0"}},n,t);return Bt(U(r,n),function(l){return V(n,l),Bt(l.text(),function(u){return Bt(yt(u),function(f){const a=function(s){try{const[i]=s.multistatus.response,{propstat:{prop:{"quota-used-bytes":o,"quota-available-bytes":h}}}=i;return o!==void 0&&h!==void 0?{used:parseInt(String(o),10),available:Zn(h)}:null}catch{}return null}(f);return ct(l,a,t.details)})})})});function Xt(n,t,e){return n&&n.then||(n=Promise.resolve(n)),t?n.then(t):n}const Si=function(n){return function(){for(var t=[],e=0;e2&&arguments[2]!==void 0?arguments[2]:{};const{details:r=!1}=e,l=G({url:F(n.remoteURL,D(t)),method:"SEARCH",headers:{Accept:"text/plain,application/xml","Content-Type":n.headers["Content-Type"]||"application/xml; charset=utf-8"}},n,e);return Xt(U(l,n),function(u){return V(n,u),Xt(u.text(),function(f){return Xt(yt(f),function(a){const s=function(i,o,h){const c={truncated:!1,results:[]};return c.truncated=i.multistatus.response.some(g=>(g.status||g.propstat?.status).split(" ",3)?.[1]==="507"&&g.href.replace(/\/$/,"").endsWith(D(o).replace(/\/$/,""))),i.multistatus.response.forEach(g=>{if(g.propstat===void 0)return;const d=g.href.split("/").map(decodeURIComponent).join("/");c.results.push(jt(g.propstat.prop,d,h))}),c}(a,t,r);return ct(u,s,r)})})})}),Ci=function(n){return function(){for(var t=[],e=0;e3&&arguments[3]!==void 0?arguments[3]:{};const l=G({url:F(n.remoteURL,D(t)),method:"MOVE",headers:{Destination:F(n.remoteURL,D(e)),Overwrite:r.overwrite===!1?"F":"T"}},n,r);return f=function(a){V(n,a)},(u=U(l,n))&&u.then||(u=Promise.resolve(u)),f?u.then(f):u;var u,f});var Li=j(172);const ji=function(n){return function(){for(var t=[],e=0;e3&&arguments[3]!==void 0?arguments[3]:{};const{contentLength:l=!0,overwrite:u=!0}=r,f={"Content-Type":"application/octet-stream"};l===!1||(f["Content-Length"]=typeof l=="number"?`${l}`:`${function(o){if(Gn(o))return o.byteLength;if(Vn(o))return o.length;if(typeof o=="string")return(0,Li.d)(o);throw new Y({info:{code:it.DataTypeNoLength}},"Cannot calculate data length: Invalid type")}(e)}`),u||(f["If-None-Match"]="*");const a=G({url:F(n.remoteURL,D(t)),method:"PUT",headers:f,data:e},n,r);return i=function(o){try{V(n,o)}catch(h){const c=h;if(c.status!==412||u)throw c;return!1}return!0},(s=U(a,n))&&s.then||(s=Promise.resolve(s)),i?s.then(i):s;var s,i}),tr=function(n){return function(){for(var t=[],e=0;e2&&arguments[2]!==void 0?arguments[2]:{};const r=G({url:F(n.remoteURL,D(t)),method:"OPTIONS"},n,e);return u=function(f){try{V(n,f)}catch(a){throw a}return{compliance:(f.headers.get("DAV")??"").split(",").map(a=>a.trim()),server:f.headers.get("Server")??""}},(l=U(r,n))&&l.then||(l=Promise.resolve(l)),u?l.then(u):l;var l,u});function vt(n,t,e){return n&&n.then||(n=Promise.resolve(n)),t?n.then(t):n}const _i=Ie(function(n,t,e,r,l){let u=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{};if(e>r||e<0)throw new Y({info:{code:it.InvalidUpdateRange}},`Invalid update range ${e} for partial update`);const f={"Content-Type":"application/octet-stream","Content-Length":""+(r-e+1),"Content-Range":`bytes ${e}-${r}/*`},a=G({url:F(n.remoteURL,D(t)),method:"PUT",headers:f,data:l},n,u);return vt(U(a,n),function(s){V(n,s)})});function an(n,t){var e=n();return e&&e.then?e.then(t):t(e)}const Di=Ie(function(n,t,e,r,l){let u=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{};if(e>r||e<0)throw new Y({info:{code:it.InvalidUpdateRange}},`Invalid update range ${e} for partial update`);const f={"Content-Type":"application/x-sabredav-partialupdate","Content-Length":""+(r-e+1),"X-Update-Range":`bytes=${e}-${r}`},a=G({url:F(n.remoteURL,D(t)),method:"PATCH",headers:f,data:l},n,u);return vt(U(a,n),function(s){V(n,s)})});function Ie(n){return function(){for(var t=[],e=0;e5&&arguments[5]!==void 0?arguments[5]:{};return vt(tr(n,t,u),function(f){let a=!1;return an(function(){if(f.compliance.includes("sabredav-partialupdate"))return vt(Di(n,t,e,r,l,u),function(s){return a=!0,s})},function(s){let i=!1;return a?s:an(function(){if(f.server.includes("Apache")&&f.compliance.includes(""))return vt(_i(n,t,e,r,l,u),function(o){return i=!0,o})},function(o){if(i)return o;throw new Y({info:{code:it.NotSupported}},"Not supported")})})})}),ki="https://github.com/perry-mitchell/webdav-client/blob/master/LOCK_CONTACT.md";function Mi(n){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const{authType:e=null,remoteBasePath:r,contactHref:l=ki,ha1:u,headers:f={},httpAgent:a,httpsAgent:s,password:i,token:o,username:h,withCredentials:c}=t;let g=e;g||(g=h||i?Z.Password:Z.None);const d={authType:g,remoteBasePath:r,contactHref:l,ha1:u,headers:Object.assign({},f),httpAgent:a,httpsAgent:s,password:i,remotePath:Pr(n),remoteURL:n,token:o,username:h,withCredentials:c};return kn(d,h,i,o,u),{copyFile:(m,w,y)=>hi(d,m,w,y),createDirectory:(m,w)=>me(d,m,w),createReadStream:(m,w)=>function(y,p){let b=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const A=new(on()).PassThrough;return mi(y,p,b).then(E=>{E.pipe(A)}).catch(E=>{A.emit("error",E)}),A}(d,m,w),createWriteStream:(m,w,y)=>function(p,b){let A=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},E=arguments.length>3&&arguments[3]!==void 0?arguments[3]:vi;const v=new(on()).PassThrough,N={};A.overwrite===!1&&(N["If-None-Match"]="*");const x=G({url:F(p.remoteURL,D(b)),method:"PUT",headers:N,data:v,maxRedirects:0},p,A);return U(x,p).then(O=>V(p,O)).then(O=>{setTimeout(()=>{E(O)},0)}).catch(O=>{v.emit("error",O)}),v}(d,m,w,y),customRequest:(m,w)=>bi(d,m,w),deleteFile:(m,w)=>yi(d,m,w),exists:(m,w)=>wi(d,m,w),getDirectoryContents:(m,w)=>Ei(d,m,w),getFileContents:(m,w)=>Ai(d,m,w),getFileDownloadLink:m=>function(w,y){let p=F(w.remoteURL,D(y));const b=/^https:/i.test(p)?"https":"http";switch(w.authType){case Z.None:break;case Z.Password:{const A=We(w.headers.Authorization.replace(/^Basic /i,"").trim());p=p.replace(/^https?:\/\//,`${b}://${A}@`);break}default:throw new Y({info:{code:it.LinkUnsupportedAuthType}},`Unsupported auth type for file link: ${w.authType}`)}return p}(d,m),getFileUploadLink:m=>function(w,y){let p=`${F(w.remoteURL,D(y))}?Content-Type=application/octet-stream`;const b=/^https:/i.test(p)?"https":"http";switch(w.authType){case Z.None:break;case Z.Password:{const A=We(w.headers.Authorization.replace(/^Basic /i,"").trim());p=p.replace(/^https?:\/\//,`${b}://${A}@`);break}default:throw new Y({info:{code:it.LinkUnsupportedAuthType}},`Unsupported auth type for file link: ${w.authType}`)}return p}(d,m),getHeaders:()=>Object.assign({},d.headers),getQuota:m=>Ri(d,m),lock:(m,w)=>Ii(d,m,w),moveFile:(m,w,y)=>Ci(d,m,w,y),putFileContents:(m,w,y)=>ji(d,m,w,y),partialUpdateFileContents:(m,w,y,p,b)=>Fi(d,m,w,y,p,b),getDAVCompliance:m=>tr(d,m),search:(m,w)=>Si(d,m,w),setHeaders:m=>{d.headers=Object.assign({},m)},stat:(m,w)=>Te(d,m,w),unlock:(m,w,y)=>Pi(d,m,w,y)}}tt.hT,tt.O4,tt.Kd,tt.YK;var Ui=tt.UU,Gi=tt.Gu;tt.ky,tt.h4,tt.ch,tt.hq,tt.i5;const ot=dr().setApp("@nextcloud/files").detectUser().build();var et=(n=>(n[n.NONE=0]="NONE",n[n.CREATE=4]="CREATE",n[n.READ=1]="READ",n[n.UPDATE=2]="UPDATE",n[n.DELETE=8]="DELETE",n[n.SHARE=16]="SHARE",n[n.ALL=31]="ALL",n))(et||{}),$e=(n=>(n.Folder="folder",n.File="file",n))($e||{});const er=function(n,t){return n.match(t)!==null},un=(n,t)=>{if(n.id&&typeof n.id!="number")throw new Error("Invalid id type of value");if(!n.source)throw new Error("Missing mandatory source");try{new URL(n.source)}catch{throw new Error("Invalid source format, source must be a valid URL")}if(!n.source.startsWith("http"))throw new Error("Invalid source format, only http(s) is supported");if(n.displayname&&typeof n.displayname!="string")throw new Error("Invalid displayname type");if(n.mtime&&!(n.mtime instanceof Date))throw new Error("Invalid mtime type");if(n.crtime&&!(n.crtime instanceof Date))throw new Error("Invalid crtime type");if(!n.mime||typeof n.mime!="string"||!n.mime.match(/^[-\w.]+\/[-+\w.]+$/gi))throw new Error("Missing or invalid mandatory mime");if("size"in n&&typeof n.size!="number"&&n.size!==void 0)throw new Error("Invalid size type");if("permissions"in n&&n.permissions!==void 0&&!(typeof n.permissions=="number"&&n.permissions>=et.NONE&&n.permissions<=et.ALL))throw new Error("Invalid permissions");if(n.owner&&n.owner!==null&&typeof n.owner!="string")throw new Error("Invalid owner type");if(n.attributes&&typeof n.attributes!="object")throw new Error("Invalid attributes type");if(n.root&&typeof n.root!="string")throw new Error("Invalid root type");if(n.root&&!n.root.startsWith("/"))throw new Error("Root must start with a leading slash");if(n.root&&!n.source.includes(n.root))throw new Error("Root must be part of the source");if(n.root&&er(n.source,t)){const e=n.source.match(t)[0];if(!n.source.includes(ut.join(e,n.root)))throw new Error("The root must be relative to the service. e.g /files/emma")}if(n.status&&!Object.values(Re).includes(n.status))throw new Error("Status must be a valid NodeStatus")};var Re=(n=>(n.NEW="new",n.FAILED="failed",n.LOADING="loading",n.LOCKED="locked",n))(Re||{});class _t{_data;_attributes;_knownDavService=/(remote|public)\.php\/(web)?dav/i;readonlyAttributes=Object.entries(Object.getOwnPropertyDescriptors(_t.prototype)).filter(t=>typeof t[1].get=="function"&&t[0]!=="__proto__").map(t=>t[0]);handler={set:(t,e,r)=>this.readonlyAttributes.includes(e)?!1:Reflect.set(t,e,r),deleteProperty:(t,e)=>this.readonlyAttributes.includes(e)?!1:Reflect.deleteProperty(t,e),get:(t,e,r)=>this.readonlyAttributes.includes(e)?(ot.warn(`Accessing "Node.attributes.${e}" is deprecated, access it directly on the Node instance.`),Reflect.get(this,e)):Reflect.get(t,e,r)};constructor(t,e){un(t,e||this._knownDavService),this._data={displayname:t.attributes?.displayname,...t,attributes:{}},this._attributes=new Proxy(this._data.attributes,this.handler),this.update(t.attributes??{}),e&&(this._knownDavService=e)}get source(){return this._data.source.replace(/\/$/i,"")}get encodedSource(){const{origin:t}=new URL(this.source);return t+br(this.source.slice(t.length))}get basename(){return ut.basename(this.source)}get displayname(){return this._data.displayname||this.basename}set displayname(t){this._data.displayname=t}get extension(){return ut.extname(this.source)}get dirname(){if(this.root){let e=this.source;this.isDavResource&&(e=e.split(this._knownDavService).pop());const r=e.indexOf(this.root),l=this.root.replace(/\/$/,"");return ut.dirname(e.slice(r+l.length)||"/")}const t=new URL(this.source);return ut.dirname(t.pathname)}get mime(){return this._data.mime}get mtime(){return this._data.mtime}set mtime(t){this._data.mtime=t}get crtime(){return this._data.crtime}get size(){return this._data.size}set size(t){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){this.updateMtime(),this._data.permissions=t}get owner(){return this.isDavResource?this._data.owner:null}get isDavResource(){return er(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 e=t.indexOf(this.root),r=this.root.replace(/\/$/,"");return t.slice(e+r.length)||"/"}return(this.dirname+"/"+this.basename).replace(/\/\//g,"/")}get fileid(){return this._data?.id}get status(){return this._data?.status}set status(t){this._data.status=t}get data(){return structuredClone(this._data)}move(t){un({...this._data,source:t},this._knownDavService);const e=this.basename;this._data.source=t,this.displayname===e&&this.basename!==e&&(this.displayname=this.basename),this.updateMtime()}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[e,r]of Object.entries(t))try{r===void 0?delete this.attributes[e]:this.attributes[e]=r}catch(l){if(l instanceof TypeError)continue;throw l}}}class Se extends _t{get type(){return $e.File}clone(){return new Se(this.data)}}class Ce extends _t{constructor(t){super({...t,mime:"httpd/unix-directory"})}get type(){return $e.Folder}get extension(){return null}get mime(){return"httpd/unix-directory"}clone(){return new Ce(this.data)}}const Vi=function(n=""){let t=et.NONE;return n&&((n.includes("C")||n.includes("K"))&&(t|=et.CREATE),n.includes("G")&&(t|=et.READ),(n.includes("W")||n.includes("N")||n.includes("V"))&&(t|=et.UPDATE),n.includes("D")&&(t|=et.DELETE),n.includes("R")&&(t|=et.SHARE)),t},nr=["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"],rr={d:"DAV:",nc:"http://nextcloud.org/ns",oc:"http://owncloud.org/ns",ocs:"http://open-collaboration-services.org/ns"},ys=function(n,t={nc:"http://nextcloud.org/ns"}){typeof window._nc_dav_properties>"u"&&(window._nc_dav_properties=[...nr],window._nc_dav_namespaces={...rr});const e={...window._nc_dav_namespaces,...t};if(window._nc_dav_properties.find(l=>l===n))return ot.warn(`${n} already registered`,{prop:n}),!1;if(n.startsWith("<")||n.split(":").length!==2)return ot.error(`${n} is not valid. See example: 'oc:fileid'`,{prop:n}),!1;const r=n.split(":")[0];return e[r]?(window._nc_dav_properties.push(n),window._nc_dav_namespaces=e,!0):(ot.error(`${n} namespace unknown`,{prop:n,namespaces:e}),!1)},Le=function(){return typeof window._nc_dav_properties>"u"&&(window._nc_dav_properties=[...nr]),window._nc_dav_properties.map(n=>`<${n} />`).join(" ")},je=function(){return typeof window._nc_dav_namespaces>"u"&&(window._nc_dav_namespaces={...rr}),Object.keys(window._nc_dav_namespaces).map(n=>`xmlns:${n}="${window._nc_dav_namespaces?.[n]}"`).join(" ")},ws=function(){return` ${Le()} `},Bi=function(){return` ${Le()} 1 `},Es=function(n){return` ${Le()} /files/${be()?.uid}/ infinity httpd/unix-directory 0 ${n} 100 0 `};function Xi(){return ye()?`/files/${mr()}`:`/files/${be()?.uid}`}const ir=Xi();function zi(){const n=gr("dav");return ye()?n.replace("remote.php","public.php"):n}const sr=zi(),xs=function(n=sr,t={}){const e=Ui(n,{headers:t});function r(l){e.setHeaders({...t,"X-Requested-With":"XMLHttpRequest",requesttoken:l??""})}return fr(r),r(pr()),Gi().patch("fetch",(l,u)=>{const f=u.headers;return f?.method&&(u.method=f.method,delete f.method),fetch(l,u)}),e},Ns=(n,t="/",e=ir)=>{const r=new AbortController;return new nt(async(l,u,f)=>{f(()=>r.abort());try{const a=(await n.getDirectoryContents(`${e}${t}`,{signal:r.signal,details:!0,data:Bi(),headers:{method:"REPORT"},includeSelf:!0})).data.filter(s=>s.filename!==t).map(s=>Wi(s,e));l(a)}catch(a){u(a)}})},Wi=function(n,t=ir,e=sr){let r=be()?.uid;if(ye())r=r??"anonymous";else if(!r)throw new Error("No user id found");const l=n.props,u=Vi(l?.permissions),f=String(l?.["owner-id"]||r),a=l.fileid||0,s=new Date(Date.parse(n.lastmod)),i=new Date(Date.parse(l.creationdate)),o={id:a,source:`${e}${n.filename}`,mtime:!isNaN(s.getTime())&&s.getTime()!==0?s:void 0,crtime:!isNaN(i.getTime())&&i.getTime()!==0?i:void 0,mime:n.mime||"application/octet-stream",displayname:l.displayname!==void 0?String(l.displayname):void 0,size:l?.size||Number.parseInt(l.getcontentlength||"0"),status:a<0?Re.FAILED:void 0,permissions:u,owner:f,root:t,attributes:{...n,...l,hasPreview:l?.["has-preview"]}};return delete o.attributes?.props,n.type==="file"?new Se(o):new Ce(o)};var zt={},qi=(n=>(n[n.UploadFromDevice=0]="UploadFromDevice",n[n.CreateNew=1]="CreateNew",n[n.Other=2]="Other",n))(qi||{});class Hi{_entries=[];registerEntry(t){this.validateEntry(t),t.category=t.category??1,this._entries.push(t)}unregisterEntry(t){const e=typeof t=="string"?this.getEntryIndex(t):this.getEntryIndex(t.id);if(e===-1){ot.warn("Entry not found, nothing removed",{entry:t,entries:this.getEntries()});return}this._entries.splice(e,1)}getEntries(t){return t?this._entries.filter(e=>typeof e.enabled=="function"?e.enabled(t):!0):this._entries}getEntryIndex(t){return this._entries.findIndex(e=>e.id===t)}validateEntry(t){if(!t.id||!t.displayName||!(t.iconSvgInline||t.iconClass)||!t.handler)throw new Error("Invalid entry");if(typeof t.id!="string"||typeof t.displayName!="string")throw new Error("Invalid id or displayName property");if(t.iconClass&&typeof t.iconClass!="string"||t.iconSvgInline&&typeof t.iconSvgInline!="string")throw new Error("Invalid icon provided");if(t.enabled!==void 0&&typeof t.enabled!="function")throw new Error("Invalid enabled property");if(typeof t.handler!="function")throw new Error("Invalid handler property");if("order"in t&&typeof t.order!="number")throw new Error("Invalid order property");if(this.getEntryIndex(t.id)!==-1)throw new Error("Duplicate entry")}}const Zi=function(){return typeof window._nc_newfilemenu>"u"&&(window._nc_newfilemenu=new Hi,ot.debug("NewFileMenu initialized")),window._nc_newfilemenu};class As{_header;constructor(t){this.validateHeader(t),this._header=t}get id(){return this._header.id}get order(){return this._header.order}get enabled(){return this._header.enabled}get render(){return this._header.render}get updated(){return this._header.updated}validateHeader(t){if(!t.id||!t.render||!t.updated)throw new Error("Invalid header: id, render and updated are required");if(typeof t.id!="string")throw new Error("Invalid id property");if(t.enabled!==void 0&&typeof t.enabled!="function")throw new Error("Invalid enabled property");if(t.render&&typeof t.render!="function")throw new Error("Invalid render property");if(t.updated&&typeof t.updated!="function")throw new Error("Invalid updated property")}}const Os=function(n){if(typeof window._nc_filelistheader>"u"&&(window._nc_filelistheader=[],ot.debug("FileListHeaders initialized")),window._nc_filelistheader.find(t=>t.id===n.id)){ot.error(`Header ${n.id} already registered`,{header:n});return}window._nc_filelistheader.push(n)},Wt=["B","KB","MB","GB","TB","PB"],qt=["B","KiB","MiB","GiB","TiB","PiB"];function Ts(n,t=!1,e=!1,r=!1){e=e&&!r,typeof n=="string"&&(n=Number(n));let l=n>0?Math.floor(Math.log(n)/Math.log(r?1e3:1024)):0;l=Math.min((e?qt.length:Wt.length)-1,l);const u=e?qt[l]:Wt[l];let f=(n/Math.pow(r?1e3:1024,l)).toFixed(1);return t===!0&&l===0?(f!=="0.0"?"< 1 ":"0 ")+(e?qt[1]:Wt[1]):(l<2?f=parseFloat(f).toFixed(0):f=parseFloat(f).toLocaleString(jn()),f+" "+u)}function cn(n){return n instanceof Date?n.toISOString():String(n)}function Ki(n,t,e){t=t??[u=>u],e=e??[];const r=t.map((u,f)=>(e[f]??"asc")==="asc"?1:-1),l=Intl.Collator([vr(),jn()],{numeric:!0,usage:"sort"});return[...n].sort((u,f)=>{for(const[a,s]of t.entries()){const i=l.compare(cn(s(u)),cn(s(f)));if(i!==0)return i*r[a]}return 0})}function Ps(n,t={}){const e={sortingMode:"basename",sortingOrder:"asc",...t},r=f=>f.lastIndexOf(".")>0?f.slice(0,f.lastIndexOf(".")):f,l=[...e.sortFavoritesFirst?[f=>f.attributes?.favorite!==1]:[],...e.sortFoldersFirst?[f=>f.type!=="folder"]:[],...e.sortingMode!=="basename"?[f=>f[e.sortingMode]]:[],f=>r(f.displayname||f.attributes?.displayname||f.basename),f=>f.basename],u=[...e.sortFavoritesFirst?["asc"]:[],...e.sortFoldersFirst?["asc"]:[],...e.sortingMode==="mtime"?[e.sortingOrder==="asc"?"desc":"asc"]:[],...e.sortingMode!=="mtime"&&e.sortingMode!=="basename"?[e.sortingOrder]:[],e.sortingOrder,e.sortingOrder];return Ki(n,l,u)}var Ht={},ln={},hn;function _e(){return hn||(hn=1,function(n){const t=":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",e=t+"\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040",r="["+t+"]["+e+"]*",l=new RegExp("^"+r+"$"),u=function(a,s){const i=[];let o=s.exec(a);for(;o;){const h=[];h.startIndex=s.lastIndex-o[0].length;const c=o.length;for(let g=0;g"u")};n.isExist=function(a){return typeof a<"u"},n.isEmptyObject=function(a){return Object.keys(a).length===0},n.merge=function(a,s,i){if(s){const o=Object.keys(s),h=o.length;for(let c=0;c"&&y[v]!==" "&&y[v]!==" "&&y[v]!==` `&&y[v]!=="\r";v++)O+=y[v];if(O=O.trim(),O[O.length-1]==="/"&&(O=O.substring(0,O.length-1),v--),!d(O)){let $;return O.trim().length===0?$="Invalid space after '<'.":$="Tag '"+O+"' is an invalid name.",c("InvalidTag",$,m(y,v))}const P=a(y,v);if(P===!1)return c("InvalidAttr","Attributes for '"+O+"' have open quote.",m(y,v));let I=P.value;if(v=P.index,I[I.length-1]==="/"){const $=v-I.length;I=I.substring(0,I.length-1);const T=i(I,p);if(T===!0)A=!0;else return c(T.err.code,T.err.msg,m(y,$+T.err.line))}else if(x)if(P.tagClosed){if(I.trim().length>0)return c("InvalidTag","Closing tag '"+O+"' can't have attributes or invalid starting.",m(y,N));if(b.length===0)return c("InvalidTag","Closing tag '"+O+"' has not been opened.",m(y,N));{const $=b.pop();if(O!==$.tagName){let T=m(y,$.tagStartPos);return c("InvalidTag","Expected closing tag '"+$.tagName+"' (opened in line "+T.line+", col "+T.col+") instead of closing tag '"+O+"'.",m(y,N))}b.length==0&&(E=!0)}}else return c("InvalidTag","Closing tag '"+O+"' doesn't have proper closing.",m(y,v));else{const $=i(I,p);if($!==!0)return c($.err.code,$.err.msg,m(y,v-I.length+$.err.line));if(E===!0)return c("InvalidXml","Multiple possible root nodes found.",m(y,v));p.unpairedTags.indexOf(O)!==-1||b.push({tagName:O,tagStartPos:N}),A=!0}for(v++;v0)return c("InvalidXml","Invalid '"+JSON.stringify(b.map(v=>v.tagName),null,4).replace(/\r?\n/g,"")+"' found.",{line:1,col:1})}else return c("InvalidXml","Start tag expected.",1);return!0};function e(y){return y===" "||y===" "||y===` `||y==="\r"}function r(y,p){const b=p;for(;p5&&A==="xml")return c("InvalidXml","XML declaration allowed only at the start of the document.",m(y,p));if(y[p]=="?"&&y[p+1]==">"){p++;break}else continue}return p}function l(y,p){if(y.length>p+5&&y[p+1]==="-"&&y[p+2]==="-"){for(p+=3;p"){p+=2;break}}else if(y.length>p+8&&y[p+1]==="D"&&y[p+2]==="O"&&y[p+3]==="C"&&y[p+4]==="T"&&y[p+5]==="Y"&&y[p+6]==="P"&&y[p+7]==="E"){let b=1;for(p+=8;p"&&(b--,b===0))break}else if(y.length>p+9&&y[p+1]==="["&&y[p+2]==="C"&&y[p+3]==="D"&&y[p+4]==="A"&&y[p+5]==="T"&&y[p+6]==="A"&&y[p+7]==="["){for(p+=8;p"){p+=2;break}}return p}const u='"',f="'";function a(y,p){let b="",A="",E=!1;for(;p"&&A===""){E=!0;break}b+=y[p]}return A!==""?!1:{value:b,index:p,tagClosed:E}}const s=new RegExp(`(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['"])(([\\s\\S])*?)\\5)?`,"g");function i(y,p){const b=n.getAllMatches(y,s),A={};for(let E=0;E!1,commentPropName:!1,unpairedTags:[],processEntities:!0,htmlEntities:!1,ignoreDeclaration:!1,ignorePiTags:!1,transformTagName:!1,transformAttributeName:!1,updateTag:function(e,r,l){return e}},t=function(e){return Object.assign({},n,e)};return At.buildOptions=t,At.defaultOptions=n,At}var Zt,dn;function Ji(){if(dn)return Zt;dn=1;class n{constructor(e){this.tagname=e,this.child=[],this[":@"]={}}add(e,r){e==="__proto__"&&(e="#__proto__"),this.child.push({[e]:r})}addChild(e){e.tagname==="__proto__"&&(e.tagname="#__proto__"),e[":@"]&&Object.keys(e[":@"]).length>0?this.child.push({[e.tagname]:e.child,":@":e[":@"]}):this.child.push({[e.tagname]:e.child})}}return Zt=n,Zt}var Kt,gn;function Qi(){if(gn)return Kt;gn=1;const n=_e();function t(s,i){const o={};if(s[i+3]==="O"&&s[i+4]==="C"&&s[i+5]==="T"&&s[i+6]==="Y"&&s[i+7]==="P"&&s[i+8]==="E"){i=i+9;let h=1,c=!1,g=!1,d="";for(;i"){if(g?s[i-1]==="-"&&s[i-2]==="-"&&(g=!1,h--):h--,h===0)break}else s[i]==="["?c=!0:d+=s[i];if(h!==0)throw new Error("Unclosed DOCTYPE")}else throw new Error("Invalid Tag instead of DOCTYPE");return{entities:o,i}}function e(s,i){let o="";for(;i0&&i&&a[2]!=="."||!f.leadingZeros&&o.length>0&&!i&&a[1]!==".")return u;{const g=Number(a),d=""+g;return d.search(/[eE]/)!==-1||c?f.eNotation?g:u:a.indexOf(".")!==-1?d==="0"&&h===""||d===h||i&&d==="-"+h?g:u:o?h===d||i+h===d?g:u:a===d||a===i+d?g:u}}else return u}}function l(u){return u&&u.indexOf(".")!==-1&&(u=u.replace(/0+$/,""),u==="."?u="0":u[0]==="."?u="0"+u:u[u.length-1]==="."&&(u=u.substr(0,u.length-1))),u}return Yt=r,Yt}var Jt,vn;function ar(){if(vn)return Jt;vn=1;function n(t){return typeof t=="function"?t:Array.isArray(t)?e=>{for(const r of t)if(typeof r=="string"&&e===r||r instanceof RegExp&&r.test(e))return!0}:()=>!1}return Jt=n,Jt}var Qt,bn;function es(){if(bn)return Qt;bn=1;const n=_e(),t=Ji(),e=Qi(),r=ts(),l=ar();class u{constructor(v){this.options=v,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:(N,x)=>String.fromCharCode(Number.parseInt(x,10))},num_hex:{regex:/&#x([0-9a-fA-F]{1,6});/g,val:(N,x)=>String.fromCharCode(Number.parseInt(x,16))}},this.addExternalEntities=f,this.parseXml=h,this.parseTextData=a,this.resolveNameSpace=s,this.buildAttributesMap=o,this.isItStopNode=m,this.replaceEntitiesValue=g,this.readStopNodeData=b,this.saveTextToParentTag=d,this.addChild=c,this.ignoreAttributesFn=l(this.options.ignoreAttributes)}}function f(E){const v=Object.keys(E);for(let N=0;N0)){I||(E=this.replaceEntitiesValue(E));const $=this.options.tagValueProcessor(v,E,N,O,P);return $==null?E:typeof $!=typeof E||$!==E?$:this.options.trimValues?A(E,this.options.parseTagValue,this.options.numberParseOptions):E.trim()===E?A(E,this.options.parseTagValue,this.options.numberParseOptions):E}}function s(E){if(this.options.removeNSPrefix){const v=E.split(":"),N=E.charAt(0)==="/"?"/":"";if(v[0]==="xmlns")return"";v.length===2&&(E=N+v[1])}return E}const i=new RegExp(`([^\\s=]+)\\s*(=\\s*(['"])([\\s\\S]*?)\\3)?`,"gm");function o(E,v,N){if(this.options.ignoreAttributes!==!0&&typeof E=="string"){const x=n.getAllMatches(E,i),O=x.length,P={};for(let I=0;I",P,"Closing Tag is not closed.");let $=E.substring(P+2,I).trim();if(this.options.removeNSPrefix){const S=$.indexOf(":");S!==-1&&($=$.substr(S+1))}this.options.transformTagName&&($=this.options.transformTagName($)),N&&(x=this.saveTextToParentTag(x,N,O));const T=O.substring(O.lastIndexOf(".")+1);if($&&this.options.unpairedTags.indexOf($)!==-1)throw new Error(`Unpaired tag can not be used as closing tag: `);let R=0;T&&this.options.unpairedTags.indexOf(T)!==-1?(R=O.lastIndexOf(".",O.lastIndexOf(".")-1),this.tagsNodeStack.pop()):R=O.lastIndexOf("."),O=O.substring(0,R),N=this.tagsNodeStack.pop(),x="",P=I}else if(E[P+1]==="?"){let I=p(E,P,!1,"?>");if(!I)throw new Error("Pi Tag is not closed.");if(x=this.saveTextToParentTag(x,N,O),!(this.options.ignoreDeclaration&&I.tagName==="?xml"||this.options.ignorePiTags)){const $=new t(I.tagName);$.add(this.options.textNodeName,""),I.tagName!==I.tagExp&&I.attrExpPresent&&($[":@"]=this.buildAttributesMap(I.tagExp,O,I.tagName)),this.addChild(N,$,O)}P=I.closeIndex+1}else if(E.substr(P+1,3)==="!--"){const I=y(E,"-->",P+4,"Comment is not closed.");if(this.options.commentPropName){const $=E.substring(P+4,I-2);x=this.saveTextToParentTag(x,N,O),N.add(this.options.commentPropName,[{[this.options.textNodeName]:$}])}P=I}else if(E.substr(P+1,2)==="!D"){const I=e(E,P);this.docTypeEntities=I.entities,P=I.i}else if(E.substr(P+1,2)==="!["){const I=y(E,"]]>",P,"CDATA is not closed.")-2,$=E.substring(P+9,I);x=this.saveTextToParentTag(x,N,O);let T=this.parseTextData($,N.tagname,O,!0,!1,!0,!0);T==null&&(T=""),this.options.cdataPropName?N.add(this.options.cdataPropName,[{[this.options.textNodeName]:$}]):N.add(this.options.textNodeName,T),P=I+2}else{let I=p(E,P,this.options.removeNSPrefix),$=I.tagName;const T=I.rawTagName;let R=I.tagExp,S=I.attrExpPresent,C=I.closeIndex;this.options.transformTagName&&($=this.options.transformTagName($)),N&&x&&N.tagname!=="!xml"&&(x=this.saveTextToParentTag(x,N,O,!1));const k=N;if(k&&this.options.unpairedTags.indexOf(k.tagname)!==-1&&(N=this.tagsNodeStack.pop(),O=O.substring(0,O.lastIndexOf("."))),$!==v.tagname&&(O+=O?"."+$:$),this.isItStopNode(this.options.stopNodes,O,$)){let L="";if(R.length>0&&R.lastIndexOf("/")===R.length-1)$[$.length-1]==="/"?($=$.substr(0,$.length-1),O=O.substr(0,O.length-1),R=$):R=R.substr(0,R.length-1),P=I.closeIndex;else if(this.options.unpairedTags.indexOf($)!==-1)P=I.closeIndex;else{const z=this.readStopNodeData(E,T,C+1);if(!z)throw new Error(`Unexpected end of ${T}`);P=z.i,L=z.tagContent}const _=new t($);$!==R&&S&&(_[":@"]=this.buildAttributesMap(R,O,$)),L&&(L=this.parseTextData(L,$,O,!0,S,!0,!0)),O=O.substr(0,O.lastIndexOf(".")),_.add(this.options.textNodeName,L),this.addChild(N,_,O)}else{if(R.length>0&&R.lastIndexOf("/")===R.length-1){$[$.length-1]==="/"?($=$.substr(0,$.length-1),O=O.substr(0,O.length-1),R=$):R=R.substr(0,R.length-1),this.options.transformTagName&&($=this.options.transformTagName($));const L=new t($);$!==R&&S&&(L[":@"]=this.buildAttributesMap(R,O,$)),this.addChild(N,L,O),O=O.substr(0,O.lastIndexOf("."))}else{const L=new t($);this.tagsNodeStack.push(N),$!==R&&S&&(L[":@"]=this.buildAttributesMap(R,O,$)),this.addChild(N,L,O),N=L}x="",P=C}}else x+=E[P];return v.child};function c(E,v,N){const x=this.options.updateTag(v.tagname,N,v[":@"]);x===!1||(typeof x=="string"&&(v.tagname=x),E.addChild(v))}const g=function(E){if(this.options.processEntities){for(let v in this.docTypeEntities){const N=this.docTypeEntities[v];E=E.replace(N.regx,N.val)}for(let v in this.lastEntities){const N=this.lastEntities[v];E=E.replace(N.regex,N.val)}if(this.options.htmlEntities)for(let v in this.htmlEntities){const N=this.htmlEntities[v];E=E.replace(N.regex,N.val)}E=E.replace(this.ampEntity.regex,this.ampEntity.val)}return E};function d(E,v,N,x){return E&&(x===void 0&&(x=Object.keys(v.child).length===0),E=this.parseTextData(E,v.tagname,N,!1,v[":@"]?Object.keys(v[":@"]).length!==0:!1,x),E!==void 0&&E!==""&&v.add(this.options.textNodeName,E),E=""),E}function m(E,v,N){const x="*."+N;for(const O in E){const P=E[O];if(x===P||v===P)return!0}return!1}function w(E,v,N=">"){let x,O="";for(let P=v;P",N,`${v} is not closed`);if(E.substring(N+2,P).trim()===v&&(O--,O===0))return{tagContent:E.substring(x,N),i:P};N=P}else if(E[N+1]==="?")N=y(E,"?>",N+1,"StopNode is not closed.");else if(E.substr(N+1,3)==="!--")N=y(E,"-->",N+3,"StopNode is not closed.");else if(E.substr(N+1,2)==="![")N=y(E,"]]>",N,"StopNode is not closed.")-2;else{const P=p(E,N,">");P&&((P&&P.tagName)===v&&P.tagExp[P.tagExp.length-1]!=="/"&&O++,N=P.closeIndex)}}function A(E,v,N){if(v&&typeof E=="string"){const x=E.trim();return x==="true"?!0:x==="false"?!1:r(E,N)}else return n.isExist(E)?E:""}return Qt=u,Qt}var te={},yn;function ns(){if(yn)return te;yn=1;function n(u,f){return t(u,f)}function t(u,f,a){let s;const i={};for(let o=0;o0&&(i[f.textNodeName]=s):s!==void 0&&(i[f.textNodeName]=s),i}function e(u){const f=Object.keys(u);for(let a=0;a0&&(i=n),e(a,s,"",i)}function e(a,s,i,o){let h="",c=!1;for(let g=0;g`,c=!1;continue}else if(m===s.commentPropName){h+=o+``,c=!0;continue}else if(m[0]==="?"){const E=l(d[":@"],s),v=m==="?xml"?"":o;let N=d[m][0][s.textNodeName];N=N.length!==0?" "+N:"",h+=v+`<${m}${N}${E}?>`,c=!0;continue}let y=o;y!==""&&(y+=s.indentBy);const p=l(d[":@"],s),b=o+`<${m}${p}`,A=e(d[m],s,w,y);s.unpairedTags.indexOf(m)!==-1?s.suppressUnpairedNode?h+=b+">":h+=b+"/>":(!A||A.length===0)&&s.suppressEmptyNode?h+=b+"/>":A&&A.endsWith(">")?h+=b+`>${A}${o}`:(h+=b+">",A&&o!==""&&(A.includes("/>")||A.includes("`),c=!0}return h}function r(a){const s=Object.keys(a);for(let i=0;i0&&s.processEntities)for(let i=0;i","g"),val:">"},{regex:new RegExp("<","g"),val:"<"},{regex:new RegExp("'","g"),val:"'"},{regex:new RegExp('"',"g"),val:"""}],processEntities:!0,stopNodes:[],oneListGroup:!1};function r(a){this.options=Object.assign({},e,a),this.options.ignoreAttributes===!0||this.options.attributesGroupName?this.isAttribute=function(){return!1}:(this.ignoreAttributesFn=t(this.options.ignoreAttributes),this.attrPrefixLen=this.options.attributeNamePrefix.length,this.isAttribute=f),this.processTextOrObjNode=l,this.options.format?(this.indentate=u,this.tagEndChar=`> `,this.newLine=` `):(this.indentate=function(){return""},this.tagEndChar=">",this.newLine="")}r.prototype.build=function(a){return this.options.preserveOrder?n(a,this.options):(Array.isArray(a)&&this.options.arrayNodeName&&this.options.arrayNodeName.length>1&&(a={[this.options.arrayNodeName]:a}),this.j2x(a,0,[]).val)},r.prototype.j2x=function(a,s,i){let o="",h="";const c=i.join(".");for(let g in a)if(Object.prototype.hasOwnProperty.call(a,g))if(typeof a[g]>"u")this.isAttribute(g)&&(h+="");else if(a[g]===null)this.isAttribute(g)?h+="":g[0]==="?"?h+=this.indentate(s)+"<"+g+"?"+this.tagEndChar:h+=this.indentate(s)+"<"+g+"/"+this.tagEndChar;else if(a[g]instanceof Date)h+=this.buildTextValNode(a[g],g,"",s);else if(typeof a[g]!="object"){const d=this.isAttribute(g);if(d&&!this.ignoreAttributesFn(d,c))o+=this.buildAttrPairStr(d,""+a[g]);else if(!d)if(g===this.options.textNodeName){let m=this.options.tagValueProcessor(g,""+a[g]);h+=this.replaceEntitiesValue(m)}else h+=this.buildTextValNode(a[g],g,"",s)}else if(Array.isArray(a[g])){const d=a[g].length;let m="",w="";for(let y=0;y"u"))if(p===null)g[0]==="?"?h+=this.indentate(s)+"<"+g+"?"+this.tagEndChar:h+=this.indentate(s)+"<"+g+"/"+this.tagEndChar;else if(typeof p=="object")if(this.options.oneListGroup){const b=this.j2x(p,s+1,i.concat(g));m+=b.val,this.options.attributesGroupName&&p.hasOwnProperty(this.options.attributesGroupName)&&(w+=b.attrStr)}else m+=this.processTextOrObjNode(p,g,s,i);else if(this.options.oneListGroup){let b=this.options.tagValueProcessor(g,p);b=this.replaceEntitiesValue(b),m+=b}else m+=this.buildTextValNode(p,g,"",s)}this.options.oneListGroup&&(m=this.buildObjectNode(m,g,w,s)),h+=m}else if(this.options.attributesGroupName&&g===this.options.attributesGroupName){const d=Object.keys(a[g]),m=d.length;for(let w=0;w"+a+h:this.options.commentPropName!==!1&&s===this.options.commentPropName&&c.length===0?this.indentate(o)+``+this.newLine:this.indentate(o)+"<"+s+i+c+this.tagEndChar+a+this.indentate(o)+h}},r.prototype.closeTag=function(a){let s="";return this.options.unpairedTags.indexOf(a)!==-1?this.options.suppressUnpairedNode||(s="/"):this.options.suppressEmptyNode?s="/":s=`>`+this.newLine;if(this.options.commentPropName!==!1&&s===this.options.commentPropName)return this.indentate(o)+``+this.newLine;if(s[0]==="?")return this.indentate(o)+"<"+s+i+"?"+this.tagEndChar;{let h=this.options.tagValueProcessor(s,a);return h=this.replaceEntitiesValue(h),h===""?this.indentate(o)+"<"+s+i+this.closeTag(s)+this.tagEndChar:this.indentate(o)+"<"+s+i+">"+h+"0&&this.options.processEntities)for(let s=0;sconsole.error("SEMVER",...n):()=>{}),An}var se,Tn;function cr(){if(Tn)return se;Tn=1;const n="2.0.0",t=256,e=Number.MAX_SAFE_INTEGER||9007199254740991,r=16,l=t-6;return se={MAX_LENGTH:t,MAX_SAFE_COMPONENT_LENGTH:r,MAX_SAFE_BUILD_LENGTH:l,MAX_SAFE_INTEGER:e,RELEASE_TYPES:["major","premajor","minor","preminor","patch","prepatch","prerelease"],SEMVER_SPEC_VERSION:n,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2},se}var oe={exports:{}},Pn;function as(){return Pn||(Pn=1,function(n,t){const{MAX_SAFE_COMPONENT_LENGTH:e,MAX_SAFE_BUILD_LENGTH:r,MAX_LENGTH:l}=cr(),u=ur();t=n.exports={};const f=t.re=[],a=t.safeRe=[],s=t.src=[],i=t.t={};let o=0;const h="[a-zA-Z0-9-]",c=[["\\s",1],["\\d",l],[h,r]],g=m=>{for(const[w,y]of c)m=m.split(`${w}*`).join(`${w}{0,${y}}`).split(`${w}+`).join(`${w}{1,${y}}`);return m},d=(m,w,y)=>{const p=g(w),b=o++;u(m,b,w),i[m]=b,s[b]=w,f[b]=new RegExp(w,y?"g":void 0),a[b]=new RegExp(p,y?"g":void 0)};d("NUMERICIDENTIFIER","0|[1-9]\\d*"),d("NUMERICIDENTIFIERLOOSE","\\d+"),d("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${h}*`),d("MAINVERSION",`(${s[i.NUMERICIDENTIFIER]})\\.(${s[i.NUMERICIDENTIFIER]})\\.(${s[i.NUMERICIDENTIFIER]})`),d("MAINVERSIONLOOSE",`(${s[i.NUMERICIDENTIFIERLOOSE]})\\.(${s[i.NUMERICIDENTIFIERLOOSE]})\\.(${s[i.NUMERICIDENTIFIERLOOSE]})`),d("PRERELEASEIDENTIFIER",`(?:${s[i.NUMERICIDENTIFIER]}|${s[i.NONNUMERICIDENTIFIER]})`),d("PRERELEASEIDENTIFIERLOOSE",`(?:${s[i.NUMERICIDENTIFIERLOOSE]}|${s[i.NONNUMERICIDENTIFIER]})`),d("PRERELEASE",`(?:-(${s[i.PRERELEASEIDENTIFIER]}(?:\\.${s[i.PRERELEASEIDENTIFIER]})*))`),d("PRERELEASELOOSE",`(?:-?(${s[i.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${s[i.PRERELEASEIDENTIFIERLOOSE]})*))`),d("BUILDIDENTIFIER",`${h}+`),d("BUILD",`(?:\\+(${s[i.BUILDIDENTIFIER]}(?:\\.${s[i.BUILDIDENTIFIER]})*))`),d("FULLPLAIN",`v?${s[i.MAINVERSION]}${s[i.PRERELEASE]}?${s[i.BUILD]}?`),d("FULL",`^${s[i.FULLPLAIN]}$`),d("LOOSEPLAIN",`[v=\\s]*${s[i.MAINVERSIONLOOSE]}${s[i.PRERELEASELOOSE]}?${s[i.BUILD]}?`),d("LOOSE",`^${s[i.LOOSEPLAIN]}$`),d("GTLT","((?:<|>)?=?)"),d("XRANGEIDENTIFIERLOOSE",`${s[i.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),d("XRANGEIDENTIFIER",`${s[i.NUMERICIDENTIFIER]}|x|X|\\*`),d("XRANGEPLAIN",`[v=\\s]*(${s[i.XRANGEIDENTIFIER]})(?:\\.(${s[i.XRANGEIDENTIFIER]})(?:\\.(${s[i.XRANGEIDENTIFIER]})(?:${s[i.PRERELEASE]})?${s[i.BUILD]}?)?)?`),d("XRANGEPLAINLOOSE",`[v=\\s]*(${s[i.XRANGEIDENTIFIERLOOSE]})(?:\\.(${s[i.XRANGEIDENTIFIERLOOSE]})(?:\\.(${s[i.XRANGEIDENTIFIERLOOSE]})(?:${s[i.PRERELEASELOOSE]})?${s[i.BUILD]}?)?)?`),d("XRANGE",`^${s[i.GTLT]}\\s*${s[i.XRANGEPLAIN]}$`),d("XRANGELOOSE",`^${s[i.GTLT]}\\s*${s[i.XRANGEPLAINLOOSE]}$`),d("COERCEPLAIN",`(^|[^\\d])(\\d{1,${e}})(?:\\.(\\d{1,${e}}))?(?:\\.(\\d{1,${e}}))?`),d("COERCE",`${s[i.COERCEPLAIN]}(?:$|[^\\d])`),d("COERCEFULL",s[i.COERCEPLAIN]+`(?:${s[i.PRERELEASE]})?(?:${s[i.BUILD]})?(?:$|[^\\d])`),d("COERCERTL",s[i.COERCE],!0),d("COERCERTLFULL",s[i.COERCEFULL],!0),d("LONETILDE","(?:~>?)"),d("TILDETRIM",`(\\s*)${s[i.LONETILDE]}\\s+`,!0),t.tildeTrimReplace="$1~",d("TILDE",`^${s[i.LONETILDE]}${s[i.XRANGEPLAIN]}$`),d("TILDELOOSE",`^${s[i.LONETILDE]}${s[i.XRANGEPLAINLOOSE]}$`),d("LONECARET","(?:\\^)"),d("CARETTRIM",`(\\s*)${s[i.LONECARET]}\\s+`,!0),t.caretTrimReplace="$1^",d("CARET",`^${s[i.LONECARET]}${s[i.XRANGEPLAIN]}$`),d("CARETLOOSE",`^${s[i.LONECARET]}${s[i.XRANGEPLAINLOOSE]}$`),d("COMPARATORLOOSE",`^${s[i.GTLT]}\\s*(${s[i.LOOSEPLAIN]})$|^$`),d("COMPARATOR",`^${s[i.GTLT]}\\s*(${s[i.FULLPLAIN]})$|^$`),d("COMPARATORTRIM",`(\\s*)${s[i.GTLT]}\\s*(${s[i.LOOSEPLAIN]}|${s[i.XRANGEPLAIN]})`,!0),t.comparatorTrimReplace="$1$2$3",d("HYPHENRANGE",`^\\s*(${s[i.XRANGEPLAIN]})\\s+-\\s+(${s[i.XRANGEPLAIN]})\\s*$`),d("HYPHENRANGELOOSE",`^\\s*(${s[i.XRANGEPLAINLOOSE]})\\s+-\\s+(${s[i.XRANGEPLAINLOOSE]})\\s*$`),d("STAR","(<|>)?=?\\s*\\*"),d("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),d("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")}(oe,oe.exports)),oe.exports}var ae,In;function us(){if(In)return ae;In=1;const n=Object.freeze({loose:!0}),t=Object.freeze({});return ae=e=>e?typeof e!="object"?n:e:t,ae}var ue,$n;function cs(){if($n)return ue;$n=1;const n=/^[0-9]+$/,t=(e,r)=>{const l=n.test(e),u=n.test(r);return l&&u&&(e=+e,r=+r),e===r?0:l&&!u?-1:u&&!l?1:et(r,e)},ue}var ce,Rn;function lr(){if(Rn)return ce;Rn=1;const n=ur(),{MAX_LENGTH:t,MAX_SAFE_INTEGER:e}=cr(),{safeRe:r,t:l}=as(),u=us(),{compareIdentifiers:f}=cs();class a{constructor(i,o){if(o=u(o),i instanceof a){if(i.loose===!!o.loose&&i.includePrerelease===!!o.includePrerelease)return i;i=i.version}else if(typeof i!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof i}".`);if(i.length>t)throw new TypeError(`version is longer than ${t} characters`);n("SemVer",i,o),this.options=o,this.loose=!!o.loose,this.includePrerelease=!!o.includePrerelease;const h=i.trim().match(o.loose?r[l.LOOSE]:r[l.FULL]);if(!h)throw new TypeError(`Invalid Version: ${i}`);if(this.raw=i,this.major=+h[1],this.minor=+h[2],this.patch=+h[3],this.major>e||this.major<0)throw new TypeError("Invalid major version");if(this.minor>e||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>e||this.patch<0)throw new TypeError("Invalid patch version");h[4]?this.prerelease=h[4].split(".").map(c=>{if(/^[0-9]+$/.test(c)){const g=+c;if(g>=0&&g=0;)typeof this.prerelease[g]=="number"&&(this.prerelease[g]++,g=-2);if(g===-1){if(o===this.prerelease.join(".")&&h===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(c)}}if(o){let g=[o,c];h===!1&&(g=[o]),f(this.prerelease[0],o)===0?isNaN(this.prerelease[1])&&(this.prerelease=g):this.prerelease=g}break}default:throw new Error(`invalid increment argument: ${i}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}}return ce=a,ce}var le,Sn;function ls(){if(Sn)return le;Sn=1;const n=lr();return le=(t,e,r=!1)=>{if(t instanceof n)return t;try{return new n(t,e)}catch(l){if(!r)return null;throw l}},le}var he,Cn;function hs(){if(Cn)return he;Cn=1;const n=ls();return he=(t,e)=>{const r=n(t,e);return r?r.version:null},he}hs();var fe,Ln;function fs(){if(Ln)return fe;Ln=1;const n=lr();return fe=(t,e)=>new n(t,e).major,fe}fs();const Is=function(n){return Zi().registerEntry(n)};export{nt as C,Se as F,As as H,qi as N,et as P,Os as a,Is as b,ws as c,ir as d,Wi as e,sr as f,xs as g,Ns as h,$e as i,Es as j,Ts as k,ys as r,Ps as s}; //# sourceMappingURL=index-BfBM59XC.chunk.mjs.map