diff --git a/.zcode-plugin/plugin.json b/.zcode-plugin/plugin.json index c15eb2a..436c4b8 100644 --- a/.zcode-plugin/plugin.json +++ b/.zcode-plugin/plugin.json @@ -1,6 +1,6 @@ { "name": "seal-use", - "version": "0.10.32", + "version": "0.10.33", "description": "Seal Use tenant operations: approval-run diagnosis, minimal rule remediation, delegation links, Hose/合思 authorization, users, rules, billing, and search.", "author": { "name": "yingqing" diff --git a/CHANGELOG.md b/CHANGELOG.md index b3450d2..32b423f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,7 +7,21 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] -## [0.10.32] - 2026-09-20 +## [0.10.33] - 2026-09-20 + +### Added +- **Instantaneous Version Discovery via SWR Update Cache**: + - Implemented zero-network Stale-While-Revalidate caching for `seal-use version` backed by `~/.config/seal-use/update-cache.json`, keeping invocations strictly sub-10ms. + - Automatically dispatches an unref'd, detached background check when cache is older than 24 hours without blocking exit. + - Returns structured `latestVersion`, `updateAvailable: true`, and `lastCheckedAt` in stdout JSON when an upgrade is available, paired with non-blocking guidance on stderr. +- **Actionable Quota Guidance & Webhook Status Clarification in Tenant Health Check**: + - Added direct console recharge auto-login guidance (`seal-use auth link --corp `) in `seal-use doctor tenant` when tenant quota is low or exhausted. + - Refined webhook integration audit in `doctor tenant` to return `pass` with clarifying notes when no webhook integrations exist, avoiding alarmism for clients who only use direct form approvals. +- **Transparent Approval Run De-duplication**: + - Added `duplicateRuns` and `dedupeNote` to `seal-use approval-runs stats` to explicitly account for and explain the discrepancy between total runs and unique document runs (e.g. retries and push events). + - Emits an objective diagnostic note on stderr when duplicates are present, while keeping the command strictly non-intrusive. +- **Developer Guidelines & Safety Rule Modularization**: + - Reorganized `.agents/rules/` covering CLI protocol standards, test hygiene, staging simulation red lines, and webhook material pack policies. ### Added - **Semantic Approval Run Web Links (`approval-runs link`)**: diff --git a/dist/mcp/server.js b/dist/mcp/server.js index 664cedb..a9f84cb 100644 --- a/dist/mcp/server.js +++ b/dist/mcp/server.js @@ -75,7 +75,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs. || ${C} === "boolean" || ${A} === null`).assign(b,Q._`[${A}]`)}}}function q({gen:O,parentData:D,parentDataProperty:P},T){O.if(Q._`${D} !== undefined`,()=>O.assign(Q._`${D}[${P}]`,T))}function V(O,D,P,T=I.Correct){let A=T===I.Correct?Q.operators.EQ:Q.operators.NEQ,j;switch(O){case"null":return Q._`${D} ${A} null`;case"array":j=Q._`Array.isArray(${D})`;break;case"object":j=Q._`${D} && typeof ${D} == "object" && !Array.isArray(${D})`;break;case"integer":j=C(Q._`!(${D} % 1) && !isNaN(${D})`);break;case"number":j=C();break;default:return Q._`typeof ${D} ${A} ${O}`}return T===I.Correct?j:(0,Q.not)(j);function C(b=Q.nil){return(0,Q.and)(Q._`typeof ${D} == "number"`,b,P?Q._`isFinite(${D})`:Q.nil)}}$.checkDataType=V;function F(O,D,P,T){if(O.length===1)return V(O[0],D,P,T);let A,j=(0,J.toHash)(O);if(j.array&&j.object){let C=Q._`typeof ${D} != "object"`;A=j.null?C:Q._`!${D} || ${C}`,delete j.null,delete j.array,delete j.object}else A=Q.nil;if(j.number)delete j.integer;for(let C in j)A=(0,Q.and)(A,V(C,D,P,T));return A}$.checkDataTypes=F;let M={message:({schema:O})=>`must be ${O}`,params:({schema:O,schemaValue:D})=>typeof O=="string"?Q._`{type: ${O}}`:Q._`{type: ${D}}`};function w(O){let D=N(O);(0,z.reportError)(D,M)}$.reportTypeError=w;function N(O){let{gen:D,data:P,schema:T}=O,A=(0,J.schemaRefOrVal)(O,T,"type");return{gen:D,keyword:"type",data:P,schema:T.type,schemaCode:A,schemaValue:A,parentSchema:T,params:{},it:O}}}),uu0=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0}),$.assignDefaults=void 0;let Y=L1(),U=v1();function z(J,I){let{properties:K,items:G}=J.schema;if(I==="object"&&K)for(let H in K)Q(J,H,K[H].default);else if(I==="array"&&Array.isArray(G))G.forEach((H,W)=>Q(J,W,H.default))}$.assignDefaults=z;function Q(J,I,K){let{gen:G,compositeRule:H,data:W,opts:X}=J;if(K===void 0)return;let Z=Y._`${W}${(0,Y.getProperty)(I)}`;if(H){(0,U.checkStrictMode)(J,`default is ignored for: ${Z}`);return}let q=Y._`${Z} === undefined`;if(X.useDefaults==="empty")q=Y._`${q} || ${Z} === null || ${Z} === ""`;G.if(q,Y._`${Z} = ${(0,Y.stringify)(K)}`)}}),Q5=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0}),$.validateUnion=$.validateArray=$.usePattern=$.callValidateCode=$.schemaProperties=$.allSchemaProperties=$.noPropertyInData=$.propertyInData=$.isOwnProperty=$.hasPropFunc=$.reportMissingProp=$.checkMissingProp=$.checkReportMissingProp=void 0;let Y=L1(),U=v1(),z=z5(),Q=v1();function J(O,D){let{gen:P,data:T,it:A}=O;P.if(X(P,T,D,A.opts.ownProperties),()=>{O.setParams({missingProperty:Y._`${D}`},!0),O.error()})}$.checkReportMissingProp=J;function I({gen:O,data:D,it:{opts:P}},T,A){return(0,Y.or)(...T.map((j)=>(0,Y.and)(X(O,D,j,P.ownProperties),Y._`${A} = ${j}`)))}$.checkMissingProp=I;function K(O,D){O.setParams({missingProperty:D},!0),O.error()}$.reportMissingProp=K;function G(O){return O.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:Y._`Object.prototype.hasOwnProperty`})}$.hasPropFunc=G;function H(O,D,P){return Y._`${G(O)}.call(${D}, ${P})`}$.isOwnProperty=H;function W(O,D,P,T){let A=Y._`${D}${(0,Y.getProperty)(P)} !== undefined`;return T?Y._`${A} && ${H(O,D,P)}`:A}$.propertyInData=W;function X(O,D,P,T){let A=Y._`${D}${(0,Y.getProperty)(P)} === undefined`;return T?(0,Y.or)(A,(0,Y.not)(H(O,D,P))):A}$.noPropertyInData=X;function Z(O){return O?Object.keys(O).filter((D)=>D!=="__proto__"):[]}$.allSchemaProperties=Z;function q(O,D){return Z(D).filter((P)=>!(0,U.alwaysValidSchema)(O,D[P]))}$.schemaProperties=q;function V({schemaCode:O,data:D,it:{gen:P,topSchemaRef:T,schemaPath:A,errorPath:j},it:C},b,x,S){let i=S?Y._`${O}, ${D}, ${T}${A}`:D,c=[[z.default.instancePath,(0,Y.strConcat)(z.default.instancePath,j)],[z.default.parentData,C.parentData],[z.default.parentDataProperty,C.parentDataProperty],[z.default.rootData,z.default.rootData]];if(C.opts.dynamicRef)c.push([z.default.dynamicAnchors,z.default.dynamicAnchors]);let z0=Y._`${i}, ${P.object(...c)}`;return x!==Y.nil?Y._`${b}.call(${x}, ${z0})`:Y._`${b}(${z0})`}$.callValidateCode=V;let F=Y._`new RegExp`;function M({gen:O,it:{opts:D}},P){let T=D.unicodeRegExp?"u":"",{regExp:A}=D.code,j=A(P,T);return O.scopeValue("pattern",{key:j.toString(),ref:j,code:Y._`${A.code==="new RegExp"?F:(0,Q.useFunc)(O,A)}(${P}, ${T})`})}$.usePattern=M;function w(O){let{gen:D,data:P,keyword:T,it:A}=O,j=D.name("valid");if(A.allErrors){let b=D.let("valid",!0);return C(()=>D.assign(b,!1)),b}return D.var(j,!0),C(()=>D.break()),j;function C(b){let x=D.const("len",Y._`${P}.length`);D.forRange("i",0,x,(S)=>{O.subschema({keyword:T,dataProp:S,dataPropType:U.Type.Num},j),D.if((0,Y.not)(j),b)})}}$.validateArray=w;function N(O){let{gen:D,schema:P,keyword:T,it:A}=O;if(!Array.isArray(P))throw Error("ajv implementation error");if(P.some((b)=>(0,U.alwaysValidSchema)(A,b))&&!A.opts.unevaluated)return;let j=D.let("valid",!1),C=D.name("_valid");D.block(()=>P.forEach((b,x)=>{let S=O.subschema({keyword:T,schemaProp:x,compositeRule:!0},C);if(D.assign(j,Y._`${j} || ${C}`),!O.mergeValidEvaluated(S,C))D.if((0,Y.not)(j))})),O.result(j,()=>O.reset(),()=>O.error(!0))}$.validateUnion=N}),bu0=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0}),$.validateKeywordUsage=$.validSchemaType=$.funcKeywordCode=$.macroKeywordCode=void 0;let Y=L1(),U=z5(),z=Q5(),Q=Sw();function J(q,V){let{gen:F,keyword:M,schema:w,parentSchema:N,it:O}=q,D=V.macro.call(O.self,w,N,O),P=W(F,M,D);if(O.opts.validateSchema!==!1)O.self.validateSchema(D,!0);let T=F.name("valid");q.subschema({schema:D,schemaPath:Y.nil,errSchemaPath:`${O.errSchemaPath}/${M}`,topSchemaRef:P,compositeRule:!0},T),q.pass(T,()=>q.error(!0))}$.macroKeywordCode=J;function I(q,V){var F;let{gen:M,keyword:w,schema:N,parentSchema:O,$data:D,it:P}=q;H(P,V);let T=W(M,w,!D&&V.compile?V.compile.call(P.self,N,O,P):V.validate),A=M.let("valid");q.block$data(A,j),q.ok((F=V.valid)!==null&&F!==void 0?F:A);function j(){if(V.errors===!1){if(x(),V.modifying)K(q);S(()=>q.error())}else{let i=V.async?C():b();if(V.modifying)K(q);S(()=>G(q,i))}}function C(){let i=M.let("ruleErrs",null);return M.try(()=>x(Y._`await `),(c)=>M.assign(A,!1).if(Y._`${c} instanceof ${P.ValidationError}`,()=>M.assign(i,Y._`${c}.errors`),()=>M.throw(c))),i}function b(){let i=Y._`${T}.errors`;return M.assign(i,null),x(Y.nil),i}function x(i=V.async?Y._`await `:Y.nil){let c=P.opts.passContext?U.default.this:U.default.self,z0=!(("compile"in V)&&!D||V.schema===!1);M.assign(A,Y._`${i}${(0,z.callValidateCode)(q,T,c,z0)}`,V.modifying)}function S(i){var c;M.if((0,Y.not)((c=V.valid)!==null&&c!==void 0?c:A),i)}}$.funcKeywordCode=I;function K(q){let{gen:V,data:F,it:M}=q;V.if(M.parentData,()=>V.assign(F,Y._`${M.parentData}[${M.parentDataProperty}]`))}function G(q,V){let{gen:F}=q;F.if(Y._`Array.isArray(${V})`,()=>{F.assign(U.default.vErrors,Y._`${U.default.vErrors} === null ? ${V} : ${U.default.vErrors}.concat(${V})`).assign(U.default.errors,Y._`${U.default.vErrors}.length`),(0,Q.extendErrors)(q)},()=>q.error())}function H({schemaEnv:q},V){if(V.async&&!q.$async)throw Error("async keyword in sync schema")}function W(q,V,F){if(F===void 0)throw Error(`keyword "${V}" failed to compile`);return q.scopeValue("keyword",typeof F=="function"?{ref:F}:{ref:F,code:(0,Y.stringify)(F)})}function X(q,V,F=!1){return!V.length||V.some((M)=>M==="array"?Array.isArray(q):M==="object"?q&&typeof q=="object"&&!Array.isArray(q):typeof q==M||F&&typeof q>"u")}$.validSchemaType=X;function Z({schema:q,opts:V,self:F,errSchemaPath:M},w,N){if(Array.isArray(w.keyword)?!w.keyword.includes(N):w.keyword!==N)throw Error("ajv implementation error");let O=w.dependencies;if(O===null||O===void 0?void 0:O.some((D)=>!Object.prototype.hasOwnProperty.call(q,D)))throw Error(`parent schema must have dependencies of ${N}: ${O.join(",")}`);if(w.validateSchema){if(!w.validateSchema(q[N])){let D=`keyword "${N}" value is invalid at path "${M}": `+F.errorsText(w.validateSchema.errors);if(V.validateSchema==="log")F.logger.error(D);else throw Error(D)}}}$.validateKeywordUsage=Z}),iu0=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0}),$.extendSubschemaMode=$.extendSubschemaData=$.getSubschema=void 0;let Y=L1(),U=v1();function z(I,{keyword:K,schemaProp:G,schema:H,schemaPath:W,errSchemaPath:X,topSchemaRef:Z}){if(K!==void 0&&H!==void 0)throw Error('both "keyword" and "schema" passed, only one allowed');if(K!==void 0){let q=I.schema[K];return G===void 0?{schema:q,schemaPath:Y._`${I.schemaPath}${(0,Y.getProperty)(K)}`,errSchemaPath:`${I.errSchemaPath}/${K}`}:{schema:q[G],schemaPath:Y._`${I.schemaPath}${(0,Y.getProperty)(K)}${(0,Y.getProperty)(G)}`,errSchemaPath:`${I.errSchemaPath}/${K}/${(0,U.escapeFragment)(G)}`}}if(H!==void 0){if(W===void 0||X===void 0||Z===void 0)throw Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:H,schemaPath:W,topSchemaRef:Z,errSchemaPath:X}}throw Error('either "keyword" or "schema" must be passed')}$.getSubschema=z;function Q(I,K,{dataProp:G,dataPropType:H,data:W,dataTypes:X,propertyName:Z}){if(W!==void 0&&G!==void 0)throw Error('both "data" and "dataProp" passed, only one allowed');let{gen:q}=K;if(G!==void 0){let{errorPath:F,dataPathArr:M,opts:w}=K;V(q.let("data",Y._`${K.data}${(0,Y.getProperty)(G)}`,!0)),I.errorPath=Y.str`${F}${(0,U.getErrorPath)(G,H,w.jsPropertySyntax)}`,I.parentDataProperty=Y._`${G}`,I.dataPathArr=[...M,I.parentDataProperty]}if(W!==void 0){if(V(W instanceof Y.Name?W:q.let("data",W,!0)),Z!==void 0)I.propertyName=Z}if(X)I.dataTypes=X;function V(F){I.data=F,I.dataLevel=K.dataLevel+1,I.dataTypes=[],K.definedProperties=new Set,I.parentData=K.data,I.dataNames=[...K.dataNames,F]}}$.extendSubschemaData=Q;function J(I,{jtdDiscriminator:K,jtdMetadata:G,compositeRule:H,createErrors:W,allErrors:X}){if(H!==void 0)I.compositeRule=H;if(W!==void 0)I.createErrors=W;if(X!==void 0)I.allErrors=X;I.jtdDiscriminator=K,I.jtdMetadata=G}$.extendSubschemaMode=J}),lt=R0(($,Y)=>{Y.exports=function U(z,Q){if(z===Q)return!0;if(z&&Q&&typeof z=="object"&&typeof Q=="object"){if(z.constructor!==Q.constructor)return!1;var J,I,K;if(Array.isArray(z)){if(J=z.length,J!=Q.length)return!1;for(I=J;I--!==0;)if(!U(z[I],Q[I]))return!1;return!0}if(z.constructor===RegExp)return z.source===Q.source&&z.flags===Q.flags;if(z.valueOf!==Object.prototype.valueOf)return z.valueOf()===Q.valueOf();if(z.toString!==Object.prototype.toString)return z.toString()===Q.toString();if(K=Object.keys(z),J=K.length,J!==Object.keys(Q).length)return!1;for(I=J;I--!==0;)if(!Object.prototype.hasOwnProperty.call(Q,K[I]))return!1;for(I=J;I--!==0;){var G=K[I];if(!U(z[G],Q[G]))return!1}return!0}return z!==z&&Q!==Q}}),cu0=R0(($,Y)=>{var U=Y.exports=function(J,I,K){if(typeof I=="function")K=I,I={};K=I.cb||K;var G=typeof K=="function"?K:K.pre||function(){},H=K.post||function(){};z(I,G,H,J,"",J)};U.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0},U.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0},U.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0},U.skipKeywords={default:!0,enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0};function z(J,I,K,G,H,W,X,Z,q,V){if(G&&typeof G=="object"&&!Array.isArray(G)){I(G,H,W,X,Z,q,V);for(var F in G){var M=G[F];if(Array.isArray(M)){if(F in U.arrayKeywords)for(var w=0;w{Object.defineProperty($,"__esModule",{value:!0}),$.getSchemaRefs=$.resolveUrl=$.normalizeId=$._getFullPath=$.getFullPath=$.inlineRef=void 0;let Y=v1(),U=lt(),z=cu0(),Q=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function J(M,w=!0){if(typeof M=="boolean")return!0;if(w===!0)return!K(M);if(!w)return!1;return G(M)<=w}$.inlineRef=J;let I=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function K(M){for(let w in M){if(I.has(w))return!0;let N=M[w];if(Array.isArray(N)&&N.some(K))return!0;if(typeof N=="object"&&K(N))return!0}return!1}function G(M){let w=0;for(let N in M){if(N==="$ref")return 1/0;if(w++,Q.has(N))continue;if(typeof M[N]=="object")(0,Y.eachItem)(M[N],(O)=>w+=G(O));if(w===1/0)return 1/0}return w}function H(M,w="",N){if(N!==!1)w=Z(w);return W(M,M.parse(w))}$.getFullPath=H;function W(M,w){return M.serialize(w).split("#")[0]+"#"}$._getFullPath=W;let X=/#\/?$/;function Z(M){return M?M.replace(X,""):""}$.normalizeId=Z;function q(M,w,N){return N=Z(N),M.resolve(w,N)}$.resolveUrl=q;let V=/^[a-z_][-a-z0-9._]*$/i;function F(M,w){if(typeof M=="boolean")return{};let{schemaId:N,uriResolver:O}=this.opts,D=Z(M[N]||w),P={"":D},T=H(O,D,!1),A={},j=new Set;return z(M,{allKeys:!0},(x,S,i,c)=>{if(c===void 0)return;let z0=T+S,k=P[c];if(typeof x[N]=="string")k=d.call(this,x[N]);t.call(this,x.$anchor),t.call(this,x.$dynamicAnchor),P[S]=k;function d($0){let g=this.opts.uriResolver.resolve;if($0=Z(k?g(k,$0):$0),j.has($0))throw b($0);j.add($0);let p=this.refs[$0];if(typeof p=="string")p=this.refs[p];if(typeof p=="object")C(x,p.schema,$0);else if($0!==Z(z0))if($0[0]==="#")C(x,A[$0],$0),A[$0]=x;else this.refs[$0]=z0;return $0}function t($0){if(typeof $0=="string"){if(!V.test($0))throw Error(`invalid anchor "${$0}"`);d.call(this,`#${$0}`)}}}),A;function C(x,S,i){if(S!==void 0&&!U(x,S))throw b(i)}function b(x){return Error(`reference "${x}" resolves to more than one schema`)}}$.getSchemaRefs=F}),yQ=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0}),$.getData=$.KeywordCxt=$.validateFunctionCode=void 0;let Y=fu0(),U=hw(),z=mt(),Q=hw(),J=uu0(),I=bu0(),K=iu0(),G=L1(),H=z5(),W=gw(),X=v1(),Z=Sw();function q(a){if(T(a)){if(j(a),P(a)){w(a);return}}V(a,()=>(0,Y.topBoolOrEmptySchema)(a))}$.validateFunctionCode=q;function V({gen:a,validateName:W0,schema:F0,schemaEnv:u0,opts:b0},c0){if(b0.code.es5)a.func(W0,G._`${H.default.data}, ${H.default.valCxt}`,u0.$async,()=>{a.code(G._`"use strict"; ${O(F0,b0)}`),M(a,b0),a.code(c0)});else a.func(W0,G._`${H.default.data}, ${F(b0)}`,u0.$async,()=>a.code(O(F0,b0)).code(c0))}function F(a){return G._`{${H.default.instancePath}="", ${H.default.parentData}, ${H.default.parentDataProperty}, ${H.default.rootData}=${H.default.data}${a.dynamicRef?G._`, ${H.default.dynamicAnchors}={}`:G.nil}}={}`}function M(a,W0){a.if(H.default.valCxt,()=>{if(a.var(H.default.instancePath,G._`${H.default.valCxt}.${H.default.instancePath}`),a.var(H.default.parentData,G._`${H.default.valCxt}.${H.default.parentData}`),a.var(H.default.parentDataProperty,G._`${H.default.valCxt}.${H.default.parentDataProperty}`),a.var(H.default.rootData,G._`${H.default.valCxt}.${H.default.rootData}`),W0.dynamicRef)a.var(H.default.dynamicAnchors,G._`${H.default.valCxt}.${H.default.dynamicAnchors}`)},()=>{if(a.var(H.default.instancePath,G._`""`),a.var(H.default.parentData,G._`undefined`),a.var(H.default.parentDataProperty,G._`undefined`),a.var(H.default.rootData,H.default.data),W0.dynamicRef)a.var(H.default.dynamicAnchors,G._`{}`)})}function w(a){let{schema:W0,opts:F0,gen:u0}=a;V(a,()=>{if(F0.$comment&&W0.$comment)c(a);if(x(a),u0.let(H.default.vErrors,null),u0.let(H.default.errors,0),F0.unevaluated)N(a);C(a),z0(a)})}function N(a){let{gen:W0,validateName:F0}=a;a.evaluated=W0.const("evaluated",G._`${F0}.evaluated`),W0.if(G._`${a.evaluated}.dynamicProps`,()=>W0.assign(G._`${a.evaluated}.props`,G._`undefined`)),W0.if(G._`${a.evaluated}.dynamicItems`,()=>W0.assign(G._`${a.evaluated}.items`,G._`undefined`))}function O(a,W0){let F0=typeof a=="object"&&a[W0.schemaId];return F0&&(W0.code.source||W0.code.process)?G._`/*# sourceURL=${F0} */`:G.nil}function D(a,W0){if(T(a)){if(j(a),P(a)){A(a,W0);return}}(0,Y.boolOrEmptySchema)(a,W0)}function P({schema:a,self:W0}){if(typeof a=="boolean")return!a;for(let F0 in a)if(W0.RULES.all[F0])return!0;return!1}function T(a){return typeof a.schema!="boolean"}function A(a,W0){let{schema:F0,gen:u0,opts:b0}=a;if(b0.$comment&&F0.$comment)c(a);S(a),i(a);let c0=u0.const("_errs",H.default.errors);C(a,c0),u0.var(W0,G._`${c0} === ${H.default.errors}`)}function j(a){(0,X.checkUnknownRules)(a),b(a)}function C(a,W0){if(a.opts.jtd)return d(a,[],!1,W0);let F0=(0,U.getSchemaTypes)(a.schema);d(a,F0,!(0,U.coerceAndCheckDataType)(a,F0),W0)}function b(a){let{schema:W0,errSchemaPath:F0,opts:u0,self:b0}=a;if(W0.$ref&&u0.ignoreKeywordsWithRef&&(0,X.schemaHasRulesButRef)(W0,b0.RULES))b0.logger.warn(`$ref: keywords ignored in schema at path "${F0}"`)}function x(a){let{schema:W0,opts:F0}=a;if(W0.default!==void 0&&F0.useDefaults&&F0.strictSchema)(0,X.checkStrictMode)(a,"default is ignored in the schema root")}function S(a){let W0=a.schema[a.opts.schemaId];if(W0)a.baseId=(0,W.resolveUrl)(a.opts.uriResolver,a.baseId,W0)}function i(a){if(a.schema.$async&&!a.schemaEnv.$async)throw Error("async schema in sync schema")}function c({gen:a,schemaEnv:W0,schema:F0,errSchemaPath:u0,opts:b0}){let c0=F0.$comment;if(b0.$comment===!0)a.code(G._`${H.default.self}.logger.log(${c0})`);else if(typeof b0.$comment=="function"){let D1=G.str`${u0}/$comment`,k1=a.scopeValue("root",{ref:W0.root});a.code(G._`${H.default.self}.opts.$comment(${c0}, ${D1}, ${k1}.schema)`)}}function z0(a){let{gen:W0,schemaEnv:F0,validateName:u0,ValidationError:b0,opts:c0}=a;if(F0.$async)W0.if(G._`${H.default.errors} === 0`,()=>W0.return(H.default.data),()=>W0.throw(G._`new ${b0}(${H.default.vErrors})`));else{if(W0.assign(G._`${u0}.errors`,H.default.vErrors),c0.unevaluated)k(a);W0.return(G._`${H.default.errors} === 0`)}}function k({gen:a,evaluated:W0,props:F0,items:u0}){if(F0 instanceof G.Name)a.assign(G._`${W0}.props`,F0);if(u0 instanceof G.Name)a.assign(G._`${W0}.items`,u0)}function d(a,W0,F0,u0){let{gen:b0,schema:c0,data:D1,allErrors:k1,opts:u1,self:b1}=a,{RULES:A0}=b1;if(c0.$ref&&(u1.ignoreKeywordsWithRef||!(0,X.schemaHasRulesButRef)(c0,A0))){b0.block(()=>G0(a,"$ref",A0.all.$ref.definition));return}if(!u1.jtd)$0(a,W0);b0.block(()=>{for(let B of A0.rules)Q0(B);Q0(A0.post)});function Q0(B){if(!(0,z.shouldUseGroup)(c0,B))return;if(B.type){if(b0.if((0,Q.checkDataType)(B.type,D1,u1.strictNumbers)),t(a,B),W0.length===1&&W0[0]===B.type&&F0)b0.else(),(0,Q.reportTypeError)(a);b0.endIf()}else t(a,B);if(!k1)b0.if(G._`${H.default.errors} === ${u0||0}`)}}function t(a,W0){let{gen:F0,schema:u0,opts:{useDefaults:b0}}=a;if(b0)(0,J.assignDefaults)(a,W0.type);F0.block(()=>{for(let c0 of W0.rules)if((0,z.shouldUseRule)(u0,c0))G0(a,c0.keyword,c0.definition,W0.type)})}function $0(a,W0){if(a.schemaEnv.meta||!a.opts.strictTypes)return;if(g(a,W0),!a.opts.allowUnionTypes)p(a,W0);e(a,a.dataTypes)}function g(a,W0){if(!W0.length)return;if(!a.dataTypes.length){a.dataTypes=W0;return}W0.forEach((F0)=>{if(!s(a.dataTypes,F0))N0(a,`type "${F0}" not allowed by context "${a.dataTypes.join(",")}"`)}),Y0(a,W0)}function p(a,W0){if(W0.length>1&&!(W0.length===2&&W0.includes("null")))N0(a,"use allowUnionTypes to allow union type keyword")}function e(a,W0){let F0=a.self.RULES.all;for(let u0 in F0){let b0=F0[u0];if(typeof b0=="object"&&(0,z.shouldUseRule)(a.schema,b0)){let{type:c0}=b0.definition;if(c0.length&&!c0.some((D1)=>y(W0,D1)))N0(a,`missing type "${c0.join(",")}" for keyword "${u0}"`)}}}function y(a,W0){return a.includes(W0)||W0==="number"&&a.includes("integer")}function s(a,W0){return a.includes(W0)||W0==="integer"&&a.includes("number")}function Y0(a,W0){let F0=[];for(let u0 of a.dataTypes)if(s(W0,u0))F0.push(u0);else if(W0.includes("integer")&&u0==="number")F0.push("integer");a.dataTypes=F0}function N0(a,W0){let F0=a.schemaEnv.baseId+a.errSchemaPath;W0+=` at "${F0}" (strictTypes)`,(0,X.checkStrictMode)(a,W0,a.opts.strictTypes)}var E0=class{constructor(a,W0,F0){if((0,I.validateKeywordUsage)(a,W0,F0),this.gen=a.gen,this.allErrors=a.allErrors,this.keyword=F0,this.data=a.data,this.schema=a.schema[F0],this.$data=W0.$data&&a.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,X.schemaRefOrVal)(a,this.schema,F0,this.$data),this.schemaType=W0.schemaType,this.parentSchema=a.schema,this.params={},this.it=a,this.def=W0,this.$data)this.schemaCode=a.gen.const("vSchema",Y1(this.$data,a));else if(this.schemaCode=this.schemaValue,!(0,I.validSchemaType)(this.schema,W0.schemaType,W0.allowUndefined))throw Error(`${F0} value must be ${JSON.stringify(W0.schemaType)}`);if("code"in W0?W0.trackErrors:W0.errors!==!1)this.errsCount=a.gen.const("_errs",H.default.errors)}result(a,W0,F0){this.failResult((0,G.not)(a),W0,F0)}failResult(a,W0,F0){if(this.gen.if(a),F0)F0();else this.error();if(W0){if(this.gen.else(),W0(),this.allErrors)this.gen.endIf()}else if(this.allErrors)this.gen.endIf();else this.gen.else()}pass(a,W0){this.failResult((0,G.not)(a),void 0,W0)}fail(a){if(a===void 0){if(this.error(),!this.allErrors)this.gen.if(!1);return}if(this.gen.if(a),this.error(),this.allErrors)this.gen.endIf();else this.gen.else()}fail$data(a){if(!this.$data)return this.fail(a);let{schemaCode:W0}=this;this.fail(G._`${W0} !== undefined && (${(0,G.or)(this.invalid$data(),a)})`)}error(a,W0,F0){if(W0){this.setParams(W0),this._error(a,F0),this.setParams({});return}this._error(a,F0)}_error(a,W0){(a?Z.reportExtraError:Z.reportError)(this,this.def.error,W0)}$dataError(){(0,Z.reportError)(this,this.def.$dataError||Z.keyword$DataError)}reset(){if(this.errsCount===void 0)throw Error('add "trackErrors" to keyword definition');(0,Z.resetErrorsCount)(this.gen,this.errsCount)}ok(a){if(!this.allErrors)this.gen.if(a)}setParams(a,W0){if(W0)Object.assign(this.params,a);else this.params=a}block$data(a,W0,F0=G.nil){this.gen.block(()=>{this.check$data(a,F0),W0()})}check$data(a=G.nil,W0=G.nil){if(!this.$data)return;let{gen:F0,schemaCode:u0,schemaType:b0,def:c0}=this;if(F0.if((0,G.or)(G._`${u0} === undefined`,W0)),a!==G.nil)F0.assign(a,!0);if(b0.length||c0.validateSchema){if(F0.elseIf(this.invalid$data()),this.$dataError(),a!==G.nil)F0.assign(a,!1)}F0.else()}invalid$data(){let{gen:a,schemaCode:W0,schemaType:F0,def:u0,it:b0}=this;return(0,G.or)(c0(),D1());function c0(){if(F0.length){if(!(W0 instanceof G.Name))throw Error("ajv implementation error");let k1=Array.isArray(F0)?F0:[F0];return G._`${(0,Q.checkDataTypes)(k1,W0,b0.opts.strictNumbers,Q.DataType.Wrong)}`}return G.nil}function D1(){if(u0.validateSchema){let k1=a.scopeValue("validate$data",{ref:u0.validateSchema});return G._`!${k1}(${W0})`}return G.nil}}subschema(a,W0){let F0=(0,K.getSubschema)(this.it,a);(0,K.extendSubschemaData)(F0,this.it,a),(0,K.extendSubschemaMode)(F0,a);let u0={...this.it,...F0,items:void 0,props:void 0};return D(u0,W0),u0}mergeEvaluated(a,W0){let{it:F0,gen:u0}=this;if(!F0.opts.unevaluated)return;if(F0.props!==!0&&a.props!==void 0)F0.props=X.mergeEvaluated.props(u0,a.props,F0.props,W0);if(F0.items!==!0&&a.items!==void 0)F0.items=X.mergeEvaluated.items(u0,a.items,F0.items,W0)}mergeValidEvaluated(a,W0){let{it:F0,gen:u0}=this;if(F0.opts.unevaluated&&(F0.props!==!0||F0.items!==!0))return u0.if(W0,()=>this.mergeEvaluated(a,G.Name)),!0}};$.KeywordCxt=E0;function G0(a,W0,F0,u0){let b0=new E0(a,F0,W0);if("code"in F0)F0.code(b0,u0);else if(b0.$data&&F0.validate)(0,I.funcKeywordCode)(b0,F0);else if("macro"in F0)(0,I.macroKeywordCode)(b0,F0);else if(F0.compile||F0.validate)(0,I.funcKeywordCode)(b0,F0)}let T0=/^\/(?:[^~]|~0|~1)*$/,i0=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function Y1(a,{dataLevel:W0,dataNames:F0,dataPathArr:u0}){let b0,c0;if(a==="")return H.default.rootData;if(a[0]==="/"){if(!T0.test(a))throw Error(`Invalid JSON-pointer: ${a}`);b0=a,c0=H.default.rootData}else{let b1=i0.exec(a);if(!b1)throw Error(`Invalid JSON-pointer: ${a}`);let A0=+b1[1];if(b0=b1[2],b0==="#"){if(A0>=W0)throw Error(u1("property/index",A0));return u0[W0-A0]}if(A0>W0)throw Error(u1("data",A0));if(c0=F0[W0-A0],!b0)return c0}let D1=c0,k1=b0.split("/");for(let b1 of k1)if(b1)c0=G._`${c0}${(0,G.getProperty)((0,X.unescapeJsonPointer)(b1))}`,D1=G._`${D1} && ${c0}`;return D1;function u1(b1,A0){return`Cannot access ${b1} ${A0} levels up, current level is ${W0}`}}$.getData=Y1}),LH=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0});var Y=class extends Error{constructor(U){super("validation failed");this.errors=U,this.ajv=this.validation=!0}};$.default=Y}),kQ=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=gw();var U=class extends Error{constructor(z,Q,J,I){super(I||`can't resolve reference ${J} from id ${Q}`);this.missingRef=(0,Y.resolveUrl)(z,Q,J),this.missingSchema=(0,Y.normalizeId)((0,Y.getFullPath)(z,this.missingRef))}};$.default=U}),yw=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0}),$.resolveSchema=$.getCompilingSchema=$.resolveRef=$.compileSchema=$.SchemaEnv=void 0;let Y=L1(),U=LH(),z=z5(),Q=gw(),J=v1(),I=yQ();var K=class{constructor(w){var N;this.refs={},this.dynamicAnchors={};let O;if(typeof w.schema=="object")O=w.schema;this.schema=w.schema,this.schemaId=w.schemaId,this.root=w.root||this,this.baseId=(N=w.baseId)!==null&&N!==void 0?N:(0,Q.normalizeId)(O===null||O===void 0?void 0:O[w.schemaId||"$id"]),this.schemaPath=w.schemaPath,this.localRefs=w.localRefs,this.meta=w.meta,this.$async=O===null||O===void 0?void 0:O.$async,this.refs={}}};$.SchemaEnv=K;function G(w){let N=X.call(this,w);if(N)return N;let O=(0,Q.getFullPath)(this.opts.uriResolver,w.root.baseId),{es5:D,lines:P}=this.opts.code,{ownProperties:T}=this.opts,A=new Y.CodeGen(this.scope,{es5:D,lines:P,ownProperties:T}),j;if(w.$async)j=A.scopeValue("Error",{ref:U.default,code:Y._`require("ajv/dist/runtime/validation_error").default`});let C=A.scopeName("validate");w.validateName=C;let b={gen:A,allErrors:this.opts.allErrors,data:z.default.data,parentData:z.default.parentData,parentDataProperty:z.default.parentDataProperty,dataNames:[z.default.data],dataPathArr:[Y.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:A.scopeValue("schema",this.opts.code.source===!0?{ref:w.schema,code:(0,Y.stringify)(w.schema)}:{ref:w.schema}),validateName:C,ValidationError:j,schema:w.schema,schemaEnv:w,rootId:O,baseId:w.baseId||O,schemaPath:Y.nil,errSchemaPath:w.schemaPath||(this.opts.jtd?"":"#"),errorPath:Y._`""`,opts:this.opts,self:this},x;try{this._compilations.add(w),(0,I.validateFunctionCode)(b),A.optimize(this.opts.code.optimize);let S=A.toString();if(x=`${A.scopeRefs(z.default.scope)}return ${S}`,this.opts.code.process)x=this.opts.code.process(x,w);let i=Function(`${z.default.self}`,`${z.default.scope}`,x)(this,this.scope.get());if(this.scope.value(C,{ref:i}),i.errors=null,i.schema=w.schema,i.schemaEnv=w,w.$async)i.$async=!0;if(this.opts.code.source===!0)i.source={validateName:C,validateCode:S,scopeValues:A._values};if(this.opts.unevaluated){let{props:c,items:z0}=b;if(i.evaluated={props:c instanceof Y.Name?void 0:c,items:z0 instanceof Y.Name?void 0:z0,dynamicProps:c instanceof Y.Name,dynamicItems:z0 instanceof Y.Name},i.source)i.source.evaluated=(0,Y.stringify)(i.evaluated)}return w.validate=i,w}catch(S){if(delete w.validate,delete w.validateName,x)this.logger.error("Error compiling schema, function code:",x);throw S}finally{this._compilations.delete(w)}}$.compileSchema=G;function H(w,N,O){var D;O=(0,Q.resolveUrl)(this.opts.uriResolver,N,O);let P=w.refs[O];if(P)return P;let T=q.call(this,w,O);if(T===void 0){let A=(D=w.localRefs)===null||D===void 0?void 0:D[O],{schemaId:j}=this.opts;if(A)T=new K({schema:A,schemaId:j,root:w,baseId:N})}if(T===void 0)return;return w.refs[O]=W.call(this,T)}$.resolveRef=H;function W(w){if((0,Q.inlineRef)(w.schema,this.opts.inlineRefs))return w.schema;return w.validate?w:G.call(this,w)}function X(w){for(let N of this._compilations)if(Z(N,w))return N}$.getCompilingSchema=X;function Z(w,N){return w.schema===N.schema&&w.root===N.root&&w.baseId===N.baseId}function q(w,N){let O;while(typeof(O=this.refs[N])=="string")N=O;return O||this.schemas[N]||V.call(this,w,N)}function V(w,N){let O=this.opts.uriResolver.parse(N),D=(0,Q._getFullPath)(this.opts.uriResolver,O),P=(0,Q.getFullPath)(this.opts.uriResolver,w.baseId,void 0);if(Object.keys(w.schema).length>0&&D===P)return M.call(this,O,w);let T=(0,Q.normalizeId)(D),A=this.refs[T]||this.schemas[T];if(typeof A=="string"){let j=V.call(this,w,A);if(typeof(j===null||j===void 0?void 0:j.schema)!=="object")return;return M.call(this,O,j)}if(typeof(A===null||A===void 0?void 0:A.schema)!=="object")return;if(!A.validate)G.call(this,A);if(T===(0,Q.normalizeId)(N)){let{schema:j}=A,{schemaId:C}=this.opts,b=j[C];if(b)P=(0,Q.resolveUrl)(this.opts.uriResolver,P,b);return new K({schema:j,schemaId:C,root:w,baseId:P})}return M.call(this,O,A)}$.resolveSchema=V;let F=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function M(w,{baseId:N,schema:O,root:D}){var P;if(((P=w.fragment)===null||P===void 0?void 0:P[0])!=="/")return;for(let j of w.fragment.slice(1).split("/")){if(typeof O==="boolean")return;let C=O[(0,J.unescapeFragment)(j)];if(C===void 0)return;O=C;let b=typeof O==="object"&&O[this.opts.schemaId];if(!F.has(j)&&b)N=(0,Q.resolveUrl)(this.opts.uriResolver,N,b)}let T;if(typeof O!="boolean"&&O.$ref&&!(0,J.schemaHasRulesButRef)(O,this.RULES)){let j=(0,Q.resolveUrl)(this.opts.uriResolver,N,O.$ref);T=V.call(this,D,j)}let{schemaId:A}=this.opts;if(T=T||new K({schema:O,schemaId:A,root:D,baseId:N}),T.schema!==T.root.schema)return T}}),nu0=R0(($,Y)=>{Y.exports={$id:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",description:"Meta-schema for $data reference (JSON AnySchema extension proposal)",type:"object",required:["$data"],properties:{$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},additionalProperties:!1}}),ot=R0(($,Y)=>{let U=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),z=RegExp.prototype.test.bind(/^(?:(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)$/u);function Q(V){let F="",M=0,w=0;for(w=0;w=48&&M<=57||M>=65&&M<=70||M>=97&&M<=102))return"";F+=V[w];break}for(w+=1;w=48&&M<=57||M>=65&&M<=70||M>=97&&M<=102))return"";F+=V[w]}return F}let J=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function I(V){return V.length=0,!0}function K(V,F,M){if(V.length){let w=Q(V);if(w!=="")F.push(w);else return M.error=!0,!1;V.length=0}return!0}function G(V){let F=0,M={error:!1,address:"",zone:""},w=[],N=[],O=!1,D=!1,P=K;for(let T=0;T7){M.error=!0;break}if(T>0&&V[T-1]===":")O=!0;w.push(":");continue}else if(A==="%"){if(!P(N,w,M))break;P=I}else{N.push(A);continue}}if(N.length)if(P===I)M.zone=N.join("");else if(D)w.push(N.join(""));else w.push(Q(N));return M.address=w.join(""),M}function H(V){if(W(V,":")<2)return{host:V,isIPV6:!1};let F=G(V);if(!F.error){let{address:M,address:w}=F;if(F.zone)M+="%"+F.zone,w+="%25"+F.zone;return{host:M,isIPV6:!0,escapedHost:w}}else return{host:V,isIPV6:!1}}function W(V,F){let M=0;for(let w=0;w{let{isUUID:U}=ot(),z=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu,Q=["http","https","ws","wss","urn","urn:uuid"];function J(A){return Q.indexOf(A)!==-1}function I(A){if(A.secure===!0)return!0;else if(A.secure===!1)return!1;else if(A.scheme)return A.scheme.length===3&&(A.scheme[0]==="w"||A.scheme[0]==="W")&&(A.scheme[1]==="s"||A.scheme[1]==="S")&&(A.scheme[2]==="s"||A.scheme[2]==="S");else return!1}function K(A){if(!A.host)A.error=A.error||"HTTP URIs must have a host.";return A}function G(A){let j=String(A.scheme).toLowerCase()==="https";if(A.port===(j?443:80)||A.port==="")A.port=void 0;if(!A.path)A.path="/";return A}function H(A){return A.secure=I(A),A.resourceName=(A.path||"/")+(A.query?"?"+A.query:""),A.path=void 0,A.query=void 0,A}function W(A){if(A.port===(I(A)?443:80)||A.port==="")A.port=void 0;if(typeof A.secure==="boolean")A.scheme=A.secure?"wss":"ws",A.secure=void 0;if(A.resourceName){let[j,C]=A.resourceName.split("?");A.path=j&&j!=="/"?j:void 0,A.query=C,A.resourceName=void 0}return A.fragment=void 0,A}function X(A,j){if(!A.path)return A.error="URN can not be parsed",A;let C=A.path.match(z);if(C){let b=j.scheme||A.scheme||"urn";A.nid=C[1].toLowerCase(),A.nss=C[2];let x=T(`${b}:${j.nid||A.nid}`);if(A.path=void 0,x)A=x.parse(A,j)}else A.error=A.error||"URN can not be parsed.";return A}function Z(A,j){if(A.nid===void 0)throw Error("URN without nid cannot be serialized");let C=j.scheme||A.scheme||"urn",b=A.nid.toLowerCase(),x=T(`${C}:${j.nid||b}`);if(x)A=x.serialize(A,j);let S=A,i=A.nss;return S.path=`${b||j.nid}:${i}`,j.skipEscape=!0,S}function q(A,j){let C=A;if(C.uuid=C.nss,C.nss=void 0,!j.tolerant&&(!C.uuid||!U(C.uuid)))C.error=C.error||"UUID is not valid.";return C}function V(A){let j=A;return j.nss=(A.uuid||"").toLowerCase(),j}let F={scheme:"http",domainHost:!0,parse:K,serialize:G},M={scheme:"https",domainHost:F.domainHost,parse:K,serialize:G},w={scheme:"ws",domainHost:!0,parse:H,serialize:W},N={scheme:"wss",domainHost:w.domainHost,parse:w.parse,serialize:w.serialize},P={http:F,https:M,ws:w,wss:N,urn:{scheme:"urn",parse:X,serialize:Z,skipNormalize:!0},"urn:uuid":{scheme:"urn:uuid",parse:q,serialize:V,skipNormalize:!0}};Object.setPrototypeOf(P,null);function T(A){return A&&(P[A]||P[A.toLowerCase()])||void 0}Y.exports={wsIsSecure:I,SCHEMES:P,isValidSchemeName:J,getSchemeHandler:T}}),du0=R0(($,Y)=>{let{normalizeIPv6:U,removeDotSegments:z,recomposeAuthority:Q,normalizeComponentEncoding:J,isIPv4:I,nonSimpleDomain:K}=ot(),{SCHEMES:G,getSchemeHandler:H}=pu0();function W(N,O){if(typeof N==="string")N=V(M(N,O),O);else if(typeof N==="object")N=M(V(N,O),O);return N}function X(N,O,D){let P=D?Object.assign({scheme:"null"},D):{scheme:"null"},T=Z(M(N,P),M(O,P),P,!0);return P.skipEscape=!0,V(T,P)}function Z(N,O,D,P){let T={};if(!P)N=M(V(N,D),D),O=M(V(O,D),D);if(D=D||{},!D.tolerant&&O.scheme)T.scheme=O.scheme,T.userinfo=O.userinfo,T.host=O.host,T.port=O.port,T.path=z(O.path||""),T.query=O.query;else{if(O.userinfo!==void 0||O.host!==void 0||O.port!==void 0)T.userinfo=O.userinfo,T.host=O.host,T.port=O.port,T.path=z(O.path||""),T.query=O.query;else{if(!O.path)if(T.path=N.path,O.query!==void 0)T.query=O.query;else T.query=N.query;else{if(O.path[0]==="/")T.path=z(O.path);else{if((N.userinfo!==void 0||N.host!==void 0||N.port!==void 0)&&!N.path)T.path="/"+O.path;else if(!N.path)T.path=O.path;else T.path=N.path.slice(0,N.path.lastIndexOf("/")+1)+O.path;T.path=z(T.path)}T.query=O.query}T.userinfo=N.userinfo,T.host=N.host,T.port=N.port}T.scheme=N.scheme}return T.fragment=O.fragment,T}function q(N,O,D){if(typeof N==="string")N=unescape(N),N=V(J(M(N,D),!0),{...D,skipEscape:!0});else if(typeof N==="object")N=V(J(N,!0),{...D,skipEscape:!0});if(typeof O==="string")O=unescape(O),O=V(J(M(O,D),!0),{...D,skipEscape:!0});else if(typeof O==="object")O=V(J(O,!0),{...D,skipEscape:!0});return N.toLowerCase()===O.toLowerCase()}function V(N,O){let D={host:N.host,scheme:N.scheme,userinfo:N.userinfo,port:N.port,path:N.path,query:N.query,nid:N.nid,nss:N.nss,uuid:N.uuid,fragment:N.fragment,reference:N.reference,resourceName:N.resourceName,secure:N.secure,error:""},P=Object.assign({},O),T=[],A=H(P.scheme||D.scheme);if(A&&A.serialize)A.serialize(D,P);if(D.path!==void 0)if(!P.skipEscape){if(D.path=escape(D.path),D.scheme!==void 0)D.path=D.path.split("%3A").join(":")}else D.path=unescape(D.path);if(P.reference!=="suffix"&&D.scheme)T.push(D.scheme,":");let j=Q(D);if(j!==void 0){if(P.reference!=="suffix")T.push("//");if(T.push(j),D.path&&D.path[0]!=="/")T.push("/")}if(D.path!==void 0){let C=D.path;if(!P.absolutePath&&(!A||!A.absolutePath))C=z(C);if(j===void 0&&C[0]==="/"&&C[1]==="/")C="/%2F"+C.slice(2);T.push(C)}if(D.query!==void 0)T.push("?",D.query);if(D.fragment!==void 0)T.push("#",D.fragment);return T.join("")}let F=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function M(N,O){let D=Object.assign({},O),P={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0},T=!1;if(D.reference==="suffix")if(D.scheme)N=D.scheme+":"+N;else N="//"+N;let A=N.match(F);if(A){if(P.scheme=A[1],P.userinfo=A[3],P.host=A[4],P.port=parseInt(A[5],10),P.path=A[6]||"",P.query=A[7],P.fragment=A[8],isNaN(P.port))P.port=A[5];if(P.host)if(I(P.host)===!1){let C=U(P.host);P.host=C.host.toLowerCase(),T=C.isIPV6}else T=!0;if(P.scheme===void 0&&P.userinfo===void 0&&P.host===void 0&&P.port===void 0&&P.query===void 0&&!P.path)P.reference="same-document";else if(P.scheme===void 0)P.reference="relative";else if(P.fragment===void 0)P.reference="absolute";else P.reference="uri";if(D.reference&&D.reference!=="suffix"&&D.reference!==P.reference)P.error=P.error||"URI is not a "+D.reference+" reference.";let j=H(D.scheme||P.scheme);if(!D.unicodeSupport&&(!j||!j.unicodeSupport)){if(P.host&&(D.domainHost||j&&j.domainHost)&&T===!1&&K(P.host))try{P.host=URL.domainToASCII(P.host.toLowerCase())}catch(C){P.error=P.error||"Host's domain name can not be converted to ASCII: "+C}}if(!j||j&&!j.skipNormalize){if(N.indexOf("%")!==-1){if(P.scheme!==void 0)P.scheme=unescape(P.scheme);if(P.host!==void 0)P.host=unescape(P.host)}if(P.path)P.path=escape(unescape(P.path));if(P.fragment)P.fragment=encodeURI(decodeURIComponent(P.fragment))}if(j&&j.parse)j.parse(P,D)}else P.error=P.error||"URI can not be parsed.";return P}let w={SCHEMES:G,normalize:W,resolve:X,resolveComponent:Z,equal:q,serialize:V,parse:M};Y.exports=w,Y.exports.default=w,Y.exports.fastUri=w}),mu0=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=du0();Y.code='require("ajv/dist/runtime/uri").default',$.default=Y}),IS=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0}),$.CodeGen=$.Name=$.nil=$.stringify=$.str=$._=$.KeywordCxt=void 0;var Y=yQ();Object.defineProperty($,"KeywordCxt",{enumerable:!0,get:function(){return Y.KeywordCxt}});var U=L1();Object.defineProperty($,"_",{enumerable:!0,get:function(){return U._}}),Object.defineProperty($,"str",{enumerable:!0,get:function(){return U.str}}),Object.defineProperty($,"stringify",{enumerable:!0,get:function(){return U.stringify}}),Object.defineProperty($,"nil",{enumerable:!0,get:function(){return U.nil}}),Object.defineProperty($,"Name",{enumerable:!0,get:function(){return U.Name}}),Object.defineProperty($,"CodeGen",{enumerable:!0,get:function(){return U.CodeGen}});let z=LH(),Q=kQ(),J=dt(),I=yw(),K=L1(),G=gw(),H=hw(),W=v1(),X=nu0(),Z=mu0(),q=(g,p)=>new RegExp(g,p);q.code="new RegExp";let V=["removeAdditional","useDefaults","coerceTypes"],F=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),M={errorDataPath:"",format:"`validateFormats: false` can be used instead.",nullable:'"nullable" keyword is supported by default.',jsonPointers:"Deprecated jsPropertySyntax can be used instead.",extendRefs:"Deprecated ignoreKeywordsWithRef can be used instead.",missingRefs:"Pass empty schema with $id that should be ignored to ajv.addSchema.",processCode:"Use option `code: {process: (code, schemaEnv: object) => string}`",sourceCode:"Use option `code: {source: true}`",strictDefaults:"It is default now, see option `strict`.",strictKeywords:"It is default now, see option `strict`.",uniqueItems:'"uniqueItems" keyword is always validated.',unknownFormats:"Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).",cache:"Map is used as cache, schema object as key.",serialize:"Map is used as cache, schema object as key.",ajvErrors:"It is default now."},w={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},N=200;function O(g){var p,e,y,s,Y0,N0,E0,G0,T0,i0,Y1,a,W0,F0,u0,b0,c0,D1,k1,u1,b1,A0,Q0,B,v;let u=g.strict,r=(p=g.code)===null||p===void 0?void 0:p.optimize,X0=r===!0||r===void 0?1:r||0,J0=(y=(e=g.code)===null||e===void 0?void 0:e.regExp)!==null&&y!==void 0?y:q,q0=(s=g.uriResolver)!==null&&s!==void 0?s:Z.default;return{strictSchema:(N0=(Y0=g.strictSchema)!==null&&Y0!==void 0?Y0:u)!==null&&N0!==void 0?N0:!0,strictNumbers:(G0=(E0=g.strictNumbers)!==null&&E0!==void 0?E0:u)!==null&&G0!==void 0?G0:!0,strictTypes:(i0=(T0=g.strictTypes)!==null&&T0!==void 0?T0:u)!==null&&i0!==void 0?i0:"log",strictTuples:(a=(Y1=g.strictTuples)!==null&&Y1!==void 0?Y1:u)!==null&&a!==void 0?a:"log",strictRequired:(F0=(W0=g.strictRequired)!==null&&W0!==void 0?W0:u)!==null&&F0!==void 0?F0:!1,code:g.code?{...g.code,optimize:X0,regExp:J0}:{optimize:X0,regExp:J0},loopRequired:(u0=g.loopRequired)!==null&&u0!==void 0?u0:N,loopEnum:(b0=g.loopEnum)!==null&&b0!==void 0?b0:N,meta:(c0=g.meta)!==null&&c0!==void 0?c0:!0,messages:(D1=g.messages)!==null&&D1!==void 0?D1:!0,inlineRefs:(k1=g.inlineRefs)!==null&&k1!==void 0?k1:!0,schemaId:(u1=g.schemaId)!==null&&u1!==void 0?u1:"$id",addUsedSchema:(b1=g.addUsedSchema)!==null&&b1!==void 0?b1:!0,validateSchema:(A0=g.validateSchema)!==null&&A0!==void 0?A0:!0,validateFormats:(Q0=g.validateFormats)!==null&&Q0!==void 0?Q0:!0,unicodeRegExp:(B=g.unicodeRegExp)!==null&&B!==void 0?B:!0,int32range:(v=g.int32range)!==null&&v!==void 0?v:!0,uriResolver:q0}}var D=class{constructor(g={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,g=this.opts={...g,...O(g)};let{es5:p,lines:e}=this.opts.code;this.scope=new K.ValueScope({scope:{},prefixes:F,es5:p,lines:e}),this.logger=S(g.logger);let y=g.validateFormats;if(g.validateFormats=!1,this.RULES=(0,J.getRules)(),P.call(this,M,g,"NOT SUPPORTED"),P.call(this,w,g,"DEPRECATED","warn"),this._metaOpts=b.call(this),g.formats)j.call(this);if(this._addVocabularies(),this._addDefaultMetaSchema(),g.keywords)C.call(this,g.keywords);if(typeof g.meta=="object")this.addMetaSchema(g.meta);A.call(this),g.validateFormats=y}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:g,meta:p,schemaId:e}=this.opts,y=X;if(e==="id")y={...X},y.id=y.$id,delete y.$id;if(p&&g)this.addMetaSchema(y,y[e],!1)}defaultMeta(){let{meta:g,schemaId:p}=this.opts;return this.opts.defaultMeta=typeof g=="object"?g[p]||g:void 0}validate(g,p){let e;if(typeof g=="string"){if(e=this.getSchema(g),!e)throw Error(`no schema with key or ref "${g}"`)}else e=this.compile(g);let y=e(p);if(!("$async"in e))this.errors=e.errors;return y}compile(g,p){let e=this._addSchema(g,p);return e.validate||this._compileSchemaEnv(e)}compileAsync(g,p){if(typeof this.opts.loadSchema!="function")throw Error("options.loadSchema should be a function");let{loadSchema:e}=this.opts;return y.call(this,g,p);async function y(T0,i0){await s.call(this,T0.$schema);let Y1=this._addSchema(T0,i0);return Y1.validate||Y0.call(this,Y1)}async function s(T0){if(T0&&!this.getSchema(T0))await y.call(this,{$ref:T0},!0)}async function Y0(T0){try{return this._compileSchemaEnv(T0)}catch(i0){if(!(i0 instanceof Q.default))throw i0;return N0.call(this,i0),await E0.call(this,i0.missingSchema),Y0.call(this,T0)}}function N0({missingSchema:T0,missingRef:i0}){if(this.refs[T0])throw Error(`AnySchema ${T0} is loaded but ${i0} cannot be resolved`)}async function E0(T0){let i0=await G0.call(this,T0);if(!this.refs[T0])await s.call(this,i0.$schema);if(!this.refs[T0])this.addSchema(i0,T0,p)}async function G0(T0){let i0=this._loading[T0];if(i0)return i0;try{return await(this._loading[T0]=e(T0))}finally{delete this._loading[T0]}}}addSchema(g,p,e,y=this.opts.validateSchema){if(Array.isArray(g)){for(let Y0 of g)this.addSchema(Y0,void 0,e,y);return this}let s;if(typeof g==="object"){let{schemaId:Y0}=this.opts;if(s=g[Y0],s!==void 0&&typeof s!="string")throw Error(`schema ${Y0} must be string`)}return p=(0,G.normalizeId)(p||s),this._checkUnique(p),this.schemas[p]=this._addSchema(g,e,p,y,!0),this}addMetaSchema(g,p,e=this.opts.validateSchema){return this.addSchema(g,p,!0,e),this}validateSchema(g,p){if(typeof g=="boolean")return!0;let e;if(e=g.$schema,e!==void 0&&typeof e!="string")throw Error("$schema must be a string");if(e=e||this.opts.defaultMeta||this.defaultMeta(),!e)return this.logger.warn("meta-schema not available"),this.errors=null,!0;let y=this.validate(e,g);if(!y&&p){let s="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(s);else throw Error(s)}return y}getSchema(g){let p;while(typeof(p=T.call(this,g))=="string")g=p;if(p===void 0){let{schemaId:e}=this.opts,y=new I.SchemaEnv({schema:{},schemaId:e});if(p=I.resolveSchema.call(this,y,g),!p)return;this.refs[g]=p}return p.validate||this._compileSchemaEnv(p)}removeSchema(g){if(g instanceof RegExp)return this._removeAllSchemas(this.schemas,g),this._removeAllSchemas(this.refs,g),this;switch(typeof g){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{let p=T.call(this,g);if(typeof p=="object")this._cache.delete(p.schema);return delete this.schemas[g],delete this.refs[g],this}case"object":{let p=g;this._cache.delete(p);let e=g[this.opts.schemaId];if(e)e=(0,G.normalizeId)(e),delete this.schemas[e],delete this.refs[e];return this}default:throw Error("ajv.removeSchema: invalid parameter")}}addVocabulary(g){for(let p of g)this.addKeyword(p);return this}addKeyword(g,p){let e;if(typeof g=="string"){if(e=g,typeof p=="object")this.logger.warn("these parameters are deprecated, see docs for addKeyword"),p.keyword=e}else if(typeof g=="object"&&p===void 0){if(p=g,e=p.keyword,Array.isArray(e)&&!e.length)throw Error("addKeywords: keyword must be string or non-empty array")}else throw Error("invalid addKeywords parameters");if(c.call(this,e,p),!p)return(0,W.eachItem)(e,(s)=>z0.call(this,s)),this;d.call(this,p);let y={...p,type:(0,H.getJSONTypes)(p.type),schemaType:(0,H.getJSONTypes)(p.schemaType)};return(0,W.eachItem)(e,y.type.length===0?(s)=>z0.call(this,s,y):(s)=>y.type.forEach((Y0)=>z0.call(this,s,y,Y0))),this}getKeyword(g){let p=this.RULES.all[g];return typeof p=="object"?p.definition:!!p}removeKeyword(g){let{RULES:p}=this;delete p.keywords[g],delete p.all[g];for(let e of p.rules){let y=e.rules.findIndex((s)=>s.keyword===g);if(y>=0)e.rules.splice(y,1)}return this}addFormat(g,p){if(typeof p=="string")p=new RegExp(p);return this.formats[g]=p,this}errorsText(g=this.errors,{separator:p=", ",dataVar:e="data"}={}){if(!g||g.length===0)return"No errors";return g.map((y)=>`${e}${y.instancePath} ${y.message}`).reduce((y,s)=>y+p+s)}$dataMetaSchema(g,p){let e=this.RULES.all;g=JSON.parse(JSON.stringify(g));for(let y of p){let s=y.split("/").slice(1),Y0=g;for(let N0 of s)Y0=Y0[N0];for(let N0 in e){let E0=e[N0];if(typeof E0!="object")continue;let{$data:G0}=E0.definition,T0=Y0[N0];if(G0&&T0)Y0[N0]=$0(T0)}}return g}_removeAllSchemas(g,p){for(let e in g){let y=g[e];if(!p||p.test(e)){if(typeof y=="string")delete g[e];else if(y&&!y.meta)this._cache.delete(y.schema),delete g[e]}}}_addSchema(g,p,e,y=this.opts.validateSchema,s=this.opts.addUsedSchema){let Y0,{schemaId:N0}=this.opts;if(typeof g=="object")Y0=g[N0];else if(this.opts.jtd)throw Error("schema must be object");else if(typeof g!="boolean")throw Error("schema must be object or boolean");let E0=this._cache.get(g);if(E0!==void 0)return E0;e=(0,G.normalizeId)(Y0||e);let G0=G.getSchemaRefs.call(this,g,e);if(E0=new I.SchemaEnv({schema:g,schemaId:N0,meta:p,baseId:e,localRefs:G0}),this._cache.set(E0.schema,E0),s&&!e.startsWith("#")){if(e)this._checkUnique(e);this.refs[e]=E0}if(y)this.validateSchema(g,!0);return E0}_checkUnique(g){if(this.schemas[g]||this.refs[g])throw Error(`schema with key or id "${g}" already exists`)}_compileSchemaEnv(g){if(g.meta)this._compileMetaSchema(g);else I.compileSchema.call(this,g);if(!g.validate)throw Error("ajv implementation error");return g.validate}_compileMetaSchema(g){let p=this.opts;this.opts=this._metaOpts;try{I.compileSchema.call(this,g)}finally{this.opts=p}}};D.ValidationError=z.default,D.MissingRefError=Q.default,$.default=D;function P(g,p,e,y="error"){for(let s in g){let Y0=s;if(Y0 in p)this.logger[y](`${e}: option ${s}. ${g[Y0]}`)}}function T(g){return g=(0,G.normalizeId)(g),this.schemas[g]||this.refs[g]}function A(){let g=this.opts.schemas;if(!g)return;if(Array.isArray(g))this.addSchema(g);else for(let p in g)this.addSchema(g[p],p)}function j(){for(let g in this.opts.formats){let p=this.opts.formats[g];if(p)this.addFormat(g,p)}}function C(g){if(Array.isArray(g)){this.addVocabulary(g);return}this.logger.warn("keywords option as map is deprecated, pass array");for(let p in g){let e=g[p];if(!e.keyword)e.keyword=p;this.addKeyword(e)}}function b(){let g={...this.opts};for(let p of V)delete g[p];return g}let x={log(){},warn(){},error(){}};function S(g){if(g===!1)return x;if(g===void 0)return console;if(g.log&&g.warn&&g.error)return g;throw Error("logger must implement log, warn and error methods")}let i=/^[a-z_$][a-z0-9_$:-]*$/i;function c(g,p){let{RULES:e}=this;if((0,W.eachItem)(g,(y)=>{if(e.keywords[y])throw Error(`Keyword ${y} is already defined`);if(!i.test(y))throw Error(`Keyword ${y} has invalid name`)}),!p)return;if(p.$data&&!(("code"in p)||("validate"in p)))throw Error('$data keyword must have "code" or "validate" function')}function z0(g,p,e){var y;let s=p===null||p===void 0?void 0:p.post;if(e&&s)throw Error('keyword with "post" flag cannot have "type"');let{RULES:Y0}=this,N0=s?Y0.post:Y0.rules.find(({type:G0})=>G0===e);if(!N0)N0={type:e,rules:[]},Y0.rules.push(N0);if(Y0.keywords[g]=!0,!p)return;let E0={keyword:g,definition:{...p,type:(0,H.getJSONTypes)(p.type),schemaType:(0,H.getJSONTypes)(p.schemaType)}};if(p.before)k.call(this,N0,E0,p.before);else N0.rules.push(E0);Y0.all[g]=E0,(y=p.implements)===null||y===void 0||y.forEach((G0)=>this.addKeyword(G0))}function k(g,p,e){let y=g.rules.findIndex((s)=>s.keyword===e);if(y>=0)g.rules.splice(y,0,p);else g.rules.push(p),this.logger.warn(`rule ${e} is not defined`)}function d(g){let{metaSchema:p}=g;if(p===void 0)return;if(g.$data&&this.opts.$data)p=$0(p);g.validateSchema=this.compile(p,!0)}let t={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function $0(g){return{anyOf:[g,t]}}}),lu0=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y={keyword:"id",code(){throw Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};$.default=Y}),KS=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0}),$.callRef=$.getValidate=void 0;let Y=kQ(),U=Q5(),z=L1(),Q=z5(),J=yw(),I=v1(),K={keyword:"$ref",schemaType:"string",code(W){let{gen:X,schema:Z,it:q}=W,{baseId:V,schemaEnv:F,validateName:M,opts:w,self:N}=q,{root:O}=F;if((Z==="#"||Z==="#/")&&V===O.baseId)return P();let D=J.resolveRef.call(N,O,V,Z);if(D===void 0)throw new Y.default(q.opts.uriResolver,V,Z);if(D instanceof J.SchemaEnv)return T(D);return A(D);function P(){if(F===O)return H(W,M,F,F.$async);let j=X.scopeValue("root",{ref:O});return H(W,z._`${j}.validate`,O,O.$async)}function T(j){H(W,G(W,j),j,j.$async)}function A(j){let C=X.scopeValue("schema",w.code.source===!0?{ref:j,code:(0,z.stringify)(j)}:{ref:j}),b=X.name("valid"),x=W.subschema({schema:j,dataTypes:[],schemaPath:z.nil,topSchemaRef:C,errSchemaPath:Z},b);W.mergeEvaluated(x),W.ok(b)}}};function G(W,X){let{gen:Z}=W;return X.validate?Z.scopeValue("validate",{ref:X.validate}):z._`${Z.scopeValue("wrapper",{ref:X})}.validate`}$.getValidate=G;function H(W,X,Z,q){let{gen:V,it:F}=W,{allErrors:M,schemaEnv:w,opts:N}=F,O=N.passContext?Q.default.this:z.nil;if(q)D();else P();function D(){if(!w.$async)throw Error("async schema referenced by sync schema");let j=V.let("valid");V.try(()=>{if(V.code(z._`await ${(0,U.callValidateCode)(W,X,O)}`),A(X),!M)V.assign(j,!0)},(C)=>{if(V.if(z._`!(${C} instanceof ${F.ValidationError})`,()=>V.throw(C)),T(C),!M)V.assign(j,!1)}),W.ok(j)}function P(){W.result((0,U.callValidateCode)(W,X,O),()=>A(X),()=>T(X))}function T(j){let C=z._`${j}.errors`;V.assign(Q.default.vErrors,z._`${Q.default.vErrors} === null ? ${C} : ${Q.default.vErrors}.concat(${C})`),V.assign(Q.default.errors,z._`${Q.default.vErrors}.length`)}function A(j){var C;if(!F.opts.unevaluated)return;let b=(C=Z===null||Z===void 0?void 0:Z.validate)===null||C===void 0?void 0:C.evaluated;if(F.props!==!0)if(b&&!b.dynamicProps){if(b.props!==void 0)F.props=I.mergeEvaluated.props(V,b.props,F.props)}else{let x=V.var("props",z._`${j}.evaluated.props`);F.props=I.mergeEvaluated.props(V,x,F.props,z.Name)}if(F.items!==!0)if(b&&!b.dynamicItems){if(b.items!==void 0)F.items=I.mergeEvaluated.items(V,b.items,F.items)}else{let x=V.var("items",z._`${j}.evaluated.items`);F.items=I.mergeEvaluated.items(V,x,F.items,z.Name)}}}$.callRef=H,$.default=K}),rt=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=lu0(),U=KS(),z=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",Y.default,U.default];$.default=z}),ou0=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=L1(),U=Y.operators,z={maximum:{okStr:"<=",ok:U.LTE,fail:U.GT},minimum:{okStr:">=",ok:U.GTE,fail:U.LT},exclusiveMaximum:{okStr:"<",ok:U.LT,fail:U.GTE},exclusiveMinimum:{okStr:">",ok:U.GT,fail:U.LTE}},Q={keyword:Object.keys(z),type:"number",schemaType:"number",$data:!0,error:{message:({keyword:J,schemaCode:I})=>Y.str`must be ${z[J].okStr} ${I}`,params:({keyword:J,schemaCode:I})=>Y._`{comparison: ${z[J].okStr}, limit: ${I}}`},code(J){let{keyword:I,data:K,schemaCode:G}=J;J.fail$data(Y._`${K} ${z[I].fail} ${G} || isNaN(${K})`)}};$.default=Q}),ru0=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=L1(),U={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:{message:({schemaCode:z})=>Y.str`must be multiple of ${z}`,params:({schemaCode:z})=>Y._`{multipleOf: ${z}}`},code(z){let{gen:Q,data:J,schemaCode:I,it:K}=z,G=K.opts.multipleOfPrecision,H=Q.let("res"),W=G?Y._`Math.abs(Math.round(${H}) - ${H}) > 1e-${G}`:Y._`${H} !== parseInt(${H})`;z.fail$data(Y._`(${I} === 0 || (${H} = ${J}/${I}, ${W}))`)}};$.default=U}),su0=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0});function Y(U){let z=U.length,Q=0,J=0,I;while(J=55296&&I<=56319&&J{Object.defineProperty($,"__esModule",{value:!0});let Y=L1(),U=v1(),z=su0(),Q={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:{message({keyword:J,schemaCode:I}){let K=J==="maxLength"?"more":"fewer";return Y.str`must NOT have ${K} than ${I} characters`},params:({schemaCode:J})=>Y._`{limit: ${J}}`},code(J){let{keyword:I,data:K,schemaCode:G,it:H}=J,W=I==="maxLength"?Y.operators.GT:Y.operators.LT,X=H.opts.unicode===!1?Y._`${K}.length`:Y._`${(0,U.useFunc)(J.gen,z.default)}(${K})`;J.fail$data(Y._`${X} ${W} ${G}`)}};$.default=Q}),tu0=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=Q5(),U=v1(),z=L1(),Q={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:{message:({schemaCode:J})=>z.str`must match pattern "${J}"`,params:({schemaCode:J})=>z._`{pattern: ${J}}`},code(J){let{gen:I,data:K,$data:G,schema:H,schemaCode:W,it:X}=J,Z=X.opts.unicodeRegExp?"u":"";if(G){let{regExp:q}=X.opts.code,V=q.code==="new RegExp"?z._`new RegExp`:(0,U.useFunc)(I,q),F=I.let("valid");I.try(()=>I.assign(F,z._`${V}(${W}, ${Z}).test(${K})`),()=>I.assign(F,!1)),J.fail$data(z._`!${F}`)}else{let q=(0,Y.usePattern)(J,H);J.fail$data(z._`!${q}.test(${K})`)}}};$.default=Q}),eu0=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=L1(),U={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:{message({keyword:z,schemaCode:Q}){let J=z==="maxProperties"?"more":"fewer";return Y.str`must NOT have ${J} than ${Q} properties`},params:({schemaCode:z})=>Y._`{limit: ${z}}`},code(z){let{keyword:Q,data:J,schemaCode:I}=z,K=Q==="maxProperties"?Y.operators.GT:Y.operators.LT;z.fail$data(Y._`Object.keys(${J}).length ${K} ${I}`)}};$.default=U}),$b0=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=Q5(),U=L1(),z=v1(),Q={keyword:"required",type:"object",schemaType:"array",$data:!0,error:{message:({params:{missingProperty:J}})=>U.str`must have required property '${J}'`,params:({params:{missingProperty:J}})=>U._`{missingProperty: ${J}}`},code(J){let{gen:I,schema:K,schemaCode:G,data:H,$data:W,it:X}=J,{opts:Z}=X;if(!W&&K.length===0)return;let q=K.length>=Z.loopRequired;if(X.allErrors)V();else F();if(Z.strictRequired){let N=J.parentSchema.properties,{definedProperties:O}=J.it;for(let D of K)if((N===null||N===void 0?void 0:N[D])===void 0&&!O.has(D)){let P=`required property "${D}" is not defined at "${X.schemaEnv.baseId+X.errSchemaPath}" (strictRequired)`;(0,z.checkStrictMode)(X,P,X.opts.strictRequired)}}function V(){if(q||W)J.block$data(U.nil,M);else for(let N of K)(0,Y.checkReportMissingProp)(J,N)}function F(){let N=I.let("missing");if(q||W){let O=I.let("valid",!0);J.block$data(O,()=>w(N,O)),J.ok(O)}else I.if((0,Y.checkMissingProp)(J,K,N)),(0,Y.reportMissingProp)(J,N),I.else()}function M(){I.forOf("prop",G,(N)=>{J.setParams({missingProperty:N}),I.if((0,Y.noPropertyInData)(I,H,N,Z.ownProperties),()=>J.error())})}function w(N,O){J.setParams({missingProperty:N}),I.forOf(N,G,()=>{I.assign(O,(0,Y.propertyInData)(I,H,N,Z.ownProperties)),I.if((0,U.not)(O),()=>{J.error(),I.break()})},U.nil)}}};$.default=Q}),Yb0=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=L1(),U={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:{message({keyword:z,schemaCode:Q}){let J=z==="maxItems"?"more":"fewer";return Y.str`must NOT have ${J} than ${Q} items`},params:({schemaCode:z})=>Y._`{limit: ${z}}`},code(z){let{keyword:Q,data:J,schemaCode:I}=z,K=Q==="maxItems"?Y.operators.GT:Y.operators.LT;z.fail$data(Y._`${J}.length ${K} ${I}`)}};$.default=U}),GS=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=lt();Y.code='require("ajv/dist/runtime/equal").default',$.default=Y}),Ub0=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=hw(),U=L1(),z=v1(),Q=GS(),J={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:{message:({params:{i:I,j:K}})=>U.str`must NOT have duplicate items (items ## ${K} and ${I} are identical)`,params:({params:{i:I,j:K}})=>U._`{i: ${I}, j: ${K}}`},code(I){let{gen:K,data:G,$data:H,schema:W,parentSchema:X,schemaCode:Z,it:q}=I;if(!H&&!W)return;let V=K.let("valid"),F=X.items?(0,Y.getSchemaTypes)(X.items):[];I.block$data(V,M,U._`${Z} === false`),I.ok(V);function M(){let D=K.let("i",U._`${G}.length`),P=K.let("j");I.setParams({i:D,j:P}),K.assign(V,!0),K.if(U._`${D} > 1`,()=>(w()?N:O)(D,P))}function w(){return F.length>0&&!F.some((D)=>D==="object"||D==="array")}function N(D,P){let T=K.name("item"),A=(0,Y.checkDataTypes)(F,T,q.opts.strictNumbers,Y.DataType.Wrong),j=K.const("indices",U._`{}`);K.for(U._`;${D}--;`,()=>{if(K.let(T,U._`${G}[${D}]`),K.if(A,U._`continue`),F.length>1)K.if(U._`typeof ${T} == "string"`,U._`${T} += "_"`);K.if(U._`typeof ${j}[${T}] == "number"`,()=>{K.assign(P,U._`${j}[${T}]`),I.error(),K.assign(V,!1).break()}).code(U._`${j}[${T}] = ${D}`)})}function O(D,P){let T=(0,z.useFunc)(K,Q.default),A=K.name("outer");K.label(A).for(U._`;${D}--;`,()=>K.for(U._`${P} = ${D}; ${P}--;`,()=>K.if(U._`${T}(${G}[${D}], ${G}[${P}])`,()=>{I.error(),K.assign(V,!1).break(A)})))}}};$.default=J}),zb0=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=L1(),U=v1(),z=GS(),Q={keyword:"const",$data:!0,error:{message:"must be equal to constant",params:({schemaCode:J})=>Y._`{allowedValue: ${J}}`},code(J){let{gen:I,data:K,$data:G,schemaCode:H,schema:W}=J;if(G||W&&typeof W=="object")J.fail$data(Y._`!${(0,U.useFunc)(I,z.default)}(${K}, ${H})`);else J.fail(Y._`${W} !== ${K}`)}};$.default=Q}),Qb0=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=L1(),U=v1(),z=GS(),Q={keyword:"enum",schemaType:"array",$data:!0,error:{message:"must be equal to one of the allowed values",params:({schemaCode:J})=>Y._`{allowedValues: ${J}}`},code(J){let{gen:I,data:K,$data:G,schema:H,schemaCode:W,it:X}=J;if(!G&&H.length===0)throw Error("enum must have non-empty array");let Z=H.length>=X.opts.loopEnum,q,V=()=>q!==null&&q!==void 0?q:q=(0,U.useFunc)(I,z.default),F;if(Z||G)F=I.let("valid"),J.block$data(F,M);else{if(!Array.isArray(H))throw Error("ajv implementation error");let N=I.const("vSchema",W);F=(0,Y.or)(...H.map((O,D)=>w(N,D)))}J.pass(F);function M(){I.assign(F,!1),I.forOf("v",W,(N)=>I.if(Y._`${V()}(${K}, ${N})`,()=>I.assign(F,!0).break()))}function w(N,O){let D=H[O];return typeof D==="object"&&D!==null?Y._`${V()}(${K}, ${N}[${O}])`:Y._`${K} === ${D}`}}};$.default=Q}),st=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=ou0(),U=ru0(),z=au0(),Q=tu0(),J=eu0(),I=$b0(),K=Yb0(),G=Ub0(),H=zb0(),W=Qb0(),X=[Y.default,U.default,z.default,Q.default,J.default,I.default,K.default,G.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},H.default,W.default];$.default=X}),at=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0}),$.validateAdditionalItems=void 0;let Y=L1(),U=v1(),z={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:{message:({params:{len:J}})=>Y.str`must NOT have more than ${J} items`,params:({params:{len:J}})=>Y._`{limit: ${J}}`},code(J){let{parentSchema:I,it:K}=J,{items:G}=I;if(!Array.isArray(G)){(0,U.checkStrictMode)(K,'"additionalItems" is ignored when "items" is not an array of schemas');return}Q(J,G)}};function Q(J,I){let{gen:K,schema:G,data:H,keyword:W,it:X}=J;X.items=!0;let Z=K.const("len",Y._`${H}.length`);if(G===!1)J.setParams({len:I.length}),J.pass(Y._`${Z} <= ${I.length}`);else if(typeof G=="object"&&!(0,U.alwaysValidSchema)(X,G)){let V=K.var("valid",Y._`${Z} <= ${I.length}`);K.if((0,Y.not)(V),()=>q(V)),J.ok(V)}function q(V){K.forRange("i",I.length,Z,(F)=>{if(J.subschema({keyword:W,dataProp:F,dataPropType:U.Type.Num},V),!X.allErrors)K.if((0,Y.not)(V),()=>K.break())})}}$.validateAdditionalItems=Q,$.default=z}),tt=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0}),$.validateTuple=void 0;let Y=L1(),U=v1(),z=Q5(),Q={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(I){let{schema:K,it:G}=I;if(Array.isArray(K))return J(I,"additionalItems",K);if(G.items=!0,(0,U.alwaysValidSchema)(G,K))return;I.ok((0,z.validateArray)(I))}};function J(I,K,G=I.schema){let{gen:H,parentSchema:W,data:X,keyword:Z,it:q}=I;if(M(W),q.opts.unevaluated&&G.length&&q.items!==!0)q.items=U.mergeEvaluated.items(H,G.length,q.items);let V=H.name("valid"),F=H.const("len",Y._`${X}.length`);G.forEach((w,N)=>{if((0,U.alwaysValidSchema)(q,w))return;H.if(Y._`${F} > ${N}`,()=>I.subschema({keyword:Z,schemaProp:N,dataProp:N},V)),I.ok(V)});function M(w){let{opts:N,errSchemaPath:O}=q,D=G.length,P=D===w.minItems&&(D===w.maxItems||w[K]===!1);if(N.strictTuples&&!P){let T=`"${Z}" is ${D}-tuple, but minItems or maxItems/${K} are not specified or different at path "${O}"`;(0,U.checkStrictMode)(q,T,N.strictTuples)}}}$.validateTuple=J,$.default=Q}),Jb0=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=tt(),U={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:(z)=>(0,Y.validateTuple)(z,"items")};$.default=U}),Ib0=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=L1(),U=v1(),z=Q5(),Q=at(),J={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:{message:({params:{len:I}})=>Y.str`must NOT have more than ${I} items`,params:({params:{len:I}})=>Y._`{limit: ${I}}`},code(I){let{schema:K,parentSchema:G,it:H}=I,{prefixItems:W}=G;if(H.items=!0,(0,U.alwaysValidSchema)(H,K))return;if(W)(0,Q.validateAdditionalItems)(I,W);else I.ok((0,z.validateArray)(I))}};$.default=J}),Kb0=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=L1(),U=v1(),z={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:{message:({params:{min:Q,max:J}})=>J===void 0?Y.str`must contain at least ${Q} valid item(s)`:Y.str`must contain at least ${Q} and no more than ${J} valid item(s)`,params:({params:{min:Q,max:J}})=>J===void 0?Y._`{minContains: ${Q}}`:Y._`{minContains: ${Q}, maxContains: ${J}}`},code(Q){let{gen:J,schema:I,parentSchema:K,data:G,it:H}=Q,W,X,{minContains:Z,maxContains:q}=K;if(H.opts.next)W=Z===void 0?1:Z,X=q;else W=1;let V=J.const("len",Y._`${G}.length`);if(Q.setParams({min:W,max:X}),X===void 0&&W===0){(0,U.checkStrictMode)(H,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(X!==void 0&&W>X){(0,U.checkStrictMode)(H,'"minContains" > "maxContains" is always invalid'),Q.fail();return}if((0,U.alwaysValidSchema)(H,I)){let O=Y._`${V} >= ${W}`;if(X!==void 0)O=Y._`${O} && ${V} <= ${X}`;Q.pass(O);return}H.items=!0;let F=J.name("valid");if(X===void 0&&W===1)w(F,()=>J.if(F,()=>J.break()));else if(W===0){if(J.let(F,!0),X!==void 0)J.if(Y._`${G}.length > 0`,M)}else J.let(F,!1),M();Q.result(F,()=>Q.reset());function M(){let O=J.name("_valid"),D=J.let("count",0);w(O,()=>J.if(O,()=>N(D)))}function w(O,D){J.forRange("i",0,V,(P)=>{Q.subschema({keyword:"contains",dataProp:P,dataPropType:U.Type.Num,compositeRule:!0},O),D()})}function N(O){if(J.code(Y._`${O}++`),X===void 0)J.if(Y._`${O} >= ${W}`,()=>J.assign(F,!0).break());else if(J.if(Y._`${O} > ${X}`,()=>J.assign(F,!1).break()),W===1)J.assign(F,!0);else J.if(Y._`${O} >= ${W}`,()=>J.assign(F,!0))}}};$.default=z}),HS=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0}),$.validateSchemaDeps=$.validatePropertyDeps=$.error=void 0;let Y=L1(),U=v1(),z=Q5();$.error={message:({params:{property:G,depsCount:H,deps:W}})=>{let X=H===1?"property":"properties";return Y.str`must have ${X} ${W} when property ${G} is present`},params:({params:{property:G,depsCount:H,deps:W,missingProperty:X}})=>Y._`{property: ${G}, missingProperty: ${X}, depsCount: ${H}, - deps: ${W}}`};let Q={keyword:"dependencies",type:"object",schemaType:"object",error:$.error,code(G){let[H,W]=J(G);I(G,H),K(G,W)}};function J({schema:G}){let H={},W={};for(let X in G){if(X==="__proto__")continue;let Z=Array.isArray(G[X])?H:W;Z[X]=G[X]}return[H,W]}function I(G,H=G.schema){let{gen:W,data:X,it:Z}=G;if(Object.keys(H).length===0)return;let q=W.let("missing");for(let V in H){let F=H[V];if(F.length===0)continue;let M=(0,z.propertyInData)(W,X,V,Z.opts.ownProperties);if(G.setParams({property:V,depsCount:F.length,deps:F.join(", ")}),Z.allErrors)W.if(M,()=>{for(let w of F)(0,z.checkReportMissingProp)(G,w)});else W.if(Y._`${M} && (${(0,z.checkMissingProp)(G,F,q)})`),(0,z.reportMissingProp)(G,q),W.else()}}$.validatePropertyDeps=I;function K(G,H=G.schema){let{gen:W,data:X,keyword:Z,it:q}=G,V=W.name("valid");for(let F in H){if((0,U.alwaysValidSchema)(q,H[F]))continue;W.if((0,z.propertyInData)(W,X,F,q.opts.ownProperties),()=>{let M=G.subschema({keyword:Z,schemaProp:F},V);G.mergeValidEvaluated(M,V)},()=>W.var(V,!0)),G.ok(V)}}$.validateSchemaDeps=K,$.default=Q}),Gb0=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=L1(),U=v1(),z={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:{message:"property name must be valid",params:({params:Q})=>Y._`{propertyName: ${Q.propertyName}}`},code(Q){let{gen:J,schema:I,data:K,it:G}=Q;if((0,U.alwaysValidSchema)(G,I))return;let H=J.name("valid");J.forIn("key",K,(W)=>{Q.setParams({propertyName:W}),Q.subschema({keyword:"propertyNames",data:W,dataTypes:["string"],propertyName:W,compositeRule:!0},H),J.if((0,Y.not)(H),()=>{if(Q.error(!0),!G.allErrors)J.break()})}),Q.ok(H)}};$.default=z}),et=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=Q5(),U=L1(),z=z5(),Q=v1(),J={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:{message:"must NOT have additional properties",params:({params:I})=>U._`{additionalProperty: ${I.additionalProperty}}`},code(I){let{gen:K,schema:G,parentSchema:H,data:W,errsCount:X,it:Z}=I;if(!X)throw Error("ajv implementation error");let{allErrors:q,opts:V}=Z;if(Z.props=!0,V.removeAdditional!=="all"&&(0,Q.alwaysValidSchema)(Z,G))return;let F=(0,Y.allSchemaProperties)(H.properties),M=(0,Y.allSchemaProperties)(H.patternProperties);w(),I.ok(U._`${X} === ${z.default.errors}`);function w(){K.forIn("key",W,(T)=>{if(!F.length&&!M.length)D(T);else K.if(N(T),()=>D(T))})}function N(T){let A;if(F.length>8){let j=(0,Q.schemaRefOrVal)(Z,H.properties,"properties");A=(0,Y.isOwnProperty)(K,j,T)}else if(F.length)A=(0,U.or)(...F.map((j)=>U._`${T} === ${j}`));else A=U.nil;if(M.length)A=(0,U.or)(A,...M.map((j)=>U._`${(0,Y.usePattern)(I,j)}.test(${T})`));return(0,U.not)(A)}function O(T){K.code(U._`delete ${W}[${T}]`)}function D(T){if(V.removeAdditional==="all"||V.removeAdditional&&G===!1){O(T);return}if(G===!1){if(I.setParams({additionalProperty:T}),I.error(),!q)K.break();return}if(typeof G=="object"&&!(0,Q.alwaysValidSchema)(Z,G)){let A=K.name("valid");if(V.removeAdditional==="failing")P(T,A,!1),K.if((0,U.not)(A),()=>{I.reset(),O(T)});else if(P(T,A),!q)K.if((0,U.not)(A),()=>K.break())}}function P(T,A,j){let C={keyword:"additionalProperties",dataProp:T,dataPropType:Q.Type.Str};if(j===!1)Object.assign(C,{compositeRule:!0,createErrors:!1,allErrors:!1});I.subschema(C,A)}}};$.default=J}),Hb0=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=yQ(),U=Q5(),z=v1(),Q=et(),J={keyword:"properties",type:"object",schemaType:"object",code(I){let{gen:K,schema:G,parentSchema:H,data:W,it:X}=I;if(X.opts.removeAdditional==="all"&&H.additionalProperties===void 0)Q.default.code(new Y.KeywordCxt(X,Q.default,"additionalProperties"));let Z=(0,U.allSchemaProperties)(G);for(let w of Z)X.definedProperties.add(w);if(X.opts.unevaluated&&Z.length&&X.props!==!0)X.props=z.mergeEvaluated.props(K,(0,z.toHash)(Z),X.props);let q=Z.filter((w)=>!(0,z.alwaysValidSchema)(X,G[w]));if(q.length===0)return;let V=K.name("valid");for(let w of q){if(F(w))M(w);else{if(K.if((0,U.propertyInData)(K,W,w,X.opts.ownProperties)),M(w),!X.allErrors)K.else().var(V,!0);K.endIf()}I.it.definedProperties.add(w),I.ok(V)}function F(w){return X.opts.useDefaults&&!X.compositeRule&&G[w].default!==void 0}function M(w){I.subschema({keyword:"properties",schemaProp:w,dataProp:w},V)}}};$.default=J}),Wb0=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=Q5(),U=L1(),z=v1(),Q=v1(),J={keyword:"patternProperties",type:"object",schemaType:"object",code(I){let{gen:K,schema:G,data:H,parentSchema:W,it:X}=I,{opts:Z}=X,q=(0,Y.allSchemaProperties)(G),V=q.filter((P)=>(0,z.alwaysValidSchema)(X,G[P]));if(q.length===0||V.length===q.length&&(!X.opts.unevaluated||X.props===!0))return;let F=Z.strictSchema&&!Z.allowMatchingProperties&&W.properties,M=K.name("valid");if(X.props!==!0&&!(X.props instanceof U.Name))X.props=(0,Q.evaluatedPropsToName)(K,X.props);let{props:w}=X;N();function N(){for(let P of q){if(F)O(P);if(X.allErrors)D(P);else K.var(M,!0),D(P),K.if(M)}}function O(P){for(let T in F)if(new RegExp(P).test(T))(0,z.checkStrictMode)(X,`property ${T} matches pattern ${P} (use allowMatchingProperties)`)}function D(P){K.forIn("key",H,(T)=>{K.if(U._`${(0,Y.usePattern)(I,P)}.test(${T})`,()=>{let A=V.includes(P);if(!A)I.subschema({keyword:"patternProperties",schemaProp:P,dataProp:T,dataPropType:Q.Type.Str},M);if(X.opts.unevaluated&&w!==!0)K.assign(U._`${w}[${T}]`,!0);else if(!A&&!X.allErrors)K.if((0,U.not)(M),()=>K.break())})})}}};$.default=J}),Xb0=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=v1(),U={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(z){let{gen:Q,schema:J,it:I}=z;if((0,Y.alwaysValidSchema)(I,J)){z.fail();return}let K=Q.name("valid");z.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},K),z.failResult(K,()=>z.reset(),()=>z.error())},error:{message:"must NOT be valid"}};$.default=U}),Zb0=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:Q5().validateUnion,error:{message:"must match a schema in anyOf"}};$.default=Y}),qb0=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=L1(),U=v1(),z={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:{message:"must match exactly one schema in oneOf",params:({params:Q})=>Y._`{passingSchemas: ${Q.passing}}`},code(Q){let{gen:J,schema:I,parentSchema:K,it:G}=Q;if(!Array.isArray(I))throw Error("ajv implementation error");if(G.opts.discriminator&&K.discriminator)return;let H=I,W=J.let("valid",!1),X=J.let("passing",null),Z=J.name("_valid");Q.setParams({passing:X}),J.block(q),Q.result(W,()=>Q.reset(),()=>Q.error(!0));function q(){H.forEach((V,F)=>{let M;if((0,U.alwaysValidSchema)(G,V))J.var(Z,!0);else M=Q.subschema({keyword:"oneOf",schemaProp:F,compositeRule:!0},Z);if(F>0)J.if(Y._`${Z} && ${W}`).assign(W,!1).assign(X,Y._`[${X}, ${F}]`).else();J.if(Z,()=>{if(J.assign(W,!0),J.assign(X,F),M)Q.mergeEvaluated(M,Y.Name)})})}}};$.default=z}),Vb0=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=v1(),U={keyword:"allOf",schemaType:"array",code(z){let{gen:Q,schema:J,it:I}=z;if(!Array.isArray(J))throw Error("ajv implementation error");let K=Q.name("valid");J.forEach((G,H)=>{if((0,Y.alwaysValidSchema)(I,G))return;let W=z.subschema({keyword:"allOf",schemaProp:H},K);z.ok(K),z.mergeEvaluated(W)})}};$.default=U}),Lb0=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=L1(),U=v1(),z={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:{message:({params:J})=>Y.str`must match "${J.ifClause}" schema`,params:({params:J})=>Y._`{failingKeyword: ${J.ifClause}}`},code(J){let{gen:I,parentSchema:K,it:G}=J;if(K.then===void 0&&K.else===void 0)(0,U.checkStrictMode)(G,'"if" without "then" and "else" is ignored');let H=Q(G,"then"),W=Q(G,"else");if(!H&&!W)return;let X=I.let("valid",!0),Z=I.name("_valid");if(q(),J.reset(),H&&W){let F=I.let("ifClause");J.setParams({ifClause:F}),I.if(Z,V("then",F),V("else",F))}else if(H)I.if(Z,V("then"));else I.if((0,Y.not)(Z),V("else"));J.pass(X,()=>J.error(!0));function q(){let F=J.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},Z);J.mergeEvaluated(F)}function V(F,M){return()=>{let w=J.subschema({keyword:F},Z);if(I.assign(X,Z),J.mergeValidEvaluated(w,X),M)I.assign(M,Y._`${F}`);else J.setParams({ifClause:F})}}}};function Q(J,I){let K=J.schema[I];return K!==void 0&&!(0,U.alwaysValidSchema)(J,K)}$.default=z}),Fb0=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=v1(),U={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:z,parentSchema:Q,it:J}){if(Q.if===void 0)(0,Y.checkStrictMode)(J,`"${z}" without "if" is ignored`)}};$.default=U}),$e=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=at(),U=Jb0(),z=tt(),Q=Ib0(),J=Kb0(),I=HS(),K=Gb0(),G=et(),H=Hb0(),W=Wb0(),X=Xb0(),Z=Zb0(),q=qb0(),V=Vb0(),F=Lb0(),M=Fb0();function w(N=!1){let O=[X.default,Z.default,q.default,V.default,F.default,M.default,K.default,G.default,I.default,H.default,W.default];if(N)O.push(U.default,Q.default);else O.push(Y.default,z.default);return O.push(J.default),O}$.default=w}),wb0=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=L1(),U={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:{message:({schemaCode:z})=>Y.str`must match format "${z}"`,params:({schemaCode:z})=>Y._`{format: ${z}}`},code(z,Q){let{gen:J,data:I,$data:K,schema:G,schemaCode:H,it:W}=z,{opts:X,errSchemaPath:Z,schemaEnv:q,self:V}=W;if(!X.validateFormats)return;if(K)F();else M();function F(){let w=J.scopeValue("formats",{ref:V.formats,code:X.code.formats}),N=J.const("fDef",Y._`${w}[${H}]`),O=J.let("fType"),D=J.let("format");J.if(Y._`typeof ${N} == "object" && !(${N} instanceof RegExp)`,()=>J.assign(O,Y._`${N}.type || "string"`).assign(D,Y._`${N}.validate`),()=>J.assign(O,Y._`"string"`).assign(D,N)),z.fail$data((0,Y.or)(P(),T()));function P(){if(X.strictSchema===!1)return Y.nil;return Y._`${H} && !${D}`}function T(){let A=q.$async?Y._`(${N}.async ? await ${D}(${I}) : ${D}(${I}))`:Y._`${D}(${I})`,j=Y._`(typeof ${D} == "function" ? ${A} : ${D}.test(${I}))`;return Y._`${D} && ${D} !== true && ${O} === ${Q} && !${j}`}}function M(){let w=V.formats[G];if(!w){P();return}if(w===!0)return;let[N,O,D]=T(w);if(N===Q)z.pass(A());function P(){if(X.strictSchema===!1){V.logger.warn(j());return}throw Error(j());function j(){return`unknown format "${G}" ignored in schema at path "${Z}"`}}function T(j){let C=j instanceof RegExp?(0,Y.regexpCode)(j):X.code.formats?Y._`${X.code.formats}${(0,Y.getProperty)(G)}`:void 0,b=J.scopeValue("formats",{key:G,ref:j,code:C});if(typeof j=="object"&&!(j instanceof RegExp))return[j.type||"string",j.validate,Y._`${b}.validate`];return["string",j,b]}function A(){if(typeof w=="object"&&!(w instanceof RegExp)&&w.async){if(!q.$async)throw Error("async format in sync schema");return Y._`await ${D}(${I})`}return typeof O=="function"?Y._`${D}(${I})`:Y._`${D}.test(${I})`}}}};$.default=U}),Ye=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=[wb0().default];$.default=Y}),Ue=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0}),$.contentVocabulary=$.metadataVocabulary=void 0,$.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"],$.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]}),ze=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=rt(),U=st(),z=$e(),Q=Ye(),J=Ue(),I=[Y.default,U.default,(0,z.default)(),Q.default,J.metadataVocabulary,J.contentVocabulary];$.default=I}),Mb0=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0}),$.DiscrError=void 0;var Y;(function(U){U.Tag="tag",U.Mapping="mapping"})(Y||($.DiscrError=Y={}))}),WS=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=L1(),U=Mb0(),z=yw(),Q=kQ(),J=v1(),I={keyword:"discriminator",type:"object",schemaType:"object",error:{message:({params:{discrError:K,tagName:G}})=>K===U.DiscrError.Tag?`tag "${G}" must be string`:`value of tag "${G}" must be in oneOf`,params:({params:{discrError:K,tag:G,tagName:H}})=>Y._`{error: ${K}, tag: ${H}, tagValue: ${G}}`},code(K){let{gen:G,data:H,schema:W,parentSchema:X,it:Z}=K,{oneOf:q}=X;if(!Z.opts.discriminator)throw Error("discriminator: requires discriminator option");let V=W.propertyName;if(typeof V!="string")throw Error("discriminator: requires propertyName");if(W.mapping)throw Error("discriminator: mapping is not supported");if(!q)throw Error("discriminator: requires oneOf keyword");let F=G.let("valid",!1),M=G.const("tag",Y._`${H}${(0,Y.getProperty)(V)}`);G.if(Y._`typeof ${M} == "string"`,()=>w(),()=>K.error(!1,{discrError:U.DiscrError.Tag,tag:M,tagName:V})),K.ok(F);function w(){let D=O();G.if(!1);for(let P in D)G.elseIf(Y._`${M} === ${P}`),G.assign(F,N(D[P]));G.else(),K.error(!1,{discrError:U.DiscrError.Mapping,tag:M,tagName:V}),G.endIf()}function N(D){let P=G.name("valid"),T=K.subschema({keyword:"oneOf",schemaProp:D},P);return K.mergeEvaluated(T,Y.Name),P}function O(){var D;let P={},T=j(X),A=!0;for(let x=0;x{Y.exports={$schema:"http://json-schema.org/draft-07/schema#",$id:"http://json-schema.org/draft-07/schema#",title:"Core schema meta-schema",definitions:{schemaArray:{type:"array",minItems:1,items:{$ref:"#"}},nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{allOf:[{$ref:"#/definitions/nonNegativeInteger"},{default:0}]},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}},type:["object","boolean"],properties:{$id:{type:"string",format:"uri-reference"},$schema:{type:"string",format:"uri"},$ref:{type:"string",format:"uri-reference"},$comment:{type:"string"},title:{type:"string"},description:{type:"string"},default:!0,readOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/definitions/nonNegativeInteger"},minLength:{$ref:"#/definitions/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},additionalItems:{$ref:"#"},items:{anyOf:[{$ref:"#"},{$ref:"#/definitions/schemaArray"}],default:!0},maxItems:{$ref:"#/definitions/nonNegativeInteger"},minItems:{$ref:"#/definitions/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},contains:{$ref:"#"},maxProperties:{$ref:"#/definitions/nonNegativeInteger"},minProperties:{$ref:"#/definitions/nonNegativeIntegerDefault0"},required:{$ref:"#/definitions/stringArray"},additionalProperties:{$ref:"#"},definitions:{type:"object",additionalProperties:{$ref:"#"},default:{}},properties:{type:"object",additionalProperties:{$ref:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$ref:"#"},propertyNames:{format:"regex"},default:{}},dependencies:{type:"object",additionalProperties:{anyOf:[{$ref:"#"},{$ref:"#/definitions/stringArray"}]}},propertyNames:{$ref:"#"},const:!0,enum:{type:"array",items:!0,minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:"#/definitions/simpleTypes"},{type:"array",items:{$ref:"#/definitions/simpleTypes"},minItems:1,uniqueItems:!0}]},format:{type:"string"},contentMediaType:{type:"string"},contentEncoding:{type:"string"},if:{$ref:"#"},then:{$ref:"#"},else:{$ref:"#"},allOf:{$ref:"#/definitions/schemaArray"},anyOf:{$ref:"#/definitions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"}},default:!0}}),Qe=R0(($,Y)=>{Object.defineProperty($,"__esModule",{value:!0}),$.MissingRefError=$.ValidationError=$.CodeGen=$.Name=$.nil=$.stringify=$.str=$._=$.KeywordCxt=$.Ajv=void 0;let U=IS(),z=ze(),Q=WS(),J=Ob0(),I=["/properties"],K="http://json-schema.org/draft-07/schema";var G=class extends U.default{_addVocabularies(){if(super._addVocabularies(),z.default.forEach((q)=>this.addVocabulary(q)),this.opts.discriminator)this.addKeyword(Q.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;let q=this.opts.$data?this.$dataMetaSchema(J,I):J;this.addMetaSchema(q,K,!1),this.refs["http://json-schema.org/schema"]=K}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(K)?K:void 0)}};$.Ajv=G,Y.exports=$=G,Y.exports.Ajv=G,Object.defineProperty($,"__esModule",{value:!0}),$.default=G;var H=yQ();Object.defineProperty($,"KeywordCxt",{enumerable:!0,get:function(){return H.KeywordCxt}});var W=L1();Object.defineProperty($,"_",{enumerable:!0,get:function(){return W._}}),Object.defineProperty($,"str",{enumerable:!0,get:function(){return W.str}}),Object.defineProperty($,"stringify",{enumerable:!0,get:function(){return W.stringify}}),Object.defineProperty($,"nil",{enumerable:!0,get:function(){return W.nil}}),Object.defineProperty($,"Name",{enumerable:!0,get:function(){return W.Name}}),Object.defineProperty($,"CodeGen",{enumerable:!0,get:function(){return W.CodeGen}});var X=LH();Object.defineProperty($,"ValidationError",{enumerable:!0,get:function(){return X.default}});var Z=kQ();Object.defineProperty($,"MissingRefError",{enumerable:!0,get:function(){return Z.default}})}),Je=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0}),$.dynamicAnchor=void 0;let Y=L1(),U=z5(),z=yw(),Q=KS(),J={keyword:"$dynamicAnchor",schemaType:"string",code:(G)=>I(G,G.schema)};function I(G,H){let{gen:W,it:X}=G;X.schemaEnv.root.dynamicAnchors[H]=!0;let Z=Y._`${U.default.dynamicAnchors}${(0,Y.getProperty)(H)}`,q=X.errSchemaPath==="#"?X.validateName:K(G);W.if(Y._`!${Z}`,()=>W.assign(Z,q))}$.dynamicAnchor=I;function K(G){let{schemaEnv:H,schema:W,self:X}=G.it,{root:Z,baseId:q,localRefs:V,meta:F}=H.root,{schemaId:M}=X.opts,w=new z.SchemaEnv({schema:W,schemaId:M,root:Z,baseId:q,localRefs:V,meta:F});return z.compileSchema.call(X,w),(0,Q.getValidate)(G,w)}$.default=J}),Ie=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0}),$.dynamicRef=void 0;let Y=L1(),U=z5(),z=KS(),Q={keyword:"$dynamicRef",schemaType:"string",code:(I)=>J(I,I.schema)};function J(I,K){let{gen:G,keyword:H,it:W}=I;if(K[0]!=="#")throw Error(`"${H}" only supports hash fragment reference`);let X=K.slice(1);if(W.allErrors)Z();else{let V=G.let("valid",!1);Z(V),I.ok(V)}function Z(V){if(W.schemaEnv.root.dynamicAnchors[X]){let F=G.let("_v",Y._`${U.default.dynamicAnchors}${(0,Y.getProperty)(X)}`);G.if(F,q(F,V),q(W.validateName,V))}else q(W.validateName,V)()}function q(V,F){return F?()=>G.block(()=>{(0,z.callRef)(I,V),G.let(F,!0)}):()=>(0,z.callRef)(I,V)}}$.dynamicRef=J,$.default=Q}),Nb0=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=Je(),U=v1(),z={keyword:"$recursiveAnchor",schemaType:"boolean",code(Q){if(Q.schema)(0,Y.dynamicAnchor)(Q,"");else(0,U.checkStrictMode)(Q.it,"$recursiveAnchor: false is ignored")}};$.default=z}),Db0=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=Ie(),U={keyword:"$recursiveRef",schemaType:"string",code:(z)=>(0,Y.dynamicRef)(z,z.schema)};$.default=U}),Ke=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=Je(),U=Ie(),z=Nb0(),Q=Db0(),J=[Y.default,U.default,z.default,Q.default];$.default=J}),Ab0=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=HS(),U={keyword:"dependentRequired",type:"object",schemaType:"object",error:Y.error,code:(z)=>(0,Y.validatePropertyDeps)(z)};$.default=U}),Bb0=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=HS(),U={keyword:"dependentSchemas",type:"object",schemaType:"object",code:(z)=>(0,Y.validateSchemaDeps)(z)};$.default=U}),Pb0=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=v1(),U={keyword:["maxContains","minContains"],type:"array",schemaType:"number",code({keyword:z,parentSchema:Q,it:J}){if(Q.contains===void 0)(0,Y.checkStrictMode)(J,`"${z}" without "contains" is ignored`)}};$.default=U}),Ge=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=Ab0(),U=Bb0(),z=Pb0(),Q=[Y.default,U.default,z.default];$.default=Q}),Tb0=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=L1(),U=v1(),z=z5(),Q={keyword:"unevaluatedProperties",type:"object",schemaType:["boolean","object"],trackErrors:!0,error:{message:"must NOT have unevaluated properties",params:({params:J})=>Y._`{unevaluatedProperty: ${J.unevaluatedProperty}}`},code(J){let{gen:I,schema:K,data:G,errsCount:H,it:W}=J;if(!H)throw Error("ajv implementation error");let{allErrors:X,props:Z}=W;if(Z instanceof Y.Name)I.if(Y._`${Z} !== true`,()=>I.forIn("key",G,(M)=>I.if(V(Z,M),()=>q(M))));else if(Z!==!0)I.forIn("key",G,(M)=>Z===void 0?q(M):I.if(F(Z,M),()=>q(M)));W.props=!0,J.ok(Y._`${H} === ${z.default.errors}`);function q(M){if(K===!1){if(J.setParams({unevaluatedProperty:M}),J.error(),!X)I.break();return}if(!(0,U.alwaysValidSchema)(W,K)){let w=I.name("valid");if(J.subschema({keyword:"unevaluatedProperties",dataProp:M,dataPropType:U.Type.Str},w),!X)I.if((0,Y.not)(w),()=>I.break())}}function V(M,w){return Y._`!${M} || !${M}[${w}]`}function F(M,w){let N=[];for(let O in M)if(M[O]===!0)N.push(Y._`${w} !== ${O}`);return(0,Y.and)(...N)}}};$.default=Q}),jb0=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=L1(),U=v1(),z={keyword:"unevaluatedItems",type:"array",schemaType:["boolean","object"],error:{message:({params:{len:Q}})=>Y.str`must NOT have more than ${Q} items`,params:({params:{len:Q}})=>Y._`{limit: ${Q}}`},code(Q){let{gen:J,schema:I,data:K,it:G}=Q,H=G.items||0;if(H===!0)return;let W=J.const("len",Y._`${K}.length`);if(I===!1)Q.setParams({len:H}),Q.fail(Y._`${W} > ${H}`);else if(typeof I=="object"&&!(0,U.alwaysValidSchema)(G,I)){let Z=J.var("valid",Y._`${W} <= ${H}`);J.if((0,Y.not)(Z),()=>X(Z,H)),Q.ok(Z)}G.items=!0;function X(Z,q){J.forRange("i",q,W,(V)=>{if(Q.subschema({keyword:"unevaluatedItems",dataProp:V,dataPropType:U.Type.Num},Z),!G.allErrors)J.if((0,Y.not)(Z),()=>J.break())})}}};$.default=z}),He=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=Tb0(),U=jb0(),z=[Y.default,U.default];$.default=z}),Eb0=R0(($,Y)=>{Y.exports={$schema:"https://json-schema.org/draft/2019-09/schema",$id:"https://json-schema.org/draft/2019-09/schema",$vocabulary:{"https://json-schema.org/draft/2019-09/vocab/core":!0,"https://json-schema.org/draft/2019-09/vocab/applicator":!0,"https://json-schema.org/draft/2019-09/vocab/validation":!0,"https://json-schema.org/draft/2019-09/vocab/meta-data":!0,"https://json-schema.org/draft/2019-09/vocab/format":!1,"https://json-schema.org/draft/2019-09/vocab/content":!0},$recursiveAnchor:!0,title:"Core and Validation specifications meta-schema",allOf:[{$ref:"meta/core"},{$ref:"meta/applicator"},{$ref:"meta/validation"},{$ref:"meta/meta-data"},{$ref:"meta/format"},{$ref:"meta/content"}],type:["object","boolean"],properties:{definitions:{$comment:"While no longer an official keyword as it is replaced by $defs, this keyword is retained in the meta-schema to prevent incompatible extensions as it remains in common use.",type:"object",additionalProperties:{$recursiveRef:"#"},default:{}},dependencies:{$comment:'"dependencies" is no longer a keyword, but schema authors should avoid redefining it to facilitate a smooth transition to "dependentSchemas" and "dependentRequired"',type:"object",additionalProperties:{anyOf:[{$recursiveRef:"#"},{$ref:"meta/validation#/$defs/stringArray"}]}}}}}),Cb0=R0(($,Y)=>{Y.exports={$schema:"https://json-schema.org/draft/2019-09/schema",$id:"https://json-schema.org/draft/2019-09/meta/applicator",$vocabulary:{"https://json-schema.org/draft/2019-09/vocab/applicator":!0},$recursiveAnchor:!0,title:"Applicator vocabulary meta-schema",type:["object","boolean"],properties:{additionalItems:{$recursiveRef:"#"},unevaluatedItems:{$recursiveRef:"#"},items:{anyOf:[{$recursiveRef:"#"},{$ref:"#/$defs/schemaArray"}]},contains:{$recursiveRef:"#"},additionalProperties:{$recursiveRef:"#"},unevaluatedProperties:{$recursiveRef:"#"},properties:{type:"object",additionalProperties:{$recursiveRef:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$recursiveRef:"#"},propertyNames:{format:"regex"},default:{}},dependentSchemas:{type:"object",additionalProperties:{$recursiveRef:"#"}},propertyNames:{$recursiveRef:"#"},if:{$recursiveRef:"#"},then:{$recursiveRef:"#"},else:{$recursiveRef:"#"},allOf:{$ref:"#/$defs/schemaArray"},anyOf:{$ref:"#/$defs/schemaArray"},oneOf:{$ref:"#/$defs/schemaArray"},not:{$recursiveRef:"#"}},$defs:{schemaArray:{type:"array",minItems:1,items:{$recursiveRef:"#"}}}}}),Rb0=R0(($,Y)=>{Y.exports={$schema:"https://json-schema.org/draft/2019-09/schema",$id:"https://json-schema.org/draft/2019-09/meta/content",$vocabulary:{"https://json-schema.org/draft/2019-09/vocab/content":!0},$recursiveAnchor:!0,title:"Content vocabulary meta-schema",type:["object","boolean"],properties:{contentMediaType:{type:"string"},contentEncoding:{type:"string"},contentSchema:{$recursiveRef:"#"}}}}),_b0=R0(($,Y)=>{Y.exports={$schema:"https://json-schema.org/draft/2019-09/schema",$id:"https://json-schema.org/draft/2019-09/meta/core",$vocabulary:{"https://json-schema.org/draft/2019-09/vocab/core":!0},$recursiveAnchor:!0,title:"Core vocabulary meta-schema",type:["object","boolean"],properties:{$id:{type:"string",format:"uri-reference",$comment:"Non-empty fragments not allowed.",pattern:"^[^#]*#?$"},$schema:{type:"string",format:"uri"},$anchor:{type:"string",pattern:"^[A-Za-z][-A-Za-z0-9.:_]*$"},$ref:{type:"string",format:"uri-reference"},$recursiveRef:{type:"string",format:"uri-reference"},$recursiveAnchor:{type:"boolean",default:!1},$vocabulary:{type:"object",propertyNames:{type:"string",format:"uri"},additionalProperties:{type:"boolean"}},$comment:{type:"string"},$defs:{type:"object",additionalProperties:{$recursiveRef:"#"},default:{}}}}}),vb0=R0(($,Y)=>{Y.exports={$schema:"https://json-schema.org/draft/2019-09/schema",$id:"https://json-schema.org/draft/2019-09/meta/format",$vocabulary:{"https://json-schema.org/draft/2019-09/vocab/format":!0},$recursiveAnchor:!0,title:"Format vocabulary meta-schema",type:["object","boolean"],properties:{format:{type:"string"}}}}),hb0=R0(($,Y)=>{Y.exports={$schema:"https://json-schema.org/draft/2019-09/schema",$id:"https://json-schema.org/draft/2019-09/meta/meta-data",$vocabulary:{"https://json-schema.org/draft/2019-09/vocab/meta-data":!0},$recursiveAnchor:!0,title:"Meta-data vocabulary meta-schema",type:["object","boolean"],properties:{title:{type:"string"},description:{type:"string"},default:!0,deprecated:{type:"boolean",default:!1},readOnly:{type:"boolean",default:!1},writeOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0}}}}),Sb0=R0(($,Y)=>{Y.exports={$schema:"https://json-schema.org/draft/2019-09/schema",$id:"https://json-schema.org/draft/2019-09/meta/validation",$vocabulary:{"https://json-schema.org/draft/2019-09/vocab/validation":!0},$recursiveAnchor:!0,title:"Validation vocabulary meta-schema",type:["object","boolean"],properties:{multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/$defs/nonNegativeInteger"},minLength:{$ref:"#/$defs/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},maxItems:{$ref:"#/$defs/nonNegativeInteger"},minItems:{$ref:"#/$defs/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},maxContains:{$ref:"#/$defs/nonNegativeInteger"},minContains:{$ref:"#/$defs/nonNegativeInteger",default:1},maxProperties:{$ref:"#/$defs/nonNegativeInteger"},minProperties:{$ref:"#/$defs/nonNegativeIntegerDefault0"},required:{$ref:"#/$defs/stringArray"},dependentRequired:{type:"object",additionalProperties:{$ref:"#/$defs/stringArray"}},const:!0,enum:{type:"array",items:!0},type:{anyOf:[{$ref:"#/$defs/simpleTypes"},{type:"array",items:{$ref:"#/$defs/simpleTypes"},minItems:1,uniqueItems:!0}]}},$defs:{nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{$ref:"#/$defs/nonNegativeInteger",default:0},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}}}}),gb0=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=Eb0(),U=Cb0(),z=Rb0(),Q=_b0(),J=vb0(),I=hb0(),K=Sb0(),G=["/properties"];function H(W){return[Y,U,z,Q,X(this,J),I,X(this,K)].forEach((Z)=>this.addMetaSchema(Z,void 0,!1)),this;function X(Z,q){return W?Z.$dataMetaSchema(q,G):q}}$.default=H}),yb0=R0(($,Y)=>{Object.defineProperty($,"__esModule",{value:!0}),$.MissingRefError=$.ValidationError=$.CodeGen=$.Name=$.nil=$.stringify=$.str=$._=$.KeywordCxt=$.Ajv2019=void 0;let U=IS(),z=ze(),Q=Ke(),J=Ge(),I=He(),K=WS(),G=gb0(),H="https://json-schema.org/draft/2019-09/schema";var W=class extends U.default{constructor(F={}){super({...F,dynamicRef:!0,next:!0,unevaluated:!0})}_addVocabularies(){if(super._addVocabularies(),this.addVocabulary(Q.default),z.default.forEach((F)=>this.addVocabulary(F)),this.addVocabulary(J.default),this.addVocabulary(I.default),this.opts.discriminator)this.addKeyword(K.default)}_addDefaultMetaSchema(){super._addDefaultMetaSchema();let{$data:F,meta:M}=this.opts;if(!M)return;G.default.call(this,F),this.refs["http://json-schema.org/schema"]=H}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(H)?H:void 0)}};$.Ajv2019=W,Y.exports=$=W,Y.exports.Ajv2019=W,Object.defineProperty($,"__esModule",{value:!0}),$.default=W;var X=yQ();Object.defineProperty($,"KeywordCxt",{enumerable:!0,get:function(){return X.KeywordCxt}});var Z=L1();Object.defineProperty($,"_",{enumerable:!0,get:function(){return Z._}}),Object.defineProperty($,"str",{enumerable:!0,get:function(){return Z.str}}),Object.defineProperty($,"stringify",{enumerable:!0,get:function(){return Z.stringify}}),Object.defineProperty($,"nil",{enumerable:!0,get:function(){return Z.nil}}),Object.defineProperty($,"Name",{enumerable:!0,get:function(){return Z.Name}}),Object.defineProperty($,"CodeGen",{enumerable:!0,get:function(){return Z.CodeGen}});var q=LH();Object.defineProperty($,"ValidationError",{enumerable:!0,get:function(){return q.default}});var V=kQ();Object.defineProperty($,"MissingRefError",{enumerable:!0,get:function(){return V.default}})}),kb0=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=rt(),U=st(),z=$e(),Q=Ke(),J=Ge(),I=He(),K=Ye(),G=Ue(),H=[Q.default,Y.default,U.default,(0,z.default)(!0),K.default,G.metadataVocabulary,G.contentVocabulary,J.default,I.default];$.default=H}),xb0=R0(($,Y)=>{Y.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/schema",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/core":!0,"https://json-schema.org/draft/2020-12/vocab/applicator":!0,"https://json-schema.org/draft/2020-12/vocab/unevaluated":!0,"https://json-schema.org/draft/2020-12/vocab/validation":!0,"https://json-schema.org/draft/2020-12/vocab/meta-data":!0,"https://json-schema.org/draft/2020-12/vocab/format-annotation":!0,"https://json-schema.org/draft/2020-12/vocab/content":!0},$dynamicAnchor:"meta",title:"Core and Validation specifications meta-schema",allOf:[{$ref:"meta/core"},{$ref:"meta/applicator"},{$ref:"meta/unevaluated"},{$ref:"meta/validation"},{$ref:"meta/meta-data"},{$ref:"meta/format-annotation"},{$ref:"meta/content"}],type:["object","boolean"],$comment:"This meta-schema also defines keywords that have appeared in previous drafts in order to prevent incompatible extensions as they remain in common use.",properties:{definitions:{$comment:'"definitions" has been replaced by "$defs".',type:"object",additionalProperties:{$dynamicRef:"#meta"},deprecated:!0,default:{}},dependencies:{$comment:'"dependencies" has been split and replaced by "dependentSchemas" and "dependentRequired" in order to serve their differing semantics.',type:"object",additionalProperties:{anyOf:[{$dynamicRef:"#meta"},{$ref:"meta/validation#/$defs/stringArray"}]},deprecated:!0,default:{}},$recursiveAnchor:{$comment:'"$recursiveAnchor" has been replaced by "$dynamicAnchor".',$ref:"meta/core#/$defs/anchorString",deprecated:!0},$recursiveRef:{$comment:'"$recursiveRef" has been replaced by "$dynamicRef".',$ref:"meta/core#/$defs/uriReferenceString",deprecated:!0}}}}),fb0=R0(($,Y)=>{Y.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/applicator",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/applicator":!0},$dynamicAnchor:"meta",title:"Applicator vocabulary meta-schema",type:["object","boolean"],properties:{prefixItems:{$ref:"#/$defs/schemaArray"},items:{$dynamicRef:"#meta"},contains:{$dynamicRef:"#meta"},additionalProperties:{$dynamicRef:"#meta"},properties:{type:"object",additionalProperties:{$dynamicRef:"#meta"},default:{}},patternProperties:{type:"object",additionalProperties:{$dynamicRef:"#meta"},propertyNames:{format:"regex"},default:{}},dependentSchemas:{type:"object",additionalProperties:{$dynamicRef:"#meta"},default:{}},propertyNames:{$dynamicRef:"#meta"},if:{$dynamicRef:"#meta"},then:{$dynamicRef:"#meta"},else:{$dynamicRef:"#meta"},allOf:{$ref:"#/$defs/schemaArray"},anyOf:{$ref:"#/$defs/schemaArray"},oneOf:{$ref:"#/$defs/schemaArray"},not:{$dynamicRef:"#meta"}},$defs:{schemaArray:{type:"array",minItems:1,items:{$dynamicRef:"#meta"}}}}}),ub0=R0(($,Y)=>{Y.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/unevaluated",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/unevaluated":!0},$dynamicAnchor:"meta",title:"Unevaluated applicator vocabulary meta-schema",type:["object","boolean"],properties:{unevaluatedItems:{$dynamicRef:"#meta"},unevaluatedProperties:{$dynamicRef:"#meta"}}}}),bb0=R0(($,Y)=>{Y.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/content",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/content":!0},$dynamicAnchor:"meta",title:"Content vocabulary meta-schema",type:["object","boolean"],properties:{contentEncoding:{type:"string"},contentMediaType:{type:"string"},contentSchema:{$dynamicRef:"#meta"}}}}),ib0=R0(($,Y)=>{Y.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/core",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/core":!0},$dynamicAnchor:"meta",title:"Core vocabulary meta-schema",type:["object","boolean"],properties:{$id:{$ref:"#/$defs/uriReferenceString",$comment:"Non-empty fragments not allowed.",pattern:"^[^#]*#?$"},$schema:{$ref:"#/$defs/uriString"},$ref:{$ref:"#/$defs/uriReferenceString"},$anchor:{$ref:"#/$defs/anchorString"},$dynamicRef:{$ref:"#/$defs/uriReferenceString"},$dynamicAnchor:{$ref:"#/$defs/anchorString"},$vocabulary:{type:"object",propertyNames:{$ref:"#/$defs/uriString"},additionalProperties:{type:"boolean"}},$comment:{type:"string"},$defs:{type:"object",additionalProperties:{$dynamicRef:"#meta"}}},$defs:{anchorString:{type:"string",pattern:"^[A-Za-z_][-A-Za-z0-9._]*$"},uriString:{type:"string",format:"uri"},uriReferenceString:{type:"string",format:"uri-reference"}}}}),cb0=R0(($,Y)=>{Y.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/format-annotation",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/format-annotation":!0},$dynamicAnchor:"meta",title:"Format vocabulary meta-schema for annotation results",type:["object","boolean"],properties:{format:{type:"string"}}}}),nb0=R0(($,Y)=>{Y.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/meta-data",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/meta-data":!0},$dynamicAnchor:"meta",title:"Meta-data vocabulary meta-schema",type:["object","boolean"],properties:{title:{type:"string"},description:{type:"string"},default:!0,deprecated:{type:"boolean",default:!1},readOnly:{type:"boolean",default:!1},writeOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0}}}}),pb0=R0(($,Y)=>{Y.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/validation",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/validation":!0},$dynamicAnchor:"meta",title:"Validation vocabulary meta-schema",type:["object","boolean"],properties:{type:{anyOf:[{$ref:"#/$defs/simpleTypes"},{type:"array",items:{$ref:"#/$defs/simpleTypes"},minItems:1,uniqueItems:!0}]},const:!0,enum:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/$defs/nonNegativeInteger"},minLength:{$ref:"#/$defs/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},maxItems:{$ref:"#/$defs/nonNegativeInteger"},minItems:{$ref:"#/$defs/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},maxContains:{$ref:"#/$defs/nonNegativeInteger"},minContains:{$ref:"#/$defs/nonNegativeInteger",default:1},maxProperties:{$ref:"#/$defs/nonNegativeInteger"},minProperties:{$ref:"#/$defs/nonNegativeIntegerDefault0"},required:{$ref:"#/$defs/stringArray"},dependentRequired:{type:"object",additionalProperties:{$ref:"#/$defs/stringArray"}}},$defs:{nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{$ref:"#/$defs/nonNegativeInteger",default:0},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}}}}),db0=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=xb0(),U=fb0(),z=ub0(),Q=bb0(),J=ib0(),I=cb0(),K=nb0(),G=pb0(),H=["/properties"];function W(X){return[Y,U,z,Q,J,Z(this,I),K,Z(this,G)].forEach((q)=>this.addMetaSchema(q,void 0,!1)),this;function Z(q,V){return X?q.$dataMetaSchema(V,H):V}}$.default=W}),mb0=R0(($,Y)=>{Object.defineProperty($,"__esModule",{value:!0}),$.MissingRefError=$.ValidationError=$.CodeGen=$.Name=$.nil=$.stringify=$.str=$._=$.KeywordCxt=$.Ajv2020=void 0;let U=IS(),z=kb0(),Q=WS(),J=db0(),I="https://json-schema.org/draft/2020-12/schema";var K=class extends U.default{constructor(Z={}){super({...Z,dynamicRef:!0,next:!0,unevaluated:!0})}_addVocabularies(){if(super._addVocabularies(),z.default.forEach((Z)=>this.addVocabulary(Z)),this.opts.discriminator)this.addKeyword(Q.default)}_addDefaultMetaSchema(){super._addDefaultMetaSchema();let{$data:Z,meta:q}=this.opts;if(!q)return;J.default.call(this,Z),this.refs["http://json-schema.org/schema"]=I}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(I)?I:void 0)}};$.Ajv2020=K,Y.exports=$=K,Y.exports.Ajv2020=K,Object.defineProperty($,"__esModule",{value:!0}),$.default=K;var G=yQ();Object.defineProperty($,"KeywordCxt",{enumerable:!0,get:function(){return G.KeywordCxt}});var H=L1();Object.defineProperty($,"_",{enumerable:!0,get:function(){return H._}}),Object.defineProperty($,"str",{enumerable:!0,get:function(){return H.str}}),Object.defineProperty($,"stringify",{enumerable:!0,get:function(){return H.stringify}}),Object.defineProperty($,"nil",{enumerable:!0,get:function(){return H.nil}}),Object.defineProperty($,"Name",{enumerable:!0,get:function(){return H.Name}}),Object.defineProperty($,"CodeGen",{enumerable:!0,get:function(){return H.CodeGen}});var W=LH();Object.defineProperty($,"ValidationError",{enumerable:!0,get:function(){return W.default}});var X=kQ();Object.defineProperty($,"MissingRefError",{enumerable:!0,get:function(){return X.default}})}),lb0=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0}),$.formatNames=$.fastFormats=$.fullFormats=void 0;function Y(x,S){return{validate:x,compare:S}}$.fullFormats={date:Y(J,I),time:Y(G(!0),H),"date-time":Y(Z(!0),q),"iso-time":Y(G(),W),"iso-date-time":Y(Z(),V),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:w,"uri-reference":/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,"uri-template":/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,url:/^(?:https?|ftp):\/\/(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)(?:\.(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu,email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)$/,ipv6:/^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i,regex:b,uuid:/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,"json-pointer":/^(?:\/(?:[^~/]|~0|~1)*)*$/,"json-pointer-uri-fragment":/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,"relative-json-pointer":/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,byte:O,int32:{type:"number",validate:T},int64:{type:"number",validate:A},float:{type:"number",validate:j},double:{type:"number",validate:j},password:!0,binary:!0},$.fastFormats={...$.fullFormats,date:Y(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,I),time:Y(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,H),"date-time":Y(/^\d\d\d\d-[0-1]\d-[0-3]\dt(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,q),"iso-time":Y(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,W),"iso-date-time":Y(/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,V),uri:/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i},$.formatNames=Object.keys($.fullFormats);function U(x){return x%4===0&&(x%100!==0||x%400===0)}let z=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,Q=[0,31,28,31,30,31,30,31,31,30,31,30,31];function J(x){let S=z.exec(x);if(!S)return!1;let i=+S[1],c=+S[2],z0=+S[3];return c>=1&&c<=12&&z0>=1&&z0<=(c===2&&U(i)?29:Q[c])}function I(x,S){if(!(x&&S))return;if(x>S)return 1;if(x23||p>59||x&&!t)return!1;if(z0<=23&&k<=59&&d<60)return!0;let e=k-p*$0,y=z0-g*$0-(e<0?1:0);return(y===23||y===-1)&&(e===59||e===-1)&&d<61}}function H(x,S){if(!(x&&S))return;let i=new Date("2020-01-01T"+x).valueOf(),c=new Date("2020-01-01T"+S).valueOf();if(!(i&&c))return;return i-c}function W(x,S){if(!(x&&S))return;let i=K.exec(x),c=K.exec(S);if(!(i&&c))return;if(x=i[1]+i[2]+i[3],S=c[1]+c[2]+c[3],x>S)return 1;if(x=D}function A(x){return Number.isInteger(x)}function j(){return!0}let C=/[^\\]\\Z/;function b(x){if(C.test(x))return!1;try{return new RegExp(x),!0}catch(S){return!1}}}),ob0=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0}),$.formatLimitDefinition=void 0;let Y=Qe(),U=L1(),z=U.operators,Q={formatMaximum:{okStr:"<=",ok:z.LTE,fail:z.GT},formatMinimum:{okStr:">=",ok:z.GTE,fail:z.LT},formatExclusiveMaximum:{okStr:"<",ok:z.LT,fail:z.GTE},formatExclusiveMinimum:{okStr:">",ok:z.GT,fail:z.LTE}},J={message:({keyword:K,schemaCode:G})=>U.str`should be ${Q[K].okStr} ${G}`,params:({keyword:K,schemaCode:G})=>U._`{comparison: ${Q[K].okStr}, limit: ${G}}`};$.formatLimitDefinition={keyword:Object.keys(Q),type:"string",schemaType:"string",$data:!0,error:J,code(K){let{gen:G,data:H,schemaCode:W,keyword:X,it:Z}=K,{opts:q,self:V}=Z;if(!q.validateFormats)return;let F=new Y.KeywordCxt(Z,V.RULES.all.format.definition,"format");if(F.$data)M();else w();function M(){let O=G.scopeValue("formats",{ref:V.formats,code:q.code.formats}),D=G.const("fmt",U._`${O}[${F.schemaCode}]`);K.fail$data((0,U.or)(U._`typeof ${D} != "object"`,U._`${D} instanceof RegExp`,U._`typeof ${D}.compare != "function"`,N(D)))}function w(){let O=F.schema,D=V.formats[O];if(!D||D===!0)return;if(typeof D!="object"||D instanceof RegExp||typeof D.compare!="function")throw Error(`"${X}": format "${O}" does not define "compare" function`);let P=G.scopeValue("formats",{key:O,ref:D,code:q.code.formats?U._`${q.code.formats}${(0,U.getProperty)(O)}`:void 0});K.fail$data(N(P))}function N(O){return U._`${O}.compare(${H}, ${W}) ${Q[X].fail} 0`}},dependencies:["format"]};let I=(K)=>{return K.addKeyword($.formatLimitDefinition),K};$.default=I}),rb0=R0(($,Y)=>{Object.defineProperty($,"__esModule",{value:!0});let U=lb0(),z=ob0(),Q=L1(),J=new Q.Name("fullFormats"),I=new Q.Name("fastFormats"),K=(H,W={keywords:!0})=>{if(Array.isArray(W))return G(H,W,U.fullFormats,J),H;let[X,Z]=W.mode==="fast"?[U.fastFormats,I]:[U.fullFormats,J];if(G(H,W.formats||U.formatNames,X,Z),W.keywords)(0,z.default)(H);return H};K.get=(H,W="full")=>{let X=(W==="fast"?U.fastFormats:U.fullFormats)[H];if(!X)throw Error(`Unknown format "${H}"`);return X};function G(H,W,X,Z){var q,V;(q=(V=H.opts.code).formats)!==null&&q!==void 0||(V.formats=Q._`require("ajv-formats/dist/formats").${Z}`);for(let F of W)H.addFormat(F,X[F])}Y.exports=$=K,Object.defineProperty($,"__esModule",{value:!0}),$.default=K}),We=Qe(),sb0=yb0(),ab0=mb0(),tb0=nq(rb0(),1),eb0=tb0.default;Mu1=We.Ajv});import XS from"node:process";var xw=m(()=>{Xe()});function qS($){return!!$&&typeof $==="object"&&Ne in $}function Yi0($){return $[Ne]?.complete}function Ui0($,Y){switch(Y.kind){case"tools_list_changed":return $.toolsListChanged===!0;case"prompts_list_changed":return $.promptsListChanged===!0;case"resources_list_changed":return $.resourcesListChanged===!0;case"resource_updated":return $.resourceSubscriptions!==void 0&&$.resourceSubscriptions.includes(Y.uri)}}function zi0($,Y){let U={},z=(Q)=>Y===void 0||Q===!0;if($.toolsListChanged===!0&&z(Y?.tools?.listChanged))U.toolsListChanged=!0;if($.promptsListChanged===!0&&z(Y?.prompts?.listChanged))U.promptsListChanged=!0;if($.resourcesListChanged===!0&&z(Y?.resources?.listChanged))U.resourcesListChanged=!0;if($.resourceSubscriptions!==void 0&&$.resourceSubscriptions.length>0&&z(Y?.resources?.subscribe))U.resourceSubscriptions=[...$.resourceSubscriptions];return U}function Ze($,Y){return{method:$.method,params:{...$.params,_meta:{...$.params?._meta,[yY]:Y}}}}function Qi0($){let Y=j7(qH).validateRequest("subscriptions/listen",$);return Y.ok?Y.value.params?.notifications:void 0}function Ii0($,Y){switch($){case"notifications/tools/list_changed":return{kind:"tools_list_changed"};case"notifications/prompts/list_changed":return{kind:"prompts_list_changed"};case"notifications/resources/list_changed":return{kind:"resources_list_changed"};default:return{kind:"resource_updated",uri:Y??""}}}function Hi0($){if($?.maxRounds!==void 0&&(!Number.isInteger($.maxRounds)||$.maxRounds<1))throw RangeError(`inputRequired.maxRounds must be a positive integer (got ${$.maxRounds})`);if($?.roundTimeoutMs!==void 0&&(!Number.isFinite($.roundTimeoutMs)||$.roundTimeoutMs<=0))throw RangeError(`inputRequired.roundTimeoutMs must be a positive number (got ${$.roundTimeoutMs})`);return{maxRounds:$?.maxRounds??Ki0,roundTimeoutMs:$?.roundTimeoutMs??Gi0,legacyShim:$?.legacyShim??!0}}function Ae($,Y,U){if(U===null||typeof U!=="object"||typeof U.method!=="string")throw new J1(n0.InternalError,`Handler for ${$} returned an invalid input request '${Y}': each inputRequests entry must be an embedded elicitation/create, sampling/createMessage, or roots/list request`);let z=U,Q=qt(z);if(Q===void 0)throw new J1(n0.InternalError,`Handler for ${$} returned an input request '${Y}' of kind '${z.method}', which is not an embedded request the 2026-07-28 revision defines`);return{embedded:z,required:Q}}function Wi0(){let $=globalThis.crypto;if($?.randomUUID!==void 0)return $.randomUUID();let Y=new Uint8Array(16);$.getRandomValues(Y),Y[6]=Y[6]&15|64,Y[8]=Y[8]&63|128;let U=[...Y].map((z)=>z.toString(16).padStart(2,"0")).join("");return`${U.slice(0,8)}-${U.slice(8,12)}-${U.slice(12,16)}-${U.slice(16,20)}-${U.slice(20)}`}function ZS($,Y){if($==="tools/call")return{content:[{type:"text",text:Y}],isError:!0};throw new J1(n0.InternalError,Y)}function VS($,Y){Be($,Y)}function LS($){return Pe($)}function Vi0($){return{...$}}function qe($,Y){if($){let z=Y;return async(Q,J)=>z(Q,J)}let U=Y;return async(z,Q)=>U(Q)}function Le($){if($===void 0)return;try{return R7($,"output")}catch{return}}function Fe($,Y,U){if(Y){let z=U;return async(Q,J)=>{let I=await fY(Y,Q);if(!I.success)throw new J1(n0.InvalidParams,`Invalid arguments for prompt ${$}: ${I.error}`);return z(I.data,J)}}else{let z=U;return async(Q,J)=>{return z(J)}}}function we($){return{completion:{values:$.map(String).slice(0,100),total:$.length,hasMore:$.length>100}}}function Me($){let Y=$;if(Y.shape&&typeof Y.shape==="object")return Y.shape}function Li0($){return $?.type==="optional"}function Oe($){if(!Li0($))return $;return $.def?.innerType??$}var Ne,fw=1024,Ji0,De=class{_subs=new Map;_serverCapabilities;_serverInfo;constructor($=fw,Y,U){this._maxSubscriptions=$,this._serverCapabilities=Y,this._serverInfo=U}setServerCapabilities($,Y){if(this._serverCapabilities=$,Y!==void 0)this._serverInfo=Y}has($){return this._subs.has($)}serve($){if(this._serverCapabilities===void 0)throw Error("StdioListenRouter.serve() called before setServerCapabilities(); refusing to honor a filter without capabilities");if(this._subs.size>=this._maxSubscriptions)return{jsonrpc:"2.0",id:$.id,error:{code:-32603,message:"Subscription limit reached"}};let Y=Qi0($);if(Y===void 0)return{jsonrpc:"2.0",id:$.id,error:{code:-32602,message:"Invalid params: 'notifications' is required and must be a valid SubscriptionFilter"}};let U=zi0(Y,this._serverCapabilities);return this._subs.set($.id,U),Ze({method:"notifications/subscriptions/acknowledged",params:{notifications:U}},$.id)}cancel($){return this._subs.delete($)}routeOutbound($){if(!Ji0.has($.method))return"passthrough";let Y=$.params?.uri,U=typeof Y==="string"?Y:void 0,z=Ii0($.method,U),Q=[];for(let[J,I]of this._subs)if(Ui0(I,z))Q.push(Ze({method:$.method,params:$.params??{}},J));return Q}teardownAll(){let $=[];for(let Y of this._subs.keys())$.push({jsonrpc:"2.0",id:Y,result:{resultType:"complete",_meta:{[yY]:Y,...this._serverInfo!==void 0&&{[d5]:this._serverInfo}}}});return this._subs.clear(),$}},Ki0=8,Gi0=600000,Xi0=class{constructor($){this._host=$}async fulfill($,Y,U,z,Q){let{maxRounds:J,roundTimeoutMs:I}=this._host,K=z.mcpReq.signal,G=Q,H=0;while(!0){if(H+=1,H>J)return ZS($,gt($,J));let W=G.inputRequests,X=W!=null&&Object.keys(W).length>0,Z=typeof G.requestState==="string"?G.requestState:void 0;if(!X&&Z===void 0)throw new J1(n0.InternalError,`Handler for ${$} returned an input-required result with neither inputRequests nor requestState (every InputRequiredResult must include at least one of the two)`);let q;if(X){let M=this._host.resolvedClientCapabilities(z),w=[];for(let[O,D]of Object.entries(W)){let{embedded:P,required:T}=Ae($,O,D);if(P.method!=="roots/list"&&P.params===void 0)throw new J1(n0.InternalError,`Handler for ${$} returned an input request '${O}' of kind '${P.method}' without params`);if(Nw(T,M)!==void 0)return ZS($,`Cannot request input '${O}' (${P.method}): the client on this 2025-era connection did not declare the required capability${M===void 0?" (no client capabilities are available on this connection — per-request legacy serving cannot receive server-to-client requests)":""}`);w.push([O,P])}let N=kt(K);try{let O={relatedRequestId:z.mcpReq.id,timeout:I,resetTimeoutOnProgress:!0,onprogress:()=>{},signal:N.signal},D=await Promise.all(w.map(async([P,T])=>{try{return[P,await this._dispatchLeg(T,O)]}catch(A){throw N.abort(A),A}}));q=Object.fromEntries(D)}catch(O){if(K.aborted)throw O;return ZS($,`Fulfilling input required by '${$}' failed: ${O instanceof Error?O.message:String(O)}`)}finally{N.dispose()}}else await yt(St,K);let V={...z,mcpReq:{...z.mcpReq,inputResponses:q,droppedInputResponseKeys:void 0,requestState:VH(Z)}};if(Z!==void 0){let M=await this._host.verifyRequestState(Z,V,$);if(M!==void 0)V=th(V,M)}let F=await Y(U,V);if(!s9(F))return F;G=F}}async _dispatchLeg($,Y){switch($.method){case"elicitation/create":{let U=$.params;if(U.mode==="url"&&U.elicitationId===void 0)U={...U,elicitationId:Wi0()};return await this._host.sendElicitation(U,Y)}case"sampling/createMessage":return await this._host.sendSampling($.params,Y);case"roots/list":return await this._host.listRoots($.params,Y)}}},Zi0,qi0,Be,Pe,Te,wH=class{server;_registeredResources={};_registeredResourceTemplates={};_registeredTools={};_registeredPrompts={};_toolInputSchemaJson={};toolInputSchemaJson($){let Y=this._registeredTools[$];if(Y===void 0||!Y.enabled)return;if(Object.hasOwn(this._toolInputSchemaJson,$))return this._toolInputSchemaJson[$];if(Y.inputSchema===void 0)return Ve;try{let U=R7(Y.inputSchema,"input");return this._toolInputSchemaJson[$]=U,U}catch{return}}constructor($,Y){if(this.server=new Te($,Y),Y?.capabilities?.tools)this.setToolRequestHandlers();if(Y?.capabilities?.resources)this.setResourceRequestHandlers();if(Y?.capabilities?.prompts)this.setPromptRequestHandlers()}async connect($){return await this.server.connect($)}async close(){await this.server.close()}_toolHandlersInitialized=!1;setToolRequestHandlers(){if(this._toolHandlersInitialized)return;this.server.assertCanSetRequestHandler("tools/list"),this.server.assertCanSetRequestHandler("tools/call"),this.server.registerCapabilities({tools:{listChanged:this.server.getCapabilities().tools?.listChanged??!0}}),this.server.setRequestHandler("tools/list",()=>({tools:Object.entries(this._registeredTools).filter(([,$])=>$.enabled).map(([$,Y])=>{let U={name:$,title:Y.title,description:Y.description,inputSchema:Y.inputSchema?R7(Y.inputSchema,"input"):Ve,annotations:Y.annotations,icons:Y.icons,execution:Y.execution,_meta:Y._meta};if(Y.outputSchema)U.outputSchema=R7(Y.outputSchema,"output");return U})})),this.server.setRequestHandler("tools/call",async($,Y)=>{let U=this._registeredTools[$.params.name];if(!U)throw new J1(n0.InvalidParams,`Tool ${$.params.name} not found`);if(!U.enabled)throw new J1(n0.InvalidParams,`Tool ${$.params.name} disabled`);try{let z=await this.validateToolInput(U,$.params.arguments,$.params.name),Q=await this.executeToolHandler(U,z,Y);if(await this.validateToolOutput(U,Q,$.params.name),s9(Q))return Q;return this.server.projectCallToolResult(Q,U.outputSchemaJson)}catch(z){if(z instanceof J1&&z.code===n0.UrlElicitationRequired)throw z;return this.createToolError(z instanceof Error?z.message:String(z))}}),this._toolHandlersInitialized=!0}createToolError($){return{content:[{type:"text",text:$}],isError:!0}}async validateToolInput($,Y,U){if(!$.inputSchema)return;let z=await fY($.inputSchema,Y??{});if(!z.success)throw new J1(n0.InvalidParams,`Input validation error: Invalid arguments for tool ${U}: ${z.error}`);return z.data}async validateToolOutput($,Y,U){if(!$.outputSchema)return;if(s9(Y))return;if(Y.isError)return;if(Y.structuredContent===void 0)throw new J1(n0.InvalidParams,`Output validation error: Tool ${U} has an output schema but no structured content was provided`);let z=await fY($.outputSchema,Y.structuredContent);if(!z.success)throw new J1(n0.InvalidParams,`Output validation error: Invalid structured content for tool ${U}: ${z.error}`)}async executeToolHandler($,Y,U){return $.executor(Y,U)}_completionHandlerInitialized=!1;setCompletionRequestHandler(){if(this._completionHandlerInitialized)return;this.server.assertCanSetRequestHandler("completion/complete"),this.server.registerCapabilities({completions:{}}),this.server.setRequestHandler("completion/complete",async($)=>{switch($.params.ref.type){case"ref/prompt":return mh($),this.handlePromptCompletion($,$.params.ref);case"ref/resource":return lh($),this.handleResourceCompletion($,$.params.ref);default:throw new J1(n0.InvalidParams,`Invalid completion reference: ${$.params.ref}`)}}),this._completionHandlerInitialized=!0}async handlePromptCompletion($,Y){let U=this._registeredPrompts[Y.name];if(!U)throw new J1(n0.InvalidParams,`Prompt ${Y.name} not found`);if(!U.enabled)throw new J1(n0.InvalidParams,`Prompt ${Y.name} disabled`);if(!U.argsSchema)return FH;let z=Oe(Me(U.argsSchema)?.[$.params.argument.name]);if(!qS(z))return FH;let Q=Yi0(z);if(!Q)return FH;return we(await Q($.params.argument.value,$.params.context))}async handleResourceCompletion($,Y){let U=Object.values(this._registeredResourceTemplates).find((Q)=>Q.resourceTemplate.uriTemplate.toString()===Y.uri);if(!U){if(this._registeredResources[Y.uri])return FH;throw new J1(n0.InvalidParams,`Resource template ${$.params.ref.uri} not found`)}let z=U.resourceTemplate.completeCallback($.params.argument.name);if(!z)return FH;return we(await z($.params.argument.value,$.params.context))}_resourceHandlersInitialized=!1;setResourceRequestHandlers(){if(this._resourceHandlersInitialized)return;this.server.assertCanSetRequestHandler("resources/list"),this.server.assertCanSetRequestHandler("resources/templates/list"),this.server.assertCanSetRequestHandler("resources/read"),this.server.registerCapabilities({resources:{listChanged:this.server.getCapabilities().resources?.listChanged??!0}}),this.server.setRequestHandler("resources/list",async($,Y)=>{let U=Object.entries(this._registeredResources).filter(([Q,J])=>J.enabled).map(([Q,J])=>({uri:Q,name:J.name,...J.metadata})),z=[];for(let Q of Object.values(this._registeredResourceTemplates)){if(!Q.resourceTemplate.listCallback)continue;let J=await Q.resourceTemplate.listCallback(Y);for(let I of J.resources)z.push({...Q.metadata,...I})}return{resources:[...U,...z]}}),this.server.setRequestHandler("resources/templates/list",async()=>{return{resourceTemplates:Object.entries(this._registeredResourceTemplates).map(([$,Y])=>({name:$,uriTemplate:Y.resourceTemplate.uriTemplate.toString(),...Y.metadata}))}}),this.server.setRequestHandler("resources/read",async($,Y)=>{let U;try{U=new URL($.params.uri)}catch{throw new J1(n0.InvalidParams,`Resource URI ${$.params.uri} is invalid`,{uri:$.params.uri,reason:"invalid_uri"})}let z=this._registeredResources[U.toString()];if(z){if(!z.enabled)throw new J1(n0.InvalidParams,`Resource ${U} disabled`);return Dw(await z.readCallback(U,Y),z.cacheHint)}for(let Q of Object.values(this._registeredResourceTemplates)){let J=Q.resourceTemplate.uriTemplate.match(U.toString());if(J)return Dw(await Q.readCallback(U,J,Y),Q.cacheHint)}throw new Aw($.params.uri)}),this._resourceHandlersInitialized=!0}_promptHandlersInitialized=!1;setPromptRequestHandlers(){if(this._promptHandlersInitialized)return;this.server.assertCanSetRequestHandler("prompts/list"),this.server.assertCanSetRequestHandler("prompts/get"),this.server.registerCapabilities({prompts:{listChanged:this.server.getCapabilities().prompts?.listChanged??!0}}),this.server.setRequestHandler("prompts/list",()=>({prompts:Object.entries(this._registeredPrompts).filter(([,$])=>$.enabled).map(([$,Y])=>{return{name:$,title:Y.title,description:Y.description,arguments:Y.argsSchema?ht(Y.argsSchema):void 0,icons:Y.icons,_meta:Y._meta}})})),this.server.setRequestHandler("prompts/get",async($,Y)=>{let U=this._registeredPrompts[$.params.name];if(!U)throw new J1(n0.InvalidParams,`Prompt ${$.params.name} not found`);if(!U.enabled)throw new J1(n0.InvalidParams,`Prompt ${$.params.name} disabled`);return U.handler($.params.arguments,Y)}),this._promptHandlersInitialized=!0}registerResource($,Y,U,z){let Q=U.cacheHint,J=U;if(Q!==void 0){nh(Q,`resource ${$}`);let I={...U};delete I.cacheHint,J=I}if(typeof Y==="string"){if(this._registeredResources[Y])throw Error(`Resource ${Y} is already registered`);let I=this._createRegisteredResource($,U.title,Y,J,z);if(Q!==void 0)I.cacheHint=Q;return this.setResourceRequestHandlers(),this.sendResourceListChanged(),I}else{if(this._registeredResourceTemplates[$])throw Error(`Resource template ${$} is already registered`);let I=this._createRegisteredResourceTemplate($,U.title,Y,J,z);if(Q!==void 0)I.cacheHint=Q;return this.setResourceRequestHandlers(),this.sendResourceListChanged(),I}}_createRegisteredResource($,Y,U,z,Q){let J={name:$,title:Y,metadata:z,readCallback:Q,enabled:!0,disable:()=>J.update({enabled:!1}),enable:()=>J.update({enabled:!0}),remove:()=>J.update({uri:null}),update:(I)=>{if(I.uri!==void 0&&I.uri!==U){if(delete this._registeredResources[U],I.uri)this._registeredResources[I.uri]=J}if(I.name!==void 0)J.name=I.name;if(I.title!==void 0)J.title=I.title;if(I.metadata!==void 0)J.metadata=I.metadata;if(I.callback!==void 0)J.readCallback=I.callback;if(I.enabled!==void 0)J.enabled=I.enabled;this.sendResourceListChanged()}};return this._registeredResources[U]=J,J}_createRegisteredResourceTemplate($,Y,U,z,Q){let J={resourceTemplate:U,title:Y,metadata:z,readCallback:Q,enabled:!0,disable:()=>J.update({enabled:!1}),enable:()=>J.update({enabled:!0}),remove:()=>J.update({name:null}),update:(K)=>{if(K.name!==void 0&&K.name!==$){if(delete this._registeredResourceTemplates[$],K.name)this._registeredResourceTemplates[K.name]=J}if(K.title!==void 0)J.title=K.title;if(K.template!==void 0)J.resourceTemplate=K.template;if(K.metadata!==void 0)J.metadata=K.metadata;if(K.callback!==void 0)J.readCallback=K.callback;if(K.enabled!==void 0)J.enabled=K.enabled;this.sendResourceListChanged()}};this._registeredResourceTemplates[$]=J;let I=U.uriTemplate.variableNames;if(Array.isArray(I)&&I.some((K)=>!!U.completeCallback(K)))this.setCompletionRequestHandler();return J}_createRegisteredPrompt($,Y,U,z,Q,J,I){let K=z,G=Q,H={title:Y,description:U,argsSchema:z,icons:J,_meta:I,handler:Fe($,z,Q),enabled:!0,disable:()=>H.update({enabled:!1}),enable:()=>H.update({enabled:!0}),remove:()=>H.update({name:null}),update:(W)=>{if(W.name!==void 0&&W.name!==$){if(delete this._registeredPrompts[$],W.name)this._registeredPrompts[W.name]=H}if(W.title!==void 0)H.title=W.title;if(W.description!==void 0)H.description=W.description;if(W.icons!==void 0)H.icons=W.icons;if(W._meta!==void 0)H._meta=W._meta;let X=!1;if(W.argsSchema!==void 0)H.argsSchema=W.argsSchema,K=W.argsSchema,X=!0;if(W.callback!==void 0)G=W.callback,X=!0;if(X)H.handler=Fe($,K,G);if(W.enabled!==void 0)H.enabled=W.enabled;this.sendPromptListChanged()}};if(this._registeredPrompts[$]=H,z){let W=Me(z);if(W){if(Object.values(W).some((X)=>{return qS(Oe(X))}))this.setCompletionRequestHandler()}}return H}_createRegisteredTool($,Y,U,z,Q,J,I,K,G,H){if(QS($),z!==void 0)try{let Z=R7(z,"input");this._toolInputSchemaJson[$]=Z;let q=oh(Z);if(!q.valid)console.warn(`[mcp-sdk] tool '${$}' carries an invalid x-mcp-header declaration and will be excluded by conforming Streamable HTTP clients: ${q.reason}`)}catch{}let W=H,X={title:Y,description:U,inputSchema:z,outputSchema:Q,outputSchemaJson:Le(Q),annotations:J,icons:I,execution:K,_meta:G,handler:H,executor:qe(z,H),enabled:!0,disable:()=>X.update({enabled:!1}),enable:()=>X.update({enabled:!0}),remove:()=>X.update({name:null}),update:(Z)=>{if(Z.name!==void 0&&Z.name!==$){if(typeof Z.name==="string")QS(Z.name);if(delete this._registeredTools[$],delete this._toolInputSchemaJson[$],Z.name)delete this._toolInputSchemaJson[Z.name],this._registeredTools[Z.name]=X,$=Z.name}if(Z.title!==void 0)X.title=Z.title;if(Z.description!==void 0)X.description=Z.description;let q=!1;if(Z.paramsSchema!==void 0)X.inputSchema=Z.paramsSchema,delete this._toolInputSchemaJson[$],q=!0;if(Z.callback!==void 0)X.handler=Z.callback,W=Z.callback,q=!0;if(q)X.executor=qe(X.inputSchema,W);if(Z.outputSchema!==void 0)X.outputSchema=Z.outputSchema,X.outputSchemaJson=Le(Z.outputSchema);if(Z.annotations!==void 0)X.annotations=Z.annotations;if(Z.icons!==void 0)X.icons=Z.icons;if(Z._meta!==void 0)X._meta=Z._meta;if(Z.enabled!==void 0)X.enabled=Z.enabled;this.sendToolListChanged()}};return this._registeredTools[$]=X,this.setToolRequestHandlers(),this.sendToolListChanged(),X}registerTool($,Y,U){if(this._registeredTools[$])throw Error(`Tool ${$} is already registered`);let{title:z,description:Q,inputSchema:J,outputSchema:I,annotations:K,icons:G,_meta:H}=Y;return this._createRegisteredTool($,z,Q,Rw(J),Rw(I),K,G,void 0,H,U)}registerPrompt($,Y,U){if(this._registeredPrompts[$])throw Error(`Prompt ${$} is already registered`);let{title:z,description:Q,argsSchema:J,icons:I,_meta:K}=Y,G=this._createRegisteredPrompt($,z,Q,Rw(J),U,I,K);return this.setPromptRequestHandlers(),this.sendPromptListChanged(),G}isConnected(){return this.server.transport!==void 0}async sendLoggingMessage($,Y){return this.server.sendLoggingMessage($,Y)}sendResourceListChanged(){if(this.isConnected())this.server.sendResourceListChanged()}sendToolListChanged(){if(this.isConnected())this.server.sendToolListChanged()}sendPromptListChanged(){if(this.isConnected())this.server.sendPromptListChanged()}},Ve,FH;var FS=m(()=>{_w();xw();Ne=Symbol.for("mcp.completable");Ji0=new Set(["notifications/tools/list_changed","notifications/prompts/list_changed","notifications/resources/list_changed","notifications/resources/updated"]);Zi0=new Set(["tools/call","prompts/get","resources/read"]);Te=class extends $S{_clientCapabilities;_clientVersion;static{qi0=($,Y)=>{if(Y.clientCapabilities!==void 0)$._clientCapabilities=Y.clientCapabilities;if(Y.clientInfo!==void 0)$._clientVersion=Y.clientInfo},Be=($,Y)=>{let U=Y.filter((z)=>!$._supportedProtocolVersions.includes(z));if(U.length>0)$._supportedProtocolVersions=[...$._supportedProtocolVersions,...U];$.setRequestHandler("server/discover",()=>$._ondiscover())},Pe=($)=>$._serverInfo}_capabilities;_instructions;_jsonSchemaValidator;_cacheHints;_requestStateVerify;_inputRequiredServing;_legacyShim;_legacyInputRequiredShim(){return this._legacyShim??=new Xi0({maxRounds:this._inputRequiredServing.maxRounds,roundTimeoutMs:this._inputRequiredServing.roundTimeoutMs,resolvedClientCapabilities:($)=>this._inputRequestCapabilityView($),verifyRequestState:($,Y,U)=>this._verifyRequestState($,Y,U),sendElicitation:($,Y)=>this._sendElicitationLeg($,Y,{validateAcceptedContent:!1}),sendSampling:($,Y)=>this.createMessage($,Y),listRoots:($,Y)=>this.listRoots($,Y)})}oninitialized;constructor($,Y){super(Y);if(this._serverInfo=$,this._capabilities=Y?.capabilities?{...Y.capabilities}:{},this._instructions=Y?.instructions,this._jsonSchemaValidator=Y?.jsonSchemaValidator??new kw,this._requestStateVerify=Y?.requestState?.verify,this._inputRequiredServing=Hi0(Y?.inputRequired),Y?.cacheHints!==void 0){for(let[U,z]of Object.entries(Y.cacheHints))if(z!==void 0)nh(z,`cacheHints['${U}']`);this._cacheHints=Y.cacheHints}if(this.setRequestHandler("initialize",(U)=>this._oninitialize(U)),this.setNotificationHandler("notifications/initialized",()=>this.oninitialized?.()),xh(this._supportedProtocolVersions).length>0)this.setRequestHandler("server/discover",()=>this._ondiscover());if(this._capabilities.logging)this._registerLoggingHandler()}_registerLoggingHandler(){this.setRequestHandler("logging/setLevel",async($,Y)=>{let U=Y.sessionId||Y.http?.req?.headers.get("mcp-session-id")||void 0,{level:z}=$.params,Q=Cw(P7,z);if(Q.success)this._loggingLevels.set(U,Q.data);return{}})}buildContext($,Y){let U=$.http||Y?.request||Y?.closeSSEStream||Y?.closeStandaloneSSEStream;return{...$,mcpReq:{...$.mcpReq,log:(z,Q,J)=>{if(!this._capabilities.logging)return Promise.resolve();let I;if(this._servedModernEra()){if(I=$.mcpReq.envelope?.[M7],I===void 0)return Promise.resolve()}else I=this._loggingLevels.get($.sessionId)??this._loggingLevels.get(void 0);if(I!==void 0&&this.LOG_LEVEL_SEVERITY.get(z)this.elicitInput(z,Q),requestSampling:(z,Q)=>this.createMessage(z,Q)},http:U?{...$.http,req:Y?.request,closeSSE:Y?.closeSSEStream,closeStandaloneSSE:Y?.closeStandaloneSSEStream}:void 0}}_loggingLevels=new Map;LOG_LEVEL_SEVERITY=new Map(P7.options.map(($,Y)=>[$,Y]));isMessageIgnored=($,Y)=>{let U=this._loggingLevels.get(Y);return U?this.LOG_LEVEL_SEVERITY.get($){let I=await Y(Q,J);if(s9(I))throw new J1(n0.InternalError,`Handler for ${$} returned an input-required result, but only tools/call, prompts/get and resources/read support input_required (protocol revision 2026-07-28)`);return I};return async(Q,J)=>{let I=z?await this._invokeInputRequiredCapableHandler($,Y,Q,J):await Y(Q,J);if(s9(I)){if(!z)throw new J1(n0.InternalError,`Handler for ${$} returned an input-required result, but only tools/call, prompts/get and resources/read support input_required (protocol revision 2026-07-28)`);return I}return U===void 0?I:Dw(I,U)}}return async(U,z)=>{let Q=j7(this._negotiatedProtocolVersion),J=Q.validateRequest("tools/call",U);if(!J.ok)throw new J1(J.reason==="not-in-era"?n0.InternalError:n0.InvalidParams,J.reason==="not-in-era"?"No wire schema for tools/call in the resolved era":`Invalid tools/call request: ${J.message}`);let I=await this._invokeInputRequiredCapableHandler("tools/call",Y,U,z);if(s9(I))return I;let K=fh(I),G=Q.validateResult("tools/call",K);if(!G.ok)throw new J1(G.reason==="not-in-era"?n0.InternalError:n0.InvalidParams,G.reason==="not-in-era"?"No wire schema for tools/call in the resolved era":`Invalid tools/call result: ${G.message}`);return G.value}}_servedModernEra(){return this._negotiatedProtocolVersion!==void 0&&SQ(this._negotiatedProtocolVersion)}async _invokeInputRequiredCapableHandler($,Y,U,z){let Q=this._servedModernEra(),J=z.mcpReq.requestState();if(J!==void 0&&typeof J!=="string")throw new J1(n0.InvalidParams,"Invalid or expired requestState",{reason:"invalid_request_state"});let I=z;if(typeof J==="string"){let X=await this._verifyRequestState(J,z,$);if(X!==void 0)I=th(z,X)}let K;try{K=await Y(U,I)}catch(X){if(X instanceof J1&&X.code===n0.UrlElicitationRequired){if(!Q)throw X;throw new J1(n0.InternalError,`URL elicitation cannot be signalled by throwing UrlElicitationRequiredError on protocol revision ${this._negotiatedProtocolVersion}: return inputRequired({ inputRequests: { …: inputRequired.elicitUrl(...) } }) from the handler instead. The urlElicitationRequired error (-32042) of earlier revisions is not available on this revision.`)}throw X}if(!s9(K))return K;if(!Q){if(!this._inputRequiredServing.legacyShim)throw new J1(n0.InternalError,`Handler for ${$} returned an input-required result, but this request is served on protocol revision ${this._negotiatedProtocolVersion??gY}, which has no input_required vocabulary`);return await this._legacyInputRequiredShim().fulfill($,Y,U,I,K)}let G=K.inputRequests,H=G!=null&&Object.keys(G).length>0,W=typeof K.requestState==="string";if(!H&&!W)throw new J1(n0.InternalError,`Handler for ${$} returned an input-required result with neither inputRequests nor requestState (every InputRequiredResult must include at least one of the two)`);if(H){let X=this._inputRequestCapabilityView(z);for(let[Z,q]of Object.entries(G)){let{embedded:V,required:F}=Ae($,Z,q),M=Nw(F,X);if(M!==void 0)throw new Bw({requiredCapabilities:M},`Cannot request input '${Z}' (${V.method}): the request's client capabilities do not declare the required capability`)}}return K}async _verifyRequestState($,Y,U){if(this._requestStateVerify===void 0)return;try{return await this._requestStateVerify($,Y)}catch(z){throw this.onerror?.(Error(`requestState verification rejected ${U}: ${z instanceof Error?z.message:String(z)}`)),new J1(n0.InvalidParams,"Invalid or expired requestState",{reason:"invalid_request_state"})}}_inputRequestCapabilityView($){return this._servedModernEra()?$.mcpReq.envelope?.[o9]:this._clientCapabilities}_assertPushApiInServedEra($){if(this._servedModernEra())throw new V1(A1.MethodNotSupportedByProtocolVersion,`Server-to-client requests are not available on protocol revision ${this._negotiatedProtocolVersion}: '${$}' cannot be sent while serving a request on that revision. Return inputRequired({ ... }) from the handler instead — the client fulfils the embedded requests and retries the original request (multi round-trip requests).`,{method:$,era:"2026-07-28"})}assertCapabilityForMethod($){switch($){case"sampling/createMessage":if(!this._clientCapabilities?.sampling)throw new V1(A1.CapabilityNotSupported,`Client does not support sampling (required for ${$})`);break;case"elicitation/create":if(!this._clientCapabilities?.elicitation)throw new V1(A1.CapabilityNotSupported,`Client does not support elicitation (required for ${$})`);break;case"roots/list":if(!this._clientCapabilities?.roots)throw new V1(A1.CapabilityNotSupported,`Client does not support listing roots (required for ${$})`);break;case"ping":break}}assertNotificationCapability($){switch($){case"notifications/message":if(!this._capabilities.logging)throw new V1(A1.CapabilityNotSupported,`Server does not support logging (required for ${$})`);break;case"notifications/resources/updated":case"notifications/resources/list_changed":if(!this._capabilities.resources)throw new V1(A1.CapabilityNotSupported,`Server does not support notifying about resources (required for ${$})`);break;case"notifications/tools/list_changed":if(!this._capabilities.tools)throw new V1(A1.CapabilityNotSupported,`Server does not support notifying of tool list changes (required for ${$})`);break;case"notifications/prompts/list_changed":if(!this._capabilities.prompts)throw new V1(A1.CapabilityNotSupported,`Server does not support notifying of prompt list changes (required for ${$})`);break;case"notifications/elicitation/complete":if(!this._clientCapabilities?.elicitation?.url)throw new V1(A1.CapabilityNotSupported,`Client does not support URL elicitation (required for ${$})`);break;case"notifications/cancelled":break;case"notifications/progress":break}}assertRequestHandlerCapability($){switch($){case"completion/complete":if(!this._capabilities.completions)throw new V1(A1.CapabilityNotSupported,`Server does not support completions (required for ${$})`);break;case"logging/setLevel":if(!this._capabilities.logging)throw new V1(A1.CapabilityNotSupported,`Server does not support logging (required for ${$})`);break;case"prompts/get":case"prompts/list":if(!this._capabilities.prompts)throw new V1(A1.CapabilityNotSupported,`Server does not support prompts (required for ${$})`);break;case"resources/list":case"resources/templates/list":case"resources/read":if(!this._capabilities.resources)throw new V1(A1.CapabilityNotSupported,`Server does not support resources (required for ${$})`);break;case"tools/call":case"tools/list":if(!this._capabilities.tools)throw new V1(A1.CapabilityNotSupported,`Server does not support tools (required for ${$})`);break;case"ping":case"initialize":break}}async _oninitialize($){let Y=$.params.protocolVersion;this._clientCapabilities=$.params.capabilities,this._clientVersion=$.params.clientInfo;let U=Lt(this._supportedProtocolVersions),z=U.includes(Y)?Y:U[0]??gY;return this._negotiatedProtocolVersion=z,this.transport?.setProtocolVersion?.(z),{protocolVersion:z,capabilities:this.getCapabilities(),serverInfo:this._serverInfo,...this._instructions&&{instructions:this._instructions}}}_ondiscover(){return{supportedVersions:xh(this._supportedProtocolVersions),capabilities:Vi0(this.getCapabilities()),...this._instructions&&{instructions:this._instructions}}}_outboundServerInfo(){return this._serverInfo}getClientCapabilities(){return this._clientCapabilities}getClientVersion(){return this._clientVersion}getNegotiatedProtocolVersion(){return this._negotiatedProtocolVersion}projectCallToolResult($,Y){return this._wireCodec().projectCallToolResult($,Y)}getCapabilities(){return this._capabilities}async ping(){return this._assertPushApiInServedEra("ping"),this.request({method:"ping"})}async createMessage($,Y){if(this._assertPushApiInServedEra("sampling/createMessage"),($.tools||$.toolChoice)&&!this._clientCapabilities?.sampling?.tools)throw new V1(A1.CapabilityNotSupported,"Client does not support sampling tools capability.");if($.messages.length>0){let J=$.messages.at(-1),I=Array.isArray(J.content)?J.content:[J.content],K=I.some((X)=>X.type==="tool_result"),G=$.messages.length>1?$.messages.at(-2):void 0,H=G?Array.isArray(G.content)?G.content:[G.content]:[],W=H.some((X)=>X.type==="tool_use");if(K){if(I.some((X)=>X.type!=="tool_result"))throw new J1(n0.InvalidParams,"The last message must contain only tool_result content if any is present");if(!W)throw new J1(n0.InvalidParams,"tool_result blocks are not matching any tool_use from the previous message")}if(W){let X=new Set(H.filter((q)=>q.type==="tool_use").map((q)=>q.id)),Z=new Set(I.filter((q)=>q.type==="tool_result").map((q)=>q.toolUseId));if(X.size!==Z.size||![...X].every((q)=>Z.has(q)))throw new J1(n0.InvalidParams,"ids of tool_result blocks and tool_use blocks from previous message do not match")}}let U=Boolean($.tools||$.toolChoice),z=await this.request({method:"sampling/createMessage",params:$},Y),Q=this._wireCodec().samplingResultVariant(U,z);if(!Q.ok)throw new V1(A1.InvalidResult,`Invalid sampling/createMessage result: ${Q.reason==="invalid"?Q.message:Q.reason}`);return Q.value}async elicitInput($,Y){switch(this._assertPushApiInServedEra("elicitation/create"),$.mode??"form"){case"url":if(!this._clientCapabilities?.elicitation?.url)throw new V1(A1.CapabilityNotSupported,"Client does not support url elicitation.");break;case"form":if(!this._clientCapabilities?.elicitation?.form)throw new V1(A1.CapabilityNotSupported,"Client does not support form elicitation.");break}return this._sendElicitationLeg($,Y)}async _sendElicitationLeg($,Y,U){let z=$.mode??"form",Q=U?.validateAcceptedContent??!0;switch(z){case"url":{let J=$;return this.request({method:"elicitation/create",params:J},Y)}case"form":{let J=$.mode==="form"?$:{...$,mode:"form"},I=await this.request({method:"elicitation/create",params:J},Y);if(Q&&I.action==="accept"&&I.content&&J.requestedSchema)try{let K=this._jsonSchemaValidator.getValidator(J.requestedSchema)(I.content);if(!K.valid)throw new J1(n0.InvalidParams,`Elicitation response content does not match requested schema: ${K.errorMessage}`)}catch(K){if(K instanceof J1)throw K;throw new J1(n0.InternalError,`Error validating elicitation response: ${K instanceof Error?K.message:String(K)}`)}return I}}}createElicitationCompletionNotifier($,Y){if(!this._clientCapabilities?.elicitation?.url)throw new V1(A1.CapabilityNotSupported,"Client does not support URL elicitation (required for notifications/elicitation/complete)");return()=>this.notification({method:"notifications/elicitation/complete",params:{elicitationId:$}},Y)}async listRoots($,Y){return this._assertPushApiInServedEra("roots/list"),this.request({method:"roots/list",params:$},Y)}async sendLoggingMessage($,Y){if(this._capabilities.logging&&!this.isMessageIgnored($.level,Y))return this.notification({method:"notifications/message",params:$})}async sendResourceUpdated($){return this.notification({method:"notifications/resources/updated",params:$})}async sendResourceListChanged(){return this.notification({method:"notifications/resources/list_changed"})}async sendToolListChanged(){return this.notification({method:"notifications/tools/list_changed"})}async sendPromptListChanged(){return this.notification({method:"notifications/prompts/list_changed"})}};Ve={type:"object",properties:{}};FH={completion:{values:[],hasMore:!1}}});var je=m(()=>{FS();_w();xw()});function Mi0($){let Y=$.params;if($.method==="initialize"&&!rh(Y)){let J=Y!==null&&typeof Y==="object"&&typeof Y.protocolVersion==="string"?Y.protocolVersion:void 0;return{kind:"legacy",reason:"initialize",...J!==void 0&&{requestedVersion:J}}}if(!Pw(Y))return{kind:"legacy",reason:"no-claim"};let U=bY(Y),z=(U===void 0?[]:jw(U))[0];if(z!==void 0)return{kind:"invalid-envelope",issue:z};let Q=Tw(Y);if(Q===void 0||!E7.includes(Q))return{kind:"unsupported-revision",requested:Q??"unknown"};return{kind:"modern",revision:Q,classification:{era:"modern",revision:Q}}}function Ce($,Y={}){let U=Y.legacy??"serve",z=Y.transport??new Fi0,Q={phase:"opening"},J,I=!1,K=()=>I||Q.phase==="closed",G=(j)=>{try{Y.onerror?.(j)}catch{}},H=(j,C,b,x)=>z.send({jsonrpc:"2.0",id:j,error:{code:C,message:b,...x!==void 0&&{data:x}}}).catch((S)=>G(J5(S))),W=new De(Y.maxSubscriptions??fw),X=(j)=>{if(!C7(j))return;let C=W.routeOutbound(j);if(C==="passthrough")return;for(let b of C)z.send({jsonrpc:"2.0",...b}).catch((x)=>G(J5(x)));return"handled"},Z=async(j)=>{if(D$(j)&&j.method==="subscriptions/listen"){let C=bY(j.params),b=Pw(j.params)?(C===void 0?[]:jw(C))[0]:{key:"_meta",problem:"the per-request envelope is required on protocol revision 2026-07-28"},x=Tw(j.params),S;if(b!==void 0)S={jsonrpc:"2.0",id:j.id,error:{code:-32602,message:`Invalid _meta envelope: ${b.key}: ${b.problem}`}};else if(x===void 0||!E7.includes(x)){let i=new gQ({supported:[...E7],requested:x??"unknown"});S={jsonrpc:"2.0",id:j.id,error:{code:i.code,message:i.message,data:i.data}}}else S=W.serve(j);return await z.send("error"in S?S:{jsonrpc:"2.0",method:S.method,params:S.params}).catch((i)=>G(J5(i))),!0}if(C7(j)&&j.method==="notifications/cancelled"){let C=j.params?.requestId;if(C!==void 0&&W.cancel(C))return!0}return!1},q=(j,C,b)=>{let x=sh({kind:"legacy",reason:C,...b!==void 0&&{requestedVersion:b}},E7);if(x===void 0)return Promise.resolve();return G(Error(`Rejected 2025-era request on a modern-only stdio connection (${x.cell}): ${x.message}`)),H(j.id,x.code,x.message,x.data)},V=(j)=>{if(I||j===J)return;T()},F=async(j,C)=>{let b=await $({era:j}),x=b instanceof wH?b.server:b;if(j==="modern")eh(x,C),VS(x,E7),W.setServerCapabilities(x.getCapabilities(),LS(x));let S=new wi0(z,()=>V(S),j==="modern"?X:void 0);return await b.connect(S),{product:b,channel:S}},M=(j)=>j.product.close().catch((C)=>G(J5(C))),w=async(j)=>{J=j.channel;try{if(!await j.channel.whenRequestsAnswered(Ee))G(Error(`Discarded the probe instance with requests still unanswered after ${Ee}ms; continuing with the fallback`));await j.product.close()}catch(C){G(J5(C))}finally{J=void 0}},N=async(j)=>{if(Q.phase==="closed")return;if(Q.phase==="pinned"){if(Q.era==="modern"&&D$(j)&&j.method==="initialize"&&!rh(j.params)){await q(j,"initialize",j.params!==null&&typeof j.params==="object"&&typeof j.params.protocolVersion==="string"?j.params.protocolVersion:void 0);return}if(Q.era==="modern"&&await Z(j))return;Q.instance.channel.deliver(j);return}if(!D$(j)&&!C7(j)){G(Error("Discarded a JSON-RPC response received before the connection negotiated an era"));return}let C=Mi0(j);switch(C.kind){case"invalid-envelope":{let b=`Invalid _meta envelope for protocol revision 2026-07-28: ${C.issue.key}: ${C.issue.problem}`;if(D$(j))await H(j.id,n0.InvalidParams,b,{envelope:C.issue});else G(Error(`Discarded a notification with a malformed envelope: ${b}`));return}case"unsupported-revision":if(D$(j)){let b=new gQ({supported:[...E7],requested:C.requested});G(b),await H(j.id,b.code,b.message,b.data)}else G(Error(`Discarded a notification claiming unsupported protocol revision ${C.requested}`));return;case"modern":if(D$(j)&&j.method==="server/discover"){if(Q.phase==="probe"){Q.instance.channel.deliver(j,{classification:C.classification});return}let b=await F("modern",C.revision);if(K()){await M(b);return}Q={phase:"probe",instance:b},b.channel.deliver(j,{classification:C.classification});return}if(Q.phase==="probe"){if(C7(j)){Q.instance.channel.deliver(j,{classification:C.classification});return}Q={phase:"pinned",era:"modern",instance:Q.instance}}else{let b=await F("modern",C.revision);if(K()){await M(b);return}Q={phase:"pinned",era:"modern",instance:b}}if(await Z(j))return;Q.instance.channel.deliver(j,{classification:C.classification});return;case"legacy":{if(U==="reject"){if(D$(j))await q(j,C.reason,C.requestedVersion);return}if(Q.phase==="probe"){if(await w(Q.instance),K())return;Q={phase:"opening"}}let b=await F("legacy");if(K()){await M(b);return}Q={phase:"pinned",era:"legacy",instance:b},Q.instance.channel.deliver(j);return}}},O=[],D=!1,P=async()=>{if(D)return;D=!0;try{while(O.length>0){let j=O.shift();try{await N(j)}catch(C){if(D$(j))await H(j.id,n0.InternalError,"Internal server error");G(J5(C))}}}finally{D=!1}},T=async()=>{if(I||Q.phase==="closed")return;I=!0;let j=Q;Q={phase:"closed"};for(let C of W.teardownAll())await z.send(C).catch((b)=>G(J5(b)));if(j.phase==="probe"||j.phase==="pinned")await j.instance.product.close().catch((C)=>G(J5(C)));await z.close().catch((C)=>G(J5(C)))};z.onmessage=(j)=>{O.push(j),P()},z.onerror=(j)=>{if(G(j),Q.phase==="probe"||Q.phase==="pinned")Q.instance.channel.onerror?.(j)},z.onclose=()=>{if(I||Q.phase==="closed")return;I=!0;let j=Q;if(Q={phase:"closed"},j.phase==="probe"||j.phase==="pinned")j.instance.product.close().catch((C)=>G(J5(C)))};let A=z.start().catch((j)=>{throw G(J5(j)),j});return A.catch(()=>{}),{close:async()=>{await A.catch(()=>{}),await T()}}}function J5($){return $ instanceof Error?$:Error(String($))}var Fi0=class{_readBuffer;_started=!1;_closed=!1;constructor($=XS.stdin,Y=XS.stdout,U){this._stdin=$,this._stdout=Y,this._readBuffer=new US({maxBufferSize:U?.maxBufferSize})}onclose;onerror;onmessage;_ondata=($)=>{try{this._readBuffer.append($),this.processReadBuffer()}catch(Y){this.onerror?.(Y),this.close().catch(()=>{})}};_onerror=($)=>{this.onerror?.($)};_onstdouterror=($)=>{this.onerror?.($),this.close().catch(()=>{})};async start(){if(this._started)throw Error("StdioServerTransport already started! If using Server class, note that connect() calls start() automatically.");this._started=!0,this._stdin.on("data",this._ondata),this._stdin.on("error",this._onerror),this._stdout.on("error",this._onstdouterror)}processReadBuffer(){while(!0)try{let $=this._readBuffer.readMessage();if($===null)break;this.onmessage?.($)}catch($){this.onerror?.($)}}async close(){if(this._closed)return;if(this._closed=!0,this._stdin.off("data",this._ondata),this._stdin.off("error",this._onerror),this._stdout.off("error",this._onstdouterror),this._stdin.listenerCount("data")===0)this._stdin.pause();this._readBuffer.clear(),this.onclose?.()}send($){if(this._closed)return Promise.reject(Error("StdioServerTransport is closed"));return new Promise((Y,U)=>{let z=zS($),Q=!1,J=(K)=>{if(Q)return;Q=!0,this._stdout.off("error",J),this._stdout.off("drain",I),U(K)},I=()=>{if(Q)return;Q=!0,this._stdout.off("error",J),this._stdout.off("drain",I),Y()};if(this._stdout.once("error",J),this._stdout.write(z)){if(Q)return;Q=!0,this._stdout.off("error",J),Y()}else if(!Q)this._stdout.once("drain",I)})}},Ee=3000,wi0=class{onclose;onerror;onmessage;_closed=!1;_pendingRequests=new Set;_drainWaiters=[];constructor($,Y,U){this._wire=$,this._onInstanceClose=Y,this._outboundIntercept=U}async start(){}async send($,Y){if(XH($)||Ew($)){let{id:U}=$;if(U!==void 0)this._settle(U)}if(this._closed)return;if(this._outboundIntercept?.($)==="handled")return;return this._wire.send($,Y)}setProtocolVersion=($)=>{this._wire.setProtocolVersion?.($)};deliver($,Y){if(this._closed)return;if(D$($))this._pendingRequests.add($.id);else if(C7($)&&$.method==="notifications/cancelled"){let U=$.params?.requestId;if(U!==void 0)this._settle(U)}this.onmessage?.($,Y)}async whenRequestsAnswered($){if(this._closed||this._pendingRequests.size===0)return!0;return await new Promise((Y)=>{let U=()=>{clearTimeout(z),Y(!0)},z=setTimeout(()=>{this._drainWaiters=this._drainWaiters.filter((Q)=>Q!==U),Y(!1)},$);this._drainWaiters.push(U)})}async close(){if(this._closed)return;this._closed=!0,this._pendingRequests.clear(),this._releaseDrainWaiters();try{this._onInstanceClose()}finally{this.onclose?.()}}_settle($){if(this._pendingRequests.delete($),this._pendingRequests.size===0)this._releaseDrainWaiters()}_releaseDrainWaiters(){let $=this._drainWaiters;this._drainWaiters=[];for(let Y of $)Y()}};var Re=m(()=>{FS();_w();xw()});var A$=m(()=>{PL();PL()});var a9;var MH=m(()=>{a9=class a9 extends Error{name="KyError";get isKyError(){return!0}}});var D6;var uw=m(()=>{MH();D6=class D6 extends a9{name="HTTPError";response;request;options;data;constructor($,Y,U){let z=$.status||$.status===0?$.status:"",Q=$.statusText??"",J=`${z} ${Q}`.trim(),I=J?`status code ${J}`:"an unknown error";super(`Request failed with ${I}: ${Y.method} ${Y.url}`);this.response=$,this.request=Y,this.options=U}}});var OH;var wS=m(()=>{MH();OH=class OH extends a9{name="NetworkError";request;constructor($,Y){super(`Request failed due to a network error: ${$.method} ${$.url}`,Y);this.request=$}}});var NH;var MS=m(()=>{NH=class NH extends Error{name="NonError";value;constructor($){let Y="Non-error value was thrown";try{if(typeof $==="string")Y=$;else if($&&typeof $==="object"&&"message"in $&&typeof $.message==="string")Y=$.message}catch{}super(Y);this.value=$}}});var xQ;var _e=m(()=>{MH();MS();xQ=class xQ extends a9{name="ForceRetryError";customDelay;code;customRequest;constructor($){let Y=$?.cause?$.cause instanceof Error?$.cause:new NH($.cause):void 0;super($?.code?`Forced retry: ${$.code}`:"Forced retry",Y?{cause:Y}:void 0);this.customDelay=$?.delay,this.code=$?.code,this.customRequest=$?.request}}});var OS;var ve=m(()=>{OS=class OS extends Error{name="SchemaValidationError";issues;constructor($){super("Response schema validation failed");this.issues=$}}});var I5;var bw=m(()=>{MH();I5=class I5 extends a9{name="TimeoutError";request;constructor($){super(`Request timed out: ${$.method} ${$.url}`);this.request=$}}});class pw{options;constructor($){this.options=$}}var NS,he,iw,Se,ge,cw,Oi0=()=>{return},ye,fQ=2147483647,ke=40,nw,xe=($)=>new pw($),fe,ue;var iY=m(()=>{NS=(()=>{let $=!1,Y=!1,U=typeof globalThis.ReadableStream==="function",z=typeof globalThis.Request==="function";if(U&&z)try{Y=new globalThis.Request("https://empty.invalid",{body:new globalThis.ReadableStream,method:"POST",get duplex(){return $=!0,"half"}}).headers.has("Content-Type")}catch(Q){if(Q instanceof Error&&Q.message==="unsupported BodyInit type")return!1;throw Q}return $&&!Y})(),he=typeof globalThis.AbortController==="function",iw=typeof globalThis.AbortSignal==="function"&&typeof globalThis.AbortSignal.any==="function",Se=typeof globalThis.ReadableStream==="function",ge=typeof globalThis.FormData==="function",cw=["get","post","put","patch","head","delete"];Oi0();ye={json:"application/json",text:"text/*",formData:"multipart/form-data",arrayBuffer:"*/*",blob:"*/*",bytes:"*/*"},nw=Symbol("stop");fe={json:!0,parseJson:!0,stringifyJson:!0,searchParams:!0,baseUrl:!0,prefix:!0,retry:!0,timeout:!0,totalTimeout:!0,hooks:!0,throwHttpErrors:!0,onDownloadProgress:!0,onUploadProgress:!0,fetch:!0,context:!0},ue={method:!0,headers:!0,body:!0,mode:!0,credentials:!0,cache:!0,redirect:!0,referrer:!0,referrerPolicy:!0,integrity:!0,keepalive:!0,signal:!0,window:!0,duplex:!0}});var dw,Ni0=($)=>{if(!$)return 0;if($ instanceof FormData){let Y=0;for(let[U,z]of $)Y+=ke,Y+=dw.encode(`Content-Disposition: form-data; name="${U}"`).byteLength,Y+=typeof z==="string"?dw.encode(z).byteLength:z.size;return Y}if($ instanceof Blob)return $.size;if($ instanceof ArrayBuffer||ArrayBuffer.isView($))return $.byteLength;if(typeof $==="string")return dw.encode($).byteLength;if($ instanceof URLSearchParams)return dw.encode($.toString()).byteLength;return 0},be=($,Y,U)=>{let z,Q=0;return $.pipeThrough(new TransformStream({transform(J,I){if(I.enqueue(J),z){Q+=z.byteLength;let K=Y===0?0:Q/Y;if(K>=1)K=1-Number.EPSILON;U?.({percent:K,totalBytes:Math.max(Y,Q),transferredBytes:Q},z)}z=J},flush(){if(z)Q+=z.byteLength,U?.({percent:1,totalBytes:Math.max(Y,Q),transferredBytes:Q},z)}}))},ie=($,Y)=>{if(!$.body)return $;let U={status:$.status,statusText:$.statusText,headers:$.headers};if($.status===204)return new Response(null,U);let z=Math.max(0,Number($.headers.get("content-length"))||0);return new Response(be($.body,z,Y),U)},ce=($,Y,U)=>{if(!$.body)return $;let z=Ni0(U??$.body);return new Request($,{duplex:"half",body:be($.body,z,Y)})};var ne=m(()=>{iY();dw=new TextEncoder});var m5=($)=>$!==null&&typeof $==="object";function DH($,Y,U){return Object.hasOwn(Y,U)&&Y[U]===void 0?[]:PS($[U]??[],Y[U]??[])}var Di0,DS=($)=>m5($)&&$[Di0]===!0?{isReplace:!0,value:$.value}:{isReplace:!1,value:$},AH=(...$)=>{for(let Y of $)if((!m5(Y)||Array.isArray(Y))&&Y!==void 0)throw TypeError("The `options` argument must be an object");return PS({},...$)},BS=($={},Y={})=>{let U=new globalThis.Headers($),z=Y instanceof globalThis.Headers,Q=new globalThis.Headers(Y);for(let[J,I]of Q.entries())if(z&&I==="undefined"||I===void 0)U.delete(J);else U.set(J,I);return U},AS=($)=>{if(!m5($)||Array.isArray($))return!1;let Y=Object.getPrototypeOf($);return Y===Object.prototype||Y===null},uQ=($)=>{if($ instanceof URLSearchParams){let Y=new URLSearchParams($),U=$[_7];if(U)Y[_7]=new Set(U);return Y}if($ instanceof globalThis.Headers)return new globalThis.Headers($);if(Array.isArray($))return[...$];if(AS($))return{...$};return $},Ai0=($)=>Object.fromEntries(Object.entries($).filter((Y)=>Y[1]!==void 0)),Bi0=($,Y)=>{if(AS($)&&AS(Y))return Ai0({...$,...Y});return BS($,Y)},mw=($={},Y={})=>({init:DH($,Y,"init"),beforeRequest:DH($,Y,"beforeRequest"),beforeRetry:DH($,Y,"beforeRetry"),beforeError:DH($,Y,"beforeError"),afterResponse:DH($,Y,"afterResponse")}),_7,Pi0=($,Y)=>{let U=new URLSearchParams,z=new Set;for(let Q of[$,Y]){if(Q===void 0)continue;if(Q instanceof URLSearchParams){for(let[I,K]of Q.entries())U.append(I,K),z.delete(I);let J=Q[_7];if(J)for(let I of J)U.delete(I),z.add(I)}else if(Array.isArray(Q))for(let J of Q){if(!Array.isArray(J)||J.length!==2)throw TypeError("Array search parameters must be provided in [[key, value], ...] format");U.append(String(J[0]),String(J[1])),z.delete(String(J[0]))}else if(m5(Q))for(let[J,I]of Object.entries(Q))if(I===void 0)U.delete(J),z.add(J);else U.append(J,String(I)),z.delete(J);else{let J=new URLSearchParams(Q);for(let[I,K]of J.entries())U.append(I,K),z.delete(I)}}if(z.size>0)U[_7]=z;return U},PS=(...$)=>{let Y={},U={},z={},Q,J=[];for(let I of $)if(Array.isArray(I)){if(!Array.isArray(Y))Y=[];Y=[...Y,...I]}else if(m5(I)){for(let[K,G]of Object.entries(I)){if(K==="signal"&&G instanceof globalThis.AbortSignal){J.push(G);continue}let H=DS(G),{isReplace:W}=H;if(G=H.value,K==="context"){if(G!==void 0&&G!==null&&(!m5(G)||Array.isArray(G)))throw TypeError("The `context` option must be an object");Y={...Y,context:G===void 0||G===null?{}:W?{...G}:{...Y.context,...G}};continue}if(K==="searchParams"){if(G===void 0||G===null)Q=void 0;else if(W)Q=G;else Q=Q===void 0?G:Pi0(Q,G);continue}if(m5(G)&&!W&&K in Y)G=PS(Y[K],G);Y={...Y,[K]:G}}if(m5(I.hooks)){let{value:K,isReplace:G}=DS(I.hooks);z=G?mw({},K):mw(z,K),Y.hooks=z}if(m5(I.headers)){let{value:K,isReplace:G}=DS(I.headers);U=G?uQ(K):Bi0(U,K),Y.headers=U}}if(Q!==void 0)Y.searchParams=Q;if(J.length>0)if(J.length===1)Y.signal=J[0];else if(iw)Y.signal=AbortSignal.any(J);else Y.signal=J.at(-1);return Y};var lw=m(()=>{iY();Di0=Symbol("replaceOption");_7=Symbol("deletedParameters")});var de=($)=>cw.includes($)?$.toUpperCase():$,Ti0,ji0,Ei0,pe,me=($={})=>{if(typeof $==="number")return{...pe,limit:$};if($.methods&&!Array.isArray($.methods))throw Error("retry.methods must be an array");if($.statusCodes&&!Array.isArray($.statusCodes))throw Error("retry.statusCodes must be an array");let Y=Object.fromEntries(Object.entries({...$,methods:$.methods?.map((U)=>U.toLowerCase())}).filter(([,U])=>U!==void 0));return{...pe,...Y}};var le=m(()=>{iY();Ti0=["get","put","head","delete","options","trace"],ji0=[408,413,429,500,502,503,504],Ei0=[413,429,503],pe={limit:2,methods:Ti0,statusCodes:ji0,afterStatusCodes:Ei0,maxRetryAfter:Number.POSITIVE_INFINITY,backoffLimit:Number.POSITIVE_INFINITY,delay:($)=>0.3*2**($-1)*1000,jitter:void 0,retryOnTimeout:!1}});async function TS($,Y,U,z){return new Promise((Q,J)=>{let I=setTimeout(()=>{if(U)U.abort();J(new I5($))},z.timeout);z.fetch($,Y).then(Q).catch(J).then(()=>{clearTimeout(I)})})}var oe=m(()=>{bw()});async function ow($,{signal:Y}){return new Promise((U,z)=>{if(Y)Y.throwIfAborted(),Y.addEventListener("abort",Q,{once:!0});function Q(){clearTimeout(J),z(Y.reason)}let J=setTimeout(()=>{Y?.removeEventListener("abort",Q),U()},$)})}var re=($)=>{let Y={};for(let U in $){if(!Object.hasOwn($,U))continue;if(!(U in ue)&&!(U in fe))Y[U]=$[U]}return Y},se=($)=>{if($===void 0)return!1;if(Array.isArray($))return $.length>0;if($ instanceof URLSearchParams)return $.size>0||Boolean($[_7]?.size);if(typeof $==="object")return Object.keys($).length>0;if(typeof $==="string")return $.trim().length>0;return Boolean($)};var ae=m(()=>{iY();lw()});function jS($){if(!($&&Ri0($)&&$.name==="TypeError"&&typeof $.message==="string"))return!1;let{message:U,stack:z}=$;if(U==="Load failed")return z===void 0||"__sentry_captured__"in $;if(U.startsWith("error sending request for url"))return!0;if(U==="Failed to fetch"||U.startsWith("Failed to fetch (")&&U.endsWith(")"))return!0;return _i0.has(U)}var Ci0,Ri0=($)=>Ci0.call($)==="[object Error]",_i0;var te=m(()=>{Ci0=Object.prototype.toString,_i0=new Set(["network error","NetworkError when attempting to fetch resource.","The Internet connection appears to be offline.","Network request failed","fetch failed","terminated"," A network error occurred.","Network connection lost"])});function ee($){return ES($,D6)}function $00($){return ES($,OH)}function Y00($){return ES($,I5)}var ES=($,Y)=>$ instanceof Y||$?.name===Y.name;var U00=m(()=>{uw();wS();bw()});function ki0($){let Y={...$,json:uQ($.json),context:uQ($.context),headers:uQ($.headers),searchParams:yi0($.searchParams)};if($.retry!==void 0)Y.retry=gi0($.retry);return Y}class bQ{static create($,Y){let U=Y.hooks?.init??[],z=U.length>0?ki0(Y):Y;for(let K of U)K(z);let Q=new bQ($,z),J=async()=>{if(typeof Q.#$.timeout==="number"&&Q.#$.timeout>fQ)throw RangeError(`The \`timeout\` option cannot be greater than ${fQ}`);if(typeof Q.#$.totalTimeout==="number"&&Q.#$.totalTimeout>fQ)throw RangeError(`The \`totalTimeout\` option cannot be greater than ${fQ}`);await Promise.resolve();let K=await Q.#g(),G=K??await Q.#h(async()=>Q.#R()),H=K!==void 0||Q.#C();for(;;){if(G===void 0)return G;if(PH(G))try{G=await Q.#y(G)}catch(X){if(!(X instanceof xQ))throw X;let Z=await Q.#E(X,async()=>Q.#R());if(Z===void 0)return Z;G=Z,H=Q.#C();continue}let W=G;if(!W.ok&&W.type!=="opaque"&&(typeof Q.#$.throwHttpErrors==="function"?Q.#$.throwHttpErrors(W.status):Q.#$.throwHttpErrors)){let X=new D6(W,Q.#O(W),Q.#M()),Z=X;if(X.data=await Q.#L(W),H)throw Z;let q=await Q.#E(X,async()=>Q.#R());if(q===void 0)return q;G=q,H=Q.#C();continue}break}if(!PH(G))return G;if(Q.#V(G),Q.#$.onDownloadProgress){if(typeof Q.#$.onDownloadProgress!=="function")throw TypeError("The `onDownloadProgress` option must be a function");if(!Se)throw Error("Streams are not supported in your environment. `ReadableStream` is missing.");let W=G.clone();return Q.#K(G),ie(W,Q.#$.onDownloadProgress)}return G},I=(async()=>{try{return await J()}catch(K){if(!(K instanceof Error))throw K;if(Q.#X.has(K))throw K;let G=K;for(let H of Q.#$.hooks.beforeError){let W=await H({request:Q.request,options:Q.#M(),error:G,retryCount:Q.#Q});if(W instanceof Error)G=W}throw G}finally{let K=Q.#W;if(Q.#F(K?.body??void 0),Q.request!==K)Q.#F(Q.request.body??void 0)}})();for(let[K,G]of Object.entries(ye)){if(K==="bytes"&&typeof globalThis.Response?.prototype?.bytes!=="function")continue;I[K]=async(H)=>{Q.request.headers.set("accept",Q.request.headers.get("accept")||G);let W=await I;if(K!=="json")return W[K]();let X=await W.text();if(X===""){if(H!==void 0)return J00(void 0,H);return JSON.parse(X)}let Z=z.parseJson?await z.parseJson(X,{request:Q.#O(W),response:W}):JSON.parse(X);return H===void 0?Z:J00(Z,H)}}return I}static#z($){if($&&typeof $==="object"&&!Array.isArray($)&&!($ instanceof URLSearchParams))return Object.fromEntries(Object.entries($).filter(([,Y])=>Y!==void 0));return $}request;#U;#Q=0;#Y;#$;#W;#H;#X=new WeakSet;#J;#I;#Z=!1;#N=new WeakMap;constructor($,Y={}){if(this.#Y=$,Object.hasOwn(Y,"prefixUrl"))throw Error(hi0);if(this.#$={...Y,headers:BS(this.#Y.headers,Y.headers),hooks:mw({},Y.hooks),method:de(Y.method??this.#Y.method??"GET"),prefix:String(Y.prefix||""),retry:me(Y.retry),throwHttpErrors:Y.throwHttpErrors??!0,timeout:Y.timeout??1e4,totalTimeout:Y.totalTimeout??!1,fetch:Y.fetch??globalThis.fetch.bind(globalThis),context:Y.context??{}},typeof this.#Y!=="string"&&!(this.#Y instanceof URL||this.#Y instanceof globalThis.Request))throw TypeError("`input` must be a string, URL, or Request");if(typeof this.#Y==="string"){if(this.#$.prefix){let z=this.#$.prefix.replace(/\/+$/,""),Q=this.#Y.replace(/^\/+/,"");this.#Y=`${z}/${Q}`}if(this.#$.baseUrl){let z;try{z=new URL(this.#Y)}catch{}if(!z)this.#Y=new URL(this.#Y,new Request(this.#$.baseUrl).url)}}if(he&&iw)this.#H=this.#$.signal??this.#Y.signal,this.#U=new globalThis.AbortController,this.#$.signal=this.#w();if(NS)this.#$.duplex="half";if(this.#$.json!==void 0)this.#$.body=this.#$.stringifyJson?.(this.#$.json)??JSON.stringify(this.#$.json),this.#$.headers.set("content-type",this.#$.headers.get("content-type")??"application/json");let U=Y.headers&&new globalThis.Headers(Y.headers).has("content-type");if(this.#Y instanceof globalThis.Request&&(ge&&this.#$.body instanceof globalThis.FormData||this.#$.body instanceof URLSearchParams)&&!U)this.#$.headers.delete("content-type");if(this.request=new globalThis.Request(this.#Y,this.#$),se(this.#$.searchParams)){let z=new URL(this.request.url),Q=this.#$.searchParams?.[_7];if(Q)for(let J of Q)z.searchParams.delete(J);if(typeof this.#$.searchParams==="string"){let J=this.#$.searchParams.replace(/^\?/,"");if(J!=="")z.search=z.search?`${z.search}&${J}`:`?${J}`}else{let J=new URLSearchParams(bQ.#z(this.#$.searchParams));for(let[I,K]of J.entries())z.searchParams.append(I,K)}if(this.#$.searchParams&&typeof this.#$.searchParams==="object"&&!Array.isArray(this.#$.searchParams)&&!(this.#$.searchParams instanceof URLSearchParams)){for(let[J,I]of Object.entries(this.#$.searchParams))if(I===void 0)z.searchParams.delete(J)}this.request=new globalThis.Request(z,this.#$)}if(this.#$.onUploadProgress&&typeof this.#$.onUploadProgress!=="function")throw TypeError("The `onUploadProgress` option must be a function");this.#I=typeof this.#$.totalTimeout==="number"?this.#S():void 0}#G(){let $=this.#$.retry.delay(this.#Q+1),Y=$;if(this.#$.retry.jitter===!0)Y=Math.random()*$;else if(typeof this.#$.retry.jitter==="function"){if(Y=this.#$.retry.jitter($),!Number.isFinite(Y)||Y<0)Y=$}return Math.min(this.#$.retry.backoffLimit,Y)}async#P($){if(this.#Q>=this.#$.retry.limit)throw $;let Y=$ instanceof Error?$:new NH($);if(Y instanceof xQ)return Y.customDelay??this.#G();if(!this.#$.retry.methods.includes(this.request.method.toLowerCase()))throw $;if(this.#$.retry.shouldRetry!==void 0){let U=await this.#$.retry.shouldRetry({error:Y,retryCount:this.#Q+1});if(U===!1)throw $;if(U===!0)return this.#G()}if(Y00($)){if(!this.#$.retry.retryOnTimeout)throw $;return this.#G()}if(ee($)){if(!this.#$.retry.statusCodes.includes($.response.status))throw $;let U=$.response.headers.get("Retry-After")??$.response.headers.get("RateLimit-Reset")??$.response.headers.get("X-RateLimit-Retry-After")??$.response.headers.get("X-RateLimit-Reset")??$.response.headers.get("X-Rate-Limit-Reset");if(U&&this.#$.retry.afterStatusCodes.includes($.response.status)){let z=Number(U)*1000;if(Number.isNaN(z))z=Date.parse(U)-Date.now();else if(z>=Date.parse("2024-01-01"))z-=Date.now();if(!Number.isFinite(z))return Math.min(this.#$.retry.maxRetryAfter,this.#G());return z=Math.max(0,z),Math.min(this.#$.retry.maxRetryAfter,z)}if($.response.status===413)throw $;return this.#G()}if(!$00($))throw $;return this.#G()}#V($){let Y=this.#O($);if(this.#$.parseJson)$.json=async()=>{let U=await $.text();if(U==="")return JSON.parse(U);return this.#$.parseJson(U,{request:Y,response:$})};return $}async#L($){let Y=await this.#T($,this.#D());if(Y===BH){this.#q();return}if(!Y)return;if(!this.#A($.headers.get("content-type")??""))return Y;let U=await this.#j(Y,$,this.#D(),this.#O($));if(U===BH){this.#q();return}return U}#D(){let $=this.#$.timeout===!1?1e4:this.#$.timeout,Y=this.#B();if(Y===void 0)return $;if(Y<=0)throw new I5(this.request);return Math.min($,Y)}#A($){let Y=($.split(";",1)[0]??"").trim().toLowerCase();return/\/(?:.*[.+-])?json$/.test(Y)}async#T($,Y){let{body:U}=$;if(!U)try{return await $.text()}catch{return}let z;try{z=U.getReader()}catch{return}let Q=Si0($.headers.get("content-type")??""),J=[],I=0,K=(async()=>{try{for(;;){let{done:W,value:X}=await z.read();if(W)break;if(I+=X.byteLength,I>vi0){z.cancel().catch(()=>{return});return}J.push(Q.decode(X,{stream:!0}))}}catch{return}return J.push(Q.decode()),J.join("")})(),G=new Promise((W)=>{let X=setTimeout(()=>{W(BH)},Y);K.finally(()=>{clearTimeout(X)})}),H=await Promise.race([K,G]);if(H===BH)z.cancel().catch(()=>{return});return H}async#j($,Y,U,z){let Q;try{return await Promise.race([Promise.resolve().then(()=>this.#$.parseJson?this.#$.parseJson($,{request:z,response:Y}):JSON.parse($)),new Promise((J)=>{Q=setTimeout(()=>{J(BH)},U)})])}catch{return}finally{clearTimeout(Q)}}#F($){if(!$)return;$.cancel().catch(()=>{return})}#K($){this.#F($.body??void 0)}#w(){return this.#H?AbortSignal.any([this.#H,this.#U.signal]):this.#U.signal}#q(){let $=this.#B();if($!==void 0&&$<=0)throw new I5(this.request)}async#g(){for(let $ of this.#$.hooks.beforeRequest){let Y=await $({request:this.request,options:this.#M(),retryCount:0});if(Q00(Y))this.#_(Y);else if(PH(Y))return Y}return}async#y($){let Y=this.#O($);for(let U of this.#$.hooks.afterResponse){let z=this.#v($.clone(),Y);this.#V(z);let Q;try{Q=await U({request:this.request,options:this.#M(),response:z,retryCount:this.#Q})}catch(I){if(z!==$)this.#K(z);throw this.#K($),I}if(Q instanceof pw){if(z!==$)this.#K(z);throw this.#K($),new xQ(Q.options)}let J=PH(Q)?this.#v(Q,Y):$;if(z!==$&&z!==J&&z.body!==J.body)this.#K(z);if($!==J&&$.body!==J.body)this.#K($);$=J}return $}async#h($){try{return await $()}catch(Y){return this.#E(Y,$)}}async#E($,Y){this.#Z=!1;let U=Math.min(await this.#P($),fQ),z={signal:this.#H},Q=this.#B();if(Q!==void 0){if(Q<=0)throw new I5(this.request);if(U>=Q)throw await ow(Q,z),new I5(this.request)}if(await ow(U,z),this.#q(),$ instanceof xQ&&$.customRequest){let J=new globalThis.Request($.customRequest,this.#$.signal?{signal:this.#$.signal}:void 0);this.#_(J)}for(let J of this.#$.hooks.beforeRetry){let I;try{I=await J({request:this.request,options:this.#M(),error:$,retryCount:this.#Q+1})}catch(K){if(K instanceof Error&&K!==$)this.#X.add(K);throw K}if(Q00(I)){this.#_(I);break}if(PH(I))return this.#Z=!0,this.#Q++,I;if(I===nw)return}return this.#q(),this.#Q++,this.#h(Y)}#C(){let $=this.#Z;return this.#Z=!1,$}async#R(){if(this.#U?.signal.aborted)this.#U=new globalThis.AbortController,this.#$.signal=this.#w(),this.request=new globalThis.Request(this.request,{signal:this.#$.signal});let $=re(this.#$),Y=this.#$.retry.limit>0?this.request.clone():void 0,U=this.#k(this.request,this.#$.body??void 0);if(this.#W=U,Y)this.request=Y;try{let z=this.#B();if(z!==void 0&&z<=0)throw new I5(this.request);let Q=this.#$.timeout===!1?z:z===void 0?this.#$.timeout:Math.min(this.#$.timeout,z),J=Q===void 0?await this.#$.fetch(U,$):await TS(U,$,this.#U,{timeout:Q,fetch:this.#$.fetch});return this.#v(J,U)}catch(z){if(jS(z))throw new OH(this.request,{cause:z});throw z}}#B(){if(this.#I===void 0)return;let $=this.#S()-this.#I;return Math.max(0,this.#$.totalTimeout-$)}#S(){return globalThis.performance?.now()??Date.now()}#M(){if(!this.#J){let{hooks:$,json:Y,parseJson:U,stringifyJson:z,searchParams:Q,timeout:J,totalTimeout:I,throwHttpErrors:K,fetch:G,...H}=this.#$;this.#J=Object.freeze(H)}return this.#J}#_($){this.#J=void 0,this.request=$}#O($){return this.#N.get($)??this.request}#v($,Y){return this.#N.set($,Y),$}#k($,Y){if(!this.#$.onUploadProgress||!$.body||!NS)return $;return ce($,this.#$.onUploadProgress,Y??this.#$.body??void 0)}}var vi0=10485760,hi0="The `prefixUrl` option has been renamed `prefix` in v2 and enhanced to allow slashes in input. See also the new `baseUrl` option for improved flexibility with standard URL resolution: https://github.com/sindresorhus/ky#baseurl",BH,Si0=($)=>{let Y=/;\s*charset\s*=\s*(?:"([^"]+)"|([^;,\s]+))/i.exec($),U=Y?.[1]??Y?.[2];if(U)try{return new TextDecoder(U)}catch{}return new TextDecoder},z00="The `schema` argument must follow the Standard Schema specification",gi0=($)=>{if(typeof $!=="object")return $;return{...$,...$.methods&&{methods:[...$.methods]},...$.statusCodes&&{statusCodes:[...$.statusCodes]},...$.afterStatusCodes&&{afterStatusCodes:[...$.afterStatusCodes]}}},I00,Q00=($)=>$ instanceof globalThis.Request||I00.call($)==="[object Request]",PH=($)=>$ instanceof globalThis.Response||I00.call($)==="[object Response]",yi0=($)=>{if(Array.isArray($))return $.map((Y)=>[...Y]);return uQ($)},J00=async($,Y)=>{if(typeof Y!=="object"&&typeof Y!=="function"||Y===null)throw TypeError(z00);let U=Y["~standard"];if(typeof U!=="object"||U===null||typeof U.validate!=="function")throw TypeError(z00);let z=await U.validate($);if(z.issues)throw new OS(z.issues);return z.value};var K00=m(()=>{uw();wS();MS();_e();ve();bw();ne();lw();le();oe();ae();te();U00();iY();BH=Symbol("timedOutResponseData"),I00=Object.prototype.toString});var CS=($)=>{let Y=(U,z)=>bQ.create(U,AH($,z));for(let U of cw)Y[U]=(z,Q)=>bQ.create(z,AH($,Q,{method:U}));return Y.create=(U)=>CS(AH(U)),Y.extend=(U)=>{if(typeof U==="function")U=U($??{});return CS(AH($,U))},Y.stop=nw,Y.retry=xe,Y},xi0,K5;var iQ=m(()=>{K00();iY();lw();uw();/*! MIT License © Sindre Sorhus */xi0=CS(),K5=xi0});async function G00($){if($.source.type!=="direct"&&$.source.type!=="seal")throw Error(`Unsupported Seal source: ${$.source.type}`);let Y=$.seal.url??$.source.sealUrl,U=$.source.type==="seal"?$.source:void 0;return{token:$.source.token,expiresAt:Date.now()+$.source.expiresIn*1000,enterprise:{provider:U?"seal":"direct",corpId:$.source.corpId??$.id,staffId:$.source.staffId,sealUrl:Y,tenantId:U?.tenantId,tenantSlug:$.seal.tenantSlug??U?.tenantSlug,tenantName:U?.tenantName,raw:{sourceType:$.source.type}}}}function fi0($){let Y=Object.entries($??{}).map(([U,z])=>`${U}=${z}`);return Y.length?Y.join("; "):void 0}function A6($){let Y={...$?.headers??{}},U=fi0($?.cookies);if(U)Y.Cookie=U;return Y}var H00,ui0,bi0,ii0,ci0,W00;var X00=m(()=>{A$();H00=L.object({token:L.string(),expiresAt:L.number(),url:L.string().url().optional()}),ui0=L.object({provider:L.string(),corpId:L.string().optional(),staffId:L.string(),sealUrl:L.string().url(),tenantId:L.string().optional(),tenantSlug:L.string().optional(),tenantName:L.string().optional(),raw:L.unknown().optional()}),bi0=L.object({token:L.string(),expiresAt:L.number(),enterprise:ui0}),ii0=L.object({openapi:H00.optional(),closeapi:H00.optional()}),ci0=L.object({seal:bi0.optional(),hose:ii0.optional()}),W00=L.record(L.string(),ci0)});import{existsSync as RS,mkdirSync as ni0,readFileSync as pi0,writeFileSync as di0}from"node:fs";import{dirname as mi0,join as q00}from"node:path";import{homedir as V00}from"node:os";function li0(){let $=(process.env.SEAL_USE_TOKEN_STORE??process.env.SEAL_HOME_TOKEN_STORE)?.trim();if($)return $;if(RS(rw))return rw;if(RS(Z00))return Z00;return rw}function oi0(){let $=(process.env.SEAL_USE_TOKEN_STORE??process.env.SEAL_HOME_TOKEN_STORE)?.trim();if($)return $;return rw}function cQ(){let $=li0();if(!RS($))return{};try{return W00.parse(JSON.parse(pi0($,"utf-8")))}catch{return{}}}function sw($){let Y=oi0();ni0(mi0(Y),{recursive:!0,mode:448}),di0(Y,JSON.stringify($,null,2),{mode:384})}function L00($){return cQ()[$]?.seal}function F00($,Y){let U=cQ();sw({...U,[$]:{...U[$],seal:Y}})}function w00($){let Y=cQ(),U=Y[$];if(!U)return;sw({...Y,[$]:{...U,seal:void 0}})}function TH($){return cQ()[$]?.hose??{}}function _S($,Y){let U=cQ();sw({...U,[$]:{...U[$],hose:Y}})}function aw($){let Y=cQ();delete Y[$],sw(Y)}var rw,Z00;var jH=m(()=>{X00();rw=q00(V00(),".config","seal-use","seal_tokens.json"),Z00=q00(V00(),".config","seal-home","seal_tokens.json")});function B$($){return $.replace(/\/+$/,"")}function N00($){let Y;try{Y=new URL($.trim())}catch{throw Error("Invalid Hose assistance link: expected a valid HTTPS URL")}if(Y.protocol!=="https:"||Y.port||!ti0(Y.hostname)||Y.pathname.replace(/\/+$/,"")!==ai0)throw Error("Invalid Hose assistance link: expected an HTTPS */web/thirdparty.html URL from ekuaibao.com or hosecloud.com");let U=Y.searchParams.getAll("accessToken").filter(Boolean),z=Y.searchParams.getAll("ekbCorpId").filter(Boolean);if(U.length!==1||z.length!==1)throw Error("Invalid Hose assistance link: accessToken and ekbCorpId are required exactly once");let Q=z[0].trim().toLowerCase();if(!O00.test(Q))throw Error("Invalid Hose assistance link: ekbCorpId is not a valid tenant slug");return{corpId:Q,accessToken:U[0],baseUrl:Y.origin}}async function tw($,Y){let U=typeof $==="string"?N00($):D00($),z=`https://${U.corpId}.sealai.cc`,J=await T8(z,void 0,Y?.customHeaders).get("api/auth/oauth2/session/oem-hosecloud",{searchParams:{token:U.accessToken,returnToken:"1"}}).json(),I=J.token??J.accessToken??J.data?.token??J.data?.accessToken;if(!I)throw Error("Seal SSO did not return a bearer token");let K=J.expiresIn??J.expires_in??J.data?.expiresIn??J.data?.expires_in??3600;return{corpId:U.corpId,sealUrl:z,token:I,expiresIn:Number.isFinite(K)&&K>0?K:3600}}function ew($,Y){let U=Y.hoseCorpConfig&&typeof Y.hoseCorpConfig==="object"?Y.hoseCorpConfig:void 0,z=[Y.tenantSlug,U?.corporationId].filter((I)=>typeof I==="string"&&Boolean(I)),Q=$.trim().toLowerCase(),J=z.map((I)=>I.trim().toLowerCase()).filter(Boolean);if(J.length===0||J.some((I)=>I!==Q))throw Error("Hose assistance link tenant mismatch: the Seal tenant does not match ekbCorpId")}function ti0($){let Y=$.toLowerCase();return si0.some((U)=>Y.endsWith(U))}function D00($){let Y=typeof $?.corpId==="string"?$.corpId.trim().toLowerCase():"",U=typeof $?.accessToken==="string"?$.accessToken.trim():"",z=typeof $?.baseUrl==="string"&&$.baseUrl.trim()?$.baseUrl.trim():void 0;if(!O00.test(Y)||!U)throw Error("Invalid Hose assistance link: accessToken and ekbCorpId are required");return{corpId:Y,accessToken:U,...z?{baseUrl:z}:{}}}function A00($,Y=60){return Boolean($&&Date.now()<$.expiresAt-Y*1000)}function v7($,Y){if($.seal.url)return $.seal.url;if(Y.sealUrl)return Y.sealUrl;return`https://${Y.corpId.toLowerCase()}.sealai.cc`}function ei0($){return $.staffId.includes(":")?$.staffId:`${$.corpId}:${$.staffId}`}function B00($){return K5.create({prefix:B$($.domain),timeout:30000,hooks:{beforeError:[async({error:Y})=>{let U=Y instanceof D6?await Y.response.text().catch(()=>""):"";return Y.message=`${Y.message}${U?`: ${U}`:""}`,Y}]}})}async function $c0($){let Y=B00($),U=$.appKey??$.key,z=$.appSecurity??$.password;if(!U||!z)throw Error("Hose source requires appKey/key and appSecurity/password");let Q=await Y.post("api/openapi/v1/auth/getAccessToken",{json:{appKey:U,appSecurity:z}}).json(),J=Q.value?.accessToken??Q.accessToken??Q.token;if(!J)throw Error("Hose login did not return an access token");return{token:J,expiresAt:Date.now()+3600000}}async function nQ($){if($.source.type!=="hose")throw Error(`Unsupported Seal source: ${$.source.type}`);let Y=TH($.id);if(A00(Y.openapi))return Y.openapi.token;let U=vS.get($.id);if(U)return U;let z=$c0($.source).then((Q)=>{return _S($.id,{...TH($.id),openapi:Q}),Q.token}).finally(()=>vS.delete($.id));return vS.set($.id,z),z}async function $M($,Y,U=7200){let z=B00($),Q=ei0($),I=(await z.post("api/openapi/v1.1/provisional/getProvisionalAuth",{searchParams:{accessToken:Y},json:{uid:Q,pageType:"home",expireDate:U}}).json()).value?.message;if(!I)throw Error("Hose CloseAPI did not return a provisional auth URL");let K=new URL(I).searchParams.get("accessToken");if(!K)throw Error("Hose provisional auth URL did not include accessToken");return{token:K,url:I,expiresAt:Date.now()+U*1000}}async function YM($){if($.source.type!=="hose")throw Error(`Unsupported Seal source: ${$.source.type}`);let Y=$.source,U=TH($.id);if(A00(U.closeapi)&&U.closeapi.url)return U.closeapi;let z=hS.get($.id);if(z)return z;let Q=nQ($).then((J)=>$M(Y,J)).then((J)=>{return _S($.id,{...TH($.id),closeapi:J}),J}).finally(()=>hS.delete($.id));return hS.set($.id,Q),Q}async function P00($,Y=7200,U){if($.source.type!=="hose")throw Error(`Unsupported Seal source: ${$.source.type}`);if(!Number.isFinite(Y)||Y<=0)throw Error(`Invalid expire seconds: ${Y}. Must be a positive integer.`);let z=await nQ($),Q=await $M($.source,z,Y);if(!Q.url)throw Error("Hose provisional auth URL was not available");return{corpId:$.source.corpId,staffId:$.source.staffId,url:Q.url,token:Q.token,expiresIn:Y}}async function T00($){if($.source.type!=="hose")throw Error(`Unsupported Seal source: ${$.source.type}`);let Y=await YM($),U=v7($,$.source),z=A6($.seal),J=await T8(U,void 0,z).get("api/auth/oauth2/session/oem-hosecloud",{searchParams:{token:Y.token,returnToken:"1"}}).json(),I=J.token??J.accessToken??J.data?.token??J.data?.accessToken;if(!I)throw Error("Seal SSO did not return a bearer token");let K=J.expiresIn??J.expires_in??J.data?.expiresIn??J.data?.expires_in??3600,G={provider:"hose",corpId:$.source.corpId,staffId:$.source.staffId,sealUrl:B$(U),tenantSlug:$.seal.tenantSlug,raw:{sourceType:"hose",hoseDomain:B$($.source.domain)}};return{token:I,expiresAt:Date.now()+K*1000,enterprise:G}}async function pQ($,Y,U){if(U){let I=B$(U),K=await M00(I,$,Y);if(!K)throw Error(`Failed to authenticate on specified domain: ${I}. Please verify appKey/appSecurity and domain connectivity.`);return K}let z=ri0.map(async(I)=>{try{return await M00(I,$,Y)}catch{return}}),J=(await Promise.all(z)).filter((I)=>Boolean(I));if(J.length>0&&J[0])return J[0];throw Error("Failed to authenticate with appKey/appSecurity on all 6 standard Hose domains (app.ekuaibao.com, dd2.hosecloud.com, wx2.ekuaibao.com, kdcloud2.ekuaibao.com, ddenterprise.ekuaibao.com, feishu.ekuaibao.com). "+'If your enterprise uses a private cloud or custom domain (such as 美年大健康), please specify the "domain" parameter explicitly.')}async function M00($,Y,U){try{let z=await fetch(`${$}/api/openapi/v1/auth/getAccessToken`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({appKey:Y,appSecurity:U}),signal:AbortSignal.timeout(8000)});if(!z.ok)return;let Q=await z.json();if(Q.value?.errorCode)return;let J=Q.value?.accessToken??Q.accessToken,I=Q.value?.corporationId??Q.value?.corporation?.id;if(!J||!I)return;return{domain:$,corpId:I,corpName:Q.value?.corporation?.name,openapiToken:J,expireTime:Q.value?.expireTime}}catch{return}}async function UM($,Y){let U=`${B$($)}/api/openapi/v1/roleDefGroups?accessToken=${encodeURIComponent(Y)}`,z=await fetch(U,{headers:{"content-type":"application/json",Accept:"application/json"},signal:AbortSignal.timeout(1e4)});if(!z.ok){let I=await z.text().catch(()=>"");throw Error(`Failed to fetch Hose role definition groups: ${z.status} ${I}`)}return((await z.json()).items??[]).map((I)=>({id:I.id,name:I.name,enName:I.enName,roleDefs:(I.roleDefs??[]).map((K)=>({id:K.id,name:K.name,enName:K.enName,sourceType:K.sourceType,sourceTypeValue:K.sourceTypeValue,groupId:I.id,groupName:I.name}))}))}async function SS($,Y,U,z="id"){let Q=U.startsWith("$")?U.slice(1):U,J=`${B$($)}/api/openapi/v1/roledefs/$${Q}?accessToken=${encodeURIComponent(Y)}&staffBy=${encodeURIComponent(z)}&pathType=name`,I=await fetch(J,{headers:{"content-type":"application/json",Accept:"application/json"},signal:AbortSignal.timeout(1e4)});if(!I.ok){let W=await I.text().catch(()=>"");throw Error(`Failed to fetch Hose role staffs for ${Q}: ${I.status} ${W}`)}let G=(await I.json()).value;if(!G)throw Error(`Hose role staff query returned empty result for ${Q}`);let H=[];for(let W of G.contents??[])for(let X of W.staffs??[])if(X&&!H.includes(X))H.push(X);return{id:G.id??Q,name:G.name??"",count:G.count??H.length,staffs:H}}async function gS($,Y,U){if(U.length===0)return[];let z=`${B$($)}/api/openapi/v1/staffs/getStaffIds?accessToken=${encodeURIComponent(Y)}`,Q=await fetch(z,{method:"POST",headers:{"content-type":"application/json",Accept:"application/json"},body:JSON.stringify({type:"STAFFID",conditionIds:U.slice(0,100)}),signal:AbortSignal.timeout(1e4)});if(!Q.ok){let I=await Q.text().catch(()=>"");throw Error(`Failed to fetch Hose staff details: ${Q.status} ${I}`)}return(await Q.json()).items??[]}function yS($){if(!$)return"-";if($.length<=12)return"******";return`${$.slice(0,8)}...${$.slice(-4)}`}async function Yc0($){let Y=typeof $==="string"?N00($):D00($),U=Y.baseUrl||"https://app.ekuaibao.com",z,Q,J,I,K,G={accesstoken:Y.accessToken,corpid:Y.corpId};try{let H=await K5.get(`${U}/api/engine/realm/$UNITY/actions/jwt`,{searchParams:{corpId:Y.corpId},headers:G,timeout:1e4}).json(),W=H.id||H.value;if(W){let X=W.split(".");if(X.length>=2){let Z=X[1].replace(/-/g,"+").replace(/_/g,"/"),q=JSON.parse(Buffer.from(Z,"base64").toString("utf-8"));if(typeof q.staffId==="string")z=q.staffId;if(typeof q.corporationName==="string")Q=q.corporationName;if(typeof q.staffName==="string")J=q.staffName;if(typeof q.cellphone==="string")K=q.cellphone;if(q.isAdmin!==void 0)I=q.isAdmin===!0||q.isAdmin==="true"}}}catch{}if(!z||!Q)try{let W=(await K5.get(`${U}/api/account/v2/session`,{headers:{...G,...z?{staffid:z}:{}},timeout:1e4}).json())?.value;if(W){if(!z&&W.loginStaffId)z=W.loginStaffId;if(!Q&&W.corporationName)Q=W.corporationName;if(!J&&W.privilege)J=W.privilege}}catch{}if(!z)z=`${Y.corpId}:admin`;return{corpId:Y.corpId,baseUrl:U,accessToken:Y.accessToken,staffId:z,corpName:Q,staffName:J,isAdmin:I,cellphone:K}}async function kS($){let Y=await Yc0($),U={accesstoken:Y.accessToken,corpid:Y.corpId,staffid:Y.staffId},z;try{z=await(await K5.get(`${Y.baseUrl}/api/innerapi/v1/key`,{searchParams:{corpId:Y.corpId},headers:U,timeout:15000})).json()}catch(I){let K=I instanceof Error?I.message:String(I);throw Error(`Failed to query Hose OpenAPI keys from assistance link: ${K}`)}let Q=z.items??[],J=[];for(let I of Q)if(typeof I==="object"&&I!==null){let K=I;if(typeof K.appKey==="string"&&typeof K.appSecurity==="string")J.push({id:String(K.id??K.appKey),name:typeof K.name==="string"?K.name:void 0,appKey:K.appKey,appSecurity:K.appSecurity,active:typeof K.active==="boolean"?K.active:!0,corporationId:typeof K.corporationId==="string"?K.corporationId:Y.corpId,createTime:typeof K.createTime==="number"?K.createTime:void 0,updateTime:typeof K.updateTime==="number"?K.updateTime:void 0})}return{corpId:Y.corpId,corpName:Y.corpName,baseUrl:Y.baseUrl,staffId:Y.staffId,keys:J}}var ri0,si0,ai0="/web/thirdparty.html",O00,vS,hS;var t9=m(()=>{iQ();i8();jH();ri0=["https://app.ekuaibao.com","https://dd2.hosecloud.com","https://wx2.ekuaibao.com","https://kdcloud2.ekuaibao.com","https://ddenterprise.ekuaibao.com","https://feishu.ekuaibao.com"],si0=[".ekuaibao.com",".hosecloud.com"],O00=/^[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?$/,vS=new Map,hS=new Map});function j00($,Y){return Date.now()>=$.expiresAt-Y*1000}async function Uc0($){switch($.source.type){case"hose":return T00($);case"direct":case"seal":return G00($)}}async function QM($){let Y=$.auth.refreshTtl,U=zM.get($.id);if(U&&!j00(U,Y))return U;let z=L00($.id);if(z&&!j00(z,Y))return zM.set($.id,z),z;let Q=await Uc0($);return zM.set($.id,Q),F00($.id,Q),Q}async function E00($){return(await QM($)).enterprise}function C00($){zM.delete($),w00($)}var zM;var xS=m(()=>{t9();jH();zM=new Map});var _00={};x8(_00,{createSealClientForUrl:()=>T8,createSealClientForToken:()=>fS,createSealClient:()=>B1});function zc0($){if($===void 0||$===null||$==="")return"";if(typeof $==="string")return $;try{return JSON.stringify($)}catch{return String($)}}function Qc0($){if(!($ instanceof D6))return $;let Y=zc0($.data);if(Y)$.message=`${$.message}: ${Y}`;return $}function R00($){return async({error:Y})=>{if($&&Y instanceof D6&&Y.response.status===401)C00($);return Qc0(Y)}}async function B1($){let Y=await QM($);return K5.create({prefix:Y.enterprise.sealUrl,timeout:30000,headers:{...A6($.seal),Authorization:`Bearer ${Y.token}`},hooks:{beforeError:[R00($.id)]}})}async function fS($,Y){let U=await QM($);return T8(U.enterprise.sealUrl,Y,A6($.seal))}function T8($,Y,U={}){let z={...U};if(Y)z.Authorization=`Bearer ${Y}`;return K5.create({prefix:$.replace(/\/+$/,""),timeout:30000,headers:z,hooks:{beforeError:[R00()]}})}var i8=m(()=>{iQ();xS()});var EH;var v00=m(()=>{EH={name:"seal-use",version:"0.10.32",private:!0,description:"Seal tenant operations toolkit: approval-run diagnosis, rule remediation, Hose/合思 auth, plus a CLI and an optional MCP server.",license:"MIT",author:{name:"yingqing"},repository:{type:"git",url:"git+https://github.com/yunyingk/seal-use.git"},type:"module",module:"src/server.ts",bin:{"seal-use":"src/cli.ts","seal-home":"src/cli.ts"},packageManager:"bun@1.3.14",engines:{bun:">=1.3.14"},scripts:{dev:"bun run --watch src/server.ts",start:"bun run src/server.ts",probe:"bun run src/probe.ts",cli:"bun run src/cli.ts",check:"tsc --noEmit","build:binary":"node scripts/build-binary.mjs","build:plugin":"node scripts/build-plugin.mjs",bump:"bun run scripts/bump-version.ts","dev:override":"bun run scripts/dev-override.ts","dev:link":"bun run scripts/dev-override.ts","openapi:bundle":"bun run scripts/bundle-openapi.ts","openapi:raw":"bun run scripts/generate-raw-openapi.ts",test:"bun test",prepare:"git config core.hooksPath .githooks"},dependencies:{"@modelcontextprotocol/server":"^2.0.0",archiver:"^8.0.0",exceljs:"^4.4.0","iconv-lite":"^0.7.3",ky:"^2.0.2","pinyin-pro":"^3.29.3",yauzl:"^3.4.0",zod:"^4.4.3"},devDependencies:{"@modelcontextprotocol/client":"^2.0.0","@types/archiver":"^8.0.0","@types/bun":"^1.3.14","@types/yauzl":"^3.4.0","bun-types":"^1.3.14",typescript:"^5.9.3",yaml:"^2.9.0"}}});import{spawnSync as h00}from"node:child_process";function Ic0($,Y=EH.version){let U=$.trim();if(!U)return null;let z=U.endsWith("-dirty"),Q=z?U.slice(0,-6):U,J=Q.match(/^v?(\d+\.\d+\.\d+(?:-[a-zA-Z0-9.]+)?)-(\d+)-g([0-9a-f]+)$/);if(J&&J[1]&&J[2]&&J[3])return{baseVersion:J[1],commitsAhead:Number.parseInt(J[2],10),commit:J[3],dirty:z,describe:U};let I=Q.match(/^v?(\d+\.\d+\.\d+(?:-[a-zA-Z0-9.]+)?)$/);if(I&&I[1])return{baseVersion:I[1],commitsAhead:0,commit:"",dirty:z,describe:U};let K=Q.match(/^([0-9a-f]{7,40})$/);if(K&&K[1])return{baseVersion:Y,commitsAhead:0,commit:K[1],dirty:z,describe:U};return null}function Kc0($,Y,U,z){let J=U?`+g${U}${z?".dirty":""}`:z?"+dirty":"";return`${$}-dev.${Y}${J}`}function Gc0($){let Y=$?.env,U=Y?.SEAL_BUILD_VERSION??process.env.SEAL_BUILD_VERSION,z=Y?.SEAL_BUILD_IS_RELEASE??process.env.SEAL_BUILD_IS_RELEASE,Q=Y?.SEAL_BUILD_CHANNEL??process.env.SEAL_BUILD_CHANNEL,J=Y?.SEAL_BUILD_GIT_BASE??process.env.SEAL_BUILD_GIT_BASE,I=Y?.SEAL_BUILD_GIT_COMMITS_AHEAD??process.env.SEAL_BUILD_GIT_COMMITS_AHEAD,K=Y?.SEAL_BUILD_GIT_COMMIT??process.env.SEAL_BUILD_GIT_COMMIT,G=Y?.SEAL_BUILD_GIT_DIRTY??process.env.SEAL_BUILD_GIT_DIRTY,H=Y?.SEAL_BUILD_GIT_DESCRIBE??process.env.SEAL_BUILD_GIT_DESCRIBE,W=Y?.SEAL_FORCE_RELEASE??process.env.SEAL_FORCE_RELEASE,X=$?.cwd;if(U){let Z=z==="true",V={name:"seal-use",version:U,channel:Q||(Z?"release":"dev"),isRelease:Z};if(J)V.git={baseVersion:J,commitsAhead:Number.parseInt(I||"0",10),commit:K||"",dirty:G==="true",describe:H||U};return V}if(z==="true"||W==="1")return{name:"seal-use",version:EH.version,channel:"release",isRelease:!0};try{let Z=h00("git",["describe","--tags","--long","--dirty","--always"],{cwd:X,encoding:"utf8",stdio:["ignore","pipe","ignore"]});if(Z.status===0&&Z.stdout){let q=Ic0(Z.stdout.trim(),EH.version);if(q){if(!q.commit){let F=h00("git",["rev-parse","--short","HEAD"],{cwd:X,encoding:"utf8",stdio:["ignore","pipe","ignore"]});if(F.status===0&&F.stdout)q.commit=F.stdout.trim()}return{name:"seal-use",version:Kc0(q.baseVersion,q.commitsAhead,q.commit,q.dirty),channel:"dev",isRelease:!1,git:q}}}}catch{}return{name:"seal-use",version:`${EH.version}-dev.0+local`,channel:"dev",isRelease:!1}}var cY,P1,uS,hc1;var e9=m(()=>{v00();cY=Gc0(),P1=cY.version,uS=cY.isRelease,hc1=cY.channel});function dQ($=void 0){return iS.parse($??{})}function y00($,Y){return dQ({...dQ($),...Y})}var S00,bS,g00,iS,cS;var mQ=m(()=>{A$();S00=[".pdf",".xls",".xlsx",".csv",".doc",".docx",".ppt",".pptx",".txt",".rtf",".odt",".ods",".odp",".jpg",".jpeg",".png",".gif",".bmp",".webp",".heic",".eml",".msg"],bS={minFileSizeBytes:500,allowedExtensions:[...S00]},g00=L.string().trim().min(1).transform(($)=>{let Y=$.toLowerCase();return Y.startsWith(".")?Y:`.${Y}`}).refine(($)=>/^\.[a-z0-9][a-z0-9+_-]*$/.test($),{message:"文件后缀必须是简单扩展名,例如 .pdf 或 xlsx"}),iS=L.object({minFileSizeBytes:L.number().int().min(0).default(bS.minFileSizeBytes),maxFileSizeBytes:L.number().int().positive().nullable().optional(),allowedExtensions:L.array(g00).min(1).default([...S00]).transform(($)=>[...new Set($)])}).superRefine(($,Y)=>{if($.maxFileSizeBytes!==void 0&&$.maxFileSizeBytes!==null&&$.maxFileSizeBytes<$.minFileSizeBytes)Y.addIssue({code:"custom",path:["maxFileSizeBytes"],message:"最大文件大小不能小于最小文件大小"})}),cS=L.object({minFileSizeBytes:L.number().int().min(0).optional(),maxFileSizeBytes:L.number().int().positive().nullable().optional(),allowedExtensions:L.array(g00).min(1).transform(($)=>[...new Set($)])}).optional()});var Hc0,Wc0,Xc0,Zc0,x00,qc0,Vc0,f00,JM,u00,Lc0,IM,b00,RH,i00,Fc0,wc0,Mc0,k00,_H,c00,Oc0,Nc0,KM,nS,n00,p00,d00,m00,GM,l00,pS,dS,o00,r00,Dc0,s00,Ac0,a00,CH,t00,e00,$10,Y10,U10,z10,Q10,J10,I10,K10,G10,Bc0,H10,Pc0,Tc0,jc0,mS,lS,Ec0,W10,X10,Z10,q10,Cc0,oS,fc1,uc1,V10,bc1;var rS=m(()=>{A$();mQ();Hc0=L.object({staffId:L.string(),name:L.string().optional(),code:L.string().default(""),bindTime:L.number().optional()}),Wc0=L.object({id:L.string(),tenantId:L.string(),name:L.string(),isAdmin:L.boolean().default(!1),permissions:L.array(L.string()).default([]),providerUserId:L.string().optional(),hosecloudStaff:Hc0.optional()}),Xc0=L.object({apiKey:L.string().optional(),corporationId:L.string().optional(),corporationName:L.string().optional()}),Zc0=L.object({id:L.string(),name:L.string(),tenantSlug:L.string().optional(),isDemo:L.boolean().default(!1),logoUrl:L.string().nullable().optional(),hoseCorpConfig:Xc0.optional()}),x00=L.object({user:Wc0,tenant:Zc0}),qc0=L.object({id:L.string(),name:L.string(),email:L.string().nullable().optional(),emailVerified:L.boolean().optional(),image:L.string().nullable().optional(),tenantId:L.string().optional(),provider:L.string().optional(),providerUserId:L.string().optional(),mobile:L.string().nullable().optional(),status:L.string().optional(),permissions:L.array(L.string()).default([]),isAdmin:L.boolean().default(!1),hosecloudStaff:L.unknown().optional()}).passthrough(),Vc0=L.object({id:L.string(),token:L.string().optional(),expiresAt:L.string(),createdAt:L.string().optional(),updatedAt:L.string().optional(),ipAddress:L.string().optional(),userAgent:L.string().optional(),userId:L.string(),delegationId:L.string().nullable().optional()}).passthrough(),f00=L.object({user:qc0,session:Vc0}),JM=L.object({id:L.string(),tenantId:L.string().optional(),code:L.union([L.number(),L.string()]).optional(),description:L.string(),scope:L.string(),strictness:L.string(),status:L.string().optional(),createdAt:L.number().optional(),updatedAt:L.number().optional()}),u00=L.object({rules:L.array(JM),hasPendingDeletes:L.boolean().default(!1)}),Lc0=L.object({code:L.string().optional(),description:L.string(),scope:L.string(),strictness:L.string()}),IM=L.object({id:L.string(),tenantId:L.string().optional(),versionNumber:L.number(),versionName:L.string().nullable().optional(),publishedBy:L.string().nullable().optional(),publishedByName:L.string().nullable().optional(),rules:L.array(Lc0).default([]),publishedAt:L.number().optional(),createdAt:L.number().optional()}),b00=L.object({version:IM,rulesCount:L.number()}),RH=L.object({id:L.string(),tenantId:L.string().optional(),title:L.string(),purpose:L.string().default(""),contentType:L.string().default("policy"),content:L.string(),status:L.string().default("published"),enabled:L.boolean().default(!0),scenarios:L.array(L.string()).default([]),tags:L.array(L.string()).default([]),category:L.string().nullable().optional(),categoryTags:L.array(L.string()).default([]),createdBy:L.string().nullable().optional(),createdByName:L.string().nullable().optional(),createdAt:L.number().optional(),updatedAt:L.number().optional(),updatedBy:L.string().nullable().optional(),updatedByName:L.string().nullable().optional(),isDeleted:L.boolean().default(!1)}),i00=L.object({articles:L.array(RH),total:L.number().optional()}),Fc0=L.object({explicitApprove:L.string().default(""),explicitReject:L.string().default(""),exemptApprove:L.string().default(""),review:L.string().default("")}).passthrough(),wc0=L.object({type:L.string(),signKey:L.string().optional(),outboundName:L.string().optional(),mode:L.string().optional(),autoApprovalRate:L.number().optional(),apiKey:L.string().optional(),apiSecret:L.string().optional(),apiOrigin:L.string().optional(),corporationId:L.string().optional(),ebotSignKey:L.string().optional(),completionSignKey:L.string().optional(),outboundMessageId:L.string().optional(),completionMessageId:L.string().optional()}).passthrough(),Mc0=L.enum(["assisted","semi_automatic","fully_automatic"]),k00=L.object({id:L.string(),url:L.string().url()}).passthrough(),_H=L.object({type:L.literal("webhook"),id:L.string(),name:L.string(),mode:Mc0,incomingDocumentWebhook:k00,outgoingResultWebhook:L.string().url(),incomingManualResultWebhook:k00,secret:L.string().min(1),autoApprovalRate:L.number().int().min(0).max(100).optional(),materialPackFilePolicy:iS.default(bS)}).passthrough(),c00=L.object({id:L.string().optional(),tenantId:L.string().optional(),tone:L.string().optional(),language:L.string().optional(),detailLevel:L.string().optional(),outputFormat:L.string().optional(),examples:L.array(L.string()).default([]),prohibitedPhrases:L.array(L.string()).default([]),customInstructions:L.string().optional(),updatedAt:L.number().optional(),decisionPreferences:Fc0.optional(),integrationSystem:L.string().optional(),integrations:L.array(wc0).default([])}).passthrough(),Oc0=L.object({id:L.string().optional(),sn:L.string().optional(),title:L.string().optional(),name:L.string().optional(),fields:L.array(L.unknown()).optional()}).passthrough(),Nc0=L.object({_langfuseTraceId:L.string().optional(),simulation_batch_id:L.string().optional()}).passthrough(),KM=L.object({id:L.string(),tenantId:L.string().optional(),agentId:L.string().optional(),status:L.string().optional(),taskMode:L.string().optional(),finalExecutionMode:L.string().optional(),sourceSystem:L.string().optional(),sourceDocumentSN:L.string().optional(),sourceDocumentId:L.string().optional(),documentId:L.string().optional(),document:Oc0.optional(),result:L.unknown().optional(),pipelineData:L.unknown().optional(),sourceExtendData:Nc0.optional(),ruleSetVersionNumber:L.number().optional(),ruleSetPublishedAt:L.number().optional(),ruleSetPublishedByName:L.string().optional(),createdAt:L.union([L.string(),L.number()]).optional(),updatedAt:L.union([L.string(),L.number()]).optional()}).passthrough(),nS=L.object({records:L.array(KM).default([]),total:L.number().optional(),page:L.number().optional(),pageSize:L.number().optional()}).passthrough(),n00=L.object({id:L.string(),expiresAt:L.number().nullable().optional(),revokedAt:L.number().nullable().optional(),createdAt:L.number().nullable().optional(),lastUsedAt:L.number().nullable().optional(),useCount:L.number().default(0),note:L.string().nullable().optional(),link:L.string()}).passthrough(),p00=L.object({id:L.string(),token:L.string(),link:L.string()}).passthrough(),d00=L.object({userId:L.string(),password:L.string()}).passthrough(),m00=L.object({password:L.string()}).passthrough(),GM=L.object({_id:L.string(),tenantId:L.string().optional(),name:L.string(),mobile:L.string().optional(),email:L.string().optional(),departmentIds:L.array(L.string()).default([]),status:L.string().optional(),permissions:L.array(L.string()).default([]),createdAt:L.string().optional(),updatedAt:L.string().optional()}).passthrough(),l00=L.object({departments:L.array(L.record(L.string(),L.unknown())).default([]),users:L.array(GM).default([])}).passthrough(),pS=L.object({_id:L.string(),tenantId:L.string().optional(),name:L.string().optional(),parentId:L.string().nullable().optional(),ancestors:L.array(L.string()).default([]),provider:L.string().optional(),permissions:L.array(L.string()).default([]),isDeleted:L.boolean().optional(),syncedAt:L.string().optional(),createdAt:L.string().optional(),updatedAt:L.string().optional()}).passthrough(),dS=L.object({items:L.array(pS).default([])}).passthrough(),o00=L.object({items:L.array(GM).default([])}).passthrough(),r00=L.object({lastSyncTime:L.union([L.string(),L.number(),L.null()])}).passthrough(),Dc0=L.object({tagId:L.string().optional(),tagName:L.string().optional(),tagPath:L.string().optional(),count:L.number().default(0),avgConfidence:L.number().default(0),errorCount:L.number().default(0),warningCount:L.number().default(0)}).passthrough(),s00=L.object({tagStats:L.array(Dc0).default([]),totalRisks:L.number().default(0),analyzedRisks:L.number().default(0),pendingRisks:L.number().default(0)}).passthrough(),Ac0=L.object({riskId:L.string().optional(),recordId:L.string().optional(),riskDetails:L.string().default(""),riskLevel:L.string().default("warning"),documentType:L.string().default(""),documentSN:L.string().default(""),sourceSystem:L.string().default(""),sourceDocumentURL:L.string().nullable().optional(),confidence:L.number().default(0),reasoning:L.string().default(""),createdAt:L.union([L.string(),L.number(),L.date()]).optional()}).passthrough(),a00=L.object({tagId:L.string(),tagName:L.string().default(""),tagPath:L.string().default(""),tagDescription:L.string().default(""),risks:L.array(Ac0).default([]),total:L.number().default(0)}).passthrough(),CH=L.object({value:L.number().default(0),trend:L.number().default(0)}).passthrough(),t00=L.object({metrics:L.object({approvalCount:CH.optional(),accuracy:CH.optional(),automationRate:CH.optional(),riskCount:CH.optional(),avgDuration:CH.optional()}).passthrough().default({}),sankeyData:L.object({nodes:L.array(L.object({id:L.string()}).passthrough()).default([]),links:L.array(L.object({source:L.string(),target:L.string(),value:L.number().default(0)}).passthrough()).default([])}).passthrough().default({nodes:[],links:[]})}).passthrough(),e00=L.record(L.string(),L.unknown()),$10=L.object({expenses:L.array(e00).default([]),total:L.number().optional()}).passthrough(),Y10=L.object({invoices:L.array(e00).default([]),total:L.number().optional(),feishuApprovalAppId:L.string().nullable().optional()}).passthrough(),U10=L.record(L.string(),L.unknown()),z10=L.object({provider:L.string(),config:L.record(L.string(),L.unknown()).default({})}).passthrough(),Q10=L.object({id:L.string(),name:L.string(),description:L.string().optional(),available:L.boolean().default(!0),fields:L.array(L.record(L.string(),L.unknown())).default([])}).passthrough(),J10=L.object({permissions:L.array(L.object({key:L.string(),name:L.string(),description:L.string().optional()}).passthrough()).default([])}).passthrough(),I10=L.object({configs:L.array(L.record(L.string(),L.unknown())).default([])}).passthrough(),K10=L.object({subscriptions:L.array(L.record(L.string(),L.unknown())).default([]),features:L.array(L.record(L.string(),L.unknown())).default([])}).passthrough(),G10=L.object({key:L.string(),type:L.string(),label:L.string(),column:L.string(),mask:L.string().optional()}).passthrough(),Bc0=L.object({columns:L.array(G10).default([]),fieldKey:L.string().optional(),keyColumn:L.string().optional(),sheetName:L.string().optional(),fieldLabel:L.string().optional()}).passthrough(),H10=L.object({id:L.string().optional(),listSheets:L.array(Bc0).default([]),mainColumns:L.array(G10).default([]),workbookName:L.string().optional(),mainKeyColumn:L.string().optional(),mainSheetName:L.string().optional(),titleColumn:L.string().optional(),statusColumn:L.string().optional(),applicationDateColumn:L.string().optional(),updatedDateColumn:L.string().optional(),attachmentFieldKey:L.string().optional(),attachmentFieldLabel:L.string().optional()}).passthrough(),Pc0=L.object({approvalCode:L.string(),nodeId:L.string().optional(),flowIds:L.array(L.string()).max(100).optional(),limit:L.number().int().positive().max(100).optional(),dataCollectionMode:L.string().optional(),signKey:L.string().optional(),rejectNodeName:L.string().nullable().optional(),skipInvoiceGeneration:L.boolean().optional(),skipExpenseExtraction:L.boolean().optional(),disableAttachmentCache:L.boolean().optional(),thinkingDepthOverride:L.enum(["default","medium","high"]).optional(),startTime:L.number().optional(),endTime:L.number().optional(),templateId:L.string().optional(),packageIds:L.array(L.string()).optional(),packageLabel:L.string().optional(),runMode:L.string().optional(),schemaConfig:H10.optional()}).passthrough(),Tc0=L.object({mode:L.string().optional(),conditions:L.array(L.object({label:L.string(),value:L.string()}).passthrough()).default([])}).passthrough(),jc0=L.object({kind:L.string().optional(),stage:L.string().optional(),code:L.string().optional(),message:L.string().optional()}).passthrough(),mS=L.object({id:L.string(),tenantId:L.string().optional(),approvalCode:L.string().optional(),nodeId:L.string().optional(),sourceSystem:L.string().optional(),status:L.string().optional(),totalCount:L.number().default(0),processedCount:L.number().default(0),successCount:L.number().default(0),failedCount:L.number().default(0),createdCount:L.number().default(0),createFailedCount:L.number().default(0),params:Pc0.optional(),requestSummary:Tc0.nullable().optional(),resultSummary:jc0.nullable().optional(),createdAt:L.union([L.string(),L.number()]).optional(),updatedAt:L.union([L.string(),L.number()]).optional()}).passthrough(),lS=L.object({batchId:L.string()}).passthrough(),Ec0=L.object({dataCollectionMode:L.string().optional(),flowIds:L.array(L.string()).max(100).optional(),rejectNodeName:L.string().nullable().optional(),skipInvoiceGeneration:L.boolean().optional(),skipExpenseExtraction:L.boolean().optional()}).passthrough(),W10=L.object({id:L.string(),tenantId:L.string().optional(),name:L.string().optional(),description:L.string().optional(),approvalSystem:L.string().optional(),hosecloudConfig:Ec0.optional(),createdAt:L.union([L.string(),L.number()]).optional(),updatedAt:L.union([L.string(),L.number()]).optional()}).passthrough(),X10=L.object({hasFeishu:L.boolean().default(!1),hasHosecloud:L.boolean().default(!1),hasWeaver:L.boolean().default(!1),hasHelios:L.boolean().default(!1),hasMaycur:L.boolean().default(!1),hasMaycurStandard:L.boolean().default(!1)}).passthrough(),Z10=L.object({signKey:L.string().optional(),displayName:L.string().optional(),corporationId:L.string().optional()}).passthrough(),q10=L.object({id:L.string(),tenantId:L.string().optional(),name:L.string().optional(),templateId:L.string().optional(),originalFileName:L.string().optional(),status:L.string().optional(),documentCount:L.number().optional(),attachmentCount:L.number().optional(),uploadedBy:L.string().optional(),schemaConfig:H10.nullable().optional(),createdAt:L.union([L.string(),L.number()]).optional(),updatedAt:L.union([L.string(),L.number()]).optional()}).passthrough(),Cc0=L.object({hitScopes:L.array(L.string()).default([]),hitRuleIds:L.array(L.string()).default([]),notHitScopes:L.array(L.string()).default([]),notHitRuleIds:L.array(L.string()).default([])}).passthrough(),oS=L.object({id:L.string().min(1),name:L.string().min(1),enabled:L.boolean().default(!0),description:L.string().default(""),condition:Cc0.default({hitScopes:[],hitRuleIds:[],notHitScopes:[],notHitRuleIds:[]}),level:L.enum(["medium","high"])}).passthrough(),fc1=L.object({defaultLevel:L.enum(["medium","high"]).default("medium"),routingPolicies:L.array(oS).default([])}).passthrough(),uc1=L.object({dryRun:L.boolean().optional(),signKey:L.string().min(1).optional(),outboundName:L.string().optional(),specificationId:L.string().optional(),specificationName:L.string().optional(),mode:L.enum(["fully_automatic","semi_automatic","assisted"]).default("assisted"),autoApprovalRate:L.number().min(0).max(100).optional(),rejectResubmitMethod:L.enum(["node_default","to_ebot","from_start"]).optional(),autoApproveNodeNames:L.array(L.string()).optional(),apiKey:L.string().min(1),apiSecret:L.string().min(1),apiOrigin:L.string().default("production"),customApiUrl:L.string().optional()}).passthrough(),V10=L.object({id:L.string().optional(),code:L.string().optional(),name:L.string().optional(),approvalSystem:L.string().optional()}).passthrough(),bc1=L.object({total:L.number(),dedupeBy:L.string(),unique:L.number(),byStatus:L.record(L.string(),L.number()),bySourceSystem:L.record(L.string(),L.number())}).passthrough()});import{randomBytes as w10}from"node:crypto";async function M1($,Y){let U=await $.json();return Y.parse(U.data??U)}async function W8($){return M1(await $.get("api/v1/auth/me"),x00)}async function O10($){return M1(await $.get("api/auth/get-session"),f00)}async function p6($){return M1(await $.get("api/v1/rules"),u00)}async function hH($,Y){return M1(await $.post("api/v1/rules",{json:Y}),JM)}async function sS($,Y,U){return M1(await $.put(`api/v1/rules/${Y}`,{json:U}),JM)}async function oQ($,Y){await $.delete(`api/v1/rules/${Y}`)}async function ZM($){let Y=await $.post("api/v1/rules/batch-recode",{throwHttpErrors:!1}),U=await Y.json().catch(()=>({}));return L.object({ok:L.boolean(),status:L.number(),body:L.unknown()}).parse({ok:Y.ok,status:Y.status,body:U})}async function P$($){return M1(await $.get("api/v1/rule-set-versions"),L.array(IM))}async function SH($,Y){return M1(await $.get(`api/v1/rule-set-versions/${Y}`),IM)}async function gH($,Y){return M1(await $.post("api/v1/rule-set-versions/publish",{json:{versionName:Y}}),b00)}async function h7($,Y={}){let U=new URLSearchParams;return U.set("offset",String(Y.offset??0)),U.set("limit",String(Y.limit??20)),U.set("sortBy",Y.sortBy??"createdAt"),U.set("sortOrder",Y.sortOrder??"desc"),Y.scenarios?.forEach((z,Q)=>{U.set(`filter[scenarios][${Q}]`,z)}),M1(await $.get("api/v1/knowledge/articles",{searchParams:U}),i00)}async function N10($,Y){return M1(await $.get(`api/v1/knowledge/articles/${Y}`),RH)}async function qM($,Y){return M1(await $.post("api/v1/knowledge/articles",{json:{...Y,contentType:Y.contentType??"policy",status:Y.status??"published",enabled:Y.enabled??!0,scenarios:Y.scenarios&&Y.scenarios.length>0?Y.scenarios:["audit"],tags:Y.tags??[]}}),RH)}async function VM($,Y,U){let z=Object.fromEntries(Object.entries(U).filter(([,Q])=>Q!==void 0));return M1(await $.patch(`api/v1/knowledge/articles/${Y}`,{json:{attributes:z}}),RH)}async function LM($,Y){return await $.delete(`api/v1/knowledge/articles/${Y}`),{success:!0,id:Y}}async function o1($,Y="api/v1/agent/ai-approval/config"){return M1(await $.get(Y),c00)}async function l5($,Y,U="api/v1/agent/ai-approval/config"){return await $.post(U,{json:Y}),o1($,U)}async function aS($,Y,U="api/v1/agent/ai-approval/config"){let z=await $.post(U,{json:Y}),Q=await z.json().catch(()=>({})),J=XM.safeParse(Q.data??Q);return J.success?J.data.success??z.ok:z.ok}async function J$($,Y="api/v1/agent/ai-approval/config"){let U=await o1($,Y);return tS(U.integrations)}async function FM($,Y,U,z="api/v1/agent/ai-approval/config"){let Q=await o1($,z),J=tS(Q.integrations),I=E10(Y,J,U);if(!await aS($,{...Q,integrations:[...Q.integrations,I]},z))throw Error("Seal did not confirm saving the Webhook integration");return I}async function D10($,Y,U,z="api/v1/agent/ai-approval/config"){let Q=await o1($,z),J=tS(Q.integrations),I=E10(Y,J,U);return{before:Q,after:{...Q,integrations:[...Q.integrations,I]},integration:I}}async function A10($,Y,U,z="api/v1/agent/ai-approval/config"){let Q=await o1($,z),J=wM(Q.integrations),I=MM(J,Y),K=C10(I.integration,U);if(!await aS($,{...Q,integrations:Q.integrations.map((H,W)=>W===I.index?K:H)},z))throw Error("Seal did not confirm saving the Webhook integration");return K}async function B10($,Y,U,z="api/v1/agent/ai-approval/config"){let Q=await o1($,z),J=wM(Q.integrations),I=MM(J,Y),K=C10(I.integration,U);return{before:Q,after:{...Q,integrations:Q.integrations.map((G,H)=>H===I.index?K:G)},integration:K}}async function P10($,Y,U="api/v1/agent/ai-approval/config"){let z=await o1($,U),Q=wM(z.integrations),J=MM(Q,Y);if(!await aS($,{...z,integrations:z.integrations.filter((K,G)=>G!==J.index)},U))throw Error("Seal did not confirm deleting the Webhook integration");return J.integration}async function T10($,Y,U="api/v1/agent/ai-approval/config"){let z=await o1($,U),Q=wM(z.integrations),J=MM(Q,Y);return{before:z,after:{...z,integrations:z.integrations.filter((I,K)=>K!==J.index)},integration:J.integration}}function S7($,Y){let U=Y.trim();if(!U)throw Error("Webhook selector must not be empty");let z=$.find((J)=>J.id===U);if(z)return z;let Q=$.filter((J)=>J.name===U);if(Q.length===1)return Q[0];if(Q.length>1)throw Error(`Multiple Webhook integrations match name: ${U}. Use the integration ID.`);throw Error(`Webhook integration not found: ${U}`)}function j10($,Y){let U=Y?.trim().toLowerCase();if(!U)return $;return $.filter((z)=>[z.id,z.name,z.mode,z.outgoingResultWebhook,z.incomingDocumentWebhook.url,z.incomingManualResultWebhook.url].some((Q)=>Q.toLowerCase().includes(U)))}function tS($){return $.filter((Y)=>Y.type==="webhook").map((Y)=>_H.parse(Y))}function wM($){return $.flatMap((Y,U)=>{if(Y.type!=="webhook")return[];return[{index:U,integration:_H.parse(Y)}]})}function MM($,Y){let U=S7($.map((z)=>z.integration),Y);return $.find((z)=>z.integration.id===U.id)}function E10($,Y,U){let z=vH(U.name,"name"),Q=U.mode??"assisted",J=_10(U.outgoingResultWebhook,"outgoingResultWebhook"),I=v10(U.autoApprovalRate??60),K=vc0(Y),G=`wh_${K}_${w10(8).toString("hex").slice(0,7)}`,H=B$($);return _H.parse({type:"webhook",id:`integration-${K}`,name:z,mode:Q,incomingDocumentWebhook:{id:G,url:`${H}/api/v1/integrations/webhook/${G}/document`},outgoingResultWebhook:J,incomingManualResultWebhook:{id:G,url:`${H}/api/v1/integrations/webhook/${G}/manual-result`},secret:U.secret?vH(U.secret,"secret"):R10(),autoApprovalRate:I,materialPackFilePolicy:dQ(U.materialPackFilePolicy)})}function C10($,Y){return _H.parse({...$,...Y.name===void 0?{}:{name:vH(Y.name,"name")},...Y.mode===void 0?{}:{mode:Y.mode},...Y.outgoingResultWebhook===void 0?{}:{outgoingResultWebhook:_10(Y.outgoingResultWebhook,"outgoingResultWebhook")},...Y.autoApprovalRate===void 0?{}:{autoApprovalRate:v10(Y.autoApprovalRate)},...Y.rotateSecret||Y.secret!==void 0?{secret:Y.rotateSecret?R10():vH(Y.secret??"","secret")}:{},...Y.materialPackFilePolicy===void 0?{}:{materialPackFilePolicy:y00($.materialPackFilePolicy,Y.materialPackFilePolicy)}})}function vc0($){let Y=new Set($.map((z)=>z.id)),U=Date.now();while(Y.has(`integration-${U}`))U+=1;return U}function R10(){return w10(16).toString("hex")}function vH($,Y){let U=$.trim();if(!U)throw Error(`Webhook ${Y} must not be empty`);return U}function _10($,Y){let U=vH($,Y);try{return new URL(U).toString()}catch{throw Error(`Webhook ${Y} must be a valid URL`)}}function v10($){if(!Number.isInteger($)||$<0||$>100)throw Error("Webhook autoApprovalRate must be an integer between 0 and 100");return $}async function OM($,Y={}){let[U,z,Q]=await Promise.all([p6($),h7($,{limit:Y.documentLimit??50}),o1($,Y.stylePreferencesEndpoint).then((J)=>({ok:!0,data:J}),(J)=>({ok:!1,error:J instanceof Error?J.message:String(J)}))]);return{rules:U,documents:z,stylePreferences:Q}}async function i4($,Y={}){let U=new URLSearchParams;return U.set("offset",String(Y.offset??0)),U.set("limit",String(Y.limit??50)),c8(U,"fromTimestamp",Y.fromTimestamp),c8(U,"toTimestamp",Y.toTimestamp),c8(U,"startDate",Y.startDate),c8(U,"endDate",Y.endDate),L10(U,"status",Y.status),c8(U,"sourceSystem",Y.sourceSystem),c8(U,"taskMode",Y.taskMode),c8(U,"search",Y.search),c8(U,"sourceDocumentSN",Y.sourceDocumentSN),c8(U,"sourceDocumentId",Y.sourceDocumentId),L10(U,"manualApprovalStatus",Y.manualApprovalStatus),M1(await $.get("api/v1/approvals",{searchParams:U}),nS)}async function H4($,Y){return M1(await $.get(`api/v1/approvals/${Y}`),KM)}async function eS($,Y){let U=await $.get(`api/v1/simulation/batch/${Y}/records`).json(),z=U.data??U;if(Array.isArray(z))return L.array(KM).parse(z);return nS.parse(z).records}async function h10($,Y){return M1(await $.post("api/v1/simulation/create-batch",{json:Y}),lS)}async function S10($,Y){return M1(await $.post("api/v1/simulation/create-material-pack-batch",{json:Y}),lS)}async function g10($,Y={}){let U=await $.get("api/v1/simulation/batches",{searchParams:{limit:String(Y.limit??50)}}).json(),z=U.data??U;return L.array(mS).parse(z)}async function NM($,Y){return M1(await $.get(`api/v1/simulation/batch/${Y}`),mS)}async function y10($){let Y=await $.get("api/v1/simulation/templates").json(),U=Y.data??Y;return L.array(W10).parse(U)}async function $g($){return M1(await $.get("api/v1/simulation/integration-status"),X10)}async function Yg($){let Y=await $.get("api/v1/simulation/hosecloud-integrations").json(),U=Y.data??Y;return L.array(Z10).parse(U)}async function k10($,Y){let z=await(await $.delete(`api/v1/simulation/batch/${encodeURIComponent(Y)}/data`)).json().catch(()=>({}));return z.data??z}async function x10($,Y){let U=Y?"api/v1/simulation/hosecloud-specifications-by-sign-key":"api/v1/simulation/hosecloud-specifications",z=Y?new URLSearchParams({signKey:Y}):void 0,Q=await $.get(U,{searchParams:z}).json(),J=Q.data??Q;return L.array(V10).parse(J)}async function f10($,Y){let U=await $.post("api/hosecloud/corporation",{json:Y}).json(),z=U.data??U;return L.object({corporationId:L.string()}).parse(z)}async function u10($,Y){let z=await(await $.post("api/hosecloud/outbound-config/sync",{json:Y})).json().catch(()=>({}));return z.data??z}async function b10($,Y){let U=new FormData;return U.append("file",new Blob([new Uint8Array(Y.fileBuffer)]),Y.fileName),M1(await $.post("api/v1/material-packages/upload",{body:U}),q10)}function c8($,Y,U){if(U)$.set(Y,U)}function L10($,Y,U){if(!U)return;(Array.isArray(U)?U:[U]).map((Q)=>Q.trim()).filter(Boolean).forEach((Q,J)=>{$.set(`${Y}[${J}]`,Q)})}async function i10($){return M1(await $.get("api/v1/delegation/list"),L.array(n00))}async function lQ($,Y){return M1(await $.post("api/v1/delegation/create",{json:Y??{}}),p00)}async function c10($,Y){let U=await $.post("api/v1/delegation/revoke",{json:{tokenId:Y}}),z=await U.json(),Q=XM.safeParse(z.data??z);return Q.success?Q.data.success??U.ok:U.ok}async function n10($,Y){let U=Y.departmentIds&&Y.departmentIds.length>0?Y.departmentIds:void 0;if(!U){let z=await $.get("api/v1/contacts/departments/root/children").json(),Q=Rc0.safeParse(z.data??z),J=Q.success?Q.data.items?.[0]?._id:void 0;if(J)U=[J]}return M1(await $.post("api/v1/contacts/local/users",{json:{name:Y.name,phone:Y.phone,permissions:Y.permissions??[],departmentIds:U??[]}}),d00)}async function Ug($,Y){return M1(await $.post(`api/v1/contacts/local/users/${Y}/reset-password`,{json:{}}),m00)}async function HM($,Y){return M1(await $.get(`api/v1/contacts/users/${Y}`),GM)}async function WM($,Y=""){return M1(await $.get("api/v1/contacts/search",{searchParams:{query:Y}}),l00)}async function p10($){return M1(await $.get("api/v1/contacts/departments/root/children"),dS)}async function d10($,Y){return M1(await $.get(`api/v1/contacts/departments/${encodeURIComponent(Y)}`),pS)}async function m10($,Y){return M1(await $.get(`api/v1/contacts/departments/${encodeURIComponent(Y)}/children`),dS)}async function l10($,Y){return M1(await $.get(`api/v1/contacts/departments/${encodeURIComponent(Y)}/users`),o00)}async function o10($){return M1(await $.get("api/v1/contacts/last-sync-time"),r00)}async function DM($,Y={}){let U=zg(),z=new URLSearchParams;if(c8(z,"startDate",Y.startDate??U.startDate),c8(z,"endDate",Y.endDate??U.endDate),Y.limit!==void 0)z.set("limit",String(Y.limit));return M1(await $.get("api/v1/insight/stats",{searchParams:z}),s00)}async function AM($,Y){let U=zg(),z=new URLSearchParams;return z.set("tagId",Y.tagId),z.set("startDate",Y.startDate??U.startDate),z.set("endDate",Y.endDate??U.endDate),M1(await $.get("api/v1/insight/risks-by-tag",{searchParams:z}),a00)}async function BM($,Y={}){let U=zg(),z=F10(Y.startDate??U.startDate),Q=F10(Y.endDate??U.endDate),J=new URLSearchParams;return J.set("startDate",String(z)),J.set("endDate",String(Q)),M1(await $.get("api/v1/insight/performance",{searchParams:J}),t00)}async function r10($,Y){return await $.post(`api/v1/insight/analyze/${encodeURIComponent(Y)}`),{success:!0,recordId:Y}}function F10($){if(typeof $==="number")return $<100000000000?$*1000:$;let Y=Number($);if(!isNaN(Y)&&$.trim()!=="")return Y<100000000000?Y*1000:Y;let U=new Date($);if(isNaN(U.getTime()))throw Error(`Invalid date format: ${$}`);return U.getTime()}function zg(){let $=new Date,Y=new Date($.getFullYear(),$.getMonth(),1),U=new Date($.getFullYear(),$.getMonth()+1,0,23,59,59,999);return{startDate:Y.toISOString(),endDate:U.toISOString()}}function s10($){let Y=new URLSearchParams;return c8(Y,"filter[startDate]",$.startDate),c8(Y,"filter[endDate]",$.endDate),c8(Y,"filter[search]",$.search),Y.set("offset",String($.offset??0)),Y.set("limit",String($.limit??50)),Y}async function a10($,Y={}){return M1(await $.get("api/v1/expenses/list",{searchParams:s10(Y)}),$10)}async function t10($,Y={}){return M1(await $.get("api/v1/invoice/list",{searchParams:s10(Y)}),Y10)}async function e10($){return M1(await $.get("api/v1/integrations/feishu/simulation/approval-definitions"),L.array(U10))}async function $40($,Y){let U=await $.delete(`api/v1/contacts/local/users/${Y}`),z=await U.json(),Q=XM.safeParse(z.data??z);return Q.success?Q.data.success??U.ok:U.ok}async function Qg($,Y){let U=await $.post(`api/v1/contacts/local/users/${Y}/activate`,{json:{}}),z=await U.json(),Q=XM.safeParse(z.data??z);return Q.success?Q.data.success??U.ok:U.ok}async function hc0($,Y){let U=await $.post("api/auth/sms-otp/sign-in-password",{json:Y}),z=U.headers.get("set-auth-token"),Q=_c0.parse(await U.json()),J=z??Q.session?.token;if(!J)throw Error("Failed to retrieve authentication token from login response");return{token:J,user:Q.user}}async function Y40($,Y,U,z){let Q;if(Y.userIdOrPhone.startsWith("+")||/^\d{11}$/.test(Y.userIdOrPhone)){let q=await WM($,Y.userIdOrPhone),V=q.users.find((F)=>F.mobile?.includes(Y.userIdOrPhone)||F._id===Y.userIdOrPhone)??q.users[0];if(!V)throw Error(`User not found with phone/ID: ${Y.userIdOrPhone}`);Q=V}else Q=await HM($,Y.userIdOrPhone).catch(async()=>{let q=await WM($,Y.userIdOrPhone),V=q.users.find((F)=>F.name===Y.userIdOrPhone)??q.users[0];if(!V)throw Error(`User not found: ${Y.userIdOrPhone}`);return V});if(Q.status==="resigned")await Qg($,Q._id),Q=await HM($,Q._id);let J=Q,I=Array.isArray(J.identities)&&J.identities.some((q)=>q.provider&&q.provider!=="local")||!!J.apps?.hosecloud;if(I&&z&&z.source.type==="hose"){let V=(Q.mobile||J.identities?.[0]?.providerId||"").replace(/^\+86/,""),F=J.identities?.find((w)=>w.provider==="hosecloud")?.providerId,M=J.apps?.hosecloud?.boundId||F||(V?`${z.source.corpId}:${V}`:void 0);if(M){let w=await nQ(z),O=(await $M({...z.source,staffId:M},w)).token,D=v7(z,z.source),P=A6(z.seal),T=T8(D,void 0,P),A;try{A=await T.get("api/auth/oauth2/session/oem-hosecloud",{searchParams:{token:O,returnToken:"1"}}).json()}catch(C){if(C instanceof D6&&C.response.status===400)throw Error(`Seal AI 用户“${Q.name}”未绑定合思账号,无法生成个人协助链接。`);throw C}let j=A.token??A.accessToken??A.data?.token;if(j){let C=await U(j),b=await lQ(C,{note:Y.note??`Delegation generated by admin for ${Q.name}`});return{targetUser:Q,delegation:b,temporaryPassword:"N/A (Hose SSO)"}}}}let K;try{K=await Ug($,Q._id)}catch(q){if(I)throw Error(`用户 "${Q.name}" (${Q.mobile||Q._id}) 为合思同步账号 (provider: hosecloud),无 Seal 本地密码。`+"Seal 系统暂不支持对同步账号直接重置本地密码。");throw q}let H=(Q.mobile||Q.identities?.[0]?.providerId||"").replace(/^\+86/,"");if(!H)throw Error(`User ${Q.name} has no associated phone number for password login`);let{token:W}=await hc0($,{phone:H,password:K.password}),X=await U(W),Z=await lQ(X,{note:Y.note??`Delegation generated by admin for ${Q.name}`});return{targetUser:Q,delegation:Z,temporaryPassword:K.password}}async function U40($){return M1(await $.get("api/v1/llm/config"),z10)}async function z40($){return M1(await $.get("api/v1/llm/providers"),L.array(Q10))}async function Q40($){return M1(await $.get("api/v1/permissions/available"),J10)}async function J40($){return M1(await $.get("api/v1/permissions/configs"),I10)}async function nY($){return M1(await $.get("api/v1/billing/status"),K10)}async function I40($){let U=await(await $.get("api/v1/billing/plans")).json();return M10.parse(U.data??U)}async function K40($){let U=await(await $.get("api/v1/billing/features")).json();return M10.parse(U.data??U)}var XM,Rc0,_c0,M10;var X6=m(()=>{iQ();A$();mQ();t9();i8();rS();XM=L.object({success:L.boolean().optional()}).passthrough(),Rc0=L.object({items:L.array(L.object({_id:L.string()})).optional()}).passthrough(),_c0=L.object({user:L.unknown().optional(),session:L.object({token:L.string().optional()}).optional()}).passthrough(),M10=L.json()});var Y6=E((in1,H40)=>{var{toString:G40}=Object.prototype,Sc0=/["&<>]/,$3={each:function(Y,U){if(Y)if(Array.isArray(Y))Y.forEach(U);else Object.keys(Y).forEach((z)=>{U(Y[z],z)})},some:function(Y,U){if(Y){if(Array.isArray(Y))return Y.some(U);return Object.keys(Y).some((z)=>U(Y[z],z))}return!1},every:function(Y,U){if(Y){if(Array.isArray(Y))return Y.every(U);return Object.keys(Y).every((z)=>U(Y[z],z))}return!0},map:function(Y,U){if(Y){if(Array.isArray(Y))return Y.map(U);return Object.keys(Y).map((z)=>U(Y[z],z))}return[]},keyBy($,Y){return $.reduce((U,z)=>{return U[z[Y]]=z,U},{})},isEqual:function(Y,U){let z=typeof Y,Q=typeof U,J=Array.isArray(Y),I=Array.isArray(U),K;if(z!==Q)return!1;switch(typeof Y){case"object":if(J||I){if(J&&I)return Y.length===U.length&&Y.every((G,H)=>{let W=U[H];return $3.isEqual(G,W)});return!1}if(Y===null||U===null)return Y===U;if(K=Object.keys(Y),Object.keys(U).length!==K.length)return!1;for(let G of K)if(!U.hasOwnProperty(G))return!1;return $3.every(Y,(G,H)=>{let W=U[H];return $3.isEqual(G,W)});default:return Y===U}},escapeHtml($){let Y=Sc0.exec($);if(!Y)return $;let U="",z="",Q=0,J=Y.index;for(;J<$.length;J++){switch($.charAt(J)){case'"':z=""";break;case"&":z="&";break;case"'":z="'";break;case"<":z="<";break;case">":z=">";break;default:continue}if(Q!==J)U+=$.substring(Q,J);Q=J+1,U+=z}if(Q!==J)return U+$.substring(Q,J);return U},strcmp($,Y){if($Y)return 1;return 0},isUndefined($){return G40.call($)==="[object Undefined]"},isObject($){return G40.call($)==="[object Object]"},deepMerge(){let $=arguments[0]||{},{length:Y}=arguments,U,z,Q;function J(I,K){if(U=$[K],Q=Array.isArray(I),$3.isObject(I)||Q){if(Q)Q=!1,z=U&&Array.isArray(U)?U:[];else z=U&&$3.isObject(U)?U:{};$[K]=$3.deepMerge(z,I)}else if(!$3.isUndefined(I))$[K]=I}for(let I=0;I{var gc0=/^[A-Z]+\d+$/,yH={_dictionary:["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"],_l2nFill:0,_l2n:{},_n2l:[],_level($){if($<=26)return 1;if($<=676)return 2;return 3},_fill($){let Y,U,z,Q,J,I=1;if($>=4)throw Error("Out of bounds. Excel supports columns from 1 to 16384");if(this._l2nFill<1&&$>=1){while(I<=26)Y=this._dictionary[I-1],this._n2l[I]=Y,this._l2n[Y]=I,I++;this._l2nFill=1}if(this._l2nFill<2&&$>=2){I=27;while(I<=702)U=I-27,z=U%26,Q=Math.floor(U/26),Y=this._dictionary[Q]+this._dictionary[z],this._n2l[I]=Y,this._l2n[Y]=I,I++;this._l2nFill=2}if(this._l2nFill<3&&$>=3){I=703;while(I<=16384)U=I-703,z=U%26,Q=Math.floor(U/26)%26,J=Math.floor(U/676),Y=this._dictionary[J]+this._dictionary[Q]+this._dictionary[z],this._n2l[I]=Y,this._l2n[Y]=I,I++;this._l2nFill=3}},l2n($){if(!this._l2n[$])this._fill($.length);if(!this._l2n[$])throw Error(`Out of bounds. Invalid column letter: ${$}`);return this._l2n[$]},n2l($){if($<1||$>16384)throw Error(`${$} is out of bounds. Excel supports columns from 1 to 16384`);if(!this._n2l[$])this._fill(this._level($));return this._n2l[$]},_hash:{},validateAddress($){if(!gc0.test($))throw Error(`Invalid Address: ${$}`);return!0},decodeAddress($){let Y=$.length<5&&this._hash[$];if(Y)return Y;let U=!1,z="",Q=0,J=!1,I="",K=0;for(let H=0,W;H<$.length;H++)if(W=$.charCodeAt(H),!J&&W>=65&&W<=90)U=!0,z+=$[H],Q=Q*26+W-64;else if(W>=48&&W<=57)J=!0,I+=$[H],K=K*10+W-48;else if(J&&U&&W!==36)break;if(!U)Q=void 0;else if(Q>16384)throw Error(`Out of bounds. Invalid column letter: ${z}`);if(!J)K=void 0;$=z+I;let G={address:$,col:Q,row:K,$col$row:`$${z}$${I}`};if(Q<=100&&K<=100)this._hash[$]=G,this._hash[G.$col$row]=G;return G},getAddress($,Y){if(Y){let U=this.n2l(Y)+$;return this.decodeAddress(U)}return this.decodeAddress($)},decode($){let Y=$.split(":");if(Y.length===2){let U=this.decodeAddress(Y[0]),z=this.decodeAddress(Y[1]),Q={top:Math.min(U.row,z.row),left:Math.min(U.col,z.col),bottom:Math.max(U.row,z.row),right:Math.max(U.col,z.col)};return Q.tl=this.n2l(Q.left)+Q.top,Q.br=this.n2l(Q.right)+Q.bottom,Q.dimensions=`${Q.tl}:${Q.br}`,Q}return this.decodeAddress($)},decodeEx($){let Y=$.match(/(?:(?:(?:'((?:[^']|'')*)')|([^'^ !]*))!)?(.*)/),U=Y[1]||Y[2],z=Y[3],Q=z.split(":");if(Q.length>1){let I=this.decodeAddress(Q[0]),K=this.decodeAddress(Q[1]),G=Math.min(I.row,K.row),H=Math.min(I.col,K.col),W=Math.max(I.row,K.row),X=Math.max(I.col,K.col);return I=this.n2l(H)+G,K=this.n2l(X)+W,{top:G,left:H,bottom:W,right:X,sheetName:U,tl:{address:I,col:H,row:G,$col$row:`$${this.n2l(H)}$${G}`,sheetName:U},br:{address:K,col:X,row:W,$col$row:`$${this.n2l(X)}$${W}`,sheetName:U},dimensions:`${I}:${K}`}}if(z.startsWith("#"))return U?{sheetName:U,error:z}:{error:z};let J=this.decodeAddress(z);return U?{sheetName:U,...J}:J},encodeAddress($,Y){return yH.n2l(Y)+$},encode(){switch(arguments.length){case 2:return yH.encodeAddress(arguments[0],arguments[1]);case 4:return`${yH.encodeAddress(arguments[0],arguments[1])}:${yH.encodeAddress(arguments[2],arguments[3])}`;default:throw Error("Can only encode with 2 or 4 arguments")}},inRange($,Y){let[U,z,,Q,J]=$,[I,K]=Y;return I>=U&&I<=Q&&K>=z&&K<=J}};W40.exports=yH});var Y3=E((nn1,X40)=>{var o5=c4();class Jg{constructor(){this.decode(arguments)}setTLBR($,Y,U,z,Q){if(arguments.length<4){let J=o5.decodeAddress($),I=o5.decodeAddress(Y);this.model={top:Math.min(J.row,I.row),left:Math.min(J.col,I.col),bottom:Math.max(J.row,I.row),right:Math.max(J.col,I.col),sheetName:U},this.setTLBR(J.row,J.col,I.row,I.col,Q)}else this.model={top:Math.min($,U),left:Math.min(Y,z),bottom:Math.max($,U),right:Math.max(Y,z),sheetName:Q}}decode($){switch($.length){case 5:this.setTLBR($[0],$[1],$[2],$[3],$[4]);break;case 4:this.setTLBR($[0],$[1],$[2],$[3]);break;case 3:this.setTLBR($[0],$[1],$[2]);break;case 2:this.setTLBR($[0],$[1]);break;case 1:{let Y=$[0];if(Y instanceof Jg)this.model={top:Y.model.top,left:Y.model.left,bottom:Y.model.bottom,right:Y.model.right,sheetName:Y.sheetName};else if(Y instanceof Array)this.decode(Y);else if(Y.top&&Y.left&&Y.bottom&&Y.right)this.model={top:Y.top,left:Y.left,bottom:Y.bottom,right:Y.right,sheetName:Y.sheetName};else{let U=o5.decodeEx(Y);if(U.top)this.model={top:U.top,left:U.left,bottom:U.bottom,right:U.right,sheetName:U.sheetName};else this.model={top:U.row,left:U.col,bottom:U.row,right:U.col,sheetName:U.sheetName}}break}case 0:this.model={top:0,left:0,bottom:0,right:0};break;default:throw Error(`Invalid number of arguments to _getDimensions() - ${$.length}`)}}get top(){return this.model.top||1}set top($){this.model.top=$}get left(){return this.model.left||1}set left($){this.model.left=$}get bottom(){return this.model.bottom||1}set bottom($){this.model.bottom=$}get right(){return this.model.right||1}set right($){this.model.right=$}get sheetName(){return this.model.sheetName}set sheetName($){this.model.sheetName=$}get _serialisedSheetName(){let{sheetName:$}=this.model;if($){if(/^[a-zA-Z0-9]*$/.test($))return`${$}!`;return`'${$}'!`}return""}expand($,Y,U,z){if(!this.model.top||$this.bottom)this.bottom=U;if(!this.model.right||z>this.right)this.right=z}expandRow($){if($){let{dimensions:Y,number:U}=$;if(Y)this.expand(U,Y.min,U,Y.max)}}expandToAddress($){let Y=o5.decodeEx($);this.expand(Y.row,Y.col,Y.row,Y.col)}get tl(){return o5.n2l(this.left)+this.top}get $t$l(){return`$${o5.n2l(this.left)}$${this.top}`}get br(){return o5.n2l(this.right)+this.bottom}get $b$r(){return`$${o5.n2l(this.right)}$${this.bottom}`}get range(){return`${this._serialisedSheetName+this.tl}:${this.br}`}get $range(){return`${this._serialisedSheetName+this.$t$l}:${this.$b$r}`}get shortRange(){return this.count>1?this.range:this._serialisedSheetName+this.tl}get $shortRange(){return this.count>1?this.$range:this._serialisedSheetName+this.$t$l}get count(){return(1+this.bottom-this.top)*(1+this.right-this.left)}toString(){return this.range}intersects($){if($.sheetName&&this.sheetName&&$.sheetName!==this.sheetName)return!1;if($.bottomthis.bottom)return!1;if($.rightthis.right)return!1;return!0}contains($){let Y=o5.decodeEx($);return this.containsEx(Y)}containsEx($){if($.sheetName&&this.sheetName&&$.sheetName!==this.sheetName)return!1;return $.row>=this.top&&$.row<=this.bottom&&$.col>=this.left&&$.col<=this.right}forEachAddress($){for(let Y=this.left;Y<=this.right;Y++)for(let U=this.top;U<=this.bottom;U++)$(o5.encodeAddress(U,Y),U,Y)}}X40.exports=Jg});var G5=E((pn1,Z40)=>{Z40.exports={ValueType:{Null:0,Merge:1,Number:2,String:3,Date:4,Hyperlink:5,Formula:6,SharedString:7,RichText:8,Boolean:9,Error:10},FormulaType:{None:0,Master:1,Shared:2},RelationshipType:{None:0,OfficeDocument:1,Worksheet:2,CalcChain:3,SharedStrings:4,Styles:5,Theme:6,Hyperlink:7},DocumentType:{Xlsx:1},ReadingOrder:{LeftToRight:1,RightToLeft:2},ErrorValue:{NotApplicable:"#N/A",Ref:"#REF!",Name:"#NAME?",DivZero:"#DIV/0!",Null:"#NULL!",Value:"#VALUE!",Num:"#NUM!"}}});var V40=E((dn1,q40)=>{var PM=c4(),yc0=/(([a-z_\-0-9]*)!)?([a-z0-9_$]{2,})([(])?/gi,kc0=/^([$])?([a-z]+)([$])?([1-9][0-9]*)$/i;function xc0($,Y,U){let z=PM.decode(Y),Q=PM.decode(U);return $.replace(yc0,(J,I,K,G,H)=>{if(H)return J;let W=kc0.exec(G);if(W){let X=W[1],Z=W[2].toUpperCase(),q=W[3],V=W[4];if(Z.length>3||Z.length===3&&Z>"XFD")return J;let F=PM.l2n(Z),M=parseInt(V,10);if(!X)F+=Q.col-z.col;if(!q)M+=Q.row-z.row;return(I||"")+(X||"")+PM.n2l(F)+(q||"")+M}return J})}q40.exports={slideFormula:xc0}});var F40=E((mn1,L40)=>{var fc0=Y6();class kH{constructor($){this.note=$}get model(){let $=null;switch(typeof this.note){case"string":$={type:"note",note:{texts:[{text:this.note}]}};break;default:$={type:"note",note:this.note};break}return fc0.deepMerge({},kH.DEFAULT_CONFIGS,$)}set model($){let{note:Y}=$,{texts:U}=Y;if(U.length===1&&Object.keys(U[0]).length===1)this.note=U[0].text;else this.note=Y}static fromModel($){let Y=new kH;return Y.model=$,Y}}kH.DEFAULT_CONFIGS={note:{margins:{insetmode:"auto",inset:[0.13,0.13,0.25,0.25]},protection:{locked:"True",lockText:"True"},editAs:"absolute"}};L40.exports=kH});var v40=E((ln1,_40)=>{var uc0=c4(),bc0=Y6(),H5=G5(),{slideFormula:ic0}=V40(),w40=F40();class d0{constructor($,Y,U){if(!$||!Y)throw Error("A Cell needs a Row");this._row=$,this._column=Y,uc0.validateAddress(U),this._address=U,this._value=g7.create(d0.Types.Null,this),this.style=this._mergeStyle($.style,Y.style,{}),this._mergeCount=0}get worksheet(){return this._row.worksheet}get workbook(){return this._row.worksheet.workbook}destroy(){delete this.style,delete this._value,delete this._row,delete this._column,delete this._address}get numFmt(){return this.style.numFmt}set numFmt($){this.style.numFmt=$}get font(){return this.style.font}set font($){this.style.font=$}get alignment(){return this.style.alignment}set alignment($){this.style.alignment=$}get border(){return this.style.border}set border($){this.style.border=$}get fill(){return this.style.fill}set fill($){this.style.fill=$}get protection(){return this.style.protection}set protection($){this.style.protection=$}_mergeStyle($,Y,U){let z=$&&$.numFmt||Y&&Y.numFmt;if(z)U.numFmt=z;let Q=$&&$.font||Y&&Y.font;if(Q)U.font=Q;let J=$&&$.alignment||Y&&Y.alignment;if(J)U.alignment=J;let I=$&&$.border||Y&&Y.border;if(I)U.border=I;let K=$&&$.fill||Y&&Y.fill;if(K)U.fill=K;let G=$&&$.protection||Y&&Y.protection;if(G)U.protection=G;return U}get address(){return this._address}get row(){return this._row.number}get col(){return this._column.number}get $col$row(){return`$${this._column.letter}$${this.row}`}get type(){return this._value.type}get effectiveType(){return this._value.effectiveType}toCsvString(){return this._value.toCsvString()}addMergeRef(){this._mergeCount++}releaseMergeRef(){this._mergeCount--}get isMerged(){return this._mergeCount>0||this.type===d0.Types.Merge}merge($,Y){if(this._value.release(),this._value=g7.create(d0.Types.Merge,this,$),!Y)this.style=$.style}unmerge(){if(this.type===d0.Types.Merge)this._value.release(),this._value=g7.create(d0.Types.Null,this),this.style=this._mergeStyle(this._row.style,this._column.style,{})}isMergedTo($){if(this._value.type!==d0.Types.Merge)return!1;return this._value.isMergedTo($)}get master(){if(this.type===d0.Types.Merge)return this._value.master;return this}get isHyperlink(){return this._value.type===d0.Types.Hyperlink}get hyperlink(){return this._value.hyperlink}get value(){return this._value.value}set value($){if(this.type===d0.Types.Merge){this._value.master.value=$;return}this._value.release(),this._value=g7.create(g7.getType($),this,$)}get note(){return this._comment&&this._comment.note}set note($){this._comment=new w40($)}get text(){return this._value.toString()}get html(){return bc0.escapeHtml(this.text)}toString(){return this.text}_upgradeToHyperlink($){if(this.type===d0.Types.String)this._value=g7.create(d0.Types.Hyperlink,this,{text:this._value.value,hyperlink:$})}get formula(){return this._value.formula}get result(){return this._value.result}get formulaType(){return this._value.formulaType}get fullAddress(){let{worksheet:$}=this._row;return{sheetName:$.name,address:this.address,row:this.row,col:this.col}}get name(){return this.names[0]}set name($){this.names=[$]}get names(){return this.workbook.definedNames.getNamesEx(this.fullAddress)}set names($){let{definedNames:Y}=this.workbook;Y.removeAllNames(this.fullAddress),$.forEach((U)=>{Y.addEx(this.fullAddress,U)})}addName($){this.workbook.definedNames.addEx(this.fullAddress,$)}removeName($){this.workbook.definedNames.removeEx(this.fullAddress,$)}removeAllNames(){this.workbook.definedNames.removeAllNames(this.fullAddress)}get _dataValidations(){return this.worksheet.dataValidations}get dataValidation(){return this._dataValidations.find(this.address)}set dataValidation($){this._dataValidations.add(this.address,$)}get model(){let{model:$}=this._value;if($.style=this.style,this._comment)$.comment=this._comment.model;return $}set model($){if(this._value.release(),this._value=g7.create($.type,this),this._value.model=$,$.comment)switch($.comment.type){case"note":this._comment=w40.fromModel($.comment);break}if($.style)this.style=$.style;else this.style={}}}d0.Types=H5.ValueType;class M40{constructor($){this.model={address:$.address,type:d0.Types.Null}}get value(){return null}set value($){}get type(){return d0.Types.Null}get effectiveType(){return d0.Types.Null}get address(){return this.model.address}set address($){this.model.address=$}toCsvString(){return""}release(){}toString(){return""}}class O40{constructor($,Y){this.model={address:$.address,type:d0.Types.Number,value:Y}}get value(){return this.model.value}set value($){this.model.value=$}get type(){return d0.Types.Number}get effectiveType(){return d0.Types.Number}get address(){return this.model.address}set address($){this.model.address=$}toCsvString(){return this.model.value.toString()}release(){}toString(){return this.model.value.toString()}}class N40{constructor($,Y){this.model={address:$.address,type:d0.Types.String,value:Y}}get value(){return this.model.value}set value($){this.model.value=$}get type(){return d0.Types.String}get effectiveType(){return d0.Types.String}get address(){return this.model.address}set address($){this.model.address=$}toCsvString(){return`"${this.model.value.replace(/"/g,'""')}"`}release(){}toString(){return this.model.value}}class D40{constructor($,Y){this.model={address:$.address,type:d0.Types.String,value:Y}}get value(){return this.model.value}set value($){this.model.value=$}toString(){return this.model.value.richText.map(($)=>$.text).join("")}get type(){return d0.Types.RichText}get effectiveType(){return d0.Types.RichText}get address(){return this.model.address}set address($){this.model.address=$}toCsvString(){return`"${this.text.replace(/"/g,'""')}"`}release(){}}class A40{constructor($,Y){this.model={address:$.address,type:d0.Types.Date,value:Y}}get value(){return this.model.value}set value($){this.model.value=$}get type(){return d0.Types.Date}get effectiveType(){return d0.Types.Date}get address(){return this.model.address}set address($){this.model.address=$}toCsvString(){return this.model.value.toISOString()}release(){}toString(){return this.model.value.toString()}}class B40{constructor($,Y){if(this.model={address:$.address,type:d0.Types.Hyperlink,text:Y?Y.text:void 0,hyperlink:Y?Y.hyperlink:void 0},Y&&Y.tooltip)this.model.tooltip=Y.tooltip}get value(){let $={text:this.model.text,hyperlink:this.model.hyperlink};if(this.model.tooltip)$.tooltip=this.model.tooltip;return $}set value($){if(this.model={text:$.text,hyperlink:$.hyperlink},$.tooltip)this.model.tooltip=$.tooltip}get text(){return this.model.text}set text($){this.model.text=$}get hyperlink(){return this.model.hyperlink}set hyperlink($){this.model.hyperlink=$}get type(){return d0.Types.Hyperlink}get effectiveType(){return d0.Types.Hyperlink}get address(){return this.model.address}set address($){this.model.address=$}toCsvString(){return this.model.hyperlink}release(){}toString(){return this.model.text}}class P40{constructor($,Y){if(this.model={address:$.address,type:d0.Types.Merge,master:Y?Y.address:void 0},this._master=Y,Y)Y.addMergeRef()}get value(){return this._master.value}set value($){if($ instanceof d0){if(this._master)this._master.releaseMergeRef();$.addMergeRef(),this._master=$}else this._master.value=$}isMergedTo($){return $===this._master}get master(){return this._master}get type(){return d0.Types.Merge}get effectiveType(){return this._master.effectiveType}get address(){return this.model.address}set address($){this.model.address=$}toCsvString(){return""}release(){this._master.releaseMergeRef()}toString(){return this.value.toString()}}class T40{constructor($,Y){this.cell=$,this.model={address:$.address,type:d0.Types.Formula,shareType:Y?Y.shareType:void 0,ref:Y?Y.ref:void 0,formula:Y?Y.formula:void 0,sharedFormula:Y?Y.sharedFormula:void 0,result:Y?Y.result:void 0}}_copyModel($){let Y={},U=(z)=>{let Q=$[z];if(Q)Y[z]=Q};return U("formula"),U("result"),U("ref"),U("shareType"),U("sharedFormula"),Y}get value(){return this._copyModel(this.model)}set value($){this.model=this._copyModel($)}validate($){switch(g7.getType($)){case d0.Types.Null:case d0.Types.String:case d0.Types.Number:case d0.Types.Date:break;case d0.Types.Hyperlink:case d0.Types.Formula:default:throw Error("Cannot process that type of result value")}}get dependencies(){let $=this.formula.match(/([a-zA-Z0-9]+!)?[A-Z]{1,3}\d{1,4}:[A-Z]{1,3}\d{1,4}/g),Y=this.formula.replace(/([a-zA-Z0-9]+!)?[A-Z]{1,3}\d{1,4}:[A-Z]{1,3}\d{1,4}/g,"").match(/([a-zA-Z0-9]+!)?[A-Z]{1,3}\d{1,4}/g);return{ranges:$,cells:Y}}get formula(){return this.model.formula||this._getTranslatedFormula()}set formula($){this.model.formula=$}get formulaType(){if(this.model.formula)return H5.FormulaType.Master;if(this.model.sharedFormula)return H5.FormulaType.Shared;return H5.FormulaType.None}get result(){return this.model.result}set result($){this.model.result=$}get type(){return d0.Types.Formula}get effectiveType(){let $=this.model.result;if($===null||$===void 0)return H5.ValueType.Null;if($ instanceof String||typeof $==="string")return H5.ValueType.String;if(typeof $==="number")return H5.ValueType.Number;if($ instanceof Date)return H5.ValueType.Date;if($.text&&$.hyperlink)return H5.ValueType.Hyperlink;if($.formula)return H5.ValueType.Formula;return H5.ValueType.Null}get address(){return this.model.address}set address($){this.model.address=$}_getTranslatedFormula(){if(!this._translatedFormula&&this.model.sharedFormula){let{worksheet:$}=this.cell,Y=$.findCell(this.model.sharedFormula);this._translatedFormula=Y&&ic0(Y.formula,Y.address,this.model.address)}return this._translatedFormula}toCsvString(){return`${this.model.result||""}`}release(){}toString(){return this.model.result?this.model.result.toString():""}}class j40{constructor($,Y){this.model={address:$.address,type:d0.Types.SharedString,value:Y}}get value(){return this.model.value}set value($){this.model.value=$}get type(){return d0.Types.SharedString}get effectiveType(){return d0.Types.SharedString}get address(){return this.model.address}set address($){this.model.address=$}toCsvString(){return this.model.value.toString()}release(){}toString(){return this.model.value.toString()}}class E40{constructor($,Y){this.model={address:$.address,type:d0.Types.Boolean,value:Y}}get value(){return this.model.value}set value($){this.model.value=$}get type(){return d0.Types.Boolean}get effectiveType(){return d0.Types.Boolean}get address(){return this.model.address}set address($){this.model.address=$}toCsvString(){return this.model.value?1:0}release(){}toString(){return this.model.value.toString()}}class C40{constructor($,Y){this.model={address:$.address,type:d0.Types.Error,value:Y}}get value(){return this.model.value}set value($){this.model.value=$}get type(){return d0.Types.Error}get effectiveType(){return d0.Types.Error}get address(){return this.model.address}set address($){this.model.address=$}toCsvString(){return this.toString()}release(){}toString(){return this.model.value.error.toString()}}class R40{constructor($,Y){this.model={address:$.address,type:d0.Types.String,value:JSON.stringify(Y),rawValue:Y}}get value(){return this.model.rawValue}set value($){this.model.rawValue=$,this.model.value=JSON.stringify($)}get type(){return d0.Types.String}get effectiveType(){return d0.Types.String}get address(){return this.model.address}set address($){this.model.address=$}toCsvString(){return this.model.value}release(){}toString(){return this.model.value}}var g7={getType($){if($===null||$===void 0)return d0.Types.Null;if($ instanceof String||typeof $==="string")return d0.Types.String;if(typeof $==="number")return d0.Types.Number;if(typeof $==="boolean")return d0.Types.Boolean;if($ instanceof Date)return d0.Types.Date;if($.text&&$.hyperlink)return d0.Types.Hyperlink;if($.formula||$.sharedFormula)return d0.Types.Formula;if($.richText)return d0.Types.RichText;if($.sharedString)return d0.Types.SharedString;if($.error)return d0.Types.Error;return d0.Types.JSON},types:[{t:d0.Types.Null,f:M40},{t:d0.Types.Number,f:O40},{t:d0.Types.String,f:N40},{t:d0.Types.Date,f:A40},{t:d0.Types.Hyperlink,f:B40},{t:d0.Types.Formula,f:T40},{t:d0.Types.Merge,f:P40},{t:d0.Types.JSON,f:R40},{t:d0.Types.SharedString,f:j40},{t:d0.Types.RichText,f:D40},{t:d0.Types.Boolean,f:E40},{t:d0.Types.Error,f:C40}].reduce(($,Y)=>{return $[Y.t]=Y.f,$},[]),create($,Y,U){let z=this.types[$];if(!z)throw Error(`Could not create Value of type ${$}`);return new z(Y,U)}};_40.exports=d0});var jM=E((on1,g40)=>{var cc0=Y6(),TM=G5(),pY=c4(),h40=v40();class S40{constructor($,Y){this._worksheet=$,this._number=Y,this._cells=[],this.style={},this.outlineLevel=0}get number(){return this._number}get worksheet(){return this._worksheet}commit(){this._worksheet._commitRow(this)}destroy(){delete this._worksheet,delete this._cells,delete this.style}findCell($){return this._cells[$-1]}getCellEx($){let Y=this._cells[$.col-1];if(!Y){let U=this._worksheet.getColumn($.col);Y=new h40(this,U,$.address),this._cells[$.col-1]=Y}return Y}getCell($){if(typeof $==="string"){let Y=this._worksheet.getColumnKey($);if(Y)$=Y.number;else $=pY.l2n($)}return this._cells[$-1]||this.getCellEx({address:pY.encodeAddress(this._number,$),row:this._number,col:$})}splice($,Y,...U){let z=$+Y,Q=U.length-Y,J=this._cells.length,I,K,G;if(Q<0){for(I=$+U.length;I<=J;I++)if(G=this._cells[I-1],K=this._cells[I-Q-1],K)G=this.getCell(I),G.value=K.value,G.style=K.style,G._comment=K._comment;else if(G)G.value=null,G.style={},G._comment=void 0}else if(Q>0)for(I=J;I>=z;I--)if(K=this._cells[I-1],K)G=this.getCell(I+Q),G.value=K.value,G.style=K.style,G._comment=K._comment;else this._cells[I+Q-1]=void 0;for(I=0;I{if(U&&U.type!==TM.ValueType.Null)Y(U,z+1)})}addPageBreak($,Y){let U=this._worksheet,z=Math.max(0,$-1)||0,Q=Math.max(0,Y-1)||16838,J={id:this._number,max:Q,man:1};if(z)J.min=z;U.rowBreaks.push(J)}get values(){let $=[];return this._cells.forEach((Y)=>{if(Y&&Y.type!==TM.ValueType.Null)$[Y.col]=Y.value}),$}set values($){if(this._cells=[],!$);else if($ instanceof Array){let Y=0;if($.hasOwnProperty("0"))Y=1;$.forEach((U,z)=>{if(U!==void 0)this.getCellEx({address:pY.encodeAddress(this._number,z+Y),row:this._number,col:z+Y}).value=U})}else this._worksheet.eachColumnKey((Y,U)=>{if($[U]!==void 0)this.getCellEx({address:pY.encodeAddress(this._number,Y.number),row:this._number,col:Y.number}).value=$[U]})}get hasValues(){return cc0.some(this._cells,($)=>$&&$.type!==TM.ValueType.Null)}get cellCount(){return this._cells.length}get actualCellCount(){let $=0;return this.eachCell(()=>{$++}),$}get dimensions(){let $=0,Y=0;return this._cells.forEach((U)=>{if(U&&U.type!==TM.ValueType.Null){if(!$||$>U.col)$=U.col;if(Y0?{min:$,max:Y}:null}_applyStyle($,Y){return this.style[$]=Y,this._cells.forEach((U)=>{if(U)U[$]=Y}),Y}get numFmt(){return this.style.numFmt}set numFmt($){this._applyStyle("numFmt",$)}get font(){return this.style.font}set font($){this._applyStyle("font",$)}get alignment(){return this.style.alignment}set alignment($){this._applyStyle("alignment",$)}get protection(){return this.style.protection}set protection($){this._applyStyle("protection",$)}get border(){return this.style.border}set border($){this._applyStyle("border",$)}get fill(){return this.style.fill}set fill($){this._applyStyle("fill",$)}get hidden(){return!!this._hidden}set hidden($){this._hidden=$}get outlineLevel(){return this._outlineLevel||0}set outlineLevel($){this._outlineLevel=$}get collapsed(){return!!(this._outlineLevel&&this._outlineLevel>=this._worksheet.properties.outlineLevelRow)}get model(){let $=[],Y=0,U=0;return this._cells.forEach((z)=>{if(z){let Q=z.model;if(Q){if(!Y||Y>z.col)Y=z.col;if(U{switch(U.type){case h40.Types.Merge:break;default:{let z;if(U.address)z=pY.decodeAddress(U.address);else if(Y){let{row:J}=Y,I=Y.col+1;z={row:J,col:I,address:pY.encodeAddress(J,I),$col$row:`$${pY.n2l(I)}$${J}`}}Y=z;let Q=this.getCellEx(z);Q.model=U;break}}}),$.height)this.height=$.height;else delete this.height;this.hidden=$.hidden,this.outlineLevel=$.outlineLevel||0,this.style=$.style&&JSON.parse(JSON.stringify($.style))||{}}}g40.exports=S40});var CM=E((rn1,y40)=>{var nc0=Y6(),pc0=G5(),dc0=c4();class EM{constructor($,Y,U){if(this._worksheet=$,this._number=Y,U!==!1)this.defn=U}get number(){return this._number}get worksheet(){return this._worksheet}get letter(){return dc0.n2l(this._number)}get isCustomWidth(){return this.width!==void 0&&this.width!==9}get defn(){return{header:this._header,key:this.key,width:this.width,style:this.style,hidden:this.hidden,outlineLevel:this.outlineLevel}}set defn($){if($){if(this.key=$.key,this.width=$.width!==void 0?$.width:9,this.outlineLevel=$.outlineLevel,$.style)this.style=$.style;else this.style={};this.header=$.header,this._hidden=!!$.hidden}else delete this._header,delete this._key,delete this.width,this.style={},this.outlineLevel=0}get headers(){return this._header&&this._header instanceof Array?this._header:[this._header]}get header(){return this._header}set header($){if($!==void 0)this._header=$,this.headers.forEach((Y,U)=>{this._worksheet.getCell(U+1,this.number).value=Y});else this._header=void 0}get key(){return this._key}set key($){if((this._key&&this._worksheet.getColumnKey(this._key))===this)this._worksheet.deleteColumnKey(this._key);if(this._key=$,$)this._worksheet.setColumnKey(this._key,this)}get hidden(){return!!this._hidden}set hidden($){this._hidden=$}get outlineLevel(){return this._outlineLevel||0}set outlineLevel($){this._outlineLevel=$}get collapsed(){return!!(this._outlineLevel&&this._outlineLevel>=this._worksheet.properties.outlineLevelCol)}toString(){return JSON.stringify({key:this.key,width:this.width,headers:this.headers.length?this.headers:void 0})}equivalentTo($){return this.width===$.width&&this.hidden===$.hidden&&this.outlineLevel===$.outlineLevel&&nc0.isEqual(this.style,$.style)}get isDefault(){if(this.isCustomWidth)return!1;if(this.hidden)return!1;if(this.outlineLevel)return!1;let $=this.style;if($&&($.font||$.numFmt||$.alignment||$.border||$.fill||$.protection))return!1;return!0}get headerCount(){return this.headers.length}eachCell($,Y){let U=this.number;if(!Y)Y=$,$=null;this._worksheet.eachRow($,(z,Q)=>{Y(z.getCell(U),Q)})}get values(){let $=[];return this.eachCell((Y,U)=>{if(Y&&Y.type!==pc0.ValueType.Null)$[U]=Y.value}),$}set values($){if(!$)return;let Y=this.number,U=0;if($.hasOwnProperty("0"))U=1;$.forEach((z,Q)=>{this._worksheet.getCell(Q+U,Y).value=z})}_applyStyle($,Y){return this.style[$]=Y,this.eachCell((U)=>{U[$]=Y}),Y}get numFmt(){return this.style.numFmt}set numFmt($){this._applyStyle("numFmt",$)}get font(){return this.style.font}set font($){this._applyStyle("font",$)}get alignment(){return this.style.alignment}set alignment($){this._applyStyle("alignment",$)}get protection(){return this.style.protection}set protection($){this._applyStyle("protection",$)}get border(){return this.style.border}set border($){this._applyStyle("border",$)}get fill(){return this.style.fill}set fill($){this._applyStyle("fill",$)}static toModel($){let Y=[],U=null;if($)$.forEach((z,Q)=>{if(z.isDefault){if(U)U=null}else if(!U||!z.equivalentTo(U))U={min:Q+1,max:Q+1,width:z.width!==void 0?z.width:9,style:z.style,isCustomWidth:z.isCustomWidth,hidden:z.hidden,outlineLevel:z.outlineLevel,collapsed:z.collapsed},Y.push(U);else U.max=Q+1});return Y.length?Y:void 0}static fromModel($,Y){Y=Y||[];let U=[],z=1,Q=0;Y=Y.sort(function(J,I){return J.min-I.min});while(Q{var mc0=c4();class RM{constructor($,Y,U=0){if(this.worksheet=$,!Y)this.nativeCol=0,this.nativeColOff=0,this.nativeRow=0,this.nativeRowOff=0;else if(typeof Y==="string"){let z=mc0.decodeAddress(Y);this.nativeCol=z.col+U,this.nativeColOff=0,this.nativeRow=z.row+U,this.nativeRowOff=0}else if(Y.nativeCol!==void 0)this.nativeCol=Y.nativeCol||0,this.nativeColOff=Y.nativeColOff||0,this.nativeRow=Y.nativeRow||0,this.nativeRowOff=Y.nativeRowOff||0;else if(Y.col!==void 0)this.col=Y.col+U,this.row=Y.row+U;else this.nativeCol=0,this.nativeColOff=0,this.nativeRow=0,this.nativeRowOff=0}static asInstance($){return $ instanceof RM||$==null?$:new RM($)}get col(){return this.nativeCol+Math.min(this.colWidth-1,this.nativeColOff)/this.colWidth}set col($){this.nativeCol=Math.floor($),this.nativeColOff=Math.floor(($-this.nativeCol)*this.colWidth)}get row(){return this.nativeRow+Math.min(this.rowHeight-1,this.nativeRowOff)/this.rowHeight}set row($){this.nativeRow=Math.floor($),this.nativeRowOff=Math.floor(($-this.nativeRow)*this.rowHeight)}get colWidth(){return this.worksheet&&this.worksheet.getColumn(this.nativeCol+1)&&this.worksheet.getColumn(this.nativeCol+1).isCustomWidth?Math.floor(this.worksheet.getColumn(this.nativeCol+1).width*1e4):640000}get rowHeight(){return this.worksheet&&this.worksheet.getRow(this.nativeRow+1)&&this.worksheet.getRow(this.nativeRow+1).height?Math.floor(this.worksheet.getRow(this.nativeRow+1).height*1e4):180000}get model(){return{nativeCol:this.nativeCol,nativeColOff:this.nativeColOff,nativeRow:this.nativeRow,nativeRowOff:this.nativeRowOff}}set model($){this.nativeCol=$.nativeCol,this.nativeColOff=$.nativeColOff,this.nativeRow=$.nativeRow,this.nativeRowOff=$.nativeRowOff}}k40.exports=RM});var b40=E((an1,u40)=>{var lc0=c4(),_M=x40();class f40{constructor($,Y){this.worksheet=$,this.model=Y}get model(){switch(this.type){case"background":return{type:this.type,imageId:this.imageId};case"image":return{type:this.type,imageId:this.imageId,hyperlinks:this.range.hyperlinks,range:{tl:this.range.tl.model,br:this.range.br&&this.range.br.model,ext:this.range.ext,editAs:this.range.editAs}};default:throw Error("Invalid Image Type")}}set model({type:$,imageId:Y,range:U,hyperlinks:z}){if(this.type=$,this.imageId=Y,$==="image")if(typeof U==="string"){let Q=lc0.decode(U);this.range={tl:new _M(this.worksheet,{col:Q.left,row:Q.top},-1),br:new _M(this.worksheet,{col:Q.right,row:Q.bottom},0),editAs:"oneCell"}}else this.range={tl:new _M(this.worksheet,U.tl,0),br:U.br&&new _M(this.worksheet,U.br,0),ext:U.ext,editAs:U.editAs,hyperlinks:z||U.hyperlinks}}}u40.exports=f40});var p40=E((tn1,n40)=>{var vM=c4();class i40{constructor($,Y,U){this.table=$,this.column=Y,this.index=U}_set($,Y){this.table.cacheState(),this.column[$]=Y}get name(){return this.column.name}set name($){this._set("name",$)}get filterButton(){return this.column.filterButton}set filterButton($){this.column.filterButton=$}get style(){return this.column.style}set style($){this.column.style=$}get totalsRowLabel(){return this.column.totalsRowLabel}set totalsRowLabel($){this._set("totalsRowLabel",$)}get totalsRowFunction(){return this.column.totalsRowFunction}set totalsRowFunction($){this._set("totalsRowFunction",$)}get totalsRowResult(){return this.column.totalsRowResult}set totalsRowResult($){this._set("totalsRowResult",$)}get totalsRowFormula(){return this.column.totalsRowFormula}set totalsRowFormula($){this._set("totalsRowFormula",$)}}class c40{constructor($,Y){if(this.worksheet=$,Y)this.table=Y,this.validate(),this.store()}getFormula($){switch($.totalsRowFunction){case"none":return null;case"average":return`SUBTOTAL(101,${this.table.name}[${$.name}])`;case"countNums":return`SUBTOTAL(102,${this.table.name}[${$.name}])`;case"count":return`SUBTOTAL(103,${this.table.name}[${$.name}])`;case"max":return`SUBTOTAL(104,${this.table.name}[${$.name}])`;case"min":return`SUBTOTAL(105,${this.table.name}[${$.name}])`;case"stdDev":return`SUBTOTAL(106,${this.table.name}[${$.name}])`;case"var":return`SUBTOTAL(107,${this.table.name}[${$.name}])`;case"sum":return`SUBTOTAL(109,${this.table.name}[${$.name}])`;case"custom":return $.totalsRowFormula;default:throw Error(`Invalid Totals Row Function: ${$.totalsRowFunction}`)}}get width(){return this.table.columns.length}get height(){return this.table.rows.length}get filterHeight(){return this.height+(this.table.headerRow?1:0)}get tableHeight(){return this.filterHeight+(this.table.totalsRow?1:0)}validate(){let{table:$}=this,Y=(G,H,W)=>{if(G[H]===void 0)G[H]=W};Y($,"headerRow",!0),Y($,"totalsRow",!1),Y($,"style",{}),Y($.style,"theme","TableStyleMedium2"),Y($.style,"showFirstColumn",!1),Y($.style,"showLastColumn",!1),Y($.style,"showRowStripes",!1),Y($.style,"showColumnStripes",!1);let U=(G,H)=>{if(!G)throw Error(H)};U($.ref,"Table must have ref"),U($.columns,"Table must have column definitions"),U($.rows,"Table must have row definitions"),$.tl=vM.decodeAddress($.ref);let{row:z,col:Q}=$.tl;U(z>0,"Table must be on valid row"),U(Q>0,"Table must be on valid col");let{width:J,filterHeight:I,tableHeight:K}=this;$.autoFilterRef=vM.encode(z,Q,z+I-1,Q+J-1),$.tableRef=vM.encode(z,Q,z+K-1,Q+J-1),$.columns.forEach((G,H)=>{if(U(G.name,`Column ${H} must have a name`),H===0)Y(G,"totalsRowLabel","Total");else Y(G,"totalsRowFunction","none"),G.totalsRowFormula=this.getFormula(G)})}store(){let $=(I,K)=>{if(K)Object.keys(K).forEach((G)=>{I[G]=K[G]})},{worksheet:Y,table:U}=this,{row:z,col:Q}=U.tl,J=0;if(U.headerRow){let I=Y.getRow(z+J++);U.columns.forEach((K,G)=>{let{style:H,name:W}=K,X=I.getCell(Q+G);X.value=W,$(X,H)})}if(U.rows.forEach((I)=>{let K=Y.getRow(z+J++);I.forEach((G,H)=>{let W=K.getCell(Q+H);W.value=G,$(W,U.columns[H].style)})}),U.totalsRow){let I=Y.getRow(z+J++);U.columns.forEach((K,G)=>{let H=I.getCell(Q+G);if(G===0)H.value=K.totalsRowLabel;else if(this.getFormula(K))H.value={formula:K.totalsRowFormula,result:K.totalsRowResult};else H.value=null;$(H,K.style)})}}load($){let{table:Y}=this,{row:U,col:z}=Y.tl,Q=0;if(Y.headerRow){let J=$.getRow(U+Q++);Y.columns.forEach((I,K)=>{let G=J.getCell(z+K);G.value=I.name})}if(Y.rows.forEach((J)=>{let I=$.getRow(U+Q++);J.forEach((K,G)=>{let H=I.getCell(z+G);H.value=K})}),Y.totalsRow){let J=$.getRow(U+Q++);Y.columns.forEach((I,K)=>{let G=J.getCell(z+K);if(K===0)G.value=I.totalsRowLabel;else if(this.getFormula(I))G.value={formula:I.totalsRowFormula,result:I.totalsRowResult}})}}get model(){return this.table}set model($){this.table=$}cacheState(){if(!this._cache)this._cache={ref:this.ref,width:this.width,tableHeight:this.tableHeight}}commit(){if(!this._cache)return;this.validate();let $=vM.decodeAddress(this._cache.ref);if(this.ref!==this._cache.ref)for(let Y=0;Y{z.push(Y[Q])});else this.table.columns.splice(U,0,$),this.table.rows.forEach((z,Q)=>{z.splice(U,0,Y[Q])})}removeColumns($,Y=1){this.cacheState(),this.table.columns.splice($,Y),this.table.rows.forEach((U)=>{U.splice($,Y)})}_assign($,Y,U){this.cacheState(),$[Y]=U}get ref(){return this.table.ref}set ref($){this._assign(this.table,"ref",$)}get name(){return this.table.name}set name($){this.table.name=$}get displayName(){return this.table.displyName||this.table.name}set displayNamename($){this.table.displayName=$}get headerRow(){return this.table.headerRow}set headerRow($){this._assign(this.table,"headerRow",$)}get totalsRow(){return this.table.totalsRow}set totalsRow($){this._assign(this.table,"totalsRow",$)}get theme(){return this.table.style.name}set theme($){this.table.style.name=$}get showFirstColumn(){return this.table.style.showFirstColumn}set showFirstColumn($){this.table.style.showFirstColumn=$}get showLastColumn(){return this.table.style.showLastColumn}set showLastColumn($){this.table.style.showLastColumn=$}get showRowStripes(){return this.table.style.showRowStripes}set showRowStripes($){this.table.style.showRowStripes=$}get showColumnStripes(){return this.table.style.showColumnStripes}set showColumnStripes($){this.table.style.showColumnStripes=$}}n40.exports=c40});var Ig=E((en1,m40)=>{class d40{constructor($){this.model=$||{}}add($,Y){return this.model[$]=Y}find($){return this.model[$]}remove($){this.model[$]=void 0}}m40.exports=d40});var Gg=E(($p1,l40)=>{var Kg=I0("crypto"),oc0={hash($,...Y){let U=Kg.createHash($);return U.update(Buffer.concat(Y)),U.digest()},convertPasswordToHash($,Y,U,z){if(Y=Y.toLowerCase(),Kg.getHashes().indexOf(Y)<0)throw Error(`Hash algorithm '${Y}' not supported!`);let J=Buffer.from($,"utf16le"),I=this.hash(Y,Buffer.from(U,"base64"),J);for(let K=0;K{var o40=($,Y)=>({...$,...Y.reduce((U,z)=>{if($[z])U[z]={...$[z]};return U},{})}),r5=($,Y,U,z=[])=>{if($[U])Y[U]=o40($[U],z)},rc0=($)=>Object.keys($).length===0,sc0=($)=>{if(!$)return $;if(rc0($))return{};let Y={...$};if(r5($,Y,"font",["color"]),r5($,Y,"alignment"),r5($,Y,"protection"),$.border)r5($,Y,"border"),r5($.border,Y.border,"top",["color"]),r5($.border,Y.border,"left",["color"]),r5($.border,Y.border,"bottom",["color"]),r5($.border,Y.border,"right",["color"]),r5($.border,Y.border,"diagonal",["color"]);if($.fill){if(r5($,Y,"fill",["fgColor","bgColor","center"]),$.fill.stops)Y.fill.stops=$.fill.stops.map((U)=>o40(U,["color"]))}return Y};ac0.copyStyle=sc0});var z60=E((Up1,U60)=>{var xH=Y6(),fH=c4(),uH=Y3(),s40=jM(),hM=CM(),ec0=G5(),Hg=b40(),a40=p40(),t40=Ig(),e40=Gg(),{copyStyle:$60}=r40();class Y60{constructor($){$=$||{},this._workbook=$.workbook,this.id=$.id,this.orderNo=$.orderNo,this.name=$.name,this.state=$.state||"visible",this._rows=[],this._columns=null,this._keys={},this._merges={},this.rowBreaks=[],this.properties=Object.assign({},{defaultRowHeight:15,dyDescent:55,outlineLevelCol:0,outlineLevelRow:0},$.properties),this.pageSetup=Object.assign({},{margins:{left:0.7,right:0.7,top:0.75,bottom:0.75,header:0.3,footer:0.3},orientation:"portrait",horizontalDpi:4294967295,verticalDpi:4294967295,fitToPage:!!($.pageSetup&&($.pageSetup.fitToWidth||$.pageSetup.fitToHeight)&&!$.pageSetup.scale),pageOrder:"downThenOver",blackAndWhite:!1,draft:!1,cellComments:"None",errors:"displayed",scale:100,fitToWidth:1,fitToHeight:1,paperSize:void 0,showRowColHeaders:!1,showGridLines:!1,firstPageNumber:void 0,horizontalCentered:!1,verticalCentered:!1,rowBreaks:null,colBreaks:null},$.pageSetup),this.headerFooter=Object.assign({},{differentFirst:!1,differentOddEven:!1,oddHeader:null,oddFooter:null,evenHeader:null,evenFooter:null,firstHeader:null,firstFooter:null},$.headerFooter),this.dataValidations=new t40,this.views=$.views||[],this.autoFilter=$.autoFilter||null,this._media=[],this.sheetProtection=null,this.tables={},this.conditionalFormattings=[]}get name(){return this._name}set name($){if($===void 0)$=`sheet${this.id}`;if(this._name===$)return;if(typeof $!=="string")throw Error("The name has to be a string.");if($==="")throw Error("The name can't be empty.");if($==="History")throw Error('The name "History" is protected. Please use a different name.');if(/[*?:/\\[\]]/.test($))throw Error(`Worksheet name ${$} cannot include any of the following characters: * ? : \\ / [ ]`);if(/(^')|('$)/.test($))throw Error(`The first or last character of worksheet name cannot be a single quotation mark: ${$}`);if($&&$.length>31)console.warn(`Worksheet name ${$} exceeds 31 chars. This will be truncated`),$=$.substring(0,31);if(this._workbook._worksheets.find((Y)=>Y&&Y.name.toLowerCase()===$.toLowerCase()))throw Error(`Worksheet name already exists: ${$}`);this._name=$}get workbook(){return this._workbook}destroy(){this._workbook.removeWorksheetEx(this)}get dimensions(){let $=new uH;return this._rows.forEach((Y)=>{if(Y){let U=Y.dimensions;if(U)$.expand(Y.number,U.min,Y.number,U.max)}}),$}get columns(){return this._columns}set columns($){this._headerRowCount=$.reduce((z,Q)=>{let J=Q.header&&1||Q.headers&&Q.headers.length||0;return Math.max(z,J)},0);let Y=1,U=this._columns=[];$.forEach((z)=>{let Q=new hM(this,Y++,!1);U.push(Q),Q.defn=z})}getColumnKey($){return this._keys[$]}setColumnKey($,Y){this._keys[$]=Y}deleteColumnKey($){delete this._keys[$]}eachColumnKey($){xH.each(this._keys,$)}getColumn($){if(typeof $==="string"){let Y=this._keys[$];if(Y)return Y;$=fH.l2n($)}if(!this._columns)this._columns=[];if($>this._columns.length){let Y=this._columns.length+1;while(Y<=$)this._columns.push(new hM(this,Y++))}return this._columns[$-1]}spliceColumns($,Y,...U){let Q=this._rows.length;if(U.length>0)for(let G=0;G{H.push(X[G]||null)});let W=this.getRow(G+1);W.splice.apply(W,H)}else this._rows.forEach((G)=>{if(G)G.splice($,Y)});let J=U.length-Y,I=$+Y,K=this._columns.length;if(J<0)for(let G=$+U.length;G<=K;G++)this.getColumn(G).defn=this.getColumn(G-J).defn;else if(J>0)for(let G=K;G>=I;G--)this.getColumn(G+J).defn=this.getColumn(G).defn;for(let G=$;G<$+U.length;G++)this.getColumn(G).defn=null;this.workbook.definedNames.spliceColumns(this.name,$,Y,U.length)}get lastColumn(){return this.getColumn(this.columnCount)}get columnCount(){let $=0;return this.eachRow((Y)=>{$=Math.max($,Y.cellCount)}),$}get actualColumnCount(){let $=[],Y=0;return this.eachRow((U)=>{U.eachCell(({col:z})=>{if(!$[z])$[z]=!0,Y++})}),Y}_commitRow(){}get _lastRowNumber(){let $=this._rows,Y=$.length;while(Y>0&&$[Y-1]===void 0)Y--;return Y}get _nextRow(){return this._lastRowNumber+1}get lastRow(){if(this._rows.length)return this._rows[this._rows.length-1];return}findRow($){return this._rows[$-1]}findRows($,Y){return this._rows.slice($-1,$-1+Y)}get rowCount(){return this._lastRowNumber}get actualRowCount(){let $=0;return this.eachRow(()=>{$++}),$}getRow($){let Y=this._rows[$-1];if(!Y)Y=this._rows[$-1]=new s40(this,$);return Y}getRows($,Y){if(Y<1)return;let U=[];for(let z=$;z<$+Y;z++)U.push(this.getRow(z));return U}addRow($,Y="n"){let U=this._nextRow,z=this.getRow(U);return z.values=$,this._setStyleOption(U,Y[0]==="i"?Y:"n"),z}addRows($,Y="n"){let U=[];return $.forEach((z)=>{U.push(this.addRow(z,Y))}),U}insertRow($,Y,U="n"){return this.spliceRows($,0,Y),this._setStyleOption($,U),this.getRow($)}insertRows($,Y,U="n"){if(this.spliceRows($,0,...Y),U!=="n"){for(let z=0;z{Q.getCell(I).style=$60(J.style)}),Q.height=z.height}duplicateRow($,Y,U=!1){let z=this._rows[$-1],Q=Array(Y).fill(z.values);this.spliceRows($+1,U?0:Y,...Q);for(let J=0;J{I.getCell(G).style=K.style})}}spliceRows($,Y,...U){let z=$+Y,Q=U.length,J=Q-Y,I=this._rows.length,K,G;if(J<0){if($===I)this._rows[I-1]=void 0;for(K=z;K<=I;K++)if(G=this._rows[K-1],G){let H=this.getRow(K+J);H.values=G.values,H.style=G.style,H.height=G.height,G.eachCell({includeEmpty:!0},(W,X)=>{H.getCell(X).style=W.style}),this._rows[K-1]=void 0}else this._rows[K+J-1]=void 0}else if(J>0)for(K=I;K>=z;K--)if(G=this._rows[K-1],G){let H=this.getRow(K+J);H.values=G.values,H.style=G.style,H.height=G.height,G.eachCell({includeEmpty:!0},(W,X)=>{if(H.getCell(X).style=W.style,W._value.constructor.name==="MergeValue"){let Z=this.getRow(W._row._number+Q).getCell(X),q=W._value._master,V=this.getRow(q._row._number+Q).getCell(q._column._number);Z.merge(V)}})}else this._rows[K+J-1]=void 0;for(K=0;K{if(U&&U.hasValues)Y(U,U.number)})}getSheetValues(){let $=[];return this._rows.forEach((Y)=>{if(Y)$[Y.number]=Y.values}),$}findCell($,Y){let U=fH.getAddress($,Y),z=this._rows[U.row-1];return z?z.findCell(U.col):void 0}getCell($,Y){let U=fH.getAddress($,Y);return this.getRow(U.row).getCellEx(U)}mergeCells(...$){let Y=new uH($);this._mergeCellsInternal(Y)}mergeCellsWithoutStyle(...$){let Y=new uH($);this._mergeCellsInternal(Y,!0)}_mergeCellsInternal($,Y){xH.each(this._merges,(z)=>{if(z.intersects($))throw Error("Cannot merge already merged cells")});let U=this.getCell($.top,$.left);for(let z=$.top;z<=$.bottom;z++)for(let Q=$.left;Q<=$.right;Q++)if(z>$.top||Q>$.left)this.getCell(z,Q).merge(U,Y);this._merges[U.address]=$}_unMergeMaster($){let Y=this._merges[$.address];if(Y){for(let U=Y.top;U<=Y.bottom;U++)for(let z=Y.left;z<=Y.right;z++)this.getCell(U,z).unmerge();delete this._merges[$.address]}}get hasMerges(){return xH.some(this._merges,Boolean)}unMergeCells(...$){let Y=new uH($);for(let U=Y.top;U<=Y.bottom;U++)for(let z=Y.left;z<=Y.right;z++){let Q=this.findCell(U,z);if(Q){if(Q.type===ec0.ValueType.Merge)this._unMergeMaster(Q.master);else if(this._merges[Q.address])this._unMergeMaster(Q)}}}fillFormula($,Y,U,z="shared"){let Q=fH.decode($),{top:J,left:I,bottom:K,right:G}=Q,H=G-I+1,W=fH.encodeAddress(J,I),X=z==="shared",Z;if(typeof U==="function")Z=U;else if(Array.isArray(U))if(Array.isArray(U[0]))Z=(V,F)=>U[V-J][F-I];else Z=(V,F)=>U[(V-J)*H+(F-I)];else Z=()=>{return};let q=!0;for(let V=J;V<=K;V++)for(let F=I;F<=G;F++)if(q)this.getCell(V,F).value={shareType:z,formula:Y,ref:$,result:Z(V,F)},q=!1;else this.getCell(V,F).value=X?{sharedFormula:W,result:Z(V,F)}:Z(V,F)}addImage($,Y){let U={type:"image",imageId:$,range:Y};this._media.push(new Hg(this,U))}getImages(){return this._media.filter(($)=>$.type==="image")}addBackgroundImage($){let Y={type:"background",imageId:$};this._media.push(new Hg(this,Y))}getBackgroundImageId(){let $=this._media.find((Y)=>Y.type==="background");return $&&$.imageId}protect($,Y){return new Promise((U)=>{if(this.sheetProtection={sheet:!0},Y&&"spinCount"in Y)Y.spinCount=Number.isFinite(Y.spinCount)?Math.round(Math.max(0,Y.spinCount)):1e5;if($)this.sheetProtection.algorithmName="SHA-512",this.sheetProtection.saltValue=e40.randomBytes(16).toString("base64"),this.sheetProtection.spinCount=Y&&"spinCount"in Y?Y.spinCount:1e5,this.sheetProtection.hashValue=e40.convertPasswordToHash($,"SHA512",this.sheetProtection.saltValue,this.sheetProtection.spinCount);if(Y){if(this.sheetProtection=Object.assign(this.sheetProtection,Y),!$&&"spinCount"in Y)delete this.sheetProtection.spinCount}U()})}unprotect(){this.sheetProtection=null}addTable($){let Y=new a40(this,$);return this.tables[$.name]=Y,Y}getTable($){return this.tables[$]}removeTable($){delete this.tables[$]}getTables(){return Object.values(this.tables)}addConditionalFormatting($){this.conditionalFormattings.push($)}removeConditionalFormatting($){if(typeof $==="number")this.conditionalFormattings.splice($,1);else if($ instanceof Function)this.conditionalFormattings=this.conditionalFormattings.filter($);else this.conditionalFormattings=[]}get tabColor(){return console.trace("worksheet.tabColor property is now deprecated. Please use worksheet.properties.tabColor"),this.properties.tabColor}set tabColor($){console.trace("worksheet.tabColor property is now deprecated. Please use worksheet.properties.tabColor"),this.properties.tabColor=$}get model(){let $={id:this.id,name:this.name,dataValidations:this.dataValidations.model,properties:this.properties,state:this.state,pageSetup:this.pageSetup,headerFooter:this.headerFooter,rowBreaks:this.rowBreaks,views:this.views,autoFilter:this.autoFilter,media:this._media.map((z)=>z.model),sheetProtection:this.sheetProtection,tables:Object.values(this.tables).map((z)=>z.model),conditionalFormattings:this.conditionalFormattings};$.cols=hM.toModel(this.columns);let Y=$.rows=[],U=$.dimensions=new uH;return this._rows.forEach((z)=>{let Q=z&&z.model;if(Q)U.expand(Q.number,Q.min,Q.number,Q.max),Y.push(Q)}),$.merges=[],xH.each(this._merges,(z)=>{$.merges.push(z.range)}),$}_parseRows($){this._rows=[],$.rows.forEach((Y)=>{let U=new s40(this,Y.number);this._rows[U.number-1]=U,U.model=Y})}_parseMergeCells($){xH.each($.mergeCells,(Y)=>{this.mergeCellsWithoutStyle(Y)})}set model($){this.name=$.name,this._columns=hM.fromModel(this,$.cols),this._parseRows($),this._parseMergeCells($),this.dataValidations=new t40($.dataValidations),this.properties=$.properties,this.pageSetup=$.pageSetup,this.headerFooter=$.headerFooter,this.views=$.views,this.autoFilter=$.autoFilter,this._media=$.media.map((Y)=>new Hg(this,Y)),this.sheetProtection=$.sheetProtection,this.tables=$.tables.reduce((Y,U)=>{let z=new a40;return z.model=U,Y[U.name]=z,Y},{}),this.conditionalFormattings=$.conditionalFormattings}}U60.exports=Y60});var K60=E((zp1,I60)=>{var Q60=Y6(),SM=c4();class J60{constructor($){this.template=$,this.sheets={}}addCell($){this.addCellEx(SM.decodeEx($))}getCell($){return this.findCellEx(SM.decodeEx($),!0)}findCell($){return this.findCellEx(SM.decodeEx($),!1)}findCellAt($,Y,U){let z=this.sheets[$],Q=z&&z[Y];return Q&&Q[U]}addCellEx($){if($.top)for(let Y=$.top;Y<=$.bottom;Y++)for(let U=$.left;U<=$.right;U++)this.getCellAt($.sheetName,Y,U);else this.findCellEx($,!0)}getCellEx($){return this.findCellEx($,!0)}findCellEx($,Y){let U=this.findSheet($,Y),z=this.findSheetRow(U,$,Y);return this.findRowCell(z,$,Y)}getCellAt($,Y,U){let z=this.sheets[$]||(this.sheets[$]=[]),Q=z[Y]||(z[Y]=[]);return Q[U]||(Q[U]={sheetName:$,address:SM.n2l(U)+Y,row:Y,col:U})}removeCellEx($){let Y=this.findSheet($);if(!Y)return;let U=this.findSheetRow(Y,$);if(!U)return;delete U[$.col]}forEachInSheet($,Y){let U=this.sheets[$];if(U)U.forEach((z,Q)=>{if(z)z.forEach((J,I)=>{if(J)Y(J,Q,I)})})}forEach($){Q60.each(this.sheets,(Y,U)=>{this.forEachInSheet(U,$)})}map($){let Y=[];return this.forEach((U)=>{Y.push($(U))}),Y}findSheet($,Y){let U=$.sheetName;if(this.sheets[U])return this.sheets[U];if(Y)return this.sheets[U]=[];return}findSheetRow($,Y,U){let{row:z}=Y;if($&&$[z])return $[z];if(U)return $[z]=[];return}findRowCell($,Y,U){let{col:z}=Y;if($&&$[z])return $[z];if(U)return $[z]=this.template?Object.assign(Y,JSON.parse(JSON.stringify(this.template))):Y;return}spliceRows($,Y,U,z){let Q=this.sheets[$];if(Q){let J=[];for(let I=0;I{I.splice(Y,U,...J)})}}}I60.exports=J60});var Wg=E((Qp1,W60)=>{var rQ=Y6(),bH=c4(),G60=K60(),$n0=Y3(),Yn0=/[$](\w+)[$](\d+)(:[$](\w+)[$](\d+))?/;class H60{constructor(){this.matrixMap={}}getMatrix($){return this.matrixMap[$]||(this.matrixMap[$]=new G60)}add($,Y){let U=bH.decodeEx($);this.addEx(U,Y)}addEx($,Y){let U=this.getMatrix(Y);if($.top)for(let z=$.left;z<=$.right;z++)for(let Q=$.top;Q<=$.bottom;Q++){let J={sheetName:$.sheetName,address:bH.n2l(z)+Q,row:Q,col:z};U.addCellEx(J)}else U.addCellEx($)}remove($,Y){let U=bH.decodeEx($);this.removeEx(U,Y)}removeEx($,Y){this.getMatrix(Y).removeCellEx($)}removeAllNames($){rQ.each(this.matrixMap,(Y)=>{Y.removeCellEx($)})}forEach($){rQ.each(this.matrixMap,(Y,U)=>{Y.forEach((z)=>{$(U,z)})})}getNames($){return this.getNamesEx(bH.decodeEx($))}getNamesEx($){return rQ.map(this.matrixMap,(Y,U)=>Y.findCellEx($)&&U).filter(Boolean)}_explore($,Y){Y.mark=!1;let{sheetName:U}=Y,z=new $n0(Y.row,Y.col,Y.row,Y.col,U),Q,J;function I(G,H){let W=$.findCellAt(U,G,Y.col);if(!W||!W.mark)return!1;return z[H]=G,W.mark=!1,!0}for(J=Y.row-1;I(J,"top");J--);for(J=Y.row+1;I(J,"bottom");J++);function K(G,H){let W=[];for(J=z.top;J<=z.bottom;J++){let X=$.findCellAt(U,J,G);if(X&&X.mark)W.push(X);else return!1}z[H]=G;for(let X=0;X{z.mark=!0});let U=Y.map((z)=>z.mark&&this._explore(Y,z)).filter(Boolean).map((z)=>z.$shortRange);return{name:$,ranges:U}}normaliseMatrix($,Y){$.forEachInSheet(Y,(U,z,Q)=>{if(U){if(U.row!==z||U.col!==Q)U.row=z,U.col=Q,U.address=bH.n2l(Q)+z}})}spliceRows($,Y,U,z){rQ.each(this.matrixMap,(Q)=>{Q.spliceRows($,Y,U,z),this.normaliseMatrix(Q,$)})}spliceColumns($,Y,U,z){rQ.each(this.matrixMap,(Q)=>{Q.spliceColumns($,Y,U,z),this.normaliseMatrix(Q,$)})}get model(){return rQ.map(this.matrixMap,($,Y)=>this.getRanges(Y,$)).filter(($)=>$.ranges.length)}set model($){let Y=this.matrixMap={};$.forEach((U)=>{let z=Y[U.name]=new G60;U.ranges.forEach((Q)=>{if(Yn0.test(Q.split("!").pop()||""))z.addCell(Q)})})}}W60.exports=H60});var I6=E((Jp1,Xg)=>{if(typeof process>"u"||!process.version||process.version.indexOf("v0.")===0||process.version.indexOf("v1.")===0&&process.version.indexOf("v1.8.")!==0)Xg.exports={nextTick:Un0};else Xg.exports=process;function Un0($,Y,U,z){if(typeof $!=="function")throw TypeError('"callback" argument must be a function');var Q=arguments.length,J,I;switch(Q){case 0:case 1:return process.nextTick($);case 2:return process.nextTick(function(){$.call(null,Y)});case 3:return process.nextTick(function(){$.call(null,Y,U)});case 4:return process.nextTick(function(){$.call(null,Y,U,z)});default:J=Array(Q-1),I=0;while(I{var zn0={}.toString;X60.exports=Array.isArray||function($){return zn0.call($)=="[object Array]"}});var K6=E((Zg,q60)=>{var gM=I0("buffer"),U3=gM.Buffer;function Z60($,Y){for(var U in $)Y[U]=$[U]}if(U3.from&&U3.alloc&&U3.allocUnsafe&&U3.allocUnsafeSlow)q60.exports=gM;else Z60(gM,Zg),Zg.Buffer=aQ;function aQ($,Y,U){return U3($,Y,U)}Z60(U3,aQ);aQ.from=function($,Y,U){if(typeof $==="number")throw TypeError("Argument must not be a number");return U3($,Y,U)};aQ.alloc=function($,Y,U){if(typeof $!=="number")throw TypeError("Argument must be a number");var z=U3($);if(Y!==void 0)if(typeof U==="string")z.fill(Y,U);else z.fill(Y);else z.fill(0);return z};aQ.allocUnsafe=function($){if(typeof $!=="number")throw TypeError("Argument must be a number");return U3($)};aQ.allocUnsafeSlow=function($){if(typeof $!=="number")throw TypeError("Argument must be a number");return gM.SlowBuffer($)}});var M4=E((Mn0)=>{function Qn0($){if(Array.isArray)return Array.isArray($);return yM($)==="[object Array]"}Mn0.isArray=Qn0;function Jn0($){return typeof $==="boolean"}Mn0.isBoolean=Jn0;function In0($){return $===null}Mn0.isNull=In0;function Kn0($){return $==null}Mn0.isNullOrUndefined=Kn0;function Gn0($){return typeof $==="number"}Mn0.isNumber=Gn0;function Hn0($){return typeof $==="string"}Mn0.isString=Hn0;function Wn0($){return typeof $==="symbol"}Mn0.isSymbol=Wn0;function Xn0($){return $===void 0}Mn0.isUndefined=Xn0;function Zn0($){return yM($)==="[object RegExp]"}Mn0.isRegExp=Zn0;function qn0($){return typeof $==="object"&&$!==null}Mn0.isObject=qn0;function Vn0($){return yM($)==="[object Date]"}Mn0.isDate=Vn0;function Ln0($){return yM($)==="[object Error]"||$ instanceof Error}Mn0.isError=Ln0;function Fn0($){return typeof $==="function"}Mn0.isFunction=Fn0;function wn0($){return $===null||typeof $==="boolean"||typeof $==="number"||typeof $==="string"||typeof $==="symbol"||typeof $>"u"}Mn0.isPrimitive=wn0;Mn0.isBuffer=I0("buffer").Buffer.isBuffer;function yM($){return Object.prototype.toString.call($)}});var V60=E((Gp1,qg)=>{if(typeof Object.create==="function")qg.exports=function(Y,U){if(U)Y.super_=U,Y.prototype=Object.create(U.prototype,{constructor:{value:Y,enumerable:!1,writable:!0,configurable:!0}})};else qg.exports=function(Y,U){if(U){Y.super_=U;var z=function(){};z.prototype=U.prototype,Y.prototype=new z,Y.prototype.constructor=Y}}});var X1=E((Hp1,Vg)=>{try{if(kM=I0("util"),typeof kM.inherits!=="function")throw"";Vg.exports=kM.inherits}catch($){Vg.exports=V60()}var kM});var F60=E((Wp1,Lg)=>{function gn0($,Y){if(!($ instanceof Y))throw TypeError("Cannot call a class as a function")}var L60=K6().Buffer,iH=I0("util");function yn0($,Y,U){$.copy(Y,U)}Lg.exports=function(){function $(){gn0(this,$),this.head=null,this.tail=null,this.length=0}return $.prototype.push=function(U){var z={data:U,next:null};if(this.length>0)this.tail.next=z;else this.head=z;this.tail=z,++this.length},$.prototype.unshift=function(U){var z={data:U,next:this.head};if(this.length===0)this.tail=z;this.head=z,++this.length},$.prototype.shift=function(){if(this.length===0)return;var U=this.head.data;if(this.length===1)this.head=this.tail=null;else this.head=this.head.next;return--this.length,U},$.prototype.clear=function(){this.head=this.tail=null,this.length=0},$.prototype.join=function(U){if(this.length===0)return"";var z=this.head,Q=""+z.data;while(z=z.next)Q+=U+z.data;return Q},$.prototype.concat=function(U){if(this.length===0)return L60.alloc(0);var z=L60.allocUnsafe(U>>>0),Q=this.head,J=0;while(Q)yn0(Q.data,z,J),J+=Q.data.length,Q=Q.next;return z},$}();if(iH&&iH.inspect&&iH.inspect.custom)Lg.exports.prototype[iH.inspect.custom]=function(){var $=iH.inspect({length:this.length});return this.constructor.name+" "+$}});var Fg=E((Xp1,w60)=>{var xM=I6();function kn0($,Y){var U=this,z=this._readableState&&this._readableState.destroyed,Q=this._writableState&&this._writableState.destroyed;if(z||Q){if(Y)Y($);else if($){if(!this._writableState)xM.nextTick(fM,this,$);else if(!this._writableState.errorEmitted)this._writableState.errorEmitted=!0,xM.nextTick(fM,this,$)}return this}if(this._readableState)this._readableState.destroyed=!0;if(this._writableState)this._writableState.destroyed=!0;return this._destroy($||null,function(J){if(!Y&&J){if(!U._writableState)xM.nextTick(fM,U,J);else if(!U._writableState.errorEmitted)U._writableState.errorEmitted=!0,xM.nextTick(fM,U,J)}else if(Y)Y(J)}),this}function xn0(){if(this._readableState)this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1;if(this._writableState)this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1}function fM($,Y){$.emit("error",Y)}w60.exports={destroy:kn0,undestroy:xn0}});var y7=E((Zp1,M60)=>{M60.exports=I0("util").deprecate});var Mg=E((qp1,j60)=>{var dY=I6();j60.exports=Z6;function N60($){var Y=this;this.next=null,this.entry=null,this.finish=function(){Yp0(Y,$)}}var fn0=["v0.10","v0.9."].indexOf(process.version.slice(0,5))>-1?setImmediate:dY.nextTick,tQ;Z6.WritableState=nH;var D60=Object.create(M4());D60.inherits=X1();var un0={deprecate:y7()},A60=I0("stream"),bM=K6().Buffer,bn0=(typeof global<"u"?global:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function in0($){return bM.from($)}function cn0($){return bM.isBuffer($)||$ instanceof bn0}var B60=Fg();D60.inherits(Z6,A60);function nn0(){}function nH($,Y){tQ=tQ||mY(),$=$||{};var U=Y instanceof tQ;if(this.objectMode=!!$.objectMode,U)this.objectMode=this.objectMode||!!$.writableObjectMode;var{highWaterMark:z,writableHighWaterMark:Q}=$,J=this.objectMode?16:16384;if(z||z===0)this.highWaterMark=z;else if(U&&(Q||Q===0))this.highWaterMark=Q;else this.highWaterMark=J;this.highWaterMark=Math.floor(this.highWaterMark),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var I=$.decodeStrings===!1;this.decodeStrings=!I,this.defaultEncoding=$.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(K){sn0(Y,K)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new N60(this)}nH.prototype.getBuffer=function(){var Y=this.bufferedRequest,U=[];while(Y)U.push(Y),Y=Y.next;return U};(function(){try{Object.defineProperty(nH.prototype,"buffer",{get:un0.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch($){}})();var uM;if(typeof Symbol==="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]==="function")uM=Function.prototype[Symbol.hasInstance],Object.defineProperty(Z6,Symbol.hasInstance,{value:function($){if(uM.call(this,$))return!0;if(this!==Z6)return!1;return $&&$._writableState instanceof nH}});else uM=function($){return $ instanceof this};function Z6($){if(tQ=tQ||mY(),!uM.call(Z6,this)&&!(this instanceof tQ))return new Z6($);if(this._writableState=new nH($,this),this.writable=!0,$){if(typeof $.write==="function")this._write=$.write;if(typeof $.writev==="function")this._writev=$.writev;if(typeof $.destroy==="function")this._destroy=$.destroy;if(typeof $.final==="function")this._final=$.final}A60.call(this)}Z6.prototype.pipe=function(){this.emit("error",Error("Cannot pipe, not readable"))};function pn0($,Y){var U=Error("write after end");$.emit("error",U),dY.nextTick(Y,U)}function dn0($,Y,U,z){var Q=!0,J=!1;if(U===null)J=TypeError("May not write null values to stream");else if(typeof U!=="string"&&U!==void 0&&!Y.objectMode)J=TypeError("Invalid non-string/buffer chunk");if(J)$.emit("error",J),dY.nextTick(z,J),Q=!1;return Q}Z6.prototype.write=function($,Y,U){var z=this._writableState,Q=!1,J=!z.objectMode&&cn0($);if(J&&!bM.isBuffer($))$=in0($);if(typeof Y==="function")U=Y,Y=null;if(J)Y="buffer";else if(!Y)Y=z.defaultEncoding;if(typeof U!=="function")U=nn0;if(z.ended)pn0(this,U);else if(J||dn0(this,z,$,U))z.pendingcb++,Q=ln0(this,z,J,$,Y,U);return Q};Z6.prototype.cork=function(){var $=this._writableState;$.corked++};Z6.prototype.uncork=function(){var $=this._writableState;if($.corked){if($.corked--,!$.writing&&!$.corked&&!$.bufferProcessing&&$.bufferedRequest)P60(this,$)}};Z6.prototype.setDefaultEncoding=function(Y){if(typeof Y==="string")Y=Y.toLowerCase();if(!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((Y+"").toLowerCase())>-1))throw TypeError("Unknown encoding: "+Y);return this._writableState.defaultEncoding=Y,this};function mn0($,Y,U){if(!$.objectMode&&$.decodeStrings!==!1&&typeof Y==="string")Y=bM.from(Y,U);return Y}Object.defineProperty(Z6.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function ln0($,Y,U,z,Q,J){if(!U){var I=mn0(Y,z,Q);if(z!==I)U=!0,Q="buffer",z=I}var K=Y.objectMode?1:z.length;Y.length+=K;var G=Y.length{var E60=I6(),Up0=Object.keys||function($){var Y=[];for(var U in $)Y.push(U);return Y};_60.exports=z3;var C60=Object.create(M4());C60.inherits=X1();var R60=Ng(),Og=Mg();C60.inherits(z3,R60);{iM=Up0(Og.prototype);for(pH=0;pH{var Ag=K6().Buffer,v60=Ag.isEncoding||function($){switch($=""+$,$&&$.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function Jp0($){if(!$)return"utf8";var Y;while(!0)switch($){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return $;default:if(Y)return;$=(""+$).toLowerCase(),Y=!0}}function Ip0($){var Y=Jp0($);if(typeof Y!=="string"&&(Ag.isEncoding===v60||!v60($)))throw Error("Unknown encoding: "+$);return Y||$}Mp0.StringDecoder=mH;function mH($){this.encoding=Ip0($);var Y;switch(this.encoding){case"utf16le":this.text=Zp0,this.end=qp0,Y=4;break;case"utf8":this.fillLast=Hp0,Y=4;break;case"base64":this.text=Vp0,this.end=Lp0,Y=3;break;default:this.write=Fp0,this.end=wp0;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=Ag.allocUnsafe(Y)}mH.prototype.write=function($){if($.length===0)return"";var Y,U;if(this.lastNeed){if(Y=this.fillLast($),Y===void 0)return"";U=this.lastNeed,this.lastNeed=0}else U=0;if(U<$.length)return Y?Y+this.text($,U):this.text($,U);return Y||""};mH.prototype.end=Xp0;mH.prototype.text=Wp0;mH.prototype.fillLast=function($){if(this.lastNeed<=$.length)return $.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);$.copy(this.lastChar,this.lastTotal-this.lastNeed,0,$.length),this.lastNeed-=$.length};function Dg($){if($<=127)return 0;else if($>>5===6)return 2;else if($>>4===14)return 3;else if($>>3===30)return 4;return $>>6===2?-1:-2}function Kp0($,Y,U){var z=Y.length-1;if(z=0){if(Q>0)$.lastNeed=Q-1;return Q}if(--z=0){if(Q>0)$.lastNeed=Q-2;return Q}if(--z=0){if(Q>0)if(Q===2)Q=0;else $.lastNeed=Q-3;return Q}return 0}function Gp0($,Y,U){if((Y[0]&192)!==128)return $.lastNeed=0,"�";if($.lastNeed>1&&Y.length>1){if((Y[1]&192)!==128)return $.lastNeed=1,"�";if($.lastNeed>2&&Y.length>2){if((Y[2]&192)!==128)return $.lastNeed=2,"�"}}}function Hp0($){var Y=this.lastTotal-this.lastNeed,U=Gp0(this,$,Y);if(U!==void 0)return U;if(this.lastNeed<=$.length)return $.copy(this.lastChar,Y,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);$.copy(this.lastChar,Y,0,$.length),this.lastNeed-=$.length}function Wp0($,Y){var U=Kp0(this,$,Y);if(!this.lastNeed)return $.toString("utf8",Y);this.lastTotal=U;var z=$.length-(U-this.lastNeed);return $.copy(this.lastChar,0,z),$.toString("utf8",Y,z)}function Xp0($){var Y=$&&$.length?this.write($):"";if(this.lastNeed)return Y+"�";return Y}function Zp0($,Y){if(($.length-Y)%2===0){var U=$.toString("utf16le",Y);if(U){var z=U.charCodeAt(U.length-1);if(z>=55296&&z<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=$[$.length-2],this.lastChar[1]=$[$.length-1],U.slice(0,-1)}return U}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=$[$.length-1],$.toString("utf16le",Y,$.length-1)}function qp0($){var Y=$&&$.length?this.write($):"";if(this.lastNeed){var U=this.lastTotal-this.lastNeed;return Y+this.lastChar.toString("utf16le",0,U)}return Y}function Vp0($,Y){var U=($.length-Y)%3;if(U===0)return $.toString("base64",Y);if(this.lastNeed=3-U,this.lastTotal=3,U===1)this.lastChar[0]=$[$.length-1];else this.lastChar[0]=$[$.length-2],this.lastChar[1]=$[$.length-1];return $.toString("base64",Y,$.length-U)}function Lp0($){var Y=$&&$.length?this.write($):"";if(this.lastNeed)return Y+this.lastChar.toString("base64",0,3-this.lastNeed);return Y}function Fp0($){return $.toString(this.encoding)}function wp0($){return $&&$.length?this.write($):""}});var Ng=E((wp1,n60)=>{var $J=I6();n60.exports=B4;var Np0=sQ(),lH;B4.ReadableState=f60;var Fp1=I0("events").EventEmitter,y60=function($,Y){return $.listeners(Y).length},Cg=I0("stream"),oH=K6().Buffer,Dp0=(typeof global<"u"?global:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function Ap0($){return oH.from($)}function Bp0($){return oH.isBuffer($)||$ instanceof Dp0}var k60=Object.create(M4());k60.inherits=X1();var Pg=I0("util"),t1=void 0;if(Pg&&Pg.debuglog)t1=Pg.debuglog("stream");else t1=function(){};var Pp0=F60(),x60=Fg(),eQ;k60.inherits(B4,Cg);var Tg=["error","close","destroy","pause","resume"];function Tp0($,Y,U){if(typeof $.prependListener==="function")return $.prependListener(Y,U);if(!$._events||!$._events[Y])$.on(Y,U);else if(Np0($._events[Y]))$._events[Y].unshift(U);else $._events[Y]=[U,$._events[Y]]}function f60($,Y){lH=lH||mY(),$=$||{};var U=Y instanceof lH;if(this.objectMode=!!$.objectMode,U)this.objectMode=this.objectMode||!!$.readableObjectMode;var{highWaterMark:z,readableHighWaterMark:Q}=$,J=this.objectMode?16:16384;if(z||z===0)this.highWaterMark=z;else if(U&&(Q||Q===0))this.highWaterMark=Q;else this.highWaterMark=J;if(this.highWaterMark=Math.floor(this.highWaterMark),this.buffer=new Pp0,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.destroyed=!1,this.defaultEncoding=$.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,$.encoding){if(!eQ)eQ=Bg().StringDecoder;this.decoder=new eQ($.encoding),this.encoding=$.encoding}}function B4($){if(lH=lH||mY(),!(this instanceof B4))return new B4($);if(this._readableState=new f60($,this),this.readable=!0,$){if(typeof $.read==="function")this._read=$.read;if(typeof $.destroy==="function")this._destroy=$.destroy}Cg.call(this)}Object.defineProperty(B4.prototype,"destroyed",{get:function(){if(this._readableState===void 0)return!1;return this._readableState.destroyed},set:function($){if(!this._readableState)return;this._readableState.destroyed=$}});B4.prototype.destroy=x60.destroy;B4.prototype._undestroy=x60.undestroy;B4.prototype._destroy=function($,Y){this.push(null),Y($)};B4.prototype.push=function($,Y){var U=this._readableState,z;if(!U.objectMode){if(typeof $==="string"){if(Y=Y||U.defaultEncoding,Y!==U.encoding)$=oH.from($,Y),Y="";z=!0}}else z=!0;return u60(this,$,Y,!1,z)};B4.prototype.unshift=function($){return u60(this,$,null,!0,!1)};function u60($,Y,U,z,Q){var J=$._readableState;if(Y===null)J.reading=!1,Rp0($,J);else{var I;if(!Q)I=jp0(J,Y);if(I)$.emit("error",I);else if(J.objectMode||Y&&Y.length>0){if(typeof Y!=="string"&&!J.objectMode&&Object.getPrototypeOf(Y)!==oH.prototype)Y=Ap0(Y);if(z)if(J.endEmitted)$.emit("error",Error("stream.unshift() after end event"));else jg($,J,Y,!0);else if(J.ended)$.emit("error",Error("stream.push() after EOF"));else if(J.reading=!1,J.decoder&&!U)if(Y=J.decoder.write(Y),J.objectMode||Y.length!==0)jg($,J,Y,!1);else b60($,J);else jg($,J,Y,!1)}else if(!z)J.reading=!1}return Ep0(J)}function jg($,Y,U,z){if(Y.flowing&&Y.length===0&&!Y.sync)$.emit("data",U),$.read(0);else{if(Y.length+=Y.objectMode?1:U.length,z)Y.buffer.unshift(U);else Y.buffer.push(U);if(Y.needReadable)cM($)}b60($,Y)}function jp0($,Y){var U;if(!Bp0(Y)&&typeof Y!=="string"&&Y!==void 0&&!$.objectMode)U=TypeError("Invalid non-string/buffer chunk");return U}function Ep0($){return!$.ended&&($.needReadable||$.length<$.highWaterMark||$.length===0)}B4.prototype.isPaused=function(){return this._readableState.flowing===!1};B4.prototype.setEncoding=function($){if(!eQ)eQ=Bg().StringDecoder;return this._readableState.decoder=new eQ($),this._readableState.encoding=$,this};var h60=8388608;function Cp0($){if($>=h60)$=h60;else $--,$|=$>>>1,$|=$>>>2,$|=$>>>4,$|=$>>>8,$|=$>>>16,$++;return $}function S60($,Y){if($<=0||Y.length===0&&Y.ended)return 0;if(Y.objectMode)return 1;if($!==$)if(Y.flowing&&Y.length)return Y.buffer.head.data.length;else return Y.length;if($>Y.highWaterMark)Y.highWaterMark=Cp0($);if($<=Y.length)return $;if(!Y.ended)return Y.needReadable=!0,0;return Y.length}B4.prototype.read=function($){t1("read",$),$=parseInt($,10);var Y=this._readableState,U=$;if($!==0)Y.emittedReadable=!1;if($===0&&Y.needReadable&&(Y.length>=Y.highWaterMark||Y.ended)){if(t1("read: emitReadable",Y.length,Y.ended),Y.length===0&&Y.ended)Eg(this);else cM(this);return null}if($=S60($,Y),$===0&&Y.ended){if(Y.length===0)Eg(this);return null}var z=Y.needReadable;if(t1("need readable",z),Y.length===0||Y.length-$0)Q=i60($,Y);else Q=null;if(Q===null)Y.needReadable=!0,$=0;else Y.length-=$;if(Y.length===0){if(!Y.ended)Y.needReadable=!0;if(U!==$&&Y.ended)Eg(this)}if(Q!==null)this.emit("data",Q);return Q};function Rp0($,Y){if(Y.ended)return;if(Y.decoder){var U=Y.decoder.end();if(U&&U.length)Y.buffer.push(U),Y.length+=Y.objectMode?1:U.length}Y.ended=!0,cM($)}function cM($){var Y=$._readableState;if(Y.needReadable=!1,!Y.emittedReadable)if(t1("emitReadable",Y.flowing),Y.emittedReadable=!0,Y.sync)$J.nextTick(g60,$);else g60($)}function g60($){t1("emit readable"),$.emit("readable"),Rg($)}function b60($,Y){if(!Y.readingMore)Y.readingMore=!0,$J.nextTick(_p0,$,Y)}function _p0($,Y){var U=Y.length;while(!Y.reading&&!Y.flowing&&!Y.ended&&Y.length1&&c60(z.pipes,$)!==-1)&&!H)t1("false write response, pause",z.awaitDrain),z.awaitDrain++,X=!0;U.pause()}}function q(w){if(t1("onerror",w),M(),$.removeListener("error",q),y60($,"error")===0)$.emit("error",w)}Tp0($,"error",q);function V(){$.removeListener("finish",F),M()}$.once("close",V);function F(){t1("onfinish"),$.removeListener("close",V),M()}$.once("finish",F);function M(){t1("unpipe"),U.unpipe($)}if($.emit("pipe",U),!z.flowing)t1("pipe resume"),U.resume();return $};function vp0($){return function(){var Y=$._readableState;if(t1("pipeOnDrain",Y.awaitDrain),Y.awaitDrain)Y.awaitDrain--;if(Y.awaitDrain===0&&y60($,"data"))Y.flowing=!0,Rg($)}}B4.prototype.unpipe=function($){var Y=this._readableState,U={hasUnpiped:!1};if(Y.pipesCount===0)return this;if(Y.pipesCount===1){if($&&$!==Y.pipes)return this;if(!$)$=Y.pipes;if(Y.pipes=null,Y.pipesCount=0,Y.flowing=!1,$)$.emit("unpipe",this,U);return this}if(!$){var{pipes:z,pipesCount:Q}=Y;Y.pipes=null,Y.pipesCount=0,Y.flowing=!1;for(var J=0;J=Y.length){if(Y.decoder)U=Y.buffer.join("");else if(Y.buffer.length===1)U=Y.buffer.head.data;else U=Y.buffer.concat(Y.length);Y.buffer.clear()}else U=yp0($,Y.buffer,Y.decoder);return U}function yp0($,Y,U){var z;if($J.length?J.length:$;if(I===J.length)Q+=J;else Q+=J.slice(0,$);if($-=I,$===0){if(I===J.length)if(++z,U.next)Y.head=U.next;else Y.head=Y.tail=null;else Y.head=U,U.data=J.slice(I);break}++z}return Y.length-=z,Q}function xp0($,Y){var U=oH.allocUnsafe($),z=Y.head,Q=1;z.data.copy(U),$-=z.data.length;while(z=z.next){var J=z.data,I=$>J.length?J.length:$;if(J.copy(U,U.length-$,0,I),$-=I,$===0){if(I===J.length)if(++Q,z.next)Y.head=z.next;else Y.head=Y.tail=null;else Y.head=z,z.data=J.slice(I);break}++Q}return Y.length-=Q,U}function Eg($){var Y=$._readableState;if(Y.length>0)throw Error('"endReadable()" called on non-empty stream');if(!Y.endEmitted)Y.ended=!0,$J.nextTick(fp0,Y,$)}function fp0($,Y){if(!$.endEmitted&&$.length===0)$.endEmitted=!0,Y.readable=!1,Y.emit("end")}function c60($,Y){for(var U=0,z=$.length;U{m60.exports=Q3;var nM=mY(),d60=Object.create(M4());d60.inherits=X1();d60.inherits(Q3,nM);function up0($,Y){var U=this._transformState;U.transforming=!1;var z=U.writecb;if(!z)return this.emit("error",Error("write callback called multiple times"));if(U.writechunk=null,U.writecb=null,Y!=null)this.push(Y);z($);var Q=this._readableState;if(Q.reading=!1,Q.needReadable||Q.length{r60.exports=rH;var l60=_g(),o60=Object.create(M4());o60.inherits=X1();o60.inherits(rH,l60);function rH($){if(!(this instanceof rH))return new rH($);l60.call(this,$)}rH.prototype._transform=function($,Y,U){U(null,$)}});var vg=E((d6,pM)=>{var s5=I0("stream");if(process.env.READABLE_STREAM==="disable"&&s5)pM.exports=s5,d6=pM.exports=s5.Readable,d6.Readable=s5.Readable,d6.Writable=s5.Writable,d6.Duplex=s5.Duplex,d6.Transform=s5.Transform,d6.PassThrough=s5.PassThrough,d6.Stream=s5;else d6=pM.exports=Ng(),d6.Stream=s5||d6,d6.Readable=d6,d6.Writable=Mg(),d6.Duplex=mY(),d6.Transform=_g(),d6.PassThrough=s60()});var J3=E((cp0)=>{cp0.base64=!0;cp0.array=!0;cp0.string=!0;cp0.arraybuffer=typeof ArrayBuffer<"u"&&typeof Uint8Array<"u";cp0.nodebuffer=typeof Buffer<"u";cp0.uint8array=typeof Uint8Array<"u";if(typeof ArrayBuffer>"u")cp0.blob=!1;else{dM=new ArrayBuffer(0);try{cp0.blob=new Blob([dM],{type:"application/zip"}).size===0}catch($){try{Sg=self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder,mM=new Sg,mM.append(dM),cp0.blob=mM.getBlob("application/zip").size===0}catch(Y){cp0.blob=!1}}}var dM,Sg,mM;try{cp0.nodestream=!!vg().Readable}catch($){cp0.nodestream=!1}});var gg=E((ap0)=>{var rp0=n4(),sp0=J3(),a5="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";ap0.encode=function($){var Y=[],U,z,Q,J,I,K,G,H=0,W=$.length,X=W,Z=rp0.getTypeOf($)!=="string";while(H<$.length){if(X=W-H,!Z)U=$.charCodeAt(H++),z=H>2,I=(U&3)<<4|z>>4,K=X>1?(z&15)<<2|Q>>6:64,G=X>2?Q&63:64,Y.push(a5.charAt(J)+a5.charAt(I)+a5.charAt(K)+a5.charAt(G))}return Y.join("")};ap0.decode=function($){var Y,U,z,Q,J,I,K,G=0,H=0,W="data:";if($.substr(0,W.length)===W)throw Error("Invalid base64 input, it looks like a data url.");$=$.replace(/[^A-Za-z0-9+/=]/g,"");var X=$.length*3/4;if($.charAt($.length-1)===a5.charAt(64))X--;if($.charAt($.length-2)===a5.charAt(64))X--;if(X%1!==0)throw Error("Invalid base64 input, bad content length.");var Z;if(sp0.uint8array)Z=new Uint8Array(X|0);else Z=Array(X|0);while(G<$.length){if(Q=a5.indexOf($.charAt(G++)),J=a5.indexOf($.charAt(G++)),I=a5.indexOf($.charAt(G++)),K=a5.indexOf($.charAt(G++)),Y=Q<<2|J>>4,U=(J&15)<<4|I>>2,z=(I&3)<<6|K,Z[H++]=Y,I!==64)Z[H++]=U;if(K!==64)Z[H++]=z}return Z}});var sH=E((Ap1,a60)=>{a60.exports={isNode:typeof Buffer<"u",newBufferFrom:function($,Y){if(Buffer.from&&Buffer.from!==Uint8Array.from)return Buffer.from($,Y);else{if(typeof $==="number")throw Error('The "data" argument must not be a number');return new Buffer($,Y)}},allocBuffer:function($){if(Buffer.alloc)return Buffer.alloc($);else{var Y=new Buffer($);return Y.fill(0),Y}},isBuffer:function($){return Buffer.isBuffer($)},isStream:function($){return $&&typeof $.on==="function"&&typeof $.pause==="function"&&typeof $.resume==="function"}}});var $80=E((Pp1,e60)=>{var Bp1=global.MutationObserver||global.WebKitMutationObserver,t60;t60=function(){process.nextTick(Qd0)};var $d0,Yd0,Ud0,zd0,yg,aH=[];function Qd0(){yg=!0;var $,Y,U=aH.length;while(U){Y=aH,aH=[],$=-1;while(++${var Y80=$80();function UJ(){}var X8={},U80=["REJECTED"],kg=["FULFILLED"],z80=["PENDING"];YJ=["UNHANDLED"];var YJ;I80.exports=k7;function k7($){if(typeof $!=="function")throw TypeError("resolver must be a function");if(this.state=z80,this.queue=[],this.outcome=void 0,this.handled=YJ,$!==UJ)Q80(this,$)}k7.prototype.finally=function($){if(typeof $!=="function")return this;var Y=this.constructor;return this.then(U,z);function U(Q){function J(){return Q}return Y.resolve($()).then(J)}function z(Q){function J(){throw Q}return Y.resolve($()).then(J)}};k7.prototype.catch=function($){return this.then(null,$)};k7.prototype.then=function($,Y){if(typeof $!=="function"&&this.state===kg||typeof Y!=="function"&&this.state===U80)return this;var U=new this.constructor(UJ);if(this.handled===YJ)this.handled=null;if(this.state!==z80){var z=this.state===kg?$:Y;xg(U,z,this.outcome)}else this.queue.push(new tH(U,$,Y));return U};function tH($,Y,U){if(this.promise=$,typeof Y==="function")this.onFulfilled=Y,this.callFulfilled=this.otherCallFulfilled;if(typeof U==="function")this.onRejected=U,this.callRejected=this.otherCallRejected}tH.prototype.callFulfilled=function($){X8.resolve(this.promise,$)};tH.prototype.otherCallFulfilled=function($){xg(this.promise,this.onFulfilled,$)};tH.prototype.callRejected=function($){X8.reject(this.promise,$)};tH.prototype.otherCallRejected=function($){xg(this.promise,this.onRejected,$)};function xg($,Y,U){Y80(function(){var z;try{z=Y(U)}catch(Q){return X8.reject($,Q)}if(z===$)X8.reject($,TypeError("Cannot resolve promise with itself"));else X8.resolve($,z)})}X8.resolve=function($,Y){var U=J80(Id0,Y);if(U.status==="error")return X8.reject($,U.value);var z=U.value;if(z)Q80($,z);else{$.state=kg,$.outcome=Y;var Q=-1,J=$.queue.length;while(++Q{var fg=null;if(typeof Promise<"u")fg=Promise;else fg=K80();G80.exports={Promise:fg}});var ug=E((H80)=>{(function($,Y){if($.setImmediate)return;var U=1,z={},Q=!1,J=$.document,I;function K(N){if(typeof N!=="function")N=Function(""+N);var O=Array(arguments.length-1);for(var D=0;D"u"?typeof global>"u"?H80:global:self)});var n4=E((qd0)=>{var x7=J3(),Xd0=gg(),QJ=sH(),bg=zJ();ug();function Zd0($){var Y=null;if(x7.uint8array)Y=new Uint8Array($.length);else Y=Array($.length);return oM($,Y)}qd0.newBlob=function($,Y){qd0.checkSupport("blob");try{return new Blob([$],{type:Y})}catch(Q){try{var U=self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder,z=new U;return z.append($),z.getBlob(Y)}catch(J){throw Error("Bug : can't construct the Blob.")}}};function eH($){return $}function oM($,Y){for(var U=0;U<$.length;++U)Y[U]=$.charCodeAt(U)&255;return Y}var lM={stringifyByChunk:function($,Y,U){var z=[],Q=0,J=$.length;if(J<=U)return String.fromCharCode.apply(null,$);while(Q1)try{return lM.stringifyByChunk($,U,Y)}catch(Q){Y=Math.floor(Y/2)}return lM.stringifyByChar($)}qd0.applyFromCharCode=$W;function rM($,Y){for(var U=0;U<$.length;U++)Y[U]=$[U];return Y}var f7={};f7.string={string:eH,array:function($){return oM($,Array($.length))},arraybuffer:function($){return f7.string.uint8array($).buffer},uint8array:function($){return oM($,new Uint8Array($.length))},nodebuffer:function($){return oM($,QJ.allocBuffer($.length))}};f7.array={string:$W,array:eH,arraybuffer:function($){return new Uint8Array($).buffer},uint8array:function($){return new Uint8Array($)},nodebuffer:function($){return QJ.newBufferFrom($)}};f7.arraybuffer={string:function($){return $W(new Uint8Array($))},array:function($){return rM(new Uint8Array($),Array($.byteLength))},arraybuffer:eH,uint8array:function($){return new Uint8Array($)},nodebuffer:function($){return QJ.newBufferFrom(new Uint8Array($))}};f7.uint8array={string:$W,array:function($){return rM($,Array($.length))},arraybuffer:function($){return $.buffer},uint8array:eH,nodebuffer:function($){return QJ.newBufferFrom($)}};f7.nodebuffer={string:$W,array:function($){return rM($,Array($.length))},arraybuffer:function($){return f7.nodebuffer.uint8array($).buffer},uint8array:function($){return rM($,new Uint8Array($.length))},nodebuffer:eH};qd0.transformTo=function($,Y){if(!Y)Y="";if(!$)return Y;qd0.checkSupport($);var U=qd0.getTypeOf(Y),z=f7[U][$](Y);return z};qd0.resolve=function($){var Y=$.split("/"),U=[];for(var z=0;z"u")$[U]=arguments[Y][U];return $};qd0.prepareContent=function($,Y,U,z,Q){var J=bg.Promise.resolve(Y).then(function(I){var K=x7.blob&&(I instanceof Blob||["[object File]","[object Blob]"].indexOf(Object.prototype.toString.call(I))!==-1);if(K&&typeof FileReader<"u")return new bg.Promise(function(G,H){var W=new FileReader;W.onload=function(X){G(X.target.result)},W.onerror=function(X){H(X.target.error)},W.readAsArrayBuffer(I)});else return I});return J.then(function(I){var K=qd0.getTypeOf(I);if(!K)return bg.Promise.reject(Error("Can't read the data of '"+$+"'. Is it in a supported JavaScript type (String, Blob, ArrayBuffer, etc) ?"));if(K==="arraybuffer")I=qd0.transformTo("uint8array",I);else if(K==="string"){if(Q)I=Xd0.decode(I);else if(U){if(z!==!0)I=Zd0(I)}}return I})}});var I$=E((Rp1,q80)=>{function Z80($){this.name=$||"default",this.streamInfo={},this.generatedError=null,this.extraStreamInfo={},this.isPaused=!0,this.isFinished=!1,this.isLocked=!1,this._listeners={data:[],end:[],error:[]},this.previous=null}Z80.prototype={push:function($){this.emit("data",$)},end:function(){if(this.isFinished)return!1;this.flush();try{this.emit("end"),this.cleanUp(),this.isFinished=!0}catch($){this.emit("error",$)}return!0},error:function($){if(this.isFinished)return!1;if(this.isPaused)this.generatedError=$;else{if(this.isFinished=!0,this.emit("error",$),this.previous)this.previous.error($);this.cleanUp()}return!0},on:function($,Y){return this._listeners[$].push(Y),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function($,Y){if(this._listeners[$])for(var U=0;U "+$;else return $}};q80.exports=Z80});var IJ=E((Cd0)=>{var JJ=n4(),lY=J3(),Pd0=sH(),sM=I$(),YW=Array(256);for(t5=0;t5<256;t5++)YW[t5]=t5>=252?6:t5>=248?5:t5>=240?4:t5>=224?3:t5>=192?2:1;var t5;YW[254]=YW[254]=1;var Td0=function($){var Y,U,z,Q,J,I=$.length,K=0;for(Q=0;Q>>6,Y[J++]=128|U&63;else if(U<65536)Y[J++]=224|U>>>12,Y[J++]=128|U>>>6&63,Y[J++]=128|U&63;else Y[J++]=240|U>>>18,Y[J++]=128|U>>>12&63,Y[J++]=128|U>>>6&63,Y[J++]=128|U&63}return Y},jd0=function($,Y){var U;if(Y=Y||$.length,Y>$.length)Y=$.length;U=Y-1;while(U>=0&&($[U]&192)===128)U--;if(U<0)return Y;if(U===0)return Y;return U+YW[$[U]]>Y?U:Y},Ed0=function($){var Y,U,z,Q,J=$.length,I=Array(J*2);for(U=0,Y=0;Y4){I[U++]=65533,Y+=Q-1;continue}z&=Q===2?31:Q===3?15:7;while(Q>1&&Y1){I[U++]=65533;continue}if(z<65536)I[U++]=z;else z-=65536,I[U++]=55296|z>>10&1023,I[U++]=56320|z&1023}if(I.length!==U)if(I.subarray)I=I.subarray(0,U);else I.length=U;return JJ.applyFromCharCode(I)};Cd0.utf8encode=function(Y){if(lY.nodebuffer)return Pd0.newBufferFrom(Y,"utf-8");return Td0(Y)};Cd0.utf8decode=function(Y){if(lY.nodebuffer)return JJ.transformTo("nodebuffer",Y).toString("utf-8");return Y=JJ.transformTo(lY.uint8array?"uint8array":"array",Y),Ed0(Y)};function aM(){sM.call(this,"utf-8 decode"),this.leftOver=null}JJ.inherits(aM,sM);aM.prototype.processChunk=function($){var Y=JJ.transformTo(lY.uint8array?"uint8array":"array",$.data);if(this.leftOver&&this.leftOver.length){if(lY.uint8array){var U=Y;Y=new Uint8Array(U.length+this.leftOver.length),Y.set(this.leftOver,0),Y.set(U,this.leftOver.length)}else Y=this.leftOver.concat(Y);this.leftOver=null}var z=jd0(Y),Q=Y;if(z!==Y.length)if(lY.uint8array)Q=Y.subarray(0,z),this.leftOver=Y.subarray(z,Y.length);else Q=Y.slice(0,z),this.leftOver=Y.slice(z,Y.length);this.push({data:Cd0.utf8decode(Q),meta:$.meta})};aM.prototype.flush=function(){if(this.leftOver&&this.leftOver.length)this.push({data:Cd0.utf8decode(this.leftOver),meta:{}}),this.leftOver=null};Cd0.Utf8DecodeWorker=aM;function cg(){sM.call(this,"utf-8 encode")}JJ.inherits(cg,sM);cg.prototype.processChunk=function($){this.push({data:Cd0.utf8encode($.data),meta:$.meta})};Cd0.Utf8EncodeWorker=cg});var M80=E((vp1,w80)=>{var L80=I$(),F80=n4();function pg($){L80.call(this,"ConvertWorker to "+$),this.destType=$}F80.inherits(pg,L80);pg.prototype.processChunk=function($){this.push({data:F80.transformTo(this.destType,$.data),meta:$.meta})};w80.exports=pg});var D80=E((hp1,N80)=>{var O80=vg().Readable,vd0=n4();vd0.inherits(dg,O80);function dg($,Y,U){O80.call(this,Y),this._helper=$;var z=this;$.on("data",function(Q,J){if(!z.push(Q))z._helper.pause();if(U)U(J)}).on("error",function(Q){z.emit("error",Q)}).on("end",function(){z.push(null)})}dg.prototype._read=function(){this._helper.resume()};N80.exports=dg});var mg=E((Sp1,P80)=>{var oY=n4(),hd0=M80(),Sd0=I$(),gd0=gg(),yd0=J3(),kd0=zJ(),A80=null;if(yd0.nodestream)try{A80=D80()}catch($){}function xd0($,Y,U){switch($){case"blob":return oY.newBlob(oY.transformTo("arraybuffer",Y),U);case"base64":return gd0.encode(Y);default:return oY.transformTo($,Y)}}function fd0($,Y){var U,z=0,Q=null,J=0;for(U=0;U{bd0.base64=!1;bd0.binary=!1;bd0.dir=!1;bd0.createFolders=!0;bd0.date=null;bd0.compression=null;bd0.compressionOptions=null;bd0.comment=null;bd0.unixPermissions=null;bd0.dosPermissions=null});var og=E((yp1,T80)=>{var tM=n4(),eM=I$(),ad0=16384;function KJ($){eM.call(this,"DataWorker");var Y=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type="",this._tickScheduled=!1,$.then(function(U){if(Y.dataIsReady=!0,Y.data=U,Y.max=U&&U.length||0,Y.type=tM.getTypeOf(U),!Y.isPaused)Y._tickAndRepeat()},function(U){Y.error(U)})}tM.inherits(KJ,eM);KJ.prototype.cleanUp=function(){eM.prototype.cleanUp.call(this),this.data=null};KJ.prototype.resume=function(){if(!eM.prototype.resume.call(this))return!1;if(!this._tickScheduled&&this.dataIsReady)this._tickScheduled=!0,tM.delay(this._tickAndRepeat,[],this);return!0};KJ.prototype._tickAndRepeat=function(){if(this._tickScheduled=!1,this.isPaused||this.isFinished)return;if(this._tick(),!this.isFinished)tM.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0};KJ.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var $=ad0,Y=null,U=Math.min(this.max,this.index+$);if(this.index>=this.max)return this.end();else{switch(this.type){case"string":Y=this.data.substring(this.index,U);break;case"uint8array":Y=this.data.subarray(this.index,U);break;case"array":case"nodebuffer":Y=this.data.slice(this.index,U);break}return this.index=U,this.push({data:Y,meta:{percent:this.max?this.index/this.max*100:0}})}};T80.exports=KJ});var $O=E((kp1,E80)=>{var td0=n4();function ed0(){var $,Y=[];for(var U=0;U<256;U++){$=U;for(var z=0;z<8;z++)$=$&1?3988292384^$>>>1:$>>>1;Y[U]=$}return Y}var j80=ed0();function $m0($,Y,U,z){var Q=j80,J=z+U;$=$^-1;for(var I=z;I>>8^Q[($^Y[I])&255];return $^-1}function Ym0($,Y,U,z){var Q=j80,J=z+U;$=$^-1;for(var I=z;I>>8^Q[($^Y.charCodeAt(I))&255];return $^-1}E80.exports=function(Y,U){if(typeof Y>"u"||!Y.length)return 0;var z=td0.getTypeOf(Y)!=="string";if(z)return $m0(U|0,Y,Y.length,0);else return Ym0(U|0,Y,Y.length,0)}});var sg=E((xp1,R80)=>{var C80=I$(),Um0=$O(),zm0=n4();function rg(){C80.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0)}zm0.inherits(rg,C80);rg.prototype.processChunk=function($){this.streamInfo.crc32=Um0($.data,this.streamInfo.crc32||0),this.push($)};R80.exports=rg});var v80=E((fp1,_80)=>{var Qm0=n4(),ag=I$();function tg($){ag.call(this,"DataLengthProbe for "+$),this.propName=$,this.withStreamInfo($,0)}Qm0.inherits(tg,ag);tg.prototype.processChunk=function($){if($){var Y=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=Y+$.data.length}ag.prototype.processChunk.call(this,$)};_80.exports=tg});var YO=E((up1,g80)=>{var h80=zJ(),S80=og(),Jm0=sg(),eg=v80();function $y($,Y,U,z,Q){this.compressedSize=$,this.uncompressedSize=Y,this.crc32=U,this.compression=z,this.compressedContent=Q}$y.prototype={getContentWorker:function(){var $=new S80(h80.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new eg("data_length")),Y=this;return $.on("end",function(){if(this.streamInfo.data_length!==Y.uncompressedSize)throw Error("Bug : uncompressed data size mismatch")}),$},getCompressedWorker:function(){return new S80(h80.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize",this.compressedSize).withStreamInfo("uncompressedSize",this.uncompressedSize).withStreamInfo("crc32",this.crc32).withStreamInfo("compression",this.compression)}};$y.createWorkerFrom=function($,Y,U){return $.pipe(new Jm0).pipe(new eg("uncompressedSize")).pipe(Y.compressWorker(U)).pipe(new eg("compressedSize")).withStreamInfo("compression",Y)};g80.exports=$y});var f80=E((bp1,x80)=>{var Im0=mg(),Km0=og(),Yy=IJ(),Uy=YO(),y80=I$(),zy=function($,Y,U){this.name=$,this.dir=U.dir,this.date=U.date,this.comment=U.comment,this.unixPermissions=U.unixPermissions,this.dosPermissions=U.dosPermissions,this._data=Y,this._dataBinary=U.binary,this.options={compression:U.compression,compressionOptions:U.compressionOptions}};zy.prototype={internalStream:function($){var Y=null,U="string";try{if(!$)throw Error("No output type specified.");U=$.toLowerCase();var z=U==="string"||U==="text";if(U==="binarystring"||U==="text")U="string";Y=this._decompressWorker();var Q=!this._dataBinary;if(Q&&!z)Y=Y.pipe(new Yy.Utf8EncodeWorker);if(!Q&&z)Y=Y.pipe(new Yy.Utf8DecodeWorker)}catch(J){Y=new y80("error"),Y.error(J)}return new Im0(Y,U,"")},async:function($,Y){return this.internalStream($).accumulate(Y)},nodeStream:function($,Y){return this.internalStream($||"nodebuffer").toNodejsStream(Y)},_compressWorker:function($,Y){if(this._data instanceof Uy&&this._data.compression.magic===$.magic)return this._data.getCompressedWorker();else{var U=this._decompressWorker();if(!this._dataBinary)U=U.pipe(new Yy.Utf8EncodeWorker);return Uy.createWorkerFrom(U,$,Y)}},_decompressWorker:function(){if(this._data instanceof Uy)return this._data.getContentWorker();else if(this._data instanceof y80)return this._data;else return new Km0(this._data)}};var k80=["asText","asBinary","asNodeBuffer","asUint8Array","asArrayBuffer"],Gm0=function(){throw Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")};for(UW=0;UW{var Zm0=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Int32Array<"u";function qm0($,Y){return Object.prototype.hasOwnProperty.call($,Y)}Qy.assign=function($){var Y=Array.prototype.slice.call(arguments,1);while(Y.length){var U=Y.shift();if(!U)continue;if(typeof U!=="object")throw TypeError(U+"must be non-object");for(var z in U)if(qm0(U,z))$[z]=U[z]}return $};Qy.shrinkBuf=function($,Y){if($.length===Y)return $;if($.subarray)return $.subarray(0,Y);return $.length=Y,$};var Vm0={arraySet:function($,Y,U,z,Q){if(Y.subarray&&$.subarray){$.set(Y.subarray(U,U+z),Q);return}for(var J=0;J{var wm0=I3(),Mm0=4,b80=0,i80=1,Om0=2;function HJ($){var Y=$.length;while(--Y>=0)$[Y]=0}var Nm0=0,l80=1,Dm0=2,Am0=3,Bm0=258,Zy=29,GW=256,QW=GW+1+Zy,GJ=30,qy=19,o80=2*QW+1,rY=15,Iy=16,Pm0=7,Vy=256,r80=16,s80=17,a80=18,Wy=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],UO=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],Tm0=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],t80=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],jm0=512,K3=Array((QW+2)*2);HJ(K3);var zW=Array(GJ*2);HJ(zW);var JW=Array(jm0);HJ(JW);var IW=Array(Bm0-Am0+1);HJ(IW);var Ly=Array(Zy);HJ(Ly);var zO=Array(GJ);HJ(zO);function Ky($,Y,U,z,Q){this.static_tree=$,this.extra_bits=Y,this.extra_base=U,this.elems=z,this.max_length=Q,this.has_stree=$&&$.length}var e80,$$0,Y$0;function Gy($,Y){this.dyn_tree=$,this.max_code=0,this.stat_desc=Y}function U$0($){return $<256?JW[$]:JW[256+($>>>7)]}function KW($,Y){$.pending_buf[$.pending++]=Y&255,$.pending_buf[$.pending++]=Y>>>8&255}function n8($,Y,U){if($.bi_valid>Iy-U)$.bi_buf|=Y<<$.bi_valid&65535,KW($,$.bi_buf),$.bi_buf=Y>>Iy-$.bi_valid,$.bi_valid+=U-Iy;else $.bi_buf|=Y<<$.bi_valid&65535,$.bi_valid+=U}function e5($,Y,U){n8($,U[Y*2],U[Y*2+1])}function z$0($,Y){var U=0;do U|=$&1,$>>>=1,U<<=1;while(--Y>0);return U>>>1}function Em0($){if($.bi_valid===16)KW($,$.bi_buf),$.bi_buf=0,$.bi_valid=0;else if($.bi_valid>=8)$.pending_buf[$.pending++]=$.bi_buf&255,$.bi_buf>>=8,$.bi_valid-=8}function Cm0($,Y){var{dyn_tree:U,max_code:z}=Y,Q=Y.stat_desc.static_tree,J=Y.stat_desc.has_stree,I=Y.stat_desc.extra_bits,K=Y.stat_desc.extra_base,G=Y.stat_desc.max_length,H,W,X,Z,q,V,F=0;for(Z=0;Z<=rY;Z++)$.bl_count[Z]=0;U[$.heap[$.heap_max]*2+1]=0;for(H=$.heap_max+1;HG)Z=G,F++;if(U[W*2+1]=Z,W>z)continue;if($.bl_count[Z]++,q=0,W>=K)q=I[W-K];if(V=U[W*2],$.opt_len+=V*(Z+q),J)$.static_len+=V*(Q[W*2+1]+q)}if(F===0)return;do{Z=G-1;while($.bl_count[Z]===0)Z--;$.bl_count[Z]--,$.bl_count[Z+1]+=2,$.bl_count[G]--,F-=2}while(F>0);for(Z=G;Z!==0;Z--){W=$.bl_count[Z];while(W!==0){if(X=$.heap[--H],X>z)continue;if(U[X*2+1]!==Z)$.opt_len+=(Z-U[X*2+1])*U[X*2],U[X*2+1]=Z;W--}}}function Q$0($,Y,U){var z=Array(rY+1),Q=0,J,I;for(J=1;J<=rY;J++)z[J]=Q=Q+U[J-1]<<1;for(I=0;I<=Y;I++){var K=$[I*2+1];if(K===0)continue;$[I*2]=z$0(z[K]++,K)}}function Rm0(){var $,Y,U,z,Q,J=Array(rY+1);U=0;for(z=0;z>=7;for(;z8)KW($,$.bi_buf);else if($.bi_valid>0)$.pending_buf[$.pending++]=$.bi_buf;$.bi_buf=0,$.bi_valid=0}function _m0($,Y,U,z){if(I$0($),z)KW($,U),KW($,~U);wm0.arraySet($.pending_buf,$.window,Y,U,$.pending),$.pending+=U}function c80($,Y,U,z){var Q=Y*2,J=U*2;return $[Q]<$[J]||$[Q]===$[J]&&z[Y]<=z[U]}function Hy($,Y,U){var z=$.heap[U],Q=U<<1;while(Q<=$.heap_len){if(Q<$.heap_len&&c80(Y,$.heap[Q+1],$.heap[Q],$.depth))Q++;if(c80(Y,z,$.heap[Q],$.depth))break;$.heap[U]=$.heap[Q],U=Q,Q<<=1}$.heap[U]=z}function n80($,Y,U){var z,Q,J=0,I,K;if($.last_lit!==0)do if(z=$.pending_buf[$.d_buf+J*2]<<8|$.pending_buf[$.d_buf+J*2+1],Q=$.pending_buf[$.l_buf+J],J++,z===0)e5($,Q,Y);else{if(I=IW[Q],e5($,I+GW+1,Y),K=Wy[I],K!==0)Q-=Ly[I],n8($,Q,K);if(z--,I=U$0(z),e5($,I,U),K=UO[I],K!==0)z-=zO[I],n8($,z,K)}while(J<$.last_lit);e5($,Vy,Y)}function Xy($,Y){var U=Y.dyn_tree,z=Y.stat_desc.static_tree,Q=Y.stat_desc.has_stree,J=Y.stat_desc.elems,I,K,G=-1,H;$.heap_len=0,$.heap_max=o80;for(I=0;I>1;I>=1;I--)Hy($,U,I);H=J;do I=$.heap[1],$.heap[1]=$.heap[$.heap_len--],Hy($,U,1),K=$.heap[1],$.heap[--$.heap_max]=I,$.heap[--$.heap_max]=K,U[H*2]=U[I*2]+U[K*2],$.depth[H]=($.depth[I]>=$.depth[K]?$.depth[I]:$.depth[K])+1,U[I*2+1]=U[K*2+1]=H,$.heap[1]=H++,Hy($,U,1);while($.heap_len>=2);$.heap[--$.heap_max]=$.heap[1],Cm0($,Y),Q$0(U,G,$.bl_count)}function p80($,Y,U){var z,Q=-1,J,I=Y[1],K=0,G=7,H=4;if(I===0)G=138,H=3;Y[(U+1)*2+1]=65535;for(z=0;z<=U;z++){if(J=I,I=Y[(z+1)*2+1],++K=3;Y--)if($.bl_tree[t80[Y]*2+1]!==0)break;return $.opt_len+=3*(Y+1)+5+5+4,Y}function hm0($,Y,U,z){var Q;n8($,Y-257,5),n8($,U-1,5),n8($,z-4,4);for(Q=0;Q>>=1)if(Y&1&&$.dyn_ltree[U*2]!==0)return b80;if($.dyn_ltree[18]!==0||$.dyn_ltree[20]!==0||$.dyn_ltree[26]!==0)return i80;for(U=32;U0){if($.strm.data_type===Om0)$.strm.data_type=Sm0($);if(Xy($,$.l_desc),Xy($,$.d_desc),I=vm0($),Q=$.opt_len+3+7>>>3,J=$.static_len+3+7>>>3,J<=Q)Q=J}else Q=J=U+5;if(U+4<=Q&&Y!==-1)K$0($,Y,U,z);else if($.strategy===Mm0||J===Q)n8($,(l80<<1)+(z?1:0),3),n80($,K3,zW);else n8($,(Dm0<<1)+(z?1:0),3),hm0($,$.l_desc.max_code+1,$.d_desc.max_code+1,I+1),n80($,$.dyn_ltree,$.dyn_dtree);if(J$0($),z)I$0($)}function xm0($,Y,U){if($.pending_buf[$.d_buf+$.last_lit*2]=Y>>>8&255,$.pending_buf[$.d_buf+$.last_lit*2+1]=Y&255,$.pending_buf[$.l_buf+$.last_lit]=U&255,$.last_lit++,Y===0)$.dyn_ltree[U*2]++;else $.matches++,Y--,$.dyn_ltree[(IW[U]+GW+1)*2]++,$.dyn_dtree[U$0(Y)*2]++;return $.last_lit===$.lit_bufsize-1}fm0._tr_init=gm0;fm0._tr_stored_block=K$0;fm0._tr_flush_block=km0;fm0._tr_tally=xm0;fm0._tr_align=ym0});var Fy=E((np1,H$0)=>{function pm0($,Y,U,z){var Q=$&65535|0,J=$>>>16&65535|0,I=0;while(U!==0){I=U>2000?2000:U,U-=I;do Q=Q+Y[z++]|0,J=J+Q|0;while(--I);Q%=65521,J%=65521}return Q|J<<16|0}H$0.exports=pm0});var wy=E((pp1,W$0)=>{function dm0(){var $,Y=[];for(var U=0;U<256;U++){$=U;for(var z=0;z<8;z++)$=$&1?3988292384^$>>>1:$>>>1;Y[U]=$}return Y}var mm0=dm0();function lm0($,Y,U,z){var Q=mm0,J=z+U;$^=-1;for(var I=z;I>>8^Q[($^Y[I])&255];return $^-1}W$0.exports=lm0});var QO=E((dp1,X$0)=>{X$0.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}});var N$0=E((jl0)=>{var j8=I3(),j$=G$0(),L$0=Fy(),u7=wy(),om0=QO(),eY=0,rm0=1,sm0=3,p7=4,Z$0=5,Y9=0,q$0=1,E$=-2,am0=-3,My=-5,tm0=-1,em0=1,JO=2,$l0=3,Yl0=4,Ul0=0,zl0=2,HO=8,Ql0=9,Jl0=15,Il0=8,Kl0=29,Gl0=256,Ny=Gl0+1+Kl0,Hl0=30,Wl0=19,Xl0=2*Ny+1,Zl0=15,f1=3,c7=258,W5=c7+f1+1,ql0=32,WO=42,Dy=69,IO=73,KO=91,GO=103,sY=113,WW=666,B6=1,XW=2,aY=3,ZJ=4,Vl0=3;function n7($,Y){return $.msg=om0[Y],Y}function V$0($){return($<<1)-($>4?9:0)}function i7($){var Y=$.length;while(--Y>=0)$[Y]=0}function b7($){var Y=$.state,U=Y.pending;if(U>$.avail_out)U=$.avail_out;if(U===0)return;if(j8.arraySet($.output,Y.pending_buf,Y.pending_out,U,$.next_out),$.next_out+=U,Y.pending_out+=U,$.total_out+=U,$.avail_out-=U,Y.pending-=U,Y.pending===0)Y.pending_out=0}function m6($,Y){j$._tr_flush_block($,$.block_start>=0?$.block_start:-1,$.strstart-$.block_start,Y),$.block_start=$.strstart,b7($.strm)}function r1($,Y){$.pending_buf[$.pending++]=Y}function HW($,Y){$.pending_buf[$.pending++]=Y>>>8&255,$.pending_buf[$.pending++]=Y&255}function Ll0($,Y,U,z){var Q=$.avail_in;if(Q>z)Q=z;if(Q===0)return 0;if($.avail_in-=Q,j8.arraySet(Y,$.input,$.next_in,Q,U),$.state.wrap===1)$.adler=L$0($.adler,Y,Q,U);else if($.state.wrap===2)$.adler=u7($.adler,Y,Q,U);return $.next_in+=Q,$.total_in+=Q,Q}function F$0($,Y){var{max_chain_length:U,strstart:z}=$,Q,J,I=$.prev_length,K=$.nice_match,G=$.strstart>$.w_size-W5?$.strstart-($.w_size-W5):0,H=$.window,W=$.w_mask,X=$.prev,Z=$.strstart+c7,q=H[z+I-1],V=H[z+I];if($.prev_length>=$.good_match)U>>=2;if(K>$.lookahead)K=$.lookahead;do{if(Q=Y,H[Q+I]!==V||H[Q+I-1]!==q||H[Q]!==H[z]||H[++Q]!==H[z+1])continue;z+=2,Q++;do;while(H[++z]===H[++Q]&&H[++z]===H[++Q]&&H[++z]===H[++Q]&&H[++z]===H[++Q]&&H[++z]===H[++Q]&&H[++z]===H[++Q]&&H[++z]===H[++Q]&&H[++z]===H[++Q]&&zI){if($.match_start=Y,I=J,J>=K)break;q=H[z+I-1],V=H[z+I]}}while((Y=X[Y&W])>G&&--U!==0);if(I<=$.lookahead)return I;return $.lookahead}function tY($){var Y=$.w_size,U,z,Q,J,I;do{if(J=$.window_size-$.lookahead-$.strstart,$.strstart>=Y+(Y-W5)){j8.arraySet($.window,$.window,Y,Y,0),$.match_start-=Y,$.strstart-=Y,$.block_start-=Y,z=$.hash_size,U=z;do Q=$.head[--U],$.head[U]=Q>=Y?Q-Y:0;while(--z);z=Y,U=z;do Q=$.prev[--U],$.prev[U]=Q>=Y?Q-Y:0;while(--z);J+=Y}if($.strm.avail_in===0)break;if(z=Ll0($.strm,$.window,$.strstart+$.lookahead,J),$.lookahead+=z,$.lookahead+$.insert>=f1){I=$.strstart-$.insert,$.ins_h=$.window[I],$.ins_h=($.ins_h<<$.hash_shift^$.window[I+1])&$.hash_mask;while($.insert)if($.ins_h=($.ins_h<<$.hash_shift^$.window[I+f1-1])&$.hash_mask,$.prev[I&$.w_mask]=$.head[$.ins_h],$.head[$.ins_h]=I,I++,$.insert--,$.lookahead+$.insert$.pending_buf_size-5)U=$.pending_buf_size-5;for(;;){if($.lookahead<=1){if(tY($),$.lookahead===0&&Y===eY)return B6;if($.lookahead===0)break}$.strstart+=$.lookahead,$.lookahead=0;var z=$.block_start+U;if($.strstart===0||$.strstart>=z){if($.lookahead=$.strstart-z,$.strstart=z,m6($,!1),$.strm.avail_out===0)return B6}if($.strstart-$.block_start>=$.w_size-W5){if(m6($,!1),$.strm.avail_out===0)return B6}}if($.insert=0,Y===p7){if(m6($,!0),$.strm.avail_out===0)return aY;return ZJ}if($.strstart>$.block_start){if(m6($,!1),$.strm.avail_out===0)return B6}return B6}function Oy($,Y){var U,z;for(;;){if($.lookahead=f1)$.ins_h=($.ins_h<<$.hash_shift^$.window[$.strstart+f1-1])&$.hash_mask,U=$.prev[$.strstart&$.w_mask]=$.head[$.ins_h],$.head[$.ins_h]=$.strstart;if(U!==0&&$.strstart-U<=$.w_size-W5)$.match_length=F$0($,U);if($.match_length>=f1)if(z=j$._tr_tally($,$.strstart-$.match_start,$.match_length-f1),$.lookahead-=$.match_length,$.match_length<=$.max_lazy_match&&$.lookahead>=f1){$.match_length--;do $.strstart++,$.ins_h=($.ins_h<<$.hash_shift^$.window[$.strstart+f1-1])&$.hash_mask,U=$.prev[$.strstart&$.w_mask]=$.head[$.ins_h],$.head[$.ins_h]=$.strstart;while(--$.match_length!==0);$.strstart++}else $.strstart+=$.match_length,$.match_length=0,$.ins_h=$.window[$.strstart],$.ins_h=($.ins_h<<$.hash_shift^$.window[$.strstart+1])&$.hash_mask;else z=j$._tr_tally($,0,$.window[$.strstart]),$.lookahead--,$.strstart++;if(z){if(m6($,!1),$.strm.avail_out===0)return B6}}if($.insert=$.strstart=f1)$.ins_h=($.ins_h<<$.hash_shift^$.window[$.strstart+f1-1])&$.hash_mask,U=$.prev[$.strstart&$.w_mask]=$.head[$.ins_h],$.head[$.ins_h]=$.strstart;if($.prev_length=$.match_length,$.prev_match=$.match_start,$.match_length=f1-1,U!==0&&$.prev_length<$.max_lazy_match&&$.strstart-U<=$.w_size-W5){if($.match_length=F$0($,U),$.match_length<=5&&($.strategy===em0||$.match_length===f1&&$.strstart-$.match_start>4096))$.match_length=f1-1}if($.prev_length>=f1&&$.match_length<=$.prev_length){Q=$.strstart+$.lookahead-f1,z=j$._tr_tally($,$.strstart-1-$.prev_match,$.prev_length-f1),$.lookahead-=$.prev_length-1,$.prev_length-=2;do if(++$.strstart<=Q)$.ins_h=($.ins_h<<$.hash_shift^$.window[$.strstart+f1-1])&$.hash_mask,U=$.prev[$.strstart&$.w_mask]=$.head[$.ins_h],$.head[$.ins_h]=$.strstart;while(--$.prev_length!==0);if($.match_available=0,$.match_length=f1-1,$.strstart++,z){if(m6($,!1),$.strm.avail_out===0)return B6}}else if($.match_available){if(z=j$._tr_tally($,0,$.window[$.strstart-1]),z)m6($,!1);if($.strstart++,$.lookahead--,$.strm.avail_out===0)return B6}else $.match_available=1,$.strstart++,$.lookahead--}if($.match_available)z=j$._tr_tally($,0,$.window[$.strstart-1]),$.match_available=0;if($.insert=$.strstart=f1&&$.strstart>0){if(Q=$.strstart-1,z=I[Q],z===I[++Q]&&z===I[++Q]&&z===I[++Q]){J=$.strstart+c7;do;while(z===I[++Q]&&z===I[++Q]&&z===I[++Q]&&z===I[++Q]&&z===I[++Q]&&z===I[++Q]&&z===I[++Q]&&z===I[++Q]&&Q$.lookahead)$.match_length=$.lookahead}}if($.match_length>=f1)U=j$._tr_tally($,1,$.match_length-f1),$.lookahead-=$.match_length,$.strstart+=$.match_length,$.match_length=0;else U=j$._tr_tally($,0,$.window[$.strstart]),$.lookahead--,$.strstart++;if(U){if(m6($,!1),$.strm.avail_out===0)return B6}}if($.insert=0,Y===p7){if(m6($,!0),$.strm.avail_out===0)return aY;return ZJ}if($.last_lit){if(m6($,!1),$.strm.avail_out===0)return B6}return XW}function Ml0($,Y){var U;for(;;){if($.lookahead===0){if(tY($),$.lookahead===0){if(Y===eY)return B6;break}}if($.match_length=0,U=j$._tr_tally($,0,$.window[$.strstart]),$.lookahead--,$.strstart++,U){if(m6($,!1),$.strm.avail_out===0)return B6}}if($.insert=0,Y===p7){if(m6($,!0),$.strm.avail_out===0)return aY;return ZJ}if($.last_lit){if(m6($,!1),$.strm.avail_out===0)return B6}return XW}function $9($,Y,U,z,Q){this.good_length=$,this.max_lazy=Y,this.nice_length=U,this.max_chain=z,this.func=Q}var XJ;XJ=[new $9(0,0,0,0,Fl0),new $9(4,4,8,4,Oy),new $9(4,5,16,8,Oy),new $9(4,6,32,32,Oy),new $9(4,4,16,16,WJ),new $9(8,16,32,32,WJ),new $9(8,16,128,128,WJ),new $9(8,32,128,256,WJ),new $9(32,128,258,1024,WJ),new $9(32,258,258,4096,WJ)];function Ol0($){$.window_size=2*$.w_size,i7($.head),$.max_lazy_match=XJ[$.level].max_lazy,$.good_match=XJ[$.level].good_length,$.nice_match=XJ[$.level].nice_length,$.max_chain_length=XJ[$.level].max_chain,$.strstart=0,$.block_start=0,$.lookahead=0,$.insert=0,$.match_length=$.prev_length=f1-1,$.match_available=0,$.ins_h=0}function Nl0(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=HO,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new j8.Buf16(Xl0*2),this.dyn_dtree=new j8.Buf16((2*Hl0+1)*2),this.bl_tree=new j8.Buf16((2*Wl0+1)*2),i7(this.dyn_ltree),i7(this.dyn_dtree),i7(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new j8.Buf16(Zl0+1),this.heap=new j8.Buf16(2*Ny+1),i7(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new j8.Buf16(2*Ny+1),i7(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function w$0($){var Y;if(!$||!$.state)return n7($,E$);if($.total_in=$.total_out=0,$.data_type=zl0,Y=$.state,Y.pending=0,Y.pending_out=0,Y.wrap<0)Y.wrap=-Y.wrap;return Y.status=Y.wrap?WO:sY,$.adler=Y.wrap===2?0:1,Y.last_flush=eY,j$._tr_init(Y),Y9}function M$0($){var Y=w$0($);if(Y===Y9)Ol0($.state);return Y}function Dl0($,Y){if(!$||!$.state)return E$;if($.state.wrap!==2)return E$;return $.state.gzhead=Y,Y9}function O$0($,Y,U,z,Q,J){if(!$)return E$;var I=1;if(Y===tm0)Y=6;if(z<0)I=0,z=-z;else if(z>15)I=2,z-=16;if(Q<1||Q>Ql0||U!==HO||z<8||z>15||Y<0||Y>9||J<0||J>Yl0)return n7($,E$);if(z===8)z=9;var K=new Nl0;return $.state=K,K.strm=$,K.wrap=I,K.gzhead=null,K.w_bits=z,K.w_size=1<Z$0||Y<0)return $?n7($,E$):E$;if(z=$.state,!$.output||!$.input&&$.avail_in!==0||z.status===WW&&Y!==p7)return n7($,$.avail_out===0?My:E$);if(z.strm=$,U=z.last_flush,z.last_flush=Y,z.status===WO)if(z.wrap===2)if($.adler=0,r1(z,31),r1(z,139),r1(z,8),!z.gzhead)r1(z,0),r1(z,0),r1(z,0),r1(z,0),r1(z,0),r1(z,z.level===9?2:z.strategy>=JO||z.level<2?4:0),r1(z,Vl0),z.status=sY;else{if(r1(z,(z.gzhead.text?1:0)+(z.gzhead.hcrc?2:0)+(!z.gzhead.extra?0:4)+(!z.gzhead.name?0:8)+(!z.gzhead.comment?0:16)),r1(z,z.gzhead.time&255),r1(z,z.gzhead.time>>8&255),r1(z,z.gzhead.time>>16&255),r1(z,z.gzhead.time>>24&255),r1(z,z.level===9?2:z.strategy>=JO||z.level<2?4:0),r1(z,z.gzhead.os&255),z.gzhead.extra&&z.gzhead.extra.length)r1(z,z.gzhead.extra.length&255),r1(z,z.gzhead.extra.length>>8&255);if(z.gzhead.hcrc)$.adler=u7($.adler,z.pending_buf,z.pending,0);z.gzindex=0,z.status=Dy}else{var I=HO+(z.w_bits-8<<4)<<8,K=-1;if(z.strategy>=JO||z.level<2)K=0;else if(z.level<6)K=1;else if(z.level===6)K=2;else K=3;if(I|=K<<6,z.strstart!==0)I|=ql0;if(I+=31-I%31,z.status=sY,HW(z,I),z.strstart!==0)HW(z,$.adler>>>16),HW(z,$.adler&65535);$.adler=1}if(z.status===Dy)if(z.gzhead.extra){Q=z.pending;while(z.gzindex<(z.gzhead.extra.length&65535)){if(z.pending===z.pending_buf_size){if(z.gzhead.hcrc&&z.pending>Q)$.adler=u7($.adler,z.pending_buf,z.pending-Q,Q);if(b7($),Q=z.pending,z.pending===z.pending_buf_size)break}r1(z,z.gzhead.extra[z.gzindex]&255),z.gzindex++}if(z.gzhead.hcrc&&z.pending>Q)$.adler=u7($.adler,z.pending_buf,z.pending-Q,Q);if(z.gzindex===z.gzhead.extra.length)z.gzindex=0,z.status=IO}else z.status=IO;if(z.status===IO)if(z.gzhead.name){Q=z.pending;do{if(z.pending===z.pending_buf_size){if(z.gzhead.hcrc&&z.pending>Q)$.adler=u7($.adler,z.pending_buf,z.pending-Q,Q);if(b7($),Q=z.pending,z.pending===z.pending_buf_size){J=1;break}}if(z.gzindexQ)$.adler=u7($.adler,z.pending_buf,z.pending-Q,Q);if(J===0)z.gzindex=0,z.status=KO}else z.status=KO;if(z.status===KO)if(z.gzhead.comment){Q=z.pending;do{if(z.pending===z.pending_buf_size){if(z.gzhead.hcrc&&z.pending>Q)$.adler=u7($.adler,z.pending_buf,z.pending-Q,Q);if(b7($),Q=z.pending,z.pending===z.pending_buf_size){J=1;break}}if(z.gzindexQ)$.adler=u7($.adler,z.pending_buf,z.pending-Q,Q);if(J===0)z.status=GO}else z.status=GO;if(z.status===GO)if(z.gzhead.hcrc){if(z.pending+2>z.pending_buf_size)b7($);if(z.pending+2<=z.pending_buf_size)r1(z,$.adler&255),r1(z,$.adler>>8&255),$.adler=0,z.status=sY}else z.status=sY;if(z.pending!==0){if(b7($),$.avail_out===0)return z.last_flush=-1,Y9}else if($.avail_in===0&&V$0(Y)<=V$0(U)&&Y!==p7)return n7($,My);if(z.status===WW&&$.avail_in!==0)return n7($,My);if($.avail_in!==0||z.lookahead!==0||Y!==eY&&z.status!==WW){var G=z.strategy===JO?Ml0(z,Y):z.strategy===$l0?wl0(z,Y):XJ[z.level].func(z,Y);if(G===aY||G===ZJ)z.status=WW;if(G===B6||G===aY){if($.avail_out===0)z.last_flush=-1;return Y9}if(G===XW){if(Y===rm0)j$._tr_align(z);else if(Y!==Z$0){if(j$._tr_stored_block(z,0,0,!1),Y===sm0){if(i7(z.head),z.lookahead===0)z.strstart=0,z.block_start=0,z.insert=0}}if(b7($),$.avail_out===0)return z.last_flush=-1,Y9}}if(Y!==p7)return Y9;if(z.wrap<=0)return q$0;if(z.wrap===2)r1(z,$.adler&255),r1(z,$.adler>>8&255),r1(z,$.adler>>16&255),r1(z,$.adler>>24&255),r1(z,$.total_in&255),r1(z,$.total_in>>8&255),r1(z,$.total_in>>16&255),r1(z,$.total_in>>24&255);else HW(z,$.adler>>>16),HW(z,$.adler&65535);if(b7($),z.wrap>0)z.wrap=-z.wrap;return z.pending!==0?Y9:q$0}function Pl0($){var Y;if(!$||!$.state)return E$;if(Y=$.state.status,Y!==WO&&Y!==Dy&&Y!==IO&&Y!==KO&&Y!==GO&&Y!==sY&&Y!==WW)return n7($,E$);return $.state=null,Y===sY?n7($,am0):Y9}function Tl0($,Y){var U=Y.length,z,Q,J,I,K,G,H,W;if(!$||!$.state)return E$;if(z=$.state,I=z.wrap,I===2||I===1&&z.status!==WO||z.lookahead)return E$;if(I===1)$.adler=L$0($.adler,Y,U,0);if(z.wrap=0,U>=z.w_size){if(I===0)i7(z.head),z.strstart=0,z.block_start=0,z.insert=0;W=new j8.Buf8(z.w_size),j8.arraySet(W,Y,U-z.w_size,z.w_size,0),Y=W,U=z.w_size}K=$.avail_in,G=$.next_in,H=$.input,$.avail_in=U,$.next_in=0,$.input=Y,tY(z);while(z.lookahead>=f1){Q=z.strstart,J=z.lookahead-(f1-1);do z.ins_h=(z.ins_h<{var XO=I3(),D$0=!0,A$0=!0;try{String.fromCharCode.apply(null,[0])}catch($){D$0=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch($){A$0=!1}var ZW=new XO.Buf8(256);for(U9=0;U9<256;U9++)ZW[U9]=U9>=252?6:U9>=248?5:U9>=240?4:U9>=224?3:U9>=192?2:1;var U9;ZW[254]=ZW[254]=1;kl0.string2buf=function($){var Y,U,z,Q,J,I=$.length,K=0;for(Q=0;Q>>6,Y[J++]=128|U&63;else if(U<65536)Y[J++]=224|U>>>12,Y[J++]=128|U>>>6&63,Y[J++]=128|U&63;else Y[J++]=240|U>>>18,Y[J++]=128|U>>>12&63,Y[J++]=128|U>>>6&63,Y[J++]=128|U&63}return Y};function B$0($,Y){if(Y<65534){if($.subarray&&A$0||!$.subarray&&D$0)return String.fromCharCode.apply(null,XO.shrinkBuf($,Y))}var U="";for(var z=0;z4){K[z++]=65533,U+=J-1;continue}Q&=J===2?31:J===3?15:7;while(J>1&&U1){K[z++]=65533;continue}if(Q<65536)K[z++]=Q;else Q-=65536,K[z++]=55296|Q>>10&1023,K[z++]=56320|Q&1023}return B$0(K,z)};kl0.utf8border=function($,Y){var U;if(Y=Y||$.length,Y>$.length)Y=$.length;U=Y-1;while(U>=0&&($[U]&192)===128)U--;if(U<0)return Y;if(U===0)return Y;return U+ZW[$[U]]>Y?U:Y}});var By=E((op1,P$0)=>{function cl0(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}P$0.exports=cl0});var C$0=E((sl0)=>{var qW=N$0(),VW=I3(),Ty=Ay(),jy=QO(),nl0=By(),E$0=Object.prototype.toString,pl0=0,Py=4,qJ=0,T$0=1,j$0=2,dl0=-1,ml0=0,ll0=8;function $U($){if(!(this instanceof $U))return new $U($);this.options=VW.assign({level:dl0,method:ll0,chunkSize:16384,windowBits:15,memLevel:8,strategy:ml0,to:""},$||{});var Y=this.options;if(Y.raw&&Y.windowBits>0)Y.windowBits=-Y.windowBits;else if(Y.gzip&&Y.windowBits>0&&Y.windowBits<16)Y.windowBits+=16;this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new nl0,this.strm.avail_out=0;var U=qW.deflateInit2(this.strm,Y.level,Y.method,Y.windowBits,Y.memLevel,Y.strategy);if(U!==qJ)throw Error(jy[U]);if(Y.header)qW.deflateSetHeader(this.strm,Y.header);if(Y.dictionary){var z;if(typeof Y.dictionary==="string")z=Ty.string2buf(Y.dictionary);else if(E$0.call(Y.dictionary)==="[object ArrayBuffer]")z=new Uint8Array(Y.dictionary);else z=Y.dictionary;if(U=qW.deflateSetDictionary(this.strm,z),U!==qJ)throw Error(jy[U]);this._dict_set=!0}}$U.prototype.push=function($,Y){var U=this.strm,z=this.options.chunkSize,Q,J;if(this.ended)return!1;if(J=Y===~~Y?Y:Y===!0?Py:pl0,typeof $==="string")U.input=Ty.string2buf($);else if(E$0.call($)==="[object ArrayBuffer]")U.input=new Uint8Array($);else U.input=$;U.next_in=0,U.avail_in=U.input.length;do{if(U.avail_out===0)U.output=new VW.Buf8(z),U.next_out=0,U.avail_out=z;if(Q=qW.deflate(U,J),Q!==T$0&&Q!==qJ)return this.onEnd(Q),this.ended=!0,!1;if(U.avail_out===0||U.avail_in===0&&(J===Py||J===j$0))if(this.options.to==="string")this.onData(Ty.buf2binstring(VW.shrinkBuf(U.output,U.next_out)));else this.onData(VW.shrinkBuf(U.output,U.next_out))}while((U.avail_in>0||U.avail_out===0)&&Q!==T$0);if(J===Py)return Q=qW.deflateEnd(this.strm),this.onEnd(Q),this.ended=!0,Q===qJ;if(J===j$0)return this.onEnd(qJ),U.avail_out=0,!0;return!0};$U.prototype.onData=function($){this.chunks.push($)};$U.prototype.onEnd=function($){if($===qJ)if(this.options.to==="string")this.result=this.chunks.join("");else this.result=VW.flattenChunks(this.chunks);this.chunks=[],this.err=$,this.msg=this.strm.msg};function Ey($,Y){var U=new $U(Y);if(U.push($,!0),U.err)throw U.msg||jy[U.err];return U.result}function ol0($,Y){return Y=Y||{},Y.raw=!0,Ey($,Y)}function rl0($,Y){return Y=Y||{},Y.gzip=!0,Ey($,Y)}sl0.Deflate=$U;sl0.deflate=Ey;sl0.deflateRaw=ol0;sl0.gzip=rl0});var _$0=E((sp1,R$0)=>{var ZO=30,Yo0=12;R$0.exports=function(Y,U){var z,Q,J,I,K,G,H,W,X,Z,q,V,F,M,w,N,O,D,P,T,A,j,C,b,x;z=Y.state,Q=Y.next_in,b=Y.input,J=Q+(Y.avail_in-5),I=Y.next_out,x=Y.output,K=I-(U-Y.avail_out),G=I+(Y.avail_out-257),H=z.dmax,W=z.wsize,X=z.whave,Z=z.wnext,q=z.window,V=z.hold,F=z.bits,M=z.lencode,w=z.distcode,N=(1<>>24,V>>>=P,F-=P,P=D>>>16&255,P===0)x[I++]=D&65535;else if(P&16){if(T=D&65535,P&=15,P){if(F>>=P,F-=P}if(F<15)V+=b[Q++]<>>24,V>>>=P,F-=P,P=D>>>16&255,P&16){if(A=D&65535,P&=15,FH){Y.msg="invalid distance too far back",z.mode=ZO;break $}if(V>>>=P,F-=P,P=I-K,A>P){if(P=A-P,P>X){if(z.sane){Y.msg="invalid distance too far back",z.mode=ZO;break $}}if(j=0,C=q,Z===0){if(j+=W-P,P2)x[I++]=C[j++],x[I++]=C[j++],x[I++]=C[j++],T-=3;if(T){if(x[I++]=C[j++],T>1)x[I++]=C[j++]}}else{j=I-A;do x[I++]=x[j++],x[I++]=x[j++],x[I++]=x[j++],T-=3;while(T>2);if(T){if(x[I++]=x[j++],T>1)x[I++]=x[j++]}}}else if((P&64)===0){D=w[(D&65535)+(V&(1<>3,Q-=T,F-=T<<3,V&=(1<{var v$0=I3(),VJ=15,h$0=852,S$0=592,g$0=0,Cy=1,y$0=2,Uo0=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],zo0=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],Qo0=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],Jo0=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];k$0.exports=function(Y,U,z,Q,J,I,K,G){var H=G.bits,W=0,X=0,Z=0,q=0,V=0,F=0,M=0,w=0,N=0,O=0,D,P,T,A,j,C=null,b=0,x,S=new v$0.Buf16(VJ+1),i=new v$0.Buf16(VJ+1),c=null,z0=0,k,d,t;for(W=0;W<=VJ;W++)S[W]=0;for(X=0;X=1;q--)if(S[q]!==0)break;if(V>q)V=q;if(q===0)return J[I++]=20971520,J[I++]=20971520,G.bits=1,0;for(Z=1;Z0&&(Y===g$0||q!==1))return-1;i[1]=0;for(W=1;Wh$0||Y===y$0&&N>S$0)return 1;for(;;){if(k=W-M,K[X]x)d=c[z0+K[X]],t=C[b+K[X]];else d=96,t=0;D=1<>M)+P]=k<<24|d<<16|t|0;while(P!==0);D=1<>=1;if(D!==0)O&=D-1,O+=D;else O=0;if(X++,--S[W]===0){if(W===q)break;W=U[z+K[X]]}if(W>V&&(O&A)!==T){if(M===0)M=V;j+=Z,F=W-M,w=1<h$0||Y===y$0&&N>S$0)return 1;T=O&A,J[T]=V<<24|F<<16|j-I|0}}if(O!==0)J[j+O]=W-M<<24|4194304|0;return G.bits=V,0}});var M50=E((Po0)=>{var K$=I3(),gy=Fy(),z9=wy(),Io0=_$0(),LW=x$0(),Ko0=0,H50=1,W50=2,f$0=4,Go0=5,qO=6,YU=0,Ho0=1,Wo0=2,C$=-2,X50=-3,yy=-4,Xo0=-5,u$0=8,Z50=1,b$0=2,i$0=3,c$0=4,n$0=5,p$0=6,d$0=7,m$0=8,l$0=9,o$0=10,FO=11,G3=12,Ry=13,r$0=14,_y=15,s$0=16,a$0=17,t$0=18,e$0=19,VO=20,LO=21,$50=22,Y50=23,U50=24,z50=25,Q50=26,vy=27,J50=28,I50=29,y4=30,ky=31,Zo0=32,qo0=852,Vo0=592,Lo0=15,Fo0=Lo0;function K50($){return($>>>24&255)+($>>>8&65280)+(($&65280)<<8)+(($&255)<<24)}function wo0(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new K$.Buf16(320),this.work=new K$.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function q50($){var Y;if(!$||!$.state)return C$;if(Y=$.state,$.total_in=$.total_out=Y.total=0,$.msg="",Y.wrap)$.adler=Y.wrap&1;return Y.mode=Z50,Y.last=0,Y.havedict=0,Y.dmax=32768,Y.head=null,Y.hold=0,Y.bits=0,Y.lencode=Y.lendyn=new K$.Buf32(qo0),Y.distcode=Y.distdyn=new K$.Buf32(Vo0),Y.sane=1,Y.back=-1,YU}function V50($){var Y;if(!$||!$.state)return C$;return Y=$.state,Y.wsize=0,Y.whave=0,Y.wnext=0,q50($)}function L50($,Y){var U,z;if(!$||!$.state)return C$;if(z=$.state,Y<0)U=0,Y=-Y;else if(U=(Y>>4)+1,Y<48)Y&=15;if(Y&&(Y<8||Y>15))return C$;if(z.window!==null&&z.wbits!==Y)z.window=null;return z.wrap=U,z.wbits=Y,V50($)}function F50($,Y){var U,z;if(!$)return C$;if(z=new wo0,$.state=z,z.window=null,U=L50($,Y),U!==YU)$.state=null;return U}function Mo0($){return F50($,Fo0)}var G50=!0,hy,Sy;function Oo0($){if(G50){var Y;hy=new K$.Buf32(512),Sy=new K$.Buf32(32),Y=0;while(Y<144)$.lens[Y++]=8;while(Y<256)$.lens[Y++]=9;while(Y<280)$.lens[Y++]=7;while(Y<288)$.lens[Y++]=8;LW(H50,$.lens,0,288,hy,0,$.work,{bits:9}),Y=0;while(Y<32)$.lens[Y++]=5;LW(W50,$.lens,0,32,Sy,0,$.work,{bits:5}),G50=!1}$.lencode=hy,$.lenbits=9,$.distcode=Sy,$.distbits=5}function w50($,Y,U,z){var Q,J=$.state;if(J.window===null)J.wsize=1<=J.wsize)K$.arraySet(J.window,Y,U-J.wsize,J.wsize,0),J.wnext=0,J.whave=J.wsize;else{if(Q=J.wsize-J.wnext,Q>z)Q=z;if(K$.arraySet(J.window,Y,U-z,Q,J.wnext),z-=Q,z)K$.arraySet(J.window,Y,U-z,z,0),J.wnext=z,J.whave=J.wsize;else{if(J.wnext+=Q,J.wnext===J.wsize)J.wnext=0;if(J.whave>>8&255,U.check=z9(U.check,C,2,0),H=0,W=0,U.mode=b$0;break}if(U.flags=0,U.head)U.head.done=!1;if(!(U.wrap&1)||(((H&255)<<8)+(H>>8))%31){$.msg="incorrect header check",U.mode=y4;break}if((H&15)!==u$0){$.msg="unknown compression method",U.mode=y4;break}if(H>>>=4,W-=4,A=(H&15)+8,U.wbits===0)U.wbits=A;else if(A>U.wbits){$.msg="invalid window size",U.mode=y4;break}U.dmax=1<>8&1;if(U.flags&512)C[0]=H&255,C[1]=H>>>8&255,U.check=z9(U.check,C,2,0);H=0,W=0,U.mode=i$0;case i$0:while(W<32){if(K===0)break $;K--,H+=z[J++]<>>8&255,C[2]=H>>>16&255,C[3]=H>>>24&255,U.check=z9(U.check,C,4,0);H=0,W=0,U.mode=c$0;case c$0:while(W<16){if(K===0)break $;K--,H+=z[J++]<>8;if(U.flags&512)C[0]=H&255,C[1]=H>>>8&255,U.check=z9(U.check,C,2,0);H=0,W=0,U.mode=n$0;case n$0:if(U.flags&1024){while(W<16){if(K===0)break $;K--,H+=z[J++]<>>8&255,U.check=z9(U.check,C,2,0);H=0,W=0}else if(U.head)U.head.extra=null;U.mode=p$0;case p$0:if(U.flags&1024){if(q=U.length,q>K)q=K;if(q){if(U.head){if(A=U.head.extra_len-U.length,!U.head.extra)U.head.extra=Array(U.head.extra_len);K$.arraySet(U.head.extra,z,J,q,A)}if(U.flags&512)U.check=z9(U.check,z,q,J);K-=q,J+=q,U.length-=q}if(U.length)break $}U.length=0,U.mode=d$0;case d$0:if(U.flags&2048){if(K===0)break $;q=0;do if(A=z[J+q++],U.head&&A&&U.length<65536)U.head.name+=String.fromCharCode(A);while(A&&q>9&1,U.head.done=!0;$.adler=U.check=0,U.mode=G3;break;case o$0:while(W<32){if(K===0)break $;K--,H+=z[J++]<>>=W&7,W-=W&7,U.mode=vy;break}while(W<3){if(K===0)break $;K--,H+=z[J++]<>>=1,W-=1,H&3){case 0:U.mode=r$0;break;case 1:if(Oo0(U),U.mode=VO,Y===qO){H>>>=2,W-=2;break $}break;case 2:U.mode=a$0;break;case 3:$.msg="invalid block type",U.mode=y4}H>>>=2,W-=2;break;case r$0:H>>>=W&7,W-=W&7;while(W<32){if(K===0)break $;K--,H+=z[J++]<>>16^65535)){$.msg="invalid stored block lengths",U.mode=y4;break}if(U.length=H&65535,H=0,W=0,U.mode=_y,Y===qO)break $;case _y:U.mode=s$0;case s$0:if(q=U.length,q){if(q>K)q=K;if(q>G)q=G;if(q===0)break $;K$.arraySet(Q,z,J,q,I),K-=q,J+=q,G-=q,I+=q,U.length-=q;break}U.mode=G3;break;case a$0:while(W<14){if(K===0)break $;K--,H+=z[J++]<>>=5,W-=5,U.ndist=(H&31)+1,H>>>=5,W-=5,U.ncode=(H&15)+4,H>>>=4,W-=4,U.nlen>286||U.ndist>30){$.msg="too many length or distance symbols",U.mode=y4;break}U.have=0,U.mode=t$0;case t$0:while(U.have>>=3,W-=3}while(U.have<19)U.lens[S[U.have++]]=0;if(U.lencode=U.lendyn,U.lenbits=7,b={bits:U.lenbits},j=LW(Ko0,U.lens,0,19,U.lencode,0,U.work,b),U.lenbits=b.bits,j){$.msg="invalid code lengths set",U.mode=y4;break}U.have=0,U.mode=e$0;case e$0:while(U.have>>24,N=M>>>16&255,O=M&65535,w<=W)break;if(K===0)break $;K--,H+=z[J++]<>>=w,W-=w,U.lens[U.have++]=O;else{if(O===16){x=w+2;while(W>>=w,W-=w,U.have===0){$.msg="invalid bit length repeat",U.mode=y4;break}A=U.lens[U.have-1],q=3+(H&3),H>>>=2,W-=2}else if(O===17){x=w+3;while(W>>=w,W-=w,A=0,q=3+(H&7),H>>>=3,W-=3}else{x=w+7;while(W>>=w,W-=w,A=0,q=11+(H&127),H>>>=7,W-=7}if(U.have+q>U.nlen+U.ndist){$.msg="invalid bit length repeat",U.mode=y4;break}while(q--)U.lens[U.have++]=A}}if(U.mode===y4)break;if(U.lens[256]===0){$.msg="invalid code -- missing end-of-block",U.mode=y4;break}if(U.lenbits=9,b={bits:U.lenbits},j=LW(H50,U.lens,0,U.nlen,U.lencode,0,U.work,b),U.lenbits=b.bits,j){$.msg="invalid literal/lengths set",U.mode=y4;break}if(U.distbits=6,U.distcode=U.distdyn,b={bits:U.distbits},j=LW(W50,U.lens,U.nlen,U.ndist,U.distcode,0,U.work,b),U.distbits=b.bits,j){$.msg="invalid distances set",U.mode=y4;break}if(U.mode=VO,Y===qO)break $;case VO:U.mode=LO;case LO:if(K>=6&&G>=258){if($.next_out=I,$.avail_out=G,$.next_in=J,$.avail_in=K,U.hold=H,U.bits=W,Io0($,Z),I=$.next_out,Q=$.output,G=$.avail_out,J=$.next_in,z=$.input,K=$.avail_in,H=U.hold,W=U.bits,U.mode===G3)U.back=-1;break}U.back=0;for(;;){if(M=U.lencode[H&(1<>>24,N=M>>>16&255,O=M&65535,w<=W)break;if(K===0)break $;K--,H+=z[J++]<>D)],w=M>>>24,N=M>>>16&255,O=M&65535,D+w<=W)break;if(K===0)break $;K--,H+=z[J++]<>>=D,W-=D,U.back+=D}if(H>>>=w,W-=w,U.back+=w,U.length=O,N===0){U.mode=Q50;break}if(N&32){U.back=-1,U.mode=G3;break}if(N&64){$.msg="invalid literal/length code",U.mode=y4;break}U.extra=N&15,U.mode=$50;case $50:if(U.extra){x=U.extra;while(W>>=U.extra,W-=U.extra,U.back+=U.extra}U.was=U.length,U.mode=Y50;case Y50:for(;;){if(M=U.distcode[H&(1<>>24,N=M>>>16&255,O=M&65535,w<=W)break;if(K===0)break $;K--,H+=z[J++]<>D)],w=M>>>24,N=M>>>16&255,O=M&65535,D+w<=W)break;if(K===0)break $;K--,H+=z[J++]<>>=D,W-=D,U.back+=D}if(H>>>=w,W-=w,U.back+=w,N&64){$.msg="invalid distance code",U.mode=y4;break}U.offset=O,U.extra=N&15,U.mode=U50;case U50:if(U.extra){x=U.extra;while(W>>=U.extra,W-=U.extra,U.back+=U.extra}if(U.offset>U.dmax){$.msg="invalid distance too far back",U.mode=y4;break}U.mode=z50;case z50:if(G===0)break $;if(q=Z-G,U.offset>q){if(q=U.offset-q,q>U.whave){if(U.sane){$.msg="invalid distance too far back",U.mode=y4;break}}if(q>U.wnext)q-=U.wnext,V=U.wsize-q;else V=U.wnext-q;if(q>U.length)q=U.length;F=U.window}else F=Q,V=I-U.offset,q=U.length;if(q>G)q=G;G-=q,U.length-=q;do Q[I++]=F[V++];while(--q);if(U.length===0)U.mode=LO;break;case Q50:if(G===0)break $;Q[I++]=U.length,G--,U.mode=LO;break;case vy:if(U.wrap){while(W<32){if(K===0)break $;K--,H|=z[J++]<{O50.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}});var D50=E(($d1,N50)=>{function yo0(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}N50.exports=yo0});var B50=E((uo0)=>{var LJ=M50(),FW=I3(),wO=Ay(),G6=xy(),fy=QO(),ko0=By(),xo0=D50(),A50=Object.prototype.toString;function UU($){if(!(this instanceof UU))return new UU($);this.options=FW.assign({chunkSize:16384,windowBits:0,to:""},$||{});var Y=this.options;if(Y.raw&&Y.windowBits>=0&&Y.windowBits<16){if(Y.windowBits=-Y.windowBits,Y.windowBits===0)Y.windowBits=-15}if(Y.windowBits>=0&&Y.windowBits<16&&!($&&$.windowBits))Y.windowBits+=32;if(Y.windowBits>15&&Y.windowBits<48){if((Y.windowBits&15)===0)Y.windowBits|=15}this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new ko0,this.strm.avail_out=0;var U=LJ.inflateInit2(this.strm,Y.windowBits);if(U!==G6.Z_OK)throw Error(fy[U]);if(this.header=new xo0,LJ.inflateGetHeader(this.strm,this.header),Y.dictionary){if(typeof Y.dictionary==="string")Y.dictionary=wO.string2buf(Y.dictionary);else if(A50.call(Y.dictionary)==="[object ArrayBuffer]")Y.dictionary=new Uint8Array(Y.dictionary);if(Y.raw){if(U=LJ.inflateSetDictionary(this.strm,Y.dictionary),U!==G6.Z_OK)throw Error(fy[U])}}}UU.prototype.push=function($,Y){var U=this.strm,z=this.options.chunkSize,Q=this.options.dictionary,J,I,K,G,H,W=!1;if(this.ended)return!1;if(I=Y===~~Y?Y:Y===!0?G6.Z_FINISH:G6.Z_NO_FLUSH,typeof $==="string")U.input=wO.binstring2buf($);else if(A50.call($)==="[object ArrayBuffer]")U.input=new Uint8Array($);else U.input=$;U.next_in=0,U.avail_in=U.input.length;do{if(U.avail_out===0)U.output=new FW.Buf8(z),U.next_out=0,U.avail_out=z;if(J=LJ.inflate(U,G6.Z_NO_FLUSH),J===G6.Z_NEED_DICT&&Q)J=LJ.inflateSetDictionary(this.strm,Q);if(J===G6.Z_BUF_ERROR&&W===!0)J=G6.Z_OK,W=!1;if(J!==G6.Z_STREAM_END&&J!==G6.Z_OK)return this.onEnd(J),this.ended=!0,!1;if(U.next_out){if(U.avail_out===0||J===G6.Z_STREAM_END||U.avail_in===0&&(I===G6.Z_FINISH||I===G6.Z_SYNC_FLUSH))if(this.options.to==="string"){if(K=wO.utf8border(U.output,U.next_out),G=U.next_out-K,H=wO.buf2string(U.output,K),U.next_out=G,U.avail_out=z-G,G)FW.arraySet(U.output,U.output,K,G,0);this.onData(H)}else this.onData(FW.shrinkBuf(U.output,U.next_out))}if(U.avail_in===0&&U.avail_out===0)W=!0}while((U.avail_in>0||U.avail_out===0)&&J!==G6.Z_STREAM_END);if(J===G6.Z_STREAM_END)I=G6.Z_FINISH;if(I===G6.Z_FINISH)return J=LJ.inflateEnd(this.strm),this.onEnd(J),this.ended=!0,J===G6.Z_OK;if(I===G6.Z_SYNC_FLUSH)return this.onEnd(G6.Z_OK),U.avail_out=0,!0;return!0};UU.prototype.onData=function($){this.chunks.push($)};UU.prototype.onEnd=function($){if($===G6.Z_OK)if(this.options.to==="string")this.result=this.chunks.join("");else this.result=FW.flattenChunks(this.chunks);this.chunks=[],this.err=$,this.msg=this.strm.msg};function uy($,Y){var U=new UU(Y);if(U.push($,!0),U.err)throw U.msg||fy[U.err];return U.result}function fo0($,Y){return Y=Y||{},Y.raw=!0,uy($,Y)}uo0.Inflate=UU;uo0.inflate=uy;uo0.inflateRaw=fo0;uo0.ungzip=uy});var j50=E((Ud1,T50)=>{var po0=I3().assign,do0=C$0(),mo0=B50(),lo0=xy(),P50={};po0(P50,do0,mo0,lo0);T50.exports=P50});var C50=E((ao0)=>{var oo0=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Uint32Array<"u",ro0=j50(),E50=n4(),MO=I$(),so0=oo0?"uint8array":"array";ao0.magic="\b\x00";function zU($,Y){MO.call(this,"FlateWorker/"+$),this._pako=null,this._pakoAction=$,this._pakoOptions=Y,this.meta={}}E50.inherits(zU,MO);zU.prototype.processChunk=function($){if(this.meta=$.meta,this._pako===null)this._createPako();this._pako.push(E50.transformTo(so0,$.data),!1)};zU.prototype.flush=function(){if(MO.prototype.flush.call(this),this._pako===null)this._createPako();this._pako.push([],!0)};zU.prototype.cleanUp=function(){MO.prototype.cleanUp.call(this),this._pako=null};zU.prototype._createPako=function(){this._pako=new ro0[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var $=this;this._pako.onData=function(Y){$.push({data:Y,meta:$.meta})}};ao0.compressWorker=function($){return new zU("Deflate",$)};ao0.uncompressWorker=function(){return new zU("Inflate",{})}});var by=E((Yr0)=>{var R50=I$();Yr0.STORE={magic:"\x00\x00",compressWorker:function(){return new R50("STORE compression")},uncompressWorker:function(){return new R50("STORE decompression")}};Yr0.DEFLATE=C50()});var iy=E((Qr0)=>{Qr0.LOCAL_FILE_HEADER="PK\x03\x04";Qr0.CENTRAL_FILE_HEADER="PK\x01\x02";Qr0.CENTRAL_DIRECTORY_END="PK\x05\x06";Qr0.ZIP64_CENTRAL_DIRECTORY_LOCATOR="PK\x06\x07";Qr0.ZIP64_CENTRAL_DIRECTORY_END="PK\x06\x06";Qr0.DATA_DESCRIPTOR="PK\x07\b"});var S50=E((Id1,h50)=>{var FJ=n4(),wJ=I$(),cy=IJ(),_50=$O(),OO=iy(),O4=function($,Y){var U="",z;for(z=0;z>>8;return U},Xr0=function($,Y){var U=$;if(!$)U=Y?16893:33204;return(U&65535)<<16},Zr0=function($){return($||0)&63},v50=function($,Y,U,z,Q,J){var{file:I,compression:K}=$,G=J!==cy.utf8encode,H=FJ.transformTo("string",J(I.name)),W=FJ.transformTo("string",cy.utf8encode(I.name)),X=I.comment,Z=FJ.transformTo("string",J(X)),q=FJ.transformTo("string",cy.utf8encode(X)),V=W.length!==I.name.length,F=q.length!==X.length,M,w,N="",O="",D="",P=I.dir,T=I.date,A={crc32:0,compressedSize:0,uncompressedSize:0};if(!Y||U)A.crc32=$.crc32,A.compressedSize=$.compressedSize,A.uncompressedSize=$.uncompressedSize;var j=0;if(Y)j|=8;if(!G&&(V||F))j|=2048;var C=0,b=0;if(P)C|=16;if(Q==="UNIX")b=798,C|=Xr0(I.unixPermissions,P);else b=20,C|=Zr0(I.dosPermissions,P);if(M=T.getUTCHours(),M=M<<6,M=M|T.getUTCMinutes(),M=M<<5,M=M|T.getUTCSeconds()/2,w=T.getUTCFullYear()-1980,w=w<<4,w=w|T.getUTCMonth()+1,w=w<<5,w=w|T.getUTCDate(),V)O=O4(1,1)+O4(_50(H),4)+W,N+="up"+O4(O.length,2)+O;if(F)D=O4(1,1)+O4(_50(Z),4)+q,N+="uc"+O4(D.length,2)+D;var x="";x+=` + deps: ${W}}`};let Q={keyword:"dependencies",type:"object",schemaType:"object",error:$.error,code(G){let[H,W]=J(G);I(G,H),K(G,W)}};function J({schema:G}){let H={},W={};for(let X in G){if(X==="__proto__")continue;let Z=Array.isArray(G[X])?H:W;Z[X]=G[X]}return[H,W]}function I(G,H=G.schema){let{gen:W,data:X,it:Z}=G;if(Object.keys(H).length===0)return;let q=W.let("missing");for(let V in H){let F=H[V];if(F.length===0)continue;let M=(0,z.propertyInData)(W,X,V,Z.opts.ownProperties);if(G.setParams({property:V,depsCount:F.length,deps:F.join(", ")}),Z.allErrors)W.if(M,()=>{for(let w of F)(0,z.checkReportMissingProp)(G,w)});else W.if(Y._`${M} && (${(0,z.checkMissingProp)(G,F,q)})`),(0,z.reportMissingProp)(G,q),W.else()}}$.validatePropertyDeps=I;function K(G,H=G.schema){let{gen:W,data:X,keyword:Z,it:q}=G,V=W.name("valid");for(let F in H){if((0,U.alwaysValidSchema)(q,H[F]))continue;W.if((0,z.propertyInData)(W,X,F,q.opts.ownProperties),()=>{let M=G.subschema({keyword:Z,schemaProp:F},V);G.mergeValidEvaluated(M,V)},()=>W.var(V,!0)),G.ok(V)}}$.validateSchemaDeps=K,$.default=Q}),Gb0=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=L1(),U=v1(),z={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:{message:"property name must be valid",params:({params:Q})=>Y._`{propertyName: ${Q.propertyName}}`},code(Q){let{gen:J,schema:I,data:K,it:G}=Q;if((0,U.alwaysValidSchema)(G,I))return;let H=J.name("valid");J.forIn("key",K,(W)=>{Q.setParams({propertyName:W}),Q.subschema({keyword:"propertyNames",data:W,dataTypes:["string"],propertyName:W,compositeRule:!0},H),J.if((0,Y.not)(H),()=>{if(Q.error(!0),!G.allErrors)J.break()})}),Q.ok(H)}};$.default=z}),et=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=Q5(),U=L1(),z=z5(),Q=v1(),J={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:{message:"must NOT have additional properties",params:({params:I})=>U._`{additionalProperty: ${I.additionalProperty}}`},code(I){let{gen:K,schema:G,parentSchema:H,data:W,errsCount:X,it:Z}=I;if(!X)throw Error("ajv implementation error");let{allErrors:q,opts:V}=Z;if(Z.props=!0,V.removeAdditional!=="all"&&(0,Q.alwaysValidSchema)(Z,G))return;let F=(0,Y.allSchemaProperties)(H.properties),M=(0,Y.allSchemaProperties)(H.patternProperties);w(),I.ok(U._`${X} === ${z.default.errors}`);function w(){K.forIn("key",W,(T)=>{if(!F.length&&!M.length)D(T);else K.if(N(T),()=>D(T))})}function N(T){let A;if(F.length>8){let j=(0,Q.schemaRefOrVal)(Z,H.properties,"properties");A=(0,Y.isOwnProperty)(K,j,T)}else if(F.length)A=(0,U.or)(...F.map((j)=>U._`${T} === ${j}`));else A=U.nil;if(M.length)A=(0,U.or)(A,...M.map((j)=>U._`${(0,Y.usePattern)(I,j)}.test(${T})`));return(0,U.not)(A)}function O(T){K.code(U._`delete ${W}[${T}]`)}function D(T){if(V.removeAdditional==="all"||V.removeAdditional&&G===!1){O(T);return}if(G===!1){if(I.setParams({additionalProperty:T}),I.error(),!q)K.break();return}if(typeof G=="object"&&!(0,Q.alwaysValidSchema)(Z,G)){let A=K.name("valid");if(V.removeAdditional==="failing")P(T,A,!1),K.if((0,U.not)(A),()=>{I.reset(),O(T)});else if(P(T,A),!q)K.if((0,U.not)(A),()=>K.break())}}function P(T,A,j){let C={keyword:"additionalProperties",dataProp:T,dataPropType:Q.Type.Str};if(j===!1)Object.assign(C,{compositeRule:!0,createErrors:!1,allErrors:!1});I.subschema(C,A)}}};$.default=J}),Hb0=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=yQ(),U=Q5(),z=v1(),Q=et(),J={keyword:"properties",type:"object",schemaType:"object",code(I){let{gen:K,schema:G,parentSchema:H,data:W,it:X}=I;if(X.opts.removeAdditional==="all"&&H.additionalProperties===void 0)Q.default.code(new Y.KeywordCxt(X,Q.default,"additionalProperties"));let Z=(0,U.allSchemaProperties)(G);for(let w of Z)X.definedProperties.add(w);if(X.opts.unevaluated&&Z.length&&X.props!==!0)X.props=z.mergeEvaluated.props(K,(0,z.toHash)(Z),X.props);let q=Z.filter((w)=>!(0,z.alwaysValidSchema)(X,G[w]));if(q.length===0)return;let V=K.name("valid");for(let w of q){if(F(w))M(w);else{if(K.if((0,U.propertyInData)(K,W,w,X.opts.ownProperties)),M(w),!X.allErrors)K.else().var(V,!0);K.endIf()}I.it.definedProperties.add(w),I.ok(V)}function F(w){return X.opts.useDefaults&&!X.compositeRule&&G[w].default!==void 0}function M(w){I.subschema({keyword:"properties",schemaProp:w,dataProp:w},V)}}};$.default=J}),Wb0=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=Q5(),U=L1(),z=v1(),Q=v1(),J={keyword:"patternProperties",type:"object",schemaType:"object",code(I){let{gen:K,schema:G,data:H,parentSchema:W,it:X}=I,{opts:Z}=X,q=(0,Y.allSchemaProperties)(G),V=q.filter((P)=>(0,z.alwaysValidSchema)(X,G[P]));if(q.length===0||V.length===q.length&&(!X.opts.unevaluated||X.props===!0))return;let F=Z.strictSchema&&!Z.allowMatchingProperties&&W.properties,M=K.name("valid");if(X.props!==!0&&!(X.props instanceof U.Name))X.props=(0,Q.evaluatedPropsToName)(K,X.props);let{props:w}=X;N();function N(){for(let P of q){if(F)O(P);if(X.allErrors)D(P);else K.var(M,!0),D(P),K.if(M)}}function O(P){for(let T in F)if(new RegExp(P).test(T))(0,z.checkStrictMode)(X,`property ${T} matches pattern ${P} (use allowMatchingProperties)`)}function D(P){K.forIn("key",H,(T)=>{K.if(U._`${(0,Y.usePattern)(I,P)}.test(${T})`,()=>{let A=V.includes(P);if(!A)I.subschema({keyword:"patternProperties",schemaProp:P,dataProp:T,dataPropType:Q.Type.Str},M);if(X.opts.unevaluated&&w!==!0)K.assign(U._`${w}[${T}]`,!0);else if(!A&&!X.allErrors)K.if((0,U.not)(M),()=>K.break())})})}}};$.default=J}),Xb0=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=v1(),U={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(z){let{gen:Q,schema:J,it:I}=z;if((0,Y.alwaysValidSchema)(I,J)){z.fail();return}let K=Q.name("valid");z.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},K),z.failResult(K,()=>z.reset(),()=>z.error())},error:{message:"must NOT be valid"}};$.default=U}),Zb0=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:Q5().validateUnion,error:{message:"must match a schema in anyOf"}};$.default=Y}),qb0=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=L1(),U=v1(),z={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:{message:"must match exactly one schema in oneOf",params:({params:Q})=>Y._`{passingSchemas: ${Q.passing}}`},code(Q){let{gen:J,schema:I,parentSchema:K,it:G}=Q;if(!Array.isArray(I))throw Error("ajv implementation error");if(G.opts.discriminator&&K.discriminator)return;let H=I,W=J.let("valid",!1),X=J.let("passing",null),Z=J.name("_valid");Q.setParams({passing:X}),J.block(q),Q.result(W,()=>Q.reset(),()=>Q.error(!0));function q(){H.forEach((V,F)=>{let M;if((0,U.alwaysValidSchema)(G,V))J.var(Z,!0);else M=Q.subschema({keyword:"oneOf",schemaProp:F,compositeRule:!0},Z);if(F>0)J.if(Y._`${Z} && ${W}`).assign(W,!1).assign(X,Y._`[${X}, ${F}]`).else();J.if(Z,()=>{if(J.assign(W,!0),J.assign(X,F),M)Q.mergeEvaluated(M,Y.Name)})})}}};$.default=z}),Vb0=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=v1(),U={keyword:"allOf",schemaType:"array",code(z){let{gen:Q,schema:J,it:I}=z;if(!Array.isArray(J))throw Error("ajv implementation error");let K=Q.name("valid");J.forEach((G,H)=>{if((0,Y.alwaysValidSchema)(I,G))return;let W=z.subschema({keyword:"allOf",schemaProp:H},K);z.ok(K),z.mergeEvaluated(W)})}};$.default=U}),Lb0=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=L1(),U=v1(),z={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:{message:({params:J})=>Y.str`must match "${J.ifClause}" schema`,params:({params:J})=>Y._`{failingKeyword: ${J.ifClause}}`},code(J){let{gen:I,parentSchema:K,it:G}=J;if(K.then===void 0&&K.else===void 0)(0,U.checkStrictMode)(G,'"if" without "then" and "else" is ignored');let H=Q(G,"then"),W=Q(G,"else");if(!H&&!W)return;let X=I.let("valid",!0),Z=I.name("_valid");if(q(),J.reset(),H&&W){let F=I.let("ifClause");J.setParams({ifClause:F}),I.if(Z,V("then",F),V("else",F))}else if(H)I.if(Z,V("then"));else I.if((0,Y.not)(Z),V("else"));J.pass(X,()=>J.error(!0));function q(){let F=J.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},Z);J.mergeEvaluated(F)}function V(F,M){return()=>{let w=J.subschema({keyword:F},Z);if(I.assign(X,Z),J.mergeValidEvaluated(w,X),M)I.assign(M,Y._`${F}`);else J.setParams({ifClause:F})}}}};function Q(J,I){let K=J.schema[I];return K!==void 0&&!(0,U.alwaysValidSchema)(J,K)}$.default=z}),Fb0=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=v1(),U={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:z,parentSchema:Q,it:J}){if(Q.if===void 0)(0,Y.checkStrictMode)(J,`"${z}" without "if" is ignored`)}};$.default=U}),$e=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=at(),U=Jb0(),z=tt(),Q=Ib0(),J=Kb0(),I=HS(),K=Gb0(),G=et(),H=Hb0(),W=Wb0(),X=Xb0(),Z=Zb0(),q=qb0(),V=Vb0(),F=Lb0(),M=Fb0();function w(N=!1){let O=[X.default,Z.default,q.default,V.default,F.default,M.default,K.default,G.default,I.default,H.default,W.default];if(N)O.push(U.default,Q.default);else O.push(Y.default,z.default);return O.push(J.default),O}$.default=w}),wb0=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=L1(),U={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:{message:({schemaCode:z})=>Y.str`must match format "${z}"`,params:({schemaCode:z})=>Y._`{format: ${z}}`},code(z,Q){let{gen:J,data:I,$data:K,schema:G,schemaCode:H,it:W}=z,{opts:X,errSchemaPath:Z,schemaEnv:q,self:V}=W;if(!X.validateFormats)return;if(K)F();else M();function F(){let w=J.scopeValue("formats",{ref:V.formats,code:X.code.formats}),N=J.const("fDef",Y._`${w}[${H}]`),O=J.let("fType"),D=J.let("format");J.if(Y._`typeof ${N} == "object" && !(${N} instanceof RegExp)`,()=>J.assign(O,Y._`${N}.type || "string"`).assign(D,Y._`${N}.validate`),()=>J.assign(O,Y._`"string"`).assign(D,N)),z.fail$data((0,Y.or)(P(),T()));function P(){if(X.strictSchema===!1)return Y.nil;return Y._`${H} && !${D}`}function T(){let A=q.$async?Y._`(${N}.async ? await ${D}(${I}) : ${D}(${I}))`:Y._`${D}(${I})`,j=Y._`(typeof ${D} == "function" ? ${A} : ${D}.test(${I}))`;return Y._`${D} && ${D} !== true && ${O} === ${Q} && !${j}`}}function M(){let w=V.formats[G];if(!w){P();return}if(w===!0)return;let[N,O,D]=T(w);if(N===Q)z.pass(A());function P(){if(X.strictSchema===!1){V.logger.warn(j());return}throw Error(j());function j(){return`unknown format "${G}" ignored in schema at path "${Z}"`}}function T(j){let C=j instanceof RegExp?(0,Y.regexpCode)(j):X.code.formats?Y._`${X.code.formats}${(0,Y.getProperty)(G)}`:void 0,b=J.scopeValue("formats",{key:G,ref:j,code:C});if(typeof j=="object"&&!(j instanceof RegExp))return[j.type||"string",j.validate,Y._`${b}.validate`];return["string",j,b]}function A(){if(typeof w=="object"&&!(w instanceof RegExp)&&w.async){if(!q.$async)throw Error("async format in sync schema");return Y._`await ${D}(${I})`}return typeof O=="function"?Y._`${D}(${I})`:Y._`${D}.test(${I})`}}}};$.default=U}),Ye=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=[wb0().default];$.default=Y}),Ue=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0}),$.contentVocabulary=$.metadataVocabulary=void 0,$.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"],$.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]}),ze=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=rt(),U=st(),z=$e(),Q=Ye(),J=Ue(),I=[Y.default,U.default,(0,z.default)(),Q.default,J.metadataVocabulary,J.contentVocabulary];$.default=I}),Mb0=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0}),$.DiscrError=void 0;var Y;(function(U){U.Tag="tag",U.Mapping="mapping"})(Y||($.DiscrError=Y={}))}),WS=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=L1(),U=Mb0(),z=yw(),Q=kQ(),J=v1(),I={keyword:"discriminator",type:"object",schemaType:"object",error:{message:({params:{discrError:K,tagName:G}})=>K===U.DiscrError.Tag?`tag "${G}" must be string`:`value of tag "${G}" must be in oneOf`,params:({params:{discrError:K,tag:G,tagName:H}})=>Y._`{error: ${K}, tag: ${H}, tagValue: ${G}}`},code(K){let{gen:G,data:H,schema:W,parentSchema:X,it:Z}=K,{oneOf:q}=X;if(!Z.opts.discriminator)throw Error("discriminator: requires discriminator option");let V=W.propertyName;if(typeof V!="string")throw Error("discriminator: requires propertyName");if(W.mapping)throw Error("discriminator: mapping is not supported");if(!q)throw Error("discriminator: requires oneOf keyword");let F=G.let("valid",!1),M=G.const("tag",Y._`${H}${(0,Y.getProperty)(V)}`);G.if(Y._`typeof ${M} == "string"`,()=>w(),()=>K.error(!1,{discrError:U.DiscrError.Tag,tag:M,tagName:V})),K.ok(F);function w(){let D=O();G.if(!1);for(let P in D)G.elseIf(Y._`${M} === ${P}`),G.assign(F,N(D[P]));G.else(),K.error(!1,{discrError:U.DiscrError.Mapping,tag:M,tagName:V}),G.endIf()}function N(D){let P=G.name("valid"),T=K.subschema({keyword:"oneOf",schemaProp:D},P);return K.mergeEvaluated(T,Y.Name),P}function O(){var D;let P={},T=j(X),A=!0;for(let x=0;x{Y.exports={$schema:"http://json-schema.org/draft-07/schema#",$id:"http://json-schema.org/draft-07/schema#",title:"Core schema meta-schema",definitions:{schemaArray:{type:"array",minItems:1,items:{$ref:"#"}},nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{allOf:[{$ref:"#/definitions/nonNegativeInteger"},{default:0}]},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}},type:["object","boolean"],properties:{$id:{type:"string",format:"uri-reference"},$schema:{type:"string",format:"uri"},$ref:{type:"string",format:"uri-reference"},$comment:{type:"string"},title:{type:"string"},description:{type:"string"},default:!0,readOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/definitions/nonNegativeInteger"},minLength:{$ref:"#/definitions/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},additionalItems:{$ref:"#"},items:{anyOf:[{$ref:"#"},{$ref:"#/definitions/schemaArray"}],default:!0},maxItems:{$ref:"#/definitions/nonNegativeInteger"},minItems:{$ref:"#/definitions/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},contains:{$ref:"#"},maxProperties:{$ref:"#/definitions/nonNegativeInteger"},minProperties:{$ref:"#/definitions/nonNegativeIntegerDefault0"},required:{$ref:"#/definitions/stringArray"},additionalProperties:{$ref:"#"},definitions:{type:"object",additionalProperties:{$ref:"#"},default:{}},properties:{type:"object",additionalProperties:{$ref:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$ref:"#"},propertyNames:{format:"regex"},default:{}},dependencies:{type:"object",additionalProperties:{anyOf:[{$ref:"#"},{$ref:"#/definitions/stringArray"}]}},propertyNames:{$ref:"#"},const:!0,enum:{type:"array",items:!0,minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:"#/definitions/simpleTypes"},{type:"array",items:{$ref:"#/definitions/simpleTypes"},minItems:1,uniqueItems:!0}]},format:{type:"string"},contentMediaType:{type:"string"},contentEncoding:{type:"string"},if:{$ref:"#"},then:{$ref:"#"},else:{$ref:"#"},allOf:{$ref:"#/definitions/schemaArray"},anyOf:{$ref:"#/definitions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"}},default:!0}}),Qe=R0(($,Y)=>{Object.defineProperty($,"__esModule",{value:!0}),$.MissingRefError=$.ValidationError=$.CodeGen=$.Name=$.nil=$.stringify=$.str=$._=$.KeywordCxt=$.Ajv=void 0;let U=IS(),z=ze(),Q=WS(),J=Ob0(),I=["/properties"],K="http://json-schema.org/draft-07/schema";var G=class extends U.default{_addVocabularies(){if(super._addVocabularies(),z.default.forEach((q)=>this.addVocabulary(q)),this.opts.discriminator)this.addKeyword(Q.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;let q=this.opts.$data?this.$dataMetaSchema(J,I):J;this.addMetaSchema(q,K,!1),this.refs["http://json-schema.org/schema"]=K}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(K)?K:void 0)}};$.Ajv=G,Y.exports=$=G,Y.exports.Ajv=G,Object.defineProperty($,"__esModule",{value:!0}),$.default=G;var H=yQ();Object.defineProperty($,"KeywordCxt",{enumerable:!0,get:function(){return H.KeywordCxt}});var W=L1();Object.defineProperty($,"_",{enumerable:!0,get:function(){return W._}}),Object.defineProperty($,"str",{enumerable:!0,get:function(){return W.str}}),Object.defineProperty($,"stringify",{enumerable:!0,get:function(){return W.stringify}}),Object.defineProperty($,"nil",{enumerable:!0,get:function(){return W.nil}}),Object.defineProperty($,"Name",{enumerable:!0,get:function(){return W.Name}}),Object.defineProperty($,"CodeGen",{enumerable:!0,get:function(){return W.CodeGen}});var X=LH();Object.defineProperty($,"ValidationError",{enumerable:!0,get:function(){return X.default}});var Z=kQ();Object.defineProperty($,"MissingRefError",{enumerable:!0,get:function(){return Z.default}})}),Je=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0}),$.dynamicAnchor=void 0;let Y=L1(),U=z5(),z=yw(),Q=KS(),J={keyword:"$dynamicAnchor",schemaType:"string",code:(G)=>I(G,G.schema)};function I(G,H){let{gen:W,it:X}=G;X.schemaEnv.root.dynamicAnchors[H]=!0;let Z=Y._`${U.default.dynamicAnchors}${(0,Y.getProperty)(H)}`,q=X.errSchemaPath==="#"?X.validateName:K(G);W.if(Y._`!${Z}`,()=>W.assign(Z,q))}$.dynamicAnchor=I;function K(G){let{schemaEnv:H,schema:W,self:X}=G.it,{root:Z,baseId:q,localRefs:V,meta:F}=H.root,{schemaId:M}=X.opts,w=new z.SchemaEnv({schema:W,schemaId:M,root:Z,baseId:q,localRefs:V,meta:F});return z.compileSchema.call(X,w),(0,Q.getValidate)(G,w)}$.default=J}),Ie=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0}),$.dynamicRef=void 0;let Y=L1(),U=z5(),z=KS(),Q={keyword:"$dynamicRef",schemaType:"string",code:(I)=>J(I,I.schema)};function J(I,K){let{gen:G,keyword:H,it:W}=I;if(K[0]!=="#")throw Error(`"${H}" only supports hash fragment reference`);let X=K.slice(1);if(W.allErrors)Z();else{let V=G.let("valid",!1);Z(V),I.ok(V)}function Z(V){if(W.schemaEnv.root.dynamicAnchors[X]){let F=G.let("_v",Y._`${U.default.dynamicAnchors}${(0,Y.getProperty)(X)}`);G.if(F,q(F,V),q(W.validateName,V))}else q(W.validateName,V)()}function q(V,F){return F?()=>G.block(()=>{(0,z.callRef)(I,V),G.let(F,!0)}):()=>(0,z.callRef)(I,V)}}$.dynamicRef=J,$.default=Q}),Nb0=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=Je(),U=v1(),z={keyword:"$recursiveAnchor",schemaType:"boolean",code(Q){if(Q.schema)(0,Y.dynamicAnchor)(Q,"");else(0,U.checkStrictMode)(Q.it,"$recursiveAnchor: false is ignored")}};$.default=z}),Db0=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=Ie(),U={keyword:"$recursiveRef",schemaType:"string",code:(z)=>(0,Y.dynamicRef)(z,z.schema)};$.default=U}),Ke=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=Je(),U=Ie(),z=Nb0(),Q=Db0(),J=[Y.default,U.default,z.default,Q.default];$.default=J}),Ab0=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=HS(),U={keyword:"dependentRequired",type:"object",schemaType:"object",error:Y.error,code:(z)=>(0,Y.validatePropertyDeps)(z)};$.default=U}),Bb0=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=HS(),U={keyword:"dependentSchemas",type:"object",schemaType:"object",code:(z)=>(0,Y.validateSchemaDeps)(z)};$.default=U}),Pb0=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=v1(),U={keyword:["maxContains","minContains"],type:"array",schemaType:"number",code({keyword:z,parentSchema:Q,it:J}){if(Q.contains===void 0)(0,Y.checkStrictMode)(J,`"${z}" without "contains" is ignored`)}};$.default=U}),Ge=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=Ab0(),U=Bb0(),z=Pb0(),Q=[Y.default,U.default,z.default];$.default=Q}),Tb0=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=L1(),U=v1(),z=z5(),Q={keyword:"unevaluatedProperties",type:"object",schemaType:["boolean","object"],trackErrors:!0,error:{message:"must NOT have unevaluated properties",params:({params:J})=>Y._`{unevaluatedProperty: ${J.unevaluatedProperty}}`},code(J){let{gen:I,schema:K,data:G,errsCount:H,it:W}=J;if(!H)throw Error("ajv implementation error");let{allErrors:X,props:Z}=W;if(Z instanceof Y.Name)I.if(Y._`${Z} !== true`,()=>I.forIn("key",G,(M)=>I.if(V(Z,M),()=>q(M))));else if(Z!==!0)I.forIn("key",G,(M)=>Z===void 0?q(M):I.if(F(Z,M),()=>q(M)));W.props=!0,J.ok(Y._`${H} === ${z.default.errors}`);function q(M){if(K===!1){if(J.setParams({unevaluatedProperty:M}),J.error(),!X)I.break();return}if(!(0,U.alwaysValidSchema)(W,K)){let w=I.name("valid");if(J.subschema({keyword:"unevaluatedProperties",dataProp:M,dataPropType:U.Type.Str},w),!X)I.if((0,Y.not)(w),()=>I.break())}}function V(M,w){return Y._`!${M} || !${M}[${w}]`}function F(M,w){let N=[];for(let O in M)if(M[O]===!0)N.push(Y._`${w} !== ${O}`);return(0,Y.and)(...N)}}};$.default=Q}),jb0=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=L1(),U=v1(),z={keyword:"unevaluatedItems",type:"array",schemaType:["boolean","object"],error:{message:({params:{len:Q}})=>Y.str`must NOT have more than ${Q} items`,params:({params:{len:Q}})=>Y._`{limit: ${Q}}`},code(Q){let{gen:J,schema:I,data:K,it:G}=Q,H=G.items||0;if(H===!0)return;let W=J.const("len",Y._`${K}.length`);if(I===!1)Q.setParams({len:H}),Q.fail(Y._`${W} > ${H}`);else if(typeof I=="object"&&!(0,U.alwaysValidSchema)(G,I)){let Z=J.var("valid",Y._`${W} <= ${H}`);J.if((0,Y.not)(Z),()=>X(Z,H)),Q.ok(Z)}G.items=!0;function X(Z,q){J.forRange("i",q,W,(V)=>{if(Q.subschema({keyword:"unevaluatedItems",dataProp:V,dataPropType:U.Type.Num},Z),!G.allErrors)J.if((0,Y.not)(Z),()=>J.break())})}}};$.default=z}),He=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=Tb0(),U=jb0(),z=[Y.default,U.default];$.default=z}),Eb0=R0(($,Y)=>{Y.exports={$schema:"https://json-schema.org/draft/2019-09/schema",$id:"https://json-schema.org/draft/2019-09/schema",$vocabulary:{"https://json-schema.org/draft/2019-09/vocab/core":!0,"https://json-schema.org/draft/2019-09/vocab/applicator":!0,"https://json-schema.org/draft/2019-09/vocab/validation":!0,"https://json-schema.org/draft/2019-09/vocab/meta-data":!0,"https://json-schema.org/draft/2019-09/vocab/format":!1,"https://json-schema.org/draft/2019-09/vocab/content":!0},$recursiveAnchor:!0,title:"Core and Validation specifications meta-schema",allOf:[{$ref:"meta/core"},{$ref:"meta/applicator"},{$ref:"meta/validation"},{$ref:"meta/meta-data"},{$ref:"meta/format"},{$ref:"meta/content"}],type:["object","boolean"],properties:{definitions:{$comment:"While no longer an official keyword as it is replaced by $defs, this keyword is retained in the meta-schema to prevent incompatible extensions as it remains in common use.",type:"object",additionalProperties:{$recursiveRef:"#"},default:{}},dependencies:{$comment:'"dependencies" is no longer a keyword, but schema authors should avoid redefining it to facilitate a smooth transition to "dependentSchemas" and "dependentRequired"',type:"object",additionalProperties:{anyOf:[{$recursiveRef:"#"},{$ref:"meta/validation#/$defs/stringArray"}]}}}}}),Cb0=R0(($,Y)=>{Y.exports={$schema:"https://json-schema.org/draft/2019-09/schema",$id:"https://json-schema.org/draft/2019-09/meta/applicator",$vocabulary:{"https://json-schema.org/draft/2019-09/vocab/applicator":!0},$recursiveAnchor:!0,title:"Applicator vocabulary meta-schema",type:["object","boolean"],properties:{additionalItems:{$recursiveRef:"#"},unevaluatedItems:{$recursiveRef:"#"},items:{anyOf:[{$recursiveRef:"#"},{$ref:"#/$defs/schemaArray"}]},contains:{$recursiveRef:"#"},additionalProperties:{$recursiveRef:"#"},unevaluatedProperties:{$recursiveRef:"#"},properties:{type:"object",additionalProperties:{$recursiveRef:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$recursiveRef:"#"},propertyNames:{format:"regex"},default:{}},dependentSchemas:{type:"object",additionalProperties:{$recursiveRef:"#"}},propertyNames:{$recursiveRef:"#"},if:{$recursiveRef:"#"},then:{$recursiveRef:"#"},else:{$recursiveRef:"#"},allOf:{$ref:"#/$defs/schemaArray"},anyOf:{$ref:"#/$defs/schemaArray"},oneOf:{$ref:"#/$defs/schemaArray"},not:{$recursiveRef:"#"}},$defs:{schemaArray:{type:"array",minItems:1,items:{$recursiveRef:"#"}}}}}),Rb0=R0(($,Y)=>{Y.exports={$schema:"https://json-schema.org/draft/2019-09/schema",$id:"https://json-schema.org/draft/2019-09/meta/content",$vocabulary:{"https://json-schema.org/draft/2019-09/vocab/content":!0},$recursiveAnchor:!0,title:"Content vocabulary meta-schema",type:["object","boolean"],properties:{contentMediaType:{type:"string"},contentEncoding:{type:"string"},contentSchema:{$recursiveRef:"#"}}}}),_b0=R0(($,Y)=>{Y.exports={$schema:"https://json-schema.org/draft/2019-09/schema",$id:"https://json-schema.org/draft/2019-09/meta/core",$vocabulary:{"https://json-schema.org/draft/2019-09/vocab/core":!0},$recursiveAnchor:!0,title:"Core vocabulary meta-schema",type:["object","boolean"],properties:{$id:{type:"string",format:"uri-reference",$comment:"Non-empty fragments not allowed.",pattern:"^[^#]*#?$"},$schema:{type:"string",format:"uri"},$anchor:{type:"string",pattern:"^[A-Za-z][-A-Za-z0-9.:_]*$"},$ref:{type:"string",format:"uri-reference"},$recursiveRef:{type:"string",format:"uri-reference"},$recursiveAnchor:{type:"boolean",default:!1},$vocabulary:{type:"object",propertyNames:{type:"string",format:"uri"},additionalProperties:{type:"boolean"}},$comment:{type:"string"},$defs:{type:"object",additionalProperties:{$recursiveRef:"#"},default:{}}}}}),vb0=R0(($,Y)=>{Y.exports={$schema:"https://json-schema.org/draft/2019-09/schema",$id:"https://json-schema.org/draft/2019-09/meta/format",$vocabulary:{"https://json-schema.org/draft/2019-09/vocab/format":!0},$recursiveAnchor:!0,title:"Format vocabulary meta-schema",type:["object","boolean"],properties:{format:{type:"string"}}}}),hb0=R0(($,Y)=>{Y.exports={$schema:"https://json-schema.org/draft/2019-09/schema",$id:"https://json-schema.org/draft/2019-09/meta/meta-data",$vocabulary:{"https://json-schema.org/draft/2019-09/vocab/meta-data":!0},$recursiveAnchor:!0,title:"Meta-data vocabulary meta-schema",type:["object","boolean"],properties:{title:{type:"string"},description:{type:"string"},default:!0,deprecated:{type:"boolean",default:!1},readOnly:{type:"boolean",default:!1},writeOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0}}}}),Sb0=R0(($,Y)=>{Y.exports={$schema:"https://json-schema.org/draft/2019-09/schema",$id:"https://json-schema.org/draft/2019-09/meta/validation",$vocabulary:{"https://json-schema.org/draft/2019-09/vocab/validation":!0},$recursiveAnchor:!0,title:"Validation vocabulary meta-schema",type:["object","boolean"],properties:{multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/$defs/nonNegativeInteger"},minLength:{$ref:"#/$defs/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},maxItems:{$ref:"#/$defs/nonNegativeInteger"},minItems:{$ref:"#/$defs/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},maxContains:{$ref:"#/$defs/nonNegativeInteger"},minContains:{$ref:"#/$defs/nonNegativeInteger",default:1},maxProperties:{$ref:"#/$defs/nonNegativeInteger"},minProperties:{$ref:"#/$defs/nonNegativeIntegerDefault0"},required:{$ref:"#/$defs/stringArray"},dependentRequired:{type:"object",additionalProperties:{$ref:"#/$defs/stringArray"}},const:!0,enum:{type:"array",items:!0},type:{anyOf:[{$ref:"#/$defs/simpleTypes"},{type:"array",items:{$ref:"#/$defs/simpleTypes"},minItems:1,uniqueItems:!0}]}},$defs:{nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{$ref:"#/$defs/nonNegativeInteger",default:0},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}}}}),gb0=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=Eb0(),U=Cb0(),z=Rb0(),Q=_b0(),J=vb0(),I=hb0(),K=Sb0(),G=["/properties"];function H(W){return[Y,U,z,Q,X(this,J),I,X(this,K)].forEach((Z)=>this.addMetaSchema(Z,void 0,!1)),this;function X(Z,q){return W?Z.$dataMetaSchema(q,G):q}}$.default=H}),yb0=R0(($,Y)=>{Object.defineProperty($,"__esModule",{value:!0}),$.MissingRefError=$.ValidationError=$.CodeGen=$.Name=$.nil=$.stringify=$.str=$._=$.KeywordCxt=$.Ajv2019=void 0;let U=IS(),z=ze(),Q=Ke(),J=Ge(),I=He(),K=WS(),G=gb0(),H="https://json-schema.org/draft/2019-09/schema";var W=class extends U.default{constructor(F={}){super({...F,dynamicRef:!0,next:!0,unevaluated:!0})}_addVocabularies(){if(super._addVocabularies(),this.addVocabulary(Q.default),z.default.forEach((F)=>this.addVocabulary(F)),this.addVocabulary(J.default),this.addVocabulary(I.default),this.opts.discriminator)this.addKeyword(K.default)}_addDefaultMetaSchema(){super._addDefaultMetaSchema();let{$data:F,meta:M}=this.opts;if(!M)return;G.default.call(this,F),this.refs["http://json-schema.org/schema"]=H}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(H)?H:void 0)}};$.Ajv2019=W,Y.exports=$=W,Y.exports.Ajv2019=W,Object.defineProperty($,"__esModule",{value:!0}),$.default=W;var X=yQ();Object.defineProperty($,"KeywordCxt",{enumerable:!0,get:function(){return X.KeywordCxt}});var Z=L1();Object.defineProperty($,"_",{enumerable:!0,get:function(){return Z._}}),Object.defineProperty($,"str",{enumerable:!0,get:function(){return Z.str}}),Object.defineProperty($,"stringify",{enumerable:!0,get:function(){return Z.stringify}}),Object.defineProperty($,"nil",{enumerable:!0,get:function(){return Z.nil}}),Object.defineProperty($,"Name",{enumerable:!0,get:function(){return Z.Name}}),Object.defineProperty($,"CodeGen",{enumerable:!0,get:function(){return Z.CodeGen}});var q=LH();Object.defineProperty($,"ValidationError",{enumerable:!0,get:function(){return q.default}});var V=kQ();Object.defineProperty($,"MissingRefError",{enumerable:!0,get:function(){return V.default}})}),kb0=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=rt(),U=st(),z=$e(),Q=Ke(),J=Ge(),I=He(),K=Ye(),G=Ue(),H=[Q.default,Y.default,U.default,(0,z.default)(!0),K.default,G.metadataVocabulary,G.contentVocabulary,J.default,I.default];$.default=H}),xb0=R0(($,Y)=>{Y.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/schema",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/core":!0,"https://json-schema.org/draft/2020-12/vocab/applicator":!0,"https://json-schema.org/draft/2020-12/vocab/unevaluated":!0,"https://json-schema.org/draft/2020-12/vocab/validation":!0,"https://json-schema.org/draft/2020-12/vocab/meta-data":!0,"https://json-schema.org/draft/2020-12/vocab/format-annotation":!0,"https://json-schema.org/draft/2020-12/vocab/content":!0},$dynamicAnchor:"meta",title:"Core and Validation specifications meta-schema",allOf:[{$ref:"meta/core"},{$ref:"meta/applicator"},{$ref:"meta/unevaluated"},{$ref:"meta/validation"},{$ref:"meta/meta-data"},{$ref:"meta/format-annotation"},{$ref:"meta/content"}],type:["object","boolean"],$comment:"This meta-schema also defines keywords that have appeared in previous drafts in order to prevent incompatible extensions as they remain in common use.",properties:{definitions:{$comment:'"definitions" has been replaced by "$defs".',type:"object",additionalProperties:{$dynamicRef:"#meta"},deprecated:!0,default:{}},dependencies:{$comment:'"dependencies" has been split and replaced by "dependentSchemas" and "dependentRequired" in order to serve their differing semantics.',type:"object",additionalProperties:{anyOf:[{$dynamicRef:"#meta"},{$ref:"meta/validation#/$defs/stringArray"}]},deprecated:!0,default:{}},$recursiveAnchor:{$comment:'"$recursiveAnchor" has been replaced by "$dynamicAnchor".',$ref:"meta/core#/$defs/anchorString",deprecated:!0},$recursiveRef:{$comment:'"$recursiveRef" has been replaced by "$dynamicRef".',$ref:"meta/core#/$defs/uriReferenceString",deprecated:!0}}}}),fb0=R0(($,Y)=>{Y.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/applicator",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/applicator":!0},$dynamicAnchor:"meta",title:"Applicator vocabulary meta-schema",type:["object","boolean"],properties:{prefixItems:{$ref:"#/$defs/schemaArray"},items:{$dynamicRef:"#meta"},contains:{$dynamicRef:"#meta"},additionalProperties:{$dynamicRef:"#meta"},properties:{type:"object",additionalProperties:{$dynamicRef:"#meta"},default:{}},patternProperties:{type:"object",additionalProperties:{$dynamicRef:"#meta"},propertyNames:{format:"regex"},default:{}},dependentSchemas:{type:"object",additionalProperties:{$dynamicRef:"#meta"},default:{}},propertyNames:{$dynamicRef:"#meta"},if:{$dynamicRef:"#meta"},then:{$dynamicRef:"#meta"},else:{$dynamicRef:"#meta"},allOf:{$ref:"#/$defs/schemaArray"},anyOf:{$ref:"#/$defs/schemaArray"},oneOf:{$ref:"#/$defs/schemaArray"},not:{$dynamicRef:"#meta"}},$defs:{schemaArray:{type:"array",minItems:1,items:{$dynamicRef:"#meta"}}}}}),ub0=R0(($,Y)=>{Y.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/unevaluated",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/unevaluated":!0},$dynamicAnchor:"meta",title:"Unevaluated applicator vocabulary meta-schema",type:["object","boolean"],properties:{unevaluatedItems:{$dynamicRef:"#meta"},unevaluatedProperties:{$dynamicRef:"#meta"}}}}),bb0=R0(($,Y)=>{Y.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/content",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/content":!0},$dynamicAnchor:"meta",title:"Content vocabulary meta-schema",type:["object","boolean"],properties:{contentEncoding:{type:"string"},contentMediaType:{type:"string"},contentSchema:{$dynamicRef:"#meta"}}}}),ib0=R0(($,Y)=>{Y.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/core",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/core":!0},$dynamicAnchor:"meta",title:"Core vocabulary meta-schema",type:["object","boolean"],properties:{$id:{$ref:"#/$defs/uriReferenceString",$comment:"Non-empty fragments not allowed.",pattern:"^[^#]*#?$"},$schema:{$ref:"#/$defs/uriString"},$ref:{$ref:"#/$defs/uriReferenceString"},$anchor:{$ref:"#/$defs/anchorString"},$dynamicRef:{$ref:"#/$defs/uriReferenceString"},$dynamicAnchor:{$ref:"#/$defs/anchorString"},$vocabulary:{type:"object",propertyNames:{$ref:"#/$defs/uriString"},additionalProperties:{type:"boolean"}},$comment:{type:"string"},$defs:{type:"object",additionalProperties:{$dynamicRef:"#meta"}}},$defs:{anchorString:{type:"string",pattern:"^[A-Za-z_][-A-Za-z0-9._]*$"},uriString:{type:"string",format:"uri"},uriReferenceString:{type:"string",format:"uri-reference"}}}}),cb0=R0(($,Y)=>{Y.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/format-annotation",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/format-annotation":!0},$dynamicAnchor:"meta",title:"Format vocabulary meta-schema for annotation results",type:["object","boolean"],properties:{format:{type:"string"}}}}),nb0=R0(($,Y)=>{Y.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/meta-data",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/meta-data":!0},$dynamicAnchor:"meta",title:"Meta-data vocabulary meta-schema",type:["object","boolean"],properties:{title:{type:"string"},description:{type:"string"},default:!0,deprecated:{type:"boolean",default:!1},readOnly:{type:"boolean",default:!1},writeOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0}}}}),pb0=R0(($,Y)=>{Y.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/validation",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/validation":!0},$dynamicAnchor:"meta",title:"Validation vocabulary meta-schema",type:["object","boolean"],properties:{type:{anyOf:[{$ref:"#/$defs/simpleTypes"},{type:"array",items:{$ref:"#/$defs/simpleTypes"},minItems:1,uniqueItems:!0}]},const:!0,enum:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/$defs/nonNegativeInteger"},minLength:{$ref:"#/$defs/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},maxItems:{$ref:"#/$defs/nonNegativeInteger"},minItems:{$ref:"#/$defs/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},maxContains:{$ref:"#/$defs/nonNegativeInteger"},minContains:{$ref:"#/$defs/nonNegativeInteger",default:1},maxProperties:{$ref:"#/$defs/nonNegativeInteger"},minProperties:{$ref:"#/$defs/nonNegativeIntegerDefault0"},required:{$ref:"#/$defs/stringArray"},dependentRequired:{type:"object",additionalProperties:{$ref:"#/$defs/stringArray"}}},$defs:{nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{$ref:"#/$defs/nonNegativeInteger",default:0},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}}}}),db0=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=xb0(),U=fb0(),z=ub0(),Q=bb0(),J=ib0(),I=cb0(),K=nb0(),G=pb0(),H=["/properties"];function W(X){return[Y,U,z,Q,J,Z(this,I),K,Z(this,G)].forEach((q)=>this.addMetaSchema(q,void 0,!1)),this;function Z(q,V){return X?q.$dataMetaSchema(V,H):V}}$.default=W}),mb0=R0(($,Y)=>{Object.defineProperty($,"__esModule",{value:!0}),$.MissingRefError=$.ValidationError=$.CodeGen=$.Name=$.nil=$.stringify=$.str=$._=$.KeywordCxt=$.Ajv2020=void 0;let U=IS(),z=kb0(),Q=WS(),J=db0(),I="https://json-schema.org/draft/2020-12/schema";var K=class extends U.default{constructor(Z={}){super({...Z,dynamicRef:!0,next:!0,unevaluated:!0})}_addVocabularies(){if(super._addVocabularies(),z.default.forEach((Z)=>this.addVocabulary(Z)),this.opts.discriminator)this.addKeyword(Q.default)}_addDefaultMetaSchema(){super._addDefaultMetaSchema();let{$data:Z,meta:q}=this.opts;if(!q)return;J.default.call(this,Z),this.refs["http://json-schema.org/schema"]=I}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(I)?I:void 0)}};$.Ajv2020=K,Y.exports=$=K,Y.exports.Ajv2020=K,Object.defineProperty($,"__esModule",{value:!0}),$.default=K;var G=yQ();Object.defineProperty($,"KeywordCxt",{enumerable:!0,get:function(){return G.KeywordCxt}});var H=L1();Object.defineProperty($,"_",{enumerable:!0,get:function(){return H._}}),Object.defineProperty($,"str",{enumerable:!0,get:function(){return H.str}}),Object.defineProperty($,"stringify",{enumerable:!0,get:function(){return H.stringify}}),Object.defineProperty($,"nil",{enumerable:!0,get:function(){return H.nil}}),Object.defineProperty($,"Name",{enumerable:!0,get:function(){return H.Name}}),Object.defineProperty($,"CodeGen",{enumerable:!0,get:function(){return H.CodeGen}});var W=LH();Object.defineProperty($,"ValidationError",{enumerable:!0,get:function(){return W.default}});var X=kQ();Object.defineProperty($,"MissingRefError",{enumerable:!0,get:function(){return X.default}})}),lb0=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0}),$.formatNames=$.fastFormats=$.fullFormats=void 0;function Y(x,S){return{validate:x,compare:S}}$.fullFormats={date:Y(J,I),time:Y(G(!0),H),"date-time":Y(Z(!0),q),"iso-time":Y(G(),W),"iso-date-time":Y(Z(),V),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:w,"uri-reference":/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,"uri-template":/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,url:/^(?:https?|ftp):\/\/(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)(?:\.(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu,email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)$/,ipv6:/^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i,regex:b,uuid:/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,"json-pointer":/^(?:\/(?:[^~/]|~0|~1)*)*$/,"json-pointer-uri-fragment":/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,"relative-json-pointer":/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,byte:O,int32:{type:"number",validate:T},int64:{type:"number",validate:A},float:{type:"number",validate:j},double:{type:"number",validate:j},password:!0,binary:!0},$.fastFormats={...$.fullFormats,date:Y(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,I),time:Y(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,H),"date-time":Y(/^\d\d\d\d-[0-1]\d-[0-3]\dt(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,q),"iso-time":Y(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,W),"iso-date-time":Y(/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,V),uri:/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i},$.formatNames=Object.keys($.fullFormats);function U(x){return x%4===0&&(x%100!==0||x%400===0)}let z=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,Q=[0,31,28,31,30,31,30,31,31,30,31,30,31];function J(x){let S=z.exec(x);if(!S)return!1;let i=+S[1],c=+S[2],z0=+S[3];return c>=1&&c<=12&&z0>=1&&z0<=(c===2&&U(i)?29:Q[c])}function I(x,S){if(!(x&&S))return;if(x>S)return 1;if(x23||p>59||x&&!t)return!1;if(z0<=23&&k<=59&&d<60)return!0;let e=k-p*$0,y=z0-g*$0-(e<0?1:0);return(y===23||y===-1)&&(e===59||e===-1)&&d<61}}function H(x,S){if(!(x&&S))return;let i=new Date("2020-01-01T"+x).valueOf(),c=new Date("2020-01-01T"+S).valueOf();if(!(i&&c))return;return i-c}function W(x,S){if(!(x&&S))return;let i=K.exec(x),c=K.exec(S);if(!(i&&c))return;if(x=i[1]+i[2]+i[3],S=c[1]+c[2]+c[3],x>S)return 1;if(x=D}function A(x){return Number.isInteger(x)}function j(){return!0}let C=/[^\\]\\Z/;function b(x){if(C.test(x))return!1;try{return new RegExp(x),!0}catch(S){return!1}}}),ob0=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0}),$.formatLimitDefinition=void 0;let Y=Qe(),U=L1(),z=U.operators,Q={formatMaximum:{okStr:"<=",ok:z.LTE,fail:z.GT},formatMinimum:{okStr:">=",ok:z.GTE,fail:z.LT},formatExclusiveMaximum:{okStr:"<",ok:z.LT,fail:z.GTE},formatExclusiveMinimum:{okStr:">",ok:z.GT,fail:z.LTE}},J={message:({keyword:K,schemaCode:G})=>U.str`should be ${Q[K].okStr} ${G}`,params:({keyword:K,schemaCode:G})=>U._`{comparison: ${Q[K].okStr}, limit: ${G}}`};$.formatLimitDefinition={keyword:Object.keys(Q),type:"string",schemaType:"string",$data:!0,error:J,code(K){let{gen:G,data:H,schemaCode:W,keyword:X,it:Z}=K,{opts:q,self:V}=Z;if(!q.validateFormats)return;let F=new Y.KeywordCxt(Z,V.RULES.all.format.definition,"format");if(F.$data)M();else w();function M(){let O=G.scopeValue("formats",{ref:V.formats,code:q.code.formats}),D=G.const("fmt",U._`${O}[${F.schemaCode}]`);K.fail$data((0,U.or)(U._`typeof ${D} != "object"`,U._`${D} instanceof RegExp`,U._`typeof ${D}.compare != "function"`,N(D)))}function w(){let O=F.schema,D=V.formats[O];if(!D||D===!0)return;if(typeof D!="object"||D instanceof RegExp||typeof D.compare!="function")throw Error(`"${X}": format "${O}" does not define "compare" function`);let P=G.scopeValue("formats",{key:O,ref:D,code:q.code.formats?U._`${q.code.formats}${(0,U.getProperty)(O)}`:void 0});K.fail$data(N(P))}function N(O){return U._`${O}.compare(${H}, ${W}) ${Q[X].fail} 0`}},dependencies:["format"]};let I=(K)=>{return K.addKeyword($.formatLimitDefinition),K};$.default=I}),rb0=R0(($,Y)=>{Object.defineProperty($,"__esModule",{value:!0});let U=lb0(),z=ob0(),Q=L1(),J=new Q.Name("fullFormats"),I=new Q.Name("fastFormats"),K=(H,W={keywords:!0})=>{if(Array.isArray(W))return G(H,W,U.fullFormats,J),H;let[X,Z]=W.mode==="fast"?[U.fastFormats,I]:[U.fullFormats,J];if(G(H,W.formats||U.formatNames,X,Z),W.keywords)(0,z.default)(H);return H};K.get=(H,W="full")=>{let X=(W==="fast"?U.fastFormats:U.fullFormats)[H];if(!X)throw Error(`Unknown format "${H}"`);return X};function G(H,W,X,Z){var q,V;(q=(V=H.opts.code).formats)!==null&&q!==void 0||(V.formats=Q._`require("ajv-formats/dist/formats").${Z}`);for(let F of W)H.addFormat(F,X[F])}Y.exports=$=K,Object.defineProperty($,"__esModule",{value:!0}),$.default=K}),We=Qe(),sb0=yb0(),ab0=mb0(),tb0=nq(rb0(),1),eb0=tb0.default;Mu1=We.Ajv});import XS from"node:process";var xw=m(()=>{Xe()});function qS($){return!!$&&typeof $==="object"&&Ne in $}function Yi0($){return $[Ne]?.complete}function Ui0($,Y){switch(Y.kind){case"tools_list_changed":return $.toolsListChanged===!0;case"prompts_list_changed":return $.promptsListChanged===!0;case"resources_list_changed":return $.resourcesListChanged===!0;case"resource_updated":return $.resourceSubscriptions!==void 0&&$.resourceSubscriptions.includes(Y.uri)}}function zi0($,Y){let U={},z=(Q)=>Y===void 0||Q===!0;if($.toolsListChanged===!0&&z(Y?.tools?.listChanged))U.toolsListChanged=!0;if($.promptsListChanged===!0&&z(Y?.prompts?.listChanged))U.promptsListChanged=!0;if($.resourcesListChanged===!0&&z(Y?.resources?.listChanged))U.resourcesListChanged=!0;if($.resourceSubscriptions!==void 0&&$.resourceSubscriptions.length>0&&z(Y?.resources?.subscribe))U.resourceSubscriptions=[...$.resourceSubscriptions];return U}function Ze($,Y){return{method:$.method,params:{...$.params,_meta:{...$.params?._meta,[yY]:Y}}}}function Qi0($){let Y=j7(qH).validateRequest("subscriptions/listen",$);return Y.ok?Y.value.params?.notifications:void 0}function Ii0($,Y){switch($){case"notifications/tools/list_changed":return{kind:"tools_list_changed"};case"notifications/prompts/list_changed":return{kind:"prompts_list_changed"};case"notifications/resources/list_changed":return{kind:"resources_list_changed"};default:return{kind:"resource_updated",uri:Y??""}}}function Hi0($){if($?.maxRounds!==void 0&&(!Number.isInteger($.maxRounds)||$.maxRounds<1))throw RangeError(`inputRequired.maxRounds must be a positive integer (got ${$.maxRounds})`);if($?.roundTimeoutMs!==void 0&&(!Number.isFinite($.roundTimeoutMs)||$.roundTimeoutMs<=0))throw RangeError(`inputRequired.roundTimeoutMs must be a positive number (got ${$.roundTimeoutMs})`);return{maxRounds:$?.maxRounds??Ki0,roundTimeoutMs:$?.roundTimeoutMs??Gi0,legacyShim:$?.legacyShim??!0}}function Ae($,Y,U){if(U===null||typeof U!=="object"||typeof U.method!=="string")throw new J1(n0.InternalError,`Handler for ${$} returned an invalid input request '${Y}': each inputRequests entry must be an embedded elicitation/create, sampling/createMessage, or roots/list request`);let z=U,Q=qt(z);if(Q===void 0)throw new J1(n0.InternalError,`Handler for ${$} returned an input request '${Y}' of kind '${z.method}', which is not an embedded request the 2026-07-28 revision defines`);return{embedded:z,required:Q}}function Wi0(){let $=globalThis.crypto;if($?.randomUUID!==void 0)return $.randomUUID();let Y=new Uint8Array(16);$.getRandomValues(Y),Y[6]=Y[6]&15|64,Y[8]=Y[8]&63|128;let U=[...Y].map((z)=>z.toString(16).padStart(2,"0")).join("");return`${U.slice(0,8)}-${U.slice(8,12)}-${U.slice(12,16)}-${U.slice(16,20)}-${U.slice(20)}`}function ZS($,Y){if($==="tools/call")return{content:[{type:"text",text:Y}],isError:!0};throw new J1(n0.InternalError,Y)}function VS($,Y){Be($,Y)}function LS($){return Pe($)}function Vi0($){return{...$}}function qe($,Y){if($){let z=Y;return async(Q,J)=>z(Q,J)}let U=Y;return async(z,Q)=>U(Q)}function Le($){if($===void 0)return;try{return R7($,"output")}catch{return}}function Fe($,Y,U){if(Y){let z=U;return async(Q,J)=>{let I=await fY(Y,Q);if(!I.success)throw new J1(n0.InvalidParams,`Invalid arguments for prompt ${$}: ${I.error}`);return z(I.data,J)}}else{let z=U;return async(Q,J)=>{return z(J)}}}function we($){return{completion:{values:$.map(String).slice(0,100),total:$.length,hasMore:$.length>100}}}function Me($){let Y=$;if(Y.shape&&typeof Y.shape==="object")return Y.shape}function Li0($){return $?.type==="optional"}function Oe($){if(!Li0($))return $;return $.def?.innerType??$}var Ne,fw=1024,Ji0,De=class{_subs=new Map;_serverCapabilities;_serverInfo;constructor($=fw,Y,U){this._maxSubscriptions=$,this._serverCapabilities=Y,this._serverInfo=U}setServerCapabilities($,Y){if(this._serverCapabilities=$,Y!==void 0)this._serverInfo=Y}has($){return this._subs.has($)}serve($){if(this._serverCapabilities===void 0)throw Error("StdioListenRouter.serve() called before setServerCapabilities(); refusing to honor a filter without capabilities");if(this._subs.size>=this._maxSubscriptions)return{jsonrpc:"2.0",id:$.id,error:{code:-32603,message:"Subscription limit reached"}};let Y=Qi0($);if(Y===void 0)return{jsonrpc:"2.0",id:$.id,error:{code:-32602,message:"Invalid params: 'notifications' is required and must be a valid SubscriptionFilter"}};let U=zi0(Y,this._serverCapabilities);return this._subs.set($.id,U),Ze({method:"notifications/subscriptions/acknowledged",params:{notifications:U}},$.id)}cancel($){return this._subs.delete($)}routeOutbound($){if(!Ji0.has($.method))return"passthrough";let Y=$.params?.uri,U=typeof Y==="string"?Y:void 0,z=Ii0($.method,U),Q=[];for(let[J,I]of this._subs)if(Ui0(I,z))Q.push(Ze({method:$.method,params:$.params??{}},J));return Q}teardownAll(){let $=[];for(let Y of this._subs.keys())$.push({jsonrpc:"2.0",id:Y,result:{resultType:"complete",_meta:{[yY]:Y,...this._serverInfo!==void 0&&{[d5]:this._serverInfo}}}});return this._subs.clear(),$}},Ki0=8,Gi0=600000,Xi0=class{constructor($){this._host=$}async fulfill($,Y,U,z,Q){let{maxRounds:J,roundTimeoutMs:I}=this._host,K=z.mcpReq.signal,G=Q,H=0;while(!0){if(H+=1,H>J)return ZS($,gt($,J));let W=G.inputRequests,X=W!=null&&Object.keys(W).length>0,Z=typeof G.requestState==="string"?G.requestState:void 0;if(!X&&Z===void 0)throw new J1(n0.InternalError,`Handler for ${$} returned an input-required result with neither inputRequests nor requestState (every InputRequiredResult must include at least one of the two)`);let q;if(X){let M=this._host.resolvedClientCapabilities(z),w=[];for(let[O,D]of Object.entries(W)){let{embedded:P,required:T}=Ae($,O,D);if(P.method!=="roots/list"&&P.params===void 0)throw new J1(n0.InternalError,`Handler for ${$} returned an input request '${O}' of kind '${P.method}' without params`);if(Nw(T,M)!==void 0)return ZS($,`Cannot request input '${O}' (${P.method}): the client on this 2025-era connection did not declare the required capability${M===void 0?" (no client capabilities are available on this connection — per-request legacy serving cannot receive server-to-client requests)":""}`);w.push([O,P])}let N=kt(K);try{let O={relatedRequestId:z.mcpReq.id,timeout:I,resetTimeoutOnProgress:!0,onprogress:()=>{},signal:N.signal},D=await Promise.all(w.map(async([P,T])=>{try{return[P,await this._dispatchLeg(T,O)]}catch(A){throw N.abort(A),A}}));q=Object.fromEntries(D)}catch(O){if(K.aborted)throw O;return ZS($,`Fulfilling input required by '${$}' failed: ${O instanceof Error?O.message:String(O)}`)}finally{N.dispose()}}else await yt(St,K);let V={...z,mcpReq:{...z.mcpReq,inputResponses:q,droppedInputResponseKeys:void 0,requestState:VH(Z)}};if(Z!==void 0){let M=await this._host.verifyRequestState(Z,V,$);if(M!==void 0)V=th(V,M)}let F=await Y(U,V);if(!s9(F))return F;G=F}}async _dispatchLeg($,Y){switch($.method){case"elicitation/create":{let U=$.params;if(U.mode==="url"&&U.elicitationId===void 0)U={...U,elicitationId:Wi0()};return await this._host.sendElicitation(U,Y)}case"sampling/createMessage":return await this._host.sendSampling($.params,Y);case"roots/list":return await this._host.listRoots($.params,Y)}}},Zi0,qi0,Be,Pe,Te,wH=class{server;_registeredResources={};_registeredResourceTemplates={};_registeredTools={};_registeredPrompts={};_toolInputSchemaJson={};toolInputSchemaJson($){let Y=this._registeredTools[$];if(Y===void 0||!Y.enabled)return;if(Object.hasOwn(this._toolInputSchemaJson,$))return this._toolInputSchemaJson[$];if(Y.inputSchema===void 0)return Ve;try{let U=R7(Y.inputSchema,"input");return this._toolInputSchemaJson[$]=U,U}catch{return}}constructor($,Y){if(this.server=new Te($,Y),Y?.capabilities?.tools)this.setToolRequestHandlers();if(Y?.capabilities?.resources)this.setResourceRequestHandlers();if(Y?.capabilities?.prompts)this.setPromptRequestHandlers()}async connect($){return await this.server.connect($)}async close(){await this.server.close()}_toolHandlersInitialized=!1;setToolRequestHandlers(){if(this._toolHandlersInitialized)return;this.server.assertCanSetRequestHandler("tools/list"),this.server.assertCanSetRequestHandler("tools/call"),this.server.registerCapabilities({tools:{listChanged:this.server.getCapabilities().tools?.listChanged??!0}}),this.server.setRequestHandler("tools/list",()=>({tools:Object.entries(this._registeredTools).filter(([,$])=>$.enabled).map(([$,Y])=>{let U={name:$,title:Y.title,description:Y.description,inputSchema:Y.inputSchema?R7(Y.inputSchema,"input"):Ve,annotations:Y.annotations,icons:Y.icons,execution:Y.execution,_meta:Y._meta};if(Y.outputSchema)U.outputSchema=R7(Y.outputSchema,"output");return U})})),this.server.setRequestHandler("tools/call",async($,Y)=>{let U=this._registeredTools[$.params.name];if(!U)throw new J1(n0.InvalidParams,`Tool ${$.params.name} not found`);if(!U.enabled)throw new J1(n0.InvalidParams,`Tool ${$.params.name} disabled`);try{let z=await this.validateToolInput(U,$.params.arguments,$.params.name),Q=await this.executeToolHandler(U,z,Y);if(await this.validateToolOutput(U,Q,$.params.name),s9(Q))return Q;return this.server.projectCallToolResult(Q,U.outputSchemaJson)}catch(z){if(z instanceof J1&&z.code===n0.UrlElicitationRequired)throw z;return this.createToolError(z instanceof Error?z.message:String(z))}}),this._toolHandlersInitialized=!0}createToolError($){return{content:[{type:"text",text:$}],isError:!0}}async validateToolInput($,Y,U){if(!$.inputSchema)return;let z=await fY($.inputSchema,Y??{});if(!z.success)throw new J1(n0.InvalidParams,`Input validation error: Invalid arguments for tool ${U}: ${z.error}`);return z.data}async validateToolOutput($,Y,U){if(!$.outputSchema)return;if(s9(Y))return;if(Y.isError)return;if(Y.structuredContent===void 0)throw new J1(n0.InvalidParams,`Output validation error: Tool ${U} has an output schema but no structured content was provided`);let z=await fY($.outputSchema,Y.structuredContent);if(!z.success)throw new J1(n0.InvalidParams,`Output validation error: Invalid structured content for tool ${U}: ${z.error}`)}async executeToolHandler($,Y,U){return $.executor(Y,U)}_completionHandlerInitialized=!1;setCompletionRequestHandler(){if(this._completionHandlerInitialized)return;this.server.assertCanSetRequestHandler("completion/complete"),this.server.registerCapabilities({completions:{}}),this.server.setRequestHandler("completion/complete",async($)=>{switch($.params.ref.type){case"ref/prompt":return mh($),this.handlePromptCompletion($,$.params.ref);case"ref/resource":return lh($),this.handleResourceCompletion($,$.params.ref);default:throw new J1(n0.InvalidParams,`Invalid completion reference: ${$.params.ref}`)}}),this._completionHandlerInitialized=!0}async handlePromptCompletion($,Y){let U=this._registeredPrompts[Y.name];if(!U)throw new J1(n0.InvalidParams,`Prompt ${Y.name} not found`);if(!U.enabled)throw new J1(n0.InvalidParams,`Prompt ${Y.name} disabled`);if(!U.argsSchema)return FH;let z=Oe(Me(U.argsSchema)?.[$.params.argument.name]);if(!qS(z))return FH;let Q=Yi0(z);if(!Q)return FH;return we(await Q($.params.argument.value,$.params.context))}async handleResourceCompletion($,Y){let U=Object.values(this._registeredResourceTemplates).find((Q)=>Q.resourceTemplate.uriTemplate.toString()===Y.uri);if(!U){if(this._registeredResources[Y.uri])return FH;throw new J1(n0.InvalidParams,`Resource template ${$.params.ref.uri} not found`)}let z=U.resourceTemplate.completeCallback($.params.argument.name);if(!z)return FH;return we(await z($.params.argument.value,$.params.context))}_resourceHandlersInitialized=!1;setResourceRequestHandlers(){if(this._resourceHandlersInitialized)return;this.server.assertCanSetRequestHandler("resources/list"),this.server.assertCanSetRequestHandler("resources/templates/list"),this.server.assertCanSetRequestHandler("resources/read"),this.server.registerCapabilities({resources:{listChanged:this.server.getCapabilities().resources?.listChanged??!0}}),this.server.setRequestHandler("resources/list",async($,Y)=>{let U=Object.entries(this._registeredResources).filter(([Q,J])=>J.enabled).map(([Q,J])=>({uri:Q,name:J.name,...J.metadata})),z=[];for(let Q of Object.values(this._registeredResourceTemplates)){if(!Q.resourceTemplate.listCallback)continue;let J=await Q.resourceTemplate.listCallback(Y);for(let I of J.resources)z.push({...Q.metadata,...I})}return{resources:[...U,...z]}}),this.server.setRequestHandler("resources/templates/list",async()=>{return{resourceTemplates:Object.entries(this._registeredResourceTemplates).map(([$,Y])=>({name:$,uriTemplate:Y.resourceTemplate.uriTemplate.toString(),...Y.metadata}))}}),this.server.setRequestHandler("resources/read",async($,Y)=>{let U;try{U=new URL($.params.uri)}catch{throw new J1(n0.InvalidParams,`Resource URI ${$.params.uri} is invalid`,{uri:$.params.uri,reason:"invalid_uri"})}let z=this._registeredResources[U.toString()];if(z){if(!z.enabled)throw new J1(n0.InvalidParams,`Resource ${U} disabled`);return Dw(await z.readCallback(U,Y),z.cacheHint)}for(let Q of Object.values(this._registeredResourceTemplates)){let J=Q.resourceTemplate.uriTemplate.match(U.toString());if(J)return Dw(await Q.readCallback(U,J,Y),Q.cacheHint)}throw new Aw($.params.uri)}),this._resourceHandlersInitialized=!0}_promptHandlersInitialized=!1;setPromptRequestHandlers(){if(this._promptHandlersInitialized)return;this.server.assertCanSetRequestHandler("prompts/list"),this.server.assertCanSetRequestHandler("prompts/get"),this.server.registerCapabilities({prompts:{listChanged:this.server.getCapabilities().prompts?.listChanged??!0}}),this.server.setRequestHandler("prompts/list",()=>({prompts:Object.entries(this._registeredPrompts).filter(([,$])=>$.enabled).map(([$,Y])=>{return{name:$,title:Y.title,description:Y.description,arguments:Y.argsSchema?ht(Y.argsSchema):void 0,icons:Y.icons,_meta:Y._meta}})})),this.server.setRequestHandler("prompts/get",async($,Y)=>{let U=this._registeredPrompts[$.params.name];if(!U)throw new J1(n0.InvalidParams,`Prompt ${$.params.name} not found`);if(!U.enabled)throw new J1(n0.InvalidParams,`Prompt ${$.params.name} disabled`);return U.handler($.params.arguments,Y)}),this._promptHandlersInitialized=!0}registerResource($,Y,U,z){let Q=U.cacheHint,J=U;if(Q!==void 0){nh(Q,`resource ${$}`);let I={...U};delete I.cacheHint,J=I}if(typeof Y==="string"){if(this._registeredResources[Y])throw Error(`Resource ${Y} is already registered`);let I=this._createRegisteredResource($,U.title,Y,J,z);if(Q!==void 0)I.cacheHint=Q;return this.setResourceRequestHandlers(),this.sendResourceListChanged(),I}else{if(this._registeredResourceTemplates[$])throw Error(`Resource template ${$} is already registered`);let I=this._createRegisteredResourceTemplate($,U.title,Y,J,z);if(Q!==void 0)I.cacheHint=Q;return this.setResourceRequestHandlers(),this.sendResourceListChanged(),I}}_createRegisteredResource($,Y,U,z,Q){let J={name:$,title:Y,metadata:z,readCallback:Q,enabled:!0,disable:()=>J.update({enabled:!1}),enable:()=>J.update({enabled:!0}),remove:()=>J.update({uri:null}),update:(I)=>{if(I.uri!==void 0&&I.uri!==U){if(delete this._registeredResources[U],I.uri)this._registeredResources[I.uri]=J}if(I.name!==void 0)J.name=I.name;if(I.title!==void 0)J.title=I.title;if(I.metadata!==void 0)J.metadata=I.metadata;if(I.callback!==void 0)J.readCallback=I.callback;if(I.enabled!==void 0)J.enabled=I.enabled;this.sendResourceListChanged()}};return this._registeredResources[U]=J,J}_createRegisteredResourceTemplate($,Y,U,z,Q){let J={resourceTemplate:U,title:Y,metadata:z,readCallback:Q,enabled:!0,disable:()=>J.update({enabled:!1}),enable:()=>J.update({enabled:!0}),remove:()=>J.update({name:null}),update:(K)=>{if(K.name!==void 0&&K.name!==$){if(delete this._registeredResourceTemplates[$],K.name)this._registeredResourceTemplates[K.name]=J}if(K.title!==void 0)J.title=K.title;if(K.template!==void 0)J.resourceTemplate=K.template;if(K.metadata!==void 0)J.metadata=K.metadata;if(K.callback!==void 0)J.readCallback=K.callback;if(K.enabled!==void 0)J.enabled=K.enabled;this.sendResourceListChanged()}};this._registeredResourceTemplates[$]=J;let I=U.uriTemplate.variableNames;if(Array.isArray(I)&&I.some((K)=>!!U.completeCallback(K)))this.setCompletionRequestHandler();return J}_createRegisteredPrompt($,Y,U,z,Q,J,I){let K=z,G=Q,H={title:Y,description:U,argsSchema:z,icons:J,_meta:I,handler:Fe($,z,Q),enabled:!0,disable:()=>H.update({enabled:!1}),enable:()=>H.update({enabled:!0}),remove:()=>H.update({name:null}),update:(W)=>{if(W.name!==void 0&&W.name!==$){if(delete this._registeredPrompts[$],W.name)this._registeredPrompts[W.name]=H}if(W.title!==void 0)H.title=W.title;if(W.description!==void 0)H.description=W.description;if(W.icons!==void 0)H.icons=W.icons;if(W._meta!==void 0)H._meta=W._meta;let X=!1;if(W.argsSchema!==void 0)H.argsSchema=W.argsSchema,K=W.argsSchema,X=!0;if(W.callback!==void 0)G=W.callback,X=!0;if(X)H.handler=Fe($,K,G);if(W.enabled!==void 0)H.enabled=W.enabled;this.sendPromptListChanged()}};if(this._registeredPrompts[$]=H,z){let W=Me(z);if(W){if(Object.values(W).some((X)=>{return qS(Oe(X))}))this.setCompletionRequestHandler()}}return H}_createRegisteredTool($,Y,U,z,Q,J,I,K,G,H){if(QS($),z!==void 0)try{let Z=R7(z,"input");this._toolInputSchemaJson[$]=Z;let q=oh(Z);if(!q.valid)console.warn(`[mcp-sdk] tool '${$}' carries an invalid x-mcp-header declaration and will be excluded by conforming Streamable HTTP clients: ${q.reason}`)}catch{}let W=H,X={title:Y,description:U,inputSchema:z,outputSchema:Q,outputSchemaJson:Le(Q),annotations:J,icons:I,execution:K,_meta:G,handler:H,executor:qe(z,H),enabled:!0,disable:()=>X.update({enabled:!1}),enable:()=>X.update({enabled:!0}),remove:()=>X.update({name:null}),update:(Z)=>{if(Z.name!==void 0&&Z.name!==$){if(typeof Z.name==="string")QS(Z.name);if(delete this._registeredTools[$],delete this._toolInputSchemaJson[$],Z.name)delete this._toolInputSchemaJson[Z.name],this._registeredTools[Z.name]=X,$=Z.name}if(Z.title!==void 0)X.title=Z.title;if(Z.description!==void 0)X.description=Z.description;let q=!1;if(Z.paramsSchema!==void 0)X.inputSchema=Z.paramsSchema,delete this._toolInputSchemaJson[$],q=!0;if(Z.callback!==void 0)X.handler=Z.callback,W=Z.callback,q=!0;if(q)X.executor=qe(X.inputSchema,W);if(Z.outputSchema!==void 0)X.outputSchema=Z.outputSchema,X.outputSchemaJson=Le(Z.outputSchema);if(Z.annotations!==void 0)X.annotations=Z.annotations;if(Z.icons!==void 0)X.icons=Z.icons;if(Z._meta!==void 0)X._meta=Z._meta;if(Z.enabled!==void 0)X.enabled=Z.enabled;this.sendToolListChanged()}};return this._registeredTools[$]=X,this.setToolRequestHandlers(),this.sendToolListChanged(),X}registerTool($,Y,U){if(this._registeredTools[$])throw Error(`Tool ${$} is already registered`);let{title:z,description:Q,inputSchema:J,outputSchema:I,annotations:K,icons:G,_meta:H}=Y;return this._createRegisteredTool($,z,Q,Rw(J),Rw(I),K,G,void 0,H,U)}registerPrompt($,Y,U){if(this._registeredPrompts[$])throw Error(`Prompt ${$} is already registered`);let{title:z,description:Q,argsSchema:J,icons:I,_meta:K}=Y,G=this._createRegisteredPrompt($,z,Q,Rw(J),U,I,K);return this.setPromptRequestHandlers(),this.sendPromptListChanged(),G}isConnected(){return this.server.transport!==void 0}async sendLoggingMessage($,Y){return this.server.sendLoggingMessage($,Y)}sendResourceListChanged(){if(this.isConnected())this.server.sendResourceListChanged()}sendToolListChanged(){if(this.isConnected())this.server.sendToolListChanged()}sendPromptListChanged(){if(this.isConnected())this.server.sendPromptListChanged()}},Ve,FH;var FS=m(()=>{_w();xw();Ne=Symbol.for("mcp.completable");Ji0=new Set(["notifications/tools/list_changed","notifications/prompts/list_changed","notifications/resources/list_changed","notifications/resources/updated"]);Zi0=new Set(["tools/call","prompts/get","resources/read"]);Te=class extends $S{_clientCapabilities;_clientVersion;static{qi0=($,Y)=>{if(Y.clientCapabilities!==void 0)$._clientCapabilities=Y.clientCapabilities;if(Y.clientInfo!==void 0)$._clientVersion=Y.clientInfo},Be=($,Y)=>{let U=Y.filter((z)=>!$._supportedProtocolVersions.includes(z));if(U.length>0)$._supportedProtocolVersions=[...$._supportedProtocolVersions,...U];$.setRequestHandler("server/discover",()=>$._ondiscover())},Pe=($)=>$._serverInfo}_capabilities;_instructions;_jsonSchemaValidator;_cacheHints;_requestStateVerify;_inputRequiredServing;_legacyShim;_legacyInputRequiredShim(){return this._legacyShim??=new Xi0({maxRounds:this._inputRequiredServing.maxRounds,roundTimeoutMs:this._inputRequiredServing.roundTimeoutMs,resolvedClientCapabilities:($)=>this._inputRequestCapabilityView($),verifyRequestState:($,Y,U)=>this._verifyRequestState($,Y,U),sendElicitation:($,Y)=>this._sendElicitationLeg($,Y,{validateAcceptedContent:!1}),sendSampling:($,Y)=>this.createMessage($,Y),listRoots:($,Y)=>this.listRoots($,Y)})}oninitialized;constructor($,Y){super(Y);if(this._serverInfo=$,this._capabilities=Y?.capabilities?{...Y.capabilities}:{},this._instructions=Y?.instructions,this._jsonSchemaValidator=Y?.jsonSchemaValidator??new kw,this._requestStateVerify=Y?.requestState?.verify,this._inputRequiredServing=Hi0(Y?.inputRequired),Y?.cacheHints!==void 0){for(let[U,z]of Object.entries(Y.cacheHints))if(z!==void 0)nh(z,`cacheHints['${U}']`);this._cacheHints=Y.cacheHints}if(this.setRequestHandler("initialize",(U)=>this._oninitialize(U)),this.setNotificationHandler("notifications/initialized",()=>this.oninitialized?.()),xh(this._supportedProtocolVersions).length>0)this.setRequestHandler("server/discover",()=>this._ondiscover());if(this._capabilities.logging)this._registerLoggingHandler()}_registerLoggingHandler(){this.setRequestHandler("logging/setLevel",async($,Y)=>{let U=Y.sessionId||Y.http?.req?.headers.get("mcp-session-id")||void 0,{level:z}=$.params,Q=Cw(P7,z);if(Q.success)this._loggingLevels.set(U,Q.data);return{}})}buildContext($,Y){let U=$.http||Y?.request||Y?.closeSSEStream||Y?.closeStandaloneSSEStream;return{...$,mcpReq:{...$.mcpReq,log:(z,Q,J)=>{if(!this._capabilities.logging)return Promise.resolve();let I;if(this._servedModernEra()){if(I=$.mcpReq.envelope?.[M7],I===void 0)return Promise.resolve()}else I=this._loggingLevels.get($.sessionId)??this._loggingLevels.get(void 0);if(I!==void 0&&this.LOG_LEVEL_SEVERITY.get(z)this.elicitInput(z,Q),requestSampling:(z,Q)=>this.createMessage(z,Q)},http:U?{...$.http,req:Y?.request,closeSSE:Y?.closeSSEStream,closeStandaloneSSE:Y?.closeStandaloneSSEStream}:void 0}}_loggingLevels=new Map;LOG_LEVEL_SEVERITY=new Map(P7.options.map(($,Y)=>[$,Y]));isMessageIgnored=($,Y)=>{let U=this._loggingLevels.get(Y);return U?this.LOG_LEVEL_SEVERITY.get($){let I=await Y(Q,J);if(s9(I))throw new J1(n0.InternalError,`Handler for ${$} returned an input-required result, but only tools/call, prompts/get and resources/read support input_required (protocol revision 2026-07-28)`);return I};return async(Q,J)=>{let I=z?await this._invokeInputRequiredCapableHandler($,Y,Q,J):await Y(Q,J);if(s9(I)){if(!z)throw new J1(n0.InternalError,`Handler for ${$} returned an input-required result, but only tools/call, prompts/get and resources/read support input_required (protocol revision 2026-07-28)`);return I}return U===void 0?I:Dw(I,U)}}return async(U,z)=>{let Q=j7(this._negotiatedProtocolVersion),J=Q.validateRequest("tools/call",U);if(!J.ok)throw new J1(J.reason==="not-in-era"?n0.InternalError:n0.InvalidParams,J.reason==="not-in-era"?"No wire schema for tools/call in the resolved era":`Invalid tools/call request: ${J.message}`);let I=await this._invokeInputRequiredCapableHandler("tools/call",Y,U,z);if(s9(I))return I;let K=fh(I),G=Q.validateResult("tools/call",K);if(!G.ok)throw new J1(G.reason==="not-in-era"?n0.InternalError:n0.InvalidParams,G.reason==="not-in-era"?"No wire schema for tools/call in the resolved era":`Invalid tools/call result: ${G.message}`);return G.value}}_servedModernEra(){return this._negotiatedProtocolVersion!==void 0&&SQ(this._negotiatedProtocolVersion)}async _invokeInputRequiredCapableHandler($,Y,U,z){let Q=this._servedModernEra(),J=z.mcpReq.requestState();if(J!==void 0&&typeof J!=="string")throw new J1(n0.InvalidParams,"Invalid or expired requestState",{reason:"invalid_request_state"});let I=z;if(typeof J==="string"){let X=await this._verifyRequestState(J,z,$);if(X!==void 0)I=th(z,X)}let K;try{K=await Y(U,I)}catch(X){if(X instanceof J1&&X.code===n0.UrlElicitationRequired){if(!Q)throw X;throw new J1(n0.InternalError,`URL elicitation cannot be signalled by throwing UrlElicitationRequiredError on protocol revision ${this._negotiatedProtocolVersion}: return inputRequired({ inputRequests: { …: inputRequired.elicitUrl(...) } }) from the handler instead. The urlElicitationRequired error (-32042) of earlier revisions is not available on this revision.`)}throw X}if(!s9(K))return K;if(!Q){if(!this._inputRequiredServing.legacyShim)throw new J1(n0.InternalError,`Handler for ${$} returned an input-required result, but this request is served on protocol revision ${this._negotiatedProtocolVersion??gY}, which has no input_required vocabulary`);return await this._legacyInputRequiredShim().fulfill($,Y,U,I,K)}let G=K.inputRequests,H=G!=null&&Object.keys(G).length>0,W=typeof K.requestState==="string";if(!H&&!W)throw new J1(n0.InternalError,`Handler for ${$} returned an input-required result with neither inputRequests nor requestState (every InputRequiredResult must include at least one of the two)`);if(H){let X=this._inputRequestCapabilityView(z);for(let[Z,q]of Object.entries(G)){let{embedded:V,required:F}=Ae($,Z,q),M=Nw(F,X);if(M!==void 0)throw new Bw({requiredCapabilities:M},`Cannot request input '${Z}' (${V.method}): the request's client capabilities do not declare the required capability`)}}return K}async _verifyRequestState($,Y,U){if(this._requestStateVerify===void 0)return;try{return await this._requestStateVerify($,Y)}catch(z){throw this.onerror?.(Error(`requestState verification rejected ${U}: ${z instanceof Error?z.message:String(z)}`)),new J1(n0.InvalidParams,"Invalid or expired requestState",{reason:"invalid_request_state"})}}_inputRequestCapabilityView($){return this._servedModernEra()?$.mcpReq.envelope?.[o9]:this._clientCapabilities}_assertPushApiInServedEra($){if(this._servedModernEra())throw new V1(A1.MethodNotSupportedByProtocolVersion,`Server-to-client requests are not available on protocol revision ${this._negotiatedProtocolVersion}: '${$}' cannot be sent while serving a request on that revision. Return inputRequired({ ... }) from the handler instead — the client fulfils the embedded requests and retries the original request (multi round-trip requests).`,{method:$,era:"2026-07-28"})}assertCapabilityForMethod($){switch($){case"sampling/createMessage":if(!this._clientCapabilities?.sampling)throw new V1(A1.CapabilityNotSupported,`Client does not support sampling (required for ${$})`);break;case"elicitation/create":if(!this._clientCapabilities?.elicitation)throw new V1(A1.CapabilityNotSupported,`Client does not support elicitation (required for ${$})`);break;case"roots/list":if(!this._clientCapabilities?.roots)throw new V1(A1.CapabilityNotSupported,`Client does not support listing roots (required for ${$})`);break;case"ping":break}}assertNotificationCapability($){switch($){case"notifications/message":if(!this._capabilities.logging)throw new V1(A1.CapabilityNotSupported,`Server does not support logging (required for ${$})`);break;case"notifications/resources/updated":case"notifications/resources/list_changed":if(!this._capabilities.resources)throw new V1(A1.CapabilityNotSupported,`Server does not support notifying about resources (required for ${$})`);break;case"notifications/tools/list_changed":if(!this._capabilities.tools)throw new V1(A1.CapabilityNotSupported,`Server does not support notifying of tool list changes (required for ${$})`);break;case"notifications/prompts/list_changed":if(!this._capabilities.prompts)throw new V1(A1.CapabilityNotSupported,`Server does not support notifying of prompt list changes (required for ${$})`);break;case"notifications/elicitation/complete":if(!this._clientCapabilities?.elicitation?.url)throw new V1(A1.CapabilityNotSupported,`Client does not support URL elicitation (required for ${$})`);break;case"notifications/cancelled":break;case"notifications/progress":break}}assertRequestHandlerCapability($){switch($){case"completion/complete":if(!this._capabilities.completions)throw new V1(A1.CapabilityNotSupported,`Server does not support completions (required for ${$})`);break;case"logging/setLevel":if(!this._capabilities.logging)throw new V1(A1.CapabilityNotSupported,`Server does not support logging (required for ${$})`);break;case"prompts/get":case"prompts/list":if(!this._capabilities.prompts)throw new V1(A1.CapabilityNotSupported,`Server does not support prompts (required for ${$})`);break;case"resources/list":case"resources/templates/list":case"resources/read":if(!this._capabilities.resources)throw new V1(A1.CapabilityNotSupported,`Server does not support resources (required for ${$})`);break;case"tools/call":case"tools/list":if(!this._capabilities.tools)throw new V1(A1.CapabilityNotSupported,`Server does not support tools (required for ${$})`);break;case"ping":case"initialize":break}}async _oninitialize($){let Y=$.params.protocolVersion;this._clientCapabilities=$.params.capabilities,this._clientVersion=$.params.clientInfo;let U=Lt(this._supportedProtocolVersions),z=U.includes(Y)?Y:U[0]??gY;return this._negotiatedProtocolVersion=z,this.transport?.setProtocolVersion?.(z),{protocolVersion:z,capabilities:this.getCapabilities(),serverInfo:this._serverInfo,...this._instructions&&{instructions:this._instructions}}}_ondiscover(){return{supportedVersions:xh(this._supportedProtocolVersions),capabilities:Vi0(this.getCapabilities()),...this._instructions&&{instructions:this._instructions}}}_outboundServerInfo(){return this._serverInfo}getClientCapabilities(){return this._clientCapabilities}getClientVersion(){return this._clientVersion}getNegotiatedProtocolVersion(){return this._negotiatedProtocolVersion}projectCallToolResult($,Y){return this._wireCodec().projectCallToolResult($,Y)}getCapabilities(){return this._capabilities}async ping(){return this._assertPushApiInServedEra("ping"),this.request({method:"ping"})}async createMessage($,Y){if(this._assertPushApiInServedEra("sampling/createMessage"),($.tools||$.toolChoice)&&!this._clientCapabilities?.sampling?.tools)throw new V1(A1.CapabilityNotSupported,"Client does not support sampling tools capability.");if($.messages.length>0){let J=$.messages.at(-1),I=Array.isArray(J.content)?J.content:[J.content],K=I.some((X)=>X.type==="tool_result"),G=$.messages.length>1?$.messages.at(-2):void 0,H=G?Array.isArray(G.content)?G.content:[G.content]:[],W=H.some((X)=>X.type==="tool_use");if(K){if(I.some((X)=>X.type!=="tool_result"))throw new J1(n0.InvalidParams,"The last message must contain only tool_result content if any is present");if(!W)throw new J1(n0.InvalidParams,"tool_result blocks are not matching any tool_use from the previous message")}if(W){let X=new Set(H.filter((q)=>q.type==="tool_use").map((q)=>q.id)),Z=new Set(I.filter((q)=>q.type==="tool_result").map((q)=>q.toolUseId));if(X.size!==Z.size||![...X].every((q)=>Z.has(q)))throw new J1(n0.InvalidParams,"ids of tool_result blocks and tool_use blocks from previous message do not match")}}let U=Boolean($.tools||$.toolChoice),z=await this.request({method:"sampling/createMessage",params:$},Y),Q=this._wireCodec().samplingResultVariant(U,z);if(!Q.ok)throw new V1(A1.InvalidResult,`Invalid sampling/createMessage result: ${Q.reason==="invalid"?Q.message:Q.reason}`);return Q.value}async elicitInput($,Y){switch(this._assertPushApiInServedEra("elicitation/create"),$.mode??"form"){case"url":if(!this._clientCapabilities?.elicitation?.url)throw new V1(A1.CapabilityNotSupported,"Client does not support url elicitation.");break;case"form":if(!this._clientCapabilities?.elicitation?.form)throw new V1(A1.CapabilityNotSupported,"Client does not support form elicitation.");break}return this._sendElicitationLeg($,Y)}async _sendElicitationLeg($,Y,U){let z=$.mode??"form",Q=U?.validateAcceptedContent??!0;switch(z){case"url":{let J=$;return this.request({method:"elicitation/create",params:J},Y)}case"form":{let J=$.mode==="form"?$:{...$,mode:"form"},I=await this.request({method:"elicitation/create",params:J},Y);if(Q&&I.action==="accept"&&I.content&&J.requestedSchema)try{let K=this._jsonSchemaValidator.getValidator(J.requestedSchema)(I.content);if(!K.valid)throw new J1(n0.InvalidParams,`Elicitation response content does not match requested schema: ${K.errorMessage}`)}catch(K){if(K instanceof J1)throw K;throw new J1(n0.InternalError,`Error validating elicitation response: ${K instanceof Error?K.message:String(K)}`)}return I}}}createElicitationCompletionNotifier($,Y){if(!this._clientCapabilities?.elicitation?.url)throw new V1(A1.CapabilityNotSupported,"Client does not support URL elicitation (required for notifications/elicitation/complete)");return()=>this.notification({method:"notifications/elicitation/complete",params:{elicitationId:$}},Y)}async listRoots($,Y){return this._assertPushApiInServedEra("roots/list"),this.request({method:"roots/list",params:$},Y)}async sendLoggingMessage($,Y){if(this._capabilities.logging&&!this.isMessageIgnored($.level,Y))return this.notification({method:"notifications/message",params:$})}async sendResourceUpdated($){return this.notification({method:"notifications/resources/updated",params:$})}async sendResourceListChanged(){return this.notification({method:"notifications/resources/list_changed"})}async sendToolListChanged(){return this.notification({method:"notifications/tools/list_changed"})}async sendPromptListChanged(){return this.notification({method:"notifications/prompts/list_changed"})}};Ve={type:"object",properties:{}};FH={completion:{values:[],hasMore:!1}}});var je=m(()=>{FS();_w();xw()});function Mi0($){let Y=$.params;if($.method==="initialize"&&!rh(Y)){let J=Y!==null&&typeof Y==="object"&&typeof Y.protocolVersion==="string"?Y.protocolVersion:void 0;return{kind:"legacy",reason:"initialize",...J!==void 0&&{requestedVersion:J}}}if(!Pw(Y))return{kind:"legacy",reason:"no-claim"};let U=bY(Y),z=(U===void 0?[]:jw(U))[0];if(z!==void 0)return{kind:"invalid-envelope",issue:z};let Q=Tw(Y);if(Q===void 0||!E7.includes(Q))return{kind:"unsupported-revision",requested:Q??"unknown"};return{kind:"modern",revision:Q,classification:{era:"modern",revision:Q}}}function Ce($,Y={}){let U=Y.legacy??"serve",z=Y.transport??new Fi0,Q={phase:"opening"},J,I=!1,K=()=>I||Q.phase==="closed",G=(j)=>{try{Y.onerror?.(j)}catch{}},H=(j,C,b,x)=>z.send({jsonrpc:"2.0",id:j,error:{code:C,message:b,...x!==void 0&&{data:x}}}).catch((S)=>G(J5(S))),W=new De(Y.maxSubscriptions??fw),X=(j)=>{if(!C7(j))return;let C=W.routeOutbound(j);if(C==="passthrough")return;for(let b of C)z.send({jsonrpc:"2.0",...b}).catch((x)=>G(J5(x)));return"handled"},Z=async(j)=>{if(D$(j)&&j.method==="subscriptions/listen"){let C=bY(j.params),b=Pw(j.params)?(C===void 0?[]:jw(C))[0]:{key:"_meta",problem:"the per-request envelope is required on protocol revision 2026-07-28"},x=Tw(j.params),S;if(b!==void 0)S={jsonrpc:"2.0",id:j.id,error:{code:-32602,message:`Invalid _meta envelope: ${b.key}: ${b.problem}`}};else if(x===void 0||!E7.includes(x)){let i=new gQ({supported:[...E7],requested:x??"unknown"});S={jsonrpc:"2.0",id:j.id,error:{code:i.code,message:i.message,data:i.data}}}else S=W.serve(j);return await z.send("error"in S?S:{jsonrpc:"2.0",method:S.method,params:S.params}).catch((i)=>G(J5(i))),!0}if(C7(j)&&j.method==="notifications/cancelled"){let C=j.params?.requestId;if(C!==void 0&&W.cancel(C))return!0}return!1},q=(j,C,b)=>{let x=sh({kind:"legacy",reason:C,...b!==void 0&&{requestedVersion:b}},E7);if(x===void 0)return Promise.resolve();return G(Error(`Rejected 2025-era request on a modern-only stdio connection (${x.cell}): ${x.message}`)),H(j.id,x.code,x.message,x.data)},V=(j)=>{if(I||j===J)return;T()},F=async(j,C)=>{let b=await $({era:j}),x=b instanceof wH?b.server:b;if(j==="modern")eh(x,C),VS(x,E7),W.setServerCapabilities(x.getCapabilities(),LS(x));let S=new wi0(z,()=>V(S),j==="modern"?X:void 0);return await b.connect(S),{product:b,channel:S}},M=(j)=>j.product.close().catch((C)=>G(J5(C))),w=async(j)=>{J=j.channel;try{if(!await j.channel.whenRequestsAnswered(Ee))G(Error(`Discarded the probe instance with requests still unanswered after ${Ee}ms; continuing with the fallback`));await j.product.close()}catch(C){G(J5(C))}finally{J=void 0}},N=async(j)=>{if(Q.phase==="closed")return;if(Q.phase==="pinned"){if(Q.era==="modern"&&D$(j)&&j.method==="initialize"&&!rh(j.params)){await q(j,"initialize",j.params!==null&&typeof j.params==="object"&&typeof j.params.protocolVersion==="string"?j.params.protocolVersion:void 0);return}if(Q.era==="modern"&&await Z(j))return;Q.instance.channel.deliver(j);return}if(!D$(j)&&!C7(j)){G(Error("Discarded a JSON-RPC response received before the connection negotiated an era"));return}let C=Mi0(j);switch(C.kind){case"invalid-envelope":{let b=`Invalid _meta envelope for protocol revision 2026-07-28: ${C.issue.key}: ${C.issue.problem}`;if(D$(j))await H(j.id,n0.InvalidParams,b,{envelope:C.issue});else G(Error(`Discarded a notification with a malformed envelope: ${b}`));return}case"unsupported-revision":if(D$(j)){let b=new gQ({supported:[...E7],requested:C.requested});G(b),await H(j.id,b.code,b.message,b.data)}else G(Error(`Discarded a notification claiming unsupported protocol revision ${C.requested}`));return;case"modern":if(D$(j)&&j.method==="server/discover"){if(Q.phase==="probe"){Q.instance.channel.deliver(j,{classification:C.classification});return}let b=await F("modern",C.revision);if(K()){await M(b);return}Q={phase:"probe",instance:b},b.channel.deliver(j,{classification:C.classification});return}if(Q.phase==="probe"){if(C7(j)){Q.instance.channel.deliver(j,{classification:C.classification});return}Q={phase:"pinned",era:"modern",instance:Q.instance}}else{let b=await F("modern",C.revision);if(K()){await M(b);return}Q={phase:"pinned",era:"modern",instance:b}}if(await Z(j))return;Q.instance.channel.deliver(j,{classification:C.classification});return;case"legacy":{if(U==="reject"){if(D$(j))await q(j,C.reason,C.requestedVersion);return}if(Q.phase==="probe"){if(await w(Q.instance),K())return;Q={phase:"opening"}}let b=await F("legacy");if(K()){await M(b);return}Q={phase:"pinned",era:"legacy",instance:b},Q.instance.channel.deliver(j);return}}},O=[],D=!1,P=async()=>{if(D)return;D=!0;try{while(O.length>0){let j=O.shift();try{await N(j)}catch(C){if(D$(j))await H(j.id,n0.InternalError,"Internal server error");G(J5(C))}}}finally{D=!1}},T=async()=>{if(I||Q.phase==="closed")return;I=!0;let j=Q;Q={phase:"closed"};for(let C of W.teardownAll())await z.send(C).catch((b)=>G(J5(b)));if(j.phase==="probe"||j.phase==="pinned")await j.instance.product.close().catch((C)=>G(J5(C)));await z.close().catch((C)=>G(J5(C)))};z.onmessage=(j)=>{O.push(j),P()},z.onerror=(j)=>{if(G(j),Q.phase==="probe"||Q.phase==="pinned")Q.instance.channel.onerror?.(j)},z.onclose=()=>{if(I||Q.phase==="closed")return;I=!0;let j=Q;if(Q={phase:"closed"},j.phase==="probe"||j.phase==="pinned")j.instance.product.close().catch((C)=>G(J5(C)))};let A=z.start().catch((j)=>{throw G(J5(j)),j});return A.catch(()=>{}),{close:async()=>{await A.catch(()=>{}),await T()}}}function J5($){return $ instanceof Error?$:Error(String($))}var Fi0=class{_readBuffer;_started=!1;_closed=!1;constructor($=XS.stdin,Y=XS.stdout,U){this._stdin=$,this._stdout=Y,this._readBuffer=new US({maxBufferSize:U?.maxBufferSize})}onclose;onerror;onmessage;_ondata=($)=>{try{this._readBuffer.append($),this.processReadBuffer()}catch(Y){this.onerror?.(Y),this.close().catch(()=>{})}};_onerror=($)=>{this.onerror?.($)};_onstdouterror=($)=>{this.onerror?.($),this.close().catch(()=>{})};async start(){if(this._started)throw Error("StdioServerTransport already started! If using Server class, note that connect() calls start() automatically.");this._started=!0,this._stdin.on("data",this._ondata),this._stdin.on("error",this._onerror),this._stdout.on("error",this._onstdouterror)}processReadBuffer(){while(!0)try{let $=this._readBuffer.readMessage();if($===null)break;this.onmessage?.($)}catch($){this.onerror?.($)}}async close(){if(this._closed)return;if(this._closed=!0,this._stdin.off("data",this._ondata),this._stdin.off("error",this._onerror),this._stdout.off("error",this._onstdouterror),this._stdin.listenerCount("data")===0)this._stdin.pause();this._readBuffer.clear(),this.onclose?.()}send($){if(this._closed)return Promise.reject(Error("StdioServerTransport is closed"));return new Promise((Y,U)=>{let z=zS($),Q=!1,J=(K)=>{if(Q)return;Q=!0,this._stdout.off("error",J),this._stdout.off("drain",I),U(K)},I=()=>{if(Q)return;Q=!0,this._stdout.off("error",J),this._stdout.off("drain",I),Y()};if(this._stdout.once("error",J),this._stdout.write(z)){if(Q)return;Q=!0,this._stdout.off("error",J),Y()}else if(!Q)this._stdout.once("drain",I)})}},Ee=3000,wi0=class{onclose;onerror;onmessage;_closed=!1;_pendingRequests=new Set;_drainWaiters=[];constructor($,Y,U){this._wire=$,this._onInstanceClose=Y,this._outboundIntercept=U}async start(){}async send($,Y){if(XH($)||Ew($)){let{id:U}=$;if(U!==void 0)this._settle(U)}if(this._closed)return;if(this._outboundIntercept?.($)==="handled")return;return this._wire.send($,Y)}setProtocolVersion=($)=>{this._wire.setProtocolVersion?.($)};deliver($,Y){if(this._closed)return;if(D$($))this._pendingRequests.add($.id);else if(C7($)&&$.method==="notifications/cancelled"){let U=$.params?.requestId;if(U!==void 0)this._settle(U)}this.onmessage?.($,Y)}async whenRequestsAnswered($){if(this._closed||this._pendingRequests.size===0)return!0;return await new Promise((Y)=>{let U=()=>{clearTimeout(z),Y(!0)},z=setTimeout(()=>{this._drainWaiters=this._drainWaiters.filter((Q)=>Q!==U),Y(!1)},$);this._drainWaiters.push(U)})}async close(){if(this._closed)return;this._closed=!0,this._pendingRequests.clear(),this._releaseDrainWaiters();try{this._onInstanceClose()}finally{this.onclose?.()}}_settle($){if(this._pendingRequests.delete($),this._pendingRequests.size===0)this._releaseDrainWaiters()}_releaseDrainWaiters(){let $=this._drainWaiters;this._drainWaiters=[];for(let Y of $)Y()}};var Re=m(()=>{FS();_w();xw()});var A$=m(()=>{PL();PL()});var a9;var MH=m(()=>{a9=class a9 extends Error{name="KyError";get isKyError(){return!0}}});var D6;var uw=m(()=>{MH();D6=class D6 extends a9{name="HTTPError";response;request;options;data;constructor($,Y,U){let z=$.status||$.status===0?$.status:"",Q=$.statusText??"",J=`${z} ${Q}`.trim(),I=J?`status code ${J}`:"an unknown error";super(`Request failed with ${I}: ${Y.method} ${Y.url}`);this.response=$,this.request=Y,this.options=U}}});var OH;var wS=m(()=>{MH();OH=class OH extends a9{name="NetworkError";request;constructor($,Y){super(`Request failed due to a network error: ${$.method} ${$.url}`,Y);this.request=$}}});var NH;var MS=m(()=>{NH=class NH extends Error{name="NonError";value;constructor($){let Y="Non-error value was thrown";try{if(typeof $==="string")Y=$;else if($&&typeof $==="object"&&"message"in $&&typeof $.message==="string")Y=$.message}catch{}super(Y);this.value=$}}});var xQ;var _e=m(()=>{MH();MS();xQ=class xQ extends a9{name="ForceRetryError";customDelay;code;customRequest;constructor($){let Y=$?.cause?$.cause instanceof Error?$.cause:new NH($.cause):void 0;super($?.code?`Forced retry: ${$.code}`:"Forced retry",Y?{cause:Y}:void 0);this.customDelay=$?.delay,this.code=$?.code,this.customRequest=$?.request}}});var OS;var ve=m(()=>{OS=class OS extends Error{name="SchemaValidationError";issues;constructor($){super("Response schema validation failed");this.issues=$}}});var I5;var bw=m(()=>{MH();I5=class I5 extends a9{name="TimeoutError";request;constructor($){super(`Request timed out: ${$.method} ${$.url}`);this.request=$}}});class pw{options;constructor($){this.options=$}}var NS,he,iw,Se,ge,cw,Oi0=()=>{return},ye,fQ=2147483647,ke=40,nw,xe=($)=>new pw($),fe,ue;var iY=m(()=>{NS=(()=>{let $=!1,Y=!1,U=typeof globalThis.ReadableStream==="function",z=typeof globalThis.Request==="function";if(U&&z)try{Y=new globalThis.Request("https://empty.invalid",{body:new globalThis.ReadableStream,method:"POST",get duplex(){return $=!0,"half"}}).headers.has("Content-Type")}catch(Q){if(Q instanceof Error&&Q.message==="unsupported BodyInit type")return!1;throw Q}return $&&!Y})(),he=typeof globalThis.AbortController==="function",iw=typeof globalThis.AbortSignal==="function"&&typeof globalThis.AbortSignal.any==="function",Se=typeof globalThis.ReadableStream==="function",ge=typeof globalThis.FormData==="function",cw=["get","post","put","patch","head","delete"];Oi0();ye={json:"application/json",text:"text/*",formData:"multipart/form-data",arrayBuffer:"*/*",blob:"*/*",bytes:"*/*"},nw=Symbol("stop");fe={json:!0,parseJson:!0,stringifyJson:!0,searchParams:!0,baseUrl:!0,prefix:!0,retry:!0,timeout:!0,totalTimeout:!0,hooks:!0,throwHttpErrors:!0,onDownloadProgress:!0,onUploadProgress:!0,fetch:!0,context:!0},ue={method:!0,headers:!0,body:!0,mode:!0,credentials:!0,cache:!0,redirect:!0,referrer:!0,referrerPolicy:!0,integrity:!0,keepalive:!0,signal:!0,window:!0,duplex:!0}});var dw,Ni0=($)=>{if(!$)return 0;if($ instanceof FormData){let Y=0;for(let[U,z]of $)Y+=ke,Y+=dw.encode(`Content-Disposition: form-data; name="${U}"`).byteLength,Y+=typeof z==="string"?dw.encode(z).byteLength:z.size;return Y}if($ instanceof Blob)return $.size;if($ instanceof ArrayBuffer||ArrayBuffer.isView($))return $.byteLength;if(typeof $==="string")return dw.encode($).byteLength;if($ instanceof URLSearchParams)return dw.encode($.toString()).byteLength;return 0},be=($,Y,U)=>{let z,Q=0;return $.pipeThrough(new TransformStream({transform(J,I){if(I.enqueue(J),z){Q+=z.byteLength;let K=Y===0?0:Q/Y;if(K>=1)K=1-Number.EPSILON;U?.({percent:K,totalBytes:Math.max(Y,Q),transferredBytes:Q},z)}z=J},flush(){if(z)Q+=z.byteLength,U?.({percent:1,totalBytes:Math.max(Y,Q),transferredBytes:Q},z)}}))},ie=($,Y)=>{if(!$.body)return $;let U={status:$.status,statusText:$.statusText,headers:$.headers};if($.status===204)return new Response(null,U);let z=Math.max(0,Number($.headers.get("content-length"))||0);return new Response(be($.body,z,Y),U)},ce=($,Y,U)=>{if(!$.body)return $;let z=Ni0(U??$.body);return new Request($,{duplex:"half",body:be($.body,z,Y)})};var ne=m(()=>{iY();dw=new TextEncoder});var m5=($)=>$!==null&&typeof $==="object";function DH($,Y,U){return Object.hasOwn(Y,U)&&Y[U]===void 0?[]:PS($[U]??[],Y[U]??[])}var Di0,DS=($)=>m5($)&&$[Di0]===!0?{isReplace:!0,value:$.value}:{isReplace:!1,value:$},AH=(...$)=>{for(let Y of $)if((!m5(Y)||Array.isArray(Y))&&Y!==void 0)throw TypeError("The `options` argument must be an object");return PS({},...$)},BS=($={},Y={})=>{let U=new globalThis.Headers($),z=Y instanceof globalThis.Headers,Q=new globalThis.Headers(Y);for(let[J,I]of Q.entries())if(z&&I==="undefined"||I===void 0)U.delete(J);else U.set(J,I);return U},AS=($)=>{if(!m5($)||Array.isArray($))return!1;let Y=Object.getPrototypeOf($);return Y===Object.prototype||Y===null},uQ=($)=>{if($ instanceof URLSearchParams){let Y=new URLSearchParams($),U=$[_7];if(U)Y[_7]=new Set(U);return Y}if($ instanceof globalThis.Headers)return new globalThis.Headers($);if(Array.isArray($))return[...$];if(AS($))return{...$};return $},Ai0=($)=>Object.fromEntries(Object.entries($).filter((Y)=>Y[1]!==void 0)),Bi0=($,Y)=>{if(AS($)&&AS(Y))return Ai0({...$,...Y});return BS($,Y)},mw=($={},Y={})=>({init:DH($,Y,"init"),beforeRequest:DH($,Y,"beforeRequest"),beforeRetry:DH($,Y,"beforeRetry"),beforeError:DH($,Y,"beforeError"),afterResponse:DH($,Y,"afterResponse")}),_7,Pi0=($,Y)=>{let U=new URLSearchParams,z=new Set;for(let Q of[$,Y]){if(Q===void 0)continue;if(Q instanceof URLSearchParams){for(let[I,K]of Q.entries())U.append(I,K),z.delete(I);let J=Q[_7];if(J)for(let I of J)U.delete(I),z.add(I)}else if(Array.isArray(Q))for(let J of Q){if(!Array.isArray(J)||J.length!==2)throw TypeError("Array search parameters must be provided in [[key, value], ...] format");U.append(String(J[0]),String(J[1])),z.delete(String(J[0]))}else if(m5(Q))for(let[J,I]of Object.entries(Q))if(I===void 0)U.delete(J),z.add(J);else U.append(J,String(I)),z.delete(J);else{let J=new URLSearchParams(Q);for(let[I,K]of J.entries())U.append(I,K),z.delete(I)}}if(z.size>0)U[_7]=z;return U},PS=(...$)=>{let Y={},U={},z={},Q,J=[];for(let I of $)if(Array.isArray(I)){if(!Array.isArray(Y))Y=[];Y=[...Y,...I]}else if(m5(I)){for(let[K,G]of Object.entries(I)){if(K==="signal"&&G instanceof globalThis.AbortSignal){J.push(G);continue}let H=DS(G),{isReplace:W}=H;if(G=H.value,K==="context"){if(G!==void 0&&G!==null&&(!m5(G)||Array.isArray(G)))throw TypeError("The `context` option must be an object");Y={...Y,context:G===void 0||G===null?{}:W?{...G}:{...Y.context,...G}};continue}if(K==="searchParams"){if(G===void 0||G===null)Q=void 0;else if(W)Q=G;else Q=Q===void 0?G:Pi0(Q,G);continue}if(m5(G)&&!W&&K in Y)G=PS(Y[K],G);Y={...Y,[K]:G}}if(m5(I.hooks)){let{value:K,isReplace:G}=DS(I.hooks);z=G?mw({},K):mw(z,K),Y.hooks=z}if(m5(I.headers)){let{value:K,isReplace:G}=DS(I.headers);U=G?uQ(K):Bi0(U,K),Y.headers=U}}if(Q!==void 0)Y.searchParams=Q;if(J.length>0)if(J.length===1)Y.signal=J[0];else if(iw)Y.signal=AbortSignal.any(J);else Y.signal=J.at(-1);return Y};var lw=m(()=>{iY();Di0=Symbol("replaceOption");_7=Symbol("deletedParameters")});var de=($)=>cw.includes($)?$.toUpperCase():$,Ti0,ji0,Ei0,pe,me=($={})=>{if(typeof $==="number")return{...pe,limit:$};if($.methods&&!Array.isArray($.methods))throw Error("retry.methods must be an array");if($.statusCodes&&!Array.isArray($.statusCodes))throw Error("retry.statusCodes must be an array");let Y=Object.fromEntries(Object.entries({...$,methods:$.methods?.map((U)=>U.toLowerCase())}).filter(([,U])=>U!==void 0));return{...pe,...Y}};var le=m(()=>{iY();Ti0=["get","put","head","delete","options","trace"],ji0=[408,413,429,500,502,503,504],Ei0=[413,429,503],pe={limit:2,methods:Ti0,statusCodes:ji0,afterStatusCodes:Ei0,maxRetryAfter:Number.POSITIVE_INFINITY,backoffLimit:Number.POSITIVE_INFINITY,delay:($)=>0.3*2**($-1)*1000,jitter:void 0,retryOnTimeout:!1}});async function TS($,Y,U,z){return new Promise((Q,J)=>{let I=setTimeout(()=>{if(U)U.abort();J(new I5($))},z.timeout);z.fetch($,Y).then(Q).catch(J).then(()=>{clearTimeout(I)})})}var oe=m(()=>{bw()});async function ow($,{signal:Y}){return new Promise((U,z)=>{if(Y)Y.throwIfAborted(),Y.addEventListener("abort",Q,{once:!0});function Q(){clearTimeout(J),z(Y.reason)}let J=setTimeout(()=>{Y?.removeEventListener("abort",Q),U()},$)})}var re=($)=>{let Y={};for(let U in $){if(!Object.hasOwn($,U))continue;if(!(U in ue)&&!(U in fe))Y[U]=$[U]}return Y},se=($)=>{if($===void 0)return!1;if(Array.isArray($))return $.length>0;if($ instanceof URLSearchParams)return $.size>0||Boolean($[_7]?.size);if(typeof $==="object")return Object.keys($).length>0;if(typeof $==="string")return $.trim().length>0;return Boolean($)};var ae=m(()=>{iY();lw()});function jS($){if(!($&&Ri0($)&&$.name==="TypeError"&&typeof $.message==="string"))return!1;let{message:U,stack:z}=$;if(U==="Load failed")return z===void 0||"__sentry_captured__"in $;if(U.startsWith("error sending request for url"))return!0;if(U==="Failed to fetch"||U.startsWith("Failed to fetch (")&&U.endsWith(")"))return!0;return _i0.has(U)}var Ci0,Ri0=($)=>Ci0.call($)==="[object Error]",_i0;var te=m(()=>{Ci0=Object.prototype.toString,_i0=new Set(["network error","NetworkError when attempting to fetch resource.","The Internet connection appears to be offline.","Network request failed","fetch failed","terminated"," A network error occurred.","Network connection lost"])});function ee($){return ES($,D6)}function $00($){return ES($,OH)}function Y00($){return ES($,I5)}var ES=($,Y)=>$ instanceof Y||$?.name===Y.name;var U00=m(()=>{uw();wS();bw()});function ki0($){let Y={...$,json:uQ($.json),context:uQ($.context),headers:uQ($.headers),searchParams:yi0($.searchParams)};if($.retry!==void 0)Y.retry=gi0($.retry);return Y}class bQ{static create($,Y){let U=Y.hooks?.init??[],z=U.length>0?ki0(Y):Y;for(let K of U)K(z);let Q=new bQ($,z),J=async()=>{if(typeof Q.#$.timeout==="number"&&Q.#$.timeout>fQ)throw RangeError(`The \`timeout\` option cannot be greater than ${fQ}`);if(typeof Q.#$.totalTimeout==="number"&&Q.#$.totalTimeout>fQ)throw RangeError(`The \`totalTimeout\` option cannot be greater than ${fQ}`);await Promise.resolve();let K=await Q.#g(),G=K??await Q.#h(async()=>Q.#R()),H=K!==void 0||Q.#C();for(;;){if(G===void 0)return G;if(PH(G))try{G=await Q.#y(G)}catch(X){if(!(X instanceof xQ))throw X;let Z=await Q.#E(X,async()=>Q.#R());if(Z===void 0)return Z;G=Z,H=Q.#C();continue}let W=G;if(!W.ok&&W.type!=="opaque"&&(typeof Q.#$.throwHttpErrors==="function"?Q.#$.throwHttpErrors(W.status):Q.#$.throwHttpErrors)){let X=new D6(W,Q.#O(W),Q.#M()),Z=X;if(X.data=await Q.#L(W),H)throw Z;let q=await Q.#E(X,async()=>Q.#R());if(q===void 0)return q;G=q,H=Q.#C();continue}break}if(!PH(G))return G;if(Q.#V(G),Q.#$.onDownloadProgress){if(typeof Q.#$.onDownloadProgress!=="function")throw TypeError("The `onDownloadProgress` option must be a function");if(!Se)throw Error("Streams are not supported in your environment. `ReadableStream` is missing.");let W=G.clone();return Q.#K(G),ie(W,Q.#$.onDownloadProgress)}return G},I=(async()=>{try{return await J()}catch(K){if(!(K instanceof Error))throw K;if(Q.#X.has(K))throw K;let G=K;for(let H of Q.#$.hooks.beforeError){let W=await H({request:Q.request,options:Q.#M(),error:G,retryCount:Q.#Q});if(W instanceof Error)G=W}throw G}finally{let K=Q.#W;if(Q.#F(K?.body??void 0),Q.request!==K)Q.#F(Q.request.body??void 0)}})();for(let[K,G]of Object.entries(ye)){if(K==="bytes"&&typeof globalThis.Response?.prototype?.bytes!=="function")continue;I[K]=async(H)=>{Q.request.headers.set("accept",Q.request.headers.get("accept")||G);let W=await I;if(K!=="json")return W[K]();let X=await W.text();if(X===""){if(H!==void 0)return J00(void 0,H);return JSON.parse(X)}let Z=z.parseJson?await z.parseJson(X,{request:Q.#O(W),response:W}):JSON.parse(X);return H===void 0?Z:J00(Z,H)}}return I}static#z($){if($&&typeof $==="object"&&!Array.isArray($)&&!($ instanceof URLSearchParams))return Object.fromEntries(Object.entries($).filter(([,Y])=>Y!==void 0));return $}request;#U;#Q=0;#Y;#$;#W;#H;#X=new WeakSet;#J;#I;#Z=!1;#N=new WeakMap;constructor($,Y={}){if(this.#Y=$,Object.hasOwn(Y,"prefixUrl"))throw Error(hi0);if(this.#$={...Y,headers:BS(this.#Y.headers,Y.headers),hooks:mw({},Y.hooks),method:de(Y.method??this.#Y.method??"GET"),prefix:String(Y.prefix||""),retry:me(Y.retry),throwHttpErrors:Y.throwHttpErrors??!0,timeout:Y.timeout??1e4,totalTimeout:Y.totalTimeout??!1,fetch:Y.fetch??globalThis.fetch.bind(globalThis),context:Y.context??{}},typeof this.#Y!=="string"&&!(this.#Y instanceof URL||this.#Y instanceof globalThis.Request))throw TypeError("`input` must be a string, URL, or Request");if(typeof this.#Y==="string"){if(this.#$.prefix){let z=this.#$.prefix.replace(/\/+$/,""),Q=this.#Y.replace(/^\/+/,"");this.#Y=`${z}/${Q}`}if(this.#$.baseUrl){let z;try{z=new URL(this.#Y)}catch{}if(!z)this.#Y=new URL(this.#Y,new Request(this.#$.baseUrl).url)}}if(he&&iw)this.#H=this.#$.signal??this.#Y.signal,this.#U=new globalThis.AbortController,this.#$.signal=this.#w();if(NS)this.#$.duplex="half";if(this.#$.json!==void 0)this.#$.body=this.#$.stringifyJson?.(this.#$.json)??JSON.stringify(this.#$.json),this.#$.headers.set("content-type",this.#$.headers.get("content-type")??"application/json");let U=Y.headers&&new globalThis.Headers(Y.headers).has("content-type");if(this.#Y instanceof globalThis.Request&&(ge&&this.#$.body instanceof globalThis.FormData||this.#$.body instanceof URLSearchParams)&&!U)this.#$.headers.delete("content-type");if(this.request=new globalThis.Request(this.#Y,this.#$),se(this.#$.searchParams)){let z=new URL(this.request.url),Q=this.#$.searchParams?.[_7];if(Q)for(let J of Q)z.searchParams.delete(J);if(typeof this.#$.searchParams==="string"){let J=this.#$.searchParams.replace(/^\?/,"");if(J!=="")z.search=z.search?`${z.search}&${J}`:`?${J}`}else{let J=new URLSearchParams(bQ.#z(this.#$.searchParams));for(let[I,K]of J.entries())z.searchParams.append(I,K)}if(this.#$.searchParams&&typeof this.#$.searchParams==="object"&&!Array.isArray(this.#$.searchParams)&&!(this.#$.searchParams instanceof URLSearchParams)){for(let[J,I]of Object.entries(this.#$.searchParams))if(I===void 0)z.searchParams.delete(J)}this.request=new globalThis.Request(z,this.#$)}if(this.#$.onUploadProgress&&typeof this.#$.onUploadProgress!=="function")throw TypeError("The `onUploadProgress` option must be a function");this.#I=typeof this.#$.totalTimeout==="number"?this.#S():void 0}#G(){let $=this.#$.retry.delay(this.#Q+1),Y=$;if(this.#$.retry.jitter===!0)Y=Math.random()*$;else if(typeof this.#$.retry.jitter==="function"){if(Y=this.#$.retry.jitter($),!Number.isFinite(Y)||Y<0)Y=$}return Math.min(this.#$.retry.backoffLimit,Y)}async#P($){if(this.#Q>=this.#$.retry.limit)throw $;let Y=$ instanceof Error?$:new NH($);if(Y instanceof xQ)return Y.customDelay??this.#G();if(!this.#$.retry.methods.includes(this.request.method.toLowerCase()))throw $;if(this.#$.retry.shouldRetry!==void 0){let U=await this.#$.retry.shouldRetry({error:Y,retryCount:this.#Q+1});if(U===!1)throw $;if(U===!0)return this.#G()}if(Y00($)){if(!this.#$.retry.retryOnTimeout)throw $;return this.#G()}if(ee($)){if(!this.#$.retry.statusCodes.includes($.response.status))throw $;let U=$.response.headers.get("Retry-After")??$.response.headers.get("RateLimit-Reset")??$.response.headers.get("X-RateLimit-Retry-After")??$.response.headers.get("X-RateLimit-Reset")??$.response.headers.get("X-Rate-Limit-Reset");if(U&&this.#$.retry.afterStatusCodes.includes($.response.status)){let z=Number(U)*1000;if(Number.isNaN(z))z=Date.parse(U)-Date.now();else if(z>=Date.parse("2024-01-01"))z-=Date.now();if(!Number.isFinite(z))return Math.min(this.#$.retry.maxRetryAfter,this.#G());return z=Math.max(0,z),Math.min(this.#$.retry.maxRetryAfter,z)}if($.response.status===413)throw $;return this.#G()}if(!$00($))throw $;return this.#G()}#V($){let Y=this.#O($);if(this.#$.parseJson)$.json=async()=>{let U=await $.text();if(U==="")return JSON.parse(U);return this.#$.parseJson(U,{request:Y,response:$})};return $}async#L($){let Y=await this.#T($,this.#D());if(Y===BH){this.#q();return}if(!Y)return;if(!this.#A($.headers.get("content-type")??""))return Y;let U=await this.#j(Y,$,this.#D(),this.#O($));if(U===BH){this.#q();return}return U}#D(){let $=this.#$.timeout===!1?1e4:this.#$.timeout,Y=this.#B();if(Y===void 0)return $;if(Y<=0)throw new I5(this.request);return Math.min($,Y)}#A($){let Y=($.split(";",1)[0]??"").trim().toLowerCase();return/\/(?:.*[.+-])?json$/.test(Y)}async#T($,Y){let{body:U}=$;if(!U)try{return await $.text()}catch{return}let z;try{z=U.getReader()}catch{return}let Q=Si0($.headers.get("content-type")??""),J=[],I=0,K=(async()=>{try{for(;;){let{done:W,value:X}=await z.read();if(W)break;if(I+=X.byteLength,I>vi0){z.cancel().catch(()=>{return});return}J.push(Q.decode(X,{stream:!0}))}}catch{return}return J.push(Q.decode()),J.join("")})(),G=new Promise((W)=>{let X=setTimeout(()=>{W(BH)},Y);K.finally(()=>{clearTimeout(X)})}),H=await Promise.race([K,G]);if(H===BH)z.cancel().catch(()=>{return});return H}async#j($,Y,U,z){let Q;try{return await Promise.race([Promise.resolve().then(()=>this.#$.parseJson?this.#$.parseJson($,{request:z,response:Y}):JSON.parse($)),new Promise((J)=>{Q=setTimeout(()=>{J(BH)},U)})])}catch{return}finally{clearTimeout(Q)}}#F($){if(!$)return;$.cancel().catch(()=>{return})}#K($){this.#F($.body??void 0)}#w(){return this.#H?AbortSignal.any([this.#H,this.#U.signal]):this.#U.signal}#q(){let $=this.#B();if($!==void 0&&$<=0)throw new I5(this.request)}async#g(){for(let $ of this.#$.hooks.beforeRequest){let Y=await $({request:this.request,options:this.#M(),retryCount:0});if(Q00(Y))this.#_(Y);else if(PH(Y))return Y}return}async#y($){let Y=this.#O($);for(let U of this.#$.hooks.afterResponse){let z=this.#v($.clone(),Y);this.#V(z);let Q;try{Q=await U({request:this.request,options:this.#M(),response:z,retryCount:this.#Q})}catch(I){if(z!==$)this.#K(z);throw this.#K($),I}if(Q instanceof pw){if(z!==$)this.#K(z);throw this.#K($),new xQ(Q.options)}let J=PH(Q)?this.#v(Q,Y):$;if(z!==$&&z!==J&&z.body!==J.body)this.#K(z);if($!==J&&$.body!==J.body)this.#K($);$=J}return $}async#h($){try{return await $()}catch(Y){return this.#E(Y,$)}}async#E($,Y){this.#Z=!1;let U=Math.min(await this.#P($),fQ),z={signal:this.#H},Q=this.#B();if(Q!==void 0){if(Q<=0)throw new I5(this.request);if(U>=Q)throw await ow(Q,z),new I5(this.request)}if(await ow(U,z),this.#q(),$ instanceof xQ&&$.customRequest){let J=new globalThis.Request($.customRequest,this.#$.signal?{signal:this.#$.signal}:void 0);this.#_(J)}for(let J of this.#$.hooks.beforeRetry){let I;try{I=await J({request:this.request,options:this.#M(),error:$,retryCount:this.#Q+1})}catch(K){if(K instanceof Error&&K!==$)this.#X.add(K);throw K}if(Q00(I)){this.#_(I);break}if(PH(I))return this.#Z=!0,this.#Q++,I;if(I===nw)return}return this.#q(),this.#Q++,this.#h(Y)}#C(){let $=this.#Z;return this.#Z=!1,$}async#R(){if(this.#U?.signal.aborted)this.#U=new globalThis.AbortController,this.#$.signal=this.#w(),this.request=new globalThis.Request(this.request,{signal:this.#$.signal});let $=re(this.#$),Y=this.#$.retry.limit>0?this.request.clone():void 0,U=this.#k(this.request,this.#$.body??void 0);if(this.#W=U,Y)this.request=Y;try{let z=this.#B();if(z!==void 0&&z<=0)throw new I5(this.request);let Q=this.#$.timeout===!1?z:z===void 0?this.#$.timeout:Math.min(this.#$.timeout,z),J=Q===void 0?await this.#$.fetch(U,$):await TS(U,$,this.#U,{timeout:Q,fetch:this.#$.fetch});return this.#v(J,U)}catch(z){if(jS(z))throw new OH(this.request,{cause:z});throw z}}#B(){if(this.#I===void 0)return;let $=this.#S()-this.#I;return Math.max(0,this.#$.totalTimeout-$)}#S(){return globalThis.performance?.now()??Date.now()}#M(){if(!this.#J){let{hooks:$,json:Y,parseJson:U,stringifyJson:z,searchParams:Q,timeout:J,totalTimeout:I,throwHttpErrors:K,fetch:G,...H}=this.#$;this.#J=Object.freeze(H)}return this.#J}#_($){this.#J=void 0,this.request=$}#O($){return this.#N.get($)??this.request}#v($,Y){return this.#N.set($,Y),$}#k($,Y){if(!this.#$.onUploadProgress||!$.body||!NS)return $;return ce($,this.#$.onUploadProgress,Y??this.#$.body??void 0)}}var vi0=10485760,hi0="The `prefixUrl` option has been renamed `prefix` in v2 and enhanced to allow slashes in input. See also the new `baseUrl` option for improved flexibility with standard URL resolution: https://github.com/sindresorhus/ky#baseurl",BH,Si0=($)=>{let Y=/;\s*charset\s*=\s*(?:"([^"]+)"|([^;,\s]+))/i.exec($),U=Y?.[1]??Y?.[2];if(U)try{return new TextDecoder(U)}catch{}return new TextDecoder},z00="The `schema` argument must follow the Standard Schema specification",gi0=($)=>{if(typeof $!=="object")return $;return{...$,...$.methods&&{methods:[...$.methods]},...$.statusCodes&&{statusCodes:[...$.statusCodes]},...$.afterStatusCodes&&{afterStatusCodes:[...$.afterStatusCodes]}}},I00,Q00=($)=>$ instanceof globalThis.Request||I00.call($)==="[object Request]",PH=($)=>$ instanceof globalThis.Response||I00.call($)==="[object Response]",yi0=($)=>{if(Array.isArray($))return $.map((Y)=>[...Y]);return uQ($)},J00=async($,Y)=>{if(typeof Y!=="object"&&typeof Y!=="function"||Y===null)throw TypeError(z00);let U=Y["~standard"];if(typeof U!=="object"||U===null||typeof U.validate!=="function")throw TypeError(z00);let z=await U.validate($);if(z.issues)throw new OS(z.issues);return z.value};var K00=m(()=>{uw();wS();MS();_e();ve();bw();ne();lw();le();oe();ae();te();U00();iY();BH=Symbol("timedOutResponseData"),I00=Object.prototype.toString});var CS=($)=>{let Y=(U,z)=>bQ.create(U,AH($,z));for(let U of cw)Y[U]=(z,Q)=>bQ.create(z,AH($,Q,{method:U}));return Y.create=(U)=>CS(AH(U)),Y.extend=(U)=>{if(typeof U==="function")U=U($??{});return CS(AH($,U))},Y.stop=nw,Y.retry=xe,Y},xi0,K5;var iQ=m(()=>{K00();iY();lw();uw();/*! MIT License © Sindre Sorhus */xi0=CS(),K5=xi0});async function G00($){if($.source.type!=="direct"&&$.source.type!=="seal")throw Error(`Unsupported Seal source: ${$.source.type}`);let Y=$.seal.url??$.source.sealUrl,U=$.source.type==="seal"?$.source:void 0;return{token:$.source.token,expiresAt:Date.now()+$.source.expiresIn*1000,enterprise:{provider:U?"seal":"direct",corpId:$.source.corpId??$.id,staffId:$.source.staffId,sealUrl:Y,tenantId:U?.tenantId,tenantSlug:$.seal.tenantSlug??U?.tenantSlug,tenantName:U?.tenantName,raw:{sourceType:$.source.type}}}}function fi0($){let Y=Object.entries($??{}).map(([U,z])=>`${U}=${z}`);return Y.length?Y.join("; "):void 0}function A6($){let Y={...$?.headers??{}},U=fi0($?.cookies);if(U)Y.Cookie=U;return Y}var H00,ui0,bi0,ii0,ci0,W00;var X00=m(()=>{A$();H00=L.object({token:L.string(),expiresAt:L.number(),url:L.string().url().optional()}),ui0=L.object({provider:L.string(),corpId:L.string().optional(),staffId:L.string(),sealUrl:L.string().url(),tenantId:L.string().optional(),tenantSlug:L.string().optional(),tenantName:L.string().optional(),raw:L.unknown().optional()}),bi0=L.object({token:L.string(),expiresAt:L.number(),enterprise:ui0}),ii0=L.object({openapi:H00.optional(),closeapi:H00.optional()}),ci0=L.object({seal:bi0.optional(),hose:ii0.optional()}),W00=L.record(L.string(),ci0)});import{existsSync as RS,mkdirSync as ni0,readFileSync as pi0,writeFileSync as di0}from"node:fs";import{dirname as mi0,join as q00}from"node:path";import{homedir as V00}from"node:os";function li0(){let $=(process.env.SEAL_USE_TOKEN_STORE??process.env.SEAL_HOME_TOKEN_STORE)?.trim();if($)return $;if(RS(rw))return rw;if(RS(Z00))return Z00;return rw}function oi0(){let $=(process.env.SEAL_USE_TOKEN_STORE??process.env.SEAL_HOME_TOKEN_STORE)?.trim();if($)return $;return rw}function cQ(){let $=li0();if(!RS($))return{};try{return W00.parse(JSON.parse(pi0($,"utf-8")))}catch{return{}}}function sw($){let Y=oi0();ni0(mi0(Y),{recursive:!0,mode:448}),di0(Y,JSON.stringify($,null,2),{mode:384})}function L00($){return cQ()[$]?.seal}function F00($,Y){let U=cQ();sw({...U,[$]:{...U[$],seal:Y}})}function w00($){let Y=cQ(),U=Y[$];if(!U)return;sw({...Y,[$]:{...U,seal:void 0}})}function TH($){return cQ()[$]?.hose??{}}function _S($,Y){let U=cQ();sw({...U,[$]:{...U[$],hose:Y}})}function aw($){let Y=cQ();delete Y[$],sw(Y)}var rw,Z00;var jH=m(()=>{X00();rw=q00(V00(),".config","seal-use","seal_tokens.json"),Z00=q00(V00(),".config","seal-home","seal_tokens.json")});function B$($){return $.replace(/\/+$/,"")}function N00($){let Y;try{Y=new URL($.trim())}catch{throw Error("Invalid Hose assistance link: expected a valid HTTPS URL")}if(Y.protocol!=="https:"||Y.port||!ti0(Y.hostname)||Y.pathname.replace(/\/+$/,"")!==ai0)throw Error("Invalid Hose assistance link: expected an HTTPS */web/thirdparty.html URL from ekuaibao.com or hosecloud.com");let U=Y.searchParams.getAll("accessToken").filter(Boolean),z=Y.searchParams.getAll("ekbCorpId").filter(Boolean);if(U.length!==1||z.length!==1)throw Error("Invalid Hose assistance link: accessToken and ekbCorpId are required exactly once");let Q=z[0].trim().toLowerCase();if(!O00.test(Q))throw Error("Invalid Hose assistance link: ekbCorpId is not a valid tenant slug");return{corpId:Q,accessToken:U[0],baseUrl:Y.origin}}async function tw($,Y){let U=typeof $==="string"?N00($):D00($),z=`https://${U.corpId}.sealai.cc`,J=await T8(z,void 0,Y?.customHeaders).get("api/auth/oauth2/session/oem-hosecloud",{searchParams:{token:U.accessToken,returnToken:"1"}}).json(),I=J.token??J.accessToken??J.data?.token??J.data?.accessToken;if(!I)throw Error("Seal SSO did not return a bearer token");let K=J.expiresIn??J.expires_in??J.data?.expiresIn??J.data?.expires_in??3600;return{corpId:U.corpId,sealUrl:z,token:I,expiresIn:Number.isFinite(K)&&K>0?K:3600}}function ew($,Y){let U=Y.hoseCorpConfig&&typeof Y.hoseCorpConfig==="object"?Y.hoseCorpConfig:void 0,z=[Y.tenantSlug,U?.corporationId].filter((I)=>typeof I==="string"&&Boolean(I)),Q=$.trim().toLowerCase(),J=z.map((I)=>I.trim().toLowerCase()).filter(Boolean);if(J.length===0||J.some((I)=>I!==Q))throw Error("Hose assistance link tenant mismatch: the Seal tenant does not match ekbCorpId")}function ti0($){let Y=$.toLowerCase();return si0.some((U)=>Y.endsWith(U))}function D00($){let Y=typeof $?.corpId==="string"?$.corpId.trim().toLowerCase():"",U=typeof $?.accessToken==="string"?$.accessToken.trim():"",z=typeof $?.baseUrl==="string"&&$.baseUrl.trim()?$.baseUrl.trim():void 0;if(!O00.test(Y)||!U)throw Error("Invalid Hose assistance link: accessToken and ekbCorpId are required");return{corpId:Y,accessToken:U,...z?{baseUrl:z}:{}}}function A00($,Y=60){return Boolean($&&Date.now()<$.expiresAt-Y*1000)}function v7($,Y){if($.seal.url)return $.seal.url;if(Y.sealUrl)return Y.sealUrl;return`https://${Y.corpId.toLowerCase()}.sealai.cc`}function ei0($){return $.staffId.includes(":")?$.staffId:`${$.corpId}:${$.staffId}`}function B00($){return K5.create({prefix:B$($.domain),timeout:30000,hooks:{beforeError:[async({error:Y})=>{let U=Y instanceof D6?await Y.response.text().catch(()=>""):"";return Y.message=`${Y.message}${U?`: ${U}`:""}`,Y}]}})}async function $c0($){let Y=B00($),U=$.appKey??$.key,z=$.appSecurity??$.password;if(!U||!z)throw Error("Hose source requires appKey/key and appSecurity/password");let Q=await Y.post("api/openapi/v1/auth/getAccessToken",{json:{appKey:U,appSecurity:z}}).json(),J=Q.value?.accessToken??Q.accessToken??Q.token;if(!J)throw Error("Hose login did not return an access token");return{token:J,expiresAt:Date.now()+3600000}}async function nQ($){if($.source.type!=="hose")throw Error(`Unsupported Seal source: ${$.source.type}`);let Y=TH($.id);if(A00(Y.openapi))return Y.openapi.token;let U=vS.get($.id);if(U)return U;let z=$c0($.source).then((Q)=>{return _S($.id,{...TH($.id),openapi:Q}),Q.token}).finally(()=>vS.delete($.id));return vS.set($.id,z),z}async function $M($,Y,U=7200){let z=B00($),Q=ei0($),I=(await z.post("api/openapi/v1.1/provisional/getProvisionalAuth",{searchParams:{accessToken:Y},json:{uid:Q,pageType:"home",expireDate:U}}).json()).value?.message;if(!I)throw Error("Hose CloseAPI did not return a provisional auth URL");let K=new URL(I).searchParams.get("accessToken");if(!K)throw Error("Hose provisional auth URL did not include accessToken");return{token:K,url:I,expiresAt:Date.now()+U*1000}}async function YM($){if($.source.type!=="hose")throw Error(`Unsupported Seal source: ${$.source.type}`);let Y=$.source,U=TH($.id);if(A00(U.closeapi)&&U.closeapi.url)return U.closeapi;let z=hS.get($.id);if(z)return z;let Q=nQ($).then((J)=>$M(Y,J)).then((J)=>{return _S($.id,{...TH($.id),closeapi:J}),J}).finally(()=>hS.delete($.id));return hS.set($.id,Q),Q}async function P00($,Y=7200,U){if($.source.type!=="hose")throw Error(`Unsupported Seal source: ${$.source.type}`);if(!Number.isFinite(Y)||Y<=0)throw Error(`Invalid expire seconds: ${Y}. Must be a positive integer.`);let z=await nQ($),Q=await $M($.source,z,Y);if(!Q.url)throw Error("Hose provisional auth URL was not available");return{corpId:$.source.corpId,staffId:$.source.staffId,url:Q.url,token:Q.token,expiresIn:Y}}async function T00($){if($.source.type!=="hose")throw Error(`Unsupported Seal source: ${$.source.type}`);let Y=await YM($),U=v7($,$.source),z=A6($.seal),J=await T8(U,void 0,z).get("api/auth/oauth2/session/oem-hosecloud",{searchParams:{token:Y.token,returnToken:"1"}}).json(),I=J.token??J.accessToken??J.data?.token??J.data?.accessToken;if(!I)throw Error("Seal SSO did not return a bearer token");let K=J.expiresIn??J.expires_in??J.data?.expiresIn??J.data?.expires_in??3600,G={provider:"hose",corpId:$.source.corpId,staffId:$.source.staffId,sealUrl:B$(U),tenantSlug:$.seal.tenantSlug,raw:{sourceType:"hose",hoseDomain:B$($.source.domain)}};return{token:I,expiresAt:Date.now()+K*1000,enterprise:G}}async function pQ($,Y,U){if(U){let I=B$(U),K=await M00(I,$,Y);if(!K)throw Error(`Failed to authenticate on specified domain: ${I}. Please verify appKey/appSecurity and domain connectivity.`);return K}let z=ri0.map(async(I)=>{try{return await M00(I,$,Y)}catch{return}}),J=(await Promise.all(z)).filter((I)=>Boolean(I));if(J.length>0&&J[0])return J[0];throw Error("Failed to authenticate with appKey/appSecurity on all 6 standard Hose domains (app.ekuaibao.com, dd2.hosecloud.com, wx2.ekuaibao.com, kdcloud2.ekuaibao.com, ddenterprise.ekuaibao.com, feishu.ekuaibao.com). "+'If your enterprise uses a private cloud or custom domain (such as 美年大健康), please specify the "domain" parameter explicitly.')}async function M00($,Y,U){try{let z=await fetch(`${$}/api/openapi/v1/auth/getAccessToken`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({appKey:Y,appSecurity:U}),signal:AbortSignal.timeout(8000)});if(!z.ok)return;let Q=await z.json();if(Q.value?.errorCode)return;let J=Q.value?.accessToken??Q.accessToken,I=Q.value?.corporationId??Q.value?.corporation?.id;if(!J||!I)return;return{domain:$,corpId:I,corpName:Q.value?.corporation?.name,openapiToken:J,expireTime:Q.value?.expireTime}}catch{return}}async function UM($,Y){let U=`${B$($)}/api/openapi/v1/roleDefGroups?accessToken=${encodeURIComponent(Y)}`,z=await fetch(U,{headers:{"content-type":"application/json",Accept:"application/json"},signal:AbortSignal.timeout(1e4)});if(!z.ok){let I=await z.text().catch(()=>"");throw Error(`Failed to fetch Hose role definition groups: ${z.status} ${I}`)}return((await z.json()).items??[]).map((I)=>({id:I.id,name:I.name,enName:I.enName,roleDefs:(I.roleDefs??[]).map((K)=>({id:K.id,name:K.name,enName:K.enName,sourceType:K.sourceType,sourceTypeValue:K.sourceTypeValue,groupId:I.id,groupName:I.name}))}))}async function SS($,Y,U,z="id"){let Q=U.startsWith("$")?U.slice(1):U,J=`${B$($)}/api/openapi/v1/roledefs/$${Q}?accessToken=${encodeURIComponent(Y)}&staffBy=${encodeURIComponent(z)}&pathType=name`,I=await fetch(J,{headers:{"content-type":"application/json",Accept:"application/json"},signal:AbortSignal.timeout(1e4)});if(!I.ok){let W=await I.text().catch(()=>"");throw Error(`Failed to fetch Hose role staffs for ${Q}: ${I.status} ${W}`)}let G=(await I.json()).value;if(!G)throw Error(`Hose role staff query returned empty result for ${Q}`);let H=[];for(let W of G.contents??[])for(let X of W.staffs??[])if(X&&!H.includes(X))H.push(X);return{id:G.id??Q,name:G.name??"",count:G.count??H.length,staffs:H}}async function gS($,Y,U){if(U.length===0)return[];let z=`${B$($)}/api/openapi/v1/staffs/getStaffIds?accessToken=${encodeURIComponent(Y)}`,Q=await fetch(z,{method:"POST",headers:{"content-type":"application/json",Accept:"application/json"},body:JSON.stringify({type:"STAFFID",conditionIds:U.slice(0,100)}),signal:AbortSignal.timeout(1e4)});if(!Q.ok){let I=await Q.text().catch(()=>"");throw Error(`Failed to fetch Hose staff details: ${Q.status} ${I}`)}return(await Q.json()).items??[]}function yS($){if(!$)return"-";if($.length<=12)return"******";return`${$.slice(0,8)}...${$.slice(-4)}`}async function Yc0($){let Y=typeof $==="string"?N00($):D00($),U=Y.baseUrl||"https://app.ekuaibao.com",z,Q,J,I,K,G={accesstoken:Y.accessToken,corpid:Y.corpId};try{let H=await K5.get(`${U}/api/engine/realm/$UNITY/actions/jwt`,{searchParams:{corpId:Y.corpId},headers:G,timeout:1e4}).json(),W=H.id||H.value;if(W){let X=W.split(".");if(X.length>=2){let Z=X[1].replace(/-/g,"+").replace(/_/g,"/"),q=JSON.parse(Buffer.from(Z,"base64").toString("utf-8"));if(typeof q.staffId==="string")z=q.staffId;if(typeof q.corporationName==="string")Q=q.corporationName;if(typeof q.staffName==="string")J=q.staffName;if(typeof q.cellphone==="string")K=q.cellphone;if(q.isAdmin!==void 0)I=q.isAdmin===!0||q.isAdmin==="true"}}}catch{}if(!z||!Q)try{let W=(await K5.get(`${U}/api/account/v2/session`,{headers:{...G,...z?{staffid:z}:{}},timeout:1e4}).json())?.value;if(W){if(!z&&W.loginStaffId)z=W.loginStaffId;if(!Q&&W.corporationName)Q=W.corporationName;if(!J&&W.privilege)J=W.privilege}}catch{}if(!z)z=`${Y.corpId}:admin`;return{corpId:Y.corpId,baseUrl:U,accessToken:Y.accessToken,staffId:z,corpName:Q,staffName:J,isAdmin:I,cellphone:K}}async function kS($){let Y=await Yc0($),U={accesstoken:Y.accessToken,corpid:Y.corpId,staffid:Y.staffId},z;try{z=await(await K5.get(`${Y.baseUrl}/api/innerapi/v1/key`,{searchParams:{corpId:Y.corpId},headers:U,timeout:15000})).json()}catch(I){let K=I instanceof Error?I.message:String(I);throw Error(`Failed to query Hose OpenAPI keys from assistance link: ${K}`)}let Q=z.items??[],J=[];for(let I of Q)if(typeof I==="object"&&I!==null){let K=I;if(typeof K.appKey==="string"&&typeof K.appSecurity==="string")J.push({id:String(K.id??K.appKey),name:typeof K.name==="string"?K.name:void 0,appKey:K.appKey,appSecurity:K.appSecurity,active:typeof K.active==="boolean"?K.active:!0,corporationId:typeof K.corporationId==="string"?K.corporationId:Y.corpId,createTime:typeof K.createTime==="number"?K.createTime:void 0,updateTime:typeof K.updateTime==="number"?K.updateTime:void 0})}return{corpId:Y.corpId,corpName:Y.corpName,baseUrl:Y.baseUrl,staffId:Y.staffId,keys:J}}var ri0,si0,ai0="/web/thirdparty.html",O00,vS,hS;var t9=m(()=>{iQ();i8();jH();ri0=["https://app.ekuaibao.com","https://dd2.hosecloud.com","https://wx2.ekuaibao.com","https://kdcloud2.ekuaibao.com","https://ddenterprise.ekuaibao.com","https://feishu.ekuaibao.com"],si0=[".ekuaibao.com",".hosecloud.com"],O00=/^[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?$/,vS=new Map,hS=new Map});function j00($,Y){return Date.now()>=$.expiresAt-Y*1000}async function Uc0($){switch($.source.type){case"hose":return T00($);case"direct":case"seal":return G00($)}}async function QM($){let Y=$.auth.refreshTtl,U=zM.get($.id);if(U&&!j00(U,Y))return U;let z=L00($.id);if(z&&!j00(z,Y))return zM.set($.id,z),z;let Q=await Uc0($);return zM.set($.id,Q),F00($.id,Q),Q}async function E00($){return(await QM($)).enterprise}function C00($){zM.delete($),w00($)}var zM;var xS=m(()=>{t9();jH();zM=new Map});var _00={};x8(_00,{createSealClientForUrl:()=>T8,createSealClientForToken:()=>fS,createSealClient:()=>B1});function zc0($){if($===void 0||$===null||$==="")return"";if(typeof $==="string")return $;try{return JSON.stringify($)}catch{return String($)}}function Qc0($){if(!($ instanceof D6))return $;let Y=zc0($.data);if(Y)$.message=`${$.message}: ${Y}`;return $}function R00($){return async({error:Y})=>{if($&&Y instanceof D6&&Y.response.status===401)C00($);return Qc0(Y)}}async function B1($){let Y=await QM($);return K5.create({prefix:Y.enterprise.sealUrl,timeout:30000,headers:{...A6($.seal),Authorization:`Bearer ${Y.token}`},hooks:{beforeError:[R00($.id)]}})}async function fS($,Y){let U=await QM($);return T8(U.enterprise.sealUrl,Y,A6($.seal))}function T8($,Y,U={}){let z={...U};if(Y)z.Authorization=`Bearer ${Y}`;return K5.create({prefix:$.replace(/\/+$/,""),timeout:30000,headers:z,hooks:{beforeError:[R00()]}})}var i8=m(()=>{iQ();xS()});var EH;var v00=m(()=>{EH={name:"seal-use",version:"0.10.33",private:!0,description:"Seal tenant operations toolkit: approval-run diagnosis, rule remediation, Hose/合思 auth, plus a CLI and an optional MCP server.",license:"MIT",author:{name:"yingqing"},repository:{type:"git",url:"git+https://github.com/yunyingk/seal-use.git"},type:"module",module:"src/server.ts",bin:{"seal-use":"src/cli.ts","seal-home":"src/cli.ts"},packageManager:"bun@1.3.14",engines:{bun:">=1.3.14"},scripts:{dev:"bun run --watch src/server.ts",start:"bun run src/server.ts",probe:"bun run src/probe.ts",cli:"bun run src/cli.ts",check:"tsc --noEmit","build:binary":"node scripts/build-binary.mjs","build:plugin":"node scripts/build-plugin.mjs",bump:"bun run scripts/bump-version.ts","dev:override":"bun run scripts/dev-override.ts","dev:link":"bun run scripts/dev-override.ts","openapi:bundle":"bun run scripts/bundle-openapi.ts","openapi:raw":"bun run scripts/generate-raw-openapi.ts",test:"bun test",prepare:"git config core.hooksPath .githooks"},dependencies:{"@modelcontextprotocol/server":"^2.0.0",archiver:"^8.0.0",exceljs:"^4.4.0","iconv-lite":"^0.7.3",ky:"^2.0.2","pinyin-pro":"^3.29.3",yauzl:"^3.4.0",zod:"^4.4.3"},devDependencies:{"@modelcontextprotocol/client":"^2.0.0","@types/archiver":"^8.0.0","@types/bun":"^1.3.14","@types/yauzl":"^3.4.0","bun-types":"^1.3.14",typescript:"^5.9.3",yaml:"^2.9.0"}}});import{spawnSync as h00}from"node:child_process";function Ic0($,Y=EH.version){let U=$.trim();if(!U)return null;let z=U.endsWith("-dirty"),Q=z?U.slice(0,-6):U,J=Q.match(/^v?(\d+\.\d+\.\d+(?:-[a-zA-Z0-9.]+)?)-(\d+)-g([0-9a-f]+)$/);if(J&&J[1]&&J[2]&&J[3])return{baseVersion:J[1],commitsAhead:Number.parseInt(J[2],10),commit:J[3],dirty:z,describe:U};let I=Q.match(/^v?(\d+\.\d+\.\d+(?:-[a-zA-Z0-9.]+)?)$/);if(I&&I[1])return{baseVersion:I[1],commitsAhead:0,commit:"",dirty:z,describe:U};let K=Q.match(/^([0-9a-f]{7,40})$/);if(K&&K[1])return{baseVersion:Y,commitsAhead:0,commit:K[1],dirty:z,describe:U};return null}function Kc0($,Y,U,z){let J=U?`+g${U}${z?".dirty":""}`:z?"+dirty":"";return`${$}-dev.${Y}${J}`}function Gc0($){let Y=$?.env,U=Y?.SEAL_BUILD_VERSION??process.env.SEAL_BUILD_VERSION,z=Y?.SEAL_BUILD_IS_RELEASE??process.env.SEAL_BUILD_IS_RELEASE,Q=Y?.SEAL_BUILD_CHANNEL??process.env.SEAL_BUILD_CHANNEL,J=Y?.SEAL_BUILD_GIT_BASE??process.env.SEAL_BUILD_GIT_BASE,I=Y?.SEAL_BUILD_GIT_COMMITS_AHEAD??process.env.SEAL_BUILD_GIT_COMMITS_AHEAD,K=Y?.SEAL_BUILD_GIT_COMMIT??process.env.SEAL_BUILD_GIT_COMMIT,G=Y?.SEAL_BUILD_GIT_DIRTY??process.env.SEAL_BUILD_GIT_DIRTY,H=Y?.SEAL_BUILD_GIT_DESCRIBE??process.env.SEAL_BUILD_GIT_DESCRIBE,W=Y?.SEAL_FORCE_RELEASE??process.env.SEAL_FORCE_RELEASE,X=$?.cwd;if(U){let Z=z==="true",V={name:"seal-use",version:U,channel:Q||(Z?"release":"dev"),isRelease:Z};if(J)V.git={baseVersion:J,commitsAhead:Number.parseInt(I||"0",10),commit:K||"",dirty:G==="true",describe:H||U};return V}if(z==="true"||W==="1")return{name:"seal-use",version:EH.version,channel:"release",isRelease:!0};try{let Z=h00("git",["describe","--tags","--long","--dirty","--always"],{cwd:X,encoding:"utf8",stdio:["ignore","pipe","ignore"]});if(Z.status===0&&Z.stdout){let q=Ic0(Z.stdout.trim(),EH.version);if(q){if(!q.commit){let F=h00("git",["rev-parse","--short","HEAD"],{cwd:X,encoding:"utf8",stdio:["ignore","pipe","ignore"]});if(F.status===0&&F.stdout)q.commit=F.stdout.trim()}return{name:"seal-use",version:Kc0(q.baseVersion,q.commitsAhead,q.commit,q.dirty),channel:"dev",isRelease:!1,git:q}}}}catch{}return{name:"seal-use",version:`${EH.version}-dev.0+local`,channel:"dev",isRelease:!1}}var cY,P1,uS,hc1;var e9=m(()=>{v00();cY=Gc0(),P1=cY.version,uS=cY.isRelease,hc1=cY.channel});function dQ($=void 0){return iS.parse($??{})}function y00($,Y){return dQ({...dQ($),...Y})}var S00,bS,g00,iS,cS;var mQ=m(()=>{A$();S00=[".pdf",".xls",".xlsx",".csv",".doc",".docx",".ppt",".pptx",".txt",".rtf",".odt",".ods",".odp",".jpg",".jpeg",".png",".gif",".bmp",".webp",".heic",".eml",".msg"],bS={minFileSizeBytes:500,allowedExtensions:[...S00]},g00=L.string().trim().min(1).transform(($)=>{let Y=$.toLowerCase();return Y.startsWith(".")?Y:`.${Y}`}).refine(($)=>/^\.[a-z0-9][a-z0-9+_-]*$/.test($),{message:"文件后缀必须是简单扩展名,例如 .pdf 或 xlsx"}),iS=L.object({minFileSizeBytes:L.number().int().min(0).default(bS.minFileSizeBytes),maxFileSizeBytes:L.number().int().positive().nullable().optional(),allowedExtensions:L.array(g00).min(1).default([...S00]).transform(($)=>[...new Set($)])}).superRefine(($,Y)=>{if($.maxFileSizeBytes!==void 0&&$.maxFileSizeBytes!==null&&$.maxFileSizeBytes<$.minFileSizeBytes)Y.addIssue({code:"custom",path:["maxFileSizeBytes"],message:"最大文件大小不能小于最小文件大小"})}),cS=L.object({minFileSizeBytes:L.number().int().min(0).optional(),maxFileSizeBytes:L.number().int().positive().nullable().optional(),allowedExtensions:L.array(g00).min(1).transform(($)=>[...new Set($)])}).optional()});var Hc0,Wc0,Xc0,Zc0,x00,qc0,Vc0,f00,JM,u00,Lc0,IM,b00,RH,i00,Fc0,wc0,Mc0,k00,_H,c00,Oc0,Nc0,KM,nS,n00,p00,d00,m00,GM,l00,pS,dS,o00,r00,Dc0,s00,Ac0,a00,CH,t00,e00,$10,Y10,U10,z10,Q10,J10,I10,K10,G10,Bc0,H10,Pc0,Tc0,jc0,mS,lS,Ec0,W10,X10,Z10,q10,Cc0,oS,fc1,uc1,V10,bc1;var rS=m(()=>{A$();mQ();Hc0=L.object({staffId:L.string(),name:L.string().optional(),code:L.string().default(""),bindTime:L.number().optional()}),Wc0=L.object({id:L.string(),tenantId:L.string(),name:L.string(),isAdmin:L.boolean().default(!1),permissions:L.array(L.string()).default([]),providerUserId:L.string().optional(),hosecloudStaff:Hc0.optional()}),Xc0=L.object({apiKey:L.string().optional(),corporationId:L.string().optional(),corporationName:L.string().optional()}),Zc0=L.object({id:L.string(),name:L.string(),tenantSlug:L.string().optional(),isDemo:L.boolean().default(!1),logoUrl:L.string().nullable().optional(),hoseCorpConfig:Xc0.optional()}),x00=L.object({user:Wc0,tenant:Zc0}),qc0=L.object({id:L.string(),name:L.string(),email:L.string().nullable().optional(),emailVerified:L.boolean().optional(),image:L.string().nullable().optional(),tenantId:L.string().optional(),provider:L.string().optional(),providerUserId:L.string().optional(),mobile:L.string().nullable().optional(),status:L.string().optional(),permissions:L.array(L.string()).default([]),isAdmin:L.boolean().default(!1),hosecloudStaff:L.unknown().optional()}).passthrough(),Vc0=L.object({id:L.string(),token:L.string().optional(),expiresAt:L.string(),createdAt:L.string().optional(),updatedAt:L.string().optional(),ipAddress:L.string().optional(),userAgent:L.string().optional(),userId:L.string(),delegationId:L.string().nullable().optional()}).passthrough(),f00=L.object({user:qc0,session:Vc0}),JM=L.object({id:L.string(),tenantId:L.string().optional(),code:L.union([L.number(),L.string()]).optional(),description:L.string(),scope:L.string(),strictness:L.string(),status:L.string().optional(),createdAt:L.number().optional(),updatedAt:L.number().optional()}),u00=L.object({rules:L.array(JM),hasPendingDeletes:L.boolean().default(!1)}),Lc0=L.object({code:L.string().optional(),description:L.string(),scope:L.string(),strictness:L.string()}),IM=L.object({id:L.string(),tenantId:L.string().optional(),versionNumber:L.number(),versionName:L.string().nullable().optional(),publishedBy:L.string().nullable().optional(),publishedByName:L.string().nullable().optional(),rules:L.array(Lc0).default([]),publishedAt:L.number().optional(),createdAt:L.number().optional()}),b00=L.object({version:IM,rulesCount:L.number()}),RH=L.object({id:L.string(),tenantId:L.string().optional(),title:L.string(),purpose:L.string().default(""),contentType:L.string().default("policy"),content:L.string(),status:L.string().default("published"),enabled:L.boolean().default(!0),scenarios:L.array(L.string()).default([]),tags:L.array(L.string()).default([]),category:L.string().nullable().optional(),categoryTags:L.array(L.string()).default([]),createdBy:L.string().nullable().optional(),createdByName:L.string().nullable().optional(),createdAt:L.number().optional(),updatedAt:L.number().optional(),updatedBy:L.string().nullable().optional(),updatedByName:L.string().nullable().optional(),isDeleted:L.boolean().default(!1)}),i00=L.object({articles:L.array(RH),total:L.number().optional()}),Fc0=L.object({explicitApprove:L.string().default(""),explicitReject:L.string().default(""),exemptApprove:L.string().default(""),review:L.string().default("")}).passthrough(),wc0=L.object({type:L.string(),signKey:L.string().optional(),outboundName:L.string().optional(),mode:L.string().optional(),autoApprovalRate:L.number().optional(),apiKey:L.string().optional(),apiSecret:L.string().optional(),apiOrigin:L.string().optional(),corporationId:L.string().optional(),ebotSignKey:L.string().optional(),completionSignKey:L.string().optional(),outboundMessageId:L.string().optional(),completionMessageId:L.string().optional()}).passthrough(),Mc0=L.enum(["assisted","semi_automatic","fully_automatic"]),k00=L.object({id:L.string(),url:L.string().url()}).passthrough(),_H=L.object({type:L.literal("webhook"),id:L.string(),name:L.string(),mode:Mc0,incomingDocumentWebhook:k00,outgoingResultWebhook:L.string().url(),incomingManualResultWebhook:k00,secret:L.string().min(1),autoApprovalRate:L.number().int().min(0).max(100).optional(),materialPackFilePolicy:iS.default(bS)}).passthrough(),c00=L.object({id:L.string().optional(),tenantId:L.string().optional(),tone:L.string().optional(),language:L.string().optional(),detailLevel:L.string().optional(),outputFormat:L.string().optional(),examples:L.array(L.string()).default([]),prohibitedPhrases:L.array(L.string()).default([]),customInstructions:L.string().optional(),updatedAt:L.number().optional(),decisionPreferences:Fc0.optional(),integrationSystem:L.string().optional(),integrations:L.array(wc0).default([])}).passthrough(),Oc0=L.object({id:L.string().optional(),sn:L.string().optional(),title:L.string().optional(),name:L.string().optional(),fields:L.array(L.unknown()).optional()}).passthrough(),Nc0=L.object({_langfuseTraceId:L.string().optional(),simulation_batch_id:L.string().optional()}).passthrough(),KM=L.object({id:L.string(),tenantId:L.string().optional(),agentId:L.string().optional(),status:L.string().optional(),taskMode:L.string().optional(),finalExecutionMode:L.string().optional(),sourceSystem:L.string().optional(),sourceDocumentSN:L.string().optional(),sourceDocumentId:L.string().optional(),documentId:L.string().optional(),document:Oc0.optional(),result:L.unknown().optional(),pipelineData:L.unknown().optional(),sourceExtendData:Nc0.optional(),ruleSetVersionNumber:L.number().optional(),ruleSetPublishedAt:L.number().optional(),ruleSetPublishedByName:L.string().optional(),createdAt:L.union([L.string(),L.number()]).optional(),updatedAt:L.union([L.string(),L.number()]).optional()}).passthrough(),nS=L.object({records:L.array(KM).default([]),total:L.number().optional(),page:L.number().optional(),pageSize:L.number().optional()}).passthrough(),n00=L.object({id:L.string(),expiresAt:L.number().nullable().optional(),revokedAt:L.number().nullable().optional(),createdAt:L.number().nullable().optional(),lastUsedAt:L.number().nullable().optional(),useCount:L.number().default(0),note:L.string().nullable().optional(),link:L.string()}).passthrough(),p00=L.object({id:L.string(),token:L.string(),link:L.string()}).passthrough(),d00=L.object({userId:L.string(),password:L.string()}).passthrough(),m00=L.object({password:L.string()}).passthrough(),GM=L.object({_id:L.string(),tenantId:L.string().optional(),name:L.string(),mobile:L.string().optional(),email:L.string().optional(),departmentIds:L.array(L.string()).default([]),status:L.string().optional(),permissions:L.array(L.string()).default([]),createdAt:L.string().optional(),updatedAt:L.string().optional()}).passthrough(),l00=L.object({departments:L.array(L.record(L.string(),L.unknown())).default([]),users:L.array(GM).default([])}).passthrough(),pS=L.object({_id:L.string(),tenantId:L.string().optional(),name:L.string().optional(),parentId:L.string().nullable().optional(),ancestors:L.array(L.string()).default([]),provider:L.string().optional(),permissions:L.array(L.string()).default([]),isDeleted:L.boolean().optional(),syncedAt:L.string().optional(),createdAt:L.string().optional(),updatedAt:L.string().optional()}).passthrough(),dS=L.object({items:L.array(pS).default([])}).passthrough(),o00=L.object({items:L.array(GM).default([])}).passthrough(),r00=L.object({lastSyncTime:L.union([L.string(),L.number(),L.null()])}).passthrough(),Dc0=L.object({tagId:L.string().optional(),tagName:L.string().optional(),tagPath:L.string().optional(),count:L.number().default(0),avgConfidence:L.number().default(0),errorCount:L.number().default(0),warningCount:L.number().default(0)}).passthrough(),s00=L.object({tagStats:L.array(Dc0).default([]),totalRisks:L.number().default(0),analyzedRisks:L.number().default(0),pendingRisks:L.number().default(0)}).passthrough(),Ac0=L.object({riskId:L.string().optional(),recordId:L.string().optional(),riskDetails:L.string().default(""),riskLevel:L.string().default("warning"),documentType:L.string().default(""),documentSN:L.string().default(""),sourceSystem:L.string().default(""),sourceDocumentURL:L.string().nullable().optional(),confidence:L.number().default(0),reasoning:L.string().default(""),createdAt:L.union([L.string(),L.number(),L.date()]).optional()}).passthrough(),a00=L.object({tagId:L.string(),tagName:L.string().default(""),tagPath:L.string().default(""),tagDescription:L.string().default(""),risks:L.array(Ac0).default([]),total:L.number().default(0)}).passthrough(),CH=L.object({value:L.number().default(0),trend:L.number().default(0)}).passthrough(),t00=L.object({metrics:L.object({approvalCount:CH.optional(),accuracy:CH.optional(),automationRate:CH.optional(),riskCount:CH.optional(),avgDuration:CH.optional()}).passthrough().default({}),sankeyData:L.object({nodes:L.array(L.object({id:L.string()}).passthrough()).default([]),links:L.array(L.object({source:L.string(),target:L.string(),value:L.number().default(0)}).passthrough()).default([])}).passthrough().default({nodes:[],links:[]})}).passthrough(),e00=L.record(L.string(),L.unknown()),$10=L.object({expenses:L.array(e00).default([]),total:L.number().optional()}).passthrough(),Y10=L.object({invoices:L.array(e00).default([]),total:L.number().optional(),feishuApprovalAppId:L.string().nullable().optional()}).passthrough(),U10=L.record(L.string(),L.unknown()),z10=L.object({provider:L.string(),config:L.record(L.string(),L.unknown()).default({})}).passthrough(),Q10=L.object({id:L.string(),name:L.string(),description:L.string().optional(),available:L.boolean().default(!0),fields:L.array(L.record(L.string(),L.unknown())).default([])}).passthrough(),J10=L.object({permissions:L.array(L.object({key:L.string(),name:L.string(),description:L.string().optional()}).passthrough()).default([])}).passthrough(),I10=L.object({configs:L.array(L.record(L.string(),L.unknown())).default([])}).passthrough(),K10=L.object({subscriptions:L.array(L.record(L.string(),L.unknown())).default([]),features:L.array(L.record(L.string(),L.unknown())).default([])}).passthrough(),G10=L.object({key:L.string(),type:L.string(),label:L.string(),column:L.string(),mask:L.string().optional()}).passthrough(),Bc0=L.object({columns:L.array(G10).default([]),fieldKey:L.string().optional(),keyColumn:L.string().optional(),sheetName:L.string().optional(),fieldLabel:L.string().optional()}).passthrough(),H10=L.object({id:L.string().optional(),listSheets:L.array(Bc0).default([]),mainColumns:L.array(G10).default([]),workbookName:L.string().optional(),mainKeyColumn:L.string().optional(),mainSheetName:L.string().optional(),titleColumn:L.string().optional(),statusColumn:L.string().optional(),applicationDateColumn:L.string().optional(),updatedDateColumn:L.string().optional(),attachmentFieldKey:L.string().optional(),attachmentFieldLabel:L.string().optional()}).passthrough(),Pc0=L.object({approvalCode:L.string(),nodeId:L.string().optional(),flowIds:L.array(L.string()).max(100).optional(),limit:L.number().int().positive().max(100).optional(),dataCollectionMode:L.string().optional(),signKey:L.string().optional(),rejectNodeName:L.string().nullable().optional(),skipInvoiceGeneration:L.boolean().optional(),skipExpenseExtraction:L.boolean().optional(),disableAttachmentCache:L.boolean().optional(),thinkingDepthOverride:L.enum(["default","medium","high"]).optional(),startTime:L.number().optional(),endTime:L.number().optional(),templateId:L.string().optional(),packageIds:L.array(L.string()).optional(),packageLabel:L.string().optional(),runMode:L.string().optional(),schemaConfig:H10.optional()}).passthrough(),Tc0=L.object({mode:L.string().optional(),conditions:L.array(L.object({label:L.string(),value:L.string()}).passthrough()).default([])}).passthrough(),jc0=L.object({kind:L.string().optional(),stage:L.string().optional(),code:L.string().optional(),message:L.string().optional()}).passthrough(),mS=L.object({id:L.string(),tenantId:L.string().optional(),approvalCode:L.string().optional(),nodeId:L.string().optional(),sourceSystem:L.string().optional(),status:L.string().optional(),totalCount:L.number().default(0),processedCount:L.number().default(0),successCount:L.number().default(0),failedCount:L.number().default(0),createdCount:L.number().default(0),createFailedCount:L.number().default(0),params:Pc0.optional(),requestSummary:Tc0.nullable().optional(),resultSummary:jc0.nullable().optional(),createdAt:L.union([L.string(),L.number()]).optional(),updatedAt:L.union([L.string(),L.number()]).optional()}).passthrough(),lS=L.object({batchId:L.string()}).passthrough(),Ec0=L.object({dataCollectionMode:L.string().optional(),flowIds:L.array(L.string()).max(100).optional(),rejectNodeName:L.string().nullable().optional(),skipInvoiceGeneration:L.boolean().optional(),skipExpenseExtraction:L.boolean().optional()}).passthrough(),W10=L.object({id:L.string(),tenantId:L.string().optional(),name:L.string().optional(),description:L.string().optional(),approvalSystem:L.string().optional(),hosecloudConfig:Ec0.optional(),createdAt:L.union([L.string(),L.number()]).optional(),updatedAt:L.union([L.string(),L.number()]).optional()}).passthrough(),X10=L.object({hasFeishu:L.boolean().default(!1),hasHosecloud:L.boolean().default(!1),hasWeaver:L.boolean().default(!1),hasHelios:L.boolean().default(!1),hasMaycur:L.boolean().default(!1),hasMaycurStandard:L.boolean().default(!1)}).passthrough(),Z10=L.object({signKey:L.string().optional(),displayName:L.string().optional(),corporationId:L.string().optional()}).passthrough(),q10=L.object({id:L.string(),tenantId:L.string().optional(),name:L.string().optional(),templateId:L.string().optional(),originalFileName:L.string().optional(),status:L.string().optional(),documentCount:L.number().optional(),attachmentCount:L.number().optional(),uploadedBy:L.string().optional(),schemaConfig:H10.nullable().optional(),createdAt:L.union([L.string(),L.number()]).optional(),updatedAt:L.union([L.string(),L.number()]).optional()}).passthrough(),Cc0=L.object({hitScopes:L.array(L.string()).default([]),hitRuleIds:L.array(L.string()).default([]),notHitScopes:L.array(L.string()).default([]),notHitRuleIds:L.array(L.string()).default([])}).passthrough(),oS=L.object({id:L.string().min(1),name:L.string().min(1),enabled:L.boolean().default(!0),description:L.string().default(""),condition:Cc0.default({hitScopes:[],hitRuleIds:[],notHitScopes:[],notHitRuleIds:[]}),level:L.enum(["medium","high"])}).passthrough(),fc1=L.object({defaultLevel:L.enum(["medium","high"]).default("medium"),routingPolicies:L.array(oS).default([])}).passthrough(),uc1=L.object({dryRun:L.boolean().optional(),signKey:L.string().min(1).optional(),outboundName:L.string().optional(),specificationId:L.string().optional(),specificationName:L.string().optional(),mode:L.enum(["fully_automatic","semi_automatic","assisted"]).default("assisted"),autoApprovalRate:L.number().min(0).max(100).optional(),rejectResubmitMethod:L.enum(["node_default","to_ebot","from_start"]).optional(),autoApproveNodeNames:L.array(L.string()).optional(),apiKey:L.string().min(1),apiSecret:L.string().min(1),apiOrigin:L.string().default("production"),customApiUrl:L.string().optional()}).passthrough(),V10=L.object({id:L.string().optional(),code:L.string().optional(),name:L.string().optional(),approvalSystem:L.string().optional()}).passthrough(),bc1=L.object({total:L.number(),dedupeBy:L.string(),unique:L.number(),byStatus:L.record(L.string(),L.number()),bySourceSystem:L.record(L.string(),L.number())}).passthrough()});import{randomBytes as w10}from"node:crypto";async function M1($,Y){let U=await $.json();return Y.parse(U.data??U)}async function W8($){return M1(await $.get("api/v1/auth/me"),x00)}async function O10($){return M1(await $.get("api/auth/get-session"),f00)}async function p6($){return M1(await $.get("api/v1/rules"),u00)}async function hH($,Y){return M1(await $.post("api/v1/rules",{json:Y}),JM)}async function sS($,Y,U){return M1(await $.put(`api/v1/rules/${Y}`,{json:U}),JM)}async function oQ($,Y){await $.delete(`api/v1/rules/${Y}`)}async function ZM($){let Y=await $.post("api/v1/rules/batch-recode",{throwHttpErrors:!1}),U=await Y.json().catch(()=>({}));return L.object({ok:L.boolean(),status:L.number(),body:L.unknown()}).parse({ok:Y.ok,status:Y.status,body:U})}async function P$($){return M1(await $.get("api/v1/rule-set-versions"),L.array(IM))}async function SH($,Y){return M1(await $.get(`api/v1/rule-set-versions/${Y}`),IM)}async function gH($,Y){return M1(await $.post("api/v1/rule-set-versions/publish",{json:{versionName:Y}}),b00)}async function h7($,Y={}){let U=new URLSearchParams;return U.set("offset",String(Y.offset??0)),U.set("limit",String(Y.limit??20)),U.set("sortBy",Y.sortBy??"createdAt"),U.set("sortOrder",Y.sortOrder??"desc"),Y.scenarios?.forEach((z,Q)=>{U.set(`filter[scenarios][${Q}]`,z)}),M1(await $.get("api/v1/knowledge/articles",{searchParams:U}),i00)}async function N10($,Y){return M1(await $.get(`api/v1/knowledge/articles/${Y}`),RH)}async function qM($,Y){return M1(await $.post("api/v1/knowledge/articles",{json:{...Y,contentType:Y.contentType??"policy",status:Y.status??"published",enabled:Y.enabled??!0,scenarios:Y.scenarios&&Y.scenarios.length>0?Y.scenarios:["audit"],tags:Y.tags??[]}}),RH)}async function VM($,Y,U){let z=Object.fromEntries(Object.entries(U).filter(([,Q])=>Q!==void 0));return M1(await $.patch(`api/v1/knowledge/articles/${Y}`,{json:{attributes:z}}),RH)}async function LM($,Y){return await $.delete(`api/v1/knowledge/articles/${Y}`),{success:!0,id:Y}}async function o1($,Y="api/v1/agent/ai-approval/config"){return M1(await $.get(Y),c00)}async function l5($,Y,U="api/v1/agent/ai-approval/config"){return await $.post(U,{json:Y}),o1($,U)}async function aS($,Y,U="api/v1/agent/ai-approval/config"){let z=await $.post(U,{json:Y}),Q=await z.json().catch(()=>({})),J=XM.safeParse(Q.data??Q);return J.success?J.data.success??z.ok:z.ok}async function J$($,Y="api/v1/agent/ai-approval/config"){let U=await o1($,Y);return tS(U.integrations)}async function FM($,Y,U,z="api/v1/agent/ai-approval/config"){let Q=await o1($,z),J=tS(Q.integrations),I=E10(Y,J,U);if(!await aS($,{...Q,integrations:[...Q.integrations,I]},z))throw Error("Seal did not confirm saving the Webhook integration");return I}async function D10($,Y,U,z="api/v1/agent/ai-approval/config"){let Q=await o1($,z),J=tS(Q.integrations),I=E10(Y,J,U);return{before:Q,after:{...Q,integrations:[...Q.integrations,I]},integration:I}}async function A10($,Y,U,z="api/v1/agent/ai-approval/config"){let Q=await o1($,z),J=wM(Q.integrations),I=MM(J,Y),K=C10(I.integration,U);if(!await aS($,{...Q,integrations:Q.integrations.map((H,W)=>W===I.index?K:H)},z))throw Error("Seal did not confirm saving the Webhook integration");return K}async function B10($,Y,U,z="api/v1/agent/ai-approval/config"){let Q=await o1($,z),J=wM(Q.integrations),I=MM(J,Y),K=C10(I.integration,U);return{before:Q,after:{...Q,integrations:Q.integrations.map((G,H)=>H===I.index?K:G)},integration:K}}async function P10($,Y,U="api/v1/agent/ai-approval/config"){let z=await o1($,U),Q=wM(z.integrations),J=MM(Q,Y);if(!await aS($,{...z,integrations:z.integrations.filter((K,G)=>G!==J.index)},U))throw Error("Seal did not confirm deleting the Webhook integration");return J.integration}async function T10($,Y,U="api/v1/agent/ai-approval/config"){let z=await o1($,U),Q=wM(z.integrations),J=MM(Q,Y);return{before:z,after:{...z,integrations:z.integrations.filter((I,K)=>K!==J.index)},integration:J.integration}}function S7($,Y){let U=Y.trim();if(!U)throw Error("Webhook selector must not be empty");let z=$.find((J)=>J.id===U);if(z)return z;let Q=$.filter((J)=>J.name===U);if(Q.length===1)return Q[0];if(Q.length>1)throw Error(`Multiple Webhook integrations match name: ${U}. Use the integration ID.`);throw Error(`Webhook integration not found: ${U}`)}function j10($,Y){let U=Y?.trim().toLowerCase();if(!U)return $;return $.filter((z)=>[z.id,z.name,z.mode,z.outgoingResultWebhook,z.incomingDocumentWebhook.url,z.incomingManualResultWebhook.url].some((Q)=>Q.toLowerCase().includes(U)))}function tS($){return $.filter((Y)=>Y.type==="webhook").map((Y)=>_H.parse(Y))}function wM($){return $.flatMap((Y,U)=>{if(Y.type!=="webhook")return[];return[{index:U,integration:_H.parse(Y)}]})}function MM($,Y){let U=S7($.map((z)=>z.integration),Y);return $.find((z)=>z.integration.id===U.id)}function E10($,Y,U){let z=vH(U.name,"name"),Q=U.mode??"assisted",J=_10(U.outgoingResultWebhook,"outgoingResultWebhook"),I=v10(U.autoApprovalRate??60),K=vc0(Y),G=`wh_${K}_${w10(8).toString("hex").slice(0,7)}`,H=B$($);return _H.parse({type:"webhook",id:`integration-${K}`,name:z,mode:Q,incomingDocumentWebhook:{id:G,url:`${H}/api/v1/integrations/webhook/${G}/document`},outgoingResultWebhook:J,incomingManualResultWebhook:{id:G,url:`${H}/api/v1/integrations/webhook/${G}/manual-result`},secret:U.secret?vH(U.secret,"secret"):R10(),autoApprovalRate:I,materialPackFilePolicy:dQ(U.materialPackFilePolicy)})}function C10($,Y){return _H.parse({...$,...Y.name===void 0?{}:{name:vH(Y.name,"name")},...Y.mode===void 0?{}:{mode:Y.mode},...Y.outgoingResultWebhook===void 0?{}:{outgoingResultWebhook:_10(Y.outgoingResultWebhook,"outgoingResultWebhook")},...Y.autoApprovalRate===void 0?{}:{autoApprovalRate:v10(Y.autoApprovalRate)},...Y.rotateSecret||Y.secret!==void 0?{secret:Y.rotateSecret?R10():vH(Y.secret??"","secret")}:{},...Y.materialPackFilePolicy===void 0?{}:{materialPackFilePolicy:y00($.materialPackFilePolicy,Y.materialPackFilePolicy)}})}function vc0($){let Y=new Set($.map((z)=>z.id)),U=Date.now();while(Y.has(`integration-${U}`))U+=1;return U}function R10(){return w10(16).toString("hex")}function vH($,Y){let U=$.trim();if(!U)throw Error(`Webhook ${Y} must not be empty`);return U}function _10($,Y){let U=vH($,Y);try{return new URL(U).toString()}catch{throw Error(`Webhook ${Y} must be a valid URL`)}}function v10($){if(!Number.isInteger($)||$<0||$>100)throw Error("Webhook autoApprovalRate must be an integer between 0 and 100");return $}async function OM($,Y={}){let[U,z,Q]=await Promise.all([p6($),h7($,{limit:Y.documentLimit??50}),o1($,Y.stylePreferencesEndpoint).then((J)=>({ok:!0,data:J}),(J)=>({ok:!1,error:J instanceof Error?J.message:String(J)}))]);return{rules:U,documents:z,stylePreferences:Q}}async function i4($,Y={}){let U=new URLSearchParams;return U.set("offset",String(Y.offset??0)),U.set("limit",String(Y.limit??50)),c8(U,"fromTimestamp",Y.fromTimestamp),c8(U,"toTimestamp",Y.toTimestamp),c8(U,"startDate",Y.startDate),c8(U,"endDate",Y.endDate),L10(U,"status",Y.status),c8(U,"sourceSystem",Y.sourceSystem),c8(U,"taskMode",Y.taskMode),c8(U,"search",Y.search),c8(U,"sourceDocumentSN",Y.sourceDocumentSN),c8(U,"sourceDocumentId",Y.sourceDocumentId),L10(U,"manualApprovalStatus",Y.manualApprovalStatus),M1(await $.get("api/v1/approvals",{searchParams:U}),nS)}async function H4($,Y){return M1(await $.get(`api/v1/approvals/${Y}`),KM)}async function eS($,Y){let U=await $.get(`api/v1/simulation/batch/${Y}/records`).json(),z=U.data??U;if(Array.isArray(z))return L.array(KM).parse(z);return nS.parse(z).records}async function h10($,Y){return M1(await $.post("api/v1/simulation/create-batch",{json:Y}),lS)}async function S10($,Y){return M1(await $.post("api/v1/simulation/create-material-pack-batch",{json:Y}),lS)}async function g10($,Y={}){let U=await $.get("api/v1/simulation/batches",{searchParams:{limit:String(Y.limit??50)}}).json(),z=U.data??U;return L.array(mS).parse(z)}async function NM($,Y){return M1(await $.get(`api/v1/simulation/batch/${Y}`),mS)}async function y10($){let Y=await $.get("api/v1/simulation/templates").json(),U=Y.data??Y;return L.array(W10).parse(U)}async function $g($){return M1(await $.get("api/v1/simulation/integration-status"),X10)}async function Yg($){let Y=await $.get("api/v1/simulation/hosecloud-integrations").json(),U=Y.data??Y;return L.array(Z10).parse(U)}async function k10($,Y){let z=await(await $.delete(`api/v1/simulation/batch/${encodeURIComponent(Y)}/data`)).json().catch(()=>({}));return z.data??z}async function x10($,Y){let U=Y?"api/v1/simulation/hosecloud-specifications-by-sign-key":"api/v1/simulation/hosecloud-specifications",z=Y?new URLSearchParams({signKey:Y}):void 0,Q=await $.get(U,{searchParams:z}).json(),J=Q.data??Q;return L.array(V10).parse(J)}async function f10($,Y){let U=await $.post("api/hosecloud/corporation",{json:Y}).json(),z=U.data??U;return L.object({corporationId:L.string()}).parse(z)}async function u10($,Y){let z=await(await $.post("api/hosecloud/outbound-config/sync",{json:Y})).json().catch(()=>({}));return z.data??z}async function b10($,Y){let U=new FormData;return U.append("file",new Blob([new Uint8Array(Y.fileBuffer)]),Y.fileName),M1(await $.post("api/v1/material-packages/upload",{body:U}),q10)}function c8($,Y,U){if(U)$.set(Y,U)}function L10($,Y,U){if(!U)return;(Array.isArray(U)?U:[U]).map((Q)=>Q.trim()).filter(Boolean).forEach((Q,J)=>{$.set(`${Y}[${J}]`,Q)})}async function i10($){return M1(await $.get("api/v1/delegation/list"),L.array(n00))}async function lQ($,Y){return M1(await $.post("api/v1/delegation/create",{json:Y??{}}),p00)}async function c10($,Y){let U=await $.post("api/v1/delegation/revoke",{json:{tokenId:Y}}),z=await U.json(),Q=XM.safeParse(z.data??z);return Q.success?Q.data.success??U.ok:U.ok}async function n10($,Y){let U=Y.departmentIds&&Y.departmentIds.length>0?Y.departmentIds:void 0;if(!U){let z=await $.get("api/v1/contacts/departments/root/children").json(),Q=Rc0.safeParse(z.data??z),J=Q.success?Q.data.items?.[0]?._id:void 0;if(J)U=[J]}return M1(await $.post("api/v1/contacts/local/users",{json:{name:Y.name,phone:Y.phone,permissions:Y.permissions??[],departmentIds:U??[]}}),d00)}async function Ug($,Y){return M1(await $.post(`api/v1/contacts/local/users/${Y}/reset-password`,{json:{}}),m00)}async function HM($,Y){return M1(await $.get(`api/v1/contacts/users/${Y}`),GM)}async function WM($,Y=""){return M1(await $.get("api/v1/contacts/search",{searchParams:{query:Y}}),l00)}async function p10($){return M1(await $.get("api/v1/contacts/departments/root/children"),dS)}async function d10($,Y){return M1(await $.get(`api/v1/contacts/departments/${encodeURIComponent(Y)}`),pS)}async function m10($,Y){return M1(await $.get(`api/v1/contacts/departments/${encodeURIComponent(Y)}/children`),dS)}async function l10($,Y){return M1(await $.get(`api/v1/contacts/departments/${encodeURIComponent(Y)}/users`),o00)}async function o10($){return M1(await $.get("api/v1/contacts/last-sync-time"),r00)}async function DM($,Y={}){let U=zg(),z=new URLSearchParams;if(c8(z,"startDate",Y.startDate??U.startDate),c8(z,"endDate",Y.endDate??U.endDate),Y.limit!==void 0)z.set("limit",String(Y.limit));return M1(await $.get("api/v1/insight/stats",{searchParams:z}),s00)}async function AM($,Y){let U=zg(),z=new URLSearchParams;return z.set("tagId",Y.tagId),z.set("startDate",Y.startDate??U.startDate),z.set("endDate",Y.endDate??U.endDate),M1(await $.get("api/v1/insight/risks-by-tag",{searchParams:z}),a00)}async function BM($,Y={}){let U=zg(),z=F10(Y.startDate??U.startDate),Q=F10(Y.endDate??U.endDate),J=new URLSearchParams;return J.set("startDate",String(z)),J.set("endDate",String(Q)),M1(await $.get("api/v1/insight/performance",{searchParams:J}),t00)}async function r10($,Y){return await $.post(`api/v1/insight/analyze/${encodeURIComponent(Y)}`),{success:!0,recordId:Y}}function F10($){if(typeof $==="number")return $<100000000000?$*1000:$;let Y=Number($);if(!isNaN(Y)&&$.trim()!=="")return Y<100000000000?Y*1000:Y;let U=new Date($);if(isNaN(U.getTime()))throw Error(`Invalid date format: ${$}`);return U.getTime()}function zg(){let $=new Date,Y=new Date($.getFullYear(),$.getMonth(),1),U=new Date($.getFullYear(),$.getMonth()+1,0,23,59,59,999);return{startDate:Y.toISOString(),endDate:U.toISOString()}}function s10($){let Y=new URLSearchParams;return c8(Y,"filter[startDate]",$.startDate),c8(Y,"filter[endDate]",$.endDate),c8(Y,"filter[search]",$.search),Y.set("offset",String($.offset??0)),Y.set("limit",String($.limit??50)),Y}async function a10($,Y={}){return M1(await $.get("api/v1/expenses/list",{searchParams:s10(Y)}),$10)}async function t10($,Y={}){return M1(await $.get("api/v1/invoice/list",{searchParams:s10(Y)}),Y10)}async function e10($){return M1(await $.get("api/v1/integrations/feishu/simulation/approval-definitions"),L.array(U10))}async function $40($,Y){let U=await $.delete(`api/v1/contacts/local/users/${Y}`),z=await U.json(),Q=XM.safeParse(z.data??z);return Q.success?Q.data.success??U.ok:U.ok}async function Qg($,Y){let U=await $.post(`api/v1/contacts/local/users/${Y}/activate`,{json:{}}),z=await U.json(),Q=XM.safeParse(z.data??z);return Q.success?Q.data.success??U.ok:U.ok}async function hc0($,Y){let U=await $.post("api/auth/sms-otp/sign-in-password",{json:Y}),z=U.headers.get("set-auth-token"),Q=_c0.parse(await U.json()),J=z??Q.session?.token;if(!J)throw Error("Failed to retrieve authentication token from login response");return{token:J,user:Q.user}}async function Y40($,Y,U,z){let Q;if(Y.userIdOrPhone.startsWith("+")||/^\d{11}$/.test(Y.userIdOrPhone)){let q=await WM($,Y.userIdOrPhone),V=q.users.find((F)=>F.mobile?.includes(Y.userIdOrPhone)||F._id===Y.userIdOrPhone)??q.users[0];if(!V)throw Error(`User not found with phone/ID: ${Y.userIdOrPhone}`);Q=V}else Q=await HM($,Y.userIdOrPhone).catch(async()=>{let q=await WM($,Y.userIdOrPhone),V=q.users.find((F)=>F.name===Y.userIdOrPhone)??q.users[0];if(!V)throw Error(`User not found: ${Y.userIdOrPhone}`);return V});if(Q.status==="resigned")await Qg($,Q._id),Q=await HM($,Q._id);let J=Q,I=Array.isArray(J.identities)&&J.identities.some((q)=>q.provider&&q.provider!=="local")||!!J.apps?.hosecloud;if(I&&z&&z.source.type==="hose"){let V=(Q.mobile||J.identities?.[0]?.providerId||"").replace(/^\+86/,""),F=J.identities?.find((w)=>w.provider==="hosecloud")?.providerId,M=J.apps?.hosecloud?.boundId||F||(V?`${z.source.corpId}:${V}`:void 0);if(M){let w=await nQ(z),O=(await $M({...z.source,staffId:M},w)).token,D=v7(z,z.source),P=A6(z.seal),T=T8(D,void 0,P),A;try{A=await T.get("api/auth/oauth2/session/oem-hosecloud",{searchParams:{token:O,returnToken:"1"}}).json()}catch(C){if(C instanceof D6&&C.response.status===400)throw Error(`Seal AI 用户“${Q.name}”未绑定合思账号,无法生成个人协助链接。`);throw C}let j=A.token??A.accessToken??A.data?.token;if(j){let C=await U(j),b=await lQ(C,{note:Y.note??`Delegation generated by admin for ${Q.name}`});return{targetUser:Q,delegation:b,temporaryPassword:"N/A (Hose SSO)"}}}}let K;try{K=await Ug($,Q._id)}catch(q){if(I)throw Error(`用户 "${Q.name}" (${Q.mobile||Q._id}) 为合思同步账号 (provider: hosecloud),无 Seal 本地密码。`+"Seal 系统暂不支持对同步账号直接重置本地密码。");throw q}let H=(Q.mobile||Q.identities?.[0]?.providerId||"").replace(/^\+86/,"");if(!H)throw Error(`User ${Q.name} has no associated phone number for password login`);let{token:W}=await hc0($,{phone:H,password:K.password}),X=await U(W),Z=await lQ(X,{note:Y.note??`Delegation generated by admin for ${Q.name}`});return{targetUser:Q,delegation:Z,temporaryPassword:K.password}}async function U40($){return M1(await $.get("api/v1/llm/config"),z10)}async function z40($){return M1(await $.get("api/v1/llm/providers"),L.array(Q10))}async function Q40($){return M1(await $.get("api/v1/permissions/available"),J10)}async function J40($){return M1(await $.get("api/v1/permissions/configs"),I10)}async function nY($){return M1(await $.get("api/v1/billing/status"),K10)}async function I40($){let U=await(await $.get("api/v1/billing/plans")).json();return M10.parse(U.data??U)}async function K40($){let U=await(await $.get("api/v1/billing/features")).json();return M10.parse(U.data??U)}var XM,Rc0,_c0,M10;var X6=m(()=>{iQ();A$();mQ();t9();i8();rS();XM=L.object({success:L.boolean().optional()}).passthrough(),Rc0=L.object({items:L.array(L.object({_id:L.string()})).optional()}).passthrough(),_c0=L.object({user:L.unknown().optional(),session:L.object({token:L.string().optional()}).optional()}).passthrough(),M10=L.json()});var Y6=E((in1,H40)=>{var{toString:G40}=Object.prototype,Sc0=/["&<>]/,$3={each:function(Y,U){if(Y)if(Array.isArray(Y))Y.forEach(U);else Object.keys(Y).forEach((z)=>{U(Y[z],z)})},some:function(Y,U){if(Y){if(Array.isArray(Y))return Y.some(U);return Object.keys(Y).some((z)=>U(Y[z],z))}return!1},every:function(Y,U){if(Y){if(Array.isArray(Y))return Y.every(U);return Object.keys(Y).every((z)=>U(Y[z],z))}return!0},map:function(Y,U){if(Y){if(Array.isArray(Y))return Y.map(U);return Object.keys(Y).map((z)=>U(Y[z],z))}return[]},keyBy($,Y){return $.reduce((U,z)=>{return U[z[Y]]=z,U},{})},isEqual:function(Y,U){let z=typeof Y,Q=typeof U,J=Array.isArray(Y),I=Array.isArray(U),K;if(z!==Q)return!1;switch(typeof Y){case"object":if(J||I){if(J&&I)return Y.length===U.length&&Y.every((G,H)=>{let W=U[H];return $3.isEqual(G,W)});return!1}if(Y===null||U===null)return Y===U;if(K=Object.keys(Y),Object.keys(U).length!==K.length)return!1;for(let G of K)if(!U.hasOwnProperty(G))return!1;return $3.every(Y,(G,H)=>{let W=U[H];return $3.isEqual(G,W)});default:return Y===U}},escapeHtml($){let Y=Sc0.exec($);if(!Y)return $;let U="",z="",Q=0,J=Y.index;for(;J<$.length;J++){switch($.charAt(J)){case'"':z=""";break;case"&":z="&";break;case"'":z="'";break;case"<":z="<";break;case">":z=">";break;default:continue}if(Q!==J)U+=$.substring(Q,J);Q=J+1,U+=z}if(Q!==J)return U+$.substring(Q,J);return U},strcmp($,Y){if($Y)return 1;return 0},isUndefined($){return G40.call($)==="[object Undefined]"},isObject($){return G40.call($)==="[object Object]"},deepMerge(){let $=arguments[0]||{},{length:Y}=arguments,U,z,Q;function J(I,K){if(U=$[K],Q=Array.isArray(I),$3.isObject(I)||Q){if(Q)Q=!1,z=U&&Array.isArray(U)?U:[];else z=U&&$3.isObject(U)?U:{};$[K]=$3.deepMerge(z,I)}else if(!$3.isUndefined(I))$[K]=I}for(let I=0;I{var gc0=/^[A-Z]+\d+$/,yH={_dictionary:["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"],_l2nFill:0,_l2n:{},_n2l:[],_level($){if($<=26)return 1;if($<=676)return 2;return 3},_fill($){let Y,U,z,Q,J,I=1;if($>=4)throw Error("Out of bounds. Excel supports columns from 1 to 16384");if(this._l2nFill<1&&$>=1){while(I<=26)Y=this._dictionary[I-1],this._n2l[I]=Y,this._l2n[Y]=I,I++;this._l2nFill=1}if(this._l2nFill<2&&$>=2){I=27;while(I<=702)U=I-27,z=U%26,Q=Math.floor(U/26),Y=this._dictionary[Q]+this._dictionary[z],this._n2l[I]=Y,this._l2n[Y]=I,I++;this._l2nFill=2}if(this._l2nFill<3&&$>=3){I=703;while(I<=16384)U=I-703,z=U%26,Q=Math.floor(U/26)%26,J=Math.floor(U/676),Y=this._dictionary[J]+this._dictionary[Q]+this._dictionary[z],this._n2l[I]=Y,this._l2n[Y]=I,I++;this._l2nFill=3}},l2n($){if(!this._l2n[$])this._fill($.length);if(!this._l2n[$])throw Error(`Out of bounds. Invalid column letter: ${$}`);return this._l2n[$]},n2l($){if($<1||$>16384)throw Error(`${$} is out of bounds. Excel supports columns from 1 to 16384`);if(!this._n2l[$])this._fill(this._level($));return this._n2l[$]},_hash:{},validateAddress($){if(!gc0.test($))throw Error(`Invalid Address: ${$}`);return!0},decodeAddress($){let Y=$.length<5&&this._hash[$];if(Y)return Y;let U=!1,z="",Q=0,J=!1,I="",K=0;for(let H=0,W;H<$.length;H++)if(W=$.charCodeAt(H),!J&&W>=65&&W<=90)U=!0,z+=$[H],Q=Q*26+W-64;else if(W>=48&&W<=57)J=!0,I+=$[H],K=K*10+W-48;else if(J&&U&&W!==36)break;if(!U)Q=void 0;else if(Q>16384)throw Error(`Out of bounds. Invalid column letter: ${z}`);if(!J)K=void 0;$=z+I;let G={address:$,col:Q,row:K,$col$row:`$${z}$${I}`};if(Q<=100&&K<=100)this._hash[$]=G,this._hash[G.$col$row]=G;return G},getAddress($,Y){if(Y){let U=this.n2l(Y)+$;return this.decodeAddress(U)}return this.decodeAddress($)},decode($){let Y=$.split(":");if(Y.length===2){let U=this.decodeAddress(Y[0]),z=this.decodeAddress(Y[1]),Q={top:Math.min(U.row,z.row),left:Math.min(U.col,z.col),bottom:Math.max(U.row,z.row),right:Math.max(U.col,z.col)};return Q.tl=this.n2l(Q.left)+Q.top,Q.br=this.n2l(Q.right)+Q.bottom,Q.dimensions=`${Q.tl}:${Q.br}`,Q}return this.decodeAddress($)},decodeEx($){let Y=$.match(/(?:(?:(?:'((?:[^']|'')*)')|([^'^ !]*))!)?(.*)/),U=Y[1]||Y[2],z=Y[3],Q=z.split(":");if(Q.length>1){let I=this.decodeAddress(Q[0]),K=this.decodeAddress(Q[1]),G=Math.min(I.row,K.row),H=Math.min(I.col,K.col),W=Math.max(I.row,K.row),X=Math.max(I.col,K.col);return I=this.n2l(H)+G,K=this.n2l(X)+W,{top:G,left:H,bottom:W,right:X,sheetName:U,tl:{address:I,col:H,row:G,$col$row:`$${this.n2l(H)}$${G}`,sheetName:U},br:{address:K,col:X,row:W,$col$row:`$${this.n2l(X)}$${W}`,sheetName:U},dimensions:`${I}:${K}`}}if(z.startsWith("#"))return U?{sheetName:U,error:z}:{error:z};let J=this.decodeAddress(z);return U?{sheetName:U,...J}:J},encodeAddress($,Y){return yH.n2l(Y)+$},encode(){switch(arguments.length){case 2:return yH.encodeAddress(arguments[0],arguments[1]);case 4:return`${yH.encodeAddress(arguments[0],arguments[1])}:${yH.encodeAddress(arguments[2],arguments[3])}`;default:throw Error("Can only encode with 2 or 4 arguments")}},inRange($,Y){let[U,z,,Q,J]=$,[I,K]=Y;return I>=U&&I<=Q&&K>=z&&K<=J}};W40.exports=yH});var Y3=E((nn1,X40)=>{var o5=c4();class Jg{constructor(){this.decode(arguments)}setTLBR($,Y,U,z,Q){if(arguments.length<4){let J=o5.decodeAddress($),I=o5.decodeAddress(Y);this.model={top:Math.min(J.row,I.row),left:Math.min(J.col,I.col),bottom:Math.max(J.row,I.row),right:Math.max(J.col,I.col),sheetName:U},this.setTLBR(J.row,J.col,I.row,I.col,Q)}else this.model={top:Math.min($,U),left:Math.min(Y,z),bottom:Math.max($,U),right:Math.max(Y,z),sheetName:Q}}decode($){switch($.length){case 5:this.setTLBR($[0],$[1],$[2],$[3],$[4]);break;case 4:this.setTLBR($[0],$[1],$[2],$[3]);break;case 3:this.setTLBR($[0],$[1],$[2]);break;case 2:this.setTLBR($[0],$[1]);break;case 1:{let Y=$[0];if(Y instanceof Jg)this.model={top:Y.model.top,left:Y.model.left,bottom:Y.model.bottom,right:Y.model.right,sheetName:Y.sheetName};else if(Y instanceof Array)this.decode(Y);else if(Y.top&&Y.left&&Y.bottom&&Y.right)this.model={top:Y.top,left:Y.left,bottom:Y.bottom,right:Y.right,sheetName:Y.sheetName};else{let U=o5.decodeEx(Y);if(U.top)this.model={top:U.top,left:U.left,bottom:U.bottom,right:U.right,sheetName:U.sheetName};else this.model={top:U.row,left:U.col,bottom:U.row,right:U.col,sheetName:U.sheetName}}break}case 0:this.model={top:0,left:0,bottom:0,right:0};break;default:throw Error(`Invalid number of arguments to _getDimensions() - ${$.length}`)}}get top(){return this.model.top||1}set top($){this.model.top=$}get left(){return this.model.left||1}set left($){this.model.left=$}get bottom(){return this.model.bottom||1}set bottom($){this.model.bottom=$}get right(){return this.model.right||1}set right($){this.model.right=$}get sheetName(){return this.model.sheetName}set sheetName($){this.model.sheetName=$}get _serialisedSheetName(){let{sheetName:$}=this.model;if($){if(/^[a-zA-Z0-9]*$/.test($))return`${$}!`;return`'${$}'!`}return""}expand($,Y,U,z){if(!this.model.top||$this.bottom)this.bottom=U;if(!this.model.right||z>this.right)this.right=z}expandRow($){if($){let{dimensions:Y,number:U}=$;if(Y)this.expand(U,Y.min,U,Y.max)}}expandToAddress($){let Y=o5.decodeEx($);this.expand(Y.row,Y.col,Y.row,Y.col)}get tl(){return o5.n2l(this.left)+this.top}get $t$l(){return`$${o5.n2l(this.left)}$${this.top}`}get br(){return o5.n2l(this.right)+this.bottom}get $b$r(){return`$${o5.n2l(this.right)}$${this.bottom}`}get range(){return`${this._serialisedSheetName+this.tl}:${this.br}`}get $range(){return`${this._serialisedSheetName+this.$t$l}:${this.$b$r}`}get shortRange(){return this.count>1?this.range:this._serialisedSheetName+this.tl}get $shortRange(){return this.count>1?this.$range:this._serialisedSheetName+this.$t$l}get count(){return(1+this.bottom-this.top)*(1+this.right-this.left)}toString(){return this.range}intersects($){if($.sheetName&&this.sheetName&&$.sheetName!==this.sheetName)return!1;if($.bottomthis.bottom)return!1;if($.rightthis.right)return!1;return!0}contains($){let Y=o5.decodeEx($);return this.containsEx(Y)}containsEx($){if($.sheetName&&this.sheetName&&$.sheetName!==this.sheetName)return!1;return $.row>=this.top&&$.row<=this.bottom&&$.col>=this.left&&$.col<=this.right}forEachAddress($){for(let Y=this.left;Y<=this.right;Y++)for(let U=this.top;U<=this.bottom;U++)$(o5.encodeAddress(U,Y),U,Y)}}X40.exports=Jg});var G5=E((pn1,Z40)=>{Z40.exports={ValueType:{Null:0,Merge:1,Number:2,String:3,Date:4,Hyperlink:5,Formula:6,SharedString:7,RichText:8,Boolean:9,Error:10},FormulaType:{None:0,Master:1,Shared:2},RelationshipType:{None:0,OfficeDocument:1,Worksheet:2,CalcChain:3,SharedStrings:4,Styles:5,Theme:6,Hyperlink:7},DocumentType:{Xlsx:1},ReadingOrder:{LeftToRight:1,RightToLeft:2},ErrorValue:{NotApplicable:"#N/A",Ref:"#REF!",Name:"#NAME?",DivZero:"#DIV/0!",Null:"#NULL!",Value:"#VALUE!",Num:"#NUM!"}}});var V40=E((dn1,q40)=>{var PM=c4(),yc0=/(([a-z_\-0-9]*)!)?([a-z0-9_$]{2,})([(])?/gi,kc0=/^([$])?([a-z]+)([$])?([1-9][0-9]*)$/i;function xc0($,Y,U){let z=PM.decode(Y),Q=PM.decode(U);return $.replace(yc0,(J,I,K,G,H)=>{if(H)return J;let W=kc0.exec(G);if(W){let X=W[1],Z=W[2].toUpperCase(),q=W[3],V=W[4];if(Z.length>3||Z.length===3&&Z>"XFD")return J;let F=PM.l2n(Z),M=parseInt(V,10);if(!X)F+=Q.col-z.col;if(!q)M+=Q.row-z.row;return(I||"")+(X||"")+PM.n2l(F)+(q||"")+M}return J})}q40.exports={slideFormula:xc0}});var F40=E((mn1,L40)=>{var fc0=Y6();class kH{constructor($){this.note=$}get model(){let $=null;switch(typeof this.note){case"string":$={type:"note",note:{texts:[{text:this.note}]}};break;default:$={type:"note",note:this.note};break}return fc0.deepMerge({},kH.DEFAULT_CONFIGS,$)}set model($){let{note:Y}=$,{texts:U}=Y;if(U.length===1&&Object.keys(U[0]).length===1)this.note=U[0].text;else this.note=Y}static fromModel($){let Y=new kH;return Y.model=$,Y}}kH.DEFAULT_CONFIGS={note:{margins:{insetmode:"auto",inset:[0.13,0.13,0.25,0.25]},protection:{locked:"True",lockText:"True"},editAs:"absolute"}};L40.exports=kH});var v40=E((ln1,_40)=>{var uc0=c4(),bc0=Y6(),H5=G5(),{slideFormula:ic0}=V40(),w40=F40();class d0{constructor($,Y,U){if(!$||!Y)throw Error("A Cell needs a Row");this._row=$,this._column=Y,uc0.validateAddress(U),this._address=U,this._value=g7.create(d0.Types.Null,this),this.style=this._mergeStyle($.style,Y.style,{}),this._mergeCount=0}get worksheet(){return this._row.worksheet}get workbook(){return this._row.worksheet.workbook}destroy(){delete this.style,delete this._value,delete this._row,delete this._column,delete this._address}get numFmt(){return this.style.numFmt}set numFmt($){this.style.numFmt=$}get font(){return this.style.font}set font($){this.style.font=$}get alignment(){return this.style.alignment}set alignment($){this.style.alignment=$}get border(){return this.style.border}set border($){this.style.border=$}get fill(){return this.style.fill}set fill($){this.style.fill=$}get protection(){return this.style.protection}set protection($){this.style.protection=$}_mergeStyle($,Y,U){let z=$&&$.numFmt||Y&&Y.numFmt;if(z)U.numFmt=z;let Q=$&&$.font||Y&&Y.font;if(Q)U.font=Q;let J=$&&$.alignment||Y&&Y.alignment;if(J)U.alignment=J;let I=$&&$.border||Y&&Y.border;if(I)U.border=I;let K=$&&$.fill||Y&&Y.fill;if(K)U.fill=K;let G=$&&$.protection||Y&&Y.protection;if(G)U.protection=G;return U}get address(){return this._address}get row(){return this._row.number}get col(){return this._column.number}get $col$row(){return`$${this._column.letter}$${this.row}`}get type(){return this._value.type}get effectiveType(){return this._value.effectiveType}toCsvString(){return this._value.toCsvString()}addMergeRef(){this._mergeCount++}releaseMergeRef(){this._mergeCount--}get isMerged(){return this._mergeCount>0||this.type===d0.Types.Merge}merge($,Y){if(this._value.release(),this._value=g7.create(d0.Types.Merge,this,$),!Y)this.style=$.style}unmerge(){if(this.type===d0.Types.Merge)this._value.release(),this._value=g7.create(d0.Types.Null,this),this.style=this._mergeStyle(this._row.style,this._column.style,{})}isMergedTo($){if(this._value.type!==d0.Types.Merge)return!1;return this._value.isMergedTo($)}get master(){if(this.type===d0.Types.Merge)return this._value.master;return this}get isHyperlink(){return this._value.type===d0.Types.Hyperlink}get hyperlink(){return this._value.hyperlink}get value(){return this._value.value}set value($){if(this.type===d0.Types.Merge){this._value.master.value=$;return}this._value.release(),this._value=g7.create(g7.getType($),this,$)}get note(){return this._comment&&this._comment.note}set note($){this._comment=new w40($)}get text(){return this._value.toString()}get html(){return bc0.escapeHtml(this.text)}toString(){return this.text}_upgradeToHyperlink($){if(this.type===d0.Types.String)this._value=g7.create(d0.Types.Hyperlink,this,{text:this._value.value,hyperlink:$})}get formula(){return this._value.formula}get result(){return this._value.result}get formulaType(){return this._value.formulaType}get fullAddress(){let{worksheet:$}=this._row;return{sheetName:$.name,address:this.address,row:this.row,col:this.col}}get name(){return this.names[0]}set name($){this.names=[$]}get names(){return this.workbook.definedNames.getNamesEx(this.fullAddress)}set names($){let{definedNames:Y}=this.workbook;Y.removeAllNames(this.fullAddress),$.forEach((U)=>{Y.addEx(this.fullAddress,U)})}addName($){this.workbook.definedNames.addEx(this.fullAddress,$)}removeName($){this.workbook.definedNames.removeEx(this.fullAddress,$)}removeAllNames(){this.workbook.definedNames.removeAllNames(this.fullAddress)}get _dataValidations(){return this.worksheet.dataValidations}get dataValidation(){return this._dataValidations.find(this.address)}set dataValidation($){this._dataValidations.add(this.address,$)}get model(){let{model:$}=this._value;if($.style=this.style,this._comment)$.comment=this._comment.model;return $}set model($){if(this._value.release(),this._value=g7.create($.type,this),this._value.model=$,$.comment)switch($.comment.type){case"note":this._comment=w40.fromModel($.comment);break}if($.style)this.style=$.style;else this.style={}}}d0.Types=H5.ValueType;class M40{constructor($){this.model={address:$.address,type:d0.Types.Null}}get value(){return null}set value($){}get type(){return d0.Types.Null}get effectiveType(){return d0.Types.Null}get address(){return this.model.address}set address($){this.model.address=$}toCsvString(){return""}release(){}toString(){return""}}class O40{constructor($,Y){this.model={address:$.address,type:d0.Types.Number,value:Y}}get value(){return this.model.value}set value($){this.model.value=$}get type(){return d0.Types.Number}get effectiveType(){return d0.Types.Number}get address(){return this.model.address}set address($){this.model.address=$}toCsvString(){return this.model.value.toString()}release(){}toString(){return this.model.value.toString()}}class N40{constructor($,Y){this.model={address:$.address,type:d0.Types.String,value:Y}}get value(){return this.model.value}set value($){this.model.value=$}get type(){return d0.Types.String}get effectiveType(){return d0.Types.String}get address(){return this.model.address}set address($){this.model.address=$}toCsvString(){return`"${this.model.value.replace(/"/g,'""')}"`}release(){}toString(){return this.model.value}}class D40{constructor($,Y){this.model={address:$.address,type:d0.Types.String,value:Y}}get value(){return this.model.value}set value($){this.model.value=$}toString(){return this.model.value.richText.map(($)=>$.text).join("")}get type(){return d0.Types.RichText}get effectiveType(){return d0.Types.RichText}get address(){return this.model.address}set address($){this.model.address=$}toCsvString(){return`"${this.text.replace(/"/g,'""')}"`}release(){}}class A40{constructor($,Y){this.model={address:$.address,type:d0.Types.Date,value:Y}}get value(){return this.model.value}set value($){this.model.value=$}get type(){return d0.Types.Date}get effectiveType(){return d0.Types.Date}get address(){return this.model.address}set address($){this.model.address=$}toCsvString(){return this.model.value.toISOString()}release(){}toString(){return this.model.value.toString()}}class B40{constructor($,Y){if(this.model={address:$.address,type:d0.Types.Hyperlink,text:Y?Y.text:void 0,hyperlink:Y?Y.hyperlink:void 0},Y&&Y.tooltip)this.model.tooltip=Y.tooltip}get value(){let $={text:this.model.text,hyperlink:this.model.hyperlink};if(this.model.tooltip)$.tooltip=this.model.tooltip;return $}set value($){if(this.model={text:$.text,hyperlink:$.hyperlink},$.tooltip)this.model.tooltip=$.tooltip}get text(){return this.model.text}set text($){this.model.text=$}get hyperlink(){return this.model.hyperlink}set hyperlink($){this.model.hyperlink=$}get type(){return d0.Types.Hyperlink}get effectiveType(){return d0.Types.Hyperlink}get address(){return this.model.address}set address($){this.model.address=$}toCsvString(){return this.model.hyperlink}release(){}toString(){return this.model.text}}class P40{constructor($,Y){if(this.model={address:$.address,type:d0.Types.Merge,master:Y?Y.address:void 0},this._master=Y,Y)Y.addMergeRef()}get value(){return this._master.value}set value($){if($ instanceof d0){if(this._master)this._master.releaseMergeRef();$.addMergeRef(),this._master=$}else this._master.value=$}isMergedTo($){return $===this._master}get master(){return this._master}get type(){return d0.Types.Merge}get effectiveType(){return this._master.effectiveType}get address(){return this.model.address}set address($){this.model.address=$}toCsvString(){return""}release(){this._master.releaseMergeRef()}toString(){return this.value.toString()}}class T40{constructor($,Y){this.cell=$,this.model={address:$.address,type:d0.Types.Formula,shareType:Y?Y.shareType:void 0,ref:Y?Y.ref:void 0,formula:Y?Y.formula:void 0,sharedFormula:Y?Y.sharedFormula:void 0,result:Y?Y.result:void 0}}_copyModel($){let Y={},U=(z)=>{let Q=$[z];if(Q)Y[z]=Q};return U("formula"),U("result"),U("ref"),U("shareType"),U("sharedFormula"),Y}get value(){return this._copyModel(this.model)}set value($){this.model=this._copyModel($)}validate($){switch(g7.getType($)){case d0.Types.Null:case d0.Types.String:case d0.Types.Number:case d0.Types.Date:break;case d0.Types.Hyperlink:case d0.Types.Formula:default:throw Error("Cannot process that type of result value")}}get dependencies(){let $=this.formula.match(/([a-zA-Z0-9]+!)?[A-Z]{1,3}\d{1,4}:[A-Z]{1,3}\d{1,4}/g),Y=this.formula.replace(/([a-zA-Z0-9]+!)?[A-Z]{1,3}\d{1,4}:[A-Z]{1,3}\d{1,4}/g,"").match(/([a-zA-Z0-9]+!)?[A-Z]{1,3}\d{1,4}/g);return{ranges:$,cells:Y}}get formula(){return this.model.formula||this._getTranslatedFormula()}set formula($){this.model.formula=$}get formulaType(){if(this.model.formula)return H5.FormulaType.Master;if(this.model.sharedFormula)return H5.FormulaType.Shared;return H5.FormulaType.None}get result(){return this.model.result}set result($){this.model.result=$}get type(){return d0.Types.Formula}get effectiveType(){let $=this.model.result;if($===null||$===void 0)return H5.ValueType.Null;if($ instanceof String||typeof $==="string")return H5.ValueType.String;if(typeof $==="number")return H5.ValueType.Number;if($ instanceof Date)return H5.ValueType.Date;if($.text&&$.hyperlink)return H5.ValueType.Hyperlink;if($.formula)return H5.ValueType.Formula;return H5.ValueType.Null}get address(){return this.model.address}set address($){this.model.address=$}_getTranslatedFormula(){if(!this._translatedFormula&&this.model.sharedFormula){let{worksheet:$}=this.cell,Y=$.findCell(this.model.sharedFormula);this._translatedFormula=Y&&ic0(Y.formula,Y.address,this.model.address)}return this._translatedFormula}toCsvString(){return`${this.model.result||""}`}release(){}toString(){return this.model.result?this.model.result.toString():""}}class j40{constructor($,Y){this.model={address:$.address,type:d0.Types.SharedString,value:Y}}get value(){return this.model.value}set value($){this.model.value=$}get type(){return d0.Types.SharedString}get effectiveType(){return d0.Types.SharedString}get address(){return this.model.address}set address($){this.model.address=$}toCsvString(){return this.model.value.toString()}release(){}toString(){return this.model.value.toString()}}class E40{constructor($,Y){this.model={address:$.address,type:d0.Types.Boolean,value:Y}}get value(){return this.model.value}set value($){this.model.value=$}get type(){return d0.Types.Boolean}get effectiveType(){return d0.Types.Boolean}get address(){return this.model.address}set address($){this.model.address=$}toCsvString(){return this.model.value?1:0}release(){}toString(){return this.model.value.toString()}}class C40{constructor($,Y){this.model={address:$.address,type:d0.Types.Error,value:Y}}get value(){return this.model.value}set value($){this.model.value=$}get type(){return d0.Types.Error}get effectiveType(){return d0.Types.Error}get address(){return this.model.address}set address($){this.model.address=$}toCsvString(){return this.toString()}release(){}toString(){return this.model.value.error.toString()}}class R40{constructor($,Y){this.model={address:$.address,type:d0.Types.String,value:JSON.stringify(Y),rawValue:Y}}get value(){return this.model.rawValue}set value($){this.model.rawValue=$,this.model.value=JSON.stringify($)}get type(){return d0.Types.String}get effectiveType(){return d0.Types.String}get address(){return this.model.address}set address($){this.model.address=$}toCsvString(){return this.model.value}release(){}toString(){return this.model.value}}var g7={getType($){if($===null||$===void 0)return d0.Types.Null;if($ instanceof String||typeof $==="string")return d0.Types.String;if(typeof $==="number")return d0.Types.Number;if(typeof $==="boolean")return d0.Types.Boolean;if($ instanceof Date)return d0.Types.Date;if($.text&&$.hyperlink)return d0.Types.Hyperlink;if($.formula||$.sharedFormula)return d0.Types.Formula;if($.richText)return d0.Types.RichText;if($.sharedString)return d0.Types.SharedString;if($.error)return d0.Types.Error;return d0.Types.JSON},types:[{t:d0.Types.Null,f:M40},{t:d0.Types.Number,f:O40},{t:d0.Types.String,f:N40},{t:d0.Types.Date,f:A40},{t:d0.Types.Hyperlink,f:B40},{t:d0.Types.Formula,f:T40},{t:d0.Types.Merge,f:P40},{t:d0.Types.JSON,f:R40},{t:d0.Types.SharedString,f:j40},{t:d0.Types.RichText,f:D40},{t:d0.Types.Boolean,f:E40},{t:d0.Types.Error,f:C40}].reduce(($,Y)=>{return $[Y.t]=Y.f,$},[]),create($,Y,U){let z=this.types[$];if(!z)throw Error(`Could not create Value of type ${$}`);return new z(Y,U)}};_40.exports=d0});var jM=E((on1,g40)=>{var cc0=Y6(),TM=G5(),pY=c4(),h40=v40();class S40{constructor($,Y){this._worksheet=$,this._number=Y,this._cells=[],this.style={},this.outlineLevel=0}get number(){return this._number}get worksheet(){return this._worksheet}commit(){this._worksheet._commitRow(this)}destroy(){delete this._worksheet,delete this._cells,delete this.style}findCell($){return this._cells[$-1]}getCellEx($){let Y=this._cells[$.col-1];if(!Y){let U=this._worksheet.getColumn($.col);Y=new h40(this,U,$.address),this._cells[$.col-1]=Y}return Y}getCell($){if(typeof $==="string"){let Y=this._worksheet.getColumnKey($);if(Y)$=Y.number;else $=pY.l2n($)}return this._cells[$-1]||this.getCellEx({address:pY.encodeAddress(this._number,$),row:this._number,col:$})}splice($,Y,...U){let z=$+Y,Q=U.length-Y,J=this._cells.length,I,K,G;if(Q<0){for(I=$+U.length;I<=J;I++)if(G=this._cells[I-1],K=this._cells[I-Q-1],K)G=this.getCell(I),G.value=K.value,G.style=K.style,G._comment=K._comment;else if(G)G.value=null,G.style={},G._comment=void 0}else if(Q>0)for(I=J;I>=z;I--)if(K=this._cells[I-1],K)G=this.getCell(I+Q),G.value=K.value,G.style=K.style,G._comment=K._comment;else this._cells[I+Q-1]=void 0;for(I=0;I{if(U&&U.type!==TM.ValueType.Null)Y(U,z+1)})}addPageBreak($,Y){let U=this._worksheet,z=Math.max(0,$-1)||0,Q=Math.max(0,Y-1)||16838,J={id:this._number,max:Q,man:1};if(z)J.min=z;U.rowBreaks.push(J)}get values(){let $=[];return this._cells.forEach((Y)=>{if(Y&&Y.type!==TM.ValueType.Null)$[Y.col]=Y.value}),$}set values($){if(this._cells=[],!$);else if($ instanceof Array){let Y=0;if($.hasOwnProperty("0"))Y=1;$.forEach((U,z)=>{if(U!==void 0)this.getCellEx({address:pY.encodeAddress(this._number,z+Y),row:this._number,col:z+Y}).value=U})}else this._worksheet.eachColumnKey((Y,U)=>{if($[U]!==void 0)this.getCellEx({address:pY.encodeAddress(this._number,Y.number),row:this._number,col:Y.number}).value=$[U]})}get hasValues(){return cc0.some(this._cells,($)=>$&&$.type!==TM.ValueType.Null)}get cellCount(){return this._cells.length}get actualCellCount(){let $=0;return this.eachCell(()=>{$++}),$}get dimensions(){let $=0,Y=0;return this._cells.forEach((U)=>{if(U&&U.type!==TM.ValueType.Null){if(!$||$>U.col)$=U.col;if(Y0?{min:$,max:Y}:null}_applyStyle($,Y){return this.style[$]=Y,this._cells.forEach((U)=>{if(U)U[$]=Y}),Y}get numFmt(){return this.style.numFmt}set numFmt($){this._applyStyle("numFmt",$)}get font(){return this.style.font}set font($){this._applyStyle("font",$)}get alignment(){return this.style.alignment}set alignment($){this._applyStyle("alignment",$)}get protection(){return this.style.protection}set protection($){this._applyStyle("protection",$)}get border(){return this.style.border}set border($){this._applyStyle("border",$)}get fill(){return this.style.fill}set fill($){this._applyStyle("fill",$)}get hidden(){return!!this._hidden}set hidden($){this._hidden=$}get outlineLevel(){return this._outlineLevel||0}set outlineLevel($){this._outlineLevel=$}get collapsed(){return!!(this._outlineLevel&&this._outlineLevel>=this._worksheet.properties.outlineLevelRow)}get model(){let $=[],Y=0,U=0;return this._cells.forEach((z)=>{if(z){let Q=z.model;if(Q){if(!Y||Y>z.col)Y=z.col;if(U{switch(U.type){case h40.Types.Merge:break;default:{let z;if(U.address)z=pY.decodeAddress(U.address);else if(Y){let{row:J}=Y,I=Y.col+1;z={row:J,col:I,address:pY.encodeAddress(J,I),$col$row:`$${pY.n2l(I)}$${J}`}}Y=z;let Q=this.getCellEx(z);Q.model=U;break}}}),$.height)this.height=$.height;else delete this.height;this.hidden=$.hidden,this.outlineLevel=$.outlineLevel||0,this.style=$.style&&JSON.parse(JSON.stringify($.style))||{}}}g40.exports=S40});var CM=E((rn1,y40)=>{var nc0=Y6(),pc0=G5(),dc0=c4();class EM{constructor($,Y,U){if(this._worksheet=$,this._number=Y,U!==!1)this.defn=U}get number(){return this._number}get worksheet(){return this._worksheet}get letter(){return dc0.n2l(this._number)}get isCustomWidth(){return this.width!==void 0&&this.width!==9}get defn(){return{header:this._header,key:this.key,width:this.width,style:this.style,hidden:this.hidden,outlineLevel:this.outlineLevel}}set defn($){if($){if(this.key=$.key,this.width=$.width!==void 0?$.width:9,this.outlineLevel=$.outlineLevel,$.style)this.style=$.style;else this.style={};this.header=$.header,this._hidden=!!$.hidden}else delete this._header,delete this._key,delete this.width,this.style={},this.outlineLevel=0}get headers(){return this._header&&this._header instanceof Array?this._header:[this._header]}get header(){return this._header}set header($){if($!==void 0)this._header=$,this.headers.forEach((Y,U)=>{this._worksheet.getCell(U+1,this.number).value=Y});else this._header=void 0}get key(){return this._key}set key($){if((this._key&&this._worksheet.getColumnKey(this._key))===this)this._worksheet.deleteColumnKey(this._key);if(this._key=$,$)this._worksheet.setColumnKey(this._key,this)}get hidden(){return!!this._hidden}set hidden($){this._hidden=$}get outlineLevel(){return this._outlineLevel||0}set outlineLevel($){this._outlineLevel=$}get collapsed(){return!!(this._outlineLevel&&this._outlineLevel>=this._worksheet.properties.outlineLevelCol)}toString(){return JSON.stringify({key:this.key,width:this.width,headers:this.headers.length?this.headers:void 0})}equivalentTo($){return this.width===$.width&&this.hidden===$.hidden&&this.outlineLevel===$.outlineLevel&&nc0.isEqual(this.style,$.style)}get isDefault(){if(this.isCustomWidth)return!1;if(this.hidden)return!1;if(this.outlineLevel)return!1;let $=this.style;if($&&($.font||$.numFmt||$.alignment||$.border||$.fill||$.protection))return!1;return!0}get headerCount(){return this.headers.length}eachCell($,Y){let U=this.number;if(!Y)Y=$,$=null;this._worksheet.eachRow($,(z,Q)=>{Y(z.getCell(U),Q)})}get values(){let $=[];return this.eachCell((Y,U)=>{if(Y&&Y.type!==pc0.ValueType.Null)$[U]=Y.value}),$}set values($){if(!$)return;let Y=this.number,U=0;if($.hasOwnProperty("0"))U=1;$.forEach((z,Q)=>{this._worksheet.getCell(Q+U,Y).value=z})}_applyStyle($,Y){return this.style[$]=Y,this.eachCell((U)=>{U[$]=Y}),Y}get numFmt(){return this.style.numFmt}set numFmt($){this._applyStyle("numFmt",$)}get font(){return this.style.font}set font($){this._applyStyle("font",$)}get alignment(){return this.style.alignment}set alignment($){this._applyStyle("alignment",$)}get protection(){return this.style.protection}set protection($){this._applyStyle("protection",$)}get border(){return this.style.border}set border($){this._applyStyle("border",$)}get fill(){return this.style.fill}set fill($){this._applyStyle("fill",$)}static toModel($){let Y=[],U=null;if($)$.forEach((z,Q)=>{if(z.isDefault){if(U)U=null}else if(!U||!z.equivalentTo(U))U={min:Q+1,max:Q+1,width:z.width!==void 0?z.width:9,style:z.style,isCustomWidth:z.isCustomWidth,hidden:z.hidden,outlineLevel:z.outlineLevel,collapsed:z.collapsed},Y.push(U);else U.max=Q+1});return Y.length?Y:void 0}static fromModel($,Y){Y=Y||[];let U=[],z=1,Q=0;Y=Y.sort(function(J,I){return J.min-I.min});while(Q{var mc0=c4();class RM{constructor($,Y,U=0){if(this.worksheet=$,!Y)this.nativeCol=0,this.nativeColOff=0,this.nativeRow=0,this.nativeRowOff=0;else if(typeof Y==="string"){let z=mc0.decodeAddress(Y);this.nativeCol=z.col+U,this.nativeColOff=0,this.nativeRow=z.row+U,this.nativeRowOff=0}else if(Y.nativeCol!==void 0)this.nativeCol=Y.nativeCol||0,this.nativeColOff=Y.nativeColOff||0,this.nativeRow=Y.nativeRow||0,this.nativeRowOff=Y.nativeRowOff||0;else if(Y.col!==void 0)this.col=Y.col+U,this.row=Y.row+U;else this.nativeCol=0,this.nativeColOff=0,this.nativeRow=0,this.nativeRowOff=0}static asInstance($){return $ instanceof RM||$==null?$:new RM($)}get col(){return this.nativeCol+Math.min(this.colWidth-1,this.nativeColOff)/this.colWidth}set col($){this.nativeCol=Math.floor($),this.nativeColOff=Math.floor(($-this.nativeCol)*this.colWidth)}get row(){return this.nativeRow+Math.min(this.rowHeight-1,this.nativeRowOff)/this.rowHeight}set row($){this.nativeRow=Math.floor($),this.nativeRowOff=Math.floor(($-this.nativeRow)*this.rowHeight)}get colWidth(){return this.worksheet&&this.worksheet.getColumn(this.nativeCol+1)&&this.worksheet.getColumn(this.nativeCol+1).isCustomWidth?Math.floor(this.worksheet.getColumn(this.nativeCol+1).width*1e4):640000}get rowHeight(){return this.worksheet&&this.worksheet.getRow(this.nativeRow+1)&&this.worksheet.getRow(this.nativeRow+1).height?Math.floor(this.worksheet.getRow(this.nativeRow+1).height*1e4):180000}get model(){return{nativeCol:this.nativeCol,nativeColOff:this.nativeColOff,nativeRow:this.nativeRow,nativeRowOff:this.nativeRowOff}}set model($){this.nativeCol=$.nativeCol,this.nativeColOff=$.nativeColOff,this.nativeRow=$.nativeRow,this.nativeRowOff=$.nativeRowOff}}k40.exports=RM});var b40=E((an1,u40)=>{var lc0=c4(),_M=x40();class f40{constructor($,Y){this.worksheet=$,this.model=Y}get model(){switch(this.type){case"background":return{type:this.type,imageId:this.imageId};case"image":return{type:this.type,imageId:this.imageId,hyperlinks:this.range.hyperlinks,range:{tl:this.range.tl.model,br:this.range.br&&this.range.br.model,ext:this.range.ext,editAs:this.range.editAs}};default:throw Error("Invalid Image Type")}}set model({type:$,imageId:Y,range:U,hyperlinks:z}){if(this.type=$,this.imageId=Y,$==="image")if(typeof U==="string"){let Q=lc0.decode(U);this.range={tl:new _M(this.worksheet,{col:Q.left,row:Q.top},-1),br:new _M(this.worksheet,{col:Q.right,row:Q.bottom},0),editAs:"oneCell"}}else this.range={tl:new _M(this.worksheet,U.tl,0),br:U.br&&new _M(this.worksheet,U.br,0),ext:U.ext,editAs:U.editAs,hyperlinks:z||U.hyperlinks}}}u40.exports=f40});var p40=E((tn1,n40)=>{var vM=c4();class i40{constructor($,Y,U){this.table=$,this.column=Y,this.index=U}_set($,Y){this.table.cacheState(),this.column[$]=Y}get name(){return this.column.name}set name($){this._set("name",$)}get filterButton(){return this.column.filterButton}set filterButton($){this.column.filterButton=$}get style(){return this.column.style}set style($){this.column.style=$}get totalsRowLabel(){return this.column.totalsRowLabel}set totalsRowLabel($){this._set("totalsRowLabel",$)}get totalsRowFunction(){return this.column.totalsRowFunction}set totalsRowFunction($){this._set("totalsRowFunction",$)}get totalsRowResult(){return this.column.totalsRowResult}set totalsRowResult($){this._set("totalsRowResult",$)}get totalsRowFormula(){return this.column.totalsRowFormula}set totalsRowFormula($){this._set("totalsRowFormula",$)}}class c40{constructor($,Y){if(this.worksheet=$,Y)this.table=Y,this.validate(),this.store()}getFormula($){switch($.totalsRowFunction){case"none":return null;case"average":return`SUBTOTAL(101,${this.table.name}[${$.name}])`;case"countNums":return`SUBTOTAL(102,${this.table.name}[${$.name}])`;case"count":return`SUBTOTAL(103,${this.table.name}[${$.name}])`;case"max":return`SUBTOTAL(104,${this.table.name}[${$.name}])`;case"min":return`SUBTOTAL(105,${this.table.name}[${$.name}])`;case"stdDev":return`SUBTOTAL(106,${this.table.name}[${$.name}])`;case"var":return`SUBTOTAL(107,${this.table.name}[${$.name}])`;case"sum":return`SUBTOTAL(109,${this.table.name}[${$.name}])`;case"custom":return $.totalsRowFormula;default:throw Error(`Invalid Totals Row Function: ${$.totalsRowFunction}`)}}get width(){return this.table.columns.length}get height(){return this.table.rows.length}get filterHeight(){return this.height+(this.table.headerRow?1:0)}get tableHeight(){return this.filterHeight+(this.table.totalsRow?1:0)}validate(){let{table:$}=this,Y=(G,H,W)=>{if(G[H]===void 0)G[H]=W};Y($,"headerRow",!0),Y($,"totalsRow",!1),Y($,"style",{}),Y($.style,"theme","TableStyleMedium2"),Y($.style,"showFirstColumn",!1),Y($.style,"showLastColumn",!1),Y($.style,"showRowStripes",!1),Y($.style,"showColumnStripes",!1);let U=(G,H)=>{if(!G)throw Error(H)};U($.ref,"Table must have ref"),U($.columns,"Table must have column definitions"),U($.rows,"Table must have row definitions"),$.tl=vM.decodeAddress($.ref);let{row:z,col:Q}=$.tl;U(z>0,"Table must be on valid row"),U(Q>0,"Table must be on valid col");let{width:J,filterHeight:I,tableHeight:K}=this;$.autoFilterRef=vM.encode(z,Q,z+I-1,Q+J-1),$.tableRef=vM.encode(z,Q,z+K-1,Q+J-1),$.columns.forEach((G,H)=>{if(U(G.name,`Column ${H} must have a name`),H===0)Y(G,"totalsRowLabel","Total");else Y(G,"totalsRowFunction","none"),G.totalsRowFormula=this.getFormula(G)})}store(){let $=(I,K)=>{if(K)Object.keys(K).forEach((G)=>{I[G]=K[G]})},{worksheet:Y,table:U}=this,{row:z,col:Q}=U.tl,J=0;if(U.headerRow){let I=Y.getRow(z+J++);U.columns.forEach((K,G)=>{let{style:H,name:W}=K,X=I.getCell(Q+G);X.value=W,$(X,H)})}if(U.rows.forEach((I)=>{let K=Y.getRow(z+J++);I.forEach((G,H)=>{let W=K.getCell(Q+H);W.value=G,$(W,U.columns[H].style)})}),U.totalsRow){let I=Y.getRow(z+J++);U.columns.forEach((K,G)=>{let H=I.getCell(Q+G);if(G===0)H.value=K.totalsRowLabel;else if(this.getFormula(K))H.value={formula:K.totalsRowFormula,result:K.totalsRowResult};else H.value=null;$(H,K.style)})}}load($){let{table:Y}=this,{row:U,col:z}=Y.tl,Q=0;if(Y.headerRow){let J=$.getRow(U+Q++);Y.columns.forEach((I,K)=>{let G=J.getCell(z+K);G.value=I.name})}if(Y.rows.forEach((J)=>{let I=$.getRow(U+Q++);J.forEach((K,G)=>{let H=I.getCell(z+G);H.value=K})}),Y.totalsRow){let J=$.getRow(U+Q++);Y.columns.forEach((I,K)=>{let G=J.getCell(z+K);if(K===0)G.value=I.totalsRowLabel;else if(this.getFormula(I))G.value={formula:I.totalsRowFormula,result:I.totalsRowResult}})}}get model(){return this.table}set model($){this.table=$}cacheState(){if(!this._cache)this._cache={ref:this.ref,width:this.width,tableHeight:this.tableHeight}}commit(){if(!this._cache)return;this.validate();let $=vM.decodeAddress(this._cache.ref);if(this.ref!==this._cache.ref)for(let Y=0;Y{z.push(Y[Q])});else this.table.columns.splice(U,0,$),this.table.rows.forEach((z,Q)=>{z.splice(U,0,Y[Q])})}removeColumns($,Y=1){this.cacheState(),this.table.columns.splice($,Y),this.table.rows.forEach((U)=>{U.splice($,Y)})}_assign($,Y,U){this.cacheState(),$[Y]=U}get ref(){return this.table.ref}set ref($){this._assign(this.table,"ref",$)}get name(){return this.table.name}set name($){this.table.name=$}get displayName(){return this.table.displyName||this.table.name}set displayNamename($){this.table.displayName=$}get headerRow(){return this.table.headerRow}set headerRow($){this._assign(this.table,"headerRow",$)}get totalsRow(){return this.table.totalsRow}set totalsRow($){this._assign(this.table,"totalsRow",$)}get theme(){return this.table.style.name}set theme($){this.table.style.name=$}get showFirstColumn(){return this.table.style.showFirstColumn}set showFirstColumn($){this.table.style.showFirstColumn=$}get showLastColumn(){return this.table.style.showLastColumn}set showLastColumn($){this.table.style.showLastColumn=$}get showRowStripes(){return this.table.style.showRowStripes}set showRowStripes($){this.table.style.showRowStripes=$}get showColumnStripes(){return this.table.style.showColumnStripes}set showColumnStripes($){this.table.style.showColumnStripes=$}}n40.exports=c40});var Ig=E((en1,m40)=>{class d40{constructor($){this.model=$||{}}add($,Y){return this.model[$]=Y}find($){return this.model[$]}remove($){this.model[$]=void 0}}m40.exports=d40});var Gg=E(($p1,l40)=>{var Kg=I0("crypto"),oc0={hash($,...Y){let U=Kg.createHash($);return U.update(Buffer.concat(Y)),U.digest()},convertPasswordToHash($,Y,U,z){if(Y=Y.toLowerCase(),Kg.getHashes().indexOf(Y)<0)throw Error(`Hash algorithm '${Y}' not supported!`);let J=Buffer.from($,"utf16le"),I=this.hash(Y,Buffer.from(U,"base64"),J);for(let K=0;K{var o40=($,Y)=>({...$,...Y.reduce((U,z)=>{if($[z])U[z]={...$[z]};return U},{})}),r5=($,Y,U,z=[])=>{if($[U])Y[U]=o40($[U],z)},rc0=($)=>Object.keys($).length===0,sc0=($)=>{if(!$)return $;if(rc0($))return{};let Y={...$};if(r5($,Y,"font",["color"]),r5($,Y,"alignment"),r5($,Y,"protection"),$.border)r5($,Y,"border"),r5($.border,Y.border,"top",["color"]),r5($.border,Y.border,"left",["color"]),r5($.border,Y.border,"bottom",["color"]),r5($.border,Y.border,"right",["color"]),r5($.border,Y.border,"diagonal",["color"]);if($.fill){if(r5($,Y,"fill",["fgColor","bgColor","center"]),$.fill.stops)Y.fill.stops=$.fill.stops.map((U)=>o40(U,["color"]))}return Y};ac0.copyStyle=sc0});var z60=E((Up1,U60)=>{var xH=Y6(),fH=c4(),uH=Y3(),s40=jM(),hM=CM(),ec0=G5(),Hg=b40(),a40=p40(),t40=Ig(),e40=Gg(),{copyStyle:$60}=r40();class Y60{constructor($){$=$||{},this._workbook=$.workbook,this.id=$.id,this.orderNo=$.orderNo,this.name=$.name,this.state=$.state||"visible",this._rows=[],this._columns=null,this._keys={},this._merges={},this.rowBreaks=[],this.properties=Object.assign({},{defaultRowHeight:15,dyDescent:55,outlineLevelCol:0,outlineLevelRow:0},$.properties),this.pageSetup=Object.assign({},{margins:{left:0.7,right:0.7,top:0.75,bottom:0.75,header:0.3,footer:0.3},orientation:"portrait",horizontalDpi:4294967295,verticalDpi:4294967295,fitToPage:!!($.pageSetup&&($.pageSetup.fitToWidth||$.pageSetup.fitToHeight)&&!$.pageSetup.scale),pageOrder:"downThenOver",blackAndWhite:!1,draft:!1,cellComments:"None",errors:"displayed",scale:100,fitToWidth:1,fitToHeight:1,paperSize:void 0,showRowColHeaders:!1,showGridLines:!1,firstPageNumber:void 0,horizontalCentered:!1,verticalCentered:!1,rowBreaks:null,colBreaks:null},$.pageSetup),this.headerFooter=Object.assign({},{differentFirst:!1,differentOddEven:!1,oddHeader:null,oddFooter:null,evenHeader:null,evenFooter:null,firstHeader:null,firstFooter:null},$.headerFooter),this.dataValidations=new t40,this.views=$.views||[],this.autoFilter=$.autoFilter||null,this._media=[],this.sheetProtection=null,this.tables={},this.conditionalFormattings=[]}get name(){return this._name}set name($){if($===void 0)$=`sheet${this.id}`;if(this._name===$)return;if(typeof $!=="string")throw Error("The name has to be a string.");if($==="")throw Error("The name can't be empty.");if($==="History")throw Error('The name "History" is protected. Please use a different name.');if(/[*?:/\\[\]]/.test($))throw Error(`Worksheet name ${$} cannot include any of the following characters: * ? : \\ / [ ]`);if(/(^')|('$)/.test($))throw Error(`The first or last character of worksheet name cannot be a single quotation mark: ${$}`);if($&&$.length>31)console.warn(`Worksheet name ${$} exceeds 31 chars. This will be truncated`),$=$.substring(0,31);if(this._workbook._worksheets.find((Y)=>Y&&Y.name.toLowerCase()===$.toLowerCase()))throw Error(`Worksheet name already exists: ${$}`);this._name=$}get workbook(){return this._workbook}destroy(){this._workbook.removeWorksheetEx(this)}get dimensions(){let $=new uH;return this._rows.forEach((Y)=>{if(Y){let U=Y.dimensions;if(U)$.expand(Y.number,U.min,Y.number,U.max)}}),$}get columns(){return this._columns}set columns($){this._headerRowCount=$.reduce((z,Q)=>{let J=Q.header&&1||Q.headers&&Q.headers.length||0;return Math.max(z,J)},0);let Y=1,U=this._columns=[];$.forEach((z)=>{let Q=new hM(this,Y++,!1);U.push(Q),Q.defn=z})}getColumnKey($){return this._keys[$]}setColumnKey($,Y){this._keys[$]=Y}deleteColumnKey($){delete this._keys[$]}eachColumnKey($){xH.each(this._keys,$)}getColumn($){if(typeof $==="string"){let Y=this._keys[$];if(Y)return Y;$=fH.l2n($)}if(!this._columns)this._columns=[];if($>this._columns.length){let Y=this._columns.length+1;while(Y<=$)this._columns.push(new hM(this,Y++))}return this._columns[$-1]}spliceColumns($,Y,...U){let Q=this._rows.length;if(U.length>0)for(let G=0;G{H.push(X[G]||null)});let W=this.getRow(G+1);W.splice.apply(W,H)}else this._rows.forEach((G)=>{if(G)G.splice($,Y)});let J=U.length-Y,I=$+Y,K=this._columns.length;if(J<0)for(let G=$+U.length;G<=K;G++)this.getColumn(G).defn=this.getColumn(G-J).defn;else if(J>0)for(let G=K;G>=I;G--)this.getColumn(G+J).defn=this.getColumn(G).defn;for(let G=$;G<$+U.length;G++)this.getColumn(G).defn=null;this.workbook.definedNames.spliceColumns(this.name,$,Y,U.length)}get lastColumn(){return this.getColumn(this.columnCount)}get columnCount(){let $=0;return this.eachRow((Y)=>{$=Math.max($,Y.cellCount)}),$}get actualColumnCount(){let $=[],Y=0;return this.eachRow((U)=>{U.eachCell(({col:z})=>{if(!$[z])$[z]=!0,Y++})}),Y}_commitRow(){}get _lastRowNumber(){let $=this._rows,Y=$.length;while(Y>0&&$[Y-1]===void 0)Y--;return Y}get _nextRow(){return this._lastRowNumber+1}get lastRow(){if(this._rows.length)return this._rows[this._rows.length-1];return}findRow($){return this._rows[$-1]}findRows($,Y){return this._rows.slice($-1,$-1+Y)}get rowCount(){return this._lastRowNumber}get actualRowCount(){let $=0;return this.eachRow(()=>{$++}),$}getRow($){let Y=this._rows[$-1];if(!Y)Y=this._rows[$-1]=new s40(this,$);return Y}getRows($,Y){if(Y<1)return;let U=[];for(let z=$;z<$+Y;z++)U.push(this.getRow(z));return U}addRow($,Y="n"){let U=this._nextRow,z=this.getRow(U);return z.values=$,this._setStyleOption(U,Y[0]==="i"?Y:"n"),z}addRows($,Y="n"){let U=[];return $.forEach((z)=>{U.push(this.addRow(z,Y))}),U}insertRow($,Y,U="n"){return this.spliceRows($,0,Y),this._setStyleOption($,U),this.getRow($)}insertRows($,Y,U="n"){if(this.spliceRows($,0,...Y),U!=="n"){for(let z=0;z{Q.getCell(I).style=$60(J.style)}),Q.height=z.height}duplicateRow($,Y,U=!1){let z=this._rows[$-1],Q=Array(Y).fill(z.values);this.spliceRows($+1,U?0:Y,...Q);for(let J=0;J{I.getCell(G).style=K.style})}}spliceRows($,Y,...U){let z=$+Y,Q=U.length,J=Q-Y,I=this._rows.length,K,G;if(J<0){if($===I)this._rows[I-1]=void 0;for(K=z;K<=I;K++)if(G=this._rows[K-1],G){let H=this.getRow(K+J);H.values=G.values,H.style=G.style,H.height=G.height,G.eachCell({includeEmpty:!0},(W,X)=>{H.getCell(X).style=W.style}),this._rows[K-1]=void 0}else this._rows[K+J-1]=void 0}else if(J>0)for(K=I;K>=z;K--)if(G=this._rows[K-1],G){let H=this.getRow(K+J);H.values=G.values,H.style=G.style,H.height=G.height,G.eachCell({includeEmpty:!0},(W,X)=>{if(H.getCell(X).style=W.style,W._value.constructor.name==="MergeValue"){let Z=this.getRow(W._row._number+Q).getCell(X),q=W._value._master,V=this.getRow(q._row._number+Q).getCell(q._column._number);Z.merge(V)}})}else this._rows[K+J-1]=void 0;for(K=0;K{if(U&&U.hasValues)Y(U,U.number)})}getSheetValues(){let $=[];return this._rows.forEach((Y)=>{if(Y)$[Y.number]=Y.values}),$}findCell($,Y){let U=fH.getAddress($,Y),z=this._rows[U.row-1];return z?z.findCell(U.col):void 0}getCell($,Y){let U=fH.getAddress($,Y);return this.getRow(U.row).getCellEx(U)}mergeCells(...$){let Y=new uH($);this._mergeCellsInternal(Y)}mergeCellsWithoutStyle(...$){let Y=new uH($);this._mergeCellsInternal(Y,!0)}_mergeCellsInternal($,Y){xH.each(this._merges,(z)=>{if(z.intersects($))throw Error("Cannot merge already merged cells")});let U=this.getCell($.top,$.left);for(let z=$.top;z<=$.bottom;z++)for(let Q=$.left;Q<=$.right;Q++)if(z>$.top||Q>$.left)this.getCell(z,Q).merge(U,Y);this._merges[U.address]=$}_unMergeMaster($){let Y=this._merges[$.address];if(Y){for(let U=Y.top;U<=Y.bottom;U++)for(let z=Y.left;z<=Y.right;z++)this.getCell(U,z).unmerge();delete this._merges[$.address]}}get hasMerges(){return xH.some(this._merges,Boolean)}unMergeCells(...$){let Y=new uH($);for(let U=Y.top;U<=Y.bottom;U++)for(let z=Y.left;z<=Y.right;z++){let Q=this.findCell(U,z);if(Q){if(Q.type===ec0.ValueType.Merge)this._unMergeMaster(Q.master);else if(this._merges[Q.address])this._unMergeMaster(Q)}}}fillFormula($,Y,U,z="shared"){let Q=fH.decode($),{top:J,left:I,bottom:K,right:G}=Q,H=G-I+1,W=fH.encodeAddress(J,I),X=z==="shared",Z;if(typeof U==="function")Z=U;else if(Array.isArray(U))if(Array.isArray(U[0]))Z=(V,F)=>U[V-J][F-I];else Z=(V,F)=>U[(V-J)*H+(F-I)];else Z=()=>{return};let q=!0;for(let V=J;V<=K;V++)for(let F=I;F<=G;F++)if(q)this.getCell(V,F).value={shareType:z,formula:Y,ref:$,result:Z(V,F)},q=!1;else this.getCell(V,F).value=X?{sharedFormula:W,result:Z(V,F)}:Z(V,F)}addImage($,Y){let U={type:"image",imageId:$,range:Y};this._media.push(new Hg(this,U))}getImages(){return this._media.filter(($)=>$.type==="image")}addBackgroundImage($){let Y={type:"background",imageId:$};this._media.push(new Hg(this,Y))}getBackgroundImageId(){let $=this._media.find((Y)=>Y.type==="background");return $&&$.imageId}protect($,Y){return new Promise((U)=>{if(this.sheetProtection={sheet:!0},Y&&"spinCount"in Y)Y.spinCount=Number.isFinite(Y.spinCount)?Math.round(Math.max(0,Y.spinCount)):1e5;if($)this.sheetProtection.algorithmName="SHA-512",this.sheetProtection.saltValue=e40.randomBytes(16).toString("base64"),this.sheetProtection.spinCount=Y&&"spinCount"in Y?Y.spinCount:1e5,this.sheetProtection.hashValue=e40.convertPasswordToHash($,"SHA512",this.sheetProtection.saltValue,this.sheetProtection.spinCount);if(Y){if(this.sheetProtection=Object.assign(this.sheetProtection,Y),!$&&"spinCount"in Y)delete this.sheetProtection.spinCount}U()})}unprotect(){this.sheetProtection=null}addTable($){let Y=new a40(this,$);return this.tables[$.name]=Y,Y}getTable($){return this.tables[$]}removeTable($){delete this.tables[$]}getTables(){return Object.values(this.tables)}addConditionalFormatting($){this.conditionalFormattings.push($)}removeConditionalFormatting($){if(typeof $==="number")this.conditionalFormattings.splice($,1);else if($ instanceof Function)this.conditionalFormattings=this.conditionalFormattings.filter($);else this.conditionalFormattings=[]}get tabColor(){return console.trace("worksheet.tabColor property is now deprecated. Please use worksheet.properties.tabColor"),this.properties.tabColor}set tabColor($){console.trace("worksheet.tabColor property is now deprecated. Please use worksheet.properties.tabColor"),this.properties.tabColor=$}get model(){let $={id:this.id,name:this.name,dataValidations:this.dataValidations.model,properties:this.properties,state:this.state,pageSetup:this.pageSetup,headerFooter:this.headerFooter,rowBreaks:this.rowBreaks,views:this.views,autoFilter:this.autoFilter,media:this._media.map((z)=>z.model),sheetProtection:this.sheetProtection,tables:Object.values(this.tables).map((z)=>z.model),conditionalFormattings:this.conditionalFormattings};$.cols=hM.toModel(this.columns);let Y=$.rows=[],U=$.dimensions=new uH;return this._rows.forEach((z)=>{let Q=z&&z.model;if(Q)U.expand(Q.number,Q.min,Q.number,Q.max),Y.push(Q)}),$.merges=[],xH.each(this._merges,(z)=>{$.merges.push(z.range)}),$}_parseRows($){this._rows=[],$.rows.forEach((Y)=>{let U=new s40(this,Y.number);this._rows[U.number-1]=U,U.model=Y})}_parseMergeCells($){xH.each($.mergeCells,(Y)=>{this.mergeCellsWithoutStyle(Y)})}set model($){this.name=$.name,this._columns=hM.fromModel(this,$.cols),this._parseRows($),this._parseMergeCells($),this.dataValidations=new t40($.dataValidations),this.properties=$.properties,this.pageSetup=$.pageSetup,this.headerFooter=$.headerFooter,this.views=$.views,this.autoFilter=$.autoFilter,this._media=$.media.map((Y)=>new Hg(this,Y)),this.sheetProtection=$.sheetProtection,this.tables=$.tables.reduce((Y,U)=>{let z=new a40;return z.model=U,Y[U.name]=z,Y},{}),this.conditionalFormattings=$.conditionalFormattings}}U60.exports=Y60});var K60=E((zp1,I60)=>{var Q60=Y6(),SM=c4();class J60{constructor($){this.template=$,this.sheets={}}addCell($){this.addCellEx(SM.decodeEx($))}getCell($){return this.findCellEx(SM.decodeEx($),!0)}findCell($){return this.findCellEx(SM.decodeEx($),!1)}findCellAt($,Y,U){let z=this.sheets[$],Q=z&&z[Y];return Q&&Q[U]}addCellEx($){if($.top)for(let Y=$.top;Y<=$.bottom;Y++)for(let U=$.left;U<=$.right;U++)this.getCellAt($.sheetName,Y,U);else this.findCellEx($,!0)}getCellEx($){return this.findCellEx($,!0)}findCellEx($,Y){let U=this.findSheet($,Y),z=this.findSheetRow(U,$,Y);return this.findRowCell(z,$,Y)}getCellAt($,Y,U){let z=this.sheets[$]||(this.sheets[$]=[]),Q=z[Y]||(z[Y]=[]);return Q[U]||(Q[U]={sheetName:$,address:SM.n2l(U)+Y,row:Y,col:U})}removeCellEx($){let Y=this.findSheet($);if(!Y)return;let U=this.findSheetRow(Y,$);if(!U)return;delete U[$.col]}forEachInSheet($,Y){let U=this.sheets[$];if(U)U.forEach((z,Q)=>{if(z)z.forEach((J,I)=>{if(J)Y(J,Q,I)})})}forEach($){Q60.each(this.sheets,(Y,U)=>{this.forEachInSheet(U,$)})}map($){let Y=[];return this.forEach((U)=>{Y.push($(U))}),Y}findSheet($,Y){let U=$.sheetName;if(this.sheets[U])return this.sheets[U];if(Y)return this.sheets[U]=[];return}findSheetRow($,Y,U){let{row:z}=Y;if($&&$[z])return $[z];if(U)return $[z]=[];return}findRowCell($,Y,U){let{col:z}=Y;if($&&$[z])return $[z];if(U)return $[z]=this.template?Object.assign(Y,JSON.parse(JSON.stringify(this.template))):Y;return}spliceRows($,Y,U,z){let Q=this.sheets[$];if(Q){let J=[];for(let I=0;I{I.splice(Y,U,...J)})}}}I60.exports=J60});var Wg=E((Qp1,W60)=>{var rQ=Y6(),bH=c4(),G60=K60(),$n0=Y3(),Yn0=/[$](\w+)[$](\d+)(:[$](\w+)[$](\d+))?/;class H60{constructor(){this.matrixMap={}}getMatrix($){return this.matrixMap[$]||(this.matrixMap[$]=new G60)}add($,Y){let U=bH.decodeEx($);this.addEx(U,Y)}addEx($,Y){let U=this.getMatrix(Y);if($.top)for(let z=$.left;z<=$.right;z++)for(let Q=$.top;Q<=$.bottom;Q++){let J={sheetName:$.sheetName,address:bH.n2l(z)+Q,row:Q,col:z};U.addCellEx(J)}else U.addCellEx($)}remove($,Y){let U=bH.decodeEx($);this.removeEx(U,Y)}removeEx($,Y){this.getMatrix(Y).removeCellEx($)}removeAllNames($){rQ.each(this.matrixMap,(Y)=>{Y.removeCellEx($)})}forEach($){rQ.each(this.matrixMap,(Y,U)=>{Y.forEach((z)=>{$(U,z)})})}getNames($){return this.getNamesEx(bH.decodeEx($))}getNamesEx($){return rQ.map(this.matrixMap,(Y,U)=>Y.findCellEx($)&&U).filter(Boolean)}_explore($,Y){Y.mark=!1;let{sheetName:U}=Y,z=new $n0(Y.row,Y.col,Y.row,Y.col,U),Q,J;function I(G,H){let W=$.findCellAt(U,G,Y.col);if(!W||!W.mark)return!1;return z[H]=G,W.mark=!1,!0}for(J=Y.row-1;I(J,"top");J--);for(J=Y.row+1;I(J,"bottom");J++);function K(G,H){let W=[];for(J=z.top;J<=z.bottom;J++){let X=$.findCellAt(U,J,G);if(X&&X.mark)W.push(X);else return!1}z[H]=G;for(let X=0;X{z.mark=!0});let U=Y.map((z)=>z.mark&&this._explore(Y,z)).filter(Boolean).map((z)=>z.$shortRange);return{name:$,ranges:U}}normaliseMatrix($,Y){$.forEachInSheet(Y,(U,z,Q)=>{if(U){if(U.row!==z||U.col!==Q)U.row=z,U.col=Q,U.address=bH.n2l(Q)+z}})}spliceRows($,Y,U,z){rQ.each(this.matrixMap,(Q)=>{Q.spliceRows($,Y,U,z),this.normaliseMatrix(Q,$)})}spliceColumns($,Y,U,z){rQ.each(this.matrixMap,(Q)=>{Q.spliceColumns($,Y,U,z),this.normaliseMatrix(Q,$)})}get model(){return rQ.map(this.matrixMap,($,Y)=>this.getRanges(Y,$)).filter(($)=>$.ranges.length)}set model($){let Y=this.matrixMap={};$.forEach((U)=>{let z=Y[U.name]=new G60;U.ranges.forEach((Q)=>{if(Yn0.test(Q.split("!").pop()||""))z.addCell(Q)})})}}W60.exports=H60});var I6=E((Jp1,Xg)=>{if(typeof process>"u"||!process.version||process.version.indexOf("v0.")===0||process.version.indexOf("v1.")===0&&process.version.indexOf("v1.8.")!==0)Xg.exports={nextTick:Un0};else Xg.exports=process;function Un0($,Y,U,z){if(typeof $!=="function")throw TypeError('"callback" argument must be a function');var Q=arguments.length,J,I;switch(Q){case 0:case 1:return process.nextTick($);case 2:return process.nextTick(function(){$.call(null,Y)});case 3:return process.nextTick(function(){$.call(null,Y,U)});case 4:return process.nextTick(function(){$.call(null,Y,U,z)});default:J=Array(Q-1),I=0;while(I{var zn0={}.toString;X60.exports=Array.isArray||function($){return zn0.call($)=="[object Array]"}});var K6=E((Zg,q60)=>{var gM=I0("buffer"),U3=gM.Buffer;function Z60($,Y){for(var U in $)Y[U]=$[U]}if(U3.from&&U3.alloc&&U3.allocUnsafe&&U3.allocUnsafeSlow)q60.exports=gM;else Z60(gM,Zg),Zg.Buffer=aQ;function aQ($,Y,U){return U3($,Y,U)}Z60(U3,aQ);aQ.from=function($,Y,U){if(typeof $==="number")throw TypeError("Argument must not be a number");return U3($,Y,U)};aQ.alloc=function($,Y,U){if(typeof $!=="number")throw TypeError("Argument must be a number");var z=U3($);if(Y!==void 0)if(typeof U==="string")z.fill(Y,U);else z.fill(Y);else z.fill(0);return z};aQ.allocUnsafe=function($){if(typeof $!=="number")throw TypeError("Argument must be a number");return U3($)};aQ.allocUnsafeSlow=function($){if(typeof $!=="number")throw TypeError("Argument must be a number");return gM.SlowBuffer($)}});var M4=E((Mn0)=>{function Qn0($){if(Array.isArray)return Array.isArray($);return yM($)==="[object Array]"}Mn0.isArray=Qn0;function Jn0($){return typeof $==="boolean"}Mn0.isBoolean=Jn0;function In0($){return $===null}Mn0.isNull=In0;function Kn0($){return $==null}Mn0.isNullOrUndefined=Kn0;function Gn0($){return typeof $==="number"}Mn0.isNumber=Gn0;function Hn0($){return typeof $==="string"}Mn0.isString=Hn0;function Wn0($){return typeof $==="symbol"}Mn0.isSymbol=Wn0;function Xn0($){return $===void 0}Mn0.isUndefined=Xn0;function Zn0($){return yM($)==="[object RegExp]"}Mn0.isRegExp=Zn0;function qn0($){return typeof $==="object"&&$!==null}Mn0.isObject=qn0;function Vn0($){return yM($)==="[object Date]"}Mn0.isDate=Vn0;function Ln0($){return yM($)==="[object Error]"||$ instanceof Error}Mn0.isError=Ln0;function Fn0($){return typeof $==="function"}Mn0.isFunction=Fn0;function wn0($){return $===null||typeof $==="boolean"||typeof $==="number"||typeof $==="string"||typeof $==="symbol"||typeof $>"u"}Mn0.isPrimitive=wn0;Mn0.isBuffer=I0("buffer").Buffer.isBuffer;function yM($){return Object.prototype.toString.call($)}});var V60=E((Gp1,qg)=>{if(typeof Object.create==="function")qg.exports=function(Y,U){if(U)Y.super_=U,Y.prototype=Object.create(U.prototype,{constructor:{value:Y,enumerable:!1,writable:!0,configurable:!0}})};else qg.exports=function(Y,U){if(U){Y.super_=U;var z=function(){};z.prototype=U.prototype,Y.prototype=new z,Y.prototype.constructor=Y}}});var X1=E((Hp1,Vg)=>{try{if(kM=I0("util"),typeof kM.inherits!=="function")throw"";Vg.exports=kM.inherits}catch($){Vg.exports=V60()}var kM});var F60=E((Wp1,Lg)=>{function gn0($,Y){if(!($ instanceof Y))throw TypeError("Cannot call a class as a function")}var L60=K6().Buffer,iH=I0("util");function yn0($,Y,U){$.copy(Y,U)}Lg.exports=function(){function $(){gn0(this,$),this.head=null,this.tail=null,this.length=0}return $.prototype.push=function(U){var z={data:U,next:null};if(this.length>0)this.tail.next=z;else this.head=z;this.tail=z,++this.length},$.prototype.unshift=function(U){var z={data:U,next:this.head};if(this.length===0)this.tail=z;this.head=z,++this.length},$.prototype.shift=function(){if(this.length===0)return;var U=this.head.data;if(this.length===1)this.head=this.tail=null;else this.head=this.head.next;return--this.length,U},$.prototype.clear=function(){this.head=this.tail=null,this.length=0},$.prototype.join=function(U){if(this.length===0)return"";var z=this.head,Q=""+z.data;while(z=z.next)Q+=U+z.data;return Q},$.prototype.concat=function(U){if(this.length===0)return L60.alloc(0);var z=L60.allocUnsafe(U>>>0),Q=this.head,J=0;while(Q)yn0(Q.data,z,J),J+=Q.data.length,Q=Q.next;return z},$}();if(iH&&iH.inspect&&iH.inspect.custom)Lg.exports.prototype[iH.inspect.custom]=function(){var $=iH.inspect({length:this.length});return this.constructor.name+" "+$}});var Fg=E((Xp1,w60)=>{var xM=I6();function kn0($,Y){var U=this,z=this._readableState&&this._readableState.destroyed,Q=this._writableState&&this._writableState.destroyed;if(z||Q){if(Y)Y($);else if($){if(!this._writableState)xM.nextTick(fM,this,$);else if(!this._writableState.errorEmitted)this._writableState.errorEmitted=!0,xM.nextTick(fM,this,$)}return this}if(this._readableState)this._readableState.destroyed=!0;if(this._writableState)this._writableState.destroyed=!0;return this._destroy($||null,function(J){if(!Y&&J){if(!U._writableState)xM.nextTick(fM,U,J);else if(!U._writableState.errorEmitted)U._writableState.errorEmitted=!0,xM.nextTick(fM,U,J)}else if(Y)Y(J)}),this}function xn0(){if(this._readableState)this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1;if(this._writableState)this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1}function fM($,Y){$.emit("error",Y)}w60.exports={destroy:kn0,undestroy:xn0}});var y7=E((Zp1,M60)=>{M60.exports=I0("util").deprecate});var Mg=E((qp1,j60)=>{var dY=I6();j60.exports=Z6;function N60($){var Y=this;this.next=null,this.entry=null,this.finish=function(){Yp0(Y,$)}}var fn0=["v0.10","v0.9."].indexOf(process.version.slice(0,5))>-1?setImmediate:dY.nextTick,tQ;Z6.WritableState=nH;var D60=Object.create(M4());D60.inherits=X1();var un0={deprecate:y7()},A60=I0("stream"),bM=K6().Buffer,bn0=(typeof global<"u"?global:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function in0($){return bM.from($)}function cn0($){return bM.isBuffer($)||$ instanceof bn0}var B60=Fg();D60.inherits(Z6,A60);function nn0(){}function nH($,Y){tQ=tQ||mY(),$=$||{};var U=Y instanceof tQ;if(this.objectMode=!!$.objectMode,U)this.objectMode=this.objectMode||!!$.writableObjectMode;var{highWaterMark:z,writableHighWaterMark:Q}=$,J=this.objectMode?16:16384;if(z||z===0)this.highWaterMark=z;else if(U&&(Q||Q===0))this.highWaterMark=Q;else this.highWaterMark=J;this.highWaterMark=Math.floor(this.highWaterMark),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var I=$.decodeStrings===!1;this.decodeStrings=!I,this.defaultEncoding=$.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(K){sn0(Y,K)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new N60(this)}nH.prototype.getBuffer=function(){var Y=this.bufferedRequest,U=[];while(Y)U.push(Y),Y=Y.next;return U};(function(){try{Object.defineProperty(nH.prototype,"buffer",{get:un0.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch($){}})();var uM;if(typeof Symbol==="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]==="function")uM=Function.prototype[Symbol.hasInstance],Object.defineProperty(Z6,Symbol.hasInstance,{value:function($){if(uM.call(this,$))return!0;if(this!==Z6)return!1;return $&&$._writableState instanceof nH}});else uM=function($){return $ instanceof this};function Z6($){if(tQ=tQ||mY(),!uM.call(Z6,this)&&!(this instanceof tQ))return new Z6($);if(this._writableState=new nH($,this),this.writable=!0,$){if(typeof $.write==="function")this._write=$.write;if(typeof $.writev==="function")this._writev=$.writev;if(typeof $.destroy==="function")this._destroy=$.destroy;if(typeof $.final==="function")this._final=$.final}A60.call(this)}Z6.prototype.pipe=function(){this.emit("error",Error("Cannot pipe, not readable"))};function pn0($,Y){var U=Error("write after end");$.emit("error",U),dY.nextTick(Y,U)}function dn0($,Y,U,z){var Q=!0,J=!1;if(U===null)J=TypeError("May not write null values to stream");else if(typeof U!=="string"&&U!==void 0&&!Y.objectMode)J=TypeError("Invalid non-string/buffer chunk");if(J)$.emit("error",J),dY.nextTick(z,J),Q=!1;return Q}Z6.prototype.write=function($,Y,U){var z=this._writableState,Q=!1,J=!z.objectMode&&cn0($);if(J&&!bM.isBuffer($))$=in0($);if(typeof Y==="function")U=Y,Y=null;if(J)Y="buffer";else if(!Y)Y=z.defaultEncoding;if(typeof U!=="function")U=nn0;if(z.ended)pn0(this,U);else if(J||dn0(this,z,$,U))z.pendingcb++,Q=ln0(this,z,J,$,Y,U);return Q};Z6.prototype.cork=function(){var $=this._writableState;$.corked++};Z6.prototype.uncork=function(){var $=this._writableState;if($.corked){if($.corked--,!$.writing&&!$.corked&&!$.bufferProcessing&&$.bufferedRequest)P60(this,$)}};Z6.prototype.setDefaultEncoding=function(Y){if(typeof Y==="string")Y=Y.toLowerCase();if(!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((Y+"").toLowerCase())>-1))throw TypeError("Unknown encoding: "+Y);return this._writableState.defaultEncoding=Y,this};function mn0($,Y,U){if(!$.objectMode&&$.decodeStrings!==!1&&typeof Y==="string")Y=bM.from(Y,U);return Y}Object.defineProperty(Z6.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function ln0($,Y,U,z,Q,J){if(!U){var I=mn0(Y,z,Q);if(z!==I)U=!0,Q="buffer",z=I}var K=Y.objectMode?1:z.length;Y.length+=K;var G=Y.length{var E60=I6(),Up0=Object.keys||function($){var Y=[];for(var U in $)Y.push(U);return Y};_60.exports=z3;var C60=Object.create(M4());C60.inherits=X1();var R60=Ng(),Og=Mg();C60.inherits(z3,R60);{iM=Up0(Og.prototype);for(pH=0;pH{var Ag=K6().Buffer,v60=Ag.isEncoding||function($){switch($=""+$,$&&$.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function Jp0($){if(!$)return"utf8";var Y;while(!0)switch($){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return $;default:if(Y)return;$=(""+$).toLowerCase(),Y=!0}}function Ip0($){var Y=Jp0($);if(typeof Y!=="string"&&(Ag.isEncoding===v60||!v60($)))throw Error("Unknown encoding: "+$);return Y||$}Mp0.StringDecoder=mH;function mH($){this.encoding=Ip0($);var Y;switch(this.encoding){case"utf16le":this.text=Zp0,this.end=qp0,Y=4;break;case"utf8":this.fillLast=Hp0,Y=4;break;case"base64":this.text=Vp0,this.end=Lp0,Y=3;break;default:this.write=Fp0,this.end=wp0;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=Ag.allocUnsafe(Y)}mH.prototype.write=function($){if($.length===0)return"";var Y,U;if(this.lastNeed){if(Y=this.fillLast($),Y===void 0)return"";U=this.lastNeed,this.lastNeed=0}else U=0;if(U<$.length)return Y?Y+this.text($,U):this.text($,U);return Y||""};mH.prototype.end=Xp0;mH.prototype.text=Wp0;mH.prototype.fillLast=function($){if(this.lastNeed<=$.length)return $.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);$.copy(this.lastChar,this.lastTotal-this.lastNeed,0,$.length),this.lastNeed-=$.length};function Dg($){if($<=127)return 0;else if($>>5===6)return 2;else if($>>4===14)return 3;else if($>>3===30)return 4;return $>>6===2?-1:-2}function Kp0($,Y,U){var z=Y.length-1;if(z=0){if(Q>0)$.lastNeed=Q-1;return Q}if(--z=0){if(Q>0)$.lastNeed=Q-2;return Q}if(--z=0){if(Q>0)if(Q===2)Q=0;else $.lastNeed=Q-3;return Q}return 0}function Gp0($,Y,U){if((Y[0]&192)!==128)return $.lastNeed=0,"�";if($.lastNeed>1&&Y.length>1){if((Y[1]&192)!==128)return $.lastNeed=1,"�";if($.lastNeed>2&&Y.length>2){if((Y[2]&192)!==128)return $.lastNeed=2,"�"}}}function Hp0($){var Y=this.lastTotal-this.lastNeed,U=Gp0(this,$,Y);if(U!==void 0)return U;if(this.lastNeed<=$.length)return $.copy(this.lastChar,Y,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);$.copy(this.lastChar,Y,0,$.length),this.lastNeed-=$.length}function Wp0($,Y){var U=Kp0(this,$,Y);if(!this.lastNeed)return $.toString("utf8",Y);this.lastTotal=U;var z=$.length-(U-this.lastNeed);return $.copy(this.lastChar,0,z),$.toString("utf8",Y,z)}function Xp0($){var Y=$&&$.length?this.write($):"";if(this.lastNeed)return Y+"�";return Y}function Zp0($,Y){if(($.length-Y)%2===0){var U=$.toString("utf16le",Y);if(U){var z=U.charCodeAt(U.length-1);if(z>=55296&&z<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=$[$.length-2],this.lastChar[1]=$[$.length-1],U.slice(0,-1)}return U}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=$[$.length-1],$.toString("utf16le",Y,$.length-1)}function qp0($){var Y=$&&$.length?this.write($):"";if(this.lastNeed){var U=this.lastTotal-this.lastNeed;return Y+this.lastChar.toString("utf16le",0,U)}return Y}function Vp0($,Y){var U=($.length-Y)%3;if(U===0)return $.toString("base64",Y);if(this.lastNeed=3-U,this.lastTotal=3,U===1)this.lastChar[0]=$[$.length-1];else this.lastChar[0]=$[$.length-2],this.lastChar[1]=$[$.length-1];return $.toString("base64",Y,$.length-U)}function Lp0($){var Y=$&&$.length?this.write($):"";if(this.lastNeed)return Y+this.lastChar.toString("base64",0,3-this.lastNeed);return Y}function Fp0($){return $.toString(this.encoding)}function wp0($){return $&&$.length?this.write($):""}});var Ng=E((wp1,n60)=>{var $J=I6();n60.exports=B4;var Np0=sQ(),lH;B4.ReadableState=f60;var Fp1=I0("events").EventEmitter,y60=function($,Y){return $.listeners(Y).length},Cg=I0("stream"),oH=K6().Buffer,Dp0=(typeof global<"u"?global:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function Ap0($){return oH.from($)}function Bp0($){return oH.isBuffer($)||$ instanceof Dp0}var k60=Object.create(M4());k60.inherits=X1();var Pg=I0("util"),t1=void 0;if(Pg&&Pg.debuglog)t1=Pg.debuglog("stream");else t1=function(){};var Pp0=F60(),x60=Fg(),eQ;k60.inherits(B4,Cg);var Tg=["error","close","destroy","pause","resume"];function Tp0($,Y,U){if(typeof $.prependListener==="function")return $.prependListener(Y,U);if(!$._events||!$._events[Y])$.on(Y,U);else if(Np0($._events[Y]))$._events[Y].unshift(U);else $._events[Y]=[U,$._events[Y]]}function f60($,Y){lH=lH||mY(),$=$||{};var U=Y instanceof lH;if(this.objectMode=!!$.objectMode,U)this.objectMode=this.objectMode||!!$.readableObjectMode;var{highWaterMark:z,readableHighWaterMark:Q}=$,J=this.objectMode?16:16384;if(z||z===0)this.highWaterMark=z;else if(U&&(Q||Q===0))this.highWaterMark=Q;else this.highWaterMark=J;if(this.highWaterMark=Math.floor(this.highWaterMark),this.buffer=new Pp0,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.destroyed=!1,this.defaultEncoding=$.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,$.encoding){if(!eQ)eQ=Bg().StringDecoder;this.decoder=new eQ($.encoding),this.encoding=$.encoding}}function B4($){if(lH=lH||mY(),!(this instanceof B4))return new B4($);if(this._readableState=new f60($,this),this.readable=!0,$){if(typeof $.read==="function")this._read=$.read;if(typeof $.destroy==="function")this._destroy=$.destroy}Cg.call(this)}Object.defineProperty(B4.prototype,"destroyed",{get:function(){if(this._readableState===void 0)return!1;return this._readableState.destroyed},set:function($){if(!this._readableState)return;this._readableState.destroyed=$}});B4.prototype.destroy=x60.destroy;B4.prototype._undestroy=x60.undestroy;B4.prototype._destroy=function($,Y){this.push(null),Y($)};B4.prototype.push=function($,Y){var U=this._readableState,z;if(!U.objectMode){if(typeof $==="string"){if(Y=Y||U.defaultEncoding,Y!==U.encoding)$=oH.from($,Y),Y="";z=!0}}else z=!0;return u60(this,$,Y,!1,z)};B4.prototype.unshift=function($){return u60(this,$,null,!0,!1)};function u60($,Y,U,z,Q){var J=$._readableState;if(Y===null)J.reading=!1,Rp0($,J);else{var I;if(!Q)I=jp0(J,Y);if(I)$.emit("error",I);else if(J.objectMode||Y&&Y.length>0){if(typeof Y!=="string"&&!J.objectMode&&Object.getPrototypeOf(Y)!==oH.prototype)Y=Ap0(Y);if(z)if(J.endEmitted)$.emit("error",Error("stream.unshift() after end event"));else jg($,J,Y,!0);else if(J.ended)$.emit("error",Error("stream.push() after EOF"));else if(J.reading=!1,J.decoder&&!U)if(Y=J.decoder.write(Y),J.objectMode||Y.length!==0)jg($,J,Y,!1);else b60($,J);else jg($,J,Y,!1)}else if(!z)J.reading=!1}return Ep0(J)}function jg($,Y,U,z){if(Y.flowing&&Y.length===0&&!Y.sync)$.emit("data",U),$.read(0);else{if(Y.length+=Y.objectMode?1:U.length,z)Y.buffer.unshift(U);else Y.buffer.push(U);if(Y.needReadable)cM($)}b60($,Y)}function jp0($,Y){var U;if(!Bp0(Y)&&typeof Y!=="string"&&Y!==void 0&&!$.objectMode)U=TypeError("Invalid non-string/buffer chunk");return U}function Ep0($){return!$.ended&&($.needReadable||$.length<$.highWaterMark||$.length===0)}B4.prototype.isPaused=function(){return this._readableState.flowing===!1};B4.prototype.setEncoding=function($){if(!eQ)eQ=Bg().StringDecoder;return this._readableState.decoder=new eQ($),this._readableState.encoding=$,this};var h60=8388608;function Cp0($){if($>=h60)$=h60;else $--,$|=$>>>1,$|=$>>>2,$|=$>>>4,$|=$>>>8,$|=$>>>16,$++;return $}function S60($,Y){if($<=0||Y.length===0&&Y.ended)return 0;if(Y.objectMode)return 1;if($!==$)if(Y.flowing&&Y.length)return Y.buffer.head.data.length;else return Y.length;if($>Y.highWaterMark)Y.highWaterMark=Cp0($);if($<=Y.length)return $;if(!Y.ended)return Y.needReadable=!0,0;return Y.length}B4.prototype.read=function($){t1("read",$),$=parseInt($,10);var Y=this._readableState,U=$;if($!==0)Y.emittedReadable=!1;if($===0&&Y.needReadable&&(Y.length>=Y.highWaterMark||Y.ended)){if(t1("read: emitReadable",Y.length,Y.ended),Y.length===0&&Y.ended)Eg(this);else cM(this);return null}if($=S60($,Y),$===0&&Y.ended){if(Y.length===0)Eg(this);return null}var z=Y.needReadable;if(t1("need readable",z),Y.length===0||Y.length-$0)Q=i60($,Y);else Q=null;if(Q===null)Y.needReadable=!0,$=0;else Y.length-=$;if(Y.length===0){if(!Y.ended)Y.needReadable=!0;if(U!==$&&Y.ended)Eg(this)}if(Q!==null)this.emit("data",Q);return Q};function Rp0($,Y){if(Y.ended)return;if(Y.decoder){var U=Y.decoder.end();if(U&&U.length)Y.buffer.push(U),Y.length+=Y.objectMode?1:U.length}Y.ended=!0,cM($)}function cM($){var Y=$._readableState;if(Y.needReadable=!1,!Y.emittedReadable)if(t1("emitReadable",Y.flowing),Y.emittedReadable=!0,Y.sync)$J.nextTick(g60,$);else g60($)}function g60($){t1("emit readable"),$.emit("readable"),Rg($)}function b60($,Y){if(!Y.readingMore)Y.readingMore=!0,$J.nextTick(_p0,$,Y)}function _p0($,Y){var U=Y.length;while(!Y.reading&&!Y.flowing&&!Y.ended&&Y.length1&&c60(z.pipes,$)!==-1)&&!H)t1("false write response, pause",z.awaitDrain),z.awaitDrain++,X=!0;U.pause()}}function q(w){if(t1("onerror",w),M(),$.removeListener("error",q),y60($,"error")===0)$.emit("error",w)}Tp0($,"error",q);function V(){$.removeListener("finish",F),M()}$.once("close",V);function F(){t1("onfinish"),$.removeListener("close",V),M()}$.once("finish",F);function M(){t1("unpipe"),U.unpipe($)}if($.emit("pipe",U),!z.flowing)t1("pipe resume"),U.resume();return $};function vp0($){return function(){var Y=$._readableState;if(t1("pipeOnDrain",Y.awaitDrain),Y.awaitDrain)Y.awaitDrain--;if(Y.awaitDrain===0&&y60($,"data"))Y.flowing=!0,Rg($)}}B4.prototype.unpipe=function($){var Y=this._readableState,U={hasUnpiped:!1};if(Y.pipesCount===0)return this;if(Y.pipesCount===1){if($&&$!==Y.pipes)return this;if(!$)$=Y.pipes;if(Y.pipes=null,Y.pipesCount=0,Y.flowing=!1,$)$.emit("unpipe",this,U);return this}if(!$){var{pipes:z,pipesCount:Q}=Y;Y.pipes=null,Y.pipesCount=0,Y.flowing=!1;for(var J=0;J=Y.length){if(Y.decoder)U=Y.buffer.join("");else if(Y.buffer.length===1)U=Y.buffer.head.data;else U=Y.buffer.concat(Y.length);Y.buffer.clear()}else U=yp0($,Y.buffer,Y.decoder);return U}function yp0($,Y,U){var z;if($J.length?J.length:$;if(I===J.length)Q+=J;else Q+=J.slice(0,$);if($-=I,$===0){if(I===J.length)if(++z,U.next)Y.head=U.next;else Y.head=Y.tail=null;else Y.head=U,U.data=J.slice(I);break}++z}return Y.length-=z,Q}function xp0($,Y){var U=oH.allocUnsafe($),z=Y.head,Q=1;z.data.copy(U),$-=z.data.length;while(z=z.next){var J=z.data,I=$>J.length?J.length:$;if(J.copy(U,U.length-$,0,I),$-=I,$===0){if(I===J.length)if(++Q,z.next)Y.head=z.next;else Y.head=Y.tail=null;else Y.head=z,z.data=J.slice(I);break}++Q}return Y.length-=Q,U}function Eg($){var Y=$._readableState;if(Y.length>0)throw Error('"endReadable()" called on non-empty stream');if(!Y.endEmitted)Y.ended=!0,$J.nextTick(fp0,Y,$)}function fp0($,Y){if(!$.endEmitted&&$.length===0)$.endEmitted=!0,Y.readable=!1,Y.emit("end")}function c60($,Y){for(var U=0,z=$.length;U{m60.exports=Q3;var nM=mY(),d60=Object.create(M4());d60.inherits=X1();d60.inherits(Q3,nM);function up0($,Y){var U=this._transformState;U.transforming=!1;var z=U.writecb;if(!z)return this.emit("error",Error("write callback called multiple times"));if(U.writechunk=null,U.writecb=null,Y!=null)this.push(Y);z($);var Q=this._readableState;if(Q.reading=!1,Q.needReadable||Q.length{r60.exports=rH;var l60=_g(),o60=Object.create(M4());o60.inherits=X1();o60.inherits(rH,l60);function rH($){if(!(this instanceof rH))return new rH($);l60.call(this,$)}rH.prototype._transform=function($,Y,U){U(null,$)}});var vg=E((d6,pM)=>{var s5=I0("stream");if(process.env.READABLE_STREAM==="disable"&&s5)pM.exports=s5,d6=pM.exports=s5.Readable,d6.Readable=s5.Readable,d6.Writable=s5.Writable,d6.Duplex=s5.Duplex,d6.Transform=s5.Transform,d6.PassThrough=s5.PassThrough,d6.Stream=s5;else d6=pM.exports=Ng(),d6.Stream=s5||d6,d6.Readable=d6,d6.Writable=Mg(),d6.Duplex=mY(),d6.Transform=_g(),d6.PassThrough=s60()});var J3=E((cp0)=>{cp0.base64=!0;cp0.array=!0;cp0.string=!0;cp0.arraybuffer=typeof ArrayBuffer<"u"&&typeof Uint8Array<"u";cp0.nodebuffer=typeof Buffer<"u";cp0.uint8array=typeof Uint8Array<"u";if(typeof ArrayBuffer>"u")cp0.blob=!1;else{dM=new ArrayBuffer(0);try{cp0.blob=new Blob([dM],{type:"application/zip"}).size===0}catch($){try{Sg=self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder,mM=new Sg,mM.append(dM),cp0.blob=mM.getBlob("application/zip").size===0}catch(Y){cp0.blob=!1}}}var dM,Sg,mM;try{cp0.nodestream=!!vg().Readable}catch($){cp0.nodestream=!1}});var gg=E((ap0)=>{var rp0=n4(),sp0=J3(),a5="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";ap0.encode=function($){var Y=[],U,z,Q,J,I,K,G,H=0,W=$.length,X=W,Z=rp0.getTypeOf($)!=="string";while(H<$.length){if(X=W-H,!Z)U=$.charCodeAt(H++),z=H>2,I=(U&3)<<4|z>>4,K=X>1?(z&15)<<2|Q>>6:64,G=X>2?Q&63:64,Y.push(a5.charAt(J)+a5.charAt(I)+a5.charAt(K)+a5.charAt(G))}return Y.join("")};ap0.decode=function($){var Y,U,z,Q,J,I,K,G=0,H=0,W="data:";if($.substr(0,W.length)===W)throw Error("Invalid base64 input, it looks like a data url.");$=$.replace(/[^A-Za-z0-9+/=]/g,"");var X=$.length*3/4;if($.charAt($.length-1)===a5.charAt(64))X--;if($.charAt($.length-2)===a5.charAt(64))X--;if(X%1!==0)throw Error("Invalid base64 input, bad content length.");var Z;if(sp0.uint8array)Z=new Uint8Array(X|0);else Z=Array(X|0);while(G<$.length){if(Q=a5.indexOf($.charAt(G++)),J=a5.indexOf($.charAt(G++)),I=a5.indexOf($.charAt(G++)),K=a5.indexOf($.charAt(G++)),Y=Q<<2|J>>4,U=(J&15)<<4|I>>2,z=(I&3)<<6|K,Z[H++]=Y,I!==64)Z[H++]=U;if(K!==64)Z[H++]=z}return Z}});var sH=E((Ap1,a60)=>{a60.exports={isNode:typeof Buffer<"u",newBufferFrom:function($,Y){if(Buffer.from&&Buffer.from!==Uint8Array.from)return Buffer.from($,Y);else{if(typeof $==="number")throw Error('The "data" argument must not be a number');return new Buffer($,Y)}},allocBuffer:function($){if(Buffer.alloc)return Buffer.alloc($);else{var Y=new Buffer($);return Y.fill(0),Y}},isBuffer:function($){return Buffer.isBuffer($)},isStream:function($){return $&&typeof $.on==="function"&&typeof $.pause==="function"&&typeof $.resume==="function"}}});var $80=E((Pp1,e60)=>{var Bp1=global.MutationObserver||global.WebKitMutationObserver,t60;t60=function(){process.nextTick(Qd0)};var $d0,Yd0,Ud0,zd0,yg,aH=[];function Qd0(){yg=!0;var $,Y,U=aH.length;while(U){Y=aH,aH=[],$=-1;while(++${var Y80=$80();function UJ(){}var X8={},U80=["REJECTED"],kg=["FULFILLED"],z80=["PENDING"];YJ=["UNHANDLED"];var YJ;I80.exports=k7;function k7($){if(typeof $!=="function")throw TypeError("resolver must be a function");if(this.state=z80,this.queue=[],this.outcome=void 0,this.handled=YJ,$!==UJ)Q80(this,$)}k7.prototype.finally=function($){if(typeof $!=="function")return this;var Y=this.constructor;return this.then(U,z);function U(Q){function J(){return Q}return Y.resolve($()).then(J)}function z(Q){function J(){throw Q}return Y.resolve($()).then(J)}};k7.prototype.catch=function($){return this.then(null,$)};k7.prototype.then=function($,Y){if(typeof $!=="function"&&this.state===kg||typeof Y!=="function"&&this.state===U80)return this;var U=new this.constructor(UJ);if(this.handled===YJ)this.handled=null;if(this.state!==z80){var z=this.state===kg?$:Y;xg(U,z,this.outcome)}else this.queue.push(new tH(U,$,Y));return U};function tH($,Y,U){if(this.promise=$,typeof Y==="function")this.onFulfilled=Y,this.callFulfilled=this.otherCallFulfilled;if(typeof U==="function")this.onRejected=U,this.callRejected=this.otherCallRejected}tH.prototype.callFulfilled=function($){X8.resolve(this.promise,$)};tH.prototype.otherCallFulfilled=function($){xg(this.promise,this.onFulfilled,$)};tH.prototype.callRejected=function($){X8.reject(this.promise,$)};tH.prototype.otherCallRejected=function($){xg(this.promise,this.onRejected,$)};function xg($,Y,U){Y80(function(){var z;try{z=Y(U)}catch(Q){return X8.reject($,Q)}if(z===$)X8.reject($,TypeError("Cannot resolve promise with itself"));else X8.resolve($,z)})}X8.resolve=function($,Y){var U=J80(Id0,Y);if(U.status==="error")return X8.reject($,U.value);var z=U.value;if(z)Q80($,z);else{$.state=kg,$.outcome=Y;var Q=-1,J=$.queue.length;while(++Q{var fg=null;if(typeof Promise<"u")fg=Promise;else fg=K80();G80.exports={Promise:fg}});var ug=E((H80)=>{(function($,Y){if($.setImmediate)return;var U=1,z={},Q=!1,J=$.document,I;function K(N){if(typeof N!=="function")N=Function(""+N);var O=Array(arguments.length-1);for(var D=0;D"u"?typeof global>"u"?H80:global:self)});var n4=E((qd0)=>{var x7=J3(),Xd0=gg(),QJ=sH(),bg=zJ();ug();function Zd0($){var Y=null;if(x7.uint8array)Y=new Uint8Array($.length);else Y=Array($.length);return oM($,Y)}qd0.newBlob=function($,Y){qd0.checkSupport("blob");try{return new Blob([$],{type:Y})}catch(Q){try{var U=self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder,z=new U;return z.append($),z.getBlob(Y)}catch(J){throw Error("Bug : can't construct the Blob.")}}};function eH($){return $}function oM($,Y){for(var U=0;U<$.length;++U)Y[U]=$.charCodeAt(U)&255;return Y}var lM={stringifyByChunk:function($,Y,U){var z=[],Q=0,J=$.length;if(J<=U)return String.fromCharCode.apply(null,$);while(Q1)try{return lM.stringifyByChunk($,U,Y)}catch(Q){Y=Math.floor(Y/2)}return lM.stringifyByChar($)}qd0.applyFromCharCode=$W;function rM($,Y){for(var U=0;U<$.length;U++)Y[U]=$[U];return Y}var f7={};f7.string={string:eH,array:function($){return oM($,Array($.length))},arraybuffer:function($){return f7.string.uint8array($).buffer},uint8array:function($){return oM($,new Uint8Array($.length))},nodebuffer:function($){return oM($,QJ.allocBuffer($.length))}};f7.array={string:$W,array:eH,arraybuffer:function($){return new Uint8Array($).buffer},uint8array:function($){return new Uint8Array($)},nodebuffer:function($){return QJ.newBufferFrom($)}};f7.arraybuffer={string:function($){return $W(new Uint8Array($))},array:function($){return rM(new Uint8Array($),Array($.byteLength))},arraybuffer:eH,uint8array:function($){return new Uint8Array($)},nodebuffer:function($){return QJ.newBufferFrom(new Uint8Array($))}};f7.uint8array={string:$W,array:function($){return rM($,Array($.length))},arraybuffer:function($){return $.buffer},uint8array:eH,nodebuffer:function($){return QJ.newBufferFrom($)}};f7.nodebuffer={string:$W,array:function($){return rM($,Array($.length))},arraybuffer:function($){return f7.nodebuffer.uint8array($).buffer},uint8array:function($){return rM($,new Uint8Array($.length))},nodebuffer:eH};qd0.transformTo=function($,Y){if(!Y)Y="";if(!$)return Y;qd0.checkSupport($);var U=qd0.getTypeOf(Y),z=f7[U][$](Y);return z};qd0.resolve=function($){var Y=$.split("/"),U=[];for(var z=0;z"u")$[U]=arguments[Y][U];return $};qd0.prepareContent=function($,Y,U,z,Q){var J=bg.Promise.resolve(Y).then(function(I){var K=x7.blob&&(I instanceof Blob||["[object File]","[object Blob]"].indexOf(Object.prototype.toString.call(I))!==-1);if(K&&typeof FileReader<"u")return new bg.Promise(function(G,H){var W=new FileReader;W.onload=function(X){G(X.target.result)},W.onerror=function(X){H(X.target.error)},W.readAsArrayBuffer(I)});else return I});return J.then(function(I){var K=qd0.getTypeOf(I);if(!K)return bg.Promise.reject(Error("Can't read the data of '"+$+"'. Is it in a supported JavaScript type (String, Blob, ArrayBuffer, etc) ?"));if(K==="arraybuffer")I=qd0.transformTo("uint8array",I);else if(K==="string"){if(Q)I=Xd0.decode(I);else if(U){if(z!==!0)I=Zd0(I)}}return I})}});var I$=E((Rp1,q80)=>{function Z80($){this.name=$||"default",this.streamInfo={},this.generatedError=null,this.extraStreamInfo={},this.isPaused=!0,this.isFinished=!1,this.isLocked=!1,this._listeners={data:[],end:[],error:[]},this.previous=null}Z80.prototype={push:function($){this.emit("data",$)},end:function(){if(this.isFinished)return!1;this.flush();try{this.emit("end"),this.cleanUp(),this.isFinished=!0}catch($){this.emit("error",$)}return!0},error:function($){if(this.isFinished)return!1;if(this.isPaused)this.generatedError=$;else{if(this.isFinished=!0,this.emit("error",$),this.previous)this.previous.error($);this.cleanUp()}return!0},on:function($,Y){return this._listeners[$].push(Y),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function($,Y){if(this._listeners[$])for(var U=0;U "+$;else return $}};q80.exports=Z80});var IJ=E((Cd0)=>{var JJ=n4(),lY=J3(),Pd0=sH(),sM=I$(),YW=Array(256);for(t5=0;t5<256;t5++)YW[t5]=t5>=252?6:t5>=248?5:t5>=240?4:t5>=224?3:t5>=192?2:1;var t5;YW[254]=YW[254]=1;var Td0=function($){var Y,U,z,Q,J,I=$.length,K=0;for(Q=0;Q>>6,Y[J++]=128|U&63;else if(U<65536)Y[J++]=224|U>>>12,Y[J++]=128|U>>>6&63,Y[J++]=128|U&63;else Y[J++]=240|U>>>18,Y[J++]=128|U>>>12&63,Y[J++]=128|U>>>6&63,Y[J++]=128|U&63}return Y},jd0=function($,Y){var U;if(Y=Y||$.length,Y>$.length)Y=$.length;U=Y-1;while(U>=0&&($[U]&192)===128)U--;if(U<0)return Y;if(U===0)return Y;return U+YW[$[U]]>Y?U:Y},Ed0=function($){var Y,U,z,Q,J=$.length,I=Array(J*2);for(U=0,Y=0;Y4){I[U++]=65533,Y+=Q-1;continue}z&=Q===2?31:Q===3?15:7;while(Q>1&&Y1){I[U++]=65533;continue}if(z<65536)I[U++]=z;else z-=65536,I[U++]=55296|z>>10&1023,I[U++]=56320|z&1023}if(I.length!==U)if(I.subarray)I=I.subarray(0,U);else I.length=U;return JJ.applyFromCharCode(I)};Cd0.utf8encode=function(Y){if(lY.nodebuffer)return Pd0.newBufferFrom(Y,"utf-8");return Td0(Y)};Cd0.utf8decode=function(Y){if(lY.nodebuffer)return JJ.transformTo("nodebuffer",Y).toString("utf-8");return Y=JJ.transformTo(lY.uint8array?"uint8array":"array",Y),Ed0(Y)};function aM(){sM.call(this,"utf-8 decode"),this.leftOver=null}JJ.inherits(aM,sM);aM.prototype.processChunk=function($){var Y=JJ.transformTo(lY.uint8array?"uint8array":"array",$.data);if(this.leftOver&&this.leftOver.length){if(lY.uint8array){var U=Y;Y=new Uint8Array(U.length+this.leftOver.length),Y.set(this.leftOver,0),Y.set(U,this.leftOver.length)}else Y=this.leftOver.concat(Y);this.leftOver=null}var z=jd0(Y),Q=Y;if(z!==Y.length)if(lY.uint8array)Q=Y.subarray(0,z),this.leftOver=Y.subarray(z,Y.length);else Q=Y.slice(0,z),this.leftOver=Y.slice(z,Y.length);this.push({data:Cd0.utf8decode(Q),meta:$.meta})};aM.prototype.flush=function(){if(this.leftOver&&this.leftOver.length)this.push({data:Cd0.utf8decode(this.leftOver),meta:{}}),this.leftOver=null};Cd0.Utf8DecodeWorker=aM;function cg(){sM.call(this,"utf-8 encode")}JJ.inherits(cg,sM);cg.prototype.processChunk=function($){this.push({data:Cd0.utf8encode($.data),meta:$.meta})};Cd0.Utf8EncodeWorker=cg});var M80=E((vp1,w80)=>{var L80=I$(),F80=n4();function pg($){L80.call(this,"ConvertWorker to "+$),this.destType=$}F80.inherits(pg,L80);pg.prototype.processChunk=function($){this.push({data:F80.transformTo(this.destType,$.data),meta:$.meta})};w80.exports=pg});var D80=E((hp1,N80)=>{var O80=vg().Readable,vd0=n4();vd0.inherits(dg,O80);function dg($,Y,U){O80.call(this,Y),this._helper=$;var z=this;$.on("data",function(Q,J){if(!z.push(Q))z._helper.pause();if(U)U(J)}).on("error",function(Q){z.emit("error",Q)}).on("end",function(){z.push(null)})}dg.prototype._read=function(){this._helper.resume()};N80.exports=dg});var mg=E((Sp1,P80)=>{var oY=n4(),hd0=M80(),Sd0=I$(),gd0=gg(),yd0=J3(),kd0=zJ(),A80=null;if(yd0.nodestream)try{A80=D80()}catch($){}function xd0($,Y,U){switch($){case"blob":return oY.newBlob(oY.transformTo("arraybuffer",Y),U);case"base64":return gd0.encode(Y);default:return oY.transformTo($,Y)}}function fd0($,Y){var U,z=0,Q=null,J=0;for(U=0;U{bd0.base64=!1;bd0.binary=!1;bd0.dir=!1;bd0.createFolders=!0;bd0.date=null;bd0.compression=null;bd0.compressionOptions=null;bd0.comment=null;bd0.unixPermissions=null;bd0.dosPermissions=null});var og=E((yp1,T80)=>{var tM=n4(),eM=I$(),ad0=16384;function KJ($){eM.call(this,"DataWorker");var Y=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type="",this._tickScheduled=!1,$.then(function(U){if(Y.dataIsReady=!0,Y.data=U,Y.max=U&&U.length||0,Y.type=tM.getTypeOf(U),!Y.isPaused)Y._tickAndRepeat()},function(U){Y.error(U)})}tM.inherits(KJ,eM);KJ.prototype.cleanUp=function(){eM.prototype.cleanUp.call(this),this.data=null};KJ.prototype.resume=function(){if(!eM.prototype.resume.call(this))return!1;if(!this._tickScheduled&&this.dataIsReady)this._tickScheduled=!0,tM.delay(this._tickAndRepeat,[],this);return!0};KJ.prototype._tickAndRepeat=function(){if(this._tickScheduled=!1,this.isPaused||this.isFinished)return;if(this._tick(),!this.isFinished)tM.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0};KJ.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var $=ad0,Y=null,U=Math.min(this.max,this.index+$);if(this.index>=this.max)return this.end();else{switch(this.type){case"string":Y=this.data.substring(this.index,U);break;case"uint8array":Y=this.data.subarray(this.index,U);break;case"array":case"nodebuffer":Y=this.data.slice(this.index,U);break}return this.index=U,this.push({data:Y,meta:{percent:this.max?this.index/this.max*100:0}})}};T80.exports=KJ});var $O=E((kp1,E80)=>{var td0=n4();function ed0(){var $,Y=[];for(var U=0;U<256;U++){$=U;for(var z=0;z<8;z++)$=$&1?3988292384^$>>>1:$>>>1;Y[U]=$}return Y}var j80=ed0();function $m0($,Y,U,z){var Q=j80,J=z+U;$=$^-1;for(var I=z;I>>8^Q[($^Y[I])&255];return $^-1}function Ym0($,Y,U,z){var Q=j80,J=z+U;$=$^-1;for(var I=z;I>>8^Q[($^Y.charCodeAt(I))&255];return $^-1}E80.exports=function(Y,U){if(typeof Y>"u"||!Y.length)return 0;var z=td0.getTypeOf(Y)!=="string";if(z)return $m0(U|0,Y,Y.length,0);else return Ym0(U|0,Y,Y.length,0)}});var sg=E((xp1,R80)=>{var C80=I$(),Um0=$O(),zm0=n4();function rg(){C80.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0)}zm0.inherits(rg,C80);rg.prototype.processChunk=function($){this.streamInfo.crc32=Um0($.data,this.streamInfo.crc32||0),this.push($)};R80.exports=rg});var v80=E((fp1,_80)=>{var Qm0=n4(),ag=I$();function tg($){ag.call(this,"DataLengthProbe for "+$),this.propName=$,this.withStreamInfo($,0)}Qm0.inherits(tg,ag);tg.prototype.processChunk=function($){if($){var Y=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=Y+$.data.length}ag.prototype.processChunk.call(this,$)};_80.exports=tg});var YO=E((up1,g80)=>{var h80=zJ(),S80=og(),Jm0=sg(),eg=v80();function $y($,Y,U,z,Q){this.compressedSize=$,this.uncompressedSize=Y,this.crc32=U,this.compression=z,this.compressedContent=Q}$y.prototype={getContentWorker:function(){var $=new S80(h80.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new eg("data_length")),Y=this;return $.on("end",function(){if(this.streamInfo.data_length!==Y.uncompressedSize)throw Error("Bug : uncompressed data size mismatch")}),$},getCompressedWorker:function(){return new S80(h80.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize",this.compressedSize).withStreamInfo("uncompressedSize",this.uncompressedSize).withStreamInfo("crc32",this.crc32).withStreamInfo("compression",this.compression)}};$y.createWorkerFrom=function($,Y,U){return $.pipe(new Jm0).pipe(new eg("uncompressedSize")).pipe(Y.compressWorker(U)).pipe(new eg("compressedSize")).withStreamInfo("compression",Y)};g80.exports=$y});var f80=E((bp1,x80)=>{var Im0=mg(),Km0=og(),Yy=IJ(),Uy=YO(),y80=I$(),zy=function($,Y,U){this.name=$,this.dir=U.dir,this.date=U.date,this.comment=U.comment,this.unixPermissions=U.unixPermissions,this.dosPermissions=U.dosPermissions,this._data=Y,this._dataBinary=U.binary,this.options={compression:U.compression,compressionOptions:U.compressionOptions}};zy.prototype={internalStream:function($){var Y=null,U="string";try{if(!$)throw Error("No output type specified.");U=$.toLowerCase();var z=U==="string"||U==="text";if(U==="binarystring"||U==="text")U="string";Y=this._decompressWorker();var Q=!this._dataBinary;if(Q&&!z)Y=Y.pipe(new Yy.Utf8EncodeWorker);if(!Q&&z)Y=Y.pipe(new Yy.Utf8DecodeWorker)}catch(J){Y=new y80("error"),Y.error(J)}return new Im0(Y,U,"")},async:function($,Y){return this.internalStream($).accumulate(Y)},nodeStream:function($,Y){return this.internalStream($||"nodebuffer").toNodejsStream(Y)},_compressWorker:function($,Y){if(this._data instanceof Uy&&this._data.compression.magic===$.magic)return this._data.getCompressedWorker();else{var U=this._decompressWorker();if(!this._dataBinary)U=U.pipe(new Yy.Utf8EncodeWorker);return Uy.createWorkerFrom(U,$,Y)}},_decompressWorker:function(){if(this._data instanceof Uy)return this._data.getContentWorker();else if(this._data instanceof y80)return this._data;else return new Km0(this._data)}};var k80=["asText","asBinary","asNodeBuffer","asUint8Array","asArrayBuffer"],Gm0=function(){throw Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")};for(UW=0;UW{var Zm0=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Int32Array<"u";function qm0($,Y){return Object.prototype.hasOwnProperty.call($,Y)}Qy.assign=function($){var Y=Array.prototype.slice.call(arguments,1);while(Y.length){var U=Y.shift();if(!U)continue;if(typeof U!=="object")throw TypeError(U+"must be non-object");for(var z in U)if(qm0(U,z))$[z]=U[z]}return $};Qy.shrinkBuf=function($,Y){if($.length===Y)return $;if($.subarray)return $.subarray(0,Y);return $.length=Y,$};var Vm0={arraySet:function($,Y,U,z,Q){if(Y.subarray&&$.subarray){$.set(Y.subarray(U,U+z),Q);return}for(var J=0;J{var wm0=I3(),Mm0=4,b80=0,i80=1,Om0=2;function HJ($){var Y=$.length;while(--Y>=0)$[Y]=0}var Nm0=0,l80=1,Dm0=2,Am0=3,Bm0=258,Zy=29,GW=256,QW=GW+1+Zy,GJ=30,qy=19,o80=2*QW+1,rY=15,Iy=16,Pm0=7,Vy=256,r80=16,s80=17,a80=18,Wy=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],UO=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],Tm0=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],t80=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],jm0=512,K3=Array((QW+2)*2);HJ(K3);var zW=Array(GJ*2);HJ(zW);var JW=Array(jm0);HJ(JW);var IW=Array(Bm0-Am0+1);HJ(IW);var Ly=Array(Zy);HJ(Ly);var zO=Array(GJ);HJ(zO);function Ky($,Y,U,z,Q){this.static_tree=$,this.extra_bits=Y,this.extra_base=U,this.elems=z,this.max_length=Q,this.has_stree=$&&$.length}var e80,$$0,Y$0;function Gy($,Y){this.dyn_tree=$,this.max_code=0,this.stat_desc=Y}function U$0($){return $<256?JW[$]:JW[256+($>>>7)]}function KW($,Y){$.pending_buf[$.pending++]=Y&255,$.pending_buf[$.pending++]=Y>>>8&255}function n8($,Y,U){if($.bi_valid>Iy-U)$.bi_buf|=Y<<$.bi_valid&65535,KW($,$.bi_buf),$.bi_buf=Y>>Iy-$.bi_valid,$.bi_valid+=U-Iy;else $.bi_buf|=Y<<$.bi_valid&65535,$.bi_valid+=U}function e5($,Y,U){n8($,U[Y*2],U[Y*2+1])}function z$0($,Y){var U=0;do U|=$&1,$>>>=1,U<<=1;while(--Y>0);return U>>>1}function Em0($){if($.bi_valid===16)KW($,$.bi_buf),$.bi_buf=0,$.bi_valid=0;else if($.bi_valid>=8)$.pending_buf[$.pending++]=$.bi_buf&255,$.bi_buf>>=8,$.bi_valid-=8}function Cm0($,Y){var{dyn_tree:U,max_code:z}=Y,Q=Y.stat_desc.static_tree,J=Y.stat_desc.has_stree,I=Y.stat_desc.extra_bits,K=Y.stat_desc.extra_base,G=Y.stat_desc.max_length,H,W,X,Z,q,V,F=0;for(Z=0;Z<=rY;Z++)$.bl_count[Z]=0;U[$.heap[$.heap_max]*2+1]=0;for(H=$.heap_max+1;HG)Z=G,F++;if(U[W*2+1]=Z,W>z)continue;if($.bl_count[Z]++,q=0,W>=K)q=I[W-K];if(V=U[W*2],$.opt_len+=V*(Z+q),J)$.static_len+=V*(Q[W*2+1]+q)}if(F===0)return;do{Z=G-1;while($.bl_count[Z]===0)Z--;$.bl_count[Z]--,$.bl_count[Z+1]+=2,$.bl_count[G]--,F-=2}while(F>0);for(Z=G;Z!==0;Z--){W=$.bl_count[Z];while(W!==0){if(X=$.heap[--H],X>z)continue;if(U[X*2+1]!==Z)$.opt_len+=(Z-U[X*2+1])*U[X*2],U[X*2+1]=Z;W--}}}function Q$0($,Y,U){var z=Array(rY+1),Q=0,J,I;for(J=1;J<=rY;J++)z[J]=Q=Q+U[J-1]<<1;for(I=0;I<=Y;I++){var K=$[I*2+1];if(K===0)continue;$[I*2]=z$0(z[K]++,K)}}function Rm0(){var $,Y,U,z,Q,J=Array(rY+1);U=0;for(z=0;z>=7;for(;z8)KW($,$.bi_buf);else if($.bi_valid>0)$.pending_buf[$.pending++]=$.bi_buf;$.bi_buf=0,$.bi_valid=0}function _m0($,Y,U,z){if(I$0($),z)KW($,U),KW($,~U);wm0.arraySet($.pending_buf,$.window,Y,U,$.pending),$.pending+=U}function c80($,Y,U,z){var Q=Y*2,J=U*2;return $[Q]<$[J]||$[Q]===$[J]&&z[Y]<=z[U]}function Hy($,Y,U){var z=$.heap[U],Q=U<<1;while(Q<=$.heap_len){if(Q<$.heap_len&&c80(Y,$.heap[Q+1],$.heap[Q],$.depth))Q++;if(c80(Y,z,$.heap[Q],$.depth))break;$.heap[U]=$.heap[Q],U=Q,Q<<=1}$.heap[U]=z}function n80($,Y,U){var z,Q,J=0,I,K;if($.last_lit!==0)do if(z=$.pending_buf[$.d_buf+J*2]<<8|$.pending_buf[$.d_buf+J*2+1],Q=$.pending_buf[$.l_buf+J],J++,z===0)e5($,Q,Y);else{if(I=IW[Q],e5($,I+GW+1,Y),K=Wy[I],K!==0)Q-=Ly[I],n8($,Q,K);if(z--,I=U$0(z),e5($,I,U),K=UO[I],K!==0)z-=zO[I],n8($,z,K)}while(J<$.last_lit);e5($,Vy,Y)}function Xy($,Y){var U=Y.dyn_tree,z=Y.stat_desc.static_tree,Q=Y.stat_desc.has_stree,J=Y.stat_desc.elems,I,K,G=-1,H;$.heap_len=0,$.heap_max=o80;for(I=0;I>1;I>=1;I--)Hy($,U,I);H=J;do I=$.heap[1],$.heap[1]=$.heap[$.heap_len--],Hy($,U,1),K=$.heap[1],$.heap[--$.heap_max]=I,$.heap[--$.heap_max]=K,U[H*2]=U[I*2]+U[K*2],$.depth[H]=($.depth[I]>=$.depth[K]?$.depth[I]:$.depth[K])+1,U[I*2+1]=U[K*2+1]=H,$.heap[1]=H++,Hy($,U,1);while($.heap_len>=2);$.heap[--$.heap_max]=$.heap[1],Cm0($,Y),Q$0(U,G,$.bl_count)}function p80($,Y,U){var z,Q=-1,J,I=Y[1],K=0,G=7,H=4;if(I===0)G=138,H=3;Y[(U+1)*2+1]=65535;for(z=0;z<=U;z++){if(J=I,I=Y[(z+1)*2+1],++K=3;Y--)if($.bl_tree[t80[Y]*2+1]!==0)break;return $.opt_len+=3*(Y+1)+5+5+4,Y}function hm0($,Y,U,z){var Q;n8($,Y-257,5),n8($,U-1,5),n8($,z-4,4);for(Q=0;Q>>=1)if(Y&1&&$.dyn_ltree[U*2]!==0)return b80;if($.dyn_ltree[18]!==0||$.dyn_ltree[20]!==0||$.dyn_ltree[26]!==0)return i80;for(U=32;U0){if($.strm.data_type===Om0)$.strm.data_type=Sm0($);if(Xy($,$.l_desc),Xy($,$.d_desc),I=vm0($),Q=$.opt_len+3+7>>>3,J=$.static_len+3+7>>>3,J<=Q)Q=J}else Q=J=U+5;if(U+4<=Q&&Y!==-1)K$0($,Y,U,z);else if($.strategy===Mm0||J===Q)n8($,(l80<<1)+(z?1:0),3),n80($,K3,zW);else n8($,(Dm0<<1)+(z?1:0),3),hm0($,$.l_desc.max_code+1,$.d_desc.max_code+1,I+1),n80($,$.dyn_ltree,$.dyn_dtree);if(J$0($),z)I$0($)}function xm0($,Y,U){if($.pending_buf[$.d_buf+$.last_lit*2]=Y>>>8&255,$.pending_buf[$.d_buf+$.last_lit*2+1]=Y&255,$.pending_buf[$.l_buf+$.last_lit]=U&255,$.last_lit++,Y===0)$.dyn_ltree[U*2]++;else $.matches++,Y--,$.dyn_ltree[(IW[U]+GW+1)*2]++,$.dyn_dtree[U$0(Y)*2]++;return $.last_lit===$.lit_bufsize-1}fm0._tr_init=gm0;fm0._tr_stored_block=K$0;fm0._tr_flush_block=km0;fm0._tr_tally=xm0;fm0._tr_align=ym0});var Fy=E((np1,H$0)=>{function pm0($,Y,U,z){var Q=$&65535|0,J=$>>>16&65535|0,I=0;while(U!==0){I=U>2000?2000:U,U-=I;do Q=Q+Y[z++]|0,J=J+Q|0;while(--I);Q%=65521,J%=65521}return Q|J<<16|0}H$0.exports=pm0});var wy=E((pp1,W$0)=>{function dm0(){var $,Y=[];for(var U=0;U<256;U++){$=U;for(var z=0;z<8;z++)$=$&1?3988292384^$>>>1:$>>>1;Y[U]=$}return Y}var mm0=dm0();function lm0($,Y,U,z){var Q=mm0,J=z+U;$^=-1;for(var I=z;I>>8^Q[($^Y[I])&255];return $^-1}W$0.exports=lm0});var QO=E((dp1,X$0)=>{X$0.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}});var N$0=E((jl0)=>{var j8=I3(),j$=G$0(),L$0=Fy(),u7=wy(),om0=QO(),eY=0,rm0=1,sm0=3,p7=4,Z$0=5,Y9=0,q$0=1,E$=-2,am0=-3,My=-5,tm0=-1,em0=1,JO=2,$l0=3,Yl0=4,Ul0=0,zl0=2,HO=8,Ql0=9,Jl0=15,Il0=8,Kl0=29,Gl0=256,Ny=Gl0+1+Kl0,Hl0=30,Wl0=19,Xl0=2*Ny+1,Zl0=15,f1=3,c7=258,W5=c7+f1+1,ql0=32,WO=42,Dy=69,IO=73,KO=91,GO=103,sY=113,WW=666,B6=1,XW=2,aY=3,ZJ=4,Vl0=3;function n7($,Y){return $.msg=om0[Y],Y}function V$0($){return($<<1)-($>4?9:0)}function i7($){var Y=$.length;while(--Y>=0)$[Y]=0}function b7($){var Y=$.state,U=Y.pending;if(U>$.avail_out)U=$.avail_out;if(U===0)return;if(j8.arraySet($.output,Y.pending_buf,Y.pending_out,U,$.next_out),$.next_out+=U,Y.pending_out+=U,$.total_out+=U,$.avail_out-=U,Y.pending-=U,Y.pending===0)Y.pending_out=0}function m6($,Y){j$._tr_flush_block($,$.block_start>=0?$.block_start:-1,$.strstart-$.block_start,Y),$.block_start=$.strstart,b7($.strm)}function r1($,Y){$.pending_buf[$.pending++]=Y}function HW($,Y){$.pending_buf[$.pending++]=Y>>>8&255,$.pending_buf[$.pending++]=Y&255}function Ll0($,Y,U,z){var Q=$.avail_in;if(Q>z)Q=z;if(Q===0)return 0;if($.avail_in-=Q,j8.arraySet(Y,$.input,$.next_in,Q,U),$.state.wrap===1)$.adler=L$0($.adler,Y,Q,U);else if($.state.wrap===2)$.adler=u7($.adler,Y,Q,U);return $.next_in+=Q,$.total_in+=Q,Q}function F$0($,Y){var{max_chain_length:U,strstart:z}=$,Q,J,I=$.prev_length,K=$.nice_match,G=$.strstart>$.w_size-W5?$.strstart-($.w_size-W5):0,H=$.window,W=$.w_mask,X=$.prev,Z=$.strstart+c7,q=H[z+I-1],V=H[z+I];if($.prev_length>=$.good_match)U>>=2;if(K>$.lookahead)K=$.lookahead;do{if(Q=Y,H[Q+I]!==V||H[Q+I-1]!==q||H[Q]!==H[z]||H[++Q]!==H[z+1])continue;z+=2,Q++;do;while(H[++z]===H[++Q]&&H[++z]===H[++Q]&&H[++z]===H[++Q]&&H[++z]===H[++Q]&&H[++z]===H[++Q]&&H[++z]===H[++Q]&&H[++z]===H[++Q]&&H[++z]===H[++Q]&&zI){if($.match_start=Y,I=J,J>=K)break;q=H[z+I-1],V=H[z+I]}}while((Y=X[Y&W])>G&&--U!==0);if(I<=$.lookahead)return I;return $.lookahead}function tY($){var Y=$.w_size,U,z,Q,J,I;do{if(J=$.window_size-$.lookahead-$.strstart,$.strstart>=Y+(Y-W5)){j8.arraySet($.window,$.window,Y,Y,0),$.match_start-=Y,$.strstart-=Y,$.block_start-=Y,z=$.hash_size,U=z;do Q=$.head[--U],$.head[U]=Q>=Y?Q-Y:0;while(--z);z=Y,U=z;do Q=$.prev[--U],$.prev[U]=Q>=Y?Q-Y:0;while(--z);J+=Y}if($.strm.avail_in===0)break;if(z=Ll0($.strm,$.window,$.strstart+$.lookahead,J),$.lookahead+=z,$.lookahead+$.insert>=f1){I=$.strstart-$.insert,$.ins_h=$.window[I],$.ins_h=($.ins_h<<$.hash_shift^$.window[I+1])&$.hash_mask;while($.insert)if($.ins_h=($.ins_h<<$.hash_shift^$.window[I+f1-1])&$.hash_mask,$.prev[I&$.w_mask]=$.head[$.ins_h],$.head[$.ins_h]=I,I++,$.insert--,$.lookahead+$.insert$.pending_buf_size-5)U=$.pending_buf_size-5;for(;;){if($.lookahead<=1){if(tY($),$.lookahead===0&&Y===eY)return B6;if($.lookahead===0)break}$.strstart+=$.lookahead,$.lookahead=0;var z=$.block_start+U;if($.strstart===0||$.strstart>=z){if($.lookahead=$.strstart-z,$.strstart=z,m6($,!1),$.strm.avail_out===0)return B6}if($.strstart-$.block_start>=$.w_size-W5){if(m6($,!1),$.strm.avail_out===0)return B6}}if($.insert=0,Y===p7){if(m6($,!0),$.strm.avail_out===0)return aY;return ZJ}if($.strstart>$.block_start){if(m6($,!1),$.strm.avail_out===0)return B6}return B6}function Oy($,Y){var U,z;for(;;){if($.lookahead=f1)$.ins_h=($.ins_h<<$.hash_shift^$.window[$.strstart+f1-1])&$.hash_mask,U=$.prev[$.strstart&$.w_mask]=$.head[$.ins_h],$.head[$.ins_h]=$.strstart;if(U!==0&&$.strstart-U<=$.w_size-W5)$.match_length=F$0($,U);if($.match_length>=f1)if(z=j$._tr_tally($,$.strstart-$.match_start,$.match_length-f1),$.lookahead-=$.match_length,$.match_length<=$.max_lazy_match&&$.lookahead>=f1){$.match_length--;do $.strstart++,$.ins_h=($.ins_h<<$.hash_shift^$.window[$.strstart+f1-1])&$.hash_mask,U=$.prev[$.strstart&$.w_mask]=$.head[$.ins_h],$.head[$.ins_h]=$.strstart;while(--$.match_length!==0);$.strstart++}else $.strstart+=$.match_length,$.match_length=0,$.ins_h=$.window[$.strstart],$.ins_h=($.ins_h<<$.hash_shift^$.window[$.strstart+1])&$.hash_mask;else z=j$._tr_tally($,0,$.window[$.strstart]),$.lookahead--,$.strstart++;if(z){if(m6($,!1),$.strm.avail_out===0)return B6}}if($.insert=$.strstart=f1)$.ins_h=($.ins_h<<$.hash_shift^$.window[$.strstart+f1-1])&$.hash_mask,U=$.prev[$.strstart&$.w_mask]=$.head[$.ins_h],$.head[$.ins_h]=$.strstart;if($.prev_length=$.match_length,$.prev_match=$.match_start,$.match_length=f1-1,U!==0&&$.prev_length<$.max_lazy_match&&$.strstart-U<=$.w_size-W5){if($.match_length=F$0($,U),$.match_length<=5&&($.strategy===em0||$.match_length===f1&&$.strstart-$.match_start>4096))$.match_length=f1-1}if($.prev_length>=f1&&$.match_length<=$.prev_length){Q=$.strstart+$.lookahead-f1,z=j$._tr_tally($,$.strstart-1-$.prev_match,$.prev_length-f1),$.lookahead-=$.prev_length-1,$.prev_length-=2;do if(++$.strstart<=Q)$.ins_h=($.ins_h<<$.hash_shift^$.window[$.strstart+f1-1])&$.hash_mask,U=$.prev[$.strstart&$.w_mask]=$.head[$.ins_h],$.head[$.ins_h]=$.strstart;while(--$.prev_length!==0);if($.match_available=0,$.match_length=f1-1,$.strstart++,z){if(m6($,!1),$.strm.avail_out===0)return B6}}else if($.match_available){if(z=j$._tr_tally($,0,$.window[$.strstart-1]),z)m6($,!1);if($.strstart++,$.lookahead--,$.strm.avail_out===0)return B6}else $.match_available=1,$.strstart++,$.lookahead--}if($.match_available)z=j$._tr_tally($,0,$.window[$.strstart-1]),$.match_available=0;if($.insert=$.strstart=f1&&$.strstart>0){if(Q=$.strstart-1,z=I[Q],z===I[++Q]&&z===I[++Q]&&z===I[++Q]){J=$.strstart+c7;do;while(z===I[++Q]&&z===I[++Q]&&z===I[++Q]&&z===I[++Q]&&z===I[++Q]&&z===I[++Q]&&z===I[++Q]&&z===I[++Q]&&Q$.lookahead)$.match_length=$.lookahead}}if($.match_length>=f1)U=j$._tr_tally($,1,$.match_length-f1),$.lookahead-=$.match_length,$.strstart+=$.match_length,$.match_length=0;else U=j$._tr_tally($,0,$.window[$.strstart]),$.lookahead--,$.strstart++;if(U){if(m6($,!1),$.strm.avail_out===0)return B6}}if($.insert=0,Y===p7){if(m6($,!0),$.strm.avail_out===0)return aY;return ZJ}if($.last_lit){if(m6($,!1),$.strm.avail_out===0)return B6}return XW}function Ml0($,Y){var U;for(;;){if($.lookahead===0){if(tY($),$.lookahead===0){if(Y===eY)return B6;break}}if($.match_length=0,U=j$._tr_tally($,0,$.window[$.strstart]),$.lookahead--,$.strstart++,U){if(m6($,!1),$.strm.avail_out===0)return B6}}if($.insert=0,Y===p7){if(m6($,!0),$.strm.avail_out===0)return aY;return ZJ}if($.last_lit){if(m6($,!1),$.strm.avail_out===0)return B6}return XW}function $9($,Y,U,z,Q){this.good_length=$,this.max_lazy=Y,this.nice_length=U,this.max_chain=z,this.func=Q}var XJ;XJ=[new $9(0,0,0,0,Fl0),new $9(4,4,8,4,Oy),new $9(4,5,16,8,Oy),new $9(4,6,32,32,Oy),new $9(4,4,16,16,WJ),new $9(8,16,32,32,WJ),new $9(8,16,128,128,WJ),new $9(8,32,128,256,WJ),new $9(32,128,258,1024,WJ),new $9(32,258,258,4096,WJ)];function Ol0($){$.window_size=2*$.w_size,i7($.head),$.max_lazy_match=XJ[$.level].max_lazy,$.good_match=XJ[$.level].good_length,$.nice_match=XJ[$.level].nice_length,$.max_chain_length=XJ[$.level].max_chain,$.strstart=0,$.block_start=0,$.lookahead=0,$.insert=0,$.match_length=$.prev_length=f1-1,$.match_available=0,$.ins_h=0}function Nl0(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=HO,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new j8.Buf16(Xl0*2),this.dyn_dtree=new j8.Buf16((2*Hl0+1)*2),this.bl_tree=new j8.Buf16((2*Wl0+1)*2),i7(this.dyn_ltree),i7(this.dyn_dtree),i7(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new j8.Buf16(Zl0+1),this.heap=new j8.Buf16(2*Ny+1),i7(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new j8.Buf16(2*Ny+1),i7(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function w$0($){var Y;if(!$||!$.state)return n7($,E$);if($.total_in=$.total_out=0,$.data_type=zl0,Y=$.state,Y.pending=0,Y.pending_out=0,Y.wrap<0)Y.wrap=-Y.wrap;return Y.status=Y.wrap?WO:sY,$.adler=Y.wrap===2?0:1,Y.last_flush=eY,j$._tr_init(Y),Y9}function M$0($){var Y=w$0($);if(Y===Y9)Ol0($.state);return Y}function Dl0($,Y){if(!$||!$.state)return E$;if($.state.wrap!==2)return E$;return $.state.gzhead=Y,Y9}function O$0($,Y,U,z,Q,J){if(!$)return E$;var I=1;if(Y===tm0)Y=6;if(z<0)I=0,z=-z;else if(z>15)I=2,z-=16;if(Q<1||Q>Ql0||U!==HO||z<8||z>15||Y<0||Y>9||J<0||J>Yl0)return n7($,E$);if(z===8)z=9;var K=new Nl0;return $.state=K,K.strm=$,K.wrap=I,K.gzhead=null,K.w_bits=z,K.w_size=1<Z$0||Y<0)return $?n7($,E$):E$;if(z=$.state,!$.output||!$.input&&$.avail_in!==0||z.status===WW&&Y!==p7)return n7($,$.avail_out===0?My:E$);if(z.strm=$,U=z.last_flush,z.last_flush=Y,z.status===WO)if(z.wrap===2)if($.adler=0,r1(z,31),r1(z,139),r1(z,8),!z.gzhead)r1(z,0),r1(z,0),r1(z,0),r1(z,0),r1(z,0),r1(z,z.level===9?2:z.strategy>=JO||z.level<2?4:0),r1(z,Vl0),z.status=sY;else{if(r1(z,(z.gzhead.text?1:0)+(z.gzhead.hcrc?2:0)+(!z.gzhead.extra?0:4)+(!z.gzhead.name?0:8)+(!z.gzhead.comment?0:16)),r1(z,z.gzhead.time&255),r1(z,z.gzhead.time>>8&255),r1(z,z.gzhead.time>>16&255),r1(z,z.gzhead.time>>24&255),r1(z,z.level===9?2:z.strategy>=JO||z.level<2?4:0),r1(z,z.gzhead.os&255),z.gzhead.extra&&z.gzhead.extra.length)r1(z,z.gzhead.extra.length&255),r1(z,z.gzhead.extra.length>>8&255);if(z.gzhead.hcrc)$.adler=u7($.adler,z.pending_buf,z.pending,0);z.gzindex=0,z.status=Dy}else{var I=HO+(z.w_bits-8<<4)<<8,K=-1;if(z.strategy>=JO||z.level<2)K=0;else if(z.level<6)K=1;else if(z.level===6)K=2;else K=3;if(I|=K<<6,z.strstart!==0)I|=ql0;if(I+=31-I%31,z.status=sY,HW(z,I),z.strstart!==0)HW(z,$.adler>>>16),HW(z,$.adler&65535);$.adler=1}if(z.status===Dy)if(z.gzhead.extra){Q=z.pending;while(z.gzindex<(z.gzhead.extra.length&65535)){if(z.pending===z.pending_buf_size){if(z.gzhead.hcrc&&z.pending>Q)$.adler=u7($.adler,z.pending_buf,z.pending-Q,Q);if(b7($),Q=z.pending,z.pending===z.pending_buf_size)break}r1(z,z.gzhead.extra[z.gzindex]&255),z.gzindex++}if(z.gzhead.hcrc&&z.pending>Q)$.adler=u7($.adler,z.pending_buf,z.pending-Q,Q);if(z.gzindex===z.gzhead.extra.length)z.gzindex=0,z.status=IO}else z.status=IO;if(z.status===IO)if(z.gzhead.name){Q=z.pending;do{if(z.pending===z.pending_buf_size){if(z.gzhead.hcrc&&z.pending>Q)$.adler=u7($.adler,z.pending_buf,z.pending-Q,Q);if(b7($),Q=z.pending,z.pending===z.pending_buf_size){J=1;break}}if(z.gzindexQ)$.adler=u7($.adler,z.pending_buf,z.pending-Q,Q);if(J===0)z.gzindex=0,z.status=KO}else z.status=KO;if(z.status===KO)if(z.gzhead.comment){Q=z.pending;do{if(z.pending===z.pending_buf_size){if(z.gzhead.hcrc&&z.pending>Q)$.adler=u7($.adler,z.pending_buf,z.pending-Q,Q);if(b7($),Q=z.pending,z.pending===z.pending_buf_size){J=1;break}}if(z.gzindexQ)$.adler=u7($.adler,z.pending_buf,z.pending-Q,Q);if(J===0)z.status=GO}else z.status=GO;if(z.status===GO)if(z.gzhead.hcrc){if(z.pending+2>z.pending_buf_size)b7($);if(z.pending+2<=z.pending_buf_size)r1(z,$.adler&255),r1(z,$.adler>>8&255),$.adler=0,z.status=sY}else z.status=sY;if(z.pending!==0){if(b7($),$.avail_out===0)return z.last_flush=-1,Y9}else if($.avail_in===0&&V$0(Y)<=V$0(U)&&Y!==p7)return n7($,My);if(z.status===WW&&$.avail_in!==0)return n7($,My);if($.avail_in!==0||z.lookahead!==0||Y!==eY&&z.status!==WW){var G=z.strategy===JO?Ml0(z,Y):z.strategy===$l0?wl0(z,Y):XJ[z.level].func(z,Y);if(G===aY||G===ZJ)z.status=WW;if(G===B6||G===aY){if($.avail_out===0)z.last_flush=-1;return Y9}if(G===XW){if(Y===rm0)j$._tr_align(z);else if(Y!==Z$0){if(j$._tr_stored_block(z,0,0,!1),Y===sm0){if(i7(z.head),z.lookahead===0)z.strstart=0,z.block_start=0,z.insert=0}}if(b7($),$.avail_out===0)return z.last_flush=-1,Y9}}if(Y!==p7)return Y9;if(z.wrap<=0)return q$0;if(z.wrap===2)r1(z,$.adler&255),r1(z,$.adler>>8&255),r1(z,$.adler>>16&255),r1(z,$.adler>>24&255),r1(z,$.total_in&255),r1(z,$.total_in>>8&255),r1(z,$.total_in>>16&255),r1(z,$.total_in>>24&255);else HW(z,$.adler>>>16),HW(z,$.adler&65535);if(b7($),z.wrap>0)z.wrap=-z.wrap;return z.pending!==0?Y9:q$0}function Pl0($){var Y;if(!$||!$.state)return E$;if(Y=$.state.status,Y!==WO&&Y!==Dy&&Y!==IO&&Y!==KO&&Y!==GO&&Y!==sY&&Y!==WW)return n7($,E$);return $.state=null,Y===sY?n7($,am0):Y9}function Tl0($,Y){var U=Y.length,z,Q,J,I,K,G,H,W;if(!$||!$.state)return E$;if(z=$.state,I=z.wrap,I===2||I===1&&z.status!==WO||z.lookahead)return E$;if(I===1)$.adler=L$0($.adler,Y,U,0);if(z.wrap=0,U>=z.w_size){if(I===0)i7(z.head),z.strstart=0,z.block_start=0,z.insert=0;W=new j8.Buf8(z.w_size),j8.arraySet(W,Y,U-z.w_size,z.w_size,0),Y=W,U=z.w_size}K=$.avail_in,G=$.next_in,H=$.input,$.avail_in=U,$.next_in=0,$.input=Y,tY(z);while(z.lookahead>=f1){Q=z.strstart,J=z.lookahead-(f1-1);do z.ins_h=(z.ins_h<{var XO=I3(),D$0=!0,A$0=!0;try{String.fromCharCode.apply(null,[0])}catch($){D$0=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch($){A$0=!1}var ZW=new XO.Buf8(256);for(U9=0;U9<256;U9++)ZW[U9]=U9>=252?6:U9>=248?5:U9>=240?4:U9>=224?3:U9>=192?2:1;var U9;ZW[254]=ZW[254]=1;kl0.string2buf=function($){var Y,U,z,Q,J,I=$.length,K=0;for(Q=0;Q>>6,Y[J++]=128|U&63;else if(U<65536)Y[J++]=224|U>>>12,Y[J++]=128|U>>>6&63,Y[J++]=128|U&63;else Y[J++]=240|U>>>18,Y[J++]=128|U>>>12&63,Y[J++]=128|U>>>6&63,Y[J++]=128|U&63}return Y};function B$0($,Y){if(Y<65534){if($.subarray&&A$0||!$.subarray&&D$0)return String.fromCharCode.apply(null,XO.shrinkBuf($,Y))}var U="";for(var z=0;z4){K[z++]=65533,U+=J-1;continue}Q&=J===2?31:J===3?15:7;while(J>1&&U1){K[z++]=65533;continue}if(Q<65536)K[z++]=Q;else Q-=65536,K[z++]=55296|Q>>10&1023,K[z++]=56320|Q&1023}return B$0(K,z)};kl0.utf8border=function($,Y){var U;if(Y=Y||$.length,Y>$.length)Y=$.length;U=Y-1;while(U>=0&&($[U]&192)===128)U--;if(U<0)return Y;if(U===0)return Y;return U+ZW[$[U]]>Y?U:Y}});var By=E((op1,P$0)=>{function cl0(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}P$0.exports=cl0});var C$0=E((sl0)=>{var qW=N$0(),VW=I3(),Ty=Ay(),jy=QO(),nl0=By(),E$0=Object.prototype.toString,pl0=0,Py=4,qJ=0,T$0=1,j$0=2,dl0=-1,ml0=0,ll0=8;function $U($){if(!(this instanceof $U))return new $U($);this.options=VW.assign({level:dl0,method:ll0,chunkSize:16384,windowBits:15,memLevel:8,strategy:ml0,to:""},$||{});var Y=this.options;if(Y.raw&&Y.windowBits>0)Y.windowBits=-Y.windowBits;else if(Y.gzip&&Y.windowBits>0&&Y.windowBits<16)Y.windowBits+=16;this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new nl0,this.strm.avail_out=0;var U=qW.deflateInit2(this.strm,Y.level,Y.method,Y.windowBits,Y.memLevel,Y.strategy);if(U!==qJ)throw Error(jy[U]);if(Y.header)qW.deflateSetHeader(this.strm,Y.header);if(Y.dictionary){var z;if(typeof Y.dictionary==="string")z=Ty.string2buf(Y.dictionary);else if(E$0.call(Y.dictionary)==="[object ArrayBuffer]")z=new Uint8Array(Y.dictionary);else z=Y.dictionary;if(U=qW.deflateSetDictionary(this.strm,z),U!==qJ)throw Error(jy[U]);this._dict_set=!0}}$U.prototype.push=function($,Y){var U=this.strm,z=this.options.chunkSize,Q,J;if(this.ended)return!1;if(J=Y===~~Y?Y:Y===!0?Py:pl0,typeof $==="string")U.input=Ty.string2buf($);else if(E$0.call($)==="[object ArrayBuffer]")U.input=new Uint8Array($);else U.input=$;U.next_in=0,U.avail_in=U.input.length;do{if(U.avail_out===0)U.output=new VW.Buf8(z),U.next_out=0,U.avail_out=z;if(Q=qW.deflate(U,J),Q!==T$0&&Q!==qJ)return this.onEnd(Q),this.ended=!0,!1;if(U.avail_out===0||U.avail_in===0&&(J===Py||J===j$0))if(this.options.to==="string")this.onData(Ty.buf2binstring(VW.shrinkBuf(U.output,U.next_out)));else this.onData(VW.shrinkBuf(U.output,U.next_out))}while((U.avail_in>0||U.avail_out===0)&&Q!==T$0);if(J===Py)return Q=qW.deflateEnd(this.strm),this.onEnd(Q),this.ended=!0,Q===qJ;if(J===j$0)return this.onEnd(qJ),U.avail_out=0,!0;return!0};$U.prototype.onData=function($){this.chunks.push($)};$U.prototype.onEnd=function($){if($===qJ)if(this.options.to==="string")this.result=this.chunks.join("");else this.result=VW.flattenChunks(this.chunks);this.chunks=[],this.err=$,this.msg=this.strm.msg};function Ey($,Y){var U=new $U(Y);if(U.push($,!0),U.err)throw U.msg||jy[U.err];return U.result}function ol0($,Y){return Y=Y||{},Y.raw=!0,Ey($,Y)}function rl0($,Y){return Y=Y||{},Y.gzip=!0,Ey($,Y)}sl0.Deflate=$U;sl0.deflate=Ey;sl0.deflateRaw=ol0;sl0.gzip=rl0});var _$0=E((sp1,R$0)=>{var ZO=30,Yo0=12;R$0.exports=function(Y,U){var z,Q,J,I,K,G,H,W,X,Z,q,V,F,M,w,N,O,D,P,T,A,j,C,b,x;z=Y.state,Q=Y.next_in,b=Y.input,J=Q+(Y.avail_in-5),I=Y.next_out,x=Y.output,K=I-(U-Y.avail_out),G=I+(Y.avail_out-257),H=z.dmax,W=z.wsize,X=z.whave,Z=z.wnext,q=z.window,V=z.hold,F=z.bits,M=z.lencode,w=z.distcode,N=(1<>>24,V>>>=P,F-=P,P=D>>>16&255,P===0)x[I++]=D&65535;else if(P&16){if(T=D&65535,P&=15,P){if(F>>=P,F-=P}if(F<15)V+=b[Q++]<>>24,V>>>=P,F-=P,P=D>>>16&255,P&16){if(A=D&65535,P&=15,FH){Y.msg="invalid distance too far back",z.mode=ZO;break $}if(V>>>=P,F-=P,P=I-K,A>P){if(P=A-P,P>X){if(z.sane){Y.msg="invalid distance too far back",z.mode=ZO;break $}}if(j=0,C=q,Z===0){if(j+=W-P,P2)x[I++]=C[j++],x[I++]=C[j++],x[I++]=C[j++],T-=3;if(T){if(x[I++]=C[j++],T>1)x[I++]=C[j++]}}else{j=I-A;do x[I++]=x[j++],x[I++]=x[j++],x[I++]=x[j++],T-=3;while(T>2);if(T){if(x[I++]=x[j++],T>1)x[I++]=x[j++]}}}else if((P&64)===0){D=w[(D&65535)+(V&(1<>3,Q-=T,F-=T<<3,V&=(1<{var v$0=I3(),VJ=15,h$0=852,S$0=592,g$0=0,Cy=1,y$0=2,Uo0=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],zo0=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],Qo0=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],Jo0=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];k$0.exports=function(Y,U,z,Q,J,I,K,G){var H=G.bits,W=0,X=0,Z=0,q=0,V=0,F=0,M=0,w=0,N=0,O=0,D,P,T,A,j,C=null,b=0,x,S=new v$0.Buf16(VJ+1),i=new v$0.Buf16(VJ+1),c=null,z0=0,k,d,t;for(W=0;W<=VJ;W++)S[W]=0;for(X=0;X=1;q--)if(S[q]!==0)break;if(V>q)V=q;if(q===0)return J[I++]=20971520,J[I++]=20971520,G.bits=1,0;for(Z=1;Z0&&(Y===g$0||q!==1))return-1;i[1]=0;for(W=1;Wh$0||Y===y$0&&N>S$0)return 1;for(;;){if(k=W-M,K[X]x)d=c[z0+K[X]],t=C[b+K[X]];else d=96,t=0;D=1<>M)+P]=k<<24|d<<16|t|0;while(P!==0);D=1<>=1;if(D!==0)O&=D-1,O+=D;else O=0;if(X++,--S[W]===0){if(W===q)break;W=U[z+K[X]]}if(W>V&&(O&A)!==T){if(M===0)M=V;j+=Z,F=W-M,w=1<h$0||Y===y$0&&N>S$0)return 1;T=O&A,J[T]=V<<24|F<<16|j-I|0}}if(O!==0)J[j+O]=W-M<<24|4194304|0;return G.bits=V,0}});var M50=E((Po0)=>{var K$=I3(),gy=Fy(),z9=wy(),Io0=_$0(),LW=x$0(),Ko0=0,H50=1,W50=2,f$0=4,Go0=5,qO=6,YU=0,Ho0=1,Wo0=2,C$=-2,X50=-3,yy=-4,Xo0=-5,u$0=8,Z50=1,b$0=2,i$0=3,c$0=4,n$0=5,p$0=6,d$0=7,m$0=8,l$0=9,o$0=10,FO=11,G3=12,Ry=13,r$0=14,_y=15,s$0=16,a$0=17,t$0=18,e$0=19,VO=20,LO=21,$50=22,Y50=23,U50=24,z50=25,Q50=26,vy=27,J50=28,I50=29,y4=30,ky=31,Zo0=32,qo0=852,Vo0=592,Lo0=15,Fo0=Lo0;function K50($){return($>>>24&255)+($>>>8&65280)+(($&65280)<<8)+(($&255)<<24)}function wo0(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new K$.Buf16(320),this.work=new K$.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function q50($){var Y;if(!$||!$.state)return C$;if(Y=$.state,$.total_in=$.total_out=Y.total=0,$.msg="",Y.wrap)$.adler=Y.wrap&1;return Y.mode=Z50,Y.last=0,Y.havedict=0,Y.dmax=32768,Y.head=null,Y.hold=0,Y.bits=0,Y.lencode=Y.lendyn=new K$.Buf32(qo0),Y.distcode=Y.distdyn=new K$.Buf32(Vo0),Y.sane=1,Y.back=-1,YU}function V50($){var Y;if(!$||!$.state)return C$;return Y=$.state,Y.wsize=0,Y.whave=0,Y.wnext=0,q50($)}function L50($,Y){var U,z;if(!$||!$.state)return C$;if(z=$.state,Y<0)U=0,Y=-Y;else if(U=(Y>>4)+1,Y<48)Y&=15;if(Y&&(Y<8||Y>15))return C$;if(z.window!==null&&z.wbits!==Y)z.window=null;return z.wrap=U,z.wbits=Y,V50($)}function F50($,Y){var U,z;if(!$)return C$;if(z=new wo0,$.state=z,z.window=null,U=L50($,Y),U!==YU)$.state=null;return U}function Mo0($){return F50($,Fo0)}var G50=!0,hy,Sy;function Oo0($){if(G50){var Y;hy=new K$.Buf32(512),Sy=new K$.Buf32(32),Y=0;while(Y<144)$.lens[Y++]=8;while(Y<256)$.lens[Y++]=9;while(Y<280)$.lens[Y++]=7;while(Y<288)$.lens[Y++]=8;LW(H50,$.lens,0,288,hy,0,$.work,{bits:9}),Y=0;while(Y<32)$.lens[Y++]=5;LW(W50,$.lens,0,32,Sy,0,$.work,{bits:5}),G50=!1}$.lencode=hy,$.lenbits=9,$.distcode=Sy,$.distbits=5}function w50($,Y,U,z){var Q,J=$.state;if(J.window===null)J.wsize=1<=J.wsize)K$.arraySet(J.window,Y,U-J.wsize,J.wsize,0),J.wnext=0,J.whave=J.wsize;else{if(Q=J.wsize-J.wnext,Q>z)Q=z;if(K$.arraySet(J.window,Y,U-z,Q,J.wnext),z-=Q,z)K$.arraySet(J.window,Y,U-z,z,0),J.wnext=z,J.whave=J.wsize;else{if(J.wnext+=Q,J.wnext===J.wsize)J.wnext=0;if(J.whave>>8&255,U.check=z9(U.check,C,2,0),H=0,W=0,U.mode=b$0;break}if(U.flags=0,U.head)U.head.done=!1;if(!(U.wrap&1)||(((H&255)<<8)+(H>>8))%31){$.msg="incorrect header check",U.mode=y4;break}if((H&15)!==u$0){$.msg="unknown compression method",U.mode=y4;break}if(H>>>=4,W-=4,A=(H&15)+8,U.wbits===0)U.wbits=A;else if(A>U.wbits){$.msg="invalid window size",U.mode=y4;break}U.dmax=1<>8&1;if(U.flags&512)C[0]=H&255,C[1]=H>>>8&255,U.check=z9(U.check,C,2,0);H=0,W=0,U.mode=i$0;case i$0:while(W<32){if(K===0)break $;K--,H+=z[J++]<>>8&255,C[2]=H>>>16&255,C[3]=H>>>24&255,U.check=z9(U.check,C,4,0);H=0,W=0,U.mode=c$0;case c$0:while(W<16){if(K===0)break $;K--,H+=z[J++]<>8;if(U.flags&512)C[0]=H&255,C[1]=H>>>8&255,U.check=z9(U.check,C,2,0);H=0,W=0,U.mode=n$0;case n$0:if(U.flags&1024){while(W<16){if(K===0)break $;K--,H+=z[J++]<>>8&255,U.check=z9(U.check,C,2,0);H=0,W=0}else if(U.head)U.head.extra=null;U.mode=p$0;case p$0:if(U.flags&1024){if(q=U.length,q>K)q=K;if(q){if(U.head){if(A=U.head.extra_len-U.length,!U.head.extra)U.head.extra=Array(U.head.extra_len);K$.arraySet(U.head.extra,z,J,q,A)}if(U.flags&512)U.check=z9(U.check,z,q,J);K-=q,J+=q,U.length-=q}if(U.length)break $}U.length=0,U.mode=d$0;case d$0:if(U.flags&2048){if(K===0)break $;q=0;do if(A=z[J+q++],U.head&&A&&U.length<65536)U.head.name+=String.fromCharCode(A);while(A&&q>9&1,U.head.done=!0;$.adler=U.check=0,U.mode=G3;break;case o$0:while(W<32){if(K===0)break $;K--,H+=z[J++]<>>=W&7,W-=W&7,U.mode=vy;break}while(W<3){if(K===0)break $;K--,H+=z[J++]<>>=1,W-=1,H&3){case 0:U.mode=r$0;break;case 1:if(Oo0(U),U.mode=VO,Y===qO){H>>>=2,W-=2;break $}break;case 2:U.mode=a$0;break;case 3:$.msg="invalid block type",U.mode=y4}H>>>=2,W-=2;break;case r$0:H>>>=W&7,W-=W&7;while(W<32){if(K===0)break $;K--,H+=z[J++]<>>16^65535)){$.msg="invalid stored block lengths",U.mode=y4;break}if(U.length=H&65535,H=0,W=0,U.mode=_y,Y===qO)break $;case _y:U.mode=s$0;case s$0:if(q=U.length,q){if(q>K)q=K;if(q>G)q=G;if(q===0)break $;K$.arraySet(Q,z,J,q,I),K-=q,J+=q,G-=q,I+=q,U.length-=q;break}U.mode=G3;break;case a$0:while(W<14){if(K===0)break $;K--,H+=z[J++]<>>=5,W-=5,U.ndist=(H&31)+1,H>>>=5,W-=5,U.ncode=(H&15)+4,H>>>=4,W-=4,U.nlen>286||U.ndist>30){$.msg="too many length or distance symbols",U.mode=y4;break}U.have=0,U.mode=t$0;case t$0:while(U.have>>=3,W-=3}while(U.have<19)U.lens[S[U.have++]]=0;if(U.lencode=U.lendyn,U.lenbits=7,b={bits:U.lenbits},j=LW(Ko0,U.lens,0,19,U.lencode,0,U.work,b),U.lenbits=b.bits,j){$.msg="invalid code lengths set",U.mode=y4;break}U.have=0,U.mode=e$0;case e$0:while(U.have>>24,N=M>>>16&255,O=M&65535,w<=W)break;if(K===0)break $;K--,H+=z[J++]<>>=w,W-=w,U.lens[U.have++]=O;else{if(O===16){x=w+2;while(W>>=w,W-=w,U.have===0){$.msg="invalid bit length repeat",U.mode=y4;break}A=U.lens[U.have-1],q=3+(H&3),H>>>=2,W-=2}else if(O===17){x=w+3;while(W>>=w,W-=w,A=0,q=3+(H&7),H>>>=3,W-=3}else{x=w+7;while(W>>=w,W-=w,A=0,q=11+(H&127),H>>>=7,W-=7}if(U.have+q>U.nlen+U.ndist){$.msg="invalid bit length repeat",U.mode=y4;break}while(q--)U.lens[U.have++]=A}}if(U.mode===y4)break;if(U.lens[256]===0){$.msg="invalid code -- missing end-of-block",U.mode=y4;break}if(U.lenbits=9,b={bits:U.lenbits},j=LW(H50,U.lens,0,U.nlen,U.lencode,0,U.work,b),U.lenbits=b.bits,j){$.msg="invalid literal/lengths set",U.mode=y4;break}if(U.distbits=6,U.distcode=U.distdyn,b={bits:U.distbits},j=LW(W50,U.lens,U.nlen,U.ndist,U.distcode,0,U.work,b),U.distbits=b.bits,j){$.msg="invalid distances set",U.mode=y4;break}if(U.mode=VO,Y===qO)break $;case VO:U.mode=LO;case LO:if(K>=6&&G>=258){if($.next_out=I,$.avail_out=G,$.next_in=J,$.avail_in=K,U.hold=H,U.bits=W,Io0($,Z),I=$.next_out,Q=$.output,G=$.avail_out,J=$.next_in,z=$.input,K=$.avail_in,H=U.hold,W=U.bits,U.mode===G3)U.back=-1;break}U.back=0;for(;;){if(M=U.lencode[H&(1<>>24,N=M>>>16&255,O=M&65535,w<=W)break;if(K===0)break $;K--,H+=z[J++]<>D)],w=M>>>24,N=M>>>16&255,O=M&65535,D+w<=W)break;if(K===0)break $;K--,H+=z[J++]<>>=D,W-=D,U.back+=D}if(H>>>=w,W-=w,U.back+=w,U.length=O,N===0){U.mode=Q50;break}if(N&32){U.back=-1,U.mode=G3;break}if(N&64){$.msg="invalid literal/length code",U.mode=y4;break}U.extra=N&15,U.mode=$50;case $50:if(U.extra){x=U.extra;while(W>>=U.extra,W-=U.extra,U.back+=U.extra}U.was=U.length,U.mode=Y50;case Y50:for(;;){if(M=U.distcode[H&(1<>>24,N=M>>>16&255,O=M&65535,w<=W)break;if(K===0)break $;K--,H+=z[J++]<>D)],w=M>>>24,N=M>>>16&255,O=M&65535,D+w<=W)break;if(K===0)break $;K--,H+=z[J++]<>>=D,W-=D,U.back+=D}if(H>>>=w,W-=w,U.back+=w,N&64){$.msg="invalid distance code",U.mode=y4;break}U.offset=O,U.extra=N&15,U.mode=U50;case U50:if(U.extra){x=U.extra;while(W>>=U.extra,W-=U.extra,U.back+=U.extra}if(U.offset>U.dmax){$.msg="invalid distance too far back",U.mode=y4;break}U.mode=z50;case z50:if(G===0)break $;if(q=Z-G,U.offset>q){if(q=U.offset-q,q>U.whave){if(U.sane){$.msg="invalid distance too far back",U.mode=y4;break}}if(q>U.wnext)q-=U.wnext,V=U.wsize-q;else V=U.wnext-q;if(q>U.length)q=U.length;F=U.window}else F=Q,V=I-U.offset,q=U.length;if(q>G)q=G;G-=q,U.length-=q;do Q[I++]=F[V++];while(--q);if(U.length===0)U.mode=LO;break;case Q50:if(G===0)break $;Q[I++]=U.length,G--,U.mode=LO;break;case vy:if(U.wrap){while(W<32){if(K===0)break $;K--,H|=z[J++]<{O50.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}});var D50=E(($d1,N50)=>{function yo0(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}N50.exports=yo0});var B50=E((uo0)=>{var LJ=M50(),FW=I3(),wO=Ay(),G6=xy(),fy=QO(),ko0=By(),xo0=D50(),A50=Object.prototype.toString;function UU($){if(!(this instanceof UU))return new UU($);this.options=FW.assign({chunkSize:16384,windowBits:0,to:""},$||{});var Y=this.options;if(Y.raw&&Y.windowBits>=0&&Y.windowBits<16){if(Y.windowBits=-Y.windowBits,Y.windowBits===0)Y.windowBits=-15}if(Y.windowBits>=0&&Y.windowBits<16&&!($&&$.windowBits))Y.windowBits+=32;if(Y.windowBits>15&&Y.windowBits<48){if((Y.windowBits&15)===0)Y.windowBits|=15}this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new ko0,this.strm.avail_out=0;var U=LJ.inflateInit2(this.strm,Y.windowBits);if(U!==G6.Z_OK)throw Error(fy[U]);if(this.header=new xo0,LJ.inflateGetHeader(this.strm,this.header),Y.dictionary){if(typeof Y.dictionary==="string")Y.dictionary=wO.string2buf(Y.dictionary);else if(A50.call(Y.dictionary)==="[object ArrayBuffer]")Y.dictionary=new Uint8Array(Y.dictionary);if(Y.raw){if(U=LJ.inflateSetDictionary(this.strm,Y.dictionary),U!==G6.Z_OK)throw Error(fy[U])}}}UU.prototype.push=function($,Y){var U=this.strm,z=this.options.chunkSize,Q=this.options.dictionary,J,I,K,G,H,W=!1;if(this.ended)return!1;if(I=Y===~~Y?Y:Y===!0?G6.Z_FINISH:G6.Z_NO_FLUSH,typeof $==="string")U.input=wO.binstring2buf($);else if(A50.call($)==="[object ArrayBuffer]")U.input=new Uint8Array($);else U.input=$;U.next_in=0,U.avail_in=U.input.length;do{if(U.avail_out===0)U.output=new FW.Buf8(z),U.next_out=0,U.avail_out=z;if(J=LJ.inflate(U,G6.Z_NO_FLUSH),J===G6.Z_NEED_DICT&&Q)J=LJ.inflateSetDictionary(this.strm,Q);if(J===G6.Z_BUF_ERROR&&W===!0)J=G6.Z_OK,W=!1;if(J!==G6.Z_STREAM_END&&J!==G6.Z_OK)return this.onEnd(J),this.ended=!0,!1;if(U.next_out){if(U.avail_out===0||J===G6.Z_STREAM_END||U.avail_in===0&&(I===G6.Z_FINISH||I===G6.Z_SYNC_FLUSH))if(this.options.to==="string"){if(K=wO.utf8border(U.output,U.next_out),G=U.next_out-K,H=wO.buf2string(U.output,K),U.next_out=G,U.avail_out=z-G,G)FW.arraySet(U.output,U.output,K,G,0);this.onData(H)}else this.onData(FW.shrinkBuf(U.output,U.next_out))}if(U.avail_in===0&&U.avail_out===0)W=!0}while((U.avail_in>0||U.avail_out===0)&&J!==G6.Z_STREAM_END);if(J===G6.Z_STREAM_END)I=G6.Z_FINISH;if(I===G6.Z_FINISH)return J=LJ.inflateEnd(this.strm),this.onEnd(J),this.ended=!0,J===G6.Z_OK;if(I===G6.Z_SYNC_FLUSH)return this.onEnd(G6.Z_OK),U.avail_out=0,!0;return!0};UU.prototype.onData=function($){this.chunks.push($)};UU.prototype.onEnd=function($){if($===G6.Z_OK)if(this.options.to==="string")this.result=this.chunks.join("");else this.result=FW.flattenChunks(this.chunks);this.chunks=[],this.err=$,this.msg=this.strm.msg};function uy($,Y){var U=new UU(Y);if(U.push($,!0),U.err)throw U.msg||fy[U.err];return U.result}function fo0($,Y){return Y=Y||{},Y.raw=!0,uy($,Y)}uo0.Inflate=UU;uo0.inflate=uy;uo0.inflateRaw=fo0;uo0.ungzip=uy});var j50=E((Ud1,T50)=>{var po0=I3().assign,do0=C$0(),mo0=B50(),lo0=xy(),P50={};po0(P50,do0,mo0,lo0);T50.exports=P50});var C50=E((ao0)=>{var oo0=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Uint32Array<"u",ro0=j50(),E50=n4(),MO=I$(),so0=oo0?"uint8array":"array";ao0.magic="\b\x00";function zU($,Y){MO.call(this,"FlateWorker/"+$),this._pako=null,this._pakoAction=$,this._pakoOptions=Y,this.meta={}}E50.inherits(zU,MO);zU.prototype.processChunk=function($){if(this.meta=$.meta,this._pako===null)this._createPako();this._pako.push(E50.transformTo(so0,$.data),!1)};zU.prototype.flush=function(){if(MO.prototype.flush.call(this),this._pako===null)this._createPako();this._pako.push([],!0)};zU.prototype.cleanUp=function(){MO.prototype.cleanUp.call(this),this._pako=null};zU.prototype._createPako=function(){this._pako=new ro0[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var $=this;this._pako.onData=function(Y){$.push({data:Y,meta:$.meta})}};ao0.compressWorker=function($){return new zU("Deflate",$)};ao0.uncompressWorker=function(){return new zU("Inflate",{})}});var by=E((Yr0)=>{var R50=I$();Yr0.STORE={magic:"\x00\x00",compressWorker:function(){return new R50("STORE compression")},uncompressWorker:function(){return new R50("STORE decompression")}};Yr0.DEFLATE=C50()});var iy=E((Qr0)=>{Qr0.LOCAL_FILE_HEADER="PK\x03\x04";Qr0.CENTRAL_FILE_HEADER="PK\x01\x02";Qr0.CENTRAL_DIRECTORY_END="PK\x05\x06";Qr0.ZIP64_CENTRAL_DIRECTORY_LOCATOR="PK\x06\x07";Qr0.ZIP64_CENTRAL_DIRECTORY_END="PK\x06\x06";Qr0.DATA_DESCRIPTOR="PK\x07\b"});var S50=E((Id1,h50)=>{var FJ=n4(),wJ=I$(),cy=IJ(),_50=$O(),OO=iy(),O4=function($,Y){var U="",z;for(z=0;z>>8;return U},Xr0=function($,Y){var U=$;if(!$)U=Y?16893:33204;return(U&65535)<<16},Zr0=function($){return($||0)&63},v50=function($,Y,U,z,Q,J){var{file:I,compression:K}=$,G=J!==cy.utf8encode,H=FJ.transformTo("string",J(I.name)),W=FJ.transformTo("string",cy.utf8encode(I.name)),X=I.comment,Z=FJ.transformTo("string",J(X)),q=FJ.transformTo("string",cy.utf8encode(X)),V=W.length!==I.name.length,F=q.length!==X.length,M,w,N="",O="",D="",P=I.dir,T=I.date,A={crc32:0,compressedSize:0,uncompressedSize:0};if(!Y||U)A.crc32=$.crc32,A.compressedSize=$.compressedSize,A.uncompressedSize=$.uncompressedSize;var j=0;if(Y)j|=8;if(!G&&(V||F))j|=2048;var C=0,b=0;if(P)C|=16;if(Q==="UNIX")b=798,C|=Xr0(I.unixPermissions,P);else b=20,C|=Zr0(I.dosPermissions,P);if(M=T.getUTCHours(),M=M<<6,M=M|T.getUTCMinutes(),M=M<<5,M=M|T.getUTCSeconds()/2,w=T.getUTCFullYear()-1980,w=w<<4,w=w|T.getUTCMonth()+1,w=w<<5,w=w|T.getUTCDate(),V)O=O4(1,1)+O4(_50(H),4)+W,N+="up"+O4(O.length,2)+O;if(F)D=O4(1,1)+O4(_50(Z),4)+q,N+="uc"+O4(D.length,2)+D;var x="";x+=` \x00`,x+=O4(j,2),x+=K.magic,x+=O4(M,2),x+=O4(w,2),x+=O4(A.crc32,4),x+=O4(A.compressedSize,4),x+=O4(A.uncompressedSize,4),x+=O4(H.length,2),x+=O4(N.length,2);var S=OO.LOCAL_FILE_HEADER+x+H+N,i=OO.CENTRAL_FILE_HEADER+O4(b,2)+x+O4(Z.length,2)+"\x00\x00\x00\x00"+O4(C,4)+O4(z,4)+H+N+Z;return{fileRecord:S,dirRecord:i}},qr0=function($,Y,U,z,Q){var J="",I=FJ.transformTo("string",Q(z));return J=OO.CENTRAL_DIRECTORY_END+"\x00\x00\x00\x00"+O4($,2)+O4($,2)+O4(Y,4)+O4(U,4)+O4(I.length,2)+I,J},Vr0=function($){var Y="";return Y=OO.DATA_DESCRIPTOR+O4($.crc32,4)+O4($.compressedSize,4)+O4($.uncompressedSize,4),Y};function X5($,Y,U,z){wJ.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=Y,this.zipPlatform=U,this.encodeFileName=z,this.streamFiles=$,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}FJ.inherits(X5,wJ);X5.prototype.push=function($){var Y=$.meta.percent||0,U=this.entriesCount,z=this._sources.length;if(this.accumulate)this.contentBuffer.push($);else this.bytesWritten+=$.data.length,wJ.prototype.push.call(this,{data:$.data,meta:{currentFile:this.currentFile,percent:U?(Y+100*(U-z-1))/U:100}})};X5.prototype.openedSource=function($){this.currentSourceOffset=this.bytesWritten,this.currentFile=$.file.name;var Y=this.streamFiles&&!$.file.dir;if(Y){var U=v50($,Y,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:U.fileRecord,meta:{percent:0}})}else this.accumulate=!0};X5.prototype.closedSource=function($){this.accumulate=!1;var Y=this.streamFiles&&!$.file.dir,U=v50($,Y,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(U.dirRecord),Y)this.push({data:Vr0($),meta:{percent:100}});else{this.push({data:U.fileRecord,meta:{percent:0}});while(this.contentBuffer.length)this.push(this.contentBuffer.shift())}this.currentFile=null};X5.prototype.flush=function(){var $=this.bytesWritten;for(var Y=0;Y{var Lr0=by(),Fr0=S50(),wr0=function($,Y){var U=$||Y,z=Lr0[U];if(!z)throw Error(U+" is not a valid compression method !");return z};Mr0.generateWorker=function($,Y,U){var z=new Fr0(Y.streamFiles,U,Y.platform,Y.encodeFileName),Q=0;try{$.forEach(function(J,I){Q++;var K=wr0(I.options.compression,Y.compression),G=I.options.compressionOptions||Y.compressionOptions||{},H=I.dir,W=I.date;I._compressWorker(K,G).withStreamInfo("file",{name:J,dir:H,date:W,comment:I.comment||"",unixPermissions:I.unixPermissions,dosPermissions:I.dosPermissions}).pipe(z)}),z.entriesCount=Q}catch(J){z.error(J)}return z}});var k50=E((Gd1,y50)=>{var Nr0=n4(),NO=I$();function wW($,Y){NO.call(this,"Nodejs stream input adapter for "+$),this._upstreamEnded=!1,this._bindStream(Y)}Nr0.inherits(wW,NO);wW.prototype._bindStream=function($){var Y=this;this._stream=$,$.pause(),$.on("data",function(U){Y.push({data:U,meta:{percent:0}})}).on("error",function(U){if(Y.isPaused)this.generatedError=U;else Y.error(U)}).on("end",function(){if(Y.isPaused)Y._upstreamEnded=!0;else Y.end()})};wW.prototype.pause=function(){if(!NO.prototype.pause.call(this))return!1;return this._stream.pause(),!0};wW.prototype.resume=function(){if(!NO.prototype.resume.call(this))return!1;if(this._upstreamEnded)this.end();else this._stream.resume();return!0};y50.exports=wW});var m50=E((Hd1,d50)=>{var Dr0=IJ(),MW=n4(),b50=I$(),Ar0=mg(),i50=lg(),x50=YO(),Br0=f80(),Pr0=g50(),f50=sH(),Tr0=k50(),c50=function($,Y,U){var z=MW.getTypeOf(Y),Q,J=MW.extend(U||{},i50);if(J.date=J.date||new Date,J.compression!==null)J.compression=J.compression.toUpperCase();if(typeof J.unixPermissions==="string")J.unixPermissions=parseInt(J.unixPermissions,8);if(J.unixPermissions&&J.unixPermissions&16384)J.dir=!0;if(J.dosPermissions&&J.dosPermissions&16)J.dir=!0;if(J.dir)$=n50($);if(J.createFolders&&(Q=jr0($)))p50.call(this,Q,!0);var I=z==="string"&&J.binary===!1&&J.base64===!1;if(!U||typeof U.binary>"u")J.binary=!I;var K=Y instanceof x50&&Y.uncompressedSize===0;if(K||J.dir||!Y||Y.length===0)J.base64=!1,J.binary=!0,Y="",J.compression="STORE",z="string";var G=null;if(Y instanceof x50||Y instanceof b50)G=Y;else if(f50.isNode&&f50.isStream(Y))G=new Tr0($,Y);else G=MW.prepareContent($,Y,J.binary,J.optimizedBinaryString,J.base64);var H=new Br0($,G,J);this.files[$]=H},jr0=function($){if($.slice(-1)==="/")$=$.substring(0,$.length-1);var Y=$.lastIndexOf("/");return Y>0?$.substring(0,Y):""},n50=function($){if($.slice(-1)!=="/")$+="/";return $},p50=function($,Y){if(Y=typeof Y<"u"?Y:i50.createFolders,$=n50($),!this.files[$])c50.call(this,$,null,{dir:!0,createFolders:Y});return this.files[$]};function u50($){return Object.prototype.toString.call($)==="[object RegExp]"}var Er0={load:function(){throw Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},forEach:function($){var Y,U,z;for(Y in this.files)if(z=this.files[Y],U=Y.slice(this.root.length,Y.length),U&&Y.slice(0,this.root.length)===this.root)$(U,z)},filter:function($){var Y=[];return this.forEach(function(U,z){if($(U,z))Y.push(z)}),Y},file:function($,Y,U){if(arguments.length===1)if(u50($)){var z=$;return this.filter(function(J,I){return!I.dir&&z.test(J)})}else{var Q=this.files[this.root+$];if(Q&&!Q.dir)return Q;else return null}else $=this.root+$,c50.call(this,$,Y,U);return this},folder:function($){if(!$)return this;if(u50($))return this.filter(function(Q,J){return J.dir&&$.test(Q)});var Y=this.root+$,U=p50.call(this,Y),z=this.clone();return z.root=U.name,z},remove:function($){$=this.root+$;var Y=this.files[$];if(!Y){if($.slice(-1)!=="/")$+="/";Y=this.files[$]}if(Y&&!Y.dir)delete this.files[$];else{var U=this.filter(function(Q,J){return J.name.slice(0,$.length)===$});for(var z=0;z{var Cr0=n4();function l50($){this.data=$,this.length=$.length,this.index=0,this.zero=0}l50.prototype={checkOffset:function($){this.checkIndex(this.index+$)},checkIndex:function($){if(this.length=this.index;U--)Y=(Y<<8)+this.byteAt(U);return this.index+=$,Y},readString:function($){return Cr0.transformTo("string",this.readData($))},readData:function(){},lastIndexOfSignature:function(){},readAndCheckSignature:function(){},readDate:function(){var $=this.readInt(4);return new Date(Date.UTC(($>>25&127)+1980,($>>21&15)-1,$>>16&31,$>>11&31,$>>5&63,($&31)<<1))}};o50.exports=l50});var py=E((Xd1,s50)=>{var r50=ny(),Rr0=n4();function MJ($){r50.call(this,$);for(var Y=0;Y=0;--J)if(this.data[J]===Y&&this.data[J+1]===U&&this.data[J+2]===z&&this.data[J+3]===Q)return J-this.zero;return-1};MJ.prototype.readAndCheckSignature=function($){var Y=$.charCodeAt(0),U=$.charCodeAt(1),z=$.charCodeAt(2),Q=$.charCodeAt(3),J=this.readData(4);return Y===J[0]&&U===J[1]&&z===J[2]&&Q===J[3]};MJ.prototype.readData=function($){if(this.checkOffset($),$===0)return[];var Y=this.data.slice(this.zero+this.index,this.zero+this.index+$);return this.index+=$,Y};s50.exports=MJ});var e50=E((Zd1,t50)=>{var a50=ny(),_r0=n4();function OJ($){a50.call(this,$)}_r0.inherits(OJ,a50);OJ.prototype.byteAt=function($){return this.data.charCodeAt(this.zero+$)};OJ.prototype.lastIndexOfSignature=function($){return this.data.lastIndexOf($)-this.zero};OJ.prototype.readAndCheckSignature=function($){var Y=this.readData(4);return $===Y};OJ.prototype.readData=function($){this.checkOffset($);var Y=this.data.slice(this.zero+this.index,this.zero+this.index+$);return this.index+=$,Y};t50.exports=OJ});var my=E((qd1,Y90)=>{var $90=py(),vr0=n4();function dy($){$90.call(this,$)}vr0.inherits(dy,$90);dy.prototype.readData=function($){if(this.checkOffset($),$===0)return new Uint8Array(0);var Y=this.data.subarray(this.zero+this.index,this.zero+this.index+$);return this.index+=$,Y};Y90.exports=dy});var Q90=E((Vd1,z90)=>{var U90=my(),hr0=n4();function ly($){U90.call(this,$)}hr0.inherits(ly,U90);ly.prototype.readData=function($){this.checkOffset($);var Y=this.data.slice(this.zero+this.index,this.zero+this.index+$);return this.index+=$,Y};z90.exports=ly});var oy=E((Ld1,I90)=>{var DO=n4(),J90=J3(),Sr0=py(),gr0=e50(),yr0=Q90(),kr0=my();I90.exports=function($){var Y=DO.getTypeOf($);if(DO.checkSupport(Y),Y==="string"&&!J90.uint8array)return new gr0($);if(Y==="nodebuffer")return new yr0($);if(J90.uint8array)return new kr0(DO.transformTo("uint8array",$));return new Sr0(DO.transformTo("array",$))}});var W90=E((Fd1,H90)=>{var ry=oy(),d7=n4(),xr0=YO(),K90=$O(),AO=IJ(),BO=by(),fr0=J3(),ur0=0,br0=3,ir0=function($){for(var Y in BO){if(!Object.prototype.hasOwnProperty.call(BO,Y))continue;if(BO[Y].magic===$)return BO[Y]}return null};function G90($,Y){this.options=$,this.loadOptions=Y}G90.prototype={isEncrypted:function(){return(this.bitFlag&1)===1},useUTF8:function(){return(this.bitFlag&2048)===2048},readLocalPart:function($){var Y,U;if($.skip(22),this.fileNameLength=$.readInt(2),U=$.readInt(2),this.fileName=$.readData(this.fileNameLength),$.skip(U),this.compressedSize===-1||this.uncompressedSize===-1)throw Error("Bug or corrupted zip : didn't get enough information from the central directory (compressedSize === -1 || uncompressedSize === -1)");if(Y=ir0(this.compressionMethod),Y===null)throw Error("Corrupted zip : compression "+d7.pretty(this.compressionMethod)+" unknown (inner file : "+d7.transformTo("string",this.fileName)+")");this.decompressed=new xr0(this.compressedSize,this.uncompressedSize,this.crc32,Y,$.readData(this.compressedSize))},readCentralPart:function($){this.versionMadeBy=$.readInt(2),$.skip(2),this.bitFlag=$.readInt(2),this.compressionMethod=$.readString(2),this.date=$.readDate(),this.crc32=$.readInt(4),this.compressedSize=$.readInt(4),this.uncompressedSize=$.readInt(4);var Y=$.readInt(2);if(this.extraFieldsLength=$.readInt(2),this.fileCommentLength=$.readInt(2),this.diskNumberStart=$.readInt(2),this.internalFileAttributes=$.readInt(2),this.externalFileAttributes=$.readInt(4),this.localHeaderOffset=$.readInt(4),this.isEncrypted())throw Error("Encrypted zip are not supported");$.skip(Y),this.readExtraFields($),this.parseZIP64ExtraField($),this.fileComment=$.readData(this.fileCommentLength)},processAttributes:function(){this.unixPermissions=null,this.dosPermissions=null;var $=this.versionMadeBy>>8;if(this.dir=this.externalFileAttributes&16?!0:!1,$===ur0)this.dosPermissions=this.externalFileAttributes&63;if($===br0)this.unixPermissions=this.externalFileAttributes>>16&65535;if(!this.dir&&this.fileNameStr.slice(-1)==="/")this.dir=!0},parseZIP64ExtraField:function(){if(!this.extraFields[1])return;var $=ry(this.extraFields[1].value);if(this.uncompressedSize===d7.MAX_VALUE_32BITS)this.uncompressedSize=$.readInt(8);if(this.compressedSize===d7.MAX_VALUE_32BITS)this.compressedSize=$.readInt(8);if(this.localHeaderOffset===d7.MAX_VALUE_32BITS)this.localHeaderOffset=$.readInt(8);if(this.diskNumberStart===d7.MAX_VALUE_32BITS)this.diskNumberStart=$.readInt(4)},readExtraFields:function($){var Y=$.index+this.extraFieldsLength,U,z,Q;if(!this.extraFields)this.extraFields={};while($.index+4{var cr0=oy(),H3=n4(),Z5=iy(),nr0=W90(),pr0=J3();function X90($){this.files=[],this.loadOptions=$}X90.prototype={checkSignature:function($){if(!this.reader.readAndCheckSignature($)){this.reader.index-=4;var Y=this.reader.readString(4);throw Error("Corrupted zip or bug: unexpected signature ("+H3.pretty(Y)+", expected "+H3.pretty($)+")")}},isSignature:function($,Y){var U=this.reader.index;this.reader.setIndex($);var z=this.reader.readString(4),Q=z===Y;return this.reader.setIndex(U),Q},readBlockEndOfCentral:function(){this.diskNumber=this.reader.readInt(2),this.diskWithCentralDirStart=this.reader.readInt(2),this.centralDirRecordsOnThisDisk=this.reader.readInt(2),this.centralDirRecords=this.reader.readInt(2),this.centralDirSize=this.reader.readInt(4),this.centralDirOffset=this.reader.readInt(4),this.zipCommentLength=this.reader.readInt(2);var $=this.reader.readData(this.zipCommentLength),Y=pr0.uint8array?"uint8array":"array",U=H3.transformTo(Y,$);this.zipComment=this.loadOptions.decodeFileName(U)},readBlockZip64EndOfCentral:function(){this.zip64EndOfCentralSize=this.reader.readInt(8),this.reader.skip(4),this.diskNumber=this.reader.readInt(4),this.diskWithCentralDirStart=this.reader.readInt(4),this.centralDirRecordsOnThisDisk=this.reader.readInt(8),this.centralDirRecords=this.reader.readInt(8),this.centralDirSize=this.reader.readInt(8),this.centralDirOffset=this.reader.readInt(8),this.zip64ExtensibleData={};var $=this.zip64EndOfCentralSize-44,Y=0,U,z,Q;while(Y<$)U=this.reader.readInt(2),z=this.reader.readInt(4),Q=this.reader.readData(z),this.zip64ExtensibleData[U]={id:U,length:z,value:Q}},readBlockZip64EndOfCentralLocator:function(){if(this.diskWithZip64CentralDirStart=this.reader.readInt(4),this.relativeOffsetEndOfZip64CentralDir=this.reader.readInt(8),this.disksCount=this.reader.readInt(4),this.disksCount>1)throw Error("Multi-volumes zip are not supported")},readLocalFiles:function(){var $,Y;for($=0;$0)if(this.isSignature(U,Z5.CENTRAL_FILE_HEADER));else this.reader.zero=Q;else if(Q<0)throw Error("Corrupted zip: missing "+Math.abs(Q)+" bytes.")},prepareReader:function($){this.reader=cr0($)},load:function($){this.prepareReader($),this.readEndOfCentral(),this.readCentralDir(),this.readLocalFiles()}};Z90.exports=X90});var F90=E((Md1,L90)=>{var sy=n4(),PO=zJ(),dr0=IJ(),mr0=q90(),lr0=sg(),V90=sH();function or0($){return new PO.Promise(function(Y,U){var z=$.decompressed.getContentWorker().pipe(new lr0);z.on("error",function(Q){U(Q)}).on("end",function(){if(z.streamInfo.crc32!==$.decompressed.crc32)U(Error("Corrupted zip : CRC32 mismatch"));else Y()}).resume()})}L90.exports=function($,Y){var U=this;if(Y=sy.extend(Y||{},{base64:!1,checkCRC32:!1,optimizedBinaryString:!1,createFolders:!1,decodeFileName:dr0.utf8decode}),V90.isNode&&V90.isStream($))return PO.Promise.reject(Error("JSZip can't accept a stream when loading a zip file."));return sy.prepareContent("the loaded zip file",$,!0,Y.optimizedBinaryString,Y.base64).then(function(z){var Q=new mr0(Y);return Q.load(z),Q}).then(function(Q){var J=[PO.Promise.resolve(Q)],I=Q.files;if(Y.checkCRC32)for(var K=0;K{function R$(){if(!(this instanceof R$))return new R$;if(arguments.length)throw Error("The constructor with parameters has been removed in JSZip 3.0, please check the upgrade guide.");this.files=Object.create(null),this.comment=null,this.root="",this.clone=function(){var $=new R$;for(var Y in this)if(typeof this[Y]!=="function")$[Y]=this[Y];return $}}R$.prototype=m50();R$.prototype.loadAsync=F90();R$.support=J3();R$.defaults=lg();R$.version="3.10.1";R$.loadAsync=function($,Y){return new R$().loadAsync($,Y)};R$.external=zJ();w90.exports=R$});var B90=E((Nd1,A90)=>{function M90($,Y){var U=Object.keys($);if(Object.getOwnPropertySymbols){var z=Object.getOwnPropertySymbols($);Y&&(z=z.filter(function(Q){return Object.getOwnPropertyDescriptor($,Q).enumerable})),U.push.apply(U,z)}return U}function O90($){for(var Y=1;Y0)this.tail.next=z;else this.head=z;this.tail=z,++this.length}},{key:"unshift",value:function(U){var z={data:U,next:this.head};if(this.length===0)this.tail=z;this.head=z,++this.length}},{key:"shift",value:function(){if(this.length===0)return;var U=this.head.data;if(this.length===1)this.head=this.tail=null;else this.head=this.head.next;return--this.length,U}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(U){if(this.length===0)return"";var z=this.head,Q=""+z.data;while(z=z.next)Q+=U+z.data;return Q}},{key:"concat",value:function(U){if(this.length===0)return TO.alloc(0);var z=TO.allocUnsafe(U>>>0),Q=this.head,J=0;while(Q)Us0(Q.data,z,J),J+=Q.data.length,Q=Q.next;return z}},{key:"consume",value:function(U,z){var Q;if(UI.length?I.length:U;if(K===I.length)J+=I;else J+=I.slice(0,U);if(U-=K,U===0){if(K===I.length)if(++Q,z.next)this.head=z.next;else this.head=this.tail=null;else this.head=z,z.data=I.slice(K);break}++Q}return this.length-=Q,J}},{key:"_getBuffer",value:function(U){var z=TO.allocUnsafe(U),Q=this.head,J=1;Q.data.copy(z),U-=Q.data.length;while(Q=Q.next){var I=Q.data,K=U>I.length?I.length:U;if(I.copy(z,z.length-U,0,K),U-=K,U===0){if(K===I.length)if(++J,Q.next)this.head=Q.next;else this.head=this.tail=null;else this.head=Q,Q.data=I.slice(K);break}++J}return this.length-=J,z}},{key:Ys0,value:function(U,z){return ty(this,O90(O90({},z),{},{depth:0,customInspect:!1}))}}]),$}()});var $k=E((Dd1,T90)=>{function zs0($,Y){var U=this,z=this._readableState&&this._readableState.destroyed,Q=this._writableState&&this._writableState.destroyed;if(z||Q){if(Y)Y($);else if($){if(!this._writableState)process.nextTick(ey,this,$);else if(!this._writableState.errorEmitted)this._writableState.errorEmitted=!0,process.nextTick(ey,this,$)}return this}if(this._readableState)this._readableState.destroyed=!0;if(this._writableState)this._writableState.destroyed=!0;return this._destroy($||null,function(J){if(!Y&&J)if(!U._writableState)process.nextTick(P90,U,J);else if(!U._writableState.errorEmitted)U._writableState.errorEmitted=!0,process.nextTick(P90,U,J);else process.nextTick(jO,U);else if(Y)process.nextTick(jO,U),Y(J);else process.nextTick(jO,U)}),this}function P90($,Y){ey($,Y),jO($)}function jO($){if($._writableState&&!$._writableState.emitClose)return;if($._readableState&&!$._readableState.emitClose)return;$.emit("close")}function Qs0(){if(this._readableState)this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1;if(this._writableState)this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1}function ey($,Y){$.emit("error",Y)}function Js0($,Y){var{_readableState:U,_writableState:z}=$;if(U&&U.autoDestroy||z&&z.autoDestroy)$.destroy(Y);else $.emit("error",Y)}T90.exports={destroy:zs0,undestroy:Qs0,errorOrDestroy:Js0}});var m7=E((Hs0,C90)=>{var E90={};function _$($,Y,U){if(!U)U=Error;function z(J,I,K){if(typeof Y==="string")return Y;else return Y(J,I,K)}class Q extends U{constructor(J,I,K){super(z(J,I,K))}}Q.prototype.name=U.name,Q.prototype.code=$,E90[$]=Q}function j90($,Y){if(Array.isArray($)){let U=$.length;if($=$.map((z)=>String(z)),U>2)return`one of ${Y} ${$.slice(0,U-1).join(", ")}, or `+$[U-1];else if(U===2)return`one of ${Y} ${$[0]} or ${$[1]}`;else return`of ${Y} ${$[0]}`}else return`of ${Y} ${String($)}`}function Is0($,Y,U){return $.substr(!U||U<0?0:+U,Y.length)===Y}function Ks0($,Y,U){if(U===void 0||U>$.length)U=$.length;return $.substring(U-Y.length,U)===Y}function Gs0($,Y,U){if(typeof U!=="number")U=0;if(U+Y.length>$.length)return!1;else return $.indexOf(Y,U)!==-1}_$("ERR_INVALID_OPT_VALUE",function($,Y){return'The value "'+Y+'" is invalid for option "'+$+'"'},TypeError);_$("ERR_INVALID_ARG_TYPE",function($,Y,U){let z;if(typeof Y==="string"&&Is0(Y,"not "))z="must not be",Y=Y.replace(/^not /,"");else z="must be";let Q;if(Ks0($," argument"))Q=`The ${$} ${z} ${j90(Y,"type")}`;else{let J=Gs0($,".")?"property":"argument";Q=`The "${$}" ${J} ${z} ${j90(Y,"type")}`}return Q+=`. Received type ${typeof U}`,Q},TypeError);_$("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF");_$("ERR_METHOD_NOT_IMPLEMENTED",function($){return"The "+$+" method is not implemented"});_$("ERR_STREAM_PREMATURE_CLOSE","Premature close");_$("ERR_STREAM_DESTROYED",function($){return"Cannot call "+$+" after a stream was destroyed"});_$("ERR_MULTIPLE_CALLBACK","Callback called multiple times");_$("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable");_$("ERR_STREAM_WRITE_AFTER_END","write after end");_$("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError);_$("ERR_UNKNOWN_ENCODING",function($){return"Unknown encoding: "+$},TypeError);_$("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event");Hs0.codes=E90});var Yk=E((Ad1,R90)=>{var Xs0=m7().codes.ERR_INVALID_OPT_VALUE;function Zs0($,Y,U){return $.highWaterMark!=null?$.highWaterMark:Y?$[U]:null}function qs0($,Y,U,z){var Q=Zs0(Y,z,U);if(Q!=null){if(!(isFinite(Q)&&Math.floor(Q)===Q)||Q<0){var J=z?U:"highWaterMark";throw new Xs0(J,Q)}return Math.floor(Q)}return $.objectMode?16:16384}R90.exports={getHighWaterMark:qs0}});var Qk=E((Bd1,y90)=>{y90.exports=U6;function v90($){var Y=this;this.next=null,this.entry=null,this.finish=function(){bs0(Y,$)}}var NJ;U6.WritableState=NW;var Vs0={deprecate:y7()},h90=I0("stream"),CO=I0("buffer").Buffer,Ls0=(typeof global<"u"?global:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function Fs0($){return CO.from($)}function ws0($){return CO.isBuffer($)||$ instanceof Ls0}var zk=$k(),Ms0=Yk(),Os0=Ms0.getHighWaterMark,l7=m7().codes,Ns0=l7.ERR_INVALID_ARG_TYPE,Ds0=l7.ERR_METHOD_NOT_IMPLEMENTED,As0=l7.ERR_MULTIPLE_CALLBACK,Bs0=l7.ERR_STREAM_CANNOT_PIPE,Ps0=l7.ERR_STREAM_DESTROYED,Ts0=l7.ERR_STREAM_NULL_VALUES,js0=l7.ERR_STREAM_WRITE_AFTER_END,Es0=l7.ERR_UNKNOWN_ENCODING,DJ=zk.errorOrDestroy;X1()(U6,h90);function Cs0(){}function NW($,Y,U){if(NJ=NJ||QU(),$=$||{},typeof U!=="boolean")U=Y instanceof NJ;if(this.objectMode=!!$.objectMode,U)this.objectMode=this.objectMode||!!$.writableObjectMode;this.highWaterMark=Os0(this,$,"writableHighWaterMark",U),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var z=$.decodeStrings===!1;this.decodeStrings=!z,this.defaultEncoding=$.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(Q){ys0(Y,Q)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=$.emitClose!==!1,this.autoDestroy=!!$.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new v90(this)}NW.prototype.getBuffer=function(){var Y=this.bufferedRequest,U=[];while(Y)U.push(Y),Y=Y.next;return U};(function(){try{Object.defineProperty(NW.prototype,"buffer",{get:Vs0.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch($){}})();var EO;if(typeof Symbol==="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]==="function")EO=Function.prototype[Symbol.hasInstance],Object.defineProperty(U6,Symbol.hasInstance,{value:function(Y){if(EO.call(this,Y))return!0;if(this!==U6)return!1;return Y&&Y._writableState instanceof NW}});else EO=function(Y){return Y instanceof this};function U6($){NJ=NJ||QU();var Y=this instanceof NJ;if(!Y&&!EO.call(U6,this))return new U6($);if(this._writableState=new NW($,this,Y),this.writable=!0,$){if(typeof $.write==="function")this._write=$.write;if(typeof $.writev==="function")this._writev=$.writev;if(typeof $.destroy==="function")this._destroy=$.destroy;if(typeof $.final==="function")this._final=$.final}h90.call(this)}U6.prototype.pipe=function(){DJ(this,new Bs0)};function Rs0($,Y){var U=new js0;DJ($,U),process.nextTick(Y,U)}function _s0($,Y,U,z){var Q;if(U===null)Q=new Ts0;else if(typeof U!=="string"&&!Y.objectMode)Q=new Ns0("chunk",["string","Buffer"],U);if(Q)return DJ($,Q),process.nextTick(z,Q),!1;return!0}U6.prototype.write=function($,Y,U){var z=this._writableState,Q=!1,J=!z.objectMode&&ws0($);if(J&&!CO.isBuffer($))$=Fs0($);if(typeof Y==="function")U=Y,Y=null;if(J)Y="buffer";else if(!Y)Y=z.defaultEncoding;if(typeof U!=="function")U=Cs0;if(z.ending)Rs0(this,U);else if(J||_s0(this,z,$,U))z.pendingcb++,Q=hs0(this,z,J,$,Y,U);return Q};U6.prototype.cork=function(){this._writableState.corked++};U6.prototype.uncork=function(){var $=this._writableState;if($.corked){if($.corked--,!$.writing&&!$.corked&&!$.bufferProcessing&&$.bufferedRequest)S90(this,$)}};U6.prototype.setDefaultEncoding=function(Y){if(typeof Y==="string")Y=Y.toLowerCase();if(!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((Y+"").toLowerCase())>-1))throw new Es0(Y);return this._writableState.defaultEncoding=Y,this};Object.defineProperty(U6.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});function vs0($,Y,U){if(!$.objectMode&&$.decodeStrings!==!1&&typeof Y==="string")Y=CO.from(Y,U);return Y}Object.defineProperty(U6.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function hs0($,Y,U,z,Q,J){if(!U){var I=vs0(Y,z,Q);if(z!==I)U=!0,Q="buffer",z=I}var K=Y.objectMode?1:z.length;Y.length+=K;var G=Y.length{var is0=Object.keys||function($){var Y=[];for(var U in $)Y.push(U);return Y};x90.exports=Q9;var k90=Ik(),Jk=Qk();X1()(Q9,k90);{RO=is0(Jk.prototype);for(DW=0;DW{/*! safe-buffer. MIT License. Feross Aboukhadijeh */var _O=I0("buffer"),J9=_O.Buffer;function f90($,Y){for(var U in $)Y[U]=$[U]}if(J9.from&&J9.alloc&&J9.allocUnsafe&&J9.allocUnsafeSlow)u90.exports=_O;else f90(_O,Kk),Kk.Buffer=JU;function JU($,Y,U){return J9($,Y,U)}JU.prototype=Object.create(J9.prototype);f90(J9,JU);JU.from=function($,Y,U){if(typeof $==="number")throw TypeError("Argument must not be a number");return J9($,Y,U)};JU.alloc=function($,Y,U){if(typeof $!=="number")throw TypeError("Argument must be a number");var z=J9($);if(Y!==void 0)if(typeof U==="string")z.fill(Y,U);else z.fill(Y);else z.fill(0);return z};JU.allocUnsafe=function($){if(typeof $!=="number")throw TypeError("Argument must be a number");return J9($)};JU.allocUnsafeSlow=function($){if(typeof $!=="number")throw TypeError("Argument must be a number");return _O.SlowBuffer($)}});var AJ=E((za0)=>{var Hk=b90().Buffer,i90=Hk.isEncoding||function($){switch($=""+$,$&&$.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function ps0($){if(!$)return"utf8";var Y;while(!0)switch($){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return $;default:if(Y)return;$=(""+$).toLowerCase(),Y=!0}}function ds0($){var Y=ps0($);if(typeof Y!=="string"&&(Hk.isEncoding===i90||!i90($)))throw Error("Unknown encoding: "+$);return Y||$}za0.StringDecoder=BW;function BW($){this.encoding=ds0($);var Y;switch(this.encoding){case"utf16le":this.text=as0,this.end=ts0,Y=4;break;case"utf8":this.fillLast=os0,Y=4;break;case"base64":this.text=es0,this.end=$a0,Y=3;break;default:this.write=Ya0,this.end=Ua0;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=Hk.allocUnsafe(Y)}BW.prototype.write=function($){if($.length===0)return"";var Y,U;if(this.lastNeed){if(Y=this.fillLast($),Y===void 0)return"";U=this.lastNeed,this.lastNeed=0}else U=0;if(U<$.length)return Y?Y+this.text($,U):this.text($,U);return Y||""};BW.prototype.end=ss0;BW.prototype.text=rs0;BW.prototype.fillLast=function($){if(this.lastNeed<=$.length)return $.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);$.copy(this.lastChar,this.lastTotal-this.lastNeed,0,$.length),this.lastNeed-=$.length};function Gk($){if($<=127)return 0;else if($>>5===6)return 2;else if($>>4===14)return 3;else if($>>3===30)return 4;return $>>6===2?-1:-2}function ms0($,Y,U){var z=Y.length-1;if(z=0){if(Q>0)$.lastNeed=Q-1;return Q}if(--z=0){if(Q>0)$.lastNeed=Q-2;return Q}if(--z=0){if(Q>0)if(Q===2)Q=0;else $.lastNeed=Q-3;return Q}return 0}function ls0($,Y,U){if((Y[0]&192)!==128)return $.lastNeed=0,"�";if($.lastNeed>1&&Y.length>1){if((Y[1]&192)!==128)return $.lastNeed=1,"�";if($.lastNeed>2&&Y.length>2){if((Y[2]&192)!==128)return $.lastNeed=2,"�"}}}function os0($){var Y=this.lastTotal-this.lastNeed,U=ls0(this,$,Y);if(U!==void 0)return U;if(this.lastNeed<=$.length)return $.copy(this.lastChar,Y,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);$.copy(this.lastChar,Y,0,$.length),this.lastNeed-=$.length}function rs0($,Y){var U=ms0(this,$,Y);if(!this.lastNeed)return $.toString("utf8",Y);this.lastTotal=U;var z=$.length-(U-this.lastNeed);return $.copy(this.lastChar,0,z),$.toString("utf8",Y,z)}function ss0($){var Y=$&&$.length?this.write($):"";if(this.lastNeed)return Y+"�";return Y}function as0($,Y){if(($.length-Y)%2===0){var U=$.toString("utf16le",Y);if(U){var z=U.charCodeAt(U.length-1);if(z>=55296&&z<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=$[$.length-2],this.lastChar[1]=$[$.length-1],U.slice(0,-1)}return U}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=$[$.length-1],$.toString("utf16le",Y,$.length-1)}function ts0($){var Y=$&&$.length?this.write($):"";if(this.lastNeed){var U=this.lastTotal-this.lastNeed;return Y+this.lastChar.toString("utf16le",0,U)}return Y}function es0($,Y){var U=($.length-Y)%3;if(U===0)return $.toString("base64",Y);if(this.lastNeed=3-U,this.lastTotal=3,U===1)this.lastChar[0]=$[$.length-1];else this.lastChar[0]=$[$.length-2],this.lastChar[1]=$[$.length-1];return $.toString("base64",Y,$.length-U)}function $a0($){var Y=$&&$.length?this.write($):"";if(this.lastNeed)return Y+this.lastChar.toString("base64",0,3-this.lastNeed);return Y}function Ya0($){return $.toString(this.encoding)}function Ua0($){return $&&$.length?this.write($):""}});var vO=E((jd1,p90)=>{var c90=m7().codes.ERR_STREAM_PREMATURE_CLOSE;function Ja0($){var Y=!1;return function(){if(Y)return;Y=!0;for(var U=arguments.length,z=Array(U),Q=0;Q{var hO;function o7($,Y,U){if(Y=Ga0(Y),Y in $)Object.defineProperty($,Y,{value:U,enumerable:!0,configurable:!0,writable:!0});else $[Y]=U;return $}function Ga0($){var Y=Ha0($,"string");return typeof Y==="symbol"?Y:String(Y)}function Ha0($,Y){if(typeof $!=="object"||$===null)return $;var U=$[Symbol.toPrimitive];if(U!==void 0){var z=U.call($,Y||"default");if(typeof z!=="object")return z;throw TypeError("@@toPrimitive must return a primitive value.")}return(Y==="string"?String:Number)($)}var Wa0=vO(),r7=Symbol("lastResolve"),IU=Symbol("lastReject"),PW=Symbol("error"),SO=Symbol("ended"),KU=Symbol("lastPromise"),Wk=Symbol("handlePromise"),GU=Symbol("stream");function s7($,Y){return{value:$,done:Y}}function Xa0($){var Y=$[r7];if(Y!==null){var U=$[GU].read();if(U!==null)$[KU]=null,$[r7]=null,$[IU]=null,Y(s7(U,!1))}}function Za0($){process.nextTick(Xa0,$)}function qa0($,Y){return function(U,z){$.then(function(){if(Y[SO]){U(s7(void 0,!0));return}Y[Wk](U,z)},z)}}var Va0=Object.getPrototypeOf(function(){}),La0=Object.setPrototypeOf((hO={get stream(){return this[GU]},next:function(){var Y=this,U=this[PW];if(U!==null)return Promise.reject(U);if(this[SO])return Promise.resolve(s7(void 0,!0));if(this[GU].destroyed)return new Promise(function(I,K){process.nextTick(function(){if(Y[PW])K(Y[PW]);else I(s7(void 0,!0))})});var z=this[KU],Q;if(z)Q=new Promise(qa0(z,this));else{var J=this[GU].read();if(J!==null)return Promise.resolve(s7(J,!1));Q=new Promise(this[Wk])}return this[KU]=Q,Q}},o7(hO,Symbol.asyncIterator,function(){return this}),o7(hO,"return",function(){var Y=this;return new Promise(function(U,z){Y[GU].destroy(null,function(Q){if(Q){z(Q);return}U(s7(void 0,!0))})})}),hO),Va0),Fa0=function(Y){var U,z=Object.create(La0,(U={},o7(U,GU,{value:Y,writable:!0}),o7(U,r7,{value:null,writable:!0}),o7(U,IU,{value:null,writable:!0}),o7(U,PW,{value:null,writable:!0}),o7(U,SO,{value:Y._readableState.endEmitted,writable:!0}),o7(U,Wk,{value:function(J,I){var K=z[GU].read();if(K)z[KU]=null,z[r7]=null,z[IU]=null,J(s7(K,!1));else z[r7]=J,z[IU]=I},writable:!0}),U));return z[KU]=null,Wa0(Y,function(Q){if(Q&&Q.code!=="ERR_STREAM_PREMATURE_CLOSE"){var J=z[IU];if(J!==null)z[KU]=null,z[r7]=null,z[IU]=null,J(Q);z[PW]=Q;return}var I=z[r7];if(I!==null)z[KU]=null,z[r7]=null,z[IU]=null,I(s7(void 0,!0));z[SO]=!0}),Y.on("readable",Za0.bind(null,z)),z};d90.exports=Fa0});var s90=E((Cd1,r90)=>{function l90($,Y,U,z,Q,J,I){try{var K=$[J](I),G=K.value}catch(H){U(H);return}if(K.done)Y(G);else Promise.resolve(G).then(z,Q)}function wa0($){return function(){var Y=this,U=arguments;return new Promise(function(z,Q){var J=$.apply(Y,U);function I(G){l90(J,z,Q,I,K,"next",G)}function K(G){l90(J,z,Q,I,K,"throw",G)}I(void 0)})}}function o90($,Y){var U=Object.keys($);if(Object.getOwnPropertySymbols){var z=Object.getOwnPropertySymbols($);Y&&(z=z.filter(function(Q){return Object.getOwnPropertyDescriptor($,Q).enumerable})),U.push.apply(U,z)}return U}function Ma0($){for(var Y=1;Y{I30.exports=p1;var BJ;p1.ReadableState=$30;var Rd1=I0("events").EventEmitter,e90=function(Y,U){return Y.listeners(U).length},jW=I0("stream"),gO=I0("buffer").Buffer,Pa0=(typeof global<"u"?global:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function Ta0($){return gO.from($)}function ja0($){return gO.isBuffer($)||$ instanceof Pa0}var Xk=I0("util"),C1;if(Xk&&Xk.debuglog)C1=Xk.debuglog("stream");else C1=function(){};var Ea0=B90(),Mk=$k(),Ca0=Yk(),Ra0=Ca0.getHighWaterMark,yO=m7().codes,_a0=yO.ERR_INVALID_ARG_TYPE,va0=yO.ERR_STREAM_PUSH_AFTER_EOF,ha0=yO.ERR_METHOD_NOT_IMPLEMENTED,Sa0=yO.ERR_STREAM_UNSHIFT_AFTER_END_EVENT,PJ,Zk,qk;X1()(p1,jW);var TW=Mk.errorOrDestroy,Vk=["error","close","destroy","pause","resume"];function ga0($,Y,U){if(typeof $.prependListener==="function")return $.prependListener(Y,U);if(!$._events||!$._events[Y])$.on(Y,U);else if(Array.isArray($._events[Y]))$._events[Y].unshift(U);else $._events[Y]=[U,$._events[Y]]}function $30($,Y,U){if(BJ=BJ||QU(),$=$||{},typeof U!=="boolean")U=Y instanceof BJ;if(this.objectMode=!!$.objectMode,U)this.objectMode=this.objectMode||!!$.readableObjectMode;if(this.highWaterMark=Ra0(this,$,"readableHighWaterMark",U),this.buffer=new Ea0,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=$.emitClose!==!1,this.autoDestroy=!!$.autoDestroy,this.destroyed=!1,this.defaultEncoding=$.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,$.encoding){if(!PJ)PJ=AJ().StringDecoder;this.decoder=new PJ($.encoding),this.encoding=$.encoding}}function p1($){if(BJ=BJ||QU(),!(this instanceof p1))return new p1($);var Y=this instanceof BJ;if(this._readableState=new $30($,this,Y),this.readable=!0,$){if(typeof $.read==="function")this._read=$.read;if(typeof $.destroy==="function")this._destroy=$.destroy}jW.call(this)}Object.defineProperty(p1.prototype,"destroyed",{enumerable:!1,get:function(){if(this._readableState===void 0)return!1;return this._readableState.destroyed},set:function(Y){if(!this._readableState)return;this._readableState.destroyed=Y}});p1.prototype.destroy=Mk.destroy;p1.prototype._undestroy=Mk.undestroy;p1.prototype._destroy=function($,Y){Y($)};p1.prototype.push=function($,Y){var U=this._readableState,z;if(!U.objectMode){if(typeof $==="string"){if(Y=Y||U.defaultEncoding,Y!==U.encoding)$=gO.from($,Y),Y="";z=!0}}else z=!0;return Y30(this,$,Y,!1,z)};p1.prototype.unshift=function($){return Y30(this,$,null,!0,!1)};function Y30($,Y,U,z,Q){C1("readableAddChunk",Y);var J=$._readableState;if(Y===null)J.reading=!1,xa0($,J);else{var I;if(!Q)I=ya0(J,Y);if(I)TW($,I);else if(J.objectMode||Y&&Y.length>0){if(typeof Y!=="string"&&!J.objectMode&&Object.getPrototypeOf(Y)!==gO.prototype)Y=Ta0(Y);if(z)if(J.endEmitted)TW($,new Sa0);else Lk($,J,Y,!0);else if(J.ended)TW($,new va0);else if(J.destroyed)return!1;else if(J.reading=!1,J.decoder&&!U)if(Y=J.decoder.write(Y),J.objectMode||Y.length!==0)Lk($,J,Y,!1);else wk($,J);else Lk($,J,Y,!1)}else if(!z)J.reading=!1,wk($,J)}return!J.ended&&(J.length=a90)$=a90;else $--,$|=$>>>1,$|=$>>>2,$|=$>>>4,$|=$>>>8,$|=$>>>16,$++;return $}function t90($,Y){if($<=0||Y.length===0&&Y.ended)return 0;if(Y.objectMode)return 1;if($!==$)if(Y.flowing&&Y.length)return Y.buffer.head.data.length;else return Y.length;if($>Y.highWaterMark)Y.highWaterMark=ka0($);if($<=Y.length)return $;if(!Y.ended)return Y.needReadable=!0,0;return Y.length}p1.prototype.read=function($){C1("read",$),$=parseInt($,10);var Y=this._readableState,U=$;if($!==0)Y.emittedReadable=!1;if($===0&&Y.needReadable&&((Y.highWaterMark!==0?Y.length>=Y.highWaterMark:Y.length>0)||Y.ended)){if(C1("read: emitReadable",Y.length,Y.ended),Y.length===0&&Y.ended)Fk(this);else kO(this);return null}if($=t90($,Y),$===0&&Y.ended){if(Y.length===0)Fk(this);return null}var z=Y.needReadable;if(C1("need readable",z),Y.length===0||Y.length-$0)Q=Q30($,Y);else Q=null;if(Q===null)Y.needReadable=Y.length<=Y.highWaterMark,$=0;else Y.length-=$,Y.awaitDrain=0;if(Y.length===0){if(!Y.ended)Y.needReadable=!0;if(U!==$&&Y.ended)Fk(this)}if(Q!==null)this.emit("data",Q);return Q};function xa0($,Y){if(C1("onEofChunk"),Y.ended)return;if(Y.decoder){var U=Y.decoder.end();if(U&&U.length)Y.buffer.push(U),Y.length+=Y.objectMode?1:U.length}if(Y.ended=!0,Y.sync)kO($);else if(Y.needReadable=!1,!Y.emittedReadable)Y.emittedReadable=!0,U30($)}function kO($){var Y=$._readableState;if(C1("emitReadable",Y.needReadable,Y.emittedReadable),Y.needReadable=!1,!Y.emittedReadable)C1("emitReadable",Y.flowing),Y.emittedReadable=!0,process.nextTick(U30,$)}function U30($){var Y=$._readableState;if(C1("emitReadable_",Y.destroyed,Y.length,Y.ended),!Y.destroyed&&(Y.length||Y.ended))$.emit("readable"),Y.emittedReadable=!1;Y.needReadable=!Y.flowing&&!Y.ended&&Y.length<=Y.highWaterMark,Ok($)}function wk($,Y){if(!Y.readingMore)Y.readingMore=!0,process.nextTick(fa0,$,Y)}function fa0($,Y){while(!Y.reading&&!Y.ended&&(Y.length1&&J30(z.pipes,$)!==-1)&&!H)C1("false write response, pause",z.awaitDrain),z.awaitDrain++;U.pause()}}function Z(M){if(C1("onerror",M),F(),$.removeListener("error",Z),e90($,"error")===0)TW($,M)}ga0($,"error",Z);function q(){$.removeListener("finish",V),F()}$.once("close",q);function V(){C1("onfinish"),$.removeListener("close",q),F()}$.once("finish",V);function F(){C1("unpipe"),U.unpipe($)}if($.emit("pipe",U),!z.flowing)C1("pipe resume"),U.resume();return $};function ua0($){return function(){var U=$._readableState;if(C1("pipeOnDrain",U.awaitDrain),U.awaitDrain)U.awaitDrain--;if(U.awaitDrain===0&&e90($,"data"))U.flowing=!0,Ok($)}}p1.prototype.unpipe=function($){var Y=this._readableState,U={hasUnpiped:!1};if(Y.pipesCount===0)return this;if(Y.pipesCount===1){if($&&$!==Y.pipes)return this;if(!$)$=Y.pipes;if(Y.pipes=null,Y.pipesCount=0,Y.flowing=!1,$)$.emit("unpipe",this,U);return this}if(!$){var{pipes:z,pipesCount:Q}=Y;Y.pipes=null,Y.pipesCount=0,Y.flowing=!1;for(var J=0;J0,z.flowing!==!1)this.resume()}else if($==="readable"){if(!z.endEmitted&&!z.readableListening){if(z.readableListening=z.needReadable=!0,z.flowing=!1,z.emittedReadable=!1,C1("on readable",z.length,z.reading),z.length)kO(this);else if(!z.reading)process.nextTick(ba0,this)}}return U};p1.prototype.addListener=p1.prototype.on;p1.prototype.removeListener=function($,Y){var U=jW.prototype.removeListener.call(this,$,Y);if($==="readable")process.nextTick(z30,this);return U};p1.prototype.removeAllListeners=function($){var Y=jW.prototype.removeAllListeners.apply(this,arguments);if($==="readable"||$===void 0)process.nextTick(z30,this);return Y};function z30($){var Y=$._readableState;if(Y.readableListening=$.listenerCount("readable")>0,Y.resumeScheduled&&!Y.paused)Y.flowing=!0;else if($.listenerCount("data")>0)$.resume()}function ba0($){C1("readable nexttick read 0"),$.read(0)}p1.prototype.resume=function(){var $=this._readableState;if(!$.flowing)C1("resume"),$.flowing=!$.readableListening,ia0(this,$);return $.paused=!1,this};function ia0($,Y){if(!Y.resumeScheduled)Y.resumeScheduled=!0,process.nextTick(ca0,$,Y)}function ca0($,Y){if(C1("resume",Y.reading),!Y.reading)$.read(0);if(Y.resumeScheduled=!1,$.emit("resume"),Ok($),Y.flowing&&!Y.reading)$.read(0)}p1.prototype.pause=function(){if(C1("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1)C1("pause"),this._readableState.flowing=!1,this.emit("pause");return this._readableState.paused=!0,this};function Ok($){var Y=$._readableState;C1("flow",Y.flowing);while(Y.flowing&&$.read()!==null);}p1.prototype.wrap=function($){var Y=this,U=this._readableState,z=!1;$.on("end",function(){if(C1("wrapped end"),U.decoder&&!U.ended){var I=U.decoder.end();if(I&&I.length)Y.push(I)}Y.push(null)}),$.on("data",function(I){if(C1("wrapped data"),U.decoder)I=U.decoder.write(I);if(U.objectMode&&(I===null||I===void 0))return;else if(!U.objectMode&&(!I||!I.length))return;var K=Y.push(I);if(!K)z=!0,$.pause()});for(var Q in $)if(this[Q]===void 0&&typeof $[Q]==="function")this[Q]=function(K){return function(){return $[K].apply($,arguments)}}(Q);for(var J=0;J=Y.length){if(Y.decoder)U=Y.buffer.join("");else if(Y.buffer.length===1)U=Y.buffer.first();else U=Y.buffer.concat(Y.length);Y.buffer.clear()}else U=Y.buffer.consume($,Y.decoder);return U}function Fk($){var Y=$._readableState;if(C1("endReadable",Y.endEmitted),!Y.endEmitted)Y.ended=!0,process.nextTick(na0,Y,$)}function na0($,Y){if(C1("endReadableNT",$.endEmitted,$.length),!$.endEmitted&&$.length===0){if($.endEmitted=!0,Y.readable=!1,Y.emit("end"),$.autoDestroy){var U=Y._writableState;if(!U||U.autoDestroy&&U.finished)Y.destroy()}}}if(typeof Symbol==="function")p1.from=function($,Y){if(qk===void 0)qk=s90();return qk(p1,$,Y)};function J30($,Y){for(var U=0,z=$.length;U{G30.exports=W3;var xO=m7().codes,pa0=xO.ERR_METHOD_NOT_IMPLEMENTED,da0=xO.ERR_MULTIPLE_CALLBACK,ma0=xO.ERR_TRANSFORM_ALREADY_TRANSFORMING,la0=xO.ERR_TRANSFORM_WITH_LENGTH_0,fO=QU();X1()(W3,fO);function oa0($,Y){var U=this._transformState;U.transforming=!1;var z=U.writecb;if(z===null)return this.emit("error",new da0);if(U.writechunk=null,U.writecb=null,Y!=null)this.push(Y);z($);var Q=this._readableState;if(Q.reading=!1,Q.needReadable||Q.length{W30.exports=EW;var H30=Nk();X1()(EW,H30);function EW($){if(!(this instanceof EW))return new EW($);H30.call(this,$)}EW.prototype._transform=function($,Y,U){U(null,$)}});var F30=E((Sd1,L30)=>{var Dk;function sa0($){var Y=!1;return function(){if(Y)return;Y=!0,$.apply(void 0,arguments)}}var V30=m7().codes,aa0=V30.ERR_MISSING_ARGS,ta0=V30.ERR_STREAM_DESTROYED;function Z30($){if($)throw $}function ea0($){return $.setHeader&&typeof $.abort==="function"}function $t0($,Y,U,z){z=sa0(z);var Q=!1;if($.on("close",function(){Q=!0}),Dk===void 0)Dk=vO();Dk($,{readable:Y,writable:U},function(I){if(I)return z(I);Q=!0,z()});var J=!1;return function(I){if(Q)return;if(J)return;if(J=!0,ea0($))return $.abort();if(typeof $.destroy==="function")return $.destroy();z(I||new ta0("pipe"))}}function q30($){$()}function Yt0($,Y){return $.pipe(Y)}function Ut0($){if(!$.length)return Z30;if(typeof $[$.length-1]!=="function")return Z30;return $.pop()}function zt0(){for(var $=arguments.length,Y=Array($),U=0;U<$;U++)Y[U]=arguments[U];var z=Ut0(Y);if(Array.isArray(Y[0]))Y=Y[0];if(Y.length<2)throw new aa0("streams");var Q,J=Y.map(function(I,K){var G=K0;return $t0(I,G,H,function(W){if(!Q)Q=W;if(W)J.forEach(q30);if(G)return;J.forEach(q30),z(Q)})});return Y.reduce(Yt0)}L30.exports=zt0});var E8=E((v$,RW)=>{var CW=I0("stream");if(process.env.READABLE_STREAM==="disable"&&CW)RW.exports=CW.Readable,Object.assign(RW.exports,CW),RW.exports.Stream=CW;else v$=RW.exports=Ik(),v$.Stream=CW||v$,v$.Readable=v$,v$.Writable=Qk(),v$.Duplex=QU(),v$.Transform=Nk(),v$.PassThrough=X30(),v$.finished=vO(),v$.pipeline=F30()});var Z8=E((gd1,O30)=>{var w30=I0("fs"),Qt0=function($,Y,U,z){if($.super_=Y,!z)z=U,U=null;if(U)Object.keys(U).forEach((J)=>{Object.defineProperty($,J,Object.getOwnPropertyDescriptor(U,J))});let Q={constructor:{value:$,enumerable:!1,writable:!1,configurable:!0}};if(z)Object.keys(z).forEach((J)=>{Q[J]=Object.getOwnPropertyDescriptor(z,J)});$.prototype=Object.create(Y.prototype,Q)},Jt0=/[<>&'"\x7F\x00-\x08\x0B-\x0C\x0E-\x1F]/,M30={nop(){},promiseImmediate($){return new Promise((Y)=>{if(global.setImmediate)setImmediate(()=>{Y($)});else setTimeout(()=>{Y($)},1)})},inherits:Qt0,dateToExcel($,Y){return 25569+$.getTime()/86400000-(Y?1462:0)},excelToDate($,Y){let U=Math.round(($-25569+(Y?1462:0))*24*3600*1000);return new Date(U)},parsePath($){let Y=$.lastIndexOf("/");return{path:$.substring(0,Y),name:$.substring(Y+1)}},getRelsPath($){let Y=M30.parsePath($);return`${Y.path}/_rels/${Y.name}.rels`},xmlEncode($){let Y=Jt0.exec($);if(!Y)return $;let U="",z="",Q=0,J=Y.index;for(;J<$.length;J++){let I=$.charCodeAt(J);switch(I){case 34:z=""";break;case 38:z="&";break;case 39:z="'";break;case 60:z="<";break;case 62:z=">";break;case 127:z="";break;default:{if(I<=31&&(I<=8||I>=11&&I!==13)){z="";break}continue}}if(Q!==J)U+=$.substring(Q,J);if(Q=J+1,z)U+=z}if(Q!==J)return U+$.substring(Q,J);return U},xmlDecode($){return $.replace(/&([a-z]*);/g,(Y)=>{switch(Y){case"<":return"<";case">":return">";case"&":return"&";case"'":return"'";case""":return'"';default:return Y}})},validInt($){let Y=parseInt($,10);return!Number.isNaN(Y)?Y:0},isDateFmt($){if(!$)return!1;return $=$.replace(/\[[^\]]*]/g,""),$=$.replace(/"[^"]*"/g,""),$.match(/[ymdhMsb]+/)!==null},fs:{exists($){return new Promise((Y)=>{w30.access($,w30.constants.F_OK,(U)=>{Y(!U)})})}},toIsoDateString($){return $.toIsoString().subsstr(0,10)},parseBoolean($){return $===!0||$==="true"||$===1||$==="1"}};O30.exports=M30});var Ak=E((yd1,D30)=>{class N30{constructor($){this._buf=Buffer.alloc($&&$.size||16384),this._encoding=$&&$.encoding||"utf8",this._inPos=0,this._buffer=void 0}get length(){return this._inPos}get capacity(){return this._buf.length}get buffer(){return this._buf}toBuffer(){if(!this._buffer)this._buffer=Buffer.alloc(this.length),this._buf.copy(this._buffer,0,0,this.length);return this._buffer}reset($){$=$||0,this._buffer=void 0,this._inPos=$}_grow($){let Y=this._buf.length*2;while(Y<$)Y*=2;let U=Buffer.alloc(Y);this._buf.copy(U,0),this._buf=U}addText($){this._buffer=void 0;let Y=this._inPos+this._buf.write($,this._inPos,this._encoding);while(Y>=this._buf.length-4)this._grow(this._inPos+$.length),Y=this._inPos+this._buf.write($,this._inPos,this._encoding);this._inPos=Y}addStringBuf($){if($.length){if(this._buffer=void 0,this.length+$.length>this.capacity)this._grow(this.length+$.length);$._buf.copy(this._buf,this._inPos,0,$.length),this._inPos+=$.length}}}D30.exports=N30});var _W=E((kd1,C30)=>{var It0=E8(),A30=Z8(),Kt0=Ak();class B30{constructor($,Y){this._data=$,this._encoding=Y}get length(){return this.toBuffer().length}copy($,Y,U,z){return this.toBuffer().copy($,Y,U,z)}toBuffer(){if(!this._buffer)this._buffer=Buffer.from(this._data,this._encoding);return this._buffer}}class P30{constructor($){this._data=$}get length(){return this._data.length}copy($,Y,U,z){return this._data._buf.copy($,Y,U,z)}toBuffer(){return this._data.toBuffer()}}class T30{constructor($){this._data=$}get length(){return this._data.length}copy($,Y,U,z){this._data.copy($,Y,U,z)}toBuffer(){return this._data}}class j30{constructor($){this.size=$,this.buffer=Buffer.alloc($),this.iRead=0,this.iWrite=0}toBuffer(){if(this.iRead===0&&this.iWrite===this.size)return this.buffer;let $=Buffer.alloc(this.iWrite-this.iRead);return this.buffer.copy($,0,this.iRead,this.iWrite),$}get length(){return this.iWrite-this.iRead}get eod(){return this.iRead===this.iWrite}get full(){return this.iWrite===this.size}read($){let Y;if($===0)return null;if($===void 0||$>=this.length)return Y=this.toBuffer(),this.iRead=this.iWrite,Y;return Y=Buffer.alloc($),this.buffer.copy(Y,0,this.iRead,$),this.iRead+=$,Y}write($,Y,U){let z=Math.min(U,this.size-this.iWrite);return $.copy(this.buffer,this.iWrite,Y,Y+z),this.iWrite+=z,z}}var E30=function($){$=$||{},this.bufSize=$.bufSize||1048576,this.buffers=[],this.batch=$.batch||!1,this.corked=!1,this.inPos=0,this.outPos=0,this.pipes=[],this.paused=!1,this.encoding=null};A30.inherits(E30,It0.Duplex,{toBuffer(){switch(this.buffers.length){case 0:return null;case 1:return this.buffers[0].toBuffer();default:return Buffer.concat(this.buffers.map(($)=>$.toBuffer()))}},_getWritableBuffer(){if(this.buffers.length){let Y=this.buffers[this.buffers.length-1];if(!Y.full)return Y}let $=new j30(this.bufSize);return this.buffers.push($),$},async _pipe($){let Y=function(U){return new Promise((z)=>{U.write($.toBuffer(),()=>{z()})})};await Promise.all(this.pipes.map(Y))},_writeToBuffers($){let Y=0,U=$.length;while(Y1)this._pipe(this.buffers.shift())}else if(!this.corked)await this._pipe(z),U();else this._writeToBuffers(z),process.nextTick(U);else{if(!this.paused)this.emit("data",z.toBuffer());this._writeToBuffers(z),this.emit("readable")}return!0},cork(){this.corked=!0},_flush(){if(this.pipes.length)while(this.buffers.length)this._pipe(this.buffers.shift())},uncork(){this.corked=!1,this._flush()},end($,Y,U){let z=(Q)=>{if(Q)U(Q);else this._flush(),this.pipes.forEach((J)=>{J.end()}),this.emit("finish")};if($)this.write($,Y,z);else z()},read($){let Y;if($){Y=[];while($&&this.buffers.length&&!this.buffers[0].eod){let U=this.buffers[0],z=U.read($);if($-=z.length,Y.push(z),U.eod&&U.full)this.buffers.shift()}return Buffer.concat(Y)}return Y=this.buffers.map((U)=>U.toBuffer()).filter(Boolean),this.buffers=[],Buffer.concat(Y)},setEncoding($){this.encoding=$},pause(){this.paused=!0},resume(){this.paused=!1},isPaused(){return!!this.paused},pipe($){if(this.pipes.push($),!this.paused&&this.buffers.length)this.end()},unpipe($){this.pipes=this.pipes.filter((Y)=>Y!==$)},unshift(){throw Error("Not Implemented")},wrap(){throw Error("Not Implemented")}});C30.exports=E30});var v30=E((Ht0)=>{var R30=typeof TextEncoder>"u"?null:new TextEncoder("utf-8"),{Buffer:_30}=I0("buffer");function Gt0($){if(typeof $!=="string")return $;if(R30)return _30.from(R30.encode($).buffer);return _30.from($)}Ht0.stringToBuffer=Gt0});var g30=E((ud1,S30)=>{var Xt0=I0("events"),Zt0=ay(),qt0=_W(),{stringToBuffer:fd1}=v30();class h30 extends Xt0.EventEmitter{constructor($){super();this.options=Object.assign({type:"nodebuffer",compression:"DEFLATE"},$),this.zip=new Zt0,this.stream=new qt0}append($,Y){if(Y.hasOwnProperty("base64")&&Y.base64)this.zip.file(Y.name,$,{base64:!0});else this.zip.file(Y.name,$)}async finalize(){let $=await this.zip.generateAsync(this.options);this.stream.end($),this.emit("finish")}read($){return this.stream.read($)}setEncoding($){return this.stream.setEncoding($)}pause(){return this.stream.pause()}resume(){return this.stream.resume()}isPaused(){return this.stream.isPaused()}pipe($,Y){return this.stream.pipe($,Y)}unpipe($){return this.stream.unpipe($)}unshift($){return this.stream.unshift($)}wrap($){return this.stream.wrap($)}}S30.exports={ZipWriter:h30}});var l6=E((bd1,x30)=>{var Vt0=Y6(),y30=Z8();function k30($,Y,U){$.push(` ${Y}="${y30.xmlEncode(U.toString())}"`)}function Bk($,Y){if(Y){let U=[];Vt0.each(Y,(z,Q)=>{if(z!==void 0)k30(U,Q,z)}),$.push(U.join(""))}}class Pk{constructor(){this._xml=[],this._stack=[],this._rollbacks=[]}get tos(){return this._stack.length?this._stack[this._stack.length-1]:void 0}get cursor(){return this._xml.length}openXml($){let Y=this._xml;Y.push(" `)}openNode($,Y){let U=this.tos,z=this._xml;if(U&&this.open)z.push(">");this._stack.push($),z.push("<"),z.push($),Bk(z,Y),this.leaf=!0,this.open=!0}addAttribute($,Y){if(!this.open)throw Error("Cannot write attributes to node if it is not open");if(Y!==void 0)k30(this._xml,$,Y)}addAttributes($){if(!this.open)throw Error("Cannot write attributes to node if it is not open");Bk(this._xml,$)}writeText($){let Y=this._xml;if(this.open)Y.push(">"),this.open=!1;this.leaf=!1,Y.push(y30.xmlEncode($.toString()))}writeXml($){if(this.open)this._xml.push(">"),this.open=!1;this.leaf=!1,this._xml.push($)}closeNode(){let $=this._stack.pop(),Y=this._xml;if(this.leaf)Y.push("/>");else Y.push("");this.open=!1,this.leaf=!1}leafNode($,Y,U){if(this.openNode($,Y),U!==void 0)this.writeText(U);this.closeNode()}closeAll(){while(this._stack.length)this.closeNode()}addRollback(){return this._rollbacks.push({xml:this._xml.length,stack:this._stack.length,leaf:this.leaf,open:this.open}),this.cursor}commit(){this._rollbacks.pop()}rollback(){let $=this._rollbacks.pop();if(this._xml.length>$.xml)this._xml.splice($.xml,this._xml.length-$.xml);if(this._stack.length>$.stack)this._stack.splice($.stack,this._stack.length-$.stack);this.leaf=$.leaf,this.open=$.open}get xml(){return this.closeAll(),this._xml.join("")}}Pk.StdDocAttributes={version:"1.0",encoding:"UTF-8",standalone:"yes"};x30.exports=Pk});var Tk=E((Ft0)=>{var f30=typeof TextDecoder>"u"?null:new TextDecoder("utf-8");function Lt0($){if(typeof $==="string")return $;if(f30)return f30.decode($);return $.toString()}Ft0.bufferToString=Lt0});var n30=E((b30)=>{Object.defineProperty(b30,"__esModule",{value:!0});b30.CHAR=` \r -퟿-�\uD800\uDC00-\uDBFF\uDFFF`;b30.S=` \r @@ -2364,13 +2364,13 @@ flowchart TD 发布后核实版本状态,完成业务安全闭环。 `;var oh0=()=>{};var ah0=`--- name: seal-use -description: "v0.10.32: Use for Seal Use first-time enterprise onboarding, Hose/合思 or Seal-native authentication, assistance links and browser cURL intake, plus tenant approval operations, diagnosis, simulation, rules, users, configuration, and search." +description: "v0.10.33: Use for Seal Use first-time enterprise onboarding, Hose/合思 or Seal-native authentication, assistance links and browser cURL intake, plus tenant approval operations, diagnosis, simulation, rules, users, configuration, and search." metadata: - version: 0.10.32 - short-description: Seal tenant and Hose approval automation (v0.10.32) + version: 0.10.33 + short-description: Seal tenant and Hose approval automation (v0.10.33) --- -# Seal Use (v0.10.32) +# Seal Use (v0.10.33) > CLI 是主执行通道,MCP 默认关闭(插件配置可选开启)。机器通道 (\`stdout\`) 必须输出纯净 JSON,诊断日志与下一步建议统一输出在 \`stderr\`。 @@ -2553,7 +2553,7 @@ ${Io.map(($)=>`### \`seal-use ${$.domain}\` `}var Qo,Jo,Io;var Ko=m(()=>{Qo=[{name:"配置与状态根目录",category:"config",standardPath:"~/.config/seal-use",purpose:"用户本地持久化配置根目录,存放企业连接元数据、会话缓存与全局状态。",accessMode:"read-write",retention:"persistent"},{name:"企业配置文件目录",category:"config",standardPath:"~/.config/seal-use/enterprises",purpose:"存放各已添加企业的配置 JSON 文件(如 xiezihao.json),存储企业域名、脱敏 Token、员工绑定关系等。",accessMode:"read-write",retention:"persistent"},{name:"全局配置文件",category:"config",standardPath:"~/.config/seal-use/config.json",purpose:"维护全局工作模式(stateful/stateless)、默认激活企业 defaultCorpId 以及 Lint 偏好。",accessMode:"read-write",retention:"persistent"},{name:"会话凭据安全缓存",category:"config",standardPath:"~/.config/seal-use/seal_tokens.json",purpose:"缓存已认证租户的 Bearer Token 与过期时间戳,避免高频调用上游 OAuth 换票接口。",accessMode:"read-write",retention:"cache"},{name:"规则版本映射快照",category:"config",standardPath:"~/.config/seal-use/mappings",purpose:"存储 corps sync-test 生成的生产与测试规则版本/编号对照映射快照,供 rules map 离线毫秒级速查。",accessMode:"read-write",retention:"persistent"},{name:"后台守护服务日志",category:"config",standardPath:"~/.config/seal-use/service.log",purpose:"常驻后台 HTTP 服务守护进程运行输出日志。",accessMode:"read-write",retention:"persistent"},{name:"全局命令行程序",category:"binary",standardPath:"/opt/homebrew/bin/seal-use",purpose:"macOS / Linux 全局独立单文件二进制程序;附带软链接 seal-home -> seal-use 兼容旧指令。",accessMode:"executable",retention:"persistent"},{name:"AI Agent 技能主目录",category:"skill",standardPath:"~/.agents/skills/seal-use",purpose:"面向 Antigravity、Codex 等 AI 智能体的标准技能目录,包含 SKILL.md、参考文档与操作规程。",accessMode:"read-write",retention:"persistent"},{name:"报表默认导出目录",category:"export",standardPath:"~/Downloads",purpose:"执行 approval-runs export 等大盘报表命令且未指定 --out 时,默认写入的 Excel 文件路径。",accessMode:"read-write",retention:"persistent"},{name:"系统隔离临时目录",category:"temp",standardPath:"/tmp 或 /var/folders/.../T",purpose:"自动化测试(bun test)生成的隔离工作副本,执行完毕后通过 afterEach 钩子彻底删除,零残留。",accessMode:"transient",retention:"ephemeral"}],Jo=[{topic:"敏感凭据脱敏保护",guarantee:"appSecurity、password 等高危密钥永不回显在 stdout,Session Token 采用掩码处理(如 5oUL...Y%3D)。",enforcement:"CLI 所有展示接口(corps get、corps list、probe 等)均经 formatSafeSourceDetail 脱敏过滤。"},{topic:"正式环境与测试环境严格隔离",guarantee:"正式企业与测试企业必须严格 1 对 1 下挂,禁止多层级级联绑定;环境标记需显式 --confirm 确认。",enforcement:"corps bind-test 与 mark 强制要求 --confirm,缺少时阻断并返回退出码 10(confirmationRequired)。"},{topic:"跨环境规则同步安全基线",guarantee:"corps sync-test 仅将正式企业偏好与规则覆盖同步至测试企业并自动发布,正式企业规则严格维持草稿态永不发布。",enforcement:"规则同步流水线由 sync-test 独占受控,正式环境端仅执行拉取草稿读取操作,零发版变更。"},{topic:"只读诊断无副作用原则",guarantee:"doctor、search、get、list、context、probe 等命令为严格只读操作,不修改用户本地文件系统,零写入污染。",enforcement:"核心领域函数严格分离 Mutation 操作与 Query 操作,Query 路径杜绝写文件与环境篡改。"}],Io=[{domain:"corps (企业管理)",summary:"多租户接入、智能软搜索、富属性查看、环境标记、测试绑定与配置规则同步",primaryCommands:["corps list","corps search ","corps get ","corps mark","corps bind-test","corps sync-test"]},{domain:"approval-runs (审核大盘)",summary:"AI 审核单据检索、统计分析、引证规则查看、附件全链路追踪、Excel 报表导出、单据直达链接与免登",primaryCommands:["approval-runs list","approval-runs stats","approval-runs get","approval-runs export","approval-runs link"]},{domain:"rules (规则治理)",summary:"审核规则拉取、本地 Lint 质量检查、增量差量推送、离线版本与编号对照映射速查",primaryCommands:["rules pull","rules lint","rules push","rules map","rules count"]},{domain:"preference (决策偏好)",summary:"AI 审核偏好读取与更新、全局与分品类思考深度策略(medium/high)配置",primaryCommands:["preference get","preference decision update","preference thinking-depth set"]},{domain:"simulation (模拟演练)",summary:"合思单据指定、材料包导入、飞书/泛微三方审批定义演练、批次轮询等待与数据清理",primaryCommands:["simulation create","simulation status","simulation wait","simulation clean"]},{domain:"webhook (通道与重放)",summary:"Webhook 回调通道配置、材料包校验推送、线上单据向 Webhook 通道测试重放",primaryCommands:["webhook list","webhook add","webhook replay","webhook material-pack push"]},{domain:"deploy (费控集成)",summary:"Seal AI 智能审核能力发布到合思费控企业、对接要求检测与配置同步",primaryCommands:["deploy hosecloud requirements","deploy hosecloud status","deploy hosecloud sync"]},{domain:"doctor (系统诊断)",summary:"整机环境健康自检、目录全景体检看板、内置架构与规范白皮书离线查阅",primaryCommands:["doctor","doctor guide","doctor paths"]}]});import{accessSync as bg1,constants as ig1,existsSync as i6,readdirSync as OS0,statSync as cg1}from"node:fs";import{homedir as ng1}from"node:os";import{join as E5}from"node:path";function wS0($){if(!i6($))return 0;try{return OS0($).filter((Y)=>Y.endsWith(".json")).length}catch{return 0}}function vT($){try{return bg1($,ig1.W_OK),!0}catch{return!1}}function MS0($){if(!i6($))return[];try{return OS0($).filter((Y)=>Y.endsWith(".json")&&!Y.startsWith("example.")).map((Y)=>E5($,Y))}catch{return[]}}function pg1($){return $.filter((Y)=>{try{return(cg1(Y).mode&63)!==0}catch{return!1}})}function Go(){let $=ng1(),Y=E5($,".config","seal-use"),U=E5(Y,"enterprises"),z=E5(Y,"config.json"),Q=E5(Y,"seal_tokens.json"),J=E5(Y,"mappings"),I=yz(),K=E5($,"Downloads"),H=["/opt/homebrew/bin/seal-use","/usr/local/bin/seal-use",E5($,".local","bin","seal-use"),E5($,"bin","seal-use")].find((A)=>i6(A))??process.execPath,W={configDir:{name:"配置根目录",path:Y,exists:i6(Y),writable:i6(Y)?vT(Y):!1,description:"用户持久化配置与企业状态根目录"},enterprisesDir:{name:"企业配置目录",path:U,exists:i6(U),writable:i6(U)?vT(U):!1,fileCount:wS0(U),description:"企业连接配置(JSON)保存路径"},globalConfigFile:{name:"全局配置文件",path:z,exists:i6(z),description:"全局工作模式与默认企业配置"},tokenStore:{name:"凭据缓存",path:Q,exists:i6(Q),description:"会话凭据与令牌缓存"},mappingsDir:{name:"规则版本映射快照",path:J,exists:i6(J),fileCount:wS0(J),description:"生产与测试规则版本映射对照表"},agentSkillDir:{name:"AI Agent 技能目录",path:I,exists:i6(E5(I,"SKILL.md")),description:"本地 Agent 技能主目录"},exportDefaultDir:{name:"报表默认导出目录",path:K,exists:i6(K),writable:i6(K)?vT(K):!1,description:"审核大盘报表默认写入目录"},lintersDir:{name:"规则校验器目录 (用户自定义)",path:b$,exists:i6(b$),writable:i6(b$)?vT(b$):!1,description:"用户私有规则校验脚本存放目录"},officialLintersDir:{name:"官方内置规则校验器目录",path:i$,exists:i6(i$),description:"官方标准与严格风控校验脚本目录 (系统自动保护与重写)"},globalBinary:{name:"全局命令行二进制",path:H,exists:i6(H),description:"系统全局命令执行入口"}},X=[];try{X=s8()}catch{X=[]}let Z=_4(),q=Z.defaultCorpId??X[0]?.id,V=X.find((A)=>A.id===q),F=X.filter((A)=>(A.environment??"production").toLowerCase()==="test").length,M=X.length-F,w=[];if(w.push({id:"executable",title:"命令行二进制",status:"ok",message:`当前执行路径: ${process.execPath}`}),W.configDir?.exists&&W.configDir.writable)w.push({id:"config_dir",title:"配置目录访问",status:"ok",message:`${Y} (正常读写)`});else if(W.configDir?.exists)w.push({id:"config_dir",title:"配置目录访问",status:"warn",message:`${Y} (存在但可能不可写)`});else w.push({id:"config_dir",title:"配置目录访问",status:"warn",message:`未检测到配置目录 ${Y},首次运行配置命令时将自动创建`});if(X.length>0)w.push({id:"enterprises",title:"企业接入状态",status:"ok",message:`已接入 ${X.length} 家企业 (正式: ${M}, 测试: ${F})`});else w.push({id:"enterprises",title:"企业接入状态",status:"warn",message:"当前未检测到企业配置,请使用 seal-use corps add-hose 或 add-seal 接入企业"});if(W.agentSkillDir?.exists)w.push({id:"agent_skill",title:"AI Agent 技能",status:"ok",message:`已就绪于 ${I}`});else w.push({id:"agent_skill",title:"AI Agent 技能",status:"warn",message:`未在 ${I} 检测到技能,可运行 'seal-use skill sync' 安装`});let N=[Q,z,_Z(),...MS0(U),...MS0(E5(process.cwd(),"enterprises"))].filter((A,j,C)=>C.indexOf(A)===j&&i6(A)),O=pg1(N);w.push({id:"credential_permissions",title:"凭据文件权限",status:O.length===0?"ok":"warn",message:O.length===0?`已检查 ${N.length} 个凭据文件,均为仅属主可读 (0600)`:`${O.length} 个凭据文件权限宽于 0600(同机其他用户可读,取决于父目录权限),建议 chmod 600:${O.join("、")}`});let D=Z.lint??{enabled:!1,activeLinter:"builtin",minScore:0};if(D.enabled)w.push({id:"rule_linter",title:"规则质量校验器",status:"ok",message:`已开启 (校验器: ${D.activeLinter}, 最低门槛分: ${D.minScore})`});else w.push({id:"rule_linter",title:"规则质量校验器",status:"ok",message:"未开启 (默认关闭,可运行 seal-use config lint enable 开启)"});let P=w.some((A)=>A.status==="warn"||A.status==="error"),T=typeof globalThis.Bun<"u"?`Bun ${globalThis.Bun.version}`:`Node ${process.version}`;return{doctor:P?"warning":"ok",timestamp:new Date().toISOString(),runtime:{version:P1,executablePath:process.execPath,platform:`${process.platform} (${process.arch})`,engine:T},directories:W,enterprises:{total:X.length,productionCount:M,testCount:F,activeCorpId:V?.id,activeCorpName:V?.name},checks:w,knowledge:{summary:"内嵌系统架构与目录规范白皮书(纯内存只读,零写入依赖)",directorySpecsCount:Qo.length,securityPoliciesCount:Jo.length,domainCapabilitiesCount:Io.length,guideCommand:"seal-use doctor guide"}}}function NS0($){let Y=[],U=$.doctor==="ok"?"✨":"⚠️";Y.push(`\uD83E\uDE7A [Seal Use Doctor] 系统健康诊断看板 ${U}`),Y.push("─────────────────────────────────────────────────────────────"),Y.push("【运行环境】"),Y.push(` 版本号: ${$.runtime.version}`),Y.push(` 程序路径: ${$.runtime.executablePath}`),Y.push(` 操作系统: ${$.runtime.platform}`),Y.push(` 执行引擎: ${$.runtime.engine}`),Y.push(""),Y.push("【核心路径状态】");for(let[,Q]of Object.entries($.directories)){let J=Q.exists?"✓":"○",I=Q.exists?Q.fileCount!==void 0?`(${Q.fileCount} 个文件)`:Q.writable?"(就绪/可写)":"(存在)":"(未创建)";Y.push(` ${J} ${Q.name.padEnd(16," ")}: ${Q.path} ${I}`)}if(Y.push(""),Y.push("【企业资产概览】"),Y.push(` 接入企业总计: ${$.enterprises.total} 家 (生产: ${$.enterprises.productionCount}, 测试: ${$.enterprises.testCount})`),$.enterprises.activeCorpId)Y.push(` 当前激活企业: ${$.enterprises.activeCorpName} (${$.enterprises.activeCorpId})`);else Y.push(" 当前激活企业: 无默认企业 (无状态模式)");Y.push(""),Y.push("【健康自检】");for(let Q of $.checks){let J=Q.status==="ok"?"✓":Q.status==="warn"?"⚠️":"✗";Y.push(` ${J} [${Q.title}]: ${Q.message}`)}Y.push(""),Y.push("─────────────────────────────────────────────────────────────"),Y.push("\uD83D\uDC49 查阅内嵌白皮书与目录规范: seal-use doctor guide"),Y.push("\uD83D\uDC49 检索企业: seal-use corps search ");let z=$.checks.find((Q)=>Q.id==="rule_linter");if(z&&z.message.includes("未开启"))Y.push("\uD83D\uDC49 开启规则自动质量校验: seal-use config lint enable");return Y.join(` `)}var DS0=m(()=>{Lp();e9();y3();Rq();iB();Ko()});var AS0={};x8(AS0,{formatTenantDoctorDashboard:()=>mg1,diagnoseTenantContract:()=>dg1});async function dg1($,Y){let U=[],z=Y.environment==="test"?"test":"production",Q=z==="test"?Y.prodCorpId:Y.testCorpId,J=z==="test"?"prodParent":"testTarget",I=Q?z==="test"?"已绑定生产母企业 (上游配置与样本源)":"已绑定测试靶场 (下游隔离演练环境)":void 0,K=null,G=null;try{let w=await W8($);if(K=w.user,G=w.tenant,Boolean(K?.isAdmin||K?.permissions?.includes("*")))U.push({id:"auth_identity",name:"身份与权限契约",status:"pass",summary:`已认证为管理员「${K.name??"未知"}」(${K.id??""}),具备完整操作权限`,details:{userId:K.id,userName:K.name,isAdmin:!0,permissionLevel:"超级管理员(具备完整操作权限)",tenantName:G?.name,tenantSlug:G?.tenantSlug,permissions:K.permissions}});else U.push({id:"auth_identity",name:"身份与权限契约",status:"warn",summary:`已认证为普通用户「${K.name??"未知"}」,非超级管理员,部分配置操作可能受限`,details:{userId:K.id,userName:K.name,isAdmin:!1,permissionLevel:"普通用户(部分管理配置受限)",tenantName:G?.name,permissions:K.permissions},recommendation:"建议使用具有管理权限的企业主账号执行规则修改与集成发布"})}catch(w){U.push({id:"auth_identity",name:"身份与权限契约",status:"fail",summary:`鉴权握手失败:${w instanceof Error?w.message:String(w)}`,details:{error:String(w)},recommendation:`请执行 seal-use auth login --corp ${Y.id} 重新登录或更新 Token`})}let H={featureCode:"ai-approval",balance:0,deductionAmount:120,estimatedRuns:0,status:"exhausted"},W={used:0,remaining:0};try{let w=await nY($),N=Array.isArray(w.features)?w.features:[],O=N.find((P)=>P?.code==="ai-approval");if(O){let P=typeof O.balance==="number"?O.balance:0,T=typeof O.deductionAmount==="number"&&O.deductionAmount>0?O.deductionAmount:120,A=Math.floor(P/T);if(H.balance=P,H.deductionAmount=T,H.estimatedRuns=A,P<=0)H.status="exhausted",U.push({id:"billing_quota",name:"AI 审批额度余量",status:"fail",summary:"当前额度已耗尽 (余量 0 点),无法执行审批模拟或回归测试",details:{balance:P,deductionAmount:T,estimatedRuns:A},recommendation:`请前往后台充值补充额度 (可通过 seal-use auth link --corp ${Y.id} 免密直达)`});else if(A<10)H.status="low",U.push({id:"billing_quota",name:"AI 审批额度余量",status:"warn",summary:`额度偏低:剩余 ${P} 点 (单笔扣除 ${T} 点),仅可支持约 ${A} 笔审核`,details:{balance:P,deductionAmount:T,estimatedRuns:A},recommendation:`建议补充额度 (可通过 seal-use auth link --corp ${Y.id} 免密直达)`});else H.status="sufficient",U.push({id:"billing_quota",name:"AI 审批额度余量",status:"pass",summary:`额度充裕:剩余 ${P} 点,预估可支持 ${A} 笔审核单据`,details:{balance:P,deductionAmount:T,estimatedRuns:A}})}else U.push({id:"billing_quota",name:"AI 审批额度余量",status:"warn",summary:"未检索到「ai-approval」功能包额度明细,按默认通道运行",details:{features:N.map((P)=>P?.code)}});let D=N.find((P)=>P?.code==="approval-rules");if(D)W.used=typeof D.used==="number"?D.used:0,W.remaining=typeof D.remaining==="number"?D.remaining:0}catch(w){U.push({id:"billing_quota",name:"AI 审批额度余量",status:"warn",summary:`读取计费状态失败:${w instanceof Error?w.message:String(w)}`,details:{error:String(w)}})}let X={totalCount:0,activeCount:0,quotaUsed:W.used,quotaRemaining:W.remaining};try{let w=await p6($),N=Array.isArray(w.rules)?w.rules:[];if(X.totalCount=N.length,X.activeCount=N.filter((O)=>O.status==="ACTIVE").length,N.length===0)U.push({id:"rules_status",name:"审核规则状态",status:"warn",summary:"当前租户未配置任何审核规则 (规则数为 0)",details:{totalCount:0,activeCount:0},recommendation:z==="test"&&Q?`可运行 seal-use corps sync-test --corp ${Q} 从生产企业同步规则`:"可运行 seal-use rules add 创建基础规则"});else U.push({id:"rules_status",name:"审核规则状态",status:"pass",summary:`审核规则健康:共 ${X.totalCount} 条规则,其中生效活跃 ${X.activeCount} 条`,details:{totalCount:X.totalCount,activeCount:X.activeCount,quotaUsed:W.used,quotaRemaining:W.remaining}})}catch(w){U.push({id:"rules_status",name:"审核规则状态",status:"fail",summary:`拉取规则列表失败:${w instanceof Error?w.message:String(w)}`,details:{error:String(w)}})}let Z={integrationCount:0,hasReplayChannel:!1,activeWebhookId:void 0};try{let w=await J$($);Z.integrationCount=w.length;let N=w.find((O)=>O.name.includes("回放")||O.name.toLowerCase().includes("replay"));if(Z.hasReplayChannel=Boolean(N),Z.activeWebhookId=N?.id??w[0]?.id,w.length===0)U.push({id:"webhook_integrations",name:"单据推送 Webhook 通道",status:"pass",summary:"未配置任何 Webhook 集成通道 (日常审批无影响;若需自动化系统推流或单据重放将自动创建)",details:{integrationCount:0}});else U.push({id:"webhook_integrations",name:"单据推送 Webhook 通道",status:"pass",summary:`Webhook 集成通道就绪:共 ${w.length} 个通道${N?` (含专属回放通道「${N.name}」)`:""}`,details:{integrationCount:w.length,hasReplayChannel:Z.hasReplayChannel,activeWebhookId:Z.activeWebhookId}})}catch(w){U.push({id:"webhook_integrations",name:"单据推送 Webhook 通道",status:"warn",summary:`检测 Webhook 通道失败:${w instanceof Error?w.message:String(w)}`,details:{error:String(w)}})}if(z==="test")if(Q)U.push({id:"environment_binding",name:"测试环境配对契约",status:"pass",summary:`测试租户已绑定生产母企业「${Q}」,具备样本拉取与配置同步能力`,details:{environment:z,boundCorpId:Q,boundCorpRole:J,boundCorpRoleDescription:I}});else U.push({id:"environment_binding",name:"测试环境配对契约",status:"warn",summary:"测试租户尚未绑定对应的生产母企业,无法直接拉取生产样本执行自动化回归",details:{environment:z},recommendation:`可运行 seal-use corps bind-test ${Y.id} 建立 1 对 1 绑定`});else if(Q)U.push({id:"environment_binding",name:"生产环境安全隔离契约",status:"pass",summary:`生产企业已绑定沙箱测试靶场「${Q}」,回归测试将严格限制在靶场中运行`,details:{environment:z,boundCorpId:Q,boundCorpRole:J,boundCorpRoleDescription:I}});else U.push({id:"environment_binding",name:"生产环境安全隔离契约",status:"warn",summary:"生产企业尚未绑定任何测试企业,所有回归测试功能将触发安全拦截",details:{environment:z},recommendation:`可运行 seal-use corps bind-test ${Y.id} 为该生产租户绑定测试靶场`});let q=U.filter((w)=>w.status==="fail").length,V=U.filter((w)=>w.status==="warn").length,F=U.filter((w)=>w.status==="pass").length,M="HEALTHY";if(q>0)M="BLOCKED";else if(V>0)M="DEGRADED";return{ok:q===0,verdict:M,timestamp:new Date().toISOString(),corp:{id:Y.id,name:Y.name,environment:z,sourceType:Y.source?.type??"native",boundCorpId:Q,boundCorpRole:J,boundCorpRoleDescription:I},summary:{totalChecks:U.length,passedChecks:F,warningChecks:V,failedChecks:q},checks:U,quota:H,rules:X,webhooks:Z}}function mg1($){let{corp:Y,verdict:U,summary:z,checks:Q,quota:J,rules:I,webhooks:K}=$,G=U==="HEALTHY"?"\uD83D\uDFE2 健康良好 (HEALTHY)":U==="DEGRADED"?"\uD83D\uDFE1 亚健康降级 (DEGRADED)":"\uD83D\uDD34 阻断受限 (BLOCKED)",H=["",`\uD83C\uDFE5 [Seal Use Doctor] 租户全链路契约体检: ${Y.name} (${Y.id})`,` 状态: ${G} · 环境: ${Y.environment.toUpperCase()} · 耗时: 实时探针`," "+"─".repeat(60)];if(H.push(` AI 审批余量: ${J.balance} 点 (可审约 ${J.estimatedRuns} 笔) | 规则数: ${I.activeCount}/${I.totalCount} | Webhook 通道: ${K.integrationCount}`),Y.boundCorpId)H.push(` 配对关系: ${Y.environment==="test"?"来源生产母企业":"绑定的测试靶场"} -> 「${Y.boundCorpId}」`);H.push(" "+"─".repeat(60));for(let W of Q){let X=W.status==="pass"?"✓":W.status==="warn"?"!":"✗";if(H.push(` [${X}] ${W.name}: ${W.summary}`),W.recommendation)H.push(` \uD83D\uDC49 建议: ${W.recommendation}`)}if(H.push(" "+"─".repeat(60)),H.push(` 检查汇总: 通过 ${z.passedChecks} · 告警 ${z.warningChecks} · 失败 ${z.failedChecks}`),J.status==="exhausted"||J.status==="low")H.push(` \uD83D\uDC49 Next action: seal-use auth link --corp ${Y.id}`);return H.push(""),H.join(` `)}var BS0=m(()=>{X6()});async function PS0($,Y,U){let z=($??Y??"").toLowerCase();if(z==="guide"||z==="doc"||z==="knowledge"||z==="book"){console.error(`\uD83D\uDCD6 [Seal Use Doctor] 正在读取内嵌系统规范白皮书(纯内存只读)... -`),console.log(FS0());return}if(z==="paths"||z==="dirs"||z==="directories"){let I=Go();f0(I.directories);return}if(z==="tenant"||z==="corp"||z==="enterprise"){let{selectCorp:I}=await Promise.resolve().then(() => (f4(),w_0)),{createSealClient:K}=await Promise.resolve().then(() => (i8(),_00)),{stringOption:G}=await Promise.resolve().then(() => (D4(),H_0)),{diagnoseTenantContract:H,formatTenantDoctorDashboard:W}=await Promise.resolve().then(() => (BS0(),AS0)),X=G(U.options.corp)??(Y&&Y!==z?Y:void 0)??(U.command[2]&&U.command[2]!==z?U.command[2]:void 0),Z=I(X),q=await K(Z),V=await H(q,Z);if(!(Z0(U.options.quiet)||Z0(U.options.silent)))console.error(W(V));f0(V);return}let Q=Go();if(!(Z0(U.options.quiet)||Z0(U.options.silent)))console.error(NS0(Q));f0(Q)}var TS0=m(()=>{DS0();Ko();D4();J4()});var ES0;var jS0=m(()=>{ES0={openapi:"3.1.0",info:{title:"seal-use Wrapped API",version:"0.10.32",description:"HTTP contract for the seal-use wrapped backend API, served by the local HTTP adapter\n(`seal-use http`, or the `seal-use service start` daemon; default http://127.0.0.1:8787).\n\nThese endpoints describe the stable wrapped API for frontend developers and agents. They are\nnot the raw downstream Seal endpoints: seal-use is responsible for enterprise selection,\nsource authentication, response compaction, and diagnostics-friendly fields.\n\nEvery operation declares `x-implementation-status`, so a caller can tell what the running\nadapter actually serves:\n\n- `implemented` — routed by `src/http/routes.ts` today. `src/http/openapi-implementation.test.ts`\n fails when an `implemented` operation has no matching route.\n- `planned` — contract-only, designed but not routed yet. Calling it returns 404.\n\nThe same capabilities are reachable through the CLI, and through the optional MCP server when\nit is enabled.\n"},servers:[{url:"http://localhost:8787",description:"Local HTTP adapter (`seal-use http`, or the `seal-use service start` daemon). Loopback-only by default."}],security:[{localSession:[]}],tags:[{name:"Corps",description:"Local enterprise configuration selection."},{name:"Source",description:"Source-derived Seal enterprise configuration."},{name:"Auth",description:"Wrapped authentication diagnostics and current identity."},{name:"Approval Runs",description:"Wrapped approval run history, summaries, document URLs, and trace bridge helpers."},{name:"Approval Knowledge",description:"Wrapped approval rules, documents, preferences, and search."},{name:"Simulation",description:"Wrapped simulation batch record access."}],paths:{"/v1/corps":{get:{tags:["Corps"],operationId:"listCorps","x-implementation-status":"implemented",summary:"List configured enterprises",responses:{"200":{description:"Configured enterprises.",content:{"application/json":{schema:{type:"array",items:{type:"object",required:["id","name","sourceType","current"],properties:{id:{type:"string"},name:{type:"string"},sourceType:{type:"string",enum:["hose","direct","seal"]},current:{type:"boolean"}}}}}}}}}},"/v1/corps/current":{get:{tags:["Corps"],operationId:"getCurrentCorp","x-implementation-status":"planned",summary:"Get current enterprise",description:"Returns the configured default enterprise in stateful mode. Stateless mode has no current enterprise and requires an explicit corpId for enterprise operations.",responses:{"200":{description:"Current enterprise.",content:{"application/json":{schema:{type:"object",required:["id","name","sourceType","current"],properties:{id:{type:"string"},name:{type:"string"},sourceType:{type:"string",enum:["hose","direct","seal"]},current:{type:"boolean"}}}}}}}}},"/v1/corps/current/switch":{post:{tags:["Corps"],operationId:"switchCurrentCorp","x-implementation-status":"planned",summary:"Switch current enterprise",requestBody:{required:!0,content:{"application/json":{schema:{type:"object",required:["corpId"],properties:{corpId:{type:"string"}}}}}},responses:{"200":{description:"Switched enterprise.",content:{"application/json":{schema:{type:"object",required:["current","id","name"],properties:{current:{type:"boolean"},id:{type:"string"},name:{type:"string"}}}}}},"404":{description:"Requested resource was not found.",content:{"application/json":{schema:{type:"object",additionalProperties:!0,required:["error"],properties:{error:{type:"string"},message:{type:"string"},details:{}}}}}}}}},"/v1/source/config":{get:{tags:["Source"],operationId:"getSourceConfig","x-implementation-status":"planned",summary:"Resolve source-derived Seal enterprise config",parameters:[{name:"corpId",in:"query",schema:{type:"string"},description:"Local enterprise config ID. Required when global selection mode is stateless; optional in stateful mode, where the configured default enterprise is used."}],responses:{"200":{description:"Redacted Seal enterprise config.",content:{"application/json":{schema:{type:"object",additionalProperties:!0,description:"Redacted Seal enterprise config resolved from the configured source."}}}},"401":{description:"Local service authentication failed or downstream Seal auth failed.",content:{"application/json":{schema:{type:"object",additionalProperties:!0,required:["error"],properties:{error:{type:"string"},message:{type:"string"},details:{}}}}}}}}},"/v1/auth/diagnose":{get:{tags:["Auth"],operationId:"diagnoseAuth","x-implementation-status":"planned",summary:"Diagnose wrapped source-to-Seal authentication",parameters:[{name:"corpId",in:"query",schema:{type:"string"},description:"Local enterprise config ID. Required when global selection mode is stateless; optional in stateful mode, where the configured default enterprise is used."}],responses:{"200":{description:"Authentication stage diagnosis.",content:{"application/json":{schema:{type:"object",required:["stages"],properties:{stages:{type:"array",items:{$ref:"#/components/schemas/AuthStage"}}}}}}}}}},"/v1/whoami":{get:{tags:["Auth"],operationId:"whoami","x-implementation-status":"implemented",summary:"Get current wrapped Seal identity",parameters:[{name:"corpId",in:"query",schema:{type:"string"},description:"Local enterprise config ID. Required when global selection mode is stateless; optional in stateful mode, where the configured default enterprise is used."}],responses:{"200":{description:"Current Seal user and tenant.",content:{"application/json":{schema:{type:"object",required:["user","tenant"],properties:{user:{$ref:"#/components/schemas/SealUser"},tenant:{$ref:"#/components/schemas/SealTenant"}}}}}},"401":{description:"Local service authentication failed or downstream Seal auth failed.",content:{"application/json":{schema:{type:"object",additionalProperties:!0,required:["error"],properties:{error:{type:"string"},message:{type:"string"},details:{}}}}}}}}},"/v1/session":{get:{tags:["Auth"],operationId:"getSession","x-implementation-status":"implemented",summary:"Get current wrapped Seal session metadata",parameters:[{name:"corpId",in:"query",schema:{type:"string"},description:"Local enterprise config ID. Required when global selection mode is stateless; optional in stateful mode, where the configured default enterprise is used."}],responses:{"200":{description:"Current session metadata.",content:{"application/json":{schema:{type:"object",additionalProperties:!0,required:["user","session"],properties:{user:{$ref:"#/components/schemas/SealUser"},session:{type:"object",additionalProperties:!0}}}}}},"401":{description:"Local service authentication failed or downstream Seal auth failed.",content:{"application/json":{schema:{type:"object",additionalProperties:!0,required:["error"],properties:{error:{type:"string"},message:{type:"string"},details:{}}}}}}}}},"/v1/approval/context":{get:{tags:["Approval Knowledge"],operationId:"getApprovalContext","x-implementation-status":"planned",summary:"Get rules, documents, and style preferences together",parameters:[{name:"corpId",in:"query",schema:{type:"string"},description:"Local enterprise config ID. Required when global selection mode is stateless; optional in stateful mode, where the configured default enterprise is used."},{name:"documentLimit",in:"query",schema:{type:"integer",minimum:1}},{name:"latestRuleVersion",in:"query",schema:{type:"boolean"}},{name:"ruleVersionNumber",in:"query",schema:{type:"integer"}}],responses:{"200":{description:"Approval context.",content:{"application/json":{schema:{type:"object",required:["rules","documents","stylePreferences"],properties:{rules:{},documents:{},stylePreferences:{}}}}}}}}},"/v1/approval/search":{post:{tags:["Approval Knowledge"],operationId:"searchApprovalKnowledge","x-implementation-status":"planned",summary:"Search approval rules, documents, and preferences",requestBody:{required:!0,content:{"application/json":{schema:{type:"object",required:["keywords"],properties:{keywords:{type:"array",minItems:1,items:{type:"string"}},matchMode:{type:"string",enum:["any","all"]},areas:{type:"array",items:{type:"string",enum:["rules","documents","preferences"]}},maxResults:{type:"integer"}}}}}},responses:{"200":{description:"Search results with line context.",content:{"application/json":{schema:{type:"object",additionalProperties:!0}}}}}}},"/v1/approval/rules":{get:{tags:["Approval Knowledge"],operationId:"listApprovalRules","x-implementation-status":"implemented",summary:"List current draft approval rules",responses:{"200":{description:"Draft rules.",content:{"application/json":{schema:{type:"object",required:["rules"],properties:{rules:{type:"array",items:{$ref:"#/components/schemas/ApprovalRule"}},hasPendingDeletes:{type:"boolean"}}}}}}}},post:{tags:["Approval Knowledge"],operationId:"createApprovalRule","x-implementation-status":"planned",summary:"Create draft approval rule",requestBody:{required:!0,content:{"application/json":{schema:{type:"object",required:["description","scope","strictness"],properties:{description:{type:"string"},scope:{type:"string"},strictness:{type:"string",enum:["MUST_FOLLOW","SHOULD_FOLLOW","SUGGESTION"]}}}}}},responses:{"200":{description:"Created rule.",content:{"application/json":{schema:{type:"object",additionalProperties:!0,required:["id","description","scope","strictness"],properties:{id:{type:"string"},description:{type:"string"},scope:{type:"string"},strictness:{type:"string",enum:["MUST_FOLLOW","SHOULD_FOLLOW","SUGGESTION"]},status:{type:"string"}}}}}}}}},"/v1/approval/rules/{ruleId}":{parameters:[{name:"ruleId",in:"path",required:!0,schema:{type:"string"},description:"Approval rule ID."}],patch:{tags:["Approval Knowledge"],operationId:"updateApprovalRule","x-implementation-status":"planned",summary:"Update draft approval rule",requestBody:{required:!0,content:{"application/json":{schema:{type:"object",additionalProperties:!1,properties:{description:{type:"string"},scope:{type:"string"},strictness:{type:"string",enum:["MUST_FOLLOW","SHOULD_FOLLOW","SUGGESTION"]}}}}}},responses:{"200":{description:"Updated rule.",content:{"application/json":{schema:{type:"object",additionalProperties:!0,required:["id","description","scope","strictness"],properties:{id:{type:"string"},description:{type:"string"},scope:{type:"string"},strictness:{type:"string",enum:["MUST_FOLLOW","SHOULD_FOLLOW","SUGGESTION"]},status:{type:"string"}}}}}}}},delete:{tags:["Approval Knowledge"],operationId:"deleteApprovalRule","x-implementation-status":"planned",summary:"Delete draft approval rule",responses:{"200":{description:"Deleted."}}}},"/v1/approval/rule-versions":{get:{tags:["Approval Knowledge"],operationId:"listApprovalRuleVersions","x-implementation-status":"planned",summary:"List published approval rule versions",responses:{"200":{description:"Published rule versions.",content:{"application/json":{schema:{type:"array",items:{type:"object",additionalProperties:!0,required:["id","versionNumber","versionName","rules"],properties:{id:{type:"string"},versionNumber:{type:"integer"},versionName:{type:"string"},publishedByName:{type:"string"},rules:{type:"array",items:{type:"object",additionalProperties:!0}}}}}}}}}}},"/v1/approval/rule-versions/{versionId}":{parameters:[{name:"versionId",in:"path",required:!0,schema:{type:"string"},description:"Published rule version ID."}],get:{tags:["Approval Knowledge"],operationId:"getApprovalRuleVersion","x-implementation-status":"planned",summary:"Get published approval rule version",responses:{"200":{description:"Rule version.",content:{"application/json":{schema:{type:"object",additionalProperties:!0,required:["id","versionNumber","versionName","rules"],properties:{id:{type:"string"},versionNumber:{type:"integer"},versionName:{type:"string"},publishedByName:{type:"string"},rules:{type:"array",items:{type:"object",additionalProperties:!0}}}}}}}}}},"/v1/approval/rules/by-version":{get:{tags:["Approval Knowledge"],operationId:"getApprovalRuleByVersion","x-implementation-status":"planned",summary:"Get one wrapped rule from a published version",parameters:[{name:"corpId",in:"query",schema:{type:"string"},description:"Local enterprise config ID. Required when global selection mode is stateless; optional in stateful mode, where the configured default enterprise is used."},{name:"versionNumber",in:"query",schema:{type:"integer"}},{name:"versionId",in:"query",schema:{type:"string"}},{name:"latest",in:"query",schema:{type:"boolean"}},{name:"code",in:"query",schema:{type:"string"},description:"Display rule code such as '#0038'."},{name:"runtimeId",in:"query",schema:{type:"string"},description:"Runtime rule ID such as rule-205."},{name:"recordId",in:"query",schema:{type:"string"},description:"Infer versionNumber from an approval run."}],responses:{"200":{description:"One rule from a published version.",content:{"application/json":{schema:{type:"object",additionalProperties:!0}}}}}}},"/v1/approval/rule-versions/publish":{post:{tags:["Approval Knowledge"],operationId:"publishApprovalRuleVersion","x-implementation-status":"planned",summary:"Publish current draft rules",requestBody:{required:!0,content:{"application/json":{schema:{type:"object",required:["versionName"],properties:{versionName:{type:"string"}}}}}},responses:{"200":{description:"Published version.",content:{"application/json":{schema:{type:"object",additionalProperties:!0}}}}}}},"/v1/approval/documents":{get:{tags:["Approval Knowledge"],operationId:"listApprovalDocuments","x-implementation-status":"planned",summary:"List approval knowledge documents",parameters:[{name:"offset",in:"query",schema:{type:"integer",minimum:0,default:0},description:"Zero-based pagination offset."},{name:"limit",in:"query",schema:{type:"integer",minimum:1,default:20}},{name:"scenario",in:"query",schema:{type:"array",items:{type:"string"}},style:"form",explode:!0}],responses:{"200":{description:"Documents.",content:{"application/json":{schema:{type:"object",required:["articles"],properties:{articles:{type:"array",items:{$ref:"#/components/schemas/ApprovalDocument"}},total:{type:"integer"}}}}}}}},post:{tags:["Approval Knowledge"],operationId:"createApprovalDocument","x-implementation-status":"planned",summary:"Create approval knowledge document",requestBody:{required:!0,content:{"application/json":{schema:{type:"object",required:["title","purpose","content"],properties:{title:{type:"string"},purpose:{type:"string"},content:{type:"string"},contentType:{type:"string"},status:{type:"string"},scenarios:{type:"array",items:{type:"string"}},tags:{type:"array",items:{type:"string"}}}}}}},responses:{"200":{description:"Created document.",content:{"application/json":{schema:{type:"object",additionalProperties:!0,required:["id","title","content"],properties:{id:{type:"string"},title:{type:"string"},purpose:{type:"string"},content:{type:"string",description:"Usually Markdown."},contentType:{type:"string"},status:{type:"string"},enabled:{type:"boolean"},scenarios:{type:"array",items:{type:"string"}},tags:{type:"array",items:{type:"string"}}}}}}}}}},"/v1/approval/documents/{documentId}":{parameters:[{name:"documentId",in:"path",required:!0,schema:{type:"string"},description:"Approval knowledge document ID."}],get:{tags:["Approval Knowledge"],operationId:"getApprovalDocument","x-implementation-status":"planned",summary:"Get approval knowledge document",responses:{"200":{description:"Document.",content:{"application/json":{schema:{type:"object",additionalProperties:!0,required:["id","title","content"],properties:{id:{type:"string"},title:{type:"string"},purpose:{type:"string"},content:{type:"string",description:"Usually Markdown."},contentType:{type:"string"},status:{type:"string"},enabled:{type:"boolean"},scenarios:{type:"array",items:{type:"string"}},tags:{type:"array",items:{type:"string"}}}}}}}}},patch:{tags:["Approval Knowledge"],operationId:"updateApprovalDocument","x-implementation-status":"planned",summary:"Update approval knowledge document",requestBody:{required:!0,content:{"application/json":{schema:{type:"object",additionalProperties:!1,properties:{title:{type:"string"},purpose:{type:"string"},content:{type:"string"},contentType:{type:"string"},status:{type:"string"},enabled:{type:"boolean"},scenarios:{type:"array",items:{type:"string"}},tags:{type:"array",items:{type:"string"}}}}}}},responses:{"200":{description:"Updated document.",content:{"application/json":{schema:{type:"object",additionalProperties:!0,required:["id","title","content"],properties:{id:{type:"string"},title:{type:"string"},purpose:{type:"string"},content:{type:"string",description:"Usually Markdown."},contentType:{type:"string"},status:{type:"string"},enabled:{type:"boolean"},scenarios:{type:"array",items:{type:"string"}},tags:{type:"array",items:{type:"string"}}}}}}}}},delete:{tags:["Approval Knowledge"],operationId:"deleteApprovalDocument","x-implementation-status":"planned",summary:"Delete approval knowledge document",responses:{"200":{description:"Deleted document confirmation."}}}},"/v1/approval/style-preferences":{get:{tags:["Approval Knowledge"],operationId:"getApprovalStylePreferences","x-implementation-status":"planned",summary:"Get approval style preferences",responses:{"200":{description:"Style preferences.",content:{"application/json":{schema:{type:"object",additionalProperties:!0,properties:{tone:{type:"string"},language:{type:"string"},detailLevel:{type:"string"},outputFormat:{type:"string"},examples:{type:"array",items:{type:"string"}},prohibitedPhrases:{type:"array",items:{type:"string"}},customInstructions:{type:"string"}}}}}}}},patch:{tags:["Approval Knowledge"],operationId:"updateApprovalStylePreferences","x-implementation-status":"planned",summary:"Update approval style preferences",requestBody:{required:!0,content:{"application/json":{schema:{type:"object",additionalProperties:!0,properties:{tone:{type:"string"},language:{type:"string"},detailLevel:{type:"string"},outputFormat:{type:"string"},examples:{type:"array",items:{type:"string"}},prohibitedPhrases:{type:"array",items:{type:"string"}},customInstructions:{type:"string"}}}}}},responses:{"200":{description:"Updated style preferences.",content:{"application/json":{schema:{type:"object",additionalProperties:!0,properties:{tone:{type:"string"},language:{type:"string"},detailLevel:{type:"string"},outputFormat:{type:"string"},examples:{type:"array",items:{type:"string"}},prohibitedPhrases:{type:"array",items:{type:"string"}},customInstructions:{type:"string"}}}}}}}}},"/v1/preferences":{get:{tags:["Approval Knowledge"],operationId:"getPreferences","x-implementation-status":"implemented",summary:"Get current decision, thinking-depth and rule-version preferences",parameters:[{name:"corpId",in:"query",schema:{type:"string"},description:"Local enterprise config ID. Required when global selection mode is stateless; optional in stateful mode, where the configured default enterprise is used."}],responses:{"200":{description:"Decision preferences, thinking depth preference and the bound rule set version.",content:{"application/json":{schema:{type:"object",additionalProperties:!0,properties:{tone:{type:"string"},language:{type:"string"},detailLevel:{type:"string"},outputFormat:{type:"string"},examples:{type:"array",items:{type:"string"}},prohibitedPhrases:{type:"array",items:{type:"string"}},customInstructions:{type:"string"}}}}}}}}},"/v1/preferences/decision":{post:{tags:["Approval Knowledge"],operationId:"updatePreferenceDecision","x-implementation-status":"implemented",summary:"Update decision preferences (takes effect immediately for the running approval agent)",parameters:[{name:"corpId",in:"query",schema:{type:"string"},description:"Local enterprise config ID. Required when global selection mode is stateless; optional in stateful mode, where the configured default enterprise is used."}],requestBody:{required:!0,content:{"application/json":{schema:{type:"object",properties:{explicitApprove:{type:"string"},explicitReject:{type:"string"},exemptApprove:{type:"string"},review:{type:"string"},dryRun:{type:"boolean",description:"Return the before/after diff without writing."}}}}}},responses:{"200":{description:"Updated preferences, or the previewed diff when dryRun is set.",content:{"application/json":{schema:{type:"object",additionalProperties:!0,properties:{tone:{type:"string"},language:{type:"string"},detailLevel:{type:"string"},outputFormat:{type:"string"},examples:{type:"array",items:{type:"string"}},prohibitedPhrases:{type:"array",items:{type:"string"}},customInstructions:{type:"string"}}}}}}}}},"/v1/approval-runs":{get:{tags:["Approval Runs"],operationId:"searchApprovalRuns","x-implementation-status":"implemented",summary:"Search wrapped approval run history",parameters:[{name:"corpId",in:"query",schema:{type:"string"},description:"Local enterprise config ID. Required when global selection mode is stateless; optional in stateful mode, where the configured default enterprise is used."},{name:"offset",in:"query",schema:{type:"integer",minimum:0,default:0},description:"Zero-based pagination offset."},{name:"limit",in:"query",schema:{type:"integer",minimum:1,maximum:100,default:50},description:"Maximum number of records to return."},{name:"startDate",in:"query",schema:{type:"string"},description:"Creation-time lower bound in milliseconds."},{name:"endDate",in:"query",schema:{type:"string"},description:"Creation-time upper bound in milliseconds."},{name:"status",in:"query",schema:{type:"string"}},{name:"taskMode",in:"query",schema:{type:"string"}},{name:"manualApprovalStatus",in:"query",schema:{oneOf:[{type:"string"},{type:"array",items:{type:"string"}}]}},{name:"sourceDocumentSN",in:"query",schema:{type:"string"},description:"Hose/易快报单号 or other external source document number."},{name:"sourceDocumentId",in:"query",schema:{type:"string"}},{name:"humanResult",in:"query",schema:{type:"string"},description:"Local human result contains filter, such as 驳回 or 通过."},{name:"query",in:"query",schema:{type:"string"},description:"Search across record ID, source document fields, document ID, and trace fields."},{name:"includeBridge",in:"query",schema:{type:"boolean",default:!1},description:"Include full Langfuse bridge rows."}],responses:{"200":{description:"Compact wrapped approval run list.",content:{"application/json":{schema:{type:"object",additionalProperties:!0,required:["records"],properties:{records:{type:"array",items:{$ref:"#/components/schemas/ApprovalRun"}},total:{type:"integer"},bridge:{type:"array",items:{type:"object",additionalProperties:!0}}}}}}}}}},"/v1/approval-runs/summary":{get:{tags:["Approval Runs"],operationId:"summarizeApprovalRuns","x-implementation-status":"implemented",summary:"Summarize approval runs by local date",parameters:[{name:"corpId",in:"query",schema:{type:"string"},description:"Local enterprise config ID. Required when global selection mode is stateless; optional in stateful mode, where the configured default enterprise is used."},{name:"date",in:"query",schema:{type:"string",format:"date"}},{name:"timezone",in:"query",schema:{type:"string",default:"Asia/Shanghai"}},{name:"limit",in:"query",schema:{type:"integer",minimum:1,maximum:100,default:50},description:"Maximum number of records to return."},{name:"query",in:"query",schema:{type:"string"}},{name:"humanResult",in:"query",schema:{type:"string"}}],responses:{"200":{description:"Date summary with counts and compact records.",content:{"application/json":{schema:{type:"object",additionalProperties:!0,properties:{date:{type:"string"},timezone:{type:"string"},matched:{type:"integer"},statusCounts:{type:"object",additionalProperties:{type:"integer"}},taskModeCounts:{type:"object",additionalProperties:{type:"integer"}}}}}}}}}},"/v1/approval-runs/stats":{get:{tags:["Approval Runs"],operationId:"statApprovalRuns","x-implementation-status":"implemented",summary:"Aggregate approval run counts by status and source system",parameters:[{name:"corpId",in:"query",schema:{type:"string"},description:"Local enterprise config ID. Required when global selection mode is stateless; optional in stateful mode, where the configured default enterprise is used."},{name:"since",in:"query",schema:{type:"string"},description:"Time window such as 3months, 7days or 24hours."},{name:"dedupeBy",in:"query",schema:{type:"string",enum:["sourceDocumentSN","sourceDocumentId","id"],default:"sourceDocumentSN"},description:"Field used to count distinct business documents."},{name:"status",in:"query",schema:{type:"string"}},{name:"sourceSystem",in:"query",schema:{type:"string"}},{name:"taskMode",in:"query",schema:{type:"string"}}],responses:{"200":{description:"Counts grouped by status and source system, plus the deduplicated total.",content:{"application/json":{schema:{type:"object"}}}}}}},"/v1/approval-runs/pick":{get:{tags:["Approval Runs"],operationId:"pickApprovalRuns","x-implementation-status":"implemented",summary:"Pick likely approval runs by document number or trace key",parameters:[{name:"corpId",in:"query",schema:{type:"string"},description:"Local enterprise config ID. Required when global selection mode is stateless; optional in stateful mode, where the configured default enterprise is used."},{name:"query",in:"query",schema:{type:"string"}},{name:"sn",in:"query",schema:{type:"string"},description:"Source document number for direct lookup."},{name:"batch",in:"query",schema:{type:"string"},description:"Optional simulation batch ID."},{name:"latest",in:"query",schema:{type:"boolean"}},{name:"fields",in:"query",schema:{type:"string"},description:"Comma-separated response fields."},{name:"limit",in:"query",schema:{type:"integer",default:20}},{name:"maxScan",in:"query",schema:{type:"integer",default:1000}}],responses:{"200":{description:"Picked records and suggested next actions.",content:{"application/json":{schema:{type:"object",additionalProperties:!0}}}}}}},"/v1/approval-runs/bridge":{get:{tags:["Approval Runs"],operationId:"getApprovalRunLangfuseBridge","x-implementation-status":"planned",summary:"Resolve approval runs to Langfuse trace or session hints",parameters:[{name:"corpId",in:"query",schema:{type:"string"},description:"Local enterprise config ID. Required when global selection mode is stateless; optional in stateful mode, where the configured default enterprise is used."},{name:"recordId",in:"query",schema:{type:"string"}},{name:"sourceDocumentSN",in:"query",schema:{type:"string"}},{name:"sourceDocumentId",in:"query",schema:{type:"string"}},{name:"simulationBatchId",in:"query",schema:{type:"string"}}],responses:{"200":{description:"Trace/session bridge hints.",content:{"application/json":{schema:{type:"object",additionalProperties:!0,properties:{count:{type:"integer"},records:{type:"array",items:{$ref:"#/components/schemas/ApprovalRun"}},bridge:{type:"array",items:{type:"object",additionalProperties:!0}}}}}}}}}},"/v1/approval-runs/url":{get:{tags:["Approval Runs"],operationId:"getApprovalRunUrl","x-implementation-status":"implemented",summary:"Get Seal AI result URL and optional source document URL",parameters:[{name:"corpId",in:"query",schema:{type:"string"},description:"Local enterprise config ID. Required when global selection mode is stateless; optional in stateful mode, where the configured default enterprise is used."},{name:"recordId",in:"query",schema:{type:"string"}},{name:"sourceDocumentSN",in:"query",schema:{type:"string"}},{name:"sourceDocumentId",in:"query",schema:{type:"string"}}],responses:{"200":{description:"Seal AI result URL and source document URL.",content:{"application/json":{schema:{type:"object",additionalProperties:!0,properties:{url:{type:"string"},sealResultUrl:{type:"string"},ssoUrl:{type:"string"},documentUrl:{type:"string"},hoseDocumentUrl:{type:"string"},recordId:{type:"string"},sourceDocumentSN:{type:"string"}}}}}}}}},"/v1/approval-runs/{recordId}":{parameters:[{name:"recordId",in:"path",required:!0,schema:{type:"string"},description:"seal-use approval run record ID."}],get:{tags:["Approval Runs"],operationId:"getApprovalRun","x-implementation-status":"implemented",summary:"Get wrapped approval run detail",parameters:[{name:"summary",in:"query",schema:{type:"boolean"}},{name:"fields",in:"query",schema:{type:"string"},description:"Comma-separated field paths such as metadata,document.fields,result.summary."}],responses:{"200":{description:"Approval run detail plus stable aliases and human result.",content:{"application/json":{schema:{type:"object",additionalProperties:!0}}}}}}},"/v1/approval-runs/{recordId}/cited-rules":{parameters:[{name:"recordId",in:"path",required:!0,schema:{type:"string"},description:"seal-use approval run record ID."}],get:{tags:["Approval Runs"],operationId:"getApprovalRunCitedRules","x-implementation-status":"implemented",summary:"Extract rules cited or matched by the AI result",responses:{"200":{description:"Cited rule summaries.",content:{"application/json":{schema:{type:"object",additionalProperties:!0}}}}}}},"/v1/approval-runs/{recordId}/document-summary":{parameters:[{name:"recordId",in:"path",required:!0,schema:{type:"string"},description:"seal-use approval run record ID."}],get:{tags:["Approval Runs"],operationId:"getApprovalRunDocumentSummary","x-implementation-status":"implemented",summary:"Get key document fields and compact AI/manual result",responses:{"200":{description:"Document summary.",content:{"application/json":{schema:{type:"object",additionalProperties:!0}}}}}}},"/v1/approval-runs/{recordId}/attachments":{parameters:[{name:"recordId",in:"path",required:!0,schema:{type:"string"},description:"seal-use approval run record ID."}],get:{tags:["Approval Runs"],operationId:"getApprovalRunAttachments","x-implementation-status":"implemented",summary:"List compact attachment metadata",parameters:[{name:"summary",in:"query",schema:{type:"boolean"}}],responses:{"200":{description:"Attachment metadata.",content:{"application/json":{schema:{type:"object",additionalProperties:!0}}}}}}},"/v1/approval-runs/{recordId}/result":{parameters:[{name:"recordId",in:"path",required:!0,schema:{type:"string"},description:"seal-use approval run record ID."}],get:{tags:["Approval Runs"],operationId:"getApprovalRunResult","x-implementation-status":"implemented",summary:"Get AI result, optionally as a compact summary",parameters:[{name:"summary",in:"query",schema:{type:"boolean"}}],responses:{"200":{description:"AI result or summary.",content:{"application/json":{schema:{type:"object",additionalProperties:!0}}}}}}},"/v1/simulation/create-batch":{post:{tags:["Simulation"],operationId:"createSimulationBatch","x-implementation-status":"implemented",summary:"Create a simulation batch",requestBody:{required:!0,content:{"application/json":{schema:{type:"object",additionalProperties:!0}}}},responses:{"200":{description:"Created batch id.",content:{"application/json":{schema:{type:"object",additionalProperties:!0}}}}}}},"/v1/simulation/create-material-pack-batch":{post:{tags:["Simulation"],operationId:"createMaterialPackBatch","x-implementation-status":"planned",summary:"Create a material pack simulation batch",requestBody:{required:!0,content:{"application/json":{schema:{type:"object",additionalProperties:!0}}}},responses:{"200":{description:"Created batch id.",content:{"application/json":{schema:{type:"object",additionalProperties:!0}}}}}}},"/v1/simulation/batches":{get:{tags:["Simulation"],operationId:"listSimulationBatches","x-implementation-status":"implemented",summary:"List simulation batches",parameters:[{name:"limit",in:"query",schema:{type:"integer"},description:"Max batches to return."}],responses:{"200":{description:"Simulation batches.",content:{"application/json":{schema:{type:"array",items:{type:"object",additionalProperties:!0}}}}}}}},"/v1/simulation/batch/{batchId}":{parameters:[{name:"batchId",in:"path",required:!0,schema:{type:"string"},description:"Simulation batch ID."}],get:{tags:["Simulation"],operationId:"getSimulationBatch","x-implementation-status":"implemented",summary:"Get a simulation batch detail including echoed create params",responses:{"200":{description:"Simulation batch detail.",content:{"application/json":{schema:{type:"object",additionalProperties:!0}}}}}}},"/v1/simulation/batches/{batchId}/records":{parameters:[{name:"batchId",in:"path",required:!0,schema:{type:"string"},description:"Simulation batch ID."}],get:{tags:["Simulation"],operationId:"getSimulationBatchRecords","x-implementation-status":"planned",summary:"Get wrapped simulation batch records",parameters:[{name:"query",in:"query",schema:{type:"string"},description:"Optional local contains filter for record/document/trace identifiers."}],responses:{"200":{description:"Compact simulation records and bridge hints.",content:{"application/json":{schema:{type:"object",additionalProperties:!0}}}}}}},"/v1/simulation/templates":{get:{tags:["Simulation"],operationId:"listSimulationTemplates","x-implementation-status":"planned",summary:"List simulation test templates",responses:{"200":{description:"Simulation templates.",content:{"application/json":{schema:{type:"array",items:{type:"object",additionalProperties:!0}}}}}}}},"/v1/simulation/integration-status":{get:{tags:["Simulation"],operationId:"getSimulationIntegrationStatus","x-implementation-status":"planned",summary:"Get available source integration status for simulation",responses:{"200":{description:"Integration status.",content:{"application/json":{schema:{type:"object",additionalProperties:!0}}}}}}},"/v1/simulation/hosecloud-integrations":{get:{tags:["Simulation"],operationId:"listSimulationHosecloudIntegrations","x-implementation-status":"planned",summary:"List hosecloud source integrations available for simulation",responses:{"200":{description:"Hosecloud integrations.",content:{"application/json":{schema:{type:"array",items:{type:"object",additionalProperties:!0}}}}}}}},"/v1/material-packages/upload":{post:{tags:["Simulation"],operationId:"uploadMaterialPackage","x-implementation-status":"planned",summary:"Upload a material package ZIP for simulation",requestBody:{required:!0,content:{"multipart/form-data":{schema:{type:"object",properties:{file:{type:"string",format:"binary"}}}}}},responses:{"200":{description:"Parsed material package with schema config.",content:{"application/json":{schema:{type:"object",additionalProperties:!0}}}}}}}},components:{securitySchemes:{localSession:{type:"apiKey",in:"header",name:"X-Seal-Home-Session",description:`Reserved header. The local adapter does not currently authenticate requests: it acts with +`),console.log(FS0());return}if(z==="paths"||z==="dirs"||z==="directories"){let I=Go();f0(I.directories);return}if(z==="tenant"||z==="corp"||z==="enterprise"){let{selectCorp:I}=await Promise.resolve().then(() => (f4(),w_0)),{createSealClient:K}=await Promise.resolve().then(() => (i8(),_00)),{stringOption:G}=await Promise.resolve().then(() => (D4(),H_0)),{diagnoseTenantContract:H,formatTenantDoctorDashboard:W}=await Promise.resolve().then(() => (BS0(),AS0)),X=G(U.options.corp)??(Y&&Y!==z?Y:void 0)??(U.command[2]&&U.command[2]!==z?U.command[2]:void 0),Z=I(X),q=await K(Z),V=await H(q,Z);if(!(Z0(U.options.quiet)||Z0(U.options.silent)))console.error(W(V));f0(V);return}let Q=Go();if(!(Z0(U.options.quiet)||Z0(U.options.silent)))console.error(NS0(Q));f0(Q)}var TS0=m(()=>{DS0();Ko();D4();J4()});var ES0;var jS0=m(()=>{ES0={openapi:"3.1.0",info:{title:"seal-use Wrapped API",version:"0.10.33",description:"HTTP contract for the seal-use wrapped backend API, served by the local HTTP adapter\n(`seal-use http`, or the `seal-use service start` daemon; default http://127.0.0.1:8787).\n\nThese endpoints describe the stable wrapped API for frontend developers and agents. They are\nnot the raw downstream Seal endpoints: seal-use is responsible for enterprise selection,\nsource authentication, response compaction, and diagnostics-friendly fields.\n\nEvery operation declares `x-implementation-status`, so a caller can tell what the running\nadapter actually serves:\n\n- `implemented` — routed by `src/http/routes.ts` today. `src/http/openapi-implementation.test.ts`\n fails when an `implemented` operation has no matching route.\n- `planned` — contract-only, designed but not routed yet. Calling it returns 404.\n\nThe same capabilities are reachable through the CLI, and through the optional MCP server when\nit is enabled.\n"},servers:[{url:"http://localhost:8787",description:"Local HTTP adapter (`seal-use http`, or the `seal-use service start` daemon). Loopback-only by default."}],security:[{localSession:[]}],tags:[{name:"Corps",description:"Local enterprise configuration selection."},{name:"Source",description:"Source-derived Seal enterprise configuration."},{name:"Auth",description:"Wrapped authentication diagnostics and current identity."},{name:"Approval Runs",description:"Wrapped approval run history, summaries, document URLs, and trace bridge helpers."},{name:"Approval Knowledge",description:"Wrapped approval rules, documents, preferences, and search."},{name:"Simulation",description:"Wrapped simulation batch record access."}],paths:{"/v1/corps":{get:{tags:["Corps"],operationId:"listCorps","x-implementation-status":"implemented",summary:"List configured enterprises",responses:{"200":{description:"Configured enterprises.",content:{"application/json":{schema:{type:"array",items:{type:"object",required:["id","name","sourceType","current"],properties:{id:{type:"string"},name:{type:"string"},sourceType:{type:"string",enum:["hose","direct","seal"]},current:{type:"boolean"}}}}}}}}}},"/v1/corps/current":{get:{tags:["Corps"],operationId:"getCurrentCorp","x-implementation-status":"planned",summary:"Get current enterprise",description:"Returns the configured default enterprise in stateful mode. Stateless mode has no current enterprise and requires an explicit corpId for enterprise operations.",responses:{"200":{description:"Current enterprise.",content:{"application/json":{schema:{type:"object",required:["id","name","sourceType","current"],properties:{id:{type:"string"},name:{type:"string"},sourceType:{type:"string",enum:["hose","direct","seal"]},current:{type:"boolean"}}}}}}}}},"/v1/corps/current/switch":{post:{tags:["Corps"],operationId:"switchCurrentCorp","x-implementation-status":"planned",summary:"Switch current enterprise",requestBody:{required:!0,content:{"application/json":{schema:{type:"object",required:["corpId"],properties:{corpId:{type:"string"}}}}}},responses:{"200":{description:"Switched enterprise.",content:{"application/json":{schema:{type:"object",required:["current","id","name"],properties:{current:{type:"boolean"},id:{type:"string"},name:{type:"string"}}}}}},"404":{description:"Requested resource was not found.",content:{"application/json":{schema:{type:"object",additionalProperties:!0,required:["error"],properties:{error:{type:"string"},message:{type:"string"},details:{}}}}}}}}},"/v1/source/config":{get:{tags:["Source"],operationId:"getSourceConfig","x-implementation-status":"planned",summary:"Resolve source-derived Seal enterprise config",parameters:[{name:"corpId",in:"query",schema:{type:"string"},description:"Local enterprise config ID. Required when global selection mode is stateless; optional in stateful mode, where the configured default enterprise is used."}],responses:{"200":{description:"Redacted Seal enterprise config.",content:{"application/json":{schema:{type:"object",additionalProperties:!0,description:"Redacted Seal enterprise config resolved from the configured source."}}}},"401":{description:"Local service authentication failed or downstream Seal auth failed.",content:{"application/json":{schema:{type:"object",additionalProperties:!0,required:["error"],properties:{error:{type:"string"},message:{type:"string"},details:{}}}}}}}}},"/v1/auth/diagnose":{get:{tags:["Auth"],operationId:"diagnoseAuth","x-implementation-status":"planned",summary:"Diagnose wrapped source-to-Seal authentication",parameters:[{name:"corpId",in:"query",schema:{type:"string"},description:"Local enterprise config ID. Required when global selection mode is stateless; optional in stateful mode, where the configured default enterprise is used."}],responses:{"200":{description:"Authentication stage diagnosis.",content:{"application/json":{schema:{type:"object",required:["stages"],properties:{stages:{type:"array",items:{$ref:"#/components/schemas/AuthStage"}}}}}}}}}},"/v1/whoami":{get:{tags:["Auth"],operationId:"whoami","x-implementation-status":"implemented",summary:"Get current wrapped Seal identity",parameters:[{name:"corpId",in:"query",schema:{type:"string"},description:"Local enterprise config ID. Required when global selection mode is stateless; optional in stateful mode, where the configured default enterprise is used."}],responses:{"200":{description:"Current Seal user and tenant.",content:{"application/json":{schema:{type:"object",required:["user","tenant"],properties:{user:{$ref:"#/components/schemas/SealUser"},tenant:{$ref:"#/components/schemas/SealTenant"}}}}}},"401":{description:"Local service authentication failed or downstream Seal auth failed.",content:{"application/json":{schema:{type:"object",additionalProperties:!0,required:["error"],properties:{error:{type:"string"},message:{type:"string"},details:{}}}}}}}}},"/v1/session":{get:{tags:["Auth"],operationId:"getSession","x-implementation-status":"implemented",summary:"Get current wrapped Seal session metadata",parameters:[{name:"corpId",in:"query",schema:{type:"string"},description:"Local enterprise config ID. Required when global selection mode is stateless; optional in stateful mode, where the configured default enterprise is used."}],responses:{"200":{description:"Current session metadata.",content:{"application/json":{schema:{type:"object",additionalProperties:!0,required:["user","session"],properties:{user:{$ref:"#/components/schemas/SealUser"},session:{type:"object",additionalProperties:!0}}}}}},"401":{description:"Local service authentication failed or downstream Seal auth failed.",content:{"application/json":{schema:{type:"object",additionalProperties:!0,required:["error"],properties:{error:{type:"string"},message:{type:"string"},details:{}}}}}}}}},"/v1/approval/context":{get:{tags:["Approval Knowledge"],operationId:"getApprovalContext","x-implementation-status":"planned",summary:"Get rules, documents, and style preferences together",parameters:[{name:"corpId",in:"query",schema:{type:"string"},description:"Local enterprise config ID. Required when global selection mode is stateless; optional in stateful mode, where the configured default enterprise is used."},{name:"documentLimit",in:"query",schema:{type:"integer",minimum:1}},{name:"latestRuleVersion",in:"query",schema:{type:"boolean"}},{name:"ruleVersionNumber",in:"query",schema:{type:"integer"}}],responses:{"200":{description:"Approval context.",content:{"application/json":{schema:{type:"object",required:["rules","documents","stylePreferences"],properties:{rules:{},documents:{},stylePreferences:{}}}}}}}}},"/v1/approval/search":{post:{tags:["Approval Knowledge"],operationId:"searchApprovalKnowledge","x-implementation-status":"planned",summary:"Search approval rules, documents, and preferences",requestBody:{required:!0,content:{"application/json":{schema:{type:"object",required:["keywords"],properties:{keywords:{type:"array",minItems:1,items:{type:"string"}},matchMode:{type:"string",enum:["any","all"]},areas:{type:"array",items:{type:"string",enum:["rules","documents","preferences"]}},maxResults:{type:"integer"}}}}}},responses:{"200":{description:"Search results with line context.",content:{"application/json":{schema:{type:"object",additionalProperties:!0}}}}}}},"/v1/approval/rules":{get:{tags:["Approval Knowledge"],operationId:"listApprovalRules","x-implementation-status":"implemented",summary:"List current draft approval rules",responses:{"200":{description:"Draft rules.",content:{"application/json":{schema:{type:"object",required:["rules"],properties:{rules:{type:"array",items:{$ref:"#/components/schemas/ApprovalRule"}},hasPendingDeletes:{type:"boolean"}}}}}}}},post:{tags:["Approval Knowledge"],operationId:"createApprovalRule","x-implementation-status":"planned",summary:"Create draft approval rule",requestBody:{required:!0,content:{"application/json":{schema:{type:"object",required:["description","scope","strictness"],properties:{description:{type:"string"},scope:{type:"string"},strictness:{type:"string",enum:["MUST_FOLLOW","SHOULD_FOLLOW","SUGGESTION"]}}}}}},responses:{"200":{description:"Created rule.",content:{"application/json":{schema:{type:"object",additionalProperties:!0,required:["id","description","scope","strictness"],properties:{id:{type:"string"},description:{type:"string"},scope:{type:"string"},strictness:{type:"string",enum:["MUST_FOLLOW","SHOULD_FOLLOW","SUGGESTION"]},status:{type:"string"}}}}}}}}},"/v1/approval/rules/{ruleId}":{parameters:[{name:"ruleId",in:"path",required:!0,schema:{type:"string"},description:"Approval rule ID."}],patch:{tags:["Approval Knowledge"],operationId:"updateApprovalRule","x-implementation-status":"planned",summary:"Update draft approval rule",requestBody:{required:!0,content:{"application/json":{schema:{type:"object",additionalProperties:!1,properties:{description:{type:"string"},scope:{type:"string"},strictness:{type:"string",enum:["MUST_FOLLOW","SHOULD_FOLLOW","SUGGESTION"]}}}}}},responses:{"200":{description:"Updated rule.",content:{"application/json":{schema:{type:"object",additionalProperties:!0,required:["id","description","scope","strictness"],properties:{id:{type:"string"},description:{type:"string"},scope:{type:"string"},strictness:{type:"string",enum:["MUST_FOLLOW","SHOULD_FOLLOW","SUGGESTION"]},status:{type:"string"}}}}}}}},delete:{tags:["Approval Knowledge"],operationId:"deleteApprovalRule","x-implementation-status":"planned",summary:"Delete draft approval rule",responses:{"200":{description:"Deleted."}}}},"/v1/approval/rule-versions":{get:{tags:["Approval Knowledge"],operationId:"listApprovalRuleVersions","x-implementation-status":"planned",summary:"List published approval rule versions",responses:{"200":{description:"Published rule versions.",content:{"application/json":{schema:{type:"array",items:{type:"object",additionalProperties:!0,required:["id","versionNumber","versionName","rules"],properties:{id:{type:"string"},versionNumber:{type:"integer"},versionName:{type:"string"},publishedByName:{type:"string"},rules:{type:"array",items:{type:"object",additionalProperties:!0}}}}}}}}}}},"/v1/approval/rule-versions/{versionId}":{parameters:[{name:"versionId",in:"path",required:!0,schema:{type:"string"},description:"Published rule version ID."}],get:{tags:["Approval Knowledge"],operationId:"getApprovalRuleVersion","x-implementation-status":"planned",summary:"Get published approval rule version",responses:{"200":{description:"Rule version.",content:{"application/json":{schema:{type:"object",additionalProperties:!0,required:["id","versionNumber","versionName","rules"],properties:{id:{type:"string"},versionNumber:{type:"integer"},versionName:{type:"string"},publishedByName:{type:"string"},rules:{type:"array",items:{type:"object",additionalProperties:!0}}}}}}}}}},"/v1/approval/rules/by-version":{get:{tags:["Approval Knowledge"],operationId:"getApprovalRuleByVersion","x-implementation-status":"planned",summary:"Get one wrapped rule from a published version",parameters:[{name:"corpId",in:"query",schema:{type:"string"},description:"Local enterprise config ID. Required when global selection mode is stateless; optional in stateful mode, where the configured default enterprise is used."},{name:"versionNumber",in:"query",schema:{type:"integer"}},{name:"versionId",in:"query",schema:{type:"string"}},{name:"latest",in:"query",schema:{type:"boolean"}},{name:"code",in:"query",schema:{type:"string"},description:"Display rule code such as '#0038'."},{name:"runtimeId",in:"query",schema:{type:"string"},description:"Runtime rule ID such as rule-205."},{name:"recordId",in:"query",schema:{type:"string"},description:"Infer versionNumber from an approval run."}],responses:{"200":{description:"One rule from a published version.",content:{"application/json":{schema:{type:"object",additionalProperties:!0}}}}}}},"/v1/approval/rule-versions/publish":{post:{tags:["Approval Knowledge"],operationId:"publishApprovalRuleVersion","x-implementation-status":"planned",summary:"Publish current draft rules",requestBody:{required:!0,content:{"application/json":{schema:{type:"object",required:["versionName"],properties:{versionName:{type:"string"}}}}}},responses:{"200":{description:"Published version.",content:{"application/json":{schema:{type:"object",additionalProperties:!0}}}}}}},"/v1/approval/documents":{get:{tags:["Approval Knowledge"],operationId:"listApprovalDocuments","x-implementation-status":"planned",summary:"List approval knowledge documents",parameters:[{name:"offset",in:"query",schema:{type:"integer",minimum:0,default:0},description:"Zero-based pagination offset."},{name:"limit",in:"query",schema:{type:"integer",minimum:1,default:20}},{name:"scenario",in:"query",schema:{type:"array",items:{type:"string"}},style:"form",explode:!0}],responses:{"200":{description:"Documents.",content:{"application/json":{schema:{type:"object",required:["articles"],properties:{articles:{type:"array",items:{$ref:"#/components/schemas/ApprovalDocument"}},total:{type:"integer"}}}}}}}},post:{tags:["Approval Knowledge"],operationId:"createApprovalDocument","x-implementation-status":"planned",summary:"Create approval knowledge document",requestBody:{required:!0,content:{"application/json":{schema:{type:"object",required:["title","purpose","content"],properties:{title:{type:"string"},purpose:{type:"string"},content:{type:"string"},contentType:{type:"string"},status:{type:"string"},scenarios:{type:"array",items:{type:"string"}},tags:{type:"array",items:{type:"string"}}}}}}},responses:{"200":{description:"Created document.",content:{"application/json":{schema:{type:"object",additionalProperties:!0,required:["id","title","content"],properties:{id:{type:"string"},title:{type:"string"},purpose:{type:"string"},content:{type:"string",description:"Usually Markdown."},contentType:{type:"string"},status:{type:"string"},enabled:{type:"boolean"},scenarios:{type:"array",items:{type:"string"}},tags:{type:"array",items:{type:"string"}}}}}}}}}},"/v1/approval/documents/{documentId}":{parameters:[{name:"documentId",in:"path",required:!0,schema:{type:"string"},description:"Approval knowledge document ID."}],get:{tags:["Approval Knowledge"],operationId:"getApprovalDocument","x-implementation-status":"planned",summary:"Get approval knowledge document",responses:{"200":{description:"Document.",content:{"application/json":{schema:{type:"object",additionalProperties:!0,required:["id","title","content"],properties:{id:{type:"string"},title:{type:"string"},purpose:{type:"string"},content:{type:"string",description:"Usually Markdown."},contentType:{type:"string"},status:{type:"string"},enabled:{type:"boolean"},scenarios:{type:"array",items:{type:"string"}},tags:{type:"array",items:{type:"string"}}}}}}}}},patch:{tags:["Approval Knowledge"],operationId:"updateApprovalDocument","x-implementation-status":"planned",summary:"Update approval knowledge document",requestBody:{required:!0,content:{"application/json":{schema:{type:"object",additionalProperties:!1,properties:{title:{type:"string"},purpose:{type:"string"},content:{type:"string"},contentType:{type:"string"},status:{type:"string"},enabled:{type:"boolean"},scenarios:{type:"array",items:{type:"string"}},tags:{type:"array",items:{type:"string"}}}}}}},responses:{"200":{description:"Updated document.",content:{"application/json":{schema:{type:"object",additionalProperties:!0,required:["id","title","content"],properties:{id:{type:"string"},title:{type:"string"},purpose:{type:"string"},content:{type:"string",description:"Usually Markdown."},contentType:{type:"string"},status:{type:"string"},enabled:{type:"boolean"},scenarios:{type:"array",items:{type:"string"}},tags:{type:"array",items:{type:"string"}}}}}}}}},delete:{tags:["Approval Knowledge"],operationId:"deleteApprovalDocument","x-implementation-status":"planned",summary:"Delete approval knowledge document",responses:{"200":{description:"Deleted document confirmation."}}}},"/v1/approval/style-preferences":{get:{tags:["Approval Knowledge"],operationId:"getApprovalStylePreferences","x-implementation-status":"planned",summary:"Get approval style preferences",responses:{"200":{description:"Style preferences.",content:{"application/json":{schema:{type:"object",additionalProperties:!0,properties:{tone:{type:"string"},language:{type:"string"},detailLevel:{type:"string"},outputFormat:{type:"string"},examples:{type:"array",items:{type:"string"}},prohibitedPhrases:{type:"array",items:{type:"string"}},customInstructions:{type:"string"}}}}}}}},patch:{tags:["Approval Knowledge"],operationId:"updateApprovalStylePreferences","x-implementation-status":"planned",summary:"Update approval style preferences",requestBody:{required:!0,content:{"application/json":{schema:{type:"object",additionalProperties:!0,properties:{tone:{type:"string"},language:{type:"string"},detailLevel:{type:"string"},outputFormat:{type:"string"},examples:{type:"array",items:{type:"string"}},prohibitedPhrases:{type:"array",items:{type:"string"}},customInstructions:{type:"string"}}}}}},responses:{"200":{description:"Updated style preferences.",content:{"application/json":{schema:{type:"object",additionalProperties:!0,properties:{tone:{type:"string"},language:{type:"string"},detailLevel:{type:"string"},outputFormat:{type:"string"},examples:{type:"array",items:{type:"string"}},prohibitedPhrases:{type:"array",items:{type:"string"}},customInstructions:{type:"string"}}}}}}}}},"/v1/preferences":{get:{tags:["Approval Knowledge"],operationId:"getPreferences","x-implementation-status":"implemented",summary:"Get current decision, thinking-depth and rule-version preferences",parameters:[{name:"corpId",in:"query",schema:{type:"string"},description:"Local enterprise config ID. Required when global selection mode is stateless; optional in stateful mode, where the configured default enterprise is used."}],responses:{"200":{description:"Decision preferences, thinking depth preference and the bound rule set version.",content:{"application/json":{schema:{type:"object",additionalProperties:!0,properties:{tone:{type:"string"},language:{type:"string"},detailLevel:{type:"string"},outputFormat:{type:"string"},examples:{type:"array",items:{type:"string"}},prohibitedPhrases:{type:"array",items:{type:"string"}},customInstructions:{type:"string"}}}}}}}}},"/v1/preferences/decision":{post:{tags:["Approval Knowledge"],operationId:"updatePreferenceDecision","x-implementation-status":"implemented",summary:"Update decision preferences (takes effect immediately for the running approval agent)",parameters:[{name:"corpId",in:"query",schema:{type:"string"},description:"Local enterprise config ID. Required when global selection mode is stateless; optional in stateful mode, where the configured default enterprise is used."}],requestBody:{required:!0,content:{"application/json":{schema:{type:"object",properties:{explicitApprove:{type:"string"},explicitReject:{type:"string"},exemptApprove:{type:"string"},review:{type:"string"},dryRun:{type:"boolean",description:"Return the before/after diff without writing."}}}}}},responses:{"200":{description:"Updated preferences, or the previewed diff when dryRun is set.",content:{"application/json":{schema:{type:"object",additionalProperties:!0,properties:{tone:{type:"string"},language:{type:"string"},detailLevel:{type:"string"},outputFormat:{type:"string"},examples:{type:"array",items:{type:"string"}},prohibitedPhrases:{type:"array",items:{type:"string"}},customInstructions:{type:"string"}}}}}}}}},"/v1/approval-runs":{get:{tags:["Approval Runs"],operationId:"searchApprovalRuns","x-implementation-status":"implemented",summary:"Search wrapped approval run history",parameters:[{name:"corpId",in:"query",schema:{type:"string"},description:"Local enterprise config ID. Required when global selection mode is stateless; optional in stateful mode, where the configured default enterprise is used."},{name:"offset",in:"query",schema:{type:"integer",minimum:0,default:0},description:"Zero-based pagination offset."},{name:"limit",in:"query",schema:{type:"integer",minimum:1,maximum:100,default:50},description:"Maximum number of records to return."},{name:"startDate",in:"query",schema:{type:"string"},description:"Creation-time lower bound in milliseconds."},{name:"endDate",in:"query",schema:{type:"string"},description:"Creation-time upper bound in milliseconds."},{name:"status",in:"query",schema:{type:"string"}},{name:"taskMode",in:"query",schema:{type:"string"}},{name:"manualApprovalStatus",in:"query",schema:{oneOf:[{type:"string"},{type:"array",items:{type:"string"}}]}},{name:"sourceDocumentSN",in:"query",schema:{type:"string"},description:"Hose/易快报单号 or other external source document number."},{name:"sourceDocumentId",in:"query",schema:{type:"string"}},{name:"humanResult",in:"query",schema:{type:"string"},description:"Local human result contains filter, such as 驳回 or 通过."},{name:"query",in:"query",schema:{type:"string"},description:"Search across record ID, source document fields, document ID, and trace fields."},{name:"includeBridge",in:"query",schema:{type:"boolean",default:!1},description:"Include full Langfuse bridge rows."}],responses:{"200":{description:"Compact wrapped approval run list.",content:{"application/json":{schema:{type:"object",additionalProperties:!0,required:["records"],properties:{records:{type:"array",items:{$ref:"#/components/schemas/ApprovalRun"}},total:{type:"integer"},bridge:{type:"array",items:{type:"object",additionalProperties:!0}}}}}}}}}},"/v1/approval-runs/summary":{get:{tags:["Approval Runs"],operationId:"summarizeApprovalRuns","x-implementation-status":"implemented",summary:"Summarize approval runs by local date",parameters:[{name:"corpId",in:"query",schema:{type:"string"},description:"Local enterprise config ID. Required when global selection mode is stateless; optional in stateful mode, where the configured default enterprise is used."},{name:"date",in:"query",schema:{type:"string",format:"date"}},{name:"timezone",in:"query",schema:{type:"string",default:"Asia/Shanghai"}},{name:"limit",in:"query",schema:{type:"integer",minimum:1,maximum:100,default:50},description:"Maximum number of records to return."},{name:"query",in:"query",schema:{type:"string"}},{name:"humanResult",in:"query",schema:{type:"string"}}],responses:{"200":{description:"Date summary with counts and compact records.",content:{"application/json":{schema:{type:"object",additionalProperties:!0,properties:{date:{type:"string"},timezone:{type:"string"},matched:{type:"integer"},statusCounts:{type:"object",additionalProperties:{type:"integer"}},taskModeCounts:{type:"object",additionalProperties:{type:"integer"}}}}}}}}}},"/v1/approval-runs/stats":{get:{tags:["Approval Runs"],operationId:"statApprovalRuns","x-implementation-status":"implemented",summary:"Aggregate approval run counts by status and source system",parameters:[{name:"corpId",in:"query",schema:{type:"string"},description:"Local enterprise config ID. Required when global selection mode is stateless; optional in stateful mode, where the configured default enterprise is used."},{name:"since",in:"query",schema:{type:"string"},description:"Time window such as 3months, 7days or 24hours."},{name:"dedupeBy",in:"query",schema:{type:"string",enum:["sourceDocumentSN","sourceDocumentId","id"],default:"sourceDocumentSN"},description:"Field used to count distinct business documents."},{name:"status",in:"query",schema:{type:"string"}},{name:"sourceSystem",in:"query",schema:{type:"string"}},{name:"taskMode",in:"query",schema:{type:"string"}}],responses:{"200":{description:"Counts grouped by status and source system, plus the deduplicated total.",content:{"application/json":{schema:{type:"object"}}}}}}},"/v1/approval-runs/pick":{get:{tags:["Approval Runs"],operationId:"pickApprovalRuns","x-implementation-status":"implemented",summary:"Pick likely approval runs by document number or trace key",parameters:[{name:"corpId",in:"query",schema:{type:"string"},description:"Local enterprise config ID. Required when global selection mode is stateless; optional in stateful mode, where the configured default enterprise is used."},{name:"query",in:"query",schema:{type:"string"}},{name:"sn",in:"query",schema:{type:"string"},description:"Source document number for direct lookup."},{name:"batch",in:"query",schema:{type:"string"},description:"Optional simulation batch ID."},{name:"latest",in:"query",schema:{type:"boolean"}},{name:"fields",in:"query",schema:{type:"string"},description:"Comma-separated response fields."},{name:"limit",in:"query",schema:{type:"integer",default:20}},{name:"maxScan",in:"query",schema:{type:"integer",default:1000}}],responses:{"200":{description:"Picked records and suggested next actions.",content:{"application/json":{schema:{type:"object",additionalProperties:!0}}}}}}},"/v1/approval-runs/bridge":{get:{tags:["Approval Runs"],operationId:"getApprovalRunLangfuseBridge","x-implementation-status":"planned",summary:"Resolve approval runs to Langfuse trace or session hints",parameters:[{name:"corpId",in:"query",schema:{type:"string"},description:"Local enterprise config ID. Required when global selection mode is stateless; optional in stateful mode, where the configured default enterprise is used."},{name:"recordId",in:"query",schema:{type:"string"}},{name:"sourceDocumentSN",in:"query",schema:{type:"string"}},{name:"sourceDocumentId",in:"query",schema:{type:"string"}},{name:"simulationBatchId",in:"query",schema:{type:"string"}}],responses:{"200":{description:"Trace/session bridge hints.",content:{"application/json":{schema:{type:"object",additionalProperties:!0,properties:{count:{type:"integer"},records:{type:"array",items:{$ref:"#/components/schemas/ApprovalRun"}},bridge:{type:"array",items:{type:"object",additionalProperties:!0}}}}}}}}}},"/v1/approval-runs/url":{get:{tags:["Approval Runs"],operationId:"getApprovalRunUrl","x-implementation-status":"implemented",summary:"Get Seal AI result URL and optional source document URL",parameters:[{name:"corpId",in:"query",schema:{type:"string"},description:"Local enterprise config ID. Required when global selection mode is stateless; optional in stateful mode, where the configured default enterprise is used."},{name:"recordId",in:"query",schema:{type:"string"}},{name:"sourceDocumentSN",in:"query",schema:{type:"string"}},{name:"sourceDocumentId",in:"query",schema:{type:"string"}}],responses:{"200":{description:"Seal AI result URL and source document URL.",content:{"application/json":{schema:{type:"object",additionalProperties:!0,properties:{url:{type:"string"},sealResultUrl:{type:"string"},ssoUrl:{type:"string"},documentUrl:{type:"string"},hoseDocumentUrl:{type:"string"},recordId:{type:"string"},sourceDocumentSN:{type:"string"}}}}}}}}},"/v1/approval-runs/{recordId}":{parameters:[{name:"recordId",in:"path",required:!0,schema:{type:"string"},description:"seal-use approval run record ID."}],get:{tags:["Approval Runs"],operationId:"getApprovalRun","x-implementation-status":"implemented",summary:"Get wrapped approval run detail",parameters:[{name:"summary",in:"query",schema:{type:"boolean"}},{name:"fields",in:"query",schema:{type:"string"},description:"Comma-separated field paths such as metadata,document.fields,result.summary."}],responses:{"200":{description:"Approval run detail plus stable aliases and human result.",content:{"application/json":{schema:{type:"object",additionalProperties:!0}}}}}}},"/v1/approval-runs/{recordId}/cited-rules":{parameters:[{name:"recordId",in:"path",required:!0,schema:{type:"string"},description:"seal-use approval run record ID."}],get:{tags:["Approval Runs"],operationId:"getApprovalRunCitedRules","x-implementation-status":"implemented",summary:"Extract rules cited or matched by the AI result",responses:{"200":{description:"Cited rule summaries.",content:{"application/json":{schema:{type:"object",additionalProperties:!0}}}}}}},"/v1/approval-runs/{recordId}/document-summary":{parameters:[{name:"recordId",in:"path",required:!0,schema:{type:"string"},description:"seal-use approval run record ID."}],get:{tags:["Approval Runs"],operationId:"getApprovalRunDocumentSummary","x-implementation-status":"implemented",summary:"Get key document fields and compact AI/manual result",responses:{"200":{description:"Document summary.",content:{"application/json":{schema:{type:"object",additionalProperties:!0}}}}}}},"/v1/approval-runs/{recordId}/attachments":{parameters:[{name:"recordId",in:"path",required:!0,schema:{type:"string"},description:"seal-use approval run record ID."}],get:{tags:["Approval Runs"],operationId:"getApprovalRunAttachments","x-implementation-status":"implemented",summary:"List compact attachment metadata",parameters:[{name:"summary",in:"query",schema:{type:"boolean"}}],responses:{"200":{description:"Attachment metadata.",content:{"application/json":{schema:{type:"object",additionalProperties:!0}}}}}}},"/v1/approval-runs/{recordId}/result":{parameters:[{name:"recordId",in:"path",required:!0,schema:{type:"string"},description:"seal-use approval run record ID."}],get:{tags:["Approval Runs"],operationId:"getApprovalRunResult","x-implementation-status":"implemented",summary:"Get AI result, optionally as a compact summary",parameters:[{name:"summary",in:"query",schema:{type:"boolean"}}],responses:{"200":{description:"AI result or summary.",content:{"application/json":{schema:{type:"object",additionalProperties:!0}}}}}}},"/v1/simulation/create-batch":{post:{tags:["Simulation"],operationId:"createSimulationBatch","x-implementation-status":"implemented",summary:"Create a simulation batch",requestBody:{required:!0,content:{"application/json":{schema:{type:"object",additionalProperties:!0}}}},responses:{"200":{description:"Created batch id.",content:{"application/json":{schema:{type:"object",additionalProperties:!0}}}}}}},"/v1/simulation/create-material-pack-batch":{post:{tags:["Simulation"],operationId:"createMaterialPackBatch","x-implementation-status":"planned",summary:"Create a material pack simulation batch",requestBody:{required:!0,content:{"application/json":{schema:{type:"object",additionalProperties:!0}}}},responses:{"200":{description:"Created batch id.",content:{"application/json":{schema:{type:"object",additionalProperties:!0}}}}}}},"/v1/simulation/batches":{get:{tags:["Simulation"],operationId:"listSimulationBatches","x-implementation-status":"implemented",summary:"List simulation batches",parameters:[{name:"limit",in:"query",schema:{type:"integer"},description:"Max batches to return."}],responses:{"200":{description:"Simulation batches.",content:{"application/json":{schema:{type:"array",items:{type:"object",additionalProperties:!0}}}}}}}},"/v1/simulation/batch/{batchId}":{parameters:[{name:"batchId",in:"path",required:!0,schema:{type:"string"},description:"Simulation batch ID."}],get:{tags:["Simulation"],operationId:"getSimulationBatch","x-implementation-status":"implemented",summary:"Get a simulation batch detail including echoed create params",responses:{"200":{description:"Simulation batch detail.",content:{"application/json":{schema:{type:"object",additionalProperties:!0}}}}}}},"/v1/simulation/batches/{batchId}/records":{parameters:[{name:"batchId",in:"path",required:!0,schema:{type:"string"},description:"Simulation batch ID."}],get:{tags:["Simulation"],operationId:"getSimulationBatchRecords","x-implementation-status":"planned",summary:"Get wrapped simulation batch records",parameters:[{name:"query",in:"query",schema:{type:"string"},description:"Optional local contains filter for record/document/trace identifiers."}],responses:{"200":{description:"Compact simulation records and bridge hints.",content:{"application/json":{schema:{type:"object",additionalProperties:!0}}}}}}},"/v1/simulation/templates":{get:{tags:["Simulation"],operationId:"listSimulationTemplates","x-implementation-status":"planned",summary:"List simulation test templates",responses:{"200":{description:"Simulation templates.",content:{"application/json":{schema:{type:"array",items:{type:"object",additionalProperties:!0}}}}}}}},"/v1/simulation/integration-status":{get:{tags:["Simulation"],operationId:"getSimulationIntegrationStatus","x-implementation-status":"planned",summary:"Get available source integration status for simulation",responses:{"200":{description:"Integration status.",content:{"application/json":{schema:{type:"object",additionalProperties:!0}}}}}}},"/v1/simulation/hosecloud-integrations":{get:{tags:["Simulation"],operationId:"listSimulationHosecloudIntegrations","x-implementation-status":"planned",summary:"List hosecloud source integrations available for simulation",responses:{"200":{description:"Hosecloud integrations.",content:{"application/json":{schema:{type:"array",items:{type:"object",additionalProperties:!0}}}}}}}},"/v1/material-packages/upload":{post:{tags:["Simulation"],operationId:"uploadMaterialPackage","x-implementation-status":"planned",summary:"Upload a material package ZIP for simulation",requestBody:{required:!0,content:{"multipart/form-data":{schema:{type:"object",properties:{file:{type:"string",format:"binary"}}}}}},responses:{"200":{description:"Parsed material package with schema config.",content:{"application/json":{schema:{type:"object",additionalProperties:!0}}}}}}}},components:{securitySchemes:{localSession:{type:"apiKey",in:"header",name:"X-Seal-Home-Session",description:`Reserved header. The local adapter does not currently authenticate requests: it acts with the credentials already stored on this machine for the selected enterprise. Keep it bound to loopback (\`--host 127.0.0.1\`) and do not expose the port to a network or an origin you do not control. diff --git a/dist/openapi.json b/dist/openapi.json index 37f061a..b0ea8e5 100644 --- a/dist/openapi.json +++ b/dist/openapi.json @@ -2,7 +2,7 @@ "openapi": "3.1.0", "info": { "title": "seal-use Wrapped API", - "version": "0.10.32", + "version": "0.10.33", "description": "HTTP contract for the seal-use wrapped backend API, served by the local HTTP adapter\n(`seal-use http`, or the `seal-use service start` daemon; default http://127.0.0.1:8787).\n\nThese endpoints describe the stable wrapped API for frontend developers and agents. They are\nnot the raw downstream Seal endpoints: seal-use is responsible for enterprise selection,\nsource authentication, response compaction, and diagnostics-friendly fields.\n\nEvery operation declares `x-implementation-status`, so a caller can tell what the running\nadapter actually serves:\n\n- `implemented` — routed by `src/http/routes.ts` today. `src/http/openapi-implementation.test.ts`\n fails when an `implemented` operation has no matching route.\n- `planned` — contract-only, designed but not routed yet. Calling it returns 404.\n\nThe same capabilities are reachable through the CLI, and through the optional MCP server when\nit is enabled.\n" }, "servers": [ diff --git a/openapi/openapi.yaml b/openapi/openapi.yaml index 6d580de..204f263 100644 --- a/openapi/openapi.yaml +++ b/openapi/openapi.yaml @@ -1,7 +1,7 @@ openapi: 3.1.0 info: title: seal-use Wrapped API - version: 0.10.32 + version: 0.10.33 description: | HTTP contract for the seal-use wrapped backend API, served by the local HTTP adapter (`seal-use http`, or the `seal-use service start` daemon; default http://127.0.0.1:8787). diff --git a/package.json b/package.json index 6f89bb6..899475d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "seal-use", - "version": "0.10.32", + "version": "0.10.33", "private": true, "description": "Seal tenant operations toolkit: approval-run diagnosis, rule remediation, Hose/合思 auth, plus a CLI and an optional MCP server.", "license": "MIT", diff --git a/skills/seal-use/SKILL.md b/skills/seal-use/SKILL.md index 103b128..52d097e 100644 --- a/skills/seal-use/SKILL.md +++ b/skills/seal-use/SKILL.md @@ -1,12 +1,12 @@ --- name: seal-use -description: "v0.10.32: Use for Seal Use first-time enterprise onboarding, Hose/合思 or Seal-native authentication, assistance links and browser cURL intake, plus tenant approval operations, diagnosis, simulation, rules, users, configuration, and search." +description: "v0.10.33: Use for Seal Use first-time enterprise onboarding, Hose/合思 or Seal-native authentication, assistance links and browser cURL intake, plus tenant approval operations, diagnosis, simulation, rules, users, configuration, and search." metadata: - version: 0.10.32 - short-description: Seal tenant and Hose approval automation (v0.10.32) + version: 0.10.33 + short-description: Seal tenant and Hose approval automation (v0.10.33) --- -# Seal Use (v0.10.32) +# Seal Use (v0.10.33) > CLI 是主执行通道,MCP 默认关闭(插件配置可选开启)。机器通道 (`stdout`) 必须输出纯净 JSON,诊断日志与下一步建议统一输出在 `stderr`。