@apdesign/oms-agent 0.1.0

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.
@@ -0,0 +1,144 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const F=require("react");var Ve=typeof document<"u"?document.currentScript:null;function Zs(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var zt={exports:{}},st={};/**
2
+ * @license React
3
+ * react-jsx-runtime.production.js
4
+ *
5
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
6
+ *
7
+ * This source code is licensed under the MIT license found in the
8
+ * LICENSE file in the root directory of this source tree.
9
+ */var Pr;function js(){if(Pr)return st;Pr=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function r(n,o,s){var a=null;if(s!==void 0&&(a=""+s),o.key!==void 0&&(a=""+o.key),"key"in o){s={};for(var i in o)i!=="key"&&(s[i]=o[i])}else s=o;return o=s.ref,{$$typeof:e,type:n,key:a,ref:o!==void 0?o:null,props:s}}return st.Fragment=t,st.jsx=r,st.jsxs=r,st}var at={};/**
10
+ * @license React
11
+ * react-jsx-runtime.development.js
12
+ *
13
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
14
+ *
15
+ * This source code is licensed under the MIT license found in the
16
+ * LICENSE file in the root directory of this source tree.
17
+ */var Rr;function Ms(){return Rr||(Rr=1,process.env.NODE_ENV!=="production"&&(function(){function e(b){if(b==null)return null;if(typeof b=="function")return b.$$typeof===kt?null:b.displayName||b.name||null;if(typeof b=="string")return b;switch(b){case _:return"Fragment";case E:return"Profiler";case y:return"StrictMode";case N:return"Suspense";case Z:return"SuspenseList";case wt:return"Activity"}if(typeof b=="object")switch(typeof b.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),b.$$typeof){case v:return"Portal";case O:return b.displayName||"Context";case p:return(b._context.displayName||"Context")+".Consumer";case P:var C=b.render;return b=b.displayName,b||(b=C.displayName||C.name||"",b=b!==""?"ForwardRef("+b+")":"ForwardRef"),b;case k:return C=b.displayName||null,C!==null?C:e(b.type)||"Memo";case Q:C=b._payload,b=b._init;try{return e(b(C))}catch{}}return null}function t(b){return""+b}function r(b){try{t(b);var C=!1}catch{C=!0}if(C){C=console;var J=C.error,H=typeof Symbol=="function"&&Symbol.toStringTag&&b[Symbol.toStringTag]||b.constructor.name||"Object";return J.call(C,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",H),t(b)}}function n(b){if(b===_)return"<>";if(typeof b=="object"&&b!==null&&b.$$typeof===Q)return"<...>";try{var C=e(b);return C?"<"+C+">":"<...>"}catch{return"<...>"}}function o(){var b=ke.A;return b===null?null:b.getOwner()}function s(){return Error("react-stack-top-frame")}function a(b){if(nt.call(b,"key")){var C=Object.getOwnPropertyDescriptor(b,"key").get;if(C&&C.isReactWarning)return!1}return b.key!==void 0}function i(b,C){function J(){ce||(ce=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",C))}J.isReactWarning=!0,Object.defineProperty(b,"key",{get:J,configurable:!0})}function l(){var b=e(this.type);return ve[b]||(ve[b]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),b=this.props.ref,b!==void 0?b:null}function c(b,C,J,H,ee,te){var G=J.ref;return b={$$typeof:w,type:b,key:C,props:J,_owner:H},(G!==void 0?G:null)!==null?Object.defineProperty(b,"ref",{enumerable:!1,get:l}):Object.defineProperty(b,"ref",{enumerable:!1,value:null}),b._store={},Object.defineProperty(b._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(b,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(b,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:ee}),Object.defineProperty(b,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:te}),Object.freeze&&(Object.freeze(b.props),Object.freeze(b)),b}function u(b,C,J,H,ee,te){var G=C.children;if(G!==void 0)if(H)if(ot(G)){for(H=0;H<G.length;H++)d(G[H]);Object.freeze&&Object.freeze(G)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else d(G);if(nt.call(C,"key")){G=e(b);var _e=Object.keys(C).filter(function(xt){return xt!=="key"});H=0<_e.length?"{key: someKey, "+_e.join(": ..., ")+": ...}":"{key: someKey}",z[G+H]||(_e=0<_e.length?"{"+_e.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
18
+ let props = %s;
19
+ <%s {...props} />
20
+ React keys must be passed directly to JSX without using spread:
21
+ let props = %s;
22
+ <%s key={someKey} {...props} />`,H,G,_e,G),z[G+H]=!0)}if(G=null,J!==void 0&&(r(J),G=""+J),a(C)&&(r(C.key),G=""+C.key),"key"in C){J={};for(var K in C)K!=="key"&&(J[K]=C[K])}else J=C;return G&&i(J,typeof b=="function"?b.displayName||b.name||"Unknown":b),c(b,G,J,o(),ee,te)}function d(b){f(b)?b._store&&(b._store.validated=1):typeof b=="object"&&b!==null&&b.$$typeof===Q&&(b._payload.status==="fulfilled"?f(b._payload.value)&&b._payload.value._store&&(b._payload.value._store.validated=1):b._store&&(b._store.validated=1))}function f(b){return typeof b=="object"&&b!==null&&b.$$typeof===w}var m=F,w=Symbol.for("react.transitional.element"),v=Symbol.for("react.portal"),_=Symbol.for("react.fragment"),y=Symbol.for("react.strict_mode"),E=Symbol.for("react.profiler"),p=Symbol.for("react.consumer"),O=Symbol.for("react.context"),P=Symbol.for("react.forward_ref"),N=Symbol.for("react.suspense"),Z=Symbol.for("react.suspense_list"),k=Symbol.for("react.memo"),Q=Symbol.for("react.lazy"),wt=Symbol.for("react.activity"),kt=Symbol.for("react.client.reference"),ke=m.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,nt=Object.prototype.hasOwnProperty,ot=Array.isArray,ge=console.createTask?console.createTask:function(){return null};m={react_stack_bottom_frame:function(b){return b()}};var ce,ve={},Ue=m.react_stack_bottom_frame.bind(m,s)(),Je=ge(n(s)),z={};at.Fragment=_,at.jsx=function(b,C,J){var H=1e4>ke.recentlyCreatedOwnerStacks++;return u(b,C,J,!1,H?Error("react-stack-top-frame"):Ue,H?ge(n(b)):Je)},at.jsxs=function(b,C,J){var H=1e4>ke.recentlyCreatedOwnerStacks++;return u(b,C,J,!0,H?Error("react-stack-top-frame"):Ue,H?ge(n(b)):Je)}})()),at}var $r;function Ds(){return $r||($r=1,process.env.NODE_ENV==="production"?zt.exports=js():zt.exports=Ms()),zt.exports}var A=Ds();/**
23
+ * @license lucide-react v0.577.0 - ISC
24
+ *
25
+ * This source code is licensed under the ISC license.
26
+ * See the LICENSE file in the root directory of this source tree.
27
+ */const jn=(...e)=>e.filter((t,r,n)=>!!t&&t.trim()!==""&&n.indexOf(t)===r).join(" ").trim();/**
28
+ * @license lucide-react v0.577.0 - ISC
29
+ *
30
+ * This source code is licensed under the ISC license.
31
+ * See the LICENSE file in the root directory of this source tree.
32
+ */const Fs=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();/**
33
+ * @license lucide-react v0.577.0 - ISC
34
+ *
35
+ * This source code is licensed under the ISC license.
36
+ * See the LICENSE file in the root directory of this source tree.
37
+ */const Ls=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,r,n)=>n?n.toUpperCase():r.toLowerCase());/**
38
+ * @license lucide-react v0.577.0 - ISC
39
+ *
40
+ * This source code is licensed under the ISC license.
41
+ * See the LICENSE file in the root directory of this source tree.
42
+ */const Cr=e=>{const t=Ls(e);return t.charAt(0).toUpperCase()+t.slice(1)};/**
43
+ * @license lucide-react v0.577.0 - ISC
44
+ *
45
+ * This source code is licensed under the ISC license.
46
+ * See the LICENSE file in the root directory of this source tree.
47
+ */var Us={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
48
+ * @license lucide-react v0.577.0 - ISC
49
+ *
50
+ * This source code is licensed under the ISC license.
51
+ * See the LICENSE file in the root directory of this source tree.
52
+ */const Js=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1};/**
53
+ * @license lucide-react v0.577.0 - ISC
54
+ *
55
+ * This source code is licensed under the ISC license.
56
+ * See the LICENSE file in the root directory of this source tree.
57
+ */const Vs=F.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:r=2,absoluteStrokeWidth:n,className:o="",children:s,iconNode:a,...i},l)=>F.createElement("svg",{ref:l,...Us,width:t,height:t,stroke:e,strokeWidth:n?Number(r)*24/Number(t):r,className:jn("lucide",o),...!s&&!Js(i)&&{"aria-hidden":"true"},...i},[...a.map(([c,u])=>F.createElement(c,u)),...Array.isArray(s)?s:[s]]));/**
58
+ * @license lucide-react v0.577.0 - ISC
59
+ *
60
+ * This source code is licensed under the ISC license.
61
+ * See the LICENSE file in the root directory of this source tree.
62
+ */const vt=(e,t)=>{const r=F.forwardRef(({className:n,...o},s)=>F.createElement(Vs,{ref:s,iconNode:t,className:jn(`lucide-${Fs(Cr(e))}`,`lucide-${e}`,n),...o}));return r.displayName=Cr(e),r};/**
63
+ * @license lucide-react v0.577.0 - ISC
64
+ *
65
+ * This source code is licensed under the ISC license.
66
+ * See the LICENSE file in the root directory of this source tree.
67
+ */const Bs=[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]],Mn=vt("bot",Bs);/**
68
+ * @license lucide-react v0.577.0 - ISC
69
+ *
70
+ * This source code is licensed under the ISC license.
71
+ * See the LICENSE file in the root directory of this source tree.
72
+ */const Ws=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"22",x2:"18",y1:"12",y2:"12",key:"l9bcsi"}],["line",{x1:"6",x2:"2",y1:"12",y2:"12",key:"13hhkx"}],["line",{x1:"12",x2:"12",y1:"6",y2:"2",key:"10w3f3"}],["line",{x1:"12",x2:"12",y1:"22",y2:"18",key:"15g9kq"}]],qs=vt("crosshair",Ws);/**
73
+ * @license lucide-react v0.577.0 - ISC
74
+ *
75
+ * This source code is licensed under the ISC license.
76
+ * See the LICENSE file in the root directory of this source tree.
77
+ */const Gs=[["path",{d:"M4 12.15V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.706.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2h-3.35",key:"1wthlu"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"m5 16-3 3 3 3",key:"331omg"}],["path",{d:"m9 22 3-3-3-3",key:"lsp7cz"}]],Ys=vt("file-code-corner",Gs);/**
78
+ * @license lucide-react v0.577.0 - ISC
79
+ *
80
+ * This source code is licensed under the ISC license.
81
+ * See the LICENSE file in the root directory of this source tree.
82
+ */const Hs=[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]],Xs=vt("send",Hs);/**
83
+ * @license lucide-react v0.577.0 - ISC
84
+ *
85
+ * This source code is licensed under the ISC license.
86
+ * See the LICENSE file in the root directory of this source tree.
87
+ */const Ks=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Zr=vt("x",Ks);function Dn(e){var t,r,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(r=Dn(e[t]))&&(n&&(n+=" "),n+=r)}else for(r in e)e[r]&&(n&&(n+=" "),n+=r);return n}function Qs(){for(var e,t,r=0,n="",o=arguments.length;r<o;r++)(e=arguments[r])&&(t=Dn(e))&&(n&&(n+=" "),n+=t);return n}const ea=(e,t)=>{const r=new Array(e.length+t.length);for(let n=0;n<e.length;n++)r[n]=e[n];for(let n=0;n<t.length;n++)r[e.length+n]=t[n];return r},ta=(e,t)=>({classGroupId:e,validator:t}),Fn=(e=new Map,t=null,r)=>({nextPart:e,validators:t,classGroupId:r}),jt="-",jr=[],ra="arbitrary..",na=e=>{const t=sa(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:n}=e;return{getClassGroupId:a=>{if(a.startsWith("[")&&a.endsWith("]"))return oa(a);const i=a.split(jt),l=i[0]===""&&i.length>1?1:0;return Ln(i,l,t)},getConflictingClassGroupIds:(a,i)=>{if(i){const l=n[a],c=r[a];return l?c?ea(c,l):l:c||jr}return r[a]||jr}}},Ln=(e,t,r)=>{if(e.length-t===0)return r.classGroupId;const o=e[t],s=r.nextPart.get(o);if(s){const c=Ln(e,t+1,s);if(c)return c}const a=r.validators;if(a===null)return;const i=t===0?e.join(jt):e.slice(t).join(jt),l=a.length;for(let c=0;c<l;c++){const u=a[c];if(u.validator(i))return u.classGroupId}},oa=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),r=t.indexOf(":"),n=t.slice(0,r);return n?ra+n:void 0})(),sa=e=>{const{theme:t,classGroups:r}=e;return aa(r,t)},aa=(e,t)=>{const r=Fn();for(const n in e){const o=e[n];br(o,r,n,t)}return r},br=(e,t,r,n)=>{const o=e.length;for(let s=0;s<o;s++){const a=e[s];ia(a,t,r,n)}},ia=(e,t,r,n)=>{if(typeof e=="string"){ca(e,t,r);return}if(typeof e=="function"){la(e,t,r,n);return}ua(e,t,r,n)},ca=(e,t,r)=>{const n=e===""?t:Un(t,e);n.classGroupId=r},la=(e,t,r,n)=>{if(da(e)){br(e(n),t,r,n);return}t.validators===null&&(t.validators=[]),t.validators.push(ta(r,e))},ua=(e,t,r,n)=>{const o=Object.entries(e),s=o.length;for(let a=0;a<s;a++){const[i,l]=o[a];br(l,Un(t,i),r,n)}},Un=(e,t)=>{let r=e;const n=t.split(jt),o=n.length;for(let s=0;s<o;s++){const a=n[s];let i=r.nextPart.get(a);i||(i=Fn(),r.nextPart.set(a,i)),r=i}return r},da=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,pa=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,r=Object.create(null),n=Object.create(null);const o=(s,a)=>{r[s]=a,t++,t>e&&(t=0,n=r,r=Object.create(null))};return{get(s){let a=r[s];if(a!==void 0)return a;if((a=n[s])!==void 0)return o(s,a),a},set(s,a){s in r?r[s]=a:o(s,a)}}},ir="!",Mr=":",fa=[],Dr=(e,t,r,n,o)=>({modifiers:e,hasImportantModifier:t,baseClassName:r,maybePostfixModifierPosition:n,isExternal:o}),ma=e=>{const{prefix:t,experimentalParseClassName:r}=e;let n=o=>{const s=[];let a=0,i=0,l=0,c;const u=o.length;for(let v=0;v<u;v++){const _=o[v];if(a===0&&i===0){if(_===Mr){s.push(o.slice(l,v)),l=v+1;continue}if(_==="/"){c=v;continue}}_==="["?a++:_==="]"?a--:_==="("?i++:_===")"&&i--}const d=s.length===0?o:o.slice(l);let f=d,m=!1;d.endsWith(ir)?(f=d.slice(0,-1),m=!0):d.startsWith(ir)&&(f=d.slice(1),m=!0);const w=c&&c>l?c-l:void 0;return Dr(s,m,f,w)};if(t){const o=t+Mr,s=n;n=a=>a.startsWith(o)?s(a.slice(o.length)):Dr(fa,!1,a,void 0,!0)}if(r){const o=n;n=s=>r({className:s,parseClassName:o})}return n},ha=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((r,n)=>{t.set(r,1e6+n)}),r=>{const n=[];let o=[];for(let s=0;s<r.length;s++){const a=r[s],i=a[0]==="[",l=t.has(a);i||l?(o.length>0&&(o.sort(),n.push(...o),o=[]),n.push(a)):o.push(a)}return o.length>0&&(o.sort(),n.push(...o)),n}},ga=e=>({cache:pa(e.cacheSize),parseClassName:ma(e),sortModifiers:ha(e),...na(e)}),va=/\s+/,ba=(e,t)=>{const{parseClassName:r,getClassGroupId:n,getConflictingClassGroupIds:o,sortModifiers:s}=t,a=[],i=e.trim().split(va);let l="";for(let c=i.length-1;c>=0;c-=1){const u=i[c],{isExternal:d,modifiers:f,hasImportantModifier:m,baseClassName:w,maybePostfixModifierPosition:v}=r(u);if(d){l=u+(l.length>0?" "+l:l);continue}let _=!!v,y=n(_?w.substring(0,v):w);if(!y){if(!_){l=u+(l.length>0?" "+l:l);continue}if(y=n(w),!y){l=u+(l.length>0?" "+l:l);continue}_=!1}const E=f.length===0?"":f.length===1?f[0]:s(f).join(":"),p=m?E+ir:E,O=p+y;if(a.indexOf(O)>-1)continue;a.push(O);const P=o(y,_);for(let N=0;N<P.length;++N){const Z=P[N];a.push(p+Z)}l=u+(l.length>0?" "+l:l)}return l},ya=(...e)=>{let t=0,r,n,o="";for(;t<e.length;)(r=e[t++])&&(n=Jn(r))&&(o&&(o+=" "),o+=n);return o},Jn=e=>{if(typeof e=="string")return e;let t,r="";for(let n=0;n<e.length;n++)e[n]&&(t=Jn(e[n]))&&(r&&(r+=" "),r+=t);return r},_a=(e,...t)=>{let r,n,o,s;const a=l=>{const c=t.reduce((u,d)=>d(u),e());return r=ga(c),n=r.cache.get,o=r.cache.set,s=i,i(l)},i=l=>{const c=n(l);if(c)return c;const u=ba(l,r);return o(l,u),u};return s=a,(...l)=>s(ya(...l))},wa=[],re=e=>{const t=r=>r[e]||wa;return t.isThemeGetter=!0,t},Vn=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Bn=/^\((?:(\w[\w-]*):)?(.+)\)$/i,ka=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,xa=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Ea=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,Sa=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,Ia=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,za=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,xe=e=>ka.test(e),j=e=>!!e&&!Number.isNaN(Number(e)),Ee=e=>!!e&&Number.isInteger(Number(e)),er=e=>e.endsWith("%")&&j(e.slice(0,-1)),we=e=>xa.test(e),Wn=()=>!0,Ta=e=>Ea.test(e)&&!Sa.test(e),yr=()=>!1,Na=e=>Ia.test(e),Oa=e=>za.test(e),Aa=e=>!x(e)&&!S(e),Pa=e=>Ae(e,Yn,yr),x=e=>Vn.test(e),$e=e=>Ae(e,Hn,Ta),Fr=e=>Ae(e,Fa,j),Ra=e=>Ae(e,Kn,Wn),$a=e=>Ae(e,Xn,yr),Lr=e=>Ae(e,qn,yr),Ca=e=>Ae(e,Gn,Oa),Tt=e=>Ae(e,Qn,Na),S=e=>Bn.test(e),it=e=>Fe(e,Hn),Za=e=>Fe(e,Xn),Ur=e=>Fe(e,qn),ja=e=>Fe(e,Yn),Ma=e=>Fe(e,Gn),Nt=e=>Fe(e,Qn,!0),Da=e=>Fe(e,Kn,!0),Ae=(e,t,r)=>{const n=Vn.exec(e);return n?n[1]?t(n[1]):r(n[2]):!1},Fe=(e,t,r=!1)=>{const n=Bn.exec(e);return n?n[1]?t(n[1]):r:!1},qn=e=>e==="position"||e==="percentage",Gn=e=>e==="image"||e==="url",Yn=e=>e==="length"||e==="size"||e==="bg-size",Hn=e=>e==="length",Fa=e=>e==="number",Xn=e=>e==="family-name",Kn=e=>e==="number"||e==="weight",Qn=e=>e==="shadow",La=()=>{const e=re("color"),t=re("font"),r=re("text"),n=re("font-weight"),o=re("tracking"),s=re("leading"),a=re("breakpoint"),i=re("container"),l=re("spacing"),c=re("radius"),u=re("shadow"),d=re("inset-shadow"),f=re("text-shadow"),m=re("drop-shadow"),w=re("blur"),v=re("perspective"),_=re("aspect"),y=re("ease"),E=re("animate"),p=()=>["auto","avoid","all","avoid-page","page","left","right","column"],O=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],P=()=>[...O(),S,x],N=()=>["auto","hidden","clip","visible","scroll"],Z=()=>["auto","contain","none"],k=()=>[S,x,l],Q=()=>[xe,"full","auto",...k()],wt=()=>[Ee,"none","subgrid",S,x],kt=()=>["auto",{span:["full",Ee,S,x]},Ee,S,x],ke=()=>[Ee,"auto",S,x],nt=()=>["auto","min","max","fr",S,x],ot=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],ge=()=>["start","end","center","stretch","center-safe","end-safe"],ce=()=>["auto",...k()],ve=()=>[xe,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...k()],Ue=()=>[xe,"screen","full","dvw","lvw","svw","min","max","fit",...k()],Je=()=>[xe,"screen","full","lh","dvh","lvh","svh","min","max","fit",...k()],z=()=>[e,S,x],b=()=>[...O(),Ur,Lr,{position:[S,x]}],C=()=>["no-repeat",{repeat:["","x","y","space","round"]}],J=()=>["auto","cover","contain",ja,Pa,{size:[S,x]}],H=()=>[er,it,$e],ee=()=>["","none","full",c,S,x],te=()=>["",j,it,$e],G=()=>["solid","dashed","dotted","double"],_e=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],K=()=>[j,er,Ur,Lr],xt=()=>["","none",w,S,x],Et=()=>["none",j,S,x],St=()=>["none",j,S,x],Qt=()=>[j,S,x],It=()=>[xe,"full",...k()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[we],breakpoint:[we],color:[Wn],container:[we],"drop-shadow":[we],ease:["in","out","in-out"],font:[Aa],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[we],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[we],shadow:[we],spacing:["px",j],text:[we],"text-shadow":[we],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",xe,x,S,_]}],container:["container"],columns:[{columns:[j,x,S,i]}],"break-after":[{"break-after":p()}],"break-before":[{"break-before":p()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:P()}],overflow:[{overflow:N()}],"overflow-x":[{"overflow-x":N()}],"overflow-y":[{"overflow-y":N()}],overscroll:[{overscroll:Z()}],"overscroll-x":[{"overscroll-x":Z()}],"overscroll-y":[{"overscroll-y":Z()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:Q()}],"inset-x":[{"inset-x":Q()}],"inset-y":[{"inset-y":Q()}],start:[{"inset-s":Q(),start:Q()}],end:[{"inset-e":Q(),end:Q()}],"inset-bs":[{"inset-bs":Q()}],"inset-be":[{"inset-be":Q()}],top:[{top:Q()}],right:[{right:Q()}],bottom:[{bottom:Q()}],left:[{left:Q()}],visibility:["visible","invisible","collapse"],z:[{z:[Ee,"auto",S,x]}],basis:[{basis:[xe,"full","auto",i,...k()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[j,xe,"auto","initial","none",x]}],grow:[{grow:["",j,S,x]}],shrink:[{shrink:["",j,S,x]}],order:[{order:[Ee,"first","last","none",S,x]}],"grid-cols":[{"grid-cols":wt()}],"col-start-end":[{col:kt()}],"col-start":[{"col-start":ke()}],"col-end":[{"col-end":ke()}],"grid-rows":[{"grid-rows":wt()}],"row-start-end":[{row:kt()}],"row-start":[{"row-start":ke()}],"row-end":[{"row-end":ke()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":nt()}],"auto-rows":[{"auto-rows":nt()}],gap:[{gap:k()}],"gap-x":[{"gap-x":k()}],"gap-y":[{"gap-y":k()}],"justify-content":[{justify:[...ot(),"normal"]}],"justify-items":[{"justify-items":[...ge(),"normal"]}],"justify-self":[{"justify-self":["auto",...ge()]}],"align-content":[{content:["normal",...ot()]}],"align-items":[{items:[...ge(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...ge(),{baseline:["","last"]}]}],"place-content":[{"place-content":ot()}],"place-items":[{"place-items":[...ge(),"baseline"]}],"place-self":[{"place-self":["auto",...ge()]}],p:[{p:k()}],px:[{px:k()}],py:[{py:k()}],ps:[{ps:k()}],pe:[{pe:k()}],pbs:[{pbs:k()}],pbe:[{pbe:k()}],pt:[{pt:k()}],pr:[{pr:k()}],pb:[{pb:k()}],pl:[{pl:k()}],m:[{m:ce()}],mx:[{mx:ce()}],my:[{my:ce()}],ms:[{ms:ce()}],me:[{me:ce()}],mbs:[{mbs:ce()}],mbe:[{mbe:ce()}],mt:[{mt:ce()}],mr:[{mr:ce()}],mb:[{mb:ce()}],ml:[{ml:ce()}],"space-x":[{"space-x":k()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":k()}],"space-y-reverse":["space-y-reverse"],size:[{size:ve()}],"inline-size":[{inline:["auto",...Ue()]}],"min-inline-size":[{"min-inline":["auto",...Ue()]}],"max-inline-size":[{"max-inline":["none",...Ue()]}],"block-size":[{block:["auto",...Je()]}],"min-block-size":[{"min-block":["auto",...Je()]}],"max-block-size":[{"max-block":["none",...Je()]}],w:[{w:[i,"screen",...ve()]}],"min-w":[{"min-w":[i,"screen","none",...ve()]}],"max-w":[{"max-w":[i,"screen","none","prose",{screen:[a]},...ve()]}],h:[{h:["screen","lh",...ve()]}],"min-h":[{"min-h":["screen","lh","none",...ve()]}],"max-h":[{"max-h":["screen","lh",...ve()]}],"font-size":[{text:["base",r,it,$e]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[n,Da,Ra]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",er,x]}],"font-family":[{font:[Za,$a,t]}],"font-features":[{"font-features":[x]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[o,S,x]}],"line-clamp":[{"line-clamp":[j,"none",S,Fr]}],leading:[{leading:[s,...k()]}],"list-image":[{"list-image":["none",S,x]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",S,x]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:z()}],"text-color":[{text:z()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...G(),"wavy"]}],"text-decoration-thickness":[{decoration:[j,"from-font","auto",S,$e]}],"text-decoration-color":[{decoration:z()}],"underline-offset":[{"underline-offset":[j,"auto",S,x]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:k()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",S,x]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",S,x]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:b()}],"bg-repeat":[{bg:C()}],"bg-size":[{bg:J()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Ee,S,x],radial:["",S,x],conic:[Ee,S,x]},Ma,Ca]}],"bg-color":[{bg:z()}],"gradient-from-pos":[{from:H()}],"gradient-via-pos":[{via:H()}],"gradient-to-pos":[{to:H()}],"gradient-from":[{from:z()}],"gradient-via":[{via:z()}],"gradient-to":[{to:z()}],rounded:[{rounded:ee()}],"rounded-s":[{"rounded-s":ee()}],"rounded-e":[{"rounded-e":ee()}],"rounded-t":[{"rounded-t":ee()}],"rounded-r":[{"rounded-r":ee()}],"rounded-b":[{"rounded-b":ee()}],"rounded-l":[{"rounded-l":ee()}],"rounded-ss":[{"rounded-ss":ee()}],"rounded-se":[{"rounded-se":ee()}],"rounded-ee":[{"rounded-ee":ee()}],"rounded-es":[{"rounded-es":ee()}],"rounded-tl":[{"rounded-tl":ee()}],"rounded-tr":[{"rounded-tr":ee()}],"rounded-br":[{"rounded-br":ee()}],"rounded-bl":[{"rounded-bl":ee()}],"border-w":[{border:te()}],"border-w-x":[{"border-x":te()}],"border-w-y":[{"border-y":te()}],"border-w-s":[{"border-s":te()}],"border-w-e":[{"border-e":te()}],"border-w-bs":[{"border-bs":te()}],"border-w-be":[{"border-be":te()}],"border-w-t":[{"border-t":te()}],"border-w-r":[{"border-r":te()}],"border-w-b":[{"border-b":te()}],"border-w-l":[{"border-l":te()}],"divide-x":[{"divide-x":te()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":te()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...G(),"hidden","none"]}],"divide-style":[{divide:[...G(),"hidden","none"]}],"border-color":[{border:z()}],"border-color-x":[{"border-x":z()}],"border-color-y":[{"border-y":z()}],"border-color-s":[{"border-s":z()}],"border-color-e":[{"border-e":z()}],"border-color-bs":[{"border-bs":z()}],"border-color-be":[{"border-be":z()}],"border-color-t":[{"border-t":z()}],"border-color-r":[{"border-r":z()}],"border-color-b":[{"border-b":z()}],"border-color-l":[{"border-l":z()}],"divide-color":[{divide:z()}],"outline-style":[{outline:[...G(),"none","hidden"]}],"outline-offset":[{"outline-offset":[j,S,x]}],"outline-w":[{outline:["",j,it,$e]}],"outline-color":[{outline:z()}],shadow:[{shadow:["","none",u,Nt,Tt]}],"shadow-color":[{shadow:z()}],"inset-shadow":[{"inset-shadow":["none",d,Nt,Tt]}],"inset-shadow-color":[{"inset-shadow":z()}],"ring-w":[{ring:te()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:z()}],"ring-offset-w":[{"ring-offset":[j,$e]}],"ring-offset-color":[{"ring-offset":z()}],"inset-ring-w":[{"inset-ring":te()}],"inset-ring-color":[{"inset-ring":z()}],"text-shadow":[{"text-shadow":["none",f,Nt,Tt]}],"text-shadow-color":[{"text-shadow":z()}],opacity:[{opacity:[j,S,x]}],"mix-blend":[{"mix-blend":[..._e(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":_e()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[j]}],"mask-image-linear-from-pos":[{"mask-linear-from":K()}],"mask-image-linear-to-pos":[{"mask-linear-to":K()}],"mask-image-linear-from-color":[{"mask-linear-from":z()}],"mask-image-linear-to-color":[{"mask-linear-to":z()}],"mask-image-t-from-pos":[{"mask-t-from":K()}],"mask-image-t-to-pos":[{"mask-t-to":K()}],"mask-image-t-from-color":[{"mask-t-from":z()}],"mask-image-t-to-color":[{"mask-t-to":z()}],"mask-image-r-from-pos":[{"mask-r-from":K()}],"mask-image-r-to-pos":[{"mask-r-to":K()}],"mask-image-r-from-color":[{"mask-r-from":z()}],"mask-image-r-to-color":[{"mask-r-to":z()}],"mask-image-b-from-pos":[{"mask-b-from":K()}],"mask-image-b-to-pos":[{"mask-b-to":K()}],"mask-image-b-from-color":[{"mask-b-from":z()}],"mask-image-b-to-color":[{"mask-b-to":z()}],"mask-image-l-from-pos":[{"mask-l-from":K()}],"mask-image-l-to-pos":[{"mask-l-to":K()}],"mask-image-l-from-color":[{"mask-l-from":z()}],"mask-image-l-to-color":[{"mask-l-to":z()}],"mask-image-x-from-pos":[{"mask-x-from":K()}],"mask-image-x-to-pos":[{"mask-x-to":K()}],"mask-image-x-from-color":[{"mask-x-from":z()}],"mask-image-x-to-color":[{"mask-x-to":z()}],"mask-image-y-from-pos":[{"mask-y-from":K()}],"mask-image-y-to-pos":[{"mask-y-to":K()}],"mask-image-y-from-color":[{"mask-y-from":z()}],"mask-image-y-to-color":[{"mask-y-to":z()}],"mask-image-radial":[{"mask-radial":[S,x]}],"mask-image-radial-from-pos":[{"mask-radial-from":K()}],"mask-image-radial-to-pos":[{"mask-radial-to":K()}],"mask-image-radial-from-color":[{"mask-radial-from":z()}],"mask-image-radial-to-color":[{"mask-radial-to":z()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":O()}],"mask-image-conic-pos":[{"mask-conic":[j]}],"mask-image-conic-from-pos":[{"mask-conic-from":K()}],"mask-image-conic-to-pos":[{"mask-conic-to":K()}],"mask-image-conic-from-color":[{"mask-conic-from":z()}],"mask-image-conic-to-color":[{"mask-conic-to":z()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:b()}],"mask-repeat":[{mask:C()}],"mask-size":[{mask:J()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",S,x]}],filter:[{filter:["","none",S,x]}],blur:[{blur:xt()}],brightness:[{brightness:[j,S,x]}],contrast:[{contrast:[j,S,x]}],"drop-shadow":[{"drop-shadow":["","none",m,Nt,Tt]}],"drop-shadow-color":[{"drop-shadow":z()}],grayscale:[{grayscale:["",j,S,x]}],"hue-rotate":[{"hue-rotate":[j,S,x]}],invert:[{invert:["",j,S,x]}],saturate:[{saturate:[j,S,x]}],sepia:[{sepia:["",j,S,x]}],"backdrop-filter":[{"backdrop-filter":["","none",S,x]}],"backdrop-blur":[{"backdrop-blur":xt()}],"backdrop-brightness":[{"backdrop-brightness":[j,S,x]}],"backdrop-contrast":[{"backdrop-contrast":[j,S,x]}],"backdrop-grayscale":[{"backdrop-grayscale":["",j,S,x]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[j,S,x]}],"backdrop-invert":[{"backdrop-invert":["",j,S,x]}],"backdrop-opacity":[{"backdrop-opacity":[j,S,x]}],"backdrop-saturate":[{"backdrop-saturate":[j,S,x]}],"backdrop-sepia":[{"backdrop-sepia":["",j,S,x]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":k()}],"border-spacing-x":[{"border-spacing-x":k()}],"border-spacing-y":[{"border-spacing-y":k()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",S,x]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[j,"initial",S,x]}],ease:[{ease:["linear","initial",y,S,x]}],delay:[{delay:[j,S,x]}],animate:[{animate:["none",E,S,x]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[v,S,x]}],"perspective-origin":[{"perspective-origin":P()}],rotate:[{rotate:Et()}],"rotate-x":[{"rotate-x":Et()}],"rotate-y":[{"rotate-y":Et()}],"rotate-z":[{"rotate-z":Et()}],scale:[{scale:St()}],"scale-x":[{"scale-x":St()}],"scale-y":[{"scale-y":St()}],"scale-z":[{"scale-z":St()}],"scale-3d":["scale-3d"],skew:[{skew:Qt()}],"skew-x":[{"skew-x":Qt()}],"skew-y":[{"skew-y":Qt()}],transform:[{transform:[S,x,"","none","gpu","cpu"]}],"transform-origin":[{origin:P()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:It()}],"translate-x":[{"translate-x":It()}],"translate-y":[{"translate-y":It()}],"translate-z":[{"translate-z":It()}],"translate-none":["translate-none"],accent:[{accent:z()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:z()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",S,x]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":k()}],"scroll-mx":[{"scroll-mx":k()}],"scroll-my":[{"scroll-my":k()}],"scroll-ms":[{"scroll-ms":k()}],"scroll-me":[{"scroll-me":k()}],"scroll-mbs":[{"scroll-mbs":k()}],"scroll-mbe":[{"scroll-mbe":k()}],"scroll-mt":[{"scroll-mt":k()}],"scroll-mr":[{"scroll-mr":k()}],"scroll-mb":[{"scroll-mb":k()}],"scroll-ml":[{"scroll-ml":k()}],"scroll-p":[{"scroll-p":k()}],"scroll-px":[{"scroll-px":k()}],"scroll-py":[{"scroll-py":k()}],"scroll-ps":[{"scroll-ps":k()}],"scroll-pe":[{"scroll-pe":k()}],"scroll-pbs":[{"scroll-pbs":k()}],"scroll-pbe":[{"scroll-pbe":k()}],"scroll-pt":[{"scroll-pt":k()}],"scroll-pr":[{"scroll-pr":k()}],"scroll-pb":[{"scroll-pb":k()}],"scroll-pl":[{"scroll-pl":k()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",S,x]}],fill:[{fill:["none",...z()]}],"stroke-w":[{stroke:[j,it,$e,Fr]}],stroke:[{stroke:["none",...z()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},Ua=_a(La);function $t(...e){return Ua(Qs(e))}function Ja(e){return new Promise(t=>window.setTimeout(t,e))}var eo="vercel.ai.error",Va=Symbol.for(eo),Jr,Vr,ye=class to extends(Vr=Error,Jr=Va,Vr){constructor({name:t,message:r,cause:n}){super(r),this[Jr]=!0,this.name=t,this.cause=n}static isInstance(t){return to.hasMarker(t,eo)}static hasMarker(t,r){const n=Symbol.for(r);return t!=null&&typeof t=="object"&&n in t&&typeof t[n]=="boolean"&&t[n]===!0}};function ro(e){return e==null?"unknown error":typeof e=="string"?e:e instanceof Error?e.message:JSON.stringify(e)}var no="AI_InvalidArgumentError",oo=`vercel.ai.error.${no}`,Ba=Symbol.for(oo),Br,Wr,Wa=class extends(Wr=ye,Br=Ba,Wr){constructor({message:e,cause:t,argument:r}){super({name:no,message:e,cause:t}),this[Br]=!0,this.argument=r}static isInstance(e){return ye.hasMarker(e,oo)}},so="AI_JSONParseError",ao=`vercel.ai.error.${so}`,qa=Symbol.for(ao),qr,Gr,Yr=class extends(Gr=ye,qr=qa,Gr){constructor({text:e,cause:t}){super({name:so,message:`JSON parsing failed: Text: ${e}.
88
+ Error message: ${ro(t)}`,cause:t}),this[qr]=!0,this.text=e}static isInstance(e){return ye.hasMarker(e,ao)}},io="AI_TypeValidationError",co=`vercel.ai.error.${io}`,Ga=Symbol.for(co),Hr,Xr,Ke=class cr extends(Xr=ye,Hr=Ga,Xr){constructor({value:t,cause:r,context:n}){let o="Type validation failed";if(n!=null&&n.field&&(o+=` for ${n.field}`),n!=null&&n.entityName||n!=null&&n.entityId){o+=" (";const s=[];n.entityName&&s.push(n.entityName),n.entityId&&s.push(`id: "${n.entityId}"`),o+=s.join(", "),o+=")"}super({name:io,message:`${o}: Value: ${JSON.stringify(t)}.
89
+ Error message: ${ro(r)}`,cause:r}),this[Hr]=!0,this.value=t,this.context=n}static isInstance(t){return ye.hasMarker(t,co)}static wrap({value:t,cause:r,context:n}){var o,s,a;return cr.isInstance(r)&&r.value===t&&((o=r.context)==null?void 0:o.field)===(n==null?void 0:n.field)&&((s=r.context)==null?void 0:s.entityName)===(n==null?void 0:n.entityName)&&((a=r.context)==null?void 0:a.entityId)===(n==null?void 0:n.entityId)?r:new cr({value:t,cause:r,context:n})}};function h(e,t,r){function n(i,l){if(i._zod||Object.defineProperty(i,"_zod",{value:{def:l,constr:a,traits:new Set},enumerable:!1}),i._zod.traits.has(e))return;i._zod.traits.add(e),t(i,l);const c=a.prototype,u=Object.keys(c);for(let d=0;d<u.length;d++){const f=u[d];f in i||(i[f]=c[f].bind(i))}}const o=(r==null?void 0:r.Parent)??Object;class s extends o{}Object.defineProperty(s,"name",{value:e});function a(i){var l;const c=r!=null&&r.Parent?new s:this;n(c,i),(l=c._zod).deferred??(l.deferred=[]);for(const u of c._zod.deferred)u();return c}return Object.defineProperty(a,"init",{value:n}),Object.defineProperty(a,Symbol.hasInstance,{value:i=>{var l,c;return r!=null&&r.Parent&&i instanceof r.Parent?!0:(c=(l=i==null?void 0:i._zod)==null?void 0:l.traits)==null?void 0:c.has(e)}}),Object.defineProperty(a,"name",{value:e}),a}class Xe extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class lo extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}}const uo={};function Ne(e){return uo}function po(e){const t=Object.values(e).filter(n=>typeof n=="number");return Object.entries(e).filter(([n,o])=>t.indexOf(+n)===-1).map(([n,o])=>o)}function lr(e,t){return typeof t=="bigint"?t.toString():t}function Gt(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function _r(e){return e==null}function wr(e){const t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}function Ya(e,t){const r=(e.toString().split(".")[1]||"").length,n=t.toString();let o=(n.split(".")[1]||"").length;if(o===0&&/\d?e-\d?/.test(n)){const l=n.match(/\d?e-(\d?)/);l!=null&&l[1]&&(o=Number.parseInt(l[1]))}const s=r>o?r:o,a=Number.parseInt(e.toFixed(s).replace(".","")),i=Number.parseInt(t.toFixed(s).replace(".",""));return a%i/10**s}const Kr=Symbol("evaluating");function D(e,t,r){let n;Object.defineProperty(e,t,{get(){if(n!==Kr)return n===void 0&&(n=Kr,n=r()),n},set(o){Object.defineProperty(e,t,{value:o})},configurable:!0})}function Le(e,t,r){Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!0,configurable:!0})}function Pe(...e){const t={};for(const r of e){const n=Object.getOwnPropertyDescriptors(r);Object.assign(t,n)}return Object.defineProperties({},t)}function Qr(e){return JSON.stringify(e)}function Ha(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const fo="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function pt(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const Xa=Gt(()=>{var e;if(typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)!=null&&e.includes("Cloudflare")))return!1;try{const t=Function;return new t(""),!0}catch{return!1}});function Qe(e){if(pt(e)===!1)return!1;const t=e.constructor;if(t===void 0||typeof t!="function")return!0;const r=t.prototype;return!(pt(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}function mo(e){return Qe(e)?{...e}:Array.isArray(e)?[...e]:e}const Ka=new Set(["string","number","symbol"]);function et(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Re(e,t,r){const n=new e._zod.constr(t??e._zod.def);return(!t||r!=null&&r.parent)&&(n._zod.parent=e),n}function I(e){const t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if((t==null?void 0:t.message)!==void 0){if((t==null?void 0:t.error)!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function Qa(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}const ei={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function ti(e,t){const r=e._zod.def,n=r.checks;if(n&&n.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");const s=Pe(e._zod.def,{get shape(){const a={};for(const i in t){if(!(i in r.shape))throw new Error(`Unrecognized key: "${i}"`);t[i]&&(a[i]=r.shape[i])}return Le(this,"shape",a),a},checks:[]});return Re(e,s)}function ri(e,t){const r=e._zod.def,n=r.checks;if(n&&n.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");const s=Pe(e._zod.def,{get shape(){const a={...e._zod.def.shape};for(const i in t){if(!(i in r.shape))throw new Error(`Unrecognized key: "${i}"`);t[i]&&delete a[i]}return Le(this,"shape",a),a},checks:[]});return Re(e,s)}function ni(e,t){if(!Qe(t))throw new Error("Invalid input to extend: expected a plain object");const r=e._zod.def.checks;if(r&&r.length>0){const s=e._zod.def.shape;for(const a in t)if(Object.getOwnPropertyDescriptor(s,a)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}const o=Pe(e._zod.def,{get shape(){const s={...e._zod.def.shape,...t};return Le(this,"shape",s),s}});return Re(e,o)}function oi(e,t){if(!Qe(t))throw new Error("Invalid input to safeExtend: expected a plain object");const r=Pe(e._zod.def,{get shape(){const n={...e._zod.def.shape,...t};return Le(this,"shape",n),n}});return Re(e,r)}function si(e,t){const r=Pe(e._zod.def,{get shape(){const n={...e._zod.def.shape,...t._zod.def.shape};return Le(this,"shape",n),n},get catchall(){return t._zod.def.catchall},checks:[]});return Re(e,r)}function ai(e,t,r){const o=t._zod.def.checks;if(o&&o.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");const a=Pe(t._zod.def,{get shape(){const i=t._zod.def.shape,l={...i};if(r)for(const c in r){if(!(c in i))throw new Error(`Unrecognized key: "${c}"`);r[c]&&(l[c]=e?new e({type:"optional",innerType:i[c]}):i[c])}else for(const c in i)l[c]=e?new e({type:"optional",innerType:i[c]}):i[c];return Le(this,"shape",l),l},checks:[]});return Re(t,a)}function ii(e,t,r){const n=Pe(t._zod.def,{get shape(){const o=t._zod.def.shape,s={...o};if(r)for(const a in r){if(!(a in s))throw new Error(`Unrecognized key: "${a}"`);r[a]&&(s[a]=new e({type:"nonoptional",innerType:o[a]}))}else for(const a in o)s[a]=new e({type:"nonoptional",innerType:o[a]});return Le(this,"shape",s),s}});return Re(t,n)}function Ye(e,t=0){var r;if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(((r=e.issues[n])==null?void 0:r.continue)!==!0)return!0;return!1}function He(e,t){return t.map(r=>{var n;return(n=r).path??(n.path=[]),r.path.unshift(e),r})}function Ot(e){return typeof e=="string"?e:e==null?void 0:e.message}function Oe(e,t,r){var o,s,a,i,l,c;const n={...e,path:e.path??[]};if(!e.message){const u=Ot((a=(s=(o=e.inst)==null?void 0:o._zod.def)==null?void 0:s.error)==null?void 0:a.call(s,e))??Ot((i=t==null?void 0:t.error)==null?void 0:i.call(t,e))??Ot((l=r.customError)==null?void 0:l.call(r,e))??Ot((c=r.localeError)==null?void 0:c.call(r,e))??"Invalid input";n.message=u}return delete n.inst,delete n.continue,t!=null&&t.reportInput||delete n.input,n}function kr(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function ft(...e){const[t,r,n]=e;return typeof t=="string"?{message:t,code:"custom",input:r,inst:n}:{...t}}const ho=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,lr,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},go=h("$ZodError",ho),vo=h("$ZodError",ho,{Parent:Error});function ci(e,t=r=>r.message){const r={},n=[];for(const o of e.issues)o.path.length>0?(r[o.path[0]]=r[o.path[0]]||[],r[o.path[0]].push(t(o))):n.push(t(o));return{formErrors:n,fieldErrors:r}}function li(e,t=r=>r.message){const r={_errors:[]},n=o=>{for(const s of o.issues)if(s.code==="invalid_union"&&s.errors.length)s.errors.map(a=>n({issues:a}));else if(s.code==="invalid_key")n({issues:s.issues});else if(s.code==="invalid_element")n({issues:s.issues});else if(s.path.length===0)r._errors.push(t(s));else{let a=r,i=0;for(;i<s.path.length;){const l=s.path[i];i===s.path.length-1?(a[l]=a[l]||{_errors:[]},a[l]._errors.push(t(s))):a[l]=a[l]||{_errors:[]},a=a[l],i++}}};return n(e),r}const xr=e=>(t,r,n,o)=>{const s=n?Object.assign(n,{async:!1}):{async:!1},a=t._zod.run({value:r,issues:[]},s);if(a instanceof Promise)throw new Xe;if(a.issues.length){const i=new((o==null?void 0:o.Err)??e)(a.issues.map(l=>Oe(l,s,Ne())));throw fo(i,o==null?void 0:o.callee),i}return a.value},Er=e=>async(t,r,n,o)=>{const s=n?Object.assign(n,{async:!0}):{async:!0};let a=t._zod.run({value:r,issues:[]},s);if(a instanceof Promise&&(a=await a),a.issues.length){const i=new((o==null?void 0:o.Err)??e)(a.issues.map(l=>Oe(l,s,Ne())));throw fo(i,o==null?void 0:o.callee),i}return a.value},Yt=e=>(t,r,n)=>{const o=n?{...n,async:!1}:{async:!1},s=t._zod.run({value:r,issues:[]},o);if(s instanceof Promise)throw new Xe;return s.issues.length?{success:!1,error:new(e??go)(s.issues.map(a=>Oe(a,o,Ne())))}:{success:!0,data:s.value}},ui=Yt(vo),Ht=e=>async(t,r,n)=>{const o=n?Object.assign(n,{async:!0}):{async:!0};let s=t._zod.run({value:r,issues:[]},o);return s instanceof Promise&&(s=await s),s.issues.length?{success:!1,error:new e(s.issues.map(a=>Oe(a,o,Ne())))}:{success:!0,data:s.value}},di=Ht(vo),pi=e=>(t,r,n)=>{const o=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return xr(e)(t,r,o)},fi=e=>(t,r,n)=>xr(e)(t,r,n),mi=e=>async(t,r,n)=>{const o=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return Er(e)(t,r,o)},hi=e=>async(t,r,n)=>Er(e)(t,r,n),gi=e=>(t,r,n)=>{const o=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return Yt(e)(t,r,o)},vi=e=>(t,r,n)=>Yt(e)(t,r,n),bi=e=>async(t,r,n)=>{const o=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return Ht(e)(t,r,o)},yi=e=>async(t,r,n)=>Ht(e)(t,r,n),_i=/^[cC][^\s-]{8,}$/,wi=/^[0-9a-z]+$/,ki=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,xi=/^[0-9a-vA-V]{20}$/,Ei=/^[A-Za-z0-9]{27}$/,Si=/^[a-zA-Z0-9_-]{21}$/,Ii=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,zi=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,en=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,Ti=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,Ni="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function Oi(){return new RegExp(Ni,"u")}const Ai=/^(?:(?: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])$/,Pi=/^(([0-9a-fA-F]{1,4}:){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}|:))$/,Ri=/^((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])\/([0-9]|[1-2][0-9]|3[0-2])$/,$i=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Ci=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,bo=/^[A-Za-z0-9_-]*$/,Zi=/^\+[1-9]\d{6,14}$/,yo="(?:(?:\\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])))",ji=new RegExp(`^${yo}$`);function _o(e){const t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function Mi(e){return new RegExp(`^${_o(e)}$`)}function Di(e){const t=_o({precision:e.precision}),r=["Z"];e.local&&r.push(""),e.offset&&r.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const n=`${t}(?:${r.join("|")})`;return new RegExp(`^${yo}T(?:${n})$`)}const Fi=e=>{const t=e?`[\\s\\S]{${(e==null?void 0:e.minimum)??0},${(e==null?void 0:e.maximum)??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},Li=/^-?\d+$/,wo=/^-?\d+(?:\.\d+)?$/,Ui=/^(?:true|false)$/i,Ji=/^null$/i,Vi=/^[^A-Z]*$/,Bi=/^[^a-z]*$/,le=h("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])}),ko={number:"number",bigint:"bigint",object:"date"},xo=h("$ZodCheckLessThan",(e,t)=>{le.init(e,t);const r=ko[typeof t.value];e._zod.onattach.push(n=>{const o=n._zod.bag,s=(t.inclusive?o.maximum:o.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<s&&(t.inclusive?o.maximum=t.value:o.exclusiveMaximum=t.value)}),e._zod.check=n=>{(t.inclusive?n.value<=t.value:n.value<t.value)||n.issues.push({origin:r,code:"too_big",maximum:typeof t.value=="object"?t.value.getTime():t.value,input:n.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Eo=h("$ZodCheckGreaterThan",(e,t)=>{le.init(e,t);const r=ko[typeof t.value];e._zod.onattach.push(n=>{const o=n._zod.bag,s=(t.inclusive?o.minimum:o.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>s&&(t.inclusive?o.minimum=t.value:o.exclusiveMinimum=t.value)}),e._zod.check=n=>{(t.inclusive?n.value>=t.value:n.value>t.value)||n.issues.push({origin:r,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:n.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Wi=h("$ZodCheckMultipleOf",(e,t)=>{le.init(e,t),e._zod.onattach.push(r=>{var n;(n=r._zod.bag).multipleOf??(n.multipleOf=t.value)}),e._zod.check=r=>{if(typeof r.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof r.value=="bigint"?r.value%t.value===BigInt(0):Ya(r.value,t.value)===0)||r.issues.push({origin:typeof r.value,code:"not_multiple_of",divisor:t.value,input:r.value,inst:e,continue:!t.abort})}}),qi=h("$ZodCheckNumberFormat",(e,t)=>{var a;le.init(e,t),t.format=t.format||"float64";const r=(a=t.format)==null?void 0:a.includes("int"),n=r?"int":"number",[o,s]=ei[t.format];e._zod.onattach.push(i=>{const l=i._zod.bag;l.format=t.format,l.minimum=o,l.maximum=s,r&&(l.pattern=Li)}),e._zod.check=i=>{const l=i.value;if(r){if(!Number.isInteger(l)){i.issues.push({expected:n,format:t.format,code:"invalid_type",continue:!1,input:l,inst:e});return}if(!Number.isSafeInteger(l)){l>0?i.issues.push({input:l,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:n,inclusive:!0,continue:!t.abort}):i.issues.push({input:l,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:n,inclusive:!0,continue:!t.abort});return}}l<o&&i.issues.push({origin:"number",input:l,code:"too_small",minimum:o,inclusive:!0,inst:e,continue:!t.abort}),l>s&&i.issues.push({origin:"number",input:l,code:"too_big",maximum:s,inclusive:!0,inst:e,continue:!t.abort})}}),Gi=h("$ZodCheckMaxLength",(e,t)=>{var r;le.init(e,t),(r=e._zod.def).when??(r.when=n=>{const o=n.value;return!_r(o)&&o.length!==void 0}),e._zod.onattach.push(n=>{const o=n._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<o&&(n._zod.bag.maximum=t.maximum)}),e._zod.check=n=>{const o=n.value;if(o.length<=t.maximum)return;const a=kr(o);n.issues.push({origin:a,code:"too_big",maximum:t.maximum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),Yi=h("$ZodCheckMinLength",(e,t)=>{var r;le.init(e,t),(r=e._zod.def).when??(r.when=n=>{const o=n.value;return!_r(o)&&o.length!==void 0}),e._zod.onattach.push(n=>{const o=n._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>o&&(n._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{const o=n.value;if(o.length>=t.minimum)return;const a=kr(o);n.issues.push({origin:a,code:"too_small",minimum:t.minimum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),Hi=h("$ZodCheckLengthEquals",(e,t)=>{var r;le.init(e,t),(r=e._zod.def).when??(r.when=n=>{const o=n.value;return!_r(o)&&o.length!==void 0}),e._zod.onattach.push(n=>{const o=n._zod.bag;o.minimum=t.length,o.maximum=t.length,o.length=t.length}),e._zod.check=n=>{const o=n.value,s=o.length;if(s===t.length)return;const a=kr(o),i=s>t.length;n.issues.push({origin:a,...i?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),Xt=h("$ZodCheckStringFormat",(e,t)=>{var r,n;le.init(e,t),e._zod.onattach.push(o=>{const s=o._zod.bag;s.format=t.format,t.pattern&&(s.patterns??(s.patterns=new Set),s.patterns.add(t.pattern))}),t.pattern?(r=e._zod).check??(r.check=o=>{t.pattern.lastIndex=0,!t.pattern.test(o.value)&&o.issues.push({origin:"string",code:"invalid_format",format:t.format,input:o.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(n=e._zod).check??(n.check=()=>{})}),Xi=h("$ZodCheckRegex",(e,t)=>{Xt.init(e,t),e._zod.check=r=>{t.pattern.lastIndex=0,!t.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),Ki=h("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=Vi),Xt.init(e,t)}),Qi=h("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=Bi),Xt.init(e,t)}),ec=h("$ZodCheckIncludes",(e,t)=>{le.init(e,t);const r=et(t.includes),n=new RegExp(typeof t.position=="number"?`^.{${t.position}}${r}`:r);t.pattern=n,e._zod.onattach.push(o=>{const s=o._zod.bag;s.patterns??(s.patterns=new Set),s.patterns.add(n)}),e._zod.check=o=>{o.value.includes(t.includes,t.position)||o.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:o.value,inst:e,continue:!t.abort})}}),tc=h("$ZodCheckStartsWith",(e,t)=>{le.init(e,t);const r=new RegExp(`^${et(t.prefix)}.*`);t.pattern??(t.pattern=r),e._zod.onattach.push(n=>{const o=n._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(r)}),e._zod.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}}),rc=h("$ZodCheckEndsWith",(e,t)=>{le.init(e,t);const r=new RegExp(`.*${et(t.suffix)}$`);t.pattern??(t.pattern=r),e._zod.onattach.push(n=>{const o=n._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(r)}),e._zod.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}}),nc=h("$ZodCheckOverwrite",(e,t)=>{le.init(e,t),e._zod.check=r=>{r.value=t.tx(r.value)}});class oc{constructor(t=[]){this.content=[],this.indent=0,this&&(this.args=t)}indented(t){this.indent+=1,t(this),this.indent-=1}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}const n=t.split(`
90
+ `).filter(a=>a),o=Math.min(...n.map(a=>a.length-a.trimStart().length)),s=n.map(a=>a.slice(o)).map(a=>" ".repeat(this.indent*2)+a);for(const a of s)this.content.push(a)}compile(){const t=Function,r=this==null?void 0:this.args,o=[...((this==null?void 0:this.content)??[""]).map(s=>` ${s}`)];return new t(...r,o.join(`
91
+ `))}}const sc={major:4,minor:3,patch:6},W=h("$ZodType",(e,t)=>{var o;var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=sc;const n=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&n.unshift(e);for(const s of n)for(const a of s._zod.onattach)a(e);if(n.length===0)(r=e._zod).deferred??(r.deferred=[]),(o=e._zod.deferred)==null||o.push(()=>{e._zod.run=e._zod.parse});else{const s=(i,l,c)=>{let u=Ye(i),d;for(const f of l){if(f._zod.def.when){if(!f._zod.def.when(i))continue}else if(u)continue;const m=i.issues.length,w=f._zod.check(i);if(w instanceof Promise&&(c==null?void 0:c.async)===!1)throw new Xe;if(d||w instanceof Promise)d=(d??Promise.resolve()).then(async()=>{await w,i.issues.length!==m&&(u||(u=Ye(i,m)))});else{if(i.issues.length===m)continue;u||(u=Ye(i,m))}}return d?d.then(()=>i):i},a=(i,l,c)=>{if(Ye(i))return i.aborted=!0,i;const u=s(l,n,c);if(u instanceof Promise){if(c.async===!1)throw new Xe;return u.then(d=>e._zod.parse(d,c))}return e._zod.parse(u,c)};e._zod.run=(i,l)=>{if(l.skipChecks)return e._zod.parse(i,l);if(l.direction==="backward"){const u=e._zod.parse({value:i.value,issues:[]},{...l,skipChecks:!0});return u instanceof Promise?u.then(d=>a(d,i,l)):a(u,i,l)}const c=e._zod.parse(i,l);if(c instanceof Promise){if(l.async===!1)throw new Xe;return c.then(u=>s(u,n,l))}return s(c,n,l)}}D(e,"~standard",()=>({validate:s=>{var a;try{const i=ui(e,s);return i.success?{value:i.data}:{issues:(a=i.error)==null?void 0:a.issues}}catch{return di(e,s).then(l=>{var c;return l.success?{value:l.data}:{issues:(c=l.error)==null?void 0:c.issues}})}},vendor:"zod",version:1}))}),Sr=h("$ZodString",(e,t)=>{var r;W.init(e,t),e._zod.pattern=[...((r=e==null?void 0:e._zod.bag)==null?void 0:r.patterns)??[]].pop()??Fi(e._zod.bag),e._zod.parse=(n,o)=>{if(t.coerce)try{n.value=String(n.value)}catch{}return typeof n.value=="string"||n.issues.push({expected:"string",code:"invalid_type",input:n.value,inst:e}),n}}),Y=h("$ZodStringFormat",(e,t)=>{Xt.init(e,t),Sr.init(e,t)}),ac=h("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=zi),Y.init(e,t)}),ic=h("$ZodUUID",(e,t)=>{if(t.version){const n={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(n===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=en(n))}else t.pattern??(t.pattern=en());Y.init(e,t)}),cc=h("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=Ti),Y.init(e,t)}),lc=h("$ZodURL",(e,t)=>{Y.init(e,t),e._zod.check=r=>{try{const n=r.value.trim(),o=new URL(n);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(o.hostname)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:r.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(o.protocol.endsWith(":")?o.protocol.slice(0,-1):o.protocol)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:r.value,inst:e,continue:!t.abort})),t.normalize?r.value=o.href:r.value=n;return}catch{r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort})}}}),uc=h("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=Oi()),Y.init(e,t)}),dc=h("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=Si),Y.init(e,t)}),pc=h("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=_i),Y.init(e,t)}),fc=h("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=wi),Y.init(e,t)}),mc=h("$ZodULID",(e,t)=>{t.pattern??(t.pattern=ki),Y.init(e,t)}),hc=h("$ZodXID",(e,t)=>{t.pattern??(t.pattern=xi),Y.init(e,t)}),gc=h("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=Ei),Y.init(e,t)}),vc=h("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=Di(t)),Y.init(e,t)}),bc=h("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=ji),Y.init(e,t)}),yc=h("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=Mi(t)),Y.init(e,t)}),_c=h("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=Ii),Y.init(e,t)}),wc=h("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=Ai),Y.init(e,t),e._zod.bag.format="ipv4"}),kc=h("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=Pi),Y.init(e,t),e._zod.bag.format="ipv6",e._zod.check=r=>{try{new URL(`http://[${r.value}]`)}catch{r.issues.push({code:"invalid_format",format:"ipv6",input:r.value,inst:e,continue:!t.abort})}}}),xc=h("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=Ri),Y.init(e,t)}),Ec=h("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=$i),Y.init(e,t),e._zod.check=r=>{const n=r.value.split("/");try{if(n.length!==2)throw new Error;const[o,s]=n;if(!s)throw new Error;const a=Number(s);if(`${a}`!==s)throw new Error;if(a<0||a>128)throw new Error;new URL(`http://[${o}]`)}catch{r.issues.push({code:"invalid_format",format:"cidrv6",input:r.value,inst:e,continue:!t.abort})}}});function So(e){if(e==="")return!0;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const Sc=h("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=Ci),Y.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=r=>{So(r.value)||r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:e,continue:!t.abort})}});function Ic(e){if(!bo.test(e))return!1;const t=e.replace(/[-_]/g,n=>n==="-"?"+":"/"),r=t.padEnd(Math.ceil(t.length/4)*4,"=");return So(r)}const zc=h("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=bo),Y.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=r=>{Ic(r.value)||r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:e,continue:!t.abort})}}),Tc=h("$ZodE164",(e,t)=>{t.pattern??(t.pattern=Zi),Y.init(e,t)});function Nc(e,t=null){try{const r=e.split(".");if(r.length!==3)return!1;const[n]=r;if(!n)return!1;const o=JSON.parse(atob(n));return!("typ"in o&&(o==null?void 0:o.typ)!=="JWT"||!o.alg||t&&(!("alg"in o)||o.alg!==t))}catch{return!1}}const Oc=h("$ZodJWT",(e,t)=>{Y.init(e,t),e._zod.check=r=>{Nc(r.value,t.alg)||r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:e,continue:!t.abort})}}),Io=h("$ZodNumber",(e,t)=>{W.init(e,t),e._zod.pattern=e._zod.bag.pattern??wo,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=Number(r.value)}catch{}const o=r.value;if(typeof o=="number"&&!Number.isNaN(o)&&Number.isFinite(o))return r;const s=typeof o=="number"?Number.isNaN(o)?"NaN":Number.isFinite(o)?void 0:"Infinity":void 0;return r.issues.push({expected:"number",code:"invalid_type",input:o,inst:e,...s?{received:s}:{}}),r}}),Ac=h("$ZodNumberFormat",(e,t)=>{qi.init(e,t),Io.init(e,t)}),Pc=h("$ZodBoolean",(e,t)=>{W.init(e,t),e._zod.pattern=Ui,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=!!r.value}catch{}const o=r.value;return typeof o=="boolean"||r.issues.push({expected:"boolean",code:"invalid_type",input:o,inst:e}),r}}),Rc=h("$ZodNull",(e,t)=>{W.init(e,t),e._zod.pattern=Ji,e._zod.values=new Set([null]),e._zod.parse=(r,n)=>{const o=r.value;return o===null||r.issues.push({expected:"null",code:"invalid_type",input:o,inst:e}),r}}),$c=h("$ZodUnknown",(e,t)=>{W.init(e,t),e._zod.parse=r=>r}),Cc=h("$ZodNever",(e,t)=>{W.init(e,t),e._zod.parse=(r,n)=>(r.issues.push({expected:"never",code:"invalid_type",input:r.value,inst:e}),r)});function tn(e,t,r){e.issues.length&&t.issues.push(...He(r,e.issues)),t.value[r]=e.value}const Zc=h("$ZodArray",(e,t)=>{W.init(e,t),e._zod.parse=(r,n)=>{const o=r.value;if(!Array.isArray(o))return r.issues.push({expected:"array",code:"invalid_type",input:o,inst:e}),r;r.value=Array(o.length);const s=[];for(let a=0;a<o.length;a++){const i=o[a],l=t.element._zod.run({value:i,issues:[]},n);l instanceof Promise?s.push(l.then(c=>tn(c,r,a))):tn(l,r,a)}return s.length?Promise.all(s).then(()=>r):r}});function Mt(e,t,r,n,o){if(e.issues.length){if(o&&!(r in n))return;t.issues.push(...He(r,e.issues))}e.value===void 0?r in n&&(t.value[r]=void 0):t.value[r]=e.value}function zo(e){var n,o,s,a;const t=Object.keys(e.shape);for(const i of t)if(!((a=(s=(o=(n=e.shape)==null?void 0:n[i])==null?void 0:o._zod)==null?void 0:s.traits)!=null&&a.has("$ZodType")))throw new Error(`Invalid element at key "${i}": expected a Zod schema`);const r=Qa(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(r)}}function To(e,t,r,n,o,s){const a=[],i=o.keySet,l=o.catchall._zod,c=l.def.type,u=l.optout==="optional";for(const d in t){if(i.has(d))continue;if(c==="never"){a.push(d);continue}const f=l.run({value:t[d],issues:[]},n);f instanceof Promise?e.push(f.then(m=>Mt(m,r,d,t,u))):Mt(f,r,d,t,u)}return a.length&&r.issues.push({code:"unrecognized_keys",keys:a,input:t,inst:s}),e.length?Promise.all(e).then(()=>r):r}const jc=h("$ZodObject",(e,t)=>{W.init(e,t);const r=Object.getOwnPropertyDescriptor(t,"shape");if(!(r!=null&&r.get)){const i=t.shape;Object.defineProperty(t,"shape",{get:()=>{const l={...i};return Object.defineProperty(t,"shape",{value:l}),l}})}const n=Gt(()=>zo(t));D(e._zod,"propValues",()=>{const i=t.shape,l={};for(const c in i){const u=i[c]._zod;if(u.values){l[c]??(l[c]=new Set);for(const d of u.values)l[c].add(d)}}return l});const o=pt,s=t.catchall;let a;e._zod.parse=(i,l)=>{a??(a=n.value);const c=i.value;if(!o(c))return i.issues.push({expected:"object",code:"invalid_type",input:c,inst:e}),i;i.value={};const u=[],d=a.shape;for(const f of a.keys){const m=d[f],w=m._zod.optout==="optional",v=m._zod.run({value:c[f],issues:[]},l);v instanceof Promise?u.push(v.then(_=>Mt(_,i,f,c,w))):Mt(v,i,f,c,w)}return s?To(u,c,i,l,n.value,e):u.length?Promise.all(u).then(()=>i):i}}),Mc=h("$ZodObjectJIT",(e,t)=>{jc.init(e,t);const r=e._zod.parse,n=Gt(()=>zo(t)),o=f=>{var p;const m=new oc(["shape","payload","ctx"]),w=n.value,v=O=>{const P=Qr(O);return`shape[${P}]._zod.run({ value: input[${P}], issues: [] }, ctx)`};m.write("const input = payload.value;");const _=Object.create(null);let y=0;for(const O of w.keys)_[O]=`key_${y++}`;m.write("const newResult = {};");for(const O of w.keys){const P=_[O],N=Qr(O),Z=f[O],k=((p=Z==null?void 0:Z._zod)==null?void 0:p.optout)==="optional";m.write(`const ${P} = ${v(O)};`),k?m.write(`
92
+ if (${P}.issues.length) {
93
+ if (${N} in input) {
94
+ payload.issues = payload.issues.concat(${P}.issues.map(iss => ({
95
+ ...iss,
96
+ path: iss.path ? [${N}, ...iss.path] : [${N}]
97
+ })));
98
+ }
99
+ }
100
+
101
+ if (${P}.value === undefined) {
102
+ if (${N} in input) {
103
+ newResult[${N}] = undefined;
104
+ }
105
+ } else {
106
+ newResult[${N}] = ${P}.value;
107
+ }
108
+
109
+ `):m.write(`
110
+ if (${P}.issues.length) {
111
+ payload.issues = payload.issues.concat(${P}.issues.map(iss => ({
112
+ ...iss,
113
+ path: iss.path ? [${N}, ...iss.path] : [${N}]
114
+ })));
115
+ }
116
+
117
+ if (${P}.value === undefined) {
118
+ if (${N} in input) {
119
+ newResult[${N}] = undefined;
120
+ }
121
+ } else {
122
+ newResult[${N}] = ${P}.value;
123
+ }
124
+
125
+ `)}m.write("payload.value = newResult;"),m.write("return payload;");const E=m.compile();return(O,P)=>E(f,O,P)};let s;const a=pt,i=!uo.jitless,c=i&&Xa.value,u=t.catchall;let d;e._zod.parse=(f,m)=>{d??(d=n.value);const w=f.value;return a(w)?i&&c&&(m==null?void 0:m.async)===!1&&m.jitless!==!0?(s||(s=o(t.shape)),f=s(f,m),u?To([],w,f,m,d,e):f):r(f,m):(f.issues.push({expected:"object",code:"invalid_type",input:w,inst:e}),f)}});function rn(e,t,r,n){for(const s of e)if(s.issues.length===0)return t.value=s.value,t;const o=e.filter(s=>!Ye(s));return o.length===1?(t.value=o[0].value,o[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map(s=>s.issues.map(a=>Oe(a,n,Ne())))}),t)}const No=h("$ZodUnion",(e,t)=>{W.init(e,t),D(e._zod,"optin",()=>t.options.some(o=>o._zod.optin==="optional")?"optional":void 0),D(e._zod,"optout",()=>t.options.some(o=>o._zod.optout==="optional")?"optional":void 0),D(e._zod,"values",()=>{if(t.options.every(o=>o._zod.values))return new Set(t.options.flatMap(o=>Array.from(o._zod.values)))}),D(e._zod,"pattern",()=>{if(t.options.every(o=>o._zod.pattern)){const o=t.options.map(s=>s._zod.pattern);return new RegExp(`^(${o.map(s=>wr(s.source)).join("|")})$`)}});const r=t.options.length===1,n=t.options[0]._zod.run;e._zod.parse=(o,s)=>{if(r)return n(o,s);let a=!1;const i=[];for(const l of t.options){const c=l._zod.run({value:o.value,issues:[]},s);if(c instanceof Promise)i.push(c),a=!0;else{if(c.issues.length===0)return c;i.push(c)}}return a?Promise.all(i).then(l=>rn(l,o,e,s)):rn(i,o,e,s)}}),Dc=h("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,No.init(e,t);const r=e._zod.parse;D(e._zod,"propValues",()=>{const o={};for(const s of t.options){const a=s._zod.propValues;if(!a||Object.keys(a).length===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(s)}"`);for(const[i,l]of Object.entries(a)){o[i]||(o[i]=new Set);for(const c of l)o[i].add(c)}}return o});const n=Gt(()=>{var a;const o=t.options,s=new Map;for(const i of o){const l=(a=i._zod.propValues)==null?void 0:a[t.discriminator];if(!l||l.size===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(i)}"`);for(const c of l){if(s.has(c))throw new Error(`Duplicate discriminator value "${String(c)}"`);s.set(c,i)}}return s});e._zod.parse=(o,s)=>{const a=o.value;if(!pt(a))return o.issues.push({code:"invalid_type",expected:"object",input:a,inst:e}),o;const i=n.value.get(a==null?void 0:a[t.discriminator]);return i?i._zod.run(o,s):t.unionFallback?r(o,s):(o.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,input:a,path:[t.discriminator],inst:e}),o)}}),Fc=h("$ZodIntersection",(e,t)=>{W.init(e,t),e._zod.parse=(r,n)=>{const o=r.value,s=t.left._zod.run({value:o,issues:[]},n),a=t.right._zod.run({value:o,issues:[]},n);return s instanceof Promise||a instanceof Promise?Promise.all([s,a]).then(([l,c])=>nn(r,l,c)):nn(r,s,a)}});function ur(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(Qe(e)&&Qe(t)){const r=Object.keys(t),n=Object.keys(e).filter(s=>r.indexOf(s)!==-1),o={...e,...t};for(const s of n){const a=ur(e[s],t[s]);if(!a.valid)return{valid:!1,mergeErrorPath:[s,...a.mergeErrorPath]};o[s]=a.data}return{valid:!0,data:o}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const r=[];for(let n=0;n<e.length;n++){const o=e[n],s=t[n],a=ur(o,s);if(!a.valid)return{valid:!1,mergeErrorPath:[n,...a.mergeErrorPath]};r.push(a.data)}return{valid:!0,data:r}}return{valid:!1,mergeErrorPath:[]}}function nn(e,t,r){const n=new Map;let o;for(const i of t.issues)if(i.code==="unrecognized_keys"){o??(o=i);for(const l of i.keys)n.has(l)||n.set(l,{}),n.get(l).l=!0}else e.issues.push(i);for(const i of r.issues)if(i.code==="unrecognized_keys")for(const l of i.keys)n.has(l)||n.set(l,{}),n.get(l).r=!0;else e.issues.push(i);const s=[...n].filter(([,i])=>i.l&&i.r).map(([i])=>i);if(s.length&&o&&e.issues.push({...o,keys:s}),Ye(e))return e;const a=ur(t.value,r.value);if(!a.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(a.mergeErrorPath)}`);return e.value=a.data,e}const Lc=h("$ZodRecord",(e,t)=>{W.init(e,t),e._zod.parse=(r,n)=>{const o=r.value;if(!Qe(o))return r.issues.push({expected:"record",code:"invalid_type",input:o,inst:e}),r;const s=[],a=t.keyType._zod.values;if(a){r.value={};const i=new Set;for(const c of a)if(typeof c=="string"||typeof c=="number"||typeof c=="symbol"){i.add(typeof c=="number"?c.toString():c);const u=t.valueType._zod.run({value:o[c],issues:[]},n);u instanceof Promise?s.push(u.then(d=>{d.issues.length&&r.issues.push(...He(c,d.issues)),r.value[c]=d.value})):(u.issues.length&&r.issues.push(...He(c,u.issues)),r.value[c]=u.value)}let l;for(const c in o)i.has(c)||(l=l??[],l.push(c));l&&l.length>0&&r.issues.push({code:"unrecognized_keys",input:o,inst:e,keys:l})}else{r.value={};for(const i of Reflect.ownKeys(o)){if(i==="__proto__")continue;let l=t.keyType._zod.run({value:i,issues:[]},n);if(l instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof i=="string"&&wo.test(i)&&l.issues.length){const d=t.keyType._zod.run({value:Number(i),issues:[]},n);if(d instanceof Promise)throw new Error("Async schemas not supported in object keys currently");d.issues.length===0&&(l=d)}if(l.issues.length){t.mode==="loose"?r.value[i]=o[i]:r.issues.push({code:"invalid_key",origin:"record",issues:l.issues.map(d=>Oe(d,n,Ne())),input:i,path:[i],inst:e});continue}const u=t.valueType._zod.run({value:o[i],issues:[]},n);u instanceof Promise?s.push(u.then(d=>{d.issues.length&&r.issues.push(...He(i,d.issues)),r.value[l.value]=d.value})):(u.issues.length&&r.issues.push(...He(i,u.issues)),r.value[l.value]=u.value)}}return s.length?Promise.all(s).then(()=>r):r}}),Uc=h("$ZodEnum",(e,t)=>{W.init(e,t);const r=po(t.entries),n=new Set(r);e._zod.values=n,e._zod.pattern=new RegExp(`^(${r.filter(o=>Ka.has(typeof o)).map(o=>typeof o=="string"?et(o):o.toString()).join("|")})$`),e._zod.parse=(o,s)=>{const a=o.value;return n.has(a)||o.issues.push({code:"invalid_value",values:r,input:a,inst:e}),o}}),Jc=h("$ZodLiteral",(e,t)=>{if(W.init(e,t),t.values.length===0)throw new Error("Cannot create literal schema with no valid values");const r=new Set(t.values);e._zod.values=r,e._zod.pattern=new RegExp(`^(${t.values.map(n=>typeof n=="string"?et(n):n?et(n.toString()):String(n)).join("|")})$`),e._zod.parse=(n,o)=>{const s=n.value;return r.has(s)||n.issues.push({code:"invalid_value",values:t.values,input:s,inst:e}),n}}),Vc=h("$ZodTransform",(e,t)=>{W.init(e,t),e._zod.parse=(r,n)=>{if(n.direction==="backward")throw new lo(e.constructor.name);const o=t.transform(r.value,r);if(n.async)return(o instanceof Promise?o:Promise.resolve(o)).then(a=>(r.value=a,r));if(o instanceof Promise)throw new Xe;return r.value=o,r}});function on(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}const Oo=h("$ZodOptional",(e,t)=>{W.init(e,t),e._zod.optin="optional",e._zod.optout="optional",D(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),D(e._zod,"pattern",()=>{const r=t.innerType._zod.pattern;return r?new RegExp(`^(${wr(r.source)})?$`):void 0}),e._zod.parse=(r,n)=>{if(t.innerType._zod.optin==="optional"){const o=t.innerType._zod.run(r,n);return o instanceof Promise?o.then(s=>on(s,r.value)):on(o,r.value)}return r.value===void 0?r:t.innerType._zod.run(r,n)}}),Bc=h("$ZodExactOptional",(e,t)=>{Oo.init(e,t),D(e._zod,"values",()=>t.innerType._zod.values),D(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(r,n)=>t.innerType._zod.run(r,n)}),Wc=h("$ZodNullable",(e,t)=>{W.init(e,t),D(e._zod,"optin",()=>t.innerType._zod.optin),D(e._zod,"optout",()=>t.innerType._zod.optout),D(e._zod,"pattern",()=>{const r=t.innerType._zod.pattern;return r?new RegExp(`^(${wr(r.source)}|null)$`):void 0}),D(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(r,n)=>r.value===null?r:t.innerType._zod.run(r,n)}),qc=h("$ZodDefault",(e,t)=>{W.init(e,t),e._zod.optin="optional",D(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,n)=>{if(n.direction==="backward")return t.innerType._zod.run(r,n);if(r.value===void 0)return r.value=t.defaultValue,r;const o=t.innerType._zod.run(r,n);return o instanceof Promise?o.then(s=>sn(s,t)):sn(o,t)}});function sn(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const Gc=h("$ZodPrefault",(e,t)=>{W.init(e,t),e._zod.optin="optional",D(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,n)=>(n.direction==="backward"||r.value===void 0&&(r.value=t.defaultValue),t.innerType._zod.run(r,n))}),Yc=h("$ZodNonOptional",(e,t)=>{W.init(e,t),D(e._zod,"values",()=>{const r=t.innerType._zod.values;return r?new Set([...r].filter(n=>n!==void 0)):void 0}),e._zod.parse=(r,n)=>{const o=t.innerType._zod.run(r,n);return o instanceof Promise?o.then(s=>an(s,e)):an(o,e)}});function an(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}const Hc=h("$ZodCatch",(e,t)=>{W.init(e,t),D(e._zod,"optin",()=>t.innerType._zod.optin),D(e._zod,"optout",()=>t.innerType._zod.optout),D(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,n)=>{if(n.direction==="backward")return t.innerType._zod.run(r,n);const o=t.innerType._zod.run(r,n);return o instanceof Promise?o.then(s=>(r.value=s.value,s.issues.length&&(r.value=t.catchValue({...r,error:{issues:s.issues.map(a=>Oe(a,n,Ne()))},input:r.value}),r.issues=[]),r)):(r.value=o.value,o.issues.length&&(r.value=t.catchValue({...r,error:{issues:o.issues.map(s=>Oe(s,n,Ne()))},input:r.value}),r.issues=[]),r)}}),Xc=h("$ZodPipe",(e,t)=>{W.init(e,t),D(e._zod,"values",()=>t.in._zod.values),D(e._zod,"optin",()=>t.in._zod.optin),D(e._zod,"optout",()=>t.out._zod.optout),D(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(r,n)=>{if(n.direction==="backward"){const s=t.out._zod.run(r,n);return s instanceof Promise?s.then(a=>At(a,t.in,n)):At(s,t.in,n)}const o=t.in._zod.run(r,n);return o instanceof Promise?o.then(s=>At(s,t.out,n)):At(o,t.out,n)}});function At(e,t,r){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},r)}const Kc=h("$ZodReadonly",(e,t)=>{W.init(e,t),D(e._zod,"propValues",()=>t.innerType._zod.propValues),D(e._zod,"values",()=>t.innerType._zod.values),D(e._zod,"optin",()=>{var r,n;return(n=(r=t.innerType)==null?void 0:r._zod)==null?void 0:n.optin}),D(e._zod,"optout",()=>{var r,n;return(n=(r=t.innerType)==null?void 0:r._zod)==null?void 0:n.optout}),e._zod.parse=(r,n)=>{if(n.direction==="backward")return t.innerType._zod.run(r,n);const o=t.innerType._zod.run(r,n);return o instanceof Promise?o.then(cn):cn(o)}});function cn(e){return e.value=Object.freeze(e.value),e}const Qc=h("$ZodLazy",(e,t)=>{W.init(e,t),D(e._zod,"innerType",()=>t.getter()),D(e._zod,"pattern",()=>{var r,n;return(n=(r=e._zod.innerType)==null?void 0:r._zod)==null?void 0:n.pattern}),D(e._zod,"propValues",()=>{var r,n;return(n=(r=e._zod.innerType)==null?void 0:r._zod)==null?void 0:n.propValues}),D(e._zod,"optin",()=>{var r,n;return((n=(r=e._zod.innerType)==null?void 0:r._zod)==null?void 0:n.optin)??void 0}),D(e._zod,"optout",()=>{var r,n;return((n=(r=e._zod.innerType)==null?void 0:r._zod)==null?void 0:n.optout)??void 0}),e._zod.parse=(r,n)=>e._zod.innerType._zod.run(r,n)}),el=h("$ZodCustom",(e,t)=>{le.init(e,t),W.init(e,t),e._zod.parse=(r,n)=>r,e._zod.check=r=>{const n=r.value,o=t.fn(n);if(o instanceof Promise)return o.then(s=>ln(s,r,n,e));ln(o,r,n,e)}});function ln(e,t,r,n){if(!e){const o={code:"custom",input:r,inst:n,path:[...n._zod.def.path??[]],continue:!n._zod.def.abort};n._zod.def.params&&(o.params=n._zod.def.params),t.issues.push(ft(o))}}var un;class tl{constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...r){const n=r[0];return this._map.set(t,n),n&&typeof n=="object"&&"id"in n&&this._idmap.set(n.id,t),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){const r=this._map.get(t);return r&&typeof r=="object"&&"id"in r&&this._idmap.delete(r.id),this._map.delete(t),this}get(t){const r=t._zod.parent;if(r){const n={...this.get(r)??{}};delete n.id;const o={...n,...this._map.get(t)};return Object.keys(o).length?o:void 0}return this._map.get(t)}has(t){return this._map.has(t)}}function rl(){return new tl}(un=globalThis).__zod_globalRegistry??(un.__zod_globalRegistry=rl());const ct=globalThis.__zod_globalRegistry;function nl(e,t){return new e({type:"string",...I(t)})}function ol(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...I(t)})}function dn(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...I(t)})}function sl(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...I(t)})}function al(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...I(t)})}function il(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...I(t)})}function cl(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...I(t)})}function ll(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...I(t)})}function ul(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...I(t)})}function dl(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...I(t)})}function pl(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...I(t)})}function fl(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...I(t)})}function ml(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...I(t)})}function hl(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...I(t)})}function gl(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...I(t)})}function vl(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...I(t)})}function bl(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...I(t)})}function yl(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...I(t)})}function _l(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...I(t)})}function wl(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...I(t)})}function kl(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...I(t)})}function xl(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...I(t)})}function El(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...I(t)})}function Sl(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...I(t)})}function Il(e,t){return new e({type:"string",format:"date",check:"string_format",...I(t)})}function zl(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...I(t)})}function Tl(e,t){return new e({type:"string",format:"duration",check:"string_format",...I(t)})}function Nl(e,t){return new e({type:"number",checks:[],...I(t)})}function Ol(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...I(t)})}function Al(e,t){return new e({type:"boolean",...I(t)})}function Pl(e,t){return new e({type:"null",...I(t)})}function Rl(e){return new e({type:"unknown"})}function $l(e,t){return new e({type:"never",...I(t)})}function pn(e,t){return new xo({check:"less_than",...I(t),value:e,inclusive:!1})}function tr(e,t){return new xo({check:"less_than",...I(t),value:e,inclusive:!0})}function fn(e,t){return new Eo({check:"greater_than",...I(t),value:e,inclusive:!1})}function rr(e,t){return new Eo({check:"greater_than",...I(t),value:e,inclusive:!0})}function mn(e,t){return new Wi({check:"multiple_of",...I(t),value:e})}function Ao(e,t){return new Gi({check:"max_length",...I(t),maximum:e})}function Dt(e,t){return new Yi({check:"min_length",...I(t),minimum:e})}function Po(e,t){return new Hi({check:"length_equals",...I(t),length:e})}function Cl(e,t){return new Xi({check:"string_format",format:"regex",...I(t),pattern:e})}function Zl(e){return new Ki({check:"string_format",format:"lowercase",...I(e)})}function jl(e){return new Qi({check:"string_format",format:"uppercase",...I(e)})}function Ml(e,t){return new ec({check:"string_format",format:"includes",...I(t),includes:e})}function Dl(e,t){return new tc({check:"string_format",format:"starts_with",...I(t),prefix:e})}function Fl(e,t){return new rc({check:"string_format",format:"ends_with",...I(t),suffix:e})}function rt(e){return new nc({check:"overwrite",tx:e})}function Ll(e){return rt(t=>t.normalize(e))}function Ul(){return rt(e=>e.trim())}function Jl(){return rt(e=>e.toLowerCase())}function Vl(){return rt(e=>e.toUpperCase())}function Bl(){return rt(e=>Ha(e))}function Wl(e,t,r){return new e({type:"array",element:t,...I(r)})}function ql(e,t,r){const n=I(r);return n.abort??(n.abort=!0),new e({type:"custom",check:"custom",fn:t,...n})}function Gl(e,t,r){return new e({type:"custom",check:"custom",fn:t,...I(r)})}function Yl(e){const t=Hl(r=>(r.addIssue=n=>{if(typeof n=="string")r.issues.push(ft(n,r.value,t._zod.def));else{const o=n;o.fatal&&(o.continue=!1),o.code??(o.code="custom"),o.input??(o.input=r.value),o.inst??(o.inst=t),o.continue??(o.continue=!t._zod.def.abort),r.issues.push(ft(o))}},e(r.value,r)));return t}function Hl(e,t){const r=new le({check:"custom",...I(t)});return r._zod.check=e,r}function Ft(e){let t=(e==null?void 0:e.target)??"draft-2020-12";return t==="draft-4"&&(t="draft-04"),t==="draft-7"&&(t="draft-07"),{processors:e.processors??{},metadataRegistry:(e==null?void 0:e.metadata)??ct,target:t,unrepresentable:(e==null?void 0:e.unrepresentable)??"throw",override:(e==null?void 0:e.override)??(()=>{}),io:(e==null?void 0:e.io)??"output",counter:0,seen:new Map,cycles:(e==null?void 0:e.cycles)??"ref",reused:(e==null?void 0:e.reused)??"inline",external:(e==null?void 0:e.external)??void 0}}function U(e,t,r={path:[],schemaPath:[]}){var u,d;var n;const o=e._zod.def,s=t.seen.get(e);if(s)return s.count++,r.schemaPath.includes(e)&&(s.cycle=r.path),s.schema;const a={schema:{},count:1,cycle:void 0,path:r.path};t.seen.set(e,a);const i=(d=(u=e._zod).toJSONSchema)==null?void 0:d.call(u);if(i)a.schema=i;else{const f={...r,schemaPath:[...r.schemaPath,e],path:r.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,a.schema,f);else{const w=a.schema,v=t.processors[o.type];if(!v)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${o.type}`);v(e,t,w,f)}const m=e._zod.parent;m&&(a.ref||(a.ref=m),U(m,t,f),t.seen.get(m).isParent=!0)}const l=t.metadataRegistry.get(e);return l&&Object.assign(a.schema,l),t.io==="input"&&se(e)&&(delete a.schema.examples,delete a.schema.default),t.io==="input"&&a.schema._prefault&&((n=a.schema).default??(n.default=a.schema._prefault)),delete a.schema._prefault,t.seen.get(e).schema}function Lt(e,t){var a,i,l,c;const r=e.seen.get(t);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");const n=new Map;for(const u of e.seen.entries()){const d=(a=e.metadataRegistry.get(u[0]))==null?void 0:a.id;if(d){const f=n.get(d);if(f&&f!==u[0])throw new Error(`Duplicate schema id "${d}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);n.set(d,u[0])}}const o=u=>{var v;const d=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){const _=(v=e.external.registry.get(u[0]))==null?void 0:v.id,y=e.external.uri??(p=>p);if(_)return{ref:y(_)};const E=u[1].defId??u[1].schema.id??`schema${e.counter++}`;return u[1].defId=E,{defId:E,ref:`${y("__shared")}#/${d}/${E}`}}if(u[1]===r)return{ref:"#"};const m=`#/${d}/`,w=u[1].schema.id??`__schema${e.counter++}`;return{defId:w,ref:m+w}},s=u=>{if(u[1].schema.$ref)return;const d=u[1],{ref:f,defId:m}=o(u);d.def={...d.schema},m&&(d.defId=m);const w=d.schema;for(const v in w)delete w[v];w.$ref=f};if(e.cycles==="throw")for(const u of e.seen.entries()){const d=u[1];if(d.cycle)throw new Error(`Cycle detected: #/${(i=d.cycle)==null?void 0:i.join("/")}/<root>
126
+
127
+ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const u of e.seen.entries()){const d=u[1];if(t===u[0]){s(u);continue}if(e.external){const m=(l=e.external.registry.get(u[0]))==null?void 0:l.id;if(t!==u[0]&&m){s(u);continue}}if((c=e.metadataRegistry.get(u[0]))==null?void 0:c.id){s(u);continue}if(d.cycle){s(u);continue}if(d.count>1&&e.reused==="ref"){s(u);continue}}}function Ut(e,t){var a,i,l;const r=e.seen.get(t);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");const n=c=>{const u=e.seen.get(c);if(u.ref===null)return;const d=u.def??u.schema,f={...d},m=u.ref;if(u.ref=null,m){n(m);const v=e.seen.get(m),_=v.schema;if(_.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(d.allOf=d.allOf??[],d.allOf.push(_)):Object.assign(d,_),Object.assign(d,f),c._zod.parent===m)for(const E in d)E==="$ref"||E==="allOf"||E in f||delete d[E];if(_.$ref&&v.def)for(const E in d)E==="$ref"||E==="allOf"||E in v.def&&JSON.stringify(d[E])===JSON.stringify(v.def[E])&&delete d[E]}const w=c._zod.parent;if(w&&w!==m){n(w);const v=e.seen.get(w);if(v!=null&&v.schema.$ref&&(d.$ref=v.schema.$ref,v.def))for(const _ in d)_==="$ref"||_==="allOf"||_ in v.def&&JSON.stringify(d[_])===JSON.stringify(v.def[_])&&delete d[_]}e.override({zodSchema:c,jsonSchema:d,path:u.path??[]})};for(const c of[...e.seen.entries()].reverse())n(c[0]);const o={};if(e.target==="draft-2020-12"?o.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?o.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?o.$schema="http://json-schema.org/draft-04/schema#":e.target,(a=e.external)!=null&&a.uri){const c=(i=e.external.registry.get(t))==null?void 0:i.id;if(!c)throw new Error("Schema is missing an `id` property");o.$id=e.external.uri(c)}Object.assign(o,r.def??r.schema);const s=((l=e.external)==null?void 0:l.defs)??{};for(const c of e.seen.entries()){const u=c[1];u.def&&u.defId&&(s[u.defId]=u.def)}e.external||Object.keys(s).length>0&&(e.target==="draft-2020-12"?o.$defs=s:o.definitions=s);try{const c=JSON.parse(JSON.stringify(o));return Object.defineProperty(c,"~standard",{value:{...t["~standard"],jsonSchema:{input:Jt(t,"input",e.processors),output:Jt(t,"output",e.processors)}},enumerable:!1,writable:!1}),c}catch{throw new Error("Error converting schema to JSON.")}}function se(e,t){const r=t??{seen:new Set};if(r.seen.has(e))return!1;r.seen.add(e);const n=e._zod.def;if(n.type==="transform")return!0;if(n.type==="array")return se(n.element,r);if(n.type==="set")return se(n.valueType,r);if(n.type==="lazy")return se(n.getter(),r);if(n.type==="promise"||n.type==="optional"||n.type==="nonoptional"||n.type==="nullable"||n.type==="readonly"||n.type==="default"||n.type==="prefault")return se(n.innerType,r);if(n.type==="intersection")return se(n.left,r)||se(n.right,r);if(n.type==="record"||n.type==="map")return se(n.keyType,r)||se(n.valueType,r);if(n.type==="pipe")return se(n.in,r)||se(n.out,r);if(n.type==="object"){for(const o in n.shape)if(se(n.shape[o],r))return!0;return!1}if(n.type==="union"){for(const o of n.options)if(se(o,r))return!0;return!1}if(n.type==="tuple"){for(const o of n.items)if(se(o,r))return!0;return!!(n.rest&&se(n.rest,r))}return!1}const Xl=(e,t={})=>r=>{const n=Ft({...r,processors:t});return U(e,n),Lt(n,e),Ut(n,e)},Jt=(e,t,r={})=>n=>{const{libraryOptions:o,target:s}=n??{},a=Ft({...o??{},target:s,io:t,processors:r});return U(e,a),Lt(a,e),Ut(a,e)},Kl={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},Ro=(e,t,r,n)=>{const o=r;o.type="string";const{minimum:s,maximum:a,format:i,patterns:l,contentEncoding:c}=e._zod.bag;if(typeof s=="number"&&(o.minLength=s),typeof a=="number"&&(o.maxLength=a),i&&(o.format=Kl[i]??i,o.format===""&&delete o.format,i==="time"&&delete o.format),c&&(o.contentEncoding=c),l&&l.size>0){const u=[...l];u.length===1?o.pattern=u[0].source:u.length>1&&(o.allOf=[...u.map(d=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:d.source}))])}},$o=(e,t,r,n)=>{const o=r,{minimum:s,maximum:a,format:i,multipleOf:l,exclusiveMaximum:c,exclusiveMinimum:u}=e._zod.bag;typeof i=="string"&&i.includes("int")?o.type="integer":o.type="number",typeof u=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(o.minimum=u,o.exclusiveMinimum=!0):o.exclusiveMinimum=u),typeof s=="number"&&(o.minimum=s,typeof u=="number"&&t.target!=="draft-04"&&(u>=s?delete o.minimum:delete o.exclusiveMinimum)),typeof c=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(o.maximum=c,o.exclusiveMaximum=!0):o.exclusiveMaximum=c),typeof a=="number"&&(o.maximum=a,typeof c=="number"&&t.target!=="draft-04"&&(c<=a?delete o.maximum:delete o.exclusiveMaximum)),typeof l=="number"&&(o.multipleOf=l)},Co=(e,t,r,n)=>{r.type="boolean"},Ql=(e,t,r,n)=>{if(t.unrepresentable==="throw")throw new Error("BigInt cannot be represented in JSON Schema")},eu=(e,t,r,n)=>{if(t.unrepresentable==="throw")throw new Error("Symbols cannot be represented in JSON Schema")},Zo=(e,t,r,n)=>{t.target==="openapi-3.0"?(r.type="string",r.nullable=!0,r.enum=[null]):r.type="null"},tu=(e,t,r,n)=>{if(t.unrepresentable==="throw")throw new Error("Undefined cannot be represented in JSON Schema")},ru=(e,t,r,n)=>{if(t.unrepresentable==="throw")throw new Error("Void cannot be represented in JSON Schema")},jo=(e,t,r,n)=>{r.not={}},nu=(e,t,r,n)=>{},Mo=(e,t,r,n)=>{},ou=(e,t,r,n)=>{if(t.unrepresentable==="throw")throw new Error("Date cannot be represented in JSON Schema")},Do=(e,t,r,n)=>{const o=e._zod.def,s=po(o.entries);s.every(a=>typeof a=="number")&&(r.type="number"),s.every(a=>typeof a=="string")&&(r.type="string"),r.enum=s},Fo=(e,t,r,n)=>{const o=e._zod.def,s=[];for(const a of o.values)if(a===void 0){if(t.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof a=="bigint"){if(t.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");s.push(Number(a))}else s.push(a);if(s.length!==0)if(s.length===1){const a=s[0];r.type=a===null?"null":typeof a,t.target==="draft-04"||t.target==="openapi-3.0"?r.enum=[a]:r.const=a}else s.every(a=>typeof a=="number")&&(r.type="number"),s.every(a=>typeof a=="string")&&(r.type="string"),s.every(a=>typeof a=="boolean")&&(r.type="boolean"),s.every(a=>a===null)&&(r.type="null"),r.enum=s},su=(e,t,r,n)=>{if(t.unrepresentable==="throw")throw new Error("NaN cannot be represented in JSON Schema")},au=(e,t,r,n)=>{const o=r,s=e._zod.pattern;if(!s)throw new Error("Pattern not found in template literal");o.type="string",o.pattern=s.source},iu=(e,t,r,n)=>{const o=r,s={type:"string",format:"binary",contentEncoding:"binary"},{minimum:a,maximum:i,mime:l}=e._zod.bag;a!==void 0&&(s.minLength=a),i!==void 0&&(s.maxLength=i),l?l.length===1?(s.contentMediaType=l[0],Object.assign(o,s)):(Object.assign(o,s),o.anyOf=l.map(c=>({contentMediaType:c}))):Object.assign(o,s)},cu=(e,t,r,n)=>{r.type="boolean"},Lo=(e,t,r,n)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},lu=(e,t,r,n)=>{if(t.unrepresentable==="throw")throw new Error("Function types cannot be represented in JSON Schema")},Uo=(e,t,r,n)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},uu=(e,t,r,n)=>{if(t.unrepresentable==="throw")throw new Error("Map cannot be represented in JSON Schema")},du=(e,t,r,n)=>{if(t.unrepresentable==="throw")throw new Error("Set cannot be represented in JSON Schema")},Jo=(e,t,r,n)=>{const o=r,s=e._zod.def,{minimum:a,maximum:i}=e._zod.bag;typeof a=="number"&&(o.minItems=a),typeof i=="number"&&(o.maxItems=i),o.type="array",o.items=U(s.element,t,{...n,path:[...n.path,"items"]})},Vo=(e,t,r,n)=>{var c;const o=r,s=e._zod.def;o.type="object",o.properties={};const a=s.shape;for(const u in a)o.properties[u]=U(a[u],t,{...n,path:[...n.path,"properties",u]});const i=new Set(Object.keys(a)),l=new Set([...i].filter(u=>{const d=s.shape[u]._zod;return t.io==="input"?d.optin===void 0:d.optout===void 0}));l.size>0&&(o.required=Array.from(l)),((c=s.catchall)==null?void 0:c._zod.def.type)==="never"?o.additionalProperties=!1:s.catchall?s.catchall&&(o.additionalProperties=U(s.catchall,t,{...n,path:[...n.path,"additionalProperties"]})):t.io==="output"&&(o.additionalProperties=!1)},Bo=(e,t,r,n)=>{const o=e._zod.def,s=o.inclusive===!1,a=o.options.map((i,l)=>U(i,t,{...n,path:[...n.path,s?"oneOf":"anyOf",l]}));s?r.oneOf=a:r.anyOf=a},Wo=(e,t,r,n)=>{const o=e._zod.def,s=U(o.left,t,{...n,path:[...n.path,"allOf",0]}),a=U(o.right,t,{...n,path:[...n.path,"allOf",1]}),i=c=>"allOf"in c&&Object.keys(c).length===1,l=[...i(s)?s.allOf:[s],...i(a)?a.allOf:[a]];r.allOf=l},pu=(e,t,r,n)=>{const o=r,s=e._zod.def;o.type="array";const a=t.target==="draft-2020-12"?"prefixItems":"items",i=t.target==="draft-2020-12"||t.target==="openapi-3.0"?"items":"additionalItems",l=s.items.map((f,m)=>U(f,t,{...n,path:[...n.path,a,m]})),c=s.rest?U(s.rest,t,{...n,path:[...n.path,i,...t.target==="openapi-3.0"?[s.items.length]:[]]}):null;t.target==="draft-2020-12"?(o.prefixItems=l,c&&(o.items=c)):t.target==="openapi-3.0"?(o.items={anyOf:l},c&&o.items.anyOf.push(c),o.minItems=l.length,c||(o.maxItems=l.length)):(o.items=l,c&&(o.additionalItems=c));const{minimum:u,maximum:d}=e._zod.bag;typeof u=="number"&&(o.minItems=u),typeof d=="number"&&(o.maxItems=d)},qo=(e,t,r,n)=>{const o=r,s=e._zod.def;o.type="object";const a=s.keyType,i=a._zod.bag,l=i==null?void 0:i.patterns;if(s.mode==="loose"&&l&&l.size>0){const u=U(s.valueType,t,{...n,path:[...n.path,"patternProperties","*"]});o.patternProperties={};for(const d of l)o.patternProperties[d.source]=u}else(t.target==="draft-07"||t.target==="draft-2020-12")&&(o.propertyNames=U(s.keyType,t,{...n,path:[...n.path,"propertyNames"]})),o.additionalProperties=U(s.valueType,t,{...n,path:[...n.path,"additionalProperties"]});const c=a._zod.values;if(c){const u=[...c].filter(d=>typeof d=="string"||typeof d=="number");u.length>0&&(o.required=u)}},Go=(e,t,r,n)=>{const o=e._zod.def,s=U(o.innerType,t,n),a=t.seen.get(e);t.target==="openapi-3.0"?(a.ref=o.innerType,r.nullable=!0):r.anyOf=[s,{type:"null"}]},Yo=(e,t,r,n)=>{const o=e._zod.def;U(o.innerType,t,n);const s=t.seen.get(e);s.ref=o.innerType},Ho=(e,t,r,n)=>{const o=e._zod.def;U(o.innerType,t,n);const s=t.seen.get(e);s.ref=o.innerType,r.default=JSON.parse(JSON.stringify(o.defaultValue))},Xo=(e,t,r,n)=>{const o=e._zod.def;U(o.innerType,t,n);const s=t.seen.get(e);s.ref=o.innerType,t.io==="input"&&(r._prefault=JSON.parse(JSON.stringify(o.defaultValue)))},Ko=(e,t,r,n)=>{const o=e._zod.def;U(o.innerType,t,n);const s=t.seen.get(e);s.ref=o.innerType;let a;try{a=o.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}r.default=a},Qo=(e,t,r,n)=>{const o=e._zod.def,s=t.io==="input"?o.in._zod.def.type==="transform"?o.out:o.in:o.out;U(s,t,n);const a=t.seen.get(e);a.ref=s},es=(e,t,r,n)=>{const o=e._zod.def;U(o.innerType,t,n);const s=t.seen.get(e);s.ref=o.innerType,r.readOnly=!0},fu=(e,t,r,n)=>{const o=e._zod.def;U(o.innerType,t,n);const s=t.seen.get(e);s.ref=o.innerType},Ir=(e,t,r,n)=>{const o=e._zod.def;U(o.innerType,t,n);const s=t.seen.get(e);s.ref=o.innerType},ts=(e,t,r,n)=>{const o=e._zod.innerType;U(o,t,n);const s=t.seen.get(e);s.ref=o},hn={string:Ro,number:$o,boolean:Co,bigint:Ql,symbol:eu,null:Zo,undefined:tu,void:ru,never:jo,any:nu,unknown:Mo,date:ou,enum:Do,literal:Fo,nan:su,template_literal:au,file:iu,success:cu,custom:Lo,function:lu,transform:Uo,map:uu,set:du,array:Jo,object:Vo,union:Bo,intersection:Wo,tuple:pu,record:qo,nullable:Go,nonoptional:Yo,default:Ho,prefault:Xo,catch:Ko,pipe:Qo,readonly:es,promise:fu,optional:Ir,lazy:ts};function mu(e,t){if("_idmap"in e){const n=e,o=Ft({...t,processors:hn}),s={};for(const l of n._idmap.entries()){const[c,u]=l;U(u,o)}const a={},i={registry:n,uri:t==null?void 0:t.uri,defs:s};o.external=i;for(const l of n._idmap.entries()){const[c,u]=l;Lt(o,u),a[c]=Ut(o,u)}if(Object.keys(s).length>0){const l=o.target==="draft-2020-12"?"$defs":"definitions";a.__shared={[l]:s}}return{schemas:a}}const r=Ft({...t,processors:hn});return U(e,r),Lt(r,e),Ut(r,e)}const hu=h("ZodISODateTime",(e,t)=>{vc.init(e,t),X.init(e,t)});function gu(e){return Sl(hu,e)}const vu=h("ZodISODate",(e,t)=>{bc.init(e,t),X.init(e,t)});function bu(e){return Il(vu,e)}const yu=h("ZodISOTime",(e,t)=>{yc.init(e,t),X.init(e,t)});function _u(e){return zl(yu,e)}const wu=h("ZodISODuration",(e,t)=>{_c.init(e,t),X.init(e,t)});function ku(e){return Tl(wu,e)}const xu=(e,t)=>{go.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:r=>li(e,r)},flatten:{value:r=>ci(e,r)},addIssue:{value:r=>{e.issues.push(r),e.message=JSON.stringify(e.issues,lr,2)}},addIssues:{value:r=>{e.issues.push(...r),e.message=JSON.stringify(e.issues,lr,2)}},isEmpty:{get(){return e.issues.length===0}}})},pe=h("ZodError",xu,{Parent:Error}),Eu=xr(pe),Su=Er(pe),Iu=Yt(pe),rs=Ht(pe),zu=pi(pe),Tu=fi(pe),Nu=mi(pe),Ou=hi(pe),Au=gi(pe),Pu=vi(pe),Ru=bi(pe),$u=yi(pe),q=h("ZodType",(e,t)=>(W.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:Jt(e,"input"),output:Jt(e,"output")}}),e.toJSONSchema=Xl(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...r)=>e.clone(Pe(t,{checks:[...t.checks??[],...r.map(n=>typeof n=="function"?{_zod:{check:n,def:{check:"custom"},onattach:[]}}:n)]}),{parent:!0}),e.with=e.check,e.clone=(r,n)=>Re(e,r,n),e.brand=()=>e,e.register=((r,n)=>(r.add(e,n),e)),e.parse=(r,n)=>Eu(e,r,n,{callee:e.parse}),e.safeParse=(r,n)=>Iu(e,r,n),e.parseAsync=async(r,n)=>Su(e,r,n,{callee:e.parseAsync}),e.safeParseAsync=async(r,n)=>rs(e,r,n),e.spa=e.safeParseAsync,e.encode=(r,n)=>zu(e,r,n),e.decode=(r,n)=>Tu(e,r,n),e.encodeAsync=async(r,n)=>Nu(e,r,n),e.decodeAsync=async(r,n)=>Ou(e,r,n),e.safeEncode=(r,n)=>Au(e,r,n),e.safeDecode=(r,n)=>Pu(e,r,n),e.safeEncodeAsync=async(r,n)=>Ru(e,r,n),e.safeDecodeAsync=async(r,n)=>$u(e,r,n),e.refine=(r,n)=>e.check(Nd(r,n)),e.superRefine=r=>e.check(Od(r)),e.overwrite=r=>e.check(rt(r)),e.optional=()=>bn(e),e.exactOptional=()=>hd(e),e.nullable=()=>yn(e),e.nullish=()=>bn(yn(e)),e.nonoptional=r=>wd(e,r),e.array=()=>ne(e),e.or=r=>ie([e,r]),e.and=r=>ld(e,r),e.transform=r=>_n(e,fd(r)),e.default=r=>bd(e,r),e.prefault=r=>_d(e,r),e.catch=r=>xd(e,r),e.pipe=r=>_n(e,r),e.readonly=()=>Id(e),e.describe=r=>{const n=e.clone();return ct.add(n,{description:r}),n},Object.defineProperty(e,"description",{get(){var r;return(r=ct.get(e))==null?void 0:r.description},configurable:!0}),e.meta=(...r)=>{if(r.length===0)return ct.get(e);const n=e.clone();return ct.add(n,r[0]),n},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=r=>r(e),e)),ns=h("_ZodString",(e,t)=>{Sr.init(e,t),q.init(e,t),e._zod.processJSONSchema=(n,o,s)=>Ro(e,n,o);const r=e._zod.bag;e.format=r.format??null,e.minLength=r.minimum??null,e.maxLength=r.maximum??null,e.regex=(...n)=>e.check(Cl(...n)),e.includes=(...n)=>e.check(Ml(...n)),e.startsWith=(...n)=>e.check(Dl(...n)),e.endsWith=(...n)=>e.check(Fl(...n)),e.min=(...n)=>e.check(Dt(...n)),e.max=(...n)=>e.check(Ao(...n)),e.length=(...n)=>e.check(Po(...n)),e.nonempty=(...n)=>e.check(Dt(1,...n)),e.lowercase=n=>e.check(Zl(n)),e.uppercase=n=>e.check(jl(n)),e.trim=()=>e.check(Ul()),e.normalize=(...n)=>e.check(Ll(...n)),e.toLowerCase=()=>e.check(Jl()),e.toUpperCase=()=>e.check(Vl()),e.slugify=()=>e.check(Bl())}),Cu=h("ZodString",(e,t)=>{Sr.init(e,t),ns.init(e,t),e.email=r=>e.check(ol(Zu,r)),e.url=r=>e.check(ll(ju,r)),e.jwt=r=>e.check(El(Ku,r)),e.emoji=r=>e.check(ul(Mu,r)),e.guid=r=>e.check(dn(gn,r)),e.uuid=r=>e.check(sl(Pt,r)),e.uuidv4=r=>e.check(al(Pt,r)),e.uuidv6=r=>e.check(il(Pt,r)),e.uuidv7=r=>e.check(cl(Pt,r)),e.nanoid=r=>e.check(dl(Du,r)),e.guid=r=>e.check(dn(gn,r)),e.cuid=r=>e.check(pl(Fu,r)),e.cuid2=r=>e.check(fl(Lu,r)),e.ulid=r=>e.check(ml(Uu,r)),e.base64=r=>e.check(wl(Yu,r)),e.base64url=r=>e.check(kl(Hu,r)),e.xid=r=>e.check(hl(Ju,r)),e.ksuid=r=>e.check(gl(Vu,r)),e.ipv4=r=>e.check(vl(Bu,r)),e.ipv6=r=>e.check(bl(Wu,r)),e.cidrv4=r=>e.check(yl(qu,r)),e.cidrv6=r=>e.check(_l(Gu,r)),e.e164=r=>e.check(xl(Xu,r)),e.datetime=r=>e.check(gu(r)),e.date=r=>e.check(bu(r)),e.time=r=>e.check(_u(r)),e.duration=r=>e.check(ku(r))});function g(e){return nl(Cu,e)}const X=h("ZodStringFormat",(e,t)=>{Y.init(e,t),ns.init(e,t)}),Zu=h("ZodEmail",(e,t)=>{cc.init(e,t),X.init(e,t)}),gn=h("ZodGUID",(e,t)=>{ac.init(e,t),X.init(e,t)}),Pt=h("ZodUUID",(e,t)=>{ic.init(e,t),X.init(e,t)}),ju=h("ZodURL",(e,t)=>{lc.init(e,t),X.init(e,t)}),Mu=h("ZodEmoji",(e,t)=>{uc.init(e,t),X.init(e,t)}),Du=h("ZodNanoID",(e,t)=>{dc.init(e,t),X.init(e,t)}),Fu=h("ZodCUID",(e,t)=>{pc.init(e,t),X.init(e,t)}),Lu=h("ZodCUID2",(e,t)=>{fc.init(e,t),X.init(e,t)}),Uu=h("ZodULID",(e,t)=>{mc.init(e,t),X.init(e,t)}),Ju=h("ZodXID",(e,t)=>{hc.init(e,t),X.init(e,t)}),Vu=h("ZodKSUID",(e,t)=>{gc.init(e,t),X.init(e,t)}),Bu=h("ZodIPv4",(e,t)=>{wc.init(e,t),X.init(e,t)}),Wu=h("ZodIPv6",(e,t)=>{kc.init(e,t),X.init(e,t)}),qu=h("ZodCIDRv4",(e,t)=>{xc.init(e,t),X.init(e,t)}),Gu=h("ZodCIDRv6",(e,t)=>{Ec.init(e,t),X.init(e,t)}),Yu=h("ZodBase64",(e,t)=>{Sc.init(e,t),X.init(e,t)}),Hu=h("ZodBase64URL",(e,t)=>{zc.init(e,t),X.init(e,t)}),Xu=h("ZodE164",(e,t)=>{Tc.init(e,t),X.init(e,t)}),Ku=h("ZodJWT",(e,t)=>{Oc.init(e,t),X.init(e,t)}),os=h("ZodNumber",(e,t)=>{Io.init(e,t),q.init(e,t),e._zod.processJSONSchema=(n,o,s)=>$o(e,n,o),e.gt=(n,o)=>e.check(fn(n,o)),e.gte=(n,o)=>e.check(rr(n,o)),e.min=(n,o)=>e.check(rr(n,o)),e.lt=(n,o)=>e.check(pn(n,o)),e.lte=(n,o)=>e.check(tr(n,o)),e.max=(n,o)=>e.check(tr(n,o)),e.int=n=>e.check(vn(n)),e.safe=n=>e.check(vn(n)),e.positive=n=>e.check(fn(0,n)),e.nonnegative=n=>e.check(rr(0,n)),e.negative=n=>e.check(pn(0,n)),e.nonpositive=n=>e.check(tr(0,n)),e.multipleOf=(n,o)=>e.check(mn(n,o)),e.step=(n,o)=>e.check(mn(n,o)),e.finite=()=>e;const r=e._zod.bag;e.minValue=Math.max(r.minimum??Number.NEGATIVE_INFINITY,r.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(r.maximum??Number.POSITIVE_INFINITY,r.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(r.format??"").includes("int")||Number.isSafeInteger(r.multipleOf??.5),e.isFinite=!0,e.format=r.format??null});function je(e){return Nl(os,e)}const Qu=h("ZodNumberFormat",(e,t)=>{Ac.init(e,t),os.init(e,t)});function vn(e){return Ol(Qu,e)}const ed=h("ZodBoolean",(e,t)=>{Pc.init(e,t),q.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Co(e,r,n)});function ae(e){return Al(ed,e)}const td=h("ZodNull",(e,t)=>{Rc.init(e,t),q.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Zo(e,r,n)});function rd(e){return Pl(td,e)}const nd=h("ZodUnknown",(e,t)=>{$c.init(e,t),q.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Mo()});function he(){return Rl(nd)}const od=h("ZodNever",(e,t)=>{Cc.init(e,t),q.init(e,t),e._zod.processJSONSchema=(r,n,o)=>jo(e,r,n)});function ss(e){return $l(od,e)}const sd=h("ZodArray",(e,t)=>{Zc.init(e,t),q.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Jo(e,r,n,o),e.element=t.element,e.min=(r,n)=>e.check(Dt(r,n)),e.nonempty=r=>e.check(Dt(1,r)),e.max=(r,n)=>e.check(Ao(r,n)),e.length=(r,n)=>e.check(Po(r,n)),e.unwrap=()=>e.element});function ne(e,t){return Wl(sd,e,t)}const as=h("ZodObject",(e,t)=>{Mc.init(e,t),q.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Vo(e,r,n,o),D(e,"shape",()=>t.shape),e.keyof=()=>bt(Object.keys(e._zod.def.shape)),e.catchall=r=>e.clone({...e._zod.def,catchall:r}),e.passthrough=()=>e.clone({...e._zod.def,catchall:he()}),e.loose=()=>e.clone({...e._zod.def,catchall:he()}),e.strict=()=>e.clone({...e._zod.def,catchall:ss()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=r=>ni(e,r),e.safeExtend=r=>oi(e,r),e.merge=r=>si(e,r),e.pick=r=>ti(e,r),e.omit=r=>ri(e,r),e.partial=(...r)=>ai(cs,e,r[0]),e.required=(...r)=>ii(ls,e,r[0])});function $(e,t){const r={type:"object",shape:e??{},...I(t)};return new as(r)}function V(e,t){return new as({type:"object",shape:e,catchall:ss(),...I(t)})}const is=h("ZodUnion",(e,t)=>{No.init(e,t),q.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Bo(e,r,n,o),e.options=t.options});function ie(e,t){return new is({type:"union",options:e,...I(t)})}const ad=h("ZodDiscriminatedUnion",(e,t)=>{is.init(e,t),Dc.init(e,t)});function id(e,t,r){return new ad({type:"union",options:t,discriminator:e,...I(r)})}const cd=h("ZodIntersection",(e,t)=>{Fc.init(e,t),q.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Wo(e,r,n,o)});function ld(e,t){return new cd({type:"intersection",left:e,right:t})}const ud=h("ZodRecord",(e,t)=>{Lc.init(e,t),q.init(e,t),e._zod.processJSONSchema=(r,n,o)=>qo(e,r,n,o),e.keyType=t.keyType,e.valueType=t.valueType});function tt(e,t,r){return new ud({type:"record",keyType:e,valueType:t,...I(r)})}const dr=h("ZodEnum",(e,t)=>{Uc.init(e,t),q.init(e,t),e._zod.processJSONSchema=(n,o,s)=>Do(e,n,o),e.enum=t.entries,e.options=Object.values(t.entries);const r=new Set(Object.keys(t.entries));e.extract=(n,o)=>{const s={};for(const a of n)if(r.has(a))s[a]=t.entries[a];else throw new Error(`Key ${a} not found in enum`);return new dr({...t,checks:[],...I(o),entries:s})},e.exclude=(n,o)=>{const s={...t.entries};for(const a of n)if(r.has(a))delete s[a];else throw new Error(`Key ${a} not found in enum`);return new dr({...t,checks:[],...I(o),entries:s})}});function bt(e,t){const r=Array.isArray(e)?Object.fromEntries(e.map(n=>[n,n])):e;return new dr({type:"enum",entries:r,...I(t)})}const dd=h("ZodLiteral",(e,t)=>{Jc.init(e,t),q.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Fo(e,r,n),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function T(e,t){return new dd({type:"literal",values:Array.isArray(e)?e:[e],...I(t)})}const pd=h("ZodTransform",(e,t)=>{Vc.init(e,t),q.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Uo(e,r),e._zod.parse=(r,n)=>{if(n.direction==="backward")throw new lo(e.constructor.name);r.addIssue=s=>{if(typeof s=="string")r.issues.push(ft(s,r.value,t));else{const a=s;a.fatal&&(a.continue=!1),a.code??(a.code="custom"),a.input??(a.input=r.value),a.inst??(a.inst=e),r.issues.push(ft(a))}};const o=t.transform(r.value,r);return o instanceof Promise?o.then(s=>(r.value=s,r)):(r.value=o,r)}});function fd(e){return new pd({type:"transform",transform:e})}const cs=h("ZodOptional",(e,t)=>{Oo.init(e,t),q.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Ir(e,r,n,o),e.unwrap=()=>e._zod.def.innerType});function bn(e){return new cs({type:"optional",innerType:e})}const md=h("ZodExactOptional",(e,t)=>{Bc.init(e,t),q.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Ir(e,r,n,o),e.unwrap=()=>e._zod.def.innerType});function hd(e){return new md({type:"optional",innerType:e})}const gd=h("ZodNullable",(e,t)=>{Wc.init(e,t),q.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Go(e,r,n,o),e.unwrap=()=>e._zod.def.innerType});function yn(e){return new gd({type:"nullable",innerType:e})}const vd=h("ZodDefault",(e,t)=>{qc.init(e,t),q.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Ho(e,r,n,o),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function bd(e,t){return new vd({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():mo(t)}})}const yd=h("ZodPrefault",(e,t)=>{Gc.init(e,t),q.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Xo(e,r,n,o),e.unwrap=()=>e._zod.def.innerType});function _d(e,t){return new yd({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():mo(t)}})}const ls=h("ZodNonOptional",(e,t)=>{Yc.init(e,t),q.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Yo(e,r,n,o),e.unwrap=()=>e._zod.def.innerType});function wd(e,t){return new ls({type:"nonoptional",innerType:e,...I(t)})}const kd=h("ZodCatch",(e,t)=>{Hc.init(e,t),q.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Ko(e,r,n,o),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function xd(e,t){return new kd({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const Ed=h("ZodPipe",(e,t)=>{Xc.init(e,t),q.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Qo(e,r,n,o),e.in=t.in,e.out=t.out});function _n(e,t){return new Ed({type:"pipe",in:e,out:t})}const Sd=h("ZodReadonly",(e,t)=>{Kc.init(e,t),q.init(e,t),e._zod.processJSONSchema=(r,n,o)=>es(e,r,n,o),e.unwrap=()=>e._zod.def.innerType});function Id(e){return new Sd({type:"readonly",innerType:e})}const zd=h("ZodLazy",(e,t)=>{Qc.init(e,t),q.init(e,t),e._zod.processJSONSchema=(r,n,o)=>ts(e,r,n,o),e.unwrap=()=>e._zod.def.getter()});function Td(e){return new zd({type:"lazy",getter:e})}const zr=h("ZodCustom",(e,t)=>{el.init(e,t),q.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Lo(e,r)});function us(e,t){return ql(zr,e??(()=>!0),t)}function Nd(e,t={}){return Gl(zr,e,t)}function Od(e){return Yl(e)}function Vt(e,t={}){const r=new zr({type:"custom",check:"custom",fn:n=>n instanceof e,abort:!0,...I(t)});return r._zod.bag.Class=e,r._zod.check=n=>{n.value instanceof e||n.issues.push({code:"invalid_type",expected:e.name,input:n.value,inst:r,path:[...r._zod.def.path??[]]})},r}var mt;(function(e){e.assertEqual=o=>{};function t(o){}e.assertIs=t;function r(o){throw new Error}e.assertNever=r,e.arrayToEnum=o=>{const s={};for(const a of o)s[a]=a;return s},e.getValidEnumValues=o=>{const s=e.objectKeys(o).filter(i=>typeof o[o[i]]!="number"),a={};for(const i of s)a[i]=o[i];return e.objectValues(a)},e.objectValues=o=>e.objectKeys(o).map(function(s){return o[s]}),e.objectKeys=typeof Object.keys=="function"?o=>Object.keys(o):o=>{const s=[];for(const a in o)Object.prototype.hasOwnProperty.call(o,a)&&s.push(a);return s},e.find=(o,s)=>{for(const a of o)if(s(a))return a},e.isInteger=typeof Number.isInteger=="function"?o=>Number.isInteger(o):o=>typeof o=="number"&&Number.isFinite(o)&&Math.floor(o)===o;function n(o,s=" | "){return o.map(a=>typeof a=="string"?`'${a}'`:a).join(s)}e.joinValues=n,e.jsonStringifyReplacer=(o,s)=>typeof s=="bigint"?s.toString():s})(mt||(mt={}));var wn;(function(e){e.mergeShapes=(t,r)=>({...t,...r})})(wn||(wn={}));mt.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]);mt.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"]);class Bt 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]};const r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=t}format(t){const r=t||function(s){return s.message},n={_errors:[]},o=s=>{for(const a of s.issues)if(a.code==="invalid_union")a.unionErrors.map(o);else if(a.code==="invalid_return_type")o(a.returnTypeError);else if(a.code==="invalid_arguments")o(a.argumentsError);else if(a.path.length===0)n._errors.push(r(a));else{let i=n,l=0;for(;l<a.path.length;){const c=a.path[l];l===a.path.length-1?(i[c]=i[c]||{_errors:[]},i[c]._errors.push(r(a))):i[c]=i[c]||{_errors:[]},i=i[c],l++}}};return o(this),n}static assert(t){if(!(t instanceof Bt))throw new Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,mt.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=r=>r.message){const r=Object.create(null),n=[];for(const o of this.issues)if(o.path.length>0){const s=o.path[0];r[s]=r[s]||[],r[s].push(t(o))}else n.push(t(o));return{formErrors:n,fieldErrors:r}}get formErrors(){return this.flatten()}}Bt.create=e=>new Bt(e);var kn;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t==null?void 0:t.message})(kn||(kn={}));var R;(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"})(R||(R={}));class xn extends Error{constructor(t,r){super(t),this.name="ParseError",this.type=r.type,this.field=r.field,this.value=r.value,this.line=r.line}}function nr(e){}function Ad(e){if(typeof e=="function")throw new TypeError("`callbacks` must be an object, got a function instead. Did you mean `{onEvent: fn}`?");const{onEvent:t=nr,onError:r=nr,onRetry:n=nr,onComment:o}=e;let s="",a=!0,i,l="",c="";function u(v){const _=a?v.replace(/^\xEF\xBB\xBF/,""):v,[y,E]=Pd(`${s}${_}`);for(const p of y)d(p);s=E,a=!1}function d(v){if(v===""){m();return}if(v.startsWith(":")){o&&o(v.slice(v.startsWith(": ")?2:1));return}const _=v.indexOf(":");if(_!==-1){const y=v.slice(0,_),E=v[_+1]===" "?2:1,p=v.slice(_+E);f(y,p,v);return}f(v,"",v)}function f(v,_,y){switch(v){case"event":c=_;break;case"data":l=`${l}${_}
128
+ `;break;case"id":i=_.includes("\0")?void 0:_;break;case"retry":/^\d+$/.test(_)?n(parseInt(_,10)):r(new xn(`Invalid \`retry\` value: "${_}"`,{type:"invalid-retry",value:_,line:y}));break;default:r(new xn(`Unknown field "${v.length>20?`${v.slice(0,20)}…`:v}"`,{type:"unknown-field",field:v,value:_,line:y}));break}}function m(){l.length>0&&t({id:i,event:c||void 0,data:l.endsWith(`
129
+ `)?l.slice(0,-1):l}),i=void 0,l="",c=""}function w(v={}){s&&v.consume&&d(s),a=!0,i=void 0,l="",c="",s=""}return{feed:u,reset:w}}function Pd(e){const t=[];let r="",n=0;for(;n<e.length;){const o=e.indexOf("\r",n),s=e.indexOf(`
130
+ `,n);let a=-1;if(o!==-1&&s!==-1?a=Math.min(o,s):o!==-1?o===e.length-1?a=-1:a=o:s!==-1&&(a=s),a===-1){r=e.slice(n);break}else{const i=e.slice(n,a);t.push(i),n=a+1,e[n-1]==="\r"&&e[n]===`
131
+ `&&n++}}return[t,r]}class Rd extends TransformStream{constructor({onError:t,onRetry:r,onComment:n}={}){let o;super({start(s){o=Ad({onEvent:a=>{s.enqueue(a)},onError(a){t==="terminate"?s.error(a):typeof t=="function"&&t(a)},onRetry:r,onComment:n})},transform(s){o.feed(s)}})}}var yt=({prefix:e,size:t=16,alphabet:r="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",separator:n="-"}={})=>{const o=()=>{const s=r.length,a=new Array(t);for(let i=0;i<t;i++)a[i]=r[Math.random()*s|0];return a.join("")};if(e==null)return o;if(r.includes(n))throw new Wa({argument:"separator",message:`The separator "${n}" must not be part of the alphabet "${r}".`});return()=>`${e}${n}${o()}`},$d=yt();function En(e=globalThis){var t,r,n;return e.window?"runtime/browser":(t=e.navigator)!=null&&t.userAgent?`runtime/${e.navigator.userAgent.toLowerCase()}`:(n=(r=e.process)==null?void 0:r.versions)!=null&&n.node?`runtime/node.js/${e.process.version.substring(0)}`:e.EdgeRuntime?"runtime/vercel-edge":"runtime/unknown"}function Ze(e){if(e==null)return{};const t={};if(e instanceof Headers)e.forEach((r,n)=>{t[n.toLowerCase()]=r});else{Array.isArray(e)||(e=Object.entries(e));for(const[r,n]of e)n!=null&&(t[r.toLowerCase()]=n)}return t}function Sn(e,...t){const r=new Headers(Ze(e)),n=r.get("user-agent")||"";return r.set("user-agent",[n,...t].filter(Boolean).join(" ")),Object.fromEntries(r.entries())}var Cd=/"(?:_|\\u005[Ff])(?:_|\\u005[Ff])(?:p|\\u0070)(?:r|\\u0072)(?:o|\\u006[Ff])(?:t|\\u0074)(?:o|\\u006[Ff])(?:_|\\u005[Ff])(?:_|\\u005[Ff])"\s*:/,Zd=/"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/;function In(e){const t=JSON.parse(e);return t===null||typeof t!="object"||Cd.test(e)===!1&&Zd.test(e)===!1?t:jd(t)}function jd(e){let t=[e];for(;t.length;){const r=t;t=[];for(const n of r){if(Object.prototype.hasOwnProperty.call(n,"__proto__"))throw new SyntaxError("Object contains forbidden prototype property");if(Object.prototype.hasOwnProperty.call(n,"constructor")&&n.constructor!==null&&typeof n.constructor=="object"&&Object.prototype.hasOwnProperty.call(n.constructor,"prototype"))throw new SyntaxError("Object contains forbidden prototype property");for(const o in n){const s=n[o];s&&typeof s=="object"&&t.push(s)}}}return e}function Md(e){const{stackTraceLimit:t}=Error;try{Error.stackTraceLimit=0}catch{return In(e)}try{return In(e)}finally{Error.stackTraceLimit=t}}function Tr(e){if(e.type==="object"||Array.isArray(e.type)&&e.type.includes("object")){e.additionalProperties=!1;const{properties:r}=e;if(r!=null)for(const n of Object.keys(r))r[n]=Ce(r[n])}e.items!=null&&(e.items=Array.isArray(e.items)?e.items.map(Ce):Ce(e.items)),e.anyOf!=null&&(e.anyOf=e.anyOf.map(Ce)),e.allOf!=null&&(e.allOf=e.allOf.map(Ce)),e.oneOf!=null&&(e.oneOf=e.oneOf.map(Ce));const{definitions:t}=e;if(t!=null)for(const r of Object.keys(t))t[r]=Ce(t[r]);return e}function Ce(e){return typeof e=="boolean"?e:Tr(e)}var Dd=Symbol("Let zodToJsonSchema decide on which parser to use"),zn={name:void 0,$refStrategy:"root",basePath:["#"],effectStrategy:"input",pipeStrategy:"all",dateStrategy:"format:date-time",mapStrategy:"entries",removeAdditionalStrategy:"passthrough",allowedAdditionalProperties:!0,rejectedAdditionalProperties:!1,definitionPath:"definitions",strictUnions:!1,definitions:{},errorMessages:!1,patternStrategy:"escape",applyRegexFlags:!1,emailStrategy:"format:email",base64Strategy:"contentEncoding:base64",nameStrategy:"ref"},Fd=e=>typeof e=="string"?{...zn,name:e}:{...zn,...e};function ue(){return{}}function Ld(e,t){var r,n,o;const s={type:"array"};return(r=e.type)!=null&&r._def&&((o=(n=e.type)==null?void 0:n._def)==null?void 0:o.typeName)!==R.ZodAny&&(s.items=L(e.type._def,{...t,currentPath:[...t.currentPath,"items"]})),e.minLength&&(s.minItems=e.minLength.value),e.maxLength&&(s.maxItems=e.maxLength.value),e.exactLength&&(s.minItems=e.exactLength.value,s.maxItems=e.exactLength.value),s}function Ud(e){const t={type:"integer",format:"int64"};if(!e.checks)return t;for(const r of e.checks)switch(r.kind){case"min":r.inclusive?t.minimum=r.value:t.exclusiveMinimum=r.value;break;case"max":r.inclusive?t.maximum=r.value:t.exclusiveMaximum=r.value;break;case"multipleOf":t.multipleOf=r.value;break}return t}function Jd(){return{type:"boolean"}}function ds(e,t){return L(e.type._def,t)}var Vd=(e,t)=>L(e.innerType._def,t);function ps(e,t,r){const n=r??t.dateStrategy;if(Array.isArray(n))return{anyOf:n.map((o,s)=>ps(e,t,o))};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 Bd(e)}}var Bd=e=>{const t={type:"integer",format:"unix-time"};for(const r of e.checks)switch(r.kind){case"min":t.minimum=r.value;break;case"max":t.maximum=r.value;break}return t};function Wd(e,t){return{...L(e.innerType._def,t),default:e.defaultValue()}}function qd(e,t){return t.effectStrategy==="input"?L(e.schema._def,t):ue()}function Gd(e){return{type:"string",enum:Array.from(e.values)}}var Yd=e=>"type"in e&&e.type==="string"?!1:"allOf"in e;function Hd(e,t){const r=[L(e.left._def,{...t,currentPath:[...t.currentPath,"allOf","0"]}),L(e.right._def,{...t,currentPath:[...t.currentPath,"allOf","1"]})].filter(o=>!!o),n=[];return r.forEach(o=>{if(Yd(o))n.push(...o.allOf);else{let s=o;if("additionalProperties"in o&&o.additionalProperties===!1){const{additionalProperties:a,...i}=o;s=i}n.push(s)}}),n.length?{allOf:n}:void 0}function Xd(e){const t=typeof e.value;return t!=="bigint"&&t!=="number"&&t!=="boolean"&&t!=="string"?{type:Array.isArray(e.value)?"array":"object"}:{type:t==="bigint"?"integer":t,const:e.value}}var or=void 0,fe={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:()=>(or===void 0&&(or=RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),or),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 fs(e,t){const r={type:"string"};if(e.checks)for(const n of e.checks)switch(n.kind){case"min":r.minLength=typeof r.minLength=="number"?Math.max(r.minLength,n.value):n.value;break;case"max":r.maxLength=typeof r.maxLength=="number"?Math.min(r.maxLength,n.value):n.value;break;case"email":switch(t.emailStrategy){case"format:email":me(r,"email",n.message,t);break;case"format:idn-email":me(r,"idn-email",n.message,t);break;case"pattern:zod":oe(r,fe.email,n.message,t);break}break;case"url":me(r,"uri",n.message,t);break;case"uuid":me(r,"uuid",n.message,t);break;case"regex":oe(r,n.regex,n.message,t);break;case"cuid":oe(r,fe.cuid,n.message,t);break;case"cuid2":oe(r,fe.cuid2,n.message,t);break;case"startsWith":oe(r,RegExp(`^${sr(n.value,t)}`),n.message,t);break;case"endsWith":oe(r,RegExp(`${sr(n.value,t)}$`),n.message,t);break;case"datetime":me(r,"date-time",n.message,t);break;case"date":me(r,"date",n.message,t);break;case"time":me(r,"time",n.message,t);break;case"duration":me(r,"duration",n.message,t);break;case"length":r.minLength=typeof r.minLength=="number"?Math.max(r.minLength,n.value):n.value,r.maxLength=typeof r.maxLength=="number"?Math.min(r.maxLength,n.value):n.value;break;case"includes":{oe(r,RegExp(sr(n.value,t)),n.message,t);break}case"ip":{n.version!=="v6"&&me(r,"ipv4",n.message,t),n.version!=="v4"&&me(r,"ipv6",n.message,t);break}case"base64url":oe(r,fe.base64url,n.message,t);break;case"jwt":oe(r,fe.jwt,n.message,t);break;case"cidr":{n.version!=="v6"&&oe(r,fe.ipv4Cidr,n.message,t),n.version!=="v4"&&oe(r,fe.ipv6Cidr,n.message,t);break}case"emoji":oe(r,fe.emoji(),n.message,t);break;case"ulid":{oe(r,fe.ulid,n.message,t);break}case"base64":{switch(t.base64Strategy){case"format:binary":{me(r,"binary",n.message,t);break}case"contentEncoding:base64":{r.contentEncoding="base64";break}case"pattern:zod":{oe(r,fe.base64,n.message,t);break}}break}case"nanoid":oe(r,fe.nanoid,n.message,t)}return r}function sr(e,t){return t.patternStrategy==="escape"?Qd(e):e}var Kd=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");function Qd(e){let t="";for(let r=0;r<e.length;r++)Kd.has(e[r])||(t+="\\"),t+=e[r];return t}function me(e,t,r,n){var o;e.format||(o=e.anyOf)!=null&&o.some(s=>s.format)?(e.anyOf||(e.anyOf=[]),e.format&&(e.anyOf.push({format:e.format}),delete e.format),e.anyOf.push({format:t,...r&&n.errorMessages&&{errorMessage:{format:r}}})):e.format=t}function oe(e,t,r,n){var o;e.pattern||(o=e.allOf)!=null&&o.some(s=>s.pattern)?(e.allOf||(e.allOf=[]),e.pattern&&(e.allOf.push({pattern:e.pattern}),delete e.pattern),e.allOf.push({pattern:Tn(t,n),...r&&n.errorMessages&&{errorMessage:{pattern:r}}})):e.pattern=Tn(t,n)}function Tn(e,t){var r;if(!t.applyRegexFlags||!e.flags)return e.source;const n={i:e.flags.includes("i"),m:e.flags.includes("m"),s:e.flags.includes("s")},o=n.i?e.source.toLowerCase():e.source;let s="",a=!1,i=!1,l=!1;for(let c=0;c<o.length;c++){if(a){s+=o[c],a=!1;continue}if(n.i){if(i){if(o[c].match(/[a-z]/)){l?(s+=o[c],s+=`${o[c-2]}-${o[c]}`.toUpperCase(),l=!1):o[c+1]==="-"&&((r=o[c+2])!=null&&r.match(/[a-z]/))?(s+=o[c],l=!0):s+=`${o[c]}${o[c].toUpperCase()}`;continue}}else if(o[c].match(/[a-z]/)){s+=`[${o[c]}${o[c].toUpperCase()}]`;continue}}if(n.m){if(o[c]==="^"){s+=`(^|(?<=[\r
132
+ ]))`;continue}else if(o[c]==="$"){s+=`($|(?=[\r
133
+ ]))`;continue}}if(n.s&&o[c]==="."){s+=i?`${o[c]}\r
134
+ `:`[${o[c]}\r
135
+ ]`;continue}s+=o[c],o[c]==="\\"?a=!0:i&&o[c]==="]"?i=!1:!i&&o[c]==="["&&(i=!0)}try{new RegExp(s)}catch{return console.warn(`Could not convert regex pattern at ${t.currentPath.join("/")} to a flag-independent form! Falling back to the flag-ignorant source`),e.source}return s}function ms(e,t){var r,n,o,s,a,i;const l={type:"object",additionalProperties:(r=L(e.valueType._def,{...t,currentPath:[...t.currentPath,"additionalProperties"]}))!=null?r:t.allowedAdditionalProperties};if(((n=e.keyType)==null?void 0:n._def.typeName)===R.ZodString&&((o=e.keyType._def.checks)!=null&&o.length)){const{type:c,...u}=fs(e.keyType._def,t);return{...l,propertyNames:u}}else{if(((s=e.keyType)==null?void 0:s._def.typeName)===R.ZodEnum)return{...l,propertyNames:{enum:e.keyType._def.values}};if(((a=e.keyType)==null?void 0:a._def.typeName)===R.ZodBranded&&e.keyType._def.type._def.typeName===R.ZodString&&((i=e.keyType._def.type._def.checks)!=null&&i.length)){const{type:c,...u}=ds(e.keyType._def,t);return{...l,propertyNames:u}}}return l}function ep(e,t){if(t.mapStrategy==="record")return ms(e,t);const r=L(e.keyType._def,{...t,currentPath:[...t.currentPath,"items","items","0"]})||ue(),n=L(e.valueType._def,{...t,currentPath:[...t.currentPath,"items","items","1"]})||ue();return{type:"array",maxItems:125,items:{type:"array",items:[r,n],minItems:2,maxItems:2}}}function tp(e){const t=e.values,n=Object.keys(e.values).filter(s=>typeof t[t[s]]!="number").map(s=>t[s]),o=Array.from(new Set(n.map(s=>typeof s)));return{type:o.length===1?o[0]==="string"?"string":"number":["string","number"],enum:n}}function rp(){return{not:ue()}}function np(){return{type:"null"}}var pr={ZodString:"string",ZodNumber:"number",ZodBigInt:"integer",ZodBoolean:"boolean",ZodNull:"null"};function op(e,t){const r=e.options instanceof Map?Array.from(e.options.values()):e.options;if(r.every(n=>n._def.typeName in pr&&(!n._def.checks||!n._def.checks.length))){const n=r.reduce((o,s)=>{const a=pr[s._def.typeName];return a&&!o.includes(a)?[...o,a]:o},[]);return{type:n.length>1?n:n[0]}}else if(r.every(n=>n._def.typeName==="ZodLiteral"&&!n.description)){const n=r.reduce((o,s)=>{const a=typeof s._def.value;switch(a){case"string":case"number":case"boolean":return[...o,a];case"bigint":return[...o,"integer"];case"object":if(s._def.value===null)return[...o,"null"];case"symbol":case"undefined":case"function":default:return o}},[]);if(n.length===r.length){const o=n.filter((s,a,i)=>i.indexOf(s)===a);return{type:o.length>1?o:o[0],enum:r.reduce((s,a)=>s.includes(a._def.value)?s:[...s,a._def.value],[])}}}else if(r.every(n=>n._def.typeName==="ZodEnum"))return{type:"string",enum:r.reduce((n,o)=>[...n,...o._def.values.filter(s=>!n.includes(s))],[])};return sp(e,t)}var sp=(e,t)=>{const r=(e.options instanceof Map?Array.from(e.options.values()):e.options).map((n,o)=>L(n._def,{...t,currentPath:[...t.currentPath,"anyOf",`${o}`]})).filter(n=>!!n&&(!t.strictUnions||typeof n=="object"&&Object.keys(n).length>0));return r.length?{anyOf:r}:void 0};function ap(e,t){if(["ZodString","ZodNumber","ZodBigInt","ZodBoolean","ZodNull"].includes(e.innerType._def.typeName)&&(!e.innerType._def.checks||!e.innerType._def.checks.length))return{type:[pr[e.innerType._def.typeName],"null"]};const r=L(e.innerType._def,{...t,currentPath:[...t.currentPath,"anyOf","0"]});return r&&{anyOf:[r,{type:"null"}]}}function ip(e){const t={type:"number"};if(!e.checks)return t;for(const r of e.checks)switch(r.kind){case"int":t.type="integer";break;case"min":r.inclusive?t.minimum=r.value:t.exclusiveMinimum=r.value;break;case"max":r.inclusive?t.maximum=r.value:t.exclusiveMaximum=r.value;break;case"multipleOf":t.multipleOf=r.value;break}return t}function cp(e,t){const r={type:"object",properties:{}},n=[],o=e.shape();for(const a in o){let i=o[a];if(i===void 0||i._def===void 0)continue;const l=up(i),c=L(i._def,{...t,currentPath:[...t.currentPath,"properties",a],propertyPath:[...t.currentPath,"properties",a]});c!==void 0&&(r.properties[a]=c,l||n.push(a))}n.length&&(r.required=n);const s=lp(e,t);return s!==void 0&&(r.additionalProperties=s),r}function lp(e,t){if(e.catchall._def.typeName!=="ZodNever")return L(e.catchall._def,{...t,currentPath:[...t.currentPath,"additionalProperties"]});switch(e.unknownKeys){case"passthrough":return t.allowedAdditionalProperties;case"strict":return t.rejectedAdditionalProperties;case"strip":return t.removeAdditionalStrategy==="strict"?t.allowedAdditionalProperties:t.rejectedAdditionalProperties}}function up(e){try{return e.isOptional()}catch{return!0}}var dp=(e,t)=>{var r;if(t.currentPath.toString()===((r=t.propertyPath)==null?void 0:r.toString()))return L(e.innerType._def,t);const n=L(e.innerType._def,{...t,currentPath:[...t.currentPath,"anyOf","1"]});return n?{anyOf:[{not:ue()},n]}:ue()},pp=(e,t)=>{if(t.pipeStrategy==="input")return L(e.in._def,t);if(t.pipeStrategy==="output")return L(e.out._def,t);const r=L(e.in._def,{...t,currentPath:[...t.currentPath,"allOf","0"]}),n=L(e.out._def,{...t,currentPath:[...t.currentPath,"allOf",r?"1":"0"]});return{allOf:[r,n].filter(o=>o!==void 0)}};function fp(e,t){return L(e.type._def,t)}function mp(e,t){const n={type:"array",uniqueItems:!0,items:L(e.valueType._def,{...t,currentPath:[...t.currentPath,"items"]})};return e.minSize&&(n.minItems=e.minSize.value),e.maxSize&&(n.maxItems=e.maxSize.value),n}function hp(e,t){return e.rest?{type:"array",minItems:e.items.length,items:e.items.map((r,n)=>L(r._def,{...t,currentPath:[...t.currentPath,"items",`${n}`]})).reduce((r,n)=>n===void 0?r:[...r,n],[]),additionalItems:L(e.rest._def,{...t,currentPath:[...t.currentPath,"additionalItems"]})}:{type:"array",minItems:e.items.length,maxItems:e.items.length,items:e.items.map((r,n)=>L(r._def,{...t,currentPath:[...t.currentPath,"items",`${n}`]})).reduce((r,n)=>n===void 0?r:[...r,n],[])}}function gp(){return{not:ue()}}function vp(){return ue()}var bp=(e,t)=>L(e.innerType._def,t),yp=(e,t,r)=>{switch(t){case R.ZodString:return fs(e,r);case R.ZodNumber:return ip(e);case R.ZodObject:return cp(e,r);case R.ZodBigInt:return Ud(e);case R.ZodBoolean:return Jd();case R.ZodDate:return ps(e,r);case R.ZodUndefined:return gp();case R.ZodNull:return np();case R.ZodArray:return Ld(e,r);case R.ZodUnion:case R.ZodDiscriminatedUnion:return op(e,r);case R.ZodIntersection:return Hd(e,r);case R.ZodTuple:return hp(e,r);case R.ZodRecord:return ms(e,r);case R.ZodLiteral:return Xd(e);case R.ZodEnum:return Gd(e);case R.ZodNativeEnum:return tp(e);case R.ZodNullable:return ap(e,r);case R.ZodOptional:return dp(e,r);case R.ZodMap:return ep(e,r);case R.ZodSet:return mp(e,r);case R.ZodLazy:return()=>e.getter()._def;case R.ZodPromise:return fp(e,r);case R.ZodNaN:case R.ZodNever:return rp();case R.ZodEffects:return qd(e,r);case R.ZodAny:return ue();case R.ZodUnknown:return vp();case R.ZodDefault:return Wd(e,r);case R.ZodBranded:return ds(e,r);case R.ZodReadonly:return bp(e,r);case R.ZodCatch:return Vd(e,r);case R.ZodPipeline:return pp(e,r);case R.ZodFunction:case R.ZodVoid:case R.ZodSymbol:return;default:return(n=>{})()}},_p=(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 L(e,t,r=!1){var n;const o=t.seen.get(e);if(t.override){const l=(n=t.override)==null?void 0:n.call(t,e,t,o,r);if(l!==Dd)return l}if(o&&!r){const l=wp(o,t);if(l!==void 0)return l}const s={def:e,path:t.currentPath,jsonSchema:void 0};t.seen.set(e,s);const a=yp(e,e.typeName,t),i=typeof a=="function"?L(a(),t):a;if(i&&kp(e,t,i),t.postProcess){const l=t.postProcess(i,e,t);return s.jsonSchema=i,l}return s.jsonSchema=i,i}var wp=(e,t)=>{switch(t.$refStrategy){case"root":return{$ref:e.path.join("/")};case"relative":return{$ref:_p(t.currentPath,e.path)};case"none":case"seen":return e.path.length<t.currentPath.length&&e.path.every((r,n)=>t.currentPath[n]===r)?(console.warn(`Recursive reference detected at ${t.currentPath.join("/")}! Defaulting to any`),ue()):t.$refStrategy==="seen"?ue():void 0}},kp=(e,t,r)=>(e.description&&(r.description=e.description),r),xp=e=>{const t=Fd(e),r=t.name!==void 0?[...t.basePath,t.definitionPath,t.name]:t.basePath;return{...t,currentPath:r,propertyPath:void 0,seen:new Map(Object.entries(t.definitions).map(([n,o])=>[o._def,{def:o._def,path:[...t.basePath,t.definitionPath,n],jsonSchema:void 0}]))}},Ep=(e,t)=>{var r;const n=xp(t);let o=typeof t=="object"&&t.definitions?Object.entries(t.definitions).reduce((c,[u,d])=>{var f;return{...c,[u]:(f=L(d._def,{...n,currentPath:[...n.basePath,n.definitionPath,u]},!0))!=null?f:ue()}},{}):void 0;const s=typeof t=="string"?t:(t==null?void 0:t.nameStrategy)==="title"||t==null?void 0:t.name,a=(r=L(e._def,s===void 0?n:{...n,currentPath:[...n.basePath,n.definitionPath,s]},!1))!=null?r:ue(),i=typeof t=="object"&&t.name!==void 0&&t.nameStrategy==="title"?t.name:void 0;i!==void 0&&(a.title=i);const l=s===void 0?o?{...a,[n.definitionPath]:o}:a:{$ref:[...n.$refStrategy==="relative"?[]:n.basePath,n.definitionPath,s].join("/"),[n.definitionPath]:{...o,[s]:a}};return l.$schema="http://json-schema.org/draft-07/schema#",l},fr=Symbol.for("vercel.ai.schema");function Sp(e){let t;return()=>(t==null&&(t=e()),t)}function Kt(e,{validate:t}={}){return{[fr]:!0,_type:void 0,get jsonSchema(){return typeof e=="function"&&(e=e()),e},validate:t}}function Ip(e){return typeof e=="object"&&e!==null&&fr in e&&e[fr]===!0&&"jsonSchema"in e&&"validate"in e}function Nr(e){return e==null?Kt({properties:{},additionalProperties:!1}):Ip(e)?e:"~standard"in e?e["~standard"].vendor==="zod"?hs(e):zp(e):e()}function zp(e){return Kt(()=>Tr(e["~standard"].jsonSchema.input({target:"draft-07"})),{validate:async t=>{const r=await e["~standard"].validate(t);return"value"in r?{success:!0,value:r.value}:{success:!1,error:new Ke({value:t,cause:r.issues})}}})}function Tp(e,t){var r;const n=(r=void 0)!=null?r:!1;return Kt(()=>Ep(e,{$refStrategy:n?"root":"none"}),{validate:async o=>{const s=await e.safeParseAsync(o);return s.success?{success:!0,value:s.data}:{success:!1,error:s.error}}})}function Np(e,t){var r;const n=(r=void 0)!=null?r:!1;return Kt(()=>Tr(mu(e,{target:"draft-7",io:"input",reused:n?"ref":"inline"})),{validate:async o=>{const s=await rs(e,o);return s.success?{success:!0,value:s.data}:{success:!1,error:s.error}}})}function Op(e){return"_zod"in e}function hs(e,t){return Op(e)?Np(e):Tp(e)}async function Nn({value:e,schema:t,context:r}){const n=await ht({value:e,schema:t,context:r});if(!n.success)throw Ke.wrap({value:e,cause:n.error,context:r});return n.value}async function ht({value:e,schema:t,context:r}){const n=Nr(t);try{if(n.validate==null)return{success:!0,value:e,rawValue:e};const o=await n.validate(e);return o.success?{success:!0,value:o.value,rawValue:e}:{success:!1,error:Ke.wrap({value:e,cause:o.error,context:r}),rawValue:e}}catch(o){return{success:!1,error:Ke.wrap({value:e,cause:o,context:r}),rawValue:e}}}async function Me({text:e,schema:t}){try{const r=Md(e);return t==null?{success:!0,value:r,rawValue:r}:await ht({value:r,schema:t})}catch(r){return{success:!1,error:Yr.isInstance(r)?r:new Yr({text:e,cause:r}),rawValue:void 0}}}function Ap({stream:e,schema:t}){return e.pipeThrough(new TextDecoderStream).pipeThrough(new Rd).pipeThrough(new TransformStream({async transform({data:r},n){r!=="[DONE]"&&n.enqueue(await Me({text:r,schema:t}))}}))}async function Ie(e){return typeof e=="function"&&(e=e()),Promise.resolve(e)}var Pp=Object.defineProperty,Rp=(e,t)=>{for(var r in t)Pp(e,r,{get:t[r],enumerable:!0})},gs="AI_NoObjectGeneratedError",vs=`vercel.ai.error.${gs}`,$p=Symbol.for(vs),bs,Te=class extends ye{constructor({message:e="No object generated.",cause:t,text:r,response:n,usage:o,finishReason:s}){super({name:gs,message:e,cause:t}),this[bs]=!0,this.text=r,this.response=n,this.usage=o,this.finishReason=s}static isInstance(e){return ye.hasMarker(e,vs)}};bs=$p;var ys="AI_UIMessageStreamError",_s=`vercel.ai.error.${ys}`,Cp=Symbol.for(_s),ws,Be=class extends ye{constructor({chunkType:e,chunkId:t,message:r}){super({name:ys,message:r}),this[ws]=!0,this.chunkType=e,this.chunkId=t}static isInstance(e){return ye.hasMarker(e,_s)}};ws=Cp;var On="6.0.116",ks=ie([g(),Vt(Uint8Array),Vt(ArrayBuffer),us(e=>{var t,r;return(r=(t=globalThis.Buffer)==null?void 0:t.isBuffer(e))!=null?r:!1},{message:"Must be a Buffer"})]),gt=Td(()=>ie([rd(),g(),je(),ae(),tt(g(),gt.optional()),ne(gt)])),M=tt(g(),tt(g(),gt.optional())),xs=$({type:T("text"),text:g(),providerOptions:M.optional()}),Zp=$({type:T("image"),image:ie([ks,Vt(URL)]),mediaType:g().optional(),providerOptions:M.optional()}),Es=$({type:T("file"),data:ie([ks,Vt(URL)]),filename:g().optional(),mediaType:g(),providerOptions:M.optional()}),jp=$({type:T("reasoning"),text:g(),providerOptions:M.optional()}),Mp=$({type:T("tool-call"),toolCallId:g(),toolName:g(),input:he(),providerOptions:M.optional(),providerExecuted:ae().optional()}),Dp=id("type",[$({type:T("text"),value:g(),providerOptions:M.optional()}),$({type:T("json"),value:gt,providerOptions:M.optional()}),$({type:T("execution-denied"),reason:g().optional(),providerOptions:M.optional()}),$({type:T("error-text"),value:g(),providerOptions:M.optional()}),$({type:T("error-json"),value:gt,providerOptions:M.optional()}),$({type:T("content"),value:ne(ie([$({type:T("text"),text:g(),providerOptions:M.optional()}),$({type:T("media"),data:g(),mediaType:g()}),$({type:T("file-data"),data:g(),mediaType:g(),filename:g().optional(),providerOptions:M.optional()}),$({type:T("file-url"),url:g(),providerOptions:M.optional()}),$({type:T("file-id"),fileId:ie([g(),tt(g(),g())]),providerOptions:M.optional()}),$({type:T("image-data"),data:g(),mediaType:g(),providerOptions:M.optional()}),$({type:T("image-url"),url:g(),providerOptions:M.optional()}),$({type:T("image-file-id"),fileId:ie([g(),tt(g(),g())]),providerOptions:M.optional()}),$({type:T("custom"),providerOptions:M.optional()})]))})]),Ss=$({type:T("tool-result"),toolCallId:g(),toolName:g(),output:Dp,providerOptions:M.optional()}),Fp=$({type:T("tool-approval-request"),approvalId:g(),toolCallId:g()}),Lp=$({type:T("tool-approval-response"),approvalId:g(),approved:ae(),reason:g().optional()}),Up=$({role:T("system"),content:g(),providerOptions:M.optional()}),Jp=$({role:T("user"),content:ie([g(),ne(ie([xs,Zp,Es]))]),providerOptions:M.optional()}),Vp=$({role:T("assistant"),content:ie([g(),ne(ie([xs,Es,jp,Mp,Ss,Fp]))]),providerOptions:M.optional()}),Bp=$({role:T("tool"),content:ne(ie([Ss,Lp])),providerOptions:M.optional()});ie([Up,Jp,Vp,Bp]);function Is(e,t){if(e===void 0&&t===void 0)return;if(e===void 0)return t;if(t===void 0)return e;const r={...e};for(const n in t)if(Object.prototype.hasOwnProperty.call(t,n)){const o=t[n];if(o===void 0)continue;const s=n in e?e[n]:void 0,a=o!==null&&typeof o=="object"&&!Array.isArray(o)&&!(o instanceof Date)&&!(o instanceof RegExp),i=s!=null&&typeof s=="object"&&!Array.isArray(s)&&!(s instanceof Date)&&!(s instanceof RegExp);a&&i?r[n]=Is(s,o):r[n]=o}return r}var Wp={};Rp(Wp,{array:()=>Hp,choice:()=>Xp,json:()=>Kp,object:()=>Yp,text:()=>Gp});function qp(e){const t=["ROOT"];let r=-1,n=null;function o(l,c,u){switch(l){case'"':{r=c,t.pop(),t.push(u),t.push("INSIDE_STRING");break}case"f":case"t":case"n":{r=c,n=c,t.pop(),t.push(u),t.push("INSIDE_LITERAL");break}case"-":{t.pop(),t.push(u),t.push("INSIDE_NUMBER");break}case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":{r=c,t.pop(),t.push(u),t.push("INSIDE_NUMBER");break}case"{":{r=c,t.pop(),t.push(u),t.push("INSIDE_OBJECT_START");break}case"[":{r=c,t.pop(),t.push(u),t.push("INSIDE_ARRAY_START");break}}}function s(l,c){switch(l){case",":{t.pop(),t.push("INSIDE_OBJECT_AFTER_COMMA");break}case"}":{r=c,t.pop();break}}}function a(l,c){switch(l){case",":{t.pop(),t.push("INSIDE_ARRAY_AFTER_COMMA");break}case"]":{r=c,t.pop();break}}}for(let l=0;l<e.length;l++){const c=e[l];switch(t[t.length-1]){case"ROOT":o(c,l,"FINISH");break;case"INSIDE_OBJECT_START":{switch(c){case'"':{t.pop(),t.push("INSIDE_OBJECT_KEY");break}case"}":{r=l,t.pop();break}}break}case"INSIDE_OBJECT_AFTER_COMMA":{switch(c){case'"':{t.pop(),t.push("INSIDE_OBJECT_KEY");break}}break}case"INSIDE_OBJECT_KEY":{switch(c){case'"':{t.pop(),t.push("INSIDE_OBJECT_AFTER_KEY");break}}break}case"INSIDE_OBJECT_AFTER_KEY":{switch(c){case":":{t.pop(),t.push("INSIDE_OBJECT_BEFORE_VALUE");break}}break}case"INSIDE_OBJECT_BEFORE_VALUE":{o(c,l,"INSIDE_OBJECT_AFTER_VALUE");break}case"INSIDE_OBJECT_AFTER_VALUE":{s(c,l);break}case"INSIDE_STRING":{switch(c){case'"':{t.pop(),r=l;break}case"\\":{t.push("INSIDE_STRING_ESCAPE");break}default:r=l}break}case"INSIDE_ARRAY_START":{switch(c){case"]":{r=l,t.pop();break}default:{r=l,o(c,l,"INSIDE_ARRAY_AFTER_VALUE");break}}break}case"INSIDE_ARRAY_AFTER_VALUE":{switch(c){case",":{t.pop(),t.push("INSIDE_ARRAY_AFTER_COMMA");break}case"]":{r=l,t.pop();break}default:{r=l;break}}break}case"INSIDE_ARRAY_AFTER_COMMA":{o(c,l,"INSIDE_ARRAY_AFTER_VALUE");break}case"INSIDE_STRING_ESCAPE":{t.pop(),r=l;break}case"INSIDE_NUMBER":{switch(c){case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":{r=l;break}case"e":case"E":case"-":case".":break;case",":{t.pop(),t[t.length-1]==="INSIDE_ARRAY_AFTER_VALUE"&&a(c,l),t[t.length-1]==="INSIDE_OBJECT_AFTER_VALUE"&&s(c,l);break}case"}":{t.pop(),t[t.length-1]==="INSIDE_OBJECT_AFTER_VALUE"&&s(c,l);break}case"]":{t.pop(),t[t.length-1]==="INSIDE_ARRAY_AFTER_VALUE"&&a(c,l);break}default:{t.pop();break}}break}case"INSIDE_LITERAL":{const d=e.substring(n,l+1);!"false".startsWith(d)&&!"true".startsWith(d)&&!"null".startsWith(d)?(t.pop(),t[t.length-1]==="INSIDE_OBJECT_AFTER_VALUE"?s(c,l):t[t.length-1]==="INSIDE_ARRAY_AFTER_VALUE"&&a(c,l)):r=l;break}}}let i=e.slice(0,r+1);for(let l=t.length-1;l>=0;l--)switch(t[l]){case"INSIDE_STRING":{i+='"';break}case"INSIDE_OBJECT_KEY":case"INSIDE_OBJECT_AFTER_KEY":case"INSIDE_OBJECT_AFTER_COMMA":case"INSIDE_OBJECT_START":case"INSIDE_OBJECT_BEFORE_VALUE":case"INSIDE_OBJECT_AFTER_VALUE":{i+="}";break}case"INSIDE_ARRAY_START":case"INSIDE_ARRAY_AFTER_COMMA":case"INSIDE_ARRAY_AFTER_VALUE":{i+="]";break}case"INSIDE_LITERAL":{const u=e.substring(n,e.length);"true".startsWith(u)?i+="true".slice(u.length):"false".startsWith(u)?i+="false".slice(u.length):"null".startsWith(u)&&(i+="null".slice(u.length))}}return i}async function _t(e){if(e===void 0)return{value:void 0,state:"undefined-input"};let t=await Me({text:e});return t.success?{value:t.value,state:"successful-parse"}:(t=await Me({text:qp(e)}),t.success?{value:t.value,state:"repaired-parse"}:{value:void 0,state:"failed-parse"})}var Gp=()=>({name:"text",responseFormat:Promise.resolve({type:"text"}),async parseCompleteOutput({text:e}){return e},async parsePartialOutput({text:e}){return{partial:e}},createElementStreamTransform(){}}),Yp=({schema:e,name:t,description:r})=>{const n=Nr(e);return{name:"object",responseFormat:Ie(n.jsonSchema).then(o=>({type:"json",schema:o,...t!=null&&{name:t},...r!=null&&{description:r}})),async parseCompleteOutput({text:o},s){const a=await Me({text:o});if(!a.success)throw new Te({message:"No object generated: could not parse the response.",cause:a.error,text:o,response:s.response,usage:s.usage,finishReason:s.finishReason});const i=await ht({value:a.value,schema:n});if(!i.success)throw new Te({message:"No object generated: response did not match schema.",cause:i.error,text:o,response:s.response,usage:s.usage,finishReason:s.finishReason});return i.value},async parsePartialOutput({text:o}){const s=await _t(o);switch(s.state){case"failed-parse":case"undefined-input":return;case"repaired-parse":case"successful-parse":return{partial:s.value}}},createElementStreamTransform(){}}},Hp=({element:e,name:t,description:r})=>{const n=Nr(e);return{name:"array",responseFormat:Ie(n.jsonSchema).then(o=>{const{$schema:s,...a}=o;return{type:"json",schema:{$schema:"http://json-schema.org/draft-07/schema#",type:"object",properties:{elements:{type:"array",items:a}},required:["elements"],additionalProperties:!1},...t!=null&&{name:t},...r!=null&&{description:r}}}),async parseCompleteOutput({text:o},s){const a=await Me({text:o});if(!a.success)throw new Te({message:"No object generated: could not parse the response.",cause:a.error,text:o,response:s.response,usage:s.usage,finishReason:s.finishReason});const i=a.value;if(i==null||typeof i!="object"||!("elements"in i)||!Array.isArray(i.elements))throw new Te({message:"No object generated: response did not match schema.",cause:new Ke({value:i,cause:"response must be an object with an elements array"}),text:o,response:s.response,usage:s.usage,finishReason:s.finishReason});for(const l of i.elements){const c=await ht({value:l,schema:n});if(!c.success)throw new Te({message:"No object generated: response did not match schema.",cause:c.error,text:o,response:s.response,usage:s.usage,finishReason:s.finishReason})}return i.elements},async parsePartialOutput({text:o}){const s=await _t(o);switch(s.state){case"failed-parse":case"undefined-input":return;case"repaired-parse":case"successful-parse":{const a=s.value;if(a==null||typeof a!="object"||!("elements"in a)||!Array.isArray(a.elements))return;const i=s.state==="repaired-parse"&&a.elements.length>0?a.elements.slice(0,-1):a.elements,l=[];for(const c of i){const u=await ht({value:c,schema:n});u.success&&l.push(u.value)}return{partial:l}}}},createElementStreamTransform(){let o=0;return new TransformStream({transform({partialOutput:s},a){if(s!=null)for(;o<s.length;o++)a.enqueue(s[o])}})}}},Xp=({options:e,name:t,description:r})=>({name:"choice",responseFormat:Promise.resolve({type:"json",schema:{$schema:"http://json-schema.org/draft-07/schema#",type:"object",properties:{result:{type:"string",enum:e}},required:["result"],additionalProperties:!1},...t!=null&&{name:t},...r!=null&&{description:r}}),async parseCompleteOutput({text:n},o){const s=await Me({text:n});if(!s.success)throw new Te({message:"No object generated: could not parse the response.",cause:s.error,text:n,response:o.response,usage:o.usage,finishReason:o.finishReason});const a=s.value;if(a==null||typeof a!="object"||!("result"in a)||typeof a.result!="string"||!e.includes(a.result))throw new Te({message:"No object generated: response did not match schema.",cause:new Ke({value:a,cause:"response must be an object that contains a choice value."}),text:n,response:o.response,usage:o.usage,finishReason:o.finishReason});return a.result},async parsePartialOutput({text:n}){const o=await _t(n);switch(o.state){case"failed-parse":case"undefined-input":return;case"repaired-parse":case"successful-parse":{const s=o.value;if(s==null||typeof s!="object"||!("result"in s)||typeof s.result!="string")return;const a=e.filter(i=>i.startsWith(s.result));return o.state==="successful-parse"?a.includes(s.result)?{partial:s.result}:void 0:a.length===1?{partial:a[0]}:void 0}}},createElementStreamTransform(){}}),Kp=({name:e,description:t}={})=>({name:"json",responseFormat:Promise.resolve({type:"json",...e!=null&&{name:e},...t!=null&&{description:t}}),async parseCompleteOutput({text:r},n){const o=await Me({text:r});if(!o.success)throw new Te({message:"No object generated: could not parse the response.",cause:o.error,text:r,response:n.response,usage:n.usage,finishReason:n.finishReason});return o.value},async parsePartialOutput({text:r}){const n=await _t(r);switch(n.state){case"failed-parse":case"undefined-input":return;case"repaired-parse":case"successful-parse":return n.value===void 0?void 0:{partial:n.value}}},createElementStreamTransform(){}});yt({prefix:"aitxt",size:24});(class extends TransformStream{constructor(){super({transform(e,t){t.enqueue(`data: ${JSON.stringify(e)}
136
+
137
+ `)},flush(e){e.enqueue(`data: [DONE]
138
+
139
+ `)}})}});var Qp=Sp(()=>hs(ie([V({type:T("text-start"),id:g(),providerMetadata:M.optional()}),V({type:T("text-delta"),id:g(),delta:g(),providerMetadata:M.optional()}),V({type:T("text-end"),id:g(),providerMetadata:M.optional()}),V({type:T("error"),errorText:g()}),V({type:T("tool-input-start"),toolCallId:g(),toolName:g(),providerExecuted:ae().optional(),providerMetadata:M.optional(),dynamic:ae().optional(),title:g().optional()}),V({type:T("tool-input-delta"),toolCallId:g(),inputTextDelta:g()}),V({type:T("tool-input-available"),toolCallId:g(),toolName:g(),input:he(),providerExecuted:ae().optional(),providerMetadata:M.optional(),dynamic:ae().optional(),title:g().optional()}),V({type:T("tool-input-error"),toolCallId:g(),toolName:g(),input:he(),providerExecuted:ae().optional(),providerMetadata:M.optional(),dynamic:ae().optional(),errorText:g(),title:g().optional()}),V({type:T("tool-approval-request"),approvalId:g(),toolCallId:g()}),V({type:T("tool-output-available"),toolCallId:g(),output:he(),providerExecuted:ae().optional(),dynamic:ae().optional(),preliminary:ae().optional()}),V({type:T("tool-output-error"),toolCallId:g(),errorText:g(),providerExecuted:ae().optional(),dynamic:ae().optional()}),V({type:T("tool-output-denied"),toolCallId:g()}),V({type:T("reasoning-start"),id:g(),providerMetadata:M.optional()}),V({type:T("reasoning-delta"),id:g(),delta:g(),providerMetadata:M.optional()}),V({type:T("reasoning-end"),id:g(),providerMetadata:M.optional()}),V({type:T("source-url"),sourceId:g(),url:g(),title:g().optional(),providerMetadata:M.optional()}),V({type:T("source-document"),sourceId:g(),mediaType:g(),title:g(),filename:g().optional(),providerMetadata:M.optional()}),V({type:T("file"),url:g(),mediaType:g(),providerMetadata:M.optional()}),V({type:us(e=>typeof e=="string"&&e.startsWith("data-"),{message:'Type must start with "data-"'}),id:g().optional(),data:he(),transient:ae().optional()}),V({type:T("start-step")}),V({type:T("finish-step")}),V({type:T("start"),messageId:g().optional(),messageMetadata:he().optional()}),V({type:T("finish"),finishReason:bt(["stop","length","content-filter","tool-calls","error","other"]).optional(),messageMetadata:he().optional()}),V({type:T("abort"),reason:g().optional()}),V({type:T("message-metadata"),messageMetadata:he()})])));function ef(e){return e.type.startsWith("data-")}function mr(e){return e.type.startsWith("tool-")}function tf(e){return e.type==="dynamic-tool"}function Wt(e){return mr(e)||tf(e)}function An(e){return e.type.split("-").slice(1).join("-")}function rf({lastMessage:e,messageId:t}){return{message:(e==null?void 0:e.role)==="assistant"?e:{id:t,metadata:void 0,role:"assistant",parts:[]},activeTextParts:{},activeReasoningParts:{},partialToolCalls:{}}}function nf({stream:e,messageMetadataSchema:t,dataPartSchemas:r,runUpdateMessageJob:n,onError:o,onToolCall:s,onData:a}){return e.pipeThrough(new TransformStream({async transform(i,l){await n(async({state:c,write:u})=>{var d,f,m,w;function v(p){const P=c.message.parts.filter(Wt).find(N=>N.toolCallId===p);if(P==null)throw new Be({chunkType:"tool-invocation",chunkId:p,message:`No tool invocation found for tool call ID "${p}".`});return P}function _(p){var O;const P=c.message.parts.find(k=>mr(k)&&k.toolCallId===p.toolCallId),N=p,Z=P;P!=null?(P.state=p.state,Z.input=N.input,Z.output=N.output,Z.errorText=N.errorText,Z.rawInput=N.rawInput,Z.preliminary=N.preliminary,p.title!==void 0&&(Z.title=p.title),Z.providerExecuted=(O=N.providerExecuted)!=null?O:P.providerExecuted,N.providerMetadata!=null&&(P.callProviderMetadata=N.providerMetadata)):c.message.parts.push({type:`tool-${p.toolName}`,toolCallId:p.toolCallId,state:p.state,title:p.title,input:N.input,output:N.output,rawInput:N.rawInput,errorText:N.errorText,providerExecuted:N.providerExecuted,preliminary:N.preliminary,...N.providerMetadata!=null?{callProviderMetadata:N.providerMetadata}:{}})}function y(p){var O,P;const N=c.message.parts.find(Q=>Q.type==="dynamic-tool"&&Q.toolCallId===p.toolCallId),Z=p,k=N;N!=null?(N.state=p.state,k.toolName=p.toolName,k.input=Z.input,k.output=Z.output,k.errorText=Z.errorText,k.rawInput=(O=Z.rawInput)!=null?O:k.rawInput,k.preliminary=Z.preliminary,p.title!==void 0&&(k.title=p.title),k.providerExecuted=(P=Z.providerExecuted)!=null?P:N.providerExecuted,Z.providerMetadata!=null&&(N.callProviderMetadata=Z.providerMetadata)):c.message.parts.push({type:"dynamic-tool",toolName:p.toolName,toolCallId:p.toolCallId,state:p.state,input:Z.input,output:Z.output,errorText:Z.errorText,preliminary:Z.preliminary,providerExecuted:Z.providerExecuted,title:p.title,...Z.providerMetadata!=null?{callProviderMetadata:Z.providerMetadata}:{}})}async function E(p){if(p!=null){const O=c.message.metadata!=null?Is(c.message.metadata,p):p;t!=null&&await Nn({value:O,schema:t,context:{field:"message.metadata",entityId:c.message.id}}),c.message.metadata=O}}switch(i.type){case"text-start":{const p={type:"text",text:"",providerMetadata:i.providerMetadata,state:"streaming"};c.activeTextParts[i.id]=p,c.message.parts.push(p),u();break}case"text-delta":{const p=c.activeTextParts[i.id];if(p==null)throw new Be({chunkType:"text-delta",chunkId:i.id,message:`Received text-delta for missing text part with ID "${i.id}". Ensure a "text-start" chunk is sent before any "text-delta" chunks.`});p.text+=i.delta,p.providerMetadata=(d=i.providerMetadata)!=null?d:p.providerMetadata,u();break}case"text-end":{const p=c.activeTextParts[i.id];if(p==null)throw new Be({chunkType:"text-end",chunkId:i.id,message:`Received text-end for missing text part with ID "${i.id}". Ensure a "text-start" chunk is sent before any "text-end" chunks.`});p.state="done",p.providerMetadata=(f=i.providerMetadata)!=null?f:p.providerMetadata,delete c.activeTextParts[i.id],u();break}case"reasoning-start":{const p={type:"reasoning",text:"",providerMetadata:i.providerMetadata,state:"streaming"};c.activeReasoningParts[i.id]=p,c.message.parts.push(p),u();break}case"reasoning-delta":{const p=c.activeReasoningParts[i.id];if(p==null)throw new Be({chunkType:"reasoning-delta",chunkId:i.id,message:`Received reasoning-delta for missing reasoning part with ID "${i.id}". Ensure a "reasoning-start" chunk is sent before any "reasoning-delta" chunks.`});p.text+=i.delta,p.providerMetadata=(m=i.providerMetadata)!=null?m:p.providerMetadata,u();break}case"reasoning-end":{const p=c.activeReasoningParts[i.id];if(p==null)throw new Be({chunkType:"reasoning-end",chunkId:i.id,message:`Received reasoning-end for missing reasoning part with ID "${i.id}". Ensure a "reasoning-start" chunk is sent before any "reasoning-end" chunks.`});p.providerMetadata=(w=i.providerMetadata)!=null?w:p.providerMetadata,p.state="done",delete c.activeReasoningParts[i.id],u();break}case"file":{c.message.parts.push({type:"file",mediaType:i.mediaType,url:i.url,...i.providerMetadata!=null?{providerMetadata:i.providerMetadata}:{}}),u();break}case"source-url":{c.message.parts.push({type:"source-url",sourceId:i.sourceId,url:i.url,title:i.title,providerMetadata:i.providerMetadata}),u();break}case"source-document":{c.message.parts.push({type:"source-document",sourceId:i.sourceId,mediaType:i.mediaType,title:i.title,filename:i.filename,providerMetadata:i.providerMetadata}),u();break}case"tool-input-start":{const p=c.message.parts.filter(mr);c.partialToolCalls[i.toolCallId]={text:"",toolName:i.toolName,index:p.length,dynamic:i.dynamic,title:i.title},i.dynamic?y({toolCallId:i.toolCallId,toolName:i.toolName,state:"input-streaming",input:void 0,providerExecuted:i.providerExecuted,title:i.title,providerMetadata:i.providerMetadata}):_({toolCallId:i.toolCallId,toolName:i.toolName,state:"input-streaming",input:void 0,providerExecuted:i.providerExecuted,title:i.title,providerMetadata:i.providerMetadata}),u();break}case"tool-input-delta":{const p=c.partialToolCalls[i.toolCallId];if(p==null)throw new Be({chunkType:"tool-input-delta",chunkId:i.toolCallId,message:`Received tool-input-delta for missing tool call with ID "${i.toolCallId}". Ensure a "tool-input-start" chunk is sent before any "tool-input-delta" chunks.`});p.text+=i.inputTextDelta;const{value:O}=await _t(p.text);p.dynamic?y({toolCallId:i.toolCallId,toolName:p.toolName,state:"input-streaming",input:O,title:p.title}):_({toolCallId:i.toolCallId,toolName:p.toolName,state:"input-streaming",input:O,title:p.title}),u();break}case"tool-input-available":{i.dynamic?y({toolCallId:i.toolCallId,toolName:i.toolName,state:"input-available",input:i.input,providerExecuted:i.providerExecuted,providerMetadata:i.providerMetadata,title:i.title}):_({toolCallId:i.toolCallId,toolName:i.toolName,state:"input-available",input:i.input,providerExecuted:i.providerExecuted,providerMetadata:i.providerMetadata,title:i.title}),u(),s&&!i.providerExecuted&&await s({toolCall:i});break}case"tool-input-error":{const p=c.message.parts.filter(Wt).find(P=>P.toolCallId===i.toolCallId);(p!=null?p.type==="dynamic-tool":!!i.dynamic)?y({toolCallId:i.toolCallId,toolName:i.toolName,state:"output-error",input:i.input,errorText:i.errorText,providerExecuted:i.providerExecuted,providerMetadata:i.providerMetadata}):_({toolCallId:i.toolCallId,toolName:i.toolName,state:"output-error",input:void 0,rawInput:i.input,errorText:i.errorText,providerExecuted:i.providerExecuted,providerMetadata:i.providerMetadata}),u();break}case"tool-approval-request":{const p=v(i.toolCallId);p.state="approval-requested",p.approval={id:i.approvalId},u();break}case"tool-output-denied":{const p=v(i.toolCallId);p.state="output-denied",u();break}case"tool-output-available":{const p=v(i.toolCallId);p.type==="dynamic-tool"?y({toolCallId:i.toolCallId,toolName:p.toolName,state:"output-available",input:p.input,output:i.output,preliminary:i.preliminary,providerExecuted:i.providerExecuted,title:p.title}):_({toolCallId:i.toolCallId,toolName:An(p),state:"output-available",input:p.input,output:i.output,providerExecuted:i.providerExecuted,preliminary:i.preliminary,title:p.title}),u();break}case"tool-output-error":{const p=v(i.toolCallId);p.type==="dynamic-tool"?y({toolCallId:i.toolCallId,toolName:p.toolName,state:"output-error",input:p.input,errorText:i.errorText,providerExecuted:i.providerExecuted,title:p.title}):_({toolCallId:i.toolCallId,toolName:An(p),state:"output-error",input:p.input,rawInput:p.rawInput,errorText:i.errorText,providerExecuted:i.providerExecuted,title:p.title}),u();break}case"start-step":{c.message.parts.push({type:"step-start"});break}case"finish-step":{c.activeTextParts={},c.activeReasoningParts={};break}case"start":{i.messageId!=null&&(c.message.id=i.messageId),await E(i.messageMetadata),(i.messageId!=null||i.messageMetadata!=null)&&u();break}case"finish":{i.finishReason!=null&&(c.finishReason=i.finishReason),await E(i.messageMetadata),i.messageMetadata!=null&&u();break}case"message-metadata":{await E(i.messageMetadata),i.messageMetadata!=null&&u();break}case"error":{o==null||o(new Error(i.errorText));break}default:if(ef(i)){if((r==null?void 0:r[i.type])!=null){const P=c.message.parts.findIndex(Z=>"id"in Z&&"data"in Z&&Z.id===i.id&&Z.type===i.type),N=P>=0?P:c.message.parts.length;await Nn({value:i.data,schema:r[i.type],context:{field:`message.parts[${N}].data`,entityName:i.type,entityId:i.id}})}const p=i;if(p.transient){a==null||a(p);break}const O=p.id!=null?c.message.parts.find(P=>p.type===P.type&&p.id===P.id):void 0;O!=null?O.data=p.data:c.message.parts.push(p),a==null||a(p),u()}}l.enqueue(i)})}}))}async function of({stream:e,onError:t}){const r=e.getReader();try{for(;;){const{done:n}=await r.read();if(n)break}}catch(n){t==null||t(n)}finally{r.releaseLock()}}yt({prefix:"aitxt",size:24});yt({prefix:"aiobj",size:24});var sf=class{constructor(){this.queue=[],this.isProcessing=!1}async processQueue(){if(!this.isProcessing){for(this.isProcessing=!0;this.queue.length>0;)await this.queue[0](),this.queue.shift();this.isProcessing=!1}}async run(e){return new Promise((t,r)=>{this.queue.push(async()=>{try{await e(),t()}catch(n){r(n)}}),this.processQueue()})}};yt({prefix:"aiobj",size:24});async function af(e){if(e==null)return[];if(!globalThis.FileList||!(e instanceof globalThis.FileList))throw new Error("FileList is not supported in the current environment");return Promise.all(Array.from(e).map(async t=>{const{name:r,type:n}=t,o=await new Promise((s,a)=>{const i=new FileReader;i.onload=l=>{var c;s((c=l.target)==null?void 0:c.result)},i.onerror=l=>a(l),i.readAsDataURL(t)});return{type:"file",mediaType:n,filename:r,url:o}}))}var cf=class{constructor({api:e="/api/chat",credentials:t,headers:r,body:n,fetch:o,prepareSendMessagesRequest:s,prepareReconnectToStreamRequest:a}){this.api=e,this.credentials=t,this.headers=r,this.body=n,this.fetch=o,this.prepareSendMessagesRequest=s,this.prepareReconnectToStreamRequest=a}async sendMessages({abortSignal:e,...t}){var r,n,o,s,a;const i=await Ie(this.body),l=await Ie(this.headers),c=await Ie(this.credentials),u={...Ze(l),...Ze(t.headers)},d=await((r=this.prepareSendMessagesRequest)==null?void 0:r.call(this,{api:this.api,id:t.chatId,messages:t.messages,body:{...i,...t.body},headers:u,credentials:c,requestMetadata:t.metadata,trigger:t.trigger,messageId:t.messageId})),f=(n=d==null?void 0:d.api)!=null?n:this.api,m=(d==null?void 0:d.headers)!==void 0?Ze(d.headers):u,w=(d==null?void 0:d.body)!==void 0?d.body:{...i,...t.body,id:t.chatId,messages:t.messages,trigger:t.trigger,messageId:t.messageId},v=(o=d==null?void 0:d.credentials)!=null?o:c,y=await((s=this.fetch)!=null?s:globalThis.fetch)(f,{method:"POST",headers:Sn({"Content-Type":"application/json",...m},`ai-sdk/${On}`,En()),body:JSON.stringify(w),credentials:v,signal:e});if(!y.ok)throw new Error((a=await y.text())!=null?a:"Failed to fetch the chat response.");if(!y.body)throw new Error("The response body is empty.");return this.processResponseStream(y.body)}async reconnectToStream(e){var t,r,n,o,s;const a=await Ie(this.body),i=await Ie(this.headers),l=await Ie(this.credentials),c={...Ze(i),...Ze(e.headers)},u=await((t=this.prepareReconnectToStreamRequest)==null?void 0:t.call(this,{api:this.api,id:e.chatId,body:{...a,...e.body},headers:c,credentials:l,requestMetadata:e.metadata})),d=(r=u==null?void 0:u.api)!=null?r:`${this.api}/${e.chatId}/stream`,f=(u==null?void 0:u.headers)!==void 0?Ze(u.headers):c,m=(n=u==null?void 0:u.credentials)!=null?n:l,v=await((o=this.fetch)!=null?o:globalThis.fetch)(d,{method:"GET",headers:Sn(f,`ai-sdk/${On}`,En()),credentials:m});if(v.status===204)return null;if(!v.ok)throw new Error((s=await v.text())!=null?s:"Failed to fetch the chat response.");if(!v.body)throw new Error("The response body is empty.");return this.processResponseStream(v.body)}},lf=class extends cf{constructor(e={}){super(e)}processResponseStream(e){return Ap({stream:e,schema:Qp}).pipeThrough(new TransformStream({async transform(t,r){if(!t.success)throw t.error;r.enqueue(t.value)}}))}},uf=class{constructor({generateId:e=$d,id:t=e(),transport:r=new lf,messageMetadataSchema:n,dataPartSchemas:o,state:s,onError:a,onToolCall:i,onFinish:l,onData:c,sendAutomaticallyWhen:u}){this.activeResponse=void 0,this.jobExecutor=new sf,this.sendMessage=async(d,f)=>{var m,w,v,_;if(d==null){await this.makeRequest({trigger:"submit-message",messageId:(m=this.lastMessage)==null?void 0:m.id,...f});return}let y;if("text"in d||"files"in d?y={parts:[...Array.isArray(d.files)?d.files:await af(d.files),..."text"in d&&d.text!=null?[{type:"text",text:d.text}]:[]]}:y=d,d.messageId!=null){const E=this.state.messages.findIndex(p=>p.id===d.messageId);if(E===-1)throw new Error(`message with id ${d.messageId} not found`);if(this.state.messages[E].role!=="user")throw new Error(`message with id ${d.messageId} is not a user message`);this.state.messages=this.state.messages.slice(0,E+1),this.state.replaceMessage(E,{...y,id:d.messageId,role:(w=y.role)!=null?w:"user",metadata:d.metadata})}else this.state.pushMessage({...y,id:(v=y.id)!=null?v:this.generateId(),role:(_=y.role)!=null?_:"user",metadata:d.metadata});await this.makeRequest({trigger:"submit-message",messageId:d.messageId,...f})},this.regenerate=async({messageId:d,...f}={})=>{const m=d==null?this.state.messages.length-1:this.state.messages.findIndex(w=>w.id===d);if(m===-1)throw new Error(`message ${d} not found`);this.state.messages=this.state.messages.slice(0,this.messages[m].role==="assistant"?m:m+1),await this.makeRequest({trigger:"regenerate-message",messageId:d,...f})},this.resumeStream=async(d={})=>{await this.makeRequest({trigger:"resume-stream",...d})},this.clearError=()=>{this.status==="error"&&(this.state.error=void 0,this.setStatus({status:"ready"}))},this.addToolApprovalResponse=async({id:d,approved:f,reason:m})=>this.jobExecutor.run(async()=>{const w=this.state.messages,v=w[w.length-1],_=y=>Wt(y)&&y.state==="approval-requested"&&y.approval.id===d?{...y,state:"approval-responded",approval:{id:d,approved:f,reason:m}}:y;this.state.replaceMessage(w.length-1,{...v,parts:v.parts.map(_)}),this.activeResponse&&(this.activeResponse.state.message.parts=this.activeResponse.state.message.parts.map(_)),this.status!=="streaming"&&this.status!=="submitted"&&this.sendAutomaticallyWhen&&this.shouldSendAutomatically().then(y=>{var E;y&&this.makeRequest({trigger:"submit-message",messageId:(E=this.lastMessage)==null?void 0:E.id})})}),this.addToolOutput=async({state:d="output-available",tool:f,toolCallId:m,output:w,errorText:v})=>this.jobExecutor.run(async()=>{const _=this.state.messages,y=_[_.length-1],E=p=>Wt(p)&&p.toolCallId===m?{...p,state:d,output:w,errorText:v}:p;this.state.replaceMessage(_.length-1,{...y,parts:y.parts.map(E)}),this.activeResponse&&(this.activeResponse.state.message.parts=this.activeResponse.state.message.parts.map(E)),this.status!=="streaming"&&this.status!=="submitted"&&this.sendAutomaticallyWhen&&this.shouldSendAutomatically().then(p=>{var O;p&&this.makeRequest({trigger:"submit-message",messageId:(O=this.lastMessage)==null?void 0:O.id})})}),this.addToolResult=this.addToolOutput,this.stop=async()=>{var d;this.status!=="streaming"&&this.status!=="submitted"||(d=this.activeResponse)!=null&&d.abortController&&this.activeResponse.abortController.abort()},this.id=t,this.transport=r,this.generateId=e,this.messageMetadataSchema=n,this.dataPartSchemas=o,this.state=s,this.onError=a,this.onToolCall=i,this.onFinish=l,this.onData=c,this.sendAutomaticallyWhen=u}get status(){return this.state.status}setStatus({status:e,error:t}){this.status!==e&&(this.state.status=e,this.state.error=t)}get error(){return this.state.error}get messages(){return this.state.messages}get lastMessage(){return this.state.messages[this.state.messages.length-1]}set messages(e){this.state.messages=e}async shouldSendAutomatically(){if(!this.sendAutomaticallyWhen)return!1;const e=this.sendAutomaticallyWhen({messages:this.state.messages});return e&&typeof e=="object"&&"then"in e?await e:e}async makeRequest({trigger:e,metadata:t,headers:r,body:n,messageId:o}){var s,a,i;let l;if(e==="resume-stream")try{const m=await this.transport.reconnectToStream({chatId:this.id,metadata:t,headers:r,body:n});if(m==null)return;l=m}catch(m){this.onError&&m instanceof Error&&this.onError(m),this.setStatus({status:"error",error:m});return}this.setStatus({status:"submitted",error:void 0});const c=this.lastMessage;let u=!1,d=!1,f=!1;try{const m={state:rf({lastMessage:this.state.snapshot(c),messageId:this.generateId()}),abortController:new AbortController};m.abortController.signal.addEventListener("abort",()=>{u=!0}),this.activeResponse=m;let w;e==="resume-stream"?w=l:w=await this.transport.sendMessages({chatId:this.id,messages:this.state.messages,abortSignal:m.abortController.signal,metadata:t,headers:r,body:n,trigger:e,messageId:o});const v=_=>this.jobExecutor.run(()=>_({state:m.state,write:()=>{var y;this.setStatus({status:"streaming"}),m.state.message.id===((y=this.lastMessage)==null?void 0:y.id)?this.state.replaceMessage(this.state.messages.length-1,m.state.message):this.state.pushMessage(m.state.message)}}));await of({stream:nf({stream:w,onToolCall:this.onToolCall,onData:this.onData,messageMetadataSchema:this.messageMetadataSchema,dataPartSchemas:this.dataPartSchemas,runUpdateMessageJob:v,onError:_=>{throw _}}),onError:_=>{throw _}}),this.setStatus({status:"ready"})}catch(m){if(u||m.name==="AbortError")return u=!0,this.setStatus({status:"ready"}),null;f=!0,m instanceof TypeError&&(m.message.toLowerCase().includes("fetch")||m.message.toLowerCase().includes("network"))&&(d=!0),this.onError&&m instanceof Error&&this.onError(m),this.setStatus({status:"error",error:m})}finally{try{(a=this.onFinish)==null||a.call(this,{message:this.activeResponse.state.message,messages:this.state.messages,isAbort:u,isDisconnect:d,isError:f,finishReason:(s=this.activeResponse)==null?void 0:s.state.finishReason})}catch(m){console.error(m)}this.activeResponse=void 0}!f&&await this.shouldSendAutomatically()&&await this.makeRequest({trigger:"submit-message",messageId:(i=this.lastMessage)==null?void 0:i.id,metadata:t,headers:r,body:n})}},ar,Pn;function df(){if(Pn)return ar;Pn=1;function e(t,r){if(typeof t!="function")throw new TypeError(`Expected the first argument to be a \`function\`, got \`${typeof t}\`.`);let n,o=0;return function(...a){clearTimeout(n);const i=Date.now(),l=i-o,c=r-l;c<=0?(o=i,t.apply(this,a)):n=setTimeout(()=>{o=Date.now(),t.apply(this,a)},c)}}return ar=e,ar}var pf=df();const ff=Zs(pf);var zs=(e,t,r)=>{if(!t.has(e))throw TypeError("Cannot "+r)},B=(e,t,r)=>(zs(e,t,"read from private field"),r?r.call(e):t.get(e)),be=(e,t,r)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,r)},Se=(e,t,r,n)=>(zs(e,t,"write to private field"),t.set(e,r),r);function mf(e,t){return t!=null?ff(e,t):e}var de,Ct,Zt,lt,ut,dt,qe,hr,gr,hf=class{constructor(e=[]){be(this,de,void 0),be(this,Ct,"ready"),be(this,Zt,void 0),be(this,lt,new Set),be(this,ut,new Set),be(this,dt,new Set),this.pushMessage=t=>{Se(this,de,B(this,de).concat(t)),B(this,qe).call(this)},this.popMessage=()=>{Se(this,de,B(this,de).slice(0,-1)),B(this,qe).call(this)},this.replaceMessage=(t,r)=>{Se(this,de,[...B(this,de).slice(0,t),this.snapshot(r),...B(this,de).slice(t+1)]),B(this,qe).call(this)},this.snapshot=t=>structuredClone(t),this["~registerMessagesCallback"]=(t,r)=>{const n=r?mf(t,r):t;return B(this,lt).add(n),()=>{B(this,lt).delete(n)}},this["~registerStatusCallback"]=t=>(B(this,ut).add(t),()=>{B(this,ut).delete(t)}),this["~registerErrorCallback"]=t=>(B(this,dt).add(t),()=>{B(this,dt).delete(t)}),be(this,qe,()=>{B(this,lt).forEach(t=>t())}),be(this,hr,()=>{B(this,ut).forEach(t=>t())}),be(this,gr,()=>{B(this,dt).forEach(t=>t())}),Se(this,de,e)}get status(){return B(this,Ct)}set status(e){Se(this,Ct,e),B(this,hr).call(this)}get error(){return B(this,Zt)}set error(e){Se(this,Zt,e),B(this,gr).call(this)}get messages(){return B(this,de)}set messages(e){Se(this,de,[...e]),B(this,qe).call(this)}};de=new WeakMap;Ct=new WeakMap;Zt=new WeakMap;lt=new WeakMap;ut=new WeakMap;dt=new WeakMap;qe=new WeakMap;hr=new WeakMap;gr=new WeakMap;var Ge,Rn=class extends uf{constructor({messages:e,...t}){const r=new hf(e);super({...t,state:r}),be(this,Ge,void 0),this["~registerMessagesCallback"]=(n,o)=>B(this,Ge)["~registerMessagesCallback"](n,o),this["~registerStatusCallback"]=n=>B(this,Ge)["~registerStatusCallback"](n),this["~registerErrorCallback"]=n=>B(this,Ge)["~registerErrorCallback"](n),Se(this,Ge,r)}};Ge=new WeakMap;function gf({experimental_throttle:e,resume:t=!1,...r}={}){const n=F.useRef("chat"in r?{}:{onToolCall:r.onToolCall,onData:r.onData,onFinish:r.onFinish,onError:r.onError,sendAutomaticallyWhen:r.sendAutomaticallyWhen});"chat"in r||(n.current={onToolCall:r.onToolCall,onData:r.onData,onFinish:r.onFinish,onError:r.onError,sendAutomaticallyWhen:r.sendAutomaticallyWhen});const o={...r,onToolCall:f=>{var m,w;return(w=(m=n.current).onToolCall)==null?void 0:w.call(m,f)},onData:f=>{var m,w;return(w=(m=n.current).onData)==null?void 0:w.call(m,f)},onFinish:f=>{var m,w;return(w=(m=n.current).onFinish)==null?void 0:w.call(m,f)},onError:f=>{var m,w;return(w=(m=n.current).onError)==null?void 0:w.call(m,f)},sendAutomaticallyWhen:f=>{var m,w,v;return(v=(w=(m=n.current).sendAutomaticallyWhen)==null?void 0:w.call(m,f))!=null?v:!1}},s=F.useRef("chat"in r?r.chat:new Rn(o));("chat"in r&&r.chat!==s.current||"id"in r&&s.current.id!==r.id)&&(s.current="chat"in r?r.chat:new Rn(o));const i=F.useCallback(f=>s.current["~registerMessagesCallback"](f,e),[e,s.current.id]),l=F.useSyncExternalStore(i,()=>s.current.messages,()=>s.current.messages),c=F.useSyncExternalStore(s.current["~registerStatusCallback"],()=>s.current.status,()=>s.current.status),u=F.useSyncExternalStore(s.current["~registerErrorCallback"],()=>s.current.error,()=>s.current.error),d=F.useCallback(f=>{typeof f=="function"&&(f=f(s.current.messages)),s.current.messages=f},[s]);return F.useEffect(()=>{t&&s.current.resumeStream()},[t,s]),{id:s.current.id,messages:l,setMessages:d,sendMessage:s.current.sendMessage,regenerate:s.current.regenerate,clearError:s.current.clearError,stop:s.current.stop,error:u,resumeStream:s.current.resumeStream,status:c,addToolResult:s.current.addToolOutput,addToolOutput:s.current.addToolOutput,addToolApprovalResponse:s.current.addToolApprovalResponse}}const Rt=typeof{url:typeof document>"u"?require("url").pathToFileURL(__filename).href:Ve&&Ve.tagName.toUpperCase()==="SCRIPT"&&Ve.src||new URL("oms-agent.cjs",document.baseURI).href}<"u"?{url:typeof document>"u"?require("url").pathToFileURL(__filename).href:Ve&&Ve.tagName.toUpperCase()==="SCRIPT"&&Ve.src||new URL("oms-agent.cjs",document.baseURI).href}:void 0;var Zn;const vf=((Zn=Rt==null?void 0:Rt.env)==null?void 0:Zn.VITE_OMS_AGENT_API_BASE)!=null?String(Rt.env.VITE_OMS_AGENT_API_BASE).replace(/\/$/,""):"";function Ts(){return typeof window<"u"&&window.__OMS_AGENT_API_BASE__!=null?String(window.__OMS_AGENT_API_BASE__).replace(/\/$/,""):vf}const Ns=bt(["page-map","manual","product-doc","faq","error-guide","glossary"]),bf=$({pageId:g(),pageName:g(),moduleName:g(),routePath:g(),currentUrl:g(),title:g(),visibleTexts:ne(g())}),yf=$({tagName:g(),text:g(),domPath:g(),classNames:ne(g()),nearbyHeading:g().optional(),componentName:g().optional()}),Or=$({page:bf,selectedNode:yf.nullable()}),Os=bt(["route-match","text-search","component-trace","api-trace","error-code-search","symbol-search"]),_f=$({type:Os,payload:tt(g(),he())});$({queryId:g(),workspace:$({repo:g(),revision:g()}),runtimeContext:Or,tasks:ne(_f)});const As=$({filePath:g(),symbol:g().optional(),matchType:g(),score:je(),snippet:g(),reason:g(),lineStart:je().optional(),lineEnd:je().optional(),relatedRoute:g().optional(),relatedComponent:g().optional(),relatedApis:ne(g()).optional()}),Ps=$({filePath:g(),method:g(),path:g(),requestName:g().optional(),calledBy:ne(g()),score:je()}),wf=$({task:Os,hits:ne(As)});$({queryId:g(),results:ne(wf),apiCandidates:ne(Ps)});const kf=bt(["semantic","keyword","hybrid"]);$({queryId:g(),mode:kf,question:g(),runtimeContext:Or});const Rs=$({docId:g(),title:g(),sourceType:Ns,excerpt:g(),score:je(),updatedAt:g()});$({queryId:g(),hits:ne(Rs)});$({question:g().min(1),runtimeContext:Or});const xf=$({answer:g(),confidence:je().min(0).max(1),sources:ne($({id:g(),title:g(),sourceType:Ns,excerpt:g()})),codeCandidates:ne(As),apiCandidates:ne(Ps),docCandidates:ne(Rs)});function Ef(e){return e.parts.filter(t=>t.type==="text").map(t=>t.text).join(`
140
+ `).trim()}class Sf{async askAgent(t,r){const n=Ts(),o=await fetch(`${n}/api/agent/query`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({question:t,runtimeContext:{page:{pageId:r.page.pageId,pageName:r.page.pageName,moduleName:r.page.moduleName,routePath:r.page.routePath,currentUrl:r.page.currentUrl,title:r.page.title,visibleTexts:r.page.visibleTexts},selectedNode:r.selectedNode?{tagName:r.selectedNode.tagName,text:r.selectedNode.text,domPath:r.selectedNode.domPath,classNames:r.selectedNode.classNames,nearbyHeading:r.selectedNode.nearbyHeading,componentName:r.selectedNode.componentName}:null}})});if(!o.ok)throw new Error("Agent 服务暂时不可用,请确认本地后端已经启动。");const s=await o.json();return xf.parse(s)}async sendMessages(t){const n=(t.body??{}).runtimeContext,o=t.messages.at(-1);if(!n||!o)throw new Error("缺少运行时上下文,暂时无法回答这个问题。");const s=Ef(o),a=await this.askAgent(s,n),i=`assistant-${Date.now()}`,l=a.answer.replaceAll(`\r
141
+ `,`
142
+ `).split(new RegExp("(?<=[。!?,\\n])")).map(c=>c.trim()).filter(Boolean);return new ReadableStream({start:async c=>{var u;c.enqueue({type:"message-metadata",messageMetadata:{sources:a.sources,confidence:a.confidence}}),c.enqueue({type:"text-start",id:i});for(const d of l){if((u=t.abortSignal)!=null&&u.aborted){c.close();return}c.enqueue({type:"text-delta",id:i,delta:`${d}${d.endsWith(`
143
+ `)?"":" "}`}),await Ja(45)}c.enqueue({type:"text-end",id:i}),c.close()}})}async reconnectToStream(){return null}}function If(e){const t=F.useMemo(()=>new Sf,[]),r=gf({id:"oms-agent-playground",transport:t});return{...r,sendQuestion:n=>r.sendMessage({text:n},{body:{runtimeContext:e}})}}const zf=["这个节点来自哪个前端文件?","这里用到的后端数据来源于哪里?","页面上这个值是什么意思?","订单出现 E2003 错误通常是什么原因?"];function Tf(e){switch(e){case"manual":return"用户手册";case"product-doc":return"产品文档";case"faq":return"FAQ";case"error-guide":return"错误说明";case"glossary":return"术语表";default:return"知识源"}}function Nf({open:e,runtimeContext:t,inspecting:r,panelStyle:n,onClose:o,onStartInspecting:s,onClearSelection:a}){const[i,l]=F.useState(""),{messages:c,status:u,error:d,sendQuestion:f}=If(t),m=F.useRef(null),w=async v=>{const _=v.trim();_&&(await f(_),l(""))};return F.useEffect(()=>{const v=m.current;v&&v.scrollTo({top:v.scrollHeight,behavior:"smooth"})},[c,u]),A.jsxs("aside",{className:$t("fixed z-50 flex h-[min(76vh,680px)] w-[min(392px,calc(100vw-24px))] flex-col overflow-hidden rounded-[24px] border border-[#4B8BFF]/18 bg-[linear-gradient(180deg,rgba(10,20,40,0.97),rgba(7,14,28,0.985))] shadow-[0_24px_72px_rgba(22,93,255,0.18)] backdrop-blur-2xl transition-all",e?"translate-y-0 opacity-100":"pointer-events-none translate-y-4 opacity-0"),"data-oms-agent-root":!0,style:n,children:[A.jsx("header",{className:"border-b border-white/10 bg-[linear-gradient(135deg,rgba(22,93,255,0.16),rgba(72,128,255,0.1),rgba(10,20,40,0.24))] px-4 py-3",children:A.jsxs("div",{className:"flex items-start justify-between gap-4",children:[A.jsxs("div",{className:"space-y-1.5",children:[A.jsxs("div",{className:"flex items-center gap-2 text-xs text-[#79A9FF]",children:[A.jsx(Mn,{className:"size-3.5"}),"OMS Agent Playground"]}),A.jsxs("div",{children:[A.jsx("h2",{className:"m-0 text-base font-semibold text-white",children:t.page.pageName}),A.jsxs("p",{className:"m-0 text-xs text-slate-400",children:[t.page.moduleName," · ",t.page.routePath]})]})]}),A.jsx("button",{className:"rounded-full border border-white/10 p-1.5 text-slate-400 transition hover:border-white/20 hover:text-white",onClick:o,type:"button",children:A.jsx(Zr,{className:"size-3.5"})})]})}),A.jsxs("div",{className:"flex-1 space-y-3 overflow-y-auto px-4 py-3",ref:m,children:[c.length===0?A.jsxs("div",{className:"space-y-3",children:[A.jsx("div",{className:"rounded-2xl border border-dashed border-[#4B8BFF]/18 bg-[linear-gradient(135deg,rgba(22,93,255,0.08),rgba(72,128,255,0.05))] px-3 py-2.5 text-xs leading-6 text-slate-300",children:"这个助手当前能结合页面 URL、选中节点、模拟源码映射、接口来源和文档知识来回答问题。"}),A.jsx("div",{className:"flex flex-wrap gap-2",children:zf.map(v=>A.jsx("button",{className:"rounded-full border border-white/10 bg-white/[0.03] px-2.5 py-1.5 text-left text-xs text-slate-200 transition hover:border-[#4B8BFF]/60 hover:bg-[#165DFF]/10",onClick:()=>void w(v),type:"button",children:v},v))})]}):null,c.map(v=>{var _,y;return A.jsxs("div",{className:$t("rounded-2xl px-3 py-2.5 text-sm leading-6",v.role==="user"?"ml-6 border border-[#4B8BFF]/14 bg-[linear-gradient(135deg,rgba(22,93,255,0.18),rgba(56,118,255,0.1))] text-[#EEF4FF]":"mr-6 border border-white/10 bg-[linear-gradient(135deg,rgba(255,255,255,0.06),rgba(22,93,255,0.04))] text-slate-100"),children:[A.jsx("div",{className:"mb-1.5 text-[10px] uppercase tracking-[0.18em] text-slate-400",children:v.role==="user"?"开发者":"OMS Agent"}),v.parts.map((E,p)=>E.type!=="text"?null:A.jsx("p",{className:"m-0 whitespace-pre-wrap",children:E.text},`${v.id}-${p}`)),v.role==="assistant"&&((y=(_=v.metadata)==null?void 0:_.sources)!=null&&y.length)?A.jsxs("div",{className:"mt-2.5 border-t border-white/10 pt-2.5",children:[A.jsx("div",{className:"mb-2 text-[10px] uppercase tracking-[0.18em] text-slate-500",children:"Sources"}),A.jsx("div",{className:"flex flex-col gap-2",children:v.metadata.sources.map(E=>A.jsxs("div",{className:"rounded-xl border border-white/8 bg-slate-900/70 px-2.5 py-2",children:[A.jsx("div",{className:"text-[11px] text-[#79A9FF]",children:Tf(E.sourceType)}),A.jsx("div",{className:"text-sm font-medium text-white",children:E.title}),A.jsx("div",{className:"text-[11px] text-slate-400",children:E.excerpt})]},E.id))})]}):null]},v.id)}),u==="streaming"?A.jsx("div",{className:"text-sm text-[#79A9FF]",children:"正在分析页面上下文和知识源..."}):null,d?A.jsx("div",{className:"text-sm text-rose-300",children:d.message}):null]}),A.jsx("footer",{className:"border-t border-white/10 p-3",children:A.jsxs("form",{className:"rounded-2xl border border-[#4B8BFF]/14 bg-[linear-gradient(135deg,rgba(255,255,255,0.05),rgba(22,93,255,0.06),rgba(72,128,255,0.05))] p-2.5",onSubmit:v=>{v.preventDefault(),w(i)},children:[t.selectedNode?A.jsx("div",{className:"mb-2.5",children:A.jsxs("div",{className:"inline-flex max-w-full items-center gap-2 rounded-lg border border-[#4B8BFF]/24 bg-[#165DFF]/10 px-2.5 py-1.5 text-xs text-[#EEF4FF]",children:[A.jsx(Ys,{className:"size-3.5 shrink-0 text-[#79A9FF]"}),A.jsx("span",{className:"truncate",children:t.selectedNode.text||t.selectedNode.tagName}),A.jsx("button",{className:"inline-flex size-4.5 items-center justify-center rounded-full text-[#9EC0FF] transition hover:bg-white/10 hover:text-white",onClick:a,"aria-label":"移除已选节点",type:"button",children:A.jsx(Zr,{className:"size-3"})})]})}):null,A.jsx("textarea",{className:"min-h-20 w-full resize-none bg-transparent text-sm text-white outline-none placeholder:text-slate-500",onChange:v=>l(v.target.value),placeholder:"问我:这个节点在哪个文件?这个值是什么意思?这个错误为什么出现?",value:i}),A.jsxs("div",{className:"mt-2.5 flex items-center justify-between",children:[A.jsxs("button",{className:$t("inline-flex h-8.5 items-center gap-1.5 rounded-lg border px-2.5 text-xs transition",r?"border-amber-300/40 bg-amber-400/85 text-slate-950":"border-[#4B8BFF]/24 bg-white/5 text-slate-200 hover:border-[#4B8BFF]/50 hover:bg-[#165DFF]/10"),onClick:s,type:"button",children:[A.jsx(qs,{className:"size-3.5"}),r?"点击页面节点":"选点"]}),A.jsx("button",{className:"inline-flex size-8.5 items-center justify-center rounded-lg bg-[linear-gradient(135deg,rgba(22,93,255,0.98),rgba(72,128,255,0.94))] text-white transition hover:brightness-110 disabled:cursor-not-allowed disabled:opacity-40",disabled:!i.trim()||u==="streaming",type:"submit",children:A.jsx(Xs,{className:"size-3.5"})})]})]})})]})}function $s(e,t){return{page:e.getPageContext(),selectedNode:t?e.resolveNodeContext(t):null}}const Of=[{pageId:"order-detail",pageName:"订单详情页",moduleName:"订单中心",routePath:"/oms/orders/detail/2026001",frontendFiles:[{filePath:"src/pages/orders/detail/index.tsx",reason:"订单详情页主入口"},{filePath:"src/pages/orders/detail/components/OrderStatusCard.tsx",reason:"状态卡片与异常提示常驻在详情页首屏"}],apiSources:[{name:"查询订单详情",method:"GET",path:"/api/orders/:orderId",purpose:"加载订单基本信息、履约状态和异常信息"},{name:"查询风控标签",method:"GET",path:"/api/orders/:orderId/risk-tags",purpose:"展示风控状态、人工复核标签和风控备注"}],domHints:[{keywords:["异常待处理","渠道库存锁定失败","重新推单"],componentName:"OrderStatusCard",frontendFiles:[{filePath:"src/pages/orders/detail/components/OrderStatusCard.tsx",symbol:"OrderStatusCard",reason:"命中状态卡片的文案与异常操作按钮"}],apiSources:[{name:"查询订单详情",method:"GET",path:"/api/orders/:orderId",purpose:"异常状态和错误信息来自订单详情接口"}]},{keywords:["待人工复核","风控状态","复核说明"],componentName:"RiskReviewPanel",frontendFiles:[{filePath:"src/pages/orders/detail/components/RiskReviewPanel.tsx",symbol:"RiskReviewPanel",reason:"命中风控状态区块的字段和标签"}],apiSources:[{name:"查询风控标签",method:"GET",path:"/api/orders/:orderId/risk-tags",purpose:"风控状态与说明由风控标签接口提供"}]}]}];function Af(e){const t=e.trim().toLowerCase();return Of.flatMap(r=>r.domHints).filter(r=>r.keywords.some(n=>t.includes(n.toLowerCase())))}function Ar(e){return e.replace(/\s+/g," ").trim()}function Pf(){const e=["h1","h2","h3","button","[data-oms-copy]"],t=Array.from(document.querySelectorAll(e.join(","))).map(r=>Ar(r.innerText||r.textContent||"")).filter(Boolean);return Array.from(new Set(t)).slice(0,12)}function Rf(e){const t=[];let r=e;for(;r&&r!==document.body&&t.length<5;){const n=r.id?`#${r.id}`:"",o=r.classList.length>0?`.${Array.from(r.classList).slice(0,2).join(".")}`:"";t.unshift(`${r.tagName.toLowerCase()}${n}${o}`),r=r.parentElement}return t.join(" > ")}function $f(e){var r;const t=(r=e.closest("section,article,div"))==null?void 0:r.querySelector("h2, h3");return t?Ar(t.textContent||""):void 0}const Cs={getPageContext(){const e=typeof window<"u"?window.location.origin:"",t=typeof window<"u"?window.location.pathname:"/";return{pageId:"unknown",pageName:"当前页",moduleName:"",routePath:t,currentUrl:`${e}${t}`,title:document.title,visibleTexts:Pf(),frontendFiles:[],apiSources:[]}},resolveNodeContext(e){var o;const t=Ar(e.innerText||e.textContent||""),r=Af(t),n=e.dataset.omsComponent;return{tagName:e.tagName.toLowerCase(),text:t,domPath:Rf(e),classNames:Array.from(e.classList),nearbyHeading:$f(e),componentName:n??((o=r[0])==null?void 0:o.componentName),frontendFiles:[],apiSources:[]}}},De=48,ze=20,Cf=12,Zf=392,jf=680,We=12,vr="oms-agent-widget-position";function Mf(){return{x:window.innerWidth-De-ze,y:window.innerHeight-De-ze}}function qt(e){return{x:Math.min(Math.max(e.x,ze),window.innerWidth-De-ze),y:Math.min(Math.max(e.y,ze),window.innerHeight-De-ze)}}function Df(e){const t=e.x+De/2<window.innerWidth/2?ze:window.innerWidth-De-ze;return qt({x:t,y:e.y})}function Ff(){const e=window.localStorage.getItem(vr);if(!e)return null;try{const t=JSON.parse(e);return typeof t.x!="number"||typeof t.y!="number"?null:qt({x:t.x,y:t.y})}catch{return null}}function Lf({selectedElement:e,inspecting:t,onStartInspecting:r,onStopInspecting:n,onClearSelection:o}){const[s,a]=F.useState(!0),[i,l]=F.useState(()=>({width:window.innerWidth,height:window.innerHeight})),[c,u]=F.useState(()=>Ff()??Mf()),d=F.useRef(!1),f=F.useRef({pointerId:-1,startX:0,startY:0,originX:0,originY:0,moved:!1}),m=F.useMemo(()=>$s(Cs,e),[e]),w=F.useMemo(()=>{const y=Math.min(Zf,i.width-24),E=Math.min(Math.round(i.height*.76),jf),p=c.x>i.width/2?c.x+De-y:c.x,O=Math.max(We,i.width-y-We),P=Math.max(We,i.height-E-We);return{left:Math.min(Math.max(p,We),O),top:Math.min(Math.max(c.y-E-Cf,We),P)}},[c,i.height,i.width]);F.useEffect(()=>{const y=()=>{l({width:window.innerWidth,height:window.innerHeight}),u(E=>{const p=qt(E);return window.localStorage.setItem(vr,JSON.stringify(p)),p})};return window.addEventListener("resize",y),()=>window.removeEventListener("resize",y)},[]);const v=y=>{window.localStorage.setItem(vr,JSON.stringify(y))},_=()=>{n(),a(!1)};return A.jsxs("div",{"data-oms-agent-root":!0,children:[A.jsx(Nf,{inspecting:t,onClearSelection:o,onClose:_,onStartInspecting:r,open:s,panelStyle:w,runtimeContext:m}),A.jsx("button",{className:$t("fixed z-50 inline-flex size-12 items-center justify-center rounded-full border border-[#4B8BFF]/45 bg-[linear-gradient(135deg,rgba(22,93,255,0.92),rgba(74,132,255,0.72),rgba(12,25,52,0.98))] text-white shadow-[0_14px_36px_rgba(22,93,255,0.3)] backdrop-blur-xl transition hover:border-[#8AB1FF]/80 hover:shadow-[0_18px_42px_rgba(22,93,255,0.34)]",s&&"ring-1 ring-[#6FA2FF]/45"),"aria-label":"打开 OMS 智能助手",onClick:()=>{if(d.current){d.current=!1;return}a(y=>(y&&n(),!y))},onPointerDown:y=>{f.current={pointerId:y.pointerId,startX:y.clientX,startY:y.clientY,originX:c.x,originY:c.y,moved:!1},y.currentTarget.setPointerCapture(y.pointerId)},onPointerMove:y=>{if(f.current.pointerId!==y.pointerId)return;const E=y.clientX-f.current.startX,p=y.clientY-f.current.startY,O=qt({x:f.current.originX+E,y:f.current.originY+p});(Math.abs(E)>3||Math.abs(p)>3)&&(f.current.moved=!0),u(O)},onPointerUp:y=>{if(f.current.pointerId===y.pointerId){if(f.current.moved){const E=y.clientX-f.current.startX,p=y.clientY-f.current.startY,O=Df({x:f.current.originX+E,y:f.current.originY+p});d.current=!0,u(O),v(O)}f.current.pointerId=-1,y.currentTarget.releasePointerCapture(y.pointerId)}},onPointerCancel:y=>{f.current.pointerId===y.pointerId&&(f.current.pointerId=-1,y.currentTarget.releasePointerCapture(y.pointerId))},style:{left:c.x,top:c.y,touchAction:"none"},type:"button",children:A.jsx(Mn,{className:"size-4.5"})})]})}function $n(e){const t=e.getBoundingClientRect();return{top:t.top+window.scrollY,left:t.left+window.scrollX,width:t.width,height:t.height}}function Cn(e){return e instanceof HTMLElement&&!!e.closest("[data-oms-agent-root]")}function Uf(){const[e,t]=F.useState(!1),[r,n]=F.useState(null),[o,s]=F.useState(null),a=F.useCallback(()=>{t(!1),n(null)},[]);F.useEffect(()=>{if(!e)return;const c=f=>{!(f.target instanceof HTMLElement)||Cn(f.target)||n(f.target)},u=f=>{!(f.target instanceof HTMLElement)||Cn(f.target)||(f.preventDefault(),f.stopPropagation(),s(f.target),a())},d=f=>{f.key==="Escape"&&a()};return document.addEventListener("mousemove",c,!0),document.addEventListener("click",u,!0),document.addEventListener("keydown",d,!0),()=>{document.removeEventListener("mousemove",c,!0),document.removeEventListener("click",u,!0),document.removeEventListener("keydown",d,!0)}},[e,a]);const i=F.useMemo(()=>r?$n(r):null,[r]),l=F.useMemo(()=>o?$n(o):null,[o]);return{isInspecting:e,hoverRect:i,selectedRect:l,selectedElement:o,startInspecting:()=>t(!0),stopInspecting:a,clearSelection:()=>s(null)}}exports.OmsAgentWidget=Lf;exports.collectRuntimeContext=$s;exports.getAgentApiBase=Ts;exports.omsBridge=Cs;exports.useElementInspector=Uf;
144
+ //# sourceMappingURL=oms-agent.cjs.map