import{L as ke,M as Re}from"./Plus-ClaUDINn.chunk.mjs";import{m as Le,n as At,M as Gt,p as _e,o as Fe,t as Me,u as Ue,ai as ft,ar as ht}from"./TrashCanOutline-Das_T9Qh.chunk.mjs";const De=["data-timestamp","title","textContent"],ar=Le({__name:"NcDateTime",props:{timestamp:{},format:{default:()=>({timeStyle:"medium",dateStyle:"short"})},relativeTime:{type:[Boolean,String],default:"long"},ignoreSeconds:{type:Boolean}},setup(n){const t=n,e=At(()=>({format:t.format})),r=At(()=>({ignoreSeconds:t.ignoreSeconds,relativeTime:t.relativeTime||"long",update:t.relativeTime!==!1})),s=ke(Gt(()=>t.timestamp),e),i=Re(Gt(()=>t.timestamp),r),l=At(()=>t.relativeTime?i.value:s.value);return(u,m)=>(Fe(),_e("span",{class:"nc-datetime",dir:"auto","data-timestamp":u.timestamp,title:Ue(s),textContent:Me(l.value)},null,8,De))}});var Pt={},Be={2:n=>{function t(s,i,l){s instanceof RegExp&&(s=e(s,l)),i instanceof RegExp&&(i=e(i,l));var u=r(s,i,l);return u&&{start:u[0],end:u[1],pre:l.slice(0,u[0]),body:l.slice(u[0]+s.length,u[1]),post:l.slice(u[1]+i.length)}}function e(s,i){var l=i.match(s);return l?l[0]:null}function r(s,i,l){var u,m,h,o,c,a=l.indexOf(s),g=l.indexOf(i,a+1),f=a;if(a>=0&&g>0){for(u=[],h=l.length;f>=0&&!c;)f==a?(u.push(f),a=l.indexOf(s,f+1)):u.length==1?c=[u.pop(),g]:((m=u.pop())=0?a:g;u.length&&(c=[h,o])}return c}n.exports=t,t.range=r},101:function(n,t,e){var r;n=e.nmd(n),(function(s){var i=(n&&n.exports,typeof ht=="object"&&ht);i.global!==i&&i.window;var l=function(c){this.message=c};(l.prototype=new Error).name="InvalidCharacterError";var u=function(c){throw new l(c)},m="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",h=/[\t\n\f\r ]/g,o={encode:function(c){c=String(c),/[^\0-\xFF]/.test(c)&&u("The string to be encoded contains characters outside of the Latin1 range.");for(var a,g,f,d,y=c.length%3,A="",p=-1,v=c.length-y;++p>18&63)+m.charAt(d>>12&63)+m.charAt(d>>6&63)+m.charAt(63&d);return y==2?(a=c.charCodeAt(p)<<8,g=c.charCodeAt(++p),A+=m.charAt((d=a+g)>>10)+m.charAt(d>>4&63)+m.charAt(d<<2&63)+"="):y==1&&(d=c.charCodeAt(p),A+=m.charAt(d>>2)+m.charAt(d<<4&63)+"=="),A},decode:function(c){var a=(c=String(c).replace(h,"")).length;a%4==0&&(a=(c=c.replace(/==?$/,"")).length),(a%4==1||/[^+a-zA-Z0-9/]/.test(c))&&u("Invalid character: the string to be decoded is not correctly encoded.");for(var g,f,d=0,y="",A=-1;++A>(-2*d&6)));return y},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,s=e.length;s--;){var i=e.charCodeAt(s);56320<=i&&i<=57343&&s--,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=[],s=0;s{var t,e;t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",e={rotl:function(r,s){return r<>>32-s},rotr:function(r,s){return r<<32-s|r>>>s},endian:function(r){if(r.constructor==Number)return 16711935&e.rotl(r,8)|4278255360&e.rotl(r,24);for(var s=0;s0;r--)s.push(Math.floor(256*Math.random()));return s},bytesToWords:function(r){for(var s=[],i=0,l=0;i>>5]|=r[i]<<24-l%32;return s},wordsToBytes:function(r){for(var s=[],i=0;i<32*r.length;i+=8)s.push(r[i>>>5]>>>24-i%32&255);return s},bytesToHex:function(r){for(var s=[],i=0;i>>4).toString(16)),s.push((15&r[i]).toString(16));return s.join("")},hexToBytes:function(r){for(var s=[],i=0;i>>6*(3-u)&63)):s.push("=");return s.join("")},base64ToBytes:function(r){r=r.replace(/[^A-Z0-9+\/]/gi,"");for(var s=[],i=0,l=0;i>>6-2*l);return s}},n.exports=e},635:(n,t,e)=>{const r=e(31),s=e(338),i=e(221);n.exports={XMLParser:s,XMLValidator:r,XMLBuilder:i}},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]*",s=new RegExp("^"+r+"$");t.isExist=function(i){return i!==void 0},t.isEmptyObject=function(i){return Object.keys(i).length===0},t.merge=function(i,l,u){if(l){const m=Object.keys(l),h=m.length;for(let o=0;o{const r=e(705),s={allowBooleanAttributes:!1,unpairedTags:[]};function i(p){return p===" "||p===" "||p===` `||p==="\r"}function l(p,v){const x=v;for(;v5&&P==="xml")return f("InvalidXml","XML declaration allowed only at the start of the document.",y(p,v));if(p[v]=="?"&&p[v+1]==">"){v++;break}}return v}function u(p,v){if(p.length>v+5&&p[v+1]==="-"&&p[v+2]==="-"){for(v+=3;v"){v+=2;break}}else if(p.length>v+8&&p[v+1]==="D"&&p[v+2]==="O"&&p[v+3]==="C"&&p[v+4]==="T"&&p[v+5]==="Y"&&p[v+6]==="P"&&p[v+7]==="E"){let x=1;for(v+=8;v"&&(x--,x===0))break}else if(p.length>v+9&&p[v+1]==="["&&p[v+2]==="C"&&p[v+3]==="D"&&p[v+4]==="A"&&p[v+5]==="T"&&p[v+6]==="A"&&p[v+7]==="["){for(v+=8;v"){v+=2;break}}return v}t.validate=function(p,v){v=Object.assign({},s,v);const x=[];let P=!1,b=!1;p[0]==="\uFEFF"&&(p=p.substr(1));for(let w=0;w"&&p[w]!==" "&&p[w]!==" "&&p[w]!==` `&&p[w]!=="\r";w++)j+=p[w];if(j=j.trim(),j[j.length-1]==="/"&&(j=j.substring(0,j.length-1),w--),O=j,!r.isName(O)){let C;return C=j.trim().length===0?"Invalid space after '<'.":"Tag '"+j+"' is an invalid name.",f("InvalidTag",C,y(p,w))}const S=o(p,w);if(S===!1)return f("InvalidAttr","Attributes for '"+j+"' have open quote.",y(p,w));let N=S.value;if(w=S.index,N[N.length-1]==="/"){const C=w-N.length;N=N.substring(0,N.length-1);const $=a(N,v);if($!==!0)return f($.err.code,$.err.msg,y(p,C+$.err.line));P=!0}else if(T){if(!S.tagClosed)return f("InvalidTag","Closing tag '"+j+"' doesn't have proper closing.",y(p,w));if(N.trim().length>0)return f("InvalidTag","Closing tag '"+j+"' can't have attributes or invalid starting.",y(p,E));if(x.length===0)return f("InvalidTag","Closing tag '"+j+"' has not been opened.",y(p,E));{const C=x.pop();if(j!==C.tagName){let $=y(p,C.tagStartPos);return f("InvalidTag","Expected closing tag '"+C.tagName+"' (opened in line "+$.line+", col "+$.col+") instead of closing tag '"+j+"'.",y(p,E))}x.length==0&&(b=!0)}}else{const C=a(N,v);if(C!==!0)return f(C.err.code,C.err.msg,y(p,w-N.length+C.err.line));if(b===!0)return f("InvalidXml","Multiple possible root nodes found.",y(p,w));v.unpairedTags.indexOf(j)!==-1||x.push({tagName:j,tagStartPos:E}),P=!0}for(w++;w0)||f("InvalidXml","Invalid '"+JSON.stringify(x.map((w=>w.tagName)),null,4).replace(/\r?\n/g,"")+"' found.",{line:1,col:1}):f("InvalidXml","Start tag expected.",1)};const m='"',h="'";function o(p,v){let x="",P="",b=!1;for(;v"&&P===""){b=!0;break}x+=p[v]}return P===""&&{value:x,index:v,tagClosed:b}}const c=new RegExp(`(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['"])(([\\s\\S])*?)\\5)?`,"g");function a(p,v){const x=r.getAllMatches(p,c),P={};for(let b=0;b{const r=e(87),s=e(118),i={attributeNamePrefix:"@_",attributesGroupName:!1,textNodeName:"#text",ignoreAttributes:!0,cdataPropName:!1,format:!1,indentBy:" ",suppressEmptyNode:!1,suppressUnpairedNode:!0,suppressBooleanAttributes:!0,tagValueProcessor:function(o,c){return c},attributeValueProcessor:function(o,c){return c},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 l(o){this.options=Object.assign({},i,o),this.options.ignoreAttributes===!0||this.options.attributesGroupName?this.isAttribute=function(){return!1}:(this.ignoreAttributesFn=s(this.options.ignoreAttributes),this.attrPrefixLen=this.options.attributeNamePrefix.length,this.isAttribute=h),this.processTextOrObjNode=u,this.options.format?(this.indentate=m,this.tagEndChar=`> `,this.newLine=` `):(this.indentate=function(){return""},this.tagEndChar=">",this.newLine="")}function u(o,c,a,g){const f=this.j2x(o,a+1,g.concat(c));return o[this.options.textNodeName]!==void 0&&Object.keys(o).length===1?this.buildTextValNode(o[this.options.textNodeName],c,f.attrStr,a):this.buildObjectNode(f.val,c,f.attrStr,a)}function m(o){return this.options.indentBy.repeat(o)}function h(o){return!(!o.startsWith(this.options.attributeNamePrefix)||o===this.options.textNodeName)&&o.substr(this.attrPrefixLen)}l.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)},l.prototype.j2x=function(o,c,a){let g="",f="";const d=a.join(".");for(let y in o)if(Object.prototype.hasOwnProperty.call(o,y))if(o[y]===void 0)this.isAttribute(y)&&(f+="");else if(o[y]===null)this.isAttribute(y)?f+="":y[0]==="?"?f+=this.indentate(c)+"<"+y+"?"+this.tagEndChar:f+=this.indentate(c)+"<"+y+"/"+this.tagEndChar;else if(o[y]instanceof Date)f+=this.buildTextValNode(o[y],y,"",c);else if(typeof o[y]!="object"){const A=this.isAttribute(y);if(A&&!this.ignoreAttributesFn(A,d))g+=this.buildAttrPairStr(A,""+o[y]);else if(!A)if(y===this.options.textNodeName){let p=this.options.tagValueProcessor(y,""+o[y]);f+=this.replaceEntitiesValue(p)}else f+=this.buildTextValNode(o[y],y,"",c)}else if(Array.isArray(o[y])){const A=o[y].length;let p="",v="";for(let x=0;x`+this.newLine:this.indentate(g)+"<"+c+a+d+this.tagEndChar+o+this.indentate(g)+f:this.indentate(g)+"<"+c+a+d+">"+o+f}},l.prototype.closeTag=function(o){let c="";return this.options.unpairedTags.indexOf(o)!==-1?this.options.suppressUnpairedNode||(c="/"):c=this.options.suppressEmptyNode?"/":`>`+this.newLine;if(this.options.commentPropName!==!1&&c===this.options.commentPropName)return this.indentate(g)+``+this.newLine;if(c[0]==="?")return this.indentate(g)+"<"+c+a+"?"+this.tagEndChar;{let f=this.options.tagValueProcessor(c,o);return f=this.replaceEntitiesValue(f),f===""?this.indentate(g)+"<"+c+a+this.closeTag(c)+this.tagEndChar:this.indentate(g)+"<"+c+a+">"+f+"0&&this.options.processEntities)for(let c=0;c{function t(l,u,m,h){let o="",c=!1;for(let a=0;a`,c=!1;continue}if(f===u.commentPropName){o+=h+``,c=!0;continue}if(f[0]==="?"){const v=r(g[":@"],u),x=f==="?xml"?"":h;let P=g[f][0][u.textNodeName];P=P.length!==0?" "+P:"",o+=x+`<${f}${P}${v}?>`,c=!0;continue}let y=h;y!==""&&(y+=u.indentBy);const A=h+`<${f}${r(g[":@"],u)}`,p=t(g[f],u,d,y);u.unpairedTags.indexOf(f)!==-1?u.suppressUnpairedNode?o+=A+">":o+=A+"/>":p&&p.length!==0||!u.suppressEmptyNode?p&&p.endsWith(">")?o+=A+`>${p}${h}`:(o+=A+">",p&&h!==""&&(p.includes("/>")||p.includes("`):o+=A+"/>",c=!0}return o}function e(l){const u=Object.keys(l);for(let m=0;m0&&u.processEntities)for(let m=0;m0&&(m=` `),t(l,u,"",m)}},193:(n,t,e)=>{const r=e(705);function s(c,a){let g="";for(;a"){if(y?c[a-1]==="-"&&c[a-2]==="-"&&(y=!1,f--):f--,f===0)break}else c[a]==="["?d=!0:A+=c[a];else{if(d&&l(c,a)){let p,v;a+=7,[p,v,a]=s(c,a+1),v.indexOf("&")===-1&&(g[o(p)]={regx:RegExp(`&${p};`,"g"),val:v})}else if(d&&u(c,a))a+=8;else if(d&&m(c,a))a+=8;else if(d&&h(c,a))a+=9;else{if(!i)throw new Error("Invalid DOCTYPE");y=!0}f++,A=""}if(f!==0)throw new Error("Unclosed DOCTYPE")}return{entities:g,i:a}}},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,s){return s},attributeValueProcessor:function(r,s){return s},stopNodes:[],alwaysCreateTextNode:!1,isArray:()=>!1,commentPropName:!1,unpairedTags:[],processEntities:!0,htmlEntities:!1,ignoreDeclaration:!1,ignorePiTags:!1,transformTagName:!1,transformAttributeName:!1,updateTag:function(r,s,i){return r}};t.buildOptions=function(r){return Object.assign({},e,r)},t.defaultOptions=e},299:(n,t,e)=>{const r=e(705),s=e(365),i=e(193),l=e(494),u=e(118);function m(b){const O=Object.keys(b);for(let w=0;w0)){S||(b=this.replaceEntitiesValue(b));const N=this.options.tagValueProcessor(O,b,w,T,j);return N==null?b:typeof N!=typeof b||N!==b?N:this.options.trimValues||b.trim()===b?P(b,this.options.parseTagValue,this.options.numberParseOptions):b}}function o(b){if(this.options.removeNSPrefix){const O=b.split(":"),w=b.charAt(0)==="/"?"/":"";if(O[0]==="xmlns")return"";O.length===2&&(b=w+O[1])}return b}const c=new RegExp(`([^\\s=]+)\\s*(=\\s*(['"])([\\s\\S]*?)\\3)?`,"gm");function a(b,O,w){if(this.options.ignoreAttributes!==!0&&typeof b=="string"){const E=r.getAllMatches(b,c),T=E.length,j={};for(let S=0;S",j,"Closing Tag is not closed.");let N=b.substring(j+2,S).trim();if(this.options.removeNSPrefix){const k=N.indexOf(":");k!==-1&&(N=N.substr(k+1))}this.options.transformTagName&&(N=this.options.transformTagName(N)),w&&(E=this.saveTextToParentTag(E,w,T));const C=T.substring(T.lastIndexOf(".")+1);if(N&&this.options.unpairedTags.indexOf(N)!==-1)throw new Error(`Unpaired tag can not be used as closing tag: `);let $=0;C&&this.options.unpairedTags.indexOf(C)!==-1?($=T.lastIndexOf(".",T.lastIndexOf(".")-1),this.tagsNodeStack.pop()):$=T.lastIndexOf("."),T=T.substring(0,$),w=this.tagsNodeStack.pop(),E="",j=S}else if(b[j+1]==="?"){let S=v(b,j,!1,"?>");if(!S)throw new Error("Pi Tag is not closed.");if(E=this.saveTextToParentTag(E,w,T),!(this.options.ignoreDeclaration&&S.tagName==="?xml"||this.options.ignorePiTags)){const N=new s(S.tagName);N.add(this.options.textNodeName,""),S.tagName!==S.tagExp&&S.attrExpPresent&&(N[":@"]=this.buildAttributesMap(S.tagExp,T,S.tagName)),this.addChild(w,N,T)}j=S.closeIndex+1}else if(b.substr(j+1,3)==="!--"){const S=p(b,"-->",j+4,"Comment is not closed.");if(this.options.commentPropName){const N=b.substring(j+4,S-2);E=this.saveTextToParentTag(E,w,T),w.add(this.options.commentPropName,[{[this.options.textNodeName]:N}])}j=S}else if(b.substr(j+1,2)==="!D"){const S=i(b,j);this.docTypeEntities=S.entities,j=S.i}else if(b.substr(j+1,2)==="!["){const S=p(b,"]]>",j,"CDATA is not closed.")-2,N=b.substring(j+9,S);E=this.saveTextToParentTag(E,w,T);let C=this.parseTextData(N,w.tagname,T,!0,!1,!0,!0);C==null&&(C=""),this.options.cdataPropName?w.add(this.options.cdataPropName,[{[this.options.textNodeName]:N}]):w.add(this.options.textNodeName,C),j=S+2}else{let S=v(b,j,this.options.removeNSPrefix),N=S.tagName;const C=S.rawTagName;let $=S.tagExp,k=S.attrExpPresent,W=S.closeIndex;this.options.transformTagName&&(N=this.options.transformTagName(N)),w&&E&&w.tagname!=="!xml"&&(E=this.saveTextToParentTag(E,w,T,!1));const M=w;if(M&&this.options.unpairedTags.indexOf(M.tagname)!==-1&&(w=this.tagsNodeStack.pop(),T=T.substring(0,T.lastIndexOf("."))),N!==O.tagname&&(T+=T?"."+N:N),this.isItStopNode(this.options.stopNodes,T,N)){let _="";if($.length>0&&$.lastIndexOf("/")===$.length-1)N[N.length-1]==="/"?(N=N.substr(0,N.length-1),T=T.substr(0,T.length-1),$=N):$=$.substr(0,$.length-1),j=S.closeIndex;else if(this.options.unpairedTags.indexOf(N)!==-1)j=S.closeIndex;else{const F=this.readStopNodeData(b,C,W+1);if(!F)throw new Error(`Unexpected end of ${C}`);j=F.i,_=F.tagContent}const Y=new s(N);N!==$&&k&&(Y[":@"]=this.buildAttributesMap($,T,N)),_&&(_=this.parseTextData(_,N,T,!0,k,!0,!0)),T=T.substr(0,T.lastIndexOf(".")),Y.add(this.options.textNodeName,_),this.addChild(w,Y,T)}else{if($.length>0&&$.lastIndexOf("/")===$.length-1){N[N.length-1]==="/"?(N=N.substr(0,N.length-1),T=T.substr(0,T.length-1),$=N):$=$.substr(0,$.length-1),this.options.transformTagName&&(N=this.options.transformTagName(N));const _=new s(N);N!==$&&k&&(_[":@"]=this.buildAttributesMap($,T,N)),this.addChild(w,_,T),T=T.substr(0,T.lastIndexOf("."))}else{const _=new s(N);this.tagsNodeStack.push(w),N!==$&&k&&(_[":@"]=this.buildAttributesMap($,T,N)),this.addChild(w,_,T),w=_}E="",j=W}}else E+=b[j];return O.child};function f(b,O,w){const E=this.options.updateTag(O.tagname,w,O[":@"]);E===!1||(typeof E=="string"&&(O.tagname=E),b.addChild(O))}const d=function(b){if(this.options.processEntities){for(let O in this.docTypeEntities){const w=this.docTypeEntities[O];b=b.replace(w.regx,w.val)}for(let O in this.lastEntities){const w=this.lastEntities[O];b=b.replace(w.regex,w.val)}if(this.options.htmlEntities)for(let O in this.htmlEntities){const w=this.htmlEntities[O];b=b.replace(w.regex,w.val)}b=b.replace(this.ampEntity.regex,this.ampEntity.val)}return b};function y(b,O,w,E){return b&&(E===void 0&&(E=Object.keys(O.child).length===0),(b=this.parseTextData(b,O.tagname,w,!1,!!O[":@"]&&Object.keys(O[":@"]).length!==0,E))!==void 0&&b!==""&&O.add(this.options.textNodeName,b),b=""),b}function A(b,O,w){const E="*."+w;for(const T in b){const j=b[T];if(E===j||O===j)return!0}return!1}function p(b,O,w,E){const T=b.indexOf(O,w);if(T===-1)throw new Error(E);return T+O.length-1}function v(b,O,w){const E=(function(k,W){let M,_=arguments.length>2&&arguments[2]!==void 0?arguments[2]:">",Y="";for(let F=W;F3&&arguments[3]!==void 0?arguments[3]:">");if(!E)return;let T=E.data;const j=E.index,S=T.search(/\s/);let N=T,C=!0;S!==-1&&(N=T.substring(0,S),T=T.substring(S+1).trimStart());const $=N;if(w){const k=N.indexOf(":");k!==-1&&(N=N.substr(k+1),C=N!==E.data.substr(k+1))}return{tagName:N,tagExp:T,closeIndex:j,attrExpPresent:C,rawTagName:$}}function x(b,O,w){const E=w;let T=1;for(;w",w,`${O} is not closed`);if(b.substring(w+2,j).trim()===O&&(T--,T===0))return{tagContent:b.substring(E,w),i:j};w=j}else if(b[w+1]==="?")w=p(b,"?>",w+1,"StopNode is not closed.");else if(b.substr(w+1,3)==="!--")w=p(b,"-->",w+3,"StopNode is not closed.");else if(b.substr(w+1,2)==="![")w=p(b,"]]>",w,"StopNode is not closed.")-2;else{const j=v(b,w,">");j&&((j&&j.tagName)===O&&j.tagExp[j.tagExp.length-1]!=="/"&&T++,w=j.closeIndex)}}function P(b,O,w){if(O&&typeof b=="string"){const E=b.trim();return E==="true"||E!=="false"&&l(b,w)}return r.isExist(b)?b:""}n.exports=class{constructor(b){this.options=b,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:(O,w)=>String.fromCharCode(Number.parseInt(w,10))},num_hex:{regex:/&#x([0-9a-fA-F]{1,6});/g,val:(O,w)=>String.fromCharCode(Number.parseInt(w,16))}},this.addExternalEntities=m,this.parseXml=g,this.parseTextData=h,this.resolveNameSpace=o,this.buildAttributesMap=a,this.isItStopNode=A,this.replaceEntitiesValue=d,this.readStopNodeData=x,this.saveTextToParentTag=y,this.addChild=f,this.ignoreAttributesFn=u(this.options.ignoreAttributes)}}},338:(n,t,e)=>{const{buildOptions:r}=e(63),s=e(299),{prettify:i}=e(728),l=e(31);n.exports=class{constructor(u){this.externalEntities={},this.options=r(u)}parse(u,m){if(typeof u!="string"){if(!u.toString)throw new Error("XML data is accepted in String or Bytes[] form.");u=u.toString()}if(m){m===!0&&(m={});const c=l.validate(u,m);if(c!==!0)throw Error(`${c.err.msg}:${c.err.line}:${c.err.col}`)}const h=new s(this.options);h.addExternalEntities(this.externalEntities);const o=h.parseXml(u);return this.options.preserveOrder||o===void 0?o:i(o,this.options)}addEntity(u,m){if(m.indexOf("&")!==-1)throw new Error("Entity value can't have '&'");if(u.indexOf("&")!==-1||u.indexOf(";")!==-1)throw new Error("An entity must be set without '&' and ';'. Eg. use '#xD' for ' '");if(m==="&")throw new Error("An entity with value '&' is not permitted");this.externalEntities[u]=m}}},728:(n,t)=>{function e(l,u,m){let h;const o={};for(let c=0;c0&&(o[u.textNodeName]=h):h!==void 0&&(o[u.textNodeName]=h),o}function r(l){const u=Object.keys(l);for(let m=0;m{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),s=e(526).utf8,i=e(135),l=e(526).bin,u=function(m,h){m.constructor==String?m=h&&h.encoding==="binary"?l.stringToBytes(m):s.stringToBytes(m):i(m)?m=Array.prototype.slice.call(m,0):Array.isArray(m)||m.constructor===Uint8Array||(m=m.toString());for(var o=r.bytesToWords(m),c=8*m.length,a=1732584193,g=-271733879,f=-1732584194,d=271733878,y=0;y>>24)|4278255360&(o[y]<<24|o[y]>>>8);o[c>>>5]|=128<>>9<<4)]=c;var A=u._ff,p=u._gg,v=u._hh,x=u._ii;for(y=0;y>>0,g=g+b>>>0,f=f+O>>>0,d=d+w>>>0}return r.endian([a,g,f,d])};u._ff=function(m,h,o,c,a,g,f){var d=m+(h&o|~h&c)+(a>>>0)+f;return(d<>>32-g)+h},u._gg=function(m,h,o,c,a,g,f){var d=m+(h&c|o&~c)+(a>>>0)+f;return(d<>>32-g)+h},u._hh=function(m,h,o,c,a,g,f){var d=m+(h^o^c)+(a>>>0)+f;return(d<>>32-g)+h},u._ii=function(m,h,o,c,a,g,f){var d=m+(o^(h|~c))+(a>>>0)+f;return(d<>>32-g)+h},u._blocksize=16,u._digestsize=16,n.exports=function(m,h){if(m==null)throw new Error("Illegal argument "+m);var o=r.wordsToBytes(u(m,h));return h&&h.asBytes?o:h&&h.asString?l.bytesToString(o):r.bytesToHex(o)}})()},285:(n,t,e)=>{var r=e(2);n.exports=function(A){return A?(A.substr(0,2)==="{}"&&(A="\\{\\}"+A.substr(2)),y((function(p){return p.split("\\\\").join(s).split("\\{").join(i).split("\\}").join(l).split("\\,").join(u).split("\\.").join(m)})(A),!0).map(o)):[]};var s="\0SLASH"+Math.random()+"\0",i="\0OPEN"+Math.random()+"\0",l="\0CLOSE"+Math.random()+"\0",u="\0COMMA"+Math.random()+"\0",m="\0PERIOD"+Math.random()+"\0";function h(A){return parseInt(A,10)==A?parseInt(A,10):A.charCodeAt(0)}function o(A){return A.split(s).join("\\").split(i).join("{").split(l).join("}").split(u).join(",").split(m).join(".")}function c(A){if(!A)return[""];var p=[],v=r("{","}",A);if(!v)return A.split(",");var x=v.pre,P=v.body,b=v.post,O=x.split(",");O[O.length-1]+="{"+P+"}";var w=c(b);return b.length&&(O[O.length-1]+=w.shift(),O.push.apply(O,w)),p.push.apply(p,O),p}function a(A){return"{"+A+"}"}function g(A){return/^-?0\d/.test(A)}function f(A,p){return A<=p}function d(A,p){return A>=p}function y(A,p){var v=[],x=r("{","}",A);if(!x)return[A];var P=x.pre,b=x.post.length?y(x.post,!1):[""];if(/\$$/.test(x.pre))for(var O=0;O=0;if(!N&&!C)return x.post.match(/,.*\}/)?y(A=x.pre+"{"+x.body+l+x.post):[A];if(N)E=x.body.split(/\.\./);else if((E=c(x.body)).length===1&&(E=y(E[0],!1).map(a)).length===1)return b.map((function(Ie){return x.pre+E[0]+Ie}));if(N){var $=h(E[0]),k=h(E[1]),W=Math.max(E[0].length,E[1].length),M=E.length==3?Math.abs(h(E[2])):1,_=f;k<$&&(M*=-1,_=d);var Y=E.some(g);T=[];for(var F=$;_(F,k);F+=M){var z;if(S)(z=String.fromCharCode(F))==="\\"&&(z="");else if(z=String(F),Y){var Vt=W-z.length;if(Vt>0){var qt=new Array(Vt+1).join("0");z=F<0?"-"+qt+z.slice(1):qt+z}}T.push(z)}}else{T=[];for(var et=0;et{function t(h){return t=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(o){return typeof o}:function(o){return o&&typeof Symbol=="function"&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},t(h)}function e(h){var o=typeof Map=="function"?new Map:void 0;return e=function(c){if(c===null||(a=c,Function.toString.call(a).indexOf("[native code]")===-1))return c;var a;if(typeof c!="function")throw new TypeError("Super expression must either be null or a function");if(o!==void 0){if(o.has(c))return o.get(c);o.set(c,g)}function g(){return r(c,arguments,i(this).constructor)}return g.prototype=Object.create(c.prototype,{constructor:{value:g,enumerable:!1,writable:!0,configurable:!0}}),s(g,c)},e(h)}function r(h,o,c){return r=(function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch{return!1}})()?Reflect.construct:function(a,g,f){var d=[null];d.push.apply(d,g);var y=new(Function.bind.apply(a,d));return f&&s(y,f.prototype),y},r.apply(null,arguments)}function s(h,o){return s=Object.setPrototypeOf||function(c,a){return c.__proto__=a,c},s(h,o)}function i(h){return i=Object.setPrototypeOf?Object.getPrototypeOf:function(o){return o.__proto__||Object.getPrototypeOf(o)},i(h)}var l=(function(h){function o(c){var a;return(function(g,f){if(!(g instanceof f))throw new TypeError("Cannot call a class as a function")})(this,o),(a=(function(g,f){return!f||t(f)!=="object"&&typeof f!="function"?(function(d){if(d===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return d})(g):f})(this,i(o).call(this,c))).name="ObjectPrototypeMutationError",a}return(function(c,a){if(typeof a!="function"&&a!==null)throw new TypeError("Super expression must either be null or a function");c.prototype=Object.create(a&&a.prototype,{constructor:{value:c,writable:!0,configurable:!0}}),a&&s(c,a)})(o,h),o})(e(Error));function u(h,o){for(var c=arguments.length>2&&arguments[2]!==void 0?arguments[2]:function(){},a=o.split("."),g=a.length,f=function(A){var p=a[A];if(!h)return{v:void 0};if(p==="+"){if(Array.isArray(h))return{v:h.map((function(x,P){var b=a.slice(A+1);return b.length>0?u(x,b.join("."),c):c(h,P,a,A)}))};var v=a.slice(0,A).join(".");throw new Error("Object at wildcard (".concat(v,") is not an array"))}h=c(h,p,a,A)},d=0;d2&&arguments[2]!==void 0?arguments[2]:{};if(t(h)!="object"||h===null||o===void 0)return!1;if(typeof o=="number")return o in h;try{var a=!1;return u(h,o,(function(g,f,d,y){if(!m(d,y))return g&&g[f];a=c.own?g.hasOwnProperty(f):f in g})),a}catch{return!1}},hasOwn:function(h,o,c){return this.has(h,o,c||{own:!0})},isIn:function(h,o,c){var a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};if(t(h)!="object"||h===null||o===void 0)return!1;try{var g=!1,f=!1;return u(h,o,(function(d,y,A,p){return g=g||d===c||!!d&&d[y]===c,f=m(A,p)&&t(d)==="object"&&y in d,d&&d[y]})),a.validPath?g&&f:g}catch{return!1}},ObjectPrototypeMutationError:l}},47:(n,t,e)=>{var r=e(410),s=function(h){return typeof h=="string"};function i(h,o){for(var c=[],a=0;a=-1&&!o;c--){var a=c>=0?arguments[c]:ft.cwd();if(!s(a))throw new TypeError("Arguments to path.resolve must be strings");a&&(h=a+"/"+h,o=a.charAt(0)==="/")}return(o?"/":"")+(h=i(h.split("/"),!o).join("/"))||"."},u.normalize=function(h){var o=u.isAbsolute(h),c=h.substr(-1)==="/";return(h=i(h.split("/"),!o).join("/"))||o||(h="."),h&&c&&(h+="/"),(o?"/":"")+h},u.isAbsolute=function(h){return h.charAt(0)==="/"},u.join=function(){for(var h="",o=0;o=0&&p[x]==="";x--);return v>x?[]:p.slice(v,x+1)}h=u.resolve(h).substr(1),o=u.resolve(o).substr(1);for(var a=c(h.split("/")),g=c(o.split("/")),f=Math.min(a.length,g.length),d=f,y=0;y{var e=Object.prototype.hasOwnProperty;function r(i){try{return decodeURIComponent(i.replace(/\+/g," "))}catch{return null}}function s(i){try{return encodeURIComponent(i)}catch{return null}}t.stringify=function(i,l){l=l||"";var u,m,h=[];for(m in typeof l!="string"&&(l="?"),i)if(e.call(i,m)){if((u=i[m])||u!=null&&!isNaN(u)||(u=""),m=s(m),u=s(u),m===null||u===null)continue;h.push(m+"="+u)}return h.length?l+h.join("&"):""},t.parse=function(i){for(var l,u=/([^=?#&]+)=?([^&]*)/g,m={};l=u.exec(i);){var h=r(l[1]),o=r(l[2]);h===null||o===null||h in m||(m[h]=o)}return m}},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(s){let i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(i=Object.assign({},r,i),!s||typeof s!="string")return s;let l=s.trim();if(i.skipLike!==void 0&&i.skipLike.test(l))return s;if(i.hex&&t.test(l))return Number.parseInt(l,16);{const m=e.exec(l);if(m){const h=m[1],o=m[2];let c=((u=m[3])&&u.indexOf(".")!==-1&&((u=u.replace(/0+$/,""))==="."?u="0":u[0]==="."?u="0"+u:u[u.length-1]==="."&&(u=u.substr(0,u.length-1))),u);const a=m[4]||m[6];if(!i.leadingZeros&&o.length>0&&h&&l[2]!=="."||!i.leadingZeros&&o.length>0&&!h&&l[1]!==".")return s;{const g=Number(l),f=""+g;return f.search(/[eE]/)!==-1||a?i.eNotation?g:s:l.indexOf(".")!==-1?f==="0"&&c===""||f===c||h&&f==="-"+c?g:s:o?c===f||h+c===f?g:s:l===f||l===h+f?g:s}}return s}var u}},737:(n,t,e)=>{var r=e(670),s=e(647),i=/^[\x00-\x20\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]+/,l=/[\n\r\t]/g,u=/^[A-Za-z][A-Za-z0-9+-.]*:\/\//,m=/:\d+$/,h=/^([a-z][a-z0-9.+-]*:)?(\/\/)?([\\/]+)?([\S\s]*)/i,o=/^[a-zA-Z]:/;function c(p){return(p||"").toString().replace(i,"")}var a=[["#","hash"],["?","query"],function(p,v){return d(v.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 f(p){var v,x=(typeof window<"u"?window:typeof ht<"u"?ht:typeof self<"u"?self:{}).location||{},P={},b=typeof(p=p||x);if(p.protocol==="blob:")P=new A(unescape(p.pathname),{});else if(b==="string")for(v in P=new A(p,{}),g)delete P[v];else if(b==="object"){for(v in p)v in g||(P[v]=p[v]);P.slashes===void 0&&(P.slashes=u.test(p.href))}return P}function d(p){return p==="file:"||p==="ftp:"||p==="http:"||p==="https:"||p==="ws:"||p==="wss:"}function y(p,v){p=(p=c(p)).replace(l,""),v=v||{};var x,P=h.exec(p),b=P[1]?P[1].toLowerCase():"",O=!!P[2],w=!!P[3],E=0;return O?w?(x=P[2]+P[3]+P[4],E=P[2].length+P[3].length):(x=P[2]+P[4],E=P[2].length):w?(x=P[3]+P[4],E=P[3].length):x=P[4],b==="file:"?E>=2&&(x=x.slice(2)):d(b)?x=P[4]:b?O&&(x=x.slice(2)):E>=2&&d(v.protocol)&&(x=P[4]),{protocol:b,slashes:O||d(b),slashesCount:E,rest:x}}function A(p,v,x){if(p=(p=c(p)).replace(l,""),!(this instanceof A))return new A(p,v,x);var P,b,O,w,E,T,j=a.slice(),S=typeof v,N=this,C=0;for(S!=="object"&&S!=="string"&&(x=v,v=null),x&&typeof x!="function"&&(x=s.parse),P=!(b=y(p||"",v=f(v))).protocol&&!b.slashes,N.slashes=b.slashes||P&&v.slashes,N.protocol=b.protocol||v.protocol||"",p=b.rest,(b.protocol==="file:"&&(b.slashesCount!==2||o.test(p))||!b.slashes&&(b.protocol||b.slashesCount<2||!d(N.protocol)))&&(j[3]=[/(.*)/,"pathname"]);C{},388:()=>{},805:()=>{},345:()=>{},800:()=>{}},Zt={};function I(n){var t=Zt[n];if(t!==void 0)return t.exports;var e=Zt[n]={id:n,loaded:!1,exports:{}};return Be[n].call(e.exports,e,e.exports,I),e.loaded=!0,e.exports}I.n=n=>{var t=n&&n.__esModule?()=>n.default:()=>n;return I.d(t,{a:t}),t},I.d=(n,t)=>{for(var e in t)I.o(t,e)&&!I.o(n,e)&&Object.defineProperty(n,e,{enumerable:!0,get:t[e]})},I.o=(n,t)=>Object.prototype.hasOwnProperty.call(n,t),I.nmd=n=>(n.paths=[],n.children||(n.children=[]),n);var J={};I.d(J,{hT:()=>G,O4:()=>tt,Kd:()=>Ke,YK:()=>He,UU:()=>or,Gu:()=>me,ky:()=>Oe,h4:()=>ct,ch:()=>xt,hq:()=>nt,i5:()=>Ee});var We=I(737),ze=I.n(We);function Nt(n){if(!It(n))throw new Error("Parameter was not an error")}function It(n){return!!n&&typeof n=="object"&&(t=n,Object.prototype.toString.call(t)==="[object Error]")||n instanceof Error;var t}class X extends Error{constructor(t,e){const r=[...arguments],{options:s,shortMessage:i}=(function(u){let m,h="";if(u.length===0)m={};else if(It(u[0]))m={cause:u[0]},h=u.slice(1).join(" ")||"";else if(u[0]&&typeof u[0]=="object")m=Object.assign({},u[0]),h=u.slice(1).join(" ")||"";else{if(typeof u[0]!="string")throw new Error("Invalid arguments passed to Layerr");m={},h=h=u.join(" ")||""}return{options:m,shortMessage:h}})(r);let l=i;if(s.cause&&(l=`${l}: ${s.cause.message}`),super(l),this.message=l,s.name&&typeof s.name=="string"?this.name=s.name:this.name="Layerr",s.cause&&Object.defineProperty(this,"_cause",{value:s.cause}),Object.defineProperty(this,"_info",{value:{}}),s.info&&typeof s.info=="object"&&Object.assign(this._info,s.info),Error.captureStackTrace){const u=s.constructorOpt||this.constructor;Error.captureStackTrace(this,u)}}static cause(t){return Nt(t),t._cause&&It(t._cause)?t._cause:null}static fullStack(t){Nt(t);const e=X.cause(t);return e?`${t.stack} caused by: ${X.fullStack(e)}`:t.stack??""}static info(t){Nt(t);const e={},r=X.cause(t);return r&&Object.assign(e,X.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 Ve=I(47),gt=I.n(Ve);const Xt="__PATH_SEPARATOR_POSIX__",Yt="__PATH_SEPARATOR_WINDOWS__";function R(n){try{const t=n.replace(/\//g,Xt).replace(/\\\\/g,Yt);return encodeURIComponent(t).split(Yt).join("\\\\").split(Xt).join("/")}catch(t){throw new X(t,"Failed encoding path")}}function Kt(n){return n.startsWith("/")?n:"/"+n}function lt(n){let t=n;return t[0]!=="/"&&(t="/"+t),/^.+\/$/.test(t)&&(t=t.substr(0,t.length-1)),t}function qe(n){let t=new(ze())(n).pathname;return t.length<=0&&(t="/"),lt(t)}function L(){for(var n=arguments.length,t=new Array(n),e=0;e1){var i=r.shift();r[0]=i+r[0]}r[0].match(/^file:\/\/\//)?r[0]=r[0].replace(/^([^/:]+):\/*/,"$1:///"):r[0]=r[0].replace(/^([^/:]+):\/*/,"$1://");for(var l=0;l0&&(u=u.replace(/^[\/]+/,"")),u=l0?"?":"")+h.join("&")})(typeof arguments[0]=="object"?arguments[0]:[].slice.call(arguments))})(t.reduce(((r,s,i)=>((i===0||s!=="/"||s==="/"&&r[r.length-1]!=="/")&&r.push(s),r)),[]))}var Ge=I(542),st=I.n(Ge);const Ze="abcdef0123456789";function Ht(n,t){const e=n.url.replace("//",""),r=e.indexOf("/")==-1?"/":e.slice(e.indexOf("/")),s=n.method?n.method.toUpperCase():"GET",i=!!/(^|,)\s*auth\s*($|,)/.test(t.qop)&&"auth",l=`00000000${t.nc}`.slice(-8),u=(function(a,g,f,d,y,A,p){const v=p||st()(`${g}:${f}:${d}`);return a&&a.toLowerCase()==="md5-sess"?st()(`${v}:${y}:${A}`):v})(t.algorithm,t.username,t.realm,t.password,t.nonce,t.cnonce,t.ha1),m=st()(`${s}:${r}`),h=i?st()(`${u}:${t.nonce}:${l}:${t.cnonce}:${i}:${m}`):st()(`${u}:${t.nonce}:${m}`),o={username:t.username,realm:t.realm,nonce:t.nonce,uri:r,qop:i,response:h,nc:l,cnonce:t.cnonce,algorithm:t.algorithm,opaque:t.opaque},c=[];for(const a in o)o[a]&&(a==="qop"||a==="nc"||a==="algorithm"?c.push(`${a}=${o[a]}`):c.push(`${a}="${o[a]}"`));return`Digest ${c.join(", ")}`}function fe(n){return(n.headers&&n.headers.get("www-authenticate")||"").split(/\s/)[0].toLowerCase()==="digest"}var Xe=I(101),ge=I.n(Xe);function Jt(n){return ge().decode(n)}function Qt(n,t){var e;return`Basic ${e=`${n}:${t}`,ge().encode(e)}`}const dt=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope?self:typeof window<"u"?window:globalThis,Ye=dt.fetch.bind(dt),Ke=dt.Request,He=dt.Response;let G=(function(n){return n.Auto="auto",n.Digest="digest",n.None="none",n.Password="password",n.Token="token",n})({}),tt=(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 de(n,t,e,r,s){switch(n.authType){case G.Auto:t&&e&&(n.headers.Authorization=Qt(t,e));break;case G.Digest:n.digest=(function(l,u,m){return{username:l,password:u,ha1:m,nc:0,algorithm:"md5",hasDigestAuth:!1}})(t,e,s);break;case G.None:break;case G.Password:n.headers.Authorization=Qt(t,e);break;case G.Token:n.headers.Authorization=`${(i=r).token_type} ${i.access_token}`;break;default:throw new X({info:{code:tt.InvalidAuthType}},`Invalid auth type: ${n.authType}`)}var i}I(345),I(800);const te="@@HOTPATCHER",Je=()=>{};function Ot(n){return{original:n,methods:[n],final:!1}}class Qe{constructor(){this._configuration={registry:{},getEmptyAction:"null"},this.__type__=te}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__!==te)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)||Je;for(var r=arguments.length,s=new Array(r>1?r-1:0),i=1;i0;)h=[s.shift().apply(o,h)];return h[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:s=!1}=r;if(this.configuration.registry[t]&&this.configuration.registry[t].final)throw new Error(`Failed patching '${t}': Method marked as being final`);if(typeof e!="function")throw new Error(`Failed patching '${t}': Provided method is not a function`);if(s)this.configuration.registry[t]?this.configuration.registry[t].methods.push(e):this.configuration.registry[t]=Ot(e);else if(this.isPatched(t)){const{original:i}=this.configuration.registry[t];this.configuration.registry[t]=Object.assign(Ot(e),{original:i})}else this.configuration.registry[t]=Ot(e);return this}patchInline(t,e){this.isPatched(t)||this.patch(t,e);for(var r=arguments.length,s=new Array(r>2?r-2:0),i=2;i1?e-1:0),s=1;s{this.patch(t,i,{chain:!0})})),this}restore(t){if(!this.isPatched(t))throw new Error(`Failed restoring method: No method present for key: ${t}`);if(typeof this.configuration.registry[t].original!="function")throw new Error(`Failed restoring method: Original method not found or of invalid type for key: ${t}`);return this.configuration.registry[t].methods=[this.configuration.registry[t].original],this}setFinal(t){if(!this.configuration.registry.hasOwnProperty(t))throw new Error(`Failed marking '${t}' as final: No method found for key`);return this.configuration.registry[t].final=!0,this}}let Et=null;function me(){return Et||(Et=new Qe),Et}function mt(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 ee(){for(var n=arguments.length,t=new Array(n),e=0;e0;){const i=s.shift();r=r?ye(r,i):mt(i)}return r}function ye(n,t){const e=mt(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]?ye(e[r],t[r]):mt(t[r]):e[r]=t[r]:e[r]=t[r]})),e}function tn(n){const t={};for(const e of n.keys())t[e]=n.get(e);return t}function kt(){for(var n=arguments.length,t=new Array(n),e=0;e(Object.keys(i).forEach((l=>{const u=l.toLowerCase();r.hasOwnProperty(u)?s[r[u]]=i[l]:(r[u]=l,s[l]=i[l])})),s)),{})}I(805);const en=typeof ArrayBuffer=="function",{toString:nn}=Object.prototype;function ve(n){return en&&(n instanceof ArrayBuffer||nn.call(n)==="[object ArrayBuffer]")}function be(n){return n!=null&&n.constructor!=null&&typeof n.constructor.isBuffer=="function"&&n.constructor.isBuffer(n)}function Ft(n){return function(){for(var t=[],e=0;et.patchInline("fetch",Ye,e.url,(function(r){let s={};const i={method:r.method};if(r.headers&&(s=kt(s,r.headers)),r.data!==void 0){const[l,u]=(function(m){if(typeof m=="string")return[m,{}];if(be(m))return[m,{}];if(ve(m))return[m,{}];if(m&&typeof m=="object")return[JSON.stringify(m),{"content-type":"application/json"}];throw new Error("Unable to convert request body: Unexpected body type: "+typeof m)})(r.data);i.body=l,s=kt(s,u)}return r.signal&&(i.signal=r.signal),r.withCredentials&&(i.credentials="include"),i.headers=s,i})(e))),n)}var on=I(285);const vt=n=>{if(typeof n!="string")throw new TypeError("invalid pattern");if(n.length>65536)throw new TypeError("pattern is too long")},sn={"[: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]},it=n=>n.replace(/[[\]\\-]/g,"\\$&"),ne=n=>n.join(""),an=(n,t)=>{const e=t;if(n.charAt(e)!=="[")throw new Error("not in a brace expression");const r=[],s=[];let i=e+1,l=!1,u=!1,m=!1,h=!1,o=e,c="";t:for(;ic?r.push(it(c)+"-"+it(d)):d===c&&r.push(it(d)),c="",i++):n.startsWith("-]",i+1)?(r.push(it(d+"-")),i+=2):n.startsWith("-",i+1)?(c=d,i+=2):(r.push(it(d)),i++)}else m=!0,i++}else h=!0,i++}if(o1&&arguments[1]!==void 0?arguments[1]:{};return t?n.replace(/\[([^\/\\])\]/g,"$1"):n.replace(/((?!\\).|^)\[([^\/\\])\]/g,"$1$2").replace(/\\([^\/])/g,"$1")},un=new Set(["!","?","+","*","@"]),re=n=>un.has(n),Tt="(?!\\.)",ln=new Set(["[","."]),cn=new Set(["..","."]),hn=new Set("().*{}+?[]^$\\!"),Mt="[^/]",oe=Mt+"*?",se=Mt+"+?";class q{type;#n;#r;#s=!1;#t=[];#e;#i;#u;#a=!1;#o;#l;#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.#o=this.#n===this?r:this.#n.#o,this.#u=this.#n===this?[]:this.#n.#u,t!=="!"||this.#n.#a||this.#u.push(this),this.#i=this.#e?this.#e.#t.length:0}get hasMagic(){if(this.#r!==void 0)return this.#r;for(const t of this.#t)if(typeof t!="string"&&(t.type||t.hasMagic))return this.#r=!0;return this.#r}toString(){return this.#l!==void 0?this.#l:this.type?this.#l=this.type+"("+this.#t.map((t=>String(t))).join("|")+")":this.#l=this.#t.map((t=>String(t))).join("")}#f(){if(this!==this.#n)throw new Error("should only call on root");if(this.#a)return this;let t;for(this.toString(),this.#a=!0;t=this.#u.pop();){if(t.type!=="!")continue;let e=t,r=e.#e;for(;r;){for(let s=e.#i+1;!r.type&&stypeof 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.#i===0)return!0;const t=this.#e;for(let e=0;e1&&arguments[1]!==void 0?arguments[1]:{};const r=new q(null,void 0,e);return q.#c(t,r,0,e),r}toMMPattern(){if(this!==this.#n)return this.#n.toMMPattern();const t=this.toString(),[e,r,s,i]=this.toRegExpSource();if(!(s||this.#r||this.#o.nocase&&!this.#o.nocaseMagicOnly&&t.toUpperCase()!==t.toLowerCase()))return r;const l=(this.#o.nocase?"i":"")+(i?"u":"");return Object.assign(new RegExp(`^${e}$`,l),{_src:e,_glob:t})}get options(){return this.#o}toRegExpSource(t){const e=t??!!this.#o.dot;if(this.#n===this&&this.#f(),!this.type){const m=this.isStart()&&this.isEnd(),h=this.#t.map((a=>{const[g,f,d,y]=typeof a=="string"?q.#g(a,this.#r,m):a.toRegExpSource(t);return this.#r=this.#r||d,this.#s=this.#s||y,g})).join("");let o="";if(this.isStart()&&typeof this.#t[0]=="string"&&(this.#t.length!==1||!cn.has(this.#t[0]))){const a=ln,g=e&&a.has(h.charAt(0))||h.startsWith("\\.")&&a.has(h.charAt(2))||h.startsWith("\\.\\.")&&a.has(h.charAt(4)),f=!e&&!t&&a.has(h.charAt(0));o=g?"(?!(?:^|/)\\.\\.?(?:$|/))":f?Tt:""}let c="";return this.isEnd()&&this.#n.#a&&this.#e?.type==="!"&&(c="(?:$|\\/)"),[o+h+c,at(h),this.#r=!!this.#r,this.#s]}const r=this.type==="*"||this.type==="+",s=this.type==="!"?"(?:(?!(?:":"(?:";let i=this.#p(e);if(this.isStart()&&this.isEnd()&&!i&&this.type!=="!"){const m=this.toString();return this.#t=[m],this.type=null,this.#r=void 0,[m,at(this.toString()),!1,!1]}let l=!r||t||e?"":this.#p(!0);l===i&&(l=""),l&&(i=`(?:${i})(?:${l})*?`);let u="";return u=this.type==="!"&&this.#h?(this.isStart()&&!e?Tt:"")+se:s+i+(this.type==="!"?"))"+(!this.isStart()||e||t?"":Tt)+oe+")":this.type==="@"?")":this.type==="?"?")?":this.type==="+"&&l?")":this.type==="*"&&l?")?":`)${this.type}`),[u,at(i),this.#r=!!this.#r,this.#s]}#p(t){return this.#t.map((e=>{if(typeof e=="string")throw new Error("string type in extglob ast??");const[r,s,i,l]=e.toRegExpSource(t);return this.#s=this.#s||l,r})).filter((e=>!(this.isStart()&&this.isEnd()&&!e))).join("|")}static#g(t,e){let r=arguments.length>2&&arguments[2]!==void 0&&arguments[2],s=!1,i="",l=!1;for(let u=0;u2&&arguments[2]!==void 0?arguments[2]:{};return vt(t),!(!e.nocomment&&t.charAt(0)==="#")&&new bt(t,e).match(n)},pn=/^\*+([^+@!?\*\[\(]*)$/,fn=n=>t=>!t.startsWith(".")&&t.endsWith(n),gn=n=>t=>t.endsWith(n),dn=n=>(n=n.toLowerCase(),t=>!t.startsWith(".")&&t.toLowerCase().endsWith(n)),mn=n=>(n=n.toLowerCase(),t=>t.toLowerCase().endsWith(n)),yn=/^\*+\.\*+$/,vn=n=>!n.startsWith(".")&&n.includes("."),bn=n=>n!=="."&&n!==".."&&n.includes("."),wn=/^\.\*+$/,xn=n=>n!=="."&&n!==".."&&n.startsWith("."),An=/^\*+$/,Pn=n=>n.length!==0&&!n.startsWith("."),Nn=n=>n.length!==0&&n!=="."&&n!=="..",On=/^\?+([^+@!?\*\[\(]*)?$/,En=n=>{let[t,e=""]=n;const r=xe([t]);return e?(e=e.toLowerCase(),s=>r(s)&&s.toLowerCase().endsWith(e)):r},Tn=n=>{let[t,e=""]=n;const r=Ae([t]);return e?(e=e.toLowerCase(),s=>r(s)&&s.toLowerCase().endsWith(e)):r},jn=n=>{let[t,e=""]=n;const r=Ae([t]);return e?s=>r(s)&&s.endsWith(e):r},Sn=n=>{let[t,e=""]=n;const r=xe([t]);return e?s=>r(s)&&s.endsWith(e):r},xe=n=>{let[t]=n;const e=t.length;return r=>r.length===e&&!r.startsWith(".")},Ae=n=>{let[t]=n;const e=t.length;return r=>r.length===e&&r!=="."&&r!==".."},Pe=typeof ft=="object"&&ft?typeof Pt=="object"&&Pt&&Pt.__MINIMATCH_TESTING_PLATFORM__||ft.platform:"posix";V.sep=Pe==="win32"?"\\":"/";const H=Symbol("globstar **");V.GLOBSTAR=H,V.filter=function(n){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return e=>V(e,n,t)};const K=function(n){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return Object.assign({},n,t)};V.defaults=n=>{if(!n||typeof n!="object"||!Object.keys(n).length)return V;const t=V;return Object.assign((function(e,r){return t(e,r,K(n,arguments.length>2&&arguments[2]!==void 0?arguments[2]:{}))}),{Minimatch:class extends t.Minimatch{constructor(e){super(e,K(n,arguments.length>1&&arguments[1]!==void 0?arguments[1]:{}))}static defaults(e){return t.defaults(K(n,e)).Minimatch}},AST:class extends t.AST{constructor(e,r){super(e,r,K(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,K(n,r))}},unescape:function(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return t.unescape(e,K(n,r))},escape:function(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return t.escape(e,K(n,r))},filter:function(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return t.filter(e,K(n,r))},defaults:e=>t.defaults(K(n,e)),makeRe:function(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return t.makeRe(e,K(n,r))},braceExpand:function(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return t.braceExpand(e,K(n,r))},match:function(e,r){let s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return t.match(e,r,K(n,s))},sep:t.sep,GLOBSTAR:H})};const Ne=function(n){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return vt(n),t.nobrace||!/\{(?:(?!\{).)*\}/.test(n)?[n]:on(n)};V.braceExpand=Ne,V.makeRe=function(n){return new bt(n,arguments.length>1&&arguments[1]!==void 0?arguments[1]:{}).makeRe()},V.match=function(n,t){const e=new bt(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 ie=/[?*]|[+@!]\(.*?\)|\[|\]/;class bt{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]:{};vt(t),e=e||{},this.options=e,this.pattern=t,this.platform=e.platform||Pe,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((i=>this.slashSplit(i)));this.globParts=this.preprocess(r),this.debug(this.pattern,this.globParts);let s=this.globParts.map(((i,l,u)=>{if(this.isWindows&&this.windowsNoMagicRoot){const m=!(i[0]!==""||i[1]!==""||i[2]!=="?"&&ie.test(i[2])||ie.test(i[3])),h=/^[a-z]:/i.test(i[0]);if(m)return[...i.slice(0,4),...i.slice(4).map((o=>this.parse(o)))];if(h)return[i[0],...i.slice(1).map((o=>this.parse(o)))]}return i.map((m=>this.parse(m)))}));if(this.debug(this.pattern,s),this.set=s.filter((i=>i.indexOf(!1)===-1)),this.isWindows)for(let i=0;i=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 s=r;for(;e[s+1]==="**";)s++;s!==r&&e.splice(r,s-r)}return e}))}levelOneOptimize(t){return t.map((e=>(e=e.reduce(((r,s)=>{const i=r[r.length-1];return s==="**"&&i==="**"?r:s===".."&&i&&i!==".."&&i!=="."&&i!=="**"?(r.pop(),r):(r.push(s),r)}),[])).length===0?[""]:e))}levelTwoFileOptimize(t){Array.isArray(t)||(t=this.slashSplit(t));let e=!1;do{if(e=!1,!this.preserveMultipleSlashes){for(let s=1;ss&&r.splice(s+1,l-s);let u=r[s+1];const m=r[s+2],h=r[s+3];if(u!==".."||!m||m==="."||m===".."||!h||h==="."||h==="..")continue;e=!0,r.splice(s,1);const o=r.slice(0);o[s]="**",t.push(o),s--}if(!this.preserveMultipleSlashes){for(let l=1;le.length))}partsMatch(t,e){let r=arguments.length>2&&arguments[2]!==void 0&&arguments[2],s=0,i=0,l=[],u="";for(;s2&&arguments[2]!==void 0&&arguments[2];const s=this.options;if(this.isWindows){const d=typeof t[0]=="string"&&/^[a-z]:$/i.test(t[0]),y=!d&&t[0]===""&&t[1]===""&&t[2]==="?"&&/^[a-z]:$/i.test(t[3]),A=typeof e[0]=="string"&&/^[a-z]:$/i.test(e[0]),p=y?3:d?0:void 0,v=!A&&e[0]===""&&e[1]===""&&e[2]==="?"&&typeof e[3]=="string"&&/^[a-z]:$/i.test(e[3])?3:A?0:void 0;if(typeof p=="number"&&typeof v=="number"){const[x,P]=[t[p],e[v]];x.toLowerCase()===P.toLowerCase()&&(e[v]=x,v>p?e=e.slice(v):p>v&&(t=t.slice(p)))}}const{optimizationLevel:i=1}=this.options;i>=2&&(t=this.levelTwoFileOptimize(t)),this.debug("matchOne",this,{file:t,pattern:e}),this.debug("matchOne",t.length,e.length);for(var l=0,u=0,m=t.length,h=e.length;l>> no match, partial?`,t,a,e,g),a!==m))}let d;if(typeof o=="string"?(d=c===o,this.debug("string match",o,c,d)):(d=o.test(c),this.debug("pattern match",o,c,d)),!d)return!1}if(l===m&&u===h)return!0;if(l===m)return r;if(u===h)return l===m-1&&t[l]==="";throw new Error("wtf?")}braceExpand(){return Ne(this.pattern,this.options)}parse(t){vt(t);const e=this.options;if(t==="**")return H;if(t==="")return"";let r,s=null;(r=t.match(An))?s=e.dot?Nn:Pn:(r=t.match(pn))?s=(e.nocase?e.dot?mn:dn:e.dot?gn:fn)(r[1]):(r=t.match(On))?s=(e.nocase?e.dot?Tn:En:e.dot?jn:Sn)(r):(r=t.match(yn))?s=e.dot?bn:vn:(r=t.match(wn))&&(s=xn);const i=q.fromGlob(t,this.options).toMMPattern();return s&&typeof i=="object"&&Reflect.defineProperty(i,"test",{value:s}),i}makeRe(){if(this.regexp||this.regexp===!1)return this.regexp;const t=this.set;if(!t.length)return this.regexp=!1,this.regexp;const e=this.options,r=e.noglobstar?"[^/]*?":e.dot?"(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?":"(?:(?!(?:\\/|^)\\.).)*?",s=new Set(e.nocase?["i"]:[]);let i=t.map((m=>{const h=m.map((o=>{if(o instanceof RegExp)for(const c of o.flags.split(""))s.add(c);return typeof o=="string"?o.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"):o===H?H:o._src}));return h.forEach(((o,c)=>{const a=h[c+1],g=h[c-1];o===H&&g!==H&&(g===void 0?a!==void 0&&a!==H?h[c+1]="(?:\\/|"+r+"\\/)?"+a:h[c]=r:a===void 0?h[c-1]=g+"(?:\\/|"+r+")?":a!==H&&(h[c-1]=g+"(?:\\/|\\/"+r+"\\/)"+a,h[c+1]=H))})),h.filter((o=>o!==H)).join("/")})).join("|");const[l,u]=t.length>1?["(?:",")"]:["",""];i="^"+l+i+u+"$",this.negate&&(i="^(?!"+i+").+$");try{this.regexp=new RegExp(i,[...s].join(""))}catch{this.regexp=!1}return this.regexp}slashSplit(t){return this.preserveMultipleSlashes?t.split("/"):this.isWindows&&/^\/\/[^\/]+/.test(t)?["",...t.split(/\/+/)]:t.split(/\/+/)}match(t){let 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 s=this.slashSplit(t);this.debug(this.pattern,"split",s);const i=this.set;this.debug(this.pattern,"set",i);let l=s[s.length-1];if(!l)for(let u=s.length-2;!l&&u>=0;u--)l=s[u];for(let u=0;u1&&arguments[1]!==void 0?arguments[1]:""}Invalid response: ${n.status} ${n.statusText}`);return t.status=n.status,t.response=n,t}function B(n,t){const{status:e}=t;if(e===401&&n.digest)return t;if(e>=400)throw Ut(t);return t}function nt(n,t){return arguments.length>2&&arguments[2]!==void 0&&arguments[2]?{data:t,headers:n.headers?tn(n.headers):{},status:n.status,statusText:n.statusText}:t}V.AST=q,V.Minimatch=bt,V.escape=function(n){let{windowsPathsNoEscape:t=!1}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return t?n.replace(/[?*()[\]]/g,"[$&]"):n.replace(/[?*()[\]\\]/g,"\\$&")},V.unescape=at;const $n=(ae=function(n,t,e){let r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};const s=D({url:L(n.remoteURL,R(t)),method:"COPY",headers:{Destination:L(n.remoteURL,R(e)),Overwrite:r.overwrite===!1?"F":"T",Depth:r.shallow?"0":"infinity"}},n,r);return l=function(u){B(n,u)},(i=U(s,n))&&i.then||(i=Promise.resolve(i)),l?i.then(l):i;var i,l},function(){for(var n=[],t=0;t2&&arguments[2]!==void 0?arguments[2]:rt.Original;const r=Q().get(n,t);return e==="array"&&Array.isArray(r)===!1?[r]:e==="object"&&Array.isArray(r)?r[0]:r}function ct(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 s={multistatus:Array.isArray(r)?r[0]:r};return Q().set(s,"multistatus.response",pt(s,"multistatus.response",rt.Array)),Q().set(s,"multistatus.response",Q().get(s,"multistatus.response").map((i=>(function(l){const u=Object.assign({},l);return u.status?Q().set(u,"status",pt(u,"status",rt.Object)):(Q().set(u,"propstat",pt(u,"propstat",rt.Object)),Q().set(u,"propstat.prop",pt(u,"propstat.prop",rt.Object))),u})(i)))),s})(new Dt.XMLParser({allowBooleanAttributes:!0,attributeNamePrefix:"",textNodeName:"text",ignoreAttributes:!1,removeNSPrefix:!0,numberParseOptions:{hex:!0,leadingZeros:!1},attributeValueProcessor:(e,r,s)=>r==="true"||r==="false"?r==="true":r,tagValueProcessor(e,r,s){if(!s.endsWith("propstat.prop.displayname"))return r}}).parse(n)))}))}function xt(n,t){let e=arguments.length>2&&arguments[2]!==void 0&&arguments[2];const{getlastmodified:r=null,getcontentlength:s="0",resourcetype:i=null,getcontenttype:l=null,getetag:u=null}=n,m=i&&typeof i=="object"&&i.collection!==void 0?"directory":"file",h={filename:t,basename:gt().basename(t),lastmod:r,size:parseInt(s,10),type:m,etag:typeof u=="string"?u.replace(/"/g,""):null};return m==="file"&&(h.mime=l&&typeof l=="string"?l.split(";")[0]:""),e&&(n.displayname!==void 0&&(n.displayname=String(n.displayname)),h.props=n),h}function Oe(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:s,status:i}}=r,[l,u,m]=i.split(" ",3),h=parseInt(u,10);if(h>=400){const o=new Error(`Invalid response: ${h} ${m}`);throw o.status=h,o}return xt(s,lt(t),e)}function Ee(n){switch(String(n)){case"-3":return"unlimited";case"-2":case"-1":return"unknown";default:return parseInt(String(n),10)}}function jt(n,t,e){return e?t?t(n):n:(n&&n.then||(n=Promise.resolve(n)),t?n.then(t):n)}const Bt=(function(n){return function(){for(var t=[],e=0;e2&&arguments[2]!==void 0?arguments[2]:{};const{details:r=!1}=e,s=D({url:L(n.remoteURL,R(t)),method:"PROPFIND",headers:{Accept:"text/plain,application/xml",Depth:"0"}},n,e);return jt(U(s,n),(function(i){return B(n,i),jt(i.text(),(function(l){return jt(ct(l),(function(u){const m=Oe(u,t,r);return nt(i,m,r)}))}))}))}));function Te(n,t,e){return e?t?t(n):n:(n&&n.then||(n=Promise.resolve(n)),t?n.then(t):n)}const In=je((function(n,t){let e=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const r=(function(i){if(!i||i==="/")return[];let l=i;const u=[];do u.push(l),l=gt().dirname(l);while(l&&l!=="/");return u})(lt(t));r.sort(((i,l)=>i.length>l.length?1:l.length>i.length?-1:0));let s=!1;return(function(i,l,u){if(typeof i[le]=="function"){let d=function(y){try{for(;!(m=c.next()).done;)if((y=l(m.value))&&y.then){if(!ce(y))return void y.then(d,o||(o=Z.bind(null,h=new ot,2)));y=y.v}h?Z(h,1,y):h=y}catch(A){Z(h||(h=new ot),2,A)}};var m,h,o,c=i[le]();if(d(),c.return){var a=function(y){try{m.done||c.return()}catch{}return y};if(h&&h.then)return h.then(a,(function(y){throw a(y)}));a()}return h}if(!("length"in i))throw new TypeError("Object is not iterable");for(var g=[],f=0;f2&&arguments[2]!==void 0?arguments[2]:{};if(e.recursive===!0)return In(n,t,e);const r=D({url:L(n.remoteURL,(s=R(t),s.endsWith("/")?s:s+"/")),method:"MKCOL"},n,e);var s;return Te(U(r,n),(function(i){B(n,i)}))}));var Rn=I(388),he=I.n(Rn);const Ln=(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 u=`bytes=${e.range.start}-`;typeof e.range.end=="number"&&(u=`${u}${e.range.end}`),r.Range=u}const s=D({url:L(n.remoteURL,R(t)),method:"GET",headers:r},n,e);return l=function(u){if(B(n,u),r.Range&&u.status!==206){const m=new Error(`Invalid response code for partial request: ${u.status}`);throw m.status=u.status,m}return e.callback&&setTimeout((()=>{e.callback(u)}),0),u.body},(i=U(s,n))&&i.then||(i=Promise.resolve(i)),l?i.then(l):i;var i,l})),_n=()=>{},Fn=(function(n){return function(){for(var t=[],e=0;e2&&arguments[2]!==void 0?arguments[2]:{};const r=D({url:L(n.remoteURL,R(t)),method:"DELETE"},n,e);return i=function(l){B(n,l)},(s=U(r,n))&&s.then||(s=Promise.resolve(s)),i?s.then(i):s;var s,i})),Un=(function(n){return function(){for(var t=[],e=0;e2&&arguments[2]!==void 0?arguments[2]:{};return(function(r,s){try{var i=(l=Bt(n,t,e),u=function(){return!0},m?u?u(l):l:(l&&l.then||(l=Promise.resolve(l)),u?l.then(u):l))}catch(h){return s(h)}var l,u,m;return i&&i.then?i.then(void 0,s):i})(0,(function(r){if(r.status===404)return!1;throw r}))}));function St(n,t,e){return e?t?t(n):n:(n&&n.then||(n=Promise.resolve(n)),t?n.then(t):n)}const Dn=(function(n){return function(){for(var t=[],e=0;e2&&arguments[2]!==void 0?arguments[2]:{};const r=D({url:L(n.remoteURL,R(t),"/"),method:"PROPFIND",headers:{Accept:"text/plain,application/xml",Depth:e.deep?"infinity":"1"}},n,e);return St(U(r,n),(function(s){return B(n,s),St(s.text(),(function(i){if(!i)throw new Error("Failed parsing directory contents: Empty response");return St(ct(i),(function(l){const u=Kt(t);let m=(function(h,o,c){let a=arguments.length>3&&arguments[3]!==void 0&&arguments[3],g=arguments.length>4&&arguments[4]!==void 0&&arguments[4];const f=gt().join(o,"/"),{multistatus:{response:d}}=h,y=d.map((A=>{const p=(function(x){try{return x.replace(/^https?:\/\/[^\/]+/,"")}catch(P){throw new X(P,"Failed normalising HREF")}})(A.href),{propstat:{prop:v}}=A;return xt(v,f==="/"?decodeURIComponent(lt(p)):lt(gt().relative(decodeURIComponent(f),decodeURIComponent(p))),a)}));return g?y:y.filter((A=>A.basename&&(A.type==="file"||A.filename!==c.replace(/\/$/,""))))})(l,Kt(n.remoteBasePath||n.remotePath),u,e.details,e.includeSelf);return e.glob&&(m=(function(h,o){return h.filter((c=>V(c.filename,o,{matchBase:!0})))})(m,e.glob)),nt(s,m,e.details)}))}))}))}));function Wt(n){return function(){for(var t=[],e=0;e2&&arguments[2]!==void 0?arguments[2]:{};const r=D({url:L(n.remoteURL,R(t)),method:"GET",headers:{Accept:"text/plain"},transformResponse:[Vn]},n,e);return wt(U(r,n),(function(s){return B(n,s),wt(s.text(),(function(i){return nt(s,i,e.details)}))}))}));function wt(n,t,e){return e?t?t(n):n:(n&&n.then||(n=Promise.resolve(n)),t?n.then(t):n)}const Wn=Wt((function(n,t){let e=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const r=D({url:L(n.remoteURL,R(t)),method:"GET"},n,e);return wt(U(r,n),(function(s){let i;return B(n,s),(function(l,u){var m=l();return m&&m.then?m.then(u):u()})((function(){return wt(s.arrayBuffer(),(function(l){i=l}))}),(function(){return nt(s,i,e.details)}))}))})),zn=Wt((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 X({info:{code:tt.InvalidOutputFormat}},`Invalid output format: ${r}`);return r==="text"?Bn(n,t,e):Wn(n,t,e)})),Vn=n=>n;function qn(n){return new Dt.XMLBuilder({attributeNamePrefix:"@_",format:!0,ignoreAttributes:!1,suppressEmptyNode:!0}).build(Se({lockinfo:{"@_xmlns:d":"DAV:",lockscope:{exclusive:{}},locktype:{write:{}},owner:{href:n}}},"d"))}function Se(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}`]=Se(e[r],t),delete e[r]):/^@_/.test(r)===!1&&(e[`${t}:${r}`]=e[r],delete e[r]));return e}function _t(n,t,e){return e?t?t(n):n:(n&&n.then||(n=Promise.resolve(n)),t?n.then(t):n)}function $e(n){return function(){for(var t=[],e=0;e3&&arguments[3]!==void 0?arguments[3]:{};const s=D({url:L(n.remoteURL,R(t)),method:"UNLOCK",headers:{"Lock-Token":e}},n,r);return _t(U(s,n),(function(i){if(B(n,i),i.status!==204&&i.status!==200)throw Ut(i)}))})),Zn=$e((function(n,t){let e=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const{refreshToken:r,timeout:s=Xn}=e,i={Accept:"text/plain,application/xml",Timeout:s};r&&(i.If=r);const l=D({url:L(n.remoteURL,R(t)),method:"LOCK",headers:i,data:qn(n.contactHref)},n,e);return _t(U(l,n),(function(u){return B(n,u),_t(u.text(),(function(m){const h=(a=m,new Dt.XMLParser({removeNSPrefix:!0,parseAttributeValue:!0,parseTagValue:!0}).parse(a)),o=Q().get(h,"prop.lockdiscovery.activelock.locktoken.href"),c=Q().get(h,"prop.lockdiscovery.activelock.timeout");var a;if(!o)throw Ut(u,"No lock token received: ");return{token:o,serverTimeout:c}}))}))})),Xn="Infinite, Second-4100000000";function $t(n,t,e){return e?t?t(n):n:(n&&n.then||(n=Promise.resolve(n)),t?n.then(t):n)}const Yn=(function(n){return function(){for(var t=[],e=0;e1&&arguments[1]!==void 0?arguments[1]:{};const e=t.path||"/",r=D({url:L(n.remoteURL,e),method:"PROPFIND",headers:{Accept:"text/plain,application/xml",Depth:"0"}},n,t);return $t(U(r,n),(function(s){return B(n,s),$t(s.text(),(function(i){return $t(ct(i),(function(l){const u=(function(m){try{const[h]=m.multistatus.response,{propstat:{prop:{"quota-used-bytes":o,"quota-available-bytes":c}}}=h;return o!==void 0&&c!==void 0?{used:parseInt(String(o),10),available:Ee(c)}:null}catch{}return null})(l);return nt(s,u,t.details)}))}))}))}));function Ct(n,t,e){return e?t?t(n):n:(n&&n.then||(n=Promise.resolve(n)),t?n.then(t):n)}const Kn=(function(n){return function(){for(var t=[],e=0;e2&&arguments[2]!==void 0?arguments[2]:{};const{details:r=!1}=e,s=D({url:L(n.remoteURL,R(t)),method:"SEARCH",headers:{Accept:"text/plain,application/xml","Content-Type":n.headers["Content-Type"]||"application/xml; charset=utf-8"}},n,e);return Ct(U(s,n),(function(i){return B(n,i),Ct(i.text(),(function(l){return Ct(ct(l),(function(u){const m=(function(h,o,c){const a={truncated:!1,results:[]};return a.truncated=h.multistatus.response.some((g=>(g.status||g.propstat?.status).split(" ",3)?.[1]==="507"&&g.href.replace(/\/$/,"").endsWith(R(o).replace(/\/$/,"")))),h.multistatus.response.forEach((g=>{if(g.propstat===void 0)return;const f=g.href.split("/").map(decodeURIComponent).join("/");a.results.push(xt(g.propstat.prop,f,c))})),a})(u,t,r);return nt(i,m,r)}))}))}))})),Hn=(function(n){return function(){for(var t=[],e=0;e3&&arguments[3]!==void 0?arguments[3]:{};const s=D({url:L(n.remoteURL,R(t)),method:"MOVE",headers:{Destination:L(n.remoteURL,R(e)),Overwrite:r.overwrite===!1?"F":"T"}},n,r);return l=function(u){B(n,u)},(i=U(s,n))&&i.then||(i=Promise.resolve(i)),l?i.then(l):i;var i,l}));var Jn=I(172);const Qn=(function(n){return function(){for(var t=[],e=0;e3&&arguments[3]!==void 0?arguments[3]:{};const{contentLength:s=!0,overwrite:i=!0}=r,l={"Content-Type":"application/octet-stream"};s===!1||(l["Content-Length"]=typeof s=="number"?`${s}`:`${(function(o){if(ve(o))return o.byteLength;if(be(o))return o.length;if(typeof o=="string")return(0,Jn.d)(o);throw new X({info:{code:tt.DataTypeNoLength}},"Cannot calculate data length: Invalid type")})(e)}`),i||(l["If-None-Match"]="*");const u=D({url:L(n.remoteURL,R(t)),method:"PUT",headers:l,data:e},n,r);return h=function(o){try{B(n,o)}catch(c){const a=c;if(a.status!==412||i)throw a;return!1}return!0},(m=U(u,n))&&m.then||(m=Promise.resolve(m)),h?m.then(h):m;var m,h})),Ce=(function(n){return function(){for(var t=[],e=0;e2&&arguments[2]!==void 0?arguments[2]:{};const r=D({url:L(n.remoteURL,R(t)),method:"OPTIONS"},n,e);return i=function(l){try{B(n,l)}catch(u){throw u}return{compliance:(l.headers.get("DAV")??"").split(",").map((u=>u.trim())),server:l.headers.get("Server")??""}},(s=U(r,n))&&s.then||(s=Promise.resolve(s)),i?s.then(i):s;var s,i}));function ut(n,t,e){return e?t?t(n):n:(n&&n.then||(n=Promise.resolve(n)),t?n.then(t):n)}const tr=zt((function(n,t,e,r,s){let i=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{};if(e>r||e<0)throw new X({info:{code:tt.InvalidUpdateRange}},`Invalid update range ${e} for partial update`);const l={"Content-Type":"application/octet-stream","Content-Length":""+(r-e+1),"Content-Range":`bytes ${e}-${r}/*`},u=D({url:L(n.remoteURL,R(t)),method:"PUT",headers:l,data:s},n,i);return ut(U(u,n),(function(m){B(n,m)}))}));function pe(n,t){var e=n();return e&&e.then?e.then(t):t(e)}const er=zt((function(n,t,e,r,s){let i=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{};if(e>r||e<0)throw new X({info:{code:tt.InvalidUpdateRange}},`Invalid update range ${e} for partial update`);const l={"Content-Type":"application/x-sabredav-partialupdate","Content-Length":""+(r-e+1),"X-Update-Range":`bytes=${e}-${r}`},u=D({url:L(n.remoteURL,R(t)),method:"PATCH",headers:l,data:s},n,i);return ut(U(u,n),(function(m){B(n,m)}))}));function zt(n){return function(){for(var t=[],e=0;e5&&arguments[5]!==void 0?arguments[5]:{};return ut(Ce(n,t,i),(function(l){let u=!1;return pe((function(){if(l.compliance.includes("sabredav-partialupdate"))return ut(er(n,t,e,r,s,i),(function(m){return u=!0,m}))}),(function(m){let h=!1;return u?m:pe((function(){if(l.server.includes("Apache")&&l.compliance.includes(""))return ut(tr(n,t,e,r,s,i),(function(o){return h=!0,o}))}),(function(o){if(h)return o;throw new X({info:{code:tt.NotSupported}},"Not supported")}))}))}))})),rr="https://github.com/perry-mitchell/webdav-client/blob/master/LOCK_CONTACT.md";function or(n){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const{authType:e=null,remoteBasePath:r,contactHref:s=rr,ha1:i,headers:l={},httpAgent:u,httpsAgent:m,password:h,token:o,username:c,withCredentials:a}=t;let g=e;g||(g=c||h?G.Password:G.None);const f={authType:g,remoteBasePath:r,contactHref:s,ha1:i,headers:Object.assign({},l),httpAgent:u,httpsAgent:m,password:h,remotePath:qe(n),remoteURL:n,token:o,username:c,withCredentials:a};return de(f,c,h,o,i),{copyFile:(d,y,A)=>$n(f,d,y,A),createDirectory:(d,y)=>Lt(f,d,y),createReadStream:(d,y)=>(function(A,p){let v=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const x=new(he()).PassThrough;return Ln(A,p,v).then((P=>{P.pipe(x)})).catch((P=>{x.emit("error",P)})),x})(f,d,y),createWriteStream:(d,y,A)=>(function(p,v){let x=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},P=arguments.length>3&&arguments[3]!==void 0?arguments[3]:_n;const b=new(he()).PassThrough,O={};x.overwrite===!1&&(O["If-None-Match"]="*");const w=D({url:L(p.remoteURL,R(v)),method:"PUT",headers:O,data:b,maxRedirects:0},p,x);return U(w,p).then((E=>B(p,E))).then((E=>{setTimeout((()=>{P(E)}),0)})).catch((E=>{b.emit("error",E)})),b})(f,d,y,A),customRequest:(d,y)=>Fn(f,d,y),deleteFile:(d,y)=>Mn(f,d,y),exists:(d,y)=>Un(f,d,y),getDirectoryContents:(d,y)=>Dn(f,d,y),getFileContents:(d,y)=>zn(f,d,y),getFileDownloadLink:d=>(function(y,A){let p=L(y.remoteURL,R(A));const v=/^https:/i.test(p)?"https":"http";switch(y.authType){case G.None:break;case G.Password:{const x=Jt(y.headers.Authorization.replace(/^Basic /i,"").trim());p=p.replace(/^https?:\/\//,`${v}://${x}@`);break}default:throw new X({info:{code:tt.LinkUnsupportedAuthType}},`Unsupported auth type for file link: ${y.authType}`)}return p})(f,d),getFileUploadLink:d=>(function(y,A){let p=`${L(y.remoteURL,R(A))}?Content-Type=application/octet-stream`;const v=/^https:/i.test(p)?"https":"http";switch(y.authType){case G.None:break;case G.Password:{const x=Jt(y.headers.Authorization.replace(/^Basic /i,"").trim());p=p.replace(/^https?:\/\//,`${v}://${x}@`);break}default:throw new X({info:{code:tt.LinkUnsupportedAuthType}},`Unsupported auth type for file link: ${y.authType}`)}return p})(f,d),getHeaders:()=>Object.assign({},f.headers),getQuota:d=>Yn(f,d),lock:(d,y)=>Zn(f,d,y),moveFile:(d,y,A)=>Hn(f,d,y,A),putFileContents:(d,y,A)=>Qn(f,d,y,A),partialUpdateFileContents:(d,y,A,p,v)=>nr(f,d,y,A,p,v),getDAVCompliance:d=>Ce(f,d),search:(d,y)=>Kn(f,d,y),setHeaders:d=>{f.headers=Object.assign({},d)},stat:(d,y)=>Bt(f,d,y),unlock:(d,y,A)=>Gn(f,d,y,A)}}J.hT,J.O4,J.Kd,J.YK;var ur=J.UU,lr=J.Gu;J.ky;var cr=J.h4;J.ch,J.hq,J.i5;export{ar as _,ur as a,cr as l,lr as u}; //# sourceMappingURL=index-C5gME6tY.chunk.mjs.map