@marimo-team/frontend 0.13.8-dev2 → 0.13.8-dev21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/{ConnectedDataExplorerComponent-BgS49O2y.js → ConnectedDataExplorerComponent-B49FoOoQ.js} +1 -1
- package/dist/assets/{VegaLite-CC_cyLqE.js → VegaLite-DFLdleLY.js} +1 -1
- package/dist/assets/{_baseEach-C1pHosxb.js → _baseEach-BaM53FvO.js} +1 -1
- package/dist/assets/_baseMap-CAAPRsun.js +1 -0
- package/dist/assets/{_baseUniq-DsRfRzA0.js → _baseUniq-sQi3NXjn.js} +1 -1
- package/dist/assets/{_createAggregator-6ir76sz5.js → _createAggregator-D1qp9HIq.js} +1 -1
- package/dist/assets/{any-language-editor-D58GINCW.js → any-language-editor-CEhxUQXU.js} +1 -1
- package/dist/assets/{architectureDiagram-IEHRJDOE-DQVugvaM.js → architectureDiagram-IEHRJDOE-BlhIanUj.js} +1 -1
- package/dist/assets/{blockDiagram-JOT3LUYC-p81uvhJJ.js → blockDiagram-JOT3LUYC-CwBeYFYc.js} +1 -1
- package/dist/assets/{c4Diagram-VJAJSXHY-B5DGGp-k.js → c4Diagram-VJAJSXHY-Doe4RcQE.js} +1 -1
- package/dist/assets/channel-CRpQ9bHC.js +1 -0
- package/dist/assets/{chunk-4BMEZGHF-BqmkMfQC.js → chunk-4BMEZGHF-Bd_xdDa8.js} +1 -1
- package/dist/assets/{chunk-A2AXSNBT-Bjt-wnKZ.js → chunk-A2AXSNBT-FRbQAbYg.js} +1 -1
- package/dist/assets/{chunk-AEK57VVT-Cusl4CVO.js → chunk-AEK57VVT-D0Wfb0zE.js} +1 -1
- package/dist/assets/{chunk-D6G4REZN-BTC2HwX0.js → chunk-D6G4REZN-B_NOceRX.js} +1 -1
- package/dist/assets/{chunk-RZ5BOZE2-ClaY-eM7.js → chunk-RZ5BOZE2-CJwDsm-v.js} +1 -1
- package/dist/assets/{chunk-XZIHB7SX-CUF2L91s.js → chunk-XZIHB7SX-CCCa7fcG.js} +1 -1
- package/dist/assets/{circle-play-DuqGOANw.js → circle-play-W2iojlzY.js} +1 -1
- package/dist/assets/classDiagram-GIVACNV2-DXQBQ9r_.js +1 -0
- package/dist/assets/classDiagram-v2-COTLJTTW-DXQBQ9r_.js +1 -0
- package/dist/assets/clone-DMpLQC19.js +1 -0
- package/dist/assets/{compile-DTXAmajo.js → compile-DWrxDO7H.js} +1 -1
- package/dist/assets/{dagre-OKDRZEBW-CNiE0aB5.js → dagre-OKDRZEBW-Bwa3_I0y.js} +1 -1
- package/dist/assets/{data-editor-nSnrGITi.js → data-editor-hYNlwsdz.js} +1 -1
- package/dist/assets/{diagram-SSKATNLV-DWtZOT0J.js → diagram-SSKATNLV-B3lm-ylq.js} +1 -1
- package/dist/assets/{diagram-VNBRO52H-CNHDg1kN.js → diagram-VNBRO52H-w2_n0Igi.js} +1 -1
- package/dist/assets/{edit-page-E7V1v51p.js → edit-page-Cd_G5mCW.js} +5 -5
- package/dist/assets/{erDiagram-Q7BY3M3F-ByHIS337.js → erDiagram-Q7BY3M3F-COqOeN_B.js} +1 -1
- package/dist/assets/{flowDiagram-4HSFHLVR-CzQQk_9i.js → flowDiagram-4HSFHLVR-C2Dhlw49.js} +1 -1
- package/dist/assets/{ganttDiagram-APWFNJXF-UqXWF8P1.js → ganttDiagram-APWFNJXF-CtWzMxbR.js} +1 -1
- package/dist/assets/{gitGraphDiagram-7IBYFJ6S-CuNV9VlX.js → gitGraphDiagram-7IBYFJ6S-D2c99Rh6.js} +1 -1
- package/dist/assets/{graph-CSd8xQQs.js → graph-ClAPC1w-.js} +1 -1
- package/dist/assets/{home-page-CL009vUk.js → home-page-CRtb9DA6.js} +1 -1
- package/dist/assets/{index-CNTUY_Lc.js → index-5T0SJzbF.js} +1 -1
- package/dist/assets/{index-CnQ_m_IG.js → index-BI0u5UD0.js} +1 -1
- package/dist/assets/{index-DW9seDti.js → index-BL6miWVE.js} +1 -1
- package/dist/assets/{index-Ca3Hp1vM.js → index-BgLtBvrq.js} +1 -1
- package/dist/assets/{index-D94BJajX.js → index-C2Gi1B_K.js} +1 -1
- package/dist/assets/{index-BSVNgZco.js → index-C4sjnNd2.js} +1 -1
- package/dist/assets/{index-D4LCkp9S.js → index-CFMf3yUC.js} +1 -1
- package/dist/assets/{index-Be3B8HV1.js → index-Ci03z9tb.js} +1 -1
- package/dist/assets/{index-CC2MODRp.js → index-CxFVHKdj.js} +1 -1
- package/dist/assets/{index-BGSbdbe_.js → index-D8v0wjrs.js} +1 -1
- package/dist/assets/{index-g2y61VXL.js → index-DGpcCc9-.js} +1 -1
- package/dist/assets/{index-BHuu2nGd.js → index-DMehqnsa.js} +1 -1
- package/dist/assets/{index-CLFnc4a4.js → index-DPeW8mNz.js} +1 -1
- package/dist/assets/{index-BaqeRO80.js → index-D_uUH2Gt.js} +1 -1
- package/dist/assets/{index-DBcz4Ck6.js → index-Di2fN1ks.js} +1 -1
- package/dist/assets/{index-FqMO9FND.js → index-DrIJd_JM.js} +1 -1
- package/dist/assets/{index-CP_5ielV.js → index-Dy8AcnmD.js} +1 -1
- package/dist/assets/{index-DhpCbssu.js → index-GsZwVOm_.js} +161 -161
- package/dist/assets/{index-BWTL5HDy.js → index-tosHVdSV.js} +1 -1
- package/dist/assets/{index-DredxwTT.css → index-w3t2_3nw.css} +1 -1
- package/dist/assets/infoDiagram-PH2N3AL5-B3NevBU5.js +2 -0
- package/dist/assets/{journeyDiagram-U35MCT3I-BasXqcjT.js → journeyDiagram-U35MCT3I-BQfMeinR.js} +1 -1
- package/dist/assets/{kanban-definition-NDS4AKOZ-BaGFKaQ7.js → kanban-definition-NDS4AKOZ-BVSDVzYM.js} +1 -1
- package/dist/assets/{layout-DW7cLgAk.js → layout-3ztec_pB.js} +1 -1
- package/dist/assets/{linear-CsGE5GZr.js → linear-DUrMGtqo.js} +1 -1
- package/dist/assets/{mermaid-0EZvq4Jv.js → mermaid-DbxZrpQo.js} +4 -4
- package/dist/assets/{min-VGFBFb_W.js → min-Dk8EzWE2.js} +1 -1
- package/dist/assets/{mindmap-definition-ALO5MXBD-ky4_ec1C.js → mindmap-definition-ALO5MXBD-DFuUGb9C.js} +1 -1
- package/dist/assets/{pieDiagram-IB7DONF6-Cih7xKWn.js → pieDiagram-IB7DONF6-Aj1QMO0Q.js} +1 -1
- package/dist/assets/{quadrantDiagram-7GDLP6J5-t83fM8Sw.js → quadrantDiagram-7GDLP6J5-irHV5rb1.js} +1 -1
- package/dist/assets/{radar-MK3ICKWK-5n60lTrG.js → radar-MK3ICKWK-Ct1tfWfj.js} +1 -1
- package/dist/assets/{react-plotly-Dxr5w-Ys.js → react-plotly-20wokNrj.js} +1 -1
- package/dist/assets/{requirementDiagram-KVF5MWMF-CFNkvOXw.js → requirementDiagram-KVF5MWMF-4WEqL8qY.js} +1 -1
- package/dist/assets/{run-page-ClgZml7I.js → run-page-CUmUExBq.js} +1 -1
- package/dist/assets/{sankeyDiagram-QLVOVGJD-C6PKMl0l.js → sankeyDiagram-QLVOVGJD-CKwI-6Ze.js} +1 -1
- package/dist/assets/{sequenceDiagram-X6HHIX6F-Chr3PzD1.js → sequenceDiagram-X6HHIX6F-BAH9HRKZ.js} +1 -1
- package/dist/assets/{slides-component-xhIQyG40.js → slides-component-BZhMEJrN.js} +1 -1
- package/dist/assets/{sortBy-Ocs-MbbX.js → sortBy-CDQAV9fO.js} +1 -1
- package/dist/assets/{stateDiagram-DGXRK772-CLz__VCe.js → stateDiagram-DGXRK772-DZtLrwb8.js} +1 -1
- package/dist/assets/stateDiagram-v2-YXO3MK2T-fJmtzB88.js +1 -0
- package/dist/assets/{terminal-bu-fhYWe.js → terminal-w-_gnRP8.js} +1 -1
- package/dist/assets/{time-1xC9mPUE.js → time-D0CG3eY_.js} +1 -1
- package/dist/assets/{timeline-definition-BDJGKUSR-CoVjTsQU.js → timeline-definition-BDJGKUSR-CnCY4iLA.js} +1 -1
- package/dist/assets/{tracing-D_xfhRs4.js → tracing-dldtmRtl.js} +2 -2
- package/dist/assets/tree-CYcdI_8s.js +17 -0
- package/dist/assets/{useMarimoWebSocket-BZ6yUxbu.js → useMarimoWebSocket-Rw0NaDS3.js} +3 -3
- package/dist/assets/{vega-component-Ce2HUTfU.js → vega-component-Delhvhk-.js} +1 -1
- package/dist/assets/{worker-D-UG5-wL.js → worker-Dq7HyhFQ.js} +1 -1
- package/dist/assets/{xychartDiagram-VJFVF3MP-ugyREHe3.js → xychartDiagram-VJFVF3MP-CpjbxNqa.js} +1 -1
- package/dist/index.html +2 -2
- package/package.json +1 -1
- package/dist/assets/_baseMap-QWVCP_aF.js +0 -1
- package/dist/assets/channel-_67l8od_.js +0 -1
- package/dist/assets/classDiagram-GIVACNV2-BkWaU-Sm.js +0 -1
- package/dist/assets/classDiagram-v2-COTLJTTW-BkWaU-Sm.js +0 -1
- package/dist/assets/clone-2u8IDR1y.js +0 -1
- package/dist/assets/infoDiagram-PH2N3AL5-DZIPEgUQ.js +0 -2
- package/dist/assets/stateDiagram-v2-YXO3MK2T-B0mm1b0E.js +0 -1
- package/dist/assets/tree-BmM-bd8f.js +0 -17
|
@@ -1 +1 @@
|
|
|
1
|
-
import{aM as N,bg as E,bh as D,d as G,aP as W,bi as $,j as g,E as q,af as C,S as j,bj as K,bk as A,bl as B,L as P,aF as V,bm as R,bn as J,bo as Q,bp as U,ap as X,bq as Y}from"./index-
|
|
1
|
+
import{aM as N,bg as E,bh as D,d as G,aP as W,bi as $,j as g,E as q,af as C,S as j,bj as K,bk as A,bl as B,L as P,aF as V,bm as R,bn as J,bo as Q,bp as U,ap as X,bq as Y}from"./index-GsZwVOm_.js";import{M as y}from"./compile-DWrxDO7H.js";import{a as tt}from"./VegaLite-DFLdleLY.js";import"./time-D0CG3eY_.js";import"./timer-DFzT7np-.js";import"./linear-DUrMGtqo.js";import"./init-DLRA0X12.js";import"./range-CtcPcB_L.js";import"./zoom-COrs4lFh.js";import"./ordinal-DDUp3AbE.js";import"./colors-bszWmPJw.js";import"./arc-Cuwikxov.js";import"./step-BwsUM5iJ.js";import"./index-C4sjnNd2.js";const z=new Set(["boxplot","errorband","errorbar"]),S={getMarkType(t){const e=typeof t=="string"?t:t.type;if(z.has(e))throw new Error("Not supported");return e},isInteractive(t){const e=typeof t=="string"?t:t.type;return!z.has(e)},makeClickable(t){const e=typeof t=="string"?t:t.type;return e in y?typeof t=="string"?{type:t,cursor:"pointer",tooltip:!0}:{...t,type:e,cursor:"pointer",tooltip:!0}:t},getOpacity:t=>typeof t=="string"?null:"opacity"in t&&typeof t.opacity=="number"?t.opacity:null},et=new Set(["color","fill","fillOpacity","opacity","shape","size"]);function at(t,e,r,i){const u={and:r.map(d=>({param:d}))};if(t==="opacity"){const d=S.getOpacity(i)||1;return{...e,opacity:{condition:{test:u,value:d},value:d/5}}}return e}const w={point:t=>t==null?"select_point":`select_point_${t}`,interval:t=>t==null?"select_interval":`select_interval_${t}`,legendSelection:t=>`legend_selection_${t}`,HIGHLIGHT:"highlight",PAN_ZOOM:"pan_zoom",hasPoint:t=>t.some(e=>e.startsWith("select_point")),hasInterval:t=>t.some(e=>e.startsWith("select_interval")),hasLegend:t=>t.some(e=>e.startsWith("legend_selection")),hasPanZoom:t=>t.some(e=>e.startsWith("pan_zoom"))},_={highlight:()=>({name:w.HIGHLIGHT,select:{type:"point",on:"mouseover"}}),interval:(t,e)=>({name:w.interval(e),select:{type:"interval",encodings:T(t),mark:{fill:"#669EFF",fillOpacity:.07,stroke:"#669EFF",strokeOpacity:.4},on:"[mousedown[!event.metaKey], mouseup] > mousemove[!event.metaKey]",translate:"[mousedown[!event.metaKey], mouseup] > mousemove[!event.metaKey]"}}),point:(t,e)=>({name:w.point(e),select:{type:"point",encodings:T(t),on:"click[!event.metaKey]"}}),legend:t=>({name:w.legendSelection(t),select:{type:"point",fields:[t]},bind:"legend"}),panZoom:()=>({name:w.PAN_ZOOM,bind:"scales",select:{type:"interval",on:"[mousedown[event.metaKey], window:mouseup] > window:mousemove!",translate:"[mousedown[event.metaKey], window:mouseup] > window:mousemove!",zoom:"wheel![event.metaKey]"}})};function T(t){switch(S.getMarkType(t.mark)){case y.image:case y.trail:return;case y.area:case y.arc:return["color"];case y.bar:{const e=function(r){var d,l;if(!r||!("mark"in r))return;const i=(d=r.encoding)==null?void 0:d.x,u=(l=r.encoding)==null?void 0:l.y;if(i&&"type"in i&&i.type==="nominal")return"vertical";if(u&&"type"in u&&u.type==="nominal"||i&&"aggregate"in i)return"horizontal";if(u&&"aggregate"in u)return"vertical"}(t);return e==="horizontal"?["y"]:e==="vertical"?["x"]:void 0}case y.circle:case y.geoshape:case y.line:case y.point:case y.rect:case y.rule:case y.square:case y.text:case y.tick:return["x","y"]}}function Z(t){return"params"in t&&t.params&&t.params.length>0?t.params.filter(e=>e!=null&&"select"in e&&e.select!==void 0).map(e=>e.name):"layer"in t?[...new Set(t.layer.flatMap(Z))]:[]}function nt(t,e){var f,v;let{chartSelection:r=!0,fieldSelection:i=!0}=e;if(!r&&!i)return t;if(((f=t.params)==null?void 0:f.some(c=>c.bind==="legend"))&&(i=!1),((v=t.params)==null?void 0:v.some(c=>!c.bind))&&(r=!1),"vconcat"in t){const c=t.vconcat.map(o=>"mark"in o?M(o):o);return{...t,vconcat:c}}if("hconcat"in t){const c=t.hconcat.map(o=>"mark"in o?M(o):o);return{...t,hconcat:c}}if("layer"in t){const c=t.layer.map((o,p)=>{if(!("mark"in o))return o;let s=o;return s=L(s,r,p),s=M(s),p===0&&(s=F(s)),s});return{...t,layer:c}}if(!("mark"in t)||!S.isInteractive(t.mark))return t;let l=t;return l=function(c,o){if(o===!1)return c;let p=function(h){if(!h||!("encoding"in h))return[];const{encoding:x}=h;return x?Object.entries(x).flatMap(a=>{const[n,m]=a;return m&&et.has(n)?"field"in m&&typeof m.field=="string"?[m.field]:"condition"in m&&m.condition&&typeof m.condition=="object"&&"field"in m.condition&&m.condition.field&&typeof m.condition.field=="string"?[m.condition.field]:[]:[]}):[]}(c);Array.isArray(o)&&(p=p.filter(h=>o.includes(h)));const s=p.map(h=>_.legend(h)),b=[...c.params||[],...s];return{...c,params:b}}(l,i),l=L(l,r,void 0),l=M(l),l=F(l),l}function L(t,e,r){if(e===!1)return t;let i;try{i=S.getMarkType(t.mark)}catch{return t}if(i==="geoshape")return t;const u=e===!0?function(f){switch(f){case"arc":case"area":return["point"];case"text":case"bar":default:return["point","interval"];case"line":return}}(i):[e];if(!u)return t;const d=u.map(f=>f==="interval"?_.interval(t,r):_.point(t,r)),l=[...t.params||[],...d];return{...t,params:l}}function F(t){let e;try{e=S.getMarkType(t.mark)}catch{}if(e==="geoshape")return t;const r=t.params||[];return r.some(i=>i.bind==="scales")?t:{...t,params:[...r,_.panZoom()]}}function M(t){const e="encoding"in t?t.encoding:void 0,r=t.params||[],i=r.map(u=>u.name);return r.length===0?t:S.isInteractive(t.mark)?{...t,mark:S.makeClickable(t.mark),encoding:at("opacity",e||{},i,t.mark)}:t}function H(t){return(e=t,e!=null&&e.schema&&Array.isArray(e.schema.fields)&&typeof e.toArray=="function"?t:function(r){return D(r,{useProxy:!0})}(t)).toArray();var e}H.responseType="arrayBuffer",$("arrow",H);const rt=t=>{const e=G.c(11),{value:r,setValue:i,chartSelection:u,fieldSelection:d,spec:l}=t;let f,v;e[0]!==l?(f=async()=>async function(s){if(!s)return s;const b="datasets"in s?{...s.datasets}:{},h=async a=>{if(!a)return a;if("layer"in a){const k=await Promise.all(a.layer.map(h));a={...a,layer:k}}if("hconcat"in a){const k=await Promise.all(a.hconcat.map(h));a={...a,hconcat:k}}if("vconcat"in a){const k=await Promise.all(a.vconcat.map(h));a={...a,vconcat:k}}if("spec"in a&&(a={...a,spec:await h(a.spec)}),!a.data||!("url"in a.data))return a;let n;try{n=N(a.data.url)}catch{return a}const m=await E(n.href,a.data.format);return b[n.pathname]=m,{...a,data:{name:n.pathname}}},x=await h(s);return Object.keys(b).length===0?x:{...x,datasets:b}}(l),v=[l],e[0]=l,e[1]=f,e[2]=v):(f=e[1],v=e[2]);const{data:c,error:o}=W(f,v);if(o){let s;return e[3]!==o?(s=g.jsx(q,{error:o}),e[3]=o,e[4]=s):s=e[4],s}if(!c)return null;let p;return e[5]!==u||e[6]!==d||e[7]!==c||e[8]!==i||e[9]!==r?(p=g.jsx(it,{value:r,setValue:i,chartSelection:u,fieldSelection:d,spec:c}),e[5]=u,e[6]=d,e[7]=c,e[8]=i,e[9]=r,e[10]=p):p=e[10],p},it=({value:t,setValue:e,chartSelection:r,fieldSelection:i,spec:u})=>{const{theme:d}=C(),l=j.useRef(),[f,v]=j.useState(),c=K(u),o=j.useMemo(()=>nt(function(n){return n.data&&"url"in n.data&&(n.data.url=N(n.data.url).href),n}(c),{chartSelection:r,fieldSelection:i}),[c,r,i]),p=j.useMemo(()=>Z(o),[o]),s=A(n=>{e({...t,...n})}),b=K(p),h=j.useMemo(()=>b.reduce((n,m)=>(w.PAN_ZOOM===m||(n[m]=B((k,I)=>{P.debug("[Vega signal]",k,I);let O=V.mapValues(I,ct);O=V.mapValues(O,st),s({[k]:O})},100)),n),{}),[b,s]),x=A(n=>{P.error(n),P.debug(o),v(n)}),a=A(n=>{P.debug("[Vega view] created",n),l.current=n,v(void 0)});return g.jsxs(g.Fragment,{children:[f&&g.jsxs(R,{variant:"destructive",children:[g.jsx(J,{children:f.message}),g.jsx("div",{className:"text-md",children:f.stack})]}),g.jsxs("div",{className:"relative",onPointerDown:Q.stopPropagation(),children:[g.jsx(tt,{spec:o,theme:d==="dark"?"dark":void 0,actions:ot,signalListeners:h,onError:x,onNewView:a}),(()=>{const n=[];return w.hasPoint(p)&&n.push(["Point selection","click to select a point; hold shift for multi-select"]),w.hasInterval(p)&&n.push(["Interval selection","click and drag to select an interval"]),w.hasLegend(p)&&n.push(["Legend selection","click to select a legend item; hold shift for multi-select"]),w.hasPanZoom(p)&&n.push(["Pan","hold the meta key and drag"],["Zoom","hold the meta key and scroll"]),n.length===0?null:g.jsx(X,{delayDuration:300,side:"left",content:g.jsx("div",{className:"text-xs flex flex-col",children:n.map((m,k)=>g.jsxs("div",{children:[g.jsxs("span",{className:"font-bold tracking-wide",children:[m[0],":"]})," ",m[1]]},k))}),children:g.jsx(Y,{className:"absolute bottom-1 right-0 m-2 h-4 w-4 cursor-help text-muted-foreground hover:text-foreground"})})})()]})]})},ot={source:!1,compiled:!1};function st(t){return t instanceof Set?[...t]:t}function ct(t){return Array.isArray(t)?t.map(e=>e instanceof Date&&U(e)?new Date(e).getTime():e):t}export{rt as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var e,t;!function(e){e.assertEqual=e=>e,e.assertIs=function(e){},e.assertNever=function(e){throw new Error},e.arrayToEnum=e=>{const t={};for(const n of e)t[n]=n;return t},e.getValidEnumValues=t=>{const n=e.objectKeys(t).filter((e=>"number"!=typeof t[t[e]])),r={};for(const e of n)r[e]=t[e];return e.objectValues(r)},e.objectValues=t=>e.objectKeys(t).map((function(e){return t[e]})),e.objectKeys="function"==typeof Object.keys?e=>Object.keys(e):e=>{const t=[];for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.push(n);return t},e.find=(e,t)=>{for(const n of e)if(t(n))return n},e.isInteger="function"==typeof Number.isInteger?e=>Number.isInteger(e):e=>"number"==typeof e&&isFinite(e)&&Math.floor(e)===e,e.joinValues=function(e,t=" | "){return e.map((e=>"string"==typeof e?`'${e}'`:e)).join(t)},e.jsonStringifyReplacer=(e,t)=>"bigint"==typeof t?t.toString():t}(e||(e={})),function(e){e.mergeShapes=(e,t)=>({...e,...t})}(t||(t={}));const n=e.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),r=e=>{switch(typeof e){case"undefined":return n.undefined;case"string":return n.string;case"number":return isNaN(e)?n.nan:n.number;case"boolean":return n.boolean;case"function":return n.function;case"bigint":return n.bigint;case"symbol":return n.symbol;case"object":return Array.isArray(e)?n.array:null===e?n.null:e.then&&"function"==typeof e.then&&e.catch&&"function"==typeof e.catch?n.promise:"undefined"!=typeof Map&&e instanceof Map?n.map:"undefined"!=typeof Set&&e instanceof Set?n.set:"undefined"!=typeof Date&&e instanceof Date?n.date:n.object;default:return n.unknown}},a=e.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 s extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=e=>{this.issues=[...this.issues,e]},this.addIssues=(e=[])=>{this.issues=[...this.issues,...e]};const t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.issues=e}format(e){const t=e||function(e){return e.message},n={_errors:[]},r=e=>{for(const a of e.issues)if("invalid_union"===a.code)a.unionErrors.map(r);else if("invalid_return_type"===a.code)r(a.returnTypeError);else if("invalid_arguments"===a.code)r(a.argumentsError);else if(0===a.path.length)n._errors.push(t(a));else{let e=n,r=0;for(;r<a.path.length;){const n=a.path[r];r===a.path.length-1?(e[n]=e[n]||{_errors:[]},e[n]._errors.push(t(a))):e[n]=e[n]||{_errors:[]},e=e[n],r++}}};return r(this),n}static assert(e){if(!(e instanceof s))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,e.jsonStringifyReplacer,2)}get isEmpty(){return 0===this.issues.length}flatten(e=e=>e.message){const t={},n=[];for(const r of this.issues)r.path.length>0?(t[r.path[0]]=t[r.path[0]]||[],t[r.path[0]].push(e(r))):n.push(e(r));return{formErrors:n,fieldErrors:t}}get formErrors(){return this.flatten()}}s.create=e=>new s(e);const i=(t,r)=>{let s;switch(t.code){case a.invalid_type:s=t.received===n.undefined?"Required":`Expected ${t.expected}, received ${t.received}`;break;case a.invalid_literal:s=`Invalid literal value, expected ${JSON.stringify(t.expected,e.jsonStringifyReplacer)}`;break;case a.unrecognized_keys:s=`Unrecognized key(s) in object: ${e.joinValues(t.keys,", ")}`;break;case a.invalid_union:s="Invalid input";break;case a.invalid_union_discriminator:s=`Invalid discriminator value. Expected ${e.joinValues(t.options)}`;break;case a.invalid_enum_value:s=`Invalid enum value. Expected ${e.joinValues(t.options)}, received '${t.received}'`;break;case a.invalid_arguments:s="Invalid function arguments";break;case a.invalid_return_type:s="Invalid function return type";break;case a.invalid_date:s="Invalid date";break;case a.invalid_string:"object"==typeof t.validation?"includes"in t.validation?(s=`Invalid input: must include "${t.validation.includes}"`,"number"==typeof t.validation.position&&(s=`${s} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?s=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?s=`Invalid input: must end with "${t.validation.endsWith}"`:e.assertNever(t.validation):s="regex"!==t.validation?`Invalid ${t.validation}`:"Invalid";break;case a.too_small:s="array"===t.type?`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:"string"===t.type?`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:"number"===t.type?`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:"date"===t.type?`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:"Invalid input";break;case a.too_big:s="array"===t.type?`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:"string"===t.type?`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:"number"===t.type?`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:"bigint"===t.type?`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:"date"===t.type?`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:"Invalid input";break;case a.custom:s="Invalid input";break;case a.invalid_intersection_types:s="Intersection results could not be merged";break;case a.not_multiple_of:s=`Number must be a multiple of ${t.multipleOf}`;break;case a.not_finite:s="Number must be finite";break;default:s=r.defaultError,e.assertNever(t)}return{message:s}};let o=i;function d(){return o}const c=e=>{const{data:t,path:n,errorMaps:r,issueData:a}=e,s=[...n,...a.path||[]],i={...a,path:s};if(void 0!==a.message)return{...a,path:s,message:a.message};let o="";const d=r.filter((e=>!!e)).slice().reverse();for(const c of d)o=c(i,{data:t,defaultError:o}).message;return{...a,path:s,message:o}};function u(e,t){const n=d(),r=c({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,n,n===i?void 0:i].filter((e=>!!e))});e.common.issues.push(r)}class l{constructor(){this.value="valid"}dirty(){"valid"===this.value&&(this.value="dirty")}abort(){"aborted"!==this.value&&(this.value="aborted")}static mergeArray(e,t){const n=[];for(const r of t){if("aborted"===r.status)return p;"dirty"===r.status&&e.dirty(),n.push(r.value)}return{status:e.value,value:n}}static async mergeObjectAsync(e,t){const n=[];for(const r of t){const e=await r.key,t=await r.value;n.push({key:e,value:t})}return l.mergeObjectSync(e,n)}static mergeObjectSync(e,t){const n={};for(const r of t){const{key:t,value:a}=r;if("aborted"===t.status)return p;if("aborted"===a.status)return p;"dirty"===t.status&&e.dirty(),"dirty"===a.status&&e.dirty(),"__proto__"===t.value||void 0===a.value&&!r.alwaysSet||(n[t.value]=a.value)}return{status:e.value,value:n}}}const p=Object.freeze({status:"aborted"}),h=e=>({status:"dirty",value:e}),m=e=>({status:"valid",value:e}),f=e=>"aborted"===e.status,y=e=>"dirty"===e.status,g=e=>"valid"===e.status,v=e=>"undefined"!=typeof Promise&&e instanceof Promise;function _(e,t,n,r){if("function"==typeof t||!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t.get(e)}function b(e,t,n,r,a){if("function"==typeof t||!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return t.set(e,n),n}var w,k,x;"function"==typeof SuppressedError&&SuppressedError,function(e){e.errToObj=e=>"string"==typeof e?{message:e}:e||{},e.toString=e=>"string"==typeof e?e:null==e?void 0:e.message}(w||(w={}));class S{constructor(e,t,n,r){this._cachedPath=[],this.parent=e,this.data=t,this._path=n,this._key=r}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const T=(e,t)=>{if(g(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const t=new s(e.common.issues);return this._error=t,this._error}}};function E(e){if(!e)return{};const{errorMap:t,invalid_type_error:n,required_error:r,description:a}=e;if(t&&(n||r))throw new Error('Can\'t use "invalid_type_error" or "required_error" in conjunction with custom error map.');if(t)return{errorMap:t,description:a};return{errorMap:(t,a)=>{var s,i;const{message:o}=e;return"invalid_enum_value"===t.code?{message:null!=o?o:a.defaultError}:void 0===a.data?{message:null!==(s=null!=o?o:r)&&void 0!==s?s:a.defaultError}:"invalid_type"!==t.code?{message:a.defaultError}:{message:null!==(i=null!=o?o:n)&&void 0!==i?i:a.defaultError}},description:a}}class O{get description(){return this._def.description}_getType(e){return r(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:r(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new l,ctx:{common:e.parent.common,data:e.data,parsedType:r(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const t=this._parse(e);if(v(t))throw new Error("Synchronous parse encountered promise.");return t}_parseAsync(e){const t=this._parse(e);return Promise.resolve(t)}parse(e,t){const n=this.safeParse(e,t);if(n.success)return n.data;throw n.error}safeParse(e,t){var n;const a={common:{issues:[],async:null!==(n=null==t?void 0:t.async)&&void 0!==n&&n,contextualErrorMap:null==t?void 0:t.errorMap},path:(null==t?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:r(e)},s=this._parseSync({data:e,path:a.path,parent:a});return T(a,s)}"~validate"(e){var t,n;const a={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:r(e)};if(!this["~standard"].async)try{const t=this._parseSync({data:e,path:[],parent:a});return g(t)?{value:t.value}:{issues:a.common.issues}}catch(s){(null===(n=null===(t=null==s?void 0:s.message)||void 0===t?void 0:t.toLowerCase())||void 0===n?void 0:n.includes("encountered"))&&(this["~standard"].async=!0),a.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:a}).then((e=>g(e)?{value:e.value}:{issues:a.common.issues}))}async parseAsync(e,t){const n=await this.safeParseAsync(e,t);if(n.success)return n.data;throw n.error}async safeParseAsync(e,t){const n={common:{issues:[],contextualErrorMap:null==t?void 0:t.errorMap,async:!0},path:(null==t?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:r(e)},a=this._parse({data:e,path:n.path,parent:n}),s=await(v(a)?a:Promise.resolve(a));return T(n,s)}refine(e,t){const n=e=>"string"==typeof t||void 0===t?{message:t}:"function"==typeof t?t(e):t;return this._refinement(((t,r)=>{const s=e(t),i=()=>r.addIssue({code:a.custom,...n(t)});return"undefined"!=typeof Promise&&s instanceof Promise?s.then((e=>!!e||(i(),!1))):!!s||(i(),!1)}))}refinement(e,t){return this._refinement(((n,r)=>!!e(n)||(r.addIssue("function"==typeof t?t(n,r):t),!1)))}_refinement(e){return new Oe({schema:this,typeName:De.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:e=>this["~validate"](e)}}optional(){return Ze.create(this,this._def)}nullable(){return je.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return de.create(this)}promise(){return Ee.create(this,this._def)}or(e){return le.create([this,e],this._def)}and(e){return fe.create(this,e,this._def)}transform(e){return new Oe({...E(this._def),schema:this,typeName:De.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const t="function"==typeof e?e:()=>e;return new Ne({...E(this._def),innerType:this,defaultValue:t,typeName:De.ZodDefault})}brand(){return new Ie({typeName:De.ZodBranded,type:this,...E(this._def)})}catch(e){const t="function"==typeof e?e:()=>e;return new Pe({...E(this._def),innerType:this,catchValue:t,typeName:De.ZodCatch})}describe(e){return new(0,this.constructor)({...this._def,description:e})}pipe(e){return Re.create(this,e)}readonly(){return $e.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const Z=/^c[^\s-]{8,}$/i,j=/^[0-9a-z]+$/,N=/^[0-9A-HJKMNP-TV-Z]{26}$/i,P=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,A=/^[a-z0-9_-]{21}$/i,C=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,I=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,R=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i;let $;const F=/^(?:(?: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])$/,M=/^(?:(?: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])$/,L=/^(([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]))$/,D=/^(([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])$/,z=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,q=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,U="((\\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])))",V=new RegExp(`^${U}$`);function H(e){let t="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return e.precision?t=`${t}\\.\\d{${e.precision}}`:null==e.precision&&(t=`${t}(\\.\\d+)?`),t}function B(e){let t=`${U}T${H(e)}`;const n=[];return n.push(e.local?"Z?":"Z"),e.offset&&n.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${n.join("|")})`,new RegExp(`^${t}$`)}function W(e,t){if(!C.test(e))return!1;try{const[n]=e.split("."),r=n.replace(/-/g,"+").replace(/_/g,"/").padEnd(n.length+(4-n.length%4)%4,"="),a=JSON.parse(atob(r));return"object"==typeof a&&null!==a&&(!(!a.typ||!a.alg)&&(!t||a.alg===t))}catch(n){return!1}}function K(e,t){return!("v4"!==t&&t||!M.test(e))||!("v6"!==t&&t||!D.test(e))}class J extends O{_parse(t){this._def.coerce&&(t.data=String(t.data));if(this._getType(t)!==n.string){const e=this._getOrReturnCtx(t);return u(e,{code:a.invalid_type,expected:n.string,received:e.parsedType}),p}const r=new l;let s;for(const n of this._def.checks)if("min"===n.kind)t.data.length<n.value&&(s=this._getOrReturnCtx(t,s),u(s,{code:a.too_small,minimum:n.value,type:"string",inclusive:!0,exact:!1,message:n.message}),r.dirty());else if("max"===n.kind)t.data.length>n.value&&(s=this._getOrReturnCtx(t,s),u(s,{code:a.too_big,maximum:n.value,type:"string",inclusive:!0,exact:!1,message:n.message}),r.dirty());else if("length"===n.kind){const e=t.data.length>n.value,i=t.data.length<n.value;(e||i)&&(s=this._getOrReturnCtx(t,s),e?u(s,{code:a.too_big,maximum:n.value,type:"string",inclusive:!0,exact:!0,message:n.message}):i&&u(s,{code:a.too_small,minimum:n.value,type:"string",inclusive:!0,exact:!0,message:n.message}),r.dirty())}else if("email"===n.kind)R.test(t.data)||(s=this._getOrReturnCtx(t,s),u(s,{validation:"email",code:a.invalid_string,message:n.message}),r.dirty());else if("emoji"===n.kind)$||($=new RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),$.test(t.data)||(s=this._getOrReturnCtx(t,s),u(s,{validation:"emoji",code:a.invalid_string,message:n.message}),r.dirty());else if("uuid"===n.kind)P.test(t.data)||(s=this._getOrReturnCtx(t,s),u(s,{validation:"uuid",code:a.invalid_string,message:n.message}),r.dirty());else if("nanoid"===n.kind)A.test(t.data)||(s=this._getOrReturnCtx(t,s),u(s,{validation:"nanoid",code:a.invalid_string,message:n.message}),r.dirty());else if("cuid"===n.kind)Z.test(t.data)||(s=this._getOrReturnCtx(t,s),u(s,{validation:"cuid",code:a.invalid_string,message:n.message}),r.dirty());else if("cuid2"===n.kind)j.test(t.data)||(s=this._getOrReturnCtx(t,s),u(s,{validation:"cuid2",code:a.invalid_string,message:n.message}),r.dirty());else if("ulid"===n.kind)N.test(t.data)||(s=this._getOrReturnCtx(t,s),u(s,{validation:"ulid",code:a.invalid_string,message:n.message}),r.dirty());else if("url"===n.kind)try{new URL(t.data)}catch(d){s=this._getOrReturnCtx(t,s),u(s,{validation:"url",code:a.invalid_string,message:n.message}),r.dirty()}else if("regex"===n.kind){n.regex.lastIndex=0;n.regex.test(t.data)||(s=this._getOrReturnCtx(t,s),u(s,{validation:"regex",code:a.invalid_string,message:n.message}),r.dirty())}else if("trim"===n.kind)t.data=t.data.trim();else if("includes"===n.kind)t.data.includes(n.value,n.position)||(s=this._getOrReturnCtx(t,s),u(s,{code:a.invalid_string,validation:{includes:n.value,position:n.position},message:n.message}),r.dirty());else if("toLowerCase"===n.kind)t.data=t.data.toLowerCase();else if("toUpperCase"===n.kind)t.data=t.data.toUpperCase();else if("startsWith"===n.kind)t.data.startsWith(n.value)||(s=this._getOrReturnCtx(t,s),u(s,{code:a.invalid_string,validation:{startsWith:n.value},message:n.message}),r.dirty());else if("endsWith"===n.kind)t.data.endsWith(n.value)||(s=this._getOrReturnCtx(t,s),u(s,{code:a.invalid_string,validation:{endsWith:n.value},message:n.message}),r.dirty());else if("datetime"===n.kind){B(n).test(t.data)||(s=this._getOrReturnCtx(t,s),u(s,{code:a.invalid_string,validation:"datetime",message:n.message}),r.dirty())}else if("date"===n.kind){V.test(t.data)||(s=this._getOrReturnCtx(t,s),u(s,{code:a.invalid_string,validation:"date",message:n.message}),r.dirty())}else if("time"===n.kind){new RegExp(`^${H(n)}$`).test(t.data)||(s=this._getOrReturnCtx(t,s),u(s,{code:a.invalid_string,validation:"time",message:n.message}),r.dirty())}else"duration"===n.kind?I.test(t.data)||(s=this._getOrReturnCtx(t,s),u(s,{validation:"duration",code:a.invalid_string,message:n.message}),r.dirty()):"ip"===n.kind?(i=t.data,("v4"!==(o=n.version)&&o||!F.test(i))&&("v6"!==o&&o||!L.test(i))&&(s=this._getOrReturnCtx(t,s),u(s,{validation:"ip",code:a.invalid_string,message:n.message}),r.dirty())):"jwt"===n.kind?W(t.data,n.alg)||(s=this._getOrReturnCtx(t,s),u(s,{validation:"jwt",code:a.invalid_string,message:n.message}),r.dirty()):"cidr"===n.kind?K(t.data,n.version)||(s=this._getOrReturnCtx(t,s),u(s,{validation:"cidr",code:a.invalid_string,message:n.message}),r.dirty()):"base64"===n.kind?z.test(t.data)||(s=this._getOrReturnCtx(t,s),u(s,{validation:"base64",code:a.invalid_string,message:n.message}),r.dirty()):"base64url"===n.kind?q.test(t.data)||(s=this._getOrReturnCtx(t,s),u(s,{validation:"base64url",code:a.invalid_string,message:n.message}),r.dirty()):e.assertNever(n);var i,o;return{status:r.value,value:t.data}}_regex(e,t,n){return this.refinement((t=>e.test(t)),{validation:t,code:a.invalid_string,...w.errToObj(n)})}_addCheck(e){return new J({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...w.errToObj(e)})}url(e){return this._addCheck({kind:"url",...w.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...w.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...w.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...w.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...w.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...w.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...w.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...w.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...w.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...w.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...w.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...w.errToObj(e)})}datetime(e){var t,n;return"string"==typeof e?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:void 0===(null==e?void 0:e.precision)?null:null==e?void 0:e.precision,offset:null!==(t=null==e?void 0:e.offset)&&void 0!==t&&t,local:null!==(n=null==e?void 0:e.local)&&void 0!==n&&n,...w.errToObj(null==e?void 0:e.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return"string"==typeof e?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:void 0===(null==e?void 0:e.precision)?null:null==e?void 0:e.precision,...w.errToObj(null==e?void 0:e.message)})}duration(e){return this._addCheck({kind:"duration",...w.errToObj(e)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...w.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:null==t?void 0:t.position,...w.errToObj(null==t?void 0:t.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...w.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...w.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...w.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...w.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...w.errToObj(t)})}nonempty(e){return this.min(1,w.errToObj(e))}trim(){return new J({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new J({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new J({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find((e=>"datetime"===e.kind))}get isDate(){return!!this._def.checks.find((e=>"date"===e.kind))}get isTime(){return!!this._def.checks.find((e=>"time"===e.kind))}get isDuration(){return!!this._def.checks.find((e=>"duration"===e.kind))}get isEmail(){return!!this._def.checks.find((e=>"email"===e.kind))}get isURL(){return!!this._def.checks.find((e=>"url"===e.kind))}get isEmoji(){return!!this._def.checks.find((e=>"emoji"===e.kind))}get isUUID(){return!!this._def.checks.find((e=>"uuid"===e.kind))}get isNANOID(){return!!this._def.checks.find((e=>"nanoid"===e.kind))}get isCUID(){return!!this._def.checks.find((e=>"cuid"===e.kind))}get isCUID2(){return!!this._def.checks.find((e=>"cuid2"===e.kind))}get isULID(){return!!this._def.checks.find((e=>"ulid"===e.kind))}get isIP(){return!!this._def.checks.find((e=>"ip"===e.kind))}get isCIDR(){return!!this._def.checks.find((e=>"cidr"===e.kind))}get isBase64(){return!!this._def.checks.find((e=>"base64"===e.kind))}get isBase64url(){return!!this._def.checks.find((e=>"base64url"===e.kind))}get minLength(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}}function Y(e,t){const n=(e.toString().split(".")[1]||"").length,r=(t.toString().split(".")[1]||"").length,a=n>r?n:r;return parseInt(e.toFixed(a).replace(".",""))%parseInt(t.toFixed(a).replace(".",""))/Math.pow(10,a)}J.create=e=>{var t;return new J({checks:[],typeName:De.ZodString,coerce:null!==(t=null==e?void 0:e.coerce)&&void 0!==t&&t,...E(e)})};class G extends O{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){this._def.coerce&&(t.data=Number(t.data));if(this._getType(t)!==n.number){const e=this._getOrReturnCtx(t);return u(e,{code:a.invalid_type,expected:n.number,received:e.parsedType}),p}let r;const s=new l;for(const n of this._def.checks)if("int"===n.kind)e.isInteger(t.data)||(r=this._getOrReturnCtx(t,r),u(r,{code:a.invalid_type,expected:"integer",received:"float",message:n.message}),s.dirty());else if("min"===n.kind){(n.inclusive?t.data<n.value:t.data<=n.value)&&(r=this._getOrReturnCtx(t,r),u(r,{code:a.too_small,minimum:n.value,type:"number",inclusive:n.inclusive,exact:!1,message:n.message}),s.dirty())}else if("max"===n.kind){(n.inclusive?t.data>n.value:t.data>=n.value)&&(r=this._getOrReturnCtx(t,r),u(r,{code:a.too_big,maximum:n.value,type:"number",inclusive:n.inclusive,exact:!1,message:n.message}),s.dirty())}else"multipleOf"===n.kind?0!==Y(t.data,n.value)&&(r=this._getOrReturnCtx(t,r),u(r,{code:a.not_multiple_of,multipleOf:n.value,message:n.message}),s.dirty()):"finite"===n.kind?Number.isFinite(t.data)||(r=this._getOrReturnCtx(t,r),u(r,{code:a.not_finite,message:n.message}),s.dirty()):e.assertNever(n);return{status:s.value,value:t.data}}gte(e,t){return this.setLimit("min",e,!0,w.toString(t))}gt(e,t){return this.setLimit("min",e,!1,w.toString(t))}lte(e,t){return this.setLimit("max",e,!0,w.toString(t))}lt(e,t){return this.setLimit("max",e,!1,w.toString(t))}setLimit(e,t,n,r){return new G({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:n,message:w.toString(r)}]})}_addCheck(e){return new G({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:w.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:w.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:w.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:w.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:w.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:w.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:w.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:w.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:w.toString(e)})}get minValue(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}get isInt(){return!!this._def.checks.find((t=>"int"===t.kind||"multipleOf"===t.kind&&e.isInteger(t.value)))}get isFinite(){let e=null,t=null;for(const n of this._def.checks){if("finite"===n.kind||"int"===n.kind||"multipleOf"===n.kind)return!0;"min"===n.kind?(null===t||n.value>t)&&(t=n.value):"max"===n.kind&&(null===e||n.value<e)&&(e=n.value)}return Number.isFinite(t)&&Number.isFinite(e)}}G.create=e=>new G({checks:[],typeName:De.ZodNumber,coerce:(null==e?void 0:e.coerce)||!1,...E(e)});class X extends O{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce)try{t.data=BigInt(t.data)}catch(i){return this._getInvalidInput(t)}if(this._getType(t)!==n.bigint)return this._getInvalidInput(t);let r;const s=new l;for(const n of this._def.checks)if("min"===n.kind){(n.inclusive?t.data<n.value:t.data<=n.value)&&(r=this._getOrReturnCtx(t,r),u(r,{code:a.too_small,type:"bigint",minimum:n.value,inclusive:n.inclusive,message:n.message}),s.dirty())}else if("max"===n.kind){(n.inclusive?t.data>n.value:t.data>=n.value)&&(r=this._getOrReturnCtx(t,r),u(r,{code:a.too_big,type:"bigint",maximum:n.value,inclusive:n.inclusive,message:n.message}),s.dirty())}else"multipleOf"===n.kind?t.data%n.value!==BigInt(0)&&(r=this._getOrReturnCtx(t,r),u(r,{code:a.not_multiple_of,multipleOf:n.value,message:n.message}),s.dirty()):e.assertNever(n);return{status:s.value,value:t.data}}_getInvalidInput(e){const t=this._getOrReturnCtx(e);return u(t,{code:a.invalid_type,expected:n.bigint,received:t.parsedType}),p}gte(e,t){return this.setLimit("min",e,!0,w.toString(t))}gt(e,t){return this.setLimit("min",e,!1,w.toString(t))}lte(e,t){return this.setLimit("max",e,!0,w.toString(t))}lt(e,t){return this.setLimit("max",e,!1,w.toString(t))}setLimit(e,t,n,r){return new X({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:n,message:w.toString(r)}]})}_addCheck(e){return new X({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:w.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:w.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:w.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:w.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:w.toString(t)})}get minValue(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}}X.create=e=>{var t;return new X({checks:[],typeName:De.ZodBigInt,coerce:null!==(t=null==e?void 0:e.coerce)&&void 0!==t&&t,...E(e)})};class Q extends O{_parse(e){this._def.coerce&&(e.data=Boolean(e.data));if(this._getType(e)!==n.boolean){const t=this._getOrReturnCtx(e);return u(t,{code:a.invalid_type,expected:n.boolean,received:t.parsedType}),p}return m(e.data)}}Q.create=e=>new Q({typeName:De.ZodBoolean,coerce:(null==e?void 0:e.coerce)||!1,...E(e)});class ee extends O{_parse(t){this._def.coerce&&(t.data=new Date(t.data));if(this._getType(t)!==n.date){const e=this._getOrReturnCtx(t);return u(e,{code:a.invalid_type,expected:n.date,received:e.parsedType}),p}if(isNaN(t.data.getTime())){return u(this._getOrReturnCtx(t),{code:a.invalid_date}),p}const r=new l;let s;for(const n of this._def.checks)"min"===n.kind?t.data.getTime()<n.value&&(s=this._getOrReturnCtx(t,s),u(s,{code:a.too_small,message:n.message,inclusive:!0,exact:!1,minimum:n.value,type:"date"}),r.dirty()):"max"===n.kind?t.data.getTime()>n.value&&(s=this._getOrReturnCtx(t,s),u(s,{code:a.too_big,message:n.message,inclusive:!0,exact:!1,maximum:n.value,type:"date"}),r.dirty()):e.assertNever(n);return{status:r.value,value:new Date(t.data.getTime())}}_addCheck(e){return new ee({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:w.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:w.toString(t)})}get minDate(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return null!=e?new Date(e):null}get maxDate(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return null!=e?new Date(e):null}}ee.create=e=>new ee({checks:[],coerce:(null==e?void 0:e.coerce)||!1,typeName:De.ZodDate,...E(e)});class te extends O{_parse(e){if(this._getType(e)!==n.symbol){const t=this._getOrReturnCtx(e);return u(t,{code:a.invalid_type,expected:n.symbol,received:t.parsedType}),p}return m(e.data)}}te.create=e=>new te({typeName:De.ZodSymbol,...E(e)});class ne extends O{_parse(e){if(this._getType(e)!==n.undefined){const t=this._getOrReturnCtx(e);return u(t,{code:a.invalid_type,expected:n.undefined,received:t.parsedType}),p}return m(e.data)}}ne.create=e=>new ne({typeName:De.ZodUndefined,...E(e)});class re extends O{_parse(e){if(this._getType(e)!==n.null){const t=this._getOrReturnCtx(e);return u(t,{code:a.invalid_type,expected:n.null,received:t.parsedType}),p}return m(e.data)}}re.create=e=>new re({typeName:De.ZodNull,...E(e)});class ae extends O{constructor(){super(...arguments),this._any=!0}_parse(e){return m(e.data)}}ae.create=e=>new ae({typeName:De.ZodAny,...E(e)});class se extends O{constructor(){super(...arguments),this._unknown=!0}_parse(e){return m(e.data)}}se.create=e=>new se({typeName:De.ZodUnknown,...E(e)});class ie extends O{_parse(e){const t=this._getOrReturnCtx(e);return u(t,{code:a.invalid_type,expected:n.never,received:t.parsedType}),p}}ie.create=e=>new ie({typeName:De.ZodNever,...E(e)});class oe extends O{_parse(e){if(this._getType(e)!==n.undefined){const t=this._getOrReturnCtx(e);return u(t,{code:a.invalid_type,expected:n.void,received:t.parsedType}),p}return m(e.data)}}oe.create=e=>new oe({typeName:De.ZodVoid,...E(e)});class de extends O{_parse(e){const{ctx:t,status:r}=this._processInputParams(e),s=this._def;if(t.parsedType!==n.array)return u(t,{code:a.invalid_type,expected:n.array,received:t.parsedType}),p;if(null!==s.exactLength){const e=t.data.length>s.exactLength.value,n=t.data.length<s.exactLength.value;(e||n)&&(u(t,{code:e?a.too_big:a.too_small,minimum:n?s.exactLength.value:void 0,maximum:e?s.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:s.exactLength.message}),r.dirty())}if(null!==s.minLength&&t.data.length<s.minLength.value&&(u(t,{code:a.too_small,minimum:s.minLength.value,type:"array",inclusive:!0,exact:!1,message:s.minLength.message}),r.dirty()),null!==s.maxLength&&t.data.length>s.maxLength.value&&(u(t,{code:a.too_big,maximum:s.maxLength.value,type:"array",inclusive:!0,exact:!1,message:s.maxLength.message}),r.dirty()),t.common.async)return Promise.all([...t.data].map(((e,n)=>s.type._parseAsync(new S(t,e,t.path,n))))).then((e=>l.mergeArray(r,e)));const i=[...t.data].map(((e,n)=>s.type._parseSync(new S(t,e,t.path,n))));return l.mergeArray(r,i)}get element(){return this._def.type}min(e,t){return new de({...this._def,minLength:{value:e,message:w.toString(t)}})}max(e,t){return new de({...this._def,maxLength:{value:e,message:w.toString(t)}})}length(e,t){return new de({...this._def,exactLength:{value:e,message:w.toString(t)}})}nonempty(e){return this.min(1,e)}}function ce(e){if(e instanceof ue){const t={};for(const n in e.shape){const r=e.shape[n];t[n]=Ze.create(ce(r))}return new ue({...e._def,shape:()=>t})}return e instanceof de?new de({...e._def,type:ce(e.element)}):e instanceof Ze?Ze.create(ce(e.unwrap())):e instanceof je?je.create(ce(e.unwrap())):e instanceof ye?ye.create(e.items.map((e=>ce(e)))):e}de.create=(e,t)=>new de({type:e,minLength:null,maxLength:null,exactLength:null,typeName:De.ZodArray,...E(t)});class ue extends O{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(null!==this._cached)return this._cached;const t=this._def.shape(),n=e.objectKeys(t);return this._cached={shape:t,keys:n}}_parse(e){if(this._getType(e)!==n.object){const t=this._getOrReturnCtx(e);return u(t,{code:a.invalid_type,expected:n.object,received:t.parsedType}),p}const{status:t,ctx:r}=this._processInputParams(e),{shape:s,keys:i}=this._getCached(),o=[];if(!(this._def.catchall instanceof ie&&"strip"===this._def.unknownKeys))for(const n in r.data)i.includes(n)||o.push(n);const d=[];for(const n of i){const e=s[n],t=r.data[n];d.push({key:{status:"valid",value:n},value:e._parse(new S(r,t,r.path,n)),alwaysSet:n in r.data})}if(this._def.catchall instanceof ie){const e=this._def.unknownKeys;if("passthrough"===e)for(const t of o)d.push({key:{status:"valid",value:t},value:{status:"valid",value:r.data[t]}});else if("strict"===e)o.length>0&&(u(r,{code:a.unrecognized_keys,keys:o}),t.dirty());else if("strip"!==e)throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const e=this._def.catchall;for(const t of o){const n=r.data[t];d.push({key:{status:"valid",value:t},value:e._parse(new S(r,n,r.path,t)),alwaysSet:t in r.data})}}return r.common.async?Promise.resolve().then((async()=>{const e=[];for(const t of d){const n=await t.key,r=await t.value;e.push({key:n,value:r,alwaysSet:t.alwaysSet})}return e})).then((e=>l.mergeObjectSync(t,e))):l.mergeObjectSync(t,d)}get shape(){return this._def.shape()}strict(e){return w.errToObj,new ue({...this._def,unknownKeys:"strict",...void 0!==e?{errorMap:(t,n)=>{var r,a,s,i;const o=null!==(s=null===(a=(r=this._def).errorMap)||void 0===a?void 0:a.call(r,t,n).message)&&void 0!==s?s:n.defaultError;return"unrecognized_keys"===t.code?{message:null!==(i=w.errToObj(e).message)&&void 0!==i?i:o}:{message:o}}}:{}})}strip(){return new ue({...this._def,unknownKeys:"strip"})}passthrough(){return new ue({...this._def,unknownKeys:"passthrough"})}extend(e){return new ue({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new ue({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:De.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new ue({...this._def,catchall:e})}pick(t){const n={};return e.objectKeys(t).forEach((e=>{t[e]&&this.shape[e]&&(n[e]=this.shape[e])})),new ue({...this._def,shape:()=>n})}omit(t){const n={};return e.objectKeys(this.shape).forEach((e=>{t[e]||(n[e]=this.shape[e])})),new ue({...this._def,shape:()=>n})}deepPartial(){return ce(this)}partial(t){const n={};return e.objectKeys(this.shape).forEach((e=>{const r=this.shape[e];t&&!t[e]?n[e]=r:n[e]=r.optional()})),new ue({...this._def,shape:()=>n})}required(t){const n={};return e.objectKeys(this.shape).forEach((e=>{if(t&&!t[e])n[e]=this.shape[e];else{let t=this.shape[e];for(;t instanceof Ze;)t=t._def.innerType;n[e]=t}})),new ue({...this._def,shape:()=>n})}keyof(){return xe(e.objectKeys(this.shape))}}ue.create=(e,t)=>new ue({shape:()=>e,unknownKeys:"strip",catchall:ie.create(),typeName:De.ZodObject,...E(t)}),ue.strictCreate=(e,t)=>new ue({shape:()=>e,unknownKeys:"strict",catchall:ie.create(),typeName:De.ZodObject,...E(t)}),ue.lazycreate=(e,t)=>new ue({shape:e,unknownKeys:"strip",catchall:ie.create(),typeName:De.ZodObject,...E(t)});class le extends O{_parse(e){const{ctx:t}=this._processInputParams(e),n=this._def.options;if(t.common.async)return Promise.all(n.map((async e=>{const n={...t,common:{...t.common,issues:[]},parent:null};return{result:await e._parseAsync({data:t.data,path:t.path,parent:n}),ctx:n}}))).then((function(e){for(const t of e)if("valid"===t.result.status)return t.result;for(const r of e)if("dirty"===r.result.status)return t.common.issues.push(...r.ctx.common.issues),r.result;const n=e.map((e=>new s(e.ctx.common.issues)));return u(t,{code:a.invalid_union,unionErrors:n}),p}));{let e;const r=[];for(const a of n){const n={...t,common:{...t.common,issues:[]},parent:null},s=a._parseSync({data:t.data,path:t.path,parent:n});if("valid"===s.status)return s;"dirty"!==s.status||e||(e={result:s,ctx:n}),n.common.issues.length&&r.push(n.common.issues)}if(e)return t.common.issues.push(...e.ctx.common.issues),e.result;const i=r.map((e=>new s(e)));return u(t,{code:a.invalid_union,unionErrors:i}),p}}get options(){return this._def.options}}le.create=(e,t)=>new le({options:e,typeName:De.ZodUnion,...E(t)});const pe=t=>t instanceof we?pe(t.schema):t instanceof Oe?pe(t.innerType()):t instanceof ke?[t.value]:t instanceof Se?t.options:t instanceof Te?e.objectValues(t.enum):t instanceof Ne?pe(t._def.innerType):t instanceof ne?[void 0]:t instanceof re?[null]:t instanceof Ze?[void 0,...pe(t.unwrap())]:t instanceof je?[null,...pe(t.unwrap())]:t instanceof Ie||t instanceof $e?pe(t.unwrap()):t instanceof Pe?pe(t._def.innerType):[];class he extends O{_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==n.object)return u(t,{code:a.invalid_type,expected:n.object,received:t.parsedType}),p;const r=this.discriminator,s=t.data[r],i=this.optionsMap.get(s);return i?t.common.async?i._parseAsync({data:t.data,path:t.path,parent:t}):i._parseSync({data:t.data,path:t.path,parent:t}):(u(t,{code:a.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),p)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,t,n){const r=new Map;for(const a of t){const t=pe(a.shape[e]);if(!t.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(const n of t){if(r.has(n))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(n)}`);r.set(n,a)}}return new he({typeName:De.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:r,...E(n)})}}function me(t,a){const s=r(t),i=r(a);if(t===a)return{valid:!0,data:t};if(s===n.object&&i===n.object){const n=e.objectKeys(a),r=e.objectKeys(t).filter((e=>-1!==n.indexOf(e))),s={...t,...a};for(const e of r){const n=me(t[e],a[e]);if(!n.valid)return{valid:!1};s[e]=n.data}return{valid:!0,data:s}}if(s===n.array&&i===n.array){if(t.length!==a.length)return{valid:!1};const e=[];for(let n=0;n<t.length;n++){const r=me(t[n],a[n]);if(!r.valid)return{valid:!1};e.push(r.data)}return{valid:!0,data:e}}return s===n.date&&i===n.date&&+t==+a?{valid:!0,data:t}:{valid:!1}}class fe extends O{_parse(e){const{status:t,ctx:n}=this._processInputParams(e),r=(e,r)=>{if(f(e)||f(r))return p;const s=me(e.value,r.value);return s.valid?((y(e)||y(r))&&t.dirty(),{status:t.value,value:s.data}):(u(n,{code:a.invalid_intersection_types}),p)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then((([e,t])=>r(e,t))):r(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}}fe.create=(e,t,n)=>new fe({left:e,right:t,typeName:De.ZodIntersection,...E(n)});class ye extends O{_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==n.array)return u(r,{code:a.invalid_type,expected:n.array,received:r.parsedType}),p;if(r.data.length<this._def.items.length)return u(r,{code:a.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),p;!this._def.rest&&r.data.length>this._def.items.length&&(u(r,{code:a.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());const s=[...r.data].map(((e,t)=>{const n=this._def.items[t]||this._def.rest;return n?n._parse(new S(r,e,r.path,t)):null})).filter((e=>!!e));return r.common.async?Promise.all(s).then((e=>l.mergeArray(t,e))):l.mergeArray(t,s)}get items(){return this._def.items}rest(e){return new ye({...this._def,rest:e})}}ye.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new ye({items:e,typeName:De.ZodTuple,rest:null,...E(t)})};class ge extends O{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==n.object)return u(r,{code:a.invalid_type,expected:n.object,received:r.parsedType}),p;const s=[],i=this._def.keyType,o=this._def.valueType;for(const n in r.data)s.push({key:i._parse(new S(r,n,r.path,n)),value:o._parse(new S(r,r.data[n],r.path,n)),alwaysSet:n in r.data});return r.common.async?l.mergeObjectAsync(t,s):l.mergeObjectSync(t,s)}get element(){return this._def.valueType}static create(e,t,n){return new ge(t instanceof O?{keyType:e,valueType:t,typeName:De.ZodRecord,...E(n)}:{keyType:J.create(),valueType:e,typeName:De.ZodRecord,...E(t)})}}class ve extends O{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==n.map)return u(r,{code:a.invalid_type,expected:n.map,received:r.parsedType}),p;const s=this._def.keyType,i=this._def.valueType,o=[...r.data.entries()].map((([e,t],n)=>({key:s._parse(new S(r,e,r.path,[n,"key"])),value:i._parse(new S(r,t,r.path,[n,"value"]))})));if(r.common.async){const e=new Map;return Promise.resolve().then((async()=>{for(const n of o){const r=await n.key,a=await n.value;if("aborted"===r.status||"aborted"===a.status)return p;"dirty"!==r.status&&"dirty"!==a.status||t.dirty(),e.set(r.value,a.value)}return{status:t.value,value:e}}))}{const e=new Map;for(const n of o){const r=n.key,a=n.value;if("aborted"===r.status||"aborted"===a.status)return p;"dirty"!==r.status&&"dirty"!==a.status||t.dirty(),e.set(r.value,a.value)}return{status:t.value,value:e}}}}ve.create=(e,t,n)=>new ve({valueType:t,keyType:e,typeName:De.ZodMap,...E(n)});class _e extends O{_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==n.set)return u(r,{code:a.invalid_type,expected:n.set,received:r.parsedType}),p;const s=this._def;null!==s.minSize&&r.data.size<s.minSize.value&&(u(r,{code:a.too_small,minimum:s.minSize.value,type:"set",inclusive:!0,exact:!1,message:s.minSize.message}),t.dirty()),null!==s.maxSize&&r.data.size>s.maxSize.value&&(u(r,{code:a.too_big,maximum:s.maxSize.value,type:"set",inclusive:!0,exact:!1,message:s.maxSize.message}),t.dirty());const i=this._def.valueType;function o(e){const n=new Set;for(const r of e){if("aborted"===r.status)return p;"dirty"===r.status&&t.dirty(),n.add(r.value)}return{status:t.value,value:n}}const d=[...r.data.values()].map(((e,t)=>i._parse(new S(r,e,r.path,t))));return r.common.async?Promise.all(d).then((e=>o(e))):o(d)}min(e,t){return new _e({...this._def,minSize:{value:e,message:w.toString(t)}})}max(e,t){return new _e({...this._def,maxSize:{value:e,message:w.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}}_e.create=(e,t)=>new _e({valueType:e,minSize:null,maxSize:null,typeName:De.ZodSet,...E(t)});class be extends O{constructor(){super(...arguments),this.validate=this.implement}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==n.function)return u(t,{code:a.invalid_type,expected:n.function,received:t.parsedType}),p;function r(e,n){return c({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,d(),i].filter((e=>!!e)),issueData:{code:a.invalid_arguments,argumentsError:n}})}function o(e,n){return c({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,d(),i].filter((e=>!!e)),issueData:{code:a.invalid_return_type,returnTypeError:n}})}const l={errorMap:t.common.contextualErrorMap},h=t.data;if(this._def.returns instanceof Ee){const e=this;return m((async function(...t){const n=new s([]),a=await e._def.args.parseAsync(t,l).catch((e=>{throw n.addIssue(r(t,e)),n})),i=await Reflect.apply(h,this,a);return await e._def.returns._def.type.parseAsync(i,l).catch((e=>{throw n.addIssue(o(i,e)),n}))}))}{const e=this;return m((function(...t){const n=e._def.args.safeParse(t,l);if(!n.success)throw new s([r(t,n.error)]);const a=Reflect.apply(h,this,n.data),i=e._def.returns.safeParse(a,l);if(!i.success)throw new s([o(a,i.error)]);return i.data}))}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new be({...this._def,args:ye.create(e).rest(se.create())})}returns(e){return new be({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,t,n){return new be({args:e||ye.create([]).rest(se.create()),returns:t||se.create(),typeName:De.ZodFunction,...E(n)})}}class we extends O{get schema(){return this._def.getter()}_parse(e){const{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}}we.create=(e,t)=>new we({getter:e,typeName:De.ZodLazy,...E(t)});class ke extends O{_parse(e){if(e.data!==this._def.value){const t=this._getOrReturnCtx(e);return u(t,{received:t.data,code:a.invalid_literal,expected:this._def.value}),p}return{status:"valid",value:e.data}}get value(){return this._def.value}}function xe(e,t){return new Se({values:e,typeName:De.ZodEnum,...E(t)})}ke.create=(e,t)=>new ke({value:e,typeName:De.ZodLiteral,...E(t)});class Se extends O{constructor(){super(...arguments),k.set(this,void 0)}_parse(t){if("string"!=typeof t.data){const n=this._getOrReturnCtx(t),r=this._def.values;return u(n,{expected:e.joinValues(r),received:n.parsedType,code:a.invalid_type}),p}if(_(this,k)||b(this,k,new Set(this._def.values)),!_(this,k).has(t.data)){const e=this._getOrReturnCtx(t),n=this._def.values;return u(e,{received:e.data,code:a.invalid_enum_value,options:n}),p}return m(t.data)}get options(){return this._def.values}get enum(){const e={};for(const t of this._def.values)e[t]=t;return e}get Values(){const e={};for(const t of this._def.values)e[t]=t;return e}get Enum(){const e={};for(const t of this._def.values)e[t]=t;return e}extract(e,t=this._def){return Se.create(e,{...this._def,...t})}exclude(e,t=this._def){return Se.create(this.options.filter((t=>!e.includes(t))),{...this._def,...t})}}k=new WeakMap,Se.create=xe;class Te extends O{constructor(){super(...arguments),x.set(this,void 0)}_parse(t){const r=e.getValidEnumValues(this._def.values),s=this._getOrReturnCtx(t);if(s.parsedType!==n.string&&s.parsedType!==n.number){const t=e.objectValues(r);return u(s,{expected:e.joinValues(t),received:s.parsedType,code:a.invalid_type}),p}if(_(this,x)||b(this,x,new Set(e.getValidEnumValues(this._def.values))),!_(this,x).has(t.data)){const t=e.objectValues(r);return u(s,{received:s.data,code:a.invalid_enum_value,options:t}),p}return m(t.data)}get enum(){return this._def.values}}x=new WeakMap,Te.create=(e,t)=>new Te({values:e,typeName:De.ZodNativeEnum,...E(t)});class Ee extends O{unwrap(){return this._def.type}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==n.promise&&!1===t.common.async)return u(t,{code:a.invalid_type,expected:n.promise,received:t.parsedType}),p;const r=t.parsedType===n.promise?t.data:Promise.resolve(t.data);return m(r.then((e=>this._def.type.parseAsync(e,{path:t.path,errorMap:t.common.contextualErrorMap}))))}}Ee.create=(e,t)=>new Ee({type:e,typeName:De.ZodPromise,...E(t)});class Oe extends O{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===De.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){const{status:n,ctx:r}=this._processInputParams(t),a=this._def.effect||null,s={addIssue:e=>{u(r,e),e.fatal?n.abort():n.dirty()},get path(){return r.path}};if(s.addIssue=s.addIssue.bind(s),"preprocess"===a.type){const e=a.transform(r.data,s);if(r.common.async)return Promise.resolve(e).then((async e=>{if("aborted"===n.value)return p;const t=await this._def.schema._parseAsync({data:e,path:r.path,parent:r});return"aborted"===t.status?p:"dirty"===t.status||"dirty"===n.value?h(t.value):t}));{if("aborted"===n.value)return p;const t=this._def.schema._parseSync({data:e,path:r.path,parent:r});return"aborted"===t.status?p:"dirty"===t.status||"dirty"===n.value?h(t.value):t}}if("refinement"===a.type){const e=e=>{const t=a.refinement(e,s);if(r.common.async)return Promise.resolve(t);if(t instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return e};if(!1===r.common.async){const t=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return"aborted"===t.status?p:("dirty"===t.status&&n.dirty(),e(t.value),{status:n.value,value:t.value})}return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then((t=>"aborted"===t.status?p:("dirty"===t.status&&n.dirty(),e(t.value).then((()=>({status:n.value,value:t.value}))))))}if("transform"===a.type){if(!1===r.common.async){const e=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!g(e))return e;const t=a.transform(e.value,s);if(t instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:t}}return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then((e=>g(e)?Promise.resolve(a.transform(e.value,s)).then((e=>({status:n.value,value:e}))):e))}e.assertNever(a)}}Oe.create=(e,t,n)=>new Oe({schema:e,typeName:De.ZodEffects,effect:t,...E(n)}),Oe.createWithPreprocess=(e,t,n)=>new Oe({schema:t,effect:{type:"preprocess",transform:e},typeName:De.ZodEffects,...E(n)});class Ze extends O{_parse(e){return this._getType(e)===n.undefined?m(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Ze.create=(e,t)=>new Ze({innerType:e,typeName:De.ZodOptional,...E(t)});class je extends O{_parse(e){return this._getType(e)===n.null?m(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}je.create=(e,t)=>new je({innerType:e,typeName:De.ZodNullable,...E(t)});class Ne extends O{_parse(e){const{ctx:t}=this._processInputParams(e);let r=t.data;return t.parsedType===n.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}Ne.create=(e,t)=>new Ne({innerType:e,typeName:De.ZodDefault,defaultValue:"function"==typeof t.default?t.default:()=>t.default,...E(t)});class Pe extends O{_parse(e){const{ctx:t}=this._processInputParams(e),n={...t,common:{...t.common,issues:[]}},r=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return v(r)?r.then((e=>({status:"valid",value:"valid"===e.status?e.value:this._def.catchValue({get error(){return new s(n.common.issues)},input:n.data})}))):{status:"valid",value:"valid"===r.status?r.value:this._def.catchValue({get error(){return new s(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}}Pe.create=(e,t)=>new Pe({innerType:e,typeName:De.ZodCatch,catchValue:"function"==typeof t.catch?t.catch:()=>t.catch,...E(t)});class Ae extends O{_parse(e){if(this._getType(e)!==n.nan){const t=this._getOrReturnCtx(e);return u(t,{code:a.invalid_type,expected:n.nan,received:t.parsedType}),p}return{status:"valid",value:e.data}}}Ae.create=e=>new Ae({typeName:De.ZodNaN,...E(e)});const Ce=Symbol("zod_brand");class Ie extends O{_parse(e){const{ctx:t}=this._processInputParams(e),n=t.data;return this._def.type._parse({data:n,path:t.path,parent:t})}unwrap(){return this._def.type}}class Re extends O{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.common.async){return(async()=>{const e=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return"aborted"===e.status?p:"dirty"===e.status?(t.dirty(),h(e.value)):this._def.out._parseAsync({data:e.value,path:n.path,parent:n})})()}{const e=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return"aborted"===e.status?p:"dirty"===e.status?(t.dirty(),{status:"dirty",value:e.value}):this._def.out._parseSync({data:e.value,path:n.path,parent:n})}}static create(e,t){return new Re({in:e,out:t,typeName:De.ZodPipeline})}}class $e extends O{_parse(e){const t=this._def.innerType._parse(e),n=e=>(g(e)&&(e.value=Object.freeze(e.value)),e);return v(t)?t.then((e=>n(e))):n(t)}unwrap(){return this._def.innerType}}function Fe(e,t){const n="function"==typeof e?e(t):"string"==typeof e?{message:e}:e;return"string"==typeof n?{message:n}:n}function Me(e,t={},n){return e?ae.create().superRefine(((r,a)=>{var s,i;const o=e(r);if(o instanceof Promise)return o.then((e=>{var s,i;if(!e){const e=Fe(t,r),o=null===(i=null!==(s=e.fatal)&&void 0!==s?s:n)||void 0===i||i;a.addIssue({code:"custom",...e,fatal:o})}}));if(!o){const e=Fe(t,r),o=null===(i=null!==(s=e.fatal)&&void 0!==s?s:n)||void 0===i||i;a.addIssue({code:"custom",...e,fatal:o})}})):ae.create()}$e.create=(e,t)=>new $e({innerType:e,typeName:De.ZodReadonly,...E(t)});const Le={object:ue.lazycreate};var De;!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"}(De||(De={}));const ze=J.create,qe=G.create,Ue=Ae.create,Ve=X.create,He=Q.create,Be=ee.create,We=te.create,Ke=ne.create,Je=re.create,Ye=ae.create,Ge=se.create,Xe=ie.create,Qe=oe.create,et=de.create,tt=ue.create,nt=ue.strictCreate,rt=le.create,at=he.create,st=fe.create,it=ye.create,ot=ge.create,dt=ve.create,ct=_e.create,ut=be.create,lt=we.create,pt=ke.create,ht=Se.create,mt=Te.create,ft=Ee.create,yt=Oe.create,gt=Ze.create,vt=je.create,_t=Oe.createWithPreprocess,bt=Re.create,wt={string:e=>J.create({...e,coerce:!0}),number:e=>G.create({...e,coerce:!0}),boolean:e=>Q.create({...e,coerce:!0}),bigint:e=>X.create({...e,coerce:!0}),date:e=>ee.create({...e,coerce:!0})},kt=p;var xt=Object.freeze({__proto__:null,defaultErrorMap:i,setErrorMap:function(e){o=e},getErrorMap:d,makeIssue:c,EMPTY_PATH:[],addIssueToContext:u,ParseStatus:l,INVALID:p,DIRTY:h,OK:m,isAborted:f,isDirty:y,isValid:g,isAsync:v,get util(){return e},get objectUtil(){return t},ZodParsedType:n,getParsedType:r,ZodType:O,datetimeRegex:B,ZodString:J,ZodNumber:G,ZodBigInt:X,ZodBoolean:Q,ZodDate:ee,ZodSymbol:te,ZodUndefined:ne,ZodNull:re,ZodAny:ae,ZodUnknown:se,ZodNever:ie,ZodVoid:oe,ZodArray:de,ZodObject:ue,ZodUnion:le,ZodDiscriminatedUnion:he,ZodIntersection:fe,ZodTuple:ye,ZodRecord:ge,ZodMap:ve,ZodSet:_e,ZodFunction:be,ZodLazy:we,ZodLiteral:ke,ZodEnum:Se,ZodNativeEnum:Te,ZodPromise:Ee,ZodEffects:Oe,ZodTransformer:Oe,ZodOptional:Ze,ZodNullable:je,ZodDefault:Ne,ZodCatch:Pe,ZodNaN:Ae,BRAND:Ce,ZodBranded:Ie,ZodPipeline:Re,ZodReadonly:$e,custom:Me,Schema:O,ZodSchema:O,late:Le,get ZodFirstPartyTypeKind(){return De},coerce:wt,any:Ye,array:et,bigint:Ve,boolean:He,date:Be,discriminatedUnion:at,effect:yt,enum:ht,function:ut,instanceof:(e,t={message:`Input not instance of ${e.name}`})=>Me((t=>t instanceof e),t),intersection:st,lazy:lt,literal:pt,map:dt,nan:Ue,nativeEnum:mt,never:Xe,null:Je,nullable:vt,number:qe,object:tt,oboolean:()=>He().optional(),onumber:()=>qe().optional(),optional:gt,ostring:()=>ze().optional(),pipeline:bt,preprocess:_t,promise:ft,record:ot,set:ct,strictObject:nt,string:ze,symbol:We,transformer:yt,tuple:it,undefined:Ke,union:rt,unknown:Ge,void:Qe,NEVER:kt,ZodIssueCode:a,quotelessJson:e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:"),ZodError:s});const St=xt.object({detail:xt.string()});function Tt(e){if(!e)return"Unknown error";if(e instanceof Error){const t=St.safeParse(e.cause);return t.success?t.data.detail:function(e){const t=function(e){try{return JSON.parse(e)}catch{return e}}(e);if(!t)return e;const n=St.safeParse(t);if(n.success)return n.data.detail;return e}(e.message)}if("object"==typeof e){const t=St.safeParse(e);if(t.success)return t.data.detail}try{return JSON.stringify(e)}catch{return String(e)}}const Et=1e3;function Ot(e,t){const n=e.map((e=>`"${e}"`)).join(", ");return new Error(`This RPC instance cannot ${t} because the transport did not provide one or more of these methods: ${n}`)}function Zt(e={}){let t={};function n(e){t=e}let r,a={};function s(e){a.unregisterHandler&&a.unregisterHandler(),a=e,a.registerHandler?.(_)}function i(e){r="function"!=typeof e?(t,n)=>{const r=e[t];if(r)return r(n);const a=e._;if(!a)throw new Error(`The requested method has no handler: ${t}`);return a(t,n)}:e}const{maxRequestTime:o=Et}=e;e.transport&&s(e.transport),e.requestHandler&&i(e.requestHandler),e._debugHooks&&n(e._debugHooks);let d=0;const c=new Map,u=new Map;function l(e,...n){const r=n[0];return new Promise(((n,s)=>{if(!a.send)throw Ot(["send"],"make requests");const i=d<=1e10?++d:d=0,l={type:"request",id:i,method:e,params:r};c.set(i,{resolve:n,reject:s}),o!==1/0&&u.set(i,setTimeout((()=>{u.delete(i),s(new Error("RPC request timed out."))}),o)),t.onSend?.(l),a.send(l)}))}const p=new Proxy(l,{get:(e,t,n)=>t in e?Reflect.get(e,t,n):e=>l(t,e)}),h=p;function m(e,...n){const r=n[0];if(!a.send)throw Ot(["send"],"send messages");const s={type:"message",id:e,payload:r};t.onSend?.(s),a.send(s)}const f=new Proxy(m,{get:(e,t,n)=>t in e?Reflect.get(e,t,n):e=>m(t,e)}),y=f,g=new Map,v=new Set;async function _(e){if(t.onReceive?.(e),!("type"in e))throw new Error("Message does not contain a type.");if("request"===e.type){if(!a.send||!r)throw Ot(["send","requestHandler"],"handle requests");const{id:s,method:i,params:o}=e;let d;try{d={type:"response",id:s,success:!0,payload:await r(i,o)}}catch(n){if(!(n instanceof Error))throw n;d={type:"response",id:s,success:!1,error:n.message}}return t.onSend?.(d),void a.send(d)}if("response"!==e.type){if("message"!==e.type)throw new Error(`Unexpected RPC message type: ${e.type}`);{for(const n of v)n(e.id,e.payload);const t=g.get(e.id);if(!t)return;for(const n of t)n(e.payload)}}else{const t=u.get(e.id);null!=t&&clearTimeout(t);const{resolve:n,reject:r}=c.get(e.id)??{};e.success?n?.(e.payload):r?.(new Error(e.error))}}return{setTransport:s,setRequestHandler:i,request:p,requestProxy:h,send:f,sendProxy:y,addMessageListener:function(e,t){if(!a.registerHandler)throw Ot(["registerHandler"],"register message listeners");"*"!==e?(g.has(e)||g.set(e,new Set),g.get(e)?.add(t)):v.add(t)},removeMessageListener:function(e,t){"*"!==e?(g.get(e)?.delete(t),0===g.get(e)?.size&&g.delete(e)):v.delete(t)},proxy:{send:y,request:h},_setDebugHooks:n}}const jt="[transport-id]";function Nt(e,t={}){const{transportId:n,filter:r,remotePort:a}=t,s=e,i=a??e;let o;return{send(e){i.postMessage(function(e,t){const{transportId:n}=t;return null!=n?{[jt]:n,data:e}:e}(e,{transportId:n}))},registerHandler(e){o=t=>{const a=t.data,[s,i]=function(e,t){const{transportId:n,filter:r}=t,a=r?.();if(null!=n&&null!=a)throw new Error("Cannot use both `transportId` and `filter` at the same time");let s=e;if(n){if(e[jt]!==n)return[!0];s=e.data}return!1===a?[!0]:[!1,s]}(a,{transportId:n,filter:()=>r?.(t)});s||e(i)},s.addEventListener("message",o)},unregisterHandler(){o&&s.removeEventListener("message",o)}}}function Pt(e,t){if(!e)throw new Error(t)}const At=()=>{},Ct=(e,t)=>{const n=`[${e}]`;return{debug:(...e)=>t.debug(n,...e),log:(...e)=>t.log(n,...e),warn:(...e)=>t.warn(n,...e),error:(...e)=>t.error(n,...e),trace:(...e)=>t.trace(n,...e),get:n=>Ct(`${e}.${n}`,t),disabled:(e=!0)=>e?Rt:t}},It={debug:(...e)=>{},log:(...e)=>{console.log(...e)},warn:(...e)=>{console.warn(...e)},error:(...e)=>{console.error(...e)},trace:(...e)=>{console.trace(...e)},get:e=>Ct(e,It),disabled:(e=!0)=>e?Rt:It},Rt={debug:()=>At,log:()=>At,warn:()=>At,error:()=>At,trace:()=>At,get:()=>Rt,disabled:()=>Rt};const $t="undefined"!=typeof window&&window.Logger||It,Ft=["normal","compact","medium","full","columns"],Mt=xt.object({completion:xt.object({activate_on_typing:xt.boolean().default(!0),copilot:xt.union([xt.boolean(),xt.enum(["github","codeium","custom"])]).default(!1).transform((e=>!0===e?"github":e)),codeium_api_key:xt.string().nullish()}).passthrough().default({}),save:xt.object({autosave:xt.enum(["off","after_delay"]).default("after_delay"),autosave_delay:xt.number().nonnegative().transform((e=>Math.max(e,1e3))).default(1e3),format_on_save:xt.boolean().default(!1)}).passthrough().default({}),formatting:xt.object({line_length:xt.number().nonnegative().default(79).transform((e=>Math.min(e,1e3)))}).passthrough().default({}),keymap:xt.object({preset:xt.enum(["default","vim"]).default("default"),overrides:xt.record(xt.string()).default({})}).passthrough().default({}),runtime:xt.object({auto_instantiate:xt.boolean().default(!0),on_cell_change:xt.enum(["lazy","autorun"]).default("autorun"),auto_reload:xt.enum(["off","lazy","autorun"]).default("off"),watcher_on_save:xt.enum(["lazy","autorun"]).default("lazy")}).passthrough().default({}),display:xt.object({theme:xt.enum(["light","dark","system"]).default("light"),code_editor_font_size:xt.number().nonnegative().default(14),cell_output:xt.enum(["above","below"]).default("above"),dataframes:xt.enum(["rich","plain"]).default("rich"),default_table_page_size:xt.number().default(10),default_width:xt.enum(Ft).default("medium").transform((e=>"normal"===e?"compact":e))}).passthrough().default({}),package_management:xt.object({manager:xt.enum(["pip","uv","rye","poetry","pixi"]).default("pip")}).passthrough().default({manager:"pip"}),ai:xt.object({rules:xt.string().default(""),open_ai:xt.object({api_key:xt.string().optional(),base_url:xt.string().optional(),model:xt.string().optional()}).optional(),anthropic:xt.object({api_key:xt.string().optional()}).optional(),google:xt.object({api_key:xt.string().optional()}).optional()}).passthrough().default({}),experimental:xt.object({markdown:xt.boolean().optional(),rtc:xt.boolean().optional()}).passthrough().default({}),server:xt.object({}).passthrough().default({})}).passthrough().default({completion:{},save:{},formatting:{},keymap:{},runtime:{},display:{},experimental:{},server:{},ai:{rules:"",open_ai:{}}}),Lt=xt.string(),Dt=xt.enum(["auto","native","polars","lazy-polars","pandas"]).default("auto");xt.object({width:xt.enum(Ft).default("medium").transform((e=>"normal"===e?"compact":e)),app_title:Lt.nullish(),css_file:xt.string().nullish(),html_head_file:xt.string().nullish(),auto_download:xt.array(xt.enum(["html","markdown","ipynb"])).default([]),sql_output:Dt}).default({width:"medium",auto_download:[]});var zt,qt=Object.defineProperty,Ut=(e,t)=>qt(e,"name",{value:t,configurable:!0}),Vt=(zt=function(e){if(typeof require<"u")return require.apply(this,arguments);throw new Error('Dynamic require of "'+e+'" is not supported')},typeof require<"u"?require:typeof Proxy<"u"?new Proxy(zt,{get:(e,t)=>(typeof require<"u"?require:e)[t]}):zt);function Ht(e){return!isNaN(parseFloat(e))&&isFinite(e)}function Bt(e){return e.charAt(0).toUpperCase()+e.substring(1)}function Wt(e){return function(){return this[e]}}Ut(Ht,"_isNumber"),Ut(Bt,"_capitalize"),Ut(Wt,"_getter");var Kt,Jt,Yt=["isConstructor","isEval","isNative","isToplevel"],Gt=["columnNumber","lineNumber"],Xt=["fileName","functionName","source"],Qt=Yt.concat(Gt,Xt,["args"],["evalOrigin"]);function en(e){if(e)for(var t=0;t<Qt.length;t++)void 0!==e[Qt[t]]&&this["set"+Bt(Qt[t])](e[Qt[t]])}for(Ut(en,"StackFrame"),en.prototype={getArgs:function(){return this.args},setArgs:function(e){if("[object Array]"!==Object.prototype.toString.call(e))throw new TypeError("Args must be an Array");this.args=e},getEvalOrigin:function(){return this.evalOrigin},setEvalOrigin:function(e){if(e instanceof en)this.evalOrigin=e;else{if(!(e instanceof Object))throw new TypeError("Eval Origin must be an Object or StackFrame");this.evalOrigin=new en(e)}},toString:function(){var e=this.getFileName()||"",t=this.getLineNumber()||"",n=this.getColumnNumber()||"",r=this.getFunctionName()||"";return this.getIsEval()?e?"[eval] ("+e+":"+t+":"+n+")":"[eval]:"+t+":"+n:r?r+" ("+e+":"+t+":"+n+")":e+":"+t+":"+n}},en.fromString=Ut((function(e){var t=e.indexOf("("),n=e.lastIndexOf(")"),r=e.substring(0,t),a=e.substring(t+1,n).split(","),s=e.substring(n+1);if(0===s.indexOf("@"))var i=/@(.+?)(?::(\d+))?(?::(\d+))?$/.exec(s,""),o=i[1],d=i[2],c=i[3];return new en({functionName:r,args:a||void 0,fileName:o,lineNumber:d||void 0,columnNumber:c||void 0})}),"StackFrame$$fromString"),Kt=0;Kt<Yt.length;Kt++)en.prototype["get"+Bt(Yt[Kt])]=Wt(Yt[Kt]),en.prototype["set"+Bt(Yt[Kt])]=function(e){return function(t){this[e]=!!t}}(Yt[Kt]);for(Jt=0;Jt<Gt.length;Jt++)en.prototype["get"+Bt(Gt[Jt])]=Wt(Gt[Jt]),en.prototype["set"+Bt(Gt[Jt])]=function(e){return function(t){if(!Ht(t))throw new TypeError(e+" must be a Number");this[e]=Number(t)}}(Gt[Jt]);for(tn=0;tn<Xt.length;tn++)en.prototype["get"+Bt(Xt[tn])]=Wt(Xt[tn]),en.prototype["set"+Bt(Xt[tn])]=function(e){return function(t){this[e]=String(t)}}(Xt[tn]);var tn,nn=en;function rn(){var e=/^\s*at .*(\S+:\d+|\(native\))/m,t=/^(eval@)?(\[native code])?$/;return{parse:Ut((function(t){if(t.stack&&t.stack.match(e))return this.parseV8OrIE(t);if(t.stack)return this.parseFFOrSafari(t);throw new Error("Cannot parse given Error object")}),"ErrorStackParser$$parse"),extractLocation:Ut((function(e){if(-1===e.indexOf(":"))return[e];var t=/(.+?)(?::(\d+))?(?::(\d+))?$/.exec(e.replace(/[()]/g,""));return[t[1],t[2]||void 0,t[3]||void 0]}),"ErrorStackParser$$extractLocation"),parseV8OrIE:Ut((function(t){return t.stack.split("\n").filter((function(t){return!!t.match(e)}),this).map((function(e){e.indexOf("(eval ")>-1&&(e=e.replace(/eval code/g,"eval").replace(/(\(eval at [^()]*)|(,.*$)/g,""));var t=e.replace(/^\s+/,"").replace(/\(eval code/g,"(").replace(/^.*?\s+/,""),n=t.match(/ (\(.+\)$)/);t=n?t.replace(n[0],""):t;var r=this.extractLocation(n?n[1]:t),a=n&&t||void 0,s=["eval","<anonymous>"].indexOf(r[0])>-1?void 0:r[0];return new nn({functionName:a,fileName:s,lineNumber:r[1],columnNumber:r[2],source:e})}),this)}),"ErrorStackParser$$parseV8OrIE"),parseFFOrSafari:Ut((function(e){return e.stack.split("\n").filter((function(e){return!e.match(t)}),this).map((function(e){if(e.indexOf(" > eval")>-1&&(e=e.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g,":$1")),-1===e.indexOf("@")&&-1===e.indexOf(":"))return new nn({functionName:e});var t=/((.*".+"[^@]*)?[^@]*)(?:@)/,n=e.match(t),r=n&&n[1]?n[1]:void 0,a=this.extractLocation(e.replace(t,""));return new nn({functionName:r,fileName:a[0],lineNumber:a[1],columnNumber:a[2],source:e})}),this)}),"ErrorStackParser$$parseFFOrSafari")}}Ut(rn,"ErrorStackParser");var an,sn,on,dn,cn,un,ln,pn,hn,mn=new rn,fn="object"==typeof process&&"object"==typeof process.versions&&"string"==typeof process.versions.node&&!process.browser,yn=fn&&typeof module<"u"&&typeof module.exports<"u"&&typeof Vt<"u"&&typeof __dirname<"u",gn=fn&&!yn,vn=typeof Deno<"u",_n=!fn&&!vn,bn=_n&&"object"==typeof window&&"object"==typeof document&&"function"==typeof document.createElement&&"sessionStorage"in window&&"function"!=typeof importScripts,wn=_n&&"function"==typeof importScripts&&"object"==typeof self;async function kn(){if(!fn||(an=(await import("./__vite-browser-external-CIEyP2s7.js")).default,dn=await import("./__vite-browser-external-CIEyP2s7.js"),cn=await import("./__vite-browser-external-CIEyP2s7.js"),on=(await import("./__vite-browser-external-CIEyP2s7.js")).default,sn=await import("./__vite-browser-external-CIEyP2s7.js"),ln=sn.sep,typeof Vt<"u"))return;let e={fs:dn,crypto:await import("./__vite-browser-external-CIEyP2s7.js"),ws:await import("./__vite-browser-external-CIEyP2s7.js"),child_process:await import("./__vite-browser-external-CIEyP2s7.js")};globalThis.require=function(t){return e[t]}}function xn(e,t){return sn.resolve(t||".",e)}function Sn(e,t){return void 0===t&&(t=location),new URL(e,t).toString()}function Tn(e,t){return e.startsWith("file://")&&(e=e.slice(7)),e.includes("://")?{response:fetch(e)}:{binary:cn.readFile(e).then((e=>new Uint8Array(e.buffer,e.byteOffset,e.byteLength)))}}function En(e,t){let n=new URL(e,location);return{response:fetch(n,t?{integrity:t}:{})}}async function On(e,t){let{response:n,binary:r}=pn(e,t);if(r)return r;let a=await n;if(!a.ok)throw new Error(`Failed to load '${e}': request failed.`);return new Uint8Array(await a.arrayBuffer())}if("object"==typeof navigator&&"string"==typeof navigator.userAgent&&-1==navigator.userAgent.indexOf("Chrome")&&navigator.userAgent.indexOf("Safari"),Ut(kn,"initNodeModules"),Ut(xn,"node_resolvePath"),Ut(Sn,"browser_resolvePath"),un=fn?xn:Sn,fn||(ln="/"),Ut(Tn,"node_getBinaryResponse"),Ut(En,"browser_getBinaryResponse"),pn=fn?Tn:En,Ut(On,"loadBinaryFile"),bn)hn=Ut((async e=>await import(e)),"loadScript");else if(wn)hn=Ut((async e=>{try{globalThis.importScripts(e)}catch(Xn){if(!(Xn instanceof TypeError))throw Xn;await import(e)}}),"loadScript");else{if(!fn)throw new Error("Cannot determine runtime environment");hn=Zn}async function Zn(e){e.startsWith("file://")&&(e=e.slice(7)),e.includes("://")?on.runInThisContext(await(await fetch(e)).text()):await import(an.pathToFileURL(e).href)}async function jn(e){if(fn){await kn();let t=await cn.readFile(e,{encoding:"utf8"});return JSON.parse(t)}return await(await fetch(e)).json()}async function Nn(){if(yn)return __dirname;let e;try{throw new Error}catch(r){e=r}let t=mn.parse(e)[0].fileName;if(fn&&!t.startsWith("file://")&&(t=`file://${t}`),gn){let e=await import("./__vite-browser-external-CIEyP2s7.js");return(await import("./__vite-browser-external-CIEyP2s7.js")).fileURLToPath(e.dirname(t))}let n=t.lastIndexOf(ln);if(-1===n)throw new Error("Could not extract indexURL path from pyodide module location");return t.slice(0,n)}function Pn(e){let t=e.FS,n=e.FS.filesystems.MEMFS,r=e.PATH,a={DIR_MODE:16895,FILE_MODE:33279,mount:function(e){if(!e.opts.fileSystemHandle)throw new Error("opts.fileSystemHandle is required");return n.mount.apply(null,arguments)},syncfs:async(e,t,n)=>{try{let r=a.getLocalSet(e),s=await a.getRemoteSet(e),i=t?s:r,o=t?r:s;await a.reconcile(e,i,o),n(null)}catch(r){n(r)}},getLocalSet:e=>{let n=Object.create(null);function a(e){return"."!==e&&".."!==e}function s(e){return t=>r.join2(e,t)}Ut(a,"isRealDir"),Ut(s,"toAbsolute");let i=t.readdir(e.mountpoint).filter(a).map(s(e.mountpoint));for(;i.length;){let e=i.pop(),r=t.stat(e);t.isDir(r.mode)&&i.push.apply(i,t.readdir(e).filter(a).map(s(e))),n[e]={timestamp:r.mtime,mode:r.mode}}return{type:"local",entries:n}},getRemoteSet:async e=>{let t=Object.create(null),n=await An(e.opts.fileSystemHandle);for(let[s,i]of n)"."!==s&&(t[r.join2(e.mountpoint,s)]={timestamp:"file"===i.kind?new Date((await i.getFile()).lastModified):new Date,mode:"file"===i.kind?a.FILE_MODE:a.DIR_MODE});return{type:"remote",entries:t,handles:n}},loadLocalEntry:e=>{let r=t.lookupPath(e).node,a=t.stat(e);if(t.isDir(a.mode))return{timestamp:a.mtime,mode:a.mode};if(t.isFile(a.mode))return r.contents=n.getFileDataAsTypedArray(r),{timestamp:a.mtime,mode:a.mode,contents:r.contents};throw new Error("node type not supported")},storeLocalEntry:(e,n)=>{if(t.isDir(n.mode))t.mkdirTree(e,n.mode);else{if(!t.isFile(n.mode))throw new Error("node type not supported");t.writeFile(e,n.contents,{canOwn:!0})}t.chmod(e,n.mode),t.utime(e,n.timestamp,n.timestamp)},removeLocalEntry:e=>{var n=t.stat(e);t.isDir(n.mode)?t.rmdir(e):t.isFile(n.mode)&&t.unlink(e)},loadRemoteEntry:async e=>{if("file"===e.kind){let t=await e.getFile();return{contents:new Uint8Array(await t.arrayBuffer()),mode:a.FILE_MODE,timestamp:new Date(t.lastModified)}}if("directory"===e.kind)return{mode:a.DIR_MODE,timestamp:new Date};throw new Error("unknown kind: "+e.kind)},storeRemoteEntry:async(e,n,a)=>{let s=e.get(r.dirname(n)),i=t.isFile(a.mode)?await s.getFileHandle(r.basename(n),{create:!0}):await s.getDirectoryHandle(r.basename(n),{create:!0});if("file"===i.kind){let e=await i.createWritable();await e.write(a.contents),await e.close()}e.set(n,i)},removeRemoteEntry:async(e,t)=>{await e.get(r.dirname(t)).removeEntry(r.basename(t)),e.delete(t)},reconcile:async(e,n,s)=>{let i=0,o=[];Object.keys(n.entries).forEach((function(e){let r=n.entries[e],a=s.entries[e];(!a||t.isFile(r.mode)&&r.timestamp.getTime()>a.timestamp.getTime())&&(o.push(e),i++)})),o.sort();let d=[];if(Object.keys(s.entries).forEach((function(e){n.entries[e]||(d.push(e),i++)})),d.sort().reverse(),!i)return;let c="remote"===n.type?n.handles:s.handles;for(let t of o){let n=r.normalize(t.replace(e.mountpoint,"/")).substring(1);if("local"===s.type){let e=c.get(n),r=await a.loadRemoteEntry(e);a.storeLocalEntry(t,r)}else{let e=a.loadLocalEntry(t);await a.storeRemoteEntry(c,n,e)}}for(let t of d)if("local"===s.type)a.removeLocalEntry(t);else{let n=r.normalize(t.replace(e.mountpoint,"/")).substring(1);await a.removeRemoteEntry(c,n)}}};e.FS.filesystems.NATIVEFS_ASYNC=a}Ut(Zn,"nodeLoadScript"),Ut(jn,"loadLockFile"),Ut(Nn,"calculateDirname"),Ut(Pn,"initializeNativeFS");var An=Ut((async e=>{let t=[];async function n(e){for await(let r of e.values())t.push(r),"directory"===r.kind&&await n(r)}Ut(n,"collect"),await n(e);let r=new Map;r.set(".",e);for(let a of t){let t=(await e.resolve(a)).join("/");r.set(t,a)}return r}),"getFsHandles");function Cn(e){let t={noImageDecoding:!0,noAudioDecoding:!0,noWasmDecoding:!1,preRun:Mn(e),quit(e,n){throw t.exited={status:e,toThrow:n},n},print:e.stdout,printErr:e.stderr,thisProgram:e._sysExecutable,arguments:e.args,API:{config:e},locateFile:t=>e.indexURL+t,instantiateWasm:Ln(e.indexURL)};return t}function In(e){return function(t){try{t.FS.mkdirTree(e)}catch(n){console.error(`Error occurred while making a home directory '${e}':`),console.error(n),console.error("Using '/' for a home directory instead"),e="/"}t.FS.chdir(e)}}function Rn(e){return function(t){Object.assign(t.ENV,e)}}function $n(e){return e?[async t=>{t.addRunDependency("fsInitHook");try{await e(t.FS,{sitePackages:t.API.sitePackages})}finally{t.removeRunDependency("fsInitHook")}}]:[]}function Fn(e){let t=On(e);return async e=>{let n=e._py_version_major(),r=e._py_version_minor();e.FS.mkdirTree("/lib"),e.API.sitePackages=`/lib/python${n}.${r}/site-packages`,e.FS.mkdirTree(e.API.sitePackages),e.addRunDependency("install-stdlib");try{let a=await t;e.FS.writeFile(`/lib/python${n}${r}.zip`,a)}catch(a){console.error("Error occurred while installing the standard library:"),console.error(a)}finally{e.removeRunDependency("install-stdlib")}}}function Mn(e){let t;return t=null!=e.stdLibURL?e.stdLibURL:e.indexURL+"python_stdlib.zip",[...$n(e.fsInit),Fn(t),In(e.env.HOME),Rn(e.env),Pn]}function Ln(e){if(typeof WasmOffsetConverter<"u")return;let{binary:t,response:n}=pn(e+"pyodide.asm.wasm");return function(e,r){return async function(){try{let a;a=n?await WebAssembly.instantiateStreaming(n,e):await WebAssembly.instantiate(await t,e);let{instance:s,module:i}=a;r(s,i)}catch(a){console.warn("wasm instantiation failed!"),console.warn(a)}}(),{}}}Ut(Cn,"createSettings"),Ut(In,"createHomeDirectory"),Ut(Rn,"setEnvironment"),Ut($n,"callFsInitHook"),Ut(Fn,"installStdlib"),Ut(Mn,"getFileSystemInitializationFuncs"),Ut(Ln,"getInstantiateWasmFunc");var Dn="0.27.5";async function zn(e={}){var t,n;await kn();let r=e.indexURL||await Nn();r=un(r),r.endsWith("/")||(r+="/"),e.indexURL=r;let a={fullStdLib:!1,jsglobals:globalThis,stdin:globalThis.prompt?globalThis.prompt:void 0,lockFileURL:r+"pyodide-lock.json",args:[],env:{},packageCacheDir:r,packages:[],enableRunUntilComplete:!1,checkAPIVersion:!0,BUILD_ID:"bd0388b62e760f8ba04185eb443fec955f25434f49c7b951efe5b1f792dbe5d4"},s=Object.assign(a,e);(t=s.env).HOME??(t.HOME="/home/pyodide"),(n=s.env).PYTHONINSPECT??(n.PYTHONINSPECT="1");let i,o=Cn(s),d=o.API;if(d.lockFilePromise=jn(s.lockFileURL),"function"!=typeof _createPyodideModule){let e=`${s.indexURL}pyodide.asm.js`;await hn(e)}if(e._loadSnapshot){let t=await e._loadSnapshot;i=ArrayBuffer.isView(t)?t:new Uint8Array(t),o.noInitialRun=!0,o.INITIAL_MEMORY=i.length}let c,u=await _createPyodideModule(o);if(o.exited)throw o.exited.toThrow;if(e.pyproxyToStringRepr&&d.setPyProxyToStringMethod(!0),d.version!==Dn&&s.checkAPIVersion)throw new Error(`Pyodide version does not match: '${Dn}' <==> '${d.version}'. If you updated the Pyodide version, make sure you also updated the 'indexURL' parameter passed to loadPyodide.`);u.locateFile=e=>{throw new Error("Didn't expect to load any more file_packager files!")},i&&(c=d.restoreSnapshot(i));let l=d.finalizeBootstrap(c,e._snapshotDeserializer);return d.sys.path.insert(0,d.config.env.HOME),l.version.includes("dev")||d.setCdnUrl(`https://cdn.jsdelivr.net/pyodide/v${l.version}/full/`),d._pyodide.set_excepthook(),await d.packageIndexReady,d.initializeStreams(s.stdin,s.stdout,s.stderr),l}function qn(e){return e.FS}Ut(zn,"loadPyodide");const Un=e=>(new TextDecoder).decode(e),Vn="notebook.py",Hn="/marimo",Bn=Vn,Wn=e=>{const t=qn(e);try{t.mkdirTree(Hn)}catch{}t.chdir(Hn)},Kn=e=>{qn(e).mount(e.FS.filesystems.IDBFS,{root:"."},Hn)},Jn=async e=>{await Gn(e,!0)},Yn=e=>{const{pyodide:t,filename:n,code:r}=e,a=qn(t);if(n&&n!==Vn){const e=(e=>{try{return Un(a.readFile(e))}catch{return null}})(n);if(e)return{code:e,filename:n}}return a.writeFile(Vn,r),{code:r,filename:Vn}};function Gn(e,t){return new Promise(((n,r)=>{qn(e).syncfs(t,(e=>{e instanceof Error?r(e):n()}))}))}const Xn=new class{constructor(){this.spans=[]}startSpan(e,t={}){const n={name:e,startTime:Date.now(),attributes:t,end:(e="ok")=>this.endSpan(n,e)};return this.spans.push(n),n}endSpan(e,t="ok"){e.endTime=Date.now(),e.status=t}getSpans(){return this.spans}wrap(e,t,n={}){const r=this.startSpan(t||e.name,n);try{const t=e();return this.endSpan(r),t}catch(a){throw this.endSpan(r,"error"),a}}wrapAsync(e,t,n={}){return async(...r)=>{const a=this.startSpan(t||e.name,n);try{const t=await e(...r);return this.endSpan(a),t}catch(s){throw this.endSpan(a,"error"),s}}}logSpans(){}};globalThis.t=Xn;class Qn{constructor(){this.pyodide=null}get requirePyodide(){return Pt(this.pyodide,"Pyodide not loaded"),this.pyodide}async bootstrap(e){return await this.loadPyodideAndPackages(e)}async loadPyodideAndPackages(e){if(!zn)throw new Error("loadPyodide is not defined");const t=Xn.startSpan("loadPyodide");try{const n=await zn({packages:["micropip","marimo-base","Markdown","pymdown-extensions","narwhals","packaging"],_makeSnapshot:false,lockFileURL:`https://wasm.marimo.app/pyodide-lock.json?v=${e.version}&pyodide=${e.pyodideVersion}`,indexURL:`https://cdn.jsdelivr.net/pyodide/${e.pyodideVersion}/full/`});return this.pyodide=n,t.end("ok"),n}catch(n){throw $t.error("Failed to load Pyodide",n),n}}async mountFilesystem(e){const t=Xn.startSpan("mountFilesystem");return Wn(this.requirePyodide),Kn(this.requirePyodide),await Jn(this.requirePyodide),t.end("ok"),Yn({pyodide:this.requirePyodide,code:e.code,filename:e.filename})}async startSession(e){const{code:t,filename:n,onMessage:r,queryParameters:a,userConfig:s}=e;self.messenger={callback:r},self.query_params=a,self.user_config=s;const i=Xn.startSpan("startSession.runPython"),o=n||Bn,[d,c,u]=this.requirePyodide.runPython(`\n print("[py] Starting marimo...")\n import asyncio\n import js\n from marimo._pyodide.bootstrap import create_session, instantiate\n\n assert js.messenger, "messenger is not defined"\n assert js.query_params, "query_params is not defined"\n\n session, bridge = create_session(\n filename="${o}",\n query_params=js.query_params.to_py(),\n message_callback=js.messenger.callback,\n user_config=js.user_config.to_py(),\n )\n\n def init(auto_instantiate=True):\n instantiate(session, auto_instantiate)\n asyncio.create_task(session.start())\n\n # Find the packages to install\n with open("${o}", "r") as f:\n packages = session.find_packages(f.read())\n\n bridge, init, packages`);i.end();const l=new Set(u.toJs());return this.loadNotebookDeps(t,l).then((()=>c(s.runtime.auto_instantiate))),d}async loadNotebookDeps(e,t){const n=this.requirePyodide;e.includes("mo.sql")&&(e=`import sqlglot\n${e=`import duckdb\n${e=`import pandas\n${e}`}`}`).includes("polars")&&(e=`import pyarrow\n${e}`),e=`import pyodide_http\n${e=`import jedi\n${e=`import pygments\n${e=`import docutils\n${e}`}`}`}`;const r=[...t];let a=Xn.startSpan("pyodide.loadPackage");await n.loadPackagesFromImports(e,{errorCallback:$t.error,messageCallback:$t.log}),a.end(),a=Xn.startSpan("micropip.install");const s=r.filter((e=>!n.loadedPackages[e]));s.length>0&&await n.runPythonAsync(`\n import micropip\n import sys\n # Filter out builtins\n missing = [p for p in ${JSON.stringify(s)} if p not in sys.modules]\n if len(missing) > 0:\n print("Loading from micropip:", missing)\n await micropip.install(missing)\n `).catch((e=>{$t.error("Failed to load packages from micropip",e)})),a.end()}}class er extends Qn{async bootstrap(e){return await super.bootstrap(e)}async mountFilesystem(e){const{code:t,filename:n}=e;try{return Wn(this.requirePyodide),Yn({pyodide:this.requirePyodide,code:t,filename:n})}catch(r){$t.error(r)}return{code:t,filename:n}}async startSession(e){return super.startSession({queryParameters:{},code:e.code,filename:e.filename,onMessage:e.onMessage,userConfig:Mt.parse({})})}}const tr=async function(){const e=self.name,t=function(e){return e.includes("dev"),`v${Dn}`}(e);try{self.controller=new er,self.pyodide=await self.controller.bootstrap({version:e,pyodideVersion:t})}catch(n){$t.error("Error bootstrapping",n),sr.send.initializedError({error:Tt(n)})}}(),nr=new class{constructor(e){this.onMessage=e,this.started=!1,this.push=e=>{this.started?this.onMessage(e):this.buffer.push(e)},this.start=()=>{this.started=!0,this.buffer.forEach((e=>this.onMessage(e))),this.buffer=[]},this.buffer=[]}}((e=>{sr.send.kernelMessage({message:e})})),rr=new class{constructor(){this.status="pending",this.promise=new Promise(((e,t)=>{this.reject=e=>{this.status="rejected",t(e)},this.resolve=t=>{this.status="resolved",e(t)}}))}},ar={startSession:async e=>{await tr;try{Pt(self.controller,"Controller not loaded");const t=await self.controller.mountFilesystem({code:e.code,filename:`app-${e.appId}.py`}),n=await self.controller.startSession({...t,onMessage:nr.push});rr.resolve(n),sr.send.initialized({})}catch(t){sr.send.initializedError({error:Tt(t)})}},loadPackages:async e=>{await tr,e.includes("mo.sql")&&(e=`import sqlglot\n${e=`import duckdb\n${e=`import pandas\n${e}`}`}`).includes("polars")&&(e=`import pyarrow\n${e}`),await self.pyodide.loadPackagesFromImports(e,{messageCallback:$t.log,errorCallback:$t.error})},bridge:async e=>{await tr;const{functionName:t,payload:n}=e,r=await rr.promise,a=null==n?null:"string"==typeof n?n:JSON.stringify(n),s=null==a?await r[t]():await r[t](a);return"string"==typeof s?JSON.parse(s):s}},sr=function(e){return Zt(e)}({transport:(ir={transportId:"marimo-transport"},Nt(self,ir)),requestHandler:ar});var ir;sr.send("ready",{}),sr.addMessageListener("consumerReady",(async()=>{await tr,nr.start()}));
|
|
1
|
+
var e,t;!function(e){e.assertEqual=e=>e,e.assertIs=function(e){},e.assertNever=function(e){throw new Error},e.arrayToEnum=e=>{const t={};for(const n of e)t[n]=n;return t},e.getValidEnumValues=t=>{const n=e.objectKeys(t).filter((e=>"number"!=typeof t[t[e]])),r={};for(const e of n)r[e]=t[e];return e.objectValues(r)},e.objectValues=t=>e.objectKeys(t).map((function(e){return t[e]})),e.objectKeys="function"==typeof Object.keys?e=>Object.keys(e):e=>{const t=[];for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.push(n);return t},e.find=(e,t)=>{for(const n of e)if(t(n))return n},e.isInteger="function"==typeof Number.isInteger?e=>Number.isInteger(e):e=>"number"==typeof e&&isFinite(e)&&Math.floor(e)===e,e.joinValues=function(e,t=" | "){return e.map((e=>"string"==typeof e?`'${e}'`:e)).join(t)},e.jsonStringifyReplacer=(e,t)=>"bigint"==typeof t?t.toString():t}(e||(e={})),function(e){e.mergeShapes=(e,t)=>({...e,...t})}(t||(t={}));const n=e.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),r=e=>{switch(typeof e){case"undefined":return n.undefined;case"string":return n.string;case"number":return isNaN(e)?n.nan:n.number;case"boolean":return n.boolean;case"function":return n.function;case"bigint":return n.bigint;case"symbol":return n.symbol;case"object":return Array.isArray(e)?n.array:null===e?n.null:e.then&&"function"==typeof e.then&&e.catch&&"function"==typeof e.catch?n.promise:"undefined"!=typeof Map&&e instanceof Map?n.map:"undefined"!=typeof Set&&e instanceof Set?n.set:"undefined"!=typeof Date&&e instanceof Date?n.date:n.object;default:return n.unknown}},a=e.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 s extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=e=>{this.issues=[...this.issues,e]},this.addIssues=(e=[])=>{this.issues=[...this.issues,...e]};const t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.issues=e}format(e){const t=e||function(e){return e.message},n={_errors:[]},r=e=>{for(const a of e.issues)if("invalid_union"===a.code)a.unionErrors.map(r);else if("invalid_return_type"===a.code)r(a.returnTypeError);else if("invalid_arguments"===a.code)r(a.argumentsError);else if(0===a.path.length)n._errors.push(t(a));else{let e=n,r=0;for(;r<a.path.length;){const n=a.path[r];r===a.path.length-1?(e[n]=e[n]||{_errors:[]},e[n]._errors.push(t(a))):e[n]=e[n]||{_errors:[]},e=e[n],r++}}};return r(this),n}static assert(e){if(!(e instanceof s))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,e.jsonStringifyReplacer,2)}get isEmpty(){return 0===this.issues.length}flatten(e=e=>e.message){const t={},n=[];for(const r of this.issues)r.path.length>0?(t[r.path[0]]=t[r.path[0]]||[],t[r.path[0]].push(e(r))):n.push(e(r));return{formErrors:n,fieldErrors:t}}get formErrors(){return this.flatten()}}s.create=e=>new s(e);const i=(t,r)=>{let s;switch(t.code){case a.invalid_type:s=t.received===n.undefined?"Required":`Expected ${t.expected}, received ${t.received}`;break;case a.invalid_literal:s=`Invalid literal value, expected ${JSON.stringify(t.expected,e.jsonStringifyReplacer)}`;break;case a.unrecognized_keys:s=`Unrecognized key(s) in object: ${e.joinValues(t.keys,", ")}`;break;case a.invalid_union:s="Invalid input";break;case a.invalid_union_discriminator:s=`Invalid discriminator value. Expected ${e.joinValues(t.options)}`;break;case a.invalid_enum_value:s=`Invalid enum value. Expected ${e.joinValues(t.options)}, received '${t.received}'`;break;case a.invalid_arguments:s="Invalid function arguments";break;case a.invalid_return_type:s="Invalid function return type";break;case a.invalid_date:s="Invalid date";break;case a.invalid_string:"object"==typeof t.validation?"includes"in t.validation?(s=`Invalid input: must include "${t.validation.includes}"`,"number"==typeof t.validation.position&&(s=`${s} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?s=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?s=`Invalid input: must end with "${t.validation.endsWith}"`:e.assertNever(t.validation):s="regex"!==t.validation?`Invalid ${t.validation}`:"Invalid";break;case a.too_small:s="array"===t.type?`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:"string"===t.type?`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:"number"===t.type?`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:"date"===t.type?`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:"Invalid input";break;case a.too_big:s="array"===t.type?`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:"string"===t.type?`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:"number"===t.type?`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:"bigint"===t.type?`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:"date"===t.type?`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:"Invalid input";break;case a.custom:s="Invalid input";break;case a.invalid_intersection_types:s="Intersection results could not be merged";break;case a.not_multiple_of:s=`Number must be a multiple of ${t.multipleOf}`;break;case a.not_finite:s="Number must be finite";break;default:s=r.defaultError,e.assertNever(t)}return{message:s}};let o=i;function d(){return o}const c=e=>{const{data:t,path:n,errorMaps:r,issueData:a}=e,s=[...n,...a.path||[]],i={...a,path:s};if(void 0!==a.message)return{...a,path:s,message:a.message};let o="";const d=r.filter((e=>!!e)).slice().reverse();for(const c of d)o=c(i,{data:t,defaultError:o}).message;return{...a,path:s,message:o}};function u(e,t){const n=d(),r=c({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,n,n===i?void 0:i].filter((e=>!!e))});e.common.issues.push(r)}class l{constructor(){this.value="valid"}dirty(){"valid"===this.value&&(this.value="dirty")}abort(){"aborted"!==this.value&&(this.value="aborted")}static mergeArray(e,t){const n=[];for(const r of t){if("aborted"===r.status)return p;"dirty"===r.status&&e.dirty(),n.push(r.value)}return{status:e.value,value:n}}static async mergeObjectAsync(e,t){const n=[];for(const r of t){const e=await r.key,t=await r.value;n.push({key:e,value:t})}return l.mergeObjectSync(e,n)}static mergeObjectSync(e,t){const n={};for(const r of t){const{key:t,value:a}=r;if("aborted"===t.status)return p;if("aborted"===a.status)return p;"dirty"===t.status&&e.dirty(),"dirty"===a.status&&e.dirty(),"__proto__"===t.value||void 0===a.value&&!r.alwaysSet||(n[t.value]=a.value)}return{status:e.value,value:n}}}const p=Object.freeze({status:"aborted"}),h=e=>({status:"dirty",value:e}),m=e=>({status:"valid",value:e}),f=e=>"aborted"===e.status,y=e=>"dirty"===e.status,g=e=>"valid"===e.status,v=e=>"undefined"!=typeof Promise&&e instanceof Promise;function _(e,t,n,r){if("function"==typeof t||!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t.get(e)}function b(e,t,n,r,a){if("function"==typeof t||!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return t.set(e,n),n}var w,k,x;"function"==typeof SuppressedError&&SuppressedError,function(e){e.errToObj=e=>"string"==typeof e?{message:e}:e||{},e.toString=e=>"string"==typeof e?e:null==e?void 0:e.message}(w||(w={}));class S{constructor(e,t,n,r){this._cachedPath=[],this.parent=e,this.data=t,this._path=n,this._key=r}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const T=(e,t)=>{if(g(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const t=new s(e.common.issues);return this._error=t,this._error}}};function E(e){if(!e)return{};const{errorMap:t,invalid_type_error:n,required_error:r,description:a}=e;if(t&&(n||r))throw new Error('Can\'t use "invalid_type_error" or "required_error" in conjunction with custom error map.');if(t)return{errorMap:t,description:a};return{errorMap:(t,a)=>{var s,i;const{message:o}=e;return"invalid_enum_value"===t.code?{message:null!=o?o:a.defaultError}:void 0===a.data?{message:null!==(s=null!=o?o:r)&&void 0!==s?s:a.defaultError}:"invalid_type"!==t.code?{message:a.defaultError}:{message:null!==(i=null!=o?o:n)&&void 0!==i?i:a.defaultError}},description:a}}class O{get description(){return this._def.description}_getType(e){return r(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:r(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new l,ctx:{common:e.parent.common,data:e.data,parsedType:r(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const t=this._parse(e);if(v(t))throw new Error("Synchronous parse encountered promise.");return t}_parseAsync(e){const t=this._parse(e);return Promise.resolve(t)}parse(e,t){const n=this.safeParse(e,t);if(n.success)return n.data;throw n.error}safeParse(e,t){var n;const a={common:{issues:[],async:null!==(n=null==t?void 0:t.async)&&void 0!==n&&n,contextualErrorMap:null==t?void 0:t.errorMap},path:(null==t?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:r(e)},s=this._parseSync({data:e,path:a.path,parent:a});return T(a,s)}"~validate"(e){var t,n;const a={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:r(e)};if(!this["~standard"].async)try{const t=this._parseSync({data:e,path:[],parent:a});return g(t)?{value:t.value}:{issues:a.common.issues}}catch(s){(null===(n=null===(t=null==s?void 0:s.message)||void 0===t?void 0:t.toLowerCase())||void 0===n?void 0:n.includes("encountered"))&&(this["~standard"].async=!0),a.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:a}).then((e=>g(e)?{value:e.value}:{issues:a.common.issues}))}async parseAsync(e,t){const n=await this.safeParseAsync(e,t);if(n.success)return n.data;throw n.error}async safeParseAsync(e,t){const n={common:{issues:[],contextualErrorMap:null==t?void 0:t.errorMap,async:!0},path:(null==t?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:r(e)},a=this._parse({data:e,path:n.path,parent:n}),s=await(v(a)?a:Promise.resolve(a));return T(n,s)}refine(e,t){const n=e=>"string"==typeof t||void 0===t?{message:t}:"function"==typeof t?t(e):t;return this._refinement(((t,r)=>{const s=e(t),i=()=>r.addIssue({code:a.custom,...n(t)});return"undefined"!=typeof Promise&&s instanceof Promise?s.then((e=>!!e||(i(),!1))):!!s||(i(),!1)}))}refinement(e,t){return this._refinement(((n,r)=>!!e(n)||(r.addIssue("function"==typeof t?t(n,r):t),!1)))}_refinement(e){return new Oe({schema:this,typeName:De.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:e=>this["~validate"](e)}}optional(){return Ze.create(this,this._def)}nullable(){return je.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return de.create(this)}promise(){return Ee.create(this,this._def)}or(e){return le.create([this,e],this._def)}and(e){return fe.create(this,e,this._def)}transform(e){return new Oe({...E(this._def),schema:this,typeName:De.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const t="function"==typeof e?e:()=>e;return new Ne({...E(this._def),innerType:this,defaultValue:t,typeName:De.ZodDefault})}brand(){return new Ie({typeName:De.ZodBranded,type:this,...E(this._def)})}catch(e){const t="function"==typeof e?e:()=>e;return new Pe({...E(this._def),innerType:this,catchValue:t,typeName:De.ZodCatch})}describe(e){return new(0,this.constructor)({...this._def,description:e})}pipe(e){return Re.create(this,e)}readonly(){return $e.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const Z=/^c[^\s-]{8,}$/i,j=/^[0-9a-z]+$/,N=/^[0-9A-HJKMNP-TV-Z]{26}$/i,P=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,A=/^[a-z0-9_-]{21}$/i,C=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,I=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,R=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i;let $;const F=/^(?:(?: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])$/,M=/^(?:(?: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])$/,L=/^(([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]))$/,D=/^(([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])$/,z=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,q=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,U="((\\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])))",V=new RegExp(`^${U}$`);function H(e){let t="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return e.precision?t=`${t}\\.\\d{${e.precision}}`:null==e.precision&&(t=`${t}(\\.\\d+)?`),t}function B(e){let t=`${U}T${H(e)}`;const n=[];return n.push(e.local?"Z?":"Z"),e.offset&&n.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${n.join("|")})`,new RegExp(`^${t}$`)}function W(e,t){if(!C.test(e))return!1;try{const[n]=e.split("."),r=n.replace(/-/g,"+").replace(/_/g,"/").padEnd(n.length+(4-n.length%4)%4,"="),a=JSON.parse(atob(r));return"object"==typeof a&&null!==a&&(!(!a.typ||!a.alg)&&(!t||a.alg===t))}catch(n){return!1}}function K(e,t){return!("v4"!==t&&t||!M.test(e))||!("v6"!==t&&t||!D.test(e))}class J extends O{_parse(t){this._def.coerce&&(t.data=String(t.data));if(this._getType(t)!==n.string){const e=this._getOrReturnCtx(t);return u(e,{code:a.invalid_type,expected:n.string,received:e.parsedType}),p}const r=new l;let s;for(const n of this._def.checks)if("min"===n.kind)t.data.length<n.value&&(s=this._getOrReturnCtx(t,s),u(s,{code:a.too_small,minimum:n.value,type:"string",inclusive:!0,exact:!1,message:n.message}),r.dirty());else if("max"===n.kind)t.data.length>n.value&&(s=this._getOrReturnCtx(t,s),u(s,{code:a.too_big,maximum:n.value,type:"string",inclusive:!0,exact:!1,message:n.message}),r.dirty());else if("length"===n.kind){const e=t.data.length>n.value,i=t.data.length<n.value;(e||i)&&(s=this._getOrReturnCtx(t,s),e?u(s,{code:a.too_big,maximum:n.value,type:"string",inclusive:!0,exact:!0,message:n.message}):i&&u(s,{code:a.too_small,minimum:n.value,type:"string",inclusive:!0,exact:!0,message:n.message}),r.dirty())}else if("email"===n.kind)R.test(t.data)||(s=this._getOrReturnCtx(t,s),u(s,{validation:"email",code:a.invalid_string,message:n.message}),r.dirty());else if("emoji"===n.kind)$||($=new RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),$.test(t.data)||(s=this._getOrReturnCtx(t,s),u(s,{validation:"emoji",code:a.invalid_string,message:n.message}),r.dirty());else if("uuid"===n.kind)P.test(t.data)||(s=this._getOrReturnCtx(t,s),u(s,{validation:"uuid",code:a.invalid_string,message:n.message}),r.dirty());else if("nanoid"===n.kind)A.test(t.data)||(s=this._getOrReturnCtx(t,s),u(s,{validation:"nanoid",code:a.invalid_string,message:n.message}),r.dirty());else if("cuid"===n.kind)Z.test(t.data)||(s=this._getOrReturnCtx(t,s),u(s,{validation:"cuid",code:a.invalid_string,message:n.message}),r.dirty());else if("cuid2"===n.kind)j.test(t.data)||(s=this._getOrReturnCtx(t,s),u(s,{validation:"cuid2",code:a.invalid_string,message:n.message}),r.dirty());else if("ulid"===n.kind)N.test(t.data)||(s=this._getOrReturnCtx(t,s),u(s,{validation:"ulid",code:a.invalid_string,message:n.message}),r.dirty());else if("url"===n.kind)try{new URL(t.data)}catch(d){s=this._getOrReturnCtx(t,s),u(s,{validation:"url",code:a.invalid_string,message:n.message}),r.dirty()}else if("regex"===n.kind){n.regex.lastIndex=0;n.regex.test(t.data)||(s=this._getOrReturnCtx(t,s),u(s,{validation:"regex",code:a.invalid_string,message:n.message}),r.dirty())}else if("trim"===n.kind)t.data=t.data.trim();else if("includes"===n.kind)t.data.includes(n.value,n.position)||(s=this._getOrReturnCtx(t,s),u(s,{code:a.invalid_string,validation:{includes:n.value,position:n.position},message:n.message}),r.dirty());else if("toLowerCase"===n.kind)t.data=t.data.toLowerCase();else if("toUpperCase"===n.kind)t.data=t.data.toUpperCase();else if("startsWith"===n.kind)t.data.startsWith(n.value)||(s=this._getOrReturnCtx(t,s),u(s,{code:a.invalid_string,validation:{startsWith:n.value},message:n.message}),r.dirty());else if("endsWith"===n.kind)t.data.endsWith(n.value)||(s=this._getOrReturnCtx(t,s),u(s,{code:a.invalid_string,validation:{endsWith:n.value},message:n.message}),r.dirty());else if("datetime"===n.kind){B(n).test(t.data)||(s=this._getOrReturnCtx(t,s),u(s,{code:a.invalid_string,validation:"datetime",message:n.message}),r.dirty())}else if("date"===n.kind){V.test(t.data)||(s=this._getOrReturnCtx(t,s),u(s,{code:a.invalid_string,validation:"date",message:n.message}),r.dirty())}else if("time"===n.kind){new RegExp(`^${H(n)}$`).test(t.data)||(s=this._getOrReturnCtx(t,s),u(s,{code:a.invalid_string,validation:"time",message:n.message}),r.dirty())}else"duration"===n.kind?I.test(t.data)||(s=this._getOrReturnCtx(t,s),u(s,{validation:"duration",code:a.invalid_string,message:n.message}),r.dirty()):"ip"===n.kind?(i=t.data,("v4"!==(o=n.version)&&o||!F.test(i))&&("v6"!==o&&o||!L.test(i))&&(s=this._getOrReturnCtx(t,s),u(s,{validation:"ip",code:a.invalid_string,message:n.message}),r.dirty())):"jwt"===n.kind?W(t.data,n.alg)||(s=this._getOrReturnCtx(t,s),u(s,{validation:"jwt",code:a.invalid_string,message:n.message}),r.dirty()):"cidr"===n.kind?K(t.data,n.version)||(s=this._getOrReturnCtx(t,s),u(s,{validation:"cidr",code:a.invalid_string,message:n.message}),r.dirty()):"base64"===n.kind?z.test(t.data)||(s=this._getOrReturnCtx(t,s),u(s,{validation:"base64",code:a.invalid_string,message:n.message}),r.dirty()):"base64url"===n.kind?q.test(t.data)||(s=this._getOrReturnCtx(t,s),u(s,{validation:"base64url",code:a.invalid_string,message:n.message}),r.dirty()):e.assertNever(n);var i,o;return{status:r.value,value:t.data}}_regex(e,t,n){return this.refinement((t=>e.test(t)),{validation:t,code:a.invalid_string,...w.errToObj(n)})}_addCheck(e){return new J({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...w.errToObj(e)})}url(e){return this._addCheck({kind:"url",...w.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...w.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...w.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...w.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...w.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...w.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...w.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...w.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...w.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...w.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...w.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...w.errToObj(e)})}datetime(e){var t,n;return"string"==typeof e?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:void 0===(null==e?void 0:e.precision)?null:null==e?void 0:e.precision,offset:null!==(t=null==e?void 0:e.offset)&&void 0!==t&&t,local:null!==(n=null==e?void 0:e.local)&&void 0!==n&&n,...w.errToObj(null==e?void 0:e.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return"string"==typeof e?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:void 0===(null==e?void 0:e.precision)?null:null==e?void 0:e.precision,...w.errToObj(null==e?void 0:e.message)})}duration(e){return this._addCheck({kind:"duration",...w.errToObj(e)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...w.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:null==t?void 0:t.position,...w.errToObj(null==t?void 0:t.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...w.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...w.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...w.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...w.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...w.errToObj(t)})}nonempty(e){return this.min(1,w.errToObj(e))}trim(){return new J({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new J({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new J({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find((e=>"datetime"===e.kind))}get isDate(){return!!this._def.checks.find((e=>"date"===e.kind))}get isTime(){return!!this._def.checks.find((e=>"time"===e.kind))}get isDuration(){return!!this._def.checks.find((e=>"duration"===e.kind))}get isEmail(){return!!this._def.checks.find((e=>"email"===e.kind))}get isURL(){return!!this._def.checks.find((e=>"url"===e.kind))}get isEmoji(){return!!this._def.checks.find((e=>"emoji"===e.kind))}get isUUID(){return!!this._def.checks.find((e=>"uuid"===e.kind))}get isNANOID(){return!!this._def.checks.find((e=>"nanoid"===e.kind))}get isCUID(){return!!this._def.checks.find((e=>"cuid"===e.kind))}get isCUID2(){return!!this._def.checks.find((e=>"cuid2"===e.kind))}get isULID(){return!!this._def.checks.find((e=>"ulid"===e.kind))}get isIP(){return!!this._def.checks.find((e=>"ip"===e.kind))}get isCIDR(){return!!this._def.checks.find((e=>"cidr"===e.kind))}get isBase64(){return!!this._def.checks.find((e=>"base64"===e.kind))}get isBase64url(){return!!this._def.checks.find((e=>"base64url"===e.kind))}get minLength(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}}function Y(e,t){const n=(e.toString().split(".")[1]||"").length,r=(t.toString().split(".")[1]||"").length,a=n>r?n:r;return parseInt(e.toFixed(a).replace(".",""))%parseInt(t.toFixed(a).replace(".",""))/Math.pow(10,a)}J.create=e=>{var t;return new J({checks:[],typeName:De.ZodString,coerce:null!==(t=null==e?void 0:e.coerce)&&void 0!==t&&t,...E(e)})};class G extends O{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){this._def.coerce&&(t.data=Number(t.data));if(this._getType(t)!==n.number){const e=this._getOrReturnCtx(t);return u(e,{code:a.invalid_type,expected:n.number,received:e.parsedType}),p}let r;const s=new l;for(const n of this._def.checks)if("int"===n.kind)e.isInteger(t.data)||(r=this._getOrReturnCtx(t,r),u(r,{code:a.invalid_type,expected:"integer",received:"float",message:n.message}),s.dirty());else if("min"===n.kind){(n.inclusive?t.data<n.value:t.data<=n.value)&&(r=this._getOrReturnCtx(t,r),u(r,{code:a.too_small,minimum:n.value,type:"number",inclusive:n.inclusive,exact:!1,message:n.message}),s.dirty())}else if("max"===n.kind){(n.inclusive?t.data>n.value:t.data>=n.value)&&(r=this._getOrReturnCtx(t,r),u(r,{code:a.too_big,maximum:n.value,type:"number",inclusive:n.inclusive,exact:!1,message:n.message}),s.dirty())}else"multipleOf"===n.kind?0!==Y(t.data,n.value)&&(r=this._getOrReturnCtx(t,r),u(r,{code:a.not_multiple_of,multipleOf:n.value,message:n.message}),s.dirty()):"finite"===n.kind?Number.isFinite(t.data)||(r=this._getOrReturnCtx(t,r),u(r,{code:a.not_finite,message:n.message}),s.dirty()):e.assertNever(n);return{status:s.value,value:t.data}}gte(e,t){return this.setLimit("min",e,!0,w.toString(t))}gt(e,t){return this.setLimit("min",e,!1,w.toString(t))}lte(e,t){return this.setLimit("max",e,!0,w.toString(t))}lt(e,t){return this.setLimit("max",e,!1,w.toString(t))}setLimit(e,t,n,r){return new G({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:n,message:w.toString(r)}]})}_addCheck(e){return new G({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:w.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:w.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:w.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:w.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:w.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:w.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:w.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:w.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:w.toString(e)})}get minValue(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}get isInt(){return!!this._def.checks.find((t=>"int"===t.kind||"multipleOf"===t.kind&&e.isInteger(t.value)))}get isFinite(){let e=null,t=null;for(const n of this._def.checks){if("finite"===n.kind||"int"===n.kind||"multipleOf"===n.kind)return!0;"min"===n.kind?(null===t||n.value>t)&&(t=n.value):"max"===n.kind&&(null===e||n.value<e)&&(e=n.value)}return Number.isFinite(t)&&Number.isFinite(e)}}G.create=e=>new G({checks:[],typeName:De.ZodNumber,coerce:(null==e?void 0:e.coerce)||!1,...E(e)});class X extends O{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce)try{t.data=BigInt(t.data)}catch(i){return this._getInvalidInput(t)}if(this._getType(t)!==n.bigint)return this._getInvalidInput(t);let r;const s=new l;for(const n of this._def.checks)if("min"===n.kind){(n.inclusive?t.data<n.value:t.data<=n.value)&&(r=this._getOrReturnCtx(t,r),u(r,{code:a.too_small,type:"bigint",minimum:n.value,inclusive:n.inclusive,message:n.message}),s.dirty())}else if("max"===n.kind){(n.inclusive?t.data>n.value:t.data>=n.value)&&(r=this._getOrReturnCtx(t,r),u(r,{code:a.too_big,type:"bigint",maximum:n.value,inclusive:n.inclusive,message:n.message}),s.dirty())}else"multipleOf"===n.kind?t.data%n.value!==BigInt(0)&&(r=this._getOrReturnCtx(t,r),u(r,{code:a.not_multiple_of,multipleOf:n.value,message:n.message}),s.dirty()):e.assertNever(n);return{status:s.value,value:t.data}}_getInvalidInput(e){const t=this._getOrReturnCtx(e);return u(t,{code:a.invalid_type,expected:n.bigint,received:t.parsedType}),p}gte(e,t){return this.setLimit("min",e,!0,w.toString(t))}gt(e,t){return this.setLimit("min",e,!1,w.toString(t))}lte(e,t){return this.setLimit("max",e,!0,w.toString(t))}lt(e,t){return this.setLimit("max",e,!1,w.toString(t))}setLimit(e,t,n,r){return new X({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:n,message:w.toString(r)}]})}_addCheck(e){return new X({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:w.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:w.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:w.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:w.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:w.toString(t)})}get minValue(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}}X.create=e=>{var t;return new X({checks:[],typeName:De.ZodBigInt,coerce:null!==(t=null==e?void 0:e.coerce)&&void 0!==t&&t,...E(e)})};class Q extends O{_parse(e){this._def.coerce&&(e.data=Boolean(e.data));if(this._getType(e)!==n.boolean){const t=this._getOrReturnCtx(e);return u(t,{code:a.invalid_type,expected:n.boolean,received:t.parsedType}),p}return m(e.data)}}Q.create=e=>new Q({typeName:De.ZodBoolean,coerce:(null==e?void 0:e.coerce)||!1,...E(e)});class ee extends O{_parse(t){this._def.coerce&&(t.data=new Date(t.data));if(this._getType(t)!==n.date){const e=this._getOrReturnCtx(t);return u(e,{code:a.invalid_type,expected:n.date,received:e.parsedType}),p}if(isNaN(t.data.getTime())){return u(this._getOrReturnCtx(t),{code:a.invalid_date}),p}const r=new l;let s;for(const n of this._def.checks)"min"===n.kind?t.data.getTime()<n.value&&(s=this._getOrReturnCtx(t,s),u(s,{code:a.too_small,message:n.message,inclusive:!0,exact:!1,minimum:n.value,type:"date"}),r.dirty()):"max"===n.kind?t.data.getTime()>n.value&&(s=this._getOrReturnCtx(t,s),u(s,{code:a.too_big,message:n.message,inclusive:!0,exact:!1,maximum:n.value,type:"date"}),r.dirty()):e.assertNever(n);return{status:r.value,value:new Date(t.data.getTime())}}_addCheck(e){return new ee({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:w.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:w.toString(t)})}get minDate(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return null!=e?new Date(e):null}get maxDate(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return null!=e?new Date(e):null}}ee.create=e=>new ee({checks:[],coerce:(null==e?void 0:e.coerce)||!1,typeName:De.ZodDate,...E(e)});class te extends O{_parse(e){if(this._getType(e)!==n.symbol){const t=this._getOrReturnCtx(e);return u(t,{code:a.invalid_type,expected:n.symbol,received:t.parsedType}),p}return m(e.data)}}te.create=e=>new te({typeName:De.ZodSymbol,...E(e)});class ne extends O{_parse(e){if(this._getType(e)!==n.undefined){const t=this._getOrReturnCtx(e);return u(t,{code:a.invalid_type,expected:n.undefined,received:t.parsedType}),p}return m(e.data)}}ne.create=e=>new ne({typeName:De.ZodUndefined,...E(e)});class re extends O{_parse(e){if(this._getType(e)!==n.null){const t=this._getOrReturnCtx(e);return u(t,{code:a.invalid_type,expected:n.null,received:t.parsedType}),p}return m(e.data)}}re.create=e=>new re({typeName:De.ZodNull,...E(e)});class ae extends O{constructor(){super(...arguments),this._any=!0}_parse(e){return m(e.data)}}ae.create=e=>new ae({typeName:De.ZodAny,...E(e)});class se extends O{constructor(){super(...arguments),this._unknown=!0}_parse(e){return m(e.data)}}se.create=e=>new se({typeName:De.ZodUnknown,...E(e)});class ie extends O{_parse(e){const t=this._getOrReturnCtx(e);return u(t,{code:a.invalid_type,expected:n.never,received:t.parsedType}),p}}ie.create=e=>new ie({typeName:De.ZodNever,...E(e)});class oe extends O{_parse(e){if(this._getType(e)!==n.undefined){const t=this._getOrReturnCtx(e);return u(t,{code:a.invalid_type,expected:n.void,received:t.parsedType}),p}return m(e.data)}}oe.create=e=>new oe({typeName:De.ZodVoid,...E(e)});class de extends O{_parse(e){const{ctx:t,status:r}=this._processInputParams(e),s=this._def;if(t.parsedType!==n.array)return u(t,{code:a.invalid_type,expected:n.array,received:t.parsedType}),p;if(null!==s.exactLength){const e=t.data.length>s.exactLength.value,n=t.data.length<s.exactLength.value;(e||n)&&(u(t,{code:e?a.too_big:a.too_small,minimum:n?s.exactLength.value:void 0,maximum:e?s.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:s.exactLength.message}),r.dirty())}if(null!==s.minLength&&t.data.length<s.minLength.value&&(u(t,{code:a.too_small,minimum:s.minLength.value,type:"array",inclusive:!0,exact:!1,message:s.minLength.message}),r.dirty()),null!==s.maxLength&&t.data.length>s.maxLength.value&&(u(t,{code:a.too_big,maximum:s.maxLength.value,type:"array",inclusive:!0,exact:!1,message:s.maxLength.message}),r.dirty()),t.common.async)return Promise.all([...t.data].map(((e,n)=>s.type._parseAsync(new S(t,e,t.path,n))))).then((e=>l.mergeArray(r,e)));const i=[...t.data].map(((e,n)=>s.type._parseSync(new S(t,e,t.path,n))));return l.mergeArray(r,i)}get element(){return this._def.type}min(e,t){return new de({...this._def,minLength:{value:e,message:w.toString(t)}})}max(e,t){return new de({...this._def,maxLength:{value:e,message:w.toString(t)}})}length(e,t){return new de({...this._def,exactLength:{value:e,message:w.toString(t)}})}nonempty(e){return this.min(1,e)}}function ce(e){if(e instanceof ue){const t={};for(const n in e.shape){const r=e.shape[n];t[n]=Ze.create(ce(r))}return new ue({...e._def,shape:()=>t})}return e instanceof de?new de({...e._def,type:ce(e.element)}):e instanceof Ze?Ze.create(ce(e.unwrap())):e instanceof je?je.create(ce(e.unwrap())):e instanceof ye?ye.create(e.items.map((e=>ce(e)))):e}de.create=(e,t)=>new de({type:e,minLength:null,maxLength:null,exactLength:null,typeName:De.ZodArray,...E(t)});class ue extends O{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(null!==this._cached)return this._cached;const t=this._def.shape(),n=e.objectKeys(t);return this._cached={shape:t,keys:n}}_parse(e){if(this._getType(e)!==n.object){const t=this._getOrReturnCtx(e);return u(t,{code:a.invalid_type,expected:n.object,received:t.parsedType}),p}const{status:t,ctx:r}=this._processInputParams(e),{shape:s,keys:i}=this._getCached(),o=[];if(!(this._def.catchall instanceof ie&&"strip"===this._def.unknownKeys))for(const n in r.data)i.includes(n)||o.push(n);const d=[];for(const n of i){const e=s[n],t=r.data[n];d.push({key:{status:"valid",value:n},value:e._parse(new S(r,t,r.path,n)),alwaysSet:n in r.data})}if(this._def.catchall instanceof ie){const e=this._def.unknownKeys;if("passthrough"===e)for(const t of o)d.push({key:{status:"valid",value:t},value:{status:"valid",value:r.data[t]}});else if("strict"===e)o.length>0&&(u(r,{code:a.unrecognized_keys,keys:o}),t.dirty());else if("strip"!==e)throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const e=this._def.catchall;for(const t of o){const n=r.data[t];d.push({key:{status:"valid",value:t},value:e._parse(new S(r,n,r.path,t)),alwaysSet:t in r.data})}}return r.common.async?Promise.resolve().then((async()=>{const e=[];for(const t of d){const n=await t.key,r=await t.value;e.push({key:n,value:r,alwaysSet:t.alwaysSet})}return e})).then((e=>l.mergeObjectSync(t,e))):l.mergeObjectSync(t,d)}get shape(){return this._def.shape()}strict(e){return w.errToObj,new ue({...this._def,unknownKeys:"strict",...void 0!==e?{errorMap:(t,n)=>{var r,a,s,i;const o=null!==(s=null===(a=(r=this._def).errorMap)||void 0===a?void 0:a.call(r,t,n).message)&&void 0!==s?s:n.defaultError;return"unrecognized_keys"===t.code?{message:null!==(i=w.errToObj(e).message)&&void 0!==i?i:o}:{message:o}}}:{}})}strip(){return new ue({...this._def,unknownKeys:"strip"})}passthrough(){return new ue({...this._def,unknownKeys:"passthrough"})}extend(e){return new ue({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new ue({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:De.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new ue({...this._def,catchall:e})}pick(t){const n={};return e.objectKeys(t).forEach((e=>{t[e]&&this.shape[e]&&(n[e]=this.shape[e])})),new ue({...this._def,shape:()=>n})}omit(t){const n={};return e.objectKeys(this.shape).forEach((e=>{t[e]||(n[e]=this.shape[e])})),new ue({...this._def,shape:()=>n})}deepPartial(){return ce(this)}partial(t){const n={};return e.objectKeys(this.shape).forEach((e=>{const r=this.shape[e];t&&!t[e]?n[e]=r:n[e]=r.optional()})),new ue({...this._def,shape:()=>n})}required(t){const n={};return e.objectKeys(this.shape).forEach((e=>{if(t&&!t[e])n[e]=this.shape[e];else{let t=this.shape[e];for(;t instanceof Ze;)t=t._def.innerType;n[e]=t}})),new ue({...this._def,shape:()=>n})}keyof(){return xe(e.objectKeys(this.shape))}}ue.create=(e,t)=>new ue({shape:()=>e,unknownKeys:"strip",catchall:ie.create(),typeName:De.ZodObject,...E(t)}),ue.strictCreate=(e,t)=>new ue({shape:()=>e,unknownKeys:"strict",catchall:ie.create(),typeName:De.ZodObject,...E(t)}),ue.lazycreate=(e,t)=>new ue({shape:e,unknownKeys:"strip",catchall:ie.create(),typeName:De.ZodObject,...E(t)});class le extends O{_parse(e){const{ctx:t}=this._processInputParams(e),n=this._def.options;if(t.common.async)return Promise.all(n.map((async e=>{const n={...t,common:{...t.common,issues:[]},parent:null};return{result:await e._parseAsync({data:t.data,path:t.path,parent:n}),ctx:n}}))).then((function(e){for(const t of e)if("valid"===t.result.status)return t.result;for(const r of e)if("dirty"===r.result.status)return t.common.issues.push(...r.ctx.common.issues),r.result;const n=e.map((e=>new s(e.ctx.common.issues)));return u(t,{code:a.invalid_union,unionErrors:n}),p}));{let e;const r=[];for(const a of n){const n={...t,common:{...t.common,issues:[]},parent:null},s=a._parseSync({data:t.data,path:t.path,parent:n});if("valid"===s.status)return s;"dirty"!==s.status||e||(e={result:s,ctx:n}),n.common.issues.length&&r.push(n.common.issues)}if(e)return t.common.issues.push(...e.ctx.common.issues),e.result;const i=r.map((e=>new s(e)));return u(t,{code:a.invalid_union,unionErrors:i}),p}}get options(){return this._def.options}}le.create=(e,t)=>new le({options:e,typeName:De.ZodUnion,...E(t)});const pe=t=>t instanceof we?pe(t.schema):t instanceof Oe?pe(t.innerType()):t instanceof ke?[t.value]:t instanceof Se?t.options:t instanceof Te?e.objectValues(t.enum):t instanceof Ne?pe(t._def.innerType):t instanceof ne?[void 0]:t instanceof re?[null]:t instanceof Ze?[void 0,...pe(t.unwrap())]:t instanceof je?[null,...pe(t.unwrap())]:t instanceof Ie||t instanceof $e?pe(t.unwrap()):t instanceof Pe?pe(t._def.innerType):[];class he extends O{_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==n.object)return u(t,{code:a.invalid_type,expected:n.object,received:t.parsedType}),p;const r=this.discriminator,s=t.data[r],i=this.optionsMap.get(s);return i?t.common.async?i._parseAsync({data:t.data,path:t.path,parent:t}):i._parseSync({data:t.data,path:t.path,parent:t}):(u(t,{code:a.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),p)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,t,n){const r=new Map;for(const a of t){const t=pe(a.shape[e]);if(!t.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(const n of t){if(r.has(n))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(n)}`);r.set(n,a)}}return new he({typeName:De.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:r,...E(n)})}}function me(t,a){const s=r(t),i=r(a);if(t===a)return{valid:!0,data:t};if(s===n.object&&i===n.object){const n=e.objectKeys(a),r=e.objectKeys(t).filter((e=>-1!==n.indexOf(e))),s={...t,...a};for(const e of r){const n=me(t[e],a[e]);if(!n.valid)return{valid:!1};s[e]=n.data}return{valid:!0,data:s}}if(s===n.array&&i===n.array){if(t.length!==a.length)return{valid:!1};const e=[];for(let n=0;n<t.length;n++){const r=me(t[n],a[n]);if(!r.valid)return{valid:!1};e.push(r.data)}return{valid:!0,data:e}}return s===n.date&&i===n.date&&+t==+a?{valid:!0,data:t}:{valid:!1}}class fe extends O{_parse(e){const{status:t,ctx:n}=this._processInputParams(e),r=(e,r)=>{if(f(e)||f(r))return p;const s=me(e.value,r.value);return s.valid?((y(e)||y(r))&&t.dirty(),{status:t.value,value:s.data}):(u(n,{code:a.invalid_intersection_types}),p)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then((([e,t])=>r(e,t))):r(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}}fe.create=(e,t,n)=>new fe({left:e,right:t,typeName:De.ZodIntersection,...E(n)});class ye extends O{_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==n.array)return u(r,{code:a.invalid_type,expected:n.array,received:r.parsedType}),p;if(r.data.length<this._def.items.length)return u(r,{code:a.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),p;!this._def.rest&&r.data.length>this._def.items.length&&(u(r,{code:a.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());const s=[...r.data].map(((e,t)=>{const n=this._def.items[t]||this._def.rest;return n?n._parse(new S(r,e,r.path,t)):null})).filter((e=>!!e));return r.common.async?Promise.all(s).then((e=>l.mergeArray(t,e))):l.mergeArray(t,s)}get items(){return this._def.items}rest(e){return new ye({...this._def,rest:e})}}ye.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new ye({items:e,typeName:De.ZodTuple,rest:null,...E(t)})};class ge extends O{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==n.object)return u(r,{code:a.invalid_type,expected:n.object,received:r.parsedType}),p;const s=[],i=this._def.keyType,o=this._def.valueType;for(const n in r.data)s.push({key:i._parse(new S(r,n,r.path,n)),value:o._parse(new S(r,r.data[n],r.path,n)),alwaysSet:n in r.data});return r.common.async?l.mergeObjectAsync(t,s):l.mergeObjectSync(t,s)}get element(){return this._def.valueType}static create(e,t,n){return new ge(t instanceof O?{keyType:e,valueType:t,typeName:De.ZodRecord,...E(n)}:{keyType:J.create(),valueType:e,typeName:De.ZodRecord,...E(t)})}}class ve extends O{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==n.map)return u(r,{code:a.invalid_type,expected:n.map,received:r.parsedType}),p;const s=this._def.keyType,i=this._def.valueType,o=[...r.data.entries()].map((([e,t],n)=>({key:s._parse(new S(r,e,r.path,[n,"key"])),value:i._parse(new S(r,t,r.path,[n,"value"]))})));if(r.common.async){const e=new Map;return Promise.resolve().then((async()=>{for(const n of o){const r=await n.key,a=await n.value;if("aborted"===r.status||"aborted"===a.status)return p;"dirty"!==r.status&&"dirty"!==a.status||t.dirty(),e.set(r.value,a.value)}return{status:t.value,value:e}}))}{const e=new Map;for(const n of o){const r=n.key,a=n.value;if("aborted"===r.status||"aborted"===a.status)return p;"dirty"!==r.status&&"dirty"!==a.status||t.dirty(),e.set(r.value,a.value)}return{status:t.value,value:e}}}}ve.create=(e,t,n)=>new ve({valueType:t,keyType:e,typeName:De.ZodMap,...E(n)});class _e extends O{_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==n.set)return u(r,{code:a.invalid_type,expected:n.set,received:r.parsedType}),p;const s=this._def;null!==s.minSize&&r.data.size<s.minSize.value&&(u(r,{code:a.too_small,minimum:s.minSize.value,type:"set",inclusive:!0,exact:!1,message:s.minSize.message}),t.dirty()),null!==s.maxSize&&r.data.size>s.maxSize.value&&(u(r,{code:a.too_big,maximum:s.maxSize.value,type:"set",inclusive:!0,exact:!1,message:s.maxSize.message}),t.dirty());const i=this._def.valueType;function o(e){const n=new Set;for(const r of e){if("aborted"===r.status)return p;"dirty"===r.status&&t.dirty(),n.add(r.value)}return{status:t.value,value:n}}const d=[...r.data.values()].map(((e,t)=>i._parse(new S(r,e,r.path,t))));return r.common.async?Promise.all(d).then((e=>o(e))):o(d)}min(e,t){return new _e({...this._def,minSize:{value:e,message:w.toString(t)}})}max(e,t){return new _e({...this._def,maxSize:{value:e,message:w.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}}_e.create=(e,t)=>new _e({valueType:e,minSize:null,maxSize:null,typeName:De.ZodSet,...E(t)});class be extends O{constructor(){super(...arguments),this.validate=this.implement}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==n.function)return u(t,{code:a.invalid_type,expected:n.function,received:t.parsedType}),p;function r(e,n){return c({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,d(),i].filter((e=>!!e)),issueData:{code:a.invalid_arguments,argumentsError:n}})}function o(e,n){return c({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,d(),i].filter((e=>!!e)),issueData:{code:a.invalid_return_type,returnTypeError:n}})}const l={errorMap:t.common.contextualErrorMap},h=t.data;if(this._def.returns instanceof Ee){const e=this;return m((async function(...t){const n=new s([]),a=await e._def.args.parseAsync(t,l).catch((e=>{throw n.addIssue(r(t,e)),n})),i=await Reflect.apply(h,this,a);return await e._def.returns._def.type.parseAsync(i,l).catch((e=>{throw n.addIssue(o(i,e)),n}))}))}{const e=this;return m((function(...t){const n=e._def.args.safeParse(t,l);if(!n.success)throw new s([r(t,n.error)]);const a=Reflect.apply(h,this,n.data),i=e._def.returns.safeParse(a,l);if(!i.success)throw new s([o(a,i.error)]);return i.data}))}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new be({...this._def,args:ye.create(e).rest(se.create())})}returns(e){return new be({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,t,n){return new be({args:e||ye.create([]).rest(se.create()),returns:t||se.create(),typeName:De.ZodFunction,...E(n)})}}class we extends O{get schema(){return this._def.getter()}_parse(e){const{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}}we.create=(e,t)=>new we({getter:e,typeName:De.ZodLazy,...E(t)});class ke extends O{_parse(e){if(e.data!==this._def.value){const t=this._getOrReturnCtx(e);return u(t,{received:t.data,code:a.invalid_literal,expected:this._def.value}),p}return{status:"valid",value:e.data}}get value(){return this._def.value}}function xe(e,t){return new Se({values:e,typeName:De.ZodEnum,...E(t)})}ke.create=(e,t)=>new ke({value:e,typeName:De.ZodLiteral,...E(t)});class Se extends O{constructor(){super(...arguments),k.set(this,void 0)}_parse(t){if("string"!=typeof t.data){const n=this._getOrReturnCtx(t),r=this._def.values;return u(n,{expected:e.joinValues(r),received:n.parsedType,code:a.invalid_type}),p}if(_(this,k)||b(this,k,new Set(this._def.values)),!_(this,k).has(t.data)){const e=this._getOrReturnCtx(t),n=this._def.values;return u(e,{received:e.data,code:a.invalid_enum_value,options:n}),p}return m(t.data)}get options(){return this._def.values}get enum(){const e={};for(const t of this._def.values)e[t]=t;return e}get Values(){const e={};for(const t of this._def.values)e[t]=t;return e}get Enum(){const e={};for(const t of this._def.values)e[t]=t;return e}extract(e,t=this._def){return Se.create(e,{...this._def,...t})}exclude(e,t=this._def){return Se.create(this.options.filter((t=>!e.includes(t))),{...this._def,...t})}}k=new WeakMap,Se.create=xe;class Te extends O{constructor(){super(...arguments),x.set(this,void 0)}_parse(t){const r=e.getValidEnumValues(this._def.values),s=this._getOrReturnCtx(t);if(s.parsedType!==n.string&&s.parsedType!==n.number){const t=e.objectValues(r);return u(s,{expected:e.joinValues(t),received:s.parsedType,code:a.invalid_type}),p}if(_(this,x)||b(this,x,new Set(e.getValidEnumValues(this._def.values))),!_(this,x).has(t.data)){const t=e.objectValues(r);return u(s,{received:s.data,code:a.invalid_enum_value,options:t}),p}return m(t.data)}get enum(){return this._def.values}}x=new WeakMap,Te.create=(e,t)=>new Te({values:e,typeName:De.ZodNativeEnum,...E(t)});class Ee extends O{unwrap(){return this._def.type}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==n.promise&&!1===t.common.async)return u(t,{code:a.invalid_type,expected:n.promise,received:t.parsedType}),p;const r=t.parsedType===n.promise?t.data:Promise.resolve(t.data);return m(r.then((e=>this._def.type.parseAsync(e,{path:t.path,errorMap:t.common.contextualErrorMap}))))}}Ee.create=(e,t)=>new Ee({type:e,typeName:De.ZodPromise,...E(t)});class Oe extends O{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===De.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){const{status:n,ctx:r}=this._processInputParams(t),a=this._def.effect||null,s={addIssue:e=>{u(r,e),e.fatal?n.abort():n.dirty()},get path(){return r.path}};if(s.addIssue=s.addIssue.bind(s),"preprocess"===a.type){const e=a.transform(r.data,s);if(r.common.async)return Promise.resolve(e).then((async e=>{if("aborted"===n.value)return p;const t=await this._def.schema._parseAsync({data:e,path:r.path,parent:r});return"aborted"===t.status?p:"dirty"===t.status||"dirty"===n.value?h(t.value):t}));{if("aborted"===n.value)return p;const t=this._def.schema._parseSync({data:e,path:r.path,parent:r});return"aborted"===t.status?p:"dirty"===t.status||"dirty"===n.value?h(t.value):t}}if("refinement"===a.type){const e=e=>{const t=a.refinement(e,s);if(r.common.async)return Promise.resolve(t);if(t instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return e};if(!1===r.common.async){const t=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return"aborted"===t.status?p:("dirty"===t.status&&n.dirty(),e(t.value),{status:n.value,value:t.value})}return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then((t=>"aborted"===t.status?p:("dirty"===t.status&&n.dirty(),e(t.value).then((()=>({status:n.value,value:t.value}))))))}if("transform"===a.type){if(!1===r.common.async){const e=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!g(e))return e;const t=a.transform(e.value,s);if(t instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:t}}return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then((e=>g(e)?Promise.resolve(a.transform(e.value,s)).then((e=>({status:n.value,value:e}))):e))}e.assertNever(a)}}Oe.create=(e,t,n)=>new Oe({schema:e,typeName:De.ZodEffects,effect:t,...E(n)}),Oe.createWithPreprocess=(e,t,n)=>new Oe({schema:t,effect:{type:"preprocess",transform:e},typeName:De.ZodEffects,...E(n)});class Ze extends O{_parse(e){return this._getType(e)===n.undefined?m(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Ze.create=(e,t)=>new Ze({innerType:e,typeName:De.ZodOptional,...E(t)});class je extends O{_parse(e){return this._getType(e)===n.null?m(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}je.create=(e,t)=>new je({innerType:e,typeName:De.ZodNullable,...E(t)});class Ne extends O{_parse(e){const{ctx:t}=this._processInputParams(e);let r=t.data;return t.parsedType===n.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}Ne.create=(e,t)=>new Ne({innerType:e,typeName:De.ZodDefault,defaultValue:"function"==typeof t.default?t.default:()=>t.default,...E(t)});class Pe extends O{_parse(e){const{ctx:t}=this._processInputParams(e),n={...t,common:{...t.common,issues:[]}},r=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return v(r)?r.then((e=>({status:"valid",value:"valid"===e.status?e.value:this._def.catchValue({get error(){return new s(n.common.issues)},input:n.data})}))):{status:"valid",value:"valid"===r.status?r.value:this._def.catchValue({get error(){return new s(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}}Pe.create=(e,t)=>new Pe({innerType:e,typeName:De.ZodCatch,catchValue:"function"==typeof t.catch?t.catch:()=>t.catch,...E(t)});class Ae extends O{_parse(e){if(this._getType(e)!==n.nan){const t=this._getOrReturnCtx(e);return u(t,{code:a.invalid_type,expected:n.nan,received:t.parsedType}),p}return{status:"valid",value:e.data}}}Ae.create=e=>new Ae({typeName:De.ZodNaN,...E(e)});const Ce=Symbol("zod_brand");class Ie extends O{_parse(e){const{ctx:t}=this._processInputParams(e),n=t.data;return this._def.type._parse({data:n,path:t.path,parent:t})}unwrap(){return this._def.type}}class Re extends O{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.common.async){return(async()=>{const e=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return"aborted"===e.status?p:"dirty"===e.status?(t.dirty(),h(e.value)):this._def.out._parseAsync({data:e.value,path:n.path,parent:n})})()}{const e=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return"aborted"===e.status?p:"dirty"===e.status?(t.dirty(),{status:"dirty",value:e.value}):this._def.out._parseSync({data:e.value,path:n.path,parent:n})}}static create(e,t){return new Re({in:e,out:t,typeName:De.ZodPipeline})}}class $e extends O{_parse(e){const t=this._def.innerType._parse(e),n=e=>(g(e)&&(e.value=Object.freeze(e.value)),e);return v(t)?t.then((e=>n(e))):n(t)}unwrap(){return this._def.innerType}}function Fe(e,t){const n="function"==typeof e?e(t):"string"==typeof e?{message:e}:e;return"string"==typeof n?{message:n}:n}function Me(e,t={},n){return e?ae.create().superRefine(((r,a)=>{var s,i;const o=e(r);if(o instanceof Promise)return o.then((e=>{var s,i;if(!e){const e=Fe(t,r),o=null===(i=null!==(s=e.fatal)&&void 0!==s?s:n)||void 0===i||i;a.addIssue({code:"custom",...e,fatal:o})}}));if(!o){const e=Fe(t,r),o=null===(i=null!==(s=e.fatal)&&void 0!==s?s:n)||void 0===i||i;a.addIssue({code:"custom",...e,fatal:o})}})):ae.create()}$e.create=(e,t)=>new $e({innerType:e,typeName:De.ZodReadonly,...E(t)});const Le={object:ue.lazycreate};var De;!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"}(De||(De={}));const ze=J.create,qe=G.create,Ue=Ae.create,Ve=X.create,He=Q.create,Be=ee.create,We=te.create,Ke=ne.create,Je=re.create,Ye=ae.create,Ge=se.create,Xe=ie.create,Qe=oe.create,et=de.create,tt=ue.create,nt=ue.strictCreate,rt=le.create,at=he.create,st=fe.create,it=ye.create,ot=ge.create,dt=ve.create,ct=_e.create,ut=be.create,lt=we.create,pt=ke.create,ht=Se.create,mt=Te.create,ft=Ee.create,yt=Oe.create,gt=Ze.create,vt=je.create,_t=Oe.createWithPreprocess,bt=Re.create,wt={string:e=>J.create({...e,coerce:!0}),number:e=>G.create({...e,coerce:!0}),boolean:e=>Q.create({...e,coerce:!0}),bigint:e=>X.create({...e,coerce:!0}),date:e=>ee.create({...e,coerce:!0})},kt=p;var xt=Object.freeze({__proto__:null,defaultErrorMap:i,setErrorMap:function(e){o=e},getErrorMap:d,makeIssue:c,EMPTY_PATH:[],addIssueToContext:u,ParseStatus:l,INVALID:p,DIRTY:h,OK:m,isAborted:f,isDirty:y,isValid:g,isAsync:v,get util(){return e},get objectUtil(){return t},ZodParsedType:n,getParsedType:r,ZodType:O,datetimeRegex:B,ZodString:J,ZodNumber:G,ZodBigInt:X,ZodBoolean:Q,ZodDate:ee,ZodSymbol:te,ZodUndefined:ne,ZodNull:re,ZodAny:ae,ZodUnknown:se,ZodNever:ie,ZodVoid:oe,ZodArray:de,ZodObject:ue,ZodUnion:le,ZodDiscriminatedUnion:he,ZodIntersection:fe,ZodTuple:ye,ZodRecord:ge,ZodMap:ve,ZodSet:_e,ZodFunction:be,ZodLazy:we,ZodLiteral:ke,ZodEnum:Se,ZodNativeEnum:Te,ZodPromise:Ee,ZodEffects:Oe,ZodTransformer:Oe,ZodOptional:Ze,ZodNullable:je,ZodDefault:Ne,ZodCatch:Pe,ZodNaN:Ae,BRAND:Ce,ZodBranded:Ie,ZodPipeline:Re,ZodReadonly:$e,custom:Me,Schema:O,ZodSchema:O,late:Le,get ZodFirstPartyTypeKind(){return De},coerce:wt,any:Ye,array:et,bigint:Ve,boolean:He,date:Be,discriminatedUnion:at,effect:yt,enum:ht,function:ut,instanceof:(e,t={message:`Input not instance of ${e.name}`})=>Me((t=>t instanceof e),t),intersection:st,lazy:lt,literal:pt,map:dt,nan:Ue,nativeEnum:mt,never:Xe,null:Je,nullable:vt,number:qe,object:tt,oboolean:()=>He().optional(),onumber:()=>qe().optional(),optional:gt,ostring:()=>ze().optional(),pipeline:bt,preprocess:_t,promise:ft,record:ot,set:ct,strictObject:nt,string:ze,symbol:We,transformer:yt,tuple:it,undefined:Ke,union:rt,unknown:Ge,void:Qe,NEVER:kt,ZodIssueCode:a,quotelessJson:e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:"),ZodError:s});const St=xt.object({detail:xt.string()});function Tt(e){if(!e)return"Unknown error";if(e instanceof Error){const t=St.safeParse(e.cause);return t.success?t.data.detail:function(e){const t=function(e){try{return JSON.parse(e)}catch{return e}}(e);if(!t)return e;const n=St.safeParse(t);if(n.success)return n.data.detail;return e}(e.message)}if("object"==typeof e){const t=St.safeParse(e);if(t.success)return t.data.detail}try{return JSON.stringify(e)}catch{return String(e)}}const Et=1e3;function Ot(e,t){const n=e.map((e=>`"${e}"`)).join(", ");return new Error(`This RPC instance cannot ${t} because the transport did not provide one or more of these methods: ${n}`)}function Zt(e={}){let t={};function n(e){t=e}let r,a={};function s(e){a.unregisterHandler&&a.unregisterHandler(),a=e,a.registerHandler?.(_)}function i(e){r="function"!=typeof e?(t,n)=>{const r=e[t];if(r)return r(n);const a=e._;if(!a)throw new Error(`The requested method has no handler: ${t}`);return a(t,n)}:e}const{maxRequestTime:o=Et}=e;e.transport&&s(e.transport),e.requestHandler&&i(e.requestHandler),e._debugHooks&&n(e._debugHooks);let d=0;const c=new Map,u=new Map;function l(e,...n){const r=n[0];return new Promise(((n,s)=>{if(!a.send)throw Ot(["send"],"make requests");const i=d<=1e10?++d:d=0,l={type:"request",id:i,method:e,params:r};c.set(i,{resolve:n,reject:s}),o!==1/0&&u.set(i,setTimeout((()=>{u.delete(i),s(new Error("RPC request timed out."))}),o)),t.onSend?.(l),a.send(l)}))}const p=new Proxy(l,{get:(e,t,n)=>t in e?Reflect.get(e,t,n):e=>l(t,e)}),h=p;function m(e,...n){const r=n[0];if(!a.send)throw Ot(["send"],"send messages");const s={type:"message",id:e,payload:r};t.onSend?.(s),a.send(s)}const f=new Proxy(m,{get:(e,t,n)=>t in e?Reflect.get(e,t,n):e=>m(t,e)}),y=f,g=new Map,v=new Set;async function _(e){if(t.onReceive?.(e),!("type"in e))throw new Error("Message does not contain a type.");if("request"===e.type){if(!a.send||!r)throw Ot(["send","requestHandler"],"handle requests");const{id:s,method:i,params:o}=e;let d;try{d={type:"response",id:s,success:!0,payload:await r(i,o)}}catch(n){if(!(n instanceof Error))throw n;d={type:"response",id:s,success:!1,error:n.message}}return t.onSend?.(d),void a.send(d)}if("response"!==e.type){if("message"!==e.type)throw new Error(`Unexpected RPC message type: ${e.type}`);{for(const n of v)n(e.id,e.payload);const t=g.get(e.id);if(!t)return;for(const n of t)n(e.payload)}}else{const t=u.get(e.id);null!=t&&clearTimeout(t);const{resolve:n,reject:r}=c.get(e.id)??{};e.success?n?.(e.payload):r?.(new Error(e.error))}}return{setTransport:s,setRequestHandler:i,request:p,requestProxy:h,send:f,sendProxy:y,addMessageListener:function(e,t){if(!a.registerHandler)throw Ot(["registerHandler"],"register message listeners");"*"!==e?(g.has(e)||g.set(e,new Set),g.get(e)?.add(t)):v.add(t)},removeMessageListener:function(e,t){"*"!==e?(g.get(e)?.delete(t),0===g.get(e)?.size&&g.delete(e)):v.delete(t)},proxy:{send:y,request:h},_setDebugHooks:n}}const jt="[transport-id]";function Nt(e,t={}){const{transportId:n,filter:r,remotePort:a}=t,s=e,i=a??e;let o;return{send(e){i.postMessage(function(e,t){const{transportId:n}=t;return null!=n?{[jt]:n,data:e}:e}(e,{transportId:n}))},registerHandler(e){o=t=>{const a=t.data,[s,i]=function(e,t){const{transportId:n,filter:r}=t,a=r?.();if(null!=n&&null!=a)throw new Error("Cannot use both `transportId` and `filter` at the same time");let s=e;if(n){if(e[jt]!==n)return[!0];s=e.data}return!1===a?[!0]:[!1,s]}(a,{transportId:n,filter:()=>r?.(t)});s||e(i)},s.addEventListener("message",o)},unregisterHandler(){o&&s.removeEventListener("message",o)}}}function Pt(e,t){if(!e)throw new Error(t)}const At=()=>{},Ct=(e,t)=>{const n=`[${e}]`;return{debug:(...e)=>t.debug(n,...e),log:(...e)=>t.log(n,...e),warn:(...e)=>t.warn(n,...e),error:(...e)=>t.error(n,...e),trace:(...e)=>t.trace(n,...e),get:n=>Ct(`${e}.${n}`,t),disabled:(e=!0)=>e?Rt:t}},It={debug:(...e)=>{},log:(...e)=>{console.log(...e)},warn:(...e)=>{console.warn(...e)},error:(...e)=>{console.error(...e)},trace:(...e)=>{console.trace(...e)},get:e=>Ct(e,It),disabled:(e=!0)=>e?Rt:It},Rt={debug:()=>At,log:()=>At,warn:()=>At,error:()=>At,trace:()=>At,get:()=>Rt,disabled:()=>Rt};const $t="undefined"!=typeof window&&window.Logger||It,Ft=["normal","compact","medium","full","columns"],Mt=["auto","native","polars","lazy-polars","pandas"],Lt=xt.object({completion:xt.object({activate_on_typing:xt.boolean().default(!0),copilot:xt.union([xt.boolean(),xt.enum(["github","codeium","custom"])]).default(!1).transform((e=>!0===e?"github":e)),codeium_api_key:xt.string().nullish()}).passthrough().default({}),save:xt.object({autosave:xt.enum(["off","after_delay"]).default("after_delay"),autosave_delay:xt.number().nonnegative().transform((e=>Math.max(e,1e3))).default(1e3),format_on_save:xt.boolean().default(!1)}).passthrough().default({}),formatting:xt.object({line_length:xt.number().nonnegative().default(79).transform((e=>Math.min(e,1e3)))}).passthrough().default({}),keymap:xt.object({preset:xt.enum(["default","vim"]).default("default"),overrides:xt.record(xt.string()).default({})}).passthrough().default({}),runtime:xt.object({auto_instantiate:xt.boolean().default(!0),on_cell_change:xt.enum(["lazy","autorun"]).default("autorun"),auto_reload:xt.enum(["off","lazy","autorun"]).default("off"),watcher_on_save:xt.enum(["lazy","autorun"]).default("lazy"),default_sql_output:xt.enum(Mt).default("auto")}).passthrough().default({}),display:xt.object({theme:xt.enum(["light","dark","system"]).default("light"),code_editor_font_size:xt.number().nonnegative().default(14),cell_output:xt.enum(["above","below"]).default("above"),dataframes:xt.enum(["rich","plain"]).default("rich"),default_table_page_size:xt.number().default(10),default_width:xt.enum(Ft).default("medium").transform((e=>"normal"===e?"compact":e))}).passthrough().default({}),package_management:xt.object({manager:xt.enum(["pip","uv","rye","poetry","pixi"]).default("pip")}).passthrough().default({manager:"pip"}),ai:xt.object({rules:xt.string().default(""),open_ai:xt.object({api_key:xt.string().optional(),base_url:xt.string().optional(),model:xt.string().optional()}).optional(),anthropic:xt.object({api_key:xt.string().optional()}).optional(),google:xt.object({api_key:xt.string().optional()}).optional()}).passthrough().default({}),experimental:xt.object({markdown:xt.boolean().optional(),rtc:xt.boolean().optional()}).passthrough().default({}),server:xt.object({}).passthrough().default({})}).passthrough().default({completion:{},save:{},formatting:{},keymap:{},runtime:{},display:{},experimental:{},server:{},ai:{rules:"",open_ai:{}}}),Dt=xt.string(),zt=xt.enum(Mt).default("auto");xt.object({width:xt.enum(Ft).default("medium").transform((e=>"normal"===e?"compact":e)),app_title:Dt.nullish(),css_file:xt.string().nullish(),html_head_file:xt.string().nullish(),auto_download:xt.array(xt.enum(["html","markdown","ipynb"])).default([]),sql_output:zt}).default({width:"medium",auto_download:[]});var qt,Ut=Object.defineProperty,Vt=(e,t)=>Ut(e,"name",{value:t,configurable:!0}),Ht=(qt=function(e){if(typeof require<"u")return require.apply(this,arguments);throw new Error('Dynamic require of "'+e+'" is not supported')},typeof require<"u"?require:typeof Proxy<"u"?new Proxy(qt,{get:(e,t)=>(typeof require<"u"?require:e)[t]}):qt);function Bt(e){return!isNaN(parseFloat(e))&&isFinite(e)}function Wt(e){return e.charAt(0).toUpperCase()+e.substring(1)}function Kt(e){return function(){return this[e]}}Vt(Bt,"_isNumber"),Vt(Wt,"_capitalize"),Vt(Kt,"_getter");var Jt,Yt,Gt=["isConstructor","isEval","isNative","isToplevel"],Xt=["columnNumber","lineNumber"],Qt=["fileName","functionName","source"],en=Gt.concat(Xt,Qt,["args"],["evalOrigin"]);function tn(e){if(e)for(var t=0;t<en.length;t++)void 0!==e[en[t]]&&this["set"+Wt(en[t])](e[en[t]])}for(Vt(tn,"StackFrame"),tn.prototype={getArgs:function(){return this.args},setArgs:function(e){if("[object Array]"!==Object.prototype.toString.call(e))throw new TypeError("Args must be an Array");this.args=e},getEvalOrigin:function(){return this.evalOrigin},setEvalOrigin:function(e){if(e instanceof tn)this.evalOrigin=e;else{if(!(e instanceof Object))throw new TypeError("Eval Origin must be an Object or StackFrame");this.evalOrigin=new tn(e)}},toString:function(){var e=this.getFileName()||"",t=this.getLineNumber()||"",n=this.getColumnNumber()||"",r=this.getFunctionName()||"";return this.getIsEval()?e?"[eval] ("+e+":"+t+":"+n+")":"[eval]:"+t+":"+n:r?r+" ("+e+":"+t+":"+n+")":e+":"+t+":"+n}},tn.fromString=Vt((function(e){var t=e.indexOf("("),n=e.lastIndexOf(")"),r=e.substring(0,t),a=e.substring(t+1,n).split(","),s=e.substring(n+1);if(0===s.indexOf("@"))var i=/@(.+?)(?::(\d+))?(?::(\d+))?$/.exec(s,""),o=i[1],d=i[2],c=i[3];return new tn({functionName:r,args:a||void 0,fileName:o,lineNumber:d||void 0,columnNumber:c||void 0})}),"StackFrame$$fromString"),Jt=0;Jt<Gt.length;Jt++)tn.prototype["get"+Wt(Gt[Jt])]=Kt(Gt[Jt]),tn.prototype["set"+Wt(Gt[Jt])]=function(e){return function(t){this[e]=!!t}}(Gt[Jt]);for(Yt=0;Yt<Xt.length;Yt++)tn.prototype["get"+Wt(Xt[Yt])]=Kt(Xt[Yt]),tn.prototype["set"+Wt(Xt[Yt])]=function(e){return function(t){if(!Bt(t))throw new TypeError(e+" must be a Number");this[e]=Number(t)}}(Xt[Yt]);for(nn=0;nn<Qt.length;nn++)tn.prototype["get"+Wt(Qt[nn])]=Kt(Qt[nn]),tn.prototype["set"+Wt(Qt[nn])]=function(e){return function(t){this[e]=String(t)}}(Qt[nn]);var nn,rn=tn;function an(){var e=/^\s*at .*(\S+:\d+|\(native\))/m,t=/^(eval@)?(\[native code])?$/;return{parse:Vt((function(t){if(t.stack&&t.stack.match(e))return this.parseV8OrIE(t);if(t.stack)return this.parseFFOrSafari(t);throw new Error("Cannot parse given Error object")}),"ErrorStackParser$$parse"),extractLocation:Vt((function(e){if(-1===e.indexOf(":"))return[e];var t=/(.+?)(?::(\d+))?(?::(\d+))?$/.exec(e.replace(/[()]/g,""));return[t[1],t[2]||void 0,t[3]||void 0]}),"ErrorStackParser$$extractLocation"),parseV8OrIE:Vt((function(t){return t.stack.split("\n").filter((function(t){return!!t.match(e)}),this).map((function(e){e.indexOf("(eval ")>-1&&(e=e.replace(/eval code/g,"eval").replace(/(\(eval at [^()]*)|(,.*$)/g,""));var t=e.replace(/^\s+/,"").replace(/\(eval code/g,"(").replace(/^.*?\s+/,""),n=t.match(/ (\(.+\)$)/);t=n?t.replace(n[0],""):t;var r=this.extractLocation(n?n[1]:t),a=n&&t||void 0,s=["eval","<anonymous>"].indexOf(r[0])>-1?void 0:r[0];return new rn({functionName:a,fileName:s,lineNumber:r[1],columnNumber:r[2],source:e})}),this)}),"ErrorStackParser$$parseV8OrIE"),parseFFOrSafari:Vt((function(e){return e.stack.split("\n").filter((function(e){return!e.match(t)}),this).map((function(e){if(e.indexOf(" > eval")>-1&&(e=e.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g,":$1")),-1===e.indexOf("@")&&-1===e.indexOf(":"))return new rn({functionName:e});var t=/((.*".+"[^@]*)?[^@]*)(?:@)/,n=e.match(t),r=n&&n[1]?n[1]:void 0,a=this.extractLocation(e.replace(t,""));return new rn({functionName:r,fileName:a[0],lineNumber:a[1],columnNumber:a[2],source:e})}),this)}),"ErrorStackParser$$parseFFOrSafari")}}Vt(an,"ErrorStackParser");var sn,on,dn,cn,un,ln,pn,hn,mn,fn=new an,yn="object"==typeof process&&"object"==typeof process.versions&&"string"==typeof process.versions.node&&!process.browser,gn=yn&&typeof module<"u"&&typeof module.exports<"u"&&typeof Ht<"u"&&typeof __dirname<"u",vn=yn&&!gn,_n=typeof Deno<"u",bn=!yn&&!_n,wn=bn&&"object"==typeof window&&"object"==typeof document&&"function"==typeof document.createElement&&"sessionStorage"in window&&"function"!=typeof importScripts,kn=bn&&"function"==typeof importScripts&&"object"==typeof self;async function xn(){if(!yn||(sn=(await import("./__vite-browser-external-CIEyP2s7.js")).default,cn=await import("./__vite-browser-external-CIEyP2s7.js"),un=await import("./__vite-browser-external-CIEyP2s7.js"),dn=(await import("./__vite-browser-external-CIEyP2s7.js")).default,on=await import("./__vite-browser-external-CIEyP2s7.js"),pn=on.sep,typeof Ht<"u"))return;let e={fs:cn,crypto:await import("./__vite-browser-external-CIEyP2s7.js"),ws:await import("./__vite-browser-external-CIEyP2s7.js"),child_process:await import("./__vite-browser-external-CIEyP2s7.js")};globalThis.require=function(t){return e[t]}}function Sn(e,t){return on.resolve(t||".",e)}function Tn(e,t){return void 0===t&&(t=location),new URL(e,t).toString()}function En(e,t){return e.startsWith("file://")&&(e=e.slice(7)),e.includes("://")?{response:fetch(e)}:{binary:un.readFile(e).then((e=>new Uint8Array(e.buffer,e.byteOffset,e.byteLength)))}}function On(e,t){let n=new URL(e,location);return{response:fetch(n,t?{integrity:t}:{})}}async function Zn(e,t){let{response:n,binary:r}=hn(e,t);if(r)return r;let a=await n;if(!a.ok)throw new Error(`Failed to load '${e}': request failed.`);return new Uint8Array(await a.arrayBuffer())}if("object"==typeof navigator&&"string"==typeof navigator.userAgent&&-1==navigator.userAgent.indexOf("Chrome")&&navigator.userAgent.indexOf("Safari"),Vt(xn,"initNodeModules"),Vt(Sn,"node_resolvePath"),Vt(Tn,"browser_resolvePath"),ln=yn?Sn:Tn,yn||(pn="/"),Vt(En,"node_getBinaryResponse"),Vt(On,"browser_getBinaryResponse"),hn=yn?En:On,Vt(Zn,"loadBinaryFile"),wn)mn=Vt((async e=>await import(e)),"loadScript");else if(kn)mn=Vt((async e=>{try{globalThis.importScripts(e)}catch(Qn){if(!(Qn instanceof TypeError))throw Qn;await import(e)}}),"loadScript");else{if(!yn)throw new Error("Cannot determine runtime environment");mn=jn}async function jn(e){e.startsWith("file://")&&(e=e.slice(7)),e.includes("://")?dn.runInThisContext(await(await fetch(e)).text()):await import(sn.pathToFileURL(e).href)}async function Nn(e){if(yn){await xn();let t=await un.readFile(e,{encoding:"utf8"});return JSON.parse(t)}return await(await fetch(e)).json()}async function Pn(){if(gn)return __dirname;let e;try{throw new Error}catch(r){e=r}let t=fn.parse(e)[0].fileName;if(yn&&!t.startsWith("file://")&&(t=`file://${t}`),vn){let e=await import("./__vite-browser-external-CIEyP2s7.js");return(await import("./__vite-browser-external-CIEyP2s7.js")).fileURLToPath(e.dirname(t))}let n=t.lastIndexOf(pn);if(-1===n)throw new Error("Could not extract indexURL path from pyodide module location");return t.slice(0,n)}function An(e){let t=e.FS,n=e.FS.filesystems.MEMFS,r=e.PATH,a={DIR_MODE:16895,FILE_MODE:33279,mount:function(e){if(!e.opts.fileSystemHandle)throw new Error("opts.fileSystemHandle is required");return n.mount.apply(null,arguments)},syncfs:async(e,t,n)=>{try{let r=a.getLocalSet(e),s=await a.getRemoteSet(e),i=t?s:r,o=t?r:s;await a.reconcile(e,i,o),n(null)}catch(r){n(r)}},getLocalSet:e=>{let n=Object.create(null);function a(e){return"."!==e&&".."!==e}function s(e){return t=>r.join2(e,t)}Vt(a,"isRealDir"),Vt(s,"toAbsolute");let i=t.readdir(e.mountpoint).filter(a).map(s(e.mountpoint));for(;i.length;){let e=i.pop(),r=t.stat(e);t.isDir(r.mode)&&i.push.apply(i,t.readdir(e).filter(a).map(s(e))),n[e]={timestamp:r.mtime,mode:r.mode}}return{type:"local",entries:n}},getRemoteSet:async e=>{let t=Object.create(null),n=await Cn(e.opts.fileSystemHandle);for(let[s,i]of n)"."!==s&&(t[r.join2(e.mountpoint,s)]={timestamp:"file"===i.kind?new Date((await i.getFile()).lastModified):new Date,mode:"file"===i.kind?a.FILE_MODE:a.DIR_MODE});return{type:"remote",entries:t,handles:n}},loadLocalEntry:e=>{let r=t.lookupPath(e).node,a=t.stat(e);if(t.isDir(a.mode))return{timestamp:a.mtime,mode:a.mode};if(t.isFile(a.mode))return r.contents=n.getFileDataAsTypedArray(r),{timestamp:a.mtime,mode:a.mode,contents:r.contents};throw new Error("node type not supported")},storeLocalEntry:(e,n)=>{if(t.isDir(n.mode))t.mkdirTree(e,n.mode);else{if(!t.isFile(n.mode))throw new Error("node type not supported");t.writeFile(e,n.contents,{canOwn:!0})}t.chmod(e,n.mode),t.utime(e,n.timestamp,n.timestamp)},removeLocalEntry:e=>{var n=t.stat(e);t.isDir(n.mode)?t.rmdir(e):t.isFile(n.mode)&&t.unlink(e)},loadRemoteEntry:async e=>{if("file"===e.kind){let t=await e.getFile();return{contents:new Uint8Array(await t.arrayBuffer()),mode:a.FILE_MODE,timestamp:new Date(t.lastModified)}}if("directory"===e.kind)return{mode:a.DIR_MODE,timestamp:new Date};throw new Error("unknown kind: "+e.kind)},storeRemoteEntry:async(e,n,a)=>{let s=e.get(r.dirname(n)),i=t.isFile(a.mode)?await s.getFileHandle(r.basename(n),{create:!0}):await s.getDirectoryHandle(r.basename(n),{create:!0});if("file"===i.kind){let e=await i.createWritable();await e.write(a.contents),await e.close()}e.set(n,i)},removeRemoteEntry:async(e,t)=>{await e.get(r.dirname(t)).removeEntry(r.basename(t)),e.delete(t)},reconcile:async(e,n,s)=>{let i=0,o=[];Object.keys(n.entries).forEach((function(e){let r=n.entries[e],a=s.entries[e];(!a||t.isFile(r.mode)&&r.timestamp.getTime()>a.timestamp.getTime())&&(o.push(e),i++)})),o.sort();let d=[];if(Object.keys(s.entries).forEach((function(e){n.entries[e]||(d.push(e),i++)})),d.sort().reverse(),!i)return;let c="remote"===n.type?n.handles:s.handles;for(let t of o){let n=r.normalize(t.replace(e.mountpoint,"/")).substring(1);if("local"===s.type){let e=c.get(n),r=await a.loadRemoteEntry(e);a.storeLocalEntry(t,r)}else{let e=a.loadLocalEntry(t);await a.storeRemoteEntry(c,n,e)}}for(let t of d)if("local"===s.type)a.removeLocalEntry(t);else{let n=r.normalize(t.replace(e.mountpoint,"/")).substring(1);await a.removeRemoteEntry(c,n)}}};e.FS.filesystems.NATIVEFS_ASYNC=a}Vt(jn,"nodeLoadScript"),Vt(Nn,"loadLockFile"),Vt(Pn,"calculateDirname"),Vt(An,"initializeNativeFS");var Cn=Vt((async e=>{let t=[];async function n(e){for await(let r of e.values())t.push(r),"directory"===r.kind&&await n(r)}Vt(n,"collect"),await n(e);let r=new Map;r.set(".",e);for(let a of t){let t=(await e.resolve(a)).join("/");r.set(t,a)}return r}),"getFsHandles");function In(e){let t={noImageDecoding:!0,noAudioDecoding:!0,noWasmDecoding:!1,preRun:Ln(e),quit(e,n){throw t.exited={status:e,toThrow:n},n},print:e.stdout,printErr:e.stderr,thisProgram:e._sysExecutable,arguments:e.args,API:{config:e},locateFile:t=>e.indexURL+t,instantiateWasm:Dn(e.indexURL)};return t}function Rn(e){return function(t){try{t.FS.mkdirTree(e)}catch(n){console.error(`Error occurred while making a home directory '${e}':`),console.error(n),console.error("Using '/' for a home directory instead"),e="/"}t.FS.chdir(e)}}function $n(e){return function(t){Object.assign(t.ENV,e)}}function Fn(e){return e?[async t=>{t.addRunDependency("fsInitHook");try{await e(t.FS,{sitePackages:t.API.sitePackages})}finally{t.removeRunDependency("fsInitHook")}}]:[]}function Mn(e){let t=Zn(e);return async e=>{let n=e._py_version_major(),r=e._py_version_minor();e.FS.mkdirTree("/lib"),e.API.sitePackages=`/lib/python${n}.${r}/site-packages`,e.FS.mkdirTree(e.API.sitePackages),e.addRunDependency("install-stdlib");try{let a=await t;e.FS.writeFile(`/lib/python${n}${r}.zip`,a)}catch(a){console.error("Error occurred while installing the standard library:"),console.error(a)}finally{e.removeRunDependency("install-stdlib")}}}function Ln(e){let t;return t=null!=e.stdLibURL?e.stdLibURL:e.indexURL+"python_stdlib.zip",[...Fn(e.fsInit),Mn(t),Rn(e.env.HOME),$n(e.env),An]}function Dn(e){if(typeof WasmOffsetConverter<"u")return;let{binary:t,response:n}=hn(e+"pyodide.asm.wasm");return function(e,r){return async function(){try{let a;a=n?await WebAssembly.instantiateStreaming(n,e):await WebAssembly.instantiate(await t,e);let{instance:s,module:i}=a;r(s,i)}catch(a){console.warn("wasm instantiation failed!"),console.warn(a)}}(),{}}}Vt(In,"createSettings"),Vt(Rn,"createHomeDirectory"),Vt($n,"setEnvironment"),Vt(Fn,"callFsInitHook"),Vt(Mn,"installStdlib"),Vt(Ln,"getFileSystemInitializationFuncs"),Vt(Dn,"getInstantiateWasmFunc");var zn="0.27.5";async function qn(e={}){var t,n;await xn();let r=e.indexURL||await Pn();r=ln(r),r.endsWith("/")||(r+="/"),e.indexURL=r;let a={fullStdLib:!1,jsglobals:globalThis,stdin:globalThis.prompt?globalThis.prompt:void 0,lockFileURL:r+"pyodide-lock.json",args:[],env:{},packageCacheDir:r,packages:[],enableRunUntilComplete:!1,checkAPIVersion:!0,BUILD_ID:"bd0388b62e760f8ba04185eb443fec955f25434f49c7b951efe5b1f792dbe5d4"},s=Object.assign(a,e);(t=s.env).HOME??(t.HOME="/home/pyodide"),(n=s.env).PYTHONINSPECT??(n.PYTHONINSPECT="1");let i,o=In(s),d=o.API;if(d.lockFilePromise=Nn(s.lockFileURL),"function"!=typeof _createPyodideModule){let e=`${s.indexURL}pyodide.asm.js`;await mn(e)}if(e._loadSnapshot){let t=await e._loadSnapshot;i=ArrayBuffer.isView(t)?t:new Uint8Array(t),o.noInitialRun=!0,o.INITIAL_MEMORY=i.length}let c,u=await _createPyodideModule(o);if(o.exited)throw o.exited.toThrow;if(e.pyproxyToStringRepr&&d.setPyProxyToStringMethod(!0),d.version!==zn&&s.checkAPIVersion)throw new Error(`Pyodide version does not match: '${zn}' <==> '${d.version}'. If you updated the Pyodide version, make sure you also updated the 'indexURL' parameter passed to loadPyodide.`);u.locateFile=e=>{throw new Error("Didn't expect to load any more file_packager files!")},i&&(c=d.restoreSnapshot(i));let l=d.finalizeBootstrap(c,e._snapshotDeserializer);return d.sys.path.insert(0,d.config.env.HOME),l.version.includes("dev")||d.setCdnUrl(`https://cdn.jsdelivr.net/pyodide/v${l.version}/full/`),d._pyodide.set_excepthook(),await d.packageIndexReady,d.initializeStreams(s.stdin,s.stdout,s.stderr),l}function Un(e){return e.FS}Vt(qn,"loadPyodide");const Vn=e=>(new TextDecoder).decode(e),Hn="notebook.py",Bn="/marimo",Wn=Hn,Kn=e=>{const t=Un(e);try{t.mkdirTree(Bn)}catch{}t.chdir(Bn)},Jn=e=>{Un(e).mount(e.FS.filesystems.IDBFS,{root:"."},Bn)},Yn=async e=>{await Xn(e,!0)},Gn=e=>{const{pyodide:t,filename:n,code:r}=e,a=Un(t);if(n&&n!==Hn){const e=(e=>{try{return Vn(a.readFile(e))}catch{return null}})(n);if(e)return{code:e,filename:n}}return a.writeFile(Hn,r),{code:r,filename:Hn}};function Xn(e,t){return new Promise(((n,r)=>{Un(e).syncfs(t,(e=>{e instanceof Error?r(e):n()}))}))}const Qn=new class{constructor(){this.spans=[]}startSpan(e,t={}){const n={name:e,startTime:Date.now(),attributes:t,end:(e="ok")=>this.endSpan(n,e)};return this.spans.push(n),n}endSpan(e,t="ok"){e.endTime=Date.now(),e.status=t}getSpans(){return this.spans}wrap(e,t,n={}){const r=this.startSpan(t||e.name,n);try{const t=e();return this.endSpan(r),t}catch(a){throw this.endSpan(r,"error"),a}}wrapAsync(e,t,n={}){return async(...r)=>{const a=this.startSpan(t||e.name,n);try{const t=await e(...r);return this.endSpan(a),t}catch(s){throw this.endSpan(a,"error"),s}}}logSpans(){}};globalThis.t=Qn;class er{constructor(){this.pyodide=null}get requirePyodide(){return Pt(this.pyodide,"Pyodide not loaded"),this.pyodide}async bootstrap(e){return await this.loadPyodideAndPackages(e)}async loadPyodideAndPackages(e){if(!qn)throw new Error("loadPyodide is not defined");const t=Qn.startSpan("loadPyodide");try{const n=await qn({packages:["micropip","marimo-base","Markdown","pymdown-extensions","narwhals","packaging"],_makeSnapshot:false,lockFileURL:`https://wasm.marimo.app/pyodide-lock.json?v=${e.version}&pyodide=${e.pyodideVersion}`,indexURL:`https://cdn.jsdelivr.net/pyodide/${e.pyodideVersion}/full/`});return this.pyodide=n,t.end("ok"),n}catch(n){throw $t.error("Failed to load Pyodide",n),n}}async mountFilesystem(e){const t=Qn.startSpan("mountFilesystem");return Kn(this.requirePyodide),Jn(this.requirePyodide),await Yn(this.requirePyodide),t.end("ok"),Gn({pyodide:this.requirePyodide,code:e.code,filename:e.filename})}async startSession(e){const{code:t,filename:n,onMessage:r,queryParameters:a,userConfig:s}=e;self.messenger={callback:r},self.query_params=a,self.user_config=s;const i=Qn.startSpan("startSession.runPython"),o=n||Wn,[d,c,u]=this.requirePyodide.runPython(`\n print("[py] Starting marimo...")\n import asyncio\n import js\n from marimo._pyodide.bootstrap import create_session, instantiate\n\n assert js.messenger, "messenger is not defined"\n assert js.query_params, "query_params is not defined"\n\n session, bridge = create_session(\n filename="${o}",\n query_params=js.query_params.to_py(),\n message_callback=js.messenger.callback,\n user_config=js.user_config.to_py(),\n )\n\n def init(auto_instantiate=True):\n instantiate(session, auto_instantiate)\n asyncio.create_task(session.start())\n\n # Find the packages to install\n with open("${o}", "r") as f:\n packages = session.find_packages(f.read())\n\n bridge, init, packages`);i.end();const l=new Set(u.toJs());return this.loadNotebookDeps(t,l).then((()=>c(s.runtime.auto_instantiate))),d}async loadNotebookDeps(e,t){const n=this.requirePyodide;e.includes("mo.sql")&&(e=`import sqlglot\n${e=`import duckdb\n${e=`import pandas\n${e}`}`}`).includes("polars")&&(e=`import pyarrow\n${e}`),e=`import pyodide_http\n${e=`import jedi\n${e=`import pygments\n${e=`import docutils\n${e}`}`}`}`;const r=[...t];let a=Qn.startSpan("pyodide.loadPackage");await n.loadPackagesFromImports(e,{errorCallback:$t.error,messageCallback:$t.log}),a.end(),a=Qn.startSpan("micropip.install");const s=r.filter((e=>!n.loadedPackages[e]));s.length>0&&await n.runPythonAsync(`\n import micropip\n import sys\n # Filter out builtins\n missing = [p for p in ${JSON.stringify(s)} if p not in sys.modules]\n if len(missing) > 0:\n print("Loading from micropip:", missing)\n await micropip.install(missing)\n `).catch((e=>{$t.error("Failed to load packages from micropip",e)})),a.end()}}class tr extends er{async bootstrap(e){return await super.bootstrap(e)}async mountFilesystem(e){const{code:t,filename:n}=e;try{return Kn(this.requirePyodide),Gn({pyodide:this.requirePyodide,code:t,filename:n})}catch(r){$t.error(r)}return{code:t,filename:n}}async startSession(e){return super.startSession({queryParameters:{},code:e.code,filename:e.filename,onMessage:e.onMessage,userConfig:Lt.parse({})})}}const nr=async function(){const e=self.name,t=function(e){return e.includes("dev"),`v${zn}`}(e);try{self.controller=new tr,self.pyodide=await self.controller.bootstrap({version:e,pyodideVersion:t})}catch(n){$t.error("Error bootstrapping",n),ir.send.initializedError({error:Tt(n)})}}(),rr=new class{constructor(e){this.onMessage=e,this.started=!1,this.push=e=>{this.started?this.onMessage(e):this.buffer.push(e)},this.start=()=>{this.started=!0,this.buffer.forEach((e=>this.onMessage(e))),this.buffer=[]},this.buffer=[]}}((e=>{ir.send.kernelMessage({message:e})})),ar=new class{constructor(){this.status="pending",this.promise=new Promise(((e,t)=>{this.reject=e=>{this.status="rejected",t(e)},this.resolve=t=>{this.status="resolved",e(t)}}))}},sr={startSession:async e=>{await nr;try{Pt(self.controller,"Controller not loaded");const t=await self.controller.mountFilesystem({code:e.code,filename:`app-${e.appId}.py`}),n=await self.controller.startSession({...t,onMessage:rr.push});ar.resolve(n),ir.send.initialized({})}catch(t){ir.send.initializedError({error:Tt(t)})}},loadPackages:async e=>{await nr,e.includes("mo.sql")&&(e=`import sqlglot\n${e=`import duckdb\n${e=`import pandas\n${e}`}`}`).includes("polars")&&(e=`import pyarrow\n${e}`),await self.pyodide.loadPackagesFromImports(e,{messageCallback:$t.log,errorCallback:$t.error})},bridge:async e=>{await nr;const{functionName:t,payload:n}=e,r=await ar.promise,a=null==n?null:"string"==typeof n?n:JSON.stringify(n),s=null==a?await r[t]():await r[t](a);return"string"==typeof s?JSON.parse(s):s}},ir=function(e){return Zt(e)}({transport:(or={transportId:"marimo-transport"},Nt(self,or)),requestHandler:sr});var or;ir.send("ready",{}),ir.addMessageListener("consumerReady",(async()=>{await nr,rr.start()}));
|
package/dist/assets/{xychartDiagram-VJFVF3MP-ugyREHe3.js → xychartDiagram-VJFVF3MP-CpjbxNqa.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var F,N,V,X,Y,U,H,G,j,Q;import{_ as a,s as ai,g as hi,q as Mt,p as oi,a as ri,b as li,l as It,I as ci,d as gi,y as ui,F as ut,E as $t,G as xi,L as di,h as pi,a8 as fi}from"./mermaid-
|
|
1
|
+
var F,N,V,X,Y,U,H,G,j,Q;import{_ as a,s as ai,g as hi,q as Mt,p as oi,a as ri,b as li,l as It,I as ci,d as gi,y as ui,F as ut,E as $t,G as xi,L as di,h as pi,a8 as fi}from"./mermaid-DbxZrpQo.js";import"./transform-Cyp0GDF-.js";import{i as mi}from"./init-DLRA0X12.js";import{o as yi}from"./ordinal-DDUp3AbE.js";import{r as bi}from"./range-CtcPcB_L.js";import{l as Bt}from"./linear-DUrMGtqo.js";import{l as zt}from"./step-BwsUM5iJ.js";import"./index-GsZwVOm_.js";import"./timer-DFzT7np-.js";function xt(){var e,t,i=yi().unknown(void 0),s=i.domain,n=i.range,r=0,l=1,d=!1,x=0,_=0,T=.5;function S(){var m=s().length,D=l<r,C=D?l:r,L=D?r:l;e=(L-C)/Math.max(1,m-x+2*_),d&&(e=Math.floor(e)),C+=(L-C-e*(m-x))*T,t=e*(1-x),d&&(C=Math.round(C),t=Math.round(t));var f=bi(m).map(function(k){return C+e*k});return n(D?f.reverse():f)}return delete i.unknown,i.domain=function(m){return arguments.length?(s(m),S()):s()},i.range=function(m){return arguments.length?([r,l]=m,r=+r,l=+l,S()):[r,l]},i.rangeRound=function(m){return[r,l]=m,r=+r,l=+l,d=!0,S()},i.bandwidth=function(){return t},i.step=function(){return e},i.round=function(m){return arguments.length?(d=!!m,S()):d},i.padding=function(m){return arguments.length?(x=Math.min(1,_=+m),S()):x},i.paddingInner=function(m){return arguments.length?(x=Math.min(1,m),S()):x},i.paddingOuter=function(m){return arguments.length?(_=+m,S()):_},i.align=function(m){return arguments.length?(T=Math.max(0,Math.min(1,m)),S()):T},i.copy=function(){return xt(s(),[r,l]).round(d).paddingInner(x).paddingOuter(_).align(T)},mi.apply(S(),arguments)}var dt=function(){var e=a(function(o,b,g,u){for(g=g||{},u=o.length;u--;g[o[u]]=b);return g},"o"),t=[1,10,12,14,16,18,19,21,23],i=[2,6],s=[1,3],n=[1,5],r=[1,6],l=[1,7],d=[1,5,10,12,14,16,18,19,21,23,34,35,36],x=[1,25],_=[1,26],T=[1,28],S=[1,29],m=[1,30],D=[1,31],C=[1,32],L=[1,33],f=[1,34],k=[1,35],c=[1,36],v=[1,37],K=[1,43],_t=[1,42],Tt=[1,47],tt=[1,50],w=[1,10,12,14,16,18,19,21,23,34,35,36],rt=[1,10,12,14,16,18,19,21,23,24,26,27,28,34,35,36],E=[1,10,12,14,16,18,19,21,23,24,26,27,28,34,35,36,41,42,43,44,45,46,47,48,49,50],Rt=[1,64],lt={trace:a(function(){},"trace"),yy:{},symbols_:{error:2,start:3,eol:4,XYCHART:5,chartConfig:6,document:7,CHART_ORIENTATION:8,statement:9,title:10,text:11,X_AXIS:12,parseXAxis:13,Y_AXIS:14,parseYAxis:15,LINE:16,plotData:17,BAR:18,acc_title:19,acc_title_value:20,acc_descr:21,acc_descr_value:22,acc_descr_multiline_value:23,SQUARE_BRACES_START:24,commaSeparatedNumbers:25,SQUARE_BRACES_END:26,NUMBER_WITH_DECIMAL:27,COMMA:28,xAxisData:29,bandData:30,ARROW_DELIMITER:31,commaSeparatedTexts:32,yAxisData:33,NEWLINE:34,SEMI:35,EOF:36,alphaNum:37,STR:38,MD_STR:39,alphaNumToken:40,AMP:41,NUM:42,ALPHA:43,PLUS:44,EQUALS:45,MULT:46,DOT:47,BRKT:48,MINUS:49,UNDERSCORE:50,$accept:0,$end:1},terminals_:{2:"error",5:"XYCHART",8:"CHART_ORIENTATION",10:"title",12:"X_AXIS",14:"Y_AXIS",16:"LINE",18:"BAR",19:"acc_title",20:"acc_title_value",21:"acc_descr",22:"acc_descr_value",23:"acc_descr_multiline_value",24:"SQUARE_BRACES_START",26:"SQUARE_BRACES_END",27:"NUMBER_WITH_DECIMAL",28:"COMMA",31:"ARROW_DELIMITER",34:"NEWLINE",35:"SEMI",36:"EOF",38:"STR",39:"MD_STR",41:"AMP",42:"NUM",43:"ALPHA",44:"PLUS",45:"EQUALS",46:"MULT",47:"DOT",48:"BRKT",49:"MINUS",50:"UNDERSCORE"},productions_:[0,[3,2],[3,3],[3,2],[3,1],[6,1],[7,0],[7,2],[9,2],[9,2],[9,2],[9,2],[9,2],[9,3],[9,2],[9,3],[9,2],[9,2],[9,1],[17,3],[25,3],[25,1],[13,1],[13,2],[13,1],[29,1],[29,3],[30,3],[32,3],[32,1],[15,1],[15,2],[15,1],[33,3],[4,1],[4,1],[4,1],[11,1],[11,1],[11,1],[37,1],[37,2],[40,1],[40,1],[40,1],[40,1],[40,1],[40,1],[40,1],[40,1],[40,1],[40,1]],performAction:a(function(o,b,g,u,A,h,q){var p=h.length-1;switch(A){case 5:u.setOrientation(h[p]);break;case 9:u.setDiagramTitle(h[p].text.trim());break;case 12:u.setLineData({text:"",type:"text"},h[p]);break;case 13:u.setLineData(h[p-1],h[p]);break;case 14:u.setBarData({text:"",type:"text"},h[p]);break;case 15:u.setBarData(h[p-1],h[p]);break;case 16:this.$=h[p].trim(),u.setAccTitle(this.$);break;case 17:case 18:this.$=h[p].trim(),u.setAccDescription(this.$);break;case 19:case 27:this.$=h[p-1];break;case 20:this.$=[Number(h[p-2]),...h[p]];break;case 21:this.$=[Number(h[p])];break;case 22:u.setXAxisTitle(h[p]);break;case 23:u.setXAxisTitle(h[p-1]);break;case 24:u.setXAxisTitle({type:"text",text:""});break;case 25:u.setXAxisBand(h[p]);break;case 26:u.setXAxisRangeData(Number(h[p-2]),Number(h[p]));break;case 28:this.$=[h[p-2],...h[p]];break;case 29:this.$=[h[p]];break;case 30:u.setYAxisTitle(h[p]);break;case 31:u.setYAxisTitle(h[p-1]);break;case 32:u.setYAxisTitle({type:"text",text:""});break;case 33:u.setYAxisRangeData(Number(h[p-2]),Number(h[p]));break;case 37:case 38:this.$={text:h[p],type:"text"};break;case 39:this.$={text:h[p],type:"markdown"};break;case 40:this.$=h[p];break;case 41:this.$=h[p-1]+""+h[p]}},"anonymous"),table:[e(t,i,{3:1,4:2,7:4,5:s,34:n,35:r,36:l}),{1:[3]},e(t,i,{4:2,7:4,3:8,5:s,34:n,35:r,36:l}),e(t,i,{4:2,7:4,6:9,3:10,5:s,8:[1,11],34:n,35:r,36:l}),{1:[2,4],9:12,10:[1,13],12:[1,14],14:[1,15],16:[1,16],18:[1,17],19:[1,18],21:[1,19],23:[1,20]},e(d,[2,34]),e(d,[2,35]),e(d,[2,36]),{1:[2,1]},e(t,i,{4:2,7:4,3:21,5:s,34:n,35:r,36:l}),{1:[2,3]},e(d,[2,5]),e(t,[2,7],{4:22,34:n,35:r,36:l}),{11:23,37:24,38:x,39:_,40:27,41:T,42:S,43:m,44:D,45:C,46:L,47:f,48:k,49:c,50:v},{11:39,13:38,24:K,27:_t,29:40,30:41,37:24,38:x,39:_,40:27,41:T,42:S,43:m,44:D,45:C,46:L,47:f,48:k,49:c,50:v},{11:45,15:44,27:Tt,33:46,37:24,38:x,39:_,40:27,41:T,42:S,43:m,44:D,45:C,46:L,47:f,48:k,49:c,50:v},{11:49,17:48,24:tt,37:24,38:x,39:_,40:27,41:T,42:S,43:m,44:D,45:C,46:L,47:f,48:k,49:c,50:v},{11:52,17:51,24:tt,37:24,38:x,39:_,40:27,41:T,42:S,43:m,44:D,45:C,46:L,47:f,48:k,49:c,50:v},{20:[1,53]},{22:[1,54]},e(w,[2,18]),{1:[2,2]},e(w,[2,8]),e(w,[2,9]),e(rt,[2,37],{40:55,41:T,42:S,43:m,44:D,45:C,46:L,47:f,48:k,49:c,50:v}),e(rt,[2,38]),e(rt,[2,39]),e(E,[2,40]),e(E,[2,42]),e(E,[2,43]),e(E,[2,44]),e(E,[2,45]),e(E,[2,46]),e(E,[2,47]),e(E,[2,48]),e(E,[2,49]),e(E,[2,50]),e(E,[2,51]),e(w,[2,10]),e(w,[2,22],{30:41,29:56,24:K,27:_t}),e(w,[2,24]),e(w,[2,25]),{31:[1,57]},{11:59,32:58,37:24,38:x,39:_,40:27,41:T,42:S,43:m,44:D,45:C,46:L,47:f,48:k,49:c,50:v},e(w,[2,11]),e(w,[2,30],{33:60,27:Tt}),e(w,[2,32]),{31:[1,61]},e(w,[2,12]),{17:62,24:tt},{25:63,27:Rt},e(w,[2,14]),{17:65,24:tt},e(w,[2,16]),e(w,[2,17]),e(E,[2,41]),e(w,[2,23]),{27:[1,66]},{26:[1,67]},{26:[2,29],28:[1,68]},e(w,[2,31]),{27:[1,69]},e(w,[2,13]),{26:[1,70]},{26:[2,21],28:[1,71]},e(w,[2,15]),e(w,[2,26]),e(w,[2,27]),{11:59,32:72,37:24,38:x,39:_,40:27,41:T,42:S,43:m,44:D,45:C,46:L,47:f,48:k,49:c,50:v},e(w,[2,33]),e(w,[2,19]),{25:73,27:Rt},{26:[2,28]},{26:[2,20]}],defaultActions:{8:[2,1],10:[2,3],21:[2,2],72:[2,28],73:[2,20]},parseError:a(function(o,b){if(!b.recoverable){var g=new Error(o);throw g.hash=b,g}this.trace(o)},"parseError"),parse:a(function(o){var b=this,g=[0],u=[],A=[null],h=[],q=this.table,p="",et=0,Dt=0,si=h.slice.call(arguments,1),R=Object.create(this.lexer),B={yy:{}};for(var ct in this.yy)Object.prototype.hasOwnProperty.call(this.yy,ct)&&(B.yy[ct]=this.yy[ct]);R.setInput(o,B.yy),B.yy.lexer=R,B.yy.parser=this,R.yylloc===void 0&&(R.yylloc={});var gt=R.yylloc;h.push(gt);var ni=R.options&&R.options.ranges;function Lt(){var I;return typeof(I=u.pop()||R.lex()||1)!="number"&&(I instanceof Array&&(I=(u=I).pop()),I=b.symbols_[I]||I),I}typeof B.yy.parseError=="function"?this.parseError=B.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError,a(function(I){g.length=g.length-2*I,A.length=A.length-I,h.length=h.length-I},"popStack"),a(Lt,"lex");for(var P,z,M,Pt,st,$,vt,nt,O={};;){if(z=g[g.length-1],this.defaultActions[z]?M=this.defaultActions[z]:(P==null&&(P=Lt()),M=q[z]&&q[z][P]),M===void 0||!M.length||!M[0]){var Et="";for(st in nt=[],q[z])this.terminals_[st]&&st>2&&nt.push("'"+this.terminals_[st]+"'");Et=R.showPosition?"Parse error on line "+(et+1)+`:
|
|
2
2
|
`+R.showPosition()+`
|
|
3
3
|
Expecting `+nt.join(", ")+", got '"+(this.terminals_[P]||P)+"'":"Parse error on line "+(et+1)+": Unexpected "+(P==1?"end of input":"'"+(this.terminals_[P]||P)+"'"),this.parseError(Et,{text:R.match,token:this.terminals_[P]||P,line:R.yylineno,loc:gt,expected:nt})}if(M[0]instanceof Array&&M.length>1)throw new Error("Parse Error: multiple actions possible at state: "+z+", token: "+P);switch(M[0]){case 1:g.push(P),A.push(R.yytext),h.push(R.yylloc),g.push(M[1]),P=null,Dt=R.yyleng,p=R.yytext,et=R.yylineno,gt=R.yylloc;break;case 2:if($=this.productions_[M[1]][1],O.$=A[A.length-$],O._$={first_line:h[h.length-($||1)].first_line,last_line:h[h.length-1].last_line,first_column:h[h.length-($||1)].first_column,last_column:h[h.length-1].last_column},ni&&(O._$.range=[h[h.length-($||1)].range[0],h[h.length-1].range[1]]),(Pt=this.performAction.apply(O,[p,Dt,et,B.yy,M[1],A,h].concat(si)))!==void 0)return Pt;$&&(g=g.slice(0,-1*$*2),A=A.slice(0,-1*$),h=h.slice(0,-1*$)),g.push(this.productions_[M[1]][0]),A.push(O.$),h.push(O._$),vt=q[g[g.length-2]][g[g.length-1]],g.push(vt);break;case 3:return!0}}return!0},"parse")},ei=function(){return{EOF:1,parseError:a(function(o,b){if(!this.yy.parser)throw new Error(o);this.yy.parser.parseError(o,b)},"parseError"),setInput:a(function(o,b){return this.yy=b||this.yy||{},this._input=o,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:a(function(){var o=this._input[0];return this.yytext+=o,this.yyleng++,this.offset++,this.match+=o,this.matched+=o,o.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),o},"input"),unput:a(function(o){var b=o.length,g=o.split(/(?:\r\n?|\n)/g);this._input=o+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-b),this.offset-=b;var u=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),g.length-1&&(this.yylineno-=g.length-1);var A=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:g?(g.length===u.length?this.yylloc.first_column:0)+u[u.length-g.length].length-g[0].length:this.yylloc.first_column-b},this.options.ranges&&(this.yylloc.range=[A[0],A[0]+this.yyleng-b]),this.yyleng=this.yytext.length,this},"unput"),more:a(function(){return this._more=!0,this},"more"),reject:a(function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
|
|
4
4
|
`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"reject"),less:a(function(o){this.unput(this.match.slice(o))},"less"),pastInput:a(function(){var o=this.matched.substr(0,this.matched.length-this.match.length);return(o.length>20?"...":"")+o.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:a(function(){var o=this.match;return o.length<20&&(o+=this._input.substr(0,20-o.length)),(o.substr(0,20)+(o.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:a(function(){var o=this.pastInput(),b=new Array(o.length+1).join("-");return o+this.upcomingInput()+`
|
package/dist/index.html
CHANGED
|
@@ -59,8 +59,8 @@
|
|
|
59
59
|
<marimo-app-config data-config='{{ app_config }}' hidden></marimo-app-config>
|
|
60
60
|
<marimo-server-token data-token='{{ server_token }}' hidden></marimo-server-token>
|
|
61
61
|
<title>{{ title }}</title>
|
|
62
|
-
<script type="module" crossorigin src="./assets/index-
|
|
63
|
-
<link rel="stylesheet" crossorigin href="./assets/index-
|
|
62
|
+
<script type="module" crossorigin src="./assets/index-GsZwVOm_.js"></script>
|
|
63
|
+
<link rel="stylesheet" crossorigin href="./assets/index-w3t2_3nw.css">
|
|
64
64
|
</head>
|
|
65
65
|
<body>
|
|
66
66
|
<div id="root"></div>
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{b as m}from"./_baseEach-C1pHosxb.js";import{x as s}from"./index-DhpCbssu.js";function e(r,o){var a=-1,t=s(r)?Array(r.length):[];return m(r,function(n,f,i){t[++a]=o(n,f,i)}),t}export{e as b};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{U as s,C as o}from"./mermaid-0EZvq4Jv.js";const n=(a,r)=>s.lang.round(o.parse(a)[r]);export{n as c};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{s as a,c as s,a as t,C as o}from"./chunk-A2AXSNBT-Bjt-wnKZ.js";import{_ as e}from"./mermaid-0EZvq4Jv.js";import"./transform-Cyp0GDF-.js";import"./chunk-RZ5BOZE2-ClaY-eM7.js";import"./index-DhpCbssu.js";import"./step-BwsUM5iJ.js";import"./timer-DFzT7np-.js";var i={parser:t,get db(){return new o},renderer:s,styles:a,init:e(r=>{r.class||(r.class={}),r.class.arrowMarkerAbsolute=r.arrowMarkerAbsolute},"init")};export{i as diagram};
|