@cortex-agent/server 2026.10.27 → 2026.11.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +255 -21
- package/README.md +54 -7
- package/THIRD_PARTY_NOTICES.txt +1109 -278
- package/defaults/hooks/cortex-hook-api.mjs +2 -1
- package/defaults/plugins/cortex-system/skills/client-manage/SKILL.md +23 -15
- package/dist/agent-adapter/claude/remote-mcp-proxy.js +1 -1
- package/dist/chunks/{anthropic-messages-M3SMXACA.js → anthropic-messages-M732OMEE.js} +1 -1
- package/dist/chunks/{azure-openai-responses-76YWXHSB.js → azure-openai-responses-RAKTV6JY.js} +1 -1
- package/dist/chunks/bedrock-converse-stream-WNUGNZ27.js +62 -0
- package/dist/chunks/bowser-MLGGLXTZ.js +20 -0
- package/dist/chunks/child-runner-MO5RT6FH.js +4 -0
- package/dist/chunks/chunk-2ATTYCRJ.js +4 -0
- package/dist/chunks/{chunk-PXS5SHOV.js → chunk-2ROGTDM2.js} +1 -1
- package/dist/chunks/chunk-2VVRTJQN.js +4 -0
- package/dist/chunks/{chunk-OZGBWAT2.js → chunk-2YTYYG4K.js} +1 -1
- package/dist/chunks/chunk-3CPIMAYX.js +30 -0
- package/dist/chunks/{chunk-FXDIR3SQ.js → chunk-3CZPBLB3.js} +1 -1
- package/dist/chunks/chunk-3ORG56I5.js +8 -0
- package/dist/chunks/{chunk-LEUENXI2.js → chunk-4YLAGSDM.js} +1 -1
- package/dist/chunks/{chunk-HU6UIDEJ.js → chunk-53TQNK7Z.js} +1 -1
- package/dist/chunks/{chunk-4U7XXM4W.js → chunk-5A6CA5TM.js} +1 -1
- package/dist/chunks/{chunk-PBJ5MPPX.js → chunk-5DF5WJNM.js} +1 -1
- package/dist/chunks/chunk-5PAW3DEU.js +50 -0
- package/dist/chunks/{chunk-DXBSQXJL.js → chunk-7GAYFN52.js} +1 -1
- package/dist/chunks/chunk-7GEBDPTT.js +4 -0
- package/dist/chunks/{chunk-NR6U3WIZ.js → chunk-AFTBQRPN.js} +1 -1
- package/dist/chunks/chunk-AVXDF7AG.js +4 -0
- package/dist/chunks/chunk-BDLKI2NT.js +4 -0
- package/dist/chunks/{chunk-P52RMIYX.js → chunk-BJGYGEZO.js} +1 -1
- package/dist/chunks/chunk-BUZQBTV2.js +10 -0
- package/dist/chunks/chunk-BZDIAI5M.js +125 -0
- package/dist/chunks/{chunk-A34TDMIC.js → chunk-CEGSDGYQ.js} +1 -1
- package/dist/chunks/{chunk-Q7CE3UIE.js → chunk-CK3P345X.js} +69 -69
- package/dist/chunks/{chunk-YAEVYJAR.js → chunk-EE3WT25T.js} +1 -1
- package/dist/chunks/chunk-ETIBCA2S.js +4 -0
- package/dist/chunks/{chunk-REBNWCKI.js → chunk-FP7ML72L.js} +1 -1
- package/dist/chunks/{chunk-H2FP6DG4.js → chunk-H4QZ2P3Z.js} +1 -1
- package/dist/chunks/chunk-IA6IODY3.js +4 -0
- package/dist/chunks/{chunk-D3NXKK2L.js → chunk-IKLTEWA3.js} +1 -1
- package/dist/chunks/chunk-IYVZHGUQ.js +5 -0
- package/dist/chunks/chunk-JJDEQ6N2.js +4 -0
- package/dist/chunks/chunk-JKL3AK5D.js +106 -0
- package/dist/chunks/chunk-KDPY2YA3.js +129 -0
- package/dist/chunks/{chunk-SUFW24P4.js → chunk-KUDK7GPS.js} +1 -1
- package/dist/chunks/chunk-LAWOWPZX.js +363 -0
- package/dist/chunks/chunk-LEAV3FFG.js +4 -0
- package/dist/chunks/chunk-LP72AF56.js +45 -0
- package/dist/chunks/{chunk-KENCMLRE.js → chunk-LP7T32PW.js} +1 -1
- package/dist/chunks/chunk-LQTFDC67.js +4 -0
- package/dist/chunks/{chunk-HALUQ7ZF.js → chunk-MGYYSX7Y.js} +1 -1
- package/dist/chunks/chunk-NNBSSISP.js +4 -0
- package/dist/chunks/chunk-NNTQUHLO.js +877 -0
- package/dist/chunks/{chunk-PFMEUFJ7.js → chunk-NRD57ICT.js} +1 -1
- package/dist/chunks/{chunk-QWAQHHRS.js → chunk-NXZS5PEW.js} +1 -1
- package/dist/chunks/chunk-OFEPDNRB.js +4 -0
- package/dist/chunks/{chunk-6LZK4DDH.js → chunk-P7TVR4GY.js} +1 -1
- package/dist/chunks/chunk-QEL6CMLE.js +4 -0
- package/dist/chunks/chunk-QMSSIDRQ.js +70 -0
- package/dist/chunks/chunk-QUXPMNFQ.js +4 -0
- package/dist/chunks/chunk-R52AVUQB.js +5 -0
- package/dist/chunks/chunk-R6CGBSTC.js +22 -0
- package/dist/chunks/chunk-RA2BUYI3.js +6 -0
- package/dist/chunks/chunk-RDW6FRF5.js +4 -0
- package/dist/chunks/chunk-RF4JLYBX.js +6 -0
- package/dist/chunks/{chunk-YPK2CAIZ.js → chunk-ROVKOIHF.js} +1 -1
- package/dist/chunks/chunk-RYLSRII6.js +7 -0
- package/dist/chunks/{chunk-XNSSUVT6.js → chunk-S3MR37DL.js} +1 -1
- package/dist/chunks/chunk-SAJD4EKE.js +10 -0
- package/dist/chunks/chunk-SFX7V5O2.js +10 -0
- package/dist/chunks/chunk-STCNHXPJ.js +6 -0
- package/dist/chunks/{chunk-FOJQXLL2.js → chunk-SY2HV3V5.js} +1 -1
- package/dist/chunks/chunk-T73GHMFB.js +4 -0
- package/dist/chunks/chunk-TKFFQNAP.js +19 -0
- package/dist/chunks/chunk-TMV2ZDOI.js +18 -0
- package/dist/chunks/chunk-TX46YMGI.js +5 -0
- package/dist/chunks/chunk-U23S37TT.js +6 -0
- package/dist/chunks/chunk-UT6DGZDO.js +4 -0
- package/dist/chunks/{chunk-JERCOLY3.js → chunk-V35MFAUQ.js} +4 -6
- package/dist/chunks/chunk-V6X7Y62J.js +7 -0
- package/dist/chunks/chunk-V7K3KNDM.js +4 -0
- package/dist/chunks/{chunk-NAA7GF6Q.js → chunk-VBN2JSER.js} +1 -1
- package/dist/chunks/chunk-VIMHSW6J.js +4 -0
- package/dist/chunks/chunk-VK5J556O.js +4 -0
- package/dist/chunks/chunk-VPVSKJGX.js +6 -0
- package/dist/chunks/chunk-VTL3Z2OP.js +23 -0
- package/dist/chunks/{chunk-X2GYYRVM.js → chunk-VW7TLY3P.js} +1 -1
- package/dist/chunks/chunk-W34AK4SK.js +65 -0
- package/dist/chunks/chunk-W6AKCEYF.js +8 -0
- package/dist/chunks/chunk-WBSE3EF3.js +27 -0
- package/dist/chunks/chunk-WZYS2HAK.js +4 -0
- package/dist/chunks/{chunk-UNVEZI57.js → chunk-XEBEWR6Y.js} +1 -1
- package/dist/chunks/chunk-XPPZ6Y3X.js +8 -0
- package/dist/chunks/chunk-XYSXL3KX.js +4 -0
- package/dist/chunks/chunk-YAAKL3QS.js +80 -0
- package/dist/chunks/chunk-YB5LUJHS.js +65 -0
- package/dist/chunks/chunk-Z24SBRJK.js +4 -0
- package/dist/chunks/cloudflare-workers-ai-system-one-32JCFHI3.js +1 -1
- package/dist/chunks/context-GQKWKFRM.js +4 -0
- package/dist/chunks/cost-OOO32GLC.js +5 -0
- package/dist/chunks/dist-V5FRMUFH.js +4 -0
- package/dist/chunks/easter-egg-3d-CZH7AYZ7.js +4 -0
- package/dist/chunks/{event-streams-3JSFPOTZ.js → event-streams-AVE4MSS6.js} +1 -1
- package/dist/chunks/execution-repo-XXL4FXC6.js +4 -0
- package/dist/chunks/{executions-6ARGR3IO.js → executions-BN6OLLVM.js} +1 -1
- package/dist/chunks/file-H572PL2Z.js +4 -0
- package/dist/chunks/google-generative-ai-2G4ITOZL.js +4 -0
- package/dist/chunks/google-vertex-PACHCMRZ.js +4 -0
- package/dist/chunks/init-75F4V7SK.js +4 -0
- package/dist/chunks/{install-cli-4IZCSDFZ.js → install-cli-ABBD7DO5.js} +1 -1
- package/dist/chunks/{interaction-ask-G5T3H3CG.js → interaction-ask-EE2UPR3Q.js} +1 -1
- package/dist/chunks/{interaction-plan-E5V42MUP.js → interaction-plan-C446T2GZ.js} +1 -1
- package/dist/chunks/{llama-cpp-classify-OTXZWCMW.js → llama-cpp-classify-IA2F2H7A.js} +1 -1
- package/dist/chunks/local-client-stop-5YOLXGYT.js +4 -0
- package/dist/chunks/memory-cli-5SSF6YJM.js +11 -0
- package/dist/chunks/{mistral-conversations-34F66L3O.js → mistral-conversations-VHP63CDS.js} +1 -1
- package/dist/chunks/{model-resolver-N3DTAQ2S.js → model-resolver-FVJNZ6NA.js} +1 -1
- package/dist/chunks/{node-PTK2HCDV.js → node-DAO3SX7O.js} +1 -1
- package/dist/chunks/{openai-codex-2REL6UQU.js → openai-codex-JULCKICT.js} +1 -1
- package/dist/chunks/{openai-codex-responses-ZBVHREB3.js → openai-codex-responses-EHJ4AZBE.js} +1 -1
- package/dist/chunks/{openai-completions-VVIB26SH.js → openai-completions-CRAGQFCE.js} +1 -1
- package/dist/chunks/{openai-decisions-2N6ZRPZC.js → openai-decisions-P5UX7BWY.js} +1 -1
- package/dist/chunks/{openai-responses-735XA2ZX.js → openai-responses-IZ22NVQ7.js} +1 -1
- package/dist/chunks/{openrouter-images-3IKETHAC.js → openrouter-images-W2JAMSRH.js} +1 -1
- package/dist/chunks/{pi-messages-I3E4ZFHA.js → pi-messages-MJEEQU2R.js} +1 -1
- package/dist/chunks/{radius-HXRZVBDB.js → radius-ZM7ZRMXF.js} +1 -1
- package/dist/chunks/{remote-ops-BALZYKH6.js → remote-ops-O5CR4RGA.js} +1 -1
- package/dist/chunks/runner-S6R3US24.js +4 -0
- package/dist/chunks/schedule-cli-4T4YC5V5.js +4 -0
- package/dist/chunks/slack-2CGM4SMY.js +4 -0
- package/dist/chunks/start-ui-http-3D7QNHGB.js +43 -0
- package/dist/chunks/subagent-OZGUOV3J.js +4 -0
- package/dist/chunks/{time-KEHDQT6K.js → time-P6PE52WL.js} +1 -1
- package/dist/chunks/tool-shims-IA2WELXJ.js +4 -0
- package/dist/chunks/typesafe-system-one-6ULACYD4.js +1 -1
- package/dist/chunks/ui-board-H4INJD6C.js +5 -0
- package/dist/chunks/ui-decision-6HHNROIT.js +4 -0
- package/dist/chunks/{ui-file-GVH53O3X.js → ui-file-6PLXHSTB.js} +1 -1
- package/dist/chunks/ui-view-6MDU4GXY.js +4 -0
- package/dist/chunks/virtual-modules-OFI7QKYH.js +4 -0
- package/dist/chunks/waitpoint-W5M3BE55.js +5 -0
- package/dist/chunks/workers-GTFP75MS.js +4 -0
- package/dist/client-bundle/client.mjs +44 -31
- package/dist/client-bundle/manifest.json +2 -2
- package/dist/core/pi-sdk.js +1 -1
- package/dist/domain/auth/cc-auth-cli.js +1 -1
- package/dist/domain/mcp/bundled-server.js +1 -1
- package/dist/domain/mcp/feishu/client.js +4 -0
- package/dist/entry/app.js +201 -191
- package/dist/entry/browser-cli.js +10 -10
- package/dist/entry/cli.js +1 -1
- package/dist/entry/cortex-cli.js +1 -1
- package/dist/entry/daemon.js +4 -4
- package/dist/entry/hook-cli.js +2 -2
- package/dist/entry/production-app-bootstrap.js +1 -1
- package/dist/entry/production-evidence-export-cli.js +1 -1
- package/dist/entry/signal-cli.js +2 -2
- package/dist/tui/index.js +41 -41
- package/package.json +3 -3
- package/vendor/pi/dist/core/extensions/loader.js +1 -1
- package/vendor/pi/dist/extensions/codemode/execute.js +1 -1
- package/vendor/pi-ai/bedrock.js +1 -1
- package/vendor/pi-ai/oauth-load.js +1 -1
- package/web/dist/assets/{board-math-css-BmiXB1z5.js → board-math-css-BgIyUG-C.js} +1 -1
- package/web/dist/assets/index-9lyu2S6W.css +1 -0
- package/web/dist/assets/index-C-hpzey7.js +532 -0
- package/web/dist/assets/{index-XBRXpnC5.js → index-C2eMpcuI.js} +1 -1
- package/web/dist/assets/pdf-worker-DdZgk2mV.js +57 -0
- package/web/dist/assets/pdf.worker.min-Bz_KHX45.js +55 -0
- package/web/dist/index.html +2 -2
- package/web/dist/theme.css +22 -0
- package/dist/chunks/api-GM53PHIL-GFHEXXE6.js +0 -4
- package/dist/chunks/bedrock-converse-stream-5UPX4NTQ.js +0 -58
- package/dist/chunks/child-runner-3GHOWGZP.js +0 -4
- package/dist/chunks/chunk-2ZNLUY2U.js +0 -128
- package/dist/chunks/chunk-3F6WW7HR.js +0 -13
- package/dist/chunks/chunk-3OKHUVEM.js +0 -7
- package/dist/chunks/chunk-3THJYAEF.js +0 -4
- package/dist/chunks/chunk-3YHOCPQU.js +0 -10
- package/dist/chunks/chunk-4LLH5OWM.js +0 -10
- package/dist/chunks/chunk-52T37Y47.js +0 -8
- package/dist/chunks/chunk-7MU2AKNM.js +0 -4
- package/dist/chunks/chunk-AAA3UBIS.js +0 -4
- package/dist/chunks/chunk-ASYQHJVQ.js +0 -9
- package/dist/chunks/chunk-BGVHA2D4.js +0 -4
- package/dist/chunks/chunk-BKHDWCRT.js +0 -79
- package/dist/chunks/chunk-CQLH4UVX.js +0 -4
- package/dist/chunks/chunk-D6UA4BZC.js +0 -19
- package/dist/chunks/chunk-DGMNI4AO.js +0 -4
- package/dist/chunks/chunk-DHSA5ACV.js +0 -125
- package/dist/chunks/chunk-DPQPXBTP.js +0 -68
- package/dist/chunks/chunk-E7ZMYIY6.js +0 -30
- package/dist/chunks/chunk-EQITBTJC.js +0 -10
- package/dist/chunks/chunk-EXJA5RIX.js +0 -357
- package/dist/chunks/chunk-FH74NME3.js +0 -115
- package/dist/chunks/chunk-FOQ7VLIL.js +0 -17
- package/dist/chunks/chunk-J5DVLUKY.js +0 -6
- package/dist/chunks/chunk-JW2HFMTF.js +0 -4
- package/dist/chunks/chunk-KIGMAATV.js +0 -23
- package/dist/chunks/chunk-KIU5FAPY.js +0 -5
- package/dist/chunks/chunk-KIWMQPH7.js +0 -739
- package/dist/chunks/chunk-LMSQZ6TQ.js +0 -4
- package/dist/chunks/chunk-MEPASGPP.js +0 -6
- package/dist/chunks/chunk-MFAEUHMV.js +0 -28
- package/dist/chunks/chunk-NKDMKRSB.js +0 -68
- package/dist/chunks/chunk-NKXV32S6.js +0 -4
- package/dist/chunks/chunk-NVX5IPRN.js +0 -4
- package/dist/chunks/chunk-O3JW2F7D.js +0 -8
- package/dist/chunks/chunk-OISO5JXB.js +0 -4
- package/dist/chunks/chunk-OPYXNSMY.js +0 -4
- package/dist/chunks/chunk-PZMXHA6X.js +0 -9
- package/dist/chunks/chunk-QEOFEETJ.js +0 -4
- package/dist/chunks/chunk-REPYBMQS.js +0 -4
- package/dist/chunks/chunk-TAWLERZA.js +0 -4
- package/dist/chunks/chunk-TWAEABGG.js +0 -52
- package/dist/chunks/chunk-TZFLHVOQ.js +0 -7
- package/dist/chunks/chunk-UD3NMUHR.js +0 -12
- package/dist/chunks/chunk-W25TB3PU.js +0 -4
- package/dist/chunks/chunk-W5LGYSPZ.js +0 -4
- package/dist/chunks/chunk-XAJLZR7C.js +0 -28
- package/dist/chunks/chunk-XH6FMP3N.js +0 -71
- package/dist/chunks/chunk-XSRZHN63.js +0 -4
- package/dist/chunks/chunk-YG7OEPR2.js +0 -6
- package/dist/chunks/chunk-YHIWOGVL.js +0 -4
- package/dist/chunks/chunk-YZSHTWNM.js +0 -92
- package/dist/chunks/chunk-Z4H3VDHI.js +0 -4
- package/dist/chunks/client-XOGYH5UR.js +0 -4
- package/dist/chunks/config-DJSQI77S-335IXHSM.js +0 -4
- package/dist/chunks/context-VCQH5OB6.js +0 -4
- package/dist/chunks/cost-PGGFI7QJ.js +0 -5
- package/dist/chunks/dist-PUKMZ7GW.js +0 -4
- package/dist/chunks/easter-egg-3d-MO4MOEVF.js +0 -4
- package/dist/chunks/es5-VNTQPCKX.js +0 -4
- package/dist/chunks/execution-repo-ZLJTBWFC.js +0 -4
- package/dist/chunks/file-7BN7RCAY.js +0 -4
- package/dist/chunks/gateway-UCRPMR75.js +0 -36
- package/dist/chunks/google-generative-ai-2VXWLHWI.js +0 -4
- package/dist/chunks/google-vertex-UA36QP2U.js +0 -4
- package/dist/chunks/init-HA7FAQ73.js +0 -4
- package/dist/chunks/local-client-stop-SQRU7ZZM.js +0 -4
- package/dist/chunks/memory-cli-PYOILNN5.js +0 -11
- package/dist/chunks/models-L5VF4I5O-XXNJYQMQ.js +0 -4
- package/dist/chunks/runner-PLVZDGHB.js +0 -4
- package/dist/chunks/schedule-cli-OLASBBYJ.js +0 -4
- package/dist/chunks/slack-WAGSPZUX.js +0 -4
- package/dist/chunks/start-ui-http-QALT7C3P.js +0 -43
- package/dist/chunks/subagent-E3UC7ZHC.js +0 -4
- package/dist/chunks/tool-shims-Q6P6UXVC.js +0 -4
- package/dist/chunks/ui-board-4GYW6KKW.js +0 -5
- package/dist/chunks/ui-decision-U2FXSEC2.js +0 -4
- package/dist/chunks/ui-view-O7PLANT7.js +0 -4
- package/dist/chunks/virtual-modules-IDC5YKZJ.js +0 -4
- package/dist/chunks/waitpoint-2FGQBIAC.js +0 -5
- package/dist/chunks/workers-XN4PSTH6.js +0 -4
- package/vendor/aistatus/gateway-cli.js +0 -21
- package/web/dist/assets/index-DqWMdMkh.css +0 -1
- package/web/dist/assets/index-btKNdkvc.js +0 -525
- package/web/dist/assets/pdf-worker-Hp15W1QJ.js +0 -57
- package/web/dist/assets/pdf.worker.min-DnhTvCwe.js +0 -55
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { createRequire as __cortexCreateRequire } from 'node:module';
|
|
2
|
-
const require = __cortexCreateRequire(import.meta.url);
|
|
3
|
-
const __cortexPackageRoot = new URL("../../", import.meta.url);
|
|
4
|
-
import{A as X,B as ze,C as z,E as se,F as ri,G as Ss,b as vs,c as Ga,d as Wa,e as Qa,f as bs,g as $s,h as yr,i as gr,j as Ya,k as Xa,l as xs,m as ei,n as f,p as G,q as ce,r as ti,t as oe,u as U,v as k,w as ge,x as re,y as ws,z as ks}from"./chunk-DPQPXBTP.js";import{c as x,e as Ja}from"./chunk-WHC7AYZD.js";var Vr=x(B=>{"use strict";Object.defineProperty(B,"__esModule",{value:!0});B.regexpCode=B.getEsmExportName=B.getProperty=B.safeStringify=B.stringify=B.strConcat=B.addCodeArg=B.str=B._=B.nil=B._Code=B.Name=B.IDENTIFIER=B._CodeOrName=void 0;var Dr=class{};B._CodeOrName=Dr;B.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;var kt=class extends Dr{constructor(e){if(super(),!B.IDENTIFIER.test(e))throw new Error("CodeGen: name must be a valid identifier");this.str=e}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}};B.Name=kt;var je=class extends Dr{constructor(e){super(),this._items=typeof e=="string"?[e]:e}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;let e=this._items[0];return e===""||e==='""'}get str(){var e;return(e=this._str)!==null&&e!==void 0?e:this._str=this._items.reduce((r,n)=>`${r}${n}`,"")}get names(){var e;return(e=this._names)!==null&&e!==void 0?e:this._names=this._items.reduce((r,n)=>(n instanceof kt&&(r[n.str]=(r[n.str]||0)+1),r),{})}};B._Code=je;B.nil=new je("");function lc(t,...e){let r=[t[0]],n=0;for(;n<e.length;)Xs(r,e[n]),r.push(t[++n]);return new je(r)}B._=lc;var Ys=new je("+");function dc(t,...e){let r=[Zr(t[0])],n=0;for(;n<e.length;)r.push(Ys),Xs(r,e[n]),r.push(Ys,Zr(t[++n]));return jp(r),new je(r)}B.str=dc;function Xs(t,e){e instanceof je?t.push(...e._items):e instanceof kt?t.push(e):t.push(Ap(e))}B.addCodeArg=Xs;function jp(t){let e=1;for(;e<t.length-1;){if(t[e]===Ys){let r=Ip(t[e-1],t[e+1]);if(r!==void 0){t.splice(e-1,3,r);continue}t[e++]="+"}e++}}function Ip(t,e){if(e==='""')return t;if(t==='""')return e;if(typeof t=="string")return e instanceof kt||t[t.length-1]!=='"'?void 0:typeof e!="string"?`${t.slice(0,-1)}${e}"`:e[0]==='"'?t.slice(0,-1)+e.slice(1):void 0;if(typeof e=="string"&&e[0]==='"'&&!(t instanceof kt))return`"${t}${e.slice(1)}`}function Mp(t,e){return e.emptyStr()?t:t.emptyStr()?e:dc`${t}${e}`}B.strConcat=Mp;function Ap(t){return typeof t=="number"||typeof t=="boolean"||t===null?t:Zr(Array.isArray(t)?t.join(","):t)}function Cp(t){return new je(Zr(t))}B.stringify=Cp;function Zr(t){return JSON.stringify(t).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}B.safeStringify=Zr;function qp(t){return typeof t=="string"&&B.IDENTIFIER.test(t)?new je(`.${t}`):lc`[${t}]`}B.getProperty=qp;function Dp(t){if(typeof t=="string"&&B.IDENTIFIER.test(t))return new je(`${t}`);throw new Error(`CodeGen: invalid export name: ${t}, use explicit $id name mapping`)}B.getEsmExportName=Dp;function Zp(t){return new je(t.toString())}B.regexpCode=Zp});var ro=x(we=>{"use strict";Object.defineProperty(we,"__esModule",{value:!0});we.ValueScope=we.ValueScopeName=we.Scope=we.varKinds=we.UsedValueState=void 0;var xe=Vr(),eo=class extends Error{constructor(e){super(`CodeGen: "code" for ${e} not defined`),this.value=e.value}},An;(function(t){t[t.Started=0]="Started",t[t.Completed=1]="Completed"})(An||(we.UsedValueState=An={}));we.varKinds={const:new xe.Name("const"),let:new xe.Name("let"),var:new xe.Name("var")};var Cn=class{constructor({prefixes:e,parent:r}={}){this._names={},this._prefixes=e,this._parent=r}toName(e){return e instanceof xe.Name?e:this.name(e)}name(e){return new xe.Name(this._newName(e))}_newName(e){let r=this._names[e]||this._nameGroup(e);return`${e}${r.index++}`}_nameGroup(e){var r,n;if(!((n=(r=this._parent)===null||r===void 0?void 0:r._prefixes)===null||n===void 0)&&n.has(e)||this._prefixes&&!this._prefixes.has(e))throw new Error(`CodeGen: prefix "${e}" is not allowed in this scope`);return this._names[e]={prefix:e,index:0}}};we.Scope=Cn;var qn=class extends xe.Name{constructor(e,r){super(r),this.prefix=e}setValue(e,{property:r,itemIndex:n}){this.value=e,this.scopePath=(0,xe._)`.${new xe.Name(r)}[${n}]`}};we.ValueScopeName=qn;var Vp=(0,xe._)`\n`,to=class extends Cn{constructor(e){super(e),this._values={},this._scope=e.scope,this.opts={...e,_n:e.lines?Vp:xe.nil}}get(){return this._scope}name(e){return new qn(e,this._newName(e))}value(e,r){var n;if(r.ref===void 0)throw new Error("CodeGen: ref must be passed in value");let s=this.toName(e),{prefix:o}=s,a=(n=r.key)!==null&&n!==void 0?n:r.ref,i=this._values[o];if(i){let l=i.get(a);if(l)return l}else i=this._values[o]=new Map;i.set(a,s);let c=this._scope[o]||(this._scope[o]=[]),u=c.length;return c[u]=r.ref,s.setValue(r,{property:o,itemIndex:u}),s}getValue(e,r){let n=this._values[e];if(n)return n.get(r)}scopeRefs(e,r=this._values){return this._reduceValues(r,n=>{if(n.scopePath===void 0)throw new Error(`CodeGen: name "${n}" has no value`);return(0,xe._)`${e}${n.scopePath}`})}scopeCode(e=this._values,r,n){return this._reduceValues(e,s=>{if(s.value===void 0)throw new Error(`CodeGen: name "${s}" has no value`);return s.value.code},r,n)}_reduceValues(e,r,n={},s){let o=xe.nil;for(let a in e){let i=e[a];if(!i)continue;let c=n[a]=n[a]||new Map;i.forEach(u=>{if(c.has(u))return;c.set(u,An.Started);let l=r(u);if(l){let d=this.opts.es5?we.varKinds.var:we.varKinds.const;o=(0,xe._)`${o}${d} ${u} = ${l};${this.opts._n}`}else if(l=s?.(u))o=(0,xe._)`${o}${l}${this.opts._n}`;else throw new eo(u);c.set(u,An.Completed)})}return o}};we.ValueScope=to});var A=x(q=>{"use strict";Object.defineProperty(q,"__esModule",{value:!0});q.or=q.and=q.not=q.CodeGen=q.operators=q.varKinds=q.ValueScopeName=q.ValueScope=q.Scope=q.Name=q.regexpCode=q.stringify=q.getProperty=q.nil=q.strConcat=q.str=q._=void 0;var L=Vr(),Ve=ro(),mt=Vr();Object.defineProperty(q,"_",{enumerable:!0,get:function(){return mt._}});Object.defineProperty(q,"str",{enumerable:!0,get:function(){return mt.str}});Object.defineProperty(q,"strConcat",{enumerable:!0,get:function(){return mt.strConcat}});Object.defineProperty(q,"nil",{enumerable:!0,get:function(){return mt.nil}});Object.defineProperty(q,"getProperty",{enumerable:!0,get:function(){return mt.getProperty}});Object.defineProperty(q,"stringify",{enumerable:!0,get:function(){return mt.stringify}});Object.defineProperty(q,"regexpCode",{enumerable:!0,get:function(){return mt.regexpCode}});Object.defineProperty(q,"Name",{enumerable:!0,get:function(){return mt.Name}});var Ln=ro();Object.defineProperty(q,"Scope",{enumerable:!0,get:function(){return Ln.Scope}});Object.defineProperty(q,"ValueScope",{enumerable:!0,get:function(){return Ln.ValueScope}});Object.defineProperty(q,"ValueScopeName",{enumerable:!0,get:function(){return Ln.ValueScopeName}});Object.defineProperty(q,"varKinds",{enumerable:!0,get:function(){return Ln.varKinds}});q.operators={GT:new L._Code(">"),GTE:new L._Code(">="),LT:new L._Code("<"),LTE:new L._Code("<="),EQ:new L._Code("==="),NEQ:new L._Code("!=="),NOT:new L._Code("!"),OR:new L._Code("||"),AND:new L._Code("&&"),ADD:new L._Code("+")};var ot=class{optimizeNodes(){return this}optimizeNames(e,r){return this}},no=class extends ot{constructor(e,r,n){super(),this.varKind=e,this.name=r,this.rhs=n}render({es5:e,_n:r}){let n=e?Ve.varKinds.var:this.varKind,s=this.rhs===void 0?"":` = ${this.rhs}`;return`${n} ${this.name}${s};`+r}optimizeNames(e,r){if(e[this.name.str])return this.rhs&&(this.rhs=Yt(this.rhs,e,r)),this}get names(){return this.rhs instanceof L._CodeOrName?this.rhs.names:{}}},Dn=class extends ot{constructor(e,r,n){super(),this.lhs=e,this.rhs=r,this.sideEffects=n}render({_n:e}){return`${this.lhs} = ${this.rhs};`+e}optimizeNames(e,r){if(!(this.lhs instanceof L.Name&&!e[this.lhs.str]&&!this.sideEffects))return this.rhs=Yt(this.rhs,e,r),this}get names(){let e=this.lhs instanceof L.Name?{}:{...this.lhs.names};return Vn(e,this.rhs)}},so=class extends Dn{constructor(e,r,n,s){super(e,n,s),this.op=r}render({_n:e}){return`${this.lhs} ${this.op}= ${this.rhs};`+e}},oo=class extends ot{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`${this.label}:`+e}},ao=class extends ot{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`break${this.label?` ${this.label}`:""};`+e}},io=class extends ot{constructor(e){super(),this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}},co=class extends ot{constructor(e){super(),this.code=e}render({_n:e}){return`${this.code};`+e}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(e,r){return this.code=Yt(this.code,e,r),this}get names(){return this.code instanceof L._CodeOrName?this.code.names:{}}},Lr=class extends ot{constructor(e=[]){super(),this.nodes=e}render(e){return this.nodes.reduce((r,n)=>r+n.render(e),"")}optimizeNodes(){let{nodes:e}=this,r=e.length;for(;r--;){let n=e[r].optimizeNodes();Array.isArray(n)?e.splice(r,1,...n):n?e[r]=n:e.splice(r,1)}return e.length>0?this:void 0}optimizeNames(e,r){let{nodes:n}=this,s=n.length;for(;s--;){let o=n[s];o.optimizeNames(e,r)||(Lp(e,o.names),n.splice(s,1))}return n.length>0?this:void 0}get names(){return this.nodes.reduce((e,r)=>Tt(e,r.names),{})}},at=class extends Lr{render(e){return"{"+e._n+super.render(e)+"}"+e._n}},uo=class extends Lr{},Qt=class extends at{};Qt.kind="else";var St=class t extends at{constructor(e,r){super(r),this.condition=e}render(e){let r=`if(${this.condition})`+super.render(e);return this.else&&(r+="else "+this.else.render(e)),r}optimizeNodes(){super.optimizeNodes();let e=this.condition;if(e===!0)return this.nodes;let r=this.else;if(r){let n=r.optimizeNodes();r=this.else=Array.isArray(n)?new Qt(n):n}if(r)return e===!1?r instanceof t?r:r.nodes:this.nodes.length?this:new t(fc(e),r instanceof t?[r]:r.nodes);if(!(e===!1||!this.nodes.length))return this}optimizeNames(e,r){var n;if(this.else=(n=this.else)===null||n===void 0?void 0:n.optimizeNames(e,r),!!(super.optimizeNames(e,r)||this.else))return this.condition=Yt(this.condition,e,r),this}get names(){let e=super.names;return Vn(e,this.condition),this.else&&Tt(e,this.else.names),e}};St.kind="if";var zt=class extends at{};zt.kind="for";var lo=class extends zt{constructor(e){super(),this.iteration=e}render(e){return`for(${this.iteration})`+super.render(e)}optimizeNames(e,r){if(super.optimizeNames(e,r))return this.iteration=Yt(this.iteration,e,r),this}get names(){return Tt(super.names,this.iteration.names)}},fo=class extends zt{constructor(e,r,n,s){super(),this.varKind=e,this.name=r,this.from=n,this.to=s}render(e){let r=e.es5?Ve.varKinds.var:this.varKind,{name:n,from:s,to:o}=this;return`for(${r} ${n}=${s}; ${n}<${o}; ${n}++)`+super.render(e)}get names(){let e=Vn(super.names,this.from);return Vn(e,this.to)}},Zn=class extends zt{constructor(e,r,n,s){super(),this.loop=e,this.varKind=r,this.name=n,this.iterable=s}render(e){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(e)}optimizeNames(e,r){if(super.optimizeNames(e,r))return this.iterable=Yt(this.iterable,e,r),this}get names(){return Tt(super.names,this.iterable.names)}},Ur=class extends at{constructor(e,r,n){super(),this.name=e,this.args=r,this.async=n}render(e){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(e)}};Ur.kind="func";var Fr=class extends Lr{render(e){return"return "+super.render(e)}};Fr.kind="return";var po=class extends at{render(e){let r="try"+super.render(e);return this.catch&&(r+=this.catch.render(e)),this.finally&&(r+=this.finally.render(e)),r}optimizeNodes(){var e,r;return super.optimizeNodes(),(e=this.catch)===null||e===void 0||e.optimizeNodes(),(r=this.finally)===null||r===void 0||r.optimizeNodes(),this}optimizeNames(e,r){var n,s;return super.optimizeNames(e,r),(n=this.catch)===null||n===void 0||n.optimizeNames(e,r),(s=this.finally)===null||s===void 0||s.optimizeNames(e,r),this}get names(){let e=super.names;return this.catch&&Tt(e,this.catch.names),this.finally&&Tt(e,this.finally.names),e}},Hr=class extends at{constructor(e){super(),this.error=e}render(e){return`catch(${this.error})`+super.render(e)}};Hr.kind="catch";var Kr=class extends at{render(e){return"finally"+super.render(e)}};Kr.kind="finally";var mo=class{constructor(e,r={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...r,_n:r.lines?`
|
|
5
|
-
`:""},this._extScope=e,this._scope=new Ve.Scope({parent:e}),this._nodes=[new uo]}toString(){return this._root.render(this.opts)}name(e){return this._scope.name(e)}scopeName(e){return this._extScope.name(e)}scopeValue(e,r){let n=this._extScope.value(e,r);return(this._values[n.prefix]||(this._values[n.prefix]=new Set)).add(n),n}getScopeValue(e,r){return this._extScope.getValue(e,r)}scopeRefs(e){return this._extScope.scopeRefs(e,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(e,r,n,s){let o=this._scope.toName(r);return n!==void 0&&s&&(this._constants[o.str]=n),this._leafNode(new no(e,o,n)),o}const(e,r,n){return this._def(Ve.varKinds.const,e,r,n)}let(e,r,n){return this._def(Ve.varKinds.let,e,r,n)}var(e,r,n){return this._def(Ve.varKinds.var,e,r,n)}assign(e,r,n){return this._leafNode(new Dn(e,r,n))}add(e,r){return this._leafNode(new so(e,q.operators.ADD,r))}code(e){return typeof e=="function"?e():e!==L.nil&&this._leafNode(new co(e)),this}object(...e){let r=["{"];for(let[n,s]of e)r.length>1&&r.push(","),r.push(n),(n!==s||this.opts.es5)&&(r.push(":"),(0,L.addCodeArg)(r,s));return r.push("}"),new L._Code(r)}if(e,r,n){if(this._blockNode(new St(e)),r&&n)this.code(r).else().code(n).endIf();else if(r)this.code(r).endIf();else if(n)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(e){return this._elseNode(new St(e))}else(){return this._elseNode(new Qt)}endIf(){return this._endBlockNode(St,Qt)}_for(e,r){return this._blockNode(e),r&&this.code(r).endFor(),this}for(e,r){return this._for(new lo(e),r)}forRange(e,r,n,s,o=this.opts.es5?Ve.varKinds.var:Ve.varKinds.let){let a=this._scope.toName(e);return this._for(new fo(o,a,r,n),()=>s(a))}forOf(e,r,n,s=Ve.varKinds.const){let o=this._scope.toName(e);if(this.opts.es5){let a=r instanceof L.Name?r:this.var("_arr",r);return this.forRange("_i",0,(0,L._)`${a}.length`,i=>{this.var(o,(0,L._)`${a}[${i}]`),n(o)})}return this._for(new Zn("of",s,o,r),()=>n(o))}forIn(e,r,n,s=this.opts.es5?Ve.varKinds.var:Ve.varKinds.const){if(this.opts.ownProperties)return this.forOf(e,(0,L._)`Object.keys(${r})`,n);let o=this._scope.toName(e);return this._for(new Zn("in",s,o,r),()=>n(o))}endFor(){return this._endBlockNode(zt)}label(e){return this._leafNode(new oo(e))}break(e){return this._leafNode(new ao(e))}return(e){let r=new Fr;if(this._blockNode(r),this.code(e),r.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(Fr)}try(e,r,n){if(!r&&!n)throw new Error('CodeGen: "try" without "catch" and "finally"');let s=new po;if(this._blockNode(s),this.code(e),r){let o=this.name("e");this._currNode=s.catch=new Hr(o),r(o)}return n&&(this._currNode=s.finally=new Kr,this.code(n)),this._endBlockNode(Hr,Kr)}throw(e){return this._leafNode(new io(e))}block(e,r){return this._blockStarts.push(this._nodes.length),e&&this.code(e).endBlock(r),this}endBlock(e){let r=this._blockStarts.pop();if(r===void 0)throw new Error("CodeGen: not in self-balancing block");let n=this._nodes.length-r;if(n<0||e!==void 0&&n!==e)throw new Error(`CodeGen: wrong number of nodes: ${n} vs ${e} expected`);return this._nodes.length=r,this}func(e,r=L.nil,n,s){return this._blockNode(new Ur(e,r,n)),s&&this.code(s).endFunc(),this}endFunc(){return this._endBlockNode(Ur)}optimize(e=1){for(;e-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(e){return this._currNode.nodes.push(e),this}_blockNode(e){this._currNode.nodes.push(e),this._nodes.push(e)}_endBlockNode(e,r){let n=this._currNode;if(n instanceof e||r&&n instanceof r)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${r?`${e.kind}/${r.kind}`:e.kind}"`)}_elseNode(e){let r=this._currNode;if(!(r instanceof St))throw new Error('CodeGen: "else" without "if"');return this._currNode=r.else=e,this}get _root(){return this._nodes[0]}get _currNode(){let e=this._nodes;return e[e.length-1]}set _currNode(e){let r=this._nodes;r[r.length-1]=e}};q.CodeGen=mo;function Tt(t,e){for(let r in e)t[r]=(t[r]||0)+(e[r]||0);return t}function Vn(t,e){return e instanceof L._CodeOrName?Tt(t,e.names):t}function Yt(t,e,r){if(t instanceof L.Name)return n(t);if(!s(t))return t;return new L._Code(t._items.reduce((o,a)=>(a instanceof L.Name&&(a=n(a)),a instanceof L._Code?o.push(...a._items):o.push(a),o),[]));function n(o){let a=r[o.str];return a===void 0||e[o.str]!==1?o:(delete e[o.str],a)}function s(o){return o instanceof L._Code&&o._items.some(a=>a instanceof L.Name&&e[a.str]===1&&r[a.str]!==void 0)}}function Lp(t,e){for(let r in e)t[r]=(t[r]||0)-(e[r]||0)}function fc(t){return typeof t=="boolean"||typeof t=="number"||t===null?!t:(0,L._)`!${ho(t)}`}q.not=fc;var Up=pc(q.operators.AND);function Fp(...t){return t.reduce(Up)}q.and=Fp;var Hp=pc(q.operators.OR);function Kp(...t){return t.reduce(Hp)}q.or=Kp;function pc(t){return(e,r)=>e===L.nil?r:r===L.nil?e:(0,L._)`${ho(e)} ${t} ${ho(r)}`}function ho(t){return t instanceof L.Name?t:(0,L._)`(${t})`}});var H=x(D=>{"use strict";Object.defineProperty(D,"__esModule",{value:!0});D.checkStrictMode=D.getErrorPath=D.Type=D.useFunc=D.setEvaluated=D.evaluatedPropsToName=D.mergeEvaluated=D.eachItem=D.unescapeJsonPointer=D.escapeJsonPointer=D.escapeFragment=D.unescapeFragment=D.schemaRefOrVal=D.schemaHasRulesButRef=D.schemaHasRules=D.checkUnknownRules=D.alwaysValidSchema=D.toHash=void 0;var Y=A(),Bp=Vr();function Jp(t){let e={};for(let r of t)e[r]=!0;return e}D.toHash=Jp;function Gp(t,e){return typeof e=="boolean"?e:Object.keys(e).length===0?!0:(yc(t,e),!gc(e,t.self.RULES.all))}D.alwaysValidSchema=Gp;function yc(t,e=t.schema){let{opts:r,self:n}=t;if(!r.strictSchema||typeof e=="boolean")return;let s=n.RULES.keywords;for(let o in e)s[o]||bc(t,`unknown keyword: "${o}"`)}D.checkUnknownRules=yc;function gc(t,e){if(typeof t=="boolean")return!t;for(let r in t)if(e[r])return!0;return!1}D.schemaHasRules=gc;function Wp(t,e){if(typeof t=="boolean")return!t;for(let r in t)if(r!=="$ref"&&e.all[r])return!0;return!1}D.schemaHasRulesButRef=Wp;function Qp({topSchemaRef:t,schemaPath:e},r,n,s){if(!s){if(typeof r=="number"||typeof r=="boolean")return r;if(typeof r=="string")return(0,Y._)`${r}`}return(0,Y._)`${t}${e}${(0,Y.getProperty)(n)}`}D.schemaRefOrVal=Qp;function Yp(t){return _c(decodeURIComponent(t))}D.unescapeFragment=Yp;function Xp(t){return encodeURIComponent(go(t))}D.escapeFragment=Xp;function go(t){return typeof t=="number"?`${t}`:t.replace(/~/g,"~0").replace(/\//g,"~1")}D.escapeJsonPointer=go;function _c(t){return t.replace(/~1/g,"/").replace(/~0/g,"~")}D.unescapeJsonPointer=_c;function em(t,e){if(Array.isArray(t))for(let r of t)e(r);else e(t)}D.eachItem=em;function mc({mergeNames:t,mergeToName:e,mergeValues:r,resultToName:n}){return(s,o,a,i)=>{let c=a===void 0?o:a instanceof Y.Name?(o instanceof Y.Name?t(s,o,a):e(s,o,a),a):o instanceof Y.Name?(e(s,a,o),o):r(o,a);return i===Y.Name&&!(c instanceof Y.Name)?n(s,c):c}}D.mergeEvaluated={props:mc({mergeNames:(t,e,r)=>t.if((0,Y._)`${r} !== true && ${e} !== undefined`,()=>{t.if((0,Y._)`${e} === true`,()=>t.assign(r,!0),()=>t.assign(r,(0,Y._)`${r} || {}`).code((0,Y._)`Object.assign(${r}, ${e})`))}),mergeToName:(t,e,r)=>t.if((0,Y._)`${r} !== true`,()=>{e===!0?t.assign(r,!0):(t.assign(r,(0,Y._)`${r} || {}`),_o(t,r,e))}),mergeValues:(t,e)=>t===!0?!0:{...t,...e},resultToName:vc}),items:mc({mergeNames:(t,e,r)=>t.if((0,Y._)`${r} !== true && ${e} !== undefined`,()=>t.assign(r,(0,Y._)`${e} === true ? true : ${r} > ${e} ? ${r} : ${e}`)),mergeToName:(t,e,r)=>t.if((0,Y._)`${r} !== true`,()=>t.assign(r,e===!0?!0:(0,Y._)`${r} > ${e} ? ${r} : ${e}`)),mergeValues:(t,e)=>t===!0?!0:Math.max(t,e),resultToName:(t,e)=>t.var("items",e)})};function vc(t,e){if(e===!0)return t.var("props",!0);let r=t.var("props",(0,Y._)`{}`);return e!==void 0&&_o(t,r,e),r}D.evaluatedPropsToName=vc;function _o(t,e,r){Object.keys(r).forEach(n=>t.assign((0,Y._)`${e}${(0,Y.getProperty)(n)}`,!0))}D.setEvaluated=_o;var hc={};function tm(t,e){return t.scopeValue("func",{ref:e,code:hc[e.code]||(hc[e.code]=new Bp._Code(e.code))})}D.useFunc=tm;var yo;(function(t){t[t.Num=0]="Num",t[t.Str=1]="Str"})(yo||(D.Type=yo={}));function rm(t,e,r){if(t instanceof Y.Name){let n=e===yo.Num;return r?n?(0,Y._)`"[" + ${t} + "]"`:(0,Y._)`"['" + ${t} + "']"`:n?(0,Y._)`"/" + ${t}`:(0,Y._)`"/" + ${t}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return r?(0,Y.getProperty)(t).toString():"/"+go(t)}D.getErrorPath=rm;function bc(t,e,r=t.opts.strictSchema){if(r){if(e=`strict mode: ${e}`,r===!0)throw new Error(e);t.self.logger.warn(e)}}D.checkStrictMode=bc});var it=x(vo=>{"use strict";Object.defineProperty(vo,"__esModule",{value:!0});var me=A(),nm={data:new me.Name("data"),valCxt:new me.Name("valCxt"),instancePath:new me.Name("instancePath"),parentData:new me.Name("parentData"),parentDataProperty:new me.Name("parentDataProperty"),rootData:new me.Name("rootData"),dynamicAnchors:new me.Name("dynamicAnchors"),vErrors:new me.Name("vErrors"),errors:new me.Name("errors"),this:new me.Name("this"),self:new me.Name("self"),scope:new me.Name("scope"),json:new me.Name("json"),jsonPos:new me.Name("jsonPos"),jsonLen:new me.Name("jsonLen"),jsonPart:new me.Name("jsonPart")};vo.default=nm});var Br=x(he=>{"use strict";Object.defineProperty(he,"__esModule",{value:!0});he.extendErrors=he.resetErrorsCount=he.reportExtraError=he.reportError=he.keyword$DataError=he.keywordError=void 0;var K=A(),Un=H(),be=it();he.keywordError={message:({keyword:t})=>(0,K.str)`must pass "${t}" keyword validation`};he.keyword$DataError={message:({keyword:t,schemaType:e})=>e?(0,K.str)`"${t}" keyword must be ${e} ($data)`:(0,K.str)`"${t}" keyword is invalid ($data)`};function sm(t,e=he.keywordError,r,n){let{it:s}=t,{gen:o,compositeRule:a,allErrors:i}=s,c=wc(t,e,r);n??(a||i)?$c(o,c):xc(s,(0,K._)`[${c}]`)}he.reportError=sm;function om(t,e=he.keywordError,r){let{it:n}=t,{gen:s,compositeRule:o,allErrors:a}=n,i=wc(t,e,r);$c(s,i),o||a||xc(n,be.default.vErrors)}he.reportExtraError=om;function am(t,e){t.assign(be.default.errors,e),t.if((0,K._)`${be.default.vErrors} !== null`,()=>t.if(e,()=>t.assign((0,K._)`${be.default.vErrors}.length`,e),()=>t.assign(be.default.vErrors,null)))}he.resetErrorsCount=am;function im({gen:t,keyword:e,schemaValue:r,data:n,errsCount:s,it:o}){if(s===void 0)throw new Error("ajv implementation error");let a=t.name("err");t.forRange("i",s,be.default.errors,i=>{t.const(a,(0,K._)`${be.default.vErrors}[${i}]`),t.if((0,K._)`${a}.instancePath === undefined`,()=>t.assign((0,K._)`${a}.instancePath`,(0,K.strConcat)(be.default.instancePath,o.errorPath))),t.assign((0,K._)`${a}.schemaPath`,(0,K.str)`${o.errSchemaPath}/${e}`),o.opts.verbose&&(t.assign((0,K._)`${a}.schema`,r),t.assign((0,K._)`${a}.data`,n))})}he.extendErrors=im;function $c(t,e){let r=t.const("err",e);t.if((0,K._)`${be.default.vErrors} === null`,()=>t.assign(be.default.vErrors,(0,K._)`[${r}]`),(0,K._)`${be.default.vErrors}.push(${r})`),t.code((0,K._)`${be.default.errors}++`)}function xc(t,e){let{gen:r,validateName:n,schemaEnv:s}=t;s.$async?r.throw((0,K._)`new ${t.ValidationError}(${e})`):(r.assign((0,K._)`${n}.errors`,e),r.return(!1))}var Pt={keyword:new K.Name("keyword"),schemaPath:new K.Name("schemaPath"),params:new K.Name("params"),propertyName:new K.Name("propertyName"),message:new K.Name("message"),schema:new K.Name("schema"),parentSchema:new K.Name("parentSchema")};function wc(t,e,r){let{createErrors:n}=t.it;return n===!1?(0,K._)`{}`:cm(t,e,r)}function cm(t,e,r={}){let{gen:n,it:s}=t,o=[um(s,r),lm(t,r)];return dm(t,e,o),n.object(...o)}function um({errorPath:t},{instancePath:e}){let r=e?(0,K.str)`${t}${(0,Un.getErrorPath)(e,Un.Type.Str)}`:t;return[be.default.instancePath,(0,K.strConcat)(be.default.instancePath,r)]}function lm({keyword:t,it:{errSchemaPath:e}},{schemaPath:r,parentSchema:n}){let s=n?e:(0,K.str)`${e}/${t}`;return r&&(s=(0,K.str)`${s}${(0,Un.getErrorPath)(r,Un.Type.Str)}`),[Pt.schemaPath,s]}function dm(t,{params:e,message:r},n){let{keyword:s,data:o,schemaValue:a,it:i}=t,{opts:c,propertyName:u,topSchemaRef:l,schemaPath:d}=i;n.push([Pt.keyword,s],[Pt.params,typeof e=="function"?e(t):e||(0,K._)`{}`]),c.messages&&n.push([Pt.message,typeof r=="function"?r(t):r]),c.verbose&&n.push([Pt.schema,a],[Pt.parentSchema,(0,K._)`${l}${d}`],[be.default.data,o]),u&&n.push([Pt.propertyName,u])}});var Sc=x(Xt=>{"use strict";Object.defineProperty(Xt,"__esModule",{value:!0});Xt.boolOrEmptySchema=Xt.topBoolOrEmptySchema=void 0;var fm=Br(),pm=A(),mm=it(),hm={message:"boolean schema is false"};function ym(t){let{gen:e,schema:r,validateName:n}=t;r===!1?kc(t,!1):typeof r=="object"&&r.$async===!0?e.return(mm.default.data):(e.assign((0,pm._)`${n}.errors`,null),e.return(!0))}Xt.topBoolOrEmptySchema=ym;function gm(t,e){let{gen:r,schema:n}=t;n===!1?(r.var(e,!1),kc(t)):r.var(e,!0)}Xt.boolOrEmptySchema=gm;function kc(t,e){let{gen:r,data:n}=t,s={gen:r,keyword:"false schema",data:n,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:t};(0,fm.reportError)(s,hm,void 0,e)}});var bo=x(er=>{"use strict";Object.defineProperty(er,"__esModule",{value:!0});er.getRules=er.isJSONType=void 0;var _m=["string","number","integer","boolean","null","object","array"],vm=new Set(_m);function bm(t){return typeof t=="string"&&vm.has(t)}er.isJSONType=bm;function $m(){let t={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...t,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},t.number,t.string,t.array,t.object],post:{rules:[]},all:{},keywords:{}}}er.getRules=$m});var $o=x(ht=>{"use strict";Object.defineProperty(ht,"__esModule",{value:!0});ht.shouldUseRule=ht.shouldUseGroup=ht.schemaHasRulesForType=void 0;function xm({schema:t,self:e},r){let n=e.RULES.types[r];return n&&n!==!0&&zc(t,n)}ht.schemaHasRulesForType=xm;function zc(t,e){return e.rules.some(r=>Tc(t,r))}ht.shouldUseGroup=zc;function Tc(t,e){var r;return t[e.keyword]!==void 0||((r=e.definition.implements)===null||r===void 0?void 0:r.some(n=>t[n]!==void 0))}ht.shouldUseRule=Tc});var Jr=x(ye=>{"use strict";Object.defineProperty(ye,"__esModule",{value:!0});ye.reportTypeError=ye.checkDataTypes=ye.checkDataType=ye.coerceAndCheckDataType=ye.getJSONTypes=ye.getSchemaTypes=ye.DataType=void 0;var wm=bo(),km=$o(),Sm=Br(),M=A(),Pc=H(),tr;(function(t){t[t.Correct=0]="Correct",t[t.Wrong=1]="Wrong"})(tr||(ye.DataType=tr={}));function zm(t){let e=Ec(t.type);if(e.includes("null")){if(t.nullable===!1)throw new Error("type: null contradicts nullable: false")}else{if(!e.length&&t.nullable!==void 0)throw new Error('"nullable" cannot be used without "type"');t.nullable===!0&&e.push("null")}return e}ye.getSchemaTypes=zm;function Ec(t){let e=Array.isArray(t)?t:t?[t]:[];if(e.every(wm.isJSONType))return e;throw new Error("type must be JSONType or JSONType[]: "+e.join(","))}ye.getJSONTypes=Ec;function Tm(t,e){let{gen:r,data:n,opts:s}=t,o=Pm(e,s.coerceTypes),a=e.length>0&&!(o.length===0&&e.length===1&&(0,km.schemaHasRulesForType)(t,e[0]));if(a){let i=wo(e,n,s.strictNumbers,tr.Wrong);r.if(i,()=>{o.length?Em(t,e,o):ko(t)})}return a}ye.coerceAndCheckDataType=Tm;var Rc=new Set(["string","number","integer","boolean","null"]);function Pm(t,e){return e?t.filter(r=>Rc.has(r)||e==="array"&&r==="array"):[]}function Em(t,e,r){let{gen:n,data:s,opts:o}=t,a=n.let("dataType",(0,M._)`typeof ${s}`),i=n.let("coerced",(0,M._)`undefined`);o.coerceTypes==="array"&&n.if((0,M._)`${a} == 'object' && Array.isArray(${s}) && ${s}.length == 1`,()=>n.assign(s,(0,M._)`${s}[0]`).assign(a,(0,M._)`typeof ${s}`).if(wo(e,s,o.strictNumbers),()=>n.assign(i,s))),n.if((0,M._)`${i} !== undefined`);for(let u of r)(Rc.has(u)||u==="array"&&o.coerceTypes==="array")&&c(u);n.else(),ko(t),n.endIf(),n.if((0,M._)`${i} !== undefined`,()=>{n.assign(s,i),Rm(t,i)});function c(u){switch(u){case"string":n.elseIf((0,M._)`${a} == "number" || ${a} == "boolean"`).assign(i,(0,M._)`"" + ${s}`).elseIf((0,M._)`${s} === null`).assign(i,(0,M._)`""`);return;case"number":n.elseIf((0,M._)`${a} == "boolean" || ${s} === null
|
|
6
|
-
|| (${a} == "string" && ${s} && ${s} == +${s})`).assign(i,(0,M._)`+${s}`);return;case"integer":n.elseIf((0,M._)`${a} === "boolean" || ${s} === null
|
|
7
|
-
|| (${a} === "string" && ${s} && ${s} == +${s} && !(${s} % 1))`).assign(i,(0,M._)`+${s}`);return;case"boolean":n.elseIf((0,M._)`${s} === "false" || ${s} === 0 || ${s} === null`).assign(i,!1).elseIf((0,M._)`${s} === "true" || ${s} === 1`).assign(i,!0);return;case"null":n.elseIf((0,M._)`${s} === "" || ${s} === 0 || ${s} === false`),n.assign(i,null);return;case"array":n.elseIf((0,M._)`${a} === "string" || ${a} === "number"
|
|
8
|
-
|| ${a} === "boolean" || ${s} === null`).assign(i,(0,M._)`[${s}]`)}}}function Rm({gen:t,parentData:e,parentDataProperty:r},n){t.if((0,M._)`${e} !== undefined`,()=>t.assign((0,M._)`${e}[${r}]`,n))}function xo(t,e,r,n=tr.Correct){let s=n===tr.Correct?M.operators.EQ:M.operators.NEQ,o;switch(t){case"null":return(0,M._)`${e} ${s} null`;case"array":o=(0,M._)`Array.isArray(${e})`;break;case"object":o=(0,M._)`${e} && typeof ${e} == "object" && !Array.isArray(${e})`;break;case"integer":o=a((0,M._)`!(${e} % 1) && !isNaN(${e})`);break;case"number":o=a();break;default:return(0,M._)`typeof ${e} ${s} ${t}`}return n===tr.Correct?o:(0,M.not)(o);function a(i=M.nil){return(0,M.and)((0,M._)`typeof ${e} == "number"`,i,r?(0,M._)`isFinite(${e})`:M.nil)}}ye.checkDataType=xo;function wo(t,e,r,n){if(t.length===1)return xo(t[0],e,r,n);let s,o=(0,Pc.toHash)(t);if(o.array&&o.object){let a=(0,M._)`typeof ${e} != "object"`;s=o.null?a:(0,M._)`!${e} || ${a}`,delete o.null,delete o.array,delete o.object}else s=M.nil;o.number&&delete o.integer;for(let a in o)s=(0,M.and)(s,xo(a,e,r,n));return s}ye.checkDataTypes=wo;var Om={message:({schema:t})=>`must be ${t}`,params:({schema:t,schemaValue:e})=>typeof t=="string"?(0,M._)`{type: ${t}}`:(0,M._)`{type: ${e}}`};function ko(t){let e=Nm(t);(0,Sm.reportError)(e,Om)}ye.reportTypeError=ko;function Nm(t){let{gen:e,data:r,schema:n}=t,s=(0,Pc.schemaRefOrVal)(t,n,"type");return{gen:e,keyword:"type",data:r,schema:n.type,schemaCode:s,schemaValue:s,parentSchema:n,params:{},it:t}}});var Nc=x(Fn=>{"use strict";Object.defineProperty(Fn,"__esModule",{value:!0});Fn.assignDefaults=void 0;var rr=A(),jm=H();function Im(t,e){let{properties:r,items:n}=t.schema;if(e==="object"&&r)for(let s in r)Oc(t,s,r[s].default);else e==="array"&&Array.isArray(n)&&n.forEach((s,o)=>Oc(t,o,s.default))}Fn.assignDefaults=Im;function Oc(t,e,r){let{gen:n,compositeRule:s,data:o,opts:a}=t;if(r===void 0)return;let i=(0,rr._)`${o}${(0,rr.getProperty)(e)}`;if(s){(0,jm.checkStrictMode)(t,`default is ignored for: ${i}`);return}let c=(0,rr._)`${i} === undefined`;a.useDefaults==="empty"&&(c=(0,rr._)`${c} || ${i} === null || ${i} === ""`),n.if(c,(0,rr._)`${i} = ${(0,rr.stringify)(r)}`)}});var Ie=x(Q=>{"use strict";Object.defineProperty(Q,"__esModule",{value:!0});Q.validateUnion=Q.validateArray=Q.usePattern=Q.callValidateCode=Q.schemaProperties=Q.allSchemaProperties=Q.noPropertyInData=Q.propertyInData=Q.isOwnProperty=Q.hasPropFunc=Q.reportMissingProp=Q.checkMissingProp=Q.checkReportMissingProp=void 0;var ee=A(),So=H(),yt=it(),Mm=H();function Am(t,e){let{gen:r,data:n,it:s}=t;r.if(To(r,n,e,s.opts.ownProperties),()=>{t.setParams({missingProperty:(0,ee._)`${e}`},!0),t.error()})}Q.checkReportMissingProp=Am;function Cm({gen:t,data:e,it:{opts:r}},n,s){return(0,ee.or)(...n.map(o=>(0,ee.and)(To(t,e,o,r.ownProperties),(0,ee._)`${s} = ${o}`)))}Q.checkMissingProp=Cm;function qm(t,e){t.setParams({missingProperty:e},!0),t.error()}Q.reportMissingProp=qm;function jc(t){return t.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,ee._)`Object.prototype.hasOwnProperty`})}Q.hasPropFunc=jc;function zo(t,e,r){return(0,ee._)`${jc(t)}.call(${e}, ${r})`}Q.isOwnProperty=zo;function Dm(t,e,r,n){let s=(0,ee._)`${e}${(0,ee.getProperty)(r)} !== undefined`;return n?(0,ee._)`${s} && ${zo(t,e,r)}`:s}Q.propertyInData=Dm;function To(t,e,r,n){let s=(0,ee._)`${e}${(0,ee.getProperty)(r)} === undefined`;return n?(0,ee.or)(s,(0,ee.not)(zo(t,e,r))):s}Q.noPropertyInData=To;function Ic(t){return t?Object.keys(t).filter(e=>e!=="__proto__"):[]}Q.allSchemaProperties=Ic;function Zm(t,e){return Ic(e).filter(r=>!(0,So.alwaysValidSchema)(t,e[r]))}Q.schemaProperties=Zm;function Vm({schemaCode:t,data:e,it:{gen:r,topSchemaRef:n,schemaPath:s,errorPath:o},it:a},i,c,u){let l=u?(0,ee._)`${t}, ${e}, ${n}${s}`:e,d=[[yt.default.instancePath,(0,ee.strConcat)(yt.default.instancePath,o)],[yt.default.parentData,a.parentData],[yt.default.parentDataProperty,a.parentDataProperty],[yt.default.rootData,yt.default.rootData]];a.opts.dynamicRef&&d.push([yt.default.dynamicAnchors,yt.default.dynamicAnchors]);let m=(0,ee._)`${l}, ${r.object(...d)}`;return c!==ee.nil?(0,ee._)`${i}.call(${c}, ${m})`:(0,ee._)`${i}(${m})`}Q.callValidateCode=Vm;var Lm=(0,ee._)`new RegExp`;function Um({gen:t,it:{opts:e}},r){let n=e.unicodeRegExp?"u":"",{regExp:s}=e.code,o=s(r,n);return t.scopeValue("pattern",{key:o.toString(),ref:o,code:(0,ee._)`${s.code==="new RegExp"?Lm:(0,Mm.useFunc)(t,s)}(${r}, ${n})`})}Q.usePattern=Um;function Fm(t){let{gen:e,data:r,keyword:n,it:s}=t,o=e.name("valid");if(s.allErrors){let i=e.let("valid",!0);return a(()=>e.assign(i,!1)),i}return e.var(o,!0),a(()=>e.break()),o;function a(i){let c=e.const("len",(0,ee._)`${r}.length`);e.forRange("i",0,c,u=>{t.subschema({keyword:n,dataProp:u,dataPropType:So.Type.Num},o),e.if((0,ee.not)(o),i)})}}Q.validateArray=Fm;function Hm(t){let{gen:e,schema:r,keyword:n,it:s}=t;if(!Array.isArray(r))throw new Error("ajv implementation error");if(r.some(c=>(0,So.alwaysValidSchema)(s,c))&&!s.opts.unevaluated)return;let a=e.let("valid",!1),i=e.name("_valid");e.block(()=>r.forEach((c,u)=>{let l=t.subschema({keyword:n,schemaProp:u,compositeRule:!0},i);e.assign(a,(0,ee._)`${a} || ${i}`),t.mergeValidEvaluated(l,i)||e.if((0,ee.not)(a))})),t.result(a,()=>t.reset(),()=>t.error(!0))}Q.validateUnion=Hm});var Cc=x(Ge=>{"use strict";Object.defineProperty(Ge,"__esModule",{value:!0});Ge.validateKeywordUsage=Ge.validSchemaType=Ge.funcKeywordCode=Ge.macroKeywordCode=void 0;var $e=A(),Et=it(),Km=Ie(),Bm=Br();function Jm(t,e){let{gen:r,keyword:n,schema:s,parentSchema:o,it:a}=t,i=e.macro.call(a.self,s,o,a),c=Ac(r,n,i);a.opts.validateSchema!==!1&&a.self.validateSchema(i,!0);let u=r.name("valid");t.subschema({schema:i,schemaPath:$e.nil,errSchemaPath:`${a.errSchemaPath}/${n}`,topSchemaRef:c,compositeRule:!0},u),t.pass(u,()=>t.error(!0))}Ge.macroKeywordCode=Jm;function Gm(t,e){var r;let{gen:n,keyword:s,schema:o,parentSchema:a,$data:i,it:c}=t;Qm(c,e);let u=!i&&e.compile?e.compile.call(c.self,o,a,c):e.validate,l=Ac(n,s,u),d=n.let("valid");t.block$data(d,m),t.ok((r=e.valid)!==null&&r!==void 0?r:d);function m(){if(e.errors===!1)y(),e.modifying&&Mc(t),v(()=>t.error());else{let $=e.async?p():h();e.modifying&&Mc(t),v(()=>Wm(t,$))}}function p(){let $=n.let("ruleErrs",null);return n.try(()=>y((0,$e._)`await `),P=>n.assign(d,!1).if((0,$e._)`${P} instanceof ${c.ValidationError}`,()=>n.assign($,(0,$e._)`${P}.errors`),()=>n.throw(P))),$}function h(){let $=(0,$e._)`${l}.errors`;return n.assign($,null),y($e.nil),$}function y($=e.async?(0,$e._)`await `:$e.nil){let P=c.opts.passContext?Et.default.this:Et.default.self,O=!("compile"in e&&!i||e.schema===!1);n.assign(d,(0,$e._)`${$}${(0,Km.callValidateCode)(t,l,P,O)}`,e.modifying)}function v($){var P;n.if((0,$e.not)((P=e.valid)!==null&&P!==void 0?P:d),$)}}Ge.funcKeywordCode=Gm;function Mc(t){let{gen:e,data:r,it:n}=t;e.if(n.parentData,()=>e.assign(r,(0,$e._)`${n.parentData}[${n.parentDataProperty}]`))}function Wm(t,e){let{gen:r}=t;r.if((0,$e._)`Array.isArray(${e})`,()=>{r.assign(Et.default.vErrors,(0,$e._)`${Et.default.vErrors} === null ? ${e} : ${Et.default.vErrors}.concat(${e})`).assign(Et.default.errors,(0,$e._)`${Et.default.vErrors}.length`),(0,Bm.extendErrors)(t)},()=>t.error())}function Qm({schemaEnv:t},e){if(e.async&&!t.$async)throw new Error("async keyword in sync schema")}function Ac(t,e,r){if(r===void 0)throw new Error(`keyword "${e}" failed to compile`);return t.scopeValue("keyword",typeof r=="function"?{ref:r}:{ref:r,code:(0,$e.stringify)(r)})}function Ym(t,e,r=!1){return!e.length||e.some(n=>n==="array"?Array.isArray(t):n==="object"?t&&typeof t=="object"&&!Array.isArray(t):typeof t==n||r&&typeof t>"u")}Ge.validSchemaType=Ym;function Xm({schema:t,opts:e,self:r,errSchemaPath:n},s,o){if(Array.isArray(s.keyword)?!s.keyword.includes(o):s.keyword!==o)throw new Error("ajv implementation error");let a=s.dependencies;if(a?.some(i=>!Object.prototype.hasOwnProperty.call(t,i)))throw new Error(`parent schema must have dependencies of ${o}: ${a.join(",")}`);if(s.validateSchema&&!s.validateSchema(t[o])){let c=`keyword "${o}" value is invalid at path "${n}": `+r.errorsText(s.validateSchema.errors);if(e.validateSchema==="log")r.logger.error(c);else throw new Error(c)}}Ge.validateKeywordUsage=Xm});var Dc=x(gt=>{"use strict";Object.defineProperty(gt,"__esModule",{value:!0});gt.extendSubschemaMode=gt.extendSubschemaData=gt.getSubschema=void 0;var We=A(),qc=H();function eh(t,{keyword:e,schemaProp:r,schema:n,schemaPath:s,errSchemaPath:o,topSchemaRef:a}){if(e!==void 0&&n!==void 0)throw new Error('both "keyword" and "schema" passed, only one allowed');if(e!==void 0){let i=t.schema[e];return r===void 0?{schema:i,schemaPath:(0,We._)`${t.schemaPath}${(0,We.getProperty)(e)}`,errSchemaPath:`${t.errSchemaPath}/${e}`}:{schema:i[r],schemaPath:(0,We._)`${t.schemaPath}${(0,We.getProperty)(e)}${(0,We.getProperty)(r)}`,errSchemaPath:`${t.errSchemaPath}/${e}/${(0,qc.escapeFragment)(r)}`}}if(n!==void 0){if(s===void 0||o===void 0||a===void 0)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:n,schemaPath:s,topSchemaRef:a,errSchemaPath:o}}throw new Error('either "keyword" or "schema" must be passed')}gt.getSubschema=eh;function th(t,e,{dataProp:r,dataPropType:n,data:s,dataTypes:o,propertyName:a}){if(s!==void 0&&r!==void 0)throw new Error('both "data" and "dataProp" passed, only one allowed');let{gen:i}=e;if(r!==void 0){let{errorPath:u,dataPathArr:l,opts:d}=e,m=i.let("data",(0,We._)`${e.data}${(0,We.getProperty)(r)}`,!0);c(m),t.errorPath=(0,We.str)`${u}${(0,qc.getErrorPath)(r,n,d.jsPropertySyntax)}`,t.parentDataProperty=(0,We._)`${r}`,t.dataPathArr=[...l,t.parentDataProperty]}if(s!==void 0){let u=s instanceof We.Name?s:i.let("data",s,!0);c(u),a!==void 0&&(t.propertyName=a)}o&&(t.dataTypes=o);function c(u){t.data=u,t.dataLevel=e.dataLevel+1,t.dataTypes=[],e.definedProperties=new Set,t.parentData=e.data,t.dataNames=[...e.dataNames,u]}}gt.extendSubschemaData=th;function rh(t,{jtdDiscriminator:e,jtdMetadata:r,compositeRule:n,createErrors:s,allErrors:o}){n!==void 0&&(t.compositeRule=n),s!==void 0&&(t.createErrors=s),o!==void 0&&(t.allErrors=o),t.jtdDiscriminator=e,t.jtdMetadata=r}gt.extendSubschemaMode=rh});var Po=x((sz,Zc)=>{"use strict";Zc.exports=function t(e,r){if(e===r)return!0;if(e&&r&&typeof e=="object"&&typeof r=="object"){if(e.constructor!==r.constructor)return!1;var n,s,o;if(Array.isArray(e)){if(n=e.length,n!=r.length)return!1;for(s=n;s--!==0;)if(!t(e[s],r[s]))return!1;return!0}if(e.constructor===RegExp)return e.source===r.source&&e.flags===r.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===r.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===r.toString();if(o=Object.keys(e),n=o.length,n!==Object.keys(r).length)return!1;for(s=n;s--!==0;)if(!Object.prototype.hasOwnProperty.call(r,o[s]))return!1;for(s=n;s--!==0;){var a=o[s];if(!t(e[a],r[a]))return!1}return!0}return e!==e&&r!==r}});var Lc=x((oz,Vc)=>{"use strict";var _t=Vc.exports=function(t,e,r){typeof e=="function"&&(r=e,e={}),r=e.cb||r;var n=typeof r=="function"?r:r.pre||function(){},s=r.post||function(){};Hn(e,n,s,t,"",t)};_t.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0};_t.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0};_t.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0};_t.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 Hn(t,e,r,n,s,o,a,i,c,u){if(n&&typeof n=="object"&&!Array.isArray(n)){e(n,s,o,a,i,c,u);for(var l in n){var d=n[l];if(Array.isArray(d)){if(l in _t.arrayKeywords)for(var m=0;m<d.length;m++)Hn(t,e,r,d[m],s+"/"+l+"/"+m,o,s,l,n,m)}else if(l in _t.propsKeywords){if(d&&typeof d=="object")for(var p in d)Hn(t,e,r,d[p],s+"/"+l+"/"+nh(p),o,s,l,n,p)}else(l in _t.keywords||t.allKeys&&!(l in _t.skipKeywords))&&Hn(t,e,r,d,s+"/"+l,o,s,l,n)}r(n,s,o,a,i,c,u)}}function nh(t){return t.replace(/~/g,"~0").replace(/\//g,"~1")}});var Gr=x(ke=>{"use strict";Object.defineProperty(ke,"__esModule",{value:!0});ke.getSchemaRefs=ke.resolveUrl=ke.normalizeId=ke._getFullPath=ke.getFullPath=ke.inlineRef=void 0;var sh=H(),oh=Po(),ah=Lc(),ih=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function ch(t,e=!0){return typeof t=="boolean"?!0:e===!0?!Eo(t):e?Uc(t)<=e:!1}ke.inlineRef=ch;var uh=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function Eo(t){for(let e in t){if(uh.has(e))return!0;let r=t[e];if(Array.isArray(r)&&r.some(Eo)||typeof r=="object"&&Eo(r))return!0}return!1}function Uc(t){let e=0;for(let r in t){if(r==="$ref")return 1/0;if(e++,!ih.has(r)&&(typeof t[r]=="object"&&(0,sh.eachItem)(t[r],n=>e+=Uc(n)),e===1/0))return 1/0}return e}function Fc(t,e="",r){r!==!1&&(e=nr(e));let n=t.parse(e);return Hc(t,n)}ke.getFullPath=Fc;function Hc(t,e){return t.serialize(e).split("#")[0]+"#"}ke._getFullPath=Hc;var lh=/#\/?$/;function nr(t){return t?t.replace(lh,""):""}ke.normalizeId=nr;function dh(t,e,r){return r=nr(r),t.resolve(e,r)}ke.resolveUrl=dh;var fh=/^[a-z_][-a-z0-9._]*$/i;function ph(t,e){if(typeof t=="boolean")return{};let{schemaId:r,uriResolver:n}=this.opts,s=nr(t[r]||e),o={"":s},a=Fc(n,s,!1),i={},c=new Set;return ah(t,{allKeys:!0},(d,m,p,h)=>{if(h===void 0)return;let y=a+m,v=o[h];typeof d[r]=="string"&&(v=$.call(this,d[r])),P.call(this,d.$anchor),P.call(this,d.$dynamicAnchor),o[m]=v;function $(O){let J=this.opts.uriResolver.resolve;if(O=nr(v?J(v,O):O),c.has(O))throw l(O);c.add(O);let j=this.refs[O];return typeof j=="string"&&(j=this.refs[j]),typeof j=="object"?u(d,j.schema,O):O!==nr(y)&&(O[0]==="#"?(u(d,i[O],O),i[O]=d):this.refs[O]=y),O}function P(O){if(typeof O=="string"){if(!fh.test(O))throw new Error(`invalid anchor "${O}"`);$.call(this,`#${O}`)}}}),i;function u(d,m,p){if(m!==void 0&&!oh(d,m))throw l(p)}function l(d){return new Error(`reference "${d}" resolves to more than one schema`)}}ke.getSchemaRefs=ph});var Yr=x(vt=>{"use strict";Object.defineProperty(vt,"__esModule",{value:!0});vt.getData=vt.KeywordCxt=vt.validateFunctionCode=void 0;var Wc=Sc(),Kc=Jr(),Oo=$o(),Kn=Jr(),mh=Nc(),Qr=Cc(),Ro=Dc(),T=A(),N=it(),hh=Gr(),ct=H(),Wr=Br();function yh(t){if(Xc(t)&&(eu(t),Yc(t))){vh(t);return}Qc(t,()=>(0,Wc.topBoolOrEmptySchema)(t))}vt.validateFunctionCode=yh;function Qc({gen:t,validateName:e,schema:r,schemaEnv:n,opts:s},o){s.code.es5?t.func(e,(0,T._)`${N.default.data}, ${N.default.valCxt}`,n.$async,()=>{t.code((0,T._)`"use strict"; ${Bc(r,s)}`),_h(t,s),t.code(o)}):t.func(e,(0,T._)`${N.default.data}, ${gh(s)}`,n.$async,()=>t.code(Bc(r,s)).code(o))}function gh(t){return(0,T._)`{${N.default.instancePath}="", ${N.default.parentData}, ${N.default.parentDataProperty}, ${N.default.rootData}=${N.default.data}${t.dynamicRef?(0,T._)`, ${N.default.dynamicAnchors}={}`:T.nil}}={}`}function _h(t,e){t.if(N.default.valCxt,()=>{t.var(N.default.instancePath,(0,T._)`${N.default.valCxt}.${N.default.instancePath}`),t.var(N.default.parentData,(0,T._)`${N.default.valCxt}.${N.default.parentData}`),t.var(N.default.parentDataProperty,(0,T._)`${N.default.valCxt}.${N.default.parentDataProperty}`),t.var(N.default.rootData,(0,T._)`${N.default.valCxt}.${N.default.rootData}`),e.dynamicRef&&t.var(N.default.dynamicAnchors,(0,T._)`${N.default.valCxt}.${N.default.dynamicAnchors}`)},()=>{t.var(N.default.instancePath,(0,T._)`""`),t.var(N.default.parentData,(0,T._)`undefined`),t.var(N.default.parentDataProperty,(0,T._)`undefined`),t.var(N.default.rootData,N.default.data),e.dynamicRef&&t.var(N.default.dynamicAnchors,(0,T._)`{}`)})}function vh(t){let{schema:e,opts:r,gen:n}=t;Qc(t,()=>{r.$comment&&e.$comment&&ru(t),kh(t),n.let(N.default.vErrors,null),n.let(N.default.errors,0),r.unevaluated&&bh(t),tu(t),Th(t)})}function bh(t){let{gen:e,validateName:r}=t;t.evaluated=e.const("evaluated",(0,T._)`${r}.evaluated`),e.if((0,T._)`${t.evaluated}.dynamicProps`,()=>e.assign((0,T._)`${t.evaluated}.props`,(0,T._)`undefined`)),e.if((0,T._)`${t.evaluated}.dynamicItems`,()=>e.assign((0,T._)`${t.evaluated}.items`,(0,T._)`undefined`))}function Bc(t,e){let r=typeof t=="object"&&t[e.schemaId];return r&&(e.code.source||e.code.process)?(0,T._)`/*# sourceURL=${r} */`:T.nil}function $h(t,e){if(Xc(t)&&(eu(t),Yc(t))){xh(t,e);return}(0,Wc.boolOrEmptySchema)(t,e)}function Yc({schema:t,self:e}){if(typeof t=="boolean")return!t;for(let r in t)if(e.RULES.all[r])return!0;return!1}function Xc(t){return typeof t.schema!="boolean"}function xh(t,e){let{schema:r,gen:n,opts:s}=t;s.$comment&&r.$comment&&ru(t),Sh(t),zh(t);let o=n.const("_errs",N.default.errors);tu(t,o),n.var(e,(0,T._)`${o} === ${N.default.errors}`)}function eu(t){(0,ct.checkUnknownRules)(t),wh(t)}function tu(t,e){if(t.opts.jtd)return Jc(t,[],!1,e);let r=(0,Kc.getSchemaTypes)(t.schema),n=(0,Kc.coerceAndCheckDataType)(t,r);Jc(t,r,!n,e)}function wh(t){let{schema:e,errSchemaPath:r,opts:n,self:s}=t;e.$ref&&n.ignoreKeywordsWithRef&&(0,ct.schemaHasRulesButRef)(e,s.RULES)&&s.logger.warn(`$ref: keywords ignored in schema at path "${r}"`)}function kh(t){let{schema:e,opts:r}=t;e.default!==void 0&&r.useDefaults&&r.strictSchema&&(0,ct.checkStrictMode)(t,"default is ignored in the schema root")}function Sh(t){let e=t.schema[t.opts.schemaId];e&&(t.baseId=(0,hh.resolveUrl)(t.opts.uriResolver,t.baseId,e))}function zh(t){if(t.schema.$async&&!t.schemaEnv.$async)throw new Error("async schema in sync schema")}function ru({gen:t,schemaEnv:e,schema:r,errSchemaPath:n,opts:s}){let o=r.$comment;if(s.$comment===!0)t.code((0,T._)`${N.default.self}.logger.log(${o})`);else if(typeof s.$comment=="function"){let a=(0,T.str)`${n}/$comment`,i=t.scopeValue("root",{ref:e.root});t.code((0,T._)`${N.default.self}.opts.$comment(${o}, ${a}, ${i}.schema)`)}}function Th(t){let{gen:e,schemaEnv:r,validateName:n,ValidationError:s,opts:o}=t;r.$async?e.if((0,T._)`${N.default.errors} === 0`,()=>e.return(N.default.data),()=>e.throw((0,T._)`new ${s}(${N.default.vErrors})`)):(e.assign((0,T._)`${n}.errors`,N.default.vErrors),o.unevaluated&&Ph(t),e.return((0,T._)`${N.default.errors} === 0`))}function Ph({gen:t,evaluated:e,props:r,items:n}){r instanceof T.Name&&t.assign((0,T._)`${e}.props`,r),n instanceof T.Name&&t.assign((0,T._)`${e}.items`,n)}function Jc(t,e,r,n){let{gen:s,schema:o,data:a,allErrors:i,opts:c,self:u}=t,{RULES:l}=u;if(o.$ref&&(c.ignoreKeywordsWithRef||!(0,ct.schemaHasRulesButRef)(o,l))){s.block(()=>su(t,"$ref",l.all.$ref.definition));return}c.jtd||Eh(t,e),s.block(()=>{for(let m of l.rules)d(m);d(l.post)});function d(m){(0,Oo.shouldUseGroup)(o,m)&&(m.type?(s.if((0,Kn.checkDataType)(m.type,a,c.strictNumbers)),Gc(t,m),e.length===1&&e[0]===m.type&&r&&(s.else(),(0,Kn.reportTypeError)(t)),s.endIf()):Gc(t,m),i||s.if((0,T._)`${N.default.errors} === ${n||0}`))}}function Gc(t,e){let{gen:r,schema:n,opts:{useDefaults:s}}=t;s&&(0,mh.assignDefaults)(t,e.type),r.block(()=>{for(let o of e.rules)(0,Oo.shouldUseRule)(n,o)&&su(t,o.keyword,o.definition,e.type)})}function Eh(t,e){t.schemaEnv.meta||!t.opts.strictTypes||(Rh(t,e),t.opts.allowUnionTypes||Oh(t,e),Nh(t,t.dataTypes))}function Rh(t,e){if(e.length){if(!t.dataTypes.length){t.dataTypes=e;return}e.forEach(r=>{nu(t.dataTypes,r)||No(t,`type "${r}" not allowed by context "${t.dataTypes.join(",")}"`)}),Ih(t,e)}}function Oh(t,e){e.length>1&&!(e.length===2&&e.includes("null"))&&No(t,"use allowUnionTypes to allow union type keyword")}function Nh(t,e){let r=t.self.RULES.all;for(let n in r){let s=r[n];if(typeof s=="object"&&(0,Oo.shouldUseRule)(t.schema,s)){let{type:o}=s.definition;o.length&&!o.some(a=>jh(e,a))&&No(t,`missing type "${o.join(",")}" for keyword "${n}"`)}}}function jh(t,e){return t.includes(e)||e==="number"&&t.includes("integer")}function nu(t,e){return t.includes(e)||e==="integer"&&t.includes("number")}function Ih(t,e){let r=[];for(let n of t.dataTypes)nu(e,n)?r.push(n):e.includes("integer")&&n==="number"&&r.push("integer");t.dataTypes=r}function No(t,e){let r=t.schemaEnv.baseId+t.errSchemaPath;e+=` at "${r}" (strictTypes)`,(0,ct.checkStrictMode)(t,e,t.opts.strictTypes)}var Bn=class{constructor(e,r,n){if((0,Qr.validateKeywordUsage)(e,r,n),this.gen=e.gen,this.allErrors=e.allErrors,this.keyword=n,this.data=e.data,this.schema=e.schema[n],this.$data=r.$data&&e.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,ct.schemaRefOrVal)(e,this.schema,n,this.$data),this.schemaType=r.schemaType,this.parentSchema=e.schema,this.params={},this.it=e,this.def=r,this.$data)this.schemaCode=e.gen.const("vSchema",ou(this.$data,e));else if(this.schemaCode=this.schemaValue,!(0,Qr.validSchemaType)(this.schema,r.schemaType,r.allowUndefined))throw new Error(`${n} value must be ${JSON.stringify(r.schemaType)}`);("code"in r?r.trackErrors:r.errors!==!1)&&(this.errsCount=e.gen.const("_errs",N.default.errors))}result(e,r,n){this.failResult((0,T.not)(e),r,n)}failResult(e,r,n){this.gen.if(e),n?n():this.error(),r?(this.gen.else(),r(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(e,r){this.failResult((0,T.not)(e),void 0,r)}fail(e){if(e===void 0){this.error(),this.allErrors||this.gen.if(!1);return}this.gen.if(e),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(e){if(!this.$data)return this.fail(e);let{schemaCode:r}=this;this.fail((0,T._)`${r} !== undefined && (${(0,T.or)(this.invalid$data(),e)})`)}error(e,r,n){if(r){this.setParams(r),this._error(e,n),this.setParams({});return}this._error(e,n)}_error(e,r){(e?Wr.reportExtraError:Wr.reportError)(this,this.def.error,r)}$dataError(){(0,Wr.reportError)(this,this.def.$dataError||Wr.keyword$DataError)}reset(){if(this.errsCount===void 0)throw new Error('add "trackErrors" to keyword definition');(0,Wr.resetErrorsCount)(this.gen,this.errsCount)}ok(e){this.allErrors||this.gen.if(e)}setParams(e,r){r?Object.assign(this.params,e):this.params=e}block$data(e,r,n=T.nil){this.gen.block(()=>{this.check$data(e,n),r()})}check$data(e=T.nil,r=T.nil){if(!this.$data)return;let{gen:n,schemaCode:s,schemaType:o,def:a}=this;n.if((0,T.or)((0,T._)`${s} === undefined`,r)),e!==T.nil&&n.assign(e,!0),(o.length||a.validateSchema)&&(n.elseIf(this.invalid$data()),this.$dataError(),e!==T.nil&&n.assign(e,!1)),n.else()}invalid$data(){let{gen:e,schemaCode:r,schemaType:n,def:s,it:o}=this;return(0,T.or)(a(),i());function a(){if(n.length){if(!(r instanceof T.Name))throw new Error("ajv implementation error");let c=Array.isArray(n)?n:[n];return(0,T._)`${(0,Kn.checkDataTypes)(c,r,o.opts.strictNumbers,Kn.DataType.Wrong)}`}return T.nil}function i(){if(s.validateSchema){let c=e.scopeValue("validate$data",{ref:s.validateSchema});return(0,T._)`!${c}(${r})`}return T.nil}}subschema(e,r){let n=(0,Ro.getSubschema)(this.it,e);(0,Ro.extendSubschemaData)(n,this.it,e),(0,Ro.extendSubschemaMode)(n,e);let s={...this.it,...n,items:void 0,props:void 0};return $h(s,r),s}mergeEvaluated(e,r){let{it:n,gen:s}=this;n.opts.unevaluated&&(n.props!==!0&&e.props!==void 0&&(n.props=ct.mergeEvaluated.props(s,e.props,n.props,r)),n.items!==!0&&e.items!==void 0&&(n.items=ct.mergeEvaluated.items(s,e.items,n.items,r)))}mergeValidEvaluated(e,r){let{it:n,gen:s}=this;if(n.opts.unevaluated&&(n.props!==!0||n.items!==!0))return s.if(r,()=>this.mergeEvaluated(e,T.Name)),!0}};vt.KeywordCxt=Bn;function su(t,e,r,n){let s=new Bn(t,r,e);"code"in r?r.code(s,n):s.$data&&r.validate?(0,Qr.funcKeywordCode)(s,r):"macro"in r?(0,Qr.macroKeywordCode)(s,r):(r.compile||r.validate)&&(0,Qr.funcKeywordCode)(s,r)}var Mh=/^\/(?:[^~]|~0|~1)*$/,Ah=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function ou(t,{dataLevel:e,dataNames:r,dataPathArr:n}){let s,o;if(t==="")return N.default.rootData;if(t[0]==="/"){if(!Mh.test(t))throw new Error(`Invalid JSON-pointer: ${t}`);s=t,o=N.default.rootData}else{let u=Ah.exec(t);if(!u)throw new Error(`Invalid JSON-pointer: ${t}`);let l=+u[1];if(s=u[2],s==="#"){if(l>=e)throw new Error(c("property/index",l));return n[e-l]}if(l>e)throw new Error(c("data",l));if(o=r[e-l],!s)return o}let a=o,i=s.split("/");for(let u of i)u&&(o=(0,T._)`${o}${(0,T.getProperty)((0,ct.unescapeJsonPointer)(u))}`,a=(0,T._)`${a} && ${o}`);return a;function c(u,l){return`Cannot access ${u} ${l} levels up, current level is ${e}`}}vt.getData=ou});var Jn=x(Io=>{"use strict";Object.defineProperty(Io,"__esModule",{value:!0});var jo=class extends Error{constructor(e){super("validation failed"),this.errors=e,this.ajv=this.validation=!0}};Io.default=jo});var Xr=x(Co=>{"use strict";Object.defineProperty(Co,"__esModule",{value:!0});var Mo=Gr(),Ao=class extends Error{constructor(e,r,n,s){super(s||`can't resolve reference ${n} from id ${r}`),this.missingRef=(0,Mo.resolveUrl)(e,r,n),this.missingSchema=(0,Mo.normalizeId)((0,Mo.getFullPath)(e,this.missingRef))}};Co.default=Ao});var Wn=x(Me=>{"use strict";Object.defineProperty(Me,"__esModule",{value:!0});Me.resolveSchema=Me.getCompilingSchema=Me.resolveRef=Me.compileSchema=Me.SchemaEnv=void 0;var Le=A(),Ch=Jn(),Rt=it(),Ue=Gr(),au=H(),qh=Yr(),sr=class{constructor(e){var r;this.refs={},this.dynamicAnchors={};let n;typeof e.schema=="object"&&(n=e.schema),this.schema=e.schema,this.schemaId=e.schemaId,this.root=e.root||this,this.baseId=(r=e.baseId)!==null&&r!==void 0?r:(0,Ue.normalizeId)(n?.[e.schemaId||"$id"]),this.schemaPath=e.schemaPath,this.localRefs=e.localRefs,this.meta=e.meta,this.$async=n?.$async,this.refs={}}};Me.SchemaEnv=sr;function Do(t){let e=iu.call(this,t);if(e)return e;let r=(0,Ue.getFullPath)(this.opts.uriResolver,t.root.baseId),{es5:n,lines:s}=this.opts.code,{ownProperties:o}=this.opts,a=new Le.CodeGen(this.scope,{es5:n,lines:s,ownProperties:o}),i;t.$async&&(i=a.scopeValue("Error",{ref:Ch.default,code:(0,Le._)`require("ajv/dist/runtime/validation_error").default`}));let c=a.scopeName("validate");t.validateName=c;let u={gen:a,allErrors:this.opts.allErrors,data:Rt.default.data,parentData:Rt.default.parentData,parentDataProperty:Rt.default.parentDataProperty,dataNames:[Rt.default.data],dataPathArr:[Le.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:a.scopeValue("schema",this.opts.code.source===!0?{ref:t.schema,code:(0,Le.stringify)(t.schema)}:{ref:t.schema}),validateName:c,ValidationError:i,schema:t.schema,schemaEnv:t,rootId:r,baseId:t.baseId||r,schemaPath:Le.nil,errSchemaPath:t.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,Le._)`""`,opts:this.opts,self:this},l;try{this._compilations.add(t),(0,qh.validateFunctionCode)(u),a.optimize(this.opts.code.optimize);let d=a.toString();l=`${a.scopeRefs(Rt.default.scope)}return ${d}`,this.opts.code.process&&(l=this.opts.code.process(l,t));let p=new Function(`${Rt.default.self}`,`${Rt.default.scope}`,l)(this,this.scope.get());if(this.scope.value(c,{ref:p}),p.errors=null,p.schema=t.schema,p.schemaEnv=t,t.$async&&(p.$async=!0),this.opts.code.source===!0&&(p.source={validateName:c,validateCode:d,scopeValues:a._values}),this.opts.unevaluated){let{props:h,items:y}=u;p.evaluated={props:h instanceof Le.Name?void 0:h,items:y instanceof Le.Name?void 0:y,dynamicProps:h instanceof Le.Name,dynamicItems:y instanceof Le.Name},p.source&&(p.source.evaluated=(0,Le.stringify)(p.evaluated))}return t.validate=p,t}catch(d){throw delete t.validate,delete t.validateName,l&&this.logger.error("Error compiling schema, function code:",l),d}finally{this._compilations.delete(t)}}Me.compileSchema=Do;function Dh(t,e,r){var n;r=(0,Ue.resolveUrl)(this.opts.uriResolver,e,r);let s=t.refs[r];if(s)return s;let o=Lh.call(this,t,r);if(o===void 0){let a=(n=t.localRefs)===null||n===void 0?void 0:n[r],{schemaId:i}=this.opts;a&&(o=new sr({schema:a,schemaId:i,root:t,baseId:e}))}if(o!==void 0)return t.refs[r]=Zh.call(this,o)}Me.resolveRef=Dh;function Zh(t){return(0,Ue.inlineRef)(t.schema,this.opts.inlineRefs)?t.schema:t.validate?t:Do.call(this,t)}function iu(t){for(let e of this._compilations)if(Vh(e,t))return e}Me.getCompilingSchema=iu;function Vh(t,e){return t.schema===e.schema&&t.root===e.root&&t.baseId===e.baseId}function Lh(t,e){let r;for(;typeof(r=this.refs[e])=="string";)e=r;return r||this.schemas[e]||Gn.call(this,t,e)}function Gn(t,e){let r=this.opts.uriResolver.parse(e),n=(0,Ue._getFullPath)(this.opts.uriResolver,r),s=(0,Ue.getFullPath)(this.opts.uriResolver,t.baseId,void 0);if(Object.keys(t.schema).length>0&&n===s)return qo.call(this,r,t);let o=(0,Ue.normalizeId)(n),a=this.refs[o]||this.schemas[o];if(typeof a=="string"){let i=Gn.call(this,t,a);return typeof i?.schema!="object"?void 0:qo.call(this,r,i)}if(typeof a?.schema=="object"){if(a.validate||Do.call(this,a),o===(0,Ue.normalizeId)(e)){let{schema:i}=a,{schemaId:c}=this.opts,u=i[c];return u&&(s=(0,Ue.resolveUrl)(this.opts.uriResolver,s,u)),new sr({schema:i,schemaId:c,root:t,baseId:s})}return qo.call(this,r,a)}}Me.resolveSchema=Gn;var Uh=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function qo(t,{baseId:e,schema:r,root:n}){var s;if(((s=t.fragment)===null||s===void 0?void 0:s[0])!=="/")return;for(let i of t.fragment.slice(1).split("/")){if(typeof r=="boolean")return;let c=r[(0,au.unescapeFragment)(i)];if(c===void 0)return;r=c;let u=typeof r=="object"&&r[this.opts.schemaId];!Uh.has(i)&&u&&(e=(0,Ue.resolveUrl)(this.opts.uriResolver,e,u))}let o;if(typeof r!="boolean"&&r.$ref&&!(0,au.schemaHasRulesButRef)(r,this.RULES)){let i=(0,Ue.resolveUrl)(this.opts.uriResolver,e,r.$ref);o=Gn.call(this,n,i)}let{schemaId:a}=this.opts;if(o=o||new sr({schema:r,schemaId:a,root:n,baseId:e}),o.schema!==o.root.schema)return o}});var cu=x((dz,Fh)=>{Fh.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}});var Lo=x((fz,mu)=>{"use strict";var Hh=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),lu=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),Zo=RegExp.prototype.test.bind(/^[\da-f]{2}$/iu),du=RegExp.prototype.test.bind(/^[\da-z\-._~]$/iu),Kh=RegExp.prototype.test.bind(/^[\da-z\-._~!$&'()*+,;=:@/]$/iu);function Vo(t){let e="",r=0,n=0;for(n=0;n<t.length;n++)if(r=t[n].charCodeAt(0),r!==48){if(!(r>=48&&r<=57||r>=65&&r<=70||r>=97&&r<=102))return"";e+=t[n];break}for(n+=1;n<t.length;n++){if(r=t[n].charCodeAt(0),!(r>=48&&r<=57||r>=65&&r<=70||r>=97&&r<=102))return"";e+=t[n]}return e}var Bh=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function uu(t){return t.length=0,!0}function Jh(t,e,r){if(t.length){let n=Vo(t);if(n!=="")e.push(n);else return r.error=!0,!1;t.length=0}return!0}function Gh(t){let e=0,r={error:!1,address:"",zone:""},n=[],s=[],o=!1,a=!1,i=Jh;for(let c=0;c<t.length;c++){let u=t[c];if(!(u==="["||u==="]"))if(u===":"){if(o===!0&&(a=!0),!i(s,n,r))break;if(++e>7){r.error=!0;break}c>0&&t[c-1]===":"&&(o=!0),n.push(":");continue}else if(u==="%"){if(!i(s,n,r))break;i=uu}else{s.push(u);continue}}return s.length&&(i===uu?r.zone=s.join(""):a?n.push(s.join("")):n.push(Vo(s))),r.address=n.join(""),r}function fu(t){if(Wh(t,":")<2)return{host:t,isIPV6:!1};let e=Gh(t);if(e.error)return{host:t,isIPV6:!1};{let r=e.address,n=e.address;return e.zone&&(r+="%"+e.zone,n+="%25"+e.zone),{host:r,isIPV6:!0,escapedHost:n}}}function Wh(t,e){let r=0;for(let n=0;n<t.length;n++)t[n]===e&&r++;return r}function Qh(t){let e=t,r=[],n=-1,s=0;for(;s=e.length;){if(s===1){if(e===".")break;if(e==="/"){r.push("/");break}else{r.push(e);break}}else if(s===2){if(e[0]==="."){if(e[1]===".")break;if(e[1]==="/"){e=e.slice(2);continue}}else if(e[0]==="/"&&(e[1]==="."||e[1]==="/")){r.push("/");break}}else if(s===3&&e==="/.."){r.length!==0&&r.pop(),r.push("/");break}if(e[0]==="."){if(e[1]==="."){if(e[2]==="/"){e=e.slice(3);continue}}else if(e[1]==="/"){e=e.slice(2);continue}}else if(e[0]==="/"&&e[1]==="."){if(e[2]==="/"){e=e.slice(2);continue}else if(e[2]==="."&&e[3]==="/"){e=e.slice(3),r.length!==0&&r.pop();continue}}if((n=e.indexOf("/",1))===-1){r.push(e);break}else r.push(e.slice(0,n)),e=e.slice(n)}return r.join("")}var Yh={"@":"%40","/":"%2F","?":"%3F","#":"%23",":":"%3A"},Xh=/[@/?#:]/g,ey=/[@/?#]/g;function pu(t,e){let r=e?ey:Xh;return r.lastIndex=0,t.replace(r,n=>Yh[n])}function ty(t,e=!1){if(t.indexOf("%")===-1)return t;let r="";for(let n=0;n<t.length;n++){if(t[n]==="%"&&n+2<t.length){let s=t.slice(n+1,n+3);if(Zo(s)){let o=s.toUpperCase(),a=String.fromCharCode(parseInt(o,16));e&&du(a)?r+=a:r+="%"+o,n+=2;continue}}r+=t[n]}return r}function ry(t){let e="";for(let r=0;r<t.length;r++){if(t[r]==="%"&&r+2<t.length){let n=t.slice(r+1,r+3);if(Zo(n)){let s=n.toUpperCase(),o=String.fromCharCode(parseInt(s,16));o!=="."&&du(o)?e+=o:e+="%"+s,r+=2;continue}}Kh(t[r])?e+=t[r]:e+=escape(t[r])}return e}function ny(t){let e="";for(let r=0;r<t.length;r++){if(t[r]==="%"&&r+2<t.length){let n=t.slice(r+1,r+3);if(Zo(n)){e+="%"+n.toUpperCase(),r+=2;continue}}e+=escape(t[r])}return e}function sy(t){let e=[];if(t.userinfo!==void 0&&(e.push(t.userinfo),e.push("@")),t.host!==void 0){let r=unescape(t.host);if(!lu(r)){let n=fu(r);n.isIPV6===!0?r=`[${n.escapedHost}]`:r=pu(r,!1)}e.push(r)}return(typeof t.port=="number"||typeof t.port=="string")&&(e.push(":"),e.push(String(t.port))),e.length?e.join(""):void 0}mu.exports={nonSimpleDomain:Bh,recomposeAuthority:sy,reescapeHostDelimiters:pu,normalizePercentEncoding:ty,normalizePathEncoding:ry,escapePreservingEscapes:ny,removeDotSegments:Qh,isIPv4:lu,isUUID:Hh,normalizeIPv6:fu,stringArrayToHexStripped:Vo}});var vu=x((pz,_u)=>{"use strict";var{isUUID:oy}=Lo(),ay=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu,iy=["http","https","ws","wss","urn","urn:uuid"];function cy(t){return iy.indexOf(t)!==-1}function Uo(t){return t.secure===!0?!0:t.secure===!1?!1:t.scheme?t.scheme.length===3&&(t.scheme[0]==="w"||t.scheme[0]==="W")&&(t.scheme[1]==="s"||t.scheme[1]==="S")&&(t.scheme[2]==="s"||t.scheme[2]==="S"):!1}function hu(t){return t.host||(t.error=t.error||"HTTP URIs must have a host."),t}function yu(t){let e=String(t.scheme).toLowerCase()==="https";return(t.port===(e?443:80)||t.port==="")&&(t.port=void 0),t.path||(t.path="/"),t}function uy(t){return t.secure=Uo(t),t.resourceName=(t.path||"/")+(t.query?"?"+t.query:""),t.path=void 0,t.query=void 0,t}function ly(t){if((t.port===(Uo(t)?443:80)||t.port==="")&&(t.port=void 0),typeof t.secure=="boolean"&&(t.scheme=t.secure?"wss":"ws",t.secure=void 0),t.resourceName){let[e,r]=t.resourceName.split("?");t.path=e&&e!=="/"?e:void 0,t.query=r,t.resourceName=void 0}return t.fragment=void 0,t}function dy(t,e){if(!t.path)return t.error="URN can not be parsed",t;let r=t.path.match(ay);if(r){let n=e.scheme||t.scheme||"urn";t.nid=r[1].toLowerCase(),t.nss=r[2];let s=`${n}:${e.nid||t.nid}`,o=Fo(s);t.path=void 0,o&&(t=o.parse(t,e))}else t.error=t.error||"URN can not be parsed.";return t}function fy(t,e){if(t.nid===void 0)throw new Error("URN without nid cannot be serialized");let r=e.scheme||t.scheme||"urn",n=t.nid.toLowerCase(),s=`${r}:${e.nid||n}`,o=Fo(s);o&&(t=o.serialize(t,e));let a=t,i=t.nss;return a.path=`${n||e.nid}:${i}`,e.skipEscape=!0,a}function py(t,e){let r=t;return r.uuid=r.nss,r.nss=void 0,!e.tolerant&&(!r.uuid||!oy(r.uuid))&&(r.error=r.error||"UUID is not valid."),r}function my(t){let e=t;return e.nss=(t.uuid||"").toLowerCase(),e}var gu={scheme:"http",domainHost:!0,parse:hu,serialize:yu},hy={scheme:"https",domainHost:gu.domainHost,parse:hu,serialize:yu},Qn={scheme:"ws",domainHost:!0,parse:uy,serialize:ly},yy={scheme:"wss",domainHost:Qn.domainHost,parse:Qn.parse,serialize:Qn.serialize},gy={scheme:"urn",parse:dy,serialize:fy,skipNormalize:!0},_y={scheme:"urn:uuid",parse:py,serialize:my,skipNormalize:!0},Yn={http:gu,https:hy,ws:Qn,wss:yy,urn:gy,"urn:uuid":_y};Object.setPrototypeOf(Yn,null);function Fo(t){return t&&(Yn[t]||Yn[t.toLowerCase()])||void 0}_u.exports={wsIsSecure:Uo,SCHEMES:Yn,isValidSchemeName:cy,getSchemeHandler:Fo}});var Su=x((mz,Xn)=>{"use strict";var{normalizeIPv6:vy,removeDotSegments:en,recomposeAuthority:by,normalizePercentEncoding:$y,normalizePathEncoding:xy,escapePreservingEscapes:wy,reescapeHostDelimiters:ky,isIPv4:Sy,nonSimpleDomain:zy}=Lo(),{SCHEMES:Ty,getSchemeHandler:$u}=vu();function Py(t,e){return typeof t=="string"?t=jy(t,e):typeof t=="object"&&(t=or(Ot(t,e),e)),t}function Ey(t,e,r){let n=r?Object.assign({scheme:"null"},r):{scheme:"null"},s=xu(or(t,n),or(e,n),n,!0);return n.skipEscape=!0,Ot(s,n)}function xu(t,e,r,n){let s={};return n||(t=or(Ot(t,r),r),e=or(Ot(e,r),r)),r=r||{},!r.tolerant&&e.scheme?(s.scheme=e.scheme,s.userinfo=e.userinfo,s.host=e.host,s.port=e.port,s.path=en(e.path||""),s.query=e.query):(e.userinfo!==void 0||e.host!==void 0||e.port!==void 0?(s.userinfo=e.userinfo,s.host=e.host,s.port=e.port,s.path=en(e.path||""),s.query=e.query):(e.path?(e.path[0]==="/"?s.path=en(e.path):((t.userinfo!==void 0||t.host!==void 0||t.port!==void 0)&&!t.path?s.path="/"+e.path:t.path?s.path=t.path.slice(0,t.path.lastIndexOf("/")+1)+e.path:s.path=e.path,s.path=en(s.path)),s.query=e.query):(s.path=t.path,e.query!==void 0?s.query=e.query:s.query=t.query),s.userinfo=t.userinfo,s.host=t.host,s.port=t.port),s.scheme=t.scheme),s.fragment=e.fragment,s}function Ry(t,e,r){let n=bu(t,r),s=bu(e,r);return n!==void 0&&s!==void 0&&n.toLowerCase()===s.toLowerCase()}function Ot(t,e){let r={host:t.host,scheme:t.scheme,userinfo:t.userinfo,port:t.port,path:t.path,query:t.query,nid:t.nid,nss:t.nss,uuid:t.uuid,fragment:t.fragment,reference:t.reference,resourceName:t.resourceName,secure:t.secure,error:""},n=Object.assign({},e),s=[],o=$u(n.scheme||r.scheme);o&&o.serialize&&o.serialize(r,n),r.path!==void 0&&(n.skipEscape?r.path=$y(r.path):(r.path=wy(r.path),r.scheme!==void 0&&(r.path=r.path.split("%3A").join(":")))),n.reference!=="suffix"&&r.scheme&&s.push(r.scheme,":");let a=by(r);if(a!==void 0&&(n.reference!=="suffix"&&s.push("//"),s.push(a),r.path&&r.path[0]!=="/"&&s.push("/")),r.path!==void 0){let i=r.path;!n.absolutePath&&(!o||!o.absolutePath)&&(i=en(i)),a===void 0&&i[0]==="/"&&i[1]==="/"&&(i="/%2F"+i.slice(2)),s.push(i)}return r.query!==void 0&&s.push("?",r.query),r.fragment!==void 0&&s.push("#",r.fragment),s.join("")}var Oy=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function Ny(t,e){if(e[2]!==void 0&&t.path&&t.path[0]!=="/")return'URI path must start with "/" when authority is present.';if(typeof t.port=="number"&&(t.port<0||t.port>65535))return"URI port is malformed."}function wu(t,e){let r=Object.assign({},e),n={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0},s=!1,o=!1;r.reference==="suffix"&&(r.scheme?t=r.scheme+":"+t:t="//"+t);let a=t.match(Oy);if(a){n.scheme=a[1],n.userinfo=a[3],n.host=a[4],n.port=parseInt(a[5],10),n.path=a[6]||"",n.query=a[7],n.fragment=a[8],isNaN(n.port)&&(n.port=a[5]);let i=Ny(n,a);if(i!==void 0&&(n.error=n.error||i,s=!0),n.host)if(Sy(n.host)===!1){let l=vy(n.host);n.host=l.host.toLowerCase(),o=l.isIPV6}else o=!0;n.scheme===void 0&&n.userinfo===void 0&&n.host===void 0&&n.port===void 0&&n.query===void 0&&!n.path?n.reference="same-document":n.scheme===void 0?n.reference="relative":n.fragment===void 0?n.reference="absolute":n.reference="uri",r.reference&&r.reference!=="suffix"&&r.reference!==n.reference&&(n.error=n.error||"URI is not a "+r.reference+" reference.");let c=$u(r.scheme||n.scheme);if(!r.unicodeSupport&&(!c||!c.unicodeSupport)&&n.host&&(r.domainHost||c&&c.domainHost)&&o===!1&&zy(n.host))try{n.host=new URL("http://"+n.host).hostname}catch(u){n.error=n.error||"Host's domain name can not be converted to ASCII: "+u}if((!c||c&&!c.skipNormalize)&&(t.indexOf("%")!==-1&&(n.scheme!==void 0&&(n.scheme=unescape(n.scheme)),n.host!==void 0&&(n.host=ky(unescape(n.host),o))),n.path&&(n.path=xy(n.path)),n.fragment))try{n.fragment=encodeURI(decodeURIComponent(n.fragment))}catch{n.error=n.error||"URI malformed"}c&&c.parse&&c.parse(n,r)}else n.error=n.error||"URI can not be parsed.";return{parsed:n,malformedAuthorityOrPort:s}}function or(t,e){return wu(t,e).parsed}function jy(t,e){return ku(t,e).normalized}function ku(t,e){let{parsed:r,malformedAuthorityOrPort:n}=wu(t,e);return{normalized:n?t:Ot(r,e),malformedAuthorityOrPort:n}}function bu(t,e){if(typeof t=="string"){let{normalized:r,malformedAuthorityOrPort:n}=ku(t,e);return n?void 0:r}if(typeof t=="object")return Ot(t,e)}var Ho={SCHEMES:Ty,normalize:Py,resolve:Ey,resolveComponent:xu,equal:Ry,serialize:Ot,parse:or};Xn.exports=Ho;Xn.exports.default=Ho;Xn.exports.fastUri=Ho});var Tu=x(Ko=>{"use strict";Object.defineProperty(Ko,"__esModule",{value:!0});var zu=Su();zu.code='require("ajv/dist/runtime/uri").default';Ko.default=zu});var Mu=x(de=>{"use strict";Object.defineProperty(de,"__esModule",{value:!0});de.CodeGen=de.Name=de.nil=de.stringify=de.str=de._=de.KeywordCxt=void 0;var Iy=Yr();Object.defineProperty(de,"KeywordCxt",{enumerable:!0,get:function(){return Iy.KeywordCxt}});var ar=A();Object.defineProperty(de,"_",{enumerable:!0,get:function(){return ar._}});Object.defineProperty(de,"str",{enumerable:!0,get:function(){return ar.str}});Object.defineProperty(de,"stringify",{enumerable:!0,get:function(){return ar.stringify}});Object.defineProperty(de,"nil",{enumerable:!0,get:function(){return ar.nil}});Object.defineProperty(de,"Name",{enumerable:!0,get:function(){return ar.Name}});Object.defineProperty(de,"CodeGen",{enumerable:!0,get:function(){return ar.CodeGen}});var My=Jn(),Nu=Xr(),Ay=bo(),tn=Wn(),Cy=A(),rn=Gr(),es=Jr(),Jo=H(),Pu=cu(),qy=Tu(),ju=(t,e)=>new RegExp(t,e);ju.code="new RegExp";var Dy=["removeAdditional","useDefaults","coerceTypes"],Zy=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),Vy={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."},Ly={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},Eu=200;function Uy(t){var e,r,n,s,o,a,i,c,u,l,d,m,p,h,y,v,$,P,O,J,j,Ke,et,ys,gs;let hr=t.strict,_s=(e=t.code)===null||e===void 0?void 0:e.optimize,Ka=_s===!0||_s===void 0?1:_s||0,Ba=(n=(r=t.code)===null||r===void 0?void 0:r.regExp)!==null&&n!==void 0?n:ju,sd=(s=t.uriResolver)!==null&&s!==void 0?s:qy.default;return{strictSchema:(a=(o=t.strictSchema)!==null&&o!==void 0?o:hr)!==null&&a!==void 0?a:!0,strictNumbers:(c=(i=t.strictNumbers)!==null&&i!==void 0?i:hr)!==null&&c!==void 0?c:!0,strictTypes:(l=(u=t.strictTypes)!==null&&u!==void 0?u:hr)!==null&&l!==void 0?l:"log",strictTuples:(m=(d=t.strictTuples)!==null&&d!==void 0?d:hr)!==null&&m!==void 0?m:"log",strictRequired:(h=(p=t.strictRequired)!==null&&p!==void 0?p:hr)!==null&&h!==void 0?h:!1,code:t.code?{...t.code,optimize:Ka,regExp:Ba}:{optimize:Ka,regExp:Ba},loopRequired:(y=t.loopRequired)!==null&&y!==void 0?y:Eu,loopEnum:(v=t.loopEnum)!==null&&v!==void 0?v:Eu,meta:($=t.meta)!==null&&$!==void 0?$:!0,messages:(P=t.messages)!==null&&P!==void 0?P:!0,inlineRefs:(O=t.inlineRefs)!==null&&O!==void 0?O:!0,schemaId:(J=t.schemaId)!==null&&J!==void 0?J:"$id",addUsedSchema:(j=t.addUsedSchema)!==null&&j!==void 0?j:!0,validateSchema:(Ke=t.validateSchema)!==null&&Ke!==void 0?Ke:!0,validateFormats:(et=t.validateFormats)!==null&&et!==void 0?et:!0,unicodeRegExp:(ys=t.unicodeRegExp)!==null&&ys!==void 0?ys:!0,int32range:(gs=t.int32range)!==null&&gs!==void 0?gs:!0,uriResolver:sd}}var nn=class{constructor(e={}){this.schemas={},this.refs={},this.formats=Object.create(null),this._compilations=new Set,this._loading={},this._cache=new Map,e=this.opts={...e,...Uy(e)};let{es5:r,lines:n}=this.opts.code;this.scope=new Cy.ValueScope({scope:{},prefixes:Zy,es5:r,lines:n}),this.logger=Gy(e.logger);let s=e.validateFormats;e.validateFormats=!1,this.RULES=(0,Ay.getRules)(),Ru.call(this,Vy,e,"NOT SUPPORTED"),Ru.call(this,Ly,e,"DEPRECATED","warn"),this._metaOpts=By.call(this),e.formats&&Hy.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),e.keywords&&Ky.call(this,e.keywords),typeof e.meta=="object"&&this.addMetaSchema(e.meta),Fy.call(this),e.validateFormats=s}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:e,meta:r,schemaId:n}=this.opts,s=Pu;n==="id"&&(s={...Pu},s.id=s.$id,delete s.$id),r&&e&&this.addMetaSchema(s,s[n],!1)}defaultMeta(){let{meta:e,schemaId:r}=this.opts;return this.opts.defaultMeta=typeof e=="object"?e[r]||e:void 0}validate(e,r){let n;if(typeof e=="string"){if(n=this.getSchema(e),!n)throw new Error(`no schema with key or ref "${e}"`)}else n=this.compile(e);let s=n(r);return"$async"in n||(this.errors=n.errors),s}compile(e,r){let n=this._addSchema(e,r);return n.validate||this._compileSchemaEnv(n)}compileAsync(e,r){if(typeof this.opts.loadSchema!="function")throw new Error("options.loadSchema should be a function");let{loadSchema:n}=this.opts;return s.call(this,e,r);async function s(l,d){await o.call(this,l.$schema);let m=this._addSchema(l,d);return m.validate||a.call(this,m)}async function o(l){l&&!this.getSchema(l)&&await s.call(this,{$ref:l},!0)}async function a(l){try{return this._compileSchemaEnv(l)}catch(d){if(!(d instanceof Nu.default))throw d;return i.call(this,d),await c.call(this,d.missingSchema),a.call(this,l)}}function i({missingSchema:l,missingRef:d}){if(this.refs[l])throw new Error(`AnySchema ${l} is loaded but ${d} cannot be resolved`)}async function c(l){let d=await u.call(this,l);this.refs[l]||await o.call(this,d.$schema),this.refs[l]||this.addSchema(d,l,r)}async function u(l){let d=this._loading[l];if(d)return d;try{return await(this._loading[l]=n(l))}finally{delete this._loading[l]}}}addSchema(e,r,n,s=this.opts.validateSchema){if(Array.isArray(e)){for(let a of e)this.addSchema(a,void 0,n,s);return this}let o;if(typeof e=="object"){let{schemaId:a}=this.opts;if(o=e[a],o!==void 0&&typeof o!="string")throw new Error(`schema ${a} must be string`)}return r=(0,rn.normalizeId)(r||o),this._checkUnique(r),this.schemas[r]=this._addSchema(e,n,r,s,!0),this}addMetaSchema(e,r,n=this.opts.validateSchema){return this.addSchema(e,r,!0,n),this}validateSchema(e,r){if(typeof e=="boolean")return!0;let n;if(n=e.$schema,n!==void 0&&typeof n!="string")throw new Error("$schema must be a string");if(n=n||this.opts.defaultMeta||this.defaultMeta(),!n)return this.logger.warn("meta-schema not available"),this.errors=null,!0;let s=this.validate(n,e);if(!s&&r){let o="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(o);else throw new Error(o)}return s}getSchema(e){let r;for(;typeof(r=Ou.call(this,e))=="string";)e=r;if(r===void 0){let{schemaId:n}=this.opts,s=new tn.SchemaEnv({schema:{},schemaId:n});if(r=tn.resolveSchema.call(this,s,e),!r)return;this.refs[e]=r}return r.validate||this._compileSchemaEnv(r)}removeSchema(e){if(e instanceof RegExp)return this._removeAllSchemas(this.schemas,e),this._removeAllSchemas(this.refs,e),this;switch(typeof e){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{let r=Ou.call(this,e);return typeof r=="object"&&this._cache.delete(r.schema),delete this.schemas[e],delete this.refs[e],this}case"object":{let r=e;this._cache.delete(r);let n=e[this.opts.schemaId];return n&&(n=(0,rn.normalizeId)(n),delete this.schemas[n],delete this.refs[n]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(e){for(let r of e)this.addKeyword(r);return this}addKeyword(e,r){let n;if(typeof e=="string")n=e,typeof r=="object"&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),r.keyword=n);else if(typeof e=="object"&&r===void 0){if(r=e,n=r.keyword,Array.isArray(n)&&!n.length)throw new Error("addKeywords: keyword must be string or non-empty array")}else throw new Error("invalid addKeywords parameters");if(Qy.call(this,n,r),!r)return(0,Jo.eachItem)(n,o=>Bo.call(this,o)),this;Xy.call(this,r);let s={...r,type:(0,es.getJSONTypes)(r.type),schemaType:(0,es.getJSONTypes)(r.schemaType)};return(0,Jo.eachItem)(n,s.type.length===0?o=>Bo.call(this,o,s):o=>s.type.forEach(a=>Bo.call(this,o,s,a))),this}getKeyword(e){let r=this.RULES.all[e];return typeof r=="object"?r.definition:!!r}removeKeyword(e){let{RULES:r}=this;delete r.keywords[e],delete r.all[e];for(let n of r.rules){let s=n.rules.findIndex(o=>o.keyword===e);s>=0&&n.rules.splice(s,1)}return this}addFormat(e,r){return typeof r=="string"&&(r=new RegExp(r)),this.formats[e]=r,this}errorsText(e=this.errors,{separator:r=", ",dataVar:n="data"}={}){return!e||e.length===0?"No errors":e.map(s=>`${n}${s.instancePath} ${s.message}`).reduce((s,o)=>s+r+o)}$dataMetaSchema(e,r){let n=this.RULES.all;e=JSON.parse(JSON.stringify(e));for(let s of r){let o=s.split("/").slice(1),a=e;for(let i of o)a=a[i];for(let i in n){let c=n[i];if(typeof c!="object")continue;let{$data:u}=c.definition,l=a[i];u&&l&&(a[i]=Iu(l))}}return e}_removeAllSchemas(e,r){for(let n in e){let s=e[n];(!r||r.test(n))&&(typeof s=="string"?delete e[n]:s&&!s.meta&&(this._cache.delete(s.schema),delete e[n]))}}_addSchema(e,r,n,s=this.opts.validateSchema,o=this.opts.addUsedSchema){let a,{schemaId:i}=this.opts;if(typeof e=="object")a=e[i];else{if(this.opts.jtd)throw new Error("schema must be object");if(typeof e!="boolean")throw new Error("schema must be object or boolean")}let c=this._cache.get(e);if(c!==void 0)return c;n=(0,rn.normalizeId)(a||n);let u=rn.getSchemaRefs.call(this,e,n);return c=new tn.SchemaEnv({schema:e,schemaId:i,meta:r,baseId:n,localRefs:u}),this._cache.set(c.schema,c),o&&!n.startsWith("#")&&(n&&this._checkUnique(n),this.refs[n]=c),s&&this.validateSchema(e,!0),c}_checkUnique(e){if(this.schemas[e]||this.refs[e])throw new Error(`schema with key or id "${e}" already exists`)}_compileSchemaEnv(e){if(e.meta?this._compileMetaSchema(e):tn.compileSchema.call(this,e),!e.validate)throw new Error("ajv implementation error");return e.validate}_compileMetaSchema(e){let r=this.opts;this.opts=this._metaOpts;try{tn.compileSchema.call(this,e)}finally{this.opts=r}}};nn.ValidationError=My.default;nn.MissingRefError=Nu.default;de.default=nn;function Ru(t,e,r,n="error"){for(let s in t){let o=s;o in e&&this.logger[n](`${r}: option ${s}. ${t[o]}`)}}function Ou(t){return t=(0,rn.normalizeId)(t),this.schemas[t]||this.refs[t]}function Fy(){let t=this.opts.schemas;if(t)if(Array.isArray(t))this.addSchema(t);else for(let e in t)this.addSchema(t[e],e)}function Hy(){for(let t in this.opts.formats){let e=this.opts.formats[t];e&&this.addFormat(t,e)}}function Ky(t){if(Array.isArray(t)){this.addVocabulary(t);return}this.logger.warn("keywords option as map is deprecated, pass array");for(let e in t){let r=t[e];r.keyword||(r.keyword=e),this.addKeyword(r)}}function By(){let t={...this.opts};for(let e of Dy)delete t[e];return t}var Jy={log(){},warn(){},error(){}};function Gy(t){if(t===!1)return Jy;if(t===void 0)return console;if(t.log&&t.warn&&t.error)return t;throw new Error("logger must implement log, warn and error methods")}var Wy=/^[a-z_$][a-z0-9_$:-]*$/i;function Qy(t,e){let{RULES:r}=this;if((0,Jo.eachItem)(t,n=>{if(r.keywords[n])throw new Error(`Keyword ${n} is already defined`);if(!Wy.test(n))throw new Error(`Keyword ${n} has invalid name`)}),!!e&&e.$data&&!("code"in e||"validate"in e))throw new Error('$data keyword must have "code" or "validate" function')}function Bo(t,e,r){var n;let s=e?.post;if(r&&s)throw new Error('keyword with "post" flag cannot have "type"');let{RULES:o}=this,a=s?o.post:o.rules.find(({type:c})=>c===r);if(a||(a={type:r,rules:[]},o.rules.push(a)),o.keywords[t]=!0,!e)return;let i={keyword:t,definition:{...e,type:(0,es.getJSONTypes)(e.type),schemaType:(0,es.getJSONTypes)(e.schemaType)}};e.before?Yy.call(this,a,i,e.before):a.rules.push(i),o.all[t]=i,(n=e.implements)===null||n===void 0||n.forEach(c=>this.addKeyword(c))}function Yy(t,e,r){let n=t.rules.findIndex(s=>s.keyword===r);n>=0?t.rules.splice(n,0,e):(t.rules.push(e),this.logger.warn(`rule ${r} is not defined`))}function Xy(t){let{metaSchema:e}=t;e!==void 0&&(t.$data&&this.opts.$data&&(e=Iu(e)),t.validateSchema=this.compile(e,!0))}var eg={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function Iu(t){return{anyOf:[t,eg]}}});var Au=x(Go=>{"use strict";Object.defineProperty(Go,"__esModule",{value:!0});var tg={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};Go.default=tg});var Zu=x(Nt=>{"use strict";Object.defineProperty(Nt,"__esModule",{value:!0});Nt.callRef=Nt.getValidate=void 0;var rg=Xr(),Cu=Ie(),Se=A(),ir=it(),qu=Wn(),ts=H(),ng={keyword:"$ref",schemaType:"string",code(t){let{gen:e,schema:r,it:n}=t,{baseId:s,schemaEnv:o,validateName:a,opts:i,self:c}=n,{root:u}=o;if((r==="#"||r==="#/")&&s===u.baseId)return d();let l=qu.resolveRef.call(c,u,s,r);if(l===void 0)throw new rg.default(n.opts.uriResolver,s,r);if(l instanceof qu.SchemaEnv)return m(l);return p(l);function d(){if(o===u)return rs(t,a,o,o.$async);let h=e.scopeValue("root",{ref:u});return rs(t,(0,Se._)`${h}.validate`,u,u.$async)}function m(h){let y=Du(t,h);rs(t,y,h,h.$async)}function p(h){let y=e.scopeValue("schema",i.code.source===!0?{ref:h,code:(0,Se.stringify)(h)}:{ref:h}),v=e.name("valid"),$=t.subschema({schema:h,dataTypes:[],schemaPath:Se.nil,topSchemaRef:y,errSchemaPath:r},v);t.mergeEvaluated($),t.ok(v)}}};function Du(t,e){let{gen:r}=t;return e.validate?r.scopeValue("validate",{ref:e.validate}):(0,Se._)`${r.scopeValue("wrapper",{ref:e})}.validate`}Nt.getValidate=Du;function rs(t,e,r,n){let{gen:s,it:o}=t,{allErrors:a,schemaEnv:i,opts:c}=o,u=c.passContext?ir.default.this:Se.nil;n?l():d();function l(){if(!i.$async)throw new Error("async schema referenced by sync schema");let h=s.let("valid");s.try(()=>{s.code((0,Se._)`await ${(0,Cu.callValidateCode)(t,e,u)}`),p(e),a||s.assign(h,!0)},y=>{s.if((0,Se._)`!(${y} instanceof ${o.ValidationError})`,()=>s.throw(y)),m(y),a||s.assign(h,!1)}),t.ok(h)}function d(){t.result((0,Cu.callValidateCode)(t,e,u),()=>p(e),()=>m(e))}function m(h){let y=(0,Se._)`${h}.errors`;s.assign(ir.default.vErrors,(0,Se._)`${ir.default.vErrors} === null ? ${y} : ${ir.default.vErrors}.concat(${y})`),s.assign(ir.default.errors,(0,Se._)`${ir.default.vErrors}.length`)}function p(h){var y;if(!o.opts.unevaluated)return;let v=(y=r?.validate)===null||y===void 0?void 0:y.evaluated;if(o.props!==!0)if(v&&!v.dynamicProps)v.props!==void 0&&(o.props=ts.mergeEvaluated.props(s,v.props,o.props));else{let $=s.var("props",(0,Se._)`${h}.evaluated.props`);o.props=ts.mergeEvaluated.props(s,$,o.props,Se.Name)}if(o.items!==!0)if(v&&!v.dynamicItems)v.items!==void 0&&(o.items=ts.mergeEvaluated.items(s,v.items,o.items));else{let $=s.var("items",(0,Se._)`${h}.evaluated.items`);o.items=ts.mergeEvaluated.items(s,$,o.items,Se.Name)}}}Nt.callRef=rs;Nt.default=ng});var Vu=x(Wo=>{"use strict";Object.defineProperty(Wo,"__esModule",{value:!0});var sg=Au(),og=Zu(),ag=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",sg.default,og.default];Wo.default=ag});var Lu=x(Qo=>{"use strict";Object.defineProperty(Qo,"__esModule",{value:!0});var ns=A(),bt=ns.operators,ss={maximum:{okStr:"<=",ok:bt.LTE,fail:bt.GT},minimum:{okStr:">=",ok:bt.GTE,fail:bt.LT},exclusiveMaximum:{okStr:"<",ok:bt.LT,fail:bt.GTE},exclusiveMinimum:{okStr:">",ok:bt.GT,fail:bt.LTE}},ig={message:({keyword:t,schemaCode:e})=>(0,ns.str)`must be ${ss[t].okStr} ${e}`,params:({keyword:t,schemaCode:e})=>(0,ns._)`{comparison: ${ss[t].okStr}, limit: ${e}}`},cg={keyword:Object.keys(ss),type:"number",schemaType:"number",$data:!0,error:ig,code(t){let{keyword:e,data:r,schemaCode:n}=t;t.fail$data((0,ns._)`${r} ${ss[e].fail} ${n} || isNaN(${r})`)}};Qo.default=cg});var Uu=x(Yo=>{"use strict";Object.defineProperty(Yo,"__esModule",{value:!0});var sn=A(),ug={message:({schemaCode:t})=>(0,sn.str)`must be multiple of ${t}`,params:({schemaCode:t})=>(0,sn._)`{multipleOf: ${t}}`},lg={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:ug,code(t){let{gen:e,data:r,schemaCode:n,it:s}=t,o=s.opts.multipleOfPrecision,a=e.let("res"),i=o?(0,sn._)`Math.abs(Math.round(${a}) - ${a}) > 1e-${o}`:(0,sn._)`${a} !== parseInt(${a})`;t.fail$data((0,sn._)`(${n} === 0 || (${a} = ${r}/${n}, ${i}))`)}};Yo.default=lg});var Hu=x(Xo=>{"use strict";Object.defineProperty(Xo,"__esModule",{value:!0});function Fu(t){let e=t.length,r=0,n=0,s;for(;n<e;)r++,s=t.charCodeAt(n++),s>=55296&&s<=56319&&n<e&&(s=t.charCodeAt(n),(s&64512)===56320&&n++);return r}Xo.default=Fu;Fu.code='require("ajv/dist/runtime/ucs2length").default'});var Ku=x(ea=>{"use strict";Object.defineProperty(ea,"__esModule",{value:!0});var jt=A(),dg=H(),fg=Hu(),pg={message({keyword:t,schemaCode:e}){let r=t==="maxLength"?"more":"fewer";return(0,jt.str)`must NOT have ${r} than ${e} characters`},params:({schemaCode:t})=>(0,jt._)`{limit: ${t}}`},mg={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:pg,code(t){let{keyword:e,data:r,schemaCode:n,it:s}=t,o=e==="maxLength"?jt.operators.GT:jt.operators.LT,a=s.opts.unicode===!1?(0,jt._)`${r}.length`:(0,jt._)`${(0,dg.useFunc)(t.gen,fg.default)}(${r})`;t.fail$data((0,jt._)`${a} ${o} ${n}`)}};ea.default=mg});var Bu=x(ta=>{"use strict";Object.defineProperty(ta,"__esModule",{value:!0});var hg=Ie(),yg=H(),cr=A(),gg={message:({schemaCode:t})=>(0,cr.str)`must match pattern "${t}"`,params:({schemaCode:t})=>(0,cr._)`{pattern: ${t}}`},_g={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:gg,code(t){let{gen:e,data:r,$data:n,schema:s,schemaCode:o,it:a}=t,i=a.opts.unicodeRegExp?"u":"";if(n){let{regExp:c}=a.opts.code,u=c.code==="new RegExp"?(0,cr._)`new RegExp`:(0,yg.useFunc)(e,c),l=e.let("valid");e.try(()=>e.assign(l,(0,cr._)`${u}(${o}, ${i}).test(${r})`),()=>e.assign(l,!1)),t.fail$data((0,cr._)`!${l}`)}else{let c=(0,hg.usePattern)(t,s);t.fail$data((0,cr._)`!${c}.test(${r})`)}}};ta.default=_g});var Ju=x(ra=>{"use strict";Object.defineProperty(ra,"__esModule",{value:!0});var on=A(),vg={message({keyword:t,schemaCode:e}){let r=t==="maxProperties"?"more":"fewer";return(0,on.str)`must NOT have ${r} than ${e} properties`},params:({schemaCode:t})=>(0,on._)`{limit: ${t}}`},bg={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:vg,code(t){let{keyword:e,data:r,schemaCode:n}=t,s=e==="maxProperties"?on.operators.GT:on.operators.LT;t.fail$data((0,on._)`Object.keys(${r}).length ${s} ${n}`)}};ra.default=bg});var Gu=x(na=>{"use strict";Object.defineProperty(na,"__esModule",{value:!0});var an=Ie(),cn=A(),$g=H(),xg={message:({params:{missingProperty:t}})=>(0,cn.str)`must have required property '${t}'`,params:({params:{missingProperty:t}})=>(0,cn._)`{missingProperty: ${t}}`},wg={keyword:"required",type:"object",schemaType:"array",$data:!0,error:xg,code(t){let{gen:e,schema:r,schemaCode:n,data:s,$data:o,it:a}=t,{opts:i}=a;if(!o&&r.length===0)return;let c=r.length>=i.loopRequired;if(a.allErrors?u():l(),i.strictRequired){let p=t.parentSchema.properties,{definedProperties:h}=t.it;for(let y of r)if(p?.[y]===void 0&&!h.has(y)){let v=a.schemaEnv.baseId+a.errSchemaPath,$=`required property "${y}" is not defined at "${v}" (strictRequired)`;(0,$g.checkStrictMode)(a,$,a.opts.strictRequired)}}function u(){if(c||o)t.block$data(cn.nil,d);else for(let p of r)(0,an.checkReportMissingProp)(t,p)}function l(){let p=e.let("missing");if(c||o){let h=e.let("valid",!0);t.block$data(h,()=>m(p,h)),t.ok(h)}else e.if((0,an.checkMissingProp)(t,r,p)),(0,an.reportMissingProp)(t,p),e.else()}function d(){e.forOf("prop",n,p=>{t.setParams({missingProperty:p}),e.if((0,an.noPropertyInData)(e,s,p,i.ownProperties),()=>t.error())})}function m(p,h){t.setParams({missingProperty:p}),e.forOf(p,n,()=>{e.assign(h,(0,an.propertyInData)(e,s,p,i.ownProperties)),e.if((0,cn.not)(h),()=>{t.error(),e.break()})},cn.nil)}}};na.default=wg});var Wu=x(sa=>{"use strict";Object.defineProperty(sa,"__esModule",{value:!0});var un=A(),kg={message({keyword:t,schemaCode:e}){let r=t==="maxItems"?"more":"fewer";return(0,un.str)`must NOT have ${r} than ${e} items`},params:({schemaCode:t})=>(0,un._)`{limit: ${t}}`},Sg={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:kg,code(t){let{keyword:e,data:r,schemaCode:n}=t,s=e==="maxItems"?un.operators.GT:un.operators.LT;t.fail$data((0,un._)`${r}.length ${s} ${n}`)}};sa.default=Sg});var os=x(oa=>{"use strict";Object.defineProperty(oa,"__esModule",{value:!0});var Qu=Po();Qu.code='require("ajv/dist/runtime/equal").default';oa.default=Qu});var Yu=x(ia=>{"use strict";Object.defineProperty(ia,"__esModule",{value:!0});var aa=Jr(),fe=A(),zg=H(),Tg=os(),Pg={message:({params:{i:t,j:e}})=>(0,fe.str)`must NOT have duplicate items (items ## ${e} and ${t} are identical)`,params:({params:{i:t,j:e}})=>(0,fe._)`{i: ${t}, j: ${e}}`},Eg={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:Pg,code(t){let{gen:e,data:r,$data:n,schema:s,parentSchema:o,schemaCode:a,it:i}=t;if(!n&&!s)return;let c=e.let("valid"),u=o.items?(0,aa.getSchemaTypes)(o.items):[];t.block$data(c,l,(0,fe._)`${a} === false`),t.ok(c);function l(){let h=e.let("i",(0,fe._)`${r}.length`),y=e.let("j");t.setParams({i:h,j:y}),e.assign(c,!0),e.if((0,fe._)`${h} > 1`,()=>(d()?m:p)(h,y))}function d(){return u.length>0&&!u.some(h=>h==="object"||h==="array")}function m(h,y){let v=e.name("item"),$=(0,aa.checkDataTypes)(u,v,i.opts.strictNumbers,aa.DataType.Wrong),P=e.const("indices",(0,fe._)`{}`);e.for((0,fe._)`;${h}--;`,()=>{e.let(v,(0,fe._)`${r}[${h}]`),e.if($,(0,fe._)`continue`),u.length>1&&e.if((0,fe._)`typeof ${v} == "string"`,(0,fe._)`${v} += "_"`),e.if((0,fe._)`typeof ${P}[${v}] == "number"`,()=>{e.assign(y,(0,fe._)`${P}[${v}]`),t.error(),e.assign(c,!1).break()}).code((0,fe._)`${P}[${v}] = ${h}`)})}function p(h,y){let v=(0,zg.useFunc)(e,Tg.default),$=e.name("outer");e.label($).for((0,fe._)`;${h}--;`,()=>e.for((0,fe._)`${y} = ${h}; ${y}--;`,()=>e.if((0,fe._)`${v}(${r}[${h}], ${r}[${y}])`,()=>{t.error(),e.assign(c,!1).break($)})))}}};ia.default=Eg});var Xu=x(ua=>{"use strict";Object.defineProperty(ua,"__esModule",{value:!0});var ca=A(),Rg=H(),Og=os(),Ng={message:"must be equal to constant",params:({schemaCode:t})=>(0,ca._)`{allowedValue: ${t}}`},jg={keyword:"const",$data:!0,error:Ng,code(t){let{gen:e,data:r,$data:n,schemaCode:s,schema:o}=t;n||o&&typeof o=="object"?t.fail$data((0,ca._)`!${(0,Rg.useFunc)(e,Og.default)}(${r}, ${s})`):t.fail((0,ca._)`${o} !== ${r}`)}};ua.default=jg});var el=x(la=>{"use strict";Object.defineProperty(la,"__esModule",{value:!0});var ln=A(),Ig=H(),Mg=os(),Ag={message:"must be equal to one of the allowed values",params:({schemaCode:t})=>(0,ln._)`{allowedValues: ${t}}`},Cg={keyword:"enum",schemaType:"array",$data:!0,error:Ag,code(t){let{gen:e,data:r,$data:n,schema:s,schemaCode:o,it:a}=t;if(!n&&s.length===0)throw new Error("enum must have non-empty array");let i=s.length>=a.opts.loopEnum,c,u=()=>c??(c=(0,Ig.useFunc)(e,Mg.default)),l;if(i||n)l=e.let("valid"),t.block$data(l,d);else{if(!Array.isArray(s))throw new Error("ajv implementation error");let p=e.const("vSchema",o);l=(0,ln.or)(...s.map((h,y)=>m(p,y)))}t.pass(l);function d(){e.assign(l,!1),e.forOf("v",o,p=>e.if((0,ln._)`${u()}(${r}, ${p})`,()=>e.assign(l,!0).break()))}function m(p,h){let y=s[h];return typeof y=="object"&&y!==null?(0,ln._)`${u()}(${r}, ${p}[${h}])`:(0,ln._)`${r} === ${y}`}}};la.default=Cg});var tl=x(da=>{"use strict";Object.defineProperty(da,"__esModule",{value:!0});var qg=Lu(),Dg=Uu(),Zg=Ku(),Vg=Bu(),Lg=Ju(),Ug=Gu(),Fg=Wu(),Hg=Yu(),Kg=Xu(),Bg=el(),Jg=[qg.default,Dg.default,Zg.default,Vg.default,Lg.default,Ug.default,Fg.default,Hg.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},Kg.default,Bg.default];da.default=Jg});var pa=x(dn=>{"use strict";Object.defineProperty(dn,"__esModule",{value:!0});dn.validateAdditionalItems=void 0;var It=A(),fa=H(),Gg={message:({params:{len:t}})=>(0,It.str)`must NOT have more than ${t} items`,params:({params:{len:t}})=>(0,It._)`{limit: ${t}}`},Wg={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:Gg,code(t){let{parentSchema:e,it:r}=t,{items:n}=e;if(!Array.isArray(n)){(0,fa.checkStrictMode)(r,'"additionalItems" is ignored when "items" is not an array of schemas');return}rl(t,n)}};function rl(t,e){let{gen:r,schema:n,data:s,keyword:o,it:a}=t;a.items=!0;let i=r.const("len",(0,It._)`${s}.length`);if(n===!1)t.setParams({len:e.length}),t.pass((0,It._)`${i} <= ${e.length}`);else if(typeof n=="object"&&!(0,fa.alwaysValidSchema)(a,n)){let u=r.var("valid",(0,It._)`${i} <= ${e.length}`);r.if((0,It.not)(u),()=>c(u)),t.ok(u)}function c(u){r.forRange("i",e.length,i,l=>{t.subschema({keyword:o,dataProp:l,dataPropType:fa.Type.Num},u),a.allErrors||r.if((0,It.not)(u),()=>r.break())})}}dn.validateAdditionalItems=rl;dn.default=Wg});var ma=x(fn=>{"use strict";Object.defineProperty(fn,"__esModule",{value:!0});fn.validateTuple=void 0;var nl=A(),as=H(),Qg=Ie(),Yg={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(t){let{schema:e,it:r}=t;if(Array.isArray(e))return sl(t,"additionalItems",e);r.items=!0,!(0,as.alwaysValidSchema)(r,e)&&t.ok((0,Qg.validateArray)(t))}};function sl(t,e,r=t.schema){let{gen:n,parentSchema:s,data:o,keyword:a,it:i}=t;l(s),i.opts.unevaluated&&r.length&&i.items!==!0&&(i.items=as.mergeEvaluated.items(n,r.length,i.items));let c=n.name("valid"),u=n.const("len",(0,nl._)`${o}.length`);r.forEach((d,m)=>{(0,as.alwaysValidSchema)(i,d)||(n.if((0,nl._)`${u} > ${m}`,()=>t.subschema({keyword:a,schemaProp:m,dataProp:m},c)),t.ok(c))});function l(d){let{opts:m,errSchemaPath:p}=i,h=r.length,y=h===d.minItems&&(h===d.maxItems||d[e]===!1);if(m.strictTuples&&!y){let v=`"${a}" is ${h}-tuple, but minItems or maxItems/${e} are not specified or different at path "${p}"`;(0,as.checkStrictMode)(i,v,m.strictTuples)}}}fn.validateTuple=sl;fn.default=Yg});var ol=x(ha=>{"use strict";Object.defineProperty(ha,"__esModule",{value:!0});var Xg=ma(),e_={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:t=>(0,Xg.validateTuple)(t,"items")};ha.default=e_});var il=x(ya=>{"use strict";Object.defineProperty(ya,"__esModule",{value:!0});var al=A(),t_=H(),r_=Ie(),n_=pa(),s_={message:({params:{len:t}})=>(0,al.str)`must NOT have more than ${t} items`,params:({params:{len:t}})=>(0,al._)`{limit: ${t}}`},o_={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:s_,code(t){let{schema:e,parentSchema:r,it:n}=t,{prefixItems:s}=r;n.items=!0,!(0,t_.alwaysValidSchema)(n,e)&&(s?(0,n_.validateAdditionalItems)(t,s):t.ok((0,r_.validateArray)(t)))}};ya.default=o_});var cl=x(ga=>{"use strict";Object.defineProperty(ga,"__esModule",{value:!0});var Ae=A(),is=H(),a_={message:({params:{min:t,max:e}})=>e===void 0?(0,Ae.str)`must contain at least ${t} valid item(s)`:(0,Ae.str)`must contain at least ${t} and no more than ${e} valid item(s)`,params:({params:{min:t,max:e}})=>e===void 0?(0,Ae._)`{minContains: ${t}}`:(0,Ae._)`{minContains: ${t}, maxContains: ${e}}`},i_={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:a_,code(t){let{gen:e,schema:r,parentSchema:n,data:s,it:o}=t,a,i,{minContains:c,maxContains:u}=n;o.opts.next?(a=c===void 0?1:c,i=u):a=1;let l=e.const("len",(0,Ae._)`${s}.length`);if(t.setParams({min:a,max:i}),i===void 0&&a===0){(0,is.checkStrictMode)(o,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(i!==void 0&&a>i){(0,is.checkStrictMode)(o,'"minContains" > "maxContains" is always invalid'),t.fail();return}if((0,is.alwaysValidSchema)(o,r)){let y=(0,Ae._)`${l} >= ${a}`;i!==void 0&&(y=(0,Ae._)`${y} && ${l} <= ${i}`),t.pass(y);return}o.items=!0;let d=e.name("valid");i===void 0&&a===1?p(d,()=>e.if(d,()=>e.break())):a===0?(e.let(d,!0),i!==void 0&&e.if((0,Ae._)`${s}.length > 0`,m)):(e.let(d,!1),m()),t.result(d,()=>t.reset());function m(){let y=e.name("_valid"),v=e.let("count",0);p(y,()=>e.if(y,()=>h(v)))}function p(y,v){e.forRange("i",0,l,$=>{t.subschema({keyword:"contains",dataProp:$,dataPropType:is.Type.Num,compositeRule:!0},y),v()})}function h(y){e.code((0,Ae._)`${y}++`),i===void 0?e.if((0,Ae._)`${y} >= ${a}`,()=>e.assign(d,!0).break()):(e.if((0,Ae._)`${y} > ${i}`,()=>e.assign(d,!1).break()),a===1?e.assign(d,!0):e.if((0,Ae._)`${y} >= ${a}`,()=>e.assign(d,!0)))}}};ga.default=i_});var dl=x(Qe=>{"use strict";Object.defineProperty(Qe,"__esModule",{value:!0});Qe.validateSchemaDeps=Qe.validatePropertyDeps=Qe.error=void 0;var _a=A(),c_=H(),pn=Ie();Qe.error={message:({params:{property:t,depsCount:e,deps:r}})=>{let n=e===1?"property":"properties";return(0,_a.str)`must have ${n} ${r} when property ${t} is present`},params:({params:{property:t,depsCount:e,deps:r,missingProperty:n}})=>(0,_a._)`{property: ${t},
|
|
9
|
-
missingProperty: ${n},
|
|
10
|
-
depsCount: ${e},
|
|
11
|
-
deps: ${r}}`};var u_={keyword:"dependencies",type:"object",schemaType:"object",error:Qe.error,code(t){let[e,r]=l_(t);ul(t,e),ll(t,r)}};function l_({schema:t}){let e={},r={};for(let n in t){if(n==="__proto__")continue;let s=Array.isArray(t[n])?e:r;s[n]=t[n]}return[e,r]}function ul(t,e=t.schema){let{gen:r,data:n,it:s}=t;if(Object.keys(e).length===0)return;let o=r.let("missing");for(let a in e){let i=e[a];if(i.length===0)continue;let c=(0,pn.propertyInData)(r,n,a,s.opts.ownProperties);t.setParams({property:a,depsCount:i.length,deps:i.join(", ")}),s.allErrors?r.if(c,()=>{for(let u of i)(0,pn.checkReportMissingProp)(t,u)}):(r.if((0,_a._)`${c} && (${(0,pn.checkMissingProp)(t,i,o)})`),(0,pn.reportMissingProp)(t,o),r.else())}}Qe.validatePropertyDeps=ul;function ll(t,e=t.schema){let{gen:r,data:n,keyword:s,it:o}=t,a=r.name("valid");for(let i in e)(0,c_.alwaysValidSchema)(o,e[i])||(r.if((0,pn.propertyInData)(r,n,i,o.opts.ownProperties),()=>{let c=t.subschema({keyword:s,schemaProp:i},a);t.mergeValidEvaluated(c,a)},()=>r.var(a,!0)),t.ok(a))}Qe.validateSchemaDeps=ll;Qe.default=u_});var pl=x(va=>{"use strict";Object.defineProperty(va,"__esModule",{value:!0});var fl=A(),d_=H(),f_={message:"property name must be valid",params:({params:t})=>(0,fl._)`{propertyName: ${t.propertyName}}`},p_={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:f_,code(t){let{gen:e,schema:r,data:n,it:s}=t;if((0,d_.alwaysValidSchema)(s,r))return;let o=e.name("valid");e.forIn("key",n,a=>{t.setParams({propertyName:a}),t.subschema({keyword:"propertyNames",data:a,dataTypes:["string"],propertyName:a,compositeRule:!0},o),e.if((0,fl.not)(o),()=>{t.error(!0),s.allErrors||e.break()})}),t.ok(o)}};va.default=p_});var $a=x(ba=>{"use strict";Object.defineProperty(ba,"__esModule",{value:!0});var cs=Ie(),Fe=A(),m_=it(),us=H(),h_={message:"must NOT have additional properties",params:({params:t})=>(0,Fe._)`{additionalProperty: ${t.additionalProperty}}`},y_={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:h_,code(t){let{gen:e,schema:r,parentSchema:n,data:s,errsCount:o,it:a}=t;if(!o)throw new Error("ajv implementation error");let{allErrors:i,opts:c}=a;if(a.props=!0,c.removeAdditional!=="all"&&(0,us.alwaysValidSchema)(a,r))return;let u=(0,cs.allSchemaProperties)(n.properties),l=(0,cs.allSchemaProperties)(n.patternProperties);d(),t.ok((0,Fe._)`${o} === ${m_.default.errors}`);function d(){e.forIn("key",s,v=>{!u.length&&!l.length?h(v):e.if(m(v),()=>h(v))})}function m(v){let $;if(u.length>8){let P=(0,us.schemaRefOrVal)(a,n.properties,"properties");$=(0,cs.isOwnProperty)(e,P,v)}else u.length?$=(0,Fe.or)(...u.map(P=>(0,Fe._)`${v} === ${P}`)):$=Fe.nil;return l.length&&($=(0,Fe.or)($,...l.map(P=>(0,Fe._)`${(0,cs.usePattern)(t,P)}.test(${v})`))),(0,Fe.not)($)}function p(v){e.code((0,Fe._)`delete ${s}[${v}]`)}function h(v){if(c.removeAdditional==="all"||c.removeAdditional&&r===!1){p(v);return}if(r===!1){t.setParams({additionalProperty:v}),t.error(),i||e.break();return}if(typeof r=="object"&&!(0,us.alwaysValidSchema)(a,r)){let $=e.name("valid");c.removeAdditional==="failing"?(y(v,$,!1),e.if((0,Fe.not)($),()=>{t.reset(),p(v)})):(y(v,$),i||e.if((0,Fe.not)($),()=>e.break()))}}function y(v,$,P){let O={keyword:"additionalProperties",dataProp:v,dataPropType:us.Type.Str};P===!1&&Object.assign(O,{compositeRule:!0,createErrors:!1,allErrors:!1}),t.subschema(O,$)}}};ba.default=y_});var yl=x(wa=>{"use strict";Object.defineProperty(wa,"__esModule",{value:!0});var g_=Yr(),ml=Ie(),xa=H(),hl=$a(),__={keyword:"properties",type:"object",schemaType:"object",code(t){let{gen:e,schema:r,parentSchema:n,data:s,it:o}=t;o.opts.removeAdditional==="all"&&n.additionalProperties===void 0&&hl.default.code(new g_.KeywordCxt(o,hl.default,"additionalProperties"));let a=(0,ml.allSchemaProperties)(r);for(let d of a)o.definedProperties.add(d);o.opts.unevaluated&&a.length&&o.props!==!0&&(o.props=xa.mergeEvaluated.props(e,(0,xa.toHash)(a),o.props));let i=a.filter(d=>!(0,xa.alwaysValidSchema)(o,r[d]));if(i.length===0)return;let c=e.name("valid");for(let d of i)u(d)?l(d):(e.if((0,ml.propertyInData)(e,s,d,o.opts.ownProperties)),l(d),o.allErrors||e.else().var(c,!0),e.endIf()),t.it.definedProperties.add(d),t.ok(c);function u(d){return o.opts.useDefaults&&!o.compositeRule&&r[d].default!==void 0}function l(d){t.subschema({keyword:"properties",schemaProp:d,dataProp:d},c)}}};wa.default=__});var bl=x(ka=>{"use strict";Object.defineProperty(ka,"__esModule",{value:!0});var gl=Ie(),ls=A(),_l=H(),vl=H(),v_={keyword:"patternProperties",type:"object",schemaType:"object",code(t){let{gen:e,schema:r,data:n,parentSchema:s,it:o}=t,{opts:a}=o,i=(0,gl.allSchemaProperties)(r),c=i.filter(y=>(0,_l.alwaysValidSchema)(o,r[y]));if(i.length===0||c.length===i.length&&(!o.opts.unevaluated||o.props===!0))return;let u=a.strictSchema&&!a.allowMatchingProperties&&s.properties,l=e.name("valid");o.props!==!0&&!(o.props instanceof ls.Name)&&(o.props=(0,vl.evaluatedPropsToName)(e,o.props));let{props:d}=o;m();function m(){for(let y of i)u&&p(y),o.allErrors?h(y):(e.var(l,!0),h(y),e.if(l))}function p(y){for(let v in u)new RegExp(y).test(v)&&(0,_l.checkStrictMode)(o,`property ${v} matches pattern ${y} (use allowMatchingProperties)`)}function h(y){e.forIn("key",n,v=>{e.if((0,ls._)`${(0,gl.usePattern)(t,y)}.test(${v})`,()=>{let $=c.includes(y);$||t.subschema({keyword:"patternProperties",schemaProp:y,dataProp:v,dataPropType:vl.Type.Str},l),o.opts.unevaluated&&d!==!0?e.assign((0,ls._)`${d}[${v}]`,!0):!$&&!o.allErrors&&e.if((0,ls.not)(l),()=>e.break())})})}}};ka.default=v_});var $l=x(Sa=>{"use strict";Object.defineProperty(Sa,"__esModule",{value:!0});var b_=H(),$_={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(t){let{gen:e,schema:r,it:n}=t;if((0,b_.alwaysValidSchema)(n,r)){t.fail();return}let s=e.name("valid");t.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},s),t.failResult(s,()=>t.reset(),()=>t.error())},error:{message:"must NOT be valid"}};Sa.default=$_});var xl=x(za=>{"use strict";Object.defineProperty(za,"__esModule",{value:!0});var x_=Ie(),w_={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:x_.validateUnion,error:{message:"must match a schema in anyOf"}};za.default=w_});var wl=x(Ta=>{"use strict";Object.defineProperty(Ta,"__esModule",{value:!0});var ds=A(),k_=H(),S_={message:"must match exactly one schema in oneOf",params:({params:t})=>(0,ds._)`{passingSchemas: ${t.passing}}`},z_={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:S_,code(t){let{gen:e,schema:r,parentSchema:n,it:s}=t;if(!Array.isArray(r))throw new Error("ajv implementation error");if(s.opts.discriminator&&n.discriminator)return;let o=r,a=e.let("valid",!1),i=e.let("passing",null),c=e.name("_valid");t.setParams({passing:i}),e.block(u),t.result(a,()=>t.reset(),()=>t.error(!0));function u(){o.forEach((l,d)=>{let m;(0,k_.alwaysValidSchema)(s,l)?e.var(c,!0):m=t.subschema({keyword:"oneOf",schemaProp:d,compositeRule:!0},c),d>0&&e.if((0,ds._)`${c} && ${a}`).assign(a,!1).assign(i,(0,ds._)`[${i}, ${d}]`).else(),e.if(c,()=>{e.assign(a,!0),e.assign(i,d),m&&t.mergeEvaluated(m,ds.Name)})})}}};Ta.default=z_});var kl=x(Pa=>{"use strict";Object.defineProperty(Pa,"__esModule",{value:!0});var T_=H(),P_={keyword:"allOf",schemaType:"array",code(t){let{gen:e,schema:r,it:n}=t;if(!Array.isArray(r))throw new Error("ajv implementation error");let s=e.name("valid");r.forEach((o,a)=>{if((0,T_.alwaysValidSchema)(n,o))return;let i=t.subschema({keyword:"allOf",schemaProp:a},s);t.ok(s),t.mergeEvaluated(i)})}};Pa.default=P_});var Tl=x(Ea=>{"use strict";Object.defineProperty(Ea,"__esModule",{value:!0});var fs=A(),zl=H(),E_={message:({params:t})=>(0,fs.str)`must match "${t.ifClause}" schema`,params:({params:t})=>(0,fs._)`{failingKeyword: ${t.ifClause}}`},R_={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:E_,code(t){let{gen:e,parentSchema:r,it:n}=t;r.then===void 0&&r.else===void 0&&(0,zl.checkStrictMode)(n,'"if" without "then" and "else" is ignored');let s=Sl(n,"then"),o=Sl(n,"else");if(!s&&!o)return;let a=e.let("valid",!0),i=e.name("_valid");if(c(),t.reset(),s&&o){let l=e.let("ifClause");t.setParams({ifClause:l}),e.if(i,u("then",l),u("else",l))}else s?e.if(i,u("then")):e.if((0,fs.not)(i),u("else"));t.pass(a,()=>t.error(!0));function c(){let l=t.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},i);t.mergeEvaluated(l)}function u(l,d){return()=>{let m=t.subschema({keyword:l},i);e.assign(a,i),t.mergeValidEvaluated(m,a),d?e.assign(d,(0,fs._)`${l}`):t.setParams({ifClause:l})}}}};function Sl(t,e){let r=t.schema[e];return r!==void 0&&!(0,zl.alwaysValidSchema)(t,r)}Ea.default=R_});var Pl=x(Ra=>{"use strict";Object.defineProperty(Ra,"__esModule",{value:!0});var O_=H(),N_={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:t,parentSchema:e,it:r}){e.if===void 0&&(0,O_.checkStrictMode)(r,`"${t}" without "if" is ignored`)}};Ra.default=N_});var El=x(Oa=>{"use strict";Object.defineProperty(Oa,"__esModule",{value:!0});var j_=pa(),I_=ol(),M_=ma(),A_=il(),C_=cl(),q_=dl(),D_=pl(),Z_=$a(),V_=yl(),L_=bl(),U_=$l(),F_=xl(),H_=wl(),K_=kl(),B_=Tl(),J_=Pl();function G_(t=!1){let e=[U_.default,F_.default,H_.default,K_.default,B_.default,J_.default,D_.default,Z_.default,q_.default,V_.default,L_.default];return t?e.push(I_.default,A_.default):e.push(j_.default,M_.default),e.push(C_.default),e}Oa.default=G_});var Rl=x(Na=>{"use strict";Object.defineProperty(Na,"__esModule",{value:!0});var ae=A(),W_={message:({schemaCode:t})=>(0,ae.str)`must match format "${t}"`,params:({schemaCode:t})=>(0,ae._)`{format: ${t}}`},Q_={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:W_,code(t,e){let{gen:r,data:n,$data:s,schema:o,schemaCode:a,it:i}=t,{opts:c,errSchemaPath:u,schemaEnv:l,self:d}=i;if(!c.validateFormats)return;s?m():p();function m(){let h=r.scopeValue("formats",{ref:d.formats,code:c.code.formats}),y=r.const("fDef",(0,ae._)`${h}[${a}]`),v=r.let("fType"),$=r.let("format");r.if((0,ae._)`typeof ${y} == "object" && !(${y} instanceof RegExp)`,()=>r.assign(v,(0,ae._)`${y}.type || "string"`).assign($,(0,ae._)`${y}.validate`),()=>r.assign(v,(0,ae._)`"string"`).assign($,y)),t.fail$data((0,ae.or)(P(),O()));function P(){return c.strictSchema===!1?ae.nil:(0,ae._)`${a} && !${$}`}function O(){let J=l.$async?(0,ae._)`(${y}.async ? await ${$}(${n}) : ${$}(${n}))`:(0,ae._)`${$}(${n})`,j=(0,ae._)`(typeof ${$} == "function" ? ${J} : ${$}.test(${n}))`;return(0,ae._)`${$} && ${$} !== true && ${v} === ${e} && !${j}`}}function p(){let h=d.formats[o];if(!h){P();return}if(h===!0)return;let[y,v,$]=O(h);y===e&&t.pass(J());function P(){if(c.strictSchema===!1){d.logger.warn(j());return}throw new Error(j());function j(){return`unknown format "${o}" ignored in schema at path "${u}"`}}function O(j){let Ke=j instanceof RegExp?(0,ae.regexpCode)(j):c.code.formats?(0,ae._)`${c.code.formats}${(0,ae.getProperty)(o)}`:void 0,et=r.scopeValue("formats",{key:o,ref:j,code:Ke});return typeof j=="object"&&!(j instanceof RegExp)?[j.type||"string",j.validate,(0,ae._)`${et}.validate`]:["string",j,et]}function J(){if(typeof h=="object"&&!(h instanceof RegExp)&&h.async){if(!l.$async)throw new Error("async format in sync schema");return(0,ae._)`await ${$}(${n})`}return typeof v=="function"?(0,ae._)`${$}(${n})`:(0,ae._)`${$}.test(${n})`}}}};Na.default=Q_});var Ol=x(ja=>{"use strict";Object.defineProperty(ja,"__esModule",{value:!0});var Y_=Rl(),X_=[Y_.default];ja.default=X_});var Nl=x(ur=>{"use strict";Object.defineProperty(ur,"__esModule",{value:!0});ur.contentVocabulary=ur.metadataVocabulary=void 0;ur.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"];ur.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]});var Il=x(Ia=>{"use strict";Object.defineProperty(Ia,"__esModule",{value:!0});var ev=Vu(),tv=tl(),rv=El(),nv=Ol(),jl=Nl(),sv=[ev.default,tv.default,(0,rv.default)(),nv.default,jl.metadataVocabulary,jl.contentVocabulary];Ia.default=sv});var Al=x(ps=>{"use strict";Object.defineProperty(ps,"__esModule",{value:!0});ps.DiscrError=void 0;var Ml;(function(t){t.Tag="tag",t.Mapping="mapping"})(Ml||(ps.DiscrError=Ml={}))});var ql=x(Aa=>{"use strict";Object.defineProperty(Aa,"__esModule",{value:!0});var lr=A(),Ma=Al(),Cl=Wn(),ov=Xr(),av=H(),iv={message:({params:{discrError:t,tagName:e}})=>t===Ma.DiscrError.Tag?`tag "${e}" must be string`:`value of tag "${e}" must be in oneOf`,params:({params:{discrError:t,tag:e,tagName:r}})=>(0,lr._)`{error: ${t}, tag: ${r}, tagValue: ${e}}`},cv={keyword:"discriminator",type:"object",schemaType:"object",error:iv,code(t){let{gen:e,data:r,schema:n,parentSchema:s,it:o}=t,{oneOf:a}=s;if(!o.opts.discriminator)throw new Error("discriminator: requires discriminator option");let i=n.propertyName;if(typeof i!="string")throw new Error("discriminator: requires propertyName");if(n.mapping)throw new Error("discriminator: mapping is not supported");if(!a)throw new Error("discriminator: requires oneOf keyword");let c=e.let("valid",!1),u=e.const("tag",(0,lr._)`${r}${(0,lr.getProperty)(i)}`);e.if((0,lr._)`typeof ${u} == "string"`,()=>l(),()=>t.error(!1,{discrError:Ma.DiscrError.Tag,tag:u,tagName:i})),t.ok(c);function l(){let p=m();e.if(!1);for(let h in p)e.elseIf((0,lr._)`${u} === ${h}`),e.assign(c,d(p[h]));e.else(),t.error(!1,{discrError:Ma.DiscrError.Mapping,tag:u,tagName:i}),e.endIf()}function d(p){let h=e.name("valid"),y=t.subschema({keyword:"oneOf",schemaProp:p},h);return t.mergeEvaluated(y,lr.Name),h}function m(){var p;let h={},y=$(s),v=!0;for(let J=0;J<a.length;J++){let j=a[J];if(j?.$ref&&!(0,av.schemaHasRulesButRef)(j,o.self.RULES)){let et=j.$ref;if(j=Cl.resolveRef.call(o.self,o.schemaEnv.root,o.baseId,et),j instanceof Cl.SchemaEnv&&(j=j.schema),j===void 0)throw new ov.default(o.opts.uriResolver,o.baseId,et)}let Ke=(p=j?.properties)===null||p===void 0?void 0:p[i];if(typeof Ke!="object")throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${i}"`);v=v&&(y||$(j)),P(Ke,J)}if(!v)throw new Error(`discriminator: "${i}" must be required`);return h;function $({required:J}){return Array.isArray(J)&&J.includes(i)}function P(J,j){if(J.const)O(J.const,j);else if(J.enum)for(let Ke of J.enum)O(Ke,j);else throw new Error(`discriminator: "properties/${i}" must have "const" or "enum"`)}function O(J,j){if(typeof J!="string"||J in h)throw new Error(`discriminator: "${i}" values must be unique strings`);h[J]=j}}}};Aa.default=cv});var Dl=x((rT,uv)=>{uv.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}});var qa=x((te,Ca)=>{"use strict";Object.defineProperty(te,"__esModule",{value:!0});te.MissingRefError=te.ValidationError=te.CodeGen=te.Name=te.nil=te.stringify=te.str=te._=te.KeywordCxt=te.Ajv=void 0;var lv=Mu(),dv=Il(),fv=ql(),Zl=Dl(),pv=["/properties"],ms="http://json-schema.org/draft-07/schema",dr=class extends lv.default{_addVocabularies(){super._addVocabularies(),dv.default.forEach(e=>this.addVocabulary(e)),this.opts.discriminator&&this.addKeyword(fv.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;let e=this.opts.$data?this.$dataMetaSchema(Zl,pv):Zl;this.addMetaSchema(e,ms,!1),this.refs["http://json-schema.org/schema"]=ms}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(ms)?ms:void 0)}};te.Ajv=dr;Ca.exports=te=dr;Ca.exports.Ajv=dr;Object.defineProperty(te,"__esModule",{value:!0});te.default=dr;var mv=Yr();Object.defineProperty(te,"KeywordCxt",{enumerable:!0,get:function(){return mv.KeywordCxt}});var fr=A();Object.defineProperty(te,"_",{enumerable:!0,get:function(){return fr._}});Object.defineProperty(te,"str",{enumerable:!0,get:function(){return fr.str}});Object.defineProperty(te,"stringify",{enumerable:!0,get:function(){return fr.stringify}});Object.defineProperty(te,"nil",{enumerable:!0,get:function(){return fr.nil}});Object.defineProperty(te,"Name",{enumerable:!0,get:function(){return fr.Name}});Object.defineProperty(te,"CodeGen",{enumerable:!0,get:function(){return fr.CodeGen}});var hv=Jn();Object.defineProperty(te,"ValidationError",{enumerable:!0,get:function(){return hv.default}});var yv=Xr();Object.defineProperty(te,"MissingRefError",{enumerable:!0,get:function(){return yv.default}})});var Jl=x(Xe=>{"use strict";Object.defineProperty(Xe,"__esModule",{value:!0});Xe.formatNames=Xe.fastFormats=Xe.fullFormats=void 0;function Ye(t,e){return{validate:t,compare:e}}Xe.fullFormats={date:Ye(Fl,La),time:Ye(Za(!0),Ua),"date-time":Ye(Vl(!0),Kl),"iso-time":Ye(Za(),Hl),"iso-date-time":Ye(Vl(),Bl),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:xv,"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:Ev,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:wv,int32:{type:"number",validate:zv},int64:{type:"number",validate:Tv},float:{type:"number",validate:Ul},double:{type:"number",validate:Ul},password:!0,binary:!0};Xe.fastFormats={...Xe.fullFormats,date:Ye(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,La),time:Ye(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,Ua),"date-time":Ye(/^\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,Kl),"iso-time":Ye(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,Hl),"iso-date-time":Ye(/^\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,Bl),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};Xe.formatNames=Object.keys(Xe.fullFormats);function gv(t){return t%4===0&&(t%100!==0||t%400===0)}var _v=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,vv=[0,31,28,31,30,31,30,31,31,30,31,30,31];function Fl(t){let e=_v.exec(t);if(!e)return!1;let r=+e[1],n=+e[2],s=+e[3];return n>=1&&n<=12&&s>=1&&s<=(n===2&&gv(r)?29:vv[n])}function La(t,e){if(t&&e)return t>e?1:t<e?-1:0}var Da=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i;function Za(t){return function(r){let n=Da.exec(r);if(!n)return!1;let s=+n[1],o=+n[2],a=+n[3],i=n[4],c=n[5]==="-"?-1:1,u=+(n[6]||0),l=+(n[7]||0);if(u>23||l>59||t&&!i)return!1;if(s<=23&&o<=59&&a<60)return!0;let d=o-l*c,m=s-u*c-(d<0?1:0);return(m===23||m===-1)&&(d===59||d===-1)&&a<61}}function Ua(t,e){if(!(t&&e))return;let r=new Date("2020-01-01T"+t).valueOf(),n=new Date("2020-01-01T"+e).valueOf();if(r&&n)return r-n}function Hl(t,e){if(!(t&&e))return;let r=Da.exec(t),n=Da.exec(e);if(r&&n)return t=r[1]+r[2]+r[3],e=n[1]+n[2]+n[3],t>e?1:t<e?-1:0}var Va=/t|\s/i;function Vl(t){let e=Za(t);return function(n){let s=n.split(Va);return s.length===2&&Fl(s[0])&&e(s[1])}}function Kl(t,e){if(!(t&&e))return;let r=new Date(t).valueOf(),n=new Date(e).valueOf();if(r&&n)return r-n}function Bl(t,e){if(!(t&&e))return;let[r,n]=t.split(Va),[s,o]=e.split(Va),a=La(r,s);if(a!==void 0)return a||Ua(n,o)}var bv=/\/|:/,$v=/^(?:[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;function xv(t){return bv.test(t)&&$v.test(t)}var Ll=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function wv(t){return Ll.lastIndex=0,Ll.test(t)}var kv=-(2**31),Sv=2**31-1;function zv(t){return Number.isInteger(t)&&t<=Sv&&t>=kv}function Tv(t){return Number.isInteger(t)}function Ul(){return!0}var Pv=/[^\\]\\Z/;function Ev(t){if(Pv.test(t))return!1;try{return new RegExp(t),!0}catch{return!1}}});var Gl=x(pr=>{"use strict";Object.defineProperty(pr,"__esModule",{value:!0});pr.formatLimitDefinition=void 0;var Rv=qa(),He=A(),$t=He.operators,hs={formatMaximum:{okStr:"<=",ok:$t.LTE,fail:$t.GT},formatMinimum:{okStr:">=",ok:$t.GTE,fail:$t.LT},formatExclusiveMaximum:{okStr:"<",ok:$t.LT,fail:$t.GTE},formatExclusiveMinimum:{okStr:">",ok:$t.GT,fail:$t.LTE}},Ov={message:({keyword:t,schemaCode:e})=>(0,He.str)`should be ${hs[t].okStr} ${e}`,params:({keyword:t,schemaCode:e})=>(0,He._)`{comparison: ${hs[t].okStr}, limit: ${e}}`};pr.formatLimitDefinition={keyword:Object.keys(hs),type:"string",schemaType:"string",$data:!0,error:Ov,code(t){let{gen:e,data:r,schemaCode:n,keyword:s,it:o}=t,{opts:a,self:i}=o;if(!a.validateFormats)return;let c=new Rv.KeywordCxt(o,i.RULES.all.format.definition,"format");c.$data?u():l();function u(){let m=e.scopeValue("formats",{ref:i.formats,code:a.code.formats}),p=e.const("fmt",(0,He._)`${m}[${c.schemaCode}]`);t.fail$data((0,He.or)((0,He._)`typeof ${p} != "object"`,(0,He._)`${p} instanceof RegExp`,(0,He._)`typeof ${p}.compare != "function"`,d(p)))}function l(){let m=c.schema,p=i.formats[m];if(!p||p===!0)return;if(typeof p!="object"||p instanceof RegExp||typeof p.compare!="function")throw new Error(`"${s}": format "${m}" does not define "compare" function`);let h=e.scopeValue("formats",{key:m,ref:p,code:a.code.formats?(0,He._)`${a.code.formats}${(0,He.getProperty)(m)}`:void 0});t.fail$data(d(h))}function d(m){return(0,He._)`${m}.compare(${r}, ${n}) ${hs[s].fail} 0`}},dependencies:["format"]};var Nv=t=>(t.addKeyword(pr.formatLimitDefinition),t);pr.default=Nv});var Xl=x((mn,Yl)=>{"use strict";Object.defineProperty(mn,"__esModule",{value:!0});var mr=Jl(),jv=Gl(),Fa=A(),Wl=new Fa.Name("fullFormats"),Iv=new Fa.Name("fastFormats"),Ha=(t,e={keywords:!0})=>{if(Array.isArray(e))return Ql(t,e,mr.fullFormats,Wl),t;let[r,n]=e.mode==="fast"?[mr.fastFormats,Iv]:[mr.fullFormats,Wl],s=e.formats||mr.formatNames;return Ql(t,s,r,n),e.keywords&&(0,jv.default)(t),t};Ha.get=(t,e="full")=>{let n=(e==="fast"?mr.fastFormats:mr.fullFormats)[t];if(!n)throw new Error(`Unknown format "${t}"`);return n};function Ql(t,e,r,n){var s,o;(s=(o=t.opts.code).formats)!==null&&s!==void 0||(o.formats=(0,Fa._)`require("ajv-formats/dist/formats").${n}`);for(let a of e)t.addFormat(a,r[a])}Yl.exports=mn=Ha;Object.defineProperty(mn,"__esModule",{value:!0});mn.default=Ha});var od="2025-11-25";var qv=[od,"2025-06-18","2025-03-26","2024-11-05","2024-10-07"],ut="io.modelcontextprotocol/related-task",yn="2.0",ie=ri(t=>t!==null&&(typeof t=="object"||typeof t=="function")),ni=re([f(),G().int()]),si=f(),Dv=ge({ttl:G().optional(),pollInterval:G().optional()}),ad=k({ttl:G().optional()}),id=k({taskId:f()}),Ts=ge({progressToken:ni.optional(),[ut]:id.optional()}),Te=k({_meta:Ts.optional()}),_r=Te.extend({task:ad.optional()}),oi=t=>_r.safeParse(t).success,ue=k({method:f(),params:Te.loose().optional()}),Re=k({_meta:Ts.optional()}),Oe=k({method:f(),params:Re.loose().optional()}),le=ge({_meta:Ts.optional()}),gn=re([f(),G().int()]),ai=k({jsonrpc:z(yn),id:gn,...ue.shape}).strict(),Ps=t=>ai.safeParse(t).success,ii=k({jsonrpc:z(yn),...Oe.shape}).strict(),ci=t=>ii.safeParse(t).success,Es=k({jsonrpc:z(yn),id:gn,result:le}).strict(),vr=t=>Es.safeParse(t).success;var W;(function(t){t[t.ConnectionClosed=-32e3]="ConnectionClosed",t[t.RequestTimeout=-32001]="RequestTimeout",t[t.ParseError=-32700]="ParseError",t[t.InvalidRequest=-32600]="InvalidRequest",t[t.MethodNotFound=-32601]="MethodNotFound",t[t.InvalidParams=-32602]="InvalidParams",t[t.InternalError=-32603]="InternalError",t[t.UrlElicitationRequired=-32042]="UrlElicitationRequired"})(W||(W={}));var Rs=k({jsonrpc:z(yn),id:gn.optional(),error:k({code:G().int(),message:f(),data:oe().optional()})}).strict();var ui=t=>Rs.safeParse(t).success;var li=re([ai,ii,Es,Rs]),Zv=re([Es,Rs]),di=le.strict(),cd=Re.extend({requestId:gn.optional(),reason:f().optional()}),_n=Oe.extend({method:z("notifications/cancelled"),params:cd}),ud=k({src:f(),mimeType:f().optional(),sizes:U(f()).optional(),theme:ze(["light","dark"]).optional()}),br=k({icons:U(ud).optional()}),Mt=k({name:f(),title:f().optional()}),fi=Mt.extend({...Mt.shape,...br.shape,version:f(),websiteUrl:f().optional(),description:f().optional()}),ld=ks(k({applyDefaults:ce().optional()}),X(f(),oe())),dd=Ss(t=>t&&typeof t=="object"&&!Array.isArray(t)&&Object.keys(t).length===0?{form:{}}:t,ks(k({form:ld.optional(),url:ie.optional()}),X(f(),oe()).optional())),fd=ge({list:ie.optional(),cancel:ie.optional(),requests:ge({sampling:ge({createMessage:ie.optional()}).optional(),elicitation:ge({create:ie.optional()}).optional()}).optional()}),pd=ge({list:ie.optional(),cancel:ie.optional(),requests:ge({tools:ge({call:ie.optional()}).optional()}).optional()}),md=k({experimental:X(f(),ie).optional(),sampling:k({context:ie.optional(),tools:ie.optional()}).optional(),elicitation:dd.optional(),roots:k({listChanged:ce().optional()}).optional(),tasks:fd.optional(),extensions:X(f(),ie).optional()}),hd=Te.extend({protocolVersion:f(),capabilities:md,clientInfo:fi}),yd=ue.extend({method:z("initialize"),params:hd});var gd=k({experimental:X(f(),ie).optional(),logging:ie.optional(),completions:ie.optional(),prompts:k({listChanged:ce().optional()}).optional(),resources:k({subscribe:ce().optional(),listChanged:ce().optional()}).optional(),tools:k({listChanged:ce().optional()}).optional(),tasks:pd.optional(),extensions:X(f(),ie).optional()}),_d=le.extend({protocolVersion:f(),capabilities:gd,serverInfo:fi,instructions:f().optional()}),pi=Oe.extend({method:z("notifications/initialized"),params:Re.optional()}),Vv=t=>pi.safeParse(t).success,vn=ue.extend({method:z("ping"),params:Te.optional()}),vd=k({progress:G(),total:se(G()),message:se(f())}),bd=k({...Re.shape,...vd.shape,progressToken:ni}),bn=Oe.extend({method:z("notifications/progress"),params:bd}),$d=Te.extend({cursor:si.optional()}),$r=ue.extend({params:$d.optional()}),xr=le.extend({nextCursor:si.optional()}),xd=ze(["working","input_required","completed","failed","cancelled"]),wr=k({taskId:f(),status:xd,ttl:re([G(),ti()]),createdAt:f(),lastUpdatedAt:f(),pollInterval:se(G()),statusMessage:se(f())}),$n=le.extend({task:wr}),wd=Re.merge(wr),kr=Oe.extend({method:z("notifications/tasks/status"),params:wd}),xn=ue.extend({method:z("tasks/get"),params:Te.extend({taskId:f()})}),wn=le.merge(wr),kn=ue.extend({method:z("tasks/result"),params:Te.extend({taskId:f()})}),Lv=le.loose(),Sn=$r.extend({method:z("tasks/list")}),zn=xr.extend({tasks:U(wr)}),Tn=ue.extend({method:z("tasks/cancel"),params:Te.extend({taskId:f()})}),mi=le.merge(wr),hi=k({uri:f(),mimeType:se(f()),_meta:X(f(),oe()).optional()}),yi=hi.extend({text:f()}),Os=f().refine(t=>{try{return atob(t),!0}catch{return!1}},{message:"Invalid Base64 string"}),gi=hi.extend({blob:Os}),Sr=ze(["user","assistant"]),At=k({audience:U(Sr).optional(),priority:G().min(0).max(1).optional(),lastModified:ei.datetime({offset:!0}).optional()}),_i=k({...Mt.shape,...br.shape,uri:f(),description:se(f()),mimeType:se(f()),size:se(G()),annotations:At.optional(),_meta:se(ge({}))}),kd=k({...Mt.shape,...br.shape,uriTemplate:f(),description:se(f()),mimeType:se(f()),annotations:At.optional(),_meta:se(ge({}))}),Sd=$r.extend({method:z("resources/list")}),zd=xr.extend({resources:U(_i)}),Td=$r.extend({method:z("resources/templates/list")}),Pd=xr.extend({resourceTemplates:U(kd)}),Ns=Te.extend({uri:f()}),Ed=Ns,Rd=ue.extend({method:z("resources/read"),params:Ed}),Od=le.extend({contents:U(re([yi,gi]))}),Nd=Oe.extend({method:z("notifications/resources/list_changed"),params:Re.optional()}),jd=Ns,Id=ue.extend({method:z("resources/subscribe"),params:jd}),Md=Ns,Ad=ue.extend({method:z("resources/unsubscribe"),params:Md}),Cd=Re.extend({uri:f()}),qd=Oe.extend({method:z("notifications/resources/updated"),params:Cd}),Dd=k({name:f(),description:se(f()),required:se(ce())}),Zd=k({...Mt.shape,...br.shape,description:se(f()),arguments:se(U(Dd)),_meta:se(ge({}))}),Vd=$r.extend({method:z("prompts/list")}),Ld=xr.extend({prompts:U(Zd)}),Ud=Te.extend({name:f(),arguments:X(f(),f()).optional()}),Fd=ue.extend({method:z("prompts/get"),params:Ud}),js=k({type:z("text"),text:f(),annotations:At.optional(),_meta:X(f(),oe()).optional()}),Is=k({type:z("image"),data:Os,mimeType:f(),annotations:At.optional(),_meta:X(f(),oe()).optional()}),Ms=k({type:z("audio"),data:Os,mimeType:f(),annotations:At.optional(),_meta:X(f(),oe()).optional()}),Hd=k({type:z("tool_use"),name:f(),id:f(),input:X(f(),oe()),_meta:X(f(),oe()).optional()}),Kd=k({type:z("resource"),resource:re([yi,gi]),annotations:At.optional(),_meta:X(f(),oe()).optional()}),Bd=_i.extend({type:z("resource_link")}),As=re([js,Is,Ms,Bd,Kd]),Jd=k({role:Sr,content:As}),Gd=le.extend({description:f().optional(),messages:U(Jd)}),Wd=Oe.extend({method:z("notifications/prompts/list_changed"),params:Re.optional()}),Qd=k({title:f().optional(),readOnlyHint:ce().optional(),destructiveHint:ce().optional(),idempotentHint:ce().optional(),openWorldHint:ce().optional()}),Yd=k({taskSupport:ze(["required","optional","forbidden"]).optional()}),vi=k({...Mt.shape,...br.shape,description:f().optional(),inputSchema:k({type:z("object"),properties:X(f(),ie).optional(),required:U(f()).optional()}).catchall(oe()),outputSchema:k({type:z("object"),properties:X(f(),ie).optional(),required:U(f()).optional()}).catchall(oe()).optional(),annotations:Qd.optional(),execution:Yd.optional(),_meta:X(f(),oe()).optional()}),Xd=$r.extend({method:z("tools/list")}),ef=xr.extend({tools:U(vi)}),bi=le.extend({content:U(As).default([]),structuredContent:X(f(),oe()).optional(),isError:ce().optional()}),Uv=bi.or(le.extend({toolResult:oe()})),tf=_r.extend({name:f(),arguments:X(f(),oe()).optional()}),rf=ue.extend({method:z("tools/call"),params:tf}),nf=Oe.extend({method:z("notifications/tools/list_changed"),params:Re.optional()}),Fv=k({autoRefresh:ce().default(!0),debounceMs:G().int().nonnegative().default(300)}),$i=ze(["debug","info","notice","warning","error","critical","alert","emergency"]),sf=Te.extend({level:$i}),of=ue.extend({method:z("logging/setLevel"),params:sf}),af=Re.extend({level:$i,logger:f().optional(),data:oe()}),cf=Oe.extend({method:z("notifications/message"),params:af}),uf=k({name:f().optional()}),lf=k({hints:U(uf).optional(),costPriority:G().min(0).max(1).optional(),speedPriority:G().min(0).max(1).optional(),intelligencePriority:G().min(0).max(1).optional()}),df=k({mode:ze(["auto","required","none"]).optional()}),ff=k({type:z("tool_result"),toolUseId:f().describe("The unique identifier for the corresponding tool call."),content:U(As).default([]),structuredContent:k({}).loose().optional(),isError:ce().optional(),_meta:X(f(),oe()).optional()}),pf=ws("type",[js,Is,Ms]),hn=ws("type",[js,Is,Ms,Hd,ff]),mf=k({role:Sr,content:re([hn,U(hn)]),_meta:X(f(),oe()).optional()}),hf=_r.extend({messages:U(mf),modelPreferences:lf.optional(),systemPrompt:f().optional(),includeContext:ze(["none","thisServer","allServers"]).optional(),temperature:G().optional(),maxTokens:G().int(),stopSequences:U(f()).optional(),metadata:ie.optional(),tools:U(vi).optional(),toolChoice:df.optional()}),yf=ue.extend({method:z("sampling/createMessage"),params:hf}),gf=le.extend({model:f(),stopReason:se(ze(["endTurn","stopSequence","maxTokens"]).or(f())),role:Sr,content:pf}),_f=le.extend({model:f(),stopReason:se(ze(["endTurn","stopSequence","maxTokens","toolUse"]).or(f())),role:Sr,content:re([hn,U(hn)])}),vf=k({type:z("boolean"),title:f().optional(),description:f().optional(),default:ce().optional()}),bf=k({type:z("string"),title:f().optional(),description:f().optional(),minLength:G().optional(),maxLength:G().optional(),format:ze(["email","uri","date","date-time"]).optional(),default:f().optional()}),$f=k({type:ze(["number","integer"]),title:f().optional(),description:f().optional(),minimum:G().optional(),maximum:G().optional(),default:G().optional()}),xf=k({type:z("string"),title:f().optional(),description:f().optional(),enum:U(f()),default:f().optional()}),wf=k({type:z("string"),title:f().optional(),description:f().optional(),oneOf:U(k({const:f(),title:f()})),default:f().optional()}),kf=k({type:z("string"),title:f().optional(),description:f().optional(),enum:U(f()),enumNames:U(f()).optional(),default:f().optional()}),Sf=re([xf,wf]),zf=k({type:z("array"),title:f().optional(),description:f().optional(),minItems:G().optional(),maxItems:G().optional(),items:k({type:z("string"),enum:U(f())}),default:U(f()).optional()}),Tf=k({type:z("array"),title:f().optional(),description:f().optional(),minItems:G().optional(),maxItems:G().optional(),items:k({anyOf:U(k({const:f(),title:f()}))}),default:U(f()).optional()}),Pf=re([zf,Tf]),Ef=re([kf,Sf,Pf]),Rf=re([Ef,vf,bf,$f]),Of=_r.extend({mode:z("form").optional(),message:f(),requestedSchema:k({type:z("object"),properties:X(f(),Rf),required:U(f()).optional()})}),Nf=_r.extend({mode:z("url"),message:f(),elicitationId:f(),url:f().url()}),jf=re([Of,Nf]),If=ue.extend({method:z("elicitation/create"),params:jf}),Mf=Re.extend({elicitationId:f()}),Af=Oe.extend({method:z("notifications/elicitation/complete"),params:Mf}),Cf=le.extend({action:ze(["accept","decline","cancel"]),content:Ss(t=>t===null?void 0:t,X(f(),re([f(),G(),ce(),U(f())])).optional())}),qf=k({type:z("ref/resource"),uri:f()});var Df=k({type:z("ref/prompt"),name:f()}),Zf=Te.extend({ref:re([Df,qf]),argument:k({name:f(),value:f()}),context:k({arguments:X(f(),f()).optional()}).optional()}),Vf=ue.extend({method:z("completion/complete"),params:Zf});function Hv(t){if(t.params.ref.type!=="ref/prompt")throw new TypeError(`Expected CompleteRequestPrompt, but got ${t.params.ref.type}`)}function Kv(t){if(t.params.ref.type!=="ref/resource")throw new TypeError(`Expected CompleteRequestResourceTemplate, but got ${t.params.ref.type}`)}var Lf=le.extend({completion:ge({values:U(f()).max(100),total:se(G().int()),hasMore:se(ce())})}),Uf=k({uri:f().startsWith("file://"),name:f().optional(),_meta:X(f(),oe()).optional()}),Ff=ue.extend({method:z("roots/list"),params:Te.optional()}),Hf=le.extend({roots:U(Uf)}),Kf=Oe.extend({method:z("notifications/roots/list_changed"),params:Re.optional()}),Bv=re([vn,yd,Vf,of,Fd,Vd,Sd,Td,Rd,Id,Ad,rf,Xd,xn,kn,Sn,Tn]),Jv=re([_n,bn,pi,Kf,kr]),Gv=re([di,gf,_f,Cf,Hf,wn,zn,$n]),Wv=re([vn,yf,If,Ff,xn,kn,Sn,Tn]),Qv=re([_n,bn,cf,qd,Nd,nf,Wd,kr,Af]),Yv=re([di,_d,Lf,Gd,Ld,zd,Pd,Od,bi,ef,wn,zn,$n]),F=class t extends Error{constructor(e,r,n){super(`MCP error ${e}: ${r}`),this.code=e,this.data=n,this.name="McpError"}static fromError(e,r,n){if(e===W.UrlElicitationRequired&&n){let s=n;if(s.elicitations)return new zs(s.elicitations,r)}return new t(e,r,n)}},zs=class extends F{constructor(e,r=`URL elicitation${e.length>1?"s":""} required`){super(W.UrlElicitationRequired,r,{elicitations:e})}get elicitations(){return this.data?.elicitations??[]}};var Z;(function(t){t.assertEqual=s=>{};function e(s){}t.assertIs=e;function r(s){throw new Error}t.assertNever=r,t.arrayToEnum=s=>{let o={};for(let a of s)o[a]=a;return o},t.getValidEnumValues=s=>{let o=t.objectKeys(s).filter(i=>typeof s[s[i]]!="number"),a={};for(let i of o)a[i]=s[i];return t.objectValues(a)},t.objectValues=s=>t.objectKeys(s).map(function(o){return s[o]}),t.objectKeys=typeof Object.keys=="function"?s=>Object.keys(s):s=>{let o=[];for(let a in s)Object.prototype.hasOwnProperty.call(s,a)&&o.push(a);return o},t.find=(s,o)=>{for(let a of s)if(o(a))return a},t.isInteger=typeof Number.isInteger=="function"?s=>Number.isInteger(s):s=>typeof s=="number"&&Number.isFinite(s)&&Math.floor(s)===s;function n(s,o=" | "){return s.map(a=>typeof a=="string"?`'${a}'`:a).join(o)}t.joinValues=n,t.jsonStringifyReplacer=(s,o)=>typeof o=="bigint"?o.toString():o})(Z||(Z={}));var xi;(function(t){t.mergeShapes=(e,r)=>({...e,...r})})(xi||(xi={}));var w=Z.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),tt=t=>{switch(typeof t){case"undefined":return w.undefined;case"string":return w.string;case"number":return Number.isNaN(t)?w.nan:w.number;case"boolean":return w.boolean;case"function":return w.function;case"bigint":return w.bigint;case"symbol":return w.symbol;case"object":return Array.isArray(t)?w.array:t===null?w.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?w.promise:typeof Map<"u"&&t instanceof Map?w.map:typeof Set<"u"&&t instanceof Set?w.set:typeof Date<"u"&&t instanceof Date?w.date:w.object;default:return w.unknown}};var g=Z.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);var Pe=class t extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=n=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};let r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=e}format(e){let r=e||function(o){return o.message},n={_errors:[]},s=o=>{for(let a of o.issues)if(a.code==="invalid_union")a.unionErrors.map(s);else if(a.code==="invalid_return_type")s(a.returnTypeError);else if(a.code==="invalid_arguments")s(a.argumentsError);else if(a.path.length===0)n._errors.push(r(a));else{let i=n,c=0;for(;c<a.path.length;){let u=a.path[c];c===a.path.length-1?(i[u]=i[u]||{_errors:[]},i[u]._errors.push(r(a))):i[u]=i[u]||{_errors:[]},i=i[u],c++}}};return s(this),n}static assert(e){if(!(e instanceof t))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,Z.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=r=>r.message){let r=Object.create(null),n=[];for(let s of this.issues)if(s.path.length>0){let o=s.path[0];r[o]=r[o]||[],r[o].push(e(s))}else n.push(e(s));return{formErrors:n,fieldErrors:r}}get formErrors(){return this.flatten()}};Pe.create=t=>new Pe(t);var Bf=(t,e)=>{let r;switch(t.code){case g.invalid_type:t.received===w.undefined?r="Required":r=`Expected ${t.expected}, received ${t.received}`;break;case g.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(t.expected,Z.jsonStringifyReplacer)}`;break;case g.unrecognized_keys:r=`Unrecognized key(s) in object: ${Z.joinValues(t.keys,", ")}`;break;case g.invalid_union:r="Invalid input";break;case g.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${Z.joinValues(t.options)}`;break;case g.invalid_enum_value:r=`Invalid enum value. Expected ${Z.joinValues(t.options)}, received '${t.received}'`;break;case g.invalid_arguments:r="Invalid function arguments";break;case g.invalid_return_type:r="Invalid function return type";break;case g.invalid_date:r="Invalid date";break;case g.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(r=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(r=`${r} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?r=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?r=`Invalid input: must end with "${t.validation.endsWith}"`:Z.assertNever(t.validation):t.validation!=="regex"?r=`Invalid ${t.validation}`:r="Invalid";break;case g.too_small:t.type==="array"?r=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?r=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?r=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="bigint"?r=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?r=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:r="Invalid input";break;case g.too_big:t.type==="array"?r=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?r=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?r=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?r=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?r=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:r="Invalid input";break;case g.custom:r="Invalid input";break;case g.invalid_intersection_types:r="Intersection results could not be merged";break;case g.not_multiple_of:r=`Number must be a multiple of ${t.multipleOf}`;break;case g.not_finite:r="Number must be finite";break;default:r=e.defaultError,Z.assertNever(t)}return{message:r}},lt=Bf;var Jf=lt;function zr(){return Jf}var Pn=t=>{let{data:e,path:r,errorMaps:n,issueData:s}=t,o=[...r,...s.path||[]],a={...s,path:o};if(s.message!==void 0)return{...s,path:o,message:s.message};let i="",c=n.filter(u=>!!u).slice().reverse();for(let u of c)i=u(a,{data:e,defaultError:i}).message;return{...s,path:o,message:i}};function b(t,e){let r=zr(),n=Pn({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,r,r===lt?void 0:lt].filter(s=>!!s)});t.common.issues.push(n)}var pe=class t{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,r){let n=[];for(let s of r){if(s.status==="aborted")return E;s.status==="dirty"&&e.dirty(),n.push(s.value)}return{status:e.value,value:n}}static async mergeObjectAsync(e,r){let n=[];for(let s of r){let o=await s.key,a=await s.value;n.push({key:o,value:a})}return t.mergeObjectSync(e,n)}static mergeObjectSync(e,r){let n={};for(let s of r){let{key:o,value:a}=s;if(o.status==="aborted"||a.status==="aborted")return E;o.status==="dirty"&&e.dirty(),a.status==="dirty"&&e.dirty(),o.value!=="__proto__"&&(typeof a.value<"u"||s.alwaysSet)&&(n[o.value]=a.value)}return{status:e.value,value:n}}},E=Object.freeze({status:"aborted"}),Ct=t=>({status:"dirty",value:t}),_e=t=>({status:"valid",value:t}),Cs=t=>t.status==="aborted",qs=t=>t.status==="dirty",xt=t=>t.status==="valid",Tr=t=>typeof Promise<"u"&&t instanceof Promise;var S;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e?.message})(S||(S={}));var Ne=class{constructor(e,r,n,s){this._cachedPath=[],this.parent=e,this.data=r,this._path=n,this._key=s}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},wi=(t,e)=>{if(xt(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let r=new Pe(t.common.issues);return this._error=r,this._error}}};function I(t){if(!t)return{};let{errorMap:e,invalid_type_error:r,required_error:n,description:s}=t;if(e&&(r||n))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:s}:{errorMap:(a,i)=>{let{message:c}=t;return a.code==="invalid_enum_value"?{message:c??i.defaultError}:typeof i.data>"u"?{message:c??n??i.defaultError}:a.code!=="invalid_type"?{message:i.defaultError}:{message:c??r??i.defaultError}},description:s}}var C=class{get description(){return this._def.description}_getType(e){return tt(e.data)}_getOrReturnCtx(e,r){return r||{common:e.parent.common,data:e.data,parsedType:tt(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new pe,ctx:{common:e.parent.common,data:e.data,parsedType:tt(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let r=this._parse(e);if(Tr(r))throw new Error("Synchronous parse encountered promise.");return r}_parseAsync(e){let r=this._parse(e);return Promise.resolve(r)}parse(e,r){let n=this.safeParse(e,r);if(n.success)return n.data;throw n.error}safeParse(e,r){let n={common:{issues:[],async:r?.async??!1,contextualErrorMap:r?.errorMap},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:tt(e)},s=this._parseSync({data:e,path:n.path,parent:n});return wi(n,s)}"~validate"(e){let r={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:tt(e)};if(!this["~standard"].async)try{let n=this._parseSync({data:e,path:[],parent:r});return xt(n)?{value:n.value}:{issues:r.common.issues}}catch(n){n?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),r.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:r}).then(n=>xt(n)?{value:n.value}:{issues:r.common.issues})}async parseAsync(e,r){let n=await this.safeParseAsync(e,r);if(n.success)return n.data;throw n.error}async safeParseAsync(e,r){let n={common:{issues:[],contextualErrorMap:r?.errorMap,async:!0},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:tt(e)},s=this._parse({data:e,path:n.path,parent:n}),o=await(Tr(s)?s:Promise.resolve(s));return wi(n,o)}refine(e,r){let n=s=>typeof r=="string"||typeof r>"u"?{message:r}:typeof r=="function"?r(s):r;return this._refinement((s,o)=>{let a=e(s),i=()=>o.addIssue({code:g.custom,...n(s)});return typeof Promise<"u"&&a instanceof Promise?a.then(c=>c?!0:(i(),!1)):a?!0:(i(),!1)})}refinement(e,r){return this._refinement((n,s)=>e(n)?!0:(s.addIssue(typeof r=="function"?r(n,s):r),!1))}_refinement(e){return new qe({schema:this,typeName:_.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:r=>this["~validate"](r)}}optional(){return Ce.create(this,this._def)}nullable(){return st.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return ft.create(this)}promise(){return wt.create(this,this._def)}or(e){return Lt.create([this,e],this._def)}and(e){return Ut.create(this,e,this._def)}transform(e){return new qe({...I(this._def),schema:this,typeName:_.ZodEffects,effect:{type:"transform",transform:e}})}default(e){let r=typeof e=="function"?e:()=>e;return new Jt({...I(this._def),innerType:this,defaultValue:r,typeName:_.ZodDefault})}brand(){return new En({typeName:_.ZodBranded,type:this,...I(this._def)})}catch(e){let r=typeof e=="function"?e:()=>e;return new Gt({...I(this._def),innerType:this,catchValue:r,typeName:_.ZodCatch})}describe(e){let r=this.constructor;return new r({...this._def,description:e})}pipe(e){return Rn.create(this,e)}readonly(){return Wt.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},Gf=/^c[^\s-]{8,}$/i,Wf=/^[0-9a-z]+$/,Qf=/^[0-9A-HJKMNP-TV-Z]{26}$/i,Yf=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,Xf=/^[a-z0-9_-]{21}$/i,ep=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,tp=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,rp=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,np="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",Ds,sp=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,op=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,ap=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,ip=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,cp=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,up=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,ki="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",lp=new RegExp(`^${ki}$`);function Si(t){let e="[0-5]\\d";t.precision?e=`${e}\\.\\d{${t.precision}}`:t.precision==null&&(e=`${e}(\\.\\d+)?`);let r=t.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${r}`}function dp(t){return new RegExp(`^${Si(t)}$`)}function fp(t){let e=`${ki}T${Si(t)}`,r=[];return r.push(t.local?"Z?":"Z"),t.offset&&r.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${r.join("|")})`,new RegExp(`^${e}$`)}function pp(t,e){return!!((e==="v4"||!e)&&sp.test(t)||(e==="v6"||!e)&&ap.test(t))}function mp(t,e){if(!ep.test(t))return!1;try{let[r]=t.split(".");if(!r)return!1;let n=r.replace(/-/g,"+").replace(/_/g,"/").padEnd(r.length+(4-r.length%4)%4,"="),s=JSON.parse(atob(n));return!(typeof s!="object"||s===null||"typ"in s&&s?.typ!=="JWT"||!s.alg||e&&s.alg!==e)}catch{return!1}}function hp(t,e){return!!((e==="v4"||!e)&&op.test(t)||(e==="v6"||!e)&&ip.test(t))}var Dt=class t extends C{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==w.string){let o=this._getOrReturnCtx(e);return b(o,{code:g.invalid_type,expected:w.string,received:o.parsedType}),E}let n=new pe,s;for(let o of this._def.checks)if(o.kind==="min")e.data.length<o.value&&(s=this._getOrReturnCtx(e,s),b(s,{code:g.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),n.dirty());else if(o.kind==="max")e.data.length>o.value&&(s=this._getOrReturnCtx(e,s),b(s,{code:g.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),n.dirty());else if(o.kind==="length"){let a=e.data.length>o.value,i=e.data.length<o.value;(a||i)&&(s=this._getOrReturnCtx(e,s),a?b(s,{code:g.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}):i&&b(s,{code:g.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}),n.dirty())}else if(o.kind==="email")rp.test(e.data)||(s=this._getOrReturnCtx(e,s),b(s,{validation:"email",code:g.invalid_string,message:o.message}),n.dirty());else if(o.kind==="emoji")Ds||(Ds=new RegExp(np,"u")),Ds.test(e.data)||(s=this._getOrReturnCtx(e,s),b(s,{validation:"emoji",code:g.invalid_string,message:o.message}),n.dirty());else if(o.kind==="uuid")Yf.test(e.data)||(s=this._getOrReturnCtx(e,s),b(s,{validation:"uuid",code:g.invalid_string,message:o.message}),n.dirty());else if(o.kind==="nanoid")Xf.test(e.data)||(s=this._getOrReturnCtx(e,s),b(s,{validation:"nanoid",code:g.invalid_string,message:o.message}),n.dirty());else if(o.kind==="cuid")Gf.test(e.data)||(s=this._getOrReturnCtx(e,s),b(s,{validation:"cuid",code:g.invalid_string,message:o.message}),n.dirty());else if(o.kind==="cuid2")Wf.test(e.data)||(s=this._getOrReturnCtx(e,s),b(s,{validation:"cuid2",code:g.invalid_string,message:o.message}),n.dirty());else if(o.kind==="ulid")Qf.test(e.data)||(s=this._getOrReturnCtx(e,s),b(s,{validation:"ulid",code:g.invalid_string,message:o.message}),n.dirty());else if(o.kind==="url")try{new URL(e.data)}catch{s=this._getOrReturnCtx(e,s),b(s,{validation:"url",code:g.invalid_string,message:o.message}),n.dirty()}else o.kind==="regex"?(o.regex.lastIndex=0,o.regex.test(e.data)||(s=this._getOrReturnCtx(e,s),b(s,{validation:"regex",code:g.invalid_string,message:o.message}),n.dirty())):o.kind==="trim"?e.data=e.data.trim():o.kind==="includes"?e.data.includes(o.value,o.position)||(s=this._getOrReturnCtx(e,s),b(s,{code:g.invalid_string,validation:{includes:o.value,position:o.position},message:o.message}),n.dirty()):o.kind==="toLowerCase"?e.data=e.data.toLowerCase():o.kind==="toUpperCase"?e.data=e.data.toUpperCase():o.kind==="startsWith"?e.data.startsWith(o.value)||(s=this._getOrReturnCtx(e,s),b(s,{code:g.invalid_string,validation:{startsWith:o.value},message:o.message}),n.dirty()):o.kind==="endsWith"?e.data.endsWith(o.value)||(s=this._getOrReturnCtx(e,s),b(s,{code:g.invalid_string,validation:{endsWith:o.value},message:o.message}),n.dirty()):o.kind==="datetime"?fp(o).test(e.data)||(s=this._getOrReturnCtx(e,s),b(s,{code:g.invalid_string,validation:"datetime",message:o.message}),n.dirty()):o.kind==="date"?lp.test(e.data)||(s=this._getOrReturnCtx(e,s),b(s,{code:g.invalid_string,validation:"date",message:o.message}),n.dirty()):o.kind==="time"?dp(o).test(e.data)||(s=this._getOrReturnCtx(e,s),b(s,{code:g.invalid_string,validation:"time",message:o.message}),n.dirty()):o.kind==="duration"?tp.test(e.data)||(s=this._getOrReturnCtx(e,s),b(s,{validation:"duration",code:g.invalid_string,message:o.message}),n.dirty()):o.kind==="ip"?pp(e.data,o.version)||(s=this._getOrReturnCtx(e,s),b(s,{validation:"ip",code:g.invalid_string,message:o.message}),n.dirty()):o.kind==="jwt"?mp(e.data,o.alg)||(s=this._getOrReturnCtx(e,s),b(s,{validation:"jwt",code:g.invalid_string,message:o.message}),n.dirty()):o.kind==="cidr"?hp(e.data,o.version)||(s=this._getOrReturnCtx(e,s),b(s,{validation:"cidr",code:g.invalid_string,message:o.message}),n.dirty()):o.kind==="base64"?cp.test(e.data)||(s=this._getOrReturnCtx(e,s),b(s,{validation:"base64",code:g.invalid_string,message:o.message}),n.dirty()):o.kind==="base64url"?up.test(e.data)||(s=this._getOrReturnCtx(e,s),b(s,{validation:"base64url",code:g.invalid_string,message:o.message}),n.dirty()):Z.assertNever(o);return{status:n.value,value:e.data}}_regex(e,r,n){return this.refinement(s=>e.test(s),{validation:r,code:g.invalid_string,...S.errToObj(n)})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...S.errToObj(e)})}url(e){return this._addCheck({kind:"url",...S.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...S.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...S.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...S.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...S.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...S.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...S.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...S.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...S.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...S.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...S.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...S.errToObj(e)})}datetime(e){return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof e?.precision>"u"?null:e?.precision,offset:e?.offset??!1,local:e?.local??!1,...S.errToObj(e?.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof e?.precision>"u"?null:e?.precision,...S.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...S.errToObj(e)})}regex(e,r){return this._addCheck({kind:"regex",regex:e,...S.errToObj(r)})}includes(e,r){return this._addCheck({kind:"includes",value:e,position:r?.position,...S.errToObj(r?.message)})}startsWith(e,r){return this._addCheck({kind:"startsWith",value:e,...S.errToObj(r)})}endsWith(e,r){return this._addCheck({kind:"endsWith",value:e,...S.errToObj(r)})}min(e,r){return this._addCheck({kind:"min",value:e,...S.errToObj(r)})}max(e,r){return this._addCheck({kind:"max",value:e,...S.errToObj(r)})}length(e,r){return this._addCheck({kind:"length",value:e,...S.errToObj(r)})}nonempty(e){return this.min(1,S.errToObj(e))}trim(){return new t({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new t({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new t({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isCIDR(){return!!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find(e=>e.kind==="base64url")}get minLength(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxLength(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}};Dt.create=t=>new Dt({checks:[],typeName:_.ZodString,coerce:t?.coerce??!1,...I(t)});function yp(t,e){let r=(t.toString().split(".")[1]||"").length,n=(e.toString().split(".")[1]||"").length,s=r>n?r:n,o=Number.parseInt(t.toFixed(s).replace(".","")),a=Number.parseInt(e.toFixed(s).replace(".",""));return o%a/10**s}var Pr=class t extends C{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==w.number){let o=this._getOrReturnCtx(e);return b(o,{code:g.invalid_type,expected:w.number,received:o.parsedType}),E}let n,s=new pe;for(let o of this._def.checks)o.kind==="int"?Z.isInteger(e.data)||(n=this._getOrReturnCtx(e,n),b(n,{code:g.invalid_type,expected:"integer",received:"float",message:o.message}),s.dirty()):o.kind==="min"?(o.inclusive?e.data<o.value:e.data<=o.value)&&(n=this._getOrReturnCtx(e,n),b(n,{code:g.too_small,minimum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),s.dirty()):o.kind==="max"?(o.inclusive?e.data>o.value:e.data>=o.value)&&(n=this._getOrReturnCtx(e,n),b(n,{code:g.too_big,maximum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),s.dirty()):o.kind==="multipleOf"?yp(e.data,o.value)!==0&&(n=this._getOrReturnCtx(e,n),b(n,{code:g.not_multiple_of,multipleOf:o.value,message:o.message}),s.dirty()):o.kind==="finite"?Number.isFinite(e.data)||(n=this._getOrReturnCtx(e,n),b(n,{code:g.not_finite,message:o.message}),s.dirty()):Z.assertNever(o);return{status:s.value,value:e.data}}gte(e,r){return this.setLimit("min",e,!0,S.toString(r))}gt(e,r){return this.setLimit("min",e,!1,S.toString(r))}lte(e,r){return this.setLimit("max",e,!0,S.toString(r))}lt(e,r){return this.setLimit("max",e,!1,S.toString(r))}setLimit(e,r,n,s){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:n,message:S.toString(s)}]})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:S.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:S.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:S.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:S.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:S.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:S.toString(r)})}finite(e){return this._addCheck({kind:"finite",message:S.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:S.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:S.toString(e)})}get minValue(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&Z.isInteger(e.value))}get isFinite(){let e=null,r=null;for(let n of this._def.checks){if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;n.kind==="min"?(r===null||n.value>r)&&(r=n.value):n.kind==="max"&&(e===null||n.value<e)&&(e=n.value)}return Number.isFinite(r)&&Number.isFinite(e)}};Pr.create=t=>new Pr({checks:[],typeName:_.ZodNumber,coerce:t?.coerce||!1,...I(t)});var Er=class t extends C{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==w.bigint)return this._getInvalidInput(e);let n,s=new pe;for(let o of this._def.checks)o.kind==="min"?(o.inclusive?e.data<o.value:e.data<=o.value)&&(n=this._getOrReturnCtx(e,n),b(n,{code:g.too_small,type:"bigint",minimum:o.value,inclusive:o.inclusive,message:o.message}),s.dirty()):o.kind==="max"?(o.inclusive?e.data>o.value:e.data>=o.value)&&(n=this._getOrReturnCtx(e,n),b(n,{code:g.too_big,type:"bigint",maximum:o.value,inclusive:o.inclusive,message:o.message}),s.dirty()):o.kind==="multipleOf"?e.data%o.value!==BigInt(0)&&(n=this._getOrReturnCtx(e,n),b(n,{code:g.not_multiple_of,multipleOf:o.value,message:o.message}),s.dirty()):Z.assertNever(o);return{status:s.value,value:e.data}}_getInvalidInput(e){let r=this._getOrReturnCtx(e);return b(r,{code:g.invalid_type,expected:w.bigint,received:r.parsedType}),E}gte(e,r){return this.setLimit("min",e,!0,S.toString(r))}gt(e,r){return this.setLimit("min",e,!1,S.toString(r))}lte(e,r){return this.setLimit("max",e,!0,S.toString(r))}lt(e,r){return this.setLimit("max",e,!1,S.toString(r))}setLimit(e,r,n,s){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:n,message:S.toString(s)}]})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:S.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:S.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:S.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:S.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:S.toString(r)})}get minValue(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}};Er.create=t=>new Er({checks:[],typeName:_.ZodBigInt,coerce:t?.coerce??!1,...I(t)});var Rr=class extends C{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==w.boolean){let n=this._getOrReturnCtx(e);return b(n,{code:g.invalid_type,expected:w.boolean,received:n.parsedType}),E}return _e(e.data)}};Rr.create=t=>new Rr({typeName:_.ZodBoolean,coerce:t?.coerce||!1,...I(t)});var Or=class t extends C{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==w.date){let o=this._getOrReturnCtx(e);return b(o,{code:g.invalid_type,expected:w.date,received:o.parsedType}),E}if(Number.isNaN(e.data.getTime())){let o=this._getOrReturnCtx(e);return b(o,{code:g.invalid_date}),E}let n=new pe,s;for(let o of this._def.checks)o.kind==="min"?e.data.getTime()<o.value&&(s=this._getOrReturnCtx(e,s),b(s,{code:g.too_small,message:o.message,inclusive:!0,exact:!1,minimum:o.value,type:"date"}),n.dirty()):o.kind==="max"?e.data.getTime()>o.value&&(s=this._getOrReturnCtx(e,s),b(s,{code:g.too_big,message:o.message,inclusive:!0,exact:!1,maximum:o.value,type:"date"}),n.dirty()):Z.assertNever(o);return{status:n.value,value:new Date(e.data.getTime())}}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}min(e,r){return this._addCheck({kind:"min",value:e.getTime(),message:S.toString(r)})}max(e,r){return this._addCheck({kind:"max",value:e.getTime(),message:S.toString(r)})}get minDate(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e!=null?new Date(e):null}};Or.create=t=>new Or({checks:[],coerce:t?.coerce||!1,typeName:_.ZodDate,...I(t)});var Nr=class extends C{_parse(e){if(this._getType(e)!==w.symbol){let n=this._getOrReturnCtx(e);return b(n,{code:g.invalid_type,expected:w.symbol,received:n.parsedType}),E}return _e(e.data)}};Nr.create=t=>new Nr({typeName:_.ZodSymbol,...I(t)});var Zt=class extends C{_parse(e){if(this._getType(e)!==w.undefined){let n=this._getOrReturnCtx(e);return b(n,{code:g.invalid_type,expected:w.undefined,received:n.parsedType}),E}return _e(e.data)}};Zt.create=t=>new Zt({typeName:_.ZodUndefined,...I(t)});var Vt=class extends C{_parse(e){if(this._getType(e)!==w.null){let n=this._getOrReturnCtx(e);return b(n,{code:g.invalid_type,expected:w.null,received:n.parsedType}),E}return _e(e.data)}};Vt.create=t=>new Vt({typeName:_.ZodNull,...I(t)});var jr=class extends C{constructor(){super(...arguments),this._any=!0}_parse(e){return _e(e.data)}};jr.create=t=>new jr({typeName:_.ZodAny,...I(t)});var dt=class extends C{constructor(){super(...arguments),this._unknown=!0}_parse(e){return _e(e.data)}};dt.create=t=>new dt({typeName:_.ZodUnknown,...I(t)});var Be=class extends C{_parse(e){let r=this._getOrReturnCtx(e);return b(r,{code:g.invalid_type,expected:w.never,received:r.parsedType}),E}};Be.create=t=>new Be({typeName:_.ZodNever,...I(t)});var Ir=class extends C{_parse(e){if(this._getType(e)!==w.undefined){let n=this._getOrReturnCtx(e);return b(n,{code:g.invalid_type,expected:w.void,received:n.parsedType}),E}return _e(e.data)}};Ir.create=t=>new Ir({typeName:_.ZodVoid,...I(t)});var ft=class t extends C{_parse(e){let{ctx:r,status:n}=this._processInputParams(e),s=this._def;if(r.parsedType!==w.array)return b(r,{code:g.invalid_type,expected:w.array,received:r.parsedType}),E;if(s.exactLength!==null){let a=r.data.length>s.exactLength.value,i=r.data.length<s.exactLength.value;(a||i)&&(b(r,{code:a?g.too_big:g.too_small,minimum:i?s.exactLength.value:void 0,maximum:a?s.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:s.exactLength.message}),n.dirty())}if(s.minLength!==null&&r.data.length<s.minLength.value&&(b(r,{code:g.too_small,minimum:s.minLength.value,type:"array",inclusive:!0,exact:!1,message:s.minLength.message}),n.dirty()),s.maxLength!==null&&r.data.length>s.maxLength.value&&(b(r,{code:g.too_big,maximum:s.maxLength.value,type:"array",inclusive:!0,exact:!1,message:s.maxLength.message}),n.dirty()),r.common.async)return Promise.all([...r.data].map((a,i)=>s.type._parseAsync(new Ne(r,a,r.path,i)))).then(a=>pe.mergeArray(n,a));let o=[...r.data].map((a,i)=>s.type._parseSync(new Ne(r,a,r.path,i)));return pe.mergeArray(n,o)}get element(){return this._def.type}min(e,r){return new t({...this._def,minLength:{value:e,message:S.toString(r)}})}max(e,r){return new t({...this._def,maxLength:{value:e,message:S.toString(r)}})}length(e,r){return new t({...this._def,exactLength:{value:e,message:S.toString(r)}})}nonempty(e){return this.min(1,e)}};ft.create=(t,e)=>new ft({type:t,minLength:null,maxLength:null,exactLength:null,typeName:_.ZodArray,...I(e)});function qt(t){if(t instanceof Ee){let e={};for(let r in t.shape){let n=t.shape[r];e[r]=Ce.create(qt(n))}return new Ee({...t._def,shape:()=>e})}else return t instanceof ft?new ft({...t._def,type:qt(t.element)}):t instanceof Ce?Ce.create(qt(t.unwrap())):t instanceof st?st.create(qt(t.unwrap())):t instanceof nt?nt.create(t.items.map(e=>qt(e))):t}var Ee=class t extends C{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let e=this._def.shape(),r=Z.objectKeys(e);return this._cached={shape:e,keys:r},this._cached}_parse(e){if(this._getType(e)!==w.object){let u=this._getOrReturnCtx(e);return b(u,{code:g.invalid_type,expected:w.object,received:u.parsedType}),E}let{status:n,ctx:s}=this._processInputParams(e),{shape:o,keys:a}=this._getCached(),i=[];if(!(this._def.catchall instanceof Be&&this._def.unknownKeys==="strip"))for(let u in s.data)a.includes(u)||i.push(u);let c=[];for(let u of a){let l=o[u],d=s.data[u];c.push({key:{status:"valid",value:u},value:l._parse(new Ne(s,d,s.path,u)),alwaysSet:u in s.data})}if(this._def.catchall instanceof Be){let u=this._def.unknownKeys;if(u==="passthrough")for(let l of i)c.push({key:{status:"valid",value:l},value:{status:"valid",value:s.data[l]}});else if(u==="strict")i.length>0&&(b(s,{code:g.unrecognized_keys,keys:i}),n.dirty());else if(u!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let u=this._def.catchall;for(let l of i){let d=s.data[l];c.push({key:{status:"valid",value:l},value:u._parse(new Ne(s,d,s.path,l)),alwaysSet:l in s.data})}}return s.common.async?Promise.resolve().then(async()=>{let u=[];for(let l of c){let d=await l.key,m=await l.value;u.push({key:d,value:m,alwaysSet:l.alwaysSet})}return u}).then(u=>pe.mergeObjectSync(n,u)):pe.mergeObjectSync(n,c)}get shape(){return this._def.shape()}strict(e){return S.errToObj,new t({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(r,n)=>{let s=this._def.errorMap?.(r,n).message??n.defaultError;return r.code==="unrecognized_keys"?{message:S.errToObj(e).message??s}:{message:s}}}:{}})}strip(){return new t({...this._def,unknownKeys:"strip"})}passthrough(){return new t({...this._def,unknownKeys:"passthrough"})}extend(e){return new t({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new t({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:_.ZodObject})}setKey(e,r){return this.augment({[e]:r})}catchall(e){return new t({...this._def,catchall:e})}pick(e){let r={};for(let n of Z.objectKeys(e))e[n]&&this.shape[n]&&(r[n]=this.shape[n]);return new t({...this._def,shape:()=>r})}omit(e){let r={};for(let n of Z.objectKeys(this.shape))e[n]||(r[n]=this.shape[n]);return new t({...this._def,shape:()=>r})}deepPartial(){return qt(this)}partial(e){let r={};for(let n of Z.objectKeys(this.shape)){let s=this.shape[n];e&&!e[n]?r[n]=s:r[n]=s.optional()}return new t({...this._def,shape:()=>r})}required(e){let r={};for(let n of Z.objectKeys(this.shape))if(e&&!e[n])r[n]=this.shape[n];else{let o=this.shape[n];for(;o instanceof Ce;)o=o._def.innerType;r[n]=o}return new t({...this._def,shape:()=>r})}keyof(){return zi(Z.objectKeys(this.shape))}};Ee.create=(t,e)=>new Ee({shape:()=>t,unknownKeys:"strip",catchall:Be.create(),typeName:_.ZodObject,...I(e)});Ee.strictCreate=(t,e)=>new Ee({shape:()=>t,unknownKeys:"strict",catchall:Be.create(),typeName:_.ZodObject,...I(e)});Ee.lazycreate=(t,e)=>new Ee({shape:t,unknownKeys:"strip",catchall:Be.create(),typeName:_.ZodObject,...I(e)});var Lt=class extends C{_parse(e){let{ctx:r}=this._processInputParams(e),n=this._def.options;function s(o){for(let i of o)if(i.result.status==="valid")return i.result;for(let i of o)if(i.result.status==="dirty")return r.common.issues.push(...i.ctx.common.issues),i.result;let a=o.map(i=>new Pe(i.ctx.common.issues));return b(r,{code:g.invalid_union,unionErrors:a}),E}if(r.common.async)return Promise.all(n.map(async o=>{let a={...r,common:{...r.common,issues:[]},parent:null};return{result:await o._parseAsync({data:r.data,path:r.path,parent:a}),ctx:a}})).then(s);{let o,a=[];for(let c of n){let u={...r,common:{...r.common,issues:[]},parent:null},l=c._parseSync({data:r.data,path:r.path,parent:u});if(l.status==="valid")return l;l.status==="dirty"&&!o&&(o={result:l,ctx:u}),u.common.issues.length&&a.push(u.common.issues)}if(o)return r.common.issues.push(...o.ctx.common.issues),o.result;let i=a.map(c=>new Pe(c));return b(r,{code:g.invalid_union,unionErrors:i}),E}}get options(){return this._def.options}};Lt.create=(t,e)=>new Lt({options:t,typeName:_.ZodUnion,...I(e)});var rt=t=>t instanceof Ft?rt(t.schema):t instanceof qe?rt(t.innerType()):t instanceof Ht?[t.value]:t instanceof Kt?t.options:t instanceof Bt?Z.objectValues(t.enum):t instanceof Jt?rt(t._def.innerType):t instanceof Zt?[void 0]:t instanceof Vt?[null]:t instanceof Ce?[void 0,...rt(t.unwrap())]:t instanceof st?[null,...rt(t.unwrap())]:t instanceof En||t instanceof Wt?rt(t.unwrap()):t instanceof Gt?rt(t._def.innerType):[],Zs=class t extends C{_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==w.object)return b(r,{code:g.invalid_type,expected:w.object,received:r.parsedType}),E;let n=this.discriminator,s=r.data[n],o=this.optionsMap.get(s);return o?r.common.async?o._parseAsync({data:r.data,path:r.path,parent:r}):o._parseSync({data:r.data,path:r.path,parent:r}):(b(r,{code:g.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),E)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,r,n){let s=new Map;for(let o of r){let a=rt(o.shape[e]);if(!a.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(let i of a){if(s.has(i))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(i)}`);s.set(i,o)}}return new t({typeName:_.ZodDiscriminatedUnion,discriminator:e,options:r,optionsMap:s,...I(n)})}};function Vs(t,e){let r=tt(t),n=tt(e);if(t===e)return{valid:!0,data:t};if(r===w.object&&n===w.object){let s=Z.objectKeys(e),o=Z.objectKeys(t).filter(i=>s.indexOf(i)!==-1),a={...t,...e};for(let i of o){let c=Vs(t[i],e[i]);if(!c.valid)return{valid:!1};a[i]=c.data}return{valid:!0,data:a}}else if(r===w.array&&n===w.array){if(t.length!==e.length)return{valid:!1};let s=[];for(let o=0;o<t.length;o++){let a=t[o],i=e[o],c=Vs(a,i);if(!c.valid)return{valid:!1};s.push(c.data)}return{valid:!0,data:s}}else return r===w.date&&n===w.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}var Ut=class extends C{_parse(e){let{status:r,ctx:n}=this._processInputParams(e),s=(o,a)=>{if(Cs(o)||Cs(a))return E;let i=Vs(o.value,a.value);return i.valid?((qs(o)||qs(a))&&r.dirty(),{status:r.value,value:i.data}):(b(n,{code:g.invalid_intersection_types}),E)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([o,a])=>s(o,a)):s(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}};Ut.create=(t,e,r)=>new Ut({left:t,right:e,typeName:_.ZodIntersection,...I(r)});var nt=class t extends C{_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==w.array)return b(n,{code:g.invalid_type,expected:w.array,received:n.parsedType}),E;if(n.data.length<this._def.items.length)return b(n,{code:g.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),E;!this._def.rest&&n.data.length>this._def.items.length&&(b(n,{code:g.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());let o=[...n.data].map((a,i)=>{let c=this._def.items[i]||this._def.rest;return c?c._parse(new Ne(n,a,n.path,i)):null}).filter(a=>!!a);return n.common.async?Promise.all(o).then(a=>pe.mergeArray(r,a)):pe.mergeArray(r,o)}get items(){return this._def.items}rest(e){return new t({...this._def,rest:e})}};nt.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new nt({items:t,typeName:_.ZodTuple,rest:null,...I(e)})};var Ls=class t extends C{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==w.object)return b(n,{code:g.invalid_type,expected:w.object,received:n.parsedType}),E;let s=[],o=this._def.keyType,a=this._def.valueType;for(let i in n.data)s.push({key:o._parse(new Ne(n,i,n.path,i)),value:a._parse(new Ne(n,n.data[i],n.path,i)),alwaysSet:i in n.data});return n.common.async?pe.mergeObjectAsync(r,s):pe.mergeObjectSync(r,s)}get element(){return this._def.valueType}static create(e,r,n){return r instanceof C?new t({keyType:e,valueType:r,typeName:_.ZodRecord,...I(n)}):new t({keyType:Dt.create(),valueType:e,typeName:_.ZodRecord,...I(r)})}},Mr=class extends C{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==w.map)return b(n,{code:g.invalid_type,expected:w.map,received:n.parsedType}),E;let s=this._def.keyType,o=this._def.valueType,a=[...n.data.entries()].map(([i,c],u)=>({key:s._parse(new Ne(n,i,n.path,[u,"key"])),value:o._parse(new Ne(n,c,n.path,[u,"value"]))}));if(n.common.async){let i=new Map;return Promise.resolve().then(async()=>{for(let c of a){let u=await c.key,l=await c.value;if(u.status==="aborted"||l.status==="aborted")return E;(u.status==="dirty"||l.status==="dirty")&&r.dirty(),i.set(u.value,l.value)}return{status:r.value,value:i}})}else{let i=new Map;for(let c of a){let u=c.key,l=c.value;if(u.status==="aborted"||l.status==="aborted")return E;(u.status==="dirty"||l.status==="dirty")&&r.dirty(),i.set(u.value,l.value)}return{status:r.value,value:i}}}};Mr.create=(t,e,r)=>new Mr({valueType:e,keyType:t,typeName:_.ZodMap,...I(r)});var Ar=class t extends C{_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==w.set)return b(n,{code:g.invalid_type,expected:w.set,received:n.parsedType}),E;let s=this._def;s.minSize!==null&&n.data.size<s.minSize.value&&(b(n,{code:g.too_small,minimum:s.minSize.value,type:"set",inclusive:!0,exact:!1,message:s.minSize.message}),r.dirty()),s.maxSize!==null&&n.data.size>s.maxSize.value&&(b(n,{code:g.too_big,maximum:s.maxSize.value,type:"set",inclusive:!0,exact:!1,message:s.maxSize.message}),r.dirty());let o=this._def.valueType;function a(c){let u=new Set;for(let l of c){if(l.status==="aborted")return E;l.status==="dirty"&&r.dirty(),u.add(l.value)}return{status:r.value,value:u}}let i=[...n.data.values()].map((c,u)=>o._parse(new Ne(n,c,n.path,u)));return n.common.async?Promise.all(i).then(c=>a(c)):a(i)}min(e,r){return new t({...this._def,minSize:{value:e,message:S.toString(r)}})}max(e,r){return new t({...this._def,maxSize:{value:e,message:S.toString(r)}})}size(e,r){return this.min(e,r).max(e,r)}nonempty(e){return this.min(1,e)}};Ar.create=(t,e)=>new Ar({valueType:t,minSize:null,maxSize:null,typeName:_.ZodSet,...I(e)});var Us=class t extends C{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==w.function)return b(r,{code:g.invalid_type,expected:w.function,received:r.parsedType}),E;function n(i,c){return Pn({data:i,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,zr(),lt].filter(u=>!!u),issueData:{code:g.invalid_arguments,argumentsError:c}})}function s(i,c){return Pn({data:i,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,zr(),lt].filter(u=>!!u),issueData:{code:g.invalid_return_type,returnTypeError:c}})}let o={errorMap:r.common.contextualErrorMap},a=r.data;if(this._def.returns instanceof wt){let i=this;return _e(async function(...c){let u=new Pe([]),l=await i._def.args.parseAsync(c,o).catch(p=>{throw u.addIssue(n(c,p)),u}),d=await Reflect.apply(a,this,l);return await i._def.returns._def.type.parseAsync(d,o).catch(p=>{throw u.addIssue(s(d,p)),u})})}else{let i=this;return _e(function(...c){let u=i._def.args.safeParse(c,o);if(!u.success)throw new Pe([n(c,u.error)]);let l=Reflect.apply(a,this,u.data),d=i._def.returns.safeParse(l,o);if(!d.success)throw new Pe([s(l,d.error)]);return d.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new t({...this._def,args:nt.create(e).rest(dt.create())})}returns(e){return new t({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,r,n){return new t({args:e||nt.create([]).rest(dt.create()),returns:r||dt.create(),typeName:_.ZodFunction,...I(n)})}},Ft=class extends C{get schema(){return this._def.getter()}_parse(e){let{ctx:r}=this._processInputParams(e);return this._def.getter()._parse({data:r.data,path:r.path,parent:r})}};Ft.create=(t,e)=>new Ft({getter:t,typeName:_.ZodLazy,...I(e)});var Ht=class extends C{_parse(e){if(e.data!==this._def.value){let r=this._getOrReturnCtx(e);return b(r,{received:r.data,code:g.invalid_literal,expected:this._def.value}),E}return{status:"valid",value:e.data}}get value(){return this._def.value}};Ht.create=(t,e)=>new Ht({value:t,typeName:_.ZodLiteral,...I(e)});function zi(t,e){return new Kt({values:t,typeName:_.ZodEnum,...I(e)})}var Kt=class t extends C{_parse(e){if(typeof e.data!="string"){let r=this._getOrReturnCtx(e),n=this._def.values;return b(r,{expected:Z.joinValues(n),received:r.parsedType,code:g.invalid_type}),E}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){let r=this._getOrReturnCtx(e),n=this._def.values;return b(r,{received:r.data,code:g.invalid_enum_value,options:n}),E}return _e(e.data)}get options(){return this._def.values}get enum(){let e={};for(let r of this._def.values)e[r]=r;return e}get Values(){let e={};for(let r of this._def.values)e[r]=r;return e}get Enum(){let e={};for(let r of this._def.values)e[r]=r;return e}extract(e,r=this._def){return t.create(e,{...this._def,...r})}exclude(e,r=this._def){return t.create(this.options.filter(n=>!e.includes(n)),{...this._def,...r})}};Kt.create=zi;var Bt=class extends C{_parse(e){let r=Z.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==w.string&&n.parsedType!==w.number){let s=Z.objectValues(r);return b(n,{expected:Z.joinValues(s),received:n.parsedType,code:g.invalid_type}),E}if(this._cache||(this._cache=new Set(Z.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){let s=Z.objectValues(r);return b(n,{received:n.data,code:g.invalid_enum_value,options:s}),E}return _e(e.data)}get enum(){return this._def.values}};Bt.create=(t,e)=>new Bt({values:t,typeName:_.ZodNativeEnum,...I(e)});var wt=class extends C{unwrap(){return this._def.type}_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==w.promise&&r.common.async===!1)return b(r,{code:g.invalid_type,expected:w.promise,received:r.parsedType}),E;let n=r.parsedType===w.promise?r.data:Promise.resolve(r.data);return _e(n.then(s=>this._def.type.parseAsync(s,{path:r.path,errorMap:r.common.contextualErrorMap})))}};wt.create=(t,e)=>new wt({type:t,typeName:_.ZodPromise,...I(e)});var qe=class extends C{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===_.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:r,ctx:n}=this._processInputParams(e),s=this._def.effect||null,o={addIssue:a=>{b(n,a),a.fatal?r.abort():r.dirty()},get path(){return n.path}};if(o.addIssue=o.addIssue.bind(o),s.type==="preprocess"){let a=s.transform(n.data,o);if(n.common.async)return Promise.resolve(a).then(async i=>{if(r.value==="aborted")return E;let c=await this._def.schema._parseAsync({data:i,path:n.path,parent:n});return c.status==="aborted"?E:c.status==="dirty"?Ct(c.value):r.value==="dirty"?Ct(c.value):c});{if(r.value==="aborted")return E;let i=this._def.schema._parseSync({data:a,path:n.path,parent:n});return i.status==="aborted"?E:i.status==="dirty"?Ct(i.value):r.value==="dirty"?Ct(i.value):i}}if(s.type==="refinement"){let a=i=>{let c=s.refinement(i,o);if(n.common.async)return Promise.resolve(c);if(c instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return i};if(n.common.async===!1){let i=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return i.status==="aborted"?E:(i.status==="dirty"&&r.dirty(),a(i.value),{status:r.value,value:i.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(i=>i.status==="aborted"?E:(i.status==="dirty"&&r.dirty(),a(i.value).then(()=>({status:r.value,value:i.value}))))}if(s.type==="transform")if(n.common.async===!1){let a=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!xt(a))return E;let i=s.transform(a.value,o);if(i instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:i}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(a=>xt(a)?Promise.resolve(s.transform(a.value,o)).then(i=>({status:r.value,value:i})):E);Z.assertNever(s)}};qe.create=(t,e,r)=>new qe({schema:t,typeName:_.ZodEffects,effect:e,...I(r)});qe.createWithPreprocess=(t,e,r)=>new qe({schema:e,effect:{type:"preprocess",transform:t},typeName:_.ZodEffects,...I(r)});var Ce=class extends C{_parse(e){return this._getType(e)===w.undefined?_e(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};Ce.create=(t,e)=>new Ce({innerType:t,typeName:_.ZodOptional,...I(e)});var st=class extends C{_parse(e){return this._getType(e)===w.null?_e(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};st.create=(t,e)=>new st({innerType:t,typeName:_.ZodNullable,...I(e)});var Jt=class extends C{_parse(e){let{ctx:r}=this._processInputParams(e),n=r.data;return r.parsedType===w.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:r.path,parent:r})}removeDefault(){return this._def.innerType}};Jt.create=(t,e)=>new Jt({innerType:t,typeName:_.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...I(e)});var Gt=class extends C{_parse(e){let{ctx:r}=this._processInputParams(e),n={...r,common:{...r.common,issues:[]}},s=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return Tr(s)?s.then(o=>({status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new Pe(n.common.issues)},input:n.data})})):{status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new Pe(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}};Gt.create=(t,e)=>new Gt({innerType:t,typeName:_.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...I(e)});var Cr=class extends C{_parse(e){if(this._getType(e)!==w.nan){let n=this._getOrReturnCtx(e);return b(n,{code:g.invalid_type,expected:w.nan,received:n.parsedType}),E}return{status:"valid",value:e.data}}};Cr.create=t=>new Cr({typeName:_.ZodNaN,...I(t)});var En=class extends C{_parse(e){let{ctx:r}=this._processInputParams(e),n=r.data;return this._def.type._parse({data:n,path:r.path,parent:r})}unwrap(){return this._def.type}},Rn=class t extends C{_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.common.async)return(async()=>{let o=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return o.status==="aborted"?E:o.status==="dirty"?(r.dirty(),Ct(o.value)):this._def.out._parseAsync({data:o.value,path:n.path,parent:n})})();{let s=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return s.status==="aborted"?E:s.status==="dirty"?(r.dirty(),{status:"dirty",value:s.value}):this._def.out._parseSync({data:s.value,path:n.path,parent:n})}}static create(e,r){return new t({in:e,out:r,typeName:_.ZodPipeline})}},Wt=class extends C{_parse(e){let r=this._def.innerType._parse(e),n=s=>(xt(s)&&(s.value=Object.freeze(s.value)),s);return Tr(r)?r.then(s=>n(s)):n(r)}unwrap(){return this._def.innerType}};Wt.create=(t,e)=>new Wt({innerType:t,typeName:_.ZodReadonly,...I(e)});var g0={object:Ee.lazycreate},_;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(_||(_={}));var _0=Dt.create,v0=Pr.create,b0=Cr.create,$0=Er.create,x0=Rr.create,w0=Or.create,k0=Nr.create,S0=Zt.create,z0=Vt.create,T0=jr.create,P0=dt.create,E0=Be.create,R0=Ir.create,O0=ft.create,Ti=Ee.create,N0=Ee.strictCreate,j0=Lt.create,I0=Zs.create,M0=Ut.create,A0=nt.create,C0=Ls.create,q0=Mr.create,D0=Ar.create,Z0=Us.create,V0=Ft.create,L0=Ht.create,U0=Kt.create,F0=Bt.create,H0=wt.create,K0=qe.create,B0=Ce.create,J0=st.create,G0=qe.createWithPreprocess,W0=Rn.create;var vp=vs("ZodMiniType",(t,e)=>{if(!t._zod)throw new Error("Uninitialized schema in ZodMiniType.");Ya.init(t,e),t.def=e,t.type=e.type,t.parse=(r,n)=>bs(t,r,n,{callee:t.parse}),t.safeParse=(r,n)=>yr(t,r,n),t.parseAsync=async(r,n)=>$s(t,r,n,{callee:t.parseAsync}),t.safeParseAsync=async(r,n)=>gr(t,r,n),t.check=(...r)=>t.clone({...e,checks:[...e.checks??[],...r.map(n=>typeof n=="function"?{_zod:{check:n,def:{check:"custom"},onattach:[]}}:n)]},{parent:!0}),t.with=t.check,t.clone=(r,n)=>Wa(t,r,n),t.brand=()=>t,t.register=((r,n)=>(r.add(t,n),t)),t.apply=r=>r(t)});var bp=vs("ZodMiniObject",(t,e)=>{Xa.init(t,e),vp.init(t,e),Ga(t,"shape",()=>e.shape)});function Fs(t,e){let r={type:"object",shape:t??{},...Qa(e)};return new bp(r)}function Je(t){return!!t._zod}function xp(t){let e=Object.values(t);if(e.length===0)return Fs({});let r=e.every(Je),n=e.every(s=>!Je(s));if(r)return Fs(t);if(n)return Ti(t);throw new Error("Mixed Zod versions detected in object shape.")}function On(t,e){return Je(t)?yr(t,e):t.safeParse(e)}async function Ax(t,e){return Je(t)?await gr(t,e):await t.safeParseAsync(e)}function Pi(t){if(!t)return;let e;if(Je(t)?e=t._zod?.def?.shape:e=t.shape,!!e){if(typeof e=="function")try{return e()}catch{return}return e}}function Cx(t){if(t){if(typeof t=="object"){let e=t,r=t;if(!e._def&&!r._zod){let n=Object.values(t);if(n.length>0&&n.every(s=>typeof s=="object"&&s!==null&&(s._def!==void 0||s._zod!==void 0||typeof s.parse=="function")))return xp(t)}}if(Je(t)){let r=t._zod?.def;if(r&&(r.type==="object"||r.shape!==void 0))return t}else if(t.shape!==void 0)return t}}function qx(t){if(t&&typeof t=="object"){if("message"in t&&typeof t.message=="string")return t.message;if("issues"in t&&Array.isArray(t.issues)&&t.issues.length>0){let e=t.issues[0];if(e&&typeof e=="object"&&"message"in e)return String(e.message)}try{return JSON.stringify(t)}catch{return String(t)}}return String(t)}function Dx(t){return t.description}function Zx(t){if(Je(t))return t._zod?.def?.type==="optional";let e=t;return typeof t.isOptional=="function"?t.isOptional():e._def?.typeName==="ZodOptional"}function Ei(t){if(Je(t)){let o=t._zod?.def;if(o){if(o.value!==void 0)return o.value;if(Array.isArray(o.values)&&o.values.length>0)return o.values[0]}}let r=t._def;if(r){if(r.value!==void 0)return r.value;if(Array.isArray(r.values)&&r.values.length>0)return r.values[0]}let n=t.value;if(n!==void 0)return n}var Oi=Symbol("Let zodToJsonSchema decide on which parser to use");var Ri={name:void 0,$refStrategy:"root",basePath:["#"],effectStrategy:"input",pipeStrategy:"all",dateStrategy:"format:date-time",mapStrategy:"entries",removeAdditionalStrategy:"passthrough",allowedAdditionalProperties:!0,rejectedAdditionalProperties:!1,definitionPath:"definitions",target:"jsonSchema7",strictUnions:!1,definitions:{},errorMessages:!1,markdownDescription:!1,patternStrategy:"escape",applyRegexFlags:!1,emailStrategy:"format:email",base64Strategy:"contentEncoding:base64",nameStrategy:"ref",openAiAnyTypeName:"OpenAiAnyType"},Ni=t=>typeof t=="string"?{...Ri,name:t}:{...Ri,...t};var ji=t=>{let e=Ni(t),r=e.name!==void 0?[...e.basePath,e.definitionPath,e.name]:e.basePath;return{...e,flags:{hasReferencedOpenAiAnyType:!1},currentPath:r,propertyPath:void 0,seen:new Map(Object.entries(e.definitions).map(([n,s])=>[s._def,{def:s._def,path:[...e.basePath,e.definitionPath,n],jsonSchema:void 0}]))}};function Hs(t,e,r,n){n?.errorMessages&&r&&(t.errorMessage={...t.errorMessage,[e]:r})}function V(t,e,r,n,s){t[e]=r,Hs(t,e,n,s)}var Nn=(t,e)=>{let r=0;for(;r<t.length&&r<e.length&&t[r]===e[r];r++);return[(t.length-r).toString(),...e.slice(r)].join("/")};function ne(t){if(t.target!=="openAi")return{};let e=[...t.basePath,t.definitionPath,t.openAiAnyTypeName];return t.flags.hasReferencedOpenAiAnyType=!0,{$ref:t.$refStrategy==="relative"?Nn(e,t.currentPath):e.join("/")}}function Ii(t,e){let r={type:"array"};return t.type?._def&&t.type?._def?.typeName!==_.ZodAny&&(r.items=R(t.type._def,{...e,currentPath:[...e.currentPath,"items"]})),t.minLength&&V(r,"minItems",t.minLength.value,t.minLength.message,e),t.maxLength&&V(r,"maxItems",t.maxLength.value,t.maxLength.message,e),t.exactLength&&(V(r,"minItems",t.exactLength.value,t.exactLength.message,e),V(r,"maxItems",t.exactLength.value,t.exactLength.message,e)),r}function Mi(t,e){let r={type:"integer",format:"int64"};if(!t.checks)return r;for(let n of t.checks)switch(n.kind){case"min":e.target==="jsonSchema7"?n.inclusive?V(r,"minimum",n.value,n.message,e):V(r,"exclusiveMinimum",n.value,n.message,e):(n.inclusive||(r.exclusiveMinimum=!0),V(r,"minimum",n.value,n.message,e));break;case"max":e.target==="jsonSchema7"?n.inclusive?V(r,"maximum",n.value,n.message,e):V(r,"exclusiveMaximum",n.value,n.message,e):(n.inclusive||(r.exclusiveMaximum=!0),V(r,"maximum",n.value,n.message,e));break;case"multipleOf":V(r,"multipleOf",n.value,n.message,e);break}return r}function Ai(){return{type:"boolean"}}function jn(t,e){return R(t.type._def,e)}var Ci=(t,e)=>R(t.innerType._def,e);function Ks(t,e,r){let n=r??e.dateStrategy;if(Array.isArray(n))return{anyOf:n.map((s,o)=>Ks(t,e,s))};switch(n){case"string":case"format:date-time":return{type:"string",format:"date-time"};case"format:date":return{type:"string",format:"date"};case"integer":return wp(t,e)}}var wp=(t,e)=>{let r={type:"integer",format:"unix-time"};if(e.target==="openApi3")return r;for(let n of t.checks)switch(n.kind){case"min":V(r,"minimum",n.value,n.message,e);break;case"max":V(r,"maximum",n.value,n.message,e);break}return r};function qi(t,e){return{...R(t.innerType._def,e),default:t.defaultValue()}}function Di(t,e){return e.effectStrategy==="input"?R(t.schema._def,e):ne(e)}function Zi(t){return{type:"string",enum:Array.from(t.values)}}var kp=t=>"type"in t&&t.type==="string"?!1:"allOf"in t;function Vi(t,e){let r=[R(t.left._def,{...e,currentPath:[...e.currentPath,"allOf","0"]}),R(t.right._def,{...e,currentPath:[...e.currentPath,"allOf","1"]})].filter(o=>!!o),n=e.target==="jsonSchema2019-09"?{unevaluatedProperties:!1}:void 0,s=[];return r.forEach(o=>{if(kp(o))s.push(...o.allOf),o.unevaluatedProperties===void 0&&(n=void 0);else{let a=o;if("additionalProperties"in o&&o.additionalProperties===!1){let{additionalProperties:i,...c}=o;a=c}else n=void 0;s.push(a)}}),s.length?{allOf:s,...n}:void 0}function Li(t,e){let r=typeof t.value;return r!=="bigint"&&r!=="number"&&r!=="boolean"&&r!=="string"?{type:Array.isArray(t.value)?"array":"object"}:e.target==="openApi3"?{type:r==="bigint"?"integer":r,enum:[t.value]}:{type:r==="bigint"?"integer":r,const:t.value}}var Bs,De={cuid:/^[cC][^\s-]{8,}$/,cuid2:/^[0-9a-z]+$/,ulid:/^[0-9A-HJKMNP-TV-Z]{26}$/,email:/^(?!\.)(?!.*\.\.)([a-zA-Z0-9_'+\-\.]*)[a-zA-Z0-9_+-]@([a-zA-Z0-9][a-zA-Z0-9\-]*\.)+[a-zA-Z]{2,}$/,emoji:()=>(Bs===void 0&&(Bs=RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),Bs),uuid:/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/,ipv4:/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,ipv4Cidr:/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,ipv6:/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,ipv6Cidr:/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,base64:/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,base64url:/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,nanoid:/^[a-zA-Z0-9_-]{21}$/,jwt:/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/};function In(t,e){let r={type:"string"};if(t.checks)for(let n of t.checks)switch(n.kind){case"min":V(r,"minLength",typeof r.minLength=="number"?Math.max(r.minLength,n.value):n.value,n.message,e);break;case"max":V(r,"maxLength",typeof r.maxLength=="number"?Math.min(r.maxLength,n.value):n.value,n.message,e);break;case"email":switch(e.emailStrategy){case"format:email":Ze(r,"email",n.message,e);break;case"format:idn-email":Ze(r,"idn-email",n.message,e);break;case"pattern:zod":ve(r,De.email,n.message,e);break}break;case"url":Ze(r,"uri",n.message,e);break;case"uuid":Ze(r,"uuid",n.message,e);break;case"regex":ve(r,n.regex,n.message,e);break;case"cuid":ve(r,De.cuid,n.message,e);break;case"cuid2":ve(r,De.cuid2,n.message,e);break;case"startsWith":ve(r,RegExp(`^${Js(n.value,e)}`),n.message,e);break;case"endsWith":ve(r,RegExp(`${Js(n.value,e)}$`),n.message,e);break;case"datetime":Ze(r,"date-time",n.message,e);break;case"date":Ze(r,"date",n.message,e);break;case"time":Ze(r,"time",n.message,e);break;case"duration":Ze(r,"duration",n.message,e);break;case"length":V(r,"minLength",typeof r.minLength=="number"?Math.max(r.minLength,n.value):n.value,n.message,e),V(r,"maxLength",typeof r.maxLength=="number"?Math.min(r.maxLength,n.value):n.value,n.message,e);break;case"includes":{ve(r,RegExp(Js(n.value,e)),n.message,e);break}case"ip":{n.version!=="v6"&&Ze(r,"ipv4",n.message,e),n.version!=="v4"&&Ze(r,"ipv6",n.message,e);break}case"base64url":ve(r,De.base64url,n.message,e);break;case"jwt":ve(r,De.jwt,n.message,e);break;case"cidr":{n.version!=="v6"&&ve(r,De.ipv4Cidr,n.message,e),n.version!=="v4"&&ve(r,De.ipv6Cidr,n.message,e);break}case"emoji":ve(r,De.emoji(),n.message,e);break;case"ulid":{ve(r,De.ulid,n.message,e);break}case"base64":{switch(e.base64Strategy){case"format:binary":{Ze(r,"binary",n.message,e);break}case"contentEncoding:base64":{V(r,"contentEncoding","base64",n.message,e);break}case"pattern:zod":{ve(r,De.base64,n.message,e);break}}break}case"nanoid":ve(r,De.nanoid,n.message,e);case"toLowerCase":case"toUpperCase":case"trim":break;default:}return r}function Js(t,e){return e.patternStrategy==="escape"?zp(t):t}var Sp=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");function zp(t){let e="";for(let r=0;r<t.length;r++)Sp.has(t[r])||(e+="\\"),e+=t[r];return e}function Ze(t,e,r,n){t.format||t.anyOf?.some(s=>s.format)?(t.anyOf||(t.anyOf=[]),t.format&&(t.anyOf.push({format:t.format,...t.errorMessage&&n.errorMessages&&{errorMessage:{format:t.errorMessage.format}}}),delete t.format,t.errorMessage&&(delete t.errorMessage.format,Object.keys(t.errorMessage).length===0&&delete t.errorMessage)),t.anyOf.push({format:e,...r&&n.errorMessages&&{errorMessage:{format:r}}})):V(t,"format",e,r,n)}function ve(t,e,r,n){t.pattern||t.allOf?.some(s=>s.pattern)?(t.allOf||(t.allOf=[]),t.pattern&&(t.allOf.push({pattern:t.pattern,...t.errorMessage&&n.errorMessages&&{errorMessage:{pattern:t.errorMessage.pattern}}}),delete t.pattern,t.errorMessage&&(delete t.errorMessage.pattern,Object.keys(t.errorMessage).length===0&&delete t.errorMessage)),t.allOf.push({pattern:Ui(e,n),...r&&n.errorMessages&&{errorMessage:{pattern:r}}})):V(t,"pattern",Ui(e,n),r,n)}function Ui(t,e){if(!e.applyRegexFlags||!t.flags)return t.source;let r={i:t.flags.includes("i"),m:t.flags.includes("m"),s:t.flags.includes("s")},n=r.i?t.source.toLowerCase():t.source,s="",o=!1,a=!1,i=!1;for(let c=0;c<n.length;c++){if(o){s+=n[c],o=!1;continue}if(r.i){if(a){if(n[c].match(/[a-z]/)){i?(s+=n[c],s+=`${n[c-2]}-${n[c]}`.toUpperCase(),i=!1):n[c+1]==="-"&&n[c+2]?.match(/[a-z]/)?(s+=n[c],i=!0):s+=`${n[c]}${n[c].toUpperCase()}`;continue}}else if(n[c].match(/[a-z]/)){s+=`[${n[c]}${n[c].toUpperCase()}]`;continue}}if(r.m){if(n[c]==="^"){s+=`(^|(?<=[\r
|
|
12
|
-
]))`;continue}else if(n[c]==="$"){s+=`($|(?=[\r
|
|
13
|
-
]))`;continue}}if(r.s&&n[c]==="."){s+=a?`${n[c]}\r
|
|
14
|
-
`:`[${n[c]}\r
|
|
15
|
-
]`;continue}s+=n[c],n[c]==="\\"?o=!0:a&&n[c]==="]"?a=!1:!a&&n[c]==="["&&(a=!0)}try{new RegExp(s)}catch{return console.warn(`Could not convert regex pattern at ${e.currentPath.join("/")} to a flag-independent form! Falling back to the flag-ignorant source`),t.source}return s}function Mn(t,e){if(e.target==="openAi"&&console.warn("Warning: OpenAI may not support records in schemas! Try an array of key-value pairs instead."),e.target==="openApi3"&&t.keyType?._def.typeName===_.ZodEnum)return{type:"object",required:t.keyType._def.values,properties:t.keyType._def.values.reduce((n,s)=>({...n,[s]:R(t.valueType._def,{...e,currentPath:[...e.currentPath,"properties",s]})??ne(e)}),{}),additionalProperties:e.rejectedAdditionalProperties};let r={type:"object",additionalProperties:R(t.valueType._def,{...e,currentPath:[...e.currentPath,"additionalProperties"]})??e.allowedAdditionalProperties};if(e.target==="openApi3")return r;if(t.keyType?._def.typeName===_.ZodString&&t.keyType._def.checks?.length){let{type:n,...s}=In(t.keyType._def,e);return{...r,propertyNames:s}}else{if(t.keyType?._def.typeName===_.ZodEnum)return{...r,propertyNames:{enum:t.keyType._def.values}};if(t.keyType?._def.typeName===_.ZodBranded&&t.keyType._def.type._def.typeName===_.ZodString&&t.keyType._def.type._def.checks?.length){let{type:n,...s}=jn(t.keyType._def,e);return{...r,propertyNames:s}}}return r}function Fi(t,e){if(e.mapStrategy==="record")return Mn(t,e);let r=R(t.keyType._def,{...e,currentPath:[...e.currentPath,"items","items","0"]})||ne(e),n=R(t.valueType._def,{...e,currentPath:[...e.currentPath,"items","items","1"]})||ne(e);return{type:"array",maxItems:125,items:{type:"array",items:[r,n],minItems:2,maxItems:2}}}function Hi(t){let e=t.values,n=Object.keys(t.values).filter(o=>typeof e[e[o]]!="number").map(o=>e[o]),s=Array.from(new Set(n.map(o=>typeof o)));return{type:s.length===1?s[0]==="string"?"string":"number":["string","number"],enum:n}}function Ki(t){return t.target==="openAi"?void 0:{not:ne({...t,currentPath:[...t.currentPath,"not"]})}}function Bi(t){return t.target==="openApi3"?{enum:["null"],nullable:!0}:{type:"null"}}var qr={ZodString:"string",ZodNumber:"number",ZodBigInt:"integer",ZodBoolean:"boolean",ZodNull:"null"};function Gi(t,e){if(e.target==="openApi3")return Ji(t,e);let r=t.options instanceof Map?Array.from(t.options.values()):t.options;if(r.every(n=>n._def.typeName in qr&&(!n._def.checks||!n._def.checks.length))){let n=r.reduce((s,o)=>{let a=qr[o._def.typeName];return a&&!s.includes(a)?[...s,a]:s},[]);return{type:n.length>1?n:n[0]}}else if(r.every(n=>n._def.typeName==="ZodLiteral"&&!n.description)){let n=r.reduce((s,o)=>{let a=typeof o._def.value;switch(a){case"string":case"number":case"boolean":return[...s,a];case"bigint":return[...s,"integer"];case"object":if(o._def.value===null)return[...s,"null"];default:return s}},[]);if(n.length===r.length){let s=n.filter((o,a,i)=>i.indexOf(o)===a);return{type:s.length>1?s:s[0],enum:r.reduce((o,a)=>o.includes(a._def.value)?o:[...o,a._def.value],[])}}}else if(r.every(n=>n._def.typeName==="ZodEnum"))return{type:"string",enum:r.reduce((n,s)=>[...n,...s._def.values.filter(o=>!n.includes(o))],[])};return Ji(t,e)}var Ji=(t,e)=>{let r=(t.options instanceof Map?Array.from(t.options.values()):t.options).map((n,s)=>R(n._def,{...e,currentPath:[...e.currentPath,"anyOf",`${s}`]})).filter(n=>!!n&&(!e.strictUnions||typeof n=="object"&&Object.keys(n).length>0));return r.length?{anyOf:r}:void 0};function Wi(t,e){if(["ZodString","ZodNumber","ZodBigInt","ZodBoolean","ZodNull"].includes(t.innerType._def.typeName)&&(!t.innerType._def.checks||!t.innerType._def.checks.length))return e.target==="openApi3"?{type:qr[t.innerType._def.typeName],nullable:!0}:{type:[qr[t.innerType._def.typeName],"null"]};if(e.target==="openApi3"){let n=R(t.innerType._def,{...e,currentPath:[...e.currentPath]});return n&&"$ref"in n?{allOf:[n],nullable:!0}:n&&{...n,nullable:!0}}let r=R(t.innerType._def,{...e,currentPath:[...e.currentPath,"anyOf","0"]});return r&&{anyOf:[r,{type:"null"}]}}function Qi(t,e){let r={type:"number"};if(!t.checks)return r;for(let n of t.checks)switch(n.kind){case"int":r.type="integer",Hs(r,"type",n.message,e);break;case"min":e.target==="jsonSchema7"?n.inclusive?V(r,"minimum",n.value,n.message,e):V(r,"exclusiveMinimum",n.value,n.message,e):(n.inclusive||(r.exclusiveMinimum=!0),V(r,"minimum",n.value,n.message,e));break;case"max":e.target==="jsonSchema7"?n.inclusive?V(r,"maximum",n.value,n.message,e):V(r,"exclusiveMaximum",n.value,n.message,e):(n.inclusive||(r.exclusiveMaximum=!0),V(r,"maximum",n.value,n.message,e));break;case"multipleOf":V(r,"multipleOf",n.value,n.message,e);break}return r}function Yi(t,e){let r=e.target==="openAi",n={type:"object",properties:{}},s=[],o=t.shape();for(let i in o){let c=o[i];if(c===void 0||c._def===void 0)continue;let u=Pp(c);u&&r&&(c._def.typeName==="ZodOptional"&&(c=c._def.innerType),c.isNullable()||(c=c.nullable()),u=!1);let l=R(c._def,{...e,currentPath:[...e.currentPath,"properties",i],propertyPath:[...e.currentPath,"properties",i]});l!==void 0&&(n.properties[i]=l,u||s.push(i))}s.length&&(n.required=s);let a=Tp(t,e);return a!==void 0&&(n.additionalProperties=a),n}function Tp(t,e){if(t.catchall._def.typeName!=="ZodNever")return R(t.catchall._def,{...e,currentPath:[...e.currentPath,"additionalProperties"]});switch(t.unknownKeys){case"passthrough":return e.allowedAdditionalProperties;case"strict":return e.rejectedAdditionalProperties;case"strip":return e.removeAdditionalStrategy==="strict"?e.allowedAdditionalProperties:e.rejectedAdditionalProperties}}function Pp(t){try{return t.isOptional()}catch{return!0}}var Xi=(t,e)=>{if(e.currentPath.toString()===e.propertyPath?.toString())return R(t.innerType._def,e);let r=R(t.innerType._def,{...e,currentPath:[...e.currentPath,"anyOf","1"]});return r?{anyOf:[{not:ne(e)},r]}:ne(e)};var ec=(t,e)=>{if(e.pipeStrategy==="input")return R(t.in._def,e);if(e.pipeStrategy==="output")return R(t.out._def,e);let r=R(t.in._def,{...e,currentPath:[...e.currentPath,"allOf","0"]}),n=R(t.out._def,{...e,currentPath:[...e.currentPath,"allOf",r?"1":"0"]});return{allOf:[r,n].filter(s=>s!==void 0)}};function tc(t,e){return R(t.type._def,e)}function rc(t,e){let n={type:"array",uniqueItems:!0,items:R(t.valueType._def,{...e,currentPath:[...e.currentPath,"items"]})};return t.minSize&&V(n,"minItems",t.minSize.value,t.minSize.message,e),t.maxSize&&V(n,"maxItems",t.maxSize.value,t.maxSize.message,e),n}function nc(t,e){return t.rest?{type:"array",minItems:t.items.length,items:t.items.map((r,n)=>R(r._def,{...e,currentPath:[...e.currentPath,"items",`${n}`]})).reduce((r,n)=>n===void 0?r:[...r,n],[]),additionalItems:R(t.rest._def,{...e,currentPath:[...e.currentPath,"additionalItems"]})}:{type:"array",minItems:t.items.length,maxItems:t.items.length,items:t.items.map((r,n)=>R(r._def,{...e,currentPath:[...e.currentPath,"items",`${n}`]})).reduce((r,n)=>n===void 0?r:[...r,n],[])}}function sc(t){return{not:ne(t)}}function oc(t){return ne(t)}var ac=(t,e)=>R(t.innerType._def,e);var ic=(t,e,r)=>{switch(e){case _.ZodString:return In(t,r);case _.ZodNumber:return Qi(t,r);case _.ZodObject:return Yi(t,r);case _.ZodBigInt:return Mi(t,r);case _.ZodBoolean:return Ai();case _.ZodDate:return Ks(t,r);case _.ZodUndefined:return sc(r);case _.ZodNull:return Bi(r);case _.ZodArray:return Ii(t,r);case _.ZodUnion:case _.ZodDiscriminatedUnion:return Gi(t,r);case _.ZodIntersection:return Vi(t,r);case _.ZodTuple:return nc(t,r);case _.ZodRecord:return Mn(t,r);case _.ZodLiteral:return Li(t,r);case _.ZodEnum:return Zi(t);case _.ZodNativeEnum:return Hi(t);case _.ZodNullable:return Wi(t,r);case _.ZodOptional:return Xi(t,r);case _.ZodMap:return Fi(t,r);case _.ZodSet:return rc(t,r);case _.ZodLazy:return()=>t.getter()._def;case _.ZodPromise:return tc(t,r);case _.ZodNaN:case _.ZodNever:return Ki(r);case _.ZodEffects:return Di(t,r);case _.ZodAny:return ne(r);case _.ZodUnknown:return oc(r);case _.ZodDefault:return qi(t,r);case _.ZodBranded:return jn(t,r);case _.ZodReadonly:return ac(t,r);case _.ZodCatch:return Ci(t,r);case _.ZodPipeline:return ec(t,r);case _.ZodFunction:case _.ZodVoid:case _.ZodSymbol:return;default:return(n=>{})(e)}};function R(t,e,r=!1){let n=e.seen.get(t);if(e.override){let i=e.override?.(t,e,n,r);if(i!==Oi)return i}if(n&&!r){let i=Ep(n,e);if(i!==void 0)return i}let s={def:t,path:e.currentPath,jsonSchema:void 0};e.seen.set(t,s);let o=ic(t,t.typeName,e),a=typeof o=="function"?R(o(),e):o;if(a&&Rp(t,e,a),e.postProcess){let i=e.postProcess(a,t,e);return s.jsonSchema=a,i}return s.jsonSchema=a,a}var Ep=(t,e)=>{switch(e.$refStrategy){case"root":return{$ref:t.path.join("/")};case"relative":return{$ref:Nn(e.currentPath,t.path)};case"none":case"seen":return t.path.length<e.currentPath.length&&t.path.every((r,n)=>e.currentPath[n]===r)?(console.warn(`Recursive reference detected at ${e.currentPath.join("/")}! Defaulting to any`),ne(e)):e.$refStrategy==="seen"?ne(e):void 0}},Rp=(t,e,r)=>(t.description&&(r.description=t.description,e.markdownDescription&&(r.markdownDescription=t.description)),r);var Gs=(t,e)=>{let r=ji(e),n=typeof e=="object"&&e.definitions?Object.entries(e.definitions).reduce((c,[u,l])=>({...c,[u]:R(l._def,{...r,currentPath:[...r.basePath,r.definitionPath,u]},!0)??ne(r)}),{}):void 0,s=typeof e=="string"?e:e?.nameStrategy==="title"?void 0:e?.name,o=R(t._def,s===void 0?r:{...r,currentPath:[...r.basePath,r.definitionPath,s]},!1)??ne(r),a=typeof e=="object"&&e.name!==void 0&&e.nameStrategy==="title"?e.name:void 0;a!==void 0&&(o.title=a),r.flags.hasReferencedOpenAiAnyType&&(n||(n={}),n[r.openAiAnyTypeName]||(n[r.openAiAnyTypeName]={type:["string","number","integer","boolean","array","null"],items:{$ref:r.$refStrategy==="relative"?"1":[...r.basePath,r.definitionPath,r.openAiAnyTypeName].join("/")}}));let i=s===void 0?n?{...o,[r.definitionPath]:n}:o:{$ref:[...r.$refStrategy==="relative"?[]:r.basePath,r.definitionPath,s].join("/"),[r.definitionPath]:{...n,[s]:o}};return r.target==="jsonSchema7"?i.$schema="http://json-schema.org/draft-07/schema#":(r.target==="jsonSchema2019-09"||r.target==="openAi")&&(i.$schema="https://json-schema.org/draft/2019-09/schema#"),r.target==="openAi"&&("anyOf"in i||"oneOf"in i||"allOf"in i||"type"in i&&Array.isArray(i.type))&&console.warn("Warning: OpenAI may not support schemas with unions as roots! Try wrapping it in an object property."),i};function Op(t){return!t||t==="jsonSchema7"||t==="draft-7"?"draft-7":t==="jsonSchema2019-09"||t==="draft-2020-12"?"draft-2020-12":"draft-7"}function MS(t,e){return Je(t)?xs(t,{target:Op(e?.target),io:e?.pipeStrategy??"input"}):Gs(t,{strictUnions:e?.strictUnions??!0,pipeStrategy:e?.pipeStrategy??"input"})}function Ws(t){let r=Pi(t)?.method;if(!r)throw new Error("Schema is missing a method literal");let n=Ei(r);if(typeof n!="string")throw new Error("Schema method literal must be a string");return n}function Qs(t,e){let r=On(t,e);if(!r.success)throw r.error;return r.data}function pt(t){return t==="completed"||t==="failed"||t==="cancelled"}var Np=6e4,cc=class{constructor(e){this._options=e,this._requestMessageId=0,this._requestHandlers=new Map,this._requestHandlerAbortControllers=new Map,this._notificationHandlers=new Map,this._responseHandlers=new Map,this._progressHandlers=new Map,this._timeoutInfo=new Map,this._pendingDebouncedNotifications=new Set,this._taskProgressTokens=new Map,this._requestResolvers=new Map,this.setNotificationHandler(_n,r=>{this._oncancel(r)}),this.setNotificationHandler(bn,r=>{this._onprogress(r)}),this.setRequestHandler(vn,r=>({})),this._taskStore=e?.taskStore,this._taskMessageQueue=e?.taskMessageQueue,this._taskStore&&(this.setRequestHandler(xn,async(r,n)=>{let s=await this._taskStore.getTask(r.params.taskId,n.sessionId);if(!s)throw new F(W.InvalidParams,"Failed to retrieve task: Task not found");return{...s}}),this.setRequestHandler(kn,async(r,n)=>{let s=async()=>{let o=r.params.taskId;if(this._taskMessageQueue){let i;for(;i=await this._taskMessageQueue.dequeue(o,n.sessionId);){if(i.type==="response"||i.type==="error"){let c=i.message,u=c.id,l=this._requestResolvers.get(u);if(l)if(this._requestResolvers.delete(u),i.type==="response")l(c);else{let d=c,m=new F(d.error.code,d.error.message,d.error.data);l(m)}else{let d=i.type==="response"?"Response":"Error";this._onerror(new Error(`${d} handler missing for request ${u}`))}continue}await this._transport?.send(i.message,{relatedRequestId:n.requestId})}}let a=await this._taskStore.getTask(o,n.sessionId);if(!a)throw new F(W.InvalidParams,`Task not found: ${o}`);if(!pt(a.status))return await this._waitForTaskUpdate(o,n.signal),await s();if(pt(a.status)){let i=await this._taskStore.getTaskResult(o,n.sessionId);return this._clearTaskQueue(o),{...i,_meta:{...i._meta,[ut]:{taskId:o}}}}return await s()};return await s()}),this.setRequestHandler(Sn,async(r,n)=>{try{let{tasks:s,nextCursor:o}=await this._taskStore.listTasks(r.params?.cursor,n.sessionId);return{tasks:s,nextCursor:o,_meta:{}}}catch(s){throw new F(W.InvalidParams,`Failed to list tasks: ${s instanceof Error?s.message:String(s)}`)}}),this.setRequestHandler(Tn,async(r,n)=>{try{let s=await this._taskStore.getTask(r.params.taskId,n.sessionId);if(!s)throw new F(W.InvalidParams,`Task not found: ${r.params.taskId}`);if(pt(s.status))throw new F(W.InvalidParams,`Cannot cancel task in terminal status: ${s.status}`);await this._taskStore.updateTaskStatus(r.params.taskId,"cancelled","Client cancelled task execution.",n.sessionId),this._clearTaskQueue(r.params.taskId);let o=await this._taskStore.getTask(r.params.taskId,n.sessionId);if(!o)throw new F(W.InvalidParams,`Task not found after cancellation: ${r.params.taskId}`);return{_meta:{},...o}}catch(s){throw s instanceof F?s:new F(W.InvalidRequest,`Failed to cancel task: ${s instanceof Error?s.message:String(s)}`)}}))}async _oncancel(e){if(!e.params.requestId)return;this._requestHandlerAbortControllers.get(e.params.requestId)?.abort(e.params.reason)}_setupTimeout(e,r,n,s,o=!1){this._timeoutInfo.set(e,{timeoutId:setTimeout(s,r),startTime:Date.now(),timeout:r,maxTotalTimeout:n,resetTimeoutOnProgress:o,onTimeout:s})}_resetTimeout(e){let r=this._timeoutInfo.get(e);if(!r)return!1;let n=Date.now()-r.startTime;if(r.maxTotalTimeout&&n>=r.maxTotalTimeout)throw this._timeoutInfo.delete(e),F.fromError(W.RequestTimeout,"Maximum total timeout exceeded",{maxTotalTimeout:r.maxTotalTimeout,totalElapsed:n});return clearTimeout(r.timeoutId),r.timeoutId=setTimeout(r.onTimeout,r.timeout),!0}_cleanupTimeout(e){let r=this._timeoutInfo.get(e);r&&(clearTimeout(r.timeoutId),this._timeoutInfo.delete(e))}async connect(e){if(this._transport)throw new Error("Already connected to a transport. Call close() before connecting to a new transport, or use a separate Protocol instance per connection.");this._transport=e;let r=this.transport?.onclose;this._transport.onclose=()=>{r?.(),this._onclose()};let n=this.transport?.onerror;this._transport.onerror=o=>{n?.(o),this._onerror(o)};let s=this._transport?.onmessage;this._transport.onmessage=(o,a)=>{s?.(o,a),vr(o)||ui(o)?this._onresponse(o):Ps(o)?this._onrequest(o,a):ci(o)?this._onnotification(o):this._onerror(new Error(`Unknown message type: ${JSON.stringify(o)}`))},await this._transport.start()}_onclose(){let e=this._responseHandlers;this._responseHandlers=new Map,this._progressHandlers.clear(),this._taskProgressTokens.clear(),this._pendingDebouncedNotifications.clear();for(let n of this._timeoutInfo.values())clearTimeout(n.timeoutId);this._timeoutInfo.clear();for(let n of this._requestHandlerAbortControllers.values())n.abort();this._requestHandlerAbortControllers.clear();let r=F.fromError(W.ConnectionClosed,"Connection closed");this._transport=void 0,this.onclose?.();for(let n of e.values())n(r)}_onerror(e){this.onerror?.(e)}_onnotification(e){let r=this._notificationHandlers.get(e.method)??this.fallbackNotificationHandler;r!==void 0&&Promise.resolve().then(()=>r(e)).catch(n=>this._onerror(new Error(`Uncaught error in notification handler: ${n}`)))}_onrequest(e,r){let n=this._requestHandlers.get(e.method)??this.fallbackRequestHandler,s=this._transport,o=e.params?._meta?.[ut]?.taskId;if(n===void 0){let l={jsonrpc:"2.0",id:e.id,error:{code:W.MethodNotFound,message:"Method not found"}};o&&this._taskMessageQueue?this._enqueueTaskMessage(o,{type:"error",message:l,timestamp:Date.now()},s?.sessionId).catch(d=>this._onerror(new Error(`Failed to enqueue error response: ${d}`))):s?.send(l).catch(d=>this._onerror(new Error(`Failed to send an error response: ${d}`)));return}let a=new AbortController;this._requestHandlerAbortControllers.set(e.id,a);let i=oi(e.params)?e.params.task:void 0,c=this._taskStore?this.requestTaskStore(e,s?.sessionId):void 0,u={signal:a.signal,sessionId:s?.sessionId,_meta:e.params?._meta,sendNotification:async l=>{if(a.signal.aborted)return;let d={relatedRequestId:e.id};o&&(d.relatedTask={taskId:o}),await this.notification(l,d)},sendRequest:async(l,d,m)=>{if(a.signal.aborted)throw new F(W.ConnectionClosed,"Request was cancelled");let p={...m,relatedRequestId:e.id};o&&!p.relatedTask&&(p.relatedTask={taskId:o});let h=p.relatedTask?.taskId??o;return h&&c&&await c.updateTaskStatus(h,"input_required"),await this.request(l,d,p)},authInfo:r?.authInfo,requestId:e.id,requestInfo:r?.requestInfo,taskId:o,taskStore:c,taskRequestedTtl:i?.ttl,closeSSEStream:r?.closeSSEStream,closeStandaloneSSEStream:r?.closeStandaloneSSEStream};Promise.resolve().then(()=>{i&&this.assertTaskHandlerCapability(e.method)}).then(()=>n(e,u)).then(async l=>{if(a.signal.aborted)return;let d={result:l,jsonrpc:"2.0",id:e.id};o&&this._taskMessageQueue?await this._enqueueTaskMessage(o,{type:"response",message:d,timestamp:Date.now()},s?.sessionId):await s?.send(d)},async l=>{if(a.signal.aborted)return;let d={jsonrpc:"2.0",id:e.id,error:{code:Number.isSafeInteger(l.code)?l.code:W.InternalError,message:l.message??"Internal error",...l.data!==void 0&&{data:l.data}}};o&&this._taskMessageQueue?await this._enqueueTaskMessage(o,{type:"error",message:d,timestamp:Date.now()},s?.sessionId):await s?.send(d)}).catch(l=>this._onerror(new Error(`Failed to send response: ${l}`))).finally(()=>{this._requestHandlerAbortControllers.get(e.id)===a&&this._requestHandlerAbortControllers.delete(e.id)})}_onprogress(e){let{progressToken:r,...n}=e.params,s=Number(r),o=this._progressHandlers.get(s);if(!o){this._onerror(new Error(`Received a progress notification for an unknown token: ${JSON.stringify(e)}`));return}let a=this._responseHandlers.get(s),i=this._timeoutInfo.get(s);if(i&&a&&i.resetTimeoutOnProgress)try{this._resetTimeout(s)}catch(c){this._responseHandlers.delete(s),this._progressHandlers.delete(s),this._cleanupTimeout(s),a(c);return}o(n)}_onresponse(e){let r=Number(e.id),n=this._requestResolvers.get(r);if(n){if(this._requestResolvers.delete(r),vr(e))n(e);else{let a=new F(e.error.code,e.error.message,e.error.data);n(a)}return}let s=this._responseHandlers.get(r);if(s===void 0){this._onerror(new Error(`Received a response for an unknown message ID: ${JSON.stringify(e)}`));return}this._responseHandlers.delete(r),this._cleanupTimeout(r);let o=!1;if(vr(e)&&e.result&&typeof e.result=="object"){let a=e.result;if(a.task&&typeof a.task=="object"){let i=a.task;typeof i.taskId=="string"&&(o=!0,this._taskProgressTokens.set(i.taskId,r))}}if(o||this._progressHandlers.delete(r),vr(e))s(e);else{let a=F.fromError(e.error.code,e.error.message,e.error.data);s(a)}}get transport(){return this._transport}async close(){await this._transport?.close()}async*requestStream(e,r,n){let{task:s}=n??{};if(!s){try{yield{type:"result",result:await this.request(e,r,n)}}catch(a){yield{type:"error",error:a instanceof F?a:new F(W.InternalError,String(a))}}return}let o;try{let a=await this.request(e,$n,n);if(a.task)o=a.task.taskId,yield{type:"taskCreated",task:a.task};else throw new F(W.InternalError,"Task creation did not return a task");for(;;){let i=await this.getTask({taskId:o},n);if(yield{type:"taskStatus",task:i},pt(i.status)){i.status==="completed"?yield{type:"result",result:await this.getTaskResult({taskId:o},r,n)}:i.status==="failed"?yield{type:"error",error:new F(W.InternalError,`Task ${o} failed`)}:i.status==="cancelled"&&(yield{type:"error",error:new F(W.InternalError,`Task ${o} was cancelled`)});return}if(i.status==="input_required"){yield{type:"result",result:await this.getTaskResult({taskId:o},r,n)};return}let c=i.pollInterval??this._options?.defaultTaskPollInterval??1e3;await new Promise(u=>setTimeout(u,c)),n?.signal?.throwIfAborted()}}catch(a){yield{type:"error",error:a instanceof F?a:new F(W.InternalError,String(a))}}}request(e,r,n){let{relatedRequestId:s,resumptionToken:o,onresumptiontoken:a,task:i,relatedTask:c}=n??{};return new Promise((u,l)=>{let d=P=>{l(P)};if(!this._transport){d(new Error("Not connected"));return}if(this._options?.enforceStrictCapabilities===!0)try{this.assertCapabilityForMethod(e.method),i&&this.assertTaskCapability(e.method)}catch(P){d(P);return}n?.signal?.throwIfAborted();let m=this._requestMessageId++,p={...e,jsonrpc:"2.0",id:m};n?.onprogress&&(this._progressHandlers.set(m,n.onprogress),p.params={...e.params,_meta:{...e.params?._meta||{},progressToken:m}}),i&&(p.params={...p.params,task:i}),c&&(p.params={...p.params,_meta:{...p.params?._meta||{},[ut]:c}});let h=P=>{this._responseHandlers.delete(m),this._progressHandlers.delete(m),this._cleanupTimeout(m),this._transport?.send({jsonrpc:"2.0",method:"notifications/cancelled",params:{requestId:m,reason:String(P)}},{relatedRequestId:s,resumptionToken:o,onresumptiontoken:a}).catch(J=>this._onerror(new Error(`Failed to send cancellation: ${J}`)));let O=P instanceof F?P:new F(W.RequestTimeout,String(P));l(O)};this._responseHandlers.set(m,P=>{if(!n?.signal?.aborted){if(P instanceof Error)return l(P);try{let O=On(r,P.result);O.success?u(O.data):l(O.error)}catch(O){l(O)}}}),n?.signal?.addEventListener("abort",()=>{h(n?.signal?.reason)});let y=n?.timeout??Np,v=()=>h(F.fromError(W.RequestTimeout,"Request timed out",{timeout:y}));this._setupTimeout(m,y,n?.maxTotalTimeout,v,n?.resetTimeoutOnProgress??!1);let $=c?.taskId;if($){let P=O=>{let J=this._responseHandlers.get(m);J?J(O):this._onerror(new Error(`Response handler missing for side-channeled request ${m}`))};this._requestResolvers.set(m,P),this._enqueueTaskMessage($,{type:"request",message:p,timestamp:Date.now()}).catch(O=>{this._cleanupTimeout(m),l(O)})}else this._transport.send(p,{relatedRequestId:s,resumptionToken:o,onresumptiontoken:a}).catch(P=>{this._cleanupTimeout(m),l(P)})})}async getTask(e,r){return this.request({method:"tasks/get",params:e},wn,r)}async getTaskResult(e,r,n){return this.request({method:"tasks/result",params:e},r,n)}async listTasks(e,r){return this.request({method:"tasks/list",params:e},zn,r)}async cancelTask(e,r){return this.request({method:"tasks/cancel",params:e},mi,r)}async notification(e,r){if(!this._transport)throw new Error("Not connected");this.assertNotificationCapability(e.method);let n=r?.relatedTask?.taskId;if(n){let i={...e,jsonrpc:"2.0",params:{...e.params,_meta:{...e.params?._meta||{},[ut]:r.relatedTask}}};await this._enqueueTaskMessage(n,{type:"notification",message:i,timestamp:Date.now()});return}if((this._options?.debouncedNotificationMethods??[]).includes(e.method)&&!e.params&&!r?.relatedRequestId&&!r?.relatedTask){if(this._pendingDebouncedNotifications.has(e.method))return;this._pendingDebouncedNotifications.add(e.method),Promise.resolve().then(()=>{if(this._pendingDebouncedNotifications.delete(e.method),!this._transport)return;let i={...e,jsonrpc:"2.0"};r?.relatedTask&&(i={...i,params:{...i.params,_meta:{...i.params?._meta||{},[ut]:r.relatedTask}}}),this._transport?.send(i,r).catch(c=>this._onerror(c))});return}let a={...e,jsonrpc:"2.0"};r?.relatedTask&&(a={...a,params:{...a.params,_meta:{...a.params?._meta||{},[ut]:r.relatedTask}}}),await this._transport.send(a,r)}setRequestHandler(e,r){let n=Ws(e);this.assertRequestHandlerCapability(n),this._requestHandlers.set(n,(s,o)=>{let a=Qs(e,s);return Promise.resolve(r(a,o))})}removeRequestHandler(e){this._requestHandlers.delete(e)}assertCanSetRequestHandler(e){if(this._requestHandlers.has(e))throw new Error(`A request handler for ${e} already exists, which would be overridden`)}setNotificationHandler(e,r){let n=Ws(e);this._notificationHandlers.set(n,s=>{let o=Qs(e,s);return Promise.resolve(r(o))})}removeNotificationHandler(e){this._notificationHandlers.delete(e)}_cleanupTaskProgressHandler(e){let r=this._taskProgressTokens.get(e);r!==void 0&&(this._progressHandlers.delete(r),this._taskProgressTokens.delete(e))}async _enqueueTaskMessage(e,r,n){if(!this._taskStore||!this._taskMessageQueue)throw new Error("Cannot enqueue task message: taskStore and taskMessageQueue are not configured");let s=this._options?.maxTaskQueueSize;await this._taskMessageQueue.enqueue(e,r,n,s)}async _clearTaskQueue(e,r){if(this._taskMessageQueue){let n=await this._taskMessageQueue.dequeueAll(e,r);for(let s of n)if(s.type==="request"&&Ps(s.message)){let o=s.message.id,a=this._requestResolvers.get(o);a?(a(new F(W.InternalError,"Task cancelled or completed")),this._requestResolvers.delete(o)):this._onerror(new Error(`Resolver missing for request ${o} during task ${e} cleanup`))}}}async _waitForTaskUpdate(e,r){let n=this._options?.defaultTaskPollInterval??1e3;try{let s=await this._taskStore?.getTask(e);s?.pollInterval&&(n=s.pollInterval)}catch{}return new Promise((s,o)=>{if(r.aborted){o(new F(W.InvalidRequest,"Request cancelled"));return}let a=setTimeout(s,n);r.addEventListener("abort",()=>{clearTimeout(a),o(new F(W.InvalidRequest,"Request cancelled"))},{once:!0})})}requestTaskStore(e,r){let n=this._taskStore;if(!n)throw new Error("No task store configured");return{createTask:async s=>{if(!e)throw new Error("No request provided");return await n.createTask(s,e.id,{method:e.method,params:e.params},r)},getTask:async s=>{let o=await n.getTask(s,r);if(!o)throw new F(W.InvalidParams,"Failed to retrieve task: Task not found");return o},storeTaskResult:async(s,o,a)=>{await n.storeTaskResult(s,o,a,r);let i=await n.getTask(s,r);if(i){let c=kr.parse({method:"notifications/tasks/status",params:i});await this.notification(c),pt(i.status)&&this._cleanupTaskProgressHandler(s)}},getTaskResult:s=>n.getTaskResult(s,r),updateTaskStatus:async(s,o,a)=>{let i=await n.getTask(s,r);if(!i)throw new F(W.InvalidParams,`Task "${s}" not found - it may have been cleaned up`);if(pt(i.status))throw new F(W.InvalidParams,`Cannot update task "${s}" from terminal status "${i.status}" to "${o}". Terminal states (completed, failed, cancelled) cannot transition to other states.`);await n.updateTaskStatus(s,o,a,r);let c=await n.getTask(s,r);if(c){let u=kr.parse({method:"notifications/tasks/status",params:c});await this.notification(u),pt(c.status)&&this._cleanupTaskProgressHandler(s)}},listTasks:s=>n.listTasks(s,r)}}};function uc(t){return t!==null&&typeof t=="object"&&!Array.isArray(t)}function LS(t,e){let r={...t};for(let n in e){let s=n,o=e[s];if(o===void 0)continue;let a=r[s];uc(a)&&uc(o)?r[s]={...a,...o}:r[s]=o}return r}var td=Ja(qa(),1),rd=Ja(Xl(),1);function Mv(){let t=new td.default({strict:!1,validateFormats:!0,validateSchema:!1,allErrors:!0});return(0,rd.default)(t),t}var ed=class{constructor(e){this._ajv=e??Mv()}getValidator(e){let r="$id"in e&&typeof e.$id=="string"?this._ajv.getSchema(e.$id)??this._ajv.compile(e):this._ajv.compile(e);return n=>r(n)?{valid:!0,data:n,errorMessage:void 0}:{valid:!1,data:void 0,errorMessage:this._ajv.errorsText(r.errors)}}};function aT(t,e,r){if(!t)throw new Error(`${r} does not support task creation (required for ${e})`);switch(e){case"tools/call":if(!t.tools?.call)throw new Error(`${r} does not support task creation for tools/call (required for ${e})`);break;default:break}}function iT(t,e,r){if(!t)throw new Error(`${r} does not support task creation (required for ${e})`);switch(e){case"sampling/createMessage":if(!t.sampling?.createMessage)throw new Error(`${r} does not support task creation for sampling/createMessage (required for ${e})`);break;case"elicitation/create":if(!t.elicitation?.create)throw new Error(`${r} does not support task creation for elicitation/create (required for ${e})`);break;default:break}}var nd=class{append(e){this._buffer=this._buffer?Buffer.concat([this._buffer,e]):e}readMessage(){if(!this._buffer)return null;let e=this._buffer.indexOf(`
|
|
16
|
-
`);if(e===-1)return null;let r=this._buffer.toString("utf8",0,e).replace(/\r$/,"");return this._buffer=this._buffer.subarray(e+1),Av(r)}clear(){this._buffer=void 0}};function Av(t){return li.parse(JSON.parse(t))}function lT(t){return JSON.stringify(t)+`
|
|
17
|
-
`}export{Je as a,xp as b,On as c,Ax as d,Pi as e,Cx as f,qx as g,Dx as h,Zx as i,Ei as j,od as k,qv as l,Ps as m,vr as n,W as o,li as p,di as q,yd as r,_d as s,pi as t,Vv as u,$n as v,Sd as w,zd as x,Td as y,Pd as z,Rd as A,Od as B,Nd as C,Vd as D,Ld as E,Fd as F,Gd as G,Wd as H,Xd as I,ef as J,bi as K,rf as L,nf as M,Fv as N,$i as O,of as P,yf as Q,gf as R,_f as S,If as T,Cf as U,Vf as V,Hv as W,Kv as X,Lf as Y,Hf as Z,F as _,MS as $,cc as aa,LS as ba,ed as ca,aT as da,iT as ea,nd as fa,lT as ga};
|