agent-canvas 0.9.0-dev.7 → 0.9.0-dev.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +10 -0
- package/bin/lib/commands/review-remote.ts +186 -0
- package/bin/lib/commands/review.ts +88 -25
- package/bin/lib/instructions/app-review.md +31 -0
- package/daemon/build.ts +2 -0
- package/daemon/dist/review.js +3 -3
- package/daemon/review-widget/client.ts +16 -1
- package/daemon/review-widget/index.tsx +69 -11
- package/daemon/review-widget/remote-client.ts +117 -0
- package/daemon/review-widget/widget.tsx +3 -9
- package/daemon/src/review/model.ts +0 -5
- package/daemon/src/review/remote.ts +112 -0
- package/daemon/src/review/sealing.ts +35 -0
- package/daemon/src/review/server.ts +2 -1
- package/daemon/src/review/store.ts +16 -35
- package/daemon/src/review/threads.ts +63 -0
- package/package.json +23 -6
- package/skills/canvas/SKILL.md +2 -1
- package/types/bin/agent-canvas.d.ts +2 -0
- package/types/bin/lib/commands/daemon.d.ts +1 -0
- package/types/bin/lib/commands/exec.d.ts +7 -0
- package/types/bin/lib/commands/fetch.d.ts +1 -0
- package/types/bin/lib/commands/install.d.ts +1 -0
- package/types/bin/lib/commands/instructions.d.ts +1 -0
- package/types/bin/lib/commands/push.d.ts +1 -0
- package/types/bin/lib/commands/review-remote.d.ts +52 -0
- package/types/bin/lib/commands/review.d.ts +1 -0
- package/types/bin/lib/commands/watch.d.ts +1 -0
- package/types/bin/lib/config.d.ts +9 -0
- package/types/bin/lib/daemon-lifecycle.d.ts +4 -0
- package/types/bin/lib/helpers.d.ts +13 -0
- package/types/daemon/build.d.ts +1 -0
- package/types/daemon/client/App.d.ts +1 -0
- package/types/daemon/client/CompareView.d.ts +17 -0
- package/types/daemon/client/FileBrowser.d.ts +4 -0
- package/types/daemon/client/FileViewer.d.ts +6 -0
- package/types/daemon/client/OverviewView.d.ts +18 -0
- package/types/daemon/client/ReviewerIdentityDialog.d.ts +17 -0
- package/types/daemon/client/RevisionSelect.d.ts +10 -0
- package/types/daemon/client/SessionSwitcher.d.ts +6 -0
- package/types/daemon/client/ShareDialog.d.ts +30 -0
- package/types/daemon/client/apiSchemas.d.ts +1311 -0
- package/types/daemon/client/canvas-runtime.d.ts +1 -0
- package/types/daemon/client/clientApi.d.ts +112 -0
- package/types/daemon/client/components/SecretInput.d.ts +10 -0
- package/types/daemon/client/components/index.d.ts +2 -0
- package/types/daemon/client/domDiff.d.ts +37 -0
- package/types/daemon/client/errorMessage.d.ts +1 -0
- package/types/daemon/client/exportMarkdown.d.ts +1 -0
- package/types/daemon/client/lcs.d.ts +2 -0
- package/types/daemon/client/shareCrypto.d.ts +40 -0
- package/types/daemon/client/unifiedDiff.d.ts +26 -0
- package/types/daemon/langMap.d.ts +2 -0
- package/types/daemon/review-widget/anchor.d.ts +18 -0
- package/types/daemon/review-widget/browser.d.ts +6 -0
- package/types/daemon/review-widget/client.d.ts +38 -0
- package/types/daemon/review-widget/index.d.ts +1 -0
- package/types/daemon/review-widget/markup.d.ts +4 -0
- package/types/daemon/review-widget/remote-client.d.ts +29 -0
- package/types/daemon/review-widget/screenshot.d.ts +8 -0
- package/types/daemon/review-widget/source.d.ts +17 -0
- package/types/daemon/review-widget/style.d.ts +7 -0
- package/types/daemon/review-widget/widget.d.ts +7 -0
- package/types/daemon/src/components.d.ts +10 -0
- package/types/daemon/src/handlers/api.d.ts +11 -0
- package/types/daemon/src/handlers/files.d.ts +3 -0
- package/types/daemon/src/handlers/static.d.ts +2 -0
- package/types/daemon/src/handlers/uploads.d.ts +3 -0
- package/types/daemon/src/paths.d.ts +12 -0
- package/types/daemon/src/remote-feedback.d.ts +4 -0
- package/types/daemon/src/review/markdown.d.ts +3 -0
- package/types/daemon/src/review/model.d.ts +1089 -0
- package/types/daemon/src/review/proxy.d.ts +30 -0
- package/types/daemon/src/review/remote.d.ts +258 -0
- package/types/daemon/src/review/sealing.d.ts +11 -0
- package/types/daemon/src/review/server.d.ts +24 -0
- package/types/daemon/src/review/store.d.ts +34 -0
- package/types/daemon/src/review/threads.d.ts +35 -0
- package/types/daemon/src/server.d.ts +7 -0
- package/types/daemon/src/share.d.ts +98 -0
- package/types/daemon/src/stubFetch.d.ts +2 -0
package/daemon/dist/review.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(()=>{var n8=Object.create;var{getPrototypeOf:a8,defineProperty:k0,getOwnPropertyNames:s8}=Object;var t8=Object.prototype.hasOwnProperty;function e8($){return this[$]}var $4,J4,Q4=($,J,Q)=>{var W=$!=null&&typeof $==="object";if(W){var q=J?$4??=new WeakMap:J4??=new WeakMap,Y=q.get($);if(Y)return Y}Q=$!=null?n8(a8($)):{};let X=J||!$||!$.__esModule?k0(Q,"default",{value:$,enumerable:!0}):Q;for(let G of s8($))if(!t8.call(X,G))k0(X,G,{get:e8.bind($,G),enumerable:!0});if(W)q.set($,X);return X};var W4=($,J)=>()=>(J||$((J={exports:{}}).exports,J),J.exports);var q4=($)=>$;function Y4($,J){this[$]=q4.bind(null,J)}var X4=($,J)=>{for(var Q in J)k0($,Q,{get:J[Q],enumerable:!0,configurable:!0,set:Y4.bind(J,Q)})};var K8=W4((n0,a0)=>{(function($,J){typeof n0==="object"&&typeof a0<"u"?a0.exports=J():typeof define==="function"&&define.amd?define(J):($=typeof globalThis<"u"?globalThis:$||self,$.resolveURI=J())})(n0,function(){let $=/^[\w+.-]+:\/\//,J=/^([\w+.-]+:)\/\/([^@/#?]*@)?([^:/#?]*)(:\d+)?(\/[^#?]*)?(\?[^#]*)?(#.*)?/,Q=/^file:(?:\/\/((?![a-z]:)[^/#?]*)?)?(\/?[^#?]*)(\?[^#]*)?(#.*)?/i;function W(F){return $.test(F)}function q(F){return F.startsWith("//")}function Y(F){return F.startsWith("/")}function X(F){return F.startsWith("file:")}function G(F){return/^[.?#]/.test(F)}function H(F){let O=J.exec(F);return M(O[1],O[2]||"",O[3],O[4]||"",O[5]||"/",O[6]||"",O[7]||"")}function B(F){let O=Q.exec(F),A=O[2];return M("file:","",O[1]||"","",Y(A)?A:"/"+A,O[3]||"",O[4]||"")}function M(F,O,A,P,T,C,y){return{scheme:F,user:O,host:A,port:P,path:T,query:C,hash:y,type:7}}function N(F){if(q(F)){let A=H("http:"+F);return A.scheme="",A.type=6,A}if(Y(F)){let A=H("http://foo.com"+F);return A.scheme="",A.host="",A.type=5,A}if(X(F))return B(F);if(W(F))return H(F);let O=H("http://foo.com/"+F);return O.scheme="",O.host="",O.type=F?F.startsWith("?")?3:F.startsWith("#")?2:4:1,O}function z(F){if(F.endsWith("/.."))return F;let O=F.lastIndexOf("/");return F.slice(0,O+1)}function V(F,O){if(k(O,O.type),F.path==="/")F.path=O.path;else F.path=z(O.path)+F.path}function k(F,O){let A=O<=4,P=F.path.split("/"),T=1,C=0,y=!1;for(let u=1;u<P.length;u++){let o=P[u];if(!o){y=!0;continue}if(y=!1,o===".")continue;if(o===".."){if(C)y=!0,C--,T--;else if(A)P[T++]=o;continue}P[T++]=o,C++}let c="";for(let u=1;u<T;u++)c+="/"+P[u];if(!c||y&&!c.endsWith("/.."))c+="/";F.path=c}function I(F,O){if(!F&&!O)return"";let A=N(F),P=A.type;if(O&&P!==7){let C=N(O),y=C.type;switch(P){case 1:A.hash=C.hash;case 2:A.query=C.query;case 3:case 4:V(A,C);case 5:A.user=C.user,A.host=C.host,A.port=C.port;case 6:A.scheme=C.scheme}if(y>P)P=y}k(A,P);let T=A.query+A.hash;switch(P){case 2:case 3:return T;case 4:{let C=A.path.slice(1);if(!C)return T||".";if(G(O||F)&&!G(C))return"./"+C+T;return C+T}case 5:return A.path+T;default:return A.scheme+"//"+A.user+A.host+A.port+A.path+T}}return I})});var B0,f,N2,G4,z1,K2,w2,b2,C0,W0,c1,U2,I0,P0,f0,H4,X0={},G0=[],B4=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,z0=Array.isArray;function X1($,J){for(var Q in J)$[Q]=J[Q];return $}function T0($){$&&$.parentNode&&$.parentNode.removeChild($)}function z4($,J,Q){var W,q,Y,X={};for(Y in J)Y=="key"?W=J[Y]:Y=="ref"?q=J[Y]:X[Y]=J[Y];if(arguments.length>2&&(X.children=arguments.length>3?B0.call(arguments,2):Q),typeof $=="function"&&$.defaultProps!=null)for(Y in $.defaultProps)X[Y]===void 0&&(X[Y]=$.defaultProps[Y]);return q0($,X,W,q,null)}function q0($,J,Q,W,q){var Y={type:$,props:J,key:Q,ref:W,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:q==null?++N2:q,__i:-1,__u:0};return q==null&&f.vnode!=null&&f.vnode(Y),Y}function J1($){return $.children}function Y0($,J){this.props=$,this.context=J}function w1($,J){if(J==null)return $.__?w1($.__,$.__i+1):null;for(var Q;J<$.__k.length;J++)if((Q=$.__k[J])!=null&&Q.__e!=null)return Q.__e;return typeof $.type=="function"?w1($):null}function _4($){if($.__P&&$.__d){var J=$.__v,Q=J.__e,W=[],q=[],Y=X1({},J);Y.__v=J.__v+1,f.vnode&&f.vnode(Y),g0($.__P,Y,J,$.__n,$.__P.namespaceURI,32&J.__u?[Q]:null,W,Q==null?w1(J):Q,!!(32&J.__u),q),Y.__v=J.__v,Y.__.__k[Y.__i]=Y,L2(W,Y,q),J.__e=J.__=null,Y.__e!=Q&&O2(Y)}}function O2($){if(($=$.__)!=null&&$.__c!=null)return $.__e=$.__c.base=null,$.__k.some(function(J){if(J!=null&&J.__e!=null)return $.__e=$.__c.base=J.__e}),O2($)}function V2($){(!$.__d&&($.__d=!0)&&z1.push($)&&!H0.__r++||K2!=f.debounceRendering)&&((K2=f.debounceRendering)||w2)(H0)}function H0(){try{for(var $,J=1;z1.length;)z1.length>J&&z1.sort(b2),$=z1.shift(),J=z1.length,_4($)}finally{z1.length=H0.__r=0}}function R2($,J,Q,W,q,Y,X,G,H,B,M){var N,z,V,k,I,F,O=W&&W.__k||G0,A=J.length;for(H=M4(Q,J,O,H,A),N=0;N<A;N++)(V=Q.__k[N])!=null&&(z=V.__i!=-1&&O[V.__i]||X0,V.__i=N,F=g0($,V,z,q,Y,X,G,H,B,M),k=V.__e,V.ref&&z.ref!=V.ref&&(z.ref&&x0(z.ref,null,V),M.push(V.ref,V.__c||k,V)),I==null&&k!=null&&(I=k),4&V.__u?(H=D2(V,H,$),z.__e&&(z.__e=null)):typeof V.type=="function"&&F!==void 0?H=F:k&&(H=k.nextSibling),V.__u&=-7);return Q.__e=I,H}function M4($,J,Q,W,q){var Y,X,G,H,B,M=Q.length,N=M,z=0;for($.__k=Array(q),Y=0;Y<q;Y++)(X=J[Y])!=null&&typeof X!="boolean"&&typeof X!="function"?(typeof X=="string"||typeof X=="number"||typeof X=="bigint"||X.constructor==String?X=$.__k[Y]=q0(null,X,null,null,null):z0(X)?X=$.__k[Y]=q0(J1,{children:X},null,null,null):X.constructor===void 0&&X.__b>0?X=$.__k[Y]=q0(X.type,X.props,X.key,X.ref?X.ref:null,X.__v):$.__k[Y]=X,H=Y+z,X.__=$,X.__b=$.__b+1,G=null,(B=X.__i=j4(X,Q,H,N))!=-1&&(N--,(G=Q[B])&&(G.__u|=2)),G==null||G.__v==null?(B==-1&&(q>M?z--:q<M&&z++),typeof X.type!="function"&&(X.__u|=4)):B!=H&&(B==H-1?z--:B==H+1?z++:(B>H?z--:z++,X.__u|=4))):$.__k[Y]=null;if(N)for(Y=0;Y<M;Y++)(G=Q[Y])!=null&&(2&G.__u)==0&&(G.__e==W&&(W=w1(G)),E2(G,G));return W}function D2($,J,Q){var W,q;if(typeof $.type=="function"){for(W=$.__k,q=0;W&&q<W.length;q++)W[q]&&(W[q].__=$,J=D2(W[q],J,Q));return J}$.__e!=J&&(J&&$.type&&!J.parentNode&&(J=w1($)),J=Q.insertBefore($.__e,J||null));do J=J&&J.nextSibling;while(J!=null&&J.nodeType==8);return J}function j4($,J,Q,W){var q,Y,X,G=$.key,H=$.type,B=J[Q],M=B!=null&&(2&B.__u)==0;if(B===null&&G==null||M&&G==B.key&&H==B.type)return Q;if(W>(M?1:0)){for(q=Q-1,Y=Q+1;q>=0||Y<J.length;)if((B=J[X=q>=0?q--:Y++])!=null&&(2&B.__u)==0&&G==B.key&&H==B.type)return X}return-1}function F2($,J,Q){J[0]=="-"?$.setProperty(J,Q==null?"":Q):$[J]=Q==null?"":typeof Q!="number"||B4.test(J)?Q:Q+"px"}function Q0($,J,Q,W,q){var Y,X;$:if(J=="style")if(typeof Q=="string")$.style.cssText=Q;else{if(typeof W=="string"&&($.style.cssText=W=""),W)for(J in W)Q&&J in Q||F2($.style,J,"");if(Q)for(J in Q)W&&Q[J]==W[J]||F2($.style,J,Q[J])}else if(J[0]=="o"&&J[1]=="n")Y=J!=(J=J.replace(U2,"$1")),X=J.toLowerCase(),J=X in $||J=="onFocusOut"||J=="onFocusIn"?X.slice(2):J.slice(2),$.l||($.l={}),$.l[J+Y]=Q,Q?W?Q[c1]=W[c1]:(Q[c1]=I0,$.addEventListener(J,Y?f0:P0,Y)):$.removeEventListener(J,Y?f0:P0,Y);else{if(q=="http://www.w3.org/2000/svg")J=J.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(J!="width"&&J!="height"&&J!="href"&&J!="list"&&J!="form"&&J!="tabIndex"&&J!="download"&&J!="rowSpan"&&J!="colSpan"&&J!="role"&&J!="popover"&&J in $)try{$[J]=Q==null?"":Q;break $}catch(G){}typeof Q=="function"||(Q==null||Q===!1&&J[4]!="-"?$.removeAttribute(J):$.setAttribute(J,J=="popover"&&Q==1?"":Q))}}function A2($){return function(J){if(this.l){var Q=this.l[J.type+$];if(J[W0]==null)J[W0]=I0++;else if(J[W0]<Q[c1])return;return Q(f.event?f.event(J):J)}}}function g0($,J,Q,W,q,Y,X,G,H,B){var M,N,z,V,k,I,F,O,A,P,T,C,y,c,u,o,i=J.type;if(J.constructor!==void 0)return null;128&Q.__u&&(H=!!(32&Q.__u),Y=[G=J.__e=Q.__e]),(M=f.__b)&&M(J);$:if(typeof i=="function"){N=X.length;try{if(A=J.props,P=i.prototype&&i.prototype.render,T=(M=i.contextType)&&W[M.__c],C=M?T?T.props.value:M.__:W,Q.__c?O=(z=J.__c=Q.__c).__=z.__E:(P?J.__c=z=new i(A,C):(J.__c=z=new Y0(A,C),z.constructor=i,z.render=V4),T&&T.sub(z),z.state||(z.state={}),z.__n=W,V=z.__d=!0,z.__h=[],z._sb=[]),P&&z.__s==null&&(z.__s=z.state),P&&i.getDerivedStateFromProps!=null&&(z.__s==z.state&&(z.__s=X1({},z.__s)),X1(z.__s,i.getDerivedStateFromProps(A,z.__s))),k=z.props,I=z.state,z.__v=J,V)P&&i.getDerivedStateFromProps==null&&z.componentWillMount!=null&&z.componentWillMount(),P&&z.componentDidMount!=null&&z.__h.push(z.componentDidMount);else{if(P&&i.getDerivedStateFromProps==null&&A!==k&&z.componentWillReceiveProps!=null&&z.componentWillReceiveProps(A,C),J.__v==Q.__v||!z.__e&&z.shouldComponentUpdate!=null&&z.shouldComponentUpdate(A,z.__s,C)===!1){J.__v!=Q.__v&&(z.props=A,z.state=z.__s,z.__d=!1),J.__e=Q.__e,J.__k=Q.__k,J.__k.some(function($1){$1&&($1.__=J)}),G0.push.apply(z.__h,z._sb),z._sb=[],z.__h.length&&X.push(z),G=w1(Q);break $}z.componentWillUpdate!=null&&z.componentWillUpdate(A,z.__s,C),P&&z.componentDidUpdate!=null&&z.__h.push(function(){z.componentDidUpdate(k,I,F)})}if(z.context=C,z.props=A,z.__P=$,z.__e=!1,y=f.__r,c=0,P)z.state=z.__s,z.__d=!1,y&&y(J),M=z.render(z.props,z.state,z.context),G0.push.apply(z.__h,z._sb),z._sb=[];else do z.__d=!1,y&&y(J),M=z.render(z.props,z.state,z.context),z.state=z.__s;while(z.__d&&++c<25);z.state=z.__s,z.getChildContext!=null&&(W=X1(X1({},W),z.getChildContext())),P&&!V&&z.getSnapshotBeforeUpdate!=null&&(F=z.getSnapshotBeforeUpdate(k,I)),u=M!=null&&M.type===J1&&M.key==null?v2(M.props.children):M,G=R2($,z0(u)?u:[u],J,Q,W,q,Y,X,G,H,B),z.base=J.__e,J.__u&=-161,z.__h.length&&X.push(z),O&&(z.__E=z.__=null)}catch($1){if(X.length=N,J.__v=null,H||Y!=null){if($1.then){for(J.__u|=H?160:128;G&&G.nodeType==8&&G.nextSibling;)G=G.nextSibling;Y!=null&&(Y[Y.indexOf(G)]=null),J.__e=G}else if(Y!=null)for(o=Y.length;o--;)T0(Y[o])}else J.__e=Q.__e;J.__k==null&&(J.__k=Q.__k||[]),$1.then||S2(J),f.__e($1,J,Q)}}else Y==null&&J.__v==Q.__v?(J.__k=Q.__k,J.__e=Q.__e):G=J.__e=K4(Q.__e,J,Q,W,q,Y,X,H,B);return(M=f.diffed)&&M(J),128&J.__u?void 0:G}function S2($){$&&($.__c&&($.__c.__e=!0),$.__k&&$.__k.some(S2))}function L2($,J,Q){for(var W=0;W<Q.length;W++)x0(Q[W],Q[++W],Q[++W]);f.__c&&f.__c(J,$),$.some(function(q){try{$=q.__h,q.__h=[],$.some(function(Y){Y.call(q)})}catch(Y){f.__e(Y,q.__v)}})}function v2($){return typeof $!="object"||$==null||$.__b>0?$:z0($)?$.map(v2):$.constructor!==void 0?null:X1({},$)}function K4($,J,Q,W,q,Y,X,G,H){var B,M,N,z,V,k,I,F=Q.props||X0,O=J.props,A=J.type;if(A=="svg"?q="http://www.w3.org/2000/svg":A=="math"?q="http://www.w3.org/1998/Math/MathML":q||(q="http://www.w3.org/1999/xhtml"),Y!=null){for(B=0;B<Y.length;B++)if((V=Y[B])&&"setAttribute"in V==!!A&&(A?V.localName==A:V.nodeType==3)){$=V,Y[B]=null;break}}if($==null){if(A==null)return document.createTextNode(O);$=document.createElementNS(q,A,O.is&&O),G&&(f.__m&&f.__m(J,Y),G=!1),Y=null}if(A==null)F===O||G&&$.data==O||($.data=O);else{if(Y=A=="textarea"&&O.defaultValue!=null?null:Y&&B0.call($.childNodes),!G&&Y!=null)for(F={},B=0;B<$.attributes.length;B++)F[(V=$.attributes[B]).name]=V.value;for(B in F)V=F[B],B=="dangerouslySetInnerHTML"?N=V:B=="children"||(B in O)||B=="value"&&("defaultValue"in O)||B=="checked"&&("defaultChecked"in O)||Q0($,B,null,V,q);for(B in O)V=O[B],B=="children"?z=V:B=="dangerouslySetInnerHTML"?M=V:B=="value"?k=V:B=="checked"?I=V:G&&typeof V!="function"||F[B]===V||Q0($,B,V,F[B],q);if(M)G||N&&(M.__html==N.__html||M.__html==$.innerHTML)||($.innerHTML=M.__html),J.__k=[];else if(N&&($.innerHTML=""),R2(J.type=="template"?$.content:$,z0(z)?z:[z],J,Q,W,A=="foreignObject"?"http://www.w3.org/1999/xhtml":q,Y,X,Y?Y[0]:Q.__k&&w1(Q,0),G,H),Y!=null)for(B=Y.length;B--;)T0(Y[B]);G&&A!="textarea"||(B="value",A=="progress"&&k==null?$.removeAttribute("value"):k!=null&&(k!==$[B]||A=="progress"&&!k||A=="option"&&k!=F[B])&&Q0($,B,k,F[B],q),B="checked",I!=null&&I!=$[B]&&Q0($,B,I,F[B],q))}return $}function x0($,J,Q){try{if(typeof $=="function"){var W=typeof $.__u=="function";W&&$.__u(),W&&J==null||($.__u=$(J))}else $.current=J}catch(q){f.__e(q,Q)}}function E2($,J,Q){var W,q;if(f.unmount&&f.unmount($),(W=$.ref)&&(W.current&&W.current!=$.__e||x0(W,null,J)),(W=$.__c)!=null){if(W.componentWillUnmount)try{W.componentWillUnmount()}catch(Y){f.__e(Y,J)}W.base=W.__P=W.__n=null}if(W=$.__k)for(q=0;q<W.length;q++)W[q]&&E2(W[q],J,Q||typeof $.type!="function");Q||T0($.__e),$.__c=$.__=$.__e=void 0}function V4($,J,Q){return this.constructor($,Q)}function k2($,J,Q){var W,q,Y,X;J==document&&(J=document.documentElement),f.__&&f.__($,J),q=(W=typeof Q=="function")?null:Q&&Q.__k||J.__k,Y=[],X=[],g0(J,$=(!W&&Q||J).__k=z4(J1,null,[$]),q||X0,X0,J.namespaceURI,!W&&Q?[Q]:q?null:J.firstChild?B0.call(J.childNodes):null,Y,!W&&Q?Q:q?q.__e:J.firstChild,W,X),L2(Y,$,X),$.props.children=null}B0=G0.slice,f={__e:function($,J,Q,W){for(var q,Y,X;J=J.__;)if((q=J.__c)&&!q.__)try{if((Y=q.constructor)&&Y.getDerivedStateFromError!=null&&(q.setState(Y.getDerivedStateFromError($)),X=q.__d),q.componentDidCatch!=null&&(q.componentDidCatch($,W||{}),X=q.__d),X)return q.__E=q}catch(G){$=G}throw $}},N2=0,G4=function($){return $!=null&&$.constructor===void 0},Y0.prototype.setState=function($,J){var Q;Q=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=X1({},this.state),typeof $=="function"&&($=$(X1({},Q),this.props)),$&&X1(Q,$),$!=null&&this.__v&&(J&&this._sb.push(J),V2(this))},Y0.prototype.forceUpdate=function($){this.__v&&(this.__e=!0,$&&this.__h.push($),V2(this))},Y0.prototype.render=J1,z1=[],w2=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,b2=function($,J){return $.__v.__b-J.__v.__b},H0.__r=0,C0=Math.random().toString(8),W0="__d"+C0,c1="__a"+C0,U2=/(PointerCapture)$|Capture$/i,I0=0,P0=A2(!1),f0=A2(!0),H4=0;var U={};X4(U,{void:()=>e4,util:()=>E,unknown:()=>s4,union:()=>W6,undefined:()=>r4,tuple:()=>X6,transformer:()=>F6,symbol:()=>o4,string:()=>h2,strictObject:()=>Q6,setErrorMap:()=>N4,set:()=>B6,record:()=>G6,quotelessJson:()=>F4,promise:()=>V6,preprocess:()=>w6,pipeline:()=>b6,ostring:()=>U6,optional:()=>A6,onumber:()=>O6,oboolean:()=>R6,objectUtil:()=>Z0,object:()=>J6,number:()=>y2,nullable:()=>N6,null:()=>n4,never:()=>t4,nativeEnum:()=>K6,nan:()=>p4,map:()=>H6,makeIssue:()=>u1,literal:()=>M6,lazy:()=>_6,late:()=>c4,isValid:()=>_1,isDirty:()=>M0,isAsync:()=>L1,isAborted:()=>_0,intersection:()=>Y6,instanceof:()=>u4,getParsedType:()=>Q1,getErrorMap:()=>S1,function:()=>z6,enum:()=>j6,effect:()=>F6,discriminatedUnion:()=>q6,defaultErrorMap:()=>G1,datetimeRegex:()=>g2,date:()=>i4,custom:()=>Z2,coerce:()=>D6,boolean:()=>m2,bigint:()=>d4,array:()=>$6,any:()=>a4,addIssueToContext:()=>K,ZodVoid:()=>d1,ZodUnknown:()=>M1,ZodUnion:()=>f1,ZodUndefined:()=>C1,ZodType:()=>v,ZodTuple:()=>q1,ZodTransformer:()=>e,ZodSymbol:()=>p1,ZodString:()=>n,ZodSet:()=>R1,ZodSchema:()=>v,ZodRecord:()=>i1,ZodReadonly:()=>y1,ZodPromise:()=>D1,ZodPipeline:()=>n1,ZodParsedType:()=>j,ZodOptional:()=>s,ZodObject:()=>g,ZodNumber:()=>j1,ZodNullable:()=>B1,ZodNull:()=>P1,ZodNever:()=>W1,ZodNativeEnum:()=>x1,ZodNaN:()=>r1,ZodMap:()=>o1,ZodLiteral:()=>g1,ZodLazy:()=>T1,ZodIssueCode:()=>_,ZodIntersection:()=>I1,ZodFunction:()=>E1,ZodFirstPartyTypeKind:()=>D,ZodError:()=>d,ZodEnum:()=>V1,ZodEffects:()=>e,ZodDiscriminatedUnion:()=>j0,ZodDefault:()=>Z1,ZodDate:()=>U1,ZodCatch:()=>h1,ZodBranded:()=>K0,ZodBoolean:()=>k1,ZodBigInt:()=>K1,ZodArray:()=>a,ZodAny:()=>O1,Schema:()=>v,ParseStatus:()=>m,OK:()=>l,NEVER:()=>S6,INVALID:()=>R,EMPTY_PATH:()=>w4,DIRTY:()=>b1,BRAND:()=>l4});var E;(function($){$.assertEqual=(q)=>{};function J(q){}$.assertIs=J;function Q(q){throw Error()}$.assertNever=Q,$.arrayToEnum=(q)=>{let Y={};for(let X of q)Y[X]=X;return Y},$.getValidEnumValues=(q)=>{let Y=$.objectKeys(q).filter((G)=>typeof q[q[G]]!=="number"),X={};for(let G of Y)X[G]=q[G];return $.objectValues(X)},$.objectValues=(q)=>{return $.objectKeys(q).map(function(Y){return q[Y]})},$.objectKeys=typeof Object.keys==="function"?(q)=>Object.keys(q):(q)=>{let Y=[];for(let X in q)if(Object.prototype.hasOwnProperty.call(q,X))Y.push(X);return Y},$.find=(q,Y)=>{for(let X of q)if(Y(X))return X;return},$.isInteger=typeof Number.isInteger==="function"?(q)=>Number.isInteger(q):(q)=>typeof q==="number"&&Number.isFinite(q)&&Math.floor(q)===q;function W(q,Y=" | "){return q.map((X)=>typeof X==="string"?`'${X}'`:X).join(Y)}$.joinValues=W,$.jsonStringifyReplacer=(q,Y)=>{if(typeof Y==="bigint")return Y.toString();return Y}})(E||(E={}));var Z0;(function($){$.mergeShapes=(J,Q)=>{return{...J,...Q}}})(Z0||(Z0={}));var j=E.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Q1=($)=>{switch(typeof $){case"undefined":return j.undefined;case"string":return j.string;case"number":return Number.isNaN($)?j.nan:j.number;case"boolean":return j.boolean;case"function":return j.function;case"bigint":return j.bigint;case"symbol":return j.symbol;case"object":if(Array.isArray($))return j.array;if($===null)return j.null;if($.then&&typeof $.then==="function"&&$.catch&&typeof $.catch==="function")return j.promise;if(typeof Map<"u"&&$ instanceof Map)return j.map;if(typeof Set<"u"&&$ instanceof Set)return j.set;if(typeof Date<"u"&&$ instanceof Date)return j.date;return j.object;default:return j.unknown}};var _=E.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),F4=($)=>{return JSON.stringify($,null,2).replace(/"([^"]+)":/g,"$1:")};class d extends Error{get errors(){return this.issues}constructor($){super();this.issues=[],this.addIssue=(Q)=>{this.issues=[...this.issues,Q]},this.addIssues=(Q=[])=>{this.issues=[...this.issues,...Q]};let J=new.target.prototype;if(Object.setPrototypeOf)Object.setPrototypeOf(this,J);else this.__proto__=J;this.name="ZodError",this.issues=$}format($){let J=$||function(q){return q.message},Q={_errors:[]},W=(q)=>{for(let Y of q.issues)if(Y.code==="invalid_union")Y.unionErrors.map(W);else if(Y.code==="invalid_return_type")W(Y.returnTypeError);else if(Y.code==="invalid_arguments")W(Y.argumentsError);else if(Y.path.length===0)Q._errors.push(J(Y));else{let X=Q,G=0;while(G<Y.path.length){let H=Y.path[G];if(G!==Y.path.length-1)X[H]=X[H]||{_errors:[]};else X[H]=X[H]||{_errors:[]},X[H]._errors.push(J(Y));X=X[H],G++}}};return W(this),Q}static assert($){if(!($ instanceof d))throw Error(`Not a ZodError: ${$}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,E.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten($=(J)=>J.message){let J={},Q=[];for(let W of this.issues)if(W.path.length>0){let q=W.path[0];J[q]=J[q]||[],J[q].push($(W))}else Q.push($(W));return{formErrors:Q,fieldErrors:J}}get formErrors(){return this.flatten()}}d.create=($)=>{return new d($)};var A4=($,J)=>{let Q;switch($.code){case _.invalid_type:if($.received===j.undefined)Q="Required";else Q=`Expected ${$.expected}, received ${$.received}`;break;case _.invalid_literal:Q=`Invalid literal value, expected ${JSON.stringify($.expected,E.jsonStringifyReplacer)}`;break;case _.unrecognized_keys:Q=`Unrecognized key(s) in object: ${E.joinValues($.keys,", ")}`;break;case _.invalid_union:Q="Invalid input";break;case _.invalid_union_discriminator:Q=`Invalid discriminator value. Expected ${E.joinValues($.options)}`;break;case _.invalid_enum_value:Q=`Invalid enum value. Expected ${E.joinValues($.options)}, received '${$.received}'`;break;case _.invalid_arguments:Q="Invalid function arguments";break;case _.invalid_return_type:Q="Invalid function return type";break;case _.invalid_date:Q="Invalid date";break;case _.invalid_string:if(typeof $.validation==="object")if("includes"in $.validation){if(Q=`Invalid input: must include "${$.validation.includes}"`,typeof $.validation.position==="number")Q=`${Q} at one or more positions greater than or equal to ${$.validation.position}`}else if("startsWith"in $.validation)Q=`Invalid input: must start with "${$.validation.startsWith}"`;else if("endsWith"in $.validation)Q=`Invalid input: must end with "${$.validation.endsWith}"`;else E.assertNever($.validation);else if($.validation!=="regex")Q=`Invalid ${$.validation}`;else Q="Invalid";break;case _.too_small:if($.type==="array")Q=`Array must contain ${$.exact?"exactly":$.inclusive?"at least":"more than"} ${$.minimum} element(s)`;else if($.type==="string")Q=`String must contain ${$.exact?"exactly":$.inclusive?"at least":"over"} ${$.minimum} character(s)`;else if($.type==="number")Q=`Number must be ${$.exact?"exactly equal to ":$.inclusive?"greater than or equal to ":"greater than "}${$.minimum}`;else if($.type==="bigint")Q=`Number must be ${$.exact?"exactly equal to ":$.inclusive?"greater than or equal to ":"greater than "}${$.minimum}`;else if($.type==="date")Q=`Date must be ${$.exact?"exactly equal to ":$.inclusive?"greater than or equal to ":"greater than "}${new Date(Number($.minimum))}`;else Q="Invalid input";break;case _.too_big:if($.type==="array")Q=`Array must contain ${$.exact?"exactly":$.inclusive?"at most":"less than"} ${$.maximum} element(s)`;else if($.type==="string")Q=`String must contain ${$.exact?"exactly":$.inclusive?"at most":"under"} ${$.maximum} character(s)`;else if($.type==="number")Q=`Number must be ${$.exact?"exactly":$.inclusive?"less than or equal to":"less than"} ${$.maximum}`;else if($.type==="bigint")Q=`BigInt must be ${$.exact?"exactly":$.inclusive?"less than or equal to":"less than"} ${$.maximum}`;else if($.type==="date")Q=`Date must be ${$.exact?"exactly":$.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number($.maximum))}`;else Q="Invalid input";break;case _.custom:Q="Invalid input";break;case _.invalid_intersection_types:Q="Intersection results could not be merged";break;case _.not_multiple_of:Q=`Number must be a multiple of ${$.multipleOf}`;break;case _.not_finite:Q="Number must be finite";break;default:Q=J.defaultError,E.assertNever($)}return{message:Q}},G1=A4;var C2=G1;function N4($){C2=$}function S1(){return C2}var u1=($)=>{let{data:J,path:Q,errorMaps:W,issueData:q}=$,Y=[...Q,...q.path||[]],X={...q,path:Y};if(q.message!==void 0)return{...q,path:Y,message:q.message};let G="",H=W.filter((B)=>!!B).slice().reverse();for(let B of H)G=B(X,{data:J,defaultError:G}).message;return{...q,path:Y,message:G}},w4=[];function K($,J){let Q=S1(),W=u1({issueData:J,data:$.data,path:$.path,errorMaps:[$.common.contextualErrorMap,$.schemaErrorMap,Q,Q===G1?void 0:G1].filter((q)=>!!q)});$.common.issues.push(W)}class m{constructor(){this.value="valid"}dirty(){if(this.value==="valid")this.value="dirty"}abort(){if(this.value!=="aborted")this.value="aborted"}static mergeArray($,J){let Q=[];for(let W of J){if(W.status==="aborted")return R;if(W.status==="dirty")$.dirty();Q.push(W.value)}return{status:$.value,value:Q}}static async mergeObjectAsync($,J){let Q=[];for(let W of J){let q=await W.key,Y=await W.value;Q.push({key:q,value:Y})}return m.mergeObjectSync($,Q)}static mergeObjectSync($,J){let Q={};for(let W of J){let{key:q,value:Y}=W;if(q.status==="aborted")return R;if(Y.status==="aborted")return R;if(q.status==="dirty")$.dirty();if(Y.status==="dirty")$.dirty();if(q.value!=="__proto__"&&(typeof Y.value<"u"||W.alwaysSet))Q[q.value]=Y.value}return{status:$.value,value:Q}}}var R=Object.freeze({status:"aborted"}),b1=($)=>({status:"dirty",value:$}),l=($)=>({status:"valid",value:$}),_0=($)=>$.status==="aborted",M0=($)=>$.status==="dirty",_1=($)=>$.status==="valid",L1=($)=>typeof Promise<"u"&&$ instanceof Promise;var b;(function($){$.errToObj=(J)=>typeof J==="string"?{message:J}:J||{},$.toString=(J)=>typeof J==="string"?J:J?.message})(b||(b={}));class t{constructor($,J,Q,W){this._cachedPath=[],this.parent=$,this.data=J,this._path=Q,this._key=W}get path(){if(!this._cachedPath.length)if(Array.isArray(this._key))this._cachedPath.push(...this._path,...this._key);else this._cachedPath.push(...this._path,this._key);return this._cachedPath}}var P2=($,J)=>{if(_1(J))return{success:!0,data:J.value};else{if(!$.common.issues.length)throw Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let Q=new d($.common.issues);return this._error=Q,this._error}}}};function L($){if(!$)return{};let{errorMap:J,invalid_type_error:Q,required_error:W,description:q}=$;if(J&&(Q||W))throw Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);if(J)return{errorMap:J,description:q};return{errorMap:(X,G)=>{let{message:H}=$;if(X.code==="invalid_enum_value")return{message:H??G.defaultError};if(typeof G.data>"u")return{message:H??W??G.defaultError};if(X.code!=="invalid_type")return{message:G.defaultError};return{message:H??Q??G.defaultError}},description:q}}class v{get description(){return this._def.description}_getType($){return Q1($.data)}_getOrReturnCtx($,J){return J||{common:$.parent.common,data:$.data,parsedType:Q1($.data),schemaErrorMap:this._def.errorMap,path:$.path,parent:$.parent}}_processInputParams($){return{status:new m,ctx:{common:$.parent.common,data:$.data,parsedType:Q1($.data),schemaErrorMap:this._def.errorMap,path:$.path,parent:$.parent}}}_parseSync($){let J=this._parse($);if(L1(J))throw Error("Synchronous parse encountered promise.");return J}_parseAsync($){let J=this._parse($);return Promise.resolve(J)}parse($,J){let Q=this.safeParse($,J);if(Q.success)return Q.data;throw Q.error}safeParse($,J){let Q={common:{issues:[],async:J?.async??!1,contextualErrorMap:J?.errorMap},path:J?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:$,parsedType:Q1($)},W=this._parseSync({data:$,path:Q.path,parent:Q});return P2(Q,W)}"~validate"($){let J={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:$,parsedType:Q1($)};if(!this["~standard"].async)try{let Q=this._parseSync({data:$,path:[],parent:J});return _1(Q)?{value:Q.value}:{issues:J.common.issues}}catch(Q){if(Q?.message?.toLowerCase()?.includes("encountered"))this["~standard"].async=!0;J.common={issues:[],async:!0}}return this._parseAsync({data:$,path:[],parent:J}).then((Q)=>_1(Q)?{value:Q.value}:{issues:J.common.issues})}async parseAsync($,J){let Q=await this.safeParseAsync($,J);if(Q.success)return Q.data;throw Q.error}async safeParseAsync($,J){let Q={common:{issues:[],contextualErrorMap:J?.errorMap,async:!0},path:J?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:$,parsedType:Q1($)},W=this._parse({data:$,path:Q.path,parent:Q}),q=await(L1(W)?W:Promise.resolve(W));return P2(Q,q)}refine($,J){let Q=(W)=>{if(typeof J==="string"||typeof J>"u")return{message:J};else if(typeof J==="function")return J(W);else return J};return this._refinement((W,q)=>{let Y=$(W),X=()=>q.addIssue({code:_.custom,...Q(W)});if(typeof Promise<"u"&&Y instanceof Promise)return Y.then((G)=>{if(!G)return X(),!1;else return!0});if(!Y)return X(),!1;else return!0})}refinement($,J){return this._refinement((Q,W)=>{if(!$(Q))return W.addIssue(typeof J==="function"?J(Q,W):J),!1;else return!0})}_refinement($){return new e({schema:this,typeName:D.ZodEffects,effect:{type:"refinement",refinement:$}})}superRefine($){return this._refinement($)}constructor($){this.spa=this.safeParseAsync,this._def=$,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:(J)=>this["~validate"](J)}}optional(){return s.create(this,this._def)}nullable(){return B1.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return a.create(this)}promise(){return D1.create(this,this._def)}or($){return f1.create([this,$],this._def)}and($){return I1.create(this,$,this._def)}transform($){return new e({...L(this._def),schema:this,typeName:D.ZodEffects,effect:{type:"transform",transform:$}})}default($){let J=typeof $==="function"?$:()=>$;return new Z1({...L(this._def),innerType:this,defaultValue:J,typeName:D.ZodDefault})}brand(){return new K0({typeName:D.ZodBranded,type:this,...L(this._def)})}catch($){let J=typeof $==="function"?$:()=>$;return new h1({...L(this._def),innerType:this,catchValue:J,typeName:D.ZodCatch})}describe($){return new this.constructor({...this._def,description:$})}pipe($){return n1.create(this,$)}readonly(){return y1.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}var b4=/^c[^\s-]{8,}$/i,U4=/^[0-9a-z]+$/,O4=/^[0-9A-HJKMNP-TV-Z]{26}$/i,R4=/^[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,D4=/^[a-z0-9_-]{21}$/i,S4=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,L4=/^[-+]?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)?)??$/,v4=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,E4="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",h0,k4=/^(?:(?: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])$/,C4=/^(?:(?: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])$/,P4=/^(([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]))$/,f4=/^(([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])$/,I4=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,T4=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,I2="((\\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])))",g4=new RegExp(`^${I2}$`);function T2($){let J="[0-5]\\d";if($.precision)J=`${J}\\.\\d{${$.precision}}`;else if($.precision==null)J=`${J}(\\.\\d+)?`;let Q=$.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${J})${Q}`}function x4($){return new RegExp(`^${T2($)}$`)}function g2($){let J=`${I2}T${T2($)}`,Q=[];if(Q.push($.local?"Z?":"Z"),$.offset)Q.push("([+-]\\d{2}:?\\d{2})");return J=`${J}(${Q.join("|")})`,new RegExp(`^${J}$`)}function Z4($,J){if((J==="v4"||!J)&&k4.test($))return!0;if((J==="v6"||!J)&&P4.test($))return!0;return!1}function h4($,J){if(!S4.test($))return!1;try{let[Q]=$.split(".");if(!Q)return!1;let W=Q.replace(/-/g,"+").replace(/_/g,"/").padEnd(Q.length+(4-Q.length%4)%4,"="),q=JSON.parse(atob(W));if(typeof q!=="object"||q===null)return!1;if("typ"in q&&q?.typ!=="JWT")return!1;if(!q.alg)return!1;if(J&&q.alg!==J)return!1;return!0}catch{return!1}}function y4($,J){if((J==="v4"||!J)&&C4.test($))return!0;if((J==="v6"||!J)&&f4.test($))return!0;return!1}class n extends v{_parse($){if(this._def.coerce)$.data=String($.data);if(this._getType($)!==j.string){let q=this._getOrReturnCtx($);return K(q,{code:_.invalid_type,expected:j.string,received:q.parsedType}),R}let Q=new m,W=void 0;for(let q of this._def.checks)if(q.kind==="min"){if($.data.length<q.value)W=this._getOrReturnCtx($,W),K(W,{code:_.too_small,minimum:q.value,type:"string",inclusive:!0,exact:!1,message:q.message}),Q.dirty()}else if(q.kind==="max"){if($.data.length>q.value)W=this._getOrReturnCtx($,W),K(W,{code:_.too_big,maximum:q.value,type:"string",inclusive:!0,exact:!1,message:q.message}),Q.dirty()}else if(q.kind==="length"){let Y=$.data.length>q.value,X=$.data.length<q.value;if(Y||X){if(W=this._getOrReturnCtx($,W),Y)K(W,{code:_.too_big,maximum:q.value,type:"string",inclusive:!0,exact:!0,message:q.message});else if(X)K(W,{code:_.too_small,minimum:q.value,type:"string",inclusive:!0,exact:!0,message:q.message});Q.dirty()}}else if(q.kind==="email"){if(!v4.test($.data))W=this._getOrReturnCtx($,W),K(W,{validation:"email",code:_.invalid_string,message:q.message}),Q.dirty()}else if(q.kind==="emoji"){if(!h0)h0=new RegExp(E4,"u");if(!h0.test($.data))W=this._getOrReturnCtx($,W),K(W,{validation:"emoji",code:_.invalid_string,message:q.message}),Q.dirty()}else if(q.kind==="uuid"){if(!R4.test($.data))W=this._getOrReturnCtx($,W),K(W,{validation:"uuid",code:_.invalid_string,message:q.message}),Q.dirty()}else if(q.kind==="nanoid"){if(!D4.test($.data))W=this._getOrReturnCtx($,W),K(W,{validation:"nanoid",code:_.invalid_string,message:q.message}),Q.dirty()}else if(q.kind==="cuid"){if(!b4.test($.data))W=this._getOrReturnCtx($,W),K(W,{validation:"cuid",code:_.invalid_string,message:q.message}),Q.dirty()}else if(q.kind==="cuid2"){if(!U4.test($.data))W=this._getOrReturnCtx($,W),K(W,{validation:"cuid2",code:_.invalid_string,message:q.message}),Q.dirty()}else if(q.kind==="ulid"){if(!O4.test($.data))W=this._getOrReturnCtx($,W),K(W,{validation:"ulid",code:_.invalid_string,message:q.message}),Q.dirty()}else if(q.kind==="url")try{new URL($.data)}catch{W=this._getOrReturnCtx($,W),K(W,{validation:"url",code:_.invalid_string,message:q.message}),Q.dirty()}else if(q.kind==="regex"){if(q.regex.lastIndex=0,!q.regex.test($.data))W=this._getOrReturnCtx($,W),K(W,{validation:"regex",code:_.invalid_string,message:q.message}),Q.dirty()}else if(q.kind==="trim")$.data=$.data.trim();else if(q.kind==="includes"){if(!$.data.includes(q.value,q.position))W=this._getOrReturnCtx($,W),K(W,{code:_.invalid_string,validation:{includes:q.value,position:q.position},message:q.message}),Q.dirty()}else if(q.kind==="toLowerCase")$.data=$.data.toLowerCase();else if(q.kind==="toUpperCase")$.data=$.data.toUpperCase();else if(q.kind==="startsWith"){if(!$.data.startsWith(q.value))W=this._getOrReturnCtx($,W),K(W,{code:_.invalid_string,validation:{startsWith:q.value},message:q.message}),Q.dirty()}else if(q.kind==="endsWith"){if(!$.data.endsWith(q.value))W=this._getOrReturnCtx($,W),K(W,{code:_.invalid_string,validation:{endsWith:q.value},message:q.message}),Q.dirty()}else if(q.kind==="datetime"){if(!g2(q).test($.data))W=this._getOrReturnCtx($,W),K(W,{code:_.invalid_string,validation:"datetime",message:q.message}),Q.dirty()}else if(q.kind==="date"){if(!g4.test($.data))W=this._getOrReturnCtx($,W),K(W,{code:_.invalid_string,validation:"date",message:q.message}),Q.dirty()}else if(q.kind==="time"){if(!x4(q).test($.data))W=this._getOrReturnCtx($,W),K(W,{code:_.invalid_string,validation:"time",message:q.message}),Q.dirty()}else if(q.kind==="duration"){if(!L4.test($.data))W=this._getOrReturnCtx($,W),K(W,{validation:"duration",code:_.invalid_string,message:q.message}),Q.dirty()}else if(q.kind==="ip"){if(!Z4($.data,q.version))W=this._getOrReturnCtx($,W),K(W,{validation:"ip",code:_.invalid_string,message:q.message}),Q.dirty()}else if(q.kind==="jwt"){if(!h4($.data,q.alg))W=this._getOrReturnCtx($,W),K(W,{validation:"jwt",code:_.invalid_string,message:q.message}),Q.dirty()}else if(q.kind==="cidr"){if(!y4($.data,q.version))W=this._getOrReturnCtx($,W),K(W,{validation:"cidr",code:_.invalid_string,message:q.message}),Q.dirty()}else if(q.kind==="base64"){if(!I4.test($.data))W=this._getOrReturnCtx($,W),K(W,{validation:"base64",code:_.invalid_string,message:q.message}),Q.dirty()}else if(q.kind==="base64url"){if(!T4.test($.data))W=this._getOrReturnCtx($,W),K(W,{validation:"base64url",code:_.invalid_string,message:q.message}),Q.dirty()}else E.assertNever(q);return{status:Q.value,value:$.data}}_regex($,J,Q){return this.refinement((W)=>$.test(W),{validation:J,code:_.invalid_string,...b.errToObj(Q)})}_addCheck($){return new n({...this._def,checks:[...this._def.checks,$]})}email($){return this._addCheck({kind:"email",...b.errToObj($)})}url($){return this._addCheck({kind:"url",...b.errToObj($)})}emoji($){return this._addCheck({kind:"emoji",...b.errToObj($)})}uuid($){return this._addCheck({kind:"uuid",...b.errToObj($)})}nanoid($){return this._addCheck({kind:"nanoid",...b.errToObj($)})}cuid($){return this._addCheck({kind:"cuid",...b.errToObj($)})}cuid2($){return this._addCheck({kind:"cuid2",...b.errToObj($)})}ulid($){return this._addCheck({kind:"ulid",...b.errToObj($)})}base64($){return this._addCheck({kind:"base64",...b.errToObj($)})}base64url($){return this._addCheck({kind:"base64url",...b.errToObj($)})}jwt($){return this._addCheck({kind:"jwt",...b.errToObj($)})}ip($){return this._addCheck({kind:"ip",...b.errToObj($)})}cidr($){return this._addCheck({kind:"cidr",...b.errToObj($)})}datetime($){if(typeof $==="string")return this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:$});return this._addCheck({kind:"datetime",precision:typeof $?.precision>"u"?null:$?.precision,offset:$?.offset??!1,local:$?.local??!1,...b.errToObj($?.message)})}date($){return this._addCheck({kind:"date",message:$})}time($){if(typeof $==="string")return this._addCheck({kind:"time",precision:null,message:$});return this._addCheck({kind:"time",precision:typeof $?.precision>"u"?null:$?.precision,...b.errToObj($?.message)})}duration($){return this._addCheck({kind:"duration",...b.errToObj($)})}regex($,J){return this._addCheck({kind:"regex",regex:$,...b.errToObj(J)})}includes($,J){return this._addCheck({kind:"includes",value:$,position:J?.position,...b.errToObj(J?.message)})}startsWith($,J){return this._addCheck({kind:"startsWith",value:$,...b.errToObj(J)})}endsWith($,J){return this._addCheck({kind:"endsWith",value:$,...b.errToObj(J)})}min($,J){return this._addCheck({kind:"min",value:$,...b.errToObj(J)})}max($,J){return this._addCheck({kind:"max",value:$,...b.errToObj(J)})}length($,J){return this._addCheck({kind:"length",value:$,...b.errToObj(J)})}nonempty($){return this.min(1,b.errToObj($))}trim(){return new n({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new n({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new n({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(($)=>$.kind==="datetime")}get isDate(){return!!this._def.checks.find(($)=>$.kind==="date")}get isTime(){return!!this._def.checks.find(($)=>$.kind==="time")}get isDuration(){return!!this._def.checks.find(($)=>$.kind==="duration")}get isEmail(){return!!this._def.checks.find(($)=>$.kind==="email")}get isURL(){return!!this._def.checks.find(($)=>$.kind==="url")}get isEmoji(){return!!this._def.checks.find(($)=>$.kind==="emoji")}get isUUID(){return!!this._def.checks.find(($)=>$.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(($)=>$.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(($)=>$.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(($)=>$.kind==="cuid2")}get isULID(){return!!this._def.checks.find(($)=>$.kind==="ulid")}get isIP(){return!!this._def.checks.find(($)=>$.kind==="ip")}get isCIDR(){return!!this._def.checks.find(($)=>$.kind==="cidr")}get isBase64(){return!!this._def.checks.find(($)=>$.kind==="base64")}get isBase64url(){return!!this._def.checks.find(($)=>$.kind==="base64url")}get minLength(){let $=null;for(let J of this._def.checks)if(J.kind==="min"){if($===null||J.value>$)$=J.value}return $}get maxLength(){let $=null;for(let J of this._def.checks)if(J.kind==="max"){if($===null||J.value<$)$=J.value}return $}}n.create=($)=>{return new n({checks:[],typeName:D.ZodString,coerce:$?.coerce??!1,...L($)})};function m4($,J){let Q=($.toString().split(".")[1]||"").length,W=(J.toString().split(".")[1]||"").length,q=Q>W?Q:W,Y=Number.parseInt($.toFixed(q).replace(".","")),X=Number.parseInt(J.toFixed(q).replace(".",""));return Y%X/10**q}class j1 extends v{constructor(){super(...arguments);this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse($){if(this._def.coerce)$.data=Number($.data);if(this._getType($)!==j.number){let q=this._getOrReturnCtx($);return K(q,{code:_.invalid_type,expected:j.number,received:q.parsedType}),R}let Q=void 0,W=new m;for(let q of this._def.checks)if(q.kind==="int"){if(!E.isInteger($.data))Q=this._getOrReturnCtx($,Q),K(Q,{code:_.invalid_type,expected:"integer",received:"float",message:q.message}),W.dirty()}else if(q.kind==="min"){if(q.inclusive?$.data<q.value:$.data<=q.value)Q=this._getOrReturnCtx($,Q),K(Q,{code:_.too_small,minimum:q.value,type:"number",inclusive:q.inclusive,exact:!1,message:q.message}),W.dirty()}else if(q.kind==="max"){if(q.inclusive?$.data>q.value:$.data>=q.value)Q=this._getOrReturnCtx($,Q),K(Q,{code:_.too_big,maximum:q.value,type:"number",inclusive:q.inclusive,exact:!1,message:q.message}),W.dirty()}else if(q.kind==="multipleOf"){if(m4($.data,q.value)!==0)Q=this._getOrReturnCtx($,Q),K(Q,{code:_.not_multiple_of,multipleOf:q.value,message:q.message}),W.dirty()}else if(q.kind==="finite"){if(!Number.isFinite($.data))Q=this._getOrReturnCtx($,Q),K(Q,{code:_.not_finite,message:q.message}),W.dirty()}else E.assertNever(q);return{status:W.value,value:$.data}}gte($,J){return this.setLimit("min",$,!0,b.toString(J))}gt($,J){return this.setLimit("min",$,!1,b.toString(J))}lte($,J){return this.setLimit("max",$,!0,b.toString(J))}lt($,J){return this.setLimit("max",$,!1,b.toString(J))}setLimit($,J,Q,W){return new j1({...this._def,checks:[...this._def.checks,{kind:$,value:J,inclusive:Q,message:b.toString(W)}]})}_addCheck($){return new j1({...this._def,checks:[...this._def.checks,$]})}int($){return this._addCheck({kind:"int",message:b.toString($)})}positive($){return this._addCheck({kind:"min",value:0,inclusive:!1,message:b.toString($)})}negative($){return this._addCheck({kind:"max",value:0,inclusive:!1,message:b.toString($)})}nonpositive($){return this._addCheck({kind:"max",value:0,inclusive:!0,message:b.toString($)})}nonnegative($){return this._addCheck({kind:"min",value:0,inclusive:!0,message:b.toString($)})}multipleOf($,J){return this._addCheck({kind:"multipleOf",value:$,message:b.toString(J)})}finite($){return this._addCheck({kind:"finite",message:b.toString($)})}safe($){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:b.toString($)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:b.toString($)})}get minValue(){let $=null;for(let J of this._def.checks)if(J.kind==="min"){if($===null||J.value>$)$=J.value}return $}get maxValue(){let $=null;for(let J of this._def.checks)if(J.kind==="max"){if($===null||J.value<$)$=J.value}return $}get isInt(){return!!this._def.checks.find(($)=>$.kind==="int"||$.kind==="multipleOf"&&E.isInteger($.value))}get isFinite(){let $=null,J=null;for(let Q of this._def.checks)if(Q.kind==="finite"||Q.kind==="int"||Q.kind==="multipleOf")return!0;else if(Q.kind==="min"){if(J===null||Q.value>J)J=Q.value}else if(Q.kind==="max"){if($===null||Q.value<$)$=Q.value}return Number.isFinite(J)&&Number.isFinite($)}}j1.create=($)=>{return new j1({checks:[],typeName:D.ZodNumber,coerce:$?.coerce||!1,...L($)})};class K1 extends v{constructor(){super(...arguments);this.min=this.gte,this.max=this.lte}_parse($){if(this._def.coerce)try{$.data=BigInt($.data)}catch{return this._getInvalidInput($)}if(this._getType($)!==j.bigint)return this._getInvalidInput($);let Q=void 0,W=new m;for(let q of this._def.checks)if(q.kind==="min"){if(q.inclusive?$.data<q.value:$.data<=q.value)Q=this._getOrReturnCtx($,Q),K(Q,{code:_.too_small,type:"bigint",minimum:q.value,inclusive:q.inclusive,message:q.message}),W.dirty()}else if(q.kind==="max"){if(q.inclusive?$.data>q.value:$.data>=q.value)Q=this._getOrReturnCtx($,Q),K(Q,{code:_.too_big,type:"bigint",maximum:q.value,inclusive:q.inclusive,message:q.message}),W.dirty()}else if(q.kind==="multipleOf"){if($.data%q.value!==BigInt(0))Q=this._getOrReturnCtx($,Q),K(Q,{code:_.not_multiple_of,multipleOf:q.value,message:q.message}),W.dirty()}else E.assertNever(q);return{status:W.value,value:$.data}}_getInvalidInput($){let J=this._getOrReturnCtx($);return K(J,{code:_.invalid_type,expected:j.bigint,received:J.parsedType}),R}gte($,J){return this.setLimit("min",$,!0,b.toString(J))}gt($,J){return this.setLimit("min",$,!1,b.toString(J))}lte($,J){return this.setLimit("max",$,!0,b.toString(J))}lt($,J){return this.setLimit("max",$,!1,b.toString(J))}setLimit($,J,Q,W){return new K1({...this._def,checks:[...this._def.checks,{kind:$,value:J,inclusive:Q,message:b.toString(W)}]})}_addCheck($){return new K1({...this._def,checks:[...this._def.checks,$]})}positive($){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:b.toString($)})}negative($){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:b.toString($)})}nonpositive($){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:b.toString($)})}nonnegative($){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:b.toString($)})}multipleOf($,J){return this._addCheck({kind:"multipleOf",value:$,message:b.toString(J)})}get minValue(){let $=null;for(let J of this._def.checks)if(J.kind==="min"){if($===null||J.value>$)$=J.value}return $}get maxValue(){let $=null;for(let J of this._def.checks)if(J.kind==="max"){if($===null||J.value<$)$=J.value}return $}}K1.create=($)=>{return new K1({checks:[],typeName:D.ZodBigInt,coerce:$?.coerce??!1,...L($)})};class k1 extends v{_parse($){if(this._def.coerce)$.data=Boolean($.data);if(this._getType($)!==j.boolean){let Q=this._getOrReturnCtx($);return K(Q,{code:_.invalid_type,expected:j.boolean,received:Q.parsedType}),R}return l($.data)}}k1.create=($)=>{return new k1({typeName:D.ZodBoolean,coerce:$?.coerce||!1,...L($)})};class U1 extends v{_parse($){if(this._def.coerce)$.data=new Date($.data);if(this._getType($)!==j.date){let q=this._getOrReturnCtx($);return K(q,{code:_.invalid_type,expected:j.date,received:q.parsedType}),R}if(Number.isNaN($.data.getTime())){let q=this._getOrReturnCtx($);return K(q,{code:_.invalid_date}),R}let Q=new m,W=void 0;for(let q of this._def.checks)if(q.kind==="min"){if($.data.getTime()<q.value)W=this._getOrReturnCtx($,W),K(W,{code:_.too_small,message:q.message,inclusive:!0,exact:!1,minimum:q.value,type:"date"}),Q.dirty()}else if(q.kind==="max"){if($.data.getTime()>q.value)W=this._getOrReturnCtx($,W),K(W,{code:_.too_big,message:q.message,inclusive:!0,exact:!1,maximum:q.value,type:"date"}),Q.dirty()}else E.assertNever(q);return{status:Q.value,value:new Date($.data.getTime())}}_addCheck($){return new U1({...this._def,checks:[...this._def.checks,$]})}min($,J){return this._addCheck({kind:"min",value:$.getTime(),message:b.toString(J)})}max($,J){return this._addCheck({kind:"max",value:$.getTime(),message:b.toString(J)})}get minDate(){let $=null;for(let J of this._def.checks)if(J.kind==="min"){if($===null||J.value>$)$=J.value}return $!=null?new Date($):null}get maxDate(){let $=null;for(let J of this._def.checks)if(J.kind==="max"){if($===null||J.value<$)$=J.value}return $!=null?new Date($):null}}U1.create=($)=>{return new U1({checks:[],coerce:$?.coerce||!1,typeName:D.ZodDate,...L($)})};class p1 extends v{_parse($){if(this._getType($)!==j.symbol){let Q=this._getOrReturnCtx($);return K(Q,{code:_.invalid_type,expected:j.symbol,received:Q.parsedType}),R}return l($.data)}}p1.create=($)=>{return new p1({typeName:D.ZodSymbol,...L($)})};class C1 extends v{_parse($){if(this._getType($)!==j.undefined){let Q=this._getOrReturnCtx($);return K(Q,{code:_.invalid_type,expected:j.undefined,received:Q.parsedType}),R}return l($.data)}}C1.create=($)=>{return new C1({typeName:D.ZodUndefined,...L($)})};class P1 extends v{_parse($){if(this._getType($)!==j.null){let Q=this._getOrReturnCtx($);return K(Q,{code:_.invalid_type,expected:j.null,received:Q.parsedType}),R}return l($.data)}}P1.create=($)=>{return new P1({typeName:D.ZodNull,...L($)})};class O1 extends v{constructor(){super(...arguments);this._any=!0}_parse($){return l($.data)}}O1.create=($)=>{return new O1({typeName:D.ZodAny,...L($)})};class M1 extends v{constructor(){super(...arguments);this._unknown=!0}_parse($){return l($.data)}}M1.create=($)=>{return new M1({typeName:D.ZodUnknown,...L($)})};class W1 extends v{_parse($){let J=this._getOrReturnCtx($);return K(J,{code:_.invalid_type,expected:j.never,received:J.parsedType}),R}}W1.create=($)=>{return new W1({typeName:D.ZodNever,...L($)})};class d1 extends v{_parse($){if(this._getType($)!==j.undefined){let Q=this._getOrReturnCtx($);return K(Q,{code:_.invalid_type,expected:j.void,received:Q.parsedType}),R}return l($.data)}}d1.create=($)=>{return new d1({typeName:D.ZodVoid,...L($)})};class a extends v{_parse($){let{ctx:J,status:Q}=this._processInputParams($),W=this._def;if(J.parsedType!==j.array)return K(J,{code:_.invalid_type,expected:j.array,received:J.parsedType}),R;if(W.exactLength!==null){let Y=J.data.length>W.exactLength.value,X=J.data.length<W.exactLength.value;if(Y||X)K(J,{code:Y?_.too_big:_.too_small,minimum:X?W.exactLength.value:void 0,maximum:Y?W.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:W.exactLength.message}),Q.dirty()}if(W.minLength!==null){if(J.data.length<W.minLength.value)K(J,{code:_.too_small,minimum:W.minLength.value,type:"array",inclusive:!0,exact:!1,message:W.minLength.message}),Q.dirty()}if(W.maxLength!==null){if(J.data.length>W.maxLength.value)K(J,{code:_.too_big,maximum:W.maxLength.value,type:"array",inclusive:!0,exact:!1,message:W.maxLength.message}),Q.dirty()}if(J.common.async)return Promise.all([...J.data].map((Y,X)=>{return W.type._parseAsync(new t(J,Y,J.path,X))})).then((Y)=>{return m.mergeArray(Q,Y)});let q=[...J.data].map((Y,X)=>{return W.type._parseSync(new t(J,Y,J.path,X))});return m.mergeArray(Q,q)}get element(){return this._def.type}min($,J){return new a({...this._def,minLength:{value:$,message:b.toString(J)}})}max($,J){return new a({...this._def,maxLength:{value:$,message:b.toString(J)}})}length($,J){return new a({...this._def,exactLength:{value:$,message:b.toString(J)}})}nonempty($){return this.min(1,$)}}a.create=($,J)=>{return new a({type:$,minLength:null,maxLength:null,exactLength:null,typeName:D.ZodArray,...L(J)})};function v1($){if($ instanceof g){let J={};for(let Q in $.shape){let W=$.shape[Q];J[Q]=s.create(v1(W))}return new g({...$._def,shape:()=>J})}else if($ instanceof a)return new a({...$._def,type:v1($.element)});else if($ instanceof s)return s.create(v1($.unwrap()));else if($ instanceof B1)return B1.create(v1($.unwrap()));else if($ instanceof q1)return q1.create($.items.map((J)=>v1(J)));else return $}class g extends v{constructor(){super(...arguments);this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let $=this._def.shape(),J=E.objectKeys($);return this._cached={shape:$,keys:J},this._cached}_parse($){if(this._getType($)!==j.object){let H=this._getOrReturnCtx($);return K(H,{code:_.invalid_type,expected:j.object,received:H.parsedType}),R}let{status:Q,ctx:W}=this._processInputParams($),{shape:q,keys:Y}=this._getCached(),X=[];if(!(this._def.catchall instanceof W1&&this._def.unknownKeys==="strip")){for(let H in W.data)if(!Y.includes(H))X.push(H)}let G=[];for(let H of Y){let B=q[H],M=W.data[H];G.push({key:{status:"valid",value:H},value:B._parse(new t(W,M,W.path,H)),alwaysSet:H in W.data})}if(this._def.catchall instanceof W1){let H=this._def.unknownKeys;if(H==="passthrough")for(let B of X)G.push({key:{status:"valid",value:B},value:{status:"valid",value:W.data[B]}});else if(H==="strict"){if(X.length>0)K(W,{code:_.unrecognized_keys,keys:X}),Q.dirty()}else if(H==="strip");else throw Error("Internal ZodObject error: invalid unknownKeys value.")}else{let H=this._def.catchall;for(let B of X){let M=W.data[B];G.push({key:{status:"valid",value:B},value:H._parse(new t(W,M,W.path,B)),alwaysSet:B in W.data})}}if(W.common.async)return Promise.resolve().then(async()=>{let H=[];for(let B of G){let M=await B.key,N=await B.value;H.push({key:M,value:N,alwaysSet:B.alwaysSet})}return H}).then((H)=>{return m.mergeObjectSync(Q,H)});else return m.mergeObjectSync(Q,G)}get shape(){return this._def.shape()}strict($){return b.errToObj,new g({...this._def,unknownKeys:"strict",...$!==void 0?{errorMap:(J,Q)=>{let W=this._def.errorMap?.(J,Q).message??Q.defaultError;if(J.code==="unrecognized_keys")return{message:b.errToObj($).message??W};return{message:W}}}:{}})}strip(){return new g({...this._def,unknownKeys:"strip"})}passthrough(){return new g({...this._def,unknownKeys:"passthrough"})}extend($){return new g({...this._def,shape:()=>({...this._def.shape(),...$})})}merge($){return new g({unknownKeys:$._def.unknownKeys,catchall:$._def.catchall,shape:()=>({...this._def.shape(),...$._def.shape()}),typeName:D.ZodObject})}setKey($,J){return this.augment({[$]:J})}catchall($){return new g({...this._def,catchall:$})}pick($){let J={};for(let Q of E.objectKeys($))if($[Q]&&this.shape[Q])J[Q]=this.shape[Q];return new g({...this._def,shape:()=>J})}omit($){let J={};for(let Q of E.objectKeys(this.shape))if(!$[Q])J[Q]=this.shape[Q];return new g({...this._def,shape:()=>J})}deepPartial(){return v1(this)}partial($){let J={};for(let Q of E.objectKeys(this.shape)){let W=this.shape[Q];if($&&!$[Q])J[Q]=W;else J[Q]=W.optional()}return new g({...this._def,shape:()=>J})}required($){let J={};for(let Q of E.objectKeys(this.shape))if($&&!$[Q])J[Q]=this.shape[Q];else{let q=this.shape[Q];while(q instanceof s)q=q._def.innerType;J[Q]=q}return new g({...this._def,shape:()=>J})}keyof(){return x2(E.objectKeys(this.shape))}}g.create=($,J)=>{return new g({shape:()=>$,unknownKeys:"strip",catchall:W1.create(),typeName:D.ZodObject,...L(J)})};g.strictCreate=($,J)=>{return new g({shape:()=>$,unknownKeys:"strict",catchall:W1.create(),typeName:D.ZodObject,...L(J)})};g.lazycreate=($,J)=>{return new g({shape:$,unknownKeys:"strip",catchall:W1.create(),typeName:D.ZodObject,...L(J)})};class f1 extends v{_parse($){let{ctx:J}=this._processInputParams($),Q=this._def.options;function W(q){for(let X of q)if(X.result.status==="valid")return X.result;for(let X of q)if(X.result.status==="dirty")return J.common.issues.push(...X.ctx.common.issues),X.result;let Y=q.map((X)=>new d(X.ctx.common.issues));return K(J,{code:_.invalid_union,unionErrors:Y}),R}if(J.common.async)return Promise.all(Q.map(async(q)=>{let Y={...J,common:{...J.common,issues:[]},parent:null};return{result:await q._parseAsync({data:J.data,path:J.path,parent:Y}),ctx:Y}})).then(W);else{let q=void 0,Y=[];for(let G of Q){let H={...J,common:{...J.common,issues:[]},parent:null},B=G._parseSync({data:J.data,path:J.path,parent:H});if(B.status==="valid")return B;else if(B.status==="dirty"&&!q)q={result:B,ctx:H};if(H.common.issues.length)Y.push(H.common.issues)}if(q)return J.common.issues.push(...q.ctx.common.issues),q.result;let X=Y.map((G)=>new d(G));return K(J,{code:_.invalid_union,unionErrors:X}),R}}get options(){return this._def.options}}f1.create=($,J)=>{return new f1({options:$,typeName:D.ZodUnion,...L(J)})};var H1=($)=>{if($ instanceof T1)return H1($.schema);else if($ instanceof e)return H1($.innerType());else if($ instanceof g1)return[$.value];else if($ instanceof V1)return $.options;else if($ instanceof x1)return E.objectValues($.enum);else if($ instanceof Z1)return H1($._def.innerType);else if($ instanceof C1)return[void 0];else if($ instanceof P1)return[null];else if($ instanceof s)return[void 0,...H1($.unwrap())];else if($ instanceof B1)return[null,...H1($.unwrap())];else if($ instanceof K0)return H1($.unwrap());else if($ instanceof y1)return H1($.unwrap());else if($ instanceof h1)return H1($._def.innerType);else return[]};class j0 extends v{_parse($){let{ctx:J}=this._processInputParams($);if(J.parsedType!==j.object)return K(J,{code:_.invalid_type,expected:j.object,received:J.parsedType}),R;let Q=this.discriminator,W=J.data[Q],q=this.optionsMap.get(W);if(!q)return K(J,{code:_.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[Q]}),R;if(J.common.async)return q._parseAsync({data:J.data,path:J.path,parent:J});else return q._parseSync({data:J.data,path:J.path,parent:J})}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create($,J,Q){let W=new Map;for(let q of J){let Y=H1(q.shape[$]);if(!Y.length)throw Error(`A discriminator value for key \`${$}\` could not be extracted from all schema options`);for(let X of Y){if(W.has(X))throw Error(`Discriminator property ${String($)} has duplicate value ${String(X)}`);W.set(X,q)}}return new j0({typeName:D.ZodDiscriminatedUnion,discriminator:$,options:J,optionsMap:W,...L(Q)})}}function y0($,J){let Q=Q1($),W=Q1(J);if($===J)return{valid:!0,data:$};else if(Q===j.object&&W===j.object){let q=E.objectKeys(J),Y=E.objectKeys($).filter((G)=>q.indexOf(G)!==-1),X={...$,...J};for(let G of Y){let H=y0($[G],J[G]);if(!H.valid)return{valid:!1};X[G]=H.data}return{valid:!0,data:X}}else if(Q===j.array&&W===j.array){if($.length!==J.length)return{valid:!1};let q=[];for(let Y=0;Y<$.length;Y++){let X=$[Y],G=J[Y],H=y0(X,G);if(!H.valid)return{valid:!1};q.push(H.data)}return{valid:!0,data:q}}else if(Q===j.date&&W===j.date&&+$===+J)return{valid:!0,data:$};else return{valid:!1}}class I1 extends v{_parse($){let{status:J,ctx:Q}=this._processInputParams($),W=(q,Y)=>{if(_0(q)||_0(Y))return R;let X=y0(q.value,Y.value);if(!X.valid)return K(Q,{code:_.invalid_intersection_types}),R;if(M0(q)||M0(Y))J.dirty();return{status:J.value,value:X.data}};if(Q.common.async)return Promise.all([this._def.left._parseAsync({data:Q.data,path:Q.path,parent:Q}),this._def.right._parseAsync({data:Q.data,path:Q.path,parent:Q})]).then(([q,Y])=>W(q,Y));else return W(this._def.left._parseSync({data:Q.data,path:Q.path,parent:Q}),this._def.right._parseSync({data:Q.data,path:Q.path,parent:Q}))}}I1.create=($,J,Q)=>{return new I1({left:$,right:J,typeName:D.ZodIntersection,...L(Q)})};class q1 extends v{_parse($){let{status:J,ctx:Q}=this._processInputParams($);if(Q.parsedType!==j.array)return K(Q,{code:_.invalid_type,expected:j.array,received:Q.parsedType}),R;if(Q.data.length<this._def.items.length)return K(Q,{code:_.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),R;if(!this._def.rest&&Q.data.length>this._def.items.length)K(Q,{code:_.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),J.dirty();let q=[...Q.data].map((Y,X)=>{let G=this._def.items[X]||this._def.rest;if(!G)return null;return G._parse(new t(Q,Y,Q.path,X))}).filter((Y)=>!!Y);if(Q.common.async)return Promise.all(q).then((Y)=>{return m.mergeArray(J,Y)});else return m.mergeArray(J,q)}get items(){return this._def.items}rest($){return new q1({...this._def,rest:$})}}q1.create=($,J)=>{if(!Array.isArray($))throw Error("You must pass an array of schemas to z.tuple([ ... ])");return new q1({items:$,typeName:D.ZodTuple,rest:null,...L(J)})};class i1 extends v{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse($){let{status:J,ctx:Q}=this._processInputParams($);if(Q.parsedType!==j.object)return K(Q,{code:_.invalid_type,expected:j.object,received:Q.parsedType}),R;let W=[],q=this._def.keyType,Y=this._def.valueType;for(let X in Q.data)W.push({key:q._parse(new t(Q,X,Q.path,X)),value:Y._parse(new t(Q,Q.data[X],Q.path,X)),alwaysSet:X in Q.data});if(Q.common.async)return m.mergeObjectAsync(J,W);else return m.mergeObjectSync(J,W)}get element(){return this._def.valueType}static create($,J,Q){if(J instanceof v)return new i1({keyType:$,valueType:J,typeName:D.ZodRecord,...L(Q)});return new i1({keyType:n.create(),valueType:$,typeName:D.ZodRecord,...L(J)})}}class o1 extends v{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse($){let{status:J,ctx:Q}=this._processInputParams($);if(Q.parsedType!==j.map)return K(Q,{code:_.invalid_type,expected:j.map,received:Q.parsedType}),R;let W=this._def.keyType,q=this._def.valueType,Y=[...Q.data.entries()].map(([X,G],H)=>{return{key:W._parse(new t(Q,X,Q.path,[H,"key"])),value:q._parse(new t(Q,G,Q.path,[H,"value"]))}});if(Q.common.async){let X=new Map;return Promise.resolve().then(async()=>{for(let G of Y){let H=await G.key,B=await G.value;if(H.status==="aborted"||B.status==="aborted")return R;if(H.status==="dirty"||B.status==="dirty")J.dirty();X.set(H.value,B.value)}return{status:J.value,value:X}})}else{let X=new Map;for(let G of Y){let{key:H,value:B}=G;if(H.status==="aborted"||B.status==="aborted")return R;if(H.status==="dirty"||B.status==="dirty")J.dirty();X.set(H.value,B.value)}return{status:J.value,value:X}}}}o1.create=($,J,Q)=>{return new o1({valueType:J,keyType:$,typeName:D.ZodMap,...L(Q)})};class R1 extends v{_parse($){let{status:J,ctx:Q}=this._processInputParams($);if(Q.parsedType!==j.set)return K(Q,{code:_.invalid_type,expected:j.set,received:Q.parsedType}),R;let W=this._def;if(W.minSize!==null){if(Q.data.size<W.minSize.value)K(Q,{code:_.too_small,minimum:W.minSize.value,type:"set",inclusive:!0,exact:!1,message:W.minSize.message}),J.dirty()}if(W.maxSize!==null){if(Q.data.size>W.maxSize.value)K(Q,{code:_.too_big,maximum:W.maxSize.value,type:"set",inclusive:!0,exact:!1,message:W.maxSize.message}),J.dirty()}let q=this._def.valueType;function Y(G){let H=new Set;for(let B of G){if(B.status==="aborted")return R;if(B.status==="dirty")J.dirty();H.add(B.value)}return{status:J.value,value:H}}let X=[...Q.data.values()].map((G,H)=>q._parse(new t(Q,G,Q.path,H)));if(Q.common.async)return Promise.all(X).then((G)=>Y(G));else return Y(X)}min($,J){return new R1({...this._def,minSize:{value:$,message:b.toString(J)}})}max($,J){return new R1({...this._def,maxSize:{value:$,message:b.toString(J)}})}size($,J){return this.min($,J).max($,J)}nonempty($){return this.min(1,$)}}R1.create=($,J)=>{return new R1({valueType:$,minSize:null,maxSize:null,typeName:D.ZodSet,...L(J)})};class E1 extends v{constructor(){super(...arguments);this.validate=this.implement}_parse($){let{ctx:J}=this._processInputParams($);if(J.parsedType!==j.function)return K(J,{code:_.invalid_type,expected:j.function,received:J.parsedType}),R;function Q(X,G){return u1({data:X,path:J.path,errorMaps:[J.common.contextualErrorMap,J.schemaErrorMap,S1(),G1].filter((H)=>!!H),issueData:{code:_.invalid_arguments,argumentsError:G}})}function W(X,G){return u1({data:X,path:J.path,errorMaps:[J.common.contextualErrorMap,J.schemaErrorMap,S1(),G1].filter((H)=>!!H),issueData:{code:_.invalid_return_type,returnTypeError:G}})}let q={errorMap:J.common.contextualErrorMap},Y=J.data;if(this._def.returns instanceof D1){let X=this;return l(async function(...G){let H=new d([]),B=await X._def.args.parseAsync(G,q).catch((z)=>{throw H.addIssue(Q(G,z)),H}),M=await Reflect.apply(Y,this,B);return await X._def.returns._def.type.parseAsync(M,q).catch((z)=>{throw H.addIssue(W(M,z)),H})})}else{let X=this;return l(function(...G){let H=X._def.args.safeParse(G,q);if(!H.success)throw new d([Q(G,H.error)]);let B=Reflect.apply(Y,this,H.data),M=X._def.returns.safeParse(B,q);if(!M.success)throw new d([W(B,M.error)]);return M.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...$){return new E1({...this._def,args:q1.create($).rest(M1.create())})}returns($){return new E1({...this._def,returns:$})}implement($){return this.parse($)}strictImplement($){return this.parse($)}static create($,J,Q){return new E1({args:$?$:q1.create([]).rest(M1.create()),returns:J||M1.create(),typeName:D.ZodFunction,...L(Q)})}}class T1 extends v{get schema(){return this._def.getter()}_parse($){let{ctx:J}=this._processInputParams($);return this._def.getter()._parse({data:J.data,path:J.path,parent:J})}}T1.create=($,J)=>{return new T1({getter:$,typeName:D.ZodLazy,...L(J)})};class g1 extends v{_parse($){if($.data!==this._def.value){let J=this._getOrReturnCtx($);return K(J,{received:J.data,code:_.invalid_literal,expected:this._def.value}),R}return{status:"valid",value:$.data}}get value(){return this._def.value}}g1.create=($,J)=>{return new g1({value:$,typeName:D.ZodLiteral,...L(J)})};function x2($,J){return new V1({values:$,typeName:D.ZodEnum,...L(J)})}class V1 extends v{_parse($){if(typeof $.data!=="string"){let J=this._getOrReturnCtx($),Q=this._def.values;return K(J,{expected:E.joinValues(Q),received:J.parsedType,code:_.invalid_type}),R}if(!this._cache)this._cache=new Set(this._def.values);if(!this._cache.has($.data)){let J=this._getOrReturnCtx($),Q=this._def.values;return K(J,{received:J.data,code:_.invalid_enum_value,options:Q}),R}return l($.data)}get options(){return this._def.values}get enum(){let $={};for(let J of this._def.values)$[J]=J;return $}get Values(){let $={};for(let J of this._def.values)$[J]=J;return $}get Enum(){let $={};for(let J of this._def.values)$[J]=J;return $}extract($,J=this._def){return V1.create($,{...this._def,...J})}exclude($,J=this._def){return V1.create(this.options.filter((Q)=>!$.includes(Q)),{...this._def,...J})}}V1.create=x2;class x1 extends v{_parse($){let J=E.getValidEnumValues(this._def.values),Q=this._getOrReturnCtx($);if(Q.parsedType!==j.string&&Q.parsedType!==j.number){let W=E.objectValues(J);return K(Q,{expected:E.joinValues(W),received:Q.parsedType,code:_.invalid_type}),R}if(!this._cache)this._cache=new Set(E.getValidEnumValues(this._def.values));if(!this._cache.has($.data)){let W=E.objectValues(J);return K(Q,{received:Q.data,code:_.invalid_enum_value,options:W}),R}return l($.data)}get enum(){return this._def.values}}x1.create=($,J)=>{return new x1({values:$,typeName:D.ZodNativeEnum,...L(J)})};class D1 extends v{unwrap(){return this._def.type}_parse($){let{ctx:J}=this._processInputParams($);if(J.parsedType!==j.promise&&J.common.async===!1)return K(J,{code:_.invalid_type,expected:j.promise,received:J.parsedType}),R;let Q=J.parsedType===j.promise?J.data:Promise.resolve(J.data);return l(Q.then((W)=>{return this._def.type.parseAsync(W,{path:J.path,errorMap:J.common.contextualErrorMap})}))}}D1.create=($,J)=>{return new D1({type:$,typeName:D.ZodPromise,...L(J)})};class e extends v{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===D.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse($){let{status:J,ctx:Q}=this._processInputParams($),W=this._def.effect||null,q={addIssue:(Y)=>{if(K(Q,Y),Y.fatal)J.abort();else J.dirty()},get path(){return Q.path}};if(q.addIssue=q.addIssue.bind(q),W.type==="preprocess"){let Y=W.transform(Q.data,q);if(Q.common.async)return Promise.resolve(Y).then(async(X)=>{if(J.value==="aborted")return R;let G=await this._def.schema._parseAsync({data:X,path:Q.path,parent:Q});if(G.status==="aborted")return R;if(G.status==="dirty")return b1(G.value);if(J.value==="dirty")return b1(G.value);return G});else{if(J.value==="aborted")return R;let X=this._def.schema._parseSync({data:Y,path:Q.path,parent:Q});if(X.status==="aborted")return R;if(X.status==="dirty")return b1(X.value);if(J.value==="dirty")return b1(X.value);return X}}if(W.type==="refinement"){let Y=(X)=>{let G=W.refinement(X,q);if(Q.common.async)return Promise.resolve(G);if(G instanceof Promise)throw Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return X};if(Q.common.async===!1){let X=this._def.schema._parseSync({data:Q.data,path:Q.path,parent:Q});if(X.status==="aborted")return R;if(X.status==="dirty")J.dirty();return Y(X.value),{status:J.value,value:X.value}}else return this._def.schema._parseAsync({data:Q.data,path:Q.path,parent:Q}).then((X)=>{if(X.status==="aborted")return R;if(X.status==="dirty")J.dirty();return Y(X.value).then(()=>{return{status:J.value,value:X.value}})})}if(W.type==="transform")if(Q.common.async===!1){let Y=this._def.schema._parseSync({data:Q.data,path:Q.path,parent:Q});if(!_1(Y))return R;let X=W.transform(Y.value,q);if(X instanceof Promise)throw Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:J.value,value:X}}else return this._def.schema._parseAsync({data:Q.data,path:Q.path,parent:Q}).then((Y)=>{if(!_1(Y))return R;return Promise.resolve(W.transform(Y.value,q)).then((X)=>({status:J.value,value:X}))});E.assertNever(W)}}e.create=($,J,Q)=>{return new e({schema:$,typeName:D.ZodEffects,effect:J,...L(Q)})};e.createWithPreprocess=($,J,Q)=>{return new e({schema:J,effect:{type:"preprocess",transform:$},typeName:D.ZodEffects,...L(Q)})};class s extends v{_parse($){if(this._getType($)===j.undefined)return l(void 0);return this._def.innerType._parse($)}unwrap(){return this._def.innerType}}s.create=($,J)=>{return new s({innerType:$,typeName:D.ZodOptional,...L(J)})};class B1 extends v{_parse($){if(this._getType($)===j.null)return l(null);return this._def.innerType._parse($)}unwrap(){return this._def.innerType}}B1.create=($,J)=>{return new B1({innerType:$,typeName:D.ZodNullable,...L(J)})};class Z1 extends v{_parse($){let{ctx:J}=this._processInputParams($),Q=J.data;if(J.parsedType===j.undefined)Q=this._def.defaultValue();return this._def.innerType._parse({data:Q,path:J.path,parent:J})}removeDefault(){return this._def.innerType}}Z1.create=($,J)=>{return new Z1({innerType:$,typeName:D.ZodDefault,defaultValue:typeof J.default==="function"?J.default:()=>J.default,...L(J)})};class h1 extends v{_parse($){let{ctx:J}=this._processInputParams($),Q={...J,common:{...J.common,issues:[]}},W=this._def.innerType._parse({data:Q.data,path:Q.path,parent:{...Q}});if(L1(W))return W.then((q)=>{return{status:"valid",value:q.status==="valid"?q.value:this._def.catchValue({get error(){return new d(Q.common.issues)},input:Q.data})}});else return{status:"valid",value:W.status==="valid"?W.value:this._def.catchValue({get error(){return new d(Q.common.issues)},input:Q.data})}}removeCatch(){return this._def.innerType}}h1.create=($,J)=>{return new h1({innerType:$,typeName:D.ZodCatch,catchValue:typeof J.catch==="function"?J.catch:()=>J.catch,...L(J)})};class r1 extends v{_parse($){if(this._getType($)!==j.nan){let Q=this._getOrReturnCtx($);return K(Q,{code:_.invalid_type,expected:j.nan,received:Q.parsedType}),R}return{status:"valid",value:$.data}}}r1.create=($)=>{return new r1({typeName:D.ZodNaN,...L($)})};var l4=Symbol("zod_brand");class K0 extends v{_parse($){let{ctx:J}=this._processInputParams($),Q=J.data;return this._def.type._parse({data:Q,path:J.path,parent:J})}unwrap(){return this._def.type}}class n1 extends v{_parse($){let{status:J,ctx:Q}=this._processInputParams($);if(Q.common.async)return(async()=>{let q=await this._def.in._parseAsync({data:Q.data,path:Q.path,parent:Q});if(q.status==="aborted")return R;if(q.status==="dirty")return J.dirty(),b1(q.value);else return this._def.out._parseAsync({data:q.value,path:Q.path,parent:Q})})();else{let W=this._def.in._parseSync({data:Q.data,path:Q.path,parent:Q});if(W.status==="aborted")return R;if(W.status==="dirty")return J.dirty(),{status:"dirty",value:W.value};else return this._def.out._parseSync({data:W.value,path:Q.path,parent:Q})}}static create($,J){return new n1({in:$,out:J,typeName:D.ZodPipeline})}}class y1 extends v{_parse($){let J=this._def.innerType._parse($),Q=(W)=>{if(_1(W))W.value=Object.freeze(W.value);return W};return L1(J)?J.then((W)=>Q(W)):Q(J)}unwrap(){return this._def.innerType}}y1.create=($,J)=>{return new y1({innerType:$,typeName:D.ZodReadonly,...L(J)})};function f2($,J){let Q=typeof $==="function"?$(J):typeof $==="string"?{message:$}:$;return typeof Q==="string"?{message:Q}:Q}function Z2($,J={},Q){if($)return O1.create().superRefine((W,q)=>{let Y=$(W);if(Y instanceof Promise)return Y.then((X)=>{if(!X){let G=f2(J,W),H=G.fatal??Q??!0;q.addIssue({code:"custom",...G,fatal:H})}});if(!Y){let X=f2(J,W),G=X.fatal??Q??!0;q.addIssue({code:"custom",...X,fatal:G})}return});return O1.create()}var c4={object:g.lazycreate},D;(function($){$.ZodString="ZodString",$.ZodNumber="ZodNumber",$.ZodNaN="ZodNaN",$.ZodBigInt="ZodBigInt",$.ZodBoolean="ZodBoolean",$.ZodDate="ZodDate",$.ZodSymbol="ZodSymbol",$.ZodUndefined="ZodUndefined",$.ZodNull="ZodNull",$.ZodAny="ZodAny",$.ZodUnknown="ZodUnknown",$.ZodNever="ZodNever",$.ZodVoid="ZodVoid",$.ZodArray="ZodArray",$.ZodObject="ZodObject",$.ZodUnion="ZodUnion",$.ZodDiscriminatedUnion="ZodDiscriminatedUnion",$.ZodIntersection="ZodIntersection",$.ZodTuple="ZodTuple",$.ZodRecord="ZodRecord",$.ZodMap="ZodMap",$.ZodSet="ZodSet",$.ZodFunction="ZodFunction",$.ZodLazy="ZodLazy",$.ZodLiteral="ZodLiteral",$.ZodEnum="ZodEnum",$.ZodEffects="ZodEffects",$.ZodNativeEnum="ZodNativeEnum",$.ZodOptional="ZodOptional",$.ZodNullable="ZodNullable",$.ZodDefault="ZodDefault",$.ZodCatch="ZodCatch",$.ZodPromise="ZodPromise",$.ZodBranded="ZodBranded",$.ZodPipeline="ZodPipeline",$.ZodReadonly="ZodReadonly"})(D||(D={}));var u4=($,J={message:`Input not instance of ${$.name}`})=>Z2((Q)=>Q instanceof $,J),h2=n.create,y2=j1.create,p4=r1.create,d4=K1.create,m2=k1.create,i4=U1.create,o4=p1.create,r4=C1.create,n4=P1.create,a4=O1.create,s4=M1.create,t4=W1.create,e4=d1.create,$6=a.create,J6=g.create,Q6=g.strictCreate,W6=f1.create,q6=j0.create,Y6=I1.create,X6=q1.create,G6=i1.create,H6=o1.create,B6=R1.create,z6=E1.create,_6=T1.create,M6=g1.create,j6=V1.create,K6=x1.create,V6=D1.create,F6=e.create,A6=s.create,N6=B1.create,w6=e.createWithPreprocess,b6=n1.create,U6=()=>h2().optional(),O6=()=>y2().optional(),R6=()=>m2().optional(),D6={string:($)=>n.create({...$,coerce:!0}),number:($)=>j1.create({...$,coerce:!0}),boolean:($)=>k1.create({...$,coerce:!0}),bigint:($)=>K1.create({...$,coerce:!0}),date:($)=>U1.create({...$,coerce:!0})};var S6=R;var m0=/^[A-Za-z0-9][A-Za-z0-9._-]{0,63}$/;function L6($){let J;try{J=new URL($)}catch{return!1}if(J.protocol!=="http:"&&J.protocol!=="https:")return!1;return J.hostname==="localhost"||J.hostname==="127.0.0.1"||J.hostname==="[::1]"||J.hostname.endsWith(".localhost")}var F1=U.string().max(500),V0=4000,l0=1000,F0=1000,v6=U.object({label:F1,file:U.string().max(l0),line:U.number().int().positive(),column:U.number().int().nonnegative()}),A0=U.object({url:U.string().min(1).max(2000),selector:U.string().max(2000),role:F1.optional(),name:F1.optional(),text:F1.optional(),components:U.array(U.string().max(200)).max(20).optional(),sources:U.array(v6).max(10).optional(),context:F1.optional(),browser:U.object({name:F1,viewport:U.object({width:U.number().int().nonnegative(),height:U.number().int().nonnegative(),scale:U.number().positive()}),colorScheme:U.enum(["light","dark"])}).optional(),style:U.string().max(F0).optional(),html:U.string().max(V0).optional(),quote:U.object({exact:U.string().min(1).max(2000),before:F1,after:F1}).optional()}),E6=U.enum(["user","agent"]),k6=U.object({id:U.string(),author:E6,body:U.string().min(1).max(20000),createdAt:U.string()}),C6=U.enum(["open","queued","working","resolved"]),c0=U.object({id:U.string(),anchor:A0,state:C6,comments:U.array(k6).min(1),screenshot:U.string().optional(),createdAt:U.string(),updatedAt:U.string()});function c2($){return $.state==="open"&&$.comments.at(-1)?.author==="user"}var D3=U.object({threads:U.array(c0)}),u0=U.string().trim().min(1).max(20000),l2="data:image/png;base64,",P6=U.string().startsWith(l2).max(8000000).transform(($)=>Uint8Array.from(atob($.slice(l2.length)),(J)=>J.charCodeAt(0))),S3=U.object({anchor:A0,body:u0,send:U.boolean(),screenshot:P6.optional()}),L3=U.object({body:u0,send:U.boolean()}),v3=U.object({body:u0,resolve:U.boolean()}),u2=U.string().url().refine(($)=>L6($),"must be an http(s) URL on localhost"),E3=U.object({target:u2}),k3=U.object({target:u2,port:U.number().int().min(1).max(65535)});var p2=U.object({threads:U.array(c0)});function d2($){return typeof $==="object"&&$!==null&&!Array.isArray($)}function f6($){if(typeof $!=="string")return;let J;try{J=JSON.parse($)}catch{return}if(!d2(J))return;if(J.type==="agent-status"&&typeof J.watching==="boolean")return{type:"agent-status",watching:J.watching};if(J.type==="reload"&&typeof J.path==="string")return{type:"reload",path:J.path};if(J.type!=="threads")return;let Q=p2.safeParse(J);return Q.success?{type:"threads",threads:Q.data.threads}:void 0}class p0{daemonOrigin;project;socket=null;closed=!1;constructor($,J){this.daemonOrigin=$;this.project=J}connect($){let J=`${this.daemonOrigin.replace(/^http/,"ws")}/ws/review/${encodeURIComponent(this.project)}`,Q=new WebSocket(J);this.socket=Q,Q.onopen=()=>{$.connected(!0),this.request("GET","/threads").then((W)=>{let q=p2.safeParse(W);if(q.success)$.threads(q.data.threads)})},Q.onmessage=(W)=>{let q=f6(W.data);if(q?.type==="threads")$.threads(q.threads);if(q?.type==="agent-status")$.agentWatching(q.watching);if(q?.type==="reload")$.reload(q.path)},Q.onclose=()=>{if($.connected(!1),!this.closed)setTimeout(()=>this.connect($),2000)}}close(){this.closed=!0,this.socket?.close()}createThread($,J,Q,W){return this.request("POST","/threads",{anchor:$,body:J,send:Q,...W===void 0?{}:{screenshot:W}})}comment($,J,Q){return this.request("POST",`/threads/${$}/comments`,{body:J,send:Q})}send($){return this.request("POST",`/threads/${$}/send`)}sendNotes(){return this.request("POST","/notes/send")}setResolved($,J){return this.request("POST",`/threads/${$}/${J?"resolve":"reopen"}`)}delete($){return this.request("DELETE",`/threads/${$}`)}async request($,J,Q){let W=await fetch(`${this.daemonOrigin}/api/review/${encodeURIComponent(this.project)}${J}`,{method:$,...Q===void 0?{}:{headers:{"Content-Type":"application/json"},body:JSON.stringify(Q)}}),q=await W.json();if(!W.ok)throw Error(d2(q)&&typeof q.error==="string"?q.error:`Request failed (${W.status})`);return q}}var i2=`:host {
|
|
1
|
+
(()=>{var U8=Object.create;var{getPrototypeOf:A8,defineProperty:I0,getOwnPropertyNames:w8}=Object;var D8=Object.prototype.hasOwnProperty;function O8($){return this[$]}var b8,R8,L8=($,Q,J)=>{var q=$!=null&&typeof $==="object";if(q){var W=Q?b8??=new WeakMap:R8??=new WeakMap,Y=W.get($);if(Y)return Y}J=$!=null?U8(A8($)):{};let G=Q||!$||!$.__esModule?I0(J,"default",{value:$,enumerable:!0}):J;for(let X of w8($))if(!D8.call(G,X))I0(G,X,{get:O8.bind($,X),enumerable:!0});if(q)W.set($,G);return G};var S8=($,Q)=>()=>(Q||$((Q={exports:{}}).exports,Q),Q.exports);var v8=($)=>$;function E8($,Q){this[$]=v8.bind(null,Q)}var k8=($,Q)=>{for(var J in Q)I0($,J,{get:Q[J],enumerable:!0,configurable:!0,set:E8.bind(Q,J)})};var Z4=S8((G2,X2)=>{(function($,Q){typeof G2==="object"&&typeof X2<"u"?X2.exports=Q():typeof define==="function"&&define.amd?define(Q):($=typeof globalThis<"u"?globalThis:$||self,$.resolveURI=Q())})(G2,function(){let $=/^[\w+.-]+:\/\//,Q=/^([\w+.-]+:)\/\/([^@/#?]*@)?([^:/#?]*)(:\d+)?(\/[^#?]*)?(\?[^#]*)?(#.*)?/,J=/^file:(?:\/\/((?![a-z]:)[^/#?]*)?)?(\/?[^#?]*)(\?[^#]*)?(#.*)?/i;function q(N){return $.test(N)}function W(N){return N.startsWith("//")}function Y(N){return N.startsWith("/")}function G(N){return N.startsWith("file:")}function X(N){return/^[.?#]/.test(N)}function H(N){let O=Q.exec(N);return j(O[1],O[2]||"",O[3],O[4]||"",O[5]||"/",O[6]||"",O[7]||"")}function B(N){let O=J.exec(N),U=O[2];return j("file:","",O[1]||"","",Y(U)?U:"/"+U,O[3]||"",O[4]||"")}function j(N,O,U,C,T,P,h){return{scheme:N,user:O,host:U,port:C,path:T,query:P,hash:h,type:7}}function A(N){if(W(N)){let U=H("http:"+N);return U.scheme="",U.type=6,U}if(Y(N)){let U=H("http://foo.com"+N);return U.scheme="",U.host="",U.type=5,U}if(G(N))return B(N);if(q(N))return H(N);let O=H("http://foo.com/"+N);return O.scheme="",O.host="",O.type=N?N.startsWith("?")?3:N.startsWith("#")?2:4:1,O}function z(N){if(N.endsWith("/.."))return N;let O=N.lastIndexOf("/");return N.slice(0,O+1)}function F(N,O){if(k(O,O.type),N.path==="/")N.path=O.path;else N.path=z(O.path)+N.path}function k(N,O){let U=O<=4,C=N.path.split("/"),T=1,P=0,h=!1;for(let u=1;u<C.length;u++){let o=C[u];if(!o){h=!0;continue}if(h=!1,o===".")continue;if(o===".."){if(P)h=!0,P--,T--;else if(U)C[T++]=o;continue}C[T++]=o,P++}let c="";for(let u=1;u<T;u++)c+="/"+C[u];if(!c||h&&!c.endsWith("/.."))c+="/";N.path=c}function I(N,O){if(!N&&!O)return"";let U=A(N),C=U.type;if(O&&C!==7){let P=A(O),h=P.type;switch(C){case 1:U.hash=P.hash;case 2:U.query=P.query;case 3:case 4:F(U,P);case 5:U.user=P.user,U.host=P.host,U.port=P.port;case 6:U.scheme=P.scheme}if(h>C)C=h}k(U,C);let T=U.query+U.hash;switch(C){case 2:case 3:return T;case 4:{let P=U.path.slice(1);if(!P)return T||".";if(X(O||N)&&!X(P))return"./"+P+T;return P+T}case 5:return U.path+T;default:return U.scheme+"//"+U.user+U.host+U.port+U.path+T}}return I})});var M0,f,C2,P8,z1,v2,f2,I2,T0,G0,p1,T2,Z0,g0,x0,C8,B0={},z0=[],f8=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,j0=Array.isArray;function G1($,Q){for(var J in Q)$[J]=Q[J];return $}function y0($){$&&$.parentNode&&$.parentNode.removeChild($)}function I8($,Q,J){var q,W,Y,G={};for(Y in Q)Y=="key"?q=Q[Y]:Y=="ref"?W=Q[Y]:G[Y]=Q[Y];if(arguments.length>2&&(G.children=arguments.length>3?M0.call(arguments,2):J),typeof $=="function"&&$.defaultProps!=null)for(Y in $.defaultProps)G[Y]===void 0&&(G[Y]=$.defaultProps[Y]);return X0($,G,q,W,null)}function X0($,Q,J,q,W){var Y={type:$,props:Q,key:J,ref:q,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:W==null?++C2:W,__i:-1,__u:0};return W==null&&f.vnode!=null&&f.vnode(Y),Y}function Q1($){return $.children}function H0($,Q){this.props=$,this.context=Q}function w1($,Q){if(Q==null)return $.__?w1($.__,$.__i+1):null;for(var J;Q<$.__k.length;Q++)if((J=$.__k[Q])!=null&&J.__e!=null)return J.__e;return typeof $.type=="function"?w1($):null}function T8($){if($.__P&&$.__d){var Q=$.__v,J=Q.__e,q=[],W=[],Y=G1({},Q);Y.__v=Q.__v+1,f.vnode&&f.vnode(Y),h0($.__P,Y,Q,$.__n,$.__P.namespaceURI,32&Q.__u?[J]:null,q,J==null?w1(Q):J,!!(32&Q.__u),W),Y.__v=Q.__v,Y.__.__k[Y.__i]=Y,h2(q,Y,W),Q.__e=Q.__=null,Y.__e!=J&&g2(Y)}}function g2($){if(($=$.__)!=null&&$.__c!=null)return $.__e=$.__c.base=null,$.__k.some(function(Q){if(Q!=null&&Q.__e!=null)return $.__e=$.__c.base=Q.__e}),g2($)}function E2($){(!$.__d&&($.__d=!0)&&z1.push($)&&!_0.__r++||v2!=f.debounceRendering)&&((v2=f.debounceRendering)||f2)(_0)}function _0(){try{for(var $,Q=1;z1.length;)z1.length>Q&&z1.sort(I2),$=z1.shift(),Q=z1.length,T8($)}finally{z1.length=_0.__r=0}}function x2($,Q,J,q,W,Y,G,X,H,B,j){var A,z,F,k,I,N,O=q&&q.__k||z0,U=Q.length;for(H=g8(J,Q,O,H,U),A=0;A<U;A++)(F=J.__k[A])!=null&&(z=F.__i!=-1&&O[F.__i]||B0,F.__i=A,N=h0($,F,z,W,Y,G,X,H,B,j),k=F.__e,F.ref&&z.ref!=F.ref&&(z.ref&&m0(z.ref,null,F),j.push(F.ref,F.__c||k,F)),I==null&&k!=null&&(I=k),4&F.__u?(H=Z2(F,H,$),z.__e&&(z.__e=null)):typeof F.type=="function"&&N!==void 0?H=N:k&&(H=k.nextSibling),F.__u&=-7);return J.__e=I,H}function g8($,Q,J,q,W){var Y,G,X,H,B,j=J.length,A=j,z=0;for($.__k=Array(W),Y=0;Y<W;Y++)(G=Q[Y])!=null&&typeof G!="boolean"&&typeof G!="function"?(typeof G=="string"||typeof G=="number"||typeof G=="bigint"||G.constructor==String?G=$.__k[Y]=X0(null,G,null,null,null):j0(G)?G=$.__k[Y]=X0(Q1,{children:G},null,null,null):G.constructor===void 0&&G.__b>0?G=$.__k[Y]=X0(G.type,G.props,G.key,G.ref?G.ref:null,G.__v):$.__k[Y]=G,H=Y+z,G.__=$,G.__b=$.__b+1,X=null,(B=G.__i=x8(G,J,H,A))!=-1&&(A--,(X=J[B])&&(X.__u|=2)),X==null||X.__v==null?(B==-1&&(W>j?z--:W<j&&z++),typeof G.type!="function"&&(G.__u|=4)):B!=H&&(B==H-1?z--:B==H+1?z++:(B>H?z--:z++,G.__u|=4))):$.__k[Y]=null;if(A)for(Y=0;Y<j;Y++)(X=J[Y])!=null&&(2&X.__u)==0&&(X.__e==q&&(q=w1(X)),l2(X,X));return q}function Z2($,Q,J){var q,W;if(typeof $.type=="function"){for(q=$.__k,W=0;q&&W<q.length;W++)q[W]&&(q[W].__=$,Q=Z2(q[W],Q,J));return Q}$.__e!=Q&&(Q&&$.type&&!Q.parentNode&&(Q=w1($)),Q=J.insertBefore($.__e,Q||null));do Q=Q&&Q.nextSibling;while(Q!=null&&Q.nodeType==8);return Q}function x8($,Q,J,q){var W,Y,G,X=$.key,H=$.type,B=Q[J],j=B!=null&&(2&B.__u)==0;if(B===null&&X==null||j&&X==B.key&&H==B.type)return J;if(q>(j?1:0)){for(W=J-1,Y=J+1;W>=0||Y<Q.length;)if((B=Q[G=W>=0?W--:Y++])!=null&&(2&B.__u)==0&&X==B.key&&H==B.type)return G}return-1}function k2($,Q,J){Q[0]=="-"?$.setProperty(Q,J==null?"":J):$[Q]=J==null?"":typeof J!="number"||f8.test(Q)?J:J+"px"}function Y0($,Q,J,q,W){var Y,G;$:if(Q=="style")if(typeof J=="string")$.style.cssText=J;else{if(typeof q=="string"&&($.style.cssText=q=""),q)for(Q in q)J&&Q in J||k2($.style,Q,"");if(J)for(Q in J)q&&J[Q]==q[Q]||k2($.style,Q,J[Q])}else if(Q[0]=="o"&&Q[1]=="n")Y=Q!=(Q=Q.replace(T2,"$1")),G=Q.toLowerCase(),Q=G in $||Q=="onFocusOut"||Q=="onFocusIn"?G.slice(2):Q.slice(2),$.l||($.l={}),$.l[Q+Y]=J,J?q?J[p1]=q[p1]:(J[p1]=Z0,$.addEventListener(Q,Y?x0:g0,Y)):$.removeEventListener(Q,Y?x0:g0,Y);else{if(W=="http://www.w3.org/2000/svg")Q=Q.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(Q!="width"&&Q!="height"&&Q!="href"&&Q!="list"&&Q!="form"&&Q!="tabIndex"&&Q!="download"&&Q!="rowSpan"&&Q!="colSpan"&&Q!="role"&&Q!="popover"&&Q in $)try{$[Q]=J==null?"":J;break $}catch(X){}typeof J=="function"||(J==null||J===!1&&Q[4]!="-"?$.removeAttribute(Q):$.setAttribute(Q,Q=="popover"&&J==1?"":J))}}function P2($){return function(Q){if(this.l){var J=this.l[Q.type+$];if(Q[G0]==null)Q[G0]=Z0++;else if(Q[G0]<J[p1])return;return J(f.event?f.event(Q):Q)}}}function h0($,Q,J,q,W,Y,G,X,H,B){var j,A,z,F,k,I,N,O,U,C,T,P,h,c,u,o,i=Q.type;if(Q.constructor!==void 0)return null;128&J.__u&&(H=!!(32&J.__u),Y=[X=Q.__e=J.__e]),(j=f.__b)&&j(Q);$:if(typeof i=="function"){A=G.length;try{if(U=Q.props,C=i.prototype&&i.prototype.render,T=(j=i.contextType)&&q[j.__c],P=j?T?T.props.value:j.__:q,J.__c?O=(z=Q.__c=J.__c).__=z.__E:(C?Q.__c=z=new i(U,P):(Q.__c=z=new H0(U,P),z.constructor=i,z.render=y8),T&&T.sub(z),z.state||(z.state={}),z.__n=q,F=z.__d=!0,z.__h=[],z._sb=[]),C&&z.__s==null&&(z.__s=z.state),C&&i.getDerivedStateFromProps!=null&&(z.__s==z.state&&(z.__s=G1({},z.__s)),G1(z.__s,i.getDerivedStateFromProps(U,z.__s))),k=z.props,I=z.state,z.__v=Q,F)C&&i.getDerivedStateFromProps==null&&z.componentWillMount!=null&&z.componentWillMount(),C&&z.componentDidMount!=null&&z.__h.push(z.componentDidMount);else{if(C&&i.getDerivedStateFromProps==null&&U!==k&&z.componentWillReceiveProps!=null&&z.componentWillReceiveProps(U,P),Q.__v==J.__v||!z.__e&&z.shouldComponentUpdate!=null&&z.shouldComponentUpdate(U,z.__s,P)===!1){Q.__v!=J.__v&&(z.props=U,z.state=z.__s,z.__d=!1),Q.__e=J.__e,Q.__k=J.__k,Q.__k.some(function($1){$1&&($1.__=Q)}),z0.push.apply(z.__h,z._sb),z._sb=[],z.__h.length&&G.push(z),X=w1(J);break $}z.componentWillUpdate!=null&&z.componentWillUpdate(U,z.__s,P),C&&z.componentDidUpdate!=null&&z.__h.push(function(){z.componentDidUpdate(k,I,N)})}if(z.context=P,z.props=U,z.__P=$,z.__e=!1,h=f.__r,c=0,C)z.state=z.__s,z.__d=!1,h&&h(Q),j=z.render(z.props,z.state,z.context),z0.push.apply(z.__h,z._sb),z._sb=[];else do z.__d=!1,h&&h(Q),j=z.render(z.props,z.state,z.context),z.state=z.__s;while(z.__d&&++c<25);z.state=z.__s,z.getChildContext!=null&&(q=G1(G1({},q),z.getChildContext())),C&&!F&&z.getSnapshotBeforeUpdate!=null&&(N=z.getSnapshotBeforeUpdate(k,I)),u=j!=null&&j.type===Q1&&j.key==null?m2(j.props.children):j,X=x2($,j0(u)?u:[u],Q,J,q,W,Y,G,X,H,B),z.base=Q.__e,Q.__u&=-161,z.__h.length&&G.push(z),O&&(z.__E=z.__=null)}catch($1){if(G.length=A,Q.__v=null,H||Y!=null){if($1.then){for(Q.__u|=H?160:128;X&&X.nodeType==8&&X.nextSibling;)X=X.nextSibling;Y!=null&&(Y[Y.indexOf(X)]=null),Q.__e=X}else if(Y!=null)for(o=Y.length;o--;)y0(Y[o])}else Q.__e=J.__e;Q.__k==null&&(Q.__k=J.__k||[]),$1.then||y2(Q),f.__e($1,Q,J)}}else Y==null&&Q.__v==J.__v?(Q.__k=J.__k,Q.__e=J.__e):X=Q.__e=Z8(J.__e,Q,J,q,W,Y,G,H,B);return(j=f.diffed)&&j(Q),128&Q.__u?void 0:X}function y2($){$&&($.__c&&($.__c.__e=!0),$.__k&&$.__k.some(y2))}function h2($,Q,J){for(var q=0;q<J.length;q++)m0(J[q],J[++q],J[++q]);f.__c&&f.__c(Q,$),$.some(function(W){try{$=W.__h,W.__h=[],$.some(function(Y){Y.call(W)})}catch(Y){f.__e(Y,W.__v)}})}function m2($){return typeof $!="object"||$==null||$.__b>0?$:j0($)?$.map(m2):$.constructor!==void 0?null:G1({},$)}function Z8($,Q,J,q,W,Y,G,X,H){var B,j,A,z,F,k,I,N=J.props||B0,O=Q.props,U=Q.type;if(U=="svg"?W="http://www.w3.org/2000/svg":U=="math"?W="http://www.w3.org/1998/Math/MathML":W||(W="http://www.w3.org/1999/xhtml"),Y!=null){for(B=0;B<Y.length;B++)if((F=Y[B])&&"setAttribute"in F==!!U&&(U?F.localName==U:F.nodeType==3)){$=F,Y[B]=null;break}}if($==null){if(U==null)return document.createTextNode(O);$=document.createElementNS(W,U,O.is&&O),X&&(f.__m&&f.__m(Q,Y),X=!1),Y=null}if(U==null)N===O||X&&$.data==O||($.data=O);else{if(Y=U=="textarea"&&O.defaultValue!=null?null:Y&&M0.call($.childNodes),!X&&Y!=null)for(N={},B=0;B<$.attributes.length;B++)N[(F=$.attributes[B]).name]=F.value;for(B in N)F=N[B],B=="dangerouslySetInnerHTML"?A=F:B=="children"||(B in O)||B=="value"&&("defaultValue"in O)||B=="checked"&&("defaultChecked"in O)||Y0($,B,null,F,W);for(B in O)F=O[B],B=="children"?z=F:B=="dangerouslySetInnerHTML"?j=F:B=="value"?k=F:B=="checked"?I=F:X&&typeof F!="function"||N[B]===F||Y0($,B,F,N[B],W);if(j)X||A&&(j.__html==A.__html||j.__html==$.innerHTML)||($.innerHTML=j.__html),Q.__k=[];else if(A&&($.innerHTML=""),x2(Q.type=="template"?$.content:$,j0(z)?z:[z],Q,J,q,U=="foreignObject"?"http://www.w3.org/1999/xhtml":W,Y,G,Y?Y[0]:J.__k&&w1(J,0),X,H),Y!=null)for(B=Y.length;B--;)y0(Y[B]);X&&U!="textarea"||(B="value",U=="progress"&&k==null?$.removeAttribute("value"):k!=null&&(k!==$[B]||U=="progress"&&!k||U=="option"&&k!=N[B])&&Y0($,B,k,N[B],W),B="checked",I!=null&&I!=$[B]&&Y0($,B,I,N[B],W))}return $}function m0($,Q,J){try{if(typeof $=="function"){var q=typeof $.__u=="function";q&&$.__u(),q&&Q==null||($.__u=$(Q))}else $.current=Q}catch(W){f.__e(W,J)}}function l2($,Q,J){var q,W;if(f.unmount&&f.unmount($),(q=$.ref)&&(q.current&&q.current!=$.__e||m0(q,null,Q)),(q=$.__c)!=null){if(q.componentWillUnmount)try{q.componentWillUnmount()}catch(Y){f.__e(Y,Q)}q.base=q.__P=q.__n=null}if(q=$.__k)for(W=0;W<q.length;W++)q[W]&&l2(q[W],Q,J||typeof $.type!="function");J||y0($.__e),$.__c=$.__=$.__e=void 0}function y8($,Q,J){return this.constructor($,J)}function c2($,Q,J){var q,W,Y,G;Q==document&&(Q=document.documentElement),f.__&&f.__($,Q),W=(q=typeof J=="function")?null:J&&J.__k||Q.__k,Y=[],G=[],h0(Q,$=(!q&&J||Q).__k=I8(Q1,null,[$]),W||B0,B0,Q.namespaceURI,!q&&J?[J]:W?null:Q.firstChild?M0.call(Q.childNodes):null,Y,!q&&J?J:W?W.__e:Q.firstChild,q,G),h2(Y,$,G),$.props.children=null}M0=z0.slice,f={__e:function($,Q,J,q){for(var W,Y,G;Q=Q.__;)if((W=Q.__c)&&!W.__)try{if((Y=W.constructor)&&Y.getDerivedStateFromError!=null&&(W.setState(Y.getDerivedStateFromError($)),G=W.__d),W.componentDidCatch!=null&&(W.componentDidCatch($,q||{}),G=W.__d),G)return W.__E=W}catch(X){$=X}throw $}},C2=0,P8=function($){return $!=null&&$.constructor===void 0},H0.prototype.setState=function($,Q){var J;J=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=G1({},this.state),typeof $=="function"&&($=$(G1({},J),this.props)),$&&G1(J,$),$!=null&&this.__v&&(Q&&this._sb.push(Q),E2(this))},H0.prototype.forceUpdate=function($){this.__v&&(this.__e=!0,$&&this.__h.push($),E2(this))},H0.prototype.render=Q1,z1=[],f2=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,I2=function($,Q){return $.__v.__b-Q.__v.__b},_0.__r=0,T0=Math.random().toString(8),G0="__d"+T0,p1="__a"+T0,T2=/(PointerCapture)$|Capture$/i,Z0=0,g0=P2(!1),x0=P2(!0),C8=0;async function u2($){let Q=m8($);return crypto.subtle.importKey("raw",Q,{name:"AES-GCM",length:256},!1,["encrypt","decrypt"])}async function l0($,Q){let J=crypto.getRandomValues(new Uint8Array(12)),q=new TextEncoder().encode(Q),W=await crypto.subtle.encrypt({name:"AES-GCM",iv:J},$,q),Y=new Uint8Array(J.byteLength+W.byteLength);return Y.set(J,0),Y.set(new Uint8Array(W),J.byteLength),h8(Y)}async function c0($,Q){let J=p2(Q);if(J.byteLength<28)throw Error("Ciphertext too short");let q=J.subarray(0,12),W=J.subarray(12),Y=await crypto.subtle.decrypt({name:"AES-GCM",iv:q},$,W);return new TextDecoder().decode(Y)}function h8($){let Q="",J=32768;for(let q=0;q<$.byteLength;q+=J)Q+=String.fromCharCode.apply(null,Array.from($.subarray(q,q+J)));return btoa(Q)}function p2($){let Q=atob($),J=new Uint8Array(Q.length);for(let q=0;q<Q.length;q++)J[q]=Q.charCodeAt(q);return J}function m8($){let Q=$.replace(/-/g,"+").replace(/_/g,"/")+"===".slice(($.length+3)%4);return p2(Q)}var M={};k8(M,{void:()=>R6,util:()=>E,unknown:()=>O6,union:()=>E6,undefined:()=>A6,tuple:()=>C6,transformer:()=>l6,symbol:()=>U6,string:()=>e2,strictObject:()=>v6,setErrorMap:()=>u8,set:()=>T6,record:()=>f6,quotelessJson:()=>l8,promise:()=>m6,preprocess:()=>p6,pipeline:()=>d6,ostring:()=>i6,optional:()=>c6,onumber:()=>o6,oboolean:()=>n6,objectUtil:()=>u0,object:()=>S6,number:()=>$4,nullable:()=>u6,null:()=>w6,never:()=>b6,nativeEnum:()=>h6,nan:()=>K6,map:()=>I6,makeIssue:()=>d1,literal:()=>Z6,lazy:()=>x6,late:()=>j6,isValid:()=>_1,isDirty:()=>K0,isAsync:()=>v1,isAborted:()=>V0,intersection:()=>P6,instanceof:()=>V6,getParsedType:()=>J1,getErrorMap:()=>S1,function:()=>g6,enum:()=>y6,effect:()=>l6,discriminatedUnion:()=>k6,defaultErrorMap:()=>X1,datetimeRegex:()=>a2,date:()=>N6,custom:()=>t2,coerce:()=>r6,boolean:()=>Q4,bigint:()=>F6,array:()=>L6,any:()=>D6,addIssueToContext:()=>K,ZodVoid:()=>o1,ZodUnknown:()=>M1,ZodUnion:()=>I1,ZodUndefined:()=>C1,ZodType:()=>v,ZodTuple:()=>W1,ZodTransformer:()=>e,ZodSymbol:()=>i1,ZodString:()=>r,ZodSet:()=>R1,ZodSchema:()=>v,ZodRecord:()=>n1,ZodReadonly:()=>m1,ZodPromise:()=>L1,ZodPipeline:()=>s1,ZodParsedType:()=>V,ZodOptional:()=>s,ZodObject:()=>g,ZodNumber:()=>j1,ZodNullable:()=>B1,ZodNull:()=>f1,ZodNever:()=>q1,ZodNativeEnum:()=>Z1,ZodNaN:()=>a1,ZodMap:()=>r1,ZodLiteral:()=>x1,ZodLazy:()=>g1,ZodIssueCode:()=>_,ZodIntersection:()=>T1,ZodFunction:()=>k1,ZodFirstPartyTypeKind:()=>R,ZodError:()=>d,ZodEnum:()=>K1,ZodEffects:()=>e,ZodDiscriminatedUnion:()=>F0,ZodDefault:()=>y1,ZodDate:()=>O1,ZodCatch:()=>h1,ZodBranded:()=>N0,ZodBoolean:()=>P1,ZodBigInt:()=>V1,ZodArray:()=>a,ZodAny:()=>b1,Schema:()=>v,ParseStatus:()=>m,OK:()=>l,NEVER:()=>a6,INVALID:()=>b,EMPTY_PATH:()=>p8,DIRTY:()=>D1,BRAND:()=>M6});var E;(function($){$.assertEqual=(W)=>{};function Q(W){}$.assertIs=Q;function J(W){throw Error()}$.assertNever=J,$.arrayToEnum=(W)=>{let Y={};for(let G of W)Y[G]=G;return Y},$.getValidEnumValues=(W)=>{let Y=$.objectKeys(W).filter((X)=>typeof W[W[X]]!=="number"),G={};for(let X of Y)G[X]=W[X];return $.objectValues(G)},$.objectValues=(W)=>{return $.objectKeys(W).map(function(Y){return W[Y]})},$.objectKeys=typeof Object.keys==="function"?(W)=>Object.keys(W):(W)=>{let Y=[];for(let G in W)if(Object.prototype.hasOwnProperty.call(W,G))Y.push(G);return Y},$.find=(W,Y)=>{for(let G of W)if(Y(G))return G;return},$.isInteger=typeof Number.isInteger==="function"?(W)=>Number.isInteger(W):(W)=>typeof W==="number"&&Number.isFinite(W)&&Math.floor(W)===W;function q(W,Y=" | "){return W.map((G)=>typeof G==="string"?`'${G}'`:G).join(Y)}$.joinValues=q,$.jsonStringifyReplacer=(W,Y)=>{if(typeof Y==="bigint")return Y.toString();return Y}})(E||(E={}));var u0;(function($){$.mergeShapes=(Q,J)=>{return{...Q,...J}}})(u0||(u0={}));var V=E.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),J1=($)=>{switch(typeof $){case"undefined":return V.undefined;case"string":return V.string;case"number":return Number.isNaN($)?V.nan:V.number;case"boolean":return V.boolean;case"function":return V.function;case"bigint":return V.bigint;case"symbol":return V.symbol;case"object":if(Array.isArray($))return V.array;if($===null)return V.null;if($.then&&typeof $.then==="function"&&$.catch&&typeof $.catch==="function")return V.promise;if(typeof Map<"u"&&$ instanceof Map)return V.map;if(typeof Set<"u"&&$ instanceof Set)return V.set;if(typeof Date<"u"&&$ instanceof Date)return V.date;return V.object;default:return V.unknown}};var _=E.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),l8=($)=>{return JSON.stringify($,null,2).replace(/"([^"]+)":/g,"$1:")};class d extends Error{get errors(){return this.issues}constructor($){super();this.issues=[],this.addIssue=(J)=>{this.issues=[...this.issues,J]},this.addIssues=(J=[])=>{this.issues=[...this.issues,...J]};let Q=new.target.prototype;if(Object.setPrototypeOf)Object.setPrototypeOf(this,Q);else this.__proto__=Q;this.name="ZodError",this.issues=$}format($){let Q=$||function(W){return W.message},J={_errors:[]},q=(W)=>{for(let Y of W.issues)if(Y.code==="invalid_union")Y.unionErrors.map(q);else if(Y.code==="invalid_return_type")q(Y.returnTypeError);else if(Y.code==="invalid_arguments")q(Y.argumentsError);else if(Y.path.length===0)J._errors.push(Q(Y));else{let G=J,X=0;while(X<Y.path.length){let H=Y.path[X];if(X!==Y.path.length-1)G[H]=G[H]||{_errors:[]};else G[H]=G[H]||{_errors:[]},G[H]._errors.push(Q(Y));G=G[H],X++}}};return q(this),J}static assert($){if(!($ instanceof d))throw Error(`Not a ZodError: ${$}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,E.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten($=(Q)=>Q.message){let Q={},J=[];for(let q of this.issues)if(q.path.length>0){let W=q.path[0];Q[W]=Q[W]||[],Q[W].push($(q))}else J.push($(q));return{formErrors:J,fieldErrors:Q}}get formErrors(){return this.flatten()}}d.create=($)=>{return new d($)};var c8=($,Q)=>{let J;switch($.code){case _.invalid_type:if($.received===V.undefined)J="Required";else J=`Expected ${$.expected}, received ${$.received}`;break;case _.invalid_literal:J=`Invalid literal value, expected ${JSON.stringify($.expected,E.jsonStringifyReplacer)}`;break;case _.unrecognized_keys:J=`Unrecognized key(s) in object: ${E.joinValues($.keys,", ")}`;break;case _.invalid_union:J="Invalid input";break;case _.invalid_union_discriminator:J=`Invalid discriminator value. Expected ${E.joinValues($.options)}`;break;case _.invalid_enum_value:J=`Invalid enum value. Expected ${E.joinValues($.options)}, received '${$.received}'`;break;case _.invalid_arguments:J="Invalid function arguments";break;case _.invalid_return_type:J="Invalid function return type";break;case _.invalid_date:J="Invalid date";break;case _.invalid_string:if(typeof $.validation==="object")if("includes"in $.validation){if(J=`Invalid input: must include "${$.validation.includes}"`,typeof $.validation.position==="number")J=`${J} at one or more positions greater than or equal to ${$.validation.position}`}else if("startsWith"in $.validation)J=`Invalid input: must start with "${$.validation.startsWith}"`;else if("endsWith"in $.validation)J=`Invalid input: must end with "${$.validation.endsWith}"`;else E.assertNever($.validation);else if($.validation!=="regex")J=`Invalid ${$.validation}`;else J="Invalid";break;case _.too_small:if($.type==="array")J=`Array must contain ${$.exact?"exactly":$.inclusive?"at least":"more than"} ${$.minimum} element(s)`;else if($.type==="string")J=`String must contain ${$.exact?"exactly":$.inclusive?"at least":"over"} ${$.minimum} character(s)`;else if($.type==="number")J=`Number must be ${$.exact?"exactly equal to ":$.inclusive?"greater than or equal to ":"greater than "}${$.minimum}`;else if($.type==="bigint")J=`Number must be ${$.exact?"exactly equal to ":$.inclusive?"greater than or equal to ":"greater than "}${$.minimum}`;else if($.type==="date")J=`Date must be ${$.exact?"exactly equal to ":$.inclusive?"greater than or equal to ":"greater than "}${new Date(Number($.minimum))}`;else J="Invalid input";break;case _.too_big:if($.type==="array")J=`Array must contain ${$.exact?"exactly":$.inclusive?"at most":"less than"} ${$.maximum} element(s)`;else if($.type==="string")J=`String must contain ${$.exact?"exactly":$.inclusive?"at most":"under"} ${$.maximum} character(s)`;else if($.type==="number")J=`Number must be ${$.exact?"exactly":$.inclusive?"less than or equal to":"less than"} ${$.maximum}`;else if($.type==="bigint")J=`BigInt must be ${$.exact?"exactly":$.inclusive?"less than or equal to":"less than"} ${$.maximum}`;else if($.type==="date")J=`Date must be ${$.exact?"exactly":$.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number($.maximum))}`;else J="Invalid input";break;case _.custom:J="Invalid input";break;case _.invalid_intersection_types:J="Intersection results could not be merged";break;case _.not_multiple_of:J=`Number must be a multiple of ${$.multipleOf}`;break;case _.not_finite:J="Number must be finite";break;default:J=Q.defaultError,E.assertNever($)}return{message:J}},X1=c8;var d2=X1;function u8($){d2=$}function S1(){return d2}var d1=($)=>{let{data:Q,path:J,errorMaps:q,issueData:W}=$,Y=[...J,...W.path||[]],G={...W,path:Y};if(W.message!==void 0)return{...W,path:Y,message:W.message};let X="",H=q.filter((B)=>!!B).slice().reverse();for(let B of H)X=B(G,{data:Q,defaultError:X}).message;return{...W,path:Y,message:X}},p8=[];function K($,Q){let J=S1(),q=d1({issueData:Q,data:$.data,path:$.path,errorMaps:[$.common.contextualErrorMap,$.schemaErrorMap,J,J===X1?void 0:X1].filter((W)=>!!W)});$.common.issues.push(q)}class m{constructor(){this.value="valid"}dirty(){if(this.value==="valid")this.value="dirty"}abort(){if(this.value!=="aborted")this.value="aborted"}static mergeArray($,Q){let J=[];for(let q of Q){if(q.status==="aborted")return b;if(q.status==="dirty")$.dirty();J.push(q.value)}return{status:$.value,value:J}}static async mergeObjectAsync($,Q){let J=[];for(let q of Q){let W=await q.key,Y=await q.value;J.push({key:W,value:Y})}return m.mergeObjectSync($,J)}static mergeObjectSync($,Q){let J={};for(let q of Q){let{key:W,value:Y}=q;if(W.status==="aborted")return b;if(Y.status==="aborted")return b;if(W.status==="dirty")$.dirty();if(Y.status==="dirty")$.dirty();if(W.value!=="__proto__"&&(typeof Y.value<"u"||q.alwaysSet))J[W.value]=Y.value}return{status:$.value,value:J}}}var b=Object.freeze({status:"aborted"}),D1=($)=>({status:"dirty",value:$}),l=($)=>({status:"valid",value:$}),V0=($)=>$.status==="aborted",K0=($)=>$.status==="dirty",_1=($)=>$.status==="valid",v1=($)=>typeof Promise<"u"&&$ instanceof Promise;var D;(function($){$.errToObj=(Q)=>typeof Q==="string"?{message:Q}:Q||{},$.toString=(Q)=>typeof Q==="string"?Q:Q?.message})(D||(D={}));class t{constructor($,Q,J,q){this._cachedPath=[],this.parent=$,this.data=Q,this._path=J,this._key=q}get path(){if(!this._cachedPath.length)if(Array.isArray(this._key))this._cachedPath.push(...this._path,...this._key);else this._cachedPath.push(...this._path,this._key);return this._cachedPath}}var i2=($,Q)=>{if(_1(Q))return{success:!0,data:Q.value};else{if(!$.common.issues.length)throw Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let J=new d($.common.issues);return this._error=J,this._error}}}};function S($){if(!$)return{};let{errorMap:Q,invalid_type_error:J,required_error:q,description:W}=$;if(Q&&(J||q))throw Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);if(Q)return{errorMap:Q,description:W};return{errorMap:(G,X)=>{let{message:H}=$;if(G.code==="invalid_enum_value")return{message:H??X.defaultError};if(typeof X.data>"u")return{message:H??q??X.defaultError};if(G.code!=="invalid_type")return{message:X.defaultError};return{message:H??J??X.defaultError}},description:W}}class v{get description(){return this._def.description}_getType($){return J1($.data)}_getOrReturnCtx($,Q){return Q||{common:$.parent.common,data:$.data,parsedType:J1($.data),schemaErrorMap:this._def.errorMap,path:$.path,parent:$.parent}}_processInputParams($){return{status:new m,ctx:{common:$.parent.common,data:$.data,parsedType:J1($.data),schemaErrorMap:this._def.errorMap,path:$.path,parent:$.parent}}}_parseSync($){let Q=this._parse($);if(v1(Q))throw Error("Synchronous parse encountered promise.");return Q}_parseAsync($){let Q=this._parse($);return Promise.resolve(Q)}parse($,Q){let J=this.safeParse($,Q);if(J.success)return J.data;throw J.error}safeParse($,Q){let J={common:{issues:[],async:Q?.async??!1,contextualErrorMap:Q?.errorMap},path:Q?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:$,parsedType:J1($)},q=this._parseSync({data:$,path:J.path,parent:J});return i2(J,q)}"~validate"($){let Q={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:$,parsedType:J1($)};if(!this["~standard"].async)try{let J=this._parseSync({data:$,path:[],parent:Q});return _1(J)?{value:J.value}:{issues:Q.common.issues}}catch(J){if(J?.message?.toLowerCase()?.includes("encountered"))this["~standard"].async=!0;Q.common={issues:[],async:!0}}return this._parseAsync({data:$,path:[],parent:Q}).then((J)=>_1(J)?{value:J.value}:{issues:Q.common.issues})}async parseAsync($,Q){let J=await this.safeParseAsync($,Q);if(J.success)return J.data;throw J.error}async safeParseAsync($,Q){let J={common:{issues:[],contextualErrorMap:Q?.errorMap,async:!0},path:Q?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:$,parsedType:J1($)},q=this._parse({data:$,path:J.path,parent:J}),W=await(v1(q)?q:Promise.resolve(q));return i2(J,W)}refine($,Q){let J=(q)=>{if(typeof Q==="string"||typeof Q>"u")return{message:Q};else if(typeof Q==="function")return Q(q);else return Q};return this._refinement((q,W)=>{let Y=$(q),G=()=>W.addIssue({code:_.custom,...J(q)});if(typeof Promise<"u"&&Y instanceof Promise)return Y.then((X)=>{if(!X)return G(),!1;else return!0});if(!Y)return G(),!1;else return!0})}refinement($,Q){return this._refinement((J,q)=>{if(!$(J))return q.addIssue(typeof Q==="function"?Q(J,q):Q),!1;else return!0})}_refinement($){return new e({schema:this,typeName:R.ZodEffects,effect:{type:"refinement",refinement:$}})}superRefine($){return this._refinement($)}constructor($){this.spa=this.safeParseAsync,this._def=$,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:(Q)=>this["~validate"](Q)}}optional(){return s.create(this,this._def)}nullable(){return B1.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return a.create(this)}promise(){return L1.create(this,this._def)}or($){return I1.create([this,$],this._def)}and($){return T1.create(this,$,this._def)}transform($){return new e({...S(this._def),schema:this,typeName:R.ZodEffects,effect:{type:"transform",transform:$}})}default($){let Q=typeof $==="function"?$:()=>$;return new y1({...S(this._def),innerType:this,defaultValue:Q,typeName:R.ZodDefault})}brand(){return new N0({typeName:R.ZodBranded,type:this,...S(this._def)})}catch($){let Q=typeof $==="function"?$:()=>$;return new h1({...S(this._def),innerType:this,catchValue:Q,typeName:R.ZodCatch})}describe($){return new this.constructor({...this._def,description:$})}pipe($){return s1.create(this,$)}readonly(){return m1.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}var d8=/^c[^\s-]{8,}$/i,i8=/^[0-9a-z]+$/,o8=/^[0-9A-HJKMNP-TV-Z]{26}$/i,n8=/^[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,r8=/^[a-z0-9_-]{21}$/i,a8=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,s8=/^[-+]?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)?)??$/,t8=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,e8="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",p0,$6=/^(?:(?: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])$/,Q6=/^(?:(?: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])$/,J6=/^(([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]))$/,q6=/^(([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])$/,W6=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,Y6=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,n2="((\\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])))",G6=new RegExp(`^${n2}$`);function r2($){let Q="[0-5]\\d";if($.precision)Q=`${Q}\\.\\d{${$.precision}}`;else if($.precision==null)Q=`${Q}(\\.\\d+)?`;let J=$.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${Q})${J}`}function X6($){return new RegExp(`^${r2($)}$`)}function a2($){let Q=`${n2}T${r2($)}`,J=[];if(J.push($.local?"Z?":"Z"),$.offset)J.push("([+-]\\d{2}:?\\d{2})");return Q=`${Q}(${J.join("|")})`,new RegExp(`^${Q}$`)}function H6($,Q){if((Q==="v4"||!Q)&&$6.test($))return!0;if((Q==="v6"||!Q)&&J6.test($))return!0;return!1}function B6($,Q){if(!a8.test($))return!1;try{let[J]=$.split(".");if(!J)return!1;let q=J.replace(/-/g,"+").replace(/_/g,"/").padEnd(J.length+(4-J.length%4)%4,"="),W=JSON.parse(atob(q));if(typeof W!=="object"||W===null)return!1;if("typ"in W&&W?.typ!=="JWT")return!1;if(!W.alg)return!1;if(Q&&W.alg!==Q)return!1;return!0}catch{return!1}}function z6($,Q){if((Q==="v4"||!Q)&&Q6.test($))return!0;if((Q==="v6"||!Q)&&q6.test($))return!0;return!1}class r extends v{_parse($){if(this._def.coerce)$.data=String($.data);if(this._getType($)!==V.string){let W=this._getOrReturnCtx($);return K(W,{code:_.invalid_type,expected:V.string,received:W.parsedType}),b}let J=new m,q=void 0;for(let W of this._def.checks)if(W.kind==="min"){if($.data.length<W.value)q=this._getOrReturnCtx($,q),K(q,{code:_.too_small,minimum:W.value,type:"string",inclusive:!0,exact:!1,message:W.message}),J.dirty()}else if(W.kind==="max"){if($.data.length>W.value)q=this._getOrReturnCtx($,q),K(q,{code:_.too_big,maximum:W.value,type:"string",inclusive:!0,exact:!1,message:W.message}),J.dirty()}else if(W.kind==="length"){let Y=$.data.length>W.value,G=$.data.length<W.value;if(Y||G){if(q=this._getOrReturnCtx($,q),Y)K(q,{code:_.too_big,maximum:W.value,type:"string",inclusive:!0,exact:!0,message:W.message});else if(G)K(q,{code:_.too_small,minimum:W.value,type:"string",inclusive:!0,exact:!0,message:W.message});J.dirty()}}else if(W.kind==="email"){if(!t8.test($.data))q=this._getOrReturnCtx($,q),K(q,{validation:"email",code:_.invalid_string,message:W.message}),J.dirty()}else if(W.kind==="emoji"){if(!p0)p0=new RegExp(e8,"u");if(!p0.test($.data))q=this._getOrReturnCtx($,q),K(q,{validation:"emoji",code:_.invalid_string,message:W.message}),J.dirty()}else if(W.kind==="uuid"){if(!n8.test($.data))q=this._getOrReturnCtx($,q),K(q,{validation:"uuid",code:_.invalid_string,message:W.message}),J.dirty()}else if(W.kind==="nanoid"){if(!r8.test($.data))q=this._getOrReturnCtx($,q),K(q,{validation:"nanoid",code:_.invalid_string,message:W.message}),J.dirty()}else if(W.kind==="cuid"){if(!d8.test($.data))q=this._getOrReturnCtx($,q),K(q,{validation:"cuid",code:_.invalid_string,message:W.message}),J.dirty()}else if(W.kind==="cuid2"){if(!i8.test($.data))q=this._getOrReturnCtx($,q),K(q,{validation:"cuid2",code:_.invalid_string,message:W.message}),J.dirty()}else if(W.kind==="ulid"){if(!o8.test($.data))q=this._getOrReturnCtx($,q),K(q,{validation:"ulid",code:_.invalid_string,message:W.message}),J.dirty()}else if(W.kind==="url")try{new URL($.data)}catch{q=this._getOrReturnCtx($,q),K(q,{validation:"url",code:_.invalid_string,message:W.message}),J.dirty()}else if(W.kind==="regex"){if(W.regex.lastIndex=0,!W.regex.test($.data))q=this._getOrReturnCtx($,q),K(q,{validation:"regex",code:_.invalid_string,message:W.message}),J.dirty()}else if(W.kind==="trim")$.data=$.data.trim();else if(W.kind==="includes"){if(!$.data.includes(W.value,W.position))q=this._getOrReturnCtx($,q),K(q,{code:_.invalid_string,validation:{includes:W.value,position:W.position},message:W.message}),J.dirty()}else if(W.kind==="toLowerCase")$.data=$.data.toLowerCase();else if(W.kind==="toUpperCase")$.data=$.data.toUpperCase();else if(W.kind==="startsWith"){if(!$.data.startsWith(W.value))q=this._getOrReturnCtx($,q),K(q,{code:_.invalid_string,validation:{startsWith:W.value},message:W.message}),J.dirty()}else if(W.kind==="endsWith"){if(!$.data.endsWith(W.value))q=this._getOrReturnCtx($,q),K(q,{code:_.invalid_string,validation:{endsWith:W.value},message:W.message}),J.dirty()}else if(W.kind==="datetime"){if(!a2(W).test($.data))q=this._getOrReturnCtx($,q),K(q,{code:_.invalid_string,validation:"datetime",message:W.message}),J.dirty()}else if(W.kind==="date"){if(!G6.test($.data))q=this._getOrReturnCtx($,q),K(q,{code:_.invalid_string,validation:"date",message:W.message}),J.dirty()}else if(W.kind==="time"){if(!X6(W).test($.data))q=this._getOrReturnCtx($,q),K(q,{code:_.invalid_string,validation:"time",message:W.message}),J.dirty()}else if(W.kind==="duration"){if(!s8.test($.data))q=this._getOrReturnCtx($,q),K(q,{validation:"duration",code:_.invalid_string,message:W.message}),J.dirty()}else if(W.kind==="ip"){if(!H6($.data,W.version))q=this._getOrReturnCtx($,q),K(q,{validation:"ip",code:_.invalid_string,message:W.message}),J.dirty()}else if(W.kind==="jwt"){if(!B6($.data,W.alg))q=this._getOrReturnCtx($,q),K(q,{validation:"jwt",code:_.invalid_string,message:W.message}),J.dirty()}else if(W.kind==="cidr"){if(!z6($.data,W.version))q=this._getOrReturnCtx($,q),K(q,{validation:"cidr",code:_.invalid_string,message:W.message}),J.dirty()}else if(W.kind==="base64"){if(!W6.test($.data))q=this._getOrReturnCtx($,q),K(q,{validation:"base64",code:_.invalid_string,message:W.message}),J.dirty()}else if(W.kind==="base64url"){if(!Y6.test($.data))q=this._getOrReturnCtx($,q),K(q,{validation:"base64url",code:_.invalid_string,message:W.message}),J.dirty()}else E.assertNever(W);return{status:J.value,value:$.data}}_regex($,Q,J){return this.refinement((q)=>$.test(q),{validation:Q,code:_.invalid_string,...D.errToObj(J)})}_addCheck($){return new r({...this._def,checks:[...this._def.checks,$]})}email($){return this._addCheck({kind:"email",...D.errToObj($)})}url($){return this._addCheck({kind:"url",...D.errToObj($)})}emoji($){return this._addCheck({kind:"emoji",...D.errToObj($)})}uuid($){return this._addCheck({kind:"uuid",...D.errToObj($)})}nanoid($){return this._addCheck({kind:"nanoid",...D.errToObj($)})}cuid($){return this._addCheck({kind:"cuid",...D.errToObj($)})}cuid2($){return this._addCheck({kind:"cuid2",...D.errToObj($)})}ulid($){return this._addCheck({kind:"ulid",...D.errToObj($)})}base64($){return this._addCheck({kind:"base64",...D.errToObj($)})}base64url($){return this._addCheck({kind:"base64url",...D.errToObj($)})}jwt($){return this._addCheck({kind:"jwt",...D.errToObj($)})}ip($){return this._addCheck({kind:"ip",...D.errToObj($)})}cidr($){return this._addCheck({kind:"cidr",...D.errToObj($)})}datetime($){if(typeof $==="string")return this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:$});return this._addCheck({kind:"datetime",precision:typeof $?.precision>"u"?null:$?.precision,offset:$?.offset??!1,local:$?.local??!1,...D.errToObj($?.message)})}date($){return this._addCheck({kind:"date",message:$})}time($){if(typeof $==="string")return this._addCheck({kind:"time",precision:null,message:$});return this._addCheck({kind:"time",precision:typeof $?.precision>"u"?null:$?.precision,...D.errToObj($?.message)})}duration($){return this._addCheck({kind:"duration",...D.errToObj($)})}regex($,Q){return this._addCheck({kind:"regex",regex:$,...D.errToObj(Q)})}includes($,Q){return this._addCheck({kind:"includes",value:$,position:Q?.position,...D.errToObj(Q?.message)})}startsWith($,Q){return this._addCheck({kind:"startsWith",value:$,...D.errToObj(Q)})}endsWith($,Q){return this._addCheck({kind:"endsWith",value:$,...D.errToObj(Q)})}min($,Q){return this._addCheck({kind:"min",value:$,...D.errToObj(Q)})}max($,Q){return this._addCheck({kind:"max",value:$,...D.errToObj(Q)})}length($,Q){return this._addCheck({kind:"length",value:$,...D.errToObj(Q)})}nonempty($){return this.min(1,D.errToObj($))}trim(){return new r({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new r({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new r({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(($)=>$.kind==="datetime")}get isDate(){return!!this._def.checks.find(($)=>$.kind==="date")}get isTime(){return!!this._def.checks.find(($)=>$.kind==="time")}get isDuration(){return!!this._def.checks.find(($)=>$.kind==="duration")}get isEmail(){return!!this._def.checks.find(($)=>$.kind==="email")}get isURL(){return!!this._def.checks.find(($)=>$.kind==="url")}get isEmoji(){return!!this._def.checks.find(($)=>$.kind==="emoji")}get isUUID(){return!!this._def.checks.find(($)=>$.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(($)=>$.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(($)=>$.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(($)=>$.kind==="cuid2")}get isULID(){return!!this._def.checks.find(($)=>$.kind==="ulid")}get isIP(){return!!this._def.checks.find(($)=>$.kind==="ip")}get isCIDR(){return!!this._def.checks.find(($)=>$.kind==="cidr")}get isBase64(){return!!this._def.checks.find(($)=>$.kind==="base64")}get isBase64url(){return!!this._def.checks.find(($)=>$.kind==="base64url")}get minLength(){let $=null;for(let Q of this._def.checks)if(Q.kind==="min"){if($===null||Q.value>$)$=Q.value}return $}get maxLength(){let $=null;for(let Q of this._def.checks)if(Q.kind==="max"){if($===null||Q.value<$)$=Q.value}return $}}r.create=($)=>{return new r({checks:[],typeName:R.ZodString,coerce:$?.coerce??!1,...S($)})};function _6($,Q){let J=($.toString().split(".")[1]||"").length,q=(Q.toString().split(".")[1]||"").length,W=J>q?J:q,Y=Number.parseInt($.toFixed(W).replace(".","")),G=Number.parseInt(Q.toFixed(W).replace(".",""));return Y%G/10**W}class j1 extends v{constructor(){super(...arguments);this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse($){if(this._def.coerce)$.data=Number($.data);if(this._getType($)!==V.number){let W=this._getOrReturnCtx($);return K(W,{code:_.invalid_type,expected:V.number,received:W.parsedType}),b}let J=void 0,q=new m;for(let W of this._def.checks)if(W.kind==="int"){if(!E.isInteger($.data))J=this._getOrReturnCtx($,J),K(J,{code:_.invalid_type,expected:"integer",received:"float",message:W.message}),q.dirty()}else if(W.kind==="min"){if(W.inclusive?$.data<W.value:$.data<=W.value)J=this._getOrReturnCtx($,J),K(J,{code:_.too_small,minimum:W.value,type:"number",inclusive:W.inclusive,exact:!1,message:W.message}),q.dirty()}else if(W.kind==="max"){if(W.inclusive?$.data>W.value:$.data>=W.value)J=this._getOrReturnCtx($,J),K(J,{code:_.too_big,maximum:W.value,type:"number",inclusive:W.inclusive,exact:!1,message:W.message}),q.dirty()}else if(W.kind==="multipleOf"){if(_6($.data,W.value)!==0)J=this._getOrReturnCtx($,J),K(J,{code:_.not_multiple_of,multipleOf:W.value,message:W.message}),q.dirty()}else if(W.kind==="finite"){if(!Number.isFinite($.data))J=this._getOrReturnCtx($,J),K(J,{code:_.not_finite,message:W.message}),q.dirty()}else E.assertNever(W);return{status:q.value,value:$.data}}gte($,Q){return this.setLimit("min",$,!0,D.toString(Q))}gt($,Q){return this.setLimit("min",$,!1,D.toString(Q))}lte($,Q){return this.setLimit("max",$,!0,D.toString(Q))}lt($,Q){return this.setLimit("max",$,!1,D.toString(Q))}setLimit($,Q,J,q){return new j1({...this._def,checks:[...this._def.checks,{kind:$,value:Q,inclusive:J,message:D.toString(q)}]})}_addCheck($){return new j1({...this._def,checks:[...this._def.checks,$]})}int($){return this._addCheck({kind:"int",message:D.toString($)})}positive($){return this._addCheck({kind:"min",value:0,inclusive:!1,message:D.toString($)})}negative($){return this._addCheck({kind:"max",value:0,inclusive:!1,message:D.toString($)})}nonpositive($){return this._addCheck({kind:"max",value:0,inclusive:!0,message:D.toString($)})}nonnegative($){return this._addCheck({kind:"min",value:0,inclusive:!0,message:D.toString($)})}multipleOf($,Q){return this._addCheck({kind:"multipleOf",value:$,message:D.toString(Q)})}finite($){return this._addCheck({kind:"finite",message:D.toString($)})}safe($){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:D.toString($)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:D.toString($)})}get minValue(){let $=null;for(let Q of this._def.checks)if(Q.kind==="min"){if($===null||Q.value>$)$=Q.value}return $}get maxValue(){let $=null;for(let Q of this._def.checks)if(Q.kind==="max"){if($===null||Q.value<$)$=Q.value}return $}get isInt(){return!!this._def.checks.find(($)=>$.kind==="int"||$.kind==="multipleOf"&&E.isInteger($.value))}get isFinite(){let $=null,Q=null;for(let J of this._def.checks)if(J.kind==="finite"||J.kind==="int"||J.kind==="multipleOf")return!0;else if(J.kind==="min"){if(Q===null||J.value>Q)Q=J.value}else if(J.kind==="max"){if($===null||J.value<$)$=J.value}return Number.isFinite(Q)&&Number.isFinite($)}}j1.create=($)=>{return new j1({checks:[],typeName:R.ZodNumber,coerce:$?.coerce||!1,...S($)})};class V1 extends v{constructor(){super(...arguments);this.min=this.gte,this.max=this.lte}_parse($){if(this._def.coerce)try{$.data=BigInt($.data)}catch{return this._getInvalidInput($)}if(this._getType($)!==V.bigint)return this._getInvalidInput($);let J=void 0,q=new m;for(let W of this._def.checks)if(W.kind==="min"){if(W.inclusive?$.data<W.value:$.data<=W.value)J=this._getOrReturnCtx($,J),K(J,{code:_.too_small,type:"bigint",minimum:W.value,inclusive:W.inclusive,message:W.message}),q.dirty()}else if(W.kind==="max"){if(W.inclusive?$.data>W.value:$.data>=W.value)J=this._getOrReturnCtx($,J),K(J,{code:_.too_big,type:"bigint",maximum:W.value,inclusive:W.inclusive,message:W.message}),q.dirty()}else if(W.kind==="multipleOf"){if($.data%W.value!==BigInt(0))J=this._getOrReturnCtx($,J),K(J,{code:_.not_multiple_of,multipleOf:W.value,message:W.message}),q.dirty()}else E.assertNever(W);return{status:q.value,value:$.data}}_getInvalidInput($){let Q=this._getOrReturnCtx($);return K(Q,{code:_.invalid_type,expected:V.bigint,received:Q.parsedType}),b}gte($,Q){return this.setLimit("min",$,!0,D.toString(Q))}gt($,Q){return this.setLimit("min",$,!1,D.toString(Q))}lte($,Q){return this.setLimit("max",$,!0,D.toString(Q))}lt($,Q){return this.setLimit("max",$,!1,D.toString(Q))}setLimit($,Q,J,q){return new V1({...this._def,checks:[...this._def.checks,{kind:$,value:Q,inclusive:J,message:D.toString(q)}]})}_addCheck($){return new V1({...this._def,checks:[...this._def.checks,$]})}positive($){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:D.toString($)})}negative($){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:D.toString($)})}nonpositive($){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:D.toString($)})}nonnegative($){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:D.toString($)})}multipleOf($,Q){return this._addCheck({kind:"multipleOf",value:$,message:D.toString(Q)})}get minValue(){let $=null;for(let Q of this._def.checks)if(Q.kind==="min"){if($===null||Q.value>$)$=Q.value}return $}get maxValue(){let $=null;for(let Q of this._def.checks)if(Q.kind==="max"){if($===null||Q.value<$)$=Q.value}return $}}V1.create=($)=>{return new V1({checks:[],typeName:R.ZodBigInt,coerce:$?.coerce??!1,...S($)})};class P1 extends v{_parse($){if(this._def.coerce)$.data=Boolean($.data);if(this._getType($)!==V.boolean){let J=this._getOrReturnCtx($);return K(J,{code:_.invalid_type,expected:V.boolean,received:J.parsedType}),b}return l($.data)}}P1.create=($)=>{return new P1({typeName:R.ZodBoolean,coerce:$?.coerce||!1,...S($)})};class O1 extends v{_parse($){if(this._def.coerce)$.data=new Date($.data);if(this._getType($)!==V.date){let W=this._getOrReturnCtx($);return K(W,{code:_.invalid_type,expected:V.date,received:W.parsedType}),b}if(Number.isNaN($.data.getTime())){let W=this._getOrReturnCtx($);return K(W,{code:_.invalid_date}),b}let J=new m,q=void 0;for(let W of this._def.checks)if(W.kind==="min"){if($.data.getTime()<W.value)q=this._getOrReturnCtx($,q),K(q,{code:_.too_small,message:W.message,inclusive:!0,exact:!1,minimum:W.value,type:"date"}),J.dirty()}else if(W.kind==="max"){if($.data.getTime()>W.value)q=this._getOrReturnCtx($,q),K(q,{code:_.too_big,message:W.message,inclusive:!0,exact:!1,maximum:W.value,type:"date"}),J.dirty()}else E.assertNever(W);return{status:J.value,value:new Date($.data.getTime())}}_addCheck($){return new O1({...this._def,checks:[...this._def.checks,$]})}min($,Q){return this._addCheck({kind:"min",value:$.getTime(),message:D.toString(Q)})}max($,Q){return this._addCheck({kind:"max",value:$.getTime(),message:D.toString(Q)})}get minDate(){let $=null;for(let Q of this._def.checks)if(Q.kind==="min"){if($===null||Q.value>$)$=Q.value}return $!=null?new Date($):null}get maxDate(){let $=null;for(let Q of this._def.checks)if(Q.kind==="max"){if($===null||Q.value<$)$=Q.value}return $!=null?new Date($):null}}O1.create=($)=>{return new O1({checks:[],coerce:$?.coerce||!1,typeName:R.ZodDate,...S($)})};class i1 extends v{_parse($){if(this._getType($)!==V.symbol){let J=this._getOrReturnCtx($);return K(J,{code:_.invalid_type,expected:V.symbol,received:J.parsedType}),b}return l($.data)}}i1.create=($)=>{return new i1({typeName:R.ZodSymbol,...S($)})};class C1 extends v{_parse($){if(this._getType($)!==V.undefined){let J=this._getOrReturnCtx($);return K(J,{code:_.invalid_type,expected:V.undefined,received:J.parsedType}),b}return l($.data)}}C1.create=($)=>{return new C1({typeName:R.ZodUndefined,...S($)})};class f1 extends v{_parse($){if(this._getType($)!==V.null){let J=this._getOrReturnCtx($);return K(J,{code:_.invalid_type,expected:V.null,received:J.parsedType}),b}return l($.data)}}f1.create=($)=>{return new f1({typeName:R.ZodNull,...S($)})};class b1 extends v{constructor(){super(...arguments);this._any=!0}_parse($){return l($.data)}}b1.create=($)=>{return new b1({typeName:R.ZodAny,...S($)})};class M1 extends v{constructor(){super(...arguments);this._unknown=!0}_parse($){return l($.data)}}M1.create=($)=>{return new M1({typeName:R.ZodUnknown,...S($)})};class q1 extends v{_parse($){let Q=this._getOrReturnCtx($);return K(Q,{code:_.invalid_type,expected:V.never,received:Q.parsedType}),b}}q1.create=($)=>{return new q1({typeName:R.ZodNever,...S($)})};class o1 extends v{_parse($){if(this._getType($)!==V.undefined){let J=this._getOrReturnCtx($);return K(J,{code:_.invalid_type,expected:V.void,received:J.parsedType}),b}return l($.data)}}o1.create=($)=>{return new o1({typeName:R.ZodVoid,...S($)})};class a extends v{_parse($){let{ctx:Q,status:J}=this._processInputParams($),q=this._def;if(Q.parsedType!==V.array)return K(Q,{code:_.invalid_type,expected:V.array,received:Q.parsedType}),b;if(q.exactLength!==null){let Y=Q.data.length>q.exactLength.value,G=Q.data.length<q.exactLength.value;if(Y||G)K(Q,{code:Y?_.too_big:_.too_small,minimum:G?q.exactLength.value:void 0,maximum:Y?q.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:q.exactLength.message}),J.dirty()}if(q.minLength!==null){if(Q.data.length<q.minLength.value)K(Q,{code:_.too_small,minimum:q.minLength.value,type:"array",inclusive:!0,exact:!1,message:q.minLength.message}),J.dirty()}if(q.maxLength!==null){if(Q.data.length>q.maxLength.value)K(Q,{code:_.too_big,maximum:q.maxLength.value,type:"array",inclusive:!0,exact:!1,message:q.maxLength.message}),J.dirty()}if(Q.common.async)return Promise.all([...Q.data].map((Y,G)=>{return q.type._parseAsync(new t(Q,Y,Q.path,G))})).then((Y)=>{return m.mergeArray(J,Y)});let W=[...Q.data].map((Y,G)=>{return q.type._parseSync(new t(Q,Y,Q.path,G))});return m.mergeArray(J,W)}get element(){return this._def.type}min($,Q){return new a({...this._def,minLength:{value:$,message:D.toString(Q)}})}max($,Q){return new a({...this._def,maxLength:{value:$,message:D.toString(Q)}})}length($,Q){return new a({...this._def,exactLength:{value:$,message:D.toString(Q)}})}nonempty($){return this.min(1,$)}}a.create=($,Q)=>{return new a({type:$,minLength:null,maxLength:null,exactLength:null,typeName:R.ZodArray,...S(Q)})};function E1($){if($ instanceof g){let Q={};for(let J in $.shape){let q=$.shape[J];Q[J]=s.create(E1(q))}return new g({...$._def,shape:()=>Q})}else if($ instanceof a)return new a({...$._def,type:E1($.element)});else if($ instanceof s)return s.create(E1($.unwrap()));else if($ instanceof B1)return B1.create(E1($.unwrap()));else if($ instanceof W1)return W1.create($.items.map((Q)=>E1(Q)));else return $}class g extends v{constructor(){super(...arguments);this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let $=this._def.shape(),Q=E.objectKeys($);return this._cached={shape:$,keys:Q},this._cached}_parse($){if(this._getType($)!==V.object){let H=this._getOrReturnCtx($);return K(H,{code:_.invalid_type,expected:V.object,received:H.parsedType}),b}let{status:J,ctx:q}=this._processInputParams($),{shape:W,keys:Y}=this._getCached(),G=[];if(!(this._def.catchall instanceof q1&&this._def.unknownKeys==="strip")){for(let H in q.data)if(!Y.includes(H))G.push(H)}let X=[];for(let H of Y){let B=W[H],j=q.data[H];X.push({key:{status:"valid",value:H},value:B._parse(new t(q,j,q.path,H)),alwaysSet:H in q.data})}if(this._def.catchall instanceof q1){let H=this._def.unknownKeys;if(H==="passthrough")for(let B of G)X.push({key:{status:"valid",value:B},value:{status:"valid",value:q.data[B]}});else if(H==="strict"){if(G.length>0)K(q,{code:_.unrecognized_keys,keys:G}),J.dirty()}else if(H==="strip");else throw Error("Internal ZodObject error: invalid unknownKeys value.")}else{let H=this._def.catchall;for(let B of G){let j=q.data[B];X.push({key:{status:"valid",value:B},value:H._parse(new t(q,j,q.path,B)),alwaysSet:B in q.data})}}if(q.common.async)return Promise.resolve().then(async()=>{let H=[];for(let B of X){let j=await B.key,A=await B.value;H.push({key:j,value:A,alwaysSet:B.alwaysSet})}return H}).then((H)=>{return m.mergeObjectSync(J,H)});else return m.mergeObjectSync(J,X)}get shape(){return this._def.shape()}strict($){return D.errToObj,new g({...this._def,unknownKeys:"strict",...$!==void 0?{errorMap:(Q,J)=>{let q=this._def.errorMap?.(Q,J).message??J.defaultError;if(Q.code==="unrecognized_keys")return{message:D.errToObj($).message??q};return{message:q}}}:{}})}strip(){return new g({...this._def,unknownKeys:"strip"})}passthrough(){return new g({...this._def,unknownKeys:"passthrough"})}extend($){return new g({...this._def,shape:()=>({...this._def.shape(),...$})})}merge($){return new g({unknownKeys:$._def.unknownKeys,catchall:$._def.catchall,shape:()=>({...this._def.shape(),...$._def.shape()}),typeName:R.ZodObject})}setKey($,Q){return this.augment({[$]:Q})}catchall($){return new g({...this._def,catchall:$})}pick($){let Q={};for(let J of E.objectKeys($))if($[J]&&this.shape[J])Q[J]=this.shape[J];return new g({...this._def,shape:()=>Q})}omit($){let Q={};for(let J of E.objectKeys(this.shape))if(!$[J])Q[J]=this.shape[J];return new g({...this._def,shape:()=>Q})}deepPartial(){return E1(this)}partial($){let Q={};for(let J of E.objectKeys(this.shape)){let q=this.shape[J];if($&&!$[J])Q[J]=q;else Q[J]=q.optional()}return new g({...this._def,shape:()=>Q})}required($){let Q={};for(let J of E.objectKeys(this.shape))if($&&!$[J])Q[J]=this.shape[J];else{let W=this.shape[J];while(W instanceof s)W=W._def.innerType;Q[J]=W}return new g({...this._def,shape:()=>Q})}keyof(){return s2(E.objectKeys(this.shape))}}g.create=($,Q)=>{return new g({shape:()=>$,unknownKeys:"strip",catchall:q1.create(),typeName:R.ZodObject,...S(Q)})};g.strictCreate=($,Q)=>{return new g({shape:()=>$,unknownKeys:"strict",catchall:q1.create(),typeName:R.ZodObject,...S(Q)})};g.lazycreate=($,Q)=>{return new g({shape:$,unknownKeys:"strip",catchall:q1.create(),typeName:R.ZodObject,...S(Q)})};class I1 extends v{_parse($){let{ctx:Q}=this._processInputParams($),J=this._def.options;function q(W){for(let G of W)if(G.result.status==="valid")return G.result;for(let G of W)if(G.result.status==="dirty")return Q.common.issues.push(...G.ctx.common.issues),G.result;let Y=W.map((G)=>new d(G.ctx.common.issues));return K(Q,{code:_.invalid_union,unionErrors:Y}),b}if(Q.common.async)return Promise.all(J.map(async(W)=>{let Y={...Q,common:{...Q.common,issues:[]},parent:null};return{result:await W._parseAsync({data:Q.data,path:Q.path,parent:Y}),ctx:Y}})).then(q);else{let W=void 0,Y=[];for(let X of J){let H={...Q,common:{...Q.common,issues:[]},parent:null},B=X._parseSync({data:Q.data,path:Q.path,parent:H});if(B.status==="valid")return B;else if(B.status==="dirty"&&!W)W={result:B,ctx:H};if(H.common.issues.length)Y.push(H.common.issues)}if(W)return Q.common.issues.push(...W.ctx.common.issues),W.result;let G=Y.map((X)=>new d(X));return K(Q,{code:_.invalid_union,unionErrors:G}),b}}get options(){return this._def.options}}I1.create=($,Q)=>{return new I1({options:$,typeName:R.ZodUnion,...S(Q)})};var H1=($)=>{if($ instanceof g1)return H1($.schema);else if($ instanceof e)return H1($.innerType());else if($ instanceof x1)return[$.value];else if($ instanceof K1)return $.options;else if($ instanceof Z1)return E.objectValues($.enum);else if($ instanceof y1)return H1($._def.innerType);else if($ instanceof C1)return[void 0];else if($ instanceof f1)return[null];else if($ instanceof s)return[void 0,...H1($.unwrap())];else if($ instanceof B1)return[null,...H1($.unwrap())];else if($ instanceof N0)return H1($.unwrap());else if($ instanceof m1)return H1($.unwrap());else if($ instanceof h1)return H1($._def.innerType);else return[]};class F0 extends v{_parse($){let{ctx:Q}=this._processInputParams($);if(Q.parsedType!==V.object)return K(Q,{code:_.invalid_type,expected:V.object,received:Q.parsedType}),b;let J=this.discriminator,q=Q.data[J],W=this.optionsMap.get(q);if(!W)return K(Q,{code:_.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[J]}),b;if(Q.common.async)return W._parseAsync({data:Q.data,path:Q.path,parent:Q});else return W._parseSync({data:Q.data,path:Q.path,parent:Q})}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create($,Q,J){let q=new Map;for(let W of Q){let Y=H1(W.shape[$]);if(!Y.length)throw Error(`A discriminator value for key \`${$}\` could not be extracted from all schema options`);for(let G of Y){if(q.has(G))throw Error(`Discriminator property ${String($)} has duplicate value ${String(G)}`);q.set(G,W)}}return new F0({typeName:R.ZodDiscriminatedUnion,discriminator:$,options:Q,optionsMap:q,...S(J)})}}function d0($,Q){let J=J1($),q=J1(Q);if($===Q)return{valid:!0,data:$};else if(J===V.object&&q===V.object){let W=E.objectKeys(Q),Y=E.objectKeys($).filter((X)=>W.indexOf(X)!==-1),G={...$,...Q};for(let X of Y){let H=d0($[X],Q[X]);if(!H.valid)return{valid:!1};G[X]=H.data}return{valid:!0,data:G}}else if(J===V.array&&q===V.array){if($.length!==Q.length)return{valid:!1};let W=[];for(let Y=0;Y<$.length;Y++){let G=$[Y],X=Q[Y],H=d0(G,X);if(!H.valid)return{valid:!1};W.push(H.data)}return{valid:!0,data:W}}else if(J===V.date&&q===V.date&&+$===+Q)return{valid:!0,data:$};else return{valid:!1}}class T1 extends v{_parse($){let{status:Q,ctx:J}=this._processInputParams($),q=(W,Y)=>{if(V0(W)||V0(Y))return b;let G=d0(W.value,Y.value);if(!G.valid)return K(J,{code:_.invalid_intersection_types}),b;if(K0(W)||K0(Y))Q.dirty();return{status:Q.value,value:G.data}};if(J.common.async)return Promise.all([this._def.left._parseAsync({data:J.data,path:J.path,parent:J}),this._def.right._parseAsync({data:J.data,path:J.path,parent:J})]).then(([W,Y])=>q(W,Y));else return q(this._def.left._parseSync({data:J.data,path:J.path,parent:J}),this._def.right._parseSync({data:J.data,path:J.path,parent:J}))}}T1.create=($,Q,J)=>{return new T1({left:$,right:Q,typeName:R.ZodIntersection,...S(J)})};class W1 extends v{_parse($){let{status:Q,ctx:J}=this._processInputParams($);if(J.parsedType!==V.array)return K(J,{code:_.invalid_type,expected:V.array,received:J.parsedType}),b;if(J.data.length<this._def.items.length)return K(J,{code:_.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),b;if(!this._def.rest&&J.data.length>this._def.items.length)K(J,{code:_.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),Q.dirty();let W=[...J.data].map((Y,G)=>{let X=this._def.items[G]||this._def.rest;if(!X)return null;return X._parse(new t(J,Y,J.path,G))}).filter((Y)=>!!Y);if(J.common.async)return Promise.all(W).then((Y)=>{return m.mergeArray(Q,Y)});else return m.mergeArray(Q,W)}get items(){return this._def.items}rest($){return new W1({...this._def,rest:$})}}W1.create=($,Q)=>{if(!Array.isArray($))throw Error("You must pass an array of schemas to z.tuple([ ... ])");return new W1({items:$,typeName:R.ZodTuple,rest:null,...S(Q)})};class n1 extends v{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse($){let{status:Q,ctx:J}=this._processInputParams($);if(J.parsedType!==V.object)return K(J,{code:_.invalid_type,expected:V.object,received:J.parsedType}),b;let q=[],W=this._def.keyType,Y=this._def.valueType;for(let G in J.data)q.push({key:W._parse(new t(J,G,J.path,G)),value:Y._parse(new t(J,J.data[G],J.path,G)),alwaysSet:G in J.data});if(J.common.async)return m.mergeObjectAsync(Q,q);else return m.mergeObjectSync(Q,q)}get element(){return this._def.valueType}static create($,Q,J){if(Q instanceof v)return new n1({keyType:$,valueType:Q,typeName:R.ZodRecord,...S(J)});return new n1({keyType:r.create(),valueType:$,typeName:R.ZodRecord,...S(Q)})}}class r1 extends v{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse($){let{status:Q,ctx:J}=this._processInputParams($);if(J.parsedType!==V.map)return K(J,{code:_.invalid_type,expected:V.map,received:J.parsedType}),b;let q=this._def.keyType,W=this._def.valueType,Y=[...J.data.entries()].map(([G,X],H)=>{return{key:q._parse(new t(J,G,J.path,[H,"key"])),value:W._parse(new t(J,X,J.path,[H,"value"]))}});if(J.common.async){let G=new Map;return Promise.resolve().then(async()=>{for(let X of Y){let H=await X.key,B=await X.value;if(H.status==="aborted"||B.status==="aborted")return b;if(H.status==="dirty"||B.status==="dirty")Q.dirty();G.set(H.value,B.value)}return{status:Q.value,value:G}})}else{let G=new Map;for(let X of Y){let{key:H,value:B}=X;if(H.status==="aborted"||B.status==="aborted")return b;if(H.status==="dirty"||B.status==="dirty")Q.dirty();G.set(H.value,B.value)}return{status:Q.value,value:G}}}}r1.create=($,Q,J)=>{return new r1({valueType:Q,keyType:$,typeName:R.ZodMap,...S(J)})};class R1 extends v{_parse($){let{status:Q,ctx:J}=this._processInputParams($);if(J.parsedType!==V.set)return K(J,{code:_.invalid_type,expected:V.set,received:J.parsedType}),b;let q=this._def;if(q.minSize!==null){if(J.data.size<q.minSize.value)K(J,{code:_.too_small,minimum:q.minSize.value,type:"set",inclusive:!0,exact:!1,message:q.minSize.message}),Q.dirty()}if(q.maxSize!==null){if(J.data.size>q.maxSize.value)K(J,{code:_.too_big,maximum:q.maxSize.value,type:"set",inclusive:!0,exact:!1,message:q.maxSize.message}),Q.dirty()}let W=this._def.valueType;function Y(X){let H=new Set;for(let B of X){if(B.status==="aborted")return b;if(B.status==="dirty")Q.dirty();H.add(B.value)}return{status:Q.value,value:H}}let G=[...J.data.values()].map((X,H)=>W._parse(new t(J,X,J.path,H)));if(J.common.async)return Promise.all(G).then((X)=>Y(X));else return Y(G)}min($,Q){return new R1({...this._def,minSize:{value:$,message:D.toString(Q)}})}max($,Q){return new R1({...this._def,maxSize:{value:$,message:D.toString(Q)}})}size($,Q){return this.min($,Q).max($,Q)}nonempty($){return this.min(1,$)}}R1.create=($,Q)=>{return new R1({valueType:$,minSize:null,maxSize:null,typeName:R.ZodSet,...S(Q)})};class k1 extends v{constructor(){super(...arguments);this.validate=this.implement}_parse($){let{ctx:Q}=this._processInputParams($);if(Q.parsedType!==V.function)return K(Q,{code:_.invalid_type,expected:V.function,received:Q.parsedType}),b;function J(G,X){return d1({data:G,path:Q.path,errorMaps:[Q.common.contextualErrorMap,Q.schemaErrorMap,S1(),X1].filter((H)=>!!H),issueData:{code:_.invalid_arguments,argumentsError:X}})}function q(G,X){return d1({data:G,path:Q.path,errorMaps:[Q.common.contextualErrorMap,Q.schemaErrorMap,S1(),X1].filter((H)=>!!H),issueData:{code:_.invalid_return_type,returnTypeError:X}})}let W={errorMap:Q.common.contextualErrorMap},Y=Q.data;if(this._def.returns instanceof L1){let G=this;return l(async function(...X){let H=new d([]),B=await G._def.args.parseAsync(X,W).catch((z)=>{throw H.addIssue(J(X,z)),H}),j=await Reflect.apply(Y,this,B);return await G._def.returns._def.type.parseAsync(j,W).catch((z)=>{throw H.addIssue(q(j,z)),H})})}else{let G=this;return l(function(...X){let H=G._def.args.safeParse(X,W);if(!H.success)throw new d([J(X,H.error)]);let B=Reflect.apply(Y,this,H.data),j=G._def.returns.safeParse(B,W);if(!j.success)throw new d([q(B,j.error)]);return j.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...$){return new k1({...this._def,args:W1.create($).rest(M1.create())})}returns($){return new k1({...this._def,returns:$})}implement($){return this.parse($)}strictImplement($){return this.parse($)}static create($,Q,J){return new k1({args:$?$:W1.create([]).rest(M1.create()),returns:Q||M1.create(),typeName:R.ZodFunction,...S(J)})}}class g1 extends v{get schema(){return this._def.getter()}_parse($){let{ctx:Q}=this._processInputParams($);return this._def.getter()._parse({data:Q.data,path:Q.path,parent:Q})}}g1.create=($,Q)=>{return new g1({getter:$,typeName:R.ZodLazy,...S(Q)})};class x1 extends v{_parse($){if($.data!==this._def.value){let Q=this._getOrReturnCtx($);return K(Q,{received:Q.data,code:_.invalid_literal,expected:this._def.value}),b}return{status:"valid",value:$.data}}get value(){return this._def.value}}x1.create=($,Q)=>{return new x1({value:$,typeName:R.ZodLiteral,...S(Q)})};function s2($,Q){return new K1({values:$,typeName:R.ZodEnum,...S(Q)})}class K1 extends v{_parse($){if(typeof $.data!=="string"){let Q=this._getOrReturnCtx($),J=this._def.values;return K(Q,{expected:E.joinValues(J),received:Q.parsedType,code:_.invalid_type}),b}if(!this._cache)this._cache=new Set(this._def.values);if(!this._cache.has($.data)){let Q=this._getOrReturnCtx($),J=this._def.values;return K(Q,{received:Q.data,code:_.invalid_enum_value,options:J}),b}return l($.data)}get options(){return this._def.values}get enum(){let $={};for(let Q of this._def.values)$[Q]=Q;return $}get Values(){let $={};for(let Q of this._def.values)$[Q]=Q;return $}get Enum(){let $={};for(let Q of this._def.values)$[Q]=Q;return $}extract($,Q=this._def){return K1.create($,{...this._def,...Q})}exclude($,Q=this._def){return K1.create(this.options.filter((J)=>!$.includes(J)),{...this._def,...Q})}}K1.create=s2;class Z1 extends v{_parse($){let Q=E.getValidEnumValues(this._def.values),J=this._getOrReturnCtx($);if(J.parsedType!==V.string&&J.parsedType!==V.number){let q=E.objectValues(Q);return K(J,{expected:E.joinValues(q),received:J.parsedType,code:_.invalid_type}),b}if(!this._cache)this._cache=new Set(E.getValidEnumValues(this._def.values));if(!this._cache.has($.data)){let q=E.objectValues(Q);return K(J,{received:J.data,code:_.invalid_enum_value,options:q}),b}return l($.data)}get enum(){return this._def.values}}Z1.create=($,Q)=>{return new Z1({values:$,typeName:R.ZodNativeEnum,...S(Q)})};class L1 extends v{unwrap(){return this._def.type}_parse($){let{ctx:Q}=this._processInputParams($);if(Q.parsedType!==V.promise&&Q.common.async===!1)return K(Q,{code:_.invalid_type,expected:V.promise,received:Q.parsedType}),b;let J=Q.parsedType===V.promise?Q.data:Promise.resolve(Q.data);return l(J.then((q)=>{return this._def.type.parseAsync(q,{path:Q.path,errorMap:Q.common.contextualErrorMap})}))}}L1.create=($,Q)=>{return new L1({type:$,typeName:R.ZodPromise,...S(Q)})};class e extends v{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===R.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse($){let{status:Q,ctx:J}=this._processInputParams($),q=this._def.effect||null,W={addIssue:(Y)=>{if(K(J,Y),Y.fatal)Q.abort();else Q.dirty()},get path(){return J.path}};if(W.addIssue=W.addIssue.bind(W),q.type==="preprocess"){let Y=q.transform(J.data,W);if(J.common.async)return Promise.resolve(Y).then(async(G)=>{if(Q.value==="aborted")return b;let X=await this._def.schema._parseAsync({data:G,path:J.path,parent:J});if(X.status==="aborted")return b;if(X.status==="dirty")return D1(X.value);if(Q.value==="dirty")return D1(X.value);return X});else{if(Q.value==="aborted")return b;let G=this._def.schema._parseSync({data:Y,path:J.path,parent:J});if(G.status==="aborted")return b;if(G.status==="dirty")return D1(G.value);if(Q.value==="dirty")return D1(G.value);return G}}if(q.type==="refinement"){let Y=(G)=>{let X=q.refinement(G,W);if(J.common.async)return Promise.resolve(X);if(X instanceof Promise)throw Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return G};if(J.common.async===!1){let G=this._def.schema._parseSync({data:J.data,path:J.path,parent:J});if(G.status==="aborted")return b;if(G.status==="dirty")Q.dirty();return Y(G.value),{status:Q.value,value:G.value}}else return this._def.schema._parseAsync({data:J.data,path:J.path,parent:J}).then((G)=>{if(G.status==="aborted")return b;if(G.status==="dirty")Q.dirty();return Y(G.value).then(()=>{return{status:Q.value,value:G.value}})})}if(q.type==="transform")if(J.common.async===!1){let Y=this._def.schema._parseSync({data:J.data,path:J.path,parent:J});if(!_1(Y))return b;let G=q.transform(Y.value,W);if(G instanceof Promise)throw Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:Q.value,value:G}}else return this._def.schema._parseAsync({data:J.data,path:J.path,parent:J}).then((Y)=>{if(!_1(Y))return b;return Promise.resolve(q.transform(Y.value,W)).then((G)=>({status:Q.value,value:G}))});E.assertNever(q)}}e.create=($,Q,J)=>{return new e({schema:$,typeName:R.ZodEffects,effect:Q,...S(J)})};e.createWithPreprocess=($,Q,J)=>{return new e({schema:Q,effect:{type:"preprocess",transform:$},typeName:R.ZodEffects,...S(J)})};class s extends v{_parse($){if(this._getType($)===V.undefined)return l(void 0);return this._def.innerType._parse($)}unwrap(){return this._def.innerType}}s.create=($,Q)=>{return new s({innerType:$,typeName:R.ZodOptional,...S(Q)})};class B1 extends v{_parse($){if(this._getType($)===V.null)return l(null);return this._def.innerType._parse($)}unwrap(){return this._def.innerType}}B1.create=($,Q)=>{return new B1({innerType:$,typeName:R.ZodNullable,...S(Q)})};class y1 extends v{_parse($){let{ctx:Q}=this._processInputParams($),J=Q.data;if(Q.parsedType===V.undefined)J=this._def.defaultValue();return this._def.innerType._parse({data:J,path:Q.path,parent:Q})}removeDefault(){return this._def.innerType}}y1.create=($,Q)=>{return new y1({innerType:$,typeName:R.ZodDefault,defaultValue:typeof Q.default==="function"?Q.default:()=>Q.default,...S(Q)})};class h1 extends v{_parse($){let{ctx:Q}=this._processInputParams($),J={...Q,common:{...Q.common,issues:[]}},q=this._def.innerType._parse({data:J.data,path:J.path,parent:{...J}});if(v1(q))return q.then((W)=>{return{status:"valid",value:W.status==="valid"?W.value:this._def.catchValue({get error(){return new d(J.common.issues)},input:J.data})}});else return{status:"valid",value:q.status==="valid"?q.value:this._def.catchValue({get error(){return new d(J.common.issues)},input:J.data})}}removeCatch(){return this._def.innerType}}h1.create=($,Q)=>{return new h1({innerType:$,typeName:R.ZodCatch,catchValue:typeof Q.catch==="function"?Q.catch:()=>Q.catch,...S(Q)})};class a1 extends v{_parse($){if(this._getType($)!==V.nan){let J=this._getOrReturnCtx($);return K(J,{code:_.invalid_type,expected:V.nan,received:J.parsedType}),b}return{status:"valid",value:$.data}}}a1.create=($)=>{return new a1({typeName:R.ZodNaN,...S($)})};var M6=Symbol("zod_brand");class N0 extends v{_parse($){let{ctx:Q}=this._processInputParams($),J=Q.data;return this._def.type._parse({data:J,path:Q.path,parent:Q})}unwrap(){return this._def.type}}class s1 extends v{_parse($){let{status:Q,ctx:J}=this._processInputParams($);if(J.common.async)return(async()=>{let W=await this._def.in._parseAsync({data:J.data,path:J.path,parent:J});if(W.status==="aborted")return b;if(W.status==="dirty")return Q.dirty(),D1(W.value);else return this._def.out._parseAsync({data:W.value,path:J.path,parent:J})})();else{let q=this._def.in._parseSync({data:J.data,path:J.path,parent:J});if(q.status==="aborted")return b;if(q.status==="dirty")return Q.dirty(),{status:"dirty",value:q.value};else return this._def.out._parseSync({data:q.value,path:J.path,parent:J})}}static create($,Q){return new s1({in:$,out:Q,typeName:R.ZodPipeline})}}class m1 extends v{_parse($){let Q=this._def.innerType._parse($),J=(q)=>{if(_1(q))q.value=Object.freeze(q.value);return q};return v1(Q)?Q.then((q)=>J(q)):J(Q)}unwrap(){return this._def.innerType}}m1.create=($,Q)=>{return new m1({innerType:$,typeName:R.ZodReadonly,...S(Q)})};function o2($,Q){let J=typeof $==="function"?$(Q):typeof $==="string"?{message:$}:$;return typeof J==="string"?{message:J}:J}function t2($,Q={},J){if($)return b1.create().superRefine((q,W)=>{let Y=$(q);if(Y instanceof Promise)return Y.then((G)=>{if(!G){let X=o2(Q,q),H=X.fatal??J??!0;W.addIssue({code:"custom",...X,fatal:H})}});if(!Y){let G=o2(Q,q),X=G.fatal??J??!0;W.addIssue({code:"custom",...G,fatal:X})}return});return b1.create()}var j6={object:g.lazycreate},R;(function($){$.ZodString="ZodString",$.ZodNumber="ZodNumber",$.ZodNaN="ZodNaN",$.ZodBigInt="ZodBigInt",$.ZodBoolean="ZodBoolean",$.ZodDate="ZodDate",$.ZodSymbol="ZodSymbol",$.ZodUndefined="ZodUndefined",$.ZodNull="ZodNull",$.ZodAny="ZodAny",$.ZodUnknown="ZodUnknown",$.ZodNever="ZodNever",$.ZodVoid="ZodVoid",$.ZodArray="ZodArray",$.ZodObject="ZodObject",$.ZodUnion="ZodUnion",$.ZodDiscriminatedUnion="ZodDiscriminatedUnion",$.ZodIntersection="ZodIntersection",$.ZodTuple="ZodTuple",$.ZodRecord="ZodRecord",$.ZodMap="ZodMap",$.ZodSet="ZodSet",$.ZodFunction="ZodFunction",$.ZodLazy="ZodLazy",$.ZodLiteral="ZodLiteral",$.ZodEnum="ZodEnum",$.ZodEffects="ZodEffects",$.ZodNativeEnum="ZodNativeEnum",$.ZodOptional="ZodOptional",$.ZodNullable="ZodNullable",$.ZodDefault="ZodDefault",$.ZodCatch="ZodCatch",$.ZodPromise="ZodPromise",$.ZodBranded="ZodBranded",$.ZodPipeline="ZodPipeline",$.ZodReadonly="ZodReadonly"})(R||(R={}));var V6=($,Q={message:`Input not instance of ${$.name}`})=>t2((J)=>J instanceof $,Q),e2=r.create,$4=j1.create,K6=a1.create,F6=V1.create,Q4=P1.create,N6=O1.create,U6=i1.create,A6=C1.create,w6=f1.create,D6=b1.create,O6=M1.create,b6=q1.create,R6=o1.create,L6=a.create,S6=g.create,v6=g.strictCreate,E6=I1.create,k6=F0.create,P6=T1.create,C6=W1.create,f6=n1.create,I6=r1.create,T6=R1.create,g6=k1.create,x6=g1.create,Z6=x1.create,y6=K1.create,h6=Z1.create,m6=L1.create,l6=e.create,c6=s.create,u6=B1.create,p6=e.createWithPreprocess,d6=s1.create,i6=()=>e2().optional(),o6=()=>$4().optional(),n6=()=>Q4().optional(),r6={string:($)=>r.create({...$,coerce:!0}),number:($)=>j1.create({...$,coerce:!0}),boolean:($)=>P1.create({...$,coerce:!0}),bigint:($)=>V1.create({...$,coerce:!0}),date:($)=>O1.create({...$,coerce:!0})};var a6=b;var i0=/^[A-Za-z0-9][A-Za-z0-9._-]{0,63}$/;function s6($){let Q;try{Q=new URL($)}catch{return!1}if(Q.protocol!=="http:"&&Q.protocol!=="https:")return!1;return Q.hostname==="localhost"||Q.hostname==="127.0.0.1"||Q.hostname==="[::1]"||Q.hostname.endsWith(".localhost")}var F1=M.string().max(500),U0=4000,o0=1000,A0=1000,t6=M.object({label:F1,file:M.string().max(o0),line:M.number().int().positive(),column:M.number().int().nonnegative()}),l1=M.object({url:M.string().min(1).max(2000),selector:M.string().max(2000),role:F1.optional(),name:F1.optional(),text:F1.optional(),components:M.array(M.string().max(200)).max(20).optional(),sources:M.array(t6).max(10).optional(),context:F1.optional(),browser:M.object({name:F1,viewport:M.object({width:M.number().int().nonnegative(),height:M.number().int().nonnegative(),scale:M.number().positive()}),colorScheme:M.enum(["light","dark"])}).optional(),style:M.string().max(A0).optional(),html:M.string().max(U0).optional(),quote:M.object({exact:M.string().min(1).max(2000),before:F1,after:F1}).optional()}),n0=M.enum(["user","agent"]),e6=M.object({id:M.string(),author:n0,body:M.string().min(1).max(20000),createdAt:M.string()}),r0=M.enum(["open","queued","working","resolved"]),t1=M.object({id:M.string(),anchor:l1,state:r0,comments:M.array(e6).min(1),screenshot:M.string().optional(),createdAt:M.string(),updatedAt:M.string()}),W7=M.object({threads:M.array(t1)}),a0=M.string().trim().min(1).max(20000),J4="data:image/png;base64,",$$=M.string().startsWith(J4).max(8000000).transform(($)=>Uint8Array.from(atob($.slice(J4.length)),(Q)=>Q.charCodeAt(0))),Y7=M.object({anchor:l1,body:a0,send:M.boolean(),screenshot:$$.optional()}),G7=M.object({body:a0,send:M.boolean()}),X7=M.object({body:a0,resolve:M.boolean()}),q4=M.string().url().refine(($)=>s6($),"must be an http(s) URL on localhost"),H7=M.object({target:q4}),B7=M.object({target:q4,port:M.number().int().min(1).max(65535)});var W4=/^[a-f0-9]{24}$/,s0="agent-canvas-review",Q$=5;var J$=200,Y4=160000,w0=110000,G4=11000000;function N1($){return M.string().min(1).max($).regex(/^[A-Za-z0-9+/]+={0,2}$/,"must be base64 ciphertext")}var q$=M.string().refine(($)=>{let Q;try{Q=new URL($)}catch{return!1}if(Q.origin!==$)return!1;if(Q.protocol==="https:")return!0;return Q.protocol==="http:"&&(Q.hostname==="localhost"||Q.hostname==="127.0.0.1"||Q.hostname.endsWith(".localhost"))},"must be an origin such as https://app.example.com"),W$=M.object({id:M.string().max(64),author:n0,body:N1(w0),createdAt:M.string().max(64)}),t0=M.object({id:M.string().max(64),anchor:N1(Y4),state:r0,comments:M.array(W$).min(1).max(J$),screenshot:M.boolean(),createdAt:M.string().max(64),updatedAt:M.string().max(64)}),X4=M.object({threads:M.array(t0)}),j7=M.object({origins:M.array(q$).min(1).max(Q$)}),V7=M.object({projectId:M.string().regex(W4),agentToken:M.string().min(32)}),K7=M.object({anchor:N1(Y4),body:N1(w0),send:M.boolean(),screenshot:N1(G4).optional()}),F7=M.object({body:N1(w0),send:M.boolean()}),N7=M.object({body:N1(w0),resolve:M.boolean()}),U7=M.object({screenshot:N1(G4)}),H4="ping";var Y$=/^[A-Za-z0-9_-]{43}$/;function B4($){return`${$.projectId}.${$.key}`}function e0($){let[Q,J,...q]=$.split(".");if(Q===void 0||J===void 0||q.length>0)return null;if(!W4.test(Q)||!Y$.test(J))return null;return{projectId:Q,key:J}}var z4=M.object({threads:M.array(t1)});function _4($){return typeof $==="object"&&$!==null&&!Array.isArray($)}function G$($){if(typeof $!=="string")return;let Q;try{Q=JSON.parse($)}catch{return}if(!_4(Q))return;if(Q.type==="agent-status"&&typeof Q.watching==="boolean")return{type:"agent-status",watching:Q.watching};if(Q.type==="reload"&&typeof Q.path==="string")return{type:"reload",path:Q.path};if(Q.type!=="threads")return;let J=z4.safeParse(Q);return J.success?{type:"threads",threads:J.data.threads}:void 0}class $2{daemonOrigin;project;offlineLabel="Daemon offline";socket=null;closed=!1;constructor($,Q){this.daemonOrigin=$;this.project=Q}connect($){let Q=`${this.daemonOrigin.replace(/^http/,"ws")}/ws/review/${encodeURIComponent(this.project)}`,J=new WebSocket(Q);this.socket=J,J.onopen=()=>{$.connected(!0),this.request("GET","/threads").then((q)=>{let W=z4.safeParse(q);if(W.success)$.threads(W.data.threads)})},J.onmessage=(q)=>{let W=G$(q.data);if(W?.type==="threads")$.threads(W.threads);if(W?.type==="agent-status")$.agentWatching(W.watching);if(W?.type==="reload")$.reload(W.path)},J.onclose=()=>{if($.connected(!1),!this.closed)setTimeout(()=>this.connect($),2000)}}close(){this.closed=!0,this.socket?.close()}createThread($,Q,J,q){return this.request("POST","/threads",{anchor:$,body:Q,send:J,...q===void 0?{}:{screenshot:q}})}comment($,Q,J){return this.request("POST",`/threads/${$}/comments`,{body:Q,send:J})}send($){return this.request("POST",`/threads/${$}/send`)}sendNotes(){return this.request("POST","/notes/send")}setResolved($,Q){return this.request("POST",`/threads/${$}/${Q?"resolve":"reopen"}`)}delete($){return this.request("DELETE",`/threads/${$}`)}async request($,Q,J){let q=await fetch(`${this.daemonOrigin}/api/review/${encodeURIComponent(this.project)}${Q}`,{method:$,...J===void 0?{}:{headers:{"Content-Type":"application/json"},body:JSON.stringify(J)}}),W=await q.json();if(!q.ok)throw Error(_4(W)&&typeof W.error==="string"?W.error:`Request failed (${q.status})`);return W}}function M4($,Q){return l0($,JSON.stringify(Q))}function D0($,Q){return l0($,Q)}async function j4($,Q,J){let q=JSON.parse(await c0($,Q.anchor)),W=await Promise.all(Q.comments.map(async(Y)=>({...Y,body:await c0($,Y.body)})));return t1.parse({id:Q.id,anchor:l1.parse(q),state:Q.state,comments:W,...J===void 0?{}:{screenshot:J},createdAt:Q.createdAt,updatedAt:Q.updatedAt})}var X$=30000,H$=M.discriminatedUnion("type",[M.object({type:M.literal("threads"),threads:M.array(t0)}),M.object({type:M.literal("agent-status"),watching:M.boolean()})]),B$=M.object({error:M.string()});class Q2{workerOrigin;projectId;key;offlineLabel="Offline";socket=null;keepalive=null;closed=!1;generation=0;constructor($,Q,J){this.workerOrigin=$;this.projectId=Q;this.key=J}connect($){let Q=new WebSocket(`${this.workerOrigin.replace(/^http/,"ws")}/review/${this.projectId}/ws`);this.socket=Q,Q.onopen=()=>{$.connected(!0),this.keepalive=setInterval(()=>Q.send(H4),X$),this.request("GET","/threads").then((J)=>this.publish(X4.parse(J).threads,$))},Q.onmessage=(J)=>{if(typeof J.data!=="string"||J.data==="pong")return;let q;try{q=JSON.parse(J.data)}catch{return}let W=H$.safeParse(q);if(!W.success)return;if(W.data.type==="threads")this.publish(W.data.threads,$);else $.agentWatching(W.data.watching)},Q.onclose=()=>{if(this.keepalive!==null)clearInterval(this.keepalive);if($.connected(!1),!this.closed)setTimeout(()=>this.connect($),2000)}}close(){this.closed=!0,this.socket?.close()}async createThread($,Q,J,q){return this.request("POST","/threads",{anchor:await M4(this.key,$),body:await D0(this.key,Q),send:J,...q===void 0?{}:{screenshot:await D0(this.key,q)}})}async comment($,Q,J){return this.request("POST",`/threads/${$}/comments`,{body:await D0(this.key,Q),send:J})}send($){return this.request("POST",`/threads/${$}/send`)}sendNotes(){return this.request("POST","/notes/send")}setResolved($,Q){return this.request("POST",`/threads/${$}/${Q?"resolve":"reopen"}`)}delete($){return this.request("DELETE",`/threads/${$}`)}publish($,Q){let J=++this.generation;Promise.allSettled($.map((q)=>j4(this.key,q))).then((q)=>{if(J!==this.generation)return;let W=[];for(let Y of q)if(Y.status==="fulfilled")W.push(Y.value);else console.warn("agent-canvas review: a thread did not open with this project key");Q.threads(W)})}async request($,Q,J){let q=await fetch(`${this.workerOrigin}/review/${this.projectId}${Q}`,{method:$,...J===void 0?{}:{headers:{"Content-Type":"application/json"},body:JSON.stringify(J)}}),W=await q.json();if(!q.ok){let Y=B$.safeParse(W);throw Error(Y.success?Y.data.error:`Request failed (${q.status})`)}return W}}var V4=`:host {
|
|
2
2
|
all: initial;
|
|
3
3
|
--bg: #ffffff;
|
|
4
4
|
--bg-muted: #f4f4f5;
|
|
@@ -387,5 +387,5 @@ textarea:focus {
|
|
|
387
387
|
.panel > .error {
|
|
388
388
|
padding: 0 12px 8px;
|
|
389
389
|
}
|
|
390
|
-
`;var
|
|
391
|
-
`).slice(1)){if(A$.test(J))continue;let Q=J.match(/\(?((?:https?|file):\/\/[^\s)]+):(\d+):(\d+)\)?\s*$/);if(Q?.[1]!==void 0&&Q[2]!==void 0&&Q[3]!==void 0)return{url:Q[1],line:Number(Q[2]),column:Number(Q[3])}}return}function t0($){let J=Object.keys($).find((q)=>q.startsWith("__reactFiber$"));if(J===void 0)return[];let Q=[],W=Reflect.get($,J);for(let q=0;m1(W)&&Q.length<V$&&q<60;q++,W=W.return){let Y=O0(W.type);if(Y===void 0||Q.length>0&&typeof W.type==="string")continue;let X=m1(W._debugStack)?W._debugStack.stack:void 0;if(typeof X!=="string")continue;let G=O8(X);if(G===void 0||U8.test(G.url))continue;let H=m1(W._debugOwner)?O0(W._debugOwner.type):void 0;Q.push({label:H===void 0?`<${Y}>`:`<${Y}> in ${H}`,...G})}return Q}function R8($){let J=m1($._debugStack)?$._debugStack.stack:void 0;if(typeof J!=="string")return!1;let Q=O8(J);return Q!==void 0&&U8.test(Q.url)}var b8=new Map;async function w$($){let Q=[...(await fetch($).then((Y)=>Y.text())).matchAll(/\/\/[#@] sourceMappingURL=(\S+)/g)].at(-1)?.[1];if(Q===void 0)return null;let W=new URL(Q,$).href,q=await fetch(W).then((Y)=>Y.json());if(!m1(q)||q.version!==3)return null;return new N8(JSON.stringify(q),b$(q,W,$))}function b$($,J,Q){if(!J.startsWith("data:"))return J;let W=$.file;return typeof W==="string"&&W.startsWith("/")?new URL(W,"file:///").href:Q}function U$($){let J=b8.get($);if(J===void 0)J=w$($).catch(()=>null),b8.set($,J);return J}function O$($,J){if(!URL.canParse($))return $;let Q=new URL($);if(Q.protocol==="file:")return decodeURIComponent(Q.pathname);if(Q.origin!==new URL(J).origin)return $;let W=decodeURIComponent(Q.pathname);return W.startsWith("/@fs/")?W.slice(4):W.slice(1)}async function R$($){let J=await U$($.url);if(J===null)return null;let Q=w8(J,{line:$.line,column:$.column-1});if(Q.source===null||Q.line===null)return null;let W=O$(Q.source,$.url);if(W.length>l0)return null;return{label:$.label,file:W,line:Q.line,column:Q.column+1}}async function e0($){let J=new Promise((W)=>setTimeout(()=>W(null),F$)),Q=await Promise.race([Promise.all($.map((W)=>R$(W).catch(()=>null))),J]);return Q===null?[]:Q.filter((W)=>W!==null)}var D$="rgba(0, 0, 0, 0)";function R0($,J){let[Q,W,q,Y]=["top","right","bottom","left"].map((X)=>$.getPropertyValue(`${J}-${X}`));if(Q===W&&W===q&&q===Y)return Q??"";if(Q===q&&W===Y)return`${Q} ${W}`;if(W===Y)return`${Q} ${W} ${q}`;return`${Q} ${W} ${q} ${Y}`}function D8($){let J=$.getPropertyValue("row-gap"),Q=$.getPropertyValue("column-gap");return J===Q?J:`${J} ${Q}`}function S8($){let J=$.getPropertyValue("display"),Q=J.endsWith("flex"),W=J.endsWith("grid"),Y=[["display",J,!0],["position",$.getPropertyValue("position"),$.getPropertyValue("position")!=="static"],["flex-direction",$.getPropertyValue("flex-direction"),Q],["flex-wrap",$.getPropertyValue("flex-wrap"),Q&&$.getPropertyValue("flex-wrap")!=="nowrap"],["grid-template-columns",$.getPropertyValue("grid-template-columns"),W],["align-items",$.getPropertyValue("align-items"),Q||W],["justify-content",$.getPropertyValue("justify-content"),Q||W],["gap",D8($),(Q||W)&&D8($)!=="normal"],["width",$.getPropertyValue("width"),!0],["height",$.getPropertyValue("height"),!0],["margin",R0($,"margin"),R0($,"margin")!=="0px"],["padding",R0($,"padding"),R0($,"padding")!=="0px"],["font-size",$.getPropertyValue("font-size"),!0],["line-height",$.getPropertyValue("line-height"),!0],["font-weight",$.getPropertyValue("font-weight"),!0],["color",$.getPropertyValue("color"),!0],["background-color",$.getPropertyValue("background-color"),$.getPropertyValue("background-color")!==D$]].filter(([,X,G])=>G&&X!=="").map(([X,G])=>`${X}: ${G}`).join("; ");return Y.length>F0?`${Y.slice(0,F0-1)}…`:Y}var S$=120,L8=40,L$=8;function l1($,J=S$){let Q=$.replace(/\s+/g," ").trim();return Q.length>J?`${Q.slice(0,J-1)}…`:Q}function E8($){let J=$.ownerDocument.createTreeWalker($,NodeFilter.SHOW_TEXT),Q=[];for(let W=J.nextNode();W!==null;W=J.nextNode())Q.push(W.textContent??"");return Q.join(" ")}var v$={button:"button",select:"combobox",textarea:"textbox",h1:"heading",h2:"heading",h3:"heading",h4:"heading",h5:"heading",h6:"heading",img:"img",nav:"navigation",main:"main",dialog:"dialog",table:"table",tr:"row",th:"columnheader",td:"cell",li:"listitem",ul:"list",ol:"list",form:"form"},E$={checkbox:"checkbox",radio:"radio",button:"button",submit:"button",range:"slider"};function J2($){let J=$.getAttribute("role");if(J!==null&&J!=="")return J.split(" ")[0];let Q=$.tagName.toLowerCase();if(Q==="a")return $.hasAttribute("href")?"link":void 0;if(Q==="input")return E$[$.getAttribute("type")??"text"]??"textbox";return v$[Q]}function k8($){let J=$.getAttribute("aria-label");if(J!==null&&J.trim()!=="")return l1(J);let Q=$.getAttribute("aria-labelledby");if(Q!==null){let X=Q.split(/\s+/).map((G)=>$.ownerDocument.getElementById(G)?.textContent??"").join(" ");if(X.trim()!=="")return l1(X)}if($.id!==""){let X=$.ownerDocument.querySelector(`label[for="${CSS.escape($.id)}"]`);if(X?.textContent!=null&&X.textContent.trim()!=="")return l1(X.textContent)}for(let X of["alt","title","placeholder"]){let G=$.getAttribute(X);if(G!==null&&G.trim()!=="")return l1(G)}let W=J2($),q=W==="button"||W==="link"||W==="heading"||W==="cell"||W==="columnheader"||W==="tab"||W==="menuitem"||W==="option",Y=E8($);if(q&&Y.trim()!=="")return l1(Y);return}function k$($){let J=[],Q=$;while(Q!==null&&Q.tagName.toLowerCase()!=="body"&&Q.tagName.toLowerCase()!=="html"){if(Q.id!==""&&Q.ownerDocument.querySelectorAll(`#${CSS.escape(Q.id)}`).length===1)return J.unshift(`#${CSS.escape(Q.id)}`),J.join(" > ");let W=Q.tagName.toLowerCase(),q=Q.parentElement,Y=q===null?[]:[...q.children].filter((X)=>X.tagName===Q?.tagName);J.unshift(Y.length>1?`${W}:nth-of-type(${Y.indexOf(Q)+1})`:W),Q=q}return J.unshift("body"),J.join(" > ")}function C8($){return typeof $==="object"&&$!==null}function $2($){if(typeof $==="function"){let J=Reflect.get($,"displayName");if(typeof J==="string"&&J!=="")return J;return $.name===""?void 0:$.name}if(C8($))return $2($.type)??$2($.render);return}function C$($){let J=Object.keys($).find((q)=>q.startsWith("__reactFiber$"));if(J===void 0)return[];let Q=[],W=Reflect.get($,J);while(C8(W)&&Q.length<40){let q=$2(W.type)?.replace(/(?<=[a-z])\d+$/,"");if(q!==void 0&&/^[A-Z]/.test(q)&&!q.endsWith("Provider")&&!R8(W)&&Q[0]!==q)Q.unshift(q);W=W.return}return Q.slice(-L$)}function P$($,J){let Q=J.toString().trim();if(Q==="")return;let W=$.ownerDocument.createRange();W.selectNodeContents($),W.setEnd(J.startContainer,J.startOffset);let q=$.ownerDocument.createRange();return q.selectNodeContents($),q.setStart(J.endContainer,J.endOffset),{exact:Q.slice(0,2000),before:W.toString().replace(/\s+/g," ").slice(-L8),after:q.toString().replace(/\s+/g," ").slice(0,L8)}}function P8($,J,Q){let W=J2($),q=k8($),Y=l1(E8($)),X=C$($),G=Q===void 0?void 0:P$($,Q),H=B8($),B=$.ownerDocument.defaultView,M=B===null?"":S8(B.getComputedStyle($));return{url:J,selector:k$($),...W===void 0?{}:{role:W},...q===void 0?{}:{name:q},...Y===""?{}:{text:Y},...X.length===0?{}:{components:X},...G===void 0?{}:{quote:G},...H===void 0?{}:{context:H},...B===null?{}:{browser:Y8(B)},...M===""?{}:{style:M},html:H8($)}}function v8($,J){if(J.role!==void 0&&J2($)!==J.role)return!1;if(J.name!==void 0&&k8($)!==J.name)return!1;return!0}function D0($,J){let Q=null;try{Q=$.querySelector(J.selector)}catch{Q=null}if(Q!==null&&v8(Q,J))return Q;if(J.role!==void 0&&J.name!==void 0){let W=[...$.body.querySelectorAll("*")].filter((q)=>v8(q,J));if(W.length===1)return W[0]??null}return Q}var f8={width:480,height:160};function f$($){let J=$;for(let Q=$.parentElement;Q!==null&&Q!==$.ownerDocument.body;Q=Q.parentElement){let W=J.getBoundingClientRect();if(W.width>=f8.width&&W.height>=f8.height)break;if(Q.getBoundingClientRect().height>900)break;J=Q}return J}function I$($,J){return new Promise((Q)=>{let W=setTimeout(Q,1000),q=(Y)=>{if(Y===0){clearTimeout(W),Q();return}$.requestVideoFrameCallback(()=>q(Y-1))};q(J)})}function T$($){let J=Math.max(0,$.left),Q=Math.max(0,$.top);return{left:J,top:Q,width:Math.min(innerWidth,$.right)-J,height:Math.min(innerHeight,$.bottom)-Q}}async function I8($,J){let Q=J.style.visibility;J.style.visibility="hidden",$.scrollIntoView({block:"nearest",inline:"nearest"});let W;try{W=await navigator.mediaDevices.getDisplayMedia({video:{displaySurface:"browser",width:{ideal:innerWidth*devicePixelRatio},height:{ideal:innerHeight*devicePixelRatio}},audio:!1,...{preferCurrentTab:!0,selfBrowserSurface:"include"}})}catch(q){throw J.style.visibility=Q,q}try{let[q]=W.getVideoTracks();if(q===void 0||q.getSettings().displaySurface!=="browser")throw Error("Share this tab to attach a screenshot");let Y=document.createElement("video");Y.muted=!0,Y.srcObject=W,await Y.play(),await I$(Y,2);let X=T$(f$($).getBoundingClientRect()),G=$.getBoundingClientRect(),H=Y.videoWidth/innerWidth,B=document.createElement("canvas");B.width=Math.round(X.width*H),B.height=Math.round(X.height*H);let M=B.getContext("2d");if(M===null)throw Error("Canvas is not available");return M.drawImage(Y,X.left*H,X.top*H,B.width,B.height,0,0,B.width,B.height),M.strokeStyle="#e11d48",M.lineWidth=3*H,M.strokeRect((G.left-X.left)*H,(G.top-X.top)*H,G.width*H,G.height*H),B.toDataURL("image/png")}finally{J.style.visibility=Q;for(let q of W.getTracks())q.stop()}}var g$=0;function w($,J,Q,W,q,Y){J||(J={});var X,G,H=J;if("ref"in H)for(G in H={},J)G=="ref"?X=J[G]:H[G]=J[G];var B={type:$,props:H,key:Q,ref:X,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--g$,__i:-1,__u:0,__source:q,__self:Y};if(typeof $=="function"&&(X=$.defaultProps))for(G in X)H[G]===void 0&&(H[G]=X[G]);return f.vnode&&f.vnode(B),B}var x$=U.object({anchor:A0,body:U.string(),screenshot:U.boolean()}),Q2="agent-canvas-review:draft";function T8($){try{if($===null)sessionStorage.removeItem(Q2);else sessionStorage.setItem(Q2,JSON.stringify($))}catch{}}function Z$(){try{let $=sessionStorage.getItem(Q2);if($===null)return null;let J=x$.safeParse(JSON.parse($));return J.success?J.data:null}catch{return null}}var h$={open:"Note",queued:"Sent to Claude",working:"Claude is on it",resolved:"Resolved"},g8='a, button, input, select, textarea, label, summary, [role="button"], [role="link"], [role="tab"], [role="menuitem"], [contenteditable]',x8="agent-canvas-review-picking",W2="agent-canvas-review:reveal";function y$($,J){let Q=new URL($);if(Q.origin===location.origin&&Q.pathname===location.pathname&&Q.search===location.search){location.hash=Q.hash;return}try{sessionStorage.setItem(W2,J)}catch{}location.href=$}function m$(){try{let $=sessionStorage.getItem(W2);return sessionStorage.removeItem(W2),$}catch{return null}}function l$($){if(!$.endsWith(".html"))return!0;let J=decodeURI(location.pathname);return $==="/index.html"||J===$||J.endsWith("/")&&`${J}index.html`===$}function $0($){let J=$.getBoundingClientRect();return{top:J.top,left:J.left,width:J.width,height:J.height}}function J0($){let J=new URL($);return`${J.origin}${J.pathname}${J.search}${J.hash.split("?")[0]??""}`}function Z8($){if($.quote!==void 0)return`“${$.quote.exact}”`;if($.role!==void 0&&$.name!==void 0)return`${$.role} “${$.name}”`;if($.text!==void 0)return $.text;return $.selector}function c$(){let[$,J]=x(0);return Y1(()=>{let Q=0,W=()=>{cancelAnimationFrame(Q),Q=requestAnimationFrame(()=>J((Y)=>Y+1))};window.addEventListener("scroll",W,!0),window.addEventListener("resize",W);let q=setInterval(W,1000);return()=>{cancelAnimationFrame(Q),window.removeEventListener("scroll",W,!0),window.removeEventListener("resize",W),clearInterval(q)}},[]),$}function u$(){let[$,J]=x(location.href);return Y1(()=>{let Q=()=>J(location.href);window.addEventListener("hashchange",Q),window.addEventListener("popstate",Q);let W=setInterval(Q,400);return()=>{window.removeEventListener("hashchange",Q),window.removeEventListener("popstate",Q),clearInterval(W)}},[]),$}function p$($,J,Q,W,q){Y1(()=>{if(!J)return;document.documentElement.classList.add(x8);let Y=(N)=>N.composedPath().includes($),X=(N)=>N.target instanceof Element?N.target.closest(g8)??N.target:null,G=(N)=>{if(!Y(N))Q(X(N))},H=(N)=>{if(Y(N))return;if(X(N)?.closest(g8))N.preventDefault(),N.stopPropagation()},B=(N)=>{if(Y(N))return;N.preventDefault(),N.stopPropagation();let z=window.getSelection(),V=z!==null&&z.rangeCount>0&&!z.isCollapsed?z.getRangeAt(0):void 0;if(V!==void 0){let I=V.commonAncestorContainer,F=I instanceof Element?I:I.parentElement;if(F!==null)return W(F,V)}let k=X(N);if(k!==null)W(k)},M=(N)=>{if(N.key==="Escape")q()};return document.addEventListener("mousemove",G,!0),document.addEventListener("pointerdown",H,!0),document.addEventListener("mousedown",H,!0),document.addEventListener("click",B,!0),document.addEventListener("keydown",M,!0),()=>{document.documentElement.classList.remove(x8),document.removeEventListener("mousemove",G,!0),document.removeEventListener("pointerdown",H,!0),document.removeEventListener("mousedown",H,!0),document.removeEventListener("click",B,!0),document.removeEventListener("keydown",M,!0)}},[$,J,Q,W,q])}function d$($){let W=Math.min(Math.max(8,$.left),window.innerWidth-320-8),q=$.top+$.height+8;return{top:q+190<window.innerHeight?q:Math.max(8,$.top-190-8),left:W}}function i$($){let[J,Q]=x($.draft.body),[W,q]=x($.draft.screenshot),{onChange:Y}=$;Y1(()=>Y(J,W),[Y,J,W]);let[X,G]=x(!1),[H,B]=x(null),M=Q8(null);Y1(()=>M.current?.focus(),[]);let N=async(z)=>{if(J.trim()==="")return;G(!0),B(null);try{await $.onSubmit(J,z,W)}catch(V){B(V instanceof Error?V.message:String(V)),G(!1)}};return w("div",{class:"popover",style:d$($.draft.box),children:[w("div",{class:"target",title:$.draft.anchor.selector,children:Z8($.draft.anchor)},void 0,!1,void 0,this),$.draft.anchor.components!==void 0&&w("div",{class:"target",children:$.draft.anchor.components.slice(-3).join(" › ")},void 0,!1,void 0,this),w("textarea",{ref:M,value:J,placeholder:"What should change here?",onInput:(z)=>Q(z.currentTarget.value),onKeyDown:(z)=>{if(z.key==="Escape")$.onCancel();if(z.key==="Enter"&&(z.metaKey||z.ctrlKey))N(!0)}},void 0,!1,void 0,this),w("label",{class:"option",children:[w("input",{type:"checkbox",checked:W,onChange:(z)=>q(z.currentTarget.checked)},void 0,!1,void 0,this),"Attach a screenshot"]},void 0,!0,void 0,this),$.reloadPending&&w("div",{class:"reload-pending",children:[w("span",{children:"The application changed. It reloads once you save or cancel this comment."},void 0,!1,void 0,this),w("button",{type:"button",class:"ghost",onClick:()=>location.reload(),children:"Reload now"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),H!==null&&w("div",{class:"error",children:H},void 0,!1,void 0,this),w("div",{class:"actions",children:[w("button",{type:"button",class:"ghost",onClick:$.onCancel,children:"Cancel"},void 0,!1,void 0,this),w("button",{type:"button",disabled:X||J.trim()==="",onClick:()=>void N(!1),children:"Save note"},void 0,!1,void 0,this),w("button",{type:"button",class:"primary",disabled:X||J.trim()==="",onClick:()=>void N(!0),children:"Send to Claude"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),w("div",{class:"hint",children:"Ctrl+Enter sends to Claude · Esc cancels"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function o$($){let{thread:J,client:Q}=$,[W,q]=x(null),[Y,X]=x(null),G=(B)=>{X(null),B().catch((M)=>X(M instanceof Error?M.message:String(M)))},H=(B)=>{if(W===null||W.trim()==="")return;G(()=>Q.comment(J.id,W,B).then(()=>q(null)))};return w("div",{class:`thread${$.number===null?"":" current"}${J.state==="resolved"?" resolved":""}`,children:[w("div",{class:"thread-head",children:[w("button",{type:"button",class:"ghost",title:"Show in page","aria-label":"Show in page",onClick:$.onReveal,children:$.number===null?"↗":`#${$.number}`},void 0,!1,void 0,this),w("span",{class:"target",title:J.anchor.url,children:Z8(J.anchor)},void 0,!1,void 0,this),w("span",{class:`badge ${J.state}`,children:h$[J.state]},void 0,!1,void 0,this)]},void 0,!0,void 0,this),J.comments.map((B)=>w("div",{class:`comment ${B.author}`,children:[w("span",{class:"author",children:B.author==="user"?"You":"Claude"},void 0,!1,void 0,this),w("span",{class:"body",children:B.body},void 0,!1,void 0,this)]},B.id,!0,void 0,this)),W!==null&&w("textarea",{value:W,placeholder:"Reply…",onInput:(B)=>q(B.currentTarget.value),onKeyDown:(B)=>{if(B.key==="Enter"&&(B.metaKey||B.ctrlKey))H(!0)}},void 0,!1,void 0,this),Y!==null&&w("div",{class:"error",children:Y},void 0,!1,void 0,this),w("div",{class:"actions",children:W===null?w(J1,{children:[w("button",{type:"button",class:"ghost",onClick:()=>G(()=>Q.delete(J.id)),children:"Delete"},void 0,!1,void 0,this),J.state==="resolved"?w("button",{type:"button",onClick:()=>G(()=>Q.setResolved(J.id,!1)),children:"Reopen"},void 0,!1,void 0,this):w("button",{type:"button",onClick:()=>G(()=>Q.setResolved(J.id,!0)),children:"Resolve"},void 0,!1,void 0,this),w("button",{type:"button",onClick:()=>q(""),children:"Reply"},void 0,!1,void 0,this),J.state==="open"&&w("button",{type:"button",class:"primary",onClick:()=>G(()=>Q.send(J.id)),children:"Send to Claude"},void 0,!1,void 0,this)]},void 0,!0,void 0,this):w(J1,{children:[w("button",{type:"button",class:"ghost",onClick:()=>q(null),children:"Cancel"},void 0,!1,void 0,this),w("button",{type:"button",disabled:W.trim()==="",onClick:()=>H(!1),children:"Reply"},void 0,!1,void 0,this),w("button",{type:"button",class:"primary",disabled:W.trim()==="",onClick:()=>H(!0),children:"Reply & send"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function h8($){let{client:J,host:Q}=$,[W,q]=x([]),[Y,X]=x(!1),[G,H]=x(!1),[B,M]=x(!1),[N,z]=x(null),[V,k]=x(null),[I,F]=x(Z$),[O,A]=x(!1),[P,T]=x(!1),[C,y]=x(!1),[c,u]=x(!1),[o,i]=x(null),[$1,q2]=x(m$),[Y2,X2]=x(null),l8=u$(),c8=c$();Y1(()=>{return J.connect({threads:q,agentWatching:X,connected:H,reload:(S)=>{if(l$(S))A(!0)}}),()=>J.close()},[J]);let G2=t1(()=>{M(!1),z(null)},[]),u8=t1((S,p)=>{M(!1),z(null),window.getSelection()?.removeAllRanges(),F(null);let r=P8(S,location.href,p);k({anchor:r,box:$0(S),element:S,sources:e0(t0(S)),body:"",screenshot:!1})},[]),S0=t1(()=>{k(null),T8(null)},[]),L0=V?.anchor,p8=t1((S,p)=>{if(L0!==void 0)T8({anchor:L0,body:S,screenshot:p})},[L0]);p$(Q,B,z,u8,G2);let d8=()=>{T(!1),S0(),M(!0)},N1=J0(l8),v0=w0(()=>W.filter((S)=>J0(S.anchor.url)===N1&&(!c||S.state!=="resolved")),[W,N1,c]),H2=C?W.filter((S)=>!c||S.state!=="resolved"):v0,B2=new Map(v0.map((S,p)=>[S.id,p+1])),z2=W.filter((S)=>S.state!=="resolved").length,E0=W.filter(c2).length,i8=()=>{i(null),J.sendNotes().catch((S)=>i(S instanceof Error?S.message:String(S)))};Y1(()=>{if($1===null)return;let S=W.find((r)=>r.id===$1);if(S===void 0||J0(S.anchor.url)!==N1)return;let p=D0(document,S.anchor);if(p===null)return;p.scrollIntoView({block:"center",behavior:"smooth"}),q2(null),setTimeout(()=>X2($0(p)),350),setTimeout(()=>X2(null),1600)},[$1,W,N1]),Y1(()=>{if(O&&V===null)location.reload()},[O,V]),Y1(()=>{if(I===null||V!==null||J0(I.anchor.url)!==N1)return;let S=D0(document,I.anchor);if(S===null)return;F(null),k({...I,box:$0(S),element:S,sources:e0(t0(S))})},[I,V,N1,c8]);let o8=(S)=>{if(q2(S.id),J0(S.anchor.url)!==N1)y$(S.anchor.url,S.id)},_2=!G?"Daemon offline":Y?"Claude is listening":"Claude is not listening",M2=N===null?null:$0(N);return w(J1,{children:[M2!==null&&w("div",{class:"highlight",style:M2},void 0,!1,void 0,this),Y2!==null&&w("div",{class:"highlight flash",style:Y2},void 0,!1,void 0,this),v0.map((S)=>{let p=D0(document,S.anchor);if(p===null)return null;let r=$0(p);if(r.width===0&&r.height===0)return null;return w("button",{type:"button",class:`pin ${S.state}`,style:{top:Math.max(0,r.top-11),left:Math.max(0,r.left+r.width-11)},title:S.comments[0]?.body,onClick:()=>T(!0),children:B2.get(S.id)},S.id,!1,void 0,this)}),V!==null&&w(i$,{draft:V,reloadPending:O,onChange:p8,onCancel:S0,onSubmit:async(S,p,r)=>{let r8=r?await I8(V.element,Q):void 0,j2=await V.sources;await J.createThread(j2.length===0?V.anchor:{...V.anchor,sources:j2},S,p,r8),S0()}},void 0,!1,void 0,this),P&&w("aside",{class:"panel",children:[w("header",{children:[w("h2",{children:"Review"},void 0,!1,void 0,this),w("button",{type:"button",class:"ghost",onClick:()=>T(!1),children:"Close"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),w("div",{class:"tabs",children:[w("button",{type:"button",class:C?"":"active",onClick:()=>y(!1),children:"This page"},void 0,!1,void 0,this),w("button",{type:"button",class:C?"active":"",onClick:()=>y(!0),children:"All pages"},void 0,!1,void 0,this),w("button",{type:"button",class:c?"active":"",onClick:()=>u(!c),children:"Hide resolved"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),E0>0&&w("div",{class:"send-notes",children:w("button",{type:"button",class:"primary",onClick:i8,children:["Send ",E0===1?"1 note":`${E0} notes`," to Claude"]},void 0,!0,void 0,this)},void 0,!1,void 0,this),o!==null&&w("div",{class:"error",children:o},void 0,!1,void 0,this),w("div",{class:"threads",children:[H2.length===0&&w("div",{class:"empty",children:"No comments yet. Click “Comment”, then an element or a text selection."},void 0,!1,void 0,this),H2.map((S)=>w(o$,{thread:S,number:B2.get(S.id)??null,client:J,onReveal:()=>o8(S)},S.id,!1,void 0,this))]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),w("div",{class:`toolbar${P?" beside-panel":""}`,children:[w("span",{class:"presence",title:_2,children:[w("span",{class:`dot ${!G?"off-line":Y?"on":""}`},void 0,!1,void 0,this),_2]},void 0,!0,void 0,this),w("button",{type:"button",class:B?"active":"",onClick:()=>B?G2():d8(),children:B?"Pick an element…":"Comment"},void 0,!1,void 0,this),w("button",{type:"button",class:P?"active":"",onClick:()=>T(!P),children:["Threads",z2>0?` (${z2})`:""]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}var y8="agent-canvas-review";function r$($){let J=$.dataset.project??"";if(!m0.test(J)){console.error(`agent-canvas review: data-project must match ${m0}, got "${J}"`);return}if(document.querySelector(y8)!==null)return;let Q=document.createElement("style");Q.textContent="html.agent-canvas-review-picking, html.agent-canvas-review-picking * { cursor: crosshair !important; }",document.head.append(Q);let W=document.createElement(y8);document.documentElement.append(W);let q=W.attachShadow({mode:"open"}),Y=document.createElement("style");Y.textContent=i2,q.append(Y),k2(w(h8,{client:new p0(new URL($.src).origin,J),host:W},void 0,!1,void 0,this),q)}var m8=document.currentScript;if(m8 instanceof HTMLScriptElement)r$(m8);else console.error("agent-canvas review: load review.js with a classic <script> tag");})();
|
|
390
|
+
`;var e1,Z,J2,K4,$0=0,b4=[],y=f,F4=y.__b,N4=y.__r,U4=y.diffed,A4=y.__c,w4=y.unmount,D4=y.__;function W2($,Q){y.__h&&y.__h(Z,$,$0||Q),$0=0;var J=Z.__H||(Z.__H={__:[],__h:[]});return $>=J.__.length&&J.__.push({}),J.__[$]}function x($){return $0=1,_$(S4,$)}function _$($,Q,J){var q=W2(e1++,2);if(q.t=$,!q.__c&&(q.__=[J?J(Q):S4(void 0,Q),function(X){var H=q.__N?q.__N[0]:q.__[0],B=q.t(H,X);H!==B&&(q.__N=[B,q.__[1]],q.__c.setState({}))}],q.__c=Z,!Z.__f)){var W=function(X,H,B){if(!q.__c.__H)return!0;var j=!1,A=q.__c.props!==X;if(q.__c.__H.__.some(function(F){if(F.__N){j=!0;var k=F.__[0];F.__=F.__N,F.__N=void 0,k!==F.__[0]&&(A=!0)}}),Y){var z=Y.call(this,X,H,B);return j?z||A:z}return!j||A};Z.__f=!0;var{shouldComponentUpdate:Y,componentWillUpdate:G}=Z;Z.componentWillUpdate=function(X,H,B){if(this.__e){var j=Y;Y=void 0,W(X,H,B),Y=j}G&&G.call(this,X,H,B)},Z.shouldComponentUpdate=W}return q.__N||q.__}function Y1($,Q){var J=W2(e1++,3);!y.__s&&L4(J.__H,Q)&&(J.__=$,J.u=Q,Z.__H.__h.push(J))}function R4($){return $0=5,b0(function(){return{current:$}},[])}function b0($,Q){var J=W2(e1++,7);return L4(J.__H,Q)&&(J.__=$(),J.__H=Q,J.__h=$),J.__}function Q0($,Q){return $0=8,b0(function(){return $},Q)}function M$(){for(var $;$=b4.shift();){var Q=$.__H;if($.__P&&Q)try{Q.__h.some(O0),Q.__h.some(q2),Q.__h=[]}catch(J){Q.__h=[],y.__e(J,$.__v)}}}y.__b=function($){Z=null,F4&&F4($)},y.__=function($,Q){$&&Q.__k&&Q.__k.__m&&($.__m=Q.__k.__m),D4&&D4($,Q)},y.__r=function($){N4&&N4($),e1=0;var Q=(Z=$.__c).__H;Q&&(J2===Z?(Q.__h=[],Z.__h=[],Q.__.some(function(J){J.__N&&(J.__=J.__N),J.u=J.__N=void 0})):(Q.__h.some(O0),Q.__h.some(q2),Q.__h=[],e1=0)),J2=Z},y.diffed=function($){U4&&U4($);var Q=$.__c;Q&&Q.__H&&(Q.__H.__h.length&&(b4.push(Q)!==1&&K4===y.requestAnimationFrame||((K4=y.requestAnimationFrame)||j$)(M$)),Q.__H.__.some(function(J){J.u&&(J.__H=J.u,J.u=void 0)})),J2=Z=null},y.__c=function($,Q){Q.some(function(J){try{J.__h.some(O0),J.__h=J.__h.filter(function(q){return!q.__||q2(q)})}catch(q){Q.some(function(W){W.__h&&(W.__h=[])}),Q=[],y.__e(q,J.__v)}}),A4&&A4($,Q)},y.unmount=function($){w4&&w4($);var Q,J=$.__c;J&&J.__H&&(J.__H.__.some(function(q){try{O0(q)}catch(W){Q=W}}),J.__H=void 0,Q&&y.__e(Q,J.__v))};var O4=typeof requestAnimationFrame=="function";function j$($){var Q,J=function(){clearTimeout(q),O4&&cancelAnimationFrame(Q),setTimeout($)},q=setTimeout(J,35);O4&&(Q=requestAnimationFrame(J))}function O0($){var Q=Z,J=$.__c;typeof J=="function"&&($.__c=void 0,J()),Z=Q}function q2($){var Q=Z;$.__c=$.__(),Z=Q}function L4($,Q){return!$||$.length!==Q.length||Q.some(function(J,q){return J!==$[q]})}function S4($,Q){return typeof Q=="function"?Q($):Q}function v4($){return $.state==="open"&&$.comments.at(-1)?.author==="user"}var V$=[["Edge",/\bEdg(?:e|A|iOS)?\/(\d+)/],["Opera",/\bOPR\/(\d+)/],["Firefox",/\b(?:Firefox|FxiOS)\/(\d+)/],["Chrome",/\b(?:Chrome|CriOS)\/(\d+)/],["Safari",/\bVersion\/(\d+)[^ ]* (?:Mobile\/\S+ )?Safari\//]],K$=[["Android",/\bAndroid\b/],["iOS",/\b(?:iPhone|iPad|iPod)\b/],["Windows",/\bWindows\b/],["macOS",/\bMac OS X\b/],["Linux",/\bLinux\b/]];function F$($){let Q;for(let[W,Y]of V$){let G=Y.exec($)?.[1];if(G!==void 0){Q=`${W} ${G}`;break}}let J=K$.find(([,W])=>W.test($))?.[0],q=[Q,J].filter((W)=>W!==void 0);return q.length===0?$.slice(0,100):q.join(" · ")}function E4($){return{name:F$($.navigator.userAgent),viewport:{width:$.innerWidth,height:$.innerHeight,scale:$.devicePixelRatio},colorScheme:$.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}}var Y2=8,k4=80,N$=new Set(["SCRIPT","STYLE","NOSCRIPT","TEMPLATE"]);function P4($,Q){if($.tagName.toLowerCase()==="svg"){$.replaceChildren();return}let J=0;for(let q of[...$.childNodes]){if(q.nodeType===Node.TEXT_NODE){let W=q.textContent??"";if(W.trim()==="")q.remove();else if(W.length>k4)q.textContent=`${W.slice(0,k4)}…`;continue}if(!(q instanceof Element)||N$.has(q.tagName)){q.remove();continue}if(J++,Q===0||J>Y2)q.remove();else P4(q,Q-1)}if(Q===0&&J>0)$.append($.ownerDocument.createComment(` ${J} child elements cut `));else if(J>Y2)$.append($.ownerDocument.createComment(` ${J-Y2} more `))}function C4($){for(let J=5;J>=0;J--){let q=$.cloneNode(!0);if(!(q instanceof Element))return"";P4(q,J);let W=q.outerHTML;if(W.length<=U0)return W}let Q=$.cloneNode(!1);return Q instanceof Element?Q.outerHTML.slice(0,U0):""}function U$($){let Q=$.getAttribute("aria-label");if(Q!==null&&Q.trim()!=="")return Q.trim();let J=$.getAttribute("aria-labelledby"),Y=((J===null?null:$.ownerDocument.getElementById(J.split(/\s+/)[0]??""))??$.querySelector('h1, h2, h3, h4, legend, [role="heading"]'))?.textContent?.replace(/\s+/g," ").trim();return Y===void 0||Y===""?void 0:Y.slice(0,80)}var A$=[{selector:'dialog, [role="dialog"], [role="alertdialog"], [aria-modal="true"]',kind:"Dialog"},{selector:'section, article, fieldset, form, [role="region"], [role="tabpanel"]',kind:"Section"}];function f4($){let Q=[],J=$.ownerDocument.querySelector("h1")?.textContent?.replace(/\s+/g," ").trim();if(J!==void 0&&J!=="")Q.push(`Page "${J.slice(0,80)}"`);for(let q of A$){let W=$.closest(q.selector),Y=W===null?void 0:U$(W);if(Y!==void 0&&!Q.includes(`Page "${Y}"`))Q.push(`${q.kind} "${Y}"`)}return Q.length===0?void 0:Q.join(" › ")}var w$=44;var I4="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",D$=new Uint8Array(64),g4=new Uint8Array(128);for(let $=0;$<I4.length;$++){let Q=I4.charCodeAt($);D$[$]=Q,g4[Q]=$}function J0($,Q){let J=0,q=0,W=0;do{let G=$.next();W=g4[G],J|=(W&31)<<q,q+=5}while(W&32);let Y=J&1;if(J>>>=1,Y)J=-2147483648|-J;return Q+J}function T4($,Q){if($.pos>=Q)return!1;return $.peek()!==w$}var O$=class{constructor($){this.pos=0,this.buffer=$}next(){return this.buffer.charCodeAt(this.pos++)}peek(){return this.buffer.charCodeAt(this.pos)}indexOf($){let{buffer:Q,pos:J}=this,q=Q.indexOf($,J);return q===-1?Q.length:q}};function x4($){let{length:Q}=$,J=new O$($),q=[],W=0,Y=0,G=0,X=0,H=0;do{let B=J.indexOf(";"),j=[],A=!0,z=0;W=0;while(J.pos<B){let F;if(W=J0(J,W),W<z)A=!1;if(z=W,T4(J,B))if(Y=J0(J,Y),G=J0(J,G),X=J0(J,X),T4(J,B))H=J0(J,H),F=[W,Y,G,X,H];else F=[W,Y,G,X];else F=[W];j.push(F),J.pos++}if(!A)b$(j);q.push(j),J.pos=B+1}while(J.pos<=Q);return q}function b$($){$.sort(R$)}function R$($,Q){return $[0]-Q[0]}var m4=L8(Z4(),1);function L$($){if(!$)return"";let Q=$.lastIndexOf("/");return $.slice(0,Q+1)}function S$($,Q){let J=L$($),q=Q?Q+"/":"";return(W)=>m4.default(q+(W||""),J)}var U1=0,v$=1,E$=2,k$=3,P$=4;function C$($,Q){let J=y4($,0);if(J===$.length)return $;if(!Q)$=$.slice();for(let q=J;q<$.length;q=y4($,q+1))$[q]=I$($[q],Q);return $}function y4($,Q){for(let J=Q;J<$.length;J++)if(!f$($[J]))return J;return $.length}function f$($){for(let Q=1;Q<$.length;Q++)if($[Q][U1]<$[Q-1][U1])return!1;return!0}function I$($,Q){if(!Q)$=$.slice();return $.sort(T$)}function T$($,Q){return $[U1]-Q[U1]}var L0=!1;function g$($,Q,J,q){while(J<=q){let W=J+(q-J>>1),Y=$[W][U1]-Q;if(Y===0)return L0=!0,W;if(Y<0)J=W+1;else q=W-1}return L0=!1,J-1}function x$($,Q,J){for(let q=J+1;q<$.length;J=q++)if($[q][U1]!==Q)break;return J}function Z$($,Q,J){for(let q=J-1;q>=0;J=q--)if($[q][U1]!==Q)break;return J}function y$(){return{lastKey:-1,lastNeedle:-1,lastIndex:-1}}function h$($,Q,J,q){let{lastKey:W,lastNeedle:Y,lastIndex:G}=J,X=0,H=$.length-1;if(q===W){if(Q===Y)return L0=G!==-1&&$[G][U1]===Q,G;if(Q>=Y)X=G===-1?0:G;else H=G}return J.lastKey=q,J.lastNeedle=Q,J.lastIndex=g$($,Q,X,H)}function m$($){return typeof $==="string"?JSON.parse($):$}var l$="`line` must be greater than 0 (lines start at line 1)",c$="`column` must be greater than or equal to 0 (columns start at column 0)",h4=-1,u$=1,l4=class{constructor($,Q){let J=typeof $==="string";if(!J&&$._decodedMemo)return $;let q=m$($),{version:W,file:Y,names:G,sourceRoot:X,sources:H,sourcesContent:B}=q;this.version=W,this.file=Y,this.names=G||[],this.sourceRoot=X,this.sources=H,this.sourcesContent=B,this.ignoreList=q.ignoreList||q.x_google_ignoreList||void 0;let j=S$(Q,X);this.resolvedSources=H.map(j);let{mappings:A}=q;if(typeof A==="string")this._encoded=A,this._decoded=void 0;else if(Array.isArray(A))this._encoded=void 0,this._decoded=C$(A,J);else if(q.sections)throw Error("TraceMap passed sectioned source map, please use FlattenMap export instead");else throw Error(`invalid source map: ${JSON.stringify(q)}`);this._decodedMemo=y$(),this._bySources=void 0,this._bySourceMemos=void 0}};function H2($){return $}function p$($){var Q;return(Q=H2($))._decoded||(Q._decoded=x4(H2($)._encoded))}function c4($,Q){let{line:J,column:q,bias:W}=Q;if(J--,J<0)throw Error(l$);if(q<0)throw Error(c$);let Y=p$($);if(J>=Y.length)return R0(null,null,null,null);let G=Y[J],X=d$(G,H2($)._decodedMemo,J,q,W||u$);if(X===-1)return R0(null,null,null,null);let H=G[X];if(H.length===1)return R0(null,null,null,null);let{names:B,resolvedSources:j}=$;return R0(j[H[v$]],H[E$]+1,H[k$],H.length===5?B[H[P$]]:null)}function R0($,Q,J,q){return{source:$,line:Q,column:J,name:q}}function d$($,Q,J,q,W){let Y=h$($,q,Q,J);if(L0)Y=(W===h4?x$:Z$)($,q,Y);else if(W===h4)Y++;if(Y===-1||Y===$.length)return-1;return Y}var i$=6,o$=3000,n$=/\bat (?:[\w$]+\.)*(?:jsxDEV|jsxs?|createElement|react_stack_bottom_frame)\b|\/node_modules\/(?:\.vite\/deps\/)?react(?:-dom)?[/_]/;function c1($){return typeof $==="object"&&$!==null}var r$=/^_c\d*$/;function S0($){if(typeof $==="string")return $;if(typeof $==="function")return $.name===""||r$.test($.name)?void 0:$.name.replace(/(?<=[a-z])\d+$/,"");if(c1($))return S0($.type)??S0($.render);return}var p4=/\/node_modules\//;function d4($){for(let Q of $.split(`
|
|
391
|
+
`).slice(1)){if(n$.test(Q))continue;let J=Q.match(/\(?((?:https?|file):\/\/[^\s)]+):(\d+):(\d+)\)?\s*$/);if(J?.[1]!==void 0&&J[2]!==void 0&&J[3]!==void 0)return{url:J[1],line:Number(J[2]),column:Number(J[3])}}return}function B2($){let Q=Object.keys($).find((W)=>W.startsWith("__reactFiber$"));if(Q===void 0)return[];let J=[],q=Reflect.get($,Q);for(let W=0;c1(q)&&J.length<i$&&W<60;W++,q=q.return){let Y=S0(q.type);if(Y===void 0||J.length>0&&typeof q.type==="string")continue;let G=c1(q._debugStack)?q._debugStack.stack:void 0;if(typeof G!=="string")continue;let X=d4(G);if(X===void 0||p4.test(X.url))continue;let H=c1(q._debugOwner)?S0(q._debugOwner.type):void 0;J.push({label:H===void 0?`<${Y}>`:`<${Y}> in ${H}`,...X})}return J}function i4($){let Q=c1($._debugStack)?$._debugStack.stack:void 0;if(typeof Q!=="string")return!1;let J=d4(Q);return J!==void 0&&p4.test(J.url)}var u4=new Map;async function a$($){let J=[...(await fetch($).then((Y)=>Y.text())).matchAll(/\/\/[#@] sourceMappingURL=(\S+)/g)].at(-1)?.[1];if(J===void 0)return null;let q=new URL(J,$).href,W=await fetch(q).then((Y)=>Y.json());if(!c1(W)||W.version!==3)return null;return new l4(JSON.stringify(W),s$(W,q,$))}function s$($,Q,J){if(!Q.startsWith("data:"))return Q;let q=$.file;return typeof q==="string"&&q.startsWith("/")?new URL(q,"file:///").href:J}function t$($){let Q=u4.get($);if(Q===void 0)Q=a$($).catch(()=>null),u4.set($,Q);return Q}function e$($,Q){if(!URL.canParse($))return $;let J=new URL($);if(J.protocol==="file:")return decodeURIComponent(J.pathname);if(J.origin!==new URL(Q).origin)return $;let q=decodeURIComponent(J.pathname);return q.startsWith("/@fs/")?q.slice(4):q.slice(1)}async function $3($){let Q=await t$($.url);if(Q===null)return null;let J=c4(Q,{line:$.line,column:$.column-1});if(J.source===null||J.line===null)return null;let q=e$(J.source,$.url);if(q.length>o0)return null;return{label:$.label,file:q,line:J.line,column:J.column+1}}async function z2($){let Q=new Promise((q)=>setTimeout(()=>q(null),o$)),J=await Promise.race([Promise.all($.map((q)=>$3(q).catch(()=>null))),Q]);return J===null?[]:J.filter((q)=>q!==null)}var Q3="rgba(0, 0, 0, 0)";function v0($,Q){let[J,q,W,Y]=["top","right","bottom","left"].map((G)=>$.getPropertyValue(`${Q}-${G}`));if(J===q&&q===W&&W===Y)return J??"";if(J===W&&q===Y)return`${J} ${q}`;if(q===Y)return`${J} ${q} ${W}`;return`${J} ${q} ${W} ${Y}`}function o4($){let Q=$.getPropertyValue("row-gap"),J=$.getPropertyValue("column-gap");return Q===J?Q:`${Q} ${J}`}function n4($){let Q=$.getPropertyValue("display"),J=Q.endsWith("flex"),q=Q.endsWith("grid"),Y=[["display",Q,!0],["position",$.getPropertyValue("position"),$.getPropertyValue("position")!=="static"],["flex-direction",$.getPropertyValue("flex-direction"),J],["flex-wrap",$.getPropertyValue("flex-wrap"),J&&$.getPropertyValue("flex-wrap")!=="nowrap"],["grid-template-columns",$.getPropertyValue("grid-template-columns"),q],["align-items",$.getPropertyValue("align-items"),J||q],["justify-content",$.getPropertyValue("justify-content"),J||q],["gap",o4($),(J||q)&&o4($)!=="normal"],["width",$.getPropertyValue("width"),!0],["height",$.getPropertyValue("height"),!0],["margin",v0($,"margin"),v0($,"margin")!=="0px"],["padding",v0($,"padding"),v0($,"padding")!=="0px"],["font-size",$.getPropertyValue("font-size"),!0],["line-height",$.getPropertyValue("line-height"),!0],["font-weight",$.getPropertyValue("font-weight"),!0],["color",$.getPropertyValue("color"),!0],["background-color",$.getPropertyValue("background-color"),$.getPropertyValue("background-color")!==Q3]].filter(([,G,X])=>X&&G!=="").map(([G,X])=>`${G}: ${X}`).join("; ");return Y.length>A0?`${Y.slice(0,A0-1)}…`:Y}var J3=120,r4=40,q3=8;function u1($,Q=J3){let J=$.replace(/\s+/g," ").trim();return J.length>Q?`${J.slice(0,Q-1)}…`:J}function s4($){let Q=$.ownerDocument.createTreeWalker($,NodeFilter.SHOW_TEXT),J=[];for(let q=Q.nextNode();q!==null;q=Q.nextNode())J.push(q.textContent??"");return J.join(" ")}var W3={button:"button",select:"combobox",textarea:"textbox",h1:"heading",h2:"heading",h3:"heading",h4:"heading",h5:"heading",h6:"heading",img:"img",nav:"navigation",main:"main",dialog:"dialog",table:"table",tr:"row",th:"columnheader",td:"cell",li:"listitem",ul:"list",ol:"list",form:"form"},Y3={checkbox:"checkbox",radio:"radio",button:"button",submit:"button",range:"slider"};function M2($){let Q=$.getAttribute("role");if(Q!==null&&Q!=="")return Q.split(" ")[0];let J=$.tagName.toLowerCase();if(J==="a")return $.hasAttribute("href")?"link":void 0;if(J==="input")return Y3[$.getAttribute("type")??"text"]??"textbox";return W3[J]}function t4($){let Q=$.getAttribute("aria-label");if(Q!==null&&Q.trim()!=="")return u1(Q);let J=$.getAttribute("aria-labelledby");if(J!==null){let G=J.split(/\s+/).map((X)=>$.ownerDocument.getElementById(X)?.textContent??"").join(" ");if(G.trim()!=="")return u1(G)}if($.id!==""){let G=$.ownerDocument.querySelector(`label[for="${CSS.escape($.id)}"]`);if(G?.textContent!=null&&G.textContent.trim()!=="")return u1(G.textContent)}for(let G of["alt","title","placeholder"]){let X=$.getAttribute(G);if(X!==null&&X.trim()!=="")return u1(X)}let q=M2($),W=q==="button"||q==="link"||q==="heading"||q==="cell"||q==="columnheader"||q==="tab"||q==="menuitem"||q==="option",Y=s4($);if(W&&Y.trim()!=="")return u1(Y);return}function G3($){let Q=[],J=$;while(J!==null&&J.tagName.toLowerCase()!=="body"&&J.tagName.toLowerCase()!=="html"){if(J.id!==""&&J.ownerDocument.querySelectorAll(`#${CSS.escape(J.id)}`).length===1)return Q.unshift(`#${CSS.escape(J.id)}`),Q.join(" > ");let q=J.tagName.toLowerCase(),W=J.parentElement,Y=W===null?[]:[...W.children].filter((G)=>G.tagName===J?.tagName);Q.unshift(Y.length>1?`${q}:nth-of-type(${Y.indexOf(J)+1})`:q),J=W}return Q.unshift("body"),Q.join(" > ")}function e4($){return typeof $==="object"&&$!==null}function _2($){if(typeof $==="function"){let Q=Reflect.get($,"displayName");if(typeof Q==="string"&&Q!=="")return Q;return $.name===""?void 0:$.name}if(e4($))return _2($.type)??_2($.render);return}function X3($){let Q=Object.keys($).find((W)=>W.startsWith("__reactFiber$"));if(Q===void 0)return[];let J=[],q=Reflect.get($,Q);while(e4(q)&&J.length<40){let W=_2(q.type)?.replace(/(?<=[a-z])\d+$/,"");if(W!==void 0&&/^[A-Z]/.test(W)&&!W.endsWith("Provider")&&!i4(q)&&J[0]!==W)J.unshift(W);q=q.return}return J.slice(-q3)}function H3($,Q){let J=Q.toString().trim();if(J==="")return;let q=$.ownerDocument.createRange();q.selectNodeContents($),q.setEnd(Q.startContainer,Q.startOffset);let W=$.ownerDocument.createRange();return W.selectNodeContents($),W.setStart(Q.endContainer,Q.endOffset),{exact:J.slice(0,2000),before:q.toString().replace(/\s+/g," ").slice(-r4),after:W.toString().replace(/\s+/g," ").slice(0,r4)}}function $8($,Q,J){let q=M2($),W=t4($),Y=u1(s4($)),G=X3($),X=J===void 0?void 0:H3($,J),H=f4($),B=$.ownerDocument.defaultView,j=B===null?"":n4(B.getComputedStyle($));return{url:Q,selector:G3($),...q===void 0?{}:{role:q},...W===void 0?{}:{name:W},...Y===""?{}:{text:Y},...G.length===0?{}:{components:G},...X===void 0?{}:{quote:X},...H===void 0?{}:{context:H},...B===null?{}:{browser:E4(B)},...j===""?{}:{style:j},html:C4($)}}function a4($,Q){if(Q.role!==void 0&&M2($)!==Q.role)return!1;if(Q.name!==void 0&&t4($)!==Q.name)return!1;return!0}function E0($,Q){let J=null;try{J=$.querySelector(Q.selector)}catch{J=null}if(J!==null&&a4(J,Q))return J;if(Q.role!==void 0&&Q.name!==void 0){let q=[...$.body.querySelectorAll("*")].filter((W)=>a4(W,Q));if(q.length===1)return q[0]??null}return J}var Q8={width:480,height:160};function B3($){let Q=$;for(let J=$.parentElement;J!==null&&J!==$.ownerDocument.body;J=J.parentElement){let q=Q.getBoundingClientRect();if(q.width>=Q8.width&&q.height>=Q8.height)break;if(J.getBoundingClientRect().height>900)break;Q=J}return Q}function z3($,Q){return new Promise((J)=>{let q=setTimeout(J,1000),W=(Y)=>{if(Y===0){clearTimeout(q),J();return}$.requestVideoFrameCallback(()=>W(Y-1))};W(Q)})}function _3($){let Q=Math.max(0,$.left),J=Math.max(0,$.top);return{left:Q,top:J,width:Math.min(innerWidth,$.right)-Q,height:Math.min(innerHeight,$.bottom)-J}}async function J8($,Q){let J=Q.style.visibility;Q.style.visibility="hidden",$.scrollIntoView({block:"nearest",inline:"nearest"});let q;try{q=await navigator.mediaDevices.getDisplayMedia({video:{displaySurface:"browser",width:{ideal:innerWidth*devicePixelRatio},height:{ideal:innerHeight*devicePixelRatio}},audio:!1,...{preferCurrentTab:!0,selfBrowserSurface:"include"}})}catch(W){throw Q.style.visibility=J,W}try{let[W]=q.getVideoTracks();if(W===void 0||W.getSettings().displaySurface!=="browser")throw Error("Share this tab to attach a screenshot");let Y=document.createElement("video");Y.muted=!0,Y.srcObject=q,await Y.play(),await z3(Y,2);let G=_3(B3($).getBoundingClientRect()),X=$.getBoundingClientRect(),H=Y.videoWidth/innerWidth,B=document.createElement("canvas");B.width=Math.round(G.width*H),B.height=Math.round(G.height*H);let j=B.getContext("2d");if(j===null)throw Error("Canvas is not available");return j.drawImage(Y,G.left*H,G.top*H,B.width,B.height,0,0,B.width,B.height),j.strokeStyle="#e11d48",j.lineWidth=3*H,j.strokeRect((X.left-G.left)*H,(X.top-G.top)*H,X.width*H,X.height*H),B.toDataURL("image/png")}finally{Q.style.visibility=J;for(let W of q.getTracks())W.stop()}}var M3=0;function w($,Q,J,q,W,Y){Q||(Q={});var G,X,H=Q;if("ref"in H)for(X in H={},Q)X=="ref"?G=Q[X]:H[X]=Q[X];var B={type:$,props:H,key:J,ref:G,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--M3,__i:-1,__u:0,__source:W,__self:Y};if(typeof $=="function"&&(G=$.defaultProps))for(X in G)H[X]===void 0&&(H[X]=G[X]);return f.vnode&&f.vnode(B),B}var j3=M.object({anchor:l1,body:M.string(),screenshot:M.boolean()}),j2="agent-canvas-review:draft";function q8($){try{if($===null)sessionStorage.removeItem(j2);else sessionStorage.setItem(j2,JSON.stringify($))}catch{}}function V3(){try{let $=sessionStorage.getItem(j2);if($===null)return null;let Q=j3.safeParse(JSON.parse($));return Q.success?Q.data:null}catch{return null}}var K3={open:"Note",queued:"Sent to Claude",working:"Claude is on it",resolved:"Resolved"},W8='a, button, input, select, textarea, label, summary, [role="button"], [role="link"], [role="tab"], [role="menuitem"], [contenteditable]',Y8="agent-canvas-review-picking",V2="agent-canvas-review:reveal";function F3($,Q){let J=new URL($);if(J.origin===location.origin&&J.pathname===location.pathname&&J.search===location.search){location.hash=J.hash;return}try{sessionStorage.setItem(V2,Q)}catch{}location.href=$}function N3(){try{let $=sessionStorage.getItem(V2);return sessionStorage.removeItem(V2),$}catch{return null}}function U3($){if(!$.endsWith(".html"))return!0;let Q=decodeURI(location.pathname);return $==="/index.html"||Q===$||Q.endsWith("/")&&`${Q}index.html`===$}function q0($){let Q=$.getBoundingClientRect();return{top:Q.top,left:Q.left,width:Q.width,height:Q.height}}function W0($){let Q=new URL($);return`${Q.origin}${Q.pathname}${Q.search}${Q.hash.split("?")[0]??""}`}function G8($){if($.quote!==void 0)return`“${$.quote.exact}”`;if($.role!==void 0&&$.name!==void 0)return`${$.role} “${$.name}”`;if($.text!==void 0)return $.text;return $.selector}function A3(){let[$,Q]=x(0);return Y1(()=>{let J=0,q=()=>{cancelAnimationFrame(J),J=requestAnimationFrame(()=>Q((Y)=>Y+1))};window.addEventListener("scroll",q,!0),window.addEventListener("resize",q);let W=setInterval(q,1000);return()=>{cancelAnimationFrame(J),window.removeEventListener("scroll",q,!0),window.removeEventListener("resize",q),clearInterval(W)}},[]),$}function w3(){let[$,Q]=x(location.href);return Y1(()=>{let J=()=>Q(location.href);window.addEventListener("hashchange",J),window.addEventListener("popstate",J);let q=setInterval(J,400);return()=>{window.removeEventListener("hashchange",J),window.removeEventListener("popstate",J),clearInterval(q)}},[]),$}function D3($,Q,J,q,W){Y1(()=>{if(!Q)return;document.documentElement.classList.add(Y8);let Y=(A)=>A.composedPath().includes($),G=(A)=>A.target instanceof Element?A.target.closest(W8)??A.target:null,X=(A)=>{if(!Y(A))J(G(A))},H=(A)=>{if(Y(A))return;if(G(A)?.closest(W8))A.preventDefault(),A.stopPropagation()},B=(A)=>{if(Y(A))return;A.preventDefault(),A.stopPropagation();let z=window.getSelection(),F=z!==null&&z.rangeCount>0&&!z.isCollapsed?z.getRangeAt(0):void 0;if(F!==void 0){let I=F.commonAncestorContainer,N=I instanceof Element?I:I.parentElement;if(N!==null)return q(N,F)}let k=G(A);if(k!==null)q(k)},j=(A)=>{if(A.key==="Escape")W()};return document.addEventListener("mousemove",X,!0),document.addEventListener("pointerdown",H,!0),document.addEventListener("mousedown",H,!0),document.addEventListener("click",B,!0),document.addEventListener("keydown",j,!0),()=>{document.documentElement.classList.remove(Y8),document.removeEventListener("mousemove",X,!0),document.removeEventListener("pointerdown",H,!0),document.removeEventListener("mousedown",H,!0),document.removeEventListener("click",B,!0),document.removeEventListener("keydown",j,!0)}},[$,Q,J,q,W])}function O3($){let q=Math.min(Math.max(8,$.left),window.innerWidth-320-8),W=$.top+$.height+8;return{top:W+190<window.innerHeight?W:Math.max(8,$.top-190-8),left:q}}function b3($){let[Q,J]=x($.draft.body),[q,W]=x($.draft.screenshot),{onChange:Y}=$;Y1(()=>Y(Q,q),[Y,Q,q]);let[G,X]=x(!1),[H,B]=x(null),j=R4(null);Y1(()=>j.current?.focus(),[]);let A=async(z)=>{if(Q.trim()==="")return;X(!0),B(null);try{await $.onSubmit(Q,z,q)}catch(F){B(F instanceof Error?F.message:String(F)),X(!1)}};return w("div",{class:"popover",style:O3($.draft.box),children:[w("div",{class:"target",title:$.draft.anchor.selector,children:G8($.draft.anchor)},void 0,!1,void 0,this),$.draft.anchor.components!==void 0&&w("div",{class:"target",children:$.draft.anchor.components.slice(-3).join(" › ")},void 0,!1,void 0,this),w("textarea",{ref:j,value:Q,placeholder:"What should change here?",onInput:(z)=>J(z.currentTarget.value),onKeyDown:(z)=>{if(z.key==="Escape")$.onCancel();if(z.key==="Enter"&&(z.metaKey||z.ctrlKey))A(!0)}},void 0,!1,void 0,this),w("label",{class:"option",children:[w("input",{type:"checkbox",checked:q,onChange:(z)=>W(z.currentTarget.checked)},void 0,!1,void 0,this),"Attach a screenshot"]},void 0,!0,void 0,this),$.reloadPending&&w("div",{class:"reload-pending",children:[w("span",{children:"The application changed. It reloads once you save or cancel this comment."},void 0,!1,void 0,this),w("button",{type:"button",class:"ghost",onClick:()=>location.reload(),children:"Reload now"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),H!==null&&w("div",{class:"error",children:H},void 0,!1,void 0,this),w("div",{class:"actions",children:[w("button",{type:"button",class:"ghost",onClick:$.onCancel,children:"Cancel"},void 0,!1,void 0,this),w("button",{type:"button",disabled:G||Q.trim()==="",onClick:()=>void A(!1),children:"Save note"},void 0,!1,void 0,this),w("button",{type:"button",class:"primary",disabled:G||Q.trim()==="",onClick:()=>void A(!0),children:"Send to Claude"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),w("div",{class:"hint",children:"Ctrl+Enter sends to Claude · Esc cancels"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function R3($){let{thread:Q,client:J}=$,[q,W]=x(null),[Y,G]=x(null),X=(B)=>{G(null),B().catch((j)=>G(j instanceof Error?j.message:String(j)))},H=(B)=>{if(q===null||q.trim()==="")return;X(()=>J.comment(Q.id,q,B).then(()=>W(null)))};return w("div",{class:`thread${$.number===null?"":" current"}${Q.state==="resolved"?" resolved":""}`,children:[w("div",{class:"thread-head",children:[w("button",{type:"button",class:"ghost",title:"Show in page","aria-label":"Show in page",onClick:$.onReveal,children:$.number===null?"↗":`#${$.number}`},void 0,!1,void 0,this),w("span",{class:"target",title:Q.anchor.url,children:G8(Q.anchor)},void 0,!1,void 0,this),w("span",{class:`badge ${Q.state}`,children:K3[Q.state]},void 0,!1,void 0,this)]},void 0,!0,void 0,this),Q.comments.map((B)=>w("div",{class:`comment ${B.author}`,children:[w("span",{class:"author",children:B.author==="user"?"You":"Claude"},void 0,!1,void 0,this),w("span",{class:"body",children:B.body},void 0,!1,void 0,this)]},B.id,!0,void 0,this)),q!==null&&w("textarea",{value:q,placeholder:"Reply…",onInput:(B)=>W(B.currentTarget.value),onKeyDown:(B)=>{if(B.key==="Enter"&&(B.metaKey||B.ctrlKey))H(!0)}},void 0,!1,void 0,this),Y!==null&&w("div",{class:"error",children:Y},void 0,!1,void 0,this),w("div",{class:"actions",children:q===null?w(Q1,{children:[w("button",{type:"button",class:"ghost",onClick:()=>X(()=>J.delete(Q.id)),children:"Delete"},void 0,!1,void 0,this),Q.state==="resolved"?w("button",{type:"button",onClick:()=>X(()=>J.setResolved(Q.id,!1)),children:"Reopen"},void 0,!1,void 0,this):w("button",{type:"button",onClick:()=>X(()=>J.setResolved(Q.id,!0)),children:"Resolve"},void 0,!1,void 0,this),w("button",{type:"button",onClick:()=>W(""),children:"Reply"},void 0,!1,void 0,this),Q.state==="open"&&w("button",{type:"button",class:"primary",onClick:()=>X(()=>J.send(Q.id)),children:"Send to Claude"},void 0,!1,void 0,this)]},void 0,!0,void 0,this):w(Q1,{children:[w("button",{type:"button",class:"ghost",onClick:()=>W(null),children:"Cancel"},void 0,!1,void 0,this),w("button",{type:"button",disabled:q.trim()==="",onClick:()=>H(!1),children:"Reply"},void 0,!1,void 0,this),w("button",{type:"button",class:"primary",disabled:q.trim()==="",onClick:()=>H(!0),children:"Reply & send"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function X8($){let{client:Q,host:J}=$,[q,W]=x([]),[Y,G]=x(!1),[X,H]=x(!1),[B,j]=x(!1),[A,z]=x(null),[F,k]=x(null),[I,N]=x(V3),[O,U]=x(!1),[C,T]=x(!1),[P,h]=x(!1),[c,u]=x(!1),[o,i]=x(null),[$1,N2]=x(N3),[U2,A2]=x(null),z8=w3(),_8=A3();Y1(()=>{return Q.connect({threads:W,agentWatching:G,connected:H,reload:(L)=>{if(U3(L))U(!0)}}),()=>Q.close()},[Q]);let w2=Q0(()=>{j(!1),z(null)},[]),M8=Q0((L,p)=>{j(!1),z(null),window.getSelection()?.removeAllRanges(),N(null);let n=$8(L,location.href,p);k({anchor:n,box:q0(L),element:L,sources:z2(B2(L)),body:"",screenshot:!1})},[]),k0=Q0(()=>{k(null),q8(null)},[]),P0=F?.anchor,j8=Q0((L,p)=>{if(P0!==void 0)q8({anchor:P0,body:L,screenshot:p})},[P0]);D3(J,B,z,M8,w2);let V8=()=>{T(!1),k0(),j(!0)},A1=W0(z8),C0=b0(()=>q.filter((L)=>W0(L.anchor.url)===A1&&(!c||L.state!=="resolved")),[q,A1,c]),D2=P?q.filter((L)=>!c||L.state!=="resolved"):C0,O2=new Map(C0.map((L,p)=>[L.id,p+1])),b2=q.filter((L)=>L.state!=="resolved").length,f0=q.filter(v4).length,K8=()=>{i(null),Q.sendNotes().catch((L)=>i(L instanceof Error?L.message:String(L)))};Y1(()=>{if($1===null)return;let L=q.find((n)=>n.id===$1);if(L===void 0||W0(L.anchor.url)!==A1)return;let p=E0(document,L.anchor);if(p===null)return;p.scrollIntoView({block:"center",behavior:"smooth"}),N2(null),setTimeout(()=>A2(q0(p)),350),setTimeout(()=>A2(null),1600)},[$1,q,A1]),Y1(()=>{if(O&&F===null)location.reload()},[O,F]),Y1(()=>{if(I===null||F!==null||W0(I.anchor.url)!==A1)return;let L=E0(document,I.anchor);if(L===null)return;N(null),k({...I,box:q0(L),element:L,sources:z2(B2(L))})},[I,F,A1,_8]);let F8=(L)=>{if(N2(L.id),W0(L.anchor.url)!==A1)F3(L.anchor.url,L.id)},R2=!X?Q.offlineLabel:Y?"Claude is listening":"Claude is not listening",L2=A===null?null:q0(A);return w(Q1,{children:[L2!==null&&w("div",{class:"highlight",style:L2},void 0,!1,void 0,this),U2!==null&&w("div",{class:"highlight flash",style:U2},void 0,!1,void 0,this),C0.map((L)=>{let p=E0(document,L.anchor);if(p===null)return null;let n=q0(p);if(n.width===0&&n.height===0)return null;return w("button",{type:"button",class:`pin ${L.state}`,style:{top:Math.max(0,n.top-11),left:Math.max(0,n.left+n.width-11)},title:L.comments[0]?.body,onClick:()=>T(!0),children:O2.get(L.id)},L.id,!1,void 0,this)}),F!==null&&w(b3,{draft:F,reloadPending:O,onChange:j8,onCancel:k0,onSubmit:async(L,p,n)=>{let N8=n?await J8(F.element,J):void 0,S2=await F.sources;await Q.createThread(S2.length===0?F.anchor:{...F.anchor,sources:S2},L,p,N8),k0()}},void 0,!1,void 0,this),C&&w("aside",{class:"panel",children:[w("header",{children:[w("h2",{children:"Review"},void 0,!1,void 0,this),w("button",{type:"button",class:"ghost",onClick:()=>T(!1),children:"Close"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),w("div",{class:"tabs",children:[w("button",{type:"button",class:P?"":"active",onClick:()=>h(!1),children:"This page"},void 0,!1,void 0,this),w("button",{type:"button",class:P?"active":"",onClick:()=>h(!0),children:"All pages"},void 0,!1,void 0,this),w("button",{type:"button",class:c?"active":"",onClick:()=>u(!c),children:"Hide resolved"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),f0>0&&w("div",{class:"send-notes",children:w("button",{type:"button",class:"primary",onClick:K8,children:["Send ",f0===1?"1 note":`${f0} notes`," to Claude"]},void 0,!0,void 0,this)},void 0,!1,void 0,this),o!==null&&w("div",{class:"error",children:o},void 0,!1,void 0,this),w("div",{class:"threads",children:[D2.length===0&&w("div",{class:"empty",children:"No comments yet. Click “Comment”, then an element or a text selection."},void 0,!1,void 0,this),D2.map((L)=>w(R3,{thread:L,number:O2.get(L.id)??null,client:Q,onReveal:()=>F8(L)},L.id,!1,void 0,this))]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),w("div",{class:`toolbar${C?" beside-panel":""}`,children:[w("span",{class:"presence",title:R2,children:[w("span",{class:`dot ${!X?"off-line":Y?"on":""}`},void 0,!1,void 0,this),R2]},void 0,!0,void 0,this),w("button",{type:"button",class:B?"active":"",onClick:()=>B?w2():V8(),children:B?"Pick an element…":"Comment"},void 0,!1,void 0,this),w("button",{type:"button",class:C?"active":"",onClick:()=>T(!C),children:["Threads",b2>0?` (${b2})`:""]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}var H8="agent-canvas-review",K2="agent-canvas-review:remote",L3="off";function S3(){let $=new URLSearchParams(location.hash.slice(1)).get(s0);if($!==null){if(history.replaceState(history.state,"",`${location.pathname}${location.search}`),$===L3){try{localStorage.removeItem(K2)}catch{}return null}let Q=e0($);if(Q===null)return console.error("agent-canvas review: the review link is malformed"),null;try{localStorage.setItem(K2,B4(Q))}catch{}return Q}try{let Q=localStorage.getItem(K2);return Q===null?null:e0(Q)}catch{return null}}function B8($){if(document.querySelector(H8)!==null)return;let Q=document.createElement("style");Q.textContent="html.agent-canvas-review-picking, html.agent-canvas-review-picking * { cursor: crosshair !important; }",document.head.append(Q);let J=document.createElement(H8);document.documentElement.append(J);let q=J.attachShadow({mode:"open"}),W=document.createElement("style");W.textContent=V4,q.append(W),c2(w(X8,{client:$,host:J},void 0,!1,void 0,this),q)}async function v3($){let Q=new URL($.src).origin,J=$.dataset.project;if(J!==void 0){if(!i0.test(J)){console.error(`agent-canvas review: data-project must match ${i0}, got "${J}"`);return}B8(new $2(Q,J));return}let q=S3();if(q===null)return;B8(new Q2(Q,q.projectId,await u2(q.key)))}var F2=document.currentScript;if(F2 instanceof HTMLScriptElement){if(v3(F2),F2.dataset.project===void 0)window.addEventListener("hashchange",()=>{if(new URLSearchParams(location.hash.slice(1)).has(s0))location.reload()})}else console.error("agent-canvas review: load review.js with a classic <script> tag");})();
|