needle-cloud 0.0.1-alpha.25 → 0.1.0-alpha.1

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.
@@ -0,0 +1 @@
1
+ export * from "./web/index.js";
@@ -0,0 +1,2 @@
1
+ function e(e){var t={authorization:"Bearer "+e.authToken};return e.org&&(t["x-needle-cloud-org"]=e.org),e.roles&&(t.roles=e.roles.join(",")),e.roles_org&&(t.roles_org=e.roles_org.join(",")),t}function t(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function n(e,n){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(r)return(r=r.call(e)).next.bind(r);if(Array.isArray(e)||(r=function(e,n){if(e){if("string"==typeof e)return t(e,n);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?t(e,n):void 0}}(e))||n&&e&&"number"==typeof e.length){r&&(e=r);var o=0;return function(){return o>=e.length?{done:!0}:{done:!1,value:e[o++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function r(){return r=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},r.apply(null,arguments)}function o(e,t){return o=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},o(e,t)}function i(){i=function(e,t){return new n(e,void 0,t)};var e=RegExp.prototype,t=new WeakMap;function n(e,r,i){var s=RegExp(e,r);return t.set(s,i||t.get(e)),o(s,n.prototype)}function r(e,n){var r=t.get(n);return Object.keys(r).reduce(function(t,n){var o=r[n];if("number"==typeof o)t[n]=e[o];else{for(var i=0;void 0===e[o[i]]&&i+1<o.length;)i++;t[n]=e[o[i]]}return t},Object.create(null))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&o(e,t)}(n,RegExp),n.prototype.exec=function(t){var n=e.exec.call(this,t);if(n){n.groups=r(n,this);var o=n.indices;o&&(o.groups=r(o,this))}return n},n.prototype[Symbol.replace]=function(n,o){if("string"==typeof o){var i=t.get(this);return e[Symbol.replace].call(this,n,o.replace(/\$<([^>]+)>/g,function(e,t){var n=i[t];return"$"+(Array.isArray(n)?n.join("$"):n)}))}if("function"==typeof o){var s=this;return e[Symbol.replace].call(this,n,function(){var e=arguments;return"object"!=typeof e[e.length-1]&&(e=[].slice.call(e)).push(r(e,s)),o.apply(this,e)})}return e[Symbol.replace].call(this,n,o)},i.apply(this,arguments)}function s(e,t){return function(){return e.apply(t,arguments)}}const{toString:a}=Object.prototype,{getPrototypeOf:l}=Object,u=(c=Object.create(null),e=>{const t=a.call(e);return c[t]||(c[t]=t.slice(8,-1).toLowerCase())});var c;const f=e=>(e=e.toLowerCase(),t=>u(t)===e),d=e=>t=>typeof t===e,{isArray:h}=Array,p=d("undefined"),m=f("ArrayBuffer"),g=d("string"),y=d("function"),v=d("number"),b=e=>null!==e&&"object"==typeof e,w=e=>{if("object"!==u(e))return!1;const t=l(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||Symbol.toStringTag in e||Symbol.iterator in e)},S=f("Date"),E=f("File"),x=f("Blob"),T=f("FileList"),R=f("URLSearchParams"),[O,A,P,_]=["ReadableStream","Request","Response","Headers"].map(f);function j(e,t,{allOwnKeys:n=!1}={}){if(null==e)return;let r,o;if("object"!=typeof e&&(e=[e]),h(e))for(r=0,o=e.length;r<o;r++)t.call(null,e[r],r,e);else{const o=n?Object.getOwnPropertyNames(e):Object.keys(e),i=o.length;let s;for(r=0;r<i;r++)s=o[r],t.call(null,e[s],s,e)}}function U(e,t){t=t.toLowerCase();const n=Object.keys(e);let r,o=n.length;for(;o-- >0;)if(r=n[o],t===r.toLowerCase())return r;return null}const F="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,C=e=>!p(e)&&e!==F,N=(k="undefined"!=typeof Uint8Array&&l(Uint8Array),e=>k&&e instanceof k);var k;const B=f("HTMLFormElement"),z=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),L=f("RegExp"),D=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};j(n,(n,o)=>{let i;!1!==(i=t(n,o,e))&&(r[o]=i||n)}),Object.defineProperties(e,r)},M="abcdefghijklmnopqrstuvwxyz",W="0123456789",I={DIGIT:W,ALPHA:M,ALPHA_DIGIT:M+M.toUpperCase()+W},q=f("AsyncFunction"),J=(H="function"==typeof setImmediate,K=y(F.postMessage),H?setImmediate:K?(V=`axios@${Math.random()}`,$=[],F.addEventListener("message",({source:e,data:t})=>{e===F&&t===V&&$.length&&$.shift()()},!1),e=>{$.push(e),F.postMessage(V,"*")}):e=>setTimeout(e));var H,K,V,$;const G="undefined"!=typeof queueMicrotask?queueMicrotask.bind(F):"undefined"!=typeof process&&process.nextTick||J;var X={isArray:h,isArrayBuffer:m,isBuffer:function(e){return null!==e&&!p(e)&&null!==e.constructor&&!p(e.constructor)&&y(e.constructor.isBuffer)&&e.constructor.isBuffer(e)},isFormData:e=>{let t;return e&&("function"==typeof FormData&&e instanceof FormData||y(e.append)&&("formdata"===(t=u(e))||"object"===t&&y(e.toString)&&"[object FormData]"===e.toString()))},isArrayBufferView:function(e){let t;return t="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&m(e.buffer),t},isString:g,isNumber:v,isBoolean:e=>!0===e||!1===e,isObject:b,isPlainObject:w,isReadableStream:O,isRequest:A,isResponse:P,isHeaders:_,isUndefined:p,isDate:S,isFile:E,isBlob:x,isRegExp:L,isFunction:y,isStream:e=>b(e)&&y(e.pipe),isURLSearchParams:R,isTypedArray:N,isFileList:T,forEach:j,merge:function e(){const{caseless:t}=C(this)&&this||{},n={},r=(r,o)=>{const i=t&&U(n,o)||o;n[i]=w(n[i])&&w(r)?e(n[i],r):w(r)?e({},r):h(r)?r.slice():r};for(let e=0,t=arguments.length;e<t;e++)arguments[e]&&j(arguments[e],r);return n},extend:(e,t,n,{allOwnKeys:r}={})=>(j(t,(t,r)=>{e[r]=n&&y(t)?s(t,n):t},{allOwnKeys:r}),e),trim:e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:e=>(65279===e.charCodeAt(0)&&(e=e.slice(1)),e),inherits:(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},toFlatObject:(e,t,n,r)=>{let o,i,s;const a={};if(t=t||{},null==e)return t;do{for(o=Object.getOwnPropertyNames(e),i=o.length;i-- >0;)s=o[i],r&&!r(s,e,t)||a[s]||(t[s]=e[s],a[s]=!0);e=!1!==n&&l(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},kindOf:u,kindOfTest:f,endsWith:(e,t,n)=>{e=String(e),(void 0===n||n>e.length)&&(n=e.length);const r=e.indexOf(t,n-=t.length);return-1!==r&&r===n},toArray:e=>{if(!e)return null;if(h(e))return e;let t=e.length;if(!v(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},forEachEntry:(e,t)=>{const n=(e&&e[Symbol.iterator]).call(e);let r;for(;(r=n.next())&&!r.done;){const n=r.value;t.call(e,n[0],n[1])}},matchAll:(e,t)=>{let n;const r=[];for(;null!==(n=e.exec(t));)r.push(n);return r},isHTMLForm:B,hasOwnProperty:z,hasOwnProp:z,reduceDescriptors:D,freezeMethods:e=>{D(e,(t,n)=>{if(y(e)&&-1!==["arguments","caller","callee"].indexOf(n))return!1;y(e[n])&&(t.enumerable=!1,"writable"in t?t.writable=!1:t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")}))})},toObjectSet:(e,t)=>{const n={},r=e=>{e.forEach(e=>{n[e]=!0})};return h(e)?r(e):r(String(e).split(t)),n},toCamelCase:e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(e,t,n){return t.toUpperCase()+n}),noop:()=>{},toFiniteNumber:(e,t)=>null!=e&&Number.isFinite(e=+e)?e:t,findKey:U,global:F,isContextDefined:C,ALPHABET:I,generateString:(e=16,t=I.ALPHA_DIGIT)=>{let n="";const{length:r}=t;for(;e--;)n+=t[Math.random()*r|0];return n},isSpecCompliantForm:function(e){return!!(e&&y(e.append)&&"FormData"===e[Symbol.toStringTag]&&e[Symbol.iterator])},toJSONObject:e=>{const t=new Array(10),n=(e,r)=>{if(b(e)){if(t.indexOf(e)>=0)return;if(!("toJSON"in e)){t[r]=e;const o=h(e)?[]:{};return j(e,(e,t)=>{const i=n(e,r+1);!p(i)&&(o[t]=i)}),t[r]=void 0,o}}return e};return n(e,0)},isAsyncFn:q,isThenable:e=>e&&(b(e)||y(e))&&y(e.then)&&y(e.catch),setImmediate:J,asap:G};function Q(e,t,n,r,o){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),o&&(this.response=o)}X.inherits(Q,Error,{toJSON:function(){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:X.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const Y=Q.prototype,Z={};function ee(e){return X.isPlainObject(e)||X.isArray(e)}function te(e){return X.endsWith(e,"[]")?e.slice(0,-2):e}function ne(e,t,n){return e?e.concat(t).map(function(e,t){return e=te(e),!n&&t?"["+e+"]":e}).join(n?".":""):t}["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{Z[e]={value:e}}),Object.defineProperties(Q,Z),Object.defineProperty(Y,"isAxiosError",{value:!0}),Q.from=(e,t,n,r,o,i)=>{const s=Object.create(Y);return X.toFlatObject(e,s,function(e){return e!==Error.prototype},e=>"isAxiosError"!==e),Q.call(s,e.message,t,n,r,o),s.cause=e,s.name=e.name,i&&Object.assign(s,i),s};const re=X.toFlatObject(X,{},null,function(e){return/^is[A-Z]/.test(e)});function oe(e,t,n){if(!X.isObject(e))throw new TypeError("target must be an object");t=t||new FormData;const r=(n=X.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(e,t){return!X.isUndefined(t[e])})).metaTokens,o=n.visitor||u,i=n.dots,s=n.indexes,a=(n.Blob||"undefined"!=typeof Blob&&Blob)&&X.isSpecCompliantForm(t);if(!X.isFunction(o))throw new TypeError("visitor must be a function");function l(e){if(null===e)return"";if(X.isDate(e))return e.toISOString();if(!a&&X.isBlob(e))throw new Q("Blob is not supported. Use a Buffer instead.");return X.isArrayBuffer(e)||X.isTypedArray(e)?a&&"function"==typeof Blob?new Blob([e]):Buffer.from(e):e}function u(e,n,o){let a=e;if(e&&!o&&"object"==typeof e)if(X.endsWith(n,"{}"))n=r?n:n.slice(0,-2),e=JSON.stringify(e);else if(X.isArray(e)&&function(e){return X.isArray(e)&&!e.some(ee)}(e)||(X.isFileList(e)||X.endsWith(n,"[]"))&&(a=X.toArray(e)))return n=te(n),a.forEach(function(e,r){!X.isUndefined(e)&&null!==e&&t.append(!0===s?ne([n],r,i):null===s?n:n+"[]",l(e))}),!1;return!!ee(e)||(t.append(ne(o,n,i),l(e)),!1)}const c=[],f=Object.assign(re,{defaultVisitor:u,convertValue:l,isVisitable:ee});if(!X.isObject(e))throw new TypeError("data must be an object");return function e(n,r){if(!X.isUndefined(n)){if(-1!==c.indexOf(n))throw Error("Circular reference detected in "+r.join("."));c.push(n),X.forEach(n,function(n,i){!0===(!(X.isUndefined(n)||null===n)&&o.call(t,n,X.isString(i)?i.trim():i,r,f))&&e(n,r?r.concat(i):[i])}),c.pop()}}(e),t}function ie(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(e){return t[e]})}function se(e,t){this._pairs=[],e&&oe(e,this,t)}const ae=se.prototype;function le(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function ue(e,t,n){if(!t)return e;const r=n&&n.encode||le,o=n&&n.serialize;let i;if(i=o?o(t,n):X.isURLSearchParams(t)?t.toString():new se(t,n).toString(r),i){const t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+i}return e}ae.append=function(e,t){this._pairs.push([e,t])},ae.toString=function(e){const t=e?function(t){return e.call(this,t,ie)}:ie;return this._pairs.map(function(e){return t(e[0])+"="+t(e[1])},"").join("&")};var ce=class{constructor(){this.handlers=[]}use(e,t,n){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!n&&n.synchronous,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){X.forEach(this.handlers,function(t){null!==t&&e(t)})}},fe={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},de={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:se,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},protocols:["http","https","file","blob","url","data"]};const he="undefined"!=typeof window&&"undefined"!=typeof document,pe=(me="undefined"!=typeof navigator&&navigator.product,he&&["ReactNative","NativeScript","NS"].indexOf(me)<0);var me,ge={__proto__:null,hasBrowserEnv:he,hasStandardBrowserWebWorkerEnv:"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,hasStandardBrowserEnv:pe,origin:he&&window.location.href||"http://localhost",...de};function ye(e){function t(e,n,r,o){let i=e[o++];if("__proto__"===i)return!0;const s=Number.isFinite(+i),a=o>=e.length;return i=!i&&X.isArray(r)?r.length:i,a?(r[i]=X.hasOwnProp(r,i)?[r[i],n]:n,!s):(r[i]&&X.isObject(r[i])||(r[i]=[]),t(e,n,r[i],o)&&X.isArray(r[i])&&(r[i]=function(e){const t={},n=Object.keys(e);let r;const o=n.length;let i;for(r=0;r<o;r++)i=n[r],t[i]=e[i];return t}(r[i])),!s)}if(X.isFormData(e)&&X.isFunction(e.entries)){const n={};return X.forEachEntry(e,(e,r)=>{t(function(e){return X.matchAll(/\w+|\[(\w*)]/g,e).map(e=>"[]"===e[0]?"":e[1]||e[0])}(e),r,n,0)}),n}return null}const ve={transitional:fe,adapter:["xhr","http","fetch"],transformRequest:[function(e,t){const n=t.getContentType()||"",r=n.indexOf("application/json")>-1,o=X.isObject(e);if(o&&X.isHTMLForm(e)&&(e=new FormData(e)),X.isFormData(e))return r?JSON.stringify(ye(e)):e;if(X.isArrayBuffer(e)||X.isBuffer(e)||X.isStream(e)||X.isFile(e)||X.isBlob(e)||X.isReadableStream(e))return e;if(X.isArrayBufferView(e))return e.buffer;if(X.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let i;if(o){if(n.indexOf("application/x-www-form-urlencoded")>-1)return function(e,t){return oe(e,new ge.classes.URLSearchParams,Object.assign({visitor:function(e,t,n,r){return ge.isNode&&X.isBuffer(e)?(this.append(t,e.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)}},t))}(e,this.formSerializer).toString();if((i=X.isFileList(e))||n.indexOf("multipart/form-data")>-1){const t=this.env&&this.env.FormData;return oe(i?{"files[]":e}:e,t&&new t,this.formSerializer)}}return o||r?(t.setContentType("application/json",!1),function(e,t,n){if(X.isString(e))try{return(0,JSON.parse)(e),X.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(0,JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){const t=this.transitional||ve.transitional,n=t&&t.forcedJSONParsing,r="json"===this.responseType;if(X.isResponse(e)||X.isReadableStream(e))return e;if(e&&X.isString(e)&&(n&&!this.responseType||r)){const n=!(t&&t.silentJSONParsing)&&r;try{return JSON.parse(e)}catch(e){if(n){if("SyntaxError"===e.name)throw Q.from(e,Q.ERR_BAD_RESPONSE,this,null,this.response);throw e}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:ge.classes.FormData,Blob:ge.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};X.forEach(["delete","get","head","post","put","patch"],e=>{ve.headers[e]={}});var be=ve;const we=X.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"]),Se=Symbol("internals");function Ee(e){return e&&String(e).trim().toLowerCase()}function xe(e){return!1===e||null==e?e:X.isArray(e)?e.map(xe):String(e)}function Te(e,t,n,r,o){return X.isFunction(r)?r.call(this,t,n):(o&&(t=n),X.isString(t)?X.isString(r)?-1!==t.indexOf(r):X.isRegExp(r)?r.test(t):void 0:void 0)}class Re{constructor(e){e&&this.set(e)}set(e,t,n){const r=this;function o(e,t,n){const o=Ee(t);if(!o)throw new Error("header name must be a non-empty string");const i=X.findKey(r,o);(!i||void 0===r[i]||!0===n||void 0===n&&!1!==r[i])&&(r[i||t]=xe(e))}const i=(e,t)=>X.forEach(e,(e,n)=>o(e,n,t));if(X.isPlainObject(e)||e instanceof this.constructor)i(e,t);else if(X.isString(e)&&(e=e.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim()))i((e=>{const t={};let n,r,o;return e&&e.split("\n").forEach(function(e){o=e.indexOf(":"),n=e.substring(0,o).trim().toLowerCase(),r=e.substring(o+1).trim(),!n||t[n]&&we[n]||("set-cookie"===n?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)}),t})(e),t);else if(X.isHeaders(e))for(const[t,r]of e.entries())o(r,t,n);else null!=e&&o(t,e,n);return this}get(e,t){if(e=Ee(e)){const n=X.findKey(this,e);if(n){const e=this[n];if(!t)return e;if(!0===t)return function(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}(e);if(X.isFunction(t))return t.call(this,e,n);if(X.isRegExp(t))return t.exec(e);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=Ee(e)){const n=X.findKey(this,e);return!(!n||void 0===this[n]||t&&!Te(0,this[n],n,t))}return!1}delete(e,t){const n=this;let r=!1;function o(e){if(e=Ee(e)){const o=X.findKey(n,e);!o||t&&!Te(0,n[o],o,t)||(delete n[o],r=!0)}}return X.isArray(e)?e.forEach(o):o(e),r}clear(e){const t=Object.keys(this);let n=t.length,r=!1;for(;n--;){const o=t[n];e&&!Te(0,this[o],o,e,!0)||(delete this[o],r=!0)}return r}normalize(e){const t=this,n={};return X.forEach(this,(r,o)=>{const i=X.findKey(n,o);if(i)return t[i]=xe(r),void delete t[o];const s=e?function(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,t,n)=>t.toUpperCase()+n)}(o):String(o).trim();s!==o&&delete t[o],t[s]=xe(r),n[s]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return X.forEach(this,(n,r)=>{null!=n&&!1!==n&&(t[r]=e&&X.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("\n")}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){const n=new this(e);return t.forEach(e=>n.set(e)),n}static accessor(e){const t=(this[Se]=this[Se]={accessors:{}}).accessors,n=this.prototype;function r(e){const r=Ee(e);t[r]||(function(e,t){const n=X.toCamelCase(" "+t);["get","set","has"].forEach(r=>{Object.defineProperty(e,r+n,{value:function(e,n,o){return this[r].call(this,t,e,n,o)},configurable:!0})})}(n,e),t[r]=!0)}return X.isArray(e)?e.forEach(r):r(e),this}}Re.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),X.reduceDescriptors(Re.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(e){this[n]=e}}}),X.freezeMethods(Re);var Oe=Re;function Ae(e,t){const n=this||be,r=t||n,o=Oe.from(r.headers);let i=r.data;return X.forEach(e,function(e){i=e.call(n,i,o.normalize(),t?t.status:void 0)}),o.normalize(),i}function Pe(e){return!(!e||!e.__CANCEL__)}function _e(e,t,n){Q.call(this,null==e?"canceled":e,Q.ERR_CANCELED,t,n),this.name="CanceledError"}function je(e,t,n){const r=n.config.validateStatus;n.status&&r&&!r(n.status)?t(new Q("Request failed with status code "+n.status,[Q.ERR_BAD_REQUEST,Q.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n)):e(n)}X.inherits(_e,Q,{__CANCEL__:!0});const Ue=(e,t,n=3)=>{let r=0;const o=function(e,t){e=e||10;const n=new Array(e),r=new Array(e);let o,i=0,s=0;return t=void 0!==t?t:1e3,function(a){const l=Date.now(),u=r[s];o||(o=l),n[i]=a,r[i]=l;let c=s,f=0;for(;c!==i;)f+=n[c++],c%=e;if(i=(i+1)%e,i===s&&(s=(s+1)%e),l-o<t)return;const d=u&&l-u;return d?Math.round(1e3*f/d):void 0}}(50,250);return function(e,t){let n,r,o=0,i=1e3/t;const s=(t,i=Date.now())=>{o=i,n=null,r&&(clearTimeout(r),r=null),e.apply(null,t)};return[(...e)=>{const t=Date.now(),a=t-o;a>=i?s(e,t):(n=e,r||(r=setTimeout(()=>{r=null,s(n)},i-a)))},()=>n&&s(n)]}(n=>{const i=n.loaded,s=n.lengthComputable?n.total:void 0,a=i-r,l=o(a);r=i,e({loaded:i,total:s,progress:s?i/s:void 0,bytes:a,rate:l||void 0,estimated:l&&s&&i<=s?(s-i)/l:void 0,event:n,lengthComputable:null!=s,[t?"download":"upload"]:!0})},n)},Fe=(e,t)=>{const n=null!=e;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},Ce=e=>(...t)=>X.asap(()=>e(...t));var Ne=ge.hasStandardBrowserEnv?function(){const e=/(msie|trident)/i.test(navigator.userAgent),t=document.createElement("a");let n;function r(n){let r=n;return e&&(t.setAttribute("href",r),r=t.href),t.setAttribute("href",r),{href:t.href,protocol:t.protocol?t.protocol.replace(/:$/,""):"",host:t.host,search:t.search?t.search.replace(/^\?/,""):"",hash:t.hash?t.hash.replace(/^#/,""):"",hostname:t.hostname,port:t.port,pathname:"/"===t.pathname.charAt(0)?t.pathname:"/"+t.pathname}}return n=r(window.location.href),function(e){const t=X.isString(e)?r(e):e;return t.protocol===n.protocol&&t.host===n.host}}():function(){return!0},ke=ge.hasStandardBrowserEnv?{write(e,t,n,r,o,i){const s=[e+"="+encodeURIComponent(t)];X.isNumber(n)&&s.push("expires="+new Date(n).toGMTString()),X.isString(r)&&s.push("path="+r),X.isString(o)&&s.push("domain="+o),!0===i&&s.push("secure"),document.cookie=s.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read:()=>null,remove(){}};function Be(e,t){return e&&!/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)?function(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}(e,t):t}const ze=e=>e instanceof Oe?{...e}:e;function Le(e,t){t=t||{};const n={};function r(e,t,n){return X.isPlainObject(e)&&X.isPlainObject(t)?X.merge.call({caseless:n},e,t):X.isPlainObject(t)?X.merge({},t):X.isArray(t)?t.slice():t}function o(e,t,n){return X.isUndefined(t)?X.isUndefined(e)?void 0:r(void 0,e,n):r(e,t,n)}function i(e,t){if(!X.isUndefined(t))return r(void 0,t)}function s(e,t){return X.isUndefined(t)?X.isUndefined(e)?void 0:r(void 0,e):r(void 0,t)}function a(n,o,i){return i in t?r(n,o):i in e?r(void 0,n):void 0}const l={url:i,method:i,data:i,baseURL:s,transformRequest:s,transformResponse:s,paramsSerializer:s,timeout:s,timeoutMessage:s,withCredentials:s,withXSRFToken:s,adapter:s,responseType:s,xsrfCookieName:s,xsrfHeaderName:s,onUploadProgress:s,onDownloadProgress:s,decompress:s,maxContentLength:s,maxBodyLength:s,beforeRedirect:s,transport:s,httpAgent:s,httpsAgent:s,cancelToken:s,socketPath:s,responseEncoding:s,validateStatus:a,headers:(e,t)=>o(ze(e),ze(t),!0)};return X.forEach(Object.keys(Object.assign({},e,t)),function(r){const i=l[r]||o,s=i(e[r],t[r],r);X.isUndefined(s)&&i!==a||(n[r]=s)}),n}var De=e=>{const t=Le({},e);let n,{data:r,withXSRFToken:o,xsrfHeaderName:i,xsrfCookieName:s,headers:a,auth:l}=t;if(t.headers=a=Oe.from(a),t.url=ue(Be(t.baseURL,t.url),e.params,e.paramsSerializer),l&&a.set("Authorization","Basic "+btoa((l.username||"")+":"+(l.password?unescape(encodeURIComponent(l.password)):""))),X.isFormData(r))if(ge.hasStandardBrowserEnv||ge.hasStandardBrowserWebWorkerEnv)a.setContentType(void 0);else if(!1!==(n=a.getContentType())){const[e,...t]=n?n.split(";").map(e=>e.trim()).filter(Boolean):[];a.setContentType([e||"multipart/form-data",...t].join("; "))}if(ge.hasStandardBrowserEnv&&(o&&X.isFunction(o)&&(o=o(t)),o||!1!==o&&Ne(t.url))){const e=i&&s&&ke.read(s);e&&a.set(i,e)}return t},Me="undefined"!=typeof XMLHttpRequest&&function(e){return new Promise(function(t,n){const r=De(e);let o=r.data;const i=Oe.from(r.headers).normalize();let s,a,l,u,c,{responseType:f,onUploadProgress:d,onDownloadProgress:h}=r;function p(){u&&u(),c&&c(),r.cancelToken&&r.cancelToken.unsubscribe(s),r.signal&&r.signal.removeEventListener("abort",s)}let m=new XMLHttpRequest;function g(){if(!m)return;const r=Oe.from("getAllResponseHeaders"in m&&m.getAllResponseHeaders());je(function(e){t(e),p()},function(e){n(e),p()},{data:f&&"text"!==f&&"json"!==f?m.response:m.responseText,status:m.status,statusText:m.statusText,headers:r,config:e,request:m}),m=null}m.open(r.method.toUpperCase(),r.url,!0),m.timeout=r.timeout,"onloadend"in m?m.onloadend=g:m.onreadystatechange=function(){m&&4===m.readyState&&(0!==m.status||m.responseURL&&0===m.responseURL.indexOf("file:"))&&setTimeout(g)},m.onabort=function(){m&&(n(new Q("Request aborted",Q.ECONNABORTED,e,m)),m=null)},m.onerror=function(){n(new Q("Network Error",Q.ERR_NETWORK,e,m)),m=null},m.ontimeout=function(){let t=r.timeout?"timeout of "+r.timeout+"ms exceeded":"timeout exceeded";r.timeoutErrorMessage&&(t=r.timeoutErrorMessage),n(new Q(t,(r.transitional||fe).clarifyTimeoutError?Q.ETIMEDOUT:Q.ECONNABORTED,e,m)),m=null},void 0===o&&i.setContentType(null),"setRequestHeader"in m&&X.forEach(i.toJSON(),function(e,t){m.setRequestHeader(t,e)}),X.isUndefined(r.withCredentials)||(m.withCredentials=!!r.withCredentials),f&&"json"!==f&&(m.responseType=r.responseType),h&&([l,c]=Ue(h,!0),m.addEventListener("progress",l)),d&&m.upload&&([a,u]=Ue(d),m.upload.addEventListener("progress",a),m.upload.addEventListener("loadend",u)),(r.cancelToken||r.signal)&&(s=t=>{m&&(n(!t||t.type?new _e(null,e,m):t),m.abort(),m=null)},r.cancelToken&&r.cancelToken.subscribe(s),r.signal&&(r.signal.aborted?s():r.signal.addEventListener("abort",s)));const y=function(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}(r.url);y&&-1===ge.protocols.indexOf(y)?n(new Q("Unsupported protocol "+y+":",Q.ERR_BAD_REQUEST,e)):m.send(o||null)})},We=(e,t)=>{let n,r=new AbortController;const o=function(e){if(!n){n=!0,s();const t=e instanceof Error?e:this.reason;r.abort(t instanceof Q?t:new _e(t instanceof Error?t.message:t))}};let i=t&&setTimeout(()=>{o(new Q(`timeout ${t} of ms exceeded`,Q.ETIMEDOUT))},t);const s=()=>{e&&(i&&clearTimeout(i),i=null,e.forEach(e=>{e&&(e.removeEventListener?e.removeEventListener("abort",o):e.unsubscribe(o))}),e=null)};e.forEach(e=>e&&e.addEventListener&&e.addEventListener("abort",o));const{signal:a}=r;return a.unsubscribe=s,[a,()=>{i&&clearTimeout(i),i=null}]};const Ie=function*(e,t){let n=e.byteLength;if(!t||n<t)return void(yield e);let r,o=0;for(;o<n;)r=o+t,yield e.slice(o,r),o=r},qe=(e,t,n,r,o)=>{const i=async function*(e,t,n){for await(const r of e)yield*Ie(ArrayBuffer.isView(r)?r:await n(String(r)),t)}(e,t,o);let s,a=0,l=e=>{s||(s=!0,r&&r(e))};return new ReadableStream({async pull(e){try{const{done:t,value:r}=await i.next();if(t)return l(),void e.close();if(n){let e=a+=r.byteLength;n(e)}e.enqueue(new Uint8Array(r))}catch(e){throw l(e),e}},cancel:e=>(l(e),i.return())},{highWaterMark:2})},Je="function"==typeof fetch&&"function"==typeof Request&&"function"==typeof Response,He=Je&&"function"==typeof ReadableStream,Ke=Je&&("function"==typeof TextEncoder?(Ve=new TextEncoder,e=>Ve.encode(e)):async e=>new Uint8Array(await new Response(e).arrayBuffer()));var Ve;const $e=(e,...t)=>{try{return!!e(...t)}catch(e){return!1}},Ge=He&&$e(()=>{let e=!1;const t=new Request(ge.origin,{body:new ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t}),Xe=He&&$e(()=>X.isReadableStream(new Response("").body)),Qe={stream:Xe&&(e=>e.body)};var Ye;Je&&(Ye=new Response,["text","arrayBuffer","blob","formData","stream"].forEach(e=>{!Qe[e]&&(Qe[e]=X.isFunction(Ye[e])?t=>t[e]():(t,n)=>{throw new Q(`Response type '${e}' is not supported`,Q.ERR_NOT_SUPPORT,n)})}));const Ze={http:null,xhr:Me,fetch:Je&&(async e=>{let{url:t,method:n,data:r,signal:o,cancelToken:i,timeout:s,onDownloadProgress:a,onUploadProgress:l,responseType:u,headers:c,withCredentials:f="same-origin",fetchOptions:d}=De(e);u=u?(u+"").toLowerCase():"text";let h,p,[m,g]=o||i||s?We([o,i],s):[];const y=()=>{!h&&setTimeout(()=>{m&&m.unsubscribe()}),h=!0};let v;try{if(l&&Ge&&"get"!==n&&"head"!==n&&0!==(v=await(async(e,t)=>{const n=X.toFiniteNumber(e.getContentLength());return null==n?(async e=>null==e?0:X.isBlob(e)?e.size:X.isSpecCompliantForm(e)?(await new Request(e).arrayBuffer()).byteLength:X.isArrayBufferView(e)||X.isArrayBuffer(e)?e.byteLength:(X.isURLSearchParams(e)&&(e+=""),X.isString(e)?(await Ke(e)).byteLength:void 0))(t):n})(c,r))){let e,n=new Request(t,{method:"POST",body:r,duplex:"half"});if(X.isFormData(r)&&(e=n.headers.get("content-type"))&&c.setContentType(e),n.body){const[e,t]=Fe(v,Ue(Ce(l)));r=qe(n.body,65536,e,t,Ke)}}X.isString(f)||(f=f?"include":"omit"),p=new Request(t,{...d,signal:m,method:n.toUpperCase(),headers:c.normalize().toJSON(),body:r,duplex:"half",credentials:f});let o=await fetch(p);const i=Xe&&("stream"===u||"response"===u);if(Xe&&(a||i)){const e={};["status","statusText","headers"].forEach(t=>{e[t]=o[t]});const t=X.toFiniteNumber(o.headers.get("content-length")),[n,r]=a&&Fe(t,Ue(Ce(a),!0))||[];o=new Response(qe(o.body,65536,n,()=>{r&&r(),i&&y()},Ke),e)}u=u||"text";let s=await Qe[X.findKey(Qe,u)||"text"](o,e);return!i&&y(),g&&g(),await new Promise((t,n)=>{je(t,n,{data:s,headers:Oe.from(o.headers),status:o.status,statusText:o.statusText,config:e,request:p})})}catch(t){if(y(),t&&"TypeError"===t.name&&/fetch/i.test(t.message))throw Object.assign(new Q("Network Error",Q.ERR_NETWORK,e,p),{cause:t.cause||t});throw Q.from(t,t&&t.code,e,p)}})};X.forEach(Ze,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch(e){}Object.defineProperty(e,"adapterName",{value:t})}});const et=e=>`- ${e}`,tt=e=>X.isFunction(e)||null===e||!1===e;var nt=e=>{e=X.isArray(e)?e:[e];const{length:t}=e;let n,r;const o={};for(let i=0;i<t;i++){let t;if(n=e[i],r=n,!tt(n)&&(r=Ze[(t=String(n)).toLowerCase()],void 0===r))throw new Q(`Unknown adapter '${t}'`);if(r)break;o[t||"#"+i]=r}if(!r){const e=Object.entries(o).map(([e,t])=>`adapter ${e} `+(!1===t?"is not supported by the environment":"is not available in the build"));throw new Q("There is no suitable adapter to dispatch the request "+(t?e.length>1?"since :\n"+e.map(et).join("\n"):" "+et(e[0]):"as no adapter specified"),"ERR_NOT_SUPPORT")}return r};function rt(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new _e(null,e)}function ot(e){return rt(e),e.headers=Oe.from(e.headers),e.data=Ae.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1),nt(e.adapter||be.adapter)(e).then(function(t){return rt(e),t.data=Ae.call(e,e.transformResponse,t),t.headers=Oe.from(t.headers),t},function(t){return Pe(t)||(rt(e),t&&t.response&&(t.response.data=Ae.call(e,e.transformResponse,t.response),t.response.headers=Oe.from(t.response.headers))),Promise.reject(t)})}const it={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{it[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}});const st={};it.transitional=function(e,t,n){function r(e,t){return"[Axios v1.7.4] Transitional option '"+e+"'"+t+(n?". "+n:"")}return(n,o,i)=>{if(!1===e)throw new Q(r(o," has been removed"+(t?" in "+t:"")),Q.ERR_DEPRECATED);return t&&!st[o]&&(st[o]=!0,console.warn(r(o," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(n,o,i)}};var at={assertOptions:function(e,t,n){if("object"!=typeof e)throw new Q("options must be an object",Q.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let o=r.length;for(;o-- >0;){const i=r[o],s=t[i];if(s){const t=e[i],n=void 0===t||s(t,i,e);if(!0!==n)throw new Q("option "+i+" must be "+n,Q.ERR_BAD_OPTION_VALUE)}else if(!0!==n)throw new Q("Unknown option "+i,Q.ERR_BAD_OPTION)}},validators:it};const lt=at.validators;class ut{constructor(e){this.defaults=e,this.interceptors={request:new ce,response:new ce}}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=new Error;const n=t.stack?t.stack.replace(/^.+\n/,""):"";try{e.stack?n&&!String(e.stack).endsWith(n.replace(/^.+\n.+\n/,""))&&(e.stack+="\n"+n):e.stack=n}catch(e){}}throw e}}_request(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},t=Le(this.defaults,t);const{transitional:n,paramsSerializer:r,headers:o}=t;void 0!==n&&at.assertOptions(n,{silentJSONParsing:lt.transitional(lt.boolean),forcedJSONParsing:lt.transitional(lt.boolean),clarifyTimeoutError:lt.transitional(lt.boolean)},!1),null!=r&&(X.isFunction(r)?t.paramsSerializer={serialize:r}:at.assertOptions(r,{encode:lt.function,serialize:lt.function},!0)),t.method=(t.method||this.defaults.method||"get").toLowerCase();let i=o&&X.merge(o.common,o[t.method]);o&&X.forEach(["delete","get","head","post","put","patch","common"],e=>{delete o[e]}),t.headers=Oe.concat(i,o);const s=[];let a=!0;this.interceptors.request.forEach(function(e){"function"==typeof e.runWhen&&!1===e.runWhen(t)||(a=a&&e.synchronous,s.unshift(e.fulfilled,e.rejected))});const l=[];let u;this.interceptors.response.forEach(function(e){l.push(e.fulfilled,e.rejected)});let c,f=0;if(!a){const e=[ot.bind(this),void 0];for(e.unshift.apply(e,s),e.push.apply(e,l),c=e.length,u=Promise.resolve(t);f<c;)u=u.then(e[f++],e[f++]);return u}c=s.length;let d=t;for(f=0;f<c;){const e=s[f++],t=s[f++];try{d=e(d)}catch(e){t.call(this,e);break}}try{u=ot.call(this,d)}catch(e){return Promise.reject(e)}for(f=0,c=l.length;f<c;)u=u.then(l[f++],l[f++]);return u}getUri(e){return ue(Be((e=Le(this.defaults,e)).baseURL,e.url),e.params,e.paramsSerializer)}}X.forEach(["delete","get","head","options"],function(e){ut.prototype[e]=function(t,n){return this.request(Le(n||{},{method:e,url:t,data:(n||{}).data}))}}),X.forEach(["post","put","patch"],function(e){function t(t){return function(n,r,o){return this.request(Le(o||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:n,data:r}))}}ut.prototype[e]=t(),ut.prototype[e+"Form"]=t(!0)});var ct=ut;class ft{constructor(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");let t;this.promise=new Promise(function(e){t=e});const 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;const r=new Promise(e=>{n.subscribe(e),t=e}).then(e);return r.cancel=function(){n.unsubscribe(t)},r},e(function(e,r,o){n.reason||(n.reason=new _e(e,r,o),t(n.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}static source(){let e;return{token:new ft(function(t){e=t}),cancel:e}}}var dt=ft;const ht={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};Object.entries(ht).forEach(([e,t])=>{ht[t]=e});var pt=ht;const mt=function e(t){const n=new ct(t),r=s(ct.prototype.request,n);return X.extend(r,ct.prototype,n,{allOwnKeys:!0}),X.extend(r,n,null,{allOwnKeys:!0}),r.create=function(n){return e(Le(t,n))},r}(be);mt.Axios=ct,mt.CanceledError=_e,mt.CancelToken=dt,mt.isCancel=Pe,mt.VERSION="1.7.4",mt.toFormData=oe,mt.AxiosError=Q,mt.Cancel=mt.CanceledError,mt.all=function(e){return Promise.all(e)},mt.spread=function(e){return function(t){return e.apply(null,t)}},mt.isAxiosError=function(e){return X.isObject(e)&&!0===e.isAxiosError},mt.mergeConfig=Le,mt.AxiosHeaders=Oe,mt.formToJSON=e=>ye(X.isHTMLForm(e)?new FormData(e):e),mt.getAdapter=nt,mt.HttpStatusCode=pt,mt.default=mt;var gt=mt;const{CanceledError:yt}=gt;var vt,bt,wt=function(t,n){try{var o=n.baseUrl+"/v1/jobs/update",i=r({},e(n),{job_id:t.identifier},t);return Promise.resolve(fetch(o,{method:"POST",headers:i}).catch(function(e){return console.error(e),null})).then(function(e){return!!e&&e.ok})}catch(e){return Promise.reject(e)}},St="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},Et={__proto__:null,default:{}},xt=(vt=function(e){!function(){var t="input is invalid type",n="object"==typeof window,r=n?window:{};r.JS_MD5_NO_WINDOW&&(n=!1);var o=!n&&"object"==typeof self,i=!r.JS_MD5_NO_NODE_JS&&"object"==typeof process&&process.versions&&process.versions.node;i?r=St:o&&(r=self);var s,a=!r.JS_MD5_NO_COMMON_JS&&e.exports,l=!r.JS_MD5_NO_ARRAY_BUFFER&&"undefined"!=typeof ArrayBuffer,u="0123456789abcdef".split(""),c=[128,32768,8388608,-2147483648],f=[0,8,16,24],d=["hex","array","digest","buffer","arrayBuffer","base64"],h="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split(""),p=[];if(l){var m=new ArrayBuffer(68);s=new Uint8Array(m),p=new Uint32Array(m)}var g=Array.isArray;!r.JS_MD5_NO_NODE_JS&&g||(g=function(e){return"[object Array]"===Object.prototype.toString.call(e)});var y=ArrayBuffer.isView;!l||!r.JS_MD5_NO_ARRAY_BUFFER_IS_VIEW&&y||(y=function(e){return"object"==typeof e&&e.buffer&&e.buffer.constructor===ArrayBuffer});var v=function(e){var n=typeof e;if("string"===n)return[e,!0];if("object"!==n||null===e)throw new Error(t);if(l&&e.constructor===ArrayBuffer)return[new Uint8Array(e),!1];if(!g(e)&&!y(e))throw new Error(t);return[e,!1]},b=function(e){return function(t){return new S(!0).update(t)[e]()}},w=function(e){return function(t,n){return new E(t,!0).update(n)[e]()}};function S(e){if(e)p[0]=p[16]=p[1]=p[2]=p[3]=p[4]=p[5]=p[6]=p[7]=p[8]=p[9]=p[10]=p[11]=p[12]=p[13]=p[14]=p[15]=0,this.blocks=p,this.buffer8=s;else if(l){var t=new ArrayBuffer(68);this.buffer8=new Uint8Array(t),this.blocks=new Uint32Array(t)}else this.blocks=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];this.h0=this.h1=this.h2=this.h3=this.start=this.bytes=this.hBytes=0,this.finalized=this.hashed=!1,this.first=!0}function E(e,t){var n,r=v(e);if(e=r[0],r[1]){var o,i=[],s=e.length,a=0;for(n=0;n<s;++n)(o=e.charCodeAt(n))<128?i[a++]=o:o<2048?(i[a++]=192|o>>>6,i[a++]=128|63&o):o<55296||o>=57344?(i[a++]=224|o>>>12,i[a++]=128|o>>>6&63,i[a++]=128|63&o):(o=65536+((1023&o)<<10|1023&e.charCodeAt(++n)),i[a++]=240|o>>>18,i[a++]=128|o>>>12&63,i[a++]=128|o>>>6&63,i[a++]=128|63&o);e=i}e.length>64&&(e=new S(!0).update(e).array());var l=[],u=[];for(n=0;n<64;++n){var c=e[n]||0;l[n]=92^c,u[n]=54^c}S.call(this,t),this.update(u),this.oKeyPad=l,this.inner=!0,this.sharedMemory=t}S.prototype.update=function(e){if(this.finalized)throw new Error("finalize already called");for(var t,n,r=v(e),o=r[1],i=0,s=(e=r[0]).length,a=this.blocks,u=this.buffer8;i<s;){if(this.hashed&&(this.hashed=!1,a[0]=a[16],a[16]=a[1]=a[2]=a[3]=a[4]=a[5]=a[6]=a[7]=a[8]=a[9]=a[10]=a[11]=a[12]=a[13]=a[14]=a[15]=0),o)if(l)for(n=this.start;i<s&&n<64;++i)(t=e.charCodeAt(i))<128?u[n++]=t:t<2048?(u[n++]=192|t>>>6,u[n++]=128|63&t):t<55296||t>=57344?(u[n++]=224|t>>>12,u[n++]=128|t>>>6&63,u[n++]=128|63&t):(t=65536+((1023&t)<<10|1023&e.charCodeAt(++i)),u[n++]=240|t>>>18,u[n++]=128|t>>>12&63,u[n++]=128|t>>>6&63,u[n++]=128|63&t);else for(n=this.start;i<s&&n<64;++i)(t=e.charCodeAt(i))<128?a[n>>>2]|=t<<f[3&n++]:t<2048?(a[n>>>2]|=(192|t>>>6)<<f[3&n++],a[n>>>2]|=(128|63&t)<<f[3&n++]):t<55296||t>=57344?(a[n>>>2]|=(224|t>>>12)<<f[3&n++],a[n>>>2]|=(128|t>>>6&63)<<f[3&n++],a[n>>>2]|=(128|63&t)<<f[3&n++]):(t=65536+((1023&t)<<10|1023&e.charCodeAt(++i)),a[n>>>2]|=(240|t>>>18)<<f[3&n++],a[n>>>2]|=(128|t>>>12&63)<<f[3&n++],a[n>>>2]|=(128|t>>>6&63)<<f[3&n++],a[n>>>2]|=(128|63&t)<<f[3&n++]);else if(l)for(n=this.start;i<s&&n<64;++i)u[n++]=e[i];else for(n=this.start;i<s&&n<64;++i)a[n>>>2]|=e[i]<<f[3&n++];this.lastByteIndex=n,this.bytes+=n-this.start,n>=64?(this.start=n-64,this.hash(),this.hashed=!0):this.start=n}return this.bytes>4294967295&&(this.hBytes+=this.bytes/4294967296|0,this.bytes=this.bytes%4294967296),this},S.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var e=this.blocks,t=this.lastByteIndex;e[t>>>2]|=c[3&t],t>=56&&(this.hashed||this.hash(),e[0]=e[16],e[16]=e[1]=e[2]=e[3]=e[4]=e[5]=e[6]=e[7]=e[8]=e[9]=e[10]=e[11]=e[12]=e[13]=e[14]=e[15]=0),e[14]=this.bytes<<3,e[15]=this.hBytes<<3|this.bytes>>>29,this.hash()}},S.prototype.hash=function(){var e,t,n,r,o,i,s=this.blocks;this.first?t=((t=((e=((e=s[0]-680876937)<<7|e>>>25)-271733879|0)^(n=((n=(-271733879^(r=((r=(-1732584194^2004318071&e)+s[1]-117830708)<<12|r>>>20)+e|0)&(-271733879^e))+s[2]-1126478375)<<17|n>>>15)+r|0)&(r^e))+s[3]-1316259209)<<22|t>>>10)+n|0:(e=this.h0,t=this.h1,t=((t+=((e=((e+=((r=this.h3)^t&((n=this.h2)^r))+s[0]-680876936)<<7|e>>>25)+t|0)^(n=((n+=(t^(r=((r+=(n^e&(t^n))+s[1]-389564586)<<12|r>>>20)+e|0)&(e^t))+s[2]+606105819)<<17|n>>>15)+r|0)&(r^e))+s[3]-1044525330)<<22|t>>>10)+n|0),t=((t+=((e=((e+=(r^t&(n^r))+s[4]-176418897)<<7|e>>>25)+t|0)^(n=((n+=(t^(r=((r+=(n^e&(t^n))+s[5]+1200080426)<<12|r>>>20)+e|0)&(e^t))+s[6]-1473231341)<<17|n>>>15)+r|0)&(r^e))+s[7]-45705983)<<22|t>>>10)+n|0,t=((t+=((e=((e+=(r^t&(n^r))+s[8]+1770035416)<<7|e>>>25)+t|0)^(n=((n+=(t^(r=((r+=(n^e&(t^n))+s[9]-1958414417)<<12|r>>>20)+e|0)&(e^t))+s[10]-42063)<<17|n>>>15)+r|0)&(r^e))+s[11]-1990404162)<<22|t>>>10)+n|0,t=((t+=((e=((e+=(r^t&(n^r))+s[12]+1804603682)<<7|e>>>25)+t|0)^(n=((n+=(t^(r=((r+=(n^e&(t^n))+s[13]-40341101)<<12|r>>>20)+e|0)&(e^t))+s[14]-1502002290)<<17|n>>>15)+r|0)&(r^e))+s[15]+1236535329)<<22|t>>>10)+n|0,t=((t+=((r=((r+=(t^n&((e=((e+=(n^r&(t^n))+s[1]-165796510)<<5|e>>>27)+t|0)^t))+s[6]-1069501632)<<9|r>>>23)+e|0)^e&((n=((n+=(e^t&(r^e))+s[11]+643717713)<<14|n>>>18)+r|0)^r))+s[0]-373897302)<<20|t>>>12)+n|0,t=((t+=((r=((r+=(t^n&((e=((e+=(n^r&(t^n))+s[5]-701558691)<<5|e>>>27)+t|0)^t))+s[10]+38016083)<<9|r>>>23)+e|0)^e&((n=((n+=(e^t&(r^e))+s[15]-660478335)<<14|n>>>18)+r|0)^r))+s[4]-405537848)<<20|t>>>12)+n|0,t=((t+=((r=((r+=(t^n&((e=((e+=(n^r&(t^n))+s[9]+568446438)<<5|e>>>27)+t|0)^t))+s[14]-1019803690)<<9|r>>>23)+e|0)^e&((n=((n+=(e^t&(r^e))+s[3]-187363961)<<14|n>>>18)+r|0)^r))+s[8]+1163531501)<<20|t>>>12)+n|0,t=((t+=((r=((r+=(t^n&((e=((e+=(n^r&(t^n))+s[13]-1444681467)<<5|e>>>27)+t|0)^t))+s[2]-51403784)<<9|r>>>23)+e|0)^e&((n=((n+=(e^t&(r^e))+s[7]+1735328473)<<14|n>>>18)+r|0)^r))+s[12]-1926607734)<<20|t>>>12)+n|0,t=((t+=((i=(r=((r+=((o=t^n)^(e=((e+=(o^r)+s[5]-378558)<<4|e>>>28)+t|0))+s[8]-2022574463)<<11|r>>>21)+e|0)^e)^(n=((n+=(i^t)+s[11]+1839030562)<<16|n>>>16)+r|0))+s[14]-35309556)<<23|t>>>9)+n|0,t=((t+=((i=(r=((r+=((o=t^n)^(e=((e+=(o^r)+s[1]-1530992060)<<4|e>>>28)+t|0))+s[4]+1272893353)<<11|r>>>21)+e|0)^e)^(n=((n+=(i^t)+s[7]-155497632)<<16|n>>>16)+r|0))+s[10]-1094730640)<<23|t>>>9)+n|0,t=((t+=((i=(r=((r+=((o=t^n)^(e=((e+=(o^r)+s[13]+681279174)<<4|e>>>28)+t|0))+s[0]-358537222)<<11|r>>>21)+e|0)^e)^(n=((n+=(i^t)+s[3]-722521979)<<16|n>>>16)+r|0))+s[6]+76029189)<<23|t>>>9)+n|0,t=((t+=((i=(r=((r+=((o=t^n)^(e=((e+=(o^r)+s[9]-640364487)<<4|e>>>28)+t|0))+s[12]-421815835)<<11|r>>>21)+e|0)^e)^(n=((n+=(i^t)+s[15]+530742520)<<16|n>>>16)+r|0))+s[2]-995338651)<<23|t>>>9)+n|0,t=((t+=((r=((r+=(t^((e=((e+=(n^(t|~r))+s[0]-198630844)<<6|e>>>26)+t|0)|~n))+s[7]+1126891415)<<10|r>>>22)+e|0)^((n=((n+=(e^(r|~t))+s[14]-1416354905)<<15|n>>>17)+r|0)|~e))+s[5]-57434055)<<21|t>>>11)+n|0,t=((t+=((r=((r+=(t^((e=((e+=(n^(t|~r))+s[12]+1700485571)<<6|e>>>26)+t|0)|~n))+s[3]-1894986606)<<10|r>>>22)+e|0)^((n=((n+=(e^(r|~t))+s[10]-1051523)<<15|n>>>17)+r|0)|~e))+s[1]-2054922799)<<21|t>>>11)+n|0,t=((t+=((r=((r+=(t^((e=((e+=(n^(t|~r))+s[8]+1873313359)<<6|e>>>26)+t|0)|~n))+s[15]-30611744)<<10|r>>>22)+e|0)^((n=((n+=(e^(r|~t))+s[6]-1560198380)<<15|n>>>17)+r|0)|~e))+s[13]+1309151649)<<21|t>>>11)+n|0,t=((t+=((r=((r+=(t^((e=((e+=(n^(t|~r))+s[4]-145523070)<<6|e>>>26)+t|0)|~n))+s[11]-1120210379)<<10|r>>>22)+e|0)^((n=((n+=(e^(r|~t))+s[2]+718787259)<<15|n>>>17)+r|0)|~e))+s[9]-343485551)<<21|t>>>11)+n|0,this.first?(this.h0=e+1732584193|0,this.h1=t-271733879|0,this.h2=n-1732584194|0,this.h3=r+271733878|0,this.first=!1):(this.h0=this.h0+e|0,this.h1=this.h1+t|0,this.h2=this.h2+n|0,this.h3=this.h3+r|0)},S.prototype.toString=S.prototype.hex=function(){this.finalize();var e=this.h0,t=this.h1,n=this.h2,r=this.h3;return u[e>>>4&15]+u[15&e]+u[e>>>12&15]+u[e>>>8&15]+u[e>>>20&15]+u[e>>>16&15]+u[e>>>28&15]+u[e>>>24&15]+u[t>>>4&15]+u[15&t]+u[t>>>12&15]+u[t>>>8&15]+u[t>>>20&15]+u[t>>>16&15]+u[t>>>28&15]+u[t>>>24&15]+u[n>>>4&15]+u[15&n]+u[n>>>12&15]+u[n>>>8&15]+u[n>>>20&15]+u[n>>>16&15]+u[n>>>28&15]+u[n>>>24&15]+u[r>>>4&15]+u[15&r]+u[r>>>12&15]+u[r>>>8&15]+u[r>>>20&15]+u[r>>>16&15]+u[r>>>28&15]+u[r>>>24&15]},S.prototype.array=S.prototype.digest=function(){this.finalize();var e=this.h0,t=this.h1,n=this.h2,r=this.h3;return[255&e,e>>>8&255,e>>>16&255,e>>>24&255,255&t,t>>>8&255,t>>>16&255,t>>>24&255,255&n,n>>>8&255,n>>>16&255,n>>>24&255,255&r,r>>>8&255,r>>>16&255,r>>>24&255]},S.prototype.arrayBuffer=function(){this.finalize();var e=new ArrayBuffer(16),t=new Uint32Array(e);return t[0]=this.h0,t[1]=this.h1,t[2]=this.h2,t[3]=this.h3,e},S.prototype.buffer=S.prototype.arrayBuffer,S.prototype.base64=function(){for(var e,t,n,r="",o=this.array(),i=0;i<15;)e=o[i++],t=o[i++],n=o[i++],r+=h[e>>>2]+h[63&(e<<4|t>>>4)]+h[63&(t<<2|n>>>6)]+h[63&n];return r+(h[(e=o[i])>>>2]+h[e<<4&63]+"==")},(E.prototype=new S).finalize=function(){if(S.prototype.finalize.call(this),this.inner){this.inner=!1;var e=this.array();S.call(this,this.sharedMemory),this.update(this.oKeyPad),this.update(e),S.prototype.finalize.call(this)}};var x=function(){var e=b("hex");i&&(e=function(e){var n,o=Et,i=Et.Buffer;return n=i.from&&!r.JS_MD5_NO_BUFFER_FROM?i.from:function(e){return new i(e)},function(r){if("string"==typeof r)return o.createHash("md5").update(r,"utf8").digest("hex");if(null==r)throw new Error(t);return r.constructor===ArrayBuffer&&(r=new Uint8Array(r)),g(r)||y(r)||r.constructor===i?o.createHash("md5").update(n(r)).digest("hex"):e(r)}}(e)),e.create=function(){return new S},e.update=function(t){return e.create().update(t)};for(var n=0;n<d.length;++n){var o=d[n];e[o]=b(o)}return e}();x.md5=x,x.md5.hmac=function(){var e=w("hex");e.create=function(e){return new E(e)},e.update=function(t,n){return e.create(t).update(n)};for(var t=0;t<d.length;++t){var n=d[t];e[n]=w(n)}return e}(),a?e.exports=x:r.md5=x}()},vt(bt={exports:{}}),bt.exports);function Tt(e,t=0){return Pt(e,t,2).getUint16(0,!0)}function Rt(e,t=0){return Pt(e,t,4).getUint32(0,!0)}function Ot(e,t=0,n=e.byteLength){const r=e.slice(t,t+n);return _t.decode(new Uint8Array(r))}function At(e,t,n=0){if(e.length<t.length+n)return!1;for(const[r,o]of t.entries())if(null!==o&&o!==e[r+n])return!1;return!0}function Pt(e,t,n){const r=e.slice(t,t+n);return new DataView(new Uint8Array(r).buffer)}const _t=new TextDecoder("utf8"),jt=[["db","application/vnd.sqlite3",[83,81,76,105,116,101,32,102,111,114,109,97,116,32,51,0]],["woff","font/woff",[119,79,70,70]],["woff2","font/woff2",[119,79,70,50]],["bmp","image/bmp",[66,77]],["gif","image/gif",[71,73,70,56,55,97]],["gif","image/gif",[71,73,70,56,57,97]],["heic","image/heic",[102,116,121,112,104,101,105],{offset:4}],["heic","image/heic",[102,116,121,112,109],{offset:4}],["ico","image/x-icon",[0,0,1,0]],["jpg","image/jpeg",[255,216,255]],["pdf","application/pdf",[37,80,68,70,45]],["png","image/png",[137,80,78,71,13,10,26,10]],["7z","application/x-7z-compressed",[55,122,188,175,39,28]],["rar","application/x-rar-compressed",[82,97,114,33,26,7,0]],["rar","application/x-rar-compressed",[82,97,114,33,26,7,1,0]],["rtf","application/rtf",[123,92,114,116,102,49]],["bz2","application/x-bzip2",[66,90,104]],["gz","application/gzip",[31,139]],["tar","application/x-tar",[117,115,116,97,114,0,48,48],{offset:257}],["tar","application/x-tar",[117,115,116,97,114,32,32,0],{offset:257}],["tif","image/tiff",[73,73,42,0]],["tiff","image/tiff",[77,77,0,42]],["zip","application/zip",[80,75,3,4],{exact:!1}],["zip","application/zip",[80,75,5,6]],["mp3","audio/mp3",[255,251]],["mp3","audio/mp3",[255,243]],["mp3","audio/mp3",[255,242]],["mp3","audio/mp3",[73,68,51]],["mp4","video/mp4",[102,116,121,112,105,115,111,109],{offset:4}],["avi","video/x-msvideo",[82,73,70,70,null,null,null,null,65,86,73,32]],["wav","audio/wav",[82,73,70,70,null,null,null,null,87,65,86,69]],["ogx","application/ogg",[79,103,103,83],{exact:!1},[["oga","audio/ogg",[127,70,76,65,67],{offset:28}],["ogg","audio/ogg",[1,118,111,114,98,105,115],{offset:28}],["ogm","video/ogg",[1,118,105,100,101,111,0],{offset:28}],["ogv","video/ogg",[128,116,104,101,111,114,97],{offset:28}]]],["webp","image/webp",[82,73,70,70,null,null,null,null,87,69,66,80]],["psd","image/vnd.adobe.photoshop",[56,66,80,83]],["flac","audio/x-flac",[102,76,97,67]],["wasm","application/wasm",[0,97,115,109]],["deb","application/x-deb",[33,60,97,114,99,104,62,10]],["exe","application/x-msdownload",[77,90]],["exe","application/x-msdownload",[90,77]],["class","application/java-vm",[202,254,186,190]]];function Ut(e){return e.flatMap(([e,t,n,r={},o=[]])=>[[e,t,n,r],...o])}function Ft(e,t){const n=Tt(e,26),r=Ot(e,30,n),[o]=r.split("/"),i=r.endsWith(".xml");return"META-INF"===o?{ext:"jar",mime:"application/java-archive"}:"ppt"===o&&i?{ext:"pptx",mime:"application/vnd.openxmlformats-officedocument.presentationml.presentation"}:"word"===o&&i?{ext:"docx",mime:"application/vnd.openxmlformats-officedocument.wordprocessingml.document"}:"xl"===o&&i?{ext:"xlsx",mime:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"}:"mimetype"===o?function(e,t){const n=Rt(e,18),r=Rt(e,22),o=Tt(e,28);if(n===r){const r=Ot(e,30+t+o,n);if("application/vnd.oasis.opendocument.presentation"===r)return{ext:"odp",mime:r};if("application/vnd.oasis.opendocument.spreadsheet"===r)return{ext:"ods",mime:r};if("application/vnd.oasis.opendocument.text"===r)return{ext:"odt",mime:r};if("application/epub+zip"===r)return{ext:"epub",mime:r}}}(e,n)??t:t}const Ct=function(e){return Ut(e).map(([e,t,n,{offset:r=0}={}])=>n.length+r).reduce((e,t)=>t>e?t:e,0)}(jt);function Nt(e,t){for(const[n,r,o,{exact:i=!0,offset:s=0}={},a=[]]of t)if(At(e,o,s)){if("zip"===n&&!i)return Ft(e.buffer,{ext:n,mime:r});if(!i&&a.length)for(const[t,n,r,{offset:o=0}={}]of a)if(At(e,r,o))return{ext:t,mime:n};return{ext:n,mime:r}}}function kt(e){var t=xt.md5.create();return t.update(e),t.base64()}function Bt(e,t,n){if(void 0===t&&(t=void 0),void 0===n&&(n=!0),e>1073741824){var r=n?" GB":"";return(e/1073741824).toFixed(t||2)+r}if(e>1048576){var o=n?" MB":"";return(e/1048576).toFixed(t||2)+o}if(e>1024){var i=n?" KB":"";return(e/1024).toFixed(t||0)+i}return e+(n?" B":"")}"undefined"==typeof Symbol||Symbol.iterator||(Symbol.iterator=Symbol("Symbol.iterator"));var zt=function(e){try{return Promise.resolve(new Promise(function(t){return setTimeout(t,e)}))}catch(e){return Promise.reject(e)}};function Lt(e,t,n){if(!e.s){if(n instanceof Dt){if(!n.s)return void(n.o=Lt.bind(null,e,t));1&t&&(t=n.s),n=n.v}if(n&&n.then)return void n.then(Lt.bind(null,e,t),Lt.bind(null,e,2));e.s=t,e.v=n;const r=e.o;r&&r(e)}}var Dt=/*#__PURE__*/function(){function e(){}return e.prototype.then=function(t,n){var r=new e,o=this.s;if(o){var i=1&o?t:n;if(i){try{Lt(r,1,i(this.v))}catch(e){Lt(r,2,e)}return r}return this}return this.o=function(e){try{var o=e.v;1&e.s?Lt(r,1,t?t(o):o):n?Lt(r,1,n(o)):Lt(r,2,o)}catch(e){Lt(r,2,e)}},r},e}();function Mt(e){return e instanceof Dt&&1&e.s}function Wt(e){for(var t=-1,n=Infinity,r=0;r<e.length;r++){var o=e[r];console.debug(o),o.path.split("/").length<n&&(n=o.path.split("/").length,t=r)}return t<0?null:e[t]}var It=/*#__PURE__*/function(){function e(e,t){this.totalFiles=e,this.estimatedTotalSize=t,this.uploadedSize=0,this.startTime=Date.now(),this.lastUpdateTime=this.startTime,this.lastUploadedSize=0,this.speedEMA=null,this.emaFactor=.1,this.smoothedRemainingTime=null,this.recentSpeeds=[],this.maxRecentSpeeds=20,this.initialEstimateThreshold=.05}var t=e.prototype;return t.updateProgress=function(e){var t=Date.now(),n=(t-this.lastUpdateTime)/1e3,r=e-this.lastUploadedSize;if(this.uploadedSize=e,n>0&&r>0){this.recentSpeeds.push(r/n),this.recentSpeeds.length>this.maxRecentSpeeds&&this.recentSpeeds.shift();var o=this.recentSpeeds.reduce(function(e,t){return e+t},0)/this.recentSpeeds.length;this.speedEMA=null===this.speedEMA?o:this.emaFactor*o+(1-this.emaFactor)*this.speedEMA}this.lastUpdateTime=t,this.lastUploadedSize=e;var i,s=this.uploadedSize/this.estimatedTotalSize,a=(t-this.startTime)/1e3,l=this.speedEMA&&this.speedEMA>0?this.speedEMA:this.uploadedSize/a;return i=l>0?(this.estimatedTotalSize-this.uploadedSize)/l:Infinity,this.smoothedRemainingTime=s>=this.initialEstimateThreshold?null===this.smoothedRemainingTime?i:.9*this.smoothedRemainingTime+.1*i:a/s-a,this.smoothedRemainingTime=Math.max(this.smoothedRemainingTime,(this.estimatedTotalSize-this.uploadedSize)/l),{progress:100*s,estimatedTimeRemaining:Math.round(this.smoothedRemainingTime),estimatedTimeRemainingString:this.smoothedRemainingTime>3?this.__formatTime(this.smoothedRemainingTime):"few seconds"}},t.__formatTime=function(e){if(!isFinite(e)||e>86400)return"Calculating...";if(e<60)return Math.round(e)+"sec";var t=Math.floor(e/60);return t<60?t+"min":Math.floor(t/60)+"h "+t%60+"min"},e}();function qt(e,t,n){if(!e.s){if(n instanceof Jt){if(!n.s)return void(n.o=qt.bind(null,e,t));1&t&&(t=n.s),n=n.v}if(n&&n.then)return void n.then(qt.bind(null,e,t),qt.bind(null,e,2));e.s=t,e.v=n;var r=e.o;r&&r(e)}}var Jt=/*#__PURE__*/function(){function e(){}return e.prototype.then=function(t,n){var r=new e,o=this.s;if(o){var i=1&o?t:n;if(i){try{qt(r,1,i(this.v))}catch(e){qt(r,2,e)}return r}return this}return this.o=function(e){try{var o=e.v;1&e.s?qt(r,1,t?t(o):o):n?qt(r,1,n(o)):qt(r,2,o)}catch(e){qt(r,2,e)}},r},e}();function Ht(e){return e instanceof Jt&&1&e.s}function Kt(e,t,n){var r,o,i=-1;return function s(a){try{for(;++i<e.length&&(!n||!n());)if((a=t(i))&&a.then){if(!Ht(a))return void a.then(s,o||(o=qt.bind(null,r=new Jt,2)));a=a.v}r?qt(r,1,a):r=a}catch(e){qt(r||(r=new Jt),2,e)}}(),r}function Vt(e,t,n){for(var r;;){var o=e();if(Ht(o)&&(o=o.v),!o)return i;if(o.then){r=0;break}var i=n();if(i&&i.then){if(!Ht(i)){r=1;break}i=i.s}if(t){var s=t();if(s&&s.then&&!Ht(s)){r=2;break}}}var a=new Jt,l=qt.bind(null,a,2);return(0===r?o.then(c):1===r?i.then(u):s.then(f)).then(void 0,l),a;function u(r){i=r;do{if(t&&(s=t())&&s.then&&!Ht(s))return void s.then(f).then(void 0,l);if(!(o=e())||Ht(o)&&!o.v)return void qt(a,1,i);if(o.then)return void o.then(c).then(void 0,l);Ht(i=n())&&(i=i.v)}while(!i||!i.then);i.then(u).then(void 0,l)}function c(e){e?(i=n())&&i.then?i.then(u).then(void 0,l):u(i):qt(a,1,i)}function f(){(o=e())?o.then?o.then(c).then(void 0,l):c(o):qt(a,1,i)}}var $t=[];function Gt(t){console.log("upload",t);var o=t.files.map(function(e){return function(e,t){void 0===t&&(t=null);var n=e;return null==t&&(t=e.webkitRelativePath||""),n.path=t+e.name,n}(e)});return console.log(o),function(t,o,s){void 0===s&&(s=void 0);try{var a=function(t,o,s){void 0===s&&(s=void 0);try{var a,l=o.files,u=(null==(a=s)?void 0:a.loglevel)||"none";if(!l.length)return console.error("No files to upload"),Promise.resolve({success:!1,error:"No files to upload"});if(!o.entrypoint){var c=function(e){var t=null,r="",o=e.filter(function(e){return e.name.endsWith("package.json")});if(1===o.length)return o[0];if(o.length>1)return r="Invalid upload: Multiple package.json files found. This is currently not supported.",console.error(r,o),{error:r};var i=e.filter(function(e){return"index.html"===e.name.toLowerCase()||"index.html.gz"===e.name.toLowerCase()||"index.html.br"===e.name.toLowerCase()});if(1===i.length)return i[0];i.length>1&&console.warn("Multiple index.html files found.");var s=e.filter(function(e){return e.name.toLowerCase().endsWith(".glb")||e.name.toLowerCase().endsWith(".gltf")||e.name.toLowerCase().endsWith(".vrm")});if(s.length>1){var a=function(e){for(var t,r=new Array,o=/(mesh_lod|image)_\d_(.{1,50})/,i=n(e);!(t=i()).done;){var s=t.value;if(!o.test(s.name)){var a=s.name.toLowerCase();(a.endsWith(".gltf")||a.endsWith(".vrm")||a.endsWith(".glb"))&&r.push(s)}}return 1==r.length?r[0]:Wt(r)}(s);return a?t=a:(r="Invalid upload: Multiple glb/glTF/vrm files found. This is currently not supported.",console.error(r,s.map(function(e){return e.path||e.name})),{error:r})}if(1===s.length)return s[0];var l=e.filter(function(e){return e.name.endsWith(".usdz")||e.name.endsWith(".usd")||e.name.endsWith(".usda")||e.name.endsWith(".usdc")});l.length>=1&&(t=Wt(l));var u=e.filter(function(e){return e.name.endsWith(".fbx")});if(u.length>1)return r="Invalid upload: Multiple fbx files found. This is currently not supported.",console.error(r,u),{error:r};if(1===u.length)return u[0];var c=e.filter(function(e){return e.name.endsWith(".obj")});return c.length>1?(r="Invalid upload: Multiple obj files found. This is currently not supported.",console.error(r,c),{error:r}):1===c.length?t=c[0]:t||{error:"No supported file to upload found..."}}(l);if(null==c)return Promise.resolve({success:!1,error:"No entrypoint file found"});if("object"==typeof c&&"error"in c)return Promise.resolve({success:!1,error:c.error});"info"===u&&console.log("Entrypoint: "+c.name),o.entrypoint=c}return o.entrypoint&&!l.includes(o.entrypoint)&&l.push(o.entrypoint),Promise.resolve(function(e){try{var t,r=function(e){return t?e:{success:!0}};if(e.length>1e3)return Promise.resolve({success:!1,error:"Too many files. Maximum filecount is 1000"});var o=0,s=e.length-1,a=function(e,t,n){for(var r;;){var o=e();if(Mt(o)&&(o=o.v),!o)return i;if(o.then){r=0;break}var i=n();if(i&&i.then){if(!Mt(i)){r=1;break}i=i.s}if(t){var s=t();if(s&&s.then&&!Mt(s)){r=2;break}}}var a=new Dt,l=Lt.bind(null,a,2);return(0===r?o.then(c):1===r?i.then(u):s.then(f)).then(void 0,l),a;function u(r){i=r;do{if(t&&(s=t())&&s.then&&!Mt(s))return void s.then(f).then(void 0,l);if(!(o=e())||Mt(o)&&!o.v)return void Lt(a,1,i);if(o.then)return void o.then(c).then(void 0,l);Mt(i=n())&&(i=i.v)}while(!i||!i.then);i.then(u).then(void 0,l)}function c(e){e?(i=n())&&i.then?i.then(u).then(void 0,l):u(i):Lt(a,1,i)}function f(){(o=e())?o.then?o.then(c).then(void 0,l):c(o):Lt(a,1,i)}}(function(){return!t&&s>=0},function(){return s--},function(){var r=e[s];return(o+=r.size)>157286400?(t=1,{success:!1,error:"Total file size exceeds limit of 150 MB. Please reduce the size of your upload."}):".ds_store"===r.name.toLocaleLowerCase()?(console.log("🚫 Remove .DS_Store file from upload"),void e.splice(s,1)):function(){if(r.name.endsWith(".gltf"))return console.log("Found glTF file "+r.name+". Will check if all dependencies are available\n",e),Promise.resolve(r.text()).then(function(o){var s,a=o.matchAll(/*#__PURE__*/i(/"uri"\s*:\s*"(.*?)"/g,{value:1}));if(a){var l=JSON.parse(o);if("2.0"!==l.asset.version)return console.warn("⚠ glTF version is not 2.0. This is currently not supported."),t=1,{success:!1,error:"glTF version "+l.asset.version+" is unsupported.Please use glTF 2.0."};for(var u,c=null==(s=r.path)?void 0:s.split("/"),f=c.splice(0,c.length-1),d=n(a);!(u=d()).done;){var h,p=null==(h=u.value.groups)?void 0:h.value;if(p){var m=!1;if(p.startsWith("http://")||p.startsWith("https://")||p.startsWith("www.")){console.log("āœ… Found remote dependency "+p+" ");break}if(p.startsWith("data:")){console.log("āœ… Found embedded dependency "+p+" ");break}var g=(f+"/"+p).split("/").reduce(function(e,t){return"."===t||(".."===t?e.pop():null!=t&&t.length&&e.push(t)),e},[]).join("/");console.log('ā“ Check if local dependency exists "'+g+'"');for(var y,v=n(e);!(y=v()).done;){var b=y.value;if(b.webkitRelativePath===g||b.name==g){m=!0,console.log("āœ… Found dependency in name or webkit: "+b.name+" || "+b.webkitRelativePath+" ");break}if(b.path===g){m=!0,console.log("āœ… Found dependency in path: "+b.path+" ");break}}if(!m)return console.warn("⚠ Missing dependency "+p),t=1,{success:!1,error:"Missing resource: "+p}}}}})}()});return Promise.resolve(a&&a.then?a.then(r):r(a))}catch(e){return Promise.reject(e)}}(l)).then(function(n){var i,a,c,f,d,h,p,m;function g(n){return Promise.resolve(fetch(v+"/v1/upload/request",{method:"POST",headers:w,body:JSON.stringify(S)}).catch(function(e){return"fetch failed"==e.message?"Network error. Make sure you are connected to the internet and "+v+" is reachable.":(console.error("Failed to begin upload",e),null)})).then(function(n){var i;function a(a){return i?a:Promise.resolve(n.json()).then(function(n){var i,a,c;function f(){return Promise.resolve(Promise.all(E).catch(function(e){var t;null!=(t=s)&&null!=(t=t.abort)&&t.aborted?console.warn("Upload aborted"):(console.error(e.message),x=!0)})).then(function(){var o;function i(i){var a;if(o)return i;function c(o){if(a)return o;m=!0;var i=r({},e(t),{id:n.id});return"none"!=u&&console.log("Completing upload - notify server"),Promise.resolve(fetch(v+"/v1/upload/done",{method:"POST",headers:i}).catch(function(e){return console.error("Failed to complete upload",e),null})).then(function(e){var t;function n(n){return t?n:("none"!=u&&console.log("Upload complete"),Promise.resolve(e.json()).then(function(e){return{success:!0,uploadSkipped:!1,id:e.id,view_id:e.view_id,url:e.url,filesUploaded:l.length,totalSize:d}}))}if(!e)return console.error("Failed to complete upload"),{success:!1,error:"Failed to complete upload"};var r=function(){if(!e.ok)return Promise.resolve(e.text()).then(function(e){return console.error("Failed to complete upload",e),t=1,{success:!1,error:"Failed to complete upload"}})}();return r&&r.then?r.then(n):n(r)})}var f=function(e){if(null!=(e=s)&&null!=(e=e.abort)&&e.aborted)return Promise.resolve(wt({identifier:n.id,status:"canceled",status_message:"Upload aborted",error:"Upload aborted"},t)).then(function(){return a=1,{success:!1,error:"Upload aborted"}})}();return f&&f.then?f.then(c):c(f)}var a=function(){if(x)return Promise.resolve(wt({identifier:n.id,status:"failed",error:"Failed to upload files"},t)).then(function(){return o=1,{success:!1,error:"Failed to upload files"}})}();return a&&a.then?a.then(i):i(a)})}"debug"===u&&console.debug("BeginResponse",n);var d=l.reduce(function(e,t){return e+t.size},0);if("exists"===n.type)return"none"!=u&&console.log("Upload already exists",n.id),{success:!0,id:n.id,uploadSkipped:!0,view_id:n.view_id,filesUploaded:l.length,totalSize:d};var h=o.entrypoint.webkitRelativePath||o.entrypoint.name,p=0;null==(i=s)||null==(i=i.abort)||i.addEventListener("abort",function(){try{return console.log("Upload aborted: Cancelling upload"),Promise.resolve(fetch(v+"/v1/upload/cancel",{method:"POST",headers:{authorization:b,id:n.id}})).then(function(){})}catch(e){return Promise.reject(e)}});var m=!1,g=Date.now();null!=(a=s)&&a.onStart&&s.onStart(n.id,n.view_id);var y=Date.now(),w=new It(l.length,d/1024/1024),E=new Array,x=!1,T=Kt([].concat(l),function(o){var i;function a(){var e=function(){if(E.length>=10)return Promise.resolve(Promise.race(E)).then(function(){})}();if(e&&e.then)return e.then(function(){})}if(null!=(i=s)&&null!=(i=i.abort)&&i.aborted)return console.debug("Upload aborted"),void(c=1);if(x)return console.debug("Upload failed"),void(c=1);var f=function(){if(E.length<10){console.debug("Uploading file "+o+"/"+l.length+": "+l[o].name);var i=0,a=0,c=S.results.files[o],f=c.filename;return Promise.resolve(l[o].arrayBuffer()).then(function(v){var b=function(t){try{var n,o=function(e){var n;function r(e){var t=function(){if(!s)return console.error("Failed to upload file "+u),Promise.resolve(wt({identifier:i,status:"failed",status_message:"Failed to upload file "+u,error:"Failed to upload file "+u},y)).then(function(){throw new Error("Failed to upload file "+u)})}();return!t||!t.then||t.then(function(e){return!0})}if(null==S)throw new Error("Failed to get presigned url for "+u);var o=S.presigned_url,s=!1,a=0,d=Vt(function(){return!n&&a<5},function(){return a++},function(){function e(){var e;if(null!=v&&null!=(e=v.abort)&&e.aborted)throw new yt("Upload aborted");var r={"Content-Type":h,"Content-MD5":f};return b&&(r["Content-Encoding"]=b),Promise.resolve(gt.put(o,c,{signal:null==v?void 0:v.abort,headers:r,onUploadProgress:function(e){t.onProgress(e)}}).catch(function(e){return e instanceof yt||"none"!==g&&console.error("Failed to upload file",e),null})).then(function(e){if(e)return 200!==e.status?void console.debug("Failed ("+e.status+" "+e.status+") to upload file "+l.name+' to "'+S.path+'". Retrying...'):(s=!0,"info"===g?console.log("Uploaded file "+u+' to "'+S.path+'"'):console.debug("Uploaded "+l.name+' to "'+S.path+'"'),void(n=1))})}var r=function(){if(a>0)return Promise.resolve(zt(1e3*a)).then(function(){})}();return r&&r.then?r.then(e):e()});return d&&d.then?d.then(r):r()},i=t.uploadId,s=t.uploadRequestPUTUrl,a=t.entrypointPath,l=t.file,u=t.fileName,c=t.fileBuffer,f=t.fileMd5,d=t.fileSize,h=t.fileType,p=t.fileIndex,m=t.fileCount,g=t.loglevel,y=t.args,v=t.options,b=void 0;l.name.endsWith(".gz")?b="gzip":l.name.endsWith(".br")&&(b="br"),"info"===g&&console.log('Uploading file "'+l.name+'" type='+h+" ("+d+") "+l.type+" with hash "+f);var w=r({},e(y),{job_id:i,filename:u,filesize:d.toString(),entrypoint:a,"content-type":h,"content-md5":f,progress:(p/m*100).toFixed(0)});b&&(w["content-encoding"]=b);var S=null,E=0,x=Vt(function(){return!n&&E<5},function(){return E++},function(){var e;if(null==S){if(null!=v&&null!=(e=v.abort)&&e.aborted)throw new Error("Upload aborted");return Promise.resolve(zt(200*E)).then(function(){return Promise.resolve(fetch(s,{method:"POST",headers:w}).then(function(e){try{var t,n=function(n){return t?n:Promise.resolve(e.json())},r=function(){if(!e.ok)return Promise.resolve(e.text()).then(function(n){return console.warn("Failed to get presigned url ("+e.status+'). Message: "'+n+'"\n→ Retrying...'),t=1,null})}();return Promise.resolve(r&&r.then?r.then(n):n(r))}catch(e){return Promise.reject(e)}}).catch(function(e){return console.warn("Failed to get presigned url "+e.message+", retrying..."),null})).then(function(e){S=e})})}n=1});return Promise.resolve(x&&x.then?x.then(o):o())}catch(e){return Promise.reject(e)}}({uploadId:n.id,uploadRequestPUTUrl:n.request_put_url,entrypointPath:h,file:l[o],fileName:f,fileMd5:c.content_md5,fileBuffer:v,fileType:c.content_type,fileSize:c.content_length,fileIndex:o,fileCount:l.length,loglevel:u,args:t,options:s,onProgress:function(e){var t,n=e.progress||0,r=(i=l[o].size*n)-a;if(a=i,p+=r,null!=(t=s)&&t.progress){var u=p/d,c=l.length,f=l[o].size,h=(Date.now()-y)/1e3,m=w.updateProgress(p/1024/1024);s.progress({uploadedBytes:p,totalBytes:d,progress01:u,fileName:l[o].name,fileSize:f,fileProgress01:n,fileIndex:o,totalFiles:c,estimatedTimeLeftDisplay:m.estimatedTimeRemainingString,estimatedTimeLeft:m.estimatedTimeRemaining,elapsedTime:h})}}}).then(function(e){if(!0!==e)return e;for(var r=E.length-1;r>=0;r--)E[r]===b&&E.splice(r,1);!function(e,r,o){if(void 0===o&&(o=!1),!o&&Date.now()-g<1e3)return!1;if(!m){g=Date.now();var i=Math.floor(p/d*100);return"debug"===u&&console.log("SET STATUS: "+r,e,i),wt({identifier:n.id,status:r,status_message:e,progress:i},t),!0}"none"!=u&&console.warn("Invalid status update...")}("Uploaded "+Bt(p)+" of "+Bt(d)+" for "+l[o].name,"running")}).catch(function(e){var t;null!=(t=s)&&null!=(t=t.abort)&&t.aborted?console.warn("Upload aborted"):(console.error(e.message),x=!0)});E.push(b)})}}();return f&&f.then?f.then(a):a()},function(){return c});return T&&T.then?T.then(f):f()})}if(null===n||"string"==typeof n)return{success:!1,error:n||"Failed to begin upload"};var c=function(){if(!n.ok)return Promise.resolve(n.text()).then(function(e){return"none"!=u&&console.error("Failed to begin upload",n.status,e),i=1,{success:!1,error:"Failed to begin upload ("+n.status+"): "+e}})}();return c&&c.then?c.then(a):a(c)})}if("error"in n)return{success:!1,error:n.error||"Failed to validate files"};(null!=(i=o.entrypoint)&&i.name.endsWith(".html")||null!=(a=o.entrypoint)&&a.name.endsWith(".html.gz")||null!=(c=o.entrypoint)&&c.name.endsWith(".html.br"))&&(s||(s={}),s.type="deployment"),l.sort(function(e,t){return e.name.includes(".needle")&&!t.name.includes(".needle")?-1:!e.name.includes(".needle")&&t.name.includes(".needle")?1:0});var y,v=t.baseUrl,b="Bearer "+t.authToken,w=r({},e(t),{triggered_by:o.triggered_by,filename:null==(f=o.entrypoint)?void 0:f.name,"total-files":l.length.toString()});null!=(d=s)&&d.view_id&&(w.view_id=s.view_id),null!=(h=s)&&h.type&&(w.type=s.type),null!=(p=s)&&p.name&&(w.name=null==(y=s)?void 0:y.name);var S={results:{entrypoint:null==(m=o.entrypoint)?void 0:m.name,files:[]}},E=Kt(l,function(e){var t,n=l[e],r=n.path||n.webkitRelativePath||n.name;if(null!=(t=r)&&t.includes(":"))throw new Error("Invalid filename: "+r);return Promise.resolve(n.arrayBuffer()).then(function(e){var t,o,i,a,l=n.size,u=null!=(t=n.type)&&t.length?n.type:function(e,t){void 0===t&&(t=void 0);var n=function(e,{extra:t=!1,hint:n}={}){const r=new Uint8Array(e.slice(0,Ct));if(n){const e=function(e,{ext:t,mime:n}){return t||n?Ut(e).filter(e=>e[0]===t||e[1]===n):[]}(jt,n);if(e.length>0){const t=Nt(r,e);if(void 0!==t)return t}}return Nt(r,jt)||(t?function(e){return function(e){try{const t=Ot(e);if(!function(e){for(let t=0;t<e.length;t++)try{const n=e.charCodeAt(t);if(65533===n||n<=8)return!1}catch{return!1}return!0}(t))return;try{return JSON.parse(t),{ext:"json",mime:"application/json"}}catch{return{ext:"txt",mime:"text/plain"}}}catch{return}}(e)}(e):void 0)}(e);if(n)return n.mime;for(var r=new Uint8Array(e).subarray(0,4),o="",i=0;i<r.length;i++)o+=r[i].toString(16);var s="unknown";switch(o){case"676c5446":s="model/gltf-binary";break;case"89504e47":s="image/png";break;case"ffd8ffe0":case"ffd8ffe1":case"ffd8ffe2":case"ffd8ffe3":case"ffd8ffe8":s="image/jpeg";break;default:s="unknown"}return"unknown"===s&&"string"==typeof t&&(t.endsWith(".html")||t.endsWith(".html.gz")?s="text/html":t.endsWith(".js")||t.endsWith(".js.gz")?s="application/javascript":t.endsWith(".wasm")?s="application/wasm":t.endsWith(".css")?s="text/css":t.endsWith(".json")?s="application/json":t.endsWith(".txt")&&(s="text/plain")),s}(e,r);if("deployment"===(null==(o=s)?void 0:o.type)){var c=(i=r,"application/gzip"===(a=u)||"application/brotli"===a?(i.endsWith(".html.gz")||i.endsWith(".html.br")?(a="text/html",i=i.substring(0,i.length-3)):i.endsWith(".js.gz")||i.endsWith(".js.br")||i.endsWith(".mjs.gz")||i.endsWith(".mjs.br")?(a="application/javascript",i=i.substring(0,i.length-3)):i.endsWith(".css.gz")||i.endsWith(".css.br")?(a="text/css",i=i.substring(0,i.length-3)):i.endsWith(".json.gz")||i.endsWith(".json.br")?(a="text/json",i=i.substring(0,i.length-3)):i.endsWith(".txt.gz")||i.endsWith(".txt.br")?(a="text/plain",i=i.substring(0,i.length-3)):i.endsWith(".wasm.gz")||i.endsWith(".wasm.br")?(a="application/wasm",i=i.substring(0,i.length-3)):(i.endsWith(".bin.gz")||i.endsWith(".bin.br"))&&(a="application/octet-stream",i=i.substring(0,i.length-3)),{filename:i,mimetype:a}):null);c&&(r=c.filename,u=c.mimetype)}return Promise.resolve(n.arrayBuffer()).then(function(e){var t=kt(e);S.results.files.push({filename:r,content_type:u,content_length:l,content_md5:t})})})},function(){});return E&&E.then?E.then(g):g()})}catch(e){return Promise.reject(e)}}(t,{triggered_by:"web",entrypoint:void 0,files:[]},s);return $t.push(a),Promise.resolve(a.finally(function(){var e=$t.indexOf(a);e>=0&&$t.splice(e,1)}))}catch(e){return Promise.reject(e)}}({baseUrl:"https://cloud-staging.needle.tools",authToken:t.token},0,{name:t.name,abort:t.abort})}new Array,"undefined"==typeof Symbol||Symbol.iterator||(Symbol.iterator=Symbol("Symbol.iterator"));export{Gt as uploadFiles};
2
+ //# sourceMappingURL=index.esm.js.map