From 62bfa7c56a2acdc292cd57f60b88956cb360032b Mon Sep 17 00:00:00 2001 From: yunyingk Date: Tue, 22 Sep 2026 12:03:45 +0800 Subject: [PATCH] Release v0.10.37: Automated release bump --- .zcode-plugin/plugin.json | 2 +- CHANGELOG.md | 13 +++++++++++++ dist/mcp/server.js | 12 ++++++------ dist/openapi.json | 2 +- openapi/openapi.yaml | 2 +- package.json | 2 +- skills/seal-use/SKILL.md | 8 ++++---- 7 files changed, 27 insertions(+), 14 deletions(-) diff --git a/.zcode-plugin/plugin.json b/.zcode-plugin/plugin.json index 69ed379..0a2e9f3 100644 --- a/.zcode-plugin/plugin.json +++ b/.zcode-plugin/plugin.json @@ -1,6 +1,6 @@ { "name": "seal-use", - "version": "0.10.36", + "version": "0.10.37", "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 c3164cd..c75ffe2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,19 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.10.37] - 2026-09-22 + +### Added +- Merge pull request #167 from yunyingk/codex/hose-command-boundaries +- Make Hose command boundaries explicit +- Clarify Hose command names +- Clarify sync-test safety and portable skill assets +- Refine corps command hierarchy and safety docs +- Merge pull request #166 from yunyingk/feat/consume-seal-delegate-link +- Support Seal native delegate link in corps add-link and refine hose keys +- Standardize rules get command format and remove ambiguous alternatives + + ## [0.10.36] - 2026-09-21 ### Added diff --git a/dist/mcp/server.js b/dist/mcp/server.js index a24eb83..6ec86bb 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:M,parentData:D,parentDataProperty:P},j){M.if(Q._`${D} !== undefined`,()=>M.assign(Q._`${D}[${P}]`,j))}function V(M,D,P,j=I.Correct){let A=j===I.Correct?Q.operators.EQ:Q.operators.NEQ,T;switch(M){case"null":return Q._`${D} ${A} null`;case"array":T=Q._`Array.isArray(${D})`;break;case"object":T=Q._`${D} && typeof ${D} == "object" && !Array.isArray(${D})`;break;case"integer":T=C(Q._`!(${D} % 1) && !isNaN(${D})`);break;case"number":T=C();break;default:return Q._`typeof ${D} ${A} ${M}`}return j===I.Correct?T:(0,Q.not)(T);function C(b=Q.nil){return(0,Q.and)(Q._`typeof ${D} == "number"`,b,P?Q._`isFinite(${D})`:Q.nil)}}$.checkDataType=V;function F(M,D,P,j){if(M.length===1)return V(M[0],D,P,j);let A,T=(0,J.toHash)(M);if(T.array&&T.object){let C=Q._`typeof ${D} != "object"`;A=T.null?C:Q._`!${D} || ${C}`,delete T.null,delete T.array,delete T.object}else A=Q.nil;if(T.number)delete T.integer;for(let C in T)A=(0,Q.and)(A,V(C,D,P,j));return A}$.checkDataTypes=F;let w={message:({schema:M})=>`must be ${M}`,params:({schema:M,schemaValue:D})=>typeof M=="string"?Q._`{type: ${M}}`:Q._`{type: ${D}}`};function O(M){let D=N(M);(0,U.reportError)(D,w)}$.reportTypeError=O;function N(M){let{gen:D,data:P,schema:j}=M,A=(0,J.schemaRefOrVal)(M,j,"type");return{gen:D,keyword:"type",data:P,schema:j.type,schemaCode:A,schemaValue:A,parentSchema:j,params:{},it:M}}}),Ob0=C0(($)=>{Object.defineProperty($,"__esModule",{value:!0}),$.assignDefaults=void 0;let Y=F1(),z=v1();function U(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=U;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,z.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)}`)}}),J5=C0(($)=>{Object.defineProperty($,"__esModule",{value:!0}),$.validateUnion=$.validateArray=$.usePattern=$.callValidateCode=$.schemaProperties=$.allSchemaProperties=$.noPropertyInData=$.propertyInData=$.isOwnProperty=$.hasPropFunc=$.reportMissingProp=$.checkMissingProp=$.checkReportMissingProp=void 0;let Y=F1(),z=v1(),U=Q5(),Q=v1();function J(M,D){let{gen:P,data:j,it:A}=M;P.if(X(P,j,D,A.opts.ownProperties),()=>{M.setParams({missingProperty:Y._`${D}`},!0),M.error()})}$.checkReportMissingProp=J;function I({gen:M,data:D,it:{opts:P}},j,A){return(0,Y.or)(...j.map((T)=>(0,Y.and)(X(M,D,T,P.ownProperties),Y._`${A} = ${T}`)))}$.checkMissingProp=I;function K(M,D){M.setParams({missingProperty:D},!0),M.error()}$.reportMissingProp=K;function G(M){return M.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:Y._`Object.prototype.hasOwnProperty`})}$.hasPropFunc=G;function H(M,D,P){return Y._`${G(M)}.call(${D}, ${P})`}$.isOwnProperty=H;function W(M,D,P,j){let A=Y._`${D}${(0,Y.getProperty)(P)} !== undefined`;return j?Y._`${A} && ${H(M,D,P)}`:A}$.propertyInData=W;function X(M,D,P,j){let A=Y._`${D}${(0,Y.getProperty)(P)} === undefined`;return j?(0,Y.or)(A,(0,Y.not)(H(M,D,P))):A}$.noPropertyInData=X;function Z(M){return M?Object.keys(M).filter((D)=>D!=="__proto__"):[]}$.allSchemaProperties=Z;function q(M,D){return Z(D).filter((P)=>!(0,z.alwaysValidSchema)(M,D[P]))}$.schemaProperties=q;function V({schemaCode:M,data:D,it:{gen:P,topSchemaRef:j,schemaPath:A,errorPath:T},it:C},b,k,S){let i=S?Y._`${M}, ${D}, ${j}${A}`:D,n=[[U.default.instancePath,(0,Y.strConcat)(U.default.instancePath,T)],[U.default.parentData,C.parentData],[U.default.parentDataProperty,C.parentDataProperty],[U.default.rootData,U.default.rootData]];if(C.opts.dynamicRef)n.push([U.default.dynamicAnchors,U.default.dynamicAnchors]);let U0=Y._`${i}, ${P.object(...n)}`;return k!==Y.nil?Y._`${b}.call(${k}, ${U0})`:Y._`${b}(${U0})`}$.callValidateCode=V;let F=Y._`new RegExp`;function w({gen:M,it:{opts:D}},P){let j=D.unicodeRegExp?"u":"",{regExp:A}=D.code,T=A(P,j);return M.scopeValue("pattern",{key:T.toString(),ref:T,code:Y._`${A.code==="new RegExp"?F:(0,Q.useFunc)(M,A)}(${P}, ${j})`})}$.usePattern=w;function O(M){let{gen:D,data:P,keyword:j,it:A}=M,T=D.name("valid");if(A.allErrors){let b=D.let("valid",!0);return C(()=>D.assign(b,!1)),b}return D.var(T,!0),C(()=>D.break()),T;function C(b){let k=D.const("len",Y._`${P}.length`);D.forRange("i",0,k,(S)=>{M.subschema({keyword:j,dataProp:S,dataPropType:z.Type.Num},T),D.if((0,Y.not)(T),b)})}}$.validateArray=O;function N(M){let{gen:D,schema:P,keyword:j,it:A}=M;if(!Array.isArray(P))throw Error("ajv implementation error");if(P.some((b)=>(0,z.alwaysValidSchema)(A,b))&&!A.opts.unevaluated)return;let T=D.let("valid",!1),C=D.name("_valid");D.block(()=>P.forEach((b,k)=>{let S=M.subschema({keyword:j,schemaProp:k,compositeRule:!0},C);if(D.assign(T,Y._`${T} || ${C}`),!M.mergeValidEvaluated(S,C))D.if((0,Y.not)(T))})),M.result(T,()=>M.reset(),()=>M.error(!0))}$.validateUnion=N}),wb0=C0(($)=>{Object.defineProperty($,"__esModule",{value:!0}),$.validateKeywordUsage=$.validSchemaType=$.funcKeywordCode=$.macroKeywordCode=void 0;let Y=F1(),z=Q5(),U=J5(),Q=bO();function J(q,V){let{gen:F,keyword:w,schema:O,parentSchema:N,it:M}=q,D=V.macro.call(M.self,O,N,M),P=W(F,w,D);if(M.opts.validateSchema!==!1)M.self.validateSchema(D,!0);let j=F.name("valid");q.subschema({schema:D,schemaPath:Y.nil,errSchemaPath:`${M.errSchemaPath}/${w}`,topSchemaRef:P,compositeRule:!0},j),q.pass(j,()=>q.error(!0))}$.macroKeywordCode=J;function I(q,V){var F;let{gen:w,keyword:O,schema:N,parentSchema:M,$data:D,it:P}=q;H(P,V);let j=W(w,O,!D&&V.compile?V.compile.call(P.self,N,M,P):V.validate),A=w.let("valid");q.block$data(A,T),q.ok((F=V.valid)!==null&&F!==void 0?F:A);function T(){if(V.errors===!1){if(k(),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=w.let("ruleErrs",null);return w.try(()=>k(Y._`await `),(n)=>w.assign(A,!1).if(Y._`${n} instanceof ${P.ValidationError}`,()=>w.assign(i,Y._`${n}.errors`),()=>w.throw(n))),i}function b(){let i=Y._`${j}.errors`;return w.assign(i,null),k(Y.nil),i}function k(i=V.async?Y._`await `:Y.nil){let n=P.opts.passContext?z.default.this:z.default.self,U0=!(("compile"in V)&&!D||V.schema===!1);w.assign(A,Y._`${i}${(0,U.callValidateCode)(q,j,n,U0)}`,V.modifying)}function S(i){var n;w.if((0,Y.not)((n=V.valid)!==null&&n!==void 0?n:A),i)}}$.funcKeywordCode=I;function K(q){let{gen:V,data:F,it:w}=q;V.if(w.parentData,()=>V.assign(F,Y._`${w.parentData}[${w.parentDataProperty}]`))}function G(q,V){let{gen:F}=q;F.if(Y._`Array.isArray(${V})`,()=>{F.assign(z.default.vErrors,Y._`${z.default.vErrors} === null ? ${V} : ${z.default.vErrors}.concat(${V})`).assign(z.default.errors,Y._`${z.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((w)=>w==="array"?Array.isArray(q):w==="object"?q&&typeof q=="object"&&!Array.isArray(q):typeof q==w||F&&typeof q>"u")}$.validSchemaType=X;function Z({schema:q,opts:V,self:F,errSchemaPath:w},O,N){if(Array.isArray(O.keyword)?!O.keyword.includes(N):O.keyword!==N)throw Error("ajv implementation error");let M=O.dependencies;if(M===null||M===void 0?void 0:M.some((D)=>!Object.prototype.hasOwnProperty.call(q,D)))throw Error(`parent schema must have dependencies of ${N}: ${M.join(",")}`);if(O.validateSchema){if(!O.validateSchema(q[N])){let D=`keyword "${N}" value is invalid at path "${w}": `+F.errorsText(O.validateSchema.errors);if(V.validateSchema==="log")F.logger.error(D);else throw Error(D)}}}$.validateKeywordUsage=Z}),Mb0=C0(($)=>{Object.defineProperty($,"__esModule",{value:!0}),$.extendSubschemaMode=$.extendSubschemaData=$.getSubschema=void 0;let Y=F1(),z=v1();function U(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,z.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=U;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:w,opts:O}=K;V(q.let("data",Y._`${K.data}${(0,Y.getProperty)(G)}`,!0)),I.errorPath=Y.str`${F}${(0,z.getErrorPath)(G,H,O.jsPropertySyntax)}`,I.parentDataProperty=Y._`${G}`,I.dataPathArr=[...w,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}),Le=C0(($,Y)=>{Y.exports=function z(U,Q){if(U===Q)return!0;if(U&&Q&&typeof U=="object"&&typeof Q=="object"){if(U.constructor!==Q.constructor)return!1;var J,I,K;if(Array.isArray(U)){if(J=U.length,J!=Q.length)return!1;for(I=J;I--!==0;)if(!z(U[I],Q[I]))return!1;return!0}if(U.constructor===RegExp)return U.source===Q.source&&U.flags===Q.flags;if(U.valueOf!==Object.prototype.valueOf)return U.valueOf()===Q.valueOf();if(U.toString!==Object.prototype.toString)return U.toString()===Q.toString();if(K=Object.keys(U),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(!z(U[G],Q[G]))return!1}return!0}return U!==U&&Q!==Q}}),Nb0=C0(($,Y)=>{var z=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(){};U(I,G,H,J,"",J)};z.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0},z.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0},z.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0},z.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 U(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 w=G[F];if(Array.isArray(w)){if(F in z.arrayKeywords)for(var O=0;O{Object.defineProperty($,"__esModule",{value:!0}),$.getSchemaRefs=$.resolveUrl=$.normalizeId=$._getFullPath=$.getFullPath=$.inlineRef=void 0;let Y=v1(),z=Le(),U=Nb0(),Q=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function J(w,O=!0){if(typeof w=="boolean")return!0;if(O===!0)return!K(w);if(!O)return!1;return G(w)<=O}$.inlineRef=J;let I=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function K(w){for(let O in w){if(I.has(O))return!0;let N=w[O];if(Array.isArray(N)&&N.some(K))return!0;if(typeof N=="object"&&K(N))return!0}return!1}function G(w){let O=0;for(let N in w){if(N==="$ref")return 1/0;if(O++,Q.has(N))continue;if(typeof w[N]=="object")(0,Y.eachItem)(w[N],(M)=>O+=G(M));if(O===1/0)return 1/0}return O}function H(w,O="",N){if(N!==!1)O=Z(O);return W(w,w.parse(O))}$.getFullPath=H;function W(w,O){return w.serialize(O).split("#")[0]+"#"}$._getFullPath=W;let X=/#\/?$/;function Z(w){return w?w.replace(X,""):""}$.normalizeId=Z;function q(w,O,N){return N=Z(N),w.resolve(O,N)}$.resolveUrl=q;let V=/^[a-z_][-a-z0-9._]*$/i;function F(w,O){if(typeof w=="boolean")return{};let{schemaId:N,uriResolver:M}=this.opts,D=Z(w[N]||O),P={"":D},j=H(M,D,!1),A={},T=new Set;return U(w,{allKeys:!0},(k,S,i,n)=>{if(n===void 0)return;let U0=j+S,x=P[n];if(typeof k[N]=="string")x=d.call(this,k[N]);t.call(this,k.$anchor),t.call(this,k.$dynamicAnchor),P[S]=x;function d(e){let g=this.opts.uriResolver.resolve;if(e=Z(x?g(x,e):e),T.has(e))throw b(e);T.add(e);let p=this.refs[e];if(typeof p=="string")p=this.refs[p];if(typeof p=="object")C(k,p.schema,e);else if(e!==Z(U0))if(e[0]==="#")C(k,A[e],e),A[e]=k;else this.refs[e]=U0;return e}function t(e){if(typeof e=="string"){if(!V.test(e))throw Error(`invalid anchor "${e}"`);d.call(this,`#${e}`)}}}),A;function C(k,S,i){if(S!==void 0&&!z(k,S))throw b(i)}function b(k){return Error(`reference "${k}" resolves to more than one schema`)}}$.getSchemaRefs=F}),uQ=C0(($)=>{Object.defineProperty($,"__esModule",{value:!0}),$.getData=$.KeywordCxt=$.validateFunctionCode=void 0;let Y=Fb0(),z=uO(),U=Ve(),Q=uO(),J=Ob0(),I=wb0(),K=Mb0(),G=F1(),H=Q5(),W=iO(),X=v1(),Z=bO();function q(s){if(j(s)){if(T(s),P(s)){O(s);return}}V(s,()=>(0,Y.topBoolOrEmptySchema)(s))}$.validateFunctionCode=q;function V({gen:s,validateName:H0,schema:F0,schemaEnv:b0,opts:i0},n0){if(i0.code.es5)s.func(H0,G._`${H.default.data}, ${H.default.valCxt}`,b0.$async,()=>{s.code(G._`"use strict"; ${M(F0,i0)}`),w(s,i0),s.code(n0)});else s.func(H0,G._`${H.default.data}, ${F(i0)}`,b0.$async,()=>s.code(M(F0,i0)).code(n0))}function F(s){return G._`{${H.default.instancePath}="", ${H.default.parentData}, ${H.default.parentDataProperty}, ${H.default.rootData}=${H.default.data}${s.dynamicRef?G._`, ${H.default.dynamicAnchors}={}`:G.nil}}={}`}function w(s,H0){s.if(H.default.valCxt,()=>{if(s.var(H.default.instancePath,G._`${H.default.valCxt}.${H.default.instancePath}`),s.var(H.default.parentData,G._`${H.default.valCxt}.${H.default.parentData}`),s.var(H.default.parentDataProperty,G._`${H.default.valCxt}.${H.default.parentDataProperty}`),s.var(H.default.rootData,G._`${H.default.valCxt}.${H.default.rootData}`),H0.dynamicRef)s.var(H.default.dynamicAnchors,G._`${H.default.valCxt}.${H.default.dynamicAnchors}`)},()=>{if(s.var(H.default.instancePath,G._`""`),s.var(H.default.parentData,G._`undefined`),s.var(H.default.parentDataProperty,G._`undefined`),s.var(H.default.rootData,H.default.data),H0.dynamicRef)s.var(H.default.dynamicAnchors,G._`{}`)})}function O(s){let{schema:H0,opts:F0,gen:b0}=s;V(s,()=>{if(F0.$comment&&H0.$comment)n(s);if(k(s),b0.let(H.default.vErrors,null),b0.let(H.default.errors,0),F0.unevaluated)N(s);C(s),U0(s)})}function N(s){let{gen:H0,validateName:F0}=s;s.evaluated=H0.const("evaluated",G._`${F0}.evaluated`),H0.if(G._`${s.evaluated}.dynamicProps`,()=>H0.assign(G._`${s.evaluated}.props`,G._`undefined`)),H0.if(G._`${s.evaluated}.dynamicItems`,()=>H0.assign(G._`${s.evaluated}.items`,G._`undefined`))}function M(s,H0){let F0=typeof s=="object"&&s[H0.schemaId];return F0&&(H0.code.source||H0.code.process)?G._`/*# sourceURL=${F0} */`:G.nil}function D(s,H0){if(j(s)){if(T(s),P(s)){A(s,H0);return}}(0,Y.boolOrEmptySchema)(s,H0)}function P({schema:s,self:H0}){if(typeof s=="boolean")return!s;for(let F0 in s)if(H0.RULES.all[F0])return!0;return!1}function j(s){return typeof s.schema!="boolean"}function A(s,H0){let{schema:F0,gen:b0,opts:i0}=s;if(i0.$comment&&F0.$comment)n(s);S(s),i(s);let n0=b0.const("_errs",H.default.errors);C(s,n0),b0.var(H0,G._`${n0} === ${H.default.errors}`)}function T(s){(0,X.checkUnknownRules)(s),b(s)}function C(s,H0){if(s.opts.jtd)return d(s,[],!1,H0);let F0=(0,z.getSchemaTypes)(s.schema);d(s,F0,!(0,z.coerceAndCheckDataType)(s,F0),H0)}function b(s){let{schema:H0,errSchemaPath:F0,opts:b0,self:i0}=s;if(H0.$ref&&b0.ignoreKeywordsWithRef&&(0,X.schemaHasRulesButRef)(H0,i0.RULES))i0.logger.warn(`$ref: keywords ignored in schema at path "${F0}"`)}function k(s){let{schema:H0,opts:F0}=s;if(H0.default!==void 0&&F0.useDefaults&&F0.strictSchema)(0,X.checkStrictMode)(s,"default is ignored in the schema root")}function S(s){let H0=s.schema[s.opts.schemaId];if(H0)s.baseId=(0,W.resolveUrl)(s.opts.uriResolver,s.baseId,H0)}function i(s){if(s.schema.$async&&!s.schemaEnv.$async)throw Error("async schema in sync schema")}function n({gen:s,schemaEnv:H0,schema:F0,errSchemaPath:b0,opts:i0}){let n0=F0.$comment;if(i0.$comment===!0)s.code(G._`${H.default.self}.logger.log(${n0})`);else if(typeof i0.$comment=="function"){let w1=G.str`${b0}/$comment`,k1=s.scopeValue("root",{ref:H0.root});s.code(G._`${H.default.self}.opts.$comment(${n0}, ${w1}, ${k1}.schema)`)}}function U0(s){let{gen:H0,schemaEnv:F0,validateName:b0,ValidationError:i0,opts:n0}=s;if(F0.$async)H0.if(G._`${H.default.errors} === 0`,()=>H0.return(H.default.data),()=>H0.throw(G._`new ${i0}(${H.default.vErrors})`));else{if(H0.assign(G._`${b0}.errors`,H.default.vErrors),n0.unevaluated)x(s);H0.return(G._`${H.default.errors} === 0`)}}function x({gen:s,evaluated:H0,props:F0,items:b0}){if(F0 instanceof G.Name)s.assign(G._`${H0}.props`,F0);if(b0 instanceof G.Name)s.assign(G._`${H0}.items`,b0)}function d(s,H0,F0,b0){let{gen:i0,schema:n0,data:w1,allErrors:k1,opts:u1,self:b1}=s,{RULES:A0}=b1;if(n0.$ref&&(u1.ignoreKeywordsWithRef||!(0,X.schemaHasRulesButRef)(n0,A0))){i0.block(()=>_0(s,"$ref",A0.all.$ref.definition));return}if(!u1.jtd)e(s,H0);i0.block(()=>{for(let B of A0.rules)Q0(B);Q0(A0.post)});function Q0(B){if(!(0,U.shouldUseGroup)(n0,B))return;if(B.type){if(i0.if((0,Q.checkDataType)(B.type,w1,u1.strictNumbers)),t(s,B),H0.length===1&&H0[0]===B.type&&F0)i0.else(),(0,Q.reportTypeError)(s);i0.endIf()}else t(s,B);if(!k1)i0.if(G._`${H.default.errors} === ${b0||0}`)}}function t(s,H0){let{gen:F0,schema:b0,opts:{useDefaults:i0}}=s;if(i0)(0,J.assignDefaults)(s,H0.type);F0.block(()=>{for(let n0 of H0.rules)if((0,U.shouldUseRule)(b0,n0))_0(s,n0.keyword,n0.definition,H0.type)})}function e(s,H0){if(s.schemaEnv.meta||!s.opts.strictTypes)return;if(g(s,H0),!s.opts.allowUnionTypes)p(s,H0);Y0(s,s.dataTypes)}function g(s,H0){if(!H0.length)return;if(!s.dataTypes.length){s.dataTypes=H0;return}H0.forEach((F0)=>{if(!r(s.dataTypes,F0))N0(s,`type "${F0}" not allowed by context "${s.dataTypes.join(",")}"`)}),$0(s,H0)}function p(s,H0){if(H0.length>1&&!(H0.length===2&&H0.includes("null")))N0(s,"use allowUnionTypes to allow union type keyword")}function Y0(s,H0){let F0=s.self.RULES.all;for(let b0 in F0){let i0=F0[b0];if(typeof i0=="object"&&(0,U.shouldUseRule)(s.schema,i0)){let{type:n0}=i0.definition;if(n0.length&&!n0.some((w1)=>y(H0,w1)))N0(s,`missing type "${n0.join(",")}" for keyword "${b0}"`)}}}function y(s,H0){return s.includes(H0)||H0==="number"&&s.includes("integer")}function r(s,H0){return s.includes(H0)||H0==="integer"&&s.includes("number")}function $0(s,H0){let F0=[];for(let b0 of s.dataTypes)if(r(H0,b0))F0.push(b0);else if(H0.includes("integer")&&b0==="number")F0.push("integer");s.dataTypes=F0}function N0(s,H0){let F0=s.schemaEnv.baseId+s.errSchemaPath;H0+=` at "${F0}" (strictTypes)`,(0,X.checkStrictMode)(s,H0,s.opts.strictTypes)}var T0=class{constructor(s,H0,F0){if((0,I.validateKeywordUsage)(s,H0,F0),this.gen=s.gen,this.allErrors=s.allErrors,this.keyword=F0,this.data=s.data,this.schema=s.schema[F0],this.$data=H0.$data&&s.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,X.schemaRefOrVal)(s,this.schema,F0,this.$data),this.schemaType=H0.schemaType,this.parentSchema=s.schema,this.params={},this.it=s,this.def=H0,this.$data)this.schemaCode=s.gen.const("vSchema",e0(this.$data,s));else if(this.schemaCode=this.schemaValue,!(0,I.validSchemaType)(this.schema,H0.schemaType,H0.allowUndefined))throw Error(`${F0} value must be ${JSON.stringify(H0.schemaType)}`);if("code"in H0?H0.trackErrors:H0.errors!==!1)this.errsCount=s.gen.const("_errs",H.default.errors)}result(s,H0,F0){this.failResult((0,G.not)(s),H0,F0)}failResult(s,H0,F0){if(this.gen.if(s),F0)F0();else this.error();if(H0){if(this.gen.else(),H0(),this.allErrors)this.gen.endIf()}else if(this.allErrors)this.gen.endIf();else this.gen.else()}pass(s,H0){this.failResult((0,G.not)(s),void 0,H0)}fail(s){if(s===void 0){if(this.error(),!this.allErrors)this.gen.if(!1);return}if(this.gen.if(s),this.error(),this.allErrors)this.gen.endIf();else this.gen.else()}fail$data(s){if(!this.$data)return this.fail(s);let{schemaCode:H0}=this;this.fail(G._`${H0} !== undefined && (${(0,G.or)(this.invalid$data(),s)})`)}error(s,H0,F0){if(H0){this.setParams(H0),this._error(s,F0),this.setParams({});return}this._error(s,F0)}_error(s,H0){(s?Z.reportExtraError:Z.reportError)(this,this.def.error,H0)}$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(s){if(!this.allErrors)this.gen.if(s)}setParams(s,H0){if(H0)Object.assign(this.params,s);else this.params=s}block$data(s,H0,F0=G.nil){this.gen.block(()=>{this.check$data(s,F0),H0()})}check$data(s=G.nil,H0=G.nil){if(!this.$data)return;let{gen:F0,schemaCode:b0,schemaType:i0,def:n0}=this;if(F0.if((0,G.or)(G._`${b0} === undefined`,H0)),s!==G.nil)F0.assign(s,!0);if(i0.length||n0.validateSchema){if(F0.elseIf(this.invalid$data()),this.$dataError(),s!==G.nil)F0.assign(s,!1)}F0.else()}invalid$data(){let{gen:s,schemaCode:H0,schemaType:F0,def:b0,it:i0}=this;return(0,G.or)(n0(),w1());function n0(){if(F0.length){if(!(H0 instanceof G.Name))throw Error("ajv implementation error");let k1=Array.isArray(F0)?F0:[F0];return G._`${(0,Q.checkDataTypes)(k1,H0,i0.opts.strictNumbers,Q.DataType.Wrong)}`}return G.nil}function w1(){if(b0.validateSchema){let k1=s.scopeValue("validate$data",{ref:b0.validateSchema});return G._`!${k1}(${H0})`}return G.nil}}subschema(s,H0){let F0=(0,K.getSubschema)(this.it,s);(0,K.extendSubschemaData)(F0,this.it,s),(0,K.extendSubschemaMode)(F0,s);let b0={...this.it,...F0,items:void 0,props:void 0};return D(b0,H0),b0}mergeEvaluated(s,H0){let{it:F0,gen:b0}=this;if(!F0.opts.unevaluated)return;if(F0.props!==!0&&s.props!==void 0)F0.props=X.mergeEvaluated.props(b0,s.props,F0.props,H0);if(F0.items!==!0&&s.items!==void 0)F0.items=X.mergeEvaluated.items(b0,s.items,F0.items,H0)}mergeValidEvaluated(s,H0){let{it:F0,gen:b0}=this;if(F0.opts.unevaluated&&(F0.props!==!0||F0.items!==!0))return b0.if(H0,()=>this.mergeEvaluated(s,G.Name)),!0}};$.KeywordCxt=T0;function _0(s,H0,F0,b0){let i0=new T0(s,F0,H0);if("code"in F0)F0.code(i0,b0);else if(i0.$data&&F0.validate)(0,I.funcKeywordCode)(i0,F0);else if("macro"in F0)(0,I.macroKeywordCode)(i0,F0);else if(F0.compile||F0.validate)(0,I.funcKeywordCode)(i0,F0)}let G0=/^\/(?:[^~]|~0|~1)*$/,f0=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function e0(s,{dataLevel:H0,dataNames:F0,dataPathArr:b0}){let i0,n0;if(s==="")return H.default.rootData;if(s[0]==="/"){if(!G0.test(s))throw Error(`Invalid JSON-pointer: ${s}`);i0=s,n0=H.default.rootData}else{let b1=f0.exec(s);if(!b1)throw Error(`Invalid JSON-pointer: ${s}`);let A0=+b1[1];if(i0=b1[2],i0==="#"){if(A0>=H0)throw Error(u1("property/index",A0));return b0[H0-A0]}if(A0>H0)throw Error(u1("data",A0));if(n0=F0[H0-A0],!i0)return n0}let w1=n0,k1=i0.split("/");for(let b1 of k1)if(b1)n0=G._`${n0}${(0,G.getProperty)((0,X.unescapeJsonPointer)(b1))}`,w1=G._`${w1} && ${n0}`;return w1;function u1(b1,A0){return`Cannot access ${b1} ${A0} levels up, current level is ${H0}`}}$.getData=e0}),OH=C0(($)=>{Object.defineProperty($,"__esModule",{value:!0});var Y=class extends Error{constructor(z){super("validation failed");this.errors=z,this.ajv=this.validation=!0}};$.default=Y}),bQ=C0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=iO();var z=class extends Error{constructor(U,Q,J,I){super(I||`can't resolve reference ${J} from id ${Q}`);this.missingRef=(0,Y.resolveUrl)(U,Q,J),this.missingSchema=(0,Y.normalizeId)((0,Y.getFullPath)(U,this.missingRef))}};$.default=z}),nO=C0(($)=>{Object.defineProperty($,"__esModule",{value:!0}),$.resolveSchema=$.getCompilingSchema=$.resolveRef=$.compileSchema=$.SchemaEnv=void 0;let Y=F1(),z=OH(),U=Q5(),Q=iO(),J=v1(),I=uQ();var K=class{constructor(O){var N;this.refs={},this.dynamicAnchors={};let M;if(typeof O.schema=="object")M=O.schema;this.schema=O.schema,this.schemaId=O.schemaId,this.root=O.root||this,this.baseId=(N=O.baseId)!==null&&N!==void 0?N:(0,Q.normalizeId)(M===null||M===void 0?void 0:M[O.schemaId||"$id"]),this.schemaPath=O.schemaPath,this.localRefs=O.localRefs,this.meta=O.meta,this.$async=M===null||M===void 0?void 0:M.$async,this.refs={}}};$.SchemaEnv=K;function G(O){let N=X.call(this,O);if(N)return N;let M=(0,Q.getFullPath)(this.opts.uriResolver,O.root.baseId),{es5:D,lines:P}=this.opts.code,{ownProperties:j}=this.opts,A=new Y.CodeGen(this.scope,{es5:D,lines:P,ownProperties:j}),T;if(O.$async)T=A.scopeValue("Error",{ref:z.default,code:Y._`require("ajv/dist/runtime/validation_error").default`});let C=A.scopeName("validate");O.validateName=C;let b={gen:A,allErrors:this.opts.allErrors,data:U.default.data,parentData:U.default.parentData,parentDataProperty:U.default.parentDataProperty,dataNames:[U.default.data],dataPathArr:[Y.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:A.scopeValue("schema",this.opts.code.source===!0?{ref:O.schema,code:(0,Y.stringify)(O.schema)}:{ref:O.schema}),validateName:C,ValidationError:T,schema:O.schema,schemaEnv:O,rootId:M,baseId:O.baseId||M,schemaPath:Y.nil,errSchemaPath:O.schemaPath||(this.opts.jtd?"":"#"),errorPath:Y._`""`,opts:this.opts,self:this},k;try{this._compilations.add(O),(0,I.validateFunctionCode)(b),A.optimize(this.opts.code.optimize);let S=A.toString();if(k=`${A.scopeRefs(U.default.scope)}return ${S}`,this.opts.code.process)k=this.opts.code.process(k,O);let i=Function(`${U.default.self}`,`${U.default.scope}`,k)(this,this.scope.get());if(this.scope.value(C,{ref:i}),i.errors=null,i.schema=O.schema,i.schemaEnv=O,O.$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:n,items:U0}=b;if(i.evaluated={props:n instanceof Y.Name?void 0:n,items:U0 instanceof Y.Name?void 0:U0,dynamicProps:n instanceof Y.Name,dynamicItems:U0 instanceof Y.Name},i.source)i.source.evaluated=(0,Y.stringify)(i.evaluated)}return O.validate=i,O}catch(S){if(delete O.validate,delete O.validateName,k)this.logger.error("Error compiling schema, function code:",k);throw S}finally{this._compilations.delete(O)}}$.compileSchema=G;function H(O,N,M){var D;M=(0,Q.resolveUrl)(this.opts.uriResolver,N,M);let P=O.refs[M];if(P)return P;let j=q.call(this,O,M);if(j===void 0){let A=(D=O.localRefs)===null||D===void 0?void 0:D[M],{schemaId:T}=this.opts;if(A)j=new K({schema:A,schemaId:T,root:O,baseId:N})}if(j===void 0)return;return O.refs[M]=W.call(this,j)}$.resolveRef=H;function W(O){if((0,Q.inlineRef)(O.schema,this.opts.inlineRefs))return O.schema;return O.validate?O:G.call(this,O)}function X(O){for(let N of this._compilations)if(Z(N,O))return N}$.getCompilingSchema=X;function Z(O,N){return O.schema===N.schema&&O.root===N.root&&O.baseId===N.baseId}function q(O,N){let M;while(typeof(M=this.refs[N])=="string")N=M;return M||this.schemas[N]||V.call(this,O,N)}function V(O,N){let M=this.opts.uriResolver.parse(N),D=(0,Q._getFullPath)(this.opts.uriResolver,M),P=(0,Q.getFullPath)(this.opts.uriResolver,O.baseId,void 0);if(Object.keys(O.schema).length>0&&D===P)return w.call(this,M,O);let j=(0,Q.normalizeId)(D),A=this.refs[j]||this.schemas[j];if(typeof A=="string"){let T=V.call(this,O,A);if(typeof(T===null||T===void 0?void 0:T.schema)!=="object")return;return w.call(this,M,T)}if(typeof(A===null||A===void 0?void 0:A.schema)!=="object")return;if(!A.validate)G.call(this,A);if(j===(0,Q.normalizeId)(N)){let{schema:T}=A,{schemaId:C}=this.opts,b=T[C];if(b)P=(0,Q.resolveUrl)(this.opts.uriResolver,P,b);return new K({schema:T,schemaId:C,root:O,baseId:P})}return w.call(this,M,A)}$.resolveSchema=V;let F=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function w(O,{baseId:N,schema:M,root:D}){var P;if(((P=O.fragment)===null||P===void 0?void 0:P[0])!=="/")return;for(let T of O.fragment.slice(1).split("/")){if(typeof M==="boolean")return;let C=M[(0,J.unescapeFragment)(T)];if(C===void 0)return;M=C;let b=typeof M==="object"&&M[this.opts.schemaId];if(!F.has(T)&&b)N=(0,Q.resolveUrl)(this.opts.uriResolver,N,b)}let j;if(typeof M!="boolean"&&M.$ref&&!(0,J.schemaHasRulesButRef)(M,this.RULES)){let T=(0,Q.resolveUrl)(this.opts.uriResolver,N,M.$ref);j=V.call(this,D,T)}let{schemaId:A}=this.opts;if(j=j||new K({schema:M,schemaId:A,root:D,baseId:N}),j.schema!==j.root.schema)return j}}),Db0=C0(($,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}}),Fe=C0(($,Y)=>{let z=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),U=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="",w=0,O=0;for(O=0;O=48&&w<=57||w>=65&&w<=70||w>=97&&w<=102))return"";F+=V[O];break}for(O+=1;O=48&&w<=57||w>=65&&w<=70||w>=97&&w<=102))return"";F+=V[O]}return F}let J=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function I(V){return V.length=0,!0}function K(V,F,w){if(V.length){let O=Q(V);if(O!=="")F.push(O);else return w.error=!0,!1;V.length=0}return!0}function G(V){let F=0,w={error:!1,address:"",zone:""},O=[],N=[],M=!1,D=!1,P=K;for(let j=0;j7){w.error=!0;break}if(j>0&&V[j-1]===":")M=!0;O.push(":");continue}else if(A==="%"){if(!P(N,O,w))break;P=I}else{N.push(A);continue}}if(N.length)if(P===I)w.zone=N.join("");else if(D)O.push(N.join(""));else O.push(Q(N));return w.address=O.join(""),w}function H(V){if(W(V,":")<2)return{host:V,isIPV6:!1};let F=G(V);if(!F.error){let{address:w,address:O}=F;if(F.zone)w+="%"+F.zone,O+="%25"+F.zone;return{host:w,isIPV6:!0,escapedHost:O}}else return{host:V,isIPV6:!1}}function W(V,F){let w=0;for(let O=0;O{let{isUUID:z}=Fe(),U=/([\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 T=String(A.scheme).toLowerCase()==="https";if(A.port===(T?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[T,C]=A.resourceName.split("?");A.path=T&&T!=="/"?T:void 0,A.query=C,A.resourceName=void 0}return A.fragment=void 0,A}function X(A,T){if(!A.path)return A.error="URN can not be parsed",A;let C=A.path.match(U);if(C){let b=T.scheme||A.scheme||"urn";A.nid=C[1].toLowerCase(),A.nss=C[2];let k=j(`${b}:${T.nid||A.nid}`);if(A.path=void 0,k)A=k.parse(A,T)}else A.error=A.error||"URN can not be parsed.";return A}function Z(A,T){if(A.nid===void 0)throw Error("URN without nid cannot be serialized");let C=T.scheme||A.scheme||"urn",b=A.nid.toLowerCase(),k=j(`${C}:${T.nid||b}`);if(k)A=k.serialize(A,T);let S=A,i=A.nss;return S.path=`${b||T.nid}:${i}`,T.skipEscape=!0,S}function q(A,T){let C=A;if(C.uuid=C.nss,C.nss=void 0,!T.tolerant&&(!C.uuid||!z(C.uuid)))C.error=C.error||"UUID is not valid.";return C}function V(A){let T=A;return T.nss=(A.uuid||"").toLowerCase(),T}let F={scheme:"http",domainHost:!0,parse:K,serialize:G},w={scheme:"https",domainHost:F.domainHost,parse:K,serialize:G},O={scheme:"ws",domainHost:!0,parse:H,serialize:W},N={scheme:"wss",domainHost:O.domainHost,parse:O.parse,serialize:O.serialize},P={http:F,https:w,ws:O,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 j(A){return A&&(P[A]||P[A.toLowerCase()])||void 0}Y.exports={wsIsSecure:I,SCHEMES:P,isValidSchemeName:J,getSchemeHandler:j}}),Bb0=C0(($,Y)=>{let{normalizeIPv6:z,removeDotSegments:U,recomposeAuthority:Q,normalizeComponentEncoding:J,isIPv4:I,nonSimpleDomain:K}=Fe(),{SCHEMES:G,getSchemeHandler:H}=Ab0();function W(N,M){if(typeof N==="string")N=V(w(N,M),M);else if(typeof N==="object")N=w(V(N,M),M);return N}function X(N,M,D){let P=D?Object.assign({scheme:"null"},D):{scheme:"null"},j=Z(w(N,P),w(M,P),P,!0);return P.skipEscape=!0,V(j,P)}function Z(N,M,D,P){let j={};if(!P)N=w(V(N,D),D),M=w(V(M,D),D);if(D=D||{},!D.tolerant&&M.scheme)j.scheme=M.scheme,j.userinfo=M.userinfo,j.host=M.host,j.port=M.port,j.path=U(M.path||""),j.query=M.query;else{if(M.userinfo!==void 0||M.host!==void 0||M.port!==void 0)j.userinfo=M.userinfo,j.host=M.host,j.port=M.port,j.path=U(M.path||""),j.query=M.query;else{if(!M.path)if(j.path=N.path,M.query!==void 0)j.query=M.query;else j.query=N.query;else{if(M.path[0]==="/")j.path=U(M.path);else{if((N.userinfo!==void 0||N.host!==void 0||N.port!==void 0)&&!N.path)j.path="/"+M.path;else if(!N.path)j.path=M.path;else j.path=N.path.slice(0,N.path.lastIndexOf("/")+1)+M.path;j.path=U(j.path)}j.query=M.query}j.userinfo=N.userinfo,j.host=N.host,j.port=N.port}j.scheme=N.scheme}return j.fragment=M.fragment,j}function q(N,M,D){if(typeof N==="string")N=unescape(N),N=V(J(w(N,D),!0),{...D,skipEscape:!0});else if(typeof N==="object")N=V(J(N,!0),{...D,skipEscape:!0});if(typeof M==="string")M=unescape(M),M=V(J(w(M,D),!0),{...D,skipEscape:!0});else if(typeof M==="object")M=V(J(M,!0),{...D,skipEscape:!0});return N.toLowerCase()===M.toLowerCase()}function V(N,M){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({},M),j=[],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)j.push(D.scheme,":");let T=Q(D);if(T!==void 0){if(P.reference!=="suffix")j.push("//");if(j.push(T),D.path&&D.path[0]!=="/")j.push("/")}if(D.path!==void 0){let C=D.path;if(!P.absolutePath&&(!A||!A.absolutePath))C=U(C);if(T===void 0&&C[0]==="/"&&C[1]==="/")C="/%2F"+C.slice(2);j.push(C)}if(D.query!==void 0)j.push("?",D.query);if(D.fragment!==void 0)j.push("#",D.fragment);return j.join("")}let F=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function w(N,M){let D=Object.assign({},M),P={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0},j=!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=z(P.host);P.host=C.host.toLowerCase(),j=C.isIPV6}else j=!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 T=H(D.scheme||P.scheme);if(!D.unicodeSupport&&(!T||!T.unicodeSupport)){if(P.host&&(D.domainHost||T&&T.domainHost)&&j===!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(!T||T&&!T.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(T&&T.parse)T.parse(P,D)}else P.error=P.error||"URI can not be parsed.";return P}let O={SCHEMES:G,normalize:W,resolve:X,resolveComponent:Z,equal:q,serialize:V,parse:w};Y.exports=O,Y.exports.default=O,Y.exports.fastUri=O}),Pb0=C0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=Bb0();Y.code='require("ajv/dist/runtime/uri").default',$.default=Y}),wS=C0(($)=>{Object.defineProperty($,"__esModule",{value:!0}),$.CodeGen=$.Name=$.nil=$.stringify=$.str=$._=$.KeywordCxt=void 0;var Y=uQ();Object.defineProperty($,"KeywordCxt",{enumerable:!0,get:function(){return Y.KeywordCxt}});var z=F1();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}});let U=OH(),Q=bQ(),J=qe(),I=nO(),K=F1(),G=iO(),H=uO(),W=v1(),X=Db0(),Z=Pb0(),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"]),w={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."},O={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},N=200;function M(g){var p,Y0,y,r,$0,N0,T0,_0,G0,f0,e0,s,H0,F0,b0,i0,n0,w1,k1,u1,b1,A0,Q0,B,v;let u=g.strict,a=(p=g.code)===null||p===void 0?void 0:p.optimize,X0=a===!0||a===void 0?1:a||0,J0=(y=(Y0=g.code)===null||Y0===void 0?void 0:Y0.regExp)!==null&&y!==void 0?y:q,q0=(r=g.uriResolver)!==null&&r!==void 0?r:Z.default;return{strictSchema:(N0=($0=g.strictSchema)!==null&&$0!==void 0?$0:u)!==null&&N0!==void 0?N0:!0,strictNumbers:(_0=(T0=g.strictNumbers)!==null&&T0!==void 0?T0:u)!==null&&_0!==void 0?_0:!0,strictTypes:(f0=(G0=g.strictTypes)!==null&&G0!==void 0?G0:u)!==null&&f0!==void 0?f0:"log",strictTuples:(s=(e0=g.strictTuples)!==null&&e0!==void 0?e0:u)!==null&&s!==void 0?s:"log",strictRequired:(F0=(H0=g.strictRequired)!==null&&H0!==void 0?H0:u)!==null&&F0!==void 0?F0:!1,code:g.code?{...g.code,optimize:X0,regExp:J0}:{optimize:X0,regExp:J0},loopRequired:(b0=g.loopRequired)!==null&&b0!==void 0?b0:N,loopEnum:(i0=g.loopEnum)!==null&&i0!==void 0?i0:N,meta:(n0=g.meta)!==null&&n0!==void 0?n0:!0,messages:(w1=g.messages)!==null&&w1!==void 0?w1:!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,...M(g)};let{es5:p,lines:Y0}=this.opts.code;this.scope=new K.ValueScope({scope:{},prefixes:F,es5:p,lines:Y0}),this.logger=S(g.logger);let y=g.validateFormats;if(g.validateFormats=!1,this.RULES=(0,J.getRules)(),P.call(this,w,g,"NOT SUPPORTED"),P.call(this,O,g,"DEPRECATED","warn"),this._metaOpts=b.call(this),g.formats)T.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:Y0}=this.opts,y=X;if(Y0==="id")y={...X},y.id=y.$id,delete y.$id;if(p&&g)this.addMetaSchema(y,y[Y0],!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 Y0;if(typeof g=="string"){if(Y0=this.getSchema(g),!Y0)throw Error(`no schema with key or ref "${g}"`)}else Y0=this.compile(g);let y=Y0(p);if(!("$async"in Y0))this.errors=Y0.errors;return y}compile(g,p){let Y0=this._addSchema(g,p);return Y0.validate||this._compileSchemaEnv(Y0)}compileAsync(g,p){if(typeof this.opts.loadSchema!="function")throw Error("options.loadSchema should be a function");let{loadSchema:Y0}=this.opts;return y.call(this,g,p);async function y(G0,f0){await r.call(this,G0.$schema);let e0=this._addSchema(G0,f0);return e0.validate||$0.call(this,e0)}async function r(G0){if(G0&&!this.getSchema(G0))await y.call(this,{$ref:G0},!0)}async function $0(G0){try{return this._compileSchemaEnv(G0)}catch(f0){if(!(f0 instanceof Q.default))throw f0;return N0.call(this,f0),await T0.call(this,f0.missingSchema),$0.call(this,G0)}}function N0({missingSchema:G0,missingRef:f0}){if(this.refs[G0])throw Error(`AnySchema ${G0} is loaded but ${f0} cannot be resolved`)}async function T0(G0){let f0=await _0.call(this,G0);if(!this.refs[G0])await r.call(this,f0.$schema);if(!this.refs[G0])this.addSchema(f0,G0,p)}async function _0(G0){let f0=this._loading[G0];if(f0)return f0;try{return await(this._loading[G0]=Y0(G0))}finally{delete this._loading[G0]}}}addSchema(g,p,Y0,y=this.opts.validateSchema){if(Array.isArray(g)){for(let $0 of g)this.addSchema($0,void 0,Y0,y);return this}let r;if(typeof g==="object"){let{schemaId:$0}=this.opts;if(r=g[$0],r!==void 0&&typeof r!="string")throw Error(`schema ${$0} must be string`)}return p=(0,G.normalizeId)(p||r),this._checkUnique(p),this.schemas[p]=this._addSchema(g,Y0,p,y,!0),this}addMetaSchema(g,p,Y0=this.opts.validateSchema){return this.addSchema(g,p,!0,Y0),this}validateSchema(g,p){if(typeof g=="boolean")return!0;let Y0;if(Y0=g.$schema,Y0!==void 0&&typeof Y0!="string")throw Error("$schema must be a string");if(Y0=Y0||this.opts.defaultMeta||this.defaultMeta(),!Y0)return this.logger.warn("meta-schema not available"),this.errors=null,!0;let y=this.validate(Y0,g);if(!y&&p){let r="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(r);else throw Error(r)}return y}getSchema(g){let p;while(typeof(p=j.call(this,g))=="string")g=p;if(p===void 0){let{schemaId:Y0}=this.opts,y=new I.SchemaEnv({schema:{},schemaId:Y0});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=j.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 Y0=g[this.opts.schemaId];if(Y0)Y0=(0,G.normalizeId)(Y0),delete this.schemas[Y0],delete this.refs[Y0];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 Y0;if(typeof g=="string"){if(Y0=g,typeof p=="object")this.logger.warn("these parameters are deprecated, see docs for addKeyword"),p.keyword=Y0}else if(typeof g=="object"&&p===void 0){if(p=g,Y0=p.keyword,Array.isArray(Y0)&&!Y0.length)throw Error("addKeywords: keyword must be string or non-empty array")}else throw Error("invalid addKeywords parameters");if(n.call(this,Y0,p),!p)return(0,W.eachItem)(Y0,(r)=>U0.call(this,r)),this;d.call(this,p);let y={...p,type:(0,H.getJSONTypes)(p.type),schemaType:(0,H.getJSONTypes)(p.schemaType)};return(0,W.eachItem)(Y0,y.type.length===0?(r)=>U0.call(this,r,y):(r)=>y.type.forEach(($0)=>U0.call(this,r,y,$0))),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 Y0 of p.rules){let y=Y0.rules.findIndex((r)=>r.keyword===g);if(y>=0)Y0.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:Y0="data"}={}){if(!g||g.length===0)return"No errors";return g.map((y)=>`${Y0}${y.instancePath} ${y.message}`).reduce((y,r)=>y+p+r)}$dataMetaSchema(g,p){let Y0=this.RULES.all;g=JSON.parse(JSON.stringify(g));for(let y of p){let r=y.split("/").slice(1),$0=g;for(let N0 of r)$0=$0[N0];for(let N0 in Y0){let T0=Y0[N0];if(typeof T0!="object")continue;let{$data:_0}=T0.definition,G0=$0[N0];if(_0&&G0)$0[N0]=e(G0)}}return g}_removeAllSchemas(g,p){for(let Y0 in g){let y=g[Y0];if(!p||p.test(Y0)){if(typeof y=="string")delete g[Y0];else if(y&&!y.meta)this._cache.delete(y.schema),delete g[Y0]}}}_addSchema(g,p,Y0,y=this.opts.validateSchema,r=this.opts.addUsedSchema){let $0,{schemaId:N0}=this.opts;if(typeof g=="object")$0=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 T0=this._cache.get(g);if(T0!==void 0)return T0;Y0=(0,G.normalizeId)($0||Y0);let _0=G.getSchemaRefs.call(this,g,Y0);if(T0=new I.SchemaEnv({schema:g,schemaId:N0,meta:p,baseId:Y0,localRefs:_0}),this._cache.set(T0.schema,T0),r&&!Y0.startsWith("#")){if(Y0)this._checkUnique(Y0);this.refs[Y0]=T0}if(y)this.validateSchema(g,!0);return T0}_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=U.default,D.MissingRefError=Q.default,$.default=D;function P(g,p,Y0,y="error"){for(let r in g){let $0=r;if($0 in p)this.logger[y](`${Y0}: option ${r}. ${g[$0]}`)}}function j(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 T(){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 Y0=g[p];if(!Y0.keyword)Y0.keyword=p;this.addKeyword(Y0)}}function b(){let g={...this.opts};for(let p of V)delete g[p];return g}let k={log(){},warn(){},error(){}};function S(g){if(g===!1)return k;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 n(g,p){let{RULES:Y0}=this;if((0,W.eachItem)(g,(y)=>{if(Y0.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 U0(g,p,Y0){var y;let r=p===null||p===void 0?void 0:p.post;if(Y0&&r)throw Error('keyword with "post" flag cannot have "type"');let{RULES:$0}=this,N0=r?$0.post:$0.rules.find(({type:_0})=>_0===Y0);if(!N0)N0={type:Y0,rules:[]},$0.rules.push(N0);if($0.keywords[g]=!0,!p)return;let T0={keyword:g,definition:{...p,type:(0,H.getJSONTypes)(p.type),schemaType:(0,H.getJSONTypes)(p.schemaType)}};if(p.before)x.call(this,N0,T0,p.before);else N0.rules.push(T0);$0.all[g]=T0,(y=p.implements)===null||y===void 0||y.forEach((_0)=>this.addKeyword(_0))}function x(g,p,Y0){let y=g.rules.findIndex((r)=>r.keyword===Y0);if(y>=0)g.rules.splice(y,0,p);else g.rules.push(p),this.logger.warn(`rule ${Y0} is not defined`)}function d(g){let{metaSchema:p}=g;if(p===void 0)return;if(g.$data&&this.opts.$data)p=e(p);g.validateSchema=this.compile(p,!0)}let t={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function e(g){return{anyOf:[g,t]}}}),jb0=C0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y={keyword:"id",code(){throw Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};$.default=Y}),MS=C0(($)=>{Object.defineProperty($,"__esModule",{value:!0}),$.callRef=$.getValidate=void 0;let Y=bQ(),z=J5(),U=F1(),Q=Q5(),J=nO(),I=v1(),K={keyword:"$ref",schemaType:"string",code(W){let{gen:X,schema:Z,it:q}=W,{baseId:V,schemaEnv:F,validateName:w,opts:O,self:N}=q,{root:M}=F;if((Z==="#"||Z==="#/")&&V===M.baseId)return P();let D=J.resolveRef.call(N,M,V,Z);if(D===void 0)throw new Y.default(q.opts.uriResolver,V,Z);if(D instanceof J.SchemaEnv)return j(D);return A(D);function P(){if(F===M)return H(W,w,F,F.$async);let T=X.scopeValue("root",{ref:M});return H(W,U._`${T}.validate`,M,M.$async)}function j(T){H(W,G(W,T),T,T.$async)}function A(T){let C=X.scopeValue("schema",O.code.source===!0?{ref:T,code:(0,U.stringify)(T)}:{ref:T}),b=X.name("valid"),k=W.subschema({schema:T,dataTypes:[],schemaPath:U.nil,topSchemaRef:C,errSchemaPath:Z},b);W.mergeEvaluated(k),W.ok(b)}}};function G(W,X){let{gen:Z}=W;return X.validate?Z.scopeValue("validate",{ref:X.validate}):U._`${Z.scopeValue("wrapper",{ref:X})}.validate`}$.getValidate=G;function H(W,X,Z,q){let{gen:V,it:F}=W,{allErrors:w,schemaEnv:O,opts:N}=F,M=N.passContext?Q.default.this:U.nil;if(q)D();else P();function D(){if(!O.$async)throw Error("async schema referenced by sync schema");let T=V.let("valid");V.try(()=>{if(V.code(U._`await ${(0,z.callValidateCode)(W,X,M)}`),A(X),!w)V.assign(T,!0)},(C)=>{if(V.if(U._`!(${C} instanceof ${F.ValidationError})`,()=>V.throw(C)),j(C),!w)V.assign(T,!1)}),W.ok(T)}function P(){W.result((0,z.callValidateCode)(W,X,M),()=>A(X),()=>j(X))}function j(T){let C=U._`${T}.errors`;V.assign(Q.default.vErrors,U._`${Q.default.vErrors} === null ? ${C} : ${Q.default.vErrors}.concat(${C})`),V.assign(Q.default.errors,U._`${Q.default.vErrors}.length`)}function A(T){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 k=V.var("props",U._`${T}.evaluated.props`);F.props=I.mergeEvaluated.props(V,k,F.props,U.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 k=V.var("items",U._`${T}.evaluated.items`);F.items=I.mergeEvaluated.items(V,k,F.items,U.Name)}}}$.callRef=H,$.default=K}),Oe=C0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=jb0(),z=MS(),U=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",Y.default,z.default];$.default=U}),Tb0=C0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=F1(),z=Y.operators,U={maximum:{okStr:"<=",ok:z.LTE,fail:z.GT},minimum:{okStr:">=",ok:z.GTE,fail:z.LT},exclusiveMaximum:{okStr:"<",ok:z.LT,fail:z.GTE},exclusiveMinimum:{okStr:">",ok:z.GT,fail:z.LTE}},Q={keyword:Object.keys(U),type:"number",schemaType:"number",$data:!0,error:{message:({keyword:J,schemaCode:I})=>Y.str`must be ${U[J].okStr} ${I}`,params:({keyword:J,schemaCode:I})=>Y._`{comparison: ${U[J].okStr}, limit: ${I}}`},code(J){let{keyword:I,data:K,schemaCode:G}=J;J.fail$data(Y._`${K} ${U[I].fail} ${G} || isNaN(${K})`)}};$.default=Q}),Eb0=C0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=F1(),z={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:{message:({schemaCode:U})=>Y.str`must be multiple of ${U}`,params:({schemaCode:U})=>Y._`{multipleOf: ${U}}`},code(U){let{gen:Q,data:J,schemaCode:I,it:K}=U,G=K.opts.multipleOfPrecision,H=Q.let("res"),W=G?Y._`Math.abs(Math.round(${H}) - ${H}) > 1e-${G}`:Y._`${H} !== parseInt(${H})`;U.fail$data(Y._`(${I} === 0 || (${H} = ${J}/${I}, ${W}))`)}};$.default=z}),Cb0=C0(($)=>{Object.defineProperty($,"__esModule",{value:!0});function Y(z){let U=z.length,Q=0,J=0,I;while(J=55296&&I<=56319&&J{Object.defineProperty($,"__esModule",{value:!0});let Y=F1(),z=v1(),U=Cb0(),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,z.useFunc)(J.gen,U.default)}(${K})`;J.fail$data(Y._`${X} ${W} ${G}`)}};$.default=Q}),_b0=C0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=J5(),z=v1(),U=F1(),Q={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:{message:({schemaCode:J})=>U.str`must match pattern "${J}"`,params:({schemaCode:J})=>U._`{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"?U._`new RegExp`:(0,z.useFunc)(I,q),F=I.let("valid");I.try(()=>I.assign(F,U._`${V}(${W}, ${Z}).test(${K})`),()=>I.assign(F,!1)),J.fail$data(U._`!${F}`)}else{let q=(0,Y.usePattern)(J,H);J.fail$data(U._`!${q}.test(${K})`)}}};$.default=Q}),vb0=C0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=F1(),z={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:{message({keyword:U,schemaCode:Q}){let J=U==="maxProperties"?"more":"fewer";return Y.str`must NOT have ${J} than ${Q} properties`},params:({schemaCode:U})=>Y._`{limit: ${U}}`},code(U){let{keyword:Q,data:J,schemaCode:I}=U,K=Q==="maxProperties"?Y.operators.GT:Y.operators.LT;U.fail$data(Y._`Object.keys(${J}).length ${K} ${I}`)}};$.default=z}),hb0=C0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=J5(),z=F1(),U=v1(),Q={keyword:"required",type:"object",schemaType:"array",$data:!0,error:{message:({params:{missingProperty:J}})=>z.str`must have required property '${J}'`,params:({params:{missingProperty:J}})=>z._`{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:M}=J.it;for(let D of K)if((N===null||N===void 0?void 0:N[D])===void 0&&!M.has(D)){let P=`required property "${D}" is not defined at "${X.schemaEnv.baseId+X.errSchemaPath}" (strictRequired)`;(0,U.checkStrictMode)(X,P,X.opts.strictRequired)}}function V(){if(q||W)J.block$data(z.nil,w);else for(let N of K)(0,Y.checkReportMissingProp)(J,N)}function F(){let N=I.let("missing");if(q||W){let M=I.let("valid",!0);J.block$data(M,()=>O(N,M)),J.ok(M)}else I.if((0,Y.checkMissingProp)(J,K,N)),(0,Y.reportMissingProp)(J,N),I.else()}function w(){I.forOf("prop",G,(N)=>{J.setParams({missingProperty:N}),I.if((0,Y.noPropertyInData)(I,H,N,Z.ownProperties),()=>J.error())})}function O(N,M){J.setParams({missingProperty:N}),I.forOf(N,G,()=>{I.assign(M,(0,Y.propertyInData)(I,H,N,Z.ownProperties)),I.if((0,z.not)(M),()=>{J.error(),I.break()})},z.nil)}}};$.default=Q}),Sb0=C0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=F1(),z={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:{message({keyword:U,schemaCode:Q}){let J=U==="maxItems"?"more":"fewer";return Y.str`must NOT have ${J} than ${Q} items`},params:({schemaCode:U})=>Y._`{limit: ${U}}`},code(U){let{keyword:Q,data:J,schemaCode:I}=U,K=Q==="maxItems"?Y.operators.GT:Y.operators.LT;U.fail$data(Y._`${J}.length ${K} ${I}`)}};$.default=z}),NS=C0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=Le();Y.code='require("ajv/dist/runtime/equal").default',$.default=Y}),gb0=C0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=uO(),z=F1(),U=v1(),Q=NS(),J={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:{message:({params:{i:I,j:K}})=>z.str`must NOT have duplicate items (items ## ${K} and ${I} are identical)`,params:({params:{i:I,j:K}})=>z._`{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,w,z._`${Z} === false`),I.ok(V);function w(){let D=K.let("i",z._`${G}.length`),P=K.let("j");I.setParams({i:D,j:P}),K.assign(V,!0),K.if(z._`${D} > 1`,()=>(O()?N:M)(D,P))}function O(){return F.length>0&&!F.some((D)=>D==="object"||D==="array")}function N(D,P){let j=K.name("item"),A=(0,Y.checkDataTypes)(F,j,q.opts.strictNumbers,Y.DataType.Wrong),T=K.const("indices",z._`{}`);K.for(z._`;${D}--;`,()=>{if(K.let(j,z._`${G}[${D}]`),K.if(A,z._`continue`),F.length>1)K.if(z._`typeof ${j} == "string"`,z._`${j} += "_"`);K.if(z._`typeof ${T}[${j}] == "number"`,()=>{K.assign(P,z._`${T}[${j}]`),I.error(),K.assign(V,!1).break()}).code(z._`${T}[${j}] = ${D}`)})}function M(D,P){let j=(0,U.useFunc)(K,Q.default),A=K.name("outer");K.label(A).for(z._`;${D}--;`,()=>K.for(z._`${P} = ${D}; ${P}--;`,()=>K.if(z._`${j}(${G}[${D}], ${G}[${P}])`,()=>{I.error(),K.assign(V,!1).break(A)})))}}};$.default=J}),yb0=C0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=F1(),z=v1(),U=NS(),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,z.useFunc)(I,U.default)}(${K}, ${H})`);else J.fail(Y._`${W} !== ${K}`)}};$.default=Q}),kb0=C0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=F1(),z=v1(),U=NS(),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,z.useFunc)(I,U.default),F;if(Z||G)F=I.let("valid"),J.block$data(F,w);else{if(!Array.isArray(H))throw Error("ajv implementation error");let N=I.const("vSchema",W);F=(0,Y.or)(...H.map((M,D)=>O(N,D)))}J.pass(F);function w(){I.assign(F,!1),I.forOf("v",W,(N)=>I.if(Y._`${V()}(${K}, ${N})`,()=>I.assign(F,!0).break()))}function O(N,M){let D=H[M];return typeof D==="object"&&D!==null?Y._`${V()}(${K}, ${N}[${M}])`:Y._`${K} === ${D}`}}};$.default=Q}),we=C0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=Tb0(),z=Eb0(),U=Rb0(),Q=_b0(),J=vb0(),I=hb0(),K=Sb0(),G=gb0(),H=yb0(),W=kb0(),X=[Y.default,z.default,U.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}),Me=C0(($)=>{Object.defineProperty($,"__esModule",{value:!0}),$.validateAdditionalItems=void 0;let Y=F1(),z=v1(),U={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,z.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,z.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:z.Type.Num},V),!X.allErrors)K.if((0,Y.not)(V),()=>K.break())})}}$.validateAdditionalItems=Q,$.default=U}),Ne=C0(($)=>{Object.defineProperty($,"__esModule",{value:!0}),$.validateTuple=void 0;let Y=F1(),z=v1(),U=J5(),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,z.alwaysValidSchema)(G,K))return;I.ok((0,U.validateArray)(I))}};function J(I,K,G=I.schema){let{gen:H,parentSchema:W,data:X,keyword:Z,it:q}=I;if(w(W),q.opts.unevaluated&&G.length&&q.items!==!0)q.items=z.mergeEvaluated.items(H,G.length,q.items);let V=H.name("valid"),F=H.const("len",Y._`${X}.length`);G.forEach((O,N)=>{if((0,z.alwaysValidSchema)(q,O))return;H.if(Y._`${F} > ${N}`,()=>I.subschema({keyword:Z,schemaProp:N,dataProp:N},V)),I.ok(V)});function w(O){let{opts:N,errSchemaPath:M}=q,D=G.length,P=D===O.minItems&&(D===O.maxItems||O[K]===!1);if(N.strictTuples&&!P){let j=`"${Z}" is ${D}-tuple, but minItems or maxItems/${K} are not specified or different at path "${M}"`;(0,z.checkStrictMode)(q,j,N.strictTuples)}}}$.validateTuple=J,$.default=Q}),xb0=C0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=Ne(),z={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:(U)=>(0,Y.validateTuple)(U,"items")};$.default=z}),fb0=C0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=F1(),z=v1(),U=J5(),Q=Me(),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,z.alwaysValidSchema)(H,K))return;if(W)(0,Q.validateAdditionalItems)(I,W);else I.ok((0,U.validateArray)(I))}};$.default=J}),ub0=C0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=F1(),z=v1(),U={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,z.checkStrictMode)(H,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(X!==void 0&&W>X){(0,z.checkStrictMode)(H,'"minContains" > "maxContains" is always invalid'),Q.fail();return}if((0,z.alwaysValidSchema)(H,I)){let M=Y._`${V} >= ${W}`;if(X!==void 0)M=Y._`${M} && ${V} <= ${X}`;Q.pass(M);return}H.items=!0;let F=J.name("valid");if(X===void 0&&W===1)O(F,()=>J.if(F,()=>J.break()));else if(W===0){if(J.let(F,!0),X!==void 0)J.if(Y._`${G}.length > 0`,w)}else J.let(F,!1),w();Q.result(F,()=>Q.reset());function w(){let M=J.name("_valid"),D=J.let("count",0);O(M,()=>J.if(M,()=>N(D)))}function O(M,D){J.forRange("i",0,V,(P)=>{Q.subschema({keyword:"contains",dataProp:P,dataPropType:z.Type.Num,compositeRule:!0},M),D()})}function N(M){if(J.code(Y._`${M}++`),X===void 0)J.if(Y._`${M} >= ${W}`,()=>J.assign(F,!0).break());else if(J.if(Y._`${M} > ${X}`,()=>J.assign(F,!1).break()),W===1)J.assign(F,!0);else J.if(Y._`${M} >= ${W}`,()=>J.assign(F,!0))}}};$.default=U}),DS=C0(($)=>{Object.defineProperty($,"__esModule",{value:!0}),$.validateSchemaDeps=$.validatePropertyDeps=$.error=void 0;let Y=F1(),z=v1(),U=J5();$.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 w=(0,U.propertyInData)(W,X,V,Z.opts.ownProperties);if(G.setParams({property:V,depsCount:F.length,deps:F.join(", ")}),Z.allErrors)W.if(w,()=>{for(let O of F)(0,U.checkReportMissingProp)(G,O)});else W.if(Y._`${w} && (${(0,U.checkMissingProp)(G,F,q)})`),(0,U.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,z.alwaysValidSchema)(q,H[F]))continue;W.if((0,U.propertyInData)(W,X,F,q.opts.ownProperties),()=>{let w=G.subschema({keyword:Z,schemaProp:F},V);G.mergeValidEvaluated(w,V)},()=>W.var(V,!0)),G.ok(V)}}$.validateSchemaDeps=K,$.default=Q}),bb0=C0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=F1(),z=v1(),U={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,z.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=U}),De=C0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=J5(),z=F1(),U=Q5(),Q=v1(),J={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:{message:"must NOT have additional properties",params:({params:I})=>z._`{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),w=(0,Y.allSchemaProperties)(H.patternProperties);O(),I.ok(z._`${X} === ${U.default.errors}`);function O(){K.forIn("key",W,(j)=>{if(!F.length&&!w.length)D(j);else K.if(N(j),()=>D(j))})}function N(j){let A;if(F.length>8){let T=(0,Q.schemaRefOrVal)(Z,H.properties,"properties");A=(0,Y.isOwnProperty)(K,T,j)}else if(F.length)A=(0,z.or)(...F.map((T)=>z._`${j} === ${T}`));else A=z.nil;if(w.length)A=(0,z.or)(A,...w.map((T)=>z._`${(0,Y.usePattern)(I,T)}.test(${j})`));return(0,z.not)(A)}function M(j){K.code(z._`delete ${W}[${j}]`)}function D(j){if(V.removeAdditional==="all"||V.removeAdditional&&G===!1){M(j);return}if(G===!1){if(I.setParams({additionalProperty:j}),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(j,A,!1),K.if((0,z.not)(A),()=>{I.reset(),M(j)});else if(P(j,A),!q)K.if((0,z.not)(A),()=>K.break())}}function P(j,A,T){let C={keyword:"additionalProperties",dataProp:j,dataPropType:Q.Type.Str};if(T===!1)Object.assign(C,{compositeRule:!0,createErrors:!1,allErrors:!1});I.subschema(C,A)}}};$.default=J}),ib0=C0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=uQ(),z=J5(),U=v1(),Q=De(),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,z.allSchemaProperties)(G);for(let O of Z)X.definedProperties.add(O);if(X.opts.unevaluated&&Z.length&&X.props!==!0)X.props=U.mergeEvaluated.props(K,(0,U.toHash)(Z),X.props);let q=Z.filter((O)=>!(0,U.alwaysValidSchema)(X,G[O]));if(q.length===0)return;let V=K.name("valid");for(let O of q){if(F(O))w(O);else{if(K.if((0,z.propertyInData)(K,W,O,X.opts.ownProperties)),w(O),!X.allErrors)K.else().var(V,!0);K.endIf()}I.it.definedProperties.add(O),I.ok(V)}function F(O){return X.opts.useDefaults&&!X.compositeRule&&G[O].default!==void 0}function w(O){I.subschema({keyword:"properties",schemaProp:O,dataProp:O},V)}}};$.default=J}),nb0=C0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=J5(),z=F1(),U=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,U.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,w=K.name("valid");if(X.props!==!0&&!(X.props instanceof z.Name))X.props=(0,Q.evaluatedPropsToName)(K,X.props);let{props:O}=X;N();function N(){for(let P of q){if(F)M(P);if(X.allErrors)D(P);else K.var(w,!0),D(P),K.if(w)}}function M(P){for(let j in F)if(new RegExp(P).test(j))(0,U.checkStrictMode)(X,`property ${j} matches pattern ${P} (use allowMatchingProperties)`)}function D(P){K.forIn("key",H,(j)=>{K.if(z._`${(0,Y.usePattern)(I,P)}.test(${j})`,()=>{let A=V.includes(P);if(!A)I.subschema({keyword:"patternProperties",schemaProp:P,dataProp:j,dataPropType:Q.Type.Str},w);if(X.opts.unevaluated&&O!==!0)K.assign(z._`${O}[${j}]`,!0);else if(!A&&!X.allErrors)K.if((0,z.not)(w),()=>K.break())})})}}};$.default=J}),cb0=C0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=v1(),z={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(U){let{gen:Q,schema:J,it:I}=U;if((0,Y.alwaysValidSchema)(I,J)){U.fail();return}let K=Q.name("valid");U.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},K),U.failResult(K,()=>U.reset(),()=>U.error())},error:{message:"must NOT be valid"}};$.default=z}),pb0=C0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:J5().validateUnion,error:{message:"must match a schema in anyOf"}};$.default=Y}),db0=C0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=F1(),z=v1(),U={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 w;if((0,z.alwaysValidSchema)(G,V))J.var(Z,!0);else w=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),w)Q.mergeEvaluated(w,Y.Name)})})}}};$.default=U}),mb0=C0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=v1(),z={keyword:"allOf",schemaType:"array",code(U){let{gen:Q,schema:J,it:I}=U;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=U.subschema({keyword:"allOf",schemaProp:H},K);U.ok(K),U.mergeEvaluated(W)})}};$.default=z}),lb0=C0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=F1(),z=v1(),U={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,z.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,w){return()=>{let O=J.subschema({keyword:F},Z);if(I.assign(X,Z),J.mergeValidEvaluated(O,X),w)I.assign(w,Y._`${F}`);else J.setParams({ifClause:F})}}}};function Q(J,I){let K=J.schema[I];return K!==void 0&&!(0,z.alwaysValidSchema)(J,K)}$.default=U}),ob0=C0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=v1(),z={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:U,parentSchema:Q,it:J}){if(Q.if===void 0)(0,Y.checkStrictMode)(J,`"${U}" without "if" is ignored`)}};$.default=z}),Ae=C0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=Me(),z=xb0(),U=Ne(),Q=fb0(),J=ub0(),I=DS(),K=bb0(),G=De(),H=ib0(),W=nb0(),X=cb0(),Z=pb0(),q=db0(),V=mb0(),F=lb0(),w=ob0();function O(N=!1){let M=[X.default,Z.default,q.default,V.default,F.default,w.default,K.default,G.default,I.default,H.default,W.default];if(N)M.push(z.default,Q.default);else M.push(Y.default,U.default);return M.push(J.default),M}$.default=O}),rb0=C0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=F1(),z={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:{message:({schemaCode:U})=>Y.str`must match format "${U}"`,params:({schemaCode:U})=>Y._`{format: ${U}}`},code(U,Q){let{gen:J,data:I,$data:K,schema:G,schemaCode:H,it:W}=U,{opts:X,errSchemaPath:Z,schemaEnv:q,self:V}=W;if(!X.validateFormats)return;if(K)F();else w();function F(){let O=J.scopeValue("formats",{ref:V.formats,code:X.code.formats}),N=J.const("fDef",Y._`${O}[${H}]`),M=J.let("fType"),D=J.let("format");J.if(Y._`typeof ${N} == "object" && !(${N} instanceof RegExp)`,()=>J.assign(M,Y._`${N}.type || "string"`).assign(D,Y._`${N}.validate`),()=>J.assign(M,Y._`"string"`).assign(D,N)),U.fail$data((0,Y.or)(P(),j()));function P(){if(X.strictSchema===!1)return Y.nil;return Y._`${H} && !${D}`}function j(){let A=q.$async?Y._`(${N}.async ? await ${D}(${I}) : ${D}(${I}))`:Y._`${D}(${I})`,T=Y._`(typeof ${D} == "function" ? ${A} : ${D}.test(${I}))`;return Y._`${D} && ${D} !== true && ${M} === ${Q} && !${T}`}}function w(){let O=V.formats[G];if(!O){P();return}if(O===!0)return;let[N,M,D]=j(O);if(N===Q)U.pass(A());function P(){if(X.strictSchema===!1){V.logger.warn(T());return}throw Error(T());function T(){return`unknown format "${G}" ignored in schema at path "${Z}"`}}function j(T){let C=T instanceof RegExp?(0,Y.regexpCode)(T):X.code.formats?Y._`${X.code.formats}${(0,Y.getProperty)(G)}`:void 0,b=J.scopeValue("formats",{key:G,ref:T,code:C});if(typeof T=="object"&&!(T instanceof RegExp))return[T.type||"string",T.validate,Y._`${b}.validate`];return["string",T,b]}function A(){if(typeof O=="object"&&!(O instanceof RegExp)&&O.async){if(!q.$async)throw Error("async format in sync schema");return Y._`await ${D}(${I})`}return typeof M=="function"?Y._`${D}(${I})`:Y._`${D}.test(${I})`}}}};$.default=z}),Be=C0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=[rb0().default];$.default=Y}),Pe=C0(($)=>{Object.defineProperty($,"__esModule",{value:!0}),$.contentVocabulary=$.metadataVocabulary=void 0,$.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"],$.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]}),je=C0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=Oe(),z=we(),U=Ae(),Q=Be(),J=Pe(),I=[Y.default,z.default,(0,U.default)(),Q.default,J.metadataVocabulary,J.contentVocabulary];$.default=I}),sb0=C0(($)=>{Object.defineProperty($,"__esModule",{value:!0}),$.DiscrError=void 0;var Y;(function(z){z.Tag="tag",z.Mapping="mapping"})(Y||($.DiscrError=Y={}))}),AS=C0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=F1(),z=sb0(),U=nO(),Q=bQ(),J=v1(),I={keyword:"discriminator",type:"object",schemaType:"object",error:{message:({params:{discrError:K,tagName:G}})=>K===z.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),w=G.const("tag",Y._`${H}${(0,Y.getProperty)(V)}`);G.if(Y._`typeof ${w} == "string"`,()=>O(),()=>K.error(!1,{discrError:z.DiscrError.Tag,tag:w,tagName:V})),K.ok(F);function O(){let D=M();G.if(!1);for(let P in D)G.elseIf(Y._`${w} === ${P}`),G.assign(F,N(D[P]));G.else(),K.error(!1,{discrError:z.DiscrError.Mapping,tag:w,tagName:V}),G.endIf()}function N(D){let P=G.name("valid"),j=K.subschema({keyword:"oneOf",schemaProp:D},P);return K.mergeEvaluated(j,Y.Name),P}function M(){var D;let P={},j=T(X),A=!0;for(let k=0;k{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}}),Te=C0(($,Y)=>{Object.defineProperty($,"__esModule",{value:!0}),$.MissingRefError=$.ValidationError=$.CodeGen=$.Name=$.nil=$.stringify=$.str=$._=$.KeywordCxt=$.Ajv=void 0;let z=wS(),U=je(),Q=AS(),J=ab0(),I=["/properties"],K="http://json-schema.org/draft-07/schema";var G=class extends z.default{_addVocabularies(){if(super._addVocabularies(),U.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=uQ();Object.defineProperty($,"KeywordCxt",{enumerable:!0,get:function(){return H.KeywordCxt}});var W=F1();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=OH();Object.defineProperty($,"ValidationError",{enumerable:!0,get:function(){return X.default}});var Z=bQ();Object.defineProperty($,"MissingRefError",{enumerable:!0,get:function(){return Z.default}})}),Ee=C0(($)=>{Object.defineProperty($,"__esModule",{value:!0}),$.dynamicAnchor=void 0;let Y=F1(),z=Q5(),U=nO(),Q=MS(),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._`${z.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:w}=X.opts,O=new U.SchemaEnv({schema:W,schemaId:w,root:Z,baseId:q,localRefs:V,meta:F});return U.compileSchema.call(X,O),(0,Q.getValidate)(G,O)}$.default=J}),Ce=C0(($)=>{Object.defineProperty($,"__esModule",{value:!0}),$.dynamicRef=void 0;let Y=F1(),z=Q5(),U=MS(),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._`${z.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,U.callRef)(I,V),G.let(F,!0)}):()=>(0,U.callRef)(I,V)}}$.dynamicRef=J,$.default=Q}),tb0=C0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=Ee(),z=v1(),U={keyword:"$recursiveAnchor",schemaType:"boolean",code(Q){if(Q.schema)(0,Y.dynamicAnchor)(Q,"");else(0,z.checkStrictMode)(Q.it,"$recursiveAnchor: false is ignored")}};$.default=U}),eb0=C0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=Ce(),z={keyword:"$recursiveRef",schemaType:"string",code:(U)=>(0,Y.dynamicRef)(U,U.schema)};$.default=z}),Re=C0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=Ee(),z=Ce(),U=tb0(),Q=eb0(),J=[Y.default,z.default,U.default,Q.default];$.default=J}),$i0=C0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=DS(),z={keyword:"dependentRequired",type:"object",schemaType:"object",error:Y.error,code:(U)=>(0,Y.validatePropertyDeps)(U)};$.default=z}),Yi0=C0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=DS(),z={keyword:"dependentSchemas",type:"object",schemaType:"object",code:(U)=>(0,Y.validateSchemaDeps)(U)};$.default=z}),zi0=C0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=v1(),z={keyword:["maxContains","minContains"],type:"array",schemaType:"number",code({keyword:U,parentSchema:Q,it:J}){if(Q.contains===void 0)(0,Y.checkStrictMode)(J,`"${U}" without "contains" is ignored`)}};$.default=z}),_e=C0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=$i0(),z=Yi0(),U=zi0(),Q=[Y.default,z.default,U.default];$.default=Q}),Ui0=C0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=F1(),z=v1(),U=Q5(),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,(w)=>I.if(V(Z,w),()=>q(w))));else if(Z!==!0)I.forIn("key",G,(w)=>Z===void 0?q(w):I.if(F(Z,w),()=>q(w)));W.props=!0,J.ok(Y._`${H} === ${U.default.errors}`);function q(w){if(K===!1){if(J.setParams({unevaluatedProperty:w}),J.error(),!X)I.break();return}if(!(0,z.alwaysValidSchema)(W,K)){let O=I.name("valid");if(J.subschema({keyword:"unevaluatedProperties",dataProp:w,dataPropType:z.Type.Str},O),!X)I.if((0,Y.not)(O),()=>I.break())}}function V(w,O){return Y._`!${w} || !${w}[${O}]`}function F(w,O){let N=[];for(let M in w)if(w[M]===!0)N.push(Y._`${O} !== ${M}`);return(0,Y.and)(...N)}}};$.default=Q}),Qi0=C0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=F1(),z=v1(),U={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,z.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:z.Type.Num},Z),!G.allErrors)J.if((0,Y.not)(Z),()=>J.break())})}}};$.default=U}),ve=C0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=Ui0(),z=Qi0(),U=[Y.default,z.default];$.default=U}),Ji0=C0(($,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"}]}}}}}),Ii0=C0(($,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:"#"}}}}}),Ki0=C0(($,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:"#"}}}}),Gi0=C0(($,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:{}}}}}),Hi0=C0(($,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"}}}}),Wi0=C0(($,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}}}}),Xi0=C0(($,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:[]}}}}),Zi0=C0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=Ji0(),z=Ii0(),U=Ki0(),Q=Gi0(),J=Hi0(),I=Wi0(),K=Xi0(),G=["/properties"];function H(W){return[Y,z,U,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}),qi0=C0(($,Y)=>{Object.defineProperty($,"__esModule",{value:!0}),$.MissingRefError=$.ValidationError=$.CodeGen=$.Name=$.nil=$.stringify=$.str=$._=$.KeywordCxt=$.Ajv2019=void 0;let z=wS(),U=je(),Q=Re(),J=_e(),I=ve(),K=AS(),G=Zi0(),H="https://json-schema.org/draft/2019-09/schema";var W=class extends z.default{constructor(F={}){super({...F,dynamicRef:!0,next:!0,unevaluated:!0})}_addVocabularies(){if(super._addVocabularies(),this.addVocabulary(Q.default),U.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:w}=this.opts;if(!w)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=uQ();Object.defineProperty($,"KeywordCxt",{enumerable:!0,get:function(){return X.KeywordCxt}});var Z=F1();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=OH();Object.defineProperty($,"ValidationError",{enumerable:!0,get:function(){return q.default}});var V=bQ();Object.defineProperty($,"MissingRefError",{enumerable:!0,get:function(){return V.default}})}),Vi0=C0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=Oe(),z=we(),U=Ae(),Q=Re(),J=_e(),I=ve(),K=Be(),G=Pe(),H=[Q.default,Y.default,z.default,(0,U.default)(!0),K.default,G.metadataVocabulary,G.contentVocabulary,J.default,I.default];$.default=H}),Li0=C0(($,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}}}}),Fi0=C0(($,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"}}}}}),Oi0=C0(($,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"}}}}),wi0=C0(($,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"}}}}),Mi0=C0(($,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"}}}}),Ni0=C0(($,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"}}}}),Di0=C0(($,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}}}}),Ai0=C0(($,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:[]}}}}),Bi0=C0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=Li0(),z=Fi0(),U=Oi0(),Q=wi0(),J=Mi0(),I=Ni0(),K=Di0(),G=Ai0(),H=["/properties"];function W(X){return[Y,z,U,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}),Pi0=C0(($,Y)=>{Object.defineProperty($,"__esModule",{value:!0}),$.MissingRefError=$.ValidationError=$.CodeGen=$.Name=$.nil=$.stringify=$.str=$._=$.KeywordCxt=$.Ajv2020=void 0;let z=wS(),U=Vi0(),Q=AS(),J=Bi0(),I="https://json-schema.org/draft/2020-12/schema";var K=class extends z.default{constructor(Z={}){super({...Z,dynamicRef:!0,next:!0,unevaluated:!0})}_addVocabularies(){if(super._addVocabularies(),U.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=uQ();Object.defineProperty($,"KeywordCxt",{enumerable:!0,get:function(){return G.KeywordCxt}});var H=F1();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=OH();Object.defineProperty($,"ValidationError",{enumerable:!0,get:function(){return W.default}});var X=bQ();Object.defineProperty($,"MissingRefError",{enumerable:!0,get:function(){return X.default}})}),ji0=C0(($)=>{Object.defineProperty($,"__esModule",{value:!0}),$.formatNames=$.fastFormats=$.fullFormats=void 0;function Y(k,S){return{validate:k,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:O,"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:M,int32:{type:"number",validate:j},int64:{type:"number",validate:A},float:{type:"number",validate:T},double:{type:"number",validate:T},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 z(k){return k%4===0&&(k%100!==0||k%400===0)}let U=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,Q=[0,31,28,31,30,31,30,31,31,30,31,30,31];function J(k){let S=U.exec(k);if(!S)return!1;let i=+S[1],n=+S[2],U0=+S[3];return n>=1&&n<=12&&U0>=1&&U0<=(n===2&&z(i)?29:Q[n])}function I(k,S){if(!(k&&S))return;if(k>S)return 1;if(k23||p>59||k&&!t)return!1;if(U0<=23&&x<=59&&d<60)return!0;let Y0=x-p*e,y=U0-g*e-(Y0<0?1:0);return(y===23||y===-1)&&(Y0===59||Y0===-1)&&d<61}}function H(k,S){if(!(k&&S))return;let i=new Date("2020-01-01T"+k).valueOf(),n=new Date("2020-01-01T"+S).valueOf();if(!(i&&n))return;return i-n}function W(k,S){if(!(k&&S))return;let i=K.exec(k),n=K.exec(S);if(!(i&&n))return;if(k=i[1]+i[2]+i[3],S=n[1]+n[2]+n[3],k>S)return 1;if(k=D}function A(k){return Number.isInteger(k)}function T(){return!0}let C=/[^\\]\\Z/;function b(k){if(C.test(k))return!1;try{return new RegExp(k),!0}catch(S){return!1}}}),Ti0=C0(($)=>{Object.defineProperty($,"__esModule",{value:!0}),$.formatLimitDefinition=void 0;let Y=Te(),z=F1(),U=z.operators,Q={formatMaximum:{okStr:"<=",ok:U.LTE,fail:U.GT},formatMinimum:{okStr:">=",ok:U.GTE,fail:U.LT},formatExclusiveMaximum:{okStr:"<",ok:U.LT,fail:U.GTE},formatExclusiveMinimum:{okStr:">",ok:U.GT,fail:U.LTE}},J={message:({keyword:K,schemaCode:G})=>z.str`should be ${Q[K].okStr} ${G}`,params:({keyword:K,schemaCode:G})=>z._`{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)w();else O();function w(){let M=G.scopeValue("formats",{ref:V.formats,code:q.code.formats}),D=G.const("fmt",z._`${M}[${F.schemaCode}]`);K.fail$data((0,z.or)(z._`typeof ${D} != "object"`,z._`${D} instanceof RegExp`,z._`typeof ${D}.compare != "function"`,N(D)))}function O(){let M=F.schema,D=V.formats[M];if(!D||D===!0)return;if(typeof D!="object"||D instanceof RegExp||typeof D.compare!="function")throw Error(`"${X}": format "${M}" does not define "compare" function`);let P=G.scopeValue("formats",{key:M,ref:D,code:q.code.formats?z._`${q.code.formats}${(0,z.getProperty)(M)}`:void 0});K.fail$data(N(P))}function N(M){return z._`${M}.compare(${H}, ${W}) ${Q[X].fail} 0`}},dependencies:["format"]};let I=(K)=>{return K.addKeyword($.formatLimitDefinition),K};$.default=I}),Ei0=C0(($,Y)=>{Object.defineProperty($,"__esModule",{value:!0});let z=ji0(),U=Ti0(),Q=F1(),J=new Q.Name("fullFormats"),I=new Q.Name("fastFormats"),K=(H,W={keywords:!0})=>{if(Array.isArray(W))return G(H,W,z.fullFormats,J),H;let[X,Z]=W.mode==="fast"?[z.fastFormats,I]:[z.fullFormats,J];if(G(H,W.formats||z.formatNames,X,Z),W.keywords)(0,U.default)(H);return H};K.get=(H,W="full")=>{let X=(W==="fast"?z.fastFormats:z.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}),he=Te(),Ci0=qi0(),Ri0=Pi0(),_i0=sq(Ei0(),1),vi0=_i0.default;qb1=he.Ajv});import BS from"node:process";var pO=m(()=>{Se()});function jS($){return!!$&&typeof $==="object"&&ne in $}function Si0($){return $[ne]?.complete}function gi0($,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 yi0($,Y){let z={},U=(Q)=>Y===void 0||Q===!0;if($.toolsListChanged===!0&&U(Y?.tools?.listChanged))z.toolsListChanged=!0;if($.promptsListChanged===!0&&U(Y?.prompts?.listChanged))z.promptsListChanged=!0;if($.resourcesListChanged===!0&&U(Y?.resources?.listChanged))z.resourcesListChanged=!0;if($.resourceSubscriptions!==void 0&&$.resourceSubscriptions.length>0&&U(Y?.resources?.subscribe))z.resourceSubscriptions=[...$.resourceSubscriptions];return z}function ge($,Y){return{method:$.method,params:{...$.params,_meta:{...$.params?._meta,[fY]:Y}}}}function ki0($){let Y=C7(LH).validateRequest("subscriptions/listen",$);return Y.ok?Y.value.params?.notifications:void 0}function fi0($,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 ii0($){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??ui0,roundTimeoutMs:$?.roundTimeoutMs??bi0,legacyShim:$?.legacyShim??!0}}function pe($,Y,z){if(z===null||typeof z!=="object"||typeof z.method!=="string")throw new J1(c0.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 U=z,Q=yt(U);if(Q===void 0)throw new J1(c0.InternalError,`Handler for ${$} returned an input request '${Y}' of kind '${U.method}', which is not an embedded request the 2026-07-28 revision defines`);return{embedded:U,required:Q}}function ni0(){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 z=[...Y].map((U)=>U.toString(16).padStart(2,"0")).join("");return`${z.slice(0,8)}-${z.slice(8,12)}-${z.slice(12,16)}-${z.slice(16,20)}-${z.slice(20)}`}function PS($,Y){if($==="tools/call")return{content:[{type:"text",text:Y}],isError:!0};throw new J1(c0.InternalError,Y)}function TS($,Y){de($,Y)}function ES($){return me($)}function mi0($){return{...$}}function ye($,Y){if($){let U=Y;return async(Q,J)=>U(Q,J)}let z=Y;return async(U,Q)=>z(Q)}function xe($){if($===void 0)return;try{return v7($,"output")}catch{return}}function fe($,Y,z){if(Y){let U=z;return async(Q,J)=>{let I=await iY(Y,Q);if(!I.success)throw new J1(c0.InvalidParams,`Invalid arguments for prompt ${$}: ${I.error}`);return U(I.data,J)}}else{let U=z;return async(Q,J)=>{return U(J)}}}function ue($){return{completion:{values:$.map(String).slice(0,100),total:$.length,hasMore:$.length>100}}}function be($){let Y=$;if(Y.shape&&typeof Y.shape==="object")return Y.shape}function li0($){return $?.type==="optional"}function ie($){if(!li0($))return $;return $.def?.innerType??$}var ne,dO=1024,xi0,ce=class{_subs=new Map;_serverCapabilities;_serverInfo;constructor($=dO,Y,z){this._maxSubscriptions=$,this._serverCapabilities=Y,this._serverInfo=z}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=ki0($);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 z=yi0(Y,this._serverCapabilities);return this._subs.set($.id,z),ge({method:"notifications/subscriptions/acknowledged",params:{notifications:z}},$.id)}cancel($){return this._subs.delete($)}routeOutbound($){if(!xi0.has($.method))return"passthrough";let Y=$.params?.uri,z=typeof Y==="string"?Y:void 0,U=fi0($.method,z),Q=[];for(let[J,I]of this._subs)if(gi0(I,U))Q.push(ge({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:{[fY]:Y,...this._serverInfo!==void 0&&{[o5]:this._serverInfo}}}});return this._subs.clear(),$}},ui0=8,bi0=600000,ci0=class{constructor($){this._host=$}async fulfill($,Y,z,U,Q){let{maxRounds:J,roundTimeoutMs:I}=this._host,K=U.mcpReq.signal,G=Q,H=0;while(!0){if(H+=1,H>J)return PS($,ze($,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(c0.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 w=this._host.resolvedClientCapabilities(U),O=[];for(let[M,D]of Object.entries(W)){let{embedded:P,required:j}=pe($,M,D);if(P.method!=="roots/list"&&P.params===void 0)throw new J1(c0.InternalError,`Handler for ${$} returned an input request '${M}' of kind '${P.method}' without params`);if(EO(j,w)!==void 0)return PS($,`Cannot request input '${M}' (${P.method}): the client on this 2025-era connection did not declare the required capability${w===void 0?" (no client capabilities are available on this connection — per-request legacy serving cannot receive server-to-client requests)":""}`);O.push([M,P])}let N=Qe(K);try{let M={relatedRequestId:U.mcpReq.id,timeout:I,resetTimeoutOnProgress:!0,onprogress:()=>{},signal:N.signal},D=await Promise.all(O.map(async([P,j])=>{try{return[P,await this._dispatchLeg(j,M)]}catch(A){throw N.abort(A),A}}));q=Object.fromEntries(D)}catch(M){if(K.aborted)throw M;return PS($,`Fulfilling input required by '${$}' failed: ${M instanceof Error?M.message:String(M)}`)}finally{N.dispose()}}else await Ue(Ye,K);let V={...U,mcpReq:{...U.mcpReq,inputResponses:q,droppedInputResponseKeys:void 0,requestState:FH(Z)}};if(Z!==void 0){let w=await this._host.verifyRequestState(Z,V,$);if(w!==void 0)V=WS(V,w)}let F=await Y(z,V);if(!t9(F))return F;G=F}}async _dispatchLeg($,Y){switch($.method){case"elicitation/create":{let z=$.params;if(z.mode==="url"&&z.elicitationId===void 0)z={...z,elicitationId:ni0()};return await this._host.sendElicitation(z,Y)}case"sampling/createMessage":return await this._host.sendSampling($.params,Y);case"roots/list":return await this._host.listRoots($.params,Y)}}},pi0,di0,de,me,le,MH=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 ke;try{let z=v7(Y.inputSchema,"input");return this._toolInputSchemaJson[$]=z,z}catch{return}}constructor($,Y){if(this.server=new le($,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 z={name:$,title:Y.title,description:Y.description,inputSchema:Y.inputSchema?v7(Y.inputSchema,"input"):ke,annotations:Y.annotations,icons:Y.icons,execution:Y.execution,_meta:Y._meta};if(Y.outputSchema)z.outputSchema=v7(Y.outputSchema,"output");return z})})),this.server.setRequestHandler("tools/call",async($,Y)=>{let z=this._registeredTools[$.params.name];if(!z)throw new J1(c0.InvalidParams,`Tool ${$.params.name} not found`);if(!z.enabled)throw new J1(c0.InvalidParams,`Tool ${$.params.name} disabled`);try{let U=await this.validateToolInput(z,$.params.arguments,$.params.name),Q=await this.executeToolHandler(z,U,Y);if(await this.validateToolOutput(z,Q,$.params.name),t9(Q))return Q;return this.server.projectCallToolResult(Q,z.outputSchemaJson)}catch(U){if(U instanceof J1&&U.code===c0.UrlElicitationRequired)throw U;return this.createToolError(U instanceof Error?U.message:String(U))}}),this._toolHandlersInitialized=!0}createToolError($){return{content:[{type:"text",text:$}],isError:!0}}async validateToolInput($,Y,z){if(!$.inputSchema)return;let U=await iY($.inputSchema,Y??{});if(!U.success)throw new J1(c0.InvalidParams,`Input validation error: Invalid arguments for tool ${z}: ${U.error}`);return U.data}async validateToolOutput($,Y,z){if(!$.outputSchema)return;if(t9(Y))return;if(Y.isError)return;if(Y.structuredContent===void 0)throw new J1(c0.InvalidParams,`Output validation error: Tool ${z} has an output schema but no structured content was provided`);let U=await iY($.outputSchema,Y.structuredContent);if(!U.success)throw new J1(c0.InvalidParams,`Output validation error: Invalid structured content for tool ${z}: ${U.error}`)}async executeToolHandler($,Y,z){return $.executor(Y,z)}_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 QS($),this.handlePromptCompletion($,$.params.ref);case"ref/resource":return JS($),this.handleResourceCompletion($,$.params.ref);default:throw new J1(c0.InvalidParams,`Invalid completion reference: ${$.params.ref}`)}}),this._completionHandlerInitialized=!0}async handlePromptCompletion($,Y){let z=this._registeredPrompts[Y.name];if(!z)throw new J1(c0.InvalidParams,`Prompt ${Y.name} not found`);if(!z.enabled)throw new J1(c0.InvalidParams,`Prompt ${Y.name} disabled`);if(!z.argsSchema)return wH;let U=ie(be(z.argsSchema)?.[$.params.argument.name]);if(!jS(U))return wH;let Q=Si0(U);if(!Q)return wH;return ue(await Q($.params.argument.value,$.params.context))}async handleResourceCompletion($,Y){let z=Object.values(this._registeredResourceTemplates).find((Q)=>Q.resourceTemplate.uriTemplate.toString()===Y.uri);if(!z){if(this._registeredResources[Y.uri])return wH;throw new J1(c0.InvalidParams,`Resource template ${$.params.ref.uri} not found`)}let U=z.resourceTemplate.completeCallback($.params.argument.name);if(!U)return wH;return ue(await U($.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 z=Object.entries(this._registeredResources).filter(([Q,J])=>J.enabled).map(([Q,J])=>({uri:Q,name:J.name,...J.metadata})),U=[];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)U.push({...Q.metadata,...I})}return{resources:[...z,...U]}}),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 z;try{z=new URL($.params.uri)}catch{throw new J1(c0.InvalidParams,`Resource URI ${$.params.uri} is invalid`,{uri:$.params.uri,reason:"invalid_uri"})}let U=this._registeredResources[z.toString()];if(U){if(!U.enabled)throw new J1(c0.InvalidParams,`Resource ${z} disabled`);return CO(await U.readCallback(z,Y),U.cacheHint)}for(let Q of Object.values(this._registeredResourceTemplates)){let J=Q.resourceTemplate.uriTemplate.match(z.toString());if(J)return CO(await Q.readCallback(z,J,Y),Q.cacheHint)}throw new RO($.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?$e(Y.argsSchema):void 0,icons:Y.icons,_meta:Y._meta}})})),this.server.setRequestHandler("prompts/get",async($,Y)=>{let z=this._registeredPrompts[$.params.name];if(!z)throw new J1(c0.InvalidParams,`Prompt ${$.params.name} not found`);if(!z.enabled)throw new J1(c0.InvalidParams,`Prompt ${$.params.name} disabled`);return z.handler($.params.arguments,Y)}),this._promptHandlersInitialized=!0}registerResource($,Y,z,U){let Q=z.cacheHint,J=z;if(Q!==void 0){YS(Q,`resource ${$}`);let I={...z};delete I.cacheHint,J=I}if(typeof Y==="string"){if(this._registeredResources[Y])throw Error(`Resource ${Y} is already registered`);let I=this._createRegisteredResource($,z.title,Y,J,U);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($,z.title,Y,J,U);if(Q!==void 0)I.cacheHint=Q;return this.setResourceRequestHandlers(),this.sendResourceListChanged(),I}}_createRegisteredResource($,Y,z,U,Q){let J={name:$,title:Y,metadata:U,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!==z){if(delete this._registeredResources[z],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[z]=J,J}_createRegisteredResourceTemplate($,Y,z,U,Q){let J={resourceTemplate:z,title:Y,metadata:U,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=z.uriTemplate.variableNames;if(Array.isArray(I)&&I.some((K)=>!!z.completeCallback(K)))this.setCompletionRequestHandler();return J}_createRegisteredPrompt($,Y,z,U,Q,J,I){let K=U,G=Q,H={title:Y,description:z,argsSchema:U,icons:J,_meta:I,handler:fe($,U,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,U){let W=be(U);if(W){if(Object.values(W).some((X)=>{return jS(ie(X))}))this.setCompletionRequestHandler()}}return H}_createRegisteredTool($,Y,z,U,Q,J,I,K,G,H){if(FS($),U!==void 0)try{let Z=v7(U,"input");this._toolInputSchemaJson[$]=Z;let q=IS(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:z,inputSchema:U,outputSchema:Q,outputSchemaJson:xe(Q),annotations:J,icons:I,execution:K,_meta:G,handler:H,executor:ye(U,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")FS(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=ye(X.inputSchema,W);if(Z.outputSchema!==void 0)X.outputSchema=Z.outputSchema,X.outputSchemaJson=xe(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,z){if(this._registeredTools[$])throw Error(`Tool ${$} is already registered`);let{title:U,description:Q,inputSchema:J,outputSchema:I,annotations:K,icons:G,_meta:H}=Y;return this._createRegisteredTool($,U,Q,kO(J),kO(I),K,G,void 0,H,z)}registerPrompt($,Y,z){if(this._registeredPrompts[$])throw Error(`Prompt ${$} is already registered`);let{title:U,description:Q,argsSchema:J,icons:I,_meta:K}=Y,G=this._createRegisteredPrompt($,U,Q,kO(J),z,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()}},ke,wH;var CS=m(()=>{xO();pO();ne=Symbol.for("mcp.completable");xi0=new Set(["notifications/tools/list_changed","notifications/prompts/list_changed","notifications/resources/list_changed","notifications/resources/updated"]);pi0=new Set(["tools/call","prompts/get","resources/read"]);le=class extends ZS{_clientCapabilities;_clientVersion;static{di0=($,Y)=>{if(Y.clientCapabilities!==void 0)$._clientCapabilities=Y.clientCapabilities;if(Y.clientInfo!==void 0)$._clientVersion=Y.clientInfo},de=($,Y)=>{let z=Y.filter((U)=>!$._supportedProtocolVersions.includes(U));if(z.length>0)$._supportedProtocolVersions=[...$._supportedProtocolVersions,...z];$.setRequestHandler("server/discover",()=>$._ondiscover())},me=($)=>$._serverInfo}_capabilities;_instructions;_jsonSchemaValidator;_cacheHints;_requestStateVerify;_inputRequiredServing;_legacyShim;_legacyInputRequiredShim(){return this._legacyShim??=new ci0({maxRounds:this._inputRequiredServing.maxRounds,roundTimeoutMs:this._inputRequiredServing.roundTimeoutMs,resolvedClientCapabilities:($)=>this._inputRequestCapabilityView($),verifyRequestState:($,Y,z)=>this._verifyRequestState($,Y,z),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 cO,this._requestStateVerify=Y?.requestState?.verify,this._inputRequiredServing=ii0(Y?.inputRequired),Y?.cacheHints!==void 0){for(let[z,U]of Object.entries(Y.cacheHints))if(U!==void 0)YS(U,`cacheHints['${z}']`);this._cacheHints=Y.cacheHints}if(this.setRequestHandler("initialize",(z)=>this._oninitialize(z)),this.setNotificationHandler("notifications/initialized",()=>this.oninitialized?.()),rh(this._supportedProtocolVersions).length>0)this.setRequestHandler("server/discover",()=>this._ondiscover());if(this._capabilities.logging)this._registerLoggingHandler()}_registerLoggingHandler(){this.setRequestHandler("logging/setLevel",async($,Y)=>{let z=Y.sessionId||Y.http?.req?.headers.get("mcp-session-id")||void 0,{level:U}=$.params,Q=yO(T7,U);if(Q.success)this._loggingLevels.set(z,Q.data);return{}})}buildContext($,Y){let z=$.http||Y?.request||Y?.closeSSEStream||Y?.closeStandaloneSSEStream;return{...$,mcpReq:{...$.mcpReq,log:(U,Q,J)=>{if(!this._capabilities.logging)return Promise.resolve();let I;if(this._servedModernEra()){if(I=$.mcpReq.envelope?.[N7],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(U)this.elicitInput(U,Q),requestSampling:(U,Q)=>this.createMessage(U,Q)},http:z?{...$.http,req:Y?.request,closeSSE:Y?.closeSSEStream,closeStandaloneSSE:Y?.closeStandaloneSSEStream}:void 0}}_loggingLevels=new Map;LOG_LEVEL_SEVERITY=new Map(T7.options.map(($,Y)=>[$,Y]));isMessageIgnored=($,Y)=>{let z=this._loggingLevels.get(Y);return z?this.LOG_LEVEL_SEVERITY.get($){let I=await Y(Q,J);if(t9(I))throw new J1(c0.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=U?await this._invokeInputRequiredCapableHandler($,Y,Q,J):await Y(Q,J);if(t9(I)){if(!U)throw new J1(c0.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 z===void 0?I:CO(I,z)}}return async(z,U)=>{let Q=C7(this._negotiatedProtocolVersion),J=Q.validateRequest("tools/call",z);if(!J.ok)throw new J1(J.reason==="not-in-era"?c0.InternalError:c0.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,z,U);if(t9(I))return I;let K=sh(I),G=Q.validateResult("tools/call",K);if(!G.ok)throw new J1(G.reason==="not-in-era"?c0.InternalError:c0.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&&xQ(this._negotiatedProtocolVersion)}async _invokeInputRequiredCapableHandler($,Y,z,U){let Q=this._servedModernEra(),J=U.mcpReq.requestState();if(J!==void 0&&typeof J!=="string")throw new J1(c0.InvalidParams,"Invalid or expired requestState",{reason:"invalid_request_state"});let I=U;if(typeof J==="string"){let X=await this._verifyRequestState(J,U,$);if(X!==void 0)I=WS(U,X)}let K;try{K=await Y(z,I)}catch(X){if(X instanceof J1&&X.code===c0.UrlElicitationRequired){if(!Q)throw X;throw new J1(c0.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(!t9(K))return K;if(!Q){if(!this._inputRequiredServing.legacyShim)throw new J1(c0.InternalError,`Handler for ${$} returned an input-required result, but this request is served on protocol revision ${this._negotiatedProtocolVersion??xY}, which has no input_required vocabulary`);return await this._legacyInputRequiredShim().fulfill($,Y,z,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(c0.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(U);for(let[Z,q]of Object.entries(G)){let{embedded:V,required:F}=pe($,Z,q),w=EO(F,X);if(w!==void 0)throw new _O({requiredCapabilities:w},`Cannot request input '${Z}' (${V.method}): the request's client capabilities do not declare the required capability`)}}return K}async _verifyRequestState($,Y,z){if(this._requestStateVerify===void 0)return;try{return await this._requestStateVerify($,Y)}catch(U){throw this.onerror?.(Error(`requestState verification rejected ${z}: ${U instanceof Error?U.message:String(U)}`)),new J1(c0.InvalidParams,"Invalid or expired requestState",{reason:"invalid_request_state"})}}_inputRequestCapabilityView($){return this._servedModernEra()?$.mcpReq.envelope?.[s9]:this._clientCapabilities}_assertPushApiInServedEra($){if(this._servedModernEra())throw new L1(B1.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 L1(B1.CapabilityNotSupported,`Client does not support sampling (required for ${$})`);break;case"elicitation/create":if(!this._clientCapabilities?.elicitation)throw new L1(B1.CapabilityNotSupported,`Client does not support elicitation (required for ${$})`);break;case"roots/list":if(!this._clientCapabilities?.roots)throw new L1(B1.CapabilityNotSupported,`Client does not support listing roots (required for ${$})`);break;case"ping":break}}assertNotificationCapability($){switch($){case"notifications/message":if(!this._capabilities.logging)throw new L1(B1.CapabilityNotSupported,`Server does not support logging (required for ${$})`);break;case"notifications/resources/updated":case"notifications/resources/list_changed":if(!this._capabilities.resources)throw new L1(B1.CapabilityNotSupported,`Server does not support notifying about resources (required for ${$})`);break;case"notifications/tools/list_changed":if(!this._capabilities.tools)throw new L1(B1.CapabilityNotSupported,`Server does not support notifying of tool list changes (required for ${$})`);break;case"notifications/prompts/list_changed":if(!this._capabilities.prompts)throw new L1(B1.CapabilityNotSupported,`Server does not support notifying of prompt list changes (required for ${$})`);break;case"notifications/elicitation/complete":if(!this._clientCapabilities?.elicitation?.url)throw new L1(B1.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 L1(B1.CapabilityNotSupported,`Server does not support completions (required for ${$})`);break;case"logging/setLevel":if(!this._capabilities.logging)throw new L1(B1.CapabilityNotSupported,`Server does not support logging (required for ${$})`);break;case"prompts/get":case"prompts/list":if(!this._capabilities.prompts)throw new L1(B1.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 L1(B1.CapabilityNotSupported,`Server does not support resources (required for ${$})`);break;case"tools/call":case"tools/list":if(!this._capabilities.tools)throw new L1(B1.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 z=xt(this._supportedProtocolVersions),U=z.includes(Y)?Y:z[0]??xY;return this._negotiatedProtocolVersion=U,this.transport?.setProtocolVersion?.(U),{protocolVersion:U,capabilities:this.getCapabilities(),serverInfo:this._serverInfo,...this._instructions&&{instructions:this._instructions}}}_ondiscover(){return{supportedVersions:rh(this._supportedProtocolVersions),capabilities:mi0(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 L1(B1.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(c0.InvalidParams,"The last message must contain only tool_result content if any is present");if(!W)throw new J1(c0.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(c0.InvalidParams,"ids of tool_result blocks and tool_use blocks from previous message do not match")}}let z=Boolean($.tools||$.toolChoice),U=await this.request({method:"sampling/createMessage",params:$},Y),Q=this._wireCodec().samplingResultVariant(z,U);if(!Q.ok)throw new L1(B1.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 L1(B1.CapabilityNotSupported,"Client does not support url elicitation.");break;case"form":if(!this._clientCapabilities?.elicitation?.form)throw new L1(B1.CapabilityNotSupported,"Client does not support form elicitation.");break}return this._sendElicitationLeg($,Y)}async _sendElicitationLeg($,Y,z){let U=$.mode??"form",Q=z?.validateAcceptedContent??!0;switch(U){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(c0.InvalidParams,`Elicitation response content does not match requested schema: ${K.errorMessage}`)}catch(K){if(K instanceof J1)throw K;throw new J1(c0.InternalError,`Error validating elicitation response: ${K instanceof Error?K.message:String(K)}`)}return I}}}createElicitationCompletionNotifier($,Y){if(!this._clientCapabilities?.elicitation?.url)throw new L1(B1.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"})}};ke={type:"object",properties:{}};wH={completion:{values:[],hasMore:!1}}});var oe=m(()=>{CS();xO();pO()});function si0($){let Y=$.params;if($.method==="initialize"&&!KS(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(!vO(Y))return{kind:"legacy",reason:"no-claim"};let z=cY(Y),U=(z===void 0?[]:SO(z))[0];if(U!==void 0)return{kind:"invalid-envelope",issue:U};let Q=hO(Y);if(Q===void 0||!R7.includes(Q))return{kind:"unsupported-revision",requested:Q??"unknown"};return{kind:"modern",revision:Q,classification:{era:"modern",revision:Q}}}function se($,Y={}){let z=Y.legacy??"serve",U=Y.transport??new oi0,Q={phase:"opening"},J,I=!1,K=()=>I||Q.phase==="closed",G=(T)=>{try{Y.onerror?.(T)}catch{}},H=(T,C,b,k)=>U.send({jsonrpc:"2.0",id:T,error:{code:C,message:b,...k!==void 0&&{data:k}}}).catch((S)=>G(I5(S))),W=new ce(Y.maxSubscriptions??dO),X=(T)=>{if(!_7(T))return;let C=W.routeOutbound(T);if(C==="passthrough")return;for(let b of C)U.send({jsonrpc:"2.0",...b}).catch((k)=>G(I5(k)));return"handled"},Z=async(T)=>{if(B$(T)&&T.method==="subscriptions/listen"){let C=cY(T.params),b=vO(T.params)?(C===void 0?[]:SO(C))[0]:{key:"_meta",problem:"the per-request envelope is required on protocol revision 2026-07-28"},k=hO(T.params),S;if(b!==void 0)S={jsonrpc:"2.0",id:T.id,error:{code:-32602,message:`Invalid _meta envelope: ${b.key}: ${b.problem}`}};else if(k===void 0||!R7.includes(k)){let i=new fQ({supported:[...R7],requested:k??"unknown"});S={jsonrpc:"2.0",id:T.id,error:{code:i.code,message:i.message,data:i.data}}}else S=W.serve(T);return await U.send("error"in S?S:{jsonrpc:"2.0",method:S.method,params:S.params}).catch((i)=>G(I5(i))),!0}if(_7(T)&&T.method==="notifications/cancelled"){let C=T.params?.requestId;if(C!==void 0&&W.cancel(C))return!0}return!1},q=(T,C,b)=>{let k=GS({kind:"legacy",reason:C,...b!==void 0&&{requestedVersion:b}},R7);if(k===void 0)return Promise.resolve();return G(Error(`Rejected 2025-era request on a modern-only stdio connection (${k.cell}): ${k.message}`)),H(T.id,k.code,k.message,k.data)},V=(T)=>{if(I||T===J)return;j()},F=async(T,C)=>{let b=await $({era:T}),k=b instanceof MH?b.server:b;if(T==="modern")XS(k,C),TS(k,R7),W.setServerCapabilities(k.getCapabilities(),ES(k));let S=new ri0(U,()=>V(S),T==="modern"?X:void 0);return await b.connect(S),{product:b,channel:S}},w=(T)=>T.product.close().catch((C)=>G(I5(C))),O=async(T)=>{J=T.channel;try{if(!await T.channel.whenRequestsAnswered(re))G(Error(`Discarded the probe instance with requests still unanswered after ${re}ms; continuing with the fallback`));await T.product.close()}catch(C){G(I5(C))}finally{J=void 0}},N=async(T)=>{if(Q.phase==="closed")return;if(Q.phase==="pinned"){if(Q.era==="modern"&&B$(T)&&T.method==="initialize"&&!KS(T.params)){await q(T,"initialize",T.params!==null&&typeof T.params==="object"&&typeof T.params.protocolVersion==="string"?T.params.protocolVersion:void 0);return}if(Q.era==="modern"&&await Z(T))return;Q.instance.channel.deliver(T);return}if(!B$(T)&&!_7(T)){G(Error("Discarded a JSON-RPC response received before the connection negotiated an era"));return}let C=si0(T);switch(C.kind){case"invalid-envelope":{let b=`Invalid _meta envelope for protocol revision 2026-07-28: ${C.issue.key}: ${C.issue.problem}`;if(B$(T))await H(T.id,c0.InvalidParams,b,{envelope:C.issue});else G(Error(`Discarded a notification with a malformed envelope: ${b}`));return}case"unsupported-revision":if(B$(T)){let b=new fQ({supported:[...R7],requested:C.requested});G(b),await H(T.id,b.code,b.message,b.data)}else G(Error(`Discarded a notification claiming unsupported protocol revision ${C.requested}`));return;case"modern":if(B$(T)&&T.method==="server/discover"){if(Q.phase==="probe"){Q.instance.channel.deliver(T,{classification:C.classification});return}let b=await F("modern",C.revision);if(K()){await w(b);return}Q={phase:"probe",instance:b},b.channel.deliver(T,{classification:C.classification});return}if(Q.phase==="probe"){if(_7(T)){Q.instance.channel.deliver(T,{classification:C.classification});return}Q={phase:"pinned",era:"modern",instance:Q.instance}}else{let b=await F("modern",C.revision);if(K()){await w(b);return}Q={phase:"pinned",era:"modern",instance:b}}if(await Z(T))return;Q.instance.channel.deliver(T,{classification:C.classification});return;case"legacy":{if(z==="reject"){if(B$(T))await q(T,C.reason,C.requestedVersion);return}if(Q.phase==="probe"){if(await O(Q.instance),K())return;Q={phase:"opening"}}let b=await F("legacy");if(K()){await w(b);return}Q={phase:"pinned",era:"legacy",instance:b},Q.instance.channel.deliver(T);return}}},M=[],D=!1,P=async()=>{if(D)return;D=!0;try{while(M.length>0){let T=M.shift();try{await N(T)}catch(C){if(B$(T))await H(T.id,c0.InternalError,"Internal server error");G(I5(C))}}}finally{D=!1}},j=async()=>{if(I||Q.phase==="closed")return;I=!0;let T=Q;Q={phase:"closed"};for(let C of W.teardownAll())await U.send(C).catch((b)=>G(I5(b)));if(T.phase==="probe"||T.phase==="pinned")await T.instance.product.close().catch((C)=>G(I5(C)));await U.close().catch((C)=>G(I5(C)))};U.onmessage=(T)=>{M.push(T),P()},U.onerror=(T)=>{if(G(T),Q.phase==="probe"||Q.phase==="pinned")Q.instance.channel.onerror?.(T)},U.onclose=()=>{if(I||Q.phase==="closed")return;I=!0;let T=Q;if(Q={phase:"closed"},T.phase==="probe"||T.phase==="pinned")T.instance.product.close().catch((C)=>G(I5(C)))};let A=U.start().catch((T)=>{throw G(I5(T)),T});return A.catch(()=>{}),{close:async()=>{await A.catch(()=>{}),await j()}}}function I5($){return $ instanceof Error?$:Error(String($))}var oi0=class{_readBuffer;_started=!1;_closed=!1;constructor($=BS.stdin,Y=BS.stdout,z){this._stdin=$,this._stdout=Y,this._readBuffer=new VS({maxBufferSize:z?.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,z)=>{let U=LS($),Q=!1,J=(K)=>{if(Q)return;Q=!0,this._stdout.off("error",J),this._stdout.off("drain",I),z(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(U)){if(Q)return;Q=!0,this._stdout.off("error",J),Y()}else if(!Q)this._stdout.once("drain",I)})}},re=3000,ri0=class{onclose;onerror;onmessage;_closed=!1;_pendingRequests=new Set;_drainWaiters=[];constructor($,Y,z){this._wire=$,this._onInstanceClose=Y,this._outboundIntercept=z}async start(){}async send($,Y){if(qH($)||gO($)){let{id:z}=$;if(z!==void 0)this._settle(z)}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(B$($))this._pendingRequests.add($.id);else if(_7($)&&$.method==="notifications/cancelled"){let z=$.params?.requestId;if(z!==void 0)this._settle(z)}this.onmessage?.($,Y)}async whenRequestsAnswered($){if(this._closed||this._pendingRequests.size===0)return!0;return await new Promise((Y)=>{let z=()=>{clearTimeout(U),Y(!0)},U=setTimeout(()=>{this._drainWaiters=this._drainWaiters.filter((Q)=>Q!==z),Y(!1)},$);this._drainWaiters.push(z)})}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 ae=m(()=>{CS();xO();pO()});var P$=m(()=>{vL();vL()});var e9;var NH=m(()=>{e9=class e9 extends Error{name="KyError";get isKyError(){return!0}}});var D6;var mO=m(()=>{NH();D6=class D6 extends e9{name="HTTPError";response;request;options;data;constructor($,Y,z){let U=$.status||$.status===0?$.status:"",Q=$.statusText??"",J=`${U} ${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=z}}});var DH;var RS=m(()=>{NH();DH=class DH extends e9{name="NetworkError";request;constructor($,Y){super(`Request failed due to a network error: ${$.method} ${$.url}`,Y);this.request=$}}});var AH;var _S=m(()=>{AH=class AH 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 iQ;var te=m(()=>{NH();_S();iQ=class iQ extends e9{name="ForceRetryError";customDelay;code;customRequest;constructor($){let Y=$?.cause?$.cause instanceof Error?$.cause:new AH($.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 vS;var ee=m(()=>{vS=class vS extends Error{name="SchemaValidationError";issues;constructor($){super("Response schema validation failed");this.issues=$}}});var K5;var lO=m(()=>{NH();K5=class K5 extends e9{name="TimeoutError";request;constructor($){super(`Request timed out: ${$.method} ${$.url}`);this.request=$}}});class aO{options;constructor($){this.options=$}}var hS,$00,oO,Y00,z00,rO,ai0=()=>{return},U00,nQ=2147483647,Q00=40,sO,J00=($)=>new aO($),I00,K00;var pY=m(()=>{hS=(()=>{let $=!1,Y=!1,z=typeof globalThis.ReadableStream==="function",U=typeof globalThis.Request==="function";if(z&&U)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})(),$00=typeof globalThis.AbortController==="function",oO=typeof globalThis.AbortSignal==="function"&&typeof globalThis.AbortSignal.any==="function",Y00=typeof globalThis.ReadableStream==="function",z00=typeof globalThis.FormData==="function",rO=["get","post","put","patch","head","delete"];ai0();U00={json:"application/json",text:"text/*",formData:"multipart/form-data",arrayBuffer:"*/*",blob:"*/*",bytes:"*/*"},sO=Symbol("stop");I00={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},K00={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 tO,ti0=($)=>{if(!$)return 0;if($ instanceof FormData){let Y=0;for(let[z,U]of $)Y+=Q00,Y+=tO.encode(`Content-Disposition: form-data; name="${z}"`).byteLength,Y+=typeof U==="string"?tO.encode(U).byteLength:U.size;return Y}if($ instanceof Blob)return $.size;if($ instanceof ArrayBuffer||ArrayBuffer.isView($))return $.byteLength;if(typeof $==="string")return tO.encode($).byteLength;if($ instanceof URLSearchParams)return tO.encode($.toString()).byteLength;return 0},G00=($,Y,z)=>{let U,Q=0;return $.pipeThrough(new TransformStream({transform(J,I){if(I.enqueue(J),U){Q+=U.byteLength;let K=Y===0?0:Q/Y;if(K>=1)K=1-Number.EPSILON;z?.({percent:K,totalBytes:Math.max(Y,Q),transferredBytes:Q},U)}U=J},flush(){if(U)Q+=U.byteLength,z?.({percent:1,totalBytes:Math.max(Y,Q),transferredBytes:Q},U)}}))},H00=($,Y)=>{if(!$.body)return $;let z={status:$.status,statusText:$.statusText,headers:$.headers};if($.status===204)return new Response(null,z);let U=Math.max(0,Number($.headers.get("content-length"))||0);return new Response(G00($.body,U,Y),z)},W00=($,Y,z)=>{if(!$.body)return $;let U=ti0(z??$.body);return new Request($,{duplex:"half",body:G00($.body,U,Y)})};var X00=m(()=>{pY();tO=new TextEncoder});var r5=($)=>$!==null&&typeof $==="object";function BH($,Y,z){return Object.hasOwn(Y,z)&&Y[z]===void 0?[]:kS($[z]??[],Y[z]??[])}var ei0,SS=($)=>r5($)&&$[ei0]===!0?{isReplace:!0,value:$.value}:{isReplace:!1,value:$},PH=(...$)=>{for(let Y of $)if((!r5(Y)||Array.isArray(Y))&&Y!==void 0)throw TypeError("The `options` argument must be an object");return kS({},...$)},yS=($={},Y={})=>{let z=new globalThis.Headers($),U=Y instanceof globalThis.Headers,Q=new globalThis.Headers(Y);for(let[J,I]of Q.entries())if(U&&I==="undefined"||I===void 0)z.delete(J);else z.set(J,I);return z},gS=($)=>{if(!r5($)||Array.isArray($))return!1;let Y=Object.getPrototypeOf($);return Y===Object.prototype||Y===null},cQ=($)=>{if($ instanceof URLSearchParams){let Y=new URLSearchParams($),z=$[h7];if(z)Y[h7]=new Set(z);return Y}if($ instanceof globalThis.Headers)return new globalThis.Headers($);if(Array.isArray($))return[...$];if(gS($))return{...$};return $},$n0=($)=>Object.fromEntries(Object.entries($).filter((Y)=>Y[1]!==void 0)),Yn0=($,Y)=>{if(gS($)&&gS(Y))return $n0({...$,...Y});return yS($,Y)},eO=($={},Y={})=>({init:BH($,Y,"init"),beforeRequest:BH($,Y,"beforeRequest"),beforeRetry:BH($,Y,"beforeRetry"),beforeError:BH($,Y,"beforeError"),afterResponse:BH($,Y,"afterResponse")}),h7,zn0=($,Y)=>{let z=new URLSearchParams,U=new Set;for(let Q of[$,Y]){if(Q===void 0)continue;if(Q instanceof URLSearchParams){for(let[I,K]of Q.entries())z.append(I,K),U.delete(I);let J=Q[h7];if(J)for(let I of J)z.delete(I),U.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");z.append(String(J[0]),String(J[1])),U.delete(String(J[0]))}else if(r5(Q))for(let[J,I]of Object.entries(Q))if(I===void 0)z.delete(J),U.add(J);else z.append(J,String(I)),U.delete(J);else{let J=new URLSearchParams(Q);for(let[I,K]of J.entries())z.append(I,K),U.delete(I)}}if(U.size>0)z[h7]=U;return z},kS=(...$)=>{let Y={},z={},U={},Q,J=[];for(let I of $)if(Array.isArray(I)){if(!Array.isArray(Y))Y=[];Y=[...Y,...I]}else if(r5(I)){for(let[K,G]of Object.entries(I)){if(K==="signal"&&G instanceof globalThis.AbortSignal){J.push(G);continue}let H=SS(G),{isReplace:W}=H;if(G=H.value,K==="context"){if(G!==void 0&&G!==null&&(!r5(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:zn0(Q,G);continue}if(r5(G)&&!W&&K in Y)G=kS(Y[K],G);Y={...Y,[K]:G}}if(r5(I.hooks)){let{value:K,isReplace:G}=SS(I.hooks);U=G?eO({},K):eO(U,K),Y.hooks=U}if(r5(I.headers)){let{value:K,isReplace:G}=SS(I.headers);z=G?cQ(K):Yn0(z,K),Y.headers=z}}if(Q!==void 0)Y.searchParams=Q;if(J.length>0)if(J.length===1)Y.signal=J[0];else if(oO)Y.signal=AbortSignal.any(J);else Y.signal=J.at(-1);return Y};var $w=m(()=>{pY();ei0=Symbol("replaceOption");h7=Symbol("deletedParameters")});var q00=($)=>rO.includes($)?$.toUpperCase():$,Un0,Qn0,Jn0,Z00,V00=($={})=>{if(typeof $==="number")return{...Z00,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((z)=>z.toLowerCase())}).filter(([,z])=>z!==void 0));return{...Z00,...Y}};var L00=m(()=>{pY();Un0=["get","put","head","delete","options","trace"],Qn0=[408,413,429,500,502,503,504],Jn0=[413,429,503],Z00={limit:2,methods:Un0,statusCodes:Qn0,afterStatusCodes:Jn0,maxRetryAfter:Number.POSITIVE_INFINITY,backoffLimit:Number.POSITIVE_INFINITY,delay:($)=>0.3*2**($-1)*1000,jitter:void 0,retryOnTimeout:!1}});async function xS($,Y,z,U){return new Promise((Q,J)=>{let I=setTimeout(()=>{if(z)z.abort();J(new K5($))},U.timeout);U.fetch($,Y).then(Q).catch(J).then(()=>{clearTimeout(I)})})}var F00=m(()=>{lO()});async function Yw($,{signal:Y}){return new Promise((z,U)=>{if(Y)Y.throwIfAborted(),Y.addEventListener("abort",Q,{once:!0});function Q(){clearTimeout(J),U(Y.reason)}let J=setTimeout(()=>{Y?.removeEventListener("abort",Q),z()},$)})}var O00=($)=>{let Y={};for(let z in $){if(!Object.hasOwn($,z))continue;if(!(z in K00)&&!(z in I00))Y[z]=$[z]}return Y},w00=($)=>{if($===void 0)return!1;if(Array.isArray($))return $.length>0;if($ instanceof URLSearchParams)return $.size>0||Boolean($[h7]?.size);if(typeof $==="object")return Object.keys($).length>0;if(typeof $==="string")return $.trim().length>0;return Boolean($)};var M00=m(()=>{pY();$w()});function fS($){if(!($&&Kn0($)&&$.name==="TypeError"&&typeof $.message==="string"))return!1;let{message:z,stack:U}=$;if(z==="Load failed")return U===void 0||"__sentry_captured__"in $;if(z.startsWith("error sending request for url"))return!0;if(z==="Failed to fetch"||z.startsWith("Failed to fetch (")&&z.endsWith(")"))return!0;return Gn0.has(z)}var In0,Kn0=($)=>In0.call($)==="[object Error]",Gn0;var N00=m(()=>{In0=Object.prototype.toString,Gn0=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 D00($){return uS($,D6)}function A00($){return uS($,DH)}function B00($){return uS($,K5)}var uS=($,Y)=>$ instanceof Y||$?.name===Y.name;var P00=m(()=>{mO();RS();lO()});function Vn0($){let Y={...$,json:cQ($.json),context:cQ($.context),headers:cQ($.headers),searchParams:qn0($.searchParams)};if($.retry!==void 0)Y.retry=Zn0($.retry);return Y}class pQ{static create($,Y){let z=Y.hooks?.init??[],U=z.length>0?Vn0(Y):Y;for(let K of z)K(U);let Q=new pQ($,U),J=async()=>{if(typeof Q.#$.timeout==="number"&&Q.#$.timeout>nQ)throw RangeError(`The \`timeout\` option cannot be greater than ${nQ}`);if(typeof Q.#$.totalTimeout==="number"&&Q.#$.totalTimeout>nQ)throw RangeError(`The \`totalTimeout\` option cannot be greater than ${nQ}`);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(TH(G))try{G=await Q.#y(G)}catch(X){if(!(X instanceof iQ))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.#M(W),Q.#w()),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(!TH(G))return G;if(Q.#V(G),Q.#$.onDownloadProgress){if(typeof Q.#$.onDownloadProgress!=="function")throw TypeError("The `onDownloadProgress` option must be a function");if(!Y00)throw Error("Streams are not supported in your environment. `ReadableStream` is missing.");let W=G.clone();return Q.#K(G),H00(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.#w(),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(U00)){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 E00(void 0,H);return JSON.parse(X)}let Z=U.parseJson?await U.parseJson(X,{request:Q.#M(W),response:W}):JSON.parse(X);return H===void 0?Z:E00(Z,H)}}return I}static#U($){if($&&typeof $==="object"&&!Array.isArray($)&&!($ instanceof URLSearchParams))return Object.fromEntries(Object.entries($).filter(([,Y])=>Y!==void 0));return $}request;#z;#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(Wn0);if(this.#$={...Y,headers:yS(this.#Y.headers,Y.headers),hooks:eO({},Y.hooks),method:q00(Y.method??this.#Y.method??"GET"),prefix:String(Y.prefix||""),retry:V00(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 U=this.#$.prefix.replace(/\/+$/,""),Q=this.#Y.replace(/^\/+/,"");this.#Y=`${U}/${Q}`}if(this.#$.baseUrl){let U;try{U=new URL(this.#Y)}catch{}if(!U)this.#Y=new URL(this.#Y,new Request(this.#$.baseUrl).url)}}if($00&&oO)this.#H=this.#$.signal??this.#Y.signal,this.#z=new globalThis.AbortController,this.#$.signal=this.#O();if(hS)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 z=Y.headers&&new globalThis.Headers(Y.headers).has("content-type");if(this.#Y instanceof globalThis.Request&&(z00&&this.#$.body instanceof globalThis.FormData||this.#$.body instanceof URLSearchParams)&&!z)this.#$.headers.delete("content-type");if(this.request=new globalThis.Request(this.#Y,this.#$),w00(this.#$.searchParams)){let U=new URL(this.request.url),Q=this.#$.searchParams?.[h7];if(Q)for(let J of Q)U.searchParams.delete(J);if(typeof this.#$.searchParams==="string"){let J=this.#$.searchParams.replace(/^\?/,"");if(J!=="")U.search=U.search?`${U.search}&${J}`:`?${J}`}else{let J=new URLSearchParams(pQ.#U(this.#$.searchParams));for(let[I,K]of J.entries())U.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)U.searchParams.delete(J)}this.request=new globalThis.Request(U,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 AH($);if(Y instanceof iQ)return Y.customDelay??this.#G();if(!this.#$.retry.methods.includes(this.request.method.toLowerCase()))throw $;if(this.#$.retry.shouldRetry!==void 0){let z=await this.#$.retry.shouldRetry({error:Y,retryCount:this.#Q+1});if(z===!1)throw $;if(z===!0)return this.#G()}if(B00($)){if(!this.#$.retry.retryOnTimeout)throw $;return this.#G()}if(D00($)){if(!this.#$.retry.statusCodes.includes($.response.status))throw $;let z=$.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(z&&this.#$.retry.afterStatusCodes.includes($.response.status)){let U=Number(z)*1000;if(Number.isNaN(U))U=Date.parse(z)-Date.now();else if(U>=Date.parse("2024-01-01"))U-=Date.now();if(!Number.isFinite(U))return Math.min(this.#$.retry.maxRetryAfter,this.#G());return U=Math.max(0,U),Math.min(this.#$.retry.maxRetryAfter,U)}if($.response.status===413)throw $;return this.#G()}if(!A00($))throw $;return this.#G()}#V($){let Y=this.#M($);if(this.#$.parseJson)$.json=async()=>{let z=await $.text();if(z==="")return JSON.parse(z);return this.#$.parseJson(z,{request:Y,response:$})};return $}async#L($){let Y=await this.#j($,this.#D());if(Y===jH){this.#q();return}if(!Y)return;if(!this.#A($.headers.get("content-type")??""))return Y;let z=await this.#T(Y,$,this.#D(),this.#M($));if(z===jH){this.#q();return}return z}#D(){let $=this.#$.timeout===!1?1e4:this.#$.timeout,Y=this.#B();if(Y===void 0)return $;if(Y<=0)throw new K5(this.request);return Math.min($,Y)}#A($){let Y=($.split(";",1)[0]??"").trim().toLowerCase();return/\/(?:.*[.+-])?json$/.test(Y)}async#j($,Y){let{body:z}=$;if(!z)try{return await $.text()}catch{return}let U;try{U=z.getReader()}catch{return}let Q=Xn0($.headers.get("content-type")??""),J=[],I=0,K=(async()=>{try{for(;;){let{done:W,value:X}=await U.read();if(W)break;if(I+=X.byteLength,I>Hn0){U.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(jH)},Y);K.finally(()=>{clearTimeout(X)})}),H=await Promise.race([K,G]);if(H===jH)U.cancel().catch(()=>{return});return H}async#T($,Y,z,U){let Q;try{return await Promise.race([Promise.resolve().then(()=>this.#$.parseJson?this.#$.parseJson($,{request:U,response:Y}):JSON.parse($)),new Promise((J)=>{Q=setTimeout(()=>{J(jH)},z)})])}catch{return}finally{clearTimeout(Q)}}#F($){if(!$)return;$.cancel().catch(()=>{return})}#K($){this.#F($.body??void 0)}#O(){return this.#H?AbortSignal.any([this.#H,this.#z.signal]):this.#z.signal}#q(){let $=this.#B();if($!==void 0&&$<=0)throw new K5(this.request)}async#g(){for(let $ of this.#$.hooks.beforeRequest){let Y=await $({request:this.request,options:this.#w(),retryCount:0});if(T00(Y))this.#_(Y);else if(TH(Y))return Y}return}async#y($){let Y=this.#M($);for(let z of this.#$.hooks.afterResponse){let U=this.#v($.clone(),Y);this.#V(U);let Q;try{Q=await z({request:this.request,options:this.#w(),response:U,retryCount:this.#Q})}catch(I){if(U!==$)this.#K(U);throw this.#K($),I}if(Q instanceof aO){if(U!==$)this.#K(U);throw this.#K($),new iQ(Q.options)}let J=TH(Q)?this.#v(Q,Y):$;if(U!==$&&U!==J&&U.body!==J.body)this.#K(U);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 z=Math.min(await this.#P($),nQ),U={signal:this.#H},Q=this.#B();if(Q!==void 0){if(Q<=0)throw new K5(this.request);if(z>=Q)throw await Yw(Q,U),new K5(this.request)}if(await Yw(z,U),this.#q(),$ instanceof iQ&&$.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.#w(),error:$,retryCount:this.#Q+1})}catch(K){if(K instanceof Error&&K!==$)this.#X.add(K);throw K}if(T00(I)){this.#_(I);break}if(TH(I))return this.#Z=!0,this.#Q++,I;if(I===sO)return}return this.#q(),this.#Q++,this.#h(Y)}#C(){let $=this.#Z;return this.#Z=!1,$}async#R(){if(this.#z?.signal.aborted)this.#z=new globalThis.AbortController,this.#$.signal=this.#O(),this.request=new globalThis.Request(this.request,{signal:this.#$.signal});let $=O00(this.#$),Y=this.#$.retry.limit>0?this.request.clone():void 0,z=this.#k(this.request,this.#$.body??void 0);if(this.#W=z,Y)this.request=Y;try{let U=this.#B();if(U!==void 0&&U<=0)throw new K5(this.request);let Q=this.#$.timeout===!1?U:U===void 0?this.#$.timeout:Math.min(this.#$.timeout,U),J=Q===void 0?await this.#$.fetch(z,$):await xS(z,$,this.#z,{timeout:Q,fetch:this.#$.fetch});return this.#v(J,z)}catch(U){if(fS(U))throw new DH(this.request,{cause:U});throw U}}#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()}#w(){if(!this.#J){let{hooks:$,json:Y,parseJson:z,stringifyJson:U,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=$}#M($){return this.#N.get($)??this.request}#v($,Y){return this.#N.set($,Y),$}#k($,Y){if(!this.#$.onUploadProgress||!$.body||!hS)return $;return W00($,this.#$.onUploadProgress,Y??this.#$.body??void 0)}}var Hn0=10485760,Wn0="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",jH,Xn0=($)=>{let Y=/;\s*charset\s*=\s*(?:"([^"]+)"|([^;,\s]+))/i.exec($),z=Y?.[1]??Y?.[2];if(z)try{return new TextDecoder(z)}catch{}return new TextDecoder},j00="The `schema` argument must follow the Standard Schema specification",Zn0=($)=>{if(typeof $!=="object")return $;return{...$,...$.methods&&{methods:[...$.methods]},...$.statusCodes&&{statusCodes:[...$.statusCodes]},...$.afterStatusCodes&&{afterStatusCodes:[...$.afterStatusCodes]}}},C00,T00=($)=>$ instanceof globalThis.Request||C00.call($)==="[object Request]",TH=($)=>$ instanceof globalThis.Response||C00.call($)==="[object Response]",qn0=($)=>{if(Array.isArray($))return $.map((Y)=>[...Y]);return cQ($)},E00=async($,Y)=>{if(typeof Y!=="object"&&typeof Y!=="function"||Y===null)throw TypeError(j00);let z=Y["~standard"];if(typeof z!=="object"||z===null||typeof z.validate!=="function")throw TypeError(j00);let U=await z.validate($);if(U.issues)throw new vS(U.issues);return U.value};var R00=m(()=>{mO();RS();_S();te();ee();lO();X00();$w();L00();F00();M00();N00();P00();pY();jH=Symbol("timedOutResponseData"),C00=Object.prototype.toString});var bS=($)=>{let Y=(z,U)=>pQ.create(z,PH($,U));for(let z of rO)Y[z]=(U,Q)=>pQ.create(U,PH($,Q,{method:z}));return Y.create=(z)=>bS(PH(z)),Y.extend=(z)=>{if(typeof z==="function")z=z($??{});return bS(PH($,z))},Y.stop=sO,Y.retry=J00,Y},Ln0,G5;var dQ=m(()=>{R00();pY();$w();mO();/*! MIT License © Sindre Sorhus */Ln0=bS(),G5=Ln0});async function _00($){if($.source.type!=="direct"&&$.source.type!=="seal")throw Error(`Unsupported Seal source: ${$.source.type}`);let Y=$.seal.url??$.source.sealUrl,z=$.source.type==="seal"?$.source:void 0;return{token:$.source.token,expiresAt:Date.now()+$.source.expiresIn*1000,enterprise:{provider:z?"seal":"direct",corpId:$.source.corpId??$.id,staffId:$.source.staffId,sealUrl:Y,tenantId:z?.tenantId,tenantSlug:$.seal.tenantSlug??z?.tenantSlug,tenantName:z?.tenantName,raw:{sourceType:$.source.type}}}}function Fn0($){let Y=Object.entries($??{}).map(([z,U])=>`${z}=${U}`);return Y.length?Y.join("; "):void 0}function A6($){let Y={...$?.headers??{}},z=Fn0($?.cookies);if(z)Y.Cookie=z;return Y}var v00,On0,wn0,Mn0,Nn0,h00;var S00=m(()=>{P$();v00=L.object({token:L.string(),expiresAt:L.number(),url:L.string().url().optional()}),On0=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()}),wn0=L.object({token:L.string(),expiresAt:L.number(),enterprise:On0}),Mn0=L.object({openapi:v00.optional(),closeapi:v00.optional()}),Nn0=L.object({seal:wn0.optional(),hose:Mn0.optional()}),h00=L.record(L.string(),Nn0)});import{existsSync as iS,mkdirSync as Dn0,readFileSync as An0,writeFileSync as Bn0}from"node:fs";import{dirname as Pn0,join as y00}from"node:path";import{homedir as k00}from"node:os";function jn0(){let $=(process.env.SEAL_USE_TOKEN_STORE??process.env.SEAL_HOME_TOKEN_STORE)?.trim();if($)return $;if(iS(zw))return zw;if(iS(g00))return g00;return zw}function Tn0(){let $=(process.env.SEAL_USE_TOKEN_STORE??process.env.SEAL_HOME_TOKEN_STORE)?.trim();if($)return $;return zw}function mQ(){let $=jn0();if(!iS($))return{};try{return h00.parse(JSON.parse(An0($,"utf-8")))}catch{return{}}}function Uw($){let Y=Tn0();Dn0(Pn0(Y),{recursive:!0,mode:448}),Bn0(Y,JSON.stringify($,null,2),{mode:384})}function x00($){return mQ()[$]?.seal}function f00($,Y){let z=mQ();Uw({...z,[$]:{...z[$],seal:Y}})}function u00($){let Y=mQ(),z=Y[$];if(!z)return;Uw({...Y,[$]:{...z,seal:void 0}})}function EH($){return mQ()[$]?.hose??{}}function nS($,Y){let z=mQ();Uw({...z,[$]:{...z[$],hose:Y}})}function Qw($){let Y=mQ();delete Y[$],Uw(Y)}var zw,g00;var CH=m(()=>{S00();zw=y00(k00(),".config","seal-use","seal_tokens.json"),g00=y00(k00(),".config","seal-home","seal_tokens.json")});function j$($){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||!_n0(Y.hostname)||Y.pathname.replace(/\/+$/,"")!==Rn0)throw Error("Invalid Hose assistance link: expected an HTTPS */web/thirdparty.html URL from ekuaibao.com or hosecloud.com");let z=Y.searchParams.getAll("accessToken").filter(Boolean),U=Y.searchParams.getAll("ekbCorpId").filter(Boolean);if(z.length!==1||U.length!==1)throw Error("Invalid Hose assistance link: accessToken and ekbCorpId are required exactly once");let Q=U[0].trim().toLowerCase();if(!i00.test(Q))throw Error("Invalid Hose assistance link: ekbCorpId is not a valid tenant slug");return{corpId:Q,accessToken:z[0],baseUrl:Y.origin}}async function Jw($,Y){let z=typeof $==="string"?n00($):c00($),U=`https://${z.corpId}.sealai.cc`,J=await y6(U,void 0,Y?.customHeaders).get("api/auth/oauth2/session/oem-hosecloud",{searchParams:{token:z.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:z.corpId,sealUrl:U,token:I,expiresIn:Number.isFinite(K)&&K>0?K:3600}}function Iw($,Y){let z=Y.hoseCorpConfig&&typeof Y.hoseCorpConfig==="object"?Y.hoseCorpConfig:void 0,U=[Y.tenantSlug,z?.corporationId].filter((I)=>typeof I==="string"&&Boolean(I)),Q=$.trim().toLowerCase(),J=U.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 _n0($){let Y=$.toLowerCase();return Cn0.some((z)=>Y.endsWith(z))}function c00($){let Y=typeof $?.corpId==="string"?$.corpId.trim().toLowerCase():"",z=typeof $?.accessToken==="string"?$.accessToken.trim():"",U=typeof $?.baseUrl==="string"&&$.baseUrl.trim()?$.baseUrl.trim():void 0;if(!i00.test(Y)||!z)throw Error("Invalid Hose assistance link: accessToken and ekbCorpId are required");return{corpId:Y,accessToken:z,...U?{baseUrl:U}:{}}}function p00($,Y=60){return Boolean($&&Date.now()<$.expiresAt-Y*1000)}function S7($,Y){if($.seal.url)return $.seal.url;if(Y.sealUrl)return Y.sealUrl;return`https://${Y.corpId.toLowerCase()}.sealai.cc`}function vn0($){return $.staffId.includes(":")?$.staffId:`${$.corpId}:${$.staffId}`}function d00($){return G5.create({prefix:j$($.domain),timeout:30000,hooks:{beforeError:[async({error:Y})=>{let z=Y instanceof D6?await Y.response.text().catch(()=>""):"";return Y.message=`${Y.message}${z?`: ${z}`:""}`,Y}]}})}async function hn0($){let Y=d00($),z=$.appKey??$.key,U=$.appSecurity??$.password;if(!z||!U)throw Error("Hose source requires appKey/key and appSecurity/password");let Q=await Y.post("api/openapi/v1/auth/getAccessToken",{json:{appKey:z,appSecurity:U}}).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 lQ($){if($.source.type!=="hose")throw Error(`Unsupported Seal source: ${$.source.type}`);let Y=EH($.id);if(p00(Y.openapi))return Y.openapi.token;let z=cS.get($.id);if(z)return z;let U=hn0($.source).then((Q)=>{return nS($.id,{...EH($.id),openapi:Q}),Q.token}).finally(()=>cS.delete($.id));return cS.set($.id,U),U}async function Kw($,Y,z=7200){let U=d00($),Q=vn0($),I=(await U.post("api/openapi/v1.1/provisional/getProvisionalAuth",{searchParams:{accessToken:Y},json:{uid:Q,pageType:"home",expireDate:z}}).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()+z*1000}}async function Gw($){if($.source.type!=="hose")throw Error(`Unsupported Seal source: ${$.source.type}`);let Y=$.source,z=EH($.id);if(p00(z.closeapi)&&z.closeapi.url)return z.closeapi;let U=pS.get($.id);if(U)return U;let Q=lQ($).then((J)=>Kw(Y,J)).then((J)=>{return nS($.id,{...EH($.id),closeapi:J}),J}).finally(()=>pS.delete($.id));return pS.set($.id,Q),Q}async function m00($,Y=7200,z){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 U=await lQ($),Q=await Kw($.source,U,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 l00($){if($.source.type!=="hose")throw Error(`Unsupported Seal source: ${$.source.type}`);let Y=await Gw($),z=S7($,$.source),U=A6($.seal),J=await y6(z,void 0,U).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:j$(z),tenantSlug:$.seal.tenantSlug,raw:{sourceType:"hose",hoseDomain:j$($.source.domain)}};return{token:I,expiresAt:Date.now()+K*1000,enterprise:G}}async function oQ($,Y,z){if(z){let I=j$(z),K=await b00(I,$,Y);if(!K)throw Error(`Failed to authenticate on specified domain: ${I}. Please verify appKey/appSecurity and domain connectivity.`);return K}let U=En0.map(async(I)=>{try{return await b00(I,$,Y)}catch{return}}),J=(await Promise.all(U)).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 b00($,Y,z){try{let U=await fetch(`${$}/api/openapi/v1/auth/getAccessToken`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({appKey:Y,appSecurity:z}),signal:AbortSignal.timeout(8000)});if(!U.ok)return;let Q=await U.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 Hw($,Y){let z=`${j$($)}/api/openapi/v1/roleDefGroups?accessToken=${encodeURIComponent(Y)}`,U=await fetch(z,{headers:{"content-type":"application/json",Accept:"application/json"},signal:AbortSignal.timeout(1e4)});if(!U.ok){let I=await U.text().catch(()=>"");throw Error(`Failed to fetch Hose role definition groups: ${U.status} ${I}`)}return((await U.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 dS($,Y,z,U="id"){let Q=z.startsWith("$")?z.slice(1):z,J=`${j$($)}/api/openapi/v1/roledefs/$${Q}?accessToken=${encodeURIComponent(Y)}&staffBy=${encodeURIComponent(U)}&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 mS($,Y,z){if(z.length===0)return[];let U=`${j$($)}/api/openapi/v1/staffs/getStaffIds?accessToken=${encodeURIComponent(Y)}`,Q=await fetch(U,{method:"POST",headers:{"content-type":"application/json",Accept:"application/json"},body:JSON.stringify({type:"STAFFID",conditionIds:z.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 Ww($){if(!$)return"-";if($.length<=12)return"******";return`${$.slice(0,8)}...${$.slice(-4)}`}async function Sn0($){let Y=typeof $==="string"?n00($):c00($),z=Y.baseUrl||"https://app.ekuaibao.com",U,Q,J,I,K,G={accesstoken:Y.accessToken,corpid:Y.corpId};try{let H=await G5.get(`${z}/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")U=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(!U||!Q)try{let W=(await G5.get(`${z}/api/account/v2/session`,{headers:{...G,...U?{staffid:U}:{}},timeout:1e4}).json())?.value;if(W){if(!U&&W.loginStaffId)U=W.loginStaffId;if(!Q&&W.corporationName)Q=W.corporationName;if(!J&&W.privilege)J=W.privilege}}catch{}if(!U)U=`${Y.corpId}:admin`;return{corpId:Y.corpId,baseUrl:z,accessToken:Y.accessToken,staffId:U,corpName:Q,staffName:J,isAdmin:I,cellphone:K}}async function lS($){let Y=await Sn0($),z={accesstoken:Y.accessToken,corpid:Y.corpId,staffid:Y.staffId},U;try{U=await(await G5.get(`${Y.baseUrl}/api/innerapi/v1/key`,{searchParams:{corpId:Y.corpId},headers:z,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=U.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 En0,Cn0,Rn0="/web/thirdparty.html",i00,cS,pS;var g7=m(()=>{dQ();i8();CH();En0=["https://app.ekuaibao.com","https://dd2.hosecloud.com","https://wx2.ekuaibao.com","https://kdcloud2.ekuaibao.com","https://ddenterprise.ekuaibao.com","https://feishu.ekuaibao.com"],Cn0=[".ekuaibao.com",".hosecloud.com"],i00=/^[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?$/,cS=new Map,pS=new Map});function o00($,Y){return Date.now()>=$.expiresAt-Y*1000}async function gn0($){switch($.source.type){case"hose":return l00($);case"direct":case"seal":return _00($)}}async function Zw($){let Y=$.auth.refreshTtl,z=Xw.get($.id);if(z&&!o00(z,Y))return z;let U=x00($.id);if(U&&!o00(U,Y))return Xw.set($.id,U),U;let Q=await gn0($);return Xw.set($.id,Q),f00($.id,Q),Q}async function r00($){return(await Zw($)).enterprise}function s00($){Xw.delete($),u00($)}var Xw;var oS=m(()=>{g7();CH();Xw=new Map});var t00={};D8(t00,{createSealClientForUrl:()=>y6,createSealClientForToken:()=>rS,createSealClient:()=>P1});function yn0($){if($===void 0||$===null||$==="")return"";if(typeof $==="string")return $;try{return JSON.stringify($)}catch{return String($)}}function kn0($){if(!($ instanceof D6))return $;let Y=yn0($.data);if(Y)$.message=`${$.message}: ${Y}`;return $}function a00($){return async({error:Y})=>{if($&&Y instanceof D6&&Y.response.status===401)s00($);return kn0(Y)}}async function P1($){let Y=await Zw($);return G5.create({prefix:Y.enterprise.sealUrl,timeout:30000,headers:{...A6($.seal),Authorization:`Bearer ${Y.token}`},hooks:{beforeError:[a00($.id)]}})}async function rS($,Y){let z=await Zw($);return y6(z.enterprise.sealUrl,Y,A6($.seal))}function y6($,Y,z={}){let U={...z};if(Y)U.Authorization=`Bearer ${Y}`;return G5.create({prefix:$.replace(/\/+$/,""),timeout:30000,headers:U,hooks:{beforeError:[a00()]}})}var i8=m(()=>{dQ();oS()});var RH;var e00=m(()=>{RH={name:"seal-use",version:"0.10.36",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"},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",release:"bun run scripts/release.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 $10}from"node:child_process";function fn0($,Y=RH.version){let z=$.trim();if(!z)return null;let U=z.endsWith("-dirty"),Q=U?z.slice(0,-6):z,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:U,describe:z};let I=Q.match(/^v?(\d+\.\d+\.\d+(?:-[a-zA-Z0-9.]+)?)$/);if(I&&I[1])return{baseVersion:I[1],commitsAhead:0,commit:"",dirty:U,describe:z};let K=Q.match(/^([0-9a-f]{7,40})$/);if(K&&K[1])return{baseVersion:Y,commitsAhead:0,commit:K[1],dirty:U,describe:z};return null}function un0($,Y,z,U){let J=z?`+g${z}${U?".dirty":""}`:U?"+dirty":"";return`${$}-dev.${Y}${J}`}function bn0($){let Y=$?.env,z=Y?.SEAL_BUILD_VERSION??process.env.SEAL_BUILD_VERSION,U=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(z){let Z=U==="true",V={name:"seal-use",version:z,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||z};return V}if(U==="true"||W==="1")return{name:"seal-use",version:RH.version,channel:"release",isRelease:!0};try{let Z=$10("git",["describe","--tags","--long","--dirty","--always"],{cwd:X,encoding:"utf8",stdio:["ignore","pipe","ignore"]});if(Z.status===0&&Z.stdout){let q=fn0(Z.stdout.trim(),RH.version);if(q){if(!q.commit){let F=$10("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:un0(q.baseVersion,q.commitsAhead,q.commit,q.dirty),channel:"dev",isRelease:!1,git:q}}}}catch{}return{name:"seal-use",version:`${RH.version}-dev.0+local`,channel:"dev",isRelease:!1}}var dY,Z1,sS,Ec1;var $3=m(()=>{e00();dY=bn0(),Z1=dY.version,sS=dY.isRelease,Ec1=dY.channel});function rQ($=void 0){return tS.parse($??{})}function U10($,Y){return rQ({...rQ($),...Y})}var Y10,aS,z10,tS,eS;var sQ=m(()=>{P$();Y10=[".pdf",".xls",".xlsx",".csv",".doc",".docx",".ppt",".pptx",".txt",".rtf",".odt",".ods",".odp",".jpg",".jpeg",".png",".gif",".bmp",".webp",".heic",".eml",".msg"],aS={minFileSizeBytes:500,allowedExtensions:[...Y10]},z10=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"}),tS=L.object({minFileSizeBytes:L.number().int().min(0).default(aS.minFileSizeBytes),maxFileSizeBytes:L.number().int().positive().nullable().optional(),allowedExtensions:L.array(z10).min(1).default([...Y10]).transform(($)=>[...new Set($)])}).superRefine(($,Y)=>{if($.maxFileSizeBytes!==void 0&&$.maxFileSizeBytes!==null&&$.maxFileSizeBytes<$.minFileSizeBytes)Y.addIssue({code:"custom",path:["maxFileSizeBytes"],message:"最大文件大小不能小于最小文件大小"})}),eS=L.object({minFileSizeBytes:L.number().int().min(0).optional(),maxFileSizeBytes:L.number().int().positive().nullable().optional(),allowedExtensions:L.array(z10).min(1).transform(($)=>[...new Set($)])}).optional()});var in0,nn0,cn0,pn0,J10,dn0,mn0,I10,qw,K10,ln0,Vw,G10,vH,H10,on0,rn0,sn0,Q10,hH,W10,an0,tn0,Lw,$g,X10,Z10,q10,V10,Fw,L10,Yg,zg,F10,O10,en0,w10,$c0,M10,_H,N10,D10,A10,B10,P10,j10,T10,E10,C10,R10,_10,Yc0,v10,zc0,Uc0,Qc0,Ug,Qg,Jc0,h10,S10,g10,y10,Ic0,Jg,Sc1,gc1,k10,yc1;var Ig=m(()=>{P$();sQ();in0=L.object({staffId:L.string(),name:L.string().optional(),code:L.string().default(""),bindTime:L.number().optional()}),nn0=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:in0.optional()}),cn0=L.object({apiKey:L.string().optional(),corporationId:L.string().optional(),corporationName:L.string().optional()}),pn0=L.object({id:L.string(),name:L.string(),tenantSlug:L.string().optional(),isDemo:L.boolean().default(!1),logoUrl:L.string().nullable().optional(),hoseCorpConfig:cn0.optional()}),J10=L.object({user:nn0,tenant:pn0}),dn0=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(),mn0=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(),I10=L.object({user:dn0,session:mn0}),qw=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()}),K10=L.object({rules:L.array(qw),hasPendingDeletes:L.boolean().default(!1)}),ln0=L.object({id:L.union([L.string(),L.number()]).optional(),ruleId:L.union([L.string(),L.number()]).optional(),stableId:L.union([L.string(),L.number()]).optional(),runtimeRuleId:L.union([L.string(),L.number()]).optional(),runtimeId:L.union([L.string(),L.number()]).optional(),code:L.union([L.string(),L.number()]).optional(),description:L.string(),scope:L.string(),strictness:L.string()}).passthrough(),Vw=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(ln0).default([]),publishedAt:L.number().optional(),createdAt:L.number().optional()}).passthrough(),G10=L.object({version:Vw,rulesCount:L.number()}),vH=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)}),H10=L.object({articles:L.array(vH),total:L.number().optional()}),on0=L.object({explicitApprove:L.string().default(""),explicitReject:L.string().default(""),exemptApprove:L.string().default(""),review:L.string().default("")}).passthrough(),rn0=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(),sn0=L.enum(["assisted","semi_automatic","fully_automatic"]),Q10=L.object({id:L.string(),url:L.string().url()}).passthrough(),hH=L.object({type:L.literal("webhook"),id:L.string(),name:L.string(),mode:sn0,incomingDocumentWebhook:Q10,outgoingResultWebhook:L.string().url(),incomingManualResultWebhook:Q10,secret:L.string().min(1),autoApprovalRate:L.number().int().min(0).max(100).optional(),materialPackFilePolicy:tS.default(aS)}).passthrough(),W10=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:on0.optional(),integrationSystem:L.string().optional(),integrations:L.array(rn0).default([])}).passthrough(),an0=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(),tn0=L.object({_langfuseTraceId:L.string().optional(),simulation_batch_id:L.string().optional()}).passthrough(),Lw=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:an0.optional(),result:L.unknown().optional(),pipelineData:L.unknown().optional(),sourceExtendData:tn0.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(),$g=L.object({records:L.array(Lw).default([]),total:L.number().optional(),page:L.number().optional(),pageSize:L.number().optional()}).passthrough(),X10=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(),Z10=L.object({id:L.string(),token:L.string(),link:L.string()}).passthrough(),q10=L.object({userId:L.string(),password:L.string()}).passthrough(),V10=L.object({password:L.string()}).passthrough(),Fw=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(),L10=L.object({departments:L.array(L.record(L.string(),L.unknown())).default([]),users:L.array(Fw).default([])}).passthrough(),Yg=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(),zg=L.object({items:L.array(Yg).default([])}).passthrough(),F10=L.object({items:L.array(Fw).default([])}).passthrough(),O10=L.object({lastSyncTime:L.union([L.string(),L.number(),L.null()])}).passthrough(),en0=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(),w10=L.object({tagStats:L.array(en0).default([]),totalRisks:L.number().default(0),analyzedRisks:L.number().default(0),pendingRisks:L.number().default(0)}).passthrough(),$c0=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(),M10=L.object({tagId:L.string(),tagName:L.string().default(""),tagPath:L.string().default(""),tagDescription:L.string().default(""),risks:L.array($c0).default([]),total:L.number().default(0)}).passthrough(),_H=L.object({value:L.number().default(0),trend:L.number().default(0)}).passthrough(),N10=L.object({metrics:L.object({approvalCount:_H.optional(),accuracy:_H.optional(),automationRate:_H.optional(),riskCount:_H.optional(),avgDuration:_H.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(),D10=L.record(L.string(),L.unknown()),A10=L.object({expenses:L.array(D10).default([]),total:L.number().optional()}).passthrough(),B10=L.object({invoices:L.array(D10).default([]),total:L.number().optional(),feishuApprovalAppId:L.string().nullable().optional()}).passthrough(),P10=L.record(L.string(),L.unknown()),j10=L.object({provider:L.string(),config:L.record(L.string(),L.unknown()).default({})}).passthrough(),T10=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(),E10=L.object({permissions:L.array(L.object({key:L.string(),name:L.string(),description:L.string().optional()}).passthrough()).default([])}).passthrough(),C10=L.object({configs:L.array(L.record(L.string(),L.unknown())).default([])}).passthrough(),R10=L.object({subscriptions:L.array(L.record(L.string(),L.unknown())).default([]),features:L.array(L.record(L.string(),L.unknown())).default([])}).passthrough(),_10=L.object({key:L.string(),type:L.string(),label:L.string(),column:L.string(),mask:L.string().optional()}).passthrough(),Yc0=L.object({columns:L.array(_10).default([]),fieldKey:L.string().optional(),keyColumn:L.string().optional(),sheetName:L.string().optional(),fieldLabel:L.string().optional()}).passthrough(),v10=L.object({id:L.string().optional(),listSheets:L.array(Yc0).default([]),mainColumns:L.array(_10).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(),zc0=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:v10.optional()}).passthrough(),Uc0=L.object({mode:L.string().optional(),conditions:L.array(L.object({label:L.string(),value:L.string()}).passthrough()).default([])}).passthrough(),Qc0=L.object({kind:L.string().optional(),stage:L.string().optional(),code:L.string().optional(),message:L.string().optional()}).passthrough(),Ug=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:zc0.optional(),requestSummary:Uc0.nullable().optional(),resultSummary:Qc0.nullable().optional(),createdAt:L.union([L.string(),L.number()]).optional(),updatedAt:L.union([L.string(),L.number()]).optional()}).passthrough(),Qg=L.object({batchId:L.string()}).passthrough(),Jc0=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(),h10=L.object({id:L.string(),tenantId:L.string().optional(),name:L.string().optional(),description:L.string().optional(),approvalSystem:L.string().optional(),hosecloudConfig:Jc0.optional(),createdAt:L.union([L.string(),L.number()]).optional(),updatedAt:L.union([L.string(),L.number()]).optional()}).passthrough(),S10=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(),g10=L.object({signKey:L.string().optional(),displayName:L.string().optional(),corporationId:L.string().optional()}).passthrough(),y10=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:v10.nullable().optional(),createdAt:L.union([L.string(),L.number()]).optional(),updatedAt:L.union([L.string(),L.number()]).optional()}).passthrough(),Ic0=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(),Jg=L.object({id:L.string().min(1),name:L.string().min(1),enabled:L.boolean().default(!0),description:L.string().default(""),condition:Ic0.default({hitScopes:[],hitRuleIds:[],notHitScopes:[],notHitRuleIds:[]}),level:L.enum(["medium","high"])}).passthrough(),Sc1=L.object({defaultLevel:L.enum(["medium","high"]).default("medium"),routingPolicies:L.array(Jg).default([])}).passthrough(),gc1=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(),k10=L.object({id:L.string().optional(),code:L.string().optional(),name:L.string().optional(),approvalSystem:L.string().optional()}).passthrough(),yc1=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 u10}from"node:crypto";async function N1($,Y){let z=await $.json();return Y.parse(z.data??z)}async function T8($){return N1(await $.get("api/v1/auth/me"),J10)}async function i10($){return N1(await $.get("api/auth/get-session"),I10)}async function X6($){return N1(await $.get("api/v1/rules"),K10)}async function gH($,Y){return N1(await $.post("api/v1/rules",{json:Y}),qw)}async function Kg($,Y,z){return N1(await $.put(`api/v1/rules/${Y}`,{json:z}),qw)}async function tQ($,Y){await $.delete(`api/v1/rules/${Y}`)}async function Nw($){let Y=await $.post("api/v1/rules/batch-recode",{throwHttpErrors:!1}),z=await Y.json().catch(()=>({}));return L.object({ok:L.boolean(),status:L.number(),body:L.unknown()}).parse({ok:Y.ok,status:Y.status,body:z})}async function c8($){return N1(await $.get("api/v1/rule-set-versions"),L.array(Vw))}async function y7($,Y){return N1(await $.get(`api/v1/rule-set-versions/${Y}`),Vw)}async function yH($,Y){return N1(await $.post("api/v1/rule-set-versions/publish",{json:{versionName:Y}}),G10)}async function mY($,Y={}){let z=new URLSearchParams;return z.set("offset",String(Y.offset??0)),z.set("limit",String(Y.limit??20)),z.set("sortBy",Y.sortBy??"createdAt"),z.set("sortOrder",Y.sortOrder??"desc"),Y.scenarios?.forEach((U,Q)=>{z.set(`filter[scenarios][${Q}]`,U)}),N1(await $.get("api/v1/knowledge/articles",{searchParams:z}),H10)}async function n10($,Y){return N1(await $.get(`api/v1/knowledge/articles/${Y}`),vH)}async function Dw($,Y){return N1(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??[]}}),vH)}async function Aw($,Y,z){let U=Object.fromEntries(Object.entries(z).filter(([,Q])=>Q!==void 0));return N1(await $.patch(`api/v1/knowledge/articles/${Y}`,{json:{attributes:U}}),vH)}async function Bw($,Y){return await $.delete(`api/v1/knowledge/articles/${Y}`),{success:!0,id:Y}}async function o1($,Y="api/v1/agent/ai-approval/config"){return N1(await $.get(Y),W10)}async function s5($,Y,z="api/v1/agent/ai-approval/config"){return await $.post(z,{json:Y}),o1($,z)}async function Gg($,Y,z="api/v1/agent/ai-approval/config"){let U=await $.post(z,{json:Y}),Q=await U.json().catch(()=>({})),J=Mw.safeParse(Q.data??Q);return J.success?J.data.success??U.ok:U.ok}async function I$($,Y="api/v1/agent/ai-approval/config"){let z=await o1($,Y);return Hg(z.integrations)}async function Pw($,Y,z,U="api/v1/agent/ai-approval/config"){let Q=await o1($,U),J=Hg(Q.integrations),I=r10(Y,J,z);if(!await Gg($,{...Q,integrations:[...Q.integrations,I]},U))throw Error("Seal did not confirm saving the Webhook integration");return I}async function c10($,Y,z,U="api/v1/agent/ai-approval/config"){let Q=await o1($,U),J=Hg(Q.integrations),I=r10(Y,J,z);return{before:Q,after:{...Q,integrations:[...Q.integrations,I]},integration:I}}async function p10($,Y,z,U="api/v1/agent/ai-approval/config"){let Q=await o1($,U),J=jw(Q.integrations),I=Tw(J,Y),K=s10(I.integration,z);if(!await Gg($,{...Q,integrations:Q.integrations.map((H,W)=>W===I.index?K:H)},U))throw Error("Seal did not confirm saving the Webhook integration");return K}async function d10($,Y,z,U="api/v1/agent/ai-approval/config"){let Q=await o1($,U),J=jw(Q.integrations),I=Tw(J,Y),K=s10(I.integration,z);return{before:Q,after:{...Q,integrations:Q.integrations.map((G,H)=>H===I.index?K:G)},integration:K}}async function m10($,Y,z="api/v1/agent/ai-approval/config"){let U=await o1($,z),Q=jw(U.integrations),J=Tw(Q,Y);if(!await Gg($,{...U,integrations:U.integrations.filter((K,G)=>G!==J.index)},z))throw Error("Seal did not confirm deleting the Webhook integration");return J.integration}async function l10($,Y,z="api/v1/agent/ai-approval/config"){let U=await o1($,z),Q=jw(U.integrations),J=Tw(Q,Y);return{before:U,after:{...U,integrations:U.integrations.filter((I,K)=>K!==J.index)},integration:J.integration}}function k7($,Y){let z=Y.trim();if(!z)throw Error("Webhook selector must not be empty");let U=$.find((J)=>J.id===z);if(U)return U;let Q=$.filter((J)=>J.name===z);if(Q.length===1)return Q[0];if(Q.length>1)throw Error(`Multiple Webhook integrations match name: ${z}. Use the integration ID.`);throw Error(`Webhook integration not found: ${z}`)}function o10($,Y){let z=Y?.trim().toLowerCase();if(!z)return $;return $.filter((U)=>[U.id,U.name,U.mode,U.outgoingResultWebhook,U.incomingDocumentWebhook.url,U.incomingManualResultWebhook.url].some((Q)=>Q.toLowerCase().includes(z)))}function Hg($){return $.filter((Y)=>Y.type==="webhook").map((Y)=>hH.parse(Y))}function jw($){return $.flatMap((Y,z)=>{if(Y.type!=="webhook")return[];return[{index:z,integration:hH.parse(Y)}]})}function Tw($,Y){let z=k7($.map((U)=>U.integration),Y);return $.find((U)=>U.integration.id===z.id)}function r10($,Y,z){let U=SH(z.name,"name"),Q=z.mode??"assisted",J=t10(z.outgoingResultWebhook,"outgoingResultWebhook"),I=e10(z.autoApprovalRate??60),K=Hc0(Y),G=`wh_${K}_${u10(8).toString("hex").slice(0,7)}`,H=j$($);return hH.parse({type:"webhook",id:`integration-${K}`,name:U,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:z.secret?SH(z.secret,"secret"):a10(),autoApprovalRate:I,materialPackFilePolicy:rQ(z.materialPackFilePolicy)})}function s10($,Y){return hH.parse({...$,...Y.name===void 0?{}:{name:SH(Y.name,"name")},...Y.mode===void 0?{}:{mode:Y.mode},...Y.outgoingResultWebhook===void 0?{}:{outgoingResultWebhook:t10(Y.outgoingResultWebhook,"outgoingResultWebhook")},...Y.autoApprovalRate===void 0?{}:{autoApprovalRate:e10(Y.autoApprovalRate)},...Y.rotateSecret||Y.secret!==void 0?{secret:Y.rotateSecret?a10():SH(Y.secret??"","secret")}:{},...Y.materialPackFilePolicy===void 0?{}:{materialPackFilePolicy:U10($.materialPackFilePolicy,Y.materialPackFilePolicy)}})}function Hc0($){let Y=new Set($.map((U)=>U.id)),z=Date.now();while(Y.has(`integration-${z}`))z+=1;return z}function a10(){return u10(16).toString("hex")}function SH($,Y){let z=$.trim();if(!z)throw Error(`Webhook ${Y} must not be empty`);return z}function t10($,Y){let z=SH($,Y);try{return new URL(z).toString()}catch{throw Error(`Webhook ${Y} must be a valid URL`)}}function e10($){if(!Number.isInteger($)||$<0||$>100)throw Error("Webhook autoApprovalRate must be an integer between 0 and 100");return $}async function Ew($,Y={}){let[z,U,Q]=await Promise.all([X6($),mY($,{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:z,documents:U,stylePreferences:Q}}async function i4($,Y={}){let z=new URLSearchParams;return z.set("offset",String(Y.offset??0)),z.set("limit",String(Y.limit??50)),n8(z,"fromTimestamp",Y.fromTimestamp),n8(z,"toTimestamp",Y.toTimestamp),n8(z,"startDate",Y.startDate),n8(z,"endDate",Y.endDate),x10(z,"status",Y.status),n8(z,"sourceSystem",Y.sourceSystem),n8(z,"taskMode",Y.taskMode),n8(z,"search",Y.search),n8(z,"sourceDocumentSN",Y.sourceDocumentSN),n8(z,"sourceDocumentId",Y.sourceDocumentId),x10(z,"manualApprovalStatus",Y.manualApprovalStatus),N1(await $.get("api/v1/approvals",{searchParams:z}),$g)}async function H4($,Y){return N1(await $.get(`api/v1/approvals/${Y}`),Lw)}async function Wg($,Y){let z=await $.get(`api/v1/simulation/batch/${Y}/records`).json(),U=z.data??z;if(Array.isArray(U))return L.array(Lw).parse(U);return $g.parse(U).records}async function $40($,Y){return N1(await $.post("api/v1/simulation/create-batch",{json:Y}),Qg)}async function Y40($,Y){return N1(await $.post("api/v1/simulation/create-material-pack-batch",{json:Y}),Qg)}async function z40($,Y={}){let z=await $.get("api/v1/simulation/batches",{searchParams:{limit:String(Y.limit??50)}}).json(),U=z.data??z;return L.array(Ug).parse(U)}async function Cw($,Y){return N1(await $.get(`api/v1/simulation/batch/${Y}`),Ug)}async function U40($){let Y=await $.get("api/v1/simulation/templates").json(),z=Y.data??Y;return L.array(h10).parse(z)}async function Xg($){return N1(await $.get("api/v1/simulation/integration-status"),S10)}async function Zg($){let Y=await $.get("api/v1/simulation/hosecloud-integrations").json(),z=Y.data??Y;return L.array(g10).parse(z)}async function Q40($,Y){let U=await(await $.delete(`api/v1/simulation/batch/${encodeURIComponent(Y)}/data`)).json().catch(()=>({}));return U.data??U}async function J40($,Y){let z=Y?"api/v1/simulation/hosecloud-specifications-by-sign-key":"api/v1/simulation/hosecloud-specifications",U=Y?new URLSearchParams({signKey:Y}):void 0,Q=await $.get(z,{searchParams:U}).json(),J=Q.data??Q;return L.array(k10).parse(J)}async function I40($,Y){let z=await $.post("api/hosecloud/corporation",{json:Y}).json(),U=z.data??z;return L.object({corporationId:L.string()}).parse(U)}async function K40($,Y){let U=await(await $.post("api/hosecloud/outbound-config/sync",{json:Y})).json().catch(()=>({}));return U.data??U}async function G40($,Y){let z=new FormData;return z.append("file",new Blob([new Uint8Array(Y.fileBuffer)]),Y.fileName),N1(await $.post("api/v1/material-packages/upload",{body:z}),y10)}function n8($,Y,z){if(z)$.set(Y,z)}function x10($,Y,z){if(!z)return;(Array.isArray(z)?z:[z]).map((Q)=>Q.trim()).filter(Boolean).forEach((Q,J)=>{$.set(`${Y}[${J}]`,Q)})}async function H40($){return N1(await $.get("api/v1/delegation/list"),L.array(X10))}async function aQ($,Y){return N1(await $.post("api/v1/delegation/create",{json:Y??{}}),Z10)}async function W40($,Y){let z=await $.post("api/v1/delegation/revoke",{json:{tokenId:Y}}),U=await z.json(),Q=Mw.safeParse(U.data??U);return Q.success?Q.data.success??z.ok:z.ok}async function X40($,Y){let z=Y.departmentIds&&Y.departmentIds.length>0?Y.departmentIds:void 0;if(!z){let U=await $.get("api/v1/contacts/departments/root/children").json(),Q=Kc0.safeParse(U.data??U),J=Q.success?Q.data.items?.[0]?._id:void 0;if(J)z=[J]}return N1(await $.post("api/v1/contacts/local/users",{json:{name:Y.name,phone:Y.phone,permissions:Y.permissions??[],departmentIds:z??[]}}),q10)}async function qg($,Y){return N1(await $.post(`api/v1/contacts/local/users/${Y}/reset-password`,{json:{}}),V10)}async function Ow($,Y){return N1(await $.get(`api/v1/contacts/users/${Y}`),Fw)}async function ww($,Y=""){return N1(await $.get("api/v1/contacts/search",{searchParams:{query:Y}}),L10)}async function Z40($){return N1(await $.get("api/v1/contacts/departments/root/children"),zg)}async function q40($,Y){return N1(await $.get(`api/v1/contacts/departments/${encodeURIComponent(Y)}`),Yg)}async function V40($,Y){return N1(await $.get(`api/v1/contacts/departments/${encodeURIComponent(Y)}/children`),zg)}async function L40($,Y){return N1(await $.get(`api/v1/contacts/departments/${encodeURIComponent(Y)}/users`),F10)}async function F40($){return N1(await $.get("api/v1/contacts/last-sync-time"),O10)}async function Rw($,Y={}){let z=Vg(),U=new URLSearchParams;if(n8(U,"startDate",Y.startDate??z.startDate),n8(U,"endDate",Y.endDate??z.endDate),Y.limit!==void 0)U.set("limit",String(Y.limit));return N1(await $.get("api/v1/insight/stats",{searchParams:U}),w10)}async function _w($,Y){let z=Vg(),U=new URLSearchParams;return U.set("tagId",Y.tagId),U.set("startDate",Y.startDate??z.startDate),U.set("endDate",Y.endDate??z.endDate),N1(await $.get("api/v1/insight/risks-by-tag",{searchParams:U}),M10)}async function vw($,Y={}){let z=Vg(),U=f10(Y.startDate??z.startDate),Q=f10(Y.endDate??z.endDate),J=new URLSearchParams;return J.set("startDate",String(U)),J.set("endDate",String(Q)),N1(await $.get("api/v1/insight/performance",{searchParams:J}),N10)}async function O40($,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 z=new Date($);if(isNaN(z.getTime()))throw Error(`Invalid date format: ${$}`);return z.getTime()}function Vg(){let $=new Date,Y=new Date($.getFullYear(),$.getMonth(),1),z=new Date($.getFullYear(),$.getMonth()+1,0,23,59,59,999);return{startDate:Y.toISOString(),endDate:z.toISOString()}}function w40($){let Y=new URLSearchParams;return n8(Y,"filter[startDate]",$.startDate),n8(Y,"filter[endDate]",$.endDate),n8(Y,"filter[search]",$.search),Y.set("offset",String($.offset??0)),Y.set("limit",String($.limit??50)),Y}async function M40($,Y={}){return N1(await $.get("api/v1/expenses/list",{searchParams:w40(Y)}),A10)}async function N40($,Y={}){return N1(await $.get("api/v1/invoice/list",{searchParams:w40(Y)}),B10)}async function D40($){return N1(await $.get("api/v1/integrations/feishu/simulation/approval-definitions"),L.array(P10))}async function A40($,Y){let z=await $.delete(`api/v1/contacts/local/users/${Y}`),U=await z.json(),Q=Mw.safeParse(U.data??U);return Q.success?Q.data.success??z.ok:z.ok}async function Lg($,Y){let z=await $.post(`api/v1/contacts/local/users/${Y}/activate`,{json:{}}),U=await z.json(),Q=Mw.safeParse(U.data??U);return Q.success?Q.data.success??z.ok:z.ok}async function Wc0($,Y){let z=await $.post("api/auth/sms-otp/sign-in-password",{json:Y}),U=z.headers.get("set-auth-token"),Q=Gc0.parse(await z.json()),J=U??Q.session?.token;if(!J)throw Error("Failed to retrieve authentication token from login response");return{token:J,user:Q.user}}async function B40($,Y,z,U){let Q;if(Y.userIdOrPhone.startsWith("+")||/^\d{11}$/.test(Y.userIdOrPhone)){let q=await ww($,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 Ow($,Y.userIdOrPhone).catch(async()=>{let q=await ww($,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 Lg($,Q._id),Q=await Ow($,Q._id);let J=Q,I=Array.isArray(J.identities)&&J.identities.some((q)=>q.provider&&q.provider!=="local")||!!J.apps?.hosecloud;if(I&&U&&U.source.type==="hose"){let V=(Q.mobile||J.identities?.[0]?.providerId||"").replace(/^\+86/,""),F=J.identities?.find((O)=>O.provider==="hosecloud")?.providerId,w=J.apps?.hosecloud?.boundId||F||(V?`${U.source.corpId}:${V}`:void 0);if(w){let O=await lQ(U),M=(await Kw({...U.source,staffId:w},O)).token,D=S7(U,U.source),P=A6(U.seal),j=y6(D,void 0,P),A;try{A=await j.get("api/auth/oauth2/session/oem-hosecloud",{searchParams:{token:M,returnToken:"1"}}).json()}catch(C){if(C instanceof D6&&C.response.status===400)throw Error(`Seal AI 用户“${Q.name}”未绑定合思账号,无法生成个人协助链接。`);throw C}let T=A.token??A.accessToken??A.data?.token;if(T){let C=await z(T),b=await aQ(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 qg($,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 Wc0($,{phone:H,password:K.password}),X=await z(W),Z=await aQ(X,{note:Y.note??`Delegation generated by admin for ${Q.name}`});return{targetUser:Q,delegation:Z,temporaryPassword:K.password}}async function P40($){return N1(await $.get("api/v1/llm/config"),j10)}async function j40($){return N1(await $.get("api/v1/llm/providers"),L.array(T10))}async function T40($){return N1(await $.get("api/v1/permissions/available"),E10)}async function E40($){return N1(await $.get("api/v1/permissions/configs"),C10)}async function lY($){return N1(await $.get("api/v1/billing/status"),R10)}async function C40($){let z=await(await $.get("api/v1/billing/plans")).json();return b10.parse(z.data??z)}async function R40($){let z=await(await $.get("api/v1/billing/features")).json();return b10.parse(z.data??z)}var Mw,Kc0,Gc0,b10;var B6=m(()=>{dQ();P$();sQ();g7();i8();Ig();Mw=L.object({success:L.boolean().optional()}).passthrough(),Kc0=L.object({items:L.array(L.object({_id:L.string()})).optional()}).passthrough(),Gc0=L.object({user:L.unknown().optional(),session:L.object({token:L.string().optional()}).optional()}).passthrough(),b10=L.json()});var Y6=E((kp1,v40)=>{var{toString:_40}=Object.prototype,Xc0=/["&<>]/,Y3={each:function(Y,z){if(Y)if(Array.isArray(Y))Y.forEach(z);else Object.keys(Y).forEach((U)=>{z(Y[U],U)})},some:function(Y,z){if(Y){if(Array.isArray(Y))return Y.some(z);return Object.keys(Y).some((U)=>z(Y[U],U))}return!1},every:function(Y,z){if(Y){if(Array.isArray(Y))return Y.every(z);return Object.keys(Y).every((U)=>z(Y[U],U))}return!0},map:function(Y,z){if(Y){if(Array.isArray(Y))return Y.map(z);return Object.keys(Y).map((U)=>z(Y[U],U))}return[]},keyBy($,Y){return $.reduce((z,U)=>{return z[U[Y]]=U,z},{})},isEqual:function(Y,z){let U=typeof Y,Q=typeof z,J=Array.isArray(Y),I=Array.isArray(z),K;if(U!==Q)return!1;switch(typeof Y){case"object":if(J||I){if(J&&I)return Y.length===z.length&&Y.every((G,H)=>{let W=z[H];return Y3.isEqual(G,W)});return!1}if(Y===null||z===null)return Y===z;if(K=Object.keys(Y),Object.keys(z).length!==K.length)return!1;for(let G of K)if(!z.hasOwnProperty(G))return!1;return Y3.every(Y,(G,H)=>{let W=z[H];return Y3.isEqual(G,W)});default:return Y===z}},escapeHtml($){let Y=Xc0.exec($);if(!Y)return $;let z="",U="",Q=0,J=Y.index;for(;J<$.length;J++){switch($.charAt(J)){case'"':U=""";break;case"&":U="&";break;case"'":U="'";break;case"<":U="<";break;case">":U=">";break;default:continue}if(Q!==J)z+=$.substring(Q,J);Q=J+1,z+=U}if(Q!==J)return z+$.substring(Q,J);return z},strcmp($,Y){if($Y)return 1;return 0},isUndefined($){return _40.call($)==="[object Undefined]"},isObject($){return _40.call($)==="[object Object]"},deepMerge(){let $=arguments[0]||{},{length:Y}=arguments,z,U,Q;function J(I,K){if(z=$[K],Q=Array.isArray(I),Y3.isObject(I)||Q){if(Q)Q=!1,U=z&&Array.isArray(z)?z:[];else U=z&&Y3.isObject(z)?z:{};$[K]=Y3.deepMerge(U,I)}else if(!Y3.isUndefined(I))$[K]=I}for(let I=0;I{var Zc0=/^[A-Z]+\d+$/,kH={_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,z,U,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)z=I-27,U=z%26,Q=Math.floor(z/26),Y=this._dictionary[Q]+this._dictionary[U],this._n2l[I]=Y,this._l2n[Y]=I,I++;this._l2nFill=2}if(this._l2nFill<3&&$>=3){I=703;while(I<=16384)z=I-703,U=z%26,Q=Math.floor(z/26)%26,J=Math.floor(z/676),Y=this._dictionary[J]+this._dictionary[Q]+this._dictionary[U],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(!Zc0.test($))throw Error(`Invalid Address: ${$}`);return!0},decodeAddress($){let Y=$.length<5&&this._hash[$];if(Y)return Y;let z=!1,U="",Q=0,J=!1,I="",K=0;for(let H=0,W;H<$.length;H++)if(W=$.charCodeAt(H),!J&&W>=65&&W<=90)z=!0,U+=$[H],Q=Q*26+W-64;else if(W>=48&&W<=57)J=!0,I+=$[H],K=K*10+W-48;else if(J&&z&&W!==36)break;if(!z)Q=void 0;else if(Q>16384)throw Error(`Out of bounds. Invalid column letter: ${U}`);if(!J)K=void 0;$=U+I;let G={address:$,col:Q,row:K,$col$row:`$${U}$${I}`};if(Q<=100&&K<=100)this._hash[$]=G,this._hash[G.$col$row]=G;return G},getAddress($,Y){if(Y){let z=this.n2l(Y)+$;return this.decodeAddress(z)}return this.decodeAddress($)},decode($){let Y=$.split(":");if(Y.length===2){let z=this.decodeAddress(Y[0]),U=this.decodeAddress(Y[1]),Q={top:Math.min(z.row,U.row),left:Math.min(z.col,U.col),bottom:Math.max(z.row,U.row),right:Math.max(z.col,U.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(/(?:(?:(?:'((?:[^']|'')*)')|([^'^ !]*))!)?(.*)/),z=Y[1]||Y[2],U=Y[3],Q=U.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:z,tl:{address:I,col:H,row:G,$col$row:`$${this.n2l(H)}$${G}`,sheetName:z},br:{address:K,col:X,row:W,$col$row:`$${this.n2l(X)}$${W}`,sheetName:z},dimensions:`${I}:${K}`}}if(U.startsWith("#"))return z?{sheetName:z,error:U}:{error:U};let J=this.decodeAddress(U);return z?{sheetName:z,...J}:J},encodeAddress($,Y){return kH.n2l(Y)+$},encode(){switch(arguments.length){case 2:return kH.encodeAddress(arguments[0],arguments[1]);case 4:return`${kH.encodeAddress(arguments[0],arguments[1])}:${kH.encodeAddress(arguments[2],arguments[3])}`;default:throw Error("Can only encode with 2 or 4 arguments")}},inRange($,Y){let[z,U,,Q,J]=$,[I,K]=Y;return I>=z&&I<=Q&&K>=U&&K<=J}};h40.exports=kH});var z3=E((fp1,S40)=>{var a5=n4();class Fg{constructor(){this.decode(arguments)}setTLBR($,Y,z,U,Q){if(arguments.length<4){let J=a5.decodeAddress($),I=a5.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:z},this.setTLBR(J.row,J.col,I.row,I.col,Q)}else this.model={top:Math.min($,z),left:Math.min(Y,U),bottom:Math.max($,z),right:Math.max(Y,U),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 Fg)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 z=a5.decodeEx(Y);if(z.top)this.model={top:z.top,left:z.left,bottom:z.bottom,right:z.right,sheetName:z.sheetName};else this.model={top:z.row,left:z.col,bottom:z.row,right:z.col,sheetName:z.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,z,U){if(!this.model.top||$this.bottom)this.bottom=z;if(!this.model.right||U>this.right)this.right=U}expandRow($){if($){let{dimensions:Y,number:z}=$;if(Y)this.expand(z,Y.min,z,Y.max)}}expandToAddress($){let Y=a5.decodeEx($);this.expand(Y.row,Y.col,Y.row,Y.col)}get tl(){return a5.n2l(this.left)+this.top}get $t$l(){return`$${a5.n2l(this.left)}$${this.top}`}get br(){return a5.n2l(this.right)+this.bottom}get $b$r(){return`$${a5.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=a5.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 z=this.top;z<=this.bottom;z++)$(a5.encodeAddress(z,Y),z,Y)}}S40.exports=Fg});var H5=E((up1,g40)=>{g40.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 k40=E((bp1,y40)=>{var hw=n4(),qc0=/(([a-z_\-0-9]*)!)?([a-z0-9_$]{2,})([(])?/gi,Vc0=/^([$])?([a-z]+)([$])?([1-9][0-9]*)$/i;function Lc0($,Y,z){let U=hw.decode(Y),Q=hw.decode(z);return $.replace(qc0,(J,I,K,G,H)=>{if(H)return J;let W=Vc0.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=hw.l2n(Z),w=parseInt(V,10);if(!X)F+=Q.col-U.col;if(!q)w+=Q.row-U.row;return(I||"")+(X||"")+hw.n2l(F)+(q||"")+w}return J})}y40.exports={slideFormula:Lc0}});var f40=E((ip1,x40)=>{var Fc0=Y6();class xH{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({},xH.DEFAULT_CONFIGS,$)}set model($){let{note:Y}=$,{texts:z}=Y;if(z.length===1&&Object.keys(z[0]).length===1)this.note=z[0].text;else this.note=Y}static fromModel($){let Y=new xH;return Y.model=$,Y}}xH.DEFAULT_CONFIGS={note:{margins:{insetmode:"auto",inset:[0.13,0.13,0.25,0.25]},protection:{locked:"True",lockText:"True"},editAs:"absolute"}};x40.exports=xH});var e40=E((np1,t40)=>{var Oc0=n4(),wc0=Y6(),W5=H5(),{slideFormula:Mc0}=k40(),u40=f40();class d0{constructor($,Y,z){if(!$||!Y)throw Error("A Cell needs a Row");this._row=$,this._column=Y,Oc0.validateAddress(z),this._address=z,this._value=x7.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,z){let U=$&&$.numFmt||Y&&Y.numFmt;if(U)z.numFmt=U;let Q=$&&$.font||Y&&Y.font;if(Q)z.font=Q;let J=$&&$.alignment||Y&&Y.alignment;if(J)z.alignment=J;let I=$&&$.border||Y&&Y.border;if(I)z.border=I;let K=$&&$.fill||Y&&Y.fill;if(K)z.fill=K;let G=$&&$.protection||Y&&Y.protection;if(G)z.protection=G;return z}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=x7.create(d0.Types.Merge,this,$),!Y)this.style=$.style}unmerge(){if(this.type===d0.Types.Merge)this._value.release(),this._value=x7.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=x7.create(x7.getType($),this,$)}get note(){return this._comment&&this._comment.note}set note($){this._comment=new u40($)}get text(){return this._value.toString()}get html(){return wc0.escapeHtml(this.text)}toString(){return this.text}_upgradeToHyperlink($){if(this.type===d0.Types.String)this._value=x7.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((z)=>{Y.addEx(this.fullAddress,z)})}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=x7.create($.type,this),this._value.model=$,$.comment)switch($.comment.type){case"note":this._comment=u40.fromModel($.comment);break}if($.style)this.style=$.style;else this.style={}}}d0.Types=W5.ValueType;class b40{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 i40{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 c40{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 p40{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 d40{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 m40{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 l40{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={},z=(U)=>{let Q=$[U];if(Q)Y[U]=Q};return z("formula"),z("result"),z("ref"),z("shareType"),z("sharedFormula"),Y}get value(){return this._copyModel(this.model)}set value($){this.model=this._copyModel($)}validate($){switch(x7.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 W5.FormulaType.Master;if(this.model.sharedFormula)return W5.FormulaType.Shared;return W5.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 W5.ValueType.Null;if($ instanceof String||typeof $==="string")return W5.ValueType.String;if(typeof $==="number")return W5.ValueType.Number;if($ instanceof Date)return W5.ValueType.Date;if($.text&&$.hyperlink)return W5.ValueType.Hyperlink;if($.formula)return W5.ValueType.Formula;return W5.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&&Mc0(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 o40{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 r40{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 s40{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 a40{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 x7={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:b40},{t:d0.Types.Number,f:i40},{t:d0.Types.String,f:n40},{t:d0.Types.Date,f:p40},{t:d0.Types.Hyperlink,f:d40},{t:d0.Types.Formula,f:l40},{t:d0.Types.Merge,f:m40},{t:d0.Types.JSON,f:a40},{t:d0.Types.SharedString,f:o40},{t:d0.Types.RichText,f:c40},{t:d0.Types.Boolean,f:r40},{t:d0.Types.Error,f:s40}].reduce(($,Y)=>{return $[Y.t]=Y.f,$},[]),create($,Y,z){let U=this.types[$];if(!U)throw Error(`Could not create Value of type ${$}`);return new U(Y,z)}};t40.exports=d0});var gw=E((cp1,z60)=>{var Nc0=Y6(),Sw=H5(),oY=n4(),$60=e40();class Y60{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 z=this._worksheet.getColumn($.col);Y=new $60(this,z,$.address),this._cells[$.col-1]=Y}return Y}getCell($){if(typeof $==="string"){let Y=this._worksheet.getColumnKey($);if(Y)$=Y.number;else $=oY.l2n($)}return this._cells[$-1]||this.getCellEx({address:oY.encodeAddress(this._number,$),row:this._number,col:$})}splice($,Y,...z){let U=$+Y,Q=z.length-Y,J=this._cells.length,I,K,G;if(Q<0){for(I=$+z.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>=U;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(z&&z.type!==Sw.ValueType.Null)Y(z,U+1)})}addPageBreak($,Y){let z=this._worksheet,U=Math.max(0,$-1)||0,Q=Math.max(0,Y-1)||16838,J={id:this._number,max:Q,man:1};if(U)J.min=U;z.rowBreaks.push(J)}get values(){let $=[];return this._cells.forEach((Y)=>{if(Y&&Y.type!==Sw.ValueType.Null)$[Y.col]=Y.value}),$}set values($){if(this._cells=[],!$);else if($ instanceof Array){let Y=0;if($.hasOwnProperty("0"))Y=1;$.forEach((z,U)=>{if(z!==void 0)this.getCellEx({address:oY.encodeAddress(this._number,U+Y),row:this._number,col:U+Y}).value=z})}else this._worksheet.eachColumnKey((Y,z)=>{if($[z]!==void 0)this.getCellEx({address:oY.encodeAddress(this._number,Y.number),row:this._number,col:Y.number}).value=$[z]})}get hasValues(){return Nc0.some(this._cells,($)=>$&&$.type!==Sw.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((z)=>{if(z&&z.type!==Sw.ValueType.Null){if(!$||$>z.col)$=z.col;if(Y0?{min:$,max:Y}:null}_applyStyle($,Y){return this.style[$]=Y,this._cells.forEach((z)=>{if(z)z[$]=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,z=0;return this._cells.forEach((U)=>{if(U){let Q=U.model;if(Q){if(!Y||Y>U.col)Y=U.col;if(z{switch(z.type){case $60.Types.Merge:break;default:{let U;if(z.address)U=oY.decodeAddress(z.address);else if(Y){let{row:J}=Y,I=Y.col+1;U={row:J,col:I,address:oY.encodeAddress(J,I),$col$row:`$${oY.n2l(I)}$${J}`}}Y=U;let Q=this.getCellEx(U);Q.model=z;break}}}),$.height)this.height=$.height;else delete this.height;this.hidden=$.hidden,this.outlineLevel=$.outlineLevel||0,this.style=$.style&&JSON.parse(JSON.stringify($.style))||{}}}z60.exports=Y60});var kw=E((pp1,U60)=>{var Dc0=Y6(),Ac0=H5(),Bc0=n4();class yw{constructor($,Y,z){if(this._worksheet=$,this._number=Y,z!==!1)this.defn=z}get number(){return this._number}get worksheet(){return this._worksheet}get letter(){return Bc0.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,z)=>{this._worksheet.getCell(z+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&&Dc0.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 z=this.number;if(!Y)Y=$,$=null;this._worksheet.eachRow($,(U,Q)=>{Y(U.getCell(z),Q)})}get values(){let $=[];return this.eachCell((Y,z)=>{if(Y&&Y.type!==Ac0.ValueType.Null)$[z]=Y.value}),$}set values($){if(!$)return;let Y=this.number,z=0;if($.hasOwnProperty("0"))z=1;$.forEach((U,Q)=>{this._worksheet.getCell(Q+z,Y).value=U})}_applyStyle($,Y){return this.style[$]=Y,this.eachCell((z)=>{z[$]=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=[],z=null;if($)$.forEach((U,Q)=>{if(U.isDefault){if(z)z=null}else if(!z||!U.equivalentTo(z))z={min:Q+1,max:Q+1,width:U.width!==void 0?U.width:9,style:U.style,isCustomWidth:U.isCustomWidth,hidden:U.hidden,outlineLevel:U.outlineLevel,collapsed:U.collapsed},Y.push(z);else z.max=Q+1});return Y.length?Y:void 0}static fromModel($,Y){Y=Y||[];let z=[],U=1,Q=0;Y=Y.sort(function(J,I){return J.min-I.min});while(Q{var Pc0=n4();class xw{constructor($,Y,z=0){if(this.worksheet=$,!Y)this.nativeCol=0,this.nativeColOff=0,this.nativeRow=0,this.nativeRowOff=0;else if(typeof Y==="string"){let U=Pc0.decodeAddress(Y);this.nativeCol=U.col+z,this.nativeColOff=0,this.nativeRow=U.row+z,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+z,this.row=Y.row+z;else this.nativeCol=0,this.nativeColOff=0,this.nativeRow=0,this.nativeRowOff=0}static asInstance($){return $ instanceof xw||$==null?$:new xw($)}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}}Q60.exports=xw});var G60=E((mp1,K60)=>{var jc0=n4(),fw=J60();class I60{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:z,hyperlinks:U}){if(this.type=$,this.imageId=Y,$==="image")if(typeof z==="string"){let Q=jc0.decode(z);this.range={tl:new fw(this.worksheet,{col:Q.left,row:Q.top},-1),br:new fw(this.worksheet,{col:Q.right,row:Q.bottom},0),editAs:"oneCell"}}else this.range={tl:new fw(this.worksheet,z.tl,0),br:z.br&&new fw(this.worksheet,z.br,0),ext:z.ext,editAs:z.editAs,hyperlinks:U||z.hyperlinks}}}K60.exports=I60});var Z60=E((lp1,X60)=>{var uw=n4();class H60{constructor($,Y,z){this.table=$,this.column=Y,this.index=z}_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 W60{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 z=(G,H)=>{if(!G)throw Error(H)};z($.ref,"Table must have ref"),z($.columns,"Table must have column definitions"),z($.rows,"Table must have row definitions"),$.tl=uw.decodeAddress($.ref);let{row:U,col:Q}=$.tl;z(U>0,"Table must be on valid row"),z(Q>0,"Table must be on valid col");let{width:J,filterHeight:I,tableHeight:K}=this;$.autoFilterRef=uw.encode(U,Q,U+I-1,Q+J-1),$.tableRef=uw.encode(U,Q,U+K-1,Q+J-1),$.columns.forEach((G,H)=>{if(z(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:z}=this,{row:U,col:Q}=z.tl,J=0;if(z.headerRow){let I=Y.getRow(U+J++);z.columns.forEach((K,G)=>{let{style:H,name:W}=K,X=I.getCell(Q+G);X.value=W,$(X,H)})}if(z.rows.forEach((I)=>{let K=Y.getRow(U+J++);I.forEach((G,H)=>{let W=K.getCell(Q+H);W.value=G,$(W,z.columns[H].style)})}),z.totalsRow){let I=Y.getRow(U+J++);z.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:z,col:U}=Y.tl,Q=0;if(Y.headerRow){let J=$.getRow(z+Q++);Y.columns.forEach((I,K)=>{let G=J.getCell(U+K);G.value=I.name})}if(Y.rows.forEach((J)=>{let I=$.getRow(z+Q++);J.forEach((K,G)=>{let H=I.getCell(U+G);H.value=K})}),Y.totalsRow){let J=$.getRow(z+Q++);Y.columns.forEach((I,K)=>{let G=J.getCell(U+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 $=uw.decodeAddress(this._cache.ref);if(this.ref!==this._cache.ref)for(let Y=0;Y{U.push(Y[Q])});else this.table.columns.splice(z,0,$),this.table.rows.forEach((U,Q)=>{U.splice(z,0,Y[Q])})}removeColumns($,Y=1){this.cacheState(),this.table.columns.splice($,Y),this.table.rows.forEach((z)=>{z.splice($,Y)})}_assign($,Y,z){this.cacheState(),$[Y]=z}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=$}}X60.exports=W60});var Og=E((op1,V60)=>{class q60{constructor($){this.model=$||{}}add($,Y){return this.model[$]=Y}find($){return this.model[$]}remove($){this.model[$]=void 0}}V60.exports=q60});var Mg=E((rp1,L60)=>{var wg=I0("crypto"),Tc0={hash($,...Y){let z=wg.createHash($);return z.update(Buffer.concat(Y)),z.digest()},convertPasswordToHash($,Y,z,U){if(Y=Y.toLowerCase(),wg.getHashes().indexOf(Y)<0)throw Error(`Hash algorithm '${Y}' not supported!`);let J=Buffer.from($,"utf16le"),I=this.hash(Y,Buffer.from(z,"base64"),J);for(let K=0;K{var F60=($,Y)=>({...$,...Y.reduce((z,U)=>{if($[U])z[U]={...$[U]};return z},{})}),t5=($,Y,z,U=[])=>{if($[z])Y[z]=F60($[z],U)},Ec0=($)=>Object.keys($).length===0,Cc0=($)=>{if(!$)return $;if(Ec0($))return{};let Y={...$};if(t5($,Y,"font",["color"]),t5($,Y,"alignment"),t5($,Y,"protection"),$.border)t5($,Y,"border"),t5($.border,Y.border,"top",["color"]),t5($.border,Y.border,"left",["color"]),t5($.border,Y.border,"bottom",["color"]),t5($.border,Y.border,"right",["color"]),t5($.border,Y.border,"diagonal",["color"]);if($.fill){if(t5($,Y,"fill",["fgColor","bgColor","center"]),$.fill.stops)Y.fill.stops=$.fill.stops.map((z)=>F60(z,["color"]))}return Y};Rc0.copyStyle=Cc0});var j60=E((ap1,P60)=>{var fH=Y6(),uH=n4(),bH=z3(),w60=gw(),bw=kw(),vc0=H5(),Ng=G60(),M60=Z60(),N60=Og(),D60=Mg(),{copyStyle:A60}=O60();class B60{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 N60,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 bH;return this._rows.forEach((Y)=>{if(Y){let z=Y.dimensions;if(z)$.expand(Y.number,z.min,Y.number,z.max)}}),$}get columns(){return this._columns}set columns($){this._headerRowCount=$.reduce((U,Q)=>{let J=Q.header&&1||Q.headers&&Q.headers.length||0;return Math.max(U,J)},0);let Y=1,z=this._columns=[];$.forEach((U)=>{let Q=new bw(this,Y++,!1);z.push(Q),Q.defn=U})}getColumnKey($){return this._keys[$]}setColumnKey($,Y){this._keys[$]=Y}deleteColumnKey($){delete this._keys[$]}eachColumnKey($){fH.each(this._keys,$)}getColumn($){if(typeof $==="string"){let Y=this._keys[$];if(Y)return Y;$=uH.l2n($)}if(!this._columns)this._columns=[];if($>this._columns.length){let Y=this._columns.length+1;while(Y<=$)this._columns.push(new bw(this,Y++))}return this._columns[$-1]}spliceColumns($,Y,...z){let Q=this._rows.length;if(z.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=z.length-Y,I=$+Y,K=this._columns.length;if(J<0)for(let G=$+z.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<$+z.length;G++)this.getColumn(G).defn=null;this.workbook.definedNames.spliceColumns(this.name,$,Y,z.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((z)=>{z.eachCell(({col:U})=>{if(!$[U])$[U]=!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 w60(this,$);return Y}getRows($,Y){if(Y<1)return;let z=[];for(let U=$;U<$+Y;U++)z.push(this.getRow(U));return z}addRow($,Y="n"){let z=this._nextRow,U=this.getRow(z);return U.values=$,this._setStyleOption(z,Y[0]==="i"?Y:"n"),U}addRows($,Y="n"){let z=[];return $.forEach((U)=>{z.push(this.addRow(U,Y))}),z}insertRow($,Y,z="n"){return this.spliceRows($,0,Y),this._setStyleOption($,z),this.getRow($)}insertRows($,Y,z="n"){if(this.spliceRows($,0,...Y),z!=="n"){for(let U=0;U{Q.getCell(I).style=A60(J.style)}),Q.height=U.height}duplicateRow($,Y,z=!1){let U=this._rows[$-1],Q=Array(Y).fill(U.values);this.spliceRows($+1,z?0:Y,...Q);for(let J=0;J{I.getCell(G).style=K.style})}}spliceRows($,Y,...z){let U=$+Y,Q=z.length,J=Q-Y,I=this._rows.length,K,G;if(J<0){if($===I)this._rows[I-1]=void 0;for(K=U;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>=U;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(z&&z.hasValues)Y(z,z.number)})}getSheetValues(){let $=[];return this._rows.forEach((Y)=>{if(Y)$[Y.number]=Y.values}),$}findCell($,Y){let z=uH.getAddress($,Y),U=this._rows[z.row-1];return U?U.findCell(z.col):void 0}getCell($,Y){let z=uH.getAddress($,Y);return this.getRow(z.row).getCellEx(z)}mergeCells(...$){let Y=new bH($);this._mergeCellsInternal(Y)}mergeCellsWithoutStyle(...$){let Y=new bH($);this._mergeCellsInternal(Y,!0)}_mergeCellsInternal($,Y){fH.each(this._merges,(U)=>{if(U.intersects($))throw Error("Cannot merge already merged cells")});let z=this.getCell($.top,$.left);for(let U=$.top;U<=$.bottom;U++)for(let Q=$.left;Q<=$.right;Q++)if(U>$.top||Q>$.left)this.getCell(U,Q).merge(z,Y);this._merges[z.address]=$}_unMergeMaster($){let Y=this._merges[$.address];if(Y){for(let z=Y.top;z<=Y.bottom;z++)for(let U=Y.left;U<=Y.right;U++)this.getCell(z,U).unmerge();delete this._merges[$.address]}}get hasMerges(){return fH.some(this._merges,Boolean)}unMergeCells(...$){let Y=new bH($);for(let z=Y.top;z<=Y.bottom;z++)for(let U=Y.left;U<=Y.right;U++){let Q=this.findCell(z,U);if(Q){if(Q.type===vc0.ValueType.Merge)this._unMergeMaster(Q.master);else if(this._merges[Q.address])this._unMergeMaster(Q)}}}fillFormula($,Y,z,U="shared"){let Q=uH.decode($),{top:J,left:I,bottom:K,right:G}=Q,H=G-I+1,W=uH.encodeAddress(J,I),X=U==="shared",Z;if(typeof z==="function")Z=z;else if(Array.isArray(z))if(Array.isArray(z[0]))Z=(V,F)=>z[V-J][F-I];else Z=(V,F)=>z[(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:U,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 z={type:"image",imageId:$,range:Y};this._media.push(new Ng(this,z))}getImages(){return this._media.filter(($)=>$.type==="image")}addBackgroundImage($){let Y={type:"background",imageId:$};this._media.push(new Ng(this,Y))}getBackgroundImageId(){let $=this._media.find((Y)=>Y.type==="background");return $&&$.imageId}protect($,Y){return new Promise((z)=>{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=D60.randomBytes(16).toString("base64"),this.sheetProtection.spinCount=Y&&"spinCount"in Y?Y.spinCount:1e5,this.sheetProtection.hashValue=D60.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}z()})}unprotect(){this.sheetProtection=null}addTable($){let Y=new M60(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((U)=>U.model),sheetProtection:this.sheetProtection,tables:Object.values(this.tables).map((U)=>U.model),conditionalFormattings:this.conditionalFormattings};$.cols=bw.toModel(this.columns);let Y=$.rows=[],z=$.dimensions=new bH;return this._rows.forEach((U)=>{let Q=U&&U.model;if(Q)z.expand(Q.number,Q.min,Q.number,Q.max),Y.push(Q)}),$.merges=[],fH.each(this._merges,(U)=>{$.merges.push(U.range)}),$}_parseRows($){this._rows=[],$.rows.forEach((Y)=>{let z=new w60(this,Y.number);this._rows[z.number-1]=z,z.model=Y})}_parseMergeCells($){fH.each($.mergeCells,(Y)=>{this.mergeCellsWithoutStyle(Y)})}set model($){this.name=$.name,this._columns=bw.fromModel(this,$.cols),this._parseRows($),this._parseMergeCells($),this.dataValidations=new N60($.dataValidations),this.properties=$.properties,this.pageSetup=$.pageSetup,this.headerFooter=$.headerFooter,this.views=$.views,this.autoFilter=$.autoFilter,this._media=$.media.map((Y)=>new Ng(this,Y)),this.sheetProtection=$.sheetProtection,this.tables=$.tables.reduce((Y,z)=>{let U=new M60;return U.model=z,Y[z.name]=U,Y},{}),this.conditionalFormattings=$.conditionalFormattings}}P60.exports=B60});var R60=E((tp1,C60)=>{var T60=Y6(),iw=n4();class E60{constructor($){this.template=$,this.sheets={}}addCell($){this.addCellEx(iw.decodeEx($))}getCell($){return this.findCellEx(iw.decodeEx($),!0)}findCell($){return this.findCellEx(iw.decodeEx($),!1)}findCellAt($,Y,z){let U=this.sheets[$],Q=U&&U[Y];return Q&&Q[z]}addCellEx($){if($.top)for(let Y=$.top;Y<=$.bottom;Y++)for(let z=$.left;z<=$.right;z++)this.getCellAt($.sheetName,Y,z);else this.findCellEx($,!0)}getCellEx($){return this.findCellEx($,!0)}findCellEx($,Y){let z=this.findSheet($,Y),U=this.findSheetRow(z,$,Y);return this.findRowCell(U,$,Y)}getCellAt($,Y,z){let U=this.sheets[$]||(this.sheets[$]=[]),Q=U[Y]||(U[Y]=[]);return Q[z]||(Q[z]={sheetName:$,address:iw.n2l(z)+Y,row:Y,col:z})}removeCellEx($){let Y=this.findSheet($);if(!Y)return;let z=this.findSheetRow(Y,$);if(!z)return;delete z[$.col]}forEachInSheet($,Y){let z=this.sheets[$];if(z)z.forEach((U,Q)=>{if(U)U.forEach((J,I)=>{if(J)Y(J,Q,I)})})}forEach($){T60.each(this.sheets,(Y,z)=>{this.forEachInSheet(z,$)})}map($){let Y=[];return this.forEach((z)=>{Y.push($(z))}),Y}findSheet($,Y){let z=$.sheetName;if(this.sheets[z])return this.sheets[z];if(Y)return this.sheets[z]=[];return}findSheetRow($,Y,z){let{row:U}=Y;if($&&$[U])return $[U];if(z)return $[U]=[];return}findRowCell($,Y,z){let{col:U}=Y;if($&&$[U])return $[U];if(z)return $[U]=this.template?Object.assign(Y,JSON.parse(JSON.stringify(this.template))):Y;return}spliceRows($,Y,z,U){let Q=this.sheets[$];if(Q){let J=[];for(let I=0;I{I.splice(Y,z,...J)})}}}C60.exports=E60});var Dg=E((ep1,h60)=>{var eQ=Y6(),iH=n4(),_60=R60(),hc0=z3(),Sc0=/[$](\w+)[$](\d+)(:[$](\w+)[$](\d+))?/;class v60{constructor(){this.matrixMap={}}getMatrix($){return this.matrixMap[$]||(this.matrixMap[$]=new _60)}add($,Y){let z=iH.decodeEx($);this.addEx(z,Y)}addEx($,Y){let z=this.getMatrix(Y);if($.top)for(let U=$.left;U<=$.right;U++)for(let Q=$.top;Q<=$.bottom;Q++){let J={sheetName:$.sheetName,address:iH.n2l(U)+Q,row:Q,col:U};z.addCellEx(J)}else z.addCellEx($)}remove($,Y){let z=iH.decodeEx($);this.removeEx(z,Y)}removeEx($,Y){this.getMatrix(Y).removeCellEx($)}removeAllNames($){eQ.each(this.matrixMap,(Y)=>{Y.removeCellEx($)})}forEach($){eQ.each(this.matrixMap,(Y,z)=>{Y.forEach((U)=>{$(z,U)})})}getNames($){return this.getNamesEx(iH.decodeEx($))}getNamesEx($){return eQ.map(this.matrixMap,(Y,z)=>Y.findCellEx($)&&z).filter(Boolean)}_explore($,Y){Y.mark=!1;let{sheetName:z}=Y,U=new hc0(Y.row,Y.col,Y.row,Y.col,z),Q,J;function I(G,H){let W=$.findCellAt(z,G,Y.col);if(!W||!W.mark)return!1;return U[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=U.top;J<=U.bottom;J++){let X=$.findCellAt(z,J,G);if(X&&X.mark)W.push(X);else return!1}U[H]=G;for(let X=0;X{U.mark=!0});let z=Y.map((U)=>U.mark&&this._explore(Y,U)).filter(Boolean).map((U)=>U.$shortRange);return{name:$,ranges:z}}normaliseMatrix($,Y){$.forEachInSheet(Y,(z,U,Q)=>{if(z){if(z.row!==U||z.col!==Q)z.row=U,z.col=Q,z.address=iH.n2l(Q)+U}})}spliceRows($,Y,z,U){eQ.each(this.matrixMap,(Q)=>{Q.spliceRows($,Y,z,U),this.normaliseMatrix(Q,$)})}spliceColumns($,Y,z,U){eQ.each(this.matrixMap,(Q)=>{Q.spliceColumns($,Y,z,U),this.normaliseMatrix(Q,$)})}get model(){return eQ.map(this.matrixMap,($,Y)=>this.getRanges(Y,$)).filter(($)=>$.ranges.length)}set model($){let Y=this.matrixMap={};$.forEach((z)=>{let U=Y[z.name]=new _60;z.ranges.forEach((Q)=>{if(Sc0.test(Q.split("!").pop()||""))U.addCell(Q)})})}}h60.exports=v60});var I6=E(($d1,Ag)=>{if(typeof process>"u"||!process.version||process.version.indexOf("v0.")===0||process.version.indexOf("v1.")===0&&process.version.indexOf("v1.8.")!==0)Ag.exports={nextTick:gc0};else Ag.exports=process;function gc0($,Y,z,U){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,z)});case 4:return process.nextTick(function(){$.call(null,Y,z,U)});default:J=Array(Q-1),I=0;while(I{var yc0={}.toString;S60.exports=Array.isArray||function($){return yc0.call($)=="[object Array]"}});var K6=E((Bg,y60)=>{var nw=I0("buffer"),U3=nw.Buffer;function g60($,Y){for(var z in $)Y[z]=$[z]}if(U3.from&&U3.alloc&&U3.allocUnsafe&&U3.allocUnsafeSlow)y60.exports=nw;else g60(nw,Bg),Bg.Buffer=YJ;function YJ($,Y,z){return U3($,Y,z)}g60(U3,YJ);YJ.from=function($,Y,z){if(typeof $==="number")throw TypeError("Argument must not be a number");return U3($,Y,z)};YJ.alloc=function($,Y,z){if(typeof $!=="number")throw TypeError("Argument must be a number");var U=U3($);if(Y!==void 0)if(typeof z==="string")U.fill(Y,z);else U.fill(Y);else U.fill(0);return U};YJ.allocUnsafe=function($){if(typeof $!=="number")throw TypeError("Argument must be a number");return U3($)};YJ.allocUnsafeSlow=function($){if(typeof $!=="number")throw TypeError("Argument must be a number");return nw.SlowBuffer($)}});var M4=E((sc0)=>{function kc0($){if(Array.isArray)return Array.isArray($);return cw($)==="[object Array]"}sc0.isArray=kc0;function xc0($){return typeof $==="boolean"}sc0.isBoolean=xc0;function fc0($){return $===null}sc0.isNull=fc0;function uc0($){return $==null}sc0.isNullOrUndefined=uc0;function bc0($){return typeof $==="number"}sc0.isNumber=bc0;function ic0($){return typeof $==="string"}sc0.isString=ic0;function nc0($){return typeof $==="symbol"}sc0.isSymbol=nc0;function cc0($){return $===void 0}sc0.isUndefined=cc0;function pc0($){return cw($)==="[object RegExp]"}sc0.isRegExp=pc0;function dc0($){return typeof $==="object"&&$!==null}sc0.isObject=dc0;function mc0($){return cw($)==="[object Date]"}sc0.isDate=mc0;function lc0($){return cw($)==="[object Error]"||$ instanceof Error}sc0.isError=lc0;function oc0($){return typeof $==="function"}sc0.isFunction=oc0;function rc0($){return $===null||typeof $==="boolean"||typeof $==="number"||typeof $==="string"||typeof $==="symbol"||typeof $>"u"}sc0.isPrimitive=rc0;sc0.isBuffer=I0("buffer").Buffer.isBuffer;function cw($){return Object.prototype.toString.call($)}});var k60=E((Ud1,Pg)=>{if(typeof Object.create==="function")Pg.exports=function(Y,z){if(z)Y.super_=z,Y.prototype=Object.create(z.prototype,{constructor:{value:Y,enumerable:!1,writable:!0,configurable:!0}})};else Pg.exports=function(Y,z){if(z){Y.super_=z;var U=function(){};U.prototype=z.prototype,Y.prototype=new U,Y.prototype.constructor=Y}}});var X1=E((Qd1,jg)=>{try{if(pw=I0("util"),typeof pw.inherits!=="function")throw"";jg.exports=pw.inherits}catch($){jg.exports=k60()}var pw});var f60=E((Jd1,Tg)=>{function Zp0($,Y){if(!($ instanceof Y))throw TypeError("Cannot call a class as a function")}var x60=K6().Buffer,nH=I0("util");function qp0($,Y,z){$.copy(Y,z)}Tg.exports=function(){function $(){Zp0(this,$),this.head=null,this.tail=null,this.length=0}return $.prototype.push=function(z){var U={data:z,next:null};if(this.length>0)this.tail.next=U;else this.head=U;this.tail=U,++this.length},$.prototype.unshift=function(z){var U={data:z,next:this.head};if(this.length===0)this.tail=U;this.head=U,++this.length},$.prototype.shift=function(){if(this.length===0)return;var z=this.head.data;if(this.length===1)this.head=this.tail=null;else this.head=this.head.next;return--this.length,z},$.prototype.clear=function(){this.head=this.tail=null,this.length=0},$.prototype.join=function(z){if(this.length===0)return"";var U=this.head,Q=""+U.data;while(U=U.next)Q+=z+U.data;return Q},$.prototype.concat=function(z){if(this.length===0)return x60.alloc(0);var U=x60.allocUnsafe(z>>>0),Q=this.head,J=0;while(Q)qp0(Q.data,U,J),J+=Q.data.length,Q=Q.next;return U},$}();if(nH&&nH.inspect&&nH.inspect.custom)Tg.exports.prototype[nH.inspect.custom]=function(){var $=nH.inspect({length:this.length});return this.constructor.name+" "+$}});var Eg=E((Id1,u60)=>{var dw=I6();function Vp0($,Y){var z=this,U=this._readableState&&this._readableState.destroyed,Q=this._writableState&&this._writableState.destroyed;if(U||Q){if(Y)Y($);else if($){if(!this._writableState)dw.nextTick(mw,this,$);else if(!this._writableState.errorEmitted)this._writableState.errorEmitted=!0,dw.nextTick(mw,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(!z._writableState)dw.nextTick(mw,z,J);else if(!z._writableState.errorEmitted)z._writableState.errorEmitted=!0,dw.nextTick(mw,z,J)}else if(Y)Y(J)}),this}function Lp0(){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 mw($,Y){$.emit("error",Y)}u60.exports={destroy:Vp0,undestroy:Lp0}});var f7=E((Kd1,b60)=>{b60.exports=I0("util").deprecate});var Rg=E((Gd1,o60)=>{var rY=I6();o60.exports=Z6;function n60($){var Y=this;this.next=null,this.entry=null,this.finish=function(){Sp0(Y,$)}}var Fp0=["v0.10","v0.9."].indexOf(process.version.slice(0,5))>-1?setImmediate:rY.nextTick,zJ;Z6.WritableState=pH;var c60=Object.create(M4());c60.inherits=X1();var Op0={deprecate:f7()},p60=I0("stream"),ow=K6().Buffer,wp0=(typeof global<"u"?global:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function Mp0($){return ow.from($)}function Np0($){return ow.isBuffer($)||$ instanceof wp0}var d60=Eg();c60.inherits(Z6,p60);function Dp0(){}function pH($,Y){zJ=zJ||sY(),$=$||{};var z=Y instanceof zJ;if(this.objectMode=!!$.objectMode,z)this.objectMode=this.objectMode||!!$.writableObjectMode;var{highWaterMark:U,writableHighWaterMark:Q}=$,J=this.objectMode?16:16384;if(U||U===0)this.highWaterMark=U;else if(z&&(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){Cp0(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)}pH.prototype.getBuffer=function(){var Y=this.bufferedRequest,z=[];while(Y)z.push(Y),Y=Y.next;return z};(function(){try{Object.defineProperty(pH.prototype,"buffer",{get:Op0.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch($){}})();var lw;if(typeof Symbol==="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]==="function")lw=Function.prototype[Symbol.hasInstance],Object.defineProperty(Z6,Symbol.hasInstance,{value:function($){if(lw.call(this,$))return!0;if(this!==Z6)return!1;return $&&$._writableState instanceof pH}});else lw=function($){return $ instanceof this};function Z6($){if(zJ=zJ||sY(),!lw.call(Z6,this)&&!(this instanceof zJ))return new Z6($);if(this._writableState=new pH($,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}p60.call(this)}Z6.prototype.pipe=function(){this.emit("error",Error("Cannot pipe, not readable"))};function Ap0($,Y){var z=Error("write after end");$.emit("error",z),rY.nextTick(Y,z)}function Bp0($,Y,z,U){var Q=!0,J=!1;if(z===null)J=TypeError("May not write null values to stream");else if(typeof z!=="string"&&z!==void 0&&!Y.objectMode)J=TypeError("Invalid non-string/buffer chunk");if(J)$.emit("error",J),rY.nextTick(U,J),Q=!1;return Q}Z6.prototype.write=function($,Y,z){var U=this._writableState,Q=!1,J=!U.objectMode&&Np0($);if(J&&!ow.isBuffer($))$=Mp0($);if(typeof Y==="function")z=Y,Y=null;if(J)Y="buffer";else if(!Y)Y=U.defaultEncoding;if(typeof z!=="function")z=Dp0;if(U.ended)Ap0(this,z);else if(J||Bp0(this,U,$,z))U.pendingcb++,Q=jp0(this,U,J,$,Y,z);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)m60(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 Pp0($,Y,z){if(!$.objectMode&&$.decodeStrings!==!1&&typeof Y==="string")Y=ow.from(Y,z);return Y}Object.defineProperty(Z6.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function jp0($,Y,z,U,Q,J){if(!z){var I=Pp0(Y,U,Q);if(U!==I)z=!0,Q="buffer",U=I}var K=Y.objectMode?1:U.length;Y.length+=K;var G=Y.length{var r60=I6(),gp0=Object.keys||function($){var Y=[];for(var z in $)Y.push(z);return Y};t60.exports=Q3;var s60=Object.create(M4());s60.inherits=X1();var a60=vg(),_g=Rg();s60.inherits(Q3,a60);{rw=gp0(_g.prototype);for(dH=0;dH{var Sg=K6().Buffer,e60=Sg.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 xp0($){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 fp0($){var Y=xp0($);if(typeof Y!=="string"&&(Sg.isEncoding===e60||!e60($)))throw Error("Unknown encoding: "+$);return Y||$}sp0.StringDecoder=lH;function lH($){this.encoding=fp0($);var Y;switch(this.encoding){case"utf16le":this.text=pp0,this.end=dp0,Y=4;break;case"utf8":this.fillLast=ip0,Y=4;break;case"base64":this.text=mp0,this.end=lp0,Y=3;break;default:this.write=op0,this.end=rp0;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=Sg.allocUnsafe(Y)}lH.prototype.write=function($){if($.length===0)return"";var Y,z;if(this.lastNeed){if(Y=this.fillLast($),Y===void 0)return"";z=this.lastNeed,this.lastNeed=0}else z=0;if(z<$.length)return Y?Y+this.text($,z):this.text($,z);return Y||""};lH.prototype.end=cp0;lH.prototype.text=np0;lH.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 hg($){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 up0($,Y,z){var U=Y.length-1;if(U=0){if(Q>0)$.lastNeed=Q-1;return Q}if(--U=0){if(Q>0)$.lastNeed=Q-2;return Q}if(--U=0){if(Q>0)if(Q===2)Q=0;else $.lastNeed=Q-3;return Q}return 0}function bp0($,Y,z){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 ip0($){var Y=this.lastTotal-this.lastNeed,z=bp0(this,$,Y);if(z!==void 0)return z;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 np0($,Y){var z=up0(this,$,Y);if(!this.lastNeed)return $.toString("utf8",Y);this.lastTotal=z;var U=$.length-(z-this.lastNeed);return $.copy(this.lastChar,0,U),$.toString("utf8",Y,U)}function cp0($){var Y=$&&$.length?this.write($):"";if(this.lastNeed)return Y+"�";return Y}function pp0($,Y){if(($.length-Y)%2===0){var z=$.toString("utf16le",Y);if(z){var U=z.charCodeAt(z.length-1);if(U>=55296&&U<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=$[$.length-2],this.lastChar[1]=$[$.length-1],z.slice(0,-1)}return z}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=$[$.length-1],$.toString("utf16le",Y,$.length-1)}function dp0($){var Y=$&&$.length?this.write($):"";if(this.lastNeed){var z=this.lastTotal-this.lastNeed;return Y+this.lastChar.toString("utf16le",0,z)}return Y}function mp0($,Y){var z=($.length-Y)%3;if(z===0)return $.toString("base64",Y);if(this.lastNeed=3-z,this.lastTotal=3,z===1)this.lastChar[0]=$[$.length-1];else this.lastChar[0]=$[$.length-2],this.lastChar[1]=$[$.length-1];return $.toString("base64",Y,$.length-z)}function lp0($){var Y=$&&$.length?this.write($):"";if(this.lastNeed)return Y+this.lastChar.toString("base64",0,3-this.lastNeed);return Y}function op0($){return $.toString(this.encoding)}function rp0($){return $&&$.length?this.write($):""}});var vg=E((Zd1,X80)=>{var QJ=I6();X80.exports=P4;var tp0=$J(),oH;P4.ReadableState=I80;var Xd1=I0("events").EventEmitter,U80=function($,Y){return $.listeners(Y).length},ug=I0("stream"),rH=K6().Buffer,ep0=(typeof global<"u"?global:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function $d0($){return rH.from($)}function Yd0($){return rH.isBuffer($)||$ instanceof ep0}var Q80=Object.create(M4());Q80.inherits=X1();var yg=I0("util"),t1=void 0;if(yg&&yg.debuglog)t1=yg.debuglog("stream");else t1=function(){};var zd0=f60(),J80=Eg(),UJ;Q80.inherits(P4,ug);var kg=["error","close","destroy","pause","resume"];function Ud0($,Y,z){if(typeof $.prependListener==="function")return $.prependListener(Y,z);if(!$._events||!$._events[Y])$.on(Y,z);else if(tp0($._events[Y]))$._events[Y].unshift(z);else $._events[Y]=[z,$._events[Y]]}function I80($,Y){oH=oH||sY(),$=$||{};var z=Y instanceof oH;if(this.objectMode=!!$.objectMode,z)this.objectMode=this.objectMode||!!$.readableObjectMode;var{highWaterMark:U,readableHighWaterMark:Q}=$,J=this.objectMode?16:16384;if(U||U===0)this.highWaterMark=U;else if(z&&(Q||Q===0))this.highWaterMark=Q;else this.highWaterMark=J;if(this.highWaterMark=Math.floor(this.highWaterMark),this.buffer=new zd0,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(!UJ)UJ=gg().StringDecoder;this.decoder=new UJ($.encoding),this.encoding=$.encoding}}function P4($){if(oH=oH||sY(),!(this instanceof P4))return new P4($);if(this._readableState=new I80($,this),this.readable=!0,$){if(typeof $.read==="function")this._read=$.read;if(typeof $.destroy==="function")this._destroy=$.destroy}ug.call(this)}Object.defineProperty(P4.prototype,"destroyed",{get:function(){if(this._readableState===void 0)return!1;return this._readableState.destroyed},set:function($){if(!this._readableState)return;this._readableState.destroyed=$}});P4.prototype.destroy=J80.destroy;P4.prototype._undestroy=J80.undestroy;P4.prototype._destroy=function($,Y){this.push(null),Y($)};P4.prototype.push=function($,Y){var z=this._readableState,U;if(!z.objectMode){if(typeof $==="string"){if(Y=Y||z.defaultEncoding,Y!==z.encoding)$=rH.from($,Y),Y="";U=!0}}else U=!0;return K80(this,$,Y,!1,U)};P4.prototype.unshift=function($){return K80(this,$,null,!0,!1)};function K80($,Y,z,U,Q){var J=$._readableState;if(Y===null)J.reading=!1,Kd0($,J);else{var I;if(!Q)I=Qd0(J,Y);if(I)$.emit("error",I);else if(J.objectMode||Y&&Y.length>0){if(typeof Y!=="string"&&!J.objectMode&&Object.getPrototypeOf(Y)!==rH.prototype)Y=$d0(Y);if(U)if(J.endEmitted)$.emit("error",Error("stream.unshift() after end event"));else xg($,J,Y,!0);else if(J.ended)$.emit("error",Error("stream.push() after EOF"));else if(J.reading=!1,J.decoder&&!z)if(Y=J.decoder.write(Y),J.objectMode||Y.length!==0)xg($,J,Y,!1);else G80($,J);else xg($,J,Y,!1)}else if(!U)J.reading=!1}return Jd0(J)}function xg($,Y,z,U){if(Y.flowing&&Y.length===0&&!Y.sync)$.emit("data",z),$.read(0);else{if(Y.length+=Y.objectMode?1:z.length,U)Y.buffer.unshift(z);else Y.buffer.push(z);if(Y.needReadable)sw($)}G80($,Y)}function Qd0($,Y){var z;if(!Yd0(Y)&&typeof Y!=="string"&&Y!==void 0&&!$.objectMode)z=TypeError("Invalid non-string/buffer chunk");return z}function Jd0($){return!$.ended&&($.needReadable||$.length<$.highWaterMark||$.length===0)}P4.prototype.isPaused=function(){return this._readableState.flowing===!1};P4.prototype.setEncoding=function($){if(!UJ)UJ=gg().StringDecoder;return this._readableState.decoder=new UJ($),this._readableState.encoding=$,this};var $80=8388608;function Id0($){if($>=$80)$=$80;else $--,$|=$>>>1,$|=$>>>2,$|=$>>>4,$|=$>>>8,$|=$>>>16,$++;return $}function Y80($,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=Id0($);if($<=Y.length)return $;if(!Y.ended)return Y.needReadable=!0,0;return Y.length}P4.prototype.read=function($){t1("read",$),$=parseInt($,10);var Y=this._readableState,z=$;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)fg(this);else sw(this);return null}if($=Y80($,Y),$===0&&Y.ended){if(Y.length===0)fg(this);return null}var U=Y.needReadable;if(t1("need readable",U),Y.length===0||Y.length-$0)Q=H80($,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(z!==$&&Y.ended)fg(this)}if(Q!==null)this.emit("data",Q);return Q};function Kd0($,Y){if(Y.ended)return;if(Y.decoder){var z=Y.decoder.end();if(z&&z.length)Y.buffer.push(z),Y.length+=Y.objectMode?1:z.length}Y.ended=!0,sw($)}function sw($){var Y=$._readableState;if(Y.needReadable=!1,!Y.emittedReadable)if(t1("emitReadable",Y.flowing),Y.emittedReadable=!0,Y.sync)QJ.nextTick(z80,$);else z80($)}function z80($){t1("emit readable"),$.emit("readable"),bg($)}function G80($,Y){if(!Y.readingMore)Y.readingMore=!0,QJ.nextTick(Gd0,$,Y)}function Gd0($,Y){var z=Y.length;while(!Y.reading&&!Y.flowing&&!Y.ended&&Y.length1&&W80(U.pipes,$)!==-1)&&!H)t1("false write response, pause",U.awaitDrain),U.awaitDrain++,X=!0;z.pause()}}function q(O){if(t1("onerror",O),w(),$.removeListener("error",q),U80($,"error")===0)$.emit("error",O)}Ud0($,"error",q);function V(){$.removeListener("finish",F),w()}$.once("close",V);function F(){t1("onfinish"),$.removeListener("close",V),w()}$.once("finish",F);function w(){t1("unpipe"),z.unpipe($)}if($.emit("pipe",z),!U.flowing)t1("pipe resume"),z.resume();return $};function Hd0($){return function(){var Y=$._readableState;if(t1("pipeOnDrain",Y.awaitDrain),Y.awaitDrain)Y.awaitDrain--;if(Y.awaitDrain===0&&U80($,"data"))Y.flowing=!0,bg($)}}P4.prototype.unpipe=function($){var Y=this._readableState,z={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,z);return this}if(!$){var{pipes:U,pipesCount:Q}=Y;Y.pipes=null,Y.pipesCount=0,Y.flowing=!1;for(var J=0;J=Y.length){if(Y.decoder)z=Y.buffer.join("");else if(Y.buffer.length===1)z=Y.buffer.head.data;else z=Y.buffer.concat(Y.length);Y.buffer.clear()}else z=qd0($,Y.buffer,Y.decoder);return z}function qd0($,Y,z){var U;if($J.length?J.length:$;if(I===J.length)Q+=J;else Q+=J.slice(0,$);if($-=I,$===0){if(I===J.length)if(++U,z.next)Y.head=z.next;else Y.head=Y.tail=null;else Y.head=z,z.data=J.slice(I);break}++U}return Y.length-=U,Q}function Ld0($,Y){var z=rH.allocUnsafe($),U=Y.head,Q=1;U.data.copy(z),$-=U.data.length;while(U=U.next){var J=U.data,I=$>J.length?J.length:$;if(J.copy(z,z.length-$,0,I),$-=I,$===0){if(I===J.length)if(++Q,U.next)Y.head=U.next;else Y.head=Y.tail=null;else Y.head=U,U.data=J.slice(I);break}++Q}return Y.length-=Q,z}function fg($){var Y=$._readableState;if(Y.length>0)throw Error('"endReadable()" called on non-empty stream');if(!Y.endEmitted)Y.ended=!0,QJ.nextTick(Fd0,Y,$)}function Fd0($,Y){if(!$.endEmitted&&$.length===0)$.endEmitted=!0,Y.readable=!1,Y.emit("end")}function W80($,Y){for(var z=0,U=$.length;z{V80.exports=J3;var aw=sY(),q80=Object.create(M4());q80.inherits=X1();q80.inherits(J3,aw);function Od0($,Y){var z=this._transformState;z.transforming=!1;var U=z.writecb;if(!U)return this.emit("error",Error("write callback called multiple times"));if(z.writechunk=null,z.writecb=null,Y!=null)this.push(Y);U($);var Q=this._readableState;if(Q.reading=!1,Q.needReadable||Q.length{O80.exports=sH;var L80=ig(),F80=Object.create(M4());F80.inherits=X1();F80.inherits(sH,L80);function sH($){if(!(this instanceof sH))return new sH($);L80.call(this,$)}sH.prototype._transform=function($,Y,z){z(null,$)}});var ng=E((m6,tw)=>{var e5=I0("stream");if(process.env.READABLE_STREAM==="disable"&&e5)tw.exports=e5,m6=tw.exports=e5.Readable,m6.Readable=e5.Readable,m6.Writable=e5.Writable,m6.Duplex=e5.Duplex,m6.Transform=e5.Transform,m6.PassThrough=e5.PassThrough,m6.Stream=e5;else m6=tw.exports=vg(),m6.Stream=e5||m6,m6.Readable=m6,m6.Writable=Rg(),m6.Duplex=sY(),m6.Transform=ig(),m6.PassThrough=w80()});var I3=E((Nd0)=>{Nd0.base64=!0;Nd0.array=!0;Nd0.string=!0;Nd0.arraybuffer=typeof ArrayBuffer<"u"&&typeof Uint8Array<"u";Nd0.nodebuffer=typeof Buffer<"u";Nd0.uint8array=typeof Uint8Array<"u";if(typeof ArrayBuffer>"u")Nd0.blob=!1;else{ew=new ArrayBuffer(0);try{Nd0.blob=new Blob([ew],{type:"application/zip"}).size===0}catch($){try{pg=self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder,$M=new pg,$M.append(ew),Nd0.blob=$M.getBlob("application/zip").size===0}catch(Y){Nd0.blob=!1}}}var ew,pg,$M;try{Nd0.nodestream=!!ng().Readable}catch($){Nd0.nodestream=!1}});var dg=E((Rd0)=>{var Ed0=c4(),Cd0=I3(),$9="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";Rd0.encode=function($){var Y=[],z,U,Q,J,I,K,G,H=0,W=$.length,X=W,Z=Ed0.getTypeOf($)!=="string";while(H<$.length){if(X=W-H,!Z)z=$.charCodeAt(H++),U=H>2,I=(z&3)<<4|U>>4,K=X>1?(U&15)<<2|Q>>6:64,G=X>2?Q&63:64,Y.push($9.charAt(J)+$9.charAt(I)+$9.charAt(K)+$9.charAt(G))}return Y.join("")};Rd0.decode=function($){var Y,z,U,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)===$9.charAt(64))X--;if($.charAt($.length-2)===$9.charAt(64))X--;if(X%1!==0)throw Error("Invalid base64 input, bad content length.");var Z;if(Cd0.uint8array)Z=new Uint8Array(X|0);else Z=Array(X|0);while(G<$.length){if(Q=$9.indexOf($.charAt(G++)),J=$9.indexOf($.charAt(G++)),I=$9.indexOf($.charAt(G++)),K=$9.indexOf($.charAt(G++)),Y=Q<<2|J>>4,z=(J&15)<<4|I>>2,U=(I&3)<<6|K,Z[H++]=Y,I!==64)Z[H++]=z;if(K!==64)Z[H++]=U}return Z}});var aH=E((Od1,M80)=>{M80.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 A80=E((Md1,D80)=>{var wd1=global.MutationObserver||global.WebKitMutationObserver,N80;N80=function(){process.nextTick(kd0)};var hd0,Sd0,gd0,yd0,mg,tH=[];function kd0(){mg=!0;var $,Y,z=tH.length;while(z){Y=tH,tH=[],$=-1;while(++${var B80=A80();function IJ(){}var X8={},P80=["REJECTED"],lg=["FULFILLED"],j80=["PENDING"];JJ=["UNHANDLED"];var JJ;C80.exports=u7;function u7($){if(typeof $!=="function")throw TypeError("resolver must be a function");if(this.state=j80,this.queue=[],this.outcome=void 0,this.handled=JJ,$!==IJ)T80(this,$)}u7.prototype.finally=function($){if(typeof $!=="function")return this;var Y=this.constructor;return this.then(z,U);function z(Q){function J(){return Q}return Y.resolve($()).then(J)}function U(Q){function J(){throw Q}return Y.resolve($()).then(J)}};u7.prototype.catch=function($){return this.then(null,$)};u7.prototype.then=function($,Y){if(typeof $!=="function"&&this.state===lg||typeof Y!=="function"&&this.state===P80)return this;var z=new this.constructor(IJ);if(this.handled===JJ)this.handled=null;if(this.state!==j80){var U=this.state===lg?$:Y;og(z,U,this.outcome)}else this.queue.push(new eH(z,$,Y));return z};function eH($,Y,z){if(this.promise=$,typeof Y==="function")this.onFulfilled=Y,this.callFulfilled=this.otherCallFulfilled;if(typeof z==="function")this.onRejected=z,this.callRejected=this.otherCallRejected}eH.prototype.callFulfilled=function($){X8.resolve(this.promise,$)};eH.prototype.otherCallFulfilled=function($){og(this.promise,this.onFulfilled,$)};eH.prototype.callRejected=function($){X8.reject(this.promise,$)};eH.prototype.otherCallRejected=function($){og(this.promise,this.onRejected,$)};function og($,Y,z){B80(function(){var U;try{U=Y(z)}catch(Q){return X8.reject($,Q)}if(U===$)X8.reject($,TypeError("Cannot resolve promise with itself"));else X8.resolve($,U)})}X8.resolve=function($,Y){var z=E80(fd0,Y);if(z.status==="error")return X8.reject($,z.value);var U=z.value;if(U)T80($,U);else{$.state=lg,$.outcome=Y;var Q=-1,J=$.queue.length;while(++Q{var rg=null;if(typeof Promise<"u")rg=Promise;else rg=R80();_80.exports={Promise:rg}});var sg=E((v80)=>{(function($,Y){if($.setImmediate)return;var z=1,U={},Q=!1,J=$.document,I;function K(N){if(typeof N!=="function")N=Function(""+N);var M=Array(arguments.length-1);for(var D=0;D"u"?typeof global>"u"?v80:global:self)});var c4=E((dd0)=>{var b7=I3(),cd0=dg(),GJ=aH(),ag=KJ();sg();function pd0($){var Y=null;if(b7.uint8array)Y=new Uint8Array($.length);else Y=Array($.length);return zM($,Y)}dd0.newBlob=function($,Y){dd0.checkSupport("blob");try{return new Blob([$],{type:Y})}catch(Q){try{var z=self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder,U=new z;return U.append($),U.getBlob(Y)}catch(J){throw Error("Bug : can't construct the Blob.")}}};function $W($){return $}function zM($,Y){for(var z=0;z<$.length;++z)Y[z]=$.charCodeAt(z)&255;return Y}var YM={stringifyByChunk:function($,Y,z){var U=[],Q=0,J=$.length;if(J<=z)return String.fromCharCode.apply(null,$);while(Q1)try{return YM.stringifyByChunk($,z,Y)}catch(Q){Y=Math.floor(Y/2)}return YM.stringifyByChar($)}dd0.applyFromCharCode=YW;function UM($,Y){for(var z=0;z<$.length;z++)Y[z]=$[z];return Y}var i7={};i7.string={string:$W,array:function($){return zM($,Array($.length))},arraybuffer:function($){return i7.string.uint8array($).buffer},uint8array:function($){return zM($,new Uint8Array($.length))},nodebuffer:function($){return zM($,GJ.allocBuffer($.length))}};i7.array={string:YW,array:$W,arraybuffer:function($){return new Uint8Array($).buffer},uint8array:function($){return new Uint8Array($)},nodebuffer:function($){return GJ.newBufferFrom($)}};i7.arraybuffer={string:function($){return YW(new Uint8Array($))},array:function($){return UM(new Uint8Array($),Array($.byteLength))},arraybuffer:$W,uint8array:function($){return new Uint8Array($)},nodebuffer:function($){return GJ.newBufferFrom(new Uint8Array($))}};i7.uint8array={string:YW,array:function($){return UM($,Array($.length))},arraybuffer:function($){return $.buffer},uint8array:$W,nodebuffer:function($){return GJ.newBufferFrom($)}};i7.nodebuffer={string:YW,array:function($){return UM($,Array($.length))},arraybuffer:function($){return i7.nodebuffer.uint8array($).buffer},uint8array:function($){return UM($,new Uint8Array($.length))},nodebuffer:$W};dd0.transformTo=function($,Y){if(!Y)Y="";if(!$)return Y;dd0.checkSupport($);var z=dd0.getTypeOf(Y),U=i7[z][$](Y);return U};dd0.resolve=function($){var Y=$.split("/"),z=[];for(var U=0;U"u")$[z]=arguments[Y][z];return $};dd0.prepareContent=function($,Y,z,U,Q){var J=ag.Promise.resolve(Y).then(function(I){var K=b7.blob&&(I instanceof Blob||["[object File]","[object Blob]"].indexOf(Object.prototype.toString.call(I))!==-1);if(K&&typeof FileReader<"u")return new ag.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=dd0.getTypeOf(I);if(!K)return ag.Promise.reject(Error("Can't read the data of '"+$+"'. Is it in a supported JavaScript type (String, Blob, ArrayBuffer, etc) ?"));if(K==="arraybuffer")I=dd0.transformTo("uint8array",I);else if(K==="string"){if(Q)I=cd0.decode(I);else if(z){if(U!==!0)I=pd0(I)}}return I})}});var K$=E((Pd1,y80)=>{function g80($){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}g80.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 z=0;z "+$;else return $}};y80.exports=g80});var WJ=E((Im0)=>{var HJ=c4(),aY=I3(),zm0=aH(),QM=K$(),zW=Array(256);for(Y9=0;Y9<256;Y9++)zW[Y9]=Y9>=252?6:Y9>=248?5:Y9>=240?4:Y9>=224?3:Y9>=192?2:1;var Y9;zW[254]=zW[254]=1;var Um0=function($){var Y,z,U,Q,J,I=$.length,K=0;for(Q=0;Q>>6,Y[J++]=128|z&63;else if(z<65536)Y[J++]=224|z>>>12,Y[J++]=128|z>>>6&63,Y[J++]=128|z&63;else Y[J++]=240|z>>>18,Y[J++]=128|z>>>12&63,Y[J++]=128|z>>>6&63,Y[J++]=128|z&63}return Y},Qm0=function($,Y){var z;if(Y=Y||$.length,Y>$.length)Y=$.length;z=Y-1;while(z>=0&&($[z]&192)===128)z--;if(z<0)return Y;if(z===0)return Y;return z+zW[$[z]]>Y?z:Y},Jm0=function($){var Y,z,U,Q,J=$.length,I=Array(J*2);for(z=0,Y=0;Y4){I[z++]=65533,Y+=Q-1;continue}U&=Q===2?31:Q===3?15:7;while(Q>1&&Y1){I[z++]=65533;continue}if(U<65536)I[z++]=U;else U-=65536,I[z++]=55296|U>>10&1023,I[z++]=56320|U&1023}if(I.length!==z)if(I.subarray)I=I.subarray(0,z);else I.length=z;return HJ.applyFromCharCode(I)};Im0.utf8encode=function(Y){if(aY.nodebuffer)return zm0.newBufferFrom(Y,"utf-8");return Um0(Y)};Im0.utf8decode=function(Y){if(aY.nodebuffer)return HJ.transformTo("nodebuffer",Y).toString("utf-8");return Y=HJ.transformTo(aY.uint8array?"uint8array":"array",Y),Jm0(Y)};function JM(){QM.call(this,"utf-8 decode"),this.leftOver=null}HJ.inherits(JM,QM);JM.prototype.processChunk=function($){var Y=HJ.transformTo(aY.uint8array?"uint8array":"array",$.data);if(this.leftOver&&this.leftOver.length){if(aY.uint8array){var z=Y;Y=new Uint8Array(z.length+this.leftOver.length),Y.set(this.leftOver,0),Y.set(z,this.leftOver.length)}else Y=this.leftOver.concat(Y);this.leftOver=null}var U=Qm0(Y),Q=Y;if(U!==Y.length)if(aY.uint8array)Q=Y.subarray(0,U),this.leftOver=Y.subarray(U,Y.length);else Q=Y.slice(0,U),this.leftOver=Y.slice(U,Y.length);this.push({data:Im0.utf8decode(Q),meta:$.meta})};JM.prototype.flush=function(){if(this.leftOver&&this.leftOver.length)this.push({data:Im0.utf8decode(this.leftOver),meta:{}}),this.leftOver=null};Im0.Utf8DecodeWorker=JM;function eg(){QM.call(this,"utf-8 encode")}HJ.inherits(eg,QM);eg.prototype.processChunk=function($){this.push({data:Im0.utf8encode($.data),meta:$.meta})};Im0.Utf8EncodeWorker=eg});var b80=E((Td1,u80)=>{var x80=K$(),f80=c4();function Yy($){x80.call(this,"ConvertWorker to "+$),this.destType=$}f80.inherits(Yy,x80);Yy.prototype.processChunk=function($){this.push({data:f80.transformTo(this.destType,$.data),meta:$.meta})};u80.exports=Yy});var c80=E((Ed1,n80)=>{var i80=ng().Readable,Hm0=c4();Hm0.inherits(zy,i80);function zy($,Y,z){i80.call(this,Y),this._helper=$;var U=this;$.on("data",function(Q,J){if(!U.push(Q))U._helper.pause();if(z)z(J)}).on("error",function(Q){U.emit("error",Q)}).on("end",function(){U.push(null)})}zy.prototype._read=function(){this._helper.resume()};n80.exports=zy});var Uy=E((Cd1,m80)=>{var tY=c4(),Wm0=b80(),Xm0=K$(),Zm0=dg(),qm0=I3(),Vm0=KJ(),p80=null;if(qm0.nodestream)try{p80=c80()}catch($){}function Lm0($,Y,z){switch($){case"blob":return tY.newBlob(tY.transformTo("arraybuffer",Y),z);case"base64":return Zm0.encode(Y);default:return tY.transformTo($,Y)}}function Fm0($,Y){var z,U=0,Q=null,J=0;for(z=0;z{wm0.base64=!1;wm0.binary=!1;wm0.dir=!1;wm0.createFolders=!0;wm0.date=null;wm0.compression=null;wm0.compressionOptions=null;wm0.comment=null;wm0.unixPermissions=null;wm0.dosPermissions=null});var Jy=E((_d1,l80)=>{var IM=c4(),KM=K$(),Rm0=16384;function XJ($){KM.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(z){if(Y.dataIsReady=!0,Y.data=z,Y.max=z&&z.length||0,Y.type=IM.getTypeOf(z),!Y.isPaused)Y._tickAndRepeat()},function(z){Y.error(z)})}IM.inherits(XJ,KM);XJ.prototype.cleanUp=function(){KM.prototype.cleanUp.call(this),this.data=null};XJ.prototype.resume=function(){if(!KM.prototype.resume.call(this))return!1;if(!this._tickScheduled&&this.dataIsReady)this._tickScheduled=!0,IM.delay(this._tickAndRepeat,[],this);return!0};XJ.prototype._tickAndRepeat=function(){if(this._tickScheduled=!1,this.isPaused||this.isFinished)return;if(this._tick(),!this.isFinished)IM.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0};XJ.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var $=Rm0,Y=null,z=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,z);break;case"uint8array":Y=this.data.subarray(this.index,z);break;case"array":case"nodebuffer":Y=this.data.slice(this.index,z);break}return this.index=z,this.push({data:Y,meta:{percent:this.max?this.index/this.max*100:0}})}};l80.exports=XJ});var GM=E((vd1,r80)=>{var _m0=c4();function vm0(){var $,Y=[];for(var z=0;z<256;z++){$=z;for(var U=0;U<8;U++)$=$&1?3988292384^$>>>1:$>>>1;Y[z]=$}return Y}var o80=vm0();function hm0($,Y,z,U){var Q=o80,J=U+z;$=$^-1;for(var I=U;I>>8^Q[($^Y[I])&255];return $^-1}function Sm0($,Y,z,U){var Q=o80,J=U+z;$=$^-1;for(var I=U;I>>8^Q[($^Y.charCodeAt(I))&255];return $^-1}r80.exports=function(Y,z){if(typeof Y>"u"||!Y.length)return 0;var U=_m0.getTypeOf(Y)!=="string";if(U)return hm0(z|0,Y,Y.length,0);else return Sm0(z|0,Y,Y.length,0)}});var Ky=E((hd1,a80)=>{var s80=K$(),gm0=GM(),ym0=c4();function Iy(){s80.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0)}ym0.inherits(Iy,s80);Iy.prototype.processChunk=function($){this.streamInfo.crc32=gm0($.data,this.streamInfo.crc32||0),this.push($)};a80.exports=Iy});var e80=E((Sd1,t80)=>{var km0=c4(),Gy=K$();function Hy($){Gy.call(this,"DataLengthProbe for "+$),this.propName=$,this.withStreamInfo($,0)}km0.inherits(Hy,Gy);Hy.prototype.processChunk=function($){if($){var Y=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=Y+$.data.length}Gy.prototype.processChunk.call(this,$)};t80.exports=Hy});var HM=E((gd1,z$0)=>{var $$0=KJ(),Y$0=Jy(),xm0=Ky(),Wy=e80();function Xy($,Y,z,U,Q){this.compressedSize=$,this.uncompressedSize=Y,this.crc32=z,this.compression=U,this.compressedContent=Q}Xy.prototype={getContentWorker:function(){var $=new Y$0($$0.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new Wy("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 Y$0($$0.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize",this.compressedSize).withStreamInfo("uncompressedSize",this.uncompressedSize).withStreamInfo("crc32",this.crc32).withStreamInfo("compression",this.compression)}};Xy.createWorkerFrom=function($,Y,z){return $.pipe(new xm0).pipe(new Wy("uncompressedSize")).pipe(Y.compressWorker(z)).pipe(new Wy("compressedSize")).withStreamInfo("compression",Y)};z$0.exports=Xy});var I$0=E((yd1,J$0)=>{var fm0=Uy(),um0=Jy(),Zy=WJ(),qy=HM(),U$0=K$(),Vy=function($,Y,z){this.name=$,this.dir=z.dir,this.date=z.date,this.comment=z.comment,this.unixPermissions=z.unixPermissions,this.dosPermissions=z.dosPermissions,this._data=Y,this._dataBinary=z.binary,this.options={compression:z.compression,compressionOptions:z.compressionOptions}};Vy.prototype={internalStream:function($){var Y=null,z="string";try{if(!$)throw Error("No output type specified.");z=$.toLowerCase();var U=z==="string"||z==="text";if(z==="binarystring"||z==="text")z="string";Y=this._decompressWorker();var Q=!this._dataBinary;if(Q&&!U)Y=Y.pipe(new Zy.Utf8EncodeWorker);if(!Q&&U)Y=Y.pipe(new Zy.Utf8DecodeWorker)}catch(J){Y=new U$0("error"),Y.error(J)}return new fm0(Y,z,"")},async:function($,Y){return this.internalStream($).accumulate(Y)},nodeStream:function($,Y){return this.internalStream($||"nodebuffer").toNodejsStream(Y)},_compressWorker:function($,Y){if(this._data instanceof qy&&this._data.compression.magic===$.magic)return this._data.getCompressedWorker();else{var z=this._decompressWorker();if(!this._dataBinary)z=z.pipe(new Zy.Utf8EncodeWorker);return qy.createWorkerFrom(z,$,Y)}},_decompressWorker:function(){if(this._data instanceof qy)return this._data.getContentWorker();else if(this._data instanceof U$0)return this._data;else return new um0(this._data)}};var Q$0=["asText","asBinary","asNodeBuffer","asUint8Array","asArrayBuffer"],bm0=function(){throw Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")};for(UW=0;UW{var pm0=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Int32Array<"u";function dm0($,Y){return Object.prototype.hasOwnProperty.call($,Y)}Ly.assign=function($){var Y=Array.prototype.slice.call(arguments,1);while(Y.length){var z=Y.shift();if(!z)continue;if(typeof z!=="object")throw TypeError(z+"must be non-object");for(var U in z)if(dm0(z,U))$[U]=z[U]}return $};Ly.shrinkBuf=function($,Y){if($.length===Y)return $;if($.subarray)return $.subarray(0,Y);return $.length=Y,$};var mm0={arraySet:function($,Y,z,U,Q){if(Y.subarray&&$.subarray){$.set(Y.subarray(z,z+U),Q);return}for(var J=0;J{var rm0=K3(),sm0=4,G$0=0,H$0=1,am0=2;function qJ($){var Y=$.length;while(--Y>=0)$[Y]=0}var tm0=0,L$0=1,em0=2,$l0=3,Yl0=258,By=29,HW=256,JW=HW+1+By,ZJ=30,Py=19,F$0=2*JW+1,eY=15,Oy=16,zl0=7,jy=256,O$0=16,w$0=17,M$0=18,Dy=[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],WM=[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],Ul0=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],N$0=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],Ql0=512,G3=Array((JW+2)*2);qJ(G3);var QW=Array(ZJ*2);qJ(QW);var IW=Array(Ql0);qJ(IW);var KW=Array(Yl0-$l0+1);qJ(KW);var Ty=Array(By);qJ(Ty);var XM=Array(ZJ);qJ(XM);function wy($,Y,z,U,Q){this.static_tree=$,this.extra_bits=Y,this.extra_base=z,this.elems=U,this.max_length=Q,this.has_stree=$&&$.length}var D$0,A$0,B$0;function My($,Y){this.dyn_tree=$,this.max_code=0,this.stat_desc=Y}function P$0($){return $<256?IW[$]:IW[256+($>>>7)]}function GW($,Y){$.pending_buf[$.pending++]=Y&255,$.pending_buf[$.pending++]=Y>>>8&255}function p8($,Y,z){if($.bi_valid>Oy-z)$.bi_buf|=Y<<$.bi_valid&65535,GW($,$.bi_buf),$.bi_buf=Y>>Oy-$.bi_valid,$.bi_valid+=z-Oy;else $.bi_buf|=Y<<$.bi_valid&65535,$.bi_valid+=z}function z9($,Y,z){p8($,z[Y*2],z[Y*2+1])}function j$0($,Y){var z=0;do z|=$&1,$>>>=1,z<<=1;while(--Y>0);return z>>>1}function Jl0($){if($.bi_valid===16)GW($,$.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 Il0($,Y){var{dyn_tree:z,max_code:U}=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<=eY;Z++)$.bl_count[Z]=0;z[$.heap[$.heap_max]*2+1]=0;for(H=$.heap_max+1;HG)Z=G,F++;if(z[W*2+1]=Z,W>U)continue;if($.bl_count[Z]++,q=0,W>=K)q=I[W-K];if(V=z[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>U)continue;if(z[X*2+1]!==Z)$.opt_len+=(Z-z[X*2+1])*z[X*2],z[X*2+1]=Z;W--}}}function T$0($,Y,z){var U=Array(eY+1),Q=0,J,I;for(J=1;J<=eY;J++)U[J]=Q=Q+z[J-1]<<1;for(I=0;I<=Y;I++){var K=$[I*2+1];if(K===0)continue;$[I*2]=j$0(U[K]++,K)}}function Kl0(){var $,Y,z,U,Q,J=Array(eY+1);z=0;for(U=0;U>=7;for(;U8)GW($,$.bi_buf);else if($.bi_valid>0)$.pending_buf[$.pending++]=$.bi_buf;$.bi_buf=0,$.bi_valid=0}function Gl0($,Y,z,U){if(C$0($),U)GW($,z),GW($,~z);rm0.arraySet($.pending_buf,$.window,Y,z,$.pending),$.pending+=z}function W$0($,Y,z,U){var Q=Y*2,J=z*2;return $[Q]<$[J]||$[Q]===$[J]&&U[Y]<=U[z]}function Ny($,Y,z){var U=$.heap[z],Q=z<<1;while(Q<=$.heap_len){if(Q<$.heap_len&&W$0(Y,$.heap[Q+1],$.heap[Q],$.depth))Q++;if(W$0(Y,U,$.heap[Q],$.depth))break;$.heap[z]=$.heap[Q],z=Q,Q<<=1}$.heap[z]=U}function X$0($,Y,z){var U,Q,J=0,I,K;if($.last_lit!==0)do if(U=$.pending_buf[$.d_buf+J*2]<<8|$.pending_buf[$.d_buf+J*2+1],Q=$.pending_buf[$.l_buf+J],J++,U===0)z9($,Q,Y);else{if(I=KW[Q],z9($,I+HW+1,Y),K=Dy[I],K!==0)Q-=Ty[I],p8($,Q,K);if(U--,I=P$0(U),z9($,I,z),K=WM[I],K!==0)U-=XM[I],p8($,U,K)}while(J<$.last_lit);z9($,jy,Y)}function Ay($,Y){var z=Y.dyn_tree,U=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=F$0;for(I=0;I>1;I>=1;I--)Ny($,z,I);H=J;do I=$.heap[1],$.heap[1]=$.heap[$.heap_len--],Ny($,z,1),K=$.heap[1],$.heap[--$.heap_max]=I,$.heap[--$.heap_max]=K,z[H*2]=z[I*2]+z[K*2],$.depth[H]=($.depth[I]>=$.depth[K]?$.depth[I]:$.depth[K])+1,z[I*2+1]=z[K*2+1]=H,$.heap[1]=H++,Ny($,z,1);while($.heap_len>=2);$.heap[--$.heap_max]=$.heap[1],Il0($,Y),T$0(z,G,$.bl_count)}function Z$0($,Y,z){var U,Q=-1,J,I=Y[1],K=0,G=7,H=4;if(I===0)G=138,H=3;Y[(z+1)*2+1]=65535;for(U=0;U<=z;U++){if(J=I,I=Y[(U+1)*2+1],++K=3;Y--)if($.bl_tree[N$0[Y]*2+1]!==0)break;return $.opt_len+=3*(Y+1)+5+5+4,Y}function Wl0($,Y,z,U){var Q;p8($,Y-257,5),p8($,z-1,5),p8($,U-4,4);for(Q=0;Q>>=1)if(Y&1&&$.dyn_ltree[z*2]!==0)return G$0;if($.dyn_ltree[18]!==0||$.dyn_ltree[20]!==0||$.dyn_ltree[26]!==0)return H$0;for(z=32;z0){if($.strm.data_type===am0)$.strm.data_type=Xl0($);if(Ay($,$.l_desc),Ay($,$.d_desc),I=Hl0($),Q=$.opt_len+3+7>>>3,J=$.static_len+3+7>>>3,J<=Q)Q=J}else Q=J=z+5;if(z+4<=Q&&Y!==-1)R$0($,Y,z,U);else if($.strategy===sm0||J===Q)p8($,(L$0<<1)+(U?1:0),3),X$0($,G3,QW);else p8($,(em0<<1)+(U?1:0),3),Wl0($,$.l_desc.max_code+1,$.d_desc.max_code+1,I+1),X$0($,$.dyn_ltree,$.dyn_dtree);if(E$0($),U)C$0($)}function Ll0($,Y,z){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]=z&255,$.last_lit++,Y===0)$.dyn_ltree[z*2]++;else $.matches++,Y--,$.dyn_ltree[(KW[z]+HW+1)*2]++,$.dyn_dtree[P$0(Y)*2]++;return $.last_lit===$.lit_bufsize-1}Fl0._tr_init=Zl0;Fl0._tr_stored_block=R$0;Fl0._tr_flush_block=Vl0;Fl0._tr_tally=Ll0;Fl0._tr_align=ql0});var Ey=E((fd1,v$0)=>{function Al0($,Y,z,U){var Q=$&65535|0,J=$>>>16&65535|0,I=0;while(z!==0){I=z>2000?2000:z,z-=I;do Q=Q+Y[U++]|0,J=J+Q|0;while(--I);Q%=65521,J%=65521}return Q|J<<16|0}v$0.exports=Al0});var Cy=E((ud1,h$0)=>{function Bl0(){var $,Y=[];for(var z=0;z<256;z++){$=z;for(var U=0;U<8;U++)$=$&1?3988292384^$>>>1:$>>>1;Y[z]=$}return Y}var Pl0=Bl0();function jl0($,Y,z,U){var Q=Pl0,J=U+z;$^=-1;for(var I=U;I>>8^Q[($^Y[I])&255];return $^-1}h$0.exports=jl0});var ZM=E((bd1,S$0)=>{S$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((Qo0)=>{var E8=K3(),E$=_$0(),x$0=Ey(),n7=Cy(),Tl0=ZM(),Uz=0,El0=1,Cl0=3,l7=4,g$0=5,Q9=0,y$0=1,C$=-2,Rl0=-3,Ry=-5,_l0=-1,vl0=1,qM=2,hl0=3,Sl0=4,gl0=0,yl0=2,OM=8,kl0=9,xl0=15,fl0=8,ul0=29,bl0=256,vy=bl0+1+ul0,il0=30,nl0=19,cl0=2*vy+1,pl0=15,f1=3,d7=258,X5=d7+f1+1,dl0=32,wM=42,hy=69,VM=73,LM=91,FM=103,$z=113,XW=666,P6=1,ZW=2,Yz=3,FJ=4,ml0=3;function m7($,Y){return $.msg=Tl0[Y],Y}function k$0($){return($<<1)-($>4?9:0)}function p7($){var Y=$.length;while(--Y>=0)$[Y]=0}function c7($){var Y=$.state,z=Y.pending;if(z>$.avail_out)z=$.avail_out;if(z===0)return;if(E8.arraySet($.output,Y.pending_buf,Y.pending_out,z,$.next_out),$.next_out+=z,Y.pending_out+=z,$.total_out+=z,$.avail_out-=z,Y.pending-=z,Y.pending===0)Y.pending_out=0}function l6($,Y){E$._tr_flush_block($,$.block_start>=0?$.block_start:-1,$.strstart-$.block_start,Y),$.block_start=$.strstart,c7($.strm)}function r1($,Y){$.pending_buf[$.pending++]=Y}function WW($,Y){$.pending_buf[$.pending++]=Y>>>8&255,$.pending_buf[$.pending++]=Y&255}function ll0($,Y,z,U){var Q=$.avail_in;if(Q>U)Q=U;if(Q===0)return 0;if($.avail_in-=Q,E8.arraySet(Y,$.input,$.next_in,Q,z),$.state.wrap===1)$.adler=x$0($.adler,Y,Q,z);else if($.state.wrap===2)$.adler=n7($.adler,Y,Q,z);return $.next_in+=Q,$.total_in+=Q,Q}function f$0($,Y){var{max_chain_length:z,strstart:U}=$,Q,J,I=$.prev_length,K=$.nice_match,G=$.strstart>$.w_size-X5?$.strstart-($.w_size-X5):0,H=$.window,W=$.w_mask,X=$.prev,Z=$.strstart+d7,q=H[U+I-1],V=H[U+I];if($.prev_length>=$.good_match)z>>=2;if(K>$.lookahead)K=$.lookahead;do{if(Q=Y,H[Q+I]!==V||H[Q+I-1]!==q||H[Q]!==H[U]||H[++Q]!==H[U+1])continue;U+=2,Q++;do;while(H[++U]===H[++Q]&&H[++U]===H[++Q]&&H[++U]===H[++Q]&&H[++U]===H[++Q]&&H[++U]===H[++Q]&&H[++U]===H[++Q]&&H[++U]===H[++Q]&&H[++U]===H[++Q]&&UI){if($.match_start=Y,I=J,J>=K)break;q=H[U+I-1],V=H[U+I]}}while((Y=X[Y&W])>G&&--z!==0);if(I<=$.lookahead)return I;return $.lookahead}function zz($){var Y=$.w_size,z,U,Q,J,I;do{if(J=$.window_size-$.lookahead-$.strstart,$.strstart>=Y+(Y-X5)){E8.arraySet($.window,$.window,Y,Y,0),$.match_start-=Y,$.strstart-=Y,$.block_start-=Y,U=$.hash_size,z=U;do Q=$.head[--z],$.head[z]=Q>=Y?Q-Y:0;while(--U);U=Y,z=U;do Q=$.prev[--z],$.prev[z]=Q>=Y?Q-Y:0;while(--U);J+=Y}if($.strm.avail_in===0)break;if(U=ll0($.strm,$.window,$.strstart+$.lookahead,J),$.lookahead+=U,$.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)z=$.pending_buf_size-5;for(;;){if($.lookahead<=1){if(zz($),$.lookahead===0&&Y===Uz)return P6;if($.lookahead===0)break}$.strstart+=$.lookahead,$.lookahead=0;var U=$.block_start+z;if($.strstart===0||$.strstart>=U){if($.lookahead=$.strstart-U,$.strstart=U,l6($,!1),$.strm.avail_out===0)return P6}if($.strstart-$.block_start>=$.w_size-X5){if(l6($,!1),$.strm.avail_out===0)return P6}}if($.insert=0,Y===l7){if(l6($,!0),$.strm.avail_out===0)return Yz;return FJ}if($.strstart>$.block_start){if(l6($,!1),$.strm.avail_out===0)return P6}return P6}function _y($,Y){var z,U;for(;;){if($.lookahead=f1)$.ins_h=($.ins_h<<$.hash_shift^$.window[$.strstart+f1-1])&$.hash_mask,z=$.prev[$.strstart&$.w_mask]=$.head[$.ins_h],$.head[$.ins_h]=$.strstart;if(z!==0&&$.strstart-z<=$.w_size-X5)$.match_length=f$0($,z);if($.match_length>=f1)if(U=E$._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,z=$.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 U=E$._tr_tally($,0,$.window[$.strstart]),$.lookahead--,$.strstart++;if(U){if(l6($,!1),$.strm.avail_out===0)return P6}}if($.insert=$.strstart=f1)$.ins_h=($.ins_h<<$.hash_shift^$.window[$.strstart+f1-1])&$.hash_mask,z=$.prev[$.strstart&$.w_mask]=$.head[$.ins_h],$.head[$.ins_h]=$.strstart;if($.prev_length=$.match_length,$.prev_match=$.match_start,$.match_length=f1-1,z!==0&&$.prev_length<$.max_lazy_match&&$.strstart-z<=$.w_size-X5){if($.match_length=f$0($,z),$.match_length<=5&&($.strategy===vl0||$.match_length===f1&&$.strstart-$.match_start>4096))$.match_length=f1-1}if($.prev_length>=f1&&$.match_length<=$.prev_length){Q=$.strstart+$.lookahead-f1,U=E$._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,z=$.prev[$.strstart&$.w_mask]=$.head[$.ins_h],$.head[$.ins_h]=$.strstart;while(--$.prev_length!==0);if($.match_available=0,$.match_length=f1-1,$.strstart++,U){if(l6($,!1),$.strm.avail_out===0)return P6}}else if($.match_available){if(U=E$._tr_tally($,0,$.window[$.strstart-1]),U)l6($,!1);if($.strstart++,$.lookahead--,$.strm.avail_out===0)return P6}else $.match_available=1,$.strstart++,$.lookahead--}if($.match_available)U=E$._tr_tally($,0,$.window[$.strstart-1]),$.match_available=0;if($.insert=$.strstart=f1&&$.strstart>0){if(Q=$.strstart-1,U=I[Q],U===I[++Q]&&U===I[++Q]&&U===I[++Q]){J=$.strstart+d7;do;while(U===I[++Q]&&U===I[++Q]&&U===I[++Q]&&U===I[++Q]&&U===I[++Q]&&U===I[++Q]&&U===I[++Q]&&U===I[++Q]&&Q$.lookahead)$.match_length=$.lookahead}}if($.match_length>=f1)z=E$._tr_tally($,1,$.match_length-f1),$.lookahead-=$.match_length,$.strstart+=$.match_length,$.match_length=0;else z=E$._tr_tally($,0,$.window[$.strstart]),$.lookahead--,$.strstart++;if(z){if(l6($,!1),$.strm.avail_out===0)return P6}}if($.insert=0,Y===l7){if(l6($,!0),$.strm.avail_out===0)return Yz;return FJ}if($.last_lit){if(l6($,!1),$.strm.avail_out===0)return P6}return ZW}function sl0($,Y){var z;for(;;){if($.lookahead===0){if(zz($),$.lookahead===0){if(Y===Uz)return P6;break}}if($.match_length=0,z=E$._tr_tally($,0,$.window[$.strstart]),$.lookahead--,$.strstart++,z){if(l6($,!1),$.strm.avail_out===0)return P6}}if($.insert=0,Y===l7){if(l6($,!0),$.strm.avail_out===0)return Yz;return FJ}if($.last_lit){if(l6($,!1),$.strm.avail_out===0)return P6}return ZW}function U9($,Y,z,U,Q){this.good_length=$,this.max_lazy=Y,this.nice_length=z,this.max_chain=U,this.func=Q}var LJ;LJ=[new U9(0,0,0,0,ol0),new U9(4,4,8,4,_y),new U9(4,5,16,8,_y),new U9(4,6,32,32,_y),new U9(4,4,16,16,VJ),new U9(8,16,32,32,VJ),new U9(8,16,128,128,VJ),new U9(8,32,128,256,VJ),new U9(32,128,258,1024,VJ),new U9(32,258,258,4096,VJ)];function al0($){$.window_size=2*$.w_size,p7($.head),$.max_lazy_match=LJ[$.level].max_lazy,$.good_match=LJ[$.level].good_length,$.nice_match=LJ[$.level].nice_length,$.max_chain_length=LJ[$.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 tl0(){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=OM,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 E8.Buf16(cl0*2),this.dyn_dtree=new E8.Buf16((2*il0+1)*2),this.bl_tree=new E8.Buf16((2*nl0+1)*2),p7(this.dyn_ltree),p7(this.dyn_dtree),p7(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new E8.Buf16(pl0+1),this.heap=new E8.Buf16(2*vy+1),p7(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new E8.Buf16(2*vy+1),p7(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 u$0($){var Y;if(!$||!$.state)return m7($,C$);if($.total_in=$.total_out=0,$.data_type=yl0,Y=$.state,Y.pending=0,Y.pending_out=0,Y.wrap<0)Y.wrap=-Y.wrap;return Y.status=Y.wrap?wM:$z,$.adler=Y.wrap===2?0:1,Y.last_flush=Uz,E$._tr_init(Y),Q9}function b$0($){var Y=u$0($);if(Y===Q9)al0($.state);return Y}function el0($,Y){if(!$||!$.state)return C$;if($.state.wrap!==2)return C$;return $.state.gzhead=Y,Q9}function i$0($,Y,z,U,Q,J){if(!$)return C$;var I=1;if(Y===_l0)Y=6;if(U<0)I=0,U=-U;else if(U>15)I=2,U-=16;if(Q<1||Q>kl0||z!==OM||U<8||U>15||Y<0||Y>9||J<0||J>Sl0)return m7($,C$);if(U===8)U=9;var K=new tl0;return $.state=K,K.strm=$,K.wrap=I,K.gzhead=null,K.w_bits=U,K.w_size=1<g$0||Y<0)return $?m7($,C$):C$;if(U=$.state,!$.output||!$.input&&$.avail_in!==0||U.status===XW&&Y!==l7)return m7($,$.avail_out===0?Ry:C$);if(U.strm=$,z=U.last_flush,U.last_flush=Y,U.status===wM)if(U.wrap===2)if($.adler=0,r1(U,31),r1(U,139),r1(U,8),!U.gzhead)r1(U,0),r1(U,0),r1(U,0),r1(U,0),r1(U,0),r1(U,U.level===9?2:U.strategy>=qM||U.level<2?4:0),r1(U,ml0),U.status=$z;else{if(r1(U,(U.gzhead.text?1:0)+(U.gzhead.hcrc?2:0)+(!U.gzhead.extra?0:4)+(!U.gzhead.name?0:8)+(!U.gzhead.comment?0:16)),r1(U,U.gzhead.time&255),r1(U,U.gzhead.time>>8&255),r1(U,U.gzhead.time>>16&255),r1(U,U.gzhead.time>>24&255),r1(U,U.level===9?2:U.strategy>=qM||U.level<2?4:0),r1(U,U.gzhead.os&255),U.gzhead.extra&&U.gzhead.extra.length)r1(U,U.gzhead.extra.length&255),r1(U,U.gzhead.extra.length>>8&255);if(U.gzhead.hcrc)$.adler=n7($.adler,U.pending_buf,U.pending,0);U.gzindex=0,U.status=hy}else{var I=OM+(U.w_bits-8<<4)<<8,K=-1;if(U.strategy>=qM||U.level<2)K=0;else if(U.level<6)K=1;else if(U.level===6)K=2;else K=3;if(I|=K<<6,U.strstart!==0)I|=dl0;if(I+=31-I%31,U.status=$z,WW(U,I),U.strstart!==0)WW(U,$.adler>>>16),WW(U,$.adler&65535);$.adler=1}if(U.status===hy)if(U.gzhead.extra){Q=U.pending;while(U.gzindex<(U.gzhead.extra.length&65535)){if(U.pending===U.pending_buf_size){if(U.gzhead.hcrc&&U.pending>Q)$.adler=n7($.adler,U.pending_buf,U.pending-Q,Q);if(c7($),Q=U.pending,U.pending===U.pending_buf_size)break}r1(U,U.gzhead.extra[U.gzindex]&255),U.gzindex++}if(U.gzhead.hcrc&&U.pending>Q)$.adler=n7($.adler,U.pending_buf,U.pending-Q,Q);if(U.gzindex===U.gzhead.extra.length)U.gzindex=0,U.status=VM}else U.status=VM;if(U.status===VM)if(U.gzhead.name){Q=U.pending;do{if(U.pending===U.pending_buf_size){if(U.gzhead.hcrc&&U.pending>Q)$.adler=n7($.adler,U.pending_buf,U.pending-Q,Q);if(c7($),Q=U.pending,U.pending===U.pending_buf_size){J=1;break}}if(U.gzindexQ)$.adler=n7($.adler,U.pending_buf,U.pending-Q,Q);if(J===0)U.gzindex=0,U.status=LM}else U.status=LM;if(U.status===LM)if(U.gzhead.comment){Q=U.pending;do{if(U.pending===U.pending_buf_size){if(U.gzhead.hcrc&&U.pending>Q)$.adler=n7($.adler,U.pending_buf,U.pending-Q,Q);if(c7($),Q=U.pending,U.pending===U.pending_buf_size){J=1;break}}if(U.gzindexQ)$.adler=n7($.adler,U.pending_buf,U.pending-Q,Q);if(J===0)U.status=FM}else U.status=FM;if(U.status===FM)if(U.gzhead.hcrc){if(U.pending+2>U.pending_buf_size)c7($);if(U.pending+2<=U.pending_buf_size)r1(U,$.adler&255),r1(U,$.adler>>8&255),$.adler=0,U.status=$z}else U.status=$z;if(U.pending!==0){if(c7($),$.avail_out===0)return U.last_flush=-1,Q9}else if($.avail_in===0&&k$0(Y)<=k$0(z)&&Y!==l7)return m7($,Ry);if(U.status===XW&&$.avail_in!==0)return m7($,Ry);if($.avail_in!==0||U.lookahead!==0||Y!==Uz&&U.status!==XW){var G=U.strategy===qM?sl0(U,Y):U.strategy===hl0?rl0(U,Y):LJ[U.level].func(U,Y);if(G===Yz||G===FJ)U.status=XW;if(G===P6||G===Yz){if($.avail_out===0)U.last_flush=-1;return Q9}if(G===ZW){if(Y===El0)E$._tr_align(U);else if(Y!==g$0){if(E$._tr_stored_block(U,0,0,!1),Y===Cl0){if(p7(U.head),U.lookahead===0)U.strstart=0,U.block_start=0,U.insert=0}}if(c7($),$.avail_out===0)return U.last_flush=-1,Q9}}if(Y!==l7)return Q9;if(U.wrap<=0)return y$0;if(U.wrap===2)r1(U,$.adler&255),r1(U,$.adler>>8&255),r1(U,$.adler>>16&255),r1(U,$.adler>>24&255),r1(U,$.total_in&255),r1(U,$.total_in>>8&255),r1(U,$.total_in>>16&255),r1(U,$.total_in>>24&255);else WW(U,$.adler>>>16),WW(U,$.adler&65535);if(c7($),U.wrap>0)U.wrap=-U.wrap;return U.pending!==0?Q9:y$0}function zo0($){var Y;if(!$||!$.state)return C$;if(Y=$.state.status,Y!==wM&&Y!==hy&&Y!==VM&&Y!==LM&&Y!==FM&&Y!==$z&&Y!==XW)return m7($,C$);return $.state=null,Y===$z?m7($,Rl0):Q9}function Uo0($,Y){var z=Y.length,U,Q,J,I,K,G,H,W;if(!$||!$.state)return C$;if(U=$.state,I=U.wrap,I===2||I===1&&U.status!==wM||U.lookahead)return C$;if(I===1)$.adler=x$0($.adler,Y,z,0);if(U.wrap=0,z>=U.w_size){if(I===0)p7(U.head),U.strstart=0,U.block_start=0,U.insert=0;W=new E8.Buf8(U.w_size),E8.arraySet(W,Y,z-U.w_size,U.w_size,0),Y=W,z=U.w_size}K=$.avail_in,G=$.next_in,H=$.input,$.avail_in=z,$.next_in=0,$.input=Y,zz(U);while(U.lookahead>=f1){Q=U.strstart,J=U.lookahead-(f1-1);do U.ins_h=(U.ins_h<{var MM=K3(),c$0=!0,p$0=!0;try{String.fromCharCode.apply(null,[0])}catch($){c$0=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch($){p$0=!1}var qW=new MM.Buf8(256);for(J9=0;J9<256;J9++)qW[J9]=J9>=252?6:J9>=248?5:J9>=240?4:J9>=224?3:J9>=192?2:1;var J9;qW[254]=qW[254]=1;Vo0.string2buf=function($){var Y,z,U,Q,J,I=$.length,K=0;for(Q=0;Q>>6,Y[J++]=128|z&63;else if(z<65536)Y[J++]=224|z>>>12,Y[J++]=128|z>>>6&63,Y[J++]=128|z&63;else Y[J++]=240|z>>>18,Y[J++]=128|z>>>12&63,Y[J++]=128|z>>>6&63,Y[J++]=128|z&63}return Y};function d$0($,Y){if(Y<65534){if($.subarray&&p$0||!$.subarray&&c$0)return String.fromCharCode.apply(null,MM.shrinkBuf($,Y))}var z="";for(var U=0;U4){K[U++]=65533,z+=J-1;continue}Q&=J===2?31:J===3?15:7;while(J>1&&z1){K[U++]=65533;continue}if(Q<65536)K[U++]=Q;else Q-=65536,K[U++]=55296|Q>>10&1023,K[U++]=56320|Q&1023}return d$0(K,U)};Vo0.utf8border=function($,Y){var z;if(Y=Y||$.length,Y>$.length)Y=$.length;z=Y-1;while(z>=0&&($[z]&192)===128)z--;if(z<0)return Y;if(z===0)return Y;return z+qW[$[z]]>Y?z:Y}});var gy=E((cd1,m$0)=>{function No0(){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}m$0.exports=No0});var s$0=E((Co0)=>{var VW=n$0(),LW=K3(),ky=Sy(),xy=ZM(),Do0=gy(),r$0=Object.prototype.toString,Ao0=0,yy=4,OJ=0,l$0=1,o$0=2,Bo0=-1,Po0=0,jo0=8;function Qz($){if(!(this instanceof Qz))return new Qz($);this.options=LW.assign({level:Bo0,method:jo0,chunkSize:16384,windowBits:15,memLevel:8,strategy:Po0,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 Do0,this.strm.avail_out=0;var z=VW.deflateInit2(this.strm,Y.level,Y.method,Y.windowBits,Y.memLevel,Y.strategy);if(z!==OJ)throw Error(xy[z]);if(Y.header)VW.deflateSetHeader(this.strm,Y.header);if(Y.dictionary){var U;if(typeof Y.dictionary==="string")U=ky.string2buf(Y.dictionary);else if(r$0.call(Y.dictionary)==="[object ArrayBuffer]")U=new Uint8Array(Y.dictionary);else U=Y.dictionary;if(z=VW.deflateSetDictionary(this.strm,U),z!==OJ)throw Error(xy[z]);this._dict_set=!0}}Qz.prototype.push=function($,Y){var z=this.strm,U=this.options.chunkSize,Q,J;if(this.ended)return!1;if(J=Y===~~Y?Y:Y===!0?yy:Ao0,typeof $==="string")z.input=ky.string2buf($);else if(r$0.call($)==="[object ArrayBuffer]")z.input=new Uint8Array($);else z.input=$;z.next_in=0,z.avail_in=z.input.length;do{if(z.avail_out===0)z.output=new LW.Buf8(U),z.next_out=0,z.avail_out=U;if(Q=VW.deflate(z,J),Q!==l$0&&Q!==OJ)return this.onEnd(Q),this.ended=!0,!1;if(z.avail_out===0||z.avail_in===0&&(J===yy||J===o$0))if(this.options.to==="string")this.onData(ky.buf2binstring(LW.shrinkBuf(z.output,z.next_out)));else this.onData(LW.shrinkBuf(z.output,z.next_out))}while((z.avail_in>0||z.avail_out===0)&&Q!==l$0);if(J===yy)return Q=VW.deflateEnd(this.strm),this.onEnd(Q),this.ended=!0,Q===OJ;if(J===o$0)return this.onEnd(OJ),z.avail_out=0,!0;return!0};Qz.prototype.onData=function($){this.chunks.push($)};Qz.prototype.onEnd=function($){if($===OJ)if(this.options.to==="string")this.result=this.chunks.join("");else this.result=LW.flattenChunks(this.chunks);this.chunks=[],this.err=$,this.msg=this.strm.msg};function fy($,Y){var z=new Qz(Y);if(z.push($,!0),z.err)throw z.msg||xy[z.err];return z.result}function To0($,Y){return Y=Y||{},Y.raw=!0,fy($,Y)}function Eo0($,Y){return Y=Y||{},Y.gzip=!0,fy($,Y)}Co0.Deflate=Qz;Co0.deflate=fy;Co0.deflateRaw=To0;Co0.gzip=Eo0});var t$0=E((dd1,a$0)=>{var NM=30,So0=12;a$0.exports=function(Y,z){var U,Q,J,I,K,G,H,W,X,Z,q,V,F,w,O,N,M,D,P,j,A,T,C,b,k;U=Y.state,Q=Y.next_in,b=Y.input,J=Q+(Y.avail_in-5),I=Y.next_out,k=Y.output,K=I-(z-Y.avail_out),G=I+(Y.avail_out-257),H=U.dmax,W=U.wsize,X=U.whave,Z=U.wnext,q=U.window,V=U.hold,F=U.bits,w=U.lencode,O=U.distcode,N=(1<>>24,V>>>=P,F-=P,P=D>>>16&255,P===0)k[I++]=D&65535;else if(P&16){if(j=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",U.mode=NM;break $}if(V>>>=P,F-=P,P=I-K,A>P){if(P=A-P,P>X){if(U.sane){Y.msg="invalid distance too far back",U.mode=NM;break $}}if(T=0,C=q,Z===0){if(T+=W-P,P2)k[I++]=C[T++],k[I++]=C[T++],k[I++]=C[T++],j-=3;if(j){if(k[I++]=C[T++],j>1)k[I++]=C[T++]}}else{T=I-A;do k[I++]=k[T++],k[I++]=k[T++],k[I++]=k[T++],j-=3;while(j>2);if(j){if(k[I++]=k[T++],j>1)k[I++]=k[T++]}}}else if((P&64)===0){D=O[(D&65535)+(V&(1<>3,Q-=j,F-=j<<3,V&=(1<{var e$0=K3(),wJ=15,$50=852,Y50=592,z50=0,uy=1,U50=2,go0=[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],yo0=[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],ko0=[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],xo0=[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];Q50.exports=function(Y,z,U,Q,J,I,K,G){var H=G.bits,W=0,X=0,Z=0,q=0,V=0,F=0,w=0,O=0,N=0,M=0,D,P,j,A,T,C=null,b=0,k,S=new e$0.Buf16(wJ+1),i=new e$0.Buf16(wJ+1),n=null,U0=0,x,d,t;for(W=0;W<=wJ;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===z50||q!==1))return-1;i[1]=0;for(W=1;W$50||Y===U50&&N>Y50)return 1;for(;;){if(x=W-w,K[X]k)d=n[U0+K[X]],t=C[b+K[X]];else d=96,t=0;D=1<>w)+P]=x<<24|d<<16|t|0;while(P!==0);D=1<>=1;if(D!==0)M&=D-1,M+=D;else M=0;if(X++,--S[W]===0){if(W===q)break;W=z[U+K[X]]}if(W>V&&(M&A)!==j){if(w===0)w=V;T+=Z,F=W-w,O=1<$50||Y===U50&&N>Y50)return 1;j=M&A,J[j]=V<<24|F<<16|T-I|0}}if(M!==0)J[T+M]=W-w<<24|4194304|0;return G.bits=V,0}});var b50=E((zr0)=>{var G$=K3(),dy=Ey(),I9=Cy(),fo0=t$0(),FW=J50(),uo0=0,v50=1,h50=2,I50=4,bo0=5,DM=6,Jz=0,io0=1,no0=2,R$=-2,S50=-3,my=-4,co0=-5,K50=8,g50=1,G50=2,H50=3,W50=4,X50=5,Z50=6,q50=7,V50=8,L50=9,F50=10,PM=11,H3=12,by=13,O50=14,iy=15,w50=16,M50=17,N50=18,D50=19,AM=20,BM=21,A50=22,B50=23,P50=24,j50=25,T50=26,ny=27,E50=28,C50=29,y4=30,ly=31,po0=32,do0=852,mo0=592,lo0=15,oo0=lo0;function R50($){return($>>>24&255)+($>>>8&65280)+(($&65280)<<8)+(($&255)<<24)}function ro0(){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 G$.Buf16(320),this.work=new G$.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function y50($){var Y;if(!$||!$.state)return R$;if(Y=$.state,$.total_in=$.total_out=Y.total=0,$.msg="",Y.wrap)$.adler=Y.wrap&1;return Y.mode=g50,Y.last=0,Y.havedict=0,Y.dmax=32768,Y.head=null,Y.hold=0,Y.bits=0,Y.lencode=Y.lendyn=new G$.Buf32(do0),Y.distcode=Y.distdyn=new G$.Buf32(mo0),Y.sane=1,Y.back=-1,Jz}function k50($){var Y;if(!$||!$.state)return R$;return Y=$.state,Y.wsize=0,Y.whave=0,Y.wnext=0,y50($)}function x50($,Y){var z,U;if(!$||!$.state)return R$;if(U=$.state,Y<0)z=0,Y=-Y;else if(z=(Y>>4)+1,Y<48)Y&=15;if(Y&&(Y<8||Y>15))return R$;if(U.window!==null&&U.wbits!==Y)U.window=null;return U.wrap=z,U.wbits=Y,k50($)}function f50($,Y){var z,U;if(!$)return R$;if(U=new ro0,$.state=U,U.window=null,z=x50($,Y),z!==Jz)$.state=null;return z}function so0($){return f50($,oo0)}var _50=!0,cy,py;function ao0($){if(_50){var Y;cy=new G$.Buf32(512),py=new G$.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;FW(v50,$.lens,0,288,cy,0,$.work,{bits:9}),Y=0;while(Y<32)$.lens[Y++]=5;FW(h50,$.lens,0,32,py,0,$.work,{bits:5}),_50=!1}$.lencode=cy,$.lenbits=9,$.distcode=py,$.distbits=5}function u50($,Y,z,U){var Q,J=$.state;if(J.window===null)J.wsize=1<=J.wsize)G$.arraySet(J.window,Y,z-J.wsize,J.wsize,0),J.wnext=0,J.whave=J.wsize;else{if(Q=J.wsize-J.wnext,Q>U)Q=U;if(G$.arraySet(J.window,Y,z-U,Q,J.wnext),U-=Q,U)G$.arraySet(J.window,Y,z-U,U,0),J.wnext=U,J.whave=J.wsize;else{if(J.wnext+=Q,J.wnext===J.wsize)J.wnext=0;if(J.whave>>8&255,z.check=I9(z.check,C,2,0),H=0,W=0,z.mode=G50;break}if(z.flags=0,z.head)z.head.done=!1;if(!(z.wrap&1)||(((H&255)<<8)+(H>>8))%31){$.msg="incorrect header check",z.mode=y4;break}if((H&15)!==K50){$.msg="unknown compression method",z.mode=y4;break}if(H>>>=4,W-=4,A=(H&15)+8,z.wbits===0)z.wbits=A;else if(A>z.wbits){$.msg="invalid window size",z.mode=y4;break}z.dmax=1<>8&1;if(z.flags&512)C[0]=H&255,C[1]=H>>>8&255,z.check=I9(z.check,C,2,0);H=0,W=0,z.mode=H50;case H50:while(W<32){if(K===0)break $;K--,H+=U[J++]<>>8&255,C[2]=H>>>16&255,C[3]=H>>>24&255,z.check=I9(z.check,C,4,0);H=0,W=0,z.mode=W50;case W50:while(W<16){if(K===0)break $;K--,H+=U[J++]<>8;if(z.flags&512)C[0]=H&255,C[1]=H>>>8&255,z.check=I9(z.check,C,2,0);H=0,W=0,z.mode=X50;case X50:if(z.flags&1024){while(W<16){if(K===0)break $;K--,H+=U[J++]<>>8&255,z.check=I9(z.check,C,2,0);H=0,W=0}else if(z.head)z.head.extra=null;z.mode=Z50;case Z50:if(z.flags&1024){if(q=z.length,q>K)q=K;if(q){if(z.head){if(A=z.head.extra_len-z.length,!z.head.extra)z.head.extra=Array(z.head.extra_len);G$.arraySet(z.head.extra,U,J,q,A)}if(z.flags&512)z.check=I9(z.check,U,q,J);K-=q,J+=q,z.length-=q}if(z.length)break $}z.length=0,z.mode=q50;case q50:if(z.flags&2048){if(K===0)break $;q=0;do if(A=U[J+q++],z.head&&A&&z.length<65536)z.head.name+=String.fromCharCode(A);while(A&&q>9&1,z.head.done=!0;$.adler=z.check=0,z.mode=H3;break;case F50:while(W<32){if(K===0)break $;K--,H+=U[J++]<>>=W&7,W-=W&7,z.mode=ny;break}while(W<3){if(K===0)break $;K--,H+=U[J++]<>>=1,W-=1,H&3){case 0:z.mode=O50;break;case 1:if(ao0(z),z.mode=AM,Y===DM){H>>>=2,W-=2;break $}break;case 2:z.mode=M50;break;case 3:$.msg="invalid block type",z.mode=y4}H>>>=2,W-=2;break;case O50:H>>>=W&7,W-=W&7;while(W<32){if(K===0)break $;K--,H+=U[J++]<>>16^65535)){$.msg="invalid stored block lengths",z.mode=y4;break}if(z.length=H&65535,H=0,W=0,z.mode=iy,Y===DM)break $;case iy:z.mode=w50;case w50:if(q=z.length,q){if(q>K)q=K;if(q>G)q=G;if(q===0)break $;G$.arraySet(Q,U,J,q,I),K-=q,J+=q,G-=q,I+=q,z.length-=q;break}z.mode=H3;break;case M50:while(W<14){if(K===0)break $;K--,H+=U[J++]<>>=5,W-=5,z.ndist=(H&31)+1,H>>>=5,W-=5,z.ncode=(H&15)+4,H>>>=4,W-=4,z.nlen>286||z.ndist>30){$.msg="too many length or distance symbols",z.mode=y4;break}z.have=0,z.mode=N50;case N50:while(z.have>>=3,W-=3}while(z.have<19)z.lens[S[z.have++]]=0;if(z.lencode=z.lendyn,z.lenbits=7,b={bits:z.lenbits},T=FW(uo0,z.lens,0,19,z.lencode,0,z.work,b),z.lenbits=b.bits,T){$.msg="invalid code lengths set",z.mode=y4;break}z.have=0,z.mode=D50;case D50:while(z.have>>24,N=w>>>16&255,M=w&65535,O<=W)break;if(K===0)break $;K--,H+=U[J++]<>>=O,W-=O,z.lens[z.have++]=M;else{if(M===16){k=O+2;while(W>>=O,W-=O,z.have===0){$.msg="invalid bit length repeat",z.mode=y4;break}A=z.lens[z.have-1],q=3+(H&3),H>>>=2,W-=2}else if(M===17){k=O+3;while(W>>=O,W-=O,A=0,q=3+(H&7),H>>>=3,W-=3}else{k=O+7;while(W>>=O,W-=O,A=0,q=11+(H&127),H>>>=7,W-=7}if(z.have+q>z.nlen+z.ndist){$.msg="invalid bit length repeat",z.mode=y4;break}while(q--)z.lens[z.have++]=A}}if(z.mode===y4)break;if(z.lens[256]===0){$.msg="invalid code -- missing end-of-block",z.mode=y4;break}if(z.lenbits=9,b={bits:z.lenbits},T=FW(v50,z.lens,0,z.nlen,z.lencode,0,z.work,b),z.lenbits=b.bits,T){$.msg="invalid literal/lengths set",z.mode=y4;break}if(z.distbits=6,z.distcode=z.distdyn,b={bits:z.distbits},T=FW(h50,z.lens,z.nlen,z.ndist,z.distcode,0,z.work,b),z.distbits=b.bits,T){$.msg="invalid distances set",z.mode=y4;break}if(z.mode=AM,Y===DM)break $;case AM:z.mode=BM;case BM:if(K>=6&&G>=258){if($.next_out=I,$.avail_out=G,$.next_in=J,$.avail_in=K,z.hold=H,z.bits=W,fo0($,Z),I=$.next_out,Q=$.output,G=$.avail_out,J=$.next_in,U=$.input,K=$.avail_in,H=z.hold,W=z.bits,z.mode===H3)z.back=-1;break}z.back=0;for(;;){if(w=z.lencode[H&(1<>>24,N=w>>>16&255,M=w&65535,O<=W)break;if(K===0)break $;K--,H+=U[J++]<>D)],O=w>>>24,N=w>>>16&255,M=w&65535,D+O<=W)break;if(K===0)break $;K--,H+=U[J++]<>>=D,W-=D,z.back+=D}if(H>>>=O,W-=O,z.back+=O,z.length=M,N===0){z.mode=T50;break}if(N&32){z.back=-1,z.mode=H3;break}if(N&64){$.msg="invalid literal/length code",z.mode=y4;break}z.extra=N&15,z.mode=A50;case A50:if(z.extra){k=z.extra;while(W>>=z.extra,W-=z.extra,z.back+=z.extra}z.was=z.length,z.mode=B50;case B50:for(;;){if(w=z.distcode[H&(1<>>24,N=w>>>16&255,M=w&65535,O<=W)break;if(K===0)break $;K--,H+=U[J++]<>D)],O=w>>>24,N=w>>>16&255,M=w&65535,D+O<=W)break;if(K===0)break $;K--,H+=U[J++]<>>=D,W-=D,z.back+=D}if(H>>>=O,W-=O,z.back+=O,N&64){$.msg="invalid distance code",z.mode=y4;break}z.offset=M,z.extra=N&15,z.mode=P50;case P50:if(z.extra){k=z.extra;while(W>>=z.extra,W-=z.extra,z.back+=z.extra}if(z.offset>z.dmax){$.msg="invalid distance too far back",z.mode=y4;break}z.mode=j50;case j50:if(G===0)break $;if(q=Z-G,z.offset>q){if(q=z.offset-q,q>z.whave){if(z.sane){$.msg="invalid distance too far back",z.mode=y4;break}}if(q>z.wnext)q-=z.wnext,V=z.wsize-q;else V=z.wnext-q;if(q>z.length)q=z.length;F=z.window}else F=Q,V=I-z.offset,q=z.length;if(q>G)q=G;G-=q,z.length-=q;do Q[I++]=F[V++];while(--q);if(z.length===0)z.mode=BM;break;case T50:if(G===0)break $;Q[I++]=z.length,G--,z.mode=BM;break;case ny:if(z.wrap){while(W<32){if(K===0)break $;K--,H|=U[J++]<{i50.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 c50=E((rd1,n50)=>{function qr0(){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=qr0});var d50=E((Or0)=>{var MJ=b50(),OW=K3(),jM=Sy(),G6=oy(),ry=ZM(),Vr0=gy(),Lr0=c50(),p50=Object.prototype.toString;function Iz($){if(!(this instanceof Iz))return new Iz($);this.options=OW.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 Vr0,this.strm.avail_out=0;var z=MJ.inflateInit2(this.strm,Y.windowBits);if(z!==G6.Z_OK)throw Error(ry[z]);if(this.header=new Lr0,MJ.inflateGetHeader(this.strm,this.header),Y.dictionary){if(typeof Y.dictionary==="string")Y.dictionary=jM.string2buf(Y.dictionary);else if(p50.call(Y.dictionary)==="[object ArrayBuffer]")Y.dictionary=new Uint8Array(Y.dictionary);if(Y.raw){if(z=MJ.inflateSetDictionary(this.strm,Y.dictionary),z!==G6.Z_OK)throw Error(ry[z])}}}Iz.prototype.push=function($,Y){var z=this.strm,U=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")z.input=jM.binstring2buf($);else if(p50.call($)==="[object ArrayBuffer]")z.input=new Uint8Array($);else z.input=$;z.next_in=0,z.avail_in=z.input.length;do{if(z.avail_out===0)z.output=new OW.Buf8(U),z.next_out=0,z.avail_out=U;if(J=MJ.inflate(z,G6.Z_NO_FLUSH),J===G6.Z_NEED_DICT&&Q)J=MJ.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(z.next_out){if(z.avail_out===0||J===G6.Z_STREAM_END||z.avail_in===0&&(I===G6.Z_FINISH||I===G6.Z_SYNC_FLUSH))if(this.options.to==="string"){if(K=jM.utf8border(z.output,z.next_out),G=z.next_out-K,H=jM.buf2string(z.output,K),z.next_out=G,z.avail_out=U-G,G)OW.arraySet(z.output,z.output,K,G,0);this.onData(H)}else this.onData(OW.shrinkBuf(z.output,z.next_out))}if(z.avail_in===0&&z.avail_out===0)W=!0}while((z.avail_in>0||z.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=MJ.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),z.avail_out=0,!0;return!0};Iz.prototype.onData=function($){this.chunks.push($)};Iz.prototype.onEnd=function($){if($===G6.Z_OK)if(this.options.to==="string")this.result=this.chunks.join("");else this.result=OW.flattenChunks(this.chunks);this.chunks=[],this.err=$,this.msg=this.strm.msg};function sy($,Y){var z=new Iz(Y);if(z.push($,!0),z.err)throw z.msg||ry[z.err];return z.result}function Fr0($,Y){return Y=Y||{},Y.raw=!0,sy($,Y)}Or0.Inflate=Iz;Or0.inflate=sy;Or0.inflateRaw=Fr0;Or0.ungzip=sy});var o50=E((ad1,l50)=>{var Ar0=K3().assign,Br0=s$0(),Pr0=d50(),jr0=oy(),m50={};Ar0(m50,Br0,Pr0,jr0);l50.exports=m50});var s50=E((Rr0)=>{var Tr0=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Uint32Array<"u",Er0=o50(),r50=c4(),TM=K$(),Cr0=Tr0?"uint8array":"array";Rr0.magic="\b\x00";function Kz($,Y){TM.call(this,"FlateWorker/"+$),this._pako=null,this._pakoAction=$,this._pakoOptions=Y,this.meta={}}r50.inherits(Kz,TM);Kz.prototype.processChunk=function($){if(this.meta=$.meta,this._pako===null)this._createPako();this._pako.push(r50.transformTo(Cr0,$.data),!1)};Kz.prototype.flush=function(){if(TM.prototype.flush.call(this),this._pako===null)this._createPako();this._pako.push([],!0)};Kz.prototype.cleanUp=function(){TM.prototype.cleanUp.call(this),this._pako=null};Kz.prototype._createPako=function(){this._pako=new Er0[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var $=this;this._pako.onData=function(Y){$.push({data:Y,meta:$.meta})}};Rr0.compressWorker=function($){return new Kz("Deflate",$)};Rr0.uncompressWorker=function(){return new Kz("Inflate",{})}});var ay=E((Sr0)=>{var a50=K$();Sr0.STORE={magic:"\x00\x00",compressWorker:function(){return new a50("STORE compression")},uncompressWorker:function(){return new a50("STORE decompression")}};Sr0.DEFLATE=s50()});var ty=E((kr0)=>{kr0.LOCAL_FILE_HEADER="PK\x03\x04";kr0.CENTRAL_FILE_HEADER="PK\x01\x02";kr0.CENTRAL_DIRECTORY_END="PK\x05\x06";kr0.ZIP64_CENTRAL_DIRECTORY_LOCATOR="PK\x06\x07";kr0.ZIP64_CENTRAL_DIRECTORY_END="PK\x06\x06";kr0.DATA_DESCRIPTOR="PK\x07\b"});var Y90=E((Ym1,$90)=>{var NJ=c4(),DJ=K$(),ey=WJ(),t50=GM(),EM=ty(),N4=function($,Y){var z="",U;for(U=0;U>>8;return z},cr0=function($,Y){var z=$;if(!$)z=Y?16893:33204;return(z&65535)<<16},pr0=function($){return($||0)&63},e50=function($,Y,z,U,Q,J){var{file:I,compression:K}=$,G=J!==ey.utf8encode,H=NJ.transformTo("string",J(I.name)),W=NJ.transformTo("string",ey.utf8encode(I.name)),X=I.comment,Z=NJ.transformTo("string",J(X)),q=NJ.transformTo("string",ey.utf8encode(X)),V=W.length!==I.name.length,F=q.length!==X.length,w,O,N="",M="",D="",P=I.dir,j=I.date,A={crc32:0,compressedSize:0,uncompressedSize:0};if(!Y||z)A.crc32=$.crc32,A.compressedSize=$.compressedSize,A.uncompressedSize=$.uncompressedSize;var T=0;if(Y)T|=8;if(!G&&(V||F))T|=2048;var C=0,b=0;if(P)C|=16;if(Q==="UNIX")b=798,C|=cr0(I.unixPermissions,P);else b=20,C|=pr0(I.dosPermissions,P);if(w=j.getUTCHours(),w=w<<6,w=w|j.getUTCMinutes(),w=w<<5,w=w|j.getUTCSeconds()/2,O=j.getUTCFullYear()-1980,O=O<<4,O=O|j.getUTCMonth()+1,O=O<<5,O=O|j.getUTCDate(),V)M=N4(1,1)+N4(t50(H),4)+W,N+="up"+N4(M.length,2)+M;if(F)D=N4(1,1)+N4(t50(Z),4)+q,N+="uc"+N4(D.length,2)+D;var k="";k+=` + 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 w=(0,U.propertyInData)(W,X,V,Z.opts.ownProperties);if(G.setParams({property:V,depsCount:F.length,deps:F.join(", ")}),Z.allErrors)W.if(w,()=>{for(let O of F)(0,U.checkReportMissingProp)(G,O)});else W.if(Y._`${w} && (${(0,U.checkMissingProp)(G,F,q)})`),(0,U.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,z.alwaysValidSchema)(q,H[F]))continue;W.if((0,U.propertyInData)(W,X,F,q.opts.ownProperties),()=>{let w=G.subschema({keyword:Z,schemaProp:F},V);G.mergeValidEvaluated(w,V)},()=>W.var(V,!0)),G.ok(V)}}$.validateSchemaDeps=K,$.default=Q}),bb0=C0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=F1(),z=v1(),U={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,z.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=U}),De=C0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=J5(),z=F1(),U=Q5(),Q=v1(),J={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:{message:"must NOT have additional properties",params:({params:I})=>z._`{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),w=(0,Y.allSchemaProperties)(H.patternProperties);O(),I.ok(z._`${X} === ${U.default.errors}`);function O(){K.forIn("key",W,(j)=>{if(!F.length&&!w.length)D(j);else K.if(N(j),()=>D(j))})}function N(j){let A;if(F.length>8){let T=(0,Q.schemaRefOrVal)(Z,H.properties,"properties");A=(0,Y.isOwnProperty)(K,T,j)}else if(F.length)A=(0,z.or)(...F.map((T)=>z._`${j} === ${T}`));else A=z.nil;if(w.length)A=(0,z.or)(A,...w.map((T)=>z._`${(0,Y.usePattern)(I,T)}.test(${j})`));return(0,z.not)(A)}function M(j){K.code(z._`delete ${W}[${j}]`)}function D(j){if(V.removeAdditional==="all"||V.removeAdditional&&G===!1){M(j);return}if(G===!1){if(I.setParams({additionalProperty:j}),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(j,A,!1),K.if((0,z.not)(A),()=>{I.reset(),M(j)});else if(P(j,A),!q)K.if((0,z.not)(A),()=>K.break())}}function P(j,A,T){let C={keyword:"additionalProperties",dataProp:j,dataPropType:Q.Type.Str};if(T===!1)Object.assign(C,{compositeRule:!0,createErrors:!1,allErrors:!1});I.subschema(C,A)}}};$.default=J}),ib0=C0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=uQ(),z=J5(),U=v1(),Q=De(),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,z.allSchemaProperties)(G);for(let O of Z)X.definedProperties.add(O);if(X.opts.unevaluated&&Z.length&&X.props!==!0)X.props=U.mergeEvaluated.props(K,(0,U.toHash)(Z),X.props);let q=Z.filter((O)=>!(0,U.alwaysValidSchema)(X,G[O]));if(q.length===0)return;let V=K.name("valid");for(let O of q){if(F(O))w(O);else{if(K.if((0,z.propertyInData)(K,W,O,X.opts.ownProperties)),w(O),!X.allErrors)K.else().var(V,!0);K.endIf()}I.it.definedProperties.add(O),I.ok(V)}function F(O){return X.opts.useDefaults&&!X.compositeRule&&G[O].default!==void 0}function w(O){I.subschema({keyword:"properties",schemaProp:O,dataProp:O},V)}}};$.default=J}),nb0=C0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=J5(),z=F1(),U=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,U.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,w=K.name("valid");if(X.props!==!0&&!(X.props instanceof z.Name))X.props=(0,Q.evaluatedPropsToName)(K,X.props);let{props:O}=X;N();function N(){for(let P of q){if(F)M(P);if(X.allErrors)D(P);else K.var(w,!0),D(P),K.if(w)}}function M(P){for(let j in F)if(new RegExp(P).test(j))(0,U.checkStrictMode)(X,`property ${j} matches pattern ${P} (use allowMatchingProperties)`)}function D(P){K.forIn("key",H,(j)=>{K.if(z._`${(0,Y.usePattern)(I,P)}.test(${j})`,()=>{let A=V.includes(P);if(!A)I.subschema({keyword:"patternProperties",schemaProp:P,dataProp:j,dataPropType:Q.Type.Str},w);if(X.opts.unevaluated&&O!==!0)K.assign(z._`${O}[${j}]`,!0);else if(!A&&!X.allErrors)K.if((0,z.not)(w),()=>K.break())})})}}};$.default=J}),cb0=C0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=v1(),z={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(U){let{gen:Q,schema:J,it:I}=U;if((0,Y.alwaysValidSchema)(I,J)){U.fail();return}let K=Q.name("valid");U.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},K),U.failResult(K,()=>U.reset(),()=>U.error())},error:{message:"must NOT be valid"}};$.default=z}),pb0=C0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:J5().validateUnion,error:{message:"must match a schema in anyOf"}};$.default=Y}),db0=C0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=F1(),z=v1(),U={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 w;if((0,z.alwaysValidSchema)(G,V))J.var(Z,!0);else w=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),w)Q.mergeEvaluated(w,Y.Name)})})}}};$.default=U}),mb0=C0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=v1(),z={keyword:"allOf",schemaType:"array",code(U){let{gen:Q,schema:J,it:I}=U;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=U.subschema({keyword:"allOf",schemaProp:H},K);U.ok(K),U.mergeEvaluated(W)})}};$.default=z}),lb0=C0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=F1(),z=v1(),U={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,z.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,w){return()=>{let O=J.subschema({keyword:F},Z);if(I.assign(X,Z),J.mergeValidEvaluated(O,X),w)I.assign(w,Y._`${F}`);else J.setParams({ifClause:F})}}}};function Q(J,I){let K=J.schema[I];return K!==void 0&&!(0,z.alwaysValidSchema)(J,K)}$.default=U}),ob0=C0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=v1(),z={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:U,parentSchema:Q,it:J}){if(Q.if===void 0)(0,Y.checkStrictMode)(J,`"${U}" without "if" is ignored`)}};$.default=z}),Ae=C0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=Me(),z=xb0(),U=Ne(),Q=fb0(),J=ub0(),I=DS(),K=bb0(),G=De(),H=ib0(),W=nb0(),X=cb0(),Z=pb0(),q=db0(),V=mb0(),F=lb0(),w=ob0();function O(N=!1){let M=[X.default,Z.default,q.default,V.default,F.default,w.default,K.default,G.default,I.default,H.default,W.default];if(N)M.push(z.default,Q.default);else M.push(Y.default,U.default);return M.push(J.default),M}$.default=O}),rb0=C0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=F1(),z={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:{message:({schemaCode:U})=>Y.str`must match format "${U}"`,params:({schemaCode:U})=>Y._`{format: ${U}}`},code(U,Q){let{gen:J,data:I,$data:K,schema:G,schemaCode:H,it:W}=U,{opts:X,errSchemaPath:Z,schemaEnv:q,self:V}=W;if(!X.validateFormats)return;if(K)F();else w();function F(){let O=J.scopeValue("formats",{ref:V.formats,code:X.code.formats}),N=J.const("fDef",Y._`${O}[${H}]`),M=J.let("fType"),D=J.let("format");J.if(Y._`typeof ${N} == "object" && !(${N} instanceof RegExp)`,()=>J.assign(M,Y._`${N}.type || "string"`).assign(D,Y._`${N}.validate`),()=>J.assign(M,Y._`"string"`).assign(D,N)),U.fail$data((0,Y.or)(P(),j()));function P(){if(X.strictSchema===!1)return Y.nil;return Y._`${H} && !${D}`}function j(){let A=q.$async?Y._`(${N}.async ? await ${D}(${I}) : ${D}(${I}))`:Y._`${D}(${I})`,T=Y._`(typeof ${D} == "function" ? ${A} : ${D}.test(${I}))`;return Y._`${D} && ${D} !== true && ${M} === ${Q} && !${T}`}}function w(){let O=V.formats[G];if(!O){P();return}if(O===!0)return;let[N,M,D]=j(O);if(N===Q)U.pass(A());function P(){if(X.strictSchema===!1){V.logger.warn(T());return}throw Error(T());function T(){return`unknown format "${G}" ignored in schema at path "${Z}"`}}function j(T){let C=T instanceof RegExp?(0,Y.regexpCode)(T):X.code.formats?Y._`${X.code.formats}${(0,Y.getProperty)(G)}`:void 0,b=J.scopeValue("formats",{key:G,ref:T,code:C});if(typeof T=="object"&&!(T instanceof RegExp))return[T.type||"string",T.validate,Y._`${b}.validate`];return["string",T,b]}function A(){if(typeof O=="object"&&!(O instanceof RegExp)&&O.async){if(!q.$async)throw Error("async format in sync schema");return Y._`await ${D}(${I})`}return typeof M=="function"?Y._`${D}(${I})`:Y._`${D}.test(${I})`}}}};$.default=z}),Be=C0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=[rb0().default];$.default=Y}),Pe=C0(($)=>{Object.defineProperty($,"__esModule",{value:!0}),$.contentVocabulary=$.metadataVocabulary=void 0,$.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"],$.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]}),je=C0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=Oe(),z=we(),U=Ae(),Q=Be(),J=Pe(),I=[Y.default,z.default,(0,U.default)(),Q.default,J.metadataVocabulary,J.contentVocabulary];$.default=I}),sb0=C0(($)=>{Object.defineProperty($,"__esModule",{value:!0}),$.DiscrError=void 0;var Y;(function(z){z.Tag="tag",z.Mapping="mapping"})(Y||($.DiscrError=Y={}))}),AS=C0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=F1(),z=sb0(),U=nO(),Q=bQ(),J=v1(),I={keyword:"discriminator",type:"object",schemaType:"object",error:{message:({params:{discrError:K,tagName:G}})=>K===z.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),w=G.const("tag",Y._`${H}${(0,Y.getProperty)(V)}`);G.if(Y._`typeof ${w} == "string"`,()=>O(),()=>K.error(!1,{discrError:z.DiscrError.Tag,tag:w,tagName:V})),K.ok(F);function O(){let D=M();G.if(!1);for(let P in D)G.elseIf(Y._`${w} === ${P}`),G.assign(F,N(D[P]));G.else(),K.error(!1,{discrError:z.DiscrError.Mapping,tag:w,tagName:V}),G.endIf()}function N(D){let P=G.name("valid"),j=K.subschema({keyword:"oneOf",schemaProp:D},P);return K.mergeEvaluated(j,Y.Name),P}function M(){var D;let P={},j=T(X),A=!0;for(let k=0;k{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}}),Te=C0(($,Y)=>{Object.defineProperty($,"__esModule",{value:!0}),$.MissingRefError=$.ValidationError=$.CodeGen=$.Name=$.nil=$.stringify=$.str=$._=$.KeywordCxt=$.Ajv=void 0;let z=wS(),U=je(),Q=AS(),J=ab0(),I=["/properties"],K="http://json-schema.org/draft-07/schema";var G=class extends z.default{_addVocabularies(){if(super._addVocabularies(),U.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=uQ();Object.defineProperty($,"KeywordCxt",{enumerable:!0,get:function(){return H.KeywordCxt}});var W=F1();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=OH();Object.defineProperty($,"ValidationError",{enumerable:!0,get:function(){return X.default}});var Z=bQ();Object.defineProperty($,"MissingRefError",{enumerable:!0,get:function(){return Z.default}})}),Ee=C0(($)=>{Object.defineProperty($,"__esModule",{value:!0}),$.dynamicAnchor=void 0;let Y=F1(),z=Q5(),U=nO(),Q=MS(),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._`${z.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:w}=X.opts,O=new U.SchemaEnv({schema:W,schemaId:w,root:Z,baseId:q,localRefs:V,meta:F});return U.compileSchema.call(X,O),(0,Q.getValidate)(G,O)}$.default=J}),Ce=C0(($)=>{Object.defineProperty($,"__esModule",{value:!0}),$.dynamicRef=void 0;let Y=F1(),z=Q5(),U=MS(),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._`${z.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,U.callRef)(I,V),G.let(F,!0)}):()=>(0,U.callRef)(I,V)}}$.dynamicRef=J,$.default=Q}),tb0=C0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=Ee(),z=v1(),U={keyword:"$recursiveAnchor",schemaType:"boolean",code(Q){if(Q.schema)(0,Y.dynamicAnchor)(Q,"");else(0,z.checkStrictMode)(Q.it,"$recursiveAnchor: false is ignored")}};$.default=U}),eb0=C0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=Ce(),z={keyword:"$recursiveRef",schemaType:"string",code:(U)=>(0,Y.dynamicRef)(U,U.schema)};$.default=z}),Re=C0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=Ee(),z=Ce(),U=tb0(),Q=eb0(),J=[Y.default,z.default,U.default,Q.default];$.default=J}),$i0=C0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=DS(),z={keyword:"dependentRequired",type:"object",schemaType:"object",error:Y.error,code:(U)=>(0,Y.validatePropertyDeps)(U)};$.default=z}),Yi0=C0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=DS(),z={keyword:"dependentSchemas",type:"object",schemaType:"object",code:(U)=>(0,Y.validateSchemaDeps)(U)};$.default=z}),zi0=C0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=v1(),z={keyword:["maxContains","minContains"],type:"array",schemaType:"number",code({keyword:U,parentSchema:Q,it:J}){if(Q.contains===void 0)(0,Y.checkStrictMode)(J,`"${U}" without "contains" is ignored`)}};$.default=z}),_e=C0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=$i0(),z=Yi0(),U=zi0(),Q=[Y.default,z.default,U.default];$.default=Q}),Ui0=C0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=F1(),z=v1(),U=Q5(),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,(w)=>I.if(V(Z,w),()=>q(w))));else if(Z!==!0)I.forIn("key",G,(w)=>Z===void 0?q(w):I.if(F(Z,w),()=>q(w)));W.props=!0,J.ok(Y._`${H} === ${U.default.errors}`);function q(w){if(K===!1){if(J.setParams({unevaluatedProperty:w}),J.error(),!X)I.break();return}if(!(0,z.alwaysValidSchema)(W,K)){let O=I.name("valid");if(J.subschema({keyword:"unevaluatedProperties",dataProp:w,dataPropType:z.Type.Str},O),!X)I.if((0,Y.not)(O),()=>I.break())}}function V(w,O){return Y._`!${w} || !${w}[${O}]`}function F(w,O){let N=[];for(let M in w)if(w[M]===!0)N.push(Y._`${O} !== ${M}`);return(0,Y.and)(...N)}}};$.default=Q}),Qi0=C0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=F1(),z=v1(),U={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,z.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:z.Type.Num},Z),!G.allErrors)J.if((0,Y.not)(Z),()=>J.break())})}}};$.default=U}),ve=C0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=Ui0(),z=Qi0(),U=[Y.default,z.default];$.default=U}),Ji0=C0(($,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"}]}}}}}),Ii0=C0(($,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:"#"}}}}}),Ki0=C0(($,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:"#"}}}}),Gi0=C0(($,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:{}}}}}),Hi0=C0(($,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"}}}}),Wi0=C0(($,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}}}}),Xi0=C0(($,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:[]}}}}),Zi0=C0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=Ji0(),z=Ii0(),U=Ki0(),Q=Gi0(),J=Hi0(),I=Wi0(),K=Xi0(),G=["/properties"];function H(W){return[Y,z,U,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}),qi0=C0(($,Y)=>{Object.defineProperty($,"__esModule",{value:!0}),$.MissingRefError=$.ValidationError=$.CodeGen=$.Name=$.nil=$.stringify=$.str=$._=$.KeywordCxt=$.Ajv2019=void 0;let z=wS(),U=je(),Q=Re(),J=_e(),I=ve(),K=AS(),G=Zi0(),H="https://json-schema.org/draft/2019-09/schema";var W=class extends z.default{constructor(F={}){super({...F,dynamicRef:!0,next:!0,unevaluated:!0})}_addVocabularies(){if(super._addVocabularies(),this.addVocabulary(Q.default),U.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:w}=this.opts;if(!w)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=uQ();Object.defineProperty($,"KeywordCxt",{enumerable:!0,get:function(){return X.KeywordCxt}});var Z=F1();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=OH();Object.defineProperty($,"ValidationError",{enumerable:!0,get:function(){return q.default}});var V=bQ();Object.defineProperty($,"MissingRefError",{enumerable:!0,get:function(){return V.default}})}),Vi0=C0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=Oe(),z=we(),U=Ae(),Q=Re(),J=_e(),I=ve(),K=Be(),G=Pe(),H=[Q.default,Y.default,z.default,(0,U.default)(!0),K.default,G.metadataVocabulary,G.contentVocabulary,J.default,I.default];$.default=H}),Li0=C0(($,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}}}}),Fi0=C0(($,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"}}}}}),Oi0=C0(($,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"}}}}),wi0=C0(($,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"}}}}),Mi0=C0(($,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"}}}}),Ni0=C0(($,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"}}}}),Di0=C0(($,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}}}}),Ai0=C0(($,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:[]}}}}),Bi0=C0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=Li0(),z=Fi0(),U=Oi0(),Q=wi0(),J=Mi0(),I=Ni0(),K=Di0(),G=Ai0(),H=["/properties"];function W(X){return[Y,z,U,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}),Pi0=C0(($,Y)=>{Object.defineProperty($,"__esModule",{value:!0}),$.MissingRefError=$.ValidationError=$.CodeGen=$.Name=$.nil=$.stringify=$.str=$._=$.KeywordCxt=$.Ajv2020=void 0;let z=wS(),U=Vi0(),Q=AS(),J=Bi0(),I="https://json-schema.org/draft/2020-12/schema";var K=class extends z.default{constructor(Z={}){super({...Z,dynamicRef:!0,next:!0,unevaluated:!0})}_addVocabularies(){if(super._addVocabularies(),U.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=uQ();Object.defineProperty($,"KeywordCxt",{enumerable:!0,get:function(){return G.KeywordCxt}});var H=F1();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=OH();Object.defineProperty($,"ValidationError",{enumerable:!0,get:function(){return W.default}});var X=bQ();Object.defineProperty($,"MissingRefError",{enumerable:!0,get:function(){return X.default}})}),ji0=C0(($)=>{Object.defineProperty($,"__esModule",{value:!0}),$.formatNames=$.fastFormats=$.fullFormats=void 0;function Y(k,S){return{validate:k,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:O,"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:M,int32:{type:"number",validate:j},int64:{type:"number",validate:A},float:{type:"number",validate:T},double:{type:"number",validate:T},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 z(k){return k%4===0&&(k%100!==0||k%400===0)}let U=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,Q=[0,31,28,31,30,31,30,31,31,30,31,30,31];function J(k){let S=U.exec(k);if(!S)return!1;let i=+S[1],n=+S[2],U0=+S[3];return n>=1&&n<=12&&U0>=1&&U0<=(n===2&&z(i)?29:Q[n])}function I(k,S){if(!(k&&S))return;if(k>S)return 1;if(k23||p>59||k&&!t)return!1;if(U0<=23&&x<=59&&d<60)return!0;let Y0=x-p*e,y=U0-g*e-(Y0<0?1:0);return(y===23||y===-1)&&(Y0===59||Y0===-1)&&d<61}}function H(k,S){if(!(k&&S))return;let i=new Date("2020-01-01T"+k).valueOf(),n=new Date("2020-01-01T"+S).valueOf();if(!(i&&n))return;return i-n}function W(k,S){if(!(k&&S))return;let i=K.exec(k),n=K.exec(S);if(!(i&&n))return;if(k=i[1]+i[2]+i[3],S=n[1]+n[2]+n[3],k>S)return 1;if(k=D}function A(k){return Number.isInteger(k)}function T(){return!0}let C=/[^\\]\\Z/;function b(k){if(C.test(k))return!1;try{return new RegExp(k),!0}catch(S){return!1}}}),Ti0=C0(($)=>{Object.defineProperty($,"__esModule",{value:!0}),$.formatLimitDefinition=void 0;let Y=Te(),z=F1(),U=z.operators,Q={formatMaximum:{okStr:"<=",ok:U.LTE,fail:U.GT},formatMinimum:{okStr:">=",ok:U.GTE,fail:U.LT},formatExclusiveMaximum:{okStr:"<",ok:U.LT,fail:U.GTE},formatExclusiveMinimum:{okStr:">",ok:U.GT,fail:U.LTE}},J={message:({keyword:K,schemaCode:G})=>z.str`should be ${Q[K].okStr} ${G}`,params:({keyword:K,schemaCode:G})=>z._`{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)w();else O();function w(){let M=G.scopeValue("formats",{ref:V.formats,code:q.code.formats}),D=G.const("fmt",z._`${M}[${F.schemaCode}]`);K.fail$data((0,z.or)(z._`typeof ${D} != "object"`,z._`${D} instanceof RegExp`,z._`typeof ${D}.compare != "function"`,N(D)))}function O(){let M=F.schema,D=V.formats[M];if(!D||D===!0)return;if(typeof D!="object"||D instanceof RegExp||typeof D.compare!="function")throw Error(`"${X}": format "${M}" does not define "compare" function`);let P=G.scopeValue("formats",{key:M,ref:D,code:q.code.formats?z._`${q.code.formats}${(0,z.getProperty)(M)}`:void 0});K.fail$data(N(P))}function N(M){return z._`${M}.compare(${H}, ${W}) ${Q[X].fail} 0`}},dependencies:["format"]};let I=(K)=>{return K.addKeyword($.formatLimitDefinition),K};$.default=I}),Ei0=C0(($,Y)=>{Object.defineProperty($,"__esModule",{value:!0});let z=ji0(),U=Ti0(),Q=F1(),J=new Q.Name("fullFormats"),I=new Q.Name("fastFormats"),K=(H,W={keywords:!0})=>{if(Array.isArray(W))return G(H,W,z.fullFormats,J),H;let[X,Z]=W.mode==="fast"?[z.fastFormats,I]:[z.fullFormats,J];if(G(H,W.formats||z.formatNames,X,Z),W.keywords)(0,U.default)(H);return H};K.get=(H,W="full")=>{let X=(W==="fast"?z.fastFormats:z.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}),he=Te(),Ci0=qi0(),Ri0=Pi0(),_i0=sq(Ei0(),1),vi0=_i0.default;qb1=he.Ajv});import BS from"node:process";var pO=m(()=>{Se()});function jS($){return!!$&&typeof $==="object"&&ne in $}function Si0($){return $[ne]?.complete}function gi0($,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 yi0($,Y){let z={},U=(Q)=>Y===void 0||Q===!0;if($.toolsListChanged===!0&&U(Y?.tools?.listChanged))z.toolsListChanged=!0;if($.promptsListChanged===!0&&U(Y?.prompts?.listChanged))z.promptsListChanged=!0;if($.resourcesListChanged===!0&&U(Y?.resources?.listChanged))z.resourcesListChanged=!0;if($.resourceSubscriptions!==void 0&&$.resourceSubscriptions.length>0&&U(Y?.resources?.subscribe))z.resourceSubscriptions=[...$.resourceSubscriptions];return z}function ge($,Y){return{method:$.method,params:{...$.params,_meta:{...$.params?._meta,[fY]:Y}}}}function ki0($){let Y=C7(LH).validateRequest("subscriptions/listen",$);return Y.ok?Y.value.params?.notifications:void 0}function fi0($,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 ii0($){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??ui0,roundTimeoutMs:$?.roundTimeoutMs??bi0,legacyShim:$?.legacyShim??!0}}function pe($,Y,z){if(z===null||typeof z!=="object"||typeof z.method!=="string")throw new J1(c0.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 U=z,Q=yt(U);if(Q===void 0)throw new J1(c0.InternalError,`Handler for ${$} returned an input request '${Y}' of kind '${U.method}', which is not an embedded request the 2026-07-28 revision defines`);return{embedded:U,required:Q}}function ni0(){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 z=[...Y].map((U)=>U.toString(16).padStart(2,"0")).join("");return`${z.slice(0,8)}-${z.slice(8,12)}-${z.slice(12,16)}-${z.slice(16,20)}-${z.slice(20)}`}function PS($,Y){if($==="tools/call")return{content:[{type:"text",text:Y}],isError:!0};throw new J1(c0.InternalError,Y)}function TS($,Y){de($,Y)}function ES($){return me($)}function mi0($){return{...$}}function ye($,Y){if($){let U=Y;return async(Q,J)=>U(Q,J)}let z=Y;return async(U,Q)=>z(Q)}function xe($){if($===void 0)return;try{return v7($,"output")}catch{return}}function fe($,Y,z){if(Y){let U=z;return async(Q,J)=>{let I=await iY(Y,Q);if(!I.success)throw new J1(c0.InvalidParams,`Invalid arguments for prompt ${$}: ${I.error}`);return U(I.data,J)}}else{let U=z;return async(Q,J)=>{return U(J)}}}function ue($){return{completion:{values:$.map(String).slice(0,100),total:$.length,hasMore:$.length>100}}}function be($){let Y=$;if(Y.shape&&typeof Y.shape==="object")return Y.shape}function li0($){return $?.type==="optional"}function ie($){if(!li0($))return $;return $.def?.innerType??$}var ne,dO=1024,xi0,ce=class{_subs=new Map;_serverCapabilities;_serverInfo;constructor($=dO,Y,z){this._maxSubscriptions=$,this._serverCapabilities=Y,this._serverInfo=z}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=ki0($);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 z=yi0(Y,this._serverCapabilities);return this._subs.set($.id,z),ge({method:"notifications/subscriptions/acknowledged",params:{notifications:z}},$.id)}cancel($){return this._subs.delete($)}routeOutbound($){if(!xi0.has($.method))return"passthrough";let Y=$.params?.uri,z=typeof Y==="string"?Y:void 0,U=fi0($.method,z),Q=[];for(let[J,I]of this._subs)if(gi0(I,U))Q.push(ge({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:{[fY]:Y,...this._serverInfo!==void 0&&{[o5]:this._serverInfo}}}});return this._subs.clear(),$}},ui0=8,bi0=600000,ci0=class{constructor($){this._host=$}async fulfill($,Y,z,U,Q){let{maxRounds:J,roundTimeoutMs:I}=this._host,K=U.mcpReq.signal,G=Q,H=0;while(!0){if(H+=1,H>J)return PS($,ze($,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(c0.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 w=this._host.resolvedClientCapabilities(U),O=[];for(let[M,D]of Object.entries(W)){let{embedded:P,required:j}=pe($,M,D);if(P.method!=="roots/list"&&P.params===void 0)throw new J1(c0.InternalError,`Handler for ${$} returned an input request '${M}' of kind '${P.method}' without params`);if(EO(j,w)!==void 0)return PS($,`Cannot request input '${M}' (${P.method}): the client on this 2025-era connection did not declare the required capability${w===void 0?" (no client capabilities are available on this connection — per-request legacy serving cannot receive server-to-client requests)":""}`);O.push([M,P])}let N=Qe(K);try{let M={relatedRequestId:U.mcpReq.id,timeout:I,resetTimeoutOnProgress:!0,onprogress:()=>{},signal:N.signal},D=await Promise.all(O.map(async([P,j])=>{try{return[P,await this._dispatchLeg(j,M)]}catch(A){throw N.abort(A),A}}));q=Object.fromEntries(D)}catch(M){if(K.aborted)throw M;return PS($,`Fulfilling input required by '${$}' failed: ${M instanceof Error?M.message:String(M)}`)}finally{N.dispose()}}else await Ue(Ye,K);let V={...U,mcpReq:{...U.mcpReq,inputResponses:q,droppedInputResponseKeys:void 0,requestState:FH(Z)}};if(Z!==void 0){let w=await this._host.verifyRequestState(Z,V,$);if(w!==void 0)V=WS(V,w)}let F=await Y(z,V);if(!t9(F))return F;G=F}}async _dispatchLeg($,Y){switch($.method){case"elicitation/create":{let z=$.params;if(z.mode==="url"&&z.elicitationId===void 0)z={...z,elicitationId:ni0()};return await this._host.sendElicitation(z,Y)}case"sampling/createMessage":return await this._host.sendSampling($.params,Y);case"roots/list":return await this._host.listRoots($.params,Y)}}},pi0,di0,de,me,le,MH=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 ke;try{let z=v7(Y.inputSchema,"input");return this._toolInputSchemaJson[$]=z,z}catch{return}}constructor($,Y){if(this.server=new le($,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 z={name:$,title:Y.title,description:Y.description,inputSchema:Y.inputSchema?v7(Y.inputSchema,"input"):ke,annotations:Y.annotations,icons:Y.icons,execution:Y.execution,_meta:Y._meta};if(Y.outputSchema)z.outputSchema=v7(Y.outputSchema,"output");return z})})),this.server.setRequestHandler("tools/call",async($,Y)=>{let z=this._registeredTools[$.params.name];if(!z)throw new J1(c0.InvalidParams,`Tool ${$.params.name} not found`);if(!z.enabled)throw new J1(c0.InvalidParams,`Tool ${$.params.name} disabled`);try{let U=await this.validateToolInput(z,$.params.arguments,$.params.name),Q=await this.executeToolHandler(z,U,Y);if(await this.validateToolOutput(z,Q,$.params.name),t9(Q))return Q;return this.server.projectCallToolResult(Q,z.outputSchemaJson)}catch(U){if(U instanceof J1&&U.code===c0.UrlElicitationRequired)throw U;return this.createToolError(U instanceof Error?U.message:String(U))}}),this._toolHandlersInitialized=!0}createToolError($){return{content:[{type:"text",text:$}],isError:!0}}async validateToolInput($,Y,z){if(!$.inputSchema)return;let U=await iY($.inputSchema,Y??{});if(!U.success)throw new J1(c0.InvalidParams,`Input validation error: Invalid arguments for tool ${z}: ${U.error}`);return U.data}async validateToolOutput($,Y,z){if(!$.outputSchema)return;if(t9(Y))return;if(Y.isError)return;if(Y.structuredContent===void 0)throw new J1(c0.InvalidParams,`Output validation error: Tool ${z} has an output schema but no structured content was provided`);let U=await iY($.outputSchema,Y.structuredContent);if(!U.success)throw new J1(c0.InvalidParams,`Output validation error: Invalid structured content for tool ${z}: ${U.error}`)}async executeToolHandler($,Y,z){return $.executor(Y,z)}_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 QS($),this.handlePromptCompletion($,$.params.ref);case"ref/resource":return JS($),this.handleResourceCompletion($,$.params.ref);default:throw new J1(c0.InvalidParams,`Invalid completion reference: ${$.params.ref}`)}}),this._completionHandlerInitialized=!0}async handlePromptCompletion($,Y){let z=this._registeredPrompts[Y.name];if(!z)throw new J1(c0.InvalidParams,`Prompt ${Y.name} not found`);if(!z.enabled)throw new J1(c0.InvalidParams,`Prompt ${Y.name} disabled`);if(!z.argsSchema)return wH;let U=ie(be(z.argsSchema)?.[$.params.argument.name]);if(!jS(U))return wH;let Q=Si0(U);if(!Q)return wH;return ue(await Q($.params.argument.value,$.params.context))}async handleResourceCompletion($,Y){let z=Object.values(this._registeredResourceTemplates).find((Q)=>Q.resourceTemplate.uriTemplate.toString()===Y.uri);if(!z){if(this._registeredResources[Y.uri])return wH;throw new J1(c0.InvalidParams,`Resource template ${$.params.ref.uri} not found`)}let U=z.resourceTemplate.completeCallback($.params.argument.name);if(!U)return wH;return ue(await U($.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 z=Object.entries(this._registeredResources).filter(([Q,J])=>J.enabled).map(([Q,J])=>({uri:Q,name:J.name,...J.metadata})),U=[];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)U.push({...Q.metadata,...I})}return{resources:[...z,...U]}}),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 z;try{z=new URL($.params.uri)}catch{throw new J1(c0.InvalidParams,`Resource URI ${$.params.uri} is invalid`,{uri:$.params.uri,reason:"invalid_uri"})}let U=this._registeredResources[z.toString()];if(U){if(!U.enabled)throw new J1(c0.InvalidParams,`Resource ${z} disabled`);return CO(await U.readCallback(z,Y),U.cacheHint)}for(let Q of Object.values(this._registeredResourceTemplates)){let J=Q.resourceTemplate.uriTemplate.match(z.toString());if(J)return CO(await Q.readCallback(z,J,Y),Q.cacheHint)}throw new RO($.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?$e(Y.argsSchema):void 0,icons:Y.icons,_meta:Y._meta}})})),this.server.setRequestHandler("prompts/get",async($,Y)=>{let z=this._registeredPrompts[$.params.name];if(!z)throw new J1(c0.InvalidParams,`Prompt ${$.params.name} not found`);if(!z.enabled)throw new J1(c0.InvalidParams,`Prompt ${$.params.name} disabled`);return z.handler($.params.arguments,Y)}),this._promptHandlersInitialized=!0}registerResource($,Y,z,U){let Q=z.cacheHint,J=z;if(Q!==void 0){YS(Q,`resource ${$}`);let I={...z};delete I.cacheHint,J=I}if(typeof Y==="string"){if(this._registeredResources[Y])throw Error(`Resource ${Y} is already registered`);let I=this._createRegisteredResource($,z.title,Y,J,U);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($,z.title,Y,J,U);if(Q!==void 0)I.cacheHint=Q;return this.setResourceRequestHandlers(),this.sendResourceListChanged(),I}}_createRegisteredResource($,Y,z,U,Q){let J={name:$,title:Y,metadata:U,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!==z){if(delete this._registeredResources[z],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[z]=J,J}_createRegisteredResourceTemplate($,Y,z,U,Q){let J={resourceTemplate:z,title:Y,metadata:U,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=z.uriTemplate.variableNames;if(Array.isArray(I)&&I.some((K)=>!!z.completeCallback(K)))this.setCompletionRequestHandler();return J}_createRegisteredPrompt($,Y,z,U,Q,J,I){let K=U,G=Q,H={title:Y,description:z,argsSchema:U,icons:J,_meta:I,handler:fe($,U,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,U){let W=be(U);if(W){if(Object.values(W).some((X)=>{return jS(ie(X))}))this.setCompletionRequestHandler()}}return H}_createRegisteredTool($,Y,z,U,Q,J,I,K,G,H){if(FS($),U!==void 0)try{let Z=v7(U,"input");this._toolInputSchemaJson[$]=Z;let q=IS(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:z,inputSchema:U,outputSchema:Q,outputSchemaJson:xe(Q),annotations:J,icons:I,execution:K,_meta:G,handler:H,executor:ye(U,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")FS(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=ye(X.inputSchema,W);if(Z.outputSchema!==void 0)X.outputSchema=Z.outputSchema,X.outputSchemaJson=xe(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,z){if(this._registeredTools[$])throw Error(`Tool ${$} is already registered`);let{title:U,description:Q,inputSchema:J,outputSchema:I,annotations:K,icons:G,_meta:H}=Y;return this._createRegisteredTool($,U,Q,kO(J),kO(I),K,G,void 0,H,z)}registerPrompt($,Y,z){if(this._registeredPrompts[$])throw Error(`Prompt ${$} is already registered`);let{title:U,description:Q,argsSchema:J,icons:I,_meta:K}=Y,G=this._createRegisteredPrompt($,U,Q,kO(J),z,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()}},ke,wH;var CS=m(()=>{xO();pO();ne=Symbol.for("mcp.completable");xi0=new Set(["notifications/tools/list_changed","notifications/prompts/list_changed","notifications/resources/list_changed","notifications/resources/updated"]);pi0=new Set(["tools/call","prompts/get","resources/read"]);le=class extends ZS{_clientCapabilities;_clientVersion;static{di0=($,Y)=>{if(Y.clientCapabilities!==void 0)$._clientCapabilities=Y.clientCapabilities;if(Y.clientInfo!==void 0)$._clientVersion=Y.clientInfo},de=($,Y)=>{let z=Y.filter((U)=>!$._supportedProtocolVersions.includes(U));if(z.length>0)$._supportedProtocolVersions=[...$._supportedProtocolVersions,...z];$.setRequestHandler("server/discover",()=>$._ondiscover())},me=($)=>$._serverInfo}_capabilities;_instructions;_jsonSchemaValidator;_cacheHints;_requestStateVerify;_inputRequiredServing;_legacyShim;_legacyInputRequiredShim(){return this._legacyShim??=new ci0({maxRounds:this._inputRequiredServing.maxRounds,roundTimeoutMs:this._inputRequiredServing.roundTimeoutMs,resolvedClientCapabilities:($)=>this._inputRequestCapabilityView($),verifyRequestState:($,Y,z)=>this._verifyRequestState($,Y,z),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 cO,this._requestStateVerify=Y?.requestState?.verify,this._inputRequiredServing=ii0(Y?.inputRequired),Y?.cacheHints!==void 0){for(let[z,U]of Object.entries(Y.cacheHints))if(U!==void 0)YS(U,`cacheHints['${z}']`);this._cacheHints=Y.cacheHints}if(this.setRequestHandler("initialize",(z)=>this._oninitialize(z)),this.setNotificationHandler("notifications/initialized",()=>this.oninitialized?.()),rh(this._supportedProtocolVersions).length>0)this.setRequestHandler("server/discover",()=>this._ondiscover());if(this._capabilities.logging)this._registerLoggingHandler()}_registerLoggingHandler(){this.setRequestHandler("logging/setLevel",async($,Y)=>{let z=Y.sessionId||Y.http?.req?.headers.get("mcp-session-id")||void 0,{level:U}=$.params,Q=yO(T7,U);if(Q.success)this._loggingLevels.set(z,Q.data);return{}})}buildContext($,Y){let z=$.http||Y?.request||Y?.closeSSEStream||Y?.closeStandaloneSSEStream;return{...$,mcpReq:{...$.mcpReq,log:(U,Q,J)=>{if(!this._capabilities.logging)return Promise.resolve();let I;if(this._servedModernEra()){if(I=$.mcpReq.envelope?.[N7],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(U)this.elicitInput(U,Q),requestSampling:(U,Q)=>this.createMessage(U,Q)},http:z?{...$.http,req:Y?.request,closeSSE:Y?.closeSSEStream,closeStandaloneSSE:Y?.closeStandaloneSSEStream}:void 0}}_loggingLevels=new Map;LOG_LEVEL_SEVERITY=new Map(T7.options.map(($,Y)=>[$,Y]));isMessageIgnored=($,Y)=>{let z=this._loggingLevels.get(Y);return z?this.LOG_LEVEL_SEVERITY.get($){let I=await Y(Q,J);if(t9(I))throw new J1(c0.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=U?await this._invokeInputRequiredCapableHandler($,Y,Q,J):await Y(Q,J);if(t9(I)){if(!U)throw new J1(c0.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 z===void 0?I:CO(I,z)}}return async(z,U)=>{let Q=C7(this._negotiatedProtocolVersion),J=Q.validateRequest("tools/call",z);if(!J.ok)throw new J1(J.reason==="not-in-era"?c0.InternalError:c0.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,z,U);if(t9(I))return I;let K=sh(I),G=Q.validateResult("tools/call",K);if(!G.ok)throw new J1(G.reason==="not-in-era"?c0.InternalError:c0.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&&xQ(this._negotiatedProtocolVersion)}async _invokeInputRequiredCapableHandler($,Y,z,U){let Q=this._servedModernEra(),J=U.mcpReq.requestState();if(J!==void 0&&typeof J!=="string")throw new J1(c0.InvalidParams,"Invalid or expired requestState",{reason:"invalid_request_state"});let I=U;if(typeof J==="string"){let X=await this._verifyRequestState(J,U,$);if(X!==void 0)I=WS(U,X)}let K;try{K=await Y(z,I)}catch(X){if(X instanceof J1&&X.code===c0.UrlElicitationRequired){if(!Q)throw X;throw new J1(c0.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(!t9(K))return K;if(!Q){if(!this._inputRequiredServing.legacyShim)throw new J1(c0.InternalError,`Handler for ${$} returned an input-required result, but this request is served on protocol revision ${this._negotiatedProtocolVersion??xY}, which has no input_required vocabulary`);return await this._legacyInputRequiredShim().fulfill($,Y,z,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(c0.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(U);for(let[Z,q]of Object.entries(G)){let{embedded:V,required:F}=pe($,Z,q),w=EO(F,X);if(w!==void 0)throw new _O({requiredCapabilities:w},`Cannot request input '${Z}' (${V.method}): the request's client capabilities do not declare the required capability`)}}return K}async _verifyRequestState($,Y,z){if(this._requestStateVerify===void 0)return;try{return await this._requestStateVerify($,Y)}catch(U){throw this.onerror?.(Error(`requestState verification rejected ${z}: ${U instanceof Error?U.message:String(U)}`)),new J1(c0.InvalidParams,"Invalid or expired requestState",{reason:"invalid_request_state"})}}_inputRequestCapabilityView($){return this._servedModernEra()?$.mcpReq.envelope?.[s9]:this._clientCapabilities}_assertPushApiInServedEra($){if(this._servedModernEra())throw new L1(B1.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 L1(B1.CapabilityNotSupported,`Client does not support sampling (required for ${$})`);break;case"elicitation/create":if(!this._clientCapabilities?.elicitation)throw new L1(B1.CapabilityNotSupported,`Client does not support elicitation (required for ${$})`);break;case"roots/list":if(!this._clientCapabilities?.roots)throw new L1(B1.CapabilityNotSupported,`Client does not support listing roots (required for ${$})`);break;case"ping":break}}assertNotificationCapability($){switch($){case"notifications/message":if(!this._capabilities.logging)throw new L1(B1.CapabilityNotSupported,`Server does not support logging (required for ${$})`);break;case"notifications/resources/updated":case"notifications/resources/list_changed":if(!this._capabilities.resources)throw new L1(B1.CapabilityNotSupported,`Server does not support notifying about resources (required for ${$})`);break;case"notifications/tools/list_changed":if(!this._capabilities.tools)throw new L1(B1.CapabilityNotSupported,`Server does not support notifying of tool list changes (required for ${$})`);break;case"notifications/prompts/list_changed":if(!this._capabilities.prompts)throw new L1(B1.CapabilityNotSupported,`Server does not support notifying of prompt list changes (required for ${$})`);break;case"notifications/elicitation/complete":if(!this._clientCapabilities?.elicitation?.url)throw new L1(B1.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 L1(B1.CapabilityNotSupported,`Server does not support completions (required for ${$})`);break;case"logging/setLevel":if(!this._capabilities.logging)throw new L1(B1.CapabilityNotSupported,`Server does not support logging (required for ${$})`);break;case"prompts/get":case"prompts/list":if(!this._capabilities.prompts)throw new L1(B1.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 L1(B1.CapabilityNotSupported,`Server does not support resources (required for ${$})`);break;case"tools/call":case"tools/list":if(!this._capabilities.tools)throw new L1(B1.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 z=xt(this._supportedProtocolVersions),U=z.includes(Y)?Y:z[0]??xY;return this._negotiatedProtocolVersion=U,this.transport?.setProtocolVersion?.(U),{protocolVersion:U,capabilities:this.getCapabilities(),serverInfo:this._serverInfo,...this._instructions&&{instructions:this._instructions}}}_ondiscover(){return{supportedVersions:rh(this._supportedProtocolVersions),capabilities:mi0(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 L1(B1.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(c0.InvalidParams,"The last message must contain only tool_result content if any is present");if(!W)throw new J1(c0.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(c0.InvalidParams,"ids of tool_result blocks and tool_use blocks from previous message do not match")}}let z=Boolean($.tools||$.toolChoice),U=await this.request({method:"sampling/createMessage",params:$},Y),Q=this._wireCodec().samplingResultVariant(z,U);if(!Q.ok)throw new L1(B1.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 L1(B1.CapabilityNotSupported,"Client does not support url elicitation.");break;case"form":if(!this._clientCapabilities?.elicitation?.form)throw new L1(B1.CapabilityNotSupported,"Client does not support form elicitation.");break}return this._sendElicitationLeg($,Y)}async _sendElicitationLeg($,Y,z){let U=$.mode??"form",Q=z?.validateAcceptedContent??!0;switch(U){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(c0.InvalidParams,`Elicitation response content does not match requested schema: ${K.errorMessage}`)}catch(K){if(K instanceof J1)throw K;throw new J1(c0.InternalError,`Error validating elicitation response: ${K instanceof Error?K.message:String(K)}`)}return I}}}createElicitationCompletionNotifier($,Y){if(!this._clientCapabilities?.elicitation?.url)throw new L1(B1.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"})}};ke={type:"object",properties:{}};wH={completion:{values:[],hasMore:!1}}});var oe=m(()=>{CS();xO();pO()});function si0($){let Y=$.params;if($.method==="initialize"&&!KS(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(!vO(Y))return{kind:"legacy",reason:"no-claim"};let z=cY(Y),U=(z===void 0?[]:SO(z))[0];if(U!==void 0)return{kind:"invalid-envelope",issue:U};let Q=hO(Y);if(Q===void 0||!R7.includes(Q))return{kind:"unsupported-revision",requested:Q??"unknown"};return{kind:"modern",revision:Q,classification:{era:"modern",revision:Q}}}function se($,Y={}){let z=Y.legacy??"serve",U=Y.transport??new oi0,Q={phase:"opening"},J,I=!1,K=()=>I||Q.phase==="closed",G=(T)=>{try{Y.onerror?.(T)}catch{}},H=(T,C,b,k)=>U.send({jsonrpc:"2.0",id:T,error:{code:C,message:b,...k!==void 0&&{data:k}}}).catch((S)=>G(I5(S))),W=new ce(Y.maxSubscriptions??dO),X=(T)=>{if(!_7(T))return;let C=W.routeOutbound(T);if(C==="passthrough")return;for(let b of C)U.send({jsonrpc:"2.0",...b}).catch((k)=>G(I5(k)));return"handled"},Z=async(T)=>{if(B$(T)&&T.method==="subscriptions/listen"){let C=cY(T.params),b=vO(T.params)?(C===void 0?[]:SO(C))[0]:{key:"_meta",problem:"the per-request envelope is required on protocol revision 2026-07-28"},k=hO(T.params),S;if(b!==void 0)S={jsonrpc:"2.0",id:T.id,error:{code:-32602,message:`Invalid _meta envelope: ${b.key}: ${b.problem}`}};else if(k===void 0||!R7.includes(k)){let i=new fQ({supported:[...R7],requested:k??"unknown"});S={jsonrpc:"2.0",id:T.id,error:{code:i.code,message:i.message,data:i.data}}}else S=W.serve(T);return await U.send("error"in S?S:{jsonrpc:"2.0",method:S.method,params:S.params}).catch((i)=>G(I5(i))),!0}if(_7(T)&&T.method==="notifications/cancelled"){let C=T.params?.requestId;if(C!==void 0&&W.cancel(C))return!0}return!1},q=(T,C,b)=>{let k=GS({kind:"legacy",reason:C,...b!==void 0&&{requestedVersion:b}},R7);if(k===void 0)return Promise.resolve();return G(Error(`Rejected 2025-era request on a modern-only stdio connection (${k.cell}): ${k.message}`)),H(T.id,k.code,k.message,k.data)},V=(T)=>{if(I||T===J)return;j()},F=async(T,C)=>{let b=await $({era:T}),k=b instanceof MH?b.server:b;if(T==="modern")XS(k,C),TS(k,R7),W.setServerCapabilities(k.getCapabilities(),ES(k));let S=new ri0(U,()=>V(S),T==="modern"?X:void 0);return await b.connect(S),{product:b,channel:S}},w=(T)=>T.product.close().catch((C)=>G(I5(C))),O=async(T)=>{J=T.channel;try{if(!await T.channel.whenRequestsAnswered(re))G(Error(`Discarded the probe instance with requests still unanswered after ${re}ms; continuing with the fallback`));await T.product.close()}catch(C){G(I5(C))}finally{J=void 0}},N=async(T)=>{if(Q.phase==="closed")return;if(Q.phase==="pinned"){if(Q.era==="modern"&&B$(T)&&T.method==="initialize"&&!KS(T.params)){await q(T,"initialize",T.params!==null&&typeof T.params==="object"&&typeof T.params.protocolVersion==="string"?T.params.protocolVersion:void 0);return}if(Q.era==="modern"&&await Z(T))return;Q.instance.channel.deliver(T);return}if(!B$(T)&&!_7(T)){G(Error("Discarded a JSON-RPC response received before the connection negotiated an era"));return}let C=si0(T);switch(C.kind){case"invalid-envelope":{let b=`Invalid _meta envelope for protocol revision 2026-07-28: ${C.issue.key}: ${C.issue.problem}`;if(B$(T))await H(T.id,c0.InvalidParams,b,{envelope:C.issue});else G(Error(`Discarded a notification with a malformed envelope: ${b}`));return}case"unsupported-revision":if(B$(T)){let b=new fQ({supported:[...R7],requested:C.requested});G(b),await H(T.id,b.code,b.message,b.data)}else G(Error(`Discarded a notification claiming unsupported protocol revision ${C.requested}`));return;case"modern":if(B$(T)&&T.method==="server/discover"){if(Q.phase==="probe"){Q.instance.channel.deliver(T,{classification:C.classification});return}let b=await F("modern",C.revision);if(K()){await w(b);return}Q={phase:"probe",instance:b},b.channel.deliver(T,{classification:C.classification});return}if(Q.phase==="probe"){if(_7(T)){Q.instance.channel.deliver(T,{classification:C.classification});return}Q={phase:"pinned",era:"modern",instance:Q.instance}}else{let b=await F("modern",C.revision);if(K()){await w(b);return}Q={phase:"pinned",era:"modern",instance:b}}if(await Z(T))return;Q.instance.channel.deliver(T,{classification:C.classification});return;case"legacy":{if(z==="reject"){if(B$(T))await q(T,C.reason,C.requestedVersion);return}if(Q.phase==="probe"){if(await O(Q.instance),K())return;Q={phase:"opening"}}let b=await F("legacy");if(K()){await w(b);return}Q={phase:"pinned",era:"legacy",instance:b},Q.instance.channel.deliver(T);return}}},M=[],D=!1,P=async()=>{if(D)return;D=!0;try{while(M.length>0){let T=M.shift();try{await N(T)}catch(C){if(B$(T))await H(T.id,c0.InternalError,"Internal server error");G(I5(C))}}}finally{D=!1}},j=async()=>{if(I||Q.phase==="closed")return;I=!0;let T=Q;Q={phase:"closed"};for(let C of W.teardownAll())await U.send(C).catch((b)=>G(I5(b)));if(T.phase==="probe"||T.phase==="pinned")await T.instance.product.close().catch((C)=>G(I5(C)));await U.close().catch((C)=>G(I5(C)))};U.onmessage=(T)=>{M.push(T),P()},U.onerror=(T)=>{if(G(T),Q.phase==="probe"||Q.phase==="pinned")Q.instance.channel.onerror?.(T)},U.onclose=()=>{if(I||Q.phase==="closed")return;I=!0;let T=Q;if(Q={phase:"closed"},T.phase==="probe"||T.phase==="pinned")T.instance.product.close().catch((C)=>G(I5(C)))};let A=U.start().catch((T)=>{throw G(I5(T)),T});return A.catch(()=>{}),{close:async()=>{await A.catch(()=>{}),await j()}}}function I5($){return $ instanceof Error?$:Error(String($))}var oi0=class{_readBuffer;_started=!1;_closed=!1;constructor($=BS.stdin,Y=BS.stdout,z){this._stdin=$,this._stdout=Y,this._readBuffer=new VS({maxBufferSize:z?.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,z)=>{let U=LS($),Q=!1,J=(K)=>{if(Q)return;Q=!0,this._stdout.off("error",J),this._stdout.off("drain",I),z(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(U)){if(Q)return;Q=!0,this._stdout.off("error",J),Y()}else if(!Q)this._stdout.once("drain",I)})}},re=3000,ri0=class{onclose;onerror;onmessage;_closed=!1;_pendingRequests=new Set;_drainWaiters=[];constructor($,Y,z){this._wire=$,this._onInstanceClose=Y,this._outboundIntercept=z}async start(){}async send($,Y){if(qH($)||gO($)){let{id:z}=$;if(z!==void 0)this._settle(z)}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(B$($))this._pendingRequests.add($.id);else if(_7($)&&$.method==="notifications/cancelled"){let z=$.params?.requestId;if(z!==void 0)this._settle(z)}this.onmessage?.($,Y)}async whenRequestsAnswered($){if(this._closed||this._pendingRequests.size===0)return!0;return await new Promise((Y)=>{let z=()=>{clearTimeout(U),Y(!0)},U=setTimeout(()=>{this._drainWaiters=this._drainWaiters.filter((Q)=>Q!==z),Y(!1)},$);this._drainWaiters.push(z)})}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 ae=m(()=>{CS();xO();pO()});var P$=m(()=>{vL();vL()});var e9;var NH=m(()=>{e9=class e9 extends Error{name="KyError";get isKyError(){return!0}}});var D6;var mO=m(()=>{NH();D6=class D6 extends e9{name="HTTPError";response;request;options;data;constructor($,Y,z){let U=$.status||$.status===0?$.status:"",Q=$.statusText??"",J=`${U} ${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=z}}});var DH;var RS=m(()=>{NH();DH=class DH extends e9{name="NetworkError";request;constructor($,Y){super(`Request failed due to a network error: ${$.method} ${$.url}`,Y);this.request=$}}});var AH;var _S=m(()=>{AH=class AH 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 iQ;var te=m(()=>{NH();_S();iQ=class iQ extends e9{name="ForceRetryError";customDelay;code;customRequest;constructor($){let Y=$?.cause?$.cause instanceof Error?$.cause:new AH($.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 vS;var ee=m(()=>{vS=class vS extends Error{name="SchemaValidationError";issues;constructor($){super("Response schema validation failed");this.issues=$}}});var K5;var lO=m(()=>{NH();K5=class K5 extends e9{name="TimeoutError";request;constructor($){super(`Request timed out: ${$.method} ${$.url}`);this.request=$}}});class aO{options;constructor($){this.options=$}}var hS,$00,oO,Y00,z00,rO,ai0=()=>{return},U00,nQ=2147483647,Q00=40,sO,J00=($)=>new aO($),I00,K00;var pY=m(()=>{hS=(()=>{let $=!1,Y=!1,z=typeof globalThis.ReadableStream==="function",U=typeof globalThis.Request==="function";if(z&&U)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})(),$00=typeof globalThis.AbortController==="function",oO=typeof globalThis.AbortSignal==="function"&&typeof globalThis.AbortSignal.any==="function",Y00=typeof globalThis.ReadableStream==="function",z00=typeof globalThis.FormData==="function",rO=["get","post","put","patch","head","delete"];ai0();U00={json:"application/json",text:"text/*",formData:"multipart/form-data",arrayBuffer:"*/*",blob:"*/*",bytes:"*/*"},sO=Symbol("stop");I00={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},K00={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 tO,ti0=($)=>{if(!$)return 0;if($ instanceof FormData){let Y=0;for(let[z,U]of $)Y+=Q00,Y+=tO.encode(`Content-Disposition: form-data; name="${z}"`).byteLength,Y+=typeof U==="string"?tO.encode(U).byteLength:U.size;return Y}if($ instanceof Blob)return $.size;if($ instanceof ArrayBuffer||ArrayBuffer.isView($))return $.byteLength;if(typeof $==="string")return tO.encode($).byteLength;if($ instanceof URLSearchParams)return tO.encode($.toString()).byteLength;return 0},G00=($,Y,z)=>{let U,Q=0;return $.pipeThrough(new TransformStream({transform(J,I){if(I.enqueue(J),U){Q+=U.byteLength;let K=Y===0?0:Q/Y;if(K>=1)K=1-Number.EPSILON;z?.({percent:K,totalBytes:Math.max(Y,Q),transferredBytes:Q},U)}U=J},flush(){if(U)Q+=U.byteLength,z?.({percent:1,totalBytes:Math.max(Y,Q),transferredBytes:Q},U)}}))},H00=($,Y)=>{if(!$.body)return $;let z={status:$.status,statusText:$.statusText,headers:$.headers};if($.status===204)return new Response(null,z);let U=Math.max(0,Number($.headers.get("content-length"))||0);return new Response(G00($.body,U,Y),z)},W00=($,Y,z)=>{if(!$.body)return $;let U=ti0(z??$.body);return new Request($,{duplex:"half",body:G00($.body,U,Y)})};var X00=m(()=>{pY();tO=new TextEncoder});var r5=($)=>$!==null&&typeof $==="object";function BH($,Y,z){return Object.hasOwn(Y,z)&&Y[z]===void 0?[]:kS($[z]??[],Y[z]??[])}var ei0,SS=($)=>r5($)&&$[ei0]===!0?{isReplace:!0,value:$.value}:{isReplace:!1,value:$},PH=(...$)=>{for(let Y of $)if((!r5(Y)||Array.isArray(Y))&&Y!==void 0)throw TypeError("The `options` argument must be an object");return kS({},...$)},yS=($={},Y={})=>{let z=new globalThis.Headers($),U=Y instanceof globalThis.Headers,Q=new globalThis.Headers(Y);for(let[J,I]of Q.entries())if(U&&I==="undefined"||I===void 0)z.delete(J);else z.set(J,I);return z},gS=($)=>{if(!r5($)||Array.isArray($))return!1;let Y=Object.getPrototypeOf($);return Y===Object.prototype||Y===null},cQ=($)=>{if($ instanceof URLSearchParams){let Y=new URLSearchParams($),z=$[h7];if(z)Y[h7]=new Set(z);return Y}if($ instanceof globalThis.Headers)return new globalThis.Headers($);if(Array.isArray($))return[...$];if(gS($))return{...$};return $},$n0=($)=>Object.fromEntries(Object.entries($).filter((Y)=>Y[1]!==void 0)),Yn0=($,Y)=>{if(gS($)&&gS(Y))return $n0({...$,...Y});return yS($,Y)},eO=($={},Y={})=>({init:BH($,Y,"init"),beforeRequest:BH($,Y,"beforeRequest"),beforeRetry:BH($,Y,"beforeRetry"),beforeError:BH($,Y,"beforeError"),afterResponse:BH($,Y,"afterResponse")}),h7,zn0=($,Y)=>{let z=new URLSearchParams,U=new Set;for(let Q of[$,Y]){if(Q===void 0)continue;if(Q instanceof URLSearchParams){for(let[I,K]of Q.entries())z.append(I,K),U.delete(I);let J=Q[h7];if(J)for(let I of J)z.delete(I),U.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");z.append(String(J[0]),String(J[1])),U.delete(String(J[0]))}else if(r5(Q))for(let[J,I]of Object.entries(Q))if(I===void 0)z.delete(J),U.add(J);else z.append(J,String(I)),U.delete(J);else{let J=new URLSearchParams(Q);for(let[I,K]of J.entries())z.append(I,K),U.delete(I)}}if(U.size>0)z[h7]=U;return z},kS=(...$)=>{let Y={},z={},U={},Q,J=[];for(let I of $)if(Array.isArray(I)){if(!Array.isArray(Y))Y=[];Y=[...Y,...I]}else if(r5(I)){for(let[K,G]of Object.entries(I)){if(K==="signal"&&G instanceof globalThis.AbortSignal){J.push(G);continue}let H=SS(G),{isReplace:W}=H;if(G=H.value,K==="context"){if(G!==void 0&&G!==null&&(!r5(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:zn0(Q,G);continue}if(r5(G)&&!W&&K in Y)G=kS(Y[K],G);Y={...Y,[K]:G}}if(r5(I.hooks)){let{value:K,isReplace:G}=SS(I.hooks);U=G?eO({},K):eO(U,K),Y.hooks=U}if(r5(I.headers)){let{value:K,isReplace:G}=SS(I.headers);z=G?cQ(K):Yn0(z,K),Y.headers=z}}if(Q!==void 0)Y.searchParams=Q;if(J.length>0)if(J.length===1)Y.signal=J[0];else if(oO)Y.signal=AbortSignal.any(J);else Y.signal=J.at(-1);return Y};var $w=m(()=>{pY();ei0=Symbol("replaceOption");h7=Symbol("deletedParameters")});var q00=($)=>rO.includes($)?$.toUpperCase():$,Un0,Qn0,Jn0,Z00,V00=($={})=>{if(typeof $==="number")return{...Z00,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((z)=>z.toLowerCase())}).filter(([,z])=>z!==void 0));return{...Z00,...Y}};var L00=m(()=>{pY();Un0=["get","put","head","delete","options","trace"],Qn0=[408,413,429,500,502,503,504],Jn0=[413,429,503],Z00={limit:2,methods:Un0,statusCodes:Qn0,afterStatusCodes:Jn0,maxRetryAfter:Number.POSITIVE_INFINITY,backoffLimit:Number.POSITIVE_INFINITY,delay:($)=>0.3*2**($-1)*1000,jitter:void 0,retryOnTimeout:!1}});async function xS($,Y,z,U){return new Promise((Q,J)=>{let I=setTimeout(()=>{if(z)z.abort();J(new K5($))},U.timeout);U.fetch($,Y).then(Q).catch(J).then(()=>{clearTimeout(I)})})}var F00=m(()=>{lO()});async function Yw($,{signal:Y}){return new Promise((z,U)=>{if(Y)Y.throwIfAborted(),Y.addEventListener("abort",Q,{once:!0});function Q(){clearTimeout(J),U(Y.reason)}let J=setTimeout(()=>{Y?.removeEventListener("abort",Q),z()},$)})}var O00=($)=>{let Y={};for(let z in $){if(!Object.hasOwn($,z))continue;if(!(z in K00)&&!(z in I00))Y[z]=$[z]}return Y},w00=($)=>{if($===void 0)return!1;if(Array.isArray($))return $.length>0;if($ instanceof URLSearchParams)return $.size>0||Boolean($[h7]?.size);if(typeof $==="object")return Object.keys($).length>0;if(typeof $==="string")return $.trim().length>0;return Boolean($)};var M00=m(()=>{pY();$w()});function fS($){if(!($&&Kn0($)&&$.name==="TypeError"&&typeof $.message==="string"))return!1;let{message:z,stack:U}=$;if(z==="Load failed")return U===void 0||"__sentry_captured__"in $;if(z.startsWith("error sending request for url"))return!0;if(z==="Failed to fetch"||z.startsWith("Failed to fetch (")&&z.endsWith(")"))return!0;return Gn0.has(z)}var In0,Kn0=($)=>In0.call($)==="[object Error]",Gn0;var N00=m(()=>{In0=Object.prototype.toString,Gn0=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 D00($){return uS($,D6)}function A00($){return uS($,DH)}function B00($){return uS($,K5)}var uS=($,Y)=>$ instanceof Y||$?.name===Y.name;var P00=m(()=>{mO();RS();lO()});function Vn0($){let Y={...$,json:cQ($.json),context:cQ($.context),headers:cQ($.headers),searchParams:qn0($.searchParams)};if($.retry!==void 0)Y.retry=Zn0($.retry);return Y}class pQ{static create($,Y){let z=Y.hooks?.init??[],U=z.length>0?Vn0(Y):Y;for(let K of z)K(U);let Q=new pQ($,U),J=async()=>{if(typeof Q.#$.timeout==="number"&&Q.#$.timeout>nQ)throw RangeError(`The \`timeout\` option cannot be greater than ${nQ}`);if(typeof Q.#$.totalTimeout==="number"&&Q.#$.totalTimeout>nQ)throw RangeError(`The \`totalTimeout\` option cannot be greater than ${nQ}`);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(TH(G))try{G=await Q.#y(G)}catch(X){if(!(X instanceof iQ))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.#M(W),Q.#w()),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(!TH(G))return G;if(Q.#V(G),Q.#$.onDownloadProgress){if(typeof Q.#$.onDownloadProgress!=="function")throw TypeError("The `onDownloadProgress` option must be a function");if(!Y00)throw Error("Streams are not supported in your environment. `ReadableStream` is missing.");let W=G.clone();return Q.#K(G),H00(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.#w(),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(U00)){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 E00(void 0,H);return JSON.parse(X)}let Z=U.parseJson?await U.parseJson(X,{request:Q.#M(W),response:W}):JSON.parse(X);return H===void 0?Z:E00(Z,H)}}return I}static#U($){if($&&typeof $==="object"&&!Array.isArray($)&&!($ instanceof URLSearchParams))return Object.fromEntries(Object.entries($).filter(([,Y])=>Y!==void 0));return $}request;#z;#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(Wn0);if(this.#$={...Y,headers:yS(this.#Y.headers,Y.headers),hooks:eO({},Y.hooks),method:q00(Y.method??this.#Y.method??"GET"),prefix:String(Y.prefix||""),retry:V00(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 U=this.#$.prefix.replace(/\/+$/,""),Q=this.#Y.replace(/^\/+/,"");this.#Y=`${U}/${Q}`}if(this.#$.baseUrl){let U;try{U=new URL(this.#Y)}catch{}if(!U)this.#Y=new URL(this.#Y,new Request(this.#$.baseUrl).url)}}if($00&&oO)this.#H=this.#$.signal??this.#Y.signal,this.#z=new globalThis.AbortController,this.#$.signal=this.#O();if(hS)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 z=Y.headers&&new globalThis.Headers(Y.headers).has("content-type");if(this.#Y instanceof globalThis.Request&&(z00&&this.#$.body instanceof globalThis.FormData||this.#$.body instanceof URLSearchParams)&&!z)this.#$.headers.delete("content-type");if(this.request=new globalThis.Request(this.#Y,this.#$),w00(this.#$.searchParams)){let U=new URL(this.request.url),Q=this.#$.searchParams?.[h7];if(Q)for(let J of Q)U.searchParams.delete(J);if(typeof this.#$.searchParams==="string"){let J=this.#$.searchParams.replace(/^\?/,"");if(J!=="")U.search=U.search?`${U.search}&${J}`:`?${J}`}else{let J=new URLSearchParams(pQ.#U(this.#$.searchParams));for(let[I,K]of J.entries())U.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)U.searchParams.delete(J)}this.request=new globalThis.Request(U,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 AH($);if(Y instanceof iQ)return Y.customDelay??this.#G();if(!this.#$.retry.methods.includes(this.request.method.toLowerCase()))throw $;if(this.#$.retry.shouldRetry!==void 0){let z=await this.#$.retry.shouldRetry({error:Y,retryCount:this.#Q+1});if(z===!1)throw $;if(z===!0)return this.#G()}if(B00($)){if(!this.#$.retry.retryOnTimeout)throw $;return this.#G()}if(D00($)){if(!this.#$.retry.statusCodes.includes($.response.status))throw $;let z=$.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(z&&this.#$.retry.afterStatusCodes.includes($.response.status)){let U=Number(z)*1000;if(Number.isNaN(U))U=Date.parse(z)-Date.now();else if(U>=Date.parse("2024-01-01"))U-=Date.now();if(!Number.isFinite(U))return Math.min(this.#$.retry.maxRetryAfter,this.#G());return U=Math.max(0,U),Math.min(this.#$.retry.maxRetryAfter,U)}if($.response.status===413)throw $;return this.#G()}if(!A00($))throw $;return this.#G()}#V($){let Y=this.#M($);if(this.#$.parseJson)$.json=async()=>{let z=await $.text();if(z==="")return JSON.parse(z);return this.#$.parseJson(z,{request:Y,response:$})};return $}async#L($){let Y=await this.#j($,this.#D());if(Y===jH){this.#q();return}if(!Y)return;if(!this.#A($.headers.get("content-type")??""))return Y;let z=await this.#T(Y,$,this.#D(),this.#M($));if(z===jH){this.#q();return}return z}#D(){let $=this.#$.timeout===!1?1e4:this.#$.timeout,Y=this.#B();if(Y===void 0)return $;if(Y<=0)throw new K5(this.request);return Math.min($,Y)}#A($){let Y=($.split(";",1)[0]??"").trim().toLowerCase();return/\/(?:.*[.+-])?json$/.test(Y)}async#j($,Y){let{body:z}=$;if(!z)try{return await $.text()}catch{return}let U;try{U=z.getReader()}catch{return}let Q=Xn0($.headers.get("content-type")??""),J=[],I=0,K=(async()=>{try{for(;;){let{done:W,value:X}=await U.read();if(W)break;if(I+=X.byteLength,I>Hn0){U.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(jH)},Y);K.finally(()=>{clearTimeout(X)})}),H=await Promise.race([K,G]);if(H===jH)U.cancel().catch(()=>{return});return H}async#T($,Y,z,U){let Q;try{return await Promise.race([Promise.resolve().then(()=>this.#$.parseJson?this.#$.parseJson($,{request:U,response:Y}):JSON.parse($)),new Promise((J)=>{Q=setTimeout(()=>{J(jH)},z)})])}catch{return}finally{clearTimeout(Q)}}#F($){if(!$)return;$.cancel().catch(()=>{return})}#K($){this.#F($.body??void 0)}#O(){return this.#H?AbortSignal.any([this.#H,this.#z.signal]):this.#z.signal}#q(){let $=this.#B();if($!==void 0&&$<=0)throw new K5(this.request)}async#g(){for(let $ of this.#$.hooks.beforeRequest){let Y=await $({request:this.request,options:this.#w(),retryCount:0});if(T00(Y))this.#_(Y);else if(TH(Y))return Y}return}async#y($){let Y=this.#M($);for(let z of this.#$.hooks.afterResponse){let U=this.#v($.clone(),Y);this.#V(U);let Q;try{Q=await z({request:this.request,options:this.#w(),response:U,retryCount:this.#Q})}catch(I){if(U!==$)this.#K(U);throw this.#K($),I}if(Q instanceof aO){if(U!==$)this.#K(U);throw this.#K($),new iQ(Q.options)}let J=TH(Q)?this.#v(Q,Y):$;if(U!==$&&U!==J&&U.body!==J.body)this.#K(U);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 z=Math.min(await this.#P($),nQ),U={signal:this.#H},Q=this.#B();if(Q!==void 0){if(Q<=0)throw new K5(this.request);if(z>=Q)throw await Yw(Q,U),new K5(this.request)}if(await Yw(z,U),this.#q(),$ instanceof iQ&&$.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.#w(),error:$,retryCount:this.#Q+1})}catch(K){if(K instanceof Error&&K!==$)this.#X.add(K);throw K}if(T00(I)){this.#_(I);break}if(TH(I))return this.#Z=!0,this.#Q++,I;if(I===sO)return}return this.#q(),this.#Q++,this.#h(Y)}#C(){let $=this.#Z;return this.#Z=!1,$}async#R(){if(this.#z?.signal.aborted)this.#z=new globalThis.AbortController,this.#$.signal=this.#O(),this.request=new globalThis.Request(this.request,{signal:this.#$.signal});let $=O00(this.#$),Y=this.#$.retry.limit>0?this.request.clone():void 0,z=this.#k(this.request,this.#$.body??void 0);if(this.#W=z,Y)this.request=Y;try{let U=this.#B();if(U!==void 0&&U<=0)throw new K5(this.request);let Q=this.#$.timeout===!1?U:U===void 0?this.#$.timeout:Math.min(this.#$.timeout,U),J=Q===void 0?await this.#$.fetch(z,$):await xS(z,$,this.#z,{timeout:Q,fetch:this.#$.fetch});return this.#v(J,z)}catch(U){if(fS(U))throw new DH(this.request,{cause:U});throw U}}#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()}#w(){if(!this.#J){let{hooks:$,json:Y,parseJson:z,stringifyJson:U,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=$}#M($){return this.#N.get($)??this.request}#v($,Y){return this.#N.set($,Y),$}#k($,Y){if(!this.#$.onUploadProgress||!$.body||!hS)return $;return W00($,this.#$.onUploadProgress,Y??this.#$.body??void 0)}}var Hn0=10485760,Wn0="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",jH,Xn0=($)=>{let Y=/;\s*charset\s*=\s*(?:"([^"]+)"|([^;,\s]+))/i.exec($),z=Y?.[1]??Y?.[2];if(z)try{return new TextDecoder(z)}catch{}return new TextDecoder},j00="The `schema` argument must follow the Standard Schema specification",Zn0=($)=>{if(typeof $!=="object")return $;return{...$,...$.methods&&{methods:[...$.methods]},...$.statusCodes&&{statusCodes:[...$.statusCodes]},...$.afterStatusCodes&&{afterStatusCodes:[...$.afterStatusCodes]}}},C00,T00=($)=>$ instanceof globalThis.Request||C00.call($)==="[object Request]",TH=($)=>$ instanceof globalThis.Response||C00.call($)==="[object Response]",qn0=($)=>{if(Array.isArray($))return $.map((Y)=>[...Y]);return cQ($)},E00=async($,Y)=>{if(typeof Y!=="object"&&typeof Y!=="function"||Y===null)throw TypeError(j00);let z=Y["~standard"];if(typeof z!=="object"||z===null||typeof z.validate!=="function")throw TypeError(j00);let U=await z.validate($);if(U.issues)throw new vS(U.issues);return U.value};var R00=m(()=>{mO();RS();_S();te();ee();lO();X00();$w();L00();F00();M00();N00();P00();pY();jH=Symbol("timedOutResponseData"),C00=Object.prototype.toString});var bS=($)=>{let Y=(z,U)=>pQ.create(z,PH($,U));for(let z of rO)Y[z]=(U,Q)=>pQ.create(U,PH($,Q,{method:z}));return Y.create=(z)=>bS(PH(z)),Y.extend=(z)=>{if(typeof z==="function")z=z($??{});return bS(PH($,z))},Y.stop=sO,Y.retry=J00,Y},Ln0,G5;var dQ=m(()=>{R00();pY();$w();mO();/*! MIT License © Sindre Sorhus */Ln0=bS(),G5=Ln0});async function _00($){if($.source.type!=="direct"&&$.source.type!=="seal")throw Error(`Unsupported Seal source: ${$.source.type}`);let Y=$.seal.url??$.source.sealUrl,z=$.source.type==="seal"?$.source:void 0;return{token:$.source.token,expiresAt:Date.now()+$.source.expiresIn*1000,enterprise:{provider:z?"seal":"direct",corpId:$.source.corpId??$.id,staffId:$.source.staffId,sealUrl:Y,tenantId:z?.tenantId,tenantSlug:$.seal.tenantSlug??z?.tenantSlug,tenantName:z?.tenantName,raw:{sourceType:$.source.type}}}}function Fn0($){let Y=Object.entries($??{}).map(([z,U])=>`${z}=${U}`);return Y.length?Y.join("; "):void 0}function A6($){let Y={...$?.headers??{}},z=Fn0($?.cookies);if(z)Y.Cookie=z;return Y}var v00,On0,wn0,Mn0,Nn0,h00;var S00=m(()=>{P$();v00=L.object({token:L.string(),expiresAt:L.number(),url:L.string().url().optional()}),On0=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()}),wn0=L.object({token:L.string(),expiresAt:L.number(),enterprise:On0}),Mn0=L.object({openapi:v00.optional(),closeapi:v00.optional()}),Nn0=L.object({seal:wn0.optional(),hose:Mn0.optional()}),h00=L.record(L.string(),Nn0)});import{existsSync as iS,mkdirSync as Dn0,readFileSync as An0,writeFileSync as Bn0}from"node:fs";import{dirname as Pn0,join as y00}from"node:path";import{homedir as k00}from"node:os";function jn0(){let $=(process.env.SEAL_USE_TOKEN_STORE??process.env.SEAL_HOME_TOKEN_STORE)?.trim();if($)return $;if(iS(zw))return zw;if(iS(g00))return g00;return zw}function Tn0(){let $=(process.env.SEAL_USE_TOKEN_STORE??process.env.SEAL_HOME_TOKEN_STORE)?.trim();if($)return $;return zw}function mQ(){let $=jn0();if(!iS($))return{};try{return h00.parse(JSON.parse(An0($,"utf-8")))}catch{return{}}}function Uw($){let Y=Tn0();Dn0(Pn0(Y),{recursive:!0,mode:448}),Bn0(Y,JSON.stringify($,null,2),{mode:384})}function x00($){return mQ()[$]?.seal}function f00($,Y){let z=mQ();Uw({...z,[$]:{...z[$],seal:Y}})}function u00($){let Y=mQ(),z=Y[$];if(!z)return;Uw({...Y,[$]:{...z,seal:void 0}})}function EH($){return mQ()[$]?.hose??{}}function nS($,Y){let z=mQ();Uw({...z,[$]:{...z[$],hose:Y}})}function Qw($){let Y=mQ();delete Y[$],Uw(Y)}var zw,g00;var CH=m(()=>{S00();zw=y00(k00(),".config","seal-use","seal_tokens.json"),g00=y00(k00(),".config","seal-home","seal_tokens.json")});function j$($){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||!_n0(Y.hostname)||Y.pathname.replace(/\/+$/,"")!==Rn0)throw Error("Invalid Hose assistance link: expected an HTTPS */web/thirdparty.html URL from ekuaibao.com or hosecloud.com");let z=Y.searchParams.getAll("accessToken").filter(Boolean),U=Y.searchParams.getAll("ekbCorpId").filter(Boolean);if(z.length!==1||U.length!==1)throw Error("Invalid Hose assistance link: accessToken and ekbCorpId are required exactly once");let Q=U[0].trim().toLowerCase();if(!i00.test(Q))throw Error("Invalid Hose assistance link: ekbCorpId is not a valid tenant slug");return{corpId:Q,accessToken:z[0],baseUrl:Y.origin}}async function Jw($,Y){let z=typeof $==="string"?n00($):c00($),U=`https://${z.corpId}.sealai.cc`,J=await y6(U,void 0,Y?.customHeaders).get("api/auth/oauth2/session/oem-hosecloud",{searchParams:{token:z.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:z.corpId,sealUrl:U,token:I,expiresIn:Number.isFinite(K)&&K>0?K:3600}}function Iw($,Y){let z=Y.hoseCorpConfig&&typeof Y.hoseCorpConfig==="object"?Y.hoseCorpConfig:void 0,U=[Y.tenantSlug,z?.corporationId].filter((I)=>typeof I==="string"&&Boolean(I)),Q=$.trim().toLowerCase(),J=U.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 _n0($){let Y=$.toLowerCase();return Cn0.some((z)=>Y.endsWith(z))}function c00($){let Y=typeof $?.corpId==="string"?$.corpId.trim().toLowerCase():"",z=typeof $?.accessToken==="string"?$.accessToken.trim():"",U=typeof $?.baseUrl==="string"&&$.baseUrl.trim()?$.baseUrl.trim():void 0;if(!i00.test(Y)||!z)throw Error("Invalid Hose assistance link: accessToken and ekbCorpId are required");return{corpId:Y,accessToken:z,...U?{baseUrl:U}:{}}}function p00($,Y=60){return Boolean($&&Date.now()<$.expiresAt-Y*1000)}function S7($,Y){if($.seal.url)return $.seal.url;if(Y.sealUrl)return Y.sealUrl;return`https://${Y.corpId.toLowerCase()}.sealai.cc`}function vn0($){return $.staffId.includes(":")?$.staffId:`${$.corpId}:${$.staffId}`}function d00($){return G5.create({prefix:j$($.domain),timeout:30000,hooks:{beforeError:[async({error:Y})=>{let z=Y instanceof D6?await Y.response.text().catch(()=>""):"";return Y.message=`${Y.message}${z?`: ${z}`:""}`,Y}]}})}async function hn0($){let Y=d00($),z=$.appKey??$.key,U=$.appSecurity??$.password;if(!z||!U)throw Error("Hose source requires appKey/key and appSecurity/password");let Q=await Y.post("api/openapi/v1/auth/getAccessToken",{json:{appKey:z,appSecurity:U}}).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 lQ($){if($.source.type!=="hose")throw Error(`Unsupported Seal source: ${$.source.type}`);let Y=EH($.id);if(p00(Y.openapi))return Y.openapi.token;let z=cS.get($.id);if(z)return z;let U=hn0($.source).then((Q)=>{return nS($.id,{...EH($.id),openapi:Q}),Q.token}).finally(()=>cS.delete($.id));return cS.set($.id,U),U}async function Kw($,Y,z=7200){let U=d00($),Q=vn0($),I=(await U.post("api/openapi/v1.1/provisional/getProvisionalAuth",{searchParams:{accessToken:Y},json:{uid:Q,pageType:"home",expireDate:z}}).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()+z*1000}}async function Gw($){if($.source.type!=="hose")throw Error(`Unsupported Seal source: ${$.source.type}`);let Y=$.source,z=EH($.id);if(p00(z.closeapi)&&z.closeapi.url)return z.closeapi;let U=pS.get($.id);if(U)return U;let Q=lQ($).then((J)=>Kw(Y,J)).then((J)=>{return nS($.id,{...EH($.id),closeapi:J}),J}).finally(()=>pS.delete($.id));return pS.set($.id,Q),Q}async function m00($,Y=7200,z){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 U=await lQ($),Q=await Kw($.source,U,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 l00($){if($.source.type!=="hose")throw Error(`Unsupported Seal source: ${$.source.type}`);let Y=await Gw($),z=S7($,$.source),U=A6($.seal),J=await y6(z,void 0,U).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:j$(z),tenantSlug:$.seal.tenantSlug,raw:{sourceType:"hose",hoseDomain:j$($.source.domain)}};return{token:I,expiresAt:Date.now()+K*1000,enterprise:G}}async function oQ($,Y,z){if(z){let I=j$(z),K=await b00(I,$,Y);if(!K)throw Error(`Failed to authenticate on specified domain: ${I}. Please verify appKey/appSecurity and domain connectivity.`);return K}let U=En0.map(async(I)=>{try{return await b00(I,$,Y)}catch{return}}),J=(await Promise.all(U)).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 b00($,Y,z){try{let U=await fetch(`${$}/api/openapi/v1/auth/getAccessToken`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({appKey:Y,appSecurity:z}),signal:AbortSignal.timeout(8000)});if(!U.ok)return;let Q=await U.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 Hw($,Y){let z=`${j$($)}/api/openapi/v1/roleDefGroups?accessToken=${encodeURIComponent(Y)}`,U=await fetch(z,{headers:{"content-type":"application/json",Accept:"application/json"},signal:AbortSignal.timeout(1e4)});if(!U.ok){let I=await U.text().catch(()=>"");throw Error(`Failed to fetch Hose role definition groups: ${U.status} ${I}`)}return((await U.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 dS($,Y,z,U="id"){let Q=z.startsWith("$")?z.slice(1):z,J=`${j$($)}/api/openapi/v1/roledefs/$${Q}?accessToken=${encodeURIComponent(Y)}&staffBy=${encodeURIComponent(U)}&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 mS($,Y,z){if(z.length===0)return[];let U=`${j$($)}/api/openapi/v1/staffs/getStaffIds?accessToken=${encodeURIComponent(Y)}`,Q=await fetch(U,{method:"POST",headers:{"content-type":"application/json",Accept:"application/json"},body:JSON.stringify({type:"STAFFID",conditionIds:z.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 Ww($){if(!$)return"-";if($.length<=12)return"******";return`${$.slice(0,8)}...${$.slice(-4)}`}async function Sn0($){let Y=typeof $==="string"?n00($):c00($),z=Y.baseUrl||"https://app.ekuaibao.com",U,Q,J,I,K,G={accesstoken:Y.accessToken,corpid:Y.corpId};try{let H=await G5.get(`${z}/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")U=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(!U||!Q)try{let W=(await G5.get(`${z}/api/account/v2/session`,{headers:{...G,...U?{staffid:U}:{}},timeout:1e4}).json())?.value;if(W){if(!U&&W.loginStaffId)U=W.loginStaffId;if(!Q&&W.corporationName)Q=W.corporationName;if(!J&&W.privilege)J=W.privilege}}catch{}if(!U)U=`${Y.corpId}:admin`;return{corpId:Y.corpId,baseUrl:z,accessToken:Y.accessToken,staffId:U,corpName:Q,staffName:J,isAdmin:I,cellphone:K}}async function lS($){let Y=await Sn0($),z={accesstoken:Y.accessToken,corpid:Y.corpId,staffid:Y.staffId},U;try{U=await(await G5.get(`${Y.baseUrl}/api/innerapi/v1/key`,{searchParams:{corpId:Y.corpId},headers:z,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=U.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 En0,Cn0,Rn0="/web/thirdparty.html",i00,cS,pS;var g7=m(()=>{dQ();i8();CH();En0=["https://app.ekuaibao.com","https://dd2.hosecloud.com","https://wx2.ekuaibao.com","https://kdcloud2.ekuaibao.com","https://ddenterprise.ekuaibao.com","https://feishu.ekuaibao.com"],Cn0=[".ekuaibao.com",".hosecloud.com"],i00=/^[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?$/,cS=new Map,pS=new Map});function o00($,Y){return Date.now()>=$.expiresAt-Y*1000}async function gn0($){switch($.source.type){case"hose":return l00($);case"direct":case"seal":return _00($)}}async function Zw($){let Y=$.auth.refreshTtl,z=Xw.get($.id);if(z&&!o00(z,Y))return z;let U=x00($.id);if(U&&!o00(U,Y))return Xw.set($.id,U),U;let Q=await gn0($);return Xw.set($.id,Q),f00($.id,Q),Q}async function r00($){return(await Zw($)).enterprise}function s00($){Xw.delete($),u00($)}var Xw;var oS=m(()=>{g7();CH();Xw=new Map});var t00={};D8(t00,{createSealClientForUrl:()=>y6,createSealClientForToken:()=>rS,createSealClient:()=>P1});function yn0($){if($===void 0||$===null||$==="")return"";if(typeof $==="string")return $;try{return JSON.stringify($)}catch{return String($)}}function kn0($){if(!($ instanceof D6))return $;let Y=yn0($.data);if(Y)$.message=`${$.message}: ${Y}`;return $}function a00($){return async({error:Y})=>{if($&&Y instanceof D6&&Y.response.status===401)s00($);return kn0(Y)}}async function P1($){let Y=await Zw($);return G5.create({prefix:Y.enterprise.sealUrl,timeout:30000,headers:{...A6($.seal),Authorization:`Bearer ${Y.token}`},hooks:{beforeError:[a00($.id)]}})}async function rS($,Y){let z=await Zw($);return y6(z.enterprise.sealUrl,Y,A6($.seal))}function y6($,Y,z={}){let U={...z};if(Y)U.Authorization=`Bearer ${Y}`;return G5.create({prefix:$.replace(/\/+$/,""),timeout:30000,headers:U,hooks:{beforeError:[a00()]}})}var i8=m(()=>{dQ();oS()});var RH;var e00=m(()=>{RH={name:"seal-use",version:"0.10.37",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"},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",release:"bun run scripts/release.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 $10}from"node:child_process";function fn0($,Y=RH.version){let z=$.trim();if(!z)return null;let U=z.endsWith("-dirty"),Q=U?z.slice(0,-6):z,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:U,describe:z};let I=Q.match(/^v?(\d+\.\d+\.\d+(?:-[a-zA-Z0-9.]+)?)$/);if(I&&I[1])return{baseVersion:I[1],commitsAhead:0,commit:"",dirty:U,describe:z};let K=Q.match(/^([0-9a-f]{7,40})$/);if(K&&K[1])return{baseVersion:Y,commitsAhead:0,commit:K[1],dirty:U,describe:z};return null}function un0($,Y,z,U){let J=z?`+g${z}${U?".dirty":""}`:U?"+dirty":"";return`${$}-dev.${Y}${J}`}function bn0($){let Y=$?.env,z=Y?.SEAL_BUILD_VERSION??process.env.SEAL_BUILD_VERSION,U=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(z){let Z=U==="true",V={name:"seal-use",version:z,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||z};return V}if(U==="true"||W==="1")return{name:"seal-use",version:RH.version,channel:"release",isRelease:!0};try{let Z=$10("git",["describe","--tags","--long","--dirty","--always"],{cwd:X,encoding:"utf8",stdio:["ignore","pipe","ignore"]});if(Z.status===0&&Z.stdout){let q=fn0(Z.stdout.trim(),RH.version);if(q){if(!q.commit){let F=$10("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:un0(q.baseVersion,q.commitsAhead,q.commit,q.dirty),channel:"dev",isRelease:!1,git:q}}}}catch{}return{name:"seal-use",version:`${RH.version}-dev.0+local`,channel:"dev",isRelease:!1}}var dY,Z1,sS,Ec1;var $3=m(()=>{e00();dY=bn0(),Z1=dY.version,sS=dY.isRelease,Ec1=dY.channel});function rQ($=void 0){return tS.parse($??{})}function U10($,Y){return rQ({...rQ($),...Y})}var Y10,aS,z10,tS,eS;var sQ=m(()=>{P$();Y10=[".pdf",".xls",".xlsx",".csv",".doc",".docx",".ppt",".pptx",".txt",".rtf",".odt",".ods",".odp",".jpg",".jpeg",".png",".gif",".bmp",".webp",".heic",".eml",".msg"],aS={minFileSizeBytes:500,allowedExtensions:[...Y10]},z10=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"}),tS=L.object({minFileSizeBytes:L.number().int().min(0).default(aS.minFileSizeBytes),maxFileSizeBytes:L.number().int().positive().nullable().optional(),allowedExtensions:L.array(z10).min(1).default([...Y10]).transform(($)=>[...new Set($)])}).superRefine(($,Y)=>{if($.maxFileSizeBytes!==void 0&&$.maxFileSizeBytes!==null&&$.maxFileSizeBytes<$.minFileSizeBytes)Y.addIssue({code:"custom",path:["maxFileSizeBytes"],message:"最大文件大小不能小于最小文件大小"})}),eS=L.object({minFileSizeBytes:L.number().int().min(0).optional(),maxFileSizeBytes:L.number().int().positive().nullable().optional(),allowedExtensions:L.array(z10).min(1).transform(($)=>[...new Set($)])}).optional()});var in0,nn0,cn0,pn0,J10,dn0,mn0,I10,qw,K10,ln0,Vw,G10,vH,H10,on0,rn0,sn0,Q10,hH,W10,an0,tn0,Lw,$g,X10,Z10,q10,V10,Fw,L10,Yg,zg,F10,O10,en0,w10,$c0,M10,_H,N10,D10,A10,B10,P10,j10,T10,E10,C10,R10,_10,Yc0,v10,zc0,Uc0,Qc0,Ug,Qg,Jc0,h10,S10,g10,y10,Ic0,Jg,Sc1,gc1,k10,yc1;var Ig=m(()=>{P$();sQ();in0=L.object({staffId:L.string(),name:L.string().optional(),code:L.string().default(""),bindTime:L.number().optional()}),nn0=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:in0.optional()}),cn0=L.object({apiKey:L.string().optional(),corporationId:L.string().optional(),corporationName:L.string().optional()}),pn0=L.object({id:L.string(),name:L.string(),tenantSlug:L.string().optional(),isDemo:L.boolean().default(!1),logoUrl:L.string().nullable().optional(),hoseCorpConfig:cn0.optional()}),J10=L.object({user:nn0,tenant:pn0}),dn0=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(),mn0=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(),I10=L.object({user:dn0,session:mn0}),qw=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()}),K10=L.object({rules:L.array(qw),hasPendingDeletes:L.boolean().default(!1)}),ln0=L.object({id:L.union([L.string(),L.number()]).optional(),ruleId:L.union([L.string(),L.number()]).optional(),stableId:L.union([L.string(),L.number()]).optional(),runtimeRuleId:L.union([L.string(),L.number()]).optional(),runtimeId:L.union([L.string(),L.number()]).optional(),code:L.union([L.string(),L.number()]).optional(),description:L.string(),scope:L.string(),strictness:L.string()}).passthrough(),Vw=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(ln0).default([]),publishedAt:L.number().optional(),createdAt:L.number().optional()}).passthrough(),G10=L.object({version:Vw,rulesCount:L.number()}),vH=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)}),H10=L.object({articles:L.array(vH),total:L.number().optional()}),on0=L.object({explicitApprove:L.string().default(""),explicitReject:L.string().default(""),exemptApprove:L.string().default(""),review:L.string().default("")}).passthrough(),rn0=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(),sn0=L.enum(["assisted","semi_automatic","fully_automatic"]),Q10=L.object({id:L.string(),url:L.string().url()}).passthrough(),hH=L.object({type:L.literal("webhook"),id:L.string(),name:L.string(),mode:sn0,incomingDocumentWebhook:Q10,outgoingResultWebhook:L.string().url(),incomingManualResultWebhook:Q10,secret:L.string().min(1),autoApprovalRate:L.number().int().min(0).max(100).optional(),materialPackFilePolicy:tS.default(aS)}).passthrough(),W10=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:on0.optional(),integrationSystem:L.string().optional(),integrations:L.array(rn0).default([])}).passthrough(),an0=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(),tn0=L.object({_langfuseTraceId:L.string().optional(),simulation_batch_id:L.string().optional()}).passthrough(),Lw=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:an0.optional(),result:L.unknown().optional(),pipelineData:L.unknown().optional(),sourceExtendData:tn0.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(),$g=L.object({records:L.array(Lw).default([]),total:L.number().optional(),page:L.number().optional(),pageSize:L.number().optional()}).passthrough(),X10=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(),Z10=L.object({id:L.string(),token:L.string(),link:L.string()}).passthrough(),q10=L.object({userId:L.string(),password:L.string()}).passthrough(),V10=L.object({password:L.string()}).passthrough(),Fw=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(),L10=L.object({departments:L.array(L.record(L.string(),L.unknown())).default([]),users:L.array(Fw).default([])}).passthrough(),Yg=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(),zg=L.object({items:L.array(Yg).default([])}).passthrough(),F10=L.object({items:L.array(Fw).default([])}).passthrough(),O10=L.object({lastSyncTime:L.union([L.string(),L.number(),L.null()])}).passthrough(),en0=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(),w10=L.object({tagStats:L.array(en0).default([]),totalRisks:L.number().default(0),analyzedRisks:L.number().default(0),pendingRisks:L.number().default(0)}).passthrough(),$c0=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(),M10=L.object({tagId:L.string(),tagName:L.string().default(""),tagPath:L.string().default(""),tagDescription:L.string().default(""),risks:L.array($c0).default([]),total:L.number().default(0)}).passthrough(),_H=L.object({value:L.number().default(0),trend:L.number().default(0)}).passthrough(),N10=L.object({metrics:L.object({approvalCount:_H.optional(),accuracy:_H.optional(),automationRate:_H.optional(),riskCount:_H.optional(),avgDuration:_H.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(),D10=L.record(L.string(),L.unknown()),A10=L.object({expenses:L.array(D10).default([]),total:L.number().optional()}).passthrough(),B10=L.object({invoices:L.array(D10).default([]),total:L.number().optional(),feishuApprovalAppId:L.string().nullable().optional()}).passthrough(),P10=L.record(L.string(),L.unknown()),j10=L.object({provider:L.string(),config:L.record(L.string(),L.unknown()).default({})}).passthrough(),T10=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(),E10=L.object({permissions:L.array(L.object({key:L.string(),name:L.string(),description:L.string().optional()}).passthrough()).default([])}).passthrough(),C10=L.object({configs:L.array(L.record(L.string(),L.unknown())).default([])}).passthrough(),R10=L.object({subscriptions:L.array(L.record(L.string(),L.unknown())).default([]),features:L.array(L.record(L.string(),L.unknown())).default([])}).passthrough(),_10=L.object({key:L.string(),type:L.string(),label:L.string(),column:L.string(),mask:L.string().optional()}).passthrough(),Yc0=L.object({columns:L.array(_10).default([]),fieldKey:L.string().optional(),keyColumn:L.string().optional(),sheetName:L.string().optional(),fieldLabel:L.string().optional()}).passthrough(),v10=L.object({id:L.string().optional(),listSheets:L.array(Yc0).default([]),mainColumns:L.array(_10).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(),zc0=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:v10.optional()}).passthrough(),Uc0=L.object({mode:L.string().optional(),conditions:L.array(L.object({label:L.string(),value:L.string()}).passthrough()).default([])}).passthrough(),Qc0=L.object({kind:L.string().optional(),stage:L.string().optional(),code:L.string().optional(),message:L.string().optional()}).passthrough(),Ug=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:zc0.optional(),requestSummary:Uc0.nullable().optional(),resultSummary:Qc0.nullable().optional(),createdAt:L.union([L.string(),L.number()]).optional(),updatedAt:L.union([L.string(),L.number()]).optional()}).passthrough(),Qg=L.object({batchId:L.string()}).passthrough(),Jc0=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(),h10=L.object({id:L.string(),tenantId:L.string().optional(),name:L.string().optional(),description:L.string().optional(),approvalSystem:L.string().optional(),hosecloudConfig:Jc0.optional(),createdAt:L.union([L.string(),L.number()]).optional(),updatedAt:L.union([L.string(),L.number()]).optional()}).passthrough(),S10=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(),g10=L.object({signKey:L.string().optional(),displayName:L.string().optional(),corporationId:L.string().optional()}).passthrough(),y10=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:v10.nullable().optional(),createdAt:L.union([L.string(),L.number()]).optional(),updatedAt:L.union([L.string(),L.number()]).optional()}).passthrough(),Ic0=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(),Jg=L.object({id:L.string().min(1),name:L.string().min(1),enabled:L.boolean().default(!0),description:L.string().default(""),condition:Ic0.default({hitScopes:[],hitRuleIds:[],notHitScopes:[],notHitRuleIds:[]}),level:L.enum(["medium","high"])}).passthrough(),Sc1=L.object({defaultLevel:L.enum(["medium","high"]).default("medium"),routingPolicies:L.array(Jg).default([])}).passthrough(),gc1=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(),k10=L.object({id:L.string().optional(),code:L.string().optional(),name:L.string().optional(),approvalSystem:L.string().optional()}).passthrough(),yc1=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 u10}from"node:crypto";async function N1($,Y){let z=await $.json();return Y.parse(z.data??z)}async function T8($){return N1(await $.get("api/v1/auth/me"),J10)}async function i10($){return N1(await $.get("api/auth/get-session"),I10)}async function X6($){return N1(await $.get("api/v1/rules"),K10)}async function gH($,Y){return N1(await $.post("api/v1/rules",{json:Y}),qw)}async function Kg($,Y,z){return N1(await $.put(`api/v1/rules/${Y}`,{json:z}),qw)}async function tQ($,Y){await $.delete(`api/v1/rules/${Y}`)}async function Nw($){let Y=await $.post("api/v1/rules/batch-recode",{throwHttpErrors:!1}),z=await Y.json().catch(()=>({}));return L.object({ok:L.boolean(),status:L.number(),body:L.unknown()}).parse({ok:Y.ok,status:Y.status,body:z})}async function c8($){return N1(await $.get("api/v1/rule-set-versions"),L.array(Vw))}async function y7($,Y){return N1(await $.get(`api/v1/rule-set-versions/${Y}`),Vw)}async function yH($,Y){return N1(await $.post("api/v1/rule-set-versions/publish",{json:{versionName:Y}}),G10)}async function mY($,Y={}){let z=new URLSearchParams;return z.set("offset",String(Y.offset??0)),z.set("limit",String(Y.limit??20)),z.set("sortBy",Y.sortBy??"createdAt"),z.set("sortOrder",Y.sortOrder??"desc"),Y.scenarios?.forEach((U,Q)=>{z.set(`filter[scenarios][${Q}]`,U)}),N1(await $.get("api/v1/knowledge/articles",{searchParams:z}),H10)}async function n10($,Y){return N1(await $.get(`api/v1/knowledge/articles/${Y}`),vH)}async function Dw($,Y){return N1(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??[]}}),vH)}async function Aw($,Y,z){let U=Object.fromEntries(Object.entries(z).filter(([,Q])=>Q!==void 0));return N1(await $.patch(`api/v1/knowledge/articles/${Y}`,{json:{attributes:U}}),vH)}async function Bw($,Y){return await $.delete(`api/v1/knowledge/articles/${Y}`),{success:!0,id:Y}}async function o1($,Y="api/v1/agent/ai-approval/config"){return N1(await $.get(Y),W10)}async function s5($,Y,z="api/v1/agent/ai-approval/config"){return await $.post(z,{json:Y}),o1($,z)}async function Gg($,Y,z="api/v1/agent/ai-approval/config"){let U=await $.post(z,{json:Y}),Q=await U.json().catch(()=>({})),J=Mw.safeParse(Q.data??Q);return J.success?J.data.success??U.ok:U.ok}async function I$($,Y="api/v1/agent/ai-approval/config"){let z=await o1($,Y);return Hg(z.integrations)}async function Pw($,Y,z,U="api/v1/agent/ai-approval/config"){let Q=await o1($,U),J=Hg(Q.integrations),I=r10(Y,J,z);if(!await Gg($,{...Q,integrations:[...Q.integrations,I]},U))throw Error("Seal did not confirm saving the Webhook integration");return I}async function c10($,Y,z,U="api/v1/agent/ai-approval/config"){let Q=await o1($,U),J=Hg(Q.integrations),I=r10(Y,J,z);return{before:Q,after:{...Q,integrations:[...Q.integrations,I]},integration:I}}async function p10($,Y,z,U="api/v1/agent/ai-approval/config"){let Q=await o1($,U),J=jw(Q.integrations),I=Tw(J,Y),K=s10(I.integration,z);if(!await Gg($,{...Q,integrations:Q.integrations.map((H,W)=>W===I.index?K:H)},U))throw Error("Seal did not confirm saving the Webhook integration");return K}async function d10($,Y,z,U="api/v1/agent/ai-approval/config"){let Q=await o1($,U),J=jw(Q.integrations),I=Tw(J,Y),K=s10(I.integration,z);return{before:Q,after:{...Q,integrations:Q.integrations.map((G,H)=>H===I.index?K:G)},integration:K}}async function m10($,Y,z="api/v1/agent/ai-approval/config"){let U=await o1($,z),Q=jw(U.integrations),J=Tw(Q,Y);if(!await Gg($,{...U,integrations:U.integrations.filter((K,G)=>G!==J.index)},z))throw Error("Seal did not confirm deleting the Webhook integration");return J.integration}async function l10($,Y,z="api/v1/agent/ai-approval/config"){let U=await o1($,z),Q=jw(U.integrations),J=Tw(Q,Y);return{before:U,after:{...U,integrations:U.integrations.filter((I,K)=>K!==J.index)},integration:J.integration}}function k7($,Y){let z=Y.trim();if(!z)throw Error("Webhook selector must not be empty");let U=$.find((J)=>J.id===z);if(U)return U;let Q=$.filter((J)=>J.name===z);if(Q.length===1)return Q[0];if(Q.length>1)throw Error(`Multiple Webhook integrations match name: ${z}. Use the integration ID.`);throw Error(`Webhook integration not found: ${z}`)}function o10($,Y){let z=Y?.trim().toLowerCase();if(!z)return $;return $.filter((U)=>[U.id,U.name,U.mode,U.outgoingResultWebhook,U.incomingDocumentWebhook.url,U.incomingManualResultWebhook.url].some((Q)=>Q.toLowerCase().includes(z)))}function Hg($){return $.filter((Y)=>Y.type==="webhook").map((Y)=>hH.parse(Y))}function jw($){return $.flatMap((Y,z)=>{if(Y.type!=="webhook")return[];return[{index:z,integration:hH.parse(Y)}]})}function Tw($,Y){let z=k7($.map((U)=>U.integration),Y);return $.find((U)=>U.integration.id===z.id)}function r10($,Y,z){let U=SH(z.name,"name"),Q=z.mode??"assisted",J=t10(z.outgoingResultWebhook,"outgoingResultWebhook"),I=e10(z.autoApprovalRate??60),K=Hc0(Y),G=`wh_${K}_${u10(8).toString("hex").slice(0,7)}`,H=j$($);return hH.parse({type:"webhook",id:`integration-${K}`,name:U,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:z.secret?SH(z.secret,"secret"):a10(),autoApprovalRate:I,materialPackFilePolicy:rQ(z.materialPackFilePolicy)})}function s10($,Y){return hH.parse({...$,...Y.name===void 0?{}:{name:SH(Y.name,"name")},...Y.mode===void 0?{}:{mode:Y.mode},...Y.outgoingResultWebhook===void 0?{}:{outgoingResultWebhook:t10(Y.outgoingResultWebhook,"outgoingResultWebhook")},...Y.autoApprovalRate===void 0?{}:{autoApprovalRate:e10(Y.autoApprovalRate)},...Y.rotateSecret||Y.secret!==void 0?{secret:Y.rotateSecret?a10():SH(Y.secret??"","secret")}:{},...Y.materialPackFilePolicy===void 0?{}:{materialPackFilePolicy:U10($.materialPackFilePolicy,Y.materialPackFilePolicy)}})}function Hc0($){let Y=new Set($.map((U)=>U.id)),z=Date.now();while(Y.has(`integration-${z}`))z+=1;return z}function a10(){return u10(16).toString("hex")}function SH($,Y){let z=$.trim();if(!z)throw Error(`Webhook ${Y} must not be empty`);return z}function t10($,Y){let z=SH($,Y);try{return new URL(z).toString()}catch{throw Error(`Webhook ${Y} must be a valid URL`)}}function e10($){if(!Number.isInteger($)||$<0||$>100)throw Error("Webhook autoApprovalRate must be an integer between 0 and 100");return $}async function Ew($,Y={}){let[z,U,Q]=await Promise.all([X6($),mY($,{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:z,documents:U,stylePreferences:Q}}async function i4($,Y={}){let z=new URLSearchParams;return z.set("offset",String(Y.offset??0)),z.set("limit",String(Y.limit??50)),n8(z,"fromTimestamp",Y.fromTimestamp),n8(z,"toTimestamp",Y.toTimestamp),n8(z,"startDate",Y.startDate),n8(z,"endDate",Y.endDate),x10(z,"status",Y.status),n8(z,"sourceSystem",Y.sourceSystem),n8(z,"taskMode",Y.taskMode),n8(z,"search",Y.search),n8(z,"sourceDocumentSN",Y.sourceDocumentSN),n8(z,"sourceDocumentId",Y.sourceDocumentId),x10(z,"manualApprovalStatus",Y.manualApprovalStatus),N1(await $.get("api/v1/approvals",{searchParams:z}),$g)}async function H4($,Y){return N1(await $.get(`api/v1/approvals/${Y}`),Lw)}async function Wg($,Y){let z=await $.get(`api/v1/simulation/batch/${Y}/records`).json(),U=z.data??z;if(Array.isArray(U))return L.array(Lw).parse(U);return $g.parse(U).records}async function $40($,Y){return N1(await $.post("api/v1/simulation/create-batch",{json:Y}),Qg)}async function Y40($,Y){return N1(await $.post("api/v1/simulation/create-material-pack-batch",{json:Y}),Qg)}async function z40($,Y={}){let z=await $.get("api/v1/simulation/batches",{searchParams:{limit:String(Y.limit??50)}}).json(),U=z.data??z;return L.array(Ug).parse(U)}async function Cw($,Y){return N1(await $.get(`api/v1/simulation/batch/${Y}`),Ug)}async function U40($){let Y=await $.get("api/v1/simulation/templates").json(),z=Y.data??Y;return L.array(h10).parse(z)}async function Xg($){return N1(await $.get("api/v1/simulation/integration-status"),S10)}async function Zg($){let Y=await $.get("api/v1/simulation/hosecloud-integrations").json(),z=Y.data??Y;return L.array(g10).parse(z)}async function Q40($,Y){let U=await(await $.delete(`api/v1/simulation/batch/${encodeURIComponent(Y)}/data`)).json().catch(()=>({}));return U.data??U}async function J40($,Y){let z=Y?"api/v1/simulation/hosecloud-specifications-by-sign-key":"api/v1/simulation/hosecloud-specifications",U=Y?new URLSearchParams({signKey:Y}):void 0,Q=await $.get(z,{searchParams:U}).json(),J=Q.data??Q;return L.array(k10).parse(J)}async function I40($,Y){let z=await $.post("api/hosecloud/corporation",{json:Y}).json(),U=z.data??z;return L.object({corporationId:L.string()}).parse(U)}async function K40($,Y){let U=await(await $.post("api/hosecloud/outbound-config/sync",{json:Y})).json().catch(()=>({}));return U.data??U}async function G40($,Y){let z=new FormData;return z.append("file",new Blob([new Uint8Array(Y.fileBuffer)]),Y.fileName),N1(await $.post("api/v1/material-packages/upload",{body:z}),y10)}function n8($,Y,z){if(z)$.set(Y,z)}function x10($,Y,z){if(!z)return;(Array.isArray(z)?z:[z]).map((Q)=>Q.trim()).filter(Boolean).forEach((Q,J)=>{$.set(`${Y}[${J}]`,Q)})}async function H40($){return N1(await $.get("api/v1/delegation/list"),L.array(X10))}async function aQ($,Y){return N1(await $.post("api/v1/delegation/create",{json:Y??{}}),Z10)}async function W40($,Y){let z=await $.post("api/v1/delegation/revoke",{json:{tokenId:Y}}),U=await z.json(),Q=Mw.safeParse(U.data??U);return Q.success?Q.data.success??z.ok:z.ok}async function X40($,Y){let z=Y.departmentIds&&Y.departmentIds.length>0?Y.departmentIds:void 0;if(!z){let U=await $.get("api/v1/contacts/departments/root/children").json(),Q=Kc0.safeParse(U.data??U),J=Q.success?Q.data.items?.[0]?._id:void 0;if(J)z=[J]}return N1(await $.post("api/v1/contacts/local/users",{json:{name:Y.name,phone:Y.phone,permissions:Y.permissions??[],departmentIds:z??[]}}),q10)}async function qg($,Y){return N1(await $.post(`api/v1/contacts/local/users/${Y}/reset-password`,{json:{}}),V10)}async function Ow($,Y){return N1(await $.get(`api/v1/contacts/users/${Y}`),Fw)}async function ww($,Y=""){return N1(await $.get("api/v1/contacts/search",{searchParams:{query:Y}}),L10)}async function Z40($){return N1(await $.get("api/v1/contacts/departments/root/children"),zg)}async function q40($,Y){return N1(await $.get(`api/v1/contacts/departments/${encodeURIComponent(Y)}`),Yg)}async function V40($,Y){return N1(await $.get(`api/v1/contacts/departments/${encodeURIComponent(Y)}/children`),zg)}async function L40($,Y){return N1(await $.get(`api/v1/contacts/departments/${encodeURIComponent(Y)}/users`),F10)}async function F40($){return N1(await $.get("api/v1/contacts/last-sync-time"),O10)}async function Rw($,Y={}){let z=Vg(),U=new URLSearchParams;if(n8(U,"startDate",Y.startDate??z.startDate),n8(U,"endDate",Y.endDate??z.endDate),Y.limit!==void 0)U.set("limit",String(Y.limit));return N1(await $.get("api/v1/insight/stats",{searchParams:U}),w10)}async function _w($,Y){let z=Vg(),U=new URLSearchParams;return U.set("tagId",Y.tagId),U.set("startDate",Y.startDate??z.startDate),U.set("endDate",Y.endDate??z.endDate),N1(await $.get("api/v1/insight/risks-by-tag",{searchParams:U}),M10)}async function vw($,Y={}){let z=Vg(),U=f10(Y.startDate??z.startDate),Q=f10(Y.endDate??z.endDate),J=new URLSearchParams;return J.set("startDate",String(U)),J.set("endDate",String(Q)),N1(await $.get("api/v1/insight/performance",{searchParams:J}),N10)}async function O40($,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 z=new Date($);if(isNaN(z.getTime()))throw Error(`Invalid date format: ${$}`);return z.getTime()}function Vg(){let $=new Date,Y=new Date($.getFullYear(),$.getMonth(),1),z=new Date($.getFullYear(),$.getMonth()+1,0,23,59,59,999);return{startDate:Y.toISOString(),endDate:z.toISOString()}}function w40($){let Y=new URLSearchParams;return n8(Y,"filter[startDate]",$.startDate),n8(Y,"filter[endDate]",$.endDate),n8(Y,"filter[search]",$.search),Y.set("offset",String($.offset??0)),Y.set("limit",String($.limit??50)),Y}async function M40($,Y={}){return N1(await $.get("api/v1/expenses/list",{searchParams:w40(Y)}),A10)}async function N40($,Y={}){return N1(await $.get("api/v1/invoice/list",{searchParams:w40(Y)}),B10)}async function D40($){return N1(await $.get("api/v1/integrations/feishu/simulation/approval-definitions"),L.array(P10))}async function A40($,Y){let z=await $.delete(`api/v1/contacts/local/users/${Y}`),U=await z.json(),Q=Mw.safeParse(U.data??U);return Q.success?Q.data.success??z.ok:z.ok}async function Lg($,Y){let z=await $.post(`api/v1/contacts/local/users/${Y}/activate`,{json:{}}),U=await z.json(),Q=Mw.safeParse(U.data??U);return Q.success?Q.data.success??z.ok:z.ok}async function Wc0($,Y){let z=await $.post("api/auth/sms-otp/sign-in-password",{json:Y}),U=z.headers.get("set-auth-token"),Q=Gc0.parse(await z.json()),J=U??Q.session?.token;if(!J)throw Error("Failed to retrieve authentication token from login response");return{token:J,user:Q.user}}async function B40($,Y,z,U){let Q;if(Y.userIdOrPhone.startsWith("+")||/^\d{11}$/.test(Y.userIdOrPhone)){let q=await ww($,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 Ow($,Y.userIdOrPhone).catch(async()=>{let q=await ww($,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 Lg($,Q._id),Q=await Ow($,Q._id);let J=Q,I=Array.isArray(J.identities)&&J.identities.some((q)=>q.provider&&q.provider!=="local")||!!J.apps?.hosecloud;if(I&&U&&U.source.type==="hose"){let V=(Q.mobile||J.identities?.[0]?.providerId||"").replace(/^\+86/,""),F=J.identities?.find((O)=>O.provider==="hosecloud")?.providerId,w=J.apps?.hosecloud?.boundId||F||(V?`${U.source.corpId}:${V}`:void 0);if(w){let O=await lQ(U),M=(await Kw({...U.source,staffId:w},O)).token,D=S7(U,U.source),P=A6(U.seal),j=y6(D,void 0,P),A;try{A=await j.get("api/auth/oauth2/session/oem-hosecloud",{searchParams:{token:M,returnToken:"1"}}).json()}catch(C){if(C instanceof D6&&C.response.status===400)throw Error(`Seal AI 用户“${Q.name}”未绑定合思账号,无法生成个人协助链接。`);throw C}let T=A.token??A.accessToken??A.data?.token;if(T){let C=await z(T),b=await aQ(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 qg($,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 Wc0($,{phone:H,password:K.password}),X=await z(W),Z=await aQ(X,{note:Y.note??`Delegation generated by admin for ${Q.name}`});return{targetUser:Q,delegation:Z,temporaryPassword:K.password}}async function P40($){return N1(await $.get("api/v1/llm/config"),j10)}async function j40($){return N1(await $.get("api/v1/llm/providers"),L.array(T10))}async function T40($){return N1(await $.get("api/v1/permissions/available"),E10)}async function E40($){return N1(await $.get("api/v1/permissions/configs"),C10)}async function lY($){return N1(await $.get("api/v1/billing/status"),R10)}async function C40($){let z=await(await $.get("api/v1/billing/plans")).json();return b10.parse(z.data??z)}async function R40($){let z=await(await $.get("api/v1/billing/features")).json();return b10.parse(z.data??z)}var Mw,Kc0,Gc0,b10;var B6=m(()=>{dQ();P$();sQ();g7();i8();Ig();Mw=L.object({success:L.boolean().optional()}).passthrough(),Kc0=L.object({items:L.array(L.object({_id:L.string()})).optional()}).passthrough(),Gc0=L.object({user:L.unknown().optional(),session:L.object({token:L.string().optional()}).optional()}).passthrough(),b10=L.json()});var Y6=E((kp1,v40)=>{var{toString:_40}=Object.prototype,Xc0=/["&<>]/,Y3={each:function(Y,z){if(Y)if(Array.isArray(Y))Y.forEach(z);else Object.keys(Y).forEach((U)=>{z(Y[U],U)})},some:function(Y,z){if(Y){if(Array.isArray(Y))return Y.some(z);return Object.keys(Y).some((U)=>z(Y[U],U))}return!1},every:function(Y,z){if(Y){if(Array.isArray(Y))return Y.every(z);return Object.keys(Y).every((U)=>z(Y[U],U))}return!0},map:function(Y,z){if(Y){if(Array.isArray(Y))return Y.map(z);return Object.keys(Y).map((U)=>z(Y[U],U))}return[]},keyBy($,Y){return $.reduce((z,U)=>{return z[U[Y]]=U,z},{})},isEqual:function(Y,z){let U=typeof Y,Q=typeof z,J=Array.isArray(Y),I=Array.isArray(z),K;if(U!==Q)return!1;switch(typeof Y){case"object":if(J||I){if(J&&I)return Y.length===z.length&&Y.every((G,H)=>{let W=z[H];return Y3.isEqual(G,W)});return!1}if(Y===null||z===null)return Y===z;if(K=Object.keys(Y),Object.keys(z).length!==K.length)return!1;for(let G of K)if(!z.hasOwnProperty(G))return!1;return Y3.every(Y,(G,H)=>{let W=z[H];return Y3.isEqual(G,W)});default:return Y===z}},escapeHtml($){let Y=Xc0.exec($);if(!Y)return $;let z="",U="",Q=0,J=Y.index;for(;J<$.length;J++){switch($.charAt(J)){case'"':U=""";break;case"&":U="&";break;case"'":U="'";break;case"<":U="<";break;case">":U=">";break;default:continue}if(Q!==J)z+=$.substring(Q,J);Q=J+1,z+=U}if(Q!==J)return z+$.substring(Q,J);return z},strcmp($,Y){if($Y)return 1;return 0},isUndefined($){return _40.call($)==="[object Undefined]"},isObject($){return _40.call($)==="[object Object]"},deepMerge(){let $=arguments[0]||{},{length:Y}=arguments,z,U,Q;function J(I,K){if(z=$[K],Q=Array.isArray(I),Y3.isObject(I)||Q){if(Q)Q=!1,U=z&&Array.isArray(z)?z:[];else U=z&&Y3.isObject(z)?z:{};$[K]=Y3.deepMerge(U,I)}else if(!Y3.isUndefined(I))$[K]=I}for(let I=0;I{var Zc0=/^[A-Z]+\d+$/,kH={_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,z,U,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)z=I-27,U=z%26,Q=Math.floor(z/26),Y=this._dictionary[Q]+this._dictionary[U],this._n2l[I]=Y,this._l2n[Y]=I,I++;this._l2nFill=2}if(this._l2nFill<3&&$>=3){I=703;while(I<=16384)z=I-703,U=z%26,Q=Math.floor(z/26)%26,J=Math.floor(z/676),Y=this._dictionary[J]+this._dictionary[Q]+this._dictionary[U],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(!Zc0.test($))throw Error(`Invalid Address: ${$}`);return!0},decodeAddress($){let Y=$.length<5&&this._hash[$];if(Y)return Y;let z=!1,U="",Q=0,J=!1,I="",K=0;for(let H=0,W;H<$.length;H++)if(W=$.charCodeAt(H),!J&&W>=65&&W<=90)z=!0,U+=$[H],Q=Q*26+W-64;else if(W>=48&&W<=57)J=!0,I+=$[H],K=K*10+W-48;else if(J&&z&&W!==36)break;if(!z)Q=void 0;else if(Q>16384)throw Error(`Out of bounds. Invalid column letter: ${U}`);if(!J)K=void 0;$=U+I;let G={address:$,col:Q,row:K,$col$row:`$${U}$${I}`};if(Q<=100&&K<=100)this._hash[$]=G,this._hash[G.$col$row]=G;return G},getAddress($,Y){if(Y){let z=this.n2l(Y)+$;return this.decodeAddress(z)}return this.decodeAddress($)},decode($){let Y=$.split(":");if(Y.length===2){let z=this.decodeAddress(Y[0]),U=this.decodeAddress(Y[1]),Q={top:Math.min(z.row,U.row),left:Math.min(z.col,U.col),bottom:Math.max(z.row,U.row),right:Math.max(z.col,U.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(/(?:(?:(?:'((?:[^']|'')*)')|([^'^ !]*))!)?(.*)/),z=Y[1]||Y[2],U=Y[3],Q=U.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:z,tl:{address:I,col:H,row:G,$col$row:`$${this.n2l(H)}$${G}`,sheetName:z},br:{address:K,col:X,row:W,$col$row:`$${this.n2l(X)}$${W}`,sheetName:z},dimensions:`${I}:${K}`}}if(U.startsWith("#"))return z?{sheetName:z,error:U}:{error:U};let J=this.decodeAddress(U);return z?{sheetName:z,...J}:J},encodeAddress($,Y){return kH.n2l(Y)+$},encode(){switch(arguments.length){case 2:return kH.encodeAddress(arguments[0],arguments[1]);case 4:return`${kH.encodeAddress(arguments[0],arguments[1])}:${kH.encodeAddress(arguments[2],arguments[3])}`;default:throw Error("Can only encode with 2 or 4 arguments")}},inRange($,Y){let[z,U,,Q,J]=$,[I,K]=Y;return I>=z&&I<=Q&&K>=U&&K<=J}};h40.exports=kH});var z3=E((fp1,S40)=>{var a5=n4();class Fg{constructor(){this.decode(arguments)}setTLBR($,Y,z,U,Q){if(arguments.length<4){let J=a5.decodeAddress($),I=a5.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:z},this.setTLBR(J.row,J.col,I.row,I.col,Q)}else this.model={top:Math.min($,z),left:Math.min(Y,U),bottom:Math.max($,z),right:Math.max(Y,U),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 Fg)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 z=a5.decodeEx(Y);if(z.top)this.model={top:z.top,left:z.left,bottom:z.bottom,right:z.right,sheetName:z.sheetName};else this.model={top:z.row,left:z.col,bottom:z.row,right:z.col,sheetName:z.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,z,U){if(!this.model.top||$this.bottom)this.bottom=z;if(!this.model.right||U>this.right)this.right=U}expandRow($){if($){let{dimensions:Y,number:z}=$;if(Y)this.expand(z,Y.min,z,Y.max)}}expandToAddress($){let Y=a5.decodeEx($);this.expand(Y.row,Y.col,Y.row,Y.col)}get tl(){return a5.n2l(this.left)+this.top}get $t$l(){return`$${a5.n2l(this.left)}$${this.top}`}get br(){return a5.n2l(this.right)+this.bottom}get $b$r(){return`$${a5.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=a5.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 z=this.top;z<=this.bottom;z++)$(a5.encodeAddress(z,Y),z,Y)}}S40.exports=Fg});var H5=E((up1,g40)=>{g40.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 k40=E((bp1,y40)=>{var hw=n4(),qc0=/(([a-z_\-0-9]*)!)?([a-z0-9_$]{2,})([(])?/gi,Vc0=/^([$])?([a-z]+)([$])?([1-9][0-9]*)$/i;function Lc0($,Y,z){let U=hw.decode(Y),Q=hw.decode(z);return $.replace(qc0,(J,I,K,G,H)=>{if(H)return J;let W=Vc0.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=hw.l2n(Z),w=parseInt(V,10);if(!X)F+=Q.col-U.col;if(!q)w+=Q.row-U.row;return(I||"")+(X||"")+hw.n2l(F)+(q||"")+w}return J})}y40.exports={slideFormula:Lc0}});var f40=E((ip1,x40)=>{var Fc0=Y6();class xH{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({},xH.DEFAULT_CONFIGS,$)}set model($){let{note:Y}=$,{texts:z}=Y;if(z.length===1&&Object.keys(z[0]).length===1)this.note=z[0].text;else this.note=Y}static fromModel($){let Y=new xH;return Y.model=$,Y}}xH.DEFAULT_CONFIGS={note:{margins:{insetmode:"auto",inset:[0.13,0.13,0.25,0.25]},protection:{locked:"True",lockText:"True"},editAs:"absolute"}};x40.exports=xH});var e40=E((np1,t40)=>{var Oc0=n4(),wc0=Y6(),W5=H5(),{slideFormula:Mc0}=k40(),u40=f40();class d0{constructor($,Y,z){if(!$||!Y)throw Error("A Cell needs a Row");this._row=$,this._column=Y,Oc0.validateAddress(z),this._address=z,this._value=x7.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,z){let U=$&&$.numFmt||Y&&Y.numFmt;if(U)z.numFmt=U;let Q=$&&$.font||Y&&Y.font;if(Q)z.font=Q;let J=$&&$.alignment||Y&&Y.alignment;if(J)z.alignment=J;let I=$&&$.border||Y&&Y.border;if(I)z.border=I;let K=$&&$.fill||Y&&Y.fill;if(K)z.fill=K;let G=$&&$.protection||Y&&Y.protection;if(G)z.protection=G;return z}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=x7.create(d0.Types.Merge,this,$),!Y)this.style=$.style}unmerge(){if(this.type===d0.Types.Merge)this._value.release(),this._value=x7.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=x7.create(x7.getType($),this,$)}get note(){return this._comment&&this._comment.note}set note($){this._comment=new u40($)}get text(){return this._value.toString()}get html(){return wc0.escapeHtml(this.text)}toString(){return this.text}_upgradeToHyperlink($){if(this.type===d0.Types.String)this._value=x7.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((z)=>{Y.addEx(this.fullAddress,z)})}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=x7.create($.type,this),this._value.model=$,$.comment)switch($.comment.type){case"note":this._comment=u40.fromModel($.comment);break}if($.style)this.style=$.style;else this.style={}}}d0.Types=W5.ValueType;class b40{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 i40{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 c40{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 p40{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 d40{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 m40{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 l40{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={},z=(U)=>{let Q=$[U];if(Q)Y[U]=Q};return z("formula"),z("result"),z("ref"),z("shareType"),z("sharedFormula"),Y}get value(){return this._copyModel(this.model)}set value($){this.model=this._copyModel($)}validate($){switch(x7.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 W5.FormulaType.Master;if(this.model.sharedFormula)return W5.FormulaType.Shared;return W5.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 W5.ValueType.Null;if($ instanceof String||typeof $==="string")return W5.ValueType.String;if(typeof $==="number")return W5.ValueType.Number;if($ instanceof Date)return W5.ValueType.Date;if($.text&&$.hyperlink)return W5.ValueType.Hyperlink;if($.formula)return W5.ValueType.Formula;return W5.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&&Mc0(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 o40{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 r40{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 s40{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 a40{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 x7={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:b40},{t:d0.Types.Number,f:i40},{t:d0.Types.String,f:n40},{t:d0.Types.Date,f:p40},{t:d0.Types.Hyperlink,f:d40},{t:d0.Types.Formula,f:l40},{t:d0.Types.Merge,f:m40},{t:d0.Types.JSON,f:a40},{t:d0.Types.SharedString,f:o40},{t:d0.Types.RichText,f:c40},{t:d0.Types.Boolean,f:r40},{t:d0.Types.Error,f:s40}].reduce(($,Y)=>{return $[Y.t]=Y.f,$},[]),create($,Y,z){let U=this.types[$];if(!U)throw Error(`Could not create Value of type ${$}`);return new U(Y,z)}};t40.exports=d0});var gw=E((cp1,z60)=>{var Nc0=Y6(),Sw=H5(),oY=n4(),$60=e40();class Y60{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 z=this._worksheet.getColumn($.col);Y=new $60(this,z,$.address),this._cells[$.col-1]=Y}return Y}getCell($){if(typeof $==="string"){let Y=this._worksheet.getColumnKey($);if(Y)$=Y.number;else $=oY.l2n($)}return this._cells[$-1]||this.getCellEx({address:oY.encodeAddress(this._number,$),row:this._number,col:$})}splice($,Y,...z){let U=$+Y,Q=z.length-Y,J=this._cells.length,I,K,G;if(Q<0){for(I=$+z.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>=U;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(z&&z.type!==Sw.ValueType.Null)Y(z,U+1)})}addPageBreak($,Y){let z=this._worksheet,U=Math.max(0,$-1)||0,Q=Math.max(0,Y-1)||16838,J={id:this._number,max:Q,man:1};if(U)J.min=U;z.rowBreaks.push(J)}get values(){let $=[];return this._cells.forEach((Y)=>{if(Y&&Y.type!==Sw.ValueType.Null)$[Y.col]=Y.value}),$}set values($){if(this._cells=[],!$);else if($ instanceof Array){let Y=0;if($.hasOwnProperty("0"))Y=1;$.forEach((z,U)=>{if(z!==void 0)this.getCellEx({address:oY.encodeAddress(this._number,U+Y),row:this._number,col:U+Y}).value=z})}else this._worksheet.eachColumnKey((Y,z)=>{if($[z]!==void 0)this.getCellEx({address:oY.encodeAddress(this._number,Y.number),row:this._number,col:Y.number}).value=$[z]})}get hasValues(){return Nc0.some(this._cells,($)=>$&&$.type!==Sw.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((z)=>{if(z&&z.type!==Sw.ValueType.Null){if(!$||$>z.col)$=z.col;if(Y0?{min:$,max:Y}:null}_applyStyle($,Y){return this.style[$]=Y,this._cells.forEach((z)=>{if(z)z[$]=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,z=0;return this._cells.forEach((U)=>{if(U){let Q=U.model;if(Q){if(!Y||Y>U.col)Y=U.col;if(z{switch(z.type){case $60.Types.Merge:break;default:{let U;if(z.address)U=oY.decodeAddress(z.address);else if(Y){let{row:J}=Y,I=Y.col+1;U={row:J,col:I,address:oY.encodeAddress(J,I),$col$row:`$${oY.n2l(I)}$${J}`}}Y=U;let Q=this.getCellEx(U);Q.model=z;break}}}),$.height)this.height=$.height;else delete this.height;this.hidden=$.hidden,this.outlineLevel=$.outlineLevel||0,this.style=$.style&&JSON.parse(JSON.stringify($.style))||{}}}z60.exports=Y60});var kw=E((pp1,U60)=>{var Dc0=Y6(),Ac0=H5(),Bc0=n4();class yw{constructor($,Y,z){if(this._worksheet=$,this._number=Y,z!==!1)this.defn=z}get number(){return this._number}get worksheet(){return this._worksheet}get letter(){return Bc0.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,z)=>{this._worksheet.getCell(z+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&&Dc0.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 z=this.number;if(!Y)Y=$,$=null;this._worksheet.eachRow($,(U,Q)=>{Y(U.getCell(z),Q)})}get values(){let $=[];return this.eachCell((Y,z)=>{if(Y&&Y.type!==Ac0.ValueType.Null)$[z]=Y.value}),$}set values($){if(!$)return;let Y=this.number,z=0;if($.hasOwnProperty("0"))z=1;$.forEach((U,Q)=>{this._worksheet.getCell(Q+z,Y).value=U})}_applyStyle($,Y){return this.style[$]=Y,this.eachCell((z)=>{z[$]=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=[],z=null;if($)$.forEach((U,Q)=>{if(U.isDefault){if(z)z=null}else if(!z||!U.equivalentTo(z))z={min:Q+1,max:Q+1,width:U.width!==void 0?U.width:9,style:U.style,isCustomWidth:U.isCustomWidth,hidden:U.hidden,outlineLevel:U.outlineLevel,collapsed:U.collapsed},Y.push(z);else z.max=Q+1});return Y.length?Y:void 0}static fromModel($,Y){Y=Y||[];let z=[],U=1,Q=0;Y=Y.sort(function(J,I){return J.min-I.min});while(Q{var Pc0=n4();class xw{constructor($,Y,z=0){if(this.worksheet=$,!Y)this.nativeCol=0,this.nativeColOff=0,this.nativeRow=0,this.nativeRowOff=0;else if(typeof Y==="string"){let U=Pc0.decodeAddress(Y);this.nativeCol=U.col+z,this.nativeColOff=0,this.nativeRow=U.row+z,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+z,this.row=Y.row+z;else this.nativeCol=0,this.nativeColOff=0,this.nativeRow=0,this.nativeRowOff=0}static asInstance($){return $ instanceof xw||$==null?$:new xw($)}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}}Q60.exports=xw});var G60=E((mp1,K60)=>{var jc0=n4(),fw=J60();class I60{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:z,hyperlinks:U}){if(this.type=$,this.imageId=Y,$==="image")if(typeof z==="string"){let Q=jc0.decode(z);this.range={tl:new fw(this.worksheet,{col:Q.left,row:Q.top},-1),br:new fw(this.worksheet,{col:Q.right,row:Q.bottom},0),editAs:"oneCell"}}else this.range={tl:new fw(this.worksheet,z.tl,0),br:z.br&&new fw(this.worksheet,z.br,0),ext:z.ext,editAs:z.editAs,hyperlinks:U||z.hyperlinks}}}K60.exports=I60});var Z60=E((lp1,X60)=>{var uw=n4();class H60{constructor($,Y,z){this.table=$,this.column=Y,this.index=z}_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 W60{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 z=(G,H)=>{if(!G)throw Error(H)};z($.ref,"Table must have ref"),z($.columns,"Table must have column definitions"),z($.rows,"Table must have row definitions"),$.tl=uw.decodeAddress($.ref);let{row:U,col:Q}=$.tl;z(U>0,"Table must be on valid row"),z(Q>0,"Table must be on valid col");let{width:J,filterHeight:I,tableHeight:K}=this;$.autoFilterRef=uw.encode(U,Q,U+I-1,Q+J-1),$.tableRef=uw.encode(U,Q,U+K-1,Q+J-1),$.columns.forEach((G,H)=>{if(z(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:z}=this,{row:U,col:Q}=z.tl,J=0;if(z.headerRow){let I=Y.getRow(U+J++);z.columns.forEach((K,G)=>{let{style:H,name:W}=K,X=I.getCell(Q+G);X.value=W,$(X,H)})}if(z.rows.forEach((I)=>{let K=Y.getRow(U+J++);I.forEach((G,H)=>{let W=K.getCell(Q+H);W.value=G,$(W,z.columns[H].style)})}),z.totalsRow){let I=Y.getRow(U+J++);z.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:z,col:U}=Y.tl,Q=0;if(Y.headerRow){let J=$.getRow(z+Q++);Y.columns.forEach((I,K)=>{let G=J.getCell(U+K);G.value=I.name})}if(Y.rows.forEach((J)=>{let I=$.getRow(z+Q++);J.forEach((K,G)=>{let H=I.getCell(U+G);H.value=K})}),Y.totalsRow){let J=$.getRow(z+Q++);Y.columns.forEach((I,K)=>{let G=J.getCell(U+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 $=uw.decodeAddress(this._cache.ref);if(this.ref!==this._cache.ref)for(let Y=0;Y{U.push(Y[Q])});else this.table.columns.splice(z,0,$),this.table.rows.forEach((U,Q)=>{U.splice(z,0,Y[Q])})}removeColumns($,Y=1){this.cacheState(),this.table.columns.splice($,Y),this.table.rows.forEach((z)=>{z.splice($,Y)})}_assign($,Y,z){this.cacheState(),$[Y]=z}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=$}}X60.exports=W60});var Og=E((op1,V60)=>{class q60{constructor($){this.model=$||{}}add($,Y){return this.model[$]=Y}find($){return this.model[$]}remove($){this.model[$]=void 0}}V60.exports=q60});var Mg=E((rp1,L60)=>{var wg=I0("crypto"),Tc0={hash($,...Y){let z=wg.createHash($);return z.update(Buffer.concat(Y)),z.digest()},convertPasswordToHash($,Y,z,U){if(Y=Y.toLowerCase(),wg.getHashes().indexOf(Y)<0)throw Error(`Hash algorithm '${Y}' not supported!`);let J=Buffer.from($,"utf16le"),I=this.hash(Y,Buffer.from(z,"base64"),J);for(let K=0;K{var F60=($,Y)=>({...$,...Y.reduce((z,U)=>{if($[U])z[U]={...$[U]};return z},{})}),t5=($,Y,z,U=[])=>{if($[z])Y[z]=F60($[z],U)},Ec0=($)=>Object.keys($).length===0,Cc0=($)=>{if(!$)return $;if(Ec0($))return{};let Y={...$};if(t5($,Y,"font",["color"]),t5($,Y,"alignment"),t5($,Y,"protection"),$.border)t5($,Y,"border"),t5($.border,Y.border,"top",["color"]),t5($.border,Y.border,"left",["color"]),t5($.border,Y.border,"bottom",["color"]),t5($.border,Y.border,"right",["color"]),t5($.border,Y.border,"diagonal",["color"]);if($.fill){if(t5($,Y,"fill",["fgColor","bgColor","center"]),$.fill.stops)Y.fill.stops=$.fill.stops.map((z)=>F60(z,["color"]))}return Y};Rc0.copyStyle=Cc0});var j60=E((ap1,P60)=>{var fH=Y6(),uH=n4(),bH=z3(),w60=gw(),bw=kw(),vc0=H5(),Ng=G60(),M60=Z60(),N60=Og(),D60=Mg(),{copyStyle:A60}=O60();class B60{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 N60,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 bH;return this._rows.forEach((Y)=>{if(Y){let z=Y.dimensions;if(z)$.expand(Y.number,z.min,Y.number,z.max)}}),$}get columns(){return this._columns}set columns($){this._headerRowCount=$.reduce((U,Q)=>{let J=Q.header&&1||Q.headers&&Q.headers.length||0;return Math.max(U,J)},0);let Y=1,z=this._columns=[];$.forEach((U)=>{let Q=new bw(this,Y++,!1);z.push(Q),Q.defn=U})}getColumnKey($){return this._keys[$]}setColumnKey($,Y){this._keys[$]=Y}deleteColumnKey($){delete this._keys[$]}eachColumnKey($){fH.each(this._keys,$)}getColumn($){if(typeof $==="string"){let Y=this._keys[$];if(Y)return Y;$=uH.l2n($)}if(!this._columns)this._columns=[];if($>this._columns.length){let Y=this._columns.length+1;while(Y<=$)this._columns.push(new bw(this,Y++))}return this._columns[$-1]}spliceColumns($,Y,...z){let Q=this._rows.length;if(z.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=z.length-Y,I=$+Y,K=this._columns.length;if(J<0)for(let G=$+z.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<$+z.length;G++)this.getColumn(G).defn=null;this.workbook.definedNames.spliceColumns(this.name,$,Y,z.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((z)=>{z.eachCell(({col:U})=>{if(!$[U])$[U]=!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 w60(this,$);return Y}getRows($,Y){if(Y<1)return;let z=[];for(let U=$;U<$+Y;U++)z.push(this.getRow(U));return z}addRow($,Y="n"){let z=this._nextRow,U=this.getRow(z);return U.values=$,this._setStyleOption(z,Y[0]==="i"?Y:"n"),U}addRows($,Y="n"){let z=[];return $.forEach((U)=>{z.push(this.addRow(U,Y))}),z}insertRow($,Y,z="n"){return this.spliceRows($,0,Y),this._setStyleOption($,z),this.getRow($)}insertRows($,Y,z="n"){if(this.spliceRows($,0,...Y),z!=="n"){for(let U=0;U{Q.getCell(I).style=A60(J.style)}),Q.height=U.height}duplicateRow($,Y,z=!1){let U=this._rows[$-1],Q=Array(Y).fill(U.values);this.spliceRows($+1,z?0:Y,...Q);for(let J=0;J{I.getCell(G).style=K.style})}}spliceRows($,Y,...z){let U=$+Y,Q=z.length,J=Q-Y,I=this._rows.length,K,G;if(J<0){if($===I)this._rows[I-1]=void 0;for(K=U;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>=U;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(z&&z.hasValues)Y(z,z.number)})}getSheetValues(){let $=[];return this._rows.forEach((Y)=>{if(Y)$[Y.number]=Y.values}),$}findCell($,Y){let z=uH.getAddress($,Y),U=this._rows[z.row-1];return U?U.findCell(z.col):void 0}getCell($,Y){let z=uH.getAddress($,Y);return this.getRow(z.row).getCellEx(z)}mergeCells(...$){let Y=new bH($);this._mergeCellsInternal(Y)}mergeCellsWithoutStyle(...$){let Y=new bH($);this._mergeCellsInternal(Y,!0)}_mergeCellsInternal($,Y){fH.each(this._merges,(U)=>{if(U.intersects($))throw Error("Cannot merge already merged cells")});let z=this.getCell($.top,$.left);for(let U=$.top;U<=$.bottom;U++)for(let Q=$.left;Q<=$.right;Q++)if(U>$.top||Q>$.left)this.getCell(U,Q).merge(z,Y);this._merges[z.address]=$}_unMergeMaster($){let Y=this._merges[$.address];if(Y){for(let z=Y.top;z<=Y.bottom;z++)for(let U=Y.left;U<=Y.right;U++)this.getCell(z,U).unmerge();delete this._merges[$.address]}}get hasMerges(){return fH.some(this._merges,Boolean)}unMergeCells(...$){let Y=new bH($);for(let z=Y.top;z<=Y.bottom;z++)for(let U=Y.left;U<=Y.right;U++){let Q=this.findCell(z,U);if(Q){if(Q.type===vc0.ValueType.Merge)this._unMergeMaster(Q.master);else if(this._merges[Q.address])this._unMergeMaster(Q)}}}fillFormula($,Y,z,U="shared"){let Q=uH.decode($),{top:J,left:I,bottom:K,right:G}=Q,H=G-I+1,W=uH.encodeAddress(J,I),X=U==="shared",Z;if(typeof z==="function")Z=z;else if(Array.isArray(z))if(Array.isArray(z[0]))Z=(V,F)=>z[V-J][F-I];else Z=(V,F)=>z[(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:U,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 z={type:"image",imageId:$,range:Y};this._media.push(new Ng(this,z))}getImages(){return this._media.filter(($)=>$.type==="image")}addBackgroundImage($){let Y={type:"background",imageId:$};this._media.push(new Ng(this,Y))}getBackgroundImageId(){let $=this._media.find((Y)=>Y.type==="background");return $&&$.imageId}protect($,Y){return new Promise((z)=>{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=D60.randomBytes(16).toString("base64"),this.sheetProtection.spinCount=Y&&"spinCount"in Y?Y.spinCount:1e5,this.sheetProtection.hashValue=D60.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}z()})}unprotect(){this.sheetProtection=null}addTable($){let Y=new M60(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((U)=>U.model),sheetProtection:this.sheetProtection,tables:Object.values(this.tables).map((U)=>U.model),conditionalFormattings:this.conditionalFormattings};$.cols=bw.toModel(this.columns);let Y=$.rows=[],z=$.dimensions=new bH;return this._rows.forEach((U)=>{let Q=U&&U.model;if(Q)z.expand(Q.number,Q.min,Q.number,Q.max),Y.push(Q)}),$.merges=[],fH.each(this._merges,(U)=>{$.merges.push(U.range)}),$}_parseRows($){this._rows=[],$.rows.forEach((Y)=>{let z=new w60(this,Y.number);this._rows[z.number-1]=z,z.model=Y})}_parseMergeCells($){fH.each($.mergeCells,(Y)=>{this.mergeCellsWithoutStyle(Y)})}set model($){this.name=$.name,this._columns=bw.fromModel(this,$.cols),this._parseRows($),this._parseMergeCells($),this.dataValidations=new N60($.dataValidations),this.properties=$.properties,this.pageSetup=$.pageSetup,this.headerFooter=$.headerFooter,this.views=$.views,this.autoFilter=$.autoFilter,this._media=$.media.map((Y)=>new Ng(this,Y)),this.sheetProtection=$.sheetProtection,this.tables=$.tables.reduce((Y,z)=>{let U=new M60;return U.model=z,Y[z.name]=U,Y},{}),this.conditionalFormattings=$.conditionalFormattings}}P60.exports=B60});var R60=E((tp1,C60)=>{var T60=Y6(),iw=n4();class E60{constructor($){this.template=$,this.sheets={}}addCell($){this.addCellEx(iw.decodeEx($))}getCell($){return this.findCellEx(iw.decodeEx($),!0)}findCell($){return this.findCellEx(iw.decodeEx($),!1)}findCellAt($,Y,z){let U=this.sheets[$],Q=U&&U[Y];return Q&&Q[z]}addCellEx($){if($.top)for(let Y=$.top;Y<=$.bottom;Y++)for(let z=$.left;z<=$.right;z++)this.getCellAt($.sheetName,Y,z);else this.findCellEx($,!0)}getCellEx($){return this.findCellEx($,!0)}findCellEx($,Y){let z=this.findSheet($,Y),U=this.findSheetRow(z,$,Y);return this.findRowCell(U,$,Y)}getCellAt($,Y,z){let U=this.sheets[$]||(this.sheets[$]=[]),Q=U[Y]||(U[Y]=[]);return Q[z]||(Q[z]={sheetName:$,address:iw.n2l(z)+Y,row:Y,col:z})}removeCellEx($){let Y=this.findSheet($);if(!Y)return;let z=this.findSheetRow(Y,$);if(!z)return;delete z[$.col]}forEachInSheet($,Y){let z=this.sheets[$];if(z)z.forEach((U,Q)=>{if(U)U.forEach((J,I)=>{if(J)Y(J,Q,I)})})}forEach($){T60.each(this.sheets,(Y,z)=>{this.forEachInSheet(z,$)})}map($){let Y=[];return this.forEach((z)=>{Y.push($(z))}),Y}findSheet($,Y){let z=$.sheetName;if(this.sheets[z])return this.sheets[z];if(Y)return this.sheets[z]=[];return}findSheetRow($,Y,z){let{row:U}=Y;if($&&$[U])return $[U];if(z)return $[U]=[];return}findRowCell($,Y,z){let{col:U}=Y;if($&&$[U])return $[U];if(z)return $[U]=this.template?Object.assign(Y,JSON.parse(JSON.stringify(this.template))):Y;return}spliceRows($,Y,z,U){let Q=this.sheets[$];if(Q){let J=[];for(let I=0;I{I.splice(Y,z,...J)})}}}C60.exports=E60});var Dg=E((ep1,h60)=>{var eQ=Y6(),iH=n4(),_60=R60(),hc0=z3(),Sc0=/[$](\w+)[$](\d+)(:[$](\w+)[$](\d+))?/;class v60{constructor(){this.matrixMap={}}getMatrix($){return this.matrixMap[$]||(this.matrixMap[$]=new _60)}add($,Y){let z=iH.decodeEx($);this.addEx(z,Y)}addEx($,Y){let z=this.getMatrix(Y);if($.top)for(let U=$.left;U<=$.right;U++)for(let Q=$.top;Q<=$.bottom;Q++){let J={sheetName:$.sheetName,address:iH.n2l(U)+Q,row:Q,col:U};z.addCellEx(J)}else z.addCellEx($)}remove($,Y){let z=iH.decodeEx($);this.removeEx(z,Y)}removeEx($,Y){this.getMatrix(Y).removeCellEx($)}removeAllNames($){eQ.each(this.matrixMap,(Y)=>{Y.removeCellEx($)})}forEach($){eQ.each(this.matrixMap,(Y,z)=>{Y.forEach((U)=>{$(z,U)})})}getNames($){return this.getNamesEx(iH.decodeEx($))}getNamesEx($){return eQ.map(this.matrixMap,(Y,z)=>Y.findCellEx($)&&z).filter(Boolean)}_explore($,Y){Y.mark=!1;let{sheetName:z}=Y,U=new hc0(Y.row,Y.col,Y.row,Y.col,z),Q,J;function I(G,H){let W=$.findCellAt(z,G,Y.col);if(!W||!W.mark)return!1;return U[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=U.top;J<=U.bottom;J++){let X=$.findCellAt(z,J,G);if(X&&X.mark)W.push(X);else return!1}U[H]=G;for(let X=0;X{U.mark=!0});let z=Y.map((U)=>U.mark&&this._explore(Y,U)).filter(Boolean).map((U)=>U.$shortRange);return{name:$,ranges:z}}normaliseMatrix($,Y){$.forEachInSheet(Y,(z,U,Q)=>{if(z){if(z.row!==U||z.col!==Q)z.row=U,z.col=Q,z.address=iH.n2l(Q)+U}})}spliceRows($,Y,z,U){eQ.each(this.matrixMap,(Q)=>{Q.spliceRows($,Y,z,U),this.normaliseMatrix(Q,$)})}spliceColumns($,Y,z,U){eQ.each(this.matrixMap,(Q)=>{Q.spliceColumns($,Y,z,U),this.normaliseMatrix(Q,$)})}get model(){return eQ.map(this.matrixMap,($,Y)=>this.getRanges(Y,$)).filter(($)=>$.ranges.length)}set model($){let Y=this.matrixMap={};$.forEach((z)=>{let U=Y[z.name]=new _60;z.ranges.forEach((Q)=>{if(Sc0.test(Q.split("!").pop()||""))U.addCell(Q)})})}}h60.exports=v60});var I6=E(($d1,Ag)=>{if(typeof process>"u"||!process.version||process.version.indexOf("v0.")===0||process.version.indexOf("v1.")===0&&process.version.indexOf("v1.8.")!==0)Ag.exports={nextTick:gc0};else Ag.exports=process;function gc0($,Y,z,U){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,z)});case 4:return process.nextTick(function(){$.call(null,Y,z,U)});default:J=Array(Q-1),I=0;while(I{var yc0={}.toString;S60.exports=Array.isArray||function($){return yc0.call($)=="[object Array]"}});var K6=E((Bg,y60)=>{var nw=I0("buffer"),U3=nw.Buffer;function g60($,Y){for(var z in $)Y[z]=$[z]}if(U3.from&&U3.alloc&&U3.allocUnsafe&&U3.allocUnsafeSlow)y60.exports=nw;else g60(nw,Bg),Bg.Buffer=YJ;function YJ($,Y,z){return U3($,Y,z)}g60(U3,YJ);YJ.from=function($,Y,z){if(typeof $==="number")throw TypeError("Argument must not be a number");return U3($,Y,z)};YJ.alloc=function($,Y,z){if(typeof $!=="number")throw TypeError("Argument must be a number");var U=U3($);if(Y!==void 0)if(typeof z==="string")U.fill(Y,z);else U.fill(Y);else U.fill(0);return U};YJ.allocUnsafe=function($){if(typeof $!=="number")throw TypeError("Argument must be a number");return U3($)};YJ.allocUnsafeSlow=function($){if(typeof $!=="number")throw TypeError("Argument must be a number");return nw.SlowBuffer($)}});var M4=E((sc0)=>{function kc0($){if(Array.isArray)return Array.isArray($);return cw($)==="[object Array]"}sc0.isArray=kc0;function xc0($){return typeof $==="boolean"}sc0.isBoolean=xc0;function fc0($){return $===null}sc0.isNull=fc0;function uc0($){return $==null}sc0.isNullOrUndefined=uc0;function bc0($){return typeof $==="number"}sc0.isNumber=bc0;function ic0($){return typeof $==="string"}sc0.isString=ic0;function nc0($){return typeof $==="symbol"}sc0.isSymbol=nc0;function cc0($){return $===void 0}sc0.isUndefined=cc0;function pc0($){return cw($)==="[object RegExp]"}sc0.isRegExp=pc0;function dc0($){return typeof $==="object"&&$!==null}sc0.isObject=dc0;function mc0($){return cw($)==="[object Date]"}sc0.isDate=mc0;function lc0($){return cw($)==="[object Error]"||$ instanceof Error}sc0.isError=lc0;function oc0($){return typeof $==="function"}sc0.isFunction=oc0;function rc0($){return $===null||typeof $==="boolean"||typeof $==="number"||typeof $==="string"||typeof $==="symbol"||typeof $>"u"}sc0.isPrimitive=rc0;sc0.isBuffer=I0("buffer").Buffer.isBuffer;function cw($){return Object.prototype.toString.call($)}});var k60=E((Ud1,Pg)=>{if(typeof Object.create==="function")Pg.exports=function(Y,z){if(z)Y.super_=z,Y.prototype=Object.create(z.prototype,{constructor:{value:Y,enumerable:!1,writable:!0,configurable:!0}})};else Pg.exports=function(Y,z){if(z){Y.super_=z;var U=function(){};U.prototype=z.prototype,Y.prototype=new U,Y.prototype.constructor=Y}}});var X1=E((Qd1,jg)=>{try{if(pw=I0("util"),typeof pw.inherits!=="function")throw"";jg.exports=pw.inherits}catch($){jg.exports=k60()}var pw});var f60=E((Jd1,Tg)=>{function Zp0($,Y){if(!($ instanceof Y))throw TypeError("Cannot call a class as a function")}var x60=K6().Buffer,nH=I0("util");function qp0($,Y,z){$.copy(Y,z)}Tg.exports=function(){function $(){Zp0(this,$),this.head=null,this.tail=null,this.length=0}return $.prototype.push=function(z){var U={data:z,next:null};if(this.length>0)this.tail.next=U;else this.head=U;this.tail=U,++this.length},$.prototype.unshift=function(z){var U={data:z,next:this.head};if(this.length===0)this.tail=U;this.head=U,++this.length},$.prototype.shift=function(){if(this.length===0)return;var z=this.head.data;if(this.length===1)this.head=this.tail=null;else this.head=this.head.next;return--this.length,z},$.prototype.clear=function(){this.head=this.tail=null,this.length=0},$.prototype.join=function(z){if(this.length===0)return"";var U=this.head,Q=""+U.data;while(U=U.next)Q+=z+U.data;return Q},$.prototype.concat=function(z){if(this.length===0)return x60.alloc(0);var U=x60.allocUnsafe(z>>>0),Q=this.head,J=0;while(Q)qp0(Q.data,U,J),J+=Q.data.length,Q=Q.next;return U},$}();if(nH&&nH.inspect&&nH.inspect.custom)Tg.exports.prototype[nH.inspect.custom]=function(){var $=nH.inspect({length:this.length});return this.constructor.name+" "+$}});var Eg=E((Id1,u60)=>{var dw=I6();function Vp0($,Y){var z=this,U=this._readableState&&this._readableState.destroyed,Q=this._writableState&&this._writableState.destroyed;if(U||Q){if(Y)Y($);else if($){if(!this._writableState)dw.nextTick(mw,this,$);else if(!this._writableState.errorEmitted)this._writableState.errorEmitted=!0,dw.nextTick(mw,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(!z._writableState)dw.nextTick(mw,z,J);else if(!z._writableState.errorEmitted)z._writableState.errorEmitted=!0,dw.nextTick(mw,z,J)}else if(Y)Y(J)}),this}function Lp0(){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 mw($,Y){$.emit("error",Y)}u60.exports={destroy:Vp0,undestroy:Lp0}});var f7=E((Kd1,b60)=>{b60.exports=I0("util").deprecate});var Rg=E((Gd1,o60)=>{var rY=I6();o60.exports=Z6;function n60($){var Y=this;this.next=null,this.entry=null,this.finish=function(){Sp0(Y,$)}}var Fp0=["v0.10","v0.9."].indexOf(process.version.slice(0,5))>-1?setImmediate:rY.nextTick,zJ;Z6.WritableState=pH;var c60=Object.create(M4());c60.inherits=X1();var Op0={deprecate:f7()},p60=I0("stream"),ow=K6().Buffer,wp0=(typeof global<"u"?global:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function Mp0($){return ow.from($)}function Np0($){return ow.isBuffer($)||$ instanceof wp0}var d60=Eg();c60.inherits(Z6,p60);function Dp0(){}function pH($,Y){zJ=zJ||sY(),$=$||{};var z=Y instanceof zJ;if(this.objectMode=!!$.objectMode,z)this.objectMode=this.objectMode||!!$.writableObjectMode;var{highWaterMark:U,writableHighWaterMark:Q}=$,J=this.objectMode?16:16384;if(U||U===0)this.highWaterMark=U;else if(z&&(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){Cp0(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)}pH.prototype.getBuffer=function(){var Y=this.bufferedRequest,z=[];while(Y)z.push(Y),Y=Y.next;return z};(function(){try{Object.defineProperty(pH.prototype,"buffer",{get:Op0.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch($){}})();var lw;if(typeof Symbol==="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]==="function")lw=Function.prototype[Symbol.hasInstance],Object.defineProperty(Z6,Symbol.hasInstance,{value:function($){if(lw.call(this,$))return!0;if(this!==Z6)return!1;return $&&$._writableState instanceof pH}});else lw=function($){return $ instanceof this};function Z6($){if(zJ=zJ||sY(),!lw.call(Z6,this)&&!(this instanceof zJ))return new Z6($);if(this._writableState=new pH($,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}p60.call(this)}Z6.prototype.pipe=function(){this.emit("error",Error("Cannot pipe, not readable"))};function Ap0($,Y){var z=Error("write after end");$.emit("error",z),rY.nextTick(Y,z)}function Bp0($,Y,z,U){var Q=!0,J=!1;if(z===null)J=TypeError("May not write null values to stream");else if(typeof z!=="string"&&z!==void 0&&!Y.objectMode)J=TypeError("Invalid non-string/buffer chunk");if(J)$.emit("error",J),rY.nextTick(U,J),Q=!1;return Q}Z6.prototype.write=function($,Y,z){var U=this._writableState,Q=!1,J=!U.objectMode&&Np0($);if(J&&!ow.isBuffer($))$=Mp0($);if(typeof Y==="function")z=Y,Y=null;if(J)Y="buffer";else if(!Y)Y=U.defaultEncoding;if(typeof z!=="function")z=Dp0;if(U.ended)Ap0(this,z);else if(J||Bp0(this,U,$,z))U.pendingcb++,Q=jp0(this,U,J,$,Y,z);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)m60(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 Pp0($,Y,z){if(!$.objectMode&&$.decodeStrings!==!1&&typeof Y==="string")Y=ow.from(Y,z);return Y}Object.defineProperty(Z6.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function jp0($,Y,z,U,Q,J){if(!z){var I=Pp0(Y,U,Q);if(U!==I)z=!0,Q="buffer",U=I}var K=Y.objectMode?1:U.length;Y.length+=K;var G=Y.length{var r60=I6(),gp0=Object.keys||function($){var Y=[];for(var z in $)Y.push(z);return Y};t60.exports=Q3;var s60=Object.create(M4());s60.inherits=X1();var a60=vg(),_g=Rg();s60.inherits(Q3,a60);{rw=gp0(_g.prototype);for(dH=0;dH{var Sg=K6().Buffer,e60=Sg.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 xp0($){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 fp0($){var Y=xp0($);if(typeof Y!=="string"&&(Sg.isEncoding===e60||!e60($)))throw Error("Unknown encoding: "+$);return Y||$}sp0.StringDecoder=lH;function lH($){this.encoding=fp0($);var Y;switch(this.encoding){case"utf16le":this.text=pp0,this.end=dp0,Y=4;break;case"utf8":this.fillLast=ip0,Y=4;break;case"base64":this.text=mp0,this.end=lp0,Y=3;break;default:this.write=op0,this.end=rp0;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=Sg.allocUnsafe(Y)}lH.prototype.write=function($){if($.length===0)return"";var Y,z;if(this.lastNeed){if(Y=this.fillLast($),Y===void 0)return"";z=this.lastNeed,this.lastNeed=0}else z=0;if(z<$.length)return Y?Y+this.text($,z):this.text($,z);return Y||""};lH.prototype.end=cp0;lH.prototype.text=np0;lH.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 hg($){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 up0($,Y,z){var U=Y.length-1;if(U=0){if(Q>0)$.lastNeed=Q-1;return Q}if(--U=0){if(Q>0)$.lastNeed=Q-2;return Q}if(--U=0){if(Q>0)if(Q===2)Q=0;else $.lastNeed=Q-3;return Q}return 0}function bp0($,Y,z){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 ip0($){var Y=this.lastTotal-this.lastNeed,z=bp0(this,$,Y);if(z!==void 0)return z;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 np0($,Y){var z=up0(this,$,Y);if(!this.lastNeed)return $.toString("utf8",Y);this.lastTotal=z;var U=$.length-(z-this.lastNeed);return $.copy(this.lastChar,0,U),$.toString("utf8",Y,U)}function cp0($){var Y=$&&$.length?this.write($):"";if(this.lastNeed)return Y+"�";return Y}function pp0($,Y){if(($.length-Y)%2===0){var z=$.toString("utf16le",Y);if(z){var U=z.charCodeAt(z.length-1);if(U>=55296&&U<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=$[$.length-2],this.lastChar[1]=$[$.length-1],z.slice(0,-1)}return z}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=$[$.length-1],$.toString("utf16le",Y,$.length-1)}function dp0($){var Y=$&&$.length?this.write($):"";if(this.lastNeed){var z=this.lastTotal-this.lastNeed;return Y+this.lastChar.toString("utf16le",0,z)}return Y}function mp0($,Y){var z=($.length-Y)%3;if(z===0)return $.toString("base64",Y);if(this.lastNeed=3-z,this.lastTotal=3,z===1)this.lastChar[0]=$[$.length-1];else this.lastChar[0]=$[$.length-2],this.lastChar[1]=$[$.length-1];return $.toString("base64",Y,$.length-z)}function lp0($){var Y=$&&$.length?this.write($):"";if(this.lastNeed)return Y+this.lastChar.toString("base64",0,3-this.lastNeed);return Y}function op0($){return $.toString(this.encoding)}function rp0($){return $&&$.length?this.write($):""}});var vg=E((Zd1,X80)=>{var QJ=I6();X80.exports=P4;var tp0=$J(),oH;P4.ReadableState=I80;var Xd1=I0("events").EventEmitter,U80=function($,Y){return $.listeners(Y).length},ug=I0("stream"),rH=K6().Buffer,ep0=(typeof global<"u"?global:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function $d0($){return rH.from($)}function Yd0($){return rH.isBuffer($)||$ instanceof ep0}var Q80=Object.create(M4());Q80.inherits=X1();var yg=I0("util"),t1=void 0;if(yg&&yg.debuglog)t1=yg.debuglog("stream");else t1=function(){};var zd0=f60(),J80=Eg(),UJ;Q80.inherits(P4,ug);var kg=["error","close","destroy","pause","resume"];function Ud0($,Y,z){if(typeof $.prependListener==="function")return $.prependListener(Y,z);if(!$._events||!$._events[Y])$.on(Y,z);else if(tp0($._events[Y]))$._events[Y].unshift(z);else $._events[Y]=[z,$._events[Y]]}function I80($,Y){oH=oH||sY(),$=$||{};var z=Y instanceof oH;if(this.objectMode=!!$.objectMode,z)this.objectMode=this.objectMode||!!$.readableObjectMode;var{highWaterMark:U,readableHighWaterMark:Q}=$,J=this.objectMode?16:16384;if(U||U===0)this.highWaterMark=U;else if(z&&(Q||Q===0))this.highWaterMark=Q;else this.highWaterMark=J;if(this.highWaterMark=Math.floor(this.highWaterMark),this.buffer=new zd0,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(!UJ)UJ=gg().StringDecoder;this.decoder=new UJ($.encoding),this.encoding=$.encoding}}function P4($){if(oH=oH||sY(),!(this instanceof P4))return new P4($);if(this._readableState=new I80($,this),this.readable=!0,$){if(typeof $.read==="function")this._read=$.read;if(typeof $.destroy==="function")this._destroy=$.destroy}ug.call(this)}Object.defineProperty(P4.prototype,"destroyed",{get:function(){if(this._readableState===void 0)return!1;return this._readableState.destroyed},set:function($){if(!this._readableState)return;this._readableState.destroyed=$}});P4.prototype.destroy=J80.destroy;P4.prototype._undestroy=J80.undestroy;P4.prototype._destroy=function($,Y){this.push(null),Y($)};P4.prototype.push=function($,Y){var z=this._readableState,U;if(!z.objectMode){if(typeof $==="string"){if(Y=Y||z.defaultEncoding,Y!==z.encoding)$=rH.from($,Y),Y="";U=!0}}else U=!0;return K80(this,$,Y,!1,U)};P4.prototype.unshift=function($){return K80(this,$,null,!0,!1)};function K80($,Y,z,U,Q){var J=$._readableState;if(Y===null)J.reading=!1,Kd0($,J);else{var I;if(!Q)I=Qd0(J,Y);if(I)$.emit("error",I);else if(J.objectMode||Y&&Y.length>0){if(typeof Y!=="string"&&!J.objectMode&&Object.getPrototypeOf(Y)!==rH.prototype)Y=$d0(Y);if(U)if(J.endEmitted)$.emit("error",Error("stream.unshift() after end event"));else xg($,J,Y,!0);else if(J.ended)$.emit("error",Error("stream.push() after EOF"));else if(J.reading=!1,J.decoder&&!z)if(Y=J.decoder.write(Y),J.objectMode||Y.length!==0)xg($,J,Y,!1);else G80($,J);else xg($,J,Y,!1)}else if(!U)J.reading=!1}return Jd0(J)}function xg($,Y,z,U){if(Y.flowing&&Y.length===0&&!Y.sync)$.emit("data",z),$.read(0);else{if(Y.length+=Y.objectMode?1:z.length,U)Y.buffer.unshift(z);else Y.buffer.push(z);if(Y.needReadable)sw($)}G80($,Y)}function Qd0($,Y){var z;if(!Yd0(Y)&&typeof Y!=="string"&&Y!==void 0&&!$.objectMode)z=TypeError("Invalid non-string/buffer chunk");return z}function Jd0($){return!$.ended&&($.needReadable||$.length<$.highWaterMark||$.length===0)}P4.prototype.isPaused=function(){return this._readableState.flowing===!1};P4.prototype.setEncoding=function($){if(!UJ)UJ=gg().StringDecoder;return this._readableState.decoder=new UJ($),this._readableState.encoding=$,this};var $80=8388608;function Id0($){if($>=$80)$=$80;else $--,$|=$>>>1,$|=$>>>2,$|=$>>>4,$|=$>>>8,$|=$>>>16,$++;return $}function Y80($,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=Id0($);if($<=Y.length)return $;if(!Y.ended)return Y.needReadable=!0,0;return Y.length}P4.prototype.read=function($){t1("read",$),$=parseInt($,10);var Y=this._readableState,z=$;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)fg(this);else sw(this);return null}if($=Y80($,Y),$===0&&Y.ended){if(Y.length===0)fg(this);return null}var U=Y.needReadable;if(t1("need readable",U),Y.length===0||Y.length-$0)Q=H80($,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(z!==$&&Y.ended)fg(this)}if(Q!==null)this.emit("data",Q);return Q};function Kd0($,Y){if(Y.ended)return;if(Y.decoder){var z=Y.decoder.end();if(z&&z.length)Y.buffer.push(z),Y.length+=Y.objectMode?1:z.length}Y.ended=!0,sw($)}function sw($){var Y=$._readableState;if(Y.needReadable=!1,!Y.emittedReadable)if(t1("emitReadable",Y.flowing),Y.emittedReadable=!0,Y.sync)QJ.nextTick(z80,$);else z80($)}function z80($){t1("emit readable"),$.emit("readable"),bg($)}function G80($,Y){if(!Y.readingMore)Y.readingMore=!0,QJ.nextTick(Gd0,$,Y)}function Gd0($,Y){var z=Y.length;while(!Y.reading&&!Y.flowing&&!Y.ended&&Y.length1&&W80(U.pipes,$)!==-1)&&!H)t1("false write response, pause",U.awaitDrain),U.awaitDrain++,X=!0;z.pause()}}function q(O){if(t1("onerror",O),w(),$.removeListener("error",q),U80($,"error")===0)$.emit("error",O)}Ud0($,"error",q);function V(){$.removeListener("finish",F),w()}$.once("close",V);function F(){t1("onfinish"),$.removeListener("close",V),w()}$.once("finish",F);function w(){t1("unpipe"),z.unpipe($)}if($.emit("pipe",z),!U.flowing)t1("pipe resume"),z.resume();return $};function Hd0($){return function(){var Y=$._readableState;if(t1("pipeOnDrain",Y.awaitDrain),Y.awaitDrain)Y.awaitDrain--;if(Y.awaitDrain===0&&U80($,"data"))Y.flowing=!0,bg($)}}P4.prototype.unpipe=function($){var Y=this._readableState,z={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,z);return this}if(!$){var{pipes:U,pipesCount:Q}=Y;Y.pipes=null,Y.pipesCount=0,Y.flowing=!1;for(var J=0;J=Y.length){if(Y.decoder)z=Y.buffer.join("");else if(Y.buffer.length===1)z=Y.buffer.head.data;else z=Y.buffer.concat(Y.length);Y.buffer.clear()}else z=qd0($,Y.buffer,Y.decoder);return z}function qd0($,Y,z){var U;if($J.length?J.length:$;if(I===J.length)Q+=J;else Q+=J.slice(0,$);if($-=I,$===0){if(I===J.length)if(++U,z.next)Y.head=z.next;else Y.head=Y.tail=null;else Y.head=z,z.data=J.slice(I);break}++U}return Y.length-=U,Q}function Ld0($,Y){var z=rH.allocUnsafe($),U=Y.head,Q=1;U.data.copy(z),$-=U.data.length;while(U=U.next){var J=U.data,I=$>J.length?J.length:$;if(J.copy(z,z.length-$,0,I),$-=I,$===0){if(I===J.length)if(++Q,U.next)Y.head=U.next;else Y.head=Y.tail=null;else Y.head=U,U.data=J.slice(I);break}++Q}return Y.length-=Q,z}function fg($){var Y=$._readableState;if(Y.length>0)throw Error('"endReadable()" called on non-empty stream');if(!Y.endEmitted)Y.ended=!0,QJ.nextTick(Fd0,Y,$)}function Fd0($,Y){if(!$.endEmitted&&$.length===0)$.endEmitted=!0,Y.readable=!1,Y.emit("end")}function W80($,Y){for(var z=0,U=$.length;z{V80.exports=J3;var aw=sY(),q80=Object.create(M4());q80.inherits=X1();q80.inherits(J3,aw);function Od0($,Y){var z=this._transformState;z.transforming=!1;var U=z.writecb;if(!U)return this.emit("error",Error("write callback called multiple times"));if(z.writechunk=null,z.writecb=null,Y!=null)this.push(Y);U($);var Q=this._readableState;if(Q.reading=!1,Q.needReadable||Q.length{O80.exports=sH;var L80=ig(),F80=Object.create(M4());F80.inherits=X1();F80.inherits(sH,L80);function sH($){if(!(this instanceof sH))return new sH($);L80.call(this,$)}sH.prototype._transform=function($,Y,z){z(null,$)}});var ng=E((m6,tw)=>{var e5=I0("stream");if(process.env.READABLE_STREAM==="disable"&&e5)tw.exports=e5,m6=tw.exports=e5.Readable,m6.Readable=e5.Readable,m6.Writable=e5.Writable,m6.Duplex=e5.Duplex,m6.Transform=e5.Transform,m6.PassThrough=e5.PassThrough,m6.Stream=e5;else m6=tw.exports=vg(),m6.Stream=e5||m6,m6.Readable=m6,m6.Writable=Rg(),m6.Duplex=sY(),m6.Transform=ig(),m6.PassThrough=w80()});var I3=E((Nd0)=>{Nd0.base64=!0;Nd0.array=!0;Nd0.string=!0;Nd0.arraybuffer=typeof ArrayBuffer<"u"&&typeof Uint8Array<"u";Nd0.nodebuffer=typeof Buffer<"u";Nd0.uint8array=typeof Uint8Array<"u";if(typeof ArrayBuffer>"u")Nd0.blob=!1;else{ew=new ArrayBuffer(0);try{Nd0.blob=new Blob([ew],{type:"application/zip"}).size===0}catch($){try{pg=self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder,$M=new pg,$M.append(ew),Nd0.blob=$M.getBlob("application/zip").size===0}catch(Y){Nd0.blob=!1}}}var ew,pg,$M;try{Nd0.nodestream=!!ng().Readable}catch($){Nd0.nodestream=!1}});var dg=E((Rd0)=>{var Ed0=c4(),Cd0=I3(),$9="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";Rd0.encode=function($){var Y=[],z,U,Q,J,I,K,G,H=0,W=$.length,X=W,Z=Ed0.getTypeOf($)!=="string";while(H<$.length){if(X=W-H,!Z)z=$.charCodeAt(H++),U=H>2,I=(z&3)<<4|U>>4,K=X>1?(U&15)<<2|Q>>6:64,G=X>2?Q&63:64,Y.push($9.charAt(J)+$9.charAt(I)+$9.charAt(K)+$9.charAt(G))}return Y.join("")};Rd0.decode=function($){var Y,z,U,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)===$9.charAt(64))X--;if($.charAt($.length-2)===$9.charAt(64))X--;if(X%1!==0)throw Error("Invalid base64 input, bad content length.");var Z;if(Cd0.uint8array)Z=new Uint8Array(X|0);else Z=Array(X|0);while(G<$.length){if(Q=$9.indexOf($.charAt(G++)),J=$9.indexOf($.charAt(G++)),I=$9.indexOf($.charAt(G++)),K=$9.indexOf($.charAt(G++)),Y=Q<<2|J>>4,z=(J&15)<<4|I>>2,U=(I&3)<<6|K,Z[H++]=Y,I!==64)Z[H++]=z;if(K!==64)Z[H++]=U}return Z}});var aH=E((Od1,M80)=>{M80.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 A80=E((Md1,D80)=>{var wd1=global.MutationObserver||global.WebKitMutationObserver,N80;N80=function(){process.nextTick(kd0)};var hd0,Sd0,gd0,yd0,mg,tH=[];function kd0(){mg=!0;var $,Y,z=tH.length;while(z){Y=tH,tH=[],$=-1;while(++${var B80=A80();function IJ(){}var X8={},P80=["REJECTED"],lg=["FULFILLED"],j80=["PENDING"];JJ=["UNHANDLED"];var JJ;C80.exports=u7;function u7($){if(typeof $!=="function")throw TypeError("resolver must be a function");if(this.state=j80,this.queue=[],this.outcome=void 0,this.handled=JJ,$!==IJ)T80(this,$)}u7.prototype.finally=function($){if(typeof $!=="function")return this;var Y=this.constructor;return this.then(z,U);function z(Q){function J(){return Q}return Y.resolve($()).then(J)}function U(Q){function J(){throw Q}return Y.resolve($()).then(J)}};u7.prototype.catch=function($){return this.then(null,$)};u7.prototype.then=function($,Y){if(typeof $!=="function"&&this.state===lg||typeof Y!=="function"&&this.state===P80)return this;var z=new this.constructor(IJ);if(this.handled===JJ)this.handled=null;if(this.state!==j80){var U=this.state===lg?$:Y;og(z,U,this.outcome)}else this.queue.push(new eH(z,$,Y));return z};function eH($,Y,z){if(this.promise=$,typeof Y==="function")this.onFulfilled=Y,this.callFulfilled=this.otherCallFulfilled;if(typeof z==="function")this.onRejected=z,this.callRejected=this.otherCallRejected}eH.prototype.callFulfilled=function($){X8.resolve(this.promise,$)};eH.prototype.otherCallFulfilled=function($){og(this.promise,this.onFulfilled,$)};eH.prototype.callRejected=function($){X8.reject(this.promise,$)};eH.prototype.otherCallRejected=function($){og(this.promise,this.onRejected,$)};function og($,Y,z){B80(function(){var U;try{U=Y(z)}catch(Q){return X8.reject($,Q)}if(U===$)X8.reject($,TypeError("Cannot resolve promise with itself"));else X8.resolve($,U)})}X8.resolve=function($,Y){var z=E80(fd0,Y);if(z.status==="error")return X8.reject($,z.value);var U=z.value;if(U)T80($,U);else{$.state=lg,$.outcome=Y;var Q=-1,J=$.queue.length;while(++Q{var rg=null;if(typeof Promise<"u")rg=Promise;else rg=R80();_80.exports={Promise:rg}});var sg=E((v80)=>{(function($,Y){if($.setImmediate)return;var z=1,U={},Q=!1,J=$.document,I;function K(N){if(typeof N!=="function")N=Function(""+N);var M=Array(arguments.length-1);for(var D=0;D"u"?typeof global>"u"?v80:global:self)});var c4=E((dd0)=>{var b7=I3(),cd0=dg(),GJ=aH(),ag=KJ();sg();function pd0($){var Y=null;if(b7.uint8array)Y=new Uint8Array($.length);else Y=Array($.length);return zM($,Y)}dd0.newBlob=function($,Y){dd0.checkSupport("blob");try{return new Blob([$],{type:Y})}catch(Q){try{var z=self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder,U=new z;return U.append($),U.getBlob(Y)}catch(J){throw Error("Bug : can't construct the Blob.")}}};function $W($){return $}function zM($,Y){for(var z=0;z<$.length;++z)Y[z]=$.charCodeAt(z)&255;return Y}var YM={stringifyByChunk:function($,Y,z){var U=[],Q=0,J=$.length;if(J<=z)return String.fromCharCode.apply(null,$);while(Q1)try{return YM.stringifyByChunk($,z,Y)}catch(Q){Y=Math.floor(Y/2)}return YM.stringifyByChar($)}dd0.applyFromCharCode=YW;function UM($,Y){for(var z=0;z<$.length;z++)Y[z]=$[z];return Y}var i7={};i7.string={string:$W,array:function($){return zM($,Array($.length))},arraybuffer:function($){return i7.string.uint8array($).buffer},uint8array:function($){return zM($,new Uint8Array($.length))},nodebuffer:function($){return zM($,GJ.allocBuffer($.length))}};i7.array={string:YW,array:$W,arraybuffer:function($){return new Uint8Array($).buffer},uint8array:function($){return new Uint8Array($)},nodebuffer:function($){return GJ.newBufferFrom($)}};i7.arraybuffer={string:function($){return YW(new Uint8Array($))},array:function($){return UM(new Uint8Array($),Array($.byteLength))},arraybuffer:$W,uint8array:function($){return new Uint8Array($)},nodebuffer:function($){return GJ.newBufferFrom(new Uint8Array($))}};i7.uint8array={string:YW,array:function($){return UM($,Array($.length))},arraybuffer:function($){return $.buffer},uint8array:$W,nodebuffer:function($){return GJ.newBufferFrom($)}};i7.nodebuffer={string:YW,array:function($){return UM($,Array($.length))},arraybuffer:function($){return i7.nodebuffer.uint8array($).buffer},uint8array:function($){return UM($,new Uint8Array($.length))},nodebuffer:$W};dd0.transformTo=function($,Y){if(!Y)Y="";if(!$)return Y;dd0.checkSupport($);var z=dd0.getTypeOf(Y),U=i7[z][$](Y);return U};dd0.resolve=function($){var Y=$.split("/"),z=[];for(var U=0;U"u")$[z]=arguments[Y][z];return $};dd0.prepareContent=function($,Y,z,U,Q){var J=ag.Promise.resolve(Y).then(function(I){var K=b7.blob&&(I instanceof Blob||["[object File]","[object Blob]"].indexOf(Object.prototype.toString.call(I))!==-1);if(K&&typeof FileReader<"u")return new ag.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=dd0.getTypeOf(I);if(!K)return ag.Promise.reject(Error("Can't read the data of '"+$+"'. Is it in a supported JavaScript type (String, Blob, ArrayBuffer, etc) ?"));if(K==="arraybuffer")I=dd0.transformTo("uint8array",I);else if(K==="string"){if(Q)I=cd0.decode(I);else if(z){if(U!==!0)I=pd0(I)}}return I})}});var K$=E((Pd1,y80)=>{function g80($){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}g80.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 z=0;z "+$;else return $}};y80.exports=g80});var WJ=E((Im0)=>{var HJ=c4(),aY=I3(),zm0=aH(),QM=K$(),zW=Array(256);for(Y9=0;Y9<256;Y9++)zW[Y9]=Y9>=252?6:Y9>=248?5:Y9>=240?4:Y9>=224?3:Y9>=192?2:1;var Y9;zW[254]=zW[254]=1;var Um0=function($){var Y,z,U,Q,J,I=$.length,K=0;for(Q=0;Q>>6,Y[J++]=128|z&63;else if(z<65536)Y[J++]=224|z>>>12,Y[J++]=128|z>>>6&63,Y[J++]=128|z&63;else Y[J++]=240|z>>>18,Y[J++]=128|z>>>12&63,Y[J++]=128|z>>>6&63,Y[J++]=128|z&63}return Y},Qm0=function($,Y){var z;if(Y=Y||$.length,Y>$.length)Y=$.length;z=Y-1;while(z>=0&&($[z]&192)===128)z--;if(z<0)return Y;if(z===0)return Y;return z+zW[$[z]]>Y?z:Y},Jm0=function($){var Y,z,U,Q,J=$.length,I=Array(J*2);for(z=0,Y=0;Y4){I[z++]=65533,Y+=Q-1;continue}U&=Q===2?31:Q===3?15:7;while(Q>1&&Y1){I[z++]=65533;continue}if(U<65536)I[z++]=U;else U-=65536,I[z++]=55296|U>>10&1023,I[z++]=56320|U&1023}if(I.length!==z)if(I.subarray)I=I.subarray(0,z);else I.length=z;return HJ.applyFromCharCode(I)};Im0.utf8encode=function(Y){if(aY.nodebuffer)return zm0.newBufferFrom(Y,"utf-8");return Um0(Y)};Im0.utf8decode=function(Y){if(aY.nodebuffer)return HJ.transformTo("nodebuffer",Y).toString("utf-8");return Y=HJ.transformTo(aY.uint8array?"uint8array":"array",Y),Jm0(Y)};function JM(){QM.call(this,"utf-8 decode"),this.leftOver=null}HJ.inherits(JM,QM);JM.prototype.processChunk=function($){var Y=HJ.transformTo(aY.uint8array?"uint8array":"array",$.data);if(this.leftOver&&this.leftOver.length){if(aY.uint8array){var z=Y;Y=new Uint8Array(z.length+this.leftOver.length),Y.set(this.leftOver,0),Y.set(z,this.leftOver.length)}else Y=this.leftOver.concat(Y);this.leftOver=null}var U=Qm0(Y),Q=Y;if(U!==Y.length)if(aY.uint8array)Q=Y.subarray(0,U),this.leftOver=Y.subarray(U,Y.length);else Q=Y.slice(0,U),this.leftOver=Y.slice(U,Y.length);this.push({data:Im0.utf8decode(Q),meta:$.meta})};JM.prototype.flush=function(){if(this.leftOver&&this.leftOver.length)this.push({data:Im0.utf8decode(this.leftOver),meta:{}}),this.leftOver=null};Im0.Utf8DecodeWorker=JM;function eg(){QM.call(this,"utf-8 encode")}HJ.inherits(eg,QM);eg.prototype.processChunk=function($){this.push({data:Im0.utf8encode($.data),meta:$.meta})};Im0.Utf8EncodeWorker=eg});var b80=E((Td1,u80)=>{var x80=K$(),f80=c4();function Yy($){x80.call(this,"ConvertWorker to "+$),this.destType=$}f80.inherits(Yy,x80);Yy.prototype.processChunk=function($){this.push({data:f80.transformTo(this.destType,$.data),meta:$.meta})};u80.exports=Yy});var c80=E((Ed1,n80)=>{var i80=ng().Readable,Hm0=c4();Hm0.inherits(zy,i80);function zy($,Y,z){i80.call(this,Y),this._helper=$;var U=this;$.on("data",function(Q,J){if(!U.push(Q))U._helper.pause();if(z)z(J)}).on("error",function(Q){U.emit("error",Q)}).on("end",function(){U.push(null)})}zy.prototype._read=function(){this._helper.resume()};n80.exports=zy});var Uy=E((Cd1,m80)=>{var tY=c4(),Wm0=b80(),Xm0=K$(),Zm0=dg(),qm0=I3(),Vm0=KJ(),p80=null;if(qm0.nodestream)try{p80=c80()}catch($){}function Lm0($,Y,z){switch($){case"blob":return tY.newBlob(tY.transformTo("arraybuffer",Y),z);case"base64":return Zm0.encode(Y);default:return tY.transformTo($,Y)}}function Fm0($,Y){var z,U=0,Q=null,J=0;for(z=0;z{wm0.base64=!1;wm0.binary=!1;wm0.dir=!1;wm0.createFolders=!0;wm0.date=null;wm0.compression=null;wm0.compressionOptions=null;wm0.comment=null;wm0.unixPermissions=null;wm0.dosPermissions=null});var Jy=E((_d1,l80)=>{var IM=c4(),KM=K$(),Rm0=16384;function XJ($){KM.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(z){if(Y.dataIsReady=!0,Y.data=z,Y.max=z&&z.length||0,Y.type=IM.getTypeOf(z),!Y.isPaused)Y._tickAndRepeat()},function(z){Y.error(z)})}IM.inherits(XJ,KM);XJ.prototype.cleanUp=function(){KM.prototype.cleanUp.call(this),this.data=null};XJ.prototype.resume=function(){if(!KM.prototype.resume.call(this))return!1;if(!this._tickScheduled&&this.dataIsReady)this._tickScheduled=!0,IM.delay(this._tickAndRepeat,[],this);return!0};XJ.prototype._tickAndRepeat=function(){if(this._tickScheduled=!1,this.isPaused||this.isFinished)return;if(this._tick(),!this.isFinished)IM.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0};XJ.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var $=Rm0,Y=null,z=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,z);break;case"uint8array":Y=this.data.subarray(this.index,z);break;case"array":case"nodebuffer":Y=this.data.slice(this.index,z);break}return this.index=z,this.push({data:Y,meta:{percent:this.max?this.index/this.max*100:0}})}};l80.exports=XJ});var GM=E((vd1,r80)=>{var _m0=c4();function vm0(){var $,Y=[];for(var z=0;z<256;z++){$=z;for(var U=0;U<8;U++)$=$&1?3988292384^$>>>1:$>>>1;Y[z]=$}return Y}var o80=vm0();function hm0($,Y,z,U){var Q=o80,J=U+z;$=$^-1;for(var I=U;I>>8^Q[($^Y[I])&255];return $^-1}function Sm0($,Y,z,U){var Q=o80,J=U+z;$=$^-1;for(var I=U;I>>8^Q[($^Y.charCodeAt(I))&255];return $^-1}r80.exports=function(Y,z){if(typeof Y>"u"||!Y.length)return 0;var U=_m0.getTypeOf(Y)!=="string";if(U)return hm0(z|0,Y,Y.length,0);else return Sm0(z|0,Y,Y.length,0)}});var Ky=E((hd1,a80)=>{var s80=K$(),gm0=GM(),ym0=c4();function Iy(){s80.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0)}ym0.inherits(Iy,s80);Iy.prototype.processChunk=function($){this.streamInfo.crc32=gm0($.data,this.streamInfo.crc32||0),this.push($)};a80.exports=Iy});var e80=E((Sd1,t80)=>{var km0=c4(),Gy=K$();function Hy($){Gy.call(this,"DataLengthProbe for "+$),this.propName=$,this.withStreamInfo($,0)}km0.inherits(Hy,Gy);Hy.prototype.processChunk=function($){if($){var Y=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=Y+$.data.length}Gy.prototype.processChunk.call(this,$)};t80.exports=Hy});var HM=E((gd1,z$0)=>{var $$0=KJ(),Y$0=Jy(),xm0=Ky(),Wy=e80();function Xy($,Y,z,U,Q){this.compressedSize=$,this.uncompressedSize=Y,this.crc32=z,this.compression=U,this.compressedContent=Q}Xy.prototype={getContentWorker:function(){var $=new Y$0($$0.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new Wy("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 Y$0($$0.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize",this.compressedSize).withStreamInfo("uncompressedSize",this.uncompressedSize).withStreamInfo("crc32",this.crc32).withStreamInfo("compression",this.compression)}};Xy.createWorkerFrom=function($,Y,z){return $.pipe(new xm0).pipe(new Wy("uncompressedSize")).pipe(Y.compressWorker(z)).pipe(new Wy("compressedSize")).withStreamInfo("compression",Y)};z$0.exports=Xy});var I$0=E((yd1,J$0)=>{var fm0=Uy(),um0=Jy(),Zy=WJ(),qy=HM(),U$0=K$(),Vy=function($,Y,z){this.name=$,this.dir=z.dir,this.date=z.date,this.comment=z.comment,this.unixPermissions=z.unixPermissions,this.dosPermissions=z.dosPermissions,this._data=Y,this._dataBinary=z.binary,this.options={compression:z.compression,compressionOptions:z.compressionOptions}};Vy.prototype={internalStream:function($){var Y=null,z="string";try{if(!$)throw Error("No output type specified.");z=$.toLowerCase();var U=z==="string"||z==="text";if(z==="binarystring"||z==="text")z="string";Y=this._decompressWorker();var Q=!this._dataBinary;if(Q&&!U)Y=Y.pipe(new Zy.Utf8EncodeWorker);if(!Q&&U)Y=Y.pipe(new Zy.Utf8DecodeWorker)}catch(J){Y=new U$0("error"),Y.error(J)}return new fm0(Y,z,"")},async:function($,Y){return this.internalStream($).accumulate(Y)},nodeStream:function($,Y){return this.internalStream($||"nodebuffer").toNodejsStream(Y)},_compressWorker:function($,Y){if(this._data instanceof qy&&this._data.compression.magic===$.magic)return this._data.getCompressedWorker();else{var z=this._decompressWorker();if(!this._dataBinary)z=z.pipe(new Zy.Utf8EncodeWorker);return qy.createWorkerFrom(z,$,Y)}},_decompressWorker:function(){if(this._data instanceof qy)return this._data.getContentWorker();else if(this._data instanceof U$0)return this._data;else return new um0(this._data)}};var Q$0=["asText","asBinary","asNodeBuffer","asUint8Array","asArrayBuffer"],bm0=function(){throw Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")};for(UW=0;UW{var pm0=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Int32Array<"u";function dm0($,Y){return Object.prototype.hasOwnProperty.call($,Y)}Ly.assign=function($){var Y=Array.prototype.slice.call(arguments,1);while(Y.length){var z=Y.shift();if(!z)continue;if(typeof z!=="object")throw TypeError(z+"must be non-object");for(var U in z)if(dm0(z,U))$[U]=z[U]}return $};Ly.shrinkBuf=function($,Y){if($.length===Y)return $;if($.subarray)return $.subarray(0,Y);return $.length=Y,$};var mm0={arraySet:function($,Y,z,U,Q){if(Y.subarray&&$.subarray){$.set(Y.subarray(z,z+U),Q);return}for(var J=0;J{var rm0=K3(),sm0=4,G$0=0,H$0=1,am0=2;function qJ($){var Y=$.length;while(--Y>=0)$[Y]=0}var tm0=0,L$0=1,em0=2,$l0=3,Yl0=258,By=29,HW=256,JW=HW+1+By,ZJ=30,Py=19,F$0=2*JW+1,eY=15,Oy=16,zl0=7,jy=256,O$0=16,w$0=17,M$0=18,Dy=[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],WM=[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],Ul0=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],N$0=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],Ql0=512,G3=Array((JW+2)*2);qJ(G3);var QW=Array(ZJ*2);qJ(QW);var IW=Array(Ql0);qJ(IW);var KW=Array(Yl0-$l0+1);qJ(KW);var Ty=Array(By);qJ(Ty);var XM=Array(ZJ);qJ(XM);function wy($,Y,z,U,Q){this.static_tree=$,this.extra_bits=Y,this.extra_base=z,this.elems=U,this.max_length=Q,this.has_stree=$&&$.length}var D$0,A$0,B$0;function My($,Y){this.dyn_tree=$,this.max_code=0,this.stat_desc=Y}function P$0($){return $<256?IW[$]:IW[256+($>>>7)]}function GW($,Y){$.pending_buf[$.pending++]=Y&255,$.pending_buf[$.pending++]=Y>>>8&255}function p8($,Y,z){if($.bi_valid>Oy-z)$.bi_buf|=Y<<$.bi_valid&65535,GW($,$.bi_buf),$.bi_buf=Y>>Oy-$.bi_valid,$.bi_valid+=z-Oy;else $.bi_buf|=Y<<$.bi_valid&65535,$.bi_valid+=z}function z9($,Y,z){p8($,z[Y*2],z[Y*2+1])}function j$0($,Y){var z=0;do z|=$&1,$>>>=1,z<<=1;while(--Y>0);return z>>>1}function Jl0($){if($.bi_valid===16)GW($,$.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 Il0($,Y){var{dyn_tree:z,max_code:U}=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<=eY;Z++)$.bl_count[Z]=0;z[$.heap[$.heap_max]*2+1]=0;for(H=$.heap_max+1;HG)Z=G,F++;if(z[W*2+1]=Z,W>U)continue;if($.bl_count[Z]++,q=0,W>=K)q=I[W-K];if(V=z[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>U)continue;if(z[X*2+1]!==Z)$.opt_len+=(Z-z[X*2+1])*z[X*2],z[X*2+1]=Z;W--}}}function T$0($,Y,z){var U=Array(eY+1),Q=0,J,I;for(J=1;J<=eY;J++)U[J]=Q=Q+z[J-1]<<1;for(I=0;I<=Y;I++){var K=$[I*2+1];if(K===0)continue;$[I*2]=j$0(U[K]++,K)}}function Kl0(){var $,Y,z,U,Q,J=Array(eY+1);z=0;for(U=0;U>=7;for(;U8)GW($,$.bi_buf);else if($.bi_valid>0)$.pending_buf[$.pending++]=$.bi_buf;$.bi_buf=0,$.bi_valid=0}function Gl0($,Y,z,U){if(C$0($),U)GW($,z),GW($,~z);rm0.arraySet($.pending_buf,$.window,Y,z,$.pending),$.pending+=z}function W$0($,Y,z,U){var Q=Y*2,J=z*2;return $[Q]<$[J]||$[Q]===$[J]&&U[Y]<=U[z]}function Ny($,Y,z){var U=$.heap[z],Q=z<<1;while(Q<=$.heap_len){if(Q<$.heap_len&&W$0(Y,$.heap[Q+1],$.heap[Q],$.depth))Q++;if(W$0(Y,U,$.heap[Q],$.depth))break;$.heap[z]=$.heap[Q],z=Q,Q<<=1}$.heap[z]=U}function X$0($,Y,z){var U,Q,J=0,I,K;if($.last_lit!==0)do if(U=$.pending_buf[$.d_buf+J*2]<<8|$.pending_buf[$.d_buf+J*2+1],Q=$.pending_buf[$.l_buf+J],J++,U===0)z9($,Q,Y);else{if(I=KW[Q],z9($,I+HW+1,Y),K=Dy[I],K!==0)Q-=Ty[I],p8($,Q,K);if(U--,I=P$0(U),z9($,I,z),K=WM[I],K!==0)U-=XM[I],p8($,U,K)}while(J<$.last_lit);z9($,jy,Y)}function Ay($,Y){var z=Y.dyn_tree,U=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=F$0;for(I=0;I>1;I>=1;I--)Ny($,z,I);H=J;do I=$.heap[1],$.heap[1]=$.heap[$.heap_len--],Ny($,z,1),K=$.heap[1],$.heap[--$.heap_max]=I,$.heap[--$.heap_max]=K,z[H*2]=z[I*2]+z[K*2],$.depth[H]=($.depth[I]>=$.depth[K]?$.depth[I]:$.depth[K])+1,z[I*2+1]=z[K*2+1]=H,$.heap[1]=H++,Ny($,z,1);while($.heap_len>=2);$.heap[--$.heap_max]=$.heap[1],Il0($,Y),T$0(z,G,$.bl_count)}function Z$0($,Y,z){var U,Q=-1,J,I=Y[1],K=0,G=7,H=4;if(I===0)G=138,H=3;Y[(z+1)*2+1]=65535;for(U=0;U<=z;U++){if(J=I,I=Y[(U+1)*2+1],++K=3;Y--)if($.bl_tree[N$0[Y]*2+1]!==0)break;return $.opt_len+=3*(Y+1)+5+5+4,Y}function Wl0($,Y,z,U){var Q;p8($,Y-257,5),p8($,z-1,5),p8($,U-4,4);for(Q=0;Q>>=1)if(Y&1&&$.dyn_ltree[z*2]!==0)return G$0;if($.dyn_ltree[18]!==0||$.dyn_ltree[20]!==0||$.dyn_ltree[26]!==0)return H$0;for(z=32;z0){if($.strm.data_type===am0)$.strm.data_type=Xl0($);if(Ay($,$.l_desc),Ay($,$.d_desc),I=Hl0($),Q=$.opt_len+3+7>>>3,J=$.static_len+3+7>>>3,J<=Q)Q=J}else Q=J=z+5;if(z+4<=Q&&Y!==-1)R$0($,Y,z,U);else if($.strategy===sm0||J===Q)p8($,(L$0<<1)+(U?1:0),3),X$0($,G3,QW);else p8($,(em0<<1)+(U?1:0),3),Wl0($,$.l_desc.max_code+1,$.d_desc.max_code+1,I+1),X$0($,$.dyn_ltree,$.dyn_dtree);if(E$0($),U)C$0($)}function Ll0($,Y,z){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]=z&255,$.last_lit++,Y===0)$.dyn_ltree[z*2]++;else $.matches++,Y--,$.dyn_ltree[(KW[z]+HW+1)*2]++,$.dyn_dtree[P$0(Y)*2]++;return $.last_lit===$.lit_bufsize-1}Fl0._tr_init=Zl0;Fl0._tr_stored_block=R$0;Fl0._tr_flush_block=Vl0;Fl0._tr_tally=Ll0;Fl0._tr_align=ql0});var Ey=E((fd1,v$0)=>{function Al0($,Y,z,U){var Q=$&65535|0,J=$>>>16&65535|0,I=0;while(z!==0){I=z>2000?2000:z,z-=I;do Q=Q+Y[U++]|0,J=J+Q|0;while(--I);Q%=65521,J%=65521}return Q|J<<16|0}v$0.exports=Al0});var Cy=E((ud1,h$0)=>{function Bl0(){var $,Y=[];for(var z=0;z<256;z++){$=z;for(var U=0;U<8;U++)$=$&1?3988292384^$>>>1:$>>>1;Y[z]=$}return Y}var Pl0=Bl0();function jl0($,Y,z,U){var Q=Pl0,J=U+z;$^=-1;for(var I=U;I>>8^Q[($^Y[I])&255];return $^-1}h$0.exports=jl0});var ZM=E((bd1,S$0)=>{S$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((Qo0)=>{var E8=K3(),E$=_$0(),x$0=Ey(),n7=Cy(),Tl0=ZM(),Uz=0,El0=1,Cl0=3,l7=4,g$0=5,Q9=0,y$0=1,C$=-2,Rl0=-3,Ry=-5,_l0=-1,vl0=1,qM=2,hl0=3,Sl0=4,gl0=0,yl0=2,OM=8,kl0=9,xl0=15,fl0=8,ul0=29,bl0=256,vy=bl0+1+ul0,il0=30,nl0=19,cl0=2*vy+1,pl0=15,f1=3,d7=258,X5=d7+f1+1,dl0=32,wM=42,hy=69,VM=73,LM=91,FM=103,$z=113,XW=666,P6=1,ZW=2,Yz=3,FJ=4,ml0=3;function m7($,Y){return $.msg=Tl0[Y],Y}function k$0($){return($<<1)-($>4?9:0)}function p7($){var Y=$.length;while(--Y>=0)$[Y]=0}function c7($){var Y=$.state,z=Y.pending;if(z>$.avail_out)z=$.avail_out;if(z===0)return;if(E8.arraySet($.output,Y.pending_buf,Y.pending_out,z,$.next_out),$.next_out+=z,Y.pending_out+=z,$.total_out+=z,$.avail_out-=z,Y.pending-=z,Y.pending===0)Y.pending_out=0}function l6($,Y){E$._tr_flush_block($,$.block_start>=0?$.block_start:-1,$.strstart-$.block_start,Y),$.block_start=$.strstart,c7($.strm)}function r1($,Y){$.pending_buf[$.pending++]=Y}function WW($,Y){$.pending_buf[$.pending++]=Y>>>8&255,$.pending_buf[$.pending++]=Y&255}function ll0($,Y,z,U){var Q=$.avail_in;if(Q>U)Q=U;if(Q===0)return 0;if($.avail_in-=Q,E8.arraySet(Y,$.input,$.next_in,Q,z),$.state.wrap===1)$.adler=x$0($.adler,Y,Q,z);else if($.state.wrap===2)$.adler=n7($.adler,Y,Q,z);return $.next_in+=Q,$.total_in+=Q,Q}function f$0($,Y){var{max_chain_length:z,strstart:U}=$,Q,J,I=$.prev_length,K=$.nice_match,G=$.strstart>$.w_size-X5?$.strstart-($.w_size-X5):0,H=$.window,W=$.w_mask,X=$.prev,Z=$.strstart+d7,q=H[U+I-1],V=H[U+I];if($.prev_length>=$.good_match)z>>=2;if(K>$.lookahead)K=$.lookahead;do{if(Q=Y,H[Q+I]!==V||H[Q+I-1]!==q||H[Q]!==H[U]||H[++Q]!==H[U+1])continue;U+=2,Q++;do;while(H[++U]===H[++Q]&&H[++U]===H[++Q]&&H[++U]===H[++Q]&&H[++U]===H[++Q]&&H[++U]===H[++Q]&&H[++U]===H[++Q]&&H[++U]===H[++Q]&&H[++U]===H[++Q]&&UI){if($.match_start=Y,I=J,J>=K)break;q=H[U+I-1],V=H[U+I]}}while((Y=X[Y&W])>G&&--z!==0);if(I<=$.lookahead)return I;return $.lookahead}function zz($){var Y=$.w_size,z,U,Q,J,I;do{if(J=$.window_size-$.lookahead-$.strstart,$.strstart>=Y+(Y-X5)){E8.arraySet($.window,$.window,Y,Y,0),$.match_start-=Y,$.strstart-=Y,$.block_start-=Y,U=$.hash_size,z=U;do Q=$.head[--z],$.head[z]=Q>=Y?Q-Y:0;while(--U);U=Y,z=U;do Q=$.prev[--z],$.prev[z]=Q>=Y?Q-Y:0;while(--U);J+=Y}if($.strm.avail_in===0)break;if(U=ll0($.strm,$.window,$.strstart+$.lookahead,J),$.lookahead+=U,$.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)z=$.pending_buf_size-5;for(;;){if($.lookahead<=1){if(zz($),$.lookahead===0&&Y===Uz)return P6;if($.lookahead===0)break}$.strstart+=$.lookahead,$.lookahead=0;var U=$.block_start+z;if($.strstart===0||$.strstart>=U){if($.lookahead=$.strstart-U,$.strstart=U,l6($,!1),$.strm.avail_out===0)return P6}if($.strstart-$.block_start>=$.w_size-X5){if(l6($,!1),$.strm.avail_out===0)return P6}}if($.insert=0,Y===l7){if(l6($,!0),$.strm.avail_out===0)return Yz;return FJ}if($.strstart>$.block_start){if(l6($,!1),$.strm.avail_out===0)return P6}return P6}function _y($,Y){var z,U;for(;;){if($.lookahead=f1)$.ins_h=($.ins_h<<$.hash_shift^$.window[$.strstart+f1-1])&$.hash_mask,z=$.prev[$.strstart&$.w_mask]=$.head[$.ins_h],$.head[$.ins_h]=$.strstart;if(z!==0&&$.strstart-z<=$.w_size-X5)$.match_length=f$0($,z);if($.match_length>=f1)if(U=E$._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,z=$.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 U=E$._tr_tally($,0,$.window[$.strstart]),$.lookahead--,$.strstart++;if(U){if(l6($,!1),$.strm.avail_out===0)return P6}}if($.insert=$.strstart=f1)$.ins_h=($.ins_h<<$.hash_shift^$.window[$.strstart+f1-1])&$.hash_mask,z=$.prev[$.strstart&$.w_mask]=$.head[$.ins_h],$.head[$.ins_h]=$.strstart;if($.prev_length=$.match_length,$.prev_match=$.match_start,$.match_length=f1-1,z!==0&&$.prev_length<$.max_lazy_match&&$.strstart-z<=$.w_size-X5){if($.match_length=f$0($,z),$.match_length<=5&&($.strategy===vl0||$.match_length===f1&&$.strstart-$.match_start>4096))$.match_length=f1-1}if($.prev_length>=f1&&$.match_length<=$.prev_length){Q=$.strstart+$.lookahead-f1,U=E$._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,z=$.prev[$.strstart&$.w_mask]=$.head[$.ins_h],$.head[$.ins_h]=$.strstart;while(--$.prev_length!==0);if($.match_available=0,$.match_length=f1-1,$.strstart++,U){if(l6($,!1),$.strm.avail_out===0)return P6}}else if($.match_available){if(U=E$._tr_tally($,0,$.window[$.strstart-1]),U)l6($,!1);if($.strstart++,$.lookahead--,$.strm.avail_out===0)return P6}else $.match_available=1,$.strstart++,$.lookahead--}if($.match_available)U=E$._tr_tally($,0,$.window[$.strstart-1]),$.match_available=0;if($.insert=$.strstart=f1&&$.strstart>0){if(Q=$.strstart-1,U=I[Q],U===I[++Q]&&U===I[++Q]&&U===I[++Q]){J=$.strstart+d7;do;while(U===I[++Q]&&U===I[++Q]&&U===I[++Q]&&U===I[++Q]&&U===I[++Q]&&U===I[++Q]&&U===I[++Q]&&U===I[++Q]&&Q$.lookahead)$.match_length=$.lookahead}}if($.match_length>=f1)z=E$._tr_tally($,1,$.match_length-f1),$.lookahead-=$.match_length,$.strstart+=$.match_length,$.match_length=0;else z=E$._tr_tally($,0,$.window[$.strstart]),$.lookahead--,$.strstart++;if(z){if(l6($,!1),$.strm.avail_out===0)return P6}}if($.insert=0,Y===l7){if(l6($,!0),$.strm.avail_out===0)return Yz;return FJ}if($.last_lit){if(l6($,!1),$.strm.avail_out===0)return P6}return ZW}function sl0($,Y){var z;for(;;){if($.lookahead===0){if(zz($),$.lookahead===0){if(Y===Uz)return P6;break}}if($.match_length=0,z=E$._tr_tally($,0,$.window[$.strstart]),$.lookahead--,$.strstart++,z){if(l6($,!1),$.strm.avail_out===0)return P6}}if($.insert=0,Y===l7){if(l6($,!0),$.strm.avail_out===0)return Yz;return FJ}if($.last_lit){if(l6($,!1),$.strm.avail_out===0)return P6}return ZW}function U9($,Y,z,U,Q){this.good_length=$,this.max_lazy=Y,this.nice_length=z,this.max_chain=U,this.func=Q}var LJ;LJ=[new U9(0,0,0,0,ol0),new U9(4,4,8,4,_y),new U9(4,5,16,8,_y),new U9(4,6,32,32,_y),new U9(4,4,16,16,VJ),new U9(8,16,32,32,VJ),new U9(8,16,128,128,VJ),new U9(8,32,128,256,VJ),new U9(32,128,258,1024,VJ),new U9(32,258,258,4096,VJ)];function al0($){$.window_size=2*$.w_size,p7($.head),$.max_lazy_match=LJ[$.level].max_lazy,$.good_match=LJ[$.level].good_length,$.nice_match=LJ[$.level].nice_length,$.max_chain_length=LJ[$.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 tl0(){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=OM,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 E8.Buf16(cl0*2),this.dyn_dtree=new E8.Buf16((2*il0+1)*2),this.bl_tree=new E8.Buf16((2*nl0+1)*2),p7(this.dyn_ltree),p7(this.dyn_dtree),p7(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new E8.Buf16(pl0+1),this.heap=new E8.Buf16(2*vy+1),p7(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new E8.Buf16(2*vy+1),p7(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 u$0($){var Y;if(!$||!$.state)return m7($,C$);if($.total_in=$.total_out=0,$.data_type=yl0,Y=$.state,Y.pending=0,Y.pending_out=0,Y.wrap<0)Y.wrap=-Y.wrap;return Y.status=Y.wrap?wM:$z,$.adler=Y.wrap===2?0:1,Y.last_flush=Uz,E$._tr_init(Y),Q9}function b$0($){var Y=u$0($);if(Y===Q9)al0($.state);return Y}function el0($,Y){if(!$||!$.state)return C$;if($.state.wrap!==2)return C$;return $.state.gzhead=Y,Q9}function i$0($,Y,z,U,Q,J){if(!$)return C$;var I=1;if(Y===_l0)Y=6;if(U<0)I=0,U=-U;else if(U>15)I=2,U-=16;if(Q<1||Q>kl0||z!==OM||U<8||U>15||Y<0||Y>9||J<0||J>Sl0)return m7($,C$);if(U===8)U=9;var K=new tl0;return $.state=K,K.strm=$,K.wrap=I,K.gzhead=null,K.w_bits=U,K.w_size=1<g$0||Y<0)return $?m7($,C$):C$;if(U=$.state,!$.output||!$.input&&$.avail_in!==0||U.status===XW&&Y!==l7)return m7($,$.avail_out===0?Ry:C$);if(U.strm=$,z=U.last_flush,U.last_flush=Y,U.status===wM)if(U.wrap===2)if($.adler=0,r1(U,31),r1(U,139),r1(U,8),!U.gzhead)r1(U,0),r1(U,0),r1(U,0),r1(U,0),r1(U,0),r1(U,U.level===9?2:U.strategy>=qM||U.level<2?4:0),r1(U,ml0),U.status=$z;else{if(r1(U,(U.gzhead.text?1:0)+(U.gzhead.hcrc?2:0)+(!U.gzhead.extra?0:4)+(!U.gzhead.name?0:8)+(!U.gzhead.comment?0:16)),r1(U,U.gzhead.time&255),r1(U,U.gzhead.time>>8&255),r1(U,U.gzhead.time>>16&255),r1(U,U.gzhead.time>>24&255),r1(U,U.level===9?2:U.strategy>=qM||U.level<2?4:0),r1(U,U.gzhead.os&255),U.gzhead.extra&&U.gzhead.extra.length)r1(U,U.gzhead.extra.length&255),r1(U,U.gzhead.extra.length>>8&255);if(U.gzhead.hcrc)$.adler=n7($.adler,U.pending_buf,U.pending,0);U.gzindex=0,U.status=hy}else{var I=OM+(U.w_bits-8<<4)<<8,K=-1;if(U.strategy>=qM||U.level<2)K=0;else if(U.level<6)K=1;else if(U.level===6)K=2;else K=3;if(I|=K<<6,U.strstart!==0)I|=dl0;if(I+=31-I%31,U.status=$z,WW(U,I),U.strstart!==0)WW(U,$.adler>>>16),WW(U,$.adler&65535);$.adler=1}if(U.status===hy)if(U.gzhead.extra){Q=U.pending;while(U.gzindex<(U.gzhead.extra.length&65535)){if(U.pending===U.pending_buf_size){if(U.gzhead.hcrc&&U.pending>Q)$.adler=n7($.adler,U.pending_buf,U.pending-Q,Q);if(c7($),Q=U.pending,U.pending===U.pending_buf_size)break}r1(U,U.gzhead.extra[U.gzindex]&255),U.gzindex++}if(U.gzhead.hcrc&&U.pending>Q)$.adler=n7($.adler,U.pending_buf,U.pending-Q,Q);if(U.gzindex===U.gzhead.extra.length)U.gzindex=0,U.status=VM}else U.status=VM;if(U.status===VM)if(U.gzhead.name){Q=U.pending;do{if(U.pending===U.pending_buf_size){if(U.gzhead.hcrc&&U.pending>Q)$.adler=n7($.adler,U.pending_buf,U.pending-Q,Q);if(c7($),Q=U.pending,U.pending===U.pending_buf_size){J=1;break}}if(U.gzindexQ)$.adler=n7($.adler,U.pending_buf,U.pending-Q,Q);if(J===0)U.gzindex=0,U.status=LM}else U.status=LM;if(U.status===LM)if(U.gzhead.comment){Q=U.pending;do{if(U.pending===U.pending_buf_size){if(U.gzhead.hcrc&&U.pending>Q)$.adler=n7($.adler,U.pending_buf,U.pending-Q,Q);if(c7($),Q=U.pending,U.pending===U.pending_buf_size){J=1;break}}if(U.gzindexQ)$.adler=n7($.adler,U.pending_buf,U.pending-Q,Q);if(J===0)U.status=FM}else U.status=FM;if(U.status===FM)if(U.gzhead.hcrc){if(U.pending+2>U.pending_buf_size)c7($);if(U.pending+2<=U.pending_buf_size)r1(U,$.adler&255),r1(U,$.adler>>8&255),$.adler=0,U.status=$z}else U.status=$z;if(U.pending!==0){if(c7($),$.avail_out===0)return U.last_flush=-1,Q9}else if($.avail_in===0&&k$0(Y)<=k$0(z)&&Y!==l7)return m7($,Ry);if(U.status===XW&&$.avail_in!==0)return m7($,Ry);if($.avail_in!==0||U.lookahead!==0||Y!==Uz&&U.status!==XW){var G=U.strategy===qM?sl0(U,Y):U.strategy===hl0?rl0(U,Y):LJ[U.level].func(U,Y);if(G===Yz||G===FJ)U.status=XW;if(G===P6||G===Yz){if($.avail_out===0)U.last_flush=-1;return Q9}if(G===ZW){if(Y===El0)E$._tr_align(U);else if(Y!==g$0){if(E$._tr_stored_block(U,0,0,!1),Y===Cl0){if(p7(U.head),U.lookahead===0)U.strstart=0,U.block_start=0,U.insert=0}}if(c7($),$.avail_out===0)return U.last_flush=-1,Q9}}if(Y!==l7)return Q9;if(U.wrap<=0)return y$0;if(U.wrap===2)r1(U,$.adler&255),r1(U,$.adler>>8&255),r1(U,$.adler>>16&255),r1(U,$.adler>>24&255),r1(U,$.total_in&255),r1(U,$.total_in>>8&255),r1(U,$.total_in>>16&255),r1(U,$.total_in>>24&255);else WW(U,$.adler>>>16),WW(U,$.adler&65535);if(c7($),U.wrap>0)U.wrap=-U.wrap;return U.pending!==0?Q9:y$0}function zo0($){var Y;if(!$||!$.state)return C$;if(Y=$.state.status,Y!==wM&&Y!==hy&&Y!==VM&&Y!==LM&&Y!==FM&&Y!==$z&&Y!==XW)return m7($,C$);return $.state=null,Y===$z?m7($,Rl0):Q9}function Uo0($,Y){var z=Y.length,U,Q,J,I,K,G,H,W;if(!$||!$.state)return C$;if(U=$.state,I=U.wrap,I===2||I===1&&U.status!==wM||U.lookahead)return C$;if(I===1)$.adler=x$0($.adler,Y,z,0);if(U.wrap=0,z>=U.w_size){if(I===0)p7(U.head),U.strstart=0,U.block_start=0,U.insert=0;W=new E8.Buf8(U.w_size),E8.arraySet(W,Y,z-U.w_size,U.w_size,0),Y=W,z=U.w_size}K=$.avail_in,G=$.next_in,H=$.input,$.avail_in=z,$.next_in=0,$.input=Y,zz(U);while(U.lookahead>=f1){Q=U.strstart,J=U.lookahead-(f1-1);do U.ins_h=(U.ins_h<{var MM=K3(),c$0=!0,p$0=!0;try{String.fromCharCode.apply(null,[0])}catch($){c$0=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch($){p$0=!1}var qW=new MM.Buf8(256);for(J9=0;J9<256;J9++)qW[J9]=J9>=252?6:J9>=248?5:J9>=240?4:J9>=224?3:J9>=192?2:1;var J9;qW[254]=qW[254]=1;Vo0.string2buf=function($){var Y,z,U,Q,J,I=$.length,K=0;for(Q=0;Q>>6,Y[J++]=128|z&63;else if(z<65536)Y[J++]=224|z>>>12,Y[J++]=128|z>>>6&63,Y[J++]=128|z&63;else Y[J++]=240|z>>>18,Y[J++]=128|z>>>12&63,Y[J++]=128|z>>>6&63,Y[J++]=128|z&63}return Y};function d$0($,Y){if(Y<65534){if($.subarray&&p$0||!$.subarray&&c$0)return String.fromCharCode.apply(null,MM.shrinkBuf($,Y))}var z="";for(var U=0;U4){K[U++]=65533,z+=J-1;continue}Q&=J===2?31:J===3?15:7;while(J>1&&z1){K[U++]=65533;continue}if(Q<65536)K[U++]=Q;else Q-=65536,K[U++]=55296|Q>>10&1023,K[U++]=56320|Q&1023}return d$0(K,U)};Vo0.utf8border=function($,Y){var z;if(Y=Y||$.length,Y>$.length)Y=$.length;z=Y-1;while(z>=0&&($[z]&192)===128)z--;if(z<0)return Y;if(z===0)return Y;return z+qW[$[z]]>Y?z:Y}});var gy=E((cd1,m$0)=>{function No0(){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}m$0.exports=No0});var s$0=E((Co0)=>{var VW=n$0(),LW=K3(),ky=Sy(),xy=ZM(),Do0=gy(),r$0=Object.prototype.toString,Ao0=0,yy=4,OJ=0,l$0=1,o$0=2,Bo0=-1,Po0=0,jo0=8;function Qz($){if(!(this instanceof Qz))return new Qz($);this.options=LW.assign({level:Bo0,method:jo0,chunkSize:16384,windowBits:15,memLevel:8,strategy:Po0,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 Do0,this.strm.avail_out=0;var z=VW.deflateInit2(this.strm,Y.level,Y.method,Y.windowBits,Y.memLevel,Y.strategy);if(z!==OJ)throw Error(xy[z]);if(Y.header)VW.deflateSetHeader(this.strm,Y.header);if(Y.dictionary){var U;if(typeof Y.dictionary==="string")U=ky.string2buf(Y.dictionary);else if(r$0.call(Y.dictionary)==="[object ArrayBuffer]")U=new Uint8Array(Y.dictionary);else U=Y.dictionary;if(z=VW.deflateSetDictionary(this.strm,U),z!==OJ)throw Error(xy[z]);this._dict_set=!0}}Qz.prototype.push=function($,Y){var z=this.strm,U=this.options.chunkSize,Q,J;if(this.ended)return!1;if(J=Y===~~Y?Y:Y===!0?yy:Ao0,typeof $==="string")z.input=ky.string2buf($);else if(r$0.call($)==="[object ArrayBuffer]")z.input=new Uint8Array($);else z.input=$;z.next_in=0,z.avail_in=z.input.length;do{if(z.avail_out===0)z.output=new LW.Buf8(U),z.next_out=0,z.avail_out=U;if(Q=VW.deflate(z,J),Q!==l$0&&Q!==OJ)return this.onEnd(Q),this.ended=!0,!1;if(z.avail_out===0||z.avail_in===0&&(J===yy||J===o$0))if(this.options.to==="string")this.onData(ky.buf2binstring(LW.shrinkBuf(z.output,z.next_out)));else this.onData(LW.shrinkBuf(z.output,z.next_out))}while((z.avail_in>0||z.avail_out===0)&&Q!==l$0);if(J===yy)return Q=VW.deflateEnd(this.strm),this.onEnd(Q),this.ended=!0,Q===OJ;if(J===o$0)return this.onEnd(OJ),z.avail_out=0,!0;return!0};Qz.prototype.onData=function($){this.chunks.push($)};Qz.prototype.onEnd=function($){if($===OJ)if(this.options.to==="string")this.result=this.chunks.join("");else this.result=LW.flattenChunks(this.chunks);this.chunks=[],this.err=$,this.msg=this.strm.msg};function fy($,Y){var z=new Qz(Y);if(z.push($,!0),z.err)throw z.msg||xy[z.err];return z.result}function To0($,Y){return Y=Y||{},Y.raw=!0,fy($,Y)}function Eo0($,Y){return Y=Y||{},Y.gzip=!0,fy($,Y)}Co0.Deflate=Qz;Co0.deflate=fy;Co0.deflateRaw=To0;Co0.gzip=Eo0});var t$0=E((dd1,a$0)=>{var NM=30,So0=12;a$0.exports=function(Y,z){var U,Q,J,I,K,G,H,W,X,Z,q,V,F,w,O,N,M,D,P,j,A,T,C,b,k;U=Y.state,Q=Y.next_in,b=Y.input,J=Q+(Y.avail_in-5),I=Y.next_out,k=Y.output,K=I-(z-Y.avail_out),G=I+(Y.avail_out-257),H=U.dmax,W=U.wsize,X=U.whave,Z=U.wnext,q=U.window,V=U.hold,F=U.bits,w=U.lencode,O=U.distcode,N=(1<>>24,V>>>=P,F-=P,P=D>>>16&255,P===0)k[I++]=D&65535;else if(P&16){if(j=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",U.mode=NM;break $}if(V>>>=P,F-=P,P=I-K,A>P){if(P=A-P,P>X){if(U.sane){Y.msg="invalid distance too far back",U.mode=NM;break $}}if(T=0,C=q,Z===0){if(T+=W-P,P2)k[I++]=C[T++],k[I++]=C[T++],k[I++]=C[T++],j-=3;if(j){if(k[I++]=C[T++],j>1)k[I++]=C[T++]}}else{T=I-A;do k[I++]=k[T++],k[I++]=k[T++],k[I++]=k[T++],j-=3;while(j>2);if(j){if(k[I++]=k[T++],j>1)k[I++]=k[T++]}}}else if((P&64)===0){D=O[(D&65535)+(V&(1<>3,Q-=j,F-=j<<3,V&=(1<{var e$0=K3(),wJ=15,$50=852,Y50=592,z50=0,uy=1,U50=2,go0=[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],yo0=[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],ko0=[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],xo0=[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];Q50.exports=function(Y,z,U,Q,J,I,K,G){var H=G.bits,W=0,X=0,Z=0,q=0,V=0,F=0,w=0,O=0,N=0,M=0,D,P,j,A,T,C=null,b=0,k,S=new e$0.Buf16(wJ+1),i=new e$0.Buf16(wJ+1),n=null,U0=0,x,d,t;for(W=0;W<=wJ;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===z50||q!==1))return-1;i[1]=0;for(W=1;W$50||Y===U50&&N>Y50)return 1;for(;;){if(x=W-w,K[X]k)d=n[U0+K[X]],t=C[b+K[X]];else d=96,t=0;D=1<>w)+P]=x<<24|d<<16|t|0;while(P!==0);D=1<>=1;if(D!==0)M&=D-1,M+=D;else M=0;if(X++,--S[W]===0){if(W===q)break;W=z[U+K[X]]}if(W>V&&(M&A)!==j){if(w===0)w=V;T+=Z,F=W-w,O=1<$50||Y===U50&&N>Y50)return 1;j=M&A,J[j]=V<<24|F<<16|T-I|0}}if(M!==0)J[T+M]=W-w<<24|4194304|0;return G.bits=V,0}});var b50=E((zr0)=>{var G$=K3(),dy=Ey(),I9=Cy(),fo0=t$0(),FW=J50(),uo0=0,v50=1,h50=2,I50=4,bo0=5,DM=6,Jz=0,io0=1,no0=2,R$=-2,S50=-3,my=-4,co0=-5,K50=8,g50=1,G50=2,H50=3,W50=4,X50=5,Z50=6,q50=7,V50=8,L50=9,F50=10,PM=11,H3=12,by=13,O50=14,iy=15,w50=16,M50=17,N50=18,D50=19,AM=20,BM=21,A50=22,B50=23,P50=24,j50=25,T50=26,ny=27,E50=28,C50=29,y4=30,ly=31,po0=32,do0=852,mo0=592,lo0=15,oo0=lo0;function R50($){return($>>>24&255)+($>>>8&65280)+(($&65280)<<8)+(($&255)<<24)}function ro0(){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 G$.Buf16(320),this.work=new G$.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function y50($){var Y;if(!$||!$.state)return R$;if(Y=$.state,$.total_in=$.total_out=Y.total=0,$.msg="",Y.wrap)$.adler=Y.wrap&1;return Y.mode=g50,Y.last=0,Y.havedict=0,Y.dmax=32768,Y.head=null,Y.hold=0,Y.bits=0,Y.lencode=Y.lendyn=new G$.Buf32(do0),Y.distcode=Y.distdyn=new G$.Buf32(mo0),Y.sane=1,Y.back=-1,Jz}function k50($){var Y;if(!$||!$.state)return R$;return Y=$.state,Y.wsize=0,Y.whave=0,Y.wnext=0,y50($)}function x50($,Y){var z,U;if(!$||!$.state)return R$;if(U=$.state,Y<0)z=0,Y=-Y;else if(z=(Y>>4)+1,Y<48)Y&=15;if(Y&&(Y<8||Y>15))return R$;if(U.window!==null&&U.wbits!==Y)U.window=null;return U.wrap=z,U.wbits=Y,k50($)}function f50($,Y){var z,U;if(!$)return R$;if(U=new ro0,$.state=U,U.window=null,z=x50($,Y),z!==Jz)$.state=null;return z}function so0($){return f50($,oo0)}var _50=!0,cy,py;function ao0($){if(_50){var Y;cy=new G$.Buf32(512),py=new G$.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;FW(v50,$.lens,0,288,cy,0,$.work,{bits:9}),Y=0;while(Y<32)$.lens[Y++]=5;FW(h50,$.lens,0,32,py,0,$.work,{bits:5}),_50=!1}$.lencode=cy,$.lenbits=9,$.distcode=py,$.distbits=5}function u50($,Y,z,U){var Q,J=$.state;if(J.window===null)J.wsize=1<=J.wsize)G$.arraySet(J.window,Y,z-J.wsize,J.wsize,0),J.wnext=0,J.whave=J.wsize;else{if(Q=J.wsize-J.wnext,Q>U)Q=U;if(G$.arraySet(J.window,Y,z-U,Q,J.wnext),U-=Q,U)G$.arraySet(J.window,Y,z-U,U,0),J.wnext=U,J.whave=J.wsize;else{if(J.wnext+=Q,J.wnext===J.wsize)J.wnext=0;if(J.whave>>8&255,z.check=I9(z.check,C,2,0),H=0,W=0,z.mode=G50;break}if(z.flags=0,z.head)z.head.done=!1;if(!(z.wrap&1)||(((H&255)<<8)+(H>>8))%31){$.msg="incorrect header check",z.mode=y4;break}if((H&15)!==K50){$.msg="unknown compression method",z.mode=y4;break}if(H>>>=4,W-=4,A=(H&15)+8,z.wbits===0)z.wbits=A;else if(A>z.wbits){$.msg="invalid window size",z.mode=y4;break}z.dmax=1<>8&1;if(z.flags&512)C[0]=H&255,C[1]=H>>>8&255,z.check=I9(z.check,C,2,0);H=0,W=0,z.mode=H50;case H50:while(W<32){if(K===0)break $;K--,H+=U[J++]<>>8&255,C[2]=H>>>16&255,C[3]=H>>>24&255,z.check=I9(z.check,C,4,0);H=0,W=0,z.mode=W50;case W50:while(W<16){if(K===0)break $;K--,H+=U[J++]<>8;if(z.flags&512)C[0]=H&255,C[1]=H>>>8&255,z.check=I9(z.check,C,2,0);H=0,W=0,z.mode=X50;case X50:if(z.flags&1024){while(W<16){if(K===0)break $;K--,H+=U[J++]<>>8&255,z.check=I9(z.check,C,2,0);H=0,W=0}else if(z.head)z.head.extra=null;z.mode=Z50;case Z50:if(z.flags&1024){if(q=z.length,q>K)q=K;if(q){if(z.head){if(A=z.head.extra_len-z.length,!z.head.extra)z.head.extra=Array(z.head.extra_len);G$.arraySet(z.head.extra,U,J,q,A)}if(z.flags&512)z.check=I9(z.check,U,q,J);K-=q,J+=q,z.length-=q}if(z.length)break $}z.length=0,z.mode=q50;case q50:if(z.flags&2048){if(K===0)break $;q=0;do if(A=U[J+q++],z.head&&A&&z.length<65536)z.head.name+=String.fromCharCode(A);while(A&&q>9&1,z.head.done=!0;$.adler=z.check=0,z.mode=H3;break;case F50:while(W<32){if(K===0)break $;K--,H+=U[J++]<>>=W&7,W-=W&7,z.mode=ny;break}while(W<3){if(K===0)break $;K--,H+=U[J++]<>>=1,W-=1,H&3){case 0:z.mode=O50;break;case 1:if(ao0(z),z.mode=AM,Y===DM){H>>>=2,W-=2;break $}break;case 2:z.mode=M50;break;case 3:$.msg="invalid block type",z.mode=y4}H>>>=2,W-=2;break;case O50:H>>>=W&7,W-=W&7;while(W<32){if(K===0)break $;K--,H+=U[J++]<>>16^65535)){$.msg="invalid stored block lengths",z.mode=y4;break}if(z.length=H&65535,H=0,W=0,z.mode=iy,Y===DM)break $;case iy:z.mode=w50;case w50:if(q=z.length,q){if(q>K)q=K;if(q>G)q=G;if(q===0)break $;G$.arraySet(Q,U,J,q,I),K-=q,J+=q,G-=q,I+=q,z.length-=q;break}z.mode=H3;break;case M50:while(W<14){if(K===0)break $;K--,H+=U[J++]<>>=5,W-=5,z.ndist=(H&31)+1,H>>>=5,W-=5,z.ncode=(H&15)+4,H>>>=4,W-=4,z.nlen>286||z.ndist>30){$.msg="too many length or distance symbols",z.mode=y4;break}z.have=0,z.mode=N50;case N50:while(z.have>>=3,W-=3}while(z.have<19)z.lens[S[z.have++]]=0;if(z.lencode=z.lendyn,z.lenbits=7,b={bits:z.lenbits},T=FW(uo0,z.lens,0,19,z.lencode,0,z.work,b),z.lenbits=b.bits,T){$.msg="invalid code lengths set",z.mode=y4;break}z.have=0,z.mode=D50;case D50:while(z.have>>24,N=w>>>16&255,M=w&65535,O<=W)break;if(K===0)break $;K--,H+=U[J++]<>>=O,W-=O,z.lens[z.have++]=M;else{if(M===16){k=O+2;while(W>>=O,W-=O,z.have===0){$.msg="invalid bit length repeat",z.mode=y4;break}A=z.lens[z.have-1],q=3+(H&3),H>>>=2,W-=2}else if(M===17){k=O+3;while(W>>=O,W-=O,A=0,q=3+(H&7),H>>>=3,W-=3}else{k=O+7;while(W>>=O,W-=O,A=0,q=11+(H&127),H>>>=7,W-=7}if(z.have+q>z.nlen+z.ndist){$.msg="invalid bit length repeat",z.mode=y4;break}while(q--)z.lens[z.have++]=A}}if(z.mode===y4)break;if(z.lens[256]===0){$.msg="invalid code -- missing end-of-block",z.mode=y4;break}if(z.lenbits=9,b={bits:z.lenbits},T=FW(v50,z.lens,0,z.nlen,z.lencode,0,z.work,b),z.lenbits=b.bits,T){$.msg="invalid literal/lengths set",z.mode=y4;break}if(z.distbits=6,z.distcode=z.distdyn,b={bits:z.distbits},T=FW(h50,z.lens,z.nlen,z.ndist,z.distcode,0,z.work,b),z.distbits=b.bits,T){$.msg="invalid distances set",z.mode=y4;break}if(z.mode=AM,Y===DM)break $;case AM:z.mode=BM;case BM:if(K>=6&&G>=258){if($.next_out=I,$.avail_out=G,$.next_in=J,$.avail_in=K,z.hold=H,z.bits=W,fo0($,Z),I=$.next_out,Q=$.output,G=$.avail_out,J=$.next_in,U=$.input,K=$.avail_in,H=z.hold,W=z.bits,z.mode===H3)z.back=-1;break}z.back=0;for(;;){if(w=z.lencode[H&(1<>>24,N=w>>>16&255,M=w&65535,O<=W)break;if(K===0)break $;K--,H+=U[J++]<>D)],O=w>>>24,N=w>>>16&255,M=w&65535,D+O<=W)break;if(K===0)break $;K--,H+=U[J++]<>>=D,W-=D,z.back+=D}if(H>>>=O,W-=O,z.back+=O,z.length=M,N===0){z.mode=T50;break}if(N&32){z.back=-1,z.mode=H3;break}if(N&64){$.msg="invalid literal/length code",z.mode=y4;break}z.extra=N&15,z.mode=A50;case A50:if(z.extra){k=z.extra;while(W>>=z.extra,W-=z.extra,z.back+=z.extra}z.was=z.length,z.mode=B50;case B50:for(;;){if(w=z.distcode[H&(1<>>24,N=w>>>16&255,M=w&65535,O<=W)break;if(K===0)break $;K--,H+=U[J++]<>D)],O=w>>>24,N=w>>>16&255,M=w&65535,D+O<=W)break;if(K===0)break $;K--,H+=U[J++]<>>=D,W-=D,z.back+=D}if(H>>>=O,W-=O,z.back+=O,N&64){$.msg="invalid distance code",z.mode=y4;break}z.offset=M,z.extra=N&15,z.mode=P50;case P50:if(z.extra){k=z.extra;while(W>>=z.extra,W-=z.extra,z.back+=z.extra}if(z.offset>z.dmax){$.msg="invalid distance too far back",z.mode=y4;break}z.mode=j50;case j50:if(G===0)break $;if(q=Z-G,z.offset>q){if(q=z.offset-q,q>z.whave){if(z.sane){$.msg="invalid distance too far back",z.mode=y4;break}}if(q>z.wnext)q-=z.wnext,V=z.wsize-q;else V=z.wnext-q;if(q>z.length)q=z.length;F=z.window}else F=Q,V=I-z.offset,q=z.length;if(q>G)q=G;G-=q,z.length-=q;do Q[I++]=F[V++];while(--q);if(z.length===0)z.mode=BM;break;case T50:if(G===0)break $;Q[I++]=z.length,G--,z.mode=BM;break;case ny:if(z.wrap){while(W<32){if(K===0)break $;K--,H|=U[J++]<{i50.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 c50=E((rd1,n50)=>{function qr0(){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=qr0});var d50=E((Or0)=>{var MJ=b50(),OW=K3(),jM=Sy(),G6=oy(),ry=ZM(),Vr0=gy(),Lr0=c50(),p50=Object.prototype.toString;function Iz($){if(!(this instanceof Iz))return new Iz($);this.options=OW.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 Vr0,this.strm.avail_out=0;var z=MJ.inflateInit2(this.strm,Y.windowBits);if(z!==G6.Z_OK)throw Error(ry[z]);if(this.header=new Lr0,MJ.inflateGetHeader(this.strm,this.header),Y.dictionary){if(typeof Y.dictionary==="string")Y.dictionary=jM.string2buf(Y.dictionary);else if(p50.call(Y.dictionary)==="[object ArrayBuffer]")Y.dictionary=new Uint8Array(Y.dictionary);if(Y.raw){if(z=MJ.inflateSetDictionary(this.strm,Y.dictionary),z!==G6.Z_OK)throw Error(ry[z])}}}Iz.prototype.push=function($,Y){var z=this.strm,U=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")z.input=jM.binstring2buf($);else if(p50.call($)==="[object ArrayBuffer]")z.input=new Uint8Array($);else z.input=$;z.next_in=0,z.avail_in=z.input.length;do{if(z.avail_out===0)z.output=new OW.Buf8(U),z.next_out=0,z.avail_out=U;if(J=MJ.inflate(z,G6.Z_NO_FLUSH),J===G6.Z_NEED_DICT&&Q)J=MJ.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(z.next_out){if(z.avail_out===0||J===G6.Z_STREAM_END||z.avail_in===0&&(I===G6.Z_FINISH||I===G6.Z_SYNC_FLUSH))if(this.options.to==="string"){if(K=jM.utf8border(z.output,z.next_out),G=z.next_out-K,H=jM.buf2string(z.output,K),z.next_out=G,z.avail_out=U-G,G)OW.arraySet(z.output,z.output,K,G,0);this.onData(H)}else this.onData(OW.shrinkBuf(z.output,z.next_out))}if(z.avail_in===0&&z.avail_out===0)W=!0}while((z.avail_in>0||z.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=MJ.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),z.avail_out=0,!0;return!0};Iz.prototype.onData=function($){this.chunks.push($)};Iz.prototype.onEnd=function($){if($===G6.Z_OK)if(this.options.to==="string")this.result=this.chunks.join("");else this.result=OW.flattenChunks(this.chunks);this.chunks=[],this.err=$,this.msg=this.strm.msg};function sy($,Y){var z=new Iz(Y);if(z.push($,!0),z.err)throw z.msg||ry[z.err];return z.result}function Fr0($,Y){return Y=Y||{},Y.raw=!0,sy($,Y)}Or0.Inflate=Iz;Or0.inflate=sy;Or0.inflateRaw=Fr0;Or0.ungzip=sy});var o50=E((ad1,l50)=>{var Ar0=K3().assign,Br0=s$0(),Pr0=d50(),jr0=oy(),m50={};Ar0(m50,Br0,Pr0,jr0);l50.exports=m50});var s50=E((Rr0)=>{var Tr0=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Uint32Array<"u",Er0=o50(),r50=c4(),TM=K$(),Cr0=Tr0?"uint8array":"array";Rr0.magic="\b\x00";function Kz($,Y){TM.call(this,"FlateWorker/"+$),this._pako=null,this._pakoAction=$,this._pakoOptions=Y,this.meta={}}r50.inherits(Kz,TM);Kz.prototype.processChunk=function($){if(this.meta=$.meta,this._pako===null)this._createPako();this._pako.push(r50.transformTo(Cr0,$.data),!1)};Kz.prototype.flush=function(){if(TM.prototype.flush.call(this),this._pako===null)this._createPako();this._pako.push([],!0)};Kz.prototype.cleanUp=function(){TM.prototype.cleanUp.call(this),this._pako=null};Kz.prototype._createPako=function(){this._pako=new Er0[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var $=this;this._pako.onData=function(Y){$.push({data:Y,meta:$.meta})}};Rr0.compressWorker=function($){return new Kz("Deflate",$)};Rr0.uncompressWorker=function(){return new Kz("Inflate",{})}});var ay=E((Sr0)=>{var a50=K$();Sr0.STORE={magic:"\x00\x00",compressWorker:function(){return new a50("STORE compression")},uncompressWorker:function(){return new a50("STORE decompression")}};Sr0.DEFLATE=s50()});var ty=E((kr0)=>{kr0.LOCAL_FILE_HEADER="PK\x03\x04";kr0.CENTRAL_FILE_HEADER="PK\x01\x02";kr0.CENTRAL_DIRECTORY_END="PK\x05\x06";kr0.ZIP64_CENTRAL_DIRECTORY_LOCATOR="PK\x06\x07";kr0.ZIP64_CENTRAL_DIRECTORY_END="PK\x06\x06";kr0.DATA_DESCRIPTOR="PK\x07\b"});var Y90=E((Ym1,$90)=>{var NJ=c4(),DJ=K$(),ey=WJ(),t50=GM(),EM=ty(),N4=function($,Y){var z="",U;for(U=0;U>>8;return z},cr0=function($,Y){var z=$;if(!$)z=Y?16893:33204;return(z&65535)<<16},pr0=function($){return($||0)&63},e50=function($,Y,z,U,Q,J){var{file:I,compression:K}=$,G=J!==ey.utf8encode,H=NJ.transformTo("string",J(I.name)),W=NJ.transformTo("string",ey.utf8encode(I.name)),X=I.comment,Z=NJ.transformTo("string",J(X)),q=NJ.transformTo("string",ey.utf8encode(X)),V=W.length!==I.name.length,F=q.length!==X.length,w,O,N="",M="",D="",P=I.dir,j=I.date,A={crc32:0,compressedSize:0,uncompressedSize:0};if(!Y||z)A.crc32=$.crc32,A.compressedSize=$.compressedSize,A.uncompressedSize=$.uncompressedSize;var T=0;if(Y)T|=8;if(!G&&(V||F))T|=2048;var C=0,b=0;if(P)C|=16;if(Q==="UNIX")b=798,C|=cr0(I.unixPermissions,P);else b=20,C|=pr0(I.dosPermissions,P);if(w=j.getUTCHours(),w=w<<6,w=w|j.getUTCMinutes(),w=w<<5,w=w|j.getUTCSeconds()/2,O=j.getUTCFullYear()-1980,O=O<<4,O=O|j.getUTCMonth()+1,O=O<<5,O=O|j.getUTCDate(),V)M=N4(1,1)+N4(t50(H),4)+W,N+="up"+N4(M.length,2)+M;if(F)D=N4(1,1)+N4(t50(Z),4)+q,N+="uc"+N4(D.length,2)+D;var k="";k+=` \x00`,k+=N4(T,2),k+=K.magic,k+=N4(w,2),k+=N4(O,2),k+=N4(A.crc32,4),k+=N4(A.compressedSize,4),k+=N4(A.uncompressedSize,4),k+=N4(H.length,2),k+=N4(N.length,2);var S=EM.LOCAL_FILE_HEADER+k+H+N,i=EM.CENTRAL_FILE_HEADER+N4(b,2)+k+N4(Z.length,2)+"\x00\x00\x00\x00"+N4(C,4)+N4(U,4)+H+N+Z;return{fileRecord:S,dirRecord:i}},dr0=function($,Y,z,U,Q){var J="",I=NJ.transformTo("string",Q(U));return J=EM.CENTRAL_DIRECTORY_END+"\x00\x00\x00\x00"+N4($,2)+N4($,2)+N4(Y,4)+N4(z,4)+N4(I.length,2)+I,J},mr0=function($){var Y="";return Y=EM.DATA_DESCRIPTOR+N4($.crc32,4)+N4($.compressedSize,4)+N4($.uncompressedSize,4),Y};function Z5($,Y,z,U){DJ.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=Y,this.zipPlatform=z,this.encodeFileName=U,this.streamFiles=$,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}NJ.inherits(Z5,DJ);Z5.prototype.push=function($){var Y=$.meta.percent||0,z=this.entriesCount,U=this._sources.length;if(this.accumulate)this.contentBuffer.push($);else this.bytesWritten+=$.data.length,DJ.prototype.push.call(this,{data:$.data,meta:{currentFile:this.currentFile,percent:z?(Y+100*(z-U-1))/z:100}})};Z5.prototype.openedSource=function($){this.currentSourceOffset=this.bytesWritten,this.currentFile=$.file.name;var Y=this.streamFiles&&!$.file.dir;if(Y){var z=e50($,Y,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:z.fileRecord,meta:{percent:0}})}else this.accumulate=!0};Z5.prototype.closedSource=function($){this.accumulate=!1;var Y=this.streamFiles&&!$.file.dir,z=e50($,Y,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(z.dirRecord),Y)this.push({data:mr0($),meta:{percent:100}});else{this.push({data:z.fileRecord,meta:{percent:0}});while(this.contentBuffer.length)this.push(this.contentBuffer.shift())}this.currentFile=null};Z5.prototype.flush=function(){var $=this.bytesWritten;for(var Y=0;Y{var lr0=ay(),or0=Y90(),rr0=function($,Y){var z=$||Y,U=lr0[z];if(!U)throw Error(z+" is not a valid compression method !");return U};sr0.generateWorker=function($,Y,z){var U=new or0(Y.streamFiles,z,Y.platform,Y.encodeFileName),Q=0;try{$.forEach(function(J,I){Q++;var K=rr0(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(U)}),U.entriesCount=Q}catch(J){U.error(J)}return U}});var Q90=E((Um1,U90)=>{var tr0=c4(),CM=K$();function wW($,Y){CM.call(this,"Nodejs stream input adapter for "+$),this._upstreamEnded=!1,this._bindStream(Y)}tr0.inherits(wW,CM);wW.prototype._bindStream=function($){var Y=this;this._stream=$,$.pause(),$.on("data",function(z){Y.push({data:z,meta:{percent:0}})}).on("error",function(z){if(Y.isPaused)this.generatedError=z;else Y.error(z)}).on("end",function(){if(Y.isPaused)Y._upstreamEnded=!0;else Y.end()})};wW.prototype.pause=function(){if(!CM.prototype.pause.call(this))return!1;return this._stream.pause(),!0};wW.prototype.resume=function(){if(!CM.prototype.resume.call(this))return!1;if(this._upstreamEnded)this.end();else this._stream.resume();return!0};U90.exports=wW});var V90=E((Qm1,q90)=>{var er0=WJ(),MW=c4(),G90=K$(),$s0=Uy(),H90=Qy(),J90=HM(),Ys0=I$0(),zs0=z90(),I90=aH(),Us0=Q90(),W90=function($,Y,z){var U=MW.getTypeOf(Y),Q,J=MW.extend(z||{},H90);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)$=X90($);if(J.createFolders&&(Q=Qs0($)))Z90.call(this,Q,!0);var I=U==="string"&&J.binary===!1&&J.base64===!1;if(!z||typeof z.binary>"u")J.binary=!I;var K=Y instanceof J90&&Y.uncompressedSize===0;if(K||J.dir||!Y||Y.length===0)J.base64=!1,J.binary=!0,Y="",J.compression="STORE",U="string";var G=null;if(Y instanceof J90||Y instanceof G90)G=Y;else if(I90.isNode&&I90.isStream(Y))G=new Us0($,Y);else G=MW.prepareContent($,Y,J.binary,J.optimizedBinaryString,J.base64);var H=new Ys0($,G,J);this.files[$]=H},Qs0=function($){if($.slice(-1)==="/")$=$.substring(0,$.length-1);var Y=$.lastIndexOf("/");return Y>0?$.substring(0,Y):""},X90=function($){if($.slice(-1)!=="/")$+="/";return $},Z90=function($,Y){if(Y=typeof Y<"u"?Y:H90.createFolders,$=X90($),!this.files[$])W90.call(this,$,null,{dir:!0,createFolders:Y});return this.files[$]};function K90($){return Object.prototype.toString.call($)==="[object RegExp]"}var Js0={load:function(){throw Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},forEach:function($){var Y,z,U;for(Y in this.files)if(U=this.files[Y],z=Y.slice(this.root.length,Y.length),z&&Y.slice(0,this.root.length)===this.root)$(z,U)},filter:function($){var Y=[];return this.forEach(function(z,U){if($(z,U))Y.push(U)}),Y},file:function($,Y,z){if(arguments.length===1)if(K90($)){var U=$;return this.filter(function(J,I){return!I.dir&&U.test(J)})}else{var Q=this.files[this.root+$];if(Q&&!Q.dir)return Q;else return null}else $=this.root+$,W90.call(this,$,Y,z);return this},folder:function($){if(!$)return this;if(K90($))return this.filter(function(Q,J){return J.dir&&$.test(Q)});var Y=this.root+$,z=Z90.call(this,Y),U=this.clone();return U.root=z.name,U},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 z=this.filter(function(Q,J){return J.name.slice(0,$.length)===$});for(var U=0;U{var Is0=c4();function L90($){this.data=$,this.length=$.length,this.index=0,this.zero=0}L90.prototype={checkOffset:function($){this.checkIndex(this.index+$)},checkIndex:function($){if(this.length=this.index;z--)Y=(Y<<8)+this.byteAt(z);return this.index+=$,Y},readString:function($){return Is0.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))}};F90.exports=L90});var Yk=E((Im1,w90)=>{var O90=$k(),Ks0=c4();function AJ($){O90.call(this,$);for(var Y=0;Y=0;--J)if(this.data[J]===Y&&this.data[J+1]===z&&this.data[J+2]===U&&this.data[J+3]===Q)return J-this.zero;return-1};AJ.prototype.readAndCheckSignature=function($){var Y=$.charCodeAt(0),z=$.charCodeAt(1),U=$.charCodeAt(2),Q=$.charCodeAt(3),J=this.readData(4);return Y===J[0]&&z===J[1]&&U===J[2]&&Q===J[3]};AJ.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};w90.exports=AJ});var D90=E((Km1,N90)=>{var M90=$k(),Gs0=c4();function BJ($){M90.call(this,$)}Gs0.inherits(BJ,M90);BJ.prototype.byteAt=function($){return this.data.charCodeAt(this.zero+$)};BJ.prototype.lastIndexOfSignature=function($){return this.data.lastIndexOf($)-this.zero};BJ.prototype.readAndCheckSignature=function($){var Y=this.readData(4);return $===Y};BJ.prototype.readData=function($){this.checkOffset($);var Y=this.data.slice(this.zero+this.index,this.zero+this.index+$);return this.index+=$,Y};N90.exports=BJ});var Uk=E((Gm1,B90)=>{var A90=Yk(),Hs0=c4();function zk($){A90.call(this,$)}Hs0.inherits(zk,A90);zk.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};B90.exports=zk});var T90=E((Hm1,j90)=>{var P90=Uk(),Ws0=c4();function Qk($){P90.call(this,$)}Ws0.inherits(Qk,P90);Qk.prototype.readData=function($){this.checkOffset($);var Y=this.data.slice(this.zero+this.index,this.zero+this.index+$);return this.index+=$,Y};j90.exports=Qk});var Jk=E((Wm1,C90)=>{var RM=c4(),E90=I3(),Xs0=Yk(),Zs0=D90(),qs0=T90(),Vs0=Uk();C90.exports=function($){var Y=RM.getTypeOf($);if(RM.checkSupport(Y),Y==="string"&&!E90.uint8array)return new Zs0($);if(Y==="nodebuffer")return new qs0($);if(E90.uint8array)return new Vs0(RM.transformTo("uint8array",$));return new Xs0(RM.transformTo("array",$))}});var h90=E((Xm1,v90)=>{var Ik=Jk(),o7=c4(),Ls0=HM(),R90=GM(),_M=WJ(),vM=ay(),Fs0=I3(),Os0=0,ws0=3,Ms0=function($){for(var Y in vM){if(!Object.prototype.hasOwnProperty.call(vM,Y))continue;if(vM[Y].magic===$)return vM[Y]}return null};function _90($,Y){this.options=$,this.loadOptions=Y}_90.prototype={isEncrypted:function(){return(this.bitFlag&1)===1},useUTF8:function(){return(this.bitFlag&2048)===2048},readLocalPart:function($){var Y,z;if($.skip(22),this.fileNameLength=$.readInt(2),z=$.readInt(2),this.fileName=$.readData(this.fileNameLength),$.skip(z),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=Ms0(this.compressionMethod),Y===null)throw Error("Corrupted zip : compression "+o7.pretty(this.compressionMethod)+" unknown (inner file : "+o7.transformTo("string",this.fileName)+")");this.decompressed=new Ls0(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,$===Os0)this.dosPermissions=this.externalFileAttributes&63;if($===ws0)this.unixPermissions=this.externalFileAttributes>>16&65535;if(!this.dir&&this.fileNameStr.slice(-1)==="/")this.dir=!0},parseZIP64ExtraField:function(){if(!this.extraFields[1])return;var $=Ik(this.extraFields[1].value);if(this.uncompressedSize===o7.MAX_VALUE_32BITS)this.uncompressedSize=$.readInt(8);if(this.compressedSize===o7.MAX_VALUE_32BITS)this.compressedSize=$.readInt(8);if(this.localHeaderOffset===o7.MAX_VALUE_32BITS)this.localHeaderOffset=$.readInt(8);if(this.diskNumberStart===o7.MAX_VALUE_32BITS)this.diskNumberStart=$.readInt(4)},readExtraFields:function($){var Y=$.index+this.extraFieldsLength,z,U,Q;if(!this.extraFields)this.extraFields={};while($.index+4{var Ns0=Jk(),W3=c4(),q5=ty(),Ds0=h90(),As0=I3();function S90($){this.files=[],this.loadOptions=$}S90.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 ("+W3.pretty(Y)+", expected "+W3.pretty($)+")")}},isSignature:function($,Y){var z=this.reader.index;this.reader.setIndex($);var U=this.reader.readString(4),Q=U===Y;return this.reader.setIndex(z),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=As0.uint8array?"uint8array":"array",z=W3.transformTo(Y,$);this.zipComment=this.loadOptions.decodeFileName(z)},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,z,U,Q;while(Y<$)z=this.reader.readInt(2),U=this.reader.readInt(4),Q=this.reader.readData(U),this.zip64ExtensibleData[z]={id:z,length:U,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(z,q5.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=Ns0($)},load:function($){this.prepareReader($),this.readEndOfCentral(),this.readCentralDir(),this.readLocalFiles()}};g90.exports=S90});var f90=E((qm1,x90)=>{var Kk=c4(),hM=KJ(),Bs0=WJ(),Ps0=y90(),js0=Ky(),k90=aH();function Ts0($){return new hM.Promise(function(Y,z){var U=$.decompressed.getContentWorker().pipe(new js0);U.on("error",function(Q){z(Q)}).on("end",function(){if(U.streamInfo.crc32!==$.decompressed.crc32)z(Error("Corrupted zip : CRC32 mismatch"));else Y()}).resume()})}x90.exports=function($,Y){var z=this;if(Y=Kk.extend(Y||{},{base64:!1,checkCRC32:!1,optimizedBinaryString:!1,createFolders:!1,decodeFileName:Bs0.utf8decode}),k90.isNode&&k90.isStream($))return hM.Promise.reject(Error("JSZip can't accept a stream when loading a zip file."));return Kk.prepareContent("the loaded zip file",$,!0,Y.optimizedBinaryString,Y.base64).then(function(U){var Q=new Ps0(Y);return Q.load(U),Q}).then(function(Q){var J=[hM.Promise.resolve(Q)],I=Q.files;if(Y.checkCRC32)for(var K=0;K{function _$(){if(!(this instanceof _$))return new _$;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 _$;for(var Y in this)if(typeof this[Y]!=="function")$[Y]=this[Y];return $}}_$.prototype=V90();_$.prototype.loadAsync=f90();_$.support=I3();_$.defaults=Qy();_$.version="3.10.1";_$.loadAsync=function($,Y){return new _$().loadAsync($,Y)};_$.external=KJ();u90.exports=_$});var d90=E((Lm1,p90)=>{function b90($,Y){var z=Object.keys($);if(Object.getOwnPropertySymbols){var U=Object.getOwnPropertySymbols($);Y&&(U=U.filter(function(Q){return Object.getOwnPropertyDescriptor($,Q).enumerable})),z.push.apply(z,U)}return z}function i90($){for(var Y=1;Y0)this.tail.next=U;else this.head=U;this.tail=U,++this.length}},{key:"unshift",value:function(z){var U={data:z,next:this.head};if(this.length===0)this.tail=U;this.head=U,++this.length}},{key:"shift",value:function(){if(this.length===0)return;var z=this.head.data;if(this.length===1)this.head=this.tail=null;else this.head=this.head.next;return--this.length,z}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(z){if(this.length===0)return"";var U=this.head,Q=""+U.data;while(U=U.next)Q+=z+U.data;return Q}},{key:"concat",value:function(z){if(this.length===0)return SM.alloc(0);var U=SM.allocUnsafe(z>>>0),Q=this.head,J=0;while(Q)gs0(Q.data,U,J),J+=Q.data.length,Q=Q.next;return U}},{key:"consume",value:function(z,U){var Q;if(zI.length?I.length:z;if(K===I.length)J+=I;else J+=I.slice(0,z);if(z-=K,z===0){if(K===I.length)if(++Q,U.next)this.head=U.next;else this.head=this.tail=null;else this.head=U,U.data=I.slice(K);break}++Q}return this.length-=Q,J}},{key:"_getBuffer",value:function(z){var U=SM.allocUnsafe(z),Q=this.head,J=1;Q.data.copy(U),z-=Q.data.length;while(Q=Q.next){var I=Q.data,K=z>I.length?I.length:z;if(I.copy(U,U.length-z,0,K),z-=K,z===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,U}},{key:Ss0,value:function(z,U){return Hk(this,i90(i90({},U),{},{depth:0,customInspect:!1}))}}]),$}()});var Xk=E((Fm1,l90)=>{function ys0($,Y){var z=this,U=this._readableState&&this._readableState.destroyed,Q=this._writableState&&this._writableState.destroyed;if(U||Q){if(Y)Y($);else if($){if(!this._writableState)process.nextTick(Wk,this,$);else if(!this._writableState.errorEmitted)this._writableState.errorEmitted=!0,process.nextTick(Wk,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(!z._writableState)process.nextTick(m90,z,J);else if(!z._writableState.errorEmitted)z._writableState.errorEmitted=!0,process.nextTick(m90,z,J);else process.nextTick(gM,z);else if(Y)process.nextTick(gM,z),Y(J);else process.nextTick(gM,z)}),this}function m90($,Y){Wk($,Y),gM($)}function gM($){if($._writableState&&!$._writableState.emitClose)return;if($._readableState&&!$._readableState.emitClose)return;$.emit("close")}function ks0(){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 Wk($,Y){$.emit("error",Y)}function xs0($,Y){var{_readableState:z,_writableState:U}=$;if(z&&z.autoDestroy||U&&U.autoDestroy)$.destroy(Y);else $.emit("error",Y)}l90.exports={destroy:ys0,undestroy:ks0,errorOrDestroy:xs0}});var r7=E((is0,s90)=>{var r90={};function v$($,Y,z){if(!z)z=Error;function U(J,I,K){if(typeof Y==="string")return Y;else return Y(J,I,K)}class Q extends z{constructor(J,I,K){super(U(J,I,K))}}Q.prototype.name=z.name,Q.prototype.code=$,r90[$]=Q}function o90($,Y){if(Array.isArray($)){let z=$.length;if($=$.map((U)=>String(U)),z>2)return`one of ${Y} ${$.slice(0,z-1).join(", ")}, or `+$[z-1];else if(z===2)return`one of ${Y} ${$[0]} or ${$[1]}`;else return`of ${Y} ${$[0]}`}else return`of ${Y} ${String($)}`}function fs0($,Y,z){return $.substr(!z||z<0?0:+z,Y.length)===Y}function us0($,Y,z){if(z===void 0||z>$.length)z=$.length;return $.substring(z-Y.length,z)===Y}function bs0($,Y,z){if(typeof z!=="number")z=0;if(z+Y.length>$.length)return!1;else return $.indexOf(Y,z)!==-1}v$("ERR_INVALID_OPT_VALUE",function($,Y){return'The value "'+Y+'" is invalid for option "'+$+'"'},TypeError);v$("ERR_INVALID_ARG_TYPE",function($,Y,z){let U;if(typeof Y==="string"&&fs0(Y,"not "))U="must not be",Y=Y.replace(/^not /,"");else U="must be";let Q;if(us0($," argument"))Q=`The ${$} ${U} ${o90(Y,"type")}`;else{let J=bs0($,".")?"property":"argument";Q=`The "${$}" ${J} ${U} ${o90(Y,"type")}`}return Q+=`. Received type ${typeof z}`,Q},TypeError);v$("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF");v$("ERR_METHOD_NOT_IMPLEMENTED",function($){return"The "+$+" method is not implemented"});v$("ERR_STREAM_PREMATURE_CLOSE","Premature close");v$("ERR_STREAM_DESTROYED",function($){return"Cannot call "+$+" after a stream was destroyed"});v$("ERR_MULTIPLE_CALLBACK","Callback called multiple times");v$("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable");v$("ERR_STREAM_WRITE_AFTER_END","write after end");v$("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError);v$("ERR_UNKNOWN_ENCODING",function($){return"Unknown encoding: "+$},TypeError);v$("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event");is0.codes=r90});var Zk=E((Om1,a90)=>{var cs0=r7().codes.ERR_INVALID_OPT_VALUE;function ps0($,Y,z){return $.highWaterMark!=null?$.highWaterMark:Y?$[z]:null}function ds0($,Y,z,U){var Q=ps0(Y,U,z);if(Q!=null){if(!(isFinite(Q)&&Math.floor(Q)===Q)||Q<0){var J=U?z:"highWaterMark";throw new cs0(J,Q)}return Math.floor(Q)}return $.objectMode?16:16384}a90.exports={getHighWaterMark:ds0}});var Lk=E((wm1,U30)=>{U30.exports=z6;function e90($){var Y=this;this.next=null,this.entry=null,this.finish=function(){wa0(Y,$)}}var PJ;z6.WritableState=DW;var ms0={deprecate:f7()},$30=I0("stream"),kM=I0("buffer").Buffer,ls0=(typeof global<"u"?global:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function os0($){return kM.from($)}function rs0($){return kM.isBuffer($)||$ instanceof ls0}var Vk=Xk(),ss0=Zk(),as0=ss0.getHighWaterMark,s7=r7().codes,ts0=s7.ERR_INVALID_ARG_TYPE,es0=s7.ERR_METHOD_NOT_IMPLEMENTED,$a0=s7.ERR_MULTIPLE_CALLBACK,Ya0=s7.ERR_STREAM_CANNOT_PIPE,za0=s7.ERR_STREAM_DESTROYED,Ua0=s7.ERR_STREAM_NULL_VALUES,Qa0=s7.ERR_STREAM_WRITE_AFTER_END,Ja0=s7.ERR_UNKNOWN_ENCODING,jJ=Vk.errorOrDestroy;X1()(z6,$30);function Ia0(){}function DW($,Y,z){if(PJ=PJ||Gz(),$=$||{},typeof z!=="boolean")z=Y instanceof PJ;if(this.objectMode=!!$.objectMode,z)this.objectMode=this.objectMode||!!$.writableObjectMode;this.highWaterMark=as0(this,$,"writableHighWaterMark",z),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var U=$.decodeStrings===!1;this.decodeStrings=!U,this.defaultEncoding=$.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(Q){qa0(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 e90(this)}DW.prototype.getBuffer=function(){var Y=this.bufferedRequest,z=[];while(Y)z.push(Y),Y=Y.next;return z};(function(){try{Object.defineProperty(DW.prototype,"buffer",{get:ms0.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch($){}})();var yM;if(typeof Symbol==="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]==="function")yM=Function.prototype[Symbol.hasInstance],Object.defineProperty(z6,Symbol.hasInstance,{value:function(Y){if(yM.call(this,Y))return!0;if(this!==z6)return!1;return Y&&Y._writableState instanceof DW}});else yM=function(Y){return Y instanceof this};function z6($){PJ=PJ||Gz();var Y=this instanceof PJ;if(!Y&&!yM.call(z6,this))return new z6($);if(this._writableState=new DW($,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}$30.call(this)}z6.prototype.pipe=function(){jJ(this,new Ya0)};function Ka0($,Y){var z=new Qa0;jJ($,z),process.nextTick(Y,z)}function Ga0($,Y,z,U){var Q;if(z===null)Q=new Ua0;else if(typeof z!=="string"&&!Y.objectMode)Q=new ts0("chunk",["string","Buffer"],z);if(Q)return jJ($,Q),process.nextTick(U,Q),!1;return!0}z6.prototype.write=function($,Y,z){var U=this._writableState,Q=!1,J=!U.objectMode&&rs0($);if(J&&!kM.isBuffer($))$=os0($);if(typeof Y==="function")z=Y,Y=null;if(J)Y="buffer";else if(!Y)Y=U.defaultEncoding;if(typeof z!=="function")z=Ia0;if(U.ending)Ka0(this,z);else if(J||Ga0(this,U,$,z))U.pendingcb++,Q=Wa0(this,U,J,$,Y,z);return Q};z6.prototype.cork=function(){this._writableState.corked++};z6.prototype.uncork=function(){var $=this._writableState;if($.corked){if($.corked--,!$.writing&&!$.corked&&!$.bufferProcessing&&$.bufferedRequest)Y30(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 new Ja0(Y);return this._writableState.defaultEncoding=Y,this};Object.defineProperty(z6.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});function Ha0($,Y,z){if(!$.objectMode&&$.decodeStrings!==!1&&typeof Y==="string")Y=kM.from(Y,z);return Y}Object.defineProperty(z6.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function Wa0($,Y,z,U,Q,J){if(!z){var I=Ha0(Y,U,Q);if(U!==I)z=!0,Q="buffer",U=I}var K=Y.objectMode?1:U.length;Y.length+=K;var G=Y.length{var Ma0=Object.keys||function($){var Y=[];for(var z in $)Y.push(z);return Y};J30.exports=K9;var Q30=Ok(),Fk=Lk();X1()(K9,Q30);{xM=Ma0(Fk.prototype);for(AW=0;AW{/*! safe-buffer. MIT License. Feross Aboukhadijeh */var fM=I0("buffer"),G9=fM.Buffer;function I30($,Y){for(var z in $)Y[z]=$[z]}if(G9.from&&G9.alloc&&G9.allocUnsafe&&G9.allocUnsafeSlow)K30.exports=fM;else I30(fM,wk),wk.Buffer=Hz;function Hz($,Y,z){return G9($,Y,z)}Hz.prototype=Object.create(G9.prototype);I30(G9,Hz);Hz.from=function($,Y,z){if(typeof $==="number")throw TypeError("Argument must not be a number");return G9($,Y,z)};Hz.alloc=function($,Y,z){if(typeof $!=="number")throw TypeError("Argument must be a number");var U=G9($);if(Y!==void 0)if(typeof z==="string")U.fill(Y,z);else U.fill(Y);else U.fill(0);return U};Hz.allocUnsafe=function($){if(typeof $!=="number")throw TypeError("Argument must be a number");return G9($)};Hz.allocUnsafeSlow=function($){if(typeof $!=="number")throw TypeError("Argument must be a number");return fM.SlowBuffer($)}});var TJ=E((ya0)=>{var Nk=G30().Buffer,H30=Nk.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 Aa0($){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 Ba0($){var Y=Aa0($);if(typeof Y!=="string"&&(Nk.isEncoding===H30||!H30($)))throw Error("Unknown encoding: "+$);return Y||$}ya0.StringDecoder=PW;function PW($){this.encoding=Ba0($);var Y;switch(this.encoding){case"utf16le":this.text=Ra0,this.end=_a0,Y=4;break;case"utf8":this.fillLast=Ta0,Y=4;break;case"base64":this.text=va0,this.end=ha0,Y=3;break;default:this.write=Sa0,this.end=ga0;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=Nk.allocUnsafe(Y)}PW.prototype.write=function($){if($.length===0)return"";var Y,z;if(this.lastNeed){if(Y=this.fillLast($),Y===void 0)return"";z=this.lastNeed,this.lastNeed=0}else z=0;if(z<$.length)return Y?Y+this.text($,z):this.text($,z);return Y||""};PW.prototype.end=Ca0;PW.prototype.text=Ea0;PW.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 Mk($){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 Pa0($,Y,z){var U=Y.length-1;if(U=0){if(Q>0)$.lastNeed=Q-1;return Q}if(--U=0){if(Q>0)$.lastNeed=Q-2;return Q}if(--U=0){if(Q>0)if(Q===2)Q=0;else $.lastNeed=Q-3;return Q}return 0}function ja0($,Y,z){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 Ta0($){var Y=this.lastTotal-this.lastNeed,z=ja0(this,$,Y);if(z!==void 0)return z;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 Ea0($,Y){var z=Pa0(this,$,Y);if(!this.lastNeed)return $.toString("utf8",Y);this.lastTotal=z;var U=$.length-(z-this.lastNeed);return $.copy(this.lastChar,0,U),$.toString("utf8",Y,U)}function Ca0($){var Y=$&&$.length?this.write($):"";if(this.lastNeed)return Y+"�";return Y}function Ra0($,Y){if(($.length-Y)%2===0){var z=$.toString("utf16le",Y);if(z){var U=z.charCodeAt(z.length-1);if(U>=55296&&U<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=$[$.length-2],this.lastChar[1]=$[$.length-1],z.slice(0,-1)}return z}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=$[$.length-1],$.toString("utf16le",Y,$.length-1)}function _a0($){var Y=$&&$.length?this.write($):"";if(this.lastNeed){var z=this.lastTotal-this.lastNeed;return Y+this.lastChar.toString("utf16le",0,z)}return Y}function va0($,Y){var z=($.length-Y)%3;if(z===0)return $.toString("base64",Y);if(this.lastNeed=3-z,this.lastTotal=3,z===1)this.lastChar[0]=$[$.length-1];else this.lastChar[0]=$[$.length-2],this.lastChar[1]=$[$.length-1];return $.toString("base64",Y,$.length-z)}function ha0($){var Y=$&&$.length?this.write($):"";if(this.lastNeed)return Y+this.lastChar.toString("base64",0,3-this.lastNeed);return Y}function Sa0($){return $.toString(this.encoding)}function ga0($){return $&&$.length?this.write($):""}});var uM=E((Dm1,Z30)=>{var W30=r7().codes.ERR_STREAM_PREMATURE_CLOSE;function xa0($){var Y=!1;return function(){if(Y)return;Y=!0;for(var z=arguments.length,U=Array(z),Q=0;Q{var bM;function a7($,Y,z){if(Y=ba0(Y),Y in $)Object.defineProperty($,Y,{value:z,enumerable:!0,configurable:!0,writable:!0});else $[Y]=z;return $}function ba0($){var Y=ia0($,"string");return typeof Y==="symbol"?Y:String(Y)}function ia0($,Y){if(typeof $!=="object"||$===null)return $;var z=$[Symbol.toPrimitive];if(z!==void 0){var U=z.call($,Y||"default");if(typeof U!=="object")return U;throw TypeError("@@toPrimitive must return a primitive value.")}return(Y==="string"?String:Number)($)}var na0=uM(),t7=Symbol("lastResolve"),Wz=Symbol("lastReject"),jW=Symbol("error"),iM=Symbol("ended"),Xz=Symbol("lastPromise"),Dk=Symbol("handlePromise"),Zz=Symbol("stream");function e7($,Y){return{value:$,done:Y}}function ca0($){var Y=$[t7];if(Y!==null){var z=$[Zz].read();if(z!==null)$[Xz]=null,$[t7]=null,$[Wz]=null,Y(e7(z,!1))}}function pa0($){process.nextTick(ca0,$)}function da0($,Y){return function(z,U){$.then(function(){if(Y[iM]){z(e7(void 0,!0));return}Y[Dk](z,U)},U)}}var ma0=Object.getPrototypeOf(function(){}),la0=Object.setPrototypeOf((bM={get stream(){return this[Zz]},next:function(){var Y=this,z=this[jW];if(z!==null)return Promise.reject(z);if(this[iM])return Promise.resolve(e7(void 0,!0));if(this[Zz].destroyed)return new Promise(function(I,K){process.nextTick(function(){if(Y[jW])K(Y[jW]);else I(e7(void 0,!0))})});var U=this[Xz],Q;if(U)Q=new Promise(da0(U,this));else{var J=this[Zz].read();if(J!==null)return Promise.resolve(e7(J,!1));Q=new Promise(this[Dk])}return this[Xz]=Q,Q}},a7(bM,Symbol.asyncIterator,function(){return this}),a7(bM,"return",function(){var Y=this;return new Promise(function(z,U){Y[Zz].destroy(null,function(Q){if(Q){U(Q);return}z(e7(void 0,!0))})})}),bM),ma0),oa0=function(Y){var z,U=Object.create(la0,(z={},a7(z,Zz,{value:Y,writable:!0}),a7(z,t7,{value:null,writable:!0}),a7(z,Wz,{value:null,writable:!0}),a7(z,jW,{value:null,writable:!0}),a7(z,iM,{value:Y._readableState.endEmitted,writable:!0}),a7(z,Dk,{value:function(J,I){var K=U[Zz].read();if(K)U[Xz]=null,U[t7]=null,U[Wz]=null,J(e7(K,!1));else U[t7]=J,U[Wz]=I},writable:!0}),z));return U[Xz]=null,na0(Y,function(Q){if(Q&&Q.code!=="ERR_STREAM_PREMATURE_CLOSE"){var J=U[Wz];if(J!==null)U[Xz]=null,U[t7]=null,U[Wz]=null,J(Q);U[jW]=Q;return}var I=U[t7];if(I!==null)U[Xz]=null,U[t7]=null,U[Wz]=null,I(e7(void 0,!0));U[iM]=!0}),Y.on("readable",pa0.bind(null,U)),U};q30.exports=oa0});var w30=E((Bm1,O30)=>{function L30($,Y,z,U,Q,J,I){try{var K=$[J](I),G=K.value}catch(H){z(H);return}if(K.done)Y(G);else Promise.resolve(G).then(U,Q)}function ra0($){return function(){var Y=this,z=arguments;return new Promise(function(U,Q){var J=$.apply(Y,z);function I(G){L30(J,U,Q,I,K,"next",G)}function K(G){L30(J,U,Q,I,K,"throw",G)}I(void 0)})}}function F30($,Y){var z=Object.keys($);if(Object.getOwnPropertySymbols){var U=Object.getOwnPropertySymbols($);Y&&(U=U.filter(function(Q){return Object.getOwnPropertyDescriptor($,Q).enumerable})),z.push.apply(z,U)}return z}function sa0($){for(var Y=1;Y{C30.exports=p1;var EJ;p1.ReadableState=A30;var Pm1=I0("events").EventEmitter,D30=function(Y,z){return Y.listeners(z).length},EW=I0("stream"),nM=I0("buffer").Buffer,zt0=(typeof global<"u"?global:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function Ut0($){return nM.from($)}function Qt0($){return nM.isBuffer($)||$ instanceof zt0}var Ak=I0("util"),C1;if(Ak&&Ak.debuglog)C1=Ak.debuglog("stream");else C1=function(){};var Jt0=d90(),Rk=Xk(),It0=Zk(),Kt0=It0.getHighWaterMark,cM=r7().codes,Gt0=cM.ERR_INVALID_ARG_TYPE,Ht0=cM.ERR_STREAM_PUSH_AFTER_EOF,Wt0=cM.ERR_METHOD_NOT_IMPLEMENTED,Xt0=cM.ERR_STREAM_UNSHIFT_AFTER_END_EVENT,CJ,Bk,Pk;X1()(p1,EW);var TW=Rk.errorOrDestroy,jk=["error","close","destroy","pause","resume"];function Zt0($,Y,z){if(typeof $.prependListener==="function")return $.prependListener(Y,z);if(!$._events||!$._events[Y])$.on(Y,z);else if(Array.isArray($._events[Y]))$._events[Y].unshift(z);else $._events[Y]=[z,$._events[Y]]}function A30($,Y,z){if(EJ=EJ||Gz(),$=$||{},typeof z!=="boolean")z=Y instanceof EJ;if(this.objectMode=!!$.objectMode,z)this.objectMode=this.objectMode||!!$.readableObjectMode;if(this.highWaterMark=Kt0(this,$,"readableHighWaterMark",z),this.buffer=new Jt0,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(!CJ)CJ=TJ().StringDecoder;this.decoder=new CJ($.encoding),this.encoding=$.encoding}}function p1($){if(EJ=EJ||Gz(),!(this instanceof p1))return new p1($);var Y=this instanceof EJ;if(this._readableState=new A30($,this,Y),this.readable=!0,$){if(typeof $.read==="function")this._read=$.read;if(typeof $.destroy==="function")this._destroy=$.destroy}EW.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=Rk.destroy;p1.prototype._undestroy=Rk.undestroy;p1.prototype._destroy=function($,Y){Y($)};p1.prototype.push=function($,Y){var z=this._readableState,U;if(!z.objectMode){if(typeof $==="string"){if(Y=Y||z.defaultEncoding,Y!==z.encoding)$=nM.from($,Y),Y="";U=!0}}else U=!0;return B30(this,$,Y,!1,U)};p1.prototype.unshift=function($){return B30(this,$,null,!0,!1)};function B30($,Y,z,U,Q){C1("readableAddChunk",Y);var J=$._readableState;if(Y===null)J.reading=!1,Lt0($,J);else{var I;if(!Q)I=qt0(J,Y);if(I)TW($,I);else if(J.objectMode||Y&&Y.length>0){if(typeof Y!=="string"&&!J.objectMode&&Object.getPrototypeOf(Y)!==nM.prototype)Y=Ut0(Y);if(U)if(J.endEmitted)TW($,new Xt0);else Tk($,J,Y,!0);else if(J.ended)TW($,new Ht0);else if(J.destroyed)return!1;else if(J.reading=!1,J.decoder&&!z)if(Y=J.decoder.write(Y),J.objectMode||Y.length!==0)Tk($,J,Y,!1);else Ck($,J);else Tk($,J,Y,!1)}else if(!U)J.reading=!1,Ck($,J)}return!J.ended&&(J.length=M30)$=M30;else $--,$|=$>>>1,$|=$>>>2,$|=$>>>4,$|=$>>>8,$|=$>>>16,$++;return $}function N30($,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=Vt0($);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,z=$;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)Ek(this);else pM(this);return null}if($=N30($,Y),$===0&&Y.ended){if(Y.length===0)Ek(this);return null}var U=Y.needReadable;if(C1("need readable",U),Y.length===0||Y.length-$0)Q=T30($,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(z!==$&&Y.ended)Ek(this)}if(Q!==null)this.emit("data",Q);return Q};function Lt0($,Y){if(C1("onEofChunk"),Y.ended)return;if(Y.decoder){var z=Y.decoder.end();if(z&&z.length)Y.buffer.push(z),Y.length+=Y.objectMode?1:z.length}if(Y.ended=!0,Y.sync)pM($);else if(Y.needReadable=!1,!Y.emittedReadable)Y.emittedReadable=!0,P30($)}function pM($){var Y=$._readableState;if(C1("emitReadable",Y.needReadable,Y.emittedReadable),Y.needReadable=!1,!Y.emittedReadable)C1("emitReadable",Y.flowing),Y.emittedReadable=!0,process.nextTick(P30,$)}function P30($){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,_k($)}function Ck($,Y){if(!Y.readingMore)Y.readingMore=!0,process.nextTick(Ft0,$,Y)}function Ft0($,Y){while(!Y.reading&&!Y.ended&&(Y.length1&&E30(U.pipes,$)!==-1)&&!H)C1("false write response, pause",U.awaitDrain),U.awaitDrain++;z.pause()}}function Z(w){if(C1("onerror",w),F(),$.removeListener("error",Z),D30($,"error")===0)TW($,w)}Zt0($,"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"),z.unpipe($)}if($.emit("pipe",z),!U.flowing)C1("pipe resume"),z.resume();return $};function Ot0($){return function(){var z=$._readableState;if(C1("pipeOnDrain",z.awaitDrain),z.awaitDrain)z.awaitDrain--;if(z.awaitDrain===0&&D30($,"data"))z.flowing=!0,_k($)}}p1.prototype.unpipe=function($){var Y=this._readableState,z={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,z);return this}if(!$){var{pipes:U,pipesCount:Q}=Y;Y.pipes=null,Y.pipesCount=0,Y.flowing=!1;for(var J=0;J0,U.flowing!==!1)this.resume()}else if($==="readable"){if(!U.endEmitted&&!U.readableListening){if(U.readableListening=U.needReadable=!0,U.flowing=!1,U.emittedReadable=!1,C1("on readable",U.length,U.reading),U.length)pM(this);else if(!U.reading)process.nextTick(wt0,this)}}return z};p1.prototype.addListener=p1.prototype.on;p1.prototype.removeListener=function($,Y){var z=EW.prototype.removeListener.call(this,$,Y);if($==="readable")process.nextTick(j30,this);return z};p1.prototype.removeAllListeners=function($){var Y=EW.prototype.removeAllListeners.apply(this,arguments);if($==="readable"||$===void 0)process.nextTick(j30,this);return Y};function j30($){var Y=$._readableState;if(Y.readableListening=$.listenerCount("readable")>0,Y.resumeScheduled&&!Y.paused)Y.flowing=!0;else if($.listenerCount("data")>0)$.resume()}function wt0($){C1("readable nexttick read 0"),$.read(0)}p1.prototype.resume=function(){var $=this._readableState;if(!$.flowing)C1("resume"),$.flowing=!$.readableListening,Mt0(this,$);return $.paused=!1,this};function Mt0($,Y){if(!Y.resumeScheduled)Y.resumeScheduled=!0,process.nextTick(Nt0,$,Y)}function Nt0($,Y){if(C1("resume",Y.reading),!Y.reading)$.read(0);if(Y.resumeScheduled=!1,$.emit("resume"),_k($),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 _k($){var Y=$._readableState;C1("flow",Y.flowing);while(Y.flowing&&$.read()!==null);}p1.prototype.wrap=function($){var Y=this,z=this._readableState,U=!1;$.on("end",function(){if(C1("wrapped end"),z.decoder&&!z.ended){var I=z.decoder.end();if(I&&I.length)Y.push(I)}Y.push(null)}),$.on("data",function(I){if(C1("wrapped data"),z.decoder)I=z.decoder.write(I);if(z.objectMode&&(I===null||I===void 0))return;else if(!z.objectMode&&(!I||!I.length))return;var K=Y.push(I);if(!K)U=!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)z=Y.buffer.join("");else if(Y.buffer.length===1)z=Y.buffer.first();else z=Y.buffer.concat(Y.length);Y.buffer.clear()}else z=Y.buffer.consume($,Y.decoder);return z}function Ek($){var Y=$._readableState;if(C1("endReadable",Y.endEmitted),!Y.endEmitted)Y.ended=!0,process.nextTick(Dt0,Y,$)}function Dt0($,Y){if(C1("endReadableNT",$.endEmitted,$.length),!$.endEmitted&&$.length===0){if($.endEmitted=!0,Y.readable=!1,Y.emit("end"),$.autoDestroy){var z=Y._writableState;if(!z||z.autoDestroy&&z.finished)Y.destroy()}}}if(typeof Symbol==="function")p1.from=function($,Y){if(Pk===void 0)Pk=w30();return Pk(p1,$,Y)};function E30($,Y){for(var z=0,U=$.length;z{_30.exports=X3;var dM=r7().codes,At0=dM.ERR_METHOD_NOT_IMPLEMENTED,Bt0=dM.ERR_MULTIPLE_CALLBACK,Pt0=dM.ERR_TRANSFORM_ALREADY_TRANSFORMING,jt0=dM.ERR_TRANSFORM_WITH_LENGTH_0,mM=Gz();X1()(X3,mM);function Tt0($,Y){var z=this._transformState;z.transforming=!1;var U=z.writecb;if(U===null)return this.emit("error",new Bt0);if(z.writechunk=null,z.writecb=null,Y!=null)this.push(Y);U($);var Q=this._readableState;if(Q.reading=!1,Q.needReadable||Q.length{h30.exports=CW;var v30=vk();X1()(CW,v30);function CW($){if(!(this instanceof CW))return new CW($);v30.call(this,$)}CW.prototype._transform=function($,Y,z){z(null,$)}});var f30=E((Cm1,x30)=>{var hk;function Ct0($){var Y=!1;return function(){if(Y)return;Y=!0,$.apply(void 0,arguments)}}var k30=r7().codes,Rt0=k30.ERR_MISSING_ARGS,_t0=k30.ERR_STREAM_DESTROYED;function g30($){if($)throw $}function vt0($){return $.setHeader&&typeof $.abort==="function"}function ht0($,Y,z,U){U=Ct0(U);var Q=!1;if($.on("close",function(){Q=!0}),hk===void 0)hk=uM();hk($,{readable:Y,writable:z},function(I){if(I)return U(I);Q=!0,U()});var J=!1;return function(I){if(Q)return;if(J)return;if(J=!0,vt0($))return $.abort();if(typeof $.destroy==="function")return $.destroy();U(I||new _t0("pipe"))}}function y30($){$()}function St0($,Y){return $.pipe(Y)}function gt0($){if(!$.length)return g30;if(typeof $[$.length-1]!=="function")return g30;return $.pop()}function yt0(){for(var $=arguments.length,Y=Array($),z=0;z<$;z++)Y[z]=arguments[z];var U=gt0(Y);if(Array.isArray(Y[0]))Y=Y[0];if(Y.length<2)throw new Rt0("streams");var Q,J=Y.map(function(I,K){var G=K0;return ht0(I,G,H,function(W){if(!Q)Q=W;if(W)J.forEach(y30);if(G)return;J.forEach(y30),U(Q)})});return Y.reduce(St0)}x30.exports=yt0});var C8=E((h$,_W)=>{var RW=I0("stream");if(process.env.READABLE_STREAM==="disable"&&RW)_W.exports=RW.Readable,Object.assign(_W.exports,RW),_W.exports.Stream=RW;else h$=_W.exports=Ok(),h$.Stream=RW||h$,h$.Readable=h$,h$.Writable=Lk(),h$.Duplex=Gz(),h$.Transform=vk(),h$.PassThrough=S30(),h$.finished=uM(),h$.pipeline=f30()});var Z8=E((Rm1,i30)=>{var u30=I0("fs"),kt0=function($,Y,z,U){if($.super_=Y,!U)U=z,z=null;if(z)Object.keys(z).forEach((J)=>{Object.defineProperty($,J,Object.getOwnPropertyDescriptor(z,J))});let Q={constructor:{value:$,enumerable:!1,writable:!1,configurable:!0}};if(U)Object.keys(U).forEach((J)=>{Q[J]=Object.getOwnPropertyDescriptor(U,J)});$.prototype=Object.create(Y.prototype,Q)},xt0=/[<>&'"\x7F\x00-\x08\x0B-\x0C\x0E-\x1F]/,b30={nop(){},promiseImmediate($){return new Promise((Y)=>{if(global.setImmediate)setImmediate(()=>{Y($)});else setTimeout(()=>{Y($)},1)})},inherits:kt0,dateToExcel($,Y){return 25569+$.getTime()/86400000-(Y?1462:0)},excelToDate($,Y){let z=Math.round(($-25569+(Y?1462:0))*24*3600*1000);return new Date(z)},parsePath($){let Y=$.lastIndexOf("/");return{path:$.substring(0,Y),name:$.substring(Y+1)}},getRelsPath($){let Y=b30.parsePath($);return`${Y.path}/_rels/${Y.name}.rels`},xmlEncode($){let Y=xt0.exec($);if(!Y)return $;let z="",U="",Q=0,J=Y.index;for(;J<$.length;J++){let I=$.charCodeAt(J);switch(I){case 34:U=""";break;case 38:U="&";break;case 39:U="'";break;case 60:U="<";break;case 62:U=">";break;case 127:U="";break;default:{if(I<=31&&(I<=8||I>=11&&I!==13)){U="";break}continue}}if(Q!==J)z+=$.substring(Q,J);if(Q=J+1,U)z+=U}if(Q!==J)return z+$.substring(Q,J);return z},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)=>{u30.access($,u30.constants.F_OK,(z)=>{Y(!z)})})}},toIsoDateString($){return $.toIsoString().subsstr(0,10)},parseBoolean($){return $===!0||$==="true"||$===1||$==="1"}};i30.exports=b30});var Sk=E((_m1,c30)=>{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 z=Buffer.alloc(Y);this._buf.copy(z,0),this._buf=z}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}}}c30.exports=n30});var vW=E((vm1,s30)=>{var ft0=C8(),p30=Z8(),ut0=Sk();class d30{constructor($,Y){this._data=$,this._encoding=Y}get length(){return this.toBuffer().length}copy($,Y,z,U){return this.toBuffer().copy($,Y,z,U)}toBuffer(){if(!this._buffer)this._buffer=Buffer.from(this._data,this._encoding);return this._buffer}}class m30{constructor($){this._data=$}get length(){return this._data.length}copy($,Y,z,U){return this._data._buf.copy($,Y,z,U)}toBuffer(){return this._data.toBuffer()}}class l30{constructor($){this._data=$}get length(){return this._data.length}copy($,Y,z,U){this._data.copy($,Y,z,U)}toBuffer(){return this._data}}class o30{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,z){let U=Math.min(z,this.size-this.iWrite);return $.copy(this.buffer,this.iWrite,Y,Y+U),this.iWrite+=U,U}}var r30=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};p30.inherits(r30,ft0.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 o30(this.bufSize);return this.buffers.push($),$},async _pipe($){let Y=function(z){return new Promise((U)=>{z.write($.toBuffer(),()=>{U()})})};await Promise.all(this.pipes.map(Y))},_writeToBuffers($){let Y=0,z=$.length;while(Y1)this._pipe(this.buffers.shift())}else if(!this.corked)await this._pipe(U),z();else this._writeToBuffers(U),process.nextTick(z);else{if(!this.paused)this.emit("data",U.toBuffer());this._writeToBuffers(U),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,z){let U=(Q)=>{if(Q)z(Q);else this._flush(),this.pipes.forEach((J)=>{J.end()}),this.emit("finish")};if($)this.write($,Y,U);else U()},read($){let Y;if($){Y=[];while($&&this.buffers.length&&!this.buffers[0].eod){let z=this.buffers[0],U=z.read($);if($-=U.length,Y.push(U),z.eod&&z.full)this.buffers.shift()}return Buffer.concat(Y)}return Y=this.buffers.map((z)=>z.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")}});s30.exports=r30});var e30=E((it0)=>{var a30=typeof TextEncoder>"u"?null:new TextEncoder("utf-8"),{Buffer:t30}=I0("buffer");function bt0($){if(typeof $!=="string")return $;if(a30)return t30.from(a30.encode($).buffer);return t30.from($)}it0.stringToBuffer=bt0});var z70=E((gm1,Y70)=>{var ct0=I0("events"),pt0=Gk(),dt0=vW(),{stringToBuffer:Sm1}=e30();class $70 extends ct0.EventEmitter{constructor($){super();this.options=Object.assign({type:"nodebuffer",compression:"DEFLATE"},$),this.zip=new pt0,this.stream=new dt0}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($)}}Y70.exports={ZipWriter:$70}});var o6=E((ym1,J70)=>{var mt0=Y6(),U70=Z8();function Q70($,Y,z){$.push(` ${Y}="${U70.xmlEncode(z.toString())}"`)}function gk($,Y){if(Y){let z=[];mt0.each(Y,(U,Q)=>{if(U!==void 0)Q70(z,Q,U)}),$.push(z.join(""))}}class yk{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 z=this.tos,U=this._xml;if(z&&this.open)U.push(">");this._stack.push($),U.push("<"),U.push($),gk(U,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)Q70(this._xml,$,Y)}addAttributes($){if(!this.open)throw Error("Cannot write attributes to node if it is not open");gk(this._xml,$)}writeText($){let Y=this._xml;if(this.open)Y.push(">"),this.open=!1;this.leaf=!1,Y.push(U70.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,z){if(this.openNode($,Y),z!==void 0)this.writeText(z);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("")}}yk.StdDocAttributes={version:"1.0",encoding:"UTF-8",standalone:"yes"};J70.exports=yk});var kk=E((ot0)=>{var I70=typeof TextDecoder>"u"?null:new TextDecoder("utf-8");function lt0($){if(typeof $==="string")return $;if(I70)return I70.decode($);return $.toString()}ot0.bufferToString=lt0});var X70=E((G70)=>{Object.defineProperty(G70,"__esModule",{value:!0});G70.CHAR=` \r -퟿-�\uD800\uDC00-\uDBFF\uDFFF`;G70.S=` \r @@ -959,13 +959,13 @@ or add '--force' (or use 'seal-use webhook replay --force') if you ex `)}if(Z.length===1)console.error(`\uD83D\uDCA1 提示:若希望单配置自动同步,可附加 --auto 参数:seal-use deploy hosecloud sync --auto --corp ${Q.id} `);throw new L4("缺少必需参数 。请从上述候选列表中选择并指定 signKey 执行同步。",2,Z.length===1?`seal-use deploy hosecloud sync ${Z[0].signKey} --corp ${Q.id}`:void 0)}await k0("seal_deploy_hosecloud_sync",U,Q,{signKey:H},E0(J.options));return}throw Error(`Unknown deploy hosecloud action: ${K??""}. Available: requirements, list, get, status, configure, sync.`)}var th0=m(()=>{f4();A4();K4();B6();F$()});var $S0=`--- name: seal-use -description: "v0.10.36: 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.37: 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.36 - short-description: Seal tenant and Hose approval automation (v0.10.36) + version: 0.10.37 + short-description: Seal tenant and Hose approval automation (v0.10.37) --- -# Seal Use (v0.10.36) +# Seal Use (v0.10.37) > CLI 是主执行通道,MCP 默认关闭(插件配置可选开启)。机器通道 (\`stdout\`) 必须输出纯净 JSON,诊断日志与下一步建议统一输出在 \`stderr\`。 @@ -2576,7 +2576,7 @@ ${Ro.map(($)=>`### \`seal-use ${$.domain}\` `}var Eo,Co,Ro;var _o=m(()=>{Eo=[{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 命令仅保留解析兼容,不再新建全局别名。",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"}],Co=[{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 路径杜绝写文件与环境篡改。"}],Ro=[{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 _y1,constants as vy1,existsSync as c6,readdirSync as sS0,statSync as hy1}from"node:fs";import{homedir as Sy1}from"node:os";import{join as C5}from"node:path";function oS0($){if(!c6($))return 0;try{return sS0($).filter((Y)=>Y.endsWith(".json")).length}catch{return 0}}function nj($){try{return _y1($,vy1.W_OK),!0}catch{return!1}}function rS0($){if(!c6($))return[];try{return sS0($).filter((Y)=>Y.endsWith(".json")&&!Y.startsWith("example.")).map((Y)=>C5($,Y))}catch{return[]}}function gy1($){return $.filter((Y)=>{try{return(hy1(Y).mode&63)!==0}catch{return!1}})}function vo(){let $=Sy1(),Y=C5($,".config","seal-use"),z=C5(Y,"enterprises"),U=C5(Y,"config.json"),Q=C5(Y,"seal_tokens.json"),J=C5(Y,"mappings"),I=bU(),K=C5($,"Downloads"),H=["/opt/homebrew/bin/seal-use","/usr/local/bin/seal-use",C5($,".local","bin","seal-use"),C5($,"bin","seal-use")].find((A)=>c6(A))??process.execPath,W={configDir:{name:"配置根目录",path:Y,exists:c6(Y),writable:c6(Y)?nj(Y):!1,description:"用户持久化配置与企业状态根目录"},enterprisesDir:{name:"企业配置目录",path:z,exists:c6(z),writable:c6(z)?nj(z):!1,fileCount:oS0(z),description:"企业连接配置(JSON)保存路径"},globalConfigFile:{name:"全局配置文件",path:U,exists:c6(U),description:"全局工作模式与默认企业配置"},tokenStore:{name:"凭据缓存",path:Q,exists:c6(Q),description:"会话凭据与令牌缓存"},mappingsDir:{name:"规则版本映射快照",path:J,exists:c6(J),fileCount:oS0(J),description:"生产与测试规则版本映射对照表"},agentSkillDir:{name:"AI Agent 技能目录",path:I,exists:c6(C5(I,"SKILL.md")),description:"本地 Agent 技能主目录"},exportDefaultDir:{name:"报表默认导出目录",path:K,exists:c6(K),writable:c6(K)?nj(K):!1,description:"审核大盘报表默认写入目录"},lintersDir:{name:"规则校验器目录 (用户自定义)",path:i$,exists:c6(i$),writable:c6(i$)?nj(i$):!1,description:"用户私有规则校验脚本存放目录"},officialLintersDir:{name:"官方内置规则校验器目录",path:n$,exists:c6(n$),description:"官方标准与严格风控校验脚本目录 (系统自动保护与重写)"},globalBinary:{name:"全局命令行二进制",path:H,exists:c6(H),description:"系统全局命令执行入口"}},X=[];try{X=a8()}catch{X=[]}let Z=v4(),q=Z.defaultCorpId??X[0]?.id,V=X.find((A)=>A.id===q),F=X.filter((A)=>(A.environment??"production").toLowerCase()==="test").length,w=X.length-F,O=[];if(O.push({id:"executable",title:"命令行二进制",status:"ok",message:`当前执行路径: ${process.execPath}`}),W.configDir?.exists&&W.configDir.writable)O.push({id:"config_dir",title:"配置目录访问",status:"ok",message:`${Y} (正常读写)`});else if(W.configDir?.exists)O.push({id:"config_dir",title:"配置目录访问",status:"warn",message:`${Y} (存在但可能不可写)`});else O.push({id:"config_dir",title:"配置目录访问",status:"warn",message:`未检测到配置目录 ${Y},首次运行配置命令时将自动创建`});if(X.length>0)O.push({id:"enterprises",title:"企业接入状态",status:"ok",message:`已接入 ${X.length} 家企业 (正式: ${w}, 测试: ${F})`});else O.push({id:"enterprises",title:"企业接入状态",status:"warn",message:"当前未检测到企业配置,请使用 seal-use corps add-hose 或 add-seal 接入企业"});if(W.agentSkillDir?.exists)O.push({id:"agent_skill",title:"AI Agent 技能",status:"ok",message:`已就绪于 ${I}`});else O.push({id:"agent_skill",title:"AI Agent 技能",status:"warn",message:`未在 ${I} 检测到技能,可运行 'seal-use skill sync' 安装`});let N=[Q,U,vZ(),...rS0(z),...rS0(C5(process.cwd(),"enterprises"))].filter((A,T,C)=>C.indexOf(A)===T&&c6(A)),M=gy1(N);O.push({id:"credential_permissions",title:"凭据文件权限",status:M.length===0?"ok":"warn",message:M.length===0?`已检查 ${N.length} 个凭据文件,均为仅属主可读 (0600)`:`${M.length} 个凭据文件权限宽于 0600(同机其他用户可读,取决于父目录权限),建议 chmod 600:${M.join("、")}`});let D=Z.lint??{enabled:!1,activeLinter:"builtin",minScore:0};if(D.enabled)O.push({id:"rule_linter",title:"规则质量校验器",status:"ok",message:`已开启 (校验器: ${D.activeLinter}, 最低门槛分: ${D.minScore})`});else O.push({id:"rule_linter",title:"规则质量校验器",status:"ok",message:"未开启 (默认关闭,可运行 seal-use config lint enable 开启)"});let P=O.some((A)=>A.status==="warn"||A.status==="error"),j=typeof globalThis.Bun<"u"?`Bun ${globalThis.Bun.version}`:`Node ${process.version}`;return{doctor:P?"warning":"ok",timestamp:new Date().toISOString(),runtime:{version:Z1,executablePath:process.execPath,platform:`${process.platform} (${process.arch})`,engine:j},directories:W,enterprises:{total:X.length,productionCount:w,testCount:F,activeCorpId:V?.id,activeCorpName:V?.name},checks:O,knowledge:{summary:"内嵌系统架构与目录规范白皮书(纯内存只读,零写入依赖)",directorySpecsCount:Eo.length,securityPoliciesCount:Co.length,domainCapabilitiesCount:Ro.length,guideCommand:"seal-use doctor guide"}}}function aS0($){let Y=[],z=$.doctor==="ok"?"✨":"⚠️";Y.push(`\uD83E\uDE7A [Seal Use Doctor] 系统健康诊断看板 ${z}`),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 U=$.checks.find((Q)=>Q.id==="rule_linter");if(U&&U.message.includes("未开启"))Y.push("\uD83D\uDC49 开启规则自动质量校验: seal-use config lint enable");return Y.join(` `)}var tS0=m(()=>{_p();$3();k3();yq();rB();_o()});var eS0={};D8(eS0,{formatTenantDoctorDashboard:()=>ky1,diagnoseTenantContract:()=>yy1});async function yy1($,Y){let z=[],U=Y.environment==="test"?"test":"production",Q=U==="test"?Y.prodCorpId:Y.testCorpId,J=U==="test"?"prodParent":"testTarget",I=Q?U==="test"?"已绑定生产母企业 (上游配置与样本源)":"已绑定测试靶场 (下游隔离演练环境)":void 0,K=null,G=null;try{let O=await T8($);if(K=O.user,G=O.tenant,Boolean(K?.isAdmin||K?.permissions?.includes("*")))z.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 z.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(O){z.push({id:"auth_identity",name:"身份与权限契约",status:"fail",summary:`鉴权握手失败:${O instanceof Error?O.message:String(O)}`,details:{error:String(O)},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 O=await lY($),N=Array.isArray(O.features)?O.features:[],M=N.find((P)=>P?.code==="ai-approval");if(M){let P=typeof M.balance==="number"?M.balance:0,j=typeof M.deductionAmount==="number"&&M.deductionAmount>0?M.deductionAmount:120,A=Math.floor(P/j);if(H.balance=P,H.deductionAmount=j,H.estimatedRuns=A,P<=0)H.status="exhausted",z.push({id:"billing_quota",name:"AI 审批额度余量",status:"fail",summary:"当前额度已耗尽 (余量 0 点),无法执行审批模拟或回归测试",details:{balance:P,deductionAmount:j,estimatedRuns:A},recommendation:`请前往后台充值补充额度 (可通过 seal-use auth link --corp ${Y.id} 免密直达)`});else if(A<10)H.status="low",z.push({id:"billing_quota",name:"AI 审批额度余量",status:"warn",summary:`额度偏低:剩余 ${P} 点 (单笔扣除 ${j} 点),仅可支持约 ${A} 笔审核`,details:{balance:P,deductionAmount:j,estimatedRuns:A},recommendation:`建议补充额度 (可通过 seal-use auth link --corp ${Y.id} 免密直达)`});else H.status="sufficient",z.push({id:"billing_quota",name:"AI 审批额度余量",status:"pass",summary:`额度充裕:剩余 ${P} 点,预估可支持 ${A} 笔审核单据`,details:{balance:P,deductionAmount:j,estimatedRuns:A}})}else z.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(O){z.push({id:"billing_quota",name:"AI 审批额度余量",status:"warn",summary:`读取计费状态失败:${O instanceof Error?O.message:String(O)}`,details:{error:String(O)}})}let X={totalCount:0,activeCount:0,quotaUsed:W.used,quotaRemaining:W.remaining};try{let O=await X6($),N=Array.isArray(O.rules)?O.rules:[];if(X.totalCount=N.length,X.activeCount=N.filter((M)=>M.status==="ACTIVE").length,N.length===0)z.push({id:"rules_status",name:"审核规则状态",status:"warn",summary:"当前租户未配置任何审核规则 (规则数为 0)",details:{totalCount:0,activeCount:0},recommendation:U==="test"&&Q?`可运行 seal-use corps sync-test --corp ${Q} 从生产企业同步规则`:"可运行 seal-use rules add 创建基础规则"});else z.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(O){z.push({id:"rules_status",name:"审核规则状态",status:"fail",summary:`拉取规则列表失败:${O instanceof Error?O.message:String(O)}`,details:{error:String(O)}})}let Z={integrationCount:0,hasReplayChannel:!1,activeWebhookId:void 0};try{let O=await I$($);Z.integrationCount=O.length;let N=O.find((M)=>M.name.includes("回放")||M.name.toLowerCase().includes("replay"));if(Z.hasReplayChannel=Boolean(N),Z.activeWebhookId=N?.id??O[0]?.id,O.length===0)z.push({id:"webhook_integrations",name:"单据推送 Webhook 通道",status:"pass",summary:"未配置任何 Webhook 集成通道 (日常审批无影响;若需自动化系统推流或单据重放将自动创建)",details:{integrationCount:0}});else z.push({id:"webhook_integrations",name:"单据推送 Webhook 通道",status:"pass",summary:`Webhook 集成通道就绪:共 ${O.length} 个通道${N?` (含专属回放通道「${N.name}」)`:""}`,details:{integrationCount:O.length,hasReplayChannel:Z.hasReplayChannel,activeWebhookId:Z.activeWebhookId}})}catch(O){z.push({id:"webhook_integrations",name:"单据推送 Webhook 通道",status:"warn",summary:`检测 Webhook 通道失败:${O instanceof Error?O.message:String(O)}`,details:{error:String(O)}})}if(U==="test")if(Q)z.push({id:"environment_binding",name:"测试环境配对契约",status:"pass",summary:`测试租户已绑定生产母企业「${Q}」,具备样本拉取与配置同步能力`,details:{environment:U,boundCorpId:Q,boundCorpRole:J,boundCorpRoleDescription:I}});else z.push({id:"environment_binding",name:"测试环境配对契约",status:"warn",summary:"测试租户尚未绑定对应的生产母企业,无法直接拉取生产样本执行自动化回归",details:{environment:U},recommendation:`可运行 seal-use corps bind-test ${Y.id} 建立 1 对 1 绑定`});else if(Q)z.push({id:"environment_binding",name:"生产环境安全隔离契约",status:"pass",summary:`生产企业已绑定沙箱测试靶场「${Q}」,回归测试将严格限制在靶场中运行`,details:{environment:U,boundCorpId:Q,boundCorpRole:J,boundCorpRoleDescription:I}});else z.push({id:"environment_binding",name:"生产环境安全隔离契约",status:"warn",summary:"生产企业尚未绑定任何测试企业,所有回归测试功能将触发安全拦截",details:{environment:U},recommendation:`可运行 seal-use corps bind-test ${Y.id} 为该生产租户绑定测试靶场`});let q=z.filter((O)=>O.status==="fail").length,V=z.filter((O)=>O.status==="warn").length,F=z.filter((O)=>O.status==="pass").length,w="HEALTHY";if(q>0)w="BLOCKED";else if(V>0)w="DEGRADED";return{ok:q===0,verdict:w,timestamp:new Date().toISOString(),corp:{id:Y.id,name:Y.name,environment:U,sourceType:Y.source?.type??"native",boundCorpId:Q,boundCorpRole:J,boundCorpRoleDescription:I},summary:{totalChecks:z.length,passedChecks:F,warningChecks:V,failedChecks:q},checks:z,quota:H,rules:X,webhooks:Z}}function ky1($){let{corp:Y,verdict:z,summary:U,checks:Q,quota:J,rules:I,webhooks:K}=$,G=z==="HEALTHY"?"\uD83D\uDFE2 健康良好 (HEALTHY)":z==="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(` 检查汇总: 通过 ${U.passedChecks} · 告警 ${U.warningChecks} · 失败 ${U.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 $g0=m(()=>{B6()});async function Yg0($,Y,z){let U=($??Y??"").toLowerCase();if(U==="guide"||U==="doc"||U==="knowledge"||U==="book"){console.error(`\uD83D\uDCD6 [Seal Use Doctor] 正在读取内嵌系统规范白皮书(纯内存只读)... -`),console.log(lS0());return}if(U==="paths"||U==="dirs"||U==="directories"){let I=vo();x0(I.directories);return}if(U==="auth"){let{selectCorp:I}=await Promise.resolve().then(() => (f4(),pl)),{stringOption:K}=await Promise.resolve().then(() => (A4(),il)),{handleAuthCommand:G}=await Promise.resolve().then(() => (Vo(),bh0)),H=K(z.options.corp)??(Y&&Y!==U?Y:void 0)??(z.command[2]&&z.command[2]!==U?z.command[2]:void 0),W=I(H);await G("check",W,z);return}if(U==="tenant"||U==="corp"||U==="enterprise"){let{selectCorp:I}=await Promise.resolve().then(() => (f4(),pl)),{createSealClient:K}=await Promise.resolve().then(() => (i8(),t00)),{stringOption:G}=await Promise.resolve().then(() => (A4(),il)),{diagnoseTenantContract:H,formatTenantDoctorDashboard:W}=await Promise.resolve().then(() => ($g0(),eS0)),X=G(z.options.corp)??(Y&&Y!==U?Y:void 0)??(z.command[2]&&z.command[2]!==U?z.command[2]:void 0),Z=I(X),q=await K(Z),V=await H(q,Z);if(!(Z0(z.options.quiet)||Z0(z.options.silent)))console.error(W(V));x0(V);return}let Q=vo();if(!(Z0(z.options.quiet)||Z0(z.options.silent)))console.error(aS0(Q));x0(Q)}var zg0=m(()=>{tS0();_o();A4();K4()});var Qg0;var Ug0=m(()=>{Qg0={openapi:"3.1.0",info:{title:"seal-use Wrapped API",version:"0.10.36",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(lS0());return}if(U==="paths"||U==="dirs"||U==="directories"){let I=vo();x0(I.directories);return}if(U==="auth"){let{selectCorp:I}=await Promise.resolve().then(() => (f4(),pl)),{stringOption:K}=await Promise.resolve().then(() => (A4(),il)),{handleAuthCommand:G}=await Promise.resolve().then(() => (Vo(),bh0)),H=K(z.options.corp)??(Y&&Y!==U?Y:void 0)??(z.command[2]&&z.command[2]!==U?z.command[2]:void 0),W=I(H);await G("check",W,z);return}if(U==="tenant"||U==="corp"||U==="enterprise"){let{selectCorp:I}=await Promise.resolve().then(() => (f4(),pl)),{createSealClient:K}=await Promise.resolve().then(() => (i8(),t00)),{stringOption:G}=await Promise.resolve().then(() => (A4(),il)),{diagnoseTenantContract:H,formatTenantDoctorDashboard:W}=await Promise.resolve().then(() => ($g0(),eS0)),X=G(z.options.corp)??(Y&&Y!==U?Y:void 0)??(z.command[2]&&z.command[2]!==U?z.command[2]:void 0),Z=I(X),q=await K(Z),V=await H(q,Z);if(!(Z0(z.options.quiet)||Z0(z.options.silent)))console.error(W(V));x0(V);return}let Q=vo();if(!(Z0(z.options.quiet)||Z0(z.options.silent)))console.error(aS0(Q));x0(Q)}var zg0=m(()=>{tS0();_o();A4();K4()});var Qg0;var Ug0=m(()=>{Qg0={openapi:"3.1.0",info:{title:"seal-use Wrapped API",version:"0.10.37",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 6e0d2a5..c0049fd 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.36", + "version": "0.10.37", "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 37e310f..7950713 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.36 + version: 0.10.37 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 b1470c0..89ef304 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "seal-use", - "version": "0.10.36", + "version": "0.10.37", "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 d610eba..ebece09 100644 --- a/skills/seal-use/SKILL.md +++ b/skills/seal-use/SKILL.md @@ -1,12 +1,12 @@ --- name: seal-use -description: "v0.10.36: 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.37: 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.36 - short-description: Seal tenant and Hose approval automation (v0.10.36) + version: 0.10.37 + short-description: Seal tenant and Hose approval automation (v0.10.37) --- -# Seal Use (v0.10.36) +# Seal Use (v0.10.37) > CLI 是主执行通道,MCP 默认关闭(插件配置可选开启)。机器通道 (`stdout`) 必须输出纯净 JSON,诊断日志与下一步建议统一输出在 `stderr`。