@arcgis/ai-components 6.0.0-next.0 → 6.0.0-next.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (181) hide show
  1. package/dist/agent-utils/LLMAgent.d.ts +9 -2
  2. package/dist/agent-utils/LLMAgent.js +45 -36
  3. package/dist/agent-utils/tools/FunctionTool.d.ts +12 -1
  4. package/dist/agent-utils/tools/FunctionTool.js +15 -14
  5. package/dist/agent-utils/tools/MCPToolProvider.d.ts +54 -0
  6. package/dist/agent-utils/tools/MCPToolProvider.js +120 -0
  7. package/dist/agent-utils/tools/ToolProvider.d.ts +13 -0
  8. package/dist/agent-utils/tools/WebMCPToolProvider.d.ts +37 -0
  9. package/dist/agent-utils/tools/WebMCPToolProvider.js +71 -0
  10. package/dist/agents/tools/query/getAttribute/adapter.js +28 -24
  11. package/dist/agents/tools/query/getStatistics/adapter.js +70 -66
  12. package/dist/agents/tools/query/getTopFeatures/adapter.js +74 -70
  13. package/dist/agents/tools/query/queryFeatures/adapter.js +40 -36
  14. package/dist/cdn/{3HV6OXCZ.js → 24TK55FP.js} +1 -1
  15. package/dist/cdn/{4OLV5LA7.js → 2DWN3SKH.js} +1 -1
  16. package/dist/cdn/2O52MJ3D.js +2 -0
  17. package/dist/cdn/2UDDCWNW.js +2 -0
  18. package/dist/cdn/5FDBJI24.js +5 -0
  19. package/dist/cdn/5LA77ZBW.js +2 -0
  20. package/dist/cdn/{SBIYXWXZ.js → 5REENYPV.js} +1 -1
  21. package/dist/cdn/{V6AQFRUC.js → 5TW2NFES.js} +1 -1
  22. package/dist/cdn/{RBRHDEOB.js → 66VWTARH.js} +1 -1
  23. package/dist/cdn/6E6T6U7W.js +2 -0
  24. package/dist/cdn/{KKXOSV62.js → 6PK2UPG3.js} +1 -1
  25. package/dist/cdn/{OFM2S6U7.js → 6WYVG3JI.js} +1 -1
  26. package/dist/cdn/7HVIVV3O.js +2 -0
  27. package/dist/cdn/{U53SVXZK.js → 7MCFHVEH.js} +1 -1
  28. package/dist/cdn/{XI4BPYGB.js → 7X22QXJP.js} +1 -1
  29. package/dist/cdn/{EU6YSCZL.js → 7ZTYHZIN.js} +1 -1
  30. package/dist/cdn/A22375P3.js +2 -0
  31. package/dist/cdn/{2XXM52PS.js → AMP43OT2.js} +1 -1
  32. package/dist/cdn/{TTPTZBCM.js → AMURN3LO.js} +1 -1
  33. package/dist/cdn/AO2G4EXA.js +2 -0
  34. package/dist/cdn/{6GQCLDLJ.js → AQF6BBWC.js} +1 -1
  35. package/dist/cdn/AWPLRVPS.js +2 -0
  36. package/dist/cdn/{W3ZLMBEE.js → BBB5EJUB.js} +1 -1
  37. package/dist/cdn/{Q6PCXSZT.js → BMPBJXD7.js} +1 -1
  38. package/dist/cdn/{ZBRZU4XB.js → C67KQCPS.js} +1 -1
  39. package/dist/cdn/C76HLPKU.js +2 -0
  40. package/dist/cdn/{FFWPUYGD.js → CDS2HGQY.js} +1 -1
  41. package/dist/cdn/CHHC6YNW.js +2 -0
  42. package/dist/cdn/DBRBT54R.js +2 -0
  43. package/dist/cdn/{NN6MELJ7.js → DGCWQYN3.js} +1 -1
  44. package/dist/cdn/{IEAHAC6B.js → DI3VGUJY.js} +1 -1
  45. package/dist/cdn/{B4C7NIB5.js → DJG6DBCU.js} +2 -2
  46. package/dist/cdn/DJKEGIQZ.js +2 -0
  47. package/dist/cdn/{T2FKFOHE.js → DZOQFEOB.js} +1 -1
  48. package/dist/cdn/{AMFZY5QK.js → EEHDAYOG.js} +1 -1
  49. package/dist/cdn/{YO3L3XIH.js → EG5BMYZO.js} +1 -1
  50. package/dist/cdn/EGSD465U.js +2 -0
  51. package/dist/cdn/{ZMMUAYDN.js → EXLDRGUC.js} +1 -1
  52. package/dist/cdn/{WVMQ3I6F.js → FBARYPZ7.js} +1 -1
  53. package/dist/cdn/{M7TMD2HP.js → FJV7CI7O.js} +1 -1
  54. package/dist/cdn/{TRZJYWEB.js → FSLPYC4Y.js} +2 -2
  55. package/dist/cdn/{W6TS2TIE.js → GBFRJF4F.js} +1 -1
  56. package/dist/cdn/{7DRHB24Z.js → GHFOAS7T.js} +1 -1
  57. package/dist/cdn/HC5DJL2U.js +3 -0
  58. package/dist/cdn/HLWG7OIR.js +2 -0
  59. package/dist/cdn/{V7ERVXIO.js → HSMAXOOA.js} +1 -1
  60. package/dist/cdn/HWIM4KWF.js +2 -0
  61. package/dist/cdn/{VVWKEN53.js → JEWJ4M25.js} +1 -1
  62. package/dist/cdn/{I5OBL24F.js → JFL5IWPK.js} +1 -1
  63. package/dist/cdn/JUPTVXLY.js +2 -0
  64. package/dist/cdn/{B2JRBDJZ.js → JZPPP4QY.js} +1 -1
  65. package/dist/cdn/KKWCHNYQ.js +2 -0
  66. package/dist/cdn/{I7PHDOEQ.js → KX6CZEVZ.js} +1 -1
  67. package/dist/cdn/{XJUYG2M3.js → KY7M4WHO.js} +1 -1
  68. package/dist/cdn/L5IPMRHC.js +2 -0
  69. package/dist/cdn/M2G44RTS.js +2 -0
  70. package/dist/cdn/{H7WJUUJT.js → M6JQGHCE.js} +1 -1
  71. package/dist/cdn/MB7SEHPZ.js +2 -0
  72. package/dist/cdn/MC2V5WT3.js +2 -0
  73. package/dist/cdn/{ZBBI5M2X.js → MD2FTKQT.js} +1 -1
  74. package/dist/cdn/{645SDZBB.js → MPQ2OZXN.js} +1 -1
  75. package/dist/cdn/MZFWD5CQ.js +2 -0
  76. package/dist/cdn/{7OQA4GCM.js → NHWT7CXX.js} +1 -1
  77. package/dist/cdn/NMFEXE4D.js +2 -0
  78. package/dist/cdn/{MQSOVP27.js → NPV4MEAZ.js} +1 -1
  79. package/dist/cdn/{ENVTUTY6.js → OGZFST2A.js} +1 -1
  80. package/dist/cdn/P4CHI7W3.js +9 -0
  81. package/dist/cdn/{TPMZRJEC.js → PCAMBPOA.js} +1 -1
  82. package/dist/cdn/{O62IJLTZ.js → PGH7POKS.js} +1 -1
  83. package/dist/cdn/{37EJSNE3.js → PGUEODFA.js} +1 -1
  84. package/dist/cdn/{QJOO6IIX.js → QEGO4B2W.js} +1 -1
  85. package/dist/cdn/{FXRZCD5Y.js → QT3B5K4R.js} +1 -1
  86. package/dist/cdn/{2FUTKTNO.js → RE7MJTEF.js} +1 -1
  87. package/dist/cdn/RF6HWZMB.js +2 -0
  88. package/dist/cdn/{DWMZ23QK.js → RFDMNYTA.js} +1 -1
  89. package/dist/cdn/{OJP56R5R.js → RFPTOFM4.js} +1 -1
  90. package/dist/cdn/RKURZ5T2.js +2 -0
  91. package/dist/cdn/SJ4UMNIS.js +2 -0
  92. package/dist/cdn/{U3ZTF2BC.js → SWXUQFB6.js} +1 -1
  93. package/dist/cdn/{KJZVYKWL.js → T3SCINN5.js} +1 -1
  94. package/dist/cdn/{W3OJTTVX.js → TENUVOFJ.js} +1 -1
  95. package/dist/cdn/{UPSFL6U3.js → TJBU5BQK.js} +1 -1
  96. package/dist/cdn/UOKYHQNO.js +2 -0
  97. package/dist/cdn/UQRBY7ID.js +11 -0
  98. package/dist/cdn/{ZS5P7NRI.js → USPB2QBX.js} +1 -1
  99. package/dist/cdn/{ZKDCEL6K.js → UYP5PH5E.js} +1 -1
  100. package/dist/cdn/V6EX4YCY.js +2 -0
  101. package/dist/cdn/VA4M72JC.js +2 -0
  102. package/dist/cdn/VQ67NANV.js +2 -0
  103. package/dist/cdn/{2ZH5JNHL.js → X5ET73QZ.js} +1 -1
  104. package/dist/cdn/{DXCDVRGL.js → XC3T3Z5R.js} +1 -1
  105. package/dist/cdn/{J37GSI7C.js → XCLICBG7.js} +1 -1
  106. package/dist/cdn/XEJFVUNQ.js +2 -0
  107. package/dist/cdn/{EXIA3APU.js → XWNZMKQF.js} +1 -1
  108. package/dist/cdn/{UYEF3IKE.js → YBWRFVA6.js} +1 -1
  109. package/dist/cdn/YI6NIHNI.js +14 -0
  110. package/dist/cdn/{MHUEU6MR.js → YJXRCO4T.js} +1 -1
  111. package/dist/cdn/{2GSHUAQ2.js → YPLPDUMB.js} +1 -1
  112. package/dist/cdn/{YOQCQAKT.js → ZKWXHSEQ.js} +1 -1
  113. package/dist/cdn/{HWNPZ4CF.js → ZSLHB6MF.js} +1 -1
  114. package/dist/cdn/agent-utils/BaseAgent.js +1 -1
  115. package/dist/cdn/agent-utils/FunctionAgent.js +1 -1
  116. package/dist/cdn/agent-utils/LLMAgent.js +1 -1
  117. package/dist/cdn/agent-utils/SkillAgent.js +1 -1
  118. package/dist/cdn/agent-utils/WorkflowAgent.js +1 -1
  119. package/dist/cdn/agent-utils/createSchema.js +1 -1
  120. package/dist/cdn/agent-utils/middlewares/humanInTheLoop.js +1 -1
  121. package/dist/cdn/agent-utils/middlewares/middleware.js +1 -1
  122. package/dist/cdn/agent-utils/middlewares/trace.js +1 -1
  123. package/dist/cdn/agent-utils/tools/FunctionTool.js +1 -1
  124. package/dist/cdn/agent-utils/tools/MCPToolProvider.js +15 -0
  125. package/dist/cdn/agent-utils/tools/WebMCPToolProvider.js +2 -0
  126. package/dist/cdn/agent-utils/workflows/ConditionalWorkflow.js +1 -1
  127. package/dist/cdn/agent-utils/workflows/LoopWorkflow.js +1 -1
  128. package/dist/cdn/agent-utils/workflows/ParallelWorkflow.js +1 -1
  129. package/dist/cdn/agent-utils/workflows/RouterWorkflow.js +1 -1
  130. package/dist/cdn/agent-utils/workflows/SequentialWorkflow.js +1 -1
  131. package/dist/cdn/agent-utils/workflows/SwitchWorkflow.js +1 -1
  132. package/dist/cdn/index.js +1 -1
  133. package/dist/cdn/orchestrator/embeddings/getEmbeddings.js +1 -1
  134. package/dist/cdn/orchestrator/models/chatModel.js +1 -1
  135. package/dist/cdn/orchestrator/models/prompts.js +1 -1
  136. package/dist/cdn/orchestrator/state/runtime.js +1 -1
  137. package/dist/chunks/converterUtils.js +65 -109
  138. package/dist/chunks/resolveFieldNames.js +9 -0
  139. package/dist/components/arcgis-assistant-message-log/customElement.js +4 -5
  140. package/dist/components/arcgis-assistant-message-log/index.js +5 -0
  141. package/dist/components/arcgis-assistant-message-text/customElement.js +10 -11
  142. package/dist/components/arcgis-assistant-message-text/index.js +5 -0
  143. package/dist/components/arcgis-assistant-user-message/customElement.js +7 -8
  144. package/dist/components/arcgis-assistant-user-message/index.js +5 -0
  145. package/dist/docs/api.json +1 -1
  146. package/dist/docs/docs.json +1 -1
  147. package/package.json +8 -5
  148. package/dist/cdn/25CQLMB4.js +0 -2
  149. package/dist/cdn/34HKOU3T.js +0 -2
  150. package/dist/cdn/3WS4DSWD.js +0 -2
  151. package/dist/cdn/43OJZMBB.js +0 -2
  152. package/dist/cdn/4BRIOLDJ.js +0 -2
  153. package/dist/cdn/4ZPGFIE2.js +0 -2
  154. package/dist/cdn/6JCDY4FL.js +0 -2
  155. package/dist/cdn/7GQCNR4P.js +0 -11
  156. package/dist/cdn/A3KIOUWB.js +0 -2
  157. package/dist/cdn/BKKLQUK2.js +0 -2
  158. package/dist/cdn/DQRKGYR3.js +0 -2
  159. package/dist/cdn/EOSKJPQV.js +0 -2
  160. package/dist/cdn/F7VQ3WH2.js +0 -2
  161. package/dist/cdn/FBIPIDP7.js +0 -2
  162. package/dist/cdn/GOET2CH4.js +0 -2
  163. package/dist/cdn/ISDNOFHU.js +0 -3
  164. package/dist/cdn/JZS6ZSWH.js +0 -2
  165. package/dist/cdn/KEBMHD4R.js +0 -9
  166. package/dist/cdn/KPHHXMRK.js +0 -2
  167. package/dist/cdn/LVSIZRTB.js +0 -2
  168. package/dist/cdn/QQPVN5MG.js +0 -2
  169. package/dist/cdn/REE4K4J7.js +0 -2
  170. package/dist/cdn/RFKOCMMT.js +0 -2
  171. package/dist/cdn/RKHDRUX5.js +0 -2
  172. package/dist/cdn/TGI7QCB2.js +0 -2
  173. package/dist/cdn/UALF45Q2.js +0 -2
  174. package/dist/cdn/WB5AFS42.js +0 -2
  175. package/dist/cdn/WC6SHIEX.js +0 -2
  176. package/dist/cdn/XPSPAZUD.js +0 -2
  177. package/dist/cdn/YAUQJ6NV.js +0 -2
  178. package/dist/cdn/YD3DLETZ.js +0 -2
  179. package/dist/cdn/YKKIJTJY.js +0 -2
  180. package/dist/cdn/ZCNCYKXW.js +0 -14
  181. package/dist/cdn/ZESTW6HJ.js +0 -2
