@tscircuit/runframe 0.0.767 → 0.0.768

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.
@@ -241,7 +241,7 @@ Check the render method of %s.`,ol(jc)||"Unknown"));var hn=bC($e,vt);hn.payload=
241
241
  You might need to use a local HTTP server (instead of file://): https://reactjs.org/link/react-devtools-faq`:""),"font-weight:bold")}zE.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=m9e,zE.createPortal=bFn,zE.createRoot=SFn,zE.findDOMNode=vFn,zE.flushSync=QFn,zE.hydrate=IFn,zE.hydrateRoot=wFn,zE.render=CFn,zE.unmountComponentAtNode=EFn,zE.unstable_batchedUpdates=jCe,zE.unstable_renderSubtreeIntoContainer=BFn,zE.version=u9e,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error)}(),zE}var rxe;function oxe(){if(rxe)return WP.exports;rxe=1;function i(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function")){if(process.env.NODE_ENV!=="production")throw new Error("^_^");try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(i)}catch(e){console.error(e)}}}return process.env.NODE_ENV==="production"?(i(),WP.exports=sht()):WP.exports=lht(),WP.exports}var axe;function cht(){if(axe)return nM;axe=1;var i=oxe();if(process.env.NODE_ENV==="production")nM.createRoot=i.createRoot,nM.hydrateRoot=i.hydrateRoot;else{var e=i.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;nM.createRoot=function(t,n){e.usingClientEntryPoint=!0;try{return i.createRoot(t,n)}finally{e.usingClientEntryPoint=!1}},nM.hydrateRoot=function(t,n,r){e.usingClientEntryPoint=!0;try{return i.hydrateRoot(t,n,r)}finally{e.usingClientEntryPoint=!1}}}return nM}var sxe=cht(),Nt=$C();const cg=g9(Nt),lxe=IB({__proto__:null,default:cg},[Nt]);function ny(i,e,{checkForDefaultPrevented:t=!0}={}){return function(r){if(i==null||i(r),t===!1||!r.defaultPrevented)return e==null?void 0:e(r)}}function rM(i,e=[]){let t=[];function n(o,a){const s=Nt.createContext(a),l=t.length;t=[...t,a];const c=A=>{var v;const{scope:d,children:f,...h}=A,y=((v=d==null?void 0:d[i])==null?void 0:v[l])||s,_=Nt.useMemo(()=>h,Object.values(h));return Ct.jsx(y.Provider,{value:_,children:f})};c.displayName=o+"Provider";function u(A,d){var y;const f=((y=d==null?void 0:d[i])==null?void 0:y[l])||s,h=Nt.useContext(f);if(h)return h;if(a!==void 0)return a;throw new Error(`\`${A}\` must be used within \`${o}\``)}return[c,u]}const r=()=>{const o=t.map(a=>Nt.createContext(a));return function(s){const l=(s==null?void 0:s[i])||o;return Nt.useMemo(()=>({[`__scope${i}`]:{...s,[i]:l}}),[s,l])}};return r.scopeName=i,[n,uht(r,...e)]}function uht(...i){const e=i[0];if(i.length===1)return e;const t=()=>{const n=i.map(r=>({useScope:r(),scopeName:r.scopeName}));return function(o){const a=n.reduce((s,{useScope:l,scopeName:c})=>{const A=l(o)[`__scope${c}`];return{...s,...A}},{});return Nt.useMemo(()=>({[`__scope${e.scopeName}`]:a}),[a])}};return t.scopeName=e.scopeName,t}function cxe(i,e){if(typeof i=="function")return i(e);i!=null&&(i.current=e)}function eU(...i){return e=>{let t=!1;const n=i.map(r=>{const o=cxe(r,e);return!t&&typeof o=="function"&&(t=!0),o});if(t)return()=>{for(let r=0;r<n.length;r++){const o=n[r];typeof o=="function"?o():cxe(i[r],null)}}}}function HE(...i){return Nt.useCallback(eU(...i),i)}function VN(i){const e=dht(i),t=Nt.forwardRef((n,r)=>{const{children:o,...a}=n,s=Nt.Children.toArray(o),l=s.find(hht);if(l){const c=l.props.children,u=s.map(A=>A===l?Nt.Children.count(c)>1?Nt.Children.only(null):Nt.isValidElement(c)?c.props.children:null:A);return Ct.jsx(e,{...a,ref:r,children:Nt.isValidElement(c)?Nt.cloneElement(c,void 0,u):null})}return Ct.jsx(e,{...a,ref:r,children:o})});return t.displayName=`${i}.Slot`,t}var Aht=VN("Slot");function dht(i){const e=Nt.forwardRef((t,n)=>{const{children:r,...o}=t;if(Nt.isValidElement(r)){const a=ght(r),s=pht(o,r.props);return r.type!==Nt.Fragment&&(s.ref=n?eU(n,a):a),Nt.cloneElement(r,s)}return Nt.Children.count(r)>1?Nt.Children.only(null):null});return e.displayName=`${i}.SlotClone`,e}var fht=Symbol("radix.slottable");function hht(i){return Nt.isValidElement(i)&&typeof i.type=="function"&&"__radixId"in i.type&&i.type.__radixId===fht}function pht(i,e){const t={...e};for(const n in e){const r=i[n],o=e[n];/^on[A-Z]/.test(n)?r&&o?t[n]=(...s)=>{const l=o(...s);return r(...s),l}:r&&(t[n]=r):n==="style"?t[n]={...r,...o}:n==="className"&&(t[n]=[r,o].filter(Boolean).join(" "))}return{...i,...t}}function ght(i){var n,r;let e=(n=Object.getOwnPropertyDescriptor(i.props,"ref"))==null?void 0:n.get,t=e&&"isReactWarning"in e&&e.isReactWarning;return t?i.ref:(e=(r=Object.getOwnPropertyDescriptor(i,"ref"))==null?void 0:r.get,t=e&&"isReactWarning"in e&&e.isReactWarning,t?i.props.ref:i.props.ref||i.ref)}function uxe(i){const e=i+"CollectionProvider",[t,n]=rM(e),[r,o]=t(e,{collectionRef:{current:null},itemMap:new Map}),a=y=>{const{scope:_,children:v}=y,E=cg.useRef(null),b=cg.useRef(new Map).current;return Ct.jsx(r,{scope:_,itemMap:b,collectionRef:E,children:v})};a.displayName=e;const s=i+"CollectionSlot",l=VN(s),c=cg.forwardRef((y,_)=>{const{scope:v,children:E}=y,b=o(s,v),M=HE(_,b.collectionRef);return Ct.jsx(l,{ref:M,children:E})});c.displayName=s;const u=i+"CollectionItemSlot",A="data-radix-collection-item",d=VN(u),f=cg.forwardRef((y,_)=>{const{scope:v,children:E,...b}=y,M=cg.useRef(null),Y=HE(_,M),G=o(u,v);return cg.useEffect(()=>(G.itemMap.set(M,{ref:M,...b}),()=>void G.itemMap.delete(M))),Ct.jsx(d,{[A]:"",ref:Y,children:E})});f.displayName=u;function h(y){const _=o(i+"CollectionConsumer",y);return cg.useCallback(()=>{const E=_.collectionRef.current;if(!E)return[];const b=Array.from(E.querySelectorAll(`[${A}]`));return Array.from(_.itemMap.values()).sort((G,F)=>b.indexOf(G.ref.current)-b.indexOf(F.ref.current))},[_.collectionRef,_.itemMap])}return[{Provider:a,Slot:c,ItemSlot:f},h,n]}var n3=globalThis!=null&&globalThis.document?Nt.useLayoutEffect:()=>{},mht=lxe[" useId ".trim().toString()]||(()=>{}),yht=0;function oM(i){const[e,t]=Nt.useState(mht());return n3(()=>{t(n=>n??String(yht++))},[i]),e?`radix-${e}`:""}var SZ=oxe();const _ht=g9(SZ);var vht=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],m9=vht.reduce((i,e)=>{const t=VN(`Primitive.${e}`),n=Nt.forwardRef((r,o)=>{const{asChild:a,...s}=r,l=a?t:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),Ct.jsx(l,{...s,ref:o})});return n.displayName=`Primitive.${e}`,{...i,[e]:n}},{});function Axe(i,e){i&&SZ.flushSync(()=>i.dispatchEvent(e))}function CB(i){const e=Nt.useRef(i);return Nt.useEffect(()=>{e.current=i}),Nt.useMemo(()=>(...t)=>{var n;return(n=e.current)==null?void 0:n.call(e,...t)},[])}var Iht=lxe[" useInsertionEffect ".trim().toString()]||n3;function tU({prop:i,defaultProp:e,onChange:t=()=>{},caller:n}){const[r,o,a]=Cht({defaultProp:e,onChange:t}),s=i!==void 0,l=s?i:r;{const u=Nt.useRef(i!==void 0);Nt.useEffect(()=>{const A=u.current;A!==s&&console.warn(`${n} is changing from ${A?"controlled":"uncontrolled"} to ${s?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),u.current=s},[s,n])}const c=Nt.useCallback(u=>{var A;if(s){const d=xht(u)?u(i):u;d!==i&&((A=a.current)==null||A.call(a,d))}else o(u)},[s,i,o,a]);return[l,c]}function Cht({defaultProp:i,onChange:e}){const[t,n]=Nt.useState(i),r=Nt.useRef(t),o=Nt.useRef(e);return Iht(()=>{o.current=e},[e]),Nt.useEffect(()=>{var a;r.current!==t&&((a=o.current)==null||a.call(o,t),r.current=t)},[t,r]),[t,n,o]}function xht(i){return typeof i=="function"}var Eht=Nt.createContext(void 0);function wZ(i){const e=Nt.useContext(Eht);return i||e||"ltr"}var QZ="rovingFocusGroup.onEntryFocus",bht={bubbles:!1,cancelable:!0},KN="RovingFocusGroup",[MZ,dxe,Bht]=uxe(KN),[Sht,nU]=rM(KN,[Bht]),[wht,Qht]=Sht(KN),fxe=Nt.forwardRef((i,e)=>Ct.jsx(MZ.Provider,{scope:i.__scopeRovingFocusGroup,children:Ct.jsx(MZ.Slot,{scope:i.__scopeRovingFocusGroup,children:Ct.jsx(Mht,{...i,ref:e})})}));fxe.displayName=KN;var Mht=Nt.forwardRef((i,e)=>{const{__scopeRovingFocusGroup:t,orientation:n,loop:r=!1,dir:o,currentTabStopId:a,defaultCurrentTabStopId:s,onCurrentTabStopIdChange:l,onEntryFocus:c,preventScrollOnEntryFocus:u=!1,...A}=i,d=Nt.useRef(null),f=HE(e,d),h=wZ(o),[y,_]=tU({prop:a,defaultProp:s??null,onChange:l,caller:KN}),[v,E]=Nt.useState(!1),b=CB(c),M=dxe(t),Y=Nt.useRef(!1),[G,F]=Nt.useState(0);return Nt.useEffect(()=>{const L=d.current;if(L)return L.addEventListener(QZ,b),()=>L.removeEventListener(QZ,b)},[b]),Ct.jsx(wht,{scope:t,orientation:n,dir:h,loop:r,currentTabStopId:y,onItemFocus:Nt.useCallback(L=>_(L),[_]),onItemShiftTab:Nt.useCallback(()=>E(!0),[]),onFocusableItemAdd:Nt.useCallback(()=>F(L=>L+1),[]),onFocusableItemRemove:Nt.useCallback(()=>F(L=>L-1),[]),children:Ct.jsx(m9.div,{tabIndex:v||G===0?-1:0,"data-orientation":n,...A,ref:f,style:{outline:"none",...i.style},onMouseDown:ny(i.onMouseDown,()=>{Y.current=!0}),onFocus:ny(i.onFocus,L=>{const V=!Y.current;if(L.target===L.currentTarget&&V&&!v){const O=new CustomEvent(QZ,bht);if(L.currentTarget.dispatchEvent(O),!O.defaultPrevented){const re=M().filter(de=>de.focusable),Z=re.find(de=>de.active),se=re.find(de=>de.id===y),xe=[Z,se,...re].filter(Boolean).map(de=>de.ref.current);gxe(xe,u)}}Y.current=!1}),onBlur:ny(i.onBlur,()=>E(!1))})})}),hxe="RovingFocusGroupItem",pxe=Nt.forwardRef((i,e)=>{const{__scopeRovingFocusGroup:t,focusable:n=!0,active:r=!1,tabStopId:o,children:a,...s}=i,l=oM(),c=o||l,u=Qht(hxe,t),A=u.currentTabStopId===c,d=dxe(t),{onFocusableItemAdd:f,onFocusableItemRemove:h,currentTabStopId:y}=u;return Nt.useEffect(()=>{if(n)return f(),()=>h()},[n,f,h]),Ct.jsx(MZ.ItemSlot,{scope:t,id:c,focusable:n,active:r,children:Ct.jsx(m9.span,{tabIndex:A?0:-1,"data-orientation":u.orientation,...s,ref:e,onMouseDown:ny(i.onMouseDown,_=>{n?u.onItemFocus(c):_.preventDefault()}),onFocus:ny(i.onFocus,()=>u.onItemFocus(c)),onKeyDown:ny(i.onKeyDown,_=>{if(_.key==="Tab"&&_.shiftKey){u.onItemShiftTab();return}if(_.target!==_.currentTarget)return;const v=Nht(_,u.orientation,u.dir);if(v!==void 0){if(_.metaKey||_.ctrlKey||_.altKey||_.shiftKey)return;_.preventDefault();let b=d().filter(M=>M.focusable).map(M=>M.ref.current);if(v==="last")b.reverse();else if(v==="prev"||v==="next"){v==="prev"&&b.reverse();const M=b.indexOf(_.currentTarget);b=u.loop?Tht(b,M+1):b.slice(M+1)}setTimeout(()=>gxe(b))}}),children:typeof a=="function"?a({isCurrentTabStop:A,hasTabStop:y!=null}):a})})});pxe.displayName=hxe;var Rht={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function Dht(i,e){return e!=="rtl"?i:i==="ArrowLeft"?"ArrowRight":i==="ArrowRight"?"ArrowLeft":i}function Nht(i,e,t){const n=Dht(i.key,t);if(!(e==="vertical"&&["ArrowLeft","ArrowRight"].includes(n))&&!(e==="horizontal"&&["ArrowUp","ArrowDown"].includes(n)))return Rht[n]}function gxe(i,e=!1){const t=document.activeElement;for(const n of i)if(n===t||(n.focus({preventScroll:e}),document.activeElement!==t))return}function Tht(i,e){return i.map((t,n)=>i[(e+n)%i.length])}var mxe=fxe,yxe=pxe;function kht(i,e){return Nt.useReducer((t,n)=>e[t][n]??t,i)}var aM=i=>{const{present:e,children:t}=i,n=Pht(e),r=typeof t=="function"?t({present:n.isPresent}):Nt.Children.only(t),o=HE(n.ref,Uht(r));return typeof t=="function"||n.isPresent?Nt.cloneElement(r,{ref:o}):null};aM.displayName="Presence";function Pht(i){const[e,t]=Nt.useState(),n=Nt.useRef(null),r=Nt.useRef(i),o=Nt.useRef("none"),a=i?"mounted":"unmounted",[s,l]=kht(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return Nt.useEffect(()=>{const c=iU(n.current);o.current=s==="mounted"?c:"none"},[s]),n3(()=>{const c=n.current,u=r.current;if(u!==i){const d=o.current,f=iU(c);i?l("MOUNT"):f==="none"||(c==null?void 0:c.display)==="none"?l("UNMOUNT"):l(u&&d!==f?"ANIMATION_OUT":"UNMOUNT"),r.current=i}},[i,l]),n3(()=>{if(e){let c;const u=e.ownerDocument.defaultView??window,A=f=>{const y=iU(n.current).includes(f.animationName);if(f.target===e&&y&&(l("ANIMATION_END"),!r.current)){const _=e.style.animationFillMode;e.style.animationFillMode="forwards",c=u.setTimeout(()=>{e.style.animationFillMode==="forwards"&&(e.style.animationFillMode=_)})}},d=f=>{f.target===e&&(o.current=iU(n.current))};return e.addEventListener("animationstart",d),e.addEventListener("animationcancel",A),e.addEventListener("animationend",A),()=>{u.clearTimeout(c),e.removeEventListener("animationstart",d),e.removeEventListener("animationcancel",A),e.removeEventListener("animationend",A)}}else l("ANIMATION_END")},[e,l]),{isPresent:["mounted","unmountSuspended"].includes(s),ref:Nt.useCallback(c=>{n.current=c?getComputedStyle(c):null,t(c)},[])}}function iU(i){return(i==null?void 0:i.animationName)||"none"}function Uht(i){var n,r;let e=(n=Object.getOwnPropertyDescriptor(i.props,"ref"))==null?void 0:n.get,t=e&&"isReactWarning"in e&&e.isReactWarning;return t?i.ref:(e=(r=Object.getOwnPropertyDescriptor(i,"ref"))==null?void 0:r.get,t=e&&"isReactWarning"in e&&e.isReactWarning,t?i.props.ref:i.props.ref||i.ref)}var rU="Tabs",[Lht,kFn]=rM(rU,[nU]),_xe=nU(),[Fht,RZ]=Lht(rU),vxe=Nt.forwardRef((i,e)=>{const{__scopeTabs:t,value:n,onValueChange:r,defaultValue:o,orientation:a="horizontal",dir:s,activationMode:l="automatic",...c}=i,u=wZ(s),[A,d]=tU({prop:n,onChange:r,defaultProp:o??"",caller:rU});return Ct.jsx(Fht,{scope:t,baseId:oM(),value:A,onValueChange:d,orientation:a,dir:u,activationMode:l,children:Ct.jsx(m9.div,{dir:u,"data-orientation":a,...c,ref:e})})});vxe.displayName=rU;var Ixe="TabsList",Cxe=Nt.forwardRef((i,e)=>{const{__scopeTabs:t,loop:n=!0,...r}=i,o=RZ(Ixe,t),a=_xe(t);return Ct.jsx(mxe,{asChild:!0,...a,orientation:o.orientation,dir:o.dir,loop:n,children:Ct.jsx(m9.div,{role:"tablist","aria-orientation":o.orientation,...r,ref:e})})});Cxe.displayName=Ixe;var xxe="TabsTrigger",Exe=Nt.forwardRef((i,e)=>{const{__scopeTabs:t,value:n,disabled:r=!1,...o}=i,a=RZ(xxe,t),s=_xe(t),l=Sxe(a.baseId,n),c=wxe(a.baseId,n),u=n===a.value;return Ct.jsx(yxe,{asChild:!0,...s,focusable:!r,active:u,children:Ct.jsx(m9.button,{type:"button",role:"tab","aria-selected":u,"aria-controls":c,"data-state":u?"active":"inactive","data-disabled":r?"":void 0,disabled:r,id:l,...o,ref:e,onMouseDown:ny(i.onMouseDown,A=>{!r&&A.button===0&&A.ctrlKey===!1?a.onValueChange(n):A.preventDefault()}),onKeyDown:ny(i.onKeyDown,A=>{[" ","Enter"].includes(A.key)&&a.onValueChange(n)}),onFocus:ny(i.onFocus,()=>{const A=a.activationMode!=="manual";!u&&!r&&A&&a.onValueChange(n)})})})});Exe.displayName=xxe;var bxe="TabsContent",Bxe=Nt.forwardRef((i,e)=>{const{__scopeTabs:t,value:n,forceMount:r,children:o,...a}=i,s=RZ(bxe,t),l=Sxe(s.baseId,n),c=wxe(s.baseId,n),u=n===s.value,A=Nt.useRef(u);return Nt.useEffect(()=>{const d=requestAnimationFrame(()=>A.current=!1);return()=>cancelAnimationFrame(d)},[]),Ct.jsx(aM,{present:r||u,children:({present:d})=>Ct.jsx(m9.div,{"data-state":u?"active":"inactive","data-orientation":s.orientation,role:"tabpanel","aria-labelledby":l,hidden:!d,id:c,tabIndex:0,...a,ref:e,style:{...i.style,animationDuration:A.current?"0s":void 0},children:d&&o})})});Bxe.displayName=bxe;function Sxe(i,e){return`${i}-trigger-${e}`}function wxe(i,e){return`${i}-content-${e}`}var Ght=vxe,Qxe=Cxe,Mxe=Exe,Rxe=Bxe;function Dxe(i){var e,t,n="";if(typeof i=="string"||typeof i=="number")n+=i;else if(typeof i=="object")if(Array.isArray(i)){var r=i.length;for(e=0;e<r;e++)i[e]&&(t=Dxe(i[e]))&&(n&&(n+=" "),n+=t)}else for(t in i)i[t]&&(n&&(n+=" "),n+=t);return n}function xB(){for(var i,e,t=0,n="",r=arguments.length;t<r;t++)(i=arguments[t])&&(e=Dxe(i))&&(n&&(n+=" "),n+=e);return n}const DZ="-",Oht=i=>{const e=Hht(i),{conflictingClassGroups:t,conflictingClassGroupModifiers:n}=i;return{getClassGroupId:a=>{const s=a.split(DZ);return s[0]===""&&s.length!==1&&s.shift(),Nxe(s,e)||zht(a)},getConflictingClassGroupIds:(a,s)=>{const l=t[a]||[];return s&&n[a]?[...l,...n[a]]:l}}},Nxe=(i,e)=>{var a;if(i.length===0)return e.classGroupId;const t=i[0],n=e.nextPart.get(t),r=n?Nxe(i.slice(1),n):void 0;if(r)return r;if(e.validators.length===0)return;const o=i.join(DZ);return(a=e.validators.find(({validator:s})=>s(o)))==null?void 0:a.classGroupId},Txe=/^\[(.+)\]$/,zht=i=>{if(Txe.test(i)){const e=Txe.exec(i)[1],t=e==null?void 0:e.substring(0,e.indexOf(":"));if(t)return"arbitrary.."+t}},Hht=i=>{const{theme:e,prefix:t}=i,n={nextPart:new Map,validators:[]};return Vht(Object.entries(i.classGroups),t).forEach(([o,a])=>{NZ(a,n,o,e)}),n},NZ=(i,e,t,n)=>{i.forEach(r=>{if(typeof r=="string"){const o=r===""?e:kxe(e,r);o.classGroupId=t;return}if(typeof r=="function"){if(Yht(r)){NZ(r(n),e,t,n);return}e.validators.push({validator:r,classGroupId:t});return}Object.entries(r).forEach(([o,a])=>{NZ(a,kxe(e,o),t,n)})})},kxe=(i,e)=>{let t=i;return e.split(DZ).forEach(n=>{t.nextPart.has(n)||t.nextPart.set(n,{nextPart:new Map,validators:[]}),t=t.nextPart.get(n)}),t},Yht=i=>i.isThemeGetter,Vht=(i,e)=>e?i.map(([t,n])=>{const r=n.map(o=>typeof o=="string"?e+o:typeof o=="object"?Object.fromEntries(Object.entries(o).map(([a,s])=>[e+a,s])):o);return[t,r]}):i,Kht=i=>{if(i<1)return{get:()=>{},set:()=>{}};let e=0,t=new Map,n=new Map;const r=(o,a)=>{t.set(o,a),e++,e>i&&(e=0,n=t,t=new Map)};return{get(o){let a=t.get(o);if(a!==void 0)return a;if((a=n.get(o))!==void 0)return r(o,a),a},set(o,a){t.has(o)?t.set(o,a):r(o,a)}}},Pxe="!",jht=i=>{const{separator:e,experimentalParseClassName:t}=i,n=e.length===1,r=e[0],o=e.length,a=s=>{const l=[];let c=0,u=0,A;for(let _=0;_<s.length;_++){let v=s[_];if(c===0){if(v===r&&(n||s.slice(_,_+o)===e)){l.push(s.slice(u,_)),u=_+o;continue}if(v==="/"){A=_;continue}}v==="["?c++:v==="]"&&c--}const d=l.length===0?s:s.substring(u),f=d.startsWith(Pxe),h=f?d.substring(1):d,y=A&&A>u?A-u:void 0;return{modifiers:l,hasImportantModifier:f,baseClassName:h,maybePostfixModifierPosition:y}};return t?s=>t({className:s,parseClassName:a}):a},Jht=i=>{if(i.length<=1)return i;const e=[];let t=[];return i.forEach(n=>{n[0]==="["?(e.push(...t.sort(),n),t=[]):t.push(n)}),e.push(...t.sort()),e},qht=i=>({cache:Kht(i.cacheSize),parseClassName:jht(i),...Oht(i)}),Zht=/\s+/,Xht=(i,e)=>{const{parseClassName:t,getClassGroupId:n,getConflictingClassGroupIds:r}=e,o=[],a=i.trim().split(Zht);let s="";for(let l=a.length-1;l>=0;l-=1){const c=a[l],{modifiers:u,hasImportantModifier:A,baseClassName:d,maybePostfixModifierPosition:f}=t(c);let h=!!f,y=n(h?d.substring(0,f):d);if(!y){if(!h){s=c+(s.length>0?" "+s:s);continue}if(y=n(d),!y){s=c+(s.length>0?" "+s:s);continue}h=!1}const _=Jht(u).join(":"),v=A?_+Pxe:_,E=v+y;if(o.includes(E))continue;o.push(E);const b=r(y,h);for(let M=0;M<b.length;++M){const Y=b[M];o.push(v+Y)}s=c+(s.length>0?" "+s:s)}return s};function Wht(){let i=0,e,t,n="";for(;i<arguments.length;)(e=arguments[i++])&&(t=Uxe(e))&&(n&&(n+=" "),n+=t);return n}const Uxe=i=>{if(typeof i=="string")return i;let e,t="";for(let n=0;n<i.length;n++)i[n]&&(e=Uxe(i[n]))&&(t&&(t+=" "),t+=e);return t};function $ht(i,...e){let t,n,r,o=a;function a(l){const c=e.reduce((u,A)=>A(u),i());return t=qht(c),n=t.cache.get,r=t.cache.set,o=s,s(l)}function s(l){const c=n(l);if(c)return c;const u=Xht(l,t);return r(l,u),u}return function(){return o(Wht.apply(null,arguments))}}const cI=i=>{const e=t=>t[i]||[];return e.isThemeGetter=!0,e},Lxe=/^\[(?:([a-z-]+):)?(.+)\]$/i,e0t=/^\d+\/\d+$/,t0t=new Set(["px","full","screen"]),n0t=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,i0t=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,r0t=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,o0t=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,a0t=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,kS=i=>sM(i)||t0t.has(i)||e0t.test(i),i3=i=>lM(i,"length",h0t),sM=i=>!!i&&!Number.isNaN(Number(i)),TZ=i=>lM(i,"number",sM),jN=i=>!!i&&Number.isInteger(Number(i)),s0t=i=>i.endsWith("%")&&sM(i.slice(0,-1)),am=i=>Lxe.test(i),r3=i=>n0t.test(i),l0t=new Set(["length","size","percentage"]),c0t=i=>lM(i,l0t,Fxe),u0t=i=>lM(i,"position",Fxe),A0t=new Set(["image","url"]),d0t=i=>lM(i,A0t,g0t),f0t=i=>lM(i,"",p0t),JN=()=>!0,lM=(i,e,t)=>{const n=Lxe.exec(i);return n?n[1]?typeof e=="string"?n[1]===e:e.has(n[1]):t(n[2]):!1},h0t=i=>i0t.test(i)&&!r0t.test(i),Fxe=()=>!1,p0t=i=>o0t.test(i),g0t=i=>a0t.test(i),m0t=$ht(()=>{const i=cI("colors"),e=cI("spacing"),t=cI("blur"),n=cI("brightness"),r=cI("borderColor"),o=cI("borderRadius"),a=cI("borderSpacing"),s=cI("borderWidth"),l=cI("contrast"),c=cI("grayscale"),u=cI("hueRotate"),A=cI("invert"),d=cI("gap"),f=cI("gradientColorStops"),h=cI("gradientColorStopPositions"),y=cI("inset"),_=cI("margin"),v=cI("opacity"),E=cI("padding"),b=cI("saturate"),M=cI("scale"),Y=cI("sepia"),G=cI("skew"),F=cI("space"),L=cI("translate"),V=()=>["auto","contain","none"],O=()=>["auto","hidden","clip","visible","scroll"],re=()=>["auto",am,e],Z=()=>[am,e],se=()=>["",kS,i3],ye=()=>["auto",sM,am],xe=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],de=()=>["solid","dashed","dotted","double","none"],Ie=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],_e=()=>["start","end","center","between","around","evenly","stretch"],Ne=()=>["","0",am],Pe=()=>["auto","avoid","all","avoid-page","page","left","right","column"],Le=()=>[sM,am];return{cacheSize:500,separator:":",theme:{colors:[JN],spacing:[kS,i3],blur:["none","",r3,am],brightness:Le(),borderColor:[i],borderRadius:["none","","full",r3,am],borderSpacing:Z(),borderWidth:se(),contrast:Le(),grayscale:Ne(),hueRotate:Le(),invert:Ne(),gap:Z(),gradientColorStops:[i],gradientColorStopPositions:[s0t,i3],inset:re(),margin:re(),opacity:Le(),padding:Z(),saturate:Le(),scale:Le(),sepia:Ne(),skew:Le(),space:Z(),translate:Z()},classGroups:{aspect:[{aspect:["auto","square","video",am]}],container:["container"],columns:[{columns:[r3]}],"break-after":[{"break-after":Pe()}],"break-before":[{"break-before":Pe()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...xe(),am]}],overflow:[{overflow:O()}],"overflow-x":[{"overflow-x":O()}],"overflow-y":[{"overflow-y":O()}],overscroll:[{overscroll:V()}],"overscroll-x":[{"overscroll-x":V()}],"overscroll-y":[{"overscroll-y":V()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[y]}],"inset-x":[{"inset-x":[y]}],"inset-y":[{"inset-y":[y]}],start:[{start:[y]}],end:[{end:[y]}],top:[{top:[y]}],right:[{right:[y]}],bottom:[{bottom:[y]}],left:[{left:[y]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",jN,am]}],basis:[{basis:re()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",am]}],grow:[{grow:Ne()}],shrink:[{shrink:Ne()}],order:[{order:["first","last","none",jN,am]}],"grid-cols":[{"grid-cols":[JN]}],"col-start-end":[{col:["auto",{span:["full",jN,am]},am]}],"col-start":[{"col-start":ye()}],"col-end":[{"col-end":ye()}],"grid-rows":[{"grid-rows":[JN]}],"row-start-end":[{row:["auto",{span:[jN,am]},am]}],"row-start":[{"row-start":ye()}],"row-end":[{"row-end":ye()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",am]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",am]}],gap:[{gap:[d]}],"gap-x":[{"gap-x":[d]}],"gap-y":[{"gap-y":[d]}],"justify-content":[{justify:["normal",..._e()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",..._e(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[..._e(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[E]}],px:[{px:[E]}],py:[{py:[E]}],ps:[{ps:[E]}],pe:[{pe:[E]}],pt:[{pt:[E]}],pr:[{pr:[E]}],pb:[{pb:[E]}],pl:[{pl:[E]}],m:[{m:[_]}],mx:[{mx:[_]}],my:[{my:[_]}],ms:[{ms:[_]}],me:[{me:[_]}],mt:[{mt:[_]}],mr:[{mr:[_]}],mb:[{mb:[_]}],ml:[{ml:[_]}],"space-x":[{"space-x":[F]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[F]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",am,e]}],"min-w":[{"min-w":[am,e,"min","max","fit"]}],"max-w":[{"max-w":[am,e,"none","full","min","max","fit","prose",{screen:[r3]},r3]}],h:[{h:[am,e,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[am,e,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[am,e,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[am,e,"auto","min","max","fit"]}],"font-size":[{text:["base",r3,i3]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",TZ]}],"font-family":[{font:[JN]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",am]}],"line-clamp":[{"line-clamp":["none",sM,TZ]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",kS,am]}],"list-image":[{"list-image":["none",am]}],"list-style-type":[{list:["none","disc","decimal",am]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[i]}],"placeholder-opacity":[{"placeholder-opacity":[v]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[i]}],"text-opacity":[{"text-opacity":[v]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...de(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",kS,i3]}],"underline-offset":[{"underline-offset":["auto",kS,am]}],"text-decoration-color":[{decoration:[i]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:Z()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",am]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",am]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[v]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...xe(),u0t]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",c0t]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},d0t]}],"bg-color":[{bg:[i]}],"gradient-from-pos":[{from:[h]}],"gradient-via-pos":[{via:[h]}],"gradient-to-pos":[{to:[h]}],"gradient-from":[{from:[f]}],"gradient-via":[{via:[f]}],"gradient-to":[{to:[f]}],rounded:[{rounded:[o]}],"rounded-s":[{"rounded-s":[o]}],"rounded-e":[{"rounded-e":[o]}],"rounded-t":[{"rounded-t":[o]}],"rounded-r":[{"rounded-r":[o]}],"rounded-b":[{"rounded-b":[o]}],"rounded-l":[{"rounded-l":[o]}],"rounded-ss":[{"rounded-ss":[o]}],"rounded-se":[{"rounded-se":[o]}],"rounded-ee":[{"rounded-ee":[o]}],"rounded-es":[{"rounded-es":[o]}],"rounded-tl":[{"rounded-tl":[o]}],"rounded-tr":[{"rounded-tr":[o]}],"rounded-br":[{"rounded-br":[o]}],"rounded-bl":[{"rounded-bl":[o]}],"border-w":[{border:[s]}],"border-w-x":[{"border-x":[s]}],"border-w-y":[{"border-y":[s]}],"border-w-s":[{"border-s":[s]}],"border-w-e":[{"border-e":[s]}],"border-w-t":[{"border-t":[s]}],"border-w-r":[{"border-r":[s]}],"border-w-b":[{"border-b":[s]}],"border-w-l":[{"border-l":[s]}],"border-opacity":[{"border-opacity":[v]}],"border-style":[{border:[...de(),"hidden"]}],"divide-x":[{"divide-x":[s]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[s]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[v]}],"divide-style":[{divide:de()}],"border-color":[{border:[r]}],"border-color-x":[{"border-x":[r]}],"border-color-y":[{"border-y":[r]}],"border-color-s":[{"border-s":[r]}],"border-color-e":[{"border-e":[r]}],"border-color-t":[{"border-t":[r]}],"border-color-r":[{"border-r":[r]}],"border-color-b":[{"border-b":[r]}],"border-color-l":[{"border-l":[r]}],"divide-color":[{divide:[r]}],"outline-style":[{outline:["",...de()]}],"outline-offset":[{"outline-offset":[kS,am]}],"outline-w":[{outline:[kS,i3]}],"outline-color":[{outline:[i]}],"ring-w":[{ring:se()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[i]}],"ring-opacity":[{"ring-opacity":[v]}],"ring-offset-w":[{"ring-offset":[kS,i3]}],"ring-offset-color":[{"ring-offset":[i]}],shadow:[{shadow:["","inner","none",r3,f0t]}],"shadow-color":[{shadow:[JN]}],opacity:[{opacity:[v]}],"mix-blend":[{"mix-blend":[...Ie(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":Ie()}],filter:[{filter:["","none"]}],blur:[{blur:[t]}],brightness:[{brightness:[n]}],contrast:[{contrast:[l]}],"drop-shadow":[{"drop-shadow":["","none",r3,am]}],grayscale:[{grayscale:[c]}],"hue-rotate":[{"hue-rotate":[u]}],invert:[{invert:[A]}],saturate:[{saturate:[b]}],sepia:[{sepia:[Y]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[t]}],"backdrop-brightness":[{"backdrop-brightness":[n]}],"backdrop-contrast":[{"backdrop-contrast":[l]}],"backdrop-grayscale":[{"backdrop-grayscale":[c]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[u]}],"backdrop-invert":[{"backdrop-invert":[A]}],"backdrop-opacity":[{"backdrop-opacity":[v]}],"backdrop-saturate":[{"backdrop-saturate":[b]}],"backdrop-sepia":[{"backdrop-sepia":[Y]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[a]}],"border-spacing-x":[{"border-spacing-x":[a]}],"border-spacing-y":[{"border-spacing-y":[a]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",am]}],duration:[{duration:Le()}],ease:[{ease:["linear","in","out","in-out",am]}],delay:[{delay:Le()}],animate:[{animate:["none","spin","ping","pulse","bounce",am]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[M]}],"scale-x":[{"scale-x":[M]}],"scale-y":[{"scale-y":[M]}],rotate:[{rotate:[jN,am]}],"translate-x":[{"translate-x":[L]}],"translate-y":[{"translate-y":[L]}],"skew-x":[{"skew-x":[G]}],"skew-y":[{"skew-y":[G]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",am]}],accent:[{accent:["auto",i]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",am]}],"caret-color":[{caret:[i]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":Z()}],"scroll-mx":[{"scroll-mx":Z()}],"scroll-my":[{"scroll-my":Z()}],"scroll-ms":[{"scroll-ms":Z()}],"scroll-me":[{"scroll-me":Z()}],"scroll-mt":[{"scroll-mt":Z()}],"scroll-mr":[{"scroll-mr":Z()}],"scroll-mb":[{"scroll-mb":Z()}],"scroll-ml":[{"scroll-ml":Z()}],"scroll-p":[{"scroll-p":Z()}],"scroll-px":[{"scroll-px":Z()}],"scroll-py":[{"scroll-py":Z()}],"scroll-ps":[{"scroll-ps":Z()}],"scroll-pe":[{"scroll-pe":Z()}],"scroll-pt":[{"scroll-pt":Z()}],"scroll-pr":[{"scroll-pr":Z()}],"scroll-pb":[{"scroll-pb":Z()}],"scroll-pl":[{"scroll-pl":Z()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",am]}],fill:[{fill:[i,"none"]}],"stroke-w":[{stroke:[kS,i3,TZ]}],stroke:[{stroke:[i,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}});var Aa=typeof window<"u"?window:void 0,YE=typeof globalThis<"u"?globalThis:Aa,Gxe=Array.prototype,Oxe=Gxe.forEach,zxe=Gxe.indexOf,wb=YE==null?void 0:YE.navigator,id=YE==null?void 0:YE.document,VE=YE==null?void 0:YE.location,kZ=YE==null?void 0:YE.fetch,PZ=YE!=null&&YE.XMLHttpRequest&&"withCredentials"in new YE.XMLHttpRequest?YE.XMLHttpRequest:void 0,Hxe=YE==null?void 0:YE.AbortController,KE=wb==null?void 0:wb.userAgent,Kp=Aa??{},PS={DEBUG:!1,LIB_VERSION:"1.257.2"},UZ="$copy_autocapture",y0t=["$snapshot","$pageview","$pageleave","$set","survey dismissed","survey sent","survey shown","$identify","$groupidentify","$create_alias","$$client_ingestion_warning","$web_experiment_applied","$feature_enrollment_update","$feature_flag_called"],US=function(i){return i.GZipJS="gzip-js",i.Base64="base64",i}({}),_0t=["fatal","error","warning","log","info","debug"];function iy(i,e){return i.indexOf(e)!==-1}var oU=function(i){return i.trim()},LZ=function(i){return i.replace(/^\$/,"")},v0t=Array.isArray,Yxe=Object.prototype,Vxe=Yxe.hasOwnProperty,aU=Yxe.toString,wI=v0t||function(i){return aU.call(i)==="[object Array]"},n2=i=>typeof i=="function",uC=i=>i===Object(i)&&!wI(i),cM=i=>{if(uC(i)){for(var e in i)if(Vxe.call(i,e))return!1;return!0}return!1},Gu=i=>i===void 0,AC=i=>aU.call(i)=="[object String]",FZ=i=>AC(i)&&i.trim().length===0,o3=i=>i===null,o_=i=>Gu(i)||o3(i),Kx=i=>aU.call(i)=="[object Number]",EB=i=>aU.call(i)==="[object Boolean]",I0t=i=>i instanceof FormData,C0t=i=>iy(y0t,i),Kxe=i=>{var e={t:function(t){if(Aa&&(PS.DEBUG||Kp.POSTHOG_DEBUG)&&!Gu(Aa.console)&&Aa.console){for(var n=("__rrweb_original__"in Aa.console[t])?Aa.console[t].__rrweb_original__:Aa.console[t],r=arguments.length,o=new Array(r>1?r-1:0),a=1;a<r;a++)o[a-1]=arguments[a];n(i,...o)}},info:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];e.t("log",...n)},warn:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];e.t("warn",...n)},error:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];e.t("error",...n)},critical:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];console.error(i,...n)},uninitializedWarning:t=>{e.error("You must initialize PostHog before calling "+t)},createLogger:t=>Kxe(i+" "+t)};return e},Qd=Kxe("[PostHog.js]"),tx=Qd.createLogger,x0t=tx("[ExternalScriptsLoader]"),jxe=(i,e,t)=>{if(i.config.disable_external_dependency_loading)return x0t.warn(e+" was requested but loading of external scripts is disabled."),t("Loading of external scripts is disabled");var n=id==null?void 0:id.querySelectorAll("script");if(n){for(var r=0;r<n.length;r++)if(n[r].src===e)return t()}var o=()=>{if(!id)return t("document not found");var a=id.createElement("script");if(a.type="text/javascript",a.crossOrigin="anonymous",a.src=e,a.onload=c=>t(void 0,c),a.onerror=c=>t(c),i.config.prepare_external_dependency_script&&(a=i.config.prepare_external_dependency_script(a)),!a)return t("prepare_external_dependency_script returned null");var s,l=id.querySelectorAll("body > script");l.length>0?(s=l[0].parentNode)==null||s.insertBefore(a,l[0]):id.body.appendChild(a)};id!=null&&id.body?o():id==null||id.addEventListener("DOMContentLoaded",o)};function PA(){return PA=Object.assign?Object.assign.bind():function(i){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var n in t)({}).hasOwnProperty.call(t,n)&&(i[n]=t[n])}return i},PA.apply(null,arguments)}function Jxe(i,e){if(i==null)return{};var t={};for(var n in i)if({}.hasOwnProperty.call(i,n)){if(e.indexOf(n)!==-1)continue;t[n]=i[n]}return t}Kp.__PosthogExtensions__=Kp.__PosthogExtensions__||{},Kp.__PosthogExtensions__.loadExternalDependency=(i,e,t)=>{var n="/static/"+e+".js?v="+i.version;if(e==="remote-config"&&(n="/array/"+i.config.token+"/config.js"),e==="toolbar"){var r=3e5;n=n+"&t="+Math.floor(Date.now()/r)*r}var o=i.requestRouter.endpointFor("assets",n);jxe(i,o,t)},Kp.__PosthogExtensions__.loadSiteApp=(i,e,t)=>{var n=i.requestRouter.endpointFor("api",e);jxe(i,n,t)};var sU={};function a3(i,e,t){if(wI(i)){if(Oxe&&i.forEach===Oxe)i.forEach(e,t);else if("length"in i&&i.length===+i.length){for(var n=0,r=i.length;n<r;n++)if(n in i&&e.call(t,i[n],n)===sU)return}}}function nv(i,e,t){if(!o_(i)){if(wI(i))return a3(i,e,t);if(I0t(i)){for(var n of i.entries())if(e.call(t,n[1],n[0])===sU)return}else for(var r in i)if(Vxe.call(i,r)&&e.call(t,i[r],r)===sU)return}}var RC=function(i){for(var e=arguments.length,t=new Array(e>1?e-1:0),n=1;n<e;n++)t[n-1]=arguments[n];return a3(t,function(r){for(var o in r)r[o]!==void 0&&(i[o]=r[o])}),i},lU=function(i){for(var e=arguments.length,t=new Array(e>1?e-1:0),n=1;n<e;n++)t[n-1]=arguments[n];return a3(t,function(r){a3(r,function(o){i.push(o)})}),i};function cU(i){for(var e=Object.keys(i),t=e.length,n=new Array(t);t--;)n[t]=[e[t],i[e[t]]];return n}var qxe=function(i){try{return i()}catch{return}},E0t=function(i){return function(){try{for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return i.apply(this,t)}catch(r){Qd.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),Qd.critical(r)}}},GZ=function(i){var e={};return nv(i,function(t,n){(AC(t)&&t.length>0||Kx(t))&&(e[n]=t)}),e};function b0t(i,e){return t=i,n=o=>AC(o)&&!o3(e)?o.slice(0,e):o,r=new Set,function o(a,s){return a!==Object(a)?n?n(a,s):a:r.has(a)?void 0:(r.add(a),wI(a)?(l=[],a3(a,c=>{l.push(o(c))})):(l={},nv(a,(c,u)=>{r.has(c)||(l[u]=o(c,u))})),l);var l}(t);var t,n,r}var B0t=["herokuapp.com","vercel.app","netlify.app"];function S0t(i){var e=i==null?void 0:i.hostname;if(!AC(e))return!1;var t=e.split(".").slice(-2).join(".");for(var n of B0t)if(t===n)return!1;return!0}function Zxe(i,e){for(var t=0;t<i.length;t++)if(e(i[t]))return i[t]}function LI(i,e,t,n){var{capture:r=!1,passive:o=!0}=n??{};i==null||i.addEventListener(e,t,{capture:r,passive:o})}var Xxe="$people_distinct_id",qN="__alias",ZN="__timers",Wxe="$autocapture_disabled_server_side",OZ="$heatmaps_enabled_server_side",$xe="$exception_capture_enabled_server_side",zZ="$error_tracking_suppression_rules",eEe="$web_vitals_enabled_server_side",tEe="$dead_clicks_enabled_server_side",nEe="$web_vitals_allowed_metrics",HZ="$session_recording_enabled_server_side",iEe="$console_log_recording_enabled_server_side",rEe="$session_recording_network_payload_capture",oEe="$session_recording_masking",aEe="$session_recording_canvas_recording",sEe="$replay_sample_rate",lEe="$replay_minimum_duration",cEe="$replay_script_config",uU="$sesid",XN="$session_is_sampled",YZ="$session_recording_url_trigger_activated_session",VZ="$session_recording_event_trigger_activated_session",uM="$enabled_feature_flags",AU="$early_access_features",KZ="$feature_flag_details",WN="$stored_person_properties",Ow="$stored_group_properties",jZ="$surveys",dU="$surveys_activated",fU="$flag_call_reported",LS="$user_state",JZ="$client_session_props",qZ="$capture_rate_limit",ZZ="$initial_campaign_params",XZ="$initial_referrer_info",hU="$initial_person_info",pU="$epp",uEe="__POSTHOG_TOOLBAR__",gU="$posthog_cookieless",w0t=[Xxe,qN,"__cmpns",ZN,HZ,OZ,uU,uM,zZ,LS,AU,KZ,Ow,WN,jZ,fU,JZ,qZ,ZZ,XZ,pU,hU];function AEe(i){return i instanceof Element&&(i.id===uEe||!(i.closest==null||!i.closest(".toolbar-global-fade-container")))}function mU(i){return!!i&&i.nodeType===1}function s3(i,e){return!!i&&!!i.tagName&&i.tagName.toLowerCase()===e.toLowerCase()}function dEe(i){return!!i&&i.nodeType===3}function fEe(i){return!!i&&i.nodeType===11}function WZ(i){return i?oU(i).split(/\s+/):[]}function hEe(i){var e=Aa==null?void 0:Aa.location.href;return!!(e&&i&&i.some(t=>e.match(t)))}function yU(i){var e="";switch(typeof i.className){case"string":e=i.className;break;case"object":e=(i.className&&"baseVal"in i.className?i.className.baseVal:null)||i.getAttribute("class")||"";break;default:e=""}return WZ(e)}function pEe(i){return o_(i)?null:oU(i).split(/(\s+)/).filter(e=>AM(e)).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function _U(i){var e="";return eX(i)&&!yEe(i)&&i.childNodes&&i.childNodes.length&&nv(i.childNodes,function(t){var n;dEe(t)&&t.textContent&&(e+=(n=pEe(t.textContent))!==null&&n!==void 0?n:"")}),oU(e)}function gEe(i){return Gu(i.target)?i.srcElement||null:(e=i.target)!=null&&e.shadowRoot?i.composedPath()[0]||null:i.target||null;var e}var $Z=["a","button","form","input","select","textarea","label"];function mEe(i){var e=i.parentNode;return!(!e||!mU(e))&&e}function Q0t(i,e,t,n,r){var o,a,s;if(t===void 0&&(t=void 0),!Aa||!i||s3(i,"html")||!mU(i)||(o=t)!=null&&o.url_allowlist&&!hEe(t.url_allowlist)||(a=t)!=null&&a.url_ignorelist&&hEe(t.url_ignorelist))return!1;if((s=t)!=null&&s.dom_event_allowlist){var l=t.dom_event_allowlist;if(l&&!l.some(_=>e.type===_))return!1}for(var c=!1,u=[i],A=!0,d=i;d.parentNode&&!s3(d,"body");)if(fEe(d.parentNode))u.push(d.parentNode.host),d=d.parentNode.host;else{if(!(A=mEe(d)))break;if(n||$Z.indexOf(A.tagName.toLowerCase())>-1)c=!0;else{var f=Aa.getComputedStyle(A);f&&f.getPropertyValue("cursor")==="pointer"&&(c=!0)}u.push(A),d=A}if(!function(_,v){var E=v==null?void 0:v.element_allowlist;if(Gu(E))return!0;var b,M=function(G){if(E.some(F=>G.tagName.toLowerCase()===F))return{v:!0}};for(var Y of _)if(b=M(Y))return b.v;return!1}(u,t)||!function(_,v){var E=v==null?void 0:v.css_selector_allowlist;if(Gu(E))return!0;var b,M=function(G){if(E.some(F=>G.matches(F)))return{v:!0}};for(var Y of _)if(b=M(Y))return b.v;return!1}(u,t))return!1;var h=Aa.getComputedStyle(i);if(h&&h.getPropertyValue("cursor")==="pointer"&&e.type==="click")return!0;var y=i.tagName.toLowerCase();switch(y){case"html":return!1;case"form":return(r||["submit"]).indexOf(e.type)>=0;case"input":case"select":case"textarea":return(r||["change","click"]).indexOf(e.type)>=0;default:return c?(r||["click"]).indexOf(e.type)>=0:(r||["click"]).indexOf(e.type)>=0&&($Z.indexOf(y)>-1||i.getAttribute("contenteditable")==="true")}}function eX(i){for(var e=i;e.parentNode&&!s3(e,"body");e=e.parentNode){var t=yU(e);if(iy(t,"ph-sensitive")||iy(t,"ph-no-capture"))return!1}if(iy(yU(i),"ph-include"))return!0;var n=i.type||"";if(AC(n))switch(n.toLowerCase()){case"hidden":case"password":return!1}var r=i.name||i.id||"";return!(AC(r)&&/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(r.replace(/[^a-zA-Z0-9]/g,"")))}function yEe(i){return!!(s3(i,"input")&&!["button","checkbox","submit","reset"].includes(i.type)||s3(i,"select")||s3(i,"textarea")||i.getAttribute("contenteditable")==="true")}var _Ee="(4[0-9]{12}(?:[0-9]{3})?)|(5[1-5][0-9]{14})|(6(?:011|5[0-9]{2})[0-9]{12})|(3[47][0-9]{13})|(3(?:0[0-5]|[68][0-9])[0-9]{11})|((?:2131|1800|35[0-9]{3})[0-9]{11})",M0t=new RegExp("^(?:"+_Ee+")$"),R0t=new RegExp(_Ee),vEe="\\d{3}-?\\d{2}-?\\d{4}",D0t=new RegExp("^("+vEe+")$"),N0t=new RegExp("("+vEe+")");function AM(i,e){return e===void 0&&(e=!0),!(o_(i)||AC(i)&&(i=oU(i),(e?M0t:R0t).test((i||"").replace(/[- ]/g,""))||(e?D0t:N0t).test(i)))}function IEe(i){var e=_U(i);return AM(e=(e+" "+CEe(i)).trim())?e:""}function CEe(i){var e="";return i&&i.childNodes&&i.childNodes.length&&nv(i.childNodes,function(t){var n;if(t&&((n=t.tagName)==null?void 0:n.toLowerCase())==="span")try{var r=_U(t);e=(e+" "+r).trim(),t.childNodes&&t.childNodes.length&&(e=(e+" "+CEe(t)).trim())}catch(o){Qd.error("[AutoCapture]",o)}}),e}function T0t(i){return function(e){var t=e.map(n=>{var r,o,a="";if(n.tag_name&&(a+=n.tag_name),n.attr_class)for(var s of(n.attr_class.sort(),n.attr_class))a+="."+s.replace(/"/g,"");var l=PA({},n.text?{text:n.text}:{},{"nth-child":(r=n.nth_child)!==null&&r!==void 0?r:0,"nth-of-type":(o=n.nth_of_type)!==null&&o!==void 0?o:0},n.href?{href:n.href}:{},n.attr_id?{attr_id:n.attr_id}:{},n.attributes),c={};return cU(l).sort((u,A)=>{var[d]=u,[f]=A;return d.localeCompare(f)}).forEach(u=>{var[A,d]=u;return c[xEe(A.toString())]=xEe(d.toString())}),a+=":",a+=cU(c).map(u=>{var[A,d]=u;return A+'="'+d+'"'}).join("")});return t.join(";")}(function(e){return e.map(t=>{var n,r,o={text:(n=t.$el_text)==null?void 0:n.slice(0,400),tag_name:t.tag_name,href:(r=t.attr__href)==null?void 0:r.slice(0,2048),attr_class:k0t(t),attr_id:t.attr__id,nth_child:t.nth_child,nth_of_type:t.nth_of_type,attributes:{}};return cU(t).filter(a=>{var[s]=a;return s.indexOf("attr__")===0}).forEach(a=>{var[s,l]=a;return o.attributes[s]=l}),o})}(i))}function xEe(i){return i.replace(/"|\\"/g,'\\"')}function k0t(i){var e=i.attr__class;return e?wI(e)?e:WZ(e):void 0}class EEe{constructor(){this.clicks=[]}isRageClick(e,t,n){var r=this.clicks[this.clicks.length-1];if(r&&Math.abs(e-r.x)+Math.abs(t-r.y)<30&&n-r.timestamp<1e3){if(this.clicks.push({x:e,y:t,timestamp:n}),this.clicks.length===3)return!0}else this.clicks=[{x:e,y:t,timestamp:n}];return!1}}var P0t=["localhost","127.0.0.1"],dM=i=>{var e=id==null?void 0:id.createElement("a");return Gu(e)?null:(e.href=i,e)},U0t=function(i,e){var t,n;e===void 0&&(e="&");var r=[];return nv(i,function(o,a){Gu(o)||Gu(a)||a==="undefined"||(t=encodeURIComponent((s=>s instanceof File)(o)?o.name:o.toString()),n=encodeURIComponent(a),r[r.length]=n+"="+t)}),r.join(e)},vU=function(i,e){for(var t,n=((i.split("#")[0]||"").split(/\?(.*)/)[1]||"").replace(/^\?+/g,"").split("&"),r=0;r<n.length;r++){var o=n[r].split("=");if(o[0]===e){t=o;break}}if(!wI(t)||t.length<2)return"";var a=t[1];try{a=decodeURIComponent(a)}catch{Qd.error("Skipping decoding for malformed query param: "+a)}return a.replace(/\+/g," ")},tX=function(i,e,t){if(!i||!e||!e.length)return i;for(var n=i.split("#"),r=n[0]||"",o=n[1],a=r.split("?"),s=a[1],l=a[0],c=(s||"").split("&"),u=[],A=0;A<c.length;A++){var d=c[A].split("=");wI(d)&&(e.includes(d[0])?u.push(d[0]+"="+t):u.push(c[A]))}var f=l;return s!=null&&(f+="?"+u.join("&")),o!=null&&(f+="#"+o),f},IU=function(i,e){var t=i.match(new RegExp(e+"=([^&]*)"));return t?t[1]:null},bEe=tx("[AutoCapture]");function nX(i,e){return e.length>i?e.slice(0,i)+"...":e}function L0t(i){if(i.previousElementSibling)return i.previousElementSibling;var e=i;do e=e.previousSibling;while(e&&!mU(e));return e}function F0t(i,e,t,n){var r=i.tagName.toLowerCase(),o={tag_name:r};$Z.indexOf(r)>-1&&!t&&(r.toLowerCase()==="a"||r.toLowerCase()==="button"?o.$el_text=nX(1024,IEe(i)):o.$el_text=nX(1024,_U(i)));var a=yU(i);a.length>0&&(o.classes=a.filter(function(u){return u!==""})),nv(i.attributes,function(u){var A;if((!yEe(i)||["name","id","class","aria-label"].indexOf(u.name)!==-1)&&(n==null||!n.includes(u.name))&&!e&&AM(u.value)&&(A=u.name,!AC(A)||A.substring(0,10)!=="_ngcontent"&&A.substring(0,7)!=="_nghost")){var d=u.value;u.name==="class"&&(d=WZ(d).join(" ")),o["attr__"+u.name]=nX(1024,d)}});for(var s=1,l=1,c=i;c=L0t(c);)s++,c.tagName===i.tagName&&l++;return o.nth_child=s,o.nth_of_type=l,o}function G0t(i,e){for(var t,n,{e:r,maskAllElementAttributes:o,maskAllText:a,elementAttributeIgnoreList:s,elementsChainAsString:l}=e,c=[i],u=i;u.parentNode&&!s3(u,"body");)fEe(u.parentNode)?(c.push(u.parentNode.host),u=u.parentNode.host):(c.push(u.parentNode),u=u.parentNode);var A,d=[],f={},h=!1,y=!1;if(nv(c,M=>{var Y=eX(M);M.tagName.toLowerCase()==="a"&&(h=M.getAttribute("href"),h=Y&&h&&AM(h)&&h),iy(yU(M),"ph-no-capture")&&(y=!0),d.push(F0t(M,o,a,s));var G=function(F){if(!eX(F))return{};var L={};return nv(F.attributes,function(V){if(V.name&&V.name.indexOf("data-ph-capture-attribute")===0){var O=V.name.replace("data-ph-capture-attribute-",""),re=V.value;O&&re&&AM(re)&&(L[O]=re)}}),L}(M);RC(f,G)}),y)return{props:{},explicitNoCapture:y};if(a||(i.tagName.toLowerCase()==="a"||i.tagName.toLowerCase()==="button"?d[0].$el_text=IEe(i):d[0].$el_text=_U(i)),h){var _,v;d[0].attr__href=h;var E=(_=dM(h))==null?void 0:_.host,b=Aa==null||(v=Aa.location)==null?void 0:v.host;E&&b&&E!==b&&(A=h)}return{props:RC({$event_type:r.type,$ce_version:1},l?{}:{$elements:d},{$elements_chain:T0t(d)},(t=d[0])!=null&&t.$el_text?{$el_text:(n=d[0])==null?void 0:n.$el_text}:{},A&&r.type==="click"?{$external_click_url:A}:{},f)}}class O0t{constructor(e){this.i=!1,this.o=null,this.rageclicks=new EEe,this.h=!1,this.instance=e,this.m=null}get S(){var e,t,n=uC(this.instance.config.autocapture)?this.instance.config.autocapture:{};return n.url_allowlist=(e=n.url_allowlist)==null?void 0:e.map(r=>new RegExp(r)),n.url_ignorelist=(t=n.url_ignorelist)==null?void 0:t.map(r=>new RegExp(r)),n}$(){if(this.isBrowserSupported()){if(Aa&&id){var e=n=>{n=n||(Aa==null?void 0:Aa.event);try{this.k(n)}catch(r){bEe.error("Failed to capture event",r)}};if(LI(id,"submit",e,{capture:!0}),LI(id,"change",e,{capture:!0}),LI(id,"click",e,{capture:!0}),this.S.capture_copied_text){var t=n=>{n=n||(Aa==null?void 0:Aa.event),this.k(n,UZ)};LI(id,"copy",t,{capture:!0}),LI(id,"cut",t,{capture:!0})}}}else bEe.info("Disabling Automatic Event Collection because this browser is not supported")}startIfEnabled(){this.isEnabled&&!this.i&&(this.$(),this.i=!0)}onRemoteConfig(e){e.elementsChainAsString&&(this.h=e.elementsChainAsString),this.instance.persistence&&this.instance.persistence.register({[Wxe]:!!e.autocapture_opt_out}),this.o=!!e.autocapture_opt_out,this.startIfEnabled()}setElementSelectors(e){this.m=e}getElementSelectors(e){var t,n=[];return(t=this.m)==null||t.forEach(r=>{var o=id==null?void 0:id.querySelectorAll(r);o==null||o.forEach(a=>{e===a&&n.push(r)})}),n}get isEnabled(){var e,t,n=(e=this.instance.persistence)==null?void 0:e.props[Wxe],r=this.o;if(o3(r)&&!EB(n)&&!this.instance.I())return!1;var o=(t=this.o)!==null&&t!==void 0?t:!!n;return!!this.instance.config.autocapture&&!o}k(e,t){if(t===void 0&&(t="$autocapture"),this.isEnabled){var n,r=gEe(e);dEe(r)&&(r=r.parentNode||null),t==="$autocapture"&&e.type==="click"&&e instanceof MouseEvent&&this.instance.config.rageclick&&(n=this.rageclicks)!=null&&n.isRageClick(e.clientX,e.clientY,new Date().getTime())&&this.k(e,"$rageclick");var o=t===UZ;if(r&&Q0t(r,e,this.S,o,o?["copy","cut"]:void 0)){var{props:a,explicitNoCapture:s}=G0t(r,{e,maskAllElementAttributes:this.instance.config.mask_all_element_attributes,maskAllText:this.instance.config.mask_all_text,elementAttributeIgnoreList:this.S.element_attribute_ignorelist,elementsChainAsString:this.h});if(s)return!1;var l=this.getElementSelectors(r);if(l&&l.length>0&&(a.$element_selectors=l),t===UZ){var c,u=pEe(Aa==null||(c=Aa.getSelection())==null?void 0:c.toString()),A=e.type||"clipboard";if(!u)return!1;a.$selected_content=u,a.$copy_type=A}return this.instance.capture(t,a),!0}}}isBrowserSupported(){return n2(id==null?void 0:id.querySelectorAll)}}Math.trunc||(Math.trunc=function(i){return i<0?Math.ceil(i):Math.floor(i)}),Number.isInteger||(Number.isInteger=function(i){return Kx(i)&&isFinite(i)&&Math.floor(i)===i});var BEe="0123456789abcdef";class CU{constructor(e){if(this.bytes=e,e.length!==16)throw new TypeError("not 128-bit length")}static fromFieldsV7(e,t,n,r){if(!Number.isInteger(e)||!Number.isInteger(t)||!Number.isInteger(n)||!Number.isInteger(r)||e<0||t<0||n<0||r<0||e>0xffffffffffff||t>4095||n>1073741823||r>4294967295)throw new RangeError("invalid field value");var o=new Uint8Array(16);return o[0]=e/Math.pow(2,40),o[1]=e/Math.pow(2,32),o[2]=e/Math.pow(2,24),o[3]=e/Math.pow(2,16),o[4]=e/Math.pow(2,8),o[5]=e,o[6]=112|t>>>8,o[7]=t,o[8]=128|n>>>24,o[9]=n>>>16,o[10]=n>>>8,o[11]=n,o[12]=r>>>24,o[13]=r>>>16,o[14]=r>>>8,o[15]=r,new CU(o)}toString(){for(var e="",t=0;t<this.bytes.length;t++)e=e+BEe.charAt(this.bytes[t]>>>4)+BEe.charAt(15&this.bytes[t]),t!==3&&t!==5&&t!==7&&t!==9||(e+="-");if(e.length!==36)throw new Error("Invalid UUIDv7 was generated");return e}clone(){return new CU(this.bytes.slice(0))}equals(e){return this.compareTo(e)===0}compareTo(e){for(var t=0;t<16;t++){var n=this.bytes[t]-e.bytes[t];if(n!==0)return Math.sign(n)}return 0}}class z0t{constructor(){this.P=0,this.R=0,this.T=new H0t}generate(){var e=this.generateOrAbort();if(Gu(e)){this.P=0;var t=this.generateOrAbort();if(Gu(t))throw new Error("Could not generate UUID after timestamp reset");return t}return e}generateOrAbort(){var e=Date.now();if(e>this.P)this.P=e,this.M();else{if(!(e+1e4>this.P))return;this.R++,this.R>4398046511103&&(this.P++,this.M())}return CU.fromFieldsV7(this.P,Math.trunc(this.R/Math.pow(2,30)),this.R&Math.pow(2,30)-1,this.T.nextUint32())}M(){this.R=1024*this.T.nextUint32()+(1023&this.T.nextUint32())}}var SEe,wEe=i=>{if(typeof UUIDV7_DENY_WEAK_RNG<"u"&&UUIDV7_DENY_WEAK_RNG)throw new Error("no cryptographically strong RNG available");for(var e=0;e<i.length;e++)i[e]=65536*Math.trunc(65536*Math.random())+Math.trunc(65536*Math.random());return i};Aa&&!Gu(Aa.crypto)&&crypto.getRandomValues&&(wEe=i=>crypto.getRandomValues(i));class H0t{constructor(){this.C=new Uint32Array(8),this.F=1/0}nextUint32(){return this.F>=this.C.length&&(wEe(this.C),this.F=0),this.C[this.F++]}}var l3=()=>Y0t().toString(),Y0t=()=>(SEe||(SEe=new z0t)).generate(),$N="",V0t=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i;function K0t(i,e){if(e){var t=function(r,o){if(o===void 0&&(o=id),$N)return $N;if(!o||["localhost","127.0.0.1"].includes(r))return"";for(var a=r.split("."),s=Math.min(a.length,8),l="dmn_chk_"+l3();!$N&&s--;){var c=a.slice(s).join("."),u=l+"=1;domain=."+c+";path=/";o.cookie=u+";max-age=3",o.cookie.includes(l)&&(o.cookie=u+";max-age=0",$N=c)}return $N}(i);if(!t){var n=(r=>{var o=r.match(V0t);return o?o[0]:""})(i);n!==t&&Qd.info("Warning: cookie subdomain discovery mismatch",n,t),t=n}return t?"; domain=."+t:""}return""}var bB={O:()=>!!id,A:function(i){Qd.error("cookieStore error: "+i)},D:function(i){if(id){try{for(var e=i+"=",t=id.cookie.split(";").filter(o=>o.length),n=0;n<t.length;n++){for(var r=t[n];r.charAt(0)==" ";)r=r.substring(1,r.length);if(r.indexOf(e)===0)return decodeURIComponent(r.substring(e.length,r.length))}}catch{}return null}},L:function(i){var e;try{e=JSON.parse(bB.D(i))||{}}catch{}return e},j:function(i,e,t,n,r){if(id)try{var o="",a="",s=K0t(id.location.hostname,n);if(t){var l=new Date;l.setTime(l.getTime()+24*t*60*60*1e3),o="; expires="+l.toUTCString()}r&&(a="; secure");var c=i+"="+encodeURIComponent(JSON.stringify(e))+o+"; SameSite=Lax; path=/"+s+a;return c.length>3686.4&&Qd.warn("cookieStore warning: large cookie, len="+c.length),id.cookie=c,c}catch{return}},N:function(i,e){try{bB.j(i,"",-1,e)}catch{return}}},iX=null,y9={O:function(){if(!o3(iX))return iX;var i=!0;if(Gu(Aa))i=!1;else try{var e="__mplssupport__";y9.j(e,"xyz"),y9.D(e)!=='"xyz"'&&(i=!1),y9.N(e)}catch{i=!1}return i||Qd.error("localStorage unsupported; falling back to cookie store"),iX=i,i},A:function(i){Qd.error("localStorage error: "+i)},D:function(i){try{return Aa==null?void 0:Aa.localStorage.getItem(i)}catch(e){y9.A(e)}return null},L:function(i){try{return JSON.parse(y9.D(i))||{}}catch{}return null},j:function(i,e){try{Aa==null||Aa.localStorage.setItem(i,JSON.stringify(e))}catch(t){y9.A(t)}},N:function(i){try{Aa==null||Aa.localStorage.removeItem(i)}catch(e){y9.A(e)}}},j0t=["distinct_id",uU,XN,pU,hU],xU=PA({},y9,{L:function(i){try{var e={};try{e=bB.L(i)||{}}catch{}var t=RC(e,JSON.parse(y9.D(i)||"{}"));return y9.j(i,t),t}catch{}return null},j:function(i,e,t,n,r,o){try{y9.j(i,e,void 0,void 0,o);var a={};j0t.forEach(s=>{e[s]&&(a[s]=e[s])}),Object.keys(a).length&&bB.j(i,a,t,n,r,o)}catch(s){y9.A(s)}},N:function(i,e){try{Aa==null||Aa.localStorage.removeItem(i),bB.N(i,e)}catch(t){y9.A(t)}}}),EU={},J0t={O:function(){return!0},A:function(i){Qd.error("memoryStorage error: "+i)},D:function(i){return EU[i]||null},L:function(i){return EU[i]||null},j:function(i,e){EU[i]=e},N:function(i){delete EU[i]}},zw=null,mx={O:function(){if(!o3(zw))return zw;if(zw=!0,Gu(Aa))zw=!1;else try{var i="__support__";mx.j(i,"xyz"),mx.D(i)!=='"xyz"'&&(zw=!1),mx.N(i)}catch{zw=!1}return zw},A:function(i){Qd.error("sessionStorage error: ",i)},D:function(i){try{return Aa==null?void 0:Aa.sessionStorage.getItem(i)}catch(e){mx.A(e)}return null},L:function(i){try{return JSON.parse(mx.D(i))||null}catch{}return null},j:function(i,e){try{Aa==null||Aa.sessionStorage.setItem(i,JSON.stringify(e))}catch(t){mx.A(t)}},N:function(i){try{Aa==null||Aa.sessionStorage.removeItem(i)}catch(e){mx.A(e)}}},fM=function(i){return i[i.PENDING=-1]="PENDING",i[i.DENIED=0]="DENIED",i[i.GRANTED=1]="GRANTED",i}({});class q0t{constructor(e){this._instance=e}get S(){return this._instance.config}get consent(){return this.U()?fM.DENIED:this.q}isOptedOut(){return this.consent===fM.DENIED||this.consent===fM.PENDING&&this.S.opt_out_capturing_by_default}isOptedIn(){return!this.isOptedOut()}optInOut(e){this.B.j(this.H,e?1:0,this.S.cookie_expiration,this.S.cross_subdomain_cookie,this.S.secure_cookie)}reset(){this.B.N(this.H,this.S.cross_subdomain_cookie)}get H(){var{token:e,opt_out_capturing_cookie_prefix:t}=this._instance.config;return(t||"__ph_opt_in_out_")+e}get q(){var e=this.B.D(this.H);return e==="1"?fM.GRANTED:e==="0"?fM.DENIED:fM.PENDING}get B(){if(!this.W){var e=this.S.opt_out_capturing_persistence_type;this.W=e==="localStorage"?y9:bB;var t=e==="localStorage"?bB:y9;t.D(this.H)&&(this.W.D(this.H)||this.optInOut(t.D(this.H)==="1"),t.N(this.H,this.S.cross_subdomain_cookie))}return this.W}U(){return!!this.S.respect_dnt&&!!Zxe([wb==null?void 0:wb.doNotTrack,wb==null?void 0:wb.msDoNotTrack,Kp.doNotTrack],e=>iy([!0,1,"1","yes"],e))}}var bU=tx("[Dead Clicks]"),Z0t=()=>!0,X0t=i=>{var e,t=!((e=i.instance.persistence)==null||!e.get_property(tEe)),n=i.instance.config.capture_dead_clicks;return EB(n)?n:t};class QEe{get lazyLoadedDeadClicksAutocapture(){return this.G}constructor(e,t,n){this.instance=e,this.isEnabled=t,this.onCapture=n,this.startIfEnabled()}onRemoteConfig(e){this.instance.persistence&&this.instance.persistence.register({[tEe]:e==null?void 0:e.captureDeadClicks}),this.startIfEnabled()}startIfEnabled(){this.isEnabled(this)&&this.J(()=>{this.V()})}J(e){var t,n;(t=Kp.__PosthogExtensions__)!=null&&t.initDeadClicksAutocapture&&e(),(n=Kp.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this.instance,"dead-clicks-autocapture",r=>{r?bU.error("failed to load script",r):e()})}V(){var e;if(id){if(!this.G&&(e=Kp.__PosthogExtensions__)!=null&&e.initDeadClicksAutocapture){var t=uC(this.instance.config.capture_dead_clicks)?this.instance.config.capture_dead_clicks:{};t.__onCapture=this.onCapture,this.G=Kp.__PosthogExtensions__.initDeadClicksAutocapture(this.instance,t),this.G.start(id),bU.info("starting...")}}else bU.error("`document` not found. Cannot start.")}stop(){this.G&&(this.G.stop(),this.G=void 0,bU.info("stopping..."))}}function Qb(i,e,t,n,r){return e>t&&(Qd.warn("min cannot be greater than max."),e=t),Kx(i)?i>t?(n&&Qd.warn(n+" cannot be greater than max: "+t+". Using max value instead."),t):i<e?(n&&Qd.warn(n+" cannot be less than min: "+e+". Using min value instead."),e):i:(n&&Qd.warn(n+" must be a number. using max or fallback. max: "+t+", fallback: "+r),Qb(r||t,e,t,n))}class MEe{constructor(e){this.K={},this.Y=()=>{Object.keys(this.K).forEach(t=>{var n=this.X(t)+this.Z;n>=this.tt?delete this.K[t]:this.it(t,n)})},this.X=t=>this.K[String(t)],this.it=(t,n)=>{this.K[String(t)]=n},this.consumeRateLimit=t=>{var n,r=(n=this.X(t))!==null&&n!==void 0?n:this.tt;if((r=Math.max(r-1,0))===0)return!0;this.it(t,r);var o,a=r===0;return a&&((o=this.et)==null||o.call(this,t)),a},this.rt=e,this.et=this.rt.et,this.tt=Qb(this.rt.bucketSize,0,100,"rate limiter bucket size"),this.Z=Qb(this.rt.refillRate,0,this.tt,"rate limiter refill rate"),this.st=Qb(this.rt.refillInterval,0,864e5,"rate limiter refill interval"),setInterval(()=>{this.Y()},this.st)}}var BU=tx("[ExceptionAutocapture]");class W0t{constructor(e){var t,n,r;this.nt=()=>{var o;if(Aa&&this.isEnabled&&(o=Kp.__PosthogExtensions__)!=null&&o.errorWrappingFunctions){var a=Kp.__PosthogExtensions__.errorWrappingFunctions.wrapOnError,s=Kp.__PosthogExtensions__.errorWrappingFunctions.wrapUnhandledRejection,l=Kp.__PosthogExtensions__.errorWrappingFunctions.wrapConsoleError;try{!this.ot&&this.S.capture_unhandled_errors&&(this.ot=a(this.captureException.bind(this))),!this.lt&&this.S.capture_unhandled_rejections&&(this.lt=s(this.captureException.bind(this))),!this.ut&&this.S.capture_console_errors&&(this.ut=l(this.captureException.bind(this)))}catch(c){BU.error("failed to start",c),this.ht()}}},this._instance=e,this.dt=!((t=this._instance.persistence)==null||!t.props[$xe]),this.S=this.vt(),this.ct=new MEe({refillRate:(n=this._instance.config.error_tracking.__exceptionRateLimiterRefillRate)!==null&&n!==void 0?n:1,bucketSize:(r=this._instance.config.error_tracking.__exceptionRateLimiterBucketSize)!==null&&r!==void 0?r:10,refillInterval:1e4}),this.startIfEnabled()}vt(){var e=this._instance.config.capture_exceptions,t={capture_unhandled_errors:!1,capture_unhandled_rejections:!1,capture_console_errors:!1};return uC(e)?t=PA({},t,e):(Gu(e)?this.dt:e)&&(t=PA({},t,{capture_unhandled_errors:!0,capture_unhandled_rejections:!0})),t}get isEnabled(){return this.S.capture_console_errors||this.S.capture_unhandled_errors||this.S.capture_unhandled_rejections}startIfEnabled(){this.isEnabled&&(BU.info("enabled"),this.J(this.nt))}J(e){var t,n;(t=Kp.__PosthogExtensions__)!=null&&t.errorWrappingFunctions&&e(),(n=Kp.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this._instance,"exception-autocapture",r=>{if(r)return BU.error("failed to load script",r);e()})}ht(){var e,t,n;(e=this.ot)==null||e.call(this),this.ot=void 0,(t=this.lt)==null||t.call(this),this.lt=void 0,(n=this.ut)==null||n.call(this),this.ut=void 0}onRemoteConfig(e){var t=e.autocaptureExceptions;this.dt=!!t||!1,this.S=this.vt(),this._instance.persistence&&this._instance.persistence.register({[$xe]:this.dt}),this.startIfEnabled()}captureException(e){var t,n=this._instance.requestRouter.endpointFor("ui");e.$exception_personURL=n+"/project/"+this._instance.config.token+"/person/"+this._instance.get_distinct_id();var r=(t=e.$exception_list[0].type)!==null&&t!==void 0?t:"Exception";this.ct.consumeRateLimit(r)?BU.info("Skipping exception capture because of client rate limiting.",{exception:e.$exception_list[0].type}):this._instance.exceptions.sendExceptionEvent(e)}}function REe(i){return!Gu(Event)&&DEe(i,Event)}function DEe(i,e){try{return i instanceof e}catch{return!1}}function NEe(i){switch(Object.prototype.toString.call(i)){case"[object Error]":case"[object Exception]":case"[object DOMException]":case"[object DOMError]":return!0;default:return DEe(i,Error)}}function SU(i,e){return Object.prototype.toString.call(i)==="[object "+e+"]"}function rX(i){return SU(i,"DOMError")}var TEe=/\(error: (.*)\)/,kEe=50,hM="?";function oX(i,e,t,n){var r={platform:"web:javascript",filename:i,function:e==="<anonymous>"?hM:e,in_app:!0};return Gu(t)||(r.lineno=t),Gu(n)||(r.colno=n),r}var $0t=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,ept=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,tpt=/\((\S*)(?::(\d+))(?::(\d+))\)/,npt=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,ipt=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,rpt=function(){for(var i=arguments.length,e=new Array(i),t=0;t<i;t++)e[t]=arguments[t];var n=e.sort((r,o)=>r[0]-o[0]).map(r=>r[1]);return function(r,o){o===void 0&&(o=0);for(var a=[],s=r.split(`
242
242
  `),l=o;l<s.length;l++){var c=s[l];if(!(c.length>1024)){var u=TEe.test(c)?c.replace(TEe,"$1"):c;if(!u.match(/\S*Error: /)){for(var A of n){var d=A(u);if(d){a.push(d);break}}if(a.length>=kEe)break}}}return function(f){if(!f.length)return[];var h=Array.from(f);return h.reverse(),h.slice(0,kEe).map(y=>PA({},y,{filename:y.filename||opt(h).filename,function:y.function||hM}))}(a)}}([30,i=>{var e=$0t.exec(i);if(e){var[,t,n,r]=e;return oX(t,hM,+n,+r)}var o=ept.exec(i);if(o){if(o[2]&&o[2].indexOf("eval")===0){var a=tpt.exec(o[2]);a&&(o[2]=a[1],o[3]=a[2],o[4]=a[3])}var[s,l]=UEe(o[1]||hM,o[2]);return oX(l,s,o[3]?+o[3]:void 0,o[4]?+o[4]:void 0)}}],[50,i=>{var e=npt.exec(i);if(e){if(e[3]&&e[3].indexOf(" > eval")>-1){var t=ipt.exec(e[3]);t&&(e[1]=e[1]||"eval",e[3]=t[1],e[4]=t[2],e[5]="")}var n=e[3],r=e[1]||hM;return[r,n]=UEe(r,n),oX(n,r,e[4]?+e[4]:void 0,e[5]?+e[5]:void 0)}}]);function opt(i){return i[i.length-1]||{}}var wU,PEe,aX,UEe=(i,e)=>{var t=i.indexOf("safari-extension")!==-1,n=i.indexOf("safari-web-extension")!==-1;return t||n?[i.indexOf("@")!==-1?i.split("@")[0]:hM,t?"safari-extension:"+e:"safari-web-extension:"+e]:[i,e]},apt=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;function sX(i,e){e===void 0&&(e=0);var t=i.stacktrace||i.stack||"",n=function(a){return a&&spt.test(a.message)?1:0}(i);try{var r=rpt,o=function(a,s){var l=function(c){var u=globalThis._posthogChunkIds;if(!u)return{};var A=Object.keys(u);return aX&&A.length===PEe||(PEe=A.length,aX=A.reduce((d,f)=>{wU||(wU={});var h=wU[f];if(h)d[h[0]]=h[1];else for(var y=c(f),_=y.length-1;_>=0;_--){var v=y[_],E=v==null?void 0:v.filename,b=u[f];if(E&&b){d[E]=b,wU[f]=[E,b];break}}return d},{})),aX}(s);return a.forEach(c=>{c.filename&&(c.chunk_id=l[c.filename])}),a}(r(t,n),r);return o.slice(0,o.length-e)}catch{}return[]}var spt=/Minified React error #\d+;/i;function lpt(i,e){var t,n,r=sX(i),o=(t=e==null?void 0:e.handled)===null||t===void 0||t,a=(n=e==null?void 0:e.synthetic)!==null&&n!==void 0&&n;return{type:e!=null&&e.overrideExceptionType?e.overrideExceptionType:i.name,value:function(s){var l=s.message;return l.error&&typeof l.error.message=="string"?String(l.error.message):String(l)}(i),stacktrace:{frames:r,type:"raw"},mechanism:{handled:o,synthetic:a}}}function LEe(i,e){var t=lpt(i,e);return i.cause&&NEe(i.cause)&&i.cause!==i?[t,...LEe(i.cause,{handled:e==null?void 0:e.handled,synthetic:e==null?void 0:e.synthetic})]:[t]}function lX(i,e){return{$exception_list:LEe(i,e),$exception_level:"error"}}function cX(i,e){var t,n,r,o=(t=e==null?void 0:e.handled)===null||t===void 0||t,a=(n=e==null?void 0:e.synthetic)===null||n===void 0||n,s={type:e!=null&&e.overrideExceptionType?e.overrideExceptionType:(r=e==null?void 0:e.defaultExceptionType)!==null&&r!==void 0?r:"Error",value:i||(e==null?void 0:e.defaultExceptionMessage),mechanism:{handled:o,synthetic:a}};if(e!=null&&e.syntheticException){var l=sX(e.syntheticException,1);l.length&&(s.stacktrace={frames:l,type:"raw"})}return{$exception_list:[s],$exception_level:"error"}}function cpt(i){return AC(i)&&!FZ(i)&&_0t.indexOf(i)>=0}function upt(i,e){var t,n,r=(t=e==null?void 0:e.handled)===null||t===void 0||t,o=(n=e==null?void 0:e.synthetic)===null||n===void 0||n,a=e!=null&&e.overrideExceptionType?e.overrideExceptionType:REe(i)?i.constructor.name:"Error",s="Non-Error 'exception' captured with keys: "+function(u,A){A===void 0&&(A=40);var d=Object.keys(u);if(d.sort(),!d.length)return"[object has no keys]";for(var f=d.length;f>0;f--){var h=d.slice(0,f).join(", ");if(!(h.length>A))return f===d.length||h.length<=A?h:h.slice(0,A)+"..."}return""}(i),l={type:a,value:s,mechanism:{handled:r,synthetic:o}};if(e!=null&&e.syntheticException){var c=sX(e==null?void 0:e.syntheticException,1);c.length&&(l.stacktrace={frames:c,type:"raw"})}return{$exception_list:[l],$exception_level:cpt(i.level)?i.level:"error"}}function Apt(i,e){var{error:t,event:n}=i,r={$exception_list:[]},o=t||n;if(rX(o)||function(d){return SU(d,"DOMException")}(o)){var a=o;if(function(d){return"stack"in d}(o))r=lX(o,e);else{var s=a.name||(rX(a)?"DOMError":"DOMException"),l=a.message?s+": "+a.message:s;r=cX(l,PA({},e,{overrideExceptionType:rX(a)?"DOMError":"DOMException",defaultExceptionMessage:l}))}return"code"in a&&(r.$exception_DOMException_code=""+a.code),r}if(function(d){return SU(d,"ErrorEvent")}(o)&&o.error)return lX(o.error,e);if(NEe(o))return lX(o,e);if(function(d){return SU(d,"Object")}(o)||REe(o))return upt(o,e);if(Gu(t)&&AC(n)){var c="Error",u=n,A=n.match(apt);return A&&(c=A[1],u=A[2]),cX(u,PA({},e,{overrideExceptionType:c,defaultExceptionMessage:u}))}return cX(o,e)}function FEe(i,e,t){try{if(!(e in i))return()=>{};var n=i[e],r=t(n);return n2(r)&&(r.prototype=r.prototype||{},Object.defineProperties(r,{__posthog_wrapped__:{enumerable:!1,value:!0}})),i[e]=r,()=>{i[e]=n}}catch{return()=>{}}}class dpt{constructor(e){var t;this._instance=e,this.ft=(Aa==null||(t=Aa.location)==null?void 0:t.pathname)||""}get isEnabled(){return this._instance.config.capture_pageview==="history_change"}startIfEnabled(){this.isEnabled&&(Qd.info("History API monitoring enabled, starting..."),this.monitorHistoryChanges())}stop(){this.gt&&this.gt(),this.gt=void 0,Qd.info("History API monitoring stopped")}monitorHistoryChanges(){var e,t;if(Aa&&Aa.history){var n=this;(e=Aa.history.pushState)!=null&&e.__posthog_wrapped__||FEe(Aa.history,"pushState",r=>function(o,a,s){r.call(this,o,a,s),n._t("pushState")}),(t=Aa.history.replaceState)!=null&&t.__posthog_wrapped__||FEe(Aa.history,"replaceState",r=>function(o,a,s){r.call(this,o,a,s),n._t("replaceState")}),this.bt()}}_t(e){try{var t,n=Aa==null||(t=Aa.location)==null?void 0:t.pathname;if(!n)return;n!==this.ft&&this.isEnabled&&this._instance.capture("$pageview",{navigation_type:e}),this.ft=n}catch(r){Qd.error("Error capturing "+e+" pageview",r)}}bt(){if(!this.gt){var e=()=>{this._t("popstate")};LI(Aa,"popstate",e),this.gt=()=>{Aa&&Aa.removeEventListener("popstate",e)}}}}function QU(i){var e,t;return((e=JSON.stringify(i,(t=[],function(n,r){if(uC(r)){for(;t.length>0&&t[t.length-1]!==this;)t.pop();return t.includes(r)?"[Circular]":(t.push(r),r)}return r})))==null?void 0:e.length)||0}function uX(i,e){if(e===void 0&&(e=66060288e-1),i.size>=e&&i.data.length>1){var t=Math.floor(i.data.length/2),n=i.data.slice(0,t),r=i.data.slice(t);return[uX({size:QU(n),data:n,sessionId:i.sessionId,windowId:i.windowId}),uX({size:QU(r),data:r,sessionId:i.sessionId,windowId:i.windowId})].flatMap(o=>o)}return[i]}var FS=(i=>(i[i.DomContentLoaded=0]="DomContentLoaded",i[i.Load=1]="Load",i[i.FullSnapshot=2]="FullSnapshot",i[i.IncrementalSnapshot=3]="IncrementalSnapshot",i[i.Meta=4]="Meta",i[i.Custom=5]="Custom",i[i.Plugin=6]="Plugin",i))(FS||{}),k2=(i=>(i[i.Mutation=0]="Mutation",i[i.MouseMove=1]="MouseMove",i[i.MouseInteraction=2]="MouseInteraction",i[i.Scroll=3]="Scroll",i[i.ViewportResize=4]="ViewportResize",i[i.Input=5]="Input",i[i.TouchMove=6]="TouchMove",i[i.MediaInteraction=7]="MediaInteraction",i[i.StyleSheetRule=8]="StyleSheetRule",i[i.CanvasMutation=9]="CanvasMutation",i[i.Font=10]="Font",i[i.Log=11]="Log",i[i.Drag=12]="Drag",i[i.StyleDeclaration=13]="StyleDeclaration",i[i.Selection=14]="Selection",i[i.AdoptedStyleSheet=15]="AdoptedStyleSheet",i[i.CustomElement=16]="CustomElement",i))(k2||{}),AX="[SessionRecording]",dX="redacted",MU={initiatorTypes:["audio","beacon","body","css","early-hint","embed","fetch","frame","iframe","icon","image","img","input","link","navigation","object","ping","script","track","video","xmlhttprequest"],maskRequestFn:i=>i,recordHeaders:!1,recordBody:!1,recordInitialRequests:!1,recordPerformance:!1,performanceEntryTypeToObserve:["first-input","navigation","paint","resource"],payloadSizeLimitBytes:1e6,payloadHostDenyList:[".lr-ingest.io",".ingest.sentry.io",".clarity.ms","analytics.google.com","bam.nr-data.net"]},fpt=["authorization","x-forwarded-for","authorization","cookie","set-cookie","x-api-key","x-real-ip","remote-addr","forwarded","proxy-authorization","x-csrf-token","x-csrftoken","x-xsrf-token"],hpt=["password","secret","passwd","api_key","apikey","auth","credentials","mysql_pwd","privatekey","private_key","token"],ppt=["/s/","/e/","/i/"];function GEe(i,e,t,n){if(o_(i))return i;var r=(e==null?void 0:e["content-length"])||function(o){return new Blob([o]).size}(i);return AC(r)&&(r=parseInt(r)),r>t?AX+" "+n+" body too large to record ("+r+" bytes)":i}function OEe(i,e){if(o_(i))return i;var t=i;return AM(t,!1)||(t=AX+" "+e+" body "+dX),nv(hpt,n=>{var r,o;(r=t)!=null&&r.length&&((o=t)==null?void 0:o.indexOf(n))!==-1&&(t=AX+" "+e+" body "+dX+" as might contain: "+n)}),t}var gpt=(i,e)=>{var t,n,r,o={payloadSizeLimitBytes:MU.payloadSizeLimitBytes,performanceEntryTypeToObserve:[...MU.performanceEntryTypeToObserve],payloadHostDenyList:[...e.payloadHostDenyList||[],...MU.payloadHostDenyList]},a=i.session_recording.recordHeaders!==!1&&e.recordHeaders,s=i.session_recording.recordBody!==!1&&e.recordBody,l=i.capture_performance!==!1&&e.recordPerformance,c=(t=o,r=Math.min(1e6,(n=t.payloadSizeLimitBytes)!==null&&n!==void 0?n:1e6),d=>(d!=null&&d.requestBody&&(d.requestBody=GEe(d.requestBody,d.requestHeaders,r,"Request")),d!=null&&d.responseBody&&(d.responseBody=GEe(d.responseBody,d.responseHeaders,r,"Response")),d)),u=d=>{return c(((y,_)=>{var v,E=dM(y.name),b=_.indexOf("http")===0?(v=dM(_))==null?void 0:v.pathname:_;b==="/"&&(b="");var M=E==null?void 0:E.pathname.replace(b||"","");if(!(E&&M&&ppt.some(Y=>M.indexOf(Y)===0)))return y})((h=(f=d).requestHeaders,o_(h)||nv(Object.keys(h??{}),y=>{fpt.includes(y.toLowerCase())&&(h[y]=dX)}),f),i.api_host));var f,h},A=n2(i.session_recording.maskNetworkRequestFn);return A&&n2(i.session_recording.maskCapturedNetworkRequestFn)&&Qd.warn("Both `maskNetworkRequestFn` and `maskCapturedNetworkRequestFn` are defined. `maskNetworkRequestFn` will be ignored."),A&&(i.session_recording.maskCapturedNetworkRequestFn=d=>{var f=i.session_recording.maskNetworkRequestFn({url:d.name});return PA({},d,{name:f==null?void 0:f.url})}),o.maskRequestFn=n2(i.session_recording.maskCapturedNetworkRequestFn)?d=>{var f,h=u(d);return h&&(f=i.session_recording.maskCapturedNetworkRequestFn==null?void 0:i.session_recording.maskCapturedNetworkRequestFn(h))!==null&&f!==void 0?f:void 0}:d=>function(f){if(!Gu(f))return f.requestBody=OEe(f.requestBody,"Request"),f.responseBody=OEe(f.responseBody,"Response"),f}(u(d)),PA({},MU,o,{recordHeaders:a,recordBody:s,recordPerformance:l,recordInitialRequests:l})};class mpt{constructor(e,t){var n,r;t===void 0&&(t={}),this.yt={},this.wt=o=>{if(!this.yt[o]){var a,s;this.yt[o]=!0;var l=this.St(o);(a=(s=this.rt).onBlockedNode)==null||a.call(s,o,l)}},this.$t=o=>{var a=this.St(o);if((a==null?void 0:a.nodeName)!=="svg"&&a instanceof Element){var s=a.closest("svg");if(s)return[this._rrweb.mirror.getId(s),s]}return[o,a]},this.St=o=>this._rrweb.mirror.getNode(o),this.kt=o=>{var a,s,l,c,u,A,d,f;return((a=(s=o.removes)==null?void 0:s.length)!==null&&a!==void 0?a:0)+((l=(c=o.attributes)==null?void 0:c.length)!==null&&l!==void 0?l:0)+((u=(A=o.texts)==null?void 0:A.length)!==null&&u!==void 0?u:0)+((d=(f=o.adds)==null?void 0:f.length)!==null&&d!==void 0?d:0)},this.throttleMutations=o=>{if(o.type!==3||o.data.source!==0)return o;var a=o.data,s=this.kt(a);a.attributes&&(a.attributes=a.attributes.filter(c=>{var[u]=this.$t(c.id);return!this.ct.consumeRateLimit(u)&&c}));var l=this.kt(a);return l!==0||s===l?o:void 0},this._rrweb=e,this.rt=t,this.ct=new MEe({bucketSize:(n=this.rt.bucketSize)!==null&&n!==void 0?n:100,refillRate:(r=this.rt.refillRate)!==null&&r!==void 0?r:10,refillInterval:1e3,et:this.wt})}}var i2=Uint8Array,jE=Uint16Array,pM=Uint32Array,fX=new i2([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),hX=new i2([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),zEe=new i2([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),HEe=function(i,e){for(var t=new jE(31),n=0;n<31;++n)t[n]=e+=1<<i[n-1];var r=new pM(t[30]);for(n=1;n<30;++n)for(var o=t[n];o<t[n+1];++o)r[o]=o-t[n]<<5|n;return[t,r]},YEe=HEe(fX,2),ypt=YEe[0],pX=YEe[1];ypt[28]=258,pX[258]=28;for(var VEe=HEe(hX,0)[1],KEe=new jE(32768),uI=0;uI<32768;++uI){var Hw=(43690&uI)>>>1|(21845&uI)<<1;Hw=(61680&(Hw=(52428&Hw)>>>2|(13107&Hw)<<2))>>>4|(3855&Hw)<<4,KEe[uI]=((65280&Hw)>>>8|(255&Hw)<<8)>>>1}var e8=function(i,e,t){for(var n=i.length,r=0,o=new jE(e);r<n;++r)++o[i[r]-1];var a,s=new jE(e);for(r=0;r<e;++r)s[r]=s[r-1]+o[r-1]<<1;for(a=new jE(n),r=0;r<n;++r)a[r]=KEe[s[i[r]-1]++]>>>15-i[r];return a},Yw=new i2(288);for(uI=0;uI<144;++uI)Yw[uI]=8;for(uI=144;uI<256;++uI)Yw[uI]=9;for(uI=256;uI<280;++uI)Yw[uI]=7;for(uI=280;uI<288;++uI)Yw[uI]=8;var RU=new i2(32);for(uI=0;uI<32;++uI)RU[uI]=5;var _pt=e8(Yw,9),vpt=e8(RU,5),jEe=function(i){return(i/8>>0)+(7&i&&1)},JEe=function(i,e,t){(t==null||t>i.length)&&(t=i.length);var n=new(i instanceof jE?jE:i instanceof pM?pM:i2)(t-e);return n.set(i.subarray(e,t)),n},GS=function(i,e,t){t<<=7&e;var n=e/8>>0;i[n]|=t,i[n+1]|=t>>>8},t8=function(i,e,t){t<<=7&e;var n=e/8>>0;i[n]|=t,i[n+1]|=t>>>8,i[n+2]|=t>>>16},gX=function(i,e){for(var t=[],n=0;n<i.length;++n)i[n]&&t.push({s:n,f:i[n]});var r=t.length,o=t.slice();if(!r)return[new i2(0),0];if(r==1){var a=new i2(t[0].s+1);return a[t[0].s]=1,[a,1]}t.sort(function(Y,G){return Y.f-G.f}),t.push({s:-1,f:25001});var s=t[0],l=t[1],c=0,u=1,A=2;for(t[0]={s:-1,f:s.f+l.f,l:s,r:l};u!=r-1;)s=t[t[c].f<t[A].f?c++:A++],l=t[c!=u&&t[c].f<t[A].f?c++:A++],t[u++]={s:-1,f:s.f+l.f,l:s,r:l};var d=o[0].s;for(n=1;n<r;++n)o[n].s>d&&(d=o[n].s);var f=new jE(d+1),h=mX(t[u-1],f,0);if(h>e){n=0;var y=0,_=h-e,v=1<<_;for(o.sort(function(Y,G){return f[G.s]-f[Y.s]||Y.f-G.f});n<r;++n){var E=o[n].s;if(!(f[E]>e))break;y+=v-(1<<h-f[E]),f[E]=e}for(y>>>=_;y>0;){var b=o[n].s;f[b]<e?y-=1<<e-f[b]++-1:++n}for(;n>=0&&y;--n){var M=o[n].s;f[M]==e&&(--f[M],++y)}h=e}return[new i2(f),h]},mX=function(i,e,t){return i.s==-1?Math.max(mX(i.l,e,t+1),mX(i.r,e,t+1)):e[i.s]=t},qEe=function(i){for(var e=i.length;e&&!i[--e];);for(var t=new jE(++e),n=0,r=i[0],o=1,a=function(l){t[n++]=l},s=1;s<=e;++s)if(i[s]==r&&s!=e)++o;else{if(!r&&o>2){for(;o>138;o-=138)a(32754);o>2&&(a(o>10?o-11<<5|28690:o-3<<5|12305),o=0)}else if(o>3){for(a(r),--o;o>6;o-=6)a(8304);o>2&&(a(o-3<<5|8208),o=0)}for(;o--;)a(r);o=1,r=i[s]}return[t.subarray(0,n),e]},n8=function(i,e){for(var t=0,n=0;n<e.length;++n)t+=i[n]*e[n];return t},yX=function(i,e,t){var n=t.length,r=jEe(e+2);i[r]=255&n,i[r+1]=n>>>8,i[r+2]=255^i[r],i[r+3]=255^i[r+1];for(var o=0;o<n;++o)i[r+o+4]=t[o];return 8*(r+4+n)},ZEe=function(i,e,t,n,r,o,a,s,l,c,u){GS(e,u++,t),++r[256];for(var A=gX(r,15),d=A[0],f=A[1],h=gX(o,15),y=h[0],_=h[1],v=qEe(d),E=v[0],b=v[1],M=qEe(y),Y=M[0],G=M[1],F=new jE(19),L=0;L<E.length;++L)F[31&E[L]]++;for(L=0;L<Y.length;++L)F[31&Y[L]]++;for(var V=gX(F,7),O=V[0],re=V[1],Z=19;Z>4&&!O[zEe[Z-1]];--Z);var se,ye,xe,de,Ie=c+5<<3,_e=n8(r,Yw)+n8(o,RU)+a,Ne=n8(r,d)+n8(o,y)+a+14+3*Z+n8(F,O)+(2*F[16]+3*F[17]+7*F[18]);if(Ie<=_e&&Ie<=Ne)return yX(e,u,i.subarray(l,l+c));if(GS(e,u,1+(Ne<_e)),u+=2,Ne<_e){se=e8(d,f),ye=d,xe=e8(y,_),de=y;var Pe=e8(O,re);for(GS(e,u,b-257),GS(e,u+5,G-1),GS(e,u+10,Z-4),u+=14,L=0;L<Z;++L)GS(e,u+3*L,O[zEe[L]]);u+=3*Z;for(var Le=[E,Y],ke=0;ke<2;++ke){var rt=Le[ke];for(L=0;L<rt.length;++L){var st=31&rt[L];GS(e,u,Pe[st]),u+=O[st],st>15&&(GS(e,u,rt[L]>>>5&127),u+=rt[L]>>>12)}}}else se=_pt,ye=Yw,xe=vpt,de=RU;for(L=0;L<s;++L)if(n[L]>255){st=n[L]>>>18&31,t8(e,u,se[st+257]),u+=ye[st+257],st>7&&(GS(e,u,n[L]>>>23&31),u+=fX[st]);var pt=31&n[L];t8(e,u,xe[pt]),u+=de[pt],pt>3&&(t8(e,u,n[L]>>>5&8191),u+=hX[pt])}else t8(e,u,se[n[L]]),u+=ye[n[L]];return t8(e,u,se[256]),u+ye[256]},Ipt=new pM([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),Cpt=function(){for(var i=new pM(256),e=0;e<256;++e){for(var t=e,n=9;--n;)t=(1&t&&3988292384)^t>>>1;i[e]=t}return i}(),xpt=function(){var i=4294967295;return{p:function(e){for(var t=i,n=0;n<e.length;++n)t=Cpt[255&t^e[n]]^t>>>8;i=t},d:function(){return 4294967295^i}}},Ept=function(i,e,t,n,r){return function(o,a,s,l,c,u){var A=o.length,d=new i2(l+A+5*(1+Math.floor(A/7e3))+c),f=d.subarray(l,d.length-c),h=0;if(!a||A<8)for(var y=0;y<=A;y+=65535){var _=y+65535;_<A?h=yX(f,h,o.subarray(y,_)):(f[y]=u,h=yX(f,h,o.subarray(y,A)))}else{for(var v=Ipt[a-1],E=v>>>13,b=8191&v,M=(1<<s)-1,Y=new jE(32768),G=new jE(M+1),F=Math.ceil(s/3),L=2*F,V=function(en){return(o[en]^o[en+1]<<F^o[en+2]<<L)&M},O=new pM(25e3),re=new jE(288),Z=new jE(32),se=0,ye=0,xe=(y=0,0),de=0,Ie=0;y<A;++y){var _e=V(y),Ne=32767&y,Pe=G[_e];if(Y[Ne]=Pe,G[_e]=Ne,de<=y){var Le=A-y;if((se>7e3||xe>24576)&&Le>423){h=ZEe(o,f,0,O,re,Z,ye,xe,Ie,y-Ie,h),xe=se=ye=0,Ie=y;for(var ke=0;ke<286;++ke)re[ke]=0;for(ke=0;ke<30;++ke)Z[ke]=0}var rt=2,st=0,pt=b,Qt=Ne-Pe&32767;if(Le>2&&_e==V(y-Qt))for(var Ft=Math.min(E,Le)-1,wt=Math.min(32767,y),He=Math.min(258,Le);Qt<=wt&&--pt&&Ne!=Pe;){if(o[y+rt]==o[y+rt-Qt]){for(var at=0;at<He&&o[y+at]==o[y+at-Qt];++at);if(at>rt){if(rt=at,st=Qt,at>Ft)break;var dt=Math.min(Qt,at-2),Et=0;for(ke=0;ke<dt;++ke){var Lt=y-Qt+ke+32768&32767,St=Lt-Y[Lt]+32768&32767;St>Et&&(Et=St,Pe=Lt)}}}Qt+=(Ne=Pe)-(Pe=Y[Ne])+32768&32767}if(st){O[xe++]=268435456|pX[rt]<<18|VEe[st];var In=31&pX[rt],ln=31&VEe[st];ye+=fX[In]+hX[ln],++re[257+In],++Z[ln],de=y+rt,++se}else O[xe++]=o[y],++re[o[y]]}}h=ZEe(o,f,u,O,re,Z,ye,xe,Ie,y-Ie,h)}return JEe(d,0,l+jEe(h)+c)}(i,e.level==null?6:e.level,e.mem==null?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(i.length)))):12+e.mem,t,n,!0)},_X=function(i,e,t){for(;t;++e)i[e]=t,t>>>=8},bpt=function(i,e){var t=e.filename;if(i[0]=31,i[1]=139,i[2]=8,i[8]=e.level<2?4:e.level==9?2:0,i[9]=3,e.mtime!=0&&_X(i,4,Math.floor(new Date(e.mtime||Date.now())/1e3)),t){i[3]=8;for(var n=0;n<=t.length;++n)i[n+10]=t.charCodeAt(n)}},Bpt=function(i){return 10+(i.filename&&i.filename.length+1||0)};function XEe(i,e){e===void 0&&(e={});var t=xpt(),n=i.length;t.p(i);var r=Ept(i,e,Bpt(e),8),o=r.length;return bpt(r,e),_X(r,o-8,t.d()),_X(r,o-4,n),r}function WEe(i,e){var t=i.length;if(typeof TextEncoder<"u")return new TextEncoder().encode(i);for(var n=new i2(i.length+(i.length>>>1)),r=0,o=function(c){n[r++]=c},a=0;a<t;++a){if(r+5>n.length){var s=new i2(r+8+(t-a<<1));s.set(n),n=s}var l=i.charCodeAt(a);l<128||e?o(l):l<2048?(o(192|l>>>6),o(128|63&l)):l>55295&&l<57344?(o(240|(l=65536+(1047552&l)|1023&i.charCodeAt(++a))>>>18),o(128|l>>>12&63),o(128|l>>>6&63),o(128|63&l)):(o(224|l>>>12),o(128|l>>>6&63),o(128|63&l))}return JEe(n,0,r)}function Spt(i,e){return function(t){for(var n=0,r=0;r<t.length;r++)n=(n<<5)-n+t.charCodeAt(r),n|=0;return Math.abs(n)}(i)%100<Qb(100*e,0,100)}var c3="disabled",vX="sampled",DU="active",Vw="buffering",IX="paused",CX="trigger",BB=CX+"_activated",jx=CX+"_pending",SB=CX+"_"+c3;function $Ee(i,e){return e.some(t=>t.matching==="regex"&&new RegExp(t.url).test(i))}class ebe{constructor(e){this.xt=e}triggerStatus(e){var t=this.xt.map(n=>n.triggerStatus(e));return t.includes(BB)?BB:t.includes(jx)?jx:SB}stop(){this.xt.forEach(e=>e.stop())}}class tbe{constructor(e){this.xt=e}triggerStatus(e){var t=new Set;for(var n of this.xt)t.add(n.triggerStatus(e));switch(t.delete(SB),t.size){case 0:return SB;case 1:return Array.from(t)[0];default:return jx}}stop(){this.xt.forEach(e=>e.stop())}}class wpt{triggerStatus(){return jx}stop(){}}class Qpt{constructor(e){this.Et=[],this.It=[],this.urlBlocked=!1,this._instance=e}onRemoteConfig(e){var t,n;this.Et=((t=e.sessionRecording)==null?void 0:t.urlTriggers)||[],this.It=((n=e.sessionRecording)==null?void 0:n.urlBlocklist)||[]}Pt(e){var t;return this.Et.length===0?SB:((t=this._instance)==null?void 0:t.get_property(YZ))===e?BB:jx}triggerStatus(e){var t=this.Pt(e),n=t===BB?BB:t===jx?jx:SB;return this._instance.register_for_session({$sdk_debug_replay_url_trigger_status:n}),n}checkUrlTriggerConditions(e,t,n){if(Aa!==void 0&&Aa.location.href){var r=Aa.location.href,o=this.urlBlocked,a=$Ee(r,this.It);o&&a||(a&&!o?e():!a&&o&&t(),$Ee(r,this.Et)&&n("url"))}}stop(){}}class Mpt{constructor(e){this.linkedFlag=null,this.linkedFlagSeen=!1,this.Rt=()=>{},this._instance=e}triggerStatus(){var e=jx;return o_(this.linkedFlag)&&(e=SB),this.linkedFlagSeen&&(e=BB),this._instance.register_for_session({$sdk_debug_replay_linked_flag_trigger_status:e}),e}onRemoteConfig(e,t){var n;if(this.linkedFlag=((n=e.sessionRecording)==null?void 0:n.linkedFlag)||null,!o_(this.linkedFlag)&&!this.linkedFlagSeen){var r=AC(this.linkedFlag)?this.linkedFlag:this.linkedFlag.flag,o=AC(this.linkedFlag)?null:this.linkedFlag.variant;this.Rt=this._instance.onFeatureFlags((a,s)=>{var l=!1;if(uC(s)&&r in s){var c=s[r];l=EB(c)?c===!0:o?c===o:!!c}this.linkedFlagSeen=l,l&&t(r,o)})}}stop(){this.Rt()}}class Rpt{constructor(e){this.Tt=[],this._instance=e}onRemoteConfig(e){var t;this.Tt=((t=e.sessionRecording)==null?void 0:t.eventTriggers)||[]}Mt(e){var t;return this.Tt.length===0?SB:((t=this._instance)==null?void 0:t.get_property(VZ))===e?BB:jx}triggerStatus(e){var t=this.Mt(e),n=t===BB?BB:t===jx?jx:SB;return this._instance.register_for_session({$sdk_debug_replay_event_trigger_status:n}),n}stop(){}}function Dpt(i){return i.isRecordingEnabled?Vw:c3}function Npt(i){if(!i.receivedFlags)return Vw;if(!i.isRecordingEnabled)return c3;if(i.urlTriggerMatching.urlBlocked)return IX;var e=i.isSampled===!0,t=new ebe([i.eventTriggerMatching,i.urlTriggerMatching,i.linkedFlagMatching]).triggerStatus(i.sessionId);return e?vX:t===BB?DU:t===jx?Vw:i.isSampled===!1?c3:DU}function Tpt(i){if(!i.receivedFlags)return Vw;if(!i.isRecordingEnabled)return c3;if(i.urlTriggerMatching.urlBlocked)return IX;var e=new tbe([i.eventTriggerMatching,i.urlTriggerMatching,i.linkedFlagMatching]).triggerStatus(i.sessionId),t=e!==SB,n=EB(i.isSampled);return t&&e===jx?Vw:t&&e===SB||n&&!i.isSampled?c3:i.isSampled===!0?vX:DU}var i8="[SessionRecording]",Jx=tx(i8);function NU(){var i;return Kp==null||(i=Kp.__PosthogExtensions__)==null||(i=i.rrweb)==null?void 0:i.record}var kpt=3e5,Ppt=[k2.MouseMove,k2.MouseInteraction,k2.Scroll,k2.ViewportResize,k2.Input,k2.TouchMove,k2.MediaInteraction,k2.Drag],nbe=i=>({rrwebMethod:i,enqueuedAt:Date.now(),attempt:1});function Kw(i){return function(e,t){for(var n="",r=0;r<e.length;){var o=e[r++];n+=String.fromCharCode(o)}return n}(XEe(WEe(JSON.stringify(i))))}function ibe(i){return i.type===FS.Custom&&i.data.tag==="sessionIdle"}class Upt{get sessionId(){return this.Ct}get Ft(){return this._instance.config.session_recording.session_idle_threshold_ms||3e5}get started(){return this.Ot}get At(){if(!this._instance.sessionManager)throw new Error(i8+" must be started with a valid sessionManager.");return this._instance.sessionManager}get Dt(){var e,t;return this.Lt.triggerStatus(this.sessionId)===jx?6e4:(e=(t=this._instance.config.session_recording)==null?void 0:t.full_snapshot_interval_millis)!==null&&e!==void 0?e:kpt}get jt(){var e=this._instance.get_property(XN);return EB(e)?e:null}get Nt(){var e,t,n=(e=this.C)==null?void 0:e.data[((t=this.C)==null?void 0:t.data.length)-1],{sessionStartTimestamp:r}=this.At.checkAndGetSessionAndWindowId(!0);return n?n.timestamp-r:null}get zt(){var e=!!this._instance.get_property(HZ),t=!this._instance.config.disable_session_recording;return Aa&&e&&t}get Ut(){var e=!!this._instance.get_property(iEe),t=this._instance.config.enable_recording_console_log;return t??e}get qt(){var e,t,n,r,o,a,s=this._instance.config.session_recording.captureCanvas,l=this._instance.get_property(aEe),c=(e=(t=s==null?void 0:s.recordCanvas)!==null&&t!==void 0?t:l==null?void 0:l.enabled)!==null&&e!==void 0&&e,u=(n=(r=s==null?void 0:s.canvasFps)!==null&&r!==void 0?r:l==null?void 0:l.fps)!==null&&n!==void 0?n:4,A=(o=(a=s==null?void 0:s.canvasQuality)!==null&&a!==void 0?a:l==null?void 0:l.quality)!==null&&o!==void 0?o:.4;if(typeof A=="string"){var d=parseFloat(A);A=isNaN(d)?.4:d}return{enabled:c,fps:Qb(u,0,12,"canvas recording fps",4),quality:Qb(A,0,1,"canvas recording quality",.4)}}get Bt(){var e,t,n=this._instance.get_property(rEe),r={recordHeaders:(e=this._instance.config.session_recording)==null?void 0:e.recordHeaders,recordBody:(t=this._instance.config.session_recording)==null?void 0:t.recordBody},o=(r==null?void 0:r.recordHeaders)||(n==null?void 0:n.recordHeaders),a=(r==null?void 0:r.recordBody)||(n==null?void 0:n.recordBody),s=uC(this._instance.config.capture_performance)?this._instance.config.capture_performance.network_timing:this._instance.config.capture_performance,l=!!(EB(s)?s:n!=null&&n.capturePerformance);return o||a||l?{recordHeaders:o,recordBody:a,recordPerformance:l}:void 0}get Ht(){var e,t,n,r,o,a,s=this._instance.get_property(oEe),l={maskAllInputs:(e=this._instance.config.session_recording)==null?void 0:e.maskAllInputs,maskTextSelector:(t=this._instance.config.session_recording)==null?void 0:t.maskTextSelector,blockSelector:(n=this._instance.config.session_recording)==null?void 0:n.blockSelector},c=(r=l==null?void 0:l.maskAllInputs)!==null&&r!==void 0?r:s==null?void 0:s.maskAllInputs,u=(o=l==null?void 0:l.maskTextSelector)!==null&&o!==void 0?o:s==null?void 0:s.maskTextSelector,A=(a=l==null?void 0:l.blockSelector)!==null&&a!==void 0?a:s==null?void 0:s.blockSelector;return Gu(c)&&Gu(u)&&Gu(A)?void 0:{maskAllInputs:c==null||c,maskTextSelector:u,blockSelector:A}}get Wt(){var e=this._instance.get_property(sEe);return Kx(e)?e:null}get Gt(){var e=this._instance.get_property(lEe);return Kx(e)?e:null}get status(){return this.Jt?this.Vt({receivedFlags:this.Jt,isRecordingEnabled:this.zt,isSampled:this.jt,urlTriggerMatching:this.Kt,eventTriggerMatching:this.Yt,linkedFlagMatching:this.Xt,sessionId:this.sessionId}):Vw}constructor(e){if(this.Vt=Dpt,this.Jt=!1,this.Qt=[],this.Zt="unknown",this.ti=Date.now(),this.Lt=new wpt,this.ii=void 0,this.ei=void 0,this.ri=void 0,this.si=void 0,this.ni=void 0,this._forceAllowLocalhostNetworkCapture=!1,this.oi=()=>{this.ai()},this.li=()=>{this.ui("browser offline",{})},this.hi=()=>{this.ui("browser online",{})},this.di=()=>{if(id!=null&&id.visibilityState){var r="window "+id.visibilityState;this.ui(r,{})}},this._instance=e,this.Ot=!1,this.vi="/s/",this.ci=void 0,this.Jt=!1,!this._instance.sessionManager)throw Jx.error("started without valid sessionManager"),new Error(i8+" started without valid sessionManager. This is a bug.");if(this._instance.config.__preview_experimental_cookieless_mode)throw new Error(i8+" cannot be used with __preview_experimental_cookieless_mode.");this.Xt=new Mpt(this._instance),this.Kt=new Qpt(this._instance),this.Yt=new Rpt(this._instance);var{sessionId:t,windowId:n}=this.At.checkAndGetSessionAndWindowId();this.Ct=t,this.fi=n,this.C=this.pi(),this.Ft>=this.At.sessionTimeoutMs&&Jx.warn("session_idle_threshold_ms ("+this.Ft+") is greater than the session timeout ("+this.At.sessionTimeoutMs+"). Session will never be detected as idle")}startIfEnabledOrStop(e){this.zt?(this.gi(e),LI(Aa,"beforeunload",this.oi),LI(Aa,"offline",this.li),LI(Aa,"online",this.hi),LI(Aa,"visibilitychange",this.di),this.mi(),this.bi(),o_(this.ii)&&(this.ii=this._instance.on("eventCaptured",t=>{try{if(t.event==="$pageview"){var n=t!=null&&t.properties.$current_url?this.yi(t==null?void 0:t.properties.$current_url):"";if(!n)return;this.ui("$pageview",{href:n})}}catch(r){Jx.error("Could not add $pageview to rrweb session",r)}})),this.ei||(this.ei=this.At.onSessionId((t,n,r)=>{var o,a;r&&(this.ui("$session_id_change",{sessionId:t,windowId:n,changeReason:r}),(o=this._instance)==null||(o=o.persistence)==null||o.unregister(VZ),(a=this._instance)==null||(a=a.persistence)==null||a.unregister(YZ))}))):this.stopRecording()}stopRecording(){var e,t,n,r;this.Ot&&this.ci&&(this.ci(),this.ci=void 0,this.Ot=!1,Aa==null||Aa.removeEventListener("beforeunload",this.oi),Aa==null||Aa.removeEventListener("offline",this.li),Aa==null||Aa.removeEventListener("online",this.hi),Aa==null||Aa.removeEventListener("visibilitychange",this.di),this.pi(),clearInterval(this.wi),(e=this.ii)==null||e.call(this),this.ii=void 0,(t=this.ni)==null||t.call(this),this.ni=void 0,(n=this.ei)==null||n.call(this),this.ei=void 0,(r=this.si)==null||r.call(this),this.si=void 0,this.Yt.stop(),this.Kt.stop(),this.Xt.stop(),Jx.info("stopped"))}Si(){var e;(e=this._instance.persistence)==null||e.unregister(XN)}$i(e){var t,n=this.Ct!==e,r=this.Wt;if(Kx(r)){var o=this.jt,a=n||!EB(o),s=a?Spt(e,r):o;a&&(s?this.ki(vX):Jx.warn("Sample rate ("+r+") has determined that this sessionId ("+e+") will not be sent to the server."),this.ui("samplingDecisionMade",{sampleRate:r,isSampled:s})),(t=this._instance.persistence)==null||t.register({[XN]:s})}else this.Si()}onRemoteConfig(e){var t,n,r,o;this.ui("$remote_config_received",e),this.xi(e),(t=e.sessionRecording)!=null&&t.endpoint&&(this.vi=(o=e.sessionRecording)==null?void 0:o.endpoint),this.mi(),((n=e.sessionRecording)==null?void 0:n.triggerMatchType)==="any"?(this.Vt=Npt,this.Lt=new ebe([this.Yt,this.Kt])):(this.Vt=Tpt,this.Lt=new tbe([this.Yt,this.Kt])),this._instance.register_for_session({$sdk_debug_replay_remote_trigger_matching_config:(r=e.sessionRecording)==null?void 0:r.triggerMatchType}),this.Kt.onRemoteConfig(e),this.Yt.onRemoteConfig(e),this.Xt.onRemoteConfig(e,(a,s)=>{this.ki("linked_flag_matched",{flag:a,variant:s})}),this.Jt=!0,this.startIfEnabledOrStop()}mi(){Kx(this.Wt)&&o_(this.si)&&(this.si=this.At.onSessionId(e=>{this.$i(e)}))}xi(e){if(this._instance.persistence){var t,n=this._instance.persistence,r=()=>{var o,a,s,l,c,u,A,d,f,h=(o=e.sessionRecording)==null?void 0:o.sampleRate,y=o_(h)?null:parseFloat(h);o_(y)&&this.Si();var _=(a=e.sessionRecording)==null?void 0:a.minimumDurationMilliseconds;n.register({[HZ]:!!e.sessionRecording,[iEe]:(s=e.sessionRecording)==null?void 0:s.consoleLogRecordingEnabled,[rEe]:PA({capturePerformance:e.capturePerformance},(l=e.sessionRecording)==null?void 0:l.networkPayloadCapture),[oEe]:(c=e.sessionRecording)==null?void 0:c.masking,[aEe]:{enabled:(u=e.sessionRecording)==null?void 0:u.recordCanvas,fps:(A=e.sessionRecording)==null?void 0:A.canvasFps,quality:(d=e.sessionRecording)==null?void 0:d.canvasQuality},[sEe]:y,[lEe]:Gu(_)?null:_,[cEe]:(f=e.sessionRecording)==null?void 0:f.scriptConfig})};r(),(t=this.ri)==null||t.call(this),this.ri=this.At.onSessionId(r)}}log(e,t){var n;t===void 0&&(t="log"),(n=this._instance.sessionRecording)==null||n.onRRwebEmit({type:6,data:{plugin:"rrweb/console@1",payload:{level:t,trace:[],payload:[JSON.stringify(e)]}},timestamp:Date.now()})}gi(e){if(!Gu(Object.assign)&&!Gu(Array.from)&&!(this.Ot||this._instance.config.disable_session_recording||this._instance.consent.isOptedOut())){var t;this.Ot=!0,this.At.checkAndGetSessionAndWindowId(),NU()?this.Ei():(t=Kp.__PosthogExtensions__)==null||t.loadExternalDependency==null||t.loadExternalDependency(this._instance,this.Ii,n=>{if(n)return Jx.error("could not load recorder",n);this.Ei()}),Jx.info("starting"),this.status===DU&&this.ki(e||"recording_initialized")}}get Ii(){var e;return((e=this._instance)==null||(e=e.persistence)==null||(e=e.get_property(cEe))==null?void 0:e.script)||"recorder"}Pi(e){var t;return e.type===3&&Ppt.indexOf((t=e.data)==null?void 0:t.source)!==-1}Ri(e){var t=this.Pi(e);t||this.Zt||e.timestamp-this.ti>this.Ft&&(this.Zt=!0,clearInterval(this.wi),this.ui("sessionIdle",{eventTimestamp:e.timestamp,lastActivityTimestamp:this.ti,threshold:this.Ft,bufferLength:this.C.data.length,bufferSize:this.C.size}),this.ai());var n=!1;if(t&&(this.ti=e.timestamp,this.Zt)){var r=this.Zt==="unknown";this.Zt=!1,r||(this.ui("sessionNoLongerIdle",{reason:"user activity",type:e.type}),n=!0)}if(!this.Zt){var{windowId:o,sessionId:a}=this.At.checkAndGetSessionAndWindowId(!t,e.timestamp),s=this.Ct!==a,l=this.fi!==o;this.fi=o,this.Ct=a,s||l?(this.stopRecording(),this.startIfEnabledOrStop("session_id_changed")):n&&this.Ti()}}Mi(e){try{return e.rrwebMethod(),!0}catch(t){return this.Qt.length<10?this.Qt.push({enqueuedAt:e.enqueuedAt||Date.now(),attempt:e.attempt++,rrwebMethod:e.rrwebMethod}):Jx.warn("could not emit queued rrweb event.",t,e),!1}}ui(e,t){return this.Mi(nbe(()=>NU().addCustomEvent(e,t)))}Ci(){return this.Mi(nbe(()=>NU().takeFullSnapshot()))}Ei(){var e,t,n,r,o={blockClass:"ph-no-capture",blockSelector:void 0,ignoreClass:"ph-ignore-input",maskTextClass:"ph-mask",maskTextSelector:void 0,maskTextFn:void 0,maskAllInputs:!0,maskInputOptions:{password:!0},maskInputFn:void 0,slimDOMOptions:{},collectFonts:!1,inlineStylesheet:!0,recordCrossOriginIframes:!1},a=this._instance.config.session_recording;for(var[s,l]of Object.entries(a||{}))s in o&&(s==="maskInputOptions"?o.maskInputOptions=PA({password:!0},l):o[s]=l);this.qt&&this.qt.enabled&&(o.recordCanvas=!0,o.sampling={canvas:this.qt.fps},o.dataURLOptions={type:"image/webp",quality:this.qt.quality}),this.Ht&&(o.maskAllInputs=(t=this.Ht.maskAllInputs)===null||t===void 0||t,o.maskTextSelector=(n=this.Ht.maskTextSelector)!==null&&n!==void 0?n:void 0,o.blockSelector=(r=this.Ht.blockSelector)!==null&&r!==void 0?r:void 0);var c=NU();if(c){this.Fi=(e=this.Fi)!==null&&e!==void 0?e:new mpt(c,{refillRate:this._instance.config.session_recording.__mutationThrottlerRefillRate,bucketSize:this._instance.config.session_recording.__mutationThrottlerBucketSize,onBlockedNode:(A,d)=>{var f="Too many mutations on node '"+A+"'. Rate limiting. This could be due to SVG animations or something similar";Jx.info(f,{node:d}),this.log(i8+" "+f,"warn")}});var u=this.Oi();this.ci=c(PA({emit:A=>{this.onRRwebEmit(A)},plugins:u},o)),this.ti=Date.now(),this.Zt=EB(this.Zt)?this.Zt:"unknown",this.ui("$session_options",{sessionRecordingOptions:o,activePlugins:u.map(A=>A==null?void 0:A.name)}),this.ui("$posthog_config",{config:this._instance.config})}else Jx.error("onScriptLoaded was called but rrwebRecord is not available. This indicates something has gone wrong.")}Ti(){if(this.wi&&clearInterval(this.wi),this.Zt!==!0){var e=this.Dt;e&&(this.wi=setInterval(()=>{this.Ci()},e))}}Oi(){var e,t,n=[],r=(e=Kp.__PosthogExtensions__)==null||(e=e.rrwebPlugins)==null?void 0:e.getRecordConsolePlugin;r&&this.Ut&&n.push(r());var o=(t=Kp.__PosthogExtensions__)==null||(t=t.rrwebPlugins)==null?void 0:t.getRecordNetworkPlugin;return this.Bt&&n2(o)&&(!P0t.includes(location.hostname)||this._forceAllowLocalhostNetworkCapture?n.push(o(gpt(this._instance.config,this.Bt))):Jx.info("NetworkCapture not started because we are on localhost.")),n}onRRwebEmit(e){var t;if(this.Ai(),e&&uC(e)){if(e.type===FS.Meta){var n=this.yi(e.data.href);if(this.Di=n,!n)return;e.data.href=n}else this.Li();if(this.Kt.checkUrlTriggerConditions(()=>this.ji(),()=>this.Ni(),d=>this.zi(d)),!this.Kt.urlBlocked||(r=e).type===FS.Custom&&r.data.tag==="recording paused"){var r;e.type===FS.FullSnapshot&&this.Ti(),e.type===FS.FullSnapshot&&this.Jt&&this.Lt.triggerStatus(this.sessionId)===jx&&this.pi();var o=this.Fi?this.Fi.throttleMutations(e):e;if(o){var a=function(d){var f=d;if(f&&uC(f)&&f.type===6&&uC(f.data)&&f.data.plugin==="rrweb/console@1"){f.data.payload.payload.length>10&&(f.data.payload.payload=f.data.payload.payload.slice(0,10),f.data.payload.payload.push("...[truncated]"));for(var h=[],y=0;y<f.data.payload.payload.length;y++)f.data.payload.payload[y]&&f.data.payload.payload[y].length>2e3?h.push(f.data.payload.payload[y].slice(0,2e3)+"...[truncated]"):h.push(f.data.payload.payload[y]);return f.data.payload.payload=h,d}return d}(o);if(this.Ri(a),this.Zt!==!0||ibe(a)){if(ibe(a)){var s=a.data.payload;if(s){var l=s.lastActivityTimestamp,c=s.threshold;a.timestamp=l+c}}var u=(t=this._instance.config.session_recording.compress_events)===null||t===void 0||t?function(d){if(QU(d)<1024)return d;try{if(d.type===FS.FullSnapshot)return PA({},d,{data:Kw(d.data),cv:"2024-10"});if(d.type===FS.IncrementalSnapshot&&d.data.source===k2.Mutation)return PA({},d,{cv:"2024-10",data:PA({},d.data,{texts:Kw(d.data.texts),attributes:Kw(d.data.attributes),removes:Kw(d.data.removes),adds:Kw(d.data.adds)})});if(d.type===FS.IncrementalSnapshot&&d.data.source===k2.StyleSheetRule)return PA({},d,{cv:"2024-10",data:PA({},d.data,{adds:d.data.adds?Kw(d.data.adds):void 0,removes:d.data.removes?Kw(d.data.removes):void 0})})}catch(f){Jx.error("could not compress event - will use uncompressed event",f)}return d}(a):a,A={$snapshot_bytes:QU(u),$snapshot_data:u,$session_id:this.Ct,$window_id:this.fi};this.status!==c3?this.Ui(A):this.pi()}}}}}Li(){if(!this._instance.config.capture_pageview&&Aa){var e=this.yi(Aa.location.href);this.Di!==e&&(this.ui("$url_changed",{href:e}),this.Di=e)}}Ai(){if(this.Qt.length){var e=[...this.Qt];this.Qt=[],e.forEach(t=>{Date.now()-t.enqueuedAt<=2e3&&this.Mi(t)})}}yi(e){var t=this._instance.config.session_recording;if(t.maskNetworkRequestFn){var n,r={url:e};return(n=r=t.maskNetworkRequestFn(r))==null?void 0:n.url}return e}pi(){return this.C={size:0,data:[],sessionId:this.Ct,windowId:this.fi},this.C}ai(){this.qi&&(clearTimeout(this.qi),this.qi=void 0);var e=this.Gt,t=this.Nt,n=Kx(t)&&t>=0,r=Kx(e)&&n&&t<e;return this.status===Vw||this.status===IX||this.status===c3||r?(this.qi=setTimeout(()=>{this.ai()},2e3),this.C):(this.C.data.length>0&&uX(this.C).forEach(o=>{this.Bi({$snapshot_bytes:o.size,$snapshot_data:o.data,$session_id:o.sessionId,$window_id:o.windowId,$lib:"web",$lib_version:PS.LIB_VERSION})}),this.pi())}Ui(e){var t,n=2+(((t=this.C)==null?void 0:t.data.length)||0);!this.Zt&&(this.C.size+e.$snapshot_bytes+n>943718.4||this.C.sessionId!==this.Ct)&&(this.C=this.ai()),this.C.size+=e.$snapshot_bytes,this.C.data.push(e.$snapshot_data),this.qi||this.Zt||(this.qi=setTimeout(()=>{this.ai()},2e3))}Bi(e){this._instance.capture("$snapshot",e,{_url:this._instance.requestRouter.endpointFor("api",this.vi),_noTruncate:!0,_batchKey:"recordings",skip_client_rate_limiting:!0})}zi(e){var t;this.Lt.triggerStatus(this.sessionId)===jx&&((t=this._instance)==null||(t=t.persistence)==null||t.register({[e==="url"?YZ:VZ]:this.Ct}),this.ai(),this.ki(e+"_trigger_matched"))}ji(){this.Kt.urlBlocked||(this.Kt.urlBlocked=!0,clearInterval(this.wi),Jx.info("recording paused due to URL blocker"),this.ui("recording paused",{reason:"url blocker"}))}Ni(){this.Kt.urlBlocked&&(this.Kt.urlBlocked=!1,this.Ci(),this.Ti(),this.ui("recording resumed",{reason:"left blocked url"}),Jx.info("recording resumed"))}bi(){this.Yt.Tt.length!==0&&o_(this.ni)&&(this.ni=this._instance.on("eventCaptured",e=>{try{this.Yt.Tt.includes(e.event)&&this.zi("event")}catch(t){Jx.error("Could not activate event trigger",t)}}))}overrideLinkedFlag(){this.Xt.linkedFlagSeen=!0,this.Ci(),this.ki("linked_flag_overridden")}overrideSampling(){var e;(e=this._instance.persistence)==null||e.register({[XN]:!0}),this.Ci(),this.ki("sampling_overridden")}overrideTrigger(e){this.zi(e)}ki(e,t){this._instance.register_for_session({$session_recording_start_reason:e}),Jx.info(e.replace("_"," "),t),iy(["recording_initialized","session_id_changed"],e)||this.ui(e,t)}get sdkDebugProperties(){var{sessionStartTimestamp:e}=this.At.checkAndGetSessionAndWindowId(!0);return{$recording_status:this.status,$sdk_debug_replay_internal_buffer_length:this.C.data.length,$sdk_debug_replay_internal_buffer_size:this.C.size,$sdk_debug_current_session_duration:this.Nt,$sdk_debug_session_start:e}}}var xX=tx("[SegmentIntegration]");function Lpt(i,e){var t=i.config.segment;if(!t)return e();(function(n,r){var o=n.config.segment;if(!o)return r();var a=l=>{var c=()=>l.anonymousId()||l3();n.config.get_device_id=c,l.id()&&(n.register({distinct_id:l.id(),$device_id:c()}),n.persistence.set_property(LS,"identified")),r()},s=o.user();"then"in s&&n2(s.then)?s.then(l=>a(l)):a(s)})(i,()=>{t.register((n=>{Promise&&Promise.resolve||xX.warn("This browser does not have Promise support, and can not use the segment integration");var r=(o,a)=>{if(!a)return o;o.event.userId||o.event.anonymousId===n.get_distinct_id()||(xX.info("No userId set, resetting PostHog"),n.reset()),o.event.userId&&o.event.userId!==n.get_distinct_id()&&(xX.info("UserId set, identifying with PostHog"),n.identify(o.event.userId));var s=n.calculateEventProperties(a,o.event.properties);return o.event.properties=Object.assign({},s,o.event.properties),o};return{name:"PostHog JS",type:"enrichment",version:"1.0.0",isLoaded:()=>!0,load:()=>Promise.resolve(),track:o=>r(o,o.event.event),page:o=>r(o,"$pageview"),identify:o=>r(o,"$identify"),screen:o=>r(o,"$screen")}})(i)).then(()=>{e()})})}var rbe="posthog-js";function obe(i,e){var{organization:t,projectId:n,prefix:r,severityAllowList:o=["error"]}=e===void 0?{}:e;return a=>{var s,l,c,u,A;if(!(o==="*"||o.includes(a.level))||!i.__loaded)return a;a.tags||(a.tags={});var d=i.requestRouter.endpointFor("ui","/project/"+i.config.token+"/person/"+i.get_distinct_id());a.tags["PostHog Person URL"]=d,i.sessionRecordingStarted()&&(a.tags["PostHog Recording URL"]=i.get_session_replay_url({withTimestamp:!0}));var f=((s=a.exception)==null?void 0:s.values)||[],h=f.map(_=>PA({},_,{stacktrace:_.stacktrace?PA({},_.stacktrace,{type:"raw",frames:(_.stacktrace.frames||[]).map(v=>PA({},v,{platform:"web:javascript"}))}):void 0})),y={$exception_message:((l=f[0])==null?void 0:l.value)||a.message,$exception_type:(c=f[0])==null?void 0:c.type,$exception_personURL:d,$exception_level:a.level,$exception_list:h,$sentry_event_id:a.event_id,$sentry_exception:a.exception,$sentry_exception_message:((u=f[0])==null?void 0:u.value)||a.message,$sentry_exception_type:(A=f[0])==null?void 0:A.type,$sentry_tags:a.tags};return t&&n&&(y.$sentry_url=(r||"https://sentry.io/organizations/")+t+"/issues/?project="+n+"&query="+a.event_id),i.exceptions.sendExceptionEvent(y),a}}class Fpt{constructor(e,t,n,r,o){this.name=rbe,this.setupOnce=function(a){a(obe(e,{organization:t,projectId:n,prefix:r,severityAllowList:o}))}}}var Gpt=Aa!=null&&Aa.location?IU(Aa.location.hash,"__posthog")||IU(location.hash,"state"):null,abe="_postHogToolbarParams",sbe=tx("[Toolbar]"),u3=function(i){return i[i.UNINITIALIZED=0]="UNINITIALIZED",i[i.LOADING=1]="LOADING",i[i.LOADED=2]="LOADED",i}(u3||{});class Opt{constructor(e){this.instance=e}Hi(e){Kp.ph_toolbar_state=e}Wi(){var e;return(e=Kp.ph_toolbar_state)!==null&&e!==void 0?e:u3.UNINITIALIZED}maybeLoadToolbar(e,t,n){if(e===void 0&&(e=void 0),t===void 0&&(t=void 0),n===void 0&&(n=void 0),!Aa||!id)return!1;e=e??Aa.location,n=n??Aa.history;try{if(!t){try{Aa.localStorage.setItem("test","test"),Aa.localStorage.removeItem("test")}catch{return!1}t=Aa==null?void 0:Aa.localStorage}var r,o=Gpt||IU(e.hash,"__posthog")||IU(e.hash,"state"),a=o?qxe(()=>JSON.parse(atob(decodeURIComponent(o))))||qxe(()=>JSON.parse(decodeURIComponent(o))):null;return a&&a.action==="ph_authorize"?((r=a).source="url",r&&Object.keys(r).length>0&&(a.desiredHash?e.hash=a.desiredHash:n?n.replaceState(n.state,"",e.pathname+e.search):e.hash="")):((r=JSON.parse(t.getItem(abe)||"{}")).source="localstorage",delete r.userIntent),!(!r.token||this.instance.config.token!==r.token)&&(this.loadToolbar(r),!0)}catch{return!1}}Gi(e){var t=Kp.ph_load_toolbar||Kp.ph_load_editor;!o_(t)&&n2(t)?t(e,this.instance):sbe.warn("No toolbar load function found")}loadToolbar(e){var t=!(id==null||!id.getElementById(uEe));if(!Aa||t)return!1;var n=this.instance.requestRouter.region==="custom"&&this.instance.config.advanced_disable_toolbar_metrics,r=PA({token:this.instance.config.token},e,{apiURL:this.instance.requestRouter.endpointFor("ui")},n?{instrument:!1}:{});if(Aa.localStorage.setItem(abe,JSON.stringify(PA({},r,{source:void 0}))),this.Wi()===u3.LOADED)this.Gi(r);else if(this.Wi()===u3.UNINITIALIZED){var o;this.Hi(u3.LOADING),(o=Kp.__PosthogExtensions__)==null||o.loadExternalDependency==null||o.loadExternalDependency(this.instance,"toolbar",a=>{if(a)return sbe.error("[Toolbar] Failed to load",a),void this.Hi(u3.UNINITIALIZED);this.Hi(u3.LOADED),this.Gi(r)}),LI(Aa,"turbolinks:load",()=>{this.Hi(u3.UNINITIALIZED),this.loadToolbar(r)})}return!0}Ji(e){return this.loadToolbar(e)}maybeLoadEditor(e,t,n){return e===void 0&&(e=void 0),t===void 0&&(t=void 0),n===void 0&&(n=void 0),this.maybeLoadToolbar(e,t,n)}}var zpt=tx("[TracingHeaders]");class Hpt{constructor(e){this.Vi=void 0,this.Ki=void 0,this.nt=()=>{var t,n;Gu(this.Vi)&&((t=Kp.__PosthogExtensions__)==null||(t=t.tracingHeadersPatchFns)==null||t._patchXHR(this._instance.config.__add_tracing_headers||[],this._instance.get_distinct_id(),this._instance.sessionManager)),Gu(this.Ki)&&((n=Kp.__PosthogExtensions__)==null||(n=n.tracingHeadersPatchFns)==null||n._patchFetch(this._instance.config.__add_tracing_headers||[],this._instance.get_distinct_id(),this._instance.sessionManager))},this._instance=e}J(e){var t,n;(t=Kp.__PosthogExtensions__)!=null&&t.tracingHeadersPatchFns&&e(),(n=Kp.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this._instance,"tracing-headers",r=>{if(r)return zpt.error("failed to load script",r);e()})}startIfEnabledOrStop(){var e,t;this._instance.config.__add_tracing_headers?this.J(this.nt):((e=this.Vi)==null||e.call(this),(t=this.Ki)==null||t.call(this),this.Vi=void 0,this.Ki=void 0)}}var A3=tx("[Web Vitals]"),lbe=9e5;class Ypt{constructor(e){var t;this.Yi=!1,this.i=!1,this.C={url:void 0,metrics:[],firstMetricTimestamp:void 0},this.Xi=()=>{clearTimeout(this.Qi),this.C.metrics.length!==0&&(this._instance.capture("$web_vitals",this.C.metrics.reduce((n,r)=>PA({},n,{["$web_vitals_"+r.name+"_event"]:PA({},r),["$web_vitals_"+r.name+"_value"]:r.value}),{})),this.C={url:void 0,metrics:[],firstMetricTimestamp:void 0})},this.Zi=n=>{var r,o=(r=this._instance.sessionManager)==null?void 0:r.checkAndGetSessionAndWindowId(!0);if(Gu(o))A3.error("Could not read session ID. Dropping metrics!");else{this.C=this.C||{url:void 0,metrics:[],firstMetricTimestamp:void 0};var a=this.te();Gu(a)||(o_(n==null?void 0:n.name)||o_(n==null?void 0:n.value)?A3.error("Invalid metric received",n):this.ie&&n.value>=this.ie?A3.error("Ignoring metric with value >= "+this.ie,n):(this.C.url!==a&&(this.Xi(),this.Qi=setTimeout(this.Xi,this.flushToCaptureTimeoutMs)),Gu(this.C.url)&&(this.C.url=a),this.C.firstMetricTimestamp=Gu(this.C.firstMetricTimestamp)?Date.now():this.C.firstMetricTimestamp,n.attribution&&n.attribution.interactionTargetElement&&(n.attribution.interactionTargetElement=void 0),this.C.metrics.push(PA({},n,{$current_url:a,$session_id:o.sessionId,$window_id:o.windowId,timestamp:Date.now()})),this.C.metrics.length===this.allowedMetrics.length&&this.Xi()))}},this.nt=()=>{var n,r,o,a,s=Kp.__PosthogExtensions__;Gu(s)||Gu(s.postHogWebVitalsCallbacks)||({onLCP:n,onCLS:r,onFCP:o,onINP:a}=s.postHogWebVitalsCallbacks),n&&r&&o&&a?(this.allowedMetrics.indexOf("LCP")>-1&&n(this.Zi.bind(this)),this.allowedMetrics.indexOf("CLS")>-1&&r(this.Zi.bind(this)),this.allowedMetrics.indexOf("FCP")>-1&&o(this.Zi.bind(this)),this.allowedMetrics.indexOf("INP")>-1&&a(this.Zi.bind(this)),this.i=!0):A3.error("web vitals callbacks not loaded - not starting")},this._instance=e,this.Yi=!((t=this._instance.persistence)==null||!t.props[eEe]),this.startIfEnabled()}get allowedMetrics(){var e,t,n=uC(this._instance.config.capture_performance)?(e=this._instance.config.capture_performance)==null?void 0:e.web_vitals_allowed_metrics:void 0;return Gu(n)?((t=this._instance.persistence)==null?void 0:t.props[nEe])||["CLS","FCP","INP","LCP"]:n}get flushToCaptureTimeoutMs(){return(uC(this._instance.config.capture_performance)?this._instance.config.capture_performance.web_vitals_delayed_flush_ms:void 0)||5e3}get ie(){var e=uC(this._instance.config.capture_performance)&&Kx(this._instance.config.capture_performance.__web_vitals_max_value)?this._instance.config.capture_performance.__web_vitals_max_value:lbe;return 0<e&&e<=6e4?lbe:e}get isEnabled(){var e=VE==null?void 0:VE.protocol;if(e!=="http:"&&e!=="https:")return A3.info("Web Vitals are disabled on non-http/https protocols"),!1;var t=uC(this._instance.config.capture_performance)?this._instance.config.capture_performance.web_vitals:EB(this._instance.config.capture_performance)?this._instance.config.capture_performance:void 0;return EB(t)?t:this.Yi}startIfEnabled(){this.isEnabled&&!this.i&&(A3.info("enabled, starting..."),this.J(this.nt))}onRemoteConfig(e){var t=uC(e.capturePerformance)&&!!e.capturePerformance.web_vitals,n=uC(e.capturePerformance)?e.capturePerformance.web_vitals_allowed_metrics:void 0;this._instance.persistence&&(this._instance.persistence.register({[eEe]:t}),this._instance.persistence.register({[nEe]:n})),this.Yi=t,this.startIfEnabled()}J(e){var t,n;(t=Kp.__PosthogExtensions__)!=null&&t.postHogWebVitalsCallbacks&&e(),(n=Kp.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this._instance,"web-vitals",r=>{r?A3.error("failed to load script",r):e()})}te(){var e=Aa?Aa.location.href:void 0;return e||A3.error("Could not determine current URL"),e}}var Vpt=tx("[Heatmaps]");function cbe(i){return uC(i)&&"clientX"in i&&"clientY"in i&&Kx(i.clientX)&&Kx(i.clientY)}class Kpt{constructor(e){var t;this.rageclicks=new EEe,this.Yi=!1,this.i=!1,this.ee=null,this.instance=e,this.Yi=!((t=this.instance.persistence)==null||!t.props[OZ])}get flushIntervalMilliseconds(){var e=5e3;return uC(this.instance.config.capture_heatmaps)&&this.instance.config.capture_heatmaps.flush_interval_milliseconds&&(e=this.instance.config.capture_heatmaps.flush_interval_milliseconds),e}get isEnabled(){return Gu(this.instance.config.capture_heatmaps)?Gu(this.instance.config.enable_heatmaps)?this.Yi:this.instance.config.enable_heatmaps:this.instance.config.capture_heatmaps!==!1}startIfEnabled(){if(this.isEnabled){if(this.i)return;Vpt.info("starting..."),this.re(),this.ee=setInterval(this.se.bind(this),this.flushIntervalMilliseconds)}else{var e,t;clearInterval((e=this.ee)!==null&&e!==void 0?e:void 0),(t=this.ne)==null||t.stop(),this.getAndClearBuffer()}}onRemoteConfig(e){var t=!!e.heatmaps;this.instance.persistence&&this.instance.persistence.register({[OZ]:t}),this.Yi=t,this.startIfEnabled()}getAndClearBuffer(){var e=this.C;return this.C=void 0,e}oe(e){this.ae(e.originalEvent,"deadclick")}re(){Aa&&id&&(LI(Aa,"beforeunload",this.se.bind(this)),LI(id,"click",e=>this.ae(e||(Aa==null?void 0:Aa.event)),{capture:!0}),LI(id,"mousemove",e=>this.le(e||(Aa==null?void 0:Aa.event)),{capture:!0}),this.ne=new QEe(this.instance,Z0t,this.oe.bind(this)),this.ne.startIfEnabled(),this.i=!0)}ue(e,t){var n=this.instance.scrollManager.scrollY(),r=this.instance.scrollManager.scrollX(),o=this.instance.scrollManager.scrollElement(),a=function(s,l,c){for(var u=s;u&&mU(u)&&!s3(u,"body");){if(u===c)return!1;if(iy(l,Aa==null?void 0:Aa.getComputedStyle(u).position))return!0;u=mEe(u)}return!1}(gEe(e),["fixed","sticky"],o);return{x:e.clientX+(a?0:r),y:e.clientY+(a?0:n),target_fixed:a,type:t}}ae(e,t){var n;if(t===void 0&&(t="click"),!AEe(e.target)&&cbe(e)){var r=this.ue(e,t);(n=this.rageclicks)!=null&&n.isRageClick(e.clientX,e.clientY,new Date().getTime())&&this.he(PA({},r,{type:"rageclick"})),this.he(r)}}le(e){!AEe(e.target)&&cbe(e)&&(clearTimeout(this.de),this.de=setTimeout(()=>{this.he(this.ue(e,"mousemove"))},500))}he(e){if(Aa){var t=Aa.location.href;this.C=this.C||{},this.C[t]||(this.C[t]=[]),this.C[t].push(e)}}se(){this.C&&!cM(this.C)&&this.instance.capture("$$heatmap",{$heatmap_data:this.getAndClearBuffer()})}}class jpt{constructor(e){this._instance=e}doPageView(e,t){var n,r=this.ve(e,t);return this.ce={pathname:(n=Aa==null?void 0:Aa.location.pathname)!==null&&n!==void 0?n:"",pageViewId:t,timestamp:e},this._instance.scrollManager.resetContext(),r}doPageLeave(e){var t;return this.ve(e,(t=this.ce)==null?void 0:t.pageViewId)}doEvent(){var e;return{$pageview_id:(e=this.ce)==null?void 0:e.pageViewId}}ve(e,t){var n=this.ce;if(!n)return{$pageview_id:t};var r={$pageview_id:t,$prev_pageview_id:n.pageViewId},o=this._instance.scrollManager.getContext();if(o&&!this._instance.config.disable_scroll_properties){var{maxScrollHeight:a,lastScrollY:s,maxScrollY:l,maxContentHeight:c,lastContentY:u,maxContentY:A}=o;if(!(Gu(a)||Gu(s)||Gu(l)||Gu(c)||Gu(u)||Gu(A))){a=Math.ceil(a),s=Math.ceil(s),l=Math.ceil(l),c=Math.ceil(c),u=Math.ceil(u),A=Math.ceil(A);var d=a<=1?1:Qb(s/a,0,1),f=a<=1?1:Qb(l/a,0,1),h=c<=1?1:Qb(u/c,0,1),y=c<=1?1:Qb(A/c,0,1);r=RC(r,{$prev_pageview_last_scroll:s,$prev_pageview_last_scroll_percentage:d,$prev_pageview_max_scroll:l,$prev_pageview_max_scroll_percentage:f,$prev_pageview_last_content:u,$prev_pageview_last_content_percentage:h,$prev_pageview_max_content:A,$prev_pageview_max_content_percentage:y})}}return n.pathname&&(r.$prev_pageview_pathname=n.pathname),n.timestamp&&(r.$prev_pageview_duration=(e.getTime()-n.timestamp.getTime())/1e3),r}}var Jpt=function(i){var e,t,n,r,o="";for(e=t=0,n=(i=(i+"").replace(/\r\n/g,`
243
243
  `).replace(/\r/g,`
244
- `)).length,r=0;r<n;r++){var a=i.charCodeAt(r),s=null;a<128?t++:s=a>127&&a<2048?String.fromCharCode(a>>6|192,63&a|128):String.fromCharCode(a>>12|224,a>>6&63|128,63&a|128),o3(s)||(t>e&&(o+=i.substring(e,t)),o+=s,e=t=r+1)}return t>e&&(o+=i.substring(e,i.length)),o},qpt=!!PZ||!!kZ,ube="text/plain",TU=(i,e)=>{var[t,n]=i.split("?"),r=PA({},e);n==null||n.split("&").forEach(a=>{var[s]=a.split("=");delete r[s]});var o=U0t(r);return t+"?"+(o=o?(n?n+"&":"")+o:n)},r8=(i,e)=>JSON.stringify(i,(t,n)=>typeof n=="bigint"?n.toString():n,e),EX=i=>{var{data:e,compression:t}=i;if(e){if(t===US.GZipJS){var n=XEe(WEe(r8(e)),{mtime:0}),r=new Blob([n],{type:ube});return{contentType:ube,body:r,estimatedSize:r.size}}if(t===US.Base64){var o=function(l){var c,u,A,d,f,h="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",y=0,_=0,v="",E=[];if(!l)return l;l=Jpt(l);do c=(f=l.charCodeAt(y++)<<16|l.charCodeAt(y++)<<8|l.charCodeAt(y++))>>18&63,u=f>>12&63,A=f>>6&63,d=63&f,E[_++]=h.charAt(c)+h.charAt(u)+h.charAt(A)+h.charAt(d);while(y<l.length);switch(v=E.join(""),l.length%3){case 1:v=v.slice(0,-2)+"==";break;case 2:v=v.slice(0,-1)+"="}return v}(r8(e)),a=(l=>"data="+encodeURIComponent(typeof l=="string"?l:r8(l)))(o);return{contentType:"application/x-www-form-urlencoded",body:a,estimatedSize:new Blob([a]).size}}var s=r8(e);return{contentType:"application/json",body:s,estimatedSize:new Blob([s]).size}}},o8=[];kZ&&o8.push({transport:"fetch",method:i=>{var e,t,{contentType:n,body:r,estimatedSize:o}=(e=EX(i))!==null&&e!==void 0?e:{},a=new Headers;nv(i.headers,function(u,A){a.append(A,u)}),n&&a.append("Content-Type",n);var s=i.url,l=null;if(Hxe){var c=new Hxe;l={signal:c.signal,timeout:setTimeout(()=>c.abort(),i.timeout)}}kZ(s,PA({method:(i==null?void 0:i.method)||"GET",headers:a,keepalive:i.method==="POST"&&(o||0)<52428.8,body:r,signal:(t=l)==null?void 0:t.signal},i.fetchOptions)).then(u=>u.text().then(A=>{var d={statusCode:u.status,text:A};if(u.status===200)try{d.json=JSON.parse(A)}catch(f){Qd.error(f)}i.callback==null||i.callback(d)})).catch(u=>{Qd.error(u),i.callback==null||i.callback({statusCode:0,text:u})}).finally(()=>l?clearTimeout(l.timeout):null)}}),PZ&&o8.push({transport:"XHR",method:i=>{var e,t=new PZ;t.open(i.method||"GET",i.url,!0);var{contentType:n,body:r}=(e=EX(i))!==null&&e!==void 0?e:{};nv(i.headers,function(o,a){t.setRequestHeader(a,o)}),n&&t.setRequestHeader("Content-Type",n),i.timeout&&(t.timeout=i.timeout),t.withCredentials=!0,t.onreadystatechange=()=>{if(t.readyState===4){var o={statusCode:t.status,text:t.responseText};if(t.status===200)try{o.json=JSON.parse(t.responseText)}catch{}i.callback==null||i.callback(o)}},t.send(r)}}),wb!=null&&wb.sendBeacon&&o8.push({transport:"sendBeacon",method:i=>{var e=TU(i.url,{beacon:"1"});try{var t,{contentType:n,body:r}=(t=EX(i))!==null&&t!==void 0?t:{},o=typeof r=="string"?new Blob([r],{type:n}):r;wb.sendBeacon(e,o)}catch{}}});var gM=function(i,e){if(!function(t){try{new RegExp(t)}catch{return!1}return!0}(e))return!1;try{return new RegExp(e).test(i)}catch{return!1}};function Abe(i,e,t){return r8({distinct_id:i,userPropertiesToSet:e,userPropertiesToSetOnce:t})}var Zpt={exact:(i,e)=>e.some(t=>i.some(n=>t===n)),is_not:(i,e)=>e.every(t=>i.every(n=>t!==n)),regex:(i,e)=>e.some(t=>i.some(n=>gM(t,n))),not_regex:(i,e)=>e.every(t=>i.every(n=>!gM(t,n))),icontains:(i,e)=>e.map(kU).some(t=>i.map(kU).some(n=>t.includes(n))),not_icontains:(i,e)=>e.map(kU).every(t=>i.map(kU).every(n=>!t.includes(n)))},kU=i=>i.toLowerCase(),Xpt=tx("[Error tracking]");class Wpt{constructor(e){var t,n;this.fe=[],this._instance=e,this.fe=(t=(n=this._instance.persistence)==null?void 0:n.get_property(zZ))!==null&&t!==void 0?t:[]}onRemoteConfig(e){var t,n,r=(t=(n=e.errorTracking)==null?void 0:n.suppressionRules)!==null&&t!==void 0?t:[];this.fe=r,this._instance.persistence&&this._instance.persistence.register({[zZ]:this.fe})}sendExceptionEvent(e){if(!this.pe(e))return this._instance.capture("$exception",e,{_noTruncate:!0,_batchKey:"exceptionEvent"});Xpt.info("Skipping exception capture because a suppression rule matched")}pe(e){var t=e.$exception_list;if(!t||!wI(t)||t.length===0)return!1;var n=t.reduce((r,o)=>{var{type:a,value:s}=o;return AC(a)&&a.length>0&&r.$exception_types.push(a),AC(s)&&s.length>0&&r.$exception_values.push(s),r},{$exception_types:[],$exception_values:[]});return this.fe.some(r=>{var o=r.values.map(a=>{var s,l=Zpt[a.operator],c=wI(a.value)?a.value:[a.value],u=(s=n[a.key])!==null&&s!==void 0?s:[];return c.length>0&&l(c,u)});return r.type==="OR"?o.some(Boolean):o.every(Boolean)})}}var r2="Mobile",PU="iOS",wB="Android",a8="Tablet",dbe=wB+" "+a8,fbe="iPad",hbe="Apple",pbe=hbe+" Watch",s8="Safari",mM="BlackBerry",gbe="Samsung",mbe=gbe+"Browser",ybe=gbe+" Internet",jw="Chrome",$pt=jw+" OS",_be=jw+" "+PU,bX="Internet Explorer",vbe=bX+" "+r2,BX="Opera",egt=BX+" Mini",SX="Edge",Ibe="Microsoft "+SX,yM="Firefox",Cbe=yM+" "+PU,l8="Nintendo",c8="PlayStation",_M="Xbox",xbe=wB+" "+r2,Ebe=r2+" "+s8,u8="Windows",wX=u8+" Phone",bbe="Nokia",QX="Ouya",Bbe="Generic",tgt=Bbe+" "+r2.toLowerCase(),Sbe=Bbe+" "+a8.toLowerCase(),MX="Konqueror",_E="(\\d+(\\.\\d+)?)",RX=new RegExp("Version/"+_E),ngt=new RegExp(_M,"i"),igt=new RegExp(c8+" \\w+","i"),rgt=new RegExp(l8+" \\w+","i"),DX=new RegExp(mM+"|PlayBook|BB10","i"),ogt={"NT3.51":"NT 3.11","NT4.0":"NT 4.0","5.0":"2000",5.1:"XP",5.2:"XP","6.0":"Vista",6.1:"7",6.2:"8",6.3:"8.1",6.4:"10","10.0":"10"},agt=(i,e)=>e&&iy(e,hbe)||function(t){return iy(t,s8)&&!iy(t,jw)&&!iy(t,wB)}(i),wbe=function(i,e){return e=e||"",iy(i," OPR/")&&iy(i,"Mini")?egt:iy(i," OPR/")?BX:DX.test(i)?mM:iy(i,"IE"+r2)||iy(i,"WPDesktop")?vbe:iy(i,mbe)?ybe:iy(i,SX)||iy(i,"Edg/")?Ibe:iy(i,"FBIOS")?"Facebook "+r2:iy(i,"UCWEB")||iy(i,"UCBrowser")?"UC Browser":iy(i,"CriOS")?_be:iy(i,"CrMo")||iy(i,jw)?jw:iy(i,wB)&&iy(i,s8)?xbe:iy(i,"FxiOS")?Cbe:iy(i.toLowerCase(),MX.toLowerCase())?MX:agt(i,e)?iy(i,r2)?Ebe:s8:iy(i,yM)?yM:iy(i,"MSIE")||iy(i,"Trident/")?bX:iy(i,"Gecko")?yM:""},sgt={[vbe]:[new RegExp("rv:"+_E)],[Ibe]:[new RegExp(SX+"?\\/"+_E)],[jw]:[new RegExp("("+jw+"|CrMo)\\/"+_E)],[_be]:[new RegExp("CriOS\\/"+_E)],"UC Browser":[new RegExp("(UCBrowser|UCWEB)\\/"+_E)],[s8]:[RX],[Ebe]:[RX],[BX]:[new RegExp("(Opera|OPR)\\/"+_E)],[yM]:[new RegExp(yM+"\\/"+_E)],[Cbe]:[new RegExp("FxiOS\\/"+_E)],[MX]:[new RegExp("Konqueror[:/]?"+_E,"i")],[mM]:[new RegExp(mM+" "+_E),RX],[xbe]:[new RegExp("android\\s"+_E,"i")],[ybe]:[new RegExp(mbe+"\\/"+_E)],[bX]:[new RegExp("(rv:|MSIE )"+_E)],Mozilla:[new RegExp("rv:"+_E)]},lgt=function(i,e){var t=wbe(i,e),n=sgt[t];if(Gu(n))return null;for(var r=0;r<n.length;r++){var o=n[r],a=i.match(o);if(a)return parseFloat(a[a.length-2])}return null},Qbe=[[new RegExp(_M+"; "+_M+" (.*?)[);]","i"),i=>[_M,i&&i[1]||""]],[new RegExp(l8,"i"),[l8,""]],[new RegExp(c8,"i"),[c8,""]],[DX,[mM,""]],[new RegExp(u8,"i"),(i,e)=>{if(/Phone/.test(e)||/WPDesktop/.test(e))return[wX,""];if(new RegExp(r2).test(e)&&!/IEMobile\b/.test(e))return[u8+" "+r2,""];var t=/Windows NT ([0-9.]+)/i.exec(e);if(t&&t[1]){var n=t[1],r=ogt[n]||"";return/arm/i.test(e)&&(r="RT"),[u8,r]}return[u8,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,i=>{if(i&&i[3]){var e=[i[3],i[4],i[5]||"0"];return[PU,e.join(".")]}return[PU,""]}],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,i=>{var e="";return i&&i.length>=3&&(e=Gu(i[2])?i[3]:i[2]),["watchOS",e]}],[new RegExp("("+wB+" (\\d+)\\.(\\d+)\\.?(\\d+)?|"+wB+")","i"),i=>{if(i&&i[2]){var e=[i[2],i[3],i[4]||"0"];return[wB,e.join(".")]}return[wB,""]}],[/Mac OS X (\d+)[_.](\d+)[_.]?(\d+)?/i,i=>{var e=["Mac OS X",""];if(i&&i[1]){var t=[i[1],i[2],i[3]||"0"];e[1]=t.join(".")}return e}],[/Mac/i,["Mac OS X",""]],[/CrOS/,[$pt,""]],[/Linux|debian/i,["Linux",""]]],Mbe=function(i){return rgt.test(i)?l8:igt.test(i)?c8:ngt.test(i)?_M:new RegExp(QX,"i").test(i)?QX:new RegExp("("+wX+"|WPDesktop)","i").test(i)?wX:/iPad/.test(i)?fbe:/iPod/.test(i)?"iPod Touch":/iPhone/.test(i)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(i)?pbe:DX.test(i)?mM:/(kobo)\s(ereader|touch)/i.test(i)?"Kobo":new RegExp(bbe,"i").test(i)?bbe:/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i.test(i)||/(kf[a-z]+)( bui|\)).+silk\//i.test(i)?"Kindle Fire":/(Android|ZTE)/i.test(i)?!new RegExp(r2).test(i)||/(9138B|TB782B|Nexus [97]|pixel c|HUAWEISHT|BTV|noble nook|smart ultra 6)/i.test(i)?/pixel[\daxl ]{1,6}/i.test(i)&&!/pixel c/i.test(i)||/(huaweimed-al00|tah-|APA|SM-G92|i980|zte|U304AA)/i.test(i)||/lmy47v/i.test(i)&&!/QTAQZ3/i.test(i)?wB:dbe:wB:new RegExp("(pda|"+r2+")","i").test(i)?tgt:new RegExp(a8,"i").test(i)&&!new RegExp(a8+" pc","i").test(i)?Sbe:""},UU="https?://(.*)",LU=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx"],cgt=lU(["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid"],LU),NX="<masked>",ugt=["li_fat_id"];function Rbe(i,e,t){if(!id)return{};var n,r=e?lU([],LU,t||[]):[],o=Dbe(tX(id.URL,r,NX),i),a=(n={},nv(ugt,function(s){var l=bB.D(s);n[s]=l||null}),n);return RC(a,o)}function Dbe(i,e){var t=cgt.concat(e||[]),n={};return nv(t,function(r){var o=vU(i,r);n[r]=o||null}),n}function Nbe(i){var e=function(o){return o?o.search(UU+"google.([^/?]*)")===0?"google":o.search(UU+"bing.com")===0?"bing":o.search(UU+"yahoo.com")===0?"yahoo":o.search(UU+"duckduckgo.com")===0?"duckduckgo":null:null}(i),t=e!="yahoo"?"q":"p",n={};if(!o3(e)){n.$search_engine=e;var r=id?vU(id.referrer,t):"";r.length&&(n.ph_keyword=r)}return n}function Tbe(){return navigator.language||navigator.userLanguage}function kbe(){return(id==null?void 0:id.referrer)||"$direct"}function Pbe(i,e){var t=i?lU([],LU,e||[]):[],n=VE==null?void 0:VE.href.substring(0,1e3);return{r:kbe().substring(0,1e3),u:n?tX(n,t,NX):void 0}}function Ube(i){var e,{r:t,u:n}=i,r={$referrer:t,$referring_domain:t==null?void 0:t=="$direct"?"$direct":(e=dM(t))==null?void 0:e.host};if(n){r.$current_url=n;var o=dM(n);r.$host=o==null?void 0:o.host,r.$pathname=o==null?void 0:o.pathname;var a=Dbe(n);RC(r,a)}if(t){var s=Nbe(t);RC(r,s)}return r}function Lbe(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch{return}}function Agt(){try{return new Date().getTimezoneOffset()}catch{return}}function dgt(i,e){if(!KE)return{};var t,n,r,o=i?lU([],LU,e||[]):[],[a,s]=function(l){for(var c=0;c<Qbe.length;c++){var[u,A]=Qbe[c],d=u.exec(l),f=d&&(n2(A)?A(d,l):A);if(f)return f}return["",""]}(KE);return RC(GZ({$os:a,$os_version:s,$browser:wbe(KE,navigator.vendor),$device:Mbe(KE),$device_type:(n=KE,r=Mbe(n),r===fbe||r===dbe||r==="Kobo"||r==="Kindle Fire"||r===Sbe?a8:r===l8||r===_M||r===c8||r===QX?"Console":r===pbe?"Wearable":r?r2:"Desktop"),$timezone:Lbe(),$timezone_offset:Agt()}),{$current_url:tX(VE==null?void 0:VE.href,o,NX),$host:VE==null?void 0:VE.host,$pathname:VE==null?void 0:VE.pathname,$raw_user_agent:KE.length>1e3?KE.substring(0,997)+"...":KE,$browser_version:lgt(KE,navigator.vendor),$browser_language:Tbe(),$browser_language_prefix:(t=Tbe(),typeof t=="string"?t.split("-")[0]:void 0),$screen_height:Aa==null?void 0:Aa.screen.height,$screen_width:Aa==null?void 0:Aa.screen.width,$viewport_height:Aa==null?void 0:Aa.innerHeight,$viewport_width:Aa==null?void 0:Aa.innerWidth,$lib:"web",$lib_version:PS.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3})}var QB=tx("[FeatureFlags]"),TX="$active_feature_flags",vM="$override_feature_flags",Fbe="$feature_flag_payloads",A8="$override_feature_flag_payloads",Gbe="$feature_flag_request_id",Obe=i=>{var e={};for(var[t,n]of cU(i||{}))n&&(e[t]=n);return e},fgt=i=>{var e=i.flags;return e?(i.featureFlags=Object.fromEntries(Object.keys(e).map(t=>{var n;return[t,(n=e[t].variant)!==null&&n!==void 0?n:e[t].enabled]})),i.featureFlagPayloads=Object.fromEntries(Object.keys(e).filter(t=>e[t].enabled).filter(t=>{var n;return(n=e[t].metadata)==null?void 0:n.payload}).map(t=>{var n;return[t,(n=e[t].metadata)==null?void 0:n.payload]}))):QB.warn("Using an older version of the feature flags endpoint. Please upgrade your PostHog server to the latest version"),i},hgt=function(i){return i.FeatureFlags="feature_flags",i.Recordings="recordings",i}({});class pgt{constructor(e){this.ge=!1,this._e=!1,this.me=!1,this.be=!1,this.ye=!1,this.we=!1,this.Se=!1,this._instance=e,this.featureFlagEventHandlers=[]}flags(){if(this._instance.config.__preview_remote_config)this.we=!0;else{var e=!this.$e&&(this._instance.config.advanced_disable_feature_flags||this._instance.config.advanced_disable_feature_flags_on_first_load);this.ke({disableFlags:e})}}get hasLoadedFlags(){return this._e}getFlags(){return Object.keys(this.getFlagVariants())}getFlagsWithDetails(){var e=this._instance.get_property(KZ),t=this._instance.get_property(vM),n=this._instance.get_property(A8);if(!n&&!t)return e||{};var r=RC({},e||{}),o=[...new Set([...Object.keys(n||{}),...Object.keys(t||{})])];for(var a of o){var s,l,c=r[a],u=t==null?void 0:t[a],A=Gu(u)?(s=c==null?void 0:c.enabled)!==null&&s!==void 0&&s:!!u,d=Gu(u)?c.variant:typeof u=="string"?u:void 0,f=n==null?void 0:n[a],h=PA({},c,{enabled:A,variant:A?d??(c==null?void 0:c.variant):void 0});A!==(c==null?void 0:c.enabled)&&(h.original_enabled=c==null?void 0:c.enabled),d!==(c==null?void 0:c.variant)&&(h.original_variant=c==null?void 0:c.variant),f&&(h.metadata=PA({},c==null?void 0:c.metadata,{payload:f,original_payload:c==null||(l=c.metadata)==null?void 0:l.payload})),r[a]=h}return this.ge||(QB.warn(" Overriding feature flag details!",{flagDetails:e,overriddenPayloads:n,finalDetails:r}),this.ge=!0),r}getFlagVariants(){var e=this._instance.get_property(uM),t=this._instance.get_property(vM);if(!t)return e||{};for(var n=RC({},e),r=Object.keys(t),o=0;o<r.length;o++)n[r[o]]=t[r[o]];return this.ge||(QB.warn(" Overriding feature flags!",{enabledFlags:e,overriddenFlags:t,finalFlags:n}),this.ge=!0),n}getFlagPayloads(){var e=this._instance.get_property(Fbe),t=this._instance.get_property(A8);if(!t)return e||{};for(var n=RC({},e||{}),r=Object.keys(t),o=0;o<r.length;o++)n[r[o]]=t[r[o]];return this.ge||(QB.warn(" Overriding feature flag payloads!",{flagPayloads:e,overriddenPayloads:t,finalPayloads:n}),this.ge=!0),n}reloadFeatureFlags(){this.be||this._instance.config.advanced_disable_feature_flags||this.$e||(this.$e=setTimeout(()=>{this.ke()},5))}xe(){clearTimeout(this.$e),this.$e=void 0}ensureFlagsLoaded(){this._e||this.me||this.$e||this.reloadFeatureFlags()}setAnonymousDistinctId(e){this.$anon_distinct_id=e}setReloadingPaused(e){this.be=e}ke(e){var t;if(this.xe(),!this._instance.I())if(this.me)this.ye=!0;else{var n={token:this._instance.config.token,distinct_id:this._instance.get_distinct_id(),groups:this._instance.getGroups(),$anon_distinct_id:this.$anon_distinct_id,person_properties:PA({},((t=this._instance.persistence)==null?void 0:t.get_initial_props())||{},this._instance.get_property(WN)||{}),group_properties:this._instance.get_property(Ow)};(e!=null&&e.disableFlags||this._instance.config.advanced_disable_feature_flags)&&(n.disable_flags=!0);var r=this._instance.config.__preview_remote_config,o=r?"/flags/?v=2":"/flags/?v=2&config=true",a=this._instance.config.advanced_only_evaluate_survey_feature_flags?"&only_evaluate_survey_feature_flags=true":"",s=this._instance.requestRouter.endpointFor("api",o+a);r&&(n.timezone=Lbe()),this.me=!0,this._instance.Ee({method:"POST",url:s,data:n,compression:this._instance.config.disable_compression?void 0:US.Base64,timeout:this._instance.config.feature_flag_request_timeout_ms,callback:l=>{var c,u,A=!0;if(l.statusCode===200&&(this.ye||(this.$anon_distinct_id=void 0),A=!1),this.me=!1,this.we||(this.we=!0,this._instance.Ie((u=l.json)!==null&&u!==void 0?u:{})),!n.disable_flags||this.ye)if(this.Se=!A,l.json&&(c=l.json.quotaLimited)!=null&&c.includes(hgt.FeatureFlags))QB.warn("You have hit your feature flags quota limit, and will not be able to load feature flags until the quota is reset. Please visit https://posthog.com/docs/billing/limits-alerts to learn more.");else{var d;n.disable_flags||this.receivedFeatureFlags((d=l.json)!==null&&d!==void 0?d:{},A),this.ye&&(this.ye=!1,this.ke())}}})}}getFeatureFlag(e,t){if(t===void 0&&(t={}),this._e||this.getFlags()&&this.getFlags().length>0){var n=this.getFlagVariants()[e],r=""+n,o=this._instance.get_property(Gbe)||void 0,a=this._instance.get_property(fU)||{};if((t.send_event||!("send_event"in t))&&(!(e in a)||!a[e].includes(r))){var s,l,c,u,A,d,f,h,y;wI(a[e])?a[e].push(r):a[e]=[r],(s=this._instance.persistence)==null||s.register({[fU]:a});var _=this.getFeatureFlagDetails(e),v={$feature_flag:e,$feature_flag_response:n,$feature_flag_payload:this.getFeatureFlagPayload(e)||null,$feature_flag_request_id:o,$feature_flag_bootstrapped_response:((l=this._instance.config.bootstrap)==null||(l=l.featureFlags)==null?void 0:l[e])||null,$feature_flag_bootstrapped_payload:((c=this._instance.config.bootstrap)==null||(c=c.featureFlagPayloads)==null?void 0:c[e])||null,$used_bootstrap_value:!this.Se};Gu(_==null||(u=_.metadata)==null?void 0:u.version)||(v.$feature_flag_version=_.metadata.version);var E,b=(A=_==null||(d=_.reason)==null?void 0:d.description)!==null&&A!==void 0?A:_==null||(f=_.reason)==null?void 0:f.code;b&&(v.$feature_flag_reason=b),_!=null&&(h=_.metadata)!=null&&h.id&&(v.$feature_flag_id=_.metadata.id),Gu(_==null?void 0:_.original_variant)&&Gu(_==null?void 0:_.original_enabled)||(v.$feature_flag_original_response=Gu(_.original_variant)?_.original_enabled:_.original_variant),_!=null&&(y=_.metadata)!=null&&y.original_payload&&(v.$feature_flag_original_payload=_==null||(E=_.metadata)==null?void 0:E.original_payload),this._instance.capture("$feature_flag_called",v)}return n}QB.warn('getFeatureFlag for key "'+e+`" failed. Feature flags didn't load in time.`)}getFeatureFlagDetails(e){return this.getFlagsWithDetails()[e]}getFeatureFlagPayload(e){return this.getFlagPayloads()[e]}getRemoteConfigPayload(e,t){var n=this._instance.config.token;this._instance.Ee({method:"POST",url:this._instance.requestRouter.endpointFor("api","/flags/?v=2&config=true"),data:{distinct_id:this._instance.get_distinct_id(),token:n},compression:this._instance.config.disable_compression?void 0:US.Base64,timeout:this._instance.config.feature_flag_request_timeout_ms,callback:r=>{var o,a=(o=r.json)==null?void 0:o.featureFlagPayloads;t((a==null?void 0:a[e])||void 0)}})}isFeatureEnabled(e,t){if(t===void 0&&(t={}),this._e||this.getFlags()&&this.getFlags().length>0)return!!this.getFeatureFlag(e,t);QB.warn('isFeatureEnabled for key "'+e+`" failed. Feature flags didn't load in time.`)}addFeatureFlagsHandler(e){this.featureFlagEventHandlers.push(e)}removeFeatureFlagsHandler(e){this.featureFlagEventHandlers=this.featureFlagEventHandlers.filter(t=>t!==e)}receivedFeatureFlags(e,t){if(this._instance.persistence){this._e=!0;var n=this.getFlagVariants(),r=this.getFlagPayloads(),o=this.getFlagsWithDetails();(function(a,s,l,c,u){l===void 0&&(l={}),c===void 0&&(c={}),u===void 0&&(u={});var A=fgt(a),d=A.flags,f=A.featureFlags,h=A.featureFlagPayloads;if(f){var y=a.requestId;if(wI(f)){QB.warn("v1 of the feature flags endpoint is deprecated. Please use the latest version.");var _={};if(f)for(var v=0;v<f.length;v++)_[f[v]]=!0;s&&s.register({[TX]:f,[uM]:_})}else{var E=f,b=h,M=d;a.errorsWhileComputingFlags&&(E=PA({},l,E),b=PA({},c,b),M=PA({},u,M)),s&&s.register(PA({[TX]:Object.keys(Obe(E)),[uM]:E||{},[Fbe]:b||{},[KZ]:M||{}},y?{[Gbe]:y}:{}))}}})(e,this._instance.persistence,n,r,o),this.Pe(t)}}override(e,t){t===void 0&&(t=!1),QB.warn("override is deprecated. Please use overrideFeatureFlags instead."),this.overrideFeatureFlags({flags:e,suppressWarning:t})}overrideFeatureFlags(e){if(!this._instance.__loaded||!this._instance.persistence)return QB.uninitializedWarning("posthog.featureFlags.overrideFeatureFlags");if(e===!1)return this._instance.persistence.unregister(vM),this._instance.persistence.unregister(A8),void this.Pe();if(e&&typeof e=="object"&&("flags"in e||"payloads"in e)){var t,n=e;if(this.ge=!!((t=n.suppressWarning)!==null&&t!==void 0&&t),"flags"in n){if(n.flags===!1)this._instance.persistence.unregister(vM);else if(n.flags)if(wI(n.flags)){for(var r={},o=0;o<n.flags.length;o++)r[n.flags[o]]=!0;this._instance.persistence.register({[vM]:r})}else this._instance.persistence.register({[vM]:n.flags})}return"payloads"in n&&(n.payloads===!1?this._instance.persistence.unregister(A8):n.payloads&&this._instance.persistence.register({[A8]:n.payloads})),void this.Pe()}this.Pe()}onFeatureFlags(e){if(this.addFeatureFlagsHandler(e),this._e){var{flags:t,flagVariants:n}=this.Re();e(t,n)}return()=>this.removeFeatureFlagsHandler(e)}updateEarlyAccessFeatureEnrollment(e,t){var n,r=(this._instance.get_property(AU)||[]).find(l=>l.flagKey===e),o={["$feature_enrollment/"+e]:t},a={$feature_flag:e,$feature_enrollment:t,$set:o};r&&(a.$early_access_feature_name=r.name),this._instance.capture("$feature_enrollment_update",a),this.setPersonPropertiesForFlags(o,!1);var s=PA({},this.getFlagVariants(),{[e]:t});(n=this._instance.persistence)==null||n.register({[TX]:Object.keys(Obe(s)),[uM]:s}),this.Pe()}getEarlyAccessFeatures(e,t,n){t===void 0&&(t=!1);var r=this._instance.get_property(AU),o=n?"&"+n.map(a=>"stage="+a).join("&"):"";if(r&&!t)return e(r);this._instance.Ee({url:this._instance.requestRouter.endpointFor("api","/api/early_access_features/?token="+this._instance.config.token+o),method:"GET",callback:a=>{var s;if(a.json){var l=a.json.earlyAccessFeatures;return(s=this._instance.persistence)==null||s.register({[AU]:l}),e(l)}}})}Re(){var e=this.getFlags(),t=this.getFlagVariants();return{flags:e.filter(n=>t[n]),flagVariants:Object.keys(t).filter(n=>t[n]).reduce((n,r)=>(n[r]=t[r],n),{})}}Pe(e){var{flags:t,flagVariants:n}=this.Re();this.featureFlagEventHandlers.forEach(r=>r(t,n,{errorsLoading:e}))}setPersonPropertiesForFlags(e,t){t===void 0&&(t=!0);var n=this._instance.get_property(WN)||{};this._instance.register({[WN]:PA({},n,e)}),t&&this._instance.reloadFeatureFlags()}resetPersonPropertiesForFlags(){this._instance.unregister(WN)}setGroupPropertiesForFlags(e,t){t===void 0&&(t=!0);var n=this._instance.get_property(Ow)||{};Object.keys(n).length!==0&&Object.keys(n).forEach(r=>{n[r]=PA({},n[r],e[r]),delete e[r]}),this._instance.register({[Ow]:PA({},n,e)}),t&&this._instance.reloadFeatureFlags()}resetGroupPropertiesForFlags(e){if(e){var t=this._instance.get_property(Ow)||{};this._instance.register({[Ow]:PA({},t,{[e]:{}})})}else this._instance.unregister(Ow)}reset(){this._e=!1,this.me=!1,this.be=!1,this.ye=!1,this.we=!1,this.Se=!1,this.$anon_distinct_id=void 0,this.xe(),this.ge=!1}}var ggt=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"];class kX{constructor(e,t){this.S=e,this.props={},this.Te=!1,this.Me=(n=>{var r="";return n.token&&(r=n.token.replace(/\+/g,"PL").replace(/\//g,"SL").replace(/=/g,"EQ")),n.persistence_name?"ph_"+n.persistence_name:"ph_"+r+"_posthog"})(e),this.B=this.Ce(e),this.load(),e.debug&&Qd.info("Persistence loaded",e.persistence,PA({},this.props)),this.update_config(e,e,t),this.save()}isDisabled(){return!!this.Fe}Ce(e){ggt.indexOf(e.persistence.toLowerCase())===-1&&(Qd.critical("Unknown persistence type "+e.persistence+"; falling back to localStorage+cookie"),e.persistence="localStorage+cookie");var t=e.persistence.toLowerCase();return t==="localstorage"&&y9.O()?y9:t==="localstorage+cookie"&&xU.O()?xU:t==="sessionstorage"&&mx.O()?mx:t==="memory"?J0t:t==="cookie"?bB:xU.O()?xU:bB}properties(){var e={};return nv(this.props,function(t,n){if(n===uM&&uC(t))for(var r=Object.keys(t),o=0;o<r.length;o++)e["$feature/"+r[o]]=t[r[o]];else s=n,l=!1,(o3(a=w0t)?l:zxe&&a.indexOf===zxe?a.indexOf(s)!=-1:(nv(a,function(c){if(l||(l=c===s))return sU}),l))||(e[n]=t);var a,s,l}),e}load(){if(!this.Fe){var e=this.B.L(this.Me);e&&(this.props=RC({},e))}}save(){this.Fe||this.B.j(this.Me,this.props,this.Oe,this.Ae,this.De,this.S.debug)}remove(){this.B.N(this.Me,!1),this.B.N(this.Me,!0)}clear(){this.remove(),this.props={}}register_once(e,t,n){if(uC(e)){Gu(t)&&(t="None"),this.Oe=Gu(n)?this.Le:n;var r=!1;if(nv(e,(o,a)=>{this.props.hasOwnProperty(a)&&this.props[a]!==t||(this.props[a]=o,r=!0)}),r)return this.save(),!0}return!1}register(e,t){if(uC(e)){this.Oe=Gu(t)?this.Le:t;var n=!1;if(nv(e,(r,o)=>{e.hasOwnProperty(o)&&this.props[o]!==r&&(this.props[o]=r,n=!0)}),n)return this.save(),!0}return!1}unregister(e){e in this.props&&(delete this.props[e],this.save())}update_campaign_params(){if(!this.Te){var e=Rbe(this.S.custom_campaign_params,this.S.mask_personal_data_properties,this.S.custom_personal_data_properties);cM(GZ(e))||this.register(e),this.Te=!0}}update_search_keyword(){var e;this.register((e=id==null?void 0:id.referrer)?Nbe(e):{})}update_referrer_info(){var e;this.register_once({$referrer:kbe(),$referring_domain:id!=null&&id.referrer&&((e=dM(id.referrer))==null?void 0:e.host)||"$direct"},void 0)}set_initial_person_info(){this.props[ZZ]||this.props[XZ]||this.register_once({[hU]:Pbe(this.S.mask_personal_data_properties,this.S.custom_personal_data_properties)},void 0)}get_initial_props(){var e={};nv([XZ,ZZ],a=>{var s=this.props[a];s&&nv(s,function(l,c){e["$initial_"+LZ(c)]=l})});var t,n,r=this.props[hU];if(r){var o=(t=Ube(r),n={},nv(t,function(a,s){n["$initial_"+LZ(s)]=a}),n);RC(e,o)}return e}safe_merge(e){return nv(this.props,function(t,n){n in e||(e[n]=t)}),e}update_config(e,t,n){if(this.Le=this.Oe=e.cookie_expiration,this.set_disabled(e.disable_persistence||!!n),this.set_cross_subdomain(e.cross_subdomain_cookie),this.set_secure(e.secure_cookie),e.persistence!==t.persistence){var r=this.Ce(e),o=this.props;this.clear(),this.B=r,this.props=o,this.save()}}set_disabled(e){this.Fe=e,this.Fe?this.remove():this.save()}set_cross_subdomain(e){e!==this.Ae&&(this.Ae=e,this.remove(),this.save())}set_secure(e){e!==this.De&&(this.De=e,this.remove(),this.save())}set_event_timer(e,t){var n=this.props[ZN]||{};n[e]=t,this.props[ZN]=n,this.save()}remove_event_timer(e){var t=(this.props[ZN]||{})[e];return Gu(t)||(delete this.props[ZN][e],this.save()),t}get_property(e){return this.props[e]}set_property(e,t){this.props[e]=t,this.save()}}class zbe{constructor(){this.je={},this.je={}}on(e,t){return this.je[e]||(this.je[e]=[]),this.je[e].push(t),()=>{this.je[e]=this.je[e].filter(n=>n!==t)}}emit(e,t){for(var n of this.je[e]||[])n(t);for(var r of this.je["*"]||[])r(e,t)}}class Jw{constructor(e){this.Ne=new zbe,this.ze=(t,n)=>this.Ue(t,n)&&this.qe(t,n)&&this.Be(t,n),this.Ue=(t,n)=>n==null||!n.event||(t==null?void 0:t.event)===(n==null?void 0:n.event),this._instance=e,this.He=new Set,this.We=new Set}init(){var e;if(!Gu((e=this._instance)==null?void 0:e.Ge)){var t;(t=this._instance)==null||t.Ge((n,r)=>{this.on(n,r)})}}register(e){var t,n;if(!Gu((t=this._instance)==null?void 0:t.Ge)&&(e.forEach(a=>{var s,l;(s=this.We)==null||s.add(a),(l=a.steps)==null||l.forEach(c=>{var u;(u=this.He)==null||u.add((c==null?void 0:c.event)||"")})}),(n=this._instance)!=null&&n.autocapture)){var r,o=new Set;e.forEach(a=>{var s;(s=a.steps)==null||s.forEach(l=>{l!=null&&l.selector&&o.add(l==null?void 0:l.selector)})}),(r=this._instance)==null||r.autocapture.setElementSelectors(o)}}on(e,t){var n;t!=null&&e.length!=0&&(this.He.has(e)||this.He.has(t==null?void 0:t.event))&&this.We&&((n=this.We)==null?void 0:n.size)>0&&this.We.forEach(r=>{this.Je(t,r)&&this.Ne.emit("actionCaptured",r.name)})}Ve(e){this.onAction("actionCaptured",t=>e(t))}Je(e,t){if((t==null?void 0:t.steps)==null)return!1;for(var n of t.steps)if(this.ze(e,n))return!0;return!1}onAction(e,t){return this.Ne.on(e,t)}qe(e,t){if(t!=null&&t.url){var n,r=e==null||(n=e.properties)==null?void 0:n.$current_url;if(!r||typeof r!="string"||!Jw.Ke(r,t==null?void 0:t.url,(t==null?void 0:t.url_matching)||"contains"))return!1}return!0}static Ke(e,t,n){switch(n){case"regex":return!!Aa&&gM(e,t);case"exact":return t===e;case"contains":var r=Jw.Ye(t).replace(/_/g,".").replace(/%/g,".*");return gM(e,r);default:return!1}}static Ye(e){return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}Be(e,t){if((t!=null&&t.href||t!=null&&t.tag_name||t!=null&&t.text)&&!this.Xe(e).some(o=>!(t!=null&&t.href&&!Jw.Ke(o.href||"",t==null?void 0:t.href,(t==null?void 0:t.href_matching)||"exact"))&&(t==null||!t.tag_name||o.tag_name===(t==null?void 0:t.tag_name))&&!(t!=null&&t.text&&!Jw.Ke(o.text||"",t==null?void 0:t.text,(t==null?void 0:t.text_matching)||"exact")&&!Jw.Ke(o.$el_text||"",t==null?void 0:t.text,(t==null?void 0:t.text_matching)||"exact"))))return!1;if(t!=null&&t.selector){var n,r=e==null||(n=e.properties)==null?void 0:n.$element_selectors;if(!r||!r.includes(t==null?void 0:t.selector))return!1}return!0}Xe(e){return(e==null?void 0:e.properties.$elements)==null?[]:e==null?void 0:e.properties.$elements}}var nx=tx("[Surveys]"),PX="seenSurvey_",mgt=(i,e)=>{var t="$survey_"+e+"/"+i.id;return i.current_iteration&&i.current_iteration>0&&(t="$survey_"+e+"/"+i.id+"/"+i.current_iteration),t};class ygt{constructor(e){this._instance=e,this.Qe=new Map,this.Ze=new Map}register(e){var t;Gu((t=this._instance)==null?void 0:t.Ge)||(this.tr(e),this.ir(e))}ir(e){var t=e.filter(n=>{var r,o;return((r=n.conditions)==null?void 0:r.actions)&&((o=n.conditions)==null||(o=o.actions)==null||(o=o.values)==null?void 0:o.length)>0});t.length!==0&&(this.er==null&&(this.er=new Jw(this._instance),this.er.init(),this.er.Ve(n=>{this.onAction(n)})),t.forEach(n=>{var r,o,a,s,l;n.conditions&&(r=n.conditions)!=null&&r.actions&&(o=n.conditions)!=null&&(o=o.actions)!=null&&o.values&&((a=n.conditions)==null||(a=a.actions)==null||(a=a.values)==null?void 0:a.length)>0&&((s=this.er)==null||s.register(n.conditions.actions.values),(l=n.conditions)==null||(l=l.actions)==null||(l=l.values)==null||l.forEach(c=>{if(c&&c.name){var u=this.Ze.get(c.name);u&&u.push(n.id),this.Ze.set(c.name,u||[n.id])}}))}))}tr(e){var t;e.filter(n=>{var r,o;return((r=n.conditions)==null?void 0:r.events)&&((o=n.conditions)==null||(o=o.events)==null||(o=o.values)==null?void 0:o.length)>0}).length!==0&&((t=this._instance)==null||t.Ge((n,r)=>{this.onEvent(n,r)}),e.forEach(n=>{var r;(r=n.conditions)==null||(r=r.events)==null||(r=r.values)==null||r.forEach(o=>{if(o&&o.name){var a=this.Qe.get(o.name);a&&a.push(n.id),this.Qe.set(o.name,a||[n.id])}})}))}onEvent(e,t){var n,r=((n=this._instance)==null||(n=n.persistence)==null?void 0:n.props[dU])||[];if(e==="survey shown"&&t&&r.length>0){var o;nx.info("survey event matched, removing survey from activated surveys",{event:e,eventPayload:t,existingActivatedSurveys:r});var a=t==null||(o=t.properties)==null?void 0:o.$survey_id;if(a){var s=r.indexOf(a);s>=0&&(r.splice(s,1),this.rr(r))}}else this.Qe.has(e)&&(nx.info("survey event matched, updating activated surveys",{event:e,surveys:this.Qe.get(e)}),this.rr(r.concat(this.Qe.get(e)||[])))}onAction(e){var t,n=((t=this._instance)==null||(t=t.persistence)==null?void 0:t.props[dU])||[];this.Ze.has(e)&&this.rr(n.concat(this.Ze.get(e)||[]))}rr(e){var t;(t=this._instance)==null||(t=t.persistence)==null||t.register({[dU]:[...new Set(e)]})}getSurveys(){var e,t=(e=this._instance)==null||(e=e.persistence)==null?void 0:e.props[dU];return t||[]}getEventToSurveys(){return this.Qe}sr(){return this.er}}class _gt{constructor(e){this.nr=void 0,this.ar=null,this.lr=!1,this.ur=!1,this.hr=[],this._instance=e,this._surveyEventReceiver=null}onRemoteConfig(e){var t=e.surveys;if(o_(t))return nx.warn("Flags not loaded yet. Not loading surveys.");var n=wI(t);this.nr=n?t.length>0:t,nx.info("flags response received, isSurveysEnabled: "+this.nr),this.loadIfEnabled()}reset(){localStorage.removeItem("lastSeenSurveyDate");for(var e=[],t=0;t<localStorage.length;t++){var n=localStorage.key(t);(n!=null&&n.startsWith(PX)||n!=null&&n.startsWith("inProgressSurvey_"))&&e.push(n)}e.forEach(r=>localStorage.removeItem(r))}loadIfEnabled(){if(!this.ar)if(this.ur)nx.info("Already initializing surveys, skipping...");else if(this._instance.config.disable_surveys)nx.info("Disabled. Not loading surveys.");else{var e=Kp==null?void 0:Kp.__PosthogExtensions__;if(e){var t=this.nr;if(!Gu(t)){this.ur=!0;try{var n=e.generateSurveys;if(n)return void this.dr(n,t);var r=e.loadExternalDependency;if(!r)return void this.vr("PostHog loadExternalDependency extension not found.");r(this._instance,"surveys",o=>{o||!e.generateSurveys?this.vr("Could not load surveys script",o):this.dr(e.generateSurveys,t)})}catch(o){throw this.vr("Error initializing surveys",o),o}finally{this.ur=!1}}}else nx.error("PostHog Extensions not found.")}}dr(e,t){this.ar=e(this._instance,t),this._surveyEventReceiver=new ygt(this._instance),nx.info("Surveys loaded successfully"),this.cr({isLoaded:!0})}vr(e,t){nx.error(e,t),this.cr({isLoaded:!1,error:e})}onSurveysLoaded(e){return this.hr.push(e),this.ar&&this.cr({isLoaded:!0}),()=>{this.hr=this.hr.filter(t=>t!==e)}}getSurveys(e,t){if(t===void 0&&(t=!1),this._instance.config.disable_surveys)return nx.info("Disabled. Not loading surveys."),e([]);var n=this._instance.get_property(jZ);if(n&&!t)return e(n,{isLoaded:!0});if(this.lr)return e([],{isLoaded:!1,error:"Surveys are already being loaded"});try{this.lr=!0,this._instance.Ee({url:this._instance.requestRouter.endpointFor("api","/api/surveys/?token="+this._instance.config.token),method:"GET",timeout:this._instance.config.surveys_request_timeout_ms,callback:r=>{var o;this.lr=!1;var a=r.statusCode;if(a!==200||!r.json){var s="Surveys API could not be loaded, status: "+a;return nx.error(s),e([],{isLoaded:!1,error:s})}var l,c=r.json.surveys||[],u=c.filter(A=>function(d){return!(!d.start_date||d.end_date)}(A)&&(function(d){var f;return!((f=d.conditions)==null||(f=f.events)==null||(f=f.values)==null||!f.length)}(A)||function(d){var f;return!((f=d.conditions)==null||(f=f.actions)==null||(f=f.values)==null||!f.length)}(A)));return u.length>0&&((l=this._surveyEventReceiver)==null||l.register(u)),(o=this._instance.persistence)==null||o.register({[jZ]:c}),e(c,{isLoaded:!0})}})}catch(r){throw this.lr=!1,r}}cr(e){for(var t of this.hr)try{e.isLoaded?this.getSurveys(t):t([],e)}catch(n){nx.error("Error in survey callback",n)}}getActiveMatchingSurveys(e,t){if(t===void 0&&(t=!1),!o_(this.ar))return this.ar.getActiveMatchingSurveys(e,t);nx.warn("init was not called")}pr(e){var t=null;return this.getSurveys(n=>{var r;t=(r=n.find(o=>o.id===e))!==null&&r!==void 0?r:null}),t}gr(e){if(o_(this.ar))return{eligible:!1,reason:"SDK is not enabled or survey functionality is not yet loaded"};var t=typeof e=="string"?this.pr(e):e;return t?this.ar.checkSurveyEligibility(t):{eligible:!1,reason:"Survey not found"}}canRenderSurvey(e){if(o_(this.ar))return nx.warn("init was not called"),{visible:!1,disabledReason:"SDK is not enabled or survey functionality is not yet loaded"};var t=this.gr(e);return{visible:t.eligible,disabledReason:t.reason}}canRenderSurveyAsync(e,t){return o_(this.ar)?(nx.warn("init was not called"),Promise.resolve({visible:!1,disabledReason:"SDK is not enabled or survey functionality is not yet loaded"})):new Promise(n=>{this.getSurveys(r=>{var o,a=(o=r.find(l=>l.id===e))!==null&&o!==void 0?o:null;if(a){var s=this.gr(a);n({visible:s.eligible,disabledReason:s.reason})}else n({visible:!1,disabledReason:"Survey not found"})},t)})}renderSurvey(e,t){if(o_(this.ar))nx.warn("init was not called");else{var n=this.pr(e),r=id==null?void 0:id.querySelector(t);n?r?this.ar.renderSurvey(n,r):nx.warn("Survey element not found"):nx.warn("Survey not found")}}}(function(i){return i.Button="button",i.Tab="tab",i.Selector="selector",i})({}),function(i){return i.TopLeft="top_left",i.TopRight="top_right",i.TopCenter="top_center",i.MiddleLeft="middle_left",i.MiddleRight="middle_right",i.MiddleCenter="middle_center",i.Left="left",i.Center="center",i.Right="right",i.NextToTrigger="next_to_trigger",i}({}),function(i){return i.Popover="popover",i.API="api",i.Widget="widget",i}({}),function(i){return i.Open="open",i.MultipleChoice="multiple_choice",i.SingleChoice="single_choice",i.Rating="rating",i.Link="link",i}({}),function(i){return i.NextQuestion="next_question",i.End="end",i.ResponseBased="response_based",i.SpecificQuestion="specific_question",i}({}),function(i){return i.Once="once",i.Recurring="recurring",i.Always="always",i}({});var UX=function(i){return i.SHOWN="survey shown",i.DISMISSED="survey dismissed",i.SENT="survey sent",i}({}),Hbe=function(i){return i.SURVEY_ID="$survey_id",i.SURVEY_NAME="$survey_name",i.SURVEY_RESPONSE="$survey_response",i.SURVEY_ITERATION="$survey_iteration",i.SURVEY_ITERATION_START_DATE="$survey_iteration_start_date",i.SURVEY_PARTIALLY_COMPLETED="$survey_partially_completed",i.SURVEY_SUBMISSION_ID="$survey_submission_id",i.SURVEY_QUESTIONS="$survey_questions",i.SURVEY_COMPLETED="$survey_completed",i}({}),Ybe=tx("[RateLimiter]");class vgt{constructor(e){var t,n;this.serverLimits={},this.lastEventRateLimited=!1,this.checkForLimiting=r=>{var o=r.text;if(o&&o.length)try{(JSON.parse(o).quota_limited||[]).forEach(a=>{Ybe.info((a||"events")+" is quota limited."),this.serverLimits[a]=new Date().getTime()+6e4})}catch(a){return void Ybe.warn('could not rate limit - continuing. Error: "'+(a==null?void 0:a.message)+'"',{text:o})}},this.instance=e,this.captureEventsPerSecond=((t=e.config.rate_limiting)==null?void 0:t.events_per_second)||10,this.captureEventsBurstLimit=Math.max(((n=e.config.rate_limiting)==null?void 0:n.events_burst_limit)||10*this.captureEventsPerSecond,this.captureEventsPerSecond),this.lastEventRateLimited=this.clientRateLimitContext(!0).isRateLimited}clientRateLimitContext(e){var t,n,r;e===void 0&&(e=!1);var o=new Date().getTime(),a=(t=(n=this.instance.persistence)==null?void 0:n.get_property(qZ))!==null&&t!==void 0?t:{tokens:this.captureEventsBurstLimit,last:o};a.tokens+=(o-a.last)/1e3*this.captureEventsPerSecond,a.last=o,a.tokens>this.captureEventsBurstLimit&&(a.tokens=this.captureEventsBurstLimit);var s=a.tokens<1;return s||e||(a.tokens=Math.max(0,a.tokens-1)),!s||this.lastEventRateLimited||e||this.instance.capture("$$client_ingestion_warning",{$$client_ingestion_warning_message:"posthog-js client rate limited. Config is set to "+this.captureEventsPerSecond+" events per second and "+this.captureEventsBurstLimit+" events burst limit."},{skip_client_rate_limiting:!0}),this.lastEventRateLimited=s,(r=this.instance.persistence)==null||r.set_property(qZ,a),{isRateLimited:s,remainingTokens:a.tokens}}isServerRateLimited(e){var t=this.serverLimits[e||"events"]||!1;return t!==!1&&new Date().getTime()<t}}var qw=tx("[RemoteConfig]");class Igt{constructor(e){this._instance=e}get remoteConfig(){var e;return(e=Kp._POSTHOG_REMOTE_CONFIG)==null||(e=e[this._instance.config.token])==null?void 0:e.config}_r(e){var t,n;(t=Kp.__PosthogExtensions__)!=null&&t.loadExternalDependency?(n=Kp.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this._instance,"remote-config",()=>e(this.remoteConfig)):(qw.error("PostHog Extensions not found. Cannot load remote config."),e())}mr(e){this._instance.Ee({method:"GET",url:this._instance.requestRouter.endpointFor("assets","/array/"+this._instance.config.token+"/config"),callback:t=>{e(t.json)}})}load(){try{if(this.remoteConfig)return qw.info("Using preloaded remote config",this.remoteConfig),void this.Ie(this.remoteConfig);if(this._instance.I())return void qw.warn("Remote config is disabled. Falling back to local config.");this._r(e=>{if(!e)return qw.info("No config found after loading remote JS config. Falling back to JSON."),void this.mr(t=>{this.Ie(t)});this.Ie(e)})}catch(e){qw.error("Error loading remote config",e)}}Ie(e){e?this._instance.config.__preview_remote_config?(this._instance.Ie(e),e.hasFeatureFlags!==!1&&this._instance.featureFlags.ensureFlagsLoaded()):qw.info("__preview_remote_config is disabled. Logging config instead",e):qw.error("Failed to fetch remote config from PostHog.")}}var LX=3e3;class Cgt{constructor(e,t){this.br=!0,this.yr=[],this.wr=Qb((t==null?void 0:t.flush_interval_ms)||LX,250,5e3,"flush interval",LX),this.Sr=e}enqueue(e){this.yr.push(e),this.$r||this.kr()}unload(){this.Er();var e=this.yr.length>0?this.Ir():{},t=Object.values(e);[...t.filter(n=>n.url.indexOf("/e")===0),...t.filter(n=>n.url.indexOf("/e")!==0)].map(n=>{this.Sr(PA({},n,{transport:"sendBeacon"}))})}enable(){this.br=!1,this.kr()}kr(){var e=this;this.br||(this.$r=setTimeout(()=>{if(this.Er(),this.yr.length>0){var t=this.Ir(),n=function(){var o=t[r],a=new Date().getTime();o.data&&wI(o.data)&&nv(o.data,s=>{s.offset=Math.abs(s.timestamp-a),delete s.timestamp}),e.Sr(o)};for(var r in t)n()}},this.wr))}Er(){clearTimeout(this.$r),this.$r=void 0}Ir(){var e={};return nv(this.yr,t=>{var n,r=t,o=(r?r.batchKey:null)||r.url;Gu(e[o])&&(e[o]=PA({},r,{data:[]})),(n=e[o].data)==null||n.push(r.data)}),this.yr=[],e}}var xgt=["retriesPerformedSoFar"];class Egt{constructor(e){this.Pr=!1,this.Rr=3e3,this.yr=[],this._instance=e,this.yr=[],this.Tr=!0,!Gu(Aa)&&"onLine"in Aa.navigator&&(this.Tr=Aa.navigator.onLine,LI(Aa,"online",()=>{this.Tr=!0,this.se()}),LI(Aa,"offline",()=>{this.Tr=!1}))}get length(){return this.yr.length}retriableRequest(e){var{retriesPerformedSoFar:t}=e,n=Jxe(e,xgt);Kx(t)&&t>0&&(n.url=TU(n.url,{retry_count:t})),this._instance.Ee(PA({},n,{callback:r=>{r.statusCode!==200&&(r.statusCode<400||r.statusCode>=500)&&(t??0)<10?this.Mr(PA({retriesPerformedSoFar:t},n)):n.callback==null||n.callback(r)}}))}Mr(e){var t=e.retriesPerformedSoFar||0;e.retriesPerformedSoFar=t+1;var n=function(a){var s=3e3*Math.pow(2,a),l=s/2,c=Math.min(18e5,s),u=(Math.random()-.5)*(c-l);return Math.ceil(c+u)}(t),r=Date.now()+n;this.yr.push({retryAt:r,requestOptions:e});var o="Enqueued failed request for retry in "+n;navigator.onLine||(o+=" (Browser is offline)"),Qd.warn(o),this.Pr||(this.Pr=!0,this.Cr())}Cr(){this.Fr&&clearTimeout(this.Fr),this.Fr=setTimeout(()=>{this.Tr&&this.yr.length>0&&this.se(),this.Cr()},this.Rr)}se(){var e=Date.now(),t=[],n=this.yr.filter(o=>o.retryAt<e||(t.push(o),!1));if(this.yr=t,n.length>0)for(var{requestOptions:r}of n)this.retriableRequest(r)}unload(){for(var{requestOptions:e}of(this.Fr&&(clearTimeout(this.Fr),this.Fr=void 0),this.yr))try{this._instance.Ee(PA({},e,{transport:"sendBeacon"}))}catch(t){Qd.error(t)}this.yr=[]}}class bgt{constructor(e){this.Or=()=>{var t,n,r,o;this.Ar||(this.Ar={});var a=this.scrollElement(),s=this.scrollY(),l=a?Math.max(0,a.scrollHeight-a.clientHeight):0,c=s+((a==null?void 0:a.clientHeight)||0),u=(a==null?void 0:a.scrollHeight)||0;this.Ar.lastScrollY=Math.ceil(s),this.Ar.maxScrollY=Math.max(s,(t=this.Ar.maxScrollY)!==null&&t!==void 0?t:0),this.Ar.maxScrollHeight=Math.max(l,(n=this.Ar.maxScrollHeight)!==null&&n!==void 0?n:0),this.Ar.lastContentY=c,this.Ar.maxContentY=Math.max(c,(r=this.Ar.maxContentY)!==null&&r!==void 0?r:0),this.Ar.maxContentHeight=Math.max(u,(o=this.Ar.maxContentHeight)!==null&&o!==void 0?o:0)},this._instance=e}getContext(){return this.Ar}resetContext(){var e=this.Ar;return setTimeout(this.Or,0),e}startMeasuringScrollPosition(){LI(Aa,"scroll",this.Or,{capture:!0}),LI(Aa,"scrollend",this.Or,{capture:!0}),LI(Aa,"resize",this.Or)}scrollElement(){if(!this._instance.config.scroll_root_selector)return Aa==null?void 0:Aa.document.documentElement;var e=wI(this._instance.config.scroll_root_selector)?this._instance.config.scroll_root_selector:[this._instance.config.scroll_root_selector];for(var t of e){var n=Aa==null?void 0:Aa.document.querySelector(t);if(n)return n}}scrollY(){if(this._instance.config.scroll_root_selector){var e=this.scrollElement();return e&&e.scrollTop||0}return Aa&&(Aa.scrollY||Aa.pageYOffset||Aa.document.documentElement.scrollTop)||0}scrollX(){if(this._instance.config.scroll_root_selector){var e=this.scrollElement();return e&&e.scrollLeft||0}return Aa&&(Aa.scrollX||Aa.pageXOffset||Aa.document.documentElement.scrollLeft)||0}}var Bgt=i=>Pbe(i==null?void 0:i.config.mask_personal_data_properties,i==null?void 0:i.config.custom_personal_data_properties);class Sgt{constructor(e,t,n,r){this.Dr=o=>{var a=this.Lr();if(!a||a.sessionId!==o){var s={sessionId:o,props:this.jr(this._instance)};this.Nr.register({[JZ]:s})}},this._instance=e,this.zr=t,this.Nr=n,this.jr=r||Bgt,this.zr.onSessionId(this.Dr)}Lr(){return this.Nr.props[JZ]}getSetOnceProps(){var e,t=(e=this.Lr())==null?void 0:e.props;return t?"r"in t?Ube(t):{$referring_domain:t.referringDomain,$pathname:t.initialPathName,utm_source:t.utm_source,utm_campaign:t.utm_campaign,utm_medium:t.utm_medium,utm_content:t.utm_content,utm_term:t.utm_term}:{}}getSessionProps(){var e={};return nv(GZ(this.getSetOnceProps()),(t,n)=>{n==="$current_url"&&(n="url"),e["$session_entry_"+LZ(n)]=t}),e}}var Vbe=tx("[SessionId]");class wgt{constructor(e,t,n){var r;if(this.Ur=[],!e.persistence)throw new Error("SessionIdManager requires a PostHogPersistence instance");if(e.config.__preview_experimental_cookieless_mode)throw new Error("SessionIdManager cannot be used with __preview_experimental_cookieless_mode");this.S=e.config,this.Nr=e.persistence,this.fi=void 0,this.Ct=void 0,this._sessionStartTimestamp=null,this._sessionActivityTimestamp=null,this.qr=t||l3,this.Br=n||l3;var o=this.S.persistence_name||this.S.token,a=this.S.session_idle_timeout_seconds||1800;if(this._sessionTimeoutMs=1e3*Qb(a,60,36e3,"session_idle_timeout_seconds",1800),e.register({$configured_session_timeout_ms:this._sessionTimeoutMs}),this.Hr(),this.Wr="ph_"+o+"_window_id",this.Gr="ph_"+o+"_primary_window_exists",this.Jr()){var s=mx.L(this.Wr),l=mx.L(this.Gr);s&&!l?this.fi=s:mx.N(this.Wr),mx.j(this.Gr,!0)}if((r=this.S.bootstrap)!=null&&r.sessionID)try{var c=(u=>{var A=u.replace(/-/g,"");if(A.length!==32)throw new Error("Not a valid UUID");if(A[12]!=="7")throw new Error("Not a UUIDv7");return parseInt(A.substring(0,12),16)})(this.S.bootstrap.sessionID);this.Vr(this.S.bootstrap.sessionID,new Date().getTime(),c)}catch(u){Vbe.error("Invalid sessionID in bootstrap",u)}this.Kr()}get sessionTimeoutMs(){return this._sessionTimeoutMs}onSessionId(e){return Gu(this.Ur)&&(this.Ur=[]),this.Ur.push(e),this.Ct&&e(this.Ct,this.fi),()=>{this.Ur=this.Ur.filter(t=>t!==e)}}Jr(){return this.S.persistence!=="memory"&&!this.Nr.Fe&&mx.O()}Yr(e){e!==this.fi&&(this.fi=e,this.Jr()&&mx.j(this.Wr,e))}Xr(){return this.fi?this.fi:this.Jr()?mx.L(this.Wr):null}Vr(e,t,n){e===this.Ct&&t===this._sessionActivityTimestamp&&n===this._sessionStartTimestamp||(this._sessionStartTimestamp=n,this._sessionActivityTimestamp=t,this.Ct=e,this.Nr.register({[uU]:[t,e,n]}))}Qr(){if(this.Ct&&this._sessionActivityTimestamp&&this._sessionStartTimestamp)return[this._sessionActivityTimestamp,this.Ct,this._sessionStartTimestamp];var e=this.Nr.props[uU];return wI(e)&&e.length===2&&e.push(e[0]),e||[0,null,0]}resetSessionId(){this.Vr(null,null,null)}Kr(){LI(Aa,"beforeunload",()=>{this.Jr()&&mx.N(this.Gr)},{capture:!1})}checkAndGetSessionAndWindowId(e,t){if(e===void 0&&(e=!1),t===void 0&&(t=null),this.S.__preview_experimental_cookieless_mode)throw new Error("checkAndGetSessionAndWindowId should not be called in __preview_experimental_cookieless_mode");var n=t||new Date().getTime(),[r,o,a]=this.Qr(),s=this.Xr(),l=Kx(a)&&a>0&&Math.abs(n-a)>864e5,c=!1,u=!o,A=!e&&Math.abs(n-r)>this.sessionTimeoutMs;u||A||l?(o=this.qr(),s=this.Br(),Vbe.info("new session ID generated",{sessionId:o,windowId:s,changeReason:{noSessionId:u,activityTimeout:A,sessionPastMaximumLength:l}}),a=n,c=!0):s||(s=this.Br(),c=!0);var d=r===0||!e||l?n:r,f=a===0?new Date().getTime():a;return this.Yr(s),this.Vr(o,d,f),e||this.Hr(),c&&this.Ur.forEach(h=>h(o,s,c?{noSessionId:u,activityTimeout:A,sessionPastMaximumLength:l}:void 0)),{sessionId:o,windowId:s,sessionStartTimestamp:f,changeReason:c?{noSessionId:u,activityTimeout:A,sessionPastMaximumLength:l}:void 0,lastActivityTimestamp:r}}Hr(){clearTimeout(this.Zr),this.Zr=setTimeout(()=>{this.resetSessionId()},1.1*this.sessionTimeoutMs)}}var Qgt=["$set_once","$set"],d3=tx("[SiteApps]");class Mgt{constructor(e){this._instance=e,this.ts=[],this.apps={}}get isEnabled(){return!!this._instance.config.opt_in_site_apps}es(e,t){if(t){var n=this.globalsForEvent(t);this.ts.push(n),this.ts.length>1e3&&(this.ts=this.ts.slice(10))}}get siteAppLoaders(){var e;return(e=Kp._POSTHOG_REMOTE_CONFIG)==null||(e=e[this._instance.config.token])==null?void 0:e.siteApps}init(){if(this.isEnabled){var e=this._instance.Ge(this.es.bind(this));this.rs=()=>{e(),this.ts=[],this.rs=void 0}}}globalsForEvent(e){var t,n,r,o,a,s,l;if(!e)throw new Error("Event payload is required");var c={},u=this._instance.get_property("$groups")||[],A=this._instance.get_property("$stored_group_properties")||{};for(var[d,f]of Object.entries(A))c[d]={id:u[d],type:d,properties:f};var{$set_once:h,$set:y}=e;return{event:PA({},Jxe(e,Qgt),{properties:PA({},e.properties,y?{$set:PA({},(t=(n=e.properties)==null?void 0:n.$set)!==null&&t!==void 0?t:{},y)}:{},h?{$set_once:PA({},(r=(o=e.properties)==null?void 0:o.$set_once)!==null&&r!==void 0?r:{},h)}:{}),elements_chain:(a=(s=e.properties)==null?void 0:s.$elements_chain)!==null&&a!==void 0?a:"",distinct_id:(l=e.properties)==null?void 0:l.distinct_id}),person:{properties:this._instance.get_property("$stored_person_properties")},groups:c}}setupSiteApp(e){var t=this.apps[e.id],n=()=>{var s;!t.errored&&this.ts.length&&(d3.info("Processing "+this.ts.length+" events for site app with id "+e.id),this.ts.forEach(l=>t.processEvent==null?void 0:t.processEvent(l)),t.processedBuffer=!0),Object.values(this.apps).every(l=>l.processedBuffer||l.errored)&&((s=this.rs)==null||s.call(this))},r=!1,o=s=>{t.errored=!s,t.loaded=!0,d3.info("Site app with id "+e.id+" "+(s?"loaded":"errored")),r&&n()};try{var{processEvent:a}=e.init({posthog:this._instance,callback:s=>{o(s)}});a&&(t.processEvent=a),r=!0}catch(s){d3.error("Error while initializing PostHog app with config id "+e.id,s),o(!1)}if(r&&t.loaded)try{n()}catch(s){d3.error("Error while processing buffered events PostHog app with config id "+e.id,s),t.errored=!0}}ss(){var e=this.siteAppLoaders||[];for(var t of e)this.apps[t.id]={id:t.id,loaded:!1,errored:!1,processedBuffer:!1};for(var n of e)this.setupSiteApp(n)}ns(e){if(Object.keys(this.apps).length!==0){var t=this.globalsForEvent(e);for(var n of Object.values(this.apps))try{n.processEvent==null||n.processEvent(t)}catch(r){d3.error("Error while processing event "+e.event+" for site app "+n.id,r)}}}onRemoteConfig(e){var t,n,r,o=this;if((t=this.siteAppLoaders)!=null&&t.length)return this.isEnabled?(this.ss(),void this._instance.on("eventCaptured",c=>this.ns(c))):void d3.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.');if((n=this.rs)==null||n.call(this),(r=e.siteApps)!=null&&r.length)if(this.isEnabled){var a=function(c){var u;Kp["__$$ph_site_app_"+c]=o._instance,(u=Kp.__PosthogExtensions__)==null||u.loadSiteApp==null||u.loadSiteApp(o._instance,l,A=>{if(A)return d3.error("Error while initializing PostHog app with config id "+c,A)})};for(var{id:s,url:l}of e.siteApps)a(s)}else d3.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}}var Rgt=["amazonbot","amazonproductbot","app.hypefactors.com","applebot","archive.org_bot","awariobot","backlinksextendedbot","baiduspider","bingbot","bingpreview","chrome-lighthouse","dataforseobot","deepscan","duckduckbot","facebookexternal","facebookcatalog","http://yandex.com/bots","hubspot","ia_archiver","leikibot","linkedinbot","meta-externalagent","mj12bot","msnbot","nessus","petalbot","pinterest","prerender","rogerbot","screaming frog","sebot-wa","sitebulb","slackbot","slurp","trendictionbot","turnitin","twitterbot","vercelbot","yahoo! slurp","yandexbot","zoombot","bot.htm","bot.php","(bot;","bot/","crawler","ahrefsbot","ahrefssiteaudit","semrushbot","siteauditbot","splitsignalbot","gptbot","oai-searchbot","chatgpt-user","perplexitybot","better uptime bot","sentryuptimebot","uptimerobot","headlesschrome","cypress","google-hoteladsverifier","adsbot-google","apis-google","duplexweb-google","feedfetcher-google","google favicon","google web preview","google-read-aloud","googlebot","googleother","google-cloudvertexbot","googleweblight","mediapartners-google","storebot-google","google-inspectiontool","bytespider"],Kbe=function(i,e){if(!i)return!1;var t=i.toLowerCase();return Rgt.concat(e||[]).some(n=>{var r=n.toLowerCase();return t.indexOf(r)!==-1})},jbe=function(i,e){if(!i)return!1;var t=i.userAgent;if(t&&Kbe(t,e))return!0;try{var n=i==null?void 0:i.userAgentData;if(n!=null&&n.brands&&n.brands.some(r=>Kbe(r==null?void 0:r.brand,e)))return!0}catch{}return!!i.webdriver},d8=function(i){return i.US="us",i.EU="eu",i.CUSTOM="custom",i}({}),Jbe="i.posthog.com";class Dgt{constructor(e){this.os={},this.instance=e}get apiHost(){var e=this.instance.config.api_host.trim().replace(/\/$/,"");return e==="https://app.posthog.com"?"https://us.i.posthog.com":e}get uiHost(){var e,t=(e=this.instance.config.ui_host)==null?void 0:e.replace(/\/$/,"");return t||(t=this.apiHost.replace("."+Jbe,".posthog.com")),t==="https://app.posthog.com"?"https://us.posthog.com":t}get region(){return this.os[this.apiHost]||(/https:\/\/(app|us|us-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?this.os[this.apiHost]=d8.US:/https:\/\/(eu|eu-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?this.os[this.apiHost]=d8.EU:this.os[this.apiHost]=d8.CUSTOM),this.os[this.apiHost]}endpointFor(e,t){if(t===void 0&&(t=""),t&&(t=t[0]==="/"?t:"/"+t),e==="ui")return this.uiHost+t;if(this.region===d8.CUSTOM)return this.apiHost+t;var n=Jbe+t;switch(e){case"assets":return"https://"+this.region+"-assets."+n;case"api":return"https://"+this.region+"."+n}}}var Ngt={icontains:(i,e)=>!!Aa&&e.href.toLowerCase().indexOf(i.toLowerCase())>-1,not_icontains:(i,e)=>!!Aa&&e.href.toLowerCase().indexOf(i.toLowerCase())===-1,regex:(i,e)=>!!Aa&&gM(e.href,i),not_regex:(i,e)=>!!Aa&&!gM(e.href,i),exact:(i,e)=>e.href===i,is_not:(i,e)=>e.href!==i};class qx{constructor(e){var t=this;this.getWebExperimentsAndEvaluateDisplayLogic=function(n){n===void 0&&(n=!1),t.getWebExperiments(r=>{qx.ls("retrieved web experiments from the server"),t.us=new Map,r.forEach(o=>{if(o.feature_flag_key){var a;t.us&&(qx.ls("setting flag key ",o.feature_flag_key," to web experiment ",o),(a=t.us)==null||a.set(o.feature_flag_key,o));var s=t._instance.getFeatureFlag(o.feature_flag_key);AC(s)&&o.variants[s]&&t.hs(o.name,s,o.variants[s].transforms)}else if(o.variants)for(var l in o.variants){var c=o.variants[l];qx.ds(c)&&t.hs(o.name,l,c.transforms)}})},n)},this._instance=e,this._instance.onFeatureFlags(n=>{this.onFeatureFlags(n)})}onFeatureFlags(e){if(this._is_bot())qx.ls("Refusing to render web experiment since the viewer is a likely bot");else if(!this._instance.config.disable_web_experiments){if(o_(this.us))return this.us=new Map,this.loadIfEnabled(),void this.previewWebExperiment();qx.ls("applying feature flags",e),e.forEach(t=>{var n;if(this.us&&(n=this.us)!=null&&n.has(t)){var r,o=this._instance.getFeatureFlag(t),a=(r=this.us)==null?void 0:r.get(t);o&&a!=null&&a.variants[o]&&this.hs(a.name,o,a.variants[o].transforms)}})}}previewWebExperiment(){var e=qx.getWindowLocation();if(e!=null&&e.search){var t=vU(e==null?void 0:e.search,"__experiment_id"),n=vU(e==null?void 0:e.search,"__experiment_variant");t&&n&&(qx.ls("previewing web experiments "+t+" && "+n),this.getWebExperiments(r=>{this.vs(parseInt(t),n,r)},!1,!0))}}loadIfEnabled(){this._instance.config.disable_web_experiments||this.getWebExperimentsAndEvaluateDisplayLogic()}getWebExperiments(e,t,n){if(this._instance.config.disable_web_experiments&&!n)return e([]);var r=this._instance.get_property("$web_experiments");if(r&&!t)return e(r);this._instance.Ee({url:this._instance.requestRouter.endpointFor("api","/api/web_experiments/?token="+this._instance.config.token),method:"GET",callback:o=>{if(o.statusCode!==200||!o.json)return e([]);var a=o.json.experiments||[];return e(a)}})}vs(e,t,n){var r=n.filter(o=>o.id===e);r&&r.length>0&&(qx.ls("Previewing web experiment ["+r[0].name+"] with variant ["+t+"]"),this.hs(r[0].name,t,r[0].variants[t].transforms))}static ds(e){return!o_(e.conditions)&&qx.cs(e)&&qx.fs(e)}static cs(e){var t;if(o_(e.conditions)||o_((t=e.conditions)==null?void 0:t.url))return!0;var n,r,o,a=qx.getWindowLocation();return!!a&&((n=e.conditions)==null||!n.url||Ngt[(r=(o=e.conditions)==null?void 0:o.urlMatchType)!==null&&r!==void 0?r:"icontains"](e.conditions.url,a))}static getWindowLocation(){return Aa==null?void 0:Aa.location}static fs(e){var t;if(o_(e.conditions)||o_((t=e.conditions)==null?void 0:t.utm))return!0;var n=Rbe();if(n.utm_source){var r,o,a,s,l,c,u,A,d=(r=e.conditions)==null||(r=r.utm)==null||!r.utm_campaign||((o=e.conditions)==null||(o=o.utm)==null?void 0:o.utm_campaign)==n.utm_campaign,f=(a=e.conditions)==null||(a=a.utm)==null||!a.utm_source||((s=e.conditions)==null||(s=s.utm)==null?void 0:s.utm_source)==n.utm_source,h=(l=e.conditions)==null||(l=l.utm)==null||!l.utm_medium||((c=e.conditions)==null||(c=c.utm)==null?void 0:c.utm_medium)==n.utm_medium,y=(u=e.conditions)==null||(u=u.utm)==null||!u.utm_term||((A=e.conditions)==null||(A=A.utm)==null?void 0:A.utm_term)==n.utm_term;return d&&h&&y&&f}return!1}static ls(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];Qd.info("[WebExperiments] "+e,n)}hs(e,t,n){this._is_bot()?qx.ls("Refusing to render web experiment since the viewer is a likely bot"):t!=="control"?n.forEach(r=>{if(r.selector){var o;qx.ls("applying transform of variant "+t+" for experiment "+e+" ",r);var a=(o=document)==null?void 0:o.querySelectorAll(r.selector);a==null||a.forEach(s=>{var l=s;r.html&&(l.innerHTML=r.html),r.css&&l.setAttribute("style",r.css)})}}):qx.ls("Control variants leave the page unmodified.")}_is_bot(){return wb&&this._instance?jbe(wb,this._instance.config.custom_blocked_useragents):void 0}}var Tgt=tx("[PostHog ExternalIntegrations]"),kgt={intercom:"intercom-integration",crispChat:"crisp-chat-integration"};class Pgt{constructor(e){this._instance=e}J(e,t){var n;(n=Kp.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this._instance,e,r=>{if(r)return Tgt.error("failed to load script",r);t()})}startIfEnabledOrStop(){var e=this,t=function(a){var s,l,c;!r||(s=Kp.__PosthogExtensions__)!=null&&(s=s.integrations)!=null&&s[a]||e.J(kgt[a],()=>{var u;(u=Kp.__PosthogExtensions__)==null||(u=u.integrations)==null||(u=u[a])==null||u.start(e._instance)}),!r&&(l=Kp.__PosthogExtensions__)!=null&&(l=l.integrations)!=null&&l[a]&&((c=Kp.__PosthogExtensions__)==null||(c=c.integrations)==null||(c=c[a])==null||c.stop())};for(var[n,r]of Object.entries((o=this._instance.config.integrations)!==null&&o!==void 0?o:{})){var o;t(n)}}}var f8={},FX=()=>{},IM="posthog",qbe=!qpt&&(KE==null?void 0:KE.indexOf("MSIE"))===-1&&(KE==null?void 0:KE.indexOf("Mozilla"))===-1,Zbe=i=>{var e;return{api_host:"https://us.i.posthog.com",ui_host:null,token:"",autocapture:!0,rageclick:!0,cross_subdomain_cookie:S0t(id==null?void 0:id.location),persistence:"localStorage+cookie",persistence_name:"",loaded:FX,save_campaign_params:!0,custom_campaign_params:[],custom_blocked_useragents:[],save_referrer:!0,capture_pageview:i!=="2025-05-24"||"history_change",capture_pageleave:"if_capture_pageview",defaults:i??"unset",debug:VE&&AC(VE==null?void 0:VE.search)&&VE.search.indexOf("__posthog_debug=true")!==-1||!1,cookie_expiration:365,upgrade:!1,disable_session_recording:!1,disable_persistence:!1,disable_web_experiments:!0,disable_surveys:!1,disable_surveys_automatic_display:!1,disable_external_dependency_loading:!1,enable_recording_console_log:void 0,secure_cookie:(Aa==null||(e=Aa.location)==null?void 0:e.protocol)==="https:",ip:!1,opt_out_capturing_by_default:!1,opt_out_persistence_by_default:!1,opt_out_useragent_filter:!1,opt_out_capturing_persistence_type:"localStorage",opt_out_capturing_cookie_prefix:null,opt_in_site_apps:!1,property_denylist:[],respect_dnt:!1,sanitize_properties:null,request_headers:{},request_batching:!0,properties_string_max_length:65535,session_recording:{},mask_all_element_attributes:!1,mask_all_text:!1,mask_personal_data_properties:!1,custom_personal_data_properties:[],advanced_disable_flags:!1,advanced_disable_decide:!1,advanced_disable_feature_flags:!1,advanced_disable_feature_flags_on_first_load:!1,advanced_only_evaluate_survey_feature_flags:!1,advanced_disable_toolbar_metrics:!1,feature_flag_request_timeout_ms:3e3,surveys_request_timeout_ms:1e4,on_request_error:t=>{var n="Bad HTTP status: "+t.statusCode+" "+t.text;Qd.error(n)},get_device_id:t=>t,capture_performance:void 0,name:"posthog",bootstrap:{},disable_compression:!1,session_idle_timeout_seconds:1800,person_profiles:"identified_only",before_send:void 0,request_queue_config:{flush_interval_ms:LX},error_tracking:{},_onCapture:FX}},Xbe=i=>{var e={};Gu(i.process_person)||(e.person_profiles=i.process_person),Gu(i.xhr_headers)||(e.request_headers=i.xhr_headers),Gu(i.cookie_name)||(e.persistence_name=i.cookie_name),Gu(i.disable_cookie)||(e.disable_persistence=i.disable_cookie),Gu(i.store_google)||(e.save_campaign_params=i.store_google),Gu(i.verbose)||(e.debug=i.verbose);var t=RC({},e,i);return wI(i.property_blacklist)&&(Gu(i.property_denylist)?t.property_denylist=i.property_blacklist:wI(i.property_denylist)?t.property_denylist=[...i.property_blacklist,...i.property_denylist]:Qd.error("Invalid value for property_denylist config: "+i.property_denylist)),t};class Ugt{constructor(){this.__forceAllowLocalhost=!1}get ps(){return this.__forceAllowLocalhost}set ps(e){Qd.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=e}}class FU{get decideEndpointWasHit(){var e,t;return(e=(t=this.featureFlags)==null?void 0:t.hasLoadedFlags)!==null&&e!==void 0&&e}get flagsEndpointWasHit(){var e,t;return(e=(t=this.featureFlags)==null?void 0:t.hasLoadedFlags)!==null&&e!==void 0&&e}constructor(){this.webPerformance=new Ugt,this.gs=!1,this.version=PS.LIB_VERSION,this._s=new zbe,this._calculate_event_properties=this.calculateEventProperties.bind(this),this.config=Zbe(),this.SentryIntegration=Fpt,this.sentryIntegration=e=>function(t,n){var r=obe(t,n);return{name:rbe,processEvent:o=>r(o)}}(this,e),this.__request_queue=[],this.__loaded=!1,this.analyticsDefaultEndpoint="/e/",this.bs=!1,this.ys=null,this.ws=null,this.Ss=null,this.featureFlags=new pgt(this),this.toolbar=new Opt(this),this.scrollManager=new bgt(this),this.pageViewManager=new jpt(this),this.surveys=new _gt(this),this.experiments=new qx(this),this.exceptions=new Wpt(this),this.rateLimiter=new vgt(this),this.requestRouter=new Dgt(this),this.consent=new q0t(this),this.externalIntegrations=new Pgt(this),this.people={set:(e,t,n)=>{var r=AC(e)?{[e]:t}:e;this.setPersonProperties(r),n==null||n({})},set_once:(e,t,n)=>{var r=AC(e)?{[e]:t}:e;this.setPersonProperties(void 0,r),n==null||n({})}},this.on("eventCaptured",e=>Qd.info('send "'+(e==null?void 0:e.event)+'"',e))}init(e,t,n){if(n&&n!==IM){var r,o=(r=f8[n])!==null&&r!==void 0?r:new FU;return o._init(e,t,n),f8[n]=o,f8[IM][n]=o,o}return this._init(e,t,n)}_init(e,t,n){var r,o;if(t===void 0&&(t={}),Gu(e)||FZ(e))return Qd.critical("PostHog was initialized without a token. This likely indicates a misconfiguration. Please check the first argument passed to posthog.init()"),this;if(this.__loaded)return Qd.warn("You have already initialized PostHog! Re-initializing is a no-op"),this;this.__loaded=!0,this.config={},this.$s=t,this.ks=[],t.person_profiles&&(this.ws=t.person_profiles),this.set_config(RC({},Zbe(t.defaults),Xbe(t),{name:n,token:e})),this.config.on_xhr_error&&Qd.error("on_xhr_error is deprecated. Use on_request_error instead"),this.compression=t.disable_compression?void 0:US.GZipJS;var a=this.xs();this.persistence=new kX(this.config,a),this.sessionPersistence=this.config.persistence==="sessionStorage"||this.config.persistence==="memory"?this.persistence:new kX(PA({},this.config,{persistence:"sessionStorage"}),a);var s=PA({},this.persistence.props),l=PA({},this.sessionPersistence.props);if(this.register({$initialization_time:new Date().toISOString()}),this.Es=new Cgt(E=>this.Is(E),this.config.request_queue_config),this.Ps=new Egt(this),this.__request_queue=[],this.config.__preview_experimental_cookieless_mode||(this.sessionManager=new wgt(this),this.sessionPropsManager=new Sgt(this,this.sessionManager,this.persistence)),new Hpt(this).startIfEnabledOrStop(),this.siteApps=new Mgt(this),(r=this.siteApps)==null||r.init(),this.config.__preview_experimental_cookieless_mode||(this.sessionRecording=new Upt(this),this.sessionRecording.startIfEnabledOrStop()),this.config.disable_scroll_properties||this.scrollManager.startMeasuringScrollPosition(),this.autocapture=new O0t(this),this.autocapture.startIfEnabled(),this.surveys.loadIfEnabled(),this.heatmaps=new Kpt(this),this.heatmaps.startIfEnabled(),this.webVitalsAutocapture=new Ypt(this),this.exceptionObserver=new W0t(this),this.exceptionObserver.startIfEnabled(),this.deadClicksAutocapture=new QEe(this,X0t),this.deadClicksAutocapture.startIfEnabled(),this.historyAutocapture=new dpt(this),this.historyAutocapture.startIfEnabled(),PS.DEBUG=PS.DEBUG||this.config.debug,PS.DEBUG&&Qd.info("Starting in debug mode",{this:this,config:t,thisC:PA({},this.config),p:s,s:l}),((o=t.bootstrap)==null?void 0:o.distinctID)!==void 0){var c,u,A=this.config.get_device_id(l3()),d=(c=t.bootstrap)!=null&&c.isIdentifiedID?A:t.bootstrap.distinctID;this.persistence.set_property(LS,(u=t.bootstrap)!=null&&u.isIdentifiedID?"identified":"anonymous"),this.register({distinct_id:t.bootstrap.distinctID,$device_id:d})}if(this.Rs()){var f,h,y=Object.keys(((f=t.bootstrap)==null?void 0:f.featureFlags)||{}).filter(E=>{var b;return!((b=t.bootstrap)==null||(b=b.featureFlags)==null||!b[E])}).reduce((E,b)=>{var M;return E[b]=((M=t.bootstrap)==null||(M=M.featureFlags)==null?void 0:M[b])||!1,E},{}),_=Object.keys(((h=t.bootstrap)==null?void 0:h.featureFlagPayloads)||{}).filter(E=>y[E]).reduce((E,b)=>{var M,Y;return(M=t.bootstrap)!=null&&(M=M.featureFlagPayloads)!=null&&M[b]&&(E[b]=(Y=t.bootstrap)==null||(Y=Y.featureFlagPayloads)==null?void 0:Y[b]),E},{});this.featureFlags.receivedFeatureFlags({featureFlags:y,featureFlagPayloads:_})}if(this.config.__preview_experimental_cookieless_mode)this.register_once({distinct_id:gU,$device_id:null},"");else if(!this.get_distinct_id()){var v=this.config.get_device_id(l3());this.register_once({distinct_id:v,$device_id:v},""),this.persistence.set_property(LS,"anonymous")}return LI(Aa,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this),{passive:!1}),this.toolbar.maybeLoadToolbar(),t.segment?Lpt(this,()=>this.Ts()):this.Ts(),n2(this.config._onCapture)&&this.config._onCapture!==FX&&(Qd.warn("onCapture is deprecated. Please use `before_send` instead"),this.on("eventCaptured",E=>this.config._onCapture(E.event,E))),this.config.ip&&Qd.warn('The `ip` config option has NO EFFECT AT ALL and has been deprecated. Use a custom transformation or "Discard IP data" project setting instead. See https://posthog.com/tutorials/web-redact-properties#hiding-customer-ip-address for more information.'),this}Ie(e){var t,n,r,o,a,s,l,c;if(!id||!id.body)return Qd.info("document not ready yet, trying again in 500 milliseconds..."),void setTimeout(()=>{this.Ie(e)},500);this.compression=void 0,e.supportedCompression&&!this.config.disable_compression&&(this.compression=iy(e.supportedCompression,US.GZipJS)?US.GZipJS:iy(e.supportedCompression,US.Base64)?US.Base64:void 0),(t=e.analytics)!=null&&t.endpoint&&(this.analyticsDefaultEndpoint=e.analytics.endpoint),this.set_config({person_profiles:this.ws?this.ws:"identified_only"}),(n=this.siteApps)==null||n.onRemoteConfig(e),(r=this.sessionRecording)==null||r.onRemoteConfig(e),(o=this.autocapture)==null||o.onRemoteConfig(e),(a=this.heatmaps)==null||a.onRemoteConfig(e),this.surveys.onRemoteConfig(e),(s=this.webVitalsAutocapture)==null||s.onRemoteConfig(e),(l=this.exceptionObserver)==null||l.onRemoteConfig(e),this.exceptions.onRemoteConfig(e),(c=this.deadClicksAutocapture)==null||c.onRemoteConfig(e)}Ts(){try{this.config.loaded(this)}catch(e){Qd.critical("`loaded` function failed",e)}this.Ms(),this.config.capture_pageview&&setTimeout(()=>{this.consent.isOptedIn()&&this.Cs()},1),new Igt(this).load(),this.featureFlags.flags()}Ms(){var e;this.has_opted_out_capturing()||this.config.request_batching&&((e=this.Es)==null||e.enable())}_dom_loaded(){this.has_opted_out_capturing()||a3(this.__request_queue,e=>this.Is(e)),this.__request_queue=[],this.Ms()}_handle_unload(){var e,t;this.config.request_batching?(this.Fs()&&this.capture("$pageleave"),(e=this.Es)==null||e.unload(),(t=this.Ps)==null||t.unload()):this.Fs()&&this.capture("$pageleave",null,{transport:"sendBeacon"})}Ee(e){this.__loaded&&(qbe?this.__request_queue.push(e):this.rateLimiter.isServerRateLimited(e.batchKey)||(e.transport=e.transport||this.config.api_transport,e.url=TU(e.url,{ip:this.config.ip?1:0}),e.headers=PA({},this.config.request_headers),e.compression=e.compression==="best-available"?this.compression:e.compression,e.fetchOptions=e.fetchOptions||this.config.fetch_options,(t=>{var n,r,o,a=PA({},t);a.timeout=a.timeout||6e4,a.url=TU(a.url,{_:new Date().getTime().toString(),ver:PS.LIB_VERSION,compression:a.compression});var s=(n=a.transport)!==null&&n!==void 0?n:"fetch",l=(r=(o=Zxe(o8,c=>c.transport===s))==null?void 0:o.method)!==null&&r!==void 0?r:o8[0].method;if(!l)throw new Error("No available transport method");l(a)})(PA({},e,{callback:t=>{var n,r;this.rateLimiter.checkForLimiting(t),t.statusCode>=400&&((n=(r=this.config).on_request_error)==null||n.call(r,t)),e.callback==null||e.callback(t)}}))))}Is(e){this.Ps?this.Ps.retriableRequest(e):this.Ee(e)}_execute_array(e){var t,n=[],r=[],o=[];a3(e,s=>{s&&(t=s[0],wI(t)?o.push(s):n2(s)?s.call(this):wI(s)&&t==="alias"?n.push(s):wI(s)&&t.indexOf("capture")!==-1&&n2(this[t])?o.push(s):r.push(s))});var a=function(s,l){a3(s,function(c){if(wI(c[0])){var u=l;nv(c,function(A){u=u[A[0]].apply(u,A.slice(1))})}else this[c[0]].apply(this,c.slice(1))},l)};a(n,this),a(r,this),a(o,this)}Rs(){var e,t;return((e=this.config.bootstrap)==null?void 0:e.featureFlags)&&Object.keys((t=this.config.bootstrap)==null?void 0:t.featureFlags).length>0||!1}push(e){this._execute_array([e])}capture(e,t,n){var r;if(this.__loaded&&this.persistence&&this.sessionPersistence&&this.Es){if(!this.consent.isOptedOut())if(!Gu(e)&&AC(e)){if(this.config.opt_out_useragent_filter||!this._is_bot()){var o=n!=null&&n.skip_client_rate_limiting?void 0:this.rateLimiter.clientRateLimitContext();if(o==null||!o.isRateLimited){t!=null&&t.$current_url&&!AC(t==null?void 0:t.$current_url)&&(Qd.error("Invalid `$current_url` property provided to `posthog.capture`. Input must be a string. Ignoring provided value."),t==null||delete t.$current_url),this.sessionPersistence.update_search_keyword(),this.config.save_campaign_params&&this.sessionPersistence.update_campaign_params(),this.config.save_referrer&&this.sessionPersistence.update_referrer_info(),(this.config.save_campaign_params||this.config.save_referrer)&&this.persistence.set_initial_person_info();var a=new Date,s=(n==null?void 0:n.timestamp)||a,l=l3(),c={uuid:l,event:e,properties:this.calculateEventProperties(e,t||{},s,l)};o&&(c.properties.$lib_rate_limit_remaining_tokens=o.remainingTokens),n!=null&&n.$set&&(c.$set=n==null?void 0:n.$set);var u,A,d=this.Os(n==null?void 0:n.$set_once);if(d&&(c.$set_once=d),(c=b0t(c,n!=null&&n._noTruncate?null:this.config.properties_string_max_length)).timestamp=s,Gu(n==null?void 0:n.timestamp)||(c.properties.$event_time_override_provided=!0,c.properties.$event_time_override_system_time=a),e===UX.DISMISSED||e===UX.SENT){var f=t==null?void 0:t[Hbe.SURVEY_ID],h=t==null?void 0:t[Hbe.SURVEY_ITERATION];localStorage.setItem((A=""+PX+(u={id:f,current_iteration:h}).id,u.current_iteration&&u.current_iteration>0&&(A=""+PX+u.id+"_"+u.current_iteration),A),"true"),c.$set=PA({},c.$set,{[mgt({id:f,current_iteration:h},e===UX.SENT?"responded":"dismissed")]:!0})}var y=PA({},c.properties.$set,c.$set);if(cM(y)||this.setPersonPropertiesForFlags(y),!o_(this.config.before_send)){var _=this.As(c);if(!_)return;c=_}this._s.emit("eventCaptured",c);var v={method:"POST",url:(r=n==null?void 0:n._url)!==null&&r!==void 0?r:this.requestRouter.endpointFor("api",this.analyticsDefaultEndpoint),data:c,compression:"best-available",batchKey:n==null?void 0:n._batchKey};return!this.config.request_batching||n&&(n==null||!n._batchKey)||n!=null&&n.send_instantly?this.Is(v):this.Es.enqueue(v),c}Qd.critical("This capture call is ignored due to client rate limiting.")}}else Qd.error("No event name provided to posthog.capture")}else Qd.uninitializedWarning("posthog.capture")}Ge(e){return this.on("eventCaptured",t=>e(t.event,t))}calculateEventProperties(e,t,n,r,o){if(n=n||new Date,!this.persistence||!this.sessionPersistence)return t;var a=o?void 0:this.persistence.remove_event_timer(e),s=PA({},t);if(s.token=this.config.token,s.$config_defaults=this.config.defaults,this.config.__preview_experimental_cookieless_mode&&(s.$cookieless_mode=!0),e==="$snapshot"){var l=PA({},this.persistence.properties(),this.sessionPersistence.properties());return s.distinct_id=l.distinct_id,(!AC(s.distinct_id)&&!Kx(s.distinct_id)||FZ(s.distinct_id))&&Qd.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),s}var c,u=dgt(this.config.mask_personal_data_properties,this.config.custom_personal_data_properties);if(this.sessionManager){var{sessionId:A,windowId:d}=this.sessionManager.checkAndGetSessionAndWindowId(o,n.getTime());s.$session_id=A,s.$window_id=d}this.sessionPropsManager&&RC(s,this.sessionPropsManager.getSessionProps());try{var f;this.sessionRecording&&RC(s,this.sessionRecording.sdkDebugProperties),s.$sdk_debug_retry_queue_size=(f=this.Ps)==null?void 0:f.length}catch(v){s.$sdk_debug_error_capturing_properties=String(v)}if(this.requestRouter.region===d8.CUSTOM&&(s.$lib_custom_api_host=this.config.api_host),c=e!=="$pageview"||o?e!=="$pageleave"||o?this.pageViewManager.doEvent():this.pageViewManager.doPageLeave(n):this.pageViewManager.doPageView(n,r),s=RC(s,c),e==="$pageview"&&id&&(s.title=id.title),!Gu(a)){var h=n.getTime()-a;s.$duration=parseFloat((h/1e3).toFixed(3))}KE&&this.config.opt_out_useragent_filter&&(s.$browser_type=this._is_bot()?"bot":"browser"),(s=RC({},u,this.persistence.properties(),this.sessionPersistence.properties(),s)).$is_identified=this._isIdentified(),wI(this.config.property_denylist)?nv(this.config.property_denylist,function(v){delete s[v]}):Qd.error("Invalid value for property_denylist config: "+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);var y=this.config.sanitize_properties;y&&(Qd.error("sanitize_properties is deprecated. Use before_send instead"),s=y(s,e));var _=this.Ds();return s.$process_person_profile=_,_&&!o&&this.Ls("_calculate_event_properties"),s}Os(e){var t;if(!this.persistence||!this.Ds()||this.gs)return e;var n=this.persistence.get_initial_props(),r=(t=this.sessionPropsManager)==null?void 0:t.getSetOnceProps(),o=RC({},n,r||{},e||{}),a=this.config.sanitize_properties;return a&&(Qd.error("sanitize_properties is deprecated. Use before_send instead"),o=a(o,"$set_once")),this.gs=!0,cM(o)?void 0:o}register(e,t){var n;(n=this.persistence)==null||n.register(e,t)}register_once(e,t,n){var r;(r=this.persistence)==null||r.register_once(e,t,n)}register_for_session(e){var t;(t=this.sessionPersistence)==null||t.register(e)}unregister(e){var t;(t=this.persistence)==null||t.unregister(e)}unregister_for_session(e){var t;(t=this.sessionPersistence)==null||t.unregister(e)}js(e,t){this.register({[e]:t})}getFeatureFlag(e,t){return this.featureFlags.getFeatureFlag(e,t)}getFeatureFlagPayload(e){var t=this.featureFlags.getFeatureFlagPayload(e);try{return JSON.parse(t)}catch{return t}}isFeatureEnabled(e,t){return this.featureFlags.isFeatureEnabled(e,t)}reloadFeatureFlags(){this.featureFlags.reloadFeatureFlags()}updateEarlyAccessFeatureEnrollment(e,t){this.featureFlags.updateEarlyAccessFeatureEnrollment(e,t)}getEarlyAccessFeatures(e,t,n){return t===void 0&&(t=!1),this.featureFlags.getEarlyAccessFeatures(e,t,n)}on(e,t){return this._s.on(e,t)}onFeatureFlags(e){return this.featureFlags.onFeatureFlags(e)}onSurveysLoaded(e){return this.surveys.onSurveysLoaded(e)}onSessionId(e){var t,n;return(t=(n=this.sessionManager)==null?void 0:n.onSessionId(e))!==null&&t!==void 0?t:()=>{}}getSurveys(e,t){t===void 0&&(t=!1),this.surveys.getSurveys(e,t)}getActiveMatchingSurveys(e,t){t===void 0&&(t=!1),this.surveys.getActiveMatchingSurveys(e,t)}renderSurvey(e,t){this.surveys.renderSurvey(e,t)}canRenderSurvey(e){return this.surveys.canRenderSurvey(e)}canRenderSurveyAsync(e,t){return t===void 0&&(t=!1),this.surveys.canRenderSurveyAsync(e,t)}identify(e,t,n){if(!this.__loaded||!this.persistence)return Qd.uninitializedWarning("posthog.identify");if(Kx(e)&&(e=e.toString(),Qd.warn("The first argument to posthog.identify was a number, but it should be a string. It has been converted to a string.")),e)if(["distinct_id","distinctid"].includes(e.toLowerCase()))Qd.critical('The string "'+e+'" was set in posthog.identify which indicates an error. This ID should be unique to the user and not a hardcoded string.');else if(e!==gU){if(this.Ls("posthog.identify")){var r=this.get_distinct_id();if(this.register({$user_id:e}),!this.get_property("$device_id")){var o=r;this.register_once({$had_persisted_distinct_id:!0,$device_id:o},"")}e!==r&&e!==this.get_property(qN)&&(this.unregister(qN),this.register({distinct_id:e}));var a=(this.persistence.get_property(LS)||"anonymous")==="anonymous";e!==r&&a?(this.persistence.set_property(LS,"identified"),this.setPersonPropertiesForFlags(PA({},n||{},t||{}),!1),this.capture("$identify",{distinct_id:e,$anon_distinct_id:r},{$set:t||{},$set_once:n||{}}),this.Ss=Abe(e,t,n),this.featureFlags.setAnonymousDistinctId(r)):(t||n)&&this.setPersonProperties(t,n),e!==r&&(this.reloadFeatureFlags(),this.unregister(fU))}}else Qd.critical('The string "'+gU+'" was set in posthog.identify which indicates an error. This ID is only used as a sentinel value.');else Qd.error("Unique user id has not been set in posthog.identify")}setPersonProperties(e,t){if((e||t)&&this.Ls("posthog.setPersonProperties")){var n=Abe(this.get_distinct_id(),e,t);this.Ss!==n?(this.setPersonPropertiesForFlags(PA({},t||{},e||{})),this.capture("$set",{$set:e||{},$set_once:t||{}}),this.Ss=n):Qd.info("A duplicate setPersonProperties call was made with the same properties. It has been ignored.")}}group(e,t,n){if(e&&t){if(this.Ls("posthog.group")){var r=this.getGroups();r[e]!==t&&this.resetGroupPropertiesForFlags(e),this.register({$groups:PA({},r,{[e]:t})}),n&&(this.capture("$groupidentify",{$group_type:e,$group_key:t,$group_set:n}),this.setGroupPropertiesForFlags({[e]:n})),r[e]===t||n||this.reloadFeatureFlags()}}else Qd.error("posthog.group requires a group type and group key")}resetGroups(){this.register({$groups:{}}),this.resetGroupPropertiesForFlags(),this.reloadFeatureFlags()}setPersonPropertiesForFlags(e,t){t===void 0&&(t=!0),this.featureFlags.setPersonPropertiesForFlags(e,t)}resetPersonPropertiesForFlags(){this.featureFlags.resetPersonPropertiesForFlags()}setGroupPropertiesForFlags(e,t){t===void 0&&(t=!0),this.Ls("posthog.setGroupPropertiesForFlags")&&this.featureFlags.setGroupPropertiesForFlags(e,t)}resetGroupPropertiesForFlags(e){this.featureFlags.resetGroupPropertiesForFlags(e)}reset(e){var t,n,r,o;if(Qd.info("reset"),!this.__loaded)return Qd.uninitializedWarning("posthog.reset");var a=this.get_property("$device_id");if(this.consent.reset(),(t=this.persistence)==null||t.clear(),(n=this.sessionPersistence)==null||n.clear(),this.surveys.reset(),this.featureFlags.reset(),(r=this.persistence)==null||r.set_property(LS,"anonymous"),(o=this.sessionManager)==null||o.resetSessionId(),this.Ss=null,this.config.__preview_experimental_cookieless_mode)this.register_once({distinct_id:gU,$device_id:null},"");else{var s=this.config.get_device_id(l3());this.register_once({distinct_id:s,$device_id:e?s:a},"")}this.register({$last_posthog_reset:new Date().toISOString()},1)}get_distinct_id(){return this.get_property("distinct_id")}getGroups(){return this.get_property("$groups")||{}}get_session_id(){var e,t;return(e=(t=this.sessionManager)==null?void 0:t.checkAndGetSessionAndWindowId(!0).sessionId)!==null&&e!==void 0?e:""}get_session_replay_url(e){if(!this.sessionManager)return"";var{sessionId:t,sessionStartTimestamp:n}=this.sessionManager.checkAndGetSessionAndWindowId(!0),r=this.requestRouter.endpointFor("ui","/project/"+this.config.token+"/replay/"+t);if(e!=null&&e.withTimestamp&&n){var o,a=(o=e.timestampLookBack)!==null&&o!==void 0?o:10;if(!n)return r;r+="?t="+Math.max(Math.floor((new Date().getTime()-n)/1e3)-a,0)}return r}alias(e,t){return e===this.get_property(Xxe)?(Qd.critical("Attempting to create alias for existing People user - aborting."),-2):this.Ls("posthog.alias")?(Gu(t)&&(t=this.get_distinct_id()),e!==t?(this.js(qN,e),this.capture("$create_alias",{alias:e,distinct_id:t})):(Qd.warn("alias matches current distinct_id - skipping api call."),this.identify(e),-1)):void 0}set_config(e){var t=PA({},this.config);if(uC(e)){var n,r,o,a,s;RC(this.config,Xbe(e));var l=this.xs();(n=this.persistence)==null||n.update_config(this.config,t,l),this.sessionPersistence=this.config.persistence==="sessionStorage"||this.config.persistence==="memory"?this.persistence:new kX(PA({},this.config,{persistence:"sessionStorage"}),l),y9.O()&&y9.D("ph_debug")==="true"&&(this.config.debug=!0),this.config.debug&&(PS.DEBUG=!0,Qd.info("set_config",{config:e,oldConfig:t,newConfig:PA({},this.config)})),(r=this.sessionRecording)==null||r.startIfEnabledOrStop(),(o=this.autocapture)==null||o.startIfEnabled(),(a=this.heatmaps)==null||a.startIfEnabled(),this.surveys.loadIfEnabled(),this.Ns(),(s=this.externalIntegrations)==null||s.startIfEnabledOrStop()}}startSessionRecording(e){var t=e===!0,n={sampling:t||!(e==null||!e.sampling),linked_flag:t||!(e==null||!e.linked_flag),url_trigger:t||!(e==null||!e.url_trigger),event_trigger:t||!(e==null||!e.event_trigger)};if(Object.values(n).some(Boolean)){var r,o,a,s,l;(r=this.sessionManager)==null||r.checkAndGetSessionAndWindowId(),n.sampling&&((o=this.sessionRecording)==null||o.overrideSampling()),n.linked_flag&&((a=this.sessionRecording)==null||a.overrideLinkedFlag()),n.url_trigger&&((s=this.sessionRecording)==null||s.overrideTrigger("url")),n.event_trigger&&((l=this.sessionRecording)==null||l.overrideTrigger("event"))}this.set_config({disable_session_recording:!1})}stopSessionRecording(){this.set_config({disable_session_recording:!0})}sessionRecordingStarted(){var e;return!((e=this.sessionRecording)==null||!e.started)}captureException(e,t){var n=new Error("PostHog syntheticException");return this.exceptions.sendExceptionEvent(PA({},Apt((r=>r instanceof Error)(e)?{error:e,event:e.message}:{event:e},{syntheticException:n}),t))}loadToolbar(e){return this.toolbar.loadToolbar(e)}get_property(e){var t;return(t=this.persistence)==null?void 0:t.props[e]}getSessionProperty(e){var t;return(t=this.sessionPersistence)==null?void 0:t.props[e]}toString(){var e,t=(e=this.config.name)!==null&&e!==void 0?e:IM;return t!==IM&&(t=IM+"."+t),t}_isIdentified(){var e,t;return((e=this.persistence)==null?void 0:e.get_property(LS))==="identified"||((t=this.sessionPersistence)==null?void 0:t.get_property(LS))==="identified"}Ds(){var e,t;return!(this.config.person_profiles==="never"||this.config.person_profiles==="identified_only"&&!this._isIdentified()&&cM(this.getGroups())&&((e=this.persistence)==null||(e=e.props)==null||!e[qN])&&((t=this.persistence)==null||(t=t.props)==null||!t[pU]))}Fs(){return this.config.capture_pageleave===!0||this.config.capture_pageleave==="if_capture_pageview"&&(this.config.capture_pageview===!0||this.config.capture_pageview==="history_change")}createPersonProfile(){this.Ds()||this.Ls("posthog.createPersonProfile")&&this.setPersonProperties({},{})}Ls(e){return this.config.person_profiles==="never"?(Qd.error(e+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this.js(pU,!0),!0)}xs(){var e=this.consent.isOptedOut(),t=this.config.opt_out_persistence_by_default;return this.config.disable_persistence||e&&!!t}Ns(){var e,t,n,r,o=this.xs();return((e=this.persistence)==null?void 0:e.Fe)!==o&&((n=this.persistence)==null||n.set_disabled(o)),((t=this.sessionPersistence)==null?void 0:t.Fe)!==o&&((r=this.sessionPersistence)==null||r.set_disabled(o)),o}opt_in_capturing(e){var t;this.consent.optInOut(!0),this.Ns(),(Gu(e==null?void 0:e.captureEventName)||e!=null&&e.captureEventName)&&this.capture((t=e==null?void 0:e.captureEventName)!==null&&t!==void 0?t:"$opt_in",e==null?void 0:e.captureProperties,{send_instantly:!0}),this.config.capture_pageview&&this.Cs()}opt_out_capturing(){this.consent.optInOut(!1),this.Ns()}has_opted_in_capturing(){return this.consent.isOptedIn()}has_opted_out_capturing(){return this.consent.isOptedOut()}clear_opt_in_out_capturing(){this.consent.reset(),this.Ns()}_is_bot(){return wb?jbe(wb,this.config.custom_blocked_useragents):void 0}Cs(){id&&(id.visibilityState==="visible"?this.bs||(this.bs=!0,this.capture("$pageview",{title:id.title},{send_instantly:!0}),this.ys&&(id.removeEventListener("visibilitychange",this.ys),this.ys=null)):this.ys||(this.ys=this.Cs.bind(this),LI(id,"visibilitychange",this.ys)))}debug(e){e===!1?(Aa==null||Aa.console.log("You've disabled debug mode."),localStorage&&localStorage.removeItem("ph_debug"),this.set_config({debug:!1})):(Aa==null||Aa.console.log("You're now in debug mode. All calls to PostHog will be logged in your console.\nYou can disable this with `posthog.debug(false)`."),localStorage&&localStorage.setItem("ph_debug","true"),this.set_config({debug:!0}))}I(){var e,t,n,r,o,a,s,l=this.$s||{};return"advanced_disable_flags"in l?!!l.advanced_disable_flags:this.config.advanced_disable_flags!==!1?!!this.config.advanced_disable_flags:this.config.advanced_disable_decide===!0?(Qd.warn("Config field 'advanced_disable_decide' is deprecated. Please use 'advanced_disable_flags' instead. The old field will be removed in a future major version."),!0):(n="advanced_disable_decide",r=!1,o=Qd,a=(t="advanced_disable_flags")in(e=l)&&!Gu(e[t]),s=n in e&&!Gu(e[n]),a?e[t]:s?(o&&o.warn("Config field '"+n+"' is deprecated. Please use '"+t+"' instead. The old field will be removed in a future major version."),e[n]):r)}As(e){if(o_(this.config.before_send))return e;var t=wI(this.config.before_send)?this.config.before_send:[this.config.before_send],n=e;for(var r of t){if(n=r(n),o_(n)){var o="Event '"+e.event+"' was rejected in beforeSend function";return C0t(e.event)?Qd.warn(o+". This can cause unexpected behavior."):Qd.info(o),null}n.properties&&!cM(n.properties)||Qd.warn("Event '"+e.event+"' has no properties after beforeSend function, this is likely an error.")}return n}getPageViewId(){var e;return(e=this.pageViewManager.ce)==null?void 0:e.pageViewId}captureTraceFeedback(e,t){this.capture("$ai_feedback",{$ai_trace_id:String(e),$ai_feedback_text:t})}captureTraceMetric(e,t,n){this.capture("$ai_metric",{$ai_trace_id:String(e),$ai_metric_name:t,$ai_metric_value:String(n)})}}(function(i,e){for(var t=0;t<e.length;t++)i.prototype[e[t]]=E0t(i.prototype[e[t]])})(FU,["identify"]);var Wbe,GU=(Wbe=f8[IM]=new FU,function(){function i(){i.done||(i.done=!0,qbe=!1,nv(f8,function(e){e._dom_loaded()}))}id!=null&&id.addEventListener?id.readyState==="complete"?i():LI(id,"DOMContentLoaded",i,{capture:!1}):Aa&&Qd.error("Browser doesn't support `document.addEventListener` so PostHog couldn't be initialized")}(),Wbe);!window.location.hostname.includes("localhost")&&!window.location.hostname.includes("127.0.0.1")&&(GU.__loaded||GU.init("phc_htd8AQjSfVEsFCLQMAiUooG4Q0DKBCjqYuQglc9V3Wo",{api_host:"https://postpig.tscircuit.com",person_profiles:"always"}));function Lgt(i){const e=String.fromCodePoint(...i);return btoa(e)}var Mb=Uint8Array,Rb=Uint16Array,GX=Int32Array,OX=new Mb([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),zX=new Mb([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),$be=new Mb([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),e2e=function(i,e){for(var t=new Rb(31),n=0;n<31;++n)t[n]=e+=1<<i[n-1];for(var r=new GX(t[30]),n=1;n<30;++n)for(var o=t[n];o<t[n+1];++o)r[o]=o-t[n]<<5|n;return{b:t,r}},t2e=e2e(OX,2),Fgt=t2e.b,HX=t2e.r;Fgt[28]=258,HX[258]=28;for(var Ggt=e2e(zX,0),n2e=Ggt.r,YX=new Rb(32768),AI=0;AI<32768;++AI){var f3=(AI&43690)>>1|(AI&21845)<<1;f3=(f3&52428)>>2|(f3&13107)<<2,f3=(f3&61680)>>4|(f3&3855)<<4,YX[AI]=((f3&65280)>>8|(f3&255)<<8)>>1}for(var h8=function(i,e,t){for(var n=i.length,r=0,o=new Rb(e);r<n;++r)i[r]&&++o[i[r]-1];var a=new Rb(e);for(r=1;r<e;++r)a[r]=a[r-1]+o[r-1]<<1;var s;if(t){s=new Rb(1<<e);var l=15-e;for(r=0;r<n;++r)if(i[r])for(var c=r<<4|i[r],u=e-i[r],A=a[i[r]-1]++<<u,d=A|(1<<u)-1;A<=d;++A)s[YX[A]>>l]=c}else for(s=new Rb(n),r=0;r<n;++r)i[r]&&(s[r]=YX[a[i[r]-1]++]>>15-i[r]);return s},Zw=new Mb(288),AI=0;AI<144;++AI)Zw[AI]=8;for(var AI=144;AI<256;++AI)Zw[AI]=9;for(var AI=256;AI<280;++AI)Zw[AI]=7;for(var AI=280;AI<288;++AI)Zw[AI]=8;for(var OU=new Mb(32),AI=0;AI<32;++AI)OU[AI]=5;var Ogt=h8(Zw,9,0),zgt=h8(OU,5,0),i2e=function(i){return(i+7)/8|0},r2e=function(i,e,t){return(t==null||t>i.length)&&(t=i.length),new Mb(i.subarray(e,t))},OS=function(i,e,t){t<<=e&7;var n=e/8|0;i[n]|=t,i[n+1]|=t>>8},p8=function(i,e,t){t<<=e&7;var n=e/8|0;i[n]|=t,i[n+1]|=t>>8,i[n+2]|=t>>16},VX=function(i,e){for(var t=[],n=0;n<i.length;++n)i[n]&&t.push({s:n,f:i[n]});var r=t.length,o=t.slice();if(!r)return{t:l2e,l:0};if(r==1){var a=new Mb(t[0].s+1);return a[t[0].s]=1,{t:a,l:1}}t.sort(function(Y,G){return Y.f-G.f}),t.push({s:-1,f:25001});var s=t[0],l=t[1],c=0,u=1,A=2;for(t[0]={s:-1,f:s.f+l.f,l:s,r:l};u!=r-1;)s=t[t[c].f<t[A].f?c++:A++],l=t[c!=u&&t[c].f<t[A].f?c++:A++],t[u++]={s:-1,f:s.f+l.f,l:s,r:l};for(var d=o[0].s,n=1;n<r;++n)o[n].s>d&&(d=o[n].s);var f=new Rb(d+1),h=KX(t[u-1],f,0);if(h>e){var n=0,y=0,_=h-e,v=1<<_;for(o.sort(function(G,F){return f[F.s]-f[G.s]||G.f-F.f});n<r;++n){var E=o[n].s;if(f[E]>e)y+=v-(1<<h-f[E]),f[E]=e;else break}for(y>>=_;y>0;){var b=o[n].s;f[b]<e?y-=1<<e-f[b]++-1:++n}for(;n>=0&&y;--n){var M=o[n].s;f[M]==e&&(--f[M],++y)}h=e}return{t:new Mb(f),l:h}},KX=function(i,e,t){return i.s==-1?Math.max(KX(i.l,e,t+1),KX(i.r,e,t+1)):e[i.s]=t},o2e=function(i){for(var e=i.length;e&&!i[--e];);for(var t=new Rb(++e),n=0,r=i[0],o=1,a=function(l){t[n++]=l},s=1;s<=e;++s)if(i[s]==r&&s!=e)++o;else{if(!r&&o>2){for(;o>138;o-=138)a(32754);o>2&&(a(o>10?o-11<<5|28690:o-3<<5|12305),o=0)}else if(o>3){for(a(r),--o;o>6;o-=6)a(8304);o>2&&(a(o-3<<5|8208),o=0)}for(;o--;)a(r);o=1,r=i[s]}return{c:t.subarray(0,n),n:e}},g8=function(i,e){for(var t=0,n=0;n<e.length;++n)t+=i[n]*e[n];return t},a2e=function(i,e,t){var n=t.length,r=i2e(e+2);i[r]=n&255,i[r+1]=n>>8,i[r+2]=i[r]^255,i[r+3]=i[r+1]^255;for(var o=0;o<n;++o)i[r+o+4]=t[o];return(r+4+n)*8},s2e=function(i,e,t,n,r,o,a,s,l,c,u){OS(e,u++,t),++r[256];for(var A=VX(r,15),d=A.t,f=A.l,h=VX(o,15),y=h.t,_=h.l,v=o2e(d),E=v.c,b=v.n,M=o2e(y),Y=M.c,G=M.n,F=new Rb(19),L=0;L<E.length;++L)++F[E[L]&31];for(var L=0;L<Y.length;++L)++F[Y[L]&31];for(var V=VX(F,7),O=V.t,re=V.l,Z=19;Z>4&&!O[$be[Z-1]];--Z);var se=c+5<<3,ye=g8(r,Zw)+g8(o,OU)+a,xe=g8(r,d)+g8(o,y)+a+14+3*Z+g8(F,O)+2*F[16]+3*F[17]+7*F[18];if(l>=0&&se<=ye&&se<=xe)return a2e(e,u,i.subarray(l,l+c));var de,Ie,_e,Ne;if(OS(e,u,1+(xe<ye)),u+=2,xe<ye){de=h8(d,f,0),Ie=d,_e=h8(y,_,0),Ne=y;var Pe=h8(O,re,0);OS(e,u,b-257),OS(e,u+5,G-1),OS(e,u+10,Z-4),u+=14;for(var L=0;L<Z;++L)OS(e,u+3*L,O[$be[L]]);u+=3*Z;for(var Le=[E,Y],ke=0;ke<2;++ke)for(var rt=Le[ke],L=0;L<rt.length;++L){var st=rt[L]&31;OS(e,u,Pe[st]),u+=O[st],st>15&&(OS(e,u,rt[L]>>5&127),u+=rt[L]>>12)}}else de=Ogt,Ie=Zw,_e=zgt,Ne=OU;for(var L=0;L<s;++L){var pt=n[L];if(pt>255){var st=pt>>18&31;p8(e,u,de[st+257]),u+=Ie[st+257],st>7&&(OS(e,u,pt>>23&31),u+=OX[st]);var Qt=pt&31;p8(e,u,_e[Qt]),u+=Ne[Qt],Qt>3&&(p8(e,u,pt>>5&8191),u+=zX[Qt])}else p8(e,u,de[pt]),u+=Ie[pt]}return p8(e,u,de[256]),u+Ie[256]},Hgt=new GX([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),l2e=new Mb(0),Ygt=function(i,e,t,n,r,o){var a=o.z||i.length,s=new Mb(n+a+5*(1+Math.ceil(a/7e3))+r),l=s.subarray(n,s.length-r),c=o.l,u=(o.r||0)&7;if(e){u&&(l[0]=o.r>>3);for(var A=Hgt[e-1],d=A>>13,f=A&8191,h=(1<<t)-1,y=o.p||new Rb(32768),_=o.h||new Rb(h+1),v=Math.ceil(t/3),E=2*v,b=function(St){return(i[St]^i[St+1]<<v^i[St+2]<<E)&h},M=new GX(25e3),Y=new Rb(288),G=new Rb(32),F=0,L=0,V=o.i||0,O=0,re=o.w||0,Z=0;V+2<a;++V){var se=b(V),ye=V&32767,xe=_[se];if(y[ye]=xe,_[se]=ye,re<=V){var de=a-V;if((F>7e3||O>24576)&&(de>423||!c)){u=s2e(i,l,0,M,Y,G,L,O,Z,V-Z,u),O=F=L=0,Z=V;for(var Ie=0;Ie<286;++Ie)Y[Ie]=0;for(var Ie=0;Ie<30;++Ie)G[Ie]=0}var _e=2,Ne=0,Pe=f,Le=ye-xe&32767;if(de>2&&se==b(V-Le))for(var ke=Math.min(d,de)-1,rt=Math.min(32767,V),st=Math.min(258,de);Le<=rt&&--Pe&&ye!=xe;){if(i[V+_e]==i[V+_e-Le]){for(var pt=0;pt<st&&i[V+pt]==i[V+pt-Le];++pt);if(pt>_e){if(_e=pt,Ne=Le,pt>ke)break;for(var Qt=Math.min(Le,pt-2),Ft=0,Ie=0;Ie<Qt;++Ie){var wt=V-Le+Ie&32767,He=y[wt],at=wt-He&32767;at>Ft&&(Ft=at,xe=wt)}}}ye=xe,xe=y[ye],Le+=ye-xe&32767}if(Ne){M[O++]=268435456|HX[_e]<<18|n2e[Ne];var dt=HX[_e]&31,Et=n2e[Ne]&31;L+=OX[dt]+zX[Et],++Y[257+dt],++G[Et],re=V+_e,++F}else M[O++]=i[V],++Y[i[V]]}}for(V=Math.max(V,re);V<a;++V)M[O++]=i[V],++Y[i[V]];u=s2e(i,l,c,M,Y,G,L,O,Z,V-Z,u),c||(o.r=u&7|l[u/8|0]<<3,u-=7,o.h=_,o.p=y,o.i=V,o.w=re)}else{for(var V=o.w||0;V<a+c;V+=65535){var Lt=V+65535;Lt>=a&&(l[u/8|0]=c,Lt=a),u=a2e(l,u+1,i.subarray(V,Lt))}o.i=a}return r2e(s,0,n+i2e(u)+r)},Vgt=function(){for(var i=new Int32Array(256),e=0;e<256;++e){for(var t=e,n=9;--n;)t=(t&1&&-306674912)^t>>>1;i[e]=t}return i}(),Kgt=function(){var i=-1;return{p:function(e){for(var t=i,n=0;n<e.length;++n)t=Vgt[t&255^e[n]]^t>>>8;i=t},d:function(){return~i}}},jgt=function(i,e,t,n,r){if(!r&&(r={l:1},e.dictionary)){var o=e.dictionary.subarray(-32768),a=new Mb(o.length+i.length);a.set(o),a.set(i,o.length),i=a,r.w=o.length}return Ygt(i,e.level==null?6:e.level,e.mem==null?r.l?Math.ceil(Math.max(8,Math.min(13,Math.log(i.length)))*1.5):20:12+e.mem,t,n,r)},jX=function(i,e,t){for(;t;++e)i[e]=t,t>>>=8},Jgt=function(i,e){var t=e.filename;if(i[0]=31,i[1]=139,i[2]=8,i[8]=e.level<2?4:e.level==9?2:0,i[9]=3,e.mtime!=0&&jX(i,4,Math.floor(new Date(e.mtime||Date.now())/1e3)),t){i[3]=8;for(var n=0;n<=t.length;++n)i[n+10]=t.charCodeAt(n)}},qgt=function(i){return 10+(i.filename?i.filename.length+1:0)};function c2e(i,e){e||(e={});var t=Kgt(),n=i.length;t.p(i);var r=jgt(i,e,qgt(e),8),o=r.length;return Jgt(r,e),jX(r,o-8,t.d()),jX(r,o-4,n),r}var u2e=typeof TextEncoder<"u"&&new TextEncoder,Zgt=typeof TextDecoder<"u"&&new TextDecoder,Xgt=0;try{Zgt.decode(l2e,{stream:!0}),Xgt=1}catch{}function A2e(i,e){var t;if(u2e)return u2e.encode(i);for(var n=i.length,r=new Mb(i.length+(i.length>>1)),o=0,a=function(c){r[o++]=c},t=0;t<n;++t){if(o+5>r.length){var s=new Mb(o+8+(n-t<<1));s.set(r),r=s}var l=i.charCodeAt(t);l<128||e?a(l):l<2048?(a(192|l>>6),a(128|l&63)):l>55295&&l<57344?(l=65536+(l&1047552)|i.charCodeAt(++t)&1023,a(240|l>>18),a(128|l>>12&63),a(128|l>>6&63),a(128|l&63)):(a(224|l>>12),a(128|l>>6&63),a(128|l&63))}return r2e(r,0,o)}function Wgt(i,e){const t=JSON.stringify(i),n=c2e(A2e(t)),r=Lgt(n);return`${window.location.origin}/editor?#data:application/gzip;base64,${r}`}function bv(...i){return m0t(xB(i))}const d2e=i=>i.replace(/_/g," ").replace(/\b\w/g,e=>e.toUpperCase()),$gt=Ght,f2e=Nt.forwardRef(({className:i,...e},t)=>Ct.jsx(Qxe,{ref:t,className:bv("rf-inline-flex rf-h-9 rf-items-center rf-justify-center rf-rounded-lg rf-bg-zinc-100 rf-p-1 rf-text-zinc-500 dark:rf-bg-zinc-800 dark:rf-text-zinc-400",i),...e}));f2e.displayName=Qxe.displayName;const CM=Nt.forwardRef(({className:i,...e},t)=>Ct.jsx(Mxe,{ref:t,className:bv("rf-inline-flex rf-items-center rf-justify-center rf-whitespace-nowrap rf-rounded-md rf-px-3 rf-py-1 rf-text-sm rf-font-medium rf-ring-offset-white rf-transition-all focus-visible:rf-outline-none focus-visible:rf-ring-2 focus-visible:rf-ring-zinc-950 focus-visible:rf-ring-offset-2 disabled:rf-pointer-events-none disabled:rf-opacity-50 data-[state=active]:rf-bg-white data-[state=active]:rf-text-zinc-950 data-[state=active]:rf-shadow dark:rf-ring-offset-zinc-950 dark:focus-visible:rf-ring-zinc-300 dark:data-[state=active]:rf-bg-zinc-950 dark:data-[state=active]:rf-text-zinc-50",i),...e}));CM.displayName=Mxe.displayName;const MB=Nt.forwardRef(({className:i,...e},t)=>Ct.jsx(Rxe,{ref:t,className:bv("rf-h-full rf-mt-2 rf-ring-offset-white focus-visible:rf-outline-none focus-visible:rf-ring-2 focus-visible:rf-ring-zinc-950 focus-visible:rf-ring-offset-2 dark:rf-ring-offset-zinc-950 dark:focus-visible:rf-ring-zinc-300",i),...e}));MB.displayName=Rxe.displayName;var Q1;(function(i){i.assertEqual=r=>{};function e(r){}i.assertIs=e;function t(r){throw new Error}i.assertNever=t,i.arrayToEnum=r=>{const o={};for(const a of r)o[a]=a;return o},i.getValidEnumValues=r=>{const o=i.objectKeys(r).filter(s=>typeof r[r[s]]!="number"),a={};for(const s of o)a[s]=r[s];return i.objectValues(a)},i.objectValues=r=>i.objectKeys(r).map(function(o){return r[o]}),i.objectKeys=typeof Object.keys=="function"?r=>Object.keys(r):r=>{const o=[];for(const a in r)Object.prototype.hasOwnProperty.call(r,a)&&o.push(a);return o},i.find=(r,o)=>{for(const a of r)if(o(a))return a},i.isInteger=typeof Number.isInteger=="function"?r=>Number.isInteger(r):r=>typeof r=="number"&&Number.isFinite(r)&&Math.floor(r)===r;function n(r,o=" | "){return r.map(a=>typeof a=="string"?`'${a}'`:a).join(o)}i.joinValues=n,i.jsonStringifyReplacer=(r,o)=>typeof o=="bigint"?o.toString():o})(Q1||(Q1={}));var h2e;(function(i){i.mergeShapes=(e,t)=>({...e,...t})})(h2e||(h2e={}));const rd=Q1.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),h3=i=>{switch(typeof i){case"undefined":return rd.undefined;case"string":return rd.string;case"number":return Number.isNaN(i)?rd.nan:rd.number;case"boolean":return rd.boolean;case"function":return rd.function;case"bigint":return rd.bigint;case"symbol":return rd.symbol;case"object":return Array.isArray(i)?rd.array:i===null?rd.null:i.then&&typeof i.then=="function"&&i.catch&&typeof i.catch=="function"?rd.promise:typeof Map<"u"&&i instanceof Map?rd.map:typeof Set<"u"&&i instanceof Set?rd.set:typeof Date<"u"&&i instanceof Date?rd.date:rd.object;default:return rd.unknown}},El=Q1.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"]);let RB=class wdt extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=n=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};const t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.issues=e}format(e){const t=e||function(o){return o.message},n={_errors:[]},r=o=>{for(const a of o.issues)if(a.code==="invalid_union")a.unionErrors.map(r);else if(a.code==="invalid_return_type")r(a.returnTypeError);else if(a.code==="invalid_arguments")r(a.argumentsError);else if(a.path.length===0)n._errors.push(t(a));else{let s=n,l=0;for(;l<a.path.length;){const c=a.path[l];l===a.path.length-1?(s[c]=s[c]||{_errors:[]},s[c]._errors.push(t(a))):s[c]=s[c]||{_errors:[]},s=s[c],l++}}};return r(this),n}static assert(e){if(!(e instanceof wdt))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,Q1.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=t=>t.message){const t={},n=[];for(const r of this.issues)if(r.path.length>0){const o=r.path[0];t[o]=t[o]||[],t[o].push(e(r))}else n.push(e(r));return{formErrors:n,fieldErrors:t}}get formErrors(){return this.flatten()}};RB.create=i=>new RB(i);const m8=(i,e)=>{let t;switch(i.code){case El.invalid_type:i.received===rd.undefined?t="Required":t=`Expected ${i.expected}, received ${i.received}`;break;case El.invalid_literal:t=`Invalid literal value, expected ${JSON.stringify(i.expected,Q1.jsonStringifyReplacer)}`;break;case El.unrecognized_keys:t=`Unrecognized key(s) in object: ${Q1.joinValues(i.keys,", ")}`;break;case El.invalid_union:t="Invalid input";break;case El.invalid_union_discriminator:t=`Invalid discriminator value. Expected ${Q1.joinValues(i.options)}`;break;case El.invalid_enum_value:t=`Invalid enum value. Expected ${Q1.joinValues(i.options)}, received '${i.received}'`;break;case El.invalid_arguments:t="Invalid function arguments";break;case El.invalid_return_type:t="Invalid function return type";break;case El.invalid_date:t="Invalid date";break;case El.invalid_string:typeof i.validation=="object"?"includes"in i.validation?(t=`Invalid input: must include "${i.validation.includes}"`,typeof i.validation.position=="number"&&(t=`${t} at one or more positions greater than or equal to ${i.validation.position}`)):"startsWith"in i.validation?t=`Invalid input: must start with "${i.validation.startsWith}"`:"endsWith"in i.validation?t=`Invalid input: must end with "${i.validation.endsWith}"`:Q1.assertNever(i.validation):i.validation!=="regex"?t=`Invalid ${i.validation}`:t="Invalid";break;case El.too_small:i.type==="array"?t=`Array must contain ${i.exact?"exactly":i.inclusive?"at least":"more than"} ${i.minimum} element(s)`:i.type==="string"?t=`String must contain ${i.exact?"exactly":i.inclusive?"at least":"over"} ${i.minimum} character(s)`:i.type==="number"?t=`Number must be ${i.exact?"exactly equal to ":i.inclusive?"greater than or equal to ":"greater than "}${i.minimum}`:i.type==="bigint"?t=`Number must be ${i.exact?"exactly equal to ":i.inclusive?"greater than or equal to ":"greater than "}${i.minimum}`:i.type==="date"?t=`Date must be ${i.exact?"exactly equal to ":i.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(i.minimum))}`:t="Invalid input";break;case El.too_big:i.type==="array"?t=`Array must contain ${i.exact?"exactly":i.inclusive?"at most":"less than"} ${i.maximum} element(s)`:i.type==="string"?t=`String must contain ${i.exact?"exactly":i.inclusive?"at most":"under"} ${i.maximum} character(s)`:i.type==="number"?t=`Number must be ${i.exact?"exactly":i.inclusive?"less than or equal to":"less than"} ${i.maximum}`:i.type==="bigint"?t=`BigInt must be ${i.exact?"exactly":i.inclusive?"less than or equal to":"less than"} ${i.maximum}`:i.type==="date"?t=`Date must be ${i.exact?"exactly":i.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(i.maximum))}`:t="Invalid input";break;case El.custom:t="Invalid input";break;case El.invalid_intersection_types:t="Intersection results could not be merged";break;case El.not_multiple_of:t=`Number must be a multiple of ${i.multipleOf}`;break;case El.not_finite:t="Number must be finite";break;default:t=e.defaultError,Q1.assertNever(i)}return{message:t}};let emt=m8;function JX(){return emt}const qX=i=>{const{data:e,path:t,errorMaps:n,issueData:r}=i,o=[...t,...r.path||[]],a={...r,path:o};if(r.message!==void 0)return{...r,path:o,message:r.message};let s="";const l=n.filter(c=>!!c).slice().reverse();for(const c of l)s=c(a,{data:e,defaultError:s}).message;return{...r,path:o,message:s}};function tA(i,e){const t=JX(),n=qX({issueData:e,data:i.data,path:i.path,errorMaps:[i.common.contextualErrorMap,i.schemaErrorMap,t,t===m8?void 0:m8].filter(r=>!!r)});i.common.issues.push(n)}let Db=class Qdt{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,t){const n=[];for(const r of t){if(r.status==="aborted")return ip;r.status==="dirty"&&e.dirty(),n.push(r.value)}return{status:e.value,value:n}}static async mergeObjectAsync(e,t){const n=[];for(const r of t){const o=await r.key,a=await r.value;n.push({key:o,value:a})}return Qdt.mergeObjectSync(e,n)}static mergeObjectSync(e,t){const n={};for(const r of t){const{key:o,value:a}=r;if(o.status==="aborted"||a.status==="aborted")return ip;o.status==="dirty"&&e.dirty(),a.status==="dirty"&&e.dirty(),o.value!=="__proto__"&&(typeof a.value<"u"||r.alwaysSet)&&(n[o.value]=a.value)}return{status:e.value,value:n}}};const ip=Object.freeze({status:"aborted"}),y8=i=>({status:"dirty",value:i}),JE=i=>({status:"valid",value:i}),p2e=i=>i.status==="aborted",g2e=i=>i.status==="dirty",xM=i=>i.status==="valid",zU=i=>typeof Promise<"u"&&i instanceof Promise;var Ff;(function(i){i.errToObj=e=>typeof e=="string"?{message:e}:e||{},i.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(Ff||(Ff={}));let DB=class{constructor(e,t,n,r){this._cachedPath=[],this.parent=e,this.data=t,this._path=n,this._key=r}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}};const m2e=(i,e)=>{if(xM(e))return{success:!0,data:e.value};if(!i.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const t=new RB(i.common.issues);return this._error=t,this._error}}};function zg(i){if(!i)return{};const{errorMap:e,invalid_type_error:t,required_error:n,description:r}=i;if(e&&(t||n))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:r}:{errorMap:(a,s)=>{const{message:l}=i;return a.code==="invalid_enum_value"?{message:l??s.defaultError}:typeof s.data>"u"?{message:l??n??s.defaultError}:a.code!=="invalid_type"?{message:s.defaultError}:{message:l??t??s.defaultError}},description:r}}let ry=class{get description(){return this._def.description}_getType(e){return h3(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:h3(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new Db,ctx:{common:e.parent.common,data:e.data,parsedType:h3(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const t=this._parse(e);if(zU(t))throw new Error("Synchronous parse encountered promise.");return t}_parseAsync(e){const t=this._parse(e);return Promise.resolve(t)}parse(e,t){const n=this.safeParse(e,t);if(n.success)return n.data;throw n.error}safeParse(e,t){const n={common:{issues:[],async:(t==null?void 0:t.async)??!1,contextualErrorMap:t==null?void 0:t.errorMap},path:(t==null?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:h3(e)},r=this._parseSync({data:e,path:n.path,parent:n});return m2e(n,r)}"~validate"(e){var n,r;const t={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:h3(e)};if(!this["~standard"].async)try{const o=this._parseSync({data:e,path:[],parent:t});return xM(o)?{value:o.value}:{issues:t.common.issues}}catch(o){(r=(n=o==null?void 0:o.message)==null?void 0:n.toLowerCase())!=null&&r.includes("encountered")&&(this["~standard"].async=!0),t.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:t}).then(o=>xM(o)?{value:o.value}:{issues:t.common.issues})}async parseAsync(e,t){const n=await this.safeParseAsync(e,t);if(n.success)return n.data;throw n.error}async safeParseAsync(e,t){const n={common:{issues:[],contextualErrorMap:t==null?void 0:t.errorMap,async:!0},path:(t==null?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:h3(e)},r=this._parse({data:e,path:n.path,parent:n}),o=await(zU(r)?r:Promise.resolve(r));return m2e(n,o)}refine(e,t){const n=r=>typeof t=="string"||typeof t>"u"?{message:t}:typeof t=="function"?t(r):t;return this._refinement((r,o)=>{const a=e(r),s=()=>o.addIssue({code:El.custom,...n(r)});return typeof Promise<"u"&&a instanceof Promise?a.then(l=>l?!0:(s(),!1)):a?!0:(s(),!1)})}refinement(e,t){return this._refinement((n,r)=>e(n)?!0:(r.addIssue(typeof t=="function"?t(n,r):t),!1))}_refinement(e){return new Ww({schema:this,typeName:mp.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:t=>this["~validate"](t)}}optional(){return YS.create(this,this._def)}nullable(){return $w.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return bM.create(this)}promise(){return v8.create(this,this._def)}or(e){return VU.create([this,e],this._def)}and(e){return KU.create(this,e,this._def)}transform(e){return new Ww({...zg(this._def),schema:this,typeName:mp.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const t=typeof e=="function"?e:()=>e;return new qU({...zg(this._def),innerType:this,defaultValue:t,typeName:mp.ZodDefault})}brand(){return new w2e({typeName:mp.ZodBranded,type:this,...zg(this._def)})}catch(e){const t=typeof e=="function"?e:()=>e;return new ZU({...zg(this._def),innerType:this,catchValue:t,typeName:mp.ZodCatch})}describe(e){const t=this.constructor;return new t({...this._def,description:e})}pipe(e){return Bmt.create(this,e)}readonly(){return XU.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}};const tmt=/^c[^\s-]{8,}$/i,nmt=/^[0-9a-z]+$/,imt=/^[0-9A-HJKMNP-TV-Z]{26}$/i,rmt=/^[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,omt=/^[a-z0-9_-]{21}$/i,amt=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,smt=/^[-+]?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)?)??$/,lmt=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,cmt="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let ZX;const umt=/^(?:(?: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])$/,Amt=/^(?:(?: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])$/,dmt=/^(([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]))$/,fmt=/^(([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])$/,hmt=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,pmt=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,y2e="((\\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])))",gmt=new RegExp(`^${y2e}$`);function _2e(i){let e="[0-5]\\d";i.precision?e=`${e}\\.\\d{${i.precision}}`:i.precision==null&&(e=`${e}(\\.\\d+)?`);const t=i.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${t}`}function mmt(i){return new RegExp(`^${_2e(i)}$`)}function ymt(i){let e=`${y2e}T${_2e(i)}`;const t=[];return t.push(i.local?"Z?":"Z"),i.offset&&t.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${t.join("|")})`,new RegExp(`^${e}$`)}function _mt(i,e){return!!((e==="v4"||!e)&&umt.test(i)||(e==="v6"||!e)&&dmt.test(i))}function vmt(i,e){if(!amt.test(i))return!1;try{const[t]=i.split(".");if(!t)return!1;const n=t.replace(/-/g,"+").replace(/_/g,"/").padEnd(t.length+(4-t.length%4)%4,"="),r=JSON.parse(atob(n));return!(typeof r!="object"||r===null||"typ"in r&&(r==null?void 0:r.typ)!=="JWT"||!r.alg||e&&r.alg!==e)}catch{return!1}}function Imt(i,e){return!!((e==="v4"||!e)&&Amt.test(i)||(e==="v6"||!e)&&fmt.test(i))}let HU=class HP extends ry{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==rd.string){const o=this._getOrReturnCtx(e);return tA(o,{code:El.invalid_type,expected:rd.string,received:o.parsedType}),ip}const n=new Db;let r;for(const o of this._def.checks)if(o.kind==="min")e.data.length<o.value&&(r=this._getOrReturnCtx(e,r),tA(r,{code:El.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),n.dirty());else if(o.kind==="max")e.data.length>o.value&&(r=this._getOrReturnCtx(e,r),tA(r,{code:El.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),n.dirty());else if(o.kind==="length"){const a=e.data.length>o.value,s=e.data.length<o.value;(a||s)&&(r=this._getOrReturnCtx(e,r),a?tA(r,{code:El.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}):s&&tA(r,{code:El.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}),n.dirty())}else if(o.kind==="email")lmt.test(e.data)||(r=this._getOrReturnCtx(e,r),tA(r,{validation:"email",code:El.invalid_string,message:o.message}),n.dirty());else if(o.kind==="emoji")ZX||(ZX=new RegExp(cmt,"u")),ZX.test(e.data)||(r=this._getOrReturnCtx(e,r),tA(r,{validation:"emoji",code:El.invalid_string,message:o.message}),n.dirty());else if(o.kind==="uuid")rmt.test(e.data)||(r=this._getOrReturnCtx(e,r),tA(r,{validation:"uuid",code:El.invalid_string,message:o.message}),n.dirty());else if(o.kind==="nanoid")omt.test(e.data)||(r=this._getOrReturnCtx(e,r),tA(r,{validation:"nanoid",code:El.invalid_string,message:o.message}),n.dirty());else if(o.kind==="cuid")tmt.test(e.data)||(r=this._getOrReturnCtx(e,r),tA(r,{validation:"cuid",code:El.invalid_string,message:o.message}),n.dirty());else if(o.kind==="cuid2")nmt.test(e.data)||(r=this._getOrReturnCtx(e,r),tA(r,{validation:"cuid2",code:El.invalid_string,message:o.message}),n.dirty());else if(o.kind==="ulid")imt.test(e.data)||(r=this._getOrReturnCtx(e,r),tA(r,{validation:"ulid",code:El.invalid_string,message:o.message}),n.dirty());else if(o.kind==="url")try{new URL(e.data)}catch{r=this._getOrReturnCtx(e,r),tA(r,{validation:"url",code:El.invalid_string,message:o.message}),n.dirty()}else o.kind==="regex"?(o.regex.lastIndex=0,o.regex.test(e.data)||(r=this._getOrReturnCtx(e,r),tA(r,{validation:"regex",code:El.invalid_string,message:o.message}),n.dirty())):o.kind==="trim"?e.data=e.data.trim():o.kind==="includes"?e.data.includes(o.value,o.position)||(r=this._getOrReturnCtx(e,r),tA(r,{code:El.invalid_string,validation:{includes:o.value,position:o.position},message:o.message}),n.dirty()):o.kind==="toLowerCase"?e.data=e.data.toLowerCase():o.kind==="toUpperCase"?e.data=e.data.toUpperCase():o.kind==="startsWith"?e.data.startsWith(o.value)||(r=this._getOrReturnCtx(e,r),tA(r,{code:El.invalid_string,validation:{startsWith:o.value},message:o.message}),n.dirty()):o.kind==="endsWith"?e.data.endsWith(o.value)||(r=this._getOrReturnCtx(e,r),tA(r,{code:El.invalid_string,validation:{endsWith:o.value},message:o.message}),n.dirty()):o.kind==="datetime"?ymt(o).test(e.data)||(r=this._getOrReturnCtx(e,r),tA(r,{code:El.invalid_string,validation:"datetime",message:o.message}),n.dirty()):o.kind==="date"?gmt.test(e.data)||(r=this._getOrReturnCtx(e,r),tA(r,{code:El.invalid_string,validation:"date",message:o.message}),n.dirty()):o.kind==="time"?mmt(o).test(e.data)||(r=this._getOrReturnCtx(e,r),tA(r,{code:El.invalid_string,validation:"time",message:o.message}),n.dirty()):o.kind==="duration"?smt.test(e.data)||(r=this._getOrReturnCtx(e,r),tA(r,{validation:"duration",code:El.invalid_string,message:o.message}),n.dirty()):o.kind==="ip"?_mt(e.data,o.version)||(r=this._getOrReturnCtx(e,r),tA(r,{validation:"ip",code:El.invalid_string,message:o.message}),n.dirty()):o.kind==="jwt"?vmt(e.data,o.alg)||(r=this._getOrReturnCtx(e,r),tA(r,{validation:"jwt",code:El.invalid_string,message:o.message}),n.dirty()):o.kind==="cidr"?Imt(e.data,o.version)||(r=this._getOrReturnCtx(e,r),tA(r,{validation:"cidr",code:El.invalid_string,message:o.message}),n.dirty()):o.kind==="base64"?hmt.test(e.data)||(r=this._getOrReturnCtx(e,r),tA(r,{validation:"base64",code:El.invalid_string,message:o.message}),n.dirty()):o.kind==="base64url"?pmt.test(e.data)||(r=this._getOrReturnCtx(e,r),tA(r,{validation:"base64url",code:El.invalid_string,message:o.message}),n.dirty()):Q1.assertNever(o);return{status:n.value,value:e.data}}_regex(e,t,n){return this.refinement(r=>e.test(r),{validation:t,code:El.invalid_string,...Ff.errToObj(n)})}_addCheck(e){return new HP({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...Ff.errToObj(e)})}url(e){return this._addCheck({kind:"url",...Ff.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...Ff.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...Ff.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...Ff.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...Ff.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...Ff.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...Ff.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...Ff.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...Ff.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...Ff.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...Ff.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...Ff.errToObj(e)})}datetime(e){return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,offset:(e==null?void 0:e.offset)??!1,local:(e==null?void 0:e.local)??!1,...Ff.errToObj(e==null?void 0:e.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,...Ff.errToObj(e==null?void 0:e.message)})}duration(e){return this._addCheck({kind:"duration",...Ff.errToObj(e)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...Ff.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:t==null?void 0:t.position,...Ff.errToObj(t==null?void 0:t.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...Ff.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...Ff.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...Ff.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...Ff.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...Ff.errToObj(t)})}nonempty(e){return this.min(1,Ff.errToObj(e))}trim(){return new HP({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new HP({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new HP({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isCIDR(){return!!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find(e=>e.kind==="base64url")}get minLength(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}};HU.create=i=>new HU({checks:[],typeName:mp.ZodString,coerce:(i==null?void 0:i.coerce)??!1,...zg(i)});function Cmt(i,e){const t=(i.toString().split(".")[1]||"").length,n=(e.toString().split(".")[1]||"").length,r=t>n?t:n,o=Number.parseInt(i.toFixed(r).replace(".","")),a=Number.parseInt(e.toFixed(r).replace(".",""));return o%a/10**r}let XX=class y9e extends ry{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==rd.number){const o=this._getOrReturnCtx(e);return tA(o,{code:El.invalid_type,expected:rd.number,received:o.parsedType}),ip}let n;const r=new Db;for(const o of this._def.checks)o.kind==="int"?Q1.isInteger(e.data)||(n=this._getOrReturnCtx(e,n),tA(n,{code:El.invalid_type,expected:"integer",received:"float",message:o.message}),r.dirty()):o.kind==="min"?(o.inclusive?e.data<o.value:e.data<=o.value)&&(n=this._getOrReturnCtx(e,n),tA(n,{code:El.too_small,minimum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),r.dirty()):o.kind==="max"?(o.inclusive?e.data>o.value:e.data>=o.value)&&(n=this._getOrReturnCtx(e,n),tA(n,{code:El.too_big,maximum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),r.dirty()):o.kind==="multipleOf"?Cmt(e.data,o.value)!==0&&(n=this._getOrReturnCtx(e,n),tA(n,{code:El.not_multiple_of,multipleOf:o.value,message:o.message}),r.dirty()):o.kind==="finite"?Number.isFinite(e.data)||(n=this._getOrReturnCtx(e,n),tA(n,{code:El.not_finite,message:o.message}),r.dirty()):Q1.assertNever(o);return{status:r.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,Ff.toString(t))}gt(e,t){return this.setLimit("min",e,!1,Ff.toString(t))}lte(e,t){return this.setLimit("max",e,!0,Ff.toString(t))}lt(e,t){return this.setLimit("max",e,!1,Ff.toString(t))}setLimit(e,t,n,r){return new y9e({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:n,message:Ff.toString(r)}]})}_addCheck(e){return new y9e({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:Ff.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:Ff.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:Ff.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:Ff.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:Ff.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:Ff.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:Ff.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:Ff.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:Ff.toString(e)})}get minValue(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&Q1.isInteger(e.value))}get isFinite(){let e=null,t=null;for(const n of this._def.checks){if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;n.kind==="min"?(t===null||n.value>t)&&(t=n.value):n.kind==="max"&&(e===null||n.value<e)&&(e=n.value)}return Number.isFinite(t)&&Number.isFinite(e)}};XX.create=i=>new XX({checks:[],typeName:mp.ZodNumber,coerce:(i==null?void 0:i.coerce)||!1,...zg(i)});let v2e=class _9e extends ry{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==rd.bigint)return this._getInvalidInput(e);let n;const r=new Db;for(const o of this._def.checks)o.kind==="min"?(o.inclusive?e.data<o.value:e.data<=o.value)&&(n=this._getOrReturnCtx(e,n),tA(n,{code:El.too_small,type:"bigint",minimum:o.value,inclusive:o.inclusive,message:o.message}),r.dirty()):o.kind==="max"?(o.inclusive?e.data>o.value:e.data>=o.value)&&(n=this._getOrReturnCtx(e,n),tA(n,{code:El.too_big,type:"bigint",maximum:o.value,inclusive:o.inclusive,message:o.message}),r.dirty()):o.kind==="multipleOf"?e.data%o.value!==BigInt(0)&&(n=this._getOrReturnCtx(e,n),tA(n,{code:El.not_multiple_of,multipleOf:o.value,message:o.message}),r.dirty()):Q1.assertNever(o);return{status:r.value,value:e.data}}_getInvalidInput(e){const t=this._getOrReturnCtx(e);return tA(t,{code:El.invalid_type,expected:rd.bigint,received:t.parsedType}),ip}gte(e,t){return this.setLimit("min",e,!0,Ff.toString(t))}gt(e,t){return this.setLimit("min",e,!1,Ff.toString(t))}lte(e,t){return this.setLimit("max",e,!0,Ff.toString(t))}lt(e,t){return this.setLimit("max",e,!1,Ff.toString(t))}setLimit(e,t,n,r){return new _9e({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:n,message:Ff.toString(r)}]})}_addCheck(e){return new _9e({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:Ff.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:Ff.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:Ff.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:Ff.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:Ff.toString(t)})}get minValue(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}};v2e.create=i=>new v2e({checks:[],typeName:mp.ZodBigInt,coerce:(i==null?void 0:i.coerce)??!1,...zg(i)});let WX=class extends ry{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==rd.boolean){const n=this._getOrReturnCtx(e);return tA(n,{code:El.invalid_type,expected:rd.boolean,received:n.parsedType}),ip}return JE(e.data)}};WX.create=i=>new WX({typeName:mp.ZodBoolean,coerce:(i==null?void 0:i.coerce)||!1,...zg(i)});let I2e=class Mdt extends ry{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==rd.date){const o=this._getOrReturnCtx(e);return tA(o,{code:El.invalid_type,expected:rd.date,received:o.parsedType}),ip}if(Number.isNaN(e.data.getTime())){const o=this._getOrReturnCtx(e);return tA(o,{code:El.invalid_date}),ip}const n=new Db;let r;for(const o of this._def.checks)o.kind==="min"?e.data.getTime()<o.value&&(r=this._getOrReturnCtx(e,r),tA(r,{code:El.too_small,message:o.message,inclusive:!0,exact:!1,minimum:o.value,type:"date"}),n.dirty()):o.kind==="max"?e.data.getTime()>o.value&&(r=this._getOrReturnCtx(e,r),tA(r,{code:El.too_big,message:o.message,inclusive:!0,exact:!1,maximum:o.value,type:"date"}),n.dirty()):Q1.assertNever(o);return{status:n.value,value:new Date(e.data.getTime())}}_addCheck(e){return new Mdt({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:Ff.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:Ff.toString(t)})}get minDate(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e!=null?new Date(e):null}};I2e.create=i=>new I2e({checks:[],coerce:(i==null?void 0:i.coerce)||!1,typeName:mp.ZodDate,...zg(i)});let C2e=class extends ry{_parse(e){if(this._getType(e)!==rd.symbol){const n=this._getOrReturnCtx(e);return tA(n,{code:El.invalid_type,expected:rd.symbol,received:n.parsedType}),ip}return JE(e.data)}};C2e.create=i=>new C2e({typeName:mp.ZodSymbol,...zg(i)});let $X=class extends ry{_parse(e){if(this._getType(e)!==rd.undefined){const n=this._getOrReturnCtx(e);return tA(n,{code:El.invalid_type,expected:rd.undefined,received:n.parsedType}),ip}return JE(e.data)}};$X.create=i=>new $X({typeName:mp.ZodUndefined,...zg(i)});let YU=class extends ry{_parse(e){if(this._getType(e)!==rd.null){const n=this._getOrReturnCtx(e);return tA(n,{code:El.invalid_type,expected:rd.null,received:n.parsedType}),ip}return JE(e.data)}};YU.create=i=>new YU({typeName:mp.ZodNull,...zg(i)});let _8=class extends ry{constructor(){super(...arguments),this._any=!0}_parse(e){return JE(e.data)}};_8.create=i=>new _8({typeName:mp.ZodAny,...zg(i)});let EM=class extends ry{constructor(){super(...arguments),this._unknown=!0}_parse(e){return JE(e.data)}};EM.create=i=>new EM({typeName:mp.ZodUnknown,...zg(i)});let p3=class extends ry{_parse(e){const t=this._getOrReturnCtx(e);return tA(t,{code:El.invalid_type,expected:rd.never,received:t.parsedType}),ip}};p3.create=i=>new p3({typeName:mp.ZodNever,...zg(i)});let x2e=class extends ry{_parse(e){if(this._getType(e)!==rd.undefined){const n=this._getOrReturnCtx(e);return tA(n,{code:El.invalid_type,expected:rd.void,received:n.parsedType}),ip}return JE(e.data)}};x2e.create=i=>new x2e({typeName:mp.ZodVoid,...zg(i)});let bM=class AZ extends ry{_parse(e){const{ctx:t,status:n}=this._processInputParams(e),r=this._def;if(t.parsedType!==rd.array)return tA(t,{code:El.invalid_type,expected:rd.array,received:t.parsedType}),ip;if(r.exactLength!==null){const a=t.data.length>r.exactLength.value,s=t.data.length<r.exactLength.value;(a||s)&&(tA(t,{code:a?El.too_big:El.too_small,minimum:s?r.exactLength.value:void 0,maximum:a?r.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:r.exactLength.message}),n.dirty())}if(r.minLength!==null&&t.data.length<r.minLength.value&&(tA(t,{code:El.too_small,minimum:r.minLength.value,type:"array",inclusive:!0,exact:!1,message:r.minLength.message}),n.dirty()),r.maxLength!==null&&t.data.length>r.maxLength.value&&(tA(t,{code:El.too_big,maximum:r.maxLength.value,type:"array",inclusive:!0,exact:!1,message:r.maxLength.message}),n.dirty()),t.common.async)return Promise.all([...t.data].map((a,s)=>r.type._parseAsync(new DB(t,a,t.path,s)))).then(a=>Db.mergeArray(n,a));const o=[...t.data].map((a,s)=>r.type._parseSync(new DB(t,a,t.path,s)));return Db.mergeArray(n,o)}get element(){return this._def.type}min(e,t){return new AZ({...this._def,minLength:{value:e,message:Ff.toString(t)}})}max(e,t){return new AZ({...this._def,maxLength:{value:e,message:Ff.toString(t)}})}length(e,t){return new AZ({...this._def,exactLength:{value:e,message:Ff.toString(t)}})}nonempty(e){return this.min(1,e)}};bM.create=(i,e)=>new bM({type:i,minLength:null,maxLength:null,exactLength:null,typeName:mp.ZodArray,...zg(e)});function BM(i){if(i instanceof zS){const e={};for(const t in i.shape){const n=i.shape[t];e[t]=YS.create(BM(n))}return new zS({...i._def,shape:()=>e})}else return i instanceof bM?new bM({...i._def,type:BM(i.element)}):i instanceof YS?YS.create(BM(i.unwrap())):i instanceof $w?$w.create(BM(i.unwrap())):i instanceof Xw?Xw.create(i.items.map(e=>BM(e))):i}let zS=class mB extends ry{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const e=this._def.shape(),t=Q1.objectKeys(e);return this._cached={shape:e,keys:t},this._cached}_parse(e){if(this._getType(e)!==rd.object){const c=this._getOrReturnCtx(e);return tA(c,{code:El.invalid_type,expected:rd.object,received:c.parsedType}),ip}const{status:n,ctx:r}=this._processInputParams(e),{shape:o,keys:a}=this._getCached(),s=[];if(!(this._def.catchall instanceof p3&&this._def.unknownKeys==="strip"))for(const c in r.data)a.includes(c)||s.push(c);const l=[];for(const c of a){const u=o[c],A=r.data[c];l.push({key:{status:"valid",value:c},value:u._parse(new DB(r,A,r.path,c)),alwaysSet:c in r.data})}if(this._def.catchall instanceof p3){const c=this._def.unknownKeys;if(c==="passthrough")for(const u of s)l.push({key:{status:"valid",value:u},value:{status:"valid",value:r.data[u]}});else if(c==="strict")s.length>0&&(tA(r,{code:El.unrecognized_keys,keys:s}),n.dirty());else if(c!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const c=this._def.catchall;for(const u of s){const A=r.data[u];l.push({key:{status:"valid",value:u},value:c._parse(new DB(r,A,r.path,u)),alwaysSet:u in r.data})}}return r.common.async?Promise.resolve().then(async()=>{const c=[];for(const u of l){const A=await u.key,d=await u.value;c.push({key:A,value:d,alwaysSet:u.alwaysSet})}return c}).then(c=>Db.mergeObjectSync(n,c)):Db.mergeObjectSync(n,l)}get shape(){return this._def.shape()}strict(e){return Ff.errToObj,new mB({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(t,n)=>{var o,a;const r=((a=(o=this._def).errorMap)==null?void 0:a.call(o,t,n).message)??n.defaultError;return t.code==="unrecognized_keys"?{message:Ff.errToObj(e).message??r}:{message:r}}}:{}})}strip(){return new mB({...this._def,unknownKeys:"strip"})}passthrough(){return new mB({...this._def,unknownKeys:"passthrough"})}extend(e){return new mB({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new mB({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:mp.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new mB({...this._def,catchall:e})}pick(e){const t={};for(const n of Q1.objectKeys(e))e[n]&&this.shape[n]&&(t[n]=this.shape[n]);return new mB({...this._def,shape:()=>t})}omit(e){const t={};for(const n of Q1.objectKeys(this.shape))e[n]||(t[n]=this.shape[n]);return new mB({...this._def,shape:()=>t})}deepPartial(){return BM(this)}partial(e){const t={};for(const n of Q1.objectKeys(this.shape)){const r=this.shape[n];e&&!e[n]?t[n]=r:t[n]=r.optional()}return new mB({...this._def,shape:()=>t})}required(e){const t={};for(const n of Q1.objectKeys(this.shape))if(e&&!e[n])t[n]=this.shape[n];else{let o=this.shape[n];for(;o instanceof YS;)o=o._def.innerType;t[n]=o}return new mB({...this._def,shape:()=>t})}keyof(){return B2e(Q1.objectKeys(this.shape))}};zS.create=(i,e)=>new zS({shape:()=>i,unknownKeys:"strip",catchall:p3.create(),typeName:mp.ZodObject,...zg(e)}),zS.strictCreate=(i,e)=>new zS({shape:()=>i,unknownKeys:"strict",catchall:p3.create(),typeName:mp.ZodObject,...zg(e)}),zS.lazycreate=(i,e)=>new zS({shape:i,unknownKeys:"strip",catchall:p3.create(),typeName:mp.ZodObject,...zg(e)});let VU=class extends ry{_parse(e){const{ctx:t}=this._processInputParams(e),n=this._def.options;function r(o){for(const s of o)if(s.result.status==="valid")return s.result;for(const s of o)if(s.result.status==="dirty")return t.common.issues.push(...s.ctx.common.issues),s.result;const a=o.map(s=>new RB(s.ctx.common.issues));return tA(t,{code:El.invalid_union,unionErrors:a}),ip}if(t.common.async)return Promise.all(n.map(async o=>{const a={...t,common:{...t.common,issues:[]},parent:null};return{result:await o._parseAsync({data:t.data,path:t.path,parent:a}),ctx:a}})).then(r);{let o;const a=[];for(const l of n){const c={...t,common:{...t.common,issues:[]},parent:null},u=l._parseSync({data:t.data,path:t.path,parent:c});if(u.status==="valid")return u;u.status==="dirty"&&!o&&(o={result:u,ctx:c}),c.common.issues.length&&a.push(c.common.issues)}if(o)return t.common.issues.push(...o.ctx.common.issues),o.result;const s=a.map(l=>new RB(l));return tA(t,{code:El.invalid_union,unionErrors:s}),ip}}get options(){return this._def.options}};VU.create=(i,e)=>new VU({options:i,typeName:mp.ZodUnion,...zg(e)});const HS=i=>i instanceof tW?HS(i.schema):i instanceof Ww?HS(i.innerType()):i instanceof jU?[i.value]:i instanceof JU?i.options:i instanceof nW?Q1.objectValues(i.enum):i instanceof qU?HS(i._def.innerType):i instanceof $X?[void 0]:i instanceof YU?[null]:i instanceof YS?[void 0,...HS(i.unwrap())]:i instanceof $w?[null,...HS(i.unwrap())]:i instanceof w2e||i instanceof XU?HS(i.unwrap()):i instanceof ZU?HS(i._def.innerType):[];let xmt=class Rdt extends ry{_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==rd.object)return tA(t,{code:El.invalid_type,expected:rd.object,received:t.parsedType}),ip;const n=this.discriminator,r=t.data[n],o=this.optionsMap.get(r);return o?t.common.async?o._parseAsync({data:t.data,path:t.path,parent:t}):o._parseSync({data:t.data,path:t.path,parent:t}):(tA(t,{code:El.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),ip)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,t,n){const r=new Map;for(const o of t){const a=HS(o.shape[e]);if(!a.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(const s of a){if(r.has(s))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(s)}`);r.set(s,o)}}return new Rdt({typeName:mp.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:r,...zg(n)})}};function eW(i,e){const t=h3(i),n=h3(e);if(i===e)return{valid:!0,data:i};if(t===rd.object&&n===rd.object){const r=Q1.objectKeys(e),o=Q1.objectKeys(i).filter(s=>r.indexOf(s)!==-1),a={...i,...e};for(const s of o){const l=eW(i[s],e[s]);if(!l.valid)return{valid:!1};a[s]=l.data}return{valid:!0,data:a}}else if(t===rd.array&&n===rd.array){if(i.length!==e.length)return{valid:!1};const r=[];for(let o=0;o<i.length;o++){const a=i[o],s=e[o],l=eW(a,s);if(!l.valid)return{valid:!1};r.push(l.data)}return{valid:!0,data:r}}else return t===rd.date&&n===rd.date&&+i==+e?{valid:!0,data:i}:{valid:!1}}let KU=class extends ry{_parse(e){const{status:t,ctx:n}=this._processInputParams(e),r=(o,a)=>{if(p2e(o)||p2e(a))return ip;const s=eW(o.value,a.value);return s.valid?((g2e(o)||g2e(a))&&t.dirty(),{status:t.value,value:s.data}):(tA(n,{code:El.invalid_intersection_types}),ip)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([o,a])=>r(o,a)):r(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}};KU.create=(i,e,t)=>new KU({left:i,right:e,typeName:mp.ZodIntersection,...zg(t)});let Xw=class Ddt extends ry{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==rd.array)return tA(n,{code:El.invalid_type,expected:rd.array,received:n.parsedType}),ip;if(n.data.length<this._def.items.length)return tA(n,{code:El.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),ip;!this._def.rest&&n.data.length>this._def.items.length&&(tA(n,{code:El.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());const o=[...n.data].map((a,s)=>{const l=this._def.items[s]||this._def.rest;return l?l._parse(new DB(n,a,n.path,s)):null}).filter(a=>!!a);return n.common.async?Promise.all(o).then(a=>Db.mergeArray(t,a)):Db.mergeArray(t,o)}get items(){return this._def.items}rest(e){return new Ddt({...this._def,rest:e})}};Xw.create=(i,e)=>{if(!Array.isArray(i))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Xw({items:i,typeName:mp.ZodTuple,rest:null,...zg(e)})};let Emt=class v9e extends ry{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==rd.object)return tA(n,{code:El.invalid_type,expected:rd.object,received:n.parsedType}),ip;const r=[],o=this._def.keyType,a=this._def.valueType;for(const s in n.data)r.push({key:o._parse(new DB(n,s,n.path,s)),value:a._parse(new DB(n,n.data[s],n.path,s)),alwaysSet:s in n.data});return n.common.async?Db.mergeObjectAsync(t,r):Db.mergeObjectSync(t,r)}get element(){return this._def.valueType}static create(e,t,n){return t instanceof ry?new v9e({keyType:e,valueType:t,typeName:mp.ZodRecord,...zg(n)}):new v9e({keyType:HU.create(),valueType:e,typeName:mp.ZodRecord,...zg(t)})}},E2e=class extends ry{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==rd.map)return tA(n,{code:El.invalid_type,expected:rd.map,received:n.parsedType}),ip;const r=this._def.keyType,o=this._def.valueType,a=[...n.data.entries()].map(([s,l],c)=>({key:r._parse(new DB(n,s,n.path,[c,"key"])),value:o._parse(new DB(n,l,n.path,[c,"value"]))}));if(n.common.async){const s=new Map;return Promise.resolve().then(async()=>{for(const l of a){const c=await l.key,u=await l.value;if(c.status==="aborted"||u.status==="aborted")return ip;(c.status==="dirty"||u.status==="dirty")&&t.dirty(),s.set(c.value,u.value)}return{status:t.value,value:s}})}else{const s=new Map;for(const l of a){const c=l.key,u=l.value;if(c.status==="aborted"||u.status==="aborted")return ip;(c.status==="dirty"||u.status==="dirty")&&t.dirty(),s.set(c.value,u.value)}return{status:t.value,value:s}}}};E2e.create=(i,e,t)=>new E2e({valueType:e,keyType:i,typeName:mp.ZodMap,...zg(t)});let b2e=class I9e extends ry{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==rd.set)return tA(n,{code:El.invalid_type,expected:rd.set,received:n.parsedType}),ip;const r=this._def;r.minSize!==null&&n.data.size<r.minSize.value&&(tA(n,{code:El.too_small,minimum:r.minSize.value,type:"set",inclusive:!0,exact:!1,message:r.minSize.message}),t.dirty()),r.maxSize!==null&&n.data.size>r.maxSize.value&&(tA(n,{code:El.too_big,maximum:r.maxSize.value,type:"set",inclusive:!0,exact:!1,message:r.maxSize.message}),t.dirty());const o=this._def.valueType;function a(l){const c=new Set;for(const u of l){if(u.status==="aborted")return ip;u.status==="dirty"&&t.dirty(),c.add(u.value)}return{status:t.value,value:c}}const s=[...n.data.values()].map((l,c)=>o._parse(new DB(n,l,n.path,c)));return n.common.async?Promise.all(s).then(l=>a(l)):a(s)}min(e,t){return new I9e({...this._def,minSize:{value:e,message:Ff.toString(t)}})}max(e,t){return new I9e({...this._def,maxSize:{value:e,message:Ff.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}};b2e.create=(i,e)=>new b2e({valueType:i,minSize:null,maxSize:null,typeName:mp.ZodSet,...zg(e)});let bmt=class dZ extends ry{constructor(){super(...arguments),this.validate=this.implement}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==rd.function)return tA(t,{code:El.invalid_type,expected:rd.function,received:t.parsedType}),ip;function n(s,l){return qX({data:s,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,JX(),m8].filter(c=>!!c),issueData:{code:El.invalid_arguments,argumentsError:l}})}function r(s,l){return qX({data:s,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,JX(),m8].filter(c=>!!c),issueData:{code:El.invalid_return_type,returnTypeError:l}})}const o={errorMap:t.common.contextualErrorMap},a=t.data;if(this._def.returns instanceof v8){const s=this;return JE(async function(...l){const c=new RB([]),u=await s._def.args.parseAsync(l,o).catch(f=>{throw c.addIssue(n(l,f)),c}),A=await Reflect.apply(a,this,u);return await s._def.returns._def.type.parseAsync(A,o).catch(f=>{throw c.addIssue(r(A,f)),c})})}else{const s=this;return JE(function(...l){const c=s._def.args.safeParse(l,o);if(!c.success)throw new RB([n(l,c.error)]);const u=Reflect.apply(a,this,c.data),A=s._def.returns.safeParse(u,o);if(!A.success)throw new RB([r(u,A.error)]);return A.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new dZ({...this._def,args:Xw.create(e).rest(EM.create())})}returns(e){return new dZ({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,t,n){return new dZ({args:e||Xw.create([]).rest(EM.create()),returns:t||EM.create(),typeName:mp.ZodFunction,...zg(n)})}},tW=class extends ry{get schema(){return this._def.getter()}_parse(e){const{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}};tW.create=(i,e)=>new tW({getter:i,typeName:mp.ZodLazy,...zg(e)});let jU=class extends ry{_parse(e){if(e.data!==this._def.value){const t=this._getOrReturnCtx(e);return tA(t,{received:t.data,code:El.invalid_literal,expected:this._def.value}),ip}return{status:"valid",value:e.data}}get value(){return this._def.value}};jU.create=(i,e)=>new jU({value:i,typeName:mp.ZodLiteral,...zg(e)});function B2e(i,e){return new JU({values:i,typeName:mp.ZodEnum,...zg(e)})}let JU=class C9e extends ry{_parse(e){if(typeof e.data!="string"){const t=this._getOrReturnCtx(e),n=this._def.values;return tA(t,{expected:Q1.joinValues(n),received:t.parsedType,code:El.invalid_type}),ip}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){const t=this._getOrReturnCtx(e),n=this._def.values;return tA(t,{received:t.data,code:El.invalid_enum_value,options:n}),ip}return JE(e.data)}get options(){return this._def.values}get enum(){const e={};for(const t of this._def.values)e[t]=t;return e}get Values(){const e={};for(const t of this._def.values)e[t]=t;return e}get Enum(){const e={};for(const t of this._def.values)e[t]=t;return e}extract(e,t=this._def){return C9e.create(e,{...this._def,...t})}exclude(e,t=this._def){return C9e.create(this.options.filter(n=>!e.includes(n)),{...this._def,...t})}};JU.create=B2e;let nW=class extends ry{_parse(e){const t=Q1.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==rd.string&&n.parsedType!==rd.number){const r=Q1.objectValues(t);return tA(n,{expected:Q1.joinValues(r),received:n.parsedType,code:El.invalid_type}),ip}if(this._cache||(this._cache=new Set(Q1.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){const r=Q1.objectValues(t);return tA(n,{received:n.data,code:El.invalid_enum_value,options:r}),ip}return JE(e.data)}get enum(){return this._def.values}};nW.create=(i,e)=>new nW({values:i,typeName:mp.ZodNativeEnum,...zg(e)});let v8=class extends ry{unwrap(){return this._def.type}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==rd.promise&&t.common.async===!1)return tA(t,{code:El.invalid_type,expected:rd.promise,received:t.parsedType}),ip;const n=t.parsedType===rd.promise?t.data:Promise.resolve(t.data);return JE(n.then(r=>this._def.type.parseAsync(r,{path:t.path,errorMap:t.common.contextualErrorMap})))}};v8.create=(i,e)=>new v8({type:i,typeName:mp.ZodPromise,...zg(e)});let Ww=class extends ry{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===mp.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:t,ctx:n}=this._processInputParams(e),r=this._def.effect||null,o={addIssue:a=>{tA(n,a),a.fatal?t.abort():t.dirty()},get path(){return n.path}};if(o.addIssue=o.addIssue.bind(o),r.type==="preprocess"){const a=r.transform(n.data,o);if(n.common.async)return Promise.resolve(a).then(async s=>{if(t.value==="aborted")return ip;const l=await this._def.schema._parseAsync({data:s,path:n.path,parent:n});return l.status==="aborted"?ip:l.status==="dirty"||t.value==="dirty"?y8(l.value):l});{if(t.value==="aborted")return ip;const s=this._def.schema._parseSync({data:a,path:n.path,parent:n});return s.status==="aborted"?ip:s.status==="dirty"||t.value==="dirty"?y8(s.value):s}}if(r.type==="refinement"){const a=s=>{const l=r.refinement(s,o);if(n.common.async)return Promise.resolve(l);if(l instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return s};if(n.common.async===!1){const s=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return s.status==="aborted"?ip:(s.status==="dirty"&&t.dirty(),a(s.value),{status:t.value,value:s.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(s=>s.status==="aborted"?ip:(s.status==="dirty"&&t.dirty(),a(s.value).then(()=>({status:t.value,value:s.value}))))}if(r.type==="transform")if(n.common.async===!1){const a=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!xM(a))return ip;const s=r.transform(a.value,o);if(s instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:s}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(a=>xM(a)?Promise.resolve(r.transform(a.value,o)).then(s=>({status:t.value,value:s})):ip);Q1.assertNever(r)}};Ww.create=(i,e,t)=>new Ww({schema:i,typeName:mp.ZodEffects,effect:e,...zg(t)}),Ww.createWithPreprocess=(i,e,t)=>new Ww({schema:e,effect:{type:"preprocess",transform:i},typeName:mp.ZodEffects,...zg(t)});let YS=class extends ry{_parse(e){return this._getType(e)===rd.undefined?JE(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};YS.create=(i,e)=>new YS({innerType:i,typeName:mp.ZodOptional,...zg(e)});let $w=class extends ry{_parse(e){return this._getType(e)===rd.null?JE(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};$w.create=(i,e)=>new $w({innerType:i,typeName:mp.ZodNullable,...zg(e)});let qU=class extends ry{_parse(e){const{ctx:t}=this._processInputParams(e);let n=t.data;return t.parsedType===rd.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:t.path,parent:t})}removeDefault(){return this._def.innerType}};qU.create=(i,e)=>new qU({innerType:i,typeName:mp.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...zg(e)});let ZU=class extends ry{_parse(e){const{ctx:t}=this._processInputParams(e),n={...t,common:{...t.common,issues:[]}},r=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return zU(r)?r.then(o=>({status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new RB(n.common.issues)},input:n.data})})):{status:"valid",value:r.status==="valid"?r.value:this._def.catchValue({get error(){return new RB(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}};ZU.create=(i,e)=>new ZU({innerType:i,typeName:mp.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...zg(e)});let S2e=class extends ry{_parse(e){if(this._getType(e)!==rd.nan){const n=this._getOrReturnCtx(e);return tA(n,{code:El.invalid_type,expected:rd.nan,received:n.parsedType}),ip}return{status:"valid",value:e.data}}};S2e.create=i=>new S2e({typeName:mp.ZodNaN,...zg(i)});let w2e=class extends ry{_parse(e){const{ctx:t}=this._processInputParams(e),n=t.data;return this._def.type._parse({data:n,path:t.path,parent:t})}unwrap(){return this._def.type}},Bmt=class Ndt extends ry{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.common.async)return(async()=>{const o=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return o.status==="aborted"?ip:o.status==="dirty"?(t.dirty(),y8(o.value)):this._def.out._parseAsync({data:o.value,path:n.path,parent:n})})();{const r=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return r.status==="aborted"?ip:r.status==="dirty"?(t.dirty(),{status:"dirty",value:r.value}):this._def.out._parseSync({data:r.value,path:n.path,parent:n})}}static create(e,t){return new Ndt({in:e,out:t,typeName:mp.ZodPipeline})}},XU=class extends ry{_parse(e){const t=this._def.innerType._parse(e),n=r=>(xM(r)&&(r.value=Object.freeze(r.value)),r);return zU(t)?t.then(r=>n(r)):n(t)}unwrap(){return this._def.innerType}};XU.create=(i,e)=>new XU({innerType:i,typeName:mp.ZodReadonly,...zg(e)});function Q2e(i,e){const t=typeof i=="function"?i(e):typeof i=="string"?{message:i}:i;return typeof t=="string"?{message:t}:t}function NB(i,e={},t){return i?_8.create().superRefine((n,r)=>{const o=i(n);if(o instanceof Promise)return o.then(a=>{if(!a){const s=Q2e(e,n),l=s.fatal??t??!0;r.addIssue({code:"custom",...s,fatal:l})}});if(!o){const a=Q2e(e,n),s=a.fatal??t??!0;r.addIssue({code:"custom",...a,fatal:s})}}):_8.create()}var mp;(function(i){i.ZodString="ZodString",i.ZodNumber="ZodNumber",i.ZodNaN="ZodNaN",i.ZodBigInt="ZodBigInt",i.ZodBoolean="ZodBoolean",i.ZodDate="ZodDate",i.ZodSymbol="ZodSymbol",i.ZodUndefined="ZodUndefined",i.ZodNull="ZodNull",i.ZodAny="ZodAny",i.ZodUnknown="ZodUnknown",i.ZodNever="ZodNever",i.ZodVoid="ZodVoid",i.ZodArray="ZodArray",i.ZodObject="ZodObject",i.ZodUnion="ZodUnion",i.ZodDiscriminatedUnion="ZodDiscriminatedUnion",i.ZodIntersection="ZodIntersection",i.ZodTuple="ZodTuple",i.ZodRecord="ZodRecord",i.ZodMap="ZodMap",i.ZodSet="ZodSet",i.ZodFunction="ZodFunction",i.ZodLazy="ZodLazy",i.ZodLiteral="ZodLiteral",i.ZodEnum="ZodEnum",i.ZodEffects="ZodEffects",i.ZodNativeEnum="ZodNativeEnum",i.ZodOptional="ZodOptional",i.ZodNullable="ZodNullable",i.ZodDefault="ZodDefault",i.ZodCatch="ZodCatch",i.ZodPromise="ZodPromise",i.ZodBranded="ZodBranded",i.ZodPipeline="ZodPipeline",i.ZodReadonly="ZodReadonly"})(mp||(mp={}));const Ve=HU.create,Ki=XX.create,Wo=WX.create,Smt=YU.create,vE=_8.create;EM.create,p3.create;const Ko=bM.create,ti=zS.create,zh=VU.create,g3=xmt.create;KU.create,Xw.create;const dI=Emt.create,wmt=bmt.create,Kn=jU.create,gl=JU.create,Qmt=v8.create;YS.create,$w.create;const Mmt="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";let iW=(i=21)=>{let e="",t=crypto.getRandomValues(new Uint8Array(i|=0));for(;i--;)e+=Mmt[t[i]&63];return e};var M2e={Hz:{baseUnit:"Hz",variants:{MHz:1e6,kHz:1e3,Hz:1}},g:{baseUnit:"g",variants:{kg:1e3,g:1}},Ω:{baseUnit:"Ω",variants:{mΩ:.001,Ω:1,kΩ:1e3,KΩ:1e3,kohm:1e3,MΩ:1e6,GΩ:1e9,TΩ:1e12}},V:{baseUnit:"V",variants:{mV:.001,V:1,kV:1e3,KV:1e3,MV:1e6,GV:1e9,TV:1e12}},A:{baseUnit:"A",variants:{µA:1e-6,mA:.001,ma:.001,A:1,kA:1e3,MA:1e6}},F:{baseUnit:"F",variants:{pF:1e-12,nF:1e-9,µF:1e-6,uF:1e-6,mF:.001,F:1}},ml:{baseUnit:"ml",variants:{ml:1,mL:1,l:1e3,L:1e3}},deg:{baseUnit:"deg",variants:{rad:180/Math.PI}},ms:{baseUnit:"ms",variants:{s:1e3}},mm:{baseUnit:"mm",variants:{nm:1e-6,µm:.001,um:.001,mm:1,cm:10,dm:100,m:1e3,km:1e6,in:25.4,ft:304.8,IN:25.4,FT:304.8,yd:914.4,mi:1609344,mil:.0254}}},rW=new Set;for(const[i,e]of Object.entries(M2e)){rW.add(i);for(const t of Object.keys(e.variants))rW.add(t)}function Rmt(i){for(const[e,t]of Object.entries(M2e))if(i in t.variants)return{baseUnit:t.baseUnit,conversionFactor:t.variants[i]};return{baseUnit:i,conversionFactor:1}}var R2e={tera:1e12,T:1e12,giga:1e9,G:1e9,mega:1e6,M:1e6,kilo:1e3,k:1e3,deci:.1,d:.1,centi:.01,c:.01,milli:.001,m:.001,micro:1e-6,u:1e-6,µ:1e-6,nano:1e-9,n:1e-9,pico:1e-12,p:1e-12},P2=i=>{var s;if(typeof i>"u")return{parsedUnit:null,unitOfValue:null,value:null};if(typeof i=="string"&&i.match(/^-?[\d\.]+$/))return{value:Number.parseFloat(i),parsedUnit:null,unitOfValue:null};if(typeof i=="number")return{value:i,parsedUnit:null,unitOfValue:null};if(typeof i=="object"&&"x"in i&&"y"in i){const{parsedUnit:l,unitOfValue:c}=P2(i.x);return{parsedUnit:l,unitOfValue:c,value:{x:P2(i.x).value,y:P2(i.y).value}}}const t=(s=i.toString().split("").reverse().join("").match(/[^\d\s]+/))==null?void 0:s[0];if(!t)throw new Error(`Could not determine unit: "${i}"`);const n=t.split("").reverse().join(""),r=i.slice(0,-n.length);if(n in R2e&&!rW.has(n)){const l=R2e[n];return{parsedUnit:null,unitOfValue:null,value:Number.parseFloat(r)*l}}const{baseUnit:o,conversionFactor:a}=Rmt(n);return{parsedUnit:n,unitOfValue:o,value:a*Number.parseFloat(r)}},SM=Ve().or(Ki()).transform(i=>P2(i).value),wM=Ve().or(Ki()).transform(i=>P2(i).value).transform(i=>Number.parseFloat(i.toPrecision(12))),oW=Ve().or(Ki()).transform(i=>P2(i).value),e4=Ve().or(Ki()).transform(i=>P2(i).value),yn=Ve().or(Ki()).transform(i=>P2(i).value),WU=Ve().or(Ki()).transform(i=>P2(i).value),cr=yn,Dmt=Ve().or(Ki()).transform(i=>P2(i).value),Nmt=Ve().or(Ki()).transform(i=>P2(i).value),Zx=Ve().or(Ki()).transform(i=>typeof i=="number"?i:i.endsWith("deg")?Number.parseFloat(i.split("deg")[0]):i.endsWith("rad")?Number.parseFloat(i.split("rad")[0])*180/Math.PI:Number.parseFloat(i)),D2e=Ki().or(Ve().endsWith("mAh")).transform(i=>{if(typeof i=="string"){const e=i.replace("mAh",""),t=Number.parseFloat(e);if(Number.isNaN(t))throw new Error("Invalid capacity");return t}return i}).describe("Battery capacity in mAh"),zm=ti({x:cr,y:cr}),Tmt=zm,QM=ti({x:cr,y:cr,z:cr}),kmt=QM,aW=ti({width:Ki(),height:Ki()}),xh=i=>Ve().optional().default(()=>`${i}_${iW(10)}`),$U=gl(["top_left","top_center","top_right","center_left","center","center_right","bottom_left","bottom_center","bottom_right"]),eL=gl(["jlcpcb","macrofab","pcbway","digikey","mouser","lcsc"]),_9=ti({type:Kn("source_component"),ftype:Ve().optional(),source_component_id:Ve(),name:Ve(),manufacturer_part_number:Ve().optional(),supplier_part_numbers:dI(eL,Ko(Ve())).optional(),display_value:Ve().optional(),are_pins_interchangeable:Wo().optional(),internally_connected_source_port_ids:Ko(Ko(Ve())).optional(),source_group_id:Ve().optional(),subcircuit_id:Ve().optional()}),sW=_9.extend({ftype:Kn("simple_capacitor"),capacitance:wM,max_voltage_rating:e4.optional(),display_capacitance:Ve().optional(),max_decoupling_trace_length:cr.optional()}),lW=_9.extend({ftype:Kn("simple_resistor"),resistance:SM,display_resistance:Ve().optional()}),tL=_9.extend({ftype:Kn("simple_diode")}),cW=tL.extend({ftype:Kn("simple_led"),color:Ve().optional(),wavelength:Ve().optional()}),N2e=_9.extend({ftype:Kn("simple_ground")}),uW=_9.extend({ftype:Kn("simple_chip")}),AW=_9.extend({ftype:Kn("simple_power_source"),voltage:e4}),Pmt=_9.extend({ftype:Kn("simple_fuse"),current_rating_amps:Ki().describe("Nominal current in amps the fuse is rated for"),voltage_rating_volts:Ki().describe("Voltage rating in volts, e.g. ±5V would be 5")}),dW=_9.extend({ftype:Kn("simple_battery"),capacity:D2e}),fW=_9.extend({ftype:Kn("simple_inductor"),inductance:oW,max_current_rating:Ki().optional()}),hW=_9.extend({ftype:Kn("simple_push_button")}),pW=_9.extend({ftype:Kn("simple_potentiometer"),max_resistance:SM}),T2e=_9.extend({ftype:Kn("simple_crystal"),frequency:Ki().describe("Frequency in Hz"),load_capacitance:Ki().optional().describe("Load capacitance in pF")}),gW=_9.extend({ftype:Kn("simple_pin_header"),pin_count:Ki(),gender:gl(["male","female"]).optional().default("male")}),mW=_9.extend({ftype:Kn("simple_resonator"),load_capacitance:wM,equivalent_series_resistance:SM.optional(),frequency:WU}),yW=_9.extend({ftype:Kn("simple_transistor"),transistor_type:gl(["npn","pnp"])}),_W=_9.extend({ftype:Kn("simple_test_point"),footprint_variant:gl(["pad","through_hole"]).optional(),pad_shape:gl(["rect","circle"]).optional(),pad_diameter:zh([Ki(),Ve()]).optional(),hole_diameter:zh([Ki(),Ve()]).optional(),width:zh([Ki(),Ve()]).optional(),height:zh([Ki(),Ve()]).optional()}),vW=_9.extend({ftype:Kn("simple_mosfet"),channel_type:gl(["n","p"]),mosfet_mode:gl(["enhancement","depletion"])}),IW=_9.extend({ftype:Kn("simple_switch")}),CW=ti({type:Kn("source_project_metadata"),name:Ve().optional(),software_used_string:Ve().optional(),project_url:Ve().optional(),created_at:Ve().datetime().optional()}),k2e=ti({type:Kn("source_missing_property_error"),source_missing_property_error_id:xh("source_missing_property_error"),source_component_id:Ve(),property_name:Ve(),subcircuit_id:Ve().optional(),error_type:Kn("source_missing_property_error").default("source_missing_property_error"),message:Ve()}).describe("The source code is missing a property"),P2e=ti({type:Kn("source_failed_to_create_component_error"),source_failed_to_create_component_error_id:xh("source_failed_to_create_component_error"),error_type:Kn("source_failed_to_create_component_error").default("source_failed_to_create_component_error"),component_name:Ve().optional(),subcircuit_id:Ve().optional(),parent_source_component_id:Ve().optional(),message:Ve(),pcb_center:ti({x:Ki().optional(),y:Ki().optional()}).optional(),schematic_center:ti({x:Ki().optional(),y:Ki().optional()}).optional()}).describe("Error emitted when a component fails to be constructed"),xW=ti({type:Kn("source_trace_not_connected"),source_trace_not_connected_id:xh("source_trace_not_connected"),error_type:Kn("source_trace_not_connected").default("source_trace_not_connected"),message:Ve(),subcircuit_id:Ve().optional(),source_group_id:Ve().optional(),source_trace_id:Ve().optional(),connected_source_port_ids:Ko(Ve()).optional(),selectors_not_found:Ko(Ve()).optional()}).describe("Occurs when a source trace selector does not match any ports"),U2e=zh([lW,sW,tL,cW,N2e,uW,AW,dW,fW,hW,pW,T2e,gW,mW,IW,yW,_W,vW,Pmt,CW,k2e,P2e,xW]),L2e=ti({type:Kn("source_port"),pin_number:Ki().optional(),port_hints:Ko(Ve()).optional(),name:Ve(),source_port_id:Ve(),source_component_id:Ve(),subcircuit_id:Ve().optional(),subcircuit_connectivity_map_key:Ve().optional()}),F2e=ti({type:Kn("source_trace"),source_trace_id:Ve(),connected_source_port_ids:Ko(Ve()),connected_source_net_ids:Ko(Ve()),subcircuit_id:Ve().optional(),subcircuit_connectivity_map_key:Ve().optional(),max_length:Ki().optional(),min_trace_thickness:Ki().optional(),display_name:Ve().optional()}),G2e=ti({type:Kn("source_group"),source_group_id:Ve(),subcircuit_id:Ve().optional(),parent_subcircuit_id:Ve().optional(),parent_source_group_id:Ve().optional(),is_subcircuit:Wo().optional(),name:Ve().optional()}),O2e=ti({type:Kn("source_net"),source_net_id:Ve(),name:Ve(),member_source_group_ids:Ko(Ve()),is_power:Wo().optional(),is_ground:Wo().optional(),is_digital_signal:Wo().optional(),is_analog_signal:Wo().optional(),trace_width:Ki().optional(),subcircuit_id:Ve().optional(),subcircuit_connectivity_map_key:Ve().optional()}),z2e=ti({type:Kn("source_pcb_ground_plane"),source_pcb_ground_plane_id:Ve(),source_group_id:Ve(),source_net_id:Ve(),subcircuit_id:Ve().optional()}).describe("Defines a ground plane in the source domain"),H2e=ti({type:Kn("schematic_box"),schematic_component_id:Ve().optional(),width:cr,height:cr,is_dashed:Wo().default(!1),x:cr,y:cr,subcircuit_id:Ve().optional()}).describe("Draws a box on the schematic"),Y2e=ti({type:Kn("schematic_path"),schematic_component_id:Ve(),fill_color:gl(["red","blue"]).optional(),is_filled:Wo().optional(),points:Ko(zm),subcircuit_id:Ve().optional()}),V2e=dI(ti({left_margin:yn.optional(),right_margin:yn.optional(),top_margin:yn.optional(),bottom_margin:yn.optional()})),K2e=ti({left_size:Ki(),right_size:Ki(),top_size:Ki().optional(),bottom_size:Ki().optional()}),j2e=ti({left_side:ti({pins:Ko(Ki()),direction:gl(["top-to-bottom","bottom-to-top"]).optional()}).optional(),right_side:ti({pins:Ko(Ki()),direction:gl(["top-to-bottom","bottom-to-top"]).optional()}).optional(),top_side:ti({pins:Ko(Ki()),direction:gl(["left-to-right","right-to-left"]).optional()}).optional(),bottom_side:ti({pins:Ko(Ki()),direction:gl(["left-to-right","right-to-left"]).optional()}).optional()}),J2e=zh([K2e,j2e]),q2e=ti({type:Kn("schematic_component"),size:aW,center:zm,source_component_id:Ve(),schematic_component_id:Ve(),pin_spacing:yn.optional(),pin_styles:V2e.optional(),box_width:yn.optional(),symbol_name:Ve().optional(),port_arrangement:J2e.optional(),port_labels:dI(Ve()).optional(),symbol_display_value:Ve().optional(),subcircuit_id:Ve().optional(),schematic_group_id:Ve().optional()}),Z2e=ti({type:Kn("schematic_line"),schematic_component_id:Ve(),x1:cr,x2:cr,y1:cr,y2:cr,subcircuit_id:Ve().optional()}),X2e=ti({type:Kn("schematic_trace"),schematic_trace_id:Ve(),source_trace_id:Ve(),junctions:Ko(ti({x:Ki(),y:Ki()})),edges:Ko(ti({from:ti({x:Ki(),y:Ki()}),to:ti({x:Ki(),y:Ki()}),is_crossing:Wo().optional(),from_schematic_port_id:Ve().optional(),to_schematic_port_id:Ve().optional()})),subcircuit_id:Ve().optional()}),Umt=gl(["center","left","right","top","bottom"]),W2e=ti({type:Kn("schematic_text"),schematic_component_id:Ve().optional(),schematic_text_id:Ve(),text:Ve(),font_size:Ki().default(.18),position:ti({x:cr,y:cr}),rotation:Ki().default(0),anchor:zh([Umt.describe("legacy"),$U]).default("center"),color:Ve().default("#000000"),subcircuit_id:Ve().optional()}),$2e=ti({type:Kn("schematic_port"),schematic_port_id:Ve(),source_port_id:Ve(),schematic_component_id:Ve().optional(),center:zm,facing_direction:gl(["up","down","left","right"]).optional(),distance_from_component_edge:Ki().optional(),side_of_component:gl(["top","bottom","left","right"]).optional(),true_ccw_index:Ki().optional(),pin_number:Ki().optional(),display_pin_label:Ve().optional(),subcircuit_id:Ve().optional(),is_connected:Wo().optional()}).describe("Defines a port on a schematic component"),eBe=ti({type:Kn("schematic_net_label"),schematic_net_label_id:xh("schematic_net_label"),schematic_trace_id:Ve().optional(),source_trace_id:Ve().optional(),source_net_id:Ve(),center:zm,anchor_position:zm.optional(),anchor_side:gl(["top","bottom","left","right"]),text:Ve(),symbol_name:Ve().optional(),is_movable:Wo().optional(),subcircuit_id:Ve().optional()}),tBe=ti({type:Kn("schematic_error"),schematic_error_id:Ve(),error_type:Kn("schematic_port_not_found").default("schematic_port_not_found"),message:Ve(),subcircuit_id:Ve().optional()}).describe("Defines a schematic error on the schematic"),nBe=ti({type:Kn("schematic_layout_error"),schematic_layout_error_id:xh("schematic_layout_error"),error_type:Kn("schematic_layout_error").default("schematic_layout_error"),message:Ve(),source_group_id:Ve(),schematic_group_id:Ve(),subcircuit_id:Ve().optional()}).describe("Error emitted when schematic layout fails for a group"),nL=ti({type:Kn("schematic_debug_object"),label:Ve().optional(),subcircuit_id:Ve().optional()}),iBe=nL.extend({shape:Kn("rect"),center:zm,size:aW}),rBe=nL.extend({shape:Kn("line"),start:zm,end:zm}),oBe=nL.extend({shape:Kn("point"),center:zm}),aBe=g3("shape",[iBe,rBe,oBe]),sBe=ti({type:Kn("schematic_voltage_probe"),schematic_voltage_probe_id:Ve(),position:zm,schematic_trace_id:Ve(),voltage:e4.optional(),subcircuit_id:Ve().optional()}).describe("Defines a voltage probe measurement point on a schematic trace"),EW=ti({type:Kn("schematic_manual_edit_conflict_warning"),schematic_manual_edit_conflict_warning_id:xh("schematic_manual_edit_conflict_warning"),warning_type:Kn("schematic_manual_edit_conflict_warning").default("schematic_manual_edit_conflict_warning"),message:Ve(),schematic_component_id:Ve(),schematic_group_id:Ve().optional(),subcircuit_id:Ve().optional(),source_component_id:Ve()}).describe("Warning emitted when a component has both manual placement and explicit schX/schY coordinates"),lBe=ti({type:Kn("schematic_group"),schematic_group_id:xh("schematic_group"),source_group_id:Ve(),is_subcircuit:Wo().optional(),subcircuit_id:Ve().optional(),width:yn,height:yn,center:zm,schematic_component_ids:Ko(Ve()),name:Ve().optional(),description:Ve().optional()}).describe("Defines a group of components on the schematic"),cBe=ti({type:Kn("schematic_table"),schematic_table_id:xh("schematic_table"),anchor_position:zm,column_widths:Ko(cr),row_heights:Ko(cr),cell_padding:cr.optional(),border_width:cr.optional(),subcircuit_id:Ve().optional(),schematic_component_id:Ve().optional(),anchor:$U.optional()}).describe("Defines a table on the schematic"),uBe=ti({type:Kn("schematic_table_cell"),schematic_table_cell_id:xh("schematic_table_cell"),schematic_table_id:Ve(),start_row_index:Ki(),end_row_index:Ki(),start_column_index:Ki(),end_column_index:Ki(),text:Ve().optional(),center:zm,width:cr,height:cr,horizontal_align:gl(["left","center","right"]).optional(),vertical_align:gl(["top","middle","bottom"]).optional(),font_size:cr.optional(),subcircuit_id:Ve().optional()}).describe("Defines a cell within a schematic_table"),I8=["top","bottom","inner1","inner2","inner3","inner4","inner5","inner6"],bW=gl(I8),oy=bW.or(ti({name:bW})).transform(i=>typeof i=="string"?i:i.name),MM=gl(["top","bottom"]),ABe=ti({x:cr,y:cr,via:Wo().optional(),via_to_layer:oy.optional()}),Lmt=Ko(ABe),VS=ti({x:cr,y:cr,via:Wo().optional(),to_layer:oy.optional(),trace_width:cr.optional()}),dBe=ti({type:Kn("pcb_component"),pcb_component_id:xh("pcb_component"),source_component_id:Ve(),center:zm,layer:oy,rotation:Zx,width:yn,height:yn,subcircuit_id:Ve().optional(),pcb_group_id:Ve().optional()}).describe("Defines a component on the PCB"),fBe=ti({type:Kn("pcb_hole"),pcb_hole_id:xh("pcb_hole"),pcb_group_id:Ve().optional(),subcircuit_id:Ve().optional(),hole_shape:gl(["circle","square"]),hole_diameter:Ki(),x:cr,y:cr}),Fmt=fBe.describe("Defines a circular or square hole on the PCB"),hBe=ti({type:Kn("pcb_hole"),pcb_hole_id:xh("pcb_hole"),pcb_group_id:Ve().optional(),subcircuit_id:Ve().optional(),hole_shape:Kn("oval"),hole_width:Ki(),hole_height:Ki(),x:cr,y:cr}),Gmt=hBe.describe("Defines an oval hole on the PCB"),pBe=fBe.or(hBe),Omt=ti({type:Kn("pcb_plated_hole"),shape:Kn("circle"),pcb_group_id:Ve().optional(),subcircuit_id:Ve().optional(),outer_diameter:Ki(),hole_diameter:Ki(),x:cr,y:cr,layers:Ko(oy),port_hints:Ko(Ve()).optional(),pcb_component_id:Ve().optional(),pcb_port_id:Ve().optional(),pcb_plated_hole_id:xh("pcb_plated_hole")}),zmt=ti({type:Kn("pcb_plated_hole"),shape:gl(["oval","pill"]),pcb_group_id:Ve().optional(),subcircuit_id:Ve().optional(),outer_width:Ki(),outer_height:Ki(),hole_width:Ki(),hole_height:Ki(),x:cr,y:cr,layers:Ko(oy),port_hints:Ko(Ve()).optional(),pcb_component_id:Ve().optional(),pcb_port_id:Ve().optional(),pcb_plated_hole_id:xh("pcb_plated_hole")}),Hmt=ti({type:Kn("pcb_plated_hole"),shape:Kn("circular_hole_with_rect_pad"),pcb_group_id:Ve().optional(),subcircuit_id:Ve().optional(),hole_shape:Kn("circle"),pad_shape:Kn("rect"),hole_diameter:Ki(),rect_pad_width:Ki(),rect_pad_height:Ki(),x:cr,y:cr,layers:Ko(oy),port_hints:Ko(Ve()).optional(),pcb_component_id:Ve().optional(),pcb_port_id:Ve().optional(),pcb_plated_hole_id:xh("pcb_plated_hole")}),Ymt=ti({type:Kn("pcb_plated_hole"),shape:Kn("pill_hole_with_rect_pad"),pcb_group_id:Ve().optional(),subcircuit_id:Ve().optional(),hole_shape:Kn("pill"),pad_shape:Kn("rect"),hole_width:Ki(),hole_height:Ki(),rect_pad_width:Ki(),rect_pad_height:Ki(),x:cr,y:cr,layers:Ko(oy),port_hints:Ko(Ve()).optional(),pcb_component_id:Ve().optional(),pcb_port_id:Ve().optional(),pcb_plated_hole_id:xh("pcb_plated_hole")}),Vmt=ti({type:Kn("pcb_plated_hole"),shape:Kn("rotated_pill_hole_with_rect_pad"),pcb_group_id:Ve().optional(),subcircuit_id:Ve().optional(),hole_shape:Kn("rotated_pill"),pad_shape:Kn("rect"),hole_width:Ki(),hole_height:Ki(),hole_ccw_rotation:Zx,rect_pad_width:Ki(),rect_pad_height:Ki(),rect_ccw_rotation:Zx,x:cr,y:cr,layers:Ko(oy),port_hints:Ko(Ve()).optional(),pcb_component_id:Ve().optional(),pcb_port_id:Ve().optional(),pcb_plated_hole_id:xh("pcb_plated_hole")}),gBe=zh([Omt,zmt,Hmt,Ymt,Vmt]),mBe=ti({type:Kn("pcb_port"),pcb_port_id:xh("pcb_port"),pcb_group_id:Ve().optional(),subcircuit_id:Ve().optional(),source_port_id:Ve(),pcb_component_id:Ve(),x:cr,y:cr,layers:Ko(oy)}).describe("Defines a port on the PCB"),Kmt=ti({type:Kn("pcb_smtpad"),shape:Kn("circle"),pcb_smtpad_id:xh("pcb_smtpad"),pcb_group_id:Ve().optional(),subcircuit_id:Ve().optional(),x:cr,y:cr,radius:Ki(),layer:oy,port_hints:Ko(Ve()).optional(),pcb_component_id:Ve().optional(),pcb_port_id:Ve().optional()}),jmt=ti({type:Kn("pcb_smtpad"),shape:Kn("rect"),pcb_smtpad_id:xh("pcb_smtpad"),pcb_group_id:Ve().optional(),subcircuit_id:Ve().optional(),x:cr,y:cr,width:Ki(),height:Ki(),layer:oy,port_hints:Ko(Ve()).optional(),pcb_component_id:Ve().optional(),pcb_port_id:Ve().optional()}),Jmt=ti({type:Kn("pcb_smtpad"),shape:Kn("rotated_rect"),pcb_smtpad_id:xh("pcb_smtpad"),pcb_group_id:Ve().optional(),subcircuit_id:Ve().optional(),x:cr,y:cr,width:Ki(),height:Ki(),ccw_rotation:Zx,layer:oy,port_hints:Ko(Ve()).optional(),pcb_component_id:Ve().optional(),pcb_port_id:Ve().optional()}),yBe=ti({type:Kn("pcb_smtpad"),shape:Kn("pill"),pcb_smtpad_id:xh("pcb_smtpad"),pcb_group_id:Ve().optional(),subcircuit_id:Ve().optional(),x:cr,y:cr,width:Ki(),height:Ki(),radius:Ki(),layer:oy,port_hints:Ko(Ve()).optional(),pcb_component_id:Ve().optional(),pcb_port_id:Ve().optional()}),qmt=ti({type:Kn("pcb_smtpad"),shape:Kn("rotated_pill"),pcb_smtpad_id:xh("pcb_smtpad"),pcb_group_id:Ve().optional(),subcircuit_id:Ve().optional(),x:cr,y:cr,width:Ki(),height:Ki(),radius:Ki(),ccw_rotation:Zx,layer:oy,port_hints:Ko(Ve()).optional(),pcb_component_id:Ve().optional(),pcb_port_id:Ve().optional()}),Zmt=ti({type:Kn("pcb_smtpad"),shape:Kn("polygon"),pcb_smtpad_id:xh("pcb_smtpad"),pcb_group_id:Ve().optional(),subcircuit_id:Ve().optional(),points:Ko(zm),layer:oy,port_hints:Ko(Ve()).optional(),pcb_component_id:Ve().optional(),pcb_port_id:Ve().optional()}),_Be=g3("shape",[Kmt,jmt,Jmt,qmt,yBe,Zmt]).describe("Defines an SMT pad on the PCB"),Xmt=ti({type:Kn("pcb_solder_paste"),shape:Kn("circle"),pcb_solder_paste_id:xh("pcb_solder_paste"),pcb_group_id:Ve().optional(),subcircuit_id:Ve().optional(),x:cr,y:cr,radius:Ki(),layer:oy,pcb_component_id:Ve().optional(),pcb_smtpad_id:Ve().optional()}),Wmt=ti({type:Kn("pcb_solder_paste"),shape:Kn("rect"),pcb_solder_paste_id:xh("pcb_solder_paste"),pcb_group_id:Ve().optional(),subcircuit_id:Ve().optional(),x:cr,y:cr,width:Ki(),height:Ki(),layer:oy,pcb_component_id:Ve().optional(),pcb_smtpad_id:Ve().optional()}),$mt=ti({type:Kn("pcb_solder_paste"),shape:Kn("pill"),pcb_solder_paste_id:xh("pcb_solder_paste"),pcb_group_id:Ve().optional(),subcircuit_id:Ve().optional(),x:cr,y:cr,width:Ki(),height:Ki(),radius:Ki(),layer:oy,pcb_component_id:Ve().optional(),pcb_smtpad_id:Ve().optional()}),eyt=ti({type:Kn("pcb_solder_paste"),shape:Kn("rotated_rect"),pcb_solder_paste_id:xh("pcb_solder_paste"),pcb_group_id:Ve().optional(),subcircuit_id:Ve().optional(),x:cr,y:cr,width:Ki(),height:Ki(),ccw_rotation:cr,layer:oy,pcb_component_id:Ve().optional(),pcb_smtpad_id:Ve().optional()}),tyt=ti({type:Kn("pcb_solder_paste"),shape:Kn("oval"),pcb_solder_paste_id:xh("pcb_solder_paste"),pcb_group_id:Ve().optional(),subcircuit_id:Ve().optional(),x:cr,y:cr,width:Ki(),height:Ki(),layer:oy,pcb_component_id:Ve().optional(),pcb_smtpad_id:Ve().optional()}),vBe=zh([Xmt,Wmt,$mt,eyt,tyt]).describe("Defines solderpaste on the PCB"),IBe=ti({type:Kn("pcb_text"),pcb_text_id:xh("pcb_text"),pcb_group_id:Ve().optional(),subcircuit_id:Ve().optional(),text:Ve(),center:zm,layer:oy,width:yn,height:yn,lines:Ki(),align:gl(["bottom-left"])}).describe("Defines text on the PCB"),CBe=ti({route_type:Kn("wire"),x:cr,y:cr,width:cr,start_pcb_port_id:Ve().optional(),end_pcb_port_id:Ve().optional(),layer:oy}),xBe=ti({route_type:Kn("via"),x:cr,y:cr,hole_diameter:cr.optional(),outer_diameter:cr.optional(),from_layer:Ve(),to_layer:Ve()}),BW=zh([CBe,xBe]),EBe=ti({type:Kn("pcb_trace"),source_trace_id:Ve().optional(),pcb_component_id:Ve().optional(),pcb_trace_id:xh("pcb_trace"),pcb_group_id:Ve().optional(),subcircuit_id:Ve().optional(),route_thickness_mode:gl(["constant","interpolated"]).default("constant").optional(),route_order_index:Ki().optional(),should_round_corners:Wo().optional(),trace_length:Ki().optional(),route:Ko(BW)}).describe("Defines a trace on the PCB"),bBe=ti({type:Kn("pcb_trace_error"),pcb_trace_error_id:xh("pcb_trace_error"),error_type:Kn("pcb_trace_error").default("pcb_trace_error"),message:Ve(),center:zm.optional(),pcb_trace_id:Ve(),source_trace_id:Ve(),pcb_component_ids:Ko(Ve()),pcb_port_ids:Ko(Ve()),subcircuit_id:Ve().optional()}).describe("Defines a trace error on the PCB"),BBe=ti({type:Kn("pcb_port_not_matched_error"),pcb_error_id:xh("pcb_error"),error_type:Kn("pcb_port_not_matched_error").default("pcb_port_not_matched_error"),message:Ve(),pcb_component_ids:Ko(Ve()),subcircuit_id:Ve().optional()}).describe("Defines a trace error on the PCB where a port is not matched"),SBe=ti({type:Kn("pcb_via"),pcb_via_id:xh("pcb_via"),pcb_group_id:Ve().optional(),subcircuit_id:Ve().optional(),x:cr,y:cr,outer_diameter:cr.default("0.6mm"),hole_diameter:cr.default("0.25mm"),from_layer:oy.optional(),to_layer:oy.optional(),layers:Ko(oy),pcb_trace_id:Ve().optional()}).describe("Defines a via on the PCB"),wBe=ti({type:Kn("pcb_board"),pcb_board_id:xh("pcb_board"),is_subcircuit:Wo().optional(),subcircuit_id:Ve().optional(),width:yn,height:yn,center:zm,thickness:yn.optional().default(1.4),num_layers:Ki().optional().default(4),outline:Ko(zm).optional(),material:gl(["fr4","fr1"]).default("fr4")}).describe("Defines the board outline of the PCB"),QBe=ti({type:Kn("pcb_placement_error"),pcb_placement_error_id:xh("pcb_placement_error"),error_type:Kn("pcb_placement_error").default("pcb_placement_error"),message:Ve(),subcircuit_id:Ve().optional()}).describe("Defines a placement error on the PCB"),MBe=ti({type:Kn("pcb_trace_hint"),pcb_trace_hint_id:xh("pcb_trace_hint"),pcb_port_id:Ve(),pcb_component_id:Ve(),route:Ko(VS),subcircuit_id:Ve().optional()}).describe("A hint that can be used during generation of a PCB trace"),RBe=ti({type:Kn("pcb_silkscreen_line"),pcb_silkscreen_line_id:xh("pcb_silkscreen_line"),pcb_component_id:Ve(),pcb_group_id:Ve().optional(),subcircuit_id:Ve().optional(),stroke_width:cr.default("0.1mm"),x1:cr,y1:cr,x2:cr,y2:cr,layer:MM}).describe("Defines a silkscreen line on the PCB"),DBe=ti({type:Kn("pcb_silkscreen_path"),pcb_silkscreen_path_id:xh("pcb_silkscreen_path"),pcb_component_id:Ve(),pcb_group_id:Ve().optional(),subcircuit_id:Ve().optional(),layer:MM,route:Ko(zm),stroke_width:yn}).describe("Defines a silkscreen path on the PCB"),NBe=ti({type:Kn("pcb_silkscreen_text"),pcb_silkscreen_text_id:xh("pcb_silkscreen_text"),pcb_group_id:Ve().optional(),subcircuit_id:Ve().optional(),font:Kn("tscircuit2024").default("tscircuit2024"),font_size:cr.default("0.2mm"),pcb_component_id:Ve(),text:Ve(),ccw_rotation:Ki().optional(),layer:oy,is_mirrored:Wo().default(!1).optional(),anchor_position:zm.default({x:0,y:0}),anchor_alignment:$U.default("center")}).describe("Defines silkscreen text on the PCB"),TBe=ti({type:Kn("pcb_silkscreen_rect"),pcb_silkscreen_rect_id:xh("pcb_silkscreen_rect"),pcb_component_id:Ve(),pcb_group_id:Ve().optional(),subcircuit_id:Ve().optional(),center:zm,width:yn,height:yn,layer:oy,stroke_width:yn.default("1mm"),is_filled:Wo().default(!0).optional(),has_stroke:Wo().optional(),is_stroke_dashed:Wo().optional()}).describe("Defines a silkscreen rect on the PCB"),kBe=ti({type:Kn("pcb_silkscreen_circle"),pcb_silkscreen_circle_id:xh("pcb_silkscreen_circle"),pcb_component_id:Ve(),pcb_group_id:Ve().optional(),subcircuit_id:Ve().optional(),center:zm,radius:yn,layer:MM,stroke_width:yn.default("1mm")}).describe("Defines a silkscreen circle on the PCB"),PBe=ti({type:Kn("pcb_silkscreen_oval"),pcb_silkscreen_oval_id:xh("pcb_silkscreen_oval"),pcb_component_id:Ve(),pcb_group_id:Ve().optional(),subcircuit_id:Ve().optional(),center:zm,radius_x:cr,radius_y:cr,layer:MM}).describe("Defines a silkscreen oval on the PCB"),UBe=ti({type:Kn("pcb_fabrication_note_text"),pcb_fabrication_note_text_id:xh("pcb_fabrication_note_text"),subcircuit_id:Ve().optional(),pcb_group_id:Ve().optional(),font:Kn("tscircuit2024").default("tscircuit2024"),font_size:cr.default("1mm"),pcb_component_id:Ve(),text:Ve(),layer:MM,anchor_position:zm.default({x:0,y:0}),anchor_alignment:gl(["center","top_left","top_right","bottom_left","bottom_right"]).default("center"),color:Ve().optional()}).describe("Defines a fabrication note in text on the PCB, useful for leaving notes for assemblers or fabricators"),LBe=ti({type:Kn("pcb_fabrication_note_path"),pcb_fabrication_note_path_id:xh("pcb_fabrication_note_path"),pcb_component_id:Ve(),subcircuit_id:Ve().optional(),layer:oy,route:Ko(zm),stroke_width:yn,color:Ve().optional()}).describe("Defines a fabrication path on the PCB for fabricators or assemblers"),FBe=ti({type:Kn("pcb_footprint_overlap_error"),pcb_error_id:xh("pcb_error"),error_type:Kn("pcb_footprint_overlap_error").default("pcb_footprint_overlap_error"),message:Ve(),pcb_smtpad_ids:Ko(Ve()).optional(),pcb_plated_hole_ids:Ko(Ve()).optional(),pcb_hole_ids:Ko(Ve()).optional(),pcb_keepout_ids:Ko(Ve()).optional()}).describe("Error emitted when a pcb footprint overlaps with another element"),GBe=ti({type:Kn("pcb_keepout"),shape:Kn("rect"),pcb_group_id:Ve().optional(),subcircuit_id:Ve().optional(),center:zm,width:cr,height:cr,pcb_keepout_id:Ve(),layers:Ko(Ve()),description:Ve().optional()}).or(ti({type:Kn("pcb_keepout"),shape:Kn("circle"),pcb_group_id:Ve().optional(),subcircuit_id:Ve().optional(),center:zm,radius:cr,pcb_keepout_id:Ve(),layers:Ko(Ve()),description:Ve().optional()})),SW=ti({type:Kn("pcb_cutout"),pcb_cutout_id:xh("pcb_cutout"),pcb_group_id:Ve().optional(),subcircuit_id:Ve().optional()}),OBe=SW.extend({shape:Kn("rect"),center:zm,width:yn,height:yn,rotation:Zx.optional()}),zBe=SW.extend({shape:Kn("circle"),center:zm,radius:yn}),HBe=SW.extend({shape:Kn("polygon"),points:Ko(zm)}),YBe=g3("shape",[OBe,zBe,HBe]).describe("Defines a cutout on the PCB, removing board material."),VBe=ti({type:Kn("pcb_missing_footprint_error"),pcb_missing_footprint_error_id:xh("pcb_missing_footprint_error"),pcb_group_id:Ve().optional(),subcircuit_id:Ve().optional(),error_type:Kn("pcb_missing_footprint_error").default("pcb_missing_footprint_error"),source_component_id:Ve(),message:Ve()}).describe("Defines a missing footprint error on the PCB"),KBe=ti({type:Kn("pcb_group"),pcb_group_id:xh("pcb_group"),source_group_id:Ve(),is_subcircuit:Wo().optional(),subcircuit_id:Ve().optional(),width:yn,height:yn,center:zm,pcb_component_ids:Ko(Ve()),name:Ve().optional(),description:Ve().optional(),autorouter_configuration:ti({trace_clearance:yn}).optional(),autorouter_used_string:Ve().optional()}).describe("Defines a group of components on the PCB"),jBe=ti({type:Kn("pcb_autorouting_error"),pcb_error_id:xh("pcb_autorouting_error"),error_type:Kn("pcb_autorouting_error").default("pcb_autorouting_error"),message:Ve(),subcircuit_id:Ve().optional()}).describe("The autorouting has failed to route a portion of the board"),wW=ti({type:Kn("pcb_manual_edit_conflict_warning"),pcb_manual_edit_conflict_warning_id:xh("pcb_manual_edit_conflict_warning"),warning_type:Kn("pcb_manual_edit_conflict_warning").default("pcb_manual_edit_conflict_warning"),message:Ve(),pcb_component_id:Ve(),pcb_group_id:Ve().optional(),subcircuit_id:Ve().optional(),source_component_id:Ve()}).describe("Warning emitted when a component has both manual placement and explicit pcbX/pcbY coordinates"),JBe=ti({type:Kn("pcb_breakout_point"),pcb_breakout_point_id:xh("pcb_breakout_point"),pcb_group_id:Ve(),subcircuit_id:Ve().optional(),source_trace_id:Ve().optional(),source_port_id:Ve().optional(),source_net_id:Ve().optional(),x:cr,y:cr}).describe("Defines a routing target within a pcb_group for a source_trace or source_net"),qBe=ti({type:Kn("pcb_ground_plane"),pcb_ground_plane_id:xh("pcb_ground_plane"),source_pcb_ground_plane_id:Ve(),source_net_id:Ve(),pcb_group_id:Ve().optional(),subcircuit_id:Ve().optional()}).describe("Defines a ground plane on the PCB"),ZBe=ti({type:Kn("pcb_ground_plane_region"),pcb_ground_plane_region_id:xh("pcb_ground_plane_region"),pcb_ground_plane_id:Ve(),pcb_group_id:Ve().optional(),subcircuit_id:Ve().optional(),layer:oy,points:Ko(zm)}).describe("Defines a polygon region of a ground plane"),XBe=ti({type:Kn("pcb_thermal_spoke"),pcb_thermal_spoke_id:xh("pcb_thermal_spoke"),pcb_ground_plane_id:Ve(),shape:Ve(),spoke_count:Ki(),spoke_thickness:cr,spoke_inner_diameter:cr,spoke_outer_diameter:cr,pcb_plated_hole_id:Ve().optional(),subcircuit_id:Ve().optional()}).describe("Pattern for connecting a ground plane to a plated hole"),WBe=ti({type:Kn("cad_component"),cad_component_id:Ve(),pcb_component_id:Ve(),source_component_id:Ve(),position:QM,rotation:QM.optional(),size:QM.optional(),layer:oy.optional(),subcircuit_id:Ve().optional(),footprinter_string:Ve().optional(),model_obj_url:Ve().optional(),model_stl_url:Ve().optional(),model_3mf_url:Ve().optional(),model_jscad:vE().optional()}).describe("Defines a component on the PCB"),$Be=ti({type:Kn("simulation_voltage_source"),simulation_voltage_source_id:xh("simulation_voltage_source"),positive_source_port_id:Ve(),negative_source_port_id:Ve(),voltage:e4}).describe("Defines a voltage source for simulation"),eSe=zh([F2e,L2e,U2e,O2e,G2e,uW,sW,tL,cW,lW,AW,dW,fW,gW,mW,IW,yW,_W,vW,pW,hW,z2e,CW,xW,dBe,pBe,VBe,wW,gBe,GBe,mBe,IBe,EBe,SBe,_Be,vBe,wBe,KBe,MBe,RBe,DBe,NBe,TBe,kBe,PBe,bBe,QBe,BBe,LBe,UBe,jBe,FBe,JBe,YBe,qBe,ZBe,XBe,H2e,W2e,Z2e,q2e,$2e,X2e,Y2e,tBe,nBe,eBe,aBe,sBe,EW,lBe,cBe,uBe,WBe,$Be]),iL=eSe;const QW=Object.freeze(Object.defineProperty({__proto__:null,all_layers:I8,any_circuit_element:eSe,any_soup_element:iL,any_source_component:U2e,battery_capacity:D2e,cad_component:WBe,capacitance:wM,current:Dmt,distance:cr,frequency:WU,getZodPrefixedIdWithDefault:xh,inductance:oW,layer_ref:oy,layer_string:bW,length:yn,ninePointAnchor:$U,pcb_autorouting_error:jBe,pcb_board:wBe,pcb_breakout_point:JBe,pcb_component:dBe,pcb_cutout:YBe,pcb_cutout_circle:zBe,pcb_cutout_polygon:HBe,pcb_cutout_rect:OBe,pcb_fabrication_note_path:LBe,pcb_fabrication_note_text:UBe,pcb_footprint_overlap_error:FBe,pcb_ground_plane:qBe,pcb_ground_plane_region:ZBe,pcb_group:KBe,pcb_hole:pBe,pcb_hole_circle_or_square_shape:Fmt,pcb_hole_oval_shape:Gmt,pcb_keepout:GBe,pcb_manual_edit_conflict_warning:wW,pcb_missing_footprint_error:VBe,pcb_placement_error:QBe,pcb_plated_hole:gBe,pcb_port:mBe,pcb_port_not_matched_error:BBe,pcb_route_hint:ABe,pcb_route_hints:Lmt,pcb_silkscreen_circle:kBe,pcb_silkscreen_line:RBe,pcb_silkscreen_oval:PBe,pcb_silkscreen_path:DBe,pcb_silkscreen_rect:TBe,pcb_silkscreen_text:NBe,pcb_smtpad:_Be,pcb_smtpad_pill:yBe,pcb_solder_paste:vBe,pcb_text:IBe,pcb_thermal_spoke:XBe,pcb_trace:EBe,pcb_trace_error:bBe,pcb_trace_hint:MBe,pcb_trace_route_point:BW,pcb_trace_route_point_via:xBe,pcb_trace_route_point_wire:CBe,pcb_via:SBe,point:zm,point3:QM,port_arrangement:J2e,position:Tmt,position3:kmt,resistance:SM,rotation:Zx,route_hint_point:VS,schematic_box:H2e,schematic_component:q2e,schematic_component_port_arrangement_by_sides:j2e,schematic_component_port_arrangement_by_size:K2e,schematic_debug_line:rBe,schematic_debug_object:aBe,schematic_debug_object_base:nL,schematic_debug_point:oBe,schematic_debug_rect:iBe,schematic_error:tBe,schematic_group:lBe,schematic_layout_error:nBe,schematic_line:Z2e,schematic_manual_edit_conflict_warning:EW,schematic_net_label:eBe,schematic_path:Y2e,schematic_pin_styles:V2e,schematic_port:$2e,schematic_table:cBe,schematic_table_cell:uBe,schematic_text:W2e,schematic_trace:X2e,schematic_voltage_probe:sBe,simulation_voltage_source:$Be,size:aW,source_component_base:_9,source_failed_to_create_component_error:P2e,source_group:G2e,source_missing_property_error:k2e,source_net:O2e,source_pcb_ground_plane:z2e,source_port:L2e,source_project_metadata:CW,source_simple_battery:dW,source_simple_capacitor:sW,source_simple_chip:uW,source_simple_crystal:T2e,source_simple_diode:tL,source_simple_ground:N2e,source_simple_inductor:fW,source_simple_led:cW,source_simple_mosfet:vW,source_simple_pin_header:gW,source_simple_potentiometer:pW,source_simple_power_source:AW,source_simple_push_button:hW,source_simple_resistor:lW,source_simple_resonator:mW,source_simple_switch:IW,source_simple_test_point:_W,source_simple_transistor:yW,source_trace:F2e,source_trace_not_connected:xW,supplier_name:eL,time:Nmt,visible_layer:MM,voltage:e4},Symbol.toStringTag,{value:"Module"}));function Ar(i,e){return Array.isArray(e)?[i.a*e[0]+i.c*e[1]+i.e,i.b*e[0]+i.d*e[1]+i.f]:{x:i.a*e.x+i.c*e.y+i.e,y:i.b*e.x+i.d*e.y+i.f}}function nyt(i,e){return e.map(t=>Ar(i,t))}function tSe(i){return{a:parseFloat(i.a),b:parseFloat(i.b),c:parseFloat(i.c),d:parseFloat(i.d),e:parseFloat(i.e),f:parseFloat(i.f)}}const iyt=/^matrix\(\s*([0-9_+-.e]+)\s*,\s*([0-9_+-.e]+)\s*,\s*([0-9_+-.e]+)\s*,\s*([0-9_+-.e]+)\s*,\s*([0-9_+-.e]+)\s*,\s*([0-9_+-.e]+)\s*\)$/i;function MW(i){const e=i.match(iyt);if(e===null||e.length<7)throw new Error(`'${i}' is not a matrix`);return{a:parseFloat(e[1]),b:parseFloat(e[2]),c:parseFloat(e[3]),d:parseFloat(e[4]),e:parseFloat(e[5]),f:parseFloat(e[6])}}function x_(){return{a:1,c:0,e:0,b:0,d:1,f:0}}function U2(i){const{a:e,b:t,c:n,d:r,e:o,f:a}=i,s=e*r-t*n;return{a:r/s,b:t/-s,c:n/-s,d:e/s,e:(r*o-n*a)/-s,f:(t*o-e*a)/s}}function C8(i){return typeof i>"u"}function RM(i){return typeof i=="number"&&!Number.isNaN(i)&&Number.isFinite(i)}function ryt(i){return typeof i=="object"&&i!==null&&!Array.isArray(i)}function oyt(i){return ryt(i)&&"a"in i&&RM(i.a)&&"b"in i&&RM(i.b)&&"c"in i&&RM(i.c)&&"d"in i&&RM(i.d)&&"e"in i&&RM(i.e)&&"f"in i&&RM(i.f)}function Hh(i,e=0){return{a:1,c:0,e:i,b:0,d:1,f:e}}function TB(...i){i=Array.isArray(i[0])?i[0]:i;const e=(t,n)=>({a:t.a*n.a+t.c*n.b,c:t.a*n.c+t.c*n.d,e:t.a*n.e+t.c*n.f+t.e,b:t.b*n.a+t.d*n.b,d:t.b*n.c+t.d*n.d,f:t.b*n.e+t.d*n.f+t.f});switch(i.length){case 0:throw new Error("no matrices provided");case 1:return i[0];case 2:return e(i[0],i[1]);default:{const[t,n,...r]=i,o=e(t,n);return TB(o,...r)}}}function of(...i){return TB(...i)}const{cos:ayt,sin:syt,PI:lyt}=Math;function IE(i,e,t){const n=ayt(i),r=syt(i),o={a:n,c:-r,e:0,b:r,d:n,f:0};return C8(e)||C8(t)?o:TB([Hh(e,t),o,Hh(-e,-t)])}function RW(i,e=void 0,t=void 0){return IE(i*lyt/180,e,t)}function v9(i,e=void 0,t=void 0,n=void 0){C8(e)&&(e=i);const r={a:i,c:0,e:0,b:0,d:e,f:0};return C8(t)||C8(n)?r:TB([Hh(t,n),r,Hh(-t,-n)])}function nSe(i,e){return{a:1,c:i,e:0,b:e,d:1,f:0}}const{tan:iSe}=Math;function rSe(i,e){return{a:1,c:iSe(i),e:0,b:iSe(e),d:1,f:0}}function DW(i,e){return rSe(i*Math.PI/180,e*Math.PI/180)}function cyt(i){return m3(i)}function oSe(i){return m3(i)}function m3(i){return`matrix(${i.a},${i.b},${i.c},${i.d},${i.e},${i.f})`}function aSe(i,e=1e10){return{a:Math.round(i.a*e)/e,b:Math.round(i.b*e)/e,c:Math.round(i.c*e)/e,d:Math.round(i.d*e)/e,e:Math.round(i.e*e)/e,f:Math.round(i.f*e)/e}}function sSe(i,e){const t=i[0].x!=null?i[0].x:i[0][0],n=i[0].y!=null?i[0].y:i[0][1],r=e[0].x!=null?e[0].x:e[0][0],o=e[0].y!=null?e[0].y:e[0][1],a=i[1].x!=null?i[1].x:i[1][0],s=i[1].y!=null?i[1].y:i[1][1],l=e[1].x!=null?e[1].x:e[1][0],c=e[1].y!=null?e[1].y:e[1][1],u=i[2].x!=null?i[2].x:i[2][0],A=i[2].y!=null?i[2].y:i[2][1],d=e[2].x!=null?e[2].x:e[2][0],f=e[2].y!=null?e[2].y:e[2][1],h={a:t-u,b:n-A,c:a-u,d:s-A,e:u,f:A},y={a:r-d,b:o-f,c:l-d,d:c-f,e:d,f},_=U2(h),v=TB([y,_]);return aSe(v)}function uyt(i){return Array.isArray(i)?i.map(e):e(i);function e(t){switch(t.type){case"matrix":if("a"in t&&"b"in t&&"c"in t&&"d"in t&&"e"in t&&"f"in t)return tSe(t);throw new Error("MISSING_MANDATORY_PARAM");case"translate":if(!("tx"in t))throw new Error("MISSING_MANDATORY_PARAM");return"ty"in t?Hh(t.tx,t.ty):Hh(t.tx);case"scale":if(!("sx"in t))throw new Error("MISSING_MANDATORY_PARAM");return"sy"in t?v9(t.sx,t.sy):v9(t.sx);case"rotate":if(!("angle"in t))throw new Error("MISSING_MANDATORY_PARAM");return"cx"in t&&"cy"in t?RW(t.angle,t.cx,t.cy):RW(t.angle);case"skewX":if(!("angle"in t))throw new Error("MISSING_MANDATORY_PARAM");return DW(t.angle,0);case"skewY":if(!("angle"in t))throw new Error("MISSING_MANDATORY_PARAM");return DW(0,t.angle);case"shear":if(!("shx"in t&&"shy"in t))throw new Error("MISSING_MANDATORY_PARAM");return nSe(t.shx,t.shy);default:throw new Error("UNSUPPORTED_DESCRIPTOR")}}}function Ayt(i,e){function t(){this.constructor=i}t.prototype=e.prototype,i.prototype=new t}function DM(i,e,t,n){var r=Error.call(this,i);return Object.setPrototypeOf&&Object.setPrototypeOf(r,DM.prototype),r.expected=e,r.found=t,r.location=n,r.name="SyntaxError",r}Ayt(DM,Error);function NW(i,e,t){return t=t||" ",i.length>e?i:(e-=i.length,t+=t.repeat(e),i+t.slice(0,e))}DM.prototype.format=function(i){var e="Error: "+this.message;if(this.location){var t=null,n;for(n=0;n<i.length;n++)if(i[n].source===this.location.source){t=i[n].text.split(/\r\n|\n|\r/g);break}var r=this.location.start,o=this.location.source&&typeof this.location.source.offset=="function"?this.location.source.offset(r):r,a=this.location.source+":"+o.line+":"+o.column;if(t){var s=this.location.end,l=NW("",o.line.toString().length," "),c=t[r.line-1],u=r.line===s.line?s.column:c.length+1,A=u-r.column||1;e+=`
244
+ `)).length,r=0;r<n;r++){var a=i.charCodeAt(r),s=null;a<128?t++:s=a>127&&a<2048?String.fromCharCode(a>>6|192,63&a|128):String.fromCharCode(a>>12|224,a>>6&63|128,63&a|128),o3(s)||(t>e&&(o+=i.substring(e,t)),o+=s,e=t=r+1)}return t>e&&(o+=i.substring(e,i.length)),o},qpt=!!PZ||!!kZ,ube="text/plain",TU=(i,e)=>{var[t,n]=i.split("?"),r=PA({},e);n==null||n.split("&").forEach(a=>{var[s]=a.split("=");delete r[s]});var o=U0t(r);return t+"?"+(o=o?(n?n+"&":"")+o:n)},r8=(i,e)=>JSON.stringify(i,(t,n)=>typeof n=="bigint"?n.toString():n,e),EX=i=>{var{data:e,compression:t}=i;if(e){if(t===US.GZipJS){var n=XEe(WEe(r8(e)),{mtime:0}),r=new Blob([n],{type:ube});return{contentType:ube,body:r,estimatedSize:r.size}}if(t===US.Base64){var o=function(l){var c,u,A,d,f,h="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",y=0,_=0,v="",E=[];if(!l)return l;l=Jpt(l);do c=(f=l.charCodeAt(y++)<<16|l.charCodeAt(y++)<<8|l.charCodeAt(y++))>>18&63,u=f>>12&63,A=f>>6&63,d=63&f,E[_++]=h.charAt(c)+h.charAt(u)+h.charAt(A)+h.charAt(d);while(y<l.length);switch(v=E.join(""),l.length%3){case 1:v=v.slice(0,-2)+"==";break;case 2:v=v.slice(0,-1)+"="}return v}(r8(e)),a=(l=>"data="+encodeURIComponent(typeof l=="string"?l:r8(l)))(o);return{contentType:"application/x-www-form-urlencoded",body:a,estimatedSize:new Blob([a]).size}}var s=r8(e);return{contentType:"application/json",body:s,estimatedSize:new Blob([s]).size}}},o8=[];kZ&&o8.push({transport:"fetch",method:i=>{var e,t,{contentType:n,body:r,estimatedSize:o}=(e=EX(i))!==null&&e!==void 0?e:{},a=new Headers;nv(i.headers,function(u,A){a.append(A,u)}),n&&a.append("Content-Type",n);var s=i.url,l=null;if(Hxe){var c=new Hxe;l={signal:c.signal,timeout:setTimeout(()=>c.abort(),i.timeout)}}kZ(s,PA({method:(i==null?void 0:i.method)||"GET",headers:a,keepalive:i.method==="POST"&&(o||0)<52428.8,body:r,signal:(t=l)==null?void 0:t.signal},i.fetchOptions)).then(u=>u.text().then(A=>{var d={statusCode:u.status,text:A};if(u.status===200)try{d.json=JSON.parse(A)}catch(f){Qd.error(f)}i.callback==null||i.callback(d)})).catch(u=>{Qd.error(u),i.callback==null||i.callback({statusCode:0,text:u})}).finally(()=>l?clearTimeout(l.timeout):null)}}),PZ&&o8.push({transport:"XHR",method:i=>{var e,t=new PZ;t.open(i.method||"GET",i.url,!0);var{contentType:n,body:r}=(e=EX(i))!==null&&e!==void 0?e:{};nv(i.headers,function(o,a){t.setRequestHeader(a,o)}),n&&t.setRequestHeader("Content-Type",n),i.timeout&&(t.timeout=i.timeout),t.withCredentials=!0,t.onreadystatechange=()=>{if(t.readyState===4){var o={statusCode:t.status,text:t.responseText};if(t.status===200)try{o.json=JSON.parse(t.responseText)}catch{}i.callback==null||i.callback(o)}},t.send(r)}}),wb!=null&&wb.sendBeacon&&o8.push({transport:"sendBeacon",method:i=>{var e=TU(i.url,{beacon:"1"});try{var t,{contentType:n,body:r}=(t=EX(i))!==null&&t!==void 0?t:{},o=typeof r=="string"?new Blob([r],{type:n}):r;wb.sendBeacon(e,o)}catch{}}});var gM=function(i,e){if(!function(t){try{new RegExp(t)}catch{return!1}return!0}(e))return!1;try{return new RegExp(e).test(i)}catch{return!1}};function Abe(i,e,t){return r8({distinct_id:i,userPropertiesToSet:e,userPropertiesToSetOnce:t})}var Zpt={exact:(i,e)=>e.some(t=>i.some(n=>t===n)),is_not:(i,e)=>e.every(t=>i.every(n=>t!==n)),regex:(i,e)=>e.some(t=>i.some(n=>gM(t,n))),not_regex:(i,e)=>e.every(t=>i.every(n=>!gM(t,n))),icontains:(i,e)=>e.map(kU).some(t=>i.map(kU).some(n=>t.includes(n))),not_icontains:(i,e)=>e.map(kU).every(t=>i.map(kU).every(n=>!t.includes(n)))},kU=i=>i.toLowerCase(),Xpt=tx("[Error tracking]");class Wpt{constructor(e){var t,n;this.fe=[],this._instance=e,this.fe=(t=(n=this._instance.persistence)==null?void 0:n.get_property(zZ))!==null&&t!==void 0?t:[]}onRemoteConfig(e){var t,n,r=(t=(n=e.errorTracking)==null?void 0:n.suppressionRules)!==null&&t!==void 0?t:[];this.fe=r,this._instance.persistence&&this._instance.persistence.register({[zZ]:this.fe})}sendExceptionEvent(e){if(!this.pe(e))return this._instance.capture("$exception",e,{_noTruncate:!0,_batchKey:"exceptionEvent"});Xpt.info("Skipping exception capture because a suppression rule matched")}pe(e){var t=e.$exception_list;if(!t||!wI(t)||t.length===0)return!1;var n=t.reduce((r,o)=>{var{type:a,value:s}=o;return AC(a)&&a.length>0&&r.$exception_types.push(a),AC(s)&&s.length>0&&r.$exception_values.push(s),r},{$exception_types:[],$exception_values:[]});return this.fe.some(r=>{var o=r.values.map(a=>{var s,l=Zpt[a.operator],c=wI(a.value)?a.value:[a.value],u=(s=n[a.key])!==null&&s!==void 0?s:[];return c.length>0&&l(c,u)});return r.type==="OR"?o.some(Boolean):o.every(Boolean)})}}var r2="Mobile",PU="iOS",wB="Android",a8="Tablet",dbe=wB+" "+a8,fbe="iPad",hbe="Apple",pbe=hbe+" Watch",s8="Safari",mM="BlackBerry",gbe="Samsung",mbe=gbe+"Browser",ybe=gbe+" Internet",jw="Chrome",$pt=jw+" OS",_be=jw+" "+PU,bX="Internet Explorer",vbe=bX+" "+r2,BX="Opera",egt=BX+" Mini",SX="Edge",Ibe="Microsoft "+SX,yM="Firefox",Cbe=yM+" "+PU,l8="Nintendo",c8="PlayStation",_M="Xbox",xbe=wB+" "+r2,Ebe=r2+" "+s8,u8="Windows",wX=u8+" Phone",bbe="Nokia",QX="Ouya",Bbe="Generic",tgt=Bbe+" "+r2.toLowerCase(),Sbe=Bbe+" "+a8.toLowerCase(),MX="Konqueror",_E="(\\d+(\\.\\d+)?)",RX=new RegExp("Version/"+_E),ngt=new RegExp(_M,"i"),igt=new RegExp(c8+" \\w+","i"),rgt=new RegExp(l8+" \\w+","i"),DX=new RegExp(mM+"|PlayBook|BB10","i"),ogt={"NT3.51":"NT 3.11","NT4.0":"NT 4.0","5.0":"2000",5.1:"XP",5.2:"XP","6.0":"Vista",6.1:"7",6.2:"8",6.3:"8.1",6.4:"10","10.0":"10"},agt=(i,e)=>e&&iy(e,hbe)||function(t){return iy(t,s8)&&!iy(t,jw)&&!iy(t,wB)}(i),wbe=function(i,e){return e=e||"",iy(i," OPR/")&&iy(i,"Mini")?egt:iy(i," OPR/")?BX:DX.test(i)?mM:iy(i,"IE"+r2)||iy(i,"WPDesktop")?vbe:iy(i,mbe)?ybe:iy(i,SX)||iy(i,"Edg/")?Ibe:iy(i,"FBIOS")?"Facebook "+r2:iy(i,"UCWEB")||iy(i,"UCBrowser")?"UC Browser":iy(i,"CriOS")?_be:iy(i,"CrMo")||iy(i,jw)?jw:iy(i,wB)&&iy(i,s8)?xbe:iy(i,"FxiOS")?Cbe:iy(i.toLowerCase(),MX.toLowerCase())?MX:agt(i,e)?iy(i,r2)?Ebe:s8:iy(i,yM)?yM:iy(i,"MSIE")||iy(i,"Trident/")?bX:iy(i,"Gecko")?yM:""},sgt={[vbe]:[new RegExp("rv:"+_E)],[Ibe]:[new RegExp(SX+"?\\/"+_E)],[jw]:[new RegExp("("+jw+"|CrMo)\\/"+_E)],[_be]:[new RegExp("CriOS\\/"+_E)],"UC Browser":[new RegExp("(UCBrowser|UCWEB)\\/"+_E)],[s8]:[RX],[Ebe]:[RX],[BX]:[new RegExp("(Opera|OPR)\\/"+_E)],[yM]:[new RegExp(yM+"\\/"+_E)],[Cbe]:[new RegExp("FxiOS\\/"+_E)],[MX]:[new RegExp("Konqueror[:/]?"+_E,"i")],[mM]:[new RegExp(mM+" "+_E),RX],[xbe]:[new RegExp("android\\s"+_E,"i")],[ybe]:[new RegExp(mbe+"\\/"+_E)],[bX]:[new RegExp("(rv:|MSIE )"+_E)],Mozilla:[new RegExp("rv:"+_E)]},lgt=function(i,e){var t=wbe(i,e),n=sgt[t];if(Gu(n))return null;for(var r=0;r<n.length;r++){var o=n[r],a=i.match(o);if(a)return parseFloat(a[a.length-2])}return null},Qbe=[[new RegExp(_M+"; "+_M+" (.*?)[);]","i"),i=>[_M,i&&i[1]||""]],[new RegExp(l8,"i"),[l8,""]],[new RegExp(c8,"i"),[c8,""]],[DX,[mM,""]],[new RegExp(u8,"i"),(i,e)=>{if(/Phone/.test(e)||/WPDesktop/.test(e))return[wX,""];if(new RegExp(r2).test(e)&&!/IEMobile\b/.test(e))return[u8+" "+r2,""];var t=/Windows NT ([0-9.]+)/i.exec(e);if(t&&t[1]){var n=t[1],r=ogt[n]||"";return/arm/i.test(e)&&(r="RT"),[u8,r]}return[u8,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,i=>{if(i&&i[3]){var e=[i[3],i[4],i[5]||"0"];return[PU,e.join(".")]}return[PU,""]}],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,i=>{var e="";return i&&i.length>=3&&(e=Gu(i[2])?i[3]:i[2]),["watchOS",e]}],[new RegExp("("+wB+" (\\d+)\\.(\\d+)\\.?(\\d+)?|"+wB+")","i"),i=>{if(i&&i[2]){var e=[i[2],i[3],i[4]||"0"];return[wB,e.join(".")]}return[wB,""]}],[/Mac OS X (\d+)[_.](\d+)[_.]?(\d+)?/i,i=>{var e=["Mac OS X",""];if(i&&i[1]){var t=[i[1],i[2],i[3]||"0"];e[1]=t.join(".")}return e}],[/Mac/i,["Mac OS X",""]],[/CrOS/,[$pt,""]],[/Linux|debian/i,["Linux",""]]],Mbe=function(i){return rgt.test(i)?l8:igt.test(i)?c8:ngt.test(i)?_M:new RegExp(QX,"i").test(i)?QX:new RegExp("("+wX+"|WPDesktop)","i").test(i)?wX:/iPad/.test(i)?fbe:/iPod/.test(i)?"iPod Touch":/iPhone/.test(i)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(i)?pbe:DX.test(i)?mM:/(kobo)\s(ereader|touch)/i.test(i)?"Kobo":new RegExp(bbe,"i").test(i)?bbe:/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i.test(i)||/(kf[a-z]+)( bui|\)).+silk\//i.test(i)?"Kindle Fire":/(Android|ZTE)/i.test(i)?!new RegExp(r2).test(i)||/(9138B|TB782B|Nexus [97]|pixel c|HUAWEISHT|BTV|noble nook|smart ultra 6)/i.test(i)?/pixel[\daxl ]{1,6}/i.test(i)&&!/pixel c/i.test(i)||/(huaweimed-al00|tah-|APA|SM-G92|i980|zte|U304AA)/i.test(i)||/lmy47v/i.test(i)&&!/QTAQZ3/i.test(i)?wB:dbe:wB:new RegExp("(pda|"+r2+")","i").test(i)?tgt:new RegExp(a8,"i").test(i)&&!new RegExp(a8+" pc","i").test(i)?Sbe:""},UU="https?://(.*)",LU=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx"],cgt=lU(["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid"],LU),NX="<masked>",ugt=["li_fat_id"];function Rbe(i,e,t){if(!id)return{};var n,r=e?lU([],LU,t||[]):[],o=Dbe(tX(id.URL,r,NX),i),a=(n={},nv(ugt,function(s){var l=bB.D(s);n[s]=l||null}),n);return RC(a,o)}function Dbe(i,e){var t=cgt.concat(e||[]),n={};return nv(t,function(r){var o=vU(i,r);n[r]=o||null}),n}function Nbe(i){var e=function(o){return o?o.search(UU+"google.([^/?]*)")===0?"google":o.search(UU+"bing.com")===0?"bing":o.search(UU+"yahoo.com")===0?"yahoo":o.search(UU+"duckduckgo.com")===0?"duckduckgo":null:null}(i),t=e!="yahoo"?"q":"p",n={};if(!o3(e)){n.$search_engine=e;var r=id?vU(id.referrer,t):"";r.length&&(n.ph_keyword=r)}return n}function Tbe(){return navigator.language||navigator.userLanguage}function kbe(){return(id==null?void 0:id.referrer)||"$direct"}function Pbe(i,e){var t=i?lU([],LU,e||[]):[],n=VE==null?void 0:VE.href.substring(0,1e3);return{r:kbe().substring(0,1e3),u:n?tX(n,t,NX):void 0}}function Ube(i){var e,{r:t,u:n}=i,r={$referrer:t,$referring_domain:t==null?void 0:t=="$direct"?"$direct":(e=dM(t))==null?void 0:e.host};if(n){r.$current_url=n;var o=dM(n);r.$host=o==null?void 0:o.host,r.$pathname=o==null?void 0:o.pathname;var a=Dbe(n);RC(r,a)}if(t){var s=Nbe(t);RC(r,s)}return r}function Lbe(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch{return}}function Agt(){try{return new Date().getTimezoneOffset()}catch{return}}function dgt(i,e){if(!KE)return{};var t,n,r,o=i?lU([],LU,e||[]):[],[a,s]=function(l){for(var c=0;c<Qbe.length;c++){var[u,A]=Qbe[c],d=u.exec(l),f=d&&(n2(A)?A(d,l):A);if(f)return f}return["",""]}(KE);return RC(GZ({$os:a,$os_version:s,$browser:wbe(KE,navigator.vendor),$device:Mbe(KE),$device_type:(n=KE,r=Mbe(n),r===fbe||r===dbe||r==="Kobo"||r==="Kindle Fire"||r===Sbe?a8:r===l8||r===_M||r===c8||r===QX?"Console":r===pbe?"Wearable":r?r2:"Desktop"),$timezone:Lbe(),$timezone_offset:Agt()}),{$current_url:tX(VE==null?void 0:VE.href,o,NX),$host:VE==null?void 0:VE.host,$pathname:VE==null?void 0:VE.pathname,$raw_user_agent:KE.length>1e3?KE.substring(0,997)+"...":KE,$browser_version:lgt(KE,navigator.vendor),$browser_language:Tbe(),$browser_language_prefix:(t=Tbe(),typeof t=="string"?t.split("-")[0]:void 0),$screen_height:Aa==null?void 0:Aa.screen.height,$screen_width:Aa==null?void 0:Aa.screen.width,$viewport_height:Aa==null?void 0:Aa.innerHeight,$viewport_width:Aa==null?void 0:Aa.innerWidth,$lib:"web",$lib_version:PS.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3})}var QB=tx("[FeatureFlags]"),TX="$active_feature_flags",vM="$override_feature_flags",Fbe="$feature_flag_payloads",A8="$override_feature_flag_payloads",Gbe="$feature_flag_request_id",Obe=i=>{var e={};for(var[t,n]of cU(i||{}))n&&(e[t]=n);return e},fgt=i=>{var e=i.flags;return e?(i.featureFlags=Object.fromEntries(Object.keys(e).map(t=>{var n;return[t,(n=e[t].variant)!==null&&n!==void 0?n:e[t].enabled]})),i.featureFlagPayloads=Object.fromEntries(Object.keys(e).filter(t=>e[t].enabled).filter(t=>{var n;return(n=e[t].metadata)==null?void 0:n.payload}).map(t=>{var n;return[t,(n=e[t].metadata)==null?void 0:n.payload]}))):QB.warn("Using an older version of the feature flags endpoint. Please upgrade your PostHog server to the latest version"),i},hgt=function(i){return i.FeatureFlags="feature_flags",i.Recordings="recordings",i}({});class pgt{constructor(e){this.ge=!1,this._e=!1,this.me=!1,this.be=!1,this.ye=!1,this.we=!1,this.Se=!1,this._instance=e,this.featureFlagEventHandlers=[]}flags(){if(this._instance.config.__preview_remote_config)this.we=!0;else{var e=!this.$e&&(this._instance.config.advanced_disable_feature_flags||this._instance.config.advanced_disable_feature_flags_on_first_load);this.ke({disableFlags:e})}}get hasLoadedFlags(){return this._e}getFlags(){return Object.keys(this.getFlagVariants())}getFlagsWithDetails(){var e=this._instance.get_property(KZ),t=this._instance.get_property(vM),n=this._instance.get_property(A8);if(!n&&!t)return e||{};var r=RC({},e||{}),o=[...new Set([...Object.keys(n||{}),...Object.keys(t||{})])];for(var a of o){var s,l,c=r[a],u=t==null?void 0:t[a],A=Gu(u)?(s=c==null?void 0:c.enabled)!==null&&s!==void 0&&s:!!u,d=Gu(u)?c.variant:typeof u=="string"?u:void 0,f=n==null?void 0:n[a],h=PA({},c,{enabled:A,variant:A?d??(c==null?void 0:c.variant):void 0});A!==(c==null?void 0:c.enabled)&&(h.original_enabled=c==null?void 0:c.enabled),d!==(c==null?void 0:c.variant)&&(h.original_variant=c==null?void 0:c.variant),f&&(h.metadata=PA({},c==null?void 0:c.metadata,{payload:f,original_payload:c==null||(l=c.metadata)==null?void 0:l.payload})),r[a]=h}return this.ge||(QB.warn(" Overriding feature flag details!",{flagDetails:e,overriddenPayloads:n,finalDetails:r}),this.ge=!0),r}getFlagVariants(){var e=this._instance.get_property(uM),t=this._instance.get_property(vM);if(!t)return e||{};for(var n=RC({},e),r=Object.keys(t),o=0;o<r.length;o++)n[r[o]]=t[r[o]];return this.ge||(QB.warn(" Overriding feature flags!",{enabledFlags:e,overriddenFlags:t,finalFlags:n}),this.ge=!0),n}getFlagPayloads(){var e=this._instance.get_property(Fbe),t=this._instance.get_property(A8);if(!t)return e||{};for(var n=RC({},e||{}),r=Object.keys(t),o=0;o<r.length;o++)n[r[o]]=t[r[o]];return this.ge||(QB.warn(" Overriding feature flag payloads!",{flagPayloads:e,overriddenPayloads:t,finalPayloads:n}),this.ge=!0),n}reloadFeatureFlags(){this.be||this._instance.config.advanced_disable_feature_flags||this.$e||(this.$e=setTimeout(()=>{this.ke()},5))}xe(){clearTimeout(this.$e),this.$e=void 0}ensureFlagsLoaded(){this._e||this.me||this.$e||this.reloadFeatureFlags()}setAnonymousDistinctId(e){this.$anon_distinct_id=e}setReloadingPaused(e){this.be=e}ke(e){var t;if(this.xe(),!this._instance.I())if(this.me)this.ye=!0;else{var n={token:this._instance.config.token,distinct_id:this._instance.get_distinct_id(),groups:this._instance.getGroups(),$anon_distinct_id:this.$anon_distinct_id,person_properties:PA({},((t=this._instance.persistence)==null?void 0:t.get_initial_props())||{},this._instance.get_property(WN)||{}),group_properties:this._instance.get_property(Ow)};(e!=null&&e.disableFlags||this._instance.config.advanced_disable_feature_flags)&&(n.disable_flags=!0);var r=this._instance.config.__preview_remote_config,o=r?"/flags/?v=2":"/flags/?v=2&config=true",a=this._instance.config.advanced_only_evaluate_survey_feature_flags?"&only_evaluate_survey_feature_flags=true":"",s=this._instance.requestRouter.endpointFor("api",o+a);r&&(n.timezone=Lbe()),this.me=!0,this._instance.Ee({method:"POST",url:s,data:n,compression:this._instance.config.disable_compression?void 0:US.Base64,timeout:this._instance.config.feature_flag_request_timeout_ms,callback:l=>{var c,u,A=!0;if(l.statusCode===200&&(this.ye||(this.$anon_distinct_id=void 0),A=!1),this.me=!1,this.we||(this.we=!0,this._instance.Ie((u=l.json)!==null&&u!==void 0?u:{})),!n.disable_flags||this.ye)if(this.Se=!A,l.json&&(c=l.json.quotaLimited)!=null&&c.includes(hgt.FeatureFlags))QB.warn("You have hit your feature flags quota limit, and will not be able to load feature flags until the quota is reset. Please visit https://posthog.com/docs/billing/limits-alerts to learn more.");else{var d;n.disable_flags||this.receivedFeatureFlags((d=l.json)!==null&&d!==void 0?d:{},A),this.ye&&(this.ye=!1,this.ke())}}})}}getFeatureFlag(e,t){if(t===void 0&&(t={}),this._e||this.getFlags()&&this.getFlags().length>0){var n=this.getFlagVariants()[e],r=""+n,o=this._instance.get_property(Gbe)||void 0,a=this._instance.get_property(fU)||{};if((t.send_event||!("send_event"in t))&&(!(e in a)||!a[e].includes(r))){var s,l,c,u,A,d,f,h,y;wI(a[e])?a[e].push(r):a[e]=[r],(s=this._instance.persistence)==null||s.register({[fU]:a});var _=this.getFeatureFlagDetails(e),v={$feature_flag:e,$feature_flag_response:n,$feature_flag_payload:this.getFeatureFlagPayload(e)||null,$feature_flag_request_id:o,$feature_flag_bootstrapped_response:((l=this._instance.config.bootstrap)==null||(l=l.featureFlags)==null?void 0:l[e])||null,$feature_flag_bootstrapped_payload:((c=this._instance.config.bootstrap)==null||(c=c.featureFlagPayloads)==null?void 0:c[e])||null,$used_bootstrap_value:!this.Se};Gu(_==null||(u=_.metadata)==null?void 0:u.version)||(v.$feature_flag_version=_.metadata.version);var E,b=(A=_==null||(d=_.reason)==null?void 0:d.description)!==null&&A!==void 0?A:_==null||(f=_.reason)==null?void 0:f.code;b&&(v.$feature_flag_reason=b),_!=null&&(h=_.metadata)!=null&&h.id&&(v.$feature_flag_id=_.metadata.id),Gu(_==null?void 0:_.original_variant)&&Gu(_==null?void 0:_.original_enabled)||(v.$feature_flag_original_response=Gu(_.original_variant)?_.original_enabled:_.original_variant),_!=null&&(y=_.metadata)!=null&&y.original_payload&&(v.$feature_flag_original_payload=_==null||(E=_.metadata)==null?void 0:E.original_payload),this._instance.capture("$feature_flag_called",v)}return n}QB.warn('getFeatureFlag for key "'+e+`" failed. Feature flags didn't load in time.`)}getFeatureFlagDetails(e){return this.getFlagsWithDetails()[e]}getFeatureFlagPayload(e){return this.getFlagPayloads()[e]}getRemoteConfigPayload(e,t){var n=this._instance.config.token;this._instance.Ee({method:"POST",url:this._instance.requestRouter.endpointFor("api","/flags/?v=2&config=true"),data:{distinct_id:this._instance.get_distinct_id(),token:n},compression:this._instance.config.disable_compression?void 0:US.Base64,timeout:this._instance.config.feature_flag_request_timeout_ms,callback:r=>{var o,a=(o=r.json)==null?void 0:o.featureFlagPayloads;t((a==null?void 0:a[e])||void 0)}})}isFeatureEnabled(e,t){if(t===void 0&&(t={}),this._e||this.getFlags()&&this.getFlags().length>0)return!!this.getFeatureFlag(e,t);QB.warn('isFeatureEnabled for key "'+e+`" failed. Feature flags didn't load in time.`)}addFeatureFlagsHandler(e){this.featureFlagEventHandlers.push(e)}removeFeatureFlagsHandler(e){this.featureFlagEventHandlers=this.featureFlagEventHandlers.filter(t=>t!==e)}receivedFeatureFlags(e,t){if(this._instance.persistence){this._e=!0;var n=this.getFlagVariants(),r=this.getFlagPayloads(),o=this.getFlagsWithDetails();(function(a,s,l,c,u){l===void 0&&(l={}),c===void 0&&(c={}),u===void 0&&(u={});var A=fgt(a),d=A.flags,f=A.featureFlags,h=A.featureFlagPayloads;if(f){var y=a.requestId;if(wI(f)){QB.warn("v1 of the feature flags endpoint is deprecated. Please use the latest version.");var _={};if(f)for(var v=0;v<f.length;v++)_[f[v]]=!0;s&&s.register({[TX]:f,[uM]:_})}else{var E=f,b=h,M=d;a.errorsWhileComputingFlags&&(E=PA({},l,E),b=PA({},c,b),M=PA({},u,M)),s&&s.register(PA({[TX]:Object.keys(Obe(E)),[uM]:E||{},[Fbe]:b||{},[KZ]:M||{}},y?{[Gbe]:y}:{}))}}})(e,this._instance.persistence,n,r,o),this.Pe(t)}}override(e,t){t===void 0&&(t=!1),QB.warn("override is deprecated. Please use overrideFeatureFlags instead."),this.overrideFeatureFlags({flags:e,suppressWarning:t})}overrideFeatureFlags(e){if(!this._instance.__loaded||!this._instance.persistence)return QB.uninitializedWarning("posthog.featureFlags.overrideFeatureFlags");if(e===!1)return this._instance.persistence.unregister(vM),this._instance.persistence.unregister(A8),void this.Pe();if(e&&typeof e=="object"&&("flags"in e||"payloads"in e)){var t,n=e;if(this.ge=!!((t=n.suppressWarning)!==null&&t!==void 0&&t),"flags"in n){if(n.flags===!1)this._instance.persistence.unregister(vM);else if(n.flags)if(wI(n.flags)){for(var r={},o=0;o<n.flags.length;o++)r[n.flags[o]]=!0;this._instance.persistence.register({[vM]:r})}else this._instance.persistence.register({[vM]:n.flags})}return"payloads"in n&&(n.payloads===!1?this._instance.persistence.unregister(A8):n.payloads&&this._instance.persistence.register({[A8]:n.payloads})),void this.Pe()}this.Pe()}onFeatureFlags(e){if(this.addFeatureFlagsHandler(e),this._e){var{flags:t,flagVariants:n}=this.Re();e(t,n)}return()=>this.removeFeatureFlagsHandler(e)}updateEarlyAccessFeatureEnrollment(e,t){var n,r=(this._instance.get_property(AU)||[]).find(l=>l.flagKey===e),o={["$feature_enrollment/"+e]:t},a={$feature_flag:e,$feature_enrollment:t,$set:o};r&&(a.$early_access_feature_name=r.name),this._instance.capture("$feature_enrollment_update",a),this.setPersonPropertiesForFlags(o,!1);var s=PA({},this.getFlagVariants(),{[e]:t});(n=this._instance.persistence)==null||n.register({[TX]:Object.keys(Obe(s)),[uM]:s}),this.Pe()}getEarlyAccessFeatures(e,t,n){t===void 0&&(t=!1);var r=this._instance.get_property(AU),o=n?"&"+n.map(a=>"stage="+a).join("&"):"";if(r&&!t)return e(r);this._instance.Ee({url:this._instance.requestRouter.endpointFor("api","/api/early_access_features/?token="+this._instance.config.token+o),method:"GET",callback:a=>{var s;if(a.json){var l=a.json.earlyAccessFeatures;return(s=this._instance.persistence)==null||s.register({[AU]:l}),e(l)}}})}Re(){var e=this.getFlags(),t=this.getFlagVariants();return{flags:e.filter(n=>t[n]),flagVariants:Object.keys(t).filter(n=>t[n]).reduce((n,r)=>(n[r]=t[r],n),{})}}Pe(e){var{flags:t,flagVariants:n}=this.Re();this.featureFlagEventHandlers.forEach(r=>r(t,n,{errorsLoading:e}))}setPersonPropertiesForFlags(e,t){t===void 0&&(t=!0);var n=this._instance.get_property(WN)||{};this._instance.register({[WN]:PA({},n,e)}),t&&this._instance.reloadFeatureFlags()}resetPersonPropertiesForFlags(){this._instance.unregister(WN)}setGroupPropertiesForFlags(e,t){t===void 0&&(t=!0);var n=this._instance.get_property(Ow)||{};Object.keys(n).length!==0&&Object.keys(n).forEach(r=>{n[r]=PA({},n[r],e[r]),delete e[r]}),this._instance.register({[Ow]:PA({},n,e)}),t&&this._instance.reloadFeatureFlags()}resetGroupPropertiesForFlags(e){if(e){var t=this._instance.get_property(Ow)||{};this._instance.register({[Ow]:PA({},t,{[e]:{}})})}else this._instance.unregister(Ow)}reset(){this._e=!1,this.me=!1,this.be=!1,this.ye=!1,this.we=!1,this.Se=!1,this.$anon_distinct_id=void 0,this.xe(),this.ge=!1}}var ggt=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"];class kX{constructor(e,t){this.S=e,this.props={},this.Te=!1,this.Me=(n=>{var r="";return n.token&&(r=n.token.replace(/\+/g,"PL").replace(/\//g,"SL").replace(/=/g,"EQ")),n.persistence_name?"ph_"+n.persistence_name:"ph_"+r+"_posthog"})(e),this.B=this.Ce(e),this.load(),e.debug&&Qd.info("Persistence loaded",e.persistence,PA({},this.props)),this.update_config(e,e,t),this.save()}isDisabled(){return!!this.Fe}Ce(e){ggt.indexOf(e.persistence.toLowerCase())===-1&&(Qd.critical("Unknown persistence type "+e.persistence+"; falling back to localStorage+cookie"),e.persistence="localStorage+cookie");var t=e.persistence.toLowerCase();return t==="localstorage"&&y9.O()?y9:t==="localstorage+cookie"&&xU.O()?xU:t==="sessionstorage"&&mx.O()?mx:t==="memory"?J0t:t==="cookie"?bB:xU.O()?xU:bB}properties(){var e={};return nv(this.props,function(t,n){if(n===uM&&uC(t))for(var r=Object.keys(t),o=0;o<r.length;o++)e["$feature/"+r[o]]=t[r[o]];else s=n,l=!1,(o3(a=w0t)?l:zxe&&a.indexOf===zxe?a.indexOf(s)!=-1:(nv(a,function(c){if(l||(l=c===s))return sU}),l))||(e[n]=t);var a,s,l}),e}load(){if(!this.Fe){var e=this.B.L(this.Me);e&&(this.props=RC({},e))}}save(){this.Fe||this.B.j(this.Me,this.props,this.Oe,this.Ae,this.De,this.S.debug)}remove(){this.B.N(this.Me,!1),this.B.N(this.Me,!0)}clear(){this.remove(),this.props={}}register_once(e,t,n){if(uC(e)){Gu(t)&&(t="None"),this.Oe=Gu(n)?this.Le:n;var r=!1;if(nv(e,(o,a)=>{this.props.hasOwnProperty(a)&&this.props[a]!==t||(this.props[a]=o,r=!0)}),r)return this.save(),!0}return!1}register(e,t){if(uC(e)){this.Oe=Gu(t)?this.Le:t;var n=!1;if(nv(e,(r,o)=>{e.hasOwnProperty(o)&&this.props[o]!==r&&(this.props[o]=r,n=!0)}),n)return this.save(),!0}return!1}unregister(e){e in this.props&&(delete this.props[e],this.save())}update_campaign_params(){if(!this.Te){var e=Rbe(this.S.custom_campaign_params,this.S.mask_personal_data_properties,this.S.custom_personal_data_properties);cM(GZ(e))||this.register(e),this.Te=!0}}update_search_keyword(){var e;this.register((e=id==null?void 0:id.referrer)?Nbe(e):{})}update_referrer_info(){var e;this.register_once({$referrer:kbe(),$referring_domain:id!=null&&id.referrer&&((e=dM(id.referrer))==null?void 0:e.host)||"$direct"},void 0)}set_initial_person_info(){this.props[ZZ]||this.props[XZ]||this.register_once({[hU]:Pbe(this.S.mask_personal_data_properties,this.S.custom_personal_data_properties)},void 0)}get_initial_props(){var e={};nv([XZ,ZZ],a=>{var s=this.props[a];s&&nv(s,function(l,c){e["$initial_"+LZ(c)]=l})});var t,n,r=this.props[hU];if(r){var o=(t=Ube(r),n={},nv(t,function(a,s){n["$initial_"+LZ(s)]=a}),n);RC(e,o)}return e}safe_merge(e){return nv(this.props,function(t,n){n in e||(e[n]=t)}),e}update_config(e,t,n){if(this.Le=this.Oe=e.cookie_expiration,this.set_disabled(e.disable_persistence||!!n),this.set_cross_subdomain(e.cross_subdomain_cookie),this.set_secure(e.secure_cookie),e.persistence!==t.persistence){var r=this.Ce(e),o=this.props;this.clear(),this.B=r,this.props=o,this.save()}}set_disabled(e){this.Fe=e,this.Fe?this.remove():this.save()}set_cross_subdomain(e){e!==this.Ae&&(this.Ae=e,this.remove(),this.save())}set_secure(e){e!==this.De&&(this.De=e,this.remove(),this.save())}set_event_timer(e,t){var n=this.props[ZN]||{};n[e]=t,this.props[ZN]=n,this.save()}remove_event_timer(e){var t=(this.props[ZN]||{})[e];return Gu(t)||(delete this.props[ZN][e],this.save()),t}get_property(e){return this.props[e]}set_property(e,t){this.props[e]=t,this.save()}}class zbe{constructor(){this.je={},this.je={}}on(e,t){return this.je[e]||(this.je[e]=[]),this.je[e].push(t),()=>{this.je[e]=this.je[e].filter(n=>n!==t)}}emit(e,t){for(var n of this.je[e]||[])n(t);for(var r of this.je["*"]||[])r(e,t)}}class Jw{constructor(e){this.Ne=new zbe,this.ze=(t,n)=>this.Ue(t,n)&&this.qe(t,n)&&this.Be(t,n),this.Ue=(t,n)=>n==null||!n.event||(t==null?void 0:t.event)===(n==null?void 0:n.event),this._instance=e,this.He=new Set,this.We=new Set}init(){var e;if(!Gu((e=this._instance)==null?void 0:e.Ge)){var t;(t=this._instance)==null||t.Ge((n,r)=>{this.on(n,r)})}}register(e){var t,n;if(!Gu((t=this._instance)==null?void 0:t.Ge)&&(e.forEach(a=>{var s,l;(s=this.We)==null||s.add(a),(l=a.steps)==null||l.forEach(c=>{var u;(u=this.He)==null||u.add((c==null?void 0:c.event)||"")})}),(n=this._instance)!=null&&n.autocapture)){var r,o=new Set;e.forEach(a=>{var s;(s=a.steps)==null||s.forEach(l=>{l!=null&&l.selector&&o.add(l==null?void 0:l.selector)})}),(r=this._instance)==null||r.autocapture.setElementSelectors(o)}}on(e,t){var n;t!=null&&e.length!=0&&(this.He.has(e)||this.He.has(t==null?void 0:t.event))&&this.We&&((n=this.We)==null?void 0:n.size)>0&&this.We.forEach(r=>{this.Je(t,r)&&this.Ne.emit("actionCaptured",r.name)})}Ve(e){this.onAction("actionCaptured",t=>e(t))}Je(e,t){if((t==null?void 0:t.steps)==null)return!1;for(var n of t.steps)if(this.ze(e,n))return!0;return!1}onAction(e,t){return this.Ne.on(e,t)}qe(e,t){if(t!=null&&t.url){var n,r=e==null||(n=e.properties)==null?void 0:n.$current_url;if(!r||typeof r!="string"||!Jw.Ke(r,t==null?void 0:t.url,(t==null?void 0:t.url_matching)||"contains"))return!1}return!0}static Ke(e,t,n){switch(n){case"regex":return!!Aa&&gM(e,t);case"exact":return t===e;case"contains":var r=Jw.Ye(t).replace(/_/g,".").replace(/%/g,".*");return gM(e,r);default:return!1}}static Ye(e){return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}Be(e,t){if((t!=null&&t.href||t!=null&&t.tag_name||t!=null&&t.text)&&!this.Xe(e).some(o=>!(t!=null&&t.href&&!Jw.Ke(o.href||"",t==null?void 0:t.href,(t==null?void 0:t.href_matching)||"exact"))&&(t==null||!t.tag_name||o.tag_name===(t==null?void 0:t.tag_name))&&!(t!=null&&t.text&&!Jw.Ke(o.text||"",t==null?void 0:t.text,(t==null?void 0:t.text_matching)||"exact")&&!Jw.Ke(o.$el_text||"",t==null?void 0:t.text,(t==null?void 0:t.text_matching)||"exact"))))return!1;if(t!=null&&t.selector){var n,r=e==null||(n=e.properties)==null?void 0:n.$element_selectors;if(!r||!r.includes(t==null?void 0:t.selector))return!1}return!0}Xe(e){return(e==null?void 0:e.properties.$elements)==null?[]:e==null?void 0:e.properties.$elements}}var nx=tx("[Surveys]"),PX="seenSurvey_",mgt=(i,e)=>{var t="$survey_"+e+"/"+i.id;return i.current_iteration&&i.current_iteration>0&&(t="$survey_"+e+"/"+i.id+"/"+i.current_iteration),t};class ygt{constructor(e){this._instance=e,this.Qe=new Map,this.Ze=new Map}register(e){var t;Gu((t=this._instance)==null?void 0:t.Ge)||(this.tr(e),this.ir(e))}ir(e){var t=e.filter(n=>{var r,o;return((r=n.conditions)==null?void 0:r.actions)&&((o=n.conditions)==null||(o=o.actions)==null||(o=o.values)==null?void 0:o.length)>0});t.length!==0&&(this.er==null&&(this.er=new Jw(this._instance),this.er.init(),this.er.Ve(n=>{this.onAction(n)})),t.forEach(n=>{var r,o,a,s,l;n.conditions&&(r=n.conditions)!=null&&r.actions&&(o=n.conditions)!=null&&(o=o.actions)!=null&&o.values&&((a=n.conditions)==null||(a=a.actions)==null||(a=a.values)==null?void 0:a.length)>0&&((s=this.er)==null||s.register(n.conditions.actions.values),(l=n.conditions)==null||(l=l.actions)==null||(l=l.values)==null||l.forEach(c=>{if(c&&c.name){var u=this.Ze.get(c.name);u&&u.push(n.id),this.Ze.set(c.name,u||[n.id])}}))}))}tr(e){var t;e.filter(n=>{var r,o;return((r=n.conditions)==null?void 0:r.events)&&((o=n.conditions)==null||(o=o.events)==null||(o=o.values)==null?void 0:o.length)>0}).length!==0&&((t=this._instance)==null||t.Ge((n,r)=>{this.onEvent(n,r)}),e.forEach(n=>{var r;(r=n.conditions)==null||(r=r.events)==null||(r=r.values)==null||r.forEach(o=>{if(o&&o.name){var a=this.Qe.get(o.name);a&&a.push(n.id),this.Qe.set(o.name,a||[n.id])}})}))}onEvent(e,t){var n,r=((n=this._instance)==null||(n=n.persistence)==null?void 0:n.props[dU])||[];if(e==="survey shown"&&t&&r.length>0){var o;nx.info("survey event matched, removing survey from activated surveys",{event:e,eventPayload:t,existingActivatedSurveys:r});var a=t==null||(o=t.properties)==null?void 0:o.$survey_id;if(a){var s=r.indexOf(a);s>=0&&(r.splice(s,1),this.rr(r))}}else this.Qe.has(e)&&(nx.info("survey event matched, updating activated surveys",{event:e,surveys:this.Qe.get(e)}),this.rr(r.concat(this.Qe.get(e)||[])))}onAction(e){var t,n=((t=this._instance)==null||(t=t.persistence)==null?void 0:t.props[dU])||[];this.Ze.has(e)&&this.rr(n.concat(this.Ze.get(e)||[]))}rr(e){var t;(t=this._instance)==null||(t=t.persistence)==null||t.register({[dU]:[...new Set(e)]})}getSurveys(){var e,t=(e=this._instance)==null||(e=e.persistence)==null?void 0:e.props[dU];return t||[]}getEventToSurveys(){return this.Qe}sr(){return this.er}}class _gt{constructor(e){this.nr=void 0,this.ar=null,this.lr=!1,this.ur=!1,this.hr=[],this._instance=e,this._surveyEventReceiver=null}onRemoteConfig(e){var t=e.surveys;if(o_(t))return nx.warn("Flags not loaded yet. Not loading surveys.");var n=wI(t);this.nr=n?t.length>0:t,nx.info("flags response received, isSurveysEnabled: "+this.nr),this.loadIfEnabled()}reset(){localStorage.removeItem("lastSeenSurveyDate");for(var e=[],t=0;t<localStorage.length;t++){var n=localStorage.key(t);(n!=null&&n.startsWith(PX)||n!=null&&n.startsWith("inProgressSurvey_"))&&e.push(n)}e.forEach(r=>localStorage.removeItem(r))}loadIfEnabled(){if(!this.ar)if(this.ur)nx.info("Already initializing surveys, skipping...");else if(this._instance.config.disable_surveys)nx.info("Disabled. Not loading surveys.");else{var e=Kp==null?void 0:Kp.__PosthogExtensions__;if(e){var t=this.nr;if(!Gu(t)){this.ur=!0;try{var n=e.generateSurveys;if(n)return void this.dr(n,t);var r=e.loadExternalDependency;if(!r)return void this.vr("PostHog loadExternalDependency extension not found.");r(this._instance,"surveys",o=>{o||!e.generateSurveys?this.vr("Could not load surveys script",o):this.dr(e.generateSurveys,t)})}catch(o){throw this.vr("Error initializing surveys",o),o}finally{this.ur=!1}}}else nx.error("PostHog Extensions not found.")}}dr(e,t){this.ar=e(this._instance,t),this._surveyEventReceiver=new ygt(this._instance),nx.info("Surveys loaded successfully"),this.cr({isLoaded:!0})}vr(e,t){nx.error(e,t),this.cr({isLoaded:!1,error:e})}onSurveysLoaded(e){return this.hr.push(e),this.ar&&this.cr({isLoaded:!0}),()=>{this.hr=this.hr.filter(t=>t!==e)}}getSurveys(e,t){if(t===void 0&&(t=!1),this._instance.config.disable_surveys)return nx.info("Disabled. Not loading surveys."),e([]);var n=this._instance.get_property(jZ);if(n&&!t)return e(n,{isLoaded:!0});if(this.lr)return e([],{isLoaded:!1,error:"Surveys are already being loaded"});try{this.lr=!0,this._instance.Ee({url:this._instance.requestRouter.endpointFor("api","/api/surveys/?token="+this._instance.config.token),method:"GET",timeout:this._instance.config.surveys_request_timeout_ms,callback:r=>{var o;this.lr=!1;var a=r.statusCode;if(a!==200||!r.json){var s="Surveys API could not be loaded, status: "+a;return nx.error(s),e([],{isLoaded:!1,error:s})}var l,c=r.json.surveys||[],u=c.filter(A=>function(d){return!(!d.start_date||d.end_date)}(A)&&(function(d){var f;return!((f=d.conditions)==null||(f=f.events)==null||(f=f.values)==null||!f.length)}(A)||function(d){var f;return!((f=d.conditions)==null||(f=f.actions)==null||(f=f.values)==null||!f.length)}(A)));return u.length>0&&((l=this._surveyEventReceiver)==null||l.register(u)),(o=this._instance.persistence)==null||o.register({[jZ]:c}),e(c,{isLoaded:!0})}})}catch(r){throw this.lr=!1,r}}cr(e){for(var t of this.hr)try{e.isLoaded?this.getSurveys(t):t([],e)}catch(n){nx.error("Error in survey callback",n)}}getActiveMatchingSurveys(e,t){if(t===void 0&&(t=!1),!o_(this.ar))return this.ar.getActiveMatchingSurveys(e,t);nx.warn("init was not called")}pr(e){var t=null;return this.getSurveys(n=>{var r;t=(r=n.find(o=>o.id===e))!==null&&r!==void 0?r:null}),t}gr(e){if(o_(this.ar))return{eligible:!1,reason:"SDK is not enabled or survey functionality is not yet loaded"};var t=typeof e=="string"?this.pr(e):e;return t?this.ar.checkSurveyEligibility(t):{eligible:!1,reason:"Survey not found"}}canRenderSurvey(e){if(o_(this.ar))return nx.warn("init was not called"),{visible:!1,disabledReason:"SDK is not enabled or survey functionality is not yet loaded"};var t=this.gr(e);return{visible:t.eligible,disabledReason:t.reason}}canRenderSurveyAsync(e,t){return o_(this.ar)?(nx.warn("init was not called"),Promise.resolve({visible:!1,disabledReason:"SDK is not enabled or survey functionality is not yet loaded"})):new Promise(n=>{this.getSurveys(r=>{var o,a=(o=r.find(l=>l.id===e))!==null&&o!==void 0?o:null;if(a){var s=this.gr(a);n({visible:s.eligible,disabledReason:s.reason})}else n({visible:!1,disabledReason:"Survey not found"})},t)})}renderSurvey(e,t){if(o_(this.ar))nx.warn("init was not called");else{var n=this.pr(e),r=id==null?void 0:id.querySelector(t);n?r?this.ar.renderSurvey(n,r):nx.warn("Survey element not found"):nx.warn("Survey not found")}}}(function(i){return i.Button="button",i.Tab="tab",i.Selector="selector",i})({}),function(i){return i.TopLeft="top_left",i.TopRight="top_right",i.TopCenter="top_center",i.MiddleLeft="middle_left",i.MiddleRight="middle_right",i.MiddleCenter="middle_center",i.Left="left",i.Center="center",i.Right="right",i.NextToTrigger="next_to_trigger",i}({}),function(i){return i.Popover="popover",i.API="api",i.Widget="widget",i}({}),function(i){return i.Open="open",i.MultipleChoice="multiple_choice",i.SingleChoice="single_choice",i.Rating="rating",i.Link="link",i}({}),function(i){return i.NextQuestion="next_question",i.End="end",i.ResponseBased="response_based",i.SpecificQuestion="specific_question",i}({}),function(i){return i.Once="once",i.Recurring="recurring",i.Always="always",i}({});var UX=function(i){return i.SHOWN="survey shown",i.DISMISSED="survey dismissed",i.SENT="survey sent",i}({}),Hbe=function(i){return i.SURVEY_ID="$survey_id",i.SURVEY_NAME="$survey_name",i.SURVEY_RESPONSE="$survey_response",i.SURVEY_ITERATION="$survey_iteration",i.SURVEY_ITERATION_START_DATE="$survey_iteration_start_date",i.SURVEY_PARTIALLY_COMPLETED="$survey_partially_completed",i.SURVEY_SUBMISSION_ID="$survey_submission_id",i.SURVEY_QUESTIONS="$survey_questions",i.SURVEY_COMPLETED="$survey_completed",i}({}),Ybe=tx("[RateLimiter]");class vgt{constructor(e){var t,n;this.serverLimits={},this.lastEventRateLimited=!1,this.checkForLimiting=r=>{var o=r.text;if(o&&o.length)try{(JSON.parse(o).quota_limited||[]).forEach(a=>{Ybe.info((a||"events")+" is quota limited."),this.serverLimits[a]=new Date().getTime()+6e4})}catch(a){return void Ybe.warn('could not rate limit - continuing. Error: "'+(a==null?void 0:a.message)+'"',{text:o})}},this.instance=e,this.captureEventsPerSecond=((t=e.config.rate_limiting)==null?void 0:t.events_per_second)||10,this.captureEventsBurstLimit=Math.max(((n=e.config.rate_limiting)==null?void 0:n.events_burst_limit)||10*this.captureEventsPerSecond,this.captureEventsPerSecond),this.lastEventRateLimited=this.clientRateLimitContext(!0).isRateLimited}clientRateLimitContext(e){var t,n,r;e===void 0&&(e=!1);var o=new Date().getTime(),a=(t=(n=this.instance.persistence)==null?void 0:n.get_property(qZ))!==null&&t!==void 0?t:{tokens:this.captureEventsBurstLimit,last:o};a.tokens+=(o-a.last)/1e3*this.captureEventsPerSecond,a.last=o,a.tokens>this.captureEventsBurstLimit&&(a.tokens=this.captureEventsBurstLimit);var s=a.tokens<1;return s||e||(a.tokens=Math.max(0,a.tokens-1)),!s||this.lastEventRateLimited||e||this.instance.capture("$$client_ingestion_warning",{$$client_ingestion_warning_message:"posthog-js client rate limited. Config is set to "+this.captureEventsPerSecond+" events per second and "+this.captureEventsBurstLimit+" events burst limit."},{skip_client_rate_limiting:!0}),this.lastEventRateLimited=s,(r=this.instance.persistence)==null||r.set_property(qZ,a),{isRateLimited:s,remainingTokens:a.tokens}}isServerRateLimited(e){var t=this.serverLimits[e||"events"]||!1;return t!==!1&&new Date().getTime()<t}}var qw=tx("[RemoteConfig]");class Igt{constructor(e){this._instance=e}get remoteConfig(){var e;return(e=Kp._POSTHOG_REMOTE_CONFIG)==null||(e=e[this._instance.config.token])==null?void 0:e.config}_r(e){var t,n;(t=Kp.__PosthogExtensions__)!=null&&t.loadExternalDependency?(n=Kp.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this._instance,"remote-config",()=>e(this.remoteConfig)):(qw.error("PostHog Extensions not found. Cannot load remote config."),e())}mr(e){this._instance.Ee({method:"GET",url:this._instance.requestRouter.endpointFor("assets","/array/"+this._instance.config.token+"/config"),callback:t=>{e(t.json)}})}load(){try{if(this.remoteConfig)return qw.info("Using preloaded remote config",this.remoteConfig),void this.Ie(this.remoteConfig);if(this._instance.I())return void qw.warn("Remote config is disabled. Falling back to local config.");this._r(e=>{if(!e)return qw.info("No config found after loading remote JS config. Falling back to JSON."),void this.mr(t=>{this.Ie(t)});this.Ie(e)})}catch(e){qw.error("Error loading remote config",e)}}Ie(e){e?this._instance.config.__preview_remote_config?(this._instance.Ie(e),e.hasFeatureFlags!==!1&&this._instance.featureFlags.ensureFlagsLoaded()):qw.info("__preview_remote_config is disabled. Logging config instead",e):qw.error("Failed to fetch remote config from PostHog.")}}var LX=3e3;class Cgt{constructor(e,t){this.br=!0,this.yr=[],this.wr=Qb((t==null?void 0:t.flush_interval_ms)||LX,250,5e3,"flush interval",LX),this.Sr=e}enqueue(e){this.yr.push(e),this.$r||this.kr()}unload(){this.Er();var e=this.yr.length>0?this.Ir():{},t=Object.values(e);[...t.filter(n=>n.url.indexOf("/e")===0),...t.filter(n=>n.url.indexOf("/e")!==0)].map(n=>{this.Sr(PA({},n,{transport:"sendBeacon"}))})}enable(){this.br=!1,this.kr()}kr(){var e=this;this.br||(this.$r=setTimeout(()=>{if(this.Er(),this.yr.length>0){var t=this.Ir(),n=function(){var o=t[r],a=new Date().getTime();o.data&&wI(o.data)&&nv(o.data,s=>{s.offset=Math.abs(s.timestamp-a),delete s.timestamp}),e.Sr(o)};for(var r in t)n()}},this.wr))}Er(){clearTimeout(this.$r),this.$r=void 0}Ir(){var e={};return nv(this.yr,t=>{var n,r=t,o=(r?r.batchKey:null)||r.url;Gu(e[o])&&(e[o]=PA({},r,{data:[]})),(n=e[o].data)==null||n.push(r.data)}),this.yr=[],e}}var xgt=["retriesPerformedSoFar"];class Egt{constructor(e){this.Pr=!1,this.Rr=3e3,this.yr=[],this._instance=e,this.yr=[],this.Tr=!0,!Gu(Aa)&&"onLine"in Aa.navigator&&(this.Tr=Aa.navigator.onLine,LI(Aa,"online",()=>{this.Tr=!0,this.se()}),LI(Aa,"offline",()=>{this.Tr=!1}))}get length(){return this.yr.length}retriableRequest(e){var{retriesPerformedSoFar:t}=e,n=Jxe(e,xgt);Kx(t)&&t>0&&(n.url=TU(n.url,{retry_count:t})),this._instance.Ee(PA({},n,{callback:r=>{r.statusCode!==200&&(r.statusCode<400||r.statusCode>=500)&&(t??0)<10?this.Mr(PA({retriesPerformedSoFar:t},n)):n.callback==null||n.callback(r)}}))}Mr(e){var t=e.retriesPerformedSoFar||0;e.retriesPerformedSoFar=t+1;var n=function(a){var s=3e3*Math.pow(2,a),l=s/2,c=Math.min(18e5,s),u=(Math.random()-.5)*(c-l);return Math.ceil(c+u)}(t),r=Date.now()+n;this.yr.push({retryAt:r,requestOptions:e});var o="Enqueued failed request for retry in "+n;navigator.onLine||(o+=" (Browser is offline)"),Qd.warn(o),this.Pr||(this.Pr=!0,this.Cr())}Cr(){this.Fr&&clearTimeout(this.Fr),this.Fr=setTimeout(()=>{this.Tr&&this.yr.length>0&&this.se(),this.Cr()},this.Rr)}se(){var e=Date.now(),t=[],n=this.yr.filter(o=>o.retryAt<e||(t.push(o),!1));if(this.yr=t,n.length>0)for(var{requestOptions:r}of n)this.retriableRequest(r)}unload(){for(var{requestOptions:e}of(this.Fr&&(clearTimeout(this.Fr),this.Fr=void 0),this.yr))try{this._instance.Ee(PA({},e,{transport:"sendBeacon"}))}catch(t){Qd.error(t)}this.yr=[]}}class bgt{constructor(e){this.Or=()=>{var t,n,r,o;this.Ar||(this.Ar={});var a=this.scrollElement(),s=this.scrollY(),l=a?Math.max(0,a.scrollHeight-a.clientHeight):0,c=s+((a==null?void 0:a.clientHeight)||0),u=(a==null?void 0:a.scrollHeight)||0;this.Ar.lastScrollY=Math.ceil(s),this.Ar.maxScrollY=Math.max(s,(t=this.Ar.maxScrollY)!==null&&t!==void 0?t:0),this.Ar.maxScrollHeight=Math.max(l,(n=this.Ar.maxScrollHeight)!==null&&n!==void 0?n:0),this.Ar.lastContentY=c,this.Ar.maxContentY=Math.max(c,(r=this.Ar.maxContentY)!==null&&r!==void 0?r:0),this.Ar.maxContentHeight=Math.max(u,(o=this.Ar.maxContentHeight)!==null&&o!==void 0?o:0)},this._instance=e}getContext(){return this.Ar}resetContext(){var e=this.Ar;return setTimeout(this.Or,0),e}startMeasuringScrollPosition(){LI(Aa,"scroll",this.Or,{capture:!0}),LI(Aa,"scrollend",this.Or,{capture:!0}),LI(Aa,"resize",this.Or)}scrollElement(){if(!this._instance.config.scroll_root_selector)return Aa==null?void 0:Aa.document.documentElement;var e=wI(this._instance.config.scroll_root_selector)?this._instance.config.scroll_root_selector:[this._instance.config.scroll_root_selector];for(var t of e){var n=Aa==null?void 0:Aa.document.querySelector(t);if(n)return n}}scrollY(){if(this._instance.config.scroll_root_selector){var e=this.scrollElement();return e&&e.scrollTop||0}return Aa&&(Aa.scrollY||Aa.pageYOffset||Aa.document.documentElement.scrollTop)||0}scrollX(){if(this._instance.config.scroll_root_selector){var e=this.scrollElement();return e&&e.scrollLeft||0}return Aa&&(Aa.scrollX||Aa.pageXOffset||Aa.document.documentElement.scrollLeft)||0}}var Bgt=i=>Pbe(i==null?void 0:i.config.mask_personal_data_properties,i==null?void 0:i.config.custom_personal_data_properties);class Sgt{constructor(e,t,n,r){this.Dr=o=>{var a=this.Lr();if(!a||a.sessionId!==o){var s={sessionId:o,props:this.jr(this._instance)};this.Nr.register({[JZ]:s})}},this._instance=e,this.zr=t,this.Nr=n,this.jr=r||Bgt,this.zr.onSessionId(this.Dr)}Lr(){return this.Nr.props[JZ]}getSetOnceProps(){var e,t=(e=this.Lr())==null?void 0:e.props;return t?"r"in t?Ube(t):{$referring_domain:t.referringDomain,$pathname:t.initialPathName,utm_source:t.utm_source,utm_campaign:t.utm_campaign,utm_medium:t.utm_medium,utm_content:t.utm_content,utm_term:t.utm_term}:{}}getSessionProps(){var e={};return nv(GZ(this.getSetOnceProps()),(t,n)=>{n==="$current_url"&&(n="url"),e["$session_entry_"+LZ(n)]=t}),e}}var Vbe=tx("[SessionId]");class wgt{constructor(e,t,n){var r;if(this.Ur=[],!e.persistence)throw new Error("SessionIdManager requires a PostHogPersistence instance");if(e.config.__preview_experimental_cookieless_mode)throw new Error("SessionIdManager cannot be used with __preview_experimental_cookieless_mode");this.S=e.config,this.Nr=e.persistence,this.fi=void 0,this.Ct=void 0,this._sessionStartTimestamp=null,this._sessionActivityTimestamp=null,this.qr=t||l3,this.Br=n||l3;var o=this.S.persistence_name||this.S.token,a=this.S.session_idle_timeout_seconds||1800;if(this._sessionTimeoutMs=1e3*Qb(a,60,36e3,"session_idle_timeout_seconds",1800),e.register({$configured_session_timeout_ms:this._sessionTimeoutMs}),this.Hr(),this.Wr="ph_"+o+"_window_id",this.Gr="ph_"+o+"_primary_window_exists",this.Jr()){var s=mx.L(this.Wr),l=mx.L(this.Gr);s&&!l?this.fi=s:mx.N(this.Wr),mx.j(this.Gr,!0)}if((r=this.S.bootstrap)!=null&&r.sessionID)try{var c=(u=>{var A=u.replace(/-/g,"");if(A.length!==32)throw new Error("Not a valid UUID");if(A[12]!=="7")throw new Error("Not a UUIDv7");return parseInt(A.substring(0,12),16)})(this.S.bootstrap.sessionID);this.Vr(this.S.bootstrap.sessionID,new Date().getTime(),c)}catch(u){Vbe.error("Invalid sessionID in bootstrap",u)}this.Kr()}get sessionTimeoutMs(){return this._sessionTimeoutMs}onSessionId(e){return Gu(this.Ur)&&(this.Ur=[]),this.Ur.push(e),this.Ct&&e(this.Ct,this.fi),()=>{this.Ur=this.Ur.filter(t=>t!==e)}}Jr(){return this.S.persistence!=="memory"&&!this.Nr.Fe&&mx.O()}Yr(e){e!==this.fi&&(this.fi=e,this.Jr()&&mx.j(this.Wr,e))}Xr(){return this.fi?this.fi:this.Jr()?mx.L(this.Wr):null}Vr(e,t,n){e===this.Ct&&t===this._sessionActivityTimestamp&&n===this._sessionStartTimestamp||(this._sessionStartTimestamp=n,this._sessionActivityTimestamp=t,this.Ct=e,this.Nr.register({[uU]:[t,e,n]}))}Qr(){if(this.Ct&&this._sessionActivityTimestamp&&this._sessionStartTimestamp)return[this._sessionActivityTimestamp,this.Ct,this._sessionStartTimestamp];var e=this.Nr.props[uU];return wI(e)&&e.length===2&&e.push(e[0]),e||[0,null,0]}resetSessionId(){this.Vr(null,null,null)}Kr(){LI(Aa,"beforeunload",()=>{this.Jr()&&mx.N(this.Gr)},{capture:!1})}checkAndGetSessionAndWindowId(e,t){if(e===void 0&&(e=!1),t===void 0&&(t=null),this.S.__preview_experimental_cookieless_mode)throw new Error("checkAndGetSessionAndWindowId should not be called in __preview_experimental_cookieless_mode");var n=t||new Date().getTime(),[r,o,a]=this.Qr(),s=this.Xr(),l=Kx(a)&&a>0&&Math.abs(n-a)>864e5,c=!1,u=!o,A=!e&&Math.abs(n-r)>this.sessionTimeoutMs;u||A||l?(o=this.qr(),s=this.Br(),Vbe.info("new session ID generated",{sessionId:o,windowId:s,changeReason:{noSessionId:u,activityTimeout:A,sessionPastMaximumLength:l}}),a=n,c=!0):s||(s=this.Br(),c=!0);var d=r===0||!e||l?n:r,f=a===0?new Date().getTime():a;return this.Yr(s),this.Vr(o,d,f),e||this.Hr(),c&&this.Ur.forEach(h=>h(o,s,c?{noSessionId:u,activityTimeout:A,sessionPastMaximumLength:l}:void 0)),{sessionId:o,windowId:s,sessionStartTimestamp:f,changeReason:c?{noSessionId:u,activityTimeout:A,sessionPastMaximumLength:l}:void 0,lastActivityTimestamp:r}}Hr(){clearTimeout(this.Zr),this.Zr=setTimeout(()=>{this.resetSessionId()},1.1*this.sessionTimeoutMs)}}var Qgt=["$set_once","$set"],d3=tx("[SiteApps]");class Mgt{constructor(e){this._instance=e,this.ts=[],this.apps={}}get isEnabled(){return!!this._instance.config.opt_in_site_apps}es(e,t){if(t){var n=this.globalsForEvent(t);this.ts.push(n),this.ts.length>1e3&&(this.ts=this.ts.slice(10))}}get siteAppLoaders(){var e;return(e=Kp._POSTHOG_REMOTE_CONFIG)==null||(e=e[this._instance.config.token])==null?void 0:e.siteApps}init(){if(this.isEnabled){var e=this._instance.Ge(this.es.bind(this));this.rs=()=>{e(),this.ts=[],this.rs=void 0}}}globalsForEvent(e){var t,n,r,o,a,s,l;if(!e)throw new Error("Event payload is required");var c={},u=this._instance.get_property("$groups")||[],A=this._instance.get_property("$stored_group_properties")||{};for(var[d,f]of Object.entries(A))c[d]={id:u[d],type:d,properties:f};var{$set_once:h,$set:y}=e;return{event:PA({},Jxe(e,Qgt),{properties:PA({},e.properties,y?{$set:PA({},(t=(n=e.properties)==null?void 0:n.$set)!==null&&t!==void 0?t:{},y)}:{},h?{$set_once:PA({},(r=(o=e.properties)==null?void 0:o.$set_once)!==null&&r!==void 0?r:{},h)}:{}),elements_chain:(a=(s=e.properties)==null?void 0:s.$elements_chain)!==null&&a!==void 0?a:"",distinct_id:(l=e.properties)==null?void 0:l.distinct_id}),person:{properties:this._instance.get_property("$stored_person_properties")},groups:c}}setupSiteApp(e){var t=this.apps[e.id],n=()=>{var s;!t.errored&&this.ts.length&&(d3.info("Processing "+this.ts.length+" events for site app with id "+e.id),this.ts.forEach(l=>t.processEvent==null?void 0:t.processEvent(l)),t.processedBuffer=!0),Object.values(this.apps).every(l=>l.processedBuffer||l.errored)&&((s=this.rs)==null||s.call(this))},r=!1,o=s=>{t.errored=!s,t.loaded=!0,d3.info("Site app with id "+e.id+" "+(s?"loaded":"errored")),r&&n()};try{var{processEvent:a}=e.init({posthog:this._instance,callback:s=>{o(s)}});a&&(t.processEvent=a),r=!0}catch(s){d3.error("Error while initializing PostHog app with config id "+e.id,s),o(!1)}if(r&&t.loaded)try{n()}catch(s){d3.error("Error while processing buffered events PostHog app with config id "+e.id,s),t.errored=!0}}ss(){var e=this.siteAppLoaders||[];for(var t of e)this.apps[t.id]={id:t.id,loaded:!1,errored:!1,processedBuffer:!1};for(var n of e)this.setupSiteApp(n)}ns(e){if(Object.keys(this.apps).length!==0){var t=this.globalsForEvent(e);for(var n of Object.values(this.apps))try{n.processEvent==null||n.processEvent(t)}catch(r){d3.error("Error while processing event "+e.event+" for site app "+n.id,r)}}}onRemoteConfig(e){var t,n,r,o=this;if((t=this.siteAppLoaders)!=null&&t.length)return this.isEnabled?(this.ss(),void this._instance.on("eventCaptured",c=>this.ns(c))):void d3.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.');if((n=this.rs)==null||n.call(this),(r=e.siteApps)!=null&&r.length)if(this.isEnabled){var a=function(c){var u;Kp["__$$ph_site_app_"+c]=o._instance,(u=Kp.__PosthogExtensions__)==null||u.loadSiteApp==null||u.loadSiteApp(o._instance,l,A=>{if(A)return d3.error("Error while initializing PostHog app with config id "+c,A)})};for(var{id:s,url:l}of e.siteApps)a(s)}else d3.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}}var Rgt=["amazonbot","amazonproductbot","app.hypefactors.com","applebot","archive.org_bot","awariobot","backlinksextendedbot","baiduspider","bingbot","bingpreview","chrome-lighthouse","dataforseobot","deepscan","duckduckbot","facebookexternal","facebookcatalog","http://yandex.com/bots","hubspot","ia_archiver","leikibot","linkedinbot","meta-externalagent","mj12bot","msnbot","nessus","petalbot","pinterest","prerender","rogerbot","screaming frog","sebot-wa","sitebulb","slackbot","slurp","trendictionbot","turnitin","twitterbot","vercelbot","yahoo! slurp","yandexbot","zoombot","bot.htm","bot.php","(bot;","bot/","crawler","ahrefsbot","ahrefssiteaudit","semrushbot","siteauditbot","splitsignalbot","gptbot","oai-searchbot","chatgpt-user","perplexitybot","better uptime bot","sentryuptimebot","uptimerobot","headlesschrome","cypress","google-hoteladsverifier","adsbot-google","apis-google","duplexweb-google","feedfetcher-google","google favicon","google web preview","google-read-aloud","googlebot","googleother","google-cloudvertexbot","googleweblight","mediapartners-google","storebot-google","google-inspectiontool","bytespider"],Kbe=function(i,e){if(!i)return!1;var t=i.toLowerCase();return Rgt.concat(e||[]).some(n=>{var r=n.toLowerCase();return t.indexOf(r)!==-1})},jbe=function(i,e){if(!i)return!1;var t=i.userAgent;if(t&&Kbe(t,e))return!0;try{var n=i==null?void 0:i.userAgentData;if(n!=null&&n.brands&&n.brands.some(r=>Kbe(r==null?void 0:r.brand,e)))return!0}catch{}return!!i.webdriver},d8=function(i){return i.US="us",i.EU="eu",i.CUSTOM="custom",i}({}),Jbe="i.posthog.com";class Dgt{constructor(e){this.os={},this.instance=e}get apiHost(){var e=this.instance.config.api_host.trim().replace(/\/$/,"");return e==="https://app.posthog.com"?"https://us.i.posthog.com":e}get uiHost(){var e,t=(e=this.instance.config.ui_host)==null?void 0:e.replace(/\/$/,"");return t||(t=this.apiHost.replace("."+Jbe,".posthog.com")),t==="https://app.posthog.com"?"https://us.posthog.com":t}get region(){return this.os[this.apiHost]||(/https:\/\/(app|us|us-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?this.os[this.apiHost]=d8.US:/https:\/\/(eu|eu-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?this.os[this.apiHost]=d8.EU:this.os[this.apiHost]=d8.CUSTOM),this.os[this.apiHost]}endpointFor(e,t){if(t===void 0&&(t=""),t&&(t=t[0]==="/"?t:"/"+t),e==="ui")return this.uiHost+t;if(this.region===d8.CUSTOM)return this.apiHost+t;var n=Jbe+t;switch(e){case"assets":return"https://"+this.region+"-assets."+n;case"api":return"https://"+this.region+"."+n}}}var Ngt={icontains:(i,e)=>!!Aa&&e.href.toLowerCase().indexOf(i.toLowerCase())>-1,not_icontains:(i,e)=>!!Aa&&e.href.toLowerCase().indexOf(i.toLowerCase())===-1,regex:(i,e)=>!!Aa&&gM(e.href,i),not_regex:(i,e)=>!!Aa&&!gM(e.href,i),exact:(i,e)=>e.href===i,is_not:(i,e)=>e.href!==i};class qx{constructor(e){var t=this;this.getWebExperimentsAndEvaluateDisplayLogic=function(n){n===void 0&&(n=!1),t.getWebExperiments(r=>{qx.ls("retrieved web experiments from the server"),t.us=new Map,r.forEach(o=>{if(o.feature_flag_key){var a;t.us&&(qx.ls("setting flag key ",o.feature_flag_key," to web experiment ",o),(a=t.us)==null||a.set(o.feature_flag_key,o));var s=t._instance.getFeatureFlag(o.feature_flag_key);AC(s)&&o.variants[s]&&t.hs(o.name,s,o.variants[s].transforms)}else if(o.variants)for(var l in o.variants){var c=o.variants[l];qx.ds(c)&&t.hs(o.name,l,c.transforms)}})},n)},this._instance=e,this._instance.onFeatureFlags(n=>{this.onFeatureFlags(n)})}onFeatureFlags(e){if(this._is_bot())qx.ls("Refusing to render web experiment since the viewer is a likely bot");else if(!this._instance.config.disable_web_experiments){if(o_(this.us))return this.us=new Map,this.loadIfEnabled(),void this.previewWebExperiment();qx.ls("applying feature flags",e),e.forEach(t=>{var n;if(this.us&&(n=this.us)!=null&&n.has(t)){var r,o=this._instance.getFeatureFlag(t),a=(r=this.us)==null?void 0:r.get(t);o&&a!=null&&a.variants[o]&&this.hs(a.name,o,a.variants[o].transforms)}})}}previewWebExperiment(){var e=qx.getWindowLocation();if(e!=null&&e.search){var t=vU(e==null?void 0:e.search,"__experiment_id"),n=vU(e==null?void 0:e.search,"__experiment_variant");t&&n&&(qx.ls("previewing web experiments "+t+" && "+n),this.getWebExperiments(r=>{this.vs(parseInt(t),n,r)},!1,!0))}}loadIfEnabled(){this._instance.config.disable_web_experiments||this.getWebExperimentsAndEvaluateDisplayLogic()}getWebExperiments(e,t,n){if(this._instance.config.disable_web_experiments&&!n)return e([]);var r=this._instance.get_property("$web_experiments");if(r&&!t)return e(r);this._instance.Ee({url:this._instance.requestRouter.endpointFor("api","/api/web_experiments/?token="+this._instance.config.token),method:"GET",callback:o=>{if(o.statusCode!==200||!o.json)return e([]);var a=o.json.experiments||[];return e(a)}})}vs(e,t,n){var r=n.filter(o=>o.id===e);r&&r.length>0&&(qx.ls("Previewing web experiment ["+r[0].name+"] with variant ["+t+"]"),this.hs(r[0].name,t,r[0].variants[t].transforms))}static ds(e){return!o_(e.conditions)&&qx.cs(e)&&qx.fs(e)}static cs(e){var t;if(o_(e.conditions)||o_((t=e.conditions)==null?void 0:t.url))return!0;var n,r,o,a=qx.getWindowLocation();return!!a&&((n=e.conditions)==null||!n.url||Ngt[(r=(o=e.conditions)==null?void 0:o.urlMatchType)!==null&&r!==void 0?r:"icontains"](e.conditions.url,a))}static getWindowLocation(){return Aa==null?void 0:Aa.location}static fs(e){var t;if(o_(e.conditions)||o_((t=e.conditions)==null?void 0:t.utm))return!0;var n=Rbe();if(n.utm_source){var r,o,a,s,l,c,u,A,d=(r=e.conditions)==null||(r=r.utm)==null||!r.utm_campaign||((o=e.conditions)==null||(o=o.utm)==null?void 0:o.utm_campaign)==n.utm_campaign,f=(a=e.conditions)==null||(a=a.utm)==null||!a.utm_source||((s=e.conditions)==null||(s=s.utm)==null?void 0:s.utm_source)==n.utm_source,h=(l=e.conditions)==null||(l=l.utm)==null||!l.utm_medium||((c=e.conditions)==null||(c=c.utm)==null?void 0:c.utm_medium)==n.utm_medium,y=(u=e.conditions)==null||(u=u.utm)==null||!u.utm_term||((A=e.conditions)==null||(A=A.utm)==null?void 0:A.utm_term)==n.utm_term;return d&&h&&y&&f}return!1}static ls(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];Qd.info("[WebExperiments] "+e,n)}hs(e,t,n){this._is_bot()?qx.ls("Refusing to render web experiment since the viewer is a likely bot"):t!=="control"?n.forEach(r=>{if(r.selector){var o;qx.ls("applying transform of variant "+t+" for experiment "+e+" ",r);var a=(o=document)==null?void 0:o.querySelectorAll(r.selector);a==null||a.forEach(s=>{var l=s;r.html&&(l.innerHTML=r.html),r.css&&l.setAttribute("style",r.css)})}}):qx.ls("Control variants leave the page unmodified.")}_is_bot(){return wb&&this._instance?jbe(wb,this._instance.config.custom_blocked_useragents):void 0}}var Tgt=tx("[PostHog ExternalIntegrations]"),kgt={intercom:"intercom-integration",crispChat:"crisp-chat-integration"};class Pgt{constructor(e){this._instance=e}J(e,t){var n;(n=Kp.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this._instance,e,r=>{if(r)return Tgt.error("failed to load script",r);t()})}startIfEnabledOrStop(){var e=this,t=function(a){var s,l,c;!r||(s=Kp.__PosthogExtensions__)!=null&&(s=s.integrations)!=null&&s[a]||e.J(kgt[a],()=>{var u;(u=Kp.__PosthogExtensions__)==null||(u=u.integrations)==null||(u=u[a])==null||u.start(e._instance)}),!r&&(l=Kp.__PosthogExtensions__)!=null&&(l=l.integrations)!=null&&l[a]&&((c=Kp.__PosthogExtensions__)==null||(c=c.integrations)==null||(c=c[a])==null||c.stop())};for(var[n,r]of Object.entries((o=this._instance.config.integrations)!==null&&o!==void 0?o:{})){var o;t(n)}}}var f8={},FX=()=>{},IM="posthog",qbe=!qpt&&(KE==null?void 0:KE.indexOf("MSIE"))===-1&&(KE==null?void 0:KE.indexOf("Mozilla"))===-1,Zbe=i=>{var e;return{api_host:"https://us.i.posthog.com",ui_host:null,token:"",autocapture:!0,rageclick:!0,cross_subdomain_cookie:S0t(id==null?void 0:id.location),persistence:"localStorage+cookie",persistence_name:"",loaded:FX,save_campaign_params:!0,custom_campaign_params:[],custom_blocked_useragents:[],save_referrer:!0,capture_pageview:i!=="2025-05-24"||"history_change",capture_pageleave:"if_capture_pageview",defaults:i??"unset",debug:VE&&AC(VE==null?void 0:VE.search)&&VE.search.indexOf("__posthog_debug=true")!==-1||!1,cookie_expiration:365,upgrade:!1,disable_session_recording:!1,disable_persistence:!1,disable_web_experiments:!0,disable_surveys:!1,disable_surveys_automatic_display:!1,disable_external_dependency_loading:!1,enable_recording_console_log:void 0,secure_cookie:(Aa==null||(e=Aa.location)==null?void 0:e.protocol)==="https:",ip:!1,opt_out_capturing_by_default:!1,opt_out_persistence_by_default:!1,opt_out_useragent_filter:!1,opt_out_capturing_persistence_type:"localStorage",opt_out_capturing_cookie_prefix:null,opt_in_site_apps:!1,property_denylist:[],respect_dnt:!1,sanitize_properties:null,request_headers:{},request_batching:!0,properties_string_max_length:65535,session_recording:{},mask_all_element_attributes:!1,mask_all_text:!1,mask_personal_data_properties:!1,custom_personal_data_properties:[],advanced_disable_flags:!1,advanced_disable_decide:!1,advanced_disable_feature_flags:!1,advanced_disable_feature_flags_on_first_load:!1,advanced_only_evaluate_survey_feature_flags:!1,advanced_disable_toolbar_metrics:!1,feature_flag_request_timeout_ms:3e3,surveys_request_timeout_ms:1e4,on_request_error:t=>{var n="Bad HTTP status: "+t.statusCode+" "+t.text;Qd.error(n)},get_device_id:t=>t,capture_performance:void 0,name:"posthog",bootstrap:{},disable_compression:!1,session_idle_timeout_seconds:1800,person_profiles:"identified_only",before_send:void 0,request_queue_config:{flush_interval_ms:LX},error_tracking:{},_onCapture:FX}},Xbe=i=>{var e={};Gu(i.process_person)||(e.person_profiles=i.process_person),Gu(i.xhr_headers)||(e.request_headers=i.xhr_headers),Gu(i.cookie_name)||(e.persistence_name=i.cookie_name),Gu(i.disable_cookie)||(e.disable_persistence=i.disable_cookie),Gu(i.store_google)||(e.save_campaign_params=i.store_google),Gu(i.verbose)||(e.debug=i.verbose);var t=RC({},e,i);return wI(i.property_blacklist)&&(Gu(i.property_denylist)?t.property_denylist=i.property_blacklist:wI(i.property_denylist)?t.property_denylist=[...i.property_blacklist,...i.property_denylist]:Qd.error("Invalid value for property_denylist config: "+i.property_denylist)),t};class Ugt{constructor(){this.__forceAllowLocalhost=!1}get ps(){return this.__forceAllowLocalhost}set ps(e){Qd.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=e}}class FU{get decideEndpointWasHit(){var e,t;return(e=(t=this.featureFlags)==null?void 0:t.hasLoadedFlags)!==null&&e!==void 0&&e}get flagsEndpointWasHit(){var e,t;return(e=(t=this.featureFlags)==null?void 0:t.hasLoadedFlags)!==null&&e!==void 0&&e}constructor(){this.webPerformance=new Ugt,this.gs=!1,this.version=PS.LIB_VERSION,this._s=new zbe,this._calculate_event_properties=this.calculateEventProperties.bind(this),this.config=Zbe(),this.SentryIntegration=Fpt,this.sentryIntegration=e=>function(t,n){var r=obe(t,n);return{name:rbe,processEvent:o=>r(o)}}(this,e),this.__request_queue=[],this.__loaded=!1,this.analyticsDefaultEndpoint="/e/",this.bs=!1,this.ys=null,this.ws=null,this.Ss=null,this.featureFlags=new pgt(this),this.toolbar=new Opt(this),this.scrollManager=new bgt(this),this.pageViewManager=new jpt(this),this.surveys=new _gt(this),this.experiments=new qx(this),this.exceptions=new Wpt(this),this.rateLimiter=new vgt(this),this.requestRouter=new Dgt(this),this.consent=new q0t(this),this.externalIntegrations=new Pgt(this),this.people={set:(e,t,n)=>{var r=AC(e)?{[e]:t}:e;this.setPersonProperties(r),n==null||n({})},set_once:(e,t,n)=>{var r=AC(e)?{[e]:t}:e;this.setPersonProperties(void 0,r),n==null||n({})}},this.on("eventCaptured",e=>Qd.info('send "'+(e==null?void 0:e.event)+'"',e))}init(e,t,n){if(n&&n!==IM){var r,o=(r=f8[n])!==null&&r!==void 0?r:new FU;return o._init(e,t,n),f8[n]=o,f8[IM][n]=o,o}return this._init(e,t,n)}_init(e,t,n){var r,o;if(t===void 0&&(t={}),Gu(e)||FZ(e))return Qd.critical("PostHog was initialized without a token. This likely indicates a misconfiguration. Please check the first argument passed to posthog.init()"),this;if(this.__loaded)return Qd.warn("You have already initialized PostHog! Re-initializing is a no-op"),this;this.__loaded=!0,this.config={},this.$s=t,this.ks=[],t.person_profiles&&(this.ws=t.person_profiles),this.set_config(RC({},Zbe(t.defaults),Xbe(t),{name:n,token:e})),this.config.on_xhr_error&&Qd.error("on_xhr_error is deprecated. Use on_request_error instead"),this.compression=t.disable_compression?void 0:US.GZipJS;var a=this.xs();this.persistence=new kX(this.config,a),this.sessionPersistence=this.config.persistence==="sessionStorage"||this.config.persistence==="memory"?this.persistence:new kX(PA({},this.config,{persistence:"sessionStorage"}),a);var s=PA({},this.persistence.props),l=PA({},this.sessionPersistence.props);if(this.register({$initialization_time:new Date().toISOString()}),this.Es=new Cgt(E=>this.Is(E),this.config.request_queue_config),this.Ps=new Egt(this),this.__request_queue=[],this.config.__preview_experimental_cookieless_mode||(this.sessionManager=new wgt(this),this.sessionPropsManager=new Sgt(this,this.sessionManager,this.persistence)),new Hpt(this).startIfEnabledOrStop(),this.siteApps=new Mgt(this),(r=this.siteApps)==null||r.init(),this.config.__preview_experimental_cookieless_mode||(this.sessionRecording=new Upt(this),this.sessionRecording.startIfEnabledOrStop()),this.config.disable_scroll_properties||this.scrollManager.startMeasuringScrollPosition(),this.autocapture=new O0t(this),this.autocapture.startIfEnabled(),this.surveys.loadIfEnabled(),this.heatmaps=new Kpt(this),this.heatmaps.startIfEnabled(),this.webVitalsAutocapture=new Ypt(this),this.exceptionObserver=new W0t(this),this.exceptionObserver.startIfEnabled(),this.deadClicksAutocapture=new QEe(this,X0t),this.deadClicksAutocapture.startIfEnabled(),this.historyAutocapture=new dpt(this),this.historyAutocapture.startIfEnabled(),PS.DEBUG=PS.DEBUG||this.config.debug,PS.DEBUG&&Qd.info("Starting in debug mode",{this:this,config:t,thisC:PA({},this.config),p:s,s:l}),((o=t.bootstrap)==null?void 0:o.distinctID)!==void 0){var c,u,A=this.config.get_device_id(l3()),d=(c=t.bootstrap)!=null&&c.isIdentifiedID?A:t.bootstrap.distinctID;this.persistence.set_property(LS,(u=t.bootstrap)!=null&&u.isIdentifiedID?"identified":"anonymous"),this.register({distinct_id:t.bootstrap.distinctID,$device_id:d})}if(this.Rs()){var f,h,y=Object.keys(((f=t.bootstrap)==null?void 0:f.featureFlags)||{}).filter(E=>{var b;return!((b=t.bootstrap)==null||(b=b.featureFlags)==null||!b[E])}).reduce((E,b)=>{var M;return E[b]=((M=t.bootstrap)==null||(M=M.featureFlags)==null?void 0:M[b])||!1,E},{}),_=Object.keys(((h=t.bootstrap)==null?void 0:h.featureFlagPayloads)||{}).filter(E=>y[E]).reduce((E,b)=>{var M,Y;return(M=t.bootstrap)!=null&&(M=M.featureFlagPayloads)!=null&&M[b]&&(E[b]=(Y=t.bootstrap)==null||(Y=Y.featureFlagPayloads)==null?void 0:Y[b]),E},{});this.featureFlags.receivedFeatureFlags({featureFlags:y,featureFlagPayloads:_})}if(this.config.__preview_experimental_cookieless_mode)this.register_once({distinct_id:gU,$device_id:null},"");else if(!this.get_distinct_id()){var v=this.config.get_device_id(l3());this.register_once({distinct_id:v,$device_id:v},""),this.persistence.set_property(LS,"anonymous")}return LI(Aa,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this),{passive:!1}),this.toolbar.maybeLoadToolbar(),t.segment?Lpt(this,()=>this.Ts()):this.Ts(),n2(this.config._onCapture)&&this.config._onCapture!==FX&&(Qd.warn("onCapture is deprecated. Please use `before_send` instead"),this.on("eventCaptured",E=>this.config._onCapture(E.event,E))),this.config.ip&&Qd.warn('The `ip` config option has NO EFFECT AT ALL and has been deprecated. Use a custom transformation or "Discard IP data" project setting instead. See https://posthog.com/tutorials/web-redact-properties#hiding-customer-ip-address for more information.'),this}Ie(e){var t,n,r,o,a,s,l,c;if(!id||!id.body)return Qd.info("document not ready yet, trying again in 500 milliseconds..."),void setTimeout(()=>{this.Ie(e)},500);this.compression=void 0,e.supportedCompression&&!this.config.disable_compression&&(this.compression=iy(e.supportedCompression,US.GZipJS)?US.GZipJS:iy(e.supportedCompression,US.Base64)?US.Base64:void 0),(t=e.analytics)!=null&&t.endpoint&&(this.analyticsDefaultEndpoint=e.analytics.endpoint),this.set_config({person_profiles:this.ws?this.ws:"identified_only"}),(n=this.siteApps)==null||n.onRemoteConfig(e),(r=this.sessionRecording)==null||r.onRemoteConfig(e),(o=this.autocapture)==null||o.onRemoteConfig(e),(a=this.heatmaps)==null||a.onRemoteConfig(e),this.surveys.onRemoteConfig(e),(s=this.webVitalsAutocapture)==null||s.onRemoteConfig(e),(l=this.exceptionObserver)==null||l.onRemoteConfig(e),this.exceptions.onRemoteConfig(e),(c=this.deadClicksAutocapture)==null||c.onRemoteConfig(e)}Ts(){try{this.config.loaded(this)}catch(e){Qd.critical("`loaded` function failed",e)}this.Ms(),this.config.capture_pageview&&setTimeout(()=>{this.consent.isOptedIn()&&this.Cs()},1),new Igt(this).load(),this.featureFlags.flags()}Ms(){var e;this.has_opted_out_capturing()||this.config.request_batching&&((e=this.Es)==null||e.enable())}_dom_loaded(){this.has_opted_out_capturing()||a3(this.__request_queue,e=>this.Is(e)),this.__request_queue=[],this.Ms()}_handle_unload(){var e,t;this.config.request_batching?(this.Fs()&&this.capture("$pageleave"),(e=this.Es)==null||e.unload(),(t=this.Ps)==null||t.unload()):this.Fs()&&this.capture("$pageleave",null,{transport:"sendBeacon"})}Ee(e){this.__loaded&&(qbe?this.__request_queue.push(e):this.rateLimiter.isServerRateLimited(e.batchKey)||(e.transport=e.transport||this.config.api_transport,e.url=TU(e.url,{ip:this.config.ip?1:0}),e.headers=PA({},this.config.request_headers),e.compression=e.compression==="best-available"?this.compression:e.compression,e.fetchOptions=e.fetchOptions||this.config.fetch_options,(t=>{var n,r,o,a=PA({},t);a.timeout=a.timeout||6e4,a.url=TU(a.url,{_:new Date().getTime().toString(),ver:PS.LIB_VERSION,compression:a.compression});var s=(n=a.transport)!==null&&n!==void 0?n:"fetch",l=(r=(o=Zxe(o8,c=>c.transport===s))==null?void 0:o.method)!==null&&r!==void 0?r:o8[0].method;if(!l)throw new Error("No available transport method");l(a)})(PA({},e,{callback:t=>{var n,r;this.rateLimiter.checkForLimiting(t),t.statusCode>=400&&((n=(r=this.config).on_request_error)==null||n.call(r,t)),e.callback==null||e.callback(t)}}))))}Is(e){this.Ps?this.Ps.retriableRequest(e):this.Ee(e)}_execute_array(e){var t,n=[],r=[],o=[];a3(e,s=>{s&&(t=s[0],wI(t)?o.push(s):n2(s)?s.call(this):wI(s)&&t==="alias"?n.push(s):wI(s)&&t.indexOf("capture")!==-1&&n2(this[t])?o.push(s):r.push(s))});var a=function(s,l){a3(s,function(c){if(wI(c[0])){var u=l;nv(c,function(A){u=u[A[0]].apply(u,A.slice(1))})}else this[c[0]].apply(this,c.slice(1))},l)};a(n,this),a(r,this),a(o,this)}Rs(){var e,t;return((e=this.config.bootstrap)==null?void 0:e.featureFlags)&&Object.keys((t=this.config.bootstrap)==null?void 0:t.featureFlags).length>0||!1}push(e){this._execute_array([e])}capture(e,t,n){var r;if(this.__loaded&&this.persistence&&this.sessionPersistence&&this.Es){if(!this.consent.isOptedOut())if(!Gu(e)&&AC(e)){if(this.config.opt_out_useragent_filter||!this._is_bot()){var o=n!=null&&n.skip_client_rate_limiting?void 0:this.rateLimiter.clientRateLimitContext();if(o==null||!o.isRateLimited){t!=null&&t.$current_url&&!AC(t==null?void 0:t.$current_url)&&(Qd.error("Invalid `$current_url` property provided to `posthog.capture`. Input must be a string. Ignoring provided value."),t==null||delete t.$current_url),this.sessionPersistence.update_search_keyword(),this.config.save_campaign_params&&this.sessionPersistence.update_campaign_params(),this.config.save_referrer&&this.sessionPersistence.update_referrer_info(),(this.config.save_campaign_params||this.config.save_referrer)&&this.persistence.set_initial_person_info();var a=new Date,s=(n==null?void 0:n.timestamp)||a,l=l3(),c={uuid:l,event:e,properties:this.calculateEventProperties(e,t||{},s,l)};o&&(c.properties.$lib_rate_limit_remaining_tokens=o.remainingTokens),n!=null&&n.$set&&(c.$set=n==null?void 0:n.$set);var u,A,d=this.Os(n==null?void 0:n.$set_once);if(d&&(c.$set_once=d),(c=b0t(c,n!=null&&n._noTruncate?null:this.config.properties_string_max_length)).timestamp=s,Gu(n==null?void 0:n.timestamp)||(c.properties.$event_time_override_provided=!0,c.properties.$event_time_override_system_time=a),e===UX.DISMISSED||e===UX.SENT){var f=t==null?void 0:t[Hbe.SURVEY_ID],h=t==null?void 0:t[Hbe.SURVEY_ITERATION];localStorage.setItem((A=""+PX+(u={id:f,current_iteration:h}).id,u.current_iteration&&u.current_iteration>0&&(A=""+PX+u.id+"_"+u.current_iteration),A),"true"),c.$set=PA({},c.$set,{[mgt({id:f,current_iteration:h},e===UX.SENT?"responded":"dismissed")]:!0})}var y=PA({},c.properties.$set,c.$set);if(cM(y)||this.setPersonPropertiesForFlags(y),!o_(this.config.before_send)){var _=this.As(c);if(!_)return;c=_}this._s.emit("eventCaptured",c);var v={method:"POST",url:(r=n==null?void 0:n._url)!==null&&r!==void 0?r:this.requestRouter.endpointFor("api",this.analyticsDefaultEndpoint),data:c,compression:"best-available",batchKey:n==null?void 0:n._batchKey};return!this.config.request_batching||n&&(n==null||!n._batchKey)||n!=null&&n.send_instantly?this.Is(v):this.Es.enqueue(v),c}Qd.critical("This capture call is ignored due to client rate limiting.")}}else Qd.error("No event name provided to posthog.capture")}else Qd.uninitializedWarning("posthog.capture")}Ge(e){return this.on("eventCaptured",t=>e(t.event,t))}calculateEventProperties(e,t,n,r,o){if(n=n||new Date,!this.persistence||!this.sessionPersistence)return t;var a=o?void 0:this.persistence.remove_event_timer(e),s=PA({},t);if(s.token=this.config.token,s.$config_defaults=this.config.defaults,this.config.__preview_experimental_cookieless_mode&&(s.$cookieless_mode=!0),e==="$snapshot"){var l=PA({},this.persistence.properties(),this.sessionPersistence.properties());return s.distinct_id=l.distinct_id,(!AC(s.distinct_id)&&!Kx(s.distinct_id)||FZ(s.distinct_id))&&Qd.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),s}var c,u=dgt(this.config.mask_personal_data_properties,this.config.custom_personal_data_properties);if(this.sessionManager){var{sessionId:A,windowId:d}=this.sessionManager.checkAndGetSessionAndWindowId(o,n.getTime());s.$session_id=A,s.$window_id=d}this.sessionPropsManager&&RC(s,this.sessionPropsManager.getSessionProps());try{var f;this.sessionRecording&&RC(s,this.sessionRecording.sdkDebugProperties),s.$sdk_debug_retry_queue_size=(f=this.Ps)==null?void 0:f.length}catch(v){s.$sdk_debug_error_capturing_properties=String(v)}if(this.requestRouter.region===d8.CUSTOM&&(s.$lib_custom_api_host=this.config.api_host),c=e!=="$pageview"||o?e!=="$pageleave"||o?this.pageViewManager.doEvent():this.pageViewManager.doPageLeave(n):this.pageViewManager.doPageView(n,r),s=RC(s,c),e==="$pageview"&&id&&(s.title=id.title),!Gu(a)){var h=n.getTime()-a;s.$duration=parseFloat((h/1e3).toFixed(3))}KE&&this.config.opt_out_useragent_filter&&(s.$browser_type=this._is_bot()?"bot":"browser"),(s=RC({},u,this.persistence.properties(),this.sessionPersistence.properties(),s)).$is_identified=this._isIdentified(),wI(this.config.property_denylist)?nv(this.config.property_denylist,function(v){delete s[v]}):Qd.error("Invalid value for property_denylist config: "+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);var y=this.config.sanitize_properties;y&&(Qd.error("sanitize_properties is deprecated. Use before_send instead"),s=y(s,e));var _=this.Ds();return s.$process_person_profile=_,_&&!o&&this.Ls("_calculate_event_properties"),s}Os(e){var t;if(!this.persistence||!this.Ds()||this.gs)return e;var n=this.persistence.get_initial_props(),r=(t=this.sessionPropsManager)==null?void 0:t.getSetOnceProps(),o=RC({},n,r||{},e||{}),a=this.config.sanitize_properties;return a&&(Qd.error("sanitize_properties is deprecated. Use before_send instead"),o=a(o,"$set_once")),this.gs=!0,cM(o)?void 0:o}register(e,t){var n;(n=this.persistence)==null||n.register(e,t)}register_once(e,t,n){var r;(r=this.persistence)==null||r.register_once(e,t,n)}register_for_session(e){var t;(t=this.sessionPersistence)==null||t.register(e)}unregister(e){var t;(t=this.persistence)==null||t.unregister(e)}unregister_for_session(e){var t;(t=this.sessionPersistence)==null||t.unregister(e)}js(e,t){this.register({[e]:t})}getFeatureFlag(e,t){return this.featureFlags.getFeatureFlag(e,t)}getFeatureFlagPayload(e){var t=this.featureFlags.getFeatureFlagPayload(e);try{return JSON.parse(t)}catch{return t}}isFeatureEnabled(e,t){return this.featureFlags.isFeatureEnabled(e,t)}reloadFeatureFlags(){this.featureFlags.reloadFeatureFlags()}updateEarlyAccessFeatureEnrollment(e,t){this.featureFlags.updateEarlyAccessFeatureEnrollment(e,t)}getEarlyAccessFeatures(e,t,n){return t===void 0&&(t=!1),this.featureFlags.getEarlyAccessFeatures(e,t,n)}on(e,t){return this._s.on(e,t)}onFeatureFlags(e){return this.featureFlags.onFeatureFlags(e)}onSurveysLoaded(e){return this.surveys.onSurveysLoaded(e)}onSessionId(e){var t,n;return(t=(n=this.sessionManager)==null?void 0:n.onSessionId(e))!==null&&t!==void 0?t:()=>{}}getSurveys(e,t){t===void 0&&(t=!1),this.surveys.getSurveys(e,t)}getActiveMatchingSurveys(e,t){t===void 0&&(t=!1),this.surveys.getActiveMatchingSurveys(e,t)}renderSurvey(e,t){this.surveys.renderSurvey(e,t)}canRenderSurvey(e){return this.surveys.canRenderSurvey(e)}canRenderSurveyAsync(e,t){return t===void 0&&(t=!1),this.surveys.canRenderSurveyAsync(e,t)}identify(e,t,n){if(!this.__loaded||!this.persistence)return Qd.uninitializedWarning("posthog.identify");if(Kx(e)&&(e=e.toString(),Qd.warn("The first argument to posthog.identify was a number, but it should be a string. It has been converted to a string.")),e)if(["distinct_id","distinctid"].includes(e.toLowerCase()))Qd.critical('The string "'+e+'" was set in posthog.identify which indicates an error. This ID should be unique to the user and not a hardcoded string.');else if(e!==gU){if(this.Ls("posthog.identify")){var r=this.get_distinct_id();if(this.register({$user_id:e}),!this.get_property("$device_id")){var o=r;this.register_once({$had_persisted_distinct_id:!0,$device_id:o},"")}e!==r&&e!==this.get_property(qN)&&(this.unregister(qN),this.register({distinct_id:e}));var a=(this.persistence.get_property(LS)||"anonymous")==="anonymous";e!==r&&a?(this.persistence.set_property(LS,"identified"),this.setPersonPropertiesForFlags(PA({},n||{},t||{}),!1),this.capture("$identify",{distinct_id:e,$anon_distinct_id:r},{$set:t||{},$set_once:n||{}}),this.Ss=Abe(e,t,n),this.featureFlags.setAnonymousDistinctId(r)):(t||n)&&this.setPersonProperties(t,n),e!==r&&(this.reloadFeatureFlags(),this.unregister(fU))}}else Qd.critical('The string "'+gU+'" was set in posthog.identify which indicates an error. This ID is only used as a sentinel value.');else Qd.error("Unique user id has not been set in posthog.identify")}setPersonProperties(e,t){if((e||t)&&this.Ls("posthog.setPersonProperties")){var n=Abe(this.get_distinct_id(),e,t);this.Ss!==n?(this.setPersonPropertiesForFlags(PA({},t||{},e||{})),this.capture("$set",{$set:e||{},$set_once:t||{}}),this.Ss=n):Qd.info("A duplicate setPersonProperties call was made with the same properties. It has been ignored.")}}group(e,t,n){if(e&&t){if(this.Ls("posthog.group")){var r=this.getGroups();r[e]!==t&&this.resetGroupPropertiesForFlags(e),this.register({$groups:PA({},r,{[e]:t})}),n&&(this.capture("$groupidentify",{$group_type:e,$group_key:t,$group_set:n}),this.setGroupPropertiesForFlags({[e]:n})),r[e]===t||n||this.reloadFeatureFlags()}}else Qd.error("posthog.group requires a group type and group key")}resetGroups(){this.register({$groups:{}}),this.resetGroupPropertiesForFlags(),this.reloadFeatureFlags()}setPersonPropertiesForFlags(e,t){t===void 0&&(t=!0),this.featureFlags.setPersonPropertiesForFlags(e,t)}resetPersonPropertiesForFlags(){this.featureFlags.resetPersonPropertiesForFlags()}setGroupPropertiesForFlags(e,t){t===void 0&&(t=!0),this.Ls("posthog.setGroupPropertiesForFlags")&&this.featureFlags.setGroupPropertiesForFlags(e,t)}resetGroupPropertiesForFlags(e){this.featureFlags.resetGroupPropertiesForFlags(e)}reset(e){var t,n,r,o;if(Qd.info("reset"),!this.__loaded)return Qd.uninitializedWarning("posthog.reset");var a=this.get_property("$device_id");if(this.consent.reset(),(t=this.persistence)==null||t.clear(),(n=this.sessionPersistence)==null||n.clear(),this.surveys.reset(),this.featureFlags.reset(),(r=this.persistence)==null||r.set_property(LS,"anonymous"),(o=this.sessionManager)==null||o.resetSessionId(),this.Ss=null,this.config.__preview_experimental_cookieless_mode)this.register_once({distinct_id:gU,$device_id:null},"");else{var s=this.config.get_device_id(l3());this.register_once({distinct_id:s,$device_id:e?s:a},"")}this.register({$last_posthog_reset:new Date().toISOString()},1)}get_distinct_id(){return this.get_property("distinct_id")}getGroups(){return this.get_property("$groups")||{}}get_session_id(){var e,t;return(e=(t=this.sessionManager)==null?void 0:t.checkAndGetSessionAndWindowId(!0).sessionId)!==null&&e!==void 0?e:""}get_session_replay_url(e){if(!this.sessionManager)return"";var{sessionId:t,sessionStartTimestamp:n}=this.sessionManager.checkAndGetSessionAndWindowId(!0),r=this.requestRouter.endpointFor("ui","/project/"+this.config.token+"/replay/"+t);if(e!=null&&e.withTimestamp&&n){var o,a=(o=e.timestampLookBack)!==null&&o!==void 0?o:10;if(!n)return r;r+="?t="+Math.max(Math.floor((new Date().getTime()-n)/1e3)-a,0)}return r}alias(e,t){return e===this.get_property(Xxe)?(Qd.critical("Attempting to create alias for existing People user - aborting."),-2):this.Ls("posthog.alias")?(Gu(t)&&(t=this.get_distinct_id()),e!==t?(this.js(qN,e),this.capture("$create_alias",{alias:e,distinct_id:t})):(Qd.warn("alias matches current distinct_id - skipping api call."),this.identify(e),-1)):void 0}set_config(e){var t=PA({},this.config);if(uC(e)){var n,r,o,a,s;RC(this.config,Xbe(e));var l=this.xs();(n=this.persistence)==null||n.update_config(this.config,t,l),this.sessionPersistence=this.config.persistence==="sessionStorage"||this.config.persistence==="memory"?this.persistence:new kX(PA({},this.config,{persistence:"sessionStorage"}),l),y9.O()&&y9.D("ph_debug")==="true"&&(this.config.debug=!0),this.config.debug&&(PS.DEBUG=!0,Qd.info("set_config",{config:e,oldConfig:t,newConfig:PA({},this.config)})),(r=this.sessionRecording)==null||r.startIfEnabledOrStop(),(o=this.autocapture)==null||o.startIfEnabled(),(a=this.heatmaps)==null||a.startIfEnabled(),this.surveys.loadIfEnabled(),this.Ns(),(s=this.externalIntegrations)==null||s.startIfEnabledOrStop()}}startSessionRecording(e){var t=e===!0,n={sampling:t||!(e==null||!e.sampling),linked_flag:t||!(e==null||!e.linked_flag),url_trigger:t||!(e==null||!e.url_trigger),event_trigger:t||!(e==null||!e.event_trigger)};if(Object.values(n).some(Boolean)){var r,o,a,s,l;(r=this.sessionManager)==null||r.checkAndGetSessionAndWindowId(),n.sampling&&((o=this.sessionRecording)==null||o.overrideSampling()),n.linked_flag&&((a=this.sessionRecording)==null||a.overrideLinkedFlag()),n.url_trigger&&((s=this.sessionRecording)==null||s.overrideTrigger("url")),n.event_trigger&&((l=this.sessionRecording)==null||l.overrideTrigger("event"))}this.set_config({disable_session_recording:!1})}stopSessionRecording(){this.set_config({disable_session_recording:!0})}sessionRecordingStarted(){var e;return!((e=this.sessionRecording)==null||!e.started)}captureException(e,t){var n=new Error("PostHog syntheticException");return this.exceptions.sendExceptionEvent(PA({},Apt((r=>r instanceof Error)(e)?{error:e,event:e.message}:{event:e},{syntheticException:n}),t))}loadToolbar(e){return this.toolbar.loadToolbar(e)}get_property(e){var t;return(t=this.persistence)==null?void 0:t.props[e]}getSessionProperty(e){var t;return(t=this.sessionPersistence)==null?void 0:t.props[e]}toString(){var e,t=(e=this.config.name)!==null&&e!==void 0?e:IM;return t!==IM&&(t=IM+"."+t),t}_isIdentified(){var e,t;return((e=this.persistence)==null?void 0:e.get_property(LS))==="identified"||((t=this.sessionPersistence)==null?void 0:t.get_property(LS))==="identified"}Ds(){var e,t;return!(this.config.person_profiles==="never"||this.config.person_profiles==="identified_only"&&!this._isIdentified()&&cM(this.getGroups())&&((e=this.persistence)==null||(e=e.props)==null||!e[qN])&&((t=this.persistence)==null||(t=t.props)==null||!t[pU]))}Fs(){return this.config.capture_pageleave===!0||this.config.capture_pageleave==="if_capture_pageview"&&(this.config.capture_pageview===!0||this.config.capture_pageview==="history_change")}createPersonProfile(){this.Ds()||this.Ls("posthog.createPersonProfile")&&this.setPersonProperties({},{})}Ls(e){return this.config.person_profiles==="never"?(Qd.error(e+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this.js(pU,!0),!0)}xs(){var e=this.consent.isOptedOut(),t=this.config.opt_out_persistence_by_default;return this.config.disable_persistence||e&&!!t}Ns(){var e,t,n,r,o=this.xs();return((e=this.persistence)==null?void 0:e.Fe)!==o&&((n=this.persistence)==null||n.set_disabled(o)),((t=this.sessionPersistence)==null?void 0:t.Fe)!==o&&((r=this.sessionPersistence)==null||r.set_disabled(o)),o}opt_in_capturing(e){var t;this.consent.optInOut(!0),this.Ns(),(Gu(e==null?void 0:e.captureEventName)||e!=null&&e.captureEventName)&&this.capture((t=e==null?void 0:e.captureEventName)!==null&&t!==void 0?t:"$opt_in",e==null?void 0:e.captureProperties,{send_instantly:!0}),this.config.capture_pageview&&this.Cs()}opt_out_capturing(){this.consent.optInOut(!1),this.Ns()}has_opted_in_capturing(){return this.consent.isOptedIn()}has_opted_out_capturing(){return this.consent.isOptedOut()}clear_opt_in_out_capturing(){this.consent.reset(),this.Ns()}_is_bot(){return wb?jbe(wb,this.config.custom_blocked_useragents):void 0}Cs(){id&&(id.visibilityState==="visible"?this.bs||(this.bs=!0,this.capture("$pageview",{title:id.title},{send_instantly:!0}),this.ys&&(id.removeEventListener("visibilitychange",this.ys),this.ys=null)):this.ys||(this.ys=this.Cs.bind(this),LI(id,"visibilitychange",this.ys)))}debug(e){e===!1?(Aa==null||Aa.console.log("You've disabled debug mode."),localStorage&&localStorage.removeItem("ph_debug"),this.set_config({debug:!1})):(Aa==null||Aa.console.log("You're now in debug mode. All calls to PostHog will be logged in your console.\nYou can disable this with `posthog.debug(false)`."),localStorage&&localStorage.setItem("ph_debug","true"),this.set_config({debug:!0}))}I(){var e,t,n,r,o,a,s,l=this.$s||{};return"advanced_disable_flags"in l?!!l.advanced_disable_flags:this.config.advanced_disable_flags!==!1?!!this.config.advanced_disable_flags:this.config.advanced_disable_decide===!0?(Qd.warn("Config field 'advanced_disable_decide' is deprecated. Please use 'advanced_disable_flags' instead. The old field will be removed in a future major version."),!0):(n="advanced_disable_decide",r=!1,o=Qd,a=(t="advanced_disable_flags")in(e=l)&&!Gu(e[t]),s=n in e&&!Gu(e[n]),a?e[t]:s?(o&&o.warn("Config field '"+n+"' is deprecated. Please use '"+t+"' instead. The old field will be removed in a future major version."),e[n]):r)}As(e){if(o_(this.config.before_send))return e;var t=wI(this.config.before_send)?this.config.before_send:[this.config.before_send],n=e;for(var r of t){if(n=r(n),o_(n)){var o="Event '"+e.event+"' was rejected in beforeSend function";return C0t(e.event)?Qd.warn(o+". This can cause unexpected behavior."):Qd.info(o),null}n.properties&&!cM(n.properties)||Qd.warn("Event '"+e.event+"' has no properties after beforeSend function, this is likely an error.")}return n}getPageViewId(){var e;return(e=this.pageViewManager.ce)==null?void 0:e.pageViewId}captureTraceFeedback(e,t){this.capture("$ai_feedback",{$ai_trace_id:String(e),$ai_feedback_text:t})}captureTraceMetric(e,t,n){this.capture("$ai_metric",{$ai_trace_id:String(e),$ai_metric_name:t,$ai_metric_value:String(n)})}}(function(i,e){for(var t=0;t<e.length;t++)i.prototype[e[t]]=E0t(i.prototype[e[t]])})(FU,["identify"]);var Wbe,GU=(Wbe=f8[IM]=new FU,function(){function i(){i.done||(i.done=!0,qbe=!1,nv(f8,function(e){e._dom_loaded()}))}id!=null&&id.addEventListener?id.readyState==="complete"?i():LI(id,"DOMContentLoaded",i,{capture:!1}):Aa&&Qd.error("Browser doesn't support `document.addEventListener` so PostHog couldn't be initialized")}(),Wbe);!window.location.hostname.includes("localhost")&&!window.location.hostname.includes("127.0.0.1")&&(GU.__loaded||GU.init("phc_htd8AQjSfVEsFCLQMAiUooG4Q0DKBCjqYuQglc9V3Wo",{api_host:"https://postpig.tscircuit.com",person_profiles:"always"}));function Lgt(i){const e=String.fromCodePoint(...i);return btoa(e)}var Mb=Uint8Array,Rb=Uint16Array,GX=Int32Array,OX=new Mb([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),zX=new Mb([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),$be=new Mb([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),e2e=function(i,e){for(var t=new Rb(31),n=0;n<31;++n)t[n]=e+=1<<i[n-1];for(var r=new GX(t[30]),n=1;n<30;++n)for(var o=t[n];o<t[n+1];++o)r[o]=o-t[n]<<5|n;return{b:t,r}},t2e=e2e(OX,2),Fgt=t2e.b,HX=t2e.r;Fgt[28]=258,HX[258]=28;for(var Ggt=e2e(zX,0),n2e=Ggt.r,YX=new Rb(32768),AI=0;AI<32768;++AI){var f3=(AI&43690)>>1|(AI&21845)<<1;f3=(f3&52428)>>2|(f3&13107)<<2,f3=(f3&61680)>>4|(f3&3855)<<4,YX[AI]=((f3&65280)>>8|(f3&255)<<8)>>1}for(var h8=function(i,e,t){for(var n=i.length,r=0,o=new Rb(e);r<n;++r)i[r]&&++o[i[r]-1];var a=new Rb(e);for(r=1;r<e;++r)a[r]=a[r-1]+o[r-1]<<1;var s;if(t){s=new Rb(1<<e);var l=15-e;for(r=0;r<n;++r)if(i[r])for(var c=r<<4|i[r],u=e-i[r],A=a[i[r]-1]++<<u,d=A|(1<<u)-1;A<=d;++A)s[YX[A]>>l]=c}else for(s=new Rb(n),r=0;r<n;++r)i[r]&&(s[r]=YX[a[i[r]-1]++]>>15-i[r]);return s},Zw=new Mb(288),AI=0;AI<144;++AI)Zw[AI]=8;for(var AI=144;AI<256;++AI)Zw[AI]=9;for(var AI=256;AI<280;++AI)Zw[AI]=7;for(var AI=280;AI<288;++AI)Zw[AI]=8;for(var OU=new Mb(32),AI=0;AI<32;++AI)OU[AI]=5;var Ogt=h8(Zw,9,0),zgt=h8(OU,5,0),i2e=function(i){return(i+7)/8|0},r2e=function(i,e,t){return(t==null||t>i.length)&&(t=i.length),new Mb(i.subarray(e,t))},OS=function(i,e,t){t<<=e&7;var n=e/8|0;i[n]|=t,i[n+1]|=t>>8},p8=function(i,e,t){t<<=e&7;var n=e/8|0;i[n]|=t,i[n+1]|=t>>8,i[n+2]|=t>>16},VX=function(i,e){for(var t=[],n=0;n<i.length;++n)i[n]&&t.push({s:n,f:i[n]});var r=t.length,o=t.slice();if(!r)return{t:l2e,l:0};if(r==1){var a=new Mb(t[0].s+1);return a[t[0].s]=1,{t:a,l:1}}t.sort(function(Y,G){return Y.f-G.f}),t.push({s:-1,f:25001});var s=t[0],l=t[1],c=0,u=1,A=2;for(t[0]={s:-1,f:s.f+l.f,l:s,r:l};u!=r-1;)s=t[t[c].f<t[A].f?c++:A++],l=t[c!=u&&t[c].f<t[A].f?c++:A++],t[u++]={s:-1,f:s.f+l.f,l:s,r:l};for(var d=o[0].s,n=1;n<r;++n)o[n].s>d&&(d=o[n].s);var f=new Rb(d+1),h=KX(t[u-1],f,0);if(h>e){var n=0,y=0,_=h-e,v=1<<_;for(o.sort(function(G,F){return f[F.s]-f[G.s]||G.f-F.f});n<r;++n){var E=o[n].s;if(f[E]>e)y+=v-(1<<h-f[E]),f[E]=e;else break}for(y>>=_;y>0;){var b=o[n].s;f[b]<e?y-=1<<e-f[b]++-1:++n}for(;n>=0&&y;--n){var M=o[n].s;f[M]==e&&(--f[M],++y)}h=e}return{t:new Mb(f),l:h}},KX=function(i,e,t){return i.s==-1?Math.max(KX(i.l,e,t+1),KX(i.r,e,t+1)):e[i.s]=t},o2e=function(i){for(var e=i.length;e&&!i[--e];);for(var t=new Rb(++e),n=0,r=i[0],o=1,a=function(l){t[n++]=l},s=1;s<=e;++s)if(i[s]==r&&s!=e)++o;else{if(!r&&o>2){for(;o>138;o-=138)a(32754);o>2&&(a(o>10?o-11<<5|28690:o-3<<5|12305),o=0)}else if(o>3){for(a(r),--o;o>6;o-=6)a(8304);o>2&&(a(o-3<<5|8208),o=0)}for(;o--;)a(r);o=1,r=i[s]}return{c:t.subarray(0,n),n:e}},g8=function(i,e){for(var t=0,n=0;n<e.length;++n)t+=i[n]*e[n];return t},a2e=function(i,e,t){var n=t.length,r=i2e(e+2);i[r]=n&255,i[r+1]=n>>8,i[r+2]=i[r]^255,i[r+3]=i[r+1]^255;for(var o=0;o<n;++o)i[r+o+4]=t[o];return(r+4+n)*8},s2e=function(i,e,t,n,r,o,a,s,l,c,u){OS(e,u++,t),++r[256];for(var A=VX(r,15),d=A.t,f=A.l,h=VX(o,15),y=h.t,_=h.l,v=o2e(d),E=v.c,b=v.n,M=o2e(y),Y=M.c,G=M.n,F=new Rb(19),L=0;L<E.length;++L)++F[E[L]&31];for(var L=0;L<Y.length;++L)++F[Y[L]&31];for(var V=VX(F,7),O=V.t,re=V.l,Z=19;Z>4&&!O[$be[Z-1]];--Z);var se=c+5<<3,ye=g8(r,Zw)+g8(o,OU)+a,xe=g8(r,d)+g8(o,y)+a+14+3*Z+g8(F,O)+2*F[16]+3*F[17]+7*F[18];if(l>=0&&se<=ye&&se<=xe)return a2e(e,u,i.subarray(l,l+c));var de,Ie,_e,Ne;if(OS(e,u,1+(xe<ye)),u+=2,xe<ye){de=h8(d,f,0),Ie=d,_e=h8(y,_,0),Ne=y;var Pe=h8(O,re,0);OS(e,u,b-257),OS(e,u+5,G-1),OS(e,u+10,Z-4),u+=14;for(var L=0;L<Z;++L)OS(e,u+3*L,O[$be[L]]);u+=3*Z;for(var Le=[E,Y],ke=0;ke<2;++ke)for(var rt=Le[ke],L=0;L<rt.length;++L){var st=rt[L]&31;OS(e,u,Pe[st]),u+=O[st],st>15&&(OS(e,u,rt[L]>>5&127),u+=rt[L]>>12)}}else de=Ogt,Ie=Zw,_e=zgt,Ne=OU;for(var L=0;L<s;++L){var pt=n[L];if(pt>255){var st=pt>>18&31;p8(e,u,de[st+257]),u+=Ie[st+257],st>7&&(OS(e,u,pt>>23&31),u+=OX[st]);var Qt=pt&31;p8(e,u,_e[Qt]),u+=Ne[Qt],Qt>3&&(p8(e,u,pt>>5&8191),u+=zX[Qt])}else p8(e,u,de[pt]),u+=Ie[pt]}return p8(e,u,de[256]),u+Ie[256]},Hgt=new GX([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),l2e=new Mb(0),Ygt=function(i,e,t,n,r,o){var a=o.z||i.length,s=new Mb(n+a+5*(1+Math.ceil(a/7e3))+r),l=s.subarray(n,s.length-r),c=o.l,u=(o.r||0)&7;if(e){u&&(l[0]=o.r>>3);for(var A=Hgt[e-1],d=A>>13,f=A&8191,h=(1<<t)-1,y=o.p||new Rb(32768),_=o.h||new Rb(h+1),v=Math.ceil(t/3),E=2*v,b=function(St){return(i[St]^i[St+1]<<v^i[St+2]<<E)&h},M=new GX(25e3),Y=new Rb(288),G=new Rb(32),F=0,L=0,V=o.i||0,O=0,re=o.w||0,Z=0;V+2<a;++V){var se=b(V),ye=V&32767,xe=_[se];if(y[ye]=xe,_[se]=ye,re<=V){var de=a-V;if((F>7e3||O>24576)&&(de>423||!c)){u=s2e(i,l,0,M,Y,G,L,O,Z,V-Z,u),O=F=L=0,Z=V;for(var Ie=0;Ie<286;++Ie)Y[Ie]=0;for(var Ie=0;Ie<30;++Ie)G[Ie]=0}var _e=2,Ne=0,Pe=f,Le=ye-xe&32767;if(de>2&&se==b(V-Le))for(var ke=Math.min(d,de)-1,rt=Math.min(32767,V),st=Math.min(258,de);Le<=rt&&--Pe&&ye!=xe;){if(i[V+_e]==i[V+_e-Le]){for(var pt=0;pt<st&&i[V+pt]==i[V+pt-Le];++pt);if(pt>_e){if(_e=pt,Ne=Le,pt>ke)break;for(var Qt=Math.min(Le,pt-2),Ft=0,Ie=0;Ie<Qt;++Ie){var wt=V-Le+Ie&32767,He=y[wt],at=wt-He&32767;at>Ft&&(Ft=at,xe=wt)}}}ye=xe,xe=y[ye],Le+=ye-xe&32767}if(Ne){M[O++]=268435456|HX[_e]<<18|n2e[Ne];var dt=HX[_e]&31,Et=n2e[Ne]&31;L+=OX[dt]+zX[Et],++Y[257+dt],++G[Et],re=V+_e,++F}else M[O++]=i[V],++Y[i[V]]}}for(V=Math.max(V,re);V<a;++V)M[O++]=i[V],++Y[i[V]];u=s2e(i,l,c,M,Y,G,L,O,Z,V-Z,u),c||(o.r=u&7|l[u/8|0]<<3,u-=7,o.h=_,o.p=y,o.i=V,o.w=re)}else{for(var V=o.w||0;V<a+c;V+=65535){var Lt=V+65535;Lt>=a&&(l[u/8|0]=c,Lt=a),u=a2e(l,u+1,i.subarray(V,Lt))}o.i=a}return r2e(s,0,n+i2e(u)+r)},Vgt=function(){for(var i=new Int32Array(256),e=0;e<256;++e){for(var t=e,n=9;--n;)t=(t&1&&-306674912)^t>>>1;i[e]=t}return i}(),Kgt=function(){var i=-1;return{p:function(e){for(var t=i,n=0;n<e.length;++n)t=Vgt[t&255^e[n]]^t>>>8;i=t},d:function(){return~i}}},jgt=function(i,e,t,n,r){if(!r&&(r={l:1},e.dictionary)){var o=e.dictionary.subarray(-32768),a=new Mb(o.length+i.length);a.set(o),a.set(i,o.length),i=a,r.w=o.length}return Ygt(i,e.level==null?6:e.level,e.mem==null?r.l?Math.ceil(Math.max(8,Math.min(13,Math.log(i.length)))*1.5):20:12+e.mem,t,n,r)},jX=function(i,e,t){for(;t;++e)i[e]=t,t>>>=8},Jgt=function(i,e){var t=e.filename;if(i[0]=31,i[1]=139,i[2]=8,i[8]=e.level<2?4:e.level==9?2:0,i[9]=3,e.mtime!=0&&jX(i,4,Math.floor(new Date(e.mtime||Date.now())/1e3)),t){i[3]=8;for(var n=0;n<=t.length;++n)i[n+10]=t.charCodeAt(n)}},qgt=function(i){return 10+(i.filename?i.filename.length+1:0)};function c2e(i,e){e||(e={});var t=Kgt(),n=i.length;t.p(i);var r=jgt(i,e,qgt(e),8),o=r.length;return Jgt(r,e),jX(r,o-8,t.d()),jX(r,o-4,n),r}var u2e=typeof TextEncoder<"u"&&new TextEncoder,Zgt=typeof TextDecoder<"u"&&new TextDecoder,Xgt=0;try{Zgt.decode(l2e,{stream:!0}),Xgt=1}catch{}function A2e(i,e){var t;if(u2e)return u2e.encode(i);for(var n=i.length,r=new Mb(i.length+(i.length>>1)),o=0,a=function(c){r[o++]=c},t=0;t<n;++t){if(o+5>r.length){var s=new Mb(o+8+(n-t<<1));s.set(r),r=s}var l=i.charCodeAt(t);l<128||e?a(l):l<2048?(a(192|l>>6),a(128|l&63)):l>55295&&l<57344?(l=65536+(l&1047552)|i.charCodeAt(++t)&1023,a(240|l>>18),a(128|l>>12&63),a(128|l>>6&63),a(128|l&63)):(a(224|l>>12),a(128|l>>6&63),a(128|l&63))}return r2e(r,0,o)}function Wgt(i,e){const t=JSON.stringify(i),n=c2e(A2e(t)),r=Lgt(n);return`${window.location.origin}/editor?#data:application/gzip;base64,${r}`}function bv(...i){return m0t(xB(i))}const d2e=i=>i.replace(/_/g," ").replace(/\b\w/g,e=>e.toUpperCase()),$gt=Ght,f2e=Nt.forwardRef(({className:i,...e},t)=>Ct.jsx(Qxe,{ref:t,className:bv("rf-inline-flex rf-h-9 rf-items-center rf-justify-center rf-rounded-lg rf-bg-zinc-100 rf-p-1 rf-text-zinc-500 dark:rf-bg-zinc-800 dark:rf-text-zinc-400",i),...e}));f2e.displayName=Qxe.displayName;const CM=Nt.forwardRef(({className:i,...e},t)=>Ct.jsx(Mxe,{ref:t,className:bv("rf-inline-flex rf-items-center rf-justify-center rf-whitespace-nowrap rf-rounded-md rf-px-3 rf-py-1 rf-text-sm rf-font-medium rf-ring-offset-white rf-transition-all focus-visible:rf-outline-none focus-visible:rf-ring-2 focus-visible:rf-ring-zinc-950 focus-visible:rf-ring-offset-2 disabled:rf-pointer-events-none disabled:rf-opacity-50 data-[state=active]:rf-bg-white data-[state=active]:rf-text-zinc-950 data-[state=active]:rf-shadow dark:rf-ring-offset-zinc-950 dark:focus-visible:rf-ring-zinc-300 dark:data-[state=active]:rf-bg-zinc-950 dark:data-[state=active]:rf-text-zinc-50",i),...e}));CM.displayName=Mxe.displayName;const MB=Nt.forwardRef(({className:i,...e},t)=>Ct.jsx(Rxe,{ref:t,className:bv("rf-h-full rf-mt-2 rf-ring-offset-white focus-visible:rf-outline-none focus-visible:rf-ring-2 focus-visible:rf-ring-zinc-950 focus-visible:rf-ring-offset-2 dark:rf-ring-offset-zinc-950 dark:focus-visible:rf-ring-zinc-300",i),...e}));MB.displayName=Rxe.displayName;var Q1;(function(i){i.assertEqual=r=>{};function e(r){}i.assertIs=e;function t(r){throw new Error}i.assertNever=t,i.arrayToEnum=r=>{const o={};for(const a of r)o[a]=a;return o},i.getValidEnumValues=r=>{const o=i.objectKeys(r).filter(s=>typeof r[r[s]]!="number"),a={};for(const s of o)a[s]=r[s];return i.objectValues(a)},i.objectValues=r=>i.objectKeys(r).map(function(o){return r[o]}),i.objectKeys=typeof Object.keys=="function"?r=>Object.keys(r):r=>{const o=[];for(const a in r)Object.prototype.hasOwnProperty.call(r,a)&&o.push(a);return o},i.find=(r,o)=>{for(const a of r)if(o(a))return a},i.isInteger=typeof Number.isInteger=="function"?r=>Number.isInteger(r):r=>typeof r=="number"&&Number.isFinite(r)&&Math.floor(r)===r;function n(r,o=" | "){return r.map(a=>typeof a=="string"?`'${a}'`:a).join(o)}i.joinValues=n,i.jsonStringifyReplacer=(r,o)=>typeof o=="bigint"?o.toString():o})(Q1||(Q1={}));var h2e;(function(i){i.mergeShapes=(e,t)=>({...e,...t})})(h2e||(h2e={}));const rd=Q1.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),h3=i=>{switch(typeof i){case"undefined":return rd.undefined;case"string":return rd.string;case"number":return Number.isNaN(i)?rd.nan:rd.number;case"boolean":return rd.boolean;case"function":return rd.function;case"bigint":return rd.bigint;case"symbol":return rd.symbol;case"object":return Array.isArray(i)?rd.array:i===null?rd.null:i.then&&typeof i.then=="function"&&i.catch&&typeof i.catch=="function"?rd.promise:typeof Map<"u"&&i instanceof Map?rd.map:typeof Set<"u"&&i instanceof Set?rd.set:typeof Date<"u"&&i instanceof Date?rd.date:rd.object;default:return rd.unknown}},El=Q1.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"]);let RB=class wdt extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=n=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};const t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.issues=e}format(e){const t=e||function(o){return o.message},n={_errors:[]},r=o=>{for(const a of o.issues)if(a.code==="invalid_union")a.unionErrors.map(r);else if(a.code==="invalid_return_type")r(a.returnTypeError);else if(a.code==="invalid_arguments")r(a.argumentsError);else if(a.path.length===0)n._errors.push(t(a));else{let s=n,l=0;for(;l<a.path.length;){const c=a.path[l];l===a.path.length-1?(s[c]=s[c]||{_errors:[]},s[c]._errors.push(t(a))):s[c]=s[c]||{_errors:[]},s=s[c],l++}}};return r(this),n}static assert(e){if(!(e instanceof wdt))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,Q1.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=t=>t.message){const t={},n=[];for(const r of this.issues)if(r.path.length>0){const o=r.path[0];t[o]=t[o]||[],t[o].push(e(r))}else n.push(e(r));return{formErrors:n,fieldErrors:t}}get formErrors(){return this.flatten()}};RB.create=i=>new RB(i);const m8=(i,e)=>{let t;switch(i.code){case El.invalid_type:i.received===rd.undefined?t="Required":t=`Expected ${i.expected}, received ${i.received}`;break;case El.invalid_literal:t=`Invalid literal value, expected ${JSON.stringify(i.expected,Q1.jsonStringifyReplacer)}`;break;case El.unrecognized_keys:t=`Unrecognized key(s) in object: ${Q1.joinValues(i.keys,", ")}`;break;case El.invalid_union:t="Invalid input";break;case El.invalid_union_discriminator:t=`Invalid discriminator value. Expected ${Q1.joinValues(i.options)}`;break;case El.invalid_enum_value:t=`Invalid enum value. Expected ${Q1.joinValues(i.options)}, received '${i.received}'`;break;case El.invalid_arguments:t="Invalid function arguments";break;case El.invalid_return_type:t="Invalid function return type";break;case El.invalid_date:t="Invalid date";break;case El.invalid_string:typeof i.validation=="object"?"includes"in i.validation?(t=`Invalid input: must include "${i.validation.includes}"`,typeof i.validation.position=="number"&&(t=`${t} at one or more positions greater than or equal to ${i.validation.position}`)):"startsWith"in i.validation?t=`Invalid input: must start with "${i.validation.startsWith}"`:"endsWith"in i.validation?t=`Invalid input: must end with "${i.validation.endsWith}"`:Q1.assertNever(i.validation):i.validation!=="regex"?t=`Invalid ${i.validation}`:t="Invalid";break;case El.too_small:i.type==="array"?t=`Array must contain ${i.exact?"exactly":i.inclusive?"at least":"more than"} ${i.minimum} element(s)`:i.type==="string"?t=`String must contain ${i.exact?"exactly":i.inclusive?"at least":"over"} ${i.minimum} character(s)`:i.type==="number"?t=`Number must be ${i.exact?"exactly equal to ":i.inclusive?"greater than or equal to ":"greater than "}${i.minimum}`:i.type==="bigint"?t=`Number must be ${i.exact?"exactly equal to ":i.inclusive?"greater than or equal to ":"greater than "}${i.minimum}`:i.type==="date"?t=`Date must be ${i.exact?"exactly equal to ":i.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(i.minimum))}`:t="Invalid input";break;case El.too_big:i.type==="array"?t=`Array must contain ${i.exact?"exactly":i.inclusive?"at most":"less than"} ${i.maximum} element(s)`:i.type==="string"?t=`String must contain ${i.exact?"exactly":i.inclusive?"at most":"under"} ${i.maximum} character(s)`:i.type==="number"?t=`Number must be ${i.exact?"exactly":i.inclusive?"less than or equal to":"less than"} ${i.maximum}`:i.type==="bigint"?t=`BigInt must be ${i.exact?"exactly":i.inclusive?"less than or equal to":"less than"} ${i.maximum}`:i.type==="date"?t=`Date must be ${i.exact?"exactly":i.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(i.maximum))}`:t="Invalid input";break;case El.custom:t="Invalid input";break;case El.invalid_intersection_types:t="Intersection results could not be merged";break;case El.not_multiple_of:t=`Number must be a multiple of ${i.multipleOf}`;break;case El.not_finite:t="Number must be finite";break;default:t=e.defaultError,Q1.assertNever(i)}return{message:t}};let emt=m8;function JX(){return emt}const qX=i=>{const{data:e,path:t,errorMaps:n,issueData:r}=i,o=[...t,...r.path||[]],a={...r,path:o};if(r.message!==void 0)return{...r,path:o,message:r.message};let s="";const l=n.filter(c=>!!c).slice().reverse();for(const c of l)s=c(a,{data:e,defaultError:s}).message;return{...r,path:o,message:s}};function tA(i,e){const t=JX(),n=qX({issueData:e,data:i.data,path:i.path,errorMaps:[i.common.contextualErrorMap,i.schemaErrorMap,t,t===m8?void 0:m8].filter(r=>!!r)});i.common.issues.push(n)}let Db=class Qdt{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,t){const n=[];for(const r of t){if(r.status==="aborted")return ip;r.status==="dirty"&&e.dirty(),n.push(r.value)}return{status:e.value,value:n}}static async mergeObjectAsync(e,t){const n=[];for(const r of t){const o=await r.key,a=await r.value;n.push({key:o,value:a})}return Qdt.mergeObjectSync(e,n)}static mergeObjectSync(e,t){const n={};for(const r of t){const{key:o,value:a}=r;if(o.status==="aborted"||a.status==="aborted")return ip;o.status==="dirty"&&e.dirty(),a.status==="dirty"&&e.dirty(),o.value!=="__proto__"&&(typeof a.value<"u"||r.alwaysSet)&&(n[o.value]=a.value)}return{status:e.value,value:n}}};const ip=Object.freeze({status:"aborted"}),y8=i=>({status:"dirty",value:i}),JE=i=>({status:"valid",value:i}),p2e=i=>i.status==="aborted",g2e=i=>i.status==="dirty",xM=i=>i.status==="valid",zU=i=>typeof Promise<"u"&&i instanceof Promise;var Ff;(function(i){i.errToObj=e=>typeof e=="string"?{message:e}:e||{},i.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(Ff||(Ff={}));let DB=class{constructor(e,t,n,r){this._cachedPath=[],this.parent=e,this.data=t,this._path=n,this._key=r}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}};const m2e=(i,e)=>{if(xM(e))return{success:!0,data:e.value};if(!i.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const t=new RB(i.common.issues);return this._error=t,this._error}}};function zg(i){if(!i)return{};const{errorMap:e,invalid_type_error:t,required_error:n,description:r}=i;if(e&&(t||n))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:r}:{errorMap:(a,s)=>{const{message:l}=i;return a.code==="invalid_enum_value"?{message:l??s.defaultError}:typeof s.data>"u"?{message:l??n??s.defaultError}:a.code!=="invalid_type"?{message:s.defaultError}:{message:l??t??s.defaultError}},description:r}}let ry=class{get description(){return this._def.description}_getType(e){return h3(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:h3(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new Db,ctx:{common:e.parent.common,data:e.data,parsedType:h3(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const t=this._parse(e);if(zU(t))throw new Error("Synchronous parse encountered promise.");return t}_parseAsync(e){const t=this._parse(e);return Promise.resolve(t)}parse(e,t){const n=this.safeParse(e,t);if(n.success)return n.data;throw n.error}safeParse(e,t){const n={common:{issues:[],async:(t==null?void 0:t.async)??!1,contextualErrorMap:t==null?void 0:t.errorMap},path:(t==null?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:h3(e)},r=this._parseSync({data:e,path:n.path,parent:n});return m2e(n,r)}"~validate"(e){var n,r;const t={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:h3(e)};if(!this["~standard"].async)try{const o=this._parseSync({data:e,path:[],parent:t});return xM(o)?{value:o.value}:{issues:t.common.issues}}catch(o){(r=(n=o==null?void 0:o.message)==null?void 0:n.toLowerCase())!=null&&r.includes("encountered")&&(this["~standard"].async=!0),t.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:t}).then(o=>xM(o)?{value:o.value}:{issues:t.common.issues})}async parseAsync(e,t){const n=await this.safeParseAsync(e,t);if(n.success)return n.data;throw n.error}async safeParseAsync(e,t){const n={common:{issues:[],contextualErrorMap:t==null?void 0:t.errorMap,async:!0},path:(t==null?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:h3(e)},r=this._parse({data:e,path:n.path,parent:n}),o=await(zU(r)?r:Promise.resolve(r));return m2e(n,o)}refine(e,t){const n=r=>typeof t=="string"||typeof t>"u"?{message:t}:typeof t=="function"?t(r):t;return this._refinement((r,o)=>{const a=e(r),s=()=>o.addIssue({code:El.custom,...n(r)});return typeof Promise<"u"&&a instanceof Promise?a.then(l=>l?!0:(s(),!1)):a?!0:(s(),!1)})}refinement(e,t){return this._refinement((n,r)=>e(n)?!0:(r.addIssue(typeof t=="function"?t(n,r):t),!1))}_refinement(e){return new Ww({schema:this,typeName:mp.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:t=>this["~validate"](t)}}optional(){return YS.create(this,this._def)}nullable(){return $w.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return bM.create(this)}promise(){return v8.create(this,this._def)}or(e){return VU.create([this,e],this._def)}and(e){return KU.create(this,e,this._def)}transform(e){return new Ww({...zg(this._def),schema:this,typeName:mp.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const t=typeof e=="function"?e:()=>e;return new qU({...zg(this._def),innerType:this,defaultValue:t,typeName:mp.ZodDefault})}brand(){return new w2e({typeName:mp.ZodBranded,type:this,...zg(this._def)})}catch(e){const t=typeof e=="function"?e:()=>e;return new ZU({...zg(this._def),innerType:this,catchValue:t,typeName:mp.ZodCatch})}describe(e){const t=this.constructor;return new t({...this._def,description:e})}pipe(e){return Bmt.create(this,e)}readonly(){return XU.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}};const tmt=/^c[^\s-]{8,}$/i,nmt=/^[0-9a-z]+$/,imt=/^[0-9A-HJKMNP-TV-Z]{26}$/i,rmt=/^[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,omt=/^[a-z0-9_-]{21}$/i,amt=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,smt=/^[-+]?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)?)??$/,lmt=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,cmt="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let ZX;const umt=/^(?:(?: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])$/,Amt=/^(?:(?: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])$/,dmt=/^(([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]))$/,fmt=/^(([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])$/,hmt=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,pmt=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,y2e="((\\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])))",gmt=new RegExp(`^${y2e}$`);function _2e(i){let e="[0-5]\\d";i.precision?e=`${e}\\.\\d{${i.precision}}`:i.precision==null&&(e=`${e}(\\.\\d+)?`);const t=i.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${t}`}function mmt(i){return new RegExp(`^${_2e(i)}$`)}function ymt(i){let e=`${y2e}T${_2e(i)}`;const t=[];return t.push(i.local?"Z?":"Z"),i.offset&&t.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${t.join("|")})`,new RegExp(`^${e}$`)}function _mt(i,e){return!!((e==="v4"||!e)&&umt.test(i)||(e==="v6"||!e)&&dmt.test(i))}function vmt(i,e){if(!amt.test(i))return!1;try{const[t]=i.split(".");if(!t)return!1;const n=t.replace(/-/g,"+").replace(/_/g,"/").padEnd(t.length+(4-t.length%4)%4,"="),r=JSON.parse(atob(n));return!(typeof r!="object"||r===null||"typ"in r&&(r==null?void 0:r.typ)!=="JWT"||!r.alg||e&&r.alg!==e)}catch{return!1}}function Imt(i,e){return!!((e==="v4"||!e)&&Amt.test(i)||(e==="v6"||!e)&&fmt.test(i))}let HU=class HP extends ry{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==rd.string){const o=this._getOrReturnCtx(e);return tA(o,{code:El.invalid_type,expected:rd.string,received:o.parsedType}),ip}const n=new Db;let r;for(const o of this._def.checks)if(o.kind==="min")e.data.length<o.value&&(r=this._getOrReturnCtx(e,r),tA(r,{code:El.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),n.dirty());else if(o.kind==="max")e.data.length>o.value&&(r=this._getOrReturnCtx(e,r),tA(r,{code:El.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),n.dirty());else if(o.kind==="length"){const a=e.data.length>o.value,s=e.data.length<o.value;(a||s)&&(r=this._getOrReturnCtx(e,r),a?tA(r,{code:El.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}):s&&tA(r,{code:El.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}),n.dirty())}else if(o.kind==="email")lmt.test(e.data)||(r=this._getOrReturnCtx(e,r),tA(r,{validation:"email",code:El.invalid_string,message:o.message}),n.dirty());else if(o.kind==="emoji")ZX||(ZX=new RegExp(cmt,"u")),ZX.test(e.data)||(r=this._getOrReturnCtx(e,r),tA(r,{validation:"emoji",code:El.invalid_string,message:o.message}),n.dirty());else if(o.kind==="uuid")rmt.test(e.data)||(r=this._getOrReturnCtx(e,r),tA(r,{validation:"uuid",code:El.invalid_string,message:o.message}),n.dirty());else if(o.kind==="nanoid")omt.test(e.data)||(r=this._getOrReturnCtx(e,r),tA(r,{validation:"nanoid",code:El.invalid_string,message:o.message}),n.dirty());else if(o.kind==="cuid")tmt.test(e.data)||(r=this._getOrReturnCtx(e,r),tA(r,{validation:"cuid",code:El.invalid_string,message:o.message}),n.dirty());else if(o.kind==="cuid2")nmt.test(e.data)||(r=this._getOrReturnCtx(e,r),tA(r,{validation:"cuid2",code:El.invalid_string,message:o.message}),n.dirty());else if(o.kind==="ulid")imt.test(e.data)||(r=this._getOrReturnCtx(e,r),tA(r,{validation:"ulid",code:El.invalid_string,message:o.message}),n.dirty());else if(o.kind==="url")try{new URL(e.data)}catch{r=this._getOrReturnCtx(e,r),tA(r,{validation:"url",code:El.invalid_string,message:o.message}),n.dirty()}else o.kind==="regex"?(o.regex.lastIndex=0,o.regex.test(e.data)||(r=this._getOrReturnCtx(e,r),tA(r,{validation:"regex",code:El.invalid_string,message:o.message}),n.dirty())):o.kind==="trim"?e.data=e.data.trim():o.kind==="includes"?e.data.includes(o.value,o.position)||(r=this._getOrReturnCtx(e,r),tA(r,{code:El.invalid_string,validation:{includes:o.value,position:o.position},message:o.message}),n.dirty()):o.kind==="toLowerCase"?e.data=e.data.toLowerCase():o.kind==="toUpperCase"?e.data=e.data.toUpperCase():o.kind==="startsWith"?e.data.startsWith(o.value)||(r=this._getOrReturnCtx(e,r),tA(r,{code:El.invalid_string,validation:{startsWith:o.value},message:o.message}),n.dirty()):o.kind==="endsWith"?e.data.endsWith(o.value)||(r=this._getOrReturnCtx(e,r),tA(r,{code:El.invalid_string,validation:{endsWith:o.value},message:o.message}),n.dirty()):o.kind==="datetime"?ymt(o).test(e.data)||(r=this._getOrReturnCtx(e,r),tA(r,{code:El.invalid_string,validation:"datetime",message:o.message}),n.dirty()):o.kind==="date"?gmt.test(e.data)||(r=this._getOrReturnCtx(e,r),tA(r,{code:El.invalid_string,validation:"date",message:o.message}),n.dirty()):o.kind==="time"?mmt(o).test(e.data)||(r=this._getOrReturnCtx(e,r),tA(r,{code:El.invalid_string,validation:"time",message:o.message}),n.dirty()):o.kind==="duration"?smt.test(e.data)||(r=this._getOrReturnCtx(e,r),tA(r,{validation:"duration",code:El.invalid_string,message:o.message}),n.dirty()):o.kind==="ip"?_mt(e.data,o.version)||(r=this._getOrReturnCtx(e,r),tA(r,{validation:"ip",code:El.invalid_string,message:o.message}),n.dirty()):o.kind==="jwt"?vmt(e.data,o.alg)||(r=this._getOrReturnCtx(e,r),tA(r,{validation:"jwt",code:El.invalid_string,message:o.message}),n.dirty()):o.kind==="cidr"?Imt(e.data,o.version)||(r=this._getOrReturnCtx(e,r),tA(r,{validation:"cidr",code:El.invalid_string,message:o.message}),n.dirty()):o.kind==="base64"?hmt.test(e.data)||(r=this._getOrReturnCtx(e,r),tA(r,{validation:"base64",code:El.invalid_string,message:o.message}),n.dirty()):o.kind==="base64url"?pmt.test(e.data)||(r=this._getOrReturnCtx(e,r),tA(r,{validation:"base64url",code:El.invalid_string,message:o.message}),n.dirty()):Q1.assertNever(o);return{status:n.value,value:e.data}}_regex(e,t,n){return this.refinement(r=>e.test(r),{validation:t,code:El.invalid_string,...Ff.errToObj(n)})}_addCheck(e){return new HP({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...Ff.errToObj(e)})}url(e){return this._addCheck({kind:"url",...Ff.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...Ff.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...Ff.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...Ff.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...Ff.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...Ff.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...Ff.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...Ff.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...Ff.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...Ff.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...Ff.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...Ff.errToObj(e)})}datetime(e){return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,offset:(e==null?void 0:e.offset)??!1,local:(e==null?void 0:e.local)??!1,...Ff.errToObj(e==null?void 0:e.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,...Ff.errToObj(e==null?void 0:e.message)})}duration(e){return this._addCheck({kind:"duration",...Ff.errToObj(e)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...Ff.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:t==null?void 0:t.position,...Ff.errToObj(t==null?void 0:t.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...Ff.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...Ff.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...Ff.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...Ff.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...Ff.errToObj(t)})}nonempty(e){return this.min(1,Ff.errToObj(e))}trim(){return new HP({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new HP({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new HP({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isCIDR(){return!!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find(e=>e.kind==="base64url")}get minLength(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}};HU.create=i=>new HU({checks:[],typeName:mp.ZodString,coerce:(i==null?void 0:i.coerce)??!1,...zg(i)});function Cmt(i,e){const t=(i.toString().split(".")[1]||"").length,n=(e.toString().split(".")[1]||"").length,r=t>n?t:n,o=Number.parseInt(i.toFixed(r).replace(".","")),a=Number.parseInt(e.toFixed(r).replace(".",""));return o%a/10**r}let XX=class y9e extends ry{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==rd.number){const o=this._getOrReturnCtx(e);return tA(o,{code:El.invalid_type,expected:rd.number,received:o.parsedType}),ip}let n;const r=new Db;for(const o of this._def.checks)o.kind==="int"?Q1.isInteger(e.data)||(n=this._getOrReturnCtx(e,n),tA(n,{code:El.invalid_type,expected:"integer",received:"float",message:o.message}),r.dirty()):o.kind==="min"?(o.inclusive?e.data<o.value:e.data<=o.value)&&(n=this._getOrReturnCtx(e,n),tA(n,{code:El.too_small,minimum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),r.dirty()):o.kind==="max"?(o.inclusive?e.data>o.value:e.data>=o.value)&&(n=this._getOrReturnCtx(e,n),tA(n,{code:El.too_big,maximum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),r.dirty()):o.kind==="multipleOf"?Cmt(e.data,o.value)!==0&&(n=this._getOrReturnCtx(e,n),tA(n,{code:El.not_multiple_of,multipleOf:o.value,message:o.message}),r.dirty()):o.kind==="finite"?Number.isFinite(e.data)||(n=this._getOrReturnCtx(e,n),tA(n,{code:El.not_finite,message:o.message}),r.dirty()):Q1.assertNever(o);return{status:r.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,Ff.toString(t))}gt(e,t){return this.setLimit("min",e,!1,Ff.toString(t))}lte(e,t){return this.setLimit("max",e,!0,Ff.toString(t))}lt(e,t){return this.setLimit("max",e,!1,Ff.toString(t))}setLimit(e,t,n,r){return new y9e({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:n,message:Ff.toString(r)}]})}_addCheck(e){return new y9e({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:Ff.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:Ff.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:Ff.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:Ff.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:Ff.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:Ff.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:Ff.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:Ff.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:Ff.toString(e)})}get minValue(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&Q1.isInteger(e.value))}get isFinite(){let e=null,t=null;for(const n of this._def.checks){if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;n.kind==="min"?(t===null||n.value>t)&&(t=n.value):n.kind==="max"&&(e===null||n.value<e)&&(e=n.value)}return Number.isFinite(t)&&Number.isFinite(e)}};XX.create=i=>new XX({checks:[],typeName:mp.ZodNumber,coerce:(i==null?void 0:i.coerce)||!1,...zg(i)});let v2e=class _9e extends ry{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==rd.bigint)return this._getInvalidInput(e);let n;const r=new Db;for(const o of this._def.checks)o.kind==="min"?(o.inclusive?e.data<o.value:e.data<=o.value)&&(n=this._getOrReturnCtx(e,n),tA(n,{code:El.too_small,type:"bigint",minimum:o.value,inclusive:o.inclusive,message:o.message}),r.dirty()):o.kind==="max"?(o.inclusive?e.data>o.value:e.data>=o.value)&&(n=this._getOrReturnCtx(e,n),tA(n,{code:El.too_big,type:"bigint",maximum:o.value,inclusive:o.inclusive,message:o.message}),r.dirty()):o.kind==="multipleOf"?e.data%o.value!==BigInt(0)&&(n=this._getOrReturnCtx(e,n),tA(n,{code:El.not_multiple_of,multipleOf:o.value,message:o.message}),r.dirty()):Q1.assertNever(o);return{status:r.value,value:e.data}}_getInvalidInput(e){const t=this._getOrReturnCtx(e);return tA(t,{code:El.invalid_type,expected:rd.bigint,received:t.parsedType}),ip}gte(e,t){return this.setLimit("min",e,!0,Ff.toString(t))}gt(e,t){return this.setLimit("min",e,!1,Ff.toString(t))}lte(e,t){return this.setLimit("max",e,!0,Ff.toString(t))}lt(e,t){return this.setLimit("max",e,!1,Ff.toString(t))}setLimit(e,t,n,r){return new _9e({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:n,message:Ff.toString(r)}]})}_addCheck(e){return new _9e({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:Ff.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:Ff.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:Ff.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:Ff.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:Ff.toString(t)})}get minValue(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}};v2e.create=i=>new v2e({checks:[],typeName:mp.ZodBigInt,coerce:(i==null?void 0:i.coerce)??!1,...zg(i)});let WX=class extends ry{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==rd.boolean){const n=this._getOrReturnCtx(e);return tA(n,{code:El.invalid_type,expected:rd.boolean,received:n.parsedType}),ip}return JE(e.data)}};WX.create=i=>new WX({typeName:mp.ZodBoolean,coerce:(i==null?void 0:i.coerce)||!1,...zg(i)});let I2e=class Mdt extends ry{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==rd.date){const o=this._getOrReturnCtx(e);return tA(o,{code:El.invalid_type,expected:rd.date,received:o.parsedType}),ip}if(Number.isNaN(e.data.getTime())){const o=this._getOrReturnCtx(e);return tA(o,{code:El.invalid_date}),ip}const n=new Db;let r;for(const o of this._def.checks)o.kind==="min"?e.data.getTime()<o.value&&(r=this._getOrReturnCtx(e,r),tA(r,{code:El.too_small,message:o.message,inclusive:!0,exact:!1,minimum:o.value,type:"date"}),n.dirty()):o.kind==="max"?e.data.getTime()>o.value&&(r=this._getOrReturnCtx(e,r),tA(r,{code:El.too_big,message:o.message,inclusive:!0,exact:!1,maximum:o.value,type:"date"}),n.dirty()):Q1.assertNever(o);return{status:n.value,value:new Date(e.data.getTime())}}_addCheck(e){return new Mdt({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:Ff.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:Ff.toString(t)})}get minDate(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e!=null?new Date(e):null}};I2e.create=i=>new I2e({checks:[],coerce:(i==null?void 0:i.coerce)||!1,typeName:mp.ZodDate,...zg(i)});let C2e=class extends ry{_parse(e){if(this._getType(e)!==rd.symbol){const n=this._getOrReturnCtx(e);return tA(n,{code:El.invalid_type,expected:rd.symbol,received:n.parsedType}),ip}return JE(e.data)}};C2e.create=i=>new C2e({typeName:mp.ZodSymbol,...zg(i)});let $X=class extends ry{_parse(e){if(this._getType(e)!==rd.undefined){const n=this._getOrReturnCtx(e);return tA(n,{code:El.invalid_type,expected:rd.undefined,received:n.parsedType}),ip}return JE(e.data)}};$X.create=i=>new $X({typeName:mp.ZodUndefined,...zg(i)});let YU=class extends ry{_parse(e){if(this._getType(e)!==rd.null){const n=this._getOrReturnCtx(e);return tA(n,{code:El.invalid_type,expected:rd.null,received:n.parsedType}),ip}return JE(e.data)}};YU.create=i=>new YU({typeName:mp.ZodNull,...zg(i)});let _8=class extends ry{constructor(){super(...arguments),this._any=!0}_parse(e){return JE(e.data)}};_8.create=i=>new _8({typeName:mp.ZodAny,...zg(i)});let EM=class extends ry{constructor(){super(...arguments),this._unknown=!0}_parse(e){return JE(e.data)}};EM.create=i=>new EM({typeName:mp.ZodUnknown,...zg(i)});let p3=class extends ry{_parse(e){const t=this._getOrReturnCtx(e);return tA(t,{code:El.invalid_type,expected:rd.never,received:t.parsedType}),ip}};p3.create=i=>new p3({typeName:mp.ZodNever,...zg(i)});let x2e=class extends ry{_parse(e){if(this._getType(e)!==rd.undefined){const n=this._getOrReturnCtx(e);return tA(n,{code:El.invalid_type,expected:rd.void,received:n.parsedType}),ip}return JE(e.data)}};x2e.create=i=>new x2e({typeName:mp.ZodVoid,...zg(i)});let bM=class AZ extends ry{_parse(e){const{ctx:t,status:n}=this._processInputParams(e),r=this._def;if(t.parsedType!==rd.array)return tA(t,{code:El.invalid_type,expected:rd.array,received:t.parsedType}),ip;if(r.exactLength!==null){const a=t.data.length>r.exactLength.value,s=t.data.length<r.exactLength.value;(a||s)&&(tA(t,{code:a?El.too_big:El.too_small,minimum:s?r.exactLength.value:void 0,maximum:a?r.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:r.exactLength.message}),n.dirty())}if(r.minLength!==null&&t.data.length<r.minLength.value&&(tA(t,{code:El.too_small,minimum:r.minLength.value,type:"array",inclusive:!0,exact:!1,message:r.minLength.message}),n.dirty()),r.maxLength!==null&&t.data.length>r.maxLength.value&&(tA(t,{code:El.too_big,maximum:r.maxLength.value,type:"array",inclusive:!0,exact:!1,message:r.maxLength.message}),n.dirty()),t.common.async)return Promise.all([...t.data].map((a,s)=>r.type._parseAsync(new DB(t,a,t.path,s)))).then(a=>Db.mergeArray(n,a));const o=[...t.data].map((a,s)=>r.type._parseSync(new DB(t,a,t.path,s)));return Db.mergeArray(n,o)}get element(){return this._def.type}min(e,t){return new AZ({...this._def,minLength:{value:e,message:Ff.toString(t)}})}max(e,t){return new AZ({...this._def,maxLength:{value:e,message:Ff.toString(t)}})}length(e,t){return new AZ({...this._def,exactLength:{value:e,message:Ff.toString(t)}})}nonempty(e){return this.min(1,e)}};bM.create=(i,e)=>new bM({type:i,minLength:null,maxLength:null,exactLength:null,typeName:mp.ZodArray,...zg(e)});function BM(i){if(i instanceof zS){const e={};for(const t in i.shape){const n=i.shape[t];e[t]=YS.create(BM(n))}return new zS({...i._def,shape:()=>e})}else return i instanceof bM?new bM({...i._def,type:BM(i.element)}):i instanceof YS?YS.create(BM(i.unwrap())):i instanceof $w?$w.create(BM(i.unwrap())):i instanceof Xw?Xw.create(i.items.map(e=>BM(e))):i}let zS=class mB extends ry{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const e=this._def.shape(),t=Q1.objectKeys(e);return this._cached={shape:e,keys:t},this._cached}_parse(e){if(this._getType(e)!==rd.object){const c=this._getOrReturnCtx(e);return tA(c,{code:El.invalid_type,expected:rd.object,received:c.parsedType}),ip}const{status:n,ctx:r}=this._processInputParams(e),{shape:o,keys:a}=this._getCached(),s=[];if(!(this._def.catchall instanceof p3&&this._def.unknownKeys==="strip"))for(const c in r.data)a.includes(c)||s.push(c);const l=[];for(const c of a){const u=o[c],A=r.data[c];l.push({key:{status:"valid",value:c},value:u._parse(new DB(r,A,r.path,c)),alwaysSet:c in r.data})}if(this._def.catchall instanceof p3){const c=this._def.unknownKeys;if(c==="passthrough")for(const u of s)l.push({key:{status:"valid",value:u},value:{status:"valid",value:r.data[u]}});else if(c==="strict")s.length>0&&(tA(r,{code:El.unrecognized_keys,keys:s}),n.dirty());else if(c!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const c=this._def.catchall;for(const u of s){const A=r.data[u];l.push({key:{status:"valid",value:u},value:c._parse(new DB(r,A,r.path,u)),alwaysSet:u in r.data})}}return r.common.async?Promise.resolve().then(async()=>{const c=[];for(const u of l){const A=await u.key,d=await u.value;c.push({key:A,value:d,alwaysSet:u.alwaysSet})}return c}).then(c=>Db.mergeObjectSync(n,c)):Db.mergeObjectSync(n,l)}get shape(){return this._def.shape()}strict(e){return Ff.errToObj,new mB({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(t,n)=>{var o,a;const r=((a=(o=this._def).errorMap)==null?void 0:a.call(o,t,n).message)??n.defaultError;return t.code==="unrecognized_keys"?{message:Ff.errToObj(e).message??r}:{message:r}}}:{}})}strip(){return new mB({...this._def,unknownKeys:"strip"})}passthrough(){return new mB({...this._def,unknownKeys:"passthrough"})}extend(e){return new mB({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new mB({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:mp.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new mB({...this._def,catchall:e})}pick(e){const t={};for(const n of Q1.objectKeys(e))e[n]&&this.shape[n]&&(t[n]=this.shape[n]);return new mB({...this._def,shape:()=>t})}omit(e){const t={};for(const n of Q1.objectKeys(this.shape))e[n]||(t[n]=this.shape[n]);return new mB({...this._def,shape:()=>t})}deepPartial(){return BM(this)}partial(e){const t={};for(const n of Q1.objectKeys(this.shape)){const r=this.shape[n];e&&!e[n]?t[n]=r:t[n]=r.optional()}return new mB({...this._def,shape:()=>t})}required(e){const t={};for(const n of Q1.objectKeys(this.shape))if(e&&!e[n])t[n]=this.shape[n];else{let o=this.shape[n];for(;o instanceof YS;)o=o._def.innerType;t[n]=o}return new mB({...this._def,shape:()=>t})}keyof(){return B2e(Q1.objectKeys(this.shape))}};zS.create=(i,e)=>new zS({shape:()=>i,unknownKeys:"strip",catchall:p3.create(),typeName:mp.ZodObject,...zg(e)}),zS.strictCreate=(i,e)=>new zS({shape:()=>i,unknownKeys:"strict",catchall:p3.create(),typeName:mp.ZodObject,...zg(e)}),zS.lazycreate=(i,e)=>new zS({shape:i,unknownKeys:"strip",catchall:p3.create(),typeName:mp.ZodObject,...zg(e)});let VU=class extends ry{_parse(e){const{ctx:t}=this._processInputParams(e),n=this._def.options;function r(o){for(const s of o)if(s.result.status==="valid")return s.result;for(const s of o)if(s.result.status==="dirty")return t.common.issues.push(...s.ctx.common.issues),s.result;const a=o.map(s=>new RB(s.ctx.common.issues));return tA(t,{code:El.invalid_union,unionErrors:a}),ip}if(t.common.async)return Promise.all(n.map(async o=>{const a={...t,common:{...t.common,issues:[]},parent:null};return{result:await o._parseAsync({data:t.data,path:t.path,parent:a}),ctx:a}})).then(r);{let o;const a=[];for(const l of n){const c={...t,common:{...t.common,issues:[]},parent:null},u=l._parseSync({data:t.data,path:t.path,parent:c});if(u.status==="valid")return u;u.status==="dirty"&&!o&&(o={result:u,ctx:c}),c.common.issues.length&&a.push(c.common.issues)}if(o)return t.common.issues.push(...o.ctx.common.issues),o.result;const s=a.map(l=>new RB(l));return tA(t,{code:El.invalid_union,unionErrors:s}),ip}}get options(){return this._def.options}};VU.create=(i,e)=>new VU({options:i,typeName:mp.ZodUnion,...zg(e)});const HS=i=>i instanceof tW?HS(i.schema):i instanceof Ww?HS(i.innerType()):i instanceof jU?[i.value]:i instanceof JU?i.options:i instanceof nW?Q1.objectValues(i.enum):i instanceof qU?HS(i._def.innerType):i instanceof $X?[void 0]:i instanceof YU?[null]:i instanceof YS?[void 0,...HS(i.unwrap())]:i instanceof $w?[null,...HS(i.unwrap())]:i instanceof w2e||i instanceof XU?HS(i.unwrap()):i instanceof ZU?HS(i._def.innerType):[];let xmt=class Rdt extends ry{_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==rd.object)return tA(t,{code:El.invalid_type,expected:rd.object,received:t.parsedType}),ip;const n=this.discriminator,r=t.data[n],o=this.optionsMap.get(r);return o?t.common.async?o._parseAsync({data:t.data,path:t.path,parent:t}):o._parseSync({data:t.data,path:t.path,parent:t}):(tA(t,{code:El.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),ip)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,t,n){const r=new Map;for(const o of t){const a=HS(o.shape[e]);if(!a.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(const s of a){if(r.has(s))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(s)}`);r.set(s,o)}}return new Rdt({typeName:mp.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:r,...zg(n)})}};function eW(i,e){const t=h3(i),n=h3(e);if(i===e)return{valid:!0,data:i};if(t===rd.object&&n===rd.object){const r=Q1.objectKeys(e),o=Q1.objectKeys(i).filter(s=>r.indexOf(s)!==-1),a={...i,...e};for(const s of o){const l=eW(i[s],e[s]);if(!l.valid)return{valid:!1};a[s]=l.data}return{valid:!0,data:a}}else if(t===rd.array&&n===rd.array){if(i.length!==e.length)return{valid:!1};const r=[];for(let o=0;o<i.length;o++){const a=i[o],s=e[o],l=eW(a,s);if(!l.valid)return{valid:!1};r.push(l.data)}return{valid:!0,data:r}}else return t===rd.date&&n===rd.date&&+i==+e?{valid:!0,data:i}:{valid:!1}}let KU=class extends ry{_parse(e){const{status:t,ctx:n}=this._processInputParams(e),r=(o,a)=>{if(p2e(o)||p2e(a))return ip;const s=eW(o.value,a.value);return s.valid?((g2e(o)||g2e(a))&&t.dirty(),{status:t.value,value:s.data}):(tA(n,{code:El.invalid_intersection_types}),ip)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([o,a])=>r(o,a)):r(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}};KU.create=(i,e,t)=>new KU({left:i,right:e,typeName:mp.ZodIntersection,...zg(t)});let Xw=class Ddt extends ry{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==rd.array)return tA(n,{code:El.invalid_type,expected:rd.array,received:n.parsedType}),ip;if(n.data.length<this._def.items.length)return tA(n,{code:El.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),ip;!this._def.rest&&n.data.length>this._def.items.length&&(tA(n,{code:El.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());const o=[...n.data].map((a,s)=>{const l=this._def.items[s]||this._def.rest;return l?l._parse(new DB(n,a,n.path,s)):null}).filter(a=>!!a);return n.common.async?Promise.all(o).then(a=>Db.mergeArray(t,a)):Db.mergeArray(t,o)}get items(){return this._def.items}rest(e){return new Ddt({...this._def,rest:e})}};Xw.create=(i,e)=>{if(!Array.isArray(i))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Xw({items:i,typeName:mp.ZodTuple,rest:null,...zg(e)})};let Emt=class v9e extends ry{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==rd.object)return tA(n,{code:El.invalid_type,expected:rd.object,received:n.parsedType}),ip;const r=[],o=this._def.keyType,a=this._def.valueType;for(const s in n.data)r.push({key:o._parse(new DB(n,s,n.path,s)),value:a._parse(new DB(n,n.data[s],n.path,s)),alwaysSet:s in n.data});return n.common.async?Db.mergeObjectAsync(t,r):Db.mergeObjectSync(t,r)}get element(){return this._def.valueType}static create(e,t,n){return t instanceof ry?new v9e({keyType:e,valueType:t,typeName:mp.ZodRecord,...zg(n)}):new v9e({keyType:HU.create(),valueType:e,typeName:mp.ZodRecord,...zg(t)})}},E2e=class extends ry{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==rd.map)return tA(n,{code:El.invalid_type,expected:rd.map,received:n.parsedType}),ip;const r=this._def.keyType,o=this._def.valueType,a=[...n.data.entries()].map(([s,l],c)=>({key:r._parse(new DB(n,s,n.path,[c,"key"])),value:o._parse(new DB(n,l,n.path,[c,"value"]))}));if(n.common.async){const s=new Map;return Promise.resolve().then(async()=>{for(const l of a){const c=await l.key,u=await l.value;if(c.status==="aborted"||u.status==="aborted")return ip;(c.status==="dirty"||u.status==="dirty")&&t.dirty(),s.set(c.value,u.value)}return{status:t.value,value:s}})}else{const s=new Map;for(const l of a){const c=l.key,u=l.value;if(c.status==="aborted"||u.status==="aborted")return ip;(c.status==="dirty"||u.status==="dirty")&&t.dirty(),s.set(c.value,u.value)}return{status:t.value,value:s}}}};E2e.create=(i,e,t)=>new E2e({valueType:e,keyType:i,typeName:mp.ZodMap,...zg(t)});let b2e=class I9e extends ry{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==rd.set)return tA(n,{code:El.invalid_type,expected:rd.set,received:n.parsedType}),ip;const r=this._def;r.minSize!==null&&n.data.size<r.minSize.value&&(tA(n,{code:El.too_small,minimum:r.minSize.value,type:"set",inclusive:!0,exact:!1,message:r.minSize.message}),t.dirty()),r.maxSize!==null&&n.data.size>r.maxSize.value&&(tA(n,{code:El.too_big,maximum:r.maxSize.value,type:"set",inclusive:!0,exact:!1,message:r.maxSize.message}),t.dirty());const o=this._def.valueType;function a(l){const c=new Set;for(const u of l){if(u.status==="aborted")return ip;u.status==="dirty"&&t.dirty(),c.add(u.value)}return{status:t.value,value:c}}const s=[...n.data.values()].map((l,c)=>o._parse(new DB(n,l,n.path,c)));return n.common.async?Promise.all(s).then(l=>a(l)):a(s)}min(e,t){return new I9e({...this._def,minSize:{value:e,message:Ff.toString(t)}})}max(e,t){return new I9e({...this._def,maxSize:{value:e,message:Ff.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}};b2e.create=(i,e)=>new b2e({valueType:i,minSize:null,maxSize:null,typeName:mp.ZodSet,...zg(e)});let bmt=class dZ extends ry{constructor(){super(...arguments),this.validate=this.implement}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==rd.function)return tA(t,{code:El.invalid_type,expected:rd.function,received:t.parsedType}),ip;function n(s,l){return qX({data:s,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,JX(),m8].filter(c=>!!c),issueData:{code:El.invalid_arguments,argumentsError:l}})}function r(s,l){return qX({data:s,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,JX(),m8].filter(c=>!!c),issueData:{code:El.invalid_return_type,returnTypeError:l}})}const o={errorMap:t.common.contextualErrorMap},a=t.data;if(this._def.returns instanceof v8){const s=this;return JE(async function(...l){const c=new RB([]),u=await s._def.args.parseAsync(l,o).catch(f=>{throw c.addIssue(n(l,f)),c}),A=await Reflect.apply(a,this,u);return await s._def.returns._def.type.parseAsync(A,o).catch(f=>{throw c.addIssue(r(A,f)),c})})}else{const s=this;return JE(function(...l){const c=s._def.args.safeParse(l,o);if(!c.success)throw new RB([n(l,c.error)]);const u=Reflect.apply(a,this,c.data),A=s._def.returns.safeParse(u,o);if(!A.success)throw new RB([r(u,A.error)]);return A.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new dZ({...this._def,args:Xw.create(e).rest(EM.create())})}returns(e){return new dZ({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,t,n){return new dZ({args:e||Xw.create([]).rest(EM.create()),returns:t||EM.create(),typeName:mp.ZodFunction,...zg(n)})}},tW=class extends ry{get schema(){return this._def.getter()}_parse(e){const{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}};tW.create=(i,e)=>new tW({getter:i,typeName:mp.ZodLazy,...zg(e)});let jU=class extends ry{_parse(e){if(e.data!==this._def.value){const t=this._getOrReturnCtx(e);return tA(t,{received:t.data,code:El.invalid_literal,expected:this._def.value}),ip}return{status:"valid",value:e.data}}get value(){return this._def.value}};jU.create=(i,e)=>new jU({value:i,typeName:mp.ZodLiteral,...zg(e)});function B2e(i,e){return new JU({values:i,typeName:mp.ZodEnum,...zg(e)})}let JU=class C9e extends ry{_parse(e){if(typeof e.data!="string"){const t=this._getOrReturnCtx(e),n=this._def.values;return tA(t,{expected:Q1.joinValues(n),received:t.parsedType,code:El.invalid_type}),ip}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){const t=this._getOrReturnCtx(e),n=this._def.values;return tA(t,{received:t.data,code:El.invalid_enum_value,options:n}),ip}return JE(e.data)}get options(){return this._def.values}get enum(){const e={};for(const t of this._def.values)e[t]=t;return e}get Values(){const e={};for(const t of this._def.values)e[t]=t;return e}get Enum(){const e={};for(const t of this._def.values)e[t]=t;return e}extract(e,t=this._def){return C9e.create(e,{...this._def,...t})}exclude(e,t=this._def){return C9e.create(this.options.filter(n=>!e.includes(n)),{...this._def,...t})}};JU.create=B2e;let nW=class extends ry{_parse(e){const t=Q1.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==rd.string&&n.parsedType!==rd.number){const r=Q1.objectValues(t);return tA(n,{expected:Q1.joinValues(r),received:n.parsedType,code:El.invalid_type}),ip}if(this._cache||(this._cache=new Set(Q1.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){const r=Q1.objectValues(t);return tA(n,{received:n.data,code:El.invalid_enum_value,options:r}),ip}return JE(e.data)}get enum(){return this._def.values}};nW.create=(i,e)=>new nW({values:i,typeName:mp.ZodNativeEnum,...zg(e)});let v8=class extends ry{unwrap(){return this._def.type}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==rd.promise&&t.common.async===!1)return tA(t,{code:El.invalid_type,expected:rd.promise,received:t.parsedType}),ip;const n=t.parsedType===rd.promise?t.data:Promise.resolve(t.data);return JE(n.then(r=>this._def.type.parseAsync(r,{path:t.path,errorMap:t.common.contextualErrorMap})))}};v8.create=(i,e)=>new v8({type:i,typeName:mp.ZodPromise,...zg(e)});let Ww=class extends ry{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===mp.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:t,ctx:n}=this._processInputParams(e),r=this._def.effect||null,o={addIssue:a=>{tA(n,a),a.fatal?t.abort():t.dirty()},get path(){return n.path}};if(o.addIssue=o.addIssue.bind(o),r.type==="preprocess"){const a=r.transform(n.data,o);if(n.common.async)return Promise.resolve(a).then(async s=>{if(t.value==="aborted")return ip;const l=await this._def.schema._parseAsync({data:s,path:n.path,parent:n});return l.status==="aborted"?ip:l.status==="dirty"||t.value==="dirty"?y8(l.value):l});{if(t.value==="aborted")return ip;const s=this._def.schema._parseSync({data:a,path:n.path,parent:n});return s.status==="aborted"?ip:s.status==="dirty"||t.value==="dirty"?y8(s.value):s}}if(r.type==="refinement"){const a=s=>{const l=r.refinement(s,o);if(n.common.async)return Promise.resolve(l);if(l instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return s};if(n.common.async===!1){const s=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return s.status==="aborted"?ip:(s.status==="dirty"&&t.dirty(),a(s.value),{status:t.value,value:s.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(s=>s.status==="aborted"?ip:(s.status==="dirty"&&t.dirty(),a(s.value).then(()=>({status:t.value,value:s.value}))))}if(r.type==="transform")if(n.common.async===!1){const a=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!xM(a))return ip;const s=r.transform(a.value,o);if(s instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:s}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(a=>xM(a)?Promise.resolve(r.transform(a.value,o)).then(s=>({status:t.value,value:s})):ip);Q1.assertNever(r)}};Ww.create=(i,e,t)=>new Ww({schema:i,typeName:mp.ZodEffects,effect:e,...zg(t)}),Ww.createWithPreprocess=(i,e,t)=>new Ww({schema:e,effect:{type:"preprocess",transform:i},typeName:mp.ZodEffects,...zg(t)});let YS=class extends ry{_parse(e){return this._getType(e)===rd.undefined?JE(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};YS.create=(i,e)=>new YS({innerType:i,typeName:mp.ZodOptional,...zg(e)});let $w=class extends ry{_parse(e){return this._getType(e)===rd.null?JE(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};$w.create=(i,e)=>new $w({innerType:i,typeName:mp.ZodNullable,...zg(e)});let qU=class extends ry{_parse(e){const{ctx:t}=this._processInputParams(e);let n=t.data;return t.parsedType===rd.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:t.path,parent:t})}removeDefault(){return this._def.innerType}};qU.create=(i,e)=>new qU({innerType:i,typeName:mp.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...zg(e)});let ZU=class extends ry{_parse(e){const{ctx:t}=this._processInputParams(e),n={...t,common:{...t.common,issues:[]}},r=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return zU(r)?r.then(o=>({status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new RB(n.common.issues)},input:n.data})})):{status:"valid",value:r.status==="valid"?r.value:this._def.catchValue({get error(){return new RB(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}};ZU.create=(i,e)=>new ZU({innerType:i,typeName:mp.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...zg(e)});let S2e=class extends ry{_parse(e){if(this._getType(e)!==rd.nan){const n=this._getOrReturnCtx(e);return tA(n,{code:El.invalid_type,expected:rd.nan,received:n.parsedType}),ip}return{status:"valid",value:e.data}}};S2e.create=i=>new S2e({typeName:mp.ZodNaN,...zg(i)});let w2e=class extends ry{_parse(e){const{ctx:t}=this._processInputParams(e),n=t.data;return this._def.type._parse({data:n,path:t.path,parent:t})}unwrap(){return this._def.type}},Bmt=class Ndt extends ry{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.common.async)return(async()=>{const o=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return o.status==="aborted"?ip:o.status==="dirty"?(t.dirty(),y8(o.value)):this._def.out._parseAsync({data:o.value,path:n.path,parent:n})})();{const r=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return r.status==="aborted"?ip:r.status==="dirty"?(t.dirty(),{status:"dirty",value:r.value}):this._def.out._parseSync({data:r.value,path:n.path,parent:n})}}static create(e,t){return new Ndt({in:e,out:t,typeName:mp.ZodPipeline})}},XU=class extends ry{_parse(e){const t=this._def.innerType._parse(e),n=r=>(xM(r)&&(r.value=Object.freeze(r.value)),r);return zU(t)?t.then(r=>n(r)):n(t)}unwrap(){return this._def.innerType}};XU.create=(i,e)=>new XU({innerType:i,typeName:mp.ZodReadonly,...zg(e)});function Q2e(i,e){const t=typeof i=="function"?i(e):typeof i=="string"?{message:i}:i;return typeof t=="string"?{message:t}:t}function NB(i,e={},t){return i?_8.create().superRefine((n,r)=>{const o=i(n);if(o instanceof Promise)return o.then(a=>{if(!a){const s=Q2e(e,n),l=s.fatal??t??!0;r.addIssue({code:"custom",...s,fatal:l})}});if(!o){const a=Q2e(e,n),s=a.fatal??t??!0;r.addIssue({code:"custom",...a,fatal:s})}}):_8.create()}var mp;(function(i){i.ZodString="ZodString",i.ZodNumber="ZodNumber",i.ZodNaN="ZodNaN",i.ZodBigInt="ZodBigInt",i.ZodBoolean="ZodBoolean",i.ZodDate="ZodDate",i.ZodSymbol="ZodSymbol",i.ZodUndefined="ZodUndefined",i.ZodNull="ZodNull",i.ZodAny="ZodAny",i.ZodUnknown="ZodUnknown",i.ZodNever="ZodNever",i.ZodVoid="ZodVoid",i.ZodArray="ZodArray",i.ZodObject="ZodObject",i.ZodUnion="ZodUnion",i.ZodDiscriminatedUnion="ZodDiscriminatedUnion",i.ZodIntersection="ZodIntersection",i.ZodTuple="ZodTuple",i.ZodRecord="ZodRecord",i.ZodMap="ZodMap",i.ZodSet="ZodSet",i.ZodFunction="ZodFunction",i.ZodLazy="ZodLazy",i.ZodLiteral="ZodLiteral",i.ZodEnum="ZodEnum",i.ZodEffects="ZodEffects",i.ZodNativeEnum="ZodNativeEnum",i.ZodOptional="ZodOptional",i.ZodNullable="ZodNullable",i.ZodDefault="ZodDefault",i.ZodCatch="ZodCatch",i.ZodPromise="ZodPromise",i.ZodBranded="ZodBranded",i.ZodPipeline="ZodPipeline",i.ZodReadonly="ZodReadonly"})(mp||(mp={}));const Ve=HU.create,Ki=XX.create,Wo=WX.create,Smt=YU.create,vE=_8.create;EM.create,p3.create;const Ko=bM.create,ti=zS.create,zh=VU.create,g3=xmt.create;KU.create,Xw.create;const dI=Emt.create,wmt=bmt.create,Kn=jU.create,gl=JU.create,Qmt=v8.create;YS.create,$w.create;const Mmt="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";let iW=(i=21)=>{let e="",t=crypto.getRandomValues(new Uint8Array(i|=0));for(;i--;)e+=Mmt[t[i]&63];return e};var M2e={Hz:{baseUnit:"Hz",variants:{MHz:1e6,kHz:1e3,Hz:1}},g:{baseUnit:"g",variants:{kg:1e3,g:1}},Ω:{baseUnit:"Ω",variants:{mΩ:.001,Ω:1,kΩ:1e3,KΩ:1e3,kohm:1e3,MΩ:1e6,GΩ:1e9,TΩ:1e12}},V:{baseUnit:"V",variants:{mV:.001,V:1,kV:1e3,KV:1e3,MV:1e6,GV:1e9,TV:1e12}},A:{baseUnit:"A",variants:{µA:1e-6,mA:.001,ma:.001,A:1,kA:1e3,MA:1e6}},F:{baseUnit:"F",variants:{pF:1e-12,nF:1e-9,µF:1e-6,uF:1e-6,mF:.001,F:1}},ml:{baseUnit:"ml",variants:{ml:1,mL:1,l:1e3,L:1e3}},deg:{baseUnit:"deg",variants:{rad:180/Math.PI}},ms:{baseUnit:"ms",variants:{s:1e3}},mm:{baseUnit:"mm",variants:{nm:1e-6,µm:.001,um:.001,mm:1,cm:10,dm:100,m:1e3,km:1e6,in:25.4,ft:304.8,IN:25.4,FT:304.8,yd:914.4,mi:1609344,mil:.0254}}},rW=new Set;for(const[i,e]of Object.entries(M2e)){rW.add(i);for(const t of Object.keys(e.variants))rW.add(t)}function Rmt(i){for(const[e,t]of Object.entries(M2e))if(i in t.variants)return{baseUnit:t.baseUnit,conversionFactor:t.variants[i]};return{baseUnit:i,conversionFactor:1}}var R2e={tera:1e12,T:1e12,giga:1e9,G:1e9,mega:1e6,M:1e6,kilo:1e3,k:1e3,deci:.1,d:.1,centi:.01,c:.01,milli:.001,m:.001,micro:1e-6,u:1e-6,µ:1e-6,nano:1e-9,n:1e-9,pico:1e-12,p:1e-12},P2=i=>{var s;if(typeof i>"u")return{parsedUnit:null,unitOfValue:null,value:null};if(typeof i=="string"&&i.match(/^-?[\d\.]+$/))return{value:Number.parseFloat(i),parsedUnit:null,unitOfValue:null};if(typeof i=="number")return{value:i,parsedUnit:null,unitOfValue:null};if(typeof i=="object"&&"x"in i&&"y"in i){const{parsedUnit:l,unitOfValue:c}=P2(i.x);return{parsedUnit:l,unitOfValue:c,value:{x:P2(i.x).value,y:P2(i.y).value}}}const t=(s=i.toString().split("").reverse().join("").match(/[^\d\s]+/))==null?void 0:s[0];if(!t)throw new Error(`Could not determine unit: "${i}"`);const n=t.split("").reverse().join(""),r=i.slice(0,-n.length);if(n in R2e&&!rW.has(n)){const l=R2e[n];return{parsedUnit:null,unitOfValue:null,value:Number.parseFloat(r)*l}}const{baseUnit:o,conversionFactor:a}=Rmt(n);return{parsedUnit:n,unitOfValue:o,value:a*Number.parseFloat(r)}},SM=Ve().or(Ki()).transform(i=>P2(i).value),wM=Ve().or(Ki()).transform(i=>P2(i).value).transform(i=>Number.parseFloat(i.toPrecision(12))),oW=Ve().or(Ki()).transform(i=>P2(i).value),e4=Ve().or(Ki()).transform(i=>P2(i).value),yn=Ve().or(Ki()).transform(i=>P2(i).value),WU=Ve().or(Ki()).transform(i=>P2(i).value),cr=yn,Dmt=Ve().or(Ki()).transform(i=>P2(i).value),Nmt=Ve().or(Ki()).transform(i=>P2(i).value),Zx=Ve().or(Ki()).transform(i=>typeof i=="number"?i:i.endsWith("deg")?Number.parseFloat(i.split("deg")[0]):i.endsWith("rad")?Number.parseFloat(i.split("rad")[0])*180/Math.PI:Number.parseFloat(i)),D2e=Ki().or(Ve().endsWith("mAh")).transform(i=>{if(typeof i=="string"){const e=i.replace("mAh",""),t=Number.parseFloat(e);if(Number.isNaN(t))throw new Error("Invalid capacity");return t}return i}).describe("Battery capacity in mAh"),zm=ti({x:cr,y:cr}),Tmt=zm,QM=ti({x:cr,y:cr,z:cr}),kmt=QM,aW=ti({width:Ki(),height:Ki()}),xh=i=>Ve().optional().default(()=>`${i}_${iW(10)}`),$U=gl(["top_left","top_center","top_right","center_left","center","center_right","bottom_left","bottom_center","bottom_right"]),eL=gl(["jlcpcb","macrofab","pcbway","digikey","mouser","lcsc"]),_9=ti({type:Kn("source_component"),ftype:Ve().optional(),source_component_id:Ve(),name:Ve(),manufacturer_part_number:Ve().optional(),supplier_part_numbers:dI(eL,Ko(Ve())).optional(),display_value:Ve().optional(),are_pins_interchangeable:Wo().optional(),internally_connected_source_port_ids:Ko(Ko(Ve())).optional(),source_group_id:Ve().optional(),subcircuit_id:Ve().optional()}),sW=_9.extend({ftype:Kn("simple_capacitor"),capacitance:wM,max_voltage_rating:e4.optional(),display_capacitance:Ve().optional(),max_decoupling_trace_length:cr.optional()}),lW=_9.extend({ftype:Kn("simple_resistor"),resistance:SM,display_resistance:Ve().optional()}),tL=_9.extend({ftype:Kn("simple_diode")}),cW=tL.extend({ftype:Kn("simple_led"),color:Ve().optional(),wavelength:Ve().optional()}),N2e=_9.extend({ftype:Kn("simple_ground")}),uW=_9.extend({ftype:Kn("simple_chip")}),AW=_9.extend({ftype:Kn("simple_power_source"),voltage:e4}),Pmt=_9.extend({ftype:Kn("simple_fuse"),current_rating_amps:Ki().describe("Nominal current in amps the fuse is rated for"),voltage_rating_volts:Ki().describe("Voltage rating in volts, e.g. ±5V would be 5")}),dW=_9.extend({ftype:Kn("simple_battery"),capacity:D2e}),fW=_9.extend({ftype:Kn("simple_inductor"),inductance:oW,max_current_rating:Ki().optional()}),hW=_9.extend({ftype:Kn("simple_push_button")}),pW=_9.extend({ftype:Kn("simple_potentiometer"),max_resistance:SM}),T2e=_9.extend({ftype:Kn("simple_crystal"),frequency:Ki().describe("Frequency in Hz"),load_capacitance:Ki().optional().describe("Load capacitance in pF")}),gW=_9.extend({ftype:Kn("simple_pin_header"),pin_count:Ki(),gender:gl(["male","female"]).optional().default("male")}),mW=_9.extend({ftype:Kn("simple_resonator"),load_capacitance:wM,equivalent_series_resistance:SM.optional(),frequency:WU}),yW=_9.extend({ftype:Kn("simple_transistor"),transistor_type:gl(["npn","pnp"])}),_W=_9.extend({ftype:Kn("simple_test_point"),footprint_variant:gl(["pad","through_hole"]).optional(),pad_shape:gl(["rect","circle"]).optional(),pad_diameter:zh([Ki(),Ve()]).optional(),hole_diameter:zh([Ki(),Ve()]).optional(),width:zh([Ki(),Ve()]).optional(),height:zh([Ki(),Ve()]).optional()}),vW=_9.extend({ftype:Kn("simple_mosfet"),channel_type:gl(["n","p"]),mosfet_mode:gl(["enhancement","depletion"])}),IW=_9.extend({ftype:Kn("simple_switch")}),CW=ti({type:Kn("source_project_metadata"),name:Ve().optional(),software_used_string:Ve().optional(),project_url:Ve().optional(),created_at:Ve().datetime().optional()}),k2e=ti({type:Kn("source_missing_property_error"),source_missing_property_error_id:xh("source_missing_property_error"),source_component_id:Ve(),property_name:Ve(),subcircuit_id:Ve().optional(),error_type:Kn("source_missing_property_error").default("source_missing_property_error"),message:Ve()}).describe("The source code is missing a property"),P2e=ti({type:Kn("source_failed_to_create_component_error"),source_failed_to_create_component_error_id:xh("source_failed_to_create_component_error"),error_type:Kn("source_failed_to_create_component_error").default("source_failed_to_create_component_error"),component_name:Ve().optional(),subcircuit_id:Ve().optional(),parent_source_component_id:Ve().optional(),message:Ve(),pcb_center:ti({x:Ki().optional(),y:Ki().optional()}).optional(),schematic_center:ti({x:Ki().optional(),y:Ki().optional()}).optional()}).describe("Error emitted when a component fails to be constructed"),xW=ti({type:Kn("source_trace_not_connected"),source_trace_not_connected_id:xh("source_trace_not_connected"),error_type:Kn("source_trace_not_connected").default("source_trace_not_connected"),message:Ve(),subcircuit_id:Ve().optional(),source_group_id:Ve().optional(),source_trace_id:Ve().optional(),connected_source_port_ids:Ko(Ve()).optional(),selectors_not_found:Ko(Ve()).optional()}).describe("Occurs when a source trace selector does not match any ports"),U2e=zh([lW,sW,tL,cW,N2e,uW,AW,dW,fW,hW,pW,T2e,gW,mW,IW,yW,_W,vW,Pmt,CW,k2e,P2e,xW]),L2e=ti({type:Kn("source_port"),pin_number:Ki().optional(),port_hints:Ko(Ve()).optional(),name:Ve(),source_port_id:Ve(),source_component_id:Ve(),subcircuit_id:Ve().optional(),subcircuit_connectivity_map_key:Ve().optional()}),F2e=ti({type:Kn("source_trace"),source_trace_id:Ve(),connected_source_port_ids:Ko(Ve()),connected_source_net_ids:Ko(Ve()),subcircuit_id:Ve().optional(),subcircuit_connectivity_map_key:Ve().optional(),max_length:Ki().optional(),min_trace_thickness:Ki().optional(),display_name:Ve().optional()}),G2e=ti({type:Kn("source_group"),source_group_id:Ve(),subcircuit_id:Ve().optional(),parent_subcircuit_id:Ve().optional(),parent_source_group_id:Ve().optional(),is_subcircuit:Wo().optional(),name:Ve().optional()}),O2e=ti({type:Kn("source_net"),source_net_id:Ve(),name:Ve(),member_source_group_ids:Ko(Ve()),is_power:Wo().optional(),is_ground:Wo().optional(),is_digital_signal:Wo().optional(),is_analog_signal:Wo().optional(),trace_width:Ki().optional(),subcircuit_id:Ve().optional(),subcircuit_connectivity_map_key:Ve().optional()}),z2e=ti({type:Kn("source_pcb_ground_plane"),source_pcb_ground_plane_id:Ve(),source_group_id:Ve(),source_net_id:Ve(),subcircuit_id:Ve().optional()}).describe("Defines a ground plane in the source domain"),H2e=ti({type:Kn("schematic_box"),schematic_component_id:Ve().optional(),width:cr,height:cr,is_dashed:Wo().default(!1),x:cr,y:cr,subcircuit_id:Ve().optional()}).describe("Draws a box on the schematic"),Y2e=ti({type:Kn("schematic_path"),schematic_component_id:Ve(),fill_color:gl(["red","blue"]).optional(),is_filled:Wo().optional(),points:Ko(zm),subcircuit_id:Ve().optional()}),V2e=dI(ti({left_margin:yn.optional(),right_margin:yn.optional(),top_margin:yn.optional(),bottom_margin:yn.optional()})),K2e=ti({left_size:Ki(),right_size:Ki(),top_size:Ki().optional(),bottom_size:Ki().optional()}),j2e=ti({left_side:ti({pins:Ko(Ki()),direction:gl(["top-to-bottom","bottom-to-top"]).optional()}).optional(),right_side:ti({pins:Ko(Ki()),direction:gl(["top-to-bottom","bottom-to-top"]).optional()}).optional(),top_side:ti({pins:Ko(Ki()),direction:gl(["left-to-right","right-to-left"]).optional()}).optional(),bottom_side:ti({pins:Ko(Ki()),direction:gl(["left-to-right","right-to-left"]).optional()}).optional()}),J2e=zh([K2e,j2e]),q2e=ti({type:Kn("schematic_component"),size:aW,center:zm,source_component_id:Ve(),schematic_component_id:Ve(),pin_spacing:yn.optional(),pin_styles:V2e.optional(),box_width:yn.optional(),symbol_name:Ve().optional(),port_arrangement:J2e.optional(),port_labels:dI(Ve()).optional(),symbol_display_value:Ve().optional(),subcircuit_id:Ve().optional(),schematic_group_id:Ve().optional()}),Z2e=ti({type:Kn("schematic_line"),schematic_component_id:Ve(),x1:cr,x2:cr,y1:cr,y2:cr,subcircuit_id:Ve().optional()}),X2e=ti({type:Kn("schematic_trace"),schematic_trace_id:Ve(),source_trace_id:Ve(),junctions:Ko(ti({x:Ki(),y:Ki()})),edges:Ko(ti({from:ti({x:Ki(),y:Ki()}),to:ti({x:Ki(),y:Ki()}),is_crossing:Wo().optional(),from_schematic_port_id:Ve().optional(),to_schematic_port_id:Ve().optional()})),subcircuit_id:Ve().optional()}),Umt=gl(["center","left","right","top","bottom"]),W2e=ti({type:Kn("schematic_text"),schematic_component_id:Ve().optional(),schematic_text_id:Ve(),text:Ve(),font_size:Ki().default(.18),position:ti({x:cr,y:cr}),rotation:Ki().default(0),anchor:zh([Umt.describe("legacy"),$U]).default("center"),color:Ve().default("#000000"),subcircuit_id:Ve().optional()}),$2e=ti({type:Kn("schematic_port"),schematic_port_id:Ve(),source_port_id:Ve(),schematic_component_id:Ve().optional(),center:zm,facing_direction:gl(["up","down","left","right"]).optional(),distance_from_component_edge:Ki().optional(),side_of_component:gl(["top","bottom","left","right"]).optional(),true_ccw_index:Ki().optional(),pin_number:Ki().optional(),display_pin_label:Ve().optional(),subcircuit_id:Ve().optional(),is_connected:Wo().optional()}).describe("Defines a port on a schematic component"),eBe=ti({type:Kn("schematic_net_label"),schematic_net_label_id:xh("schematic_net_label"),schematic_trace_id:Ve().optional(),source_trace_id:Ve().optional(),source_net_id:Ve(),center:zm,anchor_position:zm.optional(),anchor_side:gl(["top","bottom","left","right"]),text:Ve(),symbol_name:Ve().optional(),is_movable:Wo().optional(),subcircuit_id:Ve().optional()}),tBe=ti({type:Kn("schematic_error"),schematic_error_id:Ve(),error_type:Kn("schematic_port_not_found").default("schematic_port_not_found"),message:Ve(),subcircuit_id:Ve().optional()}).describe("Defines a schematic error on the schematic"),nBe=ti({type:Kn("schematic_layout_error"),schematic_layout_error_id:xh("schematic_layout_error"),error_type:Kn("schematic_layout_error").default("schematic_layout_error"),message:Ve(),source_group_id:Ve(),schematic_group_id:Ve(),subcircuit_id:Ve().optional()}).describe("Error emitted when schematic layout fails for a group"),nL=ti({type:Kn("schematic_debug_object"),label:Ve().optional(),subcircuit_id:Ve().optional()}),iBe=nL.extend({shape:Kn("rect"),center:zm,size:aW}),rBe=nL.extend({shape:Kn("line"),start:zm,end:zm}),oBe=nL.extend({shape:Kn("point"),center:zm}),aBe=g3("shape",[iBe,rBe,oBe]),sBe=ti({type:Kn("schematic_voltage_probe"),schematic_voltage_probe_id:Ve(),position:zm,schematic_trace_id:Ve(),voltage:e4.optional(),subcircuit_id:Ve().optional()}).describe("Defines a voltage probe measurement point on a schematic trace"),EW=ti({type:Kn("schematic_manual_edit_conflict_warning"),schematic_manual_edit_conflict_warning_id:xh("schematic_manual_edit_conflict_warning"),warning_type:Kn("schematic_manual_edit_conflict_warning").default("schematic_manual_edit_conflict_warning"),message:Ve(),schematic_component_id:Ve(),schematic_group_id:Ve().optional(),subcircuit_id:Ve().optional(),source_component_id:Ve()}).describe("Warning emitted when a component has both manual placement and explicit schX/schY coordinates"),lBe=ti({type:Kn("schematic_group"),schematic_group_id:xh("schematic_group"),source_group_id:Ve(),is_subcircuit:Wo().optional(),subcircuit_id:Ve().optional(),width:yn,height:yn,center:zm,schematic_component_ids:Ko(Ve()),name:Ve().optional(),description:Ve().optional()}).describe("Defines a group of components on the schematic"),cBe=ti({type:Kn("schematic_table"),schematic_table_id:xh("schematic_table"),anchor_position:zm,column_widths:Ko(cr),row_heights:Ko(cr),cell_padding:cr.optional(),border_width:cr.optional(),subcircuit_id:Ve().optional(),schematic_component_id:Ve().optional(),anchor:$U.optional()}).describe("Defines a table on the schematic"),uBe=ti({type:Kn("schematic_table_cell"),schematic_table_cell_id:xh("schematic_table_cell"),schematic_table_id:Ve(),start_row_index:Ki(),end_row_index:Ki(),start_column_index:Ki(),end_column_index:Ki(),text:Ve().optional(),center:zm,width:cr,height:cr,horizontal_align:gl(["left","center","right"]).optional(),vertical_align:gl(["top","middle","bottom"]).optional(),font_size:cr.optional(),subcircuit_id:Ve().optional()}).describe("Defines a cell within a schematic_table"),I8=["top","bottom","inner1","inner2","inner3","inner4","inner5","inner6"],bW=gl(I8),oy=bW.or(ti({name:bW})).transform(i=>typeof i=="string"?i:i.name),MM=gl(["top","bottom"]),ABe=ti({x:cr,y:cr,via:Wo().optional(),via_to_layer:oy.optional()}),Lmt=Ko(ABe),VS=ti({x:cr,y:cr,via:Wo().optional(),to_layer:oy.optional(),trace_width:cr.optional()}),dBe=ti({type:Kn("pcb_component"),pcb_component_id:xh("pcb_component"),source_component_id:Ve(),center:zm,layer:oy,rotation:Zx,width:yn,height:yn,subcircuit_id:Ve().optional(),pcb_group_id:Ve().optional()}).describe("Defines a component on the PCB"),fBe=ti({type:Kn("pcb_hole"),pcb_hole_id:xh("pcb_hole"),pcb_group_id:Ve().optional(),subcircuit_id:Ve().optional(),hole_shape:gl(["circle","square"]),hole_diameter:Ki(),x:cr,y:cr}),Fmt=fBe.describe("Defines a circular or square hole on the PCB"),hBe=ti({type:Kn("pcb_hole"),pcb_hole_id:xh("pcb_hole"),pcb_group_id:Ve().optional(),subcircuit_id:Ve().optional(),hole_shape:Kn("oval"),hole_width:Ki(),hole_height:Ki(),x:cr,y:cr}),Gmt=hBe.describe("Defines an oval hole on the PCB"),pBe=fBe.or(hBe),Omt=ti({type:Kn("pcb_plated_hole"),shape:Kn("circle"),pcb_group_id:Ve().optional(),subcircuit_id:Ve().optional(),outer_diameter:Ki(),hole_diameter:Ki(),x:cr,y:cr,layers:Ko(oy),port_hints:Ko(Ve()).optional(),pcb_component_id:Ve().optional(),pcb_port_id:Ve().optional(),pcb_plated_hole_id:xh("pcb_plated_hole")}),zmt=ti({type:Kn("pcb_plated_hole"),shape:gl(["oval","pill"]),pcb_group_id:Ve().optional(),subcircuit_id:Ve().optional(),outer_width:Ki(),outer_height:Ki(),hole_width:Ki(),hole_height:Ki(),x:cr,y:cr,layers:Ko(oy),port_hints:Ko(Ve()).optional(),pcb_component_id:Ve().optional(),pcb_port_id:Ve().optional(),pcb_plated_hole_id:xh("pcb_plated_hole")}),Hmt=ti({type:Kn("pcb_plated_hole"),shape:Kn("circular_hole_with_rect_pad"),pcb_group_id:Ve().optional(),subcircuit_id:Ve().optional(),hole_shape:Kn("circle"),pad_shape:Kn("rect"),hole_diameter:Ki(),rect_pad_width:Ki(),rect_pad_height:Ki(),x:cr,y:cr,layers:Ko(oy),port_hints:Ko(Ve()).optional(),pcb_component_id:Ve().optional(),pcb_port_id:Ve().optional(),pcb_plated_hole_id:xh("pcb_plated_hole")}),Ymt=ti({type:Kn("pcb_plated_hole"),shape:Kn("pill_hole_with_rect_pad"),pcb_group_id:Ve().optional(),subcircuit_id:Ve().optional(),hole_shape:Kn("pill"),pad_shape:Kn("rect"),hole_width:Ki(),hole_height:Ki(),rect_pad_width:Ki(),rect_pad_height:Ki(),x:cr,y:cr,layers:Ko(oy),port_hints:Ko(Ve()).optional(),pcb_component_id:Ve().optional(),pcb_port_id:Ve().optional(),pcb_plated_hole_id:xh("pcb_plated_hole")}),Vmt=ti({type:Kn("pcb_plated_hole"),shape:Kn("rotated_pill_hole_with_rect_pad"),pcb_group_id:Ve().optional(),subcircuit_id:Ve().optional(),hole_shape:Kn("rotated_pill"),pad_shape:Kn("rect"),hole_width:Ki(),hole_height:Ki(),hole_ccw_rotation:Zx,rect_pad_width:Ki(),rect_pad_height:Ki(),rect_ccw_rotation:Zx,x:cr,y:cr,layers:Ko(oy),port_hints:Ko(Ve()).optional(),pcb_component_id:Ve().optional(),pcb_port_id:Ve().optional(),pcb_plated_hole_id:xh("pcb_plated_hole")}),gBe=zh([Omt,zmt,Hmt,Ymt,Vmt]),mBe=ti({type:Kn("pcb_port"),pcb_port_id:xh("pcb_port"),pcb_group_id:Ve().optional(),subcircuit_id:Ve().optional(),source_port_id:Ve(),pcb_component_id:Ve(),x:cr,y:cr,layers:Ko(oy)}).describe("Defines a port on the PCB"),Kmt=ti({type:Kn("pcb_smtpad"),shape:Kn("circle"),pcb_smtpad_id:xh("pcb_smtpad"),pcb_group_id:Ve().optional(),subcircuit_id:Ve().optional(),x:cr,y:cr,radius:Ki(),layer:oy,port_hints:Ko(Ve()).optional(),pcb_component_id:Ve().optional(),pcb_port_id:Ve().optional()}),jmt=ti({type:Kn("pcb_smtpad"),shape:Kn("rect"),pcb_smtpad_id:xh("pcb_smtpad"),pcb_group_id:Ve().optional(),subcircuit_id:Ve().optional(),x:cr,y:cr,width:Ki(),height:Ki(),layer:oy,port_hints:Ko(Ve()).optional(),pcb_component_id:Ve().optional(),pcb_port_id:Ve().optional()}),Jmt=ti({type:Kn("pcb_smtpad"),shape:Kn("rotated_rect"),pcb_smtpad_id:xh("pcb_smtpad"),pcb_group_id:Ve().optional(),subcircuit_id:Ve().optional(),x:cr,y:cr,width:Ki(),height:Ki(),ccw_rotation:Zx,layer:oy,port_hints:Ko(Ve()).optional(),pcb_component_id:Ve().optional(),pcb_port_id:Ve().optional()}),yBe=ti({type:Kn("pcb_smtpad"),shape:Kn("pill"),pcb_smtpad_id:xh("pcb_smtpad"),pcb_group_id:Ve().optional(),subcircuit_id:Ve().optional(),x:cr,y:cr,width:Ki(),height:Ki(),radius:Ki(),layer:oy,port_hints:Ko(Ve()).optional(),pcb_component_id:Ve().optional(),pcb_port_id:Ve().optional()}),qmt=ti({type:Kn("pcb_smtpad"),shape:Kn("rotated_pill"),pcb_smtpad_id:xh("pcb_smtpad"),pcb_group_id:Ve().optional(),subcircuit_id:Ve().optional(),x:cr,y:cr,width:Ki(),height:Ki(),radius:Ki(),ccw_rotation:Zx,layer:oy,port_hints:Ko(Ve()).optional(),pcb_component_id:Ve().optional(),pcb_port_id:Ve().optional()}),Zmt=ti({type:Kn("pcb_smtpad"),shape:Kn("polygon"),pcb_smtpad_id:xh("pcb_smtpad"),pcb_group_id:Ve().optional(),subcircuit_id:Ve().optional(),points:Ko(zm),layer:oy,port_hints:Ko(Ve()).optional(),pcb_component_id:Ve().optional(),pcb_port_id:Ve().optional()}),_Be=g3("shape",[Kmt,jmt,Jmt,qmt,yBe,Zmt]).describe("Defines an SMT pad on the PCB"),Xmt=ti({type:Kn("pcb_solder_paste"),shape:Kn("circle"),pcb_solder_paste_id:xh("pcb_solder_paste"),pcb_group_id:Ve().optional(),subcircuit_id:Ve().optional(),x:cr,y:cr,radius:Ki(),layer:oy,pcb_component_id:Ve().optional(),pcb_smtpad_id:Ve().optional()}),Wmt=ti({type:Kn("pcb_solder_paste"),shape:Kn("rect"),pcb_solder_paste_id:xh("pcb_solder_paste"),pcb_group_id:Ve().optional(),subcircuit_id:Ve().optional(),x:cr,y:cr,width:Ki(),height:Ki(),layer:oy,pcb_component_id:Ve().optional(),pcb_smtpad_id:Ve().optional()}),$mt=ti({type:Kn("pcb_solder_paste"),shape:Kn("pill"),pcb_solder_paste_id:xh("pcb_solder_paste"),pcb_group_id:Ve().optional(),subcircuit_id:Ve().optional(),x:cr,y:cr,width:Ki(),height:Ki(),radius:Ki(),layer:oy,pcb_component_id:Ve().optional(),pcb_smtpad_id:Ve().optional()}),eyt=ti({type:Kn("pcb_solder_paste"),shape:Kn("rotated_rect"),pcb_solder_paste_id:xh("pcb_solder_paste"),pcb_group_id:Ve().optional(),subcircuit_id:Ve().optional(),x:cr,y:cr,width:Ki(),height:Ki(),ccw_rotation:cr,layer:oy,pcb_component_id:Ve().optional(),pcb_smtpad_id:Ve().optional()}),tyt=ti({type:Kn("pcb_solder_paste"),shape:Kn("oval"),pcb_solder_paste_id:xh("pcb_solder_paste"),pcb_group_id:Ve().optional(),subcircuit_id:Ve().optional(),x:cr,y:cr,width:Ki(),height:Ki(),layer:oy,pcb_component_id:Ve().optional(),pcb_smtpad_id:Ve().optional()}),vBe=zh([Xmt,Wmt,$mt,eyt,tyt]).describe("Defines solderpaste on the PCB"),IBe=ti({type:Kn("pcb_text"),pcb_text_id:xh("pcb_text"),pcb_group_id:Ve().optional(),subcircuit_id:Ve().optional(),text:Ve(),center:zm,layer:oy,width:yn,height:yn,lines:Ki(),align:gl(["bottom-left"])}).describe("Defines text on the PCB"),CBe=ti({route_type:Kn("wire"),x:cr,y:cr,width:cr,start_pcb_port_id:Ve().optional(),end_pcb_port_id:Ve().optional(),layer:oy}),xBe=ti({route_type:Kn("via"),x:cr,y:cr,hole_diameter:cr.optional(),outer_diameter:cr.optional(),from_layer:Ve(),to_layer:Ve()}),BW=zh([CBe,xBe]),EBe=ti({type:Kn("pcb_trace"),source_trace_id:Ve().optional(),pcb_component_id:Ve().optional(),pcb_trace_id:xh("pcb_trace"),pcb_group_id:Ve().optional(),subcircuit_id:Ve().optional(),route_thickness_mode:gl(["constant","interpolated"]).default("constant").optional(),route_order_index:Ki().optional(),should_round_corners:Wo().optional(),trace_length:Ki().optional(),route:Ko(BW)}).describe("Defines a trace on the PCB"),bBe=ti({type:Kn("pcb_trace_error"),pcb_trace_error_id:xh("pcb_trace_error"),error_type:Kn("pcb_trace_error").default("pcb_trace_error"),message:Ve(),center:zm.optional(),pcb_trace_id:Ve(),source_trace_id:Ve(),pcb_component_ids:Ko(Ve()),pcb_port_ids:Ko(Ve()),subcircuit_id:Ve().optional()}).describe("Defines a trace error on the PCB"),BBe=ti({type:Kn("pcb_port_not_matched_error"),pcb_error_id:xh("pcb_error"),error_type:Kn("pcb_port_not_matched_error").default("pcb_port_not_matched_error"),message:Ve(),pcb_component_ids:Ko(Ve()),subcircuit_id:Ve().optional()}).describe("Defines a trace error on the PCB where a port is not matched"),SBe=ti({type:Kn("pcb_via"),pcb_via_id:xh("pcb_via"),pcb_group_id:Ve().optional(),subcircuit_id:Ve().optional(),x:cr,y:cr,outer_diameter:cr.default("0.6mm"),hole_diameter:cr.default("0.25mm"),from_layer:oy.optional(),to_layer:oy.optional(),layers:Ko(oy),pcb_trace_id:Ve().optional()}).describe("Defines a via on the PCB"),wBe=ti({type:Kn("pcb_board"),pcb_board_id:xh("pcb_board"),is_subcircuit:Wo().optional(),subcircuit_id:Ve().optional(),width:yn,height:yn,center:zm,thickness:yn.optional().default(1.4),num_layers:Ki().optional().default(4),outline:Ko(zm).optional(),material:gl(["fr4","fr1"]).default("fr4")}).describe("Defines the board outline of the PCB"),QBe=ti({type:Kn("pcb_placement_error"),pcb_placement_error_id:xh("pcb_placement_error"),error_type:Kn("pcb_placement_error").default("pcb_placement_error"),message:Ve(),subcircuit_id:Ve().optional()}).describe("Defines a placement error on the PCB"),MBe=ti({type:Kn("pcb_trace_hint"),pcb_trace_hint_id:xh("pcb_trace_hint"),pcb_port_id:Ve(),pcb_component_id:Ve(),route:Ko(VS),subcircuit_id:Ve().optional()}).describe("A hint that can be used during generation of a PCB trace"),RBe=ti({type:Kn("pcb_silkscreen_line"),pcb_silkscreen_line_id:xh("pcb_silkscreen_line"),pcb_component_id:Ve(),pcb_group_id:Ve().optional(),subcircuit_id:Ve().optional(),stroke_width:cr.default("0.1mm"),x1:cr,y1:cr,x2:cr,y2:cr,layer:MM}).describe("Defines a silkscreen line on the PCB"),DBe=ti({type:Kn("pcb_silkscreen_path"),pcb_silkscreen_path_id:xh("pcb_silkscreen_path"),pcb_component_id:Ve(),pcb_group_id:Ve().optional(),subcircuit_id:Ve().optional(),layer:MM,route:Ko(zm),stroke_width:yn}).describe("Defines a silkscreen path on the PCB"),NBe=ti({type:Kn("pcb_silkscreen_text"),pcb_silkscreen_text_id:xh("pcb_silkscreen_text"),pcb_group_id:Ve().optional(),subcircuit_id:Ve().optional(),font:Kn("tscircuit2024").default("tscircuit2024"),font_size:cr.default("0.2mm"),pcb_component_id:Ve(),text:Ve(),ccw_rotation:Ki().optional(),layer:oy,is_mirrored:Wo().default(!1).optional(),anchor_position:zm.default({x:0,y:0}),anchor_alignment:$U.default("center")}).describe("Defines silkscreen text on the PCB"),TBe=ti({type:Kn("pcb_silkscreen_rect"),pcb_silkscreen_rect_id:xh("pcb_silkscreen_rect"),pcb_component_id:Ve(),pcb_group_id:Ve().optional(),subcircuit_id:Ve().optional(),center:zm,width:yn,height:yn,layer:oy,stroke_width:yn.default("1mm"),is_filled:Wo().default(!0).optional(),has_stroke:Wo().optional(),is_stroke_dashed:Wo().optional()}).describe("Defines a silkscreen rect on the PCB"),kBe=ti({type:Kn("pcb_silkscreen_circle"),pcb_silkscreen_circle_id:xh("pcb_silkscreen_circle"),pcb_component_id:Ve(),pcb_group_id:Ve().optional(),subcircuit_id:Ve().optional(),center:zm,radius:yn,layer:MM,stroke_width:yn.default("1mm")}).describe("Defines a silkscreen circle on the PCB"),PBe=ti({type:Kn("pcb_silkscreen_oval"),pcb_silkscreen_oval_id:xh("pcb_silkscreen_oval"),pcb_component_id:Ve(),pcb_group_id:Ve().optional(),subcircuit_id:Ve().optional(),center:zm,radius_x:cr,radius_y:cr,layer:MM}).describe("Defines a silkscreen oval on the PCB"),UBe=ti({type:Kn("pcb_fabrication_note_text"),pcb_fabrication_note_text_id:xh("pcb_fabrication_note_text"),subcircuit_id:Ve().optional(),pcb_group_id:Ve().optional(),font:Kn("tscircuit2024").default("tscircuit2024"),font_size:cr.default("1mm"),pcb_component_id:Ve(),text:Ve(),layer:MM,anchor_position:zm.default({x:0,y:0}),anchor_alignment:gl(["center","top_left","top_right","bottom_left","bottom_right"]).default("center"),color:Ve().optional()}).describe("Defines a fabrication note in text on the PCB, useful for leaving notes for assemblers or fabricators"),LBe=ti({type:Kn("pcb_fabrication_note_path"),pcb_fabrication_note_path_id:xh("pcb_fabrication_note_path"),pcb_component_id:Ve(),subcircuit_id:Ve().optional(),layer:oy,route:Ko(zm),stroke_width:yn,color:Ve().optional()}).describe("Defines a fabrication path on the PCB for fabricators or assemblers"),FBe=ti({type:Kn("pcb_footprint_overlap_error"),pcb_error_id:xh("pcb_error"),error_type:Kn("pcb_footprint_overlap_error").default("pcb_footprint_overlap_error"),message:Ve(),pcb_smtpad_ids:Ko(Ve()).optional(),pcb_plated_hole_ids:Ko(Ve()).optional(),pcb_hole_ids:Ko(Ve()).optional(),pcb_keepout_ids:Ko(Ve()).optional()}).describe("Error emitted when a pcb footprint overlaps with another element"),GBe=ti({type:Kn("pcb_keepout"),shape:Kn("rect"),pcb_group_id:Ve().optional(),subcircuit_id:Ve().optional(),center:zm,width:cr,height:cr,pcb_keepout_id:Ve(),layers:Ko(Ve()),description:Ve().optional()}).or(ti({type:Kn("pcb_keepout"),shape:Kn("circle"),pcb_group_id:Ve().optional(),subcircuit_id:Ve().optional(),center:zm,radius:cr,pcb_keepout_id:Ve(),layers:Ko(Ve()),description:Ve().optional()})),SW=ti({type:Kn("pcb_cutout"),pcb_cutout_id:xh("pcb_cutout"),pcb_group_id:Ve().optional(),subcircuit_id:Ve().optional()}),OBe=SW.extend({shape:Kn("rect"),center:zm,width:yn,height:yn,rotation:Zx.optional()}),zBe=SW.extend({shape:Kn("circle"),center:zm,radius:yn}),HBe=SW.extend({shape:Kn("polygon"),points:Ko(zm)}),YBe=g3("shape",[OBe,zBe,HBe]).describe("Defines a cutout on the PCB, removing board material."),VBe=ti({type:Kn("pcb_missing_footprint_error"),pcb_missing_footprint_error_id:xh("pcb_missing_footprint_error"),pcb_group_id:Ve().optional(),subcircuit_id:Ve().optional(),error_type:Kn("pcb_missing_footprint_error").default("pcb_missing_footprint_error"),source_component_id:Ve(),message:Ve()}).describe("Defines a missing footprint error on the PCB"),KBe=ti({type:Kn("pcb_group"),pcb_group_id:xh("pcb_group"),source_group_id:Ve(),is_subcircuit:Wo().optional(),subcircuit_id:Ve().optional(),width:yn,height:yn,center:zm,pcb_component_ids:Ko(Ve()),name:Ve().optional(),description:Ve().optional(),layout_mode:Ve().optional(),autorouter_configuration:ti({trace_clearance:yn}).optional(),autorouter_used_string:Ve().optional()}).describe("Defines a group of components on the PCB"),jBe=ti({type:Kn("pcb_autorouting_error"),pcb_error_id:xh("pcb_autorouting_error"),error_type:Kn("pcb_autorouting_error").default("pcb_autorouting_error"),message:Ve(),subcircuit_id:Ve().optional()}).describe("The autorouting has failed to route a portion of the board"),wW=ti({type:Kn("pcb_manual_edit_conflict_warning"),pcb_manual_edit_conflict_warning_id:xh("pcb_manual_edit_conflict_warning"),warning_type:Kn("pcb_manual_edit_conflict_warning").default("pcb_manual_edit_conflict_warning"),message:Ve(),pcb_component_id:Ve(),pcb_group_id:Ve().optional(),subcircuit_id:Ve().optional(),source_component_id:Ve()}).describe("Warning emitted when a component has both manual placement and explicit pcbX/pcbY coordinates"),JBe=ti({type:Kn("pcb_breakout_point"),pcb_breakout_point_id:xh("pcb_breakout_point"),pcb_group_id:Ve(),subcircuit_id:Ve().optional(),source_trace_id:Ve().optional(),source_port_id:Ve().optional(),source_net_id:Ve().optional(),x:cr,y:cr}).describe("Defines a routing target within a pcb_group for a source_trace or source_net"),qBe=ti({type:Kn("pcb_ground_plane"),pcb_ground_plane_id:xh("pcb_ground_plane"),source_pcb_ground_plane_id:Ve(),source_net_id:Ve(),pcb_group_id:Ve().optional(),subcircuit_id:Ve().optional()}).describe("Defines a ground plane on the PCB"),ZBe=ti({type:Kn("pcb_ground_plane_region"),pcb_ground_plane_region_id:xh("pcb_ground_plane_region"),pcb_ground_plane_id:Ve(),pcb_group_id:Ve().optional(),subcircuit_id:Ve().optional(),layer:oy,points:Ko(zm)}).describe("Defines a polygon region of a ground plane"),XBe=ti({type:Kn("pcb_thermal_spoke"),pcb_thermal_spoke_id:xh("pcb_thermal_spoke"),pcb_ground_plane_id:Ve(),shape:Ve(),spoke_count:Ki(),spoke_thickness:cr,spoke_inner_diameter:cr,spoke_outer_diameter:cr,pcb_plated_hole_id:Ve().optional(),subcircuit_id:Ve().optional()}).describe("Pattern for connecting a ground plane to a plated hole"),WBe=ti({type:Kn("cad_component"),cad_component_id:Ve(),pcb_component_id:Ve(),source_component_id:Ve(),position:QM,rotation:QM.optional(),size:QM.optional(),layer:oy.optional(),subcircuit_id:Ve().optional(),footprinter_string:Ve().optional(),model_obj_url:Ve().optional(),model_stl_url:Ve().optional(),model_3mf_url:Ve().optional(),model_jscad:vE().optional()}).describe("Defines a component on the PCB"),$Be=ti({type:Kn("simulation_voltage_source"),simulation_voltage_source_id:xh("simulation_voltage_source"),positive_source_port_id:Ve(),negative_source_port_id:Ve(),voltage:e4}).describe("Defines a voltage source for simulation"),eSe=zh([F2e,L2e,U2e,O2e,G2e,uW,sW,tL,cW,lW,AW,dW,fW,gW,mW,IW,yW,_W,vW,pW,hW,z2e,CW,xW,dBe,pBe,VBe,wW,gBe,GBe,mBe,IBe,EBe,SBe,_Be,vBe,wBe,KBe,MBe,RBe,DBe,NBe,TBe,kBe,PBe,bBe,QBe,BBe,LBe,UBe,jBe,FBe,JBe,YBe,qBe,ZBe,XBe,H2e,W2e,Z2e,q2e,$2e,X2e,Y2e,tBe,nBe,eBe,aBe,sBe,EW,lBe,cBe,uBe,WBe,$Be]),iL=eSe;const QW=Object.freeze(Object.defineProperty({__proto__:null,all_layers:I8,any_circuit_element:eSe,any_soup_element:iL,any_source_component:U2e,battery_capacity:D2e,cad_component:WBe,capacitance:wM,current:Dmt,distance:cr,frequency:WU,getZodPrefixedIdWithDefault:xh,inductance:oW,layer_ref:oy,layer_string:bW,length:yn,ninePointAnchor:$U,pcb_autorouting_error:jBe,pcb_board:wBe,pcb_breakout_point:JBe,pcb_component:dBe,pcb_cutout:YBe,pcb_cutout_circle:zBe,pcb_cutout_polygon:HBe,pcb_cutout_rect:OBe,pcb_fabrication_note_path:LBe,pcb_fabrication_note_text:UBe,pcb_footprint_overlap_error:FBe,pcb_ground_plane:qBe,pcb_ground_plane_region:ZBe,pcb_group:KBe,pcb_hole:pBe,pcb_hole_circle_or_square_shape:Fmt,pcb_hole_oval_shape:Gmt,pcb_keepout:GBe,pcb_manual_edit_conflict_warning:wW,pcb_missing_footprint_error:VBe,pcb_placement_error:QBe,pcb_plated_hole:gBe,pcb_port:mBe,pcb_port_not_matched_error:BBe,pcb_route_hint:ABe,pcb_route_hints:Lmt,pcb_silkscreen_circle:kBe,pcb_silkscreen_line:RBe,pcb_silkscreen_oval:PBe,pcb_silkscreen_path:DBe,pcb_silkscreen_rect:TBe,pcb_silkscreen_text:NBe,pcb_smtpad:_Be,pcb_smtpad_pill:yBe,pcb_solder_paste:vBe,pcb_text:IBe,pcb_thermal_spoke:XBe,pcb_trace:EBe,pcb_trace_error:bBe,pcb_trace_hint:MBe,pcb_trace_route_point:BW,pcb_trace_route_point_via:xBe,pcb_trace_route_point_wire:CBe,pcb_via:SBe,point:zm,point3:QM,port_arrangement:J2e,position:Tmt,position3:kmt,resistance:SM,rotation:Zx,route_hint_point:VS,schematic_box:H2e,schematic_component:q2e,schematic_component_port_arrangement_by_sides:j2e,schematic_component_port_arrangement_by_size:K2e,schematic_debug_line:rBe,schematic_debug_object:aBe,schematic_debug_object_base:nL,schematic_debug_point:oBe,schematic_debug_rect:iBe,schematic_error:tBe,schematic_group:lBe,schematic_layout_error:nBe,schematic_line:Z2e,schematic_manual_edit_conflict_warning:EW,schematic_net_label:eBe,schematic_path:Y2e,schematic_pin_styles:V2e,schematic_port:$2e,schematic_table:cBe,schematic_table_cell:uBe,schematic_text:W2e,schematic_trace:X2e,schematic_voltage_probe:sBe,simulation_voltage_source:$Be,size:aW,source_component_base:_9,source_failed_to_create_component_error:P2e,source_group:G2e,source_missing_property_error:k2e,source_net:O2e,source_pcb_ground_plane:z2e,source_port:L2e,source_project_metadata:CW,source_simple_battery:dW,source_simple_capacitor:sW,source_simple_chip:uW,source_simple_crystal:T2e,source_simple_diode:tL,source_simple_ground:N2e,source_simple_inductor:fW,source_simple_led:cW,source_simple_mosfet:vW,source_simple_pin_header:gW,source_simple_potentiometer:pW,source_simple_power_source:AW,source_simple_push_button:hW,source_simple_resistor:lW,source_simple_resonator:mW,source_simple_switch:IW,source_simple_test_point:_W,source_simple_transistor:yW,source_trace:F2e,source_trace_not_connected:xW,supplier_name:eL,time:Nmt,visible_layer:MM,voltage:e4},Symbol.toStringTag,{value:"Module"}));function Ar(i,e){return Array.isArray(e)?[i.a*e[0]+i.c*e[1]+i.e,i.b*e[0]+i.d*e[1]+i.f]:{x:i.a*e.x+i.c*e.y+i.e,y:i.b*e.x+i.d*e.y+i.f}}function nyt(i,e){return e.map(t=>Ar(i,t))}function tSe(i){return{a:parseFloat(i.a),b:parseFloat(i.b),c:parseFloat(i.c),d:parseFloat(i.d),e:parseFloat(i.e),f:parseFloat(i.f)}}const iyt=/^matrix\(\s*([0-9_+-.e]+)\s*,\s*([0-9_+-.e]+)\s*,\s*([0-9_+-.e]+)\s*,\s*([0-9_+-.e]+)\s*,\s*([0-9_+-.e]+)\s*,\s*([0-9_+-.e]+)\s*\)$/i;function MW(i){const e=i.match(iyt);if(e===null||e.length<7)throw new Error(`'${i}' is not a matrix`);return{a:parseFloat(e[1]),b:parseFloat(e[2]),c:parseFloat(e[3]),d:parseFloat(e[4]),e:parseFloat(e[5]),f:parseFloat(e[6])}}function x_(){return{a:1,c:0,e:0,b:0,d:1,f:0}}function U2(i){const{a:e,b:t,c:n,d:r,e:o,f:a}=i,s=e*r-t*n;return{a:r/s,b:t/-s,c:n/-s,d:e/s,e:(r*o-n*a)/-s,f:(t*o-e*a)/s}}function C8(i){return typeof i>"u"}function RM(i){return typeof i=="number"&&!Number.isNaN(i)&&Number.isFinite(i)}function ryt(i){return typeof i=="object"&&i!==null&&!Array.isArray(i)}function oyt(i){return ryt(i)&&"a"in i&&RM(i.a)&&"b"in i&&RM(i.b)&&"c"in i&&RM(i.c)&&"d"in i&&RM(i.d)&&"e"in i&&RM(i.e)&&"f"in i&&RM(i.f)}function Hh(i,e=0){return{a:1,c:0,e:i,b:0,d:1,f:e}}function TB(...i){i=Array.isArray(i[0])?i[0]:i;const e=(t,n)=>({a:t.a*n.a+t.c*n.b,c:t.a*n.c+t.c*n.d,e:t.a*n.e+t.c*n.f+t.e,b:t.b*n.a+t.d*n.b,d:t.b*n.c+t.d*n.d,f:t.b*n.e+t.d*n.f+t.f});switch(i.length){case 0:throw new Error("no matrices provided");case 1:return i[0];case 2:return e(i[0],i[1]);default:{const[t,n,...r]=i,o=e(t,n);return TB(o,...r)}}}function of(...i){return TB(...i)}const{cos:ayt,sin:syt,PI:lyt}=Math;function IE(i,e,t){const n=ayt(i),r=syt(i),o={a:n,c:-r,e:0,b:r,d:n,f:0};return C8(e)||C8(t)?o:TB([Hh(e,t),o,Hh(-e,-t)])}function RW(i,e=void 0,t=void 0){return IE(i*lyt/180,e,t)}function v9(i,e=void 0,t=void 0,n=void 0){C8(e)&&(e=i);const r={a:i,c:0,e:0,b:0,d:e,f:0};return C8(t)||C8(n)?r:TB([Hh(t,n),r,Hh(-t,-n)])}function nSe(i,e){return{a:1,c:i,e:0,b:e,d:1,f:0}}const{tan:iSe}=Math;function rSe(i,e){return{a:1,c:iSe(i),e:0,b:iSe(e),d:1,f:0}}function DW(i,e){return rSe(i*Math.PI/180,e*Math.PI/180)}function cyt(i){return m3(i)}function oSe(i){return m3(i)}function m3(i){return`matrix(${i.a},${i.b},${i.c},${i.d},${i.e},${i.f})`}function aSe(i,e=1e10){return{a:Math.round(i.a*e)/e,b:Math.round(i.b*e)/e,c:Math.round(i.c*e)/e,d:Math.round(i.d*e)/e,e:Math.round(i.e*e)/e,f:Math.round(i.f*e)/e}}function sSe(i,e){const t=i[0].x!=null?i[0].x:i[0][0],n=i[0].y!=null?i[0].y:i[0][1],r=e[0].x!=null?e[0].x:e[0][0],o=e[0].y!=null?e[0].y:e[0][1],a=i[1].x!=null?i[1].x:i[1][0],s=i[1].y!=null?i[1].y:i[1][1],l=e[1].x!=null?e[1].x:e[1][0],c=e[1].y!=null?e[1].y:e[1][1],u=i[2].x!=null?i[2].x:i[2][0],A=i[2].y!=null?i[2].y:i[2][1],d=e[2].x!=null?e[2].x:e[2][0],f=e[2].y!=null?e[2].y:e[2][1],h={a:t-u,b:n-A,c:a-u,d:s-A,e:u,f:A},y={a:r-d,b:o-f,c:l-d,d:c-f,e:d,f},_=U2(h),v=TB([y,_]);return aSe(v)}function uyt(i){return Array.isArray(i)?i.map(e):e(i);function e(t){switch(t.type){case"matrix":if("a"in t&&"b"in t&&"c"in t&&"d"in t&&"e"in t&&"f"in t)return tSe(t);throw new Error("MISSING_MANDATORY_PARAM");case"translate":if(!("tx"in t))throw new Error("MISSING_MANDATORY_PARAM");return"ty"in t?Hh(t.tx,t.ty):Hh(t.tx);case"scale":if(!("sx"in t))throw new Error("MISSING_MANDATORY_PARAM");return"sy"in t?v9(t.sx,t.sy):v9(t.sx);case"rotate":if(!("angle"in t))throw new Error("MISSING_MANDATORY_PARAM");return"cx"in t&&"cy"in t?RW(t.angle,t.cx,t.cy):RW(t.angle);case"skewX":if(!("angle"in t))throw new Error("MISSING_MANDATORY_PARAM");return DW(t.angle,0);case"skewY":if(!("angle"in t))throw new Error("MISSING_MANDATORY_PARAM");return DW(0,t.angle);case"shear":if(!("shx"in t&&"shy"in t))throw new Error("MISSING_MANDATORY_PARAM");return nSe(t.shx,t.shy);default:throw new Error("UNSUPPORTED_DESCRIPTOR")}}}function Ayt(i,e){function t(){this.constructor=i}t.prototype=e.prototype,i.prototype=new t}function DM(i,e,t,n){var r=Error.call(this,i);return Object.setPrototypeOf&&Object.setPrototypeOf(r,DM.prototype),r.expected=e,r.found=t,r.location=n,r.name="SyntaxError",r}Ayt(DM,Error);function NW(i,e,t){return t=t||" ",i.length>e?i:(e-=i.length,t+=t.repeat(e),i+t.slice(0,e))}DM.prototype.format=function(i){var e="Error: "+this.message;if(this.location){var t=null,n;for(n=0;n<i.length;n++)if(i[n].source===this.location.source){t=i[n].text.split(/\r\n|\n|\r/g);break}var r=this.location.start,o=this.location.source&&typeof this.location.source.offset=="function"?this.location.source.offset(r):r,a=this.location.source+":"+o.line+":"+o.column;if(t){var s=this.location.end,l=NW("",o.line.toString().length," "),c=t[r.line-1],u=r.line===s.line?s.column:c.length+1,A=u-r.column||1;e+=`
245
245
  --> `+a+`
246
246
  `+l+` |
247
247
  `+o.line+" | "+c+`
@@ -14067,7 +14067,7 @@ ${n.stack}`),t.complete=!0,"root"in this&&this.root&&this.root.emit("asyncEffect
14067
14067
  * Copyright (c) 2013-2015, 2017, Jon Schlinkert.
14068
14068
  * Released under the MIT License.
14069
14069
  *)
14070
- */const wPn=({containerClassName:i,...e})=>{const t=Nt.useRef(null),[n,r]=Nt.useState(620);return Nt.useLayoutEffect(()=>{const o=()=>{if(t.current){const s=t.current.clientHeight,l=window.innerHeight;r(Math.min(Math.max(s,620),l))}};o();const a=new ResizeObserver(o);return t.current&&a.observe(t.current),window.addEventListener("resize",o),()=>{a.disconnect(),window.removeEventListener("resize",o)}},[]),Ct.jsx("div",{ref:t,className:i||"rf-w-full rf-h-full",children:Ct.jsx(SPn,{...e,height:n})})},QPn='*,:after,:before{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }/*! tailwindcss v3.4.17 | MIT License | https://tailwindcss.com*/*,:after,:before{border:0 solid #e5e7eb;box-sizing:border-box}:after,:before{--tw-content:""}:host,html{line-height:1.5;-webkit-text-size-adjust:100%;font-family:ui-sans-serif,system-ui,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;font-feature-settings:normal;font-variation-settings:normal;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-tap-highlight-color:transparent}body{line-height:inherit;margin:0}hr{border-top-width:1px;color:inherit;height:0}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,pre,samp{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-size:1em;font-variation-settings:normal}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{border-collapse:collapse;border-color:inherit;text-indent:0}button,input,optgroup,select,textarea{color:inherit;font-family:inherit;font-feature-settings:inherit;font-size:100%;font-variation-settings:inherit;font-weight:inherit;letter-spacing:inherit;line-height:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dd,dl,figure,h1,h2,h3,h4,h5,h6,hr,p,pre{margin:0}fieldset{margin:0}fieldset,legend{padding:0}menu,ol,ul{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{color:#9ca3af;opacity:1}input::placeholder,textarea::placeholder{color:#9ca3af;opacity:1}[role=button],button{cursor:pointer}:disabled{cursor:default}audio,canvas,embed,iframe,img,object,svg,video{display:block;vertical-align:middle}img,video{height:auto;max-width:100%}[hidden]:where(:not([hidden=until-found])){display:none}:root{--radius:0.5rem}.rf-pointer-events-none{pointer-events:none}.rf-invisible{visibility:hidden}.rf-fixed{position:fixed}.rf-absolute{position:absolute}.rf-relative{position:relative}.rf-inset-0{inset:0}.-rf-left-2{left:-.5rem}.-rf-right-10{right:-2.5rem}.-rf-right-2{right:-.5rem}.-rf-right-4{right:-1rem}.-rf-right-6{right:-1.5rem}.-rf-right-7{right:-1.75rem}.-rf-right-8{right:-2rem}.-rf-right-9{right:-2.25rem}.rf-bottom-full{bottom:100%}.rf-left-0{left:0}.rf-left-1{left:.25rem}.rf-left-1\\/2{left:50%}.rf-left-2{left:.5rem}.rf-left-\\[50\\%\\]{left:50%}.rf-right-0{right:0}.rf-right-1{right:.25rem}.rf-right-4{right:1rem}.rf-right-\\[4px\\]{right:4px}.rf-top-0{top:0}.rf-top-1{top:.25rem}.rf-top-2{top:.5rem}.rf-top-2\\.5{top:.625rem}.rf-top-\\[50\\%\\]{top:50%}.rf-top-\\[6px\\]{top:6px}.\\!rf-z-\\[101\\]{z-index:101!important}.rf-z-10{z-index:10}.rf-z-50{z-index:50}.rf-z-\\[100\\]{z-index:100}.rf-order-1{order:1}.rf-order-2{order:2}.rf-order-3{order:3}.rf-m-1{margin:.25rem}.rf-m-6{margin:1.5rem}.-rf-mx-1,.rf--mx-1{margin-left:-.25rem;margin-right:-.25rem}.rf-mx-1{margin-left:.25rem;margin-right:.25rem}.rf-mx-2{margin-left:.5rem;margin-right:.5rem}.rf-mx-4{margin-left:1rem;margin-right:1rem}.rf-mx-auto{margin-left:auto;margin-right:auto}.rf-my-1{margin-bottom:.25rem;margin-top:.25rem}.rf-my-12{margin-bottom:3rem;margin-top:3rem}.rf-my-4{margin-bottom:1rem;margin-top:1rem}.rf-my-auto{margin-bottom:auto;margin-top:auto}.rf-mb-1{margin-bottom:.25rem}.rf-mb-12{margin-bottom:3rem}.rf-mb-2{margin-bottom:.5rem}.rf-mb-3{margin-bottom:.75rem}.rf-mb-4{margin-bottom:1rem}.rf-mb-6{margin-bottom:1.5rem}.rf-mb-8{margin-bottom:2rem}.rf-ml-1{margin-left:.25rem}.rf-ml-2{margin-left:.5rem}.rf-ml-auto{margin-left:auto}.rf-mr-1{margin-right:.25rem}.rf-mr-2{margin-right:.5rem}.rf-mt-0{margin-top:0}.rf-mt-0\\.5{margin-top:.125rem}.rf-mt-1{margin-top:.25rem}.rf-mt-2{margin-top:.5rem}.rf-mt-3{margin-top:.75rem}.rf-mt-4{margin-top:1rem}.rf-mt-5{margin-top:1.25rem}.rf-mt-auto{margin-top:auto}.rf-block{display:block}.rf-inline-block{display:inline-block}.rf-inline{display:inline}.rf-flex{display:flex}.rf-inline-flex{display:inline-flex}.rf-grid{display:grid}.rf-hidden{display:none}.rf-aspect-square{aspect-ratio:1/1}.rf-aspect-video{aspect-ratio:16/9}.rf-size-14{height:3.5rem;width:3.5rem}.rf-size-4{height:1rem;width:1rem}.\\!rf-h-2{height:.5rem!important}.\\!rf-h-2\\.5{height:.625rem!important}.\\!rf-h-3{height:.75rem!important}.\\!rf-h-full{height:100%!important}.rf-h-1{height:.25rem}.rf-h-10{height:2.5rem}.rf-h-12{height:3rem}.rf-h-2{height:.5rem}.rf-h-2\\.5{height:.625rem}.rf-h-3{height:.75rem}.rf-h-3\\.5{height:.875rem}.rf-h-4{height:1rem}.rf-h-5{height:1.25rem}.rf-h-6{height:1.5rem}.rf-h-60{height:15rem}.rf-h-64{height:16rem}.rf-h-7{height:1.75rem}.rf-h-8{height:2rem}.rf-h-9{height:2.25rem}.rf-h-\\[400px\\]{height:400px}.rf-h-\\[calc\\(100vh-52px\\)\\]{height:calc(100vh - 52px)}.rf-h-\\[var\\(--radix-select-trigger-height\\)\\]{height:var(--radix-select-trigger-height)}.rf-h-auto{height:auto}.rf-h-fit{height:-moz-fit-content;height:fit-content}.rf-h-full{height:100%}.rf-h-px{height:1px}.rf-h-screen{height:100vh}.\\!rf-max-h-\\[40vh\\]{max-height:40vh!important}.rf-max-h-32{max-height:8rem}.rf-max-h-96{max-height:24rem}.rf-max-h-\\[200px\\]{max-height:200px}.rf-max-h-\\[300px\\]{max-height:300px}.rf-max-h-\\[500px\\]{max-height:500px}.rf-max-h-\\[90vh\\]{max-height:90vh}.rf-max-h-full{max-height:100%}.rf-min-h-0{min-height:0}.rf-min-h-\\[200px\\]{min-height:200px}.rf-min-h-\\[300px\\]{min-height:300px}.rf-min-h-\\[620px\\]{min-height:620px}.rf-min-h-\\[calc\\(100vh-240px\\)\\]{min-height:calc(100vh - 240px)}.\\!rf-w-2{width:.5rem!important}.\\!rf-w-2\\.5{width:.625rem!important}.rf-w-1{width:.25rem}.rf-w-1\\/2{width:50%}.rf-w-11{width:2.75rem}.rf-w-11\\/12{width:91.666667%}.rf-w-12{width:3rem}.rf-w-16{width:4rem}.rf-w-2{width:.5rem}.rf-w-2\\.5{width:.625rem}.rf-w-20{width:5rem}.rf-w-28{width:7rem}.rf-w-3{width:.75rem}.rf-w-3\\.5{width:.875rem}.rf-w-32{width:8rem}.rf-w-4{width:1rem}.rf-w-40{width:10rem}.rf-w-48{width:12rem}.rf-w-5{width:1.25rem}.rf-w-6{width:1.5rem}.rf-w-64{width:16rem}.rf-w-72{width:18rem}.rf-w-8{width:2rem}.rf-w-9{width:2.25rem}.rf-w-96{width:24rem}.rf-w-\\[95\\%\\]{width:95%}.rf-w-fit{width:-moz-fit-content;width:fit-content}.rf-w-full{width:100%}.rf-w-screen{width:100vw}.rf-min-w-0{min-width:0}.rf-min-w-10{min-width:2.5rem}.rf-min-w-16{min-width:4rem}.rf-min-w-\\[148px\\]{min-width:148px}.rf-min-w-\\[8rem\\]{min-width:8rem}.rf-min-w-\\[var\\(--radix-select-trigger-width\\)\\]{min-width:var(--radix-select-trigger-width)}.\\!rf-max-w-\\[660px\\]{max-width:660px!important}.rf-max-w-2xl{max-width:42rem}.rf-max-w-3xl{max-width:48rem}.rf-max-w-4xl{max-width:56rem}.rf-max-w-5xl{max-width:64rem}.rf-max-w-full{max-width:100%}.rf-max-w-lg{max-width:32rem}.rf-max-w-md{max-width:28rem}.rf-max-w-none{max-width:none}.rf-max-w-xl{max-width:36rem}.rf-max-w-xs{max-width:20rem}.rf-flex-1{flex:1 1 0%}.rf-flex-shrink-0,.rf-shrink-0{flex-shrink:0}.rf-flex-grow{flex-grow:1}.rf-table-auto{table-layout:auto}.rf-origin-\\[--radix-popover-content-transform-origin\\]{transform-origin:var(--radix-popover-content-transform-origin)}.-rf-translate-x-1{--tw-translate-x:-0.25rem}.-rf-translate-x-1,.-rf-translate-x-1\\/2{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.-rf-translate-x-1\\/2{--tw-translate-x:-50%}.-rf-translate-y-1{--tw-translate-y:-0.25rem}.-rf-translate-y-1,.rf--translate-x-1{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.rf--translate-x-1{--tw-translate-x:-0.25rem}.rf--translate-x-1\\/2{--tw-translate-x:-50%}.rf--translate-x-1\\/2,.rf--translate-y-1{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.rf--translate-y-1{--tw-translate-y:-0.25rem}.rf-translate-x-\\[-50\\%\\]{--tw-translate-x:-50%}.rf-translate-x-\\[-50\\%\\],.rf-translate-y-\\[-50\\%\\]{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.rf-translate-y-\\[-50\\%\\]{--tw-translate-y:-50%}.rf-transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@keyframes rf-pulse{50%{opacity:.5}}.rf-animate-pulse{animation:rf-pulse 2s cubic-bezier(.4,0,.6,1) infinite}@keyframes rf-spin{to{transform:rotate(1turn)}}.rf-animate-spin{animation:rf-spin 1s linear infinite}.rf-cursor-default{cursor:default}.rf-cursor-not-allowed{cursor:not-allowed}.rf-cursor-pointer{cursor:pointer}.rf-select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}.rf-grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.rf-grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.rf-flex-row{flex-direction:row}.rf-flex-col{flex-direction:column}.rf-flex-col-reverse{flex-direction:column-reverse}.rf-flex-wrap{flex-wrap:wrap}.rf-place-items-center{place-items:center}.rf-items-start{align-items:flex-start}.rf-items-end{align-items:flex-end}.rf-items-center{align-items:center}.rf-items-stretch{align-items:stretch}.rf-justify-end{justify-content:flex-end}.rf-justify-center{justify-content:center}.rf-justify-between{justify-content:space-between}.rf-gap-0{gap:0}.rf-gap-1{gap:.25rem}.rf-gap-2{gap:.5rem}.rf-gap-3{gap:.75rem}.rf-gap-4{gap:1rem}.rf-gap-5{gap:1.25rem}.rf-gap-6{gap:1.5rem}.rf-gap-8{gap:2rem}.rf-space-x-2>:not([hidden])~:not([hidden]){--tw-space-x-reverse:0;margin-left:calc(.5rem*(1 - var(--tw-space-x-reverse)));margin-right:calc(.5rem*var(--tw-space-x-reverse))}.rf-space-y-2>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-bottom:calc(.5rem*var(--tw-space-y-reverse));margin-top:calc(.5rem*(1 - var(--tw-space-y-reverse)))}.rf-space-y-3>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-bottom:calc(.75rem*var(--tw-space-y-reverse));margin-top:calc(.75rem*(1 - var(--tw-space-y-reverse)))}.rf-space-y-4>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-bottom:calc(1rem*var(--tw-space-y-reverse));margin-top:calc(1rem*(1 - var(--tw-space-y-reverse)))}.rf-space-y-6>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-bottom:calc(1.5rem*var(--tw-space-y-reverse));margin-top:calc(1.5rem*(1 - var(--tw-space-y-reverse)))}.rf-divide-y>:not([hidden])~:not([hidden]){--tw-divide-y-reverse:0;border-bottom-width:calc(1px*var(--tw-divide-y-reverse));border-top-width:calc(1px*(1 - var(--tw-divide-y-reverse)))}.rf-overflow-auto{overflow:auto}.rf-overflow-hidden{overflow:hidden}.rf-overflow-visible{overflow:visible}.rf-overflow-x-auto{overflow-x:auto}.\\!rf-overflow-y-auto{overflow-y:auto!important}.rf-overflow-y-auto{overflow-y:auto}.rf-overflow-x-hidden{overflow-x:hidden}.rf-overflow-x-clip{overflow-x:clip}.rf-truncate{overflow:hidden;text-overflow:ellipsis}.rf-truncate,.rf-whitespace-nowrap{white-space:nowrap}.rf-whitespace-pre-wrap{white-space:pre-wrap}.rf-break-words{overflow-wrap:break-word}.rf-rounded{border-radius:.25rem}.rf-rounded-2xl{border-radius:1rem}.rf-rounded-full{border-radius:9999px}.rf-rounded-lg{border-radius:var(--radius)}.rf-rounded-md{border-radius:calc(var(--radius) - 2px)}.rf-rounded-sm{border-radius:calc(var(--radius) - 4px)}.rf-rounded-xl{border-radius:.75rem}.rf-border{border-width:1px}.rf-border-2{border-width:2px}.rf-border-b{border-bottom-width:1px}.rf-border-t{border-top-width:1px}.rf-border-blue-200{--tw-border-opacity:1;border-color:rgb(191 219 254/var(--tw-border-opacity,1))}.rf-border-blue-400{--tw-border-opacity:1;border-color:rgb(96 165 250/var(--tw-border-opacity,1))}.rf-border-blue-500{--tw-border-opacity:1;border-color:rgb(59 130 246/var(--tw-border-opacity,1))}.rf-border-blue-600{--tw-border-opacity:1;border-color:rgb(37 99 235/var(--tw-border-opacity,1))}.rf-border-gray-200{--tw-border-opacity:1;border-color:rgb(229 231 235/var(--tw-border-opacity,1))}.rf-border-gray-300{--tw-border-opacity:1;border-color:rgb(209 213 219/var(--tw-border-opacity,1))}.rf-border-green-200{--tw-border-opacity:1;border-color:rgb(187 247 208/var(--tw-border-opacity,1))}.rf-border-input{border-color:hsl(var(--input))}.rf-border-neutral-200{--tw-border-opacity:1;border-color:rgb(229 229 229/var(--tw-border-opacity,1))}.rf-border-orange-200{--tw-border-opacity:1;border-color:rgb(254 215 170/var(--tw-border-opacity,1))}.rf-border-primary{border-color:hsl(var(--primary))}.rf-border-red-200{--tw-border-opacity:1;border-color:rgb(254 202 202/var(--tw-border-opacity,1))}.rf-border-red-400{--tw-border-opacity:1;border-color:rgb(248 113 113/var(--tw-border-opacity,1))}.rf-border-red-500{--tw-border-opacity:1;border-color:rgb(239 68 68/var(--tw-border-opacity,1))}.rf-border-zinc-200{--tw-border-opacity:1;border-color:rgb(228 228 231/var(--tw-border-opacity,1))}.rf-border-zinc-900{--tw-border-opacity:1;border-color:rgb(24 24 27/var(--tw-border-opacity,1))}.rf-bg-background{background-color:hsl(var(--background))}.rf-bg-black{--tw-bg-opacity:1;background-color:rgb(0 0 0/var(--tw-bg-opacity,1))}.rf-bg-black\\/80{background-color:rgba(0,0,0,.8)}.rf-bg-blue-100{--tw-bg-opacity:1;background-color:rgb(219 234 254/var(--tw-bg-opacity,1))}.rf-bg-blue-50{--tw-bg-opacity:1;background-color:rgb(239 246 255/var(--tw-bg-opacity,1))}.rf-bg-blue-500{--tw-bg-opacity:1;background-color:rgb(59 130 246/var(--tw-bg-opacity,1))}.rf-bg-blue-600{--tw-bg-opacity:1;background-color:rgb(37 99 235/var(--tw-bg-opacity,1))}.rf-bg-gray-100{--tw-bg-opacity:1;background-color:rgb(243 244 246/var(--tw-bg-opacity,1))}.rf-bg-gray-200{--tw-bg-opacity:1;background-color:rgb(229 231 235/var(--tw-bg-opacity,1))}.rf-bg-gray-300{--tw-bg-opacity:1;background-color:rgb(209 213 219/var(--tw-bg-opacity,1))}.rf-bg-gray-400{--tw-bg-opacity:1;background-color:rgb(156 163 175/var(--tw-bg-opacity,1))}.rf-bg-gray-50{--tw-bg-opacity:1;background-color:rgb(249 250 251/var(--tw-bg-opacity,1))}.rf-bg-gray-500{--tw-bg-opacity:1;background-color:rgb(107 114 128/var(--tw-bg-opacity,1))}.rf-bg-gray-700{--tw-bg-opacity:1;background-color:rgb(55 65 81/var(--tw-bg-opacity,1))}.rf-bg-gray-800{--tw-bg-opacity:1;background-color:rgb(31 41 55/var(--tw-bg-opacity,1))}.rf-bg-gray-900{--tw-bg-opacity:1;background-color:rgb(17 24 39/var(--tw-bg-opacity,1))}.rf-bg-green-100{--tw-bg-opacity:1;background-color:rgb(220 252 231/var(--tw-bg-opacity,1))}.rf-bg-green-50{--tw-bg-opacity:1;background-color:rgb(240 253 244/var(--tw-bg-opacity,1))}.rf-bg-muted{background-color:hsl(var(--muted))}.rf-bg-neutral-100{--tw-bg-opacity:1;background-color:rgb(245 245 245/var(--tw-bg-opacity,1))}.rf-bg-neutral-50{--tw-bg-opacity:1;background-color:rgb(250 250 250/var(--tw-bg-opacity,1))}.rf-bg-neutral-800{--tw-bg-opacity:1;background-color:rgb(38 38 38/var(--tw-bg-opacity,1))}.rf-bg-neutral-900{--tw-bg-opacity:1;background-color:rgb(23 23 23/var(--tw-bg-opacity,1))}.rf-bg-orange-400{--tw-bg-opacity:1;background-color:rgb(251 146 60/var(--tw-bg-opacity,1))}.rf-bg-orange-50{--tw-bg-opacity:1;background-color:rgb(255 247 237/var(--tw-bg-opacity,1))}.rf-bg-popover{background-color:hsl(var(--popover))}.rf-bg-red-100{--tw-bg-opacity:1;background-color:rgb(254 226 226/var(--tw-bg-opacity,1))}.rf-bg-red-50{--tw-bg-opacity:1;background-color:rgb(254 242 242/var(--tw-bg-opacity,1))}.rf-bg-red-500{--tw-bg-opacity:1;background-color:rgb(239 68 68/var(--tw-bg-opacity,1))}.rf-bg-red-900{--tw-bg-opacity:1;background-color:rgb(127 29 29/var(--tw-bg-opacity,1))}.rf-bg-transparent{background-color:transparent}.rf-bg-white{--tw-bg-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity,1))}.rf-bg-yellow-100{--tw-bg-opacity:1;background-color:rgb(254 249 195/var(--tw-bg-opacity,1))}.rf-bg-zinc-100{--tw-bg-opacity:1;background-color:rgb(244 244 245/var(--tw-bg-opacity,1))}.rf-bg-zinc-200{--tw-bg-opacity:1;background-color:rgb(228 228 231/var(--tw-bg-opacity,1))}.rf-bg-zinc-50{--tw-bg-opacity:1;background-color:rgb(250 250 250/var(--tw-bg-opacity,1))}.rf-bg-zinc-800{--tw-bg-opacity:1;background-color:rgb(39 39 42/var(--tw-bg-opacity,1))}.rf-bg-zinc-900{--tw-bg-opacity:1;background-color:rgb(24 24 27/var(--tw-bg-opacity,1))}.rf-bg-opacity-50{--tw-bg-opacity:0.5}.rf-fill-current{fill:currentColor}.rf-object-contain{-o-object-fit:contain;object-fit:contain}.rf-object-cover{-o-object-fit:cover;object-fit:cover}.\\!rf-p-0{padding:0!important}.rf-p-0{padding:0}.rf-p-1{padding:.25rem}.rf-p-2{padding:.5rem}.rf-p-3{padding:.75rem}.rf-p-4{padding:1rem}.rf-p-5{padding:1.25rem}.rf-p-6{padding:1.5rem}.rf-p-8{padding:2rem}.rf-px-1{padding-left:.25rem;padding-right:.25rem}.rf-px-2{padding-left:.5rem;padding-right:.5rem}.rf-px-3{padding-left:.75rem;padding-right:.75rem}.rf-px-4{padding-left:1rem;padding-right:1rem}.rf-px-6{padding-left:1.5rem;padding-right:1.5rem}.rf-px-8{padding-left:2rem;padding-right:2rem}.rf-py-0{padding-bottom:0;padding-top:0}.rf-py-0\\.5{padding-bottom:.125rem;padding-top:.125rem}.rf-py-1{padding-bottom:.25rem;padding-top:.25rem}.rf-py-1\\.5{padding-bottom:.375rem;padding-top:.375rem}.rf-py-10{padding-bottom:2.5rem;padding-top:2.5rem}.rf-py-12{padding-bottom:3rem;padding-top:3rem}.rf-py-2{padding-bottom:.5rem;padding-top:.5rem}.rf-py-3{padding-bottom:.75rem;padding-top:.75rem}.rf-py-4{padding-bottom:1rem;padding-top:1rem}.rf-py-6{padding-bottom:1.5rem;padding-top:1.5rem}.rf-py-8{padding-bottom:2rem;padding-top:2rem}.rf-pb-0{padding-bottom:0}.rf-pb-2{padding-bottom:.5rem}.rf-pb-3{padding-bottom:.75rem}.rf-pb-4{padding-bottom:1rem}.rf-pl-2{padding-left:.5rem}.rf-pl-4{padding-left:1rem}.rf-pl-8{padding-left:2rem}.rf-pr-2{padding-right:.5rem}.rf-pt-0{padding-top:0}.rf-pt-2{padding-top:.5rem}.rf-pt-4{padding-top:1rem}.rf-text-left{text-align:left}.rf-text-center{text-align:center}.rf-text-right{text-align:right}.rf-font-mono{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace}.rf-text-2xl{font-size:1.5rem;line-height:2rem}.rf-text-3xl{font-size:1.875rem;line-height:2.25rem}.rf-text-\\[8px\\]{font-size:8px}.rf-text-base{font-size:1rem;line-height:1.5rem}.rf-text-lg{font-size:1.125rem;line-height:1.75rem}.rf-text-sm{font-size:.875rem;line-height:1.25rem}.rf-text-xl{font-size:1.25rem;line-height:1.75rem}.rf-text-xs{font-size:.75rem;line-height:1rem}.\\!rf-font-normal{font-weight:400!important}.rf-font-bold{font-weight:700}.rf-font-medium{font-weight:500}.rf-font-semibold{font-weight:600}.rf-uppercase{text-transform:uppercase}.rf-capitalize{text-transform:capitalize}.rf-tabular-nums{--tw-numeric-spacing:tabular-nums;font-variant-numeric:var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction)}.rf-leading-5{line-height:1.25rem}.rf-leading-none{line-height:1}.rf-leading-relaxed{line-height:1.625}.rf-leading-tight{line-height:1.25}.rf-tracking-wide{letter-spacing:.025em}.rf-tracking-widest{letter-spacing:.1em}.rf-text-black{--tw-text-opacity:1;color:rgb(0 0 0/var(--tw-text-opacity,1))}.rf-text-blue-500{--tw-text-opacity:1;color:rgb(59 130 246/var(--tw-text-opacity,1))}.rf-text-blue-600{--tw-text-opacity:1;color:rgb(37 99 235/var(--tw-text-opacity,1))}.rf-text-blue-700{--tw-text-opacity:1;color:rgb(29 78 216/var(--tw-text-opacity,1))}.rf-text-blue-800{--tw-text-opacity:1;color:rgb(30 64 175/var(--tw-text-opacity,1))}.rf-text-blue-900{--tw-text-opacity:1;color:rgb(30 58 138/var(--tw-text-opacity,1))}.rf-text-current{color:currentColor}.rf-text-gray-400{--tw-text-opacity:1;color:rgb(156 163 175/var(--tw-text-opacity,1))}.rf-text-gray-500{--tw-text-opacity:1;color:rgb(107 114 128/var(--tw-text-opacity,1))}.rf-text-gray-600{--tw-text-opacity:1;color:rgb(75 85 99/var(--tw-text-opacity,1))}.rf-text-gray-700{--tw-text-opacity:1;color:rgb(55 65 81/var(--tw-text-opacity,1))}.rf-text-gray-800{--tw-text-opacity:1;color:rgb(31 41 55/var(--tw-text-opacity,1))}.rf-text-gray-900{--tw-text-opacity:1;color:rgb(17 24 39/var(--tw-text-opacity,1))}.rf-text-green-500{--tw-text-opacity:1;color:rgb(34 197 94/var(--tw-text-opacity,1))}.rf-text-green-600{--tw-text-opacity:1;color:rgb(22 163 74/var(--tw-text-opacity,1))}.rf-text-green-700{--tw-text-opacity:1;color:rgb(21 128 61/var(--tw-text-opacity,1))}.rf-text-green-800{--tw-text-opacity:1;color:rgb(22 101 52/var(--tw-text-opacity,1))}.rf-text-green-900{--tw-text-opacity:1;color:rgb(20 83 45/var(--tw-text-opacity,1))}.rf-text-muted-foreground{color:hsl(var(--muted-foreground))}.rf-text-neutral-50{--tw-text-opacity:1;color:rgb(250 250 250/var(--tw-text-opacity,1))}.rf-text-neutral-500{--tw-text-opacity:1;color:rgb(115 115 115/var(--tw-text-opacity,1))}.rf-text-neutral-900{--tw-text-opacity:1;color:rgb(23 23 23/var(--tw-text-opacity,1))}.rf-text-neutral-950{--tw-text-opacity:1;color:rgb(10 10 10/var(--tw-text-opacity,1))}.rf-text-orange-500{--tw-text-opacity:1;color:rgb(249 115 22/var(--tw-text-opacity,1))}.rf-text-orange-600{--tw-text-opacity:1;color:rgb(234 88 12/var(--tw-text-opacity,1))}.rf-text-orange-800{--tw-text-opacity:1;color:rgb(154 52 18/var(--tw-text-opacity,1))}.rf-text-popover-foreground{color:hsl(var(--popover-foreground))}.rf-text-red-200{--tw-text-opacity:1;color:rgb(254 202 202/var(--tw-text-opacity,1))}.rf-text-red-300{--tw-text-opacity:1;color:rgb(252 165 165/var(--tw-text-opacity,1))}.rf-text-red-400{--tw-text-opacity:1;color:rgb(248 113 113/var(--tw-text-opacity,1))}.rf-text-red-500{--tw-text-opacity:1;color:rgb(239 68 68/var(--tw-text-opacity,1))}.rf-text-red-600{--tw-text-opacity:1;color:rgb(220 38 38/var(--tw-text-opacity,1))}.rf-text-red-700{--tw-text-opacity:1;color:rgb(185 28 28/var(--tw-text-opacity,1))}.rf-text-red-800{--tw-text-opacity:1;color:rgb(153 27 27/var(--tw-text-opacity,1))}.rf-text-red-900{--tw-text-opacity:1;color:rgb(127 29 29/var(--tw-text-opacity,1))}.rf-text-white{--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity,1))}.rf-text-yellow-400{--tw-text-opacity:1;color:rgb(250 204 21/var(--tw-text-opacity,1))}.rf-text-yellow-500{--tw-text-opacity:1;color:rgb(234 179 8/var(--tw-text-opacity,1))}.rf-text-yellow-900{--tw-text-opacity:1;color:rgb(113 63 18/var(--tw-text-opacity,1))}.rf-text-zinc-200{--tw-text-opacity:1;color:rgb(228 228 231/var(--tw-text-opacity,1))}.rf-text-zinc-300{--tw-text-opacity:1;color:rgb(212 212 216/var(--tw-text-opacity,1))}.rf-text-zinc-400{--tw-text-opacity:1;color:rgb(161 161 170/var(--tw-text-opacity,1))}.rf-text-zinc-50{--tw-text-opacity:1;color:rgb(250 250 250/var(--tw-text-opacity,1))}.rf-text-zinc-500{--tw-text-opacity:1;color:rgb(113 113 122/var(--tw-text-opacity,1))}.rf-text-zinc-900{--tw-text-opacity:1;color:rgb(24 24 27/var(--tw-text-opacity,1))}.rf-text-zinc-950{--tw-text-opacity:1;color:rgb(9 9 11/var(--tw-text-opacity,1))}.rf-underline{text-decoration-line:underline}.rf-line-through{text-decoration-line:line-through}.rf-underline-offset-4{text-underline-offset:4px}.rf-opacity-0{opacity:0}.rf-opacity-100{opacity:1}.rf-opacity-25{opacity:.25}.rf-opacity-30{opacity:.3}.rf-opacity-50{opacity:.5}.rf-opacity-60{opacity:.6}.rf-opacity-75{opacity:.75}.rf-shadow{--tw-shadow:0 1px 3px 0 rgba(0,0,0,.1),0 1px 2px -1px rgba(0,0,0,.1);--tw-shadow-colored:0 1px 3px 0 var(--tw-shadow-color),0 1px 2px -1px var(--tw-shadow-color)}.rf-shadow,.rf-shadow-lg{box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.rf-shadow-lg{--tw-shadow:0 10px 15px -3px rgba(0,0,0,.1),0 4px 6px -4px rgba(0,0,0,.1);--tw-shadow-colored:0 10px 15px -3px var(--tw-shadow-color),0 4px 6px -4px var(--tw-shadow-color)}.rf-shadow-md{--tw-shadow:0 4px 6px -1px rgba(0,0,0,.1),0 2px 4px -2px rgba(0,0,0,.1);--tw-shadow-colored:0 4px 6px -1px var(--tw-shadow-color),0 2px 4px -2px var(--tw-shadow-color)}.rf-shadow-md,.rf-shadow-sm{box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.rf-shadow-sm{--tw-shadow:0 1px 2px 0 rgba(0,0,0,.05);--tw-shadow-colored:0 1px 2px 0 var(--tw-shadow-color)}.rf-outline-none{outline:2px solid transparent;outline-offset:2px}.rf-ring-2{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}.rf-ring-blue-500{--tw-ring-opacity:1;--tw-ring-color:rgb(59 130 246/var(--tw-ring-opacity,1))}.rf-ring-primary{--tw-ring-color:hsl(var(--primary))}.rf-ring-offset-background{--tw-ring-offset-color:hsl(var(--background))}.rf-ring-offset-white{--tw-ring-offset-color:#fff}.rf-transition{transition-duration:.15s;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,-webkit-backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter,-webkit-backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1)}.rf-transition-all{transition-duration:.15s;transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1)}.rf-transition-colors{transition-duration:.15s;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1)}.rf-transition-opacity{transition-duration:.15s;transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1)}.rf-duration-200{transition-duration:.2s}.rf-ease-in-out{transition-timing-function:cubic-bezier(.4,0,.2,1)}@keyframes enter{0%{opacity:var(--tw-enter-opacity,1);transform:translate3d(var(--tw-enter-translate-x,0),var(--tw-enter-translate-y,0),0) scale3d(var(--tw-enter-scale,1),var(--tw-enter-scale,1),var(--tw-enter-scale,1)) rotate(var(--tw-enter-rotate,0))}}@keyframes exit{to{opacity:var(--tw-exit-opacity,1);transform:translate3d(var(--tw-exit-translate-x,0),var(--tw-exit-translate-y,0),0) scale3d(var(--tw-exit-scale,1),var(--tw-exit-scale,1),var(--tw-exit-scale,1)) rotate(var(--tw-exit-rotate,0))}}.rf-slide-in-from-left-1{--tw-enter-translate-x:-0.25rem}.rf-slide-out-to-left-1{--tw-exit-translate-x:-0.25rem}.rf-duration-200{animation-duration:.2s}.rf-ease-in-out{animation-timing-function:cubic-bezier(.4,0,.2,1)}.file\\:rf-border-0::file-selector-button{border-width:0}.file\\:rf-bg-transparent::file-selector-button{background-color:transparent}.file\\:rf-text-sm::file-selector-button{font-size:.875rem;line-height:1.25rem}.file\\:rf-font-medium::file-selector-button{font-weight:500}.placeholder\\:rf-text-zinc-500::-moz-placeholder{--tw-text-opacity:1;color:rgb(113 113 122/var(--tw-text-opacity,1))}.placeholder\\:rf-text-zinc-500::placeholder{--tw-text-opacity:1;color:rgb(113 113 122/var(--tw-text-opacity,1))}.hover\\:rf-border-blue-300:hover{--tw-border-opacity:1;border-color:rgb(147 197 253/var(--tw-border-opacity,1))}.hover\\:\\!rf-bg-transparent:hover{background-color:transparent!important}.hover\\:rf-bg-blue-700:hover{--tw-bg-opacity:1;background-color:rgb(29 78 216/var(--tw-bg-opacity,1))}.hover\\:rf-bg-red-500\\/90:hover{background-color:rgba(239,68,68,.9)}.hover\\:rf-bg-zinc-100:hover{--tw-bg-opacity:1;background-color:rgb(244 244 245/var(--tw-bg-opacity,1))}.hover\\:rf-bg-zinc-100\\/80:hover{background-color:hsla(240,5%,96%,.8)}.hover\\:rf-bg-zinc-900\\/90:hover{background-color:rgba(24,24,27,.9)}.hover\\:rf-text-red-400:hover{--tw-text-opacity:1;color:rgb(248 113 113/var(--tw-text-opacity,1))}.hover\\:rf-text-zinc-900:hover{--tw-text-opacity:1;color:rgb(24 24 27/var(--tw-text-opacity,1))}.hover\\:rf-underline:hover{text-decoration-line:underline}.focus\\:rf-bg-gray-100:focus{--tw-bg-opacity:1;background-color:rgb(243 244 246/var(--tw-bg-opacity,1))}.focus\\:rf-bg-zinc-100:focus{--tw-bg-opacity:1;background-color:rgb(244 244 245/var(--tw-bg-opacity,1))}.focus\\:rf-text-gray-900:focus{--tw-text-opacity:1;color:rgb(17 24 39/var(--tw-text-opacity,1))}.focus\\:rf-text-zinc-900:focus{--tw-text-opacity:1;color:rgb(24 24 27/var(--tw-text-opacity,1))}.focus\\:rf-outline-none:focus{outline:2px solid transparent;outline-offset:2px}.focus\\:rf-ring-2:focus{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}.focus\\:rf-ring-ring:focus{--tw-ring-color:hsl(var(--ring))}.focus\\:rf-ring-offset-2:focus{--tw-ring-offset-width:2px}.focus-visible\\:rf-outline-none:focus-visible{outline:2px solid transparent;outline-offset:2px}.focus-visible\\:rf-ring-1:focus-visible{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}.focus-visible\\:rf-ring-2:focus-visible{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}.focus-visible\\:rf-ring-zinc-950:focus-visible{--tw-ring-opacity:1;--tw-ring-color:rgb(9 9 11/var(--tw-ring-opacity,1))}.focus-visible\\:rf-ring-offset-2:focus-visible{--tw-ring-offset-width:2px}.disabled\\:rf-pointer-events-none:disabled{pointer-events:none}.disabled\\:rf-cursor-not-allowed:disabled{cursor:not-allowed}.disabled\\:rf-opacity-50:disabled{opacity:.5}.rf-group\\/bar:hover .group-hover\\/bar\\:rf-opacity-100{opacity:1}.data-\\[disabled\\=true\\]\\:rf-pointer-events-none[data-disabled=true],.data-\\[disabled\\]\\:rf-pointer-events-none[data-disabled]{pointer-events:none}.data-\\[side\\=bottom\\]\\:rf-translate-y-1[data-side=bottom]{--tw-translate-y:0.25rem}.data-\\[side\\=bottom\\]\\:rf-translate-y-1[data-side=bottom],.data-\\[side\\=left\\]\\:-rf-translate-x-1[data-side=left]{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\\[side\\=left\\]\\:-rf-translate-x-1[data-side=left]{--tw-translate-x:-0.25rem}.data-\\[side\\=right\\]\\:rf-translate-x-1[data-side=right]{--tw-translate-x:0.25rem}.data-\\[side\\=right\\]\\:rf-translate-x-1[data-side=right],.data-\\[side\\=top\\]\\:-rf-translate-y-1[data-side=top]{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\\[side\\=top\\]\\:-rf-translate-y-1[data-side=top]{--tw-translate-y:-0.25rem}.data-\\[selected\\=true\\]\\:rf-bg-zinc-100[data-selected=true]{--tw-bg-opacity:1;background-color:rgb(244 244 245/var(--tw-bg-opacity,1))}.data-\\[state\\=active\\]\\:rf-bg-white[data-state=active]{--tw-bg-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity,1))}.data-\\[state\\=checked\\]\\:rf-bg-zinc-900[data-state=checked]{--tw-bg-opacity:1;background-color:rgb(24 24 27/var(--tw-bg-opacity,1))}.data-\\[state\\=open\\]\\:rf-bg-zinc-100[data-state=open]{--tw-bg-opacity:1;background-color:rgb(244 244 245/var(--tw-bg-opacity,1))}.data-\\[selected\\=true\\]\\:rf-text-zinc-900[data-selected=true]{--tw-text-opacity:1;color:rgb(24 24 27/var(--tw-text-opacity,1))}.data-\\[state\\=active\\]\\:rf-text-zinc-950[data-state=active]{--tw-text-opacity:1;color:rgb(9 9 11/var(--tw-text-opacity,1))}.data-\\[state\\=checked\\]\\:rf-text-zinc-50[data-state=checked]{--tw-text-opacity:1;color:rgb(250 250 250/var(--tw-text-opacity,1))}.data-\\[disabled\\=true\\]\\:rf-opacity-50[data-disabled=true],.data-\\[disabled\\]\\:rf-opacity-50[data-disabled]{opacity:.5}.data-\\[state\\=active\\]\\:rf-shadow[data-state=active]{--tw-shadow:0 1px 3px 0 rgba(0,0,0,.1),0 1px 2px -1px rgba(0,0,0,.1);--tw-shadow-colored:0 1px 3px 0 var(--tw-shadow-color),0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.data-\\[state\\=open\\]\\:rf-animate-in[data-state=open]{animation-duration:.15s;animation-name:enter;--tw-enter-opacity:initial;--tw-enter-scale:initial;--tw-enter-rotate:initial;--tw-enter-translate-x:initial;--tw-enter-translate-y:initial}.data-\\[state\\=closed\\]\\:rf-animate-out[data-state=closed]{animation-duration:.15s;animation-name:exit;--tw-exit-opacity:initial;--tw-exit-scale:initial;--tw-exit-rotate:initial;--tw-exit-translate-x:initial;--tw-exit-translate-y:initial}.data-\\[state\\=closed\\]\\:rf-fade-out-0[data-state=closed]{--tw-exit-opacity:0}.data-\\[state\\=open\\]\\:rf-fade-in-0[data-state=open]{--tw-enter-opacity:0}.data-\\[state\\=closed\\]\\:rf-zoom-out-95[data-state=closed]{--tw-exit-scale:.95}.data-\\[state\\=open\\]\\:rf-zoom-in-95[data-state=open]{--tw-enter-scale:.95}.data-\\[side\\=bottom\\]\\:rf-slide-in-from-top-2[data-side=bottom]{--tw-enter-translate-y:-0.5rem}.data-\\[side\\=left\\]\\:rf-slide-in-from-right-2[data-side=left]{--tw-enter-translate-x:0.5rem}.data-\\[side\\=right\\]\\:rf-slide-in-from-left-2[data-side=right]{--tw-enter-translate-x:-0.5rem}.data-\\[side\\=top\\]\\:rf-slide-in-from-bottom-2[data-side=top]{--tw-enter-translate-y:0.5rem}.data-\\[state\\=closed\\]\\:rf-slide-out-to-left-1\\/2[data-state=closed]{--tw-exit-translate-x:-50%}.data-\\[state\\=closed\\]\\:rf-slide-out-to-top-\\[48\\%\\][data-state=closed]{--tw-exit-translate-y:-48%}.data-\\[state\\=open\\]\\:rf-slide-in-from-left-1\\/2[data-state=open]{--tw-enter-translate-x:-50%}.data-\\[state\\=open\\]\\:rf-slide-in-from-top-\\[48\\%\\][data-state=open]{--tw-enter-translate-y:-48%}.dark\\:rf-border-zinc-50:is(.rf-dark *){--tw-border-opacity:1;border-color:rgb(250 250 250/var(--tw-border-opacity,1))}.dark\\:rf-border-zinc-800:is(.rf-dark *){--tw-border-opacity:1;border-color:rgb(39 39 42/var(--tw-border-opacity,1))}.dark\\:rf-bg-red-900:is(.rf-dark *){--tw-bg-opacity:1;background-color:rgb(127 29 29/var(--tw-bg-opacity,1))}.dark\\:rf-bg-zinc-50:is(.rf-dark *){--tw-bg-opacity:1;background-color:rgb(250 250 250/var(--tw-bg-opacity,1))}.dark\\:rf-bg-zinc-800:is(.rf-dark *){--tw-bg-opacity:1;background-color:rgb(39 39 42/var(--tw-bg-opacity,1))}.dark\\:rf-bg-zinc-950:is(.rf-dark *){--tw-bg-opacity:1;background-color:rgb(9 9 11/var(--tw-bg-opacity,1))}.dark\\:rf-text-zinc-400:is(.rf-dark *){--tw-text-opacity:1;color:rgb(161 161 170/var(--tw-text-opacity,1))}.dark\\:rf-text-zinc-50:is(.rf-dark *){--tw-text-opacity:1;color:rgb(250 250 250/var(--tw-text-opacity,1))}.dark\\:rf-text-zinc-900:is(.rf-dark *){--tw-text-opacity:1;color:rgb(24 24 27/var(--tw-text-opacity,1))}.dark\\:rf-placeholder-zinc-400:is(.rf-dark *)::-moz-placeholder{--tw-placeholder-opacity:1;color:rgb(161 161 170/var(--tw-placeholder-opacity,1))}.dark\\:rf-placeholder-zinc-400:is(.rf-dark *)::placeholder{--tw-placeholder-opacity:1;color:rgb(161 161 170/var(--tw-placeholder-opacity,1))}.dark\\:rf-ring-offset-zinc-950:is(.rf-dark *){--tw-ring-offset-color:#09090b}.dark\\:placeholder\\:rf-text-zinc-400:is(.rf-dark *)::-moz-placeholder{--tw-text-opacity:1;color:rgb(161 161 170/var(--tw-text-opacity,1))}.dark\\:placeholder\\:rf-text-zinc-400:is(.rf-dark *)::placeholder{--tw-text-opacity:1;color:rgb(161 161 170/var(--tw-text-opacity,1))}.dark\\:hover\\:rf-bg-red-900\\/90:hover:is(.rf-dark *){background-color:rgba(127,29,29,.9)}.dark\\:hover\\:rf-bg-zinc-50\\/90:hover:is(.rf-dark *){background-color:hsla(0,0%,98%,.9)}.dark\\:hover\\:rf-bg-zinc-800:hover:is(.rf-dark *){--tw-bg-opacity:1;background-color:rgb(39 39 42/var(--tw-bg-opacity,1))}.dark\\:hover\\:rf-bg-zinc-800\\/80:hover:is(.rf-dark *){background-color:rgba(39,39,42,.8)}.dark\\:hover\\:rf-text-zinc-50:hover:is(.rf-dark *){--tw-text-opacity:1;color:rgb(250 250 250/var(--tw-text-opacity,1))}.dark\\:focus\\:rf-bg-zinc-800:focus:is(.rf-dark *){--tw-bg-opacity:1;background-color:rgb(39 39 42/var(--tw-bg-opacity,1))}.dark\\:focus\\:rf-text-zinc-50:focus:is(.rf-dark *){--tw-text-opacity:1;color:rgb(250 250 250/var(--tw-text-opacity,1))}.dark\\:focus-visible\\:rf-ring-zinc-300:focus-visible:is(.rf-dark *){--tw-ring-opacity:1;--tw-ring-color:rgb(212 212 216/var(--tw-ring-opacity,1))}.dark\\:data-\\[selected\\=true\\]\\:rf-bg-zinc-800[data-selected=true]:is(.rf-dark *){--tw-bg-opacity:1;background-color:rgb(39 39 42/var(--tw-bg-opacity,1))}.dark\\:data-\\[state\\=active\\]\\:rf-bg-zinc-950[data-state=active]:is(.rf-dark *){--tw-bg-opacity:1;background-color:rgb(9 9 11/var(--tw-bg-opacity,1))}.dark\\:data-\\[state\\=checked\\]\\:rf-bg-zinc-50[data-state=checked]:is(.rf-dark *){--tw-bg-opacity:1;background-color:rgb(250 250 250/var(--tw-bg-opacity,1))}.dark\\:data-\\[state\\=open\\]\\:rf-bg-zinc-800[data-state=open]:is(.rf-dark *){--tw-bg-opacity:1;background-color:rgb(39 39 42/var(--tw-bg-opacity,1))}.dark\\:data-\\[selected\\=true\\]\\:rf-text-zinc-50[data-selected=true]:is(.rf-dark *){--tw-text-opacity:1;color:rgb(250 250 250/var(--tw-text-opacity,1))}.dark\\:data-\\[state\\=active\\]\\:rf-text-zinc-50[data-state=active]:is(.rf-dark *){--tw-text-opacity:1;color:rgb(250 250 250/var(--tw-text-opacity,1))}.dark\\:data-\\[state\\=checked\\]\\:rf-text-zinc-900[data-state=checked]:is(.rf-dark *){--tw-text-opacity:1;color:rgb(24 24 27/var(--tw-text-opacity,1))}@media (min-width:640px){.sm\\:rf-order-1{order:1}.sm\\:rf-order-2{order:2}.sm\\:rf-mt-0{margin-top:0}.sm\\:rf-inline{display:inline}.sm\\:rf-hidden{display:none}.sm\\:rf-w-auto{width:auto}.sm\\:rf-flex-row{flex-direction:row}.sm\\:rf-items-center{align-items:center}.sm\\:rf-justify-end{justify-content:flex-end}.sm\\:rf-gap-3{gap:.75rem}.sm\\:rf-space-x-2>:not([hidden])~:not([hidden]){--tw-space-x-reverse:0;margin-left:calc(.5rem*(1 - var(--tw-space-x-reverse)));margin-right:calc(.5rem*var(--tw-space-x-reverse))}.sm\\:rf-rounded-lg{border-radius:var(--radius)}.sm\\:rf-px-4{padding-left:1rem;padding-right:1rem}.sm\\:rf-text-left{text-align:left}.sm\\:rf-text-sm{font-size:.875rem;line-height:1.25rem}.sm\\:rf-text-xl{font-size:1.25rem;line-height:1.75rem}}@media (min-width:768px){.md\\:rf-grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}}.\\[\\&\\>span\\]\\:rf-line-clamp-1>span{display:-webkit-box;overflow:hidden;-webkit-box-orient:vertical;-webkit-line-clamp:1}.\\[\\&\\>svg\\]\\:rf-size-4>svg{height:1rem;width:1rem}.\\[\\&\\>svg\\]\\:rf-shrink-0>svg{flex-shrink:0}.\\[\\&\\>svg\\]\\:rf-text-red-300>svg{--tw-text-opacity:1;color:rgb(252 165 165/var(--tw-text-opacity,1))}.\\[\\&\\>svg\\]\\:hover\\:rf-text-red-400:hover>svg{--tw-text-opacity:1;color:rgb(248 113 113/var(--tw-text-opacity,1))}.\\[\\&_\\[cmdk-group-heading\\]\\]\\:rf-px-2 [cmdk-group-heading]{padding-left:.5rem;padding-right:.5rem}.\\[\\&_\\[cmdk-group-heading\\]\\]\\:rf-py-1\\.5 [cmdk-group-heading]{padding-bottom:.375rem;padding-top:.375rem}.\\[\\&_\\[cmdk-group-heading\\]\\]\\:rf-text-xs [cmdk-group-heading]{font-size:.75rem;line-height:1rem}.\\[\\&_\\[cmdk-group-heading\\]\\]\\:rf-font-medium [cmdk-group-heading]{font-weight:500}.\\[\\&_\\[cmdk-group-heading\\]\\]\\:rf-text-zinc-500 [cmdk-group-heading]{--tw-text-opacity:1;color:rgb(113 113 122/var(--tw-text-opacity,1))}.dark\\:\\[\\&_\\[cmdk-group-heading\\]\\]\\:rf-text-zinc-400 [cmdk-group-heading]:is(.rf-dark *){--tw-text-opacity:1;color:rgb(161 161 170/var(--tw-text-opacity,1))}.\\[\\&_\\[cmdk-group\\]\\:not\\(\\[hidden\\]\\)_\\~\\[cmdk-group\\]\\]\\:rf-pt-0 [cmdk-group]:not([hidden])~[cmdk-group]{padding-top:0}.\\[\\&_\\[cmdk-group\\]\\]\\:rf-px-2 [cmdk-group]{padding-left:.5rem;padding-right:.5rem}.\\[\\&_\\[cmdk-input-wrapper\\]_svg\\]\\:rf-h-5 [cmdk-input-wrapper] svg{height:1.25rem}.\\[\\&_\\[cmdk-input-wrapper\\]_svg\\]\\:rf-w-5 [cmdk-input-wrapper] svg{width:1.25rem}.\\[\\&_\\[cmdk-input\\]\\]\\:rf-h-12 [cmdk-input]{height:3rem}.\\[\\&_\\[cmdk-item\\]\\]\\:rf-px-2 [cmdk-item]{padding-left:.5rem;padding-right:.5rem}.\\[\\&_\\[cmdk-item\\]\\]\\:rf-py-3 [cmdk-item]{padding-bottom:.75rem;padding-top:.75rem}.\\[\\&_\\[cmdk-item\\]_svg\\]\\:rf-h-5 [cmdk-item] svg{height:1.25rem}.\\[\\&_\\[cmdk-item\\]_svg\\]\\:rf-w-5 [cmdk-item] svg{width:1.25rem}.\\[\\&_svg\\]\\:rf-pointer-events-none svg{pointer-events:none}.\\[\\&_svg\\]\\:rf-size-4 svg{height:1rem;width:1rem}.\\[\\&_svg\\]\\:rf-shrink-0 svg{flex-shrink:0}',MPn=()=>{Nt.useEffect(()=>{if(document.querySelector('style[data-styles="tscircuit-runframe"]'))return;const e=document.createElement("style");e.setAttribute("data-styles","tscircuit-runframe"),e.textContent=QPn,document.head.appendChild(e)},[])},RPn=i=>{Nt.useEffect(()=>(i?document.body.style.overflow="hidden":document.body.style.overflow="",()=>{document.body.style.overflow=""}),[i])},zut=i=>`hsl(${y2.indexOf(i)*137.5%360}, 70%, 50%)`,DPn=({phaseTimings:i})=>{if(!i)return null;const e=Object.values(i).reduce((t,n)=>t+n,0);return Ct.jsxs("div",{className:"rf-space-y-2 rf-w-full rf-px-4",children:[Ct.jsx("div",{className:"rf-relative rf-h-8 rf-flex rf-rounded-sm",children:y2.map(t=>{const n=i[t]||0,r=n/e*100;return Ct.jsx("div",{className:"rf-group/bar rf-relative rf-overflow-visible",style:{width:`${r}%`,backgroundColor:zut(t)},children:Ct.jsxs("div",{className:"rf-opacity-0 group-hover/bar:rf-opacity-100 rf-transition-opacity rf-absolute rf-bottom-full rf-left-1/2 rf-transform -rf-translate-x-1/2 rf-mb-2 rf-px-2 rf-py-1 rf-text-xs rf-whitespace-nowrap rf-rounded rf-bg-gray-900 rf-text-white rf-pointer-events-none",children:[t,": ",n.toFixed(1),"ms"]})},t)})}),Ct.jsxs("div",{className:"rf-text-xs rf-text-gray-500",children:["Total: ",e.toFixed(2),"ms"]})]})},NPn=({renderLog:i})=>{const[e,t]=Nt.useState("chronological");if(!i)return Ct.jsx("div",{className:"rf-p-4 rf-bg-gray-100 rf-rounded-md",children:"No render log, make sure this tab is open when you render (TODO add a rerender button here)"});const n=Object.entries((i==null?void 0:i.phaseTimings)??{});e==="chronological"?n.sort((o,a)=>y2.indexOf(o[0])-y2.indexOf(a[0])):n.sort((o,a)=>a[1]-o[1]);const r=n.reduce((o,[a,s])=>o+s,0);return Ct.jsxs("div",{className:"rf-bg-white",children:[Ct.jsxs("div",{className:"rf-flex rf-justify-between rf-items-center",children:[Ct.jsx("div",{children:"Render Logs"}),Ct.jsxs("div",{className:"rf-mb-4 rf-pr-2 rf-flex rf-text-xs rf-items-center",children:[Ct.jsx("div",{className:"rf-mr-2",children:"Sort by:"}),Ct.jsxs("select",{value:e,onChange:o=>t(o.target.value),className:"rf-px-2 rf-py-1 rf-border rf-rounded rf-text-xs",children:[Ct.jsx("option",{value:"chronological",children:"Phase Order"}),Ct.jsx("option",{value:"longest",children:"Duration"})]})]})]}),Ct.jsx(DPn,{phaseTimings:i.phaseTimings}),Ct.jsxs("table",{className:"rf-w-full rf-text-xs",children:[Ct.jsx("thead",{children:Ct.jsxs("tr",{children:[Ct.jsx("th",{className:"rf-text-left rf-p-2",children:"Phase Order"}),Ct.jsx("th",{className:"rf-text-left rf-p-2",children:"Phase"}),Ct.jsx("th",{className:"rf-text-left rf-p-2",children:"Duration (ms)"})]})}),Ct.jsx("tbody",{children:n.map(([o,a])=>Ct.jsxs("tr",{children:[Ct.jsx("td",{className:"rf-p-2",children:y2.indexOf(o)}),Ct.jsx("td",{className:"rf-p-2",children:o}),Ct.jsx("td",{className:"rf-p-2",children:Ct.jsx("div",{className:"rf-w-8",children:Ct.jsx("div",{className:"rf-h-2 rf-rounded-sm",style:{backgroundColor:zut(o),width:`${a/r*100}%`}})})}),Ct.jsx("td",{className:"rf-p-2",children:Ct.jsxs("div",{className:"rf-flex w-full",children:[Ct.jsxs("span",{className:"rf-flex-grow",children:[a,"ms"]}),Ct.jsxs("span",{className:"rf-text-gray-500 rf-pr-2",children:[(a/r*100).toFixed(1),"%"]})]})})]},o))})]})]})},TPn=({errorMessage:i,errorStack:e,circuitJsonErrors:t})=>{Nt.useEffect(()=>{if(i){const n=new Error(i);e&&(n.stack=e);try{GU.captureException(n)}catch{}}},[i,e]),Nt.useEffect(()=>{if(t&&t.length>0)for(const n of t){const r=new Error(n.message||"Circuit JSON Error");n.stack&&(r.stack=n.stack);try{GU.captureException(r,{error_type:n.type})}catch{}}},[t])},kPn="0.0.766";function PPn(i,e){const[t,n]=Nt.useState(()=>{try{const r=window.localStorage.getItem(i);return r?JSON.parse(r):e}catch(r){return console.error("Error reading from localStorage:",r),e}});return Nt.useEffect(()=>{try{window.localStorage.setItem(i,JSON.stringify(t))}catch(r){console.error("Error writing to localStorage:",r)}},[i,t]),[t,n]}const _Ce={BASE_URL:"/",DEV:!1,MODE:"production",PROD:!0,SSR:!1},vCe=new Map,Hq=i=>{const e=vCe.get(i);return e?Object.fromEntries(Object.entries(e.stores).map(([t,n])=>[t,n.getState()])):{}},UPn=(i,e,t)=>{if(i===void 0)return{type:"untracked",connection:e.connect(t)};const n=vCe.get(t.name);if(n)return{type:"tracked",store:i,...n};const r={connection:e.connect(t),stores:{}};return vCe.set(t.name,r),{type:"tracked",store:i,...r}},LPn=(i,e={})=>(t,n,r)=>{const{enabled:o,anonymousActionType:a,store:s,...l}=e;let c;try{c=(o??(_Ce?"production":void 0)!=="production")&&window.__REDUX_DEVTOOLS_EXTENSION__}catch{}if(!c)return(_Ce?"production":void 0)!=="production"&&o&&console.warn("[zustand devtools middleware] Please install/enable Redux devtools extension"),i(t,n,r);const{connection:u,...A}=UPn(s,c,l);let d=!0;r.setState=(y,_,v)=>{const E=t(y,_);if(!d)return E;const b=v===void 0?{type:a||"anonymous"}:typeof v=="string"?{type:v}:v;return s===void 0?(u==null||u.send(b,n()),E):(u==null||u.send({...b,type:`${s}/${b.type}`},{...Hq(l.name),[s]:r.getState()}),E)};const f=(...y)=>{const _=d;d=!1,t(...y),d=_},h=i(r.setState,n,r);if(A.type==="untracked"?u==null||u.init(h):(A.stores[A.store]=r,u==null||u.init(Object.fromEntries(Object.entries(A.stores).map(([y,_])=>[y,y===A.store?h:_.getState()])))),r.dispatchFromDevtools&&typeof r.dispatch=="function"){let y=!1;const _=r.dispatch;r.dispatch=(...v)=>{(_Ce?"production":void 0)!=="production"&&v[0].type==="__setState"&&!y&&(console.warn('[zustand devtools middleware] "__setState" action type is reserved to set state from the devtools. Avoid using it.'),y=!0),_(...v)}}return u.subscribe(y=>{var _;switch(y.type){case"ACTION":if(typeof y.payload!="string"){console.error("[zustand devtools middleware] Unsupported action format");return}return ICe(y.payload,v=>{if(v.type==="__setState"){if(s===void 0){f(v.state);return}Object.keys(v.state).length!==1&&console.error(`
14070
+ */const wPn=({containerClassName:i,...e})=>{const t=Nt.useRef(null),[n,r]=Nt.useState(620);return Nt.useLayoutEffect(()=>{const o=()=>{if(t.current){const s=t.current.clientHeight,l=window.innerHeight;r(Math.min(Math.max(s,620),l))}};o();const a=new ResizeObserver(o);return t.current&&a.observe(t.current),window.addEventListener("resize",o),()=>{a.disconnect(),window.removeEventListener("resize",o)}},[]),Ct.jsx("div",{ref:t,className:i||"rf-w-full rf-h-full",children:Ct.jsx(SPn,{...e,height:n})})},QPn='*,:after,:before{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }/*! tailwindcss v3.4.17 | MIT License | https://tailwindcss.com*/*,:after,:before{border:0 solid #e5e7eb;box-sizing:border-box}:after,:before{--tw-content:""}:host,html{line-height:1.5;-webkit-text-size-adjust:100%;font-family:ui-sans-serif,system-ui,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;font-feature-settings:normal;font-variation-settings:normal;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-tap-highlight-color:transparent}body{line-height:inherit;margin:0}hr{border-top-width:1px;color:inherit;height:0}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,pre,samp{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-size:1em;font-variation-settings:normal}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{border-collapse:collapse;border-color:inherit;text-indent:0}button,input,optgroup,select,textarea{color:inherit;font-family:inherit;font-feature-settings:inherit;font-size:100%;font-variation-settings:inherit;font-weight:inherit;letter-spacing:inherit;line-height:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dd,dl,figure,h1,h2,h3,h4,h5,h6,hr,p,pre{margin:0}fieldset{margin:0}fieldset,legend{padding:0}menu,ol,ul{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{color:#9ca3af;opacity:1}input::placeholder,textarea::placeholder{color:#9ca3af;opacity:1}[role=button],button{cursor:pointer}:disabled{cursor:default}audio,canvas,embed,iframe,img,object,svg,video{display:block;vertical-align:middle}img,video{height:auto;max-width:100%}[hidden]:where(:not([hidden=until-found])){display:none}:root{--radius:0.5rem}.rf-pointer-events-none{pointer-events:none}.rf-invisible{visibility:hidden}.rf-fixed{position:fixed}.rf-absolute{position:absolute}.rf-relative{position:relative}.rf-inset-0{inset:0}.-rf-left-2{left:-.5rem}.-rf-right-10{right:-2.5rem}.-rf-right-2{right:-.5rem}.-rf-right-4{right:-1rem}.-rf-right-6{right:-1.5rem}.-rf-right-7{right:-1.75rem}.-rf-right-8{right:-2rem}.-rf-right-9{right:-2.25rem}.rf-bottom-full{bottom:100%}.rf-left-0{left:0}.rf-left-1{left:.25rem}.rf-left-1\\/2{left:50%}.rf-left-2{left:.5rem}.rf-left-\\[50\\%\\]{left:50%}.rf-right-0{right:0}.rf-right-1{right:.25rem}.rf-right-4{right:1rem}.rf-right-\\[4px\\]{right:4px}.rf-top-0{top:0}.rf-top-1{top:.25rem}.rf-top-2{top:.5rem}.rf-top-2\\.5{top:.625rem}.rf-top-\\[50\\%\\]{top:50%}.rf-top-\\[6px\\]{top:6px}.\\!rf-z-\\[101\\]{z-index:101!important}.rf-z-10{z-index:10}.rf-z-50{z-index:50}.rf-z-\\[100\\]{z-index:100}.rf-order-1{order:1}.rf-order-2{order:2}.rf-order-3{order:3}.rf-m-1{margin:.25rem}.rf-m-6{margin:1.5rem}.-rf-mx-1,.rf--mx-1{margin-left:-.25rem;margin-right:-.25rem}.rf-mx-1{margin-left:.25rem;margin-right:.25rem}.rf-mx-2{margin-left:.5rem;margin-right:.5rem}.rf-mx-4{margin-left:1rem;margin-right:1rem}.rf-mx-auto{margin-left:auto;margin-right:auto}.rf-my-1{margin-bottom:.25rem;margin-top:.25rem}.rf-my-12{margin-bottom:3rem;margin-top:3rem}.rf-my-4{margin-bottom:1rem;margin-top:1rem}.rf-my-auto{margin-bottom:auto;margin-top:auto}.rf-mb-1{margin-bottom:.25rem}.rf-mb-12{margin-bottom:3rem}.rf-mb-2{margin-bottom:.5rem}.rf-mb-3{margin-bottom:.75rem}.rf-mb-4{margin-bottom:1rem}.rf-mb-6{margin-bottom:1.5rem}.rf-mb-8{margin-bottom:2rem}.rf-ml-1{margin-left:.25rem}.rf-ml-2{margin-left:.5rem}.rf-ml-auto{margin-left:auto}.rf-mr-1{margin-right:.25rem}.rf-mr-2{margin-right:.5rem}.rf-mt-0{margin-top:0}.rf-mt-0\\.5{margin-top:.125rem}.rf-mt-1{margin-top:.25rem}.rf-mt-2{margin-top:.5rem}.rf-mt-3{margin-top:.75rem}.rf-mt-4{margin-top:1rem}.rf-mt-5{margin-top:1.25rem}.rf-mt-auto{margin-top:auto}.rf-block{display:block}.rf-inline-block{display:inline-block}.rf-inline{display:inline}.rf-flex{display:flex}.rf-inline-flex{display:inline-flex}.rf-grid{display:grid}.rf-hidden{display:none}.rf-aspect-square{aspect-ratio:1/1}.rf-aspect-video{aspect-ratio:16/9}.rf-size-14{height:3.5rem;width:3.5rem}.rf-size-4{height:1rem;width:1rem}.\\!rf-h-2{height:.5rem!important}.\\!rf-h-2\\.5{height:.625rem!important}.\\!rf-h-3{height:.75rem!important}.\\!rf-h-full{height:100%!important}.rf-h-1{height:.25rem}.rf-h-10{height:2.5rem}.rf-h-12{height:3rem}.rf-h-2{height:.5rem}.rf-h-2\\.5{height:.625rem}.rf-h-3{height:.75rem}.rf-h-3\\.5{height:.875rem}.rf-h-4{height:1rem}.rf-h-5{height:1.25rem}.rf-h-6{height:1.5rem}.rf-h-60{height:15rem}.rf-h-64{height:16rem}.rf-h-7{height:1.75rem}.rf-h-8{height:2rem}.rf-h-9{height:2.25rem}.rf-h-\\[400px\\]{height:400px}.rf-h-\\[calc\\(100vh-52px\\)\\]{height:calc(100vh - 52px)}.rf-h-\\[var\\(--radix-select-trigger-height\\)\\]{height:var(--radix-select-trigger-height)}.rf-h-auto{height:auto}.rf-h-fit{height:-moz-fit-content;height:fit-content}.rf-h-full{height:100%}.rf-h-px{height:1px}.rf-h-screen{height:100vh}.\\!rf-max-h-\\[40vh\\]{max-height:40vh!important}.rf-max-h-32{max-height:8rem}.rf-max-h-96{max-height:24rem}.rf-max-h-\\[200px\\]{max-height:200px}.rf-max-h-\\[300px\\]{max-height:300px}.rf-max-h-\\[500px\\]{max-height:500px}.rf-max-h-\\[90vh\\]{max-height:90vh}.rf-max-h-full{max-height:100%}.rf-min-h-0{min-height:0}.rf-min-h-\\[200px\\]{min-height:200px}.rf-min-h-\\[300px\\]{min-height:300px}.rf-min-h-\\[620px\\]{min-height:620px}.rf-min-h-\\[calc\\(100vh-240px\\)\\]{min-height:calc(100vh - 240px)}.\\!rf-w-2{width:.5rem!important}.\\!rf-w-2\\.5{width:.625rem!important}.rf-w-1{width:.25rem}.rf-w-1\\/2{width:50%}.rf-w-11{width:2.75rem}.rf-w-11\\/12{width:91.666667%}.rf-w-12{width:3rem}.rf-w-16{width:4rem}.rf-w-2{width:.5rem}.rf-w-2\\.5{width:.625rem}.rf-w-20{width:5rem}.rf-w-28{width:7rem}.rf-w-3{width:.75rem}.rf-w-3\\.5{width:.875rem}.rf-w-32{width:8rem}.rf-w-4{width:1rem}.rf-w-40{width:10rem}.rf-w-48{width:12rem}.rf-w-5{width:1.25rem}.rf-w-6{width:1.5rem}.rf-w-64{width:16rem}.rf-w-72{width:18rem}.rf-w-8{width:2rem}.rf-w-9{width:2.25rem}.rf-w-96{width:24rem}.rf-w-\\[95\\%\\]{width:95%}.rf-w-fit{width:-moz-fit-content;width:fit-content}.rf-w-full{width:100%}.rf-w-screen{width:100vw}.rf-min-w-0{min-width:0}.rf-min-w-10{min-width:2.5rem}.rf-min-w-16{min-width:4rem}.rf-min-w-\\[148px\\]{min-width:148px}.rf-min-w-\\[8rem\\]{min-width:8rem}.rf-min-w-\\[var\\(--radix-select-trigger-width\\)\\]{min-width:var(--radix-select-trigger-width)}.\\!rf-max-w-\\[660px\\]{max-width:660px!important}.rf-max-w-2xl{max-width:42rem}.rf-max-w-3xl{max-width:48rem}.rf-max-w-4xl{max-width:56rem}.rf-max-w-5xl{max-width:64rem}.rf-max-w-full{max-width:100%}.rf-max-w-lg{max-width:32rem}.rf-max-w-md{max-width:28rem}.rf-max-w-none{max-width:none}.rf-max-w-xl{max-width:36rem}.rf-max-w-xs{max-width:20rem}.rf-flex-1{flex:1 1 0%}.rf-flex-shrink-0,.rf-shrink-0{flex-shrink:0}.rf-flex-grow{flex-grow:1}.rf-table-auto{table-layout:auto}.rf-origin-\\[--radix-popover-content-transform-origin\\]{transform-origin:var(--radix-popover-content-transform-origin)}.-rf-translate-x-1{--tw-translate-x:-0.25rem}.-rf-translate-x-1,.-rf-translate-x-1\\/2{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.-rf-translate-x-1\\/2{--tw-translate-x:-50%}.-rf-translate-y-1{--tw-translate-y:-0.25rem}.-rf-translate-y-1,.rf--translate-x-1{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.rf--translate-x-1{--tw-translate-x:-0.25rem}.rf--translate-x-1\\/2{--tw-translate-x:-50%}.rf--translate-x-1\\/2,.rf--translate-y-1{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.rf--translate-y-1{--tw-translate-y:-0.25rem}.rf-translate-x-\\[-50\\%\\]{--tw-translate-x:-50%}.rf-translate-x-\\[-50\\%\\],.rf-translate-y-\\[-50\\%\\]{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.rf-translate-y-\\[-50\\%\\]{--tw-translate-y:-50%}.rf-transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@keyframes rf-pulse{50%{opacity:.5}}.rf-animate-pulse{animation:rf-pulse 2s cubic-bezier(.4,0,.6,1) infinite}@keyframes rf-spin{to{transform:rotate(1turn)}}.rf-animate-spin{animation:rf-spin 1s linear infinite}.rf-cursor-default{cursor:default}.rf-cursor-not-allowed{cursor:not-allowed}.rf-cursor-pointer{cursor:pointer}.rf-select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}.rf-grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.rf-grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.rf-flex-row{flex-direction:row}.rf-flex-col{flex-direction:column}.rf-flex-col-reverse{flex-direction:column-reverse}.rf-flex-wrap{flex-wrap:wrap}.rf-place-items-center{place-items:center}.rf-items-start{align-items:flex-start}.rf-items-end{align-items:flex-end}.rf-items-center{align-items:center}.rf-items-stretch{align-items:stretch}.rf-justify-end{justify-content:flex-end}.rf-justify-center{justify-content:center}.rf-justify-between{justify-content:space-between}.rf-gap-0{gap:0}.rf-gap-1{gap:.25rem}.rf-gap-2{gap:.5rem}.rf-gap-3{gap:.75rem}.rf-gap-4{gap:1rem}.rf-gap-5{gap:1.25rem}.rf-gap-6{gap:1.5rem}.rf-gap-8{gap:2rem}.rf-space-x-2>:not([hidden])~:not([hidden]){--tw-space-x-reverse:0;margin-left:calc(.5rem*(1 - var(--tw-space-x-reverse)));margin-right:calc(.5rem*var(--tw-space-x-reverse))}.rf-space-y-2>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-bottom:calc(.5rem*var(--tw-space-y-reverse));margin-top:calc(.5rem*(1 - var(--tw-space-y-reverse)))}.rf-space-y-3>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-bottom:calc(.75rem*var(--tw-space-y-reverse));margin-top:calc(.75rem*(1 - var(--tw-space-y-reverse)))}.rf-space-y-4>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-bottom:calc(1rem*var(--tw-space-y-reverse));margin-top:calc(1rem*(1 - var(--tw-space-y-reverse)))}.rf-space-y-6>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-bottom:calc(1.5rem*var(--tw-space-y-reverse));margin-top:calc(1.5rem*(1 - var(--tw-space-y-reverse)))}.rf-divide-y>:not([hidden])~:not([hidden]){--tw-divide-y-reverse:0;border-bottom-width:calc(1px*var(--tw-divide-y-reverse));border-top-width:calc(1px*(1 - var(--tw-divide-y-reverse)))}.rf-overflow-auto{overflow:auto}.rf-overflow-hidden{overflow:hidden}.rf-overflow-visible{overflow:visible}.rf-overflow-x-auto{overflow-x:auto}.\\!rf-overflow-y-auto{overflow-y:auto!important}.rf-overflow-y-auto{overflow-y:auto}.rf-overflow-x-hidden{overflow-x:hidden}.rf-overflow-x-clip{overflow-x:clip}.rf-truncate{overflow:hidden;text-overflow:ellipsis}.rf-truncate,.rf-whitespace-nowrap{white-space:nowrap}.rf-whitespace-pre-wrap{white-space:pre-wrap}.rf-break-words{overflow-wrap:break-word}.rf-rounded{border-radius:.25rem}.rf-rounded-2xl{border-radius:1rem}.rf-rounded-full{border-radius:9999px}.rf-rounded-lg{border-radius:var(--radius)}.rf-rounded-md{border-radius:calc(var(--radius) - 2px)}.rf-rounded-sm{border-radius:calc(var(--radius) - 4px)}.rf-rounded-xl{border-radius:.75rem}.rf-border{border-width:1px}.rf-border-2{border-width:2px}.rf-border-b{border-bottom-width:1px}.rf-border-t{border-top-width:1px}.rf-border-blue-200{--tw-border-opacity:1;border-color:rgb(191 219 254/var(--tw-border-opacity,1))}.rf-border-blue-400{--tw-border-opacity:1;border-color:rgb(96 165 250/var(--tw-border-opacity,1))}.rf-border-blue-500{--tw-border-opacity:1;border-color:rgb(59 130 246/var(--tw-border-opacity,1))}.rf-border-blue-600{--tw-border-opacity:1;border-color:rgb(37 99 235/var(--tw-border-opacity,1))}.rf-border-gray-200{--tw-border-opacity:1;border-color:rgb(229 231 235/var(--tw-border-opacity,1))}.rf-border-gray-300{--tw-border-opacity:1;border-color:rgb(209 213 219/var(--tw-border-opacity,1))}.rf-border-green-200{--tw-border-opacity:1;border-color:rgb(187 247 208/var(--tw-border-opacity,1))}.rf-border-input{border-color:hsl(var(--input))}.rf-border-neutral-200{--tw-border-opacity:1;border-color:rgb(229 229 229/var(--tw-border-opacity,1))}.rf-border-orange-200{--tw-border-opacity:1;border-color:rgb(254 215 170/var(--tw-border-opacity,1))}.rf-border-primary{border-color:hsl(var(--primary))}.rf-border-red-200{--tw-border-opacity:1;border-color:rgb(254 202 202/var(--tw-border-opacity,1))}.rf-border-red-400{--tw-border-opacity:1;border-color:rgb(248 113 113/var(--tw-border-opacity,1))}.rf-border-red-500{--tw-border-opacity:1;border-color:rgb(239 68 68/var(--tw-border-opacity,1))}.rf-border-zinc-200{--tw-border-opacity:1;border-color:rgb(228 228 231/var(--tw-border-opacity,1))}.rf-border-zinc-900{--tw-border-opacity:1;border-color:rgb(24 24 27/var(--tw-border-opacity,1))}.rf-bg-background{background-color:hsl(var(--background))}.rf-bg-black{--tw-bg-opacity:1;background-color:rgb(0 0 0/var(--tw-bg-opacity,1))}.rf-bg-black\\/80{background-color:rgba(0,0,0,.8)}.rf-bg-blue-100{--tw-bg-opacity:1;background-color:rgb(219 234 254/var(--tw-bg-opacity,1))}.rf-bg-blue-50{--tw-bg-opacity:1;background-color:rgb(239 246 255/var(--tw-bg-opacity,1))}.rf-bg-blue-500{--tw-bg-opacity:1;background-color:rgb(59 130 246/var(--tw-bg-opacity,1))}.rf-bg-blue-600{--tw-bg-opacity:1;background-color:rgb(37 99 235/var(--tw-bg-opacity,1))}.rf-bg-gray-100{--tw-bg-opacity:1;background-color:rgb(243 244 246/var(--tw-bg-opacity,1))}.rf-bg-gray-200{--tw-bg-opacity:1;background-color:rgb(229 231 235/var(--tw-bg-opacity,1))}.rf-bg-gray-300{--tw-bg-opacity:1;background-color:rgb(209 213 219/var(--tw-bg-opacity,1))}.rf-bg-gray-400{--tw-bg-opacity:1;background-color:rgb(156 163 175/var(--tw-bg-opacity,1))}.rf-bg-gray-50{--tw-bg-opacity:1;background-color:rgb(249 250 251/var(--tw-bg-opacity,1))}.rf-bg-gray-500{--tw-bg-opacity:1;background-color:rgb(107 114 128/var(--tw-bg-opacity,1))}.rf-bg-gray-700{--tw-bg-opacity:1;background-color:rgb(55 65 81/var(--tw-bg-opacity,1))}.rf-bg-gray-800{--tw-bg-opacity:1;background-color:rgb(31 41 55/var(--tw-bg-opacity,1))}.rf-bg-gray-900{--tw-bg-opacity:1;background-color:rgb(17 24 39/var(--tw-bg-opacity,1))}.rf-bg-green-100{--tw-bg-opacity:1;background-color:rgb(220 252 231/var(--tw-bg-opacity,1))}.rf-bg-green-50{--tw-bg-opacity:1;background-color:rgb(240 253 244/var(--tw-bg-opacity,1))}.rf-bg-muted{background-color:hsl(var(--muted))}.rf-bg-neutral-100{--tw-bg-opacity:1;background-color:rgb(245 245 245/var(--tw-bg-opacity,1))}.rf-bg-neutral-50{--tw-bg-opacity:1;background-color:rgb(250 250 250/var(--tw-bg-opacity,1))}.rf-bg-neutral-800{--tw-bg-opacity:1;background-color:rgb(38 38 38/var(--tw-bg-opacity,1))}.rf-bg-neutral-900{--tw-bg-opacity:1;background-color:rgb(23 23 23/var(--tw-bg-opacity,1))}.rf-bg-orange-400{--tw-bg-opacity:1;background-color:rgb(251 146 60/var(--tw-bg-opacity,1))}.rf-bg-orange-50{--tw-bg-opacity:1;background-color:rgb(255 247 237/var(--tw-bg-opacity,1))}.rf-bg-popover{background-color:hsl(var(--popover))}.rf-bg-red-100{--tw-bg-opacity:1;background-color:rgb(254 226 226/var(--tw-bg-opacity,1))}.rf-bg-red-50{--tw-bg-opacity:1;background-color:rgb(254 242 242/var(--tw-bg-opacity,1))}.rf-bg-red-500{--tw-bg-opacity:1;background-color:rgb(239 68 68/var(--tw-bg-opacity,1))}.rf-bg-red-900{--tw-bg-opacity:1;background-color:rgb(127 29 29/var(--tw-bg-opacity,1))}.rf-bg-transparent{background-color:transparent}.rf-bg-white{--tw-bg-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity,1))}.rf-bg-yellow-100{--tw-bg-opacity:1;background-color:rgb(254 249 195/var(--tw-bg-opacity,1))}.rf-bg-zinc-100{--tw-bg-opacity:1;background-color:rgb(244 244 245/var(--tw-bg-opacity,1))}.rf-bg-zinc-200{--tw-bg-opacity:1;background-color:rgb(228 228 231/var(--tw-bg-opacity,1))}.rf-bg-zinc-50{--tw-bg-opacity:1;background-color:rgb(250 250 250/var(--tw-bg-opacity,1))}.rf-bg-zinc-800{--tw-bg-opacity:1;background-color:rgb(39 39 42/var(--tw-bg-opacity,1))}.rf-bg-zinc-900{--tw-bg-opacity:1;background-color:rgb(24 24 27/var(--tw-bg-opacity,1))}.rf-bg-opacity-50{--tw-bg-opacity:0.5}.rf-fill-current{fill:currentColor}.rf-object-contain{-o-object-fit:contain;object-fit:contain}.rf-object-cover{-o-object-fit:cover;object-fit:cover}.\\!rf-p-0{padding:0!important}.rf-p-0{padding:0}.rf-p-1{padding:.25rem}.rf-p-2{padding:.5rem}.rf-p-3{padding:.75rem}.rf-p-4{padding:1rem}.rf-p-5{padding:1.25rem}.rf-p-6{padding:1.5rem}.rf-p-8{padding:2rem}.rf-px-1{padding-left:.25rem;padding-right:.25rem}.rf-px-2{padding-left:.5rem;padding-right:.5rem}.rf-px-3{padding-left:.75rem;padding-right:.75rem}.rf-px-4{padding-left:1rem;padding-right:1rem}.rf-px-6{padding-left:1.5rem;padding-right:1.5rem}.rf-px-8{padding-left:2rem;padding-right:2rem}.rf-py-0{padding-bottom:0;padding-top:0}.rf-py-0\\.5{padding-bottom:.125rem;padding-top:.125rem}.rf-py-1{padding-bottom:.25rem;padding-top:.25rem}.rf-py-1\\.5{padding-bottom:.375rem;padding-top:.375rem}.rf-py-10{padding-bottom:2.5rem;padding-top:2.5rem}.rf-py-12{padding-bottom:3rem;padding-top:3rem}.rf-py-2{padding-bottom:.5rem;padding-top:.5rem}.rf-py-3{padding-bottom:.75rem;padding-top:.75rem}.rf-py-4{padding-bottom:1rem;padding-top:1rem}.rf-py-6{padding-bottom:1.5rem;padding-top:1.5rem}.rf-py-8{padding-bottom:2rem;padding-top:2rem}.rf-pb-0{padding-bottom:0}.rf-pb-2{padding-bottom:.5rem}.rf-pb-3{padding-bottom:.75rem}.rf-pb-4{padding-bottom:1rem}.rf-pl-2{padding-left:.5rem}.rf-pl-4{padding-left:1rem}.rf-pl-8{padding-left:2rem}.rf-pr-2{padding-right:.5rem}.rf-pt-0{padding-top:0}.rf-pt-2{padding-top:.5rem}.rf-pt-4{padding-top:1rem}.rf-text-left{text-align:left}.rf-text-center{text-align:center}.rf-text-right{text-align:right}.rf-font-mono{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace}.rf-text-2xl{font-size:1.5rem;line-height:2rem}.rf-text-3xl{font-size:1.875rem;line-height:2.25rem}.rf-text-\\[8px\\]{font-size:8px}.rf-text-base{font-size:1rem;line-height:1.5rem}.rf-text-lg{font-size:1.125rem;line-height:1.75rem}.rf-text-sm{font-size:.875rem;line-height:1.25rem}.rf-text-xl{font-size:1.25rem;line-height:1.75rem}.rf-text-xs{font-size:.75rem;line-height:1rem}.\\!rf-font-normal{font-weight:400!important}.rf-font-bold{font-weight:700}.rf-font-medium{font-weight:500}.rf-font-semibold{font-weight:600}.rf-uppercase{text-transform:uppercase}.rf-capitalize{text-transform:capitalize}.rf-tabular-nums{--tw-numeric-spacing:tabular-nums;font-variant-numeric:var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction)}.rf-leading-5{line-height:1.25rem}.rf-leading-none{line-height:1}.rf-leading-relaxed{line-height:1.625}.rf-leading-tight{line-height:1.25}.rf-tracking-wide{letter-spacing:.025em}.rf-tracking-widest{letter-spacing:.1em}.rf-text-black{--tw-text-opacity:1;color:rgb(0 0 0/var(--tw-text-opacity,1))}.rf-text-blue-500{--tw-text-opacity:1;color:rgb(59 130 246/var(--tw-text-opacity,1))}.rf-text-blue-600{--tw-text-opacity:1;color:rgb(37 99 235/var(--tw-text-opacity,1))}.rf-text-blue-700{--tw-text-opacity:1;color:rgb(29 78 216/var(--tw-text-opacity,1))}.rf-text-blue-800{--tw-text-opacity:1;color:rgb(30 64 175/var(--tw-text-opacity,1))}.rf-text-blue-900{--tw-text-opacity:1;color:rgb(30 58 138/var(--tw-text-opacity,1))}.rf-text-current{color:currentColor}.rf-text-gray-400{--tw-text-opacity:1;color:rgb(156 163 175/var(--tw-text-opacity,1))}.rf-text-gray-500{--tw-text-opacity:1;color:rgb(107 114 128/var(--tw-text-opacity,1))}.rf-text-gray-600{--tw-text-opacity:1;color:rgb(75 85 99/var(--tw-text-opacity,1))}.rf-text-gray-700{--tw-text-opacity:1;color:rgb(55 65 81/var(--tw-text-opacity,1))}.rf-text-gray-800{--tw-text-opacity:1;color:rgb(31 41 55/var(--tw-text-opacity,1))}.rf-text-gray-900{--tw-text-opacity:1;color:rgb(17 24 39/var(--tw-text-opacity,1))}.rf-text-green-500{--tw-text-opacity:1;color:rgb(34 197 94/var(--tw-text-opacity,1))}.rf-text-green-600{--tw-text-opacity:1;color:rgb(22 163 74/var(--tw-text-opacity,1))}.rf-text-green-700{--tw-text-opacity:1;color:rgb(21 128 61/var(--tw-text-opacity,1))}.rf-text-green-800{--tw-text-opacity:1;color:rgb(22 101 52/var(--tw-text-opacity,1))}.rf-text-green-900{--tw-text-opacity:1;color:rgb(20 83 45/var(--tw-text-opacity,1))}.rf-text-muted-foreground{color:hsl(var(--muted-foreground))}.rf-text-neutral-50{--tw-text-opacity:1;color:rgb(250 250 250/var(--tw-text-opacity,1))}.rf-text-neutral-500{--tw-text-opacity:1;color:rgb(115 115 115/var(--tw-text-opacity,1))}.rf-text-neutral-900{--tw-text-opacity:1;color:rgb(23 23 23/var(--tw-text-opacity,1))}.rf-text-neutral-950{--tw-text-opacity:1;color:rgb(10 10 10/var(--tw-text-opacity,1))}.rf-text-orange-500{--tw-text-opacity:1;color:rgb(249 115 22/var(--tw-text-opacity,1))}.rf-text-orange-600{--tw-text-opacity:1;color:rgb(234 88 12/var(--tw-text-opacity,1))}.rf-text-orange-800{--tw-text-opacity:1;color:rgb(154 52 18/var(--tw-text-opacity,1))}.rf-text-popover-foreground{color:hsl(var(--popover-foreground))}.rf-text-red-200{--tw-text-opacity:1;color:rgb(254 202 202/var(--tw-text-opacity,1))}.rf-text-red-300{--tw-text-opacity:1;color:rgb(252 165 165/var(--tw-text-opacity,1))}.rf-text-red-400{--tw-text-opacity:1;color:rgb(248 113 113/var(--tw-text-opacity,1))}.rf-text-red-500{--tw-text-opacity:1;color:rgb(239 68 68/var(--tw-text-opacity,1))}.rf-text-red-600{--tw-text-opacity:1;color:rgb(220 38 38/var(--tw-text-opacity,1))}.rf-text-red-700{--tw-text-opacity:1;color:rgb(185 28 28/var(--tw-text-opacity,1))}.rf-text-red-800{--tw-text-opacity:1;color:rgb(153 27 27/var(--tw-text-opacity,1))}.rf-text-red-900{--tw-text-opacity:1;color:rgb(127 29 29/var(--tw-text-opacity,1))}.rf-text-white{--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity,1))}.rf-text-yellow-400{--tw-text-opacity:1;color:rgb(250 204 21/var(--tw-text-opacity,1))}.rf-text-yellow-500{--tw-text-opacity:1;color:rgb(234 179 8/var(--tw-text-opacity,1))}.rf-text-yellow-900{--tw-text-opacity:1;color:rgb(113 63 18/var(--tw-text-opacity,1))}.rf-text-zinc-200{--tw-text-opacity:1;color:rgb(228 228 231/var(--tw-text-opacity,1))}.rf-text-zinc-300{--tw-text-opacity:1;color:rgb(212 212 216/var(--tw-text-opacity,1))}.rf-text-zinc-400{--tw-text-opacity:1;color:rgb(161 161 170/var(--tw-text-opacity,1))}.rf-text-zinc-50{--tw-text-opacity:1;color:rgb(250 250 250/var(--tw-text-opacity,1))}.rf-text-zinc-500{--tw-text-opacity:1;color:rgb(113 113 122/var(--tw-text-opacity,1))}.rf-text-zinc-900{--tw-text-opacity:1;color:rgb(24 24 27/var(--tw-text-opacity,1))}.rf-text-zinc-950{--tw-text-opacity:1;color:rgb(9 9 11/var(--tw-text-opacity,1))}.rf-underline{text-decoration-line:underline}.rf-line-through{text-decoration-line:line-through}.rf-underline-offset-4{text-underline-offset:4px}.rf-opacity-0{opacity:0}.rf-opacity-100{opacity:1}.rf-opacity-25{opacity:.25}.rf-opacity-30{opacity:.3}.rf-opacity-50{opacity:.5}.rf-opacity-60{opacity:.6}.rf-opacity-75{opacity:.75}.rf-shadow{--tw-shadow:0 1px 3px 0 rgba(0,0,0,.1),0 1px 2px -1px rgba(0,0,0,.1);--tw-shadow-colored:0 1px 3px 0 var(--tw-shadow-color),0 1px 2px -1px var(--tw-shadow-color)}.rf-shadow,.rf-shadow-lg{box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.rf-shadow-lg{--tw-shadow:0 10px 15px -3px rgba(0,0,0,.1),0 4px 6px -4px rgba(0,0,0,.1);--tw-shadow-colored:0 10px 15px -3px var(--tw-shadow-color),0 4px 6px -4px var(--tw-shadow-color)}.rf-shadow-md{--tw-shadow:0 4px 6px -1px rgba(0,0,0,.1),0 2px 4px -2px rgba(0,0,0,.1);--tw-shadow-colored:0 4px 6px -1px var(--tw-shadow-color),0 2px 4px -2px var(--tw-shadow-color)}.rf-shadow-md,.rf-shadow-sm{box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.rf-shadow-sm{--tw-shadow:0 1px 2px 0 rgba(0,0,0,.05);--tw-shadow-colored:0 1px 2px 0 var(--tw-shadow-color)}.rf-outline-none{outline:2px solid transparent;outline-offset:2px}.rf-ring-2{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}.rf-ring-blue-500{--tw-ring-opacity:1;--tw-ring-color:rgb(59 130 246/var(--tw-ring-opacity,1))}.rf-ring-primary{--tw-ring-color:hsl(var(--primary))}.rf-ring-offset-background{--tw-ring-offset-color:hsl(var(--background))}.rf-ring-offset-white{--tw-ring-offset-color:#fff}.rf-transition{transition-duration:.15s;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,-webkit-backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter,-webkit-backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1)}.rf-transition-all{transition-duration:.15s;transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1)}.rf-transition-colors{transition-duration:.15s;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1)}.rf-transition-opacity{transition-duration:.15s;transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1)}.rf-duration-200{transition-duration:.2s}.rf-ease-in-out{transition-timing-function:cubic-bezier(.4,0,.2,1)}@keyframes enter{0%{opacity:var(--tw-enter-opacity,1);transform:translate3d(var(--tw-enter-translate-x,0),var(--tw-enter-translate-y,0),0) scale3d(var(--tw-enter-scale,1),var(--tw-enter-scale,1),var(--tw-enter-scale,1)) rotate(var(--tw-enter-rotate,0))}}@keyframes exit{to{opacity:var(--tw-exit-opacity,1);transform:translate3d(var(--tw-exit-translate-x,0),var(--tw-exit-translate-y,0),0) scale3d(var(--tw-exit-scale,1),var(--tw-exit-scale,1),var(--tw-exit-scale,1)) rotate(var(--tw-exit-rotate,0))}}.rf-slide-in-from-left-1{--tw-enter-translate-x:-0.25rem}.rf-slide-out-to-left-1{--tw-exit-translate-x:-0.25rem}.rf-duration-200{animation-duration:.2s}.rf-ease-in-out{animation-timing-function:cubic-bezier(.4,0,.2,1)}.file\\:rf-border-0::file-selector-button{border-width:0}.file\\:rf-bg-transparent::file-selector-button{background-color:transparent}.file\\:rf-text-sm::file-selector-button{font-size:.875rem;line-height:1.25rem}.file\\:rf-font-medium::file-selector-button{font-weight:500}.placeholder\\:rf-text-zinc-500::-moz-placeholder{--tw-text-opacity:1;color:rgb(113 113 122/var(--tw-text-opacity,1))}.placeholder\\:rf-text-zinc-500::placeholder{--tw-text-opacity:1;color:rgb(113 113 122/var(--tw-text-opacity,1))}.hover\\:rf-border-blue-300:hover{--tw-border-opacity:1;border-color:rgb(147 197 253/var(--tw-border-opacity,1))}.hover\\:\\!rf-bg-transparent:hover{background-color:transparent!important}.hover\\:rf-bg-blue-700:hover{--tw-bg-opacity:1;background-color:rgb(29 78 216/var(--tw-bg-opacity,1))}.hover\\:rf-bg-red-500\\/90:hover{background-color:rgba(239,68,68,.9)}.hover\\:rf-bg-zinc-100:hover{--tw-bg-opacity:1;background-color:rgb(244 244 245/var(--tw-bg-opacity,1))}.hover\\:rf-bg-zinc-100\\/80:hover{background-color:hsla(240,5%,96%,.8)}.hover\\:rf-bg-zinc-900\\/90:hover{background-color:rgba(24,24,27,.9)}.hover\\:rf-text-red-400:hover{--tw-text-opacity:1;color:rgb(248 113 113/var(--tw-text-opacity,1))}.hover\\:rf-text-zinc-900:hover{--tw-text-opacity:1;color:rgb(24 24 27/var(--tw-text-opacity,1))}.hover\\:rf-underline:hover{text-decoration-line:underline}.focus\\:rf-bg-gray-100:focus{--tw-bg-opacity:1;background-color:rgb(243 244 246/var(--tw-bg-opacity,1))}.focus\\:rf-bg-zinc-100:focus{--tw-bg-opacity:1;background-color:rgb(244 244 245/var(--tw-bg-opacity,1))}.focus\\:rf-text-gray-900:focus{--tw-text-opacity:1;color:rgb(17 24 39/var(--tw-text-opacity,1))}.focus\\:rf-text-zinc-900:focus{--tw-text-opacity:1;color:rgb(24 24 27/var(--tw-text-opacity,1))}.focus\\:rf-outline-none:focus{outline:2px solid transparent;outline-offset:2px}.focus\\:rf-ring-2:focus{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}.focus\\:rf-ring-ring:focus{--tw-ring-color:hsl(var(--ring))}.focus\\:rf-ring-offset-2:focus{--tw-ring-offset-width:2px}.focus-visible\\:rf-outline-none:focus-visible{outline:2px solid transparent;outline-offset:2px}.focus-visible\\:rf-ring-1:focus-visible{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}.focus-visible\\:rf-ring-2:focus-visible{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}.focus-visible\\:rf-ring-zinc-950:focus-visible{--tw-ring-opacity:1;--tw-ring-color:rgb(9 9 11/var(--tw-ring-opacity,1))}.focus-visible\\:rf-ring-offset-2:focus-visible{--tw-ring-offset-width:2px}.disabled\\:rf-pointer-events-none:disabled{pointer-events:none}.disabled\\:rf-cursor-not-allowed:disabled{cursor:not-allowed}.disabled\\:rf-opacity-50:disabled{opacity:.5}.rf-group\\/bar:hover .group-hover\\/bar\\:rf-opacity-100{opacity:1}.data-\\[disabled\\=true\\]\\:rf-pointer-events-none[data-disabled=true],.data-\\[disabled\\]\\:rf-pointer-events-none[data-disabled]{pointer-events:none}.data-\\[side\\=bottom\\]\\:rf-translate-y-1[data-side=bottom]{--tw-translate-y:0.25rem}.data-\\[side\\=bottom\\]\\:rf-translate-y-1[data-side=bottom],.data-\\[side\\=left\\]\\:-rf-translate-x-1[data-side=left]{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\\[side\\=left\\]\\:-rf-translate-x-1[data-side=left]{--tw-translate-x:-0.25rem}.data-\\[side\\=right\\]\\:rf-translate-x-1[data-side=right]{--tw-translate-x:0.25rem}.data-\\[side\\=right\\]\\:rf-translate-x-1[data-side=right],.data-\\[side\\=top\\]\\:-rf-translate-y-1[data-side=top]{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\\[side\\=top\\]\\:-rf-translate-y-1[data-side=top]{--tw-translate-y:-0.25rem}.data-\\[selected\\=true\\]\\:rf-bg-zinc-100[data-selected=true]{--tw-bg-opacity:1;background-color:rgb(244 244 245/var(--tw-bg-opacity,1))}.data-\\[state\\=active\\]\\:rf-bg-white[data-state=active]{--tw-bg-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity,1))}.data-\\[state\\=checked\\]\\:rf-bg-zinc-900[data-state=checked]{--tw-bg-opacity:1;background-color:rgb(24 24 27/var(--tw-bg-opacity,1))}.data-\\[state\\=open\\]\\:rf-bg-zinc-100[data-state=open]{--tw-bg-opacity:1;background-color:rgb(244 244 245/var(--tw-bg-opacity,1))}.data-\\[selected\\=true\\]\\:rf-text-zinc-900[data-selected=true]{--tw-text-opacity:1;color:rgb(24 24 27/var(--tw-text-opacity,1))}.data-\\[state\\=active\\]\\:rf-text-zinc-950[data-state=active]{--tw-text-opacity:1;color:rgb(9 9 11/var(--tw-text-opacity,1))}.data-\\[state\\=checked\\]\\:rf-text-zinc-50[data-state=checked]{--tw-text-opacity:1;color:rgb(250 250 250/var(--tw-text-opacity,1))}.data-\\[disabled\\=true\\]\\:rf-opacity-50[data-disabled=true],.data-\\[disabled\\]\\:rf-opacity-50[data-disabled]{opacity:.5}.data-\\[state\\=active\\]\\:rf-shadow[data-state=active]{--tw-shadow:0 1px 3px 0 rgba(0,0,0,.1),0 1px 2px -1px rgba(0,0,0,.1);--tw-shadow-colored:0 1px 3px 0 var(--tw-shadow-color),0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.data-\\[state\\=open\\]\\:rf-animate-in[data-state=open]{animation-duration:.15s;animation-name:enter;--tw-enter-opacity:initial;--tw-enter-scale:initial;--tw-enter-rotate:initial;--tw-enter-translate-x:initial;--tw-enter-translate-y:initial}.data-\\[state\\=closed\\]\\:rf-animate-out[data-state=closed]{animation-duration:.15s;animation-name:exit;--tw-exit-opacity:initial;--tw-exit-scale:initial;--tw-exit-rotate:initial;--tw-exit-translate-x:initial;--tw-exit-translate-y:initial}.data-\\[state\\=closed\\]\\:rf-fade-out-0[data-state=closed]{--tw-exit-opacity:0}.data-\\[state\\=open\\]\\:rf-fade-in-0[data-state=open]{--tw-enter-opacity:0}.data-\\[state\\=closed\\]\\:rf-zoom-out-95[data-state=closed]{--tw-exit-scale:.95}.data-\\[state\\=open\\]\\:rf-zoom-in-95[data-state=open]{--tw-enter-scale:.95}.data-\\[side\\=bottom\\]\\:rf-slide-in-from-top-2[data-side=bottom]{--tw-enter-translate-y:-0.5rem}.data-\\[side\\=left\\]\\:rf-slide-in-from-right-2[data-side=left]{--tw-enter-translate-x:0.5rem}.data-\\[side\\=right\\]\\:rf-slide-in-from-left-2[data-side=right]{--tw-enter-translate-x:-0.5rem}.data-\\[side\\=top\\]\\:rf-slide-in-from-bottom-2[data-side=top]{--tw-enter-translate-y:0.5rem}.data-\\[state\\=closed\\]\\:rf-slide-out-to-left-1\\/2[data-state=closed]{--tw-exit-translate-x:-50%}.data-\\[state\\=closed\\]\\:rf-slide-out-to-top-\\[48\\%\\][data-state=closed]{--tw-exit-translate-y:-48%}.data-\\[state\\=open\\]\\:rf-slide-in-from-left-1\\/2[data-state=open]{--tw-enter-translate-x:-50%}.data-\\[state\\=open\\]\\:rf-slide-in-from-top-\\[48\\%\\][data-state=open]{--tw-enter-translate-y:-48%}.dark\\:rf-border-zinc-50:is(.rf-dark *){--tw-border-opacity:1;border-color:rgb(250 250 250/var(--tw-border-opacity,1))}.dark\\:rf-border-zinc-800:is(.rf-dark *){--tw-border-opacity:1;border-color:rgb(39 39 42/var(--tw-border-opacity,1))}.dark\\:rf-bg-red-900:is(.rf-dark *){--tw-bg-opacity:1;background-color:rgb(127 29 29/var(--tw-bg-opacity,1))}.dark\\:rf-bg-zinc-50:is(.rf-dark *){--tw-bg-opacity:1;background-color:rgb(250 250 250/var(--tw-bg-opacity,1))}.dark\\:rf-bg-zinc-800:is(.rf-dark *){--tw-bg-opacity:1;background-color:rgb(39 39 42/var(--tw-bg-opacity,1))}.dark\\:rf-bg-zinc-950:is(.rf-dark *){--tw-bg-opacity:1;background-color:rgb(9 9 11/var(--tw-bg-opacity,1))}.dark\\:rf-text-zinc-400:is(.rf-dark *){--tw-text-opacity:1;color:rgb(161 161 170/var(--tw-text-opacity,1))}.dark\\:rf-text-zinc-50:is(.rf-dark *){--tw-text-opacity:1;color:rgb(250 250 250/var(--tw-text-opacity,1))}.dark\\:rf-text-zinc-900:is(.rf-dark *){--tw-text-opacity:1;color:rgb(24 24 27/var(--tw-text-opacity,1))}.dark\\:rf-placeholder-zinc-400:is(.rf-dark *)::-moz-placeholder{--tw-placeholder-opacity:1;color:rgb(161 161 170/var(--tw-placeholder-opacity,1))}.dark\\:rf-placeholder-zinc-400:is(.rf-dark *)::placeholder{--tw-placeholder-opacity:1;color:rgb(161 161 170/var(--tw-placeholder-opacity,1))}.dark\\:rf-ring-offset-zinc-950:is(.rf-dark *){--tw-ring-offset-color:#09090b}.dark\\:placeholder\\:rf-text-zinc-400:is(.rf-dark *)::-moz-placeholder{--tw-text-opacity:1;color:rgb(161 161 170/var(--tw-text-opacity,1))}.dark\\:placeholder\\:rf-text-zinc-400:is(.rf-dark *)::placeholder{--tw-text-opacity:1;color:rgb(161 161 170/var(--tw-text-opacity,1))}.dark\\:hover\\:rf-bg-red-900\\/90:hover:is(.rf-dark *){background-color:rgba(127,29,29,.9)}.dark\\:hover\\:rf-bg-zinc-50\\/90:hover:is(.rf-dark *){background-color:hsla(0,0%,98%,.9)}.dark\\:hover\\:rf-bg-zinc-800:hover:is(.rf-dark *){--tw-bg-opacity:1;background-color:rgb(39 39 42/var(--tw-bg-opacity,1))}.dark\\:hover\\:rf-bg-zinc-800\\/80:hover:is(.rf-dark *){background-color:rgba(39,39,42,.8)}.dark\\:hover\\:rf-text-zinc-50:hover:is(.rf-dark *){--tw-text-opacity:1;color:rgb(250 250 250/var(--tw-text-opacity,1))}.dark\\:focus\\:rf-bg-zinc-800:focus:is(.rf-dark *){--tw-bg-opacity:1;background-color:rgb(39 39 42/var(--tw-bg-opacity,1))}.dark\\:focus\\:rf-text-zinc-50:focus:is(.rf-dark *){--tw-text-opacity:1;color:rgb(250 250 250/var(--tw-text-opacity,1))}.dark\\:focus-visible\\:rf-ring-zinc-300:focus-visible:is(.rf-dark *){--tw-ring-opacity:1;--tw-ring-color:rgb(212 212 216/var(--tw-ring-opacity,1))}.dark\\:data-\\[selected\\=true\\]\\:rf-bg-zinc-800[data-selected=true]:is(.rf-dark *){--tw-bg-opacity:1;background-color:rgb(39 39 42/var(--tw-bg-opacity,1))}.dark\\:data-\\[state\\=active\\]\\:rf-bg-zinc-950[data-state=active]:is(.rf-dark *){--tw-bg-opacity:1;background-color:rgb(9 9 11/var(--tw-bg-opacity,1))}.dark\\:data-\\[state\\=checked\\]\\:rf-bg-zinc-50[data-state=checked]:is(.rf-dark *){--tw-bg-opacity:1;background-color:rgb(250 250 250/var(--tw-bg-opacity,1))}.dark\\:data-\\[state\\=open\\]\\:rf-bg-zinc-800[data-state=open]:is(.rf-dark *){--tw-bg-opacity:1;background-color:rgb(39 39 42/var(--tw-bg-opacity,1))}.dark\\:data-\\[selected\\=true\\]\\:rf-text-zinc-50[data-selected=true]:is(.rf-dark *){--tw-text-opacity:1;color:rgb(250 250 250/var(--tw-text-opacity,1))}.dark\\:data-\\[state\\=active\\]\\:rf-text-zinc-50[data-state=active]:is(.rf-dark *){--tw-text-opacity:1;color:rgb(250 250 250/var(--tw-text-opacity,1))}.dark\\:data-\\[state\\=checked\\]\\:rf-text-zinc-900[data-state=checked]:is(.rf-dark *){--tw-text-opacity:1;color:rgb(24 24 27/var(--tw-text-opacity,1))}@media (min-width:640px){.sm\\:rf-order-1{order:1}.sm\\:rf-order-2{order:2}.sm\\:rf-mt-0{margin-top:0}.sm\\:rf-inline{display:inline}.sm\\:rf-hidden{display:none}.sm\\:rf-w-auto{width:auto}.sm\\:rf-flex-row{flex-direction:row}.sm\\:rf-items-center{align-items:center}.sm\\:rf-justify-end{justify-content:flex-end}.sm\\:rf-gap-3{gap:.75rem}.sm\\:rf-space-x-2>:not([hidden])~:not([hidden]){--tw-space-x-reverse:0;margin-left:calc(.5rem*(1 - var(--tw-space-x-reverse)));margin-right:calc(.5rem*var(--tw-space-x-reverse))}.sm\\:rf-rounded-lg{border-radius:var(--radius)}.sm\\:rf-px-4{padding-left:1rem;padding-right:1rem}.sm\\:rf-text-left{text-align:left}.sm\\:rf-text-sm{font-size:.875rem;line-height:1.25rem}.sm\\:rf-text-xl{font-size:1.25rem;line-height:1.75rem}}@media (min-width:768px){.md\\:rf-grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}}.\\[\\&\\>span\\]\\:rf-line-clamp-1>span{display:-webkit-box;overflow:hidden;-webkit-box-orient:vertical;-webkit-line-clamp:1}.\\[\\&\\>svg\\]\\:rf-size-4>svg{height:1rem;width:1rem}.\\[\\&\\>svg\\]\\:rf-shrink-0>svg{flex-shrink:0}.\\[\\&\\>svg\\]\\:rf-text-red-300>svg{--tw-text-opacity:1;color:rgb(252 165 165/var(--tw-text-opacity,1))}.\\[\\&\\>svg\\]\\:hover\\:rf-text-red-400:hover>svg{--tw-text-opacity:1;color:rgb(248 113 113/var(--tw-text-opacity,1))}.\\[\\&_\\[cmdk-group-heading\\]\\]\\:rf-px-2 [cmdk-group-heading]{padding-left:.5rem;padding-right:.5rem}.\\[\\&_\\[cmdk-group-heading\\]\\]\\:rf-py-1\\.5 [cmdk-group-heading]{padding-bottom:.375rem;padding-top:.375rem}.\\[\\&_\\[cmdk-group-heading\\]\\]\\:rf-text-xs [cmdk-group-heading]{font-size:.75rem;line-height:1rem}.\\[\\&_\\[cmdk-group-heading\\]\\]\\:rf-font-medium [cmdk-group-heading]{font-weight:500}.\\[\\&_\\[cmdk-group-heading\\]\\]\\:rf-text-zinc-500 [cmdk-group-heading]{--tw-text-opacity:1;color:rgb(113 113 122/var(--tw-text-opacity,1))}.dark\\:\\[\\&_\\[cmdk-group-heading\\]\\]\\:rf-text-zinc-400 [cmdk-group-heading]:is(.rf-dark *){--tw-text-opacity:1;color:rgb(161 161 170/var(--tw-text-opacity,1))}.\\[\\&_\\[cmdk-group\\]\\:not\\(\\[hidden\\]\\)_\\~\\[cmdk-group\\]\\]\\:rf-pt-0 [cmdk-group]:not([hidden])~[cmdk-group]{padding-top:0}.\\[\\&_\\[cmdk-group\\]\\]\\:rf-px-2 [cmdk-group]{padding-left:.5rem;padding-right:.5rem}.\\[\\&_\\[cmdk-input-wrapper\\]_svg\\]\\:rf-h-5 [cmdk-input-wrapper] svg{height:1.25rem}.\\[\\&_\\[cmdk-input-wrapper\\]_svg\\]\\:rf-w-5 [cmdk-input-wrapper] svg{width:1.25rem}.\\[\\&_\\[cmdk-input\\]\\]\\:rf-h-12 [cmdk-input]{height:3rem}.\\[\\&_\\[cmdk-item\\]\\]\\:rf-px-2 [cmdk-item]{padding-left:.5rem;padding-right:.5rem}.\\[\\&_\\[cmdk-item\\]\\]\\:rf-py-3 [cmdk-item]{padding-bottom:.75rem;padding-top:.75rem}.\\[\\&_\\[cmdk-item\\]_svg\\]\\:rf-h-5 [cmdk-item] svg{height:1.25rem}.\\[\\&_\\[cmdk-item\\]_svg\\]\\:rf-w-5 [cmdk-item] svg{width:1.25rem}.\\[\\&_svg\\]\\:rf-pointer-events-none svg{pointer-events:none}.\\[\\&_svg\\]\\:rf-size-4 svg{height:1rem;width:1rem}.\\[\\&_svg\\]\\:rf-shrink-0 svg{flex-shrink:0}',MPn=()=>{Nt.useEffect(()=>{if(document.querySelector('style[data-styles="tscircuit-runframe"]'))return;const e=document.createElement("style");e.setAttribute("data-styles","tscircuit-runframe"),e.textContent=QPn,document.head.appendChild(e)},[])},RPn=i=>{Nt.useEffect(()=>(i?document.body.style.overflow="hidden":document.body.style.overflow="",()=>{document.body.style.overflow=""}),[i])},zut=i=>`hsl(${y2.indexOf(i)*137.5%360}, 70%, 50%)`,DPn=({phaseTimings:i})=>{if(!i)return null;const e=Object.values(i).reduce((t,n)=>t+n,0);return Ct.jsxs("div",{className:"rf-space-y-2 rf-w-full rf-px-4",children:[Ct.jsx("div",{className:"rf-relative rf-h-8 rf-flex rf-rounded-sm",children:y2.map(t=>{const n=i[t]||0,r=n/e*100;return Ct.jsx("div",{className:"rf-group/bar rf-relative rf-overflow-visible",style:{width:`${r}%`,backgroundColor:zut(t)},children:Ct.jsxs("div",{className:"rf-opacity-0 group-hover/bar:rf-opacity-100 rf-transition-opacity rf-absolute rf-bottom-full rf-left-1/2 rf-transform -rf-translate-x-1/2 rf-mb-2 rf-px-2 rf-py-1 rf-text-xs rf-whitespace-nowrap rf-rounded rf-bg-gray-900 rf-text-white rf-pointer-events-none",children:[t,": ",n.toFixed(1),"ms"]})},t)})}),Ct.jsxs("div",{className:"rf-text-xs rf-text-gray-500",children:["Total: ",e.toFixed(2),"ms"]})]})},NPn=({renderLog:i})=>{const[e,t]=Nt.useState("chronological");if(!i)return Ct.jsx("div",{className:"rf-p-4 rf-bg-gray-100 rf-rounded-md",children:"No render log, make sure this tab is open when you render (TODO add a rerender button here)"});const n=Object.entries((i==null?void 0:i.phaseTimings)??{});e==="chronological"?n.sort((o,a)=>y2.indexOf(o[0])-y2.indexOf(a[0])):n.sort((o,a)=>a[1]-o[1]);const r=n.reduce((o,[a,s])=>o+s,0);return Ct.jsxs("div",{className:"rf-bg-white",children:[Ct.jsxs("div",{className:"rf-flex rf-justify-between rf-items-center",children:[Ct.jsx("div",{children:"Render Logs"}),Ct.jsxs("div",{className:"rf-mb-4 rf-pr-2 rf-flex rf-text-xs rf-items-center",children:[Ct.jsx("div",{className:"rf-mr-2",children:"Sort by:"}),Ct.jsxs("select",{value:e,onChange:o=>t(o.target.value),className:"rf-px-2 rf-py-1 rf-border rf-rounded rf-text-xs",children:[Ct.jsx("option",{value:"chronological",children:"Phase Order"}),Ct.jsx("option",{value:"longest",children:"Duration"})]})]})]}),Ct.jsx(DPn,{phaseTimings:i.phaseTimings}),Ct.jsxs("table",{className:"rf-w-full rf-text-xs",children:[Ct.jsx("thead",{children:Ct.jsxs("tr",{children:[Ct.jsx("th",{className:"rf-text-left rf-p-2",children:"Phase Order"}),Ct.jsx("th",{className:"rf-text-left rf-p-2",children:"Phase"}),Ct.jsx("th",{className:"rf-text-left rf-p-2",children:"Duration (ms)"})]})}),Ct.jsx("tbody",{children:n.map(([o,a])=>Ct.jsxs("tr",{children:[Ct.jsx("td",{className:"rf-p-2",children:y2.indexOf(o)}),Ct.jsx("td",{className:"rf-p-2",children:o}),Ct.jsx("td",{className:"rf-p-2",children:Ct.jsx("div",{className:"rf-w-8",children:Ct.jsx("div",{className:"rf-h-2 rf-rounded-sm",style:{backgroundColor:zut(o),width:`${a/r*100}%`}})})}),Ct.jsx("td",{className:"rf-p-2",children:Ct.jsxs("div",{className:"rf-flex w-full",children:[Ct.jsxs("span",{className:"rf-flex-grow",children:[a,"ms"]}),Ct.jsxs("span",{className:"rf-text-gray-500 rf-pr-2",children:[(a/r*100).toFixed(1),"%"]})]})})]},o))})]})]})},TPn=({errorMessage:i,errorStack:e,circuitJsonErrors:t})=>{Nt.useEffect(()=>{if(i){const n=new Error(i);e&&(n.stack=e);try{GU.captureException(n)}catch{}}},[i,e]),Nt.useEffect(()=>{if(t&&t.length>0)for(const n of t){const r=new Error(n.message||"Circuit JSON Error");n.stack&&(r.stack=n.stack);try{GU.captureException(r,{error_type:n.type})}catch{}}},[t])},kPn="0.0.767";function PPn(i,e){const[t,n]=Nt.useState(()=>{try{const r=window.localStorage.getItem(i);return r?JSON.parse(r):e}catch(r){return console.error("Error reading from localStorage:",r),e}});return Nt.useEffect(()=>{try{window.localStorage.setItem(i,JSON.stringify(t))}catch(r){console.error("Error writing to localStorage:",r)}},[i,t]),[t,n]}const _Ce={BASE_URL:"/",DEV:!1,MODE:"production",PROD:!0,SSR:!1},vCe=new Map,Hq=i=>{const e=vCe.get(i);return e?Object.fromEntries(Object.entries(e.stores).map(([t,n])=>[t,n.getState()])):{}},UPn=(i,e,t)=>{if(i===void 0)return{type:"untracked",connection:e.connect(t)};const n=vCe.get(t.name);if(n)return{type:"tracked",store:i,...n};const r={connection:e.connect(t),stores:{}};return vCe.set(t.name,r),{type:"tracked",store:i,...r}},LPn=(i,e={})=>(t,n,r)=>{const{enabled:o,anonymousActionType:a,store:s,...l}=e;let c;try{c=(o??(_Ce?"production":void 0)!=="production")&&window.__REDUX_DEVTOOLS_EXTENSION__}catch{}if(!c)return(_Ce?"production":void 0)!=="production"&&o&&console.warn("[zustand devtools middleware] Please install/enable Redux devtools extension"),i(t,n,r);const{connection:u,...A}=UPn(s,c,l);let d=!0;r.setState=(y,_,v)=>{const E=t(y,_);if(!d)return E;const b=v===void 0?{type:a||"anonymous"}:typeof v=="string"?{type:v}:v;return s===void 0?(u==null||u.send(b,n()),E):(u==null||u.send({...b,type:`${s}/${b.type}`},{...Hq(l.name),[s]:r.getState()}),E)};const f=(...y)=>{const _=d;d=!1,t(...y),d=_},h=i(r.setState,n,r);if(A.type==="untracked"?u==null||u.init(h):(A.stores[A.store]=r,u==null||u.init(Object.fromEntries(Object.entries(A.stores).map(([y,_])=>[y,y===A.store?h:_.getState()])))),r.dispatchFromDevtools&&typeof r.dispatch=="function"){let y=!1;const _=r.dispatch;r.dispatch=(...v)=>{(_Ce?"production":void 0)!=="production"&&v[0].type==="__setState"&&!y&&(console.warn('[zustand devtools middleware] "__setState" action type is reserved to set state from the devtools. Avoid using it.'),y=!0),_(...v)}}return u.subscribe(y=>{var _;switch(y.type){case"ACTION":if(typeof y.payload!="string"){console.error("[zustand devtools middleware] Unsupported action format");return}return ICe(y.payload,v=>{if(v.type==="__setState"){if(s===void 0){f(v.state);return}Object.keys(v.state).length!==1&&console.error(`
14071
14071
  [zustand devtools middleware] Unsupported __setState action format.
14072
14072
  When using 'store' option in devtools(), the 'state' should have only one key, which is a value of 'store' that was passed in devtools(),
14073
14073
  and value of this only key should be a state object. Example: { "type": "__setState", "state": { "abc123Store": { "foo": "bar" } } }