/*! For license information please see mail.2204.2d9d9e4d5cef30a72905.js.LICENSE.txt */ (globalThis.webpackChunkf7cloud_mail=globalThis.webpackChunkf7cloud_mail||[]).push([[2204],{36117(t,e){var n,r;function i(t){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},i(t)}"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self&&self,n=function(t){"use strict";function e(t,n){return e=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},e(t,n)}function n(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}();return function(){var n,o=r(t);if(e){var s=r(this).constructor;n=Reflect.construct(o,arguments,s)}else n=o.apply(this,arguments);return function(t,e){if(e&&("object"===i(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(this,n)}}function r(t){return r=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},r(t)}function o(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return s(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?s(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,c=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){c=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(c)throw o}}}}function s(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n>5==6?2:t>>4==14?3:t>>3==30?4:t>>6==2?-1:-2}function a(t){var e=this.lastTotal-this.lastNeed,n=function(t,e){if(128!=(192&e[0]))return t.lastNeed=0,"�";if(t.lastNeed>1&&e.length>1){if(128!=(192&e[1]))return t.lastNeed=1,"�";if(t.lastNeed>2&&e.length>2&&128!=(192&e[2]))return t.lastNeed=2,"�"}}(this,t);return void 0!==n?n:this.lastNeed<=t.length?(t.copy(this.lastChar,e,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(t.copy(this.lastChar,e,0,t.length),void(this.lastNeed-=t.length))}function c(t,e){if((t.length-e)%2==0){var n=t.toString("utf16le",e);if(n){var r=n.charCodeAt(n.length-1);if(r>=55296&&r<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1],n.slice(0,-1)}return n}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=t[t.length-1],t.toString("utf16le",e,t.length-1)}function u(t){var e=t&&t.length?this.write(t):"";if(this.lastNeed){var n=this.lastTotal-this.lastNeed;return e+this.lastChar.toString("utf16le",0,n)}return e}function l(t,e){var n=(t.length-e)%3;return 0===n?t.toString("base64",e):(this.lastNeed=3-n,this.lastTotal=3,1===n?this.lastChar[0]=t[t.length-1]:(this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1]),t.toString("base64",e,t.length-n))}function h(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+this.lastChar.toString("base64",0,3-this.lastNeed):e}function f(t){return t.toString(this.encoding)}function p(t){return t&&t.length?this.write(t):""}e.I=o,o.prototype.write=function(t){if(0===t.length)return"";var e,n;if(this.lastNeed){if(void 0===(e=this.fillLast(t)))return"";n=this.lastNeed,this.lastNeed=0}else n=0;return n=0?(i>0&&(t.lastNeed=i-1),i):--r=0?(i>0&&(t.lastNeed=i-2),i):--r=0?(i>0&&(2===i?i=0:t.lastNeed=i-3),i):0}(this,t,e);if(!this.lastNeed)return t.toString("utf8",e);this.lastTotal=n;var r=t.length-(n-this.lastNeed);return t.copy(this.lastChar,0,r),t.toString("utf8",e,r)},o.prototype.fillLast=function(t){if(this.lastNeed<=t.length)return t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,t.length),this.lastNeed-=t.length}},87485(t,e,n){"use strict";n.d(e,{F:()=>i});var r=n(81222);function i(){try{return(0,r.C)("core","capabilities")}catch(t){return console.debug("Could not find capabilities initial state fall back to _oc_capabilities"),"_oc_capabilities"in window?window._oc_capabilities:{}}}},6555(t,e,n){"use strict";n.d(e,{pt:()=>gn,di:()=>ur,nF:()=>cr,aX:()=>mn,H4:()=>Rn,VL:()=>_n,R3:()=>Pn,Al:()=>Dn,lJ:()=>Sn,v7:()=>pr,Q$:()=>Ln,Yc:()=>On,ur:()=>gr,KT:()=>lr});var r=n(21777),i=n(32505),o=n(63814),s=n(36117),a=n(65606),c={2:t=>{function e(t,e,i){t instanceof RegExp&&(t=n(t,i)),e instanceof RegExp&&(e=n(e,i));var o=r(t,e,i);return o&&{start:o[0],end:o[1],pre:i.slice(0,o[0]),body:i.slice(o[0]+t.length,o[1]),post:i.slice(o[1]+e.length)}}function n(t,e){var n=e.match(t);return n?n[0]:null}function r(t,e,n){var r,i,o,s,a,c=n.indexOf(t),u=n.indexOf(e,c+1),l=c;if(c>=0&&u>0){for(r=[],o=n.length;l>=0&&!a;)l==c?(r.push(l),c=n.indexOf(t,l+1)):1==r.length?a=[r.pop(),u]:((i=r.pop())=0?c:u;r.length&&(a=[o,s])}return a}t.exports=e,e.range=r},101:function(t,e,n){var r;t=n.nmd(t),function(){var i=(t&&t.exports,"object"==typeof globalThis&&globalThis);i.global!==i&&i.window;var o=function(t){this.message=t};(o.prototype=new Error).name="InvalidCharacterError";var s=function(t){throw new o(t)},a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",c=/[\t\n\f\r ]/g,u={encode:function(t){t=String(t),/[^\0-\xFF]/.test(t)&&s("The string to be encoded contains characters outside of the Latin1 range.");for(var e,n,r,i,o=t.length%3,c="",u=-1,l=t.length-o;++u>18&63)+a.charAt(i>>12&63)+a.charAt(i>>6&63)+a.charAt(63&i);return 2==o?(e=t.charCodeAt(u)<<8,n=t.charCodeAt(++u),c+=a.charAt((i=e+n)>>10)+a.charAt(i>>4&63)+a.charAt(i<<2&63)+"="):1==o&&(i=t.charCodeAt(u),c+=a.charAt(i>>2)+a.charAt(i<<4&63)+"=="),c},decode:function(t){var e=(t=String(t).replace(c,"")).length;e%4==0&&(e=(t=t.replace(/==?$/,"")).length),(e%4==1||/[^+a-zA-Z0-9/]/.test(t))&&s("Invalid character: the string to be decoded is not correctly encoded.");for(var n,r,i=0,o="",u=-1;++u>(-2*i&6)));return o},version:"1.0.0"};void 0===(r=function(){return u}.call(e,n,e,t))||(t.exports=r)}()},172:(t,e)=>{e.d=function(t){if(!t)return 0;for(var e=(t=t.toString()).length,n=t.length;n--;){var r=t.charCodeAt(n);56320<=r&&r<=57343&&n--,127{var e={utf8:{stringToBytes:function(t){return e.bin.stringToBytes(unescape(encodeURIComponent(t)))},bytesToString:function(t){return decodeURIComponent(escape(e.bin.bytesToString(t)))}},bin:{stringToBytes:function(t){for(var e=[],n=0;n{var e,n;e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",n={rotl:function(t,e){return t<>>32-e},rotr:function(t,e){return t<<32-e|t>>>e},endian:function(t){if(t.constructor==Number)return 16711935&n.rotl(t,8)|4278255360&n.rotl(t,24);for(var e=0;e0;t--)e.push(Math.floor(256*Math.random()));return e},bytesToWords:function(t){for(var e=[],n=0,r=0;n>>5]|=t[n]<<24-r%32;return e},wordsToBytes:function(t){for(var e=[],n=0;n<32*t.length;n+=8)e.push(t[n>>>5]>>>24-n%32&255);return e},bytesToHex:function(t){for(var e=[],n=0;n>>4).toString(16)),e.push((15&t[n]).toString(16));return e.join("")},hexToBytes:function(t){for(var e=[],n=0;n>>6*(3-o)&63)):n.push("=");return n.join("")},base64ToBytes:function(t){t=t.replace(/[^A-Z0-9+\/]/gi,"");for(var n=[],r=0,i=0;r>>6-2*i);return n}},t.exports=n},635:(t,e,n)=>{const r=n(31),i=n(338),o=n(221);t.exports={XMLParser:i,XMLValidator:r,XMLBuilder:o}},118:t=>{t.exports=function(t){return"function"==typeof t?t:Array.isArray(t)?e=>{for(const n of t){if("string"==typeof n&&e===n)return!0;if(n instanceof RegExp&&n.test(e))return!0}}:()=>!1}},705:(t,e)=>{const n=":A-Za-z_\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD",r="["+n+"]["+n+"\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*",i=new RegExp("^"+r+"$");e.isExist=function(t){return void 0!==t},e.isEmptyObject=function(t){return 0===Object.keys(t).length},e.merge=function(t,e,n){if(e){const r=Object.keys(e),i=r.length;for(let o=0;o{const r=n(705),i={allowBooleanAttributes:!1,unpairedTags:[]};function o(t){return" "===t||"\t"===t||"\n"===t||"\r"===t}function s(t,e){const n=e;for(;e5&&"xml"===r)return d("InvalidXml","XML declaration allowed only at the start of the document.",m(t,e));if("?"==t[e]&&">"==t[e+1]){e++;break}}return e}function a(t,e){if(t.length>e+5&&"-"===t[e+1]&&"-"===t[e+2]){for(e+=3;e"===t[e+2]){e+=2;break}}else if(t.length>e+8&&"D"===t[e+1]&&"O"===t[e+2]&&"C"===t[e+3]&&"T"===t[e+4]&&"Y"===t[e+5]&&"P"===t[e+6]&&"E"===t[e+7]){let n=1;for(e+=8;e"===t[e]&&(n--,0===n))break}else if(t.length>e+9&&"["===t[e+1]&&"C"===t[e+2]&&"D"===t[e+3]&&"A"===t[e+4]&&"T"===t[e+5]&&"A"===t[e+6]&&"["===t[e+7])for(e+=8;e"===t[e+2]){e+=2;break}return e}e.validate=function(t,e){e=Object.assign({},i,e);const n=[];let c=!1,u=!1;"\ufeff"===t[0]&&(t=t.substr(1));for(let i=0;i"!==t[i]&&" "!==t[i]&&"\t"!==t[i]&&"\n"!==t[i]&&"\r"!==t[i];i++)E+=t[i];if(E=E.trim(),"/"===E[E.length-1]&&(E=E.substring(0,E.length-1),i--),h=E,!r.isName(h)){let e;return e=0===E.trim().length?"Invalid space after '<'.":"Tag '"+E+"' is an invalid name.",d("InvalidTag",e,m(t,i))}const y=l(t,i);if(!1===y)return d("InvalidAttr","Attributes for '"+E+"' have open quote.",m(t,i));let b=y.value;if(i=y.index,"/"===b[b.length-1]){const n=i-b.length;b=b.substring(0,b.length-1);const r=f(b,e);if(!0!==r)return d(r.err.code,r.err.msg,m(t,n+r.err.line));c=!0}else if(v){if(!y.tagClosed)return d("InvalidTag","Closing tag '"+E+"' doesn't have proper closing.",m(t,i));if(b.trim().length>0)return d("InvalidTag","Closing tag '"+E+"' can't have attributes or invalid starting.",m(t,g));if(0===n.length)return d("InvalidTag","Closing tag '"+E+"' has not been opened.",m(t,g));{const e=n.pop();if(E!==e.tagName){let n=m(t,e.tagStartPos);return d("InvalidTag","Expected closing tag '"+e.tagName+"' (opened in line "+n.line+", col "+n.col+") instead of closing tag '"+E+"'.",m(t,g))}0==n.length&&(u=!0)}}else{const r=f(b,e);if(!0!==r)return d(r.err.code,r.err.msg,m(t,i-b.length+r.err.line));if(!0===u)return d("InvalidXml","Multiple possible root nodes found.",m(t,i));-1!==e.unpairedTags.indexOf(E)||n.push({tagName:E,tagStartPos:g}),c=!0}for(i++;i0)||d("InvalidXml","Invalid '"+JSON.stringify(n.map(t=>t.tagName),null,4).replace(/\r?\n/g,"")+"' found.",{line:1,col:1}):d("InvalidXml","Start tag expected.",1)};const c='"',u="'";function l(t,e){let n="",r="",i=!1;for(;e"===t[e]&&""===r){i=!0;break}n+=t[e]}return""===r&&{value:n,index:e,tagClosed:i}}const h=new RegExp("(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['\"])(([\\s\\S])*?)\\5)?","g");function f(t,e){const n=r.getAllMatches(t,h),i={};for(let t=0;t{const r=n(87),i=n(118),o={attributeNamePrefix:"@_",attributesGroupName:!1,textNodeName:"#text",ignoreAttributes:!0,cdataPropName:!1,format:!1,indentBy:" ",suppressEmptyNode:!1,suppressUnpairedNode:!0,suppressBooleanAttributes:!0,tagValueProcessor:function(t,e){return e},attributeValueProcessor:function(t,e){return e},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 s(t){this.options=Object.assign({},o,t),!0===this.options.ignoreAttributes||this.options.attributesGroupName?this.isAttribute=function(){return!1}:(this.ignoreAttributesFn=i(this.options.ignoreAttributes),this.attrPrefixLen=this.options.attributeNamePrefix.length,this.isAttribute=u),this.processTextOrObjNode=a,this.options.format?(this.indentate=c,this.tagEndChar=">\n",this.newLine="\n"):(this.indentate=function(){return""},this.tagEndChar=">",this.newLine="")}function a(t,e,n,r){const i=this.j2x(t,n+1,r.concat(e));return void 0!==t[this.options.textNodeName]&&1===Object.keys(t).length?this.buildTextValNode(t[this.options.textNodeName],e,i.attrStr,n):this.buildObjectNode(i.val,e,i.attrStr,n)}function c(t){return this.options.indentBy.repeat(t)}function u(t){return!(!t.startsWith(this.options.attributeNamePrefix)||t===this.options.textNodeName)&&t.substr(this.attrPrefixLen)}s.prototype.build=function(t){return this.options.preserveOrder?r(t,this.options):(Array.isArray(t)&&this.options.arrayNodeName&&this.options.arrayNodeName.length>1&&(t={[this.options.arrayNodeName]:t}),this.j2x(t,0,[]).val)},s.prototype.j2x=function(t,e,n){let r="",i="";const o=n.join(".");for(let s in t)if(Object.prototype.hasOwnProperty.call(t,s))if(void 0===t[s])this.isAttribute(s)&&(i+="");else if(null===t[s])this.isAttribute(s)?i+="":"?"===s[0]?i+=this.indentate(e)+"<"+s+"?"+this.tagEndChar:i+=this.indentate(e)+"<"+s+"/"+this.tagEndChar;else if(t[s]instanceof Date)i+=this.buildTextValNode(t[s],s,"",e);else if("object"!=typeof t[s]){const n=this.isAttribute(s);if(n&&!this.ignoreAttributesFn(n,o))r+=this.buildAttrPairStr(n,""+t[s]);else if(!n)if(s===this.options.textNodeName){let e=this.options.tagValueProcessor(s,""+t[s]);i+=this.replaceEntitiesValue(e)}else i+=this.buildTextValNode(t[s],s,"",e)}else if(Array.isArray(t[s])){const r=t[s].length;let o="",a="";for(let c=0;c"+t+i}},s.prototype.closeTag=function(t){let e="";return-1!==this.options.unpairedTags.indexOf(t)?this.options.suppressUnpairedNode||(e="/"):e=this.options.suppressEmptyNode?"/":`>`+this.newLine;if(!1!==this.options.commentPropName&&e===this.options.commentPropName)return this.indentate(r)+`\x3c!--${t}--\x3e`+this.newLine;if("?"===e[0])return this.indentate(r)+"<"+e+n+"?"+this.tagEndChar;{let i=this.options.tagValueProcessor(e,t);return i=this.replaceEntitiesValue(i),""===i?this.indentate(r)+"<"+e+n+this.closeTag(e)+this.tagEndChar:this.indentate(r)+"<"+e+n+">"+i+"0&&this.options.processEntities)for(let e=0;e{function e(t,s,a,c){let u="",l=!1;for(let h=0;h`,l=!1;continue}if(p===s.commentPropName){u+=c+`\x3c!--${f[p][0][s.textNodeName]}--\x3e`,l=!0;continue}if("?"===p[0]){const t=r(f[":@"],s),e="?xml"===p?"":c;let n=f[p][0][s.textNodeName];n=0!==n.length?" "+n:"",u+=e+`<${p}${n}${t}?>`,l=!0;continue}let g=c;""!==g&&(g+=s.indentBy);const m=c+`<${p}${r(f[":@"],s)}`,v=e(f[p],s,d,g);-1!==s.unpairedTags.indexOf(p)?s.suppressUnpairedNode?u+=m+">":u+=m+"/>":v&&0!==v.length||!s.suppressEmptyNode?v&&v.endsWith(">")?u+=m+`>${v}${c}`:(u+=m+">",v&&""!==c&&(v.includes("/>")||v.includes("`):u+=m+"/>",l=!0}return u}function n(t){const e=Object.keys(t);for(let n=0;n0&&e.processEntities)for(let n=0;n0&&(r="\n"),e(t,n,"",r)}},193:(t,e,n)=>{const r=n(705);function i(t,e){let n="";for(;e"===t[e]){if(f?"-"===t[e-1]&&"-"===t[e-2]&&(f=!1,r--):r--,0===r)break}else"["===t[e]?h=!0:p+=t[e];else{if(h&&s(t,e)){let r,o;e+=7,[r,o,e]=i(t,e+1),-1===o.indexOf("&")&&(n[l(r)]={regx:RegExp(`&${r};`,"g"),val:o})}else if(h&&a(t,e))e+=8;else if(h&&c(t,e))e+=8;else if(h&&u(t,e))e+=9;else{if(!o)throw new Error("Invalid DOCTYPE");f=!0}r++,p=""}if(0!==r)throw new Error("Unclosed DOCTYPE")}return{entities:n,i:e}}},63:(t,e)=>{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(t,e){return e},attributeValueProcessor:function(t,e){return e},stopNodes:[],alwaysCreateTextNode:!1,isArray:()=>!1,commentPropName:!1,unpairedTags:[],processEntities:!0,htmlEntities:!1,ignoreDeclaration:!1,ignorePiTags:!1,transformTagName:!1,transformAttributeName:!1,updateTag:function(t,e,n){return t}};e.buildOptions=function(t){return Object.assign({},n,t)},e.defaultOptions=n},299:(t,e,n)=>{const r=n(705),i=n(365),o=n(193),s=n(494),a=n(118);function c(t){const e=Object.keys(t);for(let n=0;n0)){s||(t=this.replaceEntitiesValue(t));const r=this.options.tagValueProcessor(e,t,n,i,o);return null==r?t:typeof r!=typeof t||r!==t?r:this.options.trimValues||t.trim()===t?w(t,this.options.parseTagValue,this.options.numberParseOptions):t}}function l(t){if(this.options.removeNSPrefix){const e=t.split(":"),n="/"===t.charAt(0)?"/":"";if("xmlns"===e[0])return"";2===e.length&&(t=n+e[1])}return t}const h=new RegExp("([^\\s=]+)\\s*(=\\s*(['\"])([\\s\\S]*?)\\3)?","gm");function f(t,e,n){if(!0!==this.options.ignoreAttributes&&"string"==typeof t){const n=r.getAllMatches(t,h),i=n.length,o={};for(let t=0;t",a,"Closing Tag is not closed.");let i=t.substring(a+2,e).trim();if(this.options.removeNSPrefix){const t=i.indexOf(":");-1!==t&&(i=i.substr(t+1))}this.options.transformTagName&&(i=this.options.transformTagName(i)),n&&(r=this.saveTextToParentTag(r,n,s));const o=s.substring(s.lastIndexOf(".")+1);if(i&&-1!==this.options.unpairedTags.indexOf(i))throw new Error(`Unpaired tag can not be used as closing tag: `);let c=0;o&&-1!==this.options.unpairedTags.indexOf(o)?(c=s.lastIndexOf(".",s.lastIndexOf(".")-1),this.tagsNodeStack.pop()):c=s.lastIndexOf("."),s=s.substring(0,c),n=this.tagsNodeStack.pop(),r="",a=e}else if("?"===t[a+1]){let e=y(t,a,!1,"?>");if(!e)throw new Error("Pi Tag is not closed.");if(r=this.saveTextToParentTag(r,n,s),this.options.ignoreDeclaration&&"?xml"===e.tagName||this.options.ignorePiTags);else{const t=new i(e.tagName);t.add(this.options.textNodeName,""),e.tagName!==e.tagExp&&e.attrExpPresent&&(t[":@"]=this.buildAttributesMap(e.tagExp,s,e.tagName)),this.addChild(n,t,s)}a=e.closeIndex+1}else if("!--"===t.substr(a+1,3)){const e=E(t,"--\x3e",a+4,"Comment is not closed.");if(this.options.commentPropName){const i=t.substring(a+4,e-2);r=this.saveTextToParentTag(r,n,s),n.add(this.options.commentPropName,[{[this.options.textNodeName]:i}])}a=e}else if("!D"===t.substr(a+1,2)){const e=o(t,a);this.docTypeEntities=e.entities,a=e.i}else if("!["===t.substr(a+1,2)){const e=E(t,"]]>",a,"CDATA is not closed.")-2,i=t.substring(a+9,e);r=this.saveTextToParentTag(r,n,s);let o=this.parseTextData(i,n.tagname,s,!0,!1,!0,!0);null==o&&(o=""),this.options.cdataPropName?n.add(this.options.cdataPropName,[{[this.options.textNodeName]:i}]):n.add(this.options.textNodeName,o),a=e+2}else{let o=y(t,a,this.options.removeNSPrefix),c=o.tagName;const u=o.rawTagName;let l=o.tagExp,h=o.attrExpPresent,f=o.closeIndex;this.options.transformTagName&&(c=this.options.transformTagName(c)),n&&r&&"!xml"!==n.tagname&&(r=this.saveTextToParentTag(r,n,s,!1));const p=n;if(p&&-1!==this.options.unpairedTags.indexOf(p.tagname)&&(n=this.tagsNodeStack.pop(),s=s.substring(0,s.lastIndexOf("."))),c!==e.tagname&&(s+=s?"."+c:c),this.isItStopNode(this.options.stopNodes,s,c)){let e="";if(l.length>0&&l.lastIndexOf("/")===l.length-1)"/"===c[c.length-1]?(c=c.substr(0,c.length-1),s=s.substr(0,s.length-1),l=c):l=l.substr(0,l.length-1),a=o.closeIndex;else if(-1!==this.options.unpairedTags.indexOf(c))a=o.closeIndex;else{const n=this.readStopNodeData(t,u,f+1);if(!n)throw new Error(`Unexpected end of ${u}`);a=n.i,e=n.tagContent}const r=new i(c);c!==l&&h&&(r[":@"]=this.buildAttributesMap(l,s,c)),e&&(e=this.parseTextData(e,c,s,!0,h,!0,!0)),s=s.substr(0,s.lastIndexOf(".")),r.add(this.options.textNodeName,e),this.addChild(n,r,s)}else{if(l.length>0&&l.lastIndexOf("/")===l.length-1){"/"===c[c.length-1]?(c=c.substr(0,c.length-1),s=s.substr(0,s.length-1),l=c):l=l.substr(0,l.length-1),this.options.transformTagName&&(c=this.options.transformTagName(c));const t=new i(c);c!==l&&h&&(t[":@"]=this.buildAttributesMap(l,s,c)),this.addChild(n,t,s),s=s.substr(0,s.lastIndexOf("."))}else{const t=new i(c);this.tagsNodeStack.push(n),c!==l&&h&&(t[":@"]=this.buildAttributesMap(l,s,c)),this.addChild(n,t,s),n=t}r="",a=f}}else r+=t[a];return e.child};function d(t,e,n){const r=this.options.updateTag(e.tagname,n,e[":@"]);!1===r||("string"==typeof r?(e.tagname=r,t.addChild(e)):t.addChild(e))}const g=function(t){if(this.options.processEntities){for(let e in this.docTypeEntities){const n=this.docTypeEntities[e];t=t.replace(n.regx,n.val)}for(let e in this.lastEntities){const n=this.lastEntities[e];t=t.replace(n.regex,n.val)}if(this.options.htmlEntities)for(let e in this.htmlEntities){const n=this.htmlEntities[e];t=t.replace(n.regex,n.val)}t=t.replace(this.ampEntity.regex,this.ampEntity.val)}return t};function m(t,e,n,r){return t&&(void 0===r&&(r=0===Object.keys(e.child).length),void 0!==(t=this.parseTextData(t,e.tagname,n,!1,!!e[":@"]&&0!==Object.keys(e[":@"]).length,r))&&""!==t&&e.add(this.options.textNodeName,t),t=""),t}function v(t,e,n){const r="*."+n;for(const n in t){const i=t[n];if(r===i||e===i)return!0}return!1}function E(t,e,n,r){const i=t.indexOf(e,n);if(-1===i)throw new Error(r);return i+e.length-1}function y(t,e,n){const r=function(t,e){let n,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:">",i="";for(let o=e;o3&&void 0!==arguments[3]?arguments[3]:">");if(!r)return;let i=r.data;const o=r.index,s=i.search(/\s/);let a=i,c=!0;-1!==s&&(a=i.substring(0,s),i=i.substring(s+1).trimStart());const u=a;if(n){const t=a.indexOf(":");-1!==t&&(a=a.substr(t+1),c=a!==r.data.substr(t+1))}return{tagName:a,tagExp:i,closeIndex:o,attrExpPresent:c,rawTagName:u}}function b(t,e,n){const r=n;let i=1;for(;n",n,`${e} is not closed`);if(t.substring(n+2,o).trim()===e&&(i--,0===i))return{tagContent:t.substring(r,n),i:o};n=o}else if("?"===t[n+1])n=E(t,"?>",n+1,"StopNode is not closed.");else if("!--"===t.substr(n+1,3))n=E(t,"--\x3e",n+3,"StopNode is not closed.");else if("!["===t.substr(n+1,2))n=E(t,"]]>",n,"StopNode is not closed.")-2;else{const r=y(t,n,">");r&&((r&&r.tagName)===e&&"/"!==r.tagExp[r.tagExp.length-1]&&i++,n=r.closeIndex)}}function w(t,e,n){if(e&&"string"==typeof t){const e=t.trim();return"true"===e||"false"!==e&&s(t,n)}return r.isExist(t)?t:""}t.exports=class{constructor(t){this.options=t,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:(t,e)=>String.fromCharCode(Number.parseInt(e,10))},num_hex:{regex:/&#x([0-9a-fA-F]{1,6});/g,val:(t,e)=>String.fromCharCode(Number.parseInt(e,16))}},this.addExternalEntities=c,this.parseXml=p,this.parseTextData=u,this.resolveNameSpace=l,this.buildAttributesMap=f,this.isItStopNode=v,this.replaceEntitiesValue=g,this.readStopNodeData=b,this.saveTextToParentTag=m,this.addChild=d,this.ignoreAttributesFn=a(this.options.ignoreAttributes)}}},338:(t,e,n)=>{const{buildOptions:r}=n(63),i=n(299),{prettify:o}=n(728),s=n(31);t.exports=class{constructor(t){this.externalEntities={},this.options=r(t)}parse(t,e){if("string"==typeof t);else{if(!t.toString)throw new Error("XML data is accepted in String or Bytes[] form.");t=t.toString()}if(e){!0===e&&(e={});const n=s.validate(t,e);if(!0!==n)throw Error(`${n.err.msg}:${n.err.line}:${n.err.col}`)}const n=new i(this.options);n.addExternalEntities(this.externalEntities);const r=n.parseXml(t);return this.options.preserveOrder||void 0===r?r:o(r,this.options)}addEntity(t,e){if(-1!==e.indexOf("&"))throw new Error("Entity value can't have '&'");if(-1!==t.indexOf("&")||-1!==t.indexOf(";"))throw new Error("An entity must be set without '&' and ';'. Eg. use '#xD' for ' '");if("&"===e)throw new Error("An entity with value '&' is not permitted");this.externalEntities[t]=e}}},728:(t,e)=>{function n(t,e,s){let a;const c={};for(let u=0;u0&&(c[e.textNodeName]=a):void 0!==a&&(c[e.textNodeName]=a),c}function r(t){const e=Object.keys(t);for(let t=0;t{t.exports=class{constructor(t){this.tagname=t,this.child=[],this[":@"]={}}add(t,e){"__proto__"===t&&(t="#__proto__"),this.child.push({[t]:e})}addChild(t){"__proto__"===t.tagname&&(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:t=>{function e(t){return!!t.constructor&&"function"==typeof t.constructor.isBuffer&&t.constructor.isBuffer(t)}t.exports=function(t){return null!=t&&(e(t)||function(t){return"function"==typeof t.readFloatLE&&"function"==typeof t.slice&&e(t.slice(0,0))}(t)||!!t._isBuffer)}},542:(t,e,n)=>{!function(){var e=n(298),r=n(526).utf8,i=n(135),o=n(526).bin,s=function(t,n){t.constructor==String?t=n&&"binary"===n.encoding?o.stringToBytes(t):r.stringToBytes(t):i(t)?t=Array.prototype.slice.call(t,0):Array.isArray(t)||t.constructor===Uint8Array||(t=t.toString());for(var a=e.bytesToWords(t),c=8*t.length,u=1732584193,l=-271733879,h=-1732584194,f=271733878,p=0;p>>24)|4278255360&(a[p]<<24|a[p]>>>8);a[c>>>5]|=128<>>9<<4)]=c;var d=s._ff,g=s._gg,m=s._hh,v=s._ii;for(p=0;p>>0,l=l+y>>>0,h=h+b>>>0,f=f+w>>>0}return e.endian([u,l,h,f])};s._ff=function(t,e,n,r,i,o,s){var a=t+(e&n|~e&r)+(i>>>0)+s;return(a<>>32-o)+e},s._gg=function(t,e,n,r,i,o,s){var a=t+(e&r|n&~r)+(i>>>0)+s;return(a<>>32-o)+e},s._hh=function(t,e,n,r,i,o,s){var a=t+(e^n^r)+(i>>>0)+s;return(a<>>32-o)+e},s._ii=function(t,e,n,r,i,o,s){var a=t+(n^(e|~r))+(i>>>0)+s;return(a<>>32-o)+e},s._blocksize=16,s._digestsize=16,t.exports=function(t,n){if(null==t)throw new Error("Illegal argument "+t);var r=e.wordsToBytes(s(t,n));return n&&n.asBytes?r:n&&n.asString?o.bytesToString(r):e.bytesToHex(r)}}()},285:(t,e,n)=>{var r=n(2);t.exports=function(t){return t?("{}"===t.substr(0,2)&&(t="\\{\\}"+t.substr(2)),m(function(t){return t.split("\\\\").join(i).split("\\{").join(o).split("\\}").join(s).split("\\,").join(a).split("\\.").join(c)}(t),!0).map(l)):[]};var i="\0SLASH"+Math.random()+"\0",o="\0OPEN"+Math.random()+"\0",s="\0CLOSE"+Math.random()+"\0",a="\0COMMA"+Math.random()+"\0",c="\0PERIOD"+Math.random()+"\0";function u(t){return parseInt(t,10)==t?parseInt(t,10):t.charCodeAt(0)}function l(t){return t.split(i).join("\\").split(o).join("{").split(s).join("}").split(a).join(",").split(c).join(".")}function h(t){if(!t)return[""];var e=[],n=r("{","}",t);if(!n)return t.split(",");var i=n.pre,o=n.body,s=n.post,a=i.split(",");a[a.length-1]+="{"+o+"}";var c=h(s);return s.length&&(a[a.length-1]+=c.shift(),a.push.apply(a,c)),e.push.apply(e,a),e}function f(t){return"{"+t+"}"}function p(t){return/^-?0\d/.test(t)}function d(t,e){return t<=e}function g(t,e){return t>=e}function m(t,e){var n=[],i=r("{","}",t);if(!i)return[t];var o=i.pre,a=i.post.length?m(i.post,!1):[""];if(/\$$/.test(i.pre))for(var c=0;c=0;if(!w&&!T)return i.post.match(/,.*\}/)?m(t=i.pre+"{"+i.body+s+i.post):[t];if(w)v=i.body.split(/\.\./);else if(1===(v=h(i.body)).length&&1===(v=m(v[0],!1).map(f)).length)return a.map(function(t){return i.pre+v[0]+t});if(w){var N=u(v[0]),A=u(v[1]),O=Math.max(v[0].length,v[1].length),I=3==v.length?Math.abs(u(v[2])):1,x=d;A0){var R=new Array(C+1).join("0");S=P<0?"-"+R+S.slice(1):R+S}}E.push(S)}}else{E=[];for(var L=0;L{function e(t){return e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},e(t)}function n(t){var e="function"==typeof Map?new Map:void 0;return n=function(t){if(null===t||(n=t,-1===Function.toString.call(n).indexOf("[native code]")))return t;var n;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==e){if(e.has(t))return e.get(t);e.set(t,s)}function s(){return r(t,arguments,o(this).constructor)}return s.prototype=Object.create(t.prototype,{constructor:{value:s,enumerable:!1,writable:!0,configurable:!0}}),i(s,t)},n(t)}function r(t,e,n){return r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(t){return!1}}()?Reflect.construct:function(t,e,n){var r=[null];r.push.apply(r,e);var o=new(Function.bind.apply(t,r));return n&&i(o,n.prototype),o},r.apply(null,arguments)}function i(t,e){return i=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},i(t,e)}function o(t){return o=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},o(t)}var s=function(t){function n(t){var r;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,n),(r=function(t,n){return!n||"object"!==e(n)&&"function"!=typeof n?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):n}(this,o(n).call(this,t))).name="ObjectPrototypeMutationError",r}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&i(t,e)}(n,t),n}(n(Error));function a(t,n){for(var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){},i=n.split("."),o=i.length,s=function(e){var n=i[e];if(!t)return{v:void 0};if("+"===n){if(Array.isArray(t))return{v:t.map(function(n,o){var s=i.slice(e+1);return s.length>0?a(n,s.join("."),r):r(t,o,i,e)})};var o=i.slice(0,e).join(".");throw new Error("Object at wildcard (".concat(o,") is not an array"))}t=r(t,n,i,e)},c=0;c2&&void 0!==arguments[2]?arguments[2]:{};if("object"!=e(t)||null===t)return!1;if(void 0===n)return!1;if("number"==typeof n)return n in t;try{var i=!1;return a(t,n,function(t,e,n,o){if(!c(n,o))return t&&t[e];i=r.own?t.hasOwnProperty(e):e in t}),i}catch(t){return!1}},hasOwn:function(t,e,n){return this.has(t,e,n||{own:!0})},isIn:function(t,n,r){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};if("object"!=e(t)||null===t)return!1;if(void 0===n)return!1;try{var o=!1,s=!1;return a(t,n,function(t,n,i,a){return o=o||t===r||!!t&&t[n]===r,s=c(i,a)&&"object"===e(t)&&n in t,t&&t[n]}),i.validPath?o&&s:o}catch(t){return!1}},ObjectPrototypeMutationError:s}},47:(t,e,n)=>{var r=n(410),i=function(t){return"string"==typeof t};function o(t,e){for(var n=[],r=0;r=-1&&!e;n--){var r=n>=0?arguments[n]:a.cwd();if(!i(r))throw new TypeError("Arguments to path.resolve must be strings");r&&(t=r+"/"+t,e="/"===r.charAt(0))}return(e?"/":"")+(t=o(t.split("/"),!e).join("/"))||"."},c.normalize=function(t){var e=c.isAbsolute(t),n="/"===t.substr(-1);return(t=o(t.split("/"),!e).join("/"))||e||(t="."),t&&n&&(t+="/"),(e?"/":"")+t},c.isAbsolute=function(t){return"/"===t.charAt(0)},c.join=function(){for(var t="",e=0;e=0&&""===t[n];n--);return e>n?[]:t.slice(e,n+1)}t=c.resolve(t).substr(1),e=c.resolve(e).substr(1);for(var r=n(t.split("/")),i=n(e.split("/")),o=Math.min(r.length,i.length),s=o,a=0;a{var n=Object.prototype.hasOwnProperty;function r(t){try{return decodeURIComponent(t.replace(/\+/g," "))}catch(t){return null}}function i(t){try{return encodeURIComponent(t)}catch(t){return null}}e.stringify=function(t,e){e=e||"";var r,o,s=[];for(o in"string"!=typeof e&&(e="?"),t)if(n.call(t,o)){if((r=t[o])||null!=r&&!isNaN(r)||(r=""),o=i(o),r=i(r),null===o||null===r)continue;s.push(o+"="+r)}return s.length?e+s.join("&"):""},e.parse=function(t){for(var e,n=/([^=?#&]+)=?([^&]*)/g,i={};e=n.exec(t);){var o=r(e[1]),s=r(e[2]);null===o||null===s||o in i||(i[o]=s)}return i}},670:t=>{t.exports=function(t,e){if(e=e.split(":")[0],!(t=+t))return!1;switch(e){case"http":case"ws":return 80!==t;case"https":case"wss":return 443!==t;case"ftp":return 21!==t;case"gopher":return 70!==t;case"file":return!1}return 0!==t}},494:t=>{const e=/^[-+]?0x[a-fA-F0-9]+$/,n=/^([\-\+])?(0*)(\.[0-9]+([eE]\-?[0-9]+)?|[0-9]+(\.[0-9]+([eE]\-?[0-9]+)?)?)$/;!Number.parseInt&&window.parseInt&&(Number.parseInt=window.parseInt),!Number.parseFloat&&window.parseFloat&&(Number.parseFloat=window.parseFloat);const r={hex:!0,leadingZeros:!0,decimalPoint:".",eNotation:!0};t.exports=function(t){let i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(i=Object.assign({},r,i),!t||"string"!=typeof t)return t;let o=t.trim();if(void 0!==i.skipLike&&i.skipLike.test(o))return t;if(i.hex&&e.test(o))return Number.parseInt(o,16);{const e=n.exec(o);if(e){const n=e[1],r=e[2];let a=(s=e[3])&&-1!==s.indexOf(".")?("."===(s=s.replace(/0+$/,""))?s="0":"."===s[0]?s="0"+s:"."===s[s.length-1]&&(s=s.substr(0,s.length-1)),s):s;const c=e[4]||e[6];if(!i.leadingZeros&&r.length>0&&n&&"."!==o[2])return t;if(!i.leadingZeros&&r.length>0&&!n&&"."!==o[1])return t;{const e=Number(o),s=""+e;return-1!==s.search(/[eE]/)||c?i.eNotation?e:t:-1!==o.indexOf(".")?"0"===s&&""===a||s===a||n&&s==="-"+a?e:t:r?a===s||n+a===s?e:t:o===s||o===n+s?e:t}}return t}var s}},737:(t,e,n)=>{var r=n(670),i=n(647),o=/^[\x00-\x20\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]+/,s=/[\n\r\t]/g,a=/^[A-Za-z][A-Za-z0-9+-.]*:\/\//,c=/:\d+$/,u=/^([a-z][a-z0-9.+-]*:)?(\/\/)?([\\/]+)?([\S\s]*)/i,l=/^[a-zA-Z]:/;function h(t){return(t||"").toString().replace(o,"")}var f=[["#","hash"],["?","query"],function(t,e){return g(e.protocol)?t.replace(/\\/g,"/"):t},["/","pathname"],["@","auth",1],[NaN,"host",void 0,1,1],[/:(\d*)$/,"port",void 0,1],[NaN,"hostname",void 0,1,1]],p={hash:1,query:1};function d(t){var e,n=("undefined"!=typeof window?window:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{}).location||{},r={},i=typeof(t=t||n);if("blob:"===t.protocol)r=new v(unescape(t.pathname),{});else if("string"===i)for(e in r=new v(t,{}),p)delete r[e];else if("object"===i){for(e in t)e in p||(r[e]=t[e]);void 0===r.slashes&&(r.slashes=a.test(t.href))}return r}function g(t){return"file:"===t||"ftp:"===t||"http:"===t||"https:"===t||"ws:"===t||"wss:"===t}function m(t,e){t=(t=h(t)).replace(s,""),e=e||{};var n,r=u.exec(t),i=r[1]?r[1].toLowerCase():"",o=!!r[2],a=!!r[3],c=0;return o?a?(n=r[2]+r[3]+r[4],c=r[2].length+r[3].length):(n=r[2]+r[4],c=r[2].length):a?(n=r[3]+r[4],c=r[3].length):n=r[4],"file:"===i?c>=2&&(n=n.slice(2)):g(i)?n=r[4]:i?o&&(n=n.slice(2)):c>=2&&g(e.protocol)&&(n=r[4]),{protocol:i,slashes:o||g(i),slashesCount:c,rest:n}}function v(t,e,n){if(t=(t=h(t)).replace(s,""),!(this instanceof v))return new v(t,e,n);var o,a,c,u,p,E,y=f.slice(),b=typeof e,w=this,T=0;for("object"!==b&&"string"!==b&&(n=e,e=null),n&&"function"!=typeof n&&(n=i.parse),o=!(a=m(t||"",e=d(e))).protocol&&!a.slashes,w.slashes=a.slashes||o&&e.slashes,w.protocol=a.protocol||e.protocol||"",t=a.rest,("file:"===a.protocol&&(2!==a.slashesCount||l.test(t))||!a.slashes&&(a.protocol||a.slashesCount<2||!g(w.protocol)))&&(y[3]=[/(.*)/,"pathname"]);T{},388:()=>{},805:()=>{},345:()=>{},800:()=>{}},u={};function l(t){var e=u[t];if(void 0!==e)return e.exports;var n=u[t]={id:t,loaded:!1,exports:{}};return c[t].call(n.exports,n,n.exports,l),n.loaded=!0,n.exports}l.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return l.d(e,{a:e}),e},l.d=(t,e)=>{for(var n in e)l.o(e,n)&&!l.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},l.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),l.nmd=t=>(t.paths=[],t.children||(t.children=[]),t);var h={};l.d(h,{hT:()=>U,O4:()=>M,Kd:()=>j,YK:()=>F,UU:()=>un,Gu:()=>q,ky:()=>he,h4:()=>ue,ch:()=>le,hq:()=>ee,i5:()=>fe});var f=l(737),p=l.n(f);function d(t){if(!g(t))throw new Error("Parameter was not an error")}function g(t){return!!t&&"object"==typeof t&&"[object Error]"===(e=t,Object.prototype.toString.call(e))||t instanceof Error;var e}class m extends Error{constructor(t,e){const n=[...arguments],{options:r,shortMessage:i}=function(t){let e,n="";if(0===t.length)e={};else if(g(t[0]))e={cause:t[0]},n=t.slice(1).join(" ")||"";else if(t[0]&&"object"==typeof t[0])e=Object.assign({},t[0]),n=t.slice(1).join(" ")||"";else{if("string"!=typeof t[0])throw new Error("Invalid arguments passed to Layerr");e={},n=n=t.join(" ")||""}return{options:e,shortMessage:n}}(n);let o=i;if(r.cause&&(o=`${o}: ${r.cause.message}`),super(o),this.message=o,r.name&&"string"==typeof r.name?this.name=r.name:this.name="Layerr",r.cause&&Object.defineProperty(this,"_cause",{value:r.cause}),Object.defineProperty(this,"_info",{value:{}}),r.info&&"object"==typeof r.info&&Object.assign(this._info,r.info),Error.captureStackTrace){const t=r.constructorOpt||this.constructor;Error.captureStackTrace(this,t)}}static cause(t){return d(t),t._cause&&g(t._cause)?t._cause:null}static fullStack(t){d(t);const e=m.cause(t);return e?`${t.stack}\ncaused by: ${m.fullStack(e)}`:t.stack??""}static info(t){d(t);const e={},n=m.cause(t);return n&&Object.assign(e,m.info(n)),t._info&&Object.assign(e,t._info),e}toString(){let t=this.name||this.constructor.name||this.constructor.prototype.name;return this.message&&(t=`${t}: ${this.message}`),t}}var v=l(47),E=l.n(v);const y="__PATH_SEPARATOR_POSIX__",b="__PATH_SEPARATOR_WINDOWS__";function w(t){try{const e=t.replace(/\//g,y).replace(/\\\\/g,b);return encodeURIComponent(e).split(b).join("\\\\").split(y).join("/")}catch(t){throw new m(t,"Failed encoding path")}}function T(t){return t.startsWith("/")?t:"/"+t}function N(t){let e=t;return"/"!==e[0]&&(e="/"+e),/^.+\/$/.test(e)&&(e=e.substr(0,e.length-1)),e}function A(t){let e=new(p())(t).pathname;return e.length<=0&&(e="/"),N(e)}function O(){for(var t=arguments.length,e=new Array(t),n=0;n1){var n=t.shift();t[0]=n+t[0]}t[0].match(/^file:\/\/\//)?t[0]=t[0].replace(/^([^/:]+):\/*/,"$1:///"):t[0]=t[0].replace(/^([^/:]+):\/*/,"$1://");for(var r=0;r0&&(i=i.replace(/^[\/]+/,"")),i=r0?"?":"")+s.join("&")}("object"==typeof arguments[0]?arguments[0]:[].slice.call(arguments))}(e.reduce((t,e,n)=>((0===n||"/"!==e||"/"===e&&"/"!==t[t.length-1])&&t.push(e),t),[]))}var I=l(542),x=l.n(I);function _(t,e){const n=t.url.replace("//",""),r=-1==n.indexOf("/")?"/":n.slice(n.indexOf("/")),i=t.method?t.method.toUpperCase():"GET",o=!!/(^|,)\s*auth\s*($|,)/.test(e.qop)&&"auth",s=`00000000${e.nc}`.slice(-8),a=function(t,e,n,r,i,o,s){const a=s||x()(`${e}:${n}:${r}`);return t&&"md5-sess"===t.toLowerCase()?x()(`${a}:${i}:${o}`):a}(e.algorithm,e.username,e.realm,e.password,e.nonce,e.cnonce,e.ha1),c=x()(`${i}:${r}`),u=o?x()(`${a}:${e.nonce}:${s}:${e.cnonce}:${o}:${c}`):x()(`${a}:${e.nonce}:${c}`),l={username:e.username,realm:e.realm,nonce:e.nonce,uri:r,qop:o,response:u,nc:s,cnonce:e.cnonce,algorithm:e.algorithm,opaque:e.opaque},h=[];for(const t in l)l[t]&&("qop"===t||"nc"===t||"algorithm"===t?h.push(`${t}=${l[t]}`):h.push(`${t}="${l[t]}"`));return`Digest ${h.join(", ")}`}function P(t){return"digest"===(t.headers&&t.headers.get("www-authenticate")||"").split(/\s/)[0].toLowerCase()}var S=l(101),C=l.n(S);function R(t){return C().decode(t)}function L(t,e){var n;return`Basic ${n=`${t}:${e}`,C().encode(n)}`}const D="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope?self:"undefined"!=typeof window?window:globalThis,$=D.fetch.bind(D),j=(D.Headers,D.Request),F=D.Response;let U=function(t){return t.Auto="auto",t.Digest="digest",t.None="none",t.Password="password",t.Token="token",t}({}),M=function(t){return t.DataTypeNoLength="data-type-no-length",t.InvalidAuthType="invalid-auth-type",t.InvalidOutputFormat="invalid-output-format",t.LinkUnsupportedAuthType="link-unsupported-auth",t.InvalidUpdateRange="invalid-update-range",t.NotSupported="not-supported",t}({});function k(t,e,n,r,i){switch(t.authType){case U.Auto:e&&n&&(t.headers.Authorization=L(e,n));break;case U.Digest:t.digest=function(t,e,n){return{username:t,password:e,ha1:n,nc:0,algorithm:"md5",hasDigestAuth:!1}}(e,n,i);break;case U.None:break;case U.Password:t.headers.Authorization=L(e,n);break;case U.Token:t.headers.Authorization=`${(o=r).token_type} ${o.access_token}`;break;default:throw new m({info:{code:M.InvalidAuthType}},`Invalid auth type: ${t.authType}`)}var o}l(345),l(800);const B="@@HOTPATCHER",G=()=>{};function V(t){return{original:t,methods:[t],final:!1}}class X{constructor(){this._configuration={registry:{},getEmptyAction:"null"},this.__type__=B}get configuration(){return this._configuration}get getEmptyAction(){return this.configuration.getEmptyAction}set getEmptyAction(t){this.configuration.getEmptyAction=t}control(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!t||t.__type__!==B)throw new Error("Failed taking control of target HotPatcher instance: Invalid type or object");return Object.keys(t.configuration.registry).forEach(n=>{this.configuration.registry.hasOwnProperty(n)?e&&(this.configuration.registry[n]=Object.assign({},t.configuration.registry[n])):this.configuration.registry[n]=Object.assign({},t.configuration.registry[n])}),t._configuration=this.configuration,this}execute(t){const e=this.get(t)||G;for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i0;)i=[e.shift().apply(o,i)];return i[0]}}(...e.methods)}isPatched(t){return!!this.configuration.registry[t]}patch(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const{chain:r=!1}=n;if(this.configuration.registry[t]&&this.configuration.registry[t].final)throw new Error(`Failed patching '${t}': Method marked as being final`);if("function"!=typeof e)throw new Error(`Failed patching '${t}': Provided method is not a function`);if(r)this.configuration.registry[t]?this.configuration.registry[t].methods.push(e):this.configuration.registry[t]=V(e);else if(this.isPatched(t)){const{original:n}=this.configuration.registry[t];this.configuration.registry[t]=Object.assign(V(e),{original:n})}else this.configuration.registry[t]=V(e);return this}patchInline(t,e){this.isPatched(t)||this.patch(t,e);for(var n=arguments.length,r=new Array(n>2?n-2:0),i=2;i1?e-1:0),r=1;r{this.patch(t,e,{chain:!0})}),this}restore(t){if(!this.isPatched(t))throw new Error(`Failed restoring method: No method present for key: ${t}`);if("function"!=typeof this.configuration.registry[t].original)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 W=null;function q(){return W||(W=new X),W}function z(t){return function(t){if("object"!=typeof t||null===t||"[object Object]"!=Object.prototype.toString.call(t))return!1;if(null===Object.getPrototypeOf(t))return!0;let e=t;for(;null!==Object.getPrototypeOf(e);)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e}(t)?Object.assign({},t):Object.setPrototypeOf(Object.assign({},t),Object.getPrototypeOf(t))}function H(){for(var t=arguments.length,e=new Array(t),n=0;n0;){const t=i.shift();r=r?Y(r,t):z(t)}return r}function Y(t,e){const n=z(t);return Object.keys(e).forEach(t=>{n.hasOwnProperty(t)?Array.isArray(e[t])?n[t]=Array.isArray(n[t])?[...n[t],...e[t]]:[...e[t]]:"object"==typeof e[t]&&e[t]?n[t]="object"==typeof n[t]&&n[t]?Y(n[t],e[t]):z(e[t]):n[t]=e[t]:n[t]=e[t]}),n}function Z(t){const e={};for(const n of t.keys())e[n]=t.get(n);return e}function Q(){for(var t=arguments.length,e=new Array(t),n=0;n(Object.keys(e).forEach(n=>{const i=n.toLowerCase();r.hasOwnProperty(i)?t[r[i]]=e[n]:(r[i]=n,t[n]=e[n])}),t),{})}l(805);const K="function"==typeof ArrayBuffer,{toString:J}=Object.prototype;function tt(t){return K&&(t instanceof ArrayBuffer||"[object ArrayBuffer]"===J.call(t))}function et(t){return null!=t&&null!=t.constructor&&"function"==typeof t.constructor.isBuffer&&t.constructor.isBuffer(t)}function nt(t){return function(){for(var e=[],n=0;ne.patchInline("fetch",$,t.url,function(t){let e={};const n={method:t.method};if(t.headers&&(e=Q(e,t.headers)),void 0!==t.data){const[r,i]=function(t){if("string"==typeof t)return[t,{}];if(et(t))return[t,{}];if(tt(t))return[t,{}];if(t&&"object"==typeof t)return[JSON.stringify(t),{"content-type":"application/json"}];throw new Error("Unable to convert request body: Unexpected body type: "+typeof t)}(t.data);n.body=r,e=Q(e,i)}return t.signal&&(n.signal=t.signal),t.withCredentials&&(n.credentials="include"),n.headers=e,n}(t)),t)}var ut=l(285);const lt=t=>{if("string"!=typeof t)throw new TypeError("invalid pattern");if(t.length>65536)throw new TypeError("pattern is too long")},ht={"[: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]},ft=t=>t.replace(/[[\]\\-]/g,"\\$&"),pt=t=>t.join(""),dt=(t,e)=>{const n=e;if("["!==t.charAt(n))throw new Error("not in a brace expression");const r=[],i=[];let o=n+1,s=!1,a=!1,c=!1,u=!1,l=n,h="";t:for(;oh?r.push(ft(h)+"-"+ft(e)):e===h&&r.push(ft(e)),h="",o++):t.startsWith("-]",o+1)?(r.push(ft(e+"-")),o+=2):t.startsWith("-",o+1)?(h=e,o+=2):(r.push(ft(e)),o++)}else c=!0,o++}else u=!0,o++}if(l1&&void 0!==arguments[1]?arguments[1]:{};return e?t.replace(/\[([^\/\\])\]/g,"$1"):t.replace(/((?!\\).|^)\[([^\/\\])\]/g,"$1$2").replace(/\\([^\/])/g,"$1")},mt=new Set(["!","?","+","*","@"]),vt=t=>mt.has(t),Et="(?!\\.)",yt=new Set(["[","."]),bt=new Set(["..","."]),wt=new Set("().*{}+?[]^$\\!"),Tt="[^/]",Nt=Tt+"*?",At=Tt+"+?";class Ot{type;#t;#e;#n=!1;#r=[];#i;#o;#s;#a=!1;#c;#u;#l=!1;constructor(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};this.type=t,t&&(this.#e=!0),this.#i=e,this.#t=this.#i?this.#i.#t:this,this.#c=this.#t===this?n:this.#t.#c,this.#s=this.#t===this?[]:this.#t.#s,"!"!==t||this.#t.#a||this.#s.push(this),this.#o=this.#i?this.#i.#r.length:0}get hasMagic(){if(void 0!==this.#e)return this.#e;for(const t of this.#r)if("string"!=typeof t&&(t.type||t.hasMagic))return this.#e=!0;return this.#e}toString(){return void 0!==this.#u?this.#u:this.type?this.#u=this.type+"("+this.#r.map(t=>String(t)).join("|")+")":this.#u=this.#r.map(t=>String(t)).join("")}#h(){if(this!==this.#t)throw new Error("should only call on root");if(this.#a)return this;let t;for(this.toString(),this.#a=!0;t=this.#s.pop();){if("!"!==t.type)continue;let e=t,n=e.#i;for(;n;){for(let r=e.#o+1;!n.type&&r"string"==typeof t?t:t.toJSON()):[this.type,...this.#r.map(t=>t.toJSON())];return this.isStart()&&!this.type&&t.unshift([]),this.isEnd()&&(this===this.#t||this.#t.#a&&"!"===this.#i?.type)&&t.push({}),t}isStart(){if(this.#t===this)return!0;if(!this.#i?.isStart())return!1;if(0===this.#o)return!0;const t=this.#i;for(let e=0;e1&&void 0!==arguments[1]?arguments[1]:{};const n=new Ot(null,void 0,e);return Ot.#f(t,n,0,e),n}toMMPattern(){if(this!==this.#t)return this.#t.toMMPattern();const t=this.toString(),[e,n,r,i]=this.toRegExpSource();if(!(r||this.#e||this.#c.nocase&&!this.#c.nocaseMagicOnly&&t.toUpperCase()!==t.toLowerCase()))return n;const o=(this.#c.nocase?"i":"")+(i?"u":"");return Object.assign(new RegExp(`^${e}$`,o),{_src:e,_glob:t})}get options(){return this.#c}toRegExpSource(t){const e=t??!!this.#c.dot;if(this.#t===this&&this.#h(),!this.type){const n=this.isStart()&&this.isEnd(),r=this.#r.map(e=>{const[r,i,o,s]="string"==typeof e?Ot.#p(e,this.#e,n):e.toRegExpSource(t);return this.#e=this.#e||o,this.#n=this.#n||s,r}).join("");let i="";if(this.isStart()&&"string"==typeof this.#r[0]&&(1!==this.#r.length||!bt.has(this.#r[0]))){const n=yt,o=e&&n.has(r.charAt(0))||r.startsWith("\\.")&&n.has(r.charAt(2))||r.startsWith("\\.\\.")&&n.has(r.charAt(4)),s=!e&&!t&&n.has(r.charAt(0));i=o?"(?!(?:^|/)\\.\\.?(?:$|/))":s?Et:""}let o="";return this.isEnd()&&this.#t.#a&&"!"===this.#i?.type&&(o="(?:$|\\/)"),[i+r+o,gt(r),this.#e=!!this.#e,this.#n]}const n="*"===this.type||"+"===this.type,r="!"===this.type?"(?:(?!(?:":"(?:";let i=this.#d(e);if(this.isStart()&&this.isEnd()&&!i&&"!"!==this.type){const t=this.toString();return this.#r=[t],this.type=null,this.#e=void 0,[t,gt(this.toString()),!1,!1]}let o=!n||t||e?"":this.#d(!0);o===i&&(o=""),o&&(i=`(?:${i})(?:${o})*?`);let s="";return s="!"===this.type&&this.#l?(this.isStart()&&!e?Et:"")+At:r+i+("!"===this.type?"))"+(!this.isStart()||e||t?"":Et)+Nt+")":"@"===this.type?")":"?"===this.type?")?":"+"===this.type&&o?")":"*"===this.type&&o?")?":`)${this.type}`),[s,gt(i),this.#e=!!this.#e,this.#n]}#d(t){return this.#r.map(e=>{if("string"==typeof e)throw new Error("string type in extglob ast??");const[n,r,i,o]=e.toRegExpSource(t);return this.#n=this.#n||o,n}).filter(t=>!(this.isStart()&&this.isEnd()&&!t)).join("|")}static#p(t,e){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=!1,i="",o=!1;for(let s=0;s2&&void 0!==arguments[2]?arguments[2]:{};return lt(e),!(!n.nocomment&&"#"===e.charAt(0))&&new Kt(e,n).match(t)},xt=/^\*+([^+@!?\*\[\(]*)$/,_t=t=>e=>!e.startsWith(".")&&e.endsWith(t),Pt=t=>e=>e.endsWith(t),St=t=>(t=t.toLowerCase(),e=>!e.startsWith(".")&&e.toLowerCase().endsWith(t)),Ct=t=>(t=t.toLowerCase(),e=>e.toLowerCase().endsWith(t)),Rt=/^\*+\.\*+$/,Lt=t=>!t.startsWith(".")&&t.includes("."),Dt=t=>"."!==t&&".."!==t&&t.includes("."),$t=/^\.\*+$/,jt=t=>"."!==t&&".."!==t&&t.startsWith("."),Ft=/^\*+$/,Ut=t=>0!==t.length&&!t.startsWith("."),Mt=t=>0!==t.length&&"."!==t&&".."!==t,kt=/^\?+([^+@!?\*\[\(]*)?$/,Bt=t=>{let[e,n=""]=t;const r=Wt([e]);return n?(n=n.toLowerCase(),t=>r(t)&&t.toLowerCase().endsWith(n)):r},Gt=t=>{let[e,n=""]=t;const r=qt([e]);return n?(n=n.toLowerCase(),t=>r(t)&&t.toLowerCase().endsWith(n)):r},Vt=t=>{let[e,n=""]=t;const r=qt([e]);return n?t=>r(t)&&t.endsWith(n):r},Xt=t=>{let[e,n=""]=t;const r=Wt([e]);return n?t=>r(t)&&t.endsWith(n):r},Wt=t=>{let[e]=t;const n=e.length;return t=>t.length===n&&!t.startsWith(".")},qt=t=>{let[e]=t;const n=e.length;return t=>t.length===n&&"."!==t&&".."!==t},zt="object"==typeof a&&a?"object"==typeof a.env&&a.env&&a.env.__MINIMATCH_TESTING_PLATFORM__||a.platform:"posix";It.sep="win32"===zt?"\\":"/";const Ht=Symbol("globstar **");It.GLOBSTAR=Ht,It.filter=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return n=>It(n,t,e)};const Yt=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Object.assign({},t,e)};It.defaults=t=>{if(!t||"object"!=typeof t||!Object.keys(t).length)return It;const e=It;return Object.assign(function(n,r){return e(n,r,Yt(t,arguments.length>2&&void 0!==arguments[2]?arguments[2]:{}))},{Minimatch:class extends e.Minimatch{constructor(e){super(e,Yt(t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}))}static defaults(n){return e.defaults(Yt(t,n)).Minimatch}},AST:class extends e.AST{constructor(e,n){super(e,n,Yt(t,arguments.length>2&&void 0!==arguments[2]?arguments[2]:{}))}static fromGlob(n){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return e.AST.fromGlob(n,Yt(t,r))}},unescape:function(n){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return e.unescape(n,Yt(t,r))},escape:function(n){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return e.escape(n,Yt(t,r))},filter:function(n){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return e.filter(n,Yt(t,r))},defaults:n=>e.defaults(Yt(t,n)),makeRe:function(n){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return e.makeRe(n,Yt(t,r))},braceExpand:function(n){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return e.braceExpand(n,Yt(t,r))},match:function(n,r){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return e.match(n,r,Yt(t,i))},sep:e.sep,GLOBSTAR:Ht})};const Zt=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return lt(t),e.nobrace||!/\{(?:(?!\{).)*\}/.test(t)?[t]:ut(t)};It.braceExpand=Zt,It.makeRe=function(t){return new Kt(t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).makeRe()},It.match=function(t,e){const n=new Kt(e,arguments.length>2&&void 0!==arguments[2]?arguments[2]:{});return t=t.filter(t=>n.match(t)),n.options.nonull&&!t.length&&t.push(e),t};const Qt=/[?*]|[+@!]\(.*?\)|\[|\]/;class Kt{options;set;pattern;windowsPathsNoEscape;nonegate;negate;comment;empty;preserveMultipleSlashes;partial;globSet;globParts;nocase;isWindows;platform;windowsNoMagicRoot;regexp;constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};lt(t),e=e||{},this.options=e,this.pattern=t,this.platform=e.platform||zt,this.isWindows="win32"===this.platform,this.windowsPathsNoEscape=!!e.windowsPathsNoEscape||!1===e.allowWindowsEscape,this.windowsPathsNoEscape&&(this.pattern=this.pattern.replace(/\\/g,"/")),this.preserveMultipleSlashes=!!e.preserveMultipleSlashes,this.regexp=null,this.negate=!1,this.nonegate=!!e.nonegate,this.comment=!1,this.empty=!1,this.partial=!!e.partial,this.nocase=!!this.options.nocase,this.windowsNoMagicRoot=void 0!==e.windowsNoMagicRoot?e.windowsNoMagicRoot:!(!this.isWindows||!this.nocase),this.globSet=[],this.globParts=[],this.set=[],this.make()}hasMagic(){if(this.options.magicalBraces&&this.set.length>1)return!0;for(const t of this.set)for(const e of t)if("string"!=typeof e)return!0;return!1}debug(){}make(){const t=this.pattern,e=this.options;if(!e.nocomment&&"#"===t.charAt(0))return void(this.comment=!0);if(!t)return void(this.empty=!0);this.parseNegate(),this.globSet=[...new Set(this.braceExpand())],e.debug&&(this.debug=function(){return console.error(...arguments)}),this.debug(this.pattern,this.globSet);const n=this.globSet.map(t=>this.slashSplit(t));this.globParts=this.preprocess(n),this.debug(this.pattern,this.globParts);let r=this.globParts.map((t,e,n)=>{if(this.isWindows&&this.windowsNoMagicRoot){const e=!(""!==t[0]||""!==t[1]||"?"!==t[2]&&Qt.test(t[2])||Qt.test(t[3])),n=/^[a-z]:/i.test(t[0]);if(e)return[...t.slice(0,4),...t.slice(4).map(t=>this.parse(t))];if(n)return[t[0],...t.slice(1).map(t=>this.parse(t))]}return t.map(t=>this.parse(t))});if(this.debug(this.pattern,r),this.set=r.filter(t=>-1===t.indexOf(!1)),this.isWindows)for(let t=0;t=2?(t=this.firstPhasePreProcess(t),t=this.secondPhasePreProcess(t)):t=e>=1?this.levelOneOptimize(t):this.adjascentGlobstarOptimize(t),t}adjascentGlobstarOptimize(t){return t.map(t=>{let e=-1;for(;-1!==(e=t.indexOf("**",e+1));){let n=e;for(;"**"===t[n+1];)n++;n!==e&&t.splice(e,n-e)}return t})}levelOneOptimize(t){return t.map(t=>0===(t=t.reduce((t,e)=>{const n=t[t.length-1];return"**"===e&&"**"===n?t:".."===e&&n&&".."!==n&&"."!==n&&"**"!==n?(t.pop(),t):(t.push(e),t)},[])).length?[""]:t)}levelTwoFileOptimize(t){Array.isArray(t)||(t=this.slashSplit(t));let e=!1;do{if(e=!1,!this.preserveMultipleSlashes){for(let n=1;nr&&n.splice(r+1,i-r);let o=n[r+1];const s=n[r+2],a=n[r+3];if(".."!==o)continue;if(!s||"."===s||".."===s||!a||"."===a||".."===a)continue;e=!0,n.splice(r,1);const c=n.slice(0);c[r]="**",t.push(c),r--}if(!this.preserveMultipleSlashes){for(let t=1;tt.length)}partsMatch(t,e){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=0,i=0,o=[],s="";for(;r2&&void 0!==arguments[2]&&arguments[2];const r=this.options;if(this.isWindows){const n="string"==typeof t[0]&&/^[a-z]:$/i.test(t[0]),r=!n&&""===t[0]&&""===t[1]&&"?"===t[2]&&/^[a-z]:$/i.test(t[3]),i="string"==typeof e[0]&&/^[a-z]:$/i.test(e[0]),o=r?3:n?0:void 0,s=!i&&""===e[0]&&""===e[1]&&"?"===e[2]&&"string"==typeof e[3]&&/^[a-z]:$/i.test(e[3])?3:i?0:void 0;if("number"==typeof o&&"number"==typeof s){const[n,r]=[t[o],e[s]];n.toLowerCase()===r.toLowerCase()&&(e[s]=n,s>o?e=e.slice(s):o>s&&(t=t.slice(o)))}}const{optimizationLevel:i=1}=this.options;i>=2&&(t=this.levelTwoFileOptimize(t)),this.debug("matchOne",this,{file:t,pattern:e}),this.debug("matchOne",t.length,e.length);for(var o=0,s=0,a=t.length,c=e.length;o>> no match, partial?",t,h,e,f),h!==a))}let i;if("string"==typeof u?(i=l===u,this.debug("string match",u,l,i)):(i=u.test(l),this.debug("pattern match",u,l,i)),!i)return!1}if(o===a&&s===c)return!0;if(o===a)return n;if(s===c)return o===a-1&&""===t[o];throw new Error("wtf?")}braceExpand(){return Zt(this.pattern,this.options)}parse(t){lt(t);const e=this.options;if("**"===t)return Ht;if(""===t)return"";let n,r=null;(n=t.match(Ft))?r=e.dot?Mt:Ut:(n=t.match(xt))?r=(e.nocase?e.dot?Ct:St:e.dot?Pt:_t)(n[1]):(n=t.match(kt))?r=(e.nocase?e.dot?Gt:Bt:e.dot?Vt:Xt)(n):(n=t.match(Rt))?r=e.dot?Dt:Lt:(n=t.match($t))&&(r=jt);const i=Ot.fromGlob(t,this.options).toMMPattern();return r&&"object"==typeof i&&Reflect.defineProperty(i,"test",{value:r}),i}makeRe(){if(this.regexp||!1===this.regexp)return this.regexp;const t=this.set;if(!t.length)return this.regexp=!1,this.regexp;const e=this.options,n=e.noglobstar?"[^/]*?":e.dot?"(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?":"(?:(?!(?:\\/|^)\\.).)*?",r=new Set(e.nocase?["i"]:[]);let i=t.map(t=>{const e=t.map(t=>{if(t instanceof RegExp)for(const e of t.flags.split(""))r.add(e);return"string"==typeof t?t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"):t===Ht?Ht:t._src});return e.forEach((t,r)=>{const i=e[r+1],o=e[r-1];t===Ht&&o!==Ht&&(void 0===o?void 0!==i&&i!==Ht?e[r+1]="(?:\\/|"+n+"\\/)?"+i:e[r]=n:void 0===i?e[r-1]=o+"(?:\\/|"+n+")?":i!==Ht&&(e[r-1]=o+"(?:\\/|\\/"+n+"\\/)"+i,e[r+1]=Ht))}),e.filter(t=>t!==Ht).join("/")}).join("|");const[o,s]=t.length>1?["(?:",")"]:["",""];i="^"+o+i+s+"$",this.negate&&(i="^(?!"+i+").+$");try{this.regexp=new RegExp(i,[...r].join(""))}catch(t){this.regexp=!1}return this.regexp}slashSplit(t){return this.preserveMultipleSlashes?t.split("/"):this.isWindows&&/^\/\/[^\/]+/.test(t)?["",...t.split(/\/+/)]:t.split(/\/+/)}match(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.partial;if(this.debug("match",t,this.pattern),this.comment)return!1;if(this.empty)return""===t;if("/"===t&&e)return!0;const n=this.options;this.isWindows&&(t=t.split("\\").join("/"));const r=this.slashSplit(t);this.debug(this.pattern,"split",r);const i=this.set;this.debug(this.pattern,"set",i);let o=r[r.length-1];if(!o)for(let t=r.length-2;!o&&t>=0;t--)o=r[t];for(let t=0;t1&&void 0!==arguments[1]?arguments[1]:""}Invalid response: ${t.status} ${t.statusText}`);return e.status=t.status,e.response=t,e}function te(t,e){const{status:n}=e;if(401===n&&t.digest)return e;if(n>=400)throw Jt(e);return e}function ee(t,e){return arguments.length>2&&void 0!==arguments[2]&&arguments[2]?{data:e,headers:t.headers?Z(t.headers):{},status:t.status,statusText:t.statusText}:e}It.AST=Ot,It.Minimatch=Kt,It.escape=function(t){let{windowsPathsNoEscape:e=!1}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return e?t.replace(/[?*()[\]]/g,"[$&]"):t.replace(/[?*()[\]\\]/g,"\\$&")},It.unescape=gt;const ne=(re=function(t,e,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};const i=at({url:O(t.remoteURL,w(e)),method:"COPY",headers:{Destination:O(t.remoteURL,w(n)),Overwrite:!1===r.overwrite?"F":"T",Depth:r.shallow?"0":"infinity"}},t,r);return s=function(e){te(t,e)},(o=st(i,t))&&o.then||(o=Promise.resolve(o)),s?o.then(s):o;var o,s},function(){for(var t=[],e=0;e2&&void 0!==arguments[2]?arguments[2]:ae.Original;const r=se().get(t,e);return"array"===n&&!1===Array.isArray(r)?[r]:"object"===n&&Array.isArray(r)?r[0]:r}function ue(t){return new Promise(e=>{e(function(t){const{multistatus:e}=t;if(""===e)return{multistatus:{response:[]}};if(!e)throw new Error("Invalid response: No root multistatus found");const n={multistatus:Array.isArray(e)?e[0]:e};return se().set(n,"multistatus.response",ce(n,"multistatus.response",ae.Array)),se().set(n,"multistatus.response",se().get(n,"multistatus.response").map(t=>function(t){const e=Object.assign({},t);return e.status?se().set(e,"status",ce(e,"status",ae.Object)):(se().set(e,"propstat",ce(e,"propstat",ae.Object)),se().set(e,"propstat.prop",ce(e,"propstat.prop",ae.Object))),e}(t))),n}(new ie.XMLParser({allowBooleanAttributes:!0,attributeNamePrefix:"",textNodeName:"text",ignoreAttributes:!1,removeNSPrefix:!0,numberParseOptions:{hex:!0,leadingZeros:!1},attributeValueProcessor:(t,e,n)=>"true"===e||"false"===e?"true"===e:e,tagValueProcessor(t,e,n){if(!n.endsWith("propstat.prop.displayname"))return e}}).parse(t)))})}function le(t,e){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const{getlastmodified:r=null,getcontentlength:i="0",resourcetype:o=null,getcontenttype:s=null,getetag:a=null}=t,c=o&&"object"==typeof o&&void 0!==o.collection?"directory":"file",u={filename:e,basename:E().basename(e),lastmod:r,size:parseInt(i,10),type:c,etag:"string"==typeof a?a.replace(/"/g,""):null};return"file"===c&&(u.mime=s&&"string"==typeof s?s.split(";")[0]:""),n&&(void 0!==t.displayname&&(t.displayname=String(t.displayname)),u.props=t),u}function he(t,e){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=null;try{t.multistatus.response[0].propstat&&(r=t.multistatus.response[0])}catch(t){}if(!r)throw new Error("Failed getting item stat: bad response");const{propstat:{prop:i,status:o}}=r,[s,a,c]=o.split(" ",3),u=parseInt(a,10);if(u>=400){const t=new Error(`Invalid response: ${u} ${c}`);throw t.status=u,t}return le(i,N(e),n)}function fe(t){switch(String(t)){case"-3":return"unlimited";case"-2":case"-1":return"unknown";default:return parseInt(String(t),10)}}function pe(t,e,n){return n?e?e(t):t:(t&&t.then||(t=Promise.resolve(t)),e?t.then(e):t)}const de=function(t){return function(){for(var e=[],n=0;n2&&void 0!==arguments[2]?arguments[2]:{};const{details:r=!1}=n,i=at({url:O(t.remoteURL,w(e)),method:"PROPFIND",headers:{Accept:"text/plain,application/xml",Depth:"0"}},t,n);return pe(st(i,t),function(n){return te(t,n),pe(n.text(),function(t){return pe(ue(t),function(t){const i=he(t,e,r);return ee(n,i,r)})})})});function ge(t,e,n){return n?e?e(t):t:(t&&t.then||(t=Promise.resolve(t)),e?t.then(e):t)}const me=ve(function(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const r=function(t){if(!t||"/"===t)return[];let e=t;const n=[];do{n.push(e),e=E().dirname(e)}while(e&&"/"!==e);return n}(N(e));r.sort((t,e)=>t.length>e.length?1:e.length>t.length?-1:0);let i=!1;return function(t,e){if("function"==typeof t[be]){var n,r,i,o=t[be]();function u(t){try{for(;!(n=o.next()).done;)if((t=e(n.value))&&t.then){if(!Ne(t))return void t.then(u,i||(i=we.bind(null,r=new Te,2)));t=t.v}r?we(r,1,t):r=t}catch(t){we(r||(r=new Te),2,t)}}if(u(),o.return){var s=function(t){try{n.done||o.return()}catch(t){}return t};if(r&&r.then)return r.then(s,function(t){throw s(t)});s()}return r}if(!("length"in t))throw new TypeError("Object is not iterable");for(var a=[],c=0;c2&&void 0!==arguments[2]?arguments[2]:{};if(!0===n.recursive)return me(t,e,n);const r=at({url:O(t.remoteURL,(i=w(e),i.endsWith("/")?i:i+"/")),method:"MKCOL"},t,n);var i;return ge(st(r,t),function(e){te(t,e)})});var Oe=l(388),Ie=l.n(Oe);const xe=function(t){return function(){for(var e=[],n=0;n2&&void 0!==arguments[2]?arguments[2]:{};const r={};if("object"==typeof n.range&&"number"==typeof n.range.start){let t=`bytes=${n.range.start}-`;"number"==typeof n.range.end&&(t=`${t}${n.range.end}`),r.Range=t}const i=at({url:O(t.remoteURL,w(e)),method:"GET",headers:r},t,n);return s=function(e){if(te(t,e),r.Range&&206!==e.status){const t=new Error(`Invalid response code for partial request: ${e.status}`);throw t.status=e.status,t}return n.callback&&setTimeout(()=>{n.callback(e)},0),e.body},(o=st(i,t))&&o.then||(o=Promise.resolve(o)),s?o.then(s):o;var o,s}),_e=()=>{},Pe=function(t){return function(){for(var e=[],n=0;n2&&void 0!==arguments[2]?arguments[2]:{};const r=at({url:O(t.remoteURL,w(e)),method:"DELETE"},t,n);return o=function(e){te(t,e)},(i=st(r,t))&&i.then||(i=Promise.resolve(i)),o?i.then(o):i;var i,o}),Ce=function(t){return function(){for(var e=[],n=0;n2&&void 0!==arguments[2]?arguments[2]:{};return function(r,i){try{var o=(s=de(t,e,n),a=function(){return!0},s&&s.then||(s=Promise.resolve(s)),a?s.then(a):s)}catch(t){return i(t)}var s,a;return o&&o.then?o.then(void 0,i):o}(0,function(t){if(404===t.status)return!1;throw t})});function Re(t,e,n){return n?e?e(t):t:(t&&t.then||(t=Promise.resolve(t)),e?t.then(e):t)}const Le=function(t){return function(){for(var e=[],n=0;n2&&void 0!==arguments[2]?arguments[2]:{};const r=at({url:O(t.remoteURL,w(e),"/"),method:"PROPFIND",headers:{Accept:"text/plain,application/xml",Depth:n.deep?"infinity":"1"}},t,n);return Re(st(r,t),function(r){return te(t,r),Re(r.text(),function(i){if(!i)throw new Error("Failed parsing directory contents: Empty response");return Re(ue(i),function(i){const o=T(e);let s=function(t,e,n){let r=arguments.length>3&&void 0!==arguments[3]&&arguments[3],i=arguments.length>4&&void 0!==arguments[4]&&arguments[4];const o=E().join(e,"/"),{multistatus:{response:s}}=t,a=s.map(t=>{const e=function(t){try{return t.replace(/^https?:\/\/[^\/]+/,"")}catch(t){throw new m(t,"Failed normalising HREF")}}(t.href),{propstat:{prop:n}}=t;return le(n,"/"===o?decodeURIComponent(N(e)):N(E().relative(decodeURIComponent(o),decodeURIComponent(e))),r)});return i?a:a.filter(t=>t.basename&&("file"===t.type||t.filename!==n.replace(/\/$/,"")))}(i,T(t.remoteBasePath||t.remotePath),o,n.details,n.includeSelf);return n.glob&&(s=function(t,e){return t.filter(t=>It(t.filename,e,{matchBase:!0}))}(s,n.glob)),ee(r,s,n.details)})})})});function De(t){return function(){for(var e=[],n=0;n2&&void 0!==arguments[2]?arguments[2]:{};const r=at({url:O(t.remoteURL,w(e)),method:"GET",headers:{Accept:"text/plain"},transformResponse:[Me]},t,n);return je(st(r,t),function(e){return te(t,e),je(e.text(),function(t){return ee(e,t,n.details)})})});function je(t,e,n){return n?e?e(t):t:(t&&t.then||(t=Promise.resolve(t)),e?t.then(e):t)}const Fe=De(function(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const r=at({url:O(t.remoteURL,w(e)),method:"GET"},t,n);return je(st(r,t),function(e){let r;return te(t,e),function(t,e){var n=t();return n&&n.then?n.then(e):e()}(function(){return je(e.arrayBuffer(),function(t){r=t})},function(){return ee(e,r,n.details)})})}),Ue=De(function(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const{format:r="binary"}=n;if("binary"!==r&&"text"!==r)throw new m({info:{code:M.InvalidOutputFormat}},`Invalid output format: ${r}`);return"text"===r?$e(t,e,n):Fe(t,e,n)}),Me=t=>t;function ke(t){return new ie.XMLBuilder({attributeNamePrefix:"@_",format:!0,ignoreAttributes:!1,suppressEmptyNode:!0}).build(Be({lockinfo:{"@_xmlns:d":"DAV:",lockscope:{exclusive:{}},locktype:{write:{}},owner:{href:t}}},"d"))}function Be(t,e){const n={...t};for(const t in n)n.hasOwnProperty(t)&&(n[t]&&"object"==typeof n[t]&&-1===t.indexOf(":")?(n[`${e}:${t}`]=Be(n[t],e),delete n[t]):!1===/^@_/.test(t)&&(n[`${e}:${t}`]=n[t],delete n[t]));return n}function Ge(t,e,n){return n?e?e(t):t:(t&&t.then||(t=Promise.resolve(t)),e?t.then(e):t)}function Ve(t){return function(){for(var e=[],n=0;n3&&void 0!==arguments[3]?arguments[3]:{};const i=at({url:O(t.remoteURL,w(e)),method:"UNLOCK",headers:{"Lock-Token":n}},t,r);return Ge(st(i,t),function(e){if(te(t,e),204!==e.status&&200!==e.status)throw Jt(e)})}),We=Ve(function(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const{refreshToken:r,timeout:i=qe}=n,o={Accept:"text/plain,application/xml",Timeout:i};r&&(o.If=r);const s=at({url:O(t.remoteURL,w(e)),method:"LOCK",headers:o,data:ke(t.contactHref)},t,n);return Ge(st(s,t),function(e){return te(t,e),Ge(e.text(),function(t){const n=(o=t,new ie.XMLParser({removeNSPrefix:!0,parseAttributeValue:!0,parseTagValue:!0}).parse(o)),r=se().get(n,"prop.lockdiscovery.activelock.locktoken.href"),i=se().get(n,"prop.lockdiscovery.activelock.timeout");var o;if(!r)throw Jt(e,"No lock token received: ");return{token:r,serverTimeout:i}})})}),qe="Infinite, Second-4100000000";function ze(t,e,n){return n?e?e(t):t:(t&&t.then||(t=Promise.resolve(t)),e?t.then(e):t)}const He=function(t){return function(){for(var e=[],n=0;n1&&void 0!==arguments[1]?arguments[1]:{};const n=e.path||"/",r=at({url:O(t.remoteURL,n),method:"PROPFIND",headers:{Accept:"text/plain,application/xml",Depth:"0"}},t,e);return ze(st(r,t),function(n){return te(t,n),ze(n.text(),function(t){return ze(ue(t),function(t){const r=function(t){try{const[e]=t.multistatus.response,{propstat:{prop:{"quota-used-bytes":n,"quota-available-bytes":r}}}=e;return void 0!==n&&void 0!==r?{used:parseInt(String(n),10),available:fe(r)}:null}catch(t){}return null}(t);return ee(n,r,e.details)})})})});function Ye(t,e,n){return n?e?e(t):t:(t&&t.then||(t=Promise.resolve(t)),e?t.then(e):t)}const Ze=function(t){return function(){for(var e=[],n=0;n2&&void 0!==arguments[2]?arguments[2]:{};const{details:r=!1}=n,i=at({url:O(t.remoteURL,w(e)),method:"SEARCH",headers:{Accept:"text/plain,application/xml","Content-Type":t.headers["Content-Type"]||"application/xml; charset=utf-8"}},t,n);return Ye(st(i,t),function(n){return te(t,n),Ye(n.text(),function(t){return Ye(ue(t),function(t){const i=function(t,e,n){const r={truncated:!1,results:[]};return r.truncated=t.multistatus.response.some(t=>"507"===(t.status||t.propstat?.status).split(" ",3)?.[1]&&t.href.replace(/\/$/,"").endsWith(w(e).replace(/\/$/,""))),t.multistatus.response.forEach(t=>{if(void 0===t.propstat)return;const e=t.href.split("/").map(decodeURIComponent).join("/");r.results.push(le(t.propstat.prop,e,n))}),r}(t,e,r);return ee(n,i,r)})})})}),Qe=function(t){return function(){for(var e=[],n=0;n3&&void 0!==arguments[3]?arguments[3]:{};const i=at({url:O(t.remoteURL,w(e)),method:"MOVE",headers:{Destination:O(t.remoteURL,w(n)),Overwrite:!1===r.overwrite?"F":"T"}},t,r);return s=function(e){te(t,e)},(o=st(i,t))&&o.then||(o=Promise.resolve(o)),s?o.then(s):o;var o,s});var Ke=l(172);const Je=function(t){return function(){for(var e=[],n=0;n3&&void 0!==arguments[3]?arguments[3]:{};const{contentLength:i=!0,overwrite:o=!0}=r,s={"Content-Type":"application/octet-stream"};!1===i||(s["Content-Length"]="number"==typeof i?`${i}`:`${function(t){if(tt(t))return t.byteLength;if(et(t))return t.length;if("string"==typeof t)return(0,Ke.d)(t);throw new m({info:{code:M.DataTypeNoLength}},"Cannot calculate data length: Invalid type")}(n)}`),o||(s["If-None-Match"]="*");const a=at({url:O(t.remoteURL,w(e)),method:"PUT",headers:s,data:n},t,r);return u=function(e){try{te(t,e)}catch(t){const e=t;if(412!==e.status||o)throw e;return!1}return!0},(c=st(a,t))&&c.then||(c=Promise.resolve(c)),u?c.then(u):c;var c,u}),tn=function(t){return function(){for(var e=[],n=0;n2&&void 0!==arguments[2]?arguments[2]:{};const r=at({url:O(t.remoteURL,w(e)),method:"OPTIONS"},t,n);return o=function(e){try{te(t,e)}catch(t){throw t}return{compliance:(e.headers.get("DAV")??"").split(",").map(t=>t.trim()),server:e.headers.get("Server")??""}},(i=st(r,t))&&i.then||(i=Promise.resolve(i)),o?i.then(o):i;var i,o});function en(t,e,n){return n?e?e(t):t:(t&&t.then||(t=Promise.resolve(t)),e?t.then(e):t)}const nn=sn(function(t,e,n,r,i){let o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{};if(n>r||n<0)throw new m({info:{code:M.InvalidUpdateRange}},`Invalid update range ${n} for partial update`);const s={"Content-Type":"application/octet-stream","Content-Length":""+(r-n+1),"Content-Range":`bytes ${n}-${r}/*`},a=at({url:O(t.remoteURL,w(e)),method:"PUT",headers:s,data:i},t,o);return en(st(a,t),function(e){te(t,e)})});function rn(t,e){var n=t();return n&&n.then?n.then(e):e(n)}const on=sn(function(t,e,n,r,i){let o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{};if(n>r||n<0)throw new m({info:{code:M.InvalidUpdateRange}},`Invalid update range ${n} for partial update`);const s={"Content-Type":"application/x-sabredav-partialupdate","Content-Length":""+(r-n+1),"X-Update-Range":`bytes=${n}-${r}`},a=at({url:O(t.remoteURL,w(e)),method:"PATCH",headers:s,data:i},t,o);return en(st(a,t),function(e){te(t,e)})});function sn(t){return function(){for(var e=[],n=0;n5&&void 0!==arguments[5]?arguments[5]:{};return en(tn(t,e,o),function(s){let a=!1;return rn(function(){if(s.compliance.includes("sabredav-partialupdate"))return en(on(t,e,n,r,i,o),function(t){return a=!0,t})},function(c){let u=!1;return a?c:rn(function(){if(s.server.includes("Apache")&&s.compliance.includes(""))return en(nn(t,e,n,r,i,o),function(t){return u=!0,t})},function(t){if(u)return t;throw new m({info:{code:M.NotSupported}},"Not supported")})})})}),cn="https://github.com/perry-mitchell/webdav-client/blob/master/LOCK_CONTACT.md";function un(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{authType:n=null,remoteBasePath:r,contactHref:i=cn,ha1:o,headers:s={},httpAgent:a,httpsAgent:c,password:u,token:l,username:h,withCredentials:f}=e;let p=n;p||(p=h||u?U.Password:U.None);const d={authType:p,remoteBasePath:r,contactHref:i,ha1:o,headers:Object.assign({},s),httpAgent:a,httpsAgent:c,password:u,remotePath:A(t),remoteURL:t,token:l,username:h,withCredentials:f};return k(d,h,u,l,o),{copyFile:(t,e,n)=>ne(d,t,e,n),createDirectory:(t,e)=>Ae(d,t,e),createReadStream:(t,e)=>function(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const r=new(0,Ie().PassThrough);return xe(t,e,n).then(t=>{t.pipe(r)}).catch(t=>{r.emit("error",t)}),r}(d,t,e),createWriteStream:(t,e,n)=>function(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:_e;const i=new(0,Ie().PassThrough),o={};!1===n.overwrite&&(o["If-None-Match"]="*");const s=at({url:O(t.remoteURL,w(e)),method:"PUT",headers:o,data:i,maxRedirects:0},t,n);return st(s,t).then(e=>te(t,e)).then(t=>{setTimeout(()=>{r(t)},0)}).catch(t=>{i.emit("error",t)}),i}(d,t,e,n),customRequest:(t,e)=>Pe(d,t,e),deleteFile:(t,e)=>Se(d,t,e),exists:(t,e)=>Ce(d,t,e),getDirectoryContents:(t,e)=>Le(d,t,e),getFileContents:(t,e)=>Ue(d,t,e),getFileDownloadLink:t=>function(t,e){let n=O(t.remoteURL,w(e));const r=/^https:/i.test(n)?"https":"http";switch(t.authType){case U.None:break;case U.Password:{const e=R(t.headers.Authorization.replace(/^Basic /i,"").trim());n=n.replace(/^https?:\/\//,`${r}://${e}@`);break}default:throw new m({info:{code:M.LinkUnsupportedAuthType}},`Unsupported auth type for file link: ${t.authType}`)}return n}(d,t),getFileUploadLink:t=>function(t,e){let n=`${O(t.remoteURL,w(e))}?Content-Type=application/octet-stream`;const r=/^https:/i.test(n)?"https":"http";switch(t.authType){case U.None:break;case U.Password:{const e=R(t.headers.Authorization.replace(/^Basic /i,"").trim());n=n.replace(/^https?:\/\//,`${r}://${e}@`);break}default:throw new m({info:{code:M.LinkUnsupportedAuthType}},`Unsupported auth type for file link: ${t.authType}`)}return n}(d,t),getHeaders:()=>Object.assign({},d.headers),getQuota:t=>He(d,t),lock:(t,e)=>We(d,t,e),moveFile:(t,e,n)=>Qe(d,t,e,n),putFileContents:(t,e,n)=>Je(d,t,e,n),partialUpdateFileContents:(t,e,n,r,i)=>an(d,t,e,n,r,i),getDAVCompliance:t=>tn(d,t),search:(t,e)=>Ze(d,t,e),setHeaders:t=>{d.headers=Object.assign({},t)},stat:(t,e)=>de(d,t,e),unlock:(t,e,n)=>Xe(d,t,e,n)}}var ln=h.UU,hn=h.Gu;function fn(t,e){return t=t.replace(/\\/g,"/").replace(/\/+$/g,"").replace(/.*\//,""),e&&e!==t&&t.endsWith(e)?t.substring(0,t.length-e.length):t}function pn(t){const e=(t=t.replaceAll(/\\/g,"/")).split("/");return e.length<=1?".":(e.pop(),1===e.length&&""===e[0]?"/":e.join("/"))}const dn=(0,n(35947).YK)().setApp("@f7cloud/files").detectUser().build();var gn=(t=>(t.Folder="folder",t.File="file",t))(gn||{}),mn=(t=>(t[t.NONE=0]="NONE",t[t.CREATE=4]="CREATE",t[t.READ=1]="READ",t[t.UPDATE=2]="UPDATE",t[t.DELETE=8]="DELETE",t[t.SHARE=16]="SHARE",t[t.ALL=31]="ALL",t))(mn||{});const vn=function(t,e){return null!==t.match(e)},En=(t,e)=>{if(t.id&&"number"!=typeof t.id)throw new Error("Invalid id type of value");if(!t.source)throw new Error("Missing mandatory source");try{new URL(t.source)}catch(t){throw new Error("Invalid source format, source must be a valid URL")}if(!t.source.startsWith("http"))throw new Error("Invalid source format, only http(s) is supported");if(t.displayname&&"string"!=typeof t.displayname)throw new Error("Invalid displayname type");if(t.mtime&&!(t.mtime instanceof Date))throw new Error("Invalid mtime type");if(t.crtime&&!(t.crtime instanceof Date))throw new Error("Invalid crtime type");if(!t.mime||"string"!=typeof t.mime||!t.mime.match(/^[-\w.]+\/[-+\w.]+$/gi))throw new Error("Missing or invalid mandatory mime");if("size"in t&&"number"!=typeof t.size&&void 0!==t.size)throw new Error("Invalid size type");if("permissions"in t&&void 0!==t.permissions&&!("number"==typeof t.permissions&&t.permissions>=mn.NONE&&t.permissions<=mn.ALL))throw new Error("Invalid permissions");if(t.owner&&null!==t.owner&&"string"!=typeof t.owner)throw new Error("Invalid owner type");if(t.attributes&&"object"!=typeof t.attributes)throw new Error("Invalid attributes type");if(t.root&&"string"!=typeof t.root)throw new Error("Invalid root type");if(t.root&&!t.root.startsWith("/"))throw new Error("Root must start with a leading slash");if(t.root&&!t.source.includes(t.root))throw new Error("Root must be part of the source");if(t.root&&vn(t.source,e)){const n=t.source.match(e)[0];if(!t.source.includes(function(...t){if(arguments.length<1)return"";const e=t.filter(t=>t.length>0);if(e.length<1)return"";const n=e[e.length-1],r="/"===e[0].charAt(0),i="/"===n.charAt(n.length-1),o=e.reduce((t,e)=>t.concat(e.split("/")),[]);let s=!r;const a=o.reduce((t,e)=>""===e?t:s?(s=!1,t+e):t+"/"+e,"");return i?a+"/":a}(n,t.root)))throw new Error("The root must be relative to the service. e.g /files/emma")}if(t.status&&!Object.values(yn).includes(t.status))throw new Error("Status must be a valid NodeStatus")};var yn=(t=>(t.NEW="new",t.FAILED="failed",t.LOADING="loading",t.LOCKED="locked",t))(yn||{});class bn{_data;_attributes;_knownDavService=/(remote|public)\.php\/(web)?dav/i;readonlyAttributes=Object.entries(Object.getOwnPropertyDescriptors(bn.prototype)).filter(t=>"function"==typeof t[1].get&&"__proto__"!==t[0]).map(t=>t[0]);handler={set:(t,e,n)=>!this.readonlyAttributes.includes(e)&&Reflect.set(t,e,n),deleteProperty:(t,e)=>!this.readonlyAttributes.includes(e)&&Reflect.deleteProperty(t,e),get:(t,e,n)=>this.readonlyAttributes.includes(e)?(dn.warn(`Accessing "Node.attributes.${e}" is deprecated, access it directly on the Node instance.`),Reflect.get(this,e)):Reflect.get(t,e,n)};constructor(t,e){t.mime||(t.mime="application/octet-stream"),En(t,e||this._knownDavService),this._data={displayname:t.attributes?.displayname,...t,attributes:{}},this._attributes=new Proxy(this._data.attributes,this.handler),this.update(t.attributes??{}),e&&(this._knownDavService=e)}get source(){return this._data.source.replace(/\/$/i,"")}get encodedSource(){const{origin:t}=new URL(this.source);return t+((e=this.source.slice(t.length))?e.split("/").map(encodeURIComponent).join("/"):e);var e}get basename(){return fn(this.source)}get displayname(){return this._data.displayname||this.basename}set displayname(t){En({...this._data,displayname:t},this._knownDavService),this._data.displayname=t}get extension(){return function(t){const e=fn(t),n=e.lastIndexOf(".");return n>0?e.substring(n):""}(this.source)}get dirname(){if(this.root){let t=this.source;this.isDavResource&&(t=t.split(this._knownDavService).pop());const e=t.indexOf(this.root),n=this.root.replace(/\/$/,"");return pn(t.slice(e+n.length)||"/")}return pn(new URL(this.source).pathname)}get mime(){return this._data.mime||"application/octet-stream"}set mime(t){t??="application/octet-stream",En({...this._data,mime:t},this._knownDavService),this._data.mime=t}get mtime(){return this._data.mtime}set mtime(t){En({...this._data,mtime:t},this._knownDavService),this._data.mtime=t}get crtime(){return this._data.crtime}get size(){return this._data.size}set size(t){En({...this._data,size:t},this._knownDavService),this.updateMtime(),this._data.size=t}get attributes(){return this._attributes}get permissions(){return null!==this.owner||this.isDavResource?void 0!==this._data.permissions?this._data.permissions:mn.NONE:mn.READ}set permissions(t){En({...this._data,permissions:t},this._knownDavService),this.updateMtime(),this._data.permissions=t}get owner(){return this.isDavResource?this._data.owner:null}get isDavResource(){return vn(this.source,this._knownDavService)}get isDavRessource(){return this.isDavResource}get root(){return this._data.root?this._data.root.replace(/^(.+)\/$/,"$1"):this.isDavResource&&pn(this.source).split(this._knownDavService).pop()||null}get path(){if(this.root){let t=this.source;this.isDavResource&&(t=t.split(this._knownDavService).pop());const e=t.indexOf(this.root),n=this.root.replace(/\/$/,"");return t.slice(e+n.length)||"/"}return(this.dirname+"/"+this.basename).replace(/\/\//g,"/")}get fileid(){return this._data?.id}get status(){return this._data?.status}set status(t){En({...this._data,status:t},this._knownDavService),this._data.status=t}get data(){return structuredClone(this._data)}move(t){En({...this._data,source:t},this._knownDavService);const e=this.basename;this._data.source=t,this.displayname===e&&this.basename!==e&&(this.displayname=this.basename)}rename(t){if(t.includes("/"))throw new Error("Invalid basename");this.move(pn(this.source)+"/"+t)}updateMtime(){this._data.mtime&&(this._data.mtime=new Date)}update(t){for(const[e,n]of Object.entries(t))try{void 0===n?delete this.attributes[e]:this.attributes[e]=n}catch(t){if(t instanceof TypeError)continue;throw t}}}class wn extends bn{get type(){return gn.File}clone(){return new wn(this.data)}}class Tn extends bn{constructor(t){super({...t,mime:"httpd/unix-directory"})}get type(){return gn.Folder}get extension(){return null}get mime(){return"httpd/unix-directory"}clone(){return new Tn(this.data)}}const Nn=["d:getcontentlength","d:getcontenttype","d:getetag","d:getlastmodified","d:creationdate","d:displayname","d:quota-available-bytes","d:resourcetype","nc:has-preview","nc:is-encrypted","nc:mount-type","oc:comments-unread","oc:favorite","oc:fileid","oc:owner-display-name","oc:owner-id","oc:permissions","oc:size"],An={d:"DAV:",nc:"http://f7cloud.org/ns",oc:"http://owncloud.org/ns",ocs:"http://open-collaboration-services.org/ns"},On=function(t,e={nc:"http://f7cloud.org/ns"}){void 0===window._nc_dav_properties&&(window._nc_dav_properties=[...Nn],window._nc_dav_namespaces={...An});const n={...window._nc_dav_namespaces,...e};return window._nc_dav_properties.find(e=>e===t)?(dn.warn(`${t} already registered`,{prop:t}),!1):t.startsWith("<")||2!==t.split(":").length?(dn.error(`${t} is not valid. See example: 'oc:fileid'`,{prop:t}),!1):n[t.split(":")[0]]?(window._nc_dav_properties.push(t),window._nc_dav_namespaces=n,!0):(dn.error(`${t} namespace unknown`,{prop:t,namespaces:n}),!1)},In=function(){return void 0===window._nc_dav_properties&&(window._nc_dav_properties=[...Nn]),window._nc_dav_properties.map(t=>`<${t} />`).join(" ")},xn=function(){return void 0===window._nc_dav_namespaces&&(window._nc_dav_namespaces={...An}),Object.keys(window._nc_dav_namespaces).map(t=>`xmlns:${t}="${window._nc_dav_namespaces?.[t]}"`).join(" ")},_n=function(){return`\n\t\t\n\t\t\t\n\t\t\t\t${In()}\n\t\t\t\n\t\t`},Pn=function(t){return`\n\n\t\n\t\t\n\t\t\t\n\t\t\t\t${In()}\n\t\t\t\n\t\t\n\t\t\n\t\t\t\n\t\t\t\t/files/${(0,r.HW)()?.uid}/\n\t\t\t\tinfinity\n\t\t\t\n\t\t\n\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\thttpd/unix-directory\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t0\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t${t}\n\t\t\t\t\n\t\t\t\n\t\t\n\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t\n\t\t\n\t\t\t100\n\t\t\t0\n\t\t\n\t\n`},Sn=(0,i.f)()?`/files/${(0,i.G)()}`:`/files/${(0,r.HW)()?.uid}`,Cn=function(){const t=(0,o.dC)("dav");return(0,i.f)()?t.replace("remote.php","public.php"):t}(),Rn=function(t=Cn,e={}){const n=ln(t,{headers:e});function i(t){n.setHeaders({...e,"X-Requested-With":"XMLHttpRequest",requesttoken:t??""})}return(0,r.zo)(i),i((0,r.do)()),hn().patch("fetch",(t,e)=>{const n=e.headers;return n?.method&&(e.method=n.method,delete n.method),fetch(t,e)}),n},Ln=(t,e="/",n=Sn)=>{const r=new AbortController;return new s.CancelablePromise(async(i,o,s)=>{s(()=>r.abort());try{i((await t.getDirectoryContents(`${n}${e}`,{signal:r.signal,details:!0,data:`\n\t\t\n\t\t\t\n\t\t\t\t${In()}\n\t\t\t\n\t\t\t\n\t\t\t\t1\n\t\t\t\n\t\t`,headers:{method:"REPORT"},includeSelf:!0})).data.filter(t=>t.filename!==e).map(t=>Dn(t,n)))}catch(t){o(t)}})},Dn=function(t,e=Sn,n=Cn){let o=(0,r.HW)()?.uid;if((0,i.f)())o=o??"anonymous";else if(!o)throw new Error("No user id found");const s=t.props,a=function(t=""){let e=mn.NONE;return t?((t.includes("C")||t.includes("K"))&&(e|=mn.CREATE),t.includes("G")&&(e|=mn.READ),(t.includes("W")||t.includes("N")||t.includes("V"))&&(e|=mn.UPDATE),t.includes("D")&&(e|=mn.DELETE),t.includes("R")&&(e|=mn.SHARE),e):e}(s?.permissions),c=String(s?.["owner-id"]||o),u=s.fileid||0,l=new Date(Date.parse(t.lastmod)),h=new Date(Date.parse(s.creationdate)),f={id:u,source:`${n}${t.filename}`,mtime:isNaN(l.getTime())||0===l.getTime()?void 0:l,crtime:isNaN(h.getTime())||0===h.getTime()?void 0:h,mime:t.mime||"application/octet-stream",displayname:void 0!==s.displayname?String(s.displayname):void 0,size:s?.size||Number.parseInt(s.getcontentlength||"0"),status:u<0?yn.FAILED:void 0,permissions:a,owner:c,root:e,attributes:{...t,...s,hasPreview:s?.["has-preview"]}};return delete f.attributes?.props,"file"===t.type?new wn(f):new Tn(f)};EventTarget;var $n,jn,Fn,Un,Mn=n(83141),kn=n(87485),Bn=n(53334),Gn=n(65606),Vn=n(48287).Buffer;function Xn(){if(jn)return $n;jn=1;const t="object"==typeof Gn&&Gn.env&&Gn.env.NODE_DEBUG&&/\bsemver\b/i.test(Gn.env.NODE_DEBUG)?(...t)=>console.error("SEMVER",...t):()=>{};return $n=t}function Wn(){if(Un)return Fn;Un=1;const t=Number.MAX_SAFE_INTEGER||9007199254740991;return Fn={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:16,MAX_SAFE_BUILD_LENGTH:250,MAX_SAFE_INTEGER:t,RELEASE_TYPES:["major","premajor","minor","preminor","patch","prepatch","prerelease"],SEMVER_SPEC_VERSION:"2.0.0",FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}}var qn,zn,Hn,Yn,Zn,Qn,Kn,Jn,tr,er,nr,rr,ir,or={exports:{}};function sr(){if(Kn)return Qn;Kn=1;const t=Xn(),{MAX_LENGTH:e,MAX_SAFE_INTEGER:n}=Wn(),{safeRe:r,t:i}=(qn||(qn=1,function(t,e){const{MAX_SAFE_COMPONENT_LENGTH:n,MAX_SAFE_BUILD_LENGTH:r,MAX_LENGTH:i}=Wn(),o=Xn(),s=(e=t.exports={}).re=[],a=e.safeRe=[],c=e.src=[],u=e.safeSrc=[],l=e.t={};let h=0;const f="[a-zA-Z0-9-]",p=[["\\s",1],["\\d",i],[f,r]],d=(t,e,n)=>{const r=(t=>{for(const[e,n]of p)t=t.split(`${e}*`).join(`${e}{0,${n}}`).split(`${e}+`).join(`${e}{1,${n}}`);return t})(e),i=h++;o(t,i,e),l[t]=i,c[i]=e,u[i]=r,s[i]=new RegExp(e,n?"g":void 0),a[i]=new RegExp(r,n?"g":void 0)};d("NUMERICIDENTIFIER","0|[1-9]\\d*"),d("NUMERICIDENTIFIERLOOSE","\\d+"),d("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${f}*`),d("MAINVERSION",`(${c[l.NUMERICIDENTIFIER]})\\.(${c[l.NUMERICIDENTIFIER]})\\.(${c[l.NUMERICIDENTIFIER]})`),d("MAINVERSIONLOOSE",`(${c[l.NUMERICIDENTIFIERLOOSE]})\\.(${c[l.NUMERICIDENTIFIERLOOSE]})\\.(${c[l.NUMERICIDENTIFIERLOOSE]})`),d("PRERELEASEIDENTIFIER",`(?:${c[l.NONNUMERICIDENTIFIER]}|${c[l.NUMERICIDENTIFIER]})`),d("PRERELEASEIDENTIFIERLOOSE",`(?:${c[l.NONNUMERICIDENTIFIER]}|${c[l.NUMERICIDENTIFIERLOOSE]})`),d("PRERELEASE",`(?:-(${c[l.PRERELEASEIDENTIFIER]}(?:\\.${c[l.PRERELEASEIDENTIFIER]})*))`),d("PRERELEASELOOSE",`(?:-?(${c[l.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${c[l.PRERELEASEIDENTIFIERLOOSE]})*))`),d("BUILDIDENTIFIER",`${f}+`),d("BUILD",`(?:\\+(${c[l.BUILDIDENTIFIER]}(?:\\.${c[l.BUILDIDENTIFIER]})*))`),d("FULLPLAIN",`v?${c[l.MAINVERSION]}${c[l.PRERELEASE]}?${c[l.BUILD]}?`),d("FULL",`^${c[l.FULLPLAIN]}$`),d("LOOSEPLAIN",`[v=\\s]*${c[l.MAINVERSIONLOOSE]}${c[l.PRERELEASELOOSE]}?${c[l.BUILD]}?`),d("LOOSE",`^${c[l.LOOSEPLAIN]}$`),d("GTLT","((?:<|>)?=?)"),d("XRANGEIDENTIFIERLOOSE",`${c[l.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),d("XRANGEIDENTIFIER",`${c[l.NUMERICIDENTIFIER]}|x|X|\\*`),d("XRANGEPLAIN",`[v=\\s]*(${c[l.XRANGEIDENTIFIER]})(?:\\.(${c[l.XRANGEIDENTIFIER]})(?:\\.(${c[l.XRANGEIDENTIFIER]})(?:${c[l.PRERELEASE]})?${c[l.BUILD]}?)?)?`),d("XRANGEPLAINLOOSE",`[v=\\s]*(${c[l.XRANGEIDENTIFIERLOOSE]})(?:\\.(${c[l.XRANGEIDENTIFIERLOOSE]})(?:\\.(${c[l.XRANGEIDENTIFIERLOOSE]})(?:${c[l.PRERELEASELOOSE]})?${c[l.BUILD]}?)?)?`),d("XRANGE",`^${c[l.GTLT]}\\s*${c[l.XRANGEPLAIN]}$`),d("XRANGELOOSE",`^${c[l.GTLT]}\\s*${c[l.XRANGEPLAINLOOSE]}$`),d("COERCEPLAIN",`(^|[^\\d])(\\d{1,${n}})(?:\\.(\\d{1,${n}}))?(?:\\.(\\d{1,${n}}))?`),d("COERCE",`${c[l.COERCEPLAIN]}(?:$|[^\\d])`),d("COERCEFULL",c[l.COERCEPLAIN]+`(?:${c[l.PRERELEASE]})?(?:${c[l.BUILD]})?(?:$|[^\\d])`),d("COERCERTL",c[l.COERCE],!0),d("COERCERTLFULL",c[l.COERCEFULL],!0),d("LONETILDE","(?:~>?)"),d("TILDETRIM",`(\\s*)${c[l.LONETILDE]}\\s+`,!0),e.tildeTrimReplace="$1~",d("TILDE",`^${c[l.LONETILDE]}${c[l.XRANGEPLAIN]}$`),d("TILDELOOSE",`^${c[l.LONETILDE]}${c[l.XRANGEPLAINLOOSE]}$`),d("LONECARET","(?:\\^)"),d("CARETTRIM",`(\\s*)${c[l.LONECARET]}\\s+`,!0),e.caretTrimReplace="$1^",d("CARET",`^${c[l.LONECARET]}${c[l.XRANGEPLAIN]}$`),d("CARETLOOSE",`^${c[l.LONECARET]}${c[l.XRANGEPLAINLOOSE]}$`),d("COMPARATORLOOSE",`^${c[l.GTLT]}\\s*(${c[l.LOOSEPLAIN]})$|^$`),d("COMPARATOR",`^${c[l.GTLT]}\\s*(${c[l.FULLPLAIN]})$|^$`),d("COMPARATORTRIM",`(\\s*)${c[l.GTLT]}\\s*(${c[l.LOOSEPLAIN]}|${c[l.XRANGEPLAIN]})`,!0),e.comparatorTrimReplace="$1$2$3",d("HYPHENRANGE",`^\\s*(${c[l.XRANGEPLAIN]})\\s+-\\s+(${c[l.XRANGEPLAIN]})\\s*$`),d("HYPHENRANGELOOSE",`^\\s*(${c[l.XRANGEPLAINLOOSE]})\\s+-\\s+(${c[l.XRANGEPLAINLOOSE]})\\s*$`),d("STAR","(<|>)?=?\\s*\\*"),d("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),d("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")}(or,or.exports)),or.exports),o=function(){if(Hn)return zn;Hn=1;const t=Object.freeze({loose:!0}),e=Object.freeze({});return zn=n=>n?"object"!=typeof n?t:n:e}(),{compareIdentifiers:s}=function(){if(Zn)return Yn;Zn=1;const t=/^[0-9]+$/,e=(e,n)=>{if("number"==typeof e&&"number"==typeof n)return e===n?0:ee(n,t)}}();class a{constructor(s,c){if(c=o(c),s instanceof a){if(s.loose===!!c.loose&&s.includePrerelease===!!c.includePrerelease)return s;s=s.version}else if("string"!=typeof s)throw new TypeError(`Invalid version. Must be a string. Got type "${typeof s}".`);if(s.length>e)throw new TypeError(`version is longer than ${e} characters`);t("SemVer",s,c),this.options=c,this.loose=!!c.loose,this.includePrerelease=!!c.includePrerelease;const u=s.trim().match(c.loose?r[i.LOOSE]:r[i.FULL]);if(!u)throw new TypeError(`Invalid Version: ${s}`);if(this.raw=s,this.major=+u[1],this.minor=+u[2],this.patch=+u[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");u[4]?this.prerelease=u[4].split(".").map(t=>{if(/^[0-9]+$/.test(t)){const e=+t;if(e>=0&&et.major?1:this.minort.minor?1:this.patcht.patch?1:0}comparePre(e){if(e instanceof a||(e=new a(e,this.options)),this.prerelease.length&&!e.prerelease.length)return-1;if(!this.prerelease.length&&e.prerelease.length)return 1;if(!this.prerelease.length&&!e.prerelease.length)return 0;let n=0;do{const r=this.prerelease[n],i=e.prerelease[n];if(t("prerelease compare",n,r,i),void 0===r&&void 0===i)return 0;if(void 0===i)return 1;if(void 0===r)return-1;if(r!==i)return s(r,i)}while(++n)}compareBuild(e){e instanceof a||(e=new a(e,this.options));let n=0;do{const r=this.build[n],i=e.build[n];if(t("build compare",n,r,i),void 0===r&&void 0===i)return 0;if(void 0===i)return 1;if(void 0===r)return-1;if(r!==i)return s(r,i)}while(++n)}inc(t,e,n){if(t.startsWith("pre")){if(!e&&!1===n)throw new Error("invalid increment argument: identifier is empty");if(e){const t=`-${e}`.match(this.options.loose?r[i.PRERELEASELOOSE]:r[i.PRERELEASE]);if(!t||t[1]!==e)throw new Error(`invalid identifier: ${e}`)}}switch(t){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",e,n);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",e,n);break;case"prepatch":this.prerelease.length=0,this.inc("patch",e,n),this.inc("pre",e,n);break;case"prerelease":0===this.prerelease.length&&this.inc("patch",e,n),this.inc("pre",e,n);break;case"release":if(0===this.prerelease.length)throw new Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":0===this.minor&&0===this.patch&&0!==this.prerelease.length||this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":0===this.patch&&0!==this.prerelease.length||this.minor++,this.patch=0,this.prerelease=[];break;case"patch":0===this.prerelease.length&&this.patch++,this.prerelease=[];break;case"pre":{const t=Number(n)?1:0;if(0===this.prerelease.length)this.prerelease=[t];else{let r=this.prerelease.length;for(;--r>=0;)"number"==typeof this.prerelease[r]&&(this.prerelease[r]++,r=-2);if(-1===r){if(e===this.prerelease.join(".")&&!1===n)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(t)}}if(e){let r=[e,t];!1===n&&(r=[e]),0===s(this.prerelease[0],e)?isNaN(this.prerelease[1])&&(this.prerelease=r):this.prerelease=r}break}default:throw new Error(`invalid increment argument: ${t}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}}return Qn=a}!function(){if(tr)return Jn;tr=1;const t=sr();Jn=(e,n)=>new t(e,n).major}(),function(){if(ir)return rr;ir=1;const t=function(){if(nr)return er;nr=1;const t=sr();return er=(e,n,r=!1)=>{if(e instanceof t)return e;try{return new t(e,n)}catch(t){if(!r)return null;throw t}}}();rr=(e,n)=>{const r=t(e,n);return r?r.version:null}}();var ar;ar||(ar=1,function(t){t.parser=function(t,e){return new r(t,e)},t.SAXParser=r,t.SAXStream=o,t.createStream=function(t,e){return new o(t,e)},t.MAX_BUFFER_LENGTH=65536;var e,n=["comment","sgmlDecl","textNode","tagName","doctype","procInstName","procInstBody","entity","attribName","attribValue","cdata","script"];function r(e,i){if(!(this instanceof r))return new r(e,i);var o=this;!function(t){for(var e=0,r=n.length;e"===o?(I(r,"onsgmldeclaration",r.sgmlDecl),r.sgmlDecl="",r.state=N.TEXT):m(o)?(r.state=N.SGML_DECL_QUOTED,r.sgmlDecl+=o):r.sgmlDecl+=o;continue;case N.SGML_DECL_QUOTED:o===r.q&&(r.state=N.SGML_DECL,r.q=""),r.sgmlDecl+=o;continue;case N.DOCTYPE:">"===o?(r.state=N.TEXT,I(r,"ondoctype",r.doctype),r.doctype=!0):(r.doctype+=o,"["===o?r.state=N.DOCTYPE_DTD:m(o)&&(r.state=N.DOCTYPE_QUOTED,r.q=o));continue;case N.DOCTYPE_QUOTED:r.doctype+=o,o===r.q&&(r.q="",r.state=N.DOCTYPE);continue;case N.DOCTYPE_DTD:"]"===o?(r.doctype+=o,r.state=N.DOCTYPE):"<"===o?(r.state=N.OPEN_WAKA,r.startTagPosition=r.position):m(o)?(r.doctype+=o,r.state=N.DOCTYPE_DTD_QUOTED,r.q=o):r.doctype+=o;continue;case N.DOCTYPE_DTD_QUOTED:r.doctype+=o,o===r.q&&(r.state=N.DOCTYPE_DTD,r.q="");continue;case N.COMMENT:"-"===o?r.state=N.COMMENT_ENDING:r.comment+=o;continue;case N.COMMENT_ENDING:"-"===o?(r.state=N.COMMENT_ENDED,r.comment=_(r.opt,r.comment),r.comment&&I(r,"oncomment",r.comment),r.comment=""):(r.comment+="-"+o,r.state=N.COMMENT);continue;case N.COMMENT_ENDED:">"!==o?(C(r,"Malformed comment"),r.comment+="--"+o,r.state=N.COMMENT):r.doctype&&!0!==r.doctype?r.state=N.DOCTYPE_DTD:r.state=N.TEXT;continue;case N.CDATA:"]"===o?r.state=N.CDATA_ENDING:r.cdata+=o;continue;case N.CDATA_ENDING:"]"===o?r.state=N.CDATA_ENDING_2:(r.cdata+="]"+o,r.state=N.CDATA);continue;case N.CDATA_ENDING_2:">"===o?(r.cdata&&I(r,"oncdata",r.cdata),I(r,"onclosecdata"),r.cdata="",r.state=N.TEXT):"]"===o?r.cdata+="]":(r.cdata+="]]"+o,r.state=N.CDATA);continue;case N.PROC_INST:"?"===o?r.state=N.PROC_INST_ENDING:g(o)?r.state=N.PROC_INST_BODY:r.procInstName+=o;continue;case N.PROC_INST_BODY:if(!r.procInstBody&&g(o))continue;"?"===o?r.state=N.PROC_INST_ENDING:r.procInstBody+=o;continue;case N.PROC_INST_ENDING:">"===o?(I(r,"onprocessinginstruction",{name:r.procInstName,body:r.procInstBody}),r.procInstName=r.procInstBody="",r.state=N.TEXT):(r.procInstBody+="?"+o,r.state=N.PROC_INST_BODY);continue;case N.OPEN_TAG:E(f,o)?r.tagName+=o:(R(r),">"===o?$(r):"/"===o?r.state=N.OPEN_TAG_SLASH:(g(o)||C(r,"Invalid character in tag name"),r.state=N.ATTRIB));continue;case N.OPEN_TAG_SLASH:">"===o?($(r,!0),j(r)):(C(r,"Forward-slash in opening tag not followed by >"),r.state=N.ATTRIB);continue;case N.ATTRIB:if(g(o))continue;">"===o?$(r):"/"===o?r.state=N.OPEN_TAG_SLASH:E(h,o)?(r.attribName=o,r.attribValue="",r.state=N.ATTRIB_NAME):C(r,"Invalid attribute name");continue;case N.ATTRIB_NAME:"="===o?r.state=N.ATTRIB_VALUE:">"===o?(C(r,"Attribute without value"),r.attribValue=r.attribName,D(r),$(r)):g(o)?r.state=N.ATTRIB_NAME_SAW_WHITE:E(f,o)?r.attribName+=o:C(r,"Invalid attribute name");continue;case N.ATTRIB_NAME_SAW_WHITE:if("="===o)r.state=N.ATTRIB_VALUE;else{if(g(o))continue;C(r,"Attribute without value"),r.tag.attributes[r.attribName]="",r.attribValue="",I(r,"onattribute",{name:r.attribName,value:""}),r.attribName="",">"===o?$(r):E(h,o)?(r.attribName=o,r.state=N.ATTRIB_NAME):(C(r,"Invalid attribute name"),r.state=N.ATTRIB)}continue;case N.ATTRIB_VALUE:if(g(o))continue;m(o)?(r.q=o,r.state=N.ATTRIB_VALUE_QUOTED):(r.opt.unquotedAttributeValues||P(r,"Unquoted attribute value"),r.state=N.ATTRIB_VALUE_UNQUOTED,r.attribValue=o);continue;case N.ATTRIB_VALUE_QUOTED:if(o!==r.q){"&"===o?r.state=N.ATTRIB_VALUE_ENTITY_Q:r.attribValue+=o;continue}D(r),r.q="",r.state=N.ATTRIB_VALUE_CLOSED;continue;case N.ATTRIB_VALUE_CLOSED:g(o)?r.state=N.ATTRIB:">"===o?$(r):"/"===o?r.state=N.OPEN_TAG_SLASH:E(h,o)?(C(r,"No whitespace between attributes"),r.attribName=o,r.attribValue="",r.state=N.ATTRIB_NAME):C(r,"Invalid attribute name");continue;case N.ATTRIB_VALUE_UNQUOTED:if(!v(o)){"&"===o?r.state=N.ATTRIB_VALUE_ENTITY_U:r.attribValue+=o;continue}D(r),">"===o?$(r):r.state=N.ATTRIB;continue;case N.CLOSE_TAG:if(r.tagName)">"===o?j(r):E(f,o)?r.tagName+=o:r.script?(r.script+=""===o?j(r):C(r,"Invalid characters in closing tag");continue;case N.TEXT_ENTITY:case N.ATTRIB_VALUE_ENTITY_Q:case N.ATTRIB_VALUE_ENTITY_U:var l,b;switch(r.state){case N.TEXT_ENTITY:l=N.TEXT,b="textNode";break;case N.ATTRIB_VALUE_ENTITY_Q:l=N.ATTRIB_VALUE_QUOTED,b="attribValue";break;case N.ATTRIB_VALUE_ENTITY_U:l=N.ATTRIB_VALUE_UNQUOTED,b="attribValue"}if(";"===o){var w=F(r);r.opt.unparsedEntities&&!Object.values(t.XML_ENTITIES).includes(w)?(r.entity="",r.state=l,r.write(w)):(r[b]+=w,r.entity="",r.state=l)}else E(r.entity.length?d:p,o)?r.entity+=o:(C(r,"Invalid character in entity name"),r[b]+="&"+r.entity+o,r.entity="",r.state=l);continue;default:throw new Error(r,"Unknown state: "+r.state)}return r.position>=r.bufferCheckPosition&&function(e){for(var r=Math.max(t.MAX_BUFFER_LENGTH,10),i=0,o=0,s=n.length;or)switch(n[o]){case"textNode":x(e);break;case"cdata":I(e,"oncdata",e.cdata),e.cdata="";break;case"script":I(e,"onscript",e.script),e.script="";break;default:P(e,"Max buffer length exceeded: "+n[o])}i=Math.max(i,a)}var c=t.MAX_BUFFER_LENGTH-i;e.bufferCheckPosition=c+e.position}(r),r},resume:function(){return this.error=null,this},close:function(){return this.write(null)},flush:function(){var t;x(t=this),""!==t.cdata&&(I(t,"oncdata",t.cdata),t.cdata=""),""!==t.script&&(I(t,"onscript",t.script),t.script="")}};try{e=require("stream").Stream}catch(t){e=function(){}}e||(e=function(){});var i=t.EVENTS.filter(function(t){return"error"!==t&&"end"!==t});function o(t,n){if(!(this instanceof o))return new o(t,n);e.apply(this),this._parser=new r(t,n),this.writable=!0,this.readable=!0;var s=this;this._parser.onend=function(){s.emit("end")},this._parser.onerror=function(t){s.emit("error",t),s._parser.error=null},this._decoder=null,i.forEach(function(t){Object.defineProperty(s,"on"+t,{get:function(){return s._parser["on"+t]},set:function(e){if(!e)return s.removeAllListeners(t),s._parser["on"+t]=e,e;s.on(t,e)},enumerable:!0,configurable:!1})})}o.prototype=Object.create(e.prototype,{constructor:{value:o}}),o.prototype.write=function(t){if("function"==typeof Vn&&"function"==typeof Vn.isBuffer&&Vn.isBuffer(t)){if(!this._decoder){var e=Mn.I;this._decoder=new e("utf8")}t=this._decoder.write(t)}return this._parser.write(t.toString()),this.emit("data",t),!0},o.prototype.end=function(t){return t&&t.length&&this.write(t),this._parser.end(),!0},o.prototype.on=function(t,n){var r=this;return r._parser["on"+t]||-1===i.indexOf(t)||(r._parser["on"+t]=function(){var e=1===arguments.length?[arguments[0]]:Array.apply(null,arguments);e.splice(0,0,t),r.emit.apply(r,e)}),e.prototype.on.call(r,t,n)};var s="[CDATA[",a="DOCTYPE",c="http://www.w3.org/XML/1998/namespace",u="http://www.w3.org/2000/xmlns/",l={xml:c,xmlns:u},h=/[:_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]/,f=/[:_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\u00B7\u0300-\u036F\u203F-\u2040.\d-]/,p=/[#:_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]/,d=/[#:_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\u00B7\u0300-\u036F\u203F-\u2040.\d-]/;function g(t){return" "===t||"\n"===t||"\r"===t||"\t"===t}function m(t){return'"'===t||"'"===t}function v(t){return">"===t||g(t)}function E(t,e){return t.test(e)}function y(t,e){return!E(t,e)}var b,w,T,N=0;for(var A in t.STATE={BEGIN:N++,BEGIN_WHITESPACE:N++,TEXT:N++,TEXT_ENTITY:N++,OPEN_WAKA:N++,SGML_DECL:N++,SGML_DECL_QUOTED:N++,DOCTYPE:N++,DOCTYPE_QUOTED:N++,DOCTYPE_DTD:N++,DOCTYPE_DTD_QUOTED:N++,COMMENT_STARTING:N++,COMMENT:N++,COMMENT_ENDING:N++,COMMENT_ENDED:N++,CDATA:N++,CDATA_ENDING:N++,CDATA_ENDING_2:N++,PROC_INST:N++,PROC_INST_BODY:N++,PROC_INST_ENDING:N++,OPEN_TAG:N++,OPEN_TAG_SLASH:N++,ATTRIB:N++,ATTRIB_NAME:N++,ATTRIB_NAME_SAW_WHITE:N++,ATTRIB_VALUE:N++,ATTRIB_VALUE_QUOTED:N++,ATTRIB_VALUE_CLOSED:N++,ATTRIB_VALUE_UNQUOTED:N++,ATTRIB_VALUE_ENTITY_Q:N++,ATTRIB_VALUE_ENTITY_U:N++,CLOSE_TAG:N++,CLOSE_TAG_SAW_WHITE:N++,SCRIPT:N++,SCRIPT_ENDING:N++},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(e){var n=t.ENTITIES[e],r="number"==typeof n?String.fromCharCode(n):n;t.ENTITIES[e]=r}),t.STATE)t.STATE[t.STATE[A]]=A;function O(t,e,n){t[e]&&t[e](n)}function I(t,e,n){t.textNode&&x(t),O(t,e,n)}function x(t){t.textNode=_(t.opt,t.textNode),t.textNode&&O(t,"ontext",t.textNode),t.textNode=""}function _(t,e){return t.trim&&(e=e.trim()),t.normalize&&(e=e.replace(/\s+/g," ")),e}function P(t,e){return x(t),t.trackPosition&&(e+="\nLine: "+t.line+"\nColumn: "+t.column+"\nChar: "+t.c),e=new Error(e),t.error=e,O(t,"onerror",e),t}function S(t){return t.sawRoot&&!t.closedRoot&&C(t,"Unclosed root tag"),t.state!==N.BEGIN&&t.state!==N.BEGIN_WHITESPACE&&t.state!==N.TEXT&&P(t,"Unexpected end"),x(t),t.c="",t.closed=!0,O(t,"onend"),r.call(t,t.strict,t.opt),t}function C(t,e){if("object"!=typeof t||!(t instanceof r))throw new Error("bad call to strictFail");t.strict&&P(t,e)}function R(t){t.strict||(t.tagName=t.tagName[t.looseCase]());var e=t.tags[t.tags.length-1]||t,n=t.tag={name:t.tagName,attributes:{}};t.opt.xmlns&&(n.ns=e.ns),t.attribList.length=0,I(t,"onopentagstart",n)}function L(t,e){var n=t.indexOf(":")<0?["",t]:t.split(":"),r=n[0],i=n[1];return e&&"xmlns"===t&&(r="xmlns",i=""),{prefix:r,local:i}}function D(t){if(t.strict||(t.attribName=t.attribName[t.looseCase]()),-1!==t.attribList.indexOf(t.attribName)||t.tag.attributes.hasOwnProperty(t.attribName))t.attribName=t.attribValue="";else{if(t.opt.xmlns){var e=L(t.attribName,!0),n=e.prefix,r=e.local;if("xmlns"===n)if("xml"===r&&t.attribValue!==c)C(t,"xml: prefix must be bound to "+c+"\nActual: "+t.attribValue);else if("xmlns"===r&&t.attribValue!==u)C(t,"xmlns: prefix must be bound to "+u+"\nActual: "+t.attribValue);else{var i=t.tag,o=t.tags[t.tags.length-1]||t;i.ns===o.ns&&(i.ns=Object.create(o.ns)),i.ns[r]=t.attribValue}t.attribList.push([t.attribName,t.attribValue])}else t.tag.attributes[t.attribName]=t.attribValue,I(t,"onattribute",{name:t.attribName,value:t.attribValue});t.attribName=t.attribValue=""}}function $(t,e){if(t.opt.xmlns){var n=t.tag,r=L(t.tagName);n.prefix=r.prefix,n.local=r.local,n.uri=n.ns[r.prefix]||"",n.prefix&&!n.uri&&(C(t,"Unbound namespace prefix: "+JSON.stringify(t.tagName)),n.uri=r.prefix);var i=t.tags[t.tags.length-1]||t;n.ns&&i.ns!==n.ns&&Object.keys(n.ns).forEach(function(e){I(t,"onopennamespace",{prefix:e,uri:n.ns[e]})});for(var o=0,s=t.attribList.length;o",t.tagName="",void(t.state=N.SCRIPT);I(t,"onscript",t.script),t.script=""}var e=t.tags.length,n=t.tagName;t.strict||(n=n[t.looseCase]());for(var r=n;e--&&t.tags[e].name!==r;)C(t,"Unexpected close tag");if(e<0)return C(t,"Unmatched closing tag: "+t.tagName),t.textNode+="",void(t.state=N.TEXT);t.tagName=n;for(var i=t.tags.length;i-- >e;){var o=t.tag=t.tags.pop();t.tagName=t.tag.name,I(t,"onclosetag",t.tagName);var s={};for(var a in o.ns)s[a]=o.ns[a];var c=t.tags[t.tags.length-1]||t;t.opt.xmlns&&o.ns!==c.ns&&Object.keys(o.ns).forEach(function(e){var n=o.ns[e];I(t,"onclosenamespace",{prefix:e,uri:n})})}0===e&&(t.closedRoot=!0),t.tagName=t.attribValue=t.attribName="",t.attribList.length=0,t.state=N.TEXT}function F(t){var e,n=t.entity,r=n.toLowerCase(),i="";return t.ENTITIES[n]?t.ENTITIES[n]:t.ENTITIES[r]?t.ENTITIES[r]:("#"===(n=r).charAt(0)&&("x"===n.charAt(1)?(n=n.slice(2),i=(e=parseInt(n,16)).toString(16)):(n=n.slice(1),i=(e=parseInt(n,10)).toString(10))),n=n.replace(/^0+/,""),isNaN(e)||i.toLowerCase()!==n?(C(t,"Invalid character entity"),"&"+t.entity+";"):String.fromCodePoint(e))}function U(t,e){"<"===e?(t.state=N.OPEN_WAKA,t.startTagPosition=t.position):g(e)||(C(t,"Non-whitespace before first tag."),t.textNode=e,t.state=N.TEXT)}function M(t,e){var n="";return e1114111||w(s)!==s)throw RangeError("Invalid code point: "+s);s<=65535?n.push(s):(t=55296+((s-=65536)>>10),e=s%1024+56320,n.push(t,e)),(r+1===i||n.length>16384)&&(o+=b.apply(null,n),n.length=0)}return o},Object.defineProperty?Object.defineProperty(String,"fromCodePoint",{value:T,configurable:!0,writable:!0}):String.fromCodePoint=T)}({}));var cr=(t=>(t.ReservedName="reserved name",t.Character="character",t.Extension="extension",t))(cr||{});class ur extends Error{constructor(t){super(`Invalid ${t.reason} '${t.segment}' in filename '${t.filename}'`,{cause:t})}get filename(){return this.cause.filename}get reason(){return this.cause.reason}get segment(){return this.cause.segment}}function lr(t){const e=(0,kn.F)().files,n=e.forbidden_filename_characters??window._oc_config?.forbidden_filenames_characters??["/","\\"];for(const e of n)if(t.includes(e))throw new ur({segment:e,reason:"character",filename:t});if(t=t.toLocaleLowerCase(),(e.forbidden_filenames??[".htaccess"]).includes(t))throw new ur({filename:t,segment:t,reason:"reserved name"});const r=t.indexOf(".",1),i=t.substring(0,-1===r?void 0:r);if((e.forbidden_filename_basenames??[]).includes(i))throw new ur({filename:t,segment:i,reason:"reserved name"});const o=e.forbidden_filename_extensions??[".part",".filepart"];for(const e of o)if(t.length>e.length&&t.endsWith(e))throw new ur({segment:e,reason:"extension",filename:t})}const hr=["B","KB","MB","GB","TB","PB"],fr=["B","KiB","MiB","GiB","TiB","PiB"];function pr(t,e=!1,n=!1,r=!1){n=n&&!r,"string"==typeof t&&(t=Number(t));let i=t>0?Math.floor(Math.log(t)/Math.log(r?1e3:1024)):0;i=Math.min((n?fr.length:hr.length)-1,i);const o=n?fr[i]:hr[i];let s=(t/Math.pow(r?1e3:1024,i)).toFixed(1);return!0===e&&0===i?("0.0"!==s?"< 1 ":"0 ")+(n?fr[1]:hr[1]):(s=i<2?parseFloat(s).toFixed(0):parseFloat(s).toLocaleString((0,Bn.lO)()),s+" "+o)}function dr(t){return t instanceof Date?t.toISOString():String(t)}function gr(t,e={}){const n={sortingMode:"basename",sortingOrder:"asc",...e},r=[...n.sortFavoritesFirst?[t=>1!==t.attributes?.favorite]:[],...n.sortFoldersFirst?[t=>"folder"!==t.type]:[],..."basename"!==n.sortingMode?[t=>t[n.sortingMode]??t.attributes[n.sortingMode]]:[],t=>function(t){const e=t.displayname||t.attributes?.displayname||t.basename||"";return t.type===gn.Folder?e:e.lastIndexOf(".")>0?e.slice(0,e.lastIndexOf(".")):e}(t),t=>t.basename];return function(t,e,n){n=n??[];const r=(e=e??[t=>t]).map((t,e)=>"asc"===(n[e]??"asc")?1:-1),i=Intl.Collator([(0,Bn.Z0)(),(0,Bn.lO)()],{numeric:!0,usage:"sort"});return[...t].sort((t,n)=>{for(const[o,s]of e.entries()){const e=i.compare(dr(s(t)),dr(s(n)));if(0!==e)return e*r[o]}return 0})}(t,r,[...n.sortFavoritesFirst?["asc"]:[],...n.sortFoldersFirst?["asc"]:[],..."mtime"===n.sortingMode?["asc"===n.sortingOrder?"desc":"asc"]:[],..."mtime"!==n.sortingMode&&"basename"!==n.sortingMode?[n.sortingOrder]:[],n.sortingOrder,n.sortingOrder])}},32505(t,e,n){"use strict";n.d(e,{G:()=>o,f:()=>i});var r=n(81222);function i(){return(0,r.C)("files_sharing","isPublic",null)??null!==document.querySelector('input#isPublic[type="hidden"][name="isPublic"][value="1"]')}function o(){return(0,r.C)("files_sharing","sharingToken",null)??document.querySelector('input#sharingToken[type="hidden"]')?.value??null}},82182(t,e,n){"use strict";n.d(e,{A:()=>r.N});var r=n(75078)}}]); //# sourceMappingURL=mail.2204.2d9d9e4d5cef30a72905.js.map