import{p as Vt,g as Jr,a as Kr,b as to,l as eo,t as oe,c as no,d as Bt}from"./logger-DsWSbSNC.chunk.mjs";import{g as ie,U as ro,B as Ne,_ as oo,d as mr,c as In,m as io,a as so,b as ao,e as uo,f as ce,o as he,r as Nn,h as _n,i as Ht,n as Qt,u as Rn,N as lo,j as Er,t as Jt,k as co,l as sn,v as an,p as ho,q as fo,s as Sn,w as po,x as _e,y as Re,z as Se,F as go,A as xe,C as Pe,D as mo}from"./index-hZPKu-D6-Bm8qo_pT.chunk.mjs";function yr(e,t,n){const o=document.querySelector(`#initial-state-${e}-${t}`);if(o===null)return n;try{return JSON.parse(atob(o.value))}catch{throw new Error(`Could not parse initial state ${t} of ${e}`)}}function br(){return yr("files_sharing","isPublic",null)??document.querySelector('input#isPublic[type="hidden"][name="isPublic"][value="1"]')!==null}function Eo(){return yr("files_sharing","sharingToken",null)??document.querySelector('input#sharingToken[type="hidden"]')?.value??null}function $t(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function xn(e,t,n){yo(e,t),t.set(e,n)}function yo(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function pt(e,t){var n=vr(e,t,"get");return bo(e,n)}function bo(e,t){return t.get?t.get.call(e):t.value}function Pn(e,t,n){var o=vr(e,t,"set");return vo(e,o,n),n}function vr(e,t,n){if(!t.has(e))throw new TypeError("attempted to "+n+" private field on non-instance");return t.get(e)}function vo(e,t,n){if(t.set)t.set.call(e,n);else{if(!t.writable)throw new TypeError("attempted to set read only private field");t.value=n}}var wo=typeof Symbol<"u"?Symbol.toStringTag:"@@toStringTag",dt=new WeakMap,Wt=new WeakMap;class ve{constructor(t){var{executor:n=()=>{},internals:o=ln(),promise:i=new Promise((a,h)=>n(a,h,c=>{o.onCancelList.push(c)}))}=t;xn(this,dt,{writable:!0,value:void 0}),xn(this,Wt,{writable:!0,value:void 0}),$t(this,wo,"CancelablePromise"),this.cancel=this.cancel.bind(this),Pn(this,dt,o),Pn(this,Wt,i||new Promise((a,h)=>n(a,h,c=>{o.onCancelList.push(c)})))}then(t,n){return le(pt(this,Wt).then(se(t,pt(this,dt)),se(n,pt(this,dt))),pt(this,dt))}catch(t){return le(pt(this,Wt).catch(se(t,pt(this,dt))),pt(this,dt))}finally(t,n){return n&&pt(this,dt).onCancelList.push(t),le(pt(this,Wt).finally(se(()=>{if(t)return n&&(pt(this,dt).onCancelList=pt(this,dt).onCancelList.filter(o=>o!==t)),t()},pt(this,dt))),pt(this,dt))}cancel(){pt(this,dt).isCanceled=!0;var t=pt(this,dt).onCancelList;pt(this,dt).onCancelList=[];for(var n of t)if(typeof n=="function")try{n()}catch(o){console.error(o)}}isCanceled(){return pt(this,dt).isCanceled===!0}}class Dt extends ve{constructor(t){super({executor:t})}}$t(Dt,"all",function(e){return ae(e,Promise.all(e))}),$t(Dt,"allSettled",function(e){return ae(e,Promise.allSettled(e))}),$t(Dt,"any",function(e){return ae(e,Promise.any(e))}),$t(Dt,"race",function(e){return ae(e,Promise.race(e))}),$t(Dt,"resolve",function(e){return Ln(Promise.resolve(e))}),$t(Dt,"reject",function(e){return Ln(Promise.reject(e))}),$t(Dt,"isCancelable",un);function Ln(e){return le(e,ln())}function un(e){return e instanceof Dt||e instanceof ve}function se(e,t){if(e)return n=>{if(!t.isCanceled){var o=e(n);return un(o)&&t.onCancelList.push(o.cancel),o}return n}}function le(e,t){return new ve({internals:t,promise:e})}function ae(e,t){var n=ln();return n.onCancelList.push(()=>{for(var o of e)un(o)&&o.cancel()}),new ve({internals:n,promise:t})}function ln(){return{isCanceled:!1,onCancelList:[]}}var Le={},Ao={2:e=>{function t(i,a,h){i instanceof RegExp&&(i=n(i,h)),a instanceof RegExp&&(a=n(a,h));var c=o(i,a,h);return c&&{start:c[0],end:c[1],pre:h.slice(0,c[0]),body:h.slice(c[0]+i.length,c[1]),post:h.slice(c[1]+a.length)}}function n(i,a){var h=a.match(i);return h?h[0]:null}function o(i,a,h){var c,d,s,u,f,p=h.indexOf(i),b=h.indexOf(a,p+1),E=p;if(p>=0&&b>0){for(c=[],s=h.length;E>=0&&!f;)E==p?(c.push(E),p=h.indexOf(i,E+1)):c.length==1?f=[c.pop(),b]:((d=c.pop())=0?p:b;c.length&&(f=[s,u])}return f}e.exports=t,t.range=o},101:function(e,t,n){var o;e=n.nmd(e),(function(i){var a=(e&&e.exports,typeof ie=="object"&&ie);a.global!==a&&a.window;var h=function(f){this.message=f};(h.prototype=new Error).name="InvalidCharacterError";var c=function(f){throw new h(f)},d="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=/[\t\n\f\r ]/g,u={encode:function(f){f=String(f),/[^\0-\xFF]/.test(f)&&c("The string to be encoded contains characters outside of the Latin1 range.");for(var p,b,E,w,T=f.length%3,I="",g=-1,v=f.length-T;++g>18&63)+d.charAt(w>>12&63)+d.charAt(w>>6&63)+d.charAt(63&w);return T==2?(p=f.charCodeAt(g)<<8,b=f.charCodeAt(++g),I+=d.charAt((w=p+b)>>10)+d.charAt(w>>4&63)+d.charAt(w<<2&63)+"="):T==1&&(w=f.charCodeAt(g),I+=d.charAt(w>>2)+d.charAt(w<<4&63)+"=="),I},decode:function(f){var p=(f=String(f).replace(s,"")).length;p%4==0&&(p=(f=f.replace(/==?$/,"")).length),(p%4==1||/[^+a-zA-Z0-9/]/.test(f))&&c("Invalid character: the string to be decoded is not correctly encoded.");for(var b,E,w=0,T="",I=-1;++I>(-2*w&6)));return T},version:"1.0.0"};(o=function(){return u}.call(t,n,t,e))===void 0||(e.exports=o)})()},172:(e,t)=>{t.d=function(n){if(!n)return 0;for(var o=(n=n.toString()).length,i=n.length;i--;){var a=n.charCodeAt(i);56320<=a&&a<=57343&&i--,127{var t={utf8:{stringToBytes:function(n){return t.bin.stringToBytes(unescape(encodeURIComponent(n)))},bytesToString:function(n){return decodeURIComponent(escape(t.bin.bytesToString(n)))}},bin:{stringToBytes:function(n){for(var o=[],i=0;i{var t,n;t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",n={rotl:function(o,i){return o<>>32-i},rotr:function(o,i){return o<<32-i|o>>>i},endian:function(o){if(o.constructor==Number)return 16711935&n.rotl(o,8)|4278255360&n.rotl(o,24);for(var i=0;i0;o--)i.push(Math.floor(256*Math.random()));return i},bytesToWords:function(o){for(var i=[],a=0,h=0;a>>5]|=o[a]<<24-h%32;return i},wordsToBytes:function(o){for(var i=[],a=0;a<32*o.length;a+=8)i.push(o[a>>>5]>>>24-a%32&255);return i},bytesToHex:function(o){for(var i=[],a=0;a>>4).toString(16)),i.push((15&o[a]).toString(16));return i.join("")},hexToBytes:function(o){for(var i=[],a=0;a>>6*(3-c)&63)):i.push("=");return i.join("")},base64ToBytes:function(o){o=o.replace(/[^A-Z0-9+\/]/gi,"");for(var i=[],a=0,h=0;a>>6-2*h);return i}},e.exports=n},635:(e,t,n)=>{const o=n(31),i=n(338),a=n(221);e.exports={XMLParser:i,XMLValidator:o,XMLBuilder:a}},118:e=>{e.exports=function(t){return typeof t=="function"?t:Array.isArray(t)?n=>{for(const o of t)if(typeof o=="string"&&n===o||o instanceof RegExp&&o.test(n))return!0}:()=>!1}},705:(e,t)=>{const n=":A-Za-z_\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD",o="["+n+"]["+n+"\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*",i=new RegExp("^"+o+"$");t.isExist=function(a){return a!==void 0},t.isEmptyObject=function(a){return Object.keys(a).length===0},t.merge=function(a,h,c){if(h){const d=Object.keys(h),s=d.length;for(let u=0;u{const o=n(705),i={allowBooleanAttributes:!1,unpairedTags:[]};function a(g){return g===" "||g===" "||g===` `||g==="\r"}function h(g,v){const N=v;for(;v5&&P==="xml")return E("InvalidXml","XML declaration allowed only at the start of the document.",T(g,v));if(g[v]=="?"&&g[v+1]==">"){v++;break}}return v}function c(g,v){if(g.length>v+5&&g[v+1]==="-"&&g[v+2]==="-"){for(v+=3;v"){v+=2;break}}else if(g.length>v+8&&g[v+1]==="D"&&g[v+2]==="O"&&g[v+3]==="C"&&g[v+4]==="T"&&g[v+5]==="Y"&&g[v+6]==="P"&&g[v+7]==="E"){let N=1;for(v+=8;v"&&(N--,N===0))break}else if(g.length>v+9&&g[v+1]==="["&&g[v+2]==="C"&&g[v+3]==="D"&&g[v+4]==="A"&&g[v+5]==="T"&&g[v+6]==="A"&&g[v+7]==="["){for(v+=8;v"){v+=2;break}}return v}t.validate=function(g,v){v=Object.assign({},i,v);const N=[];let P=!1,_=!1;g[0]==="\uFEFF"&&(g=g.substr(1));for(let S=0;S"&&g[S]!==" "&&g[S]!==" "&&g[S]!==` `&&g[S]!=="\r";S++)M+=g[S];if(M=M.trim(),M[M.length-1]==="/"&&(M=M.substring(0,M.length-1),S--),L=M,!o.isName(L)){let F;return F=M.trim().length===0?"Invalid space after '<'.":"Tag '"+M+"' is an invalid name.",E("InvalidTag",F,T(g,S))}const R=u(g,S);if(R===!1)return E("InvalidAttr","Attributes for '"+M+"' have open quote.",T(g,S));let D=R.value;if(S=R.index,D[D.length-1]==="/"){const F=S-D.length;D=D.substring(0,D.length-1);const G=p(D,v);if(G!==!0)return E(G.err.code,G.err.msg,T(g,F+G.err.line));P=!0}else if(U){if(!R.tagClosed)return E("InvalidTag","Closing tag '"+M+"' doesn't have proper closing.",T(g,S));if(D.trim().length>0)return E("InvalidTag","Closing tag '"+M+"' can't have attributes or invalid starting.",T(g,O));if(N.length===0)return E("InvalidTag","Closing tag '"+M+"' has not been opened.",T(g,O));{const F=N.pop();if(M!==F.tagName){let G=T(g,F.tagStartPos);return E("InvalidTag","Expected closing tag '"+F.tagName+"' (opened in line "+G.line+", col "+G.col+") instead of closing tag '"+M+"'.",T(g,O))}N.length==0&&(_=!0)}}else{const F=p(D,v);if(F!==!0)return E(F.err.code,F.err.msg,T(g,S-D.length+F.err.line));if(_===!0)return E("InvalidXml","Multiple possible root nodes found.",T(g,S));v.unpairedTags.indexOf(M)!==-1||N.push({tagName:M,tagStartPos:O}),P=!0}for(S++;S0)||E("InvalidXml","Invalid '"+JSON.stringify(N.map((S=>S.tagName)),null,4).replace(/\r?\n/g,"")+"' found.",{line:1,col:1}):E("InvalidXml","Start tag expected.",1)};const d='"',s="'";function u(g,v){let N="",P="",_=!1;for(;v"&&P===""){_=!0;break}N+=g[v]}return P===""&&{value:N,index:v,tagClosed:_}}const f=new RegExp(`(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['"])(([\\s\\S])*?)\\5)?`,"g");function p(g,v){const N=o.getAllMatches(g,f),P={};for(let _=0;_{const o=n(87),i=n(118),a={attributeNamePrefix:"@_",attributesGroupName:!1,textNodeName:"#text",ignoreAttributes:!0,cdataPropName:!1,format:!1,indentBy:" ",suppressEmptyNode:!1,suppressUnpairedNode:!0,suppressBooleanAttributes:!0,tagValueProcessor:function(u,f){return f},attributeValueProcessor:function(u,f){return f},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 h(u){this.options=Object.assign({},a,u),this.options.ignoreAttributes===!0||this.options.attributesGroupName?this.isAttribute=function(){return!1}:(this.ignoreAttributesFn=i(this.options.ignoreAttributes),this.attrPrefixLen=this.options.attributeNamePrefix.length,this.isAttribute=s),this.processTextOrObjNode=c,this.options.format?(this.indentate=d,this.tagEndChar=`> `,this.newLine=` `):(this.indentate=function(){return""},this.tagEndChar=">",this.newLine="")}function c(u,f,p,b){const E=this.j2x(u,p+1,b.concat(f));return u[this.options.textNodeName]!==void 0&&Object.keys(u).length===1?this.buildTextValNode(u[this.options.textNodeName],f,E.attrStr,p):this.buildObjectNode(E.val,f,E.attrStr,p)}function d(u){return this.options.indentBy.repeat(u)}function s(u){return!(!u.startsWith(this.options.attributeNamePrefix)||u===this.options.textNodeName)&&u.substr(this.attrPrefixLen)}h.prototype.build=function(u){return this.options.preserveOrder?o(u,this.options):(Array.isArray(u)&&this.options.arrayNodeName&&this.options.arrayNodeName.length>1&&(u={[this.options.arrayNodeName]:u}),this.j2x(u,0,[]).val)},h.prototype.j2x=function(u,f,p){let b="",E="";const w=p.join(".");for(let T in u)if(Object.prototype.hasOwnProperty.call(u,T))if(u[T]===void 0)this.isAttribute(T)&&(E+="");else if(u[T]===null)this.isAttribute(T)?E+="":T[0]==="?"?E+=this.indentate(f)+"<"+T+"?"+this.tagEndChar:E+=this.indentate(f)+"<"+T+"/"+this.tagEndChar;else if(u[T]instanceof Date)E+=this.buildTextValNode(u[T],T,"",f);else if(typeof u[T]!="object"){const I=this.isAttribute(T);if(I&&!this.ignoreAttributesFn(I,w))b+=this.buildAttrPairStr(I,""+u[T]);else if(!I)if(T===this.options.textNodeName){let g=this.options.tagValueProcessor(T,""+u[T]);E+=this.replaceEntitiesValue(g)}else E+=this.buildTextValNode(u[T],T,"",f)}else if(Array.isArray(u[T])){const I=u[T].length;let g="",v="";for(let N=0;N`+this.newLine:this.indentate(b)+"<"+f+p+w+this.tagEndChar+u+this.indentate(b)+E:this.indentate(b)+"<"+f+p+w+">"+u+E}},h.prototype.closeTag=function(u){let f="";return this.options.unpairedTags.indexOf(u)!==-1?this.options.suppressUnpairedNode||(f="/"):f=this.options.suppressEmptyNode?"/":`>`+this.newLine;if(this.options.commentPropName!==!1&&f===this.options.commentPropName)return this.indentate(b)+``+this.newLine;if(f[0]==="?")return this.indentate(b)+"<"+f+p+"?"+this.tagEndChar;{let E=this.options.tagValueProcessor(f,u);return E=this.replaceEntitiesValue(E),E===""?this.indentate(b)+"<"+f+p+this.closeTag(f)+this.tagEndChar:this.indentate(b)+"<"+f+p+">"+E+"0&&this.options.processEntities)for(let f=0;f{function t(h,c,d,s){let u="",f=!1;for(let p=0;p`,f=!1;continue}if(E===c.commentPropName){u+=s+``,f=!0;continue}if(E[0]==="?"){const v=o(b[":@"],c),N=E==="?xml"?"":s;let P=b[E][0][c.textNodeName];P=P.length!==0?" "+P:"",u+=N+`<${E}${P}${v}?>`,f=!0;continue}let T=s;T!==""&&(T+=c.indentBy);const I=s+`<${E}${o(b[":@"],c)}`,g=t(b[E],c,w,T);c.unpairedTags.indexOf(E)!==-1?c.suppressUnpairedNode?u+=I+">":u+=I+"/>":g&&g.length!==0||!c.suppressEmptyNode?g&&g.endsWith(">")?u+=I+`>${g}${s}`:(u+=I+">",g&&s!==""&&(g.includes("/>")||g.includes("`):u+=I+"/>",f=!0}return u}function n(h){const c=Object.keys(h);for(let d=0;d0&&c.processEntities)for(let d=0;d0&&(d=` `),t(h,c,"",d)}},193:(e,t,n)=>{const o=n(705);function i(f,p){let b="";for(;p"){if(T?f[p-1]==="-"&&f[p-2]==="-"&&(T=!1,E--):E--,E===0)break}else f[p]==="["?w=!0:I+=f[p];else{if(w&&h(f,p)){let g,v;p+=7,[g,v,p]=i(f,p+1),v.indexOf("&")===-1&&(b[u(g)]={regx:RegExp(`&${g};`,"g"),val:v})}else if(w&&c(f,p))p+=8;else if(w&&d(f,p))p+=8;else if(w&&s(f,p))p+=9;else{if(!a)throw new Error("Invalid DOCTYPE");T=!0}E++,I=""}if(E!==0)throw new Error("Unclosed DOCTYPE")}return{entities:b,i:p}}},63:(e,t)=>{const n={preserveOrder:!1,attributeNamePrefix:"@_",attributesGroupName:!1,textNodeName:"#text",ignoreAttributes:!0,removeNSPrefix:!1,allowBooleanAttributes:!1,parseTagValue:!0,parseAttributeValue:!1,trimValues:!0,cdataPropName:!1,numberParseOptions:{hex:!0,leadingZeros:!0,eNotation:!0},tagValueProcessor:function(o,i){return i},attributeValueProcessor:function(o,i){return i},stopNodes:[],alwaysCreateTextNode:!1,isArray:()=>!1,commentPropName:!1,unpairedTags:[],processEntities:!0,htmlEntities:!1,ignoreDeclaration:!1,ignorePiTags:!1,transformTagName:!1,transformAttributeName:!1,updateTag:function(o,i,a){return o}};t.buildOptions=function(o){return Object.assign({},n,o)},t.defaultOptions=n},299:(e,t,n)=>{const o=n(705),i=n(365),a=n(193),h=n(494),c=n(118);function d(_){const L=Object.keys(_);for(let S=0;S0)){R||(_=this.replaceEntitiesValue(_));const D=this.options.tagValueProcessor(L,_,S,U,M);return D==null?_:typeof D!=typeof _||D!==_?D:this.options.trimValues||_.trim()===_?P(_,this.options.parseTagValue,this.options.numberParseOptions):_}}function u(_){if(this.options.removeNSPrefix){const L=_.split(":"),S=_.charAt(0)==="/"?"/":"";if(L[0]==="xmlns")return"";L.length===2&&(_=S+L[1])}return _}const f=new RegExp(`([^\\s=]+)\\s*(=\\s*(['"])([\\s\\S]*?)\\3)?`,"gm");function p(_,L,S){if(this.options.ignoreAttributes!==!0&&typeof _=="string"){const O=o.getAllMatches(_,f),U=O.length,M={};for(let R=0;R",M,"Closing Tag is not closed.");let D=_.substring(M+2,R).trim();if(this.options.removeNSPrefix){const X=D.indexOf(":");X!==-1&&(D=D.substr(X+1))}this.options.transformTagName&&(D=this.options.transformTagName(D)),S&&(O=this.saveTextToParentTag(O,S,U));const F=U.substring(U.lastIndexOf(".")+1);if(D&&this.options.unpairedTags.indexOf(D)!==-1)throw new Error(`Unpaired tag can not be used as closing tag: `);let G=0;F&&this.options.unpairedTags.indexOf(F)!==-1?(G=U.lastIndexOf(".",U.lastIndexOf(".")-1),this.tagsNodeStack.pop()):G=U.lastIndexOf("."),U=U.substring(0,G),S=this.tagsNodeStack.pop(),O="",M=R}else if(_[M+1]==="?"){let R=v(_,M,!1,"?>");if(!R)throw new Error("Pi Tag is not closed.");if(O=this.saveTextToParentTag(O,S,U),!(this.options.ignoreDeclaration&&R.tagName==="?xml"||this.options.ignorePiTags)){const D=new i(R.tagName);D.add(this.options.textNodeName,""),R.tagName!==R.tagExp&&R.attrExpPresent&&(D[":@"]=this.buildAttributesMap(R.tagExp,U,R.tagName)),this.addChild(S,D,U)}M=R.closeIndex+1}else if(_.substr(M+1,3)==="!--"){const R=g(_,"-->",M+4,"Comment is not closed.");if(this.options.commentPropName){const D=_.substring(M+4,R-2);O=this.saveTextToParentTag(O,S,U),S.add(this.options.commentPropName,[{[this.options.textNodeName]:D}])}M=R}else if(_.substr(M+1,2)==="!D"){const R=a(_,M);this.docTypeEntities=R.entities,M=R.i}else if(_.substr(M+1,2)==="!["){const R=g(_,"]]>",M,"CDATA is not closed.")-2,D=_.substring(M+9,R);O=this.saveTextToParentTag(O,S,U);let F=this.parseTextData(D,S.tagname,U,!0,!1,!0,!0);F==null&&(F=""),this.options.cdataPropName?S.add(this.options.cdataPropName,[{[this.options.textNodeName]:D}]):S.add(this.options.textNodeName,F),M=R+2}else{let R=v(_,M,this.options.removeNSPrefix),D=R.tagName;const F=R.rawTagName;let G=R.tagExp,X=R.attrExpPresent,V=R.closeIndex;this.options.transformTagName&&(D=this.options.transformTagName(D)),S&&O&&S.tagname!=="!xml"&&(O=this.saveTextToParentTag(O,S,U,!1));const Z=S;if(Z&&this.options.unpairedTags.indexOf(Z.tagname)!==-1&&(S=this.tagsNodeStack.pop(),U=U.substring(0,U.lastIndexOf("."))),D!==L.tagname&&(U+=U?"."+D:D),this.isItStopNode(this.options.stopNodes,U,D)){let z="";if(G.length>0&&G.lastIndexOf("/")===G.length-1)D[D.length-1]==="/"?(D=D.substr(0,D.length-1),U=U.substr(0,U.length-1),G=D):G=G.substr(0,G.length-1),M=R.closeIndex;else if(this.options.unpairedTags.indexOf(D)!==-1)M=R.closeIndex;else{const W=this.readStopNodeData(_,F,V+1);if(!W)throw new Error(`Unexpected end of ${F}`);M=W.i,z=W.tagContent}const st=new i(D);D!==G&&X&&(st[":@"]=this.buildAttributesMap(G,U,D)),z&&(z=this.parseTextData(z,D,U,!0,X,!0,!0)),U=U.substr(0,U.lastIndexOf(".")),st.add(this.options.textNodeName,z),this.addChild(S,st,U)}else{if(G.length>0&&G.lastIndexOf("/")===G.length-1){D[D.length-1]==="/"?(D=D.substr(0,D.length-1),U=U.substr(0,U.length-1),G=D):G=G.substr(0,G.length-1),this.options.transformTagName&&(D=this.options.transformTagName(D));const z=new i(D);D!==G&&X&&(z[":@"]=this.buildAttributesMap(G,U,D)),this.addChild(S,z,U),U=U.substr(0,U.lastIndexOf("."))}else{const z=new i(D);this.tagsNodeStack.push(S),D!==G&&X&&(z[":@"]=this.buildAttributesMap(G,U,D)),this.addChild(S,z,U),S=z}O="",M=V}}else O+=_[M];return L.child};function E(_,L,S){const O=this.options.updateTag(L.tagname,S,L[":@"]);O===!1||(typeof O=="string"&&(L.tagname=O),_.addChild(L))}const w=function(_){if(this.options.processEntities){for(let L in this.docTypeEntities){const S=this.docTypeEntities[L];_=_.replace(S.regx,S.val)}for(let L in this.lastEntities){const S=this.lastEntities[L];_=_.replace(S.regex,S.val)}if(this.options.htmlEntities)for(let L in this.htmlEntities){const S=this.htmlEntities[L];_=_.replace(S.regex,S.val)}_=_.replace(this.ampEntity.regex,this.ampEntity.val)}return _};function T(_,L,S,O){return _&&(O===void 0&&(O=Object.keys(L.child).length===0),(_=this.parseTextData(_,L.tagname,S,!1,!!L[":@"]&&Object.keys(L[":@"]).length!==0,O))!==void 0&&_!==""&&L.add(this.options.textNodeName,_),_=""),_}function I(_,L,S){const O="*."+S;for(const U in _){const M=_[U];if(O===M||L===M)return!0}return!1}function g(_,L,S,O){const U=_.indexOf(L,S);if(U===-1)throw new Error(O);return U+L.length-1}function v(_,L,S){const O=(function(X,V){let Z,z=arguments.length>2&&arguments[2]!==void 0?arguments[2]:">",st="";for(let W=V;W3&&arguments[3]!==void 0?arguments[3]:">");if(!O)return;let U=O.data;const M=O.index,R=U.search(/\s/);let D=U,F=!0;R!==-1&&(D=U.substring(0,R),U=U.substring(R+1).trimStart());const G=D;if(S){const X=D.indexOf(":");X!==-1&&(D=D.substr(X+1),F=D!==O.data.substr(X+1))}return{tagName:D,tagExp:U,closeIndex:M,attrExpPresent:F,rawTagName:G}}function N(_,L,S){const O=S;let U=1;for(;S<_.length;S++)if(_[S]==="<")if(_[S+1]==="/"){const M=g(_,">",S,`${L} is not closed`);if(_.substring(S+2,M).trim()===L&&(U--,U===0))return{tagContent:_.substring(O,S),i:M};S=M}else if(_[S+1]==="?")S=g(_,"?>",S+1,"StopNode is not closed.");else if(_.substr(S+1,3)==="!--")S=g(_,"-->",S+3,"StopNode is not closed.");else if(_.substr(S+1,2)==="![")S=g(_,"]]>",S,"StopNode is not closed.")-2;else{const M=v(_,S,">");M&&((M&&M.tagName)===L&&M.tagExp[M.tagExp.length-1]!=="/"&&U++,S=M.closeIndex)}}function P(_,L,S){if(L&&typeof _=="string"){const O=_.trim();return O==="true"||O!=="false"&&h(_,S)}return o.isExist(_)?_:""}e.exports=class{constructor(_){this.options=_,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:(L,S)=>String.fromCharCode(Number.parseInt(S,10))},num_hex:{regex:/&#x([0-9a-fA-F]{1,6});/g,val:(L,S)=>String.fromCharCode(Number.parseInt(S,16))}},this.addExternalEntities=d,this.parseXml=b,this.parseTextData=s,this.resolveNameSpace=u,this.buildAttributesMap=p,this.isItStopNode=I,this.replaceEntitiesValue=w,this.readStopNodeData=N,this.saveTextToParentTag=T,this.addChild=E,this.ignoreAttributesFn=c(this.options.ignoreAttributes)}}},338:(e,t,n)=>{const{buildOptions:o}=n(63),i=n(299),{prettify:a}=n(728),h=n(31);e.exports=class{constructor(c){this.externalEntities={},this.options=o(c)}parse(c,d){if(typeof c!="string"){if(!c.toString)throw new Error("XML data is accepted in String or Bytes[] form.");c=c.toString()}if(d){d===!0&&(d={});const f=h.validate(c,d);if(f!==!0)throw Error(`${f.err.msg}:${f.err.line}:${f.err.col}`)}const s=new i(this.options);s.addExternalEntities(this.externalEntities);const u=s.parseXml(c);return this.options.preserveOrder||u===void 0?u:a(u,this.options)}addEntity(c,d){if(d.indexOf("&")!==-1)throw new Error("Entity value can't have '&'");if(c.indexOf("&")!==-1||c.indexOf(";")!==-1)throw new Error("An entity must be set without '&' and ';'. Eg. use '#xD' for ' '");if(d==="&")throw new Error("An entity with value '&' is not permitted");this.externalEntities[c]=d}}},728:(e,t)=>{function n(h,c,d){let s;const u={};for(let f=0;f0&&(u[c.textNodeName]=s):s!==void 0&&(u[c.textNodeName]=s),u}function o(h){const c=Object.keys(h);for(let d=0;d{e.exports=class{constructor(t){this.tagname=t,this.child=[],this[":@"]={}}add(t,n){t==="__proto__"&&(t="#__proto__"),this.child.push({[t]:n})}addChild(t){t.tagname==="__proto__"&&(t.tagname="#__proto__"),t[":@"]&&Object.keys(t[":@"]).length>0?this.child.push({[t.tagname]:t.child,":@":t[":@"]}):this.child.push({[t.tagname]:t.child})}}},135:e=>{function t(n){return!!n.constructor&&typeof n.constructor.isBuffer=="function"&&n.constructor.isBuffer(n)}e.exports=function(n){return n!=null&&(t(n)||(function(o){return typeof o.readFloatLE=="function"&&typeof o.slice=="function"&&t(o.slice(0,0))})(n)||!!n._isBuffer)}},542:(e,t,n)=>{(function(){var o=n(298),i=n(526).utf8,a=n(135),h=n(526).bin,c=function(d,s){d.constructor==String?d=s&&s.encoding==="binary"?h.stringToBytes(d):i.stringToBytes(d):a(d)?d=Array.prototype.slice.call(d,0):Array.isArray(d)||d.constructor===Uint8Array||(d=d.toString());for(var u=o.bytesToWords(d),f=8*d.length,p=1732584193,b=-271733879,E=-1732584194,w=271733878,T=0;T>>24)|4278255360&(u[T]<<24|u[T]>>>8);u[f>>>5]|=128<>>9<<4)]=f;var I=c._ff,g=c._gg,v=c._hh,N=c._ii;for(T=0;T>>0,b=b+_>>>0,E=E+L>>>0,w=w+S>>>0}return o.endian([p,b,E,w])};c._ff=function(d,s,u,f,p,b,E){var w=d+(s&u|~s&f)+(p>>>0)+E;return(w<>>32-b)+s},c._gg=function(d,s,u,f,p,b,E){var w=d+(s&f|u&~f)+(p>>>0)+E;return(w<>>32-b)+s},c._hh=function(d,s,u,f,p,b,E){var w=d+(s^u^f)+(p>>>0)+E;return(w<>>32-b)+s},c._ii=function(d,s,u,f,p,b,E){var w=d+(u^(s|~f))+(p>>>0)+E;return(w<>>32-b)+s},c._blocksize=16,c._digestsize=16,e.exports=function(d,s){if(d==null)throw new Error("Illegal argument "+d);var u=o.wordsToBytes(c(d,s));return s&&s.asBytes?u:s&&s.asString?h.bytesToString(u):o.bytesToHex(u)}})()},285:(e,t,n)=>{var o=n(2);e.exports=function(I){return I?(I.substr(0,2)==="{}"&&(I="\\{\\}"+I.substr(2)),T((function(g){return g.split("\\\\").join(i).split("\\{").join(a).split("\\}").join(h).split("\\,").join(c).split("\\.").join(d)})(I),!0).map(u)):[]};var i="\0SLASH"+Math.random()+"\0",a="\0OPEN"+Math.random()+"\0",h="\0CLOSE"+Math.random()+"\0",c="\0COMMA"+Math.random()+"\0",d="\0PERIOD"+Math.random()+"\0";function s(I){return parseInt(I,10)==I?parseInt(I,10):I.charCodeAt(0)}function u(I){return I.split(i).join("\\").split(a).join("{").split(h).join("}").split(c).join(",").split(d).join(".")}function f(I){if(!I)return[""];var g=[],v=o("{","}",I);if(!v)return I.split(",");var N=v.pre,P=v.body,_=v.post,L=N.split(",");L[L.length-1]+="{"+P+"}";var S=f(_);return _.length&&(L[L.length-1]+=S.shift(),L.push.apply(L,S)),g.push.apply(g,L),g}function p(I){return"{"+I+"}"}function b(I){return/^-?0\d/.test(I)}function E(I,g){return I<=g}function w(I,g){return I>=g}function T(I,g){var v=[],N=o("{","}",I);if(!N)return[I];var P=N.pre,_=N.post.length?T(N.post,!1):[""];if(/\$$/.test(N.pre))for(var L=0;L<_.length;L++){var S=P+"{"+N.body+"}"+_[L];v.push(S)}else{var O,U,M=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(N.body),R=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(N.body),D=M||R,F=N.body.indexOf(",")>=0;if(!D&&!F)return N.post.match(/,.*\}/)?T(I=N.pre+"{"+N.body+h+N.post):[I];if(D)O=N.body.split(/\.\./);else if((O=f(N.body)).length===1&&(O=T(O[0],!1).map(p)).length===1)return _.map((function(Nt){return N.pre+O[0]+Nt}));if(D){var G=s(O[0]),X=s(O[1]),V=Math.max(O[0].length,O[1].length),Z=O.length==3?Math.abs(s(O[2])):1,z=E;X0){var Lt=new Array(jt+1).join("0");Q=W<0?"-"+Lt+Q.slice(1):Lt+Q}}U.push(Q)}}else{U=[];for(var At=0;At{function t(s){return t=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(u){return typeof u}:function(u){return u&&typeof Symbol=="function"&&u.constructor===Symbol&&u!==Symbol.prototype?"symbol":typeof u},t(s)}function n(s){var u=typeof Map=="function"?new Map:void 0;return n=function(f){if(f===null||(p=f,Function.toString.call(p).indexOf("[native code]")===-1))return f;var p;if(typeof f!="function")throw new TypeError("Super expression must either be null or a function");if(u!==void 0){if(u.has(f))return u.get(f);u.set(f,b)}function b(){return o(f,arguments,a(this).constructor)}return b.prototype=Object.create(f.prototype,{constructor:{value:b,enumerable:!1,writable:!0,configurable:!0}}),i(b,f)},n(s)}function o(s,u,f){return o=(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(p,b,E){var w=[null];w.push.apply(w,b);var T=new(Function.bind.apply(p,w));return E&&i(T,E.prototype),T},o.apply(null,arguments)}function i(s,u){return i=Object.setPrototypeOf||function(f,p){return f.__proto__=p,f},i(s,u)}function a(s){return a=Object.setPrototypeOf?Object.getPrototypeOf:function(u){return u.__proto__||Object.getPrototypeOf(u)},a(s)}var h=(function(s){function u(f){var p;return(function(b,E){if(!(b instanceof E))throw new TypeError("Cannot call a class as a function")})(this,u),(p=(function(b,E){return!E||t(E)!=="object"&&typeof E!="function"?(function(w){if(w===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return w})(b):E})(this,a(u).call(this,f))).name="ObjectPrototypeMutationError",p}return(function(f,p){if(typeof p!="function"&&p!==null)throw new TypeError("Super expression must either be null or a function");f.prototype=Object.create(p&&p.prototype,{constructor:{value:f,writable:!0,configurable:!0}}),p&&i(f,p)})(u,s),u})(n(Error));function c(s,u){for(var f=arguments.length>2&&arguments[2]!==void 0?arguments[2]:function(){},p=u.split("."),b=p.length,E=function(I){var g=p[I];if(!s)return{v:void 0};if(g==="+"){if(Array.isArray(s))return{v:s.map((function(N,P){var _=p.slice(I+1);return _.length>0?c(N,_.join("."),f):f(s,P,p,I)}))};var v=p.slice(0,I).join(".");throw new Error("Object at wildcard (".concat(v,") is not an array"))}s=f(s,g,p,I)},w=0;w2&&arguments[2]!==void 0?arguments[2]:{};if(t(s)!="object"||s===null||u===void 0)return!1;if(typeof u=="number")return u in s;try{var p=!1;return c(s,u,(function(b,E,w,T){if(!d(w,T))return b&&b[E];p=f.own?b.hasOwnProperty(E):E in b})),p}catch{return!1}},hasOwn:function(s,u,f){return this.has(s,u,f||{own:!0})},isIn:function(s,u,f){var p=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};if(t(s)!="object"||s===null||u===void 0)return!1;try{var b=!1,E=!1;return c(s,u,(function(w,T,I,g){return b=b||w===f||!!w&&w[T]===f,E=d(I,g)&&t(w)==="object"&&T in w,w&&w[T]})),p.validPath?b&&E:b}catch{return!1}},ObjectPrototypeMutationError:h}},47:(e,t,n)=>{var o=n(410),i=function(s){return typeof s=="string"};function a(s,u){for(var f=[],p=0;p=-1&&!u;f--){var p=f>=0?arguments[f]:Vt.cwd();if(!i(p))throw new TypeError("Arguments to path.resolve must be strings");p&&(s=p+"/"+s,u=p.charAt(0)==="/")}return(u?"/":"")+(s=a(s.split("/"),!u).join("/"))||"."},c.normalize=function(s){var u=c.isAbsolute(s),f=s.substr(-1)==="/";return(s=a(s.split("/"),!u).join("/"))||u||(s="."),s&&f&&(s+="/"),(u?"/":"")+s},c.isAbsolute=function(s){return s.charAt(0)==="/"},c.join=function(){for(var s="",u=0;u=0&&g[N]==="";N--);return v>N?[]:g.slice(v,N+1)}s=c.resolve(s).substr(1),u=c.resolve(u).substr(1);for(var p=f(s.split("/")),b=f(u.split("/")),E=Math.min(p.length,b.length),w=E,T=0;T{var n=Object.prototype.hasOwnProperty;function o(a){try{return decodeURIComponent(a.replace(/\+/g," "))}catch{return null}}function i(a){try{return encodeURIComponent(a)}catch{return null}}t.stringify=function(a,h){h=h||"";var c,d,s=[];for(d in typeof h!="string"&&(h="?"),a)if(n.call(a,d)){if((c=a[d])||c!=null&&!isNaN(c)||(c=""),d=i(d),c=i(c),d===null||c===null)continue;s.push(d+"="+c)}return s.length?h+s.join("&"):""},t.parse=function(a){for(var h,c=/([^=?#&]+)=?([^&]*)/g,d={};h=c.exec(a);){var s=o(h[1]),u=o(h[2]);s===null||u===null||s in d||(d[s]=u)}return d}},670:e=>{e.exports=function(t,n){if(n=n.split(":")[0],!(t=+t))return!1;switch(n){case"http":case"ws":return t!==80;case"https":case"wss":return t!==443;case"ftp":return t!==21;case"gopher":return t!==70;case"file":return!1}return t!==0}},494:e=>{const t=/^[-+]?0x[a-fA-F0-9]+$/,n=/^([\-\+])?(0*)(\.[0-9]+([eE]\-?[0-9]+)?|[0-9]+(\.[0-9]+([eE]\-?[0-9]+)?)?)$/;!Number.parseInt&&window.parseInt&&(Number.parseInt=window.parseInt),!Number.parseFloat&&window.parseFloat&&(Number.parseFloat=window.parseFloat);const o={hex:!0,leadingZeros:!0,decimalPoint:".",eNotation:!0};e.exports=function(i){let a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(a=Object.assign({},o,a),!i||typeof i!="string")return i;let h=i.trim();if(a.skipLike!==void 0&&a.skipLike.test(h))return i;if(a.hex&&t.test(h))return Number.parseInt(h,16);{const d=n.exec(h);if(d){const s=d[1],u=d[2];let f=((c=d[3])&&c.indexOf(".")!==-1&&((c=c.replace(/0+$/,""))==="."?c="0":c[0]==="."?c="0"+c:c[c.length-1]==="."&&(c=c.substr(0,c.length-1))),c);const p=d[4]||d[6];if(!a.leadingZeros&&u.length>0&&s&&h[2]!=="."||!a.leadingZeros&&u.length>0&&!s&&h[1]!==".")return i;{const b=Number(h),E=""+b;return E.search(/[eE]/)!==-1||p?a.eNotation?b:i:h.indexOf(".")!==-1?E==="0"&&f===""||E===f||s&&E==="-"+f?b:i:u?f===E||s+f===E?b:i:h===E||h===s+E?b:i}}return i}var c}},737:(e,t,n)=>{var o=n(670),i=n(647),a=/^[\x00-\x20\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]+/,h=/[\n\r\t]/g,c=/^[A-Za-z][A-Za-z0-9+-.]*:\/\//,d=/:\d+$/,s=/^([a-z][a-z0-9.+-]*:)?(\/\/)?([\\/]+)?([\S\s]*)/i,u=/^[a-zA-Z]:/;function f(g){return(g||"").toString().replace(a,"")}var p=[["#","hash"],["?","query"],function(g,v){return w(v.protocol)?g.replace(/\\/g,"/"):g},["/","pathname"],["@","auth",1],[NaN,"host",void 0,1,1],[/:(\d*)$/,"port",void 0,1],[NaN,"hostname",void 0,1,1]],b={hash:1,query:1};function E(g){var v,N=(typeof window<"u"?window:typeof ie<"u"?ie:typeof self<"u"?self:{}).location||{},P={},_=typeof(g=g||N);if(g.protocol==="blob:")P=new I(unescape(g.pathname),{});else if(_==="string")for(v in P=new I(g,{}),b)delete P[v];else if(_==="object"){for(v in g)v in b||(P[v]=g[v]);P.slashes===void 0&&(P.slashes=c.test(g.href))}return P}function w(g){return g==="file:"||g==="ftp:"||g==="http:"||g==="https:"||g==="ws:"||g==="wss:"}function T(g,v){g=(g=f(g)).replace(h,""),v=v||{};var N,P=s.exec(g),_=P[1]?P[1].toLowerCase():"",L=!!P[2],S=!!P[3],O=0;return L?S?(N=P[2]+P[3]+P[4],O=P[2].length+P[3].length):(N=P[2]+P[4],O=P[2].length):S?(N=P[3]+P[4],O=P[3].length):N=P[4],_==="file:"?O>=2&&(N=N.slice(2)):w(_)?N=P[4]:_?L&&(N=N.slice(2)):O>=2&&w(v.protocol)&&(N=P[4]),{protocol:_,slashes:L||w(_),slashesCount:O,rest:N}}function I(g,v,N){if(g=(g=f(g)).replace(h,""),!(this instanceof I))return new I(g,v,N);var P,_,L,S,O,U,M=p.slice(),R=typeof v,D=this,F=0;for(R!=="object"&&R!=="string"&&(N=v,v=null),N&&typeof N!="function"&&(N=i.parse),P=!(_=T(g||"",v=E(v))).protocol&&!_.slashes,D.slashes=_.slashes||P&&v.slashes,D.protocol=_.protocol||v.protocol||"",g=_.rest,(_.protocol==="file:"&&(_.slashesCount!==2||u.test(g))||!_.slashes&&(_.protocol||_.slashesCount<2||!w(D.protocol)))&&(M[3]=[/(.*)/,"pathname"]);F{},388:()=>{},805:()=>{},345:()=>{},800:()=>{}},Cn={};function Y(e){var t=Cn[e];if(t!==void 0)return t.exports;var n=Cn[e]={id:e,loaded:!1,exports:{}};return Ao[e].call(n.exports,n,n.exports,Y),n.loaded=!0,n.exports}Y.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return Y.d(t,{a:t}),t},Y.d=(e,t)=>{for(var n in t)Y.o(t,n)&&!Y.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},Y.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),Y.nmd=e=>(e.paths=[],e.children||(e.children=[]),e);var Ot={};Y.d(Ot,{hT:()=>yt,O4:()=>Pt,Kd:()=>Po,YK:()=>Lo,UU:()=>ji,Gu:()=>Or,ky:()=>Cr,h4:()=>ee,ch:()=>we,hq:()=>Ut,i5:()=>$r});var To=Y(737),Oo=Y.n(To);function Ce(e){if(!tn(e))throw new Error("Parameter was not an error")}function tn(e){return!!e&&typeof e=="object"&&(t=e,Object.prototype.toString.call(t)==="[object Error]")||e instanceof Error;var t}class vt extends Error{constructor(t,n){const o=[...arguments],{options:i,shortMessage:a}=(function(c){let d,s="";if(c.length===0)d={};else if(tn(c[0]))d={cause:c[0]},s=c.slice(1).join(" ")||"";else if(c[0]&&typeof c[0]=="object")d=Object.assign({},c[0]),s=c.slice(1).join(" ")||"";else{if(typeof c[0]!="string")throw new Error("Invalid arguments passed to Layerr");d={},s=s=c.join(" ")||""}return{options:d,shortMessage:s}})(o);let h=a;if(i.cause&&(h=`${h}: ${i.cause.message}`),super(h),this.message=h,i.name&&typeof i.name=="string"?this.name=i.name:this.name="Layerr",i.cause&&Object.defineProperty(this,"_cause",{value:i.cause}),Object.defineProperty(this,"_info",{value:{}}),i.info&&typeof i.info=="object"&&Object.assign(this._info,i.info),Error.captureStackTrace){const c=i.constructorOpt||this.constructor;Error.captureStackTrace(this,c)}}static cause(t){return Ce(t),t._cause&&tn(t._cause)?t._cause:null}static fullStack(t){Ce(t);const n=vt.cause(t);return n?`${t.stack} caused by: ${vt.fullStack(n)}`:t.stack??""}static info(t){Ce(t);const n={},o=vt.cause(t);return o&&Object.assign(n,vt.info(o)),t._info&&Object.assign(n,t._info),n}toString(){let t=this.name||this.constructor.name||this.constructor.prototype.name;return this.message&&(t=`${t}: ${this.message}`),t}}var Io=Y(47),fe=Y.n(Io);const $n="__PATH_SEPARATOR_POSIX__",Dn="__PATH_SEPARATOR_WINDOWS__";function tt(e){try{const t=e.replace(/\//g,$n).replace(/\\\\/g,Dn);return encodeURIComponent(t).split(Dn).join("\\\\").split($n).join("/")}catch(t){throw new vt(t,"Failed encoding path")}}function Bn(e){return e.startsWith("/")?e:"/"+e}function te(e){let t=e;return t[0]!=="/"&&(t="/"+t),/^.+\/$/.test(t)&&(t=t.substr(0,t.length-1)),t}function No(e){let t=new(Oo())(e).pathname;return t.length<=0&&(t="/"),te(t)}function et(){for(var e=arguments.length,t=new Array(e),n=0;n1){var a=o.shift();o[0]=a+o[0]}o[0].match(/^file:\/\/\//)?o[0]=o[0].replace(/^([^/:]+):\/*/,"$1:///"):o[0]=o[0].replace(/^([^/:]+):\/*/,"$1://");for(var h=0;h0&&(c=c.replace(/^[\/]+/,"")),c=h0?"?":"")+s.join("&")})(typeof arguments[0]=="object"?arguments[0]:[].slice.call(arguments))})(t.reduce(((o,i,a)=>((a===0||i!=="/"||i==="/"&&o[o.length-1]!=="/")&&o.push(i),o)),[]))}var _o=Y(542),zt=Y.n(_o);const Ro="abcdef0123456789";function Un(e,t){const n=e.url.replace("//",""),o=n.indexOf("/")==-1?"/":n.slice(n.indexOf("/")),i=e.method?e.method.toUpperCase():"GET",a=!!/(^|,)\s*auth\s*($|,)/.test(t.qop)&&"auth",h=`00000000${t.nc}`.slice(-8),c=(function(p,b,E,w,T,I,g){const v=g||zt()(`${b}:${E}:${w}`);return p&&p.toLowerCase()==="md5-sess"?zt()(`${v}:${T}:${I}`):v})(t.algorithm,t.username,t.realm,t.password,t.nonce,t.cnonce,t.ha1),d=zt()(`${i}:${o}`),s=a?zt()(`${c}:${t.nonce}:${h}:${t.cnonce}:${a}:${d}`):zt()(`${c}:${t.nonce}:${d}`),u={username:t.username,realm:t.realm,nonce:t.nonce,uri:o,qop:a,response:s,nc:h,cnonce:t.cnonce,algorithm:t.algorithm,opaque:t.opaque},f=[];for(const p in u)u[p]&&(p==="qop"||p==="nc"||p==="algorithm"?f.push(`${p}=${u[p]}`):f.push(`${p}="${u[p]}"`));return`Digest ${f.join(", ")}`}function wr(e){return(e.headers&&e.headers.get("www-authenticate")||"").split(/\s/)[0].toLowerCase()==="digest"}var So=Y(101),Ar=Y.n(So);function jn(e){return Ar().decode(e)}function Mn(e,t){var n;return`Basic ${n=`${e}:${t}`,Ar().encode(n)}`}const pe=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope?self:typeof window<"u"?window:globalThis,xo=pe.fetch.bind(pe),Po=pe.Request,Lo=pe.Response;let yt=(function(e){return e.Auto="auto",e.Digest="digest",e.None="none",e.Password="password",e.Token="token",e})({}),Pt=(function(e){return e.DataTypeNoLength="data-type-no-length",e.InvalidAuthType="invalid-auth-type",e.InvalidOutputFormat="invalid-output-format",e.LinkUnsupportedAuthType="link-unsupported-auth",e.InvalidUpdateRange="invalid-update-range",e.NotSupported="not-supported",e})({});function Tr(e,t,n,o,i){switch(e.authType){case yt.Auto:t&&n&&(e.headers.Authorization=Mn(t,n));break;case yt.Digest:e.digest=(function(h,c,d){return{username:h,password:c,ha1:d,nc:0,algorithm:"md5",hasDigestAuth:!1}})(t,n,i);break;case yt.None:break;case yt.Password:e.headers.Authorization=Mn(t,n);break;case yt.Token:e.headers.Authorization=`${(a=o).token_type} ${a.access_token}`;break;default:throw new vt({info:{code:Pt.InvalidAuthType}},`Invalid auth type: ${e.authType}`)}var a}Y(345),Y(800);const kn="@@HOTPATCHER",Co=()=>{};function $e(e){return{original:e,methods:[e],final:!1}}class $o{constructor(){this._configuration={registry:{},getEmptyAction:"null"},this.__type__=kn}get configuration(){return this._configuration}get getEmptyAction(){return this.configuration.getEmptyAction}set getEmptyAction(t){this.configuration.getEmptyAction=t}control(t){let n=arguments.length>1&&arguments[1]!==void 0&&arguments[1];if(!t||t.__type__!==kn)throw new Error("Failed taking control of target HotPatcher instance: Invalid type or object");return Object.keys(t.configuration.registry).forEach((o=>{this.configuration.registry.hasOwnProperty(o)?n&&(this.configuration.registry[o]=Object.assign({},t.configuration.registry[o])):this.configuration.registry[o]=Object.assign({},t.configuration.registry[o])})),t._configuration=this.configuration,this}execute(t){const n=this.get(t)||Co;for(var o=arguments.length,i=new Array(o>1?o-1:0),a=1;a0;)s=[i.shift().apply(u,s)];return s[0]}})(...n.methods)}isPatched(t){return!!this.configuration.registry[t]}patch(t,n){let o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const{chain:i=!1}=o;if(this.configuration.registry[t]&&this.configuration.registry[t].final)throw new Error(`Failed patching '${t}': Method marked as being final`);if(typeof n!="function")throw new Error(`Failed patching '${t}': Provided method is not a function`);if(i)this.configuration.registry[t]?this.configuration.registry[t].methods.push(n):this.configuration.registry[t]=$e(n);else if(this.isPatched(t)){const{original:a}=this.configuration.registry[t];this.configuration.registry[t]=Object.assign($e(n),{original:a})}else this.configuration.registry[t]=$e(n);return this}patchInline(t,n){this.isPatched(t)||this.patch(t,n);for(var o=arguments.length,i=new Array(o>2?o-2:0),a=2;a1?n-1:0),i=1;i{this.patch(t,a,{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 De=null;function Or(){return De||(De=new $o),De}function ge(e){return(function(t){if(typeof t!="object"||t===null||Object.prototype.toString.call(t)!="[object Object]")return!1;if(Object.getPrototypeOf(t)===null)return!0;let n=t;for(;Object.getPrototypeOf(n)!==null;)n=Object.getPrototypeOf(n);return Object.getPrototypeOf(t)===n})(e)?Object.assign({},e):Object.setPrototypeOf(Object.assign({},e),Object.getPrototypeOf(e))}function Gn(){for(var e=arguments.length,t=new Array(e),n=0;n0;){const a=i.shift();o=o?Ir(o,a):ge(a)}return o}function Ir(e,t){const n=ge(e);return Object.keys(t).forEach((o=>{n.hasOwnProperty(o)?Array.isArray(t[o])?n[o]=Array.isArray(n[o])?[...n[o],...t[o]]:[...t[o]]:typeof t[o]=="object"&&t[o]?n[o]=typeof n[o]=="object"&&n[o]?Ir(n[o],t[o]):ge(t[o]):n[o]=t[o]:n[o]=t[o]})),n}function Do(e){const t={};for(const n of e.keys())t[n]=e.get(n);return t}function en(){for(var e=arguments.length,t=new Array(e),n=0;n(Object.keys(a).forEach((h=>{const c=h.toLowerCase();o.hasOwnProperty(c)?i[o[c]]=a[h]:(o[c]=h,i[h]=a[h])})),i)),{})}Y(805);const Bo=typeof ArrayBuffer=="function",{toString:Uo}=Object.prototype;function Nr(e){return Bo&&(e instanceof ArrayBuffer||Uo.call(e)==="[object ArrayBuffer]")}function _r(e){return e!=null&&e.constructor!=null&&typeof e.constructor.isBuffer=="function"&&e.constructor.isBuffer(e)}function cn(e){return function(){for(var t=[],n=0;nt.patchInline("fetch",xo,n.url,(function(o){let i={};const a={method:o.method};if(o.headers&&(i=en(i,o.headers)),o.data!==void 0){const[h,c]=(function(d){if(typeof d=="string")return[d,{}];if(_r(d))return[d,{}];if(Nr(d))return[d,{}];if(d&&typeof d=="object")return[JSON.stringify(d),{"content-type":"application/json"}];throw new Error("Unable to convert request body: Unexpected body type: "+typeof d)})(o.data);a.body=h,i=en(i,c)}return o.signal&&(a.signal=o.signal),o.withCredentials&&(a.credentials="include"),a.headers=i,a})(n))),e)}var Mo=Y(285);const me=e=>{if(typeof e!="string")throw new TypeError("invalid pattern");if(e.length>65536)throw new TypeError("pattern is too long")},ko={"[: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]},Yt=e=>e.replace(/[[\]\\-]/g,"\\$&"),Fn=e=>e.join(""),Go=(e,t)=>{const n=t;if(e.charAt(n)!=="[")throw new Error("not in a brace expression");const o=[],i=[];let a=n+1,h=!1,c=!1,d=!1,s=!1,u=n,f="";t:for(;af?o.push(Yt(f)+"-"+Yt(w)):w===f&&o.push(Yt(w)),f="",a++):e.startsWith("-]",a+1)?(o.push(Yt(w+"-")),a+=2):e.startsWith("-",a+1)?(f=w,a+=2):(o.push(Yt(w)),a++)}else d=!0,a++}else s=!0,a++}if(u1&&arguments[1]!==void 0?arguments[1]:{};return t?e.replace(/\[([^\/\\])\]/g,"$1"):e.replace(/((?!\\).|^)\[([^\/\\])\]/g,"$1$2").replace(/\\([^\/])/g,"$1")},Fo=new Set(["!","?","+","*","@"]),Vn=e=>Fo.has(e),Be="(?!\\.)",Vo=new Set(["[","."]),Xo=new Set(["..","."]),qo=new Set("().*{}+?[]^$\\!"),hn="[^/]",Xn=hn+"*?",qn=hn+"+?";class Et{type;#n;#r;#i=!1;#t=[];#e;#s;#u;#a=!1;#o;#l;#h=!1;constructor(t,n){let o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.type=t,t&&(this.#r=!0),this.#e=n,this.#n=this.#e?this.#e.#n:this,this.#o=this.#n===this?o:this.#n.#o,this.#u=this.#n===this?[]:this.#n.#u,t!=="!"||this.#n.#a||this.#u.push(this),this.#s=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("")}#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 n=t,o=n.#e;for(;o;){for(let i=n.#s+1;!o.type&&itypeof n=="string"?n:n.toJSON())):[this.type,...this.#t.map((n=>n.toJSON()))];return this.isStart()&&!this.type&&t.unshift([]),this.isEnd()&&(this===this.#n||this.#n.#a&&this.#e?.type==="!")&&t.push({}),t}isStart(){if(this.#n===this)return!0;if(!this.#e?.isStart())return!1;if(this.#s===0)return!0;const t=this.#e;for(let n=0;n1&&arguments[1]!==void 0?arguments[1]:{};const o=new Et(null,void 0,n);return Et.#c(t,o,0,n),o}toMMPattern(){if(this!==this.#n)return this.#n.toMMPattern();const t=this.toString(),[n,o,i,a]=this.toRegExpSource();if(!(i||this.#r||this.#o.nocase&&!this.#o.nocaseMagicOnly&&t.toUpperCase()!==t.toLowerCase()))return o;const h=(this.#o.nocase?"i":"")+(a?"u":"");return Object.assign(new RegExp(`^${n}$`,h),{_src:n,_glob:t})}get options(){return this.#o}toRegExpSource(t){const n=t??!!this.#o.dot;if(this.#n===this&&this.#p(),!this.type){const d=this.isStart()&&this.isEnd(),s=this.#t.map((p=>{const[b,E,w,T]=typeof p=="string"?Et.#g(p,this.#r,d):p.toRegExpSource(t);return this.#r=this.#r||w,this.#i=this.#i||T,b})).join("");let u="";if(this.isStart()&&typeof this.#t[0]=="string"&&(this.#t.length!==1||!Xo.has(this.#t[0]))){const p=Vo,b=n&&p.has(s.charAt(0))||s.startsWith("\\.")&&p.has(s.charAt(2))||s.startsWith("\\.\\.")&&p.has(s.charAt(4)),E=!n&&!t&&p.has(s.charAt(0));u=b?"(?!(?:^|/)\\.\\.?(?:$|/))":E?Be:""}let f="";return this.isEnd()&&this.#n.#a&&this.#e?.type==="!"&&(f="(?:$|\\/)"),[u+s+f,Zt(s),this.#r=!!this.#r,this.#i]}const o=this.type==="*"||this.type==="+",i=this.type==="!"?"(?:(?!(?:":"(?:";let a=this.#f(n);if(this.isStart()&&this.isEnd()&&!a&&this.type!=="!"){const d=this.toString();return this.#t=[d],this.type=null,this.#r=void 0,[d,Zt(this.toString()),!1,!1]}let h=!o||t||n?"":this.#f(!0);h===a&&(h=""),h&&(a=`(?:${a})(?:${h})*?`);let c="";return c=this.type==="!"&&this.#h?(this.isStart()&&!n?Be:"")+qn:i+a+(this.type==="!"?"))"+(!this.isStart()||n||t?"":Be)+Xn+")":this.type==="@"?")":this.type==="?"?")?":this.type==="+"&&h?")":this.type==="*"&&h?")?":`)${this.type}`),[c,Zt(a),this.#r=!!this.#r,this.#i]}#f(t){return this.#t.map((n=>{if(typeof n=="string")throw new Error("string type in extglob ast??");const[o,i,a,h]=n.toRegExpSource(t);return this.#i=this.#i||h,o})).filter((n=>!(this.isStart()&&this.isEnd()&&!n))).join("|")}static#g(t,n){let o=arguments.length>2&&arguments[2]!==void 0&&arguments[2],i=!1,a="",h=!1;for(let c=0;c2&&arguments[2]!==void 0?arguments[2]:{};return me(t),!(!n.nocomment&&t.charAt(0)==="#")&&new Ee(t,n).match(e)},Wo=/^\*+([^+@!?\*\[\(]*)$/,zo=e=>t=>!t.startsWith(".")&&t.endsWith(e),Yo=e=>t=>t.endsWith(e),Ho=e=>(e=e.toLowerCase(),t=>!t.startsWith(".")&&t.toLowerCase().endsWith(e)),Zo=e=>(e=e.toLowerCase(),t=>t.toLowerCase().endsWith(e)),Qo=/^\*+\.\*+$/,Jo=e=>!e.startsWith(".")&&e.includes("."),Ko=e=>e!=="."&&e!==".."&&e.includes("."),ti=/^\.\*+$/,ei=e=>e!=="."&&e!==".."&&e.startsWith("."),ni=/^\*+$/,ri=e=>e.length!==0&&!e.startsWith("."),oi=e=>e.length!==0&&e!=="."&&e!=="..",ii=/^\?+([^+@!?\*\[\(]*)?$/,si=e=>{let[t,n=""]=e;const o=Sr([t]);return n?(n=n.toLowerCase(),i=>o(i)&&i.toLowerCase().endsWith(n)):o},ai=e=>{let[t,n=""]=e;const o=xr([t]);return n?(n=n.toLowerCase(),i=>o(i)&&i.toLowerCase().endsWith(n)):o},ui=e=>{let[t,n=""]=e;const o=xr([t]);return n?i=>o(i)&&i.endsWith(n):o},li=e=>{let[t,n=""]=e;const o=Sr([t]);return n?i=>o(i)&&i.endsWith(n):o},Sr=e=>{let[t]=e;const n=t.length;return o=>o.length===n&&!o.startsWith(".")},xr=e=>{let[t]=e;const n=t.length;return o=>o.length===n&&o!=="."&&o!==".."},Pr=typeof Vt=="object"&&Vt?typeof Le=="object"&&Le&&Le.__MINIMATCH_TESTING_PLATFORM__||Vt.platform:"posix";mt.sep=Pr==="win32"?"\\":"/";const It=Symbol("globstar **");mt.GLOBSTAR=It,mt.filter=function(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return n=>mt(n,e,t)};const Tt=function(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return Object.assign({},e,t)};mt.defaults=e=>{if(!e||typeof e!="object"||!Object.keys(e).length)return mt;const t=mt;return Object.assign((function(n,o){return t(n,o,Tt(e,arguments.length>2&&arguments[2]!==void 0?arguments[2]:{}))}),{Minimatch:class extends t.Minimatch{constructor(n){super(n,Tt(e,arguments.length>1&&arguments[1]!==void 0?arguments[1]:{}))}static defaults(n){return t.defaults(Tt(e,n)).Minimatch}},AST:class extends t.AST{constructor(n,o){super(n,o,Tt(e,arguments.length>2&&arguments[2]!==void 0?arguments[2]:{}))}static fromGlob(n){let o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return t.AST.fromGlob(n,Tt(e,o))}},unescape:function(n){let o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return t.unescape(n,Tt(e,o))},escape:function(n){let o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return t.escape(n,Tt(e,o))},filter:function(n){let o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return t.filter(n,Tt(e,o))},defaults:n=>t.defaults(Tt(e,n)),makeRe:function(n){let o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return t.makeRe(n,Tt(e,o))},braceExpand:function(n){let o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return t.braceExpand(n,Tt(e,o))},match:function(n,o){let i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return t.match(n,o,Tt(e,i))},sep:t.sep,GLOBSTAR:It})};const Lr=function(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return me(e),t.nobrace||!/\{(?:(?!\{).)*\}/.test(e)?[e]:Mo(e)};mt.braceExpand=Lr,mt.makeRe=function(e){return new Ee(e,arguments.length>1&&arguments[1]!==void 0?arguments[1]:{}).makeRe()},mt.match=function(e,t){const n=new Ee(t,arguments.length>2&&arguments[2]!==void 0?arguments[2]:{});return e=e.filter((o=>n.match(o))),n.options.nonull&&!e.length&&e.push(t),e};const Wn=/[?*]|[+@!]\(.*?\)|\[|\]/;class Ee{options;set;pattern;windowsPathsNoEscape;nonegate;negate;comment;empty;preserveMultipleSlashes;partial;globSet;globParts;nocase;isWindows;platform;windowsNoMagicRoot;regexp;constructor(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};me(t),n=n||{},this.options=n,this.pattern=t,this.platform=n.platform||Pr,this.isWindows=this.platform==="win32",this.windowsPathsNoEscape=!!n.windowsPathsNoEscape||n.allowWindowsEscape===!1,this.windowsPathsNoEscape&&(this.pattern=this.pattern.replace(/\\/g,"/")),this.preserveMultipleSlashes=!!n.preserveMultipleSlashes,this.regexp=null,this.negate=!1,this.nonegate=!!n.nonegate,this.comment=!1,this.empty=!1,this.partial=!!n.partial,this.nocase=!!this.options.nocase,this.windowsNoMagicRoot=n.windowsNoMagicRoot!==void 0?n.windowsNoMagicRoot:!(!this.isWindows||!this.nocase),this.globSet=[],this.globParts=[],this.set=[],this.make()}hasMagic(){if(this.options.magicalBraces&&this.set.length>1)return!0;for(const t of this.set)for(const n of t)if(typeof n!="string")return!0;return!1}debug(){}make(){const t=this.pattern,n=this.options;if(!n.nocomment&&t.charAt(0)==="#")return void(this.comment=!0);if(!t)return void(this.empty=!0);this.parseNegate(),this.globSet=[...new Set(this.braceExpand())],n.debug&&(this.debug=function(){return console.error(...arguments)}),this.debug(this.pattern,this.globSet);const o=this.globSet.map((a=>this.slashSplit(a)));this.globParts=this.preprocess(o),this.debug(this.pattern,this.globParts);let i=this.globParts.map(((a,h,c)=>{if(this.isWindows&&this.windowsNoMagicRoot){const d=!(a[0]!==""||a[1]!==""||a[2]!=="?"&&Wn.test(a[2])||Wn.test(a[3])),s=/^[a-z]:/i.test(a[0]);if(d)return[...a.slice(0,4),...a.slice(4).map((u=>this.parse(u)))];if(s)return[a[0],...a.slice(1).map((u=>this.parse(u)))]}return a.map((d=>this.parse(d)))}));if(this.debug(this.pattern,i),this.set=i.filter((a=>a.indexOf(!1)===-1)),this.isWindows)for(let a=0;a=2?(t=this.firstPhasePreProcess(t),t=this.secondPhasePreProcess(t)):t=n>=1?this.levelOneOptimize(t):this.adjascentGlobstarOptimize(t),t}adjascentGlobstarOptimize(t){return t.map((n=>{let o=-1;for(;(o=n.indexOf("**",o+1))!==-1;){let i=o;for(;n[i+1]==="**";)i++;i!==o&&n.splice(o,i-o)}return n}))}levelOneOptimize(t){return t.map((n=>(n=n.reduce(((o,i)=>{const a=o[o.length-1];return i==="**"&&a==="**"?o:i===".."&&a&&a!==".."&&a!=="."&&a!=="**"?(o.pop(),o):(o.push(i),o)}),[])).length===0?[""]:n))}levelTwoFileOptimize(t){Array.isArray(t)||(t=this.slashSplit(t));let n=!1;do{if(n=!1,!this.preserveMultipleSlashes){for(let i=1;ii&&o.splice(i+1,h-i);let c=o[i+1];const d=o[i+2],s=o[i+3];if(c!==".."||!d||d==="."||d===".."||!s||s==="."||s==="..")continue;n=!0,o.splice(i,1);const u=o.slice(0);u[i]="**",t.push(u),i--}if(!this.preserveMultipleSlashes){for(let h=1;hn.length))}partsMatch(t,n){let o=arguments.length>2&&arguments[2]!==void 0&&arguments[2],i=0,a=0,h=[],c="";for(;i2&&arguments[2]!==void 0&&arguments[2];const i=this.options;if(this.isWindows){const w=typeof t[0]=="string"&&/^[a-z]:$/i.test(t[0]),T=!w&&t[0]===""&&t[1]===""&&t[2]==="?"&&/^[a-z]:$/i.test(t[3]),I=typeof n[0]=="string"&&/^[a-z]:$/i.test(n[0]),g=T?3:w?0:void 0,v=!I&&n[0]===""&&n[1]===""&&n[2]==="?"&&typeof n[3]=="string"&&/^[a-z]:$/i.test(n[3])?3:I?0:void 0;if(typeof g=="number"&&typeof v=="number"){const[N,P]=[t[g],n[v]];N.toLowerCase()===P.toLowerCase()&&(n[v]=N,v>g?n=n.slice(v):g>v&&(t=t.slice(g)))}}const{optimizationLevel:a=1}=this.options;a>=2&&(t=this.levelTwoFileOptimize(t)),this.debug("matchOne",this,{file:t,pattern:n}),this.debug("matchOne",t.length,n.length);for(var h=0,c=0,d=t.length,s=n.length;h>> no match, partial?`,t,p,n,b),p!==d))}let w;if(typeof u=="string"?(w=f===u,this.debug("string match",u,f,w)):(w=u.test(f),this.debug("pattern match",u,f,w)),!w)return!1}if(h===d&&c===s)return!0;if(h===d)return o;if(c===s)return h===d-1&&t[h]==="";throw new Error("wtf?")}braceExpand(){return Lr(this.pattern,this.options)}parse(t){me(t);const n=this.options;if(t==="**")return It;if(t==="")return"";let o,i=null;(o=t.match(ni))?i=n.dot?oi:ri:(o=t.match(Wo))?i=(n.nocase?n.dot?Zo:Ho:n.dot?Yo:zo)(o[1]):(o=t.match(ii))?i=(n.nocase?n.dot?ai:si:n.dot?ui:li)(o):(o=t.match(Qo))?i=n.dot?Ko:Jo:(o=t.match(ti))&&(i=ei);const a=Et.fromGlob(t,this.options).toMMPattern();return i&&typeof a=="object"&&Reflect.defineProperty(a,"test",{value:i}),a}makeRe(){if(this.regexp||this.regexp===!1)return this.regexp;const t=this.set;if(!t.length)return this.regexp=!1,this.regexp;const n=this.options,o=n.noglobstar?"[^/]*?":n.dot?"(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?":"(?:(?!(?:\\/|^)\\.).)*?",i=new Set(n.nocase?["i"]:[]);let a=t.map((d=>{const s=d.map((u=>{if(u instanceof RegExp)for(const f of u.flags.split(""))i.add(f);return typeof u=="string"?u.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"):u===It?It:u._src}));return s.forEach(((u,f)=>{const p=s[f+1],b=s[f-1];u===It&&b!==It&&(b===void 0?p!==void 0&&p!==It?s[f+1]="(?:\\/|"+o+"\\/)?"+p:s[f]=o:p===void 0?s[f-1]=b+"(?:\\/|"+o+")?":p!==It&&(s[f-1]=b+"(?:\\/|\\/"+o+"\\/)"+p,s[f+1]=It))})),s.filter((u=>u!==It)).join("/")})).join("|");const[h,c]=t.length>1?["(?:",")"]:["",""];a="^"+h+a+c+"$",this.negate&&(a="^(?!"+a+").+$");try{this.regexp=new RegExp(a,[...i].join(""))}catch{this.regexp=!1}return this.regexp}slashSplit(t){return this.preserveMultipleSlashes?t.split("/"):this.isWindows&&/^\/\/[^\/]+/.test(t)?["",...t.split(/\/+/)]:t.split(/\/+/)}match(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.partial;if(this.debug("match",t,this.pattern),this.comment)return!1;if(this.empty)return t==="";if(t==="/"&&n)return!0;const o=this.options;this.isWindows&&(t=t.split("\\").join("/"));const i=this.slashSplit(t);this.debug(this.pattern,"split",i);const a=this.set;this.debug(this.pattern,"set",a);let h=i[i.length-1];if(!h)for(let c=i.length-2;!h&&c>=0;c--)h=i[c];for(let c=0;c1&&arguments[1]!==void 0?arguments[1]:""}Invalid response: ${e.status} ${e.statusText}`);return t.status=e.status,t.response=e,t}function ct(e,t){const{status:n}=t;if(n===401&&e.digest)return t;if(n>=400)throw fn(t);return t}function Ut(e,t){return arguments.length>2&&arguments[2]!==void 0&&arguments[2]?{data:t,headers:e.headers?Do(e.headers):{},status:e.status,statusText:e.statusText}:t}mt.AST=Et,mt.Minimatch=Ee,mt.escape=function(e){let{windowsPathsNoEscape:t=!1}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return t?e.replace(/[?*()[\]]/g,"[$&]"):e.replace(/[?*()[\]\\]/g,"\\$&")},mt.unescape=Zt;const ci=(zn=function(e,t,n){let o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};const i=lt({url:et(e.remoteURL,tt(t)),method:"COPY",headers:{Destination:et(e.remoteURL,tt(n)),Overwrite:o.overwrite===!1?"F":"T",Depth:o.shallow?"0":"infinity"}},e,o);return h=function(c){ct(e,c)},(a=ut(i,e))&&a.then||(a=Promise.resolve(a)),h?a.then(h):a;var a,h},function(){for(var e=[],t=0;t2&&arguments[2]!==void 0?arguments[2]:Gt.Original;const o=xt().get(e,t);return n==="array"&&Array.isArray(o)===!1?[o]:n==="object"&&Array.isArray(o)?o[0]:o}function ee(e){return new Promise((t=>{t((function(n){const{multistatus:o}=n;if(o==="")return{multistatus:{response:[]}};if(!o)throw new Error("Invalid response: No root multistatus found");const i={multistatus:Array.isArray(o)?o[0]:o};return xt().set(i,"multistatus.response",ue(i,"multistatus.response",Gt.Array)),xt().set(i,"multistatus.response",xt().get(i,"multistatus.response").map((a=>(function(h){const c=Object.assign({},h);return c.status?xt().set(c,"status",ue(c,"status",Gt.Object)):(xt().set(c,"propstat",ue(c,"propstat",Gt.Object)),xt().set(c,"propstat.prop",ue(c,"propstat.prop",Gt.Object))),c})(a)))),i})(new pn.XMLParser({allowBooleanAttributes:!0,attributeNamePrefix:"",textNodeName:"text",ignoreAttributes:!1,removeNSPrefix:!0,numberParseOptions:{hex:!0,leadingZeros:!1},attributeValueProcessor:(n,o,i)=>o==="true"||o==="false"?o==="true":o,tagValueProcessor(n,o,i){if(!i.endsWith("propstat.prop.displayname"))return o}}).parse(e)))}))}function we(e,t){let n=arguments.length>2&&arguments[2]!==void 0&&arguments[2];const{getlastmodified:o=null,getcontentlength:i="0",resourcetype:a=null,getcontenttype:h=null,getetag:c=null}=e,d=a&&typeof a=="object"&&a.collection!==void 0?"directory":"file",s={filename:t,basename:fe().basename(t),lastmod:o,size:parseInt(i,10),type:d,etag:typeof c=="string"?c.replace(/"/g,""):null};return d==="file"&&(s.mime=h&&typeof h=="string"?h.split(";")[0]:""),n&&(e.displayname!==void 0&&(e.displayname=String(e.displayname)),s.props=e),s}function Cr(e,t){let n=arguments.length>2&&arguments[2]!==void 0&&arguments[2],o=null;try{e.multistatus.response[0].propstat&&(o=e.multistatus.response[0])}catch{}if(!o)throw new Error("Failed getting item stat: bad response");const{propstat:{prop:i,status:a}}=o,[h,c,d]=a.split(" ",3),s=parseInt(c,10);if(s>=400){const u=new Error(`Invalid response: ${s} ${d}`);throw u.status=s,u}return we(i,te(t),n)}function $r(e){switch(String(e)){case"-3":return"unlimited";case"-2":case"-1":return"unknown";default:return parseInt(String(e),10)}}function Ue(e,t,n){return n?t?t(e):e:(e&&e.then||(e=Promise.resolve(e)),t?e.then(t):e)}const gn=(function(e){return function(){for(var t=[],n=0;n2&&arguments[2]!==void 0?arguments[2]:{};const{details:o=!1}=n,i=lt({url:et(e.remoteURL,tt(t)),method:"PROPFIND",headers:{Accept:"text/plain,application/xml",Depth:"0"}},e,n);return Ue(ut(i,e),(function(a){return ct(e,a),Ue(a.text(),(function(h){return Ue(ee(h),(function(c){const d=Cr(c,t,o);return Ut(a,d,o)}))}))}))}));function Dr(e,t,n){return n?t?t(e):e:(e&&e.then||(e=Promise.resolve(e)),t?e.then(t):e)}const fi=Br((function(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const o=(function(a){if(!a||a==="/")return[];let h=a;const c=[];do c.push(h),h=fe().dirname(h);while(h&&h!=="/");return c})(te(t));o.sort(((a,h)=>a.length>h.length?1:h.length>a.length?-1:0));let i=!1;return(function(a,h,c){if(typeof a[Hn]=="function"){let w=function(T){try{for(;!(d=f.next()).done;)if((T=h(d.value))&&T.then){if(!Zn(T))return void T.then(w,u||(u=bt.bind(null,s=new Ft,2)));T=T.v}s?bt(s,1,T):s=T}catch(I){bt(s||(s=new Ft),2,I)}};var d,s,u,f=a[Hn]();if(w(),f.return){var p=function(T){try{d.done||f.return()}catch{}return T};if(s&&s.then)return s.then(p,(function(T){throw p(T)}));p()}return s}if(!("length"in a))throw new TypeError("Object is not iterable");for(var b=[],E=0;E2&&arguments[2]!==void 0?arguments[2]:{};if(n.recursive===!0)return fi(e,t,n);const o=lt({url:et(e.remoteURL,(i=tt(t),i.endsWith("/")?i:i+"/")),method:"MKCOL"},e,n);var i;return Dr(ut(o,e),(function(a){ct(e,a)}))}));var gi=Y(388),Qn=Y.n(gi);const di=(function(e){return function(){for(var t=[],n=0;n2&&arguments[2]!==void 0?arguments[2]:{};const o={};if(typeof n.range=="object"&&typeof n.range.start=="number"){let c=`bytes=${n.range.start}-`;typeof n.range.end=="number"&&(c=`${c}${n.range.end}`),o.Range=c}const i=lt({url:et(e.remoteURL,tt(t)),method:"GET",headers:o},e,n);return h=function(c){if(ct(e,c),o.Range&&c.status!==206){const d=new Error(`Invalid response code for partial request: ${c.status}`);throw d.status=c.status,d}return n.callback&&setTimeout((()=>{n.callback(c)}),0),c.body},(a=ut(i,e))&&a.then||(a=Promise.resolve(a)),h?a.then(h):a;var a,h})),mi=()=>{},Ei=(function(e){return function(){for(var t=[],n=0;n2&&arguments[2]!==void 0?arguments[2]:{};const o=lt({url:et(e.remoteURL,tt(t)),method:"DELETE"},e,n);return a=function(h){ct(e,h)},(i=ut(o,e))&&i.then||(i=Promise.resolve(i)),a?i.then(a):i;var i,a})),bi=(function(e){return function(){for(var t=[],n=0;n2&&arguments[2]!==void 0?arguments[2]:{};return(function(o,i){try{var a=(h=gn(e,t,n),c=function(){return!0},d?c?c(h):h:(h&&h.then||(h=Promise.resolve(h)),c?h.then(c):h))}catch(s){return i(s)}var h,c,d;return a&&a.then?a.then(void 0,i):a})(0,(function(o){if(o.status===404)return!1;throw o}))}));function je(e,t,n){return n?t?t(e):e:(e&&e.then||(e=Promise.resolve(e)),t?e.then(t):e)}const vi=(function(e){return function(){for(var t=[],n=0;n2&&arguments[2]!==void 0?arguments[2]:{};const o=lt({url:et(e.remoteURL,tt(t),"/"),method:"PROPFIND",headers:{Accept:"text/plain,application/xml",Depth:n.deep?"infinity":"1"}},e,n);return je(ut(o,e),(function(i){return ct(e,i),je(i.text(),(function(a){if(!a)throw new Error("Failed parsing directory contents: Empty response");return je(ee(a),(function(h){const c=Bn(t);let d=(function(s,u,f){let p=arguments.length>3&&arguments[3]!==void 0&&arguments[3],b=arguments.length>4&&arguments[4]!==void 0&&arguments[4];const E=fe().join(u,"/"),{multistatus:{response:w}}=s,T=w.map((I=>{const g=(function(N){try{return N.replace(/^https?:\/\/[^\/]+/,"")}catch(P){throw new vt(P,"Failed normalising HREF")}})(I.href),{propstat:{prop:v}}=I;return we(v,E==="/"?decodeURIComponent(te(g)):te(fe().relative(decodeURIComponent(E),decodeURIComponent(g))),p)}));return b?T:T.filter((I=>I.basename&&(I.type==="file"||I.filename!==f.replace(/\/$/,""))))})(h,Bn(e.remoteBasePath||e.remotePath),c,n.details,n.includeSelf);return n.glob&&(d=(function(s,u){return s.filter((f=>mt(f.filename,u,{matchBase:!0})))})(d,n.glob)),Ut(i,d,n.details)}))}))}))}));function dn(e){return function(){for(var t=[],n=0;n2&&arguments[2]!==void 0?arguments[2]:{};const o=lt({url:et(e.remoteURL,tt(t)),method:"GET",headers:{Accept:"text/plain"},transformResponse:[Oi]},e,n);return ye(ut(o,e),(function(i){return ct(e,i),ye(i.text(),(function(a){return Ut(i,a,n.details)}))}))}));function ye(e,t,n){return n?t?t(e):e:(e&&e.then||(e=Promise.resolve(e)),t?e.then(t):e)}const Ai=dn((function(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const o=lt({url:et(e.remoteURL,tt(t)),method:"GET"},e,n);return ye(ut(o,e),(function(i){let a;return ct(e,i),(function(h,c){var d=h();return d&&d.then?d.then(c):c()})((function(){return ye(i.arrayBuffer(),(function(h){a=h}))}),(function(){return Ut(i,a,n.details)}))}))})),Ti=dn((function(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const{format:o="binary"}=n;if(o!=="binary"&&o!=="text")throw new vt({info:{code:Pt.InvalidOutputFormat}},`Invalid output format: ${o}`);return o==="text"?wi(e,t,n):Ai(e,t,n)})),Oi=e=>e;function Ii(e){return new pn.XMLBuilder({attributeNamePrefix:"@_",format:!0,ignoreAttributes:!1,suppressEmptyNode:!0}).build(Ur({lockinfo:{"@_xmlns:d":"DAV:",lockscope:{exclusive:{}},locktype:{write:{}},owner:{href:e}}},"d"))}function Ur(e,t){const n={...e};for(const o in n)n.hasOwnProperty(o)&&(n[o]&&typeof n[o]=="object"&&o.indexOf(":")===-1?(n[`${t}:${o}`]=Ur(n[o],t),delete n[o]):/^@_/.test(o)===!1&&(n[`${t}:${o}`]=n[o],delete n[o]));return n}function on(e,t,n){return n?t?t(e):e:(e&&e.then||(e=Promise.resolve(e)),t?e.then(t):e)}function jr(e){return function(){for(var t=[],n=0;n3&&arguments[3]!==void 0?arguments[3]:{};const i=lt({url:et(e.remoteURL,tt(t)),method:"UNLOCK",headers:{"Lock-Token":n}},e,o);return on(ut(i,e),(function(a){if(ct(e,a),a.status!==204&&a.status!==200)throw fn(a)}))})),_i=jr((function(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const{refreshToken:o,timeout:i=Ri}=n,a={Accept:"text/plain,application/xml",Timeout:i};o&&(a.If=o);const h=lt({url:et(e.remoteURL,tt(t)),method:"LOCK",headers:a,data:Ii(e.contactHref)},e,n);return on(ut(h,e),(function(c){return ct(e,c),on(c.text(),(function(d){const s=(p=d,new pn.XMLParser({removeNSPrefix:!0,parseAttributeValue:!0,parseTagValue:!0}).parse(p)),u=xt().get(s,"prop.lockdiscovery.activelock.locktoken.href"),f=xt().get(s,"prop.lockdiscovery.activelock.timeout");var p;if(!u)throw fn(c,"No lock token received: ");return{token:u,serverTimeout:f}}))}))})),Ri="Infinite, Second-4100000000";function Me(e,t,n){return n?t?t(e):e:(e&&e.then||(e=Promise.resolve(e)),t?e.then(t):e)}const Si=(function(e){return function(){for(var t=[],n=0;n1&&arguments[1]!==void 0?arguments[1]:{};const n=t.path||"/",o=lt({url:et(e.remoteURL,n),method:"PROPFIND",headers:{Accept:"text/plain,application/xml",Depth:"0"}},e,t);return Me(ut(o,e),(function(i){return ct(e,i),Me(i.text(),(function(a){return Me(ee(a),(function(h){const c=(function(d){try{const[s]=d.multistatus.response,{propstat:{prop:{"quota-used-bytes":u,"quota-available-bytes":f}}}=s;return u!==void 0&&f!==void 0?{used:parseInt(String(u),10),available:$r(f)}:null}catch{}return null})(h);return Ut(i,c,t.details)}))}))}))}));function ke(e,t,n){return n?t?t(e):e:(e&&e.then||(e=Promise.resolve(e)),t?e.then(t):e)}const xi=(function(e){return function(){for(var t=[],n=0;n2&&arguments[2]!==void 0?arguments[2]:{};const{details:o=!1}=n,i=lt({url:et(e.remoteURL,tt(t)),method:"SEARCH",headers:{Accept:"text/plain,application/xml","Content-Type":e.headers["Content-Type"]||"application/xml; charset=utf-8"}},e,n);return ke(ut(i,e),(function(a){return ct(e,a),ke(a.text(),(function(h){return ke(ee(h),(function(c){const d=(function(s,u,f){const p={truncated:!1,results:[]};return p.truncated=s.multistatus.response.some((b=>(b.status||b.propstat?.status).split(" ",3)?.[1]==="507"&&b.href.replace(/\/$/,"").endsWith(tt(u).replace(/\/$/,"")))),s.multistatus.response.forEach((b=>{if(b.propstat===void 0)return;const E=b.href.split("/").map(decodeURIComponent).join("/");p.results.push(we(b.propstat.prop,E,f))})),p})(c,t,o);return Ut(a,d,o)}))}))}))})),Pi=(function(e){return function(){for(var t=[],n=0;n3&&arguments[3]!==void 0?arguments[3]:{};const i=lt({url:et(e.remoteURL,tt(t)),method:"MOVE",headers:{Destination:et(e.remoteURL,tt(n)),Overwrite:o.overwrite===!1?"F":"T"}},e,o);return h=function(c){ct(e,c)},(a=ut(i,e))&&a.then||(a=Promise.resolve(a)),h?a.then(h):a;var a,h}));var Li=Y(172);const Ci=(function(e){return function(){for(var t=[],n=0;n3&&arguments[3]!==void 0?arguments[3]:{};const{contentLength:i=!0,overwrite:a=!0}=o,h={"Content-Type":"application/octet-stream"};i===!1||(h["Content-Length"]=typeof i=="number"?`${i}`:`${(function(u){if(Nr(u))return u.byteLength;if(_r(u))return u.length;if(typeof u=="string")return(0,Li.d)(u);throw new vt({info:{code:Pt.DataTypeNoLength}},"Cannot calculate data length: Invalid type")})(n)}`),a||(h["If-None-Match"]="*");const c=lt({url:et(e.remoteURL,tt(t)),method:"PUT",headers:h,data:n},e,o);return s=function(u){try{ct(e,u)}catch(f){const p=f;if(p.status!==412||a)throw p;return!1}return!0},(d=ut(c,e))&&d.then||(d=Promise.resolve(d)),s?d.then(s):d;var d,s})),Mr=(function(e){return function(){for(var t=[],n=0;n2&&arguments[2]!==void 0?arguments[2]:{};const o=lt({url:et(e.remoteURL,tt(t)),method:"OPTIONS"},e,n);return a=function(h){try{ct(e,h)}catch(c){throw c}return{compliance:(h.headers.get("DAV")??"").split(",").map((c=>c.trim())),server:h.headers.get("Server")??""}},(i=ut(o,e))&&i.then||(i=Promise.resolve(i)),a?i.then(a):i;var i,a}));function Kt(e,t,n){return n?t?t(e):e:(e&&e.then||(e=Promise.resolve(e)),t?e.then(t):e)}const $i=mn((function(e,t,n,o,i){let a=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{};if(n>o||n<0)throw new vt({info:{code:Pt.InvalidUpdateRange}},`Invalid update range ${n} for partial update`);const h={"Content-Type":"application/octet-stream","Content-Length":""+(o-n+1),"Content-Range":`bytes ${n}-${o}/*`},c=lt({url:et(e.remoteURL,tt(t)),method:"PUT",headers:h,data:i},e,a);return Kt(ut(c,e),(function(d){ct(e,d)}))}));function Jn(e,t){var n=e();return n&&n.then?n.then(t):t(n)}const Di=mn((function(e,t,n,o,i){let a=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{};if(n>o||n<0)throw new vt({info:{code:Pt.InvalidUpdateRange}},`Invalid update range ${n} for partial update`);const h={"Content-Type":"application/x-sabredav-partialupdate","Content-Length":""+(o-n+1),"X-Update-Range":`bytes=${n}-${o}`},c=lt({url:et(e.remoteURL,tt(t)),method:"PATCH",headers:h,data:i},e,a);return Kt(ut(c,e),(function(d){ct(e,d)}))}));function mn(e){return function(){for(var t=[],n=0;n5&&arguments[5]!==void 0?arguments[5]:{};return Kt(Mr(e,t,a),(function(h){let c=!1;return Jn((function(){if(h.compliance.includes("sabredav-partialupdate"))return Kt(Di(e,t,n,o,i,a),(function(d){return c=!0,d}))}),(function(d){let s=!1;return c?d:Jn((function(){if(h.server.includes("Apache")&&h.compliance.includes(""))return Kt($i(e,t,n,o,i,a),(function(u){return s=!0,u}))}),(function(u){if(s)return u;throw new vt({info:{code:Pt.NotSupported}},"Not supported")}))}))}))})),Ui="https://github.com/perry-mitchell/webdav-client/blob/master/LOCK_CONTACT.md";function ji(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const{authType:n=null,remoteBasePath:o,contactHref:i=Ui,ha1:a,headers:h={},httpAgent:c,httpsAgent:d,password:s,token:u,username:f,withCredentials:p}=t;let b=n;b||(b=f||s?yt.Password:yt.None);const E={authType:b,remoteBasePath:o,contactHref:i,ha1:a,headers:Object.assign({},h),httpAgent:c,httpsAgent:d,password:s,remotePath:No(e),remoteURL:e,token:u,username:f,withCredentials:p};return Tr(E,f,s,u,a),{copyFile:(w,T,I)=>ci(E,w,T,I),createDirectory:(w,T)=>rn(E,w,T),createReadStream:(w,T)=>(function(I,g){let v=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const N=new(Qn()).PassThrough;return di(I,g,v).then((P=>{P.pipe(N)})).catch((P=>{N.emit("error",P)})),N})(E,w,T),createWriteStream:(w,T,I)=>(function(g,v){let N=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},P=arguments.length>3&&arguments[3]!==void 0?arguments[3]:mi;const _=new(Qn()).PassThrough,L={};N.overwrite===!1&&(L["If-None-Match"]="*");const S=lt({url:et(g.remoteURL,tt(v)),method:"PUT",headers:L,data:_,maxRedirects:0},g,N);return ut(S,g).then((O=>ct(g,O))).then((O=>{setTimeout((()=>{P(O)}),0)})).catch((O=>{_.emit("error",O)})),_})(E,w,T,I),customRequest:(w,T)=>Ei(E,w,T),deleteFile:(w,T)=>yi(E,w,T),exists:(w,T)=>bi(E,w,T),getDirectoryContents:(w,T)=>vi(E,w,T),getFileContents:(w,T)=>Ti(E,w,T),getFileDownloadLink:w=>(function(T,I){let g=et(T.remoteURL,tt(I));const v=/^https:/i.test(g)?"https":"http";switch(T.authType){case yt.None:break;case yt.Password:{const N=jn(T.headers.Authorization.replace(/^Basic /i,"").trim());g=g.replace(/^https?:\/\//,`${v}://${N}@`);break}default:throw new vt({info:{code:Pt.LinkUnsupportedAuthType}},`Unsupported auth type for file link: ${T.authType}`)}return g})(E,w),getFileUploadLink:w=>(function(T,I){let g=`${et(T.remoteURL,tt(I))}?Content-Type=application/octet-stream`;const v=/^https:/i.test(g)?"https":"http";switch(T.authType){case yt.None:break;case yt.Password:{const N=jn(T.headers.Authorization.replace(/^Basic /i,"").trim());g=g.replace(/^https?:\/\//,`${v}://${N}@`);break}default:throw new vt({info:{code:Pt.LinkUnsupportedAuthType}},`Unsupported auth type for file link: ${T.authType}`)}return g})(E,w),getHeaders:()=>Object.assign({},E.headers),getQuota:w=>Si(E,w),lock:(w,T)=>_i(E,w,T),moveFile:(w,T,I)=>Pi(E,w,T,I),putFileContents:(w,T,I)=>Ci(E,w,T,I),partialUpdateFileContents:(w,T,I,g,v)=>Bi(E,w,T,I,g,v),getDAVCompliance:w=>Mr(E,w),search:(w,T)=>xi(E,w,T),setHeaders:w=>{E.headers=Object.assign({},w)},stat:(w,T)=>gn(E,w,T),unlock:(w,T,I)=>Ni(E,w,T,I)}}Ot.hT,Ot.O4,Ot.Kd,Ot.YK,Ot.UU,Ot.Gu,Ot.ky,Ot.h4,Ot.ch,Ot.hq,Ot.i5;var Ge,Kn;function Mi(){if(Kn)return Ge;Kn=1;function e(i){if(typeof i!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(i))}function t(i,a){for(var h="",c=0,d=-1,s=0,u,f=0;f<=i.length;++f){if(f2){var p=h.lastIndexOf("/");if(p!==h.length-1){p===-1?(h="",c=0):(h=h.slice(0,p),c=h.length-1-h.lastIndexOf("/")),d=f,s=0;continue}}else if(h.length===2||h.length===1){h="",c=0,d=f,s=0;continue}}a&&(h.length>0?h+="/..":h="..",c=2)}else h.length>0?h+="/"+i.slice(d+1,f):h=i.slice(d+1,f),c=f-d-1;d=f,s=0}else u===46&&s!==-1?++s:s=-1}return h}function n(i,a){var h=a.dir||a.root,c=a.base||(a.name||"")+(a.ext||"");return h?h===a.root?h+c:h+i+c:c}var o={resolve:function(){for(var i="",a=!1,h,c=arguments.length-1;c>=-1&&!a;c--){var d;c>=0?d=arguments[c]:(h===void 0&&(h=Vt.cwd()),d=h),e(d),d.length!==0&&(i=d+"/"+i,a=d.charCodeAt(0)===47)}return i=t(i,!a),a?i.length>0?"/"+i:"/":i.length>0?i:"."},normalize:function(i){if(e(i),i.length===0)return".";var a=i.charCodeAt(0)===47,h=i.charCodeAt(i.length-1)===47;return i=t(i,!a),i.length===0&&!a&&(i="."),i.length>0&&h&&(i+="/"),a?"/"+i:i},isAbsolute:function(i){return e(i),i.length>0&&i.charCodeAt(0)===47},join:function(){if(arguments.length===0)return".";for(var i,a=0;a0&&(i===void 0?i=h:i+="/"+h)}return i===void 0?".":o.normalize(i)},relative:function(i,a){if(e(i),e(a),i===a||(i=o.resolve(i),a=o.resolve(a),i===a))return"";for(var h=1;hp){if(a.charCodeAt(s+E)===47)return a.slice(s+E+1);if(E===0)return a.slice(s+E)}else d>p&&(i.charCodeAt(h+E)===47?b=E:E===0&&(b=0));break}var w=i.charCodeAt(h+E),T=a.charCodeAt(s+E);if(w!==T)break;w===47&&(b=E)}var I="";for(E=h+b+1;E<=c;++E)(E===c||i.charCodeAt(E)===47)&&(I.length===0?I+="..":I+="/..");return I.length>0?I+a.slice(s+b):(s+=b,a.charCodeAt(s)===47&&++s,a.slice(s))},_makeLong:function(i){return i},dirname:function(i){if(e(i),i.length===0)return".";for(var a=i.charCodeAt(0),h=a===47,c=-1,d=!0,s=i.length-1;s>=1;--s)if(a=i.charCodeAt(s),a===47){if(!d){c=s;break}}else d=!1;return c===-1?h?"/":".":h&&c===1?"//":i.slice(0,c)},basename:function(i,a){if(a!==void 0&&typeof a!="string")throw new TypeError('"ext" argument must be a string');e(i);var h=0,c=-1,d=!0,s;if(a!==void 0&&a.length>0&&a.length<=i.length){if(a.length===i.length&&a===i)return"";var u=a.length-1,f=-1;for(s=i.length-1;s>=0;--s){var p=i.charCodeAt(s);if(p===47){if(!d){h=s+1;break}}else f===-1&&(d=!1,f=s+1),u>=0&&(p===a.charCodeAt(u)?--u===-1&&(c=s):(u=-1,c=f))}return h===c?c=f:c===-1&&(c=i.length),i.slice(h,c)}else{for(s=i.length-1;s>=0;--s)if(i.charCodeAt(s)===47){if(!d){h=s+1;break}}else c===-1&&(d=!1,c=s+1);return c===-1?"":i.slice(h,c)}},extname:function(i){e(i);for(var a=-1,h=0,c=-1,d=!0,s=0,u=i.length-1;u>=0;--u){var f=i.charCodeAt(u);if(f===47){if(!d){h=u+1;break}continue}c===-1&&(d=!1,c=u+1),f===46?a===-1?a=u:s!==1&&(s=1):a!==-1&&(s=-1)}return a===-1||c===-1||s===0||s===1&&a===c-1&&a===h+1?"":i.slice(a,c)},format:function(i){if(i===null||typeof i!="object")throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof i);return n("/",i)},parse:function(i){e(i);var a={root:"",dir:"",base:"",ext:"",name:""};if(i.length===0)return a;var h=i.charCodeAt(0),c=h===47,d;c?(a.root="/",d=1):d=0;for(var s=-1,u=0,f=-1,p=!0,b=i.length-1,E=0;b>=d;--b){if(h=i.charCodeAt(b),h===47){if(!p){u=b+1;break}continue}f===-1&&(p=!1,f=b+1),h===46?s===-1?s=b:E!==1&&(E=1):s!==-1&&(E=-1)}return s===-1||f===-1||E===0||E===1&&s===f-1&&s===u+1?f!==-1&&(u===0&&c?a.base=a.name=i.slice(1,f):a.base=a.name=i.slice(u,f)):(u===0&&c?(a.name=i.slice(1,s),a.base=i.slice(1,f)):(a.name=i.slice(u,s),a.base=i.slice(u,f)),a.ext=i.slice(s,f)),u>0?a.dir=i.slice(0,u-1):c&&(a.dir="/"),a},sep:"/",delimiter:":",win32:null,posix:null};return o.posix=o,Ge=o,Ge}Mi(),Jr().setApp("@nextcloud/files").detectUser().build();var kr=(e=>(e.Folder="folder",e.File="file",e))(kr||{});function ki(){return br()?`/files/${Eo()}`:`/files/${Kr()?.uid}`}ki();function Gi(){const e=ro("dav");return br()?e.replace("remote.php","public.php"):e}Gi();var Fe={},Ve={exports:{}},tr={},er;function Fi(){return er||(er=1,(function(e){Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});var t={},n={};n.byteLength=u,n.toByteArray=p,n.fromByteArray=w;for(var o=[],i=[],a=typeof Uint8Array<"u"?Uint8Array:Array,h="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",c=0,d=h.length;c0)throw new Error("Invalid string. Length must be a multiple of 4");var N=g.indexOf("=");N===-1&&(N=v);var P=N===v?0:4-N%4;return[N,P]}function u(g){var v=s(g),N=v[0],P=v[1];return(N+P)*3/4-P}function f(g,v,N){return(v+N)*3/4-N}function p(g){var v,N=s(g),P=N[0],_=N[1],L=new a(f(g,P,_)),S=0,O=_>0?P-4:P,U;for(U=0;U>16&255,L[S++]=v>>8&255,L[S++]=v&255;return _===2&&(v=i[g.charCodeAt(U)]<<2|i[g.charCodeAt(U+1)]>>4,L[S++]=v&255),_===1&&(v=i[g.charCodeAt(U)]<<10|i[g.charCodeAt(U+1)]<<4|i[g.charCodeAt(U+2)]>>2,L[S++]=v>>8&255,L[S++]=v&255),L}function b(g){return o[g>>18&63]+o[g>>12&63]+o[g>>6&63]+o[g&63]}function E(g,v,N){for(var P,_=[],L=v;LO?O:S+L));return P===1?(v=g[N-1],_.push(o[v>>2]+o[v<<4&63]+"==")):P===2&&(v=(g[N-2]<<8)+g[N-1],_.push(o[v>>10]+o[v>>4&63]+o[v<<2&63]+"=")),_.join("")}var T={};T.read=function(g,v,N,P,_){var L,S,O=_*8-P-1,U=(1<>1,R=-7,D=N?_-1:0,F=N?-1:1,G=g[v+D];for(D+=F,L=G&(1<<-R)-1,G>>=-R,R+=O;R>0;L=L*256+g[v+D],D+=F,R-=8);for(S=L&(1<<-R)-1,L>>=-R,R+=P;R>0;S=S*256+g[v+D],D+=F,R-=8);if(L===0)L=1-M;else{if(L===U)return S?NaN:(G?-1:1)*(1/0);S=S+Math.pow(2,P),L=L-M}return(G?-1:1)*S*Math.pow(2,L-P)},T.write=function(g,v,N,P,_,L){var S,O,U,M=L*8-_-1,R=(1<>1,F=_===23?Math.pow(2,-24)-Math.pow(2,-77):0,G=P?0:L-1,X=P?1:-1,V=v<0||v===0&&1/v<0?1:0;for(v=Math.abs(v),isNaN(v)||v===1/0?(O=isNaN(v)?1:0,S=R):(S=Math.floor(Math.log(v)/Math.LN2),v*(U=Math.pow(2,-S))<1&&(S--,U*=2),S+D>=1?v+=F/U:v+=F*Math.pow(2,1-D),v*U>=2&&(S++,U/=2),S+D>=R?(O=0,S=R):S+D>=1?(O=(v*U-1)*Math.pow(2,_),S=S+D):(O=v*Math.pow(2,D-1)*Math.pow(2,_),S=0));_>=8;g[N+G]=O&255,G+=X,O/=256,_-=8);for(S=S<<_|O,M+=_;M>0;g[N+G]=S&255,G+=X,S/=256,M-=8);g[N+G-X]|=V*128},(function(g){const v=n,N=T,P=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;g.Buffer=R,g.SlowBuffer=jt,g.INSPECT_MAX_BYTES=50;const _=2147483647;g.kMaxLength=_;const{Uint8Array:L,ArrayBuffer:S,SharedArrayBuffer:O}=globalThis;R.TYPED_ARRAY_SUPPORT=U(),!R.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function U(){try{const r=new L(1),l={foo:function(){return 42}};return Object.setPrototypeOf(l,L.prototype),Object.setPrototypeOf(r,l),r.foo()===42}catch{return!1}}Object.defineProperty(R.prototype,"parent",{enumerable:!0,get:function(){if(R.isBuffer(this))return this.buffer}}),Object.defineProperty(R.prototype,"offset",{enumerable:!0,get:function(){if(R.isBuffer(this))return this.byteOffset}});function M(r){if(r>_)throw new RangeError('The value "'+r+'" is invalid for option "size"');const l=new L(r);return Object.setPrototypeOf(l,R.prototype),l}function R(r,l,m){if(typeof r=="number"){if(typeof l=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return X(r)}return D(r,l,m)}R.poolSize=8192;function D(r,l,m){if(typeof r=="string")return V(r,l);if(S.isView(r))return z(r);if(r==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof r);if(Rt(r,S)||r&&Rt(r.buffer,S)||typeof O<"u"&&(Rt(r,O)||r&&Rt(r.buffer,O)))return st(r,l,m);if(typeof r=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const x=r.valueOf&&r.valueOf();if(x!=null&&x!==r)return R.from(x,l,m);const $=W(r);if($)return $;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof r[Symbol.toPrimitive]=="function")return R.from(r[Symbol.toPrimitive]("string"),l,m);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof r)}R.from=function(r,l,m){return D(r,l,m)},Object.setPrototypeOf(R.prototype,L.prototype),Object.setPrototypeOf(R,L);function F(r){if(typeof r!="number")throw new TypeError('"size" argument must be of type number');if(r<0)throw new RangeError('The value "'+r+'" is invalid for option "size"')}function G(r,l,m){return F(r),r<=0?M(r):l!==void 0?typeof m=="string"?M(r).fill(l,m):M(r).fill(l):M(r)}R.alloc=function(r,l,m){return G(r,l,m)};function X(r){return F(r),M(r<0?0:Q(r)|0)}R.allocUnsafe=function(r){return X(r)},R.allocUnsafeSlow=function(r){return X(r)};function V(r,l){if((typeof l!="string"||l==="")&&(l="utf8"),!R.isEncoding(l))throw new TypeError("Unknown encoding: "+l);const m=Lt(r,l)|0;let x=M(m);const $=x.write(r,l);return $!==m&&(x=x.slice(0,$)),x}function Z(r){const l=r.length<0?0:Q(r.length)|0,m=M(l);for(let x=0;x=_)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+_.toString(16)+" bytes");return r|0}function jt(r){return+r!=r&&(r=0),R.alloc(+r)}R.isBuffer=function(r){return r!=null&&r._isBuffer===!0&&r!==R.prototype},R.compare=function(r,l){if(Rt(r,L)&&(r=R.from(r,r.offset,r.byteLength)),Rt(l,L)&&(l=R.from(l,l.offset,l.byteLength)),!R.isBuffer(r)||!R.isBuffer(l))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(r===l)return 0;let m=r.length,x=l.length;for(let $=0,B=Math.min(m,x);$x.length?(R.isBuffer(B)||(B=R.from(B)),B.copy(x,$)):L.prototype.set.call(x,B,$);else if(R.isBuffer(B))B.copy(x,$);else throw new TypeError('"list" argument must be an Array of Buffers');$+=B.length}return x};function Lt(r,l){if(R.isBuffer(r))return r.length;if(S.isView(r)||Rt(r,S))return r.byteLength;if(typeof r!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof r);const m=r.length,x=arguments.length>2&&arguments[2]===!0;if(!x&&m===0)return 0;let $=!1;for(;;)switch(l){case"ascii":case"latin1":case"binary":return m;case"utf8":case"utf-8":return Oe(r).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return m*2;case"hex":return m>>>1;case"base64":return On(r).length;default:if($)return x?-1:Oe(r).length;l=(""+l).toLowerCase(),$=!0}}R.byteLength=Lt;function At(r,l,m){let x=!1;if((l===void 0||l<0)&&(l=0),l>this.length||((m===void 0||m>this.length)&&(m=this.length),m<=0)||(m>>>=0,l>>>=0,m<=l))return"";for(r||(r="utf8");;)switch(r){case"hex":return ne(this,l,m);case"utf8":case"utf-8":return ht(this,l,m);case"ascii":return _t(this,l,m);case"latin1":case"binary":return Ae(this,l,m);case"base64":return gt(this,l,m);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Xt(this,l,m);default:if(x)throw new TypeError("Unknown encoding: "+r);r=(r+"").toLowerCase(),x=!0}}R.prototype._isBuffer=!0;function Nt(r,l,m){const x=r[l];r[l]=r[m],r[m]=x}R.prototype.swap16=function(){const r=this.length;if(r%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let l=0;ll&&(r+=" ... "),""},P&&(R.prototype[P]=R.prototype.inspect),R.prototype.compare=function(r,l,m,x,$){if(Rt(r,L)&&(r=R.from(r,r.offset,r.byteLength)),!R.isBuffer(r))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof r);if(l===void 0&&(l=0),m===void 0&&(m=r?r.length:0),x===void 0&&(x=0),$===void 0&&($=this.length),l<0||m>r.length||x<0||$>this.length)throw new RangeError("out of range index");if(x>=$&&l>=m)return 0;if(x>=$)return-1;if(l>=m)return 1;if(l>>>=0,m>>>=0,x>>>=0,$>>>=0,this===r)return 0;let B=$-x,k=m-l;const J=Math.min(B,k),ft=this.slice(x,$),K=r.slice(l,m);for(let H=0;H2147483647?m=2147483647:m<-2147483648&&(m=-2147483648),m=+m,Ie(m)&&(m=$?0:r.length-1),m<0&&(m=r.length+m),m>=r.length){if($)return-1;m=r.length-1}else if(m<0)if($)m=0;else return-1;if(typeof l=="string"&&(l=R.from(l,x)),R.isBuffer(l))return l.length===0?-1:y(r,l,m,x,$);if(typeof l=="number")return l=l&255,typeof L.prototype.indexOf=="function"?$?L.prototype.indexOf.call(r,l,m):L.prototype.lastIndexOf.call(r,l,m):y(r,[l],m,x,$);throw new TypeError("val must be string, number or Buffer")}function y(r,l,m,x,$){let B=1,k=r.length,J=l.length;if(x!==void 0&&(x=String(x).toLowerCase(),x==="ucs2"||x==="ucs-2"||x==="utf16le"||x==="utf-16le")){if(r.length<2||l.length<2)return-1;B=2,k/=2,J/=2,m/=2}function ft(H,it){return B===1?H[it]:H.readUInt16BE(it*B)}let K;if($){let H=-1;for(K=m;Kk&&(m=k-J),K=m;K>=0;K--){let H=!0;for(let it=0;it$&&(x=$)):x=$;const B=l.length;x>B/2&&(x=B/2);let k;for(k=0;k>>0,isFinite(m)?(m=m>>>0,x===void 0&&(x="utf8")):(x=m,m=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const $=this.length-l;if((m===void 0||m>$)&&(m=$),r.length>0&&(m<0||l<0)||l>this.length)throw new RangeError("Attempt to write outside buffer bounds");x||(x="utf8");let B=!1;for(;;)switch(x){case"hex":return j(this,r,l,m);case"utf8":case"utf-8":return C(this,r,l,m);case"ascii":case"latin1":case"binary":return q(this,r,l,m);case"base64":return nt(this,r,l,m);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return rt(this,r,l,m);default:if(B)throw new TypeError("Unknown encoding: "+x);x=(""+x).toLowerCase(),B=!0}},R.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function gt(r,l,m){return l===0&&m===r.length?v.fromByteArray(r):v.fromByteArray(r.slice(l,m))}function ht(r,l,m){m=Math.min(r.length,m);const x=[];let $=l;for(;$239?4:B>223?3:B>191?2:1;if($+J<=m){let ft,K,H,it;switch(J){case 1:B<128&&(k=B);break;case 2:ft=r[$+1],(ft&192)===128&&(it=(B&31)<<6|ft&63,it>127&&(k=it));break;case 3:ft=r[$+1],K=r[$+2],(ft&192)===128&&(K&192)===128&&(it=(B&15)<<12|(ft&63)<<6|K&63,it>2047&&(it<55296||it>57343)&&(k=it));break;case 4:ft=r[$+1],K=r[$+2],H=r[$+3],(ft&192)===128&&(K&192)===128&&(H&192)===128&&(it=(B&15)<<18|(ft&63)<<12|(K&63)<<6|H&63,it>65535&&it<1114112&&(k=it))}}k===null?(k=65533,J=1):k>65535&&(k-=65536,x.push(k>>>10&1023|55296),k=56320|k&1023),x.push(k),$+=J}return at(x)}const St=4096;function at(r){const l=r.length;if(l<=St)return String.fromCharCode.apply(String,r);let m="",x=0;for(;xx)&&(m=x);let $="";for(let B=l;Bm&&(r=m),l<0?(l+=m,l<0&&(l=0)):l>m&&(l=m),lm)throw new RangeError("Trying to access beyond buffer length")}R.prototype.readUintLE=R.prototype.readUIntLE=function(r,l,m){r=r>>>0,l=l>>>0,m||ot(r,l,this.length);let x=this[r],$=1,B=0;for(;++B>>0,l=l>>>0,m||ot(r,l,this.length);let x=this[r+--l],$=1;for(;l>0&&($*=256);)x+=this[r+--l]*$;return x},R.prototype.readUint8=R.prototype.readUInt8=function(r,l){return r=r>>>0,l||ot(r,1,this.length),this[r]},R.prototype.readUint16LE=R.prototype.readUInt16LE=function(r,l){return r=r>>>0,l||ot(r,2,this.length),this[r]|this[r+1]<<8},R.prototype.readUint16BE=R.prototype.readUInt16BE=function(r,l){return r=r>>>0,l||ot(r,2,this.length),this[r]<<8|this[r+1]},R.prototype.readUint32LE=R.prototype.readUInt32LE=function(r,l){return r=r>>>0,l||ot(r,4,this.length),(this[r]|this[r+1]<<8|this[r+2]<<16)+this[r+3]*16777216},R.prototype.readUint32BE=R.prototype.readUInt32BE=function(r,l){return r=r>>>0,l||ot(r,4,this.length),this[r]*16777216+(this[r+1]<<16|this[r+2]<<8|this[r+3])},R.prototype.readBigUInt64LE=Ct(function(r){r=r>>>0,kt(r,"offset");const l=this[r],m=this[r+7];(l===void 0||m===void 0)&&qt(r,this.length-8);const x=l+this[++r]*2**8+this[++r]*2**16+this[++r]*2**24,$=this[++r]+this[++r]*2**8+this[++r]*2**16+m*2**24;return BigInt(x)+(BigInt($)<>>0,kt(r,"offset");const l=this[r],m=this[r+7];(l===void 0||m===void 0)&&qt(r,this.length-8);const x=l*2**24+this[++r]*2**16+this[++r]*2**8+this[++r],$=this[++r]*2**24+this[++r]*2**16+this[++r]*2**8+m;return(BigInt(x)<>>0,l=l>>>0,m||ot(r,l,this.length);let x=this[r],$=1,B=0;for(;++B=$&&(x-=Math.pow(2,8*l)),x},R.prototype.readIntBE=function(r,l,m){r=r>>>0,l=l>>>0,m||ot(r,l,this.length);let x=l,$=1,B=this[r+--x];for(;x>0&&($*=256);)B+=this[r+--x]*$;return $*=128,B>=$&&(B-=Math.pow(2,8*l)),B},R.prototype.readInt8=function(r,l){return r=r>>>0,l||ot(r,1,this.length),this[r]&128?(255-this[r]+1)*-1:this[r]},R.prototype.readInt16LE=function(r,l){r=r>>>0,l||ot(r,2,this.length);const m=this[r]|this[r+1]<<8;return m&32768?m|4294901760:m},R.prototype.readInt16BE=function(r,l){r=r>>>0,l||ot(r,2,this.length);const m=this[r+1]|this[r]<<8;return m&32768?m|4294901760:m},R.prototype.readInt32LE=function(r,l){return r=r>>>0,l||ot(r,4,this.length),this[r]|this[r+1]<<8|this[r+2]<<16|this[r+3]<<24},R.prototype.readInt32BE=function(r,l){return r=r>>>0,l||ot(r,4,this.length),this[r]<<24|this[r+1]<<16|this[r+2]<<8|this[r+3]},R.prototype.readBigInt64LE=Ct(function(r){r=r>>>0,kt(r,"offset");const l=this[r],m=this[r+7];(l===void 0||m===void 0)&&qt(r,this.length-8);const x=this[r+4]+this[r+5]*2**8+this[r+6]*2**16+(m<<24);return(BigInt(x)<>>0,kt(r,"offset");const l=this[r],m=this[r+7];(l===void 0||m===void 0)&&qt(r,this.length-8);const x=(l<<24)+this[++r]*2**16+this[++r]*2**8+this[++r];return(BigInt(x)<>>0,l||ot(r,4,this.length),N.read(this,r,!0,23,4)},R.prototype.readFloatBE=function(r,l){return r=r>>>0,l||ot(r,4,this.length),N.read(this,r,!1,23,4)},R.prototype.readDoubleLE=function(r,l){return r=r>>>0,l||ot(r,8,this.length),N.read(this,r,!0,52,8)},R.prototype.readDoubleBE=function(r,l){return r=r>>>0,l||ot(r,8,this.length),N.read(this,r,!1,52,8)};function wt(r,l,m,x,$,B){if(!R.isBuffer(r))throw new TypeError('"buffer" argument must be a Buffer instance');if(l>$||lr.length)throw new RangeError("Index out of range")}R.prototype.writeUintLE=R.prototype.writeUIntLE=function(r,l,m,x){if(r=+r,l=l>>>0,m=m>>>0,!x){const k=Math.pow(2,8*m)-1;wt(this,r,l,m,k,0)}let $=1,B=0;for(this[l]=r&255;++B>>0,m=m>>>0,!x){const k=Math.pow(2,8*m)-1;wt(this,r,l,m,k,0)}let $=m-1,B=1;for(this[l+$]=r&255;--$>=0&&(B*=256);)this[l+$]=r/B&255;return l+m},R.prototype.writeUint8=R.prototype.writeUInt8=function(r,l,m){return r=+r,l=l>>>0,m||wt(this,r,l,1,255,0),this[l]=r&255,l+1},R.prototype.writeUint16LE=R.prototype.writeUInt16LE=function(r,l,m){return r=+r,l=l>>>0,m||wt(this,r,l,2,65535,0),this[l]=r&255,this[l+1]=r>>>8,l+2},R.prototype.writeUint16BE=R.prototype.writeUInt16BE=function(r,l,m){return r=+r,l=l>>>0,m||wt(this,r,l,2,65535,0),this[l]=r>>>8,this[l+1]=r&255,l+2},R.prototype.writeUint32LE=R.prototype.writeUInt32LE=function(r,l,m){return r=+r,l=l>>>0,m||wt(this,r,l,4,4294967295,0),this[l+3]=r>>>24,this[l+2]=r>>>16,this[l+1]=r>>>8,this[l]=r&255,l+4},R.prototype.writeUint32BE=R.prototype.writeUInt32BE=function(r,l,m){return r=+r,l=l>>>0,m||wt(this,r,l,4,4294967295,0),this[l]=r>>>24,this[l+1]=r>>>16,this[l+2]=r>>>8,this[l+3]=r&255,l+4};function En(r,l,m,x,$){Tn(l,x,$,r,m,7);let B=Number(l&BigInt(4294967295));r[m++]=B,B=B>>8,r[m++]=B,B=B>>8,r[m++]=B,B=B>>8,r[m++]=B;let k=Number(l>>BigInt(32)&BigInt(4294967295));return r[m++]=k,k=k>>8,r[m++]=k,k=k>>8,r[m++]=k,k=k>>8,r[m++]=k,m}function yn(r,l,m,x,$){Tn(l,x,$,r,m,7);let B=Number(l&BigInt(4294967295));r[m+7]=B,B=B>>8,r[m+6]=B,B=B>>8,r[m+5]=B,B=B>>8,r[m+4]=B;let k=Number(l>>BigInt(32)&BigInt(4294967295));return r[m+3]=k,k=k>>8,r[m+2]=k,k=k>>8,r[m+1]=k,k=k>>8,r[m]=k,m+8}R.prototype.writeBigUInt64LE=Ct(function(r,l=0){return En(this,r,l,BigInt(0),BigInt("0xffffffffffffffff"))}),R.prototype.writeBigUInt64BE=Ct(function(r,l=0){return yn(this,r,l,BigInt(0),BigInt("0xffffffffffffffff"))}),R.prototype.writeIntLE=function(r,l,m,x){if(r=+r,l=l>>>0,!x){const J=Math.pow(2,8*m-1);wt(this,r,l,m,J-1,-J)}let $=0,B=1,k=0;for(this[l]=r&255;++$>0)-k&255;return l+m},R.prototype.writeIntBE=function(r,l,m,x){if(r=+r,l=l>>>0,!x){const J=Math.pow(2,8*m-1);wt(this,r,l,m,J-1,-J)}let $=m-1,B=1,k=0;for(this[l+$]=r&255;--$>=0&&(B*=256);)r<0&&k===0&&this[l+$+1]!==0&&(k=1),this[l+$]=(r/B>>0)-k&255;return l+m},R.prototype.writeInt8=function(r,l,m){return r=+r,l=l>>>0,m||wt(this,r,l,1,127,-128),r<0&&(r=255+r+1),this[l]=r&255,l+1},R.prototype.writeInt16LE=function(r,l,m){return r=+r,l=l>>>0,m||wt(this,r,l,2,32767,-32768),this[l]=r&255,this[l+1]=r>>>8,l+2},R.prototype.writeInt16BE=function(r,l,m){return r=+r,l=l>>>0,m||wt(this,r,l,2,32767,-32768),this[l]=r>>>8,this[l+1]=r&255,l+2},R.prototype.writeInt32LE=function(r,l,m){return r=+r,l=l>>>0,m||wt(this,r,l,4,2147483647,-2147483648),this[l]=r&255,this[l+1]=r>>>8,this[l+2]=r>>>16,this[l+3]=r>>>24,l+4},R.prototype.writeInt32BE=function(r,l,m){return r=+r,l=l>>>0,m||wt(this,r,l,4,2147483647,-2147483648),r<0&&(r=4294967295+r+1),this[l]=r>>>24,this[l+1]=r>>>16,this[l+2]=r>>>8,this[l+3]=r&255,l+4},R.prototype.writeBigInt64LE=Ct(function(r,l=0){return En(this,r,l,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),R.prototype.writeBigInt64BE=Ct(function(r,l=0){return yn(this,r,l,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function bn(r,l,m,x,$,B){if(m+x>r.length)throw new RangeError("Index out of range");if(m<0)throw new RangeError("Index out of range")}function vn(r,l,m,x,$){return l=+l,m=m>>>0,$||bn(r,l,m,4),N.write(r,l,m,x,23,4),m+4}R.prototype.writeFloatLE=function(r,l,m){return vn(this,r,l,!0,m)},R.prototype.writeFloatBE=function(r,l,m){return vn(this,r,l,!1,m)};function wn(r,l,m,x,$){return l=+l,m=m>>>0,$||bn(r,l,m,8),N.write(r,l,m,x,52,8),m+8}R.prototype.writeDoubleLE=function(r,l,m){return wn(this,r,l,!0,m)},R.prototype.writeDoubleBE=function(r,l,m){return wn(this,r,l,!1,m)},R.prototype.copy=function(r,l,m,x){if(!R.isBuffer(r))throw new TypeError("argument should be a Buffer");if(m||(m=0),!x&&x!==0&&(x=this.length),l>=r.length&&(l=r.length),l||(l=0),x>0&&x=this.length)throw new RangeError("Index out of range");if(x<0)throw new RangeError("sourceEnd out of bounds");x>this.length&&(x=this.length),r.length-l>>0,m=m===void 0?this.length:m>>>0,r||(r=0);let $;if(typeof r=="number")for($=l;$2**32?$=An(String(m)):typeof m=="bigint"&&($=String(m),(m>BigInt(2)**BigInt(32)||m<-(BigInt(2)**BigInt(32)))&&($=An($)),$+="n"),x+=` It must be ${l}. Received ${$}`,x},RangeError);function An(r){let l="",m=r.length;const x=r[0]==="-"?1:0;for(;m>=x+4;m-=3)l=`_${r.slice(m-3,m)}${l}`;return`${r.slice(0,m)}${l}`}function qr(r,l,m){kt(l,"offset"),(r[l]===void 0||r[l+m]===void 0)&&qt(l,r.length-(m+1))}function Tn(r,l,m,x,$,B){if(r>m||r= 0${k} and < 2${k} ** ${(B+1)*8}${k}`:J=`>= -(2${k} ** ${(B+1)*8-1}${k}) and < 2 ** ${(B+1)*8-1}${k}`,new Mt.ERR_OUT_OF_RANGE("value",J,r)}qr(x,$,B)}function kt(r,l){if(typeof r!="number")throw new Mt.ERR_INVALID_ARG_TYPE(l,"number",r)}function qt(r,l,m){throw Math.floor(r)!==r?(kt(r,m),new Mt.ERR_OUT_OF_RANGE("offset","an integer",r)):l<0?new Mt.ERR_BUFFER_OUT_OF_BOUNDS:new Mt.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${l}`,r)}const Wr=/[^+/0-9A-Za-z-_]/g;function zr(r){if(r=r.split("=")[0],r=r.trim().replace(Wr,""),r.length<2)return"";for(;r.length%4!==0;)r=r+"=";return r}function Oe(r,l){l=l||1/0;let m;const x=r.length;let $=null;const B=[];for(let k=0;k55295&&m<57344){if(!$){if(m>56319){(l-=3)>-1&&B.push(239,191,189);continue}else if(k+1===x){(l-=3)>-1&&B.push(239,191,189);continue}$=m;continue}if(m<56320){(l-=3)>-1&&B.push(239,191,189),$=m;continue}m=($-55296<<10|m-56320)+65536}else $&&(l-=3)>-1&&B.push(239,191,189);if($=null,m<128){if((l-=1)<0)break;B.push(m)}else if(m<2048){if((l-=2)<0)break;B.push(m>>6|192,m&63|128)}else if(m<65536){if((l-=3)<0)break;B.push(m>>12|224,m>>6&63|128,m&63|128)}else if(m<1114112){if((l-=4)<0)break;B.push(m>>18|240,m>>12&63|128,m>>6&63|128,m&63|128)}else throw new Error("Invalid code point")}return B}function Yr(r){const l=[];for(let m=0;m>8,$=m%256,B.push($),B.push(x);return B}function On(r){return v.toByteArray(zr(r))}function re(r,l,m,x){let $;for($=0;$=l.length||$>=r.length);++$)l[$+m]=r[$];return $}function Rt(r,l){return r instanceof l||r!=null&&r.constructor!=null&&r.constructor.name!=null&&r.constructor.name===l.name}function Ie(r){return r!==r}const Zr=(function(){const r="0123456789abcdef",l=new Array(256);for(let m=0;m<16;++m){const x=m*16;for(let $=0;$<16;++$)l[x+$]=r[m]+r[$]}return l})();function Ct(r){return typeof BigInt>"u"?Qr:r}function Qr(){throw new Error("BigInt not supported")}})(t);const I=t.Buffer;e.Blob=t.Blob,e.BlobOptions=t.BlobOptions,e.Buffer=t.Buffer,e.File=t.File,e.FileOptions=t.FileOptions,e.INSPECT_MAX_BYTES=t.INSPECT_MAX_BYTES,e.SlowBuffer=t.SlowBuffer,e.TranscodeEncoding=t.TranscodeEncoding,e.atob=t.atob,e.btoa=t.btoa,e.constants=t.constants,e.default=I,e.isAscii=t.isAscii,e.isUtf8=t.isUtf8,e.kMaxLength=t.kMaxLength,e.kStringMaxLength=t.kStringMaxLength,e.resolveObjectURL=t.resolveObjectURL,e.transcode=t.transcode})(tr)),tr}var nr;function Vi(){return nr||(nr=1,(function(e,t){var n=Fi(),o=n.Buffer;function i(h,c){for(var d in h)c[d]=h[d]}o.from&&o.alloc&&o.allocUnsafe&&o.allocUnsafeSlow?e.exports=n:(i(n,t),t.Buffer=a);function a(h,c,d){return o(h,c,d)}a.prototype=Object.create(o.prototype),i(o,a),a.from=function(h,c,d){if(typeof h=="number")throw new TypeError("Argument must not be a number");return o(h,c,d)},a.alloc=function(h,c,d){if(typeof h!="number")throw new TypeError("Argument must be a number");var s=o(h);return c!==void 0?typeof d=="string"?s.fill(c,d):s.fill(c):s.fill(0),s},a.allocUnsafe=function(h){if(typeof h!="number")throw new TypeError("Argument must be a number");return o(h)},a.allocUnsafeSlow=function(h){if(typeof h!="number")throw new TypeError("Argument must be a number");return n.SlowBuffer(h)}})(Ve,Ve.exports)),Ve.exports}var rr;function Xi(){if(rr)return Fe;rr=1;var e=Vi().Buffer,t=e.isEncoding||function(I){switch(I=""+I,I&&I.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function n(I){if(!I)return"utf8";for(var g;;)switch(I){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return I;default:if(g)return;I=(""+I).toLowerCase(),g=!0}}function o(I){var g=n(I);if(typeof g!="string"&&(e.isEncoding===t||!t(I)))throw new Error("Unknown encoding: "+I);return g||I}Fe.StringDecoder=i;function i(I){this.encoding=o(I);var g;switch(this.encoding){case"utf16le":this.text=f,this.end=p,g=4;break;case"utf8":this.fillLast=d,g=4;break;case"base64":this.text=b,this.end=E,g=3;break;default:this.write=w,this.end=T;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=e.allocUnsafe(g)}i.prototype.write=function(I){if(I.length===0)return"";var g,v;if(this.lastNeed){if(g=this.fillLast(I),g===void 0)return"";v=this.lastNeed,this.lastNeed=0}else v=0;return v>5===6?2:I>>4===14?3:I>>3===30?4:I>>6===2?-1:-2}function h(I,g,v){var N=g.length-1;if(N=0?(P>0&&(I.lastNeed=P-1),P):--N=0?(P>0&&(I.lastNeed=P-2),P):--N=0?(P>0&&(P===2?P=0:I.lastNeed=P-3),P):0))}function c(I,g,v){if((g[0]&192)!==128)return I.lastNeed=0,"�";if(I.lastNeed>1&&g.length>1){if((g[1]&192)!==128)return I.lastNeed=1,"�";if(I.lastNeed>2&&g.length>2&&(g[2]&192)!==128)return I.lastNeed=2,"�"}}function d(I){var g=this.lastTotal-this.lastNeed,v=c(this,I);if(v!==void 0)return v;if(this.lastNeed<=I.length)return I.copy(this.lastChar,g,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);I.copy(this.lastChar,g,0,I.length),this.lastNeed-=I.length}function s(I,g){var v=h(this,I,g);if(!this.lastNeed)return I.toString("utf8",g);this.lastTotal=v;var N=I.length-(v-this.lastNeed);return I.copy(this.lastChar,0,N),I.toString("utf8",g,N)}function u(I){var g=I&&I.length?this.write(I):"";return this.lastNeed?g+"�":g}function f(I,g){if((I.length-g)%2===0){var v=I.toString("utf16le",g);if(v){var N=v.charCodeAt(v.length-1);if(N>=55296&&N<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=I[I.length-2],this.lastChar[1]=I[I.length-1],v.slice(0,-1)}return v}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=I[I.length-1],I.toString("utf16le",g,I.length-1)}function p(I){var g=I&&I.length?this.write(I):"";if(this.lastNeed){var v=this.lastTotal-this.lastNeed;return g+this.lastChar.toString("utf16le",0,v)}return g}function b(I,g){var v=(I.length-g)%3;return v===0?I.toString("base64",g):(this.lastNeed=3-v,this.lastTotal=3,v===1?this.lastChar[0]=I[I.length-1]:(this.lastChar[0]=I[I.length-2],this.lastChar[1]=I[I.length-1]),I.toString("base64",g,I.length-v))}function E(I){var g=I&&I.length?this.write(I):"";return this.lastNeed?g+this.lastChar.toString("base64",0,3-this.lastNeed):g}function w(I){return I.toString(this.encoding)}function T(I){return I&&I.length?this.write(I):""}return Fe}var qi=Xi();const Wi=to(qi);var Xe={},or,ir;function Gr(){return ir||(ir=1,or=typeof Vt=="object"&&Xe&&Xe.NODE_DEBUG&&/\bsemver\b/i.test(Xe.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{}),or}var qe,sr;function Fr(){if(sr)return qe;sr=1;const e="2.0.0",t=256,n=Number.MAX_SAFE_INTEGER||9007199254740991,o=16,i=t-6;return qe={MAX_LENGTH:t,MAX_SAFE_COMPONENT_LENGTH:o,MAX_SAFE_BUILD_LENGTH:i,MAX_SAFE_INTEGER:n,RELEASE_TYPES:["major","premajor","minor","preminor","patch","prepatch","prerelease"],SEMVER_SPEC_VERSION:e,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2},qe}var We={exports:{}},ar;function zi(){return ar||(ar=1,(function(e,t){const{MAX_SAFE_COMPONENT_LENGTH:n,MAX_SAFE_BUILD_LENGTH:o,MAX_LENGTH:i}=Fr(),a=Gr();t=e.exports={};const h=t.re=[],c=t.safeRe=[],d=t.src=[],s=t.t={};let u=0;const f="[a-zA-Z0-9-]",p=[["\\s",1],["\\d",i],[f,o]],b=w=>{for(const[T,I]of p)w=w.split(`${T}*`).join(`${T}{0,${I}}`).split(`${T}+`).join(`${T}{1,${I}}`);return w},E=(w,T,I)=>{const g=b(T),v=u++;a(w,v,T),s[w]=v,d[v]=T,h[v]=new RegExp(T,I?"g":void 0),c[v]=new RegExp(g,I?"g":void 0)};E("NUMERICIDENTIFIER","0|[1-9]\\d*"),E("NUMERICIDENTIFIERLOOSE","\\d+"),E("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${f}*`),E("MAINVERSION",`(${d[s.NUMERICIDENTIFIER]})\\.(${d[s.NUMERICIDENTIFIER]})\\.(${d[s.NUMERICIDENTIFIER]})`),E("MAINVERSIONLOOSE",`(${d[s.NUMERICIDENTIFIERLOOSE]})\\.(${d[s.NUMERICIDENTIFIERLOOSE]})\\.(${d[s.NUMERICIDENTIFIERLOOSE]})`),E("PRERELEASEIDENTIFIER",`(?:${d[s.NUMERICIDENTIFIER]}|${d[s.NONNUMERICIDENTIFIER]})`),E("PRERELEASEIDENTIFIERLOOSE",`(?:${d[s.NUMERICIDENTIFIERLOOSE]}|${d[s.NONNUMERICIDENTIFIER]})`),E("PRERELEASE",`(?:-(${d[s.PRERELEASEIDENTIFIER]}(?:\\.${d[s.PRERELEASEIDENTIFIER]})*))`),E("PRERELEASELOOSE",`(?:-?(${d[s.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${d[s.PRERELEASEIDENTIFIERLOOSE]})*))`),E("BUILDIDENTIFIER",`${f}+`),E("BUILD",`(?:\\+(${d[s.BUILDIDENTIFIER]}(?:\\.${d[s.BUILDIDENTIFIER]})*))`),E("FULLPLAIN",`v?${d[s.MAINVERSION]}${d[s.PRERELEASE]}?${d[s.BUILD]}?`),E("FULL",`^${d[s.FULLPLAIN]}$`),E("LOOSEPLAIN",`[v=\\s]*${d[s.MAINVERSIONLOOSE]}${d[s.PRERELEASELOOSE]}?${d[s.BUILD]}?`),E("LOOSE",`^${d[s.LOOSEPLAIN]}$`),E("GTLT","((?:<|>)?=?)"),E("XRANGEIDENTIFIERLOOSE",`${d[s.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),E("XRANGEIDENTIFIER",`${d[s.NUMERICIDENTIFIER]}|x|X|\\*`),E("XRANGEPLAIN",`[v=\\s]*(${d[s.XRANGEIDENTIFIER]})(?:\\.(${d[s.XRANGEIDENTIFIER]})(?:\\.(${d[s.XRANGEIDENTIFIER]})(?:${d[s.PRERELEASE]})?${d[s.BUILD]}?)?)?`),E("XRANGEPLAINLOOSE",`[v=\\s]*(${d[s.XRANGEIDENTIFIERLOOSE]})(?:\\.(${d[s.XRANGEIDENTIFIERLOOSE]})(?:\\.(${d[s.XRANGEIDENTIFIERLOOSE]})(?:${d[s.PRERELEASELOOSE]})?${d[s.BUILD]}?)?)?`),E("XRANGE",`^${d[s.GTLT]}\\s*${d[s.XRANGEPLAIN]}$`),E("XRANGELOOSE",`^${d[s.GTLT]}\\s*${d[s.XRANGEPLAINLOOSE]}$`),E("COERCEPLAIN",`(^|[^\\d])(\\d{1,${n}})(?:\\.(\\d{1,${n}}))?(?:\\.(\\d{1,${n}}))?`),E("COERCE",`${d[s.COERCEPLAIN]}(?:$|[^\\d])`),E("COERCEFULL",d[s.COERCEPLAIN]+`(?:${d[s.PRERELEASE]})?(?:${d[s.BUILD]})?(?:$|[^\\d])`),E("COERCERTL",d[s.COERCE],!0),E("COERCERTLFULL",d[s.COERCEFULL],!0),E("LONETILDE","(?:~>?)"),E("TILDETRIM",`(\\s*)${d[s.LONETILDE]}\\s+`,!0),t.tildeTrimReplace="$1~",E("TILDE",`^${d[s.LONETILDE]}${d[s.XRANGEPLAIN]}$`),E("TILDELOOSE",`^${d[s.LONETILDE]}${d[s.XRANGEPLAINLOOSE]}$`),E("LONECARET","(?:\\^)"),E("CARETTRIM",`(\\s*)${d[s.LONECARET]}\\s+`,!0),t.caretTrimReplace="$1^",E("CARET",`^${d[s.LONECARET]}${d[s.XRANGEPLAIN]}$`),E("CARETLOOSE",`^${d[s.LONECARET]}${d[s.XRANGEPLAINLOOSE]}$`),E("COMPARATORLOOSE",`^${d[s.GTLT]}\\s*(${d[s.LOOSEPLAIN]})$|^$`),E("COMPARATOR",`^${d[s.GTLT]}\\s*(${d[s.FULLPLAIN]})$|^$`),E("COMPARATORTRIM",`(\\s*)${d[s.GTLT]}\\s*(${d[s.LOOSEPLAIN]}|${d[s.XRANGEPLAIN]})`,!0),t.comparatorTrimReplace="$1$2$3",E("HYPHENRANGE",`^\\s*(${d[s.XRANGEPLAIN]})\\s+-\\s+(${d[s.XRANGEPLAIN]})\\s*$`),E("HYPHENRANGELOOSE",`^\\s*(${d[s.XRANGEPLAINLOOSE]})\\s+-\\s+(${d[s.XRANGEPLAINLOOSE]})\\s*$`),E("STAR","(<|>)?=?\\s*\\*"),E("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),E("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")})(We,We.exports)),We.exports}var ze,ur;function Yi(){if(ur)return ze;ur=1;const e=Object.freeze({loose:!0}),t=Object.freeze({});return ze=n=>n?typeof n!="object"?e:n:t,ze}var Ye,lr;function Hi(){if(lr)return Ye;lr=1;const e=/^[0-9]+$/,t=(n,o)=>{const i=e.test(n),a=e.test(o);return i&&a&&(n=+n,o=+o),n===o?0:i&&!a?-1:a&&!i?1:nt(o,n)},Ye}var He,cr;function Vr(){if(cr)return He;cr=1;const e=Gr(),{MAX_LENGTH:t,MAX_SAFE_INTEGER:n}=Fr(),{safeRe:o,t:i}=zi(),a=Yi(),{compareIdentifiers:h}=Hi();class c{constructor(s,u){if(u=a(u),s instanceof c){if(s.loose===!!u.loose&&s.includePrerelease===!!u.includePrerelease)return s;s=s.version}else if(typeof s!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof s}".`);if(s.length>t)throw new TypeError(`version is longer than ${t} characters`);e("SemVer",s,u),this.options=u,this.loose=!!u.loose,this.includePrerelease=!!u.includePrerelease;const f=s.trim().match(u.loose?o[i.LOOSE]:o[i.FULL]);if(!f)throw new TypeError(`Invalid Version: ${s}`);if(this.raw=s,this.major=+f[1],this.minor=+f[2],this.patch=+f[3],this.major>n||this.major<0)throw new TypeError("Invalid major version");if(this.minor>n||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>n||this.patch<0)throw new TypeError("Invalid patch version");f[4]?this.prerelease=f[4].split(".").map(p=>{if(/^[0-9]+$/.test(p)){const b=+p;if(b>=0&&b=0;)typeof this.prerelease[b]=="number"&&(this.prerelease[b]++,b=-2);if(b===-1){if(u===this.prerelease.join(".")&&f===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(p)}}if(u){let b=[u,p];f===!1&&(b=[u]),h(this.prerelease[0],u)===0?isNaN(this.prerelease[1])&&(this.prerelease=b):this.prerelease=b}break}default:throw new Error(`invalid increment argument: ${s}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}}return He=c,He}var Ze,hr;function Zi(){if(hr)return Ze;hr=1;const e=Vr();return Ze=(t,n,o=!1)=>{if(t instanceof e)return t;try{return new e(t,n)}catch(i){if(!o)return null;throw i}},Ze}var Qe,fr;function Qi(){if(fr)return Qe;fr=1;const e=Zi();return Qe=(t,n)=>{const o=e(t,n);return o?o.version:null},Qe}Qi();var Je,pr;function Ji(){if(pr)return Je;pr=1;const e=Vr();return Je=(t,n)=>new e(t,n).major,Je}Ji();var gr={},dr;function Ki(){return dr||(dr=1,(function(e){(function(t){t.parser=function(A,y){return new o(A,y)},t.SAXParser=o,t.SAXStream=u,t.createStream=s,t.MAX_BUFFER_LENGTH=64*1024;var n=["comment","sgmlDecl","textNode","tagName","doctype","procInstName","procInstBody","entity","attribName","attribValue","cdata","script"];t.EVENTS=["text","processinginstruction","sgmldeclaration","doctype","comment","opentagstart","attribute","opentag","closetag","opencdata","cdata","closecdata","error","end","ready","script","opennamespace","closenamespace"];function o(A,y){if(!(this instanceof o))return new o(A,y);var j=this;a(j),j.q=j.c="",j.bufferCheckPosition=t.MAX_BUFFER_LENGTH,j.opt=y||{},j.opt.lowercase=j.opt.lowercase||j.opt.lowercasetags,j.looseCase=j.opt.lowercase?"toLowerCase":"toUpperCase",j.tags=[],j.closed=j.closedRoot=j.sawRoot=!1,j.tag=j.error=null,j.strict=!!A,j.noscript=!!(A||j.opt.noscript),j.state=O.BEGIN,j.strictEntities=j.opt.strictEntities,j.ENTITIES=j.strictEntities?Object.create(t.XML_ENTITIES):Object.create(t.ENTITIES),j.attribList=[],j.opt.xmlns&&(j.ns=Object.create(w)),j.opt.unquotedAttributeValues===void 0&&(j.opt.unquotedAttributeValues=!A),j.trackPosition=j.opt.position!==!1,j.trackPosition&&(j.position=j.line=j.column=0),M(j,"onready")}Object.create||(Object.create=function(A){function y(){}y.prototype=A;var j=new y;return j}),Object.keys||(Object.keys=function(A){var y=[];for(var j in A)A.hasOwnProperty(j)&&y.push(j);return y});function i(A){for(var y=Math.max(t.MAX_BUFFER_LENGTH,10),j=0,C=0,q=n.length;Cy)switch(n[C]){case"textNode":D(A);break;case"cdata":R(A,"oncdata",A.cdata),A.cdata="";break;case"script":R(A,"onscript",A.script),A.script="";break;default:G(A,"Max buffer length exceeded: "+n[C])}j=Math.max(j,nt)}var rt=t.MAX_BUFFER_LENGTH-j;A.bufferCheckPosition=rt+A.position}function a(A){for(var y=0,j=n.length;y"||N(A)}function L(A,y){return A.test(y)}function S(A,y){return!L(A,y)}var O=0;t.STATE={BEGIN:O++,BEGIN_WHITESPACE:O++,TEXT:O++,TEXT_ENTITY:O++,OPEN_WAKA:O++,SGML_DECL:O++,SGML_DECL_QUOTED:O++,DOCTYPE:O++,DOCTYPE_QUOTED:O++,DOCTYPE_DTD:O++,DOCTYPE_DTD_QUOTED:O++,COMMENT_STARTING:O++,COMMENT:O++,COMMENT_ENDING:O++,COMMENT_ENDED:O++,CDATA:O++,CDATA_ENDING:O++,CDATA_ENDING_2:O++,PROC_INST:O++,PROC_INST_BODY:O++,PROC_INST_ENDING:O++,OPEN_TAG:O++,OPEN_TAG_SLASH:O++,ATTRIB:O++,ATTRIB_NAME:O++,ATTRIB_NAME_SAW_WHITE:O++,ATTRIB_VALUE:O++,ATTRIB_VALUE_QUOTED:O++,ATTRIB_VALUE_CLOSED:O++,ATTRIB_VALUE_UNQUOTED:O++,ATTRIB_VALUE_ENTITY_Q:O++,ATTRIB_VALUE_ENTITY_U:O++,CLOSE_TAG:O++,CLOSE_TAG_SAW_WHITE:O++,SCRIPT:O++,SCRIPT_ENDING:O++},t.XML_ENTITIES={amp:"&",gt:">",lt:"<",quot:'"',apos:"'"},t.ENTITIES={amp:"&",gt:">",lt:"<",quot:'"',apos:"'",AElig:198,Aacute:193,Acirc:194,Agrave:192,Aring:197,Atilde:195,Auml:196,Ccedil:199,ETH:208,Eacute:201,Ecirc:202,Egrave:200,Euml:203,Iacute:205,Icirc:206,Igrave:204,Iuml:207,Ntilde:209,Oacute:211,Ocirc:212,Ograve:210,Oslash:216,Otilde:213,Ouml:214,THORN:222,Uacute:218,Ucirc:219,Ugrave:217,Uuml:220,Yacute:221,aacute:225,acirc:226,aelig:230,agrave:224,aring:229,atilde:227,auml:228,ccedil:231,eacute:233,ecirc:234,egrave:232,eth:240,euml:235,iacute:237,icirc:238,igrave:236,iuml:239,ntilde:241,oacute:243,ocirc:244,ograve:242,oslash:248,otilde:245,ouml:246,szlig:223,thorn:254,uacute:250,ucirc:251,ugrave:249,uuml:252,yacute:253,yuml:255,copy:169,reg:174,nbsp:160,iexcl:161,cent:162,pound:163,curren:164,yen:165,brvbar:166,sect:167,uml:168,ordf:170,laquo:171,not:172,shy:173,macr:175,deg:176,plusmn:177,sup1:185,sup2:178,sup3:179,acute:180,micro:181,para:182,middot:183,cedil:184,ordm:186,raquo:187,frac14:188,frac12:189,frac34:190,iquest:191,times:215,divide:247,OElig:338,oelig:339,Scaron:352,scaron:353,Yuml:376,fnof:402,circ:710,tilde:732,Alpha:913,Beta:914,Gamma:915,Delta:916,Epsilon:917,Zeta:918,Eta:919,Theta:920,Iota:921,Kappa:922,Lambda:923,Mu:924,Nu:925,Xi:926,Omicron:927,Pi:928,Rho:929,Sigma:931,Tau:932,Upsilon:933,Phi:934,Chi:935,Psi:936,Omega:937,alpha:945,beta:946,gamma:947,delta:948,epsilon:949,zeta:950,eta:951,theta:952,iota:953,kappa:954,lambda:955,mu:956,nu:957,xi:958,omicron:959,pi:960,rho:961,sigmaf:962,sigma:963,tau:964,upsilon:965,phi:966,chi:967,psi:968,omega:969,thetasym:977,upsih:978,piv:982,ensp:8194,emsp:8195,thinsp:8201,zwnj:8204,zwj:8205,lrm:8206,rlm:8207,ndash:8211,mdash:8212,lsquo:8216,rsquo:8217,sbquo:8218,ldquo:8220,rdquo:8221,bdquo:8222,dagger:8224,Dagger:8225,bull:8226,hellip:8230,permil:8240,prime:8242,Prime:8243,lsaquo:8249,rsaquo:8250,oline:8254,frasl:8260,euro:8364,image:8465,weierp:8472,real:8476,trade:8482,alefsym:8501,larr:8592,uarr:8593,rarr:8594,darr:8595,harr:8596,crarr:8629,lArr:8656,uArr:8657,rArr:8658,dArr:8659,hArr:8660,forall:8704,part:8706,exist:8707,empty:8709,nabla:8711,isin:8712,notin:8713,ni:8715,prod:8719,sum:8721,minus:8722,lowast:8727,radic:8730,prop:8733,infin:8734,ang:8736,and:8743,or:8744,cap:8745,cup:8746,int:8747,there4:8756,sim:8764,cong:8773,asymp:8776,ne:8800,equiv:8801,le:8804,ge:8805,sub:8834,sup:8835,nsub:8836,sube:8838,supe:8839,oplus:8853,otimes:8855,perp:8869,sdot:8901,lceil:8968,rceil:8969,lfloor:8970,rfloor:8971,lang:9001,rang:9002,loz:9674,spades:9824,clubs:9827,hearts:9829,diams:9830},Object.keys(t.ENTITIES).forEach(function(A){var y=t.ENTITIES[A],j=typeof y=="number"?String.fromCharCode(y):y;t.ENTITIES[A]=j});for(var U in t.STATE)t.STATE[t.STATE[U]]=U;O=t.STATE;function M(A,y,j){A[y]&&A[y](j)}function R(A,y,j){A.textNode&&D(A),M(A,y,j)}function D(A){A.textNode=F(A.opt,A.textNode),A.textNode&&M(A,"ontext",A.textNode),A.textNode=""}function F(A,y){return A.trim&&(y=y.trim()),A.normalize&&(y=y.replace(/\s+/g," ")),y}function G(A,y){return D(A),A.trackPosition&&(y+=` Line: `+A.line+` Column: `+A.column+` Char: `+A.c),y=new Error(y),A.error=y,M(A,"onerror",y),A}function X(A){return A.sawRoot&&!A.closedRoot&&V(A,"Unclosed root tag"),A.state!==O.BEGIN&&A.state!==O.BEGIN_WHITESPACE&&A.state!==O.TEXT&&G(A,"Unexpected end"),D(A),A.c="",A.closed=!0,M(A,"onend"),o.call(A,A.strict,A.opt),A}function V(A,y){if(typeof A!="object"||!(A instanceof o))throw new Error("bad call to strictFail");A.strict&&G(A,y)}function Z(A){A.strict||(A.tagName=A.tagName[A.looseCase]());var y=A.tags[A.tags.length-1]||A,j=A.tag={name:A.tagName,attributes:{}};A.opt.xmlns&&(j.ns=y.ns),A.attribList.length=0,R(A,"onopentagstart",j)}function z(A,y){var j=A.indexOf(":"),C=j<0?["",A]:A.split(":"),q=C[0],nt=C[1];return y&&A==="xmlns"&&(q="xmlns",nt=""),{prefix:q,local:nt}}function st(A){if(A.strict||(A.attribName=A.attribName[A.looseCase]()),A.attribList.indexOf(A.attribName)!==-1||A.tag.attributes.hasOwnProperty(A.attribName)){A.attribName=A.attribValue="";return}if(A.opt.xmlns){var y=z(A.attribName,!0),j=y.prefix,C=y.local;if(j==="xmlns")if(C==="xml"&&A.attribValue!==b)V(A,"xml: prefix must be bound to "+b+` Actual: `+A.attribValue);else if(C==="xmlns"&&A.attribValue!==E)V(A,"xmlns: prefix must be bound to "+E+` Actual: `+A.attribValue);else{var q=A.tag,nt=A.tags[A.tags.length-1]||A;q.ns===nt.ns&&(q.ns=Object.create(nt.ns)),q.ns[C]=A.attribValue}A.attribList.push([A.attribName,A.attribValue])}else A.tag.attributes[A.attribName]=A.attribValue,R(A,"onattribute",{name:A.attribName,value:A.attribValue});A.attribName=A.attribValue=""}function W(A,y){if(A.opt.xmlns){var j=A.tag,C=z(A.tagName);j.prefix=C.prefix,j.local=C.local,j.uri=j.ns[C.prefix]||"",j.prefix&&!j.uri&&(V(A,"Unbound namespace prefix: "+JSON.stringify(A.tagName)),j.uri=C.prefix);var q=A.tags[A.tags.length-1]||A;j.ns&&q.ns!==j.ns&&Object.keys(j.ns).forEach(function(ot){R(A,"onopennamespace",{prefix:ot,uri:j.ns[ot]})});for(var nt=0,rt=A.attribList.length;nt",A.tagName="",A.state=O.SCRIPT;return}R(A,"onscript",A.script),A.script=""}var y=A.tags.length,j=A.tagName;A.strict||(j=j[A.looseCase]());for(var C=j;y--;){var q=A.tags[y];if(q.name!==C)V(A,"Unexpected close tag");else break}if(y<0){V(A,"Unmatched closing tag: "+A.tagName),A.textNode+="",A.state=O.TEXT;return}A.tagName=j;for(var nt=A.tags.length;nt-- >y;){var rt=A.tag=A.tags.pop();A.tagName=A.tag.name,R(A,"onclosetag",A.tagName);var gt={};for(var ht in rt.ns)gt[ht]=rt.ns[ht];var St=A.tags[A.tags.length-1]||A;A.opt.xmlns&&rt.ns!==St.ns&&Object.keys(rt.ns).forEach(function(at){var _t=rt.ns[at];R(A,"onclosenamespace",{prefix:at,uri:_t})})}y===0&&(A.closedRoot=!0),A.tagName=A.attribValue=A.attribName="",A.attribList.length=0,A.state=O.TEXT}function jt(A){var y=A.entity,j=y.toLowerCase(),C,q="";return A.ENTITIES[y]?A.ENTITIES[y]:A.ENTITIES[j]?A.ENTITIES[j]:(y=j,y.charAt(0)==="#"&&(y.charAt(1)==="x"?(y=y.slice(2),C=parseInt(y,16),q=C.toString(16)):(y=y.slice(1),C=parseInt(y,10),q=C.toString(10))),y=y.replace(/^0+/,""),isNaN(C)||q.toLowerCase()!==y?(V(A,"Invalid character entity"),"&"+A.entity+";"):String.fromCodePoint(C))}function Lt(A,y){y==="<"?(A.state=O.OPEN_WAKA,A.startTagPosition=A.position):N(y)||(V(A,"Non-whitespace before first tag."),A.textNode=y,A.state=O.TEXT)}function At(A,y){var j="";return y"?(R(y,"onsgmldeclaration",y.sgmlDecl),y.sgmlDecl="",y.state=O.TEXT):(P(C)&&(y.state=O.SGML_DECL_QUOTED),y.sgmlDecl+=C);continue;case O.SGML_DECL_QUOTED:C===y.q&&(y.state=O.SGML_DECL,y.q=""),y.sgmlDecl+=C;continue;case O.DOCTYPE:C===">"?(y.state=O.TEXT,R(y,"ondoctype",y.doctype),y.doctype=!0):(y.doctype+=C,C==="["?y.state=O.DOCTYPE_DTD:P(C)&&(y.state=O.DOCTYPE_QUOTED,y.q=C));continue;case O.DOCTYPE_QUOTED:y.doctype+=C,C===y.q&&(y.q="",y.state=O.DOCTYPE);continue;case O.DOCTYPE_DTD:C==="]"?(y.doctype+=C,y.state=O.DOCTYPE):C==="<"?(y.state=O.OPEN_WAKA,y.startTagPosition=y.position):P(C)?(y.doctype+=C,y.state=O.DOCTYPE_DTD_QUOTED,y.q=C):y.doctype+=C;continue;case O.DOCTYPE_DTD_QUOTED:y.doctype+=C,C===y.q&&(y.state=O.DOCTYPE_DTD,y.q="");continue;case O.COMMENT:C==="-"?y.state=O.COMMENT_ENDING:y.comment+=C;continue;case O.COMMENT_ENDING:C==="-"?(y.state=O.COMMENT_ENDED,y.comment=F(y.opt,y.comment),y.comment&&R(y,"oncomment",y.comment),y.comment=""):(y.comment+="-"+C,y.state=O.COMMENT);continue;case O.COMMENT_ENDED:C!==">"?(V(y,"Malformed comment"),y.comment+="--"+C,y.state=O.COMMENT):y.doctype&&y.doctype!==!0?y.state=O.DOCTYPE_DTD:y.state=O.TEXT;continue;case O.CDATA:C==="]"?y.state=O.CDATA_ENDING:y.cdata+=C;continue;case O.CDATA_ENDING:C==="]"?y.state=O.CDATA_ENDING_2:(y.cdata+="]"+C,y.state=O.CDATA);continue;case O.CDATA_ENDING_2:C===">"?(y.cdata&&R(y,"oncdata",y.cdata),R(y,"onclosecdata"),y.cdata="",y.state=O.TEXT):C==="]"?y.cdata+="]":(y.cdata+="]]"+C,y.state=O.CDATA);continue;case O.PROC_INST:C==="?"?y.state=O.PROC_INST_ENDING:N(C)?y.state=O.PROC_INST_BODY:y.procInstName+=C;continue;case O.PROC_INST_BODY:if(!y.procInstBody&&N(C))continue;C==="?"?y.state=O.PROC_INST_ENDING:y.procInstBody+=C;continue;case O.PROC_INST_ENDING:C===">"?(R(y,"onprocessinginstruction",{name:y.procInstName,body:y.procInstBody}),y.procInstName=y.procInstBody="",y.state=O.TEXT):(y.procInstBody+="?"+C,y.state=O.PROC_INST_BODY);continue;case O.OPEN_TAG:L(I,C)?y.tagName+=C:(Z(y),C===">"?W(y):C==="/"?y.state=O.OPEN_TAG_SLASH:(N(C)||V(y,"Invalid character in tag name"),y.state=O.ATTRIB));continue;case O.OPEN_TAG_SLASH:C===">"?(W(y,!0),Q(y)):(V(y,"Forward-slash in opening tag not followed by >"),y.state=O.ATTRIB);continue;case O.ATTRIB:if(N(C))continue;C===">"?W(y):C==="/"?y.state=O.OPEN_TAG_SLASH:L(T,C)?(y.attribName=C,y.attribValue="",y.state=O.ATTRIB_NAME):V(y,"Invalid attribute name");continue;case O.ATTRIB_NAME:C==="="?y.state=O.ATTRIB_VALUE:C===">"?(V(y,"Attribute without value"),y.attribValue=y.attribName,st(y),W(y)):N(C)?y.state=O.ATTRIB_NAME_SAW_WHITE:L(I,C)?y.attribName+=C:V(y,"Invalid attribute name");continue;case O.ATTRIB_NAME_SAW_WHITE:if(C==="=")y.state=O.ATTRIB_VALUE;else{if(N(C))continue;V(y,"Attribute without value"),y.tag.attributes[y.attribName]="",y.attribValue="",R(y,"onattribute",{name:y.attribName,value:""}),y.attribName="",C===">"?W(y):L(T,C)?(y.attribName=C,y.state=O.ATTRIB_NAME):(V(y,"Invalid attribute name"),y.state=O.ATTRIB)}continue;case O.ATTRIB_VALUE:if(N(C))continue;P(C)?(y.q=C,y.state=O.ATTRIB_VALUE_QUOTED):(y.opt.unquotedAttributeValues||G(y,"Unquoted attribute value"),y.state=O.ATTRIB_VALUE_UNQUOTED,y.attribValue=C);continue;case O.ATTRIB_VALUE_QUOTED:if(C!==y.q){C==="&"?y.state=O.ATTRIB_VALUE_ENTITY_Q:y.attribValue+=C;continue}st(y),y.q="",y.state=O.ATTRIB_VALUE_CLOSED;continue;case O.ATTRIB_VALUE_CLOSED:N(C)?y.state=O.ATTRIB:C===">"?W(y):C==="/"?y.state=O.OPEN_TAG_SLASH:L(T,C)?(V(y,"No whitespace between attributes"),y.attribName=C,y.attribValue="",y.state=O.ATTRIB_NAME):V(y,"Invalid attribute name");continue;case O.ATTRIB_VALUE_UNQUOTED:if(!_(C)){C==="&"?y.state=O.ATTRIB_VALUE_ENTITY_U:y.attribValue+=C;continue}st(y),C===">"?W(y):y.state=O.ATTRIB;continue;case O.CLOSE_TAG:if(y.tagName)C===">"?Q(y):L(I,C)?y.tagName+=C:y.script?(y.script+=""?Q(y):V(y,"Invalid characters in closing tag");continue;case O.TEXT_ENTITY:case O.ATTRIB_VALUE_ENTITY_Q:case O.ATTRIB_VALUE_ENTITY_U:var rt,gt;switch(y.state){case O.TEXT_ENTITY:rt=O.TEXT,gt="textNode";break;case O.ATTRIB_VALUE_ENTITY_Q:rt=O.ATTRIB_VALUE_QUOTED,gt="attribValue";break;case O.ATTRIB_VALUE_ENTITY_U:rt=O.ATTRIB_VALUE_UNQUOTED,gt="attribValue";break}if(C===";"){var ht=jt(y);y.opt.unparsedEntities&&!Object.values(t.XML_ENTITIES).includes(ht)?(y.entity="",y.state=rt,y.write(ht)):(y[gt]+=ht,y.entity="",y.state=rt)}else L(y.entity.length?v:g,C)?y.entity+=C:(V(y,"Invalid character in entity name"),y[gt]+="&"+y.entity+C,y.entity="",y.state=rt);continue;default:throw new Error(y,"Unknown state: "+y.state)}return y.position>=y.bufferCheckPosition&&i(y),y}String.fromCodePoint||(function(){var A=String.fromCharCode,y=Math.floor,j=function(){var C=16384,q=[],nt,rt,gt=-1,ht=arguments.length;if(!ht)return"";for(var St="";++gt1114111||y(at)!==at)throw RangeError("Invalid code point: "+at);at<=65535?q.push(at):(at-=65536,nt=(at>>10)+55296,rt=at%1024+56320,q.push(nt,rt)),(gt+1===ht||q.length>C)&&(St+=A.apply(null,q),q.length=0)}return St};Object.defineProperty?Object.defineProperty(String,"fromCodePoint",{value:j,configurable:!0,writable:!0}):String.fromCodePoint=j})()})(e)})(gr)),gr}Ki();var be;(function(e){e[e.User=0]="User",e[e.Group=1]="Group",e[e.Link=3]="Link",e[e.Email=4]="Email",e[e.Remote=6]="Remote",e[e.Team=7]="Team",e[e.Guest=8]="Guest",e[e.RemoteGroup=9]="RemoteGroup",e[e.Room=10]="Room",e[e.Deck=12]="Deck",e[e.FederatedGroup=14]="FederatedGroup",e[e.ScienceMesh=15]="ScienceMesh"})(be||(be={}));function ts(e){if(!e.id)throw new Error("Sidebar actions must have an id");if(!e.element||!e.element.startsWith("oca_")||!window.customElements.get(e.element))throw new Error("Sidebar actions must provide a registered custom web component identifier");if(typeof e.order!="number")throw new Error("Sidebar actions must have the order property");if(typeof e.enabled!="function")throw new Error('Sidebar actions must implement the "enabled" method');if(window._nc_files_sharing_sidebar_actions??=new Map,window._nc_files_sharing_sidebar_actions.has(e.id))throw new Error(`Sidebar action with id "${e.id}" is already registered`);window._nc_files_sharing_sidebar_actions.set(e.id,e)}const es=["role"],ns={key:0,class:"notecard__heading"},rs={class:"notecard__text"},os=mr({__name:"NcNoteCard",props:{heading:{default:void 0},showAlert:{type:Boolean},text:{default:void 0},type:{default:"warning"}},setup(e){const t=e,n=In(()=>t.showAlert||t.type==="error"),o=In(()=>{switch(t.type){case"error":return uo;case"success":return ao;case"info":return so;case"warning":default:return io}});return(i,a)=>(he(),ce("div",{class:Qt(["notecard",{[`notecard--${i.type}`]:i.type,"notecard--legacy":Rn(co)}]),role:n.value?"alert":"note"},[Nn(i.$slots,"icon",{},()=>[Ht(Rn(lo),{path:o.value,class:Qt(["notecard__icon",{"notecard__icon--heading":i.heading}]),inline:""},null,8,["path","class"])],!0),_n("div",null,[i.heading?(he(),ce("p",ns,Jt(i.heading),1)):Er("",!0),Nn(i.$slots,"default",{},()=>[_n("p",rs,Jt(i.text),1)],!0)])],10,es))}}),is=oo(os,[["__scopeId","data-v-dfa67081"]]);async function ss(e){return(await sn.get(an("/apps/files_downloadlimit/api/v1/{token}/limit",{token:e}))).data.ocs.data}async function as(e,t){return(await sn.put(an("/apps/files_downloadlimit/api/v1/{token}/limit",{token:e}),{limit:t})).data.ocs.data}async function us(e){return(await sn.delete(an("/apps/files_downloadlimit/api/v1/{token}/limit",{token:e}))).data.ocs.data}const Ke=eo("files_downloadlimit","default-download-limit",-1),ls=mr({name:"DownloadLimitEntry",components:{NcCheckboxRadioSwitch:fo,NcNoteCard:is,NcTextField:ho},props:{share:{type:Object,required:!0},onSave:{type:Function,required:!0}},data(){return{limitEnabled:Ke!==-1,initialLimit:null,limit:Ke===-1?10:Ke,count:null,loading:!1,hasError:!1}},computed:{remainingCount(){return(this.initialLimit??0)-(this.count??0)},helperText(){return this.limit&&this.limit>0?"":oe("files_downloadlimit","The minimum limit is 1")},isNewShare(){return this.share.id===null||this.share.id===void 0},showRemainingDownloadsNote(){return typeof this.count=="number"},showResetNote(){return!this.isNewShare&&!!this.initialLimit&&typeof this.limit=="number"&&this.limit!==this.initialLimit}},watch:{share:{deep:!0,immediate:!0,async handler(e,t){if(!e?.id||t?.id){Bt.debug("Skip undefined share");return}if(this.onSave(this.save),e.id===t?.id&&this.limit){Bt.debug("Same share given, skip loading download limit",{share:e,oldShare:t});return}Bt.debug("Loading download limit",{share:this.share}),this.loading=!0;try{const{limit:n,count:o}=await ss(this.share.token);typeof n=="number"&&typeof o=="number"&&(this.limitEnabled=!!n,this.initialLimit=n,this.limit=n,this.count=o)}catch(n){this.hasError=!0,Bt.error("Failed to load download limit",{error:n,share:this.share})}this.loading=!1}}},methods:{n:no,t:oe,async save(){if(typeof this.limit!="number"||this.limit<=0){Bt.debug("Skip saving invalid limit",{limit:this.limit});return}if(this.isNewShare||this.limit!==this.initialLimit){try{await as(this.share.token,this.limit)}catch(e){Bt.error("Failed to set the download limit",{error:e,limit:this.limit,share:this.share}),Sn(oe("files_downloadlimit","Failed to set download limit"))}return}if(!this.limitEnabled&&this.initialLimit)try{await us(this.share.token)}catch(e){Bt.error("Failed to remove the download limit",{error:e,share:this.share}),Sn(oe("files_downloadlimit","Failed to remove download limit"))}}}}),cs="_action__wrapper_19i6i_1",hs="_action__countNote_19i6i_4",fs="_action__resetNote_19i6i_7",ps={action__wrapper:cs,action__countNote:hs,action__resetNote:fs};function gs(e,t,n,o,i,a){const h=_e("NcCheckboxRadioSwitch"),c=_e("NcNoteCard"),d=_e("NcTextField");return he(),ce("div",{class:Qt(e.$style.action__wrapper)},[Ht(h,{modelValue:e.limitEnabled,"onUpdate:modelValue":t[0]||(t[0]=s=>e.limitEnabled=s),loading:e.loading,disabled:e.hasError},{default:Re(()=>[Se(Jt(e.t("files_downloadlimit","Limit downloads")),1)]),_:1},8,["modelValue","loading","disabled"]),!e.loading&&!e.hasError?(he(),ce(go,{key:0},[xe(Ht(c,{class:Qt(e.$style.action__countNote),type:"info"},{default:Re(()=>[Se(Jt(e.n("files_downloadlimit","1 remaining download allowed","{count} remaining downloads allowed",e.remainingCount,{count:e.remainingCount})),1)]),_:1},8,["class"]),[[Pe,e.limitEnabled&&e.showRemainingDownloadsNote]]),xe(Ht(d,{modelValue:e.limit,"onUpdate:modelValue":t[1]||(t[1]=s=>e.limit=s),label:e.t("files_downloadlimit","Set download limit"),type:"number",min:"1",error:e.helperText!=="","helper-text":e.helperText},null,8,["modelValue","label","error","helper-text"]),[[Pe,e.limitEnabled]]),xe(Ht(c,{class:Qt(e.$style.action__resetNote),type:"warning"},{default:Re(()=>[Se(Jt(e.t("files_downloadlimit","Setting a new limit will reset the download count")),1)]),_:1},8,["class"]),[[Pe,e.limitEnabled&&e.showResetNote]])],64)):Er("",!0)],2)}const ds={$style:ps},ms=po(ls,[["render",gs],["__cssModules",ds]]),Xr="oca_files_downloadlimit-sharing_action",Es={id:"files_downloadlimit",element:Xr,order:20,enabled(e,t){return e.type!==be.Email&&e.type!==be.Link||!e.token?!1:t.type===kr.File}},ys=mo(ms,{shadowRoot:!1});window.customElements.define(Xr,ys),ts(Es); //# sourceMappingURL=files_downloadlimit-main.mjs.map