@@ -1,5 +1,5 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{a as ke,b as on,c as fr,d as cn,e as Za,f as La,g as un,j as ne,k as Fa,l as Va,m as ln,o as dn}from"./2XXM52PS.js";import{$ as Pa,$a as Ft,Ba as Ma,Ca as ja,Da,Ma as mi,Pa as kt,Ra as lr,U as Ca,V as an,Va as dr,Wa as za,Ya as oe,_ as wt,_a as le,a as L,aa as xt,ab as Z,bb as J,c as Ia,cb as de,f as Na,g as Lt,ia as ur,n as cr,ra as sn,t as bt,u as Ra}from"./2UKFCF2J.js";import{a as pi,b as hi,c as $a}from"./UZLQALHY.js";var ni=pi(Br=>{"use strict";Br.byteLength=Xc;Br.toByteArray=tu;Br.fromByteArray=au;var Ne=[],ye=[],Qc=typeof Uint8Array<"u"?Uint8Array:Array,pa="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(gt=0,ti=pa.length;gt<ti;++gt)Ne[gt]=pa[gt],ye[pa.charCodeAt(gt)]=gt;var gt,ti;ye[45]=62;ye[95]=63;function ri(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");r===-1&&(r=t);var n=r===t?0:4-r%4;return[r,n]}function Xc(e){var t=ri(e),r=t[0],n=t[1];return(r+n)*3/4-n}function eu(e,t,r){return(t+r)*3/4-r}function tu(e){var t,r=ri(e),n=r[0],a=r[1],s=new Qc(eu(e,n,a)),i=0,o=a>0?n-4:n,c;for(c=0;c<o;c+=4)t=ye[e.charCodeAt(c)]<<18|ye[e.charCodeAt(c+1)]<<12|ye[e.charCodeAt(c+2)]<<6|ye[e.charCodeAt(c+3)],s[i++]=t>>16&255,s[i++]=t>>8&255,s[i++]=t&255;return a===2&&(t=ye[e.charCodeAt(c)]<<2|ye[e.charCodeAt(c+1)]>>4,s[i++]=t&255),a===1&&(t=ye[e.charCodeAt(c)]<<10|ye[e.charCodeAt(c+1)]<<4|ye[e.charCodeAt(c+2)]>>2,s[i++]=t>>8&255,s[i++]=t&255),s}function ru(e){return Ne[e>>18&63]+Ne[e>>12&63]+Ne[e>>6&63]+Ne[e&63]}function nu(e,t,r){for(var n,a=[],s=t;s<r;s+=3)n=(e[s]<<16&16711680)+(e[s+1]<<8&65280)+(e[s+2]&255),a.push(ru(n));return a.join("")}function au(e){for(var t,r=e.length,n=r%3,a=[],s=16383,i=0,o=r-n;i<o;i+=s)a.push(nu(e,i,i+s>o?o:i+s));return n===1?(t=e[r-1],a.push(Ne[t>>2]+Ne[t<<4&63]+"==")):n===2&&(t=(e[r-2]<<8)+e[r-1],a.push(Ne[t>>10]+Ne[t>>4&63]+Ne[t<<2&63]+"=")),a.join("")}});async function ge(e,t){if(t===void 0)return e;let r;return Promise.race([e.catch(n=>{if(!t?.aborted)throw n}),new Promise((n,a)=>{r=()=>{a(ze(t))},t.addEventListener("abort",r,{once:!0}),t.aborted&&a(ze(t))})]).finally(()=>t.removeEventListener("abort",r))}function ze(e){return e?.reason instanceof Error?e.reason:typeof e?.reason=="string"?new Error(e.reason):new Error("Aborted")}function W(e){if(typeof e!="object"||e===null)return!1;let t=e;if(!("_zod"in t))return!1;let r=t._zod;return typeof r=="object"&&r!==null&&"def"in r}function G(e){if(typeof e!="object"||e===null)return!1;let t=e;if(!("_def"in t)||"_zod"in t)return!1;let r=t._def;return typeof r=="object"&&r!=null&&"typeName"in r}function Tu(e){return W(e)&&console.warn("[WARNING] Attempting to use Zod 4 schema in a context where Zod 3 schema is expected. This may cause unexpected behavior."),G(e)}function Tt(e){return!e||typeof e!="object"||Array.isArray(e)?!1:!!(W(e)||G(e))}function yi(e){return typeof e=="object"&&e!==null&&"_def"in e&&typeof e._def=="object"&&e._def!==null&&"typeName"in e._def&&e._def.typeName==="ZodLiteral"}function gi(e){return W(e)?typeof e=="object"&&e!==null&&"_zod"in e&&typeof e._zod=="object"&&e._zod!==null&&"def"in e._zod&&typeof e._zod.def=="object"&&e._zod.def!==null&&"type"in e._zod.def&&e._zod.def.type==="literal":!1}function Au(e){return!!(yi(e)||gi(e))}async function Su(e,t){if(W(e))try{return{success:!0,data:await cn(e,t)}}catch(r){return{success:!1,error:r}}if(G(e))return await e.safeParseAsync(t);throw new Error("Schema must be an instance of z3.ZodType or z4.$ZodType")}async function hr(e,t){if(W(e))return await cn(e,t);if(G(e))return await e.parseAsync(t);throw new Error("Schema must be an instance of z3.ZodType or z4.$ZodType")}function Eu(e,t){if(W(e))try{return{success:!0,data:fr(e,t)}}catch(r){return{success:!1,error:r}}if(G(e))return e.safeParse(t);throw new Error("Schema must be an instance of z3.ZodType or z4.$ZodType")}function Ou(e,t){if(W(e))return fr(e,t);if(G(e))return e.parse(t);throw new Error("Schema must be an instance of z3.ZodType or z4.$ZodType")}function Wa(e){if(W(e))return ne.get(e)?.description;if(G(e)||"description"in e&&typeof e.description=="string")return e.description}function $u(e){if(!Tt(e))return!1;if(G(e)){let t=e._def;if(t.typeName==="ZodObject"){let r=e;return!r.shape||Object.keys(r.shape).length===0}if(t.typeName==="ZodRecord")return!0}if(W(e)){let t=e._zod.def;if(t.type==="object"){let r=e;return!r.shape||Object.keys(r.shape).length===0}if(t.type==="record")return!0}return typeof e=="object"&&e!==null&&!("shape"in e)}function mr(e){return Tt(e)?G(e)?e._def.typeName==="ZodString":W(e)?e._zod.def.type==="string":!1:!1}function fn(e){return typeof e=="object"&&e!==null&&"_def"in e&&typeof e._def=="object"&&e._def!==null&&"typeName"in e._def&&e._def.typeName==="ZodObject"}function Te(e){return W(e)?typeof e=="object"&&e!==null&&"_zod"in e&&typeof e._zod=="object"&&e._zod!==null&&"def"in e._zod&&typeof e._zod.def=="object"&&e._zod.def!==null&&"type"in e._zod.def&&e._zod.def.type==="object":!1}function pn(e){return W(e)?typeof e=="object"&&e!==null&&"_zod"in e&&typeof e._zod=="object"&&e._zod!==null&&"def"in e._zod&&typeof e._zod.def=="object"&&e._zod.def!==null&&"type"in e._zod.def&&e._zod.def.type==="array":!1}function _i(e){return W(e)?typeof e=="object"&&e!==null&&"_zod"in e&&typeof e._zod=="object"&&e._zod!==null&&"def"in e._zod&&typeof e._zod.def=="object"&&e._zod.def!==null&&"type"in e._zod.def&&e._zod.def.type==="optional":!1}function vi(e){return W(e)?typeof e=="object"&&e!==null&&"_zod"in e&&typeof e._zod=="object"&&e._zod!==null&&"def"in e._zod&&typeof e._zod.def=="object"&&e._zod.def!==null&&"type"in e._zod.def&&e._zod.def.type==="nullable":!1}function Iu(e){return!!(fn(e)||Te(e))}function Ua(e){if(G(e))return e.shape;if(W(e))return e._zod.def.shape;throw new Error("Schema must be an instance of z3.ZodObject or z4.$ZodObject")}function Nu(e,t){if(G(e))return e.extend(t);if(W(e))return on.extend(e,t);throw new Error("Schema must be an instance of z3.ZodObject or z4.$ZodObject")}function Ru(e){if(G(e))return e.partial();if(W(e))return on.partial(un,e,void 0);throw new Error("Schema must be an instance of z3.ZodObject or z4.$ZodObject")}function pr(e,t=!1){if(fn(e))return e.strict();if(Te(e)){let r=e._zod.def.shape;if(t)for(let[s,i]of Object.entries(e._zod.def.shape)){if(Te(i))r[s]=pr(i,t);else if(pn(i)){let c=i._zod.def.element;Te(c)&&(c=pr(c,t)),r[s]=ke(i,{...i._zod.def,element:c})}else r[s]=i;let o=ne.get(i);o&&ne.add(r[s],o)}let n=ke(e,{...e._zod.def,shape:r,catchall:Va(La)}),a=ne.get(e);return a&&ne.add(n,a),n}throw new Error("Schema must be an instance of z3.ZodObject or z4.$ZodObject")}function Ba(e,t=!1){if(fn(e))return e.passthrough();if(Te(e)){let r=e._zod.def.shape;if(t)for(let[s,i]of Object.entries(e._zod.def.shape)){if(Te(i))r[s]=Ba(i,t);else if(pn(i)){let c=i._zod.def.element;Te(c)&&(c=Ba(c,t)),r[s]=ke(i,{...i._zod.def,element:c})}else r[s]=i;let o=ne.get(i);o&&ne.add(r[s],o)}let n=ke(e,{...e._zod.def,shape:r,catchall:Fa(Za)}),a=ne.get(e);return a&&ne.add(n,a),n}throw new Error("Schema must be an instance of z3.ZodObject or z4.$ZodObject")}function Cu(e){if(G(e))try{let t=e.parse(void 0);return()=>t}catch{return}if(W(e))try{let t=fr(e,void 0);return()=>t}catch{return}}function bi(e){return G(e)&&"typeName"in e._def&&e._def.typeName==="ZodEffects"}function wi(e){return W(e)&&e._zod.def.type==="pipe"}function Ke(e,t,r){let n=r.get(e);if(n!==void 0)return n;if(G(e))return bi(e)?Ke(e._def.schema,t,r):e;if(W(e)){let a=e;if(wi(e)&&(a=Ke(e._zod.def.in,t,r)),t){if(Te(a)){let i={};for(let[o,c]of Object.entries(a._zod.def.shape))i[o]=Ke(c,t,r);a=ke(a,{...a._zod.def,shape:i})}else if(pn(a)){let i=Ke(a._zod.def.element,t,r);a=ke(a,{...a._zod.def,element:i})}else if(_i(a)){let i=Ke(a._zod.def.innerType,t,r);a=ke(a,{...a._zod.def,innerType:i})}else if(vi(a)){let i=Ke(a._zod.def.innerType,t,r);a=ke(a,{...a._zod.def,innerType:i})}}let s=ne.get(e);return s&&ne.add(a,s),r.set(e,a),a}throw new Error("Schema must be an instance of z3.ZodType or z4.$ZodType")}function qa(e,t=!1){return Ke(e,t,new WeakMap)}function Pu(e,t){if(G(e)){let r=Ua(e),n={};for(let[a,s]of Object.entries(r))t(a,s)?n[a]=s.optional():n[a]=s;return e.extend(n)}if(W(e)){let r=Ua(e),n={...e._zod.def.shape};for(let[i,o]of Object.entries(r))t(i,o)&&(n[i]=new un({type:"optional",innerType:o}));let a=ke(e,{...e._zod.def,shape:n}),s=ne.get(e);return s&&ne.add(a,s),a}throw new Error("Schema must be an instance of z3.ZodObject or z4.$ZodObject")}function Ja(e){return e instanceof Error&&(e.constructor.name==="ZodError"||e.constructor.name==="$ZodError")}var mn=Symbol("Let zodToJsonSchema decide on which parser to use"),hn={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"},yn=e=>typeof e=="string"?{...hn,name:e}:{...hn,...e};var gn=e=>{let t=yn(e),r=t.name!==void 0?[...t.basePath,t.definitionPath,t.name]:t.basePath;return{...t,flags:{hasReferencedOpenAiAnyType:!1},currentPath:r,propertyPath:void 0,seen:new Map(Object.entries(t.definitions).map(([n,a])=>[a._def,{def:a._def,path:[...t.basePath,t.definitionPath,n],jsonSchema:void 0}]))}};var Vt=(e,t)=>{let r=0;for(;r<e.length&&r<t.length&&e[r]===t[r];r++);return[(e.length-r).toString(),...t.slice(r)].join("/")};function V(e){if(e.target!=="openAi")return{};let t=[...e.basePath,e.definitionPath,e.openAiAnyTypeName];return e.flags.hasReferencedOpenAiAnyType=!0,{$ref:e.$refStrategy==="relative"?Vt(t,e.currentPath):t.join("/")}}function yr(e,t,r,n){n?.errorMessages&&r&&(e.errorMessage={...e.errorMessage,[t]:r})}function D(e,t,r,n,a){e[t]=r,yr(e,t,n,a)}var Oe={};hi(Oe,{BRAND:()=>Ji,DIRTY:()=>Ye,EMPTY_PATH:()=>Ai,INVALID:()=>A,NEVER:()=>Ro,OK:()=>X,ParseStatus:()=>Q,Schema:()=>P,ZodAny:()=>Fe,ZodArray:()=>je,ZodBigInt:()=>Xe,ZodBoolean:()=>et,ZodBranded:()=>Bt,ZodCatch:()=>dt,ZodDate:()=>tt,ZodDefault:()=>lt,ZodDiscriminatedUnion:()=>vr,ZodEffects:()=>he,ZodEnum:()=>ct,ZodError:()=>ae,ZodFirstPartyTypeKind:()=>h,ZodFunction:()=>wr,ZodIntersection:()=>st,ZodIssueCode:()=>p,ZodLazy:()=>it,ZodLiteral:()=>ot,ZodMap:()=>It,ZodNaN:()=>Rt,ZodNativeEnum:()=>ut,ZodNever:()=>_e,ZodNull:()=>nt,ZodNullable:()=>Ee,ZodNumber:()=>Qe,ZodObject:()=>se,ZodOptional:()=>fe,ZodParsedType:()=>_,ZodPipeline:()=>Wt,ZodPromise:()=>Ve,ZodReadonly:()=>ft,ZodRecord:()=>br,ZodSchema:()=>P,ZodSet:()=>Nt,ZodString:()=>Le,ZodSymbol:()=>Ot,ZodTransformer:()=>he,ZodTuple:()=>Se,ZodType:()=>P,ZodUndefined:()=>rt,ZodUnion:()=>at,ZodUnknown:()=>Me,ZodVoid:()=>$t,addIssueToContext:()=>m,any:()=>ro,array:()=>io,bigint:()=>Yi,boolean:()=>as,coerce:()=>No,custom:()=>ts,date:()=>Qi,datetimeRegex:()=>Xa,defaultErrorMap:()=>Ce,discriminatedUnion:()=>lo,effect:()=>ko,enum:()=>bo,function:()=>go,getErrorMap:()=>At,getParsedType:()=>Ae,instanceof:()=>Hi,intersection:()=>fo,isAborted:()=>gr,isAsync:()=>St,isDirty:()=>_r,isValid:()=>Ze,late:()=>Gi,lazy:()=>_o,literal:()=>vo,makeIssue:()=>Ut,map:()=>mo,nan:()=>Ki,nativeEnum:()=>wo,never:()=>ao,null:()=>to,nullable:()=>Ao,number:()=>ns,object:()=>oo,objectUtil:()=>_n,oboolean:()=>Io,onumber:()=>$o,optional:()=>To,ostring:()=>Oo,pipeline:()=>Eo,preprocess:()=>So,promise:()=>xo,quotelessJson:()=>xi,record:()=>ho,set:()=>yo,setErrorMap:()=>Ti,strictObject:()=>co,string:()=>rs,symbol:()=>Xi,transformer:()=>ko,tuple:()=>po,undefined:()=>eo,union:()=>uo,unknown:()=>no,util:()=>j,void:()=>so});var j;(function(e){e.assertEqual=a=>{};function t(a){}e.assertIs=t;function r(a){throw new Error}e.assertNever=r,e.arrayToEnum=a=>{let s={};for(let i of a)s[i]=i;return s},e.getValidEnumValues=a=>{let s=e.objectKeys(a).filter(o=>typeof a[a[o]]!="number"),i={};for(let o of s)i[o]=a[o];return e.objectValues(i)},e.objectValues=a=>e.objectKeys(a).map(function(s){return a[s]}),e.objectKeys=typeof Object.keys=="function"?a=>Object.keys(a):a=>{let s=[];for(let i in a)Object.prototype.hasOwnProperty.call(a,i)&&s.push(i);return s},e.find=(a,s)=>{for(let i of a)if(s(i))return i},e.isInteger=typeof Number.isInteger=="function"?a=>Number.isInteger(a):a=>typeof a=="number"&&Number.isFinite(a)&&Math.floor(a)===a;function n(a,s=" | "){return a.map(i=>typeof i=="string"?`'${i}'`:i).join(s)}e.joinValues=n,e.jsonStringifyReplacer=(a,s)=>typeof s=="bigint"?s.toString():s})(j||(j={}));var _n;(function(e){e.mergeShapes=(t,r)=>({...t,...r})})(_n||(_n={}));var _=j.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Ae=e=>{switch(typeof e){case"undefined":return _.undefined;case"string":return _.string;case"number":return Number.isNaN(e)?_.nan:_.number;case"boolean":return _.boolean;case"function":return _.function;case"bigint":return _.bigint;case"symbol":return _.symbol;case"object":return Array.isArray(e)?_.array:e===null?_.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?_.promise:typeof Map<"u"&&e instanceof Map?_.map:typeof Set<"u"&&e instanceof Set?_.set:typeof Date<"u"&&e instanceof Date?_.date:_.object;default:return _.unknown}};var p=j.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"]),xi=e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:"),ae=class e extends Error{get errors(){return this.issues}constructor(t){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=t}format(t){let r=t||function(s){return s.message},n={_errors:[]},a=s=>{for(let i of s.issues)if(i.code==="invalid_union")i.unionErrors.map(a);else if(i.code==="invalid_return_type")a(i.returnTypeError);else if(i.code==="invalid_arguments")a(i.argumentsError);else if(i.path.length===0)n._errors.push(r(i));else{let o=n,c=0;for(;c<i.path.length;){let u=i.path[c];c===i.path.length-1?(o[u]=o[u]||{_errors:[]},o[u]._errors.push(r(i))):o[u]=o[u]||{_errors:[]},o=o[u],c++}}};return a(this),n}static assert(t){if(!(t instanceof e))throw new Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,j.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=r=>r.message){let r=Object.create(null),n=[];for(let a of this.issues)if(a.path.length>0){let s=a.path[0];r[s]=r[s]||[],r[s].push(t(a))}else n.push(t(a));return{formErrors:n,fieldErrors:r}}get formErrors(){return this.flatten()}};ae.create=e=>new ae(e);var ki=(e,t)=>{let r;switch(e.code){case p.invalid_type:e.received===_.undefined?r="Required":r=`Expected ${e.expected}, received ${e.received}`;break;case p.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(e.expected,j.jsonStringifyReplacer)}`;break;case p.unrecognized_keys:r=`Unrecognized key(s) in object: ${j.joinValues(e.keys,", ")}`;break;case p.invalid_union:r="Invalid input";break;case p.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${j.joinValues(e.options)}`;break;case p.invalid_enum_value:r=`Invalid enum value. Expected ${j.joinValues(e.options)}, received '${e.received}'`;break;case p.invalid_arguments:r="Invalid function arguments";break;case p.invalid_return_type:r="Invalid function return type";break;case p.invalid_date:r="Invalid date";break;case p.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(r=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(r=`${r} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?r=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?r=`Invalid input: must end with "${e.validation.endsWith}"`:j.assertNever(e.validation):e.validation!=="regex"?r=`Invalid ${e.validation}`:r="Invalid";break;case p.too_small:e.type==="array"?r=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?r=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?r=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="bigint"?r=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?r=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:r="Invalid input";break;case p.too_big:e.type==="array"?r=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?r=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?r=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?r=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?r=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:r="Invalid input";break;case p.custom:r="Invalid input";break;case p.invalid_intersection_types:r="Intersection results could not be merged";break;case p.not_multiple_of:r=`Number must be a multiple of ${e.multipleOf}`;break;case p.not_finite:r="Number must be finite";break;default:r=t.defaultError,j.assertNever(e)}return{message:r}},Ce=ki;var Ga=Ce;function Ti(e){Ga=e}function At(){return Ga}var Ut=e=>{let{data:t,path:r,errorMaps:n,issueData:a}=e,s=[...r,...a.path||[]],i={...a,path:s};if(a.message!==void 0)return{...a,path:s,message:a.message};let o="",c=n.filter(u=>!!u).slice().reverse();for(let u of c)o=u(i,{data:t,defaultError:o}).message;return{...a,path:s,message:o}},Ai=[];function m(e,t){let r=At(),n=Ut({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,r,r===Ce?void 0:Ce].filter(a=>!!a)});e.common.issues.push(n)}var Q=class e{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,r){let n=[];for(let a of r){if(a.status==="aborted")return A;a.status==="dirty"&&t.dirty(),n.push(a.value)}return{status:t.value,value:n}}static async mergeObjectAsync(t,r){let n=[];for(let a of r){let s=await a.key,i=await a.value;n.push({key:s,value:i})}return e.mergeObjectSync(t,n)}static mergeObjectSync(t,r){let n={};for(let a of r){let{key:s,value:i}=a;if(s.status==="aborted"||i.status==="aborted")return A;s.status==="dirty"&&t.dirty(),i.status==="dirty"&&t.dirty(),s.value!=="__proto__"&&(typeof i.value<"u"||a.alwaysSet)&&(n[s.value]=i.value)}return{status:t.value,value:n}}},A=Object.freeze({status:"aborted"}),Ye=e=>({status:"dirty",value:e}),X=e=>({status:"valid",value:e}),gr=e=>e.status==="aborted",_r=e=>e.status==="dirty",Ze=e=>e.status==="valid",St=e=>typeof Promise<"u"&&e instanceof Promise;var k;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t?.message})(k||(k={}));var pe=class{constructor(t,r,n,a){this._cachedPath=[],this.parent=t,this.data=r,this._path=n,this._key=a}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}},Ha=(e,t)=>{if(Ze(t))return{success:!0,data:t.value};if(!e.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 ae(e.common.issues);return this._error=r,this._error}}};function C(e){if(!e)return{};let{errorMap:t,invalid_type_error:r,required_error:n,description:a}=e;if(t&&(r||n))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:a}:{errorMap:(i,o)=>{let{message:c}=e;return i.code==="invalid_enum_value"?{message:c??o.defaultError}:typeof o.data>"u"?{message:c??n??o.defaultError}:i.code!=="invalid_type"?{message:o.defaultError}:{message:c??r??o.defaultError}},description:a}}var P=class{get description(){return this._def.description}_getType(t){return Ae(t.data)}_getOrReturnCtx(t,r){return r||{common:t.parent.common,data:t.data,parsedType:Ae(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new Q,ctx:{common:t.parent.common,data:t.data,parsedType:Ae(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){let r=this._parse(t);if(St(r))throw new Error("Synchronous parse encountered promise.");return r}_parseAsync(t){let r=this._parse(t);return Promise.resolve(r)}parse(t,r){let n=this.safeParse(t,r);if(n.success)return n.data;throw n.error}safeParse(t,r){let n={common:{issues:[],async:r?.async??!1,contextualErrorMap:r?.errorMap},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Ae(t)},a=this._parseSync({data:t,path:n.path,parent:n});return Ha(n,a)}"~validate"(t){let r={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Ae(t)};if(!this["~standard"].async)try{let n=this._parseSync({data:t,path:[],parent:r});return Ze(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:t,path:[],parent:r}).then(n=>Ze(n)?{value:n.value}:{issues:r.common.issues})}async parseAsync(t,r){let n=await this.safeParseAsync(t,r);if(n.success)return n.data;throw n.error}async safeParseAsync(t,r){let n={common:{issues:[],contextualErrorMap:r?.errorMap,async:!0},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Ae(t)},a=this._parse({data:t,path:n.path,parent:n}),s=await(St(a)?a:Promise.resolve(a));return Ha(n,s)}refine(t,r){let n=a=>typeof r=="string"||typeof r>"u"?{message:r}:typeof r=="function"?r(a):r;return this._refinement((a,s)=>{let i=t(a),o=()=>s.addIssue({code:p.custom,...n(a)});return typeof Promise<"u"&&i instanceof Promise?i.then(c=>c?!0:(o(),!1)):i?!0:(o(),!1)})}refinement(t,r){return this._refinement((n,a)=>t(n)?!0:(a.addIssue(typeof r=="function"?r(n,a):r),!1))}_refinement(t){return new he({schema:this,typeName:h.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}constructor(t){this.spa=this.safeParseAsync,this._def=t,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 fe.create(this,this._def)}nullable(){return Ee.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return je.create(this)}promise(){return Ve.create(this,this._def)}or(t){return at.create([this,t],this._def)}and(t){return st.create(this,t,this._def)}transform(t){return new he({...C(this._def),schema:this,typeName:h.ZodEffects,effect:{type:"transform",transform:t}})}default(t){let r=typeof t=="function"?t:()=>t;return new lt({...C(this._def),innerType:this,defaultValue:r,typeName:h.ZodDefault})}brand(){return new Bt({typeName:h.ZodBranded,type:this,...C(this._def)})}catch(t){let r=typeof t=="function"?t:()=>t;return new dt({...C(this._def),innerType:this,catchValue:r,typeName:h.ZodCatch})}describe(t){let r=this.constructor;return new r({...this._def,description:t})}pipe(t){return Wt.create(this,t)}readonly(){return ft.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},Si=/^c[^\s-]{8,}$/i,Ei=/^[0-9a-z]+$/,Oi=/^[0-9A-HJKMNP-TV-Z]{26}$/i,$i=/^[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,Ii=/^[a-z0-9_-]{21}$/i,Ni=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,Ri=/^[-+]?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)?)??$/,Ci=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Pi="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",vn,Mi=/^(?:(?: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])$/,ji=/^(?:(?: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])$/,Di=/^(([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]))$/,zi=/^(([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])$/,Zi=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,Li=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,Ya="((\\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])))",Fi=new RegExp(`^${Ya}$`);function Qa(e){let t="[0-5]\\d";e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision==null&&(t=`${t}(\\.\\d+)?`);let r=e.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${t})${r}`}function Vi(e){return new RegExp(`^${Qa(e)}$`)}function Xa(e){let t=`${Ya}T${Qa(e)}`,r=[];return r.push(e.local?"Z?":"Z"),e.offset&&r.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${r.join("|")})`,new RegExp(`^${t}$`)}function Ui(e,t){return!!((t==="v4"||!t)&&Mi.test(e)||(t==="v6"||!t)&&Di.test(e))}function Bi(e,t){if(!Ni.test(e))return!1;try{let[r]=e.split(".");if(!r)return!1;let n=r.replace(/-/g,"+").replace(/_/g,"/").padEnd(r.length+(4-r.length%4)%4,"="),a=JSON.parse(atob(n));return!(typeof a!="object"||a===null||"typ"in a&&a?.typ!=="JWT"||!a.alg||t&&a.alg!==t)}catch{return!1}}function Wi(e,t){return!!((t==="v4"||!t)&&ji.test(e)||(t==="v6"||!t)&&zi.test(e))}var Le=class e extends P{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==_.string){let s=this._getOrReturnCtx(t);return m(s,{code:p.invalid_type,expected:_.string,received:s.parsedType}),A}let n=new Q,a;for(let s of this._def.checks)if(s.kind==="min")t.data.length<s.value&&(a=this._getOrReturnCtx(t,a),m(a,{code:p.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),n.dirty());else if(s.kind==="max")t.data.length>s.value&&(a=this._getOrReturnCtx(t,a),m(a,{code:p.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),n.dirty());else if(s.kind==="length"){let i=t.data.length>s.value,o=t.data.length<s.value;(i||o)&&(a=this._getOrReturnCtx(t,a),i?m(a,{code:p.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}):o&&m(a,{code:p.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}),n.dirty())}else if(s.kind==="email")Ci.test(t.data)||(a=this._getOrReturnCtx(t,a),m(a,{validation:"email",code:p.invalid_string,message:s.message}),n.dirty());else if(s.kind==="emoji")vn||(vn=new RegExp(Pi,"u")),vn.test(t.data)||(a=this._getOrReturnCtx(t,a),m(a,{validation:"emoji",code:p.invalid_string,message:s.message}),n.dirty());else if(s.kind==="uuid")$i.test(t.data)||(a=this._getOrReturnCtx(t,a),m(a,{validation:"uuid",code:p.invalid_string,message:s.message}),n.dirty());else if(s.kind==="nanoid")Ii.test(t.data)||(a=this._getOrReturnCtx(t,a),m(a,{validation:"nanoid",code:p.invalid_string,message:s.message}),n.dirty());else if(s.kind==="cuid")Si.test(t.data)||(a=this._getOrReturnCtx(t,a),m(a,{validation:"cuid",code:p.invalid_string,message:s.message}),n.dirty());else if(s.kind==="cuid2")Ei.test(t.data)||(a=this._getOrReturnCtx(t,a),m(a,{validation:"cuid2",code:p.invalid_string,message:s.message}),n.dirty());else if(s.kind==="ulid")Oi.test(t.data)||(a=this._getOrReturnCtx(t,a),m(a,{validation:"ulid",code:p.invalid_string,message:s.message}),n.dirty());else if(s.kind==="url")try{new URL(t.data)}catch{a=this._getOrReturnCtx(t,a),m(a,{validation:"url",code:p.invalid_string,message:s.message}),n.dirty()}else s.kind==="regex"?(s.regex.lastIndex=0,s.regex.test(t.data)||(a=this._getOrReturnCtx(t,a),m(a,{validation:"regex",code:p.invalid_string,message:s.message}),n.dirty())):s.kind==="trim"?t.data=t.data.trim():s.kind==="includes"?t.data.includes(s.value,s.position)||(a=this._getOrReturnCtx(t,a),m(a,{code:p.invalid_string,validation:{includes:s.value,position:s.position},message:s.message}),n.dirty()):s.kind==="toLowerCase"?t.data=t.data.toLowerCase():s.kind==="toUpperCase"?t.data=t.data.toUpperCase():s.kind==="startsWith"?t.data.startsWith(s.value)||(a=this._getOrReturnCtx(t,a),m(a,{code:p.invalid_string,validation:{startsWith:s.value},message:s.message}),n.dirty()):s.kind==="endsWith"?t.data.endsWith(s.value)||(a=this._getOrReturnCtx(t,a),m(a,{code:p.invalid_string,validation:{endsWith:s.value},message:s.message}),n.dirty()):s.kind==="datetime"?Xa(s).test(t.data)||(a=this._getOrReturnCtx(t,a),m(a,{code:p.invalid_string,validation:"datetime",message:s.message}),n.dirty()):s.kind==="date"?Fi.test(t.data)||(a=this._getOrReturnCtx(t,a),m(a,{code:p.invalid_string,validation:"date",message:s.message}),n.dirty()):s.kind==="time"?Vi(s).test(t.data)||(a=this._getOrReturnCtx(t,a),m(a,{code:p.invalid_string,validation:"time",message:s.message}),n.dirty()):s.kind==="duration"?Ri.test(t.data)||(a=this._getOrReturnCtx(t,a),m(a,{validation:"duration",code:p.invalid_string,message:s.message}),n.dirty()):s.kind==="ip"?Ui(t.data,s.version)||(a=this._getOrReturnCtx(t,a),m(a,{validation:"ip",code:p.invalid_string,message:s.message}),n.dirty()):s.kind==="jwt"?Bi(t.data,s.alg)||(a=this._getOrReturnCtx(t,a),m(a,{validation:"jwt",code:p.invalid_string,message:s.message}),n.dirty()):s.kind==="cidr"?Wi(t.data,s.version)||(a=this._getOrReturnCtx(t,a),m(a,{validation:"cidr",code:p.invalid_string,message:s.message}),n.dirty()):s.kind==="base64"?Zi.test(t.data)||(a=this._getOrReturnCtx(t,a),m(a,{validation:"base64",code:p.invalid_string,message:s.message}),n.dirty()):s.kind==="base64url"?Li.test(t.data)||(a=this._getOrReturnCtx(t,a),m(a,{validation:"base64url",code:p.invalid_string,message:s.message}),n.dirty()):j.assertNever(s);return{status:n.value,value:t.data}}_regex(t,r,n){return this.refinement(a=>t.test(a),{validation:r,code:p.invalid_string,...k.errToObj(n)})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...k.errToObj(t)})}url(t){return this._addCheck({kind:"url",...k.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...k.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...k.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...k.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...k.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...k.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...k.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...k.errToObj(t)})}base64url(t){return this._addCheck({kind:"base64url",...k.errToObj(t)})}jwt(t){return this._addCheck({kind:"jwt",...k.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...k.errToObj(t)})}cidr(t){return this._addCheck({kind:"cidr",...k.errToObj(t)})}datetime(t){return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:t}):this._addCheck({kind:"datetime",precision:typeof t?.precision>"u"?null:t?.precision,offset:t?.offset??!1,local:t?.local??!1,...k.errToObj(t?.message)})}date(t){return this._addCheck({kind:"date",message:t})}time(t){return typeof t=="string"?this._addCheck({kind:"time",precision:null,message:t}):this._addCheck({kind:"time",precision:typeof t?.precision>"u"?null:t?.precision,...k.errToObj(t?.message)})}duration(t){return this._addCheck({kind:"duration",...k.errToObj(t)})}regex(t,r){return this._addCheck({kind:"regex",regex:t,...k.errToObj(r)})}includes(t,r){return this._addCheck({kind:"includes",value:t,position:r?.position,...k.errToObj(r?.message)})}startsWith(t,r){return this._addCheck({kind:"startsWith",value:t,...k.errToObj(r)})}endsWith(t,r){return this._addCheck({kind:"endsWith",value:t,...k.errToObj(r)})}min(t,r){return this._addCheck({kind:"min",value:t,...k.errToObj(r)})}max(t,r){return this._addCheck({kind:"max",value:t,...k.errToObj(r)})}length(t,r){return this._addCheck({kind:"length",value:t,...k.errToObj(r)})}nonempty(t){return this.min(1,k.errToObj(t))}trim(){return new e({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new e({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new e({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(t=>t.kind==="datetime")}get isDate(){return!!this._def.checks.find(t=>t.kind==="date")}get isTime(){return!!this._def.checks.find(t=>t.kind==="time")}get isDuration(){return!!this._def.checks.find(t=>t.kind==="duration")}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find(t=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(t=>t.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(t=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find(t=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find(t=>t.kind==="ip")}get isCIDR(){return!!this._def.checks.find(t=>t.kind==="cidr")}get isBase64(){return!!this._def.checks.find(t=>t.kind==="base64")}get isBase64url(){return!!this._def.checks.find(t=>t.kind==="base64url")}get minLength(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxLength(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}};Le.create=e=>new Le({checks:[],typeName:h.ZodString,coerce:e?.coerce??!1,...C(e)});function qi(e,t){let r=(e.toString().split(".")[1]||"").length,n=(t.toString().split(".")[1]||"").length,a=r>n?r:n,s=Number.parseInt(e.toFixed(a).replace(".","")),i=Number.parseInt(t.toFixed(a).replace(".",""));return s%i/10**a}var Qe=class e extends P{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==_.number){let s=this._getOrReturnCtx(t);return m(s,{code:p.invalid_type,expected:_.number,received:s.parsedType}),A}let n,a=new Q;for(let s of this._def.checks)s.kind==="int"?j.isInteger(t.data)||(n=this._getOrReturnCtx(t,n),m(n,{code:p.invalid_type,expected:"integer",received:"float",message:s.message}),a.dirty()):s.kind==="min"?(s.inclusive?t.data<s.value:t.data<=s.value)&&(n=this._getOrReturnCtx(t,n),m(n,{code:p.too_small,minimum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),a.dirty()):s.kind==="max"?(s.inclusive?t.data>s.value:t.data>=s.value)&&(n=this._getOrReturnCtx(t,n),m(n,{code:p.too_big,maximum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),a.dirty()):s.kind==="multipleOf"?qi(t.data,s.value)!==0&&(n=this._getOrReturnCtx(t,n),m(n,{code:p.not_multiple_of,multipleOf:s.value,message:s.message}),a.dirty()):s.kind==="finite"?Number.isFinite(t.data)||(n=this._getOrReturnCtx(t,n),m(n,{code:p.not_finite,message:s.message}),a.dirty()):j.assertNever(s);return{status:a.value,value:t.data}}gte(t,r){return this.setLimit("min",t,!0,k.toString(r))}gt(t,r){return this.setLimit("min",t,!1,k.toString(r))}lte(t,r){return this.setLimit("max",t,!0,k.toString(r))}lt(t,r){return this.setLimit("max",t,!1,k.toString(r))}setLimit(t,r,n,a){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:n,message:k.toString(a)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:k.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:k.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:k.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:k.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:k.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:k.toString(r)})}finite(t){return this._addCheck({kind:"finite",message:k.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:k.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:k.toString(t)})}get minValue(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxValue(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}get isInt(){return!!this._def.checks.find(t=>t.kind==="int"||t.kind==="multipleOf"&&j.isInteger(t.value))}get isFinite(){let t=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"&&(t===null||n.value<t)&&(t=n.value)}return Number.isFinite(r)&&Number.isFinite(t)}};Qe.create=e=>new Qe({checks:[],typeName:h.ZodNumber,coerce:e?.coerce||!1,...C(e)});var Xe=class e extends P{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce)try{t.data=BigInt(t.data)}catch{return this._getInvalidInput(t)}if(this._getType(t)!==_.bigint)return this._getInvalidInput(t);let n,a=new Q;for(let s of this._def.checks)s.kind==="min"?(s.inclusive?t.data<s.value:t.data<=s.value)&&(n=this._getOrReturnCtx(t,n),m(n,{code:p.too_small,type:"bigint",minimum:s.value,inclusive:s.inclusive,message:s.message}),a.dirty()):s.kind==="max"?(s.inclusive?t.data>s.value:t.data>=s.value)&&(n=this._getOrReturnCtx(t,n),m(n,{code:p.too_big,type:"bigint",maximum:s.value,inclusive:s.inclusive,message:s.message}),a.dirty()):s.kind==="multipleOf"?t.data%s.value!==BigInt(0)&&(n=this._getOrReturnCtx(t,n),m(n,{code:p.not_multiple_of,multipleOf:s.value,message:s.message}),a.dirty()):j.assertNever(s);return{status:a.value,value:t.data}}_getInvalidInput(t){let r=this._getOrReturnCtx(t);return m(r,{code:p.invalid_type,expected:_.bigint,received:r.parsedType}),A}gte(t,r){return this.setLimit("min",t,!0,k.toString(r))}gt(t,r){return this.setLimit("min",t,!1,k.toString(r))}lte(t,r){return this.setLimit("max",t,!0,k.toString(r))}lt(t,r){return this.setLimit("max",t,!1,k.toString(r))}setLimit(t,r,n,a){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:n,message:k.toString(a)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:k.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:k.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:k.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:k.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:k.toString(r)})}get minValue(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxValue(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}};Xe.create=e=>new Xe({checks:[],typeName:h.ZodBigInt,coerce:e?.coerce??!1,...C(e)});var et=class extends P{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==_.boolean){let n=this._getOrReturnCtx(t);return m(n,{code:p.invalid_type,expected:_.boolean,received:n.parsedType}),A}return X(t.data)}};et.create=e=>new et({typeName:h.ZodBoolean,coerce:e?.coerce||!1,...C(e)});var tt=class e extends P{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==_.date){let s=this._getOrReturnCtx(t);return m(s,{code:p.invalid_type,expected:_.date,received:s.parsedType}),A}if(Number.isNaN(t.data.getTime())){let s=this._getOrReturnCtx(t);return m(s,{code:p.invalid_date}),A}let n=new Q,a;for(let s of this._def.checks)s.kind==="min"?t.data.getTime()<s.value&&(a=this._getOrReturnCtx(t,a),m(a,{code:p.too_small,message:s.message,inclusive:!0,exact:!1,minimum:s.value,type:"date"}),n.dirty()):s.kind==="max"?t.data.getTime()>s.value&&(a=this._getOrReturnCtx(t,a),m(a,{code:p.too_big,message:s.message,inclusive:!0,exact:!1,maximum:s.value,type:"date"}),n.dirty()):j.assertNever(s);return{status:n.value,value:new Date(t.data.getTime())}}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}min(t,r){return this._addCheck({kind:"min",value:t.getTime(),message:k.toString(r)})}max(t,r){return this._addCheck({kind:"max",value:t.getTime(),message:k.toString(r)})}get minDate(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t!=null?new Date(t):null}};tt.create=e=>new tt({checks:[],coerce:e?.coerce||!1,typeName:h.ZodDate,...C(e)});var Ot=class extends P{_parse(t){if(this._getType(t)!==_.symbol){let n=this._getOrReturnCtx(t);return m(n,{code:p.invalid_type,expected:_.symbol,received:n.parsedType}),A}return X(t.data)}};Ot.create=e=>new Ot({typeName:h.ZodSymbol,...C(e)});var rt=class extends P{_parse(t){if(this._getType(t)!==_.undefined){let n=this._getOrReturnCtx(t);return m(n,{code:p.invalid_type,expected:_.undefined,received:n.parsedType}),A}return X(t.data)}};rt.create=e=>new rt({typeName:h.ZodUndefined,...C(e)});var nt=class extends P{_parse(t){if(this._getType(t)!==_.null){let n=this._getOrReturnCtx(t);return m(n,{code:p.invalid_type,expected:_.null,received:n.parsedType}),A}return X(t.data)}};nt.create=e=>new nt({typeName:h.ZodNull,...C(e)});var Fe=class extends P{constructor(){super(...arguments),this._any=!0}_parse(t){return X(t.data)}};Fe.create=e=>new Fe({typeName:h.ZodAny,...C(e)});var Me=class extends P{constructor(){super(...arguments),this._unknown=!0}_parse(t){return X(t.data)}};Me.create=e=>new Me({typeName:h.ZodUnknown,...C(e)});var _e=class extends P{_parse(t){let r=this._getOrReturnCtx(t);return m(r,{code:p.invalid_type,expected:_.never,received:r.parsedType}),A}};_e.create=e=>new _e({typeName:h.ZodNever,...C(e)});var $t=class extends P{_parse(t){if(this._getType(t)!==_.undefined){let n=this._getOrReturnCtx(t);return m(n,{code:p.invalid_type,expected:_.void,received:n.parsedType}),A}return X(t.data)}};$t.create=e=>new $t({typeName:h.ZodVoid,...C(e)});var je=class e extends P{_parse(t){let{ctx:r,status:n}=this._processInputParams(t),a=this._def;if(r.parsedType!==_.array)return m(r,{code:p.invalid_type,expected:_.array,received:r.parsedType}),A;if(a.exactLength!==null){let i=r.data.length>a.exactLength.value,o=r.data.length<a.exactLength.value;(i||o)&&(m(r,{code:i?p.too_big:p.too_small,minimum:o?a.exactLength.value:void 0,maximum:i?a.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:a.exactLength.message}),n.dirty())}if(a.minLength!==null&&r.data.length<a.minLength.value&&(m(r,{code:p.too_small,minimum:a.minLength.value,type:"array",inclusive:!0,exact:!1,message:a.minLength.message}),n.dirty()),a.maxLength!==null&&r.data.length>a.maxLength.value&&(m(r,{code:p.too_big,maximum:a.maxLength.value,type:"array",inclusive:!0,exact:!1,message:a.maxLength.message}),n.dirty()),r.common.async)return Promise.all([...r.data].map((i,o)=>a.type._parseAsync(new pe(r,i,r.path,o)))).then(i=>Q.mergeArray(n,i));let s=[...r.data].map((i,o)=>a.type._parseSync(new pe(r,i,r.path,o)));return Q.mergeArray(n,s)}get element(){return this._def.type}min(t,r){return new e({...this._def,minLength:{value:t,message:k.toString(r)}})}max(t,r){return new e({...this._def,maxLength:{value:t,message:k.toString(r)}})}length(t,r){return new e({...this._def,exactLength:{value:t,message:k.toString(r)}})}nonempty(t){return this.min(1,t)}};je.create=(e,t)=>new je({type:e,minLength:null,maxLength:null,exactLength:null,typeName:h.ZodArray,...C(t)});function Et(e){if(e instanceof se){let t={};for(let r in e.shape){let n=e.shape[r];t[r]=fe.create(Et(n))}return new se({...e._def,shape:()=>t})}else return e instanceof je?new je({...e._def,type:Et(e.element)}):e instanceof fe?fe.create(Et(e.unwrap())):e instanceof Ee?Ee.create(Et(e.unwrap())):e instanceof Se?Se.create(e.items.map(t=>Et(t))):e}var se=class e extends P{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let t=this._def.shape(),r=j.objectKeys(t);return this._cached={shape:t,keys:r},this._cached}_parse(t){if(this._getType(t)!==_.object){let u=this._getOrReturnCtx(t);return m(u,{code:p.invalid_type,expected:_.object,received:u.parsedType}),A}let{status:n,ctx:a}=this._processInputParams(t),{shape:s,keys:i}=this._getCached(),o=[];if(!(this._def.catchall instanceof _e&&this._def.unknownKeys==="strip"))for(let u in a.data)i.includes(u)||o.push(u);let c=[];for(let u of i){let l=s[u],d=a.data[u];c.push({key:{status:"valid",value:u},value:l._parse(new pe(a,d,a.path,u)),alwaysSet:u in a.data})}if(this._def.catchall instanceof _e){let u=this._def.unknownKeys;if(u==="passthrough")for(let l of o)c.push({key:{status:"valid",value:l},value:{status:"valid",value:a.data[l]}});else if(u==="strict")o.length>0&&(m(a,{code:p.unrecognized_keys,keys:o}),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 o){let d=a.data[l];c.push({key:{status:"valid",value:l},value:u._parse(new pe(a,d,a.path,l)),alwaysSet:l in a.data})}}return a.common.async?Promise.resolve().then(async()=>{let u=[];for(let l of c){let d=await l.key,v=await l.value;u.push({key:d,value:v,alwaysSet:l.alwaysSet})}return u}).then(u=>Q.mergeObjectSync(n,u)):Q.mergeObjectSync(n,c)}get shape(){return this._def.shape()}strict(t){return k.errToObj,new e({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(r,n)=>{let a=this._def.errorMap?.(r,n).message??n.defaultError;return r.code==="unrecognized_keys"?{message:k.errToObj(t).message??a}:{message:a}}}:{}})}strip(){return new e({...this._def,unknownKeys:"strip"})}passthrough(){return new e({...this._def,unknownKeys:"passthrough"})}extend(t){return new e({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new e({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:h.ZodObject})}setKey(t,r){return this.augment({[t]:r})}catchall(t){return new e({...this._def,catchall:t})}pick(t){let r={};for(let n of j.objectKeys(t))t[n]&&this.shape[n]&&(r[n]=this.shape[n]);return new e({...this._def,shape:()=>r})}omit(t){let r={};for(let n of j.objectKeys(this.shape))t[n]||(r[n]=this.shape[n]);return new e({...this._def,shape:()=>r})}deepPartial(){return Et(this)}partial(t){let r={};for(let n of j.objectKeys(this.shape)){let a=this.shape[n];t&&!t[n]?r[n]=a:r[n]=a.optional()}return new e({...this._def,shape:()=>r})}required(t){let r={};for(let n of j.objectKeys(this.shape))if(t&&!t[n])r[n]=this.shape[n];else{let s=this.shape[n];for(;s instanceof fe;)s=s._def.innerType;r[n]=s}return new e({...this._def,shape:()=>r})}keyof(){return es(j.objectKeys(this.shape))}};se.create=(e,t)=>new se({shape:()=>e,unknownKeys:"strip",catchall:_e.create(),typeName:h.ZodObject,...C(t)});se.strictCreate=(e,t)=>new se({shape:()=>e,unknownKeys:"strict",catchall:_e.create(),typeName:h.ZodObject,...C(t)});se.lazycreate=(e,t)=>new se({shape:e,unknownKeys:"strip",catchall:_e.create(),typeName:h.ZodObject,...C(t)});var at=class extends P{_parse(t){let{ctx:r}=this._processInputParams(t),n=this._def.options;function a(s){for(let o of s)if(o.result.status==="valid")return o.result;for(let o of s)if(o.result.status==="dirty")return r.common.issues.push(...o.ctx.common.issues),o.result;let i=s.map(o=>new ae(o.ctx.common.issues));return m(r,{code:p.invalid_union,unionErrors:i}),A}if(r.common.async)return Promise.all(n.map(async s=>{let i={...r,common:{...r.common,issues:[]},parent:null};return{result:await s._parseAsync({data:r.data,path:r.path,parent:i}),ctx:i}})).then(a);{let s,i=[];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"&&!s&&(s={result:l,ctx:u}),u.common.issues.length&&i.push(u.common.issues)}if(s)return r.common.issues.push(...s.ctx.common.issues),s.result;let o=i.map(c=>new ae(c));return m(r,{code:p.invalid_union,unionErrors:o}),A}}get options(){return this._def.options}};at.create=(e,t)=>new at({options:e,typeName:h.ZodUnion,...C(t)});var Pe=e=>e instanceof it?Pe(e.schema):e instanceof he?Pe(e.innerType()):e instanceof ot?[e.value]:e instanceof ct?e.options:e instanceof ut?j.objectValues(e.enum):e instanceof lt?Pe(e._def.innerType):e instanceof rt?[void 0]:e instanceof nt?[null]:e instanceof fe?[void 0,...Pe(e.unwrap())]:e instanceof Ee?[null,...Pe(e.unwrap())]:e instanceof Bt||e instanceof ft?Pe(e.unwrap()):e instanceof dt?Pe(e._def.innerType):[],vr=class e extends P{_parse(t){let{ctx:r}=this._processInputParams(t);if(r.parsedType!==_.object)return m(r,{code:p.invalid_type,expected:_.object,received:r.parsedType}),A;let n=this.discriminator,a=r.data[n],s=this.optionsMap.get(a);return s?r.common.async?s._parseAsync({data:r.data,path:r.path,parent:r}):s._parseSync({data:r.data,path:r.path,parent:r}):(m(r,{code:p.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),A)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,r,n){let a=new Map;for(let s of r){let i=Pe(s.shape[t]);if(!i.length)throw new Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(let o of i){if(a.has(o))throw new Error(`Discriminator property ${String(t)} has duplicate value ${String(o)}`);a.set(o,s)}}return new e({typeName:h.ZodDiscriminatedUnion,discriminator:t,options:r,optionsMap:a,...C(n)})}};function bn(e,t){let r=Ae(e),n=Ae(t);if(e===t)return{valid:!0,data:e};if(r===_.object&&n===_.object){let a=j.objectKeys(t),s=j.objectKeys(e).filter(o=>a.indexOf(o)!==-1),i={...e,...t};for(let o of s){let c=bn(e[o],t[o]);if(!c.valid)return{valid:!1};i[o]=c.data}return{valid:!0,data:i}}else if(r===_.array&&n===_.array){if(e.length!==t.length)return{valid:!1};let a=[];for(let s=0;s<e.length;s++){let i=e[s],o=t[s],c=bn(i,o);if(!c.valid)return{valid:!1};a.push(c.data)}return{valid:!0,data:a}}else return r===_.date&&n===_.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}var st=class extends P{_parse(t){let{status:r,ctx:n}=this._processInputParams(t),a=(s,i)=>{if(gr(s)||gr(i))return A;let o=bn(s.value,i.value);return o.valid?((_r(s)||_r(i))&&r.dirty(),{status:r.value,value:o.data}):(m(n,{code:p.invalid_intersection_types}),A)};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(([s,i])=>a(s,i)):a(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}};st.create=(e,t,r)=>new st({left:e,right:t,typeName:h.ZodIntersection,...C(r)});var Se=class e extends P{_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==_.array)return m(n,{code:p.invalid_type,expected:_.array,received:n.parsedType}),A;if(n.data.length<this._def.items.length)return m(n,{code:p.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),A;!this._def.rest&&n.data.length>this._def.items.length&&(m(n,{code:p.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());let s=[...n.data].map((i,o)=>{let c=this._def.items[o]||this._def.rest;return c?c._parse(new pe(n,i,n.path,o)):null}).filter(i=>!!i);return n.common.async?Promise.all(s).then(i=>Q.mergeArray(r,i)):Q.mergeArray(r,s)}get items(){return this._def.items}rest(t){return new e({...this._def,rest:t})}};Se.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Se({items:e,typeName:h.ZodTuple,rest:null,...C(t)})};var br=class e extends P{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==_.object)return m(n,{code:p.invalid_type,expected:_.object,received:n.parsedType}),A;let a=[],s=this._def.keyType,i=this._def.valueType;for(let o in n.data)a.push({key:s._parse(new pe(n,o,n.path,o)),value:i._parse(new pe(n,n.data[o],n.path,o)),alwaysSet:o in n.data});return n.common.async?Q.mergeObjectAsync(r,a):Q.mergeObjectSync(r,a)}get element(){return this._def.valueType}static create(t,r,n){return r instanceof P?new e({keyType:t,valueType:r,typeName:h.ZodRecord,...C(n)}):new e({keyType:Le.create(),valueType:t,typeName:h.ZodRecord,...C(r)})}},It=class extends P{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==_.map)return m(n,{code:p.invalid_type,expected:_.map,received:n.parsedType}),A;let a=this._def.keyType,s=this._def.valueType,i=[...n.data.entries()].map(([o,c],u)=>({key:a._parse(new pe(n,o,n.path,[u,"key"])),value:s._parse(new pe(n,c,n.path,[u,"value"]))}));if(n.common.async){let o=new Map;return Promise.resolve().then(async()=>{for(let c of i){let u=await c.key,l=await c.value;if(u.status==="aborted"||l.status==="aborted")return A;(u.status==="dirty"||l.status==="dirty")&&r.dirty(),o.set(u.value,l.value)}return{status:r.value,value:o}})}else{let o=new Map;for(let c of i){let u=c.key,l=c.value;if(u.status==="aborted"||l.status==="aborted")return A;(u.status==="dirty"||l.status==="dirty")&&r.dirty(),o.set(u.value,l.value)}return{status:r.value,value:o}}}};It.create=(e,t,r)=>new It({valueType:t,keyType:e,typeName:h.ZodMap,...C(r)});var Nt=class e extends P{_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==_.set)return m(n,{code:p.invalid_type,expected:_.set,received:n.parsedType}),A;let a=this._def;a.minSize!==null&&n.data.size<a.minSize.value&&(m(n,{code:p.too_small,minimum:a.minSize.value,type:"set",inclusive:!0,exact:!1,message:a.minSize.message}),r.dirty()),a.maxSize!==null&&n.data.size>a.maxSize.value&&(m(n,{code:p.too_big,maximum:a.maxSize.value,type:"set",inclusive:!0,exact:!1,message:a.maxSize.message}),r.dirty());let s=this._def.valueType;function i(c){let u=new Set;for(let l of c){if(l.status==="aborted")return A;l.status==="dirty"&&r.dirty(),u.add(l.value)}return{status:r.value,value:u}}let o=[...n.data.values()].map((c,u)=>s._parse(new pe(n,c,n.path,u)));return n.common.async?Promise.all(o).then(c=>i(c)):i(o)}min(t,r){return new e({...this._def,minSize:{value:t,message:k.toString(r)}})}max(t,r){return new e({...this._def,maxSize:{value:t,message:k.toString(r)}})}size(t,r){return this.min(t,r).max(t,r)}nonempty(t){return this.min(1,t)}};Nt.create=(e,t)=>new Nt({valueType:e,minSize:null,maxSize:null,typeName:h.ZodSet,...C(t)});var wr=class e extends P{constructor(){super(...arguments),this.validate=this.implement}_parse(t){let{ctx:r}=this._processInputParams(t);if(r.parsedType!==_.function)return m(r,{code:p.invalid_type,expected:_.function,received:r.parsedType}),A;function n(o,c){return Ut({data:o,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,At(),Ce].filter(u=>!!u),issueData:{code:p.invalid_arguments,argumentsError:c}})}function a(o,c){return Ut({data:o,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,At(),Ce].filter(u=>!!u),issueData:{code:p.invalid_return_type,returnTypeError:c}})}let s={errorMap:r.common.contextualErrorMap},i=r.data;if(this._def.returns instanceof Ve){let o=this;return X(async function(...c){let u=new ae([]),l=await o._def.args.parseAsync(c,s).catch(f=>{throw u.addIssue(n(c,f)),u}),d=await Reflect.apply(i,this,l);return await o._def.returns._def.type.parseAsync(d,s).catch(f=>{throw u.addIssue(a(d,f)),u})})}else{let o=this;return X(function(...c){let u=o._def.args.safeParse(c,s);if(!u.success)throw new ae([n(c,u.error)]);let l=Reflect.apply(i,this,u.data),d=o._def.returns.safeParse(l,s);if(!d.success)throw new ae([a(l,d.error)]);return d.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new e({...this._def,args:Se.create(t).rest(Me.create())})}returns(t){return new e({...this._def,returns:t})}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,r,n){return new e({args:t||Se.create([]).rest(Me.create()),returns:r||Me.create(),typeName:h.ZodFunction,...C(n)})}},it=class extends P{get schema(){return this._def.getter()}_parse(t){let{ctx:r}=this._processInputParams(t);return this._def.getter()._parse({data:r.data,path:r.path,parent:r})}};it.create=(e,t)=>new it({getter:e,typeName:h.ZodLazy,...C(t)});var ot=class extends P{_parse(t){if(t.data!==this._def.value){let r=this._getOrReturnCtx(t);return m(r,{received:r.data,code:p.invalid_literal,expected:this._def.value}),A}return{status:"valid",value:t.data}}get value(){return this._def.value}};ot.create=(e,t)=>new ot({value:e,typeName:h.ZodLiteral,...C(t)});function es(e,t){return new ct({values:e,typeName:h.ZodEnum,...C(t)})}var ct=class e extends P{_parse(t){if(typeof t.data!="string"){let r=this._getOrReturnCtx(t),n=this._def.values;return m(r,{expected:j.joinValues(n),received:r.parsedType,code:p.invalid_type}),A}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(t.data)){let r=this._getOrReturnCtx(t),n=this._def.values;return m(r,{received:r.data,code:p.invalid_enum_value,options:n}),A}return X(t.data)}get options(){return this._def.values}get enum(){let t={};for(let r of this._def.values)t[r]=r;return t}get Values(){let t={};for(let r of this._def.values)t[r]=r;return t}get Enum(){let t={};for(let r of this._def.values)t[r]=r;return t}extract(t,r=this._def){return e.create(t,{...this._def,...r})}exclude(t,r=this._def){return e.create(this.options.filter(n=>!t.includes(n)),{...this._def,...r})}};ct.create=es;var ut=class extends P{_parse(t){let r=j.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(t);if(n.parsedType!==_.string&&n.parsedType!==_.number){let a=j.objectValues(r);return m(n,{expected:j.joinValues(a),received:n.parsedType,code:p.invalid_type}),A}if(this._cache||(this._cache=new Set(j.getValidEnumValues(this._def.values))),!this._cache.has(t.data)){let a=j.objectValues(r);return m(n,{received:n.data,code:p.invalid_enum_value,options:a}),A}return X(t.data)}get enum(){return this._def.values}};ut.create=(e,t)=>new ut({values:e,typeName:h.ZodNativeEnum,...C(t)});var Ve=class extends P{unwrap(){return this._def.type}_parse(t){let{ctx:r}=this._processInputParams(t);if(r.parsedType!==_.promise&&r.common.async===!1)return m(r,{code:p.invalid_type,expected:_.promise,received:r.parsedType}),A;let n=r.parsedType===_.promise?r.data:Promise.resolve(r.data);return X(n.then(a=>this._def.type.parseAsync(a,{path:r.path,errorMap:r.common.contextualErrorMap})))}};Ve.create=(e,t)=>new Ve({type:e,typeName:h.ZodPromise,...C(t)});var he=class extends P{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===h.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){let{status:r,ctx:n}=this._processInputParams(t),a=this._def.effect||null,s={addIssue:i=>{m(n,i),i.fatal?r.abort():r.dirty()},get path(){return n.path}};if(s.addIssue=s.addIssue.bind(s),a.type==="preprocess"){let i=a.transform(n.data,s);if(n.common.async)return Promise.resolve(i).then(async o=>{if(r.value==="aborted")return A;let c=await this._def.schema._parseAsync({data:o,path:n.path,parent:n});return c.status==="aborted"?A:c.status==="dirty"?Ye(c.value):r.value==="dirty"?Ye(c.value):c});{if(r.value==="aborted")return A;let o=this._def.schema._parseSync({data:i,path:n.path,parent:n});return o.status==="aborted"?A:o.status==="dirty"?Ye(o.value):r.value==="dirty"?Ye(o.value):o}}if(a.type==="refinement"){let i=o=>{let c=a.refinement(o,s);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 o};if(n.common.async===!1){let o=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return o.status==="aborted"?A:(o.status==="dirty"&&r.dirty(),i(o.value),{status:r.value,value:o.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(o=>o.status==="aborted"?A:(o.status==="dirty"&&r.dirty(),i(o.value).then(()=>({status:r.value,value:o.value}))))}if(a.type==="transform")if(n.common.async===!1){let i=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!Ze(i))return A;let o=a.transform(i.value,s);if(o instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:o}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(i=>Ze(i)?Promise.resolve(a.transform(i.value,s)).then(o=>({status:r.value,value:o})):A);j.assertNever(a)}};he.create=(e,t,r)=>new he({schema:e,typeName:h.ZodEffects,effect:t,...C(r)});he.createWithPreprocess=(e,t,r)=>new he({schema:t,effect:{type:"preprocess",transform:e},typeName:h.ZodEffects,...C(r)});var fe=class extends P{_parse(t){return this._getType(t)===_.undefined?X(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};fe.create=(e,t)=>new fe({innerType:e,typeName:h.ZodOptional,...C(t)});var Ee=class extends P{_parse(t){return this._getType(t)===_.null?X(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};Ee.create=(e,t)=>new Ee({innerType:e,typeName:h.ZodNullable,...C(t)});var lt=class extends P{_parse(t){let{ctx:r}=this._processInputParams(t),n=r.data;return r.parsedType===_.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:r.path,parent:r})}removeDefault(){return this._def.innerType}};lt.create=(e,t)=>new lt({innerType:e,typeName:h.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...C(t)});var dt=class extends P{_parse(t){let{ctx:r}=this._processInputParams(t),n={...r,common:{...r.common,issues:[]}},a=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return St(a)?a.then(s=>({status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new ae(n.common.issues)},input:n.data})})):{status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new ae(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}};dt.create=(e,t)=>new dt({innerType:e,typeName:h.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...C(t)});var Rt=class extends P{_parse(t){if(this._getType(t)!==_.nan){let n=this._getOrReturnCtx(t);return m(n,{code:p.invalid_type,expected:_.nan,received:n.parsedType}),A}return{status:"valid",value:t.data}}};Rt.create=e=>new Rt({typeName:h.ZodNaN,...C(e)});var Ji=Symbol("zod_brand"),Bt=class extends P{_parse(t){let{ctx:r}=this._processInputParams(t),n=r.data;return this._def.type._parse({data:n,path:r.path,parent:r})}unwrap(){return this._def.type}},Wt=class e extends P{_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.common.async)return(async()=>{let s=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return s.status==="aborted"?A:s.status==="dirty"?(r.dirty(),Ye(s.value)):this._def.out._parseAsync({data:s.value,path:n.path,parent:n})})();{let a=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return a.status==="aborted"?A:a.status==="dirty"?(r.dirty(),{status:"dirty",value:a.value}):this._def.out._parseSync({data:a.value,path:n.path,parent:n})}}static create(t,r){return new e({in:t,out:r,typeName:h.ZodPipeline})}},ft=class extends P{_parse(t){let r=this._def.innerType._parse(t),n=a=>(Ze(a)&&(a.value=Object.freeze(a.value)),a);return St(r)?r.then(a=>n(a)):n(r)}unwrap(){return this._def.innerType}};ft.create=(e,t)=>new ft({innerType:e,typeName:h.ZodReadonly,...C(t)});function Ka(e,t){let r=typeof e=="function"?e(t):typeof e=="string"?{message:e}:e;return typeof r=="string"?{message:r}:r}function ts(e,t={},r){return e?Fe.create().superRefine((n,a)=>{let s=e(n);if(s instanceof Promise)return s.then(i=>{if(!i){let o=Ka(t,n),c=o.fatal??r??!0;a.addIssue({code:"custom",...o,fatal:c})}});if(!s){let i=Ka(t,n),o=i.fatal??r??!0;a.addIssue({code:"custom",...i,fatal:o})}}):Fe.create()}var Gi={object:se.lazycreate},h;(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"})(h||(h={}));var Hi=(e,t={message:`Input not instance of ${e.name}`})=>ts(r=>r instanceof e,t),rs=Le.create,ns=Qe.create,Ki=Rt.create,Yi=Xe.create,as=et.create,Qi=tt.create,Xi=Ot.create,eo=rt.create,to=nt.create,ro=Fe.create,no=Me.create,ao=_e.create,so=$t.create,io=je.create,oo=se.create,co=se.strictCreate,uo=at.create,lo=vr.create,fo=st.create,po=Se.create,ho=br.create,mo=It.create,yo=Nt.create,go=wr.create,_o=it.create,vo=ot.create,bo=ct.create,wo=ut.create,xo=Ve.create,ko=he.create,To=fe.create,Ao=Ee.create,So=he.createWithPreprocess,Eo=Wt.create,Oo=()=>rs().optional(),$o=()=>ns().optional(),Io=()=>as().optional(),No={string:(e=>Le.create({...e,coerce:!0})),number:(e=>Qe.create({...e,coerce:!0})),boolean:(e=>et.create({...e,coerce:!0})),bigint:(e=>Xe.create({...e,coerce:!0})),date:(e=>tt.create({...e,coerce:!0}))};var Ro=A;function wn(e,t){let r={type:"array"};return e.type?._def&&e.type?._def?.typeName!==h.ZodAny&&(r.items=E(e.type._def,{...t,currentPath:[...t.currentPath,"items"]})),e.minLength&&D(r,"minItems",e.minLength.value,e.minLength.message,t),e.maxLength&&D(r,"maxItems",e.maxLength.value,e.maxLength.message,t),e.exactLength&&(D(r,"minItems",e.exactLength.value,e.exactLength.message,t),D(r,"maxItems",e.exactLength.value,e.exactLength.message,t)),r}function xn(e,t){let r={type:"integer",format:"int64"};if(!e.checks)return r;for(let n of e.checks)switch(n.kind){case"min":t.target==="jsonSchema7"?n.inclusive?D(r,"minimum",n.value,n.message,t):D(r,"exclusiveMinimum",n.value,n.message,t):(n.inclusive||(r.exclusiveMinimum=!0),D(r,"minimum",n.value,n.message,t));break;case"max":t.target==="jsonSchema7"?n.inclusive?D(r,"maximum",n.value,n.message,t):D(r,"exclusiveMaximum",n.value,n.message,t):(n.inclusive||(r.exclusiveMaximum=!0),D(r,"maximum",n.value,n.message,t));break;case"multipleOf":D(r,"multipleOf",n.value,n.message,t);break}return r}function kn(){return{type:"boolean"}}function qt(e,t){return E(e.type._def,t)}var Tn=(e,t)=>E(e.innerType._def,t);function xr(e,t,r){let n=r??t.dateStrategy;if(Array.isArray(n))return{anyOf:n.map(a=>xr(e,t,a))};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 Co(e,t)}}var Co=(e,t)=>{let r={type:"integer",format:"unix-time"};if(t.target==="openApi3")return r;for(let n of e.checks)switch(n.kind){case"min":D(r,"minimum",n.value,n.message,t);break;case"max":D(r,"maximum",n.value,n.message,t);break}return r};function An(e,t){return{...E(e.innerType._def,t),default:e.defaultValue()}}function Sn(e,t){return t.effectStrategy==="input"?E(e.schema._def,t):V(t)}function En(e){return{type:"string",enum:Array.from(e.values)}}var Po=e=>"type"in e&&e.type==="string"?!1:"allOf"in e;function On(e,t){let r=[E(e.left._def,{...t,currentPath:[...t.currentPath,"allOf","0"]}),E(e.right._def,{...t,currentPath:[...t.currentPath,"allOf","1"]})].filter(s=>!!s),n=t.target==="jsonSchema2019-09"?{unevaluatedProperties:!1}:void 0,a=[];return r.forEach(s=>{if(Po(s))a.push(...s.allOf),s.unevaluatedProperties===void 0&&(n=void 0);else{let i=s;if("additionalProperties"in s&&s.additionalProperties===!1){let{additionalProperties:o,...c}=s;i=c}else n=void 0;a.push(i)}}),a.length?{allOf:a,...n}:void 0}function $n(e,t){let r=typeof e.value;return r!=="bigint"&&r!=="number"&&r!=="boolean"&&r!=="string"?{type:Array.isArray(e.value)?"array":"object"}:t.target==="openApi3"?{type:r==="bigint"?"integer":r,enum:[e.value]}:{type:r==="bigint"?"integer":r,const:e.value}}var In,me={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:()=>(In===void 0&&(In=RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),In),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 Jt(e,t){let r={type:"string"};if(e.checks)for(let n of e.checks)switch(n.kind){case"min":D(r,"minLength",typeof r.minLength=="number"?Math.max(r.minLength,n.value):n.value,n.message,t);break;case"max":D(r,"maxLength",typeof r.maxLength=="number"?Math.min(r.maxLength,n.value):n.value,n.message,t);break;case"email":switch(t.emailStrategy){case"format:email":ve(r,"email",n.message,t);break;case"format:idn-email":ve(r,"idn-email",n.message,t);break;case"pattern:zod":ee(r,me.email,n.message,t);break}break;case"url":ve(r,"uri",n.message,t);break;case"uuid":ve(r,"uuid",n.message,t);break;case"regex":ee(r,n.regex,n.message,t);break;case"cuid":ee(r,me.cuid,n.message,t);break;case"cuid2":ee(r,me.cuid2,n.message,t);break;case"startsWith":ee(r,RegExp(`^${Nn(n.value,t)}`),n.message,t);break;case"endsWith":ee(r,RegExp(`${Nn(n.value,t)}$`),n.message,t);break;case"datetime":ve(r,"date-time",n.message,t);break;case"date":ve(r,"date",n.message,t);break;case"time":ve(r,"time",n.message,t);break;case"duration":ve(r,"duration",n.message,t);break;case"length":D(r,"minLength",typeof r.minLength=="number"?Math.max(r.minLength,n.value):n.value,n.message,t),D(r,"maxLength",typeof r.maxLength=="number"?Math.min(r.maxLength,n.value):n.value,n.message,t);break;case"includes":ee(r,RegExp(Nn(n.value,t)),n.message,t);break;case"ip":n.version!=="v6"&&ve(r,"ipv4",n.message,t),n.version!=="v4"&&ve(r,"ipv6",n.message,t);break;case"base64url":ee(r,me.base64url,n.message,t);break;case"jwt":ee(r,me.jwt,n.message,t);break;case"cidr":n.version!=="v6"&&ee(r,me.ipv4Cidr,n.message,t),n.version!=="v4"&&ee(r,me.ipv6Cidr,n.message,t);break;case"emoji":ee(r,me.emoji(),n.message,t);break;case"ulid":ee(r,me.ulid,n.message,t);break;case"base64":switch(t.base64Strategy){case"format:binary":ve(r,"binary",n.message,t);break;case"contentEncoding:base64":D(r,"contentEncoding","base64",n.message,t);break;case"pattern:zod":ee(r,me.base64,n.message,t);break}break;case"nanoid":ee(r,me.nanoid,n.message,t);break;case"toLowerCase":case"toUpperCase":case"trim":break;default:}return r}function Nn(e,t){return t.patternStrategy==="escape"?jo(e):e}var Mo=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");function jo(e){let t="";for(let r=0;r<e.length;r++)Mo.has(e[r])||(t+="\\"),t+=e[r];return t}function ve(e,t,r,n){e.format||e.anyOf?.some(a=>a.format)?(e.anyOf||(e.anyOf=[]),e.format&&(e.anyOf.push({format:e.format,...e.errorMessage&&n.errorMessages&&{errorMessage:{format:e.errorMessage.format}}}),delete e.format,e.errorMessage&&(delete e.errorMessage.format,Object.keys(e.errorMessage).length===0&&delete e.errorMessage)),e.anyOf.push({format:t,...r&&n.errorMessages&&{errorMessage:{format:r}}})):D(e,"format",t,r,n)}function ee(e,t,r,n){e.pattern||e.allOf?.some(a=>a.pattern)?(e.allOf||(e.allOf=[]),e.pattern&&(e.allOf.push({pattern:e.pattern,...e.errorMessage&&n.errorMessages&&{errorMessage:{pattern:e.errorMessage.pattern}}}),delete e.pattern,e.errorMessage&&(delete e.errorMessage.pattern,Object.keys(e.errorMessage).length===0&&delete e.errorMessage)),e.allOf.push({pattern:ss(t,n),...r&&n.errorMessages&&{errorMessage:{pattern:r}}})):D(e,"pattern",ss(t,n),r,n)}function ss(e,t){if(!t.applyRegexFlags||!e.flags)return e.source;let r={i:e.flags.includes("i"),m:e.flags.includes("m"),s:e.flags.includes("s")},n=r.i?e.source.toLowerCase():e.source,a="",s=!1,i=!1,o=!1;for(let c=0;c<n.length;c++){if(s){a+=n[c],s=!1;continue}if(r.i){if(i){if(n[c].match(/[a-z]/)){o?(a+=n[c],a+=`${n[c-2]}-${n[c]}`.toUpperCase(),o=!1):n[c+1]==="-"&&n[c+2]?.match(/[a-z]/)?(a+=n[c],o=!0):a+=`${n[c]}${n[c].toUpperCase()}`;continue}}else if(n[c].match(/[a-z]/)){a+=`[${n[c]}${n[c].toUpperCase()}]`;continue}}if(r.m){if(n[c]==="^"){a+=`(^|(?<=[\r
2
+ import{N as dn,b as ke,c as on,d as fr,e as cn,f as Za,g as La,h as un,k as ne,l as Fa,m as Va,n as ln}from"./AMP43OT2.js";import{$ as Pa,$a as Ft,Ba as Ma,Ca as ja,Da,Ma as mi,Pa as kt,Ra as lr,U as Ca,V as an,Va as dr,Wa as za,Ya as oe,_ as wt,_a as le,a as L,aa as xt,ab as Z,bb as J,c as Ia,cb as de,f as Na,g as Lt,ia as ur,n as cr,ra as sn,t as bt,u as Ra}from"./2UKFCF2J.js";import{a as pi,b as hi,c as $a}from"./UZLQALHY.js";var ni=pi(Br=>{"use strict";Br.byteLength=Xc;Br.toByteArray=tu;Br.fromByteArray=au;var Ne=[],ye=[],Qc=typeof Uint8Array<"u"?Uint8Array:Array,pa="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(gt=0,ti=pa.length;gt<ti;++gt)Ne[gt]=pa[gt],ye[pa.charCodeAt(gt)]=gt;var gt,ti;ye[45]=62;ye[95]=63;function ri(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");r===-1&&(r=t);var n=r===t?0:4-r%4;return[r,n]}function Xc(e){var t=ri(e),r=t[0],n=t[1];return(r+n)*3/4-n}function eu(e,t,r){return(t+r)*3/4-r}function tu(e){var t,r=ri(e),n=r[0],a=r[1],s=new Qc(eu(e,n,a)),i=0,o=a>0?n-4:n,c;for(c=0;c<o;c+=4)t=ye[e.charCodeAt(c)]<<18|ye[e.charCodeAt(c+1)]<<12|ye[e.charCodeAt(c+2)]<<6|ye[e.charCodeAt(c+3)],s[i++]=t>>16&255,s[i++]=t>>8&255,s[i++]=t&255;return a===2&&(t=ye[e.charCodeAt(c)]<<2|ye[e.charCodeAt(c+1)]>>4,s[i++]=t&255),a===1&&(t=ye[e.charCodeAt(c)]<<10|ye[e.charCodeAt(c+1)]<<4|ye[e.charCodeAt(c+2)]>>2,s[i++]=t>>8&255,s[i++]=t&255),s}function ru(e){return Ne[e>>18&63]+Ne[e>>12&63]+Ne[e>>6&63]+Ne[e&63]}function nu(e,t,r){for(var n,a=[],s=t;s<r;s+=3)n=(e[s]<<16&16711680)+(e[s+1]<<8&65280)+(e[s+2]&255),a.push(ru(n));return a.join("")}function au(e){for(var t,r=e.length,n=r%3,a=[],s=16383,i=0,o=r-n;i<o;i+=s)a.push(nu(e,i,i+s>o?o:i+s));return n===1?(t=e[r-1],a.push(Ne[t>>2]+Ne[t<<4&63]+"==")):n===2&&(t=(e[r-2]<<8)+e[r-1],a.push(Ne[t>>10]+Ne[t>>4&63]+Ne[t<<2&63]+"=")),a.join("")}});async function ge(e,t){if(t===void 0)return e;let r;return Promise.race([e.catch(n=>{if(!t?.aborted)throw n}),new Promise((n,a)=>{r=()=>{a(ze(t))},t.addEventListener("abort",r,{once:!0}),t.aborted&&a(ze(t))})]).finally(()=>t.removeEventListener("abort",r))}function ze(e){return e?.reason instanceof Error?e.reason:typeof e?.reason=="string"?new Error(e.reason):new Error("Aborted")}function W(e){if(typeof e!="object"||e===null)return!1;let t=e;if(!("_zod"in t))return!1;let r=t._zod;return typeof r=="object"&&r!==null&&"def"in r}function G(e){if(typeof e!="object"||e===null)return!1;let t=e;if(!("_def"in t)||"_zod"in t)return!1;let r=t._def;return typeof r=="object"&&r!=null&&"typeName"in r}function Tu(e){return W(e)&&console.warn("[WARNING] Attempting to use Zod 4 schema in a context where Zod 3 schema is expected. This may cause unexpected behavior."),G(e)}function Tt(e){return!e||typeof e!="object"||Array.isArray(e)?!1:!!(W(e)||G(e))}function yi(e){return typeof e=="object"&&e!==null&&"_def"in e&&typeof e._def=="object"&&e._def!==null&&"typeName"in e._def&&e._def.typeName==="ZodLiteral"}function gi(e){return W(e)?typeof e=="object"&&e!==null&&"_zod"in e&&typeof e._zod=="object"&&e._zod!==null&&"def"in e._zod&&typeof e._zod.def=="object"&&e._zod.def!==null&&"type"in e._zod.def&&e._zod.def.type==="literal":!1}function Au(e){return!!(yi(e)||gi(e))}async function Su(e,t){if(W(e))try{return{success:!0,data:await cn(e,t)}}catch(r){return{success:!1,error:r}}if(G(e))return await e.safeParseAsync(t);throw new Error("Schema must be an instance of z3.ZodType or z4.$ZodType")}async function hr(e,t){if(W(e))return await cn(e,t);if(G(e))return await e.parseAsync(t);throw new Error("Schema must be an instance of z3.ZodType or z4.$ZodType")}function Eu(e,t){if(W(e))try{return{success:!0,data:fr(e,t)}}catch(r){return{success:!1,error:r}}if(G(e))return e.safeParse(t);throw new Error("Schema must be an instance of z3.ZodType or z4.$ZodType")}function Ou(e,t){if(W(e))return fr(e,t);if(G(e))return e.parse(t);throw new Error("Schema must be an instance of z3.ZodType or z4.$ZodType")}function Wa(e){if(W(e))return ne.get(e)?.description;if(G(e)||"description"in e&&typeof e.description=="string")return e.description}function $u(e){if(!Tt(e))return!1;if(G(e)){let t=e._def;if(t.typeName==="ZodObject"){let r=e;return!r.shape||Object.keys(r.shape).length===0}if(t.typeName==="ZodRecord")return!0}if(W(e)){let t=e._zod.def;if(t.type==="object"){let r=e;return!r.shape||Object.keys(r.shape).length===0}if(t.type==="record")return!0}return typeof e=="object"&&e!==null&&!("shape"in e)}function mr(e){return Tt(e)?G(e)?e._def.typeName==="ZodString":W(e)?e._zod.def.type==="string":!1:!1}function fn(e){return typeof e=="object"&&e!==null&&"_def"in e&&typeof e._def=="object"&&e._def!==null&&"typeName"in e._def&&e._def.typeName==="ZodObject"}function Te(e){return W(e)?typeof e=="object"&&e!==null&&"_zod"in e&&typeof e._zod=="object"&&e._zod!==null&&"def"in e._zod&&typeof e._zod.def=="object"&&e._zod.def!==null&&"type"in e._zod.def&&e._zod.def.type==="object":!1}function pn(e){return W(e)?typeof e=="object"&&e!==null&&"_zod"in e&&typeof e._zod=="object"&&e._zod!==null&&"def"in e._zod&&typeof e._zod.def=="object"&&e._zod.def!==null&&"type"in e._zod.def&&e._zod.def.type==="array":!1}function _i(e){return W(e)?typeof e=="object"&&e!==null&&"_zod"in e&&typeof e._zod=="object"&&e._zod!==null&&"def"in e._zod&&typeof e._zod.def=="object"&&e._zod.def!==null&&"type"in e._zod.def&&e._zod.def.type==="optional":!1}function vi(e){return W(e)?typeof e=="object"&&e!==null&&"_zod"in e&&typeof e._zod=="object"&&e._zod!==null&&"def"in e._zod&&typeof e._zod.def=="object"&&e._zod.def!==null&&"type"in e._zod.def&&e._zod.def.type==="nullable":!1}function Iu(e){return!!(fn(e)||Te(e))}function Ua(e){if(G(e))return e.shape;if(W(e))return e._zod.def.shape;throw new Error("Schema must be an instance of z3.ZodObject or z4.$ZodObject")}function Nu(e,t){if(G(e))return e.extend(t);if(W(e))return on.extend(e,t);throw new Error("Schema must be an instance of z3.ZodObject or z4.$ZodObject")}function Ru(e){if(G(e))return e.partial();if(W(e))return on.partial(un,e,void 0);throw new Error("Schema must be an instance of z3.ZodObject or z4.$ZodObject")}function pr(e,t=!1){if(fn(e))return e.strict();if(Te(e)){let r=e._zod.def.shape;if(t)for(let[s,i]of Object.entries(e._zod.def.shape)){if(Te(i))r[s]=pr(i,t);else if(pn(i)){let c=i._zod.def.element;Te(c)&&(c=pr(c,t)),r[s]=ke(i,{...i._zod.def,element:c})}else r[s]=i;let o=ne.get(i);o&&ne.add(r[s],o)}let n=ke(e,{...e._zod.def,shape:r,catchall:Va(La)}),a=ne.get(e);return a&&ne.add(n,a),n}throw new Error("Schema must be an instance of z3.ZodObject or z4.$ZodObject")}function Ba(e,t=!1){if(fn(e))return e.passthrough();if(Te(e)){let r=e._zod.def.shape;if(t)for(let[s,i]of Object.entries(e._zod.def.shape)){if(Te(i))r[s]=Ba(i,t);else if(pn(i)){let c=i._zod.def.element;Te(c)&&(c=Ba(c,t)),r[s]=ke(i,{...i._zod.def,element:c})}else r[s]=i;let o=ne.get(i);o&&ne.add(r[s],o)}let n=ke(e,{...e._zod.def,shape:r,catchall:Fa(Za)}),a=ne.get(e);return a&&ne.add(n,a),n}throw new Error("Schema must be an instance of z3.ZodObject or z4.$ZodObject")}function Cu(e){if(G(e))try{let t=e.parse(void 0);return()=>t}catch{return}if(W(e))try{let t=fr(e,void 0);return()=>t}catch{return}}function bi(e){return G(e)&&"typeName"in e._def&&e._def.typeName==="ZodEffects"}function wi(e){return W(e)&&e._zod.def.type==="pipe"}function Ke(e,t,r){let n=r.get(e);if(n!==void 0)return n;if(G(e))return bi(e)?Ke(e._def.schema,t,r):e;if(W(e)){let a=e;if(wi(e)&&(a=Ke(e._zod.def.in,t,r)),t){if(Te(a)){let i={};for(let[o,c]of Object.entries(a._zod.def.shape))i[o]=Ke(c,t,r);a=ke(a,{...a._zod.def,shape:i})}else if(pn(a)){let i=Ke(a._zod.def.element,t,r);a=ke(a,{...a._zod.def,element:i})}else if(_i(a)){let i=Ke(a._zod.def.innerType,t,r);a=ke(a,{...a._zod.def,innerType:i})}else if(vi(a)){let i=Ke(a._zod.def.innerType,t,r);a=ke(a,{...a._zod.def,innerType:i})}}let s=ne.get(e);return s&&ne.add(a,s),r.set(e,a),a}throw new Error("Schema must be an instance of z3.ZodType or z4.$ZodType")}function qa(e,t=!1){return Ke(e,t,new WeakMap)}function Pu(e,t){if(G(e)){let r=Ua(e),n={};for(let[a,s]of Object.entries(r))t(a,s)?n[a]=s.optional():n[a]=s;return e.extend(n)}if(W(e)){let r=Ua(e),n={...e._zod.def.shape};for(let[i,o]of Object.entries(r))t(i,o)&&(n[i]=new un({type:"optional",innerType:o}));let a=ke(e,{...e._zod.def,shape:n}),s=ne.get(e);return s&&ne.add(a,s),a}throw new Error("Schema must be an instance of z3.ZodObject or z4.$ZodObject")}function Ja(e){return e instanceof Error&&(e.constructor.name==="ZodError"||e.constructor.name==="$ZodError")}var mn=Symbol("Let zodToJsonSchema decide on which parser to use"),hn={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"},yn=e=>typeof e=="string"?{...hn,name:e}:{...hn,...e};var gn=e=>{let t=yn(e),r=t.name!==void 0?[...t.basePath,t.definitionPath,t.name]:t.basePath;return{...t,flags:{hasReferencedOpenAiAnyType:!1},currentPath:r,propertyPath:void 0,seen:new Map(Object.entries(t.definitions).map(([n,a])=>[a._def,{def:a._def,path:[...t.basePath,t.definitionPath,n],jsonSchema:void 0}]))}};var Vt=(e,t)=>{let r=0;for(;r<e.length&&r<t.length&&e[r]===t[r];r++);return[(e.length-r).toString(),...t.slice(r)].join("/")};function V(e){if(e.target!=="openAi")return{};let t=[...e.basePath,e.definitionPath,e.openAiAnyTypeName];return e.flags.hasReferencedOpenAiAnyType=!0,{$ref:e.$refStrategy==="relative"?Vt(t,e.currentPath):t.join("/")}}function yr(e,t,r,n){n?.errorMessages&&r&&(e.errorMessage={...e.errorMessage,[t]:r})}function D(e,t,r,n,a){e[t]=r,yr(e,t,n,a)}var Oe={};hi(Oe,{BRAND:()=>Ji,DIRTY:()=>Ye,EMPTY_PATH:()=>Ai,INVALID:()=>A,NEVER:()=>Ro,OK:()=>X,ParseStatus:()=>Q,Schema:()=>P,ZodAny:()=>Fe,ZodArray:()=>je,ZodBigInt:()=>Xe,ZodBoolean:()=>et,ZodBranded:()=>Bt,ZodCatch:()=>dt,ZodDate:()=>tt,ZodDefault:()=>lt,ZodDiscriminatedUnion:()=>vr,ZodEffects:()=>he,ZodEnum:()=>ct,ZodError:()=>ae,ZodFirstPartyTypeKind:()=>h,ZodFunction:()=>wr,ZodIntersection:()=>st,ZodIssueCode:()=>p,ZodLazy:()=>it,ZodLiteral:()=>ot,ZodMap:()=>It,ZodNaN:()=>Rt,ZodNativeEnum:()=>ut,ZodNever:()=>_e,ZodNull:()=>nt,ZodNullable:()=>Ee,ZodNumber:()=>Qe,ZodObject:()=>se,ZodOptional:()=>fe,ZodParsedType:()=>_,ZodPipeline:()=>Wt,ZodPromise:()=>Ve,ZodReadonly:()=>ft,ZodRecord:()=>br,ZodSchema:()=>P,ZodSet:()=>Nt,ZodString:()=>Le,ZodSymbol:()=>Ot,ZodTransformer:()=>he,ZodTuple:()=>Se,ZodType:()=>P,ZodUndefined:()=>rt,ZodUnion:()=>at,ZodUnknown:()=>Me,ZodVoid:()=>$t,addIssueToContext:()=>m,any:()=>ro,array:()=>io,bigint:()=>Yi,boolean:()=>as,coerce:()=>No,custom:()=>ts,date:()=>Qi,datetimeRegex:()=>Xa,defaultErrorMap:()=>Ce,discriminatedUnion:()=>lo,effect:()=>ko,enum:()=>bo,function:()=>go,getErrorMap:()=>At,getParsedType:()=>Ae,instanceof:()=>Hi,intersection:()=>fo,isAborted:()=>gr,isAsync:()=>St,isDirty:()=>_r,isValid:()=>Ze,late:()=>Gi,lazy:()=>_o,literal:()=>vo,makeIssue:()=>Ut,map:()=>mo,nan:()=>Ki,nativeEnum:()=>wo,never:()=>ao,null:()=>to,nullable:()=>Ao,number:()=>ns,object:()=>oo,objectUtil:()=>_n,oboolean:()=>Io,onumber:()=>$o,optional:()=>To,ostring:()=>Oo,pipeline:()=>Eo,preprocess:()=>So,promise:()=>xo,quotelessJson:()=>xi,record:()=>ho,set:()=>yo,setErrorMap:()=>Ti,strictObject:()=>co,string:()=>rs,symbol:()=>Xi,transformer:()=>ko,tuple:()=>po,undefined:()=>eo,union:()=>uo,unknown:()=>no,util:()=>j,void:()=>so});var j;(function(e){e.assertEqual=a=>{};function t(a){}e.assertIs=t;function r(a){throw new Error}e.assertNever=r,e.arrayToEnum=a=>{let s={};for(let i of a)s[i]=i;return s},e.getValidEnumValues=a=>{let s=e.objectKeys(a).filter(o=>typeof a[a[o]]!="number"),i={};for(let o of s)i[o]=a[o];return e.objectValues(i)},e.objectValues=a=>e.objectKeys(a).map(function(s){return a[s]}),e.objectKeys=typeof Object.keys=="function"?a=>Object.keys(a):a=>{let s=[];for(let i in a)Object.prototype.hasOwnProperty.call(a,i)&&s.push(i);return s},e.find=(a,s)=>{for(let i of a)if(s(i))return i},e.isInteger=typeof Number.isInteger=="function"?a=>Number.isInteger(a):a=>typeof a=="number"&&Number.isFinite(a)&&Math.floor(a)===a;function n(a,s=" | "){return a.map(i=>typeof i=="string"?`'${i}'`:i).join(s)}e.joinValues=n,e.jsonStringifyReplacer=(a,s)=>typeof s=="bigint"?s.toString():s})(j||(j={}));var _n;(function(e){e.mergeShapes=(t,r)=>({...t,...r})})(_n||(_n={}));var _=j.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Ae=e=>{switch(typeof e){case"undefined":return _.undefined;case"string":return _.string;case"number":return Number.isNaN(e)?_.nan:_.number;case"boolean":return _.boolean;case"function":return _.function;case"bigint":return _.bigint;case"symbol":return _.symbol;case"object":return Array.isArray(e)?_.array:e===null?_.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?_.promise:typeof Map<"u"&&e instanceof Map?_.map:typeof Set<"u"&&e instanceof Set?_.set:typeof Date<"u"&&e instanceof Date?_.date:_.object;default:return _.unknown}};var p=j.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"]),xi=e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:"),ae=class e extends Error{get errors(){return this.issues}constructor(t){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=t}format(t){let r=t||function(s){return s.message},n={_errors:[]},a=s=>{for(let i of s.issues)if(i.code==="invalid_union")i.unionErrors.map(a);else if(i.code==="invalid_return_type")a(i.returnTypeError);else if(i.code==="invalid_arguments")a(i.argumentsError);else if(i.path.length===0)n._errors.push(r(i));else{let o=n,c=0;for(;c<i.path.length;){let u=i.path[c];c===i.path.length-1?(o[u]=o[u]||{_errors:[]},o[u]._errors.push(r(i))):o[u]=o[u]||{_errors:[]},o=o[u],c++}}};return a(this),n}static assert(t){if(!(t instanceof e))throw new Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,j.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=r=>r.message){let r=Object.create(null),n=[];for(let a of this.issues)if(a.path.length>0){let s=a.path[0];r[s]=r[s]||[],r[s].push(t(a))}else n.push(t(a));return{formErrors:n,fieldErrors:r}}get formErrors(){return this.flatten()}};ae.create=e=>new ae(e);var ki=(e,t)=>{let r;switch(e.code){case p.invalid_type:e.received===_.undefined?r="Required":r=`Expected ${e.expected}, received ${e.received}`;break;case p.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(e.expected,j.jsonStringifyReplacer)}`;break;case p.unrecognized_keys:r=`Unrecognized key(s) in object: ${j.joinValues(e.keys,", ")}`;break;case p.invalid_union:r="Invalid input";break;case p.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${j.joinValues(e.options)}`;break;case p.invalid_enum_value:r=`Invalid enum value. Expected ${j.joinValues(e.options)}, received '${e.received}'`;break;case p.invalid_arguments:r="Invalid function arguments";break;case p.invalid_return_type:r="Invalid function return type";break;case p.invalid_date:r="Invalid date";break;case p.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(r=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(r=`${r} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?r=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?r=`Invalid input: must end with "${e.validation.endsWith}"`:j.assertNever(e.validation):e.validation!=="regex"?r=`Invalid ${e.validation}`:r="Invalid";break;case p.too_small:e.type==="array"?r=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?r=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?r=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="bigint"?r=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?r=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:r="Invalid input";break;case p.too_big:e.type==="array"?r=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?r=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?r=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?r=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?r=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:r="Invalid input";break;case p.custom:r="Invalid input";break;case p.invalid_intersection_types:r="Intersection results could not be merged";break;case p.not_multiple_of:r=`Number must be a multiple of ${e.multipleOf}`;break;case p.not_finite:r="Number must be finite";break;default:r=t.defaultError,j.assertNever(e)}return{message:r}},Ce=ki;var Ga=Ce;function Ti(e){Ga=e}function At(){return Ga}var Ut=e=>{let{data:t,path:r,errorMaps:n,issueData:a}=e,s=[...r,...a.path||[]],i={...a,path:s};if(a.message!==void 0)return{...a,path:s,message:a.message};let o="",c=n.filter(u=>!!u).slice().reverse();for(let u of c)o=u(i,{data:t,defaultError:o}).message;return{...a,path:s,message:o}},Ai=[];function m(e,t){let r=At(),n=Ut({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,r,r===Ce?void 0:Ce].filter(a=>!!a)});e.common.issues.push(n)}var Q=class e{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,r){let n=[];for(let a of r){if(a.status==="aborted")return A;a.status==="dirty"&&t.dirty(),n.push(a.value)}return{status:t.value,value:n}}static async mergeObjectAsync(t,r){let n=[];for(let a of r){let s=await a.key,i=await a.value;n.push({key:s,value:i})}return e.mergeObjectSync(t,n)}static mergeObjectSync(t,r){let n={};for(let a of r){let{key:s,value:i}=a;if(s.status==="aborted"||i.status==="aborted")return A;s.status==="dirty"&&t.dirty(),i.status==="dirty"&&t.dirty(),s.value!=="__proto__"&&(typeof i.value<"u"||a.alwaysSet)&&(n[s.value]=i.value)}return{status:t.value,value:n}}},A=Object.freeze({status:"aborted"}),Ye=e=>({status:"dirty",value:e}),X=e=>({status:"valid",value:e}),gr=e=>e.status==="aborted",_r=e=>e.status==="dirty",Ze=e=>e.status==="valid",St=e=>typeof Promise<"u"&&e instanceof Promise;var k;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t?.message})(k||(k={}));var pe=class{constructor(t,r,n,a){this._cachedPath=[],this.parent=t,this.data=r,this._path=n,this._key=a}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}},Ha=(e,t)=>{if(Ze(t))return{success:!0,data:t.value};if(!e.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 ae(e.common.issues);return this._error=r,this._error}}};function C(e){if(!e)return{};let{errorMap:t,invalid_type_error:r,required_error:n,description:a}=e;if(t&&(r||n))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:a}:{errorMap:(i,o)=>{let{message:c}=e;return i.code==="invalid_enum_value"?{message:c??o.defaultError}:typeof o.data>"u"?{message:c??n??o.defaultError}:i.code!=="invalid_type"?{message:o.defaultError}:{message:c??r??o.defaultError}},description:a}}var P=class{get description(){return this._def.description}_getType(t){return Ae(t.data)}_getOrReturnCtx(t,r){return r||{common:t.parent.common,data:t.data,parsedType:Ae(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new Q,ctx:{common:t.parent.common,data:t.data,parsedType:Ae(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){let r=this._parse(t);if(St(r))throw new Error("Synchronous parse encountered promise.");return r}_parseAsync(t){let r=this._parse(t);return Promise.resolve(r)}parse(t,r){let n=this.safeParse(t,r);if(n.success)return n.data;throw n.error}safeParse(t,r){let n={common:{issues:[],async:r?.async??!1,contextualErrorMap:r?.errorMap},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Ae(t)},a=this._parseSync({data:t,path:n.path,parent:n});return Ha(n,a)}"~validate"(t){let r={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Ae(t)};if(!this["~standard"].async)try{let n=this._parseSync({data:t,path:[],parent:r});return Ze(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:t,path:[],parent:r}).then(n=>Ze(n)?{value:n.value}:{issues:r.common.issues})}async parseAsync(t,r){let n=await this.safeParseAsync(t,r);if(n.success)return n.data;throw n.error}async safeParseAsync(t,r){let n={common:{issues:[],contextualErrorMap:r?.errorMap,async:!0},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Ae(t)},a=this._parse({data:t,path:n.path,parent:n}),s=await(St(a)?a:Promise.resolve(a));return Ha(n,s)}refine(t,r){let n=a=>typeof r=="string"||typeof r>"u"?{message:r}:typeof r=="function"?r(a):r;return this._refinement((a,s)=>{let i=t(a),o=()=>s.addIssue({code:p.custom,...n(a)});return typeof Promise<"u"&&i instanceof Promise?i.then(c=>c?!0:(o(),!1)):i?!0:(o(),!1)})}refinement(t,r){return this._refinement((n,a)=>t(n)?!0:(a.addIssue(typeof r=="function"?r(n,a):r),!1))}_refinement(t){return new he({schema:this,typeName:h.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}constructor(t){this.spa=this.safeParseAsync,this._def=t,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 fe.create(this,this._def)}nullable(){return Ee.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return je.create(this)}promise(){return Ve.create(this,this._def)}or(t){return at.create([this,t],this._def)}and(t){return st.create(this,t,this._def)}transform(t){return new he({...C(this._def),schema:this,typeName:h.ZodEffects,effect:{type:"transform",transform:t}})}default(t){let r=typeof t=="function"?t:()=>t;return new lt({...C(this._def),innerType:this,defaultValue:r,typeName:h.ZodDefault})}brand(){return new Bt({typeName:h.ZodBranded,type:this,...C(this._def)})}catch(t){let r=typeof t=="function"?t:()=>t;return new dt({...C(this._def),innerType:this,catchValue:r,typeName:h.ZodCatch})}describe(t){let r=this.constructor;return new r({...this._def,description:t})}pipe(t){return Wt.create(this,t)}readonly(){return ft.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},Si=/^c[^\s-]{8,}$/i,Ei=/^[0-9a-z]+$/,Oi=/^[0-9A-HJKMNP-TV-Z]{26}$/i,$i=/^[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,Ii=/^[a-z0-9_-]{21}$/i,Ni=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,Ri=/^[-+]?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)?)??$/,Ci=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Pi="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",vn,Mi=/^(?:(?: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])$/,ji=/^(?:(?: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])$/,Di=/^(([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]))$/,zi=/^(([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])$/,Zi=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,Li=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,Ya="((\\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])))",Fi=new RegExp(`^${Ya}$`);function Qa(e){let t="[0-5]\\d";e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision==null&&(t=`${t}(\\.\\d+)?`);let r=e.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${t})${r}`}function Vi(e){return new RegExp(`^${Qa(e)}$`)}function Xa(e){let t=`${Ya}T${Qa(e)}`,r=[];return r.push(e.local?"Z?":"Z"),e.offset&&r.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${r.join("|")})`,new RegExp(`^${t}$`)}function Ui(e,t){return!!((t==="v4"||!t)&&Mi.test(e)||(t==="v6"||!t)&&Di.test(e))}function Bi(e,t){if(!Ni.test(e))return!1;try{let[r]=e.split(".");if(!r)return!1;let n=r.replace(/-/g,"+").replace(/_/g,"/").padEnd(r.length+(4-r.length%4)%4,"="),a=JSON.parse(atob(n));return!(typeof a!="object"||a===null||"typ"in a&&a?.typ!=="JWT"||!a.alg||t&&a.alg!==t)}catch{return!1}}function Wi(e,t){return!!((t==="v4"||!t)&&ji.test(e)||(t==="v6"||!t)&&zi.test(e))}var Le=class e extends P{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==_.string){let s=this._getOrReturnCtx(t);return m(s,{code:p.invalid_type,expected:_.string,received:s.parsedType}),A}let n=new Q,a;for(let s of this._def.checks)if(s.kind==="min")t.data.length<s.value&&(a=this._getOrReturnCtx(t,a),m(a,{code:p.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),n.dirty());else if(s.kind==="max")t.data.length>s.value&&(a=this._getOrReturnCtx(t,a),m(a,{code:p.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),n.dirty());else if(s.kind==="length"){let i=t.data.length>s.value,o=t.data.length<s.value;(i||o)&&(a=this._getOrReturnCtx(t,a),i?m(a,{code:p.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}):o&&m(a,{code:p.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}),n.dirty())}else if(s.kind==="email")Ci.test(t.data)||(a=this._getOrReturnCtx(t,a),m(a,{validation:"email",code:p.invalid_string,message:s.message}),n.dirty());else if(s.kind==="emoji")vn||(vn=new RegExp(Pi,"u")),vn.test(t.data)||(a=this._getOrReturnCtx(t,a),m(a,{validation:"emoji",code:p.invalid_string,message:s.message}),n.dirty());else if(s.kind==="uuid")$i.test(t.data)||(a=this._getOrReturnCtx(t,a),m(a,{validation:"uuid",code:p.invalid_string,message:s.message}),n.dirty());else if(s.kind==="nanoid")Ii.test(t.data)||(a=this._getOrReturnCtx(t,a),m(a,{validation:"nanoid",code:p.invalid_string,message:s.message}),n.dirty());else if(s.kind==="cuid")Si.test(t.data)||(a=this._getOrReturnCtx(t,a),m(a,{validation:"cuid",code:p.invalid_string,message:s.message}),n.dirty());else if(s.kind==="cuid2")Ei.test(t.data)||(a=this._getOrReturnCtx(t,a),m(a,{validation:"cuid2",code:p.invalid_string,message:s.message}),n.dirty());else if(s.kind==="ulid")Oi.test(t.data)||(a=this._getOrReturnCtx(t,a),m(a,{validation:"ulid",code:p.invalid_string,message:s.message}),n.dirty());else if(s.kind==="url")try{new URL(t.data)}catch{a=this._getOrReturnCtx(t,a),m(a,{validation:"url",code:p.invalid_string,message:s.message}),n.dirty()}else s.kind==="regex"?(s.regex.lastIndex=0,s.regex.test(t.data)||(a=this._getOrReturnCtx(t,a),m(a,{validation:"regex",code:p.invalid_string,message:s.message}),n.dirty())):s.kind==="trim"?t.data=t.data.trim():s.kind==="includes"?t.data.includes(s.value,s.position)||(a=this._getOrReturnCtx(t,a),m(a,{code:p.invalid_string,validation:{includes:s.value,position:s.position},message:s.message}),n.dirty()):s.kind==="toLowerCase"?t.data=t.data.toLowerCase():s.kind==="toUpperCase"?t.data=t.data.toUpperCase():s.kind==="startsWith"?t.data.startsWith(s.value)||(a=this._getOrReturnCtx(t,a),m(a,{code:p.invalid_string,validation:{startsWith:s.value},message:s.message}),n.dirty()):s.kind==="endsWith"?t.data.endsWith(s.value)||(a=this._getOrReturnCtx(t,a),m(a,{code:p.invalid_string,validation:{endsWith:s.value},message:s.message}),n.dirty()):s.kind==="datetime"?Xa(s).test(t.data)||(a=this._getOrReturnCtx(t,a),m(a,{code:p.invalid_string,validation:"datetime",message:s.message}),n.dirty()):s.kind==="date"?Fi.test(t.data)||(a=this._getOrReturnCtx(t,a),m(a,{code:p.invalid_string,validation:"date",message:s.message}),n.dirty()):s.kind==="time"?Vi(s).test(t.data)||(a=this._getOrReturnCtx(t,a),m(a,{code:p.invalid_string,validation:"time",message:s.message}),n.dirty()):s.kind==="duration"?Ri.test(t.data)||(a=this._getOrReturnCtx(t,a),m(a,{validation:"duration",code:p.invalid_string,message:s.message}),n.dirty()):s.kind==="ip"?Ui(t.data,s.version)||(a=this._getOrReturnCtx(t,a),m(a,{validation:"ip",code:p.invalid_string,message:s.message}),n.dirty()):s.kind==="jwt"?Bi(t.data,s.alg)||(a=this._getOrReturnCtx(t,a),m(a,{validation:"jwt",code:p.invalid_string,message:s.message}),n.dirty()):s.kind==="cidr"?Wi(t.data,s.version)||(a=this._getOrReturnCtx(t,a),m(a,{validation:"cidr",code:p.invalid_string,message:s.message}),n.dirty()):s.kind==="base64"?Zi.test(t.data)||(a=this._getOrReturnCtx(t,a),m(a,{validation:"base64",code:p.invalid_string,message:s.message}),n.dirty()):s.kind==="base64url"?Li.test(t.data)||(a=this._getOrReturnCtx(t,a),m(a,{validation:"base64url",code:p.invalid_string,message:s.message}),n.dirty()):j.assertNever(s);return{status:n.value,value:t.data}}_regex(t,r,n){return this.refinement(a=>t.test(a),{validation:r,code:p.invalid_string,...k.errToObj(n)})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...k.errToObj(t)})}url(t){return this._addCheck({kind:"url",...k.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...k.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...k.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...k.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...k.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...k.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...k.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...k.errToObj(t)})}base64url(t){return this._addCheck({kind:"base64url",...k.errToObj(t)})}jwt(t){return this._addCheck({kind:"jwt",...k.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...k.errToObj(t)})}cidr(t){return this._addCheck({kind:"cidr",...k.errToObj(t)})}datetime(t){return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:t}):this._addCheck({kind:"datetime",precision:typeof t?.precision>"u"?null:t?.precision,offset:t?.offset??!1,local:t?.local??!1,...k.errToObj(t?.message)})}date(t){return this._addCheck({kind:"date",message:t})}time(t){return typeof t=="string"?this._addCheck({kind:"time",precision:null,message:t}):this._addCheck({kind:"time",precision:typeof t?.precision>"u"?null:t?.precision,...k.errToObj(t?.message)})}duration(t){return this._addCheck({kind:"duration",...k.errToObj(t)})}regex(t,r){return this._addCheck({kind:"regex",regex:t,...k.errToObj(r)})}includes(t,r){return this._addCheck({kind:"includes",value:t,position:r?.position,...k.errToObj(r?.message)})}startsWith(t,r){return this._addCheck({kind:"startsWith",value:t,...k.errToObj(r)})}endsWith(t,r){return this._addCheck({kind:"endsWith",value:t,...k.errToObj(r)})}min(t,r){return this._addCheck({kind:"min",value:t,...k.errToObj(r)})}max(t,r){return this._addCheck({kind:"max",value:t,...k.errToObj(r)})}length(t,r){return this._addCheck({kind:"length",value:t,...k.errToObj(r)})}nonempty(t){return this.min(1,k.errToObj(t))}trim(){return new e({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new e({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new e({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(t=>t.kind==="datetime")}get isDate(){return!!this._def.checks.find(t=>t.kind==="date")}get isTime(){return!!this._def.checks.find(t=>t.kind==="time")}get isDuration(){return!!this._def.checks.find(t=>t.kind==="duration")}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find(t=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(t=>t.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(t=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find(t=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find(t=>t.kind==="ip")}get isCIDR(){return!!this._def.checks.find(t=>t.kind==="cidr")}get isBase64(){return!!this._def.checks.find(t=>t.kind==="base64")}get isBase64url(){return!!this._def.checks.find(t=>t.kind==="base64url")}get minLength(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxLength(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}};Le.create=e=>new Le({checks:[],typeName:h.ZodString,coerce:e?.coerce??!1,...C(e)});function qi(e,t){let r=(e.toString().split(".")[1]||"").length,n=(t.toString().split(".")[1]||"").length,a=r>n?r:n,s=Number.parseInt(e.toFixed(a).replace(".","")),i=Number.parseInt(t.toFixed(a).replace(".",""));return s%i/10**a}var Qe=class e extends P{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==_.number){let s=this._getOrReturnCtx(t);return m(s,{code:p.invalid_type,expected:_.number,received:s.parsedType}),A}let n,a=new Q;for(let s of this._def.checks)s.kind==="int"?j.isInteger(t.data)||(n=this._getOrReturnCtx(t,n),m(n,{code:p.invalid_type,expected:"integer",received:"float",message:s.message}),a.dirty()):s.kind==="min"?(s.inclusive?t.data<s.value:t.data<=s.value)&&(n=this._getOrReturnCtx(t,n),m(n,{code:p.too_small,minimum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),a.dirty()):s.kind==="max"?(s.inclusive?t.data>s.value:t.data>=s.value)&&(n=this._getOrReturnCtx(t,n),m(n,{code:p.too_big,maximum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),a.dirty()):s.kind==="multipleOf"?qi(t.data,s.value)!==0&&(n=this._getOrReturnCtx(t,n),m(n,{code:p.not_multiple_of,multipleOf:s.value,message:s.message}),a.dirty()):s.kind==="finite"?Number.isFinite(t.data)||(n=this._getOrReturnCtx(t,n),m(n,{code:p.not_finite,message:s.message}),a.dirty()):j.assertNever(s);return{status:a.value,value:t.data}}gte(t,r){return this.setLimit("min",t,!0,k.toString(r))}gt(t,r){return this.setLimit("min",t,!1,k.toString(r))}lte(t,r){return this.setLimit("max",t,!0,k.toString(r))}lt(t,r){return this.setLimit("max",t,!1,k.toString(r))}setLimit(t,r,n,a){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:n,message:k.toString(a)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:k.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:k.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:k.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:k.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:k.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:k.toString(r)})}finite(t){return this._addCheck({kind:"finite",message:k.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:k.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:k.toString(t)})}get minValue(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxValue(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}get isInt(){return!!this._def.checks.find(t=>t.kind==="int"||t.kind==="multipleOf"&&j.isInteger(t.value))}get isFinite(){let t=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"&&(t===null||n.value<t)&&(t=n.value)}return Number.isFinite(r)&&Number.isFinite(t)}};Qe.create=e=>new Qe({checks:[],typeName:h.ZodNumber,coerce:e?.coerce||!1,...C(e)});var Xe=class e extends P{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce)try{t.data=BigInt(t.data)}catch{return this._getInvalidInput(t)}if(this._getType(t)!==_.bigint)return this._getInvalidInput(t);let n,a=new Q;for(let s of this._def.checks)s.kind==="min"?(s.inclusive?t.data<s.value:t.data<=s.value)&&(n=this._getOrReturnCtx(t,n),m(n,{code:p.too_small,type:"bigint",minimum:s.value,inclusive:s.inclusive,message:s.message}),a.dirty()):s.kind==="max"?(s.inclusive?t.data>s.value:t.data>=s.value)&&(n=this._getOrReturnCtx(t,n),m(n,{code:p.too_big,type:"bigint",maximum:s.value,inclusive:s.inclusive,message:s.message}),a.dirty()):s.kind==="multipleOf"?t.data%s.value!==BigInt(0)&&(n=this._getOrReturnCtx(t,n),m(n,{code:p.not_multiple_of,multipleOf:s.value,message:s.message}),a.dirty()):j.assertNever(s);return{status:a.value,value:t.data}}_getInvalidInput(t){let r=this._getOrReturnCtx(t);return m(r,{code:p.invalid_type,expected:_.bigint,received:r.parsedType}),A}gte(t,r){return this.setLimit("min",t,!0,k.toString(r))}gt(t,r){return this.setLimit("min",t,!1,k.toString(r))}lte(t,r){return this.setLimit("max",t,!0,k.toString(r))}lt(t,r){return this.setLimit("max",t,!1,k.toString(r))}setLimit(t,r,n,a){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:n,message:k.toString(a)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:k.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:k.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:k.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:k.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:k.toString(r)})}get minValue(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxValue(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}};Xe.create=e=>new Xe({checks:[],typeName:h.ZodBigInt,coerce:e?.coerce??!1,...C(e)});var et=class extends P{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==_.boolean){let n=this._getOrReturnCtx(t);return m(n,{code:p.invalid_type,expected:_.boolean,received:n.parsedType}),A}return X(t.data)}};et.create=e=>new et({typeName:h.ZodBoolean,coerce:e?.coerce||!1,...C(e)});var tt=class e extends P{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==_.date){let s=this._getOrReturnCtx(t);return m(s,{code:p.invalid_type,expected:_.date,received:s.parsedType}),A}if(Number.isNaN(t.data.getTime())){let s=this._getOrReturnCtx(t);return m(s,{code:p.invalid_date}),A}let n=new Q,a;for(let s of this._def.checks)s.kind==="min"?t.data.getTime()<s.value&&(a=this._getOrReturnCtx(t,a),m(a,{code:p.too_small,message:s.message,inclusive:!0,exact:!1,minimum:s.value,type:"date"}),n.dirty()):s.kind==="max"?t.data.getTime()>s.value&&(a=this._getOrReturnCtx(t,a),m(a,{code:p.too_big,message:s.message,inclusive:!0,exact:!1,maximum:s.value,type:"date"}),n.dirty()):j.assertNever(s);return{status:n.value,value:new Date(t.data.getTime())}}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}min(t,r){return this._addCheck({kind:"min",value:t.getTime(),message:k.toString(r)})}max(t,r){return this._addCheck({kind:"max",value:t.getTime(),message:k.toString(r)})}get minDate(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t!=null?new Date(t):null}};tt.create=e=>new tt({checks:[],coerce:e?.coerce||!1,typeName:h.ZodDate,...C(e)});var Ot=class extends P{_parse(t){if(this._getType(t)!==_.symbol){let n=this._getOrReturnCtx(t);return m(n,{code:p.invalid_type,expected:_.symbol,received:n.parsedType}),A}return X(t.data)}};Ot.create=e=>new Ot({typeName:h.ZodSymbol,...C(e)});var rt=class extends P{_parse(t){if(this._getType(t)!==_.undefined){let n=this._getOrReturnCtx(t);return m(n,{code:p.invalid_type,expected:_.undefined,received:n.parsedType}),A}return X(t.data)}};rt.create=e=>new rt({typeName:h.ZodUndefined,...C(e)});var nt=class extends P{_parse(t){if(this._getType(t)!==_.null){let n=this._getOrReturnCtx(t);return m(n,{code:p.invalid_type,expected:_.null,received:n.parsedType}),A}return X(t.data)}};nt.create=e=>new nt({typeName:h.ZodNull,...C(e)});var Fe=class extends P{constructor(){super(...arguments),this._any=!0}_parse(t){return X(t.data)}};Fe.create=e=>new Fe({typeName:h.ZodAny,...C(e)});var Me=class extends P{constructor(){super(...arguments),this._unknown=!0}_parse(t){return X(t.data)}};Me.create=e=>new Me({typeName:h.ZodUnknown,...C(e)});var _e=class extends P{_parse(t){let r=this._getOrReturnCtx(t);return m(r,{code:p.invalid_type,expected:_.never,received:r.parsedType}),A}};_e.create=e=>new _e({typeName:h.ZodNever,...C(e)});var $t=class extends P{_parse(t){if(this._getType(t)!==_.undefined){let n=this._getOrReturnCtx(t);return m(n,{code:p.invalid_type,expected:_.void,received:n.parsedType}),A}return X(t.data)}};$t.create=e=>new $t({typeName:h.ZodVoid,...C(e)});var je=class e extends P{_parse(t){let{ctx:r,status:n}=this._processInputParams(t),a=this._def;if(r.parsedType!==_.array)return m(r,{code:p.invalid_type,expected:_.array,received:r.parsedType}),A;if(a.exactLength!==null){let i=r.data.length>a.exactLength.value,o=r.data.length<a.exactLength.value;(i||o)&&(m(r,{code:i?p.too_big:p.too_small,minimum:o?a.exactLength.value:void 0,maximum:i?a.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:a.exactLength.message}),n.dirty())}if(a.minLength!==null&&r.data.length<a.minLength.value&&(m(r,{code:p.too_small,minimum:a.minLength.value,type:"array",inclusive:!0,exact:!1,message:a.minLength.message}),n.dirty()),a.maxLength!==null&&r.data.length>a.maxLength.value&&(m(r,{code:p.too_big,maximum:a.maxLength.value,type:"array",inclusive:!0,exact:!1,message:a.maxLength.message}),n.dirty()),r.common.async)return Promise.all([...r.data].map((i,o)=>a.type._parseAsync(new pe(r,i,r.path,o)))).then(i=>Q.mergeArray(n,i));let s=[...r.data].map((i,o)=>a.type._parseSync(new pe(r,i,r.path,o)));return Q.mergeArray(n,s)}get element(){return this._def.type}min(t,r){return new e({...this._def,minLength:{value:t,message:k.toString(r)}})}max(t,r){return new e({...this._def,maxLength:{value:t,message:k.toString(r)}})}length(t,r){return new e({...this._def,exactLength:{value:t,message:k.toString(r)}})}nonempty(t){return this.min(1,t)}};je.create=(e,t)=>new je({type:e,minLength:null,maxLength:null,exactLength:null,typeName:h.ZodArray,...C(t)});function Et(e){if(e instanceof se){let t={};for(let r in e.shape){let n=e.shape[r];t[r]=fe.create(Et(n))}return new se({...e._def,shape:()=>t})}else return e instanceof je?new je({...e._def,type:Et(e.element)}):e instanceof fe?fe.create(Et(e.unwrap())):e instanceof Ee?Ee.create(Et(e.unwrap())):e instanceof Se?Se.create(e.items.map(t=>Et(t))):e}var se=class e extends P{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let t=this._def.shape(),r=j.objectKeys(t);return this._cached={shape:t,keys:r},this._cached}_parse(t){if(this._getType(t)!==_.object){let u=this._getOrReturnCtx(t);return m(u,{code:p.invalid_type,expected:_.object,received:u.parsedType}),A}let{status:n,ctx:a}=this._processInputParams(t),{shape:s,keys:i}=this._getCached(),o=[];if(!(this._def.catchall instanceof _e&&this._def.unknownKeys==="strip"))for(let u in a.data)i.includes(u)||o.push(u);let c=[];for(let u of i){let l=s[u],d=a.data[u];c.push({key:{status:"valid",value:u},value:l._parse(new pe(a,d,a.path,u)),alwaysSet:u in a.data})}if(this._def.catchall instanceof _e){let u=this._def.unknownKeys;if(u==="passthrough")for(let l of o)c.push({key:{status:"valid",value:l},value:{status:"valid",value:a.data[l]}});else if(u==="strict")o.length>0&&(m(a,{code:p.unrecognized_keys,keys:o}),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 o){let d=a.data[l];c.push({key:{status:"valid",value:l},value:u._parse(new pe(a,d,a.path,l)),alwaysSet:l in a.data})}}return a.common.async?Promise.resolve().then(async()=>{let u=[];for(let l of c){let d=await l.key,v=await l.value;u.push({key:d,value:v,alwaysSet:l.alwaysSet})}return u}).then(u=>Q.mergeObjectSync(n,u)):Q.mergeObjectSync(n,c)}get shape(){return this._def.shape()}strict(t){return k.errToObj,new e({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(r,n)=>{let a=this._def.errorMap?.(r,n).message??n.defaultError;return r.code==="unrecognized_keys"?{message:k.errToObj(t).message??a}:{message:a}}}:{}})}strip(){return new e({...this._def,unknownKeys:"strip"})}passthrough(){return new e({...this._def,unknownKeys:"passthrough"})}extend(t){return new e({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new e({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:h.ZodObject})}setKey(t,r){return this.augment({[t]:r})}catchall(t){return new e({...this._def,catchall:t})}pick(t){let r={};for(let n of j.objectKeys(t))t[n]&&this.shape[n]&&(r[n]=this.shape[n]);return new e({...this._def,shape:()=>r})}omit(t){let r={};for(let n of j.objectKeys(this.shape))t[n]||(r[n]=this.shape[n]);return new e({...this._def,shape:()=>r})}deepPartial(){return Et(this)}partial(t){let r={};for(let n of j.objectKeys(this.shape)){let a=this.shape[n];t&&!t[n]?r[n]=a:r[n]=a.optional()}return new e({...this._def,shape:()=>r})}required(t){let r={};for(let n of j.objectKeys(this.shape))if(t&&!t[n])r[n]=this.shape[n];else{let s=this.shape[n];for(;s instanceof fe;)s=s._def.innerType;r[n]=s}return new e({...this._def,shape:()=>r})}keyof(){return es(j.objectKeys(this.shape))}};se.create=(e,t)=>new se({shape:()=>e,unknownKeys:"strip",catchall:_e.create(),typeName:h.ZodObject,...C(t)});se.strictCreate=(e,t)=>new se({shape:()=>e,unknownKeys:"strict",catchall:_e.create(),typeName:h.ZodObject,...C(t)});se.lazycreate=(e,t)=>new se({shape:e,unknownKeys:"strip",catchall:_e.create(),typeName:h.ZodObject,...C(t)});var at=class extends P{_parse(t){let{ctx:r}=this._processInputParams(t),n=this._def.options;function a(s){for(let o of s)if(o.result.status==="valid")return o.result;for(let o of s)if(o.result.status==="dirty")return r.common.issues.push(...o.ctx.common.issues),o.result;let i=s.map(o=>new ae(o.ctx.common.issues));return m(r,{code:p.invalid_union,unionErrors:i}),A}if(r.common.async)return Promise.all(n.map(async s=>{let i={...r,common:{...r.common,issues:[]},parent:null};return{result:await s._parseAsync({data:r.data,path:r.path,parent:i}),ctx:i}})).then(a);{let s,i=[];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"&&!s&&(s={result:l,ctx:u}),u.common.issues.length&&i.push(u.common.issues)}if(s)return r.common.issues.push(...s.ctx.common.issues),s.result;let o=i.map(c=>new ae(c));return m(r,{code:p.invalid_union,unionErrors:o}),A}}get options(){return this._def.options}};at.create=(e,t)=>new at({options:e,typeName:h.ZodUnion,...C(t)});var Pe=e=>e instanceof it?Pe(e.schema):e instanceof he?Pe(e.innerType()):e instanceof ot?[e.value]:e instanceof ct?e.options:e instanceof ut?j.objectValues(e.enum):e instanceof lt?Pe(e._def.innerType):e instanceof rt?[void 0]:e instanceof nt?[null]:e instanceof fe?[void 0,...Pe(e.unwrap())]:e instanceof Ee?[null,...Pe(e.unwrap())]:e instanceof Bt||e instanceof ft?Pe(e.unwrap()):e instanceof dt?Pe(e._def.innerType):[],vr=class e extends P{_parse(t){let{ctx:r}=this._processInputParams(t);if(r.parsedType!==_.object)return m(r,{code:p.invalid_type,expected:_.object,received:r.parsedType}),A;let n=this.discriminator,a=r.data[n],s=this.optionsMap.get(a);return s?r.common.async?s._parseAsync({data:r.data,path:r.path,parent:r}):s._parseSync({data:r.data,path:r.path,parent:r}):(m(r,{code:p.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),A)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,r,n){let a=new Map;for(let s of r){let i=Pe(s.shape[t]);if(!i.length)throw new Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(let o of i){if(a.has(o))throw new Error(`Discriminator property ${String(t)} has duplicate value ${String(o)}`);a.set(o,s)}}return new e({typeName:h.ZodDiscriminatedUnion,discriminator:t,options:r,optionsMap:a,...C(n)})}};function bn(e,t){let r=Ae(e),n=Ae(t);if(e===t)return{valid:!0,data:e};if(r===_.object&&n===_.object){let a=j.objectKeys(t),s=j.objectKeys(e).filter(o=>a.indexOf(o)!==-1),i={...e,...t};for(let o of s){let c=bn(e[o],t[o]);if(!c.valid)return{valid:!1};i[o]=c.data}return{valid:!0,data:i}}else if(r===_.array&&n===_.array){if(e.length!==t.length)return{valid:!1};let a=[];for(let s=0;s<e.length;s++){let i=e[s],o=t[s],c=bn(i,o);if(!c.valid)return{valid:!1};a.push(c.data)}return{valid:!0,data:a}}else return r===_.date&&n===_.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}var st=class extends P{_parse(t){let{status:r,ctx:n}=this._processInputParams(t),a=(s,i)=>{if(gr(s)||gr(i))return A;let o=bn(s.value,i.value);return o.valid?((_r(s)||_r(i))&&r.dirty(),{status:r.value,value:o.data}):(m(n,{code:p.invalid_intersection_types}),A)};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(([s,i])=>a(s,i)):a(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}};st.create=(e,t,r)=>new st({left:e,right:t,typeName:h.ZodIntersection,...C(r)});var Se=class e extends P{_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==_.array)return m(n,{code:p.invalid_type,expected:_.array,received:n.parsedType}),A;if(n.data.length<this._def.items.length)return m(n,{code:p.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),A;!this._def.rest&&n.data.length>this._def.items.length&&(m(n,{code:p.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());let s=[...n.data].map((i,o)=>{let c=this._def.items[o]||this._def.rest;return c?c._parse(new pe(n,i,n.path,o)):null}).filter(i=>!!i);return n.common.async?Promise.all(s).then(i=>Q.mergeArray(r,i)):Q.mergeArray(r,s)}get items(){return this._def.items}rest(t){return new e({...this._def,rest:t})}};Se.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Se({items:e,typeName:h.ZodTuple,rest:null,...C(t)})};var br=class e extends P{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==_.object)return m(n,{code:p.invalid_type,expected:_.object,received:n.parsedType}),A;let a=[],s=this._def.keyType,i=this._def.valueType;for(let o in n.data)a.push({key:s._parse(new pe(n,o,n.path,o)),value:i._parse(new pe(n,n.data[o],n.path,o)),alwaysSet:o in n.data});return n.common.async?Q.mergeObjectAsync(r,a):Q.mergeObjectSync(r,a)}get element(){return this._def.valueType}static create(t,r,n){return r instanceof P?new e({keyType:t,valueType:r,typeName:h.ZodRecord,...C(n)}):new e({keyType:Le.create(),valueType:t,typeName:h.ZodRecord,...C(r)})}},It=class extends P{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==_.map)return m(n,{code:p.invalid_type,expected:_.map,received:n.parsedType}),A;let a=this._def.keyType,s=this._def.valueType,i=[...n.data.entries()].map(([o,c],u)=>({key:a._parse(new pe(n,o,n.path,[u,"key"])),value:s._parse(new pe(n,c,n.path,[u,"value"]))}));if(n.common.async){let o=new Map;return Promise.resolve().then(async()=>{for(let c of i){let u=await c.key,l=await c.value;if(u.status==="aborted"||l.status==="aborted")return A;(u.status==="dirty"||l.status==="dirty")&&r.dirty(),o.set(u.value,l.value)}return{status:r.value,value:o}})}else{let o=new Map;for(let c of i){let u=c.key,l=c.value;if(u.status==="aborted"||l.status==="aborted")return A;(u.status==="dirty"||l.status==="dirty")&&r.dirty(),o.set(u.value,l.value)}return{status:r.value,value:o}}}};It.create=(e,t,r)=>new It({valueType:t,keyType:e,typeName:h.ZodMap,...C(r)});var Nt=class e extends P{_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==_.set)return m(n,{code:p.invalid_type,expected:_.set,received:n.parsedType}),A;let a=this._def;a.minSize!==null&&n.data.size<a.minSize.value&&(m(n,{code:p.too_small,minimum:a.minSize.value,type:"set",inclusive:!0,exact:!1,message:a.minSize.message}),r.dirty()),a.maxSize!==null&&n.data.size>a.maxSize.value&&(m(n,{code:p.too_big,maximum:a.maxSize.value,type:"set",inclusive:!0,exact:!1,message:a.maxSize.message}),r.dirty());let s=this._def.valueType;function i(c){let u=new Set;for(let l of c){if(l.status==="aborted")return A;l.status==="dirty"&&r.dirty(),u.add(l.value)}return{status:r.value,value:u}}let o=[...n.data.values()].map((c,u)=>s._parse(new pe(n,c,n.path,u)));return n.common.async?Promise.all(o).then(c=>i(c)):i(o)}min(t,r){return new e({...this._def,minSize:{value:t,message:k.toString(r)}})}max(t,r){return new e({...this._def,maxSize:{value:t,message:k.toString(r)}})}size(t,r){return this.min(t,r).max(t,r)}nonempty(t){return this.min(1,t)}};Nt.create=(e,t)=>new Nt({valueType:e,minSize:null,maxSize:null,typeName:h.ZodSet,...C(t)});var wr=class e extends P{constructor(){super(...arguments),this.validate=this.implement}_parse(t){let{ctx:r}=this._processInputParams(t);if(r.parsedType!==_.function)return m(r,{code:p.invalid_type,expected:_.function,received:r.parsedType}),A;function n(o,c){return Ut({data:o,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,At(),Ce].filter(u=>!!u),issueData:{code:p.invalid_arguments,argumentsError:c}})}function a(o,c){return Ut({data:o,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,At(),Ce].filter(u=>!!u),issueData:{code:p.invalid_return_type,returnTypeError:c}})}let s={errorMap:r.common.contextualErrorMap},i=r.data;if(this._def.returns instanceof Ve){let o=this;return X(async function(...c){let u=new ae([]),l=await o._def.args.parseAsync(c,s).catch(f=>{throw u.addIssue(n(c,f)),u}),d=await Reflect.apply(i,this,l);return await o._def.returns._def.type.parseAsync(d,s).catch(f=>{throw u.addIssue(a(d,f)),u})})}else{let o=this;return X(function(...c){let u=o._def.args.safeParse(c,s);if(!u.success)throw new ae([n(c,u.error)]);let l=Reflect.apply(i,this,u.data),d=o._def.returns.safeParse(l,s);if(!d.success)throw new ae([a(l,d.error)]);return d.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new e({...this._def,args:Se.create(t).rest(Me.create())})}returns(t){return new e({...this._def,returns:t})}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,r,n){return new e({args:t||Se.create([]).rest(Me.create()),returns:r||Me.create(),typeName:h.ZodFunction,...C(n)})}},it=class extends P{get schema(){return this._def.getter()}_parse(t){let{ctx:r}=this._processInputParams(t);return this._def.getter()._parse({data:r.data,path:r.path,parent:r})}};it.create=(e,t)=>new it({getter:e,typeName:h.ZodLazy,...C(t)});var ot=class extends P{_parse(t){if(t.data!==this._def.value){let r=this._getOrReturnCtx(t);return m(r,{received:r.data,code:p.invalid_literal,expected:this._def.value}),A}return{status:"valid",value:t.data}}get value(){return this._def.value}};ot.create=(e,t)=>new ot({value:e,typeName:h.ZodLiteral,...C(t)});function es(e,t){return new ct({values:e,typeName:h.ZodEnum,...C(t)})}var ct=class e extends P{_parse(t){if(typeof t.data!="string"){let r=this._getOrReturnCtx(t),n=this._def.values;return m(r,{expected:j.joinValues(n),received:r.parsedType,code:p.invalid_type}),A}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(t.data)){let r=this._getOrReturnCtx(t),n=this._def.values;return m(r,{received:r.data,code:p.invalid_enum_value,options:n}),A}return X(t.data)}get options(){return this._def.values}get enum(){let t={};for(let r of this._def.values)t[r]=r;return t}get Values(){let t={};for(let r of this._def.values)t[r]=r;return t}get Enum(){let t={};for(let r of this._def.values)t[r]=r;return t}extract(t,r=this._def){return e.create(t,{...this._def,...r})}exclude(t,r=this._def){return e.create(this.options.filter(n=>!t.includes(n)),{...this._def,...r})}};ct.create=es;var ut=class extends P{_parse(t){let r=j.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(t);if(n.parsedType!==_.string&&n.parsedType!==_.number){let a=j.objectValues(r);return m(n,{expected:j.joinValues(a),received:n.parsedType,code:p.invalid_type}),A}if(this._cache||(this._cache=new Set(j.getValidEnumValues(this._def.values))),!this._cache.has(t.data)){let a=j.objectValues(r);return m(n,{received:n.data,code:p.invalid_enum_value,options:a}),A}return X(t.data)}get enum(){return this._def.values}};ut.create=(e,t)=>new ut({values:e,typeName:h.ZodNativeEnum,...C(t)});var Ve=class extends P{unwrap(){return this._def.type}_parse(t){let{ctx:r}=this._processInputParams(t);if(r.parsedType!==_.promise&&r.common.async===!1)return m(r,{code:p.invalid_type,expected:_.promise,received:r.parsedType}),A;let n=r.parsedType===_.promise?r.data:Promise.resolve(r.data);return X(n.then(a=>this._def.type.parseAsync(a,{path:r.path,errorMap:r.common.contextualErrorMap})))}};Ve.create=(e,t)=>new Ve({type:e,typeName:h.ZodPromise,...C(t)});var he=class extends P{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===h.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){let{status:r,ctx:n}=this._processInputParams(t),a=this._def.effect||null,s={addIssue:i=>{m(n,i),i.fatal?r.abort():r.dirty()},get path(){return n.path}};if(s.addIssue=s.addIssue.bind(s),a.type==="preprocess"){let i=a.transform(n.data,s);if(n.common.async)return Promise.resolve(i).then(async o=>{if(r.value==="aborted")return A;let c=await this._def.schema._parseAsync({data:o,path:n.path,parent:n});return c.status==="aborted"?A:c.status==="dirty"?Ye(c.value):r.value==="dirty"?Ye(c.value):c});{if(r.value==="aborted")return A;let o=this._def.schema._parseSync({data:i,path:n.path,parent:n});return o.status==="aborted"?A:o.status==="dirty"?Ye(o.value):r.value==="dirty"?Ye(o.value):o}}if(a.type==="refinement"){let i=o=>{let c=a.refinement(o,s);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 o};if(n.common.async===!1){let o=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return o.status==="aborted"?A:(o.status==="dirty"&&r.dirty(),i(o.value),{status:r.value,value:o.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(o=>o.status==="aborted"?A:(o.status==="dirty"&&r.dirty(),i(o.value).then(()=>({status:r.value,value:o.value}))))}if(a.type==="transform")if(n.common.async===!1){let i=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!Ze(i))return A;let o=a.transform(i.value,s);if(o instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:o}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(i=>Ze(i)?Promise.resolve(a.transform(i.value,s)).then(o=>({status:r.value,value:o})):A);j.assertNever(a)}};he.create=(e,t,r)=>new he({schema:e,typeName:h.ZodEffects,effect:t,...C(r)});he.createWithPreprocess=(e,t,r)=>new he({schema:t,effect:{type:"preprocess",transform:e},typeName:h.ZodEffects,...C(r)});var fe=class extends P{_parse(t){return this._getType(t)===_.undefined?X(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};fe.create=(e,t)=>new fe({innerType:e,typeName:h.ZodOptional,...C(t)});var Ee=class extends P{_parse(t){return this._getType(t)===_.null?X(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};Ee.create=(e,t)=>new Ee({innerType:e,typeName:h.ZodNullable,...C(t)});var lt=class extends P{_parse(t){let{ctx:r}=this._processInputParams(t),n=r.data;return r.parsedType===_.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:r.path,parent:r})}removeDefault(){return this._def.innerType}};lt.create=(e,t)=>new lt({innerType:e,typeName:h.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...C(t)});var dt=class extends P{_parse(t){let{ctx:r}=this._processInputParams(t),n={...r,common:{...r.common,issues:[]}},a=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return St(a)?a.then(s=>({status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new ae(n.common.issues)},input:n.data})})):{status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new ae(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}};dt.create=(e,t)=>new dt({innerType:e,typeName:h.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...C(t)});var Rt=class extends P{_parse(t){if(this._getType(t)!==_.nan){let n=this._getOrReturnCtx(t);return m(n,{code:p.invalid_type,expected:_.nan,received:n.parsedType}),A}return{status:"valid",value:t.data}}};Rt.create=e=>new Rt({typeName:h.ZodNaN,...C(e)});var Ji=Symbol("zod_brand"),Bt=class extends P{_parse(t){let{ctx:r}=this._processInputParams(t),n=r.data;return this._def.type._parse({data:n,path:r.path,parent:r})}unwrap(){return this._def.type}},Wt=class e extends P{_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.common.async)return(async()=>{let s=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return s.status==="aborted"?A:s.status==="dirty"?(r.dirty(),Ye(s.value)):this._def.out._parseAsync({data:s.value,path:n.path,parent:n})})();{let a=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return a.status==="aborted"?A:a.status==="dirty"?(r.dirty(),{status:"dirty",value:a.value}):this._def.out._parseSync({data:a.value,path:n.path,parent:n})}}static create(t,r){return new e({in:t,out:r,typeName:h.ZodPipeline})}},ft=class extends P{_parse(t){let r=this._def.innerType._parse(t),n=a=>(Ze(a)&&(a.value=Object.freeze(a.value)),a);return St(r)?r.then(a=>n(a)):n(r)}unwrap(){return this._def.innerType}};ft.create=(e,t)=>new ft({innerType:e,typeName:h.ZodReadonly,...C(t)});function Ka(e,t){let r=typeof e=="function"?e(t):typeof e=="string"?{message:e}:e;return typeof r=="string"?{message:r}:r}function ts(e,t={},r){return e?Fe.create().superRefine((n,a)=>{let s=e(n);if(s instanceof Promise)return s.then(i=>{if(!i){let o=Ka(t,n),c=o.fatal??r??!0;a.addIssue({code:"custom",...o,fatal:c})}});if(!s){let i=Ka(t,n),o=i.fatal??r??!0;a.addIssue({code:"custom",...i,fatal:o})}}):Fe.create()}var Gi={object:se.lazycreate},h;(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"})(h||(h={}));var Hi=(e,t={message:`Input not instance of ${e.name}`})=>ts(r=>r instanceof e,t),rs=Le.create,ns=Qe.create,Ki=Rt.create,Yi=Xe.create,as=et.create,Qi=tt.create,Xi=Ot.create,eo=rt.create,to=nt.create,ro=Fe.create,no=Me.create,ao=_e.create,so=$t.create,io=je.create,oo=se.create,co=se.strictCreate,uo=at.create,lo=vr.create,fo=st.create,po=Se.create,ho=br.create,mo=It.create,yo=Nt.create,go=wr.create,_o=it.create,vo=ot.create,bo=ct.create,wo=ut.create,xo=Ve.create,ko=he.create,To=fe.create,Ao=Ee.create,So=he.createWithPreprocess,Eo=Wt.create,Oo=()=>rs().optional(),$o=()=>ns().optional(),Io=()=>as().optional(),No={string:(e=>Le.create({...e,coerce:!0})),number:(e=>Qe.create({...e,coerce:!0})),boolean:(e=>et.create({...e,coerce:!0})),bigint:(e=>Xe.create({...e,coerce:!0})),date:(e=>tt.create({...e,coerce:!0}))};var Ro=A;function wn(e,t){let r={type:"array"};return e.type?._def&&e.type?._def?.typeName!==h.ZodAny&&(r.items=E(e.type._def,{...t,currentPath:[...t.currentPath,"items"]})),e.minLength&&D(r,"minItems",e.minLength.value,e.minLength.message,t),e.maxLength&&D(r,"maxItems",e.maxLength.value,e.maxLength.message,t),e.exactLength&&(D(r,"minItems",e.exactLength.value,e.exactLength.message,t),D(r,"maxItems",e.exactLength.value,e.exactLength.message,t)),r}function xn(e,t){let r={type:"integer",format:"int64"};if(!e.checks)return r;for(let n of e.checks)switch(n.kind){case"min":t.target==="jsonSchema7"?n.inclusive?D(r,"minimum",n.value,n.message,t):D(r,"exclusiveMinimum",n.value,n.message,t):(n.inclusive||(r.exclusiveMinimum=!0),D(r,"minimum",n.value,n.message,t));break;case"max":t.target==="jsonSchema7"?n.inclusive?D(r,"maximum",n.value,n.message,t):D(r,"exclusiveMaximum",n.value,n.message,t):(n.inclusive||(r.exclusiveMaximum=!0),D(r,"maximum",n.value,n.message,t));break;case"multipleOf":D(r,"multipleOf",n.value,n.message,t);break}return r}function kn(){return{type:"boolean"}}function qt(e,t){return E(e.type._def,t)}var Tn=(e,t)=>E(e.innerType._def,t);function xr(e,t,r){let n=r??t.dateStrategy;if(Array.isArray(n))return{anyOf:n.map(a=>xr(e,t,a))};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 Co(e,t)}}var Co=(e,t)=>{let r={type:"integer",format:"unix-time"};if(t.target==="openApi3")return r;for(let n of e.checks)switch(n.kind){case"min":D(r,"minimum",n.value,n.message,t);break;case"max":D(r,"maximum",n.value,n.message,t);break}return r};function An(e,t){return{...E(e.innerType._def,t),default:e.defaultValue()}}function Sn(e,t){return t.effectStrategy==="input"?E(e.schema._def,t):V(t)}function En(e){return{type:"string",enum:Array.from(e.values)}}var Po=e=>"type"in e&&e.type==="string"?!1:"allOf"in e;function On(e,t){let r=[E(e.left._def,{...t,currentPath:[...t.currentPath,"allOf","0"]}),E(e.right._def,{...t,currentPath:[...t.currentPath,"allOf","1"]})].filter(s=>!!s),n=t.target==="jsonSchema2019-09"?{unevaluatedProperties:!1}:void 0,a=[];return r.forEach(s=>{if(Po(s))a.push(...s.allOf),s.unevaluatedProperties===void 0&&(n=void 0);else{let i=s;if("additionalProperties"in s&&s.additionalProperties===!1){let{additionalProperties:o,...c}=s;i=c}else n=void 0;a.push(i)}}),a.length?{allOf:a,...n}:void 0}function $n(e,t){let r=typeof e.value;return r!=="bigint"&&r!=="number"&&r!=="boolean"&&r!=="string"?{type:Array.isArray(e.value)?"array":"object"}:t.target==="openApi3"?{type:r==="bigint"?"integer":r,enum:[e.value]}:{type:r==="bigint"?"integer":r,const:e.value}}var In,me={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:()=>(In===void 0&&(In=RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),In),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 Jt(e,t){let r={type:"string"};if(e.checks)for(let n of e.checks)switch(n.kind){case"min":D(r,"minLength",typeof r.minLength=="number"?Math.max(r.minLength,n.value):n.value,n.message,t);break;case"max":D(r,"maxLength",typeof r.maxLength=="number"?Math.min(r.maxLength,n.value):n.value,n.message,t);break;case"email":switch(t.emailStrategy){case"format:email":ve(r,"email",n.message,t);break;case"format:idn-email":ve(r,"idn-email",n.message,t);break;case"pattern:zod":ee(r,me.email,n.message,t);break}break;case"url":ve(r,"uri",n.message,t);break;case"uuid":ve(r,"uuid",n.message,t);break;case"regex":ee(r,n.regex,n.message,t);break;case"cuid":ee(r,me.cuid,n.message,t);break;case"cuid2":ee(r,me.cuid2,n.message,t);break;case"startsWith":ee(r,RegExp(`^${Nn(n.value,t)}`),n.message,t);break;case"endsWith":ee(r,RegExp(`${Nn(n.value,t)}$`),n.message,t);break;case"datetime":ve(r,"date-time",n.message,t);break;case"date":ve(r,"date",n.message,t);break;case"time":ve(r,"time",n.message,t);break;case"duration":ve(r,"duration",n.message,t);break;case"length":D(r,"minLength",typeof r.minLength=="number"?Math.max(r.minLength,n.value):n.value,n.message,t),D(r,"maxLength",typeof r.maxLength=="number"?Math.min(r.maxLength,n.value):n.value,n.message,t);break;case"includes":ee(r,RegExp(Nn(n.value,t)),n.message,t);break;case"ip":n.version!=="v6"&&ve(r,"ipv4",n.message,t),n.version!=="v4"&&ve(r,"ipv6",n.message,t);break;case"base64url":ee(r,me.base64url,n.message,t);break;case"jwt":ee(r,me.jwt,n.message,t);break;case"cidr":n.version!=="v6"&&ee(r,me.ipv4Cidr,n.message,t),n.version!=="v4"&&ee(r,me.ipv6Cidr,n.message,t);break;case"emoji":ee(r,me.emoji(),n.message,t);break;case"ulid":ee(r,me.ulid,n.message,t);break;case"base64":switch(t.base64Strategy){case"format:binary":ve(r,"binary",n.message,t);break;case"contentEncoding:base64":D(r,"contentEncoding","base64",n.message,t);break;case"pattern:zod":ee(r,me.base64,n.message,t);break}break;case"nanoid":ee(r,me.nanoid,n.message,t);break;case"toLowerCase":case"toUpperCase":case"trim":break;default:}return r}function Nn(e,t){return t.patternStrategy==="escape"?jo(e):e}var Mo=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");function jo(e){let t="";for(let r=0;r<e.length;r++)Mo.has(e[r])||(t+="\\"),t+=e[r];return t}function ve(e,t,r,n){e.format||e.anyOf?.some(a=>a.format)?(e.anyOf||(e.anyOf=[]),e.format&&(e.anyOf.push({format:e.format,...e.errorMessage&&n.errorMessages&&{errorMessage:{format:e.errorMessage.format}}}),delete e.format,e.errorMessage&&(delete e.errorMessage.format,Object.keys(e.errorMessage).length===0&&delete e.errorMessage)),e.anyOf.push({format:t,...r&&n.errorMessages&&{errorMessage:{format:r}}})):D(e,"format",t,r,n)}function ee(e,t,r,n){e.pattern||e.allOf?.some(a=>a.pattern)?(e.allOf||(e.allOf=[]),e.pattern&&(e.allOf.push({pattern:e.pattern,...e.errorMessage&&n.errorMessages&&{errorMessage:{pattern:e.errorMessage.pattern}}}),delete e.pattern,e.errorMessage&&(delete e.errorMessage.pattern,Object.keys(e.errorMessage).length===0&&delete e.errorMessage)),e.allOf.push({pattern:ss(t,n),...r&&n.errorMessages&&{errorMessage:{pattern:r}}})):D(e,"pattern",ss(t,n),r,n)}function ss(e,t){if(!t.applyRegexFlags||!e.flags)return e.source;let r={i:e.flags.includes("i"),m:e.flags.includes("m"),s:e.flags.includes("s")},n=r.i?e.source.toLowerCase():e.source,a="",s=!1,i=!1,o=!1;for(let c=0;c<n.length;c++){if(s){a+=n[c],s=!1;continue}if(r.i){if(i){if(n[c].match(/[a-z]/)){o?(a+=n[c],a+=`${n[c-2]}-${n[c]}`.toUpperCase(),o=!1):n[c+1]==="-"&&n[c+2]?.match(/[a-z]/)?(a+=n[c],o=!0):a+=`${n[c]}${n[c].toUpperCase()}`;continue}}else if(n[c].match(/[a-z]/)){a+=`[${n[c]}${n[c].toUpperCase()}]`;continue}}if(r.m){if(n[c]==="^"){a+=`(^|(?<=[\r
3
3
  ]))`;continue}else if(n[c]==="$"){a+=`($|(?=[\r
4
4
  ]))`;continue}}if(r.s&&n[c]==="."){a+=i?`${n[c]}\r
5
5
  `:`[${n[c]}\r
@@ -30,4 +30,4 @@ Details: ${f.message}`),Ja(f)&&(g=`${g}
30
30
  ${dn.prettifyError(f)}`),new xt(g,JSON.stringify(e))}else{let f=F(n,this.schema);if(!f.valid){let g="Received tool input did not match expected schema";throw this.verboseParsingErrors&&(g=`${g}
31
31
  Details: ${f.errors.map(S=>`${S.keywordLocation}: ${S.error}`).join(`
32
32
  `)}`),new xt(g,JSON.stringify(e))}a=n}let s=dr(t),i=za.configure(s.callbacks,this.callbacks,s.tags||r,this.tags,s.metadata,this.metadata,{verbose:this.verbose}),o;wt(e)&&(o=e.id),!o&&Pa(s)&&(o=s.toolCall.id);let c=await i?.handleToolStart(this.toJSON(),typeof e=="string"?e:JSON.stringify(e),s.runId,void 0,void 0,void 0,s.runName,o);delete s.runId;let u;try{let f=await this._call(a,c,s);u=Xn(f)?await hs(f,async g=>{try{await c?.handleToolEvent(g)}catch(S){await c?.handleToolError(S)}}):f}catch(f){throw await c?.handleToolError(f),f}let l,d;if(this.responseFormat==="content_and_artifact")if(Array.isArray(u)&&u.length===2)[l,d]=u;else throw new Error(`Tool response format is "content_and_artifact" but the output was not a two-tuple.
33
- Result: ${JSON.stringify(u)}`);else l=u;let v=bu({content:l,artifact:d,toolCallId:o,name:this.name,metadata:this.metadata});return await c?.handleToolEnd(v),v}},ci=class extends va{schema=Oe.object({input:Oe.string().optional()}).transform(e=>e.input);constructor(e){super(e)}call(e,t){let r=typeof e=="string"||e==null?{input:e}:e;return super.call(r,t)}},ui=class extends ci{static lc_name(){return"DynamicTool"}name;description;func;constructor(e){super(e),this.name=e.name,this.description=e.description,this.func=e.func,this.returnDirect=e.returnDirect??this.returnDirect}async call(e,t){let r=dr(t);return r.runName===void 0&&(r.runName=this.name),super.call(e,r)}_call(e,t,r){return this.func(e,t,r)}},li=class extends va{static lc_name(){return"DynamicStructuredTool"}description;func;schema;constructor(e){super(e),this.name=e.name,this.description=e.description,this.func=e.func,this.returnDirect=e.returnDirect??this.returnDirect,this.schema=e.schema}async call(e,t,r){let n=dr(t);return n.runName===void 0&&(n.runName=this.name),super.call(e,n,r)}_call(e,t,r){return this.func(e,t,r)}},gu=class{getTools(){return this.tools}};function _u(e,t){let r=mr(t.schema),n=Pt(t.schema);if(!t.schema||r||n)return new ui({...t,description:t.description??t.schema?.description??`${t.name} tool`,func:async(i,o,c)=>new Promise((u,l)=>{let d=J(c,{callbacks:o?.getChild()});oe.runWithConfig(de(d),async()=>{try{u(e(i,d))}catch(v){l(v)}})})});let a=t.schema,s=t.description??t.schema.description??`${t.name} tool`;return new li({...t,description:s,schema:a,func:async(i,o,c)=>new Promise((u,l)=>{let d,v=()=>{c?.signal&&d&&c.signal.removeEventListener("abort",d)};c?.signal&&(d=()=>{v(),l(ze(c.signal))},c.signal.addEventListener("abort",d,{once:!0}));let f=J(c,{callbacks:o?.getChild()});oe.runWithConfig(de(f),async()=>{try{let g=await e(i,f);if(Xn(g)){u(g);return}if(c?.signal?.aborted){v();return}v(),u(g)}catch(g){v(),l(g)}})})})}function vu(e){return typeof e=="object"&&e!==null&&"type"in e}function bu(e){let{content:t,artifact:r,toolCallId:n,metadata:a}=e;return n&&!Ca(t)?typeof t=="string"||Array.isArray(t)&&t.every(vu)?new an({status:"success",content:t,artifact:r,tool_call_id:n,name:e.name,metadata:a}):new an({status:"success",content:wu(t),artifact:r,tool_call_id:n,name:e.name,metadata:a}):t}function wu(e){try{return JSON.stringify(e)??""}catch{return`${e}`}}export{Or as a,Vp as b,Gp as c,ge as d,ph as e,te as f,Rr as g,Be as h,mt as i,Dc as j,Ph as k,Zh as l,Zc as m,Qt as n,Lc as o,sh as p,pt as q,Xf as r,Fo as s,W as t,G as u,Tu as v,Tt as w,yi as x,gi as y,Au as z,Su as A,hr as B,Eu as C,Ou as D,Wa as E,$u as F,mr as G,fn as H,Te as I,pn as J,_i as K,vi as L,Iu as M,Ua as N,Nu as O,Ru as P,pr as Q,Ba as R,Cu as S,qa as T,Pu as U,Ja as V,h as W,Oe as X,Ue as Y,Tr as Z,Cp as _,Yn as $,sm as aa,Lr as ba,K as ca,Y as da,Fr as ea,$m as fa,Hs as ga,Ks as ha,Vr as ia,Xs as ja,Im as ka,Jc as la,yt as ma,Gc as na,Hc as oa,qs as pa,Um as qa,da as ra,fa as sa,Yc as ta,ny as ua,fy as va,ii as wa,pu as xa,yu as ya,ya as za,ga as Aa,_a as Ba,oi as Ca,Dy as Da,va as Ea,_u as Fa};
33
+ Result: ${JSON.stringify(u)}`);else l=u;let v=bu({content:l,artifact:d,toolCallId:o,name:this.name,metadata:this.metadata});return await c?.handleToolEnd(v),v}},ci=class extends va{schema=Oe.object({input:Oe.string().optional()}).transform(e=>e.input);constructor(e){super(e)}call(e,t){let r=typeof e=="string"||e==null?{input:e}:e;return super.call(r,t)}},ui=class extends ci{static lc_name(){return"DynamicTool"}name;description;func;constructor(e){super(e),this.name=e.name,this.description=e.description,this.func=e.func,this.returnDirect=e.returnDirect??this.returnDirect}async call(e,t){let r=dr(t);return r.runName===void 0&&(r.runName=this.name),super.call(e,r)}_call(e,t,r){return this.func(e,t,r)}},li=class extends va{static lc_name(){return"DynamicStructuredTool"}description;func;schema;constructor(e){super(e),this.name=e.name,this.description=e.description,this.func=e.func,this.returnDirect=e.returnDirect??this.returnDirect,this.schema=e.schema}async call(e,t,r){let n=dr(t);return n.runName===void 0&&(n.runName=this.name),super.call(e,n,r)}_call(e,t,r){return this.func(e,t,r)}},gu=class{getTools(){return this.tools}};function _u(e,t){let r=mr(t.schema),n=Pt(t.schema);if(!t.schema||r||n)return new ui({...t,description:t.description??t.schema?.description??`${t.name} tool`,func:async(i,o,c)=>new Promise((u,l)=>{let d=J(c,{callbacks:o?.getChild()});oe.runWithConfig(de(d),async()=>{try{u(e(i,d))}catch(v){l(v)}})})});let a=t.schema,s=t.description??t.schema.description??`${t.name} tool`;return new li({...t,description:s,schema:a,func:async(i,o,c)=>new Promise((u,l)=>{let d,v=()=>{c?.signal&&d&&c.signal.removeEventListener("abort",d)};c?.signal&&(d=()=>{v(),l(ze(c.signal))},c.signal.addEventListener("abort",d,{once:!0}));let f=J(c,{callbacks:o?.getChild()});oe.runWithConfig(de(f),async()=>{try{let g=await e(i,f);if(Xn(g)){u(g);return}if(c?.signal?.aborted){v();return}v(),u(g)}catch(g){v(),l(g)}})})})}function vu(e){return typeof e=="object"&&e!==null&&"type"in e}function bu(e){let{content:t,artifact:r,toolCallId:n,metadata:a}=e;return n&&!Ca(t)?typeof t=="string"||Array.isArray(t)&&t.every(vu)?new an({status:"success",content:t,artifact:r,tool_call_id:n,name:e.name,metadata:a}):new an({status:"success",content:wu(t),artifact:r,tool_call_id:n,name:e.name,metadata:a}):t}function wu(e){try{return JSON.stringify(e)??""}catch{return`${e}`}}export{Or as a,Vp as b,Gp as c,ge as d,ph as e,te as f,Rr as g,Be as h,mt as i,Dc as j,Ph as k,Zh as l,Zc as m,Qt as n,Lc as o,sh as p,pt as q,Xf as r,Fo as s,W as t,G as u,Tu as v,Tt as w,yi as x,gi as y,Au as z,Su as A,hr as B,Eu as C,Ou as D,Wa as E,$u as F,mr as G,fn as H,Te as I,pn as J,_i as K,vi as L,Iu as M,Ua as N,Nu as O,Ru as P,pr as Q,Ba as R,Cu as S,qa as T,Pu as U,Ja as V,h as W,Oe as X,Ue as Y,Tr as Z,Cp as _,Yn as $,sm as aa,Lr as ba,K as ca,Y as da,Fr as ea,$m as fa,Hs as ga,Ks as ha,Vr as ia,Xs as ja,Im as ka,Jc as la,yt as ma,Gc as na,Hc as oa,qs as pa,Um as qa,da as ra,fa as sa,Yc as ta,ny as ua,fy as va,ii as wa,pu as xa,yu as ya,ya as za,ga as Aa,_a as Ba,oi as Ca,Dy as Da,va as Ea,li as Fa,_u as Ga};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{a as e}from"./OJP56R5R.js";import{W as i}from"./QJOO6IIX.js";import"./AMFZY5QK.js";import"./EXIA3APU.js";import{Fa as o}from"./TRZJYWEB.js";import"./2XXM52PS.js";import"./2UKFCF2J.js";import"./UZLQALHY.js";var n=["custom","extent","point","polygon","polyline"],u=e.object({id:e.string(),kind:e.enum(n),description:e.string()}),p=e.object({kinds:e.array(e.enum(n)).optional().describe("Optional resource kinds to include. Omit to list all available resources.")}),m=({kinds:r},a)=>{let d=i(a),t=r?new Set(r):void 0,c=(d.agentExecutionContext?.sharedResources??[]).flatMap(l=>{let s=u.safeParse(l);return s.success&&(!t||t.has(s.data.kind))?[s.data]:[]});return JSON.stringify({resources:c},null,2)},h=o(m,{name:"listSharedResources",description:"List IDs, kinds, and descriptions for resources created by earlier agents. Use this to reuse prior results instead of repeating work. Resource payloads are hidden.",schema:p});export{h as listSharedResourcesTool};
2
+ import{a as e}from"./RFPTOFM4.js";import{W as i}from"./QEGO4B2W.js";import"./EEHDAYOG.js";import"./XWNZMKQF.js";import{Ga as o}from"./FSLPYC4Y.js";import"./AMP43OT2.js";import"./2UKFCF2J.js";import"./UZLQALHY.js";var n=["custom","extent","point","polygon","polyline"],u=e.object({id:e.string(),kind:e.enum(n),description:e.string()}),p=e.object({kinds:e.array(e.enum(n)).optional().describe("Optional resource kinds to include. Omit to list all available resources.")}),m=({kinds:r},a)=>{let d=i(a),t=r?new Set(r):void 0,c=(d.agentExecutionContext?.sharedResources??[]).flatMap(l=>{let s=u.safeParse(l);return s.success&&(!t||t.has(s.data.kind))?[s.data]:[]});return JSON.stringify({resources:c},null,2)},h=o(m,{name:"listSharedResources",description:"List IDs, kinds, and descriptions for resources created by earlier agents. Use this to reuse prior results instead of repeating work. Resource payloads are hidden.",schema:p});export{h as listSharedResourcesTool};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{Ea as y,a as E,b as p}from"./QJOO6IIX.js";function x(o,f,t,s={}){let{agent:h,entryNode:l,middlewares:i=[]}=s,r=new y(t);if(Object.keys(o).length===0)throw new Error("Graph requires at least one node.");if(f.length===0)throw new Error("Graph requires at least one edge.");if(i.length>0&&!h)throw new Error("Graph middleware requires agent metadata.");let n=new Set(Object.keys(o)),g=new Map,w=new Map;for(let e of n)g.set(e,0),w.set(e,0);for(let e of f)"to"in e?(n.has(e.from)&&w.set(e.from,(w.get(e.from)??0)+1),n.has(e.to)&&g.set(e.to,(g.get(e.to)??0)+1)):n.has(e.from)&&w.set(e.from,(w.get(e.from)??0)+1);for(let[e,a]of Object.entries(o)){let c=$(h,e,i,async(d,m)=>await Promise.resolve(a(d,m))),u=async(d,m)=>await c(d,m);r=r.addNode(e,u)}for(let e of f)if("to"in e){let a=e.from,c=e.to;if(!n.has(a))throw new Error(`Graph edge references unknown from-node: ${a}`);if(!n.has(c))throw new Error(`Graph edge references unknown to-node: ${c}`);r.addEdge(a,c)}else{let a=e.from;if(!n.has(a))throw new Error(`Graph conditional edge references unknown from-node: ${a}`);r.addConditionalEdges(a,async(c,u)=>{let d=await e.decide(c,u);if(!d)return p;if(!n.has(d))throw new Error(`Graph conditional edge returned unknown node: ${d}`);return d})}let G=N(n,g,l);r.addEdge(E,G);let k=[...n].filter(e=>(w.get(e)??0)===0);for(let e of k)r.addEdge(e,p);return r}function $(o,f,t,s){return!t.length||!o?s:async(h,l)=>await t.reduceRight((i,r)=>async n=>await r.handler(n,i),async i=>{let r=await s(i.state,i.config);return{...i.state,...r}})({agent:o,config:l,nodeName:f,state:h})}function N(o,f,t){if(t){if(!o.has(t))throw new Error(`Graph entry node references unknown node: ${t}`);return t}let s=[...o].filter(h=>(f.get(h)??0)===0);if(s.length!==1)throw new Error(`Graph could not infer a single entry node (found ${s.length}). Provide an explicit entryNode or ensure exactly one node has no incoming edges.`);return s[0]}export{x as a};
2
+ import{Ea as y,a as E,b as p}from"./QEGO4B2W.js";function x(o,f,t,s={}){let{agent:h,entryNode:l,middlewares:i=[]}=s,r=new y(t);if(Object.keys(o).length===0)throw new Error("Graph requires at least one node.");if(f.length===0)throw new Error("Graph requires at least one edge.");if(i.length>0&&!h)throw new Error("Graph middleware requires agent metadata.");let n=new Set(Object.keys(o)),g=new Map,w=new Map;for(let e of n)g.set(e,0),w.set(e,0);for(let e of f)"to"in e?(n.has(e.from)&&w.set(e.from,(w.get(e.from)??0)+1),n.has(e.to)&&g.set(e.to,(g.get(e.to)??0)+1)):n.has(e.from)&&w.set(e.from,(w.get(e.from)??0)+1);for(let[e,a]of Object.entries(o)){let c=$(h,e,i,async(d,m)=>await Promise.resolve(a(d,m))),u=async(d,m)=>await c(d,m);r=r.addNode(e,u)}for(let e of f)if("to"in e){let a=e.from,c=e.to;if(!n.has(a))throw new Error(`Graph edge references unknown from-node: ${a}`);if(!n.has(c))throw new Error(`Graph edge references unknown to-node: ${c}`);r.addEdge(a,c)}else{let a=e.from;if(!n.has(a))throw new Error(`Graph conditional edge references unknown from-node: ${a}`);r.addConditionalEdges(a,async(c,u)=>{let d=await e.decide(c,u);if(!d)return p;if(!n.has(d))throw new Error(`Graph conditional edge returned unknown node: ${d}`);return d})}let G=N(n,g,l);r.addEdge(E,G);let k=[...n].filter(e=>(w.get(e)??0)===0);for(let e of k)r.addEdge(e,p);return r}function $(o,f,t,s){return!t.length||!o?s:async(h,l)=>await t.reduceRight((i,r)=>async n=>await r.handler(n,i),async i=>{let r=await s(i.state,i.config);return{...i.state,...r}})({agent:o,config:l,nodeName:f,state:h})}function N(o,f,t){if(t){if(!o.has(t))throw new Error(`Graph entry node references unknown node: ${t}`);return t}let s=[...o].filter(h=>(f.get(h)??0)===0);if(s.length!==1)throw new Error(`Graph could not infer a single entry node (found ${s.length}). Provide an explicit entryNode or ensure exactly one node has no incoming edges.`);return s[0]}export{x as a};
@@ -0,0 +1,3 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
+ import{a as e}from"./P4CHI7W3.js";import"./46DT6BIG.js";import{C as s,g as o,h as r,x as c}from"./RE7MJTEF.js";import"./R74ZHFA6.js";import"./UZLQALHY.js";var n=o`.container{border-radius:var(--calcite-border-radius);margin-bottom:var(--calcite-spacing-md)}.block{margin:0;background-color:var(--calcite-color-foreground-1);width:100%;max-height:300px;overflow:auto}.entry{margin-left:var(--calcite-spacing-sm);padding:var(--calcite-spacing-xxs) var(--calcite-spacing-lg);border-left:1px solid var(--calcite-color-border-1)}`,i=class extends c{constructor(){super(...arguments),this.logEnabled=!1,this.showLog=!1}static{this.properties={logEnabled:5,showLog:5,log:[1,{type:Array}]}}static{this.styles=n}render(){return this.log?.length&&this.showLog&&this.logEnabled?r`<div class="container"><div class="block"><calcite-accordion appearance=transparent icon-position=start icon-type=chevron scale=s>${this.log.map(a=>{let t=a.includes(`
3
+ `)||a.length>70;return r`<calcite-accordion-item .heading=${t?`${a.substring(0,70)}...`:a} .expanded=${t}><div class="entry">${t?e(a):null}</div></calcite-accordion-item>`})}</calcite-accordion></div></div>`:null}};s("arcgis-assistant-message-log",i);export{i as ArcgisAssistantMessageLog};
@@ -0,0 +1,2 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
+ import{a}from"./PGH7POKS.js";import"./ONQ6JSBJ.js";import"./RFPTOFM4.js";import"./FSLPYC4Y.js";import"./AMP43OT2.js";import"./2UKFCF2J.js";import"./UZLQALHY.js";export{a as goToFeaturesTool};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{a as $,c as f}from"./AAUVOBPS.js";import{f as o}from"./GEFFWUB2.js";import{B as m,g as u,h as t,k as g,w as v,z as h}from"./2FUTKTNO.js";import"./R74ZHFA6.js";import"./UZLQALHY.js";var w=u`:host{display:block;min-width:0;min-height:0}calcite-panel{height:100%}calcite-tabs{position:relative;flex:1;height:0;min-height:0;overflow:hidden}.details{padding:var(--calcite-spacing-md)}.details>*+*{margin-block-start:var(--calcite-spacing-lg)}h3{margin:0 0 var(--calcite-spacing-sm);font-size:var(--calcite-font-size-relative-base);font-weight:var(--calcite-font-weight-semibold)}.metadata calcite-table-header,.detail-value,.error{overflow-wrap:anywhere}calcite-table{font-variant-numeric:tabular-nums}.table-scroll{overflow-x:auto}.table-scroll calcite-table{min-width:30rem}.payload{margin:0;padding:var(--calcite-spacing-md);white-space:pre-wrap;overflow-wrap:anywhere;font-family:var(--calcite-monospace-family);font-size:var(--calcite-font-size-relative-sm);color:var(--calcite-color-text-1);background-color:var(--calcite-color-foreground-1)}.empty{display:grid;min-height:5rem;place-items:center;color:var(--calcite-color-text-3);font-size:var(--calcite-font-size-relative-sm)}`;function y(i,e){if(i===void 0)return t`<div class="empty">${e} unavailable.</div>`;try{let a=typeof i=="string"?i:JSON.stringify(i,null,2);return a===void 0?t`<div class="empty">${e} cannot be serialized.</div>`:t`<pre class="payload">${a===""?'""':a}</pre>`}catch{return t`<div class="empty">${e} cannot be serialized.</div>`}}function s(i,e){let a=e.filter(l=>l.value!==void 0);return a.length?t`<section aria-label=${`${i} details`}><h3>${i}</h3><calcite-table class="metadata" .caption=${`${i} metadata`} aria-label=${`${i} metadata`} scale=s layout=fixed interaction-mode=static bordered><calcite-table-row slot=table-header><calcite-table-header heading=Field></calcite-table-header><calcite-table-header heading=Value col-span=2></calcite-table-header></calcite-table-row>${a.map(l=>t`<calcite-table-row><calcite-table-header .heading=${l.label}></calcite-table-header><calcite-table-cell col-span=2><span class="detail-value">${l.value}</span></calcite-table-cell></calcite-table-row>`)}</calcite-table></section>`:null}var d=class extends v{constructor(){super(...arguments),this.pricing=$}static{this.properties={span:0,run:0,pricing:0}}static{this.styles=w}async copy(){let e=this.span??this.run;if(e)try{await navigator.clipboard.writeText(JSON.stringify(e,null,2))}catch(a){g("warn","assistant-observation-inspector","Failed to copy selected data as JSON",{once:!0,detail:{error:a}})}}renderRunDetails(e){return t`<div class="details">${s("Run",[{label:"Status",value:e.status},{label:"Duration",value:o(e)},{label:"Started",value:new Date(e.startedAt).toLocaleString()},{label:"Ended",value:e.endedAt!==void 0?new Date(e.endedAt).toLocaleString():void 0}])}${s("Model",[{label:"Models used",value:e.models.map(a=>a.model??"Not reported").join(", ")||"None"},{label:"Model calls",value:e.usage.modelCalls.toLocaleString()}])}<arcgis-assistant-observation-usage .usage=${e.usage} aggregate .pricing=${this.pricing}></arcgis-assistant-observation-usage><div class="table-scroll"><calcite-table caption="Usage by model" aria-label="Usage by model" scale=s interaction-mode=static bordered><calcite-table-row slot=table-header><calcite-table-header heading=Model></calcite-table-header><calcite-table-header heading=Calls></calcite-table-header><calcite-table-header heading="Input tokens"></calcite-table-header><calcite-table-header heading="Output tokens"></calcite-table-header><calcite-table-header heading="Estimated cost (USD)"></calcite-table-header></calcite-table-row>${e.models.map(({model:a,usage:l})=>t`<calcite-table-row><calcite-table-header .heading=${a??"Not reported"}></calcite-table-header><calcite-table-cell>${l.modelCalls.toLocaleString()}</calcite-table-cell><calcite-table-cell>${l.tokens.input?.toLocaleString()??"Not reported"}</calcite-table-cell><calcite-table-cell>${l.tokens.output?.toLocaleString()??"Not reported"}</calcite-table-cell><calcite-table-cell>${f(l.cost?.total)}</calcite-table-cell></calcite-table-row>`)}</calcite-table></div>${s("Identifiers",[{label:"Run ID",value:e.id}])}</div>`}renderSpanDetails(e){let a=e.metadata?.model,l=[{label:"Status",value:e.status},{label:"Type",value:e.type},{label:"Duration",value:e.durationMs!==void 0?o(e):void 0},{label:"Started",value:new Date(e.startedAt).toLocaleString()},{label:"Ended",value:e.endedAt!==void 0?new Date(e.endedAt).toLocaleString():void 0}],r=[];if(a||e.type==="model"){let c=e.pricingTier==="long-context"?"Long context":e.pricingTier==="standard"?"Standard":"Unavailable";r.push({label:"Model",value:a??"Not reported"},{label:"Pricing tier",value:c})}let n=[{label:"Run ID",value:e.runId},{label:"Span ID",value:e.id},{label:"Parent span",value:e.parentId||void 0},{label:"Agent",value:e.agentId||void 0}];return t`<div class="details">${s("Span",l)}${s("Model",r)}${e.usage?t`<arcgis-assistant-observation-usage .usage=${e.usage} .pricing=${this.pricing}></arcgis-assistant-observation-usage>`:null}${s("Identifiers",n)}</div>`}render(){let e=this.run,a=this.span,l=e?.spans.filter(p=>p.type==="workflow"&&!p.parentId).at(-1),r=a?a.input:e?e.prompt||l?.input:void 0,n=a?a.output:l?.output,c=a?.error,b=a?"Copy span JSON":"Copy run JSON";return t`<calcite-panel .heading=${a?a.label:e?`Run ${e.number}`:"Span details"} aria-label=${a||!e?"Span inspector":"Run inspector"} closable><calcite-action slot=header-actions-end icon=copy-to-clipboard .text=${b} title=${b??h} .disabled=${!e&&!a} @click=${this.copy}></calcite-action>${c?t`<calcite-notice role=alert slot=content-top open kind=danger icon scale=s width=full><div class="error" slot=message>${c.name?`${c.name}: `:""}${c.message}</div></calcite-notice>`:null}${e||a?t`<calcite-tabs><calcite-tab-nav slot=title-group><calcite-tab-title selected>Details</calcite-tab-title><calcite-tab-title>Input</calcite-tab-title><calcite-tab-title>Output</calcite-tab-title><calcite-tab-title>Latency</calcite-tab-title></calcite-tab-nav><calcite-tab selected>${a?this.renderSpanDetails(a):this.renderRunDetails(e)}</calcite-tab><calcite-tab>${y(r,"Input")}</calcite-tab><calcite-tab>${y(n,"Output")}</calcite-tab><calcite-tab><arcgis-assistant-observation-latency .run=${e} .span=${a}></arcgis-assistant-observation-latency></calcite-tab></calcite-tabs>`:t`<div class="empty">No span selected.</div>`}</calcite-panel>`}};m("arcgis-assistant-observation-inspector",d);export{d as ArcgisAssistantObservationInspector};
2
+ import{f as o}from"./GEFFWUB2.js";import{a as $,c as f}from"./AAUVOBPS.js";import{A as h,C as m,g as u,h as t,l as g,x as v}from"./RE7MJTEF.js";import"./R74ZHFA6.js";import"./UZLQALHY.js";var w=u`:host{display:block;min-width:0;min-height:0}calcite-panel{height:100%}calcite-tabs{position:relative;flex:1;height:0;min-height:0;overflow:hidden}.details{padding:var(--calcite-spacing-md)}.details>*+*{margin-block-start:var(--calcite-spacing-lg)}h3{margin:0 0 var(--calcite-spacing-sm);font-size:var(--calcite-font-size-relative-base);font-weight:var(--calcite-font-weight-semibold)}.metadata calcite-table-header,.detail-value,.error{overflow-wrap:anywhere}calcite-table{font-variant-numeric:tabular-nums}.table-scroll{overflow-x:auto}.table-scroll calcite-table{min-width:30rem}.payload{margin:0;padding:var(--calcite-spacing-md);white-space:pre-wrap;overflow-wrap:anywhere;font-family:var(--calcite-monospace-family);font-size:var(--calcite-font-size-relative-sm);color:var(--calcite-color-text-1);background-color:var(--calcite-color-foreground-1)}.empty{display:grid;min-height:5rem;place-items:center;color:var(--calcite-color-text-3);font-size:var(--calcite-font-size-relative-sm)}`;function y(i,e){if(i===void 0)return t`<div class="empty">${e} unavailable.</div>`;try{let a=typeof i=="string"?i:JSON.stringify(i,null,2);return a===void 0?t`<div class="empty">${e} cannot be serialized.</div>`:t`<pre class="payload">${a===""?'""':a}</pre>`}catch{return t`<div class="empty">${e} cannot be serialized.</div>`}}function s(i,e){let a=e.filter(l=>l.value!==void 0);return a.length?t`<section aria-label=${`${i} details`}><h3>${i}</h3><calcite-table class="metadata" .caption=${`${i} metadata`} aria-label=${`${i} metadata`} scale=s layout=fixed interaction-mode=static bordered><calcite-table-row slot=table-header><calcite-table-header heading=Field></calcite-table-header><calcite-table-header heading=Value col-span=2></calcite-table-header></calcite-table-row>${a.map(l=>t`<calcite-table-row><calcite-table-header .heading=${l.label}></calcite-table-header><calcite-table-cell col-span=2><span class="detail-value">${l.value}</span></calcite-table-cell></calcite-table-row>`)}</calcite-table></section>`:null}var d=class extends v{constructor(){super(...arguments),this.pricing=$}static{this.properties={span:0,run:0,pricing:0}}static{this.styles=w}async copy(){let e=this.span??this.run;if(e)try{await navigator.clipboard.writeText(JSON.stringify(e,null,2))}catch(a){g("warn","assistant-observation-inspector","Failed to copy selected data as JSON",{once:!0,detail:{error:a}})}}renderRunDetails(e){return t`<div class="details">${s("Run",[{label:"Status",value:e.status},{label:"Duration",value:o(e)},{label:"Started",value:new Date(e.startedAt).toLocaleString()},{label:"Ended",value:e.endedAt!==void 0?new Date(e.endedAt).toLocaleString():void 0}])}${s("Model",[{label:"Models used",value:e.models.map(a=>a.model??"Not reported").join(", ")||"None"},{label:"Model calls",value:e.usage.modelCalls.toLocaleString()}])}<arcgis-assistant-observation-usage .usage=${e.usage} aggregate .pricing=${this.pricing}></arcgis-assistant-observation-usage><div class="table-scroll"><calcite-table caption="Usage by model" aria-label="Usage by model" scale=s interaction-mode=static bordered><calcite-table-row slot=table-header><calcite-table-header heading=Model></calcite-table-header><calcite-table-header heading=Calls></calcite-table-header><calcite-table-header heading="Input tokens"></calcite-table-header><calcite-table-header heading="Output tokens"></calcite-table-header><calcite-table-header heading="Estimated cost (USD)"></calcite-table-header></calcite-table-row>${e.models.map(({model:a,usage:l})=>t`<calcite-table-row><calcite-table-header .heading=${a??"Not reported"}></calcite-table-header><calcite-table-cell>${l.modelCalls.toLocaleString()}</calcite-table-cell><calcite-table-cell>${l.tokens.input?.toLocaleString()??"Not reported"}</calcite-table-cell><calcite-table-cell>${l.tokens.output?.toLocaleString()??"Not reported"}</calcite-table-cell><calcite-table-cell>${f(l.cost?.total)}</calcite-table-cell></calcite-table-row>`)}</calcite-table></div>${s("Identifiers",[{label:"Run ID",value:e.id}])}</div>`}renderSpanDetails(e){let a=e.metadata?.model,l=[{label:"Status",value:e.status},{label:"Type",value:e.type},{label:"Duration",value:e.durationMs!==void 0?o(e):void 0},{label:"Started",value:new Date(e.startedAt).toLocaleString()},{label:"Ended",value:e.endedAt!==void 0?new Date(e.endedAt).toLocaleString():void 0}],r=[];if(a||e.type==="model"){let c=e.pricingTier==="long-context"?"Long context":e.pricingTier==="standard"?"Standard":"Unavailable";r.push({label:"Model",value:a??"Not reported"},{label:"Pricing tier",value:c})}let n=[{label:"Run ID",value:e.runId},{label:"Span ID",value:e.id},{label:"Parent span",value:e.parentId||void 0},{label:"Agent",value:e.agentId||void 0}];return t`<div class="details">${s("Span",l)}${s("Model",r)}${e.usage?t`<arcgis-assistant-observation-usage .usage=${e.usage} .pricing=${this.pricing}></arcgis-assistant-observation-usage>`:null}${s("Identifiers",n)}</div>`}render(){let e=this.run,a=this.span,l=e?.spans.filter(p=>p.type==="workflow"&&!p.parentId).at(-1),r=a?a.input:e?e.prompt||l?.input:void 0,n=a?a.output:l?.output,c=a?.error,b=a?"Copy span JSON":"Copy run JSON";return t`<calcite-panel .heading=${a?a.label:e?`Run ${e.number}`:"Span details"} aria-label=${a||!e?"Span inspector":"Run inspector"} closable><calcite-action slot=header-actions-end icon=copy-to-clipboard .text=${b} title=${b??h} .disabled=${!e&&!a} @click=${this.copy}></calcite-action>${c?t`<calcite-notice role=alert slot=content-top open kind=danger icon scale=s width=full><div class="error" slot=message>${c.name?`${c.name}: `:""}${c.message}</div></calcite-notice>`:null}${e||a?t`<calcite-tabs><calcite-tab-nav slot=title-group><calcite-tab-title selected>Details</calcite-tab-title><calcite-tab-title>Input</calcite-tab-title><calcite-tab-title>Output</calcite-tab-title><calcite-tab-title>Latency</calcite-tab-title></calcite-tab-nav><calcite-tab selected>${a?this.renderSpanDetails(a):this.renderRunDetails(e)}</calcite-tab><calcite-tab>${y(r,"Input")}</calcite-tab><calcite-tab>${y(n,"Output")}</calcite-tab><calcite-tab><arcgis-assistant-observation-latency .run=${e} .span=${a}></arcgis-assistant-observation-latency></calcite-tab></calcite-tabs>`:t`<div class="empty">No span selected.</div>`}</calcite-panel>`}};m("arcgis-assistant-observation-inspector",d);export{d as ArcgisAssistantObservationInspector};
@@ -0,0 +1,2 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
+ import n from"./BBB5EJUB.js";import{a as i,c as r}from"./GMZUN5SF.js";import"./KY7M4WHO.js";import m from"./UOKYHQNO.js";import l from"./YI6NIHNI.js";import k from"./L5IPMRHC.js";import j from"./UQRBY7ID.js";import h from"./FX4LV2S3.js";import"./34O57OGV.js";import"./XEJFVUNQ.js";import g from"./XC3T3Z5R.js";import"./KX6CZEVZ.js";import"./PGH7POKS.js";import f from"./NPV4MEAZ.js";import"./AQF6BBWC.js";import"./ZSLHB6MF.js";import"./TJBU5BQK.js";import d from"./C67KQCPS.js";import"./OVIQ5NSE.js";import"./QUZTFUWM.js";import"./OGZFST2A.js";import"./X5ET73QZ.js";import c from"./MPQ2OZXN.js";import b from"./JZPPP4QY.js";import"./ONQ6JSBJ.js";import"./2DWN3SKH.js";import"./FDOMMK2M.js";import"./DYSPEU7W.js";import"./66VWTARH.js";import"./24TK55FP.js";import"./FJV7CI7O.js";import"./WSIZ2OTL.js";import{C as a,x as e}from"./RE7MJTEF.js";import"./R74ZHFA6.js";import{a as o}from"./DJG6DBCU.js";import"./C76HLPKU.js";import"./RFPTOFM4.js";import"./CADNOKIK.js";import"./BMPBJXD7.js";import"./CDS2HGQY.js";import"./QEGO4B2W.js";import"./EEHDAYOG.js";import"./XWNZMKQF.js";import"./FSLPYC4Y.js";import"./AMP43OT2.js";import"./2UKFCF2J.js";import"./UZLQALHY.js";export default $arcgis.t(([])=>{var n=[async()=>(await import("./MPWEXYYB.js")).default,async()=>(await import("./ZQTCPJUV.js")).default],s=o({id:"data-exploration",name:"Data Exploration Agent",description:"Explores feature-layer data and applies data-driven map filters using on-demand query and filter skills.",skillLoaders:n,modelTier:"default",systemPrompt:"You are an ArcGIS data exploration agent.",instructions:"Answer only questions about the current map's layers, features, fields, spatial relationships, or supported map actions, using returned tool results. Do not answer unrelated general-knowledge, advice, opinion, political, health, security, or other non-map requests, even when the user asks for this agent. For an unsupported request, respond only: 'I can help with questions about the data and features in this map.' Report directly relevant findings, requested calculations, and limitations that affect the answer. Do not provide unsolicited advice about dataset design, publishing, classification, grouping, future analysis, or alternative questions. Ask a clarifying question only when a map-related request cannot be answered reliably as written. A request can require both query and filter skills. Treat show, display, highlight, map, filter, reveal, emphasize, include, or exclude as visual map intent when the request targets matching features. For visual map intent, do not stop after query. First use query to identify/count the matching features, then load the filter skill and call setFeatureEffect with the same layer, where clause, geometry filter, extent setting, or object IDs. Use only tool results to describe data or map changes."});var t=class extends e{constructor(){super(...arguments),this.agent=s}static{this.properties={referenceElement:1}}#t;#e;getContext(){if(!this.#t)throw new Error("arcgis-assistant-data-exploration-agent requires a mapView");return{mapView:this.#t}}load(){this.#t=i(this,"arcgis-assistant-data-exploration-agent"),this.#e=r(this)}disconnectedCallback(){this.#e?.unregister(this.agent.id),super.disconnectedCallback()}};a("arcgis-assistant-data-exploration-agent",t);return t},"intl","smartMapping/statistics/summaryStatistics","smartMapping/statistics/uniqueValues","rest/knowledgeGraphService",b,c,d,f,g,h,j,k,l,m,n)
@@ -1,5 +1,5 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{a as j}from"./434TAA3J.js";import{a as O}from"./46DT6BIG.js";import{b as Z}from"./ZKDCEL6K.js";import{b as pe}from"./OVIQ5NSE.js";import"./QUZTFUWM.js";import{a as I,b as R}from"./WVMQ3I6F.js";import"./KPHHXMRK.js";import"./DYSPEU7W.js";import{a as he}from"./T2FKFOHE.js";import{a as U}from"./3HV6OXCZ.js";import"./M7TMD2HP.js";import a from"./LCI5MEDN.js";import{b as K}from"./WSIZ2OTL.js";import{B as J,g as B,h as y,k as V,l as G,n as w,u as P,v as M,w as Q,z as C}from"./2FUTKTNO.js";import{b as q}from"./R74ZHFA6.js";import"./OJP56R5R.js";import{a as b}from"./CADNOKIK.js";import{c as de,d as ue,e as ge}from"./Q6PCXSZT.js";import{a as A,b as oe,c as le,d as ce}from"./FFWPUYGD.js";import{Ea as ae,M as ie,S as x,a as Y,b as ee,y as te}from"./QJOO6IIX.js";import{c as ne}from"./AMFZY5QK.js";import"./EXIA3APU.js";import"./TRZJYWEB.js";import{o as p}from"./2XXM52PS.js";import{La as re,fa as F,ra as se}from"./2UKFCF2J.js";import"./UZLQALHY.js";export default $arcgis.t(([vt,{whenOnce:Et,watch:_t,when:kt},xt,Me,Te,Ee,De,Le,It,{property:k,subclass:Rt},ke,{b:X}])=>{var Re=(t,e,s)=>{let r=t[e];return r?typeof r=="function"?r():Promise.resolve(r):new Promise((n,i)=>{(typeof queueMicrotask=="function"?queueMicrotask:setTimeout)(i.bind(null,new Error("Unknown variable dynamic import: "+e+(e.split("/").length!==s?". Note that variables only represent file names one level deep.":""))))})},me=async t=>(await Re(Object.assign({"./field_descriptions_prompt.md":()=>import("./ZU2FHVNK.js"),"./intent_prompt.md":()=>import("./OT5ECP4V.js"),"./layer_descriptions_prompt.md":()=>import("./LK7ZIQW6.js")}),`./${t}.md`,2)).default,Se="0.1",$=1536,Ce="openai",Ae=K.default,$e=`Name: {name}
2
+ import{a as O}from"./46DT6BIG.js";import{a as j}from"./434TAA3J.js";import{b as Z}from"./UYP5PH5E.js";import{b as pe}from"./OVIQ5NSE.js";import"./QUZTFUWM.js";import a from"./LCI5MEDN.js";import{a as I,b as R}from"./FBARYPZ7.js";import"./A22375P3.js";import"./DYSPEU7W.js";import{a as he}from"./DZOQFEOB.js";import{a as U}from"./24TK55FP.js";import"./FJV7CI7O.js";import{b as K}from"./WSIZ2OTL.js";import{A as C,C as J,g as B,h as y,l as V,m as G,o as w,v as P,w as M,x as Q}from"./RE7MJTEF.js";import{b as q}from"./R74ZHFA6.js";import"./RFPTOFM4.js";import{a as b}from"./CADNOKIK.js";import{c as de,d as ue,e as ge}from"./BMPBJXD7.js";import{a as A,b as oe,c as le,d as ce}from"./CDS2HGQY.js";import{Ea as ae,M as ie,S as x,a as Y,b as ee,y as te}from"./QEGO4B2W.js";import{c as ne}from"./EEHDAYOG.js";import"./XWNZMKQF.js";import"./FSLPYC4Y.js";import{N as p}from"./AMP43OT2.js";import{La as re,fa as F,ra as se}from"./2UKFCF2J.js";import"./UZLQALHY.js";export default $arcgis.t(([vt,{whenOnce:Et,watch:_t,when:kt},xt,Me,Te,Ee,De,Le,It,{property:k,subclass:Rt},ke,{b:X}])=>{var Re=(t,e,s)=>{let r=t[e];return r?typeof r=="function"?r():Promise.resolve(r):new Promise((n,i)=>{(typeof queueMicrotask=="function"?queueMicrotask:setTimeout)(i.bind(null,new Error("Unknown variable dynamic import: "+e+(e.split("/").length!==s?". Note that variables only represent file names one level deep.":""))))})},me=async t=>(await Re(Object.assign({"./field_descriptions_prompt.md":()=>import("./ZU2FHVNK.js"),"./intent_prompt.md":()=>import("./OT5ECP4V.js"),"./layer_descriptions_prompt.md":()=>import("./LK7ZIQW6.js")}),`./${t}.md`,2)).default,Se="0.1",$=1536,Ce="openai",Ae=K.default,$e=`Name: {name}
3
3
  Title: {title}
4
4
  Description: {description}`,Pe=`Name: {name}
5
5
  Alias: {alias}
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{a as r}from"./FDOMMK2M.js";import{a as s}from"./OJP56R5R.js";import{Fa as o}from"./TRZJYWEB.js";import"./2XXM52PS.js";import"./2UKFCF2J.js";import"./UZLQALHY.js";var m=.7;async function h(a){let{query:e,layerSearch:t,layersAndFieldsRegistry:c,embeddingCache:l,minScore:d=m}=a;return(await t.searchLayers({text:e,minScore:d,embeddingCache:l})).map(({id:i,score:y})=>{let n=c.get(i)?.layerItem;return{layerId:i,score:y,name:n?.name??void 0,title:n?.title,description:n?.description}})}var f=s.object({query:s.string().describe("A concise semantic description of the layers relevant to the user's task.")});async function u({query:a},e){let t=await h({query:a,layerSearch:r(e,"layerSearch"),layersAndFieldsRegistry:r(e,"layersAndFieldsRegistry"),embeddingCache:r(e,"embeddingCache")});return JSON.stringify({layers:t},null,2)}var S=o(u,{name:"findRelevantLayers",description:"Finds map layers relevant to a task and returns their layer IDs, similarity scores, names, titles, and descriptions. Call this before finding fields or querying data when layer IDs are not already known.",schema:f});export{S as findRelevantLayersTool};
2
+ import{a as r}from"./FDOMMK2M.js";import{a as s}from"./RFPTOFM4.js";import{Ga as o}from"./FSLPYC4Y.js";import"./AMP43OT2.js";import"./2UKFCF2J.js";import"./UZLQALHY.js";var m=.7;async function h(a){let{query:e,layerSearch:t,layersAndFieldsRegistry:c,embeddingCache:l,minScore:d=m}=a;return(await t.searchLayers({text:e,minScore:d,embeddingCache:l})).map(({id:i,score:y})=>{let n=c.get(i)?.layerItem;return{layerId:i,score:y,name:n?.name??void 0,title:n?.title,description:n?.description}})}var f=s.object({query:s.string().describe("A concise semantic description of the layers relevant to the user's task.")});async function u({query:a},e){let t=await h({query:a,layerSearch:r(e,"layerSearch"),layersAndFieldsRegistry:r(e,"layersAndFieldsRegistry"),embeddingCache:r(e,"embeddingCache")});return JSON.stringify({layers:t},null,2)}var S=o(u,{name:"findRelevantLayers",description:"Finds map layers relevant to a task and returns their layer IDs, similarity scores, names, titles, and descriptions. Call this before finding fields or querying data when layer IDs are not already known.",schema:f});export{S as findRelevantLayersTool};
@@ -0,0 +1,2 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
+ import{a as c,b as o}from"./P4CHI7W3.js";import"./46DT6BIG.js";import{C as i,g as e,h as t,x as r}from"./RE7MJTEF.js";import"./R74ZHFA6.js";import"./UZLQALHY.js";var n=e`.container{color:var(--calcite-color-text-1);min-width:0}.content{min-width:0;overflow-wrap:anywhere}.content>*{margin:0}.content>*+*{margin-block-start:var(--calcite-spacing-sm)}.content :is(ol,ul){padding-inline-start:var(--calcite-spacing-lg)}.content>calcite-table{display:block;max-width:100%}.content pre{background-color:var(--calcite-color-foreground-1);padding:var(--calcite-spacing-sm);border-radius:var(--calcite-border-radius);color:var(--calcite-color-text-1);direction:ltr;max-width:100%;overflow:auto}.content pre code{display:block;white-space:pre;font-family:var(--calcite-code-family)}.part{animation:part-reveal calc(3 * var(--calcite-animation-timing)) ease-out}@keyframes part-reveal{0%{opacity:0;transform:translateY(var(--calcite-size-fixed-xxs))}to{opacity:1;transform:translateY(0)}}@media(prefers-reduced-motion:reduce){.part{animation:none}}`,a=class extends r{static{this.properties={content:1,parts:[1,{type:Array}]}}static{this.styles=n}render(){return t`<div class="container"><div class="content">${this.parts?.map(s=>t`<span class="part">${o(s)}</span>`)??c(this.content)}</div></div>`}};i("arcgis-assistant-message-text",a);export{a as ArcgisAssistantMessageText};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{a as r}from"./OJP56R5R.js";export default $arcgis.t(([y,m,g,f])=>{var p=["feet","kilometers","meters","miles","nautical-miles","us-nautical-miles"],d=r.enum(p);var u=750;function h(e){return"point"in e&&e.point!==void 0}function b(e){return"layerId"in e&&e.layerId!==void 0}function w(e){return"polygon"in e&&e.polygon!==void 0}function R(e){return"polyline"in e&&e.polyline!==void 0}var F=async(e,i)=>{if(h(e)){let{point:t}=e;return{geometry:new y({x:t.x,y:t.y,spatialReference:t.spatialReference?{wkid:t.spatialReference.wkid}:i.spatialReference})}}if(w(e))return{geometry:new m({rings:e.polygon.rings,spatialReference:e.polygon.spatialReference})};if(R(e))return{geometry:new g({paths:e.polyline.paths,spatialReference:e.polyline.spatialReference})};if(b(e)){let t=i.map?.allLayers.find(n=>n.id===e.layerId);if(!t)return{error:`Could not find geometry layer with ID: ${e.layerId}`};let o=t.title??t.id,a=e.where?.trim()||"1=1";try{let n=await t.queryFeatures({where:a,returnGeometry:!0,outSpatialReference:i.spatialReference,num:u+1});if(!n.features.length)return{error:`No features found in geometry layer "${o}" with the specified where clause: ${a}`};if(n.features.length>u)return{error:`Geometry filter for layer "${o}" matched too many features (${n.features.length}+). Please narrow the geometry layer filter.`};let s=n.features.map(c=>c.geometry).filter(c=>!!c);if(!s.length)return{error:"No valid geometries found for the matched geometry layer features."};let l=s.length===1?s[0]:f.executeMany(s);return l?(l.spatialReference||(l.spatialReference=i.spatialReference),{geometry:l}):{error:"Failed to combine geometries from geometry layer."}}catch(n){return{error:`Failed to query geometry: ${String(n)}`}}}return{error:"Invalid geometry configuration provided"}},I=r.object({id:r.string()}),j=r.discriminatedUnion("kind",[r.object({id:r.string(),kind:r.literal("point"),payload:r.object({x:r.number(),y:r.number(),spatialReference:r.object({wkid:r.number()}).optional()})}),r.object({id:r.string(),kind:r.literal("polyline"),payload:r.object({paths:r.array(r.array(r.array(r.number()))),spatialReference:r.object({wkid:r.number()}).optional()})}),r.object({id:r.string(),kind:r.literal("polygon"),payload:r.object({rings:r.array(r.array(r.array(r.number()))),spatialReference:r.object({wkid:r.number()}).optional()})})]),U=r.object({sharedResourceId:r.string().describe("ID of a point, polyline, or polygon returned by listSharedResources."),distance:r.number().optional().describe("Optional buffer distance around the geometry."),units:d.optional().describe("The units for the distance buffer.")}),q=(e,i)=>{if(!e||!("sharedResourceId"in e))return e;if(!i)throw new Error("Shared resources are unavailable in the tool runtime state.");let t=i.find(a=>{let n=I.safeParse(a);return n.success&&n.data.id===e.sharedResourceId});if(!t)throw new Error(`Shared resource not found: ${e.sharedResourceId}`);let o=j.safeParse(t);if(!o.success)throw new Error(`Shared resource ${e.sharedResourceId} does not contain valid point, polyline, or polygon geometry.`);switch(o.data.kind){case"point":return{point:o.data.payload,distance:e.distance,units:e.units};case"polyline":return{polyline:o.data.payload,distance:e.distance,units:e.units};case"polygon":return{polygon:o.data.payload,distance:e.distance,units:e.units}}};return{a:d,b:h,c:b,d:F,e:U,f:q}},"geometry/Point","geometry/Polygon","geometry/Polyline","geometry/operators/unionOperator")
2
+ import{a as r}from"./RFPTOFM4.js";export default $arcgis.t(([y,m,g,f])=>{var p=["feet","kilometers","meters","miles","nautical-miles","us-nautical-miles"],d=r.enum(p);var u=750;function h(e){return"point"in e&&e.point!==void 0}function b(e){return"layerId"in e&&e.layerId!==void 0}function w(e){return"polygon"in e&&e.polygon!==void 0}function R(e){return"polyline"in e&&e.polyline!==void 0}var F=async(e,i)=>{if(h(e)){let{point:t}=e;return{geometry:new y({x:t.x,y:t.y,spatialReference:t.spatialReference?{wkid:t.spatialReference.wkid}:i.spatialReference})}}if(w(e))return{geometry:new m({rings:e.polygon.rings,spatialReference:e.polygon.spatialReference})};if(R(e))return{geometry:new g({paths:e.polyline.paths,spatialReference:e.polyline.spatialReference})};if(b(e)){let t=i.map?.allLayers.find(n=>n.id===e.layerId);if(!t)return{error:`Could not find geometry layer with ID: ${e.layerId}`};let o=t.title??t.id,a=e.where?.trim()||"1=1";try{let n=await t.queryFeatures({where:a,returnGeometry:!0,outSpatialReference:i.spatialReference,num:u+1});if(!n.features.length)return{error:`No features found in geometry layer "${o}" with the specified where clause: ${a}`};if(n.features.length>u)return{error:`Geometry filter for layer "${o}" matched too many features (${n.features.length}+). Please narrow the geometry layer filter.`};let s=n.features.map(c=>c.geometry).filter(c=>!!c);if(!s.length)return{error:"No valid geometries found for the matched geometry layer features."};let l=s.length===1?s[0]:f.executeMany(s);return l?(l.spatialReference||(l.spatialReference=i.spatialReference),{geometry:l}):{error:"Failed to combine geometries from geometry layer."}}catch(n){return{error:`Failed to query geometry: ${String(n)}`}}}return{error:"Invalid geometry configuration provided"}},I=r.object({id:r.string()}),j=r.discriminatedUnion("kind",[r.object({id:r.string(),kind:r.literal("point"),payload:r.object({x:r.number(),y:r.number(),spatialReference:r.object({wkid:r.number()}).optional()})}),r.object({id:r.string(),kind:r.literal("polyline"),payload:r.object({paths:r.array(r.array(r.array(r.number()))),spatialReference:r.object({wkid:r.number()}).optional()})}),r.object({id:r.string(),kind:r.literal("polygon"),payload:r.object({rings:r.array(r.array(r.array(r.number()))),spatialReference:r.object({wkid:r.number()}).optional()})})]),U=r.object({sharedResourceId:r.string().describe("ID of a point, polyline, or polygon returned by listSharedResources."),distance:r.number().optional().describe("Optional buffer distance around the geometry."),units:d.optional().describe("The units for the distance buffer.")}),q=(e,i)=>{if(!e||!("sharedResourceId"in e))return e;if(!i)throw new Error("Shared resources are unavailable in the tool runtime state.");let t=i.find(a=>{let n=I.safeParse(a);return n.success&&n.data.id===e.sharedResourceId});if(!t)throw new Error(`Shared resource not found: ${e.sharedResourceId}`);let o=j.safeParse(t);if(!o.success)throw new Error(`Shared resource ${e.sharedResourceId} does not contain valid point, polyline, or polygon geometry.`);switch(o.data.kind){case"point":return{point:o.data.payload,distance:e.distance,units:e.units};case"polyline":return{polyline:o.data.payload,distance:e.distance,units:e.units};case"polygon":return{polygon:o.data.payload,distance:e.distance,units:e.units}}};return{a:d,b:h,c:b,d:F,e:U,f:q}},"geometry/Point","geometry/Polygon","geometry/Polyline","geometry/operators/unionOperator")
@@ -0,0 +1,2 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
+ import{a}from"./AQF6BBWC.js";import"./ONQ6JSBJ.js";import"./RFPTOFM4.js";import"./FSLPYC4Y.js";import"./AMP43OT2.js";import"./2UKFCF2J.js";import"./UZLQALHY.js";export{a as goToHomeExtentTool};