@object-ui/plugin-timeline 0.3.1 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,7 +1,45 @@
1
- (function(o,y){typeof exports=="object"&&typeof module<"u"?y(exports,require("react"),require("@object-ui/components"),require("@object-ui/core")):typeof define=="function"&&define.amd?define(["exports","react","@object-ui/components","@object-ui/core"],y):(o=typeof globalThis<"u"?globalThis:o||self,y(o.ObjectUIPluginTimeline={},o.React,o.ObjectUIComponents,o.ObjectUICore))})(this,(function(o,y,v,ue){"use strict";function me(t){const a=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const r in t)if(r!=="default"){const m=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(a,r,m.get?m:{enumerable:!0,get:()=>t[r]})}}return a.default=t,Object.freeze(a)}const T=me(y);var E={exports:{}},_={};var re;function fe(){if(re)return _;re=1;var t=Symbol.for("react.transitional.element"),a=Symbol.for("react.fragment");function r(m,s,c){var x=null;if(c!==void 0&&(x=""+c),s.key!==void 0&&(x=""+s.key),"key"in s){c={};for(var l in s)l!=="key"&&(c[l]=s[l])}else c=s;return s=c.ref,{$$typeof:t,type:m,key:x,ref:s!==void 0?s:null,props:c}}return _.Fragment=a,_.jsx=r,_.jsxs=r,_}var N={};var ae;function be(){return ae||(ae=1,process.env.NODE_ENV!=="production"&&(function(){function t(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===Ne?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case u:return"Fragment";case ge:return"Profiler";case F:return"StrictMode";case ye:return"Suspense";case Re:return"SuspenseList";case _e:return"Activity"}if(typeof e=="object")switch(typeof e.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),e.$$typeof){case g:return"Portal";case we:return e.displayName||"Context";case xe:return(e._context.displayName||"Context")+".Consumer";case je:var i=e.render;return e=e.displayName,e||(e=i.displayName||i.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case De:return i=e.displayName||null,i!==null?i:t(e.type)||"Memo";case X:i=e._payload,e=e._init;try{return t(e(i))}catch{}}return null}function a(e){return""+e}function r(e){try{a(e);var i=!1}catch{i=!0}if(i){i=console;var d=i.error,f=typeof Symbol=="function"&&Symbol.toStringTag&&e[Symbol.toStringTag]||e.constructor.name||"Object";return d.call(i,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",f),a(e)}}function m(e){if(e===u)return"<>";if(typeof e=="object"&&e!==null&&e.$$typeof===X)return"<...>";try{var i=t(e);return i?"<"+i+">":"<...>"}catch{return"<...>"}}function s(){var e=Z.A;return e===null?null:e.getOwner()}function c(){return Error("react-stack-top-frame")}function x(e){if(ie.call(e,"key")){var i=Object.getOwnPropertyDescriptor(e,"key").get;if(i&&i.isReactWarning)return!1}return e.key!==void 0}function l(e,i){function d(){le||(le=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",i))}d.isReactWarning=!0,Object.defineProperty(e,"key",{get:d,configurable:!0})}function w(){var e=t(this.type);return se[e]||(se[e]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),e=this.props.ref,e!==void 0?e:null}function R(e,i,d,f,L,ee){var b=d.ref;return e={$$typeof:h,type:e,key:i,props:d,_owner:f},(b!==void 0?b:null)!==null?Object.defineProperty(e,"ref",{enumerable:!1,get:w}):Object.defineProperty(e,"ref",{enumerable:!1,value:null}),e._store={},Object.defineProperty(e._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(e,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(e,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:L}),Object.defineProperty(e,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:ee}),Object.freeze&&(Object.freeze(e.props),Object.freeze(e)),e}function j(e,i,d,f,L,ee){var b=i.children;if(b!==void 0)if(f)if(Ee(b)){for(f=0;f<b.length;f++)Q(b[f]);Object.freeze&&Object.freeze(b)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else Q(b);if(ie.call(i,"key")){b=t(e);var D=Object.keys(i).filter(function(Se){return Se!=="key"});f=0<D.length?"{key: someKey, "+D.join(": ..., ")+": ...}":"{key: someKey}",de[b+f]||(D=0<D.length?"{"+D.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
1
+ (function(z,F){typeof exports=="object"&&typeof module<"u"?F(exports,require("react"),require("@object-ui/components"),require("@object-ui/core"),require("@object-ui/react")):typeof define=="function"&&define.amd?define(["exports","react","@object-ui/components","@object-ui/core","@object-ui/react"],F):(z=typeof globalThis<"u"?globalThis:z||self,F(z.ObjectUIPluginTimeline={},z.React,z.ObjectUIComponents,z.ObjectUICore,z.ObjectUIReact))})(this,(function(z,F,P,Xe,Qe){"use strict";function nn(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const R=nn(F);var oe={exports:{}},Q={};var et;function rn(){if(et)return Q;et=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(r,o,a){var i=null;if(a!==void 0&&(i=""+a),o.key!==void 0&&(i=""+o.key),"key"in o){a={};for(var s in o)s!=="key"&&(a[s]=o[s])}else a=o;return o=a.ref,{$$typeof:e,type:r,key:i,ref:o!==void 0?o:null,props:a}}return Q.Fragment=t,Q.jsx=n,Q.jsxs=n,Q}var ee={};var tt;function on(){return tt||(tt=1,process.env.NODE_ENV!=="production"&&(function(){function e(l){if(l==null)return null;if(typeof l=="function")return l.$$typeof===Pa?null:l.displayName||l.name||null;if(typeof l=="string")return l;switch(l){case w:return"Fragment";case U:return"Profiler";case V:return"StrictMode";case qt:return"Suspense";case We:return"SuspenseList";case Ea:return"Activity"}if(typeof l=="object")switch(typeof l.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),l.$$typeof){case v:return"Portal";case N:return l.displayName||"Context";case C:return(l._context.displayName||"Context")+".Consumer";case I:var y=l.render;return l=l.displayName,l||(l=y.displayName||y.name||"",l=l!==""?"ForwardRef("+l+")":"ForwardRef"),l;case Za:return y=l.displayName||null,y!==null?y:e(l.type)||"Memo";case Ye:y=l._payload,l=l._init;try{return e(l(y))}catch{}}return null}function t(l){return""+l}function n(l){try{t(l);var y=!1}catch{y=!0}if(y){y=console;var O=y.error,Z=typeof Symbol=="function"&&Symbol.toStringTag&&l[Symbol.toStringTag]||l.constructor.name||"Object";return O.call(y,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",Z),t(l)}}function r(l){if(l===w)return"<>";if(typeof l=="object"&&l!==null&&l.$$typeof===Ye)return"<...>";try{var y=e(l);return y?"<"+y+">":"<...>"}catch{return"<...>"}}function o(){var l=Be.A;return l===null?null:l.getOwner()}function a(){return Error("react-stack-top-frame")}function i(l){if(Kt.call(l,"key")){var y=Object.getOwnPropertyDescriptor(l,"key").get;if(y&&y.isReactWarning)return!1}return l.key!==void 0}function s(l,y){function O(){Ht||(Ht=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",y))}O.isReactWarning=!0,Object.defineProperty(l,"key",{get:O,configurable:!0})}function c(){var l=e(this.type);return Xt[l]||(Xt[l]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),l=this.props.ref,l!==void 0?l:null}function f(l,y,O,Z,$e,Ke){var E=O.ref;return l={$$typeof:b,type:l,key:y,props:O,_owner:Z},(E!==void 0?E:null)!==null?Object.defineProperty(l,"ref",{enumerable:!1,get:c}):Object.defineProperty(l,"ref",{enumerable:!1,value:null}),l._store={},Object.defineProperty(l._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(l,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(l,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:$e}),Object.defineProperty(l,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:Ke}),Object.freeze&&(Object.freeze(l.props),Object.freeze(l)),l}function d(l,y,O,Z,$e,Ke){var E=y.children;if(E!==void 0)if(Z)if(Ra(E)){for(Z=0;Z<E.length;Z++)_(E[Z]);Object.freeze&&Object.freeze(E)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else _(E);if(Kt.call(y,"key")){E=e(l);var X=Object.keys(y).filter(function(Da){return Da!=="key"});Z=0<X.length?"{key: someKey, "+X.join(": ..., ")+": ...}":"{key: someKey}",tn[E+Z]||(X=0<X.length?"{"+X.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
2
2
  let props = %s;
3
3
  <%s {...props} />
4
4
  React keys must be passed directly to JSX without using spread:
5
5
  let props = %s;
6
- <%s key={someKey} {...props} />`,f,b,D,b),de[b+f]=!0)}if(b=null,d!==void 0&&(r(d),b=""+d),x(i)&&(r(i.key),b=""+i.key),"key"in i){d={};for(var te in i)te!=="key"&&(d[te]=i[te])}else d=i;return b&&l(d,typeof e=="function"?e.displayName||e.name||"Unknown":e),R(e,b,d,s(),L,ee)}function Q(e){M(e)?e._store&&(e._store.validated=1):typeof e=="object"&&e!==null&&e.$$typeof===X&&(e._payload.status==="fulfilled"?M(e._payload.value)&&e._payload.value._store&&(e._payload.value._store.validated=1):e._store&&(e._store.validated=1))}function M(e){return typeof e=="object"&&e!==null&&e.$$typeof===h}var p=y,h=Symbol.for("react.transitional.element"),g=Symbol.for("react.portal"),u=Symbol.for("react.fragment"),F=Symbol.for("react.strict_mode"),ge=Symbol.for("react.profiler"),xe=Symbol.for("react.consumer"),we=Symbol.for("react.context"),je=Symbol.for("react.forward_ref"),ye=Symbol.for("react.suspense"),Re=Symbol.for("react.suspense_list"),De=Symbol.for("react.memo"),X=Symbol.for("react.lazy"),_e=Symbol.for("react.activity"),Ne=Symbol.for("react.client.reference"),Z=p.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ie=Object.prototype.hasOwnProperty,Ee=Array.isArray,K=console.createTask?console.createTask:function(){return null};p={react_stack_bottom_frame:function(e){return e()}};var le,se={},oe=p.react_stack_bottom_frame.bind(p,c)(),ce=K(m(c)),de={};N.Fragment=u,N.jsx=function(e,i,d){var f=1e4>Z.recentlyCreatedOwnerStacks++;return j(e,i,d,!1,f?Error("react-stack-top-frame"):oe,f?K(m(e)):ce)},N.jsxs=function(e,i,d){var f=1e4>Z.recentlyCreatedOwnerStacks++;return j(e,i,d,!0,f?Error("react-stack-top-frame"):oe,f?K(m(e)):ce)}})()),N}var ne;function ve(){return ne||(ne=1,process.env.NODE_ENV==="production"?E.exports=fe():E.exports=be()),E.exports}var n=ve();const Te=10080*60*1e3;function pe(t){const a=t.flatMap(s=>(s.items||[]).flatMap(c=>[c.startDate,c.endDate])),r=Math.min(...a.map(s=>new Date(s).getTime())),m=Math.max(...a.map(s=>new Date(s).getTime()));return{minDate:new Date(r).toISOString().split("T")[0],maxDate:new Date(m).toISOString().split("T")[0]}}function he(t,a,r,m){const s=new Date(t).getTime(),c=new Date(a).getTime(),x=new Date(r).getTime(),w=new Date(m).getTime()-x,R=s-x,j=c-s;return{start:R/w*100,width:j/w*100}}function S(t,a){const r=new Date(t);return a==="short"?r.toLocaleDateString():a==="long"?r.toLocaleDateString("en-US",{year:"numeric",month:"long",day:"numeric"}):r.toISOString().split("T")[0]}ue.ComponentRegistry.register("timeline",({schema:t,className:a,...r})=>{const{variant:m="vertical",items:s=[],dateFormat:c="short",onItemClick:x}=t;if(m==="vertical")return n.jsx(Y,{className:a,...r,children:s.map((l,w)=>n.jsxs($,{className:l.className,children:[n.jsx(k,{variant:l.variant||"default",children:l.icon&&n.jsx("span",{className:"text-xs",children:l.icon})}),n.jsxs(z,{children:[l.time&&n.jsx(P,{dateTime:l.time,children:S(l.time,c)}),l.title&&n.jsx(O,{children:l.title}),l.description&&n.jsx(A,{children:l.description}),l.content&&v.renderChildren(l.content)]})]},w))});if(m==="horizontal")return n.jsx(U,{className:a,...r,children:s.map((l,w)=>n.jsxs(q,{className:l.className,children:[n.jsxs("div",{className:"flex flex-col items-center",children:[n.jsx(k,{variant:l.variant||"default",children:l.icon&&n.jsx("span",{className:"text-xs",children:l.icon})}),n.jsxs("div",{className:"mt-4 text-center",children:[l.time&&n.jsx(P,{dateTime:l.time,children:S(l.time,c)}),l.title&&n.jsx(O,{children:l.title}),l.description&&n.jsx(A,{className:"text-center",children:l.description}),l.content&&v.renderChildren(l.content)]})]}),w<s.length-1&&n.jsx("div",{className:"absolute left-full w-16 border-t-2 border-gray-200 top-3"})]},w))});if(m==="gantt"){const l=pe(s),w=t.minDate||l.minDate,R=t.maxDate||l.maxDate,j=t.timeScale||"month",M=(()=>{const p=[],h=new Date(w),g=new Date(R);if(j==="month"){const u=new Date(h);for(;u<=g;)p.push(u.toLocaleDateString("en-US",{month:"short",year:"numeric"})),u.setMonth(u.getMonth()+1)}else if(j==="week"){const u=new Date(h);for(;u<=g;)p.push(`Week ${Math.ceil((u.getTime()-h.getTime())/Te)+1}`),u.setDate(u.getDate()+7)}else if(j==="day"){const u=new Date(h);for(;u<=g;)p.push(u.toLocaleDateString("en-US",{month:"short",day:"numeric"})),u.setDate(u.getDate()+1)}return p})();return n.jsxs(H,{className:a,...r,children:[n.jsxs(V,{children:[n.jsx(C,{className:"flex items-center px-4 py-3",children:n.jsx("span",{className:"font-semibold text-sm",children:t.rowLabel||"Items"})}),n.jsx(G,{children:n.jsx("div",{className:"flex h-full",children:M.map((p,h)=>n.jsx("div",{className:"flex-1 px-2 py-3 border-r text-xs font-medium text-center",children:p},h))})})]}),n.jsx("div",{children:n.jsxs("div",{className:"flex",children:[n.jsx(C,{children:s.map((p,h)=>n.jsx(I,{children:n.jsx(W,{title:p.label,children:p.label})},h))}),n.jsx(G,{className:"relative",children:s.map((p,h)=>n.jsx(I,{className:"relative",children:(p.items||[]).map((g,u)=>{const F=he(g.startDate,g.endDate,w,R);return n.jsx(B,{start:F.start,width:F.width,variant:g.variant||"default",onClick:()=>x?.(g,p,h,u),title:`${g.title||""}
7
- ${S(g.startDate,c)} - ${S(g.endDate,c)}`,children:n.jsx(J,{children:g.title})},u)})},h))})]})})]})}return null},{label:"Timeline",category:"data-display",inputs:[{name:"variant",type:"enum",enum:["vertical","horizontal","gantt"],label:"Timeline Variant",defaultValue:"vertical"},{name:"items",type:"array",label:"Timeline Items",description:"For vertical/horizontal: Array of { time, title, description, variant, icon, content }. For gantt: Array of { label, items: [{ title, startDate, endDate, variant }] }"},{name:"dateFormat",type:"enum",enum:["short","long","iso"],label:"Date Format",defaultValue:"short"},{name:"timeScale",type:"enum",enum:["day","week","month"],label:"Time Scale (Gantt only)",defaultValue:"month"},{name:"rowLabel",type:"string",label:"Row Label (Gantt only)",defaultValue:"Items"},{name:"minDate",type:"string",label:"Min Date (Gantt only)",description:"Override auto-calculated min date (YYYY-MM-DD)"},{name:"maxDate",type:"string",label:"Max Date (Gantt only)",description:"Override auto-calculated max date (YYYY-MM-DD)"},{name:"className",type:"string",label:"CSS Class"}],defaultProps:{variant:"vertical",dateFormat:"short",items:[{time:"2024-01-15",title:"Project Started",description:"Kickoff meeting and initial planning",variant:"success",icon:"🚀"},{time:"2024-02-01",title:"First Milestone",description:"Completed initial design phase",variant:"info",icon:"🎨"},{time:"2024-03-15",title:"Beta Release",description:"Released beta version to testers",variant:"warning",icon:"⚡"},{time:"2024-04-01",title:"Launch",description:"Official product launch",variant:"success",icon:"🎉"}]},examples:{vertical:{variant:"vertical",dateFormat:"long",items:[{time:"2024-01-15",title:"Project Started",description:"Kickoff meeting and initial planning",variant:"success"},{time:"2024-02-01",title:"First Milestone",description:"Completed initial design phase",variant:"info"}]},horizontal:{variant:"horizontal",dateFormat:"short",items:[{time:"2024-01-01",title:"Q1",description:"First quarter",variant:"default"},{time:"2024-04-01",title:"Q2",description:"Second quarter",variant:"info"},{time:"2024-07-01",title:"Q3",description:"Third quarter",variant:"warning"},{time:"2024-10-01",title:"Q4",description:"Fourth quarter",variant:"success"}]},gantt:{variant:"gantt",dateFormat:"short",timeScale:"month",rowLabel:"Projects",items:[{label:"Backend Development",items:[{title:"API Design",startDate:"2024-01-01",endDate:"2024-01-31",variant:"success"},{title:"Implementation",startDate:"2024-02-01",endDate:"2024-03-31",variant:"info"}]},{label:"Frontend Development",items:[{title:"UI Design",startDate:"2024-01-15",endDate:"2024-02-15",variant:"warning"},{title:"Component Dev",startDate:"2024-02-15",endDate:"2024-04-15",variant:"default"}]},{label:"Testing",items:[{title:"QA Phase",startDate:"2024-03-01",endDate:"2024-04-30",variant:"danger"}]}]}}});const Y=T.forwardRef(({className:t,...a},r)=>n.jsx("ol",{ref:r,className:v.cn("relative border-l border-gray-200",t),...a}));Y.displayName="Timeline";const $=T.forwardRef(({className:t,...a},r)=>n.jsx("li",{ref:r,className:v.cn("mb-10 ml-6",t),...a}));$.displayName="TimelineItem";const k=T.forwardRef(({className:t,variant:a="default",...r},m)=>{const s={default:"bg-gray-200 border-gray-300",success:"bg-green-200 border-green-500",warning:"bg-yellow-200 border-yellow-500",danger:"bg-red-200 border-red-500",info:"bg-blue-200 border-blue-500"};return n.jsx("div",{ref:m,className:v.cn("absolute -left-3 w-6 h-6 rounded-full border-2 flex items-center justify-center",s[a],t),...r})});k.displayName="TimelineMarker";const z=T.forwardRef(({className:t,...a},r)=>n.jsx("div",{ref:r,className:t,...a}));z.displayName="TimelineContent";const O=T.forwardRef(({className:t,...a},r)=>n.jsx("h3",{ref:r,className:v.cn("font-semibold text-lg mb-1",t),...a}));O.displayName="TimelineTitle";const P=T.forwardRef(({className:t,...a},r)=>n.jsx("time",{ref:r,className:v.cn("text-sm font-normal text-gray-500 mb-2 block",t),...a}));P.displayName="TimelineTime";const A=T.forwardRef(({className:t,...a},r)=>n.jsx("p",{ref:r,className:v.cn("text-base text-gray-700",t),...a}));A.displayName="TimelineDescription";const U=T.forwardRef(({className:t,...a},r)=>n.jsx("div",{ref:r,className:v.cn("relative flex overflow-x-auto py-8",t),...a}));U.displayName="TimelineHorizontal";const q=T.forwardRef(({className:t,...a},r)=>n.jsx("div",{ref:r,className:v.cn("flex-shrink-0 w-64 relative",t),...a}));q.displayName="TimelineHorizontalItem";const H=T.forwardRef(({className:t,...a},r)=>n.jsx("div",{ref:r,className:v.cn("relative w-full border rounded-lg overflow-hidden",t),...a}));H.displayName="TimelineGantt";const V=T.forwardRef(({className:t,...a},r)=>n.jsx("div",{ref:r,className:v.cn("flex border-b bg-gray-50",t),...a}));V.displayName="TimelineGanttHeader";const C=T.forwardRef(({className:t,...a},r)=>n.jsx("div",{ref:r,className:v.cn("w-48 border-r bg-white",t),...a}));C.displayName="TimelineGanttRowLabels";const G=T.forwardRef(({className:t,...a},r)=>n.jsx("div",{ref:r,className:v.cn("flex-1 overflow-x-auto",t),...a}));G.displayName="TimelineGanttGrid";const I=T.forwardRef(({className:t,...a},r)=>n.jsx("div",{ref:r,className:v.cn("flex items-center border-b min-h-12",t),...a}));I.displayName="TimelineGanttRow";const W=T.forwardRef(({className:t,...a},r)=>n.jsx("div",{ref:r,className:v.cn("px-4 py-2 font-medium text-sm truncate",t),...a}));W.displayName="TimelineGanttLabel";const B=T.forwardRef(({className:t,start:a=0,width:r=100,variant:m="default",...s},c)=>{const x={default:"bg-blue-500 hover:bg-blue-600",success:"bg-green-500 hover:bg-green-600",warning:"bg-yellow-500 hover:bg-yellow-600",danger:"bg-red-500 hover:bg-red-600",info:"bg-purple-500 hover:bg-purple-600"};return n.jsx("div",{ref:c,className:v.cn("absolute h-8 rounded-md transition-colors cursor-pointer",x[m],t),style:{left:`${a}%`,width:`${r}%`},...s})});B.displayName="TimelineGanttBar";const J=T.forwardRef(({className:t,...a},r)=>n.jsx("div",{ref:r,className:v.cn("px-2 py-1 text-white text-xs font-medium truncate",t),...a}));J.displayName="TimelineGanttBarContent",o.Timeline=Y,o.TimelineContent=z,o.TimelineDescription=A,o.TimelineGantt=H,o.TimelineGanttBar=B,o.TimelineGanttBarContent=J,o.TimelineGanttGrid=G,o.TimelineGanttHeader=V,o.TimelineGanttLabel=W,o.TimelineGanttRow=I,o.TimelineGanttRowLabels=C,o.TimelineHorizontal=U,o.TimelineHorizontalItem=q,o.TimelineItem=$,o.TimelineMarker=k,o.TimelineTime=P,o.TimelineTitle=O,Object.defineProperty(o,Symbol.toStringTag,{value:"Module"})}));
6
+ <%s key={someKey} {...props} />`,Z,E,X,E),tn[E+Z]=!0)}if(E=null,O!==void 0&&(n(O),E=""+O),i(y)&&(n(y.key),E=""+y.key),"key"in y){O={};for(var He in y)He!=="key"&&(O[He]=y[He])}else O=y;return E&&s(O,typeof l=="function"?l.displayName||l.name||"Unknown":l),f(l,E,O,o(),$e,Ke)}function _(l){m(l)?l._store&&(l._store.validated=1):typeof l=="object"&&l!==null&&l.$$typeof===Ye&&(l._payload.status==="fulfilled"?m(l._payload.value)&&l._payload.value._store&&(l._payload.value._store.validated=1):l._store&&(l._store.validated=1))}function m(l){return typeof l=="object"&&l!==null&&l.$$typeof===b}var p=F,b=Symbol.for("react.transitional.element"),v=Symbol.for("react.portal"),w=Symbol.for("react.fragment"),V=Symbol.for("react.strict_mode"),U=Symbol.for("react.profiler"),C=Symbol.for("react.consumer"),N=Symbol.for("react.context"),I=Symbol.for("react.forward_ref"),qt=Symbol.for("react.suspense"),We=Symbol.for("react.suspense_list"),Za=Symbol.for("react.memo"),Ye=Symbol.for("react.lazy"),Ea=Symbol.for("react.activity"),Pa=Symbol.for("react.client.reference"),Be=p.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Kt=Object.prototype.hasOwnProperty,Ra=Array.isArray,qe=console.createTask?console.createTask:function(){return null};p={react_stack_bottom_frame:function(l){return l()}};var Ht,Xt={},Qt=p.react_stack_bottom_frame.bind(p,a)(),en=qe(r(a)),tn={};ee.Fragment=w,ee.jsx=function(l,y,O){var Z=1e4>Be.recentlyCreatedOwnerStacks++;return d(l,y,O,!1,Z?Error("react-stack-top-frame"):Qt,Z?qe(r(l)):en)},ee.jsxs=function(l,y,O){var Z=1e4>Be.recentlyCreatedOwnerStacks++;return d(l,y,O,!0,Z?Error("react-stack-top-frame"):Qt,Z?qe(r(l)):en)}})()),ee}var nt;function an(){return nt||(nt=1,process.env.NODE_ENV==="production"?oe.exports=rn():oe.exports=on()),oe.exports}var h=an();const sn=10080*60*1e3;function cn(e){const t=e.flatMap(o=>(o.items||[]).flatMap(a=>[a.startDate,a.endDate])),n=Math.min(...t.map(o=>new Date(o).getTime())),r=Math.max(...t.map(o=>new Date(o).getTime()));return{minDate:new Date(n).toISOString().split("T")[0],maxDate:new Date(r).toISOString().split("T")[0]}}function un(e,t,n,r){const o=new Date(e).getTime(),a=new Date(t).getTime(),i=new Date(n).getTime(),c=new Date(r).getTime()-i,f=o-i,d=a-o;return{start:f/c*100,width:d/c*100}}function ie(e,t){const n=new Date(e);return t==="short"?n.toLocaleDateString():t==="long"?n.toLocaleDateString("en-US",{year:"numeric",month:"long",day:"numeric"}):n.toISOString().split("T")[0]}const Te=({schema:e,className:t,...n})=>{const{variant:r="vertical",items:o=[],dateFormat:a="short",onItemClick:i}=e;if(r==="vertical")return h.jsx(Ie,{className:t,...n,children:o.map((s,c)=>h.jsxs(Ae,{className:s.className,children:[h.jsx(_e,{variant:s.variant||"default",children:s.icon&&h.jsx("span",{className:"text-xs",children:s.icon})}),h.jsxs(Ce,{children:[s.time&&h.jsx(ye,{dateTime:s.time,children:ie(s.time,a)}),s.title&&h.jsx(ve,{children:s.title}),s.description&&h.jsx(be,{children:s.description}),s.content&&P.renderChildren(s.content)]})]},c))});if(r==="horizontal")return h.jsx(Fe,{className:t,...n,children:o.map((s,c)=>h.jsxs(Ue,{className:s.className,children:[h.jsxs("div",{className:"flex flex-col items-center",children:[h.jsx(_e,{variant:s.variant||"default",children:s.icon&&h.jsx("span",{className:"text-xs",children:s.icon})}),h.jsxs("div",{className:"mt-4 text-center",children:[s.time&&h.jsx(ye,{dateTime:s.time,children:ie(s.time,a)}),s.title&&h.jsx(ve,{children:s.title}),s.description&&h.jsx(be,{className:"text-center",children:s.description}),s.content&&P.renderChildren(s.content)]})]}),c<o.length-1&&h.jsx("div",{className:"absolute left-full w-16 border-t-2 border-gray-200 top-3"})]},c))});if(r==="gantt"){const s=cn(o),c=e.minDate||s.minDate,f=e.maxDate||s.maxDate,d=e.timeScale||"month",m=(()=>{const p=[],b=new Date(c),v=new Date(f);if(d==="month"){const w=new Date(b);for(;w<=v;)p.push(w.toLocaleDateString("en-US",{month:"short",year:"numeric"})),w.setMonth(w.getMonth()+1)}else if(d==="week"){const w=new Date(b);for(;w<=v;)p.push(`Week ${Math.ceil((w.getTime()-b.getTime())/sn)+1}`),w.setDate(w.getDate()+7)}else if(d==="day"){const w=new Date(b);for(;w<=v;)p.push(w.toLocaleDateString("en-US",{month:"short",day:"numeric"})),w.setDate(w.getDate()+1)}return p})();return h.jsxs(Le,{className:t,...n,children:[h.jsxs(Je,{children:[h.jsx(we,{className:"flex items-center px-4 py-3",children:h.jsx("span",{className:"font-semibold text-sm",children:e.rowLabel||"Items"})}),h.jsx(ze,{children:h.jsx("div",{className:"flex h-full",children:m.map((p,b)=>h.jsx("div",{className:"flex-1 px-2 py-3 border-r text-xs font-medium text-center",children:p},b))})})]}),h.jsx("div",{children:h.jsxs("div",{className:"flex",children:[h.jsx(we,{children:o.map((p,b)=>h.jsx(ke,{children:h.jsx(Me,{title:p.label,children:p.label})},b))}),h.jsx(ze,{className:"relative",children:o.map((p,b)=>h.jsx(ke,{className:"relative",children:(p.items||[]).map((v,w)=>{const V=un(v.startDate,v.endDate,c,f);return h.jsx(Ge,{start:V.start,width:V.width,variant:v.variant||"default",onClick:()=>i?.(v,p,b,w),title:`${v.title||""}
7
+ ${ie(v.startDate,a)} - ${ie(v.endDate,a)}`,children:h.jsx(Ve,{children:v.title})},w)})},b))})]})})]})}return null};Xe.ComponentRegistry.register("timeline",Te,{namespace:"plugin-timeline",label:"Timeline",category:"data-display",inputs:[{name:"variant",type:"enum",enum:["vertical","horizontal","gantt"],label:"Timeline Variant",defaultValue:"vertical"},{name:"items",type:"array",label:"Timeline Items",description:"For vertical/horizontal: Array of { time, title, description, variant, icon, content }. For gantt: Array of { label, items: [{ title, startDate, endDate, variant }] }"},{name:"dateFormat",type:"enum",enum:["short","long","iso"],label:"Date Format",defaultValue:"short"},{name:"timeScale",type:"enum",enum:["day","week","month"],label:"Time Scale (Gantt only)",defaultValue:"month"},{name:"rowLabel",type:"string",label:"Row Label (Gantt only)",defaultValue:"Items"},{name:"minDate",type:"string",label:"Min Date (Gantt only)",description:"Override auto-calculated min date (YYYY-MM-DD)"},{name:"maxDate",type:"string",label:"Max Date (Gantt only)",description:"Override auto-calculated max date (YYYY-MM-DD)"},{name:"className",type:"string",label:"CSS Class"}],defaultProps:{variant:"vertical",dateFormat:"short",items:[{time:"2024-01-15",title:"Project Started",description:"Kickoff meeting and initial planning",variant:"success",icon:"🚀"},{time:"2024-02-01",title:"First Milestone",description:"Completed initial design phase",variant:"info",icon:"🎨"},{time:"2024-03-15",title:"Beta Release",description:"Released beta version to testers",variant:"warning",icon:"⚡"},{time:"2024-04-01",title:"Launch",description:"Official product launch",variant:"success",icon:"🎉"}]},examples:{vertical:{variant:"vertical",dateFormat:"long",items:[{time:"2024-01-15",title:"Project Started",description:"Kickoff meeting and initial planning",variant:"success"},{time:"2024-02-01",title:"First Milestone",description:"Completed initial design phase",variant:"info"}]},horizontal:{variant:"horizontal",dateFormat:"short",items:[{time:"2024-01-01",title:"Q1",description:"First quarter",variant:"default"},{time:"2024-04-01",title:"Q2",description:"Second quarter",variant:"info"},{time:"2024-07-01",title:"Q3",description:"Third quarter",variant:"warning"},{time:"2024-10-01",title:"Q4",description:"Fourth quarter",variant:"success"}]},gantt:{variant:"gantt",dateFormat:"short",timeScale:"month",rowLabel:"Projects",items:[{label:"Backend Development",items:[{title:"API Design",startDate:"2024-01-01",endDate:"2024-01-31",variant:"success"},{title:"Implementation",startDate:"2024-02-01",endDate:"2024-03-31",variant:"info"}]},{label:"Frontend Development",items:[{title:"UI Design",startDate:"2024-01-15",endDate:"2024-02-15",variant:"warning"},{title:"Component Dev",startDate:"2024-02-15",endDate:"2024-04-15",variant:"default"}]},{label:"Testing",items:[{title:"QA Phase",startDate:"2024-03-01",endDate:"2024-04-30",variant:"danger"}]}]}}});function u(e,t,n){function r(s,c){if(s._zod||Object.defineProperty(s,"_zod",{value:{def:c,constr:i,traits:new Set},enumerable:!1}),s._zod.traits.has(e))return;s._zod.traits.add(e),t(s,c);const f=i.prototype,d=Object.keys(f);for(let _=0;_<d.length;_++){const m=d[_];m in s||(s[m]=f[m].bind(s))}}const o=n?.Parent??Object;class a extends o{}Object.defineProperty(a,"name",{value:e});function i(s){var c;const f=n?.Parent?new a:this;r(f,s),(c=f._zod).deferred??(c.deferred=[]);for(const d of f._zod.deferred)d();return f}return Object.defineProperty(i,"init",{value:r}),Object.defineProperty(i,Symbol.hasInstance,{value:s=>n?.Parent&&s instanceof n.Parent?!0:s?._zod?.traits?.has(e)}),Object.defineProperty(i,"name",{value:e}),i}class q extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class rt extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}}const ot={};function W(e){return ot}function it(e){const t=Object.values(e).filter(r=>typeof r=="number");return Object.entries(e).filter(([r,o])=>t.indexOf(+r)===-1).map(([r,o])=>o)}function Oe(e,t){return typeof t=="bigint"?t.toString():t}function Se(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function je(e){return e==null}function Ze(e){const t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}const at=Symbol("evaluating");function k(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==at)return r===void 0&&(r=at,r=n()),r},set(o){Object.defineProperty(e,t,{value:o})},configurable:!0})}function Y(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function J(...e){const t={};for(const n of e){const r=Object.getOwnPropertyDescriptors(n);Object.assign(t,r)}return Object.defineProperties({},t)}function st(e){return JSON.stringify(e)}function ln(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const ct="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function ae(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const fn=Se(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{const e=Function;return new e(""),!0}catch{return!1}});function te(e){if(ae(e)===!1)return!1;const t=e.constructor;if(t===void 0||typeof t!="function")return!0;const n=t.prototype;return!(ae(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}function ut(e){return te(e)?{...e}:Array.isArray(e)?[...e]:e}const dn=new Set(["string","number","symbol"]);function se(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function M(e,t,n){const r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function g(e){const t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function pn(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}function hn(e,t){const n=e._zod.def,r=n.checks;if(r&&r.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");const a=J(e._zod.def,{get shape(){const i={};for(const s in t){if(!(s in n.shape))throw new Error(`Unrecognized key: "${s}"`);t[s]&&(i[s]=n.shape[s])}return Y(this,"shape",i),i},checks:[]});return M(e,a)}function mn(e,t){const n=e._zod.def,r=n.checks;if(r&&r.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");const a=J(e._zod.def,{get shape(){const i={...e._zod.def.shape};for(const s in t){if(!(s in n.shape))throw new Error(`Unrecognized key: "${s}"`);t[s]&&delete i[s]}return Y(this,"shape",i),i},checks:[]});return M(e,a)}function gn(e,t){if(!te(t))throw new Error("Invalid input to extend: expected a plain object");const n=e._zod.def.checks;if(n&&n.length>0){const a=e._zod.def.shape;for(const i in t)if(Object.getOwnPropertyDescriptor(a,i)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}const o=J(e._zod.def,{get shape(){const a={...e._zod.def.shape,...t};return Y(this,"shape",a),a}});return M(e,o)}function _n(e,t){if(!te(t))throw new Error("Invalid input to safeExtend: expected a plain object");const n=J(e._zod.def,{get shape(){const r={...e._zod.def.shape,...t};return Y(this,"shape",r),r}});return M(e,n)}function vn(e,t){const n=J(e._zod.def,{get shape(){const r={...e._zod.def.shape,...t._zod.def.shape};return Y(this,"shape",r),r},get catchall(){return t._zod.def.catchall},checks:[]});return M(e,n)}function yn(e,t,n){const o=t._zod.def.checks;if(o&&o.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");const i=J(t._zod.def,{get shape(){const s=t._zod.def.shape,c={...s};if(n)for(const f in n){if(!(f in s))throw new Error(`Unrecognized key: "${f}"`);n[f]&&(c[f]=e?new e({type:"optional",innerType:s[f]}):s[f])}else for(const f in s)c[f]=e?new e({type:"optional",innerType:s[f]}):s[f];return Y(this,"shape",c),c},checks:[]});return M(t,i)}function bn(e,t,n){const r=J(t._zod.def,{get shape(){const o=t._zod.def.shape,a={...o};if(n)for(const i in n){if(!(i in a))throw new Error(`Unrecognized key: "${i}"`);n[i]&&(a[i]=new e({type:"nonoptional",innerType:o[i]}))}else for(const i in o)a[i]=new e({type:"nonoptional",innerType:o[i]});return Y(this,"shape",a),a}});return M(t,r)}function K(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function lt(e,t){return t.map(n=>{var r;return(r=n).path??(r.path=[]),n.path.unshift(e),n})}function ce(e){return typeof e=="string"?e:e?.message}function B(e,t,n){const r={...e,path:e.path??[]};if(!e.message){const o=ce(e.inst?._zod.def?.error?.(e))??ce(t?.error?.(e))??ce(n.customError?.(e))??ce(n.localeError?.(e))??"Invalid input";r.message=o}return delete r.inst,delete r.continue,t?.reportInput||delete r.input,r}function Ee(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function ne(...e){const[t,n,r]=e;return typeof t=="string"?{message:t,code:"custom",input:n,inst:r}:{...t}}const ft=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,Oe,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},dt=u("$ZodError",ft),pt=u("$ZodError",ft,{Parent:Error});function wn(e,t=n=>n.message){const n={},r=[];for(const o of e.issues)o.path.length>0?(n[o.path[0]]=n[o.path[0]]||[],n[o.path[0]].push(t(o))):r.push(t(o));return{formErrors:r,fieldErrors:n}}function zn(e,t=n=>n.message){const n={_errors:[]},r=o=>{for(const a of o.issues)if(a.code==="invalid_union"&&a.errors.length)a.errors.map(i=>r({issues:i}));else if(a.code==="invalid_key")r({issues:a.issues});else if(a.code==="invalid_element")r({issues:a.issues});else if(a.path.length===0)n._errors.push(t(a));else{let i=n,s=0;for(;s<a.path.length;){const c=a.path[s];s===a.path.length-1?(i[c]=i[c]||{_errors:[]},i[c]._errors.push(t(a))):i[c]=i[c]||{_errors:[]},i=i[c],s++}}};return r(e),n}const Pe=e=>(t,n,r,o)=>{const a=r?Object.assign(r,{async:!1}):{async:!1},i=t._zod.run({value:n,issues:[]},a);if(i instanceof Promise)throw new q;if(i.issues.length){const s=new(o?.Err??e)(i.issues.map(c=>B(c,a,W())));throw ct(s,o?.callee),s}return i.value},Re=e=>async(t,n,r,o)=>{const a=r?Object.assign(r,{async:!0}):{async:!0};let i=t._zod.run({value:n,issues:[]},a);if(i instanceof Promise&&(i=await i),i.issues.length){const s=new(o?.Err??e)(i.issues.map(c=>B(c,a,W())));throw ct(s,o?.callee),s}return i.value},ue=e=>(t,n,r)=>{const o=r?{...r,async:!1}:{async:!1},a=t._zod.run({value:n,issues:[]},o);if(a instanceof Promise)throw new q;return a.issues.length?{success:!1,error:new(e??dt)(a.issues.map(i=>B(i,o,W())))}:{success:!0,data:a.value}},kn=ue(pt),le=e=>async(t,n,r)=>{const o=r?Object.assign(r,{async:!0}):{async:!0};let a=t._zod.run({value:n,issues:[]},o);return a instanceof Promise&&(a=await a),a.issues.length?{success:!1,error:new e(a.issues.map(i=>B(i,o,W())))}:{success:!0,data:a.value}},$n=le(pt),Tn=e=>(t,n,r)=>{const o=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return Pe(e)(t,n,o)},On=e=>(t,n,r)=>Pe(e)(t,n,r),Sn=e=>async(t,n,r)=>{const o=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return Re(e)(t,n,o)},jn=e=>async(t,n,r)=>Re(e)(t,n,r),Zn=e=>(t,n,r)=>{const o=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return ue(e)(t,n,o)},En=e=>(t,n,r)=>ue(e)(t,n,r),Pn=e=>async(t,n,r)=>{const o=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return le(e)(t,n,o)},Rn=e=>async(t,n,r)=>le(e)(t,n,r),Dn=/^[cC][^\s-]{8,}$/,Nn=/^[0-9a-z]+$/,xn=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,In=/^[0-9a-vA-V]{20}$/,An=/^[A-Za-z0-9]{27}$/,Cn=/^[a-zA-Z0-9_-]{21}$/,Fn=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,Un=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,ht=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,Ln=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,Jn="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function Mn(){return new RegExp(Jn,"u")}const Gn=/^(?:(?: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])$/,Vn=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,Wn=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,Yn=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Bn=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,mt=/^[A-Za-z0-9_-]*$/,qn=/^\+[1-9]\d{6,14}$/,gt="(?:(?:\\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])))",Kn=new RegExp(`^${gt}$`);function _t(e){const t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function Hn(e){return new RegExp(`^${_t(e)}$`)}function Xn(e){const t=_t({precision:e.precision}),n=["Z"];e.local&&n.push(""),e.offset&&n.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const r=`${t}(?:${n.join("|")})`;return new RegExp(`^${gt}T(?:${r})$`)}const Qn=e=>{const t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},er=/^[^A-Z]*$/,tr=/^[^a-z]*$/,L=u("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),nr=u("$ZodCheckMaxLength",(e,t)=>{var n;L.init(e,t),(n=e._zod.def).when??(n.when=r=>{const o=r.value;return!je(o)&&o.length!==void 0}),e._zod.onattach.push(r=>{const o=r._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<o&&(r._zod.bag.maximum=t.maximum)}),e._zod.check=r=>{const o=r.value;if(o.length<=t.maximum)return;const i=Ee(o);r.issues.push({origin:i,code:"too_big",maximum:t.maximum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),rr=u("$ZodCheckMinLength",(e,t)=>{var n;L.init(e,t),(n=e._zod.def).when??(n.when=r=>{const o=r.value;return!je(o)&&o.length!==void 0}),e._zod.onattach.push(r=>{const o=r._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>o&&(r._zod.bag.minimum=t.minimum)}),e._zod.check=r=>{const o=r.value;if(o.length>=t.minimum)return;const i=Ee(o);r.issues.push({origin:i,code:"too_small",minimum:t.minimum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),or=u("$ZodCheckLengthEquals",(e,t)=>{var n;L.init(e,t),(n=e._zod.def).when??(n.when=r=>{const o=r.value;return!je(o)&&o.length!==void 0}),e._zod.onattach.push(r=>{const o=r._zod.bag;o.minimum=t.length,o.maximum=t.length,o.length=t.length}),e._zod.check=r=>{const o=r.value,a=o.length;if(a===t.length)return;const i=Ee(o),s=a>t.length;r.issues.push({origin:i,...s?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:r.value,inst:e,continue:!t.abort})}}),fe=u("$ZodCheckStringFormat",(e,t)=>{var n,r;L.init(e,t),e._zod.onattach.push(o=>{const a=o._zod.bag;a.format=t.format,t.pattern&&(a.patterns??(a.patterns=new Set),a.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=o=>{t.pattern.lastIndex=0,!t.pattern.test(o.value)&&o.issues.push({origin:"string",code:"invalid_format",format:t.format,input:o.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),ir=u("$ZodCheckRegex",(e,t)=>{fe.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:"string",code:"invalid_format",format:"regex",input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),ar=u("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=er),fe.init(e,t)}),sr=u("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=tr),fe.init(e,t)}),cr=u("$ZodCheckIncludes",(e,t)=>{L.init(e,t);const n=se(t.includes),r=new RegExp(typeof t.position=="number"?`^.{${t.position}}${n}`:n);t.pattern=r,e._zod.onattach.push(o=>{const a=o._zod.bag;a.patterns??(a.patterns=new Set),a.patterns.add(r)}),e._zod.check=o=>{o.value.includes(t.includes,t.position)||o.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:o.value,inst:e,continue:!t.abort})}}),ur=u("$ZodCheckStartsWith",(e,t)=>{L.init(e,t);const n=new RegExp(`^${se(t.prefix)}.*`);t.pattern??(t.pattern=n),e._zod.onattach.push(r=>{const o=r._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(n)}),e._zod.check=r=>{r.value.startsWith(t.prefix)||r.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:r.value,inst:e,continue:!t.abort})}}),lr=u("$ZodCheckEndsWith",(e,t)=>{L.init(e,t);const n=new RegExp(`.*${se(t.suffix)}$`);t.pattern??(t.pattern=n),e._zod.onattach.push(r=>{const o=r._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(n)}),e._zod.check=r=>{r.value.endsWith(t.suffix)||r.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:r.value,inst:e,continue:!t.abort})}}),fr=u("$ZodCheckOverwrite",(e,t)=>{L.init(e,t),e._zod.check=n=>{n.value=t.tx(n.value)}});class dr{constructor(t=[]){this.content=[],this.indent=0,this&&(this.args=t)}indented(t){this.indent+=1,t(this),this.indent-=1}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}const r=t.split(`
8
+ `).filter(i=>i),o=Math.min(...r.map(i=>i.length-i.trimStart().length)),a=r.map(i=>i.slice(o)).map(i=>" ".repeat(this.indent*2)+i);for(const i of a)this.content.push(i)}compile(){const t=Function,n=this?.args,o=[...(this?.content??[""]).map(a=>` ${a}`)];return new t(...n,o.join(`
9
+ `))}}const pr={major:4,minor:3,patch:6},S=u("$ZodType",(e,t)=>{var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=pr;const r=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&r.unshift(e);for(const o of r)for(const a of o._zod.onattach)a(e);if(r.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{const o=(i,s,c)=>{let f=K(i),d;for(const _ of s){if(_._zod.def.when){if(!_._zod.def.when(i))continue}else if(f)continue;const m=i.issues.length,p=_._zod.check(i);if(p instanceof Promise&&c?.async===!1)throw new q;if(d||p instanceof Promise)d=(d??Promise.resolve()).then(async()=>{await p,i.issues.length!==m&&(f||(f=K(i,m)))});else{if(i.issues.length===m)continue;f||(f=K(i,m))}}return d?d.then(()=>i):i},a=(i,s,c)=>{if(K(i))return i.aborted=!0,i;const f=o(s,r,c);if(f instanceof Promise){if(c.async===!1)throw new q;return f.then(d=>e._zod.parse(d,c))}return e._zod.parse(f,c)};e._zod.run=(i,s)=>{if(s.skipChecks)return e._zod.parse(i,s);if(s.direction==="backward"){const f=e._zod.parse({value:i.value,issues:[]},{...s,skipChecks:!0});return f instanceof Promise?f.then(d=>a(d,i,s)):a(f,i,s)}const c=e._zod.parse(i,s);if(c instanceof Promise){if(s.async===!1)throw new q;return c.then(f=>o(f,r,s))}return o(c,r,s)}}k(e,"~standard",()=>({validate:o=>{try{const a=kn(e,o);return a.success?{value:a.data}:{issues:a.error?.issues}}catch{return $n(e,o).then(i=>i.success?{value:i.data}:{issues:i.error?.issues})}},vendor:"zod",version:1}))}),De=u("$ZodString",(e,t)=>{S.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??Qn(e._zod.bag),e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=String(n.value)}catch{}return typeof n.value=="string"||n.issues.push({expected:"string",code:"invalid_type",input:n.value,inst:e}),n}}),$=u("$ZodStringFormat",(e,t)=>{fe.init(e,t),De.init(e,t)}),hr=u("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=Un),$.init(e,t)}),mr=u("$ZodUUID",(e,t)=>{if(t.version){const r={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(r===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=ht(r))}else t.pattern??(t.pattern=ht());$.init(e,t)}),gr=u("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=Ln),$.init(e,t)}),_r=u("$ZodURL",(e,t)=>{$.init(e,t),e._zod.check=n=>{try{const r=n.value.trim(),o=new URL(r);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(o.hostname)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:n.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(o.protocol.endsWith(":")?o.protocol.slice(0,-1):o.protocol)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort})),t.normalize?n.value=o.href:n.value=r;return}catch{n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:e,continue:!t.abort})}}}),vr=u("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=Mn()),$.init(e,t)}),yr=u("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=Cn),$.init(e,t)}),br=u("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=Dn),$.init(e,t)}),wr=u("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=Nn),$.init(e,t)}),zr=u("$ZodULID",(e,t)=>{t.pattern??(t.pattern=xn),$.init(e,t)}),kr=u("$ZodXID",(e,t)=>{t.pattern??(t.pattern=In),$.init(e,t)}),$r=u("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=An),$.init(e,t)}),Tr=u("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=Xn(t)),$.init(e,t)}),Or=u("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=Kn),$.init(e,t)}),Sr=u("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=Hn(t)),$.init(e,t)}),jr=u("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=Fn),$.init(e,t)}),Zr=u("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=Gn),$.init(e,t),e._zod.bag.format="ipv4"}),Er=u("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=Vn),$.init(e,t),e._zod.bag.format="ipv6",e._zod.check=n=>{try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:"invalid_format",format:"ipv6",input:n.value,inst:e,continue:!t.abort})}}}),Pr=u("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=Wn),$.init(e,t)}),Rr=u("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=Yn),$.init(e,t),e._zod.check=n=>{const r=n.value.split("/");try{if(r.length!==2)throw new Error;const[o,a]=r;if(!a)throw new Error;const i=Number(a);if(`${i}`!==a)throw new Error;if(i<0||i>128)throw new Error;new URL(`http://[${o}]`)}catch{n.issues.push({code:"invalid_format",format:"cidrv6",input:n.value,inst:e,continue:!t.abort})}}});function vt(e){if(e==="")return!0;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const Dr=u("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=Bn),$.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=n=>{vt(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}});function Nr(e){if(!mt.test(e))return!1;const t=e.replace(/[-_]/g,r=>r==="-"?"+":"/"),n=t.padEnd(Math.ceil(t.length/4)*4,"=");return vt(n)}const xr=u("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=mt),$.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=n=>{Nr(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:e,continue:!t.abort})}}),Ir=u("$ZodE164",(e,t)=>{t.pattern??(t.pattern=qn),$.init(e,t)});function Ar(e,t=null){try{const n=e.split(".");if(n.length!==3)return!1;const[r]=n;if(!r)return!1;const o=JSON.parse(atob(r));return!("typ"in o&&o?.typ!=="JWT"||!o.alg||t&&(!("alg"in o)||o.alg!==t))}catch{return!1}}const Cr=u("$ZodJWT",(e,t)=>{$.init(e,t),e._zod.check=n=>{Ar(n.value,t.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!t.abort})}}),Fr=u("$ZodUnknown",(e,t)=>{S.init(e,t),e._zod.parse=n=>n}),Ur=u("$ZodNever",(e,t)=>{S.init(e,t),e._zod.parse=(n,r)=>(n.issues.push({expected:"never",code:"invalid_type",input:n.value,inst:e}),n)});function yt(e,t,n){e.issues.length&&t.issues.push(...lt(n,e.issues)),t.value[n]=e.value}const Lr=u("$ZodArray",(e,t)=>{S.init(e,t),e._zod.parse=(n,r)=>{const o=n.value;if(!Array.isArray(o))return n.issues.push({expected:"array",code:"invalid_type",input:o,inst:e}),n;n.value=Array(o.length);const a=[];for(let i=0;i<o.length;i++){const s=o[i],c=t.element._zod.run({value:s,issues:[]},r);c instanceof Promise?a.push(c.then(f=>yt(f,n,i))):yt(c,n,i)}return a.length?Promise.all(a).then(()=>n):n}});function de(e,t,n,r,o){if(e.issues.length){if(o&&!(n in r))return;t.issues.push(...lt(n,e.issues))}e.value===void 0?n in r&&(t.value[n]=void 0):t.value[n]=e.value}function bt(e){const t=Object.keys(e.shape);for(const r of t)if(!e.shape?.[r]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${r}": expected a Zod schema`);const n=pn(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function wt(e,t,n,r,o,a){const i=[],s=o.keySet,c=o.catchall._zod,f=c.def.type,d=c.optout==="optional";for(const _ in t){if(s.has(_))continue;if(f==="never"){i.push(_);continue}const m=c.run({value:t[_],issues:[]},r);m instanceof Promise?e.push(m.then(p=>de(p,n,_,t,d))):de(m,n,_,t,d)}return i.length&&n.issues.push({code:"unrecognized_keys",keys:i,input:t,inst:a}),e.length?Promise.all(e).then(()=>n):n}const Jr=u("$ZodObject",(e,t)=>{if(S.init(e,t),!Object.getOwnPropertyDescriptor(t,"shape")?.get){const s=t.shape;Object.defineProperty(t,"shape",{get:()=>{const c={...s};return Object.defineProperty(t,"shape",{value:c}),c}})}const r=Se(()=>bt(t));k(e._zod,"propValues",()=>{const s=t.shape,c={};for(const f in s){const d=s[f]._zod;if(d.values){c[f]??(c[f]=new Set);for(const _ of d.values)c[f].add(_)}}return c});const o=ae,a=t.catchall;let i;e._zod.parse=(s,c)=>{i??(i=r.value);const f=s.value;if(!o(f))return s.issues.push({expected:"object",code:"invalid_type",input:f,inst:e}),s;s.value={};const d=[],_=i.shape;for(const m of i.keys){const p=_[m],b=p._zod.optout==="optional",v=p._zod.run({value:f[m],issues:[]},c);v instanceof Promise?d.push(v.then(w=>de(w,s,m,f,b))):de(v,s,m,f,b)}return a?wt(d,f,s,c,r.value,e):d.length?Promise.all(d).then(()=>s):s}}),Mr=u("$ZodObjectJIT",(e,t)=>{Jr.init(e,t);const n=e._zod.parse,r=Se(()=>bt(t)),o=m=>{const p=new dr(["shape","payload","ctx"]),b=r.value,v=C=>{const N=st(C);return`shape[${N}]._zod.run({ value: input[${N}], issues: [] }, ctx)`};p.write("const input = payload.value;");const w=Object.create(null);let V=0;for(const C of b.keys)w[C]=`key_${V++}`;p.write("const newResult = {};");for(const C of b.keys){const N=w[C],I=st(C),We=m[C]?._zod?.optout==="optional";p.write(`const ${N} = ${v(C)};`),We?p.write(`
10
+ if (${N}.issues.length) {
11
+ if (${I} in input) {
12
+ payload.issues = payload.issues.concat(${N}.issues.map(iss => ({
13
+ ...iss,
14
+ path: iss.path ? [${I}, ...iss.path] : [${I}]
15
+ })));
16
+ }
17
+ }
18
+
19
+ if (${N}.value === undefined) {
20
+ if (${I} in input) {
21
+ newResult[${I}] = undefined;
22
+ }
23
+ } else {
24
+ newResult[${I}] = ${N}.value;
25
+ }
26
+
27
+ `):p.write(`
28
+ if (${N}.issues.length) {
29
+ payload.issues = payload.issues.concat(${N}.issues.map(iss => ({
30
+ ...iss,
31
+ path: iss.path ? [${I}, ...iss.path] : [${I}]
32
+ })));
33
+ }
34
+
35
+ if (${N}.value === undefined) {
36
+ if (${I} in input) {
37
+ newResult[${I}] = undefined;
38
+ }
39
+ } else {
40
+ newResult[${I}] = ${N}.value;
41
+ }
42
+
43
+ `)}p.write("payload.value = newResult;"),p.write("return payload;");const U=p.compile();return(C,N)=>U(m,C,N)};let a;const i=ae,s=!ot.jitless,f=s&&fn.value,d=t.catchall;let _;e._zod.parse=(m,p)=>{_??(_=r.value);const b=m.value;return i(b)?s&&f&&p?.async===!1&&p.jitless!==!0?(a||(a=o(t.shape)),m=a(m,p),d?wt([],b,m,p,_,e):m):n(m,p):(m.issues.push({expected:"object",code:"invalid_type",input:b,inst:e}),m)}});function zt(e,t,n,r){for(const a of e)if(a.issues.length===0)return t.value=a.value,t;const o=e.filter(a=>!K(a));return o.length===1?(t.value=o[0].value,o[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:e.map(a=>a.issues.map(i=>B(i,r,W())))}),t)}const Gr=u("$ZodUnion",(e,t)=>{S.init(e,t),k(e._zod,"optin",()=>t.options.some(o=>o._zod.optin==="optional")?"optional":void 0),k(e._zod,"optout",()=>t.options.some(o=>o._zod.optout==="optional")?"optional":void 0),k(e._zod,"values",()=>{if(t.options.every(o=>o._zod.values))return new Set(t.options.flatMap(o=>Array.from(o._zod.values)))}),k(e._zod,"pattern",()=>{if(t.options.every(o=>o._zod.pattern)){const o=t.options.map(a=>a._zod.pattern);return new RegExp(`^(${o.map(a=>Ze(a.source)).join("|")})$`)}});const n=t.options.length===1,r=t.options[0]._zod.run;e._zod.parse=(o,a)=>{if(n)return r(o,a);let i=!1;const s=[];for(const c of t.options){const f=c._zod.run({value:o.value,issues:[]},a);if(f instanceof Promise)s.push(f),i=!0;else{if(f.issues.length===0)return f;s.push(f)}}return i?Promise.all(s).then(c=>zt(c,o,e,a)):zt(s,o,e,a)}}),Vr=u("$ZodIntersection",(e,t)=>{S.init(e,t),e._zod.parse=(n,r)=>{const o=n.value,a=t.left._zod.run({value:o,issues:[]},r),i=t.right._zod.run({value:o,issues:[]},r);return a instanceof Promise||i instanceof Promise?Promise.all([a,i]).then(([c,f])=>kt(n,c,f)):kt(n,a,i)}});function Ne(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(te(e)&&te(t)){const n=Object.keys(t),r=Object.keys(e).filter(a=>n.indexOf(a)!==-1),o={...e,...t};for(const a of r){const i=Ne(e[a],t[a]);if(!i.valid)return{valid:!1,mergeErrorPath:[a,...i.mergeErrorPath]};o[a]=i.data}return{valid:!0,data:o}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const n=[];for(let r=0;r<e.length;r++){const o=e[r],a=t[r],i=Ne(o,a);if(!i.valid)return{valid:!1,mergeErrorPath:[r,...i.mergeErrorPath]};n.push(i.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function kt(e,t,n){const r=new Map;let o;for(const s of t.issues)if(s.code==="unrecognized_keys"){o??(o=s);for(const c of s.keys)r.has(c)||r.set(c,{}),r.get(c).l=!0}else e.issues.push(s);for(const s of n.issues)if(s.code==="unrecognized_keys")for(const c of s.keys)r.has(c)||r.set(c,{}),r.get(c).r=!0;else e.issues.push(s);const a=[...r].filter(([,s])=>s.l&&s.r).map(([s])=>s);if(a.length&&o&&e.issues.push({...o,keys:a}),K(e))return e;const i=Ne(t.value,n.value);if(!i.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(i.mergeErrorPath)}`);return e.value=i.data,e}const Wr=u("$ZodEnum",(e,t)=>{S.init(e,t);const n=it(t.entries),r=new Set(n);e._zod.values=r,e._zod.pattern=new RegExp(`^(${n.filter(o=>dn.has(typeof o)).map(o=>typeof o=="string"?se(o):o.toString()).join("|")})$`),e._zod.parse=(o,a)=>{const i=o.value;return r.has(i)||o.issues.push({code:"invalid_value",values:n,input:i,inst:e}),o}}),Yr=u("$ZodTransform",(e,t)=>{S.init(e,t),e._zod.parse=(n,r)=>{if(r.direction==="backward")throw new rt(e.constructor.name);const o=t.transform(n.value,n);if(r.async)return(o instanceof Promise?o:Promise.resolve(o)).then(i=>(n.value=i,n));if(o instanceof Promise)throw new q;return n.value=o,n}});function $t(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}const Tt=u("$ZodOptional",(e,t)=>{S.init(e,t),e._zod.optin="optional",e._zod.optout="optional",k(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),k(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${Ze(n.source)})?$`):void 0}),e._zod.parse=(n,r)=>{if(t.innerType._zod.optin==="optional"){const o=t.innerType._zod.run(n,r);return o instanceof Promise?o.then(a=>$t(a,n.value)):$t(o,n.value)}return n.value===void 0?n:t.innerType._zod.run(n,r)}}),Br=u("$ZodExactOptional",(e,t)=>{Tt.init(e,t),k(e._zod,"values",()=>t.innerType._zod.values),k(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(n,r)=>t.innerType._zod.run(n,r)}),qr=u("$ZodNullable",(e,t)=>{S.init(e,t),k(e._zod,"optin",()=>t.innerType._zod.optin),k(e._zod,"optout",()=>t.innerType._zod.optout),k(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${Ze(n.source)}|null)$`):void 0}),k(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(n,r)=>n.value===null?n:t.innerType._zod.run(n,r)}),Kr=u("$ZodDefault",(e,t)=>{S.init(e,t),e._zod.optin="optional",k(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,r)=>{if(r.direction==="backward")return t.innerType._zod.run(n,r);if(n.value===void 0)return n.value=t.defaultValue,n;const o=t.innerType._zod.run(n,r);return o instanceof Promise?o.then(a=>Ot(a,t)):Ot(o,t)}});function Ot(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const Hr=u("$ZodPrefault",(e,t)=>{S.init(e,t),e._zod.optin="optional",k(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,r)=>(r.direction==="backward"||n.value===void 0&&(n.value=t.defaultValue),t.innerType._zod.run(n,r))}),Xr=u("$ZodNonOptional",(e,t)=>{S.init(e,t),k(e._zod,"values",()=>{const n=t.innerType._zod.values;return n?new Set([...n].filter(r=>r!==void 0)):void 0}),e._zod.parse=(n,r)=>{const o=t.innerType._zod.run(n,r);return o instanceof Promise?o.then(a=>St(a,e)):St(o,e)}});function St(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}const Qr=u("$ZodCatch",(e,t)=>{S.init(e,t),k(e._zod,"optin",()=>t.innerType._zod.optin),k(e._zod,"optout",()=>t.innerType._zod.optout),k(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,r)=>{if(r.direction==="backward")return t.innerType._zod.run(n,r);const o=t.innerType._zod.run(n,r);return o instanceof Promise?o.then(a=>(n.value=a.value,a.issues.length&&(n.value=t.catchValue({...n,error:{issues:a.issues.map(i=>B(i,r,W()))},input:n.value}),n.issues=[]),n)):(n.value=o.value,o.issues.length&&(n.value=t.catchValue({...n,error:{issues:o.issues.map(a=>B(a,r,W()))},input:n.value}),n.issues=[]),n)}}),eo=u("$ZodPipe",(e,t)=>{S.init(e,t),k(e._zod,"values",()=>t.in._zod.values),k(e._zod,"optin",()=>t.in._zod.optin),k(e._zod,"optout",()=>t.out._zod.optout),k(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(n,r)=>{if(r.direction==="backward"){const a=t.out._zod.run(n,r);return a instanceof Promise?a.then(i=>pe(i,t.in,r)):pe(a,t.in,r)}const o=t.in._zod.run(n,r);return o instanceof Promise?o.then(a=>pe(a,t.out,r)):pe(o,t.out,r)}});function pe(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}const to=u("$ZodReadonly",(e,t)=>{S.init(e,t),k(e._zod,"propValues",()=>t.innerType._zod.propValues),k(e._zod,"values",()=>t.innerType._zod.values),k(e._zod,"optin",()=>t.innerType?._zod?.optin),k(e._zod,"optout",()=>t.innerType?._zod?.optout),e._zod.parse=(n,r)=>{if(r.direction==="backward")return t.innerType._zod.run(n,r);const o=t.innerType._zod.run(n,r);return o instanceof Promise?o.then(jt):jt(o)}});function jt(e){return e.value=Object.freeze(e.value),e}const no=u("$ZodCustom",(e,t)=>{L.init(e,t),S.init(e,t),e._zod.parse=(n,r)=>n,e._zod.check=n=>{const r=n.value,o=t.fn(r);if(o instanceof Promise)return o.then(a=>Zt(a,n,r,e));Zt(o,n,r,e)}});function Zt(e,t,n,r){if(!e){const o={code:"custom",input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(o.params=r._zod.def.params),t.issues.push(ne(o))}}var Et;class ro{constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...n){const r=n[0];return this._map.set(t,r),r&&typeof r=="object"&&"id"in r&&this._idmap.set(r.id,t),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){const n=this._map.get(t);return n&&typeof n=="object"&&"id"in n&&this._idmap.delete(n.id),this._map.delete(t),this}get(t){const n=t._zod.parent;if(n){const r={...this.get(n)??{}};delete r.id;const o={...r,...this._map.get(t)};return Object.keys(o).length?o:void 0}return this._map.get(t)}has(t){return this._map.has(t)}}function oo(){return new ro}(Et=globalThis).__zod_globalRegistry??(Et.__zod_globalRegistry=oo());const re=globalThis.__zod_globalRegistry;function io(e,t){return new e({type:"string",...g(t)})}function ao(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...g(t)})}function Pt(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...g(t)})}function so(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...g(t)})}function co(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...g(t)})}function uo(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...g(t)})}function lo(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...g(t)})}function fo(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...g(t)})}function po(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...g(t)})}function ho(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...g(t)})}function mo(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...g(t)})}function go(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...g(t)})}function _o(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...g(t)})}function vo(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...g(t)})}function yo(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...g(t)})}function bo(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...g(t)})}function wo(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...g(t)})}function zo(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...g(t)})}function ko(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...g(t)})}function $o(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...g(t)})}function To(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...g(t)})}function Oo(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...g(t)})}function So(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...g(t)})}function jo(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...g(t)})}function Zo(e,t){return new e({type:"string",format:"date",check:"string_format",...g(t)})}function Eo(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...g(t)})}function Po(e,t){return new e({type:"string",format:"duration",check:"string_format",...g(t)})}function Ro(e){return new e({type:"unknown"})}function Do(e,t){return new e({type:"never",...g(t)})}function Rt(e,t){return new nr({check:"max_length",...g(t),maximum:e})}function he(e,t){return new rr({check:"min_length",...g(t),minimum:e})}function Dt(e,t){return new or({check:"length_equals",...g(t),length:e})}function No(e,t){return new ir({check:"string_format",format:"regex",...g(t),pattern:e})}function xo(e){return new ar({check:"string_format",format:"lowercase",...g(e)})}function Io(e){return new sr({check:"string_format",format:"uppercase",...g(e)})}function Ao(e,t){return new cr({check:"string_format",format:"includes",...g(t),includes:e})}function Co(e,t){return new ur({check:"string_format",format:"starts_with",...g(t),prefix:e})}function Fo(e,t){return new lr({check:"string_format",format:"ends_with",...g(t),suffix:e})}function H(e){return new fr({check:"overwrite",tx:e})}function Uo(e){return H(t=>t.normalize(e))}function Lo(){return H(e=>e.trim())}function Jo(){return H(e=>e.toLowerCase())}function Mo(){return H(e=>e.toUpperCase())}function Go(){return H(e=>ln(e))}function Vo(e,t,n){return new e({type:"array",element:t,...g(n)})}function Wo(e,t,n){return new e({type:"custom",check:"custom",fn:t,...g(n)})}function Yo(e){const t=Bo(n=>(n.addIssue=r=>{if(typeof r=="string")n.issues.push(ne(r,n.value,t._zod.def));else{const o=r;o.fatal&&(o.continue=!1),o.code??(o.code="custom"),o.input??(o.input=n.value),o.inst??(o.inst=t),o.continue??(o.continue=!t._zod.def.abort),n.issues.push(ne(o))}},e(n.value,n)));return t}function Bo(e,t){const n=new L({check:"custom",...g(t)});return n._zod.check=e,n}function Nt(e){let t=e?.target??"draft-2020-12";return t==="draft-4"&&(t="draft-04"),t==="draft-7"&&(t="draft-07"),{processors:e.processors??{},metadataRegistry:e?.metadata??re,target:t,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,cycles:e?.cycles??"ref",reused:e?.reused??"inline",external:e?.external??void 0}}function D(e,t,n={path:[],schemaPath:[]}){var r;const o=e._zod.def,a=t.seen.get(e);if(a)return a.count++,n.schemaPath.includes(e)&&(a.cycle=n.path),a.schema;const i={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,i);const s=e._zod.toJSONSchema?.();if(s)i.schema=s;else{const d={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,i.schema,d);else{const m=i.schema,p=t.processors[o.type];if(!p)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${o.type}`);p(e,t,m,d)}const _=e._zod.parent;_&&(i.ref||(i.ref=_),D(_,t,d),t.seen.get(_).isParent=!0)}const c=t.metadataRegistry.get(e);return c&&Object.assign(i.schema,c),t.io==="input"&&x(e)&&(delete i.schema.examples,delete i.schema.default),t.io==="input"&&i.schema._prefault&&((r=i.schema).default??(r.default=i.schema._prefault)),delete i.schema._prefault,t.seen.get(e).schema}function xt(e,t){const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const r=new Map;for(const i of e.seen.entries()){const s=e.metadataRegistry.get(i[0])?.id;if(s){const c=r.get(s);if(c&&c!==i[0])throw new Error(`Duplicate schema id "${s}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(s,i[0])}}const o=i=>{const s=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){const _=e.external.registry.get(i[0])?.id,m=e.external.uri??(b=>b);if(_)return{ref:m(_)};const p=i[1].defId??i[1].schema.id??`schema${e.counter++}`;return i[1].defId=p,{defId:p,ref:`${m("__shared")}#/${s}/${p}`}}if(i[1]===n)return{ref:"#"};const f=`#/${s}/`,d=i[1].schema.id??`__schema${e.counter++}`;return{defId:d,ref:f+d}},a=i=>{if(i[1].schema.$ref)return;const s=i[1],{ref:c,defId:f}=o(i);s.def={...s.schema},f&&(s.defId=f);const d=s.schema;for(const _ in d)delete d[_];d.$ref=c};if(e.cycles==="throw")for(const i of e.seen.entries()){const s=i[1];if(s.cycle)throw new Error(`Cycle detected: #/${s.cycle?.join("/")}/<root>
44
+
45
+ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const i of e.seen.entries()){const s=i[1];if(t===i[0]){a(i);continue}if(e.external){const f=e.external.registry.get(i[0])?.id;if(t!==i[0]&&f){a(i);continue}}if(e.metadataRegistry.get(i[0])?.id){a(i);continue}if(s.cycle){a(i);continue}if(s.count>1&&e.reused==="ref"){a(i);continue}}}function It(e,t){const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const r=i=>{const s=e.seen.get(i);if(s.ref===null)return;const c=s.def??s.schema,f={...c},d=s.ref;if(s.ref=null,d){r(d);const m=e.seen.get(d),p=m.schema;if(p.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(c.allOf=c.allOf??[],c.allOf.push(p)):Object.assign(c,p),Object.assign(c,f),i._zod.parent===d)for(const v in c)v==="$ref"||v==="allOf"||v in f||delete c[v];if(p.$ref&&m.def)for(const v in c)v==="$ref"||v==="allOf"||v in m.def&&JSON.stringify(c[v])===JSON.stringify(m.def[v])&&delete c[v]}const _=i._zod.parent;if(_&&_!==d){r(_);const m=e.seen.get(_);if(m?.schema.$ref&&(c.$ref=m.schema.$ref,m.def))for(const p in c)p==="$ref"||p==="allOf"||p in m.def&&JSON.stringify(c[p])===JSON.stringify(m.def[p])&&delete c[p]}e.override({zodSchema:i,jsonSchema:c,path:s.path??[]})};for(const i of[...e.seen.entries()].reverse())r(i[0]);const o={};if(e.target==="draft-2020-12"?o.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?o.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?o.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){const i=e.external.registry.get(t)?.id;if(!i)throw new Error("Schema is missing an `id` property");o.$id=e.external.uri(i)}Object.assign(o,n.def??n.schema);const a=e.external?.defs??{};for(const i of e.seen.entries()){const s=i[1];s.def&&s.defId&&(a[s.defId]=s.def)}e.external||Object.keys(a).length>0&&(e.target==="draft-2020-12"?o.$defs=a:o.definitions=a);try{const i=JSON.parse(JSON.stringify(o));return Object.defineProperty(i,"~standard",{value:{...t["~standard"],jsonSchema:{input:me(t,"input",e.processors),output:me(t,"output",e.processors)}},enumerable:!1,writable:!1}),i}catch{throw new Error("Error converting schema to JSON.")}}function x(e,t){const n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);const r=e._zod.def;if(r.type==="transform")return!0;if(r.type==="array")return x(r.element,n);if(r.type==="set")return x(r.valueType,n);if(r.type==="lazy")return x(r.getter(),n);if(r.type==="promise"||r.type==="optional"||r.type==="nonoptional"||r.type==="nullable"||r.type==="readonly"||r.type==="default"||r.type==="prefault")return x(r.innerType,n);if(r.type==="intersection")return x(r.left,n)||x(r.right,n);if(r.type==="record"||r.type==="map")return x(r.keyType,n)||x(r.valueType,n);if(r.type==="pipe")return x(r.in,n)||x(r.out,n);if(r.type==="object"){for(const o in r.shape)if(x(r.shape[o],n))return!0;return!1}if(r.type==="union"){for(const o of r.options)if(x(o,n))return!0;return!1}if(r.type==="tuple"){for(const o of r.items)if(x(o,n))return!0;return!!(r.rest&&x(r.rest,n))}return!1}const qo=(e,t={})=>n=>{const r=Nt({...n,processors:t});return D(e,r),xt(r,e),It(r,e)},me=(e,t,n={})=>r=>{const{libraryOptions:o,target:a}=r??{},i=Nt({...o??{},target:a,io:t,processors:n});return D(e,i),xt(i,e),It(i,e)},Ko={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},Ho=(e,t,n,r)=>{const o=n;o.type="string";const{minimum:a,maximum:i,format:s,patterns:c,contentEncoding:f}=e._zod.bag;if(typeof a=="number"&&(o.minLength=a),typeof i=="number"&&(o.maxLength=i),s&&(o.format=Ko[s]??s,o.format===""&&delete o.format,s==="time"&&delete o.format),f&&(o.contentEncoding=f),c&&c.size>0){const d=[...c];d.length===1?o.pattern=d[0].source:d.length>1&&(o.allOf=[...d.map(_=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:_.source}))])}},Xo=(e,t,n,r)=>{n.not={}},Qo=(e,t,n,r)=>{},ei=(e,t,n,r)=>{const o=e._zod.def,a=it(o.entries);a.every(i=>typeof i=="number")&&(n.type="number"),a.every(i=>typeof i=="string")&&(n.type="string"),n.enum=a},ti=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},ni=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},ri=(e,t,n,r)=>{const o=n,a=e._zod.def,{minimum:i,maximum:s}=e._zod.bag;typeof i=="number"&&(o.minItems=i),typeof s=="number"&&(o.maxItems=s),o.type="array",o.items=D(a.element,t,{...r,path:[...r.path,"items"]})},oi=(e,t,n,r)=>{const o=n,a=e._zod.def;o.type="object",o.properties={};const i=a.shape;for(const f in i)o.properties[f]=D(i[f],t,{...r,path:[...r.path,"properties",f]});const s=new Set(Object.keys(i)),c=new Set([...s].filter(f=>{const d=a.shape[f]._zod;return t.io==="input"?d.optin===void 0:d.optout===void 0}));c.size>0&&(o.required=Array.from(c)),a.catchall?._zod.def.type==="never"?o.additionalProperties=!1:a.catchall?a.catchall&&(o.additionalProperties=D(a.catchall,t,{...r,path:[...r.path,"additionalProperties"]})):t.io==="output"&&(o.additionalProperties=!1)},ii=(e,t,n,r)=>{const o=e._zod.def,a=o.inclusive===!1,i=o.options.map((s,c)=>D(s,t,{...r,path:[...r.path,a?"oneOf":"anyOf",c]}));a?n.oneOf=i:n.anyOf=i},ai=(e,t,n,r)=>{const o=e._zod.def,a=D(o.left,t,{...r,path:[...r.path,"allOf",0]}),i=D(o.right,t,{...r,path:[...r.path,"allOf",1]}),s=f=>"allOf"in f&&Object.keys(f).length===1,c=[...s(a)?a.allOf:[a],...s(i)?i.allOf:[i]];n.allOf=c},si=(e,t,n,r)=>{const o=e._zod.def,a=D(o.innerType,t,r),i=t.seen.get(e);t.target==="openapi-3.0"?(i.ref=o.innerType,n.nullable=!0):n.anyOf=[a,{type:"null"}]},ci=(e,t,n,r)=>{const o=e._zod.def;D(o.innerType,t,r);const a=t.seen.get(e);a.ref=o.innerType},ui=(e,t,n,r)=>{const o=e._zod.def;D(o.innerType,t,r);const a=t.seen.get(e);a.ref=o.innerType,n.default=JSON.parse(JSON.stringify(o.defaultValue))},li=(e,t,n,r)=>{const o=e._zod.def;D(o.innerType,t,r);const a=t.seen.get(e);a.ref=o.innerType,t.io==="input"&&(n._prefault=JSON.parse(JSON.stringify(o.defaultValue)))},fi=(e,t,n,r)=>{const o=e._zod.def;D(o.innerType,t,r);const a=t.seen.get(e);a.ref=o.innerType;let i;try{i=o.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}n.default=i},di=(e,t,n,r)=>{const o=e._zod.def,a=t.io==="input"?o.in._zod.def.type==="transform"?o.out:o.in:o.out;D(a,t,r);const i=t.seen.get(e);i.ref=a},pi=(e,t,n,r)=>{const o=e._zod.def;D(o.innerType,t,r);const a=t.seen.get(e);a.ref=o.innerType,n.readOnly=!0},At=(e,t,n,r)=>{const o=e._zod.def;D(o.innerType,t,r);const a=t.seen.get(e);a.ref=o.innerType},hi=u("ZodISODateTime",(e,t)=>{Tr.init(e,t),T.init(e,t)});function mi(e){return jo(hi,e)}const gi=u("ZodISODate",(e,t)=>{Or.init(e,t),T.init(e,t)});function _i(e){return Zo(gi,e)}const vi=u("ZodISOTime",(e,t)=>{Sr.init(e,t),T.init(e,t)});function yi(e){return Eo(vi,e)}const bi=u("ZodISODuration",(e,t)=>{jr.init(e,t),T.init(e,t)});function wi(e){return Po(bi,e)}const A=u("ZodError",(e,t)=>{dt.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:n=>zn(e,n)},flatten:{value:n=>wn(e,n)},addIssue:{value:n=>{e.issues.push(n),e.message=JSON.stringify(e.issues,Oe,2)}},addIssues:{value:n=>{e.issues.push(...n),e.message=JSON.stringify(e.issues,Oe,2)}},isEmpty:{get(){return e.issues.length===0}}})},{Parent:Error}),zi=Pe(A),ki=Re(A),$i=ue(A),Ti=le(A),Oi=Tn(A),Si=On(A),ji=Sn(A),Zi=jn(A),Ei=Zn(A),Pi=En(A),Ri=Pn(A),Di=Rn(A),j=u("ZodType",(e,t)=>(S.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:me(e,"input"),output:me(e,"output")}}),e.toJSONSchema=qo(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...n)=>e.clone(J(t,{checks:[...t.checks??[],...n.map(r=>typeof r=="function"?{_zod:{check:r,def:{check:"custom"},onattach:[]}}:r)]}),{parent:!0}),e.with=e.check,e.clone=(n,r)=>M(e,n,r),e.brand=()=>e,e.register=((n,r)=>(n.add(e,r),e)),e.parse=(n,r)=>zi(e,n,r,{callee:e.parse}),e.safeParse=(n,r)=>$i(e,n,r),e.parseAsync=async(n,r)=>ki(e,n,r,{callee:e.parseAsync}),e.safeParseAsync=async(n,r)=>Ti(e,n,r),e.spa=e.safeParseAsync,e.encode=(n,r)=>Oi(e,n,r),e.decode=(n,r)=>Si(e,n,r),e.encodeAsync=async(n,r)=>ji(e,n,r),e.decodeAsync=async(n,r)=>Zi(e,n,r),e.safeEncode=(n,r)=>Ei(e,n,r),e.safeDecode=(n,r)=>Pi(e,n,r),e.safeEncodeAsync=async(n,r)=>Ri(e,n,r),e.safeDecodeAsync=async(n,r)=>Di(e,n,r),e.refine=(n,r)=>e.check(Ta(n,r)),e.superRefine=n=>e.check(Oa(n)),e.overwrite=n=>e.check(H(n)),e.optional=()=>Mt(e),e.exactOptional=()=>da(e),e.nullable=()=>Gt(e),e.nullish=()=>Mt(Gt(e)),e.nonoptional=n=>va(e,n),e.array=()=>na(e),e.or=n=>ia([e,n]),e.and=n=>sa(e,n),e.transform=n=>Wt(e,la(n)),e.default=n=>ma(e,n),e.prefault=n=>_a(e,n),e.catch=n=>ba(e,n),e.pipe=n=>Wt(e,n),e.readonly=()=>ka(e),e.describe=n=>{const r=e.clone();return re.add(r,{description:n}),r},Object.defineProperty(e,"description",{get(){return re.get(e)?.description},configurable:!0}),e.meta=(...n)=>{if(n.length===0)return re.get(e);const r=e.clone();return re.add(r,n[0]),r},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=n=>n(e),e)),Ct=u("_ZodString",(e,t)=>{De.init(e,t),j.init(e,t),e._zod.processJSONSchema=(r,o,a)=>Ho(e,r,o);const n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,e.regex=(...r)=>e.check(No(...r)),e.includes=(...r)=>e.check(Ao(...r)),e.startsWith=(...r)=>e.check(Co(...r)),e.endsWith=(...r)=>e.check(Fo(...r)),e.min=(...r)=>e.check(he(...r)),e.max=(...r)=>e.check(Rt(...r)),e.length=(...r)=>e.check(Dt(...r)),e.nonempty=(...r)=>e.check(he(1,...r)),e.lowercase=r=>e.check(xo(r)),e.uppercase=r=>e.check(Io(r)),e.trim=()=>e.check(Lo()),e.normalize=(...r)=>e.check(Uo(...r)),e.toLowerCase=()=>e.check(Jo()),e.toUpperCase=()=>e.check(Mo()),e.slugify=()=>e.check(Go())}),Ni=u("ZodString",(e,t)=>{De.init(e,t),Ct.init(e,t),e.email=n=>e.check(ao(xi,n)),e.url=n=>e.check(fo(Ii,n)),e.jwt=n=>e.check(So(Hi,n)),e.emoji=n=>e.check(po(Ai,n)),e.guid=n=>e.check(Pt(Ft,n)),e.uuid=n=>e.check(so(ge,n)),e.uuidv4=n=>e.check(co(ge,n)),e.uuidv6=n=>e.check(uo(ge,n)),e.uuidv7=n=>e.check(lo(ge,n)),e.nanoid=n=>e.check(ho(Ci,n)),e.guid=n=>e.check(Pt(Ft,n)),e.cuid=n=>e.check(mo(Fi,n)),e.cuid2=n=>e.check(go(Ui,n)),e.ulid=n=>e.check(_o(Li,n)),e.base64=n=>e.check($o(Bi,n)),e.base64url=n=>e.check(To(qi,n)),e.xid=n=>e.check(vo(Ji,n)),e.ksuid=n=>e.check(yo(Mi,n)),e.ipv4=n=>e.check(bo(Gi,n)),e.ipv6=n=>e.check(wo(Vi,n)),e.cidrv4=n=>e.check(zo(Wi,n)),e.cidrv6=n=>e.check(ko(Yi,n)),e.e164=n=>e.check(Oo(Ki,n)),e.datetime=n=>e.check(mi(n)),e.date=n=>e.check(_i(n)),e.time=n=>e.check(yi(n)),e.duration=n=>e.check(wi(n))});function G(e){return io(Ni,e)}const T=u("ZodStringFormat",(e,t)=>{$.init(e,t),Ct.init(e,t)}),xi=u("ZodEmail",(e,t)=>{gr.init(e,t),T.init(e,t)}),Ft=u("ZodGUID",(e,t)=>{hr.init(e,t),T.init(e,t)}),ge=u("ZodUUID",(e,t)=>{mr.init(e,t),T.init(e,t)}),Ii=u("ZodURL",(e,t)=>{_r.init(e,t),T.init(e,t)}),Ai=u("ZodEmoji",(e,t)=>{vr.init(e,t),T.init(e,t)}),Ci=u("ZodNanoID",(e,t)=>{yr.init(e,t),T.init(e,t)}),Fi=u("ZodCUID",(e,t)=>{br.init(e,t),T.init(e,t)}),Ui=u("ZodCUID2",(e,t)=>{wr.init(e,t),T.init(e,t)}),Li=u("ZodULID",(e,t)=>{zr.init(e,t),T.init(e,t)}),Ji=u("ZodXID",(e,t)=>{kr.init(e,t),T.init(e,t)}),Mi=u("ZodKSUID",(e,t)=>{$r.init(e,t),T.init(e,t)}),Gi=u("ZodIPv4",(e,t)=>{Zr.init(e,t),T.init(e,t)}),Vi=u("ZodIPv6",(e,t)=>{Er.init(e,t),T.init(e,t)}),Wi=u("ZodCIDRv4",(e,t)=>{Pr.init(e,t),T.init(e,t)}),Yi=u("ZodCIDRv6",(e,t)=>{Rr.init(e,t),T.init(e,t)}),Bi=u("ZodBase64",(e,t)=>{Dr.init(e,t),T.init(e,t)}),qi=u("ZodBase64URL",(e,t)=>{xr.init(e,t),T.init(e,t)}),Ki=u("ZodE164",(e,t)=>{Ir.init(e,t),T.init(e,t)}),Hi=u("ZodJWT",(e,t)=>{Cr.init(e,t),T.init(e,t)}),Xi=u("ZodUnknown",(e,t)=>{Fr.init(e,t),j.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Qo()});function Ut(){return Ro(Xi)}const Qi=u("ZodNever",(e,t)=>{Ur.init(e,t),j.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Xo(e,n,r)});function ea(e){return Do(Qi,e)}const ta=u("ZodArray",(e,t)=>{Lr.init(e,t),j.init(e,t),e._zod.processJSONSchema=(n,r,o)=>ri(e,n,r,o),e.element=t.element,e.min=(n,r)=>e.check(he(n,r)),e.nonempty=n=>e.check(he(1,n)),e.max=(n,r)=>e.check(Rt(n,r)),e.length=(n,r)=>e.check(Dt(n,r)),e.unwrap=()=>e.element});function na(e,t){return Vo(ta,e,t)}const ra=u("ZodObject",(e,t)=>{Mr.init(e,t),j.init(e,t),e._zod.processJSONSchema=(n,r,o)=>oi(e,n,r,o),k(e,"shape",()=>t.shape),e.keyof=()=>ca(Object.keys(e._zod.def.shape)),e.catchall=n=>e.clone({...e._zod.def,catchall:n}),e.passthrough=()=>e.clone({...e._zod.def,catchall:Ut()}),e.loose=()=>e.clone({...e._zod.def,catchall:Ut()}),e.strict=()=>e.clone({...e._zod.def,catchall:ea()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=n=>gn(e,n),e.safeExtend=n=>_n(e,n),e.merge=n=>vn(e,n),e.pick=n=>hn(e,n),e.omit=n=>mn(e,n),e.partial=(...n)=>yn(Jt,e,n[0]),e.required=(...n)=>bn(Vt,e,n[0])});function Lt(e,t){const n={type:"object",shape:e??{},...g(t)};return new ra(n)}const oa=u("ZodUnion",(e,t)=>{Gr.init(e,t),j.init(e,t),e._zod.processJSONSchema=(n,r,o)=>ii(e,n,r,o),e.options=t.options});function ia(e,t){return new oa({type:"union",options:e,...g(t)})}const aa=u("ZodIntersection",(e,t)=>{Vr.init(e,t),j.init(e,t),e._zod.processJSONSchema=(n,r,o)=>ai(e,n,r,o)});function sa(e,t){return new aa({type:"intersection",left:e,right:t})}const xe=u("ZodEnum",(e,t)=>{Wr.init(e,t),j.init(e,t),e._zod.processJSONSchema=(r,o,a)=>ei(e,r,o),e.enum=t.entries,e.options=Object.values(t.entries);const n=new Set(Object.keys(t.entries));e.extract=(r,o)=>{const a={};for(const i of r)if(n.has(i))a[i]=t.entries[i];else throw new Error(`Key ${i} not found in enum`);return new xe({...t,checks:[],...g(o),entries:a})},e.exclude=(r,o)=>{const a={...t.entries};for(const i of r)if(n.has(i))delete a[i];else throw new Error(`Key ${i} not found in enum`);return new xe({...t,checks:[],...g(o),entries:a})}});function ca(e,t){const n=Array.isArray(e)?Object.fromEntries(e.map(r=>[r,r])):e;return new xe({type:"enum",entries:n,...g(t)})}const ua=u("ZodTransform",(e,t)=>{Yr.init(e,t),j.init(e,t),e._zod.processJSONSchema=(n,r,o)=>ni(e,n),e._zod.parse=(n,r)=>{if(r.direction==="backward")throw new rt(e.constructor.name);n.addIssue=a=>{if(typeof a=="string")n.issues.push(ne(a,n.value,t));else{const i=a;i.fatal&&(i.continue=!1),i.code??(i.code="custom"),i.input??(i.input=n.value),i.inst??(i.inst=e),n.issues.push(ne(i))}};const o=t.transform(n.value,n);return o instanceof Promise?o.then(a=>(n.value=a,n)):(n.value=o,n)}});function la(e){return new ua({type:"transform",transform:e})}const Jt=u("ZodOptional",(e,t)=>{Tt.init(e,t),j.init(e,t),e._zod.processJSONSchema=(n,r,o)=>At(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function Mt(e){return new Jt({type:"optional",innerType:e})}const fa=u("ZodExactOptional",(e,t)=>{Br.init(e,t),j.init(e,t),e._zod.processJSONSchema=(n,r,o)=>At(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function da(e){return new fa({type:"optional",innerType:e})}const pa=u("ZodNullable",(e,t)=>{qr.init(e,t),j.init(e,t),e._zod.processJSONSchema=(n,r,o)=>si(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function Gt(e){return new pa({type:"nullable",innerType:e})}const ha=u("ZodDefault",(e,t)=>{Kr.init(e,t),j.init(e,t),e._zod.processJSONSchema=(n,r,o)=>ui(e,n,r,o),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function ma(e,t){return new ha({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():ut(t)}})}const ga=u("ZodPrefault",(e,t)=>{Hr.init(e,t),j.init(e,t),e._zod.processJSONSchema=(n,r,o)=>li(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function _a(e,t){return new ga({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():ut(t)}})}const Vt=u("ZodNonOptional",(e,t)=>{Xr.init(e,t),j.init(e,t),e._zod.processJSONSchema=(n,r,o)=>ci(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function va(e,t){return new Vt({type:"nonoptional",innerType:e,...g(t)})}const ya=u("ZodCatch",(e,t)=>{Qr.init(e,t),j.init(e,t),e._zod.processJSONSchema=(n,r,o)=>fi(e,n,r,o),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function ba(e,t){return new ya({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const wa=u("ZodPipe",(e,t)=>{eo.init(e,t),j.init(e,t),e._zod.processJSONSchema=(n,r,o)=>di(e,n,r,o),e.in=t.in,e.out=t.out});function Wt(e,t){return new wa({type:"pipe",in:e,out:t})}const za=u("ZodReadonly",(e,t)=>{to.init(e,t),j.init(e,t),e._zod.processJSONSchema=(n,r,o)=>pi(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function ka(e){return new za({type:"readonly",innerType:e})}const $a=u("ZodCustom",(e,t)=>{no.init(e,t),j.init(e,t),e._zod.processJSONSchema=(n,r,o)=>ti(e,n)});function Ta(e,t={}){return Wo($a,e,t)}function Oa(e){return Yo(e)}const Sa=Lt({title:G().optional(),date:G().optional(),description:G().optional(),variant:G().optional()}),ja=Lt({mapping:Sa.optional(),objectName:G().optional(),titleField:G().optional(),dateField:G().optional(),descriptionField:G().optional()}),Yt=({schema:e,dataSource:t,className:n,...r})=>{const[o,a]=F.useState([]),[i,s]=F.useState(!1),[c,f]=F.useState(null);F.useEffect(()=>{const b=ja.safeParse(e);b.success||console.warn("[ObjectTimeline] Invalid timeline configuration:",b.error.format())},[e]);const d=Qe.useDataScope(e.bind);F.useEffect(()=>{const b=async()=>{if(!(!t||!e.objectName)){s(!0);try{const v=await t.find(e.objectName,{options:{$top:100}});let w=v;v.value?w=v.value:v.data&&(w=v.data),Array.isArray(w)&&a(w)}catch(v){console.error(v),f(v)}finally{s(!1)}}};e.objectName&&!d&&!e.items&&!r.data&&b()},[e.objectName,t,d,e.items,r.data]);const _=r.data||d||o;let m=e.items;if(!m&&_&&Array.isArray(_)){const b=e.mapping?.title||e.titleField||"name",v=e.mapping?.date||e.dateField||"date",w=e.mapping?.description||e.descriptionField||"description",V=e.mapping?.variant||"variant";m=_.map(U=>({title:U[b],time:U[v],startDate:U[v],endDate:U[v],description:U[w],variant:U[V]||"default",_data:U}))}const p={...e,items:m||[],className:n||e.className};return c?h.jsxs("div",{className:"p-4 text-red-500",children:["Error loading timeline: ",c.message]}):h.jsx(Te,{schema:p})},Ie=R.forwardRef(({className:e,...t},n)=>h.jsx("ol",{ref:n,className:P.cn("relative border-l border-gray-200",e),...t}));Ie.displayName="Timeline";const Ae=R.forwardRef(({className:e,...t},n)=>h.jsx("li",{ref:n,className:P.cn("mb-10 ml-6",e),...t}));Ae.displayName="TimelineItem";const _e=R.forwardRef(({className:e,variant:t="default",...n},r)=>{const o={default:"bg-gray-200 border-gray-300",success:"bg-green-200 border-green-500",warning:"bg-yellow-200 border-yellow-500",danger:"bg-red-200 border-red-500",info:"bg-blue-200 border-blue-500"};return h.jsx("div",{ref:r,className:P.cn("absolute -left-3 w-6 h-6 rounded-full border-2 flex items-center justify-center",o[t],e),...n})});_e.displayName="TimelineMarker";const Ce=R.forwardRef(({className:e,...t},n)=>h.jsx("div",{ref:n,className:e,...t}));Ce.displayName="TimelineContent";const ve=R.forwardRef(({className:e,...t},n)=>h.jsx("h3",{ref:n,className:P.cn("font-semibold text-lg mb-1",e),...t}));ve.displayName="TimelineTitle";const ye=R.forwardRef(({className:e,...t},n)=>h.jsx("time",{ref:n,className:P.cn("text-sm font-normal text-gray-500 mb-2 block",e),...t}));ye.displayName="TimelineTime";const be=R.forwardRef(({className:e,...t},n)=>h.jsx("p",{ref:n,className:P.cn("text-base text-gray-700",e),...t}));be.displayName="TimelineDescription";const Fe=R.forwardRef(({className:e,...t},n)=>h.jsx("div",{ref:n,className:P.cn("relative flex overflow-x-auto py-8",e),...t}));Fe.displayName="TimelineHorizontal";const Ue=R.forwardRef(({className:e,...t},n)=>h.jsx("div",{ref:n,className:P.cn("flex-shrink-0 w-64 relative",e),...t}));Ue.displayName="TimelineHorizontalItem";const Le=R.forwardRef(({className:e,...t},n)=>h.jsx("div",{ref:n,className:P.cn("relative w-full border rounded-lg overflow-hidden",e),...t}));Le.displayName="TimelineGantt";const Je=R.forwardRef(({className:e,...t},n)=>h.jsx("div",{ref:n,className:P.cn("flex border-b bg-gray-50",e),...t}));Je.displayName="TimelineGanttHeader";const we=R.forwardRef(({className:e,...t},n)=>h.jsx("div",{ref:n,className:P.cn("w-48 border-r bg-white",e),...t}));we.displayName="TimelineGanttRowLabels";const ze=R.forwardRef(({className:e,...t},n)=>h.jsx("div",{ref:n,className:P.cn("flex-1 overflow-x-auto",e),...t}));ze.displayName="TimelineGanttGrid";const ke=R.forwardRef(({className:e,...t},n)=>h.jsx("div",{ref:n,className:P.cn("flex items-center border-b min-h-12",e),...t}));ke.displayName="TimelineGanttRow";const Me=R.forwardRef(({className:e,...t},n)=>h.jsx("div",{ref:n,className:P.cn("px-4 py-2 font-medium text-sm truncate",e),...t}));Me.displayName="TimelineGanttLabel";const Ge=R.forwardRef(({className:e,start:t=0,width:n=100,variant:r="default",...o},a)=>{const i={default:"bg-blue-500 hover:bg-blue-600",success:"bg-green-500 hover:bg-green-600",warning:"bg-yellow-500 hover:bg-yellow-600",danger:"bg-red-500 hover:bg-red-600",info:"bg-purple-500 hover:bg-purple-600"};return h.jsx("div",{ref:a,className:P.cn("absolute h-8 rounded-md transition-colors cursor-pointer",i[r],e),style:{left:`${t}%`,width:`${n}%`},...o})});Ge.displayName="TimelineGanttBar";const Ve=R.forwardRef(({className:e,...t},n)=>h.jsx("div",{ref:n,className:P.cn("px-2 py-1 text-white text-xs font-medium truncate",e),...t}));Ve.displayName="TimelineGanttBarContent";const Bt=({schema:e,...t})=>{const{dataSource:n}=Qe.useSchemaContext();return h.jsx(Yt,{schema:e,dataSource:n,...t})};Xe.ComponentRegistry.register("object-timeline",Bt,{namespace:"plugin-timeline",label:"Object Timeline",category:"plugin",inputs:[{name:"objectName",type:"string",label:"Object Name",required:!0},{name:"variant",type:"enum",enum:["vertical","horizontal","gantt"],defaultValue:"vertical"}]}),z.ObjectTimeline=Yt,z.ObjectTimelineRenderer=Bt,z.Timeline=Ie,z.TimelineContent=Ce,z.TimelineDescription=be,z.TimelineGantt=Le,z.TimelineGanttBar=Ge,z.TimelineGanttBarContent=Ve,z.TimelineGanttGrid=ze,z.TimelineGanttHeader=Je,z.TimelineGanttLabel=Me,z.TimelineGanttRow=ke,z.TimelineGanttRowLabels=we,z.TimelineHorizontal=Fe,z.TimelineHorizontalItem=Ue,z.TimelineItem=Ae,z.TimelineMarker=_e,z.TimelineRenderer=Te,z.TimelineTime=ye,z.TimelineTitle=ve,Object.defineProperty(z,Symbol.toStringTag,{value:"Module"})}));
@@ -0,0 +1,20 @@
1
+ import { default as React } from 'react';
2
+ import { DataSource, TimelineSchema } from '../../types/src';
3
+ export interface ObjectTimelineProps {
4
+ schema: TimelineSchema & {
5
+ objectName?: string;
6
+ titleField?: string;
7
+ dateField?: string;
8
+ descriptionField?: string;
9
+ mapping?: {
10
+ title?: string;
11
+ date?: string;
12
+ description?: string;
13
+ variant?: string;
14
+ };
15
+ };
16
+ dataSource?: DataSource;
17
+ className?: string;
18
+ }
19
+ export declare const ObjectTimeline: React.FC<ObjectTimelineProps>;
20
+ //# sourceMappingURL=ObjectTimeline.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ObjectTimeline.d.ts","sourceRoot":"","sources":["../../src/ObjectTimeline.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAA8B,MAAM,OAAO,CAAC;AACnD,OAAO,KAAK,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAoBnE,MAAM,WAAW,mBAAmB;IAClC,MAAM,EAAE,cAAc,GAAG;QACvB,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,gBAAgB,CAAC,EAAE,MAAM,CAAC;QAE1B,OAAO,CAAC,EAAE;YACR,KAAK,CAAC,EAAE,MAAM,CAAC;YACf,IAAI,CAAC,EAAE,MAAM,CAAC;YACd,WAAW,CAAC,EAAE,MAAM,CAAC;YACrB,OAAO,CAAC,EAAE,MAAM,CAAC;SAClB,CAAA;KACF,CAAC;IACF,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,eAAO,MAAM,cAAc,EAAE,KAAK,CAAC,EAAE,CAAC,mBAAmB,CAyFxD,CAAA"}
@@ -31,4 +31,7 @@ declare const TimelineGanttBar: React.ForwardRefExoticComponent<React.HTMLAttrib
31
31
  declare const TimelineGanttBarContent: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
32
32
  export { Timeline, TimelineItem, TimelineMarker, TimelineContent, TimelineTitle, TimelineTime, TimelineDescription, TimelineHorizontal, TimelineHorizontalItem, TimelineGantt, TimelineGanttHeader, TimelineGanttRowLabels, TimelineGanttGrid, TimelineGanttRow, TimelineGanttLabel, TimelineGanttBar, TimelineGanttBarContent, };
33
33
  export * from './renderer';
34
+ export { ObjectTimeline } from './ObjectTimeline';
35
+ export type { ObjectTimelineProps } from './ObjectTimeline';
36
+ export declare const ObjectTimelineRenderer: React.FC<any>;
34
37
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAG9B,QAAA,MAAM,QAAQ,iHASZ,CAAA;AAGF,QAAA,MAAM,YAAY,2GAShB,CAAA;AAGF,QAAA,MAAM,cAAc;cAGN,SAAS,GAAG,SAAS,GAAG,SAAS,GAAG,QAAQ,GAAG,MAAM;wCAsBjE,CAAA;AAGF,QAAA,MAAM,eAAe,6GASnB,CAAA;AAGF,QAAA,MAAM,aAAa,qHASjB,CAAA;AAGF,QAAA,MAAM,YAAY,mHAShB,CAAA;AAGF,QAAA,MAAM,mBAAmB,yHASvB,CAAA;AAIF,QAAA,MAAM,kBAAkB,6GAStB,CAAA;AAGF,QAAA,MAAM,sBAAsB,6GAS1B,CAAA;AAIF,QAAA,MAAM,aAAa,6GASjB,CAAA;AAGF,QAAA,MAAM,mBAAmB,6GASvB,CAAA;AAGF,QAAA,MAAM,sBAAsB,6GAS1B,CAAA;AAGF,QAAA,MAAM,iBAAiB,6GASrB,CAAA;AAGF,QAAA,MAAM,gBAAgB,6GASpB,CAAA;AAGF,QAAA,MAAM,kBAAkB,6GAStB,CAAA;AAGF,QAAA,MAAM,gBAAgB;YAGV,MAAM;YACN,MAAM;cACJ,SAAS,GAAG,SAAS,GAAG,SAAS,GAAG,QAAQ,GAAG,MAAM;wCA0BjE,CAAA;AAGF,QAAA,MAAM,uBAAuB,6GAS3B,CAAA;AAGF,OAAO,EACL,QAAQ,EACR,YAAY,EACZ,cAAc,EACd,eAAe,EACf,aAAa,EACb,YAAY,EACZ,mBAAmB,EACnB,kBAAkB,EAClB,sBAAsB,EACtB,aAAa,EACb,mBAAmB,EACnB,sBAAsB,EACtB,iBAAiB,EACjB,gBAAgB,EAChB,kBAAkB,EAClB,gBAAgB,EAChB,uBAAuB,GACxB,CAAA;AAGD,cAAc,YAAY,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAG9B,QAAA,MAAM,QAAQ,iHASZ,CAAA;AAGF,QAAA,MAAM,YAAY,2GAShB,CAAA;AAGF,QAAA,MAAM,cAAc;cAGN,SAAS,GAAG,SAAS,GAAG,SAAS,GAAG,QAAQ,GAAG,MAAM;wCAsBjE,CAAA;AAGF,QAAA,MAAM,eAAe,6GASnB,CAAA;AAGF,QAAA,MAAM,aAAa,qHASjB,CAAA;AAGF,QAAA,MAAM,YAAY,mHAShB,CAAA;AAGF,QAAA,MAAM,mBAAmB,yHASvB,CAAA;AAIF,QAAA,MAAM,kBAAkB,6GAStB,CAAA;AAGF,QAAA,MAAM,sBAAsB,6GAS1B,CAAA;AAIF,QAAA,MAAM,aAAa,6GASjB,CAAA;AAGF,QAAA,MAAM,mBAAmB,6GASvB,CAAA;AAGF,QAAA,MAAM,sBAAsB,6GAS1B,CAAA;AAGF,QAAA,MAAM,iBAAiB,6GASrB,CAAA;AAGF,QAAA,MAAM,gBAAgB,6GASpB,CAAA;AAGF,QAAA,MAAM,kBAAkB,6GAStB,CAAA;AAGF,QAAA,MAAM,gBAAgB;YAGV,MAAM;YACN,MAAM;cACJ,SAAS,GAAG,SAAS,GAAG,SAAS,GAAG,QAAQ,GAAG,MAAM;wCA0BjE,CAAA;AAGF,QAAA,MAAM,uBAAuB,6GAS3B,CAAA;AAGF,OAAO,EACL,QAAQ,EACR,YAAY,EACZ,cAAc,EACd,eAAe,EACf,aAAa,EACb,YAAY,EACZ,mBAAmB,EACnB,kBAAkB,EAClB,sBAAsB,EACtB,aAAa,EACb,mBAAmB,EACnB,sBAAsB,EACtB,iBAAiB,EACjB,gBAAgB,EAChB,kBAAkB,EAClB,gBAAgB,EAChB,uBAAuB,GACxB,CAAA;AAGD,cAAc,YAAY,CAAC;AAG3B,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,YAAY,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAO5D,eAAO,MAAM,sBAAsB,EAAE,KAAK,CAAC,EAAE,CAAC,GAAG,CAGhD,CAAC"}
@@ -1,9 +1,7 @@
1
- /**
2
- * ObjectUI
3
- * Copyright (c) 2024-present ObjectStack Inc.
4
- *
5
- * This source code is licensed under the MIT license found in the
6
- * LICENSE file in the root directory of this source tree.
7
- */
8
- export {};
1
+ import { TimelineSchema } from '../../types/src';
2
+ export declare const TimelineRenderer: ({ schema, className, ...props }: {
3
+ schema: TimelineSchema;
4
+ className?: string;
5
+ [key: string]: any;
6
+ }) => import("react/jsx-runtime").JSX.Element | null;
9
7
  //# sourceMappingURL=renderer.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"renderer.d.ts","sourceRoot":"","sources":["../../src/renderer.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG"}
1
+ {"version":3,"file":"renderer.d.ts","sourceRoot":"","sources":["../../src/renderer.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AA8EvD,eAAO,MAAM,gBAAgB,GAAI,iCAAiC;IAAE,MAAM,EAAE,cAAc,CAAC;IAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;CAAE,mDAiMjI,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@object-ui/plugin-timeline",
3
- "version": "0.3.1",
3
+ "version": "0.5.0",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "description": "Timeline component plugin for Object UI",
@@ -24,22 +24,25 @@
24
24
  }
25
25
  },
26
26
  "dependencies": {
27
- "@object-ui/core": "0.3.1",
28
- "@object-ui/components": "0.3.1",
29
- "@object-ui/react": "0.3.1",
30
- "@object-ui/types": "0.3.1"
27
+ "@objectstack/spec": "^0.9.2",
28
+ "zod": "^4.3.6",
29
+ "@object-ui/components": "0.5.0",
30
+ "@object-ui/core": "0.5.0",
31
+ "@object-ui/react": "0.5.0",
32
+ "@object-ui/types": "0.5.0"
31
33
  },
32
34
  "peerDependencies": {
33
35
  "react": "^18.0.0 || ^19.0.0",
34
36
  "react-dom": "^18.0.0 || ^19.0.0"
35
37
  },
36
38
  "devDependencies": {
37
- "@types/react": "^19.2.9",
39
+ "@types/react": "^19.2.10",
38
40
  "@types/react-dom": "^19.2.3",
39
- "@vitejs/plugin-react": "^4.2.1",
41
+ "@vitejs/plugin-react": "^5.1.3",
40
42
  "typescript": "^5.9.3",
41
43
  "vite": "^7.3.1",
42
- "vite-plugin-dts": "^4.5.4"
44
+ "vite-plugin-dts": "^4.5.4",
45
+ "@object-ui/data-objectstack": "0.5.0"
43
46
  },
44
47
  "scripts": {
45
48
  "build": "vite build",
@@ -0,0 +1,80 @@
1
+ import { describe, it, expect, beforeAll, afterAll, afterEach } from 'vitest';
2
+ import { render, screen, waitFor } from '@testing-library/react';
3
+ import { ObjectTimeline } from './ObjectTimeline';
4
+ import { ObjectStackAdapter } from '@object-ui/data-objectstack';
5
+ import { setupServer } from 'msw/node';
6
+ import { http, HttpResponse } from 'msw';
7
+ import React from 'react';
8
+
9
+ const BASE_URL = 'http://localhost';
10
+
11
+ // --- Mock Data ---
12
+
13
+ const mockMilestones = {
14
+ value: [
15
+ { _id: '1', title: 'Start Project', due_date: '2023-01-01', description: 'Initial Kickoff' },
16
+ { _id: '2', title: 'Beta Launch', due_date: '2023-06-01', description: 'Public Beta' },
17
+ { _id: '3', title: 'Release', due_date: '2023-12-01', description: 'v1.0 Release' }
18
+ ]
19
+ };
20
+
21
+ // --- MSW Setup ---
22
+
23
+ const handlers = [
24
+ http.options('*', () => {
25
+ return new HttpResponse(null, { status: 200 });
26
+ }),
27
+
28
+ http.get(`${BASE_URL}/api/v1`, () => {
29
+ return HttpResponse.json({ status: 'ok', version: '1.0.0' });
30
+ }),
31
+
32
+ http.get(`${BASE_URL}/api/v1/data/milestones`, () => {
33
+ return HttpResponse.json(mockMilestones);
34
+ })
35
+ ];
36
+
37
+ const server = setupServer(...handlers);
38
+
39
+ // --- Test Suite ---
40
+
41
+ describe('ObjectTimeline with MSW', () => {
42
+ beforeAll(() => server.listen());
43
+ afterEach(() => server.resetHandlers());
44
+ afterAll(() => server.close());
45
+
46
+ it('fetches and renders timeline items from object data', async () => {
47
+ const adapter = new ObjectStackAdapter({
48
+ baseUrl: BASE_URL,
49
+ bucket: 'test-bucket'
50
+ });
51
+
52
+ const schema = {
53
+ type: 'timeline',
54
+ objectName: 'milestones',
55
+ variant: 'vertical',
56
+ titleField: 'title',
57
+ dateField: 'due_date',
58
+ descriptionField: 'description'
59
+ };
60
+
61
+ render(
62
+ <ObjectTimeline
63
+ // @ts-expect-error - Mock schema type mismatch with TimelineSchema
64
+ schema={schema}
65
+ dataSource={adapter}
66
+ />
67
+ );
68
+
69
+ // Wait for items to appear
70
+ await waitFor(() => {
71
+ expect(screen.getByText('Start Project')).toBeInTheDocument();
72
+ });
73
+
74
+ expect(screen.getByText('Beta Launch')).toBeInTheDocument();
75
+ expect(screen.getByText('Release')).toBeInTheDocument();
76
+
77
+ // Check descriptions if rendered
78
+ expect(screen.getByText('Initial Kickoff')).toBeInTheDocument();
79
+ });
80
+ });
@@ -0,0 +1,69 @@
1
+ import React from 'react';
2
+ import { render, screen, waitFor } from '@testing-library/react';
3
+ import { describe, it, expect, vi } from 'vitest';
4
+ import { ObjectTimeline } from './ObjectTimeline';
5
+ import { DataSource } from '@object-ui/types';
6
+
7
+ // Mock useDataScope
8
+ vi.mock('@object-ui/react', () => ({
9
+ useDataScope: () => undefined,
10
+ }));
11
+
12
+ vi.mock('./renderer', () => ({
13
+ TimelineRenderer: ({ schema }: any) => (
14
+ <div data-testid="timeline-view">
15
+ {schema.items?.map((t: any, idx: number) => (
16
+ <div key={idx} data-testid="timeline-item">{t.title}</div>
17
+ ))}
18
+ </div>
19
+ ),
20
+ }));
21
+
22
+ const mockData = [
23
+ { id: '1', name: 'Event 1', date: '2024-01-01', description: 'Desc 1' },
24
+ ];
25
+
26
+ const mockDataSource: DataSource = {
27
+ find: vi.fn(),
28
+ findOne: vi.fn(),
29
+ create: vi.fn(),
30
+ update: vi.fn(),
31
+ delete: vi.fn(),
32
+ getObjectSchema: vi.fn(),
33
+ };
34
+
35
+ describe('ObjectTimeline', () => {
36
+ it('renders with static items', async () => {
37
+ const schema: any = {
38
+ type: 'timeline',
39
+ items: [
40
+ { title: 'Static Event', date: '2024-01-01' }
41
+ ]
42
+ };
43
+ render(<ObjectTimeline schema={schema} />);
44
+ await waitFor(() => {
45
+ expect(screen.getByText('Static Event')).toBeDefined();
46
+ });
47
+ });
48
+
49
+ it('fetches data when objectName is provided', async () => {
50
+ (mockDataSource.find as any).mockResolvedValue({ value: mockData });
51
+
52
+ const schema: any = {
53
+ type: 'timeline',
54
+ objectName: 'events',
55
+ titleField: 'name',
56
+ dateField: 'date' // Mapping needs to be correct in logic
57
+ };
58
+
59
+ render(<ObjectTimeline schema={schema} dataSource={mockDataSource} />);
60
+
61
+ await waitFor(() => {
62
+ expect(mockDataSource.find).toHaveBeenCalled();
63
+ });
64
+
65
+ await waitFor(() => {
66
+ expect(screen.getByText('Event 1')).toBeDefined();
67
+ });
68
+ });
69
+ });