UNPKG

itk-wasm

Version:

High-performance spatial analysis in a web browser, Node.js, and reproducible execution across programming languages and hardware architectures.

6 lines 211 kB
var er=Object.defineProperty;var tr=(A,e)=>{for(var r in e)er(A,r,{get:e[r],enumerable:!0})};var rr="1.0.0-b.188",Ir=rr;var ir={Int8:"int8",UInt8:"uint8",Int16:"int16",UInt16:"uint16",Int32:"int32",UInt32:"uint32",Int64:"int64",UInt64:"uint64",SizeValueType:"uint64",IdentifierType:"uint64",IndexValueType:"int64",OffsetValueType:"int64"},d=ir;var or={Float32:"float32",Float64:"float64",SpacePrecisionType:"float64"},h=or;function ar(A,e){let r=null;switch(A){case d.UInt8:{r=new Uint8Array(e);break}case d.Int8:{r=new Int8Array(e);break}case d.UInt16:{r=new Uint16Array(e);break}case d.Int16:{r=new Int16Array(e);break}case d.UInt32:{r=new Uint32Array(e);break}case d.Int32:{r=new Int32Array(e);break}case d.UInt64:{typeof globalThis.BigUint64Array=="function"?r=new BigUint64Array(e):r=new Uint8Array(e);break}case d.Int64:{typeof globalThis.BigInt64Array=="function"?r=new BigInt64Array(e):r=new Uint8Array(e);break}case h.Float32:{r=new Float32Array(e);break}case h.Float64:{r=new Float64Array(e);break}case"null":{r=null;break}case null:{r=null;break}default:throw new Error("Type is not supported as a TypedArray")}return r}var G=ar;var gr={Unknown:"Unknown",Scalar:"Scalar",RGB:"RGB",RGBA:"RGBA",Offset:"Offset",Vector:"Vector",Point:"Point",CovariantVector:"CovariantVector",SymmetricSecondRankTensor:"SymmetricSecondRankTensor",DiffusionTensor3D:"DiffusionTensor3D",Complex:"Complex",FixedArray:"FixedArray",Array:"Array",Matrix:"Matrix",VariableLengthVector:"VariableLengthVector",VariableSizeMatrix:"VariableSizeMatrix"},N=gr;var YA=class{constructor(e=2,r=d.UInt8,t=N.Scalar,I=1){this.dimension=e;this.componentType=r;this.pixelType=t;this.components=I}},HA=YA;function nr(A,e,r,t,I){A[t+r*e]=I}var xA=nr;var OA=class{constructor(e=new HA){this.imageType=e;let r=e.dimension;this.origin=new Array(r),this.origin.fill(0),this.spacing=new Array(r),this.spacing.fill(1),this.direction=new Float64Array(r*r),this.direction.fill(0);for(let t=0;t<r;t++)xA(this.direction,r,t,t,1);this.size=new Array(r),this.size.fill(0),this.metadata=new Map,this.data=null}name="Image";origin;spacing;direction;size;metadata;data},K=OA;function sr(A){let e=new K(A.imageType);if(e.name=A.name,e.origin=Array.from(A.origin),e.spacing=Array.from(A.spacing),e.direction=A.direction.slice(),e.size=Array.from(A.size),A.data!==null){let r=A.data.constructor;e.data=new r(A.data.length),e.data!=null&&e.data.set(A.data,0)}return e}var qA=sr;var Br=typeof globalThis.SharedArrayBuffer=="function";function Cr(A){if(A.data===null)return A;if(Br){if(A.data.buffer instanceof SharedArrayBuffer)return A;let e=new SharedArrayBuffer(A.data.buffer.byteLength),r=A.data.constructor,t=new r(e);return t!==null&&t.set(A.data,0),A.data=t,A}else return qA(A)}var Qr=Cr;function Er(A){if(A.length<1)throw Error("At least one images is required.");let e=A[0];if(e.data===null)throw Error("Image data is null.");let r=new K(e.imageType);r.origin=Array.from(e.origin),r.spacing=Array.from(e.spacing);let t=r.imageType.dimension;r.direction=e.direction.slice();let I=t-1;r.size=Array.from(e.size);let i=A.reduce((a,n)=>a+n.size[I],0);r.size[I]=i;let o=r.size.reduce((a,n)=>a*n,1)*r.imageType.components,s=e.data.constructor;r.data=new s(o);let Q=r.imageType.components;for(let a=0;a<r.size.length-1;a++)Q*=r.size[a];let C=0;if(r.data!=null)for(let a=0;a<A.length;a++)r.data.set(A[a].data,Q*C),C+=A[a].size[I];else throw Error("Could not create result image data.");return r}var lr=Er;function cr(A){let e=A.slice((A.lastIndexOf(".")-1>>>0)+2);if(e.toLowerCase()==="gz"){let r=A.slice(0,-3).lastIndexOf(".");e=A.slice((r-1>>>0)+2)}else if(e.toLowerCase()==="cbor"){let r=A.slice(0,-5).lastIndexOf(".");e=A.slice((r-1>>>0)+2)}else if(e.toLowerCase()==="zst"){let r=A.slice(0,-10).lastIndexOf(".");e=A.slice((r-1>>>0)+2)}else if(e.toLowerCase()==="zip"){let r=A.slice(0,-4).lastIndexOf(".");e=A.slice((r-1>>>0)+2)}return e}var fr=cr;function ur(A,e,r,t){return A[t+r*e]}var dr=ur;function yr(A,e){let r={...A.imageType};if(typeof e<"u"&&typeof e.pixelType<"u"&&(r.pixelType=e.pixelType,e.pixelType===N.Scalar&&r.components!==1))throw new Error("Cannot cast multi-component image to a scalar image");typeof e<"u"&&typeof e.componentType<"u"&&e.componentType!==A.imageType.componentType&&(r.componentType=e.componentType);let t=new K(r);if(t.name=A.name,t.origin=Array.from(A.origin),t.spacing=Array.from(A.spacing),t.direction=A.direction.slice(),t.size=Array.from(A.size),t.metadata=new Map(JSON.parse(JSON.stringify(Array.from(A.metadata)))),A.data!==null)if(typeof e<"u"&&typeof e.componentType<"u"&&e.componentType!==A.imageType.componentType)switch(A.imageType.componentType){case d.UInt8:case d.Int8:case d.UInt16:case d.Int16:case d.UInt32:case d.Int32:case h.Float32:case h.Float64:switch(t.imageType.componentType){case d.UInt8:if(A.data instanceof BigInt64Array||A.data instanceof BigUint64Array){t.data=new Uint8Array(A.data.length);for(let I=0;I<t.data.length;I++)t.data[I]=Number(A.data[I])}else t.data=new Uint8Array(A.data);break;case d.Int8:if(A.data instanceof BigInt64Array||A.data instanceof BigUint64Array){t.data=new Int8Array(A.data.length);for(let I=0;I<t.data.length;I++)t.data[I]=Number(A.data[I])}else t.data=new Int8Array(A.data);break;case d.UInt16:if(A.data instanceof BigInt64Array||A.data instanceof BigUint64Array){t.data=new Uint16Array(A.data.length);for(let I=0;I<t.data.length;I++)t.data[I]=Number(A.data[I])}else t.data=new Uint16Array(A.data);break;case d.Int16:if(A.data instanceof BigInt64Array||A.data instanceof BigUint64Array){t.data=new Int16Array(A.data.length);for(let I=0;I<t.data.length;I++)t.data[I]=Number(A.data[I])}else t.data=new Int16Array(A.data);break;case d.UInt32:if(A.data instanceof BigInt64Array||A.data instanceof BigUint64Array){t.data=new Uint32Array(A.data.length);for(let I=0;I<t.data.length;I++)t.data[I]=Number(A.data[I])}else t.data=new Uint32Array(A.data);break;case d.Int32:if(A.data instanceof BigInt64Array||A.data instanceof BigUint64Array){t.data=new Int32Array(A.data.length);for(let I=0;I<t.data.length;I++)t.data[I]=Number(A.data[I])}else t.data=new Int32Array(A.data);break;case h.Float32:if(A.data instanceof BigInt64Array||A.data instanceof BigUint64Array){t.data=new Float32Array(A.data.length);for(let I=0;I<t.data.length;I++)t.data[I]=Number(A.data[I])}else t.data=new Float32Array(A.data);break;case h.Float64:if(A.data instanceof BigInt64Array||A.data instanceof BigUint64Array){t.data=new Float64Array(A.data.length);for(let I=0;I<t.data.length;I++)t.data[I]=Number(A.data[I])}else t.data=new Float64Array(A.data);break;case d.UInt64:t.data=new BigUint64Array(A.data.length);for(let I=0;I<t.data.length;I++)t.data[I]=BigInt.asIntN(64,BigInt(A.data[I]));break;case d.Int64:t.data=new BigInt64Array(A.data.length);for(let I=0;I<t.data.length;I++)t.data[I]=BigInt.asUintN(64,BigInt(A.data[I]));break}break;case d.UInt64:case d.Int64:switch(t.imageType.componentType){case d.UInt8:t.data=new Uint8Array(A.data.length);for(let I=0;I<t.data.length;I++)t.data[I]=Number(A.data[I]);break;case d.Int8:t.data=new Int8Array(A.data.length);for(let I=0;I<t.data.length;I++)t.data[I]=Number(A.data[I]);break;case d.UInt16:t.data=new Uint16Array(A.data.length);for(let I=0;I<t.data.length;I++)t.data[I]=Number(A.data[I]);break;case d.Int16:t.data=new Int16Array(A.data.length);for(let I=0;I<t.data.length;I++)t.data[I]=Number(A.data[I]);break;case d.UInt32:t.data=new Uint32Array(A.data.length);for(let I=0;I<t.data.length;I++)t.data[I]=Number(A.data[I]);break;case d.Int32:t.data=new Int32Array(A.data.length);for(let I=0;I<t.data.length;I++)t.data[I]=Number(A.data[I]);break;case h.Float32:t.data=new Float32Array(A.data.length);for(let I=0;I<t.data.length;I++)t.data[I]=Number(A.data[I]);break;case h.Float64:t.data=new Float64Array(A.data.length);for(let I=0;I<t.data.length;I++)t.data[I]=Number(A.data[I]);break;case d.UInt64:if(A.data instanceof BigInt64Array||A.data instanceof BigUint64Array)t.data=new BigUint64Array(A.data);else{t.data=new BigUint64Array(A.data.length);for(let I=0;I<t.data.length;I++)t.data[I]=BigInt.asUintN(64,BigInt(A.data[I]))}break;case d.Int64:if(A.data instanceof BigInt64Array||A.data instanceof BigUint64Array)t.data=new BigInt64Array(A.data);else{t.data=new BigInt64Array(A.data.length);for(let I=0;I<t.data.length;I++)t.data[I]=BigInt.asIntN(64,BigInt(A.data[I]))}break}break}else{let I=A.data.constructor;t.data=new I(A.data.length),t.data!=null&&t.data.set(A.data,0)}return t}var pr=yr;var PA=class{fcn;workerQueue;runInfo;constructor(e,r){this.fcn=r,this.workerQueue=new Array(e),this.workerQueue.fill(null),this.runInfo=[]}runTasks(e,r=null){let t={taskQueue:[],results:[],addingTasks:!1,postponed:!1,runningWorkers:0,index:0,completedTasks:0,progressCallback:r,canceled:!1};return this.runInfo.push(t),t.index=this.runInfo.length-1,{promise:new Promise((I,i)=>{t.resolve=I,t.reject=i,t.results=new Array(e.length),t.completedTasks=0,t.addingTasks=!0,e.forEach((o,s)=>{this.addTask(t.index,s,o)}),t.addingTasks=!1}),runId:t.index}}terminateWorkers(){for(let e=0;e<this.workerQueue.length;e++){let r=this.workerQueue[e];r?.terminate(),this.workerQueue[e]=null}}cancel(e){let r=this.runInfo[e];r!=null&&(r.canceled=!0)}addTask(e,r,t){let I=this.runInfo[e];if(I?.canceled===!0){I.reject("Remaining tasks canceled"),this.clearTask(I.index);return}if(this.workerQueue.length>0){let i=this.workerQueue.pop();I.runningWorkers++,t[t.length-1].webWorker=i,this.fcn(...t).then(({webWorker:o,...s})=>{if(this.workerQueue.push(o),this.runInfo[e]!==null){if(I.runningWorkers--,I.results[r]=s,I.completedTasks++,I.progressCallback!=null&&I.progressCallback(I.completedTasks,I.results.length),I.taskQueue.length>0){let Q=I.taskQueue.shift();this.addTask(e,Q[0],Q[1])}else if(!I.addingTasks&&I.runningWorkers===0){let Q=I.results;I.resolve(Q),this.clearTask(I.index)}}}).catch(o=>{I.reject(o),this.clearTask(I.index)})}else I.runningWorkers!==0||I.postponed?I.taskQueue.push([r,t]):(I.postponed=!0,setTimeout(()=>{I.postponed=!1,this.addTask(I.index,r,t)},50))}clearTask(e){this.runInfo[e].results=[],this.runInfo[e].taskQueue=[],this.runInfo[e].progressCallback=null,this.runInfo[e].canceled=null,this.runInfo[e].reject=()=>{},this.runInfo[e].resolve=()=>{}}},hr=PA;var KA=class{constructor(e=3,r=h.Float32,t=h.Float32,I=N.Scalar,i=1){this.dimension=e;this.pointComponentType=r;this.pointPixelComponentType=t;this.pointPixelType=I;this.pointPixelComponents=i}},WA=KA;var jA=class{constructor(e=new WA){this.pointSetType=e;this.name="PointSet",this.numberOfPoints=0,this.points=null,this.numberOfPointPixels=0,this.pointData=null}name="PointSet";numberOfPoints;points;numberOfPointPixels;pointData},mr=jA;var vA=class{constructor(e=2,r=h.Float32,t=h.Float32,I=N.Scalar,i=1,o=d.Int32,s=h.Float32,Q=N.Scalar,C=1){this.dimension=e;this.pointComponentType=r;this.pointPixelComponentType=t;this.pointPixelType=I;this.pointPixelComponents=i;this.cellComponentType=o;this.cellPixelComponentType=s;this.cellPixelType=Q;this.cellPixelComponents=C}},ZA=vA;var VA=class{constructor(e=new ZA){this.meshType=e;this.name="Mesh",this.numberOfPoints=0,this.points=null,this.numberOfPointPixels=0,this.pointData=null,this.numberOfCells=0,this.cellBufferSize=0,this.cells=null,this.numberOfCellPixels=0,this.cellData=null}name="Mesh";numberOfPoints;points;numberOfPointPixels;pointData;numberOfCells;cells;cellBufferSize;numberOfCellPixels;cellData},Dr=VA;var zA=class{constructor(e=h.Float32,r=N.Scalar,t=1,I=h.Float32,i=N.Scalar,o=1){this.pointPixelComponentType=e;this.pointPixelType=r;this.pointPixelComponents=t;this.cellPixelComponentType=I;this.cellPixelType=i;this.cellPixelComponents=o}},XA=zA;var _A=class{constructor(e=new XA){this.polyDataType=e;this.polyDataType=e,this.name="PolyData",this.numberOfPoints=0,this.points=new Float32Array,this.verticesBufferSize=0,this.vertices=null,this.linesBufferSize=0,this.lines=null,this.polygonsBufferSize=0,this.polygons=null,this.triangleStripsBufferSize=0,this.triangleStrips=null,this.numberOfPointPixels=0,this.pointData=null,this.numberOfCellPixels=0,this.cellData=null,this.metadata=new Map}name="PolyData";numberOfPoints;points;verticesBufferSize;vertices;linesBufferSize;lines;polygonsBufferSize;polygons;triangleStripsBufferSize;triangleStrips;numberOfPointPixels;pointData;numberOfCellPixels;cellData;metadata},wr=_A;var Sr={Composite:"Composite",Identity:"Identity",Translation:"Translation",Euler2D:"Euler2D",Euler3D:"Euler3D",Rigid2D:"Rigid2D",Rigid3D:"Rigid3D",Rigid3DPerspective:"Rigid3DPerspective",Versor:"Versor",VersorRigid3D:"VersorRigid3D",Scale:"Scale",ScaleLogarithmic:"ScaleLogarithmic",ScaleSkewVersor3D:"ScaleSkewVersor3D",Similarity2D:"Similarity2D",Similarity3D:"Similarity3D",QuaternionRigid:"QuaternionRigid",Affine:"Affine",ScalableAffine:"ScalableAffine",AzimuthElevationToCartesian:"AzimuthElevationToCartesian",BSpline:"BSpline",BSplineSmoothingOnUpdateDisplacementField:"BSplineSmoothingOnUpdateDisplacementField",ConstantVelocityField:"ConstantVelocityField",DisplacementField:"DisplacementField",GaussianSmoothingOnUpdateDisplacementField:"GaussianSmoothingOnUpdateDisplacementField",GaussianExponentialDiffeomorphic:"GaussianExponentialDiffeomorphic",VelocityField:"VelocityField",TimeVaringVelocityField:"TimeVaringVelocityField",GaussianSmoothingOnUpdateTimeVaringVelocityField:"GaussianSmoothingOnUpdateTimeVaringVelocityField"},$A=Sr;var Ae=class{constructor(e=$A.Identity,r=h.Float64,t=3,I=3){this.transformParameterization=e;this.parametersValueType=r;this.inputDimension=t;this.outputDimension=I}},ee=Ae;var te=class{transformType;numberOfFixedParameters;numberOfParameters;name="Transform";inputSpaceName;outputSpaceName;parameters;fixedParameters;constructor(e=new ee){this.transformType=e,this.numberOfFixedParameters=0,this.numberOfParameters=0,this.inputSpaceName="",this.outputSpaceName="",this.parameters=new Uint8Array(0),this.fixedParameters=new Uint8Array(0)}},Fr=te;var Rr={TextFile:"TextFile",BinaryFile:"BinaryFile",TextStream:"TextStream",BinaryStream:"BinaryStream",Image:"Image",PointSet:"PointSet",Mesh:"Mesh",PolyData:"PolyData",TransformList:"TransformList",JsonCompatible:"JsonCompatible"},p=Rr;function kr(){let A=typeof globalThis.SharedArrayBuffer=="function",e=typeof process=="object"&&typeof process.versions=="object"&&typeof process.versions.node=="string"&&process.type!=="renderer",r=typeof crossOriginIsolated<"u"?crossOriginIsolated:globalThis.crossOriginIsolated||!1;return e?A:A&&r}var Ur=kr;var Ye=Symbol("Comlink.proxy"),Nr=Symbol("Comlink.endpoint"),ie=Symbol("Comlink.releaseProxy"),re=Symbol("Comlink.finalizer"),cA=Symbol("Comlink.thrown"),He=A=>typeof A=="object"&&A!==null||typeof A=="function",br={canHandle:A=>He(A)&&A[Ye],serialize(A){let{port1:e,port2:r}=new MessageChannel;return Oe(A,e),[r,[r]]},deserialize(A){return A.start(),oe(A)}},Gr={canHandle:A=>He(A)&&cA in A,serialize({value:A}){let e;return A instanceof Error?e={isError:!0,value:{message:A.message,name:A.name,stack:A.stack}}:e={isError:!1,value:A},[e,[]]},deserialize(A){throw A.isError?Object.assign(new Error(A.value.message),A.value):A.value}},xe=new Map([["proxy",br],["throw",Gr]]);function Lr(A,e){for(let r of A)if(e===r||r==="*"||r instanceof RegExp&&r.test(e))return!0;return!1}function Oe(A,e=globalThis,r=["*"]){e.addEventListener("message",function t(I){if(!I||!I.data)return;if(!Lr(r,I.origin)){console.warn(`Invalid origin '${I.origin}' for comlink proxy`);return}let{id:i,type:o,path:s}=Object.assign({path:[]},I.data),Q=(I.data.argumentList||[]).map(W),C;try{let a=s.slice(0,-1).reduce((c,B)=>c[B],A),n=s.reduce((c,B)=>c[B],A);switch(o){case"GET":C=n;break;case"SET":a[s.slice(-1)[0]]=W(I.data.value),C=!0;break;case"APPLY":C=n.apply(a,Q);break;case"CONSTRUCT":{let c=new n(...Q);C=Hr(c)}break;case"ENDPOINT":{let{port1:c,port2:B}=new MessageChannel;Oe(A,B),C=ae(c,[c])}break;case"RELEASE":C=void 0;break;default:return}}catch(a){C={value:a,[cA]:0}}Promise.resolve(C).catch(a=>({value:a,[cA]:0})).then(a=>{let[n,c]=dA(a);e.postMessage(Object.assign(Object.assign({},n),{id:i}),c),o==="RELEASE"&&(e.removeEventListener("message",t),qe(e),re in A&&typeof A[re]=="function"&&A[re]())}).catch(a=>{let[n,c]=dA({value:new TypeError("Unserializable return value"),[cA]:0});e.postMessage(Object.assign(Object.assign({},n),{id:i}),c)})}),e.start&&e.start()}function Tr(A){return A.constructor.name==="MessagePort"}function qe(A){Tr(A)&&A.close()}function oe(A,e){return Ie(A,[],e)}function lA(A){if(A)throw new Error("Proxy has been released and is not useable")}function Pe(A){return v(A,{type:"RELEASE"}).then(()=>{qe(A)})}var fA=new WeakMap,uA="FinalizationRegistry"in globalThis&&new FinalizationRegistry(A=>{let e=(fA.get(A)||0)-1;fA.set(A,e),e===0&&Pe(A)});function Mr(A,e){let r=(fA.get(e)||0)+1;fA.set(e,r),uA&&uA.register(A,e,A)}function Jr(A){uA&&uA.unregister(A)}function Ie(A,e=[],r=function(){}){let t=!1,I=new Proxy(r,{get(i,o){if(lA(t),o===ie)return()=>{Jr(I),Pe(A),t=!0};if(o==="then"){if(e.length===0)return{then:()=>I};let s=v(A,{type:"GET",path:e.map(Q=>Q.toString())}).then(W);return s.then.bind(s)}return Ie(A,[...e,o])},set(i,o,s){lA(t);let[Q,C]=dA(s);return v(A,{type:"SET",path:[...e,o].map(a=>a.toString()),value:Q},C).then(W)},apply(i,o,s){lA(t);let Q=e[e.length-1];if(Q===Nr)return v(A,{type:"ENDPOINT"}).then(W);if(Q==="bind")return Ie(A,e.slice(0,-1));let[C,a]=Je(s);return v(A,{type:"APPLY",path:e.map(n=>n.toString()),argumentList:C},a).then(W)},construct(i,o){lA(t);let[s,Q]=Je(o);return v(A,{type:"CONSTRUCT",path:e.map(C=>C.toString()),argumentList:s},Q).then(W)}});return Mr(I,A),I}function Yr(A){return Array.prototype.concat.apply([],A)}function Je(A){let e=A.map(dA);return[e.map(r=>r[0]),Yr(e.map(r=>r[1]))]}var Ke=new WeakMap;function ae(A,e){return Ke.set(A,e),A}function Hr(A){return Object.assign(A,{[Ye]:!0})}function dA(A){for(let[e,r]of xe)if(r.canHandle(A)){let[t,I]=r.serialize(A);return[{type:"HANDLER",name:e,value:t},I]}return[{type:"RAW",value:A},Ke.get(A)||[]]}function W(A){switch(A.type){case"HANDLER":return xe.get(A.name).deserialize(A.value);case"RAW":return A.value}}function v(A,e,r){return new Promise(t=>{let I=xr();A.addEventListener("message",function i(o){!o.data||!o.data.id||o.data.id!==I||(A.removeEventListener("message",i),t(o.data))}),A.start&&A.start(),A.postMessage(Object.assign({id:I},e),r)})}function xr(){return new Array(4).fill(0).map(()=>Math.floor(Math.random()*Number.MAX_SAFE_INTEGER).toString(16)).join("-")}function eA(A,e){return function(){return A.apply(e,arguments)}}var{toString:Or}=Object.prototype,{getPrototypeOf:ne}=Object,pA=(A=>e=>{let r=Or.call(e);return A[r]||(A[r]=r.slice(8,-1).toLowerCase())})(Object.create(null)),L=A=>(A=A.toLowerCase(),e=>pA(e)===A),hA=A=>e=>typeof e===A,{isArray:Z}=Array,tA=hA("undefined");function qr(A){return A!==null&&!tA(A)&&A.constructor!==null&&!tA(A.constructor)&&b(A.constructor.isBuffer)&&A.constructor.isBuffer(A)}var ve=L("ArrayBuffer");function Pr(A){let e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(A):e=A&&A.buffer&&ve(A.buffer),e}var Kr=hA("string"),b=hA("function"),Ze=hA("number"),mA=A=>A!==null&&typeof A=="object",Wr=A=>A===!0||A===!1,yA=A=>{if(pA(A)!=="object")return!1;let e=ne(A);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in A)&&!(Symbol.iterator in A)},jr=L("Date"),vr=L("File"),Zr=L("Blob"),Vr=L("FileList"),zr=A=>mA(A)&&b(A.pipe),Xr=A=>{let e;return A&&(typeof FormData=="function"&&A instanceof FormData||b(A.append)&&((e=pA(A))==="formdata"||e==="object"&&b(A.toString)&&A.toString()==="[object FormData]"))},_r=L("URLSearchParams"),[$r,AI,eI,tI]=["ReadableStream","Request","Response","Headers"].map(L),rI=A=>A.trim?A.trim():A.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function rA(A,e,{allOwnKeys:r=!1}={}){if(A===null||typeof A>"u")return;let t,I;if(typeof A!="object"&&(A=[A]),Z(A))for(t=0,I=A.length;t<I;t++)e.call(null,A[t],t,A);else{let i=r?Object.getOwnPropertyNames(A):Object.keys(A),o=i.length,s;for(t=0;t<o;t++)s=i[t],e.call(null,A[s],s,A)}}function Ve(A,e){e=e.toLowerCase();let r=Object.keys(A),t=r.length,I;for(;t-- >0;)if(I=r[t],e===I.toLowerCase())return I;return null}var j=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,ze=A=>!tA(A)&&A!==j;function ge(){let{caseless:A}=ze(this)&&this||{},e={},r=(t,I)=>{let i=A&&Ve(e,I)||I;yA(e[i])&&yA(t)?e[i]=ge(e[i],t):yA(t)?e[i]=ge({},t):Z(t)?e[i]=t.slice():e[i]=t};for(let t=0,I=arguments.length;t<I;t++)arguments[t]&&rA(arguments[t],r);return e}var II=(A,e,r,{allOwnKeys:t}={})=>(rA(e,(I,i)=>{r&&b(I)?A[i]=eA(I,r):A[i]=I},{allOwnKeys:t}),A),iI=A=>(A.charCodeAt(0)===65279&&(A=A.slice(1)),A),oI=(A,e,r,t)=>{A.prototype=Object.create(e.prototype,t),A.prototype.constructor=A,Object.defineProperty(A,"super",{value:e.prototype}),r&&Object.assign(A.prototype,r)},aI=(A,e,r,t)=>{let I,i,o,s={};if(e=e||{},A==null)return e;do{for(I=Object.getOwnPropertyNames(A),i=I.length;i-- >0;)o=I[i],(!t||t(o,A,e))&&!s[o]&&(e[o]=A[o],s[o]=!0);A=r!==!1&&ne(A)}while(A&&(!r||r(A,e))&&A!==Object.prototype);return e},gI=(A,e,r)=>{A=String(A),(r===void 0||r>A.length)&&(r=A.length),r-=e.length;let t=A.indexOf(e,r);return t!==-1&&t===r},nI=A=>{if(!A)return null;if(Z(A))return A;let e=A.length;if(!Ze(e))return null;let r=new Array(e);for(;e-- >0;)r[e]=A[e];return r},sI=(A=>e=>A&&e instanceof A)(typeof Uint8Array<"u"&&ne(Uint8Array)),BI=(A,e)=>{let t=(A&&A[Symbol.iterator]).call(A),I;for(;(I=t.next())&&!I.done;){let i=I.value;e.call(A,i[0],i[1])}},CI=(A,e)=>{let r,t=[];for(;(r=A.exec(e))!==null;)t.push(r);return t},QI=L("HTMLFormElement"),EI=A=>A.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(r,t,I){return t.toUpperCase()+I}),je=(({hasOwnProperty:A})=>(e,r)=>A.call(e,r))(Object.prototype),lI=L("RegExp"),Xe=(A,e)=>{let r=Object.getOwnPropertyDescriptors(A),t={};rA(r,(I,i)=>{let o;(o=e(I,i,A))!==!1&&(t[i]=o||I)}),Object.defineProperties(A,t)},cI=A=>{Xe(A,(e,r)=>{if(b(A)&&["arguments","caller","callee"].indexOf(r)!==-1)return!1;let t=A[r];if(b(t)){if(e.enumerable=!1,"writable"in e){e.writable=!1;return}e.set||(e.set=()=>{throw Error("Can not rewrite read-only method '"+r+"'")})}})},fI=(A,e)=>{let r={},t=I=>{I.forEach(i=>{r[i]=!0})};return Z(A)?t(A):t(String(A).split(e)),r},uI=()=>{},dI=(A,e)=>A!=null&&Number.isFinite(A=+A)?A:e;function yI(A){return!!(A&&b(A.append)&&A[Symbol.toStringTag]==="FormData"&&A[Symbol.iterator])}var pI=A=>{let e=new Array(10),r=(t,I)=>{if(mA(t)){if(e.indexOf(t)>=0)return;if(!("toJSON"in t)){e[I]=t;let i=Z(t)?[]:{};return rA(t,(o,s)=>{let Q=r(o,I+1);!tA(Q)&&(i[s]=Q)}),e[I]=void 0,i}}return t};return r(A,0)},hI=L("AsyncFunction"),mI=A=>A&&(mA(A)||b(A))&&b(A.then)&&b(A.catch),_e=((A,e)=>A?setImmediate:e?((r,t)=>(j.addEventListener("message",({source:I,data:i})=>{I===j&&i===r&&t.length&&t.shift()()},!1),I=>{t.push(I),j.postMessage(r,"*")}))(`axios@${Math.random()}`,[]):r=>setTimeout(r))(typeof setImmediate=="function",b(j.postMessage)),DI=typeof queueMicrotask<"u"?queueMicrotask.bind(j):typeof process<"u"&&process.nextTick||_e,g={isArray:Z,isArrayBuffer:ve,isBuffer:qr,isFormData:Xr,isArrayBufferView:Pr,isString:Kr,isNumber:Ze,isBoolean:Wr,isObject:mA,isPlainObject:yA,isReadableStream:$r,isRequest:AI,isResponse:eI,isHeaders:tI,isUndefined:tA,isDate:jr,isFile:vr,isBlob:Zr,isRegExp:lI,isFunction:b,isStream:zr,isURLSearchParams:_r,isTypedArray:sI,isFileList:Vr,forEach:rA,merge:ge,extend:II,trim:rI,stripBOM:iI,inherits:oI,toFlatObject:aI,kindOf:pA,kindOfTest:L,endsWith:gI,toArray:nI,forEachEntry:BI,matchAll:CI,isHTMLForm:QI,hasOwnProperty:je,hasOwnProp:je,reduceDescriptors:Xe,freezeMethods:cI,toObjectSet:fI,toCamelCase:EI,noop:uI,toFiniteNumber:dI,findKey:Ve,global:j,isContextDefined:ze,isSpecCompliantForm:yI,toJSONObject:pI,isAsyncFn:hI,isThenable:mI,setImmediate:_e,asap:DI};function V(A,e,r,t,I){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=A,this.name="AxiosError",e&&(this.code=e),r&&(this.config=r),t&&(this.request=t),I&&(this.response=I,this.status=I.status?I.status:null)}g.inherits(V,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:g.toJSONObject(this.config),code:this.code,status:this.status}}});var $e=V.prototype,At={};["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(A=>{At[A]={value:A}});Object.defineProperties(V,At);Object.defineProperty($e,"isAxiosError",{value:!0});V.from=(A,e,r,t,I,i)=>{let o=Object.create($e);return g.toFlatObject(A,o,function(Q){return Q!==Error.prototype},s=>s!=="isAxiosError"),V.call(o,A.message,e,r,t,I),o.cause=A,o.name=A.name,i&&Object.assign(o,i),o};var u=V;var DA=null;function se(A){return g.isPlainObject(A)||g.isArray(A)}function tt(A){return g.endsWith(A,"[]")?A.slice(0,-2):A}function et(A,e,r){return A?A.concat(e).map(function(I,i){return I=tt(I),!r&&i?"["+I+"]":I}).join(r?".":""):e}function wI(A){return g.isArray(A)&&!A.some(se)}var SI=g.toFlatObject(g,{},null,function(e){return/^is[A-Z]/.test(e)});function FI(A,e,r){if(!g.isObject(A))throw new TypeError("target must be an object");e=e||new(DA||FormData),r=g.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,function(f,l){return!g.isUndefined(l[f])});let t=r.metaTokens,I=r.visitor||a,i=r.dots,o=r.indexes,Q=(r.Blob||typeof Blob<"u"&&Blob)&&g.isSpecCompliantForm(e);if(!g.isFunction(I))throw new TypeError("visitor must be a function");function C(E){if(E===null)return"";if(g.isDate(E))return E.toISOString();if(!Q&&g.isBlob(E))throw new u("Blob is not supported. Use a Buffer instead.");return g.isArrayBuffer(E)||g.isTypedArray(E)?Q&&typeof Blob=="function"?new Blob([E]):Buffer.from(E):E}function a(E,f,l){let y=E;if(E&&!l&&typeof E=="object"){if(g.endsWith(f,"{}"))f=t?f:f.slice(0,-2),E=JSON.stringify(E);else if(g.isArray(E)&&wI(E)||(g.isFileList(E)||g.endsWith(f,"[]"))&&(y=g.toArray(E)))return f=tt(f),y.forEach(function(w,Y){!(g.isUndefined(w)||w===null)&&e.append(o===!0?et([f],Y,i):o===null?f:f+"[]",C(w))}),!1}return se(E)?!0:(e.append(et(l,f,i),C(E)),!1)}let n=[],c=Object.assign(SI,{defaultVisitor:a,convertValue:C,isVisitable:se});function B(E,f){if(!g.isUndefined(E)){if(n.indexOf(E)!==-1)throw Error("Circular reference detected in "+f.join("."));n.push(E),g.forEach(E,function(y,m){(!(g.isUndefined(y)||y===null)&&I.call(e,y,g.isString(m)?m.trim():m,f,c))===!0&&B(y,f?f.concat(m):[m])}),n.pop()}}if(!g.isObject(A))throw new TypeError("data must be an object");return B(A),e}var O=FI;function rt(A){let e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(A).replace(/[!'()~]|%20|%00/g,function(t){return e[t]})}function It(A,e){this._pairs=[],A&&O(A,this,e)}var it=It.prototype;it.append=function(e,r){this._pairs.push([e,r])};it.toString=function(e){let r=e?function(t){return e.call(this,t,rt)}:rt;return this._pairs.map(function(I){return r(I[0])+"="+r(I[1])},"").join("&")};var wA=It;function RI(A){return encodeURIComponent(A).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function IA(A,e,r){if(!e)return A;let t=r&&r.encode||RI;g.isFunction(r)&&(r={serialize:r});let I=r&&r.serialize,i;if(I?i=I(e,r):i=g.isURLSearchParams(e)?e.toString():new wA(e,r).toString(t),i){let o=A.indexOf("#");o!==-1&&(A=A.slice(0,o)),A+=(A.indexOf("?")===-1?"?":"&")+i}return A}var Be=class{constructor(){this.handlers=[]}use(e,r,t){return this.handlers.push({fulfilled:e,rejected:r,synchronous:t?t.synchronous:!1,runWhen:t?t.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){g.forEach(this.handlers,function(t){t!==null&&e(t)})}},Ce=Be;var SA={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1};var ot=typeof URLSearchParams<"u"?URLSearchParams:wA;var at=typeof FormData<"u"?FormData:null;var gt=typeof Blob<"u"?Blob:null;var nt={isBrowser:!0,classes:{URLSearchParams:ot,FormData:at,Blob:gt},protocols:["http","https","file","blob","url","data"]};var le={};tr(le,{hasBrowserEnv:()=>Ee,hasStandardBrowserEnv:()=>kI,hasStandardBrowserWebWorkerEnv:()=>UI,navigator:()=>Qe,origin:()=>NI});var Ee=typeof window<"u"&&typeof document<"u",Qe=typeof navigator=="object"&&navigator||void 0,kI=Ee&&(!Qe||["ReactNative","NativeScript","NS"].indexOf(Qe.product)<0),UI=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",NI=Ee&&window.location.href||"http://localhost";var D={...le,...nt};function ce(A,e){return O(A,new D.classes.URLSearchParams,Object.assign({visitor:function(r,t,I,i){return D.isNode&&g.isBuffer(r)?(this.append(t,r.toString("base64")),!1):i.defaultVisitor.apply(this,arguments)}},e))}function bI(A){return g.matchAll(/\w+|\[(\w*)]/g,A).map(e=>e[0]==="[]"?"":e[1]||e[0])}function GI(A){let e={},r=Object.keys(A),t,I=r.length,i;for(t=0;t<I;t++)i=r[t],e[i]=A[i];return e}function LI(A){function e(r,t,I,i){let o=r[i++];if(o==="__proto__")return!0;let s=Number.isFinite(+o),Q=i>=r.length;return o=!o&&g.isArray(I)?I.length:o,Q?(g.hasOwnProp(I,o)?I[o]=[I[o],t]:I[o]=t,!s):((!I[o]||!g.isObject(I[o]))&&(I[o]=[]),e(r,t,I[o],i)&&g.isArray(I[o])&&(I[o]=GI(I[o])),!s)}if(g.isFormData(A)&&g.isFunction(A.entries)){let r={};return g.forEachEntry(A,(t,I)=>{e(bI(t),I,r,0)}),r}return null}var FA=LI;function TI(A,e,r){if(g.isString(A))try{return(e||JSON.parse)(A),g.trim(A)}catch(t){if(t.name!=="SyntaxError")throw t}return(r||JSON.stringify)(A)}var fe={transitional:SA,adapter:["xhr","http","fetch"],transformRequest:[function(e,r){let t=r.getContentType()||"",I=t.indexOf("application/json")>-1,i=g.isObject(e);if(i&&g.isHTMLForm(e)&&(e=new FormData(e)),g.isFormData(e))return I?JSON.stringify(FA(e)):e;if(g.isArrayBuffer(e)||g.isBuffer(e)||g.isStream(e)||g.isFile(e)||g.isBlob(e)||g.isReadableStream(e))return e;if(g.isArrayBufferView(e))return e.buffer;if(g.isURLSearchParams(e))return r.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let s;if(i){if(t.indexOf("application/x-www-form-urlencoded")>-1)return ce(e,this.formSerializer).toString();if((s=g.isFileList(e))||t.indexOf("multipart/form-data")>-1){let Q=this.env&&this.env.FormData;return O(s?{"files[]":e}:e,Q&&new Q,this.formSerializer)}}return i||I?(r.setContentType("application/json",!1),TI(e)):e}],transformResponse:[function(e){let r=this.transitional||fe.transitional,t=r&&r.forcedJSONParsing,I=this.responseType==="json";if(g.isResponse(e)||g.isReadableStream(e))return e;if(e&&g.isString(e)&&(t&&!this.responseType||I)){let o=!(r&&r.silentJSONParsing)&&I;try{return JSON.parse(e)}catch(s){if(o)throw s.name==="SyntaxError"?u.from(s,u.ERR_BAD_RESPONSE,this,null,this.response):s}}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}}};g.forEach(["delete","get","head","post","put","patch"],A=>{fe.headers[A]={}});var z=fe;var MI=g.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"]),st=A=>{let e={},r,t,I;return A&&A.split(` `).forEach(function(o){I=o.indexOf(":"),r=o.substring(0,I).trim().toLowerCase(),t=o.substring(I+1).trim(),!(!r||e[r]&&MI[r])&&(r==="set-cookie"?e[r]?e[r].push(t):e[r]=[t]:e[r]=e[r]?e[r]+", "+t:t)}),e};var Bt=Symbol("internals");function iA(A){return A&&String(A).trim().toLowerCase()}function RA(A){return A===!1||A==null?A:g.isArray(A)?A.map(RA):String(A)}function JI(A){let e=Object.create(null),r=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g,t;for(;t=r.exec(A);)e[t[1]]=t[2];return e}var YI=A=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(A.trim());function ue(A,e,r,t,I){if(g.isFunction(t))return t.call(this,e,r);if(I&&(e=r),!!g.isString(e)){if(g.isString(t))return e.indexOf(t)!==-1;if(g.isRegExp(t))return t.test(e)}}function HI(A){return A.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,r,t)=>r.toUpperCase()+t)}function xI(A,e){let r=g.toCamelCase(" "+e);["get","set","has"].forEach(t=>{Object.defineProperty(A,t+r,{value:function(I,i,o){return this[t].call(this,e,I,i,o)},configurable:!0})})}var X=class{constructor(e){e&&this.set(e)}set(e,r,t){let I=this;function i(s,Q,C){let a=iA(Q);if(!a)throw new Error("header name must be a non-empty string");let n=g.findKey(I,a);(!n||I[n]===void 0||C===!0||C===void 0&&I[n]!==!1)&&(I[n||Q]=RA(s))}let o=(s,Q)=>g.forEach(s,(C,a)=>i(C,a,Q));if(g.isPlainObject(e)||e instanceof this.constructor)o(e,r);else if(g.isString(e)&&(e=e.trim())&&!YI(e))o(st(e),r);else if(g.isHeaders(e))for(let[s,Q]of e.entries())i(Q,s,t);else e!=null&&i(r,e,t);return this}get(e,r){if(e=iA(e),e){let t=g.findKey(this,e);if(t){let I=this[t];if(!r)return I;if(r===!0)return JI(I);if(g.isFunction(r))return r.call(this,I,t);if(g.isRegExp(r))return r.exec(I);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,r){if(e=iA(e),e){let t=g.findKey(this,e);return!!(t&&this[t]!==void 0&&(!r||ue(this,this[t],t,r)))}return!1}delete(e,r){let t=this,I=!1;function i(o){if(o=iA(o),o){let s=g.findKey(t,o);s&&(!r||ue(t,t[s],s,r))&&(delete t[s],I=!0)}}return g.isArray(e)?e.forEach(i):i(e),I}clear(e){let r=Object.keys(this),t=r.length,I=!1;for(;t--;){let i=r[t];(!e||ue(this,this[i],i,e,!0))&&(delete this[i],I=!0)}return I}normalize(e){let r=this,t={};return g.forEach(this,(I,i)=>{let o=g.findKey(t,i);if(o){r[o]=RA(I),delete r[i];return}let s=e?HI(i):String(i).trim();s!==i&&delete r[i],r[s]=RA(I),t[s]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){let r=Object.create(null);return g.forEach(this,(t,I)=>{t!=null&&t!==!1&&(r[I]=e&&g.isArray(t)?t.join(", "):t)}),r}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,r])=>e+": "+r).join(` `)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...r){let t=new this(e);return r.forEach(I=>t.set(I)),t}static accessor(e){let t=(this[Bt]=this[Bt]={accessors:{}}).accessors,I=this.prototype;function i(o){let s=iA(o);t[s]||(xI(I,o),t[s]=!0)}return g.isArray(e)?e.forEach(i):i(e),this}};X.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);g.reduceDescriptors(X.prototype,({value:A},e)=>{let r=e[0].toUpperCase()+e.slice(1);return{get:()=>A,set(t){this[r]=t}}});g.freezeMethods(X);var R=X;function oA(A,e){let r=this||z,t=e||r,I=R.from(t.headers),i=t.data;return g.forEach(A,function(s){i=s.call(r,i,I.normalize(),e?e.status:void 0)}),I.normalize(),i}function aA(A){return!!(A&&A.__CANCEL__)}function Ct(A,e,r){u.call(this,A??"canceled",u.ERR_CANCELED,e,r),this.name="CanceledError"}g.inherits(Ct,u,{__CANCEL__:!0});var M=Ct;function gA(A,e,r){let t=r.config.validateStatus;!r.status||!t||t(r.status)?A(r):e(new u("Request failed with status code "+r.status,[u.ERR_BAD_REQUEST,u.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r))}function de(A){let e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(A);return e&&e[1]||""}function OI(A,e){A=A||10;let r=new Array(A),t=new Array(A),I=0,i=0,o;return e=e!==void 0?e:1e3,function(Q){let C=Date.now(),a=t[i];o||(o=C),r[I]=Q,t[I]=C;let n=i,c=0;for(;n!==I;)c+=r[n++],n=n%A;if(I=(I+1)%A,I===i&&(i=(i+1)%A),C-o<e)return;let B=a&&C-a;return B?Math.round(c*1e3/B):void 0}}var Qt=OI;function qI(A,e){let r=0,t=1e3/e,I,i,o=(C,a=Date.now())=>{r=a,I=null,i&&(clearTimeout(i),i=null),A.apply(null,C)};return[(...C)=>{let a=Date.now(),n=a-r;n>=t?o(C,a):(I=C,i||(i=setTimeout(()=>{i=null,o(I)},t-n)))},()=>I&&o(I)]}var Et=qI;var _=(A,e,r=3)=>{let t=0,I=Qt(50,250);return Et(i=>{let o=i.loaded,s=i.lengthComputable?i.total:void 0,Q=o-t,C=I(Q),a=o<=s;t=o;let n={loaded:o,total:s,progress:s?o/s:void 0,bytes:Q,rate:C||void 0,estimated:C&&s&&a?(s-o)/C:void 0,event:i,lengthComputable:s!=null,[e?"download":"upload"]:!0};A(n)},r)},ye=(A,e)=>{let r=A!=null;return[t=>e[0]({lengthComputable:r,total:A,loaded:t}),e[1]]},pe=A=>(...e)=>g.asap(()=>A(...e));var lt=D.hasStandardBrowserEnv?((A,e)=>r=>(r=new URL(r,D.origin),A.protocol===r.protocol&&A.host===r.host&&(e||A.port===r.port)))(new URL(D.origin),D.navigator&&/(msie|trident)/i.test(D.navigator.userAgent)):()=>!0;var ct=D.hasStandardBrowserEnv?{write(A,e,r,t,I,i){let o=[A+"="+encodeURIComponent(e)];g.isNumber(r)&&o.push("expires="+new Date(r).toGMTString()),g.isString(t)&&o.push("path="+t),g.isString(I)&&o.push("domain="+I),i===!0&&o.push("secure"),document.cookie=o.join("; ")},read(A){let e=document.cookie.match(new RegExp("(^|;\\s*)("+A+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove(A){this.write(A,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function he(A){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(A)}function me(A,e){return e?A.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):A}function nA(A,e,r){let t=!he(e);return A&&(t||r==!1)?me(A,e):e}var ft=A=>A instanceof R?{...A}:A;function T(A,e){e=e||{};let r={};function t(C,a,n,c){return g.isPlainObject(C)&&g.isPlainObject(a)?g.merge.call({caseless:c},C,a):g.isPlainObject(a)?g.merge({},a):g.isArray(a)?a.slice():a}function I(C,a,n,c){if(g.isUndefined(a)){if(!g.isUndefined(C))return t(void 0,C,n,c)}else return t(C,a,n,c)}function i(C,a){if(!g.isUndefined(a))return t(void 0,a)}function o(C,a){if(g.isUndefined(a)){if(!g.isUndefined(C))return t(void 0,C)}else return t(void 0,a)}function s(C,a,n){if(n in e)return t(C,a);if(n in A)return t(void 0,C)}let Q={url:i,method:i,data:i,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:(C,a,n)=>I(ft(C),ft(a),n,!0)};return g.forEach(Object.keys(Object.assign({},A,e)),function(a){let n=Q[a]||I,c=n(A[a],e[a],a);g.isUndefined(c)&&n!==s||(r[a]=c)}),r}var kA=A=>{let e=T({},A),{data:r,withXSRFToken:t,xsrfHeaderName:I,xsrfCookieName:i,headers:o,auth:s}=e;e.headers=o=R.from(o),e.url=IA(nA(e.baseURL,e.url,e.allowAbsoluteUrls),A.params,A.paramsSerializer),s&&o.set("Authorization","Basic "+btoa((s.username||"")+":"+(s.password?unescape(encodeURIComponent(s.password)):"")));let Q;if(g.isFormData(r)){if(D.hasStandardBrowserEnv||D.hasStandardBrowserWebWorkerEnv)o.setContentType(void 0);else if((Q=o.getContentType())!==!1){let[C,...a]=Q?Q.split(";").map(n=>n.trim()).filter(Boolean):[];o.setContentType([C||"multipart/form-data",...a].join("; "))}}if(D.hasStandardBrowserEnv&&(t&&g.isFunction(t)&&(t=t(e)),t||t!==!1&&lt(e.url))){let C=I&&i&&ct.read(i);C&&o.set(I,C)}return e};var PI=typeof XMLHttpRequest<"u",ut=PI&&function(A){return new Promise(function(r,t){let I=kA(A),i=I.data,o=R.from(I.headers).normalize(),{responseType:s,onUploadProgress:Q,onDownloadProgress:C}=I,a,n,c,B,E;function f(){B&&B(),E&&E(),I.cancelToken&&I.cancelToken.unsubscribe(a),I.signal&&I.signal.removeEventListener("abort",a)}let l=new XMLHttpRequest;l.open(I.method.toUpperCase(),I.url,!0),l.timeout=I.timeout;function y(){if(!l)return;let w=R.from("getAllResponseHeaders"in l&&l.getAllResponseHeaders()),U={data:!s||s==="text"||s==="json"?l.responseText:l.response,status:l.status,statusText:l.statusText,headers:w,config:A,request:l};gA(function(P){r(P),f()},function(P){t(P),f()},U),l=null}"onloadend"in l?l.onloadend=y:l.onreadystatechange=function(){!l||l.readyState!==4||l.status===0&&!(l.responseURL&&l.responseURL.indexOf("file:")===0)||setTimeout(y)},l.onabort=function(){l&&(t(new u("Request aborted",u.ECONNABORTED,A,l)),l=null)},l.onerror=function(){t(new u("Network Error",u.ERR_NETWORK,A,l)),l=null},l.ontimeout=function(){let Y=I.timeout?"timeout of "+I.timeout+"ms exceeded":"timeout exceeded",U=I.transitional||SA;I.timeoutErrorMessage&&(Y=I.timeoutErrorMessage),t(new u(Y,U.clarifyTimeoutError?u.ETIMEDOUT:u.ECONNABORTED,A,l)),l=null},i===void 0&&o.setContentType(null),"setRequestHeader"in l&&g.forEach(o.toJSON(),function(Y,U){l.setRequestHeader(U,Y)}),g.isUndefined(I.withCredentials)||(l.withCredentials=!!I.withCredentials),s&&s!=="json"&&(l.responseType=I.responseType),C&&([c,E]=_(C,!0),l.addEventListener("progress",c)),Q&&l.upload&&([n,B]=_(Q),l.upload.addEventListener("progress",n),l.upload.addEventListener("loadend",B)),(I.cancelToken||I.signal)&&(a=w=>{l&&(t(!w||w.type?new M(null,A,l):w),l.abort(),l=null)},I.cancelToken&&I.cancelToken.subscribe(a),I.signal&&(I.signal.aborted?a():I.signal.addEventListener("abort",a)));let m=de(I.url);if(m&&D.protocols.indexOf(m)===-1){t(new u("Unsupported protocol "+m+":",u.ERR_BAD_REQUEST,A));return}l.send(i||null)})};var KI=(A,e)=>{let{length:r}=A=A?A.filter(Boolean):[];if(e||r){let t=new AbortController,I,i=function(C){if(!I){I=!0,s();let a=C instanceof Error?C:this.reason;t.abort(a instanceof u?a:new M(a instanceof Error?a.message:a))}},o=e&&setTimeout(()=>{o=null,i(new u(`timeout ${e} of ms exceeded`,u.ETIMEDOUT))},e),s=()=>{A&&(o&&clearTimeout(o),o=null,A.forEach(C=>{C.unsubscribe?C.unsubscribe(i):C.removeEventListener("abort",i)}),A=null)};A.forEach(C=>C.addEventListener("abort",i));let{signal:Q}=t;return Q.unsubscribe=()=>g.asap(s),Q}},dt=KI;var WI=function*(A,e){let r=A.byteLength;if(!e||r<e){yield A;return}let t=0,I;for(;t<r;)I=t+e,yield A.slice(t,I),t=I},jI=async function*(A,e){for await(let r of vI(A))yield*WI(r,e)},vI=async function*(A){if(A[Symbol.asyncIterator]){yield*A;return}let e=A.getReader();try{for(;;){let{done:r,value:t}=await e.read();if(r)break;yield t}}finally{await e.cancel()}},De=(A,e,r,t)=>{let I=jI(A,e),i=0,o,s=Q=>{o||(o=!0,t&&t(Q))};return new ReadableStream({async pull(Q){try{let{done:C,value:a}=await I.next();if(C){s(),Q.close();return}let n=a.byteLength;if(r){let c=i+=n;r(c)}Q.enqueue(new Uint8Array(a))}catch(C){throw s(C),C}},cancel(Q){return s(Q),I.return()}},{highWaterMark:2})};var NA=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",pt=NA&&typeof ReadableStream=="function",ZI=NA&&(typeof TextEncoder=="function"?(A=>e=>A.encode(e))(new TextEncoder):async A=>new Uint8Array(await new Response(A).arrayBuffer())),ht=(A,...e)=>{try{return!!A(...e)}catch{return!1}},VI=pt&&ht(()=>{let A=!1,e=new Request(D.origin,{body:new ReadableStream,method:"POST",get duplex(){return A=!0,"half"}}).headers.has("Content-Type");return A&&!e}),yt=64*1024,we=pt&&ht(()=>g.isReadableStream(new Response("").body)),UA={stream:we&&(A=>A.body)};NA&&(A=>{["text","arrayBuffer","blob","formData","stream"].forEach(e=>{!UA[e]&&(UA[e]=g.isFunction(A[e])?r=>r[e]():(r,t)=>{throw new u(`Response type '${e}' is not supported`,u.ERR_NOT_SUPPORT,t)})})})(new Response);var zI=async A=>{if(A==null)return 0;if(g.isBlob(A))return A.size;if(g.isSpecCompliantForm(A))return(await new Request(D.origin,{method:"POST",body:A}).arrayBuffer()).byteLength;if(g.isArrayBufferView(A)||g.isArrayBuffer(A))return A.byteLength;if(g.isURLSearchParams(A)&&(A=A+""),g.isString(A))return(await ZI(A)).byteLength},XI=async(A,e)=>{let r=g.toFiniteNumber(A.getContentLength());return r??zI(e)},mt=NA&&(async A=>{let{url:e,method:r,data:t,signal:I,cancelToken:i,timeout:o,onDownloadProgress:s,onUploadProgress:Q,responseType:C,headers:a,withCredentials:n="same-origin",fetchOptions:c}=kA(A);C=C?(C+"").toLowerCase():"text";let B=dt([I,i&&i.toAbortSignal()],o),E,f=B&&B.unsubscribe&&(()=>{B.unsubscribe()}),l;try{if(Q&&VI&&r!=="get"&&r!=="head"&&(l=await XI(a,t))!==0){let U=new Request(e,{method:"POST",body:t,duplex:"half"}),x;if(g.isFormData(t)&&(x=U.headers.get("content-type"))&&a.setContentType(x),U.body){let[P,EA]=ye(l,_(pe(Q)));t=De(U.body,yt,P,EA)}}g.isString(n)||(n=n?"include":"omit");let y="credentials"in Request.prototype;E=new Request(e,{...c,signal:B,method:r.toUpperCase(),headers:a.normalize().toJSON(),body:t,duplex:"half",credentials:y?n:void 0});let m=await fetch(E),w=we&&(C==="stream"||C==="response");if(we&&(s||w&&f)){let U={};["status","statusText","headers"].forEach(Me=>{U[Me]=m[Me]});let x=g.toFiniteNumber(m.headers.get("content-length")),[P,EA]=s&&ye(x,_(pe(s),!0))||[];m=new Response(De(m.body,yt,P,()=>{EA&&EA(),f&&f()}),U)}C=C||"text";let Y=await UA[g.findKey(UA,C)||"text"](m,A);return!w&&f&&f(),await new Promise((U,x)=>{gA(U,x,{data:Y,headers:R.from(m.headers),status:m.status,statusText:m.statusText,config:A,request:E})})}catch(y){throw f&&f(),y&&y.name==="TypeError"&&/fetch/i.test(y.message)?Object.assign(new u("Network Error",u.ERR_NETWORK,A,E),{cause:y.cause||y}):u.from(y,y&&y.code,A,E)}});var Se={http:DA,xhr:ut,fetch:mt};g.forEach(Se,(A,e)=>{if(A){try{Object.defineProperty(A,"name",{value:e})}catch{}Object.defineProperty(A,"adapterName",{value:e})}});var Dt=A=>`- ${A}`,_I=A=>g.isFunction(A)||A===null||A===!1,bA={getAdapter:A=>{A=g.isArray(A)?A:[A];let{length:e}=A,r,t,I={};for(let i=0;i<e;i++){r=A[i];let o;if(t=r,!_I(r)&&(t=Se[(o=String(r)).toLowerCase()],t===void 0))throw new u(`Unknown adapter '${o}'`);if(t)break;I[o||"#"+i]=t}if(!t){let i=Object.entries(I).map(([s,Q])=>`adapter ${s} `+(Q===!1?"is not supported by the environment":"is not available in the build")),o=e?i.length>1?`since : `+i.map(Dt).join(` `):" "+Dt(i[0]):"as no adapter specified";throw new u("There is no suitable adapter to dispatch the request "+o,"ERR_NOT_SUPPORT")}return t},adapters:Se};function Fe(A){if(A.cancelToken&&A.cancelToken.throwIfRequested(),A.signal&&A.signal.aborted)throw new M(null,A)}function GA(A){return Fe(A),A.headers=R.from(A.headers),A.data=oA.call(A,A.transformRequest),["post","put","patch"].indexOf(A.method)!==-1&&A.headers.setContentType("application/x-www-form-urlencoded",!1),bA.getAdapter(A.adapter||z.adapter)(A).then(function(t){return Fe(A),t.data=oA.call(A,A.transformResponse,t),t.headers=R.from(t.headers),t},function(t){return aA(t)||(Fe(A),t&&t.response&&(t.response.data=oA.call(A,A.transformResponse,t.response),t.response.headers=R.from(t.response.headers))),Promise.reject(t)})}var LA="1.8.4";var TA={};["object","boolean","number","function","string","symbol"].forEach((A,e)=>{TA[A]=function(t){return typeof t===A||"a"+(e<1?"n ":" ")+A}});var wt={};TA.transitional=function(e,r,t){function I(i,o){return"[Axios v"+LA+"] Transitional option '"+i+"'"+o+(t?". "+t:"")}return(i,o,s)=>{if(e===!1)throw new u(I(o," has been removed"+(r?" in "+r:"")),u.ERR_DEPRECATED);return r&&!wt[o]&&(wt[o]=!0,console.warn(I(o," has been deprecated since v"+r+" and will be removed in the near future"))),e?e(i,o,s):!0}};TA.spelling=function(e){return(r,t)=>(console.warn(`${t} is likely a misspelling of ${e}`),!0)};function $I(A,e,r){if(typeof A!="object")throw new u("options must be an object",u.ERR_BAD_OPTION_VALUE);let t=Object.keys(A),I=t.length;for(;I-- >0;){let i=t[I],o=e[i];if(o){let s=A[i],Q=s===void 0||o(s,i,A);if(Q!==!0)throw new u("option "+i+" must be "+Q,u.ERR_BAD_OPTION_VALUE);continue}if(r!==!0)throw new u("Unknown option "+i,u.ERR_BAD_OPTION)}}var sA={assertOptions:$I,validators:TA};var J=sA.validators,$=class{constructor(e){this.defaults=e,this.interceptors={request:new Ce,response:new Ce}}async request(e,r){try{return await this._request(e,r)}catch(t){if(t instanceof Error){let I={};Error.captureStackTrace?Error.captureStackTrace(I):I=new Error;let i=I.stack?I.stack.replace(/^.+\n/,""):"";try{t.stack?i&&!String(t.stack).endsWith(i.replace(/^.+\n.+\n/,""))&&(t.stack+=` `+i):t.stack=i}catch{}}throw t}}_request(e,r){typeof e=="string"?(r=r||{},r.url=e):r=e||{},r=T(this.defaults,r);let{transitional:t,paramsSerializer:I,headers:i}=r;t!==void 0&&sA.assertOptions(t,{silentJSONParsing:J.transitional(J.boolean),forcedJSONParsing:J.transitional(J.boolean),clarifyTimeoutError:J.transitional(J.boolean)},!1),I!=null&&(g.isFunction(I)?r.paramsSerializer={serialize:I}:sA.assertOptions(I,{encode:J.function,serialize:J.function},!0)),r.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?r.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:r.allowAbsoluteUrls=!0),sA.assertOptions(r,{baseUrl:J.spelling("baseURL"),withXsrfToken:J.spelling("withXSRFToken")},!0),r.method=(r.method||this.defaults.method||"get").toLowerCase();let o=i&&g.merge(i.common,i[r.method]);i&&g.forEach(["delete","get","head","post","put","patch","common"],E=>{delete i[E]}),r.headers=R.concat(o,i);let s=[],Q=!0;this.interceptors.request.forEach(function(f){typeof f.runWhen=="function"&&f.runWhen(r)===!1||(Q=Q&&f.synchronous,s.unshift(f.fulfilled,f.rejected))});let C=[];this.interceptors.response.forEach(function(f){C.push(f.fulfilled,f.rejected)});let a,n=0,c;if(!Q){let E=[GA.bind(this),void 0];for(E.unshift.apply(E,s),E.push.apply(E,C),c=E.length,a=Promise.resolve(r);n<c;)a=a.then(E[n++],E[n++]);return a}c=s.length;let B=r;for(n=0;n<c;){let E=s[n++],f=s[n++];try{B=E(B)}catch(l){f.call(this,l);break}}try{a=GA.call(this,B)}catch(E){return Promise.reject(E)}for(n=0,c=C.length;n<c;)a=a.then(C[n++],C[n++]);return a}getUri(e){e=T(this.defaults,e);let r=nA(e.baseURL,e.url,e.allowAbsoluteUrls);return IA(r,e.params,e.paramsSerializer)}};g.forEach(["delete","get","head","options"],function(e){$.prototype[e]=function(r,t){return this.request(T(t||{},{method:e,url:r,data:(t||{}).data}))}});g.forEach(["post","put","patch"],function(e){function r(t){return function(i,o,s){return this.request(T(s||{},{method:e,headers:t?{"Content-