@clawos-dev/clawd 0.2.721 → 0.2.722

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.
@@ -92,7 +92,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
92
92
  0 -6px 16px 0 rgba(0, 0, 0, 0.08),
93
93
  0 -3px 6px -4px rgba(0, 0, 0, 0.12),
94
94
  0 -9px 28px 8px rgba(0, 0, 0, 0.05)
95
- `,boxShadowTabsOverflowLeft:"inset 10px 0 8px -8px rgba(0, 0, 0, 0.08)",boxShadowTabsOverflowRight:"inset -10px 0 8px -8px rgba(0, 0, 0, 0.08)",boxShadowTabsOverflowTop:"inset 0 10px 8px -8px rgba(0, 0, 0, 0.08)",boxShadowTabsOverflowBottom:"inset 0 -10px 8px -8px rgba(0, 0, 0, 0.08)"}),r)}var K4=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,r=Object.getOwnPropertySymbols(e);s<r.length;s++)t.indexOf(r[s])<0&&Object.prototype.propertyIsEnumerable.call(e,r[s])&&(n[r[s]]=e[r[s]]);return n};const Rae={lineHeight:!0,lineHeightSM:!0,lineHeightLG:!0,lineHeightHeading1:!0,lineHeightHeading2:!0,lineHeightHeading3:!0,lineHeightHeading4:!0,lineHeightHeading5:!0,opacityLoading:!0,fontWeightStrong:!0,zIndexPopupBase:!0,zIndexBase:!0,opacityImage:!0},Mae={motionBase:!0,motionUnit:!0},Pae={screenXS:!0,screenXSMin:!0,screenXSMax:!0,screenSM:!0,screenSMMin:!0,screenSMMax:!0,screenMD:!0,screenMDMin:!0,screenMDMax:!0,screenLG:!0,screenLGMin:!0,screenLGMax:!0,screenXL:!0,screenXLMin:!0,screenXLMax:!0,screenXXL:!0,screenXXLMin:!0},t7=(e,t,n)=>{const r=n.getDerivativeToken(e),{override:s}=t,i=K4(t,["override"]);let o=Object.assign(Object.assign({},r),{override:s});return o=e7(o),i&&Object.entries(i).forEach(([l,c])=>{const{theme:u}=c,d=K4(c,["theme"]);let h=d;u&&(h=t7(Object.assign(Object.assign({},o),d),{override:d},u)),o[l]=h}),o};function n7(){const{token:e,hashed:t,theme:n,override:r,cssVar:s}=q.useContext(Q9),i=`${Iae}-${t||""}`,o=n||Z9,[l,c,u]=boe(o,[gg,e],{salt:i,override:r,getComputedToken:t7,formatToken:e7,cssVar:s&&{prefix:s.prefix,key:s.key,unitless:Rae,ignore:Mae,preserve:Pae}});return[o,u,t?c:"",l,s]}const Oae=()=>({display:"inline-flex",alignItems:"center",color:"inherit",fontStyle:"normal",lineHeight:0,textAlign:"center",textTransform:"none",verticalAlign:"-0.125em",textRendering:"optimizeLegibility","-webkit-font-smoothing":"antialiased","-moz-osx-font-smoothing":"grayscale","> *":{lineHeight:1},svg:{display:"inline-block"}}),Dae=e=>({[`.${e}`]:Object.assign(Object.assign({},Oae()),{[`.${e} .${e}-icon`]:{display:"block"}})}),Aae=(e,t)=>{const[n,r]=n7();return Goe({token:r,hashId:"",path:["ant-design-icons",e],nonce:()=>t==null?void 0:t.nonce,layer:{name:"antd"}},()=>Dae(e))},$ae=Object.assign({},bf),{useId:G4}=$ae,Lae=()=>"",Bae=typeof G4>"u"?Lae:G4;function Fae(e,t,n){var r;const s=e||{},i=s.inherit===!1||!t?Object.assign(Object.assign({},kb),{hashed:(r=t==null?void 0:t.hashed)!==null&&r!==void 0?r:kb.hashed,cssVar:t==null?void 0:t.cssVar}):t,o=Bae();return w9(()=>{var l,c;if(!e)return t;const u=Object.assign({},i.components);Object.keys(e.components||{}).forEach(f=>{u[f]=Object.assign(Object.assign({},u[f]),e.components[f])});const d=`css-var-${o.replace(/:/g,"")}`,h=((l=s.cssVar)!==null&&l!==void 0?l:i.cssVar)&&Object.assign(Object.assign(Object.assign({prefix:n==null?void 0:n.prefixCls},typeof i.cssVar=="object"?i.cssVar:{}),typeof s.cssVar=="object"?s.cssVar:{}),{key:typeof s.cssVar=="object"&&((c=s.cssVar)===null||c===void 0?void 0:c.key)||d});return Object.assign(Object.assign(Object.assign({},i),s),{token:Object.assign(Object.assign({},i.token),s.token),components:u,cssVar:h})},[s,i],(l,c)=>l.some((u,d)=>{const h=c[d];return!Gie(u,h,!0)}))}var zae=["children"],r7=p.createContext({});function Hae(e){var t=e.children,n=ui(e,zae);return p.createElement(r7.Provider,{value:n},t)}var Uae=function(e){Rr(n,e);var t=k9(n);function n(){return Rn(this,n),t.apply(this,arguments)}return Mn(n,[{key:"render",value:function(){return this.props.children}}]),n}(p.Component);function Wae(e){var t=p.useReducer(function(l){return l+1},0),n=St(t,2),r=n[1],s=p.useRef(e),i=LN(function(){return s.current}),o=LN(function(l){s.current=typeof l=="function"?l(s.current):l,r()});return[i,o]}var Dl="none",t0="appear",n0="enter",r0="leave",Y4="none",fo="prepare",ah="start",lh="active",_5="end",s7="prepared";function X4(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit".concat(e)]="webkit".concat(t),n["Moz".concat(e)]="moz".concat(t),n["ms".concat(e)]="MS".concat(t),n["O".concat(e)]="o".concat(t.toLowerCase()),n}function Vae(e,t){var n={animationend:X4("Animation","AnimationEnd"),transitionend:X4("Transition","TransitionEnd")};return e&&("AnimationEvent"in t||delete n.animationend.animation,"TransitionEvent"in t||delete n.transitionend.transition),n}var qae=Vae(ul(),typeof window<"u"?window:{}),i7={};if(ul()){var Kae=document.createElement("div");i7=Kae.style}var s0={};function o7(e){if(s0[e])return s0[e];var t=qae[e];if(t)for(var n=Object.keys(t),r=n.length,s=0;s<r;s+=1){var i=n[s];if(Object.prototype.hasOwnProperty.call(t,i)&&i in i7)return s0[e]=t[i],s0[e]}return""}var a7=o7("animationend"),l7=o7("transitionend"),c7=!!(a7&&l7),Z4=a7||"animationend",Q4=l7||"transitionend";function J4(e,t){if(!e)return null;if(Tn(e)==="object"){var n=t.replace(/-\w/g,function(r){return r[1].toUpperCase()});return e[n]}return"".concat(e,"-").concat(t)}const Gae=function(e){var t=p.useRef();function n(s){s&&(s.removeEventListener(Q4,e),s.removeEventListener(Z4,e))}function r(s){t.current&&t.current!==s&&n(t.current),s&&s!==t.current&&(s.addEventListener(Q4,e),s.addEventListener(Z4,e),t.current=s)}return p.useEffect(function(){return function(){n(t.current)}},[]),[r,n]};var u7=ul()?p.useLayoutEffect:p.useEffect;const Yae=function(){var e=p.useRef(null);function t(){mN.cancel(e.current)}function n(r){var s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:2;t();var i=mN(function(){s<=1?r({isCanceled:function(){return i!==e.current}}):n(r,s-1)});e.current=i}return p.useEffect(function(){return function(){t()}},[]),[n,t]};var Xae=[fo,ah,lh,_5],Zae=[fo,s7],d7=!1,Qae=!0;function h7(e){return e===lh||e===_5}const Jae=function(e,t,n){var r=BN(Y4),s=St(r,2),i=s[0],o=s[1],l=Yae(),c=St(l,2),u=c[0],d=c[1];function h(){o(fo,!0)}var f=t?Zae:Xae;return u7(function(){if(i!==Y4&&i!==_5){var m=f.indexOf(i),g=f[m+1],x=n(i);x===d7?o(g,!0):g&&u(function(b){function y(){b.isCanceled()||o(g,!0)}x===!0?y():Promise.resolve(x).then(y)})}},[e,i]),p.useEffect(function(){return function(){d()}},[]),[h,i]};function ele(e,t,n,r){var s=r.motionEnter,i=s===void 0?!0:s,o=r.motionAppear,l=o===void 0?!0:o,c=r.motionLeave,u=c===void 0?!0:c,d=r.motionDeadline,h=r.motionLeaveImmediately,f=r.onAppearPrepare,m=r.onEnterPrepare,g=r.onLeavePrepare,x=r.onAppearStart,b=r.onEnterStart,y=r.onLeaveStart,v=r.onAppearActive,w=r.onEnterActive,_=r.onLeaveActive,S=r.onAppearEnd,k=r.onEnterEnd,C=r.onLeaveEnd,j=r.onVisibleChanged,R=BN(),E=St(R,2),T=E[0],P=E[1],O=Wae(Dl),A=St(O,2),F=A[0],B=A[1],U=BN(null),L=St(U,2),D=L[0],I=L[1],V=F(),H=p.useRef(!1),M=p.useRef(null);function G(){return n()}var X=p.useRef(!1);function K(){B(Dl),I(null,!0)}var te=LN(function(De){var Me=F();if(Me!==Dl){var We=G();if(!(De&&!De.deadline&&De.target!==We)){var wt=X.current,Nt;Me===t0&&wt?Nt=S==null?void 0:S(We,De):Me===n0&&wt?Nt=k==null?void 0:k(We,De):Me===r0&&wt&&(Nt=C==null?void 0:C(We,De)),wt&&Nt!==!1&&K()}}}),ce=Gae(te),J=St(ce,1),de=J[0],Se=function(Me){switch(Me){case t0:return Ze(Ze(Ze({},fo,f),ah,x),lh,v);case n0:return Ze(Ze(Ze({},fo,m),ah,b),lh,w);case r0:return Ze(Ze(Ze({},fo,g),ah,y),lh,_);default:return{}}},se=p.useMemo(function(){return Se(V)},[V]),ae=Jae(V,!e,function(De){if(De===fo){var Me=se[fo];return Me?Me(G()):d7}if(xe in se){var We;I(((We=se[xe])===null||We===void 0?void 0:We.call(se,G(),null))||null)}return xe===lh&&V!==Dl&&(de(G()),d>0&&(clearTimeout(M.current),M.current=setTimeout(function(){te({deadline:!0})},d))),xe===s7&&K(),Qae}),Z=St(ae,2),fe=Z[0],xe=Z[1],Te=h7(xe);X.current=Te;var Qe=p.useRef(null);u7(function(){if(!(H.current&&Qe.current===t)){P(t);var De=H.current;H.current=!0;var Me;!De&&t&&l&&(Me=t0),De&&t&&i&&(Me=n0),(De&&!t&&u||!De&&h&&!t&&u)&&(Me=r0);var We=Se(Me);Me&&(e||We[fo])?(B(Me),fe()):B(Dl),Qe.current=t}},[t]),p.useEffect(function(){(V===t0&&!l||V===n0&&!i||V===r0&&!u)&&B(Dl)},[l,i,u]),p.useEffect(function(){return function(){H.current=!1,clearTimeout(M.current)}},[]);var ge=p.useRef(!1);p.useEffect(function(){T&&(ge.current=!0),T!==void 0&&V===Dl&&((ge.current||T)&&(j==null||j(T)),ge.current=!0)},[T,V]);var Ce=D;return se[fo]&&xe===ah&&(Ce=Pt({transition:"none"},Ce)),[V,xe,Ce,T??t]}function tle(e){var t=e;Tn(e)==="object"&&(t=e.transitionSupport);function n(s,i){return!!(s.motionName&&t&&i!==!1)}var r=p.forwardRef(function(s,i){var o=s.visible,l=o===void 0?!0:o,c=s.removeOnLeave,u=c===void 0?!0:c,d=s.forceRender,h=s.children,f=s.motionName,m=s.leavedClassName,g=s.eventProps,x=p.useContext(r7),b=x.motion,y=n(s,b),v=p.useRef(),w=p.useRef();function _(){try{return v.current instanceof HTMLElement?v.current:Pie(w.current)}catch{return null}}var S=ele(y,l,_,s),k=St(S,4),C=k[0],j=k[1],R=k[2],E=k[3],T=p.useRef(E);E&&(T.current=!0);var P=p.useCallback(function(L){v.current=L,$ie(i,L)},[i]),O,A=Pt(Pt({},g),{},{visible:l});if(!h)O=null;else if(C===Dl)E?O=h(Pt({},A),P):!u&&T.current&&m?O=h(Pt(Pt({},A),{},{className:m}),P):d||!u&&!m?O=h(Pt(Pt({},A),{},{style:{display:"none"}}),P):O=null;else{var F;j===fo?F="prepare":h7(j)?F="active":j===ah&&(F="start");var B=J4(f,"".concat(C,"-").concat(F));O=h(Pt(Pt({},A),{},{className:wie(J4(f,C),Ze(Ze({},B,B&&F),f,typeof f=="string")),style:R}),P)}if(p.isValidElement(O)&&Lie(O)){var U=Bie(O);U||(O=p.cloneElement(O,{ref:P}))}return p.createElement(Uae,{ref:w},O)});return r.displayName="CSSMotion",r}const nle=tle(c7);var FN="add",zN="keep",HN="remove",yk="removed";function rle(e){var t;return e&&Tn(e)==="object"&&"key"in e?t=e:t={key:e},Pt(Pt({},t),{},{key:String(t.key)})}function UN(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];return e.map(rle)}function sle(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],n=[],r=0,s=t.length,i=UN(e),o=UN(t);i.forEach(function(u){for(var d=!1,h=r;h<s;h+=1){var f=o[h];if(f.key===u.key){r<h&&(n=n.concat(o.slice(r,h).map(function(m){return Pt(Pt({},m),{},{status:FN})})),r=h),n.push(Pt(Pt({},f),{},{status:zN})),r+=1,d=!0;break}}d||n.push(Pt(Pt({},u),{},{status:HN}))}),r<s&&(n=n.concat(o.slice(r).map(function(u){return Pt(Pt({},u),{},{status:FN})})));var l={};n.forEach(function(u){var d=u.key;l[d]=(l[d]||0)+1});var c=Object.keys(l).filter(function(u){return l[u]>1});return c.forEach(function(u){n=n.filter(function(d){var h=d.key,f=d.status;return h!==u||f!==HN}),n.forEach(function(d){d.key===u&&(d.status=zN)})}),n}var ile=["component","children","onVisibleChanged","onAllRemoved"],ole=["status"],ale=["eventProps","visible","children","motionName","motionAppear","motionEnter","motionLeave","motionLeaveImmediately","motionDeadline","removeOnLeave","leavedClassName","onAppearPrepare","onAppearStart","onAppearActive","onAppearEnd","onEnterStart","onEnterActive","onEnterEnd","onLeaveStart","onLeaveActive","onLeaveEnd"];function lle(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:nle,n=function(r){Rr(i,r);var s=k9(i);function i(){var o;Rn(this,i);for(var l=arguments.length,c=new Array(l),u=0;u<l;u++)c[u]=arguments[u];return o=s.call.apply(s,[this].concat(c)),Ze(fN(o),"state",{keyEntities:[]}),Ze(fN(o),"removeKey",function(d){o.setState(function(h){var f=h.keyEntities.map(function(m){return m.key!==d?m:Pt(Pt({},m),{},{status:yk})});return{keyEntities:f}},function(){var h=o.state.keyEntities,f=h.filter(function(m){var g=m.status;return g!==yk}).length;f===0&&o.props.onAllRemoved&&o.props.onAllRemoved()})}),o}return Mn(i,[{key:"render",value:function(){var l=this,c=this.state.keyEntities,u=this.props,d=u.component,h=u.children,f=u.onVisibleChanged;u.onAllRemoved;var m=ui(u,ile),g=d||p.Fragment,x={};return ale.forEach(function(b){x[b]=m[b],delete m[b]}),delete m.keys,p.createElement(g,m,c.map(function(b,y){var v=b.status,w=ui(b,ole),_=v===FN||v===zN;return p.createElement(t,bt({},x,{key:w.key,visible:_,eventProps:w,onVisibleChanged:function(k){f==null||f(k,{key:w.key}),k||l.removeKey(w.key)}}),function(S,k){return h(Pt(Pt({},S),{},{index:y}),k)})}))}}],[{key:"getDerivedStateFromProps",value:function(l,c){var u=l.keys,d=c.keyEntities,h=UN(u),f=sle(d,h);return{keyEntities:f.filter(function(m){var g=d.find(function(x){var b=x.key;return m.key===b});return!(g&&g.status===yk&&m.status===HN)})}}}]),i}(p.Component);return Ze(n,"defaultProps",{component:"div"}),n}lle(c7);const eO=p.createContext(!0);function cle(e){const t=p.useContext(eO),{children:n}=e,[,r]=n7(),{motion:s}=r,i=p.useRef(!1);return i.current||(i.current=t!==s),i.current?p.createElement(eO.Provider,{value:s},p.createElement(Hae,{motion:s},n)):n}const ule=()=>null;var dle=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,r=Object.getOwnPropertySymbols(e);s<r.length;s++)t.indexOf(r[s])<0&&Object.prototype.propertyIsEnumerable.call(e,r[s])&&(n[r[s]]=e[r[s]]);return n};const hle=["getTargetContainer","getPopupContainer","renderEmpty","input","pagination","form","select","button"];let f7;function fle(){return f7||AN}function ple(e){return Object.keys(e).some(t=>t.endsWith("Color"))}const mle=e=>{const{prefixCls:t,iconPrefixCls:n,theme:r,holderRender:s}=e;t!==void 0&&(f7=t),r&&ple(r)&&Sae(fle(),r)},gle=e=>{const{children:t,csp:n,autoInsertSpaceInButton:r,alert:s,anchor:i,form:o,locale:l,componentSize:c,direction:u,space:d,splitter:h,virtual:f,dropdownMatchSelectWidth:m,popupMatchSelectWidth:g,popupOverflow:x,legacyLocale:b,parentContext:y,iconPrefixCls:v,theme:w,componentDisabled:_,segmented:S,statistic:k,spin:C,calendar:j,carousel:R,cascader:E,collapse:T,typography:P,checkbox:O,descriptions:A,divider:F,drawer:B,skeleton:U,steps:L,image:D,layout:I,list:V,mentions:H,modal:M,progress:G,result:X,slider:K,breadcrumb:te,menu:ce,pagination:J,input:de,textArea:Se,empty:se,badge:ae,radio:Z,rate:fe,switch:xe,transfer:Te,avatar:Qe,message:ge,tag:Ce,table:De,card:Me,tabs:We,timeline:wt,timePicker:Nt,upload:ie,notification:le,tree:pe,colorPicker:Ke,datePicker:Ge,rangePicker:dt,flex:rn,wave:Ve,dropdown:en,warning:ye,tour:Oe,tooltip:ht,popover:jt,popconfirm:vn,floatButton:be,floatButtonGroup:ne,variant:Ae,inputNumber:nt,treeSelect:rt}=e,Mt=p.useCallback((_t,Kt)=>{const{prefixCls:Zn}=e;if(Kt)return Kt;const dr=Zn||y.getPrefixCls("");return _t?`${dr}-${_t}`:dr},[y.getPrefixCls,e.prefixCls]),$t=v||y.iconPrefixCls||J9,Ht=n||y.csp;Aae($t,Ht);const sn=Fae(w,y.theme,{prefixCls:Mt("")}),$n={csp:Ht,autoInsertSpaceInButton:r,alert:s,anchor:i,locale:l||b,direction:u,space:d,splitter:h,virtual:f,popupMatchSelectWidth:g??m,popupOverflow:x,getPrefixCls:Mt,iconPrefixCls:$t,theme:sn,segmented:S,statistic:k,spin:C,calendar:j,carousel:R,cascader:E,collapse:T,typography:P,checkbox:O,descriptions:A,divider:F,drawer:B,skeleton:U,steps:L,image:D,input:de,textArea:Se,layout:I,list:V,mentions:H,modal:M,progress:G,result:X,slider:K,breadcrumb:te,menu:ce,pagination:J,empty:se,badge:ae,radio:Z,rate:fe,switch:xe,transfer:Te,avatar:Qe,message:ge,tag:Ce,table:De,card:Me,tabs:We,timeline:wt,timePicker:Nt,upload:ie,notification:le,tree:pe,colorPicker:Ke,datePicker:Ge,rangePicker:dt,flex:rn,wave:Ve,dropdown:en,warning:ye,tour:Oe,tooltip:ht,popover:jt,popconfirm:vn,floatButton:be,floatButtonGroup:ne,variant:Ae,inputNumber:nt,treeSelect:rt},Lt=Object.assign({},y);Object.keys($n).forEach(_t=>{$n[_t]!==void 0&&(Lt[_t]=$n[_t])}),hle.forEach(_t=>{const Kt=e[_t];Kt&&(Lt[_t]=Kt)}),typeof r<"u"&&(Lt.button=Object.assign({autoInsertSpace:r},Lt.button));const an=w9(()=>Lt,Lt,(_t,Kt)=>{const Zn=Object.keys(_t),dr=Object.keys(Kt);return Zn.length!==dr.length||Zn.some(nr=>_t[nr]!==Kt[nr])}),{layer:yn}=p.useContext(bw),bn=p.useMemo(()=>({prefixCls:$t,csp:Ht,layer:yn?"antd":void 0}),[$t,Ht,yn]);let Zt=p.createElement(p.Fragment,null,p.createElement(ule,{dropdownMatchSelectWidth:m}),t);const _e=p.useMemo(()=>{var _t,Kt,Zn,dr;return tae(((_t=Sw.Form)===null||_t===void 0?void 0:_t.defaultValidateMessages)||{},((Zn=(Kt=an.locale)===null||Kt===void 0?void 0:Kt.Form)===null||Zn===void 0?void 0:Zn.defaultValidateMessages)||{},((dr=an.form)===null||dr===void 0?void 0:dr.validateMessages)||{},(o==null?void 0:o.validateMessages)||{})},[an,o==null?void 0:o.validateMessages]);Object.keys(_e).length>0&&(Zt=p.createElement(rae.Provider,{value:_e},Zt)),l&&(Zt=p.createElement(oae,{locale:l,_ANT_MARK__:iae},Zt)),Zt=p.createElement(Qoe.Provider,{value:bn},Zt),c&&(Zt=p.createElement(Cae,{size:c},Zt)),Zt=p.createElement(cle,null,Zt);const ct=p.useMemo(()=>{const _t=sn||{},{algorithm:Kt,token:Zn,components:dr,cssVar:nr}=_t,eo=dle(_t,["algorithm","token","components","cssVar"]),Ca=Kt&&(!Array.isArray(Kt)||Kt.length>0)?vN(Kt):Z9,Gs={};Object.entries(dr||{}).forEach(([Na,ja])=>{const Ut=Object.assign({},ja);"algorithm"in Ut&&(Ut.algorithm===!0?Ut.theme=Ca:(Array.isArray(Ut.algorithm)||typeof Ut.algorithm=="function")&&(Ut.theme=vN(Ut.algorithm)),delete Ut.algorithm),Gs[Na]=Ut});const _i=Object.assign(Object.assign({},gg),Zn);return Object.assign(Object.assign({},eo),{theme:Ca,token:_i,components:Gs,override:Object.assign({override:_i},Gs),cssVar:nr})},[sn]);return w&&(Zt=p.createElement(Q9.Provider,{value:ct},Zt)),an.warning&&(Zt=p.createElement(nae.Provider,{value:an.warning},Zt)),_!==void 0&&(Zt=p.createElement(kae,{disabled:_},Zt)),p.createElement(kw.Provider,{value:an},Zt)},kf=e=>{const t=p.useContext(kw),n=p.useContext(K9);return p.createElement(gle,Object.assign({parentContext:t,legacyLocale:n},e))};kf.ConfigContext=kw;kf.SizeContext=xg;kf.config=mle;kf.useConfig=Nae;Object.defineProperty(kf,"SizeContext",{get:()=>xg});var p7={exports:{}};(function(e,t){(function(n,r){e.exports=r()})(Br,function(){var n=1e3,r=6e4,s=36e5,i="millisecond",o="second",l="minute",c="hour",u="day",d="week",h="month",f="quarter",m="year",g="date",x="Invalid Date",b=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,y=/\[([^\]]+)]|YYYY|YY|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,v={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(A){var F=["th","st","nd","rd"],B=A%100;return"["+A+(F[(B-20)%10]||F[B]||F[0])+"]"}},w=function(A,F,B){var U=String(A);return!U||U.length>=F?A:""+Array(F+1-U.length).join(B)+A},_={s:w,z:function(A){var F=-A.utcOffset(),B=Math.abs(F),U=Math.floor(B/60),L=B%60;return(F<=0?"+":"-")+w(U,2,"0")+":"+w(L,2,"0")},m:function A(F,B){if(F.date()<B.date())return-A(B,F);var U=12*(B.year()-F.year())+(B.month()-F.month()),L=F.clone().add(U,h),D=B-L<0,I=F.clone().add(U+(D?-1:1),h);return+(-(U+(B-L)/(D?L-I:I-L))||0)},a:function(A){return A<0?Math.ceil(A)||0:Math.floor(A)},p:function(A){return{M:h,y:m,w:d,d:u,D:g,h:c,m:l,s:o,ms:i,Q:f}[A]||String(A||"").toLowerCase().replace(/s$/,"")},u:function(A){return A===void 0}},S="en",k={};k[S]=v;var C="$isDayjsObject",j=function(A){return A instanceof P||!(!A||!A[C])},R=function A(F,B,U){var L;if(!F)return S;if(typeof F=="string"){var D=F.toLowerCase();k[D]&&(L=D),B&&(k[D]=B,L=D);var I=F.split("-");if(!L&&I.length>1)return A(I[0])}else{var V=F.name;k[V]=F,L=V}return!U&&L&&(S=L),L||!U&&S},E=function(A,F){if(j(A))return A.clone();var B=typeof F=="object"?F:{};return B.date=A,B.args=arguments,new P(B)},T=_;T.l=R,T.i=j,T.w=function(A,F){return E(A,{locale:F.$L,utc:F.$u,x:F.$x,$offset:F.$offset})};var P=function(){function A(B){this.$L=R(B.locale,null,!0),this.parse(B),this.$x=this.$x||B.x||{},this[C]=!0}var F=A.prototype;return F.parse=function(B){this.$d=function(U){var L=U.date,D=U.utc;if(L===null)return new Date(NaN);if(T.u(L))return new Date;if(L instanceof Date)return new Date(L);if(typeof L=="string"&&!/Z$/i.test(L)){var I=L.match(b);if(I){var V=I[2]-1||0,H=(I[7]||"0").substring(0,3);return D?new Date(Date.UTC(I[1],V,I[3]||1,I[4]||0,I[5]||0,I[6]||0,H)):new Date(I[1],V,I[3]||1,I[4]||0,I[5]||0,I[6]||0,H)}}return new Date(L)}(B),this.init()},F.init=function(){var B=this.$d;this.$y=B.getFullYear(),this.$M=B.getMonth(),this.$D=B.getDate(),this.$W=B.getDay(),this.$H=B.getHours(),this.$m=B.getMinutes(),this.$s=B.getSeconds(),this.$ms=B.getMilliseconds()},F.$utils=function(){return T},F.isValid=function(){return this.$d.toString()!==x},F.isSame=function(B,U){var L=E(B);return this.startOf(U)<=L&&L<=this.endOf(U)},F.isAfter=function(B,U){return E(B)<this.startOf(U)},F.isBefore=function(B,U){return this.endOf(U)<E(B)},F.$g=function(B,U,L){return T.u(B)?this[U]:this.set(L,B)},F.unix=function(){return Math.floor(this.valueOf()/1e3)},F.valueOf=function(){return this.$d.getTime()},F.startOf=function(B,U){var L=this,D=!!T.u(U)||U,I=T.p(B),V=function(J,de){var Se=T.w(L.$u?Date.UTC(L.$y,de,J):new Date(L.$y,de,J),L);return D?Se:Se.endOf(u)},H=function(J,de){return T.w(L.toDate()[J].apply(L.toDate("s"),(D?[0,0,0,0]:[23,59,59,999]).slice(de)),L)},M=this.$W,G=this.$M,X=this.$D,K="set"+(this.$u?"UTC":"");switch(I){case m:return D?V(1,0):V(31,11);case h:return D?V(1,G):V(0,G+1);case d:var te=this.$locale().weekStart||0,ce=(M<te?M+7:M)-te;return V(D?X-ce:X+(6-ce),G);case u:case g:return H(K+"Hours",0);case c:return H(K+"Minutes",1);case l:return H(K+"Seconds",2);case o:return H(K+"Milliseconds",3);default:return this.clone()}},F.endOf=function(B){return this.startOf(B,!1)},F.$set=function(B,U){var L,D=T.p(B),I="set"+(this.$u?"UTC":""),V=(L={},L[u]=I+"Date",L[g]=I+"Date",L[h]=I+"Month",L[m]=I+"FullYear",L[c]=I+"Hours",L[l]=I+"Minutes",L[o]=I+"Seconds",L[i]=I+"Milliseconds",L)[D],H=D===u?this.$D+(U-this.$W):U;if(D===h||D===m){var M=this.clone().set(g,1);M.$d[V](H),M.init(),this.$d=M.set(g,Math.min(this.$D,M.daysInMonth())).$d}else V&&this.$d[V](H);return this.init(),this},F.set=function(B,U){return this.clone().$set(B,U)},F.get=function(B){return this[T.p(B)]()},F.add=function(B,U){var L,D=this;B=Number(B);var I=T.p(U),V=function(G){var X=E(D);return T.w(X.date(X.date()+Math.round(G*B)),D)};if(I===h)return this.set(h,this.$M+B);if(I===m)return this.set(m,this.$y+B);if(I===u)return V(1);if(I===d)return V(7);var H=(L={},L[l]=r,L[c]=s,L[o]=n,L)[I]||1,M=this.$d.getTime()+B*H;return T.w(M,this)},F.subtract=function(B,U){return this.add(-1*B,U)},F.format=function(B){var U=this,L=this.$locale();if(!this.isValid())return L.invalidDate||x;var D=B||"YYYY-MM-DDTHH:mm:ssZ",I=T.z(this),V=this.$H,H=this.$m,M=this.$M,G=L.weekdays,X=L.months,K=L.meridiem,te=function(de,Se,se,ae){return de&&(de[Se]||de(U,D))||se[Se].slice(0,ae)},ce=function(de){return T.s(V%12||12,de,"0")},J=K||function(de,Se,se){var ae=de<12?"AM":"PM";return se?ae.toLowerCase():ae};return D.replace(y,function(de,Se){return Se||function(se){switch(se){case"YY":return String(U.$y).slice(-2);case"YYYY":return T.s(U.$y,4,"0");case"M":return M+1;case"MM":return T.s(M+1,2,"0");case"MMM":return te(L.monthsShort,M,X,3);case"MMMM":return te(X,M);case"D":return U.$D;case"DD":return T.s(U.$D,2,"0");case"d":return String(U.$W);case"dd":return te(L.weekdaysMin,U.$W,G,2);case"ddd":return te(L.weekdaysShort,U.$W,G,3);case"dddd":return G[U.$W];case"H":return String(V);case"HH":return T.s(V,2,"0");case"h":return ce(1);case"hh":return ce(2);case"a":return J(V,H,!0);case"A":return J(V,H,!1);case"m":return String(H);case"mm":return T.s(H,2,"0");case"s":return String(U.$s);case"ss":return T.s(U.$s,2,"0");case"SSS":return T.s(U.$ms,3,"0");case"Z":return I}return null}(de)||I.replace(":","")})},F.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},F.diff=function(B,U,L){var D,I=this,V=T.p(U),H=E(B),M=(H.utcOffset()-this.utcOffset())*r,G=this-H,X=function(){return T.m(I,H)};switch(V){case m:D=X()/12;break;case h:D=X();break;case f:D=X()/3;break;case d:D=(G-M)/6048e5;break;case u:D=(G-M)/864e5;break;case c:D=G/s;break;case l:D=G/r;break;case o:D=G/n;break;default:D=G}return L?D:T.a(D)},F.daysInMonth=function(){return this.endOf(h).$D},F.$locale=function(){return k[this.$L]},F.locale=function(B,U){if(!B)return this.$L;var L=this.clone(),D=R(B,U,!0);return D&&(L.$L=D),L},F.clone=function(){return T.w(this.$d,this)},F.toDate=function(){return new Date(this.valueOf())},F.toJSON=function(){return this.isValid()?this.toISOString():null},F.toISOString=function(){return this.$d.toISOString()},F.toString=function(){return this.$d.toUTCString()},A}(),O=P.prototype;return E.prototype=O,[["$ms",i],["$s",o],["$m",l],["$H",c],["$W",u],["$M",h],["$y",m],["$D",g]].forEach(function(A){O[A[1]]=function(F){return this.$g(F,A[0],A[1])}}),E.extend=function(A,F){return A.$i||(A(F,P,E),A.$i=!0),E},E.locale=R,E.isDayjs=j,E.unix=function(A){return E(1e3*A)},E.en=k[S],E.Ls=k,E.p={},E})})(p7);var xle=p7.exports;const WN=xn(xle);var m7={exports:{}};(function(e,t){(function(n,r){e.exports=r()})(Br,function(){return function(n,r,s){var i=r.prototype,o=function(h){return h&&(h.indexOf?h:h.s)},l=function(h,f,m,g,x){var b=h.name?h:h.$locale(),y=o(b[f]),v=o(b[m]),w=y||v.map(function(S){return S.slice(0,g)});if(!x)return w;var _=b.weekStart;return w.map(function(S,k){return w[(k+(_||0))%7]})},c=function(){return s.Ls[s.locale()]},u=function(h,f){return h.formats[f]||function(m){return m.replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,function(g,x,b){return x||b.slice(1)})}(h.formats[f.toUpperCase()])},d=function(){var h=this;return{months:function(f){return f?f.format("MMMM"):l(h,"months")},monthsShort:function(f){return f?f.format("MMM"):l(h,"monthsShort","months",3)},firstDayOfWeek:function(){return h.$locale().weekStart||0},weekdays:function(f){return f?f.format("dddd"):l(h,"weekdays")},weekdaysMin:function(f){return f?f.format("dd"):l(h,"weekdaysMin","weekdays",2)},weekdaysShort:function(f){return f?f.format("ddd"):l(h,"weekdaysShort","weekdays",3)},longDateFormat:function(f){return u(h.$locale(),f)},meridiem:this.$locale().meridiem,ordinal:this.$locale().ordinal}};i.localeData=function(){return d.bind(this)()},s.localeData=function(){var h=c();return{firstDayOfWeek:function(){return h.weekStart||0},weekdays:function(){return s.weekdays()},weekdaysShort:function(){return s.weekdaysShort()},weekdaysMin:function(){return s.weekdaysMin()},months:function(){return s.months()},monthsShort:function(){return s.monthsShort()},longDateFormat:function(f){return u(h,f)},meridiem:h.meridiem,ordinal:h.ordinal}},s.months=function(){return l(c(),"months")},s.monthsShort=function(){return l(c(),"monthsShort","months",3)},s.weekdays=function(h){return l(c(),"weekdays",null,null,h)},s.weekdaysShort=function(h){return l(c(),"weekdaysShort","weekdays",3,h)},s.weekdaysMin=function(h){return l(c(),"weekdaysMin","weekdays",2,h)}}})})(m7);var vle=m7.exports;const yle=xn(vle),Ni=(e,t)=>new Un(e).setA(t).toRgbString(),jd=(e,t)=>new Un(e).lighten(t).toHexString(),ble=e=>{const t=Fh(e,{theme:"dark"});return{1:t[0],2:t[1],3:t[2],4:t[3],5:t[6],6:t[5],7:t[4],8:t[6],9:t[5],10:t[4]}},wle=(e,t)=>{const n=e||"#000",r=t||"#fff";return{colorBgBase:n,colorTextBase:r,colorText:Ni(r,.85),colorTextSecondary:Ni(r,.65),colorTextTertiary:Ni(r,.45),colorTextQuaternary:Ni(r,.25),colorFill:Ni(r,.18),colorFillSecondary:Ni(r,.12),colorFillTertiary:Ni(r,.08),colorFillQuaternary:Ni(r,.04),colorBgSolid:Ni(r,.95),colorBgSolidHover:Ni(r,1),colorBgSolidActive:Ni(r,.9),colorBgElevated:jd(n,12),colorBgContainer:jd(n,8),colorBgLayout:jd(n,0),colorBgSpotlight:jd(n,26),colorBgBlur:Ni(r,.04),colorBorder:jd(n,26),colorBorderSecondary:jd(n,19)}},_le=(e,t)=>{const n=Object.keys(b5).map(i=>{const o=Fh(e[i],{theme:"dark"});return Array.from({length:10},()=>1).reduce((l,c,u)=>(l[`${i}-${u+1}`]=o[u],l[`${i}${u+1}`]=o[u],l),{})}).reduce((i,o)=>(i=Object.assign(Object.assign({},i),o),i),{}),r=t??w5(e),s=X9(e,{generateColorPalettes:ble,generateNeutralColorPalettes:wle});return Object.assign(Object.assign(Object.assign(Object.assign({},r),n),s),{colorPrimaryBg:s.colorPrimaryBorder,colorPrimaryBgHover:s.colorPrimaryBorderHover})},tO={defaultSeed:kb.token,defaultAlgorithm:w5,darkAlgorithm:_le};function Sle({children:e}){const t=cl(),[n,r]=p.useState(t.theme);return p.useEffect(()=>t.onThemeChange(r),[t]),a.jsx(kf,{theme:{algorithm:n.mode==="dark"?tO.darkAlgorithm:tO.defaultAlgorithm,token:{colorPrimary:n.colorPrimary,colorBgContainer:n.colorBgContainer,colorText:n.colorText,colorBorder:n.colorBorder}},children:e})}var Gt;(function(e){e.assertEqual=s=>{};function t(s){}e.assertIs=t;function n(s){throw new Error}e.assertNever=n,e.arrayToEnum=s=>{const i={};for(const o of s)i[o]=o;return i},e.getValidEnumValues=s=>{const i=e.objectKeys(s).filter(l=>typeof s[s[l]]!="number"),o={};for(const l of i)o[l]=s[l];return e.objectValues(o)},e.objectValues=s=>e.objectKeys(s).map(function(i){return s[i]}),e.objectKeys=typeof Object.keys=="function"?s=>Object.keys(s):s=>{const i=[];for(const o in s)Object.prototype.hasOwnProperty.call(s,o)&&i.push(o);return i},e.find=(s,i)=>{for(const o of s)if(i(o))return o},e.isInteger=typeof Number.isInteger=="function"?s=>Number.isInteger(s):s=>typeof s=="number"&&Number.isFinite(s)&&Math.floor(s)===s;function r(s,i=" | "){return s.map(o=>typeof o=="string"?`'${o}'`:o).join(i)}e.joinValues=r,e.jsonStringifyReplacer=(s,i)=>typeof i=="bigint"?i.toString():i})(Gt||(Gt={}));var nO;(function(e){e.mergeShapes=(t,n)=>({...t,...n})})(nO||(nO={}));const Xe=Gt.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Bl=e=>{switch(typeof e){case"undefined":return Xe.undefined;case"string":return Xe.string;case"number":return Number.isNaN(e)?Xe.nan:Xe.number;case"boolean":return Xe.boolean;case"function":return Xe.function;case"bigint":return Xe.bigint;case"symbol":return Xe.symbol;case"object":return Array.isArray(e)?Xe.array:e===null?Xe.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?Xe.promise:typeof Map<"u"&&e instanceof Map?Xe.map:typeof Set<"u"&&e instanceof Set?Xe.set:typeof Date<"u"&&e instanceof Date?Xe.date:Xe.object;default:return Xe.unknown}},ke=Gt.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class tl extends Error{get errors(){return this.issues}constructor(t){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};const n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=t}format(t){const n=t||function(i){return i.message},r={_errors:[]},s=i=>{for(const o of i.issues)if(o.code==="invalid_union")o.unionErrors.map(s);else if(o.code==="invalid_return_type")s(o.returnTypeError);else if(o.code==="invalid_arguments")s(o.argumentsError);else if(o.path.length===0)r._errors.push(n(o));else{let l=r,c=0;for(;c<o.path.length;){const u=o.path[c];c===o.path.length-1?(l[u]=l[u]||{_errors:[]},l[u]._errors.push(n(o))):l[u]=l[u]||{_errors:[]},l=l[u],c++}}};return s(this),r}static assert(t){if(!(t instanceof tl))throw new Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,Gt.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=n=>n.message){const n={},r=[];for(const s of this.issues)if(s.path.length>0){const i=s.path[0];n[i]=n[i]||[],n[i].push(t(s))}else r.push(t(s));return{formErrors:r,fieldErrors:n}}get formErrors(){return this.flatten()}}tl.create=e=>new tl(e);const VN=(e,t)=>{let n;switch(e.code){case ke.invalid_type:e.received===Xe.undefined?n="Required":n=`Expected ${e.expected}, received ${e.received}`;break;case ke.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,Gt.jsonStringifyReplacer)}`;break;case ke.unrecognized_keys:n=`Unrecognized key(s) in object: ${Gt.joinValues(e.keys,", ")}`;break;case ke.invalid_union:n="Invalid input";break;case ke.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${Gt.joinValues(e.options)}`;break;case ke.invalid_enum_value:n=`Invalid enum value. Expected ${Gt.joinValues(e.options)}, received '${e.received}'`;break;case ke.invalid_arguments:n="Invalid function arguments";break;case ke.invalid_return_type:n="Invalid function return type";break;case ke.invalid_date:n="Invalid date";break;case ke.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(n=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?n=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?n=`Invalid input: must end with "${e.validation.endsWith}"`:Gt.assertNever(e.validation):e.validation!=="regex"?n=`Invalid ${e.validation}`:n="Invalid";break;case ke.too_small:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="bigint"?n=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:n="Invalid input";break;case ke.too_big:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?n=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:n="Invalid input";break;case ke.custom:n="Invalid input";break;case ke.invalid_intersection_types:n="Intersection results could not be merged";break;case ke.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case ke.not_finite:n="Number must be finite";break;default:n=t.defaultError,Gt.assertNever(e)}return{message:n}};let kle=VN;function Cle(){return kle}const Nle=e=>{const{data:t,path:n,errorMaps:r,issueData:s}=e,i=[...n,...s.path||[]],o={...s,path:i};if(s.message!==void 0)return{...s,path:i,message:s.message};let l="";const c=r.filter(u=>!!u).slice().reverse();for(const u of c)l=u(o,{data:t,defaultError:l}).message;return{...s,path:i,message:l}};function Be(e,t){const n=Cle(),r=Nle({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,n,n===VN?void 0:VN].filter(s=>!!s)});e.common.issues.push(r)}class ys{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,n){const r=[];for(const s of n){if(s.status==="aborted")return gt;s.status==="dirty"&&t.dirty(),r.push(s.value)}return{status:t.value,value:r}}static async mergeObjectAsync(t,n){const r=[];for(const s of n){const i=await s.key,o=await s.value;r.push({key:i,value:o})}return ys.mergeObjectSync(t,r)}static mergeObjectSync(t,n){const r={};for(const s of n){const{key:i,value:o}=s;if(i.status==="aborted"||o.status==="aborted")return gt;i.status==="dirty"&&t.dirty(),o.status==="dirty"&&t.dirty(),i.value!=="__proto__"&&(typeof o.value<"u"||s.alwaysSet)&&(r[i.value]=o.value)}return{status:t.value,value:r}}}const gt=Object.freeze({status:"aborted"}),em=e=>({status:"dirty",value:e}),Xi=e=>({status:"valid",value:e}),rO=e=>e.status==="aborted",sO=e=>e.status==="dirty",zh=e=>e.status==="valid",Cb=e=>typeof Promise<"u"&&e instanceof Promise;var st;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t==null?void 0:t.message})(st||(st={}));class la{constructor(t,n,r,s){this._cachedPath=[],this.parent=t,this.data=n,this._path=r,this._key=s}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const iO=(e,t)=>{if(zh(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const n=new tl(e.common.issues);return this._error=n,this._error}}};function Ct(e){if(!e)return{};const{errorMap:t,invalid_type_error:n,required_error:r,description:s}=e;if(t&&(n||r))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:s}:{errorMap:(o,l)=>{const{message:c}=e;return o.code==="invalid_enum_value"?{message:c??l.defaultError}:typeof l.data>"u"?{message:c??r??l.defaultError}:o.code!=="invalid_type"?{message:l.defaultError}:{message:c??n??l.defaultError}},description:s}}class zt{get description(){return this._def.description}_getType(t){return Bl(t.data)}_getOrReturnCtx(t,n){return n||{common:t.parent.common,data:t.data,parsedType:Bl(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new ys,ctx:{common:t.parent.common,data:t.data,parsedType:Bl(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){const n=this._parse(t);if(Cb(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(t){const n=this._parse(t);return Promise.resolve(n)}parse(t,n){const r=this.safeParse(t,n);if(r.success)return r.data;throw r.error}safeParse(t,n){const r={common:{issues:[],async:(n==null?void 0:n.async)??!1,contextualErrorMap:n==null?void 0:n.errorMap},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Bl(t)},s=this._parseSync({data:t,path:r.path,parent:r});return iO(r,s)}"~validate"(t){var r,s;const n={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Bl(t)};if(!this["~standard"].async)try{const i=this._parseSync({data:t,path:[],parent:n});return zh(i)?{value:i.value}:{issues:n.common.issues}}catch(i){(s=(r=i==null?void 0:i.message)==null?void 0:r.toLowerCase())!=null&&s.includes("encountered")&&(this["~standard"].async=!0),n.common={issues:[],async:!0}}return this._parseAsync({data:t,path:[],parent:n}).then(i=>zh(i)?{value:i.value}:{issues:n.common.issues})}async parseAsync(t,n){const r=await this.safeParseAsync(t,n);if(r.success)return r.data;throw r.error}async safeParseAsync(t,n){const r={common:{issues:[],contextualErrorMap:n==null?void 0:n.errorMap,async:!0},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Bl(t)},s=this._parse({data:t,path:r.path,parent:r}),i=await(Cb(s)?s:Promise.resolve(s));return iO(r,i)}refine(t,n){const r=s=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(s):n;return this._refinement((s,i)=>{const o=t(s),l=()=>i.addIssue({code:ke.custom,...r(s)});return typeof Promise<"u"&&o instanceof Promise?o.then(c=>c?!0:(l(),!1)):o?!0:(l(),!1)})}refinement(t,n){return this._refinement((r,s)=>t(r)?!0:(s.addIssue(typeof n=="function"?n(r,s):n),!1))}_refinement(t){return new gc({schema:this,typeName:xt.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}constructor(t){this.spa=this.safeParseAsync,this._def=t,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:n=>this["~validate"](n)}}optional(){return Ga.create(this,this._def)}nullable(){return Iu.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return na.create(this)}promise(){return Rb.create(this,this._def)}or(t){return jb.create([this,t],this._def)}and(t){return Eb.create(this,t,this._def)}transform(t){return new gc({...Ct(this._def),schema:this,typeName:xt.ZodEffects,effect:{type:"transform",transform:t}})}default(t){const n=typeof t=="function"?t:()=>t;return new Mb({...Ct(this._def),innerType:this,defaultValue:n,typeName:xt.ZodDefault})}brand(){return new y7({typeName:xt.ZodBranded,type:this,...Ct(this._def)})}catch(t){const n=typeof t=="function"?t:()=>t;return new Pb({...Ct(this._def),innerType:this,catchValue:n,typeName:xt.ZodCatch})}describe(t){const n=this.constructor;return new n({...this._def,description:t})}pipe(t){return k5.create(this,t)}readonly(){return Ob.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const jle=/^c[^\s-]{8,}$/i,Ele=/^[0-9a-z]+$/,Ile=/^[0-9A-HJKMNP-TV-Z]{26}$/i,Tle=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,Rle=/^[a-z0-9_-]{21}$/i,Mle=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,Ple=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,Ole=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Dle="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let bk;const Ale=/^(?:(?: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])$/,$le=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,Lle=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,Ble=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Fle=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,zle=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,g7="((\\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])))",Hle=new RegExp(`^${g7}$`);function x7(e){let t="[0-5]\\d";e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision==null&&(t=`${t}(\\.\\d+)?`);const n=e.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${t})${n}`}function Ule(e){return new RegExp(`^${x7(e)}$`)}function Wle(e){let t=`${g7}T${x7(e)}`;const n=[];return n.push(e.local?"Z?":"Z"),e.offset&&n.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${n.join("|")})`,new RegExp(`^${t}$`)}function Vle(e,t){return!!((t==="v4"||!t)&&Ale.test(e)||(t==="v6"||!t)&&Lle.test(e))}function qle(e,t){if(!Mle.test(e))return!1;try{const[n]=e.split(".");if(!n)return!1;const r=n.replace(/-/g,"+").replace(/_/g,"/").padEnd(n.length+(4-n.length%4)%4,"="),s=JSON.parse(atob(r));return!(typeof s!="object"||s===null||"typ"in s&&(s==null?void 0:s.typ)!=="JWT"||!s.alg||t&&s.alg!==t)}catch{return!1}}function Kle(e,t){return!!((t==="v4"||!t)&&$le.test(e)||(t==="v6"||!t)&&Ble.test(e))}class Ua extends zt{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==Xe.string){const i=this._getOrReturnCtx(t);return Be(i,{code:ke.invalid_type,expected:Xe.string,received:i.parsedType}),gt}const r=new ys;let s;for(const i of this._def.checks)if(i.kind==="min")t.data.length<i.value&&(s=this._getOrReturnCtx(t,s),Be(s,{code:ke.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),r.dirty());else if(i.kind==="max")t.data.length>i.value&&(s=this._getOrReturnCtx(t,s),Be(s,{code:ke.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),r.dirty());else if(i.kind==="length"){const o=t.data.length>i.value,l=t.data.length<i.value;(o||l)&&(s=this._getOrReturnCtx(t,s),o?Be(s,{code:ke.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}):l&&Be(s,{code:ke.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}),r.dirty())}else if(i.kind==="email")Ole.test(t.data)||(s=this._getOrReturnCtx(t,s),Be(s,{validation:"email",code:ke.invalid_string,message:i.message}),r.dirty());else if(i.kind==="emoji")bk||(bk=new RegExp(Dle,"u")),bk.test(t.data)||(s=this._getOrReturnCtx(t,s),Be(s,{validation:"emoji",code:ke.invalid_string,message:i.message}),r.dirty());else if(i.kind==="uuid")Tle.test(t.data)||(s=this._getOrReturnCtx(t,s),Be(s,{validation:"uuid",code:ke.invalid_string,message:i.message}),r.dirty());else if(i.kind==="nanoid")Rle.test(t.data)||(s=this._getOrReturnCtx(t,s),Be(s,{validation:"nanoid",code:ke.invalid_string,message:i.message}),r.dirty());else if(i.kind==="cuid")jle.test(t.data)||(s=this._getOrReturnCtx(t,s),Be(s,{validation:"cuid",code:ke.invalid_string,message:i.message}),r.dirty());else if(i.kind==="cuid2")Ele.test(t.data)||(s=this._getOrReturnCtx(t,s),Be(s,{validation:"cuid2",code:ke.invalid_string,message:i.message}),r.dirty());else if(i.kind==="ulid")Ile.test(t.data)||(s=this._getOrReturnCtx(t,s),Be(s,{validation:"ulid",code:ke.invalid_string,message:i.message}),r.dirty());else if(i.kind==="url")try{new URL(t.data)}catch{s=this._getOrReturnCtx(t,s),Be(s,{validation:"url",code:ke.invalid_string,message:i.message}),r.dirty()}else i.kind==="regex"?(i.regex.lastIndex=0,i.regex.test(t.data)||(s=this._getOrReturnCtx(t,s),Be(s,{validation:"regex",code:ke.invalid_string,message:i.message}),r.dirty())):i.kind==="trim"?t.data=t.data.trim():i.kind==="includes"?t.data.includes(i.value,i.position)||(s=this._getOrReturnCtx(t,s),Be(s,{code:ke.invalid_string,validation:{includes:i.value,position:i.position},message:i.message}),r.dirty()):i.kind==="toLowerCase"?t.data=t.data.toLowerCase():i.kind==="toUpperCase"?t.data=t.data.toUpperCase():i.kind==="startsWith"?t.data.startsWith(i.value)||(s=this._getOrReturnCtx(t,s),Be(s,{code:ke.invalid_string,validation:{startsWith:i.value},message:i.message}),r.dirty()):i.kind==="endsWith"?t.data.endsWith(i.value)||(s=this._getOrReturnCtx(t,s),Be(s,{code:ke.invalid_string,validation:{endsWith:i.value},message:i.message}),r.dirty()):i.kind==="datetime"?Wle(i).test(t.data)||(s=this._getOrReturnCtx(t,s),Be(s,{code:ke.invalid_string,validation:"datetime",message:i.message}),r.dirty()):i.kind==="date"?Hle.test(t.data)||(s=this._getOrReturnCtx(t,s),Be(s,{code:ke.invalid_string,validation:"date",message:i.message}),r.dirty()):i.kind==="time"?Ule(i).test(t.data)||(s=this._getOrReturnCtx(t,s),Be(s,{code:ke.invalid_string,validation:"time",message:i.message}),r.dirty()):i.kind==="duration"?Ple.test(t.data)||(s=this._getOrReturnCtx(t,s),Be(s,{validation:"duration",code:ke.invalid_string,message:i.message}),r.dirty()):i.kind==="ip"?Vle(t.data,i.version)||(s=this._getOrReturnCtx(t,s),Be(s,{validation:"ip",code:ke.invalid_string,message:i.message}),r.dirty()):i.kind==="jwt"?qle(t.data,i.alg)||(s=this._getOrReturnCtx(t,s),Be(s,{validation:"jwt",code:ke.invalid_string,message:i.message}),r.dirty()):i.kind==="cidr"?Kle(t.data,i.version)||(s=this._getOrReturnCtx(t,s),Be(s,{validation:"cidr",code:ke.invalid_string,message:i.message}),r.dirty()):i.kind==="base64"?Fle.test(t.data)||(s=this._getOrReturnCtx(t,s),Be(s,{validation:"base64",code:ke.invalid_string,message:i.message}),r.dirty()):i.kind==="base64url"?zle.test(t.data)||(s=this._getOrReturnCtx(t,s),Be(s,{validation:"base64url",code:ke.invalid_string,message:i.message}),r.dirty()):Gt.assertNever(i);return{status:r.value,value:t.data}}_regex(t,n,r){return this.refinement(s=>t.test(s),{validation:n,code:ke.invalid_string,...st.errToObj(r)})}_addCheck(t){return new Ua({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...st.errToObj(t)})}url(t){return this._addCheck({kind:"url",...st.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...st.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...st.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...st.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...st.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...st.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...st.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...st.errToObj(t)})}base64url(t){return this._addCheck({kind:"base64url",...st.errToObj(t)})}jwt(t){return this._addCheck({kind:"jwt",...st.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...st.errToObj(t)})}cidr(t){return this._addCheck({kind:"cidr",...st.errToObj(t)})}datetime(t){return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:t}):this._addCheck({kind:"datetime",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,offset:(t==null?void 0:t.offset)??!1,local:(t==null?void 0:t.local)??!1,...st.errToObj(t==null?void 0:t.message)})}date(t){return this._addCheck({kind:"date",message:t})}time(t){return typeof t=="string"?this._addCheck({kind:"time",precision:null,message:t}):this._addCheck({kind:"time",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,...st.errToObj(t==null?void 0:t.message)})}duration(t){return this._addCheck({kind:"duration",...st.errToObj(t)})}regex(t,n){return this._addCheck({kind:"regex",regex:t,...st.errToObj(n)})}includes(t,n){return this._addCheck({kind:"includes",value:t,position:n==null?void 0:n.position,...st.errToObj(n==null?void 0:n.message)})}startsWith(t,n){return this._addCheck({kind:"startsWith",value:t,...st.errToObj(n)})}endsWith(t,n){return this._addCheck({kind:"endsWith",value:t,...st.errToObj(n)})}min(t,n){return this._addCheck({kind:"min",value:t,...st.errToObj(n)})}max(t,n){return this._addCheck({kind:"max",value:t,...st.errToObj(n)})}length(t,n){return this._addCheck({kind:"length",value:t,...st.errToObj(n)})}nonempty(t){return this.min(1,st.errToObj(t))}trim(){return new Ua({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Ua({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Ua({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(t=>t.kind==="datetime")}get isDate(){return!!this._def.checks.find(t=>t.kind==="date")}get isTime(){return!!this._def.checks.find(t=>t.kind==="time")}get isDuration(){return!!this._def.checks.find(t=>t.kind==="duration")}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find(t=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(t=>t.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(t=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find(t=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find(t=>t.kind==="ip")}get isCIDR(){return!!this._def.checks.find(t=>t.kind==="cidr")}get isBase64(){return!!this._def.checks.find(t=>t.kind==="base64")}get isBase64url(){return!!this._def.checks.find(t=>t.kind==="base64url")}get minLength(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxLength(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}}Ua.create=e=>new Ua({checks:[],typeName:xt.ZodString,coerce:(e==null?void 0:e.coerce)??!1,...Ct(e)});function Gle(e,t){const n=(e.toString().split(".")[1]||"").length,r=(t.toString().split(".")[1]||"").length,s=n>r?n:r,i=Number.parseInt(e.toFixed(s).replace(".","")),o=Number.parseInt(t.toFixed(s).replace(".",""));return i%o/10**s}class Hh extends zt{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==Xe.number){const i=this._getOrReturnCtx(t);return Be(i,{code:ke.invalid_type,expected:Xe.number,received:i.parsedType}),gt}let r;const s=new ys;for(const i of this._def.checks)i.kind==="int"?Gt.isInteger(t.data)||(r=this._getOrReturnCtx(t,r),Be(r,{code:ke.invalid_type,expected:"integer",received:"float",message:i.message}),s.dirty()):i.kind==="min"?(i.inclusive?t.data<i.value:t.data<=i.value)&&(r=this._getOrReturnCtx(t,r),Be(r,{code:ke.too_small,minimum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),s.dirty()):i.kind==="max"?(i.inclusive?t.data>i.value:t.data>=i.value)&&(r=this._getOrReturnCtx(t,r),Be(r,{code:ke.too_big,maximum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),s.dirty()):i.kind==="multipleOf"?Gle(t.data,i.value)!==0&&(r=this._getOrReturnCtx(t,r),Be(r,{code:ke.not_multiple_of,multipleOf:i.value,message:i.message}),s.dirty()):i.kind==="finite"?Number.isFinite(t.data)||(r=this._getOrReturnCtx(t,r),Be(r,{code:ke.not_finite,message:i.message}),s.dirty()):Gt.assertNever(i);return{status:s.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,st.toString(n))}gt(t,n){return this.setLimit("min",t,!1,st.toString(n))}lte(t,n){return this.setLimit("max",t,!0,st.toString(n))}lt(t,n){return this.setLimit("max",t,!1,st.toString(n))}setLimit(t,n,r,s){return new Hh({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:st.toString(s)}]})}_addCheck(t){return new Hh({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:st.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:st.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:st.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:st.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:st.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:st.toString(n)})}finite(t){return this._addCheck({kind:"finite",message:st.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:st.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:st.toString(t)})}get minValue(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}get isInt(){return!!this._def.checks.find(t=>t.kind==="int"||t.kind==="multipleOf"&&Gt.isInteger(t.value))}get isFinite(){let t=null,n=null;for(const r of this._def.checks){if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;r.kind==="min"?(n===null||r.value>n)&&(n=r.value):r.kind==="max"&&(t===null||r.value<t)&&(t=r.value)}return Number.isFinite(n)&&Number.isFinite(t)}}Hh.create=e=>new Hh({checks:[],typeName:xt.ZodNumber,coerce:(e==null?void 0:e.coerce)||!1,...Ct(e)});class vg extends zt{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce)try{t.data=BigInt(t.data)}catch{return this._getInvalidInput(t)}if(this._getType(t)!==Xe.bigint)return this._getInvalidInput(t);let r;const s=new ys;for(const i of this._def.checks)i.kind==="min"?(i.inclusive?t.data<i.value:t.data<=i.value)&&(r=this._getOrReturnCtx(t,r),Be(r,{code:ke.too_small,type:"bigint",minimum:i.value,inclusive:i.inclusive,message:i.message}),s.dirty()):i.kind==="max"?(i.inclusive?t.data>i.value:t.data>=i.value)&&(r=this._getOrReturnCtx(t,r),Be(r,{code:ke.too_big,type:"bigint",maximum:i.value,inclusive:i.inclusive,message:i.message}),s.dirty()):i.kind==="multipleOf"?t.data%i.value!==BigInt(0)&&(r=this._getOrReturnCtx(t,r),Be(r,{code:ke.not_multiple_of,multipleOf:i.value,message:i.message}),s.dirty()):Gt.assertNever(i);return{status:s.value,value:t.data}}_getInvalidInput(t){const n=this._getOrReturnCtx(t);return Be(n,{code:ke.invalid_type,expected:Xe.bigint,received:n.parsedType}),gt}gte(t,n){return this.setLimit("min",t,!0,st.toString(n))}gt(t,n){return this.setLimit("min",t,!1,st.toString(n))}lte(t,n){return this.setLimit("max",t,!0,st.toString(n))}lt(t,n){return this.setLimit("max",t,!1,st.toString(n))}setLimit(t,n,r,s){return new vg({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:st.toString(s)}]})}_addCheck(t){return new vg({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:st.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:st.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:st.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:st.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:st.toString(n)})}get minValue(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}}vg.create=e=>new vg({checks:[],typeName:xt.ZodBigInt,coerce:(e==null?void 0:e.coerce)??!1,...Ct(e)});class qN extends zt{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==Xe.boolean){const r=this._getOrReturnCtx(t);return Be(r,{code:ke.invalid_type,expected:Xe.boolean,received:r.parsedType}),gt}return Xi(t.data)}}qN.create=e=>new qN({typeName:xt.ZodBoolean,coerce:(e==null?void 0:e.coerce)||!1,...Ct(e)});class Nb extends zt{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==Xe.date){const i=this._getOrReturnCtx(t);return Be(i,{code:ke.invalid_type,expected:Xe.date,received:i.parsedType}),gt}if(Number.isNaN(t.data.getTime())){const i=this._getOrReturnCtx(t);return Be(i,{code:ke.invalid_date}),gt}const r=new ys;let s;for(const i of this._def.checks)i.kind==="min"?t.data.getTime()<i.value&&(s=this._getOrReturnCtx(t,s),Be(s,{code:ke.too_small,message:i.message,inclusive:!0,exact:!1,minimum:i.value,type:"date"}),r.dirty()):i.kind==="max"?t.data.getTime()>i.value&&(s=this._getOrReturnCtx(t,s),Be(s,{code:ke.too_big,message:i.message,inclusive:!0,exact:!1,maximum:i.value,type:"date"}),r.dirty()):Gt.assertNever(i);return{status:r.value,value:new Date(t.data.getTime())}}_addCheck(t){return new Nb({...this._def,checks:[...this._def.checks,t]})}min(t,n){return this._addCheck({kind:"min",value:t.getTime(),message:st.toString(n)})}max(t,n){return this._addCheck({kind:"max",value:t.getTime(),message:st.toString(n)})}get minDate(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t!=null?new Date(t):null}}Nb.create=e=>new Nb({checks:[],coerce:(e==null?void 0:e.coerce)||!1,typeName:xt.ZodDate,...Ct(e)});class oO extends zt{_parse(t){if(this._getType(t)!==Xe.symbol){const r=this._getOrReturnCtx(t);return Be(r,{code:ke.invalid_type,expected:Xe.symbol,received:r.parsedType}),gt}return Xi(t.data)}}oO.create=e=>new oO({typeName:xt.ZodSymbol,...Ct(e)});class KN extends zt{_parse(t){if(this._getType(t)!==Xe.undefined){const r=this._getOrReturnCtx(t);return Be(r,{code:ke.invalid_type,expected:Xe.undefined,received:r.parsedType}),gt}return Xi(t.data)}}KN.create=e=>new KN({typeName:xt.ZodUndefined,...Ct(e)});class GN extends zt{_parse(t){if(this._getType(t)!==Xe.null){const r=this._getOrReturnCtx(t);return Be(r,{code:ke.invalid_type,expected:Xe.null,received:r.parsedType}),gt}return Xi(t.data)}}GN.create=e=>new GN({typeName:xt.ZodNull,...Ct(e)});class aO extends zt{constructor(){super(...arguments),this._any=!0}_parse(t){return Xi(t.data)}}aO.create=e=>new aO({typeName:xt.ZodAny,...Ct(e)});class YN extends zt{constructor(){super(...arguments),this._unknown=!0}_parse(t){return Xi(t.data)}}YN.create=e=>new YN({typeName:xt.ZodUnknown,...Ct(e)});class mc extends zt{_parse(t){const n=this._getOrReturnCtx(t);return Be(n,{code:ke.invalid_type,expected:Xe.never,received:n.parsedType}),gt}}mc.create=e=>new mc({typeName:xt.ZodNever,...Ct(e)});class lO extends zt{_parse(t){if(this._getType(t)!==Xe.undefined){const r=this._getOrReturnCtx(t);return Be(r,{code:ke.invalid_type,expected:Xe.void,received:r.parsedType}),gt}return Xi(t.data)}}lO.create=e=>new lO({typeName:xt.ZodVoid,...Ct(e)});class na extends zt{_parse(t){const{ctx:n,status:r}=this._processInputParams(t),s=this._def;if(n.parsedType!==Xe.array)return Be(n,{code:ke.invalid_type,expected:Xe.array,received:n.parsedType}),gt;if(s.exactLength!==null){const o=n.data.length>s.exactLength.value,l=n.data.length<s.exactLength.value;(o||l)&&(Be(n,{code:o?ke.too_big:ke.too_small,minimum:l?s.exactLength.value:void 0,maximum:o?s.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:s.exactLength.message}),r.dirty())}if(s.minLength!==null&&n.data.length<s.minLength.value&&(Be(n,{code:ke.too_small,minimum:s.minLength.value,type:"array",inclusive:!0,exact:!1,message:s.minLength.message}),r.dirty()),s.maxLength!==null&&n.data.length>s.maxLength.value&&(Be(n,{code:ke.too_big,maximum:s.maxLength.value,type:"array",inclusive:!0,exact:!1,message:s.maxLength.message}),r.dirty()),n.common.async)return Promise.all([...n.data].map((o,l)=>s.type._parseAsync(new la(n,o,n.path,l)))).then(o=>ys.mergeArray(r,o));const i=[...n.data].map((o,l)=>s.type._parseSync(new la(n,o,n.path,l)));return ys.mergeArray(r,i)}get element(){return this._def.type}min(t,n){return new na({...this._def,minLength:{value:t,message:st.toString(n)}})}max(t,n){return new na({...this._def,maxLength:{value:t,message:st.toString(n)}})}length(t,n){return new na({...this._def,exactLength:{value:t,message:st.toString(n)}})}nonempty(t){return this.min(1,t)}}na.create=(e,t)=>new na({type:e,minLength:null,maxLength:null,exactLength:null,typeName:xt.ZodArray,...Ct(t)});function Vd(e){if(e instanceof ir){const t={};for(const n in e.shape){const r=e.shape[n];t[n]=Ga.create(Vd(r))}return new ir({...e._def,shape:()=>t})}else return e instanceof na?new na({...e._def,type:Vd(e.element)}):e instanceof Ga?Ga.create(Vd(e.unwrap())):e instanceof Iu?Iu.create(Vd(e.unwrap())):e instanceof ju?ju.create(e.items.map(t=>Vd(t))):e}class ir extends zt{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const t=this._def.shape(),n=Gt.objectKeys(t);return this._cached={shape:t,keys:n},this._cached}_parse(t){if(this._getType(t)!==Xe.object){const u=this._getOrReturnCtx(t);return Be(u,{code:ke.invalid_type,expected:Xe.object,received:u.parsedType}),gt}const{status:r,ctx:s}=this._processInputParams(t),{shape:i,keys:o}=this._getCached(),l=[];if(!(this._def.catchall instanceof mc&&this._def.unknownKeys==="strip"))for(const u in s.data)o.includes(u)||l.push(u);const c=[];for(const u of o){const d=i[u],h=s.data[u];c.push({key:{status:"valid",value:u},value:d._parse(new la(s,h,s.path,u)),alwaysSet:u in s.data})}if(this._def.catchall instanceof mc){const u=this._def.unknownKeys;if(u==="passthrough")for(const d of l)c.push({key:{status:"valid",value:d},value:{status:"valid",value:s.data[d]}});else if(u==="strict")l.length>0&&(Be(s,{code:ke.unrecognized_keys,keys:l}),r.dirty());else if(u!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const u=this._def.catchall;for(const d of l){const h=s.data[d];c.push({key:{status:"valid",value:d},value:u._parse(new la(s,h,s.path,d)),alwaysSet:d in s.data})}}return s.common.async?Promise.resolve().then(async()=>{const u=[];for(const d of c){const h=await d.key,f=await d.value;u.push({key:h,value:f,alwaysSet:d.alwaysSet})}return u}).then(u=>ys.mergeObjectSync(r,u)):ys.mergeObjectSync(r,c)}get shape(){return this._def.shape()}strict(t){return st.errToObj,new ir({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(n,r)=>{var i,o;const s=((o=(i=this._def).errorMap)==null?void 0:o.call(i,n,r).message)??r.defaultError;return n.code==="unrecognized_keys"?{message:st.errToObj(t).message??s}:{message:s}}}:{}})}strip(){return new ir({...this._def,unknownKeys:"strip"})}passthrough(){return new ir({...this._def,unknownKeys:"passthrough"})}extend(t){return new ir({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new ir({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:xt.ZodObject})}setKey(t,n){return this.augment({[t]:n})}catchall(t){return new ir({...this._def,catchall:t})}pick(t){const n={};for(const r of Gt.objectKeys(t))t[r]&&this.shape[r]&&(n[r]=this.shape[r]);return new ir({...this._def,shape:()=>n})}omit(t){const n={};for(const r of Gt.objectKeys(this.shape))t[r]||(n[r]=this.shape[r]);return new ir({...this._def,shape:()=>n})}deepPartial(){return Vd(this)}partial(t){const n={};for(const r of Gt.objectKeys(this.shape)){const s=this.shape[r];t&&!t[r]?n[r]=s:n[r]=s.optional()}return new ir({...this._def,shape:()=>n})}required(t){const n={};for(const r of Gt.objectKeys(this.shape))if(t&&!t[r])n[r]=this.shape[r];else{let i=this.shape[r];for(;i instanceof Ga;)i=i._def.innerType;n[r]=i}return new ir({...this._def,shape:()=>n})}keyof(){return v7(Gt.objectKeys(this.shape))}}ir.create=(e,t)=>new ir({shape:()=>e,unknownKeys:"strip",catchall:mc.create(),typeName:xt.ZodObject,...Ct(t)});ir.strictCreate=(e,t)=>new ir({shape:()=>e,unknownKeys:"strict",catchall:mc.create(),typeName:xt.ZodObject,...Ct(t)});ir.lazycreate=(e,t)=>new ir({shape:e,unknownKeys:"strip",catchall:mc.create(),typeName:xt.ZodObject,...Ct(t)});class jb extends zt{_parse(t){const{ctx:n}=this._processInputParams(t),r=this._def.options;function s(i){for(const l of i)if(l.result.status==="valid")return l.result;for(const l of i)if(l.result.status==="dirty")return n.common.issues.push(...l.ctx.common.issues),l.result;const o=i.map(l=>new tl(l.ctx.common.issues));return Be(n,{code:ke.invalid_union,unionErrors:o}),gt}if(n.common.async)return Promise.all(r.map(async i=>{const o={...n,common:{...n.common,issues:[]},parent:null};return{result:await i._parseAsync({data:n.data,path:n.path,parent:o}),ctx:o}})).then(s);{let i;const o=[];for(const c of r){const u={...n,common:{...n.common,issues:[]},parent:null},d=c._parseSync({data:n.data,path:n.path,parent:u});if(d.status==="valid")return d;d.status==="dirty"&&!i&&(i={result:d,ctx:u}),u.common.issues.length&&o.push(u.common.issues)}if(i)return n.common.issues.push(...i.ctx.common.issues),i.result;const l=o.map(c=>new tl(c));return Be(n,{code:ke.invalid_union,unionErrors:l}),gt}}get options(){return this._def.options}}jb.create=(e,t)=>new jb({options:e,typeName:xt.ZodUnion,...Ct(t)});const La=e=>e instanceof ZN?La(e.schema):e instanceof gc?La(e.innerType()):e instanceof Tb?[e.value]:e instanceof Eu?e.options:e instanceof QN?Gt.objectValues(e.enum):e instanceof Mb?La(e._def.innerType):e instanceof KN?[void 0]:e instanceof GN?[null]:e instanceof Ga?[void 0,...La(e.unwrap())]:e instanceof Iu?[null,...La(e.unwrap())]:e instanceof y7||e instanceof Ob?La(e.unwrap()):e instanceof Pb?La(e._def.innerType):[];class S5 extends zt{_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==Xe.object)return Be(n,{code:ke.invalid_type,expected:Xe.object,received:n.parsedType}),gt;const r=this.discriminator,s=n.data[r],i=this.optionsMap.get(s);return i?n.common.async?i._parseAsync({data:n.data,path:n.path,parent:n}):i._parseSync({data:n.data,path:n.path,parent:n}):(Be(n,{code:ke.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),gt)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,n,r){const s=new Map;for(const i of n){const o=La(i.shape[t]);if(!o.length)throw new Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(const l of o){if(s.has(l))throw new Error(`Discriminator property ${String(t)} has duplicate value ${String(l)}`);s.set(l,i)}}return new S5({typeName:xt.ZodDiscriminatedUnion,discriminator:t,options:n,optionsMap:s,...Ct(r)})}}function XN(e,t){const n=Bl(e),r=Bl(t);if(e===t)return{valid:!0,data:e};if(n===Xe.object&&r===Xe.object){const s=Gt.objectKeys(t),i=Gt.objectKeys(e).filter(l=>s.indexOf(l)!==-1),o={...e,...t};for(const l of i){const c=XN(e[l],t[l]);if(!c.valid)return{valid:!1};o[l]=c.data}return{valid:!0,data:o}}else if(n===Xe.array&&r===Xe.array){if(e.length!==t.length)return{valid:!1};const s=[];for(let i=0;i<e.length;i++){const o=e[i],l=t[i],c=XN(o,l);if(!c.valid)return{valid:!1};s.push(c.data)}return{valid:!0,data:s}}else return n===Xe.date&&r===Xe.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}class Eb extends zt{_parse(t){const{status:n,ctx:r}=this._processInputParams(t),s=(i,o)=>{if(rO(i)||rO(o))return gt;const l=XN(i.value,o.value);return l.valid?((sO(i)||sO(o))&&n.dirty(),{status:n.value,value:l.data}):(Be(r,{code:ke.invalid_intersection_types}),gt)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([i,o])=>s(i,o)):s(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}}Eb.create=(e,t,n)=>new Eb({left:e,right:t,typeName:xt.ZodIntersection,...Ct(n)});class ju extends zt{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==Xe.array)return Be(r,{code:ke.invalid_type,expected:Xe.array,received:r.parsedType}),gt;if(r.data.length<this._def.items.length)return Be(r,{code:ke.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),gt;!this._def.rest&&r.data.length>this._def.items.length&&(Be(r,{code:ke.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());const i=[...r.data].map((o,l)=>{const c=this._def.items[l]||this._def.rest;return c?c._parse(new la(r,o,r.path,l)):null}).filter(o=>!!o);return r.common.async?Promise.all(i).then(o=>ys.mergeArray(n,o)):ys.mergeArray(n,i)}get items(){return this._def.items}rest(t){return new ju({...this._def,rest:t})}}ju.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new ju({items:e,typeName:xt.ZodTuple,rest:null,...Ct(t)})};class Ib extends zt{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==Xe.object)return Be(r,{code:ke.invalid_type,expected:Xe.object,received:r.parsedType}),gt;const s=[],i=this._def.keyType,o=this._def.valueType;for(const l in r.data)s.push({key:i._parse(new la(r,l,r.path,l)),value:o._parse(new la(r,r.data[l],r.path,l)),alwaysSet:l in r.data});return r.common.async?ys.mergeObjectAsync(n,s):ys.mergeObjectSync(n,s)}get element(){return this._def.valueType}static create(t,n,r){return n instanceof zt?new Ib({keyType:t,valueType:n,typeName:xt.ZodRecord,...Ct(r)}):new Ib({keyType:Ua.create(),valueType:t,typeName:xt.ZodRecord,...Ct(n)})}}class cO extends zt{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==Xe.map)return Be(r,{code:ke.invalid_type,expected:Xe.map,received:r.parsedType}),gt;const s=this._def.keyType,i=this._def.valueType,o=[...r.data.entries()].map(([l,c],u)=>({key:s._parse(new la(r,l,r.path,[u,"key"])),value:i._parse(new la(r,c,r.path,[u,"value"]))}));if(r.common.async){const l=new Map;return Promise.resolve().then(async()=>{for(const c of o){const u=await c.key,d=await c.value;if(u.status==="aborted"||d.status==="aborted")return gt;(u.status==="dirty"||d.status==="dirty")&&n.dirty(),l.set(u.value,d.value)}return{status:n.value,value:l}})}else{const l=new Map;for(const c of o){const u=c.key,d=c.value;if(u.status==="aborted"||d.status==="aborted")return gt;(u.status==="dirty"||d.status==="dirty")&&n.dirty(),l.set(u.value,d.value)}return{status:n.value,value:l}}}}cO.create=(e,t,n)=>new cO({valueType:t,keyType:e,typeName:xt.ZodMap,...Ct(n)});class yg extends zt{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==Xe.set)return Be(r,{code:ke.invalid_type,expected:Xe.set,received:r.parsedType}),gt;const s=this._def;s.minSize!==null&&r.data.size<s.minSize.value&&(Be(r,{code:ke.too_small,minimum:s.minSize.value,type:"set",inclusive:!0,exact:!1,message:s.minSize.message}),n.dirty()),s.maxSize!==null&&r.data.size>s.maxSize.value&&(Be(r,{code:ke.too_big,maximum:s.maxSize.value,type:"set",inclusive:!0,exact:!1,message:s.maxSize.message}),n.dirty());const i=this._def.valueType;function o(c){const u=new Set;for(const d of c){if(d.status==="aborted")return gt;d.status==="dirty"&&n.dirty(),u.add(d.value)}return{status:n.value,value:u}}const l=[...r.data.values()].map((c,u)=>i._parse(new la(r,c,r.path,u)));return r.common.async?Promise.all(l).then(c=>o(c)):o(l)}min(t,n){return new yg({...this._def,minSize:{value:t,message:st.toString(n)}})}max(t,n){return new yg({...this._def,maxSize:{value:t,message:st.toString(n)}})}size(t,n){return this.min(t,n).max(t,n)}nonempty(t){return this.min(1,t)}}yg.create=(e,t)=>new yg({valueType:e,minSize:null,maxSize:null,typeName:xt.ZodSet,...Ct(t)});class ZN extends zt{get schema(){return this._def.getter()}_parse(t){const{ctx:n}=this._processInputParams(t);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}}ZN.create=(e,t)=>new ZN({getter:e,typeName:xt.ZodLazy,...Ct(t)});class Tb extends zt{_parse(t){if(t.data!==this._def.value){const n=this._getOrReturnCtx(t);return Be(n,{received:n.data,code:ke.invalid_literal,expected:this._def.value}),gt}return{status:"valid",value:t.data}}get value(){return this._def.value}}Tb.create=(e,t)=>new Tb({value:e,typeName:xt.ZodLiteral,...Ct(t)});function v7(e,t){return new Eu({values:e,typeName:xt.ZodEnum,...Ct(t)})}class Eu extends zt{_parse(t){if(typeof t.data!="string"){const n=this._getOrReturnCtx(t),r=this._def.values;return Be(n,{expected:Gt.joinValues(r),received:n.parsedType,code:ke.invalid_type}),gt}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(t.data)){const n=this._getOrReturnCtx(t),r=this._def.values;return Be(n,{received:n.data,code:ke.invalid_enum_value,options:r}),gt}return Xi(t.data)}get options(){return this._def.values}get enum(){const t={};for(const n of this._def.values)t[n]=n;return t}get Values(){const t={};for(const n of this._def.values)t[n]=n;return t}get Enum(){const t={};for(const n of this._def.values)t[n]=n;return t}extract(t,n=this._def){return Eu.create(t,{...this._def,...n})}exclude(t,n=this._def){return Eu.create(this.options.filter(r=>!t.includes(r)),{...this._def,...n})}}Eu.create=v7;class QN extends zt{_parse(t){const n=Gt.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(t);if(r.parsedType!==Xe.string&&r.parsedType!==Xe.number){const s=Gt.objectValues(n);return Be(r,{expected:Gt.joinValues(s),received:r.parsedType,code:ke.invalid_type}),gt}if(this._cache||(this._cache=new Set(Gt.getValidEnumValues(this._def.values))),!this._cache.has(t.data)){const s=Gt.objectValues(n);return Be(r,{received:r.data,code:ke.invalid_enum_value,options:s}),gt}return Xi(t.data)}get enum(){return this._def.values}}QN.create=(e,t)=>new QN({values:e,typeName:xt.ZodNativeEnum,...Ct(t)});class Rb extends zt{unwrap(){return this._def.type}_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==Xe.promise&&n.common.async===!1)return Be(n,{code:ke.invalid_type,expected:Xe.promise,received:n.parsedType}),gt;const r=n.parsedType===Xe.promise?n.data:Promise.resolve(n.data);return Xi(r.then(s=>this._def.type.parseAsync(s,{path:n.path,errorMap:n.common.contextualErrorMap})))}}Rb.create=(e,t)=>new Rb({type:e,typeName:xt.ZodPromise,...Ct(t)});class gc extends zt{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===xt.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){const{status:n,ctx:r}=this._processInputParams(t),s=this._def.effect||null,i={addIssue:o=>{Be(r,o),o.fatal?n.abort():n.dirty()},get path(){return r.path}};if(i.addIssue=i.addIssue.bind(i),s.type==="preprocess"){const o=s.transform(r.data,i);if(r.common.async)return Promise.resolve(o).then(async l=>{if(n.value==="aborted")return gt;const c=await this._def.schema._parseAsync({data:l,path:r.path,parent:r});return c.status==="aborted"?gt:c.status==="dirty"||n.value==="dirty"?em(c.value):c});{if(n.value==="aborted")return gt;const l=this._def.schema._parseSync({data:o,path:r.path,parent:r});return l.status==="aborted"?gt:l.status==="dirty"||n.value==="dirty"?em(l.value):l}}if(s.type==="refinement"){const o=l=>{const c=s.refinement(l,i);if(r.common.async)return Promise.resolve(c);if(c instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return l};if(r.common.async===!1){const l=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return l.status==="aborted"?gt:(l.status==="dirty"&&n.dirty(),o(l.value),{status:n.value,value:l.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(l=>l.status==="aborted"?gt:(l.status==="dirty"&&n.dirty(),o(l.value).then(()=>({status:n.value,value:l.value}))))}if(s.type==="transform")if(r.common.async===!1){const o=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!zh(o))return gt;const l=s.transform(o.value,i);if(l instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:l}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(o=>zh(o)?Promise.resolve(s.transform(o.value,i)).then(l=>({status:n.value,value:l})):gt);Gt.assertNever(s)}}gc.create=(e,t,n)=>new gc({schema:e,typeName:xt.ZodEffects,effect:t,...Ct(n)});gc.createWithPreprocess=(e,t,n)=>new gc({schema:t,effect:{type:"preprocess",transform:e},typeName:xt.ZodEffects,...Ct(n)});class Ga extends zt{_parse(t){return this._getType(t)===Xe.undefined?Xi(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}Ga.create=(e,t)=>new Ga({innerType:e,typeName:xt.ZodOptional,...Ct(t)});class Iu extends zt{_parse(t){return this._getType(t)===Xe.null?Xi(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}Iu.create=(e,t)=>new Iu({innerType:e,typeName:xt.ZodNullable,...Ct(t)});class Mb extends zt{_parse(t){const{ctx:n}=this._processInputParams(t);let r=n.data;return n.parsedType===Xe.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:n.path,parent:n})}removeDefault(){return this._def.innerType}}Mb.create=(e,t)=>new Mb({innerType:e,typeName:xt.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...Ct(t)});class Pb extends zt{_parse(t){const{ctx:n}=this._processInputParams(t),r={...n,common:{...n.common,issues:[]}},s=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return Cb(s)?s.then(i=>({status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new tl(r.common.issues)},input:r.data})})):{status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new tl(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}Pb.create=(e,t)=>new Pb({innerType:e,typeName:xt.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...Ct(t)});class uO extends zt{_parse(t){if(this._getType(t)!==Xe.nan){const r=this._getOrReturnCtx(t);return Be(r,{code:ke.invalid_type,expected:Xe.nan,received:r.parsedType}),gt}return{status:"valid",value:t.data}}}uO.create=e=>new uO({typeName:xt.ZodNaN,...Ct(e)});class y7 extends zt{_parse(t){const{ctx:n}=this._processInputParams(t),r=n.data;return this._def.type._parse({data:r,path:n.path,parent:n})}unwrap(){return this._def.type}}class k5 extends zt{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.common.async)return(async()=>{const i=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return i.status==="aborted"?gt:i.status==="dirty"?(n.dirty(),em(i.value)):this._def.out._parseAsync({data:i.value,path:r.path,parent:r})})();{const s=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return s.status==="aborted"?gt:s.status==="dirty"?(n.dirty(),{status:"dirty",value:s.value}):this._def.out._parseSync({data:s.value,path:r.path,parent:r})}}static create(t,n){return new k5({in:t,out:n,typeName:xt.ZodPipeline})}}class Ob extends zt{_parse(t){const n=this._def.innerType._parse(t),r=s=>(zh(s)&&(s.value=Object.freeze(s.value)),s);return Cb(n)?n.then(s=>r(s)):r(n)}unwrap(){return this._def.innerType}}Ob.create=(e,t)=>new Ob({innerType:e,typeName:xt.ZodReadonly,...Ct(t)});var xt;(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"})(xt||(xt={}));const N=Ua.create,Q=Hh.create,Re=qN.create,Ya=YN.create;mc.create;const ve=na.create,z=ir.create,Yle=jb.create,Fs=S5.create;Eb.create;ju.create;const Zi=Ib.create,he=Tb.create,et=Eu.create;Rb.create;Ga.create;Iu.create;const Xle=gc.createWithPreprocess,Zle=["head","index"],b7=N().regex(/^[A-Za-z0-9][A-Za-z0-9-]{0,127}$/),Db=N().regex(/^[1-9][0-9]*$/),Ab=N().regex(/^[A-Za-z0-9_.-]+$/),bg=N().min(1).max(255).refine(e=>!e.startsWith("-")&&e!=="HEAD"&&!e.startsWith("/")&&!e.endsWith("/")&&!e.endsWith(".")&&!/[\s~^:?*\[\\\x00-\x1f\x7f]/.test(e)&&!e.includes("..")&&!e.includes("@{")&&!e.includes("//")&&e.split("/").every(t=>!t.startsWith(".")&&!t.endsWith(".lock")),"Invalid Git branch"),C5=N().min(1).max(4096).refine(e=>!e.startsWith("/")&&!e.includes("\0")&&!e.split(/[\\/]/).includes("..")),Cw=z({workspaceId:b7,repoId:Db,owner:Ab,name:Ab,sourceBranch:bg,defaultBranch:bg}).strict(),Qle=z({repoId:Db,owner:Ab,name:Ab,defaultBranch:N(),private:Re(),description:N().nullable()}),Jle=Cw.extend({initialCommit:N(),head:N(),actualBranch:N().nullable(),branches:ve(N()).optional(),files:ve(z({path:C5,previousPath:N().optional(),comparison:et(Zle).optional(),status:N(),added:Q().nonnegative(),removed:Q().nonnegative(),binary:Re(),untracked:Re().optional()})),totalFiles:Q().int().nonnegative().optional(),filesTruncated:Re().optional(),added:Q().nonnegative(),removed:Q().nonnegative(),dirty:Re(),conflicted:Re(),version:N(),measuredAt:Q()}),Ed=z({sessionId:b7});Fs("action",[Ed.extend({action:he("repositories"),page:Q().int().min(1).max(1e3).optional(),search:N().max(100).optional()}).strict(),Ed.extend({action:he("branches"),repoId:Db,page:Q().int().min(1).max(1e3).optional(),search:N().max(100).optional(),cursor:N().min(1).max(1024).optional()}).strict(),Ed.extend({action:he("bind"),repoId:Db,branch:bg}).strict(),Ed.extend({action:he("status")}).strict(),Ed.extend({action:he("intend"),branch:bg.optional()}).strict(),Ed.extend({action:he("diff"),filePath:C5}).strict()]);z({binding:Cw.nullable().optional(),workspace:Jle.nullable().optional(),repositories:ve(Qle).optional(),branches:ve(N()).optional(),hasMore:Re().optional(),nextCursor:N().min(1).max(1024).optional(),diff:z({path:C5,patch:N(),binary:Re(),truncated:Re(),notStored:Re().optional()}).optional()});z({threadId:N().min(1),conversationId:N().min(1),workspace:Cw.optional()});new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");z({id:N().min(1),name:N().min(1),baseUrl:N().min(1),apiKey:N().min(1),remark:N().optional(),createdAt:Q(),updatedAt:Q()}).strict();const ece=z({id:N().min(1),name:N().min(1),baseUrl:N().min(1),remark:N().optional(),keyMasked:N(),hasKey:Re(),createdAt:Q(),updatedAt:Q()}).strict();z({activeChannelId:N().nullable(),channels:ve(ece)}).strict();z({}).strict();z({id:N().min(1).optional(),name:N().min(1),baseUrl:N().min(1),apiKey:N().optional(),remark:N().optional()}).strict();z({id:N().min(1)}).strict();z({id:N().min(1).nullable()}).strict();z({channelId:N().min(1).optional(),updatedAt:Q().optional()}).strict().refine(e=>e.updatedAt===void 0||e.channelId!==void 0,{message:"updatedAt requires channelId"});z({channelId:N().nullable(),models:ve(z({id:N().min(1),ownedBy:N().optional()}).strict())}).strict();const tce=["owner"],nce=["agent","owner","user-upload"],w7=z({id:N().min(1),relPath:N().min(1),from:et(nce),label:N().optional(),size:Q().int().nonnegative(),mime:N().min(1),addedAt:Q().int().nonnegative(),lastEditedAt:Q().int().nonnegative().optional(),stale:Re().optional()});z({sessionId:N().min(1),relPath:N().min(1),ttlSeconds:Q().int().positive().nullable().optional(),view:et(["raw","md-rendered"]).optional()});z({url:N().min(1),expiresAt:Q().int().nonnegative().nullable()});z({sessionId:N().min(1),relPath:N().min(1),label:N().optional(),origin:he("agent").optional()});z({entry:w7});z({sessionId:N().min(1),relPath:N().min(1)});z({removed:he(!0)});z({sessionId:N().min(1)});z({entries:ve(w7)});z({attachmentId:N().min(1),url:N().min(1),relPath:N().min(1),sizeBytes:Q().int().nonnegative(),mimeType:N().min(1)});const rce=Fs("type",[z({type:he("persona"),id:N().min(1)}).strict(),z({type:he("chat"),id:N().min(1)}).strict(),z({type:he("*")}).strict()]),sce=et(["read","send","admin"]),N5=z({resource:rce,actions:ve(sce).min(1)}).strict(),ice=z({id:N().min(1),secretHash:N().regex(/^[a-f0-9]{64}$/),displayName:N(),grants:ve(N5),issuedAt:Q().int().nonnegative(),expiresAt:Q().int().positive().optional(),maxUses:Q().int().positive().optional(),usedCount:Q().int().nonnegative(),peerOwnerId:N().min(1).optional(),firstUsedByPeerAt:Q().int().positive().optional(),peerDisplayName:N().optional()}).strict(),oce=ice.omit({secretHash:!0});z({type:he("whoami:ok"),owner:z({id:N(),kind:et(["owner","guest"]),displayName:N(),ownerId:N(),provider:N()}).strict(),capability:oce,grantedPersonas:ve(z({id:N().min(1),displayName:N()}).strict())}).strict();const ace="PEER_LOGIN_EXPIRED";z({selfUrl:N().min(1)});z({type:he("contact:handshake:ok"),owner:z({id:N(),ownerId:N(),provider:N(),displayName:N()}),grants:ve(N5)});const lce=Fs("status",[z({status:he("authorized"),login:N().min(1),source:et(["git","file"])}).strict(),z({status:he("missing")}).strict(),z({status:he("invalid"),message:N().min(1)}).strict(),z({status:he("pending"),authUrl:N().url()}).strict()]);z({token:N().min(1)}).strict();z({returnTo:N().url().optional()}).strict();const cce=z({url:N().url(),bin:N(),sha256:N().regex(/^[0-9a-f]{64}$/),size:Q().int().positive()}),uce={label:"Debian 13"},_7=["node","npm"],dce=["claude","codex","git","lark-cli","pi","pi-mcp-bridge","pi-cliproxyapi-provider","python3","jq","rsync","psql","go","chromium","fonts-wqy-microhei","openssh-server","pnpm","whiteboard-cli","s","supabase-mcp","mcp-server-kibana","aliyun"],hce=z({name:N().min(1),from:N().optional(),version:N().optional(),min:N().optional(),library:Re().optional(),localVersion:N().optional(),artifact:cce.optional(),aptMissing:he(!0).optional(),aptVersion:N().optional()}),fce=z({name:N().min(1),env:ve(N().min(1)).min(1)}),j5=N().regex(/^[a-z0-9-]+$/,"连接器名只能是小写字母、数字和短横线"),S7=["proxy","env"],k7=["mcp","cli"],pce=["bearer","lark-sidecar"],C7=["none","shared","personal"],E5=["oauth","fields"],I5=N().regex(/^[A-Z][A-Z0-9_]*$/,"要填的变量名只能是大写字母、数字和下划线,且以字母开头"),N7=z({name:j5,kind:et(S7),runner:et(k7),protocol:et(pce).optional(),id:N().min(1),credentialSource:et(C7).optional(),auth:et(E5).optional(),publisherUnionId:N().regex(/^on_[A-Za-z0-9_-]+$/).optional(),fields:ve(I5).default([]),http:z({url:N().min(1),headers:Zi(N(),N())}).optional()}),j7=["LARKSUITE_CLI_APP_ID","LARKSUITE_CLI_APP_SECRET"];function T5(e){return e.name==="feishu"&&e.runner==="cli"&&e.kind==="env"&&e.credentialSource==="shared"}function mce(e){return e.name==="feishu"&&e.id==="feishu"&&e.runner==="cli"&&e.kind==="proxy"&&e.protocol==="lark-sidecar"&&e.credentialSource==="shared"&&e.auth==="oauth"&&e.fields.length===0}function E7(e){if(!e.credentialSource)return[`连接器 ${e.name} 还没选用谁的账号`];const t=[];return mce(e)?t:e.protocol==="lark-sidecar"&&e.credentialSource==="shared"?["连接器 feishu 的发布者 OAuth 配置不完整,请重新选择账号身份"]:T5(e)?j7.filter(n=>!e.fields.includes(n)).map(n=>`连接器 feishu 的 Lark App Bot 缺少 ${n==="LARKSUITE_CLI_APP_ID"?"App ID":"App Secret"}`):(e.credentialSource==="personal"&&(e.auth?e.auth==="oauth"&&e.kind==="env"?t.push(`连接器 ${e.name} 是进程型(stdio MCP / CLI),只能粘贴 API key,走不了 OAuth`):e.auth==="fields"&&e.fields.length===0&&t.push(`连接器 ${e.name} 要填的变量还没列`):t.push(`连接器 ${e.name} 还没选用户怎么关联账号`)),e.credentialSource==="shared"&&e.fields.length===0&&t.push(`连接器 ${e.name} 选了发布者的账号,但要填的变量还没列`),t)}const gce=/^([A-Za-z0-9._/-]+)@([A-Za-z0-9._-]+)(?:\?tags=([A-Za-z0-9_,]+))?$/,xce=["main","master","HEAD","latest"];function vce(e){const t=gce.exec(e);return!!t&&!xce.includes(t[2])}function I7(e){var n,r;return _7.includes(e.name)||dce.includes(e.name)?[]:(n=e.from)!=null&&n.startsWith("github:")&&!e.artifact?[`${e.name} 还没钉下载资产(github: 要具体到哪个文件)——重新扫描`]:(r=e.from)!=null&&r.startsWith("go:")&&!vce(e.from.slice(3))?[`${e.name} 还没钉版本(go: 要写成 <module>@<tag>,不收 latest / main 这类移动引用)——重新扫描`]:[]}function Nw(e){return e.connectors.filter(t=>t.credentialSource==="shared"&&t.fields.length>0).map(t=>({name:t.name,env:[...t.fields]}))}function yce(e){return[...new Set([...e.secrets.flatMap(t=>t.env),...Nw(e).flatMap(t=>t.env)])]}const bce=e=>{if(!e||typeof e!="object")return e;let t=e;if("clis"in t&&Array.isArray(t.clis)){const{clis:n,...r}=t;t="packages"in r?r:{...r,packages:n}}if("assets"in t&&Array.isArray(t.assets)&&t.assets.length===0){const{assets:n,...r}=t;t=r}return t},wce="Publisher test: ",T7=z({version:he(1),entry:N().max(240).regex(/^[A-Za-z0-9_.-]+(?:\/[A-Za-z0-9_.-]+)*\.mjs$/).refine(e=>!e.split("/").some(t=>[".",".."].includes(t))),timeoutSeconds:Q().int().min(1).max(600),checks:ve(N().regex(/^[a-z0-9][a-z0-9-]{0,63}$/)).min(1).max(64).refine(e=>new Set(e).size===e.length)}).strict(),R7={test:T7.optional(),packages:ve(hce),secrets:ve(fce),connectors:ve(N7).default([])};z(R7);const R5=Xle(bce,z({version:he(1),...R7}).strict()),_ce=z({target:N().min(1),reason:N().min(1),file:N().min(1),quote:N().min(1)}),Sce=["integration","production"],Ws=et(Sce),xc=N().regex(/^[a-z0-9.-]+(?::[0-9]+)?\/[a-z0-9._/-]+@sha256:[a-f0-9]{64}$/),JN=N().regex(/^[a-f0-9]{40}$/),kce=N().refine(e=>{try{const t=new URL(e);return t.protocol==="https:"&&!t.username&&!t.password&&!t.search&&!t.hash&&t.pathname==="/"&&/(^|[.-])int([.-]|$)/.test(t.hostname)}catch{return!1}},"测试验证地址必须明确指向 int HTTPS 环境"),Cce=z({version:he(1),runId:N().regex(/^[A-Za-z0-9_-]{1,128}$/),status:he("passed"),exitCode:he(0),result:z({version:he(1),runId:N().regex(/^[A-Za-z0-9_-]{1,128}$/),checks:ve(z({name:N().regex(/^[a-z0-9][a-z0-9-]{0,63}$/),status:he("passed"),reason:N().max(1024).optional()}).strict()).min(1).max(64)}).strict(),execution:z({image:xc,imageID:N().min(1).max(512),engine:et(["codex","pi"]),podUid:N().min(1).max(512),jobUid:N().min(1).max(512)}).strict()}).strict(),M7=z({status:he("passed"),fingerprint:N().regex(/^[a-f0-9]{64}$/),checks:ve(N().regex(/^[a-z0-9-]+$/)),endpoint:kce,verifiedAt:N().refine(e=>Number.isFinite(Date.parse(e))),test:Cce.optional()}).strict(),P7=z({engine:N().min(1),model:N(),effort:N(),size:N().min(1),cpu:Q().positive(),taskConcurrency:Q().int().positive(),minPods:Q().int().nonnegative().safe().optional()}).strict(),O7=z({version:he(1),environment:he("integration"),component:he("persona"),image:xc,commit:JN,baseImage:xc,pipelineCommit:JN,repository:N().regex(/^[A-Za-z0-9_.-]+\/[A-Za-z0-9_.-]+$/),config:P7.optional(),verification:M7.refine(e=>e.checks.includes("persona-smoke")),test:T7.optional()}).strict().refine(e=>{if(!e.test)return e.verification.test===void 0;const t=e.verification.test;return["persona-dialogue","persona-task","persona-custom-test"].every(n=>e.verification.checks.includes(n))&&t!==void 0&&t.execution.image===e.image&&t.runId===t.result.runId&&t.result.checks.length===e.test.checks.length&&new Set(t.result.checks.map(n=>n.name)).size===e.test.checks.length&&t.result.checks.every(n=>e.test.checks.includes(n.name))},"Declared publisher acceptance requires complete candidate runtime evidence");z({version:he(1),environment:he("integration"),component:he("base"),image:xc,commit:JN,verification:M7.refine(e=>e.checks.includes("base-smoke"))}).strict();const wg="-cloud",M5=`codex${wg}`,_g={standard:"default",fast:"priority"},Nce=`claude${wg}`;function D7(e){return e==="codex"||e===M5}const A7="pi",jce=`${A7}${wg}`;function $7(e){return e===A7||e===jce}function gu(e){return typeof e=="string"&&e.length>wg.length&&e.endsWith(wg)}const L7=et([_g.standard,_g.fast]),P5=["tiny","small","medium","large","xlarge"],Ece=et(P5),$b="medium",Lb=[.5,1,2],Ice=Q().refine(e=>Lb.includes(e),"Unsupported CPU"),ej={tiny:.5,small:1,medium:2,large:2,xlarge:2},B7=z({model:N().optional(),effort:N().optional()}).strict(),Em=z({personaId:N(),label:N(),model:N().optional(),effort:N().optional(),serviceTier:L7.optional(),public:Re(),iconKey:N().optional(),tool:N().optional(),size:N().optional(),cpu:Q().finite().optional(),taskConcurrency:Q().int().positive().optional(),minPods:Q().int().nonnegative().safe().optional(),cloudEngine:B7.optional(),createdAt:Q(),updatedAt:Q(),cloud:z({gatewayUrl:N().min(1),personaId:N().min(1),publishedByMe:Re().optional(),environment:Ws.optional(),expectedImage:xc.optional(),testReleaseId:N().optional()}).strict().optional()}).strict(),Tce=z({name:N().min(1),description:N().optional()}),Rce=z({id:N().min(1)}),F7=z({writableRoots:ve(N()).optional(),denyRead:ve(N()).optional(),network:Re().optional()}).strict(),Mce=z({permissions:z({defaultMode:N().optional(),allow:ve(N()).optional(),deny:ve(N()).optional()}).optional(),sandbox:z({enabled:Re().optional(),autoAllowBashIfSandboxed:Re().optional(),allowUnsandboxedCommands:Re().optional(),excludedCommands:ve(N()).optional(),filesystem:z({denyRead:ve(N()).optional(),allowRead:ve(N()).optional(),denyWrite:ve(N()).optional(),allowWrite:ve(N()).optional()}).optional(),network:z({allowedDomains:ve(N()).optional(),allowLocalBinding:Re().optional()}).optional()}).optional()});Em.extend({personality:N().optional(),personalityLocal:N().optional(),personalityManaged:Re().optional(),skills:ve(Tce).optional(),plugins:ve(Rce).optional(),sandboxSettings:Mce.nullable().optional(),codexSandbox:F7.nullable().optional()});z({slug:N().regex(/^[a-z0-9]+(-[a-z0-9]+)*$/).max(32),label:N().min(1),personality:N(),model:N().optional(),effort:N().optional(),serviceTier:Em.shape.serviceTier,tool:N().optional(),public:Re().optional(),iconKey:N().optional()}).strict();z({personaId:N().min(1)});z({personaId:N().min(1),patch:z({label:N().min(1).optional(),model:N().optional(),effort:N().optional(),serviceTier:Em.shape.serviceTier,tool:N().optional(),size:Ece.optional(),cpu:Ice.optional(),taskConcurrency:Em.shape.taskConcurrency,minPods:Em.shape.minPods,cloudEngine:B7.optional(),personality:N().optional(),personalityLocal:N().optional(),public:Re().optional(),iconKey:N().nullable().optional(),codexSandbox:F7.optional()}).strict()}).strict();z({version:he(1),manifest:R5}).strict();const Pce=["hard","soft"],z7=et(Pce),Oce=et(["scanning","done","failed"]),H7=z({id:N().min(1),manifest:R5,scanSessionId:N().optional(),status:Oce,evidence:ve(_ce).default([]),notes:ve(N()).default([]),head:N().min(1).optional(),baseKind:z7.default("hard"),base:N().min(1).optional(),startedAt:Q(),finishedAt:Q().optional(),error:N().optional()}).strict(),O5=z({id:N().min(1).optional(),environment:Ws.optional(),legacy:Re().optional(),head:N().min(1),contentHead:N().min(1),scanId:N().min(1),at:Q(),pushed:Re().optional(),runId:Q().int().positive().optional(),runAttempt:Q().int().positive().optional(),artifactId:Q().int().positive().optional(),verified:O7.optional(),config:P7.optional(),reconfigOf:N().min(1).optional(),workflowVersion:Q().int().positive().optional(),confirmation:z({fingerprint:N().regex(/^[a-f0-9]{64}$/),runId:Q().int().positive(),runAttempt:Q().int().positive(),at:Q()}).strict().optional()}).strict(),Dce=["prepared","main-pushed","dispatching","dispatched","completed","failed"],D5=z({id:N().min(1),releaseId:N().min(1),at:Q(),verified:O7.optional(),phase:et(Dce),expectedMain:N().optional(),runId:Q().int().positive().optional(),runAttempt:Q().int().positive().optional(),error:N().optional()}).strict(),dO=z({channelId:N().min(1),updatedAt:Q()}).strict(),A5=z({integration:dO.nullable().optional(),production:dO.nullable().optional()}).strict();z({version:he(4),engineChannels:A5.optional(),scans:ve(H7),releases:ve(O5),promotions:ve(D5).default([])}).strict();const Ace=z({url:N().min(1),branch:N().min(1),head:N().min(1),dirty:Re(),ahead:Q()}).strict(),wy=z({env:N().min(1),setAt:Q().optional()}).strict(),hO={baseUrl:"CLAWD_ENGINE_BASE_URL",apiKey:"CLAWD_ENGINE_API_KEY"},$ce="模型订阅只写进去一半——重填或改回平台默认";function Bb(e){if(!e)return;const t=r=>e.some(s=>s.env===r&&s.setAt!==void 0),n=[hO.baseUrl,hO.apiKey].filter(t).length;return n===2?"own":n===0?"platform":"partial"}function Lce(e){const t=e.trim();let n;try{n=new URL(t)}catch{throw new Error("订阅地址要以 http:// 或 https:// 开头,形如 https://cpa.example.com")}if(n.protocol!=="http:"&&n.protocol!=="https:"||!n.hostname)throw new Error("订阅地址要以 http:// 或 https:// 开头,形如 https://cpa.example.com");const r=`${n.origin}${n.pathname}`.replace(/\/+$/,"");return r.endsWith("/v1")?r:`${r}/v1`}const Bce=["pending","running","done","failed","waiting","skipped"],Fce=et(Bce),go="verify",Im=["build","smoke","deploy",go],zce=et(Im),Hce=z({key:zce,status:Fce,url:N().optional(),jobId:Q().optional(),startedAt:Q().optional(),completedAt:Q().optional()}).strict(),_y=z({runId:Q(),headSha:N().min(1),status:et(["queued","running","completed"]),htmlUrl:N().min(1),jobs:ve(Hce),environment:Ws.optional(),branch:N().optional(),event:N().optional(),runAttempt:Q().int().positive().optional(),conclusion:et(["success","failure"]).optional(),promotionId:N().optional()}).strict();function U7(e,t){return t&&e.head===t.head?t.contentHead:e.head}function jw(e,t,n){return!e||!t||e.status!=="done"?!1:e.head===U7(t,n)&&!t.dirty}function $5(e,t,n){return!e||!t||e.status!=="done"||!e.head?!1:e.head!==U7(t,n)}function fO(e,t,n){return jw(e,t,n)||$5(e,t,n)}function Uce(e,t){return!t||!e.head?!1:t.contentHead===e.head||t.at>=e.startedAt}const W7=["codex","pi","claude"];function dl(e){return W7.includes(e||"claude")}const V7={codex:"0.163.0",pi:"1.3.0",claude:"0.3.304"},Wce="2.1.304";function Vce(e,t){if(!e||!dl(e)||!t)return null;const n=e==="claude"?Wce:V7[e];return n===t?null:{tool:e,cloud:n,local:t}}function q7(e){const t=e.tool||"claude",n=t==="claude"?e.cloudEngine??{}:e;return{tool:t,model:n.model??"",effort:n.effort??""}}const wk=z({runId:Q(),status:_y.shape.status,conclusion:et(["success","failure"]).optional(),htmlUrl:N().min(1)}).strict(),qce=z({desired:Q().int().nonnegative().safe(),ready:Q().int().nonnegative().safe(),bound:Q().int().nonnegative().safe(),starting:Q().int().nonnegative().safe(),retiring:Q().int().nonnegative().safe(),observedAt:Q(),error:N().nullable()}).strict(),pO=z({online:Re().optional(),image:xc.optional(),minPods:Q().int().nonnegative().safe().optional(),reservation:qce.nullable().optional(),reservationError:N().optional()}).strict(),K7=z({personaId:N().min(1),engineChannels:A5.optional(),github:lce.optional(),publisherFeishuAuth:z({integration:z({connected:Re(),authUrl:N().optional(),error:N().optional()}).strict(),production:z({connected:Re(),authUrl:N().optional(),error:N().optional()}).strict()}).strict().optional(),repo:Ace.optional(),scans:ve(H7).default([]),releases:ve(O5).default([]),promotions:ve(D5).optional(),targets:z({integration:pO.extend({run:_y.optional(),secrets:ve(wy).optional(),unpublish:wk.optional()}).optional(),production:pO.extend({run:_y.optional(),secrets:ve(wy).optional(),unpublish:wk.optional()}).optional()}).strict().optional(),secrets:ve(wy).optional(),run:_y.optional(),online:Re().optional(),unpublish:wk.optional(),historyError:N().optional()}).strict();z({before:Q().nullable()}).strict();K7.pick({personaId:!0,github:!0,repo:!0,scans:!0,releases:!0,promotions:!0,engineChannels:!0,historyError:!0});K7.pick({scans:!0});z({environment:Ws,secrets:ve(wy).optional(),engineChannels:A5.optional()}).strict();const Kce=e=>e.includes("minPods")?3:2,Gce=4,Yce=["engine","model","effort","size","cpu","taskConcurrency","minPods"];function Xce(e){const{tool:t,model:n,effort:r}=q7(e),s=(e.size??"").trim()||$b,i=e.cpu??ej[s]??ej[$b];return{engine:t,model:n.trim(),effort:r.trim(),size:s,cpu:i,taskConcurrency:e.taskConcurrency??Gce,minPods:e.minPods??0}}function G7(e,t){return!e||!t?null:Yce.filter(n=>n==="minPods"?(e.minPods??0)!==(t.minPods??0):e[n]!==t[n])}z({sha:N().min(1),actionsUrl:N().min(1),releaseId:N().optional()}).strict();const cx=z({personaId:N().min(1)}).strict();cx.extend({releaseHead:N().min(1).optional(),releaseId:N().min(1).optional(),environment:Ws.optional()}).strict();cx.extend({scanBase:z7.optional()}).strict();cx.extend({scanId:N().min(1)}).strict();cx.extend({releaseId:N().min(1)}).strict();cx.extend({environment:Ws.default("production")}).strict();z({confirmation:O5.shape.confirmation.unwrap()}).strict();z({promotion:D5}).strict();z({personaId:N().min(1),expectedImage:xc}).strict();z({personaId:N().min(1),scanId:N().min(1),patch:z({manifest:R5.optional(),connector:N7.optional()}).strict()}).strict();z({personaId:N().min(1),environment:Ws.default("production"),scanId:N().min(1),name:N().min(1),values:Zi(N(),N())}).strict();z({personaId:N().min(1),environment:Ws.default("production"),channelId:N().min(1).optional(),auth:z({baseUrl:N(),apiKey:N()}).strict().nullable().optional()}).strict().refine(e=>e.channelId!==void 0||e.auth!==void 0,{message:"Either channelId or auth must be provided"});z({personaId:N().min(1),environment:Ws.default("production"),releaseId:N().optional(),jobId:Q()}).strict();z({personaId:N().min(1),kind:et(["package","secret","connector"]),item:Zi(N(),Ya()),evidence:z({reason:N().min(1),file:N().min(1),quote:N().min(1)})}).strict();z({personaId:N().min(1),notes:ve(N()).default([])}).strict();const Y7="ottin4ttc";function Uh(e){return e.trim().replace(/^git@[^:]+:/,"").replace(/^https?:\/\/[^/]+\//,"").replace(/\.git$/,"")}z({environment:Ws.default("production")}).strict();const Zce="LOGIN_EXPIRED",Qce=z({deviceId:N().min(1),name:N().min(1),url:N().min(1)});z({type:he("device:list:ok"),devices:ve(Qce)});z({deviceId:N().min(1),url:N().min(1).optional(),name:N().optional()});z({type:he("device:connect:ok"),deviceId:N(),name:N(),url:N()});const X7=z({ownerId:N().min(1),provider:N().min(1),displayName:N().min(1),avatarUrl:N().optional(),unionId:N().optional()});z({type:he("auth:login:start:ok"),environment:Ws.optional(),authUrl:N().min(1),state:N().min(1)});z({type:he("auth:getIdentity:ok"),identity:X7.nullable(),deviceId:N().min(1)});z({type:he("auth:logout:ok")});const Z7=N().nullable();z({type:he("auth:apiKey:get:ok"),apiKey:N().nullable(),createdAt:N().nullable(),gatewayUrl:Z7});z({type:he("auth:apiKey:regenerate:ok"),apiKey:N().min(1),createdAt:N().min(1),gatewayUrl:Z7});z({type:he("auth:apiKey:revoke:ok"),revoked:Re()});z({type:he("auth:login:done"),environment:Ws.optional(),identity:X7});z({type:he("auth:login:failed"),environment:Ws.optional(),reason:N()});z({deviceId:N().min(1),remoteAccessAllowed:Re()}).strict();z({type:he("contact:setRemoteAccess:ok"),deviceId:N().min(1),remoteAccessAllowed:Re()}).strict();z({type:he("contact:remote-access-updated"),deviceId:N().min(1),remoteAccessAllowed:Re()}).strict();z({personaId:N().min(1)}).strict();const Jce=["connected","missing","reauth"],eue=["link","fill"],tue=z({name:j5,id:N().min(1),kind:et(S7),runner:et(k7),auth:et(E5),status:et(Jce),action:et(eue),authUrl:N().optional(),fields:ve(I5)}).strict();z({connectors:ve(tue)}).strict();z({personaId:N().min(1),name:j5,values:Zi(I5,N().min(1))}).strict();const nue=z({deviceId:N().min(1),ownerId:N().min(1),provider:N().min(1),displayName:N(),remoteUrl:N().min(1),connectToken:N(),grants:ve(N5),addedAt:Q().int().nonnegative(),pinnedAt:Q().int().nullable().default(null),remoteAccessAllowed:Re().default(!1),note:N().default("")}).strict(),Q7=nue;z({deviceId:N().min(1)}).strict();z({type:he("contact:remove:ok"),deviceId:N().min(1)}).strict();z({type:he("contact:list:ok"),contacts:ve(Q7)}).strict();z({type:he("contact:added"),contact:Q7}).strict();z({type:he("contact:removed"),deviceId:N().min(1)}).strict();z({deviceId:N().min(1),pinned:Re()}).strict();z({deviceId:N().min(1),note:N()}).strict();z({type:he("contact:setNote:ok"),deviceId:N().min(1),note:N()}).strict();z({type:he("contact:pin:ok"),deviceId:N().min(1),pinnedAt:Q().int().nullable()}).strict();z({type:he("contact:pinned"),deviceId:N().min(1),pinnedAt:Q().int().nullable()}).strict();const L5=Fs("kind",[z({kind:he("success"),text:N(),brief:N().optional(),filePaths:ve(N()).optional()}),z({kind:he("failure"),reason:N(),brief:N().optional()})]);z({targetPersona:N().min(1).optional(),dispatchId:N().min(1).optional(),prompt:N(),brief:N().optional(),targetDeviceId:N().min(1).optional(),model:N().min(1).optional(),tool:N().min(1).optional(),sessionLabel:N().min(1).max(60).optional(),meta:Zi(Ya()).optional()}).refine(e=>e.targetPersona!==void 0||e.dispatchId!==void 0,{message:"either targetPersona (new dispatch) or dispatchId (follow-up) is required"}).refine(e=>!(e.dispatchId!==void 0&&e.targetDeviceId!==void 0),{message:"cross-device dispatch cannot be continued (dispatchId + targetDeviceId are mutually exclusive)"}).refine(e=>!(e.tool!==void 0&&e.targetDeviceId!==void 0),{message:"engine override is not supported for cross-device dispatch (tool + targetDeviceId are mutually exclusive)"}).refine(e=>!(e.dispatchId!==void 0&&(e.tool!==void 0||e.model!==void 0)),{message:"a follow-up dispatch cannot change engine or model (dispatchId excludes tool / model); start a new dispatch instead"});z({dispatchId:N().min(1),outcome:L5});const rue=["running","completed","failed"],B5=et(rue),sue=z({dispatchId:N().min(1),sourceSessionId:N().min(1),sourcePersonaId:N().min(1).optional(),targetPersonaId:N().min(1),targetDeviceId:N().min(1).optional(),workerSessionId:N().min(1).optional(),taskText:N(),taskBrief:N().optional(),round:Q().int().positive().optional(),status:B5,outcome:L5.optional(),meta:Zi(Ya()).optional(),createdAt:N().min(1),completedAt:N().min(1).optional(),deliveredAt:N().min(1).optional()});z({sourceSessionId:N().min(1).optional(),relatedSessionId:N().min(1).optional()});z({records:ve(sue)});z({dispatchId:N().min(1)});z({type:he("personaDispatch:get:ok"),status:B5,outcome:L5.optional()});const iue=/^[a-z0-9][a-z0-9-]*$/;et(["stopped","starting","running","crashed","invalid"]);const oue=new Set(["localhost","127.0.0.1"]);function aue(e){let t;try{t=new URL(e)}catch{return!1}return!!(t.protocol==="https:"||t.protocol==="http:"&&oue.has(t.hostname))}const i0=z({id:N().regex(iue),name:N().min(1),version:N().min(1),apiVersion:he("1"),runtime:z({startCommand:N().min(1)}).passthrough().optional(),entry:z({url:N().url().refine(aue,{message:"INVALID_URL_SCHEME: only https or http://localhost is allowed"})}).strict().optional()}).passthrough().superRefine((e,t)=>{var s;const n=!!e.runtime,r=!!((s=e.entry)!=null&&s.url);n&&r&&t.addIssue({code:ke.custom,message:"INVALID_MANIFEST: entry.url and runtime cannot coexist"}),!n&&!r&&t.addIssue({code:ke.custom,message:"INVALID_MANIFEST: must have either entry.url or runtime"})}),lue=Fs("kind",[z({kind:he("local"),port:Q().int().min(1).max(65535)}),z({kind:he("hosted"),url:N().url()})]);Fs("state",[z({extId:N(),manifest:i0,state:he("stopped")}),z({extId:N(),manifest:i0,state:he("starting")}),z({extId:N(),manifest:i0,state:he("running"),target:lue}),z({extId:N(),manifest:i0,state:he("crashed")}),z({extId:N(),manifest:Ya().nullable(),state:he("invalid"),invalidReason:N().min(1)})]);z({snapshotHash:N().min(1),version:N().min(1),publishedAt:Q()});const cue=Fs("kind",[z({kind:he("p2p-tunnel"),ownerPrincipalId:N().min(1),extId:N().min(1)})]);Fs("kind",[z({kind:he("p2p-tunnel"),ownerPrincipalId:N().min(1),extId:N().min(1),snapshotHash:N().min(1)})]);z({extId:N().min(1),name:N().min(1),version:N().min(1),contentHash:N().min(1),publishedAt:Q()});const uue=Fs("kind",[z({kind:he("clean")}),z({kind:he("ready-new-version"),fromVersion:N().min(1),toVersion:N().min(1)}),z({kind:he("error-same-hash"),version:N().min(1)}),z({kind:he("error-version-not-bumped"),localVersion:N().min(1),publishedVersion:N().min(1)}),z({kind:he("error-version-regression"),localVersion:N().min(1),publishedVersion:N().min(1)})]);function due(e){let t=2166136261;for(let n=0;n<e.length;n++)t^=e.charCodeAt(n),t=Math.imul(t,16777619)>>>0;return(t>>>0).toString(16).padStart(8,"0")}function F5(e,t){return`${e}-${due(t)}`}function z5(e){if(typeof e!="string")return{ok:!1,reason:"version must be a string"};const t=e.split(".");if(t.length!==3)return{ok:!1,reason:`"${e}" — only MAJOR.MINOR.PATCH allowed`};for(const n of t)if(!/^\d+$/.test(n))return{ok:!1,reason:`"${e}" — only numeric segments allowed`};return{ok:!0}}function J7(e,t){const n=mO(e),r=mO(t);for(let s=0;s<3;s++){if(n[s]<r[s])return-1;if(n[s]>r[s])return 1}return 0}function mO(e){const t=z5(e);if(!t.ok)throw new Error(t.reason);const[n,r,s]=e.split(".").map(i=>parseInt(i,10));return[n,r,s]}z({localManifest:z({name:N().min(1),version:N().min(1),contentHash:N().min(1)}),publishState:Fs("kind",[z({kind:he("unpublished")}),z({kind:he("published"),version:N().min(1),contentHash:N().min(1),publishedAt:Q()})]),check:uue});z({extId:N().min(1),newVersion:N().min(1).nullish()});z({extId:N().min(1)});z({extId:N().min(1),snapshotHash:N().min(1)});z({channelRef:cue,snapshotHash:N().min(1),zipBase64:N().min(1)});z({id:N().min(1),peerDeviceId:N().min(1),senderDeviceId:N().min(1),text:N().min(1),createdAt:Q().int().nonnegative(),readBy:Zi(N().min(1),Q().int().positive()).default({}),origin:z({kind:he("persona"),personaId:N().min(1)}).optional()}).strict();z({peerDeviceId:N().min(1).optional(),id:N().min(1),text:N().min(1),createdAt:Q().int().nonnegative(),origin:z({kind:he("persona"),personaId:N().min(1)}).optional()}).strict();z({peerDeviceId:N().min(1),sinceCreatedAt:Q().int().nonnegative().optional()}).strict();z({peerDeviceId:N().min(1),upToCreatedAt:Q().int().nonnegative()}).strict();z({peerDeviceId:N().min(1).optional(),text:N().min(1)});z({peerDeviceId:N().min(1).optional(),command:N().min(1),timeoutMs:Q().int().positive().optional()}).strict();z({type:he("peerExec:run:ok"),stdout:N(),stderr:N(),exitCode:Q().int().nullable(),timedOut:Re(),stdoutTruncated:Re(),stderrTruncated:Re()}).strict();const eH=Fs("kind",[z({kind:he("at"),at:N().min(1)}),z({kind:he("every"),everyMs:Q().int().positive(),anchorMs:Q().int().nonnegative().optional()}),z({kind:he("cron"),expr:N().min(1),tz:N().min(1).optional()})]),ux=N().trim().min(1);z({personaId:ux,name:N().min(1),schedule:eH,prompt:N().min(1),targetPersona:N().min(1).optional(),timeoutMs:Q().int().positive().optional()});z({personaId:ux,onlyMine:Re().optional()});z({personaId:ux,shiftId:N().min(1)});const hue=z({name:N().min(1).optional(),schedule:eH.optional(),prompt:N().min(1).optional(),targetPersona:N().min(1).optional(),timeoutMs:Q().int().positive().optional(),enabled:Re().optional()});z({personaId:ux,shiftId:N().min(1),patch:hue});z({personaId:ux,shiftId:N().min(1),limit:Q().int().positive().optional()});const zi="persona-master",H5=z({personaId:N().min(1),deviceId:N().min(1).optional()}),tH=z({id:N().min(1),name:N().min(1),memberPersonas:ve(H5),memberContactDeviceIds:ve(N().min(1)),createdAt:N().min(1),updatedAt:N().min(1)}),nH=N().trim().min(1);z({name:nH,memberPersonas:ve(H5).default([]),memberContactDeviceIds:ve(N().min(1)).default([])});z({channelId:N().min(1),name:nH.optional(),memberPersonas:ve(H5).optional(),memberContactDeviceIds:ve(N().min(1)).optional()});z({channelId:N().min(1)});z({channels:ve(tH)});z({channel:tH});z({ok:he(!0),removedTopics:Q().int().min(0)});const ur=N().trim().min(1),U5=["master-confirmed","owner-needed"],W5=["open","resolved"],fue=U5[0],rH=U5[1],sH=W5[0],pue=W5[1],mue=et(U5),gue=et(W5),xue=z({id:ur.optional(),resolves:ur.optional(),type:mue,status:gue,question:ur,recommendation:ur}).superRefine((e,t)=>{e.type===fue&&e.status!==pue&&t.addIssue({code:ke.custom,path:["status"],message:"master-confirmed decisions must be resolved"})}),vue=["planning","running","done"],yue=et(vue),iH=z({at:N().min(1),actor:N().min(1),action:N().min(1),target:N().optional(),reason:N().min(1),artifacts:ve(ur).optional(),decision:xue.optional()}),bue=z({rejectCount:Q().int().min(0),accepted:Re().default(!1),ordinal:Q().int().min(1).optional(),overrideCount:Q().int().min(0).optional()}),V5=z({id:N().min(1),channelId:N().min(1),title:N(),masterSessionId:N().min(1),goal:N(),boundaries:N(),acceptanceCriteria:ve(N()),activity:ve(iH),lineMeta:Zi(bue),nextLineOrdinal:Q().int().min(1).optional(),state:yue,createdAt:N().min(1),updatedAt:N().min(1)}),wue=z({lineId:N().min(1),dispatchId:N().min(1),workerSessionId:N().optional(),assignee:N().min(1),focus:N(),status:B5,acceptance:ve(N()),rejectCount:Q().int().min(0),accepted:Re(),ordinal:Q().int().min(1).nullable()});z({channelId:N().min(1)});z({topicId:N().min(1).optional(),sessionId:N().min(1).optional()}).refine(e=>e.topicId!==void 0||e.sessionId!==void 0,{message:"either topicId or sessionId is required"});z({channelId:N().min(1),title:ur.optional()});z({topicId:N().min(1),title:ur.optional(),goal:ur,boundaries:N(),acceptanceCriteria:ve(ur).min(1)});z({topicId:N().min(1),action:ur,target:ur.optional(),reason:ur,artifacts:ve(ur).optional(),decision:iH.shape.decision});z({topicId:N().min(1),lineId:ur,reason:ur});z({topicId:N().min(1),lineId:ur,reason:ur,artifacts:ve(ur).optional(),watcherVerdict:et(["pass","fail"]),overrideReason:ur.optional()}).refine(e=>e.watcherVerdict!=="fail"||!!e.overrideReason,{message:"watcherVerdict=fail 时必须给 overrideReason(推翻 watcher 的理由)",path:["overrideReason"]});z({topicId:N().min(1),state:et(["done"])});z({topicId:N().min(1),title:ur});z({topicId:N().min(1)});const _ue=V5.extend({lineCount:Q().int().min(0)});z({topics:ve(_ue)});z({topic:V5,lines:ve(wue)});z({topicId:N().min(1),masterSessionId:N().min(1)});z({rejectCount:Q().int().min(1),needsOwnerAttention:Re()});z({acceptedLines:Q().int().min(1),totalLines:Q().int().min(1),allAccepted:Re(),overrides:Q().int().min(0),needsOwnerAttention:Re()});z({topic:V5});z({ok:he(!0),removedMasterSessionId:N().min(1).nullable(),removedWorkerSessionIds:ve(N().min(1))});const Sue=["ask","allow","deny"],oH=et(Sue),kue=z({id:N().min(1),desc:N().min(1),action:oH});z({rules:ve(kue)});z({ruleId:N().min(1)});z({action:oH,desc:N(),source:N().min(1)});const Cue=["created","review-requested"],aH=/^[A-Za-z0-9._-]+$/,Cf=N().min(1).regex(aH),Nf=N().min(1).regex(aH),dx=Q().int().positive();z({role:et(Cue)});z({owner:Cf,repo:Nf,number:dx});z({owner:Cf,repo:Nf,number:dx,expectedHeadSha:N().min(1)});z({owner:Cf,repo:Nf,number:dx,body:N().min(1)});z({owner:Cf,repo:Nf,number:dx,ready:Re()});z({owner:Cf,repo:Nf});z({owner:Cf,repo:Nf,number:dx,reviewers:ve(N().min(1)).min(1)});z({page:Q().int().min(1).max(1e3).optional(),search:N().max(100).optional()});z({personaId:N().min(1)});z({personaId:N().min(1)});const Nue=["expired","cancelled","access_denied","lark_protocol_error","cloud_unreachable","internal_error"],jue=et(Nue);z({personaId:N().min(1),appId:N().min(1),appSecret:N().min(1),botName:N().min(1).optional()});const Eue=z({chatId:N().min(1),chatName:N().optional(),lastActiveAt:Q().int().optional()}),Iue=z({state:et(["unbound","provisioning","bound","broken"]),appId:N().optional(),botName:N().optional(),brokenReason:N().optional(),qrUrl:N().optional(),provisionId:N().optional(),errorReason:jue.optional(),groups:ve(Eue),needsUpgrade:Re().optional(),upgradeQrUrl:N().optional()});Iue.extend({personaId:N().min(1)});z({});z({onboardingCompletedAt:Q()});const Wh=["claude","codex","pi"];z({});z({tools:ve(z({id:et(Wh),available:Re(),version:N().optional(),path:N().optional()}))});z({});const Tue=z({tool:et(Wh),cwd:N(),toolSessionId:N(),label:N().optional(),createdAt:N(),updatedAt:N(),turns:Q()});z({candidates:ve(Tue)});z({});z({registered:Re()});z({tool:et(Wh)});const gO=z({usedPercent:Q(),windowDurationMins:Q().optional(),resetsAt:Q().optional()}).strict(),Rue=Fs("kind",[z({kind:he("claude"),loggedIn:Re(),authMethod:N().optional(),apiProvider:N().optional(),apiKeySource:N().optional(),email:N().optional(),orgName:N().optional(),subscriptionType:N().optional()}).strict(),z({kind:he("codex"),login:Fs("type",[z({type:he("none")}).strict(),z({type:he("apiKey")}).strict(),z({type:he("chatgpt"),email:N(),planType:N()}).strict()]),provider:z({name:N(),baseUrl:N().optional()}).strict(),rateLimits:z({primary:gO.optional(),secondary:gO.optional()}).strict().optional()}).strict(),z({kind:he("pi"),providers:ve(z({id:N(),modelCount:Q(),credential:et(["api_key","oauth"]).optional(),oauthExpiresAt:Q().optional()}).strict())}).strict()]);z({tool:et(Wh),installed:Re(),version:N().optional(),path:N().optional(),account:Rue.optional(),error:N().optional(),modelsLoadedAt:Q().optional()}).strict();const q5="https://cpa-portal-d417.app.clawos.chat";z({apiKey:N().min(1)}).strict();z({ok:he(!0)}).strict();const lH=["cloud-persona-metrics","cloud-persona-conversations"],Mue=et(lH);z({page:Mue}).strict();z({url:N(),expiresAt:Q().int()}).strict();const cH=["ready","session:info","session:status","session:event","session:deleted","session:rewound","session:cleared","session:queue","permission:request","session:question","session:question:cleared","pong","error","subscribed","unsubscribed","auth:ok","tunnel:ready","tunnel:exited","tunnel:unavailable","session:control","session:pty","contact:added","contact:pinned","contact:removed","contact:remote-access-updated","contact:note-updated","org-mesh:progress","channel:changed","inbox:event","friend:reverseTokenOffered","auth:login:done","auth:login:failed","larkBot:state"],Pue="cloud_history_refresh",K5=["idle","running","running-idle","stopped","error","observing"],Oue=["task-notification","slash-command","local-command","system-reminder","skill-hint","meta-text","attachment-skills","attachment-deferred-tools","dispatch-task","dispatch-result"];function Ew(e){return e==="dispatch-task"||e==="dispatch-result"}const Due=["builtin","global","project","plugin"],Aue=["builtin","global","project","policy","plugin"],uH=et(["owner","guest"]);z({id:N().min(1),kind:uH,displayName:N(),feishuUnionId:N().optional()}).strict();const $ue=z({did:N().min(1),displayName:N(),feishuUnionId:N().optional(),principal:uH}).strict(),Lue=et(K5),Bue=z({inputTokens:Q().int().nonnegative(),outputTokens:Q().int().nonnegative(),cacheReadTokens:Q().int().nonnegative().optional(),cacheCreateTokens:Q().int().nonnegative().optional()}),dH={gitBranch:N().optional(),resolvedModel:N().optional(),resolvedEffort:N().optional(),contextUsage:Bue.optional(),contextWindowSize:Q().int().positive().optional(),aiLabel:N().optional()},Fue=z(dH),hH=z({value:N(),label:N(),description:N().optional()}),zue=z({id:N().min(1),label:N().min(1),description:N().optional(),contextWindowSize:Q().int().positive().optional(),default:Re().optional(),efforts:ve(hH).optional(),defaultEffort:N().optional(),group:N().optional()}),Hue=z({id:N().min(1),label:N().min(1),description:N().optional()}),Uue=z({name:N().min(1),type:et(["string","select","toggle"]),label:N().min(1),description:N().optional(),options:ve(hH).optional(),default:Ya().optional(),scope:et(["core","tool-specific"])});z({tool:N().min(1),refresh:Re().optional()});const Wue=z({rewind:Re(),subagents:Re(),tui:Re(),observe:Re(),fileSharing:Re(),fork:Re()});z({tool:N().min(1),toolSessionIdLabel:N().optional(),models:ve(zue),permissionModes:ve(Hue),configSchema:ve(Uue),features:Wue});const Vue=z({tool:N().min(1),pattern:N().min(1),createdAt:N().min(1).optional()});z({cloudEnvironment:Ws.optional(),cloudExpectedImage:xc.optional(),testReleaseId:N().optional(),sessionId:N().min(1),cloudExecutionId:N().min(1).optional(),cloudConversationId:N().min(1).optional(),cloudWorkspace:Cw.optional(),cloudPendingTurns:ve(z({id:N().min(1),text:N(),prepared:Re().optional()})).optional(),cloudBranchIntent:bg.optional(),cloudGatewaySessionId:N().min(1).optional(),cloudPendingCommand:z({id:N().min(1),text:N(),prepared:Re().optional()}).optional(),cwd:N().min(1),tool:he("claude").or(N().min(1)).default("claude"),toolSessionId:N().optional(),label:N().optional(),model:N().optional(),permissionMode:N().optional(),effort:N().optional(),serviceTier:N().optional(),...dH,aiLabelGeneratedAt:N().optional(),permissionRules:ve(Vue).optional(),pinnedAt:Q().int().nonnegative().nullable().optional(),archivedAt:Q().int().nonnegative().nullable().optional(),pinSortOrder:Q().int().nullable().optional(),unreadAt:N().min(1).nullable().optional(),iconKey:N().optional(),forkedFromSessionId:N().min(1).optional(),ephemeral:Re().optional(),deployId:N().min(1).optional(),ownerPersonaId:N().min(1).optional(),projectPath:N().min(1).optional(),chatId:N().min(1).optional(),creatorPrincipalId:N().min(1).optional(),creatorDisplayName:N().min(1).optional(),creatorFeishuUnionId:N().min(1).optional(),originOwnerPrincipalId:N().min(1).optional(),originOwnerPersonaId:N().min(1).optional(),dispatchedFromSessionId:N().min(1).optional(),shiftFiredFromSessionId:N().min(1).optional(),larkChatId:N().min(1).optional(),larkChatName:N().min(1).optional(),larkChatType:et(["p2p","group"]).optional(),createdAt:N().min(1),updatedAt:N().min(1)});const js={turnId:N().min(1).optional(),seq:Q().int().nonnegative().optional(),ts:N().optional(),uuid:N().optional()},que=et(Oue),Kue=z({readCount:Q().int().nonnegative().optional(),searchCount:Q().int().nonnegative().optional(),bashCount:Q().int().nonnegative().optional(),editFileCount:Q().int().nonnegative().optional(),linesAdded:Q().int().nonnegative().optional(),linesRemoved:Q().int().nonnegative().optional(),otherToolCount:Q().int().nonnegative().optional()}),Gue=z({oldStart:Q().int().nonnegative(),oldLines:Q().int().nonnegative(),newStart:Q().int().nonnegative(),newLines:Q().int().nonnegative(),lines:ve(N())}),Yue=z({agentId:N().optional(),agentType:N().optional(),status:N().optional(),prompt:N().optional(),filePath:N().optional(),structuredPatch:ve(Gue).optional(),stats:z({durationMs:Q().int().nonnegative().optional(),tokens:Q().int().nonnegative().optional(),toolUseCount:Q().int().nonnegative().optional(),toolStats:Kue.optional()}).optional()}),Xue=z({path:N(),content:N(),mtimeMs:Q().optional()}),Zue=z({label:N().min(1),description:N().optional()}),fH=z({question:N().min(1),multiSelect:Re(),options:ve(Zue).min(1)}),Que=["completed","interrupted"];Fs("kind",[z({...js,kind:he("session_init"),toolSessionId:N().optional()}),z({...js,kind:he("thinking"),text:N(),partialId:N().optional()}),z({...js,kind:he("text"),text:N(),partialId:N().optional()}),z({...js,kind:he("user_text"),text:N(),meta:que.optional(),taskId:N().optional(),parentToolUseId:N().optional(),sender:$ue.optional()}),z({...js,kind:he("tool_call"),toolUseId:N(),tool:N(),toolKind:N().optional(),input:Ya()}),z({...js,kind:he("tool_result"),toolUseId:N(),output:Ya().optional(),error:N().optional(),toolResultExtra:Yue.optional(),sourceToolAssistantUUID:N().optional(),askQuestionAnswers:Zi(N(),N()).optional()}),z({...js,kind:he("attachment_memories"),memories:ve(Xue)}),z({...js,kind:he("permission_request"),requestId:N(),tool:N(),input:Ya(),toolUseId:N().optional()}),z({...js,kind:he("ask_user_question"),toolUseId:N(),questions:ve(fH)}),z({...js,kind:he("turn_end"),durationMs:Q().int().nonnegative().optional(),reason:et(Que).optional(),turnId:N().min(1).optional()}),z({...js,kind:he("subagent_progress"),toolUseId:N(),agentId:N(),status:et(["started","running","completed","failed"]),description:N().optional(),lastToolName:N().optional(),prompt:N().optional(),stats:z({durationMs:Q().int().nonnegative().optional(),tokens:Q().int().nonnegative().optional(),toolUseCount:Q().int().nonnegative().optional()}).optional()}),z({...js,kind:he("error"),message:N()}),z({...js,kind:he("meta_update"),patch:Fue}),z({...js,kind:he("meta-text"),text:N(),metaSource:et(["cc","owner"]).optional()})]);z({cwd:N().min(1).optional(),tool:N().optional(),label:N().optional(),aiLabel:N().optional(),model:N().optional(),permissionMode:N().optional(),effort:N().optional(),serviceTier:L7.optional(),iconKey:N().optional(),forkedFromSessionId:N().min(1).optional(),forkAt:Yle([z({messageUuid:N().min(1)}).strict(),z({turnId:N().min(1)}).strict()]).optional(),ephemeral:Re().optional(),ownerPersonaId:N().min(1).optional(),projectPath:N().min(1).optional()}).refine(e=>e.cwd!=null||e.ownerPersonaId!=null||e.projectPath!=null,{message:"cwd / ownerPersonaId / projectPath 至少传一个"});z({path:N().min(1),name:N().min(1),createdAt:N().datetime(),pinnedAt:Q().optional()});z({path:N().min(1),pinnedAt:Q().nullable()});z({path:N().min(1)});z({path:N().min(1).optional(),name:N().min(1).optional()}).refine(e=>e.path!=null||e.name!=null,{message:"path 与 name 至少给一个"});z({cwd:N().min(1),tool:N().min(1),toolSessionId:N().min(1),label:N().optional(),aiLabel:N().optional(),iconKey:N().optional(),createdAt:N().datetime(),updatedAt:N().datetime(),ownerPersonaId:N().min(1).optional()});z({originOnly:Re().optional(),ownerPersonaId:N().min(1).optional(),limit:Q().int().positive().optional(),offset:Q().int().nonnegative().optional()});z({sessionId:N().min(1)});z({sessionId:N().min(1),patch:z({label:N().optional(),tool:N().min(1).optional(),model:N().optional(),permissionMode:N().optional(),effort:N().optional(),cwd:N().optional(),iconKey:N().optional(),ephemeral:he(!1).optional()})});z({id:N().min(1),text:N(),queuedAt:Q(),senderDisplayName:N().optional()});z({sessionId:N().min(1),text:N(),queueWhileRunning:Re().optional()});z({sessionId:N().min(1),id:N().min(1).optional()});z({sessionId:N().min(1),userMessageId:N().min(1),dryRun:Re().optional()});z({canRewind:Re(),error:N().optional(),filesChanged:ve(N()).optional(),insertions:Q().int().nonnegative().optional(),deletions:Q().int().nonnegative().optional()});z({sessionId:N().min(1),userMessageId:N().min(1)});const Jue=z({oldStart:Q().int().nonnegative(),oldLines:Q().int().nonnegative(),newStart:Q().int().nonnegative(),newLines:Q().int().nonnegative(),lines:ve(N())}),ede=z({filePath:N().min(1),hunks:ve(Jue),insertions:Q().int().nonnegative(),deletions:Q().int().nonnegative(),status:et(["modified","added","deleted"]).optional()});z({canRewind:Re(),error:N().optional(),files:ve(ede),totalInsertions:Q().int().nonnegative(),totalDeletions:Q().int().nonnegative()});z({userMessageIds:ve(N())});z({sessionId:N().min(1),toolSessionId:N().min(1)});z({cwd:N().min(1),toolSessionId:N().min(1),messageUuid:N().min(1).optional(),turnId:N().min(1).optional(),sourceSessionId:N().min(1).optional(),targetCwd:N().min(1).optional()}).refine(e=>!!(e.messageUuid||e.turnId),"messageUuid or turnId required");z({forkedToolSessionId:N().min(1),forkedFilePath:N().min(1)});z({sessionId:N().min(1),toolSessionId:N().min(1),jsonlPath:N().optional()});z({sessionId:N().min(1),afterSeq:Q().int().min(-1)});z({sessionId:N().min(1),permissionRequestId:N().min(1),allow:Re(),permanent:Re().optional(),pattern:N().optional()});z({projectPath:N().min(1)});z({sessionId:N().min(1),limit:Q().int().positive().max(5e3).optional(),offset:Q().int().nonnegative().optional(),snapshotId:N().uuid().optional(),slim:Re().optional(),view:et(["turns","items"]).optional(),cursor:N().min(1).max(16384).optional(),turnId:N().min(1).max(256).optional()}).superRefine((e,t)=>{e.view==="items"&&!e.turnId&&t.addIssue({code:ke.custom,path:["turnId"],message:"items requires turnId"}),e.view&&(e.offset!==void 0||e.slim!==void 0)&&t.addIssue({code:ke.custom,message:"native views do not accept offset or slim"}),!e.view&&(e.cursor!==void 0||e.turnId!==void 0)&&t.addIssue({code:ke.custom,message:"cursor and turnId require a native view"}),e.view==="turns"&&e.turnId!==void 0&&t.addIssue({code:ke.custom,path:["turnId"],message:"turns does not accept turnId"}),e.view&&e.limit!==void 0&&e.limit>100&&t.addIssue({code:ke.custom,path:["limit"],message:"native page limit is 100"})});z({cwd:N().min(1),toolSessionId:N().min(1)});z({cwd:N().min(1),toolSessionId:N().min(1),subagentId:N().min(1)});z({cwd:N().min(1).optional(),path:N().optional(),showHidden:Re().optional()});z({cwd:N().min(1),path:N().min(1)});z({cwd:N().min(1),tool:N().optional()});z({name:N().min(1),source:et(Due),path:N().optional(),description:N().optional(),plugin:N().optional()});const tde=z({name:N().min(1),source:et(Aue),path:N().optional(),description:N().optional(),whenToUse:N().optional(),plugin:N().optional()});z({cwd:N().min(1),tool:N().optional()});z({agents:ve(tde)});z({sessionId:N().optional()});z({sessionId:N().min(1).optional()});z({sessionId:N().min(1),pinned:Re()});z({sessionId:N().min(1),archived:Re()});z({query:N().min(1),sessionIds:ve(N().min(1)),limit:Q().int().positive().max(50).optional()});const nde=z({sessionId:N().min(1),snippet:N()});z({type:he("session:searchContent"),matches:ve(nde)});z({type:he("peerSession:upsert:ok")});z({sessionId:N().min(1)});z({type:he("peerSession:remove:ok")});z({orderedIds:ve(N().min(1)).min(1)});z({cwd:N().min(1)});z({isGitRoot:Re(),gitRoot:N().nullable()});z({cwd:N().min(1)});z({branch:N().nullable()});z({cwd:N().min(1)});z({branches:ve(N()),head:N().nullable()});const rde=z({cwd:N().min(1),updatedAt:N().min(1)});z({dirs:ve(rde)});z({type:he("session:question"),sessionId:N().min(1),toolUseId:N().min(1),requestId:N().min(1),questions:ve(fH).min(1)});z({type:he("session:question:cleared"),sessionId:N().min(1),toolUseId:N().min(1),answers:Zi(N(),N()).optional()});z({sessionId:N().min(1),toolUseId:N().min(1),answers:Zi(N(),N())});z({ok:he(!0)});z({sessionId:N().min(1),toolUseId:N().min(1)});z({ok:he(!0)});const pH=z({name:N().min(1),version:N().min(1),instanceId:N().min(1),deviceLabel:N().transform(e=>e.trim().slice(0,64)).optional()});z({type:he("auth"),token:N().min(1),scheme:he("bearer").optional(),clientInfo:pH.optional()});z({type:he("auth:ok"),version:N().min(1).optional(),protocolVersion:Q().int().nonnegative().optional()});const sde=z({clientId:N().min(1),connectedAt:Q().int().nonnegative(),self:Re(),clientInfo:pH.optional()});z({type:he("device:connections:ok"),connections:ve(sde)});z({type:he("tunnel:ready"),url:N().min(1),subdomain:N().min(1)});z({type:he("tunnel:exited"),code:Q().int().nullable(),subdomain:N().nullable(),url:N().nullable()});z({type:he("tunnel:unavailable"),reason:N().min(1),failedAt:N().min(1)});const ide=z({sessionId:N().min(1),status:Lue,freshSpawn:Re(),pendingPermissionRequestIds:ve(N().min(1)),pendingQuestionToolUseIds:ve(N().min(1))});z({type:he("info"),version:N(),protocolVersion:Q(),hostname:N(),os:N(),tools:ve(z({id:N(),available:Re()})),runningSessions:ve(ide),tokenRole:et(tce).optional(),isLoopback:Re().optional(),httpBaseUrl:N().optional(),httpToken:N().optional(),daemonSource:et(["ota","packaged"]).optional(),globalCliVersion:N().nullable().optional()});z({});z({method:N().min(1).optional()});const ode=["allowed","conditional","denied"],ade=et(ode),lde=z({name:N().min(1),status:ade,description:N().min(1),args:ve(z({name:N(),required:Re()})).nullable(),argsSchema:Zi(Ya()).optional(),reason:N().optional()});z({type:he("meta:methods"),methods:ve(lde)});const xO=1,cde=z({usedBytes:Q().int().nonnegative(),sizeBytes:Q().int().positive(),measuredAt:Q().int().nonnegative()}).strict();z({volume:cde.nullable()}).strict();const vO=25*1024*1024,G5={".png":"image/png",".jpg":"image/jpeg",".jpeg":"image/jpeg",".gif":"image/gif",".webp":"image/webp",".pdf":"application/pdf",".txt":"text/plain",".md":"text/plain",".markdown":"text/plain",".csv":"text/plain",".log":"text/plain",".json":"application/json",".xml":"application/xml",".yaml":"application/yaml",".yml":"application/yaml",".html":"text/html",".conf":"text/plain",".cfg":"text/plain",".ini":"text/plain",".toml":"text/plain"},mH=new Set([...Object.values(G5),"application/x-yaml"]),gH=[...mH,"text/*",...Object.keys(G5)].join(",");function xH(e,t){const n=t.split(";",1)[0].trim().toLowerCase();if(n===""||n==="application/octet-stream"){const r=e.lastIndexOf("."),s=r>0?e.slice(r).toLowerCase():"";return G5[s]??null}return mH.has(n)||n.startsWith("text/")?n:null}const ude=["daemon","main","renderer"],dde=et(ude),hde=["debug","info","warn","error"],fde=et(hde);z({ts:Q().int(),source:dde,level:fde,msg:N(),ownerPrincipalId:N(),deviceId:N(),appVersion:N(),daemonVersion:N().optional(),os:N(),meta_json:N().optional(),sessionId:N().optional()});z({v:he(1),visitorId:N().min(1),displayName:N(),provider:N(),iat:Q(),exp:Q()});const pde=z({visitorId:N(),displayName:N(),avatarUrl:N().optional(),provider:N(),firstSeen:Q(),lastSeen:Q()});z({visitors:ve(pde)});z({type:he("web:open"),url:N().min(1),expiresAt:Q()});z({ticket:N().min(1)}).strict();z({token:N().min(1),expiresAt:Q()});const mde=/<system-reminder>此消息来自飞书群成员 (.+?)<\/system-reminder>\s*$/,vH=/<system-reminder>此消息来自 (owner|guest):(.+?)<\/system-reminder>\s*$/,yH="clawd-dispatch-task",bH="clawd-dispatch-result",yO=120;function gde(e){if(!e)return null;const t=e.search(bO(yH)),n=e.search(bO(bH));return t<0&&n<0?null:n<0?"task":t<0?"result":t<n?"task":"result"}function xde(e){if(!e)return[];const t=[];for(const n of["task","result"]){const r=n==="task"?yH:bH,s=new RegExp(`<${r}\\b([^>]*)>([\\s\\S]*?)</${r}>`,"gi");for(let i=s.exec(e);i!==null;i=s.exec(e))t.push({at:i.index,block:vde(n,i[1]??"",i[2]??"")})}return t.sort((n,r)=>n.at-r.at).map(n=>n.block)}function vde(e,t,n){var u;const r=Cde(t),s=tj(kde(_k(n,"detail")??n)),i=(u=_k(n,"brief"))==null?void 0:u.trim(),o=i&&i.length>0?tj(i):yde(s),l=r.round!==void 0?Number.parseInt(r.round,10):void 0,c=r.status;return{kind:e,dispatchId:r["dispatch-id"]??"",...r.from?{from:r.from}:{},...e==="task"&&l!==void 0&&Number.isFinite(l)?{round:l}:{},...e==="result"&&(c==="success"||c==="failure")?{status:c}:{},brief:o,briefIsDerived:!(i&&i.length>0),detail:s,filePaths:Sde(_k(n,"files"))}}function yde(e){const t=e.split(/\n\s*\n/).map(r=>r.trim()).find(r=>r.length>0);if(!t)return"";const n=t.replace(/\s+/g," ");return n.length>yO?`${n.slice(0,yO)}…`:n}const bde="clawd-dispatch-task|clawd-dispatch-result|brief|detail|files",wde=new RegExp(`<\\\\(\\\\*)(/?)(${bde})\\b`,"g");function _de(e){return tj(e)}function tj(e){return e.replace(wde,"<$1$2$3")}function _k(e,t){const n=new RegExp(`<${t}>([\\s\\S]*?)</${t}>`,"i").exec(e);return n?n[1]??"":null}function Sde(e){return e?e.split(`
95
+ `,boxShadowTabsOverflowLeft:"inset 10px 0 8px -8px rgba(0, 0, 0, 0.08)",boxShadowTabsOverflowRight:"inset -10px 0 8px -8px rgba(0, 0, 0, 0.08)",boxShadowTabsOverflowTop:"inset 0 10px 8px -8px rgba(0, 0, 0, 0.08)",boxShadowTabsOverflowBottom:"inset 0 -10px 8px -8px rgba(0, 0, 0, 0.08)"}),r)}var K4=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,r=Object.getOwnPropertySymbols(e);s<r.length;s++)t.indexOf(r[s])<0&&Object.prototype.propertyIsEnumerable.call(e,r[s])&&(n[r[s]]=e[r[s]]);return n};const Rae={lineHeight:!0,lineHeightSM:!0,lineHeightLG:!0,lineHeightHeading1:!0,lineHeightHeading2:!0,lineHeightHeading3:!0,lineHeightHeading4:!0,lineHeightHeading5:!0,opacityLoading:!0,fontWeightStrong:!0,zIndexPopupBase:!0,zIndexBase:!0,opacityImage:!0},Mae={motionBase:!0,motionUnit:!0},Pae={screenXS:!0,screenXSMin:!0,screenXSMax:!0,screenSM:!0,screenSMMin:!0,screenSMMax:!0,screenMD:!0,screenMDMin:!0,screenMDMax:!0,screenLG:!0,screenLGMin:!0,screenLGMax:!0,screenXL:!0,screenXLMin:!0,screenXLMax:!0,screenXXL:!0,screenXXLMin:!0},t7=(e,t,n)=>{const r=n.getDerivativeToken(e),{override:s}=t,i=K4(t,["override"]);let o=Object.assign(Object.assign({},r),{override:s});return o=e7(o),i&&Object.entries(i).forEach(([l,c])=>{const{theme:u}=c,d=K4(c,["theme"]);let h=d;u&&(h=t7(Object.assign(Object.assign({},o),d),{override:d},u)),o[l]=h}),o};function n7(){const{token:e,hashed:t,theme:n,override:r,cssVar:s}=q.useContext(Q9),i=`${Iae}-${t||""}`,o=n||Z9,[l,c,u]=boe(o,[gg,e],{salt:i,override:r,getComputedToken:t7,formatToken:e7,cssVar:s&&{prefix:s.prefix,key:s.key,unitless:Rae,ignore:Mae,preserve:Pae}});return[o,u,t?c:"",l,s]}const Oae=()=>({display:"inline-flex",alignItems:"center",color:"inherit",fontStyle:"normal",lineHeight:0,textAlign:"center",textTransform:"none",verticalAlign:"-0.125em",textRendering:"optimizeLegibility","-webkit-font-smoothing":"antialiased","-moz-osx-font-smoothing":"grayscale","> *":{lineHeight:1},svg:{display:"inline-block"}}),Dae=e=>({[`.${e}`]:Object.assign(Object.assign({},Oae()),{[`.${e} .${e}-icon`]:{display:"block"}})}),Aae=(e,t)=>{const[n,r]=n7();return Goe({token:r,hashId:"",path:["ant-design-icons",e],nonce:()=>t==null?void 0:t.nonce,layer:{name:"antd"}},()=>Dae(e))},$ae=Object.assign({},bf),{useId:G4}=$ae,Lae=()=>"",Bae=typeof G4>"u"?Lae:G4;function Fae(e,t,n){var r;const s=e||{},i=s.inherit===!1||!t?Object.assign(Object.assign({},kb),{hashed:(r=t==null?void 0:t.hashed)!==null&&r!==void 0?r:kb.hashed,cssVar:t==null?void 0:t.cssVar}):t,o=Bae();return w9(()=>{var l,c;if(!e)return t;const u=Object.assign({},i.components);Object.keys(e.components||{}).forEach(f=>{u[f]=Object.assign(Object.assign({},u[f]),e.components[f])});const d=`css-var-${o.replace(/:/g,"")}`,h=((l=s.cssVar)!==null&&l!==void 0?l:i.cssVar)&&Object.assign(Object.assign(Object.assign({prefix:n==null?void 0:n.prefixCls},typeof i.cssVar=="object"?i.cssVar:{}),typeof s.cssVar=="object"?s.cssVar:{}),{key:typeof s.cssVar=="object"&&((c=s.cssVar)===null||c===void 0?void 0:c.key)||d});return Object.assign(Object.assign(Object.assign({},i),s),{token:Object.assign(Object.assign({},i.token),s.token),components:u,cssVar:h})},[s,i],(l,c)=>l.some((u,d)=>{const h=c[d];return!Gie(u,h,!0)}))}var zae=["children"],r7=p.createContext({});function Hae(e){var t=e.children,n=ui(e,zae);return p.createElement(r7.Provider,{value:n},t)}var Uae=function(e){Rr(n,e);var t=k9(n);function n(){return Rn(this,n),t.apply(this,arguments)}return Mn(n,[{key:"render",value:function(){return this.props.children}}]),n}(p.Component);function Wae(e){var t=p.useReducer(function(l){return l+1},0),n=St(t,2),r=n[1],s=p.useRef(e),i=LN(function(){return s.current}),o=LN(function(l){s.current=typeof l=="function"?l(s.current):l,r()});return[i,o]}var Dl="none",t0="appear",n0="enter",r0="leave",Y4="none",fo="prepare",ah="start",lh="active",_5="end",s7="prepared";function X4(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit".concat(e)]="webkit".concat(t),n["Moz".concat(e)]="moz".concat(t),n["ms".concat(e)]="MS".concat(t),n["O".concat(e)]="o".concat(t.toLowerCase()),n}function Vae(e,t){var n={animationend:X4("Animation","AnimationEnd"),transitionend:X4("Transition","TransitionEnd")};return e&&("AnimationEvent"in t||delete n.animationend.animation,"TransitionEvent"in t||delete n.transitionend.transition),n}var qae=Vae(ul(),typeof window<"u"?window:{}),i7={};if(ul()){var Kae=document.createElement("div");i7=Kae.style}var s0={};function o7(e){if(s0[e])return s0[e];var t=qae[e];if(t)for(var n=Object.keys(t),r=n.length,s=0;s<r;s+=1){var i=n[s];if(Object.prototype.hasOwnProperty.call(t,i)&&i in i7)return s0[e]=t[i],s0[e]}return""}var a7=o7("animationend"),l7=o7("transitionend"),c7=!!(a7&&l7),Z4=a7||"animationend",Q4=l7||"transitionend";function J4(e,t){if(!e)return null;if(Tn(e)==="object"){var n=t.replace(/-\w/g,function(r){return r[1].toUpperCase()});return e[n]}return"".concat(e,"-").concat(t)}const Gae=function(e){var t=p.useRef();function n(s){s&&(s.removeEventListener(Q4,e),s.removeEventListener(Z4,e))}function r(s){t.current&&t.current!==s&&n(t.current),s&&s!==t.current&&(s.addEventListener(Q4,e),s.addEventListener(Z4,e),t.current=s)}return p.useEffect(function(){return function(){n(t.current)}},[]),[r,n]};var u7=ul()?p.useLayoutEffect:p.useEffect;const Yae=function(){var e=p.useRef(null);function t(){mN.cancel(e.current)}function n(r){var s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:2;t();var i=mN(function(){s<=1?r({isCanceled:function(){return i!==e.current}}):n(r,s-1)});e.current=i}return p.useEffect(function(){return function(){t()}},[]),[n,t]};var Xae=[fo,ah,lh,_5],Zae=[fo,s7],d7=!1,Qae=!0;function h7(e){return e===lh||e===_5}const Jae=function(e,t,n){var r=BN(Y4),s=St(r,2),i=s[0],o=s[1],l=Yae(),c=St(l,2),u=c[0],d=c[1];function h(){o(fo,!0)}var f=t?Zae:Xae;return u7(function(){if(i!==Y4&&i!==_5){var m=f.indexOf(i),g=f[m+1],x=n(i);x===d7?o(g,!0):g&&u(function(b){function y(){b.isCanceled()||o(g,!0)}x===!0?y():Promise.resolve(x).then(y)})}},[e,i]),p.useEffect(function(){return function(){d()}},[]),[h,i]};function ele(e,t,n,r){var s=r.motionEnter,i=s===void 0?!0:s,o=r.motionAppear,l=o===void 0?!0:o,c=r.motionLeave,u=c===void 0?!0:c,d=r.motionDeadline,h=r.motionLeaveImmediately,f=r.onAppearPrepare,m=r.onEnterPrepare,g=r.onLeavePrepare,x=r.onAppearStart,b=r.onEnterStart,y=r.onLeaveStart,v=r.onAppearActive,w=r.onEnterActive,_=r.onLeaveActive,S=r.onAppearEnd,k=r.onEnterEnd,C=r.onLeaveEnd,j=r.onVisibleChanged,R=BN(),E=St(R,2),T=E[0],P=E[1],O=Wae(Dl),A=St(O,2),F=A[0],B=A[1],U=BN(null),L=St(U,2),D=L[0],I=L[1],V=F(),H=p.useRef(!1),M=p.useRef(null);function G(){return n()}var X=p.useRef(!1);function K(){B(Dl),I(null,!0)}var te=LN(function(De){var Me=F();if(Me!==Dl){var We=G();if(!(De&&!De.deadline&&De.target!==We)){var wt=X.current,Nt;Me===t0&&wt?Nt=S==null?void 0:S(We,De):Me===n0&&wt?Nt=k==null?void 0:k(We,De):Me===r0&&wt&&(Nt=C==null?void 0:C(We,De)),wt&&Nt!==!1&&K()}}}),ce=Gae(te),J=St(ce,1),de=J[0],Se=function(Me){switch(Me){case t0:return Ze(Ze(Ze({},fo,f),ah,x),lh,v);case n0:return Ze(Ze(Ze({},fo,m),ah,b),lh,w);case r0:return Ze(Ze(Ze({},fo,g),ah,y),lh,_);default:return{}}},se=p.useMemo(function(){return Se(V)},[V]),ae=Jae(V,!e,function(De){if(De===fo){var Me=se[fo];return Me?Me(G()):d7}if(xe in se){var We;I(((We=se[xe])===null||We===void 0?void 0:We.call(se,G(),null))||null)}return xe===lh&&V!==Dl&&(de(G()),d>0&&(clearTimeout(M.current),M.current=setTimeout(function(){te({deadline:!0})},d))),xe===s7&&K(),Qae}),Z=St(ae,2),fe=Z[0],xe=Z[1],Te=h7(xe);X.current=Te;var Qe=p.useRef(null);u7(function(){if(!(H.current&&Qe.current===t)){P(t);var De=H.current;H.current=!0;var Me;!De&&t&&l&&(Me=t0),De&&t&&i&&(Me=n0),(De&&!t&&u||!De&&h&&!t&&u)&&(Me=r0);var We=Se(Me);Me&&(e||We[fo])?(B(Me),fe()):B(Dl),Qe.current=t}},[t]),p.useEffect(function(){(V===t0&&!l||V===n0&&!i||V===r0&&!u)&&B(Dl)},[l,i,u]),p.useEffect(function(){return function(){H.current=!1,clearTimeout(M.current)}},[]);var ge=p.useRef(!1);p.useEffect(function(){T&&(ge.current=!0),T!==void 0&&V===Dl&&((ge.current||T)&&(j==null||j(T)),ge.current=!0)},[T,V]);var Ce=D;return se[fo]&&xe===ah&&(Ce=Pt({transition:"none"},Ce)),[V,xe,Ce,T??t]}function tle(e){var t=e;Tn(e)==="object"&&(t=e.transitionSupport);function n(s,i){return!!(s.motionName&&t&&i!==!1)}var r=p.forwardRef(function(s,i){var o=s.visible,l=o===void 0?!0:o,c=s.removeOnLeave,u=c===void 0?!0:c,d=s.forceRender,h=s.children,f=s.motionName,m=s.leavedClassName,g=s.eventProps,x=p.useContext(r7),b=x.motion,y=n(s,b),v=p.useRef(),w=p.useRef();function _(){try{return v.current instanceof HTMLElement?v.current:Pie(w.current)}catch{return null}}var S=ele(y,l,_,s),k=St(S,4),C=k[0],j=k[1],R=k[2],E=k[3],T=p.useRef(E);E&&(T.current=!0);var P=p.useCallback(function(L){v.current=L,$ie(i,L)},[i]),O,A=Pt(Pt({},g),{},{visible:l});if(!h)O=null;else if(C===Dl)E?O=h(Pt({},A),P):!u&&T.current&&m?O=h(Pt(Pt({},A),{},{className:m}),P):d||!u&&!m?O=h(Pt(Pt({},A),{},{style:{display:"none"}}),P):O=null;else{var F;j===fo?F="prepare":h7(j)?F="active":j===ah&&(F="start");var B=J4(f,"".concat(C,"-").concat(F));O=h(Pt(Pt({},A),{},{className:wie(J4(f,C),Ze(Ze({},B,B&&F),f,typeof f=="string")),style:R}),P)}if(p.isValidElement(O)&&Lie(O)){var U=Bie(O);U||(O=p.cloneElement(O,{ref:P}))}return p.createElement(Uae,{ref:w},O)});return r.displayName="CSSMotion",r}const nle=tle(c7);var FN="add",zN="keep",HN="remove",yk="removed";function rle(e){var t;return e&&Tn(e)==="object"&&"key"in e?t=e:t={key:e},Pt(Pt({},t),{},{key:String(t.key)})}function UN(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];return e.map(rle)}function sle(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],n=[],r=0,s=t.length,i=UN(e),o=UN(t);i.forEach(function(u){for(var d=!1,h=r;h<s;h+=1){var f=o[h];if(f.key===u.key){r<h&&(n=n.concat(o.slice(r,h).map(function(m){return Pt(Pt({},m),{},{status:FN})})),r=h),n.push(Pt(Pt({},f),{},{status:zN})),r+=1,d=!0;break}}d||n.push(Pt(Pt({},u),{},{status:HN}))}),r<s&&(n=n.concat(o.slice(r).map(function(u){return Pt(Pt({},u),{},{status:FN})})));var l={};n.forEach(function(u){var d=u.key;l[d]=(l[d]||0)+1});var c=Object.keys(l).filter(function(u){return l[u]>1});return c.forEach(function(u){n=n.filter(function(d){var h=d.key,f=d.status;return h!==u||f!==HN}),n.forEach(function(d){d.key===u&&(d.status=zN)})}),n}var ile=["component","children","onVisibleChanged","onAllRemoved"],ole=["status"],ale=["eventProps","visible","children","motionName","motionAppear","motionEnter","motionLeave","motionLeaveImmediately","motionDeadline","removeOnLeave","leavedClassName","onAppearPrepare","onAppearStart","onAppearActive","onAppearEnd","onEnterStart","onEnterActive","onEnterEnd","onLeaveStart","onLeaveActive","onLeaveEnd"];function lle(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:nle,n=function(r){Rr(i,r);var s=k9(i);function i(){var o;Rn(this,i);for(var l=arguments.length,c=new Array(l),u=0;u<l;u++)c[u]=arguments[u];return o=s.call.apply(s,[this].concat(c)),Ze(fN(o),"state",{keyEntities:[]}),Ze(fN(o),"removeKey",function(d){o.setState(function(h){var f=h.keyEntities.map(function(m){return m.key!==d?m:Pt(Pt({},m),{},{status:yk})});return{keyEntities:f}},function(){var h=o.state.keyEntities,f=h.filter(function(m){var g=m.status;return g!==yk}).length;f===0&&o.props.onAllRemoved&&o.props.onAllRemoved()})}),o}return Mn(i,[{key:"render",value:function(){var l=this,c=this.state.keyEntities,u=this.props,d=u.component,h=u.children,f=u.onVisibleChanged;u.onAllRemoved;var m=ui(u,ile),g=d||p.Fragment,x={};return ale.forEach(function(b){x[b]=m[b],delete m[b]}),delete m.keys,p.createElement(g,m,c.map(function(b,y){var v=b.status,w=ui(b,ole),_=v===FN||v===zN;return p.createElement(t,bt({},x,{key:w.key,visible:_,eventProps:w,onVisibleChanged:function(k){f==null||f(k,{key:w.key}),k||l.removeKey(w.key)}}),function(S,k){return h(Pt(Pt({},S),{},{index:y}),k)})}))}}],[{key:"getDerivedStateFromProps",value:function(l,c){var u=l.keys,d=c.keyEntities,h=UN(u),f=sle(d,h);return{keyEntities:f.filter(function(m){var g=d.find(function(x){var b=x.key;return m.key===b});return!(g&&g.status===yk&&m.status===HN)})}}}]),i}(p.Component);return Ze(n,"defaultProps",{component:"div"}),n}lle(c7);const eO=p.createContext(!0);function cle(e){const t=p.useContext(eO),{children:n}=e,[,r]=n7(),{motion:s}=r,i=p.useRef(!1);return i.current||(i.current=t!==s),i.current?p.createElement(eO.Provider,{value:s},p.createElement(Hae,{motion:s},n)):n}const ule=()=>null;var dle=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,r=Object.getOwnPropertySymbols(e);s<r.length;s++)t.indexOf(r[s])<0&&Object.prototype.propertyIsEnumerable.call(e,r[s])&&(n[r[s]]=e[r[s]]);return n};const hle=["getTargetContainer","getPopupContainer","renderEmpty","input","pagination","form","select","button"];let f7;function fle(){return f7||AN}function ple(e){return Object.keys(e).some(t=>t.endsWith("Color"))}const mle=e=>{const{prefixCls:t,iconPrefixCls:n,theme:r,holderRender:s}=e;t!==void 0&&(f7=t),r&&ple(r)&&Sae(fle(),r)},gle=e=>{const{children:t,csp:n,autoInsertSpaceInButton:r,alert:s,anchor:i,form:o,locale:l,componentSize:c,direction:u,space:d,splitter:h,virtual:f,dropdownMatchSelectWidth:m,popupMatchSelectWidth:g,popupOverflow:x,legacyLocale:b,parentContext:y,iconPrefixCls:v,theme:w,componentDisabled:_,segmented:S,statistic:k,spin:C,calendar:j,carousel:R,cascader:E,collapse:T,typography:P,checkbox:O,descriptions:A,divider:F,drawer:B,skeleton:U,steps:L,image:D,layout:I,list:V,mentions:H,modal:M,progress:G,result:X,slider:K,breadcrumb:te,menu:ce,pagination:J,input:de,textArea:Se,empty:se,badge:ae,radio:Z,rate:fe,switch:xe,transfer:Te,avatar:Qe,message:ge,tag:Ce,table:De,card:Me,tabs:We,timeline:wt,timePicker:Nt,upload:ie,notification:le,tree:pe,colorPicker:Ke,datePicker:Ge,rangePicker:dt,flex:rn,wave:Ve,dropdown:en,warning:ye,tour:Oe,tooltip:ht,popover:jt,popconfirm:vn,floatButton:be,floatButtonGroup:ne,variant:Ae,inputNumber:nt,treeSelect:rt}=e,Mt=p.useCallback((_t,Kt)=>{const{prefixCls:Zn}=e;if(Kt)return Kt;const dr=Zn||y.getPrefixCls("");return _t?`${dr}-${_t}`:dr},[y.getPrefixCls,e.prefixCls]),$t=v||y.iconPrefixCls||J9,Ht=n||y.csp;Aae($t,Ht);const sn=Fae(w,y.theme,{prefixCls:Mt("")}),$n={csp:Ht,autoInsertSpaceInButton:r,alert:s,anchor:i,locale:l||b,direction:u,space:d,splitter:h,virtual:f,popupMatchSelectWidth:g??m,popupOverflow:x,getPrefixCls:Mt,iconPrefixCls:$t,theme:sn,segmented:S,statistic:k,spin:C,calendar:j,carousel:R,cascader:E,collapse:T,typography:P,checkbox:O,descriptions:A,divider:F,drawer:B,skeleton:U,steps:L,image:D,input:de,textArea:Se,layout:I,list:V,mentions:H,modal:M,progress:G,result:X,slider:K,breadcrumb:te,menu:ce,pagination:J,empty:se,badge:ae,radio:Z,rate:fe,switch:xe,transfer:Te,avatar:Qe,message:ge,tag:Ce,table:De,card:Me,tabs:We,timeline:wt,timePicker:Nt,upload:ie,notification:le,tree:pe,colorPicker:Ke,datePicker:Ge,rangePicker:dt,flex:rn,wave:Ve,dropdown:en,warning:ye,tour:Oe,tooltip:ht,popover:jt,popconfirm:vn,floatButton:be,floatButtonGroup:ne,variant:Ae,inputNumber:nt,treeSelect:rt},Lt=Object.assign({},y);Object.keys($n).forEach(_t=>{$n[_t]!==void 0&&(Lt[_t]=$n[_t])}),hle.forEach(_t=>{const Kt=e[_t];Kt&&(Lt[_t]=Kt)}),typeof r<"u"&&(Lt.button=Object.assign({autoInsertSpace:r},Lt.button));const an=w9(()=>Lt,Lt,(_t,Kt)=>{const Zn=Object.keys(_t),dr=Object.keys(Kt);return Zn.length!==dr.length||Zn.some(nr=>_t[nr]!==Kt[nr])}),{layer:yn}=p.useContext(bw),bn=p.useMemo(()=>({prefixCls:$t,csp:Ht,layer:yn?"antd":void 0}),[$t,Ht,yn]);let Zt=p.createElement(p.Fragment,null,p.createElement(ule,{dropdownMatchSelectWidth:m}),t);const _e=p.useMemo(()=>{var _t,Kt,Zn,dr;return tae(((_t=Sw.Form)===null||_t===void 0?void 0:_t.defaultValidateMessages)||{},((Zn=(Kt=an.locale)===null||Kt===void 0?void 0:Kt.Form)===null||Zn===void 0?void 0:Zn.defaultValidateMessages)||{},((dr=an.form)===null||dr===void 0?void 0:dr.validateMessages)||{},(o==null?void 0:o.validateMessages)||{})},[an,o==null?void 0:o.validateMessages]);Object.keys(_e).length>0&&(Zt=p.createElement(rae.Provider,{value:_e},Zt)),l&&(Zt=p.createElement(oae,{locale:l,_ANT_MARK__:iae},Zt)),Zt=p.createElement(Qoe.Provider,{value:bn},Zt),c&&(Zt=p.createElement(Cae,{size:c},Zt)),Zt=p.createElement(cle,null,Zt);const ct=p.useMemo(()=>{const _t=sn||{},{algorithm:Kt,token:Zn,components:dr,cssVar:nr}=_t,eo=dle(_t,["algorithm","token","components","cssVar"]),Ca=Kt&&(!Array.isArray(Kt)||Kt.length>0)?vN(Kt):Z9,Gs={};Object.entries(dr||{}).forEach(([Na,ja])=>{const Ut=Object.assign({},ja);"algorithm"in Ut&&(Ut.algorithm===!0?Ut.theme=Ca:(Array.isArray(Ut.algorithm)||typeof Ut.algorithm=="function")&&(Ut.theme=vN(Ut.algorithm)),delete Ut.algorithm),Gs[Na]=Ut});const _i=Object.assign(Object.assign({},gg),Zn);return Object.assign(Object.assign({},eo),{theme:Ca,token:_i,components:Gs,override:Object.assign({override:_i},Gs),cssVar:nr})},[sn]);return w&&(Zt=p.createElement(Q9.Provider,{value:ct},Zt)),an.warning&&(Zt=p.createElement(nae.Provider,{value:an.warning},Zt)),_!==void 0&&(Zt=p.createElement(kae,{disabled:_},Zt)),p.createElement(kw.Provider,{value:an},Zt)},kf=e=>{const t=p.useContext(kw),n=p.useContext(K9);return p.createElement(gle,Object.assign({parentContext:t,legacyLocale:n},e))};kf.ConfigContext=kw;kf.SizeContext=xg;kf.config=mle;kf.useConfig=Nae;Object.defineProperty(kf,"SizeContext",{get:()=>xg});var p7={exports:{}};(function(e,t){(function(n,r){e.exports=r()})(Br,function(){var n=1e3,r=6e4,s=36e5,i="millisecond",o="second",l="minute",c="hour",u="day",d="week",h="month",f="quarter",m="year",g="date",x="Invalid Date",b=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,y=/\[([^\]]+)]|YYYY|YY|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,v={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(A){var F=["th","st","nd","rd"],B=A%100;return"["+A+(F[(B-20)%10]||F[B]||F[0])+"]"}},w=function(A,F,B){var U=String(A);return!U||U.length>=F?A:""+Array(F+1-U.length).join(B)+A},_={s:w,z:function(A){var F=-A.utcOffset(),B=Math.abs(F),U=Math.floor(B/60),L=B%60;return(F<=0?"+":"-")+w(U,2,"0")+":"+w(L,2,"0")},m:function A(F,B){if(F.date()<B.date())return-A(B,F);var U=12*(B.year()-F.year())+(B.month()-F.month()),L=F.clone().add(U,h),D=B-L<0,I=F.clone().add(U+(D?-1:1),h);return+(-(U+(B-L)/(D?L-I:I-L))||0)},a:function(A){return A<0?Math.ceil(A)||0:Math.floor(A)},p:function(A){return{M:h,y:m,w:d,d:u,D:g,h:c,m:l,s:o,ms:i,Q:f}[A]||String(A||"").toLowerCase().replace(/s$/,"")},u:function(A){return A===void 0}},S="en",k={};k[S]=v;var C="$isDayjsObject",j=function(A){return A instanceof P||!(!A||!A[C])},R=function A(F,B,U){var L;if(!F)return S;if(typeof F=="string"){var D=F.toLowerCase();k[D]&&(L=D),B&&(k[D]=B,L=D);var I=F.split("-");if(!L&&I.length>1)return A(I[0])}else{var V=F.name;k[V]=F,L=V}return!U&&L&&(S=L),L||!U&&S},E=function(A,F){if(j(A))return A.clone();var B=typeof F=="object"?F:{};return B.date=A,B.args=arguments,new P(B)},T=_;T.l=R,T.i=j,T.w=function(A,F){return E(A,{locale:F.$L,utc:F.$u,x:F.$x,$offset:F.$offset})};var P=function(){function A(B){this.$L=R(B.locale,null,!0),this.parse(B),this.$x=this.$x||B.x||{},this[C]=!0}var F=A.prototype;return F.parse=function(B){this.$d=function(U){var L=U.date,D=U.utc;if(L===null)return new Date(NaN);if(T.u(L))return new Date;if(L instanceof Date)return new Date(L);if(typeof L=="string"&&!/Z$/i.test(L)){var I=L.match(b);if(I){var V=I[2]-1||0,H=(I[7]||"0").substring(0,3);return D?new Date(Date.UTC(I[1],V,I[3]||1,I[4]||0,I[5]||0,I[6]||0,H)):new Date(I[1],V,I[3]||1,I[4]||0,I[5]||0,I[6]||0,H)}}return new Date(L)}(B),this.init()},F.init=function(){var B=this.$d;this.$y=B.getFullYear(),this.$M=B.getMonth(),this.$D=B.getDate(),this.$W=B.getDay(),this.$H=B.getHours(),this.$m=B.getMinutes(),this.$s=B.getSeconds(),this.$ms=B.getMilliseconds()},F.$utils=function(){return T},F.isValid=function(){return this.$d.toString()!==x},F.isSame=function(B,U){var L=E(B);return this.startOf(U)<=L&&L<=this.endOf(U)},F.isAfter=function(B,U){return E(B)<this.startOf(U)},F.isBefore=function(B,U){return this.endOf(U)<E(B)},F.$g=function(B,U,L){return T.u(B)?this[U]:this.set(L,B)},F.unix=function(){return Math.floor(this.valueOf()/1e3)},F.valueOf=function(){return this.$d.getTime()},F.startOf=function(B,U){var L=this,D=!!T.u(U)||U,I=T.p(B),V=function(J,de){var Se=T.w(L.$u?Date.UTC(L.$y,de,J):new Date(L.$y,de,J),L);return D?Se:Se.endOf(u)},H=function(J,de){return T.w(L.toDate()[J].apply(L.toDate("s"),(D?[0,0,0,0]:[23,59,59,999]).slice(de)),L)},M=this.$W,G=this.$M,X=this.$D,K="set"+(this.$u?"UTC":"");switch(I){case m:return D?V(1,0):V(31,11);case h:return D?V(1,G):V(0,G+1);case d:var te=this.$locale().weekStart||0,ce=(M<te?M+7:M)-te;return V(D?X-ce:X+(6-ce),G);case u:case g:return H(K+"Hours",0);case c:return H(K+"Minutes",1);case l:return H(K+"Seconds",2);case o:return H(K+"Milliseconds",3);default:return this.clone()}},F.endOf=function(B){return this.startOf(B,!1)},F.$set=function(B,U){var L,D=T.p(B),I="set"+(this.$u?"UTC":""),V=(L={},L[u]=I+"Date",L[g]=I+"Date",L[h]=I+"Month",L[m]=I+"FullYear",L[c]=I+"Hours",L[l]=I+"Minutes",L[o]=I+"Seconds",L[i]=I+"Milliseconds",L)[D],H=D===u?this.$D+(U-this.$W):U;if(D===h||D===m){var M=this.clone().set(g,1);M.$d[V](H),M.init(),this.$d=M.set(g,Math.min(this.$D,M.daysInMonth())).$d}else V&&this.$d[V](H);return this.init(),this},F.set=function(B,U){return this.clone().$set(B,U)},F.get=function(B){return this[T.p(B)]()},F.add=function(B,U){var L,D=this;B=Number(B);var I=T.p(U),V=function(G){var X=E(D);return T.w(X.date(X.date()+Math.round(G*B)),D)};if(I===h)return this.set(h,this.$M+B);if(I===m)return this.set(m,this.$y+B);if(I===u)return V(1);if(I===d)return V(7);var H=(L={},L[l]=r,L[c]=s,L[o]=n,L)[I]||1,M=this.$d.getTime()+B*H;return T.w(M,this)},F.subtract=function(B,U){return this.add(-1*B,U)},F.format=function(B){var U=this,L=this.$locale();if(!this.isValid())return L.invalidDate||x;var D=B||"YYYY-MM-DDTHH:mm:ssZ",I=T.z(this),V=this.$H,H=this.$m,M=this.$M,G=L.weekdays,X=L.months,K=L.meridiem,te=function(de,Se,se,ae){return de&&(de[Se]||de(U,D))||se[Se].slice(0,ae)},ce=function(de){return T.s(V%12||12,de,"0")},J=K||function(de,Se,se){var ae=de<12?"AM":"PM";return se?ae.toLowerCase():ae};return D.replace(y,function(de,Se){return Se||function(se){switch(se){case"YY":return String(U.$y).slice(-2);case"YYYY":return T.s(U.$y,4,"0");case"M":return M+1;case"MM":return T.s(M+1,2,"0");case"MMM":return te(L.monthsShort,M,X,3);case"MMMM":return te(X,M);case"D":return U.$D;case"DD":return T.s(U.$D,2,"0");case"d":return String(U.$W);case"dd":return te(L.weekdaysMin,U.$W,G,2);case"ddd":return te(L.weekdaysShort,U.$W,G,3);case"dddd":return G[U.$W];case"H":return String(V);case"HH":return T.s(V,2,"0");case"h":return ce(1);case"hh":return ce(2);case"a":return J(V,H,!0);case"A":return J(V,H,!1);case"m":return String(H);case"mm":return T.s(H,2,"0");case"s":return String(U.$s);case"ss":return T.s(U.$s,2,"0");case"SSS":return T.s(U.$ms,3,"0");case"Z":return I}return null}(de)||I.replace(":","")})},F.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},F.diff=function(B,U,L){var D,I=this,V=T.p(U),H=E(B),M=(H.utcOffset()-this.utcOffset())*r,G=this-H,X=function(){return T.m(I,H)};switch(V){case m:D=X()/12;break;case h:D=X();break;case f:D=X()/3;break;case d:D=(G-M)/6048e5;break;case u:D=(G-M)/864e5;break;case c:D=G/s;break;case l:D=G/r;break;case o:D=G/n;break;default:D=G}return L?D:T.a(D)},F.daysInMonth=function(){return this.endOf(h).$D},F.$locale=function(){return k[this.$L]},F.locale=function(B,U){if(!B)return this.$L;var L=this.clone(),D=R(B,U,!0);return D&&(L.$L=D),L},F.clone=function(){return T.w(this.$d,this)},F.toDate=function(){return new Date(this.valueOf())},F.toJSON=function(){return this.isValid()?this.toISOString():null},F.toISOString=function(){return this.$d.toISOString()},F.toString=function(){return this.$d.toUTCString()},A}(),O=P.prototype;return E.prototype=O,[["$ms",i],["$s",o],["$m",l],["$H",c],["$W",u],["$M",h],["$y",m],["$D",g]].forEach(function(A){O[A[1]]=function(F){return this.$g(F,A[0],A[1])}}),E.extend=function(A,F){return A.$i||(A(F,P,E),A.$i=!0),E},E.locale=R,E.isDayjs=j,E.unix=function(A){return E(1e3*A)},E.en=k[S],E.Ls=k,E.p={},E})})(p7);var xle=p7.exports;const WN=xn(xle);var m7={exports:{}};(function(e,t){(function(n,r){e.exports=r()})(Br,function(){return function(n,r,s){var i=r.prototype,o=function(h){return h&&(h.indexOf?h:h.s)},l=function(h,f,m,g,x){var b=h.name?h:h.$locale(),y=o(b[f]),v=o(b[m]),w=y||v.map(function(S){return S.slice(0,g)});if(!x)return w;var _=b.weekStart;return w.map(function(S,k){return w[(k+(_||0))%7]})},c=function(){return s.Ls[s.locale()]},u=function(h,f){return h.formats[f]||function(m){return m.replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,function(g,x,b){return x||b.slice(1)})}(h.formats[f.toUpperCase()])},d=function(){var h=this;return{months:function(f){return f?f.format("MMMM"):l(h,"months")},monthsShort:function(f){return f?f.format("MMM"):l(h,"monthsShort","months",3)},firstDayOfWeek:function(){return h.$locale().weekStart||0},weekdays:function(f){return f?f.format("dddd"):l(h,"weekdays")},weekdaysMin:function(f){return f?f.format("dd"):l(h,"weekdaysMin","weekdays",2)},weekdaysShort:function(f){return f?f.format("ddd"):l(h,"weekdaysShort","weekdays",3)},longDateFormat:function(f){return u(h.$locale(),f)},meridiem:this.$locale().meridiem,ordinal:this.$locale().ordinal}};i.localeData=function(){return d.bind(this)()},s.localeData=function(){var h=c();return{firstDayOfWeek:function(){return h.weekStart||0},weekdays:function(){return s.weekdays()},weekdaysShort:function(){return s.weekdaysShort()},weekdaysMin:function(){return s.weekdaysMin()},months:function(){return s.months()},monthsShort:function(){return s.monthsShort()},longDateFormat:function(f){return u(h,f)},meridiem:h.meridiem,ordinal:h.ordinal}},s.months=function(){return l(c(),"months")},s.monthsShort=function(){return l(c(),"monthsShort","months",3)},s.weekdays=function(h){return l(c(),"weekdays",null,null,h)},s.weekdaysShort=function(h){return l(c(),"weekdaysShort","weekdays",3,h)},s.weekdaysMin=function(h){return l(c(),"weekdaysMin","weekdays",2,h)}}})})(m7);var vle=m7.exports;const yle=xn(vle),Ni=(e,t)=>new Un(e).setA(t).toRgbString(),jd=(e,t)=>new Un(e).lighten(t).toHexString(),ble=e=>{const t=Fh(e,{theme:"dark"});return{1:t[0],2:t[1],3:t[2],4:t[3],5:t[6],6:t[5],7:t[4],8:t[6],9:t[5],10:t[4]}},wle=(e,t)=>{const n=e||"#000",r=t||"#fff";return{colorBgBase:n,colorTextBase:r,colorText:Ni(r,.85),colorTextSecondary:Ni(r,.65),colorTextTertiary:Ni(r,.45),colorTextQuaternary:Ni(r,.25),colorFill:Ni(r,.18),colorFillSecondary:Ni(r,.12),colorFillTertiary:Ni(r,.08),colorFillQuaternary:Ni(r,.04),colorBgSolid:Ni(r,.95),colorBgSolidHover:Ni(r,1),colorBgSolidActive:Ni(r,.9),colorBgElevated:jd(n,12),colorBgContainer:jd(n,8),colorBgLayout:jd(n,0),colorBgSpotlight:jd(n,26),colorBgBlur:Ni(r,.04),colorBorder:jd(n,26),colorBorderSecondary:jd(n,19)}},_le=(e,t)=>{const n=Object.keys(b5).map(i=>{const o=Fh(e[i],{theme:"dark"});return Array.from({length:10},()=>1).reduce((l,c,u)=>(l[`${i}-${u+1}`]=o[u],l[`${i}${u+1}`]=o[u],l),{})}).reduce((i,o)=>(i=Object.assign(Object.assign({},i),o),i),{}),r=t??w5(e),s=X9(e,{generateColorPalettes:ble,generateNeutralColorPalettes:wle});return Object.assign(Object.assign(Object.assign(Object.assign({},r),n),s),{colorPrimaryBg:s.colorPrimaryBorder,colorPrimaryBgHover:s.colorPrimaryBorderHover})},tO={defaultSeed:kb.token,defaultAlgorithm:w5,darkAlgorithm:_le};function Sle({children:e}){const t=cl(),[n,r]=p.useState(t.theme);return p.useEffect(()=>t.onThemeChange(r),[t]),a.jsx(kf,{theme:{algorithm:n.mode==="dark"?tO.darkAlgorithm:tO.defaultAlgorithm,token:{colorPrimary:n.colorPrimary,colorBgContainer:n.colorBgContainer,colorText:n.colorText,colorBorder:n.colorBorder}},children:e})}var Gt;(function(e){e.assertEqual=s=>{};function t(s){}e.assertIs=t;function n(s){throw new Error}e.assertNever=n,e.arrayToEnum=s=>{const i={};for(const o of s)i[o]=o;return i},e.getValidEnumValues=s=>{const i=e.objectKeys(s).filter(l=>typeof s[s[l]]!="number"),o={};for(const l of i)o[l]=s[l];return e.objectValues(o)},e.objectValues=s=>e.objectKeys(s).map(function(i){return s[i]}),e.objectKeys=typeof Object.keys=="function"?s=>Object.keys(s):s=>{const i=[];for(const o in s)Object.prototype.hasOwnProperty.call(s,o)&&i.push(o);return i},e.find=(s,i)=>{for(const o of s)if(i(o))return o},e.isInteger=typeof Number.isInteger=="function"?s=>Number.isInteger(s):s=>typeof s=="number"&&Number.isFinite(s)&&Math.floor(s)===s;function r(s,i=" | "){return s.map(o=>typeof o=="string"?`'${o}'`:o).join(i)}e.joinValues=r,e.jsonStringifyReplacer=(s,i)=>typeof i=="bigint"?i.toString():i})(Gt||(Gt={}));var nO;(function(e){e.mergeShapes=(t,n)=>({...t,...n})})(nO||(nO={}));const Xe=Gt.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Bl=e=>{switch(typeof e){case"undefined":return Xe.undefined;case"string":return Xe.string;case"number":return Number.isNaN(e)?Xe.nan:Xe.number;case"boolean":return Xe.boolean;case"function":return Xe.function;case"bigint":return Xe.bigint;case"symbol":return Xe.symbol;case"object":return Array.isArray(e)?Xe.array:e===null?Xe.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?Xe.promise:typeof Map<"u"&&e instanceof Map?Xe.map:typeof Set<"u"&&e instanceof Set?Xe.set:typeof Date<"u"&&e instanceof Date?Xe.date:Xe.object;default:return Xe.unknown}},ke=Gt.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class tl extends Error{get errors(){return this.issues}constructor(t){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};const n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=t}format(t){const n=t||function(i){return i.message},r={_errors:[]},s=i=>{for(const o of i.issues)if(o.code==="invalid_union")o.unionErrors.map(s);else if(o.code==="invalid_return_type")s(o.returnTypeError);else if(o.code==="invalid_arguments")s(o.argumentsError);else if(o.path.length===0)r._errors.push(n(o));else{let l=r,c=0;for(;c<o.path.length;){const u=o.path[c];c===o.path.length-1?(l[u]=l[u]||{_errors:[]},l[u]._errors.push(n(o))):l[u]=l[u]||{_errors:[]},l=l[u],c++}}};return s(this),r}static assert(t){if(!(t instanceof tl))throw new Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,Gt.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=n=>n.message){const n={},r=[];for(const s of this.issues)if(s.path.length>0){const i=s.path[0];n[i]=n[i]||[],n[i].push(t(s))}else r.push(t(s));return{formErrors:r,fieldErrors:n}}get formErrors(){return this.flatten()}}tl.create=e=>new tl(e);const VN=(e,t)=>{let n;switch(e.code){case ke.invalid_type:e.received===Xe.undefined?n="Required":n=`Expected ${e.expected}, received ${e.received}`;break;case ke.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,Gt.jsonStringifyReplacer)}`;break;case ke.unrecognized_keys:n=`Unrecognized key(s) in object: ${Gt.joinValues(e.keys,", ")}`;break;case ke.invalid_union:n="Invalid input";break;case ke.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${Gt.joinValues(e.options)}`;break;case ke.invalid_enum_value:n=`Invalid enum value. Expected ${Gt.joinValues(e.options)}, received '${e.received}'`;break;case ke.invalid_arguments:n="Invalid function arguments";break;case ke.invalid_return_type:n="Invalid function return type";break;case ke.invalid_date:n="Invalid date";break;case ke.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(n=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?n=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?n=`Invalid input: must end with "${e.validation.endsWith}"`:Gt.assertNever(e.validation):e.validation!=="regex"?n=`Invalid ${e.validation}`:n="Invalid";break;case ke.too_small:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="bigint"?n=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:n="Invalid input";break;case ke.too_big:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?n=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:n="Invalid input";break;case ke.custom:n="Invalid input";break;case ke.invalid_intersection_types:n="Intersection results could not be merged";break;case ke.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case ke.not_finite:n="Number must be finite";break;default:n=t.defaultError,Gt.assertNever(e)}return{message:n}};let kle=VN;function Cle(){return kle}const Nle=e=>{const{data:t,path:n,errorMaps:r,issueData:s}=e,i=[...n,...s.path||[]],o={...s,path:i};if(s.message!==void 0)return{...s,path:i,message:s.message};let l="";const c=r.filter(u=>!!u).slice().reverse();for(const u of c)l=u(o,{data:t,defaultError:l}).message;return{...s,path:i,message:l}};function Be(e,t){const n=Cle(),r=Nle({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,n,n===VN?void 0:VN].filter(s=>!!s)});e.common.issues.push(r)}class ys{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,n){const r=[];for(const s of n){if(s.status==="aborted")return gt;s.status==="dirty"&&t.dirty(),r.push(s.value)}return{status:t.value,value:r}}static async mergeObjectAsync(t,n){const r=[];for(const s of n){const i=await s.key,o=await s.value;r.push({key:i,value:o})}return ys.mergeObjectSync(t,r)}static mergeObjectSync(t,n){const r={};for(const s of n){const{key:i,value:o}=s;if(i.status==="aborted"||o.status==="aborted")return gt;i.status==="dirty"&&t.dirty(),o.status==="dirty"&&t.dirty(),i.value!=="__proto__"&&(typeof o.value<"u"||s.alwaysSet)&&(r[i.value]=o.value)}return{status:t.value,value:r}}}const gt=Object.freeze({status:"aborted"}),em=e=>({status:"dirty",value:e}),Xi=e=>({status:"valid",value:e}),rO=e=>e.status==="aborted",sO=e=>e.status==="dirty",zh=e=>e.status==="valid",Cb=e=>typeof Promise<"u"&&e instanceof Promise;var st;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t==null?void 0:t.message})(st||(st={}));class la{constructor(t,n,r,s){this._cachedPath=[],this.parent=t,this.data=n,this._path=r,this._key=s}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const iO=(e,t)=>{if(zh(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const n=new tl(e.common.issues);return this._error=n,this._error}}};function Ct(e){if(!e)return{};const{errorMap:t,invalid_type_error:n,required_error:r,description:s}=e;if(t&&(n||r))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:s}:{errorMap:(o,l)=>{const{message:c}=e;return o.code==="invalid_enum_value"?{message:c??l.defaultError}:typeof l.data>"u"?{message:c??r??l.defaultError}:o.code!=="invalid_type"?{message:l.defaultError}:{message:c??n??l.defaultError}},description:s}}class zt{get description(){return this._def.description}_getType(t){return Bl(t.data)}_getOrReturnCtx(t,n){return n||{common:t.parent.common,data:t.data,parsedType:Bl(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new ys,ctx:{common:t.parent.common,data:t.data,parsedType:Bl(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){const n=this._parse(t);if(Cb(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(t){const n=this._parse(t);return Promise.resolve(n)}parse(t,n){const r=this.safeParse(t,n);if(r.success)return r.data;throw r.error}safeParse(t,n){const r={common:{issues:[],async:(n==null?void 0:n.async)??!1,contextualErrorMap:n==null?void 0:n.errorMap},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Bl(t)},s=this._parseSync({data:t,path:r.path,parent:r});return iO(r,s)}"~validate"(t){var r,s;const n={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Bl(t)};if(!this["~standard"].async)try{const i=this._parseSync({data:t,path:[],parent:n});return zh(i)?{value:i.value}:{issues:n.common.issues}}catch(i){(s=(r=i==null?void 0:i.message)==null?void 0:r.toLowerCase())!=null&&s.includes("encountered")&&(this["~standard"].async=!0),n.common={issues:[],async:!0}}return this._parseAsync({data:t,path:[],parent:n}).then(i=>zh(i)?{value:i.value}:{issues:n.common.issues})}async parseAsync(t,n){const r=await this.safeParseAsync(t,n);if(r.success)return r.data;throw r.error}async safeParseAsync(t,n){const r={common:{issues:[],contextualErrorMap:n==null?void 0:n.errorMap,async:!0},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Bl(t)},s=this._parse({data:t,path:r.path,parent:r}),i=await(Cb(s)?s:Promise.resolve(s));return iO(r,i)}refine(t,n){const r=s=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(s):n;return this._refinement((s,i)=>{const o=t(s),l=()=>i.addIssue({code:ke.custom,...r(s)});return typeof Promise<"u"&&o instanceof Promise?o.then(c=>c?!0:(l(),!1)):o?!0:(l(),!1)})}refinement(t,n){return this._refinement((r,s)=>t(r)?!0:(s.addIssue(typeof n=="function"?n(r,s):n),!1))}_refinement(t){return new gc({schema:this,typeName:xt.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}constructor(t){this.spa=this.safeParseAsync,this._def=t,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:n=>this["~validate"](n)}}optional(){return Ga.create(this,this._def)}nullable(){return Iu.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return na.create(this)}promise(){return Rb.create(this,this._def)}or(t){return jb.create([this,t],this._def)}and(t){return Eb.create(this,t,this._def)}transform(t){return new gc({...Ct(this._def),schema:this,typeName:xt.ZodEffects,effect:{type:"transform",transform:t}})}default(t){const n=typeof t=="function"?t:()=>t;return new Mb({...Ct(this._def),innerType:this,defaultValue:n,typeName:xt.ZodDefault})}brand(){return new y7({typeName:xt.ZodBranded,type:this,...Ct(this._def)})}catch(t){const n=typeof t=="function"?t:()=>t;return new Pb({...Ct(this._def),innerType:this,catchValue:n,typeName:xt.ZodCatch})}describe(t){const n=this.constructor;return new n({...this._def,description:t})}pipe(t){return k5.create(this,t)}readonly(){return Ob.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const jle=/^c[^\s-]{8,}$/i,Ele=/^[0-9a-z]+$/,Ile=/^[0-9A-HJKMNP-TV-Z]{26}$/i,Tle=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,Rle=/^[a-z0-9_-]{21}$/i,Mle=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,Ple=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,Ole=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Dle="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let bk;const Ale=/^(?:(?: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])$/,$le=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,Lle=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,Ble=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Fle=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,zle=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,g7="((\\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])))",Hle=new RegExp(`^${g7}$`);function x7(e){let t="[0-5]\\d";e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision==null&&(t=`${t}(\\.\\d+)?`);const n=e.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${t})${n}`}function Ule(e){return new RegExp(`^${x7(e)}$`)}function Wle(e){let t=`${g7}T${x7(e)}`;const n=[];return n.push(e.local?"Z?":"Z"),e.offset&&n.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${n.join("|")})`,new RegExp(`^${t}$`)}function Vle(e,t){return!!((t==="v4"||!t)&&Ale.test(e)||(t==="v6"||!t)&&Lle.test(e))}function qle(e,t){if(!Mle.test(e))return!1;try{const[n]=e.split(".");if(!n)return!1;const r=n.replace(/-/g,"+").replace(/_/g,"/").padEnd(n.length+(4-n.length%4)%4,"="),s=JSON.parse(atob(r));return!(typeof s!="object"||s===null||"typ"in s&&(s==null?void 0:s.typ)!=="JWT"||!s.alg||t&&s.alg!==t)}catch{return!1}}function Kle(e,t){return!!((t==="v4"||!t)&&$le.test(e)||(t==="v6"||!t)&&Ble.test(e))}class Ua extends zt{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==Xe.string){const i=this._getOrReturnCtx(t);return Be(i,{code:ke.invalid_type,expected:Xe.string,received:i.parsedType}),gt}const r=new ys;let s;for(const i of this._def.checks)if(i.kind==="min")t.data.length<i.value&&(s=this._getOrReturnCtx(t,s),Be(s,{code:ke.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),r.dirty());else if(i.kind==="max")t.data.length>i.value&&(s=this._getOrReturnCtx(t,s),Be(s,{code:ke.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),r.dirty());else if(i.kind==="length"){const o=t.data.length>i.value,l=t.data.length<i.value;(o||l)&&(s=this._getOrReturnCtx(t,s),o?Be(s,{code:ke.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}):l&&Be(s,{code:ke.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}),r.dirty())}else if(i.kind==="email")Ole.test(t.data)||(s=this._getOrReturnCtx(t,s),Be(s,{validation:"email",code:ke.invalid_string,message:i.message}),r.dirty());else if(i.kind==="emoji")bk||(bk=new RegExp(Dle,"u")),bk.test(t.data)||(s=this._getOrReturnCtx(t,s),Be(s,{validation:"emoji",code:ke.invalid_string,message:i.message}),r.dirty());else if(i.kind==="uuid")Tle.test(t.data)||(s=this._getOrReturnCtx(t,s),Be(s,{validation:"uuid",code:ke.invalid_string,message:i.message}),r.dirty());else if(i.kind==="nanoid")Rle.test(t.data)||(s=this._getOrReturnCtx(t,s),Be(s,{validation:"nanoid",code:ke.invalid_string,message:i.message}),r.dirty());else if(i.kind==="cuid")jle.test(t.data)||(s=this._getOrReturnCtx(t,s),Be(s,{validation:"cuid",code:ke.invalid_string,message:i.message}),r.dirty());else if(i.kind==="cuid2")Ele.test(t.data)||(s=this._getOrReturnCtx(t,s),Be(s,{validation:"cuid2",code:ke.invalid_string,message:i.message}),r.dirty());else if(i.kind==="ulid")Ile.test(t.data)||(s=this._getOrReturnCtx(t,s),Be(s,{validation:"ulid",code:ke.invalid_string,message:i.message}),r.dirty());else if(i.kind==="url")try{new URL(t.data)}catch{s=this._getOrReturnCtx(t,s),Be(s,{validation:"url",code:ke.invalid_string,message:i.message}),r.dirty()}else i.kind==="regex"?(i.regex.lastIndex=0,i.regex.test(t.data)||(s=this._getOrReturnCtx(t,s),Be(s,{validation:"regex",code:ke.invalid_string,message:i.message}),r.dirty())):i.kind==="trim"?t.data=t.data.trim():i.kind==="includes"?t.data.includes(i.value,i.position)||(s=this._getOrReturnCtx(t,s),Be(s,{code:ke.invalid_string,validation:{includes:i.value,position:i.position},message:i.message}),r.dirty()):i.kind==="toLowerCase"?t.data=t.data.toLowerCase():i.kind==="toUpperCase"?t.data=t.data.toUpperCase():i.kind==="startsWith"?t.data.startsWith(i.value)||(s=this._getOrReturnCtx(t,s),Be(s,{code:ke.invalid_string,validation:{startsWith:i.value},message:i.message}),r.dirty()):i.kind==="endsWith"?t.data.endsWith(i.value)||(s=this._getOrReturnCtx(t,s),Be(s,{code:ke.invalid_string,validation:{endsWith:i.value},message:i.message}),r.dirty()):i.kind==="datetime"?Wle(i).test(t.data)||(s=this._getOrReturnCtx(t,s),Be(s,{code:ke.invalid_string,validation:"datetime",message:i.message}),r.dirty()):i.kind==="date"?Hle.test(t.data)||(s=this._getOrReturnCtx(t,s),Be(s,{code:ke.invalid_string,validation:"date",message:i.message}),r.dirty()):i.kind==="time"?Ule(i).test(t.data)||(s=this._getOrReturnCtx(t,s),Be(s,{code:ke.invalid_string,validation:"time",message:i.message}),r.dirty()):i.kind==="duration"?Ple.test(t.data)||(s=this._getOrReturnCtx(t,s),Be(s,{validation:"duration",code:ke.invalid_string,message:i.message}),r.dirty()):i.kind==="ip"?Vle(t.data,i.version)||(s=this._getOrReturnCtx(t,s),Be(s,{validation:"ip",code:ke.invalid_string,message:i.message}),r.dirty()):i.kind==="jwt"?qle(t.data,i.alg)||(s=this._getOrReturnCtx(t,s),Be(s,{validation:"jwt",code:ke.invalid_string,message:i.message}),r.dirty()):i.kind==="cidr"?Kle(t.data,i.version)||(s=this._getOrReturnCtx(t,s),Be(s,{validation:"cidr",code:ke.invalid_string,message:i.message}),r.dirty()):i.kind==="base64"?Fle.test(t.data)||(s=this._getOrReturnCtx(t,s),Be(s,{validation:"base64",code:ke.invalid_string,message:i.message}),r.dirty()):i.kind==="base64url"?zle.test(t.data)||(s=this._getOrReturnCtx(t,s),Be(s,{validation:"base64url",code:ke.invalid_string,message:i.message}),r.dirty()):Gt.assertNever(i);return{status:r.value,value:t.data}}_regex(t,n,r){return this.refinement(s=>t.test(s),{validation:n,code:ke.invalid_string,...st.errToObj(r)})}_addCheck(t){return new Ua({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...st.errToObj(t)})}url(t){return this._addCheck({kind:"url",...st.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...st.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...st.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...st.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...st.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...st.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...st.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...st.errToObj(t)})}base64url(t){return this._addCheck({kind:"base64url",...st.errToObj(t)})}jwt(t){return this._addCheck({kind:"jwt",...st.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...st.errToObj(t)})}cidr(t){return this._addCheck({kind:"cidr",...st.errToObj(t)})}datetime(t){return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:t}):this._addCheck({kind:"datetime",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,offset:(t==null?void 0:t.offset)??!1,local:(t==null?void 0:t.local)??!1,...st.errToObj(t==null?void 0:t.message)})}date(t){return this._addCheck({kind:"date",message:t})}time(t){return typeof t=="string"?this._addCheck({kind:"time",precision:null,message:t}):this._addCheck({kind:"time",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,...st.errToObj(t==null?void 0:t.message)})}duration(t){return this._addCheck({kind:"duration",...st.errToObj(t)})}regex(t,n){return this._addCheck({kind:"regex",regex:t,...st.errToObj(n)})}includes(t,n){return this._addCheck({kind:"includes",value:t,position:n==null?void 0:n.position,...st.errToObj(n==null?void 0:n.message)})}startsWith(t,n){return this._addCheck({kind:"startsWith",value:t,...st.errToObj(n)})}endsWith(t,n){return this._addCheck({kind:"endsWith",value:t,...st.errToObj(n)})}min(t,n){return this._addCheck({kind:"min",value:t,...st.errToObj(n)})}max(t,n){return this._addCheck({kind:"max",value:t,...st.errToObj(n)})}length(t,n){return this._addCheck({kind:"length",value:t,...st.errToObj(n)})}nonempty(t){return this.min(1,st.errToObj(t))}trim(){return new Ua({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Ua({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Ua({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(t=>t.kind==="datetime")}get isDate(){return!!this._def.checks.find(t=>t.kind==="date")}get isTime(){return!!this._def.checks.find(t=>t.kind==="time")}get isDuration(){return!!this._def.checks.find(t=>t.kind==="duration")}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find(t=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(t=>t.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(t=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find(t=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find(t=>t.kind==="ip")}get isCIDR(){return!!this._def.checks.find(t=>t.kind==="cidr")}get isBase64(){return!!this._def.checks.find(t=>t.kind==="base64")}get isBase64url(){return!!this._def.checks.find(t=>t.kind==="base64url")}get minLength(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxLength(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}}Ua.create=e=>new Ua({checks:[],typeName:xt.ZodString,coerce:(e==null?void 0:e.coerce)??!1,...Ct(e)});function Gle(e,t){const n=(e.toString().split(".")[1]||"").length,r=(t.toString().split(".")[1]||"").length,s=n>r?n:r,i=Number.parseInt(e.toFixed(s).replace(".","")),o=Number.parseInt(t.toFixed(s).replace(".",""));return i%o/10**s}class Hh extends zt{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==Xe.number){const i=this._getOrReturnCtx(t);return Be(i,{code:ke.invalid_type,expected:Xe.number,received:i.parsedType}),gt}let r;const s=new ys;for(const i of this._def.checks)i.kind==="int"?Gt.isInteger(t.data)||(r=this._getOrReturnCtx(t,r),Be(r,{code:ke.invalid_type,expected:"integer",received:"float",message:i.message}),s.dirty()):i.kind==="min"?(i.inclusive?t.data<i.value:t.data<=i.value)&&(r=this._getOrReturnCtx(t,r),Be(r,{code:ke.too_small,minimum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),s.dirty()):i.kind==="max"?(i.inclusive?t.data>i.value:t.data>=i.value)&&(r=this._getOrReturnCtx(t,r),Be(r,{code:ke.too_big,maximum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),s.dirty()):i.kind==="multipleOf"?Gle(t.data,i.value)!==0&&(r=this._getOrReturnCtx(t,r),Be(r,{code:ke.not_multiple_of,multipleOf:i.value,message:i.message}),s.dirty()):i.kind==="finite"?Number.isFinite(t.data)||(r=this._getOrReturnCtx(t,r),Be(r,{code:ke.not_finite,message:i.message}),s.dirty()):Gt.assertNever(i);return{status:s.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,st.toString(n))}gt(t,n){return this.setLimit("min",t,!1,st.toString(n))}lte(t,n){return this.setLimit("max",t,!0,st.toString(n))}lt(t,n){return this.setLimit("max",t,!1,st.toString(n))}setLimit(t,n,r,s){return new Hh({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:st.toString(s)}]})}_addCheck(t){return new Hh({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:st.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:st.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:st.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:st.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:st.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:st.toString(n)})}finite(t){return this._addCheck({kind:"finite",message:st.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:st.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:st.toString(t)})}get minValue(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}get isInt(){return!!this._def.checks.find(t=>t.kind==="int"||t.kind==="multipleOf"&&Gt.isInteger(t.value))}get isFinite(){let t=null,n=null;for(const r of this._def.checks){if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;r.kind==="min"?(n===null||r.value>n)&&(n=r.value):r.kind==="max"&&(t===null||r.value<t)&&(t=r.value)}return Number.isFinite(n)&&Number.isFinite(t)}}Hh.create=e=>new Hh({checks:[],typeName:xt.ZodNumber,coerce:(e==null?void 0:e.coerce)||!1,...Ct(e)});class vg extends zt{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce)try{t.data=BigInt(t.data)}catch{return this._getInvalidInput(t)}if(this._getType(t)!==Xe.bigint)return this._getInvalidInput(t);let r;const s=new ys;for(const i of this._def.checks)i.kind==="min"?(i.inclusive?t.data<i.value:t.data<=i.value)&&(r=this._getOrReturnCtx(t,r),Be(r,{code:ke.too_small,type:"bigint",minimum:i.value,inclusive:i.inclusive,message:i.message}),s.dirty()):i.kind==="max"?(i.inclusive?t.data>i.value:t.data>=i.value)&&(r=this._getOrReturnCtx(t,r),Be(r,{code:ke.too_big,type:"bigint",maximum:i.value,inclusive:i.inclusive,message:i.message}),s.dirty()):i.kind==="multipleOf"?t.data%i.value!==BigInt(0)&&(r=this._getOrReturnCtx(t,r),Be(r,{code:ke.not_multiple_of,multipleOf:i.value,message:i.message}),s.dirty()):Gt.assertNever(i);return{status:s.value,value:t.data}}_getInvalidInput(t){const n=this._getOrReturnCtx(t);return Be(n,{code:ke.invalid_type,expected:Xe.bigint,received:n.parsedType}),gt}gte(t,n){return this.setLimit("min",t,!0,st.toString(n))}gt(t,n){return this.setLimit("min",t,!1,st.toString(n))}lte(t,n){return this.setLimit("max",t,!0,st.toString(n))}lt(t,n){return this.setLimit("max",t,!1,st.toString(n))}setLimit(t,n,r,s){return new vg({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:st.toString(s)}]})}_addCheck(t){return new vg({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:st.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:st.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:st.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:st.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:st.toString(n)})}get minValue(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}}vg.create=e=>new vg({checks:[],typeName:xt.ZodBigInt,coerce:(e==null?void 0:e.coerce)??!1,...Ct(e)});class qN extends zt{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==Xe.boolean){const r=this._getOrReturnCtx(t);return Be(r,{code:ke.invalid_type,expected:Xe.boolean,received:r.parsedType}),gt}return Xi(t.data)}}qN.create=e=>new qN({typeName:xt.ZodBoolean,coerce:(e==null?void 0:e.coerce)||!1,...Ct(e)});class Nb extends zt{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==Xe.date){const i=this._getOrReturnCtx(t);return Be(i,{code:ke.invalid_type,expected:Xe.date,received:i.parsedType}),gt}if(Number.isNaN(t.data.getTime())){const i=this._getOrReturnCtx(t);return Be(i,{code:ke.invalid_date}),gt}const r=new ys;let s;for(const i of this._def.checks)i.kind==="min"?t.data.getTime()<i.value&&(s=this._getOrReturnCtx(t,s),Be(s,{code:ke.too_small,message:i.message,inclusive:!0,exact:!1,minimum:i.value,type:"date"}),r.dirty()):i.kind==="max"?t.data.getTime()>i.value&&(s=this._getOrReturnCtx(t,s),Be(s,{code:ke.too_big,message:i.message,inclusive:!0,exact:!1,maximum:i.value,type:"date"}),r.dirty()):Gt.assertNever(i);return{status:r.value,value:new Date(t.data.getTime())}}_addCheck(t){return new Nb({...this._def,checks:[...this._def.checks,t]})}min(t,n){return this._addCheck({kind:"min",value:t.getTime(),message:st.toString(n)})}max(t,n){return this._addCheck({kind:"max",value:t.getTime(),message:st.toString(n)})}get minDate(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t!=null?new Date(t):null}}Nb.create=e=>new Nb({checks:[],coerce:(e==null?void 0:e.coerce)||!1,typeName:xt.ZodDate,...Ct(e)});class oO extends zt{_parse(t){if(this._getType(t)!==Xe.symbol){const r=this._getOrReturnCtx(t);return Be(r,{code:ke.invalid_type,expected:Xe.symbol,received:r.parsedType}),gt}return Xi(t.data)}}oO.create=e=>new oO({typeName:xt.ZodSymbol,...Ct(e)});class KN extends zt{_parse(t){if(this._getType(t)!==Xe.undefined){const r=this._getOrReturnCtx(t);return Be(r,{code:ke.invalid_type,expected:Xe.undefined,received:r.parsedType}),gt}return Xi(t.data)}}KN.create=e=>new KN({typeName:xt.ZodUndefined,...Ct(e)});class GN extends zt{_parse(t){if(this._getType(t)!==Xe.null){const r=this._getOrReturnCtx(t);return Be(r,{code:ke.invalid_type,expected:Xe.null,received:r.parsedType}),gt}return Xi(t.data)}}GN.create=e=>new GN({typeName:xt.ZodNull,...Ct(e)});class aO extends zt{constructor(){super(...arguments),this._any=!0}_parse(t){return Xi(t.data)}}aO.create=e=>new aO({typeName:xt.ZodAny,...Ct(e)});class YN extends zt{constructor(){super(...arguments),this._unknown=!0}_parse(t){return Xi(t.data)}}YN.create=e=>new YN({typeName:xt.ZodUnknown,...Ct(e)});class mc extends zt{_parse(t){const n=this._getOrReturnCtx(t);return Be(n,{code:ke.invalid_type,expected:Xe.never,received:n.parsedType}),gt}}mc.create=e=>new mc({typeName:xt.ZodNever,...Ct(e)});class lO extends zt{_parse(t){if(this._getType(t)!==Xe.undefined){const r=this._getOrReturnCtx(t);return Be(r,{code:ke.invalid_type,expected:Xe.void,received:r.parsedType}),gt}return Xi(t.data)}}lO.create=e=>new lO({typeName:xt.ZodVoid,...Ct(e)});class na extends zt{_parse(t){const{ctx:n,status:r}=this._processInputParams(t),s=this._def;if(n.parsedType!==Xe.array)return Be(n,{code:ke.invalid_type,expected:Xe.array,received:n.parsedType}),gt;if(s.exactLength!==null){const o=n.data.length>s.exactLength.value,l=n.data.length<s.exactLength.value;(o||l)&&(Be(n,{code:o?ke.too_big:ke.too_small,minimum:l?s.exactLength.value:void 0,maximum:o?s.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:s.exactLength.message}),r.dirty())}if(s.minLength!==null&&n.data.length<s.minLength.value&&(Be(n,{code:ke.too_small,minimum:s.minLength.value,type:"array",inclusive:!0,exact:!1,message:s.minLength.message}),r.dirty()),s.maxLength!==null&&n.data.length>s.maxLength.value&&(Be(n,{code:ke.too_big,maximum:s.maxLength.value,type:"array",inclusive:!0,exact:!1,message:s.maxLength.message}),r.dirty()),n.common.async)return Promise.all([...n.data].map((o,l)=>s.type._parseAsync(new la(n,o,n.path,l)))).then(o=>ys.mergeArray(r,o));const i=[...n.data].map((o,l)=>s.type._parseSync(new la(n,o,n.path,l)));return ys.mergeArray(r,i)}get element(){return this._def.type}min(t,n){return new na({...this._def,minLength:{value:t,message:st.toString(n)}})}max(t,n){return new na({...this._def,maxLength:{value:t,message:st.toString(n)}})}length(t,n){return new na({...this._def,exactLength:{value:t,message:st.toString(n)}})}nonempty(t){return this.min(1,t)}}na.create=(e,t)=>new na({type:e,minLength:null,maxLength:null,exactLength:null,typeName:xt.ZodArray,...Ct(t)});function Vd(e){if(e instanceof ir){const t={};for(const n in e.shape){const r=e.shape[n];t[n]=Ga.create(Vd(r))}return new ir({...e._def,shape:()=>t})}else return e instanceof na?new na({...e._def,type:Vd(e.element)}):e instanceof Ga?Ga.create(Vd(e.unwrap())):e instanceof Iu?Iu.create(Vd(e.unwrap())):e instanceof ju?ju.create(e.items.map(t=>Vd(t))):e}class ir extends zt{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const t=this._def.shape(),n=Gt.objectKeys(t);return this._cached={shape:t,keys:n},this._cached}_parse(t){if(this._getType(t)!==Xe.object){const u=this._getOrReturnCtx(t);return Be(u,{code:ke.invalid_type,expected:Xe.object,received:u.parsedType}),gt}const{status:r,ctx:s}=this._processInputParams(t),{shape:i,keys:o}=this._getCached(),l=[];if(!(this._def.catchall instanceof mc&&this._def.unknownKeys==="strip"))for(const u in s.data)o.includes(u)||l.push(u);const c=[];for(const u of o){const d=i[u],h=s.data[u];c.push({key:{status:"valid",value:u},value:d._parse(new la(s,h,s.path,u)),alwaysSet:u in s.data})}if(this._def.catchall instanceof mc){const u=this._def.unknownKeys;if(u==="passthrough")for(const d of l)c.push({key:{status:"valid",value:d},value:{status:"valid",value:s.data[d]}});else if(u==="strict")l.length>0&&(Be(s,{code:ke.unrecognized_keys,keys:l}),r.dirty());else if(u!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const u=this._def.catchall;for(const d of l){const h=s.data[d];c.push({key:{status:"valid",value:d},value:u._parse(new la(s,h,s.path,d)),alwaysSet:d in s.data})}}return s.common.async?Promise.resolve().then(async()=>{const u=[];for(const d of c){const h=await d.key,f=await d.value;u.push({key:h,value:f,alwaysSet:d.alwaysSet})}return u}).then(u=>ys.mergeObjectSync(r,u)):ys.mergeObjectSync(r,c)}get shape(){return this._def.shape()}strict(t){return st.errToObj,new ir({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(n,r)=>{var i,o;const s=((o=(i=this._def).errorMap)==null?void 0:o.call(i,n,r).message)??r.defaultError;return n.code==="unrecognized_keys"?{message:st.errToObj(t).message??s}:{message:s}}}:{}})}strip(){return new ir({...this._def,unknownKeys:"strip"})}passthrough(){return new ir({...this._def,unknownKeys:"passthrough"})}extend(t){return new ir({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new ir({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:xt.ZodObject})}setKey(t,n){return this.augment({[t]:n})}catchall(t){return new ir({...this._def,catchall:t})}pick(t){const n={};for(const r of Gt.objectKeys(t))t[r]&&this.shape[r]&&(n[r]=this.shape[r]);return new ir({...this._def,shape:()=>n})}omit(t){const n={};for(const r of Gt.objectKeys(this.shape))t[r]||(n[r]=this.shape[r]);return new ir({...this._def,shape:()=>n})}deepPartial(){return Vd(this)}partial(t){const n={};for(const r of Gt.objectKeys(this.shape)){const s=this.shape[r];t&&!t[r]?n[r]=s:n[r]=s.optional()}return new ir({...this._def,shape:()=>n})}required(t){const n={};for(const r of Gt.objectKeys(this.shape))if(t&&!t[r])n[r]=this.shape[r];else{let i=this.shape[r];for(;i instanceof Ga;)i=i._def.innerType;n[r]=i}return new ir({...this._def,shape:()=>n})}keyof(){return v7(Gt.objectKeys(this.shape))}}ir.create=(e,t)=>new ir({shape:()=>e,unknownKeys:"strip",catchall:mc.create(),typeName:xt.ZodObject,...Ct(t)});ir.strictCreate=(e,t)=>new ir({shape:()=>e,unknownKeys:"strict",catchall:mc.create(),typeName:xt.ZodObject,...Ct(t)});ir.lazycreate=(e,t)=>new ir({shape:e,unknownKeys:"strip",catchall:mc.create(),typeName:xt.ZodObject,...Ct(t)});class jb extends zt{_parse(t){const{ctx:n}=this._processInputParams(t),r=this._def.options;function s(i){for(const l of i)if(l.result.status==="valid")return l.result;for(const l of i)if(l.result.status==="dirty")return n.common.issues.push(...l.ctx.common.issues),l.result;const o=i.map(l=>new tl(l.ctx.common.issues));return Be(n,{code:ke.invalid_union,unionErrors:o}),gt}if(n.common.async)return Promise.all(r.map(async i=>{const o={...n,common:{...n.common,issues:[]},parent:null};return{result:await i._parseAsync({data:n.data,path:n.path,parent:o}),ctx:o}})).then(s);{let i;const o=[];for(const c of r){const u={...n,common:{...n.common,issues:[]},parent:null},d=c._parseSync({data:n.data,path:n.path,parent:u});if(d.status==="valid")return d;d.status==="dirty"&&!i&&(i={result:d,ctx:u}),u.common.issues.length&&o.push(u.common.issues)}if(i)return n.common.issues.push(...i.ctx.common.issues),i.result;const l=o.map(c=>new tl(c));return Be(n,{code:ke.invalid_union,unionErrors:l}),gt}}get options(){return this._def.options}}jb.create=(e,t)=>new jb({options:e,typeName:xt.ZodUnion,...Ct(t)});const La=e=>e instanceof ZN?La(e.schema):e instanceof gc?La(e.innerType()):e instanceof Tb?[e.value]:e instanceof Eu?e.options:e instanceof QN?Gt.objectValues(e.enum):e instanceof Mb?La(e._def.innerType):e instanceof KN?[void 0]:e instanceof GN?[null]:e instanceof Ga?[void 0,...La(e.unwrap())]:e instanceof Iu?[null,...La(e.unwrap())]:e instanceof y7||e instanceof Ob?La(e.unwrap()):e instanceof Pb?La(e._def.innerType):[];class S5 extends zt{_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==Xe.object)return Be(n,{code:ke.invalid_type,expected:Xe.object,received:n.parsedType}),gt;const r=this.discriminator,s=n.data[r],i=this.optionsMap.get(s);return i?n.common.async?i._parseAsync({data:n.data,path:n.path,parent:n}):i._parseSync({data:n.data,path:n.path,parent:n}):(Be(n,{code:ke.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),gt)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,n,r){const s=new Map;for(const i of n){const o=La(i.shape[t]);if(!o.length)throw new Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(const l of o){if(s.has(l))throw new Error(`Discriminator property ${String(t)} has duplicate value ${String(l)}`);s.set(l,i)}}return new S5({typeName:xt.ZodDiscriminatedUnion,discriminator:t,options:n,optionsMap:s,...Ct(r)})}}function XN(e,t){const n=Bl(e),r=Bl(t);if(e===t)return{valid:!0,data:e};if(n===Xe.object&&r===Xe.object){const s=Gt.objectKeys(t),i=Gt.objectKeys(e).filter(l=>s.indexOf(l)!==-1),o={...e,...t};for(const l of i){const c=XN(e[l],t[l]);if(!c.valid)return{valid:!1};o[l]=c.data}return{valid:!0,data:o}}else if(n===Xe.array&&r===Xe.array){if(e.length!==t.length)return{valid:!1};const s=[];for(let i=0;i<e.length;i++){const o=e[i],l=t[i],c=XN(o,l);if(!c.valid)return{valid:!1};s.push(c.data)}return{valid:!0,data:s}}else return n===Xe.date&&r===Xe.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}class Eb extends zt{_parse(t){const{status:n,ctx:r}=this._processInputParams(t),s=(i,o)=>{if(rO(i)||rO(o))return gt;const l=XN(i.value,o.value);return l.valid?((sO(i)||sO(o))&&n.dirty(),{status:n.value,value:l.data}):(Be(r,{code:ke.invalid_intersection_types}),gt)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([i,o])=>s(i,o)):s(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}}Eb.create=(e,t,n)=>new Eb({left:e,right:t,typeName:xt.ZodIntersection,...Ct(n)});class ju extends zt{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==Xe.array)return Be(r,{code:ke.invalid_type,expected:Xe.array,received:r.parsedType}),gt;if(r.data.length<this._def.items.length)return Be(r,{code:ke.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),gt;!this._def.rest&&r.data.length>this._def.items.length&&(Be(r,{code:ke.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());const i=[...r.data].map((o,l)=>{const c=this._def.items[l]||this._def.rest;return c?c._parse(new la(r,o,r.path,l)):null}).filter(o=>!!o);return r.common.async?Promise.all(i).then(o=>ys.mergeArray(n,o)):ys.mergeArray(n,i)}get items(){return this._def.items}rest(t){return new ju({...this._def,rest:t})}}ju.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new ju({items:e,typeName:xt.ZodTuple,rest:null,...Ct(t)})};class Ib extends zt{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==Xe.object)return Be(r,{code:ke.invalid_type,expected:Xe.object,received:r.parsedType}),gt;const s=[],i=this._def.keyType,o=this._def.valueType;for(const l in r.data)s.push({key:i._parse(new la(r,l,r.path,l)),value:o._parse(new la(r,r.data[l],r.path,l)),alwaysSet:l in r.data});return r.common.async?ys.mergeObjectAsync(n,s):ys.mergeObjectSync(n,s)}get element(){return this._def.valueType}static create(t,n,r){return n instanceof zt?new Ib({keyType:t,valueType:n,typeName:xt.ZodRecord,...Ct(r)}):new Ib({keyType:Ua.create(),valueType:t,typeName:xt.ZodRecord,...Ct(n)})}}class cO extends zt{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==Xe.map)return Be(r,{code:ke.invalid_type,expected:Xe.map,received:r.parsedType}),gt;const s=this._def.keyType,i=this._def.valueType,o=[...r.data.entries()].map(([l,c],u)=>({key:s._parse(new la(r,l,r.path,[u,"key"])),value:i._parse(new la(r,c,r.path,[u,"value"]))}));if(r.common.async){const l=new Map;return Promise.resolve().then(async()=>{for(const c of o){const u=await c.key,d=await c.value;if(u.status==="aborted"||d.status==="aborted")return gt;(u.status==="dirty"||d.status==="dirty")&&n.dirty(),l.set(u.value,d.value)}return{status:n.value,value:l}})}else{const l=new Map;for(const c of o){const u=c.key,d=c.value;if(u.status==="aborted"||d.status==="aborted")return gt;(u.status==="dirty"||d.status==="dirty")&&n.dirty(),l.set(u.value,d.value)}return{status:n.value,value:l}}}}cO.create=(e,t,n)=>new cO({valueType:t,keyType:e,typeName:xt.ZodMap,...Ct(n)});class yg extends zt{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==Xe.set)return Be(r,{code:ke.invalid_type,expected:Xe.set,received:r.parsedType}),gt;const s=this._def;s.minSize!==null&&r.data.size<s.minSize.value&&(Be(r,{code:ke.too_small,minimum:s.minSize.value,type:"set",inclusive:!0,exact:!1,message:s.minSize.message}),n.dirty()),s.maxSize!==null&&r.data.size>s.maxSize.value&&(Be(r,{code:ke.too_big,maximum:s.maxSize.value,type:"set",inclusive:!0,exact:!1,message:s.maxSize.message}),n.dirty());const i=this._def.valueType;function o(c){const u=new Set;for(const d of c){if(d.status==="aborted")return gt;d.status==="dirty"&&n.dirty(),u.add(d.value)}return{status:n.value,value:u}}const l=[...r.data.values()].map((c,u)=>i._parse(new la(r,c,r.path,u)));return r.common.async?Promise.all(l).then(c=>o(c)):o(l)}min(t,n){return new yg({...this._def,minSize:{value:t,message:st.toString(n)}})}max(t,n){return new yg({...this._def,maxSize:{value:t,message:st.toString(n)}})}size(t,n){return this.min(t,n).max(t,n)}nonempty(t){return this.min(1,t)}}yg.create=(e,t)=>new yg({valueType:e,minSize:null,maxSize:null,typeName:xt.ZodSet,...Ct(t)});class ZN extends zt{get schema(){return this._def.getter()}_parse(t){const{ctx:n}=this._processInputParams(t);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}}ZN.create=(e,t)=>new ZN({getter:e,typeName:xt.ZodLazy,...Ct(t)});class Tb extends zt{_parse(t){if(t.data!==this._def.value){const n=this._getOrReturnCtx(t);return Be(n,{received:n.data,code:ke.invalid_literal,expected:this._def.value}),gt}return{status:"valid",value:t.data}}get value(){return this._def.value}}Tb.create=(e,t)=>new Tb({value:e,typeName:xt.ZodLiteral,...Ct(t)});function v7(e,t){return new Eu({values:e,typeName:xt.ZodEnum,...Ct(t)})}class Eu extends zt{_parse(t){if(typeof t.data!="string"){const n=this._getOrReturnCtx(t),r=this._def.values;return Be(n,{expected:Gt.joinValues(r),received:n.parsedType,code:ke.invalid_type}),gt}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(t.data)){const n=this._getOrReturnCtx(t),r=this._def.values;return Be(n,{received:n.data,code:ke.invalid_enum_value,options:r}),gt}return Xi(t.data)}get options(){return this._def.values}get enum(){const t={};for(const n of this._def.values)t[n]=n;return t}get Values(){const t={};for(const n of this._def.values)t[n]=n;return t}get Enum(){const t={};for(const n of this._def.values)t[n]=n;return t}extract(t,n=this._def){return Eu.create(t,{...this._def,...n})}exclude(t,n=this._def){return Eu.create(this.options.filter(r=>!t.includes(r)),{...this._def,...n})}}Eu.create=v7;class QN extends zt{_parse(t){const n=Gt.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(t);if(r.parsedType!==Xe.string&&r.parsedType!==Xe.number){const s=Gt.objectValues(n);return Be(r,{expected:Gt.joinValues(s),received:r.parsedType,code:ke.invalid_type}),gt}if(this._cache||(this._cache=new Set(Gt.getValidEnumValues(this._def.values))),!this._cache.has(t.data)){const s=Gt.objectValues(n);return Be(r,{received:r.data,code:ke.invalid_enum_value,options:s}),gt}return Xi(t.data)}get enum(){return this._def.values}}QN.create=(e,t)=>new QN({values:e,typeName:xt.ZodNativeEnum,...Ct(t)});class Rb extends zt{unwrap(){return this._def.type}_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==Xe.promise&&n.common.async===!1)return Be(n,{code:ke.invalid_type,expected:Xe.promise,received:n.parsedType}),gt;const r=n.parsedType===Xe.promise?n.data:Promise.resolve(n.data);return Xi(r.then(s=>this._def.type.parseAsync(s,{path:n.path,errorMap:n.common.contextualErrorMap})))}}Rb.create=(e,t)=>new Rb({type:e,typeName:xt.ZodPromise,...Ct(t)});class gc extends zt{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===xt.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){const{status:n,ctx:r}=this._processInputParams(t),s=this._def.effect||null,i={addIssue:o=>{Be(r,o),o.fatal?n.abort():n.dirty()},get path(){return r.path}};if(i.addIssue=i.addIssue.bind(i),s.type==="preprocess"){const o=s.transform(r.data,i);if(r.common.async)return Promise.resolve(o).then(async l=>{if(n.value==="aborted")return gt;const c=await this._def.schema._parseAsync({data:l,path:r.path,parent:r});return c.status==="aborted"?gt:c.status==="dirty"||n.value==="dirty"?em(c.value):c});{if(n.value==="aborted")return gt;const l=this._def.schema._parseSync({data:o,path:r.path,parent:r});return l.status==="aborted"?gt:l.status==="dirty"||n.value==="dirty"?em(l.value):l}}if(s.type==="refinement"){const o=l=>{const c=s.refinement(l,i);if(r.common.async)return Promise.resolve(c);if(c instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return l};if(r.common.async===!1){const l=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return l.status==="aborted"?gt:(l.status==="dirty"&&n.dirty(),o(l.value),{status:n.value,value:l.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(l=>l.status==="aborted"?gt:(l.status==="dirty"&&n.dirty(),o(l.value).then(()=>({status:n.value,value:l.value}))))}if(s.type==="transform")if(r.common.async===!1){const o=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!zh(o))return gt;const l=s.transform(o.value,i);if(l instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:l}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(o=>zh(o)?Promise.resolve(s.transform(o.value,i)).then(l=>({status:n.value,value:l})):gt);Gt.assertNever(s)}}gc.create=(e,t,n)=>new gc({schema:e,typeName:xt.ZodEffects,effect:t,...Ct(n)});gc.createWithPreprocess=(e,t,n)=>new gc({schema:t,effect:{type:"preprocess",transform:e},typeName:xt.ZodEffects,...Ct(n)});class Ga extends zt{_parse(t){return this._getType(t)===Xe.undefined?Xi(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}Ga.create=(e,t)=>new Ga({innerType:e,typeName:xt.ZodOptional,...Ct(t)});class Iu extends zt{_parse(t){return this._getType(t)===Xe.null?Xi(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}Iu.create=(e,t)=>new Iu({innerType:e,typeName:xt.ZodNullable,...Ct(t)});class Mb extends zt{_parse(t){const{ctx:n}=this._processInputParams(t);let r=n.data;return n.parsedType===Xe.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:n.path,parent:n})}removeDefault(){return this._def.innerType}}Mb.create=(e,t)=>new Mb({innerType:e,typeName:xt.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...Ct(t)});class Pb extends zt{_parse(t){const{ctx:n}=this._processInputParams(t),r={...n,common:{...n.common,issues:[]}},s=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return Cb(s)?s.then(i=>({status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new tl(r.common.issues)},input:r.data})})):{status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new tl(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}Pb.create=(e,t)=>new Pb({innerType:e,typeName:xt.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...Ct(t)});class uO extends zt{_parse(t){if(this._getType(t)!==Xe.nan){const r=this._getOrReturnCtx(t);return Be(r,{code:ke.invalid_type,expected:Xe.nan,received:r.parsedType}),gt}return{status:"valid",value:t.data}}}uO.create=e=>new uO({typeName:xt.ZodNaN,...Ct(e)});class y7 extends zt{_parse(t){const{ctx:n}=this._processInputParams(t),r=n.data;return this._def.type._parse({data:r,path:n.path,parent:n})}unwrap(){return this._def.type}}class k5 extends zt{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.common.async)return(async()=>{const i=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return i.status==="aborted"?gt:i.status==="dirty"?(n.dirty(),em(i.value)):this._def.out._parseAsync({data:i.value,path:r.path,parent:r})})();{const s=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return s.status==="aborted"?gt:s.status==="dirty"?(n.dirty(),{status:"dirty",value:s.value}):this._def.out._parseSync({data:s.value,path:r.path,parent:r})}}static create(t,n){return new k5({in:t,out:n,typeName:xt.ZodPipeline})}}class Ob extends zt{_parse(t){const n=this._def.innerType._parse(t),r=s=>(zh(s)&&(s.value=Object.freeze(s.value)),s);return Cb(n)?n.then(s=>r(s)):r(n)}unwrap(){return this._def.innerType}}Ob.create=(e,t)=>new Ob({innerType:e,typeName:xt.ZodReadonly,...Ct(t)});var xt;(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"})(xt||(xt={}));const N=Ua.create,Q=Hh.create,Re=qN.create,Ya=YN.create;mc.create;const ve=na.create,z=ir.create,Yle=jb.create,Fs=S5.create;Eb.create;ju.create;const Zi=Ib.create,he=Tb.create,et=Eu.create;Rb.create;Ga.create;Iu.create;const Xle=gc.createWithPreprocess,Zle=["head","index"],b7=N().regex(/^[A-Za-z0-9][A-Za-z0-9-]{0,127}$/),Db=N().regex(/^[1-9][0-9]*$/),Ab=N().regex(/^[A-Za-z0-9_.-]+$/),bg=N().min(1).max(255).refine(e=>!e.startsWith("-")&&e!=="HEAD"&&!e.startsWith("/")&&!e.endsWith("/")&&!e.endsWith(".")&&!/[\s~^:?*\[\\\x00-\x1f\x7f]/.test(e)&&!e.includes("..")&&!e.includes("@{")&&!e.includes("//")&&e.split("/").every(t=>!t.startsWith(".")&&!t.endsWith(".lock")),"Invalid Git branch"),C5=N().min(1).max(4096).refine(e=>!e.startsWith("/")&&!e.includes("\0")&&!e.split(/[\\/]/).includes("..")),Cw=z({workspaceId:b7,repoId:Db,owner:Ab,name:Ab,sourceBranch:bg,defaultBranch:bg}).strict(),Qle=z({repoId:Db,owner:Ab,name:Ab,defaultBranch:N(),private:Re(),description:N().nullable()}),Jle=Cw.extend({initialCommit:N(),head:N(),actualBranch:N().nullable(),branches:ve(N()).optional(),files:ve(z({path:C5,previousPath:N().optional(),comparison:et(Zle).optional(),status:N(),added:Q().nonnegative(),removed:Q().nonnegative(),binary:Re(),untracked:Re().optional()})),totalFiles:Q().int().nonnegative().optional(),filesTruncated:Re().optional(),added:Q().nonnegative(),removed:Q().nonnegative(),dirty:Re(),conflicted:Re(),version:N(),measuredAt:Q()}),Ed=z({sessionId:b7});Fs("action",[Ed.extend({action:he("repositories"),page:Q().int().min(1).max(1e3).optional(),search:N().max(100).optional()}).strict(),Ed.extend({action:he("branches"),repoId:Db,page:Q().int().min(1).max(1e3).optional(),search:N().max(100).optional(),cursor:N().min(1).max(1024).optional()}).strict(),Ed.extend({action:he("bind"),repoId:Db,branch:bg}).strict(),Ed.extend({action:he("status")}).strict(),Ed.extend({action:he("intend"),branch:bg.optional()}).strict(),Ed.extend({action:he("diff"),filePath:C5}).strict()]);z({binding:Cw.nullable().optional(),workspace:Jle.nullable().optional(),repositories:ve(Qle).optional(),branches:ve(N()).optional(),hasMore:Re().optional(),nextCursor:N().min(1).max(1024).optional(),diff:z({path:C5,patch:N(),binary:Re(),truncated:Re(),notStored:Re().optional()}).optional()});z({threadId:N().min(1),conversationId:N().min(1),workspace:Cw.optional()});new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");z({id:N().min(1),name:N().min(1),baseUrl:N().min(1),apiKey:N().min(1),remark:N().optional(),createdAt:Q(),updatedAt:Q()}).strict();const ece=z({id:N().min(1),name:N().min(1),baseUrl:N().min(1),remark:N().optional(),keyMasked:N(),hasKey:Re(),createdAt:Q(),updatedAt:Q()}).strict();z({activeChannelId:N().nullable(),channels:ve(ece)}).strict();z({}).strict();z({id:N().min(1).optional(),name:N().min(1),baseUrl:N().min(1),apiKey:N().optional(),remark:N().optional()}).strict();z({id:N().min(1)}).strict();z({id:N().min(1).nullable()}).strict();z({channelId:N().min(1).optional(),updatedAt:Q().optional()}).strict().refine(e=>e.updatedAt===void 0||e.channelId!==void 0,{message:"updatedAt requires channelId"});z({channelId:N().nullable(),models:ve(z({id:N().min(1),ownedBy:N().optional()}).strict())}).strict();const tce=["owner"],nce=["agent","owner","user-upload"],w7=z({id:N().min(1),relPath:N().min(1),from:et(nce),label:N().optional(),size:Q().int().nonnegative(),mime:N().min(1),addedAt:Q().int().nonnegative(),lastEditedAt:Q().int().nonnegative().optional(),stale:Re().optional()});z({sessionId:N().min(1),relPath:N().min(1),ttlSeconds:Q().int().positive().nullable().optional(),view:et(["raw","md-rendered"]).optional()});z({url:N().min(1),expiresAt:Q().int().nonnegative().nullable()});z({sessionId:N().min(1),relPath:N().min(1),label:N().optional(),origin:he("agent").optional()});z({entry:w7});z({sessionId:N().min(1),relPath:N().min(1)});z({removed:he(!0)});z({sessionId:N().min(1)});z({entries:ve(w7)});z({attachmentId:N().min(1),url:N().min(1),relPath:N().min(1),sizeBytes:Q().int().nonnegative(),mimeType:N().min(1)});const rce=Fs("type",[z({type:he("persona"),id:N().min(1)}).strict(),z({type:he("chat"),id:N().min(1)}).strict(),z({type:he("*")}).strict()]),sce=et(["read","send","admin"]),N5=z({resource:rce,actions:ve(sce).min(1)}).strict(),ice=z({id:N().min(1),secretHash:N().regex(/^[a-f0-9]{64}$/),displayName:N(),grants:ve(N5),issuedAt:Q().int().nonnegative(),expiresAt:Q().int().positive().optional(),maxUses:Q().int().positive().optional(),usedCount:Q().int().nonnegative(),peerOwnerId:N().min(1).optional(),firstUsedByPeerAt:Q().int().positive().optional(),peerDisplayName:N().optional()}).strict(),oce=ice.omit({secretHash:!0});z({type:he("whoami:ok"),owner:z({id:N(),kind:et(["owner","guest"]),displayName:N(),ownerId:N(),provider:N()}).strict(),capability:oce,grantedPersonas:ve(z({id:N().min(1),displayName:N()}).strict())}).strict();const ace="PEER_LOGIN_EXPIRED";z({selfUrl:N().min(1)});z({type:he("contact:handshake:ok"),owner:z({id:N(),ownerId:N(),provider:N(),displayName:N()}),grants:ve(N5)});const lce=Fs("status",[z({status:he("authorized"),login:N().min(1),source:et(["git","file"])}).strict(),z({status:he("missing")}).strict(),z({status:he("invalid"),message:N().min(1)}).strict(),z({status:he("pending"),authUrl:N().url()}).strict()]);z({token:N().min(1)}).strict();z({returnTo:N().url().optional()}).strict();const cce=z({url:N().url(),bin:N(),sha256:N().regex(/^[0-9a-f]{64}$/),size:Q().int().positive()}),uce={label:"Debian 13"},_7=["node","npm"],dce=["claude","codex","git","lark-cli","pi","pi-mcp-bridge","pi-cliproxyapi-provider","python3","jq","rsync","psql","go","chromium","fonts-wqy-microhei","openssh-server","pnpm","whiteboard-cli","s","supabase-mcp","mcp-server-kibana","aliyun"],hce=z({name:N().min(1),from:N().optional(),version:N().optional(),min:N().optional(),library:Re().optional(),localVersion:N().optional(),artifact:cce.optional(),aptMissing:he(!0).optional(),aptVersion:N().optional()}),fce=z({name:N().min(1),env:ve(N().min(1)).min(1)}),j5=N().regex(/^[a-z0-9-]+$/,"连接器名只能是小写字母、数字和短横线"),S7=["proxy","env"],k7=["mcp","cli"],pce=["bearer","lark-sidecar"],C7=["none","shared","personal"],E5=["oauth","fields"],I5=N().regex(/^[A-Z][A-Z0-9_]*$/,"要填的变量名只能是大写字母、数字和下划线,且以字母开头"),N7=z({name:j5,kind:et(S7),runner:et(k7),protocol:et(pce).optional(),id:N().min(1),credentialSource:et(C7).optional(),auth:et(E5).optional(),publisherUnionId:N().regex(/^on_[A-Za-z0-9_-]+$/).optional(),fields:ve(I5).default([]),http:z({url:N().min(1),headers:Zi(N(),N())}).optional()}),j7=["LARKSUITE_CLI_APP_ID","LARKSUITE_CLI_APP_SECRET"];function T5(e){return e.name==="feishu"&&e.runner==="cli"&&e.kind==="env"&&e.credentialSource==="shared"}function mce(e){return e.name==="feishu"&&e.id==="feishu"&&e.runner==="cli"&&e.kind==="proxy"&&e.protocol==="lark-sidecar"&&e.credentialSource==="shared"&&e.auth==="oauth"&&e.fields.length===0}function E7(e){if(!e.credentialSource)return[`连接器 ${e.name} 还没选用谁的账号`];const t=[];return mce(e)?t:e.protocol==="lark-sidecar"&&e.credentialSource==="shared"?["连接器 feishu 的发布者 OAuth 配置不完整,请重新选择账号身份"]:T5(e)?j7.filter(n=>!e.fields.includes(n)).map(n=>`连接器 feishu 的 Lark App Bot 缺少 ${n==="LARKSUITE_CLI_APP_ID"?"App ID":"App Secret"}`):(e.credentialSource==="personal"&&(e.auth?e.auth==="oauth"&&e.kind==="env"?t.push(`连接器 ${e.name} 是进程型(stdio MCP / CLI),只能粘贴 API key,走不了 OAuth`):e.auth==="fields"&&e.fields.length===0&&t.push(`连接器 ${e.name} 要填的变量还没列`):t.push(`连接器 ${e.name} 还没选用户怎么关联账号`)),e.credentialSource==="shared"&&e.fields.length===0&&t.push(`连接器 ${e.name} 选了发布者的账号,但要填的变量还没列`),t)}const gce=/^([A-Za-z0-9._/-]+)@([A-Za-z0-9._-]+)(?:\?tags=([A-Za-z0-9_,]+))?$/,xce=["main","master","HEAD","latest"];function vce(e){const t=gce.exec(e);return!!t&&!xce.includes(t[2])}function I7(e){var n,r;return _7.includes(e.name)||dce.includes(e.name)?[]:(n=e.from)!=null&&n.startsWith("github:")&&!e.artifact?[`${e.name} 还没钉下载资产(github: 要具体到哪个文件)——重新扫描`]:(r=e.from)!=null&&r.startsWith("go:")&&!vce(e.from.slice(3))?[`${e.name} 还没钉版本(go: 要写成 <module>@<tag>,不收 latest / main 这类移动引用)——重新扫描`]:[]}function Nw(e){return e.connectors.filter(t=>t.credentialSource==="shared"&&t.fields.length>0).map(t=>({name:t.name,env:[...t.fields]}))}function yce(e){return[...new Set([...e.secrets.flatMap(t=>t.env),...Nw(e).flatMap(t=>t.env)])]}const bce=e=>{if(!e||typeof e!="object")return e;let t=e;if("clis"in t&&Array.isArray(t.clis)){const{clis:n,...r}=t;t="packages"in r?r:{...r,packages:n}}if("assets"in t&&Array.isArray(t.assets)&&t.assets.length===0){const{assets:n,...r}=t;t=r}return t},wce="Publisher test: ",T7=z({version:he(1),entry:N().max(240).regex(/^[A-Za-z0-9_.-]+(?:\/[A-Za-z0-9_.-]+)*\.mjs$/).refine(e=>!e.split("/").some(t=>[".",".."].includes(t))),timeoutSeconds:Q().int().min(1).max(600),checks:ve(N().regex(/^[a-z0-9][a-z0-9-]{0,63}$/)).min(1).max(64).refine(e=>new Set(e).size===e.length)}).strict(),R7={test:T7.optional(),packages:ve(hce),secrets:ve(fce),connectors:ve(N7).default([])};z(R7);const R5=Xle(bce,z({version:he(1),...R7}).strict()),_ce=z({target:N().min(1),reason:N().min(1),file:N().min(1),quote:N().min(1)}),Sce=["integration","production"],Ws=et(Sce),xc=N().regex(/^[a-z0-9.-]+(?::[0-9]+)?\/[a-z0-9._/-]+@sha256:[a-f0-9]{64}$/),JN=N().regex(/^[a-f0-9]{40}$/),kce=N().refine(e=>{try{const t=new URL(e);return t.protocol==="https:"&&!t.username&&!t.password&&!t.search&&!t.hash&&t.pathname==="/"&&/(^|[.-])int([.-]|$)/.test(t.hostname)}catch{return!1}},"测试验证地址必须明确指向 int HTTPS 环境"),Cce=z({version:he(1),runId:N().regex(/^[A-Za-z0-9_-]{1,128}$/),status:he("passed"),exitCode:he(0),result:z({version:he(1),runId:N().regex(/^[A-Za-z0-9_-]{1,128}$/),checks:ve(z({name:N().regex(/^[a-z0-9][a-z0-9-]{0,63}$/),status:he("passed"),reason:N().max(1024).optional()}).strict()).min(1).max(64)}).strict(),execution:z({image:xc,imageID:N().min(1).max(512),engine:et(["codex","pi"]),podUid:N().min(1).max(512),jobUid:N().min(1).max(512)}).strict()}).strict(),M7=z({status:he("passed"),fingerprint:N().regex(/^[a-f0-9]{64}$/),checks:ve(N().regex(/^[a-z0-9-]+$/)),endpoint:kce,verifiedAt:N().refine(e=>Number.isFinite(Date.parse(e))),test:Cce.optional()}).strict(),P7=z({engine:N().min(1),model:N(),effort:N(),size:N().min(1),cpu:Q().positive(),taskConcurrency:Q().int().positive(),minPods:Q().int().nonnegative().safe().optional()}).strict(),O7=z({version:he(1),environment:he("integration"),component:he("persona"),image:xc,commit:JN,baseImage:xc,pipelineCommit:JN,repository:N().regex(/^[A-Za-z0-9_.-]+\/[A-Za-z0-9_.-]+$/),config:P7.optional(),verification:M7.refine(e=>e.checks.includes("persona-smoke")),test:T7.optional()}).strict().refine(e=>{if(!e.test)return e.verification.test===void 0;const t=e.verification.test;return["persona-dialogue","persona-task","persona-custom-test"].every(n=>e.verification.checks.includes(n))&&t!==void 0&&t.execution.image===e.image&&t.runId===t.result.runId&&t.result.checks.length===e.test.checks.length&&new Set(t.result.checks.map(n=>n.name)).size===e.test.checks.length&&t.result.checks.every(n=>e.test.checks.includes(n.name))},"Declared publisher acceptance requires complete candidate runtime evidence");z({version:he(1),environment:he("integration"),component:he("base"),image:xc,commit:JN,verification:M7.refine(e=>e.checks.includes("base-smoke"))}).strict();const wg="-cloud",M5=`codex${wg}`,_g={standard:"default",fast:"priority"},Nce=`claude${wg}`;function D7(e){return e==="codex"||e===M5}const A7="pi",jce=`${A7}${wg}`;function $7(e){return e===A7||e===jce}function gu(e){return typeof e=="string"&&e.length>wg.length&&e.endsWith(wg)}const L7=et([_g.standard,_g.fast]),P5=["tiny","small","medium","large","xlarge"],Ece=et(P5),$b="medium",Lb=[.5,1,2],Ice=Q().refine(e=>Lb.includes(e),"Unsupported CPU"),ej={tiny:.5,small:1,medium:2,large:2,xlarge:2},B7=z({model:N().optional(),effort:N().optional()}).strict(),Em=z({personaId:N(),label:N(),model:N().optional(),effort:N().optional(),serviceTier:L7.optional(),public:Re(),iconKey:N().optional(),tool:N().optional(),size:N().optional(),cpu:Q().finite().optional(),taskConcurrency:Q().int().positive().optional(),minPods:Q().int().nonnegative().safe().optional(),cloudEngine:B7.optional(),createdAt:Q(),updatedAt:Q(),cloud:z({gatewayUrl:N().min(1),personaId:N().min(1),publishedByMe:Re().optional(),environment:Ws.optional(),expectedImage:xc.optional(),testReleaseId:N().optional()}).strict().optional()}).strict(),Tce=z({name:N().min(1),description:N().optional()}),Rce=z({id:N().min(1)}),F7=z({writableRoots:ve(N()).optional(),denyRead:ve(N()).optional(),network:Re().optional()}).strict(),Mce=z({permissions:z({defaultMode:N().optional(),allow:ve(N()).optional(),deny:ve(N()).optional()}).optional(),sandbox:z({enabled:Re().optional(),autoAllowBashIfSandboxed:Re().optional(),allowUnsandboxedCommands:Re().optional(),excludedCommands:ve(N()).optional(),filesystem:z({denyRead:ve(N()).optional(),allowRead:ve(N()).optional(),denyWrite:ve(N()).optional(),allowWrite:ve(N()).optional()}).optional(),network:z({allowedDomains:ve(N()).optional(),allowLocalBinding:Re().optional()}).optional()}).optional()});Em.extend({personality:N().optional(),personalityLocal:N().optional(),personalityManaged:Re().optional(),skills:ve(Tce).optional(),plugins:ve(Rce).optional(),sandboxSettings:Mce.nullable().optional(),codexSandbox:F7.nullable().optional()});z({slug:N().regex(/^[a-z0-9]+(-[a-z0-9]+)*$/).max(32),label:N().min(1),personality:N(),model:N().optional(),effort:N().optional(),serviceTier:Em.shape.serviceTier,tool:N().optional(),public:Re().optional(),iconKey:N().optional()}).strict();z({personaId:N().min(1)});z({personaId:N().min(1),patch:z({label:N().min(1).optional(),model:N().optional(),effort:N().optional(),serviceTier:Em.shape.serviceTier,tool:N().optional(),size:Ece.optional(),cpu:Ice.optional(),taskConcurrency:Em.shape.taskConcurrency,minPods:Em.shape.minPods,cloudEngine:B7.optional(),personality:N().optional(),personalityLocal:N().optional(),public:Re().optional(),iconKey:N().nullable().optional(),codexSandbox:F7.optional()}).strict()}).strict();z({version:he(1),manifest:R5}).strict();const Pce=["hard","soft"],z7=et(Pce),Oce=et(["scanning","done","failed"]),H7=z({id:N().min(1),manifest:R5,scanSessionId:N().optional(),status:Oce,evidence:ve(_ce).default([]),notes:ve(N()).default([]),head:N().min(1).optional(),baseKind:z7.default("hard"),base:N().min(1).optional(),startedAt:Q(),finishedAt:Q().optional(),error:N().optional()}).strict(),O5=z({id:N().min(1).optional(),environment:Ws.optional(),legacy:Re().optional(),head:N().min(1),contentHead:N().min(1),scanId:N().min(1),at:Q(),pushed:Re().optional(),runId:Q().int().positive().optional(),runAttempt:Q().int().positive().optional(),artifactId:Q().int().positive().optional(),verified:O7.optional(),config:P7.optional(),reconfigOf:N().min(1).optional(),workflowVersion:Q().int().positive().optional(),confirmation:z({fingerprint:N().regex(/^[a-f0-9]{64}$/),runId:Q().int().positive(),runAttempt:Q().int().positive(),at:Q()}).strict().optional()}).strict(),Dce=["prepared","main-pushed","dispatching","dispatched","completed","failed"],D5=z({id:N().min(1),releaseId:N().min(1),at:Q(),verified:O7.optional(),phase:et(Dce),expectedMain:N().optional(),runId:Q().int().positive().optional(),runAttempt:Q().int().positive().optional(),error:N().optional()}).strict(),dO=z({channelId:N().min(1),updatedAt:Q()}).strict(),A5=z({integration:dO.nullable().optional(),production:dO.nullable().optional()}).strict();z({version:he(4),engineChannels:A5.optional(),scans:ve(H7),releases:ve(O5),promotions:ve(D5).default([])}).strict();const Ace=z({url:N().min(1),branch:N().min(1),head:N().min(1),dirty:Re(),ahead:Q()}).strict(),wy=z({env:N().min(1),setAt:Q().optional()}).strict(),hO={baseUrl:"CLAWD_ENGINE_BASE_URL",apiKey:"CLAWD_ENGINE_API_KEY"},$ce="模型订阅只写进去一半——重填或改回平台默认";function Bb(e){if(!e)return;const t=r=>e.some(s=>s.env===r&&s.setAt!==void 0),n=[hO.baseUrl,hO.apiKey].filter(t).length;return n===2?"own":n===0?"platform":"partial"}function Lce(e){const t=e.trim();let n;try{n=new URL(t)}catch{throw new Error("订阅地址要以 http:// 或 https:// 开头,形如 https://cpa.example.com")}if(n.protocol!=="http:"&&n.protocol!=="https:"||!n.hostname)throw new Error("订阅地址要以 http:// 或 https:// 开头,形如 https://cpa.example.com");const r=`${n.origin}${n.pathname}`.replace(/\/+$/,"");return r.endsWith("/v1")?r:`${r}/v1`}const Bce=["pending","running","done","failed","waiting","skipped"],Fce=et(Bce),go="verify",Im=["build","smoke","deploy",go],zce=et(Im),Hce=z({key:zce,status:Fce,url:N().optional(),jobId:Q().optional(),startedAt:Q().optional(),completedAt:Q().optional()}).strict(),_y=z({runId:Q(),headSha:N().min(1),status:et(["queued","running","completed"]),htmlUrl:N().min(1),jobs:ve(Hce),environment:Ws.optional(),branch:N().optional(),event:N().optional(),runAttempt:Q().int().positive().optional(),conclusion:et(["success","failure"]).optional(),promotionId:N().optional()}).strict();function U7(e,t){return t&&e.head===t.head?t.contentHead:e.head}function jw(e,t,n){return!e||!t||e.status!=="done"?!1:e.head===U7(t,n)&&!t.dirty}function $5(e,t,n){return!e||!t||e.status!=="done"||!e.head?!1:e.head!==U7(t,n)}function fO(e,t,n){return jw(e,t,n)||$5(e,t,n)}function Uce(e,t){return!t||!e.head?!1:t.contentHead===e.head||t.at>=e.startedAt}const W7=["codex","pi","claude"];function dl(e){return W7.includes(e||"claude")}const V7={codex:"0.163.0",pi:"1.3.0",claude:"0.3.304"},Wce="2.1.304";function Vce(e,t){if(!e||!dl(e)||!t)return null;const n=e==="claude"?Wce:V7[e];return n===t?null:{tool:e,cloud:n,local:t}}function q7(e){const t=e.tool||"claude",n=t==="claude"?e.cloudEngine??{}:e;return{tool:t,model:n.model??"",effort:n.effort??""}}const wk=z({runId:Q(),status:_y.shape.status,conclusion:et(["success","failure"]).optional(),htmlUrl:N().min(1)}).strict(),qce=z({desired:Q().int().nonnegative().safe(),ready:Q().int().nonnegative().safe(),bound:Q().int().nonnegative().safe(),starting:Q().int().nonnegative().safe(),retiring:Q().int().nonnegative().safe(),observedAt:Q(),error:N().nullable()}).strict(),pO=z({online:Re().optional(),image:xc.optional(),minPods:Q().int().nonnegative().safe().optional(),reservation:qce.nullable().optional(),reservationError:N().optional()}).strict(),K7=z({personaId:N().min(1),engineChannels:A5.optional(),github:lce.optional(),publisherFeishuAuth:z({integration:z({connected:Re(),authUrl:N().optional(),error:N().optional()}).strict(),production:z({connected:Re(),authUrl:N().optional(),error:N().optional()}).strict()}).strict().optional(),repo:Ace.optional(),scans:ve(H7).default([]),releases:ve(O5).default([]),promotions:ve(D5).optional(),targets:z({integration:pO.extend({run:_y.optional(),secrets:ve(wy).optional(),unpublish:wk.optional()}).optional(),production:pO.extend({run:_y.optional(),secrets:ve(wy).optional(),unpublish:wk.optional()}).optional()}).strict().optional(),secrets:ve(wy).optional(),run:_y.optional(),online:Re().optional(),unpublish:wk.optional(),historyError:N().optional()}).strict();z({before:Q().nullable()}).strict();K7.pick({personaId:!0,github:!0,repo:!0,scans:!0,releases:!0,promotions:!0,engineChannels:!0,historyError:!0});K7.pick({scans:!0});z({environment:Ws,secrets:ve(wy).optional(),engineChannels:A5.optional()}).strict();const Kce=e=>e.includes("minPods")?3:2,Gce=4,Yce=["engine","model","effort","size","cpu","taskConcurrency","minPods"];function Xce(e){const{tool:t,model:n,effort:r}=q7(e),s=(e.size??"").trim()||$b,i=e.cpu??ej[s]??ej[$b];return{engine:t,model:n.trim(),effort:r.trim(),size:s,cpu:i,taskConcurrency:e.taskConcurrency??Gce,minPods:e.minPods??0}}function G7(e,t){return!e||!t?null:Yce.filter(n=>n==="minPods"?(e.minPods??0)!==(t.minPods??0):e[n]!==t[n])}z({sha:N().min(1),actionsUrl:N().min(1),releaseId:N().optional()}).strict();const cx=z({personaId:N().min(1)}).strict();cx.extend({releaseHead:N().min(1).optional(),releaseId:N().min(1).optional(),environment:Ws.optional()}).strict();cx.extend({scanBase:z7.optional()}).strict();cx.extend({scanId:N().min(1)}).strict();cx.extend({releaseId:N().min(1)}).strict();cx.extend({environment:Ws.default("production")}).strict();z({confirmation:O5.shape.confirmation.unwrap()}).strict();z({promotion:D5}).strict();z({personaId:N().min(1),expectedImage:xc}).strict();z({personaId:N().min(1),scanId:N().min(1),patch:z({manifest:R5.optional(),connector:N7.optional()}).strict()}).strict();z({personaId:N().min(1),environment:Ws.default("production"),scanId:N().min(1),name:N().min(1),values:Zi(N(),N())}).strict();z({personaId:N().min(1),environment:Ws.default("production"),channelId:N().min(1).optional(),auth:z({baseUrl:N(),apiKey:N()}).strict().nullable().optional()}).strict().refine(e=>e.channelId!==void 0||e.auth!==void 0,{message:"Either channelId or auth must be provided"});z({personaId:N().min(1),environment:Ws.default("production"),releaseId:N().optional(),jobId:Q()}).strict();z({personaId:N().min(1),kind:et(["package","secret","connector"]),item:Zi(N(),Ya()),evidence:z({reason:N().min(1),file:N().min(1),quote:N().min(1)})}).strict();z({personaId:N().min(1),notes:ve(N()).default([])}).strict();const Y7="ottin4ttc";function Uh(e){return e.trim().replace(/^git@[^:]+:/,"").replace(/^https?:\/\/[^/]+\//,"").replace(/\.git$/,"")}z({environment:Ws.default("production")}).strict();const Zce="LOGIN_EXPIRED",Qce=z({deviceId:N().min(1),name:N().min(1),url:N().min(1)});z({type:he("device:list:ok"),devices:ve(Qce)});z({deviceId:N().min(1),url:N().min(1).optional(),name:N().optional()});z({type:he("device:connect:ok"),deviceId:N(),name:N(),url:N()});const X7=z({ownerId:N().min(1),provider:N().min(1),displayName:N().min(1),avatarUrl:N().optional(),unionId:N().optional()});z({type:he("auth:login:start:ok"),environment:Ws.optional(),authUrl:N().min(1),state:N().min(1)});z({type:he("auth:getIdentity:ok"),identity:X7.nullable(),deviceId:N().min(1)});z({type:he("auth:logout:ok")});const Z7=N().nullable();z({type:he("auth:apiKey:get:ok"),apiKey:N().nullable(),createdAt:N().nullable(),gatewayUrl:Z7});z({type:he("auth:apiKey:regenerate:ok"),apiKey:N().min(1),createdAt:N().min(1),gatewayUrl:Z7});z({type:he("auth:apiKey:revoke:ok"),revoked:Re()});z({type:he("auth:login:done"),environment:Ws.optional(),identity:X7});z({type:he("auth:login:failed"),environment:Ws.optional(),reason:N()});z({deviceId:N().min(1),remoteAccessAllowed:Re()}).strict();z({type:he("contact:setRemoteAccess:ok"),deviceId:N().min(1),remoteAccessAllowed:Re()}).strict();z({type:he("contact:remote-access-updated"),deviceId:N().min(1),remoteAccessAllowed:Re()}).strict();z({personaId:N().min(1)}).strict();const Jce=["connected","missing","reauth"],eue=["link","fill"],tue=z({name:j5,id:N().min(1),kind:et(S7),runner:et(k7),auth:et(E5),status:et(Jce),action:et(eue),authUrl:N().optional(),fields:ve(I5)}).strict();z({connectors:ve(tue)}).strict();z({personaId:N().min(1),name:j5,values:Zi(I5,N().min(1))}).strict();const nue=z({deviceId:N().min(1),ownerId:N().min(1),provider:N().min(1),displayName:N(),remoteUrl:N().min(1),connectToken:N(),grants:ve(N5),addedAt:Q().int().nonnegative(),pinnedAt:Q().int().nullable().default(null),remoteAccessAllowed:Re().default(!1),note:N().default("")}).strict(),Q7=nue;z({deviceId:N().min(1)}).strict();z({type:he("contact:remove:ok"),deviceId:N().min(1)}).strict();z({type:he("contact:list:ok"),contacts:ve(Q7)}).strict();z({type:he("contact:added"),contact:Q7}).strict();z({type:he("contact:removed"),deviceId:N().min(1)}).strict();z({deviceId:N().min(1),pinned:Re()}).strict();z({deviceId:N().min(1),note:N()}).strict();z({type:he("contact:setNote:ok"),deviceId:N().min(1),note:N()}).strict();z({type:he("contact:pin:ok"),deviceId:N().min(1),pinnedAt:Q().int().nullable()}).strict();z({type:he("contact:pinned"),deviceId:N().min(1),pinnedAt:Q().int().nullable()}).strict();const L5=Fs("kind",[z({kind:he("success"),text:N(),brief:N().optional(),filePaths:ve(N()).optional()}),z({kind:he("failure"),reason:N(),brief:N().optional()})]);z({targetPersona:N().min(1).optional(),dispatchId:N().min(1).optional(),prompt:N(),brief:N().optional(),targetDeviceId:N().min(1).optional(),model:N().min(1).optional(),tool:N().min(1).optional(),sessionLabel:N().min(1).max(60).optional(),meta:Zi(Ya()).optional()}).refine(e=>e.targetPersona!==void 0||e.dispatchId!==void 0,{message:"either targetPersona (new dispatch) or dispatchId (follow-up) is required"}).refine(e=>!(e.dispatchId!==void 0&&e.targetDeviceId!==void 0),{message:"follow-ups take only dispatchId; the target device comes from the ledger row (dispatchId + targetDeviceId are mutually exclusive)"}).refine(e=>!(e.tool!==void 0&&e.targetDeviceId!==void 0),{message:"engine override is not supported for cross-device dispatch (tool + targetDeviceId are mutually exclusive)"}).refine(e=>!(e.dispatchId!==void 0&&(e.tool!==void 0||e.model!==void 0)),{message:"a follow-up dispatch cannot change engine or model (dispatchId excludes tool / model); start a new dispatch instead"});z({dispatchId:N().min(1),outcome:L5});const rue=["running","completed","failed"],B5=et(rue),sue=z({dispatchId:N().min(1),sourceSessionId:N().min(1),sourcePersonaId:N().min(1).optional(),targetPersonaId:N().min(1),targetDeviceId:N().min(1).optional(),remoteDispatchId:N().min(1).optional(),remoteRound:Q().int().positive().optional(),workerSessionId:N().min(1).optional(),taskText:N(),taskBrief:N().optional(),round:Q().int().positive().optional(),status:B5,outcome:L5.optional(),meta:Zi(Ya()).optional(),createdAt:N().min(1),completedAt:N().min(1).optional(),deliveredAt:N().min(1).optional()});z({sourceSessionId:N().min(1).optional(),relatedSessionId:N().min(1).optional()});z({records:ve(sue)});z({dispatchId:N().min(1)});z({type:he("personaDispatch:get:ok"),status:B5,outcome:L5.optional()});const iue=/^[a-z0-9][a-z0-9-]*$/;et(["stopped","starting","running","crashed","invalid"]);const oue=new Set(["localhost","127.0.0.1"]);function aue(e){let t;try{t=new URL(e)}catch{return!1}return!!(t.protocol==="https:"||t.protocol==="http:"&&oue.has(t.hostname))}const i0=z({id:N().regex(iue),name:N().min(1),version:N().min(1),apiVersion:he("1"),runtime:z({startCommand:N().min(1)}).passthrough().optional(),entry:z({url:N().url().refine(aue,{message:"INVALID_URL_SCHEME: only https or http://localhost is allowed"})}).strict().optional()}).passthrough().superRefine((e,t)=>{var s;const n=!!e.runtime,r=!!((s=e.entry)!=null&&s.url);n&&r&&t.addIssue({code:ke.custom,message:"INVALID_MANIFEST: entry.url and runtime cannot coexist"}),!n&&!r&&t.addIssue({code:ke.custom,message:"INVALID_MANIFEST: must have either entry.url or runtime"})}),lue=Fs("kind",[z({kind:he("local"),port:Q().int().min(1).max(65535)}),z({kind:he("hosted"),url:N().url()})]);Fs("state",[z({extId:N(),manifest:i0,state:he("stopped")}),z({extId:N(),manifest:i0,state:he("starting")}),z({extId:N(),manifest:i0,state:he("running"),target:lue}),z({extId:N(),manifest:i0,state:he("crashed")}),z({extId:N(),manifest:Ya().nullable(),state:he("invalid"),invalidReason:N().min(1)})]);z({snapshotHash:N().min(1),version:N().min(1),publishedAt:Q()});const cue=Fs("kind",[z({kind:he("p2p-tunnel"),ownerPrincipalId:N().min(1),extId:N().min(1)})]);Fs("kind",[z({kind:he("p2p-tunnel"),ownerPrincipalId:N().min(1),extId:N().min(1),snapshotHash:N().min(1)})]);z({extId:N().min(1),name:N().min(1),version:N().min(1),contentHash:N().min(1),publishedAt:Q()});const uue=Fs("kind",[z({kind:he("clean")}),z({kind:he("ready-new-version"),fromVersion:N().min(1),toVersion:N().min(1)}),z({kind:he("error-same-hash"),version:N().min(1)}),z({kind:he("error-version-not-bumped"),localVersion:N().min(1),publishedVersion:N().min(1)}),z({kind:he("error-version-regression"),localVersion:N().min(1),publishedVersion:N().min(1)})]);function due(e){let t=2166136261;for(let n=0;n<e.length;n++)t^=e.charCodeAt(n),t=Math.imul(t,16777619)>>>0;return(t>>>0).toString(16).padStart(8,"0")}function F5(e,t){return`${e}-${due(t)}`}function z5(e){if(typeof e!="string")return{ok:!1,reason:"version must be a string"};const t=e.split(".");if(t.length!==3)return{ok:!1,reason:`"${e}" — only MAJOR.MINOR.PATCH allowed`};for(const n of t)if(!/^\d+$/.test(n))return{ok:!1,reason:`"${e}" — only numeric segments allowed`};return{ok:!0}}function J7(e,t){const n=mO(e),r=mO(t);for(let s=0;s<3;s++){if(n[s]<r[s])return-1;if(n[s]>r[s])return 1}return 0}function mO(e){const t=z5(e);if(!t.ok)throw new Error(t.reason);const[n,r,s]=e.split(".").map(i=>parseInt(i,10));return[n,r,s]}z({localManifest:z({name:N().min(1),version:N().min(1),contentHash:N().min(1)}),publishState:Fs("kind",[z({kind:he("unpublished")}),z({kind:he("published"),version:N().min(1),contentHash:N().min(1),publishedAt:Q()})]),check:uue});z({extId:N().min(1),newVersion:N().min(1).nullish()});z({extId:N().min(1)});z({extId:N().min(1),snapshotHash:N().min(1)});z({channelRef:cue,snapshotHash:N().min(1),zipBase64:N().min(1)});z({id:N().min(1),peerDeviceId:N().min(1),senderDeviceId:N().min(1),text:N().min(1),createdAt:Q().int().nonnegative(),readBy:Zi(N().min(1),Q().int().positive()).default({}),origin:z({kind:he("persona"),personaId:N().min(1)}).optional()}).strict();z({peerDeviceId:N().min(1).optional(),id:N().min(1),text:N().min(1),createdAt:Q().int().nonnegative(),origin:z({kind:he("persona"),personaId:N().min(1)}).optional()}).strict();z({peerDeviceId:N().min(1),sinceCreatedAt:Q().int().nonnegative().optional()}).strict();z({peerDeviceId:N().min(1),upToCreatedAt:Q().int().nonnegative()}).strict();z({peerDeviceId:N().min(1).optional(),text:N().min(1)});z({peerDeviceId:N().min(1).optional(),command:N().min(1),timeoutMs:Q().int().positive().optional()}).strict();z({type:he("peerExec:run:ok"),stdout:N(),stderr:N(),exitCode:Q().int().nullable(),timedOut:Re(),stdoutTruncated:Re(),stderrTruncated:Re()}).strict();const eH=Fs("kind",[z({kind:he("at"),at:N().min(1)}),z({kind:he("every"),everyMs:Q().int().positive(),anchorMs:Q().int().nonnegative().optional()}),z({kind:he("cron"),expr:N().min(1),tz:N().min(1).optional()})]),ux=N().trim().min(1);z({personaId:ux,name:N().min(1),schedule:eH,prompt:N().min(1),targetPersona:N().min(1).optional(),timeoutMs:Q().int().positive().optional()});z({personaId:ux,onlyMine:Re().optional()});z({personaId:ux,shiftId:N().min(1)});const hue=z({name:N().min(1).optional(),schedule:eH.optional(),prompt:N().min(1).optional(),targetPersona:N().min(1).optional(),timeoutMs:Q().int().positive().optional(),enabled:Re().optional()});z({personaId:ux,shiftId:N().min(1),patch:hue});z({personaId:ux,shiftId:N().min(1),limit:Q().int().positive().optional()});const zi="persona-master",H5=z({personaId:N().min(1),deviceId:N().min(1).optional()}),tH=z({id:N().min(1),name:N().min(1),memberPersonas:ve(H5),memberContactDeviceIds:ve(N().min(1)),createdAt:N().min(1),updatedAt:N().min(1)}),nH=N().trim().min(1);z({name:nH,memberPersonas:ve(H5).default([]),memberContactDeviceIds:ve(N().min(1)).default([])});z({channelId:N().min(1),name:nH.optional(),memberPersonas:ve(H5).optional(),memberContactDeviceIds:ve(N().min(1)).optional()});z({channelId:N().min(1)});z({channels:ve(tH)});z({channel:tH});z({ok:he(!0),removedTopics:Q().int().min(0)});const ur=N().trim().min(1),U5=["master-confirmed","owner-needed"],W5=["open","resolved"],fue=U5[0],rH=U5[1],sH=W5[0],pue=W5[1],mue=et(U5),gue=et(W5),xue=z({id:ur.optional(),resolves:ur.optional(),type:mue,status:gue,question:ur,recommendation:ur}).superRefine((e,t)=>{e.type===fue&&e.status!==pue&&t.addIssue({code:ke.custom,path:["status"],message:"master-confirmed decisions must be resolved"})}),vue=["planning","running","done"],yue=et(vue),iH=z({at:N().min(1),actor:N().min(1),action:N().min(1),target:N().optional(),reason:N().min(1),artifacts:ve(ur).optional(),decision:xue.optional()}),bue=z({rejectCount:Q().int().min(0),accepted:Re().default(!1),ordinal:Q().int().min(1).optional(),overrideCount:Q().int().min(0).optional()}),V5=z({id:N().min(1),channelId:N().min(1),title:N(),masterSessionId:N().min(1),goal:N(),boundaries:N(),acceptanceCriteria:ve(N()),activity:ve(iH),lineMeta:Zi(bue),nextLineOrdinal:Q().int().min(1).optional(),state:yue,createdAt:N().min(1),updatedAt:N().min(1)}),wue=z({lineId:N().min(1),dispatchId:N().min(1),workerSessionId:N().optional(),assignee:N().min(1),focus:N(),status:B5,acceptance:ve(N()),rejectCount:Q().int().min(0),accepted:Re(),ordinal:Q().int().min(1).nullable()});z({channelId:N().min(1)});z({topicId:N().min(1).optional(),sessionId:N().min(1).optional()}).refine(e=>e.topicId!==void 0||e.sessionId!==void 0,{message:"either topicId or sessionId is required"});z({channelId:N().min(1),title:ur.optional()});z({topicId:N().min(1),title:ur.optional(),goal:ur,boundaries:N(),acceptanceCriteria:ve(ur).min(1)});z({topicId:N().min(1),action:ur,target:ur.optional(),reason:ur,artifacts:ve(ur).optional(),decision:iH.shape.decision});z({topicId:N().min(1),lineId:ur,reason:ur});z({topicId:N().min(1),lineId:ur,reason:ur,artifacts:ve(ur).optional(),watcherVerdict:et(["pass","fail"]),overrideReason:ur.optional()}).refine(e=>e.watcherVerdict!=="fail"||!!e.overrideReason,{message:"watcherVerdict=fail 时必须给 overrideReason(推翻 watcher 的理由)",path:["overrideReason"]});z({topicId:N().min(1),state:et(["done"])});z({topicId:N().min(1),title:ur});z({topicId:N().min(1)});const _ue=V5.extend({lineCount:Q().int().min(0)});z({topics:ve(_ue)});z({topic:V5,lines:ve(wue)});z({topicId:N().min(1),masterSessionId:N().min(1)});z({rejectCount:Q().int().min(1),needsOwnerAttention:Re()});z({acceptedLines:Q().int().min(1),totalLines:Q().int().min(1),allAccepted:Re(),overrides:Q().int().min(0),needsOwnerAttention:Re()});z({topic:V5});z({ok:he(!0),removedMasterSessionId:N().min(1).nullable(),removedWorkerSessionIds:ve(N().min(1))});const Sue=["ask","allow","deny"],oH=et(Sue),kue=z({id:N().min(1),desc:N().min(1),action:oH});z({rules:ve(kue)});z({ruleId:N().min(1)});z({action:oH,desc:N(),source:N().min(1)});const Cue=["created","review-requested"],aH=/^[A-Za-z0-9._-]+$/,Cf=N().min(1).regex(aH),Nf=N().min(1).regex(aH),dx=Q().int().positive();z({role:et(Cue)});z({owner:Cf,repo:Nf,number:dx});z({owner:Cf,repo:Nf,number:dx,expectedHeadSha:N().min(1)});z({owner:Cf,repo:Nf,number:dx,body:N().min(1)});z({owner:Cf,repo:Nf,number:dx,ready:Re()});z({owner:Cf,repo:Nf});z({owner:Cf,repo:Nf,number:dx,reviewers:ve(N().min(1)).min(1)});z({page:Q().int().min(1).max(1e3).optional(),search:N().max(100).optional()});z({personaId:N().min(1)});z({personaId:N().min(1)});const Nue=["expired","cancelled","access_denied","lark_protocol_error","cloud_unreachable","internal_error"],jue=et(Nue);z({personaId:N().min(1),appId:N().min(1),appSecret:N().min(1),botName:N().min(1).optional()});const Eue=z({chatId:N().min(1),chatName:N().optional(),lastActiveAt:Q().int().optional()}),Iue=z({state:et(["unbound","provisioning","bound","broken"]),appId:N().optional(),botName:N().optional(),brokenReason:N().optional(),qrUrl:N().optional(),provisionId:N().optional(),errorReason:jue.optional(),groups:ve(Eue),needsUpgrade:Re().optional(),upgradeQrUrl:N().optional()});Iue.extend({personaId:N().min(1)});z({});z({onboardingCompletedAt:Q()});const Wh=["claude","codex","pi"];z({});z({tools:ve(z({id:et(Wh),available:Re(),version:N().optional(),path:N().optional()}))});z({});const Tue=z({tool:et(Wh),cwd:N(),toolSessionId:N(),label:N().optional(),createdAt:N(),updatedAt:N(),turns:Q()});z({candidates:ve(Tue)});z({});z({registered:Re()});z({tool:et(Wh)});const gO=z({usedPercent:Q(),windowDurationMins:Q().optional(),resetsAt:Q().optional()}).strict(),Rue=Fs("kind",[z({kind:he("claude"),loggedIn:Re(),authMethod:N().optional(),apiProvider:N().optional(),apiKeySource:N().optional(),email:N().optional(),orgName:N().optional(),subscriptionType:N().optional()}).strict(),z({kind:he("codex"),login:Fs("type",[z({type:he("none")}).strict(),z({type:he("apiKey")}).strict(),z({type:he("chatgpt"),email:N(),planType:N()}).strict()]),provider:z({name:N(),baseUrl:N().optional()}).strict(),rateLimits:z({primary:gO.optional(),secondary:gO.optional()}).strict().optional()}).strict(),z({kind:he("pi"),providers:ve(z({id:N(),modelCount:Q(),credential:et(["api_key","oauth"]).optional(),oauthExpiresAt:Q().optional()}).strict())}).strict()]);z({tool:et(Wh),installed:Re(),version:N().optional(),path:N().optional(),account:Rue.optional(),error:N().optional(),modelsLoadedAt:Q().optional()}).strict();const q5="https://cpa-portal-d417.app.clawos.chat";z({apiKey:N().min(1)}).strict();z({ok:he(!0)}).strict();const lH=["cloud-persona-metrics","cloud-persona-conversations"],Mue=et(lH);z({page:Mue}).strict();z({url:N(),expiresAt:Q().int()}).strict();const cH=["ready","session:info","session:status","session:event","session:deleted","session:rewound","session:cleared","session:queue","permission:request","session:question","session:question:cleared","pong","error","subscribed","unsubscribed","auth:ok","tunnel:ready","tunnel:exited","tunnel:unavailable","session:control","session:pty","contact:added","contact:pinned","contact:removed","contact:remote-access-updated","contact:note-updated","org-mesh:progress","channel:changed","inbox:event","friend:reverseTokenOffered","auth:login:done","auth:login:failed","larkBot:state"],Pue="cloud_history_refresh",K5=["idle","running","running-idle","stopped","error","observing"],Oue=["task-notification","slash-command","local-command","system-reminder","skill-hint","meta-text","attachment-skills","attachment-deferred-tools","dispatch-task","dispatch-result"];function Ew(e){return e==="dispatch-task"||e==="dispatch-result"}const Due=["builtin","global","project","plugin"],Aue=["builtin","global","project","policy","plugin"],uH=et(["owner","guest"]);z({id:N().min(1),kind:uH,displayName:N(),feishuUnionId:N().optional()}).strict();const $ue=z({did:N().min(1),displayName:N(),feishuUnionId:N().optional(),principal:uH}).strict(),Lue=et(K5),Bue=z({inputTokens:Q().int().nonnegative(),outputTokens:Q().int().nonnegative(),cacheReadTokens:Q().int().nonnegative().optional(),cacheCreateTokens:Q().int().nonnegative().optional()}),dH={gitBranch:N().optional(),resolvedModel:N().optional(),resolvedEffort:N().optional(),contextUsage:Bue.optional(),contextWindowSize:Q().int().positive().optional(),aiLabel:N().optional()},Fue=z(dH),hH=z({value:N(),label:N(),description:N().optional()}),zue=z({id:N().min(1),label:N().min(1),description:N().optional(),contextWindowSize:Q().int().positive().optional(),default:Re().optional(),efforts:ve(hH).optional(),defaultEffort:N().optional(),group:N().optional()}),Hue=z({id:N().min(1),label:N().min(1),description:N().optional()}),Uue=z({name:N().min(1),type:et(["string","select","toggle"]),label:N().min(1),description:N().optional(),options:ve(hH).optional(),default:Ya().optional(),scope:et(["core","tool-specific"])});z({tool:N().min(1),refresh:Re().optional()});const Wue=z({rewind:Re(),subagents:Re(),tui:Re(),observe:Re(),fileSharing:Re(),fork:Re()});z({tool:N().min(1),toolSessionIdLabel:N().optional(),models:ve(zue),permissionModes:ve(Hue),configSchema:ve(Uue),features:Wue});const Vue=z({tool:N().min(1),pattern:N().min(1),createdAt:N().min(1).optional()});z({cloudEnvironment:Ws.optional(),cloudExpectedImage:xc.optional(),testReleaseId:N().optional(),sessionId:N().min(1),cloudExecutionId:N().min(1).optional(),cloudConversationId:N().min(1).optional(),cloudWorkspace:Cw.optional(),cloudPendingTurns:ve(z({id:N().min(1),text:N(),prepared:Re().optional()})).optional(),cloudBranchIntent:bg.optional(),cloudGatewaySessionId:N().min(1).optional(),cloudPendingCommand:z({id:N().min(1),text:N(),prepared:Re().optional()}).optional(),cwd:N().min(1),tool:he("claude").or(N().min(1)).default("claude"),toolSessionId:N().optional(),label:N().optional(),model:N().optional(),permissionMode:N().optional(),effort:N().optional(),serviceTier:N().optional(),...dH,aiLabelGeneratedAt:N().optional(),permissionRules:ve(Vue).optional(),pinnedAt:Q().int().nonnegative().nullable().optional(),archivedAt:Q().int().nonnegative().nullable().optional(),pinSortOrder:Q().int().nullable().optional(),unreadAt:N().min(1).nullable().optional(),iconKey:N().optional(),forkedFromSessionId:N().min(1).optional(),ephemeral:Re().optional(),deployId:N().min(1).optional(),ownerPersonaId:N().min(1).optional(),projectPath:N().min(1).optional(),chatId:N().min(1).optional(),creatorPrincipalId:N().min(1).optional(),creatorDisplayName:N().min(1).optional(),creatorFeishuUnionId:N().min(1).optional(),originOwnerPrincipalId:N().min(1).optional(),originOwnerPersonaId:N().min(1).optional(),dispatchedFromSessionId:N().min(1).optional(),shiftFiredFromSessionId:N().min(1).optional(),larkChatId:N().min(1).optional(),larkChatName:N().min(1).optional(),larkChatType:et(["p2p","group"]).optional(),createdAt:N().min(1),updatedAt:N().min(1)});const js={turnId:N().min(1).optional(),seq:Q().int().nonnegative().optional(),ts:N().optional(),uuid:N().optional()},que=et(Oue),Kue=z({readCount:Q().int().nonnegative().optional(),searchCount:Q().int().nonnegative().optional(),bashCount:Q().int().nonnegative().optional(),editFileCount:Q().int().nonnegative().optional(),linesAdded:Q().int().nonnegative().optional(),linesRemoved:Q().int().nonnegative().optional(),otherToolCount:Q().int().nonnegative().optional()}),Gue=z({oldStart:Q().int().nonnegative(),oldLines:Q().int().nonnegative(),newStart:Q().int().nonnegative(),newLines:Q().int().nonnegative(),lines:ve(N())}),Yue=z({agentId:N().optional(),agentType:N().optional(),status:N().optional(),prompt:N().optional(),filePath:N().optional(),structuredPatch:ve(Gue).optional(),stats:z({durationMs:Q().int().nonnegative().optional(),tokens:Q().int().nonnegative().optional(),toolUseCount:Q().int().nonnegative().optional(),toolStats:Kue.optional()}).optional()}),Xue=z({path:N(),content:N(),mtimeMs:Q().optional()}),Zue=z({label:N().min(1),description:N().optional()}),fH=z({question:N().min(1),multiSelect:Re(),options:ve(Zue).min(1)}),Que=["completed","interrupted"];Fs("kind",[z({...js,kind:he("session_init"),toolSessionId:N().optional()}),z({...js,kind:he("thinking"),text:N(),partialId:N().optional()}),z({...js,kind:he("text"),text:N(),partialId:N().optional()}),z({...js,kind:he("user_text"),text:N(),meta:que.optional(),taskId:N().optional(),parentToolUseId:N().optional(),sender:$ue.optional()}),z({...js,kind:he("tool_call"),toolUseId:N(),tool:N(),toolKind:N().optional(),input:Ya()}),z({...js,kind:he("tool_result"),toolUseId:N(),output:Ya().optional(),error:N().optional(),toolResultExtra:Yue.optional(),sourceToolAssistantUUID:N().optional(),askQuestionAnswers:Zi(N(),N()).optional()}),z({...js,kind:he("attachment_memories"),memories:ve(Xue)}),z({...js,kind:he("permission_request"),requestId:N(),tool:N(),input:Ya(),toolUseId:N().optional()}),z({...js,kind:he("ask_user_question"),toolUseId:N(),questions:ve(fH)}),z({...js,kind:he("turn_end"),durationMs:Q().int().nonnegative().optional(),reason:et(Que).optional(),turnId:N().min(1).optional()}),z({...js,kind:he("subagent_progress"),toolUseId:N(),agentId:N(),status:et(["started","running","completed","failed"]),description:N().optional(),lastToolName:N().optional(),prompt:N().optional(),stats:z({durationMs:Q().int().nonnegative().optional(),tokens:Q().int().nonnegative().optional(),toolUseCount:Q().int().nonnegative().optional()}).optional()}),z({...js,kind:he("error"),message:N()}),z({...js,kind:he("meta_update"),patch:Fue}),z({...js,kind:he("meta-text"),text:N(),metaSource:et(["cc","owner"]).optional()})]);z({cwd:N().min(1).optional(),tool:N().optional(),label:N().optional(),aiLabel:N().optional(),model:N().optional(),permissionMode:N().optional(),effort:N().optional(),serviceTier:L7.optional(),iconKey:N().optional(),forkedFromSessionId:N().min(1).optional(),forkAt:Yle([z({messageUuid:N().min(1)}).strict(),z({turnId:N().min(1)}).strict()]).optional(),ephemeral:Re().optional(),ownerPersonaId:N().min(1).optional(),projectPath:N().min(1).optional()}).refine(e=>e.cwd!=null||e.ownerPersonaId!=null||e.projectPath!=null,{message:"cwd / ownerPersonaId / projectPath 至少传一个"});z({path:N().min(1),name:N().min(1),createdAt:N().datetime(),pinnedAt:Q().optional()});z({path:N().min(1),pinnedAt:Q().nullable()});z({path:N().min(1)});z({path:N().min(1).optional(),name:N().min(1).optional()}).refine(e=>e.path!=null||e.name!=null,{message:"path 与 name 至少给一个"});z({cwd:N().min(1),tool:N().min(1),toolSessionId:N().min(1),label:N().optional(),aiLabel:N().optional(),iconKey:N().optional(),createdAt:N().datetime(),updatedAt:N().datetime(),ownerPersonaId:N().min(1).optional()});z({originOnly:Re().optional(),ownerPersonaId:N().min(1).optional(),limit:Q().int().positive().optional(),offset:Q().int().nonnegative().optional()});z({sessionId:N().min(1)});z({sessionId:N().min(1),patch:z({label:N().optional(),tool:N().min(1).optional(),model:N().optional(),permissionMode:N().optional(),effort:N().optional(),cwd:N().optional(),iconKey:N().optional(),ephemeral:he(!1).optional()})});z({id:N().min(1),text:N(),queuedAt:Q(),senderDisplayName:N().optional()});z({sessionId:N().min(1),text:N(),queueWhileRunning:Re().optional()});z({sessionId:N().min(1),id:N().min(1).optional()});z({sessionId:N().min(1),userMessageId:N().min(1),dryRun:Re().optional()});z({canRewind:Re(),error:N().optional(),filesChanged:ve(N()).optional(),insertions:Q().int().nonnegative().optional(),deletions:Q().int().nonnegative().optional()});z({sessionId:N().min(1),userMessageId:N().min(1)});const Jue=z({oldStart:Q().int().nonnegative(),oldLines:Q().int().nonnegative(),newStart:Q().int().nonnegative(),newLines:Q().int().nonnegative(),lines:ve(N())}),ede=z({filePath:N().min(1),hunks:ve(Jue),insertions:Q().int().nonnegative(),deletions:Q().int().nonnegative(),status:et(["modified","added","deleted"]).optional()});z({canRewind:Re(),error:N().optional(),files:ve(ede),totalInsertions:Q().int().nonnegative(),totalDeletions:Q().int().nonnegative()});z({userMessageIds:ve(N())});z({sessionId:N().min(1),toolSessionId:N().min(1)});z({cwd:N().min(1),toolSessionId:N().min(1),messageUuid:N().min(1).optional(),turnId:N().min(1).optional(),sourceSessionId:N().min(1).optional(),targetCwd:N().min(1).optional()}).refine(e=>!!(e.messageUuid||e.turnId),"messageUuid or turnId required");z({forkedToolSessionId:N().min(1),forkedFilePath:N().min(1)});z({sessionId:N().min(1),toolSessionId:N().min(1),jsonlPath:N().optional()});z({sessionId:N().min(1),afterSeq:Q().int().min(-1)});z({sessionId:N().min(1),permissionRequestId:N().min(1),allow:Re(),permanent:Re().optional(),pattern:N().optional()});z({projectPath:N().min(1)});z({sessionId:N().min(1),limit:Q().int().positive().max(5e3).optional(),offset:Q().int().nonnegative().optional(),snapshotId:N().uuid().optional(),slim:Re().optional(),view:et(["turns","items"]).optional(),cursor:N().min(1).max(16384).optional(),turnId:N().min(1).max(256).optional()}).superRefine((e,t)=>{e.view==="items"&&!e.turnId&&t.addIssue({code:ke.custom,path:["turnId"],message:"items requires turnId"}),e.view&&(e.offset!==void 0||e.slim!==void 0)&&t.addIssue({code:ke.custom,message:"native views do not accept offset or slim"}),!e.view&&(e.cursor!==void 0||e.turnId!==void 0)&&t.addIssue({code:ke.custom,message:"cursor and turnId require a native view"}),e.view==="turns"&&e.turnId!==void 0&&t.addIssue({code:ke.custom,path:["turnId"],message:"turns does not accept turnId"}),e.view&&e.limit!==void 0&&e.limit>100&&t.addIssue({code:ke.custom,path:["limit"],message:"native page limit is 100"})});z({cwd:N().min(1),toolSessionId:N().min(1)});z({cwd:N().min(1),toolSessionId:N().min(1),subagentId:N().min(1)});z({cwd:N().min(1).optional(),path:N().optional(),showHidden:Re().optional()});z({cwd:N().min(1),path:N().min(1)});z({cwd:N().min(1),tool:N().optional()});z({name:N().min(1),source:et(Due),path:N().optional(),description:N().optional(),plugin:N().optional()});const tde=z({name:N().min(1),source:et(Aue),path:N().optional(),description:N().optional(),whenToUse:N().optional(),plugin:N().optional()});z({cwd:N().min(1),tool:N().optional()});z({agents:ve(tde)});z({sessionId:N().optional()});z({sessionId:N().min(1).optional()});z({sessionId:N().min(1),pinned:Re()});z({sessionId:N().min(1),archived:Re()});z({query:N().min(1),sessionIds:ve(N().min(1)),limit:Q().int().positive().max(50).optional()});const nde=z({sessionId:N().min(1),snippet:N()});z({type:he("session:searchContent"),matches:ve(nde)});z({type:he("peerSession:upsert:ok")});z({sessionId:N().min(1)});z({type:he("peerSession:remove:ok")});z({orderedIds:ve(N().min(1)).min(1)});z({cwd:N().min(1)});z({isGitRoot:Re(),gitRoot:N().nullable()});z({cwd:N().min(1)});z({branch:N().nullable()});z({cwd:N().min(1)});z({branches:ve(N()),head:N().nullable()});const rde=z({cwd:N().min(1),updatedAt:N().min(1)});z({dirs:ve(rde)});z({type:he("session:question"),sessionId:N().min(1),toolUseId:N().min(1),requestId:N().min(1),questions:ve(fH).min(1)});z({type:he("session:question:cleared"),sessionId:N().min(1),toolUseId:N().min(1),answers:Zi(N(),N()).optional()});z({sessionId:N().min(1),toolUseId:N().min(1),answers:Zi(N(),N())});z({ok:he(!0)});z({sessionId:N().min(1),toolUseId:N().min(1)});z({ok:he(!0)});const pH=z({name:N().min(1),version:N().min(1),instanceId:N().min(1),deviceLabel:N().transform(e=>e.trim().slice(0,64)).optional()});z({type:he("auth"),token:N().min(1),scheme:he("bearer").optional(),clientInfo:pH.optional()});z({type:he("auth:ok"),version:N().min(1).optional(),protocolVersion:Q().int().nonnegative().optional()});const sde=z({clientId:N().min(1),connectedAt:Q().int().nonnegative(),self:Re(),clientInfo:pH.optional()});z({type:he("device:connections:ok"),connections:ve(sde)});z({type:he("tunnel:ready"),url:N().min(1),subdomain:N().min(1)});z({type:he("tunnel:exited"),code:Q().int().nullable(),subdomain:N().nullable(),url:N().nullable()});z({type:he("tunnel:unavailable"),reason:N().min(1),failedAt:N().min(1)});const ide=z({sessionId:N().min(1),status:Lue,freshSpawn:Re(),pendingPermissionRequestIds:ve(N().min(1)),pendingQuestionToolUseIds:ve(N().min(1))});z({type:he("info"),version:N(),protocolVersion:Q(),hostname:N(),os:N(),tools:ve(z({id:N(),available:Re()})),runningSessions:ve(ide),tokenRole:et(tce).optional(),isLoopback:Re().optional(),httpBaseUrl:N().optional(),httpToken:N().optional(),daemonSource:et(["ota","packaged"]).optional(),globalCliVersion:N().nullable().optional()});z({});z({method:N().min(1).optional()});const ode=["allowed","conditional","denied"],ade=et(ode),lde=z({name:N().min(1),status:ade,description:N().min(1),args:ve(z({name:N(),required:Re()})).nullable(),argsSchema:Zi(Ya()).optional(),reason:N().optional()});z({type:he("meta:methods"),methods:ve(lde)});const xO=1,cde=z({usedBytes:Q().int().nonnegative(),sizeBytes:Q().int().positive(),measuredAt:Q().int().nonnegative()}).strict();z({volume:cde.nullable()}).strict();const vO=25*1024*1024,G5={".png":"image/png",".jpg":"image/jpeg",".jpeg":"image/jpeg",".gif":"image/gif",".webp":"image/webp",".pdf":"application/pdf",".txt":"text/plain",".md":"text/plain",".markdown":"text/plain",".csv":"text/plain",".log":"text/plain",".json":"application/json",".xml":"application/xml",".yaml":"application/yaml",".yml":"application/yaml",".html":"text/html",".conf":"text/plain",".cfg":"text/plain",".ini":"text/plain",".toml":"text/plain"},mH=new Set([...Object.values(G5),"application/x-yaml"]),gH=[...mH,"text/*",...Object.keys(G5)].join(",");function xH(e,t){const n=t.split(";",1)[0].trim().toLowerCase();if(n===""||n==="application/octet-stream"){const r=e.lastIndexOf("."),s=r>0?e.slice(r).toLowerCase():"";return G5[s]??null}return mH.has(n)||n.startsWith("text/")?n:null}const ude=["daemon","main","renderer"],dde=et(ude),hde=["debug","info","warn","error"],fde=et(hde);z({ts:Q().int(),source:dde,level:fde,msg:N(),ownerPrincipalId:N(),deviceId:N(),appVersion:N(),daemonVersion:N().optional(),os:N(),meta_json:N().optional(),sessionId:N().optional()});z({v:he(1),visitorId:N().min(1),displayName:N(),provider:N(),iat:Q(),exp:Q()});const pde=z({visitorId:N(),displayName:N(),avatarUrl:N().optional(),provider:N(),firstSeen:Q(),lastSeen:Q()});z({visitors:ve(pde)});z({type:he("web:open"),url:N().min(1),expiresAt:Q()});z({ticket:N().min(1)}).strict();z({token:N().min(1),expiresAt:Q()});const mde=/<system-reminder>此消息来自飞书群成员 (.+?)<\/system-reminder>\s*$/,vH=/<system-reminder>此消息来自 (owner|guest):(.+?)<\/system-reminder>\s*$/,yH="clawd-dispatch-task",bH="clawd-dispatch-result",yO=120;function gde(e){if(!e)return null;const t=e.search(bO(yH)),n=e.search(bO(bH));return t<0&&n<0?null:n<0?"task":t<0?"result":t<n?"task":"result"}function xde(e){if(!e)return[];const t=[];for(const n of["task","result"]){const r=n==="task"?yH:bH,s=new RegExp(`<${r}\\b([^>]*)>([\\s\\S]*?)</${r}>`,"gi");for(let i=s.exec(e);i!==null;i=s.exec(e))t.push({at:i.index,block:vde(n,i[1]??"",i[2]??"")})}return t.sort((n,r)=>n.at-r.at).map(n=>n.block)}function vde(e,t,n){var u;const r=Cde(t),s=tj(kde(_k(n,"detail")??n)),i=(u=_k(n,"brief"))==null?void 0:u.trim(),o=i&&i.length>0?tj(i):yde(s),l=r.round!==void 0?Number.parseInt(r.round,10):void 0,c=r.status;return{kind:e,dispatchId:r["dispatch-id"]??"",...r.from?{from:r.from}:{},...e==="task"&&l!==void 0&&Number.isFinite(l)?{round:l}:{},...e==="result"&&(c==="success"||c==="failure")?{status:c}:{},brief:o,briefIsDerived:!(i&&i.length>0),detail:s,filePaths:Sde(_k(n,"files"))}}function yde(e){const t=e.split(/\n\s*\n/).map(r=>r.trim()).find(r=>r.length>0);if(!t)return"";const n=t.replace(/\s+/g," ");return n.length>yO?`${n.slice(0,yO)}…`:n}const bde="clawd-dispatch-task|clawd-dispatch-result|brief|detail|files",wde=new RegExp(`<\\\\(\\\\*)(/?)(${bde})\\b`,"g");function _de(e){return tj(e)}function tj(e){return e.replace(wde,"<$1$2$3")}function _k(e,t){const n=new RegExp(`<${t}>([\\s\\S]*?)</${t}>`,"i").exec(e);return n?n[1]??"":null}function Sde(e){return e?e.split(`
96
96
  `).map(t=>t.trim()).filter(t=>t.startsWith("- ")).map(t=>t.slice(2).trim()).filter(t=>t.length>0):[]}function kde(e){return e.replace(/^\n/,"").replace(/\n$/,"")}function bO(e){return new RegExp(`<${e}\\b[^>]*>`,"i")}function Cde(e){const t={},n=/([a-z-]+)="([^"]*)"/gi;for(let r=n.exec(e);r!==null;r=n.exec(e))t[r[1]]=Nde(r[2]??"");return t}function Nde(e){return e.replace(/&quot;/g,'"').replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&amp;/g,"&")}/**
97
97
  * @license lucide-react v0.577.0 - ISC
98
98
  *