@opencloud-eu/web-pkg 6.1.0 → 7.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/worker-B8V6K8WY.js +25 -0
- package/dist/assets/worker-BjLAp2qA.js +25 -0
- package/dist/assets/worker-Cz7k4ET0.js +25 -0
- package/dist/{composables-TkULFBg4.js → components-DGm07xAo.js} +8229 -10761
- package/dist/src/components/AppBar/AppBar.vue.d.ts +34 -91
- package/dist/src/components/AppTemplates/AppWrapper.vue.d.ts +1 -9
- package/dist/src/components/AppTopBar.vue.d.ts +3 -11
- package/dist/src/components/Avatars/AvatarUpload.vue.d.ts +0 -1
- package/dist/src/components/Avatars/UserAvatar.vue.d.ts +1 -9
- package/dist/src/components/ContextActions/ActionMenuDropItem.vue.d.ts +1 -9
- package/dist/src/components/ContextActions/ContextActionMenu.vue.d.ts +9 -27
- package/dist/src/components/ContextActions/ContextMenuQuickAction.vue.d.ts +30 -134
- package/dist/src/components/CreateLinkModal.vue.d.ts +6 -14
- package/dist/src/components/CreateShortcutModal.vue.d.ts +34 -142
- package/dist/src/components/CustomComponentTarget.vue.d.ts +1 -9
- package/dist/src/components/FilesList/ContextActions.vue.d.ts +9 -27
- package/dist/src/components/FilesList/ResourceGhostElement.vue.d.ts +7 -17
- package/dist/src/components/FilesList/ResourceIcon.vue.d.ts +1 -9
- package/dist/src/components/FilesList/ResourceListItem.vue.d.ts +5 -12
- package/dist/src/components/FilesList/ResourceName.vue.d.ts +3 -9
- package/dist/src/components/FilesList/ResourceStatusIndicators.vue.d.ts +1 -9
- package/dist/src/components/FilesList/ResourceTable.vue.d.ts +8 -16
- package/dist/src/components/FilesList/ResourceTile.vue.d.ts +6 -14
- package/dist/src/components/FilesList/ResourceTiles.vue.d.ts +7 -15
- package/dist/src/components/Filters/DateFilter.vue.d.ts +5 -13
- package/dist/src/components/ImageCropper.vue.d.ts +12 -0
- package/dist/src/components/ItemFilter.vue.d.ts +5 -13
- package/dist/src/components/NoContentMessage.vue.d.ts +1 -9
- package/dist/src/components/Search/ResourcePreview.vue.d.ts +1 -9
- package/dist/src/components/SideBar/CompareSaveDialog.vue.d.ts +1 -1
- package/dist/src/components/SideBar/FileSideBar.vue.d.ts +1 -9
- package/dist/src/components/SideBar/Files/FileInfo.vue.d.ts +1 -9
- package/dist/src/components/SideBar/SideBar.vue.d.ts +5 -13
- package/dist/src/components/SideBar/SideBarPanels.vue.d.ts +6 -14
- package/dist/src/components/SideBar/Spaces/Details/SpaceDetails.vue.d.ts +1 -9
- package/dist/src/components/SideBar/Spaces/Details/SpaceDetailsMultiple.vue.d.ts +1 -9
- package/dist/src/components/SideBar/Spaces/SpaceInfo.vue.d.ts +5 -1
- package/dist/src/components/SpaceQuota.vue.d.ts +1 -9
- package/dist/src/components/Spaces/QuotaModal.vue.d.ts +3 -11
- package/dist/src/components/Spaces/SpaceImageModal.vue.d.ts +2 -11
- package/dist/src/components/ViewOptions.vue.d.ts +1 -9
- package/dist/src/components/index.d.ts +0 -2
- package/dist/src/composables/actions/files/index.d.ts +0 -21
- package/dist/src/composables/actions/spaces/index.d.ts +0 -12
- package/dist/src/composables/actions/types.d.ts +93 -2
- package/dist/src/composables/breadcrumbs/useBreadcrumbsFromPath.d.ts +1 -3
- package/dist/src/composables/driveResolver/useDriveResolver.d.ts +0 -1
- package/dist/src/composables/keyboardActions/useCropperKeyboardActions.d.ts +2 -1
- package/dist/src/composables/keyboardActions/useKeyboardActions.d.ts +1 -0
- package/dist/src/composables/piniaStores/auth.d.ts +24 -2
- package/dist/src/composables/piniaStores/avatars.d.ts +3 -3
- package/dist/src/composables/piniaStores/config/config.d.ts +1 -91
- package/dist/src/composables/piniaStores/config/types.d.ts +0 -20
- package/dist/src/composables/piniaStores/extensionRegistry/extensionRegistry.d.ts +4 -1
- package/dist/src/composables/piniaStores/messages.d.ts +12 -594
- package/dist/src/composables/piniaStores/spaces.d.ts +1 -3
- package/dist/src/composables/piniaStores/theme.d.ts +1 -1
- package/dist/src/composables/resources/useResourceViewDrag.d.ts +7 -17
- package/dist/src/composables/resources/useResourceViewHelpers.d.ts +7 -17
- package/dist/src/composables/router/useFileRouteReplace.d.ts +0 -2
- package/dist/src/composables/spaces/useGetMatchingSpace.d.ts +0 -4
- package/dist/src/editor/components/SlashCommandMenu.vue.d.ts +9 -0
- package/dist/src/editor/components/TextEditorContent.vue.d.ts +7 -0
- package/dist/src/editor/components/TextEditorProvider.vue.d.ts +17 -0
- package/dist/src/editor/composables/index.d.ts +3 -0
- package/dist/src/editor/composables/strategies/html.d.ts +3 -0
- package/dist/src/editor/composables/strategies/index.d.ts +5 -0
- package/dist/src/editor/composables/strategies/markdown.d.ts +3 -0
- package/dist/src/editor/composables/strategies/plainText.d.ts +3 -0
- package/dist/src/editor/composables/strategies/tiptapJson.d.ts +3 -0
- package/dist/src/editor/composables/strategies/types.d.ts +10 -0
- package/dist/src/editor/composables/useContentStrategy.d.ts +5 -0
- package/dist/src/editor/composables/useEditorActions.d.ts +75 -0
- package/dist/src/editor/composables/useTextEditor.d.ts +2 -0
- package/dist/src/editor/extensions/index.d.ts +1 -0
- package/dist/src/editor/extensions/slashCommands.d.ts +16 -0
- package/dist/src/editor/index.d.ts +5 -0
- package/dist/src/editor/types.d.ts +29 -0
- package/dist/src/helpers/groupwareResponse.d.ts +1 -0
- package/dist/src/helpers/index.d.ts +2 -0
- package/dist/src/helpers/router/routeOptions.d.ts +1 -7
- package/dist/src/helpers/virtualCursorElement.d.ts +1 -0
- package/dist/src/router/index.d.ts +2 -1
- package/dist/src/router/utils.d.ts +1 -6
- package/dist/src/types.d.ts +1 -0
- package/dist/src/utils/dummyGettext.d.ts +6 -0
- package/dist/src/utils/index.d.ts +1 -0
- package/dist/web-pkg/editor.js +1360 -0
- package/dist/web-pkg.js +2956 -1661
- package/package.json +26 -9
- package/dist/TextEditor-B0ZZfO_w.js +0 -819
- package/dist/assets/worker-C-Nrpmiq.js +0 -24
- package/dist/assets/worker-CzI1mBNb.js +0 -24
- package/dist/assets/worker-DDmV-och.js +0 -24
- package/dist/src/components/Navigation/index.d.ts +0 -1
- package/dist/src/components/TextEditor/TextEditor.vue.d.ts +0 -26
- package/dist/src/components/TextEditor/index.d.ts +0 -39
- package/dist/src/components/TextEditor/l18n.d.ts +0 -3
- package/dist/src/composables/actions/files/useFileActionsCopy.d.ts +0 -4
- package/dist/src/composables/actions/files/useFileActionsCopyPermanentLink.d.ts +0 -4
- package/dist/src/composables/actions/files/useFileActionsCreateLink.d.ts +0 -6
- package/dist/src/composables/actions/files/useFileActionsCreateNewFile.d.ts +0 -10
- package/dist/src/composables/actions/files/useFileActionsCreateNewFolder.d.ts +0 -9
- package/dist/src/composables/actions/files/useFileActionsCreateNewShortcut.d.ts +0 -8
- package/dist/src/composables/actions/files/useFileActionsCreateSpaceFromResource.d.ts +0 -4
- package/dist/src/composables/actions/files/useFileActionsDisableSync.d.ts +0 -5
- package/dist/src/composables/actions/files/useFileActionsDownloadArchive.d.ts +0 -4
- package/dist/src/composables/actions/files/useFileActionsEmptyTrashBin.d.ts +0 -8
- package/dist/src/composables/actions/files/useFileActionsEnableSync.d.ts +0 -5
- package/dist/src/composables/actions/files/useFileActionsFavorite.d.ts +0 -4
- package/dist/src/composables/actions/files/useFileActionsMove.d.ts +0 -4
- package/dist/src/composables/actions/files/useFileActionsOpenShortcut.d.ts +0 -5
- package/dist/src/composables/actions/files/useFileActionsPaste.d.ts +0 -4
- package/dist/src/composables/actions/files/useFileActionsRename.d.ts +0 -6
- package/dist/src/composables/actions/files/useFileActionsSetImage.d.ts +0 -4
- package/dist/src/composables/actions/files/useFileActionsShowActions.d.ts +0 -4
- package/dist/src/composables/actions/files/useFileActionsShowDetails.d.ts +0 -4
- package/dist/src/composables/actions/files/useFileActionsShowShares.d.ts +0 -5
- package/dist/src/composables/actions/files/useFileActionsToggleHideShare.d.ts +0 -5
- package/dist/src/composables/actions/spaces/useSpaceActionsDelete.d.ts +0 -6
- package/dist/src/composables/actions/spaces/useSpaceActionsDeleteImage.d.ts +0 -8
- package/dist/src/composables/actions/spaces/useSpaceActionsDisable.d.ts +0 -6
- package/dist/src/composables/actions/spaces/useSpaceActionsDuplicate.d.ts +0 -6
- package/dist/src/composables/actions/spaces/useSpaceActionsEditDescription.d.ts +0 -6
- package/dist/src/composables/actions/spaces/useSpaceActionsEditQuota.d.ts +0 -4
- package/dist/src/composables/actions/spaces/useSpaceActionsEditReadmeContent.d.ts +0 -4
- package/dist/src/composables/actions/spaces/useSpaceActionsNavigateToTrash.d.ts +0 -4
- package/dist/src/composables/actions/spaces/useSpaceActionsRename.d.ts +0 -6
- package/dist/src/composables/actions/spaces/useSpaceActionsRestore.d.ts +0 -6
- package/dist/src/composables/actions/spaces/useSpaceActionsSetIcon.d.ts +0 -6
- package/dist/src/composables/actions/spaces/useSpaceActionsShowMembers.d.ts +0 -4
- /package/dist/src/{components/Navigation/MobileNav.vue.d.ts → editor/components/TextEditorToolbar.vue.d.ts} +0 -0
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
(function(){var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),s=(e,n)=>{let r={};for(var i in e)t(r,i,{get:e[i],enumerable:!0});return n||t(r,Symbol.toStringTag,{value:`Module`}),r},c=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},l=(n,r,a)=>(a=n==null?{}:e(i(n)),c(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n)),u=l(o(((e,t)=>{var n=Object.prototype.hasOwnProperty,r=`~`;function i(){}Object.create&&(i.prototype=Object.create(null),new i().__proto__||(r=!1));function a(e,t,n){this.fn=e,this.context=t,this.once=n||!1}function o(e,t,n,i,o){if(typeof n!=`function`)throw TypeError(`The listener must be a function`);var s=new a(n,i||e,o),c=r?r+t:t;return e._events[c]?e._events[c].fn?e._events[c]=[e._events[c],s]:e._events[c].push(s):(e._events[c]=s,e._eventsCount++),e}function s(e,t){--e._eventsCount===0?e._events=new i:delete e._events[t]}function c(){this._events=new i,this._eventsCount=0}c.prototype.eventNames=function(){var e=[],t,i;if(this._eventsCount===0)return e;for(i in t=this._events)n.call(t,i)&&e.push(r?i.slice(1):i);return Object.getOwnPropertySymbols?e.concat(Object.getOwnPropertySymbols(t)):e},c.prototype.listeners=function(e){var t=r?r+e:e,n=this._events[t];if(!n)return[];if(n.fn)return[n.fn];for(var i=0,a=n.length,o=Array(a);i<a;i++)o[i]=n[i].fn;return o},c.prototype.listenerCount=function(e){var t=r?r+e:e,n=this._events[t];return n?n.fn?1:n.length:0},c.prototype.emit=function(e,t,n,i,a,o){var s=r?r+e:e;if(!this._events[s])return!1;var c=this._events[s],l=arguments.length,u,d;if(c.fn){switch(c.once&&this.removeListener(e,c.fn,void 0,!0),l){case 1:return c.fn.call(c.context),!0;case 2:return c.fn.call(c.context,t),!0;case 3:return c.fn.call(c.context,t,n),!0;case 4:return c.fn.call(c.context,t,n,i),!0;case 5:return c.fn.call(c.context,t,n,i,a),!0;case 6:return c.fn.call(c.context,t,n,i,a,o),!0}for(d=1,u=Array(l-1);d<l;d++)u[d-1]=arguments[d];c.fn.apply(c.context,u)}else{var f=c.length,p;for(d=0;d<f;d++)switch(c[d].once&&this.removeListener(e,c[d].fn,void 0,!0),l){case 1:c[d].fn.call(c[d].context);break;case 2:c[d].fn.call(c[d].context,t);break;case 3:c[d].fn.call(c[d].context,t,n);break;case 4:c[d].fn.call(c[d].context,t,n,i);break;default:if(!u)for(p=1,u=Array(l-1);p<l;p++)u[p-1]=arguments[p];c[d].fn.apply(c[d].context,u)}}return!0},c.prototype.on=function(e,t,n){return o(this,e,t,n,!1)},c.prototype.once=function(e,t,n){return o(this,e,t,n,!0)},c.prototype.removeListener=function(e,t,n,i){var a=r?r+e:e;if(!this._events[a])return this;if(!t)return s(this,a),this;var o=this._events[a];if(o.fn)o.fn===t&&(!i||o.once)&&(!n||o.context===n)&&s(this,a);else{for(var c=0,l=[],u=o.length;c<u;c++)(o[c].fn!==t||i&&!o[c].once||n&&o[c].context!==n)&&l.push(o[c]);l.length?this._events[a]=l.length===1?l[0]:l:s(this,a)}return this},c.prototype.removeAllListeners=function(e){var t;return e?(t=r?r+e:e,this._events[t]&&s(this,t)):(this._events=new i,this._eventsCount=0),this},c.prototype.off=c.prototype.removeListener,c.prototype.addListener=c.prototype.on,c.prefixed=r,c.EventEmitter=c,t!==void 0&&(t.exports=c)}))(),1),d=class e extends Error{name=`TimeoutError`;constructor(t,n){super(t,n),Error.captureStackTrace?.(this,e)}};let f=e=>e.reason??new DOMException(`This operation was aborted.`,`AbortError`);function p(e,t){let{milliseconds:n,fallback:r,message:i,customTimers:a={setTimeout,clearTimeout},signal:o}=t,s,c,l=new Promise((t,l)=>{if(typeof n!=`number`||Math.sign(n)!==1)throw TypeError(`Expected \`milliseconds\` to be a positive number, got \`${n}\``);if(o?.aborted){l(f(o));return}if(o&&(c=()=>{l(f(o))},o.addEventListener(`abort`,c,{once:!0})),e.then(t,l),n===1/0)return;let u=new d;s=a.setTimeout.call(void 0,()=>{if(r){try{t(r())}catch(e){l(e)}return}typeof e.cancel==`function`&&e.cancel(),i===!1?t():i instanceof Error?l(i):(u.message=i??`Promise timed out after ${n} milliseconds`,l(u))},n)}).finally(()=>{l.clear(),c&&o&&o.removeEventListener(`abort`,c)});return l.clear=()=>{a.clearTimeout.call(void 0,s),s=void 0},l}function m(e,t,n){let r=0,i=e.length;for(;i>0;){let a=Math.trunc(i/2),o=r+a;n(e[o],t)<=0?(r=++o,i-=a+1):i=a}return r}var h=class{#e=[];enqueue(e,t){let{priority:n=0,id:r}=t??{},i={priority:n,id:r,run:e};if(this.size===0||this.#e[this.size-1].priority>=n){this.#e.push(i);return}let a=m(this.#e,i,(e,t)=>t.priority-e.priority);this.#e.splice(a,0,i)}setPriority(e,t){let n=this.#e.findIndex(t=>t.id===e);if(n===-1)throw ReferenceError(`No promise function with the id "${e}" exists in the queue.`);let[r]=this.#e.splice(n,1);this.enqueue(r.run,{priority:t,id:e})}dequeue(){return this.#e.shift()?.run}filter(e){return this.#e.filter(t=>t.priority===e.priority).map(e=>e.run)}get size(){return this.#e.length}},g=class extends u.default{#e;#t;#n=0;#r;#i=!1;#a=!1;#o;#s=0;#c=0;#l;#u;#d;#f=[];#p=0;#m;#h;#g=0;#_;#v;#y=1n;#b=new Map;timeout;constructor(e){if(super(),e={carryoverIntervalCount:!1,intervalCap:1/0,interval:0,concurrency:1/0,autoStart:!0,queueClass:h,strict:!1,...e},!(typeof e.intervalCap==`number`&&e.intervalCap>=1))throw TypeError(`Expected \`intervalCap\` to be a number from 1 and up, got \`${e.intervalCap?.toString()??``}\` (${typeof e.intervalCap})`);if(e.interval===void 0||!(Number.isFinite(e.interval)&&e.interval>=0))throw TypeError(`Expected \`interval\` to be a finite number >= 0, got \`${e.interval?.toString()??``}\` (${typeof e.interval})`);if(e.strict&&e.interval===0)throw TypeError("The `strict` option requires a non-zero `interval`");if(e.strict&&e.intervalCap===1/0)throw TypeError("The `strict` option requires a finite `intervalCap`");if(this.#e=e.carryoverIntervalCount??e.carryoverConcurrencyCount??!1,this.#t=e.intervalCap===1/0||e.interval===0,this.#r=e.intervalCap,this.#o=e.interval,this.#d=e.strict,this.#m=new e.queueClass,this.#h=e.queueClass,this.concurrency=e.concurrency,e.timeout!==void 0&&!(Number.isFinite(e.timeout)&&e.timeout>0))throw TypeError(`Expected \`timeout\` to be a positive finite number, got \`${e.timeout}\` (${typeof e.timeout})`);this.timeout=e.timeout,this.#v=e.autoStart===!1,this.#R()}#x(e){for(;this.#p<this.#f.length;){let t=this.#f[this.#p];if(t!==void 0&&e-t>=this.#o)this.#p++;else break}(this.#p>100&&this.#p>this.#f.length/2||this.#p===this.#f.length)&&(this.#f=this.#f.slice(this.#p),this.#p=0)}#S(e){this.#d?this.#f.push(e):this.#n++}#C(){this.#d?this.#f.length>this.#p&&this.#f.pop():this.#n>0&&this.#n--}#w(){return this.#f.length-this.#p}get#T(){return this.#t?!0:this.#d?this.#w()<this.#r:this.#n<this.#r}get#E(){return this.#g<this.#_}#D(){this.#g--,this.#g===0&&this.emit(`pendingZero`),this.#N(),this.emit(`next`)}#O(){this.#u=void 0,this.#F(),this.#P()}#k(e){if(this.#d){if(this.#x(e),this.#w()>=this.#r){let t=this.#f[this.#p],n=this.#o-(e-t);return this.#A(n),!0}return!1}if(this.#l===void 0){let t=this.#s-e;if(t<0){if(this.#c>0){let t=e-this.#c;if(t<this.#o)return this.#A(this.#o-t),!0}this.#n=this.#e?this.#g:0}else return this.#A(t),!0}return!1}#A(e){this.#u===void 0&&(this.#u=setTimeout(()=>{this.#O()},e))}#j(){this.#l&&=(clearInterval(this.#l),void 0)}#M(){this.#u&&=(clearTimeout(this.#u),void 0)}#N(){if(this.#m.size===0){if(this.#j(),this.emit(`empty`),this.#g===0){if(this.#M(),this.#d&&this.#p>0){let e=Date.now();this.#x(e)}this.emit(`idle`)}return!1}let e=!1;if(!this.#v){let t=Date.now(),n=!this.#k(t);if(this.#T&&this.#E){let r=this.#m.dequeue();this.#t||(this.#S(t),this.#z()),this.emit(`active`),r(),n&&this.#P(),e=!0}}return e}#P(){this.#t||this.#l!==void 0||this.#d||(this.#l=setInterval(()=>{this.#F()},this.#o),this.#s=Date.now()+this.#o)}#F(){this.#d||(this.#n===0&&this.#g===0&&this.#l&&this.#j(),this.#n=this.#e?this.#g:0),this.#I(),this.#z()}#I(){for(;this.#N(););}get concurrency(){return this.#_}set concurrency(e){if(!(typeof e==`number`&&e>=1))throw TypeError(`Expected \`concurrency\` to be a number from 1 and up, got \`${e}\` (${typeof e})`);this.#_=e,this.#I()}setPriority(e,t){if(typeof t!=`number`||!Number.isFinite(t))throw TypeError(`Expected \`priority\` to be a finite number, got \`${t}\` (${typeof t})`);this.#m.setPriority(e,t)}async add(e,t={}){return t={timeout:this.timeout,...t,id:t.id??(this.#y++).toString()},new Promise((n,r)=>{let i=Symbol(`task-${t.id}`);this.#m.enqueue(async()=>{this.#g++,this.#b.set(i,{id:t.id,priority:t.priority??0,startTime:Date.now(),timeout:t.timeout});let a;try{try{t.signal?.throwIfAborted()}catch(e){throw this.#B(),this.#b.delete(i),e}this.#c=Date.now();let r=e({signal:t.signal});if(t.timeout&&(r=p(Promise.resolve(r),{milliseconds:t.timeout,message:`Task timed out after ${t.timeout}ms (queue has ${this.#g} running, ${this.#m.size} waiting)`})),t.signal){let{signal:e}=t;r=Promise.race([r,new Promise((t,n)=>{a=()=>{n(e.reason)},e.addEventListener(`abort`,a,{once:!0})})])}let o=await r;n(o),this.emit(`completed`,o)}catch(e){r(e),this.emit(`error`,e)}finally{a&&t.signal?.removeEventListener(`abort`,a),this.#b.delete(i),queueMicrotask(()=>{this.#D()})}},t),this.emit(`add`),this.#N()})}async addAll(e,t){return Promise.all(e.map(async e=>this.add(e,t)))}start(){return this.#v?(this.#v=!1,this.#I(),this):this}pause(){this.#v=!0}clear(){this.#m=new this.#h,this.#j(),this.#V(),this.emit(`empty`),this.#g===0&&(this.#M(),this.emit(`idle`)),this.emit(`next`)}async onEmpty(){this.#m.size!==0&&await this.#L(`empty`)}async onSizeLessThan(e){this.#m.size<e||await this.#L(`next`,()=>this.#m.size<e)}async onIdle(){this.#g===0&&this.#m.size===0||await this.#L(`idle`)}async onPendingZero(){this.#g!==0&&await this.#L(`pendingZero`)}async onRateLimit(){this.isRateLimited||await this.#L(`rateLimit`)}async onRateLimitCleared(){this.isRateLimited&&await this.#L(`rateLimitCleared`)}onError(){return new Promise((e,t)=>{let n=e=>{this.off(`error`,n),t(e)};this.on(`error`,n)})}async#L(e,t){return new Promise(n=>{let r=()=>{t&&!t()||(this.off(e,r),n())};this.on(e,r)})}get size(){return this.#m.size}sizeBy(e){return this.#m.filter(e).length}get pending(){return this.#g}get isPaused(){return this.#v}#R(){this.#t||(this.on(`add`,()=>{this.#m.size>0&&this.#z()}),this.on(`next`,()=>{this.#z()}))}#z(){this.#t||this.#a||(this.#a=!0,queueMicrotask(()=>{this.#a=!1,this.#V()}))}#B(){this.#t||(this.#C(),this.#z())}#V(){let e=this.#i;if(this.#t||this.#m.size===0){e&&(this.#i=!1,this.emit(`rateLimitCleared`));return}let t;if(this.#d){let e=Date.now();this.#x(e),t=this.#w()}else t=this.#n;let n=t>=this.#r;n!==e&&(this.#i=n,this.emit(n?`rateLimit`:`rateLimitCleared`))}get isRateLimited(){return this.#i}get isSaturated(){return this.#g===this.#_&&this.#m.size>0||this.isRateLimited&&this.#m.size>0}get runningTasks(){return[...this.#b.values()].map(e=>({...e}))}},_=o(((e,t)=>{function n(e){if(typeof e!=`string`)throw TypeError(`Path must be a string. Received `+JSON.stringify(e))}function r(e,t){for(var n=``,r=0,i=-1,a=0,o,s=0;s<=e.length;++s){if(s<e.length)o=e.charCodeAt(s);else if(o===47)break;else o=47;if(o===47){if(!(i===s-1||a===1))if(i!==s-1&&a===2){if(n.length<2||r!==2||n.charCodeAt(n.length-1)!==46||n.charCodeAt(n.length-2)!==46){if(n.length>2){var c=n.lastIndexOf(`/`);if(c!==n.length-1){c===-1?(n=``,r=0):(n=n.slice(0,c),r=n.length-1-n.lastIndexOf(`/`)),i=s,a=0;continue}}else if(n.length===2||n.length===1){n=``,r=0,i=s,a=0;continue}}t&&(n.length>0?n+=`/..`:n=`..`,r=2)}else n.length>0?n+=`/`+e.slice(i+1,s):n=e.slice(i+1,s),r=s-i-1;i=s,a=0}else o===46&&a!==-1?++a:a=-1}return n}function i(e,t){var n=t.dir||t.root,r=t.base||(t.name||``)+(t.ext||``);return n?n===t.root?n+r:n+e+r:r}var a={resolve:function(){for(var e=``,t=!1,i,a=arguments.length-1;a>=-1&&!t;a--){var o;a>=0?o=arguments[a]:(i===void 0&&(i=process.cwd()),o=i),n(o),o.length!==0&&(e=o+`/`+e,t=o.charCodeAt(0)===47)}return e=r(e,!t),t?e.length>0?`/`+e:`/`:e.length>0?e:`.`},normalize:function(e){if(n(e),e.length===0)return`.`;var t=e.charCodeAt(0)===47,i=e.charCodeAt(e.length-1)===47;return e=r(e,!t),e.length===0&&!t&&(e=`.`),e.length>0&&i&&(e+=`/`),t?`/`+e:e},isAbsolute:function(e){return n(e),e.length>0&&e.charCodeAt(0)===47},join:function(){if(arguments.length===0)return`.`;for(var e,t=0;t<arguments.length;++t){var r=arguments[t];n(r),r.length>0&&(e===void 0?e=r:e+=`/`+r)}return e===void 0?`.`:a.normalize(e)},relative:function(e,t){if(n(e),n(t),e===t||(e=a.resolve(e),t=a.resolve(t),e===t))return``;for(var r=1;r<e.length&&e.charCodeAt(r)===47;++r);for(var i=e.length,o=i-r,s=1;s<t.length&&t.charCodeAt(s)===47;++s);for(var c=t.length-s,l=o<c?o:c,u=-1,d=0;d<=l;++d){if(d===l){if(c>l){if(t.charCodeAt(s+d)===47)return t.slice(s+d+1);if(d===0)return t.slice(s+d)}else o>l&&(e.charCodeAt(r+d)===47?u=d:d===0&&(u=0));break}var f=e.charCodeAt(r+d);if(f!==t.charCodeAt(s+d))break;f===47&&(u=d)}var p=``;for(d=r+u+1;d<=i;++d)(d===i||e.charCodeAt(d)===47)&&(p.length===0?p+=`..`:p+=`/..`);return p.length>0?p+t.slice(s+u):(s+=u,t.charCodeAt(s)===47&&++s,t.slice(s))},_makeLong:function(e){return e},dirname:function(e){if(n(e),e.length===0)return`.`;for(var t=e.charCodeAt(0),r=t===47,i=-1,a=!0,o=e.length-1;o>=1;--o)if(t=e.charCodeAt(o),t===47){if(!a){i=o;break}}else a=!1;return i===-1?r?`/`:`.`:r&&i===1?`//`:e.slice(0,i)},basename:function(e,t){if(t!==void 0&&typeof t!=`string`)throw TypeError(`"ext" argument must be a string`);n(e);var r=0,i=-1,a=!0,o;if(t!==void 0&&t.length>0&&t.length<=e.length){if(t.length===e.length&&t===e)return``;var s=t.length-1,c=-1;for(o=e.length-1;o>=0;--o){var l=e.charCodeAt(o);if(l===47){if(!a){r=o+1;break}}else c===-1&&(a=!1,c=o+1),s>=0&&(l===t.charCodeAt(s)?--s===-1&&(i=o):(s=-1,i=c))}return r===i?i=c:i===-1&&(i=e.length),e.slice(r,i)}else{for(o=e.length-1;o>=0;--o)if(e.charCodeAt(o)===47){if(!a){r=o+1;break}}else i===-1&&(a=!1,i=o+1);return i===-1?``:e.slice(r,i)}},extname:function(e){n(e);for(var t=-1,r=0,i=-1,a=!0,o=0,s=e.length-1;s>=0;--s){var c=e.charCodeAt(s);if(c===47){if(!a){r=s+1;break}continue}i===-1&&(a=!1,i=s+1),c===46?t===-1?t=s:o!==1&&(o=1):t!==-1&&(o=-1)}return t===-1||i===-1||o===0||o===1&&t===i-1&&t===r+1?``:e.slice(t,i)},format:function(e){if(typeof e!=`object`||!e)throw TypeError(`The "pathObject" argument must be of type Object. Received type `+typeof e);return i(`/`,e)},parse:function(e){n(e);var t={root:``,dir:``,base:``,ext:``,name:``};if(e.length===0)return t;var r=e.charCodeAt(0),i=r===47,a;i?(t.root=`/`,a=1):a=0;for(var o=-1,s=0,c=-1,l=!0,u=e.length-1,d=0;u>=a;--u){if(r=e.charCodeAt(u),r===47){if(!l){s=u+1;break}continue}c===-1&&(l=!1,c=u+1),r===46?o===-1?o=u:d!==1&&(d=1):o!==-1&&(d=-1)}return o===-1||c===-1||d===0||d===1&&o===c-1&&o===s+1?c!==-1&&(s===0&&i?t.base=t.name=e.slice(1,c):t.base=t.name=e.slice(s,c)):(s===0&&i?(t.name=e.slice(1,o),t.base=e.slice(1,c)):(t.name=e.slice(s,o),t.base=e.slice(s,c)),t.ext=e.slice(o,c)),s>0?t.dir=e.slice(0,s-1):i&&(t.dir=`/`),t},sep:`/`,delimiter:`:`,win32:null,posix:null};a.posix=a,t.exports=a}));function v(e,t){return function(){return e.apply(t,arguments)}}let{toString:y}=Object.prototype,{getPrototypeOf:ee}=Object,{iterator:b,toStringTag:x}=Symbol,S=(e=>t=>{let n=y.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),C=e=>(e=e.toLowerCase(),t=>S(t)===e),te=e=>t=>typeof t===e,{isArray:ne}=Array,re=te(`undefined`);function ie(e){return e!==null&&!re(e)&&e.constructor!==null&&!re(e.constructor)&&w(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}let ae=C(`ArrayBuffer`);function oe(e){let t;return t=typeof ArrayBuffer<`u`&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&ae(e.buffer),t}let se=te(`string`),w=te(`function`),ce=te(`number`),le=e=>typeof e==`object`&&!!e,ue=e=>e===!0||e===!1,de=e=>{if(S(e)!==`object`)return!1;let t=ee(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(x in e)&&!(b in e)},fe=e=>{if(!le(e)||ie(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch{return!1}},pe=C(`Date`),me=C(`File`),he=e=>!!(e&&e.uri!==void 0),ge=e=>e&&e.getParts!==void 0,_e=C(`Blob`),ve=C(`FileList`),ye=e=>le(e)&&w(e.pipe);function be(){return typeof globalThis<`u`?globalThis:typeof self<`u`?self:typeof window<`u`?window:typeof global<`u`?global:{}}let xe=be(),Se=xe.FormData===void 0?void 0:xe.FormData,Ce=e=>{let t;return e&&(Se&&e instanceof Se||w(e.append)&&((t=S(e))===`formdata`||t===`object`&&w(e.toString)&&e.toString()===`[object FormData]`))},we=C(`URLSearchParams`),[Te,Ee,De,Oe]=[`ReadableStream`,`Request`,`Response`,`Headers`].map(C),ke=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,``);function Ae(e,t,{allOwnKeys:n=!1}={}){if(e==null)return;let r,i;if(typeof e!=`object`&&(e=[e]),ne(e))for(r=0,i=e.length;r<i;r++)t.call(null,e[r],r,e);else{if(ie(e))return;let i=n?Object.getOwnPropertyNames(e):Object.keys(e),a=i.length,o;for(r=0;r<a;r++)o=i[r],t.call(null,e[o],o,e)}}function je(e,t){if(ie(e))return null;t=t.toLowerCase();let n=Object.keys(e),r=n.length,i;for(;r-- >0;)if(i=n[r],t===i.toLowerCase())return i;return null}let Me=typeof globalThis<`u`?globalThis:typeof self<`u`?self:typeof window<`u`?window:global,Ne=e=>!re(e)&&e!==Me;function Pe(){let{caseless:e,skipUndefined:t}=Ne(this)&&this||{},n={},r=(r,i)=>{if(i===`__proto__`||i===`constructor`||i===`prototype`)return;let a=e&&je(n,i)||i;de(n[a])&&de(r)?n[a]=Pe(n[a],r):de(r)?n[a]=Pe({},r):ne(r)?n[a]=r.slice():(!t||!re(r))&&(n[a]=r)};for(let e=0,t=arguments.length;e<t;e++)arguments[e]&&Ae(arguments[e],r);return n}let Fe=(e,t,n,{allOwnKeys:r}={})=>(Ae(t,(t,r)=>{n&&w(t)?Object.defineProperty(e,r,{value:v(t,n),writable:!0,enumerable:!0,configurable:!0}):Object.defineProperty(e,r,{value:t,writable:!0,enumerable:!0,configurable:!0})},{allOwnKeys:r}),e),Ie=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),Le=(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),Object.defineProperty(e.prototype,`constructor`,{value:e,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(e,`super`,{value:t.prototype}),n&&Object.assign(e.prototype,n)},Re=(e,t,n,r)=>{let i,a,o,s={};if(t||={},e==null)return t;do{for(i=Object.getOwnPropertyNames(e),a=i.length;a-- >0;)o=i[a],(!r||r(o,e,t))&&!s[o]&&(t[o]=e[o],s[o]=!0);e=n!==!1&&ee(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},ze=(e,t,n)=>{e=String(e),(n===void 0||n>e.length)&&(n=e.length),n-=t.length;let r=e.indexOf(t,n);return r!==-1&&r===n},Be=e=>{if(!e)return null;if(ne(e))return e;let t=e.length;if(!ce(t))return null;let n=Array(t);for(;t-- >0;)n[t]=e[t];return n},Ve=(e=>t=>e&&t instanceof e)(typeof Uint8Array<`u`&&ee(Uint8Array)),He=(e,t)=>{let n=(e&&e[b]).call(e),r;for(;(r=n.next())&&!r.done;){let n=r.value;t.call(e,n[0],n[1])}},Ue=(e,t)=>{let n,r=[];for(;(n=e.exec(t))!==null;)r.push(n);return r},We=C(`HTMLFormElement`),Ge=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(e,t,n){return t.toUpperCase()+n}),Ke=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),qe=C(`RegExp`),Je=(e,t)=>{let n=Object.getOwnPropertyDescriptors(e),r={};Ae(n,(n,i)=>{let a;(a=t(n,i,e))!==!1&&(r[i]=a||n)}),Object.defineProperties(e,r)},Ye=e=>{Je(e,(t,n)=>{if(w(e)&&[`arguments`,`caller`,`callee`].indexOf(n)!==-1)return!1;let r=e[n];if(w(r)){if(t.enumerable=!1,`writable`in t){t.writable=!1;return}t.set||=()=>{throw Error(`Can not rewrite read-only method '`+n+`'`)}}})},Xe=(e,t)=>{let n={},r=e=>{e.forEach(e=>{n[e]=!0})};return ne(e)?r(e):r(String(e).split(t)),n},Ze=()=>{},Qe=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function $e(e){return!!(e&&w(e.append)&&e[x]===`FormData`&&e[b])}let et=e=>{let t=Array(10),n=(e,r)=>{if(le(e)){if(t.indexOf(e)>=0)return;if(ie(e))return e;if(!(`toJSON`in e)){t[r]=e;let i=ne(e)?[]:{};return Ae(e,(e,t)=>{let a=n(e,r+1);!re(a)&&(i[t]=a)}),t[r]=void 0,i}}return e};return n(e,0)},tt=C(`AsyncFunction`),nt=e=>e&&(le(e)||w(e))&&w(e.then)&&w(e.catch),rt=((e,t)=>e?setImmediate:t?((e,t)=>(Me.addEventListener(`message`,({source:n,data:r})=>{n===Me&&r===e&&t.length&&t.shift()()},!1),n=>{t.push(n),Me.postMessage(e,`*`)}))(`axios@${Math.random()}`,[]):e=>setTimeout(e))(typeof setImmediate==`function`,w(Me.postMessage));var T={isArray:ne,isArrayBuffer:ae,isBuffer:ie,isFormData:Ce,isArrayBufferView:oe,isString:se,isNumber:ce,isBoolean:ue,isObject:le,isPlainObject:de,isEmptyObject:fe,isReadableStream:Te,isRequest:Ee,isResponse:De,isHeaders:Oe,isUndefined:re,isDate:pe,isFile:me,isReactNativeBlob:he,isReactNative:ge,isBlob:_e,isRegExp:qe,isFunction:w,isStream:ye,isURLSearchParams:we,isTypedArray:Ve,isFileList:ve,forEach:Ae,merge:Pe,extend:Fe,trim:ke,stripBOM:Ie,inherits:Le,toFlatObject:Re,kindOf:S,kindOfTest:C,endsWith:ze,toArray:Be,forEachEntry:He,matchAll:Ue,isHTMLForm:We,hasOwnProperty:Ke,hasOwnProp:Ke,reduceDescriptors:Je,freezeMethods:Ye,toObjectSet:Xe,toCamelCase:Ge,noop:Ze,toFiniteNumber:Qe,findKey:je,global:Me,isContextDefined:Ne,isSpecCompliantForm:$e,toJSONObject:et,isAsyncFn:tt,isThenable:nt,setImmediate:rt,asap:typeof queueMicrotask<`u`?queueMicrotask.bind(Me):typeof process<`u`&&process.nextTick||rt,isIterable:e=>e!=null&&w(e[b])},E=class e extends Error{static from(t,n,r,i,a,o){let s=new e(t.message,n||t.code,r,i,a);return s.cause=t,s.name=t.name,t.status!=null&&s.status==null&&(s.status=t.status),o&&Object.assign(s,o),s}constructor(e,t,n,r,i){super(e),Object.defineProperty(this,`message`,{value:e,enumerable:!0,writable:!0,configurable:!0}),this.name=`AxiosError`,this.isAxiosError=!0,t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),i&&(this.response=i,this.status=i.status)}toJSON(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:T.toJSONObject(this.config),code:this.code,status:this.status}}};E.ERR_BAD_OPTION_VALUE=`ERR_BAD_OPTION_VALUE`,E.ERR_BAD_OPTION=`ERR_BAD_OPTION`,E.ECONNABORTED=`ECONNABORTED`,E.ETIMEDOUT=`ETIMEDOUT`,E.ERR_NETWORK=`ERR_NETWORK`,E.ERR_FR_TOO_MANY_REDIRECTS=`ERR_FR_TOO_MANY_REDIRECTS`,E.ERR_DEPRECATED=`ERR_DEPRECATED`,E.ERR_BAD_RESPONSE=`ERR_BAD_RESPONSE`,E.ERR_BAD_REQUEST=`ERR_BAD_REQUEST`,E.ERR_CANCELED=`ERR_CANCELED`,E.ERR_NOT_SUPPORT=`ERR_NOT_SUPPORT`,E.ERR_INVALID_URL=`ERR_INVALID_URL`;function it(e){return T.isPlainObject(e)||T.isArray(e)}function at(e){return T.endsWith(e,`[]`)?e.slice(0,-2):e}function ot(e,t,n){return e?e.concat(t).map(function(e,t){return e=at(e),!n&&t?`[`+e+`]`:e}).join(n?`.`:``):t}function st(e){return T.isArray(e)&&!e.some(it)}let ct=T.toFlatObject(T,{},null,function(e){return/^is[A-Z]/.test(e)});function lt(e,t,n){if(!T.isObject(e))throw TypeError(`target must be an object`);t||=new FormData,n=T.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(e,t){return!T.isUndefined(t[e])});let r=n.metaTokens,i=n.visitor||l,a=n.dots,o=n.indexes,s=(n.Blob||typeof Blob<`u`&&Blob)&&T.isSpecCompliantForm(t);if(!T.isFunction(i))throw TypeError(`visitor must be a function`);function c(e){if(e===null)return``;if(T.isDate(e))return e.toISOString();if(T.isBoolean(e))return e.toString();if(!s&&T.isBlob(e))throw new E(`Blob is not supported. Use a Buffer instead.`);return T.isArrayBuffer(e)||T.isTypedArray(e)?s&&typeof Blob==`function`?new Blob([e]):Buffer.from(e):e}function l(e,n,i){let s=e;if(T.isReactNative(t)&&T.isReactNativeBlob(e))return t.append(ot(i,n,a),c(e)),!1;if(e&&!i&&typeof e==`object`){if(T.endsWith(n,`{}`))n=r?n:n.slice(0,-2),e=JSON.stringify(e);else if(T.isArray(e)&&st(e)||(T.isFileList(e)||T.endsWith(n,`[]`))&&(s=T.toArray(e)))return n=at(n),s.forEach(function(e,r){!(T.isUndefined(e)||e===null)&&t.append(o===!0?ot([n],r,a):o===null?n:n+`[]`,c(e))}),!1}return it(e)?!0:(t.append(ot(i,n,a),c(e)),!1)}let u=[],d=Object.assign(ct,{defaultVisitor:l,convertValue:c,isVisitable:it});function f(e,n){if(!T.isUndefined(e)){if(u.indexOf(e)!==-1)throw Error(`Circular reference detected in `+n.join(`.`));u.push(e),T.forEach(e,function(e,r){(!(T.isUndefined(e)||e===null)&&i.call(t,e,T.isString(r)?r.trim():r,n,d))===!0&&f(e,n?n.concat(r):[r])}),u.pop()}}if(!T.isObject(e))throw TypeError(`data must be an object`);return f(e),t}function ut(e){let t={"!":`%21`,"'":`%27`,"(":`%28`,")":`%29`,"~":`%7E`,"%20":`+`,"%00":`\0`};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(e){return t[e]})}function dt(e,t){this._pairs=[],e&<(e,this,t)}let ft=dt.prototype;ft.append=function(e,t){this._pairs.push([e,t])},ft.toString=function(e){let t=e?function(t){return e.call(this,t,ut)}:ut;return this._pairs.map(function(e){return t(e[0])+`=`+t(e[1])},``).join(`&`)};function pt(e){return encodeURIComponent(e).replace(/%3A/gi,`:`).replace(/%24/g,`$`).replace(/%2C/gi,`,`).replace(/%20/g,`+`)}function mt(e,t,n){if(!t)return e;let r=n&&n.encode||pt,i=T.isFunction(n)?{serialize:n}:n,a=i&&i.serialize,o;if(o=a?a(t,i):T.isURLSearchParams(t)?t.toString():new dt(t,i).toString(r),o){let t=e.indexOf(`#`);t!==-1&&(e=e.slice(0,t)),e+=(e.indexOf(`?`)===-1?`?`:`&`)+o}return e}var ht=class{constructor(){this.handlers=[]}use(e,t,n){return this.handlers.push({fulfilled:e,rejected:t,synchronous:n?n.synchronous:!1,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&=[]}forEach(e){T.forEach(this.handlers,function(t){t!==null&&e(t)})}},gt={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1,legacyInterceptorReqResOrdering:!0},_t={isBrowser:!0,classes:{URLSearchParams:typeof URLSearchParams<`u`?URLSearchParams:dt,FormData:typeof FormData<`u`?FormData:null,Blob:typeof Blob<`u`?Blob:null},protocols:[`http`,`https`,`file`,`blob`,`url`,`data`]},vt=s({hasBrowserEnv:()=>yt,hasStandardBrowserEnv:()=>xt,hasStandardBrowserWebWorkerEnv:()=>St,navigator:()=>bt,origin:()=>Ct});let yt=typeof window<`u`&&typeof document<`u`,bt=typeof navigator==`object`&&navigator||void 0,xt=yt&&(!bt||[`ReactNative`,`NativeScript`,`NS`].indexOf(bt.product)<0),St=typeof WorkerGlobalScope<`u`&&self instanceof WorkerGlobalScope&&typeof self.importScripts==`function`,Ct=yt&&window.location.href||`http://localhost`;var D={...vt,..._t};function wt(e,t){return lt(e,new D.classes.URLSearchParams,{visitor:function(e,t,n,r){return D.isNode&&T.isBuffer(e)?(this.append(t,e.toString(`base64`)),!1):r.defaultVisitor.apply(this,arguments)},...t})}function Tt(e){return T.matchAll(/\w+|\[(\w*)]/g,e).map(e=>e[0]===`[]`?``:e[1]||e[0])}function Et(e){let t={},n=Object.keys(e),r,i=n.length,a;for(r=0;r<i;r++)a=n[r],t[a]=e[a];return t}function Dt(e){function t(e,n,r,i){let a=e[i++];if(a===`__proto__`)return!0;let o=Number.isFinite(+a),s=i>=e.length;return a=!a&&T.isArray(r)?r.length:a,s?(T.hasOwnProp(r,a)?r[a]=[r[a],n]:r[a]=n,!o):((!r[a]||!T.isObject(r[a]))&&(r[a]=[]),t(e,n,r[a],i)&&T.isArray(r[a])&&(r[a]=Et(r[a])),!o)}if(T.isFormData(e)&&T.isFunction(e.entries)){let n={};return T.forEachEntry(e,(e,r)=>{t(Tt(e),r,n,0)}),n}return null}function Ot(e,t,n){if(T.isString(e))try{return(t||JSON.parse)(e),T.trim(e)}catch(e){if(e.name!==`SyntaxError`)throw e}return(n||JSON.stringify)(e)}let kt={transitional:gt,adapter:[`xhr`,`http`,`fetch`],transformRequest:[function(e,t){let n=t.getContentType()||``,r=n.indexOf(`application/json`)>-1,i=T.isObject(e);if(i&&T.isHTMLForm(e)&&(e=new FormData(e)),T.isFormData(e))return r?JSON.stringify(Dt(e)):e;if(T.isArrayBuffer(e)||T.isBuffer(e)||T.isStream(e)||T.isFile(e)||T.isBlob(e)||T.isReadableStream(e))return e;if(T.isArrayBufferView(e))return e.buffer;if(T.isURLSearchParams(e))return t.setContentType(`application/x-www-form-urlencoded;charset=utf-8`,!1),e.toString();let a;if(i){if(n.indexOf(`application/x-www-form-urlencoded`)>-1)return wt(e,this.formSerializer).toString();if((a=T.isFileList(e))||n.indexOf(`multipart/form-data`)>-1){let t=this.env&&this.env.FormData;return lt(a?{"files[]":e}:e,t&&new t,this.formSerializer)}}return i||r?(t.setContentType(`application/json`,!1),Ot(e)):e}],transformResponse:[function(e){let t=this.transitional||kt.transitional,n=t&&t.forcedJSONParsing,r=this.responseType===`json`;if(T.isResponse(e)||T.isReadableStream(e))return e;if(e&&T.isString(e)&&(n&&!this.responseType||r)){let n=!(t&&t.silentJSONParsing)&&r;try{return JSON.parse(e,this.parseReviver)}catch(e){if(n)throw e.name===`SyntaxError`?E.from(e,E.ERR_BAD_RESPONSE,this,null,this.response):e}}return e}],timeout:0,xsrfCookieName:`XSRF-TOKEN`,xsrfHeaderName:`X-XSRF-TOKEN`,maxContentLength:-1,maxBodyLength:-1,env:{FormData:D.classes.FormData,Blob:D.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:`application/json, text/plain, */*`,"Content-Type":void 0}}};T.forEach([`delete`,`get`,`head`,`post`,`put`,`patch`],e=>{kt.headers[e]={}});let At=T.toObjectSet([`age`,`authorization`,`content-length`,`content-type`,`etag`,`expires`,`from`,`host`,`if-modified-since`,`if-unmodified-since`,`last-modified`,`location`,`max-forwards`,`proxy-authorization`,`referer`,`retry-after`,`user-agent`]);var jt=e=>{let t={},n,r,i;return e&&e.split(`
|
|
2
|
-
`).forEach(function(e){i=e.indexOf(`:`),n=e.substring(0,i).trim().toLowerCase(),r=e.substring(i+1).trim(),!(!n||t[n]&&At[n])&&(n===`set-cookie`?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+`, `+r:r)}),t};let Mt=Symbol(`internals`);function Nt(e){return e&&String(e).trim().toLowerCase()}function Pt(e){return e===!1||e==null?e:T.isArray(e)?e.map(Pt):String(e)}function Ft(e){let t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g,r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}let It=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function Lt(e,t,n,r,i){if(T.isFunction(r))return r.call(this,t,n);if(i&&(t=n),T.isString(t)){if(T.isString(r))return t.indexOf(r)!==-1;if(T.isRegExp(r))return r.test(t)}}function Rt(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,t,n)=>t.toUpperCase()+n)}function zt(e,t){let n=T.toCamelCase(` `+t);[`get`,`set`,`has`].forEach(r=>{Object.defineProperty(e,r+n,{value:function(e,n,i){return this[r].call(this,t,e,n,i)},configurable:!0})})}var O=class{constructor(e){e&&this.set(e)}set(e,t,n){let r=this;function i(e,t,n){let i=Nt(t);if(!i)throw Error(`header name must be a non-empty string`);let a=T.findKey(r,i);(!a||r[a]===void 0||n===!0||n===void 0&&r[a]!==!1)&&(r[a||t]=Pt(e))}let a=(e,t)=>T.forEach(e,(e,n)=>i(e,n,t));if(T.isPlainObject(e)||e instanceof this.constructor)a(e,t);else if(T.isString(e)&&(e=e.trim())&&!It(e))a(jt(e),t);else if(T.isObject(e)&&T.isIterable(e)){let n={},r,i;for(let t of e){if(!T.isArray(t))throw TypeError(`Object iterator must return a key-value pair`);n[i=t[0]]=(r=n[i])?T.isArray(r)?[...r,t[1]]:[r,t[1]]:t[1]}a(n,t)}else e!=null&&i(t,e,n);return this}get(e,t){if(e=Nt(e),e){let n=T.findKey(this,e);if(n){let e=this[n];if(!t)return e;if(t===!0)return Ft(e);if(T.isFunction(t))return t.call(this,e,n);if(T.isRegExp(t))return t.exec(e);throw TypeError(`parser must be boolean|regexp|function`)}}}has(e,t){if(e=Nt(e),e){let n=T.findKey(this,e);return!!(n&&this[n]!==void 0&&(!t||Lt(this,this[n],n,t)))}return!1}delete(e,t){let n=this,r=!1;function i(e){if(e=Nt(e),e){let i=T.findKey(n,e);i&&(!t||Lt(n,n[i],i,t))&&(delete n[i],r=!0)}}return T.isArray(e)?e.forEach(i):i(e),r}clear(e){let t=Object.keys(this),n=t.length,r=!1;for(;n--;){let i=t[n];(!e||Lt(this,this[i],i,e,!0))&&(delete this[i],r=!0)}return r}normalize(e){let t=this,n={};return T.forEach(this,(r,i)=>{let a=T.findKey(n,i);if(a){t[a]=Pt(r),delete t[i];return}let o=e?Rt(i):String(i).trim();o!==i&&delete t[i],t[o]=Pt(r),n[o]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){let t=Object.create(null);return T.forEach(this,(n,r)=>{n!=null&&n!==!1&&(t[r]=e&&T.isArray(n)?n.join(`, `):n)}),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,t])=>e+`: `+t).join(`
|
|
3
|
-
`)}getSetCookie(){return this.get(`set-cookie`)||[]}get[Symbol.toStringTag](){return`AxiosHeaders`}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){let n=new this(e);return t.forEach(e=>n.set(e)),n}static accessor(e){let t=(this[Mt]=this[Mt]={accessors:{}}).accessors,n=this.prototype;function r(e){let r=Nt(e);t[r]||(zt(n,e),t[r]=!0)}return T.isArray(e)?e.forEach(r):r(e),this}};O.accessor([`Content-Type`,`Content-Length`,`Accept`,`Accept-Encoding`,`User-Agent`,`Authorization`]),T.reduceDescriptors(O.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(e){this[n]=e}}}),T.freezeMethods(O);function Bt(e,t){let n=this||kt,r=t||n,i=O.from(r.headers),a=r.data;return T.forEach(e,function(e){a=e.call(n,a,i.normalize(),t?t.status:void 0)}),i.normalize(),a}function Vt(e){return!!(e&&e.__CANCEL__)}var Ht=class extends E{constructor(e,t,n){super(e??`canceled`,E.ERR_CANCELED,t,n),this.name=`CanceledError`,this.__CANCEL__=!0}};function Ut(e,t,n){let r=n.config.validateStatus;!n.status||!r||r(n.status)?e(n):t(new E(`Request failed with status code `+n.status,[E.ERR_BAD_REQUEST,E.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function Wt(e){let t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||``}function Gt(e,t){e||=10;let n=Array(e),r=Array(e),i=0,a=0,o;return t=t===void 0?1e3:t,function(s){let c=Date.now(),l=r[a];o||=c,n[i]=s,r[i]=c;let u=a,d=0;for(;u!==i;)d+=n[u++],u%=e;if(i=(i+1)%e,i===a&&(a=(a+1)%e),c-o<t)return;let f=l&&c-l;return f?Math.round(d*1e3/f):void 0}}function Kt(e,t){let n=0,r=1e3/t,i,a,o=(t,r=Date.now())=>{n=r,i=null,a&&=(clearTimeout(a),null),e(...t)};return[(...e)=>{let t=Date.now(),s=t-n;s>=r?o(e,t):(i=e,a||=setTimeout(()=>{a=null,o(i)},r-s))},()=>i&&o(i)]}let qt=(e,t,n=3)=>{let r=0,i=Gt(50,250);return Kt(n=>{let a=n.loaded,o=n.lengthComputable?n.total:void 0,s=a-r,c=i(s),l=a<=o;r=a,e({loaded:a,total:o,progress:o?a/o:void 0,bytes:s,rate:c||void 0,estimated:c&&o&&l?(o-a)/c:void 0,event:n,lengthComputable:o!=null,[t?`download`:`upload`]:!0})},n)},Jt=(e,t)=>{let n=e!=null;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},Yt=e=>(...t)=>T.asap(()=>e(...t));var Xt=D.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,D.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(D.origin),D.navigator&&/(msie|trident)/i.test(D.navigator.userAgent)):()=>!0,Zt=D.hasStandardBrowserEnv?{write(e,t,n,r,i,a,o){if(typeof document>`u`)return;let s=[`${e}=${encodeURIComponent(t)}`];T.isNumber(n)&&s.push(`expires=${new Date(n).toUTCString()}`),T.isString(r)&&s.push(`path=${r}`),T.isString(i)&&s.push(`domain=${i}`),a===!0&&s.push(`secure`),T.isString(o)&&s.push(`SameSite=${o}`),document.cookie=s.join(`; `)},read(e){if(typeof document>`u`)return null;let t=document.cookie.match(RegExp(`(?:^|; )`+e+`=([^;]*)`));return t?decodeURIComponent(t[1]):null},remove(e){this.write(e,``,Date.now()-864e5,`/`)}}:{write(){},read(){return null},remove(){}};function Qt(e){return typeof e==`string`?/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e):!1}function $t(e,t){return t?e.replace(/\/?\/$/,``)+`/`+t.replace(/^\/+/,``):e}function en(e,t,n){let r=!Qt(t);return e&&(r||n==0)?$t(e,t):t}let tn=e=>e instanceof O?{...e}:e;function nn(e,t){t||={};let n={};function r(e,t,n,r){return T.isPlainObject(e)&&T.isPlainObject(t)?T.merge.call({caseless:r},e,t):T.isPlainObject(t)?T.merge({},t):T.isArray(t)?t.slice():t}function i(e,t,n,i){if(!T.isUndefined(t))return r(e,t,n,i);if(!T.isUndefined(e))return r(void 0,e,n,i)}function a(e,t){if(!T.isUndefined(t))return r(void 0,t)}function o(e,t){if(!T.isUndefined(t))return r(void 0,t);if(!T.isUndefined(e))return r(void 0,e)}function s(n,i,a){if(a in t)return r(n,i);if(a in e)return r(void 0,n)}let c={url:a,method:a,data:a,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,withXSRFToken:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,responseEncoding:o,validateStatus:s,headers:(e,t,n)=>i(tn(e),tn(t),n,!0)};return T.forEach(Object.keys({...e,...t}),function(r){if(r===`__proto__`||r===`constructor`||r===`prototype`)return;let a=T.hasOwnProp(c,r)?c[r]:i,o=a(e[r],t[r],r);T.isUndefined(o)&&a!==s||(n[r]=o)}),n}var rn=e=>{let t=nn({},e),{data:n,withXSRFToken:r,xsrfHeaderName:i,xsrfCookieName:a,headers:o,auth:s}=t;if(t.headers=o=O.from(o),t.url=mt(en(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),s&&o.set(`Authorization`,`Basic `+btoa((s.username||``)+`:`+(s.password?unescape(encodeURIComponent(s.password)):``))),T.isFormData(n)){if(D.hasStandardBrowserEnv||D.hasStandardBrowserWebWorkerEnv)o.setContentType(void 0);else if(T.isFunction(n.getHeaders)){let e=n.getHeaders(),t=[`content-type`,`content-length`];Object.entries(e).forEach(([e,n])=>{t.includes(e.toLowerCase())&&o.set(e,n)})}}if(D.hasStandardBrowserEnv&&(r&&T.isFunction(r)&&(r=r(t)),r||r!==!1&&Xt(t.url))){let e=i&&a&&Zt.read(a);e&&o.set(i,e)}return t},an=typeof XMLHttpRequest<`u`&&function(e){return new Promise(function(t,n){let r=rn(e),i=r.data,a=O.from(r.headers).normalize(),{responseType:o,onUploadProgress:s,onDownloadProgress:c}=r,l,u,d,f,p;function m(){f&&f(),p&&p(),r.cancelToken&&r.cancelToken.unsubscribe(l),r.signal&&r.signal.removeEventListener(`abort`,l)}let h=new XMLHttpRequest;h.open(r.method.toUpperCase(),r.url,!0),h.timeout=r.timeout;function g(){if(!h)return;let r=O.from(`getAllResponseHeaders`in h&&h.getAllResponseHeaders());Ut(function(e){t(e),m()},function(e){n(e),m()},{data:!o||o===`text`||o===`json`?h.responseText:h.response,status:h.status,statusText:h.statusText,headers:r,config:e,request:h}),h=null}`onloadend`in h?h.onloadend=g:h.onreadystatechange=function(){!h||h.readyState!==4||h.status===0&&!(h.responseURL&&h.responseURL.indexOf(`file:`)===0)||setTimeout(g)},h.onabort=function(){h&&=(n(new E(`Request aborted`,E.ECONNABORTED,e,h)),null)},h.onerror=function(t){let r=new E(t&&t.message?t.message:`Network Error`,E.ERR_NETWORK,e,h);r.event=t||null,n(r),h=null},h.ontimeout=function(){let t=r.timeout?`timeout of `+r.timeout+`ms exceeded`:`timeout exceeded`,i=r.transitional||gt;r.timeoutErrorMessage&&(t=r.timeoutErrorMessage),n(new E(t,i.clarifyTimeoutError?E.ETIMEDOUT:E.ECONNABORTED,e,h)),h=null},i===void 0&&a.setContentType(null),`setRequestHeader`in h&&T.forEach(a.toJSON(),function(e,t){h.setRequestHeader(t,e)}),T.isUndefined(r.withCredentials)||(h.withCredentials=!!r.withCredentials),o&&o!==`json`&&(h.responseType=r.responseType),c&&([d,p]=qt(c,!0),h.addEventListener(`progress`,d)),s&&h.upload&&([u,f]=qt(s),h.upload.addEventListener(`progress`,u),h.upload.addEventListener(`loadend`,f)),(r.cancelToken||r.signal)&&(l=t=>{h&&=(n(!t||t.type?new Ht(null,e,h):t),h.abort(),null)},r.cancelToken&&r.cancelToken.subscribe(l),r.signal&&(r.signal.aborted?l():r.signal.addEventListener(`abort`,l)));let _=Wt(r.url);if(_&&D.protocols.indexOf(_)===-1){n(new E(`Unsupported protocol `+_+`:`,E.ERR_BAD_REQUEST,e));return}h.send(i||null)})};let on=(e,t)=>{let{length:n}=e=e?e.filter(Boolean):[];if(t||n){let n=new AbortController,r,i=function(e){if(!r){r=!0,o();let t=e instanceof Error?e:this.reason;n.abort(t instanceof E?t:new Ht(t instanceof Error?t.message:t))}},a=t&&setTimeout(()=>{a=null,i(new E(`timeout of ${t}ms exceeded`,E.ETIMEDOUT))},t),o=()=>{e&&=(a&&clearTimeout(a),a=null,e.forEach(e=>{e.unsubscribe?e.unsubscribe(i):e.removeEventListener(`abort`,i)}),null)};e.forEach(e=>e.addEventListener(`abort`,i));let{signal:s}=n;return s.unsubscribe=()=>T.asap(o),s}},sn=function*(e,t){let n=e.byteLength;if(!t||n<t){yield e;return}let r=0,i;for(;r<n;)i=r+t,yield e.slice(r,i),r=i},cn=async function*(e,t){for await(let n of ln(e))yield*sn(n,t)},ln=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}let t=e.getReader();try{for(;;){let{done:e,value:n}=await t.read();if(e)break;yield n}}finally{await t.cancel()}},un=(e,t,n,r)=>{let i=cn(e,t),a=0,o,s=e=>{o||(o=!0,r&&r(e))};return new ReadableStream({async pull(e){try{let{done:t,value:r}=await i.next();if(t){s(),e.close();return}let o=r.byteLength;n&&n(a+=o),e.enqueue(new Uint8Array(r))}catch(e){throw s(e),e}},cancel(e){return s(e),i.return()}},{highWaterMark:2})},dn=64*1024,{isFunction:fn}=T,pn=(({Request:e,Response:t})=>({Request:e,Response:t}))(T.global),{ReadableStream:mn,TextEncoder:hn}=T.global,gn=(e,...t)=>{try{return!!e(...t)}catch{return!1}},_n=e=>{e=T.merge.call({skipUndefined:!0},pn,e);let{fetch:t,Request:n,Response:r}=e,i=t?fn(t):typeof fetch==`function`,a=fn(n),o=fn(r);if(!i)return!1;let s=i&&fn(mn),c=i&&(typeof hn==`function`?(e=>t=>e.encode(t))(new hn):async e=>new Uint8Array(await new n(e).arrayBuffer())),l=a&&s&&gn(()=>{let e=!1,t=new n(D.origin,{body:new mn,method:`POST`,get duplex(){return e=!0,`half`}}).headers.has(`Content-Type`);return e&&!t}),u=o&&s&&gn(()=>T.isReadableStream(new r(``).body)),d={stream:u&&(e=>e.body)};i&&[`text`,`arrayBuffer`,`blob`,`formData`,`stream`].forEach(e=>{!d[e]&&(d[e]=(t,n)=>{let r=t&&t[e];if(r)return r.call(t);throw new E(`Response type '${e}' is not supported`,E.ERR_NOT_SUPPORT,n)})});let f=async e=>{if(e==null)return 0;if(T.isBlob(e))return e.size;if(T.isSpecCompliantForm(e))return(await new n(D.origin,{method:`POST`,body:e}).arrayBuffer()).byteLength;if(T.isArrayBufferView(e)||T.isArrayBuffer(e))return e.byteLength;if(T.isURLSearchParams(e)&&(e+=``),T.isString(e))return(await c(e)).byteLength},p=async(e,t)=>T.toFiniteNumber(e.getContentLength())??f(t);return async e=>{let{url:i,method:o,data:s,signal:c,cancelToken:f,timeout:m,onDownloadProgress:h,onUploadProgress:g,responseType:_,headers:v,withCredentials:y=`same-origin`,fetchOptions:ee}=rn(e),b=t||fetch;_=_?(_+``).toLowerCase():`text`;let x=on([c,f&&f.toAbortSignal()],m),S=null,C=x&&x.unsubscribe&&(()=>{x.unsubscribe()}),te;try{if(g&&l&&o!==`get`&&o!==`head`&&(te=await p(v,s))!==0){let e=new n(i,{method:`POST`,body:s,duplex:`half`}),t;if(T.isFormData(s)&&(t=e.headers.get(`content-type`))&&v.setContentType(t),e.body){let[t,n]=Jt(te,qt(Yt(g)));s=un(e.body,dn,t,n)}}T.isString(y)||(y=y?`include`:`omit`);let t=a&&`credentials`in n.prototype,c={...ee,signal:x,method:o.toUpperCase(),headers:v.normalize().toJSON(),body:s,duplex:`half`,credentials:t?y:void 0};S=a&&new n(i,c);let f=await(a?b(S,ee):b(i,c)),m=u&&(_===`stream`||_===`response`);if(u&&(h||m&&C)){let e={};[`status`,`statusText`,`headers`].forEach(t=>{e[t]=f[t]});let t=T.toFiniteNumber(f.headers.get(`content-length`)),[n,i]=h&&Jt(t,qt(Yt(h),!0))||[];f=new r(un(f.body,dn,n,()=>{i&&i(),C&&C()}),e)}_||=`text`;let ne=await d[T.findKey(d,_)||`text`](f,e);return!m&&C&&C(),await new Promise((t,n)=>{Ut(t,n,{data:ne,headers:O.from(f.headers),status:f.status,statusText:f.statusText,config:e,request:S})})}catch(t){throw C&&C(),t&&t.name===`TypeError`&&/Load failed|fetch/i.test(t.message)?Object.assign(new E(`Network Error`,E.ERR_NETWORK,e,S,t&&t.response),{cause:t.cause||t}):E.from(t,t&&t.code,e,S,t&&t.response)}}},vn=new Map,yn=e=>{let t=e&&e.env||{},{fetch:n,Request:r,Response:i}=t,a=[r,i,n],o=a.length,s,c,l=vn;for(;o--;)s=a[o],c=l.get(s),c===void 0&&l.set(s,c=o?new Map:_n(t)),l=c;return c};yn();let bn={http:null,xhr:an,fetch:{get:yn}};T.forEach(bn,(e,t)=>{if(e){try{Object.defineProperty(e,`name`,{value:t})}catch{}Object.defineProperty(e,`adapterName`,{value:t})}});let xn=e=>`- ${e}`,Sn=e=>T.isFunction(e)||e===null||e===!1;function Cn(e,t){e=T.isArray(e)?e:[e];let{length:n}=e,r,i,a={};for(let o=0;o<n;o++){r=e[o];let n;if(i=r,!Sn(r)&&(i=bn[(n=String(r)).toLowerCase()],i===void 0))throw new E(`Unknown adapter '${n}'`);if(i&&(T.isFunction(i)||(i=i.get(t))))break;a[n||`#`+o]=i}if(!i){let e=Object.entries(a).map(([e,t])=>`adapter ${e} `+(t===!1?`is not supported by the environment`:`is not available in the build`));throw new E(`There is no suitable adapter to dispatch the request `+(n?e.length>1?`since :
|
|
4
|
-
`+e.map(xn).join(`
|
|
5
|
-
`):` `+xn(e[0]):`as no adapter specified`),`ERR_NOT_SUPPORT`)}return i}var wn={getAdapter:Cn,adapters:bn};function Tn(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Ht(null,e)}function En(e){return Tn(e),e.headers=O.from(e.headers),e.data=Bt.call(e,e.transformRequest),[`post`,`put`,`patch`].indexOf(e.method)!==-1&&e.headers.setContentType(`application/x-www-form-urlencoded`,!1),wn.getAdapter(e.adapter||kt.adapter,e)(e).then(function(t){return Tn(e),t.data=Bt.call(e,e.transformResponse,t),t.headers=O.from(t.headers),t},function(t){return Vt(t)||(Tn(e),t&&t.response&&(t.response.data=Bt.call(e,e.transformResponse,t.response),t.response.headers=O.from(t.response.headers))),Promise.reject(t)})}let Dn=`1.13.6`,On={};[`object`,`boolean`,`number`,`function`,`string`,`symbol`].forEach((e,t)=>{On[e]=function(n){return typeof n===e||`a`+(t<1?`n `:` `)+e}});let kn={};On.transitional=function(e,t,n){function r(e,t){return`[Axios v`+Dn+`] Transitional option '`+e+`'`+t+(n?`. `+n:``)}return(n,i,a)=>{if(e===!1)throw new E(r(i,` has been removed`+(t?` in `+t:``)),E.ERR_DEPRECATED);return t&&!kn[i]&&(kn[i]=!0,console.warn(r(i,` has been deprecated since v`+t+` and will be removed in the near future`))),e?e(n,i,a):!0}},On.spelling=function(e){return(t,n)=>(console.warn(`${n} is likely a misspelling of ${e}`),!0)};function An(e,t,n){if(typeof e!=`object`)throw new E(`options must be an object`,E.ERR_BAD_OPTION_VALUE);let r=Object.keys(e),i=r.length;for(;i-- >0;){let a=r[i],o=t[a];if(o){let t=e[a],n=t===void 0||o(t,a,e);if(n!==!0)throw new E(`option `+a+` must be `+n,E.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new E(`Unknown option `+a,E.ERR_BAD_OPTION)}}var jn={assertOptions:An,validators:On};let Mn=jn.validators;var Nn=class{constructor(e){this.defaults=e||{},this.interceptors={request:new ht,response:new ht}}async request(e,t){try{return await this._request(e,t)}catch(e){if(e instanceof Error){let t={};Error.captureStackTrace?Error.captureStackTrace(t):t=Error();let n=t.stack?t.stack.replace(/^.+\n/,``):``;try{e.stack?n&&!String(e.stack).endsWith(n.replace(/^.+\n.+\n/,``))&&(e.stack+=`
|
|
6
|
-
`+n):e.stack=n}catch{}}throw e}}_request(e,t){typeof e==`string`?(t||={},t.url=e):t=e||{},t=nn(this.defaults,t);let{transitional:n,paramsSerializer:r,headers:i}=t;n!==void 0&&jn.assertOptions(n,{silentJSONParsing:Mn.transitional(Mn.boolean),forcedJSONParsing:Mn.transitional(Mn.boolean),clarifyTimeoutError:Mn.transitional(Mn.boolean),legacyInterceptorReqResOrdering:Mn.transitional(Mn.boolean)},!1),r!=null&&(T.isFunction(r)?t.paramsSerializer={serialize:r}:jn.assertOptions(r,{encode:Mn.function,serialize:Mn.function},!0)),t.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls===void 0?t.allowAbsoluteUrls=!0:t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls),jn.assertOptions(t,{baseUrl:Mn.spelling(`baseURL`),withXsrfToken:Mn.spelling(`withXSRFToken`)},!0),t.method=(t.method||this.defaults.method||`get`).toLowerCase();let a=i&&T.merge(i.common,i[t.method]);i&&T.forEach([`delete`,`get`,`head`,`post`,`put`,`patch`,`common`],e=>{delete i[e]}),t.headers=O.concat(a,i);let o=[],s=!0;this.interceptors.request.forEach(function(e){if(typeof e.runWhen==`function`&&e.runWhen(t)===!1)return;s&&=e.synchronous;let n=t.transitional||gt;n&&n.legacyInterceptorReqResOrdering?o.unshift(e.fulfilled,e.rejected):o.push(e.fulfilled,e.rejected)});let c=[];this.interceptors.response.forEach(function(e){c.push(e.fulfilled,e.rejected)});let l,u=0,d;if(!s){let e=[En.bind(this),void 0];for(e.unshift(...o),e.push(...c),d=e.length,l=Promise.resolve(t);u<d;)l=l.then(e[u++],e[u++]);return l}d=o.length;let f=t;for(;u<d;){let e=o[u++],t=o[u++];try{f=e(f)}catch(e){t.call(this,e);break}}try{l=En.call(this,f)}catch(e){return Promise.reject(e)}for(u=0,d=c.length;u<d;)l=l.then(c[u++],c[u++]);return l}getUri(e){return e=nn(this.defaults,e),mt(en(e.baseURL,e.url,e.allowAbsoluteUrls),e.params,e.paramsSerializer)}};T.forEach([`delete`,`get`,`head`,`options`],function(e){Nn.prototype[e]=function(t,n){return this.request(nn(n||{},{method:e,url:t,data:(n||{}).data}))}}),T.forEach([`post`,`put`,`patch`],function(e){function t(t){return function(n,r,i){return this.request(nn(i||{},{method:e,headers:t?{"Content-Type":`multipart/form-data`}:{},url:n,data:r}))}}Nn.prototype[e]=t(),Nn.prototype[e+`Form`]=t(!0)});var Pn=class e{constructor(e){if(typeof e!=`function`)throw TypeError(`executor must be a function.`);let t;this.promise=new Promise(function(e){t=e});let n=this;this.promise.then(e=>{if(!n._listeners)return;let t=n._listeners.length;for(;t-- >0;)n._listeners[t](e);n._listeners=null}),this.promise.then=e=>{let t,r=new Promise(e=>{n.subscribe(e),t=e}).then(e);return r.cancel=function(){n.unsubscribe(t)},r},e(function(e,r,i){n.reason||(n.reason=new Ht(e,r,i),t(n.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;let t=this._listeners.indexOf(e);t!==-1&&this._listeners.splice(t,1)}toAbortSignal(){let e=new AbortController,t=t=>{e.abort(t)};return this.subscribe(t),e.signal.unsubscribe=()=>this.unsubscribe(t),e.signal}static source(){let t;return{token:new e(function(e){t=e}),cancel:t}}};function Fn(e){return function(t){return e.apply(null,t)}}function In(e){return T.isObject(e)&&e.isAxiosError===!0}let Ln={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(Ln).forEach(([e,t])=>{Ln[t]=e});function Rn(e){let t=new Nn(e),n=v(Nn.prototype.request,t);return T.extend(n,Nn.prototype,t,{allOwnKeys:!0}),T.extend(n,t,null,{allOwnKeys:!0}),n.create=function(t){return Rn(nn(e,t))},n}let k=Rn(kt);k.Axios=Nn,k.CanceledError=Ht,k.CancelToken=Pn,k.isCancel=Vt,k.VERSION=Dn,k.toFormData=lt,k.AxiosError=E,k.Cancel=k.CanceledError,k.all=function(e){return Promise.all(e)},k.spread=Fn,k.isAxiosError=In,k.mergeConfig=nn,k.AxiosHeaders=O,k.formToJSON=e=>Dt(T.isHTMLForm(e)?new FormData(e):e),k.getAdapter=wn.getAdapter,k.HttpStatusCode=Ln,k.default=k;var zn=l(_(),1);`https://localhost:9200/graph`.replace(/\/+$/,``);let Bn=e=>encodeURIComponent(e).split(`%2F`).join(`/`),Vn=/^(\w+:\/\/[^/?]+)?(.*?)$/,Hn=e=>e.filter(e=>typeof e==`string`||typeof e==`number`).map(e=>`${e}`).filter(e=>e),Un=e=>{let[,t=``,n=``]=e.join(`/`).match(Vn)||[];return{prefix:t,pathname:{parts:n.split(`/`).filter(e=>e!==``),hasLeading:/^\/+/.test(n),hasTrailing:/\/+$/.test(n)}}},Wn=(e,t)=>{let{prefix:n,pathname:r}=e,{parts:i,hasLeading:a,hasTrailing:o}=r,{leadingSlash:s,trailingSlash:c}=t,l=s===!0||s===`keep`&&a,u=c===!0||c===`keep`&&o,d=n;return i.length>0&&((d||l)&&(d+=`/`),d+=i.join(`/`)),u&&(d+=`/`),!d&&l&&(d+=`/`),d},A=(...e)=>{let t=e[e.length-1],n;return t&&typeof t==`object`&&(n=t,e=e.slice(0,-1)),n={leadingSlash:!0,trailingSlash:!1,...n},e=Hn(e),Wn(Un(e),n)};var Gn=class extends Error{response;statusCode;constructor(e,t,n=null){super(e),this.response=t,this.statusCode=n}},Kn=class extends Gn{errorCode;constructor(e,t,n,r=null){super(e,n,r),this.errorCode=t}};function qn(e,t=``){return`/public-files/${e}/${t}`.split(`/`).filter(Boolean).join(`/`)}function Jn(e,t=``){return`/ocm/${e}/${t}`.split(`/`).filter(Boolean).join(`/`)}var Yn=class{static Shared=`S`;static Shareable=`R`;static Mounted=`M`;static Deletable=`D`;static Renameable=`N`;static Moveable=`V`;static Updateable=`NV`;static FileUpdateable=`W`;static FolderCreateable=`CK`;static Deny=`Z`;static SecureView=`X`};let Xn=function(e){return e.copy=`COPY`,e.delete=`DELETE`,e.lock=`LOCK`,e.mkcol=`MKCOL`,e.move=`MOVE`,e.propfind=`PROPFIND`,e.proppatch=`PROPPATCH`,e.put=`PUT`,e.report=`REPORT`,e.unlock=`UNLOCK`,e}({}),Zn=e=>({value:e,type:null}),Qn=e=>Zn(e),j=e=>Zn(e),$n=e=>Zn(e),er={Permissions:j(`permissions`),IsFavorite:$n(`favorite`),FileId:j(`fileid`),FileParent:j(`file-parent`),Name:j(`name`),OwnerId:j(`owner-id`),OwnerDisplayName:j(`owner-display-name`),PrivateLink:j(`privatelink`),ContentLength:$n(`getcontentlength`),ContentSize:$n(`size`),LastModifiedDate:j(`getlastmodified`),Tags:Qn(`tags`),Audio:{value:`audio`,type:null},Location:{value:`location`,type:null},Image:{value:`image`,type:null},Photo:{value:`photo`,type:null},ETag:j(`getetag`),MimeType:j(`getcontenttype`),ResourceType:(e=>Zn(e))(`resourcetype`),LockDiscovery:{value:`lockdiscovery`,type:null},LockOwner:j(`owner`),LockTime:j(`locktime`),ActiveLock:{value:`activelock`,type:null},DownloadURL:j(`downloadURL`),Highlights:j(`highlights`),MetaPathForUser:j(`meta-path-for-user`),RemoteItemId:j(`remote-item-id`),HasPreview:$n(`has-preview`),ShareId:j(`shareid`),ShareRoot:j(`shareroot`),ShareTypes:{value:`share-types`,type:null},SharePermissions:j(`share-permissions`),TrashbinOriginalFilename:j(`trashbin-original-filename`),TrashbinOriginalLocation:j(`trashbin-original-location`),TrashbinDeletedDate:j(`trashbin-delete-datetime`),PublicLinkItemType:j(`public-link-item-type`),PublicLinkPermission:j(`public-link-permission`),PublicLinkExpiration:j(`public-link-expiration`),PublicLinkShareDate:j(`public-link-share-datetime`),PublicLinkShareOwner:j(`public-link-share-owner`)},M=Object.fromEntries(Object.entries(er).map(([e,t])=>[e,t.value]));var tr=class e{static Default=[M.Permissions,M.IsFavorite,M.FileId,M.FileParent,M.Name,M.LockDiscovery,M.ActiveLock,M.OwnerId,M.OwnerDisplayName,M.RemoteItemId,M.ShareRoot,M.ShareTypes,M.PrivateLink,M.ContentLength,M.ContentSize,M.LastModifiedDate,M.ETag,M.MimeType,M.ResourceType,M.Tags,M.Audio,M.Location,M.Image,M.Photo,M.HasPreview];static PublicLink=e.Default.concat([M.PublicLinkItemType,M.PublicLinkPermission,M.PublicLinkExpiration,M.PublicLinkShareDate,M.PublicLinkShareOwner]);static Trashbin=[M.ContentLength,M.ResourceType,M.TrashbinOriginalLocation,M.TrashbinOriginalFilename,M.TrashbinDeletedDate,M.Permissions,M.FileParent];static DavNamespace=[M.ContentLength,M.LastModifiedDate,M.ETag,M.MimeType,M.ResourceType,M.LockDiscovery,M.ActiveLock]},nr=typeof global==`object`&&global&&global.Object===Object&&global,rr=typeof self==`object`&&self&&self.Object===Object&&self,ir=nr||rr||Function(`return this`)(),ar=ir.Symbol,or=Object.prototype,sr=or.hasOwnProperty,cr=or.toString,lr=ar?ar.toStringTag:void 0;function ur(e){var t=sr.call(e,lr),n=e[lr];try{e[lr]=void 0;var r=!0}catch{}var i=cr.call(e);return r&&(t?e[lr]=n:delete e[lr]),i}var dr=Object.prototype.toString;function fr(e){return dr.call(e)}var pr=`[object Null]`,mr=`[object Undefined]`,hr=ar?ar.toStringTag:void 0;function gr(e){return e==null?e===void 0?mr:pr:hr&&hr in Object(e)?ur(e):fr(e)}function _r(e){return typeof e==`object`&&!!e}var vr=`[object Symbol]`;function yr(e){return typeof e==`symbol`||_r(e)&&gr(e)==vr}function br(e,t){for(var n=-1,r=e==null?0:e.length,i=Array(r);++n<r;)i[n]=t(e[n],n,e);return i}var xr=Array.isArray,Sr=1/0,Cr=ar?ar.prototype:void 0,wr=Cr?Cr.toString:void 0;function Tr(e){if(typeof e==`string`)return e;if(xr(e))return br(e,Tr)+``;if(yr(e))return wr?wr.call(e):``;var t=e+``;return t==`0`&&1/e==-Sr?`-0`:t}function Er(e){var t=typeof e;return e!=null&&(t==`object`||t==`function`)}function Dr(e){return e}var Or=`[object AsyncFunction]`,kr=`[object Function]`,Ar=`[object GeneratorFunction]`,jr=`[object Proxy]`;function Mr(e){if(!Er(e))return!1;var t=gr(e);return t==kr||t==Ar||t==Or||t==jr}var Nr=ir[`__core-js_shared__`],Pr=function(){var e=/[^.]+$/.exec(Nr&&Nr.keys&&Nr.keys.IE_PROTO||``);return e?`Symbol(src)_1.`+e:``}();function Fr(e){return!!Pr&&Pr in e}var Ir=Function.prototype.toString;function Lr(e){if(e!=null){try{return Ir.call(e)}catch{}try{return e+``}catch{}}return``}var Rr=/[\\^$.*+?()[\]{}|]/g,zr=/^\[object .+?Constructor\]$/,Br=Function.prototype,Vr=Object.prototype,Hr=Br.toString,Ur=Vr.hasOwnProperty,Wr=RegExp(`^`+Hr.call(Ur).replace(Rr,`\\$&`).replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,`$1.*?`)+`$`);function Gr(e){return!Er(e)||Fr(e)?!1:(Mr(e)?Wr:zr).test(Lr(e))}function Kr(e,t){return e?.[t]}function qr(e,t){var n=Kr(e,t);return Gr(n)?n:void 0}function Jr(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}var Yr=800,Xr=16,Zr=Date.now;function Qr(e){var t=0,n=0;return function(){var r=Zr(),i=Xr-(r-n);if(n=r,i>0){if(++t>=Yr)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}function $r(e){return function(){return e}}var ei=function(){try{var e=qr(Object,`defineProperty`);return e({},``,{}),e}catch{}}(),ti=Qr(ei?function(e,t){return ei(e,`toString`,{configurable:!0,enumerable:!1,value:$r(t),writable:!0})}:Dr);function ni(e,t,n,r){for(var i=e.length,a=n+(r?1:-1);r?a--:++a<i;)if(t(e[a],a,e))return a;return-1}function ri(e){return e!==e}function ii(e,t,n){for(var r=n-1,i=e.length;++r<i;)if(e[r]===t)return r;return-1}function ai(e,t,n){return t===t?ii(e,t,n):ni(e,ri,n)}function oi(e,t){return!!(e!=null&&e.length)&&ai(e,t,0)>-1}function si(e,t){return e===t||e!==e&&t!==t}var ci=Math.max;function li(e,t,n){return t=ci(t===void 0?e.length-1:t,0),function(){for(var r=arguments,i=-1,a=ci(r.length-t,0),o=Array(a);++i<a;)o[i]=r[t+i];i=-1;for(var s=Array(t+1);++i<t;)s[i]=r[i];return s[t]=n(o),Jr(e,this,s)}}function ui(e,t){return ti(li(e,t,Dr),e+``)}var di=9007199254740991;function fi(e){return typeof e==`number`&&e>-1&&e%1==0&&e<=di}function pi(e){return e!=null&&fi(e.length)&&!Mr(e)}function mi(e){return function(t){return e(t)}}var hi=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,gi=/^\w*$/;function _i(e,t){if(xr(e))return!1;var n=typeof e;return n==`number`||n==`symbol`||n==`boolean`||e==null||yr(e)?!0:gi.test(e)||!hi.test(e)||t!=null&&e in Object(t)}var vi=qr(Object,`create`);function yi(){this.__data__=vi?vi(null):{},this.size=0}function bi(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var xi=`__lodash_hash_undefined__`,Si=Object.prototype.hasOwnProperty;function Ci(e){var t=this.__data__;if(vi){var n=t[e];return n===xi?void 0:n}return Si.call(t,e)?t[e]:void 0}var wi=Object.prototype.hasOwnProperty;function Ti(e){var t=this.__data__;return vi?t[e]!==void 0:wi.call(t,e)}var Ei=`__lodash_hash_undefined__`;function Di(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=vi&&t===void 0?Ei:t,this}function Oi(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}Oi.prototype.clear=yi,Oi.prototype.delete=bi,Oi.prototype.get=Ci,Oi.prototype.has=Ti,Oi.prototype.set=Di;function ki(){this.__data__=[],this.size=0}function Ai(e,t){for(var n=e.length;n--;)if(si(e[n][0],t))return n;return-1}var ji=Array.prototype.splice;function Mi(e){var t=this.__data__,n=Ai(t,e);return n<0?!1:(n==t.length-1?t.pop():ji.call(t,n,1),--this.size,!0)}function Ni(e){var t=this.__data__,n=Ai(t,e);return n<0?void 0:t[n][1]}function Pi(e){return Ai(this.__data__,e)>-1}function Fi(e,t){var n=this.__data__,r=Ai(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}function Ii(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}Ii.prototype.clear=ki,Ii.prototype.delete=Mi,Ii.prototype.get=Ni,Ii.prototype.has=Pi,Ii.prototype.set=Fi;var Li=qr(ir,`Map`);function Ri(){this.size=0,this.__data__={hash:new Oi,map:new(Li||Ii),string:new Oi}}function zi(e){var t=typeof e;return t==`string`||t==`number`||t==`symbol`||t==`boolean`?e!==`__proto__`:e===null}function Bi(e,t){var n=e.__data__;return zi(t)?n[typeof t==`string`?`string`:`hash`]:n.map}function Vi(e){var t=Bi(this,e).delete(e);return this.size-=t?1:0,t}function Hi(e){return Bi(this,e).get(e)}function Ui(e){return Bi(this,e).has(e)}function Wi(e,t){var n=Bi(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this}function Gi(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}Gi.prototype.clear=Ri,Gi.prototype.delete=Vi,Gi.prototype.get=Hi,Gi.prototype.has=Ui,Gi.prototype.set=Wi;var Ki=`Expected a function`;function qi(e,t){if(typeof e!=`function`||t!=null&&typeof t!=`function`)throw TypeError(Ki);var n=function(){var r=arguments,i=t?t.apply(this,r):r[0],a=n.cache;if(a.has(i))return a.get(i);var o=e.apply(this,r);return n.cache=a.set(i,o)||a,o};return n.cache=new(qi.Cache||Gi),n}qi.Cache=Gi;var Ji=500;function Yi(e){var t=qi(e,function(e){return n.size===Ji&&n.clear(),e}),n=t.cache;return t}var Xi=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Zi=/\\(\\)?/g,Qi=Yi(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(``),e.replace(Xi,function(e,n,r,i){t.push(r?i.replace(Zi,`$1`):n||e)}),t});function $i(e){return e==null?``:Tr(e)}function ea(e,t){return xr(e)?e:_i(e,t)?[e]:Qi($i(e))}var ta=1/0;function na(e){if(typeof e==`string`||yr(e))return e;var t=e+``;return t==`0`&&1/e==-ta?`-0`:t}function ra(e,t){t=ea(t,e);for(var n=0,r=t.length;e!=null&&n<r;)e=e[na(t[n++])];return n&&n==r?e:void 0}function ia(e,t,n){var r=e==null?void 0:ra(e,t);return r===void 0?n:r}function aa(e,t,n){var r=-1,i=e.length;t<0&&(t=-t>i?0:i+t),n=n>i?i:n,n<0&&(n+=i),i=t>n?0:n-t>>>0,t>>>=0;for(var a=Array(i);++r<i;)a[r]=e[r+t];return a}function oa(e,t,n){var r=e.length;return n=n===void 0?r:n,!t&&n>=r?e:aa(e,t,n)}var sa=RegExp(`[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]`);function ca(e){return sa.test(e)}function la(e){return e.split(``)}var ua=`\\ud800-\\udfff`,da=`\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff`,fa=`\\ufe0e\\ufe0f`,pa=`[`+ua+`]`,ma=`[`+da+`]`,ha=`\\ud83c[\\udffb-\\udfff]`,ga=`(?:`+ma+`|`+ha+`)`,_a=`[^`+ua+`]`,va=`(?:\\ud83c[\\udde6-\\uddff]){2}`,ya=`[\\ud800-\\udbff][\\udc00-\\udfff]`,ba=`\\u200d`,xa=ga+`?`,Sa=`[`+fa+`]?`,Ca=`(?:`+ba+`(?:`+[_a,va,ya].join(`|`)+`)`+Sa+xa+`)*`,wa=Sa+xa+Ca,Ta=`(?:`+[_a+ma+`?`,ma,va,ya,pa].join(`|`)+`)`,Ea=RegExp(ha+`(?=`+ha+`)|`+Ta+wa,`g`);function Da(e){return e.match(Ea)||[]}function Oa(e){return ca(e)?Da(e):la(e)}function ka(e){return function(t){t=$i(t);var n=ca(t)?Oa(t):void 0,r=n?n[0]:t.charAt(0),i=n?oa(n,1).join(``):t.slice(1);return r[e]()+i}}var Aa=ka(`toUpperCase`);function ja(e){return Aa($i(e).toLowerCase())}function Ma(e,t,n,r){var i=-1,a=e==null?0:e.length;for(r&&a&&(n=e[++i]);++i<a;)n=t(n,e[i],i,e);return n}function Na(e){return function(t){return e?.[t]}}var Pa=Na({À:`A`,Á:`A`,Â:`A`,Ã:`A`,Ä:`A`,Å:`A`,à:`a`,á:`a`,â:`a`,ã:`a`,ä:`a`,å:`a`,Ç:`C`,ç:`c`,Ð:`D`,ð:`d`,È:`E`,É:`E`,Ê:`E`,Ë:`E`,è:`e`,é:`e`,ê:`e`,ë:`e`,Ì:`I`,Í:`I`,Î:`I`,Ï:`I`,ì:`i`,í:`i`,î:`i`,ï:`i`,Ñ:`N`,ñ:`n`,Ò:`O`,Ó:`O`,Ô:`O`,Õ:`O`,Ö:`O`,Ø:`O`,ò:`o`,ó:`o`,ô:`o`,õ:`o`,ö:`o`,ø:`o`,Ù:`U`,Ú:`U`,Û:`U`,Ü:`U`,ù:`u`,ú:`u`,û:`u`,ü:`u`,Ý:`Y`,ý:`y`,ÿ:`y`,Æ:`Ae`,æ:`ae`,Þ:`Th`,þ:`th`,ß:`ss`,Ā:`A`,Ă:`A`,Ą:`A`,ā:`a`,ă:`a`,ą:`a`,Ć:`C`,Ĉ:`C`,Ċ:`C`,Č:`C`,ć:`c`,ĉ:`c`,ċ:`c`,č:`c`,Ď:`D`,Đ:`D`,ď:`d`,đ:`d`,Ē:`E`,Ĕ:`E`,Ė:`E`,Ę:`E`,Ě:`E`,ē:`e`,ĕ:`e`,ė:`e`,ę:`e`,ě:`e`,Ĝ:`G`,Ğ:`G`,Ġ:`G`,Ģ:`G`,ĝ:`g`,ğ:`g`,ġ:`g`,ģ:`g`,Ĥ:`H`,Ħ:`H`,ĥ:`h`,ħ:`h`,Ĩ:`I`,Ī:`I`,Ĭ:`I`,Į:`I`,İ:`I`,ĩ:`i`,ī:`i`,ĭ:`i`,į:`i`,ı:`i`,Ĵ:`J`,ĵ:`j`,Ķ:`K`,ķ:`k`,ĸ:`k`,Ĺ:`L`,Ļ:`L`,Ľ:`L`,Ŀ:`L`,Ł:`L`,ĺ:`l`,ļ:`l`,ľ:`l`,ŀ:`l`,ł:`l`,Ń:`N`,Ņ:`N`,Ň:`N`,Ŋ:`N`,ń:`n`,ņ:`n`,ň:`n`,ŋ:`n`,Ō:`O`,Ŏ:`O`,Ő:`O`,ō:`o`,ŏ:`o`,ő:`o`,Ŕ:`R`,Ŗ:`R`,Ř:`R`,ŕ:`r`,ŗ:`r`,ř:`r`,Ś:`S`,Ŝ:`S`,Ş:`S`,Š:`S`,ś:`s`,ŝ:`s`,ş:`s`,š:`s`,Ţ:`T`,Ť:`T`,Ŧ:`T`,ţ:`t`,ť:`t`,ŧ:`t`,Ũ:`U`,Ū:`U`,Ŭ:`U`,Ů:`U`,Ű:`U`,Ų:`U`,ũ:`u`,ū:`u`,ŭ:`u`,ů:`u`,ű:`u`,ų:`u`,Ŵ:`W`,ŵ:`w`,Ŷ:`Y`,ŷ:`y`,Ÿ:`Y`,Ź:`Z`,Ż:`Z`,Ž:`Z`,ź:`z`,ż:`z`,ž:`z`,IJ:`IJ`,ij:`ij`,Œ:`Oe`,œ:`oe`,ʼn:`'n`,ſ:`s`}),Fa=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Ia=RegExp(`[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]`,`g`);function La(e){return e=$i(e),e&&e.replace(Fa,Pa).replace(Ia,``)}var Ra=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;function za(e){return e.match(Ra)||[]}var Ba=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;function Va(e){return Ba.test(e)}var Ha=`\\ud800-\\udfff`,Ua=`\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff`,Wa=`\\u2700-\\u27bf`,Ga=`a-z\\xdf-\\xf6\\xf8-\\xff`,Ka=`\\xac\\xb1\\xd7\\xf7`,qa=`\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf`,Ja=`\\u2000-\\u206f`,Ya=` \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000`,Xa=`A-Z\\xc0-\\xd6\\xd8-\\xde`,Za=`\\ufe0e\\ufe0f`,Qa=Ka+qa+Ja+Ya,$a=`['’]`,eo=`[`+Qa+`]`,to=`[`+Ua+`]`,no=`\\d+`,ro=`[`+Wa+`]`,io=`[`+Ga+`]`,ao=`[^`+Ha+Qa+no+Wa+Ga+Xa+`]`,oo=`(?:`+to+`|\\ud83c[\\udffb-\\udfff])`,so=`[^`+Ha+`]`,co=`(?:\\ud83c[\\udde6-\\uddff]){2}`,lo=`[\\ud800-\\udbff][\\udc00-\\udfff]`,uo=`[`+Xa+`]`,fo=`\\u200d`,po=`(?:`+io+`|`+ao+`)`,mo=`(?:`+uo+`|`+ao+`)`,ho=`(?:`+$a+`(?:d|ll|m|re|s|t|ve))?`,go=`(?:`+$a+`(?:D|LL|M|RE|S|T|VE))?`,_o=oo+`?`,vo=`[`+Za+`]?`,yo=`(?:`+fo+`(?:`+[so,co,lo].join(`|`)+`)`+vo+_o+`)*`,bo=`\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])`,xo=`\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])`,So=vo+_o+yo,Co=`(?:`+[ro,co,lo].join(`|`)+`)`+So,wo=RegExp([uo+`?`+io+`+`+ho+`(?=`+[eo,uo,`$`].join(`|`)+`)`,mo+`+`+go+`(?=`+[eo,uo+po,`$`].join(`|`)+`)`,uo+`?`+po+`+`+ho,uo+`+`+go,xo,bo,no,Co].join(`|`),`g`);function To(e){return e.match(wo)||[]}function Eo(e,t,n){return e=$i(e),t=n?void 0:t,t===void 0?Va(e)?To(e):za(e):e.match(t)||[]}var Do=RegExp(`['’]`,`g`);function Oo(e){return function(t){return Ma(Eo(La(t).replace(Do,``)),e,``)}}var ko=Oo(function(e,t,n){return t=t.toLowerCase(),e+(n?ja(t):t)}),Ao=`__lodash_hash_undefined__`;function jo(e){return this.__data__.set(e,Ao),this}function Mo(e){return this.__data__.has(e)}function No(e){var t=-1,n=e==null?0:e.length;for(this.__data__=new Gi;++t<n;)this.add(e[t])}No.prototype.add=No.prototype.push=jo,No.prototype.has=Mo;function Po(e,t){return e.has(t)}function Fo(e){return _r(e)&&pi(e)}function Io(e,t,n){for(var r=-1,i=e==null?0:e.length;++r<i;)if(n(t,e[r]))return!0;return!1}var Lo=Math.min;function Ro(e,t,n){for(var r=n?Io:oi,i=e[0].length,a=e.length,o=a,s=Array(a),c=1/0,l=[];o--;){var u=e[o];o&&t&&(u=br(u,mi(t))),c=Lo(u.length,c),s[o]=!n&&(t||i>=120&&u.length>=120)?new No(o&&u):void 0}u=e[0];var d=-1,f=s[0];outer:for(;++d<i&&l.length<c;){var p=u[d],m=t?t(p):p;if(p=n||p!==0?p:0,!(f?Po(f,m):r(l,m,n))){for(o=a;--o;){var h=s[o];if(!(h?Po(h,m):r(e[o],m,n)))continue outer}f&&f.push(m),l.push(p)}}return l}function zo(e){return Fo(e)?e:[]}var Bo=ui(function(e){var t=br(e,zo);return t.length&&t[0]===e[0]?Ro(t):[]});let Vo={complex:[`tar.bz2`,`tar.gz`,`tar.xz`]},Ho=e=>e.replace(/[^A-Za-z0-9\-_]/g,``),Uo=(e,t)=>!e||typeof e!=`string`?``:e.indexOf(`!`)>=0?e.split(`!`)[t]:``,Wo=e=>Uo(e,0),Go=e=>Uo(e,1),Ko=e=>{let t=e.name.split(`.`);if(t.length>2)for(let e=0;e<t.length;e++){let n=t.slice(e,t.length).join(`.`);if(Vo.complex.includes(n))return n}return t.length<2?``:t[t.length-1]},qo=e=>{if(!e)return e;let t={};return Object.keys(e).forEach(n=>{t[ko(n)]=e[n]}),t};function Jo(e,t=[]){let n=e.props[M.Name]?.toString()||(0,zn.basename)(e.filename),r=e.props[M.FileId],i=e.type===`directory`,a;a=e.filename.startsWith(`/files`)||e.filename.startsWith(`/space`)?e.filename.split(`/`).slice(3).join(`/`):e.filename,a.startsWith(`/`)||(a=`/${a}`);let o=Ko({...e,id:r,name:n,path:a}),s=e.props[M.LockDiscovery],c,l,u;s&&(c=s[M.ActiveLock],l=c[M.LockOwner],u=c[M.LockTime]);let d=[];e.props[M.ShareTypes]&&(d=e.props[M.ShareTypes][`share-type`],Array.isArray(d)||(d=[d]));let f={};for(let n of t||[]){let t=n.split(`:`).pop();e.props[t]&&(f[n]=e.props[t])}let p={id:r,fileId:r,storageId:Wo(r),parentFolderId:e.props[M.FileParent],mimeType:e.props[M.MimeType],name:n,extension:o,path:a,webDavPath:e.filename,type:i?`folder`:e.type,isFolder:i,locked:!!c,lockOwner:l,lockTime:u,processing:e.processing||!1,mdate:e.props[M.LastModifiedDate],size:i?e.props[M.ContentSize]?.toString()||`0`:e.props[M.ContentLength]?.toString()||`0`,permissions:e.props[M.Permissions]||``,starred:e.props[M.IsFavorite]===1,etag:e.props[M.ETag],shareTypes:d,privateLink:e.props[M.PrivateLink],downloadURL:e.props[M.DownloadURL],remoteItemId:e.props[M.RemoteItemId],remoteItemPath:e.props[M.ShareRoot],owner:{id:e.props[M.OwnerId],displayName:e.props[M.OwnerDisplayName]},tags:(e.props[M.Tags]||``).toString().split(`,`).filter(Boolean),audio:qo(e.props[M.Audio]),location:qo(e.props[M.Location]),image:qo(e.props[M.Image]),photo:qo(e.props[M.Photo]),extraProps:f,hasPreview:()=>e.props[M.HasPreview]===1,canUpload:function(){return this.permissions.indexOf(Yn.FolderCreateable)>=0},canDownload:function(){return this.permissions.indexOf(Yn.SecureView)===-1},canBeDeleted:function(){return this.permissions.indexOf(Yn.Deletable)>=0},canRename:function(){return this.permissions.indexOf(Yn.Renameable)>=0},canShare:function({ability:e}){return e.can(`create-all`,`Share`)&&this.permissions.indexOf(Yn.Shareable)>=0},canCreate:function(){return this.permissions.indexOf(Yn.FolderCreateable)>=0},canEditTags:function(){return this.permissions.indexOf(Yn.Updateable)>=0||this.permissions.indexOf(Yn.FileUpdateable)>=0||this.permissions.indexOf(Yn.FolderCreateable)>=0},isMounted:function(){return this.permissions.indexOf(Yn.Mounted)>=0},isReceivedShare:function(){return this.permissions.indexOf(Yn.Shared)>=0},isShareRoot(){return e.props[M.ShareRoot]?e.filename.split(`/`).length===3:!1},getDomSelector:()=>Ho(r)};return Object.defineProperty(p,`nodeId`,{get(){return Go(this.id)}}),p}function Yo(e){let t=e.type===`directory`,n=e.props[M.TrashbinOriginalFilename]?.toString(),r=Ko({name:n,type:e.type}),i=zn.default.basename(e.filename);return{type:t?`folder`:e.type,isFolder:t,ddate:e.props[M.TrashbinDeletedDate],name:zn.default.basename(n),extension:r,path:A(e.props[M.TrashbinOriginalLocation],{leadingSlash:!0}),id:i,parentFolderId:e.props[M.FileParent],webDavPath:``,canUpload:()=>!1,canDownload:()=>!1,canBeDeleted:()=>!0,canBeRestored:function(){return!0},canRename:()=>!1,canShare:()=>!1,canCreate:()=>!1,isMounted:()=>!1,isReceivedShare:()=>!1,hasPreview:()=>!1,isShareRoot:()=>!1,getDomSelector:()=>Ho(i)}}let N=function(e){return e.createUpload=`libre.graph/driveItem/upload/create`,e.createPermissions=`libre.graph/driveItem/permissions/create`,e.createChildren=`libre.graph/driveItem/children/create`,e.readBasic=`libre.graph/driveItem/basic/read`,e.readPath=`libre.graph/driveItem/path/read`,e.readQuota=`libre.graph/driveItem/quota/read`,e.readContent=`libre.graph/driveItem/content/read`,e.readChildren=`libre.graph/driveItem/children/read`,e.readDeleted=`libre.graph/driveItem/deleted/read`,e.readPermissions=`libre.graph/driveItem/permissions/read`,e.readVersions=`libre.graph/driveItem/versions/read`,e.updatePath=`libre.graph/driveItem/path/update`,e.updateDeleted=`libre.graph/driveItem/deleted/update`,e.updatePermissions=`libre.graph/driveItem/permissions/update`,e.updateVersions=`libre.graph/driveItem/versions/update`,e.deleteStandard=`libre.graph/driveItem/standard/delete`,e.deleteDeleted=`libre.graph/driveItem/deleted/delete`,e.deletePermissions=`libre.graph/driveItem/permissions/delete`,e}({}),Xo=e=>e;var Zo=class{_key;_value;_label;_icon;constructor(e,t,n,r){this._key=e,this._value=t,this._label=n,this._icon=r}get key(){return this._key}get value(){return this._value}get label(){return this._label}get icon(){return this._icon}};(class{static user=new Zo(`user`,0,Xo(`User`),`user`);static group=new Zo(`group`,1,Xo(`Group`),`group`);static link=new Zo(`link`,3,Xo(`Link`),`link`);static guest=new Zo(`guest`,4,Xo(`Guest`),`global`);static remote=new Zo(`remote`,6,Xo(`External`),`earth`);static individuals=[this.user,this.guest,this.remote];static collectives=[this.group];static unauthenticated=[this.link];static authenticated=[this.user,this.group,this.guest,this.remote];static all=[this.user,this.group,this.link,this.guest,this.remote];static isIndividual(e){return this.individuals.includes(e)}static isCollective(e){return this.collectives.includes(e)}static isUnauthenticated(e){return this.unauthenticated.includes(e)}static isAuthenticated(e){return this.authenticated.includes(e)}static getByValue(e){return this.all.find(t=>t.value===e)}static getByValues(e){return e.map(e=>this.getByValue(e))}static getByKeys(e){return e.map(e=>this.all.find(t=>t.key===e))}static getValues(e){return e.map(e=>e.value)}static containsAnyValue(e,t){return Bo(this.getValues(e),t).length>0}});let Qo=e=>e?.driveType===`personal`,$o=e=>e?.driveType===`public`;function es(e,t){return A(`spaces`,e,t,{leadingSlash:!0})}function ts(e,t=``){return A(`spaces`,`trash-bin`,e,t,{leadingSlash:!0})}function ns(e){let t=e.publicLinkPassword,n=e.props?.[M.FileId],r=e.props?.[M.PublicLinkItemType],i=e.props?.[M.PublicLinkPermission],a=e.props?.[M.PublicLinkExpiration],o=e.props?.[M.PublicLinkShareDate],s=e.props?.[M.PublicLinkShareOwner],c=e.publicLinkType,l,u;return c===`ocm`?(l=`ocm/${e.id}`,u=Jn(e.id)):(l=`public/${e.id}`,u=qn(e.id)),Object.assign(rs({...e,driveType:`public`,driveAlias:l,webDavPath:u}),{...n&&{fileId:n},...t&&{publicLinkPassword:t},...r&&{publicLinkItemType:r},...i&&{publicLinkPermission:parseInt(i)},...a&&{publicLinkExpiration:a},...o&&{publicLinkShareDate:o},...s&&{publicLinkShareOwner:s},publicLinkType:c})}function rs(e){let t,n;e.special&&(t=e.special.find(e=>e.specialFolder.name===`image`),n=e.special.find(e=>e.specialFolder.name===`readme`),t&&(t.webDavUrl=decodeURI(t.webDavUrl)),n&&(n.webDavUrl=decodeURI(n.webDavUrl)));let r=e.root?.deleted?.state===`trashed`,i=A(e.webDavPath||es(e.id),{leadingSlash:!0}),a=A(e.serverUrl,`remote.php/dav`,i),o=A(e.webDavTrashPath||ts(e.id),{leadingSlash:!0}),s=A(e.serverUrl,`remote.php/dav`,o),c={id:e.id,fileId:e.id,storageId:e.id,mimeType:``,name:e.name,description:e.description,extension:``,path:`/`,webDavPath:i,webDavTrashPath:o,driveAlias:e.driveAlias,driveType:e.driveType,type:`space`,isFolder:!0,mdate:e.lastModifiedDateTime,size:e.quota?.used||0,tags:[],permissions:``,starred:!1,etag:``,shareTypes:[],privateLink:e.webUrl,downloadURL:``,owner:e.owner?.user,disabled:r,root:e.root,spaceQuota:e.quota,spaceImageData:t,spaceReadmeData:n,hasTrashedItems:e[`@libre.graph.hasTrashedItems`]||!1,graphPermissions:void 0,canUpload:function({user:e}={}){return Qo(this)&&this.isOwner(e)?!0:this.graphPermissions?.includes(N.createUpload)},canDownload:function(){return!0},canBeDeleted:function({ability:e}={}){return this.disabled?e?.can(`delete-all`,`Drive`)?!0:this.graphPermissions?.includes(N.deletePermissions):!1},canRename:function({ability:e}={}){return e?.can(`update-all`,`Drive`)?!0:this.graphPermissions?.includes(N.deletePermissions)},canEditDescription:function({ability:e}={}){return e?.can(`update-all`,`Drive`)?!0:this.graphPermissions?.includes(N.deletePermissions)},canRestore:function({ability:e}={}){return this.disabled?e?.can(`update-all`,`Drive`)?!0:this.graphPermissions?.includes(N.deletePermissions):!1},canDisable:function({ability:e}={}){return this.disabled?!1:e?.can(`delete-all`,`Drive`)?!0:this.graphPermissions?.includes(N.deletePermissions)},canShare:function(){return this.graphPermissions?.includes(N.createPermissions)},canEditImage:function(){return this.disabled?!1:this.graphPermissions?.includes(N.deletePermissions)},canEditReadme:function(){return this.disabled?!1:this.graphPermissions?.includes(N.deletePermissions)},canRestoreFromTrashbin:function(){return this.graphPermissions?.includes(N.updateDeleted)},canDeleteFromTrashBin:function({user:e}={}){return Qo(this)&&this.isOwner(e)?!0:this.graphPermissions?.includes(N.deletePermissions)},canListVersions:function({user:e}={}){return Qo(this)&&this.isOwner(e)?!0:this.graphPermissions?.includes(N.readVersions)},canCreate:function(){return!0},canEditTags:function(){return!1},isMounted:function(){return!0},isReceivedShare:function(){return!1},isShareRoot:function(){return[`share`,`mountpoint`,`public`].includes(e.driveType)},getDomSelector:()=>Ho(e.id),getDriveAliasAndItem({path:e}){return A(this.driveAlias,e,{leadingSlash:!1})},getWebDavUrl({path:e}){return A(a,e)},getWebDavTrashUrl({path:e}){return A(s,e)},isOwner(e){return e?.id===this.owner?.id}};return Object.defineProperty(c,`nodeId`,{get(){return Go(this.id)}}),c}let is=(e,t)=>{let n=new URL(e);n.pathname=[...n.pathname.split(`/`),`cloud`,`capabilities`].filter(Boolean).join(`/`),n.searchParams.append(`format`,`json`);let r=n.href;return{async getCapabilities(){return ia(await t.get(r),`data.ocs.data`,{capabilities:null,version:null})}}};
|
|
7
|
-
/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */
|
|
8
|
-
function as(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name===`Uint8Array`}function os(e,t=``){if(!Number.isSafeInteger(e)||e<0){let n=t&&`"${t}" `;throw Error(`${n}expected integer >= 0, got ${e}`)}}function ss(e,t,n=``){let r=as(e),i=e?.length,a=t!==void 0;if(!r||a&&i!==t){let o=n&&`"${n}" `,s=a?` of length ${t}`:``,c=r?`length=${i}`:`type=${typeof e}`;throw Error(o+`expected Uint8Array`+s+`, got `+c)}return e}function cs(e){if(typeof e!=`function`||typeof e.create!=`function`)throw Error(`Hash must wrapped by utils.createHasher`);os(e.outputLen),os(e.blockLen)}function ls(e,t=!0){if(e.destroyed)throw Error(`Hash instance has been destroyed`);if(t&&e.finished)throw Error(`Hash#digest() has already been called`)}function us(e,t){ss(e,void 0,`digestInto() output`);let n=t.outputLen;if(e.length<n)throw Error(`"digestInto() output" expected to be of length >=`+n)}function ds(...e){for(let t=0;t<e.length;t++)e[t].fill(0)}function fs(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}new Uint8Array(new Uint32Array([287454020]).buffer)[0],typeof Uint8Array.from([]).toHex==`function`&&Uint8Array.fromHex;function ps(e){if(typeof e!=`string`)throw Error(`string expected`);return new Uint8Array(new TextEncoder().encode(e))}function ms(e,t=``){return typeof e==`string`?ps(e):ss(e,void 0,t)}function hs(e,t){if(t!==void 0&&{}.toString.call(t)!==`[object Object]`)throw Error(`options must be object or undefined`);return Object.assign(e,t)}function gs(e,t={}){let n=(t,n)=>e(n).update(t).digest(),r=e(void 0);return n.outputLen=r.outputLen,n.blockLen=r.blockLen,n.create=t=>e(t),Object.assign(n,t),Object.freeze(n)}let _s=e=>({oid:Uint8Array.from([6,9,96,134,72,1,101,3,4,2,e])});var vs=class{oHash;iHash;blockLen;outputLen;finished=!1;destroyed=!1;constructor(e,t){if(cs(e),ss(t,void 0,`key`),this.iHash=e.create(),typeof this.iHash.update!=`function`)throw Error(`Expected instance of class which extends utils.Hash`);this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;let n=this.blockLen,r=new Uint8Array(n);r.set(t.length>n?e.create().update(t).digest():t);for(let e=0;e<r.length;e++)r[e]^=54;this.iHash.update(r),this.oHash=e.create();for(let e=0;e<r.length;e++)r[e]^=106;this.oHash.update(r),ds(r)}update(e){return ls(this),this.iHash.update(e),this}digestInto(e){ls(this),ss(e,this.outputLen,`output`),this.finished=!0,this.iHash.digestInto(e),this.oHash.update(e),this.oHash.digestInto(e),this.destroy()}digest(){let e=new Uint8Array(this.oHash.outputLen);return this.digestInto(e),e}_cloneInto(e){e||=Object.create(Object.getPrototypeOf(this),{});let{oHash:t,iHash:n,finished:r,destroyed:i,blockLen:a,outputLen:o}=this;return e=e,e.finished=r,e.destroyed=i,e.blockLen=a,e.outputLen=o,e.oHash=t._cloneInto(e.oHash),e.iHash=n._cloneInto(e.iHash),e}clone(){return this._cloneInto()}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}};let ys=(e,t,n)=>new vs(e,t).update(n).digest();ys.create=(e,t)=>new vs(e,t);function bs(e,t,n,r){cs(e);let{c:i,dkLen:a,asyncTick:o}=hs({dkLen:32,asyncTick:10},r);if(os(i,`c`),os(a,`dkLen`),os(o,`asyncTick`),i<1)throw Error(`iterations (c) must be >= 1`);let s=ms(t,`password`),c=ms(n,`salt`),l=new Uint8Array(a),u=ys.create(e,s);return{c:i,dkLen:a,asyncTick:o,DK:l,PRF:u,PRFSalt:u._cloneInto().update(c)}}function xs(e,t,n,r,i){return e.destroy(),t.destroy(),r&&r.destroy(),ds(i),n}function Ss(e,t,n,r){let{c:i,dkLen:a,DK:o,PRF:s,PRFSalt:c}=bs(e,t,n,r),l,u=new Uint8Array(4),d=fs(u),f=new Uint8Array(s.outputLen);for(let e=1,t=0;t<a;e++,t+=s.outputLen){let n=o.subarray(t,t+s.outputLen);d.setInt32(0,e,!1),(l=c._cloneInto(l)).update(u).digestInto(f),n.set(f.subarray(0,n.length));for(let e=1;e<i;e++){s._cloneInto(l).update(f).digestInto(f);for(let e=0;e<n.length;e++)n[e]^=f[e]}}return xs(s,c,o,l,f)}var Cs=class{blockLen;outputLen;padOffset;isLE;buffer;view;finished=!1;length=0;pos=0;destroyed=!1;constructor(e,t,n,r){this.blockLen=e,this.outputLen=t,this.padOffset=n,this.isLE=r,this.buffer=new Uint8Array(e),this.view=fs(this.buffer)}update(e){ls(this),ss(e);let{view:t,buffer:n,blockLen:r}=this,i=e.length;for(let a=0;a<i;){let o=Math.min(r-this.pos,i-a);if(o===r){let t=fs(e);for(;r<=i-a;a+=r)this.process(t,a);continue}n.set(e.subarray(a,a+o),this.pos),this.pos+=o,a+=o,this.pos===r&&(this.process(t,0),this.pos=0)}return this.length+=e.length,this.roundClean(),this}digestInto(e){ls(this),us(e,this),this.finished=!0;let{buffer:t,view:n,blockLen:r,isLE:i}=this,{pos:a}=this;t[a++]=128,ds(this.buffer.subarray(a)),this.padOffset>r-a&&(this.process(n,0),a=0);for(let e=a;e<r;e++)t[e]=0;n.setBigUint64(r-8,BigInt(this.length*8),i),this.process(n,0);let o=fs(e),s=this.outputLen;if(s%4)throw Error(`_sha2: outputLen must be aligned to 32bit`);let c=s/4,l=this.get();if(c>l.length)throw Error(`_sha2: outputLen bigger than state`);for(let e=0;e<c;e++)o.setUint32(4*e,l[e],i)}digest(){let{buffer:e,outputLen:t}=this;this.digestInto(e);let n=e.slice(0,t);return this.destroy(),n}_cloneInto(e){e||=new this.constructor,e.set(...this.get());let{blockLen:t,buffer:n,length:r,finished:i,destroyed:a,pos:o}=this;return e.destroyed=a,e.finished=i,e.length=r,e.pos=o,r%t&&e.buffer.set(n),e}clone(){return this._cloneInto()}};let P=Uint32Array.from([1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209]),ws=BigInt(2**32-1),Ts=BigInt(32);function Es(e,t=!1){return t?{h:Number(e&ws),l:Number(e>>Ts&ws)}:{h:Number(e>>Ts&ws)|0,l:Number(e&ws)|0}}function Ds(e,t=!1){let n=e.length,r=new Uint32Array(n),i=new Uint32Array(n);for(let a=0;a<n;a++){let{h:n,l:o}=Es(e[a],t);[r[a],i[a]]=[n,o]}return[r,i]}let Os=(e,t,n)=>e>>>n,ks=(e,t,n)=>e<<32-n|t>>>n,As=(e,t,n)=>e>>>n|t<<32-n,js=(e,t,n)=>e<<32-n|t>>>n,Ms=(e,t,n)=>e<<64-n|t>>>n-32,Ns=(e,t,n)=>e>>>n-32|t<<64-n;function Ps(e,t,n,r){let i=(t>>>0)+(r>>>0);return{h:e+n+(i/2**32|0)|0,l:i|0}}let Fs=(e,t,n)=>(e>>>0)+(t>>>0)+(n>>>0),Is=(e,t,n,r)=>t+n+r+(e/2**32|0)|0,Ls=(e,t,n,r)=>(e>>>0)+(t>>>0)+(n>>>0)+(r>>>0),Rs=(e,t,n,r,i)=>t+n+r+i+(e/2**32|0)|0,zs=(e,t,n,r,i)=>(e>>>0)+(t>>>0)+(n>>>0)+(r>>>0)+(i>>>0),Bs=(e,t,n,r,i,a)=>t+n+r+i+a+(e/2**32|0)|0,Vs=Ds(`0x428a2f98d728ae22.0x7137449123ef65cd.0xb5c0fbcfec4d3b2f.0xe9b5dba58189dbbc.0x3956c25bf348b538.0x59f111f1b605d019.0x923f82a4af194f9b.0xab1c5ed5da6d8118.0xd807aa98a3030242.0x12835b0145706fbe.0x243185be4ee4b28c.0x550c7dc3d5ffb4e2.0x72be5d74f27b896f.0x80deb1fe3b1696b1.0x9bdc06a725c71235.0xc19bf174cf692694.0xe49b69c19ef14ad2.0xefbe4786384f25e3.0x0fc19dc68b8cd5b5.0x240ca1cc77ac9c65.0x2de92c6f592b0275.0x4a7484aa6ea6e483.0x5cb0a9dcbd41fbd4.0x76f988da831153b5.0x983e5152ee66dfab.0xa831c66d2db43210.0xb00327c898fb213f.0xbf597fc7beef0ee4.0xc6e00bf33da88fc2.0xd5a79147930aa725.0x06ca6351e003826f.0x142929670a0e6e70.0x27b70a8546d22ffc.0x2e1b21385c26c926.0x4d2c6dfc5ac42aed.0x53380d139d95b3df.0x650a73548baf63de.0x766a0abb3c77b2a8.0x81c2c92e47edaee6.0x92722c851482353b.0xa2bfe8a14cf10364.0xa81a664bbc423001.0xc24b8b70d0f89791.0xc76c51a30654be30.0xd192e819d6ef5218.0xd69906245565a910.0xf40e35855771202a.0x106aa07032bbd1b8.0x19a4c116b8d2d0c8.0x1e376c085141ab53.0x2748774cdf8eeb99.0x34b0bcb5e19b48a8.0x391c0cb3c5c95a63.0x4ed8aa4ae3418acb.0x5b9cca4f7763e373.0x682e6ff3d6b2b8a3.0x748f82ee5defb2fc.0x78a5636f43172f60.0x84c87814a1f0ab72.0x8cc702081a6439ec.0x90befffa23631e28.0xa4506cebde82bde9.0xbef9a3f7b2c67915.0xc67178f2e372532b.0xca273eceea26619c.0xd186b8c721c0c207.0xeada7dd6cde0eb1e.0xf57d4f7fee6ed178.0x06f067aa72176fba.0x0a637dc5a2c898a6.0x113f9804bef90dae.0x1b710b35131c471b.0x28db77f523047d84.0x32caab7b40c72493.0x3c9ebe0a15c9bebc.0x431d67c49c100d4c.0x4cc5d4becb3e42b6.0x597f299cfc657e2a.0x5fcb6fab3ad6faec.0x6c44198c4a475817`.split(`.`).map(e=>BigInt(e))),Hs=Vs[0],Us=Vs[1],Ws=new Uint32Array(80),Gs=new Uint32Array(80);var Ks=class extends Cs{constructor(e){super(128,e,16,!1)}get(){let{Ah:e,Al:t,Bh:n,Bl:r,Ch:i,Cl:a,Dh:o,Dl:s,Eh:c,El:l,Fh:u,Fl:d,Gh:f,Gl:p,Hh:m,Hl:h}=this;return[e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h]}set(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h){this.Ah=e|0,this.Al=t|0,this.Bh=n|0,this.Bl=r|0,this.Ch=i|0,this.Cl=a|0,this.Dh=o|0,this.Dl=s|0,this.Eh=c|0,this.El=l|0,this.Fh=u|0,this.Fl=d|0,this.Gh=f|0,this.Gl=p|0,this.Hh=m|0,this.Hl=h|0}process(e,t){for(let n=0;n<16;n++,t+=4)Ws[n]=e.getUint32(t),Gs[n]=e.getUint32(t+=4);for(let e=16;e<80;e++){let t=Ws[e-15]|0,n=Gs[e-15]|0,r=As(t,n,1)^As(t,n,8)^Os(t,n,7),i=js(t,n,1)^js(t,n,8)^ks(t,n,7),a=Ws[e-2]|0,o=Gs[e-2]|0,s=As(a,o,19)^Ms(a,o,61)^Os(a,o,6),c=Ls(i,js(a,o,19)^Ns(a,o,61)^ks(a,o,6),Gs[e-7],Gs[e-16]);Ws[e]=Rs(c,r,s,Ws[e-7],Ws[e-16])|0,Gs[e]=c|0}let{Ah:n,Al:r,Bh:i,Bl:a,Ch:o,Cl:s,Dh:c,Dl:l,Eh:u,El:d,Fh:f,Fl:p,Gh:m,Gl:h,Hh:g,Hl:_}=this;for(let e=0;e<80;e++){let t=As(u,d,14)^As(u,d,18)^Ms(u,d,41),v=js(u,d,14)^js(u,d,18)^Ns(u,d,41),y=u&f^~u&m,ee=d&p^~d&h,b=zs(_,v,ee,Us[e],Gs[e]),x=Bs(b,g,t,y,Hs[e],Ws[e]),S=b|0,C=As(n,r,28)^Ms(n,r,34)^Ms(n,r,39),te=js(n,r,28)^Ns(n,r,34)^Ns(n,r,39),ne=n&i^n&o^i&o,re=r&a^r&s^a&s;g=m|0,_=h|0,m=f|0,h=p|0,f=u|0,p=d|0,{h:u,l:d}=Ps(c|0,l|0,x|0,S|0),c=o|0,l=s|0,o=i|0,s=a|0,i=n|0,a=r|0;let ie=Fs(S,te,re);n=Is(ie,x,C,ne),r=ie|0}({h:n,l:r}=Ps(this.Ah|0,this.Al|0,n|0,r|0)),{h:i,l:a}=Ps(this.Bh|0,this.Bl|0,i|0,a|0),{h:o,l:s}=Ps(this.Ch|0,this.Cl|0,o|0,s|0),{h:c,l}=Ps(this.Dh|0,this.Dl|0,c|0,l|0),{h:u,l:d}=Ps(this.Eh|0,this.El|0,u|0,d|0),{h:f,l:p}=Ps(this.Fh|0,this.Fl|0,f|0,p|0),{h:m,l:h}=Ps(this.Gh|0,this.Gl|0,m|0,h|0),{h:g,l:_}=Ps(this.Hh|0,this.Hl|0,g|0,_|0),this.set(n,r,i,a,o,s,c,l,u,d,f,p,m,h,g,_)}roundClean(){ds(Ws,Gs)}destroy(){ds(this.buffer),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}},qs=class extends Ks{Ah=P[0]|0;Al=P[1]|0;Bh=P[2]|0;Bl=P[3]|0;Ch=P[4]|0;Cl=P[5]|0;Dh=P[6]|0;Dl=P[7]|0;Eh=P[8]|0;El=P[9]|0;Fh=P[10]|0;Fl=P[11]|0;Gh=P[12]|0;Gl=P[13]|0;Hh=P[14]|0;Hl=P[15]|0;constructor(){super(64)}};let Js=gs(()=>new qs,_s(3)),Ys=(e,t,n,r)=>Buffer.from(Ss(Js,e,t,{c:n,dkLen:r})),Xs=`: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`;Xs+``,``+Xs;let Zs=RegExp(`^[: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][: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\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$`);function Qs(e,t){let n=[],r=t.exec(e);for(;r;){let i=[];i.startIndex=t.lastIndex-r[0].length;let a=r.length;for(let e=0;e<a;e++)i.push(r[e]);n.push(i),r=t.exec(e)}return n}let $s=function(e){return Zs.exec(e)!=null};function ec(e){return e!==void 0}let tc=[`hasOwnProperty`,`toString`,`valueOf`,`__defineGetter__`,`__defineSetter__`,`__lookupGetter__`,`__lookupSetter__`],nc=[`__proto__`,`constructor`,`prototype`],rc={allowBooleanAttributes:!1,unpairedTags:[]};function ic(e,t){t=Object.assign({},rc,t);let n=[],r=!1,i=!1;e[0]===``&&(e=e.substr(1));for(let a=0;a<e.length;a++)if(e[a]===`<`&&e[a+1]===`?`){if(a+=2,a=oc(e,a),a.err)return a}else if(e[a]===`<`){let o=a;if(a++,e[a]===`!`){a=sc(e,a);continue}else{let s=!1;e[a]===`/`&&(s=!0,a++);let c=``;for(;a<e.length&&e[a]!==`>`&&e[a]!==` `&&e[a]!==` `&&e[a]!==`
|
|
9
|
-
`&&e[a]!==`\r`;a++)c+=e[a];if(c=c.trim(),c[c.length-1]===`/`&&(c=c.substring(0,c.length-1),a--),!mc(c)){let t;return t=c.trim().length===0?`Invalid space after '<'.`:`Tag '`+c+`' is an invalid name.`,F(`InvalidTag`,t,I(e,a))}let l=cc(e,a);if(l===!1)return F(`InvalidAttr`,`Attributes for '`+c+`' have open quote.`,I(e,a));let u=l.value;if(a=l.index,u[u.length-1]===`/`){let n=a-u.length;u=u.substring(0,u.length-1);let i=uc(u,t);if(i===!0)r=!0;else return F(i.err.code,i.err.msg,I(e,n+i.err.line))}else if(s){if(!l.tagClosed)return F(`InvalidTag`,`Closing tag '`+c+`' doesn't have proper closing.`,I(e,a));if(u.trim().length>0)return F(`InvalidTag`,`Closing tag '`+c+`' can't have attributes or invalid starting.`,I(e,o));if(n.length===0)return F(`InvalidTag`,`Closing tag '`+c+`' has not been opened.`,I(e,o));{let t=n.pop();if(c!==t.tagName){let n=I(e,t.tagStartPos);return F(`InvalidTag`,`Expected closing tag '`+t.tagName+`' (opened in line `+n.line+`, col `+n.col+`) instead of closing tag '`+c+`'.`,I(e,o))}n.length==0&&(i=!0)}}else{let s=uc(u,t);if(s!==!0)return F(s.err.code,s.err.msg,I(e,a-u.length+s.err.line));if(i===!0)return F(`InvalidXml`,`Multiple possible root nodes found.`,I(e,a));t.unpairedTags.indexOf(c)!==-1||n.push({tagName:c,tagStartPos:o}),r=!0}for(a++;a<e.length;a++)if(e[a]===`<`)if(e[a+1]===`!`){a++,a=sc(e,a);continue}else if(e[a+1]===`?`){if(a=oc(e,++a),a.err)return a}else break;else if(e[a]===`&`){let t=fc(e,a);if(t==-1)return F(`InvalidChar`,`char '&' is not expected.`,I(e,a));a=t}else if(i===!0&&!ac(e[a]))return F(`InvalidXml`,`Extra text at the end`,I(e,a));e[a]===`<`&&a--}}else{if(ac(e[a]))continue;return F(`InvalidChar`,`char '`+e[a]+`' is not expected.`,I(e,a))}return r?n.length==1?F(`InvalidTag`,`Unclosed tag '`+n[0].tagName+`'.`,I(e,n[0].tagStartPos)):n.length>0?F(`InvalidXml`,`Invalid '`+JSON.stringify(n.map(e=>e.tagName),null,4).replace(/\r?\n/g,``)+`' found.`,{line:1,col:1}):!0:F(`InvalidXml`,`Start tag expected.`,1)}function ac(e){return e===` `||e===` `||e===`
|
|
10
|
-
`||e===`\r`}function oc(e,t){let n=t;for(;t<e.length;t++)if(e[t]==`?`||e[t]==` `){let r=e.substr(n,t-n);if(t>5&&r===`xml`)return F(`InvalidXml`,`XML declaration allowed only at the start of the document.`,I(e,t));if(e[t]==`?`&&e[t+1]==`>`){t++;break}else continue}return t}function sc(e,t){if(e.length>t+5&&e[t+1]===`-`&&e[t+2]===`-`){for(t+=3;t<e.length;t++)if(e[t]===`-`&&e[t+1]===`-`&&e[t+2]===`>`){t+=2;break}}else if(e.length>t+8&&e[t+1]===`D`&&e[t+2]===`O`&&e[t+3]===`C`&&e[t+4]===`T`&&e[t+5]===`Y`&&e[t+6]===`P`&&e[t+7]===`E`){let n=1;for(t+=8;t<e.length;t++)if(e[t]===`<`)n++;else if(e[t]===`>`&&(n--,n===0))break}else if(e.length>t+9&&e[t+1]===`[`&&e[t+2]===`C`&&e[t+3]===`D`&&e[t+4]===`A`&&e[t+5]===`T`&&e[t+6]===`A`&&e[t+7]===`[`){for(t+=8;t<e.length;t++)if(e[t]===`]`&&e[t+1]===`]`&&e[t+2]===`>`){t+=2;break}}return t}function cc(e,t){let n=``,r=``,i=!1;for(;t<e.length;t++){if(e[t]===`"`||e[t]===`'`)r===``?r=e[t]:r!==e[t]||(r=``);else if(e[t]===`>`&&r===``){i=!0;break}n+=e[t]}return r===``?{value:n,index:t,tagClosed:i}:!1}let lc=RegExp(`(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['"])(([\\s\\S])*?)\\5)?`,`g`);function uc(e,t){let n=Qs(e,lc),r={};for(let e=0;e<n.length;e++){if(n[e][1].length===0)return F(`InvalidAttr`,`Attribute '`+n[e][2]+`' has no space in starting.`,hc(n[e]));if(n[e][3]!==void 0&&n[e][4]===void 0)return F(`InvalidAttr`,`Attribute '`+n[e][2]+`' is without value.`,hc(n[e]));if(n[e][3]===void 0&&!t.allowBooleanAttributes)return F(`InvalidAttr`,`boolean attribute '`+n[e][2]+`' is not allowed.`,hc(n[e]));let i=n[e][2];if(!pc(i))return F(`InvalidAttr`,`Attribute '`+i+`' is an invalid name.`,hc(n[e]));if(!Object.prototype.hasOwnProperty.call(r,i))r[i]=1;else return F(`InvalidAttr`,`Attribute '`+i+`' is repeated.`,hc(n[e]))}return!0}function dc(e,t){let n=/\d/;for(e[t]===`x`&&(t++,n=/[\da-fA-F]/);t<e.length;t++){if(e[t]===`;`)return t;if(!e[t].match(n))break}return-1}function fc(e,t){if(t++,e[t]===`;`)return-1;if(e[t]===`#`)return t++,dc(e,t);let n=0;for(;t<e.length;t++,n++)if(!(e[t].match(/\w/)&&n<20)){if(e[t]===`;`)break;return-1}return t}function F(e,t,n){return{err:{code:e,msg:t,line:n.line||n,col:n.col}}}function pc(e){return $s(e)}function mc(e){return $s(e)}function I(e,t){let n=e.substring(0,t).split(/\r?\n/);return{line:n.length,col:n[n.length-1].length+1}}function hc(e){return e.startIndex+e[1].length}let gc=e=>tc.includes(e)?`__`+e:e,_c={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(e,t){return t},attributeValueProcessor:function(e,t){return t},stopNodes:[],alwaysCreateTextNode:!1,isArray:()=>!1,commentPropName:!1,unpairedTags:[],processEntities:!0,htmlEntities:!1,ignoreDeclaration:!1,ignorePiTags:!1,transformTagName:!1,transformAttributeName:!1,updateTag:function(e,t,n){return e},captureMetaData:!1,maxNestedTags:100,strictReservedNames:!0,jPath:!0,onDangerousProperty:gc};function vc(e,t){if(typeof e!=`string`)return;let n=e.toLowerCase();if(tc.some(e=>n===e.toLowerCase())||nc.some(e=>n===e.toLowerCase()))throw Error(`[SECURITY] Invalid ${t}: "${e}" is a reserved JavaScript keyword that could cause prototype pollution`)}function yc(e){return typeof e==`boolean`?{enabled:e,maxEntitySize:1e4,maxExpansionDepth:10,maxTotalExpansions:1e3,maxExpandedLength:1e5,maxEntityCount:100,allowedTags:null,tagFilter:null}:typeof e==`object`&&e?{enabled:e.enabled!==!1,maxEntitySize:Math.max(1,e.maxEntitySize??1e4),maxExpansionDepth:Math.max(1,e.maxExpansionDepth??10),maxTotalExpansions:Math.max(1,e.maxTotalExpansions??1e3),maxExpandedLength:Math.max(1,e.maxExpandedLength??1e5),maxEntityCount:Math.max(1,e.maxEntityCount??100),allowedTags:e.allowedTags??null,tagFilter:e.tagFilter??null}:yc(!0)}let bc=function(e){let t=Object.assign({},_c,e),n=[{value:t.attributeNamePrefix,name:`attributeNamePrefix`},{value:t.attributesGroupName,name:`attributesGroupName`},{value:t.textNodeName,name:`textNodeName`},{value:t.cdataPropName,name:`cdataPropName`},{value:t.commentPropName,name:`commentPropName`}];for(let{value:e,name:t}of n)e&&vc(e,t);return t.onDangerousProperty===null&&(t.onDangerousProperty=gc),t.processEntities=yc(t.processEntities),t.stopNodes&&Array.isArray(t.stopNodes)&&(t.stopNodes=t.stopNodes.map(e=>typeof e==`string`&&e.startsWith(`*.`)?`..`+e.substring(2):e)),t},xc;xc=typeof Symbol==`function`?Symbol(`XML Node Metadata`):`@@xmlMetadata`;var Sc=class{constructor(e){this.tagname=e,this.child=[],this[`:@`]=Object.create(null)}add(e,t){e===`__proto__`&&(e=`#__proto__`),this.child.push({[e]:t})}addChild(e,t){e.tagname===`__proto__`&&(e.tagname=`#__proto__`),e[`:@`]&&Object.keys(e[`:@`]).length>0?this.child.push({[e.tagname]:e.child,":@":e[`:@`]}):this.child.push({[e.tagname]:e.child}),t!==void 0&&(this.child[this.child.length-1][xc]={startIndex:t})}static getMetaDataSymbol(){return xc}},Cc=class{constructor(e){this.suppressValidationErr=!e,this.options=e}readDocType(e,t){let n=Object.create(null),r=0;if(e[t+3]===`O`&&e[t+4]===`C`&&e[t+5]===`T`&&e[t+6]===`Y`&&e[t+7]===`P`&&e[t+8]===`E`){t+=9;let i=1,a=!1,o=!1,s=``;for(;t<e.length;t++)if(e[t]===`<`&&!o){if(a&&wc(e,`!ENTITY`,t)){t+=7;let i,a;if([i,a,t]=this.readEntityExp(e,t+1,this.suppressValidationErr),a.indexOf(`&`)===-1){if(this.options.enabled!==!1&&this.options.maxEntityCount!=null&&r>=this.options.maxEntityCount)throw Error(`Entity count (${r+1}) exceeds maximum allowed (${this.options.maxEntityCount})`);let e=i.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`);n[i]={regx:RegExp(`&${e};`,`g`),val:a},r++}}else if(a&&wc(e,`!ELEMENT`,t)){t+=8;let{index:n}=this.readElementExp(e,t+1);t=n}else if(a&&wc(e,`!ATTLIST`,t))t+=8;else if(a&&wc(e,`!NOTATION`,t)){t+=9;let{index:n}=this.readNotationExp(e,t+1,this.suppressValidationErr);t=n}else if(wc(e,`!--`,t))o=!0;else throw Error(`Invalid DOCTYPE`);i++,s=``}else if(e[t]===`>`){if(o?e[t-1]===`-`&&e[t-2]===`-`&&(o=!1,i--):i--,i===0)break}else e[t]===`[`?a=!0:s+=e[t];if(i!==0)throw Error(`Unclosed DOCTYPE`)}else throw Error(`Invalid Tag instead of DOCTYPE`);return{entities:n,i:t}}readEntityExp(e,t){t=L(e,t);let n=t;for(;t<e.length&&!/\s/.test(e[t])&&e[t]!==`"`&&e[t]!==`'`;)t++;let r=e.substring(n,t);if(Tc(r),t=L(e,t),!this.suppressValidationErr){if(e.substring(t,t+6).toUpperCase()===`SYSTEM`)throw Error(`External entities are not supported`);if(e[t]===`%`)throw Error(`Parameter entities are not supported`)}let i=``;if([t,i]=this.readIdentifierVal(e,t,`entity`),this.options.enabled!==!1&&this.options.maxEntitySize!=null&&i.length>this.options.maxEntitySize)throw Error(`Entity "${r}" size (${i.length}) exceeds maximum allowed size (${this.options.maxEntitySize})`);return t--,[r,i,t]}readNotationExp(e,t){t=L(e,t);let n=t;for(;t<e.length&&!/\s/.test(e[t]);)t++;let r=e.substring(n,t);!this.suppressValidationErr&&Tc(r),t=L(e,t);let i=e.substring(t,t+6).toUpperCase();if(!this.suppressValidationErr&&i!==`SYSTEM`&&i!==`PUBLIC`)throw Error(`Expected SYSTEM or PUBLIC, found "${i}"`);t+=i.length,t=L(e,t);let a=null,o=null;if(i===`PUBLIC`)[t,a]=this.readIdentifierVal(e,t,`publicIdentifier`),t=L(e,t),(e[t]===`"`||e[t]===`'`)&&([t,o]=this.readIdentifierVal(e,t,`systemIdentifier`));else if(i===`SYSTEM`&&([t,o]=this.readIdentifierVal(e,t,`systemIdentifier`),!this.suppressValidationErr&&!o))throw Error(`Missing mandatory system identifier for SYSTEM notation`);return{notationName:r,publicIdentifier:a,systemIdentifier:o,index:--t}}readIdentifierVal(e,t,n){let r=``,i=e[t];if(i!==`"`&&i!==`'`)throw Error(`Expected quoted string, found "${i}"`);t++;let a=t;for(;t<e.length&&e[t]!==i;)t++;if(r=e.substring(a,t),e[t]!==i)throw Error(`Unterminated ${n} value`);return t++,[t,r]}readElementExp(e,t){t=L(e,t);let n=t;for(;t<e.length&&!/\s/.test(e[t]);)t++;let r=e.substring(n,t);if(!this.suppressValidationErr&&!$s(r))throw Error(`Invalid element name: "${r}"`);t=L(e,t);let i=``;if(e[t]===`E`&&wc(e,`MPTY`,t))t+=4;else if(e[t]===`A`&&wc(e,`NY`,t))t+=2;else if(e[t]===`(`){t++;let n=t;for(;t<e.length&&e[t]!==`)`;)t++;if(i=e.substring(n,t),e[t]!==`)`)throw Error(`Unterminated content model`)}else if(!this.suppressValidationErr)throw Error(`Invalid Element Expression, found "${e[t]}"`);return{elementName:r,contentModel:i.trim(),index:t}}readAttlistExp(e,t){t=L(e,t);let n=t;for(;t<e.length&&!/\s/.test(e[t]);)t++;let r=e.substring(n,t);for(Tc(r),t=L(e,t),n=t;t<e.length&&!/\s/.test(e[t]);)t++;let i=e.substring(n,t);if(!Tc(i))throw Error(`Invalid attribute name: "${i}"`);t=L(e,t);let a=``;if(e.substring(t,t+8).toUpperCase()===`NOTATION`){if(a=`NOTATION`,t+=8,t=L(e,t),e[t]!==`(`)throw Error(`Expected '(', found "${e[t]}"`);t++;let n=[];for(;t<e.length&&e[t]!==`)`;){let r=t;for(;t<e.length&&e[t]!==`|`&&e[t]!==`)`;)t++;let i=e.substring(r,t);if(i=i.trim(),!Tc(i))throw Error(`Invalid notation name: "${i}"`);n.push(i),e[t]===`|`&&(t++,t=L(e,t))}if(e[t]!==`)`)throw Error(`Unterminated list of notations`);t++,a+=` (`+n.join(`|`)+`)`}else{let n=t;for(;t<e.length&&!/\s/.test(e[t]);)t++;if(a+=e.substring(n,t),!this.suppressValidationErr&&![`CDATA`,`ID`,`IDREF`,`IDREFS`,`ENTITY`,`ENTITIES`,`NMTOKEN`,`NMTOKENS`].includes(a.toUpperCase()))throw Error(`Invalid attribute type: "${a}"`)}t=L(e,t);let o=``;return e.substring(t,t+8).toUpperCase()===`#REQUIRED`?(o=`#REQUIRED`,t+=8):e.substring(t,t+7).toUpperCase()===`#IMPLIED`?(o=`#IMPLIED`,t+=7):[t,o]=this.readIdentifierVal(e,t,`ATTLIST`),{elementName:r,attributeName:i,attributeType:a,defaultValue:o,index:t}}};let L=(e,t)=>{for(;t<e.length&&/\s/.test(e[t]);)t++;return t};function wc(e,t,n){for(let r=0;r<t.length;r++)if(t[r]!==e[n+r+1])return!1;return!0}function Tc(e){if($s(e))return e;throw Error(`Invalid entity name ${e}`)}let Ec=/^[-+]?0x[a-fA-F0-9]+$/,Dc=/^([\-\+])?(0*)([0-9]*(\.[0-9]*)?)$/,Oc={hex:!0,leadingZeros:!0,decimalPoint:`.`,eNotation:!0,infinity:`original`};function kc(e,t={}){if(t=Object.assign({},Oc,t),!e||typeof e!=`string`)return e;let n=e.trim();if(n.length===0||t.skipLike!==void 0&&t.skipLike.test(n))return e;if(n===`0`)return 0;if(t.hex&&Ec.test(n))return Nc(n,16);if(!isFinite(n))return Pc(e,Number(n),t);if(n.includes(`e`)||n.includes(`E`))return jc(e,n,t);{let r=Dc.exec(n);if(r){let i=r[1]||``,a=r[2],o=Mc(r[3]),s=i?e[a.length+1]===`.`:e[a.length]===`.`;if(!t.leadingZeros&&(a.length>1||a.length===1&&!s))return e;{let r=Number(n),s=String(r);if(r===0)return r;if(s.search(/[eE]/)!==-1)return t.eNotation?r:e;if(n.indexOf(`.`)!==-1)return s===`0`||s===o||s===`${i}${o}`?r:e;let c=a?o:n;return a?c===s||i+c===s?r:e:c===s||c===i+s?r:e}}else return e}}let Ac=/^([-+])?(0*)(\d*(\.\d*)?[eE][-\+]?\d+)$/;function jc(e,t,n){if(!n.eNotation)return e;let r=t.match(Ac);if(r){let i=r[1]||``,a=r[3].indexOf(`e`)===-1?`E`:`e`,o=r[2],s=i?e[o.length+1]===a:e[o.length]===a;return o.length>1&&s?e:o.length===1&&(r[3].startsWith(`.${a}`)||r[3][0]===a)?Number(t):o.length>0?n.leadingZeros&&!s?(t=(r[1]||``)+r[3],Number(t)):e:Number(t)}else return e}function Mc(e){return e&&e.indexOf(`.`)!==-1?(e=e.replace(/0+$/,``),e===`.`?e=`0`:e[0]===`.`?e=`0`+e:e[e.length-1]===`.`&&(e=e.substring(0,e.length-1)),e):e}function Nc(e,t){if(parseInt)return parseInt(e,t);if(Number.parseInt)return Number.parseInt(e,t);if(window&&window.parseInt)return window.parseInt(e,t);throw Error(`parseInt, Number.parseInt, window.parseInt are not supported`)}function Pc(e,t,n){let r=t===1/0;switch(n.infinity.toLowerCase()){case`null`:return null;case`infinity`:return t;case`string`:return r?`Infinity`:`-Infinity`;default:return e}}function Fc(e){return typeof e==`function`?e:Array.isArray(e)?t=>{for(let n of e)if(typeof n==`string`&&t===n||n instanceof RegExp&&n.test(t))return!0}:()=>!1}var Ic=class{constructor(e,t={}){this.pattern=e,this.separator=t.separator||`.`,this.segments=this._parse(e),this._hasDeepWildcard=this.segments.some(e=>e.type===`deep-wildcard`),this._hasAttributeCondition=this.segments.some(e=>e.attrName!==void 0),this._hasPositionSelector=this.segments.some(e=>e.position!==void 0)}_parse(e){let t=[],n=0,r=``;for(;n<e.length;)e[n]===this.separator?n+1<e.length&&e[n+1]===this.separator?(r.trim()&&(t.push(this._parseSegment(r.trim())),r=``),t.push({type:`deep-wildcard`}),n+=2):(r.trim()&&t.push(this._parseSegment(r.trim())),r=``,n++):(r+=e[n],n++);return r.trim()&&t.push(this._parseSegment(r.trim())),t}_parseSegment(e){let t={type:`tag`},n=null,r=e,i=e.match(/^([^\[]+)(\[[^\]]*\])(.*)$/);if(i&&(r=i[1]+i[3],i[2])){let e=i[2].slice(1,-1);e&&(n=e)}let a,o=r;if(r.includes(`::`)){let t=r.indexOf(`::`);if(a=r.substring(0,t).trim(),o=r.substring(t+2).trim(),!a)throw Error(`Invalid namespace in pattern: ${e}`)}let s,c=null;if(o.includes(`:`)){let e=o.lastIndexOf(`:`),t=o.substring(0,e).trim(),n=o.substring(e+1).trim();[`first`,`last`,`odd`,`even`].includes(n)||/^nth\(\d+\)$/.test(n)?(s=t,c=n):s=o}else s=o;if(!s)throw Error(`Invalid segment pattern: ${e}`);if(t.tag=s,a&&(t.namespace=a),n)if(n.includes(`=`)){let e=n.indexOf(`=`);t.attrName=n.substring(0,e).trim(),t.attrValue=n.substring(e+1).trim()}else t.attrName=n.trim();if(c){let e=c.match(/^nth\((\d+)\)$/);e?(t.position=`nth`,t.positionValue=parseInt(e[1],10)):t.position=c}return t}get length(){return this.segments.length}hasDeepWildcard(){return this._hasDeepWildcard}hasAttributeCondition(){return this._hasAttributeCondition}hasPositionSelector(){return this._hasPositionSelector}toString(){return this.pattern}};let Lc=new Set([`push`,`pop`,`reset`,`updateCurrent`,`restore`]);var Rc=class{constructor(e={}){this.separator=e.separator||`.`,this.path=[],this.siblingStacks=[]}push(e,t=null,n=null){if(this.path.length>0){let e=this.path[this.path.length-1];e.values=void 0}let r=this.path.length;this.siblingStacks[r]||(this.siblingStacks[r]=new Map);let i=this.siblingStacks[r],a=n?`${n}:${e}`:e,o=i.get(a)||0,s=0;for(let e of i.values())s+=e;i.set(a,o+1);let c={tag:e,position:s,counter:o};n!=null&&(c.namespace=n),t!=null&&(c.values=t),this.path.push(c)}pop(){if(this.path.length===0)return;let e=this.path.pop();return this.siblingStacks.length>this.path.length+1&&(this.siblingStacks.length=this.path.length+1),e}updateCurrent(e){if(this.path.length>0){let t=this.path[this.path.length-1];e!=null&&(t.values=e)}}getCurrentTag(){return this.path.length>0?this.path[this.path.length-1].tag:void 0}getCurrentNamespace(){return this.path.length>0?this.path[this.path.length-1].namespace:void 0}getAttrValue(e){if(this.path.length!==0)return this.path[this.path.length-1].values?.[e]}hasAttr(e){if(this.path.length===0)return!1;let t=this.path[this.path.length-1];return t.values!==void 0&&e in t.values}getPosition(){return this.path.length===0?-1:this.path[this.path.length-1].position??0}getCounter(){return this.path.length===0?-1:this.path[this.path.length-1].counter??0}getIndex(){return this.getPosition()}getDepth(){return this.path.length}toString(e,t=!0){let n=e||this.separator;return this.path.map(e=>t&&e.namespace?`${e.namespace}:${e.tag}`:e.tag).join(n)}toArray(){return this.path.map(e=>e.tag)}reset(){this.path=[],this.siblingStacks=[]}matches(e){let t=e.segments;return t.length===0?!1:e.hasDeepWildcard()?this._matchWithDeepWildcard(t):this._matchSimple(t)}_matchSimple(e){if(this.path.length!==e.length)return!1;for(let t=0;t<e.length;t++){let n=e[t],r=this.path[t],i=t===this.path.length-1;if(!this._matchSegment(n,r,i))return!1}return!0}_matchWithDeepWildcard(e){let t=this.path.length-1,n=e.length-1;for(;n>=0&&t>=0;){let r=e[n];if(r.type===`deep-wildcard`){if(n--,n<0)return!0;let r=e[n],i=!1;for(let e=t;e>=0;e--){let a=e===this.path.length-1;if(this._matchSegment(r,this.path[e],a)){t=e-1,n--,i=!0;break}}if(!i)return!1}else{let e=t===this.path.length-1;if(!this._matchSegment(r,this.path[t],e))return!1;t--,n--}}return n<0}_matchSegment(e,t,n){if(e.tag!==`*`&&e.tag!==t.tag||e.namespace!==void 0&&e.namespace!==`*`&&e.namespace!==t.namespace)return!1;if(e.attrName!==void 0){if(!n||!t.values||!(e.attrName in t.values))return!1;if(e.attrValue!==void 0){let n=t.values[e.attrName];if(String(n)!==String(e.attrValue))return!1}}if(e.position!==void 0){if(!n)return!1;let r=t.counter??0;if(e.position===`first`&&r!==0||e.position===`odd`&&r%2!=1||e.position===`even`&&r%2!=0||e.position===`nth`&&r!==e.positionValue)return!1}return!0}snapshot(){return{path:this.path.map(e=>({...e})),siblingStacks:this.siblingStacks.map(e=>new Map(e))}}restore(e){this.path=e.path.map(e=>({...e})),this.siblingStacks=e.siblingStacks.map(e=>new Map(e))}readOnly(){return new Proxy(this,{get(e,t,n){if(Lc.has(t))return()=>{throw TypeError(`Cannot call '${t}' on a read-only Matcher. Obtain a writable instance to mutate state.`)};let r=Reflect.get(e,t,n);return t===`path`||t===`siblingStacks`?Object.freeze(Array.isArray(r)?r.map(e=>e instanceof Map?Object.freeze(new Map(e)):Object.freeze({...e})):r):typeof r==`function`?r.bind(e):r},set(e,t){throw TypeError(`Cannot set property '${String(t)}' on a read-only Matcher.`)},deleteProperty(e,t){throw TypeError(`Cannot delete property '${String(t)}' from a read-only Matcher.`)}})}};function zc(e,t){if(!e)return{};let n=t.attributesGroupName?e[t.attributesGroupName]:e;if(!n)return{};let r={};for(let e in n)if(e.startsWith(t.attributeNamePrefix)){let i=e.substring(t.attributeNamePrefix.length);r[i]=n[e]}else r[e]=n[e];return r}function Bc(e){if(!e||typeof e!=`string`)return;let t=e.indexOf(`:`);if(t!==-1&&t>0){let n=e.substring(0,t);if(n!==`xmlns`)return n}}var Vc=class{constructor(e){if(this.options=e,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:(e,t)=>rl(t,10,`&#`)},num_hex:{regex:/&#x([0-9a-fA-F]{1,6});/g,val:(e,t)=>rl(t,16,`&#x`)}},this.addExternalEntities=Hc,this.parseXml=qc,this.parseTextData=Uc,this.resolveNameSpace=Wc,this.buildAttributesMap=Kc,this.isItStopNode=Zc,this.replaceEntitiesValue=Yc,this.readStopNodeData=tl,this.saveTextToParentTag=Xc,this.addChild=Jc,this.ignoreAttributesFn=Fc(this.options.ignoreAttributes),this.entityExpansionCount=0,this.currentExpandedLength=0,this.matcher=new Rc,this.readonlyMatcher=this.matcher.readOnly(),this.isCurrentNodeStopNode=!1,this.options.stopNodes&&this.options.stopNodes.length>0){this.stopNodeExpressions=[];for(let e=0;e<this.options.stopNodes.length;e++){let t=this.options.stopNodes[e];typeof t==`string`?this.stopNodeExpressions.push(new Ic(t)):t instanceof Ic&&this.stopNodeExpressions.push(t)}}}};function Hc(e){let t=Object.keys(e);for(let n=0;n<t.length;n++){let r=t[n],i=r.replace(/[.\-+*:]/g,`\\.`);this.lastEntities[r]={regex:RegExp(`&`+i+`;`,`g`),val:e[r]}}}function Uc(e,t,n,r,i,a,o){if(e!==void 0&&(this.options.trimValues&&!r&&(e=e.trim()),e.length>0)){o||(e=this.replaceEntitiesValue(e,t,n));let r=this.options.jPath?n.toString():n,s=this.options.tagValueProcessor(t,e,r,i,a);return s==null?e:typeof s!=typeof e||s!==e?s:this.options.trimValues||e.trim()===e?nl(e,this.options.parseTagValue,this.options.numberParseOptions):e}}function Wc(e){if(this.options.removeNSPrefix){let t=e.split(`:`),n=e.charAt(0)===`/`?`/`:``;if(t[0]===`xmlns`)return``;t.length===2&&(e=n+t[1])}return e}let Gc=RegExp(`([^\\s=]+)\\s*(=\\s*(['"])([\\s\\S]*?)\\3)?`,`gm`);function Kc(e,t,n){if(this.options.ignoreAttributes!==!0&&typeof e==`string`){let r=Qs(e,Gc),i=r.length,a={},o={};for(let e=0;e<i;e++){let t=this.resolveNameSpace(r[e][1]),i=r[e][4];if(t.length&&i!==void 0){let e=i;this.options.trimValues&&(e=e.trim()),e=this.replaceEntitiesValue(e,n,this.readonlyMatcher),o[t]=e}}Object.keys(o).length>0&&typeof t==`object`&&t.updateCurrent&&t.updateCurrent(o);for(let e=0;e<i;e++){let i=this.resolveNameSpace(r[e][1]),o=this.options.jPath?t.toString():this.readonlyMatcher;if(this.ignoreAttributesFn(i,o))continue;let s=r[e][4],c=this.options.attributeNamePrefix+i;if(i.length)if(this.options.transformAttributeName&&(c=this.options.transformAttributeName(c)),c=al(c,this.options),s!==void 0){this.options.trimValues&&(s=s.trim()),s=this.replaceEntitiesValue(s,n,this.readonlyMatcher);let e=this.options.jPath?t.toString():this.readonlyMatcher,r=this.options.attributeValueProcessor(i,s,e);r==null?a[c]=s:typeof r!=typeof s||r!==s?a[c]=r:a[c]=nl(s,this.options.parseAttributeValue,this.options.numberParseOptions)}else this.options.allowBooleanAttributes&&(a[c]=!0)}if(!Object.keys(a).length)return;if(this.options.attributesGroupName){let e={};return e[this.options.attributesGroupName]=a,e}return a}}let qc=function(e){e=e.replace(/\r\n?/g,`
|
|
11
|
-
`);let t=new Sc(`!xml`),n=t,r=``;this.matcher.reset(),this.entityExpansionCount=0,this.currentExpandedLength=0;let i=new Cc(this.options.processEntities);for(let a=0;a<e.length;a++)if(e[a]===`<`)if(e[a+1]===`/`){let t=$c(e,`>`,a,`Closing Tag is not closed.`),i=e.substring(a+2,t).trim();if(this.options.removeNSPrefix){let e=i.indexOf(`:`);e!==-1&&(i=i.substr(e+1))}i=il(this.options.transformTagName,i,``,this.options).tagName,n&&(r=this.saveTextToParentTag(r,n,this.readonlyMatcher));let o=this.matcher.getCurrentTag();if(i&&this.options.unpairedTags.indexOf(i)!==-1)throw Error(`Unpaired tag can not be used as closing tag: </${i}>`);o&&this.options.unpairedTags.indexOf(o)!==-1&&(this.matcher.pop(),this.tagsNodeStack.pop()),this.matcher.pop(),this.isCurrentNodeStopNode=!1,n=this.tagsNodeStack.pop(),r=``,a=t}else if(e[a+1]===`?`){let t=el(e,a,!1,`?>`);if(!t)throw Error(`Pi Tag is not closed.`);if(r=this.saveTextToParentTag(r,n,this.readonlyMatcher),!(this.options.ignoreDeclaration&&t.tagName===`?xml`||this.options.ignorePiTags)){let e=new Sc(t.tagName);e.add(this.options.textNodeName,``),t.tagName!==t.tagExp&&t.attrExpPresent&&(e[`:@`]=this.buildAttributesMap(t.tagExp,this.matcher,t.tagName)),this.addChild(n,e,this.readonlyMatcher,a)}a=t.closeIndex+1}else if(e.substr(a+1,3)===`!--`){let t=$c(e,`-->`,a+4,`Comment is not closed.`);if(this.options.commentPropName){let i=e.substring(a+4,t-2);r=this.saveTextToParentTag(r,n,this.readonlyMatcher),n.add(this.options.commentPropName,[{[this.options.textNodeName]:i}])}a=t}else if(e.substr(a+1,2)===`!D`){let t=i.readDocType(e,a);this.docTypeEntities=t.entities,a=t.i}else if(e.substr(a+1,2)===`![`){let t=$c(e,`]]>`,a,`CDATA is not closed.`)-2,i=e.substring(a+9,t);r=this.saveTextToParentTag(r,n,this.readonlyMatcher);let o=this.parseTextData(i,n.tagname,this.readonlyMatcher,!0,!1,!0,!0);o??=``,this.options.cdataPropName?n.add(this.options.cdataPropName,[{[this.options.textNodeName]:i}]):n.add(this.options.textNodeName,o),a=t+2}else{let i=el(e,a,this.options.removeNSPrefix);if(!i){let t=e.substring(Math.max(0,a-50),Math.min(e.length,a+50));throw Error(`readTagExp returned undefined at position ${a}. Context: "${t}"`)}let o=i.tagName,s=i.rawTagName,c=i.tagExp,l=i.attrExpPresent,u=i.closeIndex;if({tagName:o,tagExp:c}=il(this.options.transformTagName,o,c,this.options),this.options.strictReservedNames&&(o===this.options.commentPropName||o===this.options.cdataPropName||o===this.options.textNodeName||o===this.options.attributesGroupName))throw Error(`Invalid tag name: ${o}`);n&&r&&n.tagname!==`!xml`&&(r=this.saveTextToParentTag(r,n,this.readonlyMatcher,!1));let d=n;d&&this.options.unpairedTags.indexOf(d.tagname)!==-1&&(n=this.tagsNodeStack.pop(),this.matcher.pop());let f=!1;c.length>0&&c.lastIndexOf(`/`)===c.length-1&&(f=!0,o[o.length-1]===`/`?(o=o.substr(0,o.length-1),c=o):c=c.substr(0,c.length-1),l=o!==c);let p=null,m;m=Bc(s),o!==t.tagname&&this.matcher.push(o,{},m),o!==c&&l&&(p=this.buildAttributesMap(c,this.matcher,o),p&&zc(p,this.options)),o!==t.tagname&&(this.isCurrentNodeStopNode=this.isItStopNode(this.stopNodeExpressions,this.matcher));let h=a;if(this.isCurrentNodeStopNode){let t=``;if(f)a=i.closeIndex;else if(this.options.unpairedTags.indexOf(o)!==-1)a=i.closeIndex;else{let n=this.readStopNodeData(e,s,u+1);if(!n)throw Error(`Unexpected end of ${s}`);a=n.i,t=n.tagContent}let r=new Sc(o);p&&(r[`:@`]=p),r.add(this.options.textNodeName,t),this.matcher.pop(),this.isCurrentNodeStopNode=!1,this.addChild(n,r,this.readonlyMatcher,h)}else{if(f){({tagName:o,tagExp:c}=il(this.options.transformTagName,o,c,this.options));let e=new Sc(o);p&&(e[`:@`]=p),this.addChild(n,e,this.readonlyMatcher,h),this.matcher.pop(),this.isCurrentNodeStopNode=!1}else if(this.options.unpairedTags.indexOf(o)!==-1){let e=new Sc(o);p&&(e[`:@`]=p),this.addChild(n,e,this.readonlyMatcher,h),this.matcher.pop(),this.isCurrentNodeStopNode=!1,a=i.closeIndex;continue}else{let e=new Sc(o);if(this.tagsNodeStack.length>this.options.maxNestedTags)throw Error(`Maximum nested tags exceeded`);this.tagsNodeStack.push(n),p&&(e[`:@`]=p),this.addChild(n,e,this.readonlyMatcher,h),n=e}r=``,a=u}}else r+=e[a];return t.child};function Jc(e,t,n,r){this.options.captureMetaData||(r=void 0);let i=this.options.jPath?n.toString():n,a=this.options.updateTag(t.tagname,i,t[`:@`]);a===!1||(typeof a==`string`&&(t.tagname=a),e.addChild(t,r))}function Yc(e,t,n){let r=this.options.processEntities;if(!r||!r.enabled)return e;if(r.allowedTags){let i=this.options.jPath?n.toString():n;if(!(Array.isArray(r.allowedTags)?r.allowedTags.includes(t):r.allowedTags(t,i)))return e}if(r.tagFilter){let i=this.options.jPath?n.toString():n;if(!r.tagFilter(t,i))return e}for(let t of Object.keys(this.docTypeEntities)){let n=this.docTypeEntities[t],i=e.match(n.regx);if(i){if(this.entityExpansionCount+=i.length,r.maxTotalExpansions&&this.entityExpansionCount>r.maxTotalExpansions)throw Error(`Entity expansion limit exceeded: ${this.entityExpansionCount} > ${r.maxTotalExpansions}`);let t=e.length;if(e=e.replace(n.regx,n.val),r.maxExpandedLength&&(this.currentExpandedLength+=e.length-t,this.currentExpandedLength>r.maxExpandedLength))throw Error(`Total expanded content size exceeded: ${this.currentExpandedLength} > ${r.maxExpandedLength}`)}}for(let t of Object.keys(this.lastEntities)){let n=this.lastEntities[t],i=e.match(n.regex);if(i&&(this.entityExpansionCount+=i.length,r.maxTotalExpansions&&this.entityExpansionCount>r.maxTotalExpansions))throw Error(`Entity expansion limit exceeded: ${this.entityExpansionCount} > ${r.maxTotalExpansions}`);e=e.replace(n.regex,n.val)}if(e.indexOf(`&`)===-1)return e;if(this.options.htmlEntities)for(let t of Object.keys(this.htmlEntities)){let n=this.htmlEntities[t],i=e.match(n.regex);if(i&&(this.entityExpansionCount+=i.length,r.maxTotalExpansions&&this.entityExpansionCount>r.maxTotalExpansions))throw Error(`Entity expansion limit exceeded: ${this.entityExpansionCount} > ${r.maxTotalExpansions}`);e=e.replace(n.regex,n.val)}return e=e.replace(this.ampEntity.regex,this.ampEntity.val),e}function Xc(e,t,n,r){return e&&=(r===void 0&&(r=t.child.length===0),e=this.parseTextData(e,t.tagname,n,!1,t[`:@`]?Object.keys(t[`:@`]).length!==0:!1,r),e!==void 0&&e!==``&&t.add(this.options.textNodeName,e),``),e}function Zc(e,t){if(!e||e.length===0)return!1;for(let n=0;n<e.length;n++)if(t.matches(e[n]))return!0;return!1}function Qc(e,t,n=`>`){let r,i=``;for(let a=t;a<e.length;a++){let t=e[a];if(r)t===r&&(r=``);else if(t===`"`||t===`'`)r=t;else if(t===n[0])if(n[1]){if(e[a+1]===n[1])return{data:i,index:a}}else return{data:i,index:a};else t===` `&&(t=` `);i+=t}}function $c(e,t,n,r){let i=e.indexOf(t,n);if(i===-1)throw Error(r);return i+t.length-1}function el(e,t,n,r=`>`){let i=Qc(e,t+1,r);if(!i)return;let a=i.data,o=i.index,s=a.search(/\s/),c=a,l=!0;s!==-1&&(c=a.substring(0,s),a=a.substring(s+1).trimStart());let u=c;if(n){let e=c.indexOf(`:`);e!==-1&&(c=c.substr(e+1),l=c!==i.data.substr(e+1))}return{tagName:c,tagExp:a,closeIndex:o,attrExpPresent:l,rawTagName:u}}function tl(e,t,n){let r=n,i=1;for(;n<e.length;n++)if(e[n]===`<`)if(e[n+1]===`/`){let a=$c(e,`>`,n,`${t} is not closed`);if(e.substring(n+2,a).trim()===t&&(i--,i===0))return{tagContent:e.substring(r,n),i:a};n=a}else if(e[n+1]===`?`)n=$c(e,`?>`,n+1,`StopNode is not closed.`);else if(e.substr(n+1,3)===`!--`)n=$c(e,`-->`,n+3,`StopNode is not closed.`);else if(e.substr(n+1,2)===`![`)n=$c(e,`]]>`,n,`StopNode is not closed.`)-2;else{let r=el(e,n,`>`);r&&((r&&r.tagName)===t&&r.tagExp[r.tagExp.length-1]!==`/`&&i++,n=r.closeIndex)}}function nl(e,t,n){if(t&&typeof e==`string`){let t=e.trim();return t===`true`?!0:t===`false`?!1:kc(e,n)}else if(ec(e))return e;else return``}function rl(e,t,n){let r=Number.parseInt(e,t);return r>=0&&r<=1114111?String.fromCodePoint(r):n+e+`;`}function il(e,t,n,r){if(e){let r=e(t);n===t&&(n=r),t=r}return t=al(t,r),{tagName:t,tagExp:n}}function al(e,t){if(nc.includes(e))throw Error(`[SECURITY] Invalid name: "${e}" is a reserved JavaScript keyword that could cause prototype pollution`);return tc.includes(e)?t.onDangerousProperty(e):e}let ol=Sc.getMetaDataSymbol();function sl(e,t){if(!e||typeof e!=`object`)return{};if(!t)return e;let n={};for(let r in e)if(r.startsWith(t)){let i=r.substring(t.length);n[i]=e[r]}else n[r]=e[r];return n}function cl(e,t,n,r){return ll(e,t,n,r)}function ll(e,t,n,r){let i,a={};for(let o=0;o<e.length;o++){let s=e[o],c=ul(s);if(c!==void 0&&c!==t.textNodeName){let e=sl(s[`:@`]||{},t.attributeNamePrefix);n.push(c,e)}if(c===t.textNodeName)i===void 0?i=s[c]:i+=``+s[c];else if(c===void 0)continue;else if(s[c]){let e=ll(s[c],t,n,r),i=fl(e,t);if(s[`:@`]?dl(e,s[`:@`],r,t):Object.keys(e).length===1&&e[t.textNodeName]!==void 0&&!t.alwaysCreateTextNode?e=e[t.textNodeName]:Object.keys(e).length===0&&(t.alwaysCreateTextNode?e[t.textNodeName]=``:e=``),s[ol]!==void 0&&typeof e==`object`&&e&&(e[ol]=s[ol]),a[c]!==void 0&&Object.prototype.hasOwnProperty.call(a,c))Array.isArray(a[c])||(a[c]=[a[c]]),a[c].push(e);else{let n=t.jPath?r.toString():r;t.isArray(c,n,i)?a[c]=[e]:a[c]=e}c!==void 0&&c!==t.textNodeName&&n.pop()}}return typeof i==`string`?i.length>0&&(a[t.textNodeName]=i):i!==void 0&&(a[t.textNodeName]=i),a}function ul(e){let t=Object.keys(e);for(let e=0;e<t.length;e++){let n=t[e];if(n!==`:@`)return n}}function dl(e,t,n,r){if(t){let i=Object.keys(t),a=i.length;for(let o=0;o<a;o++){let a=i[o],s=a.startsWith(r.attributeNamePrefix)?a.substring(r.attributeNamePrefix.length):a,c=r.jPath?n.toString()+`.`+s:n;r.isArray(a,c,!0,!0)?e[a]=[t[a]]:e[a]=t[a]}}}function fl(e,t){let{textNodeName:n}=t,r=Object.keys(e).length;return!!(r===0||r===1&&(e[n]||typeof e[n]==`boolean`||e[n]===0))}var pl=class{constructor(e){this.externalEntities={},this.options=bc(e)}parse(e,t){if(typeof e!=`string`&&e.toString)e=e.toString();else if(typeof e!=`string`)throw Error(`XML data is accepted in String or Bytes[] form.`);if(t){t===!0&&(t={});let n=ic(e,t);if(n!==!0)throw Error(`${n.err.msg}:${n.err.line}:${n.err.col}`)}let n=new Vc(this.options);n.addExternalEntities(this.externalEntities);let r=n.parseXml(e);return this.options.preserveOrder||r===void 0?r:cl(r,this.options,n.matcher,n.readonlyMatcher)}addEntity(e,t){if(t.indexOf(`&`)!==-1)throw Error(`Entity value can't have '&'`);if(e.indexOf(`&`)!==-1||e.indexOf(`;`)!==-1)throw Error(`An entity must be set without '&' and ';'. Eg. use '#xD' for '
'`);if(t===`&`)throw Error(`An entity with value '&' is not permitted`);this.externalEntities[e]=t}static getMetaDataSymbol(){return Sc.getMetaDataSymbol()}};function ml(e,t){let n=``;t.format&&t.indentBy.length>0&&(n=`
|
|
12
|
-
`);let r=[];if(t.stopNodes&&Array.isArray(t.stopNodes))for(let e=0;e<t.stopNodes.length;e++){let n=t.stopNodes[e];typeof n==`string`?r.push(new Ic(n)):n instanceof Ic&&r.push(n)}let i=new Rc;return hl(e,t,n,i,r)}function hl(e,t,n,r,i){let a=``,o=!1;if(t.maxNestedTags&&r.getDepth()>t.maxNestedTags)throw Error(`Maximum nested tags exceeded`);if(!Array.isArray(e)){if(e!=null){let n=e.toString();return n=Sl(n,t),n}return``}for(let s=0;s<e.length;s++){let c=e[s],l=yl(c);if(l===void 0)continue;let u=gl(c[`:@`],t);r.push(l,u);let d=xl(r,i);if(l===t.textNodeName){let e=c[l];d||(e=t.tagValueProcessor(l,e),e=Sl(e,t)),o&&(a+=n),a+=e,o=!1,r.pop();continue}else if(l===t.cdataPropName){o&&(a+=n),a+=`<![CDATA[${c[l][0][t.textNodeName]}]]>`,o=!1,r.pop();continue}else if(l===t.commentPropName){a+=n+`<!--${c[l][0][t.textNodeName]}-->`,o=!0,r.pop();continue}else if(l[0]===`?`){let e=bl(c[`:@`],t,d),i=l===`?xml`?``:n,s=c[l][0][t.textNodeName];s=s.length===0?``:` `+s,a+=i+`<${l}${s}${e}?>`,o=!0,r.pop();continue}let f=n;f!==``&&(f+=t.indentBy);let p=n+`<${l}${bl(c[`:@`],t,d)}`,m;m=d?_l(c[l],t):hl(c[l],t,f,r,i),t.unpairedTags.indexOf(l)===-1?(!m||m.length===0)&&t.suppressEmptyNode?a+=p+`/>`:m&&m.endsWith(`>`)?a+=p+`>${m}${n}</${l}>`:(a+=p+`>`,m&&n!==``&&(m.includes(`/>`)||m.includes(`</`))?a+=n+t.indentBy+m+n:a+=m,a+=`</${l}>`):t.suppressUnpairedNode?a+=p+`>`:a+=p+`/>`,o=!0,r.pop()}return a}function gl(e,t){if(!e||t.ignoreAttributes)return null;let n={},r=!1;for(let i in e){if(!Object.prototype.hasOwnProperty.call(e,i))continue;let a=i.startsWith(t.attributeNamePrefix)?i.substr(t.attributeNamePrefix.length):i;n[a]=e[i],r=!0}return r?n:null}function _l(e,t){if(!Array.isArray(e))return e==null?``:e.toString();let n=``;for(let r=0;r<e.length;r++){let i=e[r],a=yl(i);if(a===t.textNodeName)n+=i[a];else if(a===t.cdataPropName)n+=i[a][0][t.textNodeName];else if(a===t.commentPropName)n+=i[a][0][t.textNodeName];else if(a&&a[0]===`?`)continue;else if(a){let e=vl(i[`:@`],t),r=_l(i[a],t);!r||r.length===0?n+=`<${a}${e}/>`:n+=`<${a}${e}>${r}</${a}>`}}return n}function vl(e,t){let n=``;if(e&&!t.ignoreAttributes)for(let r in e){if(!Object.prototype.hasOwnProperty.call(e,r))continue;let i=e[r];i===!0&&t.suppressBooleanAttributes?n+=` ${r.substr(t.attributeNamePrefix.length)}`:n+=` ${r.substr(t.attributeNamePrefix.length)}="${i}"`}return n}function yl(e){let t=Object.keys(e);for(let n=0;n<t.length;n++){let r=t[n];if(Object.prototype.hasOwnProperty.call(e,r)&&r!==`:@`)return r}}function bl(e,t,n){let r=``;if(e&&!t.ignoreAttributes)for(let i in e){if(!Object.prototype.hasOwnProperty.call(e,i))continue;let a;n?a=e[i]:(a=t.attributeValueProcessor(i,e[i]),a=Sl(a,t)),a===!0&&t.suppressBooleanAttributes?r+=` ${i.substr(t.attributeNamePrefix.length)}`:r+=` ${i.substr(t.attributeNamePrefix.length)}="${a}"`}return r}function xl(e,t){if(!t||t.length===0)return!1;for(let n=0;n<t.length;n++)if(e.matches(t[n]))return!0;return!1}function Sl(e,t){if(e&&e.length>0&&t.processEntities)for(let n=0;n<t.entities.length;n++){let r=t.entities[n];e=e.replace(r.regex,r.val)}return e}function Cl(e){return typeof e==`function`?e:Array.isArray(e)?t=>{for(let n of e)if(typeof n==`string`&&t===n||n instanceof RegExp&&n.test(t))return!0}:()=>!1}let wl={attributeNamePrefix:`@_`,attributesGroupName:!1,textNodeName:`#text`,ignoreAttributes:!0,cdataPropName:!1,format:!1,indentBy:` `,suppressEmptyNode:!1,suppressUnpairedNode:!0,suppressBooleanAttributes:!0,tagValueProcessor:function(e,t){return t},attributeValueProcessor:function(e,t){return t},preserveOrder:!1,commentPropName:!1,unpairedTags:[],entities:[{regex:RegExp(`&`,`g`),val:`&`},{regex:RegExp(`>`,`g`),val:`>`},{regex:RegExp(`<`,`g`),val:`<`},{regex:RegExp(`'`,`g`),val:`'`},{regex:RegExp(`"`,`g`),val:`"`}],processEntities:!0,stopNodes:[],oneListGroup:!1,maxNestedTags:100,jPath:!0};function R(e){if(this.options=Object.assign({},wl,e),this.options.stopNodes&&Array.isArray(this.options.stopNodes)&&(this.options.stopNodes=this.options.stopNodes.map(e=>typeof e==`string`&&e.startsWith(`*.`)?`..`+e.substring(2):e)),this.stopNodeExpressions=[],this.options.stopNodes&&Array.isArray(this.options.stopNodes))for(let e=0;e<this.options.stopNodes.length;e++){let t=this.options.stopNodes[e];typeof t==`string`?this.stopNodeExpressions.push(new Ic(t)):t instanceof Ic&&this.stopNodeExpressions.push(t)}this.options.ignoreAttributes===!0||this.options.attributesGroupName?this.isAttribute=function(){return!1}:(this.ignoreAttributesFn=Cl(this.options.ignoreAttributes),this.attrPrefixLen=this.options.attributeNamePrefix.length,this.isAttribute=Dl),this.processTextOrObjNode=Tl,this.options.format?(this.indentate=El,this.tagEndChar=`>
|
|
13
|
-
`,this.newLine=`
|
|
14
|
-
`):(this.indentate=function(){return``},this.tagEndChar=`>`,this.newLine=``)}R.prototype.build=function(e){if(this.options.preserveOrder)return ml(e,this.options);{Array.isArray(e)&&this.options.arrayNodeName&&this.options.arrayNodeName.length>1&&(e={[this.options.arrayNodeName]:e});let t=new Rc;return this.j2x(e,0,t).val}},R.prototype.j2x=function(e,t,n){let r=``,i=``;if(this.options.maxNestedTags&&n.getDepth()>=this.options.maxNestedTags)throw Error(`Maximum nested tags exceeded`);let a=this.options.jPath?n.toString():n,o=this.checkStopNode(n);for(let s in e)if(Object.prototype.hasOwnProperty.call(e,s))if(e[s]===void 0)this.isAttribute(s)&&(i+=``);else if(e[s]===null)this.isAttribute(s)||s===this.options.cdataPropName?i+=``:s[0]===`?`?i+=this.indentate(t)+`<`+s+`?`+this.tagEndChar:i+=this.indentate(t)+`<`+s+`/`+this.tagEndChar;else if(e[s]instanceof Date)i+=this.buildTextValNode(e[s],s,``,t,n);else if(typeof e[s]!=`object`){let c=this.isAttribute(s);if(c&&!this.ignoreAttributesFn(c,a))r+=this.buildAttrPairStr(c,``+e[s],o);else if(!c)if(s===this.options.textNodeName){let t=this.options.tagValueProcessor(s,``+e[s]);i+=this.replaceEntitiesValue(t)}else{n.push(s);let r=this.checkStopNode(n);if(n.pop(),r){let n=``+e[s];n===``?i+=this.indentate(t)+`<`+s+this.closeTag(s)+this.tagEndChar:i+=this.indentate(t)+`<`+s+`>`+n+`</`+s+this.tagEndChar}else i+=this.buildTextValNode(e[s],s,``,t,n)}}else if(Array.isArray(e[s])){let r=e[s].length,a=``,o=``;for(let c=0;c<r;c++){let r=e[s][c];if(r!==void 0)if(r===null)s[0]===`?`?i+=this.indentate(t)+`<`+s+`?`+this.tagEndChar:i+=this.indentate(t)+`<`+s+`/`+this.tagEndChar;else if(typeof r==`object`)if(this.options.oneListGroup){n.push(s);let e=this.j2x(r,t+1,n);n.pop(),a+=e.val,this.options.attributesGroupName&&r.hasOwnProperty(this.options.attributesGroupName)&&(o+=e.attrStr)}else a+=this.processTextOrObjNode(r,s,t,n);else if(this.options.oneListGroup){let e=this.options.tagValueProcessor(s,r);e=this.replaceEntitiesValue(e),a+=e}else{n.push(s);let e=this.checkStopNode(n);if(n.pop(),e){let e=``+r;e===``?a+=this.indentate(t)+`<`+s+this.closeTag(s)+this.tagEndChar:a+=this.indentate(t)+`<`+s+`>`+e+`</`+s+this.tagEndChar}else a+=this.buildTextValNode(r,s,``,t,n)}}this.options.oneListGroup&&(a=this.buildObjectNode(a,s,o,t)),i+=a}else if(this.options.attributesGroupName&&s===this.options.attributesGroupName){let t=Object.keys(e[s]),n=t.length;for(let i=0;i<n;i++)r+=this.buildAttrPairStr(t[i],``+e[s][t[i]],o)}else i+=this.processTextOrObjNode(e[s],s,t,n);return{attrStr:r,val:i}},R.prototype.buildAttrPairStr=function(e,t,n){return n||(t=this.options.attributeValueProcessor(e,``+t),t=this.replaceEntitiesValue(t)),this.options.suppressBooleanAttributes&&t===`true`?` `+e:` `+e+`="`+t+`"`};function Tl(e,t,n,r){let i=this.extractAttributes(e);if(r.push(t,i),this.checkStopNode(r)){let i=this.buildRawContent(e),a=this.buildAttributesForStopNode(e);return r.pop(),this.buildObjectNode(i,t,a,n)}let a=this.j2x(e,n+1,r);return r.pop(),e[this.options.textNodeName]!==void 0&&Object.keys(e).length===1?this.buildTextValNode(e[this.options.textNodeName],t,a.attrStr,n,r):this.buildObjectNode(a.val,t,a.attrStr,n)}R.prototype.extractAttributes=function(e){if(!e||typeof e!=`object`)return null;let t={},n=!1;if(this.options.attributesGroupName&&e[this.options.attributesGroupName]){let r=e[this.options.attributesGroupName];for(let e in r){if(!Object.prototype.hasOwnProperty.call(r,e))continue;let i=e.startsWith(this.options.attributeNamePrefix)?e.substring(this.options.attributeNamePrefix.length):e;t[i]=r[e],n=!0}}else for(let r in e){if(!Object.prototype.hasOwnProperty.call(e,r))continue;let i=this.isAttribute(r);i&&(t[i]=e[r],n=!0)}return n?t:null},R.prototype.buildRawContent=function(e){if(typeof e==`string`)return e;if(typeof e!=`object`||!e)return String(e);if(e[this.options.textNodeName]!==void 0)return e[this.options.textNodeName];let t=``;for(let n in e){if(!Object.prototype.hasOwnProperty.call(e,n)||this.isAttribute(n)||this.options.attributesGroupName&&n===this.options.attributesGroupName)continue;let r=e[n];if(n===this.options.textNodeName)t+=r;else if(Array.isArray(r)){for(let e of r)if(typeof e==`string`||typeof e==`number`)t+=`<${n}>${e}</${n}>`;else if(typeof e==`object`&&e){let r=this.buildRawContent(e),i=this.buildAttributesForStopNode(e);r===``?t+=`<${n}${i}/>`:t+=`<${n}${i}>${r}</${n}>`}}else if(typeof r==`object`&&r){let e=this.buildRawContent(r),i=this.buildAttributesForStopNode(r);e===``?t+=`<${n}${i}/>`:t+=`<${n}${i}>${e}</${n}>`}else t+=`<${n}>${r}</${n}>`}return t},R.prototype.buildAttributesForStopNode=function(e){if(!e||typeof e!=`object`)return``;let t=``;if(this.options.attributesGroupName&&e[this.options.attributesGroupName]){let n=e[this.options.attributesGroupName];for(let e in n){if(!Object.prototype.hasOwnProperty.call(n,e))continue;let r=e.startsWith(this.options.attributeNamePrefix)?e.substring(this.options.attributeNamePrefix.length):e,i=n[e];i===!0&&this.options.suppressBooleanAttributes?t+=` `+r:t+=` `+r+`="`+i+`"`}}else for(let n in e){if(!Object.prototype.hasOwnProperty.call(e,n))continue;let r=this.isAttribute(n);if(r){let i=e[n];i===!0&&this.options.suppressBooleanAttributes?t+=` `+r:t+=` `+r+`="`+i+`"`}}return t},R.prototype.buildObjectNode=function(e,t,n,r){if(e===``)return t[0]===`?`?this.indentate(r)+`<`+t+n+`?`+this.tagEndChar:this.indentate(r)+`<`+t+n+this.closeTag(t)+this.tagEndChar;{let i=`</`+t+this.tagEndChar,a=``;return t[0]===`?`&&(a=`?`,i=``),(n||n===``)&&e.indexOf(`<`)===-1?this.indentate(r)+`<`+t+n+a+`>`+e+i:this.options.commentPropName!==!1&&t===this.options.commentPropName&&a.length===0?this.indentate(r)+`<!--${e}-->`+this.newLine:this.indentate(r)+`<`+t+n+a+this.tagEndChar+e+this.indentate(r)+i}},R.prototype.closeTag=function(e){let t=``;return this.options.unpairedTags.indexOf(e)===-1?t=this.options.suppressEmptyNode?`/`:`></${e}`:this.options.suppressUnpairedNode||(t=`/`),t},R.prototype.checkStopNode=function(e){if(!this.stopNodeExpressions||this.stopNodeExpressions.length===0)return!1;for(let t=0;t<this.stopNodeExpressions.length;t++)if(e.matches(this.stopNodeExpressions[t]))return!0;return!1},R.prototype.buildTextValNode=function(e,t,n,r,i){if(this.options.cdataPropName!==!1&&t===this.options.cdataPropName)return this.indentate(r)+`<![CDATA[${e}]]>`+this.newLine;if(this.options.commentPropName!==!1&&t===this.options.commentPropName)return this.indentate(r)+`<!--${e}-->`+this.newLine;if(t[0]===`?`)return this.indentate(r)+`<`+t+n+`?`+this.tagEndChar;{let i=this.options.tagValueProcessor(t,e);return i=this.replaceEntitiesValue(i),i===``?this.indentate(r)+`<`+t+n+this.closeTag(t)+this.tagEndChar:this.indentate(r)+`<`+t+n+`>`+i+`</`+t+this.tagEndChar}},R.prototype.replaceEntitiesValue=function(e){if(e&&e.length>0&&this.options.processEntities)for(let t=0;t<this.options.entities.length;t++){let n=this.options.entities[t];e=e.replace(n.regex,n.val)}return e};function El(e){return this.options.indentBy.repeat(e)}function Dl(e){return e.startsWith(this.options.attributeNamePrefix)&&e!==this.options.textNodeName?e.substr(this.attrPrefixLen):!1}var Ol=R,kl=class{axiosClient;baseURI;xmlParser;signingKey;ALGORITHM=`sha512`;TTL=1200;HASH_LENGTH=32;ITERATION_COUNT=1e4;constructor({axiosClient:e,baseURI:t}){this.axiosClient=e,this.baseURI=t,this.xmlParser=new pl}async signUrl(e,t){let n=new URL(e);n.searchParams.set(`OC-Credential`,t),n.searchParams.set(`OC-Date`,new Date().toISOString()),n.searchParams.set(`OC-Expires`,this.TTL.toString()),n.searchParams.set(`OC-Verb`,`GET`);let r=await this.createHashedKey(n.toString());return n.searchParams.set(`OC-Algo`,`PBKDF2/${this.ITERATION_COUNT}-SHA512`),n.searchParams.set(`OC-Signature`,r),n.toString()}async getSignKey(){if(this.signingKey)return this.signingKey;let e=await this.axiosClient.get(A(this.baseURI,`ocs/v1.php/cloud/user/signing-key`),{headers:{"Content-Type":`application/x-www-form-urlencoded`}});return this.signingKey=this.xmlParser.parse(e.data).ocs.data[`signing-key`],this.signingKey}async createHashedKey(e){return Ys(e,await this.getSignKey(),this.ITERATION_COUNT,this.HASH_LENGTH,this.ALGORITHM).toString(`hex`)}};let Al=(e,t)=>{let n=new URL(e);n.pathname=[...n.pathname.split(`/`),`ocs`,`v1.php`].filter(Boolean).join(`/`);let r=n.href,i=is(r,t),a=new kl({baseURI:e,axiosClient:t});return{getCapabilities:()=>i.getCapabilities(),signUrl:(e,t)=>a.signUrl(e,t)}},jl=(e,{fileId:t,path:n,name:r})=>{if(n!==void 0)return A(e.webDavPath,n);if(t!==void 0){if($o(e))throw Error(`public spaces need a path provided`);return A(`spaces`,t,r||``)}return e.webDavPath},Ml=(e,t)=>({copyFiles(t,{path:n,fileId:r},i,{path:a,parentFolderId:o,name:s},{overwrite:c,...l}={}){let u=jl(t,{fileId:r,path:n}),d=jl(i,{fileId:o,path:a,name:s});return e.copy(u,d,{overwrite:c||!1,...l})}}),Nl=(e,t,n)=>({async createFolder(n,{path:r,parentFolderId:i,folderName:a,fetchFolder:o=!0,...s}){let c=jl(n,{fileId:i,path:r,name:a});if(await e.mkcol(c),o)return t.getFileInfo(n,{path:r},s)}}),Pl=(e,{axiosClient:t})=>({async getFileContents(n,{fileId:r,path:i},{responseType:a=`text`,noCache:o=!0,headers:s,...c}={}){try{let l=jl(n,{fileId:r,path:i}),u=await t.get(e.getFileUrl(l),{responseType:a,headers:{...o&&{"Cache-Control":`no-cache`},...s||{}},...c});return{response:u,body:u.data,headers:{ETag:u.headers.etag,"OC-ETag":u.headers[`oc-etag`],"OC-FileId":u.headers[`oc-fileid`]}}}catch(e){let{message:t,response:n}=e;throw new Gn(t,n,n.status)}}}),Fl=(e,t)=>({async getFileInfo(t,n,r){return(await e.listFiles(t,n,{depth:0,...r})).resource}}),Il=(e,t,n,{axiosClient:r,baseUrl:i})=>({async getFileUrl(a,o,{disposition:s=`attachment`,version:c=null,username:l=``,...u}){if(s===`inline`){let e=await t.getFileContents(a,o,{responseType:`blob`,...u});return URL.createObjectURL(e.body)}if(c){if(!l)throw Error(`username is required for URL signing`);let t=e.getFileUrl(A(`meta`,o.fileId,`v`,c));return await Al(i,r).signUrl(t,l)}if(o.downloadURL)return o.downloadURL;let{downloadURL:d}=await n.getFileInfo(a,o,{davProperties:[M.DownloadURL]});return d},revokeUrl:e=>{e&&e.startsWith(`blob:`)&&URL.revokeObjectURL(e)}}),Ll=(e,t)=>({getPublicFileUrl(t,n){return e.getFileUrl(A(`public-files`,n))}}),Rl=(e,t,n)=>({async listFiles(n,{path:r,fileId:i}={},{depth:a=1,davProperties:o,isTrash:s=!1,...c}={}){let l;if($o(n)){l=await e.propfind(A(n.webDavPath,r),{depth:a,properties:o||tr.PublicLink,...c}),l.forEach(e=>{e.filename=e.filename.split(`/`).slice(1).join(`/`)}),l.length===1&&(l[0].filename=A(n.id,r,{leadingSlash:!0})),l.forEach(e=>{e.filename=e.filename.split(`/`).slice(2).join(`/`)});let t=n.driveAlias.startsWith(`ocm/`)?`ocm`:`public-link`;if((!r||r===`/`)&&a>0&&t===`ocm`&&l[0].props[M.PublicLinkItemType]===`file`&&(l=[{basename:n.fileId,type:`directory`,filename:``,props:{}},...l]),!r){let[r,...i]=l;return{resource:ns({...r,id:n.id,driveAlias:n.driveAlias,webDavPath:n.webDavPath,publicLinkType:t}),children:i.map(t=>Jo(t,e.extraProps))}}let i=l.map(t=>Jo(t,e.extraProps));return{resource:i[0],children:i.slice(1)}}let u=async()=>{let e=await t.getPathForFileId(i);return this.listFiles(n,{path:e},{depth:a,davProperties:o})};try{let t=``;if(t=s?ts(n.id):jl(n,{fileId:i,path:r}),l=await e.propfind(t,{depth:a,properties:o||tr.Default,...c}),s)return{resource:Jo(l[0],e.extraProps),children:l.slice(1).map(Yo)};let d=l.map(t=>Jo(t,e.extraProps)),f=i===n.id;return i&&!f&&d[0].fileId&&i!==d[0].fileId?u():{resource:d[0],children:d.slice(1)}}catch(e){if(e.statusCode===404&&i)return u();throw e}}}),zl=(e,t)=>({moveFiles(t,{path:n,fileId:r},i,{path:a,parentFolderId:o,name:s},{overwrite:c,...l}={}){let u=jl(t,{fileId:r,path:n}),d=jl(i,{fileId:o,path:a,name:s});return e.move(u,d,{overwrite:c||!1,...l})}}),Bl=(e,t,n)=>({async putFileContents(n,{fileName:r,path:i,parentFolderId:a,content:o=``,previousEntityTag:s=``,overwrite:c,onUploadProgress:l=null,...u}){let d=jl(n,{fileId:a,name:r,path:i}),{result:f}=await e.put(d,o,{previousEntityTag:s,overwrite:c,onUploadProgress:l,...u});return t.getFileInfo(n,{fileId:f.headers.get(`Oc-Fileid`),path:i})}}),Vl=(e,t)=>({deleteFile(t,{path:n,...r}){return e.delete(A(t.webDavPath,n),r)}}),Hl=(e,t)=>({restoreFile(t,{id:n},{path:r},{overwrite:i,...a}={}){if($o(t))return;let o=A(t.webDavPath,r);return e.move(A(t.webDavTrashPath,n),o,{overwrite:i,...a})}}),Ul=(e,t)=>({restoreFileVersion(t,{parentFolderId:n,name:r,path:i},a,o={}){let s=jl(t,{path:i,fileId:n,name:r}),c=A(`meta`,n,`v`,a,{leadingSlash:!0}),l=A(`files`,s,{leadingSlash:!0});return e.copy(c,l,o)}}),Wl=(e,t)=>({clearTrashBin(t,{id:n,...r}={}){let i=ts(t.id);return n&&(i=A(i,n)),e.delete(i,r)}}),Gl=(e,t)=>({async search(t,{davProperties:n=tr.Default,searchLimit:r,...i}){let{range:a,results:o}=await e.report(`/spaces/`,{pattern:t,limit:r,properties:n,...i});return{resources:o.map(t=>({...Jo(t,e.extraProps),highlights:t.props[M.Highlights]||``})),totalResults:a?parseInt(a?.split(`/`)[1]):null}}}),Kl=(e,t)=>({async getPathForFileId(t,n={}){return(await e.propfind(A(`meta`,t,{leadingSlash:!0}),{properties:[M.MetaPathForUser],...n}))[0].props[M.MetaPathForUser]}});
|
|
15
|
-
/*! For license information please see index.js.LICENSE.txt */
|
|
16
|
-
var ql={2:e=>{function t(e,t,i){e instanceof RegExp&&(e=n(e,i)),t instanceof RegExp&&(t=n(t,i));var a=r(e,t,i);return a&&{start:a[0],end:a[1],pre:i.slice(0,a[0]),body:i.slice(a[0]+e.length,a[1]),post:i.slice(a[1]+t.length)}}function n(e,t){var n=t.match(e);return n?n[0]:null}function r(e,t,n){var r,i,a,o,s,c=n.indexOf(e),l=n.indexOf(t,c+1),u=c;if(c>=0&&l>0){for(r=[],a=n.length;u>=0&&!s;)u==c?(r.push(u),c=n.indexOf(e,u+1)):r.length==1?s=[r.pop(),l]:((i=r.pop())<a&&(a=i,o=l),l=n.indexOf(t,u+1)),u=c<l&&c>=0?c:l;r.length&&(s=[a,o])}return s}e.exports=t,t.range=r},47:(e,t,n)=>{var r=n(410),i=function(e){return typeof e==`string`};function a(e,t){for(var n=[],r=0;r<e.length;r++){var i=e[r];i&&i!==`.`&&(i===`..`?n.length&&n[n.length-1]!==`..`?n.pop():t&&n.push(`..`):n.push(i))}return n}var o=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/,s={};function c(e){return o.exec(e).slice(1)}s.resolve=function(){for(var e=``,t=!1,n=arguments.length-1;n>=-1&&!t;n--){var r=n>=0?arguments[n]:process.cwd();if(!i(r))throw TypeError(`Arguments to path.resolve must be strings`);r&&(e=r+`/`+e,t=r.charAt(0)===`/`)}return(t?`/`:``)+(e=a(e.split(`/`),!t).join(`/`))||`.`},s.normalize=function(e){var t=s.isAbsolute(e),n=e.substr(-1)===`/`;return(e=a(e.split(`/`),!t).join(`/`))||t||(e=`.`),e&&n&&(e+=`/`),(t?`/`:``)+e},s.isAbsolute=function(e){return e.charAt(0)===`/`},s.join=function(){for(var e=``,t=0;t<arguments.length;t++){var n=arguments[t];if(!i(n))throw TypeError(`Arguments to path.join must be strings`);n&&(e+=e?`/`+n:n)}return s.normalize(e)},s.relative=function(e,t){function n(e){for(var t=0;t<e.length&&e[t]===``;t++);for(var n=e.length-1;n>=0&&e[n]===``;n--);return t>n?[]:e.slice(t,n+1)}e=s.resolve(e).substr(1),t=s.resolve(t).substr(1);for(var r=n(e.split(`/`)),i=n(t.split(`/`)),a=Math.min(r.length,i.length),o=a,c=0;c<a;c++)if(r[c]!==i[c]){o=c;break}var l=[];for(c=o;c<r.length;c++)l.push(`..`);return(l=l.concat(i.slice(o))).join(`/`)},s._makeLong=function(e){return e},s.dirname=function(e){var t=c(e),n=t[0],r=t[1];return n||r?(r&&=r.substr(0,r.length-1),n+r):`.`},s.basename=function(e,t){var n=c(e)[2];return t&&n.substr(-1*t.length)===t&&(n=n.substr(0,n.length-t.length)),n},s.extname=function(e){return c(e)[3]},s.format=function(e){if(!r.isObject(e))throw TypeError(`Parameter 'pathObject' must be an object, not `+typeof e);if(!i(e.root||``))throw TypeError(`'pathObject.root' must be a string or undefined, not `+typeof e.root);return(e.dir?e.dir+s.sep:``)+(e.base||``)},s.parse=function(e){if(!i(e))throw TypeError(`Parameter 'pathString' must be a string, not `+typeof e);var t=c(e);if(!t||t.length!==4)throw TypeError(`Invalid path '`+e+`'`);return t[1]=t[1]||``,t[2]=t[2]||``,t[3]=t[3]||``,{root:t[0],dir:t[0]+t[1].slice(0,t[1].length-1),base:t[2],ext:t[3],name:t[2].slice(0,t[2].length-t[3].length)}},s.sep=`/`,s.delimiter=`:`,e.exports=s},101:function(e,t,n){var r;e=n.nmd(e),function(){var i=(e&&e.exports,typeof global==`object`&&global);i.global!==i&&i.window;var a=function(e){this.message=e};(a.prototype=Error()).name=`InvalidCharacterError`;var o=function(e){throw new a(e)},s=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/`,c=/[\t\n\f\r ]/g,l={encode:function(e){e=String(e),/[^\0-\xFF]/.test(e)&&o(`The string to be encoded contains characters outside of the Latin1 range.`);for(var t,n,r,i,a=e.length%3,c=``,l=-1,u=e.length-a;++l<u;)t=e.charCodeAt(l)<<16,n=e.charCodeAt(++l)<<8,r=e.charCodeAt(++l),c+=s.charAt((i=t+n+r)>>18&63)+s.charAt(i>>12&63)+s.charAt(i>>6&63)+s.charAt(63&i);return a==2?(t=e.charCodeAt(l)<<8,n=e.charCodeAt(++l),c+=s.charAt((i=t+n)>>10)+s.charAt(i>>4&63)+s.charAt(i<<2&63)+`=`):a==1&&(i=e.charCodeAt(l),c+=s.charAt(i>>2)+s.charAt(i<<4&63)+`==`),c},decode:function(e){var t=(e=String(e).replace(c,``)).length;t%4==0&&(t=(e=e.replace(/==?$/,``)).length),(t%4==1||/[^+a-zA-Z0-9/]/.test(e))&&o(`Invalid character: the string to be decoded is not correctly encoded.`);for(var n,r,i=0,a=``,l=-1;++l<t;)r=s.indexOf(e.charAt(l)),n=i%4?64*n+r:r,i++%4&&(a+=String.fromCharCode(255&n>>(-2*i&6)));return a},version:`1.0.0`};(r=function(){return l}.call(t,n,t,e))===void 0||(e.exports=r)}()},135:e=>{function t(e){return!!e.constructor&&typeof e.constructor.isBuffer==`function`&&e.constructor.isBuffer(e)}e.exports=function(e){return e!=null&&(t(e)||function(e){return typeof e.readFloatLE==`function`&&typeof e.slice==`function`&&t(e.slice(0,0))}(e)||!!e._isBuffer)}},172:(e,t)=>{t.d=function(e){if(!e)return 0;for(var t=(e=e.toString()).length,n=e.length;n--;){var r=e.charCodeAt(n);56320<=r&&r<=57343&&n--,127<r&&r<=2047?t++:2047<r&&r<=65535&&(t+=2)}return t}},285:(e,t,n)=>{var r=n(2);e.exports=function(e){return e?(e.substr(0,2)===`{}`&&(e=`\\{\\}`+e.substr(2)),g(function(e){return e.split(`\\\\`).join(i).split(`\\{`).join(a).split(`\\}`).join(o).split(`\\,`).join(s).split(`\\.`).join(c)}(e),!0).map(u)):[]};var i=`\0SLASH`+Math.random()+`\0`,a=`\0OPEN`+Math.random()+`\0`,o=`\0CLOSE`+Math.random()+`\0`,s=`\0COMMA`+Math.random()+`\0`,c=`\0PERIOD`+Math.random()+`\0`;function l(e){return parseInt(e,10)==e?parseInt(e,10):e.charCodeAt(0)}function u(e){return e.split(i).join(`\\`).split(a).join(`{`).split(o).join(`}`).split(s).join(`,`).split(c).join(`.`)}function d(e){if(!e)return[``];var t=[],n=r(`{`,`}`,e);if(!n)return e.split(`,`);var i=n.pre,a=n.body,o=n.post,s=i.split(`,`);s[s.length-1]+=`{`+a+`}`;var c=d(o);return o.length&&(s[s.length-1]+=c.shift(),s.push.apply(s,c)),t.push.apply(t,s),t}function f(e){return`{`+e+`}`}function p(e){return/^-?0\d/.test(e)}function m(e,t){return e<=t}function h(e,t){return e>=t}function g(e,t){var n=[],i=r(`{`,`}`,e);if(!i)return[e];var a=i.pre,s=i.post.length?g(i.post,!1):[``];if(/\$$/.test(i.pre))for(var c=0;c<s.length;c++){var u=a+`{`+i.body+`}`+s[c];n.push(u)}else{var _,v,y=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(i.body),ee=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(i.body),b=y||ee,x=i.body.indexOf(`,`)>=0;if(!b&&!x)return i.post.match(/,(?!,).*\}/)?g(e=i.pre+`{`+i.body+o+i.post):[e];if(b)_=i.body.split(/\.\./);else if((_=d(i.body)).length===1&&(_=g(_[0],!1).map(f)).length===1)return s.map((function(e){return i.pre+_[0]+e}));if(b){var S=l(_[0]),C=l(_[1]),te=Math.max(_[0].length,_[1].length),ne=_.length==3?Math.abs(l(_[2])):1,re=m;C<S&&(ne*=-1,re=h);var ie=_.some(p);v=[];for(var ae=S;re(ae,C);ae+=ne){var oe;if(ee)(oe=String.fromCharCode(ae))===`\\`&&(oe=``);else if(oe=String(ae),ie){var se=te-oe.length;if(se>0){var w=Array(se+1).join(`0`);oe=ae<0?`-`+w+oe.slice(1):w+oe}}v.push(oe)}}else{v=[];for(var ce=0;ce<_.length;ce++)v.push.apply(v,g(_[ce],!1))}for(ce=0;ce<v.length;ce++)for(c=0;c<s.length;c++)u=a+v[ce]+s[c],(!t||b||u)&&n.push(u)}return n}},298:e=>{var t=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/`,n={rotl:function(e,t){return e<<t|e>>>32-t},rotr:function(e,t){return e<<32-t|e>>>t},endian:function(e){if(e.constructor==Number)return 16711935&n.rotl(e,8)|4278255360&n.rotl(e,24);for(var t=0;t<e.length;t++)e[t]=n.endian(e[t]);return e},randomBytes:function(e){for(var t=[];e>0;e--)t.push(Math.floor(256*Math.random()));return t},bytesToWords:function(e){for(var t=[],n=0,r=0;n<e.length;n++,r+=8)t[r>>>5]|=e[n]<<24-r%32;return t},wordsToBytes:function(e){for(var t=[],n=0;n<32*e.length;n+=8)t.push(e[n>>>5]>>>24-n%32&255);return t},bytesToHex:function(e){for(var t=[],n=0;n<e.length;n++)t.push((e[n]>>>4).toString(16)),t.push((15&e[n]).toString(16));return t.join(``)},hexToBytes:function(e){for(var t=[],n=0;n<e.length;n+=2)t.push(parseInt(e.substr(n,2),16));return t},bytesToBase64:function(e){for(var n=[],r=0;r<e.length;r+=3)for(var i=e[r]<<16|e[r+1]<<8|e[r+2],a=0;a<4;a++)8*r+6*a<=8*e.length?n.push(t.charAt(i>>>6*(3-a)&63)):n.push(`=`);return n.join(``)},base64ToBytes:function(e){e=e.replace(/[^A-Z0-9+\/]/gi,``);for(var n=[],r=0,i=0;r<e.length;i=++r%4)i!=0&&n.push((t.indexOf(e.charAt(r-1))&2**(-2*i+8)-1)<<2*i|t.indexOf(e.charAt(r))>>>6-2*i);return n}};e.exports=n},345:()=>{},388:()=>{},410:()=>{},526:e=>{var t={utf8:{stringToBytes:function(e){return t.bin.stringToBytes(unescape(encodeURIComponent(e)))},bytesToString:function(e){return decodeURIComponent(escape(t.bin.bytesToString(e)))}},bin:{stringToBytes:function(e){for(var t=[],n=0;n<e.length;n++)t.push(255&e.charCodeAt(n));return t},bytesToString:function(e){for(var t=[],n=0;n<e.length;n++)t.push(String.fromCharCode(e[n]));return t.join(``)}}};e.exports=t},542:(e,t,n)=>{(function(){var t=n(298),r=n(526).utf8,i=n(135),a=n(526).bin,o=function(e,n){e.constructor==String?e=n&&n.encoding===`binary`?a.stringToBytes(e):r.stringToBytes(e):i(e)?e=Array.prototype.slice.call(e,0):Array.isArray(e)||e.constructor===Uint8Array||(e=e.toString());for(var s=t.bytesToWords(e),c=8*e.length,l=1732584193,u=-271733879,d=-1732584194,f=271733878,p=0;p<s.length;p++)s[p]=16711935&(s[p]<<8|s[p]>>>24)|4278255360&(s[p]<<24|s[p]>>>8);s[c>>>5]|=128<<c%32,s[14+(c+64>>>9<<4)]=c;var m=o._ff,h=o._gg,g=o._hh,_=o._ii;for(p=0;p<s.length;p+=16){var v=l,y=u,ee=d,b=f;l=m(l,u,d,f,s[p+0],7,-680876936),f=m(f,l,u,d,s[p+1],12,-389564586),d=m(d,f,l,u,s[p+2],17,606105819),u=m(u,d,f,l,s[p+3],22,-1044525330),l=m(l,u,d,f,s[p+4],7,-176418897),f=m(f,l,u,d,s[p+5],12,1200080426),d=m(d,f,l,u,s[p+6],17,-1473231341),u=m(u,d,f,l,s[p+7],22,-45705983),l=m(l,u,d,f,s[p+8],7,1770035416),f=m(f,l,u,d,s[p+9],12,-1958414417),d=m(d,f,l,u,s[p+10],17,-42063),u=m(u,d,f,l,s[p+11],22,-1990404162),l=m(l,u,d,f,s[p+12],7,1804603682),f=m(f,l,u,d,s[p+13],12,-40341101),d=m(d,f,l,u,s[p+14],17,-1502002290),l=h(l,u=m(u,d,f,l,s[p+15],22,1236535329),d,f,s[p+1],5,-165796510),f=h(f,l,u,d,s[p+6],9,-1069501632),d=h(d,f,l,u,s[p+11],14,643717713),u=h(u,d,f,l,s[p+0],20,-373897302),l=h(l,u,d,f,s[p+5],5,-701558691),f=h(f,l,u,d,s[p+10],9,38016083),d=h(d,f,l,u,s[p+15],14,-660478335),u=h(u,d,f,l,s[p+4],20,-405537848),l=h(l,u,d,f,s[p+9],5,568446438),f=h(f,l,u,d,s[p+14],9,-1019803690),d=h(d,f,l,u,s[p+3],14,-187363961),u=h(u,d,f,l,s[p+8],20,1163531501),l=h(l,u,d,f,s[p+13],5,-1444681467),f=h(f,l,u,d,s[p+2],9,-51403784),d=h(d,f,l,u,s[p+7],14,1735328473),l=g(l,u=h(u,d,f,l,s[p+12],20,-1926607734),d,f,s[p+5],4,-378558),f=g(f,l,u,d,s[p+8],11,-2022574463),d=g(d,f,l,u,s[p+11],16,1839030562),u=g(u,d,f,l,s[p+14],23,-35309556),l=g(l,u,d,f,s[p+1],4,-1530992060),f=g(f,l,u,d,s[p+4],11,1272893353),d=g(d,f,l,u,s[p+7],16,-155497632),u=g(u,d,f,l,s[p+10],23,-1094730640),l=g(l,u,d,f,s[p+13],4,681279174),f=g(f,l,u,d,s[p+0],11,-358537222),d=g(d,f,l,u,s[p+3],16,-722521979),u=g(u,d,f,l,s[p+6],23,76029189),l=g(l,u,d,f,s[p+9],4,-640364487),f=g(f,l,u,d,s[p+12],11,-421815835),d=g(d,f,l,u,s[p+15],16,530742520),l=_(l,u=g(u,d,f,l,s[p+2],23,-995338651),d,f,s[p+0],6,-198630844),f=_(f,l,u,d,s[p+7],10,1126891415),d=_(d,f,l,u,s[p+14],15,-1416354905),u=_(u,d,f,l,s[p+5],21,-57434055),l=_(l,u,d,f,s[p+12],6,1700485571),f=_(f,l,u,d,s[p+3],10,-1894986606),d=_(d,f,l,u,s[p+10],15,-1051523),u=_(u,d,f,l,s[p+1],21,-2054922799),l=_(l,u,d,f,s[p+8],6,1873313359),f=_(f,l,u,d,s[p+15],10,-30611744),d=_(d,f,l,u,s[p+6],15,-1560198380),u=_(u,d,f,l,s[p+13],21,1309151649),l=_(l,u,d,f,s[p+4],6,-145523070),f=_(f,l,u,d,s[p+11],10,-1120210379),d=_(d,f,l,u,s[p+2],15,718787259),u=_(u,d,f,l,s[p+9],21,-343485551),l=l+v>>>0,u=u+y>>>0,d=d+ee>>>0,f=f+b>>>0}return t.endian([l,u,d,f])};o._ff=function(e,t,n,r,i,a,o){var s=e+(t&n|~t&r)+(i>>>0)+o;return(s<<a|s>>>32-a)+t},o._gg=function(e,t,n,r,i,a,o){var s=e+(t&r|n&~r)+(i>>>0)+o;return(s<<a|s>>>32-a)+t},o._hh=function(e,t,n,r,i,a,o){var s=e+(t^n^r)+(i>>>0)+o;return(s<<a|s>>>32-a)+t},o._ii=function(e,t,n,r,i,a,o){var s=e+(n^(t|~r))+(i>>>0)+o;return(s<<a|s>>>32-a)+t},o._blocksize=16,o._digestsize=16,e.exports=function(e,n){if(e==null)throw Error(`Illegal argument `+e);var r=t.wordsToBytes(o(e,n));return n&&n.asBytes?r:n&&n.asString?a.bytesToString(r):t.bytesToHex(r)}})()},647:(e,t)=>{var n=Object.prototype.hasOwnProperty;function r(e){try{return decodeURIComponent(e.replace(/\+/g,` `))}catch{return null}}function i(e){try{return encodeURIComponent(e)}catch{return null}}t.stringify=function(e,t){t||=``;var r,a,o=[];for(a in typeof t!=`string`&&(t=`?`),e)if(n.call(e,a)){if((r=e[a])||r!=null&&!isNaN(r)||(r=``),a=i(a),r=i(r),a===null||r===null)continue;o.push(a+`=`+r)}return o.length?t+o.join(`&`):``},t.parse=function(e){for(var t,n=/([^=?#&]+)=?([^&]*)/g,i={};t=n.exec(e);){var a=r(t[1]),o=r(t[2]);a===null||o===null||a in i||(i[a]=o)}return i}},670:e=>{e.exports=function(e,t){if(t=t.split(`:`)[0],!(e=+e))return!1;switch(t){case`http`:case`ws`:return e!==80;case`https`:case`wss`:return e!==443;case`ftp`:return e!==21;case`gopher`:return e!==70;case`file`:return!1}return e!==0}},737:(e,t,n)=>{var r=n(670),i=n(647),a=/^[\x00-\x20\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]+/,o=/[\n\r\t]/g,s=/^[A-Za-z][A-Za-z0-9+-.]*:\/\//,c=/:\d+$/,l=/^([a-z][a-z0-9.+-]*:)?(\/\/)?([\\/]+)?([\S\s]*)/i,u=/^[a-zA-Z]:/;function d(e){return(e||``).toString().replace(a,``)}var f=[[`#`,`hash`],[`?`,`query`],function(e,t){return h(t.protocol)?e.replace(/\\/g,`/`):e},[`/`,`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 m(e){var t,n=(typeof window<`u`?window:typeof global<`u`?global:typeof self<`u`?self:{}).location||{},r={},i=typeof(e||=n);if(e.protocol===`blob:`)r=new _(unescape(e.pathname),{});else if(i===`string`)for(t in r=new _(e,{}),p)delete r[t];else if(i===`object`){for(t in e)t in p||(r[t]=e[t]);r.slashes===void 0&&(r.slashes=s.test(e.href))}return r}function h(e){return e===`file:`||e===`ftp:`||e===`http:`||e===`https:`||e===`ws:`||e===`wss:`}function g(e,t){e=(e=d(e)).replace(o,``),t||={};var n,r=l.exec(e),i=r[1]?r[1].toLowerCase():``,a=!!r[2],s=!!r[3],c=0;return a?s?(n=r[2]+r[3]+r[4],c=r[2].length+r[3].length):(n=r[2]+r[4],c=r[2].length):s?(n=r[3]+r[4],c=r[3].length):n=r[4],i===`file:`?c>=2&&(n=n.slice(2)):h(i)?n=r[4]:i?a&&(n=n.slice(2)):c>=2&&h(t.protocol)&&(n=r[4]),{protocol:i,slashes:a||h(i),slashesCount:c,rest:n}}function _(e,t,n){if(e=(e=d(e)).replace(o,``),!(this instanceof _))return new _(e,t,n);var a,s,c,l,p,v,y=f.slice(),ee=typeof t,b=this,x=0;for(ee!==`object`&&ee!==`string`&&(n=t,t=null),n&&typeof n!=`function`&&(n=i.parse),a=!(s=g(e||``,t=m(t))).protocol&&!s.slashes,b.slashes=s.slashes||a&&t.slashes,b.protocol=s.protocol||t.protocol||``,e=s.rest,(s.protocol===`file:`&&(s.slashesCount!==2||u.test(e))||!s.slashes&&(s.protocol||s.slashesCount<2||!h(b.protocol)))&&(y[3]=[/(.*)/,`pathname`]);x<y.length;x++)typeof(l=y[x])==`function`?e=l(e,b):(c=l[0],v=l[1],c==c?typeof c==`string`?~(p=c===`@`?e.lastIndexOf(c):e.indexOf(c))&&(typeof l[2]==`number`?(b[v]=e.slice(0,p),e=e.slice(p+l[2])):(b[v]=e.slice(p),e=e.slice(0,p))):(p=c.exec(e))&&(b[v]=p[1],e=e.slice(0,p.index)):b[v]=e,b[v]=b[v]||a&&l[3]&&t[v]||``,l[4]&&(b[v]=b[v].toLowerCase()));n&&(b.query=n(b.query)),a&&t.slashes&&b.pathname.charAt(0)!==`/`&&(b.pathname!==``||t.pathname!==``)&&(b.pathname=function(e,t){if(e===``)return t;for(var n=(t||`/`).split(`/`).slice(0,-1).concat(e.split(`/`)),r=n.length,i=n[r-1],a=!1,o=0;r--;)n[r]===`.`?n.splice(r,1):n[r]===`..`?(n.splice(r,1),o++):o&&(r===0&&(a=!0),n.splice(r,1),o--);return a&&n.unshift(``),i!==`.`&&i!==`..`||n.push(``),n.join(`/`)}(b.pathname,t.pathname)),b.pathname.charAt(0)!==`/`&&h(b.protocol)&&(b.pathname=`/`+b.pathname),r(b.port,b.protocol)||(b.host=b.hostname,b.port=``),b.username=b.password=``,b.auth&&=(~(p=b.auth.indexOf(`:`))?(b.username=b.auth.slice(0,p),b.username=encodeURIComponent(decodeURIComponent(b.username)),b.password=b.auth.slice(p+1),b.password=encodeURIComponent(decodeURIComponent(b.password))):b.username=encodeURIComponent(decodeURIComponent(b.auth)),b.password?b.username+`:`+b.password:b.username),b.origin=b.protocol!==`file:`&&h(b.protocol)&&b.host?b.protocol+`//`+b.host:`null`,b.href=b.toString()}_.prototype={set:function(e,t,n){var a=this;switch(e){case`query`:typeof t==`string`&&t.length&&(t=(n||i.parse)(t)),a[e]=t;break;case`port`:a[e]=t,r(t,a.protocol)?t&&(a.host=a.hostname+`:`+t):(a.host=a.hostname,a[e]=``);break;case`hostname`:a[e]=t,a.port&&(t+=`:`+a.port),a.host=t;break;case`host`:a[e]=t,c.test(t)?(t=t.split(`:`),a.port=t.pop(),a.hostname=t.join(`:`)):(a.hostname=t,a.port=``);break;case`protocol`:a.protocol=t.toLowerCase(),a.slashes=!n;break;case`pathname`:case`hash`:if(t){var o=e===`pathname`?`/`:`#`;a[e]=t.charAt(0)===o?t:o+t}else a[e]=t;break;case`username`:case`password`:a[e]=encodeURIComponent(t);break;case`auth`:var s=t.indexOf(`:`);~s?(a.username=t.slice(0,s),a.username=encodeURIComponent(decodeURIComponent(a.username)),a.password=t.slice(s+1),a.password=encodeURIComponent(decodeURIComponent(a.password))):a.username=encodeURIComponent(decodeURIComponent(t))}for(var l=0;l<f.length;l++){var u=f[l];u[4]&&(a[u[1]]=a[u[1]].toLowerCase())}return a.auth=a.password?a.username+`:`+a.password:a.username,a.origin=a.protocol!==`file:`&&h(a.protocol)&&a.host?a.protocol+`//`+a.host:`null`,a.href=a.toString(),a},toString:function(e){e&&typeof e==`function`||(e=i.stringify);var t,n=this,r=n.host,a=n.protocol;a&&a.charAt(a.length-1)!==`:`&&(a+=`:`);var o=a+(n.protocol&&n.slashes||h(n.protocol)?`//`:``);return n.username?(o+=n.username,n.password&&(o+=`:`+n.password),o+=`@`):n.password?(o+=`:`+n.password,o+=`@`):n.protocol!==`file:`&&h(n.protocol)&&!r&&n.pathname!==`/`&&(o+=`@`),(r[r.length-1]===`:`||c.test(n.hostname)&&!n.port)&&(r+=`:`),o+=r+n.pathname,(t=typeof n.query==`object`?e(n.query):n.query)&&(o+=t.charAt(0)===`?`?t:`?`+t),n.hash&&(o+=n.hash),o}},_.extractProtocol=g,_.location=m,_.trimLeft=d,_.qs=i,e.exports=_},800:()=>{},805:()=>{},829:e=>{function t(e){return t=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},t(e)}function n(e){var t=typeof Map==`function`?new Map:void 0;return n=function(e){if(e===null||(n=e,Function.toString.call(n).indexOf(`[native code]`)===-1))return e;var n;if(typeof e!=`function`)throw TypeError(`Super expression must either be null or a function`);if(t!==void 0){if(t.has(e))return t.get(e);t.set(e,o)}function o(){return r(e,arguments,a(this).constructor)}return o.prototype=Object.create(e.prototype,{constructor:{value:o,enumerable:!1,writable:!0,configurable:!0}}),i(o,e)},n(e)}function r(e,t,n){return r=function(){if(typeof Reflect>`u`||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy==`function`)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch{return!1}}()?Reflect.construct:function(e,t,n){var r=[null];r.push.apply(r,t);var a=new(Function.bind.apply(e,r));return n&&i(a,n.prototype),a},r.apply(null,arguments)}function i(e,t){return i=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},i(e,t)}function a(e){return a=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},a(e)}var o=function(e){function n(e){var r;return function(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}(this,n),(r=function(e,n){return!n||t(n)!==`object`&&typeof n!=`function`?function(e){if(e===void 0)throw ReferenceError(`this hasn't been initialised - super() hasn't been called`);return e}(e):n}(this,a(n).call(this,e))).name=`ObjectPrototypeMutationError`,r}return function(e,t){if(typeof t!=`function`&&t!==null)throw TypeError(`Super expression must either be null or a function`);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&i(e,t)}(n,e),n}(n(Error));function s(e,n){for(var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:function(){},i=n.split(`.`),a=i.length,o=function(t){var n=i[t];if(!e)return{v:void 0};if(n===`+`){if(Array.isArray(e))return{v:e.map((function(n,a){var o=i.slice(t+1);return o.length>0?s(n,o.join(`.`),r):r(e,a,i,t)}))};var a=i.slice(0,t).join(`.`);throw Error(`Object at wildcard (${a}) is not an array`)}e=r(e,n,i,t)},c=0;c<a;c++){var l=o(c);if(t(l)===`object`)return l.v}return e}function c(e,t){return e.length===t+1}e.exports={set:function(e,n,r){if(t(e)!=`object`||e===null||n===void 0)return e;if(typeof n==`number`)return e[n]=r,e[n];try{return s(e,n,(function(e,t,n,i){if(e===Reflect.getPrototypeOf({}))throw new o(`Attempting to mutate Object.prototype`);if(!e[t]){var a=Number.isInteger(Number(n[i+1])),s=n[i+1]===`+`;e[t]=a||s?[]:{}}return c(n,i)&&(e[t]=r),e[t]}))}catch(t){if(t instanceof o)throw t;return e}},get:function(e,n){if(t(e)!=`object`||e===null||n===void 0)return e;if(typeof n==`number`)return e[n];try{return s(e,n,(function(e,t){return e[t]}))}catch{return e}},has:function(e,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(t(e)!=`object`||e===null||n===void 0)return!1;if(typeof n==`number`)return n in e;try{var i=!1;return s(e,n,(function(e,t,n,a){if(!c(n,a))return e&&e[t];i=r.own?e.hasOwnProperty(t):t in e})),i}catch{return!1}},hasOwn:function(e,t,n){return this.has(e,t,n||{own:!0})},isIn:function(e,n,r){var i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};if(t(e)!=`object`||e===null||n===void 0)return!1;try{var a=!1,o=!1;return s(e,n,(function(e,n,i,s){return a=a||e===r||!!e&&e[n]===r,o=c(i,s)&&t(e)===`object`&&n in e,e&&e[n]})),i.validPath?a&&o:a}catch{return!1}},ObjectPrototypeMutationError:o}}},Jl={};function z(e){var t=Jl[e];if(t!==void 0)return t.exports;var n=Jl[e]={id:e,loaded:!1,exports:{}};return ql[e].call(n.exports,n,n.exports,z),n.loaded=!0,n.exports}z.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return z.d(t,{a:t}),t},z.d=(e,t)=>{for(var n in t)z.o(t,n)&&!z.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},z.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),z.nmd=e=>(e.paths=[],e.children||=[],e);var Yl=z(737),Xl=z.n(Yl);function Zl(e){if(!Ql(e))throw Error(`Parameter was not an error`)}function Ql(e){return!!e&&typeof e==`object`&&(t=e,Object.prototype.toString.call(t))===`[object Error]`||e instanceof Error;var t}var $l=class e extends Error{constructor(e,t){let{options:n,shortMessage:r}=function(e){let t,n=``;if(e.length===0)t={};else if(Ql(e[0]))t={cause:e[0]},n=e.slice(1).join(` `)||``;else if(e[0]&&typeof e[0]==`object`)t=Object.assign({},e[0]),n=e.slice(1).join(` `)||``;else{if(typeof e[0]!=`string`)throw Error(`Invalid arguments passed to Layerr`);t={},n=n=e.join(` `)||``}return{options:t,shortMessage:n}}([...arguments]),i=r;if(n.cause&&(i=`${i}: ${n.cause.message}`),super(i),this.message=i,n.name&&typeof n.name==`string`?this.name=n.name:this.name=`Layerr`,n.cause&&Object.defineProperty(this,`_cause`,{value:n.cause}),Object.defineProperty(this,`_info`,{value:{}}),n.info&&typeof n.info==`object`&&Object.assign(this._info,n.info),Error.captureStackTrace){let e=n.constructorOpt||this.constructor;Error.captureStackTrace(this,e)}}static cause(e){return Zl(e),e._cause&&Ql(e._cause)?e._cause:null}static fullStack(t){Zl(t);let n=e.cause(t);return n?`${t.stack}\ncaused by: ${e.fullStack(n)}`:t.stack??``}static info(t){Zl(t);let n={},r=e.cause(t);return r&&Object.assign(n,e.info(r)),t._info&&Object.assign(n,t._info),n}toString(){let e=this.name||this.constructor.name||this.constructor.prototype.name;return this.message&&(e=`${e}: ${this.message}`),e}},eu=z(47),tu=z.n(eu);let nu=`__PATH_SEPARATOR_POSIX__`,ru=`__PATH_SEPARATOR_WINDOWS__`;function B(e){try{let t=e.replace(/\//g,nu).replace(/\\\\/g,ru);return encodeURIComponent(t).split(ru).join(`\\\\`).split(nu).join(`/`)}catch(e){throw new $l(e,`Failed encoding path`)}}function iu(e){return e.startsWith(`/`)?e:`/`+e}function au(e){let t=e;return t[0]!==`/`&&(t=`/`+t),/^.+\/$/.test(t)&&(t=t.substr(0,t.length-1)),t}function ou(e){let t=new(Xl())(e).pathname;return t.length<=0&&(t=`/`),au(t)}function V(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(){return function(e){var t=[];if(e.length===0)return``;if(typeof e[0]!=`string`)throw TypeError(`Url must be a string. Received `+e[0]);e[0].match(/^[^/:]+:\/*$/)&&e.length>1&&(e[0]=e.shift()+e[0]),e[0].match(/^file:\/\/\//)?e[0]=e[0].replace(/^([^/:]+):\/*/,`$1:///`):e[0]=e[0].replace(/^([^/:]+):\/*/,`$1://`);for(var n=0;n<e.length;n++){var r=e[n];if(typeof r!=`string`)throw TypeError(`Url must be a string. Received `+r);r!==``&&(n>0&&(r=r.replace(/^[\/]+/,``)),r=n<e.length-1?r.replace(/[\/]+$/,``):r.replace(/[\/]+$/,`/`),t.push(r))}var i=t.join(`/`),a=(i=i.replace(/\/(\?|&|#[^!])/g,`$1`)).split(`?`);return a.shift()+(a.length>0?`?`:``)+a.join(`&`)}(typeof arguments[0]==`object`?arguments[0]:[].slice.call(arguments))}(t.reduce(((e,t,n)=>((n===0||t!==`/`||t===`/`&&e[e.length-1]!==`/`)&&e.push(t),e)),[]))}var su=z(542),cu=z.n(su);function lu(e,t){let n=e.url.replace(`//`,``),r=n.indexOf(`/`)==-1?`/`:n.slice(n.indexOf(`/`)),i=e.method?e.method.toUpperCase():`GET`,a=!!/(^|,)\s*auth\s*($|,)/.test(t.qop)&&`auth`,o=`00000000${t.nc}`.slice(-8),s=function(e,t,n,r,i,a,o){let s=o||cu()(`${t}:${n}:${r}`);return e&&e.toLowerCase()===`md5-sess`?cu()(`${s}:${i}:${a}`):s}(t.algorithm,t.username,t.realm,t.password,t.nonce,t.cnonce,t.ha1),c=cu()(`${i}:${r}`),l=a?cu()(`${s}:${t.nonce}:${o}:${t.cnonce}:${a}:${c}`):cu()(`${s}:${t.nonce}:${c}`),u={username:t.username,realm:t.realm,nonce:t.nonce,uri:r,qop:a,response:l,nc:o,cnonce:t.cnonce,algorithm:t.algorithm,opaque:t.opaque},d=[];for(let e in u)u[e]&&(e===`qop`||e===`nc`||e===`algorithm`?d.push(`${e}=${u[e]}`):d.push(`${e}="${u[e]}"`));return`Digest ${d.join(`, `)}`}function uu(e){return(e.headers&&e.headers.get(`www-authenticate`)||``).split(/\s/)[0].toLowerCase()===`digest`}var du=z(101),fu=z.n(du);function pu(e){return fu().decode(e)}function mu(e,t){var n;return`Basic ${n=`${e}:${t}`,fu().encode(n)}`}let hu=typeof WorkerGlobalScope<`u`&&self instanceof WorkerGlobalScope?self:typeof window<`u`?window:globalThis,gu=hu.fetch.bind(hu);hu.Headers,hu.Request,hu.Response;let H=function(e){return e.Auto=`auto`,e.Digest=`digest`,e.None=`none`,e.Password=`password`,e.Token=`token`,e}({}),_u=function(e){return e.DataTypeNoLength=`data-type-no-length`,e.InvalidAuthType=`invalid-auth-type`,e.InvalidOutputFormat=`invalid-output-format`,e.LinkUnsupportedAuthType=`link-unsupported-auth`,e.InvalidUpdateRange=`invalid-update-range`,e.NotSupported=`not-supported`,e}({});function vu(e,t,n,r,i){switch(e.authType){case H.Auto:t&&n&&(e.headers.Authorization=mu(t,n));break;case H.Digest:e.digest=function(e,t,n){return{username:e,password:t,ha1:n,nc:0,algorithm:`md5`,hasDigestAuth:!1}}(t,n,i);break;case H.None:break;case H.Password:e.headers.Authorization=mu(t,n);break;case H.Token:e.headers.Authorization=`${(a=r).token_type} ${a.access_token}`;break;default:throw new $l({info:{code:_u.InvalidAuthType}},`Invalid auth type: ${e.authType}`)}var a}z(345),z(800);let yu=`@@HOTPATCHER`,bu=()=>{};function xu(e){return{original:e,methods:[e],final:!1}}var Su=class{constructor(){this._configuration={registry:{},getEmptyAction:`null`},this.__type__=yu}get configuration(){return this._configuration}get getEmptyAction(){return this.configuration.getEmptyAction}set getEmptyAction(e){this.configuration.getEmptyAction=e}control(e){let t=arguments.length>1&&arguments[1]!==void 0&&arguments[1];if(!e||e.__type__!==yu)throw Error(`Failed taking control of target HotPatcher instance: Invalid type or object`);return Object.keys(e.configuration.registry).forEach((n=>{this.configuration.registry.hasOwnProperty(n)?t&&(this.configuration.registry[n]=Object.assign({},e.configuration.registry[n])):this.configuration.registry[n]=Object.assign({},e.configuration.registry[n])})),e._configuration=this.configuration,this}execute(e){return(this.get(e)||bu)(...[...arguments].slice(1))}get(e){let t=this.configuration.registry[e];if(!t)switch(this.getEmptyAction){case`null`:return null;case`throw`:throw Error(`Failed handling method request: No method provided for override: ${e}`);default:throw Error(`Failed handling request which resulted in an empty method: Invalid empty-action specified: ${this.getEmptyAction}`)}return function(){var e=[...arguments];if(e.length===0)throw Error(`Failed creating sequence: No functions provided`);return function(){let t=[...arguments],n=this;for(;e.length>0;)t=[e.shift().apply(n,t)];return t[0]}}(...t.methods)}isPatched(e){return!!this.configuration.registry[e]}patch(e,t){let{chain:n=!1}=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(this.configuration.registry[e]&&this.configuration.registry[e].final)throw Error(`Failed patching '${e}': Method marked as being final`);if(typeof t!=`function`)throw Error(`Failed patching '${e}': Provided method is not a function`);if(n)this.configuration.registry[e]?this.configuration.registry[e].methods.push(t):this.configuration.registry[e]=xu(t);else if(this.isPatched(e)){let{original:n}=this.configuration.registry[e];this.configuration.registry[e]=Object.assign(xu(t),{original:n})}else this.configuration.registry[e]=xu(t);return this}patchInline(e,t){this.isPatched(e)||this.patch(e,t);var n=[...arguments].slice(2);return this.execute(e,...n)}plugin(e){return[...arguments].slice(1).forEach((t=>{this.patch(e,t,{chain:!0})})),this}restore(e){if(!this.isPatched(e))throw Error(`Failed restoring method: No method present for key: ${e}`);if(typeof this.configuration.registry[e].original!=`function`)throw Error(`Failed restoring method: Original method not found or of invalid type for key: ${e}`);return this.configuration.registry[e].methods=[this.configuration.registry[e].original],this}setFinal(e){if(!this.configuration.registry.hasOwnProperty(e))throw Error(`Failed marking '${e}' as final: No method found for key`);return this.configuration.registry[e].final=!0,this}};let Cu=null;function wu(){return Cu||=new Su,Cu}function Tu(e){return function(e){if(typeof e!=`object`||!e||Object.prototype.toString.call(e)!=`[object Object]`)return!1;if(Object.getPrototypeOf(e)===null)return!0;let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}(e)?Object.assign({},e):Object.setPrototypeOf(Object.assign({},e),Object.getPrototypeOf(e))}function Eu(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];let r=null,i=[...t];for(;i.length>0;){let e=i.shift();r=r?Du(r,e):Tu(e)}return r}function Du(e,t){let n=Tu(e);return Object.keys(t).forEach((e=>{n.hasOwnProperty(e)?Array.isArray(t[e])?n[e]=Array.isArray(n[e])?[...n[e],...t[e]]:[...t[e]]:typeof t[e]==`object`&&t[e]?n[e]=typeof n[e]==`object`&&n[e]?Du(n[e],t[e]):Tu(t[e]):n[e]=t[e]:n[e]=t[e]})),n}function Ou(e){let t={};for(let n of e.keys())t[n]=e.get(n);return t}function ku(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];if(t.length===0)return{};let r={};return t.reduce(((e,t)=>(Object.keys(t).forEach((n=>{let i=n.toLowerCase();r.hasOwnProperty(i)?e[r[i]]=t[n]:(r[i]=n,e[n]=t[n])})),e)),{})}z(805);let Au=typeof ArrayBuffer==`function`,{toString:ju}=Object.prototype;function Mu(e){return Au&&(e instanceof ArrayBuffer||ju.call(e)===`[object ArrayBuffer]`)}function Nu(e){return e!=null&&e.constructor!=null&&typeof e.constructor.isBuffer==`function`&&e.constructor.isBuffer(e)}function Pu(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{return Promise.resolve(e.apply(this,t))}catch(e){return Promise.reject(e)}}}function Fu(e,t,n){return n?t?t(e):e:(e&&e.then||(e=Promise.resolve(e)),t?e.then(t):e)}let Iu=Pu((function(e){let t=e._digest;return delete e._digest,t.hasDigestAuth&&(e=Eu(e,{headers:{Authorization:lu(e,t)}})),Fu(Ru(e),(function(n){let r=!1;return i=function(e){return r?e:n},(a=function(){if(n.status==401)return t.hasDigestAuth=function(e,t){if(!uu(e))return!1;let n=/([a-z0-9_-]+)=(?:"([^"]+)"|([a-z0-9_-]+))/gi;for(;;){let r=e.headers&&e.headers.get(`www-authenticate`)||``,i=n.exec(r);if(!i)break;t[i[1]]=i[2]||i[3]}return t.nc+=1,t.cnonce=function(){let e=``;for(let t=0;t<32;++t)e=`${e}${`abcdef0123456789`[Math.floor(16*Math.random())]}`;return e}(),!0}(n,t),function(){if(t.hasDigestAuth)return Fu(Ru(e=Eu(e,{headers:{Authorization:lu(e,t)}})),(function(e){return e.status==401?t.hasDigestAuth=!1:t.nc++,r=!0,e}))}();t.nc++}())&&a.then?a.then(i):i(a);var i,a}))})),Lu=Pu((function(e,t){return Fu(Ru(e),(function(n){return n.ok?(t.authType=H.Password,n):n.status==401&&uu(n)?(t.authType=H.Digest,vu(t,t.username,t.password,void 0,void 0),e._digest=t.digest,Iu(e)):n}))})),U=Pu((function(e,t){return t.authType===H.Auto?Lu(e,t):e._digest?Iu(e):Ru(e)}));function W(e,t,n){let r=Tu(e);return r.headers=ku(t.headers,r.headers||{},n.headers||{}),n.data!==void 0&&(r.data=n.data),n.signal&&(r.signal=n.signal),t.httpAgent&&(r.httpAgent=t.httpAgent),t.httpsAgent&&(r.httpsAgent=t.httpsAgent),t.digest&&(r._digest=t.digest),typeof t.withCredentials==`boolean`&&(r.withCredentials=t.withCredentials),r}function Ru(e){let t=wu();return t.patchInline(`request`,(e=>t.patchInline(`fetch`,gu,e.url,function(e){let t={},n={method:e.method};if(e.headers&&(t=ku(t,e.headers)),e.data!==void 0){let[r,i]=function(e){if(typeof e==`string`||Nu(e)||Mu(e))return[e,{}];if(e&&typeof e==`object`)return[JSON.stringify(e),{"content-type":`application/json`}];throw Error(`Unable to convert request body: Unexpected body type: `+typeof e)}(e.data);n.body=r,t=ku(t,i)}return e.signal&&(n.signal=e.signal),e.withCredentials&&(n.credentials=`include`),n.headers=t,n}(e))),e)}var zu=z(285);let Bu=e=>{if(typeof e!=`string`)throw TypeError(`invalid pattern`);if(e.length>65536)throw TypeError(`pattern is too long`)},Vu={"[: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]},Hu=e=>e.replace(/[[\]\\-]/g,`\\$&`),Uu=e=>e.join(``),Wu=(e,t)=>{let n=t;if(e.charAt(n)!==`[`)throw Error(`not in a brace expression`);let r=[],i=[],a=n+1,o=!1,s=!1,c=!1,l=!1,u=n,d=``;t:for(;a<e.length;){let t=e.charAt(a);if(t!==`!`&&t!==`^`||a!==n+1){if(t===`]`&&o&&!c){u=a+1;break}if(o=!0,t!==`\\`||c){if(t===`[`&&!c){for(let[t,[o,c,l]]of Object.entries(Vu))if(e.startsWith(t,a)){if(d)return[`$.`,!1,e.length-n,!0];a+=t.length,l?i.push(o):r.push(o),s||=c;continue t}}c=!1,d?(t>d?r.push(Hu(d)+`-`+Hu(t)):t===d&&r.push(Hu(t)),d=``,a++):e.startsWith(`-]`,a+1)?(r.push(Hu(t+`-`)),a+=2):e.startsWith(`-`,a+1)?(d=t,a+=2):(r.push(Hu(t)),a++)}else c=!0,a++}else l=!0,a++}if(u<a)return[``,!1,0,!1];if(!r.length&&!i.length)return[`$.`,!1,e.length-n,!0];if(i.length===0&&r.length===1&&/^\\?.$/.test(r[0])&&!l)return[(f=r[0].length===2?r[0].slice(-1):r[0],f.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,`\\$&`)),!1,u-n,!1];var f;let p=`[`+(l?`^`:``)+Uu(r)+`]`,m=`[`+(l?``:`^`)+Uu(i)+`]`;return[r.length&&i.length?`(`+p+`|`+m+`)`:r.length?p:m,s,u-n,!0]},Gu=function(e){let{windowsPathsNoEscape:t=!1}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return t?e.replace(/\[([^\/\\])\]/g,`$1`):e.replace(/((?!\\).|^)\[([^\/\\])\]/g,`$1$2`).replace(/\\([^\/])/g,`$1`)},Ku=new Set([`!`,`?`,`+`,`*`,`@`]),qu=e=>Ku.has(e),Ju=`(?!\\.)`,Yu=new Set([`[`,`.`]),Xu=new Set([`..`,`.`]),Zu=new Set(`().*{}+?[]^$\\!`),Qu=`[^/]`,$u=Qu+`*?`,ed=Qu+`+?`;var td=class e{type;#e;#t;#n=!1;#r=[];#i;#a;#o;#s=!1;#c;#l;#u=!1;constructor(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.type=e,e&&(this.#t=!0),this.#i=t,this.#e=this.#i?this.#i.#e:this,this.#c=this.#e===this?n:this.#e.#c,this.#o=this.#e===this?[]:this.#e.#o,e!==`!`||this.#e.#s||this.#o.push(this),this.#a=this.#i?this.#i.#r.length:0}get hasMagic(){if(this.#t!==void 0)return this.#t;for(let e of this.#r)if(typeof e!=`string`&&(e.type||e.hasMagic))return this.#t=!0;return this.#t}toString(){return this.#l===void 0?this.type?this.#l=this.type+`(`+this.#r.map((e=>String(e))).join(`|`)+`)`:this.#l=this.#r.map((e=>String(e))).join(``):this.#l}#d(){if(this!==this.#e)throw Error(`should only call on root`);if(this.#s)return this;let e;for(this.toString(),this.#s=!0;e=this.#o.pop();){if(e.type!==`!`)continue;let t=e,n=t.#i;for(;n;){for(let r=t.#a+1;!n.type&&r<n.#r.length;r++)for(let t of e.#r){if(typeof t==`string`)throw Error(`string part in extglob AST??`);t.copyIn(n.#r[r])}t=n,n=t.#i}}return this}push(){var t=[...arguments];for(let n of t)if(n!==``){if(typeof n!=`string`&&!(n instanceof e&&n.#i===this))throw Error(`invalid part: `+n);this.#r.push(n)}}toJSON(){let e=this.type===null?this.#r.slice().map((e=>typeof e==`string`?e:e.toJSON())):[this.type,...this.#r.map((e=>e.toJSON()))];return this.isStart()&&!this.type&&e.unshift([]),this.isEnd()&&(this===this.#e||this.#e.#s&&this.#i?.type===`!`)&&e.push({}),e}isStart(){if(this.#e===this)return!0;if(!this.#i?.isStart())return!1;if(this.#a===0)return!0;let t=this.#i;for(let n=0;n<this.#a;n++){let r=t.#r[n];if(!(r instanceof e&&r.type===`!`))return!1}return!0}isEnd(){if(this.#e===this||this.#i?.type===`!`)return!0;if(!this.#i?.isEnd())return!1;if(!this.type)return this.#i?.isEnd();let e=this.#i?this.#i.#r.length:0;return this.#a===e-1}copyIn(e){typeof e==`string`?this.push(e):this.push(e.clone(this))}clone(t){let n=new e(this.type,t);for(let e of this.#r)n.copyIn(e);return n}static#f(t,n,r,i){let a=!1,o=!1,s=-1,c=!1;if(n.type===null){let l=r,u=``;for(;l<t.length;){let r=t.charAt(l++);if(a||r===`\\`)a=!a,u+=r;else if(o)l===s+1?r!==`^`&&r!==`!`||(c=!0):r!==`]`||l===s+2&&c||(o=!1),u+=r;else if(r!==`[`)if(i.noext||!qu(r)||t.charAt(l)!==`(`)u+=r;else{n.push(u),u=``;let a=new e(r,n);l=e.#f(t,a,l,i),n.push(a)}else o=!0,s=l,c=!1,u+=r}return n.push(u),l}let l=r+1,u=new e(null,n),d=[],f=``;for(;l<t.length;){let r=t.charAt(l++);if(a||r===`\\`)a=!a,f+=r;else if(o)l===s+1?r!==`^`&&r!==`!`||(c=!0):r!==`]`||l===s+2&&c||(o=!1),f+=r;else if(r!==`[`)if(qu(r)&&t.charAt(l)===`(`){u.push(f),f=``;let n=new e(r,u);u.push(n),l=e.#f(t,n,l,i)}else if(r!==`|`){if(r===`)`)return f===``&&n.#r.length===0&&(n.#u=!0),u.push(f),f=``,n.push(...d,u),l;f+=r}else u.push(f),f=``,d.push(u),u=new e(null,n);else o=!0,s=l,c=!1,f+=r}return n.type=null,n.#t=void 0,n.#r=[t.substring(r-1)],l}static fromGlob(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=new e(null,void 0,n);return e.#f(t,r,0,n),r}toMMPattern(){if(this!==this.#e)return this.#e.toMMPattern();let e=this.toString(),[t,n,r,i]=this.toRegExpSource();if(!(r||this.#t||this.#c.nocase&&!this.#c.nocaseMagicOnly&&e.toUpperCase()!==e.toLowerCase()))return n;let a=(this.#c.nocase?`i`:``)+(i?`u`:``);return Object.assign(RegExp(`^${t}$`,a),{_src:t,_glob:e})}get options(){return this.#c}toRegExpSource(t){let n=t??!!this.#c.dot;if(this.#e===this&&this.#d(),!this.type){let r=this.isStart()&&this.isEnd(),i=this.#r.map((n=>{let[i,a,o,s]=typeof n==`string`?e.#m(n,this.#t,r):n.toRegExpSource(t);return this.#t=this.#t||o,this.#n=this.#n||s,i})).join(``),a=``;if(this.isStart()&&typeof this.#r[0]==`string`&&(this.#r.length!==1||!Xu.has(this.#r[0]))){let e=Yu,r=n&&e.has(i.charAt(0))||i.startsWith(`\\.`)&&e.has(i.charAt(2))||i.startsWith(`\\.\\.`)&&e.has(i.charAt(4)),o=!n&&!t&&e.has(i.charAt(0));a=r?`(?!(?:^|/)\\.\\.?(?:$|/))`:o?Ju:``}let o=``;return this.isEnd()&&this.#e.#s&&this.#i?.type===`!`&&(o=`(?:$|\\/)`),[a+i+o,Gu(i),this.#t=!!this.#t,this.#n]}let r=this.type===`*`||this.type===`+`,i=this.type===`!`?`(?:(?!(?:`:`(?:`,a=this.#p(n);if(this.isStart()&&this.isEnd()&&!a&&this.type!==`!`){let e=this.toString();return this.#r=[e],this.type=null,this.#t=void 0,[e,Gu(this.toString()),!1,!1]}let o=!r||t||n?``:this.#p(!0);o===a&&(o=``),o&&(a=`(?:${a})(?:${o})*?`);let s=``;return s=this.type===`!`&&this.#u?(this.isStart()&&!n?Ju:``)+ed:i+a+(this.type===`!`?`))`+(!this.isStart()||n||t?``:Ju)+$u+`)`:this.type===`@`?`)`:this.type===`?`?`)?`:this.type===`+`&&o?`)`:this.type===`*`&&o?`)?`:`)${this.type}`),[s,Gu(a),this.#t=!!this.#t,this.#n]}#p(e){return this.#r.map((t=>{if(typeof t==`string`)throw Error(`string type in extglob ast??`);let[n,r,i,a]=t.toRegExpSource(e);return this.#n=this.#n||a,n})).filter((e=>!(this.isStart()&&this.isEnd()&&!e))).join(`|`)}static#m(e,t){let n=arguments.length>2&&arguments[2]!==void 0&&arguments[2],r=!1,i=``,a=!1;for(let o=0;o<e.length;o++){let s=e.charAt(o);if(r)r=!1,i+=(Zu.has(s)?`\\`:``)+s;else if(s!==`\\`){if(s===`[`){let[n,r,s,c]=Wu(e,o);if(s){i+=n,a||=r,o+=s-1,t||=c;continue}}s===`*`?(i+=n&&e===`*`?ed:$u,t=!0):s===`?`?(i+=Qu,t=!0):i+=s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,`\\$&`)}else o===e.length-1?i+=`\\\\`:r=!0}return[i,Gu(e),!!t,a]}};let G=function(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return Bu(t),!(!n.nocomment&&t.charAt(0)===`#`)&&new Td(t,n).match(e)},nd=/^\*+([^+@!?\*\[\(]*)$/,rd=e=>t=>!t.startsWith(`.`)&&t.endsWith(e),id=e=>t=>t.endsWith(e),ad=e=>(e=e.toLowerCase(),t=>!t.startsWith(`.`)&&t.toLowerCase().endsWith(e)),od=e=>(e=e.toLowerCase(),t=>t.toLowerCase().endsWith(e)),sd=/^\*+\.\*+$/,cd=e=>!e.startsWith(`.`)&&e.includes(`.`),ld=e=>e!==`.`&&e!==`..`&&e.includes(`.`),ud=/^\.\*+$/,dd=e=>e!==`.`&&e!==`..`&&e.startsWith(`.`),fd=/^\*+$/,pd=e=>e.length!==0&&!e.startsWith(`.`),md=e=>e.length!==0&&e!==`.`&&e!==`..`,hd=/^\?+([^+@!?\*\[\(]*)?$/,gd=e=>{let[t,n=``]=e,r=bd([t]);return n?(n=n.toLowerCase(),e=>r(e)&&e.toLowerCase().endsWith(n)):r},_d=e=>{let[t,n=``]=e,r=xd([t]);return n?(n=n.toLowerCase(),e=>r(e)&&e.toLowerCase().endsWith(n)):r},vd=e=>{let[t,n=``]=e,r=xd([t]);return n?e=>r(e)&&e.endsWith(n):r},yd=e=>{let[t,n=``]=e,r=bd([t]);return n?e=>r(e)&&e.endsWith(n):r},bd=e=>{let[t]=e,n=t.length;return e=>e.length===n&&!e.startsWith(`.`)},xd=e=>{let[t]=e,n=t.length;return e=>e.length===n&&e!==`.`&&e!==`..`},Sd=typeof process==`object`&&process?typeof process.env==`object`&&process.env&&process.env.__MINIMATCH_TESTING_PLATFORM__||process.platform:`posix`;G.sep=Sd===`win32`?`\\`:`/`;let K=Symbol(`globstar **`);G.GLOBSTAR=K,G.filter=function(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return n=>G(n,e,t)};let q=function(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return Object.assign({},e,t)};G.defaults=e=>{if(!e||typeof e!=`object`||!Object.keys(e).length)return G;let t=G;return Object.assign((function(n,r){return t(n,r,q(e,arguments.length>2&&arguments[2]!==void 0?arguments[2]:{}))}),{Minimatch:class extends t.Minimatch{constructor(t){super(t,q(e,arguments.length>1&&arguments[1]!==void 0?arguments[1]:{}))}static defaults(n){return t.defaults(q(e,n)).Minimatch}},AST:class extends t.AST{constructor(t,n){super(t,n,q(e,arguments.length>2&&arguments[2]!==void 0?arguments[2]:{}))}static fromGlob(n){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return t.AST.fromGlob(n,q(e,r))}},unescape:function(n){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return t.unescape(n,q(e,r))},escape:function(n){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return t.escape(n,q(e,r))},filter:function(n){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return t.filter(n,q(e,r))},defaults:n=>t.defaults(q(e,n)),makeRe:function(n){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return t.makeRe(n,q(e,r))},braceExpand:function(n){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return t.braceExpand(n,q(e,r))},match:function(n,r){let i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return t.match(n,r,q(e,i))},sep:t.sep,GLOBSTAR:K})};let Cd=function(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return Bu(e),t.nobrace||!/\{(?:(?!\{).)*\}/.test(e)?[e]:zu(e)};G.braceExpand=Cd,G.makeRe=function(e){return new Td(e,arguments.length>1&&arguments[1]!==void 0?arguments[1]:{}).makeRe()},G.match=function(e,t){let n=new Td(t,arguments.length>2&&arguments[2]!==void 0?arguments[2]:{});return e=e.filter((e=>n.match(e))),n.options.nonull&&!e.length&&e.push(t),e};let wd=/[?*]|[+@!]\(.*?\)|\[|\]/;var Td=class{options;set;pattern;windowsPathsNoEscape;nonegate;negate;comment;empty;preserveMultipleSlashes;partial;globSet;globParts;nocase;isWindows;platform;windowsNoMagicRoot;regexp;constructor(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};Bu(e),t||={},this.options=t,this.pattern=e,this.platform=t.platform||Sd,this.isWindows=this.platform===`win32`,this.windowsPathsNoEscape=!!t.windowsPathsNoEscape||!1===t.allowWindowsEscape,this.windowsPathsNoEscape&&(this.pattern=this.pattern.replace(/\\/g,`/`)),this.preserveMultipleSlashes=!!t.preserveMultipleSlashes,this.regexp=null,this.negate=!1,this.nonegate=!!t.nonegate,this.comment=!1,this.empty=!1,this.partial=!!t.partial,this.nocase=!!this.options.nocase,this.windowsNoMagicRoot=t.windowsNoMagicRoot===void 0?!(!this.isWindows||!this.nocase):t.windowsNoMagicRoot,this.globSet=[],this.globParts=[],this.set=[],this.make()}hasMagic(){if(this.options.magicalBraces&&this.set.length>1)return!0;for(let e of this.set)for(let t of e)if(typeof t!=`string`)return!0;return!1}debug(){}make(){let e=this.pattern,t=this.options;if(!t.nocomment&&e.charAt(0)===`#`)return void(this.comment=!0);if(!e)return void(this.empty=!0);this.parseNegate(),this.globSet=[...new Set(this.braceExpand())],t.debug&&(this.debug=function(){return console.error(...arguments)}),this.debug(this.pattern,this.globSet);let n=this.globSet.map((e=>this.slashSplit(e)));this.globParts=this.preprocess(n),this.debug(this.pattern,this.globParts);let r=this.globParts.map(((e,t,n)=>{if(this.isWindows&&this.windowsNoMagicRoot){let t=!(e[0]!==``||e[1]!==``||e[2]!==`?`&&wd.test(e[2])||wd.test(e[3])),n=/^[a-z]:/i.test(e[0]);if(t)return[...e.slice(0,4),...e.slice(4).map((e=>this.parse(e)))];if(n)return[e[0],...e.slice(1).map((e=>this.parse(e)))]}return e.map((e=>this.parse(e)))}));if(this.debug(this.pattern,r),this.set=r.filter((e=>e.indexOf(!1)===-1)),this.isWindows)for(let e=0;e<this.set.length;e++){let t=this.set[e];t[0]===``&&t[1]===``&&this.globParts[e][2]===`?`&&typeof t[3]==`string`&&/^[a-z]:$/i.test(t[3])&&(t[2]=`?`)}this.debug(this.pattern,this.set)}preprocess(e){if(this.options.noglobstar)for(let t=0;t<e.length;t++)for(let n=0;n<e[t].length;n++)e[t][n]===`**`&&(e[t][n]=`*`);let{optimizationLevel:t=1}=this.options;return t>=2?(e=this.firstPhasePreProcess(e),e=this.secondPhasePreProcess(e)):e=t>=1?this.levelOneOptimize(e):this.adjascentGlobstarOptimize(e),e}adjascentGlobstarOptimize(e){return e.map((e=>{let t=-1;for(;(t=e.indexOf(`**`,t+1))!==-1;){let n=t;for(;e[n+1]===`**`;)n++;n!==t&&e.splice(t,n-t)}return e}))}levelOneOptimize(e){return e.map((e=>(e=e.reduce(((e,t)=>{let n=e[e.length-1];return t===`**`&&n===`**`?e:t===`..`&&n&&n!==`..`&&n!==`.`&&n!==`**`?(e.pop(),e):(e.push(t),e)}),[])).length===0?[``]:e))}levelTwoFileOptimize(e){Array.isArray(e)||(e=this.slashSplit(e));let t=!1;do{if(t=!1,!this.preserveMultipleSlashes){for(let n=1;n<e.length-1;n++){let r=e[n];n===1&&r===``&&e[0]===``||r!==`.`&&r!==``||(t=!0,e.splice(n,1),n--)}e[0]!==`.`||e.length!==2||e[1]!==`.`&&e[1]!==``||(t=!0,e.pop())}let n=0;for(;(n=e.indexOf(`..`,n+1))!==-1;){let r=e[n-1];r&&r!==`.`&&r!==`..`&&r!==`**`&&(t=!0,e.splice(n-1,2),n-=2)}}while(t);return e.length===0?[``]:e}firstPhasePreProcess(e){let t=!1;do{t=!1;for(let n of e){let r=-1;for(;(r=n.indexOf(`**`,r+1))!==-1;){let i=r;for(;n[i+1]===`**`;)i++;i>r&&n.splice(r+1,i-r);let a=n[r+1],o=n[r+2],s=n[r+3];if(a!==`..`||!o||o===`.`||o===`..`||!s||s===`.`||s===`..`)continue;t=!0,n.splice(r,1);let c=n.slice(0);c[r]=`**`,e.push(c),r--}if(!this.preserveMultipleSlashes){for(let e=1;e<n.length-1;e++){let r=n[e];e===1&&r===``&&n[0]===``||r!==`.`&&r!==``||(t=!0,n.splice(e,1),e--)}n[0]!==`.`||n.length!==2||n[1]!==`.`&&n[1]!==``||(t=!0,n.pop())}let i=0;for(;(i=n.indexOf(`..`,i+1))!==-1;){let e=n[i-1];if(e&&e!==`.`&&e!==`..`&&e!==`**`){t=!0;let e=i===1&&n[i+1]===`**`?[`.`]:[];n.splice(i-1,2,...e),n.length===0&&n.push(``),i-=2}}}}while(t);return e}secondPhasePreProcess(e){for(let t=0;t<e.length-1;t++)for(let n=t+1;n<e.length;n++){let r=this.partsMatch(e[t],e[n],!this.preserveMultipleSlashes);if(r){e[t]=[],e[n]=r;break}}return e.filter((e=>e.length))}partsMatch(e,t){let n=arguments.length>2&&arguments[2]!==void 0&&arguments[2],r=0,i=0,a=[],o=``;for(;r<e.length&&i<t.length;)if(e[r]===t[i])a.push(o===`b`?t[i]:e[r]),r++,i++;else if(n&&e[r]===`**`&&t[i]===e[r+1])a.push(e[r]),r++;else if(n&&t[i]===`**`&&e[r]===t[i+1])a.push(t[i]),i++;else if(e[r]!==`*`||!t[i]||!this.options.dot&&t[i].startsWith(`.`)||t[i]===`**`){if(t[i]!==`*`||!e[r]||!this.options.dot&&e[r].startsWith(`.`)||e[r]===`**`||o===`a`)return!1;o=`b`,a.push(t[i]),r++,i++}else{if(o===`b`)return!1;o=`a`,a.push(e[r]),r++,i++}return e.length===t.length&&a}parseNegate(){if(this.nonegate)return;let e=this.pattern,t=!1,n=0;for(let r=0;r<e.length&&e.charAt(r)===`!`;r++)t=!t,n++;n&&(this.pattern=e.slice(n)),this.negate=t}matchOne(e,t){let n=arguments.length>2&&arguments[2]!==void 0&&arguments[2],r=this.options;if(this.isWindows){let n=typeof e[0]==`string`&&/^[a-z]:$/i.test(e[0]),r=!n&&e[0]===``&&e[1]===``&&e[2]===`?`&&/^[a-z]:$/i.test(e[3]),i=typeof t[0]==`string`&&/^[a-z]:$/i.test(t[0]),a=r?3:n?0:void 0,o=!i&&t[0]===``&&t[1]===``&&t[2]===`?`&&typeof t[3]==`string`&&/^[a-z]:$/i.test(t[3])?3:i?0:void 0;if(typeof a==`number`&&typeof o==`number`){let[n,r]=[e[a],t[o]];n.toLowerCase()===r.toLowerCase()&&(t[o]=n,o>a?t=t.slice(o):a>o&&(e=e.slice(a)))}}let{optimizationLevel:i=1}=this.options;i>=2&&(e=this.levelTwoFileOptimize(e)),this.debug(`matchOne`,this,{file:e,pattern:t}),this.debug(`matchOne`,e.length,t.length);for(var a=0,o=0,s=e.length,c=t.length;a<s&&o<c;a++,o++){this.debug(`matchOne loop`);var l=t[o],u=e[a];if(this.debug(t,l,u),!1===l)return!1;if(l===K){this.debug(`GLOBSTAR`,[t,l,u]);var d=a,f=o+1;if(f===c){for(this.debug(`** at the end`);a<s;a++)if(e[a]===`.`||e[a]===`..`||!r.dot&&e[a].charAt(0)===`.`)return!1;return!0}for(;d<s;){var p=e[d];if(this.debug(`
|
|
17
|
-
globstar while`,e,d,t,f,p),this.matchOne(e.slice(d),t.slice(f),n))return this.debug(`globstar found match!`,d,s,p),!0;if(p===`.`||p===`..`||!r.dot&&p.charAt(0)===`.`){this.debug(`dot detected!`,e,d,t,f);break}this.debug(`globstar swallow a segment, and continue`),d++}return!(!n||(this.debug(`
|
|
18
|
-
>>> no match, partial?`,e,d,t,f),d!==s))}let i;if(typeof l==`string`?(i=u===l,this.debug(`string match`,l,u,i)):(i=l.test(u),this.debug(`pattern match`,l,u,i)),!i)return!1}if(a===s&&o===c)return!0;if(a===s)return n;if(o===c)return a===s-1&&e[a]===``;throw Error(`wtf?`)}braceExpand(){return Cd(this.pattern,this.options)}parse(e){Bu(e);let t=this.options;if(e===`**`)return K;if(e===``)return``;let n,r=null;(n=e.match(fd))?r=t.dot?md:pd:(n=e.match(nd))?r=(t.nocase?t.dot?od:ad:t.dot?id:rd)(n[1]):(n=e.match(hd))?r=(t.nocase?t.dot?_d:gd:t.dot?vd:yd)(n):(n=e.match(sd))?r=t.dot?ld:cd:(n=e.match(ud))&&(r=dd);let i=td.fromGlob(e,this.options).toMMPattern();return r&&typeof i==`object`&&Reflect.defineProperty(i,`test`,{value:r}),i}makeRe(){if(this.regexp||!1===this.regexp)return this.regexp;let e=this.set;if(!e.length)return this.regexp=!1,this.regexp;let t=this.options,n=t.noglobstar?`[^/]*?`:t.dot?`(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?`:`(?:(?!(?:\\/|^)\\.).)*?`,r=new Set(t.nocase?[`i`]:[]),i=e.map((e=>{let t=e.map((e=>{if(e instanceof RegExp)for(let t of e.flags.split(``))r.add(t);return typeof e==`string`?e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,`\\$&`):e===K?K:e._src}));return t.forEach(((e,r)=>{let i=t[r+1],a=t[r-1];e===K&&a!==K&&(a===void 0?i!==void 0&&i!==K?t[r+1]=`(?:\\/|`+n+`\\/)?`+i:t[r]=n:i===void 0?t[r-1]=a+`(?:\\/|`+n+`)?`:i!==K&&(t[r-1]=a+`(?:\\/|\\/`+n+`\\/)`+i,t[r+1]=K))})),t.filter((e=>e!==K)).join(`/`)})).join(`|`),[a,o]=e.length>1?[`(?:`,`)`]:[``,``];i=`^`+a+i+o+`$`,this.negate&&(i=`^(?!`+i+`).+$`);try{this.regexp=new RegExp(i,[...r].join(``))}catch{this.regexp=!1}return this.regexp}slashSplit(e){return this.preserveMultipleSlashes?e.split(`/`):this.isWindows&&/^\/\/[^\/]+/.test(e)?[``,...e.split(/\/+/)]:e.split(/\/+/)}match(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.partial;if(this.debug(`match`,e,this.pattern),this.comment)return!1;if(this.empty)return e===``;if(e===`/`&&t)return!0;let n=this.options;this.isWindows&&(e=e.split(`\\`).join(`/`));let r=this.slashSplit(e);this.debug(this.pattern,`split`,r);let i=this.set;this.debug(this.pattern,`set`,i);let a=r[r.length-1];if(!a)for(let e=r.length-2;!a&&e>=0;e--)a=r[e];for(let e=0;e<i.length;e++){let o=i[e],s=r;if(n.matchBase&&o.length===1&&(s=[a]),this.matchOne(s,o,t))return!!n.flipNegate||!this.negate}return!n.flipNegate&&this.negate}static defaults(e){return G.defaults(e).Minimatch}};function Ed(e){let t=Error(`${arguments.length>1&&arguments[1]!==void 0?arguments[1]:``}Invalid response: ${e.status} ${e.statusText}`);return t.status=e.status,t.response=e,t}function J(e,t){let{status:n}=t;if(n===401&&e.digest)return t;if(n>=400)throw Ed(t);return t}function Dd(e,t){return arguments.length>2&&arguments[2]!==void 0&&arguments[2]?{data:t,headers:e.headers?Ou(e.headers):{},status:e.status,statusText:e.statusText}:t}G.AST=td,G.Minimatch=Td,G.escape=function(e){let{windowsPathsNoEscape:t=!1}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return t?e.replace(/[?*()[\]]/g,`[$&]`):e.replace(/[?*()[\]\\]/g,`\\$&`)},G.unescape=Gu;let Od=(kd=function(e,t,n){let r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},i=W({url:V(e.remoteURL,B(t)),method:`COPY`,headers:{Destination:V(e.remoteURL,B(n)),Overwrite:!1===r.overwrite?`F`:`T`,Depth:r.shallow?`0`:`infinity`}},e,r);return o=function(t){J(e,t)},(a=U(i,e))&&a.then||(a=Promise.resolve(a)),o?a.then(o):a;var a,o},function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];try{return Promise.resolve(kd.apply(this,e))}catch(e){return Promise.reject(e)}});var kd;let Ad={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(e,t){return t},attributeValueProcessor:function(e,t){return t},stopNodes:[],alwaysCreateTextNode:!1,isArray:()=>!1,commentPropName:!1,unpairedTags:[],processEntities:!0,htmlEntities:!1,ignoreDeclaration:!1,ignorePiTags:!1,transformTagName:!1,transformAttributeName:!1,updateTag:function(e,t,n){return e},captureMetaData:!1},jd=RegExp(`^[: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][: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\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$`);function Md(e,t){let n=[],r=t.exec(e);for(;r;){let i=[];i.startIndex=t.lastIndex-r[0].length;let a=r.length;for(let e=0;e<a;e++)i.push(r[e]);n.push(i),r=t.exec(e)}return n}let Nd=function(e){return jd.exec(e)!=null},Pd;Pd=typeof Symbol==`function`?Symbol(`XML Node Metadata`):`@@xmlMetadata`;var Fd=class{constructor(e){this.tagname=e,this.child=[],this[`:@`]={}}add(e,t){e===`__proto__`&&(e=`#__proto__`),this.child.push({[e]:t})}addChild(e,t){e.tagname===`__proto__`&&(e.tagname=`#__proto__`),e[`:@`]&&Object.keys(e[`:@`]).length>0?this.child.push({[e.tagname]:e.child,":@":e[`:@`]}):this.child.push({[e.tagname]:e.child}),t!==void 0&&(this.child[this.child.length-1][Pd]={startIndex:t})}static getMetaDataSymbol(){return Pd}},Id=class{constructor(e){this.suppressValidationErr=!e}readDocType(e,t){let n={};if(e[t+3]!==`O`||e[t+4]!==`C`||e[t+5]!==`T`||e[t+6]!==`Y`||e[t+7]!==`P`||e[t+8]!==`E`)throw Error(`Invalid Tag instead of DOCTYPE`);{t+=9;let r=1,i=!1,a=!1,o=``;for(;t<e.length;t++)if(e[t]!==`<`||a)if(e[t]===`>`){if(a?e[t-1]===`-`&&e[t-2]===`-`&&(a=!1,r--):r--,r===0)break}else e[t]===`[`?i=!0:o+=e[t];else{if(i&&Ld(e,`!ENTITY`,t)){let r,i;t+=7,[r,i,t]=this.readEntityExp(e,t+1,this.suppressValidationErr),i.indexOf(`&`)===-1&&(n[r]={regx:RegExp(`&${r};`,`g`),val:i})}else if(i&&Ld(e,`!ELEMENT`,t)){t+=8;let{index:n}=this.readElementExp(e,t+1);t=n}else if(i&&Ld(e,`!ATTLIST`,t))t+=8;else if(i&&Ld(e,`!NOTATION`,t)){t+=9;let{index:n}=this.readNotationExp(e,t+1,this.suppressValidationErr);t=n}else{if(!Ld(e,`!--`,t))throw Error(`Invalid DOCTYPE`);a=!0}r++,o=``}if(r!==0)throw Error(`Unclosed DOCTYPE`)}return{entities:n,i:t}}readEntityExp(e,t){t=Y(e,t);let n=``;for(;t<e.length&&!/\s/.test(e[t])&&e[t]!==`"`&&e[t]!==`'`;)n+=e[t],t++;if(Rd(n),t=Y(e,t),!this.suppressValidationErr){if(e.substring(t,t+6).toUpperCase()===`SYSTEM`)throw Error(`External entities are not supported`);if(e[t]===`%`)throw Error(`Parameter entities are not supported`)}let r=``;return[t,r]=this.readIdentifierVal(e,t,`entity`),[n,r,--t]}readNotationExp(e,t){t=Y(e,t);let n=``;for(;t<e.length&&!/\s/.test(e[t]);)n+=e[t],t++;!this.suppressValidationErr&&Rd(n),t=Y(e,t);let r=e.substring(t,t+6).toUpperCase();if(!this.suppressValidationErr&&r!==`SYSTEM`&&r!==`PUBLIC`)throw Error(`Expected SYSTEM or PUBLIC, found "${r}"`);t+=r.length,t=Y(e,t);let i=null,a=null;if(r===`PUBLIC`)[t,i]=this.readIdentifierVal(e,t,`publicIdentifier`),e[t=Y(e,t)]!==`"`&&e[t]!==`'`||([t,a]=this.readIdentifierVal(e,t,`systemIdentifier`));else if(r===`SYSTEM`&&([t,a]=this.readIdentifierVal(e,t,`systemIdentifier`),!this.suppressValidationErr&&!a))throw Error(`Missing mandatory system identifier for SYSTEM notation`);return{notationName:n,publicIdentifier:i,systemIdentifier:a,index:--t}}readIdentifierVal(e,t,n){let r=``,i=e[t];if(i!==`"`&&i!==`'`)throw Error(`Expected quoted string, found "${i}"`);for(t++;t<e.length&&e[t]!==i;)r+=e[t],t++;if(e[t]!==i)throw Error(`Unterminated ${n} value`);return[++t,r]}readElementExp(e,t){t=Y(e,t);let n=``;for(;t<e.length&&!/\s/.test(e[t]);)n+=e[t],t++;if(!this.suppressValidationErr&&!Nd(n))throw Error(`Invalid element name: "${n}"`);let r=``;if(e[t=Y(e,t)]===`E`&&Ld(e,`MPTY`,t))t+=4;else if(e[t]===`A`&&Ld(e,`NY`,t))t+=2;else if(e[t]===`(`){for(t++;t<e.length&&e[t]!==`)`;)r+=e[t],t++;if(e[t]!==`)`)throw Error(`Unterminated content model`)}else if(!this.suppressValidationErr)throw Error(`Invalid Element Expression, found "${e[t]}"`);return{elementName:n,contentModel:r.trim(),index:t}}readAttlistExp(e,t){t=Y(e,t);let n=``;for(;t<e.length&&!/\s/.test(e[t]);)n+=e[t],t++;Rd(n),t=Y(e,t);let r=``;for(;t<e.length&&!/\s/.test(e[t]);)r+=e[t],t++;if(!Rd(r))throw Error(`Invalid attribute name: "${r}"`);t=Y(e,t);let i=``;if(e.substring(t,t+8).toUpperCase()===`NOTATION`){if(i=`NOTATION`,e[t=Y(e,t+=8)]!==`(`)throw Error(`Expected '(', found "${e[t]}"`);t++;let n=[];for(;t<e.length&&e[t]!==`)`;){let r=``;for(;t<e.length&&e[t]!==`|`&&e[t]!==`)`;)r+=e[t],t++;if(r=r.trim(),!Rd(r))throw Error(`Invalid notation name: "${r}"`);n.push(r),e[t]===`|`&&(t++,t=Y(e,t))}if(e[t]!==`)`)throw Error(`Unterminated list of notations`);t++,i+=` (`+n.join(`|`)+`)`}else{for(;t<e.length&&!/\s/.test(e[t]);)i+=e[t],t++;if(!this.suppressValidationErr&&![`CDATA`,`ID`,`IDREF`,`IDREFS`,`ENTITY`,`ENTITIES`,`NMTOKEN`,`NMTOKENS`].includes(i.toUpperCase()))throw Error(`Invalid attribute type: "${i}"`)}t=Y(e,t);let a=``;return e.substring(t,t+8).toUpperCase()===`#REQUIRED`?(a=`#REQUIRED`,t+=8):e.substring(t,t+7).toUpperCase()===`#IMPLIED`?(a=`#IMPLIED`,t+=7):[t,a]=this.readIdentifierVal(e,t,`ATTLIST`),{elementName:n,attributeName:r,attributeType:i,defaultValue:a,index:t}}};let Y=(e,t)=>{for(;t<e.length&&/\s/.test(e[t]);)t++;return t};function Ld(e,t,n){for(let r=0;r<t.length;r++)if(t[r]!==e[n+r+1])return!1;return!0}function Rd(e){if(Nd(e))return e;throw Error(`Invalid entity name ${e}`)}let zd=/^[-+]?0x[a-fA-F0-9]+$/,Bd=/^([\-\+])?(0*)([0-9]*(\.[0-9]*)?)$/,Vd={hex:!0,leadingZeros:!0,decimalPoint:`.`,eNotation:!0},Hd=/^([-+])?(0*)(\d*(\.\d*)?[eE][-\+]?\d+)$/;function Ud(e){return typeof e==`function`?e:Array.isArray(e)?t=>{for(let n of e)if(typeof n==`string`&&t===n||n instanceof RegExp&&n.test(t))return!0}:()=>!1}var Wd=class{constructor(e){if(this.options=e,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:(e,t)=>of(t,10,`&#`)},num_hex:{regex:/&#x([0-9a-fA-F]{1,6});/g,val:(e,t)=>of(t,16,`&#x`)}},this.addExternalEntities=Gd,this.parseXml=Xd,this.parseTextData=Kd,this.resolveNameSpace=qd,this.buildAttributesMap=Yd,this.isItStopNode=ef,this.replaceEntitiesValue=Qd,this.readStopNodeData=rf,this.saveTextToParentTag=$d,this.addChild=Zd,this.ignoreAttributesFn=Ud(this.options.ignoreAttributes),this.options.stopNodes&&this.options.stopNodes.length>0){this.stopNodesExact=new Set,this.stopNodesWildcard=new Set;for(let e=0;e<this.options.stopNodes.length;e++){let t=this.options.stopNodes[e];typeof t==`string`&&(t.startsWith(`*.`)?this.stopNodesWildcard.add(t.substring(2)):this.stopNodesExact.add(t))}}}};function Gd(e){let t=Object.keys(e);for(let n=0;n<t.length;n++){let r=t[n];this.lastEntities[r]={regex:RegExp(`&`+r+`;`,`g`),val:e[r]}}}function Kd(e,t,n,r,i,a,o){if(e!==void 0&&(this.options.trimValues&&!r&&(e=e.trim()),e.length>0)){o||(e=this.replaceEntitiesValue(e));let r=this.options.tagValueProcessor(t,e,n,i,a);return r==null?e:typeof r!=typeof e||r!==e?r:this.options.trimValues||e.trim()===e?af(e,this.options.parseTagValue,this.options.numberParseOptions):e}}function qd(e){if(this.options.removeNSPrefix){let t=e.split(`:`),n=e.charAt(0)===`/`?`/`:``;if(t[0]===`xmlns`)return``;t.length===2&&(e=n+t[1])}return e}let Jd=RegExp(`([^\\s=]+)\\s*(=\\s*(['"])([\\s\\S]*?)\\3)?`,`gm`);function Yd(e,t){if(!0!==this.options.ignoreAttributes&&typeof e==`string`){let n=Md(e,Jd),r=n.length,i={};for(let e=0;e<r;e++){let r=this.resolveNameSpace(n[e][1]);if(this.ignoreAttributesFn(r,t))continue;let a=n[e][4],o=this.options.attributeNamePrefix+r;if(r.length)if(this.options.transformAttributeName&&(o=this.options.transformAttributeName(o)),o===`__proto__`&&(o=`#__proto__`),a!==void 0){this.options.trimValues&&(a=a.trim()),a=this.replaceEntitiesValue(a);let e=this.options.attributeValueProcessor(r,a,t);i[o]=e==null?a:typeof e!=typeof a||e!==a?e:af(a,this.options.parseAttributeValue,this.options.numberParseOptions)}else this.options.allowBooleanAttributes&&(i[o]=!0)}if(!Object.keys(i).length)return;if(this.options.attributesGroupName){let e={};return e[this.options.attributesGroupName]=i,e}return i}}let Xd=function(e){e=e.replace(/\r\n?/g,`
|
|
19
|
-
`);let t=new Fd(`!xml`),n=t,r=``,i=``,a=new Id(this.options.processEntities);for(let o=0;o<e.length;o++)if(e[o]===`<`)if(e[o+1]===`/`){let t=tf(e,`>`,o,`Closing Tag is not closed.`),a=e.substring(o+2,t).trim();if(this.options.removeNSPrefix){let e=a.indexOf(`:`);e!==-1&&(a=a.substr(e+1))}this.options.transformTagName&&(a=this.options.transformTagName(a)),n&&(r=this.saveTextToParentTag(r,n,i));let s=i.substring(i.lastIndexOf(`.`)+1);if(a&&this.options.unpairedTags.indexOf(a)!==-1)throw Error(`Unpaired tag can not be used as closing tag: </${a}>`);let c=0;s&&this.options.unpairedTags.indexOf(s)!==-1?(c=i.lastIndexOf(`.`,i.lastIndexOf(`.`)-1),this.tagsNodeStack.pop()):c=i.lastIndexOf(`.`),i=i.substring(0,c),n=this.tagsNodeStack.pop(),r=``,o=t}else if(e[o+1]===`?`){let t=nf(e,o,!1,`?>`);if(!t)throw Error(`Pi Tag is not closed.`);if(r=this.saveTextToParentTag(r,n,i),!(this.options.ignoreDeclaration&&t.tagName===`?xml`||this.options.ignorePiTags)){let e=new Fd(t.tagName);e.add(this.options.textNodeName,``),t.tagName!==t.tagExp&&t.attrExpPresent&&(e[`:@`]=this.buildAttributesMap(t.tagExp,i)),this.addChild(n,e,i,o)}o=t.closeIndex+1}else if(e.substr(o+1,3)===`!--`){let t=tf(e,`-->`,o+4,`Comment is not closed.`);if(this.options.commentPropName){let a=e.substring(o+4,t-2);r=this.saveTextToParentTag(r,n,i),n.add(this.options.commentPropName,[{[this.options.textNodeName]:a}])}o=t}else if(e.substr(o+1,2)===`!D`){let t=a.readDocType(e,o);this.docTypeEntities=t.entities,o=t.i}else if(e.substr(o+1,2)===`![`){let t=tf(e,`]]>`,o,`CDATA is not closed.`)-2,a=e.substring(o+9,t);r=this.saveTextToParentTag(r,n,i);let s=this.parseTextData(a,n.tagname,i,!0,!1,!0,!0);s??=``,this.options.cdataPropName?n.add(this.options.cdataPropName,[{[this.options.textNodeName]:a}]):n.add(this.options.textNodeName,s),o=t+2}else{let a=nf(e,o,this.options.removeNSPrefix),s=a.tagName,c=a.rawTagName,l=a.tagExp,u=a.attrExpPresent,d=a.closeIndex;if(this.options.transformTagName){let e=this.options.transformTagName(s);l===s&&(l=e),s=e}n&&r&&n.tagname!==`!xml`&&(r=this.saveTextToParentTag(r,n,i,!1));let f=n;f&&this.options.unpairedTags.indexOf(f.tagname)!==-1&&(n=this.tagsNodeStack.pop(),i=i.substring(0,i.lastIndexOf(`.`))),s!==t.tagname&&(i+=i?`.`+s:s);let p=o;if(this.isItStopNode(this.stopNodesExact,this.stopNodesWildcard,i,s)){let t=``;if(l.length>0&&l.lastIndexOf(`/`)===l.length-1)s[s.length-1]===`/`?(s=s.substr(0,s.length-1),i=i.substr(0,i.length-1),l=s):l=l.substr(0,l.length-1),o=a.closeIndex;else if(this.options.unpairedTags.indexOf(s)!==-1)o=a.closeIndex;else{let n=this.readStopNodeData(e,c,d+1);if(!n)throw Error(`Unexpected end of ${c}`);o=n.i,t=n.tagContent}let r=new Fd(s);s!==l&&u&&(r[`:@`]=this.buildAttributesMap(l,i)),t&&=this.parseTextData(t,s,i,!0,u,!0,!0),i=i.substr(0,i.lastIndexOf(`.`)),r.add(this.options.textNodeName,t),this.addChild(n,r,i,p)}else{if(l.length>0&&l.lastIndexOf(`/`)===l.length-1){if(s[s.length-1]===`/`?(s=s.substr(0,s.length-1),i=i.substr(0,i.length-1),l=s):l=l.substr(0,l.length-1),this.options.transformTagName){let e=this.options.transformTagName(s);l===s&&(l=e),s=e}let e=new Fd(s);s!==l&&u&&(e[`:@`]=this.buildAttributesMap(l,i)),this.addChild(n,e,i,p),i=i.substr(0,i.lastIndexOf(`.`))}else{let e=new Fd(s);this.tagsNodeStack.push(n),s!==l&&u&&(e[`:@`]=this.buildAttributesMap(l,i)),this.addChild(n,e,i,p),n=e}r=``,o=d}}else r+=e[o];return t.child};function Zd(e,t,n,r){this.options.captureMetaData||(r=void 0);let i=this.options.updateTag(t.tagname,n,t[`:@`]);!1===i||(typeof i==`string`&&(t.tagname=i),e.addChild(t,r))}let Qd=function(e){if(this.options.processEntities){for(let t in this.docTypeEntities){let n=this.docTypeEntities[t];e=e.replace(n.regx,n.val)}for(let t in this.lastEntities){let n=this.lastEntities[t];e=e.replace(n.regex,n.val)}if(this.options.htmlEntities)for(let t in this.htmlEntities){let n=this.htmlEntities[t];e=e.replace(n.regex,n.val)}e=e.replace(this.ampEntity.regex,this.ampEntity.val)}return e};function $d(e,t,n,r){return e&&=(r===void 0&&(r=t.child.length===0),(e=this.parseTextData(e,t.tagname,n,!1,!!t[`:@`]&&Object.keys(t[`:@`]).length!==0,r))!==void 0&&e!==``&&t.add(this.options.textNodeName,e),``),e}function ef(e,t,n,r){return!(!t||!t.has(r))||!(!e||!e.has(n))}function tf(e,t,n,r){let i=e.indexOf(t,n);if(i===-1)throw Error(r);return i+t.length-1}function nf(e,t,n){let r=function(e,t){let n,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:`>`,i=``;for(let a=t;a<e.length;a++){let t=e[a];if(n)t===n&&(n=``);else if(t===`"`||t===`'`)n=t;else if(t===r[0]){if(!r[1]||e[a+1]===r[1])return{data:i,index:a}}else t===` `&&(t=` `);i+=t}}(e,t+1,arguments.length>3&&arguments[3]!==void 0?arguments[3]:`>`);if(!r)return;let i=r.data,a=r.index,o=i.search(/\s/),s=i,c=!0;o!==-1&&(s=i.substring(0,o),i=i.substring(o+1).trimStart());let l=s;if(n){let e=s.indexOf(`:`);e!==-1&&(s=s.substr(e+1),c=s!==r.data.substr(e+1))}return{tagName:s,tagExp:i,closeIndex:a,attrExpPresent:c,rawTagName:l}}function rf(e,t,n){let r=n,i=1;for(;n<e.length;n++)if(e[n]===`<`)if(e[n+1]===`/`){let a=tf(e,`>`,n,`${t} is not closed`);if(e.substring(n+2,a).trim()===t&&(i--,i===0))return{tagContent:e.substring(r,n),i:a};n=a}else if(e[n+1]===`?`)n=tf(e,`?>`,n+1,`StopNode is not closed.`);else if(e.substr(n+1,3)===`!--`)n=tf(e,`-->`,n+3,`StopNode is not closed.`);else if(e.substr(n+1,2)===`![`)n=tf(e,`]]>`,n,`StopNode is not closed.`)-2;else{let r=nf(e,n,`>`);r&&((r&&r.tagName)===t&&r.tagExp[r.tagExp.length-1]!==`/`&&i++,n=r.closeIndex)}}function af(e,t,n){if(t&&typeof e==`string`){let t=e.trim();return t===`true`||t!==`false`&&function(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(t=Object.assign({},Vd,t),!e||typeof e!=`string`)return e;let n=e.trim();if(t.skipLike!==void 0&&t.skipLike.test(n))return e;if(e===`0`)return 0;if(t.hex&&zd.test(n))return function(e){if(parseInt)return parseInt(e,16);if(Number.parseInt)return Number.parseInt(e,16);if(window&&window.parseInt)return window.parseInt(e,16);throw Error(`parseInt, Number.parseInt, window.parseInt are not supported`)}(n);if(n.includes(`e`)||n.includes(`E`))return function(e,t,n){if(!n.eNotation)return e;let r=t.match(Hd);if(r){let i=r[1]||``,a=r[3].indexOf(`e`)===-1?`E`:`e`,o=r[2],s=i?e[o.length+1]===a:e[o.length]===a;return o.length>1&&s?e:o.length!==1||!r[3].startsWith(`.${a}`)&&r[3][0]!==a?n.leadingZeros&&!s?(t=(r[1]||``)+r[3],Number(t)):e:Number(t)}return e}(e,n,t);{let i=Bd.exec(n);if(i){let a=i[1]||``,o=i[2],s=((r=i[3])&&r.indexOf(`.`)!==-1&&((r=r.replace(/0+$/,``))===`.`?r=`0`:r[0]===`.`?r=`0`+r:r[r.length-1]===`.`&&(r=r.substring(0,r.length-1))),r),c=a?e[o.length+1]===`.`:e[o.length]===`.`;if(!t.leadingZeros&&(o.length>1||o.length===1&&!c))return e;{let r=Number(n),i=String(r);if(r===0)return r;if(i.search(/[eE]/)!==-1)return t.eNotation?r:e;if(n.indexOf(`.`)!==-1)return i===`0`||i===s||i===`${a}${s}`?r:e;let c=o?s:n;return o?c===i||a+c===i?r:e:c===i||c===a+i?r:e}}return e}var r}(e,n)}return e===void 0?``:e}function of(e,t,n){let r=Number.parseInt(e,t);return r>=0&&r<=1114111?String.fromCodePoint(r):n+e+`;`}let sf=Fd.getMetaDataSymbol();function cf(e,t){return lf(e,t)}function lf(e,t,n){let r,i={};for(let a=0;a<e.length;a++){let o=e[a],s=uf(o),c=``;if(c=n===void 0?s:n+`.`+s,s===t.textNodeName)r===void 0?r=o[s]:r+=``+o[s];else{if(s===void 0)continue;if(o[s]){let e=lf(o[s],t,c),n=ff(e,t);o[sf]!==void 0&&(e[sf]=o[sf]),o[`:@`]?df(e,o[`:@`],c,t):Object.keys(e).length!==1||e[t.textNodeName]===void 0||t.alwaysCreateTextNode?Object.keys(e).length===0&&(t.alwaysCreateTextNode?e[t.textNodeName]=``:e=``):e=e[t.textNodeName],i[s]!==void 0&&i.hasOwnProperty(s)?(Array.isArray(i[s])||(i[s]=[i[s]]),i[s].push(e)):t.isArray(s,c,n)?i[s]=[e]:i[s]=e}}}return typeof r==`string`?r.length>0&&(i[t.textNodeName]=r):r!==void 0&&(i[t.textNodeName]=r),i}function uf(e){let t=Object.keys(e);for(let e=0;e<t.length;e++){let n=t[e];if(n!==`:@`)return n}}function df(e,t,n,r){if(t){let i=Object.keys(t),a=i.length;for(let o=0;o<a;o++){let a=i[o];r.isArray(a,n+`.`+a,!0,!0)?e[a]=[t[a]]:e[a]=t[a]}}}function ff(e,t){let{textNodeName:n}=t,r=Object.keys(e).length;return r===0||!(r!==1||!e[n]&&typeof e[n]!=`boolean`&&e[n]!==0)}let pf={allowBooleanAttributes:!1,unpairedTags:[]};function mf(e){return e===` `||e===` `||e===`
|
|
20
|
-
`||e===`\r`}function hf(e,t){let n=t;for(;t<e.length;t++)if(!(e[t]!=`?`&&e[t]!=` `)){let r=e.substr(n,t-n);if(t>5&&r===`xml`)return X(`InvalidXml`,`XML declaration allowed only at the start of the document.`,Z(e,t));if(e[t]==`?`&&e[t+1]==`>`){t++;break}}return t}function gf(e,t){if(e.length>t+5&&e[t+1]===`-`&&e[t+2]===`-`){for(t+=3;t<e.length;t++)if(e[t]===`-`&&e[t+1]===`-`&&e[t+2]===`>`){t+=2;break}}else if(e.length>t+8&&e[t+1]===`D`&&e[t+2]===`O`&&e[t+3]===`C`&&e[t+4]===`T`&&e[t+5]===`Y`&&e[t+6]===`P`&&e[t+7]===`E`){let n=1;for(t+=8;t<e.length;t++)if(e[t]===`<`)n++;else if(e[t]===`>`&&(n--,n===0))break}else if(e.length>t+9&&e[t+1]===`[`&&e[t+2]===`C`&&e[t+3]===`D`&&e[t+4]===`A`&&e[t+5]===`T`&&e[t+6]===`A`&&e[t+7]===`[`){for(t+=8;t<e.length;t++)if(e[t]===`]`&&e[t+1]===`]`&&e[t+2]===`>`){t+=2;break}}return t}function _f(e,t){let n=``,r=``,i=!1;for(;t<e.length;t++){if(e[t]===`"`||e[t]===`'`)r===``?r=e[t]:r!==e[t]||(r=``);else if(e[t]===`>`&&r===``){i=!0;break}n+=e[t]}return r===``&&{value:n,index:t,tagClosed:i}}let vf=RegExp(`(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['"])(([\\s\\S])*?)\\5)?`,`g`);function yf(e,t){let n=Md(e,vf),r={};for(let e=0;e<n.length;e++){if(n[e][1].length===0)return X(`InvalidAttr`,`Attribute '`+n[e][2]+`' has no space in starting.`,Sf(n[e]));if(n[e][3]!==void 0&&n[e][4]===void 0)return X(`InvalidAttr`,`Attribute '`+n[e][2]+`' is without value.`,Sf(n[e]));if(n[e][3]===void 0&&!t.allowBooleanAttributes)return X(`InvalidAttr`,`boolean attribute '`+n[e][2]+`' is not allowed.`,Sf(n[e]));let i=n[e][2];if(!xf(i))return X(`InvalidAttr`,`Attribute '`+i+`' is an invalid name.`,Sf(n[e]));if(r.hasOwnProperty(i))return X(`InvalidAttr`,`Attribute '`+i+`' is repeated.`,Sf(n[e]));r[i]=1}return!0}function bf(e,t){if(e[++t]===`;`)return-1;if(e[t]===`#`)return function(e,t){let n=/\d/;for(e[t]===`x`&&(t++,n=/[\da-fA-F]/);t<e.length;t++){if(e[t]===`;`)return t;if(!e[t].match(n))break}return-1}(e,++t);let n=0;for(;t<e.length;t++,n++)if(!(e[t].match(/\w/)&&n<20)){if(e[t]===`;`)break;return-1}return t}function X(e,t,n){return{err:{code:e,msg:t,line:n.line||n,col:n.col}}}function xf(e){return Nd(e)}function Z(e,t){let n=e.substring(0,t).split(/\r?\n/);return{line:n.length,col:n[n.length-1].length+1}}function Sf(e){return e.startIndex+e[1].length}var Cf=class{constructor(e){this.externalEntities={},this.options=function(e){return Object.assign({},Ad,e)}(e)}parse(e,t){if(typeof e!=`string`&&e.toString)e=e.toString();else if(typeof e!=`string`)throw Error(`XML data is accepted in String or Bytes[] form.`);if(t){!0===t&&(t={});let n=function(e,t){t=Object.assign({},pf,t);let n=[],r=!1,i=!1;e[0]===``&&(e=e.substr(1));for(let a=0;a<e.length;a++)if(e[a]===`<`&&e[a+1]===`?`){if(a+=2,a=hf(e,a),a.err)return a}else{if(e[a]!==`<`){if(mf(e[a]))continue;return X(`InvalidChar`,`char '`+e[a]+`' is not expected.`,Z(e,a))}{let o=a;if(a++,e[a]===`!`){a=gf(e,a);continue}{let s=!1;e[a]===`/`&&(s=!0,a++);let c=``;for(;a<e.length&&e[a]!==`>`&&e[a]!==` `&&e[a]!==` `&&e[a]!==`
|
|
21
|
-
`&&e[a]!==`\r`;a++)c+=e[a];if(c=c.trim(),c[c.length-1]===`/`&&(c=c.substring(0,c.length-1),a--),!Nd(c)){let t;return t=c.trim().length===0?`Invalid space after '<'.`:`Tag '`+c+`' is an invalid name.`,X(`InvalidTag`,t,Z(e,a))}let l=_f(e,a);if(!1===l)return X(`InvalidAttr`,`Attributes for '`+c+`' have open quote.`,Z(e,a));let u=l.value;if(a=l.index,u[u.length-1]===`/`){let n=a-u.length;u=u.substring(0,u.length-1);let i=yf(u,t);if(!0!==i)return X(i.err.code,i.err.msg,Z(e,n+i.err.line));r=!0}else if(s){if(!l.tagClosed)return X(`InvalidTag`,`Closing tag '`+c+`' doesn't have proper closing.`,Z(e,a));if(u.trim().length>0)return X(`InvalidTag`,`Closing tag '`+c+`' can't have attributes or invalid starting.`,Z(e,o));if(n.length===0)return X(`InvalidTag`,`Closing tag '`+c+`' has not been opened.`,Z(e,o));{let t=n.pop();if(c!==t.tagName){let n=Z(e,t.tagStartPos);return X(`InvalidTag`,`Expected closing tag '`+t.tagName+`' (opened in line `+n.line+`, col `+n.col+`) instead of closing tag '`+c+`'.`,Z(e,o))}n.length==0&&(i=!0)}}else{let s=yf(u,t);if(!0!==s)return X(s.err.code,s.err.msg,Z(e,a-u.length+s.err.line));if(!0===i)return X(`InvalidXml`,`Multiple possible root nodes found.`,Z(e,a));t.unpairedTags.indexOf(c)!==-1||n.push({tagName:c,tagStartPos:o}),r=!0}for(a++;a<e.length;a++)if(e[a]===`<`){if(e[a+1]===`!`){a++,a=gf(e,a);continue}if(e[a+1]!==`?`)break;if(a=hf(e,++a),a.err)return a}else if(e[a]===`&`){let t=bf(e,a);if(t==-1)return X(`InvalidChar`,`char '&' is not expected.`,Z(e,a));a=t}else if(!0===i&&!mf(e[a]))return X(`InvalidXml`,`Extra text at the end`,Z(e,a));e[a]===`<`&&a--}}}return r?n.length==1?X(`InvalidTag`,`Unclosed tag '`+n[0].tagName+`'.`,Z(e,n[0].tagStartPos)):!(n.length>0)||X(`InvalidXml`,`Invalid '`+JSON.stringify(n.map((e=>e.tagName)),null,4).replace(/\r?\n/g,``)+`' found.`,{line:1,col:1}):X(`InvalidXml`,`Start tag expected.`,1)}(e,t);if(!0!==n)throw Error(`${n.err.msg}:${n.err.line}:${n.err.col}`)}let n=new Wd(this.options);n.addExternalEntities(this.externalEntities);let r=n.parseXml(e);return this.options.preserveOrder||r===void 0?r:cf(r,this.options)}addEntity(e,t){if(t.indexOf(`&`)!==-1)throw Error(`Entity value can't have '&'`);if(e.indexOf(`&`)!==-1||e.indexOf(`;`)!==-1)throw Error(`An entity must be set without '&' and ';'. Eg. use '#xD' for '
'`);if(t===`&`)throw Error(`An entity with value '&' is not permitted`);this.externalEntities[e]=t}static getMetaDataSymbol(){return Fd.getMetaDataSymbol()}},wf=z(829),Tf=z.n(wf),Ef=function(e){return e.Array=`array`,e.Object=`object`,e.Original=`original`,e}(Ef||{});function Df(e,t){if(!e.endsWith(`propstat.prop.displayname`))return t}function Of(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Ef.Original,r=Tf().get(e,t);return n===`array`&&!1===Array.isArray(r)?[r]:n===`object`&&Array.isArray(r)?r[0]:r}function kf(e,t){return t??={attributeNamePrefix:`@`,attributeParsers:[],tagParsers:[Df]},new Promise((n=>{n(function(e){let{multistatus:t}=e;if(t===``)return{multistatus:{response:[]}};if(!t)throw Error(`Invalid response: No root multistatus found`);let n={multistatus:Array.isArray(t)?t[0]:t};return Tf().set(n,`multistatus.response`,Of(n,`multistatus.response`,Ef.Array)),Tf().set(n,`multistatus.response`,Tf().get(n,`multistatus.response`).map((e=>function(e){let t=Object.assign({},e);return t.status?Tf().set(t,`status`,Of(t,`status`,Ef.Object)):(Tf().set(t,`propstat`,Of(t,`propstat`,Ef.Object)),Tf().set(t,`propstat.prop`,Of(t,`propstat.prop`,Ef.Object))),t}(e)))),n}(function(e){let{attributeNamePrefix:t,attributeParsers:n,tagParsers:r}=e;return new Cf({allowBooleanAttributes:!0,attributeNamePrefix:t,textNodeName:`text`,ignoreAttributes:!1,removeNSPrefix:!0,numberParseOptions:{hex:!0,leadingZeros:!1},attributeValueProcessor(e,t,r){for(let e of n)try{let n=e(r,t);if(n!==t)return n}catch{}return t},tagValueProcessor(e,t,n){for(let e of r)try{let r=e(n,t);if(r!==t)return r}catch{}return t}})}(t).parse(e)))}))}function Af(e,t){let n=arguments.length>2&&arguments[2]!==void 0&&arguments[2],{getlastmodified:r=null,getcontentlength:i=`0`,resourcetype:a=null,getcontenttype:o=null,getetag:s=null}=e,c=a&&typeof a==`object`&&a.collection!==void 0?`directory`:`file`,l={filename:t,basename:tu().basename(t),lastmod:r,size:parseInt(i,10),type:c,etag:typeof s==`string`?s.replace(/"/g,``):null};return c===`file`&&(l.mime=o&&typeof o==`string`?o.split(`;`)[0]:``),n&&(e.displayname!==void 0&&(e.displayname=String(e.displayname)),l.props=e),l}function jf(e,t){let n=arguments.length>2&&arguments[2]!==void 0&&arguments[2],r=null;try{e.multistatus.response[0].propstat&&(r=e.multistatus.response[0])}catch{}if(!r)throw Error(`Failed getting item stat: bad response`);let{propstat:{prop:i,status:a}}=r,[o,s,c]=a.split(` `,3),l=parseInt(s,10);if(l>=400){let e=Error(`Invalid response: ${l} ${c}`);throw e.status=l,e}return Af(i,au(t),n)}function Mf(e){switch(String(e)){case`-3`:return`unlimited`;case`-2`:case`-1`:return`unknown`;default:return parseInt(String(e),10)}}function Nf(e,t,n){return n?t?t(e):e:(e&&e.then||(e=Promise.resolve(e)),t?e.then(t):e)}let Pf=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{return Promise.resolve(e.apply(this,t))}catch(e){return Promise.reject(e)}}}((function(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},{details:r=!1}=n;return Nf(U(W({url:V(e.remoteURL,B(t)),method:`PROPFIND`,headers:{Accept:`text/plain,application/xml`,Depth:`0`}},e,n),e),(function(n){return J(e,n),Nf(n.text(),(function(i){return Nf(kf(i,e.parsing),(function(e){return Dd(n,jf(e,t,r),r)}))}))}))}));function Ff(e,t,n){return n?t?t(e):e:(e&&e.then||(e=Promise.resolve(e)),t?e.then(t):e)}let If=Lf((function(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},r=function(e){if(!e||e===`/`)return[];let t=e,n=[];do n.push(t),t=tu().dirname(t);while(t&&t!==`/`);return n}(au(t));r.sort(((e,t)=>e.length>t.length?1:t.length>e.length?-1:0));let i=!1;return function(e,t,n){if(typeof e[Bf]==`function`){var r,i,a,o=e[Bf]();function n(e){try{for(;!(r=o.next()).done;)if((e=t(r.value))&&e.then){if(!Hf(e))return void e.then(n,a||=Q.bind(null,i=new Vf,2));e=e.v}i?Q(i,1,e):i=e}catch(e){Q(i||=new Vf,2,e)}}if(n(),o.return){var s=function(e){try{r.done||o.return()}catch{}return e};if(i&&i.then)return i.then(s,(function(e){throw s(e)}));s()}return i}if(!(`length`in e))throw TypeError(`Object is not iterable`);for(var c=[],l=0;l<e.length;l++)c.push(e[l]);return function(e,t,n){var r,i,a=-1;return function o(s){try{for(;++a<e.length&&(!n||!n());)if((s=t(a))&&s.then){if(!Hf(s))return void s.then(o,i||=Q.bind(null,r=new Vf,2));s=s.v}r?Q(r,1,s):r=s}catch(e){Q(r||=new Vf,2,e)}}(),r}(c,(function(e){return t(c[e])}),n)}(r,(function(r){return a=function(){return function(n,i){try{var a=Ff(Pf(e,r),(function(e){if(e.type!==`directory`)throw Error(`Path includes a file: ${t}`)}))}catch(e){return i(e)}return a&&a.then?a.then(void 0,i):a}(0,(function(t){let a=t;return function(){if(a.status===404)return i=!0,zf(Uf(e,r,{...n,recursive:!1}));throw t}()}))},(o=function(){if(i)return zf(Uf(e,r,{...n,recursive:!1}))}())&&o.then?o.then(a):a();var a,o}),(function(){return!1}))}));function Lf(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{return Promise.resolve(e.apply(this,t))}catch(e){return Promise.reject(e)}}}function Rf(){}function zf(e,t){if(!t)return e&&e.then?e.then(Rf):Promise.resolve()}let Bf=typeof Symbol<`u`?Symbol.iterator||(Symbol.iterator=Symbol(`Symbol.iterator`)):`@@iterator`;function Q(e,t,n){if(!e.s){if(n instanceof Vf){if(!n.s)return void(n.o=Q.bind(null,e,t));1&t&&(t=n.s),n=n.v}if(n&&n.then)return void n.then(Q.bind(null,e,t),Q.bind(null,e,2));e.s=t,e.v=n;let r=e.o;r&&r(e)}}let Vf=function(){function e(){}return e.prototype.then=function(t,n){let r=new e,i=this.s;if(i){let e=1&i?t:n;if(e){try{Q(r,1,e(this.v))}catch(e){Q(r,2,e)}return r}return this}return this.o=function(e){try{let i=e.v;1&e.s?Q(r,1,t?t(i):i):n?Q(r,1,n(i)):Q(r,2,i)}catch(e){Q(r,2,e)}},r},e}();function Hf(e){return e instanceof Vf&&1&e.s}let Uf=Lf((function(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(!0===n.recursive)return If(e,t,n);let r=W({url:V(e.remoteURL,(i=B(t),i.endsWith(`/`)?i:i+`/`)),method:`MKCOL`},e,n);var i;return Ff(U(r,e),(function(t){J(e,t)}))}));var Wf=z(388),Gf=z.n(Wf);let Kf=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{return Promise.resolve(e.apply(this,t))}catch(e){return Promise.reject(e)}}}((function(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},r={};if(typeof n.range==`object`&&typeof n.range.start==`number`){let e=`bytes=${n.range.start}-`;typeof n.range.end==`number`&&(e=`${e}${n.range.end}`),r.Range=e}let i=W({url:V(e.remoteURL,B(t)),method:`GET`,headers:r},e,n);return o=function(t){if(J(e,t),r.Range&&t.status!==206){let e=Error(`Invalid response code for partial request: ${t.status}`);throw e.status=t.status,e}return n.callback&&setTimeout((()=>{n.callback(t)}),0),t.body},(a=U(i,e))&&a.then||(a=Promise.resolve(a)),o?a.then(o):a;var a,o})),qf=()=>{},Jf=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{return Promise.resolve(e.apply(this,t))}catch(e){return Promise.reject(e)}}}((function(e,t,n){n.url||=V(e.remoteURL,B(t));let r=W(n,e,{});return a=function(t){return J(e,t),t},(i=U(r,e))&&i.then||(i=Promise.resolve(i)),a?i.then(a):i;var i,a})),Yf=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{return Promise.resolve(e.apply(this,t))}catch(e){return Promise.reject(e)}}}((function(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},r=W({url:V(e.remoteURL,B(t)),method:`DELETE`},e,n);return a=function(t){J(e,t)},(i=U(r,e))&&i.then||(i=Promise.resolve(i)),a?i.then(a):i;var i,a})),Xf=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{return Promise.resolve(e.apply(this,t))}catch(e){return Promise.reject(e)}}}((function(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return function(r,i){try{var a=(o=Pf(e,t,n),s=function(){return!0},c?s?s(o):o:(o&&o.then||(o=Promise.resolve(o)),s?o.then(s):o))}catch(e){return i(e)}var o,s,c;return a&&a.then?a.then(void 0,i):a}(0,(function(e){if(e.status===404)return!1;throw e}))}));function Zf(e,t,n){return n?t?t(e):e:(e&&e.then||(e=Promise.resolve(e)),t?e.then(t):e)}let Qf=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{return Promise.resolve(e.apply(this,t))}catch(e){return Promise.reject(e)}}}((function(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return Zf(U(W({url:V(e.remoteURL,B(t),`/`),method:`PROPFIND`,headers:{Accept:`text/plain,application/xml`,Depth:n.deep?`infinity`:`1`}},e,n),e),(function(r){return J(e,r),Zf(r.text(),(function(i){if(!i)throw Error(`Failed parsing directory contents: Empty response`);return Zf(kf(i,e.parsing),(function(i){let a=iu(t),o=function(e,t,n){let r=arguments.length>3&&arguments[3]!==void 0&&arguments[3],i=arguments.length>4&&arguments[4]!==void 0&&arguments[4],a=tu().join(t,`/`),{multistatus:{response:o}}=e,s=o.map((e=>{let t=function(e){try{return e.replace(/^https?:\/\/[^\/]+/,``)}catch(e){throw new $l(e,`Failed normalising HREF`)}}(e.href),{propstat:{prop:n}}=e;return Af(n,a===`/`?decodeURIComponent(au(t)):au(tu().relative(decodeURIComponent(a),decodeURIComponent(t))),r)}));return i?s:s.filter((e=>e.basename&&(e.type===`file`||e.filename!==n.replace(/\/$/,``))))}(i,iu(e.remoteBasePath||e.remotePath),a,n.details,n.includeSelf);return n.glob&&(o=function(e,t){return e.filter((e=>G(e.filename,t,{matchBase:!0})))}(o,n.glob)),Dd(r,o,n.details)}))}))}))}));function $f(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{return Promise.resolve(e.apply(this,t))}catch(e){return Promise.reject(e)}}}let ep=$f((function(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return tp(U(W({url:V(e.remoteURL,B(t)),method:`GET`,headers:{Accept:`text/plain`},transformResponse:[ip]},e,n),e),(function(t){return J(e,t),tp(t.text(),(function(e){return Dd(t,e,n.details)}))}))}));function tp(e,t,n){return n?t?t(e):e:(e&&e.then||(e=Promise.resolve(e)),t?e.then(t):e)}let np=$f((function(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return tp(U(W({url:V(e.remoteURL,B(t)),method:`GET`},e,n),e),(function(t){let r;return J(e,t),function(e,t){var n=e();return n&&n.then?n.then(t):t()}((function(){return tp(t.arrayBuffer(),(function(e){r=e}))}),(function(){return Dd(t,r,n.details)}))}))})),rp=$f((function(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},{format:r=`binary`}=n;if(r!==`binary`&&r!==`text`)throw new $l({info:{code:_u.InvalidOutputFormat}},`Invalid output format: ${r}`);return r===`text`?ep(e,t,n):np(e,t,n)})),ip=e=>e;function ap(e,t){let n=``;return t.format&&t.indentBy.length>0&&(n=`
|
|
22
|
-
`),op(e,t,``,n)}function op(e,t,n,r){let i=``,a=!1;for(let o=0;o<e.length;o++){let s=e[o],c=sp(s);if(c===void 0)continue;let l=``;if(l=n.length===0?c:`${n}.${c}`,c===t.textNodeName){let e=s[c];lp(l,t)||(e=t.tagValueProcessor(c,e),e=up(e,t)),a&&(i+=r),i+=e,a=!1;continue}if(c===t.cdataPropName){a&&(i+=r),i+=`<![CDATA[${s[c][0][t.textNodeName]}]]>`,a=!1;continue}if(c===t.commentPropName){i+=r+`\x3c!--${s[c][0][t.textNodeName]}--\x3e`,a=!0;continue}if(c[0]===`?`){let e=cp(s[`:@`],t),n=c===`?xml`?``:r,o=s[c][0][t.textNodeName];o=o.length===0?``:` `+o,i+=n+`<${c}${o}${e}?>`,a=!0;continue}let u=r;u!==``&&(u+=t.indentBy);let d=r+`<${c}${cp(s[`:@`],t)}`,f=op(s[c],t,l,u);t.unpairedTags.indexOf(c)===-1?f&&f.length!==0||!t.suppressEmptyNode?f&&f.endsWith(`>`)?i+=d+`>${f}${r}</${c}>`:(i+=d+`>`,f&&r!==``&&(f.includes(`/>`)||f.includes(`</`))?i+=r+t.indentBy+f+r:i+=f,i+=`</${c}>`):i+=d+`/>`:t.suppressUnpairedNode?i+=d+`>`:i+=d+`/>`,a=!0}return i}function sp(e){let t=Object.keys(e);for(let n=0;n<t.length;n++){let r=t[n];if(e.hasOwnProperty(r)&&r!==`:@`)return r}}function cp(e,t){let n=``;if(e&&!t.ignoreAttributes)for(let r in e){if(!e.hasOwnProperty(r))continue;let i=t.attributeValueProcessor(r,e[r]);i=up(i,t),!0===i&&t.suppressBooleanAttributes?n+=` ${r.substr(t.attributeNamePrefix.length)}`:n+=` ${r.substr(t.attributeNamePrefix.length)}="${i}"`}return n}function lp(e,t){let n=(e=e.substr(0,e.length-t.textNodeName.length-1)).substr(e.lastIndexOf(`.`)+1);for(let r in t.stopNodes)if(t.stopNodes[r]===e||t.stopNodes[r]===`*.`+n)return!0;return!1}function up(e,t){if(e&&e.length>0&&t.processEntities)for(let n=0;n<t.entities.length;n++){let r=t.entities[n];e=e.replace(r.regex,r.val)}return e}let dp={attributeNamePrefix:`@_`,attributesGroupName:!1,textNodeName:`#text`,ignoreAttributes:!0,cdataPropName:!1,format:!1,indentBy:` `,suppressEmptyNode:!1,suppressUnpairedNode:!0,suppressBooleanAttributes:!0,tagValueProcessor:function(e,t){return t},attributeValueProcessor:function(e,t){return t},preserveOrder:!1,commentPropName:!1,unpairedTags:[],entities:[{regex:RegExp(`&`,`g`),val:`&`},{regex:RegExp(`>`,`g`),val:`>`},{regex:RegExp(`<`,`g`),val:`<`},{regex:RegExp(`'`,`g`),val:`'`},{regex:RegExp(`"`,`g`),val:`"`}],processEntities:!0,stopNodes:[],oneListGroup:!1};function fp(e){this.options=Object.assign({},dp,e),!0===this.options.ignoreAttributes||this.options.attributesGroupName?this.isAttribute=function(){return!1}:(this.ignoreAttributesFn=Ud(this.options.ignoreAttributes),this.attrPrefixLen=this.options.attributeNamePrefix.length,this.isAttribute=hp),this.processTextOrObjNode=pp,this.options.format?(this.indentate=mp,this.tagEndChar=`>
|
|
23
|
-
`,this.newLine=`
|
|
24
|
-
`):(this.indentate=function(){return``},this.tagEndChar=`>`,this.newLine=``)}function pp(e,t,n,r){let i=this.j2x(e,n+1,r.concat(t));return e[this.options.textNodeName]!==void 0&&Object.keys(e).length===1?this.buildTextValNode(e[this.options.textNodeName],t,i.attrStr,n):this.buildObjectNode(i.val,t,i.attrStr,n)}function mp(e){return this.options.indentBy.repeat(e)}function hp(e){return!(!e.startsWith(this.options.attributeNamePrefix)||e===this.options.textNodeName)&&e.substr(this.attrPrefixLen)}function gp(e){return new fp({attributeNamePrefix:`@_`,format:!0,ignoreAttributes:!1,suppressEmptyNode:!0}).build(_p({lockinfo:{"@_xmlns:d":`DAV:`,lockscope:{exclusive:{}},locktype:{write:{}},owner:{href:e}}},`d`))}function _p(e,t){let n={...e};for(let e in n)n.hasOwnProperty(e)&&(n[e]&&typeof n[e]==`object`&&e.indexOf(`:`)===-1?(n[`${t}:${e}`]=_p(n[e],t),delete n[e]):!1===/^@_/.test(e)&&(n[`${t}:${e}`]=n[e],delete n[e]));return n}function vp(e,t,n){return n?t?t(e):e:(e&&e.then||(e=Promise.resolve(e)),t?e.then(t):e)}function yp(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{return Promise.resolve(e.apply(this,t))}catch(e){return Promise.reject(e)}}}fp.prototype.build=function(e){return this.options.preserveOrder?ap(e,this.options):(Array.isArray(e)&&this.options.arrayNodeName&&this.options.arrayNodeName.length>1&&(e={[this.options.arrayNodeName]:e}),this.j2x(e,0,[]).val)},fp.prototype.j2x=function(e,t,n){let r=``,i=``,a=n.join(`.`);for(let o in e)if(Object.prototype.hasOwnProperty.call(e,o))if(e[o]===void 0)this.isAttribute(o)&&(i+=``);else if(e[o]===null)this.isAttribute(o)||o===this.options.cdataPropName?i+=``:o[0]===`?`?i+=this.indentate(t)+`<`+o+`?`+this.tagEndChar:i+=this.indentate(t)+`<`+o+`/`+this.tagEndChar;else if(e[o]instanceof Date)i+=this.buildTextValNode(e[o],o,``,t);else if(typeof e[o]!=`object`){let n=this.isAttribute(o);if(n&&!this.ignoreAttributesFn(n,a))r+=this.buildAttrPairStr(n,``+e[o]);else if(!n)if(o===this.options.textNodeName){let t=this.options.tagValueProcessor(o,``+e[o]);i+=this.replaceEntitiesValue(t)}else i+=this.buildTextValNode(e[o],o,``,t)}else if(Array.isArray(e[o])){let r=e[o].length,a=``,s=``;for(let c=0;c<r;c++){let r=e[o][c];if(r!==void 0)if(r===null)o[0]===`?`?i+=this.indentate(t)+`<`+o+`?`+this.tagEndChar:i+=this.indentate(t)+`<`+o+`/`+this.tagEndChar;else if(typeof r==`object`)if(this.options.oneListGroup){let e=this.j2x(r,t+1,n.concat(o));a+=e.val,this.options.attributesGroupName&&r.hasOwnProperty(this.options.attributesGroupName)&&(s+=e.attrStr)}else a+=this.processTextOrObjNode(r,o,t,n);else if(this.options.oneListGroup){let e=this.options.tagValueProcessor(o,r);e=this.replaceEntitiesValue(e),a+=e}else a+=this.buildTextValNode(r,o,``,t)}this.options.oneListGroup&&(a=this.buildObjectNode(a,o,s,t)),i+=a}else if(this.options.attributesGroupName&&o===this.options.attributesGroupName){let t=Object.keys(e[o]),n=t.length;for(let i=0;i<n;i++)r+=this.buildAttrPairStr(t[i],``+e[o][t[i]])}else i+=this.processTextOrObjNode(e[o],o,t,n);return{attrStr:r,val:i}},fp.prototype.buildAttrPairStr=function(e,t){return t=this.options.attributeValueProcessor(e,``+t),t=this.replaceEntitiesValue(t),this.options.suppressBooleanAttributes&&t===`true`?` `+e:` `+e+`="`+t+`"`},fp.prototype.buildObjectNode=function(e,t,n,r){if(e===``)return t[0]===`?`?this.indentate(r)+`<`+t+n+`?`+this.tagEndChar:this.indentate(r)+`<`+t+n+this.closeTag(t)+this.tagEndChar;{let i=`</`+t+this.tagEndChar,a=``;return t[0]===`?`&&(a=`?`,i=``),!n&&n!==``||e.indexOf(`<`)!==-1?!1!==this.options.commentPropName&&t===this.options.commentPropName&&a.length===0?this.indentate(r)+`\x3c!--${e}--\x3e`+this.newLine:this.indentate(r)+`<`+t+n+a+this.tagEndChar+e+this.indentate(r)+i:this.indentate(r)+`<`+t+n+a+`>`+e+i}},fp.prototype.closeTag=function(e){let t=``;return this.options.unpairedTags.indexOf(e)===-1?t=this.options.suppressEmptyNode?`/`:`></${e}`:this.options.suppressUnpairedNode||(t=`/`),t},fp.prototype.buildTextValNode=function(e,t,n,r){if(!1!==this.options.cdataPropName&&t===this.options.cdataPropName)return this.indentate(r)+`<![CDATA[${e}]]>`+this.newLine;if(!1!==this.options.commentPropName&&t===this.options.commentPropName)return this.indentate(r)+`\x3c!--${e}--\x3e`+this.newLine;if(t[0]===`?`)return this.indentate(r)+`<`+t+n+`?`+this.tagEndChar;{let i=this.options.tagValueProcessor(t,e);return i=this.replaceEntitiesValue(i),i===``?this.indentate(r)+`<`+t+n+this.closeTag(t)+this.tagEndChar:this.indentate(r)+`<`+t+n+`>`+i+`</`+t+this.tagEndChar}},fp.prototype.replaceEntitiesValue=function(e){if(e&&e.length>0&&this.options.processEntities)for(let t=0;t<this.options.entities.length;t++){let n=this.options.entities[t];e=e.replace(n.regex,n.val)}return e};let bp=yp((function(e,t,n){let r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return vp(U(W({url:V(e.remoteURL,B(t)),method:`UNLOCK`,headers:{"Lock-Token":n}},e,r),e),(function(t){if(J(e,t),t.status!==204&&t.status!==200)throw Ed(t)}))})),xp=yp((function(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},{refreshToken:r,timeout:i=Sp}=n,a={Accept:`text/plain,application/xml`,Timeout:i};return r&&(a.If=r),vp(U(W({url:V(e.remoteURL,B(t)),method:`LOCK`,headers:a,data:gp(e.contactHref)},e,n),e),(function(t){return J(e,t),vp(t.text(),(function(e){let n=(a=e,new Cf({removeNSPrefix:!0,parseAttributeValue:!0,parseTagValue:!0}).parse(a)),r=Tf().get(n,`prop.lockdiscovery.activelock.locktoken.href`),i=Tf().get(n,`prop.lockdiscovery.activelock.timeout`);var a;if(!r)throw Ed(t,`No lock token received: `);return{token:r,serverTimeout:i}}))}))})),Sp=`Infinite, Second-4100000000`;function Cp(e,t,n){return n?t?t(e):e:(e&&e.then||(e=Promise.resolve(e)),t?e.then(t):e)}let wp=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{return Promise.resolve(e.apply(this,t))}catch(e){return Promise.reject(e)}}}((function(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=t.path||`/`;return Cp(U(W({url:V(e.remoteURL,n),method:`PROPFIND`,headers:{Accept:`text/plain,application/xml`,Depth:`0`}},e,t),e),(function(n){return J(e,n),Cp(n.text(),(function(r){return Cp(kf(r,e.parsing),(function(e){return Dd(n,function(e){try{let[t]=e.multistatus.response,{propstat:{prop:{"quota-used-bytes":n,"quota-available-bytes":r}}}=t;return n!==void 0&&r!==void 0?{used:parseInt(String(n),10),available:Mf(r)}:null}catch{}return null}(e),t.details)}))}))}))}));function Tp(e,t,n){return n?t?t(e):e:(e&&e.then||(e=Promise.resolve(e)),t?e.then(t):e)}let Ep=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{return Promise.resolve(e.apply(this,t))}catch(e){return Promise.reject(e)}}}((function(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},{details:r=!1}=n;return Tp(U(W({url:V(e.remoteURL,B(t)),method:`SEARCH`,headers:{Accept:`text/plain,application/xml`,"Content-Type":e.headers[`Content-Type`]||`application/xml; charset=utf-8`}},e,n),e),(function(n){return J(e,n),Tp(n.text(),(function(i){return Tp(kf(i,e.parsing),(function(e){return Dd(n,function(e,t,n){let r={truncated:!1,results:[]};return r.truncated=e.multistatus.response.some((e=>(e.status||e.propstat?.status).split(` `,3)?.[1]===`507`&&e.href.replace(/\/$/,``).endsWith(B(t).replace(/\/$/,``)))),e.multistatus.response.forEach((e=>{if(e.propstat===void 0)return;let t=e.href.split(`/`).map(decodeURIComponent).join(`/`);r.results.push(Af(e.propstat.prop,t,n))})),r}(e,t,r),r)}))}))}))})),Dp=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{return Promise.resolve(e.apply(this,t))}catch(e){return Promise.reject(e)}}}((function(e,t,n){let r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},i=W({url:V(e.remoteURL,B(t)),method:`MOVE`,headers:{Destination:V(e.remoteURL,B(n)),Overwrite:!1===r.overwrite?`F`:`T`}},e,r);return o=function(t){J(e,t)},(a=U(i,e))&&a.then||(a=Promise.resolve(a)),o?a.then(o):a;var a,o}));var Op=z(172);function kp(e){if(Mu(e))return e.byteLength;if(Nu(e))return e.length;if(typeof e==`string`)return(0,Op.d)(e);throw new $l({info:{code:_u.DataTypeNoLength}},`Cannot calculate data length: Invalid type`)}let Ap=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{return Promise.resolve(e.apply(this,t))}catch(e){return Promise.reject(e)}}}((function(e,t,n){let r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},{contentLength:i=!0,overwrite:a=!0}=r,o={"Content-Type":`application/octet-stream`};!1===i||(o[`Content-Length`]=typeof i==`number`?`${i}`:`${kp(n)}`),a||(o[`If-None-Match`]=`*`);let s=W({url:V(e.remoteURL,B(t)),method:`PUT`,headers:o,data:n},e,r);return l=function(t){try{J(e,t)}catch(e){let t=e;if(t.status!==412||a)throw t;return!1}return!0},(c=U(s,e))&&c.then||(c=Promise.resolve(c)),l?c.then(l):c;var c,l})),jp=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{return Promise.resolve(e.apply(this,t))}catch(e){return Promise.reject(e)}}}((function(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},r=W({url:V(e.remoteURL,B(t)),method:`OPTIONS`},e,n);return a=function(t){try{J(e,t)}catch(e){throw e}return{compliance:(t.headers.get(`DAV`)??``).split(`,`).map((e=>e.trim())),server:t.headers.get(`Server`)??``}},(i=U(r,e))&&i.then||(i=Promise.resolve(i)),a?i.then(a):i;var i,a}));function Mp(e,t,n){return n?t?t(e):e:(e&&e.then||(e=Promise.resolve(e)),t?e.then(t):e)}let Np=Ip((function(e,t,n,r,i){let a=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{};if(n>r||n<0)throw new $l({info:{code:_u.InvalidUpdateRange}},`Invalid update range ${n} for partial update`);let o={"Content-Type":`application/octet-stream`,"Content-Length":``+(r-n+1),"Content-Range":`bytes ${n}-${r}/*`};return Mp(U(W({url:V(e.remoteURL,B(t)),method:`PUT`,headers:o,data:i},e,a),e),(function(t){J(e,t)}))}));function Pp(e,t){var n=e();return n&&n.then?n.then(t):t(n)}let Fp=Ip((function(e,t,n,r,i){let a=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{};if(n>r||n<0)throw new $l({info:{code:_u.InvalidUpdateRange}},`Invalid update range ${n} for partial update`);let o={"Content-Type":`application/x-sabredav-partialupdate`,"Content-Length":``+(r-n+1),"X-Update-Range":`bytes=${n}-${r}`};return Mp(U(W({url:V(e.remoteURL,B(t)),method:`PATCH`,headers:o,data:i},e,a),e),(function(t){J(e,t)}))}));function Ip(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{return Promise.resolve(e.apply(this,t))}catch(e){return Promise.reject(e)}}}let Lp=Ip((function(e,t,n,r,i){let a=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{};return Mp(jp(e,t,a),(function(o){let s=!1;return Pp((function(){if(o.compliance.includes(`sabredav-partialupdate`))return Mp(Fp(e,t,n,r,i,a),(function(e){return s=!0,e}))}),(function(c){let l=!1;return s?c:Pp((function(){if(o.server.includes(`Apache`)&&o.compliance.includes(`<http://apache.org/dav/propset/fs/1>`))return Mp(Np(e,t,n,r,i,a),(function(e){return l=!0,e}))}),(function(e){if(l)return e;throw new $l({info:{code:_u.NotSupported}},`Not supported`)}))}))}))}));function Rp(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},{authType:n=null,remoteBasePath:r,contactHref:i=`https://github.com/perry-mitchell/webdav-client/blob/master/LOCK_CONTACT.md`,ha1:a,headers:o={},httpAgent:s,httpsAgent:c,password:l,token:u,username:d,withCredentials:f}=t,p=n;p||=d||l?H.Password:H.None;let m={authType:p,remoteBasePath:r,contactHref:i,ha1:a,headers:Object.assign({},o),httpAgent:s,httpsAgent:c,password:l,parsing:{attributeNamePrefix:t.attributeNamePrefix??`@`,attributeParsers:[],tagParsers:[Df]},remotePath:ou(e),remoteURL:e,token:u,username:d,withCredentials:f};return vu(m,d,l,u,a),{copyFile:(e,t,n)=>Od(m,e,t,n),createDirectory:(e,t)=>Uf(m,e,t),createReadStream:(e,t)=>function(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},r=new(Gf()).PassThrough;return Kf(e,t,n).then((e=>{e.pipe(r)})).catch((e=>{r.emit(`error`,e)})),r}(m,e,t),createWriteStream:(e,t,n)=>function(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:qf,i=new(Gf()).PassThrough,a={};return!1===n.overwrite&&(a[`If-None-Match`]=`*`),U(W({url:V(e.remoteURL,B(t)),method:`PUT`,headers:a,data:i,maxRedirects:0},e,n),e).then((t=>J(e,t))).then((e=>{setTimeout((()=>{r(e)}),0)})).catch((e=>{i.emit(`error`,e)})),i}(m,e,t,n),customRequest:(e,t)=>Jf(m,e,t),deleteFile:(e,t)=>Yf(m,e,t),exists:(e,t)=>Xf(m,e,t),getDirectoryContents:(e,t)=>Qf(m,e,t),getFileContents:(e,t)=>rp(m,e,t),getFileDownloadLink:e=>function(e,t){let n=V(e.remoteURL,B(t)),r=/^https:/i.test(n)?`https`:`http`;switch(e.authType){case H.None:break;case H.Password:{let t=pu(e.headers.Authorization.replace(/^Basic /i,``).trim());n=n.replace(/^https?:\/\//,`${r}://${t}@`);break}default:throw new $l({info:{code:_u.LinkUnsupportedAuthType}},`Unsupported auth type for file link: ${e.authType}`)}return n}(m,e),getFileUploadLink:e=>function(e,t){let n=`${V(e.remoteURL,B(t))}?Content-Type=application/octet-stream`,r=/^https:/i.test(n)?`https`:`http`;switch(e.authType){case H.None:break;case H.Password:{let t=pu(e.headers.Authorization.replace(/^Basic /i,``).trim());n=n.replace(/^https?:\/\//,`${r}://${t}@`);break}default:throw new $l({info:{code:_u.LinkUnsupportedAuthType}},`Unsupported auth type for file link: ${e.authType}`)}return n}(m,e),getHeaders:()=>Object.assign({},m.headers),getQuota:e=>wp(m,e),lock:(e,t)=>xp(m,e,t),moveFile:(e,t,n)=>Dp(m,e,t,n),putFileContents:(e,t,n)=>Ap(m,e,t,n),partialUpdateFileContents:(e,t,n,r,i)=>Lp(m,e,t,n,r,i),getDAVCompliance:e=>jp(m,e),search:(e,t)=>Ep(m,e,t),setHeaders:e=>{m.headers=Object.assign({},e)},stat:(e,t)=>Pf(m,e,t),unlock:(e,t,n)=>bp(m,e,t,n),registerAttributeParser:e=>{m.parsing.attributeParsers.push(e)},registerTagParser:e=>{m.parsing.tagParsers.push(e)}}}let $=[];for(let e=0;e<256;++e)$.push((e+256).toString(16).slice(1));function zp(e,t=0){return($[e[t+0]]+$[e[t+1]]+$[e[t+2]]+$[e[t+3]]+`-`+$[e[t+4]]+$[e[t+5]]+`-`+$[e[t+6]]+$[e[t+7]]+`-`+$[e[t+8]]+$[e[t+9]]+`-`+$[e[t+10]]+$[e[t+11]]+$[e[t+12]]+$[e[t+13]]+$[e[t+14]]+$[e[t+15]]).toLowerCase()}let Bp,Vp=new Uint8Array(16);function Hp(){if(!Bp){if(typeof crypto>`u`||!crypto.getRandomValues)throw Error(`crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported`);Bp=crypto.getRandomValues.bind(crypto)}return Bp(Vp)}var Up={randomUUID:typeof crypto<`u`&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function Wp(e,t,n){e||={};let r=e.random??e.rng?.()??Hp();if(r.length<16)throw Error(`Random bytes length must be >= 16`);if(r[6]=r[6]&15|64,r[8]=r[8]&63|128,t){if(n||=0,n<0||n+16>t.length)throw RangeError(`UUID byte range ${n}:${n+15} is out of buffer bounds`);for(let e=0;e<16;++e)t[n+e]=r[e];return t}return zp(r)}function Gp(e,t,n){return Up.randomUUID&&!t&&!e?Up.randomUUID():Wp(e,t,n)}let Kp=(e,t)=>Object.fromEntries(Object.entries(e).map(([e,n])=>t.includes(e)?[e,n||``]:[tr.DavNamespace.includes(e)?`d:${e}`:`oc:${e}`,n||``])),qp=(e=[],{pattern:t,filterRules:n,limit:r=0,extraProps:i=[]})=>{let a=`d:propfind`;t&&(a=`oc:search-files`),n&&(a=`oc:filter-files`);let o=Kp(e.reduce((e,t)=>Object.assign(e,{[t]:null}),{}),i),s={[a]:{"d:prop":o,"@@xmlns:d":`DAV:`,"@@xmlns:oc":`http://owncloud.org/ns`,...t&&{"oc:search":{"oc:pattern":t,"oc:limit":r}},...n&&{"oc:filter-rules":Kp(n,[])}}};return new Ol({format:!0,ignoreAttributes:!1,attributeNamePrefix:`@@`,suppressEmptyNode:!0}).build(s)},Jp=e=>{let t={"d:propertyupdate":{"d:set":{"d:prop":Kp(e,[])},"@@xmlns:d":`DAV:`,"@@xmlns:oc":`http://owncloud.org/ns`}};return new Ol({format:!0,ignoreAttributes:!1,attributeNamePrefix:`@@`,suppressEmptyNode:!0}).build(t)},Yp=e=>{let t={},n=e.get(`tus-version`);return n?(t.version=n.split(`,`),e.get(`tus-extension`)&&(t.extension=e.get(`tus-extension`).split(`,`)),e.get(`tus-resumable`)&&(t.resumable=e.get(`tus-resumable`)),e.get(`tus-max-size`)&&(t.maxSize=parseInt(e.get(`tus-max-size`),10)),t):null},Xp=async e=>{let t=e=>{let t=decodeURIComponent(e);return e?.startsWith(`/remote.php/dav/`)?A(t.replace(`/remote.php/dav/`,``),{leadingSlash:!0,trailingSlash:!1}):t};return(await kf(e)).multistatus.response.map(({href:e,propstat:n})=>{let r={...Af(n.prop,t(e),!0),processing:n.status===`HTTP/1.1 425 TOO EARLY`};return r.props.name&&(r.props.name=r.props.name.toString()),r})},Zp=e=>{let t=new pl,n={message:`Unknown error`,errorCode:void 0};try{let r=t.parse(e);if(!r[`d:error`])return n;if(r[`d:error`][`s:message`]){let e=r[`d:error`][`s:message`];typeof e==`string`&&(n.message=e)}if(r[`d:error`][`s:errorcode`]){let e=r[`d:error`][`s:errorcode`];typeof e==`string`&&(n.errorCode=e)}}catch{return n}return n};var Qp=class{client;davPath;headers;extraProps;constructor({baseUrl:e,headers:t}){this.davPath=A(e,`remote.php/dav`),this.client=Rp(this.davPath,{}),this.headers=t,this.extraProps=[]}mkcol(e,t={}){return this.request(e,{method:Xn.mkcol,...t})}async propfind(e,{depth:t=1,properties:n=[],headers:r={},...i}={}){let a={...r,Depth:t.toString()},{body:o,result:s}=await this.request(e,{method:Xn.propfind,data:qp(n,{extraProps:this.extraProps}),headers:a,...i});return o?.length&&(o[0].tusSupport=Yp(s.headers)),o}async report(e,{pattern:t=``,filterRules:n=null,limit:r=30,properties:i,...a}={}){let{body:o,result:s}=await this.request(e,{method:Xn.report,data:qp(i,{pattern:t,filterRules:n,limit:r,extraProps:this.extraProps}),...a});return{results:o,range:s.headers.get(`content-range`)}}copy(e,t,{overwrite:n=!1,headers:r={},...i}={}){let a=A(this.davPath,Bn(t));return this.request(e,{method:Xn.copy,headers:{...r,Destination:a,overwrite:n?`T`:`F`},...i})}move(e,t,{overwrite:n=!1,headers:r={},...i}={}){let a=A(this.davPath,Bn(t));return this.request(e,{method:Xn.move,headers:{...r,Destination:a,overwrite:n?`T`:`F`},...i})}put(e,t,{headers:n={},onUploadProgress:r,previousEntityTag:i,overwrite:a,...o}={}){let s={...n};return i?s[`If-Match`]=i:a||(s[`If-None-Match`]=`*`),this.request(e,{method:Xn.put,data:t,headers:s,onUploadProgress:r,...o})}delete(e,t={}){return this.request(e,{method:Xn.delete,...t})}propPatch(e,t,n={}){let r=Jp(t);return this.request(e,{method:Xn.proppatch,data:r,...n})}getFileUrl(e){return A(this.davPath,Bn(e))}buildHeaders(e={}){return{"Content-Type":`application/xml; charset=utf-8`,"X-Requested-With":`XMLHttpRequest`,"X-Request-ID":Gp(),...this.headers&&{...this.headers()},...e}}async request(e,t){let n=A(this.davPath,Bn(e),{leadingSlash:!0}),r={...t,url:n,headers:this.buildHeaders(t.headers||{})};try{let e=await this.client.customRequest(``,r),t;return e.status===207&&(t=await Xp(await e.text())),{body:t,status:e.status,result:e}}catch(e){let{response:t}=e,n=Zp(await t.text());throw new Kn(n.message,n.errorCode,t,t.status)}}};let $p=(e,t)=>({async listFileVersions(t,n={}){let[r,...i]=await e.propfind(A(`meta`,t,`v`,{leadingSlash:!0}),n);return i.map(t=>Jo(t,e.extraProps))}}),em=(e,t)=>({setFavorite(t,{path:n},r,i={}){let a={[M.IsFavorite]:r?`true`:`false`};return e.propPatch(A(t.webDavPath,n),a,i)}}),tm=(e,t)=>{let n=k.create();t&&n.interceptors.request.use(e=>(Object.assign(e.headers,t()),e));let r={axiosClient:n,baseUrl:e,headers:t},i=new Qp({baseUrl:e,headers:t}),a=e=>{i.extraProps.push(e)},o=Kl(i,r),{getPathForFileId:s}=o,c=Rl(i,o,r),{listFiles:l}=c,u=Fl(c,r),{getFileInfo:d}=u,{createFolder:f}=Nl(i,u,r),p=Pl(i,r),{getFileContents:m}=p,{putFileContents:h}=Bl(i,u,r),{getFileUrl:g,revokeUrl:_}=Il(i,p,u,r),{getPublicFileUrl:v}=Ll(i,r),{copyFiles:y}=Ml(i,r),{moveFiles:ee}=zl(i,r),{deleteFile:b}=Vl(i,r),{restoreFile:x}=Hl(i,r),{listFileVersions:S}=$p(i,r),{restoreFileVersion:C}=Ul(i,r),{clearTrashBin:te}=Wl(i,r),{search:ne}=Gl(i,r),{setFavorite:re}=em(i,r);return{copyFiles:y,createFolder:f,deleteFile:b,restoreFile:x,restoreFileVersion:C,getFileContents:m,getFileInfo:d,getFileUrl:g,getPublicFileUrl:v,getPathForFileId:s,listFiles:l,listFileVersions:S,moveFiles:ee,putFileContents:h,revokeUrl:_,clearTrashBin:te,search:ne,setFavorite:re,registerExtraProp:a}},nm=function(e){return e[e.COPY=0]=`COPY`,e[e.MOVE=1]=`MOVE`,e}({}),rm;self.onmessage=async e=>{let{topic:t,data:n}=JSON.parse(e.data);if(t===`tokenUpdate`&&rm){rm.Authorization?.toString().startsWith(`Bearer`)&&(rm.Authorization=n.accessToken);return}let{baseUrl:r,headers:i,transferData:a}=n;rm=i;let o=tm(r,()=>rm),s=[],c=[],l=new g({concurrency:4}),u=e=>o.copyFiles(e.sourceSpace,e.resource,e.targetSpace,{path:e.path},{overwrite:e.overwrite}),d=e=>o.moveFiles(e.sourceSpace,e.resource,e.targetSpace,{path:e.path},{overwrite:e.overwrite}),f=a.map(e=>l.add(async()=>{let t=e.resource;try{e.transferType===nm.COPY?(await u(e),t.id=void 0,t.fileId=void 0):await d(e),t.path=(0,zn.join)(e.targetFolder.path,t.name),t.webDavPath=(0,zn.join)(e.targetFolder.webDavPath,t.name),s.push(t)}catch(e){console.error(e),c.push({resourceName:t.name,message:e.message,statusCode:e.statusCode,xReqId:e.response.headers?.get(`x-request-id`)})}}));await Promise.allSettled(f),postMessage(JSON.stringify({successful:s,failed:c}))}})();
|