@tscircuit/runframe 0.0.2855 → 0.0.2857

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.
@@ -236,9 +236,9 @@ Learn more: https://react.dev/warnings/version-mismatch`))})(),typeof Map=="func
236
236
  You might need to use a local HTTP server (instead of file://): https://react.dev/link/react-devtools-faq`:""),"font-weight:bold")}TK.createRoot=function(b,v){if(!_(b))throw Error("Target container is not a DOM element.");gp(b);var L=!1,j="",ae=f4,fe=z0,ze=bm,At=null;return v!=null&&(v.hydrate?console.warn("hydrate through createRoot is deprecated. Use ReactDOMClient.hydrateRoot(container, <App />) instead."):typeof v=="object"&&v!==null&&v.$$typeof===Vd&&console.error(`You passed a JSX element to createRoot. You probably meant to call root.render instead. Example usage:
237
237
 
238
238
  let root = createRoot(domContainer);
239
- root.render(<App />);`),v.unstable_strictMode===!0&&(L=!0),v.identifierPrefix!==void 0&&(j=v.identifierPrefix),v.onUncaughtError!==void 0&&(ae=v.onUncaughtError),v.onCaughtError!==void 0&&(fe=v.onCaughtError),v.onRecoverableError!==void 0&&(ze=v.onRecoverableError),v.unstable_transitionCallbacks!==void 0&&(At=v.unstable_transitionCallbacks)),v=Tt(b,1,!1,null,null,L,j,ae,fe,ze,At,null),b[X0]=v.current,XE(b),new F1(v)},TK.hydrateRoot=function(b,v,L){if(!_(b))throw Error("Target container is not a DOM element.");gp(b),v===void 0&&console.error("Must provide initial children as second argument to hydrateRoot. Example usage: hydrateRoot(domContainer, <App />)");var j=!1,ae="",fe=f4,ze=z0,At=bm,Mt=null,Vt=null;return L!=null&&(L.unstable_strictMode===!0&&(j=!0),L.identifierPrefix!==void 0&&(ae=L.identifierPrefix),L.onUncaughtError!==void 0&&(fe=L.onUncaughtError),L.onCaughtError!==void 0&&(ze=L.onCaughtError),L.onRecoverableError!==void 0&&(At=L.onRecoverableError),L.unstable_transitionCallbacks!==void 0&&(Mt=L.unstable_transitionCallbacks),L.formState!==void 0&&(Vt=L.formState)),v=Tt(b,1,!0,v,L??null,j,ae,fe,ze,At,Mt,Vt),v.context=ln(null),L=v.current,j=Gd(L),j=ct(j),ae=tp(j),ae.callback=null,y0(L,ae,j),L=j,v.current.lanes=L,Le(v,L),Cu(v),b[X0]=v.current,XE(b),new w_(v)},TK.version="19.1.0",typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})(),TK}var bot;function AEn(){if(bot)return Ete.exports;bot=1;var t={env:{}};function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function")){if(t.env.NODE_ENV!=="production")throw new Error("^_^");try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(n){console.error(n)}}}return t.env.NODE_ENV==="production"?(e(),Ete.exports=sEn()):Ete.exports=aEn(),Ete.exports}var cEn=AEn(),te=Q3();const ks=uy(te),u5=tx({__proto__:null,default:ks},[te]);var lEn=Object.defineProperty,_k=(t,e)=>lEn(t,"name",{value:e,configurable:!0}),Sot=!!(typeof window<"u"&&window.document&&window.document.createElement);function _r(t,e,{checkForDefaultPrevented:n=!0}={}){return _k(function(i){if(t?.(i),n===!1||!i||!i.defaultPrevented)return e?.(i)},"handleEvent")}_k(_r,"composeEventHandlers");function gEn(t){if(!Sot)throw new Error("Cannot access window outside of the DOM");return t?.ownerDocument?.defaultView??window}_k(gEn,"getOwnerWindow");function iye(t){if(!Sot)throw new Error("Cannot access document outside of the DOM");return t?.ownerDocument??document}_k(iye,"getOwnerDocument");function Qot(t,e=!1){const{activeElement:n}=iye(t);if(!n?.nodeName)return null;if(vot(n)&&n.contentDocument)return Qot(n.contentDocument.body,e);if(e){const o=n.getAttribute("aria-activedescendant");if(o){const i=iye(n).getElementById(o);if(i)return i}}return n}_k(Qot,"getActiveElement");function vot(t){return t.tagName==="IFRAME"}_k(vot,"isFrame");var uEn=Object.defineProperty,d5=(t,e)=>uEn(t,"name",{value:e,configurable:!0});function dEn(t,e){const n=te.createContext(e);n.displayName=t+"Context";const o=d5(r=>{const{children:s,...a}=r,A=te.useMemo(()=>a,Object.values(a));return V.jsx(n.Provider,{value:A,children:s})},"Provider");o.displayName=t+"Provider";function i(r,s={}){const{optional:a=!1}=s,A=te.useContext(n);if(A)return A;if(e!==void 0)return e;if(!a)throw new Error(`\`${r}\` must be used within \`${t}\``)}return d5(i,"useContext"),[o,i]}d5(dEn,"createContext");function v3(t,e=[]){let n=[];function o(r,s){const a=te.createContext(s);a.displayName=r+"Context";const A=n.length;n=[...n,s];const c=d5(g=>{const{scope:u,children:h,...d}=g,p=u?.[t]?.[A]||a,m=te.useMemo(()=>d,Object.values(d));return V.jsx(p.Provider,{value:m,children:h})},"Provider");c.displayName=r+"Provider";function l(g,u,h={}){const{optional:d=!1}=h,p=u?.[t]?.[A]||a,m=te.useContext(p);if(m)return m;if(s!==void 0)return s;if(!d)throw new Error(`\`${g}\` must be used within \`${r}\``)}return d5(l,"useContext"),[c,l]}d5(o,"createContext");const i=d5(()=>{const r=n.map(s=>te.createContext(s));return d5(function(a){const A=a?.[t]||r;return te.useMemo(()=>({[`__scope${t}`]:{...a,[t]:A}}),[a,A])},"useScope")},"createScope");return i.scopeName=t,[o,wot(i,...e)]}d5(v3,"createContextScope");function wot(...t){const e=t[0];if(t.length===1)return e;const n=d5(()=>{const o=t.map(i=>({useScope:i(),scopeName:i.scopeName}));return d5(function(r){const s=o.reduce((a,{useScope:A,scopeName:c})=>{const g=A(r)[`__scope${c}`];return{...a,...g}},{});return te.useMemo(()=>({[`__scope${e.scopeName}`]:s}),[s])},"useComposedScopes")},"createScope");return n.scopeName=e.scopeName,n}d5(wot,"composeContextScopes");var hEn=Object.defineProperty,rye=(t,e)=>hEn(t,"name",{value:e,configurable:!0});function sye(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}rye(sye,"setRef");function Pot(...t){return e=>{let n=!1;const o=t.map(i=>{const r=sye(i,e);return!n&&typeof r=="function"&&(n=!0),r});if(n)return()=>{for(let i=0;i<o.length;i++){const r=o[i];typeof r=="function"?r():sye(t[i],null)}}}}rye(Pot,"composeRefs");function lc(...t){return te.useCallback(Pot(...t),t)}rye(lc,"useComposedRefs");var pEn=Object.defineProperty,D4=(t,e)=>pEn(t,"name",{value:e,configurable:!0});function I9(t){const e=te.forwardRef((n,o)=>{let{children:i,...r}=n,s=null,a=!1;const A=[];aye(i)&&typeof Qte=="function"&&(i=Qte(i._payload)),te.Children.forEach(i,u=>{if(Tot(u)){a=!0;const h=u;let d="child"in h.props?h.props.child:h.props.children;aye(d)&&typeof Qte=="function"&&(d=Qte(d._payload)),s=_En(h,d),A.push(s?.props?.children)}else A.push(u)}),s?s=te.cloneElement(s,void 0,A):!a&&te.Children.count(i)===1&&te.isValidElement(i)&&(s=i);const c=s?Rot(s):void 0,l=lc(o,c);if(!s){if(i||i===0)throw new Error(a?CEn(t):IEn(t));return i}const g=Not(r,s.props??{});return s.type!==te.Fragment&&(g.ref=o?l:c),te.cloneElement(s,g)});return e.displayName=`${t}.Slot`,e}D4(I9,"createSlot");var mEn=I9("Slot"),Mot=Symbol.for("radix.slottable");function Dot(t){const e=D4(n=>"child"in n?n.children(n.child):n.children,"Slottable");return e.displayName=`${t}.Slottable`,e.__radixId=Mot,e}D4(Dot,"createSlottable");var _En=D4((t,e)=>{if("child"in t.props){const n=t.props.child;return te.isValidElement(n)?te.cloneElement(n,void 0,t.props.children(n.props.children)):null}return te.isValidElement(e)?e:null},"getSlottableElementFromSlottable");function Not(t,e){const n={...e};for(const o in e){const i=t[o],r=e[o];/^on[A-Z]/.test(o)?i&&r?n[o]=(...a)=>{const A=r(...a);return i(...a),A}:i&&(n[o]=i):o==="style"?n[o]={...i,...r}:o==="className"&&(n[o]=[i,r].filter(Boolean).join(" "))}return{...t,...n}}D4(Not,"mergeProps");function Rot(t){let e=Object.getOwnPropertyDescriptor(t.props,"ref")?.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=Object.getOwnPropertyDescriptor(t,"ref")?.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}D4(Rot,"getElementRef");function Tot(t){return te.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===Mot}D4(Tot,"isSlottable");var fEn=Symbol.for("react.lazy");function aye(t){return t!=null&&typeof t=="object"&&"$$typeof"in t&&t.$$typeof===fEn&&"_payload"in t&&kot(t._payload)}D4(aye,"isLazyComponent");function kot(t){return typeof t=="object"&&t!==null&&"then"in t}D4(kot,"isPromiseLike");var IEn=D4(t=>`${t} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,"createSlotError"),CEn=D4(t=>`${t} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,"createSlottableError"),Qte=u5[" use ".trim().toString()],yEn=Object.defineProperty,Uf=(t,e)=>yEn(t,"name",{value:e,configurable:!0});function vte(t){const e=t+"CollectionProvider",[n,o]=v3(e),[i,r]=n(e,{collectionRef:{current:null},itemMap:new Map}),s=Uf(p=>{const{scope:m,children:_}=p,f=te.useRef(null),I=te.useRef(new Map).current;return V.jsx(i,{scope:m,itemMap:I,collectionRef:f,children:_})},"CollectionProvider");s.displayName=e;const a=t+"CollectionSlot",A=I9(a),c=te.forwardRef((p,m)=>{const{scope:_,children:f}=p,I=r(a,_),C=lc(m,I.collectionRef);return V.jsx(A,{ref:C,children:f})});c.displayName=a;const l=t+"CollectionItemSlot",g="data-radix-collection-item",u=I9(l),h=te.forwardRef((p,m)=>{const{scope:_,children:f,...I}=p,C=te.useRef(null),y=lc(m,C),x=r(l,_);return te.useEffect(()=>(x.itemMap.set(C,{ref:C,...I}),()=>{x.itemMap.delete(C)})),V.jsx(u,{[g]:"",ref:y,children:f})});h.displayName=l;function d(p){const m=r(t+"CollectionConsumer",p);return te.useCallback(()=>{const f=m.collectionRef.current;if(!f)return[];const I=Array.from(f.querySelectorAll(`[${g}]`));return Array.from(m.itemMap.values()).sort((x,E)=>I.indexOf(x.ref.current)-I.indexOf(E.ref.current))},[m.collectionRef,m.itemMap])}return Uf(d,"useCollection"),[{Provider:s,Slot:c,ItemSlot:h},d,o]}Uf(vte,"createCollection");var Fot=new WeakMap,Aye=(wE=class extends Map{constructor(n){super(n);Vnt(this,u_);ste(this,u_,[...super.keys()]),Fot.set(this,!0)}set(n,o){return Fot.get(this)&&(this.has(n)?w0(this,u_)[w0(this,u_).indexOf(n)]=n:w0(this,u_).push(n)),super.set(n,o),this}insert(n,o,i){const r=this.has(o),s=w0(this,u_).length,a=cye(n);let A=a>=0?a:s+a;const c=A<0||A>=s?-1:A;if(c===this.size||r&&c===this.size-1||c===-1)return this.set(o,i),this;const l=this.size+(r?0:1);a<0&&A++;const g=[...w0(this,u_)];let u,h=!1;for(let d=A;d<l;d++)if(A===d){let p=g[d];g[d]===o&&(p=g[d+1]),r&&this.delete(o),u=this.get(p),this.set(o,i)}else{!h&&g[d-1]===o&&(h=!0);const p=g[h?d:d-1],m=u;u=this.get(p),this.delete(p),this.set(p,m)}return this}with(n,o,i){const r=new wE(this);return r.insert(n,o,i),r}before(n){const o=w0(this,u_).indexOf(n)-1;if(!(o<0))return this.entryAt(o)}setBefore(n,o,i){const r=w0(this,u_).indexOf(n);return r===-1?this:this.insert(r,o,i)}after(n){let o=w0(this,u_).indexOf(n);if(o=o===-1||o===this.size-1?-1:o+1,o!==-1)return this.entryAt(o)}setAfter(n,o,i){const r=w0(this,u_).indexOf(n);return r===-1?this:this.insert(r+1,o,i)}first(){return this.entryAt(0)}last(){return this.entryAt(-1)}clear(){return ste(this,u_,[]),super.clear()}delete(n){const o=super.delete(n);return o&&w0(this,u_).splice(w0(this,u_).indexOf(n),1),o}deleteAt(n){const o=this.keyAt(n);return o!==void 0?this.delete(o):!1}at(n){const o=wte(w0(this,u_),n);if(o!==void 0)return this.get(o)}entryAt(n){const o=wte(w0(this,u_),n);if(o!==void 0)return[o,this.get(o)]}indexOf(n){return w0(this,u_).indexOf(n)}keyAt(n){return wte(w0(this,u_),n)}from(n,o){const i=this.indexOf(n);if(i===-1)return;let r=i+o;return r<0&&(r=0),r>=this.size&&(r=this.size-1),this.at(r)}keyFrom(n,o){const i=this.indexOf(n);if(i===-1)return;let r=i+o;return r<0&&(r=0),r>=this.size&&(r=this.size-1),this.keyAt(r)}find(n,o){let i=0;for(const r of this){if(Reflect.apply(n,o,[r,i,this]))return r;i++}}findIndex(n,o){let i=0;for(const r of this){if(Reflect.apply(n,o,[r,i,this]))return i;i++}return-1}filter(n,o){const i=[];let r=0;for(const s of this)Reflect.apply(n,o,[s,r,this])&&i.push(s),r++;return new wE(i)}map(n,o){const i=[];let r=0;for(const s of this)i.push([s[0],Reflect.apply(n,o,[s,r,this])]),r++;return new wE(i)}reduce(...n){const[o,i]=n;let r=0,s=i??this.at(0);for(const a of this)r===0&&n.length===1?s=a:s=Reflect.apply(o,this,[s,a,r,this]),r++;return s}reduceRight(...n){const[o,i]=n;let r=i??this.at(-1);for(let s=this.size-1;s>=0;s--){const a=this.at(s);s===this.size-1&&n.length===1?r=a:r=Reflect.apply(o,this,[r,a,s,this])}return r}toSorted(n){const o=[...this.entries()].sort(n);return new wE(o)}toReversed(){const n=new wE;for(let o=this.size-1;o>=0;o--){const i=this.keyAt(o),r=this.get(i);n.set(i,r)}return n}toSpliced(...n){const o=[...this.entries()];return o.splice(...n),new wE(o)}slice(n,o){const i=new wE;let r=this.size-1;if(n===void 0)return i;n<0&&(n=n+this.size),o!==void 0&&o>0&&(r=o-1);for(let s=n;s<=r;s++){const a=this.keyAt(s),A=this.get(a);i.set(a,A)}return i}every(n,o){let i=0;for(const r of this){if(!Reflect.apply(n,o,[r,i,this]))return!1;i++}return!0}some(n,o){let i=0;for(const r of this){if(Reflect.apply(n,o,[r,i,this]))return!0;i++}return!1}},u_=new WeakMap,Uf(wE,"OrderedDict"),wE);function wte(t,e){if("at"in Array.prototype)return Array.prototype.at.call(t,e);const n=Lot(t,e);return n===-1?void 0:t[n]}Uf(wte,"at");function Lot(t,e){const n=t.length,o=cye(e),i=o>=0?o:n+o;return i<0||i>=n?-1:i}Uf(Lot,"toSafeIndex");function cye(t){return t!==t||t===0?0:Math.trunc(t)}Uf(cye,"toSafeInteger");function xEn(t){const e=t+"CollectionProvider",[n,o]=v3(e),[i,r]=n(e,{collectionElement:null,collectionRef:{current:null},collectionRefObject:{current:null},itemMap:new Aye,setItemMap:Uf(()=>{},"setItemMap")}),s=Uf(({state:I,...C})=>I?V.jsx(A,{...C,state:I}):V.jsx(a,{...C}),"CollectionProvider");s.displayName=e;const a=Uf(I=>{const C=m();return V.jsx(A,{...I,state:C})},"CollectionInit");a.displayName=e+"Init";const A=Uf(I=>{const{scope:C,children:y,state:x}=I,E=te.useRef(null),[B,S]=te.useState(null),Q=lc(E,S),[w,M]=x;return te.useEffect(()=>{if(!B)return;const k=Got(()=>{});return k.observe(B,{childList:!0,subtree:!0}),()=>{k.disconnect()}},[B]),V.jsx(i,{scope:C,itemMap:w,setItemMap:M,collectionRef:Q,collectionRefObject:E,collectionElement:B,children:y})},"CollectionProviderImpl");A.displayName=e+"Impl";const c=t+"CollectionSlot",l=I9(c),g=te.forwardRef((I,C)=>{const{scope:y,children:x}=I,E=r(c,y),B=lc(C,E.collectionRef);return V.jsx(l,{ref:B,children:x})});g.displayName=c;const u=t+"CollectionItemSlot",h="data-radix-collection-item",d=I9(u),p=te.forwardRef((I,C)=>{const{scope:y,children:x,...E}=I,B=te.useRef(null),[S,Q]=te.useState(null),w=lc(C,B,Q),M=r(u,y),{setItemMap:k}=M,R=te.useRef(E);Hot(R.current,E)||(R.current=E);const F=R.current;return te.useEffect(()=>{const O=F;return k(U=>S?U.has(S)?U.set(S,{...O,element:S}).toSorted(lye):(U.set(S,{...O,element:S}),U.toSorted(lye)):U),()=>{k(U=>!S||!U.has(S)?U:(U.delete(S),new Aye(U)))}},[S,F,k]),V.jsx(d,{[h]:"",ref:w,children:x})});p.displayName=u;function m(){return te.useState(new Aye)}Uf(m,"useInitCollection");function _(I){const{itemMap:C}=r(t+"CollectionConsumer",I);return C}return Uf(_,"useCollection"),[{Provider:s,Slot:g,ItemSlot:p},{createCollectionScope:o,useCollection:_,useInitCollection:m}]}Uf(xEn,"createCollection");function Hot(t,e){if(t===e)return!0;if(typeof t!="object"||typeof e!="object"||t==null||e==null)return!1;const n=Object.keys(t),o=Object.keys(e);if(n.length!==o.length)return!1;for(const i of n)if(!Object.prototype.hasOwnProperty.call(e,i)||t[i]!==e[i])return!1;return!0}Uf(Hot,"shallowEqual");function Oot(t,e){return!!(e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_PRECEDING)}Uf(Oot,"isElementPreceding");function lye(t,e){return!t[1].element||!e[1].element?0:Oot(t[1].element,e[1].element)?-1:1}Uf(lye,"sortByDocumentPosition");function Got(t){return new MutationObserver(n=>{for(const o of n)if(o.type==="childList"){t();return}})}Uf(Got,"getChildListObserver");var _p=globalThis?.document?te.useLayoutEffect:()=>{},EEn=Object.defineProperty,BEn=(t,e)=>EEn(t,"name",{value:e,configurable:!0}),bEn=u5[" useId ".trim().toString()]||(()=>{}),SEn=0;function w3(t){const[e,n]=te.useState(bEn());return _p(()=>{t||n(o=>o??String(SEn++))},[t]),t||(e?`radix-${e}`:"")}BEn(w3,"useId");var C9=oye();const Yot=uy(C9);var QEn=Object.defineProperty,vEn=(t,e)=>QEn(t,"name",{value:e,configurable:!0}),wEn=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],gc=wEn.reduce((t,e)=>{const n=I9(`Primitive.${e}`),o=te.forwardRef((i,r)=>{const{asChild:s,...a}=i,A=s?n:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),V.jsx(A,{...a,ref:r})});return o.displayName=`Primitive.${e}`,{...t,[e]:o}},{});function gye(t,e){t&&C9.flushSync(()=>t.dispatchEvent(e))}vEn(gye,"dispatchDiscreteCustomEvent");var PEn=Object.defineProperty,MEn=(t,e)=>PEn(t,"name",{value:e,configurable:!0});function P3(t){const e=te.useRef(t);return te.useEffect(()=>{e.current=t}),te.useMemo(()=>((...n)=>e.current?.(...n)),[])}MEn(P3,"useCallbackRef");var DEn=Object.defineProperty,NEn=(t,e)=>DEn(t,"name",{value:e,configurable:!0}),Uot=u5[" useEffectEvent ".trim().toString()],Kot=u5[" useInsertionEffect ".trim().toString()];function Vot(t){if(typeof Uot=="function")return Uot(t);const e=te.useRef(()=>{throw new Error("Cannot call an event handler while rendering.")});return typeof Kot=="function"?Kot(()=>{e.current=t}):_p(()=>{e.current=t}),te.useMemo(()=>((...n)=>e.current?.(...n)),[])}NEn(Vot,"useEffectEvent");var REn=Object.defineProperty,kK=(t,e)=>REn(t,"name",{value:e,configurable:!0}),TEn=u5[" useInsertionEffect ".trim().toString()]||_p;function y9({prop:t,defaultProp:e,onChange:n=kK(()=>{},"onChange"),caller:o}){const[i,r,s]=zot({defaultProp:e,onChange:n}),a=t!==void 0,A=a?t:i,c=te.useCallback(l=>{if(a){const g=Jot(l)?l(t):l;g!==t&&s.current?.(g)}else r(l)},[a,t,r,s]);return[A,c]}kK(y9,"useControllableState");function zot({defaultProp:t,onChange:e}){const[n,o]=te.useState(t),i=te.useRef(n),r=te.useRef(e);return TEn(()=>{r.current=e},[e]),te.useEffect(()=>{i.current!==n&&(r.current?.(n),i.current=n)},[n,i]),[n,o,r]}kK(zot,"useUncontrolledState");function Jot(t){return typeof t=="function"}kK(Jot,"isFunction");var Wot=Symbol("RADIX:SYNC_STATE");function kEn(t,e,n,o){const{prop:i,defaultProp:r,onChange:s,caller:a}=e,A=i!==void 0,c=Vot(s),l=[{...n,state:r}];o&&l.push(o);const[g,u]=te.useReducer((m,_)=>{if(_.type===Wot)return{...m,state:_.state};const f=t(m,_);return A&&!Object.is(f.state,m.state)&&c(f.state),f},...l),h=g.state,d=te.useRef(h);te.useEffect(()=>{d.current!==h&&(d.current=h,A||c(h))},[h,d,A]);const p=te.useMemo(()=>i!==void 0?{...g,state:i}:g,[g,i]);return te.useEffect(()=>{A&&!Object.is(i,g.state)&&u({type:Wot,state:i})},[i,g.state,A]),[p,u]}kK(kEn,"useControllableStateReducer");var FEn=Object.defineProperty,LEn=(t,e)=>FEn(t,"name",{value:e,configurable:!0}),HEn=te.createContext(void 0);function FK(t){const e=te.useContext(HEn);return t||e||"ltr"}LEn(FK,"useDirection");var OEn=Object.defineProperty,uye=(t,e)=>OEn(t,"name",{value:e,configurable:!0}),dye=!1;function jot(){const[t,e]=te.useState(dye);return te.useEffect(()=>{dye||(dye=!0,e(!0))},[]),t}uye(jot,"useIsHydrated");var qot=u5[" useSyncExternalStore ".trim().toString()];function Xot(){return()=>{}}uye(Xot,"subscribe");function $ot(){return qot(Xot,()=>!0,()=>!1)}uye($ot,"useIsHydratedModern");var GEn=typeof qot=="function"?$ot:jot,YEn=Object.defineProperty,vM=(t,e)=>YEn(t,"name",{value:e,configurable:!0}),hye="rovingFocusGroup.onEntryFocus",UEn={bubbles:!1,cancelable:!0},Pte="RovingFocusGroup",[pye,Zot,KEn]=vte(Pte),[VEn,Mte]=v3(Pte,[KEn]),[zEn,JEn]=VEn(Pte),WEn=te.forwardRef(vM(function(e,n){return V.jsx(pye.Provider,{scope:e.__scopeRovingFocusGroup,children:V.jsx(pye.Slot,{scope:e.__scopeRovingFocusGroup,children:V.jsx(jEn,{...e,ref:n})})})},"RovingFocusGroup")),jEn=te.forwardRef(vM(function(e,n){const{__scopeRovingFocusGroup:o,orientation:i,loop:r=!1,dir:s,currentTabStopId:a,defaultCurrentTabStopId:A,onCurrentTabStopIdChange:c,onEntryFocus:l,preventScrollOnEntryFocus:g=!1,...u}=e,h=te.useRef(null),d=lc(n,h),p=FK(s),[m,_]=y9({prop:a,defaultProp:A??null,onChange:c,caller:Pte}),[f,I]=te.useState(!1),C=P3(l),y=Zot(o),x=te.useRef(!1),[E,B]=te.useState(0);return te.useEffect(()=>{const S=h.current;if(S)return S.addEventListener(hye,C),()=>S.removeEventListener(hye,C)},[C]),V.jsx(zEn,{scope:o,orientation:i,dir:p,loop:r,currentTabStopId:m,onItemFocus:te.useCallback(S=>_(S),[_]),onItemShiftTab:te.useCallback(()=>I(!0),[]),onFocusableItemAdd:te.useCallback(()=>B(S=>S+1),[]),onFocusableItemRemove:te.useCallback(()=>B(S=>S-1),[]),children:V.jsx(gc.div,{tabIndex:f||E===0?-1:0,"data-orientation":i,...u,ref:d,style:{outline:"none",...e.style},onMouseDown:_r(e.onMouseDown,()=>{x.current=!0}),onFocus:_r(e.onFocus,S=>{const Q=!x.current;if(S.target===S.currentTarget&&Q&&!f){const w=new CustomEvent(hye,UEn);if(S.currentTarget.dispatchEvent(w),!w.defaultPrevented){const M=y().filter(U=>U.focusable),k=M.find(U=>U.active),R=M.find(U=>U.id===m),O=[k,R,...M].filter(Boolean).map(U=>U.ref.current);mye(O,g)}}x.current=!1}),onBlur:_r(e.onBlur,()=>I(!1))})})},"RovingFocusGroupImpl")),qEn="RovingFocusGroupItem",XEn=te.forwardRef(vM(function(e,n){const{__scopeRovingFocusGroup:o,focusable:i=!0,active:r=!1,tabStopId:s,children:a,...A}=e,c=w3(),l=s||c,g=JEn(qEn,o),u=g.currentTabStopId===l,h=Zot(o),{onFocusableItemAdd:d,onFocusableItemRemove:p,currentTabStopId:m}=g,_=GEn();return _p(()=>{if(!(!_||!i))return d(),()=>p()},[_,i,d,p]),te.useEffect(()=>{if(!(_||!i))return d(),()=>p()},[_,i,d,p]),V.jsx(pye.ItemSlot,{scope:o,id:l,focusable:i,active:r,children:V.jsx(gc.span,{tabIndex:u?0:-1,"data-orientation":g.orientation,...A,ref:n,onMouseDown:_r(e.onMouseDown,f=>{i?g.onItemFocus(l):f.preventDefault()}),onFocus:_r(e.onFocus,()=>g.onItemFocus(l)),onKeyDown:_r(e.onKeyDown,f=>{if(f.key==="Tab"&&f.shiftKey){g.onItemShiftTab();return}if(f.target!==f.currentTarget)return;const I=tit(f,g.orientation,g.dir);if(I!==void 0){if(f.metaKey||f.ctrlKey||f.altKey||f.shiftKey)return;f.preventDefault();let y=h().filter(x=>x.focusable).map(x=>x.ref.current);if(I==="last")y.reverse();else if(I==="prev"||I==="next"){I==="prev"&&y.reverse();const x=y.indexOf(f.currentTarget);y=g.loop?nit(y,x+1):y.slice(x+1)}setTimeout(()=>mye(y))}}),children:typeof a=="function"?a({isCurrentTabStop:u,hasTabStop:m!=null}):a})})},"RovingFocusGroupItem")),$En={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function eit(t,e){return e!=="rtl"?t:t==="ArrowLeft"?"ArrowRight":t==="ArrowRight"?"ArrowLeft":t}vM(eit,"getDirectionAwareKey");function tit(t,e,n){const o=eit(t.key,n);if(!(e==="vertical"&&["ArrowLeft","ArrowRight"].includes(o))&&!(e==="horizontal"&&["ArrowUp","ArrowDown"].includes(o)))return $En[o]}vM(tit,"getFocusIntent");function mye(t,e=!1){const n=document.activeElement;for(const o of t)if(o===n||(o.focus({preventScroll:e}),document.activeElement!==n))return}vM(mye,"focusFirst");function nit(t,e){return t.map((n,o)=>t[(e+o)%t.length])}vM(nit,"wrapArray");var oit=WEn,iit=XEn,ZEn=Object.defineProperty,m8=(t,e)=>ZEn(t,"name",{value:e,configurable:!0});function rit(t,e){return te.useReducer((n,o)=>e[n][o]??n,t)}m8(rit,"useStateMachine");var N4=m8(t=>{const{present:e,children:n}=t,o=sit(e),i=typeof n=="function"?n({present:o.isPresent}):te.Children.only(n),r=ait(o.ref,Ait(i));return typeof n=="function"||o.isPresent?te.cloneElement(i,{ref:r}):null},"Presence");function sit(t){const[e,n]=te.useState(),o=te.useRef(null),i=te.useRef(t),r=te.useRef("none"),s=te.useRef(void 0),a=t?"mounted":"unmounted",[A,c]=rit(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return te.useEffect(()=>{A==="mounted"?(r.current=s.current??fk(o.current),s.current=void 0):r.current="none"},[A]),_p(()=>{const l=o.current,g=i.current;if(g!==t){const h=r.current,d=fk(l);t?(s.current=d,c("MOUNT")):d==="none"||l?.display==="none"?c("UNMOUNT"):c(g&&h!==d?"ANIMATION_OUT":"UNMOUNT"),i.current=t}},[t,c]),_p(()=>{if(e){let l;const g=e.ownerDocument.defaultView??window,u=m8(d=>{const m=fk(o.current).includes(CSS.escape(d.animationName));if(d.target===e&&m&&(c("ANIMATION_END"),!i.current)){const _=e.style.animationFillMode;e.style.animationFillMode="forwards",l=g.setTimeout(()=>{e.style.animationFillMode==="forwards"&&(e.style.animationFillMode=_)})}},"handleAnimationEnd"),h=m8(d=>{d.target===e&&(r.current=fk(o.current))},"handleAnimationStart");return e.addEventListener("animationstart",h),e.addEventListener("animationcancel",u),e.addEventListener("animationend",u),()=>{g.clearTimeout(l),e.removeEventListener("animationstart",h),e.removeEventListener("animationcancel",u),e.removeEventListener("animationend",u)}}else c("ANIMATION_END")},[e,c]),{isPresent:["mounted","unmountSuspended"].includes(A),ref:te.useCallback(l=>{if(l){const g=getComputedStyle(l);o.current=g,s.current=fk(g)}else o.current=null;n(l)},[])}}m8(sit,"usePresence");function _ye(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}m8(_ye,"setRef");function ait(...t){const e=te.useRef(t);return e.current=t,te.useCallback(n=>{const o=e.current;let i=!1;const r=o.map(s=>{const a=_ye(s,n);return!i&&typeof a=="function"&&(i=!0),a});if(i)return()=>{for(let s=0;s<r.length;s++){const a=r[s];typeof a=="function"?a():_ye(o[s],null)}}},[])}m8(ait,"useStableComposedRefs");function fk(t){return t?.animationName||"none"}m8(fk,"getAnimationName");function Ait(t){let e=Object.getOwnPropertyDescriptor(t.props,"ref")?.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=Object.getOwnPropertyDescriptor(t,"ref")?.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}m8(Ait,"getElementRef");var e5n=Object.defineProperty,Ik=(t,e)=>e5n(t,"name",{value:e,configurable:!0}),fye="Tabs",[t5n,YAr]=v3(fye,[Mte]),cit=Mte(),[n5n,Iye]=t5n(fye),o5n=te.forwardRef(Ik(function(e,n){const{__scopeTabs:o,value:i,onValueChange:r,defaultValue:s,orientation:a="horizontal",dir:A,activationMode:c="automatic",...l}=e,g=FK(A),[u,h]=y9({prop:i,onChange:r,defaultProp:s??"",caller:fye});return V.jsx(n5n,{scope:o,baseId:w3(),value:u,onValueChange:h,orientation:a,dir:g,activationMode:c,children:V.jsx(gc.div,{dir:g,"data-orientation":a,...l,ref:n})})},"Tabs")),i5n="TabsList",r5n=te.forwardRef(Ik(function(e,n){const{__scopeTabs:o,loop:i=!0,...r}=e,s=Iye(i5n,o),a=cit(o);return V.jsx(oit,{asChild:!0,...a,orientation:s.orientation,dir:s.dir,loop:i,children:V.jsx(gc.div,{role:"tablist","aria-orientation":s.orientation,...r,ref:n})})},"TabsList")),s5n="TabsTrigger",a5n=te.forwardRef(Ik(function(e,n){const{__scopeTabs:o,value:i,disabled:r=!1,...s}=e,a=Iye(s5n,o),A=cit(o),c=Cye(a.baseId,i),l=yye(a.baseId,i),g=i===a.value;return V.jsx(iit,{asChild:!0,...A,focusable:!r,active:g,children:V.jsx(gc.button,{type:"button",role:"tab","aria-selected":g,"aria-controls":l,"data-state":g?"active":"inactive","data-disabled":r?"":void 0,disabled:r,id:c,...s,ref:n,onMouseDown:_r(e.onMouseDown,u=>{!r&&u.button===0&&u.ctrlKey===!1?a.onValueChange(i):u.preventDefault()}),onKeyDown:_r(e.onKeyDown,u=>{r||u.target!==u.currentTarget||[" ","Enter"].includes(u.key)&&a.onValueChange(i)}),onFocus:_r(e.onFocus,()=>{const u=a.activationMode!=="manual";!g&&!r&&u&&a.onValueChange(i)})})})},"TabsTrigger")),A5n="TabsContent",c5n=te.forwardRef(Ik(function(e,n){const{__scopeTabs:o,value:i,forceMount:r,children:s,...a}=e,A=Iye(A5n,o),c=Cye(A.baseId,i),l=yye(A.baseId,i),g=i===A.value,u=te.useRef(g);return te.useEffect(()=>{const h=requestAnimationFrame(()=>u.current=!1);return()=>cancelAnimationFrame(h)},[]),V.jsx(N4,{present:r||g,children:({present:h})=>V.jsx(gc.div,{"data-state":g?"active":"inactive","data-orientation":A.orientation,role:"tabpanel","aria-labelledby":c,hidden:!h,id:l,tabIndex:0,...a,ref:n,style:{...e.style,animationDuration:u.current?"0s":void 0},children:h&&s})})},"TabsContent"));function Cye(t,e){return`${t}-trigger-${e}`}Ik(Cye,"makeTriggerId");function yye(t,e){return`${t}-content-${e}`}Ik(yye,"makeContentId");var l5n=o5n,lit=r5n,git=a5n,uit=c5n;function dit(t){var e,n,o="";if(typeof t=="string"||typeof t=="number")o+=t;else if(typeof t=="object")if(Array.isArray(t)){var i=t.length;for(e=0;e<i;e++)t[e]&&(n=dit(t[e]))&&(o&&(o+=" "),o+=n)}else for(n in t)t[n]&&(o&&(o+=" "),o+=n);return o}function R4(){for(var t,e,n=0,o="",i=arguments.length;n<i;n++)(t=arguments[n])&&(e=dit(t))&&(o&&(o+=" "),o+=e);return o}const xye="-",g5n=t=>{const e=d5n(t),{conflictingClassGroups:n,conflictingClassGroupModifiers:o}=t;return{getClassGroupId:s=>{const a=s.split(xye);return a[0]===""&&a.length!==1&&a.shift(),hit(a,e)||u5n(s)},getConflictingClassGroupIds:(s,a)=>{const A=n[s]||[];return a&&o[s]?[...A,...o[s]]:A}}},hit=(t,e)=>{if(t.length===0)return e.classGroupId;const n=t[0],o=e.nextPart.get(n),i=o?hit(t.slice(1),o):void 0;if(i)return i;if(e.validators.length===0)return;const r=t.join(xye);return e.validators.find(({validator:s})=>s(r))?.classGroupId},pit=/^\[(.+)\]$/,u5n=t=>{if(pit.test(t)){const e=pit.exec(t)[1],n=e?.substring(0,e.indexOf(":"));if(n)return"arbitrary.."+n}},d5n=t=>{const{theme:e,prefix:n}=t,o={nextPart:new Map,validators:[]};return p5n(Object.entries(t.classGroups),n).forEach(([r,s])=>{Eye(s,o,r,e)}),o},Eye=(t,e,n,o)=>{t.forEach(i=>{if(typeof i=="string"){const r=i===""?e:mit(e,i);r.classGroupId=n;return}if(typeof i=="function"){if(h5n(i)){Eye(i(o),e,n,o);return}e.validators.push({validator:i,classGroupId:n});return}Object.entries(i).forEach(([r,s])=>{Eye(s,mit(e,r),n,o)})})},mit=(t,e)=>{let n=t;return e.split(xye).forEach(o=>{n.nextPart.has(o)||n.nextPart.set(o,{nextPart:new Map,validators:[]}),n=n.nextPart.get(o)}),n},h5n=t=>t.isThemeGetter,p5n=(t,e)=>e?t.map(([n,o])=>{const i=o.map(r=>typeof r=="string"?e+r:typeof r=="object"?Object.fromEntries(Object.entries(r).map(([s,a])=>[e+s,a])):r);return[n,i]}):t,m5n=t=>{if(t<1)return{get:()=>{},set:()=>{}};let e=0,n=new Map,o=new Map;const i=(r,s)=>{n.set(r,s),e++,e>t&&(e=0,o=n,n=new Map)};return{get(r){let s=n.get(r);if(s!==void 0)return s;if((s=o.get(r))!==void 0)return i(r,s),s},set(r,s){n.has(r)?n.set(r,s):i(r,s)}}},_it="!",_5n=t=>{const{separator:e,experimentalParseClassName:n}=t,o=e.length===1,i=e[0],r=e.length,s=a=>{const A=[];let c=0,l=0,g;for(let m=0;m<a.length;m++){let _=a[m];if(c===0){if(_===i&&(o||a.slice(m,m+r)===e)){A.push(a.slice(l,m)),l=m+r;continue}if(_==="/"){g=m;continue}}_==="["?c++:_==="]"&&c--}const u=A.length===0?a:a.substring(l),h=u.startsWith(_it),d=h?u.substring(1):u,p=g&&g>l?g-l:void 0;return{modifiers:A,hasImportantModifier:h,baseClassName:d,maybePostfixModifierPosition:p}};return n?a=>n({className:a,parseClassName:s}):s},f5n=t=>{if(t.length<=1)return t;const e=[];let n=[];return t.forEach(o=>{o[0]==="["?(e.push(...n.sort(),o),n=[]):n.push(o)}),e.push(...n.sort()),e},I5n=t=>({cache:m5n(t.cacheSize),parseClassName:_5n(t),...g5n(t)}),C5n=/\s+/,y5n=(t,e)=>{const{parseClassName:n,getClassGroupId:o,getConflictingClassGroupIds:i}=e,r=[],s=t.trim().split(C5n);let a="";for(let A=s.length-1;A>=0;A-=1){const c=s[A],{modifiers:l,hasImportantModifier:g,baseClassName:u,maybePostfixModifierPosition:h}=n(c);let d=!!h,p=o(d?u.substring(0,h):u);if(!p){if(!d){a=c+(a.length>0?" "+a:a);continue}if(p=o(u),!p){a=c+(a.length>0?" "+a:a);continue}d=!1}const m=f5n(l).join(":"),_=g?m+_it:m,f=_+p;if(r.includes(f))continue;r.push(f);const I=i(p,d);for(let C=0;C<I.length;++C){const y=I[C];r.push(_+y)}a=c+(a.length>0?" "+a:a)}return a};function x5n(){let t=0,e,n,o="";for(;t<arguments.length;)(e=arguments[t++])&&(n=fit(e))&&(o&&(o+=" "),o+=n);return o}const fit=t=>{if(typeof t=="string")return t;let e,n="";for(let o=0;o<t.length;o++)t[o]&&(e=fit(t[o]))&&(n&&(n+=" "),n+=e);return n};function E5n(t,...e){let n,o,i,r=s;function s(A){const c=e.reduce((l,g)=>g(l),t());return n=I5n(c),o=n.cache.get,i=n.cache.set,r=a,a(A)}function a(A){const c=o(A);if(c)return c;const l=y5n(A,n);return i(A,l),l}return function(){return r(x5n.apply(null,arguments))}}const rd=t=>{const e=n=>n[t]||[];return e.isThemeGetter=!0,e},Iit=/^\[(?:([a-z-]+):)?(.+)\]$/i,B5n=/^\d+\/\d+$/,b5n=new Set(["px","full","screen"]),S5n=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Q5n=/\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$/,v5n=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,w5n=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,P5n=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,_8=t=>Ck(t)||b5n.has(t)||B5n.test(t),nQ=t=>yk(t,"length",L5n),Ck=t=>!!t&&!Number.isNaN(Number(t)),Bye=t=>yk(t,"number",Ck),LK=t=>!!t&&Number.isInteger(Number(t)),M5n=t=>t.endsWith("%")&&Ck(t.slice(0,-1)),RA=t=>Iit.test(t),oQ=t=>S5n.test(t),D5n=new Set(["length","size","percentage"]),N5n=t=>yk(t,D5n,Cit),R5n=t=>yk(t,"position",Cit),T5n=new Set(["image","url"]),k5n=t=>yk(t,T5n,O5n),F5n=t=>yk(t,"",H5n),HK=()=>!0,yk=(t,e,n)=>{const o=Iit.exec(t);return o?o[1]?typeof e=="string"?o[1]===e:e.has(o[1]):n(o[2]):!1},L5n=t=>Q5n.test(t)&&!v5n.test(t),Cit=()=>!1,H5n=t=>w5n.test(t),O5n=t=>P5n.test(t),G5n=E5n(()=>{const t=rd("colors"),e=rd("spacing"),n=rd("blur"),o=rd("brightness"),i=rd("borderColor"),r=rd("borderRadius"),s=rd("borderSpacing"),a=rd("borderWidth"),A=rd("contrast"),c=rd("grayscale"),l=rd("hueRotate"),g=rd("invert"),u=rd("gap"),h=rd("gradientColorStops"),d=rd("gradientColorStopPositions"),p=rd("inset"),m=rd("margin"),_=rd("opacity"),f=rd("padding"),I=rd("saturate"),C=rd("scale"),y=rd("sepia"),x=rd("skew"),E=rd("space"),B=rd("translate"),S=()=>["auto","contain","none"],Q=()=>["auto","hidden","clip","visible","scroll"],w=()=>["auto",RA,e],M=()=>[RA,e],k=()=>["",_8,nQ],R=()=>["auto",Ck,RA],F=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],O=()=>["solid","dashed","dotted","double","none"],U=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],Y=()=>["start","end","center","between","around","evenly","stretch"],J=()=>["","0",RA],ee=()=>["auto","avoid","all","avoid-page","page","left","right","column"],W=()=>[Ck,RA];return{cacheSize:500,separator:":",theme:{colors:[HK],spacing:[_8,nQ],blur:["none","",oQ,RA],brightness:W(),borderColor:[t],borderRadius:["none","","full",oQ,RA],borderSpacing:M(),borderWidth:k(),contrast:W(),grayscale:J(),hueRotate:W(),invert:J(),gap:M(),gradientColorStops:[t],gradientColorStopPositions:[M5n,nQ],inset:w(),margin:w(),opacity:W(),padding:M(),saturate:W(),scale:W(),sepia:J(),skew:W(),space:M(),translate:M()},classGroups:{aspect:[{aspect:["auto","square","video",RA]}],container:["container"],columns:[{columns:[oQ]}],"break-after":[{"break-after":ee()}],"break-before":[{"break-before":ee()}],"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:[...F(),RA]}],overflow:[{overflow:Q()}],"overflow-x":[{"overflow-x":Q()}],"overflow-y":[{"overflow-y":Q()}],overscroll:[{overscroll:S()}],"overscroll-x":[{"overscroll-x":S()}],"overscroll-y":[{"overscroll-y":S()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[p]}],"inset-x":[{"inset-x":[p]}],"inset-y":[{"inset-y":[p]}],start:[{start:[p]}],end:[{end:[p]}],top:[{top:[p]}],right:[{right:[p]}],bottom:[{bottom:[p]}],left:[{left:[p]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",LK,RA]}],basis:[{basis:w()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",RA]}],grow:[{grow:J()}],shrink:[{shrink:J()}],order:[{order:["first","last","none",LK,RA]}],"grid-cols":[{"grid-cols":[HK]}],"col-start-end":[{col:["auto",{span:["full",LK,RA]},RA]}],"col-start":[{"col-start":R()}],"col-end":[{"col-end":R()}],"grid-rows":[{"grid-rows":[HK]}],"row-start-end":[{row:["auto",{span:[LK,RA]},RA]}],"row-start":[{"row-start":R()}],"row-end":[{"row-end":R()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",RA]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",RA]}],gap:[{gap:[u]}],"gap-x":[{"gap-x":[u]}],"gap-y":[{"gap-y":[u]}],"justify-content":[{justify:["normal",...Y()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...Y(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...Y(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[f]}],px:[{px:[f]}],py:[{py:[f]}],ps:[{ps:[f]}],pe:[{pe:[f]}],pt:[{pt:[f]}],pr:[{pr:[f]}],pb:[{pb:[f]}],pl:[{pl:[f]}],m:[{m:[m]}],mx:[{mx:[m]}],my:[{my:[m]}],ms:[{ms:[m]}],me:[{me:[m]}],mt:[{mt:[m]}],mr:[{mr:[m]}],mb:[{mb:[m]}],ml:[{ml:[m]}],"space-x":[{"space-x":[E]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[E]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",RA,e]}],"min-w":[{"min-w":[RA,e,"min","max","fit"]}],"max-w":[{"max-w":[RA,e,"none","full","min","max","fit","prose",{screen:[oQ]},oQ]}],h:[{h:[RA,e,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[RA,e,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[RA,e,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[RA,e,"auto","min","max","fit"]}],"font-size":[{text:["base",oQ,nQ]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Bye]}],"font-family":[{font:[HK]}],"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",RA]}],"line-clamp":[{"line-clamp":["none",Ck,Bye]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",_8,RA]}],"list-image":[{"list-image":["none",RA]}],"list-style-type":[{list:["none","disc","decimal",RA]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[t]}],"placeholder-opacity":[{"placeholder-opacity":[_]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[t]}],"text-opacity":[{"text-opacity":[_]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...O(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",_8,nQ]}],"underline-offset":[{"underline-offset":["auto",_8,RA]}],"text-decoration-color":[{decoration:[t]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:M()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",RA]}],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",RA]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[_]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...F(),R5n]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",N5n]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},k5n]}],"bg-color":[{bg:[t]}],"gradient-from-pos":[{from:[d]}],"gradient-via-pos":[{via:[d]}],"gradient-to-pos":[{to:[d]}],"gradient-from":[{from:[h]}],"gradient-via":[{via:[h]}],"gradient-to":[{to:[h]}],rounded:[{rounded:[r]}],"rounded-s":[{"rounded-s":[r]}],"rounded-e":[{"rounded-e":[r]}],"rounded-t":[{"rounded-t":[r]}],"rounded-r":[{"rounded-r":[r]}],"rounded-b":[{"rounded-b":[r]}],"rounded-l":[{"rounded-l":[r]}],"rounded-ss":[{"rounded-ss":[r]}],"rounded-se":[{"rounded-se":[r]}],"rounded-ee":[{"rounded-ee":[r]}],"rounded-es":[{"rounded-es":[r]}],"rounded-tl":[{"rounded-tl":[r]}],"rounded-tr":[{"rounded-tr":[r]}],"rounded-br":[{"rounded-br":[r]}],"rounded-bl":[{"rounded-bl":[r]}],"border-w":[{border:[a]}],"border-w-x":[{"border-x":[a]}],"border-w-y":[{"border-y":[a]}],"border-w-s":[{"border-s":[a]}],"border-w-e":[{"border-e":[a]}],"border-w-t":[{"border-t":[a]}],"border-w-r":[{"border-r":[a]}],"border-w-b":[{"border-b":[a]}],"border-w-l":[{"border-l":[a]}],"border-opacity":[{"border-opacity":[_]}],"border-style":[{border:[...O(),"hidden"]}],"divide-x":[{"divide-x":[a]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[a]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[_]}],"divide-style":[{divide:O()}],"border-color":[{border:[i]}],"border-color-x":[{"border-x":[i]}],"border-color-y":[{"border-y":[i]}],"border-color-s":[{"border-s":[i]}],"border-color-e":[{"border-e":[i]}],"border-color-t":[{"border-t":[i]}],"border-color-r":[{"border-r":[i]}],"border-color-b":[{"border-b":[i]}],"border-color-l":[{"border-l":[i]}],"divide-color":[{divide:[i]}],"outline-style":[{outline:["",...O()]}],"outline-offset":[{"outline-offset":[_8,RA]}],"outline-w":[{outline:[_8,nQ]}],"outline-color":[{outline:[t]}],"ring-w":[{ring:k()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[t]}],"ring-opacity":[{"ring-opacity":[_]}],"ring-offset-w":[{"ring-offset":[_8,nQ]}],"ring-offset-color":[{"ring-offset":[t]}],shadow:[{shadow:["","inner","none",oQ,F5n]}],"shadow-color":[{shadow:[HK]}],opacity:[{opacity:[_]}],"mix-blend":[{"mix-blend":[...U(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":U()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[o]}],contrast:[{contrast:[A]}],"drop-shadow":[{"drop-shadow":["","none",oQ,RA]}],grayscale:[{grayscale:[c]}],"hue-rotate":[{"hue-rotate":[l]}],invert:[{invert:[g]}],saturate:[{saturate:[I]}],sepia:[{sepia:[y]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[o]}],"backdrop-contrast":[{"backdrop-contrast":[A]}],"backdrop-grayscale":[{"backdrop-grayscale":[c]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[l]}],"backdrop-invert":[{"backdrop-invert":[g]}],"backdrop-opacity":[{"backdrop-opacity":[_]}],"backdrop-saturate":[{"backdrop-saturate":[I]}],"backdrop-sepia":[{"backdrop-sepia":[y]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[s]}],"border-spacing-x":[{"border-spacing-x":[s]}],"border-spacing-y":[{"border-spacing-y":[s]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",RA]}],duration:[{duration:W()}],ease:[{ease:["linear","in","out","in-out",RA]}],delay:[{delay:W()}],animate:[{animate:["none","spin","ping","pulse","bounce",RA]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[C]}],"scale-x":[{"scale-x":[C]}],"scale-y":[{"scale-y":[C]}],rotate:[{rotate:[LK,RA]}],"translate-x":[{"translate-x":[B]}],"translate-y":[{"translate-y":[B]}],"skew-x":[{"skew-x":[x]}],"skew-y":[{"skew-y":[x]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",RA]}],accent:[{accent:["auto",t]}],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",RA]}],"caret-color":[{caret:[t]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":M()}],"scroll-mx":[{"scroll-mx":M()}],"scroll-my":[{"scroll-my":M()}],"scroll-ms":[{"scroll-ms":M()}],"scroll-me":[{"scroll-me":M()}],"scroll-mt":[{"scroll-mt":M()}],"scroll-mr":[{"scroll-mr":M()}],"scroll-mb":[{"scroll-mb":M()}],"scroll-ml":[{"scroll-ml":M()}],"scroll-p":[{"scroll-p":M()}],"scroll-px":[{"scroll-px":M()}],"scroll-py":[{"scroll-py":M()}],"scroll-ps":[{"scroll-ps":M()}],"scroll-pe":[{"scroll-pe":M()}],"scroll-pt":[{"scroll-pt":M()}],"scroll-pr":[{"scroll-pr":M()}],"scroll-pb":[{"scroll-pb":M()}],"scroll-pl":[{"scroll-pl":M()}],"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",RA]}],fill:[{fill:[t,"none"]}],"stroke-w":[{stroke:[_8,nQ,Bye]}],stroke:[{stroke:[t,"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"]}}}),Fn="u">typeof window?window:void 0,gC="u">typeof globalThis?globalThis:Fn,F_=gC?.navigator,No=gC?.document,sd=gC?.location,OK=gC?.fetch,bye=gC?.XMLHttpRequest&&"withCredentials"in new gC.XMLHttpRequest?gC.XMLHttpRequest:void 0,yit=gC?.AbortController,Y5n=gC?.CompressionStream,dy=F_?.userAgent;function xit(){return!(!Fn||Fn.navigator.onLine===!1)}const GK=typeof globalThis<"u"?globalThis:Fn;GK&&typeof self>"u"&&(GK.self=GK),GK&&typeof File>"u"&&(GK.File=function(){});const Ur=Fn??{},U5n="0.9.0",f8={DEBUG:!1,LIB_VERSION:U5n,LIB_NAME:"browser-common"};var x9=(function(t){return t.AnonymousId="anonymous_id",t.DistinctId="distinct_id",t.Props="props",t.EnablePersonProcessing="enable_person_processing",t.PersonMode="person_mode",t.FeatureFlagDetails="feature_flag_details",t.FeatureFlags="feature_flags",t.FeatureFlagPayloads="feature_flag_payloads",t.BootstrapFeatureFlagDetails="bootstrap_feature_flag_details",t.BootstrapFeatureFlags="bootstrap_feature_flags",t.BootstrapFeatureFlagPayloads="bootstrap_feature_flag_payloads",t.OverrideFeatureFlags="override_feature_flags",t.Queue="queue",t.AiQueue="ai_queue",t.AiCaptureQueue="ai_capture_queue",t.LogsQueue="logs_queue",t.OptedOut="opted_out",t.SessionId="session_id",t.SessionStartTimestamp="session_start_timestamp",t.SessionLastTimestamp="session_timestamp",t.PersonProperties="person_properties",t.GroupProperties="group_properties",t.InstalledAppBuild="installed_app_build",t.InstalledAppVersion="installed_app_version",t.SessionReplay="session_replay",t.PushRegistered="push_registered",t.SessionReplayEventTriggerActivatedSession="session_replay_event_trigger_activated_session",t.SurveyLastSeenDate="survey_last_seen_date",t.SurveysInProgress="surveys_in_progress",t.SurveysSeen="surveys_seen",t.Surveys="surveys",t.RemoteConfig="remote_config",t.FlagsEndpointWasHit="flags_endpoint_was_hit",t.DeviceId="device_id",t})({}),Sye=(function(t){return t.GZipJS="gzip-js",t.Base64="base64",t})({});const K5n=["$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"],V5n=["token"];function as(t,e){return t.indexOf(e)!==-1}const Dte=function(t){return t.trim()},Qye=function(t){return t.replace(/^\$/,"")};function Eit(t){var e;const n=[];return(e=JSON.stringify(t,function(o,i){if(typeof i=="bigint")return i.toString();if(typeof i!="function"&&typeof i!="symbol"){if(i instanceof Error)return{name:i.name,message:i.message,stack:i.stack};if(i&&typeof i=="object"){for(;n.length>0&&n[n.length-1]!==this;)n.pop();if(n.includes(i))return"[Circular]";n.push(i)}return i}}))!==null&&e!==void 0?e:"null"}const Bit=Object.prototype,vye=Bit.hasOwnProperty,Nte=Bit.toString,As=Array.isArray||function(t){return Nte.call(t)==="[object Array]"},L_=t=>typeof t=="function",xA=t=>t===Object(t)&&!As(t),nx=t=>{if(xA(t)){for(const e in t)if(vye.call(t,e))return!1;return!0}return!1},Eo=t=>t===void 0,nA=t=>Nte.call(t)=="[object String]",YK=t=>nA(t)&&t.trim().length===0,ad=t=>t===null,Fs=t=>Eo(t)||ad(t),jd=t=>Nte.call(t)=="[object Number]"&&t==t,I8=t=>jd(t)&&t>0,hy=t=>Nte.call(t)==="[object Boolean]",z5n=t=>as(K5n,t),J5n=t=>as(V5n,t);function bit(t){return t===null||typeof t!="object"}function Rte(t,e){return{}.toString.call(t)===`[object ${e}]`}function xk(t){switch({}.toString.call(t)){case"[object Error]":case"[object Exception]":case"[object DOMException]":case"[object DOMError]":case"[object WebAssembly.Exception]":return!0;default:return Sit(t,Error)}}function wye(t){return"u">typeof Event&&Sit(t,Event)}function Sit(t,e){try{return t instanceof e}catch{return!1}}const W5n=[!0,"true",1,"1","yes"],Pye=t=>as(W5n,t),j5n=[!1,"false",0,"0","no"];function Qit(t,e,n,o,i,r,s){try{var a=t[r](s),A=a.value}catch(c){return void n(c)}a.done?e(A):Promise.resolve(A).then(o,i)}function Wg(t){return function(){var e=this,n=arguments;return new Promise(function(o,i){var r=t.apply(e,n);function s(A){Qit(r,o,i,s,a,"next",A)}function a(A){Qit(r,o,i,s,a,"throw",A)}s(void 0)})}}const q5n=["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","pinterestbot","prerender","rogerbot","screaming frog","sebot-wa","sitebulb","slackbot","slurp","trendictionbot","turnitin","twitterbot","vercel-screenshot","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"],vit=function(t,e=[]){if(!t)return!1;const n=t.toLowerCase();return q5n.concat(e).some(o=>{const i=o.toLowerCase();return n.indexOf(i)!==-1})};function E9(t,e,n,o,i){return e>n&&(o.warn("min cannot be greater than max."),e=n),jd(t)?t>n?(o.warn(" cannot be greater than max: "+n+". Using max value instead."),n):e>t?(o.warn(" cannot be less than min: "+e+". Using min value instead."),e):t:(o.warn(" must be a number. using max or fallback. max: "+n+", fallback: "+i),E9(i??n,e,n,o))}var X5n=class{constructor(e){this.C={},this.I=e.I,this.R=E9(e.bucketSize,0,100,e.A),this.$=E9(e.refillRate,0,this.R,e.A),this.O=E9(e.refillInterval,0,864e5,e.A)}F(e,n){const o=Math.floor((n-e.lastAccess)/this.O);o>0&&(e.tokens=Math.min(e.tokens+o*this.$,this.R),e.lastAccess=e.lastAccess+o*this.O)}consumeRateLimit(e){var n;const o=Date.now(),i=String(e);let r=this.C[i];return r?this.F(r,o):(r={tokens:this.R,lastAccess:o},this.C[i]=r),r.tokens===0||(r.tokens--,r.tokens===0&&((n=this.I)===null||n===void 0||n.call(this,e)),r.tokens===0)}stop(){this.C={}}};const Ek="Mobile",UK="Android",Tte="Tablet",wit="Android Tablet",Pit="iPad",Mit="Apple Watch",kte="Safari",Fte="BlackBerry",Dit="Samsung Internet",Lte="Chrome",Nit="Chrome iOS",Rit="Internet Explorer",Tit="Internet Explorer Mobile",kit="Opera",Fit="Microsoft Edge",Hte="Firefox",Lit="Firefox iOS",Ote="Nintendo",Gte="PlayStation",Yte="Xbox",Hit="Android Mobile",Oit="Mobile Safari",Mye="Windows",Git="Windows Phone",Yit="Nokia",Dye="Ouya",$5n="Generic "+Ek.toLowerCase(),Uit="Generic "+Tte.toLowerCase(),Nye="Konqueror",Kit="Oculus Browser",Vit="Vivaldi",zit="Yandex",Jit="Whale",Wit="DuckDuckGo",jit="Pale Moon",qit="Waterfox",Rye="Brave",Xit="Claude",$it="Codex",Zit="ChatGPT",ert="Google Search App",Tye=new RegExp("Version/(\\d+(\\.\\d+)?)"),kye=new RegExp("(Claude|Codex|ChatGPT)\\/(\\d+(\\.\\d+)?)"),Z5n=new RegExp(Yte,"i"),e4n=new RegExp("PlayStation \\w+","i"),t4n=new RegExp("Nintendo \\w+","i"),Fye=new RegExp("BlackBerry|PlayBook|BB10","i"),n4n={"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"},trt=function(t,e,n,o){return e=e||"",(function(r){return r?.brave?Rye:null})(n)||(o?.detectGoogleSearchApp&&as(t,"GSA/")?ert:as(t," OPR/")&&as(t,"Mini")?"Opera Mini":as(t," OPR/")?kit:Fye.test(t)?Fte:as(t,"IEMobile")||as(t,"WPDesktop")?Tit:as(t,"OculusBrowser")?Kit:as(t,"SamsungBrowser")?Dit:as(t,"Edge")||as(t,"Edg/")?Fit:as(t,"Vivaldi/")?Vit:as(t,"YaBrowser/")?zit:as(t,"Whale/")?Jit:as(t,"DuckDuckGo/")||as(t,"Ddg/")?Wit:as(t,"Claude/")?Xit:as(t,"Codex/")?$it:as(t,"ChatGPT/")?Zit:as(t,"FBIOS")?"Facebook Mobile":as(t,"UCWEB")||as(t,"UCBrowser")?"UC Browser":as(t,"CriOS")?Nit:as(t,"CrMo")||as(t,Lte)?Lte:as(t,UK)&&as(t,kte)?Hit:as(t,"FxiOS")?Lit:as(t.toLowerCase(),Nye.toLowerCase())?Nye:as(t,"Brave/")?Rye:((r,s)=>s&&as(s,"Apple")||(function(a){return as(a,kte)&&!as(a,Lte)&&!as(a,UK)})(r))(t,e)?as(t,Ek)?Oit:kte:as(t,"PaleMoon/")?jit:as(t,"Waterfox/")?qit:as(t,Hte)?Hte:as(t,"MSIE")||as(t,"Trident/")?Rit:as(t,"Gecko")?Hte:"")},o4n={[Tit]:[new RegExp("rv:(\\d+(\\.\\d+)?)")],[Fit]:[new RegExp("Edge?\\/(\\d+(\\.\\d+)?)")],[Lte]:[new RegExp("(Chrome|CrMo)\\/(\\d+(\\.\\d+)?)")],[Nit]:[new RegExp("CriOS\\/(\\d+(\\.\\d+)?)")],"UC Browser":[new RegExp("(UCBrowser|UCWEB)\\/(\\d+(\\.\\d+)?)")],[kte]:[Tye],[Oit]:[Tye],[kit]:[new RegExp("(Opera|OPR)\\/(\\d+(\\.\\d+)?)")],[Hte]:[new RegExp("Firefox\\/(\\d+(\\.\\d+)?)")],[Lit]:[new RegExp("FxiOS\\/(\\d+(\\.\\d+)?)")],[Nye]:[new RegExp("Konqueror[:/]?(\\d+(\\.\\d+)?)","i")],[Fte]:[new RegExp("BlackBerry (\\d+(\\.\\d+)?)"),Tye],[Hit]:[new RegExp("android\\s(\\d+(\\.\\d+)?)","i")],[Dit]:[new RegExp("SamsungBrowser\\/(\\d+(\\.\\d+)?)")],[Kit]:[new RegExp("OculusBrowser\\/(\\d+(\\.\\d+)?)")],[Vit]:[new RegExp("Vivaldi\\/(\\d+(\\.\\d+)?)")],[zit]:[new RegExp("YaBrowser\\/(\\d+(\\.\\d+)?)")],[Jit]:[new RegExp("Whale\\/(\\d+(\\.\\d+)?)")],[Rye]:[new RegExp("Brave\\/(\\d+(\\.\\d+)?)")],[Xit]:[kye],[$it]:[kye],[Zit]:[kye],[Wit]:[new RegExp("(DuckDuckGo|Ddg)\\/(\\d+(\\.\\d+)?)")],[jit]:[new RegExp("PaleMoon\\/(\\d+(\\.\\d+)?)")],[qit]:[new RegExp("Waterfox\\/(\\d+(\\.\\d+)?)")],[ert]:[new RegExp("GSA\\/(\\d+(\\.\\d+)?)")],[Rit]:[new RegExp("(rv:|MSIE )(\\d+(\\.\\d+)?)")],Mozilla:[new RegExp("rv:(\\d+(\\.\\d+)?)")]},i4n=function(t,e,n,o){const i=trt(t,e,n,o),r=o4n[i];if(Eo(r))return null;for(let s=0;r.length>s;s++){const a=t.match(r[s]);if(a)return parseFloat(a[a.length-2])}return null},nrt=[[new RegExp("Xbox; Xbox (.*?)[);]","i"),t=>[Yte,t&&t[1]||""]],[new RegExp(Ote,"i"),[Ote,""]],[new RegExp(Gte,"i"),[Gte,""]],[Fye,[Fte,""]],[new RegExp(Mye,"i"),(t,e)=>{if(/Phone/.test(e)||/WPDesktop/.test(e))return[Git,""];if(new RegExp(Ek).test(e)&&!/IEMobile\b/.test(e))return["Windows Mobile",""];const n=/Windows NT ([0-9.]+)/i.exec(e);if(n&&n[1]){let o=n4n[n[1]]||"";return/arm/i.test(e)&&(o="RT"),[Mye,o]}return[Mye,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,t=>t&&t[3]?["iOS",[t[3],t[4],t[5]||"0"].join(".")]:["iOS",""]],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,t=>{let e="";return t&&t.length>=3&&(e=Eo(t[2])?t[3]:t[2]),["watchOS",e]}],[new RegExp("(Android (\\d+)\\.(\\d+)\\.?(\\d+)?|Android)","i"),t=>t&&t[2]?[UK,[t[2],t[3],t[4]||"0"].join(".")]:[UK,""]],[/Mac OS X (\d+)[_.](\d+)[_.]?(\d+)?/i,t=>{const e=["Mac OS X",""];return t&&t[1]&&(e[1]=[t[1],t[2],t[3]||"0"].join(".")),e}],[/Mac/i,["Mac OS X",""]],[/CrOS/,["Chrome OS",""]],[/Linux|debian/i,["Linux",""]]],ort=function(t){for(let e=0;nrt.length>e;e++){const[n,o]=nrt[e],i=n.exec(t),r=i&&(L_(o)?o(i,t):o);if(r)return r}return["",""]},irt=function(t){return t4n.test(t)?Ote:e4n.test(t)?Gte:Z5n.test(t)?Yte:new RegExp(Dye,"i").test(t)?Dye:new RegExp("(Windows Phone|WPDesktop)","i").test(t)?Git:/iPad/.test(t)?Pit:/iPod/.test(t)?"iPod Touch":/iPhone/.test(t)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(t)?Mit:Fye.test(t)?Fte:/(kobo)\s(ereader|touch)/i.test(t)?"Kobo":new RegExp(Yit,"i").test(t)?Yit:/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i.test(t)||/(kf[a-z]+)( bui|\)).+silk\//i.test(t)?"Kindle Fire":/(Android|ZTE)/i.test(t)?new RegExp(Ek).test(t)&&!/(9138B|TB782B|Nexus [97]|pixel c|HUAWEISHT|BTV|noble nook|smart ultra 6)/i.test(t)||/pixel[\daxl ]{1,6}/i.test(t)&&!/pixel c/i.test(t)||/(huaweimed-al00|tah-|APA|SM-G92|i980|zte|U304AA)/i.test(t)||/lmy47v/i.test(t)&&!/QTAQZ3/i.test(t)?UK:wit:new RegExp("(pda|Mobile)","i").test(t)?$5n:new RegExp(Tte,"i").test(t)&&!new RegExp("Tablet pc","i").test(t)?Uit:""},r4n=function(t,e){var n;const o=irt(t);return o===Pit||o===wit||o==="Kobo"||o==="Kindle Fire"||o===Uit?Tte:o===Ote||o===Yte||o===Gte||o===Dye?"Console":o===Mit?"Wearable":o?Ek:e?.userAgentDataPlatform==="Android"&&((n=e?.maxTouchPoints)!==null&&n!==void 0?n:0)>0?600>Math.min((i=e?.screenWidth)!==null&&i!==void 0?i:0,(r=e?.screenHeight)!==null&&r!==void 0?r:0)/((s=e?.devicePixelRatio)!==null&&s!==void 0?s:1)?Ek:Tte:"Desktop";var i,r,s},Lye=/\bFBAV\/(\d+(?:\.\d+)*)/i,rrt=[[/\bInstagram(?:[ /](\d+(?:\.\d+)*))?\b/i,"Instagram"],[/\bBarcelona[ /](\d+(?:\.\d+)*)?/i,"Threads"],[/\b(?:MessengerForiOS|(?:FBAN|FB_IAB)\/Orca-Android)\b/i,"Messenger",Lye],[/\bFBAN\/EMA\b/i,"Facebook Lite",Lye],[/\b(?:FBIOS|(?:FBAN|FB_IAB)\/(?:FB4A|FBIOS))\b/i,"Facebook",Lye],[/\bLinkedInApp(?:\]?\/(\d+(?:\.\d+)*))?\b/i,"LinkedIn"],[/\bTwitter(?:Android| for (?:iPhone|iPad|Android))(?:\/(\d+(?:\.\d+)*))?\b/i,"Twitter"],[/\b(?:musical_ly|trill)(?:[_/](\d+\.\d+(?:\.\d+)*))?(?=\b|_)/i,"TikTok",/\bapp_version\/(\d+(?:\.\d+)*)/i],[/\b(?:MicroMessenger|WeChat)\/(\d+(?:\.\d+)*)?/i,"WeChat"],[/\bLine\/(\d+(?:\.\d+)*)?/i,"Line"],[/\bGSA\/(\d+(?:\.\d+)*)?/i,"Google"],[/\[Pinterest\/(?:iOS|Android)\b|\bPinterest(?: for (?:Android(?: Tablet)?|iOS))?\/(\d+(?:\.\d+)*)/i,"Pinterest"],[/\b(?:WA4A|WAiOS)\/(\d+(?:\.\d+)*)?/i,"WhatsApp"],[/\bSnapchat[ /](\d+(?:\.\d+)*)?/i,"Snapchat"],[/\bBing(?:Web|Sapphire)\/(\d+(?:\.\d+)*)?/i,"Bing"],[/\bNAVER\(inapp; search;/i,"Naver",/\bNAVER\(inapp; search;[^;)]*; (\d+(?:\.\d+)*)/i],[/\bKAKAOTALK[ /](\d+\.\d+(?:\.\d+)*)?/i,"KakaoTalk"]],Hye="[Truncated]",KK="[Unserializable]";function Bk(t){let e="";for(let n=0;t.length>n;n++){const o=t.charCodeAt(n);if(55296>o||o>56319)e+=56320>o||o>57343?t[n]:"�";else{const i=t.charCodeAt(n+1);56320>i||i>57343?e+="�":(e+=t[n]+t[n+1],n++)}}return e}function srt(t,e){if(!e)return t;let n=[];try{n=Object.keys(e)}catch{n=[]}for(const o of n){let i;try{i=e[o]}catch{i=KK}Object.defineProperty(t,o,{value:i,enumerable:!0,writable:!0,configurable:!0})}return t}const Ute=3e5;var art=class{record(e){if(e.kind==="too-large")return;if(e.kind!=="retry-later")return void this.reset();if(!e.retryAfterMs)return;const n=this.isOpen(),o=Date.now(),i=Math.min(e.retryAfterMs,Ute);if(!n)return this.ts=o,void(this.es=o+i);this.es=Math.max(this.es,Math.min(o+i,this.ts+Ute))}remainingMs(){const e=Date.now();if(this.ts-5e3>e)return this.reset(),0;const n=Math.min(Ute,Math.max(0,this.es-e));return n===0&&this.reset(),n}isOpen(){return this.remainingMs()>0}reset(){this.es=0,this.ts=0}constructor(){this.es=0,this.ts=0}};const s4n=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function Art(t,e){return typeof(n=t)=="string"&&s4n.test(n)?t:e();var n}function crt(t,e){const n=new Error(e);try{Object.defineProperty(n,"name",{value:t,writable:!0,enumerable:!0,configurable:!0})}catch{}return n}function iQ(t){return t&&t.split("#")[0]}function lrt(t){try{return t()}catch{return}}function grt(t,e){const n=setTimeout(t,e);return n!=null&&n.unref&&n?.unref(),n}function urt(t,e,n){return drt.apply(this,arguments)}function drt(){return(drt=Wg(function*(t,e,n){let o;try{return yield Promise.race([t,new Promise((i,r)=>{o=grt(()=>{try{n?.(),i()}catch(s){r(s)}},e)})])}finally{clearTimeout(o)}})).apply(this,arguments)}let Kte,hrt,Oye;function a4n(t){const e=globalThis._posthogChunkIds;if(!e)return;const n=Object.keys(e);return Oye&&n.length===hrt||(hrt=n.length,Oye=n.reduce((o,i)=>{Kte||(Kte={});const r=Kte[i];if(r)o[r[0]]=r[1];else{const s=t(i);for(let a=s.length-1;a>=0;a--){const A=s[a],c=A?.filename,l=e[i];if(c&&l){o[c]=l,Kte[i]=[c,l];break}}}return o},{})),Oye}function VK(t){return VK=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},VK(t)}function A4n(t,e,n){return(e=(function(o){var i=(function(r){if(VK(r)!="object"||!r)return r;var s=r[Symbol.toPrimitive];if(s!==void 0){var a=s.call(r,"string");if(VK(a)!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(r)})(o);return VK(i)=="symbol"?i:i+""})(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function prt(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,o)}return n}function sn(t){for(var e=1;arguments.length>e;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?prt(Object(n),!0).forEach(function(o){A4n(t,o,n[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):prt(Object(n)).forEach(function(o){Object.defineProperty(t,o,Object.getOwnPropertyDescriptor(n,o))})}return t}var c4n=class{constructor(e,n,o=[]){this.coercers=e,this.stackParser=n,this.modifiers=o}buildFromUnknown(e,n={}){const o=n&&n.mechanism||{handled:!0,type:"generic"},i=this.buildCoercingContext(o,n,0).apply(e),r=this.buildParsingContext(n),s=this.parseStacktrace(i,r);return{$exception_list:this.convertToExceptionList(s,o),$exception_level:"error"}}modifyFrames(e){var n=this;return Wg(function*(){for(const o of e)o.stacktrace&&o.stacktrace.frames&&As(o.stacktrace.frames)&&(o.stacktrace.frames=yield n.applyModifiers(o.stacktrace.frames));return e})()}coerceFallback(e){var n;return{type:"Error",value:"Unknown error",stack:(n=e.syntheticException)===null||n===void 0?void 0:n.stack,synthetic:!0}}parseStacktrace(e,n){var o;let i,r;if(e.cause!=null&&(i=this.parseStacktrace(e.cause,n)),e.stack!=""&&e.stack!=null)try{r=this.applyChunkIds(this.stackParser(e.stack,e.synthetic?n.skipFirstLines:0),n.chunkIdMap)}catch{}return sn(sn({},e),{},{cause:i,stack:r,errors:(o=e.errors)===null||o===void 0?void 0:o.map(s=>this.parseStacktrace(s,n))})}applyChunkIds(e,n){return e.map(o=>(o.filename&&n&&(o.chunk_id=n[o.filename]),o))}applyCoercers(e,n){for(const o of this.coercers)if(o.match(e))return o.coerce(e,n);return this.coerceFallback(n)}applyModifiers(e){var n=this;return Wg(function*(){let o=e;for(const i of n.modifiers)o=yield i(o);return o})()}convertToExceptionList(e,n){const o=[],i=(r,s,a)=>{var A;const c=o.length,l=s===void 0?sn(sn({type:typeof n.type=="string"&&n.type.length>0?n.type:"generic"},typeof n.handled=="boolean"?{handled:n.handled}:n.handled===void 0?{handled:!0}:{}),{},{synthetic:typeof n.synthetic=="boolean"?n.synthetic:r.synthetic,exception_id:c}):{type:"chained",source:a,synthetic:r.synthetic,exception_id:c,parent_id:s},g={type:r.type,value:r.value,mechanism:l};r.stack&&(g.stacktrace={type:"raw",frames:r.stack}),o.push(g),r.cause&&i(r.cause,c,"cause");for(const u of(A=r.errors)!==null&&A!==void 0?A:[])i(u,c,"member")};return i(e),o}buildParsingContext(e){var n;return{chunkIdMap:a4n(this.stackParser),skipFirstLines:(n=e.skipFirstLines)!==null&&n!==void 0?n:1}}getAggregateErrors(e){try{if(xk(e)){let o=Object.getPrototypeOf(e);for(let i=0;o&&100>i;i++){var n;const r=(n=Object.getOwnPropertyDescriptor(o,"constructor"))===null||n===void 0?void 0:n.value;if(typeof r=="function"&&r.name==="AggregateError"){const s=e.errors;return As(s)?s:void 0}o=Object.getPrototypeOf(o)}}}catch{}}buildCoercingContext(e,n,o=0){let i=0,r=0,s=!1;const a=new Set,A=[],c={},l=(h,d,p=0)=>{const m=g(d,p),_=m.apply;if(m.apply=E=>{A.push(h);try{return _(E)}finally{A.pop()}},p>4||p>0&&A.indexOf(h)!==-1)return this.coerceFallback(m);const f=typeof h=="object"&&h!==null||typeof h=="function";if(p===0&&i>=50||f&&a.has(h))return;f&&a.add(h),p===0&&i++;const I=this.getAggregateErrors(h);let C,y;s||(s=!!I);try{if(C=this.applyCoercers(h,m),!C)throw c}catch(E){if(E===c)return void(p===0&&i--);if(!s)throw E;C=this.coerceFallback(m)}if(!I||i>=50)return C;try{y=I.length}catch{return C}if(!Number.isInteger(y)||0>y||y>4294967295)return C;const x=[];for(let E=0;50>i&&1e3>r&&y>E;E++){let B;r++;try{B=m.next(I[E])}catch{i++,B=this.coerceFallback(g(d+1))}B&&x.push(B)}return sn(sn({},C),{},{errors:x})},g=(h,d=0)=>sn(sn({},n),{},{syntheticException:h==0?n.syntheticException:void 0,mechanism:h==0?e:{},apply(p){const m=l(p,h,d+1);if(!m)throw c;return m},next:p=>l(p,h+1)}),u=g(o);return sn(sn({},u),{},{apply:h=>{var d;return(d=l(h,o))!==null&&d!==void 0?d:this.coerceFallback(u)}})}};const l4n=/^([a-z][a-z0-9.+-]+):/i,g4n=["http","https","file","blob","app","capacitor","ionic","webpack","webpack-internal","ng"];function u4n(t){if(!t||t==="<anonymous>")return!1;const e=l4n.exec(t);return!e||g4n.includes(e[1].toLowerCase())}function Gye(t,e,n,o,i){const r={platform:t,filename:e,function:n==="<anonymous>"?"?":n,in_app:u4n(e)};return Eo(o)||(r.lineno=o),Eo(i)||(r.colno=i),r}const mrt=(t,e)=>{const n=t.indexOf("safari-extension")!==-1,o=t.indexOf("safari-web-extension")!==-1;return n||o?[t.indexOf("@")!==-1?t.split("@")[0]:"?",n?`safari-extension:${e}`:`safari-web-extension:${e}`]:[t,e]},d4n=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,h4n=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,p4n=/\((\S*)(?::(\d+))(?::(\d+))\)/,m4n=(t,e)=>{const n=d4n.exec(t);if(n){const[,i,r,s]=n;return Gye(e,i,"?",+r,+s)}const o=h4n.exec(t);if(o){if(o[2]&&o[2].indexOf("eval")===0){const s=p4n.exec(o[2]);s&&(o[2]=s[1],o[3]=s[2],o[4]=s[3])}const[i,r]=mrt(o[1]||"?",o[2]);return Gye(e,r,i,o[3]?+o[3]:void 0,o[4]?+o[4]:void 0)}},_4n=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,f4n=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,I4n=(t,e)=>{const n=_4n.exec(t);if(n){if(n[3]&&n[3].indexOf(" > eval")>-1){const r=f4n.exec(n[3]);r&&(n[1]=n[1]||"eval",n[3]=r[1],n[4]=r[2],n[5]="")}let o=n[3],i=n[1]||"?";return[i,o]=mrt(i,o),Gye(e,o,i,n[4]?+n[4]:void 0,n[5]?+n[5]:void 0)}},_rt=/\(error: (.*)\)/;function Yye(t,e){return t.filename===e.filename&&t.function===e.function&&t.module===e.module&&t.lineno===e.lineno&&t.colno===e.colno}function C4n(t){for(let e=1;10>=e;e++){const n=t.length-2*e;if(0>n)break;let o=!0;for(let i=0;e>i;i++)if(!Yye(t[n+i],t[n+e+i])){o=!1;break}if(o){for(let i=0;e>i;i++)t[n+i]=t[n+e+i];return t.length=n+e,{start:n,length:e}}}}function y4n(t,e){const n=e.start+e.length,o=Irt(t,e);o&&t.splice(n+o===t.length?n:e.start,o)}function frt(t,e){let n=e.start;for(;n>0&&Yye(t[n-1],t[n-1+e.length]);)n--;return e.start-n}function Irt(t,e){const n=e.start+e.length;let o=n;for(;t.length>o&&Yye(t[o],t[o-e.length]);)o++;return o-n}function x4n(t,e){const n=e[0];let o=t.length-(n?frt(t,n):0);for(const i of e)o-=Irt(t,i);return o}function E4n(t,e,n){for(let o=0;t.length>o;o++){const i=t[(e+o)%t.length],r=t[(n+o)%t.length];if(i!==r)return r>i}return!1}var B4n=class{match(e){return this.isDOMException(e)||this.isDOMError(e)}coerce(e,n){const o=nA(e.stack);return{type:this.getType(e),value:this.getValue(e),stack:o?e.stack:void 0,cause:e.cause?n.next(e.cause):void 0,synthetic:!1}}getType(e){return this.isDOMError(e)?"DOMError":"DOMException"}getValue(e){const n=e.name||(this.isDOMError(e)?"DOMError":"DOMException");return e.message?`${n}: ${e.message}`:n}isDOMException(e){return Rte(e,"DOMException")}isDOMError(e){return Rte(e,"DOMError")}},b4n=class{match(e){return xk(e)}coerce(e,n){var o;const i=this.getStack(e),r=i===void 0?(o=n.syntheticException)===null||o===void 0?void 0:o.stack:void 0,s=!!r;return{type:this.getType(e),value:this.getMessage(e,n),stack:i??r,cause:e.cause?n.next(e.cause):void 0,synthetic:s}}getType(e){return e.name||e.constructor.name}getMessage(e,n){const o=e.message;return String(o.error&&typeof o.error.message=="string"?o.error.message:o)}getStack(e){try{const n=e.stacktrace;if(typeof n=="string"&&n.length>0)return n;const o=e.stack;return typeof o=="string"&&o.length>0?o:void 0}catch{return}}},S4n=class{match(e){return!!Rte(e,"ErrorEvent")&&(e.error!=null||this.sr(e))}coerce(e,n){var o;if(e.error!=null)return n.apply(e.error);const i=n.apply(e.message);return sn(sn({},i),{},{stack:(o=this.ar(e))!==null&&o!==void 0?o:i.stack,synthetic:!0})}sr(e){return nA(e.message)&&e.message.length>0}ar(e){var n,o;const i=e,r=(n=i.lineno)!==null&&n!==void 0?n:0,s=(o=i.colno)!==null&&o!==void 0?o:0;if(nA(i.filename)&&i.filename.length!==0&&r!==0)return`Error
240
- at ${i.filename}:${r}:${s}`}};const Q4n=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;var v4n=class{match(e){return typeof e=="string"}coerce(e,n){var o;const[i,r]=this.getInfos(e);return{type:i??"Error",value:r??e,stack:(o=n.syntheticException)===null||o===void 0?void 0:o.stack,synthetic:!0}}getInfos(e){let n="Error",o=e;const i=e.match(Q4n);return i&&(n=i[1],o=i[2]),[n,o]}};const w4n=["fatal","error","warning","log","info","debug"];function Crt(t,e=40){const n=Object.keys(t);if(n.sort(),!n.length)return"[object has no keys]";for(let o=n.length;o>0;o--){const i=n.slice(0,o).join(", ");if(e>=i.length)return o===n.length?i:i.length>e?`${i.slice(0,e)}...`:i}return""}var P4n=class{match(e){return typeof e=="object"&&e!==null}coerce(e,n){var o,i;const r=this.getErrorPropertyFromObject(e);return r?n.apply(r):{type:this.getType(e),value:this.getValue(e),stack:(o=this.getStack(e))!==null&&o!==void 0?o:(i=n.syntheticException)===null||i===void 0?void 0:i.stack,level:this.isSeverityLevel(e.level)?e.level:"error",synthetic:!0}}getType(e){if(wye(e))return e.constructor.name;const n="name"in e?e.name:void 0;return nA(n)&&!YK(n)?n:"Error"}getValue(e){if("name"in e&&typeof e.name=="string"){let o=`'${e.name}' captured as exception`;return"message"in e&&typeof e.message=="string"&&(o+=` with message: '${e.message}'`),o}if("message"in e&&typeof e.message=="string")return e.message;const n=this.getObjectClassName(e);return`${n&&n!=="Object"?`'${n}'`:"Object"} captured as exception with keys: ${Crt(e)}`}isSeverityLevel(e){return nA(e)&&!YK(e)&&w4n.indexOf(e)>=0}getStack(e){try{return nA(e.stacktrace)&&e.stacktrace.length>0?e.stacktrace:nA(e.stack)&&e.stack.length>0?e.stack:void 0}catch{return}}getErrorPropertyFromObject(e){for(const n in e)if({}.hasOwnProperty.call(e,n)){const o=e[n];if(xk(o))return o}}getObjectClassName(e){try{const n=Object.getPrototypeOf(e);return n?n.constructor.name:void 0}catch{return}}},M4n=class{match(e){return wye(e)}coerce(e,n){var o;const i=e.constructor.name;return{type:i,value:`${i} captured as exception with keys: ${Crt(e)}`,stack:(o=n.syntheticException)===null||o===void 0?void 0:o.stack,synthetic:!0}}},D4n=class{match(e){return bit(e)}coerce(e,n){var o;return{type:"Error",value:`Primitive value captured as exception: ${String(e)}`,stack:(o=n.syntheticException)===null||o===void 0?void 0:o.stack,synthetic:!0}}},N4n=class{match(e){return Rte(e,"PromiseRejectionEvent")||this.isCustomEventWrappingRejection(e)}isCustomEventWrappingRejection(e){if(!wye(e))return!1;try{const n=e.detail;return n!=null&&typeof n=="object"&&"reason"in n}catch{return!1}}coerce(e,n){var o;const i=this.getUnhandledRejectionReason(e);return bit(i)?{type:"UnhandledRejection",value:`Non-Error promise rejection captured with value: ${String(i)}`,stack:(o=n.syntheticException)===null||o===void 0?void 0:o.stack,synthetic:!0}:n.apply(i)}getUnhandledRejectionReason(e){try{if("reason"in e)return e.reason;if("detail"in e&&e.detail!=null&&typeof e.detail=="object"&&"reason"in e.detail)return e.detail.reason}catch{}return e}};const Vte="$message",zte="$timestamp",R4n=new Set([Vte,zte]),Uye={enabled:!0,max_bytes:32768};function Jte(t){var e;return t?{enabled:(e=t.enabled)!==null&&e!==void 0?e:Uye.enabled,max_bytes:k4n(t.max_bytes,Uye.max_bytes)}:sn({},Uye)}var T4n=class{constructor(e){this.ns=[],this.ss=0,this.Mr=Jte(e)}setConfig(e){this.Mr=Jte(e),this.rs()}add(e){const n=(function(i){let r;try{r=Eit(i)}catch{return}try{const s=JSON.parse(r);if(!xA(s))return;const a=s,A=a[Vte],c=a[zte];return!nA(A)||A.trim().length===0||!nA(c)&&!jd(c)?void 0:{step:a,json:r}}catch{return}})(e);if(!n)return;const o=(function(i){if("u">typeof TextEncoder)return new TextEncoder().encode(i).length;const r=encodeURIComponent(i);let s=0;for(let a=0;r.length>a;a++)r[a]==="%"?(s+=1,a+=2):s+=1;return s})(n.json);o>this.Mr.max_bytes||(this.ns.push({step:n.step,bytes:o}),this.ss+=o,this.rs())}getAttachable(){return this.ns.map(e=>e.step)}clear(){this.ns=[],this.ss=0}size(){return this.ns.length}rs(){for(;this.ss>this.Mr.max_bytes&&this.ns.length>0;){const e=this.ns.shift();e&&(this.ss-=e.bytes)}}};function k4n(t,e){if(!jd(t)||t===1/0||t===-1/0)return e;const n=Math.floor(t);return 0>n?e:n}const yrt=t=>{if(typeof t!="string")return t;try{return JSON.parse(t)}catch{return t}};function xrt(t){return typeof t=="string"||t}function Ert(t){return typeof t=="string"?t:void 0}const F4n=["$feature_flag","$feature_flag_response","$feature_flag_has_experiment","$feature_flag_id","$feature_flag_version","$feature_flag_reason","$feature_flag_request_id","$feature_flag_evaluated_at","$feature_flag_error","locally_evaluated","$groups","$process_person_profile","$geoip_disable","$current_url","$pathname","$referring_domain","utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid","gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx","$session_id","$window_id","$lib","$lib_version","$device_id","$is_server"],Brt="NativeGzipValidationError",Kye=t=>t.length>=2&&t[0]===31&&t[1]===139,brt=(t,e)=>t===Sye.GZipJS||e===Sye.GZipJS||e==="gzip",Srt=t=>!(!t||typeof t!="object")&&("name"in t?String(t.name):"")==="NotReadableError";let zK;const Wte=t=>{throw crt(Brt,`Native gzip produced invalid output: ${t}`)},L4n=(Qrt=Wg(function*(t,e){18>t.size&&Wte("too-short");const n=new Uint8Array(yield t.slice(0,10).arrayBuffer());Kye(n)&&n[2]===8||Wte("invalid-header");const o=new DataView(yield t.slice(t.size-8).arrayBuffer());o.getUint32(0,!0)!==(r=>{const s=(()=>{if(zK)return zK;zK=[];for(let A=0;256>A;A++){let c=A;for(let l=0;8>l;l++)c=1&c?3988292384^c>>>1:c>>>1;zK[A]=c>>>0}return zK})();let a=4294967295;for(let A=0;r.length>A;A++)a=s[255&(a^r[A])]^a>>>8;return(4294967295^a)>>>0})(e)&&Wte("invalid-crc");const i=e.length>>>0;o.getUint32(4,!0)!==i&&Wte("invalid-size")}),function(t,e){return Qrt.apply(this,arguments)});var Qrt;function Vye(){return Vye=Wg(function*(t,e=!0,n){try{const i=new TextEncoder().encode(t),r=new globalThis.CompressionStream("gzip"),s=r.writable.getWriter(),a=s.write(i).then(()=>s.close()).catch((o=Wg(function*(l){try{yield s.abort(l)}catch{}throw l}),function(l){return o.apply(this,arguments)})),A=new Response(r.readable).blob(),[c]=yield Promise.all([A,a]);return yield L4n(c,i),c}catch(i){if(n?.rethrow)throw i;return e&&console.error("Failed to gzip compress data",i),null}var o}),Vye.apply(this,arguments)}function vrt(t,e){if(t==null)return{};var n,o,i=(function(s,a){if(s==null)return{};var A={};for(var c in s)if({}.hasOwnProperty.call(s,c)){if(a.includes(c))continue;A[c]=s[c]}return A})(t,e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);for(o=0;r.length>o;o++)e.includes(n=r[o])||{}.propertyIsEnumerable.call(t,n)&&(i[n]=t[n])}return i}const H4n={}.propertyIsEnumerable;function jte(t,e){try{return wrt(t,e,{ancestors:new WeakSet,remainingNodes:1e4},0)}catch{return[]}}function zye(t,e,n,o){if(0>=n.remainingNodes)return{stringValue:Hye};if(n.remainingNodes--,hy(t))return{boolValue:t};if(typeof t=="bigint")return(function(i,r){const s=i.toString(),a=BigInt("9223372036854775808");return i>=a||-a>i?(r?.debug(`Attribute ${s} is outside the int64 range; encoding it as a string`),{stringValue:s}):{intValue:s}})(t,e);if(typeof t=="number"){if(!Number.isFinite(t))return{stringValue:String(t)};if(Number.isInteger(t)){if(Number.isSafeInteger(t))return{intValue:String(t)};if(typeof BigInt>"u")return{stringValue:String(t)};const i=BigInt(t).toString();return t>=9223372036854776e3||-9223372036854776e3>t?(e?.debug(`Attribute ${i} is outside the int64 range; encoding it as a string`),{stringValue:i}):{intValue:i}}return{doubleValue:t}}if(typeof t=="string")return{stringValue:Bk(t)};if(typeof t=="function")return{stringValue:"[Function]"};if(typeof t=="symbol")return{stringValue:String(t)};if(typeof t=="object"&&t!==null){if(n.ancestors.has(t))return{stringValue:"[Circular]"};if(o>=20)return{stringValue:Hye};if(t instanceof Date){const i=t.getTime(),r=Number.isFinite(i)?t.toISOString():String(t);return{stringValue:typeof r=="string"?Bk(r):String(r)}}n.ancestors.add(t);try{try{const i=t.toJSON;if(typeof i=="function")return zye(i.call(t),e,n,o+1)}catch{}return As(t)?{arrayValue:{values:O4n(t,e,n,o+1)}}:{kvlistValue:{values:wrt(t,e,n,o+1)}}}finally{n.ancestors.delete(t)}}return{stringValue:Bk(String(t))}}function O4n(t,e,n,o){const i=[],r=Math.min(t.length,1e3);let s=0;for(;r>s&&n.remainingNodes>0;s++)try{const a=s in t?t[s]:void 0;if(Fs(a))continue;i.push(zye(a,e,n,o))}catch{i.push({stringValue:KK})}return t.length>s&&i.push({stringValue:Hye}),i}function wrt(t,e,n,o){const i=[];for(const r in t)if(H4n.call(t,r)){if(!r){e?.debug("Dropping an attribute with an empty key");continue}if(i.length>=1e3||0>=n.remainingNodes){e?.debug("Attributes truncated: the value exceeds the OTLP encoder budget");break}try{const s=t[r];if(ad(s)||Eo(s))continue;i.push({key:Bk(r),value:zye(s,e,n,o)})}catch{i.push({key:Bk(r),value:{stringValue:KK}})}}return i}function Prt(t,e,n){return sn(sn(sn(sn({},srt({},t.resourceAttributes)),{},{"service.name":t.serviceName||"unknown_service"},t.environment&&{"deployment.environment":t.environment}),t.serviceVersion&&{"service.version":t.serviceVersion}),{},{"telemetry.sdk.name":e,"telemetry.sdk.version":n})}const G4n=["service.name","deployment.environment","service.version","telemetry.sdk.name","telemetry.sdk.version"];function Mrt(t,e){const n=srt({},t),o={};for(const i of G4n)({}).hasOwnProperty.call(n,i)&&(o[i]=n[i],delete n[i]);return[...jte(n,e),...jte(o,e)]}const Drt={darwin:"macOS",win32:"Windows",cygwin:"Windows",linux:"Linux",android:"Android",freebsd:"FreeBSD",openbsd:"OpenBSD",netbsd:"NetBSD",sunos:"SunOS",aix:"AIX",haiku:"Haiku","Mac OS X":"macOS"},Nrt={trace:{text:"TRACE",number:1},debug:{text:"DEBUG",number:5},info:{text:"INFO",number:9},warn:{text:"WARN",number:13},error:{text:"ERROR",number:17},fatal:{text:"FATAL",number:21}},Y4n=Nrt.info;function U4n(t){try{return Bk(String(t))}catch{return KK}}function K4n(t,e,n,o){const i=t.level||"info",{text:r,number:s}=Nrt[i]||Y4n,a=(function(u=Date.now()){return String(u)+"000000"})(jd(o)?o:void 0),A={};e.distinctId&&(A.posthogDistinctId=e.distinctId),e.sessionId&&(A.sessionId=e.sessionId),e.windowId&&(A["window.id"]=e.windowId),Fs(e.sessionStartTimestamp)||(A.sessionStartTimestamp=String(e.sessionStartTimestamp)),Fs(e.lastActivityTimestamp)||(A.lastActivityTimestamp=String(e.lastActivityTimestamp)),e.currentUrl&&(A["url.full"]=e.currentUrl),e.screenName&&(A["screen.name"]=e.screenName),e.appState&&(A["app.state"]=e.appState),e.activeFeatureFlags&&e.activeFeatureFlags.length>0&&(A.feature_flags=e.activeFeatureFlags);const c=sn({},A),l=t.attributes;if(l){let u=[];try{u=Object.keys(l)}catch{u=[]}for(const h of u){let d;try{d=l[h]}catch{d=KK}Object.defineProperty(c,h,{value:d,enumerable:!0,writable:!0,configurable:!0})}}const g={timeUnixNano:a,observedTimeUnixNano:a,severityNumber:s,severityText:r,body:{stringValue:U4n(t.body)},attributes:jte(c,n)};return t.trace_id&&(g.traceId=t.trace_id),t.span_id&&(g.spanId=t.span_id),Eo(t.trace_flags)||(g.flags=t.trace_flags),g}function Rrt(t,e,n){return Prt(t,e,n)}function Trt(t,e,n,o){return{resourceLogs:[{resource:{attributes:Mrt(e)},scopeLogs:[{scope:{name:n,version:o},logRecords:t}]}]}}var krt=class{constructor(e){this.ls=e,this.us=0}get pending(){return!!this.hs}arm(e){this.clear(),this.us=Date.now()+e,this.hs=grt(()=>{this.hs=void 0,this.ls()},e)}armNoEarlierThan(e){this.hs&&Date.now()+e<=this.us||this.arm(e)}clear(){this.hs&&(clearTimeout(this.hs),this.hs=void 0)}};function Frt(){return .75+.5*Math.random()}function Lrt(t,e,n,o){const i=Math.min(Math.max(0,e-1),6),r=t*Math.pow(2,i);return Math.round(Math.min(r,Math.max(o,t))*n)}var V4n=class{constructor(e,n,o,i,r,s=()=>Promise.resolve(),a){var A;this._instance=e,this.Mr=n,this.A=o,this.cs=i,this.ds=r,this.vs=s,this.fs=a,this.ps=new krt(()=>this.gs()),this.ys=null,this.bs=0,this._s=0,this.ws=new art,this.ks=0,this.Ss=1,this.xs=0,this.Cs=0,this.$s=!1,this.Ts=n.maxBufferSize,this.Is=Math.max((A=n.maxQueueSize)!==null&&A!==void 0?A:n.maxBufferSize,n.maxBufferSize),this.Ms=n.flushIntervalMs,this.Es=n.maxBatchRecordsPerPost,this.Ps=n.rateCapWindowMs,this.Rs=n.maxLogsPerInterval}clearQueue(){this._s++,this._instance.setPersistedProperty(x9.LogsQueue,[])}reset(){this.ps.clear(),this.xs=0,this.Cs=0,this.$s=!1,this.ks=0,this.Ss=1,this.ws.reset(),this.Es=this.Mr.maxBatchRecordsPerPost}onReconnect(){this.ks=0,this.Ss=1,this.ws.isOpen()?this.As()&&this.Fs():this.gs()}captureLog(e,n){var o;if(this._instance.isDisabled||this._instance.optedOut||!e?.body)return;const i=this.Os(e);if(i===null)return;if(!i.body)return void this.A.info("Log was rejected in beforeSend function");if(!this.Ds())return;const r={record:K4n(i,(o=n?.context)!==null&&o!==void 0?o:this.cs(),this.A,n?.occurredAtMs)};this.ds(()=>this.Ls(r))}Os(e){const n=this.Mr.beforeSend;if(!n)return e;const o=As(n)?n:[n];let i=e;for(const r of o)try{const s=r(i);if(!s)return this.A.info("Log was rejected in beforeSend function"),null;i=s}catch(s){return this.A.error("Error in beforeSend function for log:",s),null}return i}Ds(){if(this.Rs===void 0)return!0;const e=Date.now(),n=e-this.xs;return this.Ps>n&&n>=0||(this.xs=e,this.Cs=0,this.$s=!1),this.Rs>this.Cs?(this.Cs++,!0):(this.$s||(this.A.warn(`captureLog dropping logs: exceeded ${this.Rs} logs per ${this.Ps}ms`),this.$s=!0),!1)}flush(){var e=this;return Wg(function*(){if(!e._instance.isDisabled)return e.ys||(e.ys=e.Ns().finally(()=>{e.ys=null})),e.ys})()}Ns(){var e=this;return Wg(function*(){var n;e.ps.clear();let o=(n=e._instance.getPersistedProperty(x9.LogsQueue))!==null&&n!==void 0?n:[];if(o.length===0)return;const i=o.length;let r=0;for(;o.length>0&&i>r;){var s,a;const A=e._s;e.bs=0;const c=Math.min(o.length,e.Es),l=o.slice(0,c),g=Trt(l.map(h=>h.record),e.qs(),(s=e.fs)!==null&&s!==void 0?s:e._instance.getLibraryId(),e._instance.getLibraryVersion()),u=yield e._instance.js(g);if(e._s!==A)return;if(u.kind==="too-large"&&l.length>1)e.Es=Math.max(1,Math.floor(l.length/2)),e.A.warn(`Logs batch of size ${l.length} was too large for the ingestion endpoint, reducing batch size to ${e.Es}`);else if(e.ws.record(u),e.ps.pending&&e.ps.arm(Math.max(e.Ms,e.ws.remainingMs())),u.kind==="retry-later"||(u.kind==="too-large"?e.A.warn("Dropping a single log record with batch size 1 — the record is larger than the server cap and cannot be split further."):u.kind==="ok"&&e.Mr.maxBatchRecordsPerPost>e.Es&&(e.Es=Math.min(e.Mr.maxBatchRecordsPerPost,e.Es+1)),yield e.Bs(l.length),o=(a=e._instance.getPersistedProperty(x9.LogsQueue))!==null&&a!==void 0?a:[],r+=l.length,u.kind==="fatal"))throw u.error}})()}Bs(e){var n=this;return Wg(function*(){var o;const i=Math.max(0,e-n.bs),r=(o=n._instance.getPersistedProperty(x9.LogsQueue))!==null&&o!==void 0?o:[];n._instance.setPersistedProperty(x9.LogsQueue,r.slice(i)),yield n.vs()})()}qs(){return Rrt(this.Mr,this._instance.getLibraryId(),this._instance.getLibraryVersion())}Ls(e){var n;if(this._instance.optedOut)return;const o=(n=this._instance.getPersistedProperty(x9.LogsQueue))!==null&&n!==void 0?n:[];this.Is>o.length||(o.shift(),this.bs++,this.A.info("Logs queue is full, dropping oldest record.")),o.push(e),this._instance.setPersistedProperty(x9.LogsQueue,o),this.Ts>o.length||this.ws.isOpen()?this.Fs():this.gs()}Fs(){this.ps.pending||this.ps.arm(Math.max(this.Ms,this.ws.remainingMs()))}Hs(){return Math.max(Lrt(this.Ms,this.ks,this.Ss,3e4),this.ws.remainingMs())}As(){const e=this._instance.getPersistedProperty(x9.LogsQueue);return!!e&&e.length>0}shutdown(e){var n=this;return Wg(function*(){n.ps.clear();const o=n.flush().catch(()=>{});e!==void 0?yield urt(o,e):yield o})()}flushWithTimeout(e){var n=this;return Wg(function*(){const o=n.flush();yield urt(o,e,()=>{o.catch(()=>{})})})()}gs(){this.flush().then(()=>{this.ks=0,this.Ss=1},e=>{this.ks++,this.Ss=Frt(),this.A.error("PostHog logs flush failed:",e)}).finally(()=>{!this._instance.isDisabled&&this.As()&&this.ps.armNoEarlierThan(this.Hs())})}};const Jye=[0,5,10,25,50,75,100,250,500,750,1e3,2500,5e3,7500,1e4];function Hrt(t){return String(t)+"000000"}function Ort(t,e,n,o){let i="";return o&&(i=Object.keys(o).sort().map(r=>`${JSON.stringify(r)}:${JSON.stringify(o[r])}`).join(",")),`${t}\0${e}\0${n??""}\0${i}`}var z4n=class{constructor(e,n,o){this._instance=e,this.Mr=n,this.A=o,this.zs=new Map,this.ps=new krt(()=>this.flush().catch(i=>{this.A.error("Metrics flush failed:",i)})),this.ys=null,this.Us=!1,this.Ws=new Map,this.Vs=new Set,this.ws=new art,this.ks=0,this.Ss=1,this.Gs=0}count(e,n=1,o){this.Zs({name:e,type:"count",value:n,unit:o?.unit,attributes:o?.attributes})}gauge(e,n,o){this.Zs({name:e,type:"gauge",value:n,unit:o?.unit,attributes:o?.attributes})}histogram(e,n,o){this.Zs({name:e,type:"histogram",value:n,unit:o?.unit,attributes:o?.attributes})}flush(){var e=this;const n=this.ys,o=(function(){var i=Wg(function*(){n&&(yield n.catch(()=>{})),yield e.Qs()});return function(){return i.apply(this,arguments)}})()().finally(()=>{this.ys===o&&(this.ys=null)});return this.ys=o,o}drainWindow(){if(this.zs.size===0)return null;const e=this.zs;return this.zs=new Map,this.Us=!1,this.Ws=new Map,this.Vs=new Set,this.Js(e)}reset(){this.Gs++,this.ws.reset(),this.ks=0,this.Ss=1,this.ps.clear(),this.zs=new Map,this.ys=null,this.Us=!1,this.Ws=new Map,this.Vs=new Set}Zs(e){if(this._instance.isDisabled||this._instance.optedOut)return;const n=this.Os(e);if(n===null)return;if(!n.name||typeof n.name!="string")return void this.A.warn("Dropping metric with empty name");if(typeof n.value!="number"||!Number.isFinite(n.value))return void this.A.warn(`Dropping metric '${n.name}': value must be a finite number`);if(n.type==="count"&&0>n.value)return void this.A.warn(`Dropping count '${n.name}': counters are monotonic, value must be >= 0`);let o,i;try{o=n.attributes?sn({},n.attributes):void 0,i=Ort(n.type,n.name,n.unit,o)}catch(a){return void this.A.warn(`Dropping metric '${n.name}': attributes could not be serialized`,a)}let r=this.zs.get(i);if(!r){if(!this.Ks())return;r={name:n.name,type:n.type,unit:n.unit,attributes:o,windowStartMs:Date.now()},this.zs.set(i,r)}const s=this.Ws.get(n.name);s===void 0?this.Ws.set(n.name,n.type):s===n.type||this.Vs.has(n.name)||(this.Vs.add(n.name),this.A.warn(`Metric name '${n.name}' is already used as a ${s}; recording it as a ${n.type} too will blend both series in charts. Use a distinct name.`)),this.Xs(r,n.value),this.Fs()}Ks(){return this.Mr.maxSeriesPerFlush>this.zs.size||(this.Us||(this.Us=!0,this.A.warn(`Metric series cap reached (${this.Mr.maxSeriesPerFlush} per flush window); dropping new series until the next flush. Reduce attribute cardinality.`)),!1)}Xs(e,n){switch(e.type){case"count":var o;e.total=((o=e.total)!==null&&o!==void 0?o:0)+n;break;case"gauge":e.last=n;break;case"histogram":{e.hist||(e.hist={count:0,sum:0,min:n,max:n,bucketCounts:new Array(Jye.length+1).fill(0)});const i=e.hist;i.count+=1,i.sum+=n,i.min=Math.min(i.min,n),i.max=Math.max(i.max,n),i.bucketCounts[(function(r,s){for(let a=0;s.length>a;a++)if(s[a]>=r)return a;return s.length})(n,Jye)]+=1;break}}}Os(e){const n=this.Mr.beforeSend;if(!n)return e;const o=As(n)?n:[n];let i=e;for(const r of o)try{const s=r(i);if(!s)return this.A.info("Metric was rejected in beforeSend function"),null;i=s}catch(s){return this.A.error("Error in beforeSend function for metric:",s),null}return i}Fs(){this.ps.pending||this.ps.arm(this.Hs())}Hs(){return Math.max(Lrt(this.Mr.flushIntervalMs,this.ks,this.Ss,3e4),this.ws.remainingMs())}Qs(){var e=this;return Wg(function*(){if(e.ps.clear(),e.zs.size===0)return;const n=e.zs;e.zs=new Map,e.Us=!1,e.Ws=new Map,e.Vs=new Set;const o=e.Gs,i=yield e._instance.Ys(e.Js(n));if(o===e.Gs)switch(e.ws.record(i),i.kind==="retry-later"?(e.ks++,e.Ss=Frt()):(e.ks=0,e.Ss=1),e.ps.pending&&e.ps.arm(e.Hs()),i.kind){case"ok":return;case"retry-later":return e.uo(n),void e.ps.armNoEarlierThan(e.Hs());case"too-large":return void e.A.warn("Metrics batch exceeded the server size limit and was dropped");case"fatal":return void e.A.error("Failed to send metrics batch:",i.error)}})()}Js(e){return n=this.ho(e),o=(function(s,a,A){return Prt(s,a,A)})(this.Mr,this._instance.getLibraryId(),this._instance.getLibraryVersion()),i=this._instance.getLibraryId(),r=this._instance.getLibraryVersion(),{resourceMetrics:[{resource:{attributes:Mrt(o)},scopeMetrics:[{scope:{name:i,version:r},metrics:n}]}]};var n,o,i,r}ho(e){const n=Hrt(Date.now()),o=new Map;for(const a of e.values()){var i;const A=Ort(a.type,a.name,a.unit,void 0);let c=o.get(A);c||(c=sn({name:a.name},a.unit&&{unit:a.unit}),a.type==="count"?c.sum={aggregationTemporality:1,isMonotonic:!0,dataPoints:[]}:a.type==="gauge"?c.gauge={dataPoints:[]}:c.histogram={aggregationTemporality:1,dataPoints:[]},o.set(A,c));const l=jte((i=a.attributes)!==null&&i!==void 0?i:{},this.A),g=Hrt(a.windowStartMs);if(a.type==="count"){var r;const u={attributes:l,startTimeUnixNano:g,timeUnixNano:n,asDouble:(r=a.total)!==null&&r!==void 0?r:0};c.sum.dataPoints.push(u)}else if(a.type==="gauge"){var s;const u={attributes:l,timeUnixNano:n,asDouble:(s=a.last)!==null&&s!==void 0?s:0};c.gauge.dataPoints.push(u)}else a.hist&&c.histogram.dataPoints.push({attributes:l,startTimeUnixNano:g,timeUnixNano:n,count:a.hist.count,sum:a.hist.sum,min:a.hist.min,max:a.hist.max,bucketCounts:a.hist.bucketCounts,explicitBounds:Jye})}return Array.from(o.values())}uo(e){for(const[i,r]of e){const s=this.zs.get(i);if(s)switch(s.windowStartMs=Math.min(s.windowStartMs,r.windowStartMs),s.type){case"count":var n,o;s.total=((n=s.total)!==null&&n!==void 0?n:0)+((o=r.total)!==null&&o!==void 0?o:0);break;case"gauge":break;case"histogram":if(r.hist)if(s.hist){s.hist.count+=r.hist.count,s.hist.sum+=r.hist.sum,s.hist.min=Math.min(s.hist.min,r.hist.min),s.hist.max=Math.max(s.hist.max,r.hist.max);for(let a=0;s.hist.bucketCounts.length>a;a++)s.hist.bucketCounts[a]+=r.hist.bucketCounts[a]}else s.hist=r.hist}else this.Ks()&&this.zs.set(i,r)}}};const Grt=(t,{debugEnabled:e}={})=>{const n={N(o,...i){Fn&&(f8.DEBUG||Fn.POSTHOG_DEBUG||e)&&!Eo(Fn.console)&&Fn.console&&("__rrweb_original__"in Fn.console[o]?Fn.console[o].__rrweb_original__:Fn.console[o])(t,...i)},debug(...o){n.N("debug",...o)},info(...o){n.N("log",...o)},warn(...o){n.N("warn",...o)},error(...o){n.N("error",...o)},critical(...o){console.error(t,...o)},uninitializedWarning(o){n.error(`You must initialize PostHog before calling ${o}`)},createLogger:(o,i)=>Grt(`${t} ${o}`,i)};return n},gi=Grt("[PostHog.js]"),Ad=gi.createLogger,J4n=Ad("[ExternalScriptsLoader]"),qte=t=>{const e=No?.querySelectorAll("script");if(e){for(let n=0;e.length>n;n++)if(e[n].src===t||e[n].getAttribute("src")===t)return e[n]}},wM=(t,e,n)=>{if(t.config.disable_external_dependency_loading)return J4n.warn(`${e} was requested but loading of external scripts is disabled.`),n("Loading of external scripts is disabled");const o=qte(e);if(o){if(o.__posthog_loading_callback_fired)return n();const r=o.__posthog_loading_error;return r?n(r):(o.addEventListener("load",s=>{o.__posthog_loading_callback_fired=!0,n(void 0,s)}),void o.addEventListener("error",s=>{o.__posthog_loading_error=s,n(s)}))}const i=()=>{if(!No)return n("document not found");if(qte(e))return wM(t,e,n);let r=No.createElement("script");if(r.type="text/javascript",r.crossOrigin="anonymous",r.src=e,r.onload=a=>{r.__posthog_loading_callback_fired=!0,n(void 0,a)},r.onerror=a=>{r.__posthog_loading_error=a,n(a)},t.config.prepare_external_dependency_script&&(r=t.config.prepare_external_dependency_script(r)),!r)return n("prepare_external_dependency_script returned null");if(t.config.external_scripts_inject_target==="head")No.head.appendChild(r);else{const a=No.querySelectorAll("body > script");var s;a.length>0?(s=a[0].parentNode)===null||s===void 0||s.insertBefore(r,a[0]):No.body.appendChild(r)}};No?.body?i():No?.addEventListener("DOMContentLoaded",i)},Wye={},Yrt=(t,e)=>{let n=`/static/${e}.js?v=${t.version}`;return e==="toolbar"&&(n=`${n}&t=${Math.floor(Date.now()/3e5)*3e5}`),t.requestRouter.endpointFor("assets",n)};Ur.__PosthogExtensions__=Ur.__PosthogExtensions__||{},Ur.__PosthogExtensions__.loadExternalDependency=(t,e,n)=>{if(e==="remote-config"){const i=t.requestRouter.endpointFor("assets",`/array/${t.config.token}/config.js`);return void wM(t,i,n)}const o=t.config.strict_script_versioning;if(o){const i=t.requestRouter.endpointFor("assets",`/static/${t.version}/${e}.js`),r=Wye[i];if(o==="fallback"&&r){if(qte(r))return void wM(t,r,n);delete Wye[i]}return void wM(t,i,o==="fallback"?(s,a)=>{if(s)if(typeof s=="string")n(s);else{var A;const c=Yrt(t,e);Wye[i]=c;const l=qte(i);l==null||(A=l.parentNode)===null||A===void 0||A.removeChild(l),wM(t,c,n)}else n(void 0,a)}:n)}wM(t,Yrt(t,e),n)},Ur.__PosthogExtensions__.loadSiteApp=(t,e,n)=>{const o=t.requestRouter.endpointFor("api",e);wM(t,o,n)},f8.DEBUG=!1,f8.LIB_VERSION="1.435.2",f8.LIB_NAME="web";var Ym=f8;const W4n="$people_distinct_id",T4="distinct_id",jye="$device_id",qye="$device_model",Xte="__alias",j4n="__cmpns",Urt="$fbc",bk="$fbc_persistence",Krt="$fbp",JK="$fbp_persistence",Xye="__timers",Vrt="$autocapture_disabled_server_side",$ye="$heatmaps_enabled_server_side",Zye="$exception_capture_enabled_server_side",zrt="$error_tracking_suppression_rules",e2e="$error_tracking_capture_extension_exceptions",t2e="$web_vitals_enabled_server_side",n2e="$dead_clicks_enabled_server_side",o2e="$product_tours_enabled_server_side",Jrt="$logs_capture_enabled_server_side",Wrt="$web_vitals_allowed_metrics",WK="$session_recording_remote_config",q4n="$session_recording_enabled_server_side",X4n="$replay_sample_rate",$4n="$replay_override_sampling",Z4n="$replay_override_linked_flag",eBn="$replay_override_url_trigger",tBn="$replay_override_event_trigger",Sk="$sesid",jrt="$session_is_sampled",nBn="$session_past_minimum_duration",oBn="$session_recording_url_trigger_activated_session",iBn="$session_recording_event_trigger_activated_session",rBn="$debug_first_full_snapshot_timestamp",sBn="$sess_rec_flush_size",k4="$enabled_feature_flags",C8="$active_feature_flags",i2e="$early_access_features",PM="$feature_flag_details",rQ="$feature_flag_payloads",MM="$feature_flag_request_id",jK="$minimal_flag_called_events",B9="$override_feature_flags",DM="$override_feature_flag_payloads",sQ="$stored_person_properties",aQ="$stored_group_properties",qrt="$groups",qK="$surveys",$te="$surveys_loaded_at",Xrt="$surveys_activated",$rt="$surveys_activated_session",Zrt="$surveys_activated_timestamps",r2e="ph_product_tours",aBn="$product_tours_activated",ABn="$product_tours_activated_session",cBn="$conversations_widget_session_id",lBn="$conversations_ticket_id",gBn="$conversations_widget_state",uBn="$conversations_user_traits",AQ="$flag_call_reported",XK="$flag_call_reported_session_id",$K="$feature_flag_errors",cQ="$feature_flag_evaluated_at",py="$user_state",s2e="$client_session_props",dBn="$capture_rate_limit",est="$initial_campaign_params",tst="$initial_referrer_info",Qk="$initial_person_info",a2e="$epp",A2e="$posthog_cookieless",nst="$cookieless_mode",ost="$sdk_debug_extensions_init_method",ist="$sdk_debug_extensions_init_time_ms",c2e="$sdk_debug_recording_script_not_loaded",l2e="$sdk_debug_replay_stale_config",rst="$sdk_debug_replay_event_trigger_status",sst="$sdk_debug_replay_linked_flag_trigger_status",ast="$sdk_debug_replay_matched_recording_trigger_groups",Ast="$sdk_debug_replay_pending_trigger_conditions",cst="$sdk_debug_replay_remote_trigger_matching_config",lst="$sdk_debug_replay_trigger_groups_count",gst="$sdk_debug_replay_url_trigger_status",hBn="$session_recording_start_reason",g2e="PostHog loadExternalDependency extension not found.",y8="anonymous",Zte="identified",ust="identified_only",ZK="visibilitychange",ene="beforeunload",u2e="$pageview",dst="$pageleave",hst="$identify",pst="$groupidentify";function vk(t,e){As(t)&&t.forEach(e)}function vl(t,e){if(!Fs(t))if(As(t))t.forEach(e);else if((n=>n instanceof FormData)(t))t.forEach((n,o)=>e(n,o));else for(const n in t)vye.call(t,n)&&e(t[n],n)}const jg=function(t,...e){for(const n of e)for(const o in n)n[o]!==void 0&&(t[o]=n[o]);return t};function tne(t){const e=Object.keys(t);let n=e.length;const o=new Array(n);for(;n--;)o[n]=[e[n],t[e[n]]];return o}const pBn=function(t){return function(...e){try{return t.apply(this,e)}catch(n){gi.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),gi.critical(n)}}},d2e=function(t){const e={};return vl(t,function(n,o){(nA(n)&&n.length>0||jd(n))&&(e[o]=n)}),e};function mst(t){const e=sn({},t);for(const n of["name","message","stack","cause","errors"])try{n in t&&(e[n]=t[n])}catch{}return e}const mBn=["herokuapp.com","vercel.app","netlify.app"];function _Bn(t){const e=t?.hostname;if(!nA(e))return!1;const n=e.split(".").slice(-2).join(".");for(const o of mBn)if(n===o)return!1;return!0}function jc(t,e,n,o){const{capture:i=!1,passive:r=!0}=o??{};t?.addEventListener(e,n,{capture:i,passive:r})}function h2e(t){return t.name==="ph_toolbar_internal"}const eV=t=>{if(No){try{const e=t+"=",n=No.cookie.split(";").filter(o=>o.length);for(let o=0;n.length>o;o++){let i=n[o];for(;i.charAt(0)==" ";)i=i.substring(1,i.length);if(i.indexOf(e)===0)return decodeURIComponent(i.substring(e.length,i.length))}}catch{}return null}};Math.trunc||(Math.trunc=function(t){return 0>t?Math.ceil(t):Math.floor(t)}),Number.isInteger||(Number.isInteger=function(t){return jd(t)&&isFinite(t)&&Math.floor(t)===t});var fBn=class znt{constructor(e){if(this.bytes=e,e.length!==16)throw new TypeError("not 128-bit length")}static fromFieldsV7(e,n,o,i){if(!Number.isInteger(e)||!Number.isInteger(n)||!Number.isInteger(o)||!Number.isInteger(i)||0>e||0>n||0>o||0>i||e>0xffffffffffff||n>4095||o>1073741823||i>4294967295)throw new RangeError("invalid field value");const r=new Uint8Array(16);return r[0]=e/Math.pow(2,40),r[1]=e/Math.pow(2,32),r[2]=e/Math.pow(2,24),r[3]=e/Math.pow(2,16),r[4]=e/256,r[5]=e,r[6]=112|n>>>8,r[7]=n,r[8]=128|o>>>24,r[9]=o>>>16,r[10]=o>>>8,r[11]=o,r[12]=i>>>24,r[13]=i>>>16,r[14]=i>>>8,r[15]=i,new znt(r)}toString(){let e="";for(let n=0;this.bytes.length>n;n++)e=e+(this.bytes[n]>>>4).toString(16)+(15&this.bytes[n]).toString(16),n!==3&&n!==5&&n!==7&&n!==9||(e+="-");if(e.length!==36)throw new Error("Invalid UUIDv7 was generated");return e}clone(){return new znt(this.bytes.slice(0))}equals(e){return this.compareTo(e)===0}compareTo(e){for(let n=0;16>n;n++){const o=this.bytes[n]-e.bytes[n];if(o!==0)return Math.sign(o)}return 0}},IBn=class{generate(){const e=this.generateOrAbort();if(!Eo(e))return e;{this.Ct=0;const n=this.generateOrAbort();if(Eo(n))throw new Error("Could not generate UUID after timestamp reset");return n}}generateOrAbort(){const e=(()=>{const n=Date.now();return jd(n)&&isFinite(n)?Math.min(Math.max(Math.floor(n),0),0xffffffffffff):0})();if(e>this.Ct)this.Ct=e,this.Mt();else{if(this.Ct>=e+1e4)return;this.It++,this.It>4398046511103&&(this.Ct++,this.Mt())}return fBn.fromFieldsV7(this.Ct,Math.trunc(this.It/Math.pow(2,30)),this.It&Math.pow(2,30)-1,this.Tt.nextUint32())}Mt(){this.It=1024*this.Tt.nextUint32()+(1023&this.Tt.nextUint32())}constructor(){this.Ct=0,this.It=0,this.Tt=new CBn}};let _st=t=>{if("u">typeof UUIDV7_DENY_WEAK_RNG&&UUIDV7_DENY_WEAK_RNG)throw new Error("no cryptographically strong RNG available");for(let e=0;t.length>e;e++)t[e]=65536*Math.trunc(65536*Math.random())+Math.trunc(65536*Math.random());return t};Fn&&!Eo(Fn.crypto)&&crypto.getRandomValues&&(_st=t=>crypto.getRandomValues(t));var CBn=class{nextUint32(){return this.Rt.length>this.Et||(_st(this.Rt),this.Et=0),this.Rt[this.Et++]}constructor(){this.Rt=new Uint32Array(8),this.Et=1/0}};let fst;const F4=()=>yBn().toString(),yBn=()=>(fst||(fst=new IBn)).generate();let tV="";const xBn=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i;let wk=null;const cd={At(){if(!ad(wk))return wk;if(wk=!1,No)try{const t=`__ph_cookie_support_${F4()}`;cd.$t(t,"xyz"),wk=eV(t)==='"xyz"',cd.Lt(t)}catch{wk=!1}return wk},Pt(t){gi.error("cookieStore error: "+t)},Ot:eV,Dt(t){let e;try{e=JSON.parse(cd.Ot(t))||{}}catch{}return e},$t(t,e,n,o,i){if(!No)return!1;try{let r="",s="";const a=(function(c,l){if(l){let g=(function(u,h=No){if(tV)return tV;if(!h||["localhost","127.0.0.1"].includes(u))return"";const d=u.split(".");let p=Math.min(d.length,8);const m="dmn_chk_"+F4();for(;!tV&&p--;){const _=d.slice(p).join("."),f=m+"=1;domain=."+_+";path=/";h.cookie=f+";max-age=3",h.cookie.includes(m)&&(h.cookie=f+";max-age=0",tV=_)}return tV})(c);if(!g){const u=(h=>{const d=h.match(xBn);return d?d[0]:""})(c);u!==g&&gi.info("Warning: cookie subdomain discovery mismatch",u,g),g=u}return g?"; domain=."+g:""}return""})(No.location.hostname,o);if(n){const c=new Date;c.setTime(c.getTime()+864e5*n),r="; expires="+c.toUTCString()}i&&(s="; secure");const A=t+"="+encodeURIComponent(JSON.stringify(e))+r+"; SameSite=Lax; path=/"+a+s;return A.length>3686.4&&gi.warn("cookieStore warning: large cookie, len="+A.length),No.cookie=A,!0}catch{return!1}},Lt(t,e){if(No?.cookie&&(!e||!ad(eV(t))))try{cd.$t(t,"",-1,e)}catch{return}}};let p2e=null;const uc={At(){if(!ad(p2e))return p2e;let t=!0;if(Eo(Fn))t=!1;else try{const e="__mplssupport__";uc.$t(e,"xyz"),uc.Ot(e)!=='"xyz"'&&(t=!1),uc.Lt(e)}catch{t=!1}return t||gi.error("localStorage unsupported; falling back to cookie store"),p2e=t,t},Pt(t){gi.error("localStorage error: "+t)},Ot(t){try{return Fn?.localStorage.getItem(t)}catch(e){uc.Pt(e)}return null},Dt(t){try{return JSON.parse(uc.Ot(t))||{}}catch{}return null},$t(t,e){try{return Fn?.localStorage.setItem(t,JSON.stringify(e)),!0}catch(n){uc.Pt(n)}return!1},Lt(t){try{Fn?.localStorage.removeItem(t)}catch(e){uc.Pt(e)}}},m2e=[sQ,C8,k4,PM,rQ,MM,cQ,$K,AQ],NM=[jye,T4,Sk,jrt,a2e,Qk,bk,py],nne=t=>t+"_cpm",EBn=["__proto__","constructor","prototype"],_2e=t=>{if(!xA(t))return{};const e={};return Object.keys(t).forEach(n=>{EBn.indexOf(n)===-1&&(e[n]=t[n])}),e},f2e=(t,e=[])=>{const n={};return[...NM,...e].forEach(o=>{const i=t[o];Eo(i)||ad(i)||i===""||(n[o]=i)}),n},Ist=t=>{let e=5381,n=2166136261;for(let o=0;t.length>o;o++){const i=t.charCodeAt(o);e=33*e^i,n=Math.imul(n^i,16777619)}return t.length.toString(36)+"."+(e>>>0).toString(36)+"."+(n>>>0).toString(36)},Cst=(t,e)=>({p:e,f:Ist(JSON.stringify(t))}),yst=(t,e)=>{if(!e)return{properties:[],isValid:!1};try{const n=cd.Dt(nne(t)),o=n?.f===Ist(e)&&As(n.p);return{properties:o?n.p:[],isValid:o}}catch{return{properties:[],isValid:!1}}},I2e=(t,e)=>e+"|"+(cd.Ot(nne(t))||""),Pk={},C2e={At:()=>!0,Pt(t){gi.error("memoryStorage error: "+t)},Ot:t=>t in Pk?Pk[t]:null,Dt:t=>t in Pk?Pk[t]:null,$t:(t,e)=>(Pk[t]=e,!0),Lt(t){delete Pk[t]}};let RM=null;const Z0={At(){if(!ad(RM))return RM;if(RM=!0,Eo(Fn))RM=!1;else try{const t="__support__";Z0.$t(t,"xyz"),Z0.Ot(t)!=='"xyz"'&&(RM=!1),Z0.Lt(t)}catch{RM=!1}return RM},Pt(t){gi.error("sessionStorage error: ",t)},Ot(t){try{return Fn?.sessionStorage.getItem(t)}catch(e){Z0.Pt(e)}return null},Dt(t){try{return JSON.parse(Z0.Ot(t))||null}catch{}return null},$t(t,e){try{return Fn?.sessionStorage.setItem(t,JSON.stringify(e)),!0}catch(n){Z0.Pt(n)}return!1},Lt(t){try{Fn?.sessionStorage.removeItem(t)}catch(e){Z0.Pt(e)}}};var BBn=class{constructor(e){this._instance=e}get Mr(){return this._instance.config}get consent(){return this.Oo()?0:this.Do}isOptedOut(){return this.Mr.cookieless_mode==="always"||this.isRejected()||this.consent===-1&&this.Mr.cookieless_mode==="on_reject"}isOptedIn(){return!this.isOptedOut()}isExplicitlyOptedOut(){return this.consent===0}isRejected(){return this.consent===0||this.consent===-1&&this.Mr.opt_out_capturing_by_default}optInOut(e){this.Lo.$t(this.No,e?1:0,this.Mr.cookie_expiration,this.Mr.cross_subdomain_cookie,this.Mr.secure_cookie)}reset(){this.Lo.Lt(this.No,this.Mr.cross_subdomain_cookie)}get No(){const{token:e,opt_out_capturing_cookie_prefix:n,consent_persistence_name:o}=this._instance.config;return o||(n?n+e:"__ph_opt_in_out_"+e)}get Do(){const e=this.Lo.Ot(this.No);return Pye(e)?1:as(j5n,e)?0:-1}get Lo(){const e=this.Mr.opt_out_capturing_persistence_type,n=e==="localStorage"?uc:cd,o=n.At()?n:C2e;if(!this.qo||this.qo!==o){this.qo=o;const i=e==="localStorage"?cd:uc;i.Ot(this.No)&&(this.qo.Ot(this.No)||this.optInOut(Pye(i.Ot(this.No))),i.Lt(this.No,this.Mr.cross_subdomain_cookie))}return this.qo}Oo(){return!!this.Mr.respect_dnt&&[F_?.doNotTrack,F_?.msDoNotTrack,Ur.doNotTrack,F_?.globalPrivacyControl].some(e=>Pye(e))}};function xst(t,e){var n;const o=t==null||(n=t.config)===null||n===void 0?void 0:n.get_current_url;if(!L_(o))return e;try{const i=o(e);return nA(i)&&i?i:e}catch(i){return gi.error("Error in get_current_url, falling back to window.location.href",i),e}}function Est(t){var e;return t instanceof Element&&(t.id==="__POSTHOG_TOOLBAR__"||!!(!((e=t.closest)===null||e===void 0)&&e.call(t,".toolbar-global-fade-container")))}function b9(t){return!!t&&t.nodeType===1}function j1(t,e){return!!t&&!!t.tagName&&t.tagName.toLowerCase()===e.toLowerCase()}function Bst(t){return!!t&&t.nodeType===3}function y2e(t){return!!t&&t.nodeType===11&&b9(t.host)}function x2e(t){return t?Dte(t).split(/\s+/):[]}function bst(t,e){const n=(function(o){var i;const r=Fn==null||(i=Fn.location)===null||i===void 0?void 0:i.href;return Eo(r)?void 0:xst(o,r)})(e);return!!(n&&t&&t.some(o=>n.match(o)))}function Mk(t){let e="";switch(typeof t.className){case"string":e=t.className;break;case"object":e=(t.className&&"baseVal"in t.className?t.className.baseVal:null)||t.getAttribute("class")||"";break;default:e=""}return x2e(e)}function Sst(t){return Fs(t)?null:Dte(t).split(/(\s+)/).filter(e=>rV(e)).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function nV(t){let e="";return Dk(t)&&!iV(t)&&t.childNodes&&t.childNodes.length&&vl(t.childNodes,function(n){var o;Bst(n)&&n.textContent&&(e+=(o=Sst(n.textContent))!==null&&o!==void 0?o:"")}),Dte(e)}function oV(t){var e;return Eo(t.target)?t.srcElement||null:!((e=t.target)===null||e===void 0)&&e.shadowRoot?t.composedPath()[0]||null:t.target||null}const E2e=["a","button","form","input","select","textarea","label"];function B2e(t,e){const n=t.matches||t.matchesSelector||t.msMatchesSelector||t.mozMatchesSelector||t.webkitMatchesSelector||t.oMatchesSelector;try{return!!n&&n.call(t,e)}catch{return!1}}function b2e(t,e){if(Eo(e))return!0;for(const n of t)if(e.some(o=>B2e(n,o)))return!0;return!1}function Qst(t){const e=t.parentNode;return!(!e||!b9(e))&&e}const S2e=[".ph-no-autocapture","[data-ph-no-autocapture]"],vst=["next","previous","prev",">","<"],bBn=[...vst,"+","-","−","–"],wst=(t,e)=>/[a-z0-9]/i.test(e)?t.includes(e):t===e,Pst=[".ph-no-rageclick",".ph-no-capture"],SBn=["","text","search","email","password","url","tel","number"];function Mst(t,e){if(!Fn||Q2e(t))return!1;let n,o,i;var r,s;if(hy(e)?(n=!!e&&Pst,o=void 0,i=!1):(n=(r=e?.css_selector_ignorelist)!==null&&r!==void 0?r:Pst,o=e?.content_ignorelist,i=(s=e?.ignore_text_selection)!==null&&s!==void 0&&s),n===!1||i&&(function(A){return!(!A||!b9(A))&&(!!j1(A,"textarea")||(j1(A,"input")?as(SBn,(A.getAttribute("type")||"").toLowerCase()):(function(c){var l;if(c.isContentEditable)return!0;const g=(l=c.getAttribute)===null||l===void 0?void 0:l.call(c,"contenteditable");return g==="true"||g===""})(A)))})(t))return!1;const{targetElementList:a}=Dst(t,!1);return!(function(A,c){if(A===!1||Eo(A))return!1;let l;if(A===!0)l=vst;else{if(!As(A))return!1;if(A.length>10)return gi.error("[PostHog] content_ignorelist array cannot exceed 10 items. Use css_selector_ignorelist for more complex matching."),!1;l=A.map(g=>g.toLowerCase())}return c.some(({safeText:g,ariaLabel:u})=>l.some(h=>wst(g,h)||wst(u,h)))})(o,a.map(A=>{var c;return{safeText:nV(A).toLowerCase(),ariaLabel:((c=A.getAttribute("aria-label"))===null||c===void 0?void 0:c.toLowerCase().trim())||""}}))&&!b2e(a,n)}const Q2e=t=>!t||j1(t,"html")||!b9(t),Dst=(t,e)=>{if(!Fn||Q2e(t))return{parentIsUsefulElement:!1,targetElementList:[]};let n=!1;const o=[t];let i=t;for(;i.parentNode&&!j1(i,"body");){if(y2e(i.parentNode)){o.push(i.parentNode.host),i=i.parentNode.host;continue}const r=Qst(i);if(!r)break;if(e||E2e.indexOf(r.tagName.toLowerCase())>-1)n=!0;else try{const s=Fn.getComputedStyle(r);s&&s.getPropertyValue("cursor")==="pointer"&&(n=!0)}catch{}o.push(r),i=r}return{parentIsUsefulElement:n,targetElementList:o}};function Dk(t){const e=new Set;let n=0;for(let r=t;r.parentNode&&!j1(r,"body");r=r.parentNode){if(n++>=1e3||e.has(r))return!1;e.add(r);const s=Mk(r);if(as(s,"ph-sensitive")||as(s,"ph-no-capture"))return!1}if(as(Mk(t),"ph-include"))return!0;const o=t.type||"";if(nA(o))switch(o.toLowerCase()){case"hidden":case"password":return!1}const i=t.name||t.id||"";return!nA(i)||!/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(i.replace(/[^a-zA-Z0-9]/g,""))}function iV(t){return!!(j1(t,"input")&&!["button","checkbox","submit","reset"].includes(t.type)||j1(t,"select")||j1(t,"textarea")||t.getAttribute("contenteditable")==="true")}const Nst=new RegExp("^(?:(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}))$"),Rst=/(^|[^0-9A-Za-z_])([0-9][0-9 -]*[0-9])(?=$|[^0-9A-Za-z_])/g,QBn=[16,15,14,13],vBn=new RegExp("^(\\d{3}-?\\d{2}-?\\d{4})$"),Tst=new RegExp("(^|[^0-9])((?!000|666)[0-9]{3}-?(?!00)[0-9]{2}-?(?!0000)[0-9]{4})(?=$|([^0-9]))","g"),kst=/[0-9A-Za-z_]/;function wBn(t){let e=0,n=!1;for(let o=t.length-1;o>=0;o--){let i=t.charCodeAt(o)-48;n&&(i*=2,i>9&&(i-=9)),e+=i,n=!n}return e%10==0}function rV(t,e=!0){return!(Fs(t)||nA(t)&&(t=Dte(t),(e?Nst.test((t||"").replace(/[- ]/g,"")):(function(n){let o;for(Rst.lastIndex=0;o=Rst.exec(n);){const i=o[2];if(!i)continue;const r=i.replace(/[- ]/g,"");for(let s=0;r.length>s;s++)for(const a of QBn){const A=s+a;if(r.length>=A){const c=r.slice(s,A);if(Nst.test(c)&&wBn(c))return!0}}}return!1})(t))||(e?vBn.test(t):(function(n){let o;for(Tst.lastIndex=0;o=Tst.exec(n);){const i=o[1],r=o[3];if(!(i&&r&&kst.test(i)&&kst.test(r)))return!0}return!1})(t))))}function Fst(t){let e=nV(t);return e=`${e} ${Lst(t)}`.trim(),rV(e)?e:""}function Lst(t){let e="";return t&&t.childNodes&&t.childNodes.length&&vl(t.childNodes,function(n){var o;if(n&&((o=n.tagName)===null||o===void 0?void 0:o.toLowerCase())==="span")try{const i=nV(n);e=`${e} ${i}`.trim(),n.childNodes&&n.childNodes.length&&(e=`${e} ${Lst(n)}`.trim())}catch(i){gi.error("[AutoCapture]",i)}}),e}function Hst(t){return t.replace(/"|\\"/g,'\\"')}function PBn(t){const e=t.attr__class;if(e)return As(e)?e:x2e(e)}const one=Ad("[Dead Clicks]"),MBn=()=>!0,DBn=t=>{var e;const n=!!(!((e=t.instance.persistence)===null||e===void 0)&&e.get_property(n2e)),o=t.instance.config.capture_dead_clicks;return hy(o)?o:!!xA(o)||n};var Ost=class{get lazyLoadedDeadClicksAutocapture(){return this.jo}constructor(e,n,o){this.instance=e,this.isEnabled=n,this.onCapture=o,this.startIfEnabledOrStop()}onRemoteConfig(e){if(!e.ok)return;const n=e.config;"captureDeadClicks"in n&&(this.instance.persistence&&this.instance.persistence.register({[n2e]:n.captureDeadClicks}),this.startIfEnabledOrStop())}startIfEnabledOrStop(){this.isEnabled(this)?this.Bo(()=>{this.Ho()}):this.stop()}Bo(e){var n,o,i;!((n=Ur.__PosthogExtensions__)===null||n===void 0)&&n.initDeadClicksAutocapture?e():(o=Ur.__PosthogExtensions__)===null||o===void 0||(i=o.loadExternalDependency)===null||i===void 0||i.call(o,this.instance,"dead-clicks-autocapture",r=>{r?one.error("failed to load script",r):e()})}Ho(){var e;if(No){if(!this.jo&&(!((e=Ur.__PosthogExtensions__)===null||e===void 0)&&e.initDeadClicksAutocapture)){const n=xA(this.instance.config.capture_dead_clicks)?sn({},this.instance.config.capture_dead_clicks):{};n.__onCapture=this.onCapture,this.onCapture&&(n.capture_dead_swipes=!1),this.jo=Ur.__PosthogExtensions__.initDeadClicksAutocapture(this.instance,n),this.jo.start(No),one.info("starting...")}}else one.error("`document` not found. Cannot start.")}stop(){this.jo&&(this.jo.stop(),this.jo=void 0,one.info("stopping..."))}};const sV=Ad("[SegmentIntegration]");function Gst(t,e,n=!0){const o=t.config.segment;if(!o)return e();const{analytics:i,filterProperties:r}=(a=>L_(a.register))(s=o)?{analytics:s}:s;var s;(function(a,A,c,l){const g=h=>{const d=()=>h.anonymousId()||F4();a.config.get_device_id=d,l&&h.id()&&(a.register({distinct_id:h.id(),$device_id:d()}),a.persistence.set_property(py,Zte)),c(l?void 0:h.anonymousId()||void 0)},u=A.user();"then"in u&&L_(u.then)?u.then(g):g(u)})(t,i,a=>{i.register(((A,c,{filterProperties:l}={})=>{typeof Promise<"u"&&Promise.resolve||sV.warn("This browser does not have Promise support, and can not use the segment integration");const g=(u,h)=>{if(!h)return u;const d=!!c&&u.event.anonymousId===c&&!u.event.userId;d||u.event.userId||u.event.anonymousId===A.get_distinct_id()||(sV.info("No userId set, resetting PostHog"),A.reset()),d||(c=void 0),u.event.userId&&u.event.userId!==A.get_distinct_id()&&(sV.info("UserId set, identifying with PostHog"),A.identify(u.event.userId));let p=A.calculateEventProperties(h,u.event.properties);if(!Fs(l)){const m=u.event.properties||{},_={};for(const I of Object.keys(p))vye.call(m,I)||(_[I]=p[I]);const f=((I,C)=>{const y=As(I)?I:[I];let x=sn({},C);for(const E of y)try{if(x=E(x),Fs(x))return null}catch(B){return sV.error("Error in Segment filterProperties:",B),null}return x})(l,_);if(Fs(f))return u;p=f}return u.event.properties=Object.assign({},p,u.event.properties),u};return{name:"PostHog JS",type:"enrichment",version:"1.0.0",isLoaded(){return!0},load(){return Promise.resolve()},track(u){return g(u,u.event.event)},page(u){return g(u,u2e)},identify(u){return g(u,hst)},screen(u){return g(u,"$screen")}}})(t,a,{filterProperties:r})).then(()=>{e()},A=>{sV.error("Failed to register the Segment integration",A),e()})},n)}const Yst="posthog-js";function Ust(t,{organization:e,projectId:n,prefix:o,severityAllowList:i=["error"],sendExceptionsToPostHog:r=!0}={}){return s=>{var a,A,c,l,g;if(i!=="*"&&!i.includes(s.level)||!t.__loaded)return s;s.tags||(s.tags={});const u=t.requestRouter.endpointFor("ui",`/project/${t.config.token}/person/${t.get_distinct_id()}`);s.tags["PostHog Person URL"]=u,t.sessionRecordingStarted()&&(s.tags["PostHog Recording URL"]=t.get_session_replay_url({withTimestamp:!0}));const h=((a=s.exception)===null||a===void 0?void 0:a.values)||[],d=h.map(_=>sn(sn({},_),{},{stacktrace:_.stacktrace?sn(sn({},_.stacktrace),{},{type:"raw",frames:(_.stacktrace.frames||[]).map(f=>sn(sn({},f),{},{platform:"web:javascript"}))}):void 0})),p={$exception_message:((A=h[0])===null||A===void 0?void 0:A.value)||s.message,$exception_type:(c=h[0])===null||c===void 0?void 0:c.type,$exception_level:s.level,$exception_list:d,$sentry_event_id:s.event_id,$sentry_exception:s.exception,$sentry_exception_message:((l=h[0])===null||l===void 0?void 0:l.value)||s.message,$sentry_exception_type:(g=h[0])===null||g===void 0?void 0:g.type,$sentry_tags:s.tags};var m;return e&&n&&(p.$sentry_url=(o||"https://sentry.io/organizations/")+e+"/issues/?project="+n+"&query="+s.event_id),r&&((m=t.exceptions)===null||m===void 0||m.sendExceptionEvent(p)),s}}var NBn=class{constructor(e,n,o,i,r,s){this.name=Yst,this.setupOnce=function(a){a(Ust(e,{organization:n,projectId:o,prefix:i,severityAllowList:r,sendExceptionsToPostHog:s==null||s}))}}},Kst=class{constructor(e){this.zo=(n,o,i)=>{i&&(i.noSessionId||i.activityTimeout||i.sessionPastMaximumLength||i.crossTabAdoption)&&(gi.info("[PageViewManager] Session rotated, clearing pageview state",{sessionId:n,changeReason:i}),this.Uo=void 0,this._instance.scrollManager.resetContext())},this._instance=e,this.Wo()}Wo(){var e;this.Vo=(e=this._instance.sessionManager)===null||e===void 0?void 0:e.onSessionId(this.zo)}destroy(){var e;(e=this.Vo)===null||e===void 0||e.call(this),this.Vo=void 0}doPageView(e,n){var o;const i=this.Go(e,n);return this.Uo={pathname:(o=Fn?.location.pathname)!==null&&o!==void 0?o:"",pageViewId:n,timestamp:e},this._instance.scrollManager.resetContext(),i}doPageLeave(e){var n;return this.Go(e,(n=this.Uo)===null||n===void 0?void 0:n.pageViewId)}doEvent(){var e;return{$pageview_id:(e=this.Uo)===null||e===void 0?void 0:e.pageViewId}}Go(e,n){const o=this.Uo;if(!o)return{$pageview_id:n};let i={$pageview_id:n,$prev_pageview_id:o.pageViewId};const r=this._instance.scrollManager.getContext();if(r&&!this._instance.config.disable_scroll_properties){let{maxScrollHeight:s,lastScrollY:a,maxScrollY:A,maxContentHeight:c,lastContentY:l,maxContentY:g}=r;if(!(Eo(s)||Eo(a)||Eo(A)||Eo(c)||Eo(l)||Eo(g))){s=Math.ceil(s),a=Math.ceil(a),A=Math.ceil(A),c=Math.ceil(c),l=Math.ceil(l),g=Math.ceil(g);const u=s>1?E9(a/s,0,1,gi):1,h=s>1?E9(A/s,0,1,gi):1,d=c>1?E9(l/c,0,1,gi):1,p=c>1?E9(g/c,0,1,gi):1;i=jg(i,{$prev_pageview_last_scroll:a,$prev_pageview_last_scroll_percentage:u,$prev_pageview_max_scroll:A,$prev_pageview_max_scroll_percentage:h,$prev_pageview_last_content:l,$prev_pageview_last_content_percentage:d,$prev_pageview_max_content:g,$prev_pageview_max_content_percentage:p})}}return o.pathname&&(i.$prev_pageview_pathname=o.pathname),o.timestamp&&(i.$prev_pageview_duration=(e.getTime()-o.timestamp.getTime())/1e3),i}};const aV=["flags","surveys"],RBn={[W4n]:{exposure:"hidden"},[Xte]:{exposure:"hidden"},[j4n]:{exposure:"hidden"},[Xye]:{exposure:"hidden"},[bk]:{exposure:"hidden"},[JK]:{exposure:"hidden"},[Vrt]:{exposure:"event"},[$ye]:{exposure:"hidden"},[Jrt]:{exposure:"hidden"},[Zye]:{exposure:"event"},[zrt]:{exposure:"hidden"},[e2e]:{exposure:"event"},[t2e]:{exposure:"event"},[n2e]:{exposure:"event"},[o2e]:{exposure:"hidden"},[Wrt]:{exposure:"event"},[WK]:{exposure:"hidden"},[q4n]:{exposure:"hidden"},[Sk]:{exposure:"hidden"},[jrt]:{exposure:"event"},[X4n]:{exposure:"event",shouldSkipFromEventProperties:t=>ad(t)},[nBn]:{exposure:"event"},[oBn]:{exposure:"event"},[iBn]:{exposure:"event"},[rBn]:{exposure:"event"},[sBn]:{exposure:"hidden"},[k4]:{exposure:"hidden",storageGroup:"flags"},[C8]:{exposure:"hidden",storageGroup:"flags"},[i2e]:{exposure:"hidden"},[PM]:{exposure:"hidden",storageGroup:"flags"},[rQ]:{exposure:"hidden",storageGroup:"flags"},[MM]:{exposure:"hidden",storageGroup:"flags",volatile:!0},[jK]:{exposure:"hidden",storageGroup:"flags"},[B9]:{exposure:"hidden"},[DM]:{exposure:"hidden"},[sQ]:{exposure:"hidden"},[aQ]:{exposure:"hidden"},[qK]:{exposure:"hidden",storageGroup:"surveys"},[$te]:{exposure:"hidden",storageGroup:"surveys",volatile:!0},[Xrt]:{exposure:"event"},[$rt]:{exposure:"hidden"},[Zrt]:{exposure:"hidden"},[r2e]:{exposure:"hidden"},[aBn]:{exposure:"hidden"},[ABn]:{exposure:"hidden"},[cBn]:{exposure:"event"},[lBn]:{exposure:"event"},[gBn]:{exposure:"event"},[uBn]:{exposure:"event"},[AQ]:{exposure:"hidden"},[XK]:{exposure:"hidden"},[qrt]:{exposure:"event"},[$K]:{exposure:"hidden"},[cQ]:{exposure:"hidden",storageGroup:"flags",volatile:!0},[py]:{exposure:"hidden"},[s2e]:{exposure:"hidden"},[dBn]:{exposure:"hidden"},[est]:{exposure:"hidden"},[tst]:{exposure:"hidden"},[Qk]:{exposure:"hidden"},[a2e]:{exposure:"hidden"},[$4n]:{exposure:"event"},[Z4n]:{exposure:"event"},[eBn]:{exposure:"event"},[tBn]:{exposure:"event"},[ost]:{exposure:"event"},[ist]:{exposure:"event"},[c2e]:{exposure:"hidden"},[l2e]:{exposure:"hidden"},[rst]:{exposure:"hidden"},[sst]:{exposure:"hidden"},[ast]:{exposure:"hidden"},[Ast]:{exposure:"hidden"},[cst]:{exposure:"hidden"},[lst]:{exposure:"hidden"},[gst]:{exposure:"hidden"},[hBn]:{exposure:"event"}},TBn=[["$posthog_sr_group_event_trigger_",{exposure:"hidden"}],["$posthog_sr_group_url_trigger_",{exposure:"hidden"}],["$posthog_sr_group_sampling_",{exposure:"hidden"}]],Kf=t=>{const e=RBn[t];if(e)return e;for(const[n,o]of TBn)if(t.indexOf(n)===0)return o},Nk=(t,e)=>{try{let n;return JSON.stringify(t,(o,i)=>{var r;return xk(i)?((r=n)!==null&&r!==void 0||(n=new WeakMap),n.has(i)||n.set(i,mst(i)),n.get(i)):typeof i=="bigint"?i.toString():i},e)}catch{return Eit(t)}},x8=t=>{const e=No?.createElement("a");return Eo(e)?null:(e.href=t,e)},Rk=function(t,e){const n=((t.split("#")[0]||"").split(/\?(.*)/)[1]||"").replace(/^\?+/g,"").split("&");let o;for(let i=0;n.length>i;i++){const r=n[i].split("=");if(r[0]===e){o=r;break}}if(!As(o)||2>o.length)return"";{let i=o[1];try{i=decodeURIComponent(i)}catch{gi.error("Skipping decoding for malformed query param: "+i)}return i.replace(/\+/g," ")}},AV=function(t,e,n){if(!t||!e||!e.length)return t;const o=t.split("#"),i=o[1],r=(o[0]||"").split("?"),s=r[1],a=r[0],A=(s||"").split("&"),c=[];for(let g=0;A.length>g;g++){const u=A[g].split("=");As(u)&&(e.includes(u[0])?c.push(u[0]+"="+n):c.push(A[g]))}let l=a;return s!=null&&(l+="?"+c.join("&")),i!=null&&(l+="#"+i),l},ine=function(t,e){const n=t.match(new RegExp(e+"=([^&]*)"));return n?n[1]:null},Vst=(t,e)=>t>=e&&xit(),zst=(t,e,n,o)=>{if(t===0){if(xit()){const i=e+1;return i===n&&o(),i}return e}return 0},Tk=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx"],kBn=["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid",...Tk],cV="<masked>",FBn=["li_fat_id"];function Jst(t,e,n){if(!No)return{};const o=e?[...Tk,...n||[]]:[],i=Wst(AV(No.URL,o,cV),t),r=(function(){const s={};return vl(FBn,function(a){const A=eV(a);s[a]=A||null}),s})();return jg(r,i)}function Wst(t,e){const n=kBn.concat(e||[]),o={};return vl(n,function(i){const r=Rk(t,i);o[i]=r||null}),o}function jst(t){const e=(function(i){return i?i.search("https?://(.*)google.([^/?]*)")===0?"google":i.search("https?://(.*)bing.com")===0?"bing":i.search("https?://(.*)yahoo.com")===0?"yahoo":i.search("https?://(.*)duckduckgo.com")===0?"duckduckgo":null:null})(t),n=e!="yahoo"?"q":"p",o={};if(!ad(e)){o.$search_engine=e;const i=No?Rk(No.referrer,n):"";i.length&&(o.ph_keyword=i)}return o}function qst(){return navigator.language||navigator.userLanguage}function LBn(){const t=qst();return typeof t=="string"?t.split("-")[0]:void 0}const rne="$direct";function Xst(){return No?.referrer||rne}function $st(t,e,n=!1){const o=t?[...Tk,...e||[]]:[],i=n?iQ(sd?.href):sd?.href,r=i?.substring(0,1e3);return{r:Xst().substring(0,1e3),u:r?AV(r,o,cV):void 0}}function Zst(t,e=!1){var n;const{r:o,u:i}=t,r=e?iQ(i):i,s={$referrer:o,$referring_domain:o==null?void 0:o==rne?rne:(n=x8(o))===null||n===void 0?void 0:n.host};if(r){s.$current_url=r;const a=x8(r);s.$host=a?.host,s.$pathname=a?.pathname;const A=Wst(r);jg(s,A)}if(o){const a=jst(o);jg(s,a)}return s}function eat(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch{return}}function HBn(){try{return new Date().getTimezoneOffset()}catch{return}}const OBn={flags:cQ,surveys:$te},GBn=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"],sne=t=>`${t}_cookie_identity_change_pending`,ane=t=>{let e="",n=0;for(const o of t){const i=encodeURIComponent(JSON.stringify(o).slice(1,-1)).length;if(n+i>1e3)break;e+=o,n+=i}return e},Um="main",E8=[k4,C8,PM,rQ,MM,cQ,jK,sQ],v2e=t=>E8.indexOf(t)!==-1,tat=[bk,JK],nat=t=>tat.indexOf(t)!==-1,lQ=(t,e)=>{try{return JSON.stringify(t)===JSON.stringify(e)}catch{return t===e}},kk=t=>{if(!t)return{};const e=JSON.parse(t);return xA(e)?e:{}},oat=(t,e)=>{vl(t,(n,o)=>{const i=Kf(o);i&&i.exposure!=="event"||{}.hasOwnProperty.call(e,o)||delete t[o]})};var w2e=class{constructor(e,n,o=!0){if(this.Zo={},this.Qo=!1,this.Jo=!1,this.Ko=!1,this.Xo=!1,this.Yo=!1,this.ta=new Map,this.ea=!1,this.ia=!1,this.na=!1,this.sa=new Set,this.ra=new Set,this.Mr=e,this.oa=o,this.props={},this.aa=void 0,this.la=(i=>{let r="";return i.token&&(r=i.token.replace(/\+/g,"PL").replace(/\//g,"SL").replace(/=/g,"EQ")),i.persistence_name?"ph_"+i.persistence_name:"ph_"+r+"_posthog"})(e),this.hi=e.disable_persistence||!!n,this.Lo=this.ua(e),this.Ko=this.ha(e),this.load(),this.ca(),e.debug&&gi.info("Persistence loaded",e.persistence,sn({},this.props)),this.update_config(e,e,n),this.save(),Fn){const i=()=>this.flush();jc(Fn,"beforeunload",i,{capture:!1}),jc(Fn,"pagehide",i,{capture:!1}),this.da=r=>{if(this.Qo&&(!r.storageArea||r.storageArea===Fn?.localStorage)&&r.key)if(r.key!==this.la){if(this.Ko){const s=aV.find(a=>r.key===this.va(a));s&&this.fa(r.key,s)}}else this.fa(r.key,Um)},jc(Fn,"storage",this.da)}}markCrossTabFeatureFlagChanges(e){Object.entries(e).forEach(([n,o])=>{const i=this.ta.get(n);if(!v2e(n)||i===!0)return;if(o===!0)return void this.pa(n,!0);const r=new Set(i||[]);o.forEach(s=>r.add(s)),r.size&&this.pa(n,r)})}onCrossTabFeatureFlagChange(e){return this.ra.add(e),()=>this.ra.delete(e)}destroy(){this.da&&Fn&&(Fn.removeEventListener("storage",this.da),this.da=void 0),this.ra.clear()}fa(e,n,o=!0){if(this.hi)return!1;let i,r;try{if(r=uc.Ot(e),ad(r)){const A=this.ga(n);return A.storageValue=null,n!==Um&&(A.persisted=!1),!1}i=kk(r)}catch{return!1}const s=n===Um?i:uc.Dt(this.la);if(s&&this.ma(s))return!1;const a=this.ya(i,n,o);return n===Um&&this.Ko&&!lQ(this.ba().main,i)||this._a(i,n,!0,r),a}ma(e){const n=this.props[T4],o=e[T4];return!Eo(n)&&!Eo(o)&&n!==o}_a(e,n,o,i){const r=this.ga(n);r.storageValue=i,n!==Um&&(r.persisted=o);try{r.fingerprint=this.wa(e,n)}catch{r.fingerprint=void 0}}ya(e,n,o){let i=!1;return E8.forEach(r=>{var s;const a=(s=Kf(r))===null||s===void 0?void 0:s.storageGroup;if(n===Um&&this.Ko&&a||n!==Um&&a!==n)return;const A=r in e,c=this.ka(r,A?e[r]:void 0),l=this.ta.has(r)?r in this.props:A;l===r in this.props&&lQ(c,this.props[r])||(l?this.Sa(r,c,!1):this.xa(r,!1),i=!0)}),i&&o&&this.ra.forEach(r=>r()),i}Ca(){if(!this.Qo)return!1;try{this.na=!1;const e=uc.Ot(this.la),n=this.ga(Um);let o,i=!1,r=!1;if(e!==n.storageValue)if(ad(e))n.storageValue=null;else{if(o=kk(e),this.na=!this.ia&&this.ma(o),this.na)return!1;r=this.ya(o,Um,!1),!this.Ko||lQ(this.ba().main,o)?this._a(o,Um,!0,e):n.storageValue=e,i=!0}return this.Ko&&aV.forEach(s=>{const a=uc.Ot(this.va(s)),A=this.ga(s),c=o||{},l=i&&E8.some(u=>{var h;return((h=Kf(u))===null||h===void 0?void 0:h.storageGroup)===s&&u in c});if(a===A.storageValue&&!l)return;if(ad(a))return A.storageValue=null,A.persisted=!1,void(l&&(r=this.ya(c,s,!1)||r));const g=kk(a);r=this.ya(g,s,!1)||r,this._a(g,s,!0,a)}),r}catch{return!1}}pa(e,n){this.ta.set(e,n);const o=Kf(e);o?.volatile||(this.ga((this.Ko?o?.storageGroup:void 0)||Um).fingerprint=void 0,this.$a(e))}Ta(){E8.forEach(e=>this.ta.set(e,!0))}ca(){if(this.Qo)try{const e=uc.Ot(this.la),n=kk(e);this.ga(Um).storageValue=e,E8.forEach(o=>{var i;const r=this.Ko?(i=Kf(o))===null||i===void 0?void 0:i.storageGroup:void 0,s=r?uc.Ot(this.va(r)):null;if(r){const A=this.ga(r);A.storageValue=s,A.persisted=!ad(s)}const a=r&&!ad(s)?kk(s):n;o in this.props?this.Ia(o,a[o],this.props[o]):o in a&&this.pa(o,!0)})}catch{}}ka(e,n){const o=this.ta.get(e);if(!o)return n;if(o===!0)return this.props[e];if(e==="$active_feature_flags"){const s=new Set(As(n)?n:[]),a=new Set(As(this.props[e])?this.props[e]:[]);return o.forEach(A=>a.has(A)?s.add(A):s.delete(A)),Array.from(s)}const i=xA(n)?sn({},n):{},r=xA(this.props[e])?this.props[e]:{};return o.forEach(s=>{s in r?i[s]=r[s]:delete i[s]}),i}Ia(e,n,o){if(!v2e(e))return;const i=this.ta.get(e);if(i===!0)return;let r=n;if(this.Qo)try{var s;const A=this.Ko?(s=Kf(e))===null||s===void 0?void 0:s.storageGroup:void 0,c=A?this.va(A):this.la;r=kk(uc.Ot(c))[e]}catch{}const a=new Set(i||[]);if(e==="$active_feature_flags"){if(!Eo(n)&&!As(n)||!Eo(r)&&!As(r)||!As(o))return void this.pa(e,!0);const A=new Set(n||[]),c=new Set(r||[]),l=new Set(o);new Set([...A,...l]).forEach(g=>{A.has(g)!==l.has(g)&&a.add(g)}),a.forEach(g=>{c.has(g)===l.has(g)&&a.delete(g)})}else{if(!xA(o))return void(lQ(r,o)?this.ta.delete(e):this.pa(e,!0));{if(!Eo(n)&&!xA(n)||Eo(n)&&nx(o)&&Eo(r))return void this.pa(e,!0);const A=xA(n)?n:{},c=xA(r)?r:{};new Set([...Object.keys(A),...Object.keys(o)]).forEach(l=>{l in A==l in o&&lQ(A[l],o[l])||a.add(l)}),a.forEach(l=>{l in c==l in o&&lQ(c[l],o[l])&&a.delete(l)})}}a.size?this.pa(e,a):this.ta.delete(e)}Ma(){var e;const n=(e=this.Mr)===null||e===void 0?void 0:e.persistence_save_debounce_ms;return jd(n)&&n>0?n:0}Ea(e){if(this.Mr.cookieWinsOnConflict&&this.Mr.persistence.toLowerCase()==="localstorage+cookie")if(e)try{const n=f2e(e,this.Mr.cookie_persisted_properties||[]),o=Cst(n,this.Mr.cookie_persisted_properties||[]),i=JSON.stringify(n)+"|"+JSON.stringify(o),r=cd.Ot(this.la)||void 0;r&&I2e(this.la,r)===i&&(this.Pa=i,this.Ra=r)}catch{}else try{const n=cd.Ot(this.la)||void 0;this.Pa=n?I2e(this.la,n):void 0,this.Ra=n}catch{}}syncCookieProperties(){return this.Aa(this.Mr)}Aa(e,n=!1){if(this.hi&&!n||this.Yo||!e.cookieWinsOnConflict||e.persistence.toLowerCase()!=="localstorage+cookie")return!1;let o;try{o=cd.Ot(this.la)||void 0}catch{}if(!o||o===this.Ra)return!1;const i=I2e(this.la,o);let r;try{r=_2e(JSON.parse(o))}catch{return!1}if((cd.Ot(this.la)||void 0)!==o)return!1;this.Pa=i,this.Ra=o;const s=yst(this.la,o),a=[...NM,...s.properties],A={};if(Object.keys(r).forEach(m=>{const _=r[m];(Eo(_)||ad(_)||_===""||m==="$user_state"&&_!=="anonymous"&&_!=="identified")&&(A[m]=!0,delete r[m])}),nx(r))return!1;const c="distinct_id"in r||r.$user_state==="anonymous"||r.$user_state==="identified",l=this.props,g=l[T4],u=l[py],h=jg({},l);[...NM,...e.cookie_persisted_properties||[]].forEach(m=>{if(a.indexOf(m)!==-1&&!(m in r)&&!A[m]&&(c||m!=="distinct_id"&&m!=="$user_state")){const _=h[m];(s.isValid||NM.indexOf(m)===-1||_!==!1&&_!==0)&&delete h[m]}}),this.props=jg(h,r),E8.forEach(m=>{const _=m in this.props;m in l===_&&lQ(l[m],this.props[m])||(_?this.Ia(m,l[m],this.props[m]):this.pa(m,!0))}),!c||"$user_state"in r||"$user_state"in this.props||this.Sa(py,y8);const d=this.props[T4],p=this.props[py];return!c||d===g&&p===u||(this.ia=!0,this.Xo=!0,Z0.$t(sne(this.la),!0),this.xa(sQ),this.xa(C8),this.xa(k4),this.xa(PM),this.xa(rQ),this.xa(MM),this.xa(cQ),this.xa($K),this.xa(AQ),p!=="anonymous"||u!=="identified"&&r.$user_state!=="anonymous"&&(Eo(g)||d===g)||(oat(this.props,r),this.xa(aQ)),p==="identified"?this.props.$user_id=d:delete this.props.$user_id,this.xa(Xte)),!0}consumeCookieIdentityChange(){const e=sne(this.la),n=this.Xo||!!Z0.Ot(e);return this.Xo=!1,n&&Z0.Lt(e),n}Fa(e=!1){return!(this.Yo||this.hi&&!e||!this.Mr.cookieWinsOnConflict||this.Mr.persistence.toLowerCase()!=="localstorage+cookie"||(this.Yo=!0,0))}Oa(){this.Yo&&(Eo(this.Da)||(clearTimeout(this.Da),this.Da=void 0),delete this.Zo[Um],this.La(!0))}Na(e=!0){if(this.Yo)try{e?this.Oa():Eo(this.Da)||(clearTimeout(this.Da),this.Da=void 0)}finally{this.Yo=!1}}isDisabled(){return!!this.hi}ua(e){GBn.indexOf(e.persistence.toLowerCase())===-1&&(gi.critical("Unknown persistence type "+e.persistence+"; falling back to localStorage+cookie"),e.persistence="localStorage+cookie");const n=((a=[],A=!1)=>{const c=[...NM,...a];return sn(sn({},uc),{},{Dt(l){try{let u,h={};try{u=cd.Ot(l)||void 0,h=u?_2e(JSON.parse(u)):{}}catch{}const d=JSON.parse(uc.Ot(l)||"{}");let p;if(A){const m=yst(l,u),_=[...NM,...m.properties],f={};Object.keys(h).forEach(C=>{const y=h[C];ad(y)||y===""||C==="$user_state"&&y!=="anonymous"&&y!=="identified"||(f[C]=y)});const I="distinct_id"in f||f.$user_state==="anonymous"||f.$user_state==="identified";if(Object.keys(f).length>0){var g;const C=d[T4],y=(g=d.$user_state)!==null&&g!==void 0?g:y8;c.forEach(x=>{if(_.indexOf(x)!==-1&&!(x in h)&&(I||x!=="distinct_id"&&x!=="$user_state")){const E=d[x];(m.isValid||NM.indexOf(x)===-1||E!==!1&&E!==0)&&delete d[x]}}),!I||"$user_state"in h||"$user_state"in d||(d[py]=y8),!I||("distinct_id"in f?f[T4]:d[T4])===C&&("$user_state"in f?f[py]:d[py])===y||(m2e.forEach(x=>delete d[x]),f.$user_state==="identified"&&"distinct_id"in f?d.$user_id=f[T4]:delete d.$user_id,f.$user_state!=="identified"&&(delete d[qrt],delete d[aQ]),delete d.__alias)}p=jg(d,f)}else p=jg(h,d);return uc.$t(l,p),p}catch{}return null},$t(l,g,u,h,d,p){const m=uc.$t(l,g,void 0,void 0,p);try{const _=f2e(g,a);if(Object.keys(_).length){if(A){const f=nne(l),I=Cst(_,a);if(cd.$t(f,I,u,h,d,p),cd.Ot(f)!==JSON.stringify(I)){cd.Lt(f,h);const C=f2e(g);return cd.$t(l,C,u,h,d,p),m}}cd.$t(l,_,u,h,d,p)}}catch(_){uc.Pt(_)}return m},Lt(l,g){try{Fn?.localStorage.removeItem(l),cd.Lt(l,g),cd.Lt(nne(l),g)}catch(u){uc.Pt(u)}}})})(e.cookie_persisted_properties||[],e.cookieWinsOnConflict);let o,i=!1,r=!1;const s=e.persistence.toLowerCase();return s==="localstorage"&&uc.At()?(o=uc,r=!0):s==="localstorage+cookie"&&n.At()?(o=n,r=!0,i=!0):s==="sessionstorage"&&Z0.At()?o=Z0:s==="memory"?o=C2e:s==="cookie"&&cd.At()?(o=cd,i=!0):n.At()?(o=n,r=!0,i=!0):cd.At()?(o=cd,i=!0):o=C2e,this.Qo=r,this.Jo=i,o}va(e){return`${this.la}__${e}`}ha(e){return this.Qo&&!!e.split_storage}properties(){const e={};return vl(this.props,(n,o)=>{const i=Kf(o);if(!i||i.exposure==="event"){var r;if(!(i==null||(r=i.shouldSkipFromEventProperties)===null||r===void 0)&&r.call(i,n))return;e[o]=n}}),e}load(e=!1){if(this.hi&&!e)return;const n=this.Mr.cookieWinsOnConflict&&this.Mr.persistence.toLowerCase()==="localstorage+cookie",o=n?uc.Dt(this.la):null;let i={};if(n)try{i=_2e(cd.Dt(this.la)),vl(i,(A,c)=>{(Eo(A)||ad(A)||A==="")&&delete i[c]})}catch{}const r=this.Lo.Dt(this.la);if(r&&(this.props=jg({},r)),this.Ko&&this.qa(),n&&r){var s,a;const A=o?.[T4],c=(s=o?.$user_state)!==null&&s!==void 0?s:y8,l=r[T4],g=(a=r.$user_state)!==null&&a!==void 0?a:y8;if(l!==A||g!==c){this.Xo=!0,Z0.$t(sne(this.la),!0);const u=jg({},this.props);m2e.forEach(d=>delete u[d]),g!=="anonymous"||c!=="identified"&&i.$user_state!=="anonymous"&&(Eo(A)||l===A)||(oat(u,i),delete u[aQ]),this.props=u;const h=new Set;m2e.forEach(d=>{var p;const m=(p=Kf(d))===null||p===void 0?void 0:p.storageGroup;m&&h.add(m)}),h.forEach(d=>{const p={};vl(this.props,(m,_)=>{var f;((f=Kf(_))===null||f===void 0?void 0:f.storageGroup)===d&&(p[_]=m)}),nx(p)?(uc.Lt(this.va(d)),this.Zo[d]={}):uc.$t(this.va(d),p)&&(this.Zo[d]={persisted:!0,fingerprint:this.wa(p,d)})})}}Z0.Ot(sne(this.la))&&(this.Xo=!0)}qa(){for(const e of aV){const n=uc.Dt(this.va(e));if(n&&!nx(n)){const o=this.ga(e);o.persisted=!0,this.ja(e)||(o.fingerprint=this.wa(n,e)),this.Ba(e,n)||jg(this.props,n)}}}ja(e){return Object.keys(this.props).some(n=>{var o;return((o=Kf(n))===null||o===void 0?void 0:o.storageGroup)===e})}Ba(e,n){const o=OBn[e];if(!o)return!1;const i=n[o],r=this.props[o];return jd(i)&&jd(r)&&r>i}refreshKey(e){var n;if(this.hi||this.sa.has(e))return;const o=this.Ko?(n=Kf(e))===null||n===void 0?void 0:n.storageGroup:void 0,i=o?uc.Dt(this.va(o)):this.Lo.Dt(this.la);if(i&&e in i)this.Sa(e,i[e],!1);else{if(o){const r=this.Lo.Dt(this.la);if(r&&e in r)return void this.Sa(e,r[e],!1)}this.xa(e,!1)}}save(){if(this.hi)return;const e=this.Ma();e>0?Eo(this.Da)&&(this.Da=setTimeout(()=>{this.Da=void 0,this.La()},e)):this.La()}flush(){Eo(this.Da)||(clearTimeout(this.Da),this.Da=void 0,this.La())}La(e=!1){if(this.hi||this.Yo&&!e)return;e||(this.syncCookieProperties(),this.Mr.cookieWinsOnConflict&&this.Mr.persistence.toLowerCase()==="localstorage+cookie"||tat.forEach(r=>this.refreshKey(r)));const n=!e&&!this.ea;n||(this.na=!1);const o=!!n&&this.Ca();if(this.na)return void(this.Mr.debug&&gi.warn("skipping persistence write because storage belongs to a different distinct ID"));if(this.Ko)return this.Ha(),void(o&&this.ra.forEach(r=>r()));const i=this.za(this.Lo,this.la,this.props,Um);i==="written"&&this.Ea(this.props),i!=="failed"&&(this.ta.clear(),this.ia=!1,this.sa.clear()),o&&this.ra.forEach(r=>r())}Ha(){const{main:e,groups:n}=this.ba(),o=this.za(this.Lo,this.la,e,Um);o==="written"&&this.Ea(e),o!=="failed"&&(this.ia=!1,this.sa.clear(),E8.forEach(r=>{var s;!((s=Kf(r))===null||s===void 0)&&s.storageGroup||this.ta.delete(r)}));for(const r of aV){var i;const s=n[r];if(nx(s)&&!(!((i=this.Zo[r])===null||i===void 0)&&i.persisted)){E8.forEach(A=>{var c;((c=Kf(A))===null||c===void 0?void 0:c.storageGroup)===r&&this.ta.delete(A)});continue}const a=this.za(uc,this.va(r),s,r);a!=="failed"&&E8.forEach(A=>{const c=Kf(A);c?.storageGroup!==r||a!=="written"&&c.volatile||this.ta.delete(A)})}}ba(){const e={},n={flags:{},surveys:{}};return vl(this.props,(o,i)=>{var r;const s=(r=Kf(i))===null||r===void 0?void 0:r.storageGroup;s?n[s][i]=o:e[i]=o}),{main:e,groups:n}}wa(e,n){if(n===Um)return JSON.stringify(e)+"|"+this.Ua+"|"+this.Wa+"|"+this.Va;const o={};return vl(e,(i,r)=>{var s;o[r]=!((s=Kf(r))===null||s===void 0)&&s.volatile?"__volatile__":i}),JSON.stringify(o)}za(e,n,o,i){const r=this.ga(i);if(i!==Um&&!r.dirty&&!Eo(r.fingerprint))return"skipped";let s;try{if(s=this.wa(o,i),s===r.fingerprint)return r.dirty=!1,"skipped"}catch{s=void 0}return e.$t(n,o,this.Ua,this.Wa,this.Va,this.Mr.debug)?(r.dirty=!1,i!==Um&&(r.persisted=!0),Eo(s)||(r.fingerprint=s),this.Qo&&(r.storageValue=uc.Ot(n)),"written"):(this.Mr.debug&&gi.warn(`failed to persist storage entry "${n}"; will retry on next save`),"failed")}remove({keepGroupEntries:e=!1}={}){if(this.Ta(),Eo(this.Da)||(clearTimeout(this.Da),this.Da=void 0),this.Lo.Lt(this.la,!1),this.Lo.Lt(this.la,!0),!e&&this.oa)for(const n of aV)uc.Lt(this.va(n));e?delete this.Zo[Um]:this.Zo={},this.Pa=void 0,this.Ra=void 0}clear(){this.remove(),this.props={}}register_once(e,n,o){if(xA(e)){this.syncCookieProperties(),Eo(n)&&(n="None"),this.Ua=Eo(o)?this.Ga:o;let i=!1;if(vl(e,(r,s)=>{this.props.hasOwnProperty(s)&&this.props[s]!==n||(this.Sa(s,r),i=!0)}),i)return this.save(),!0}return!1}register(e,n){if(xA(e)){this.syncCookieProperties(),this.Ua=Eo(n)?this.Ga:n;let o=!1;if(vl(e,(i,r)=>{e.hasOwnProperty(r)&&(this.props[r]!==i||xA(i)||As(i))&&(this.Sa(r,i),o=!0)}),o)return this.save(),!0}return!1}unregister(e){this.syncCookieProperties();const n=typeof e=="string"?[e]:e;let o=!1;for(const i of n)i in this.props&&(this.xa(i),o=!0);o&&this.save()}update_campaign_params(){const e=No?.URL;if(e===this.aa)return;const n=Jst(this.Mr.custom_campaign_params,this.Mr.mask_personal_data_properties,this.Mr.custom_personal_data_properties),o=!nx(d2e(n));return o&&this.register(n),this.aa=e,o?n:void 0}update_search_keyword(){this.register((function(){const e=No?.referrer;return e?jst(e):{}})())}update_referrer_info(){var e;this.register_once({$referrer:Xst(),$referring_domain:No?.referrer&&((e=x8(No.referrer))===null||e===void 0?void 0:e.host)||rne},void 0)}set_initial_person_info(){if(this.props.$initial_campaign_params||this.props.$initial_referrer_info)return;const e=$st(this.Mr.mask_personal_data_properties,this.Mr.custom_personal_data_properties,this.Mr.disable_capture_url_hashes);this.register_once({[Qk]:this.Jo?{r:ane(e.r),u:e.u?ane(e.u):void 0}:e},void 0)}get_initial_props(){const e={};vl([tst,est],o=>{const i=this.props[o];i&&vl(i,function(r,s){e["$initial_"+Qye(s)]=r})});const n=this.props[Qk];if(n){const o=(function(i,r=!1){const s=Zst(i,r),a={};return vl(s,function(A,c){a[`$initial_${Qye(c)}`]=A}),a})(n,this.Mr.disable_capture_url_hashes);jg(e,o)}return e}safe_merge(e){return vl(this.props,function(n,o){o in e||(e[o]=n)}),e}update_config(e,n,o){const i=e.persistence!==n.persistence,r=!((d,p)=>{if(d.length!==p.length)return!1;const m=[...d].sort(),_=[...p].sort();return m.every((f,I)=>f===_[I])})(e.cookie_persisted_properties||[],n.cookie_persisted_properties||[]),s=i||r,a=e.cookieWinsOnConflict!==n.cookieWinsOnConflict,A=e.disable_persistence||!!o,c=!!this.hi&&!A;A||this.Aa(n,c),this.Mr=e,!A&&(i||r||a)&&(this.Pa=void 0,this.Ra=void 0,this.Aa(sn(sn({},e),{},{cookie_persisted_properties:n.cookie_persisted_properties}),c));const l=s||a?this.ua(e):this.Lo;this.Za();const g=this.ha(e),u=s||g!==this.Ko,h=!A&&(u||e.cross_subdomain_cookie!==this.Wa||e.secure_cookie!==this.Va)&&this.Fa(c);this.ea=u;try{if(this.Ga=this.Ua=e.cookie_expiration,this.set_disabled(A),this.set_cross_subdomain(e.cross_subdomain_cookie),this.set_secure(e.secure_cookie),u){const d=this.props;this.clear(),this.Lo=l,this.Ko=g,this.props=d,this.save()}else a&&(this.Lo=l,A||(delete this.Zo[Um],this.La()))}finally{this.ea=!1,h&&this.Na()}}Za(){const e=this.props[Qk];if(!this.Jo||!xA(e)||typeof e.r!="string")return;const n=ane(e.r),o=typeof e.u=="string"?ane(e.u):e.u;n===e.r&&o===e.u||this.Sa(Qk,sn(sn({},e),{},{r:n,u:o}))}set_disabled(e){this.hi=e,this.hi?this.remove():this.save()}set_cross_subdomain(e){e!==this.Wa&&(this.Wa=e,this.remove({keepGroupEntries:!0}),this.save())}set_secure(e){e!==this.Va&&(this.Va=e,this.remove({keepGroupEntries:!0}),this.save())}set_event_timer(e,n){const o=this.props.__timers||{};o[e]=n,this.Sa(Xye,o),this.save()}remove_event_timer(e){const n=this.props.__timers||{},o=n[e];return Eo(o)||(delete n[e],this.Sa(Xye,n),this.save()),o}get_property(e){return this.props[e]}set_property(e,n){this.Sa(e,n),this.save()}Sa(e,n,o=!0){var i;const r=this.props[e];this.props[e]=n,o&&(e!=="distinct_id"&&e!=="$user_state"||r===n||(this.ia=!0),nat(e)&&!lQ(r,n)&&this.sa.add(e),this.Ia(e,r,n),!((i=Kf(e))===null||i===void 0)&&i.volatile||this.$a(e))}xa(e,n=!0){delete this.props[e],n&&(v2e(e)&&this.pa(e,!0),nat(e)&&this.sa.add(e),this.$a(e))}$a(e){var n;const o=(n=Kf(e))===null||n===void 0?void 0:n.storageGroup;o&&(this.ga(o).dirty=!0)}ga(e){return this.Zo[e]||(this.Zo[e]={})}};const M3={GZipJS:"gzip-js",Base64:"base64"},lV={Activation:"events",Cancellation:"cancelEvents"},P2e={Popover:"popover",API:"api",Widget:"widget"},D3={SHOWN:"survey shown",DISMISSED:"survey dismissed",SENT:"survey sent"},M2e={SURVEY_ID:"$survey_id",SURVEY_ITERATION:"$survey_iteration",SURVEY_LAST_SEEN_DATE:"$survey_last_seen_date"},D2e={Popover:"popover",Inline:"inline"};function Ane(t){let e=!0;return{dispose(){if(e){e=!1;const n=t();n&&L_(n.then)&&n.then(void 0,()=>{})}}}}const YBn={SHOWN:"product tour shown"},iat={TOUR_LAST_SEEN_DATE:"$product_tour_last_seen_date",TOUR_TYPE:"$product_tour_type"},rat=Ad("[RateLimiter]");var UBn=class{constructor(e){this.serverLimits={},this.lastEventRateLimited=!1,this.checkForLimiting=n=>{const o=n.text;if(o&&o.length)try{(JSON.parse(o).quota_limited||[]).forEach(i=>{rat.info(`${i||"events"} is quota limited.`),this.serverLimits[i]=new Date().getTime()+6e4})}catch(i){return void rat.warn(`could not rate limit - continuing. Error: "${i?.message}"`,{text:o})}},this.instance=e,this.lastEventRateLimited=this.clientRateLimitContext(!0).isRateLimited}get captureEventsPerSecond(){var e;return((e=this.instance.config.rate_limiting)===null||e===void 0?void 0:e.events_per_second)||10}get captureEventsBurstLimit(){var e;return Math.max(((e=this.instance.config.rate_limiting)===null||e===void 0?void 0:e.events_burst_limit)||10*this.captureEventsPerSecond,this.captureEventsPerSecond)}clientRateLimitContext(e=!1){var n,o,i;const{captureEventsBurstLimit:r,captureEventsPerSecond:s}=this,a=new Date().getTime(),A=(n=(o=this.instance.persistence)===null||o===void 0?void 0:o.get_property("$capture_rate_limit"))!==null&&n!==void 0?n:{tokens:r,last:a};A.tokens+=(a-A.last)/1e3*s,A.last=a,A.tokens>r&&(A.tokens=r);const c=1>A.tokens;if(c||e||(A.tokens=Math.max(0,A.tokens-1)),c&&!e){const l=(jd(A.dropped)?A.dropped:0)+1;A.dropped=l,!this.lastEventRateLimited&&this.Qa(l)&&(A.dropped=0)}return this.lastEventRateLimited=c,(i=this.instance.persistence)===null||i===void 0||i.set_property("$capture_rate_limit",A),{isRateLimited:c,remainingTokens:A.tokens}}Ja(e){const n=this.instance.config.property_denylist;return!As(n)||!n.includes(e)}Ka(){var e;if(this.Ja("$current_url")&&this.Ja("$pathname")&&sd?.pathname)return`${(e=sd.origin)!==null&&e!==void 0?e:""}${sd.pathname}`}Qa(e){var n,o;const{captureEventsBurstLimit:i,captureEventsPerSecond:r}=this,s=this.Ka(),a=this.Ja("$session_id")?(n=(o=this.instance).get_session_id)===null||n===void 0?void 0:n.call(o):void 0,A=[`${e} event(s) dropped since the last warning`,s?`triggered on ${s}`:void 0,a?`session ${a}`:void 0].filter(Boolean).join(", ");return!!this.instance.capture("$$client_ingestion_warning",{$$client_ingestion_warning_message:`posthog-js client rate limited: ${A}. Config is set to ${r} events per second and ${i} events burst limit.`},{skip_client_rate_limiting:!0})}isServerRateLimited(e){const n=this.serverLimits[e||"events"]||!1;return n!==!1&&new Date().getTime()<n}};const gQ=Ad("[RemoteConfig]");var sat=class{constructor(e){this._instance=e}get remoteConfig(){var e;return(e=Ur._POSTHOG_REMOTE_CONFIG)===null||e===void 0||(e=e[this._instance.config.token])===null||e===void 0?void 0:e.config}Xa(e){var n,o,i;!((n=Ur.__PosthogExtensions__)===null||n===void 0)&&n.loadExternalDependency?(o=Ur.__PosthogExtensions__)===null||o===void 0||(i=o.loadExternalDependency)===null||i===void 0||i.call(o,this._instance,"remote-config",()=>e(this.remoteConfig)):e()}Ya(e){this._instance._send_request({method:"GET",url:this._instance.requestRouter.endpointFor("assets",`/array/${this._instance.config.token}/config`),callback:e})}load(){try{if(this.remoteConfig)return gQ.info("Using preloaded remote config",this.remoteConfig),void this.tl(this.remoteConfig);if(this._instance.el())return void gQ.warn("Remote config is disabled. Falling back to local config.");this.Xa(e=>{if(!e)return gQ.info("No config found after loading remote JS config. Falling back to JSON."),void this.Ya(n=>{this.tl(n.json,n)});this.tl(e)})}catch(e){gQ.error("Error loading remote config",e),this.tl()}}tl(e,n){!e&&n&&(n.statusCode===0?n.error||gQ.warn("Failed to fetch remote config from PostHog."):gQ.error("Failed to fetch remote config from PostHog."));try{this._instance.tl(e?{ok:!0,config:e}:{ok:!1})}catch(i){gQ.error("Error applying remote config",i)}if(e?.hasFeatureFlags!==!1&&!this._instance.config.advanced_disable_feature_flags_on_first_load)try{var o;(o=this._instance.featureFlags)===null||o===void 0||o.ensureFlagsLoaded()}catch(i){gQ.error("Error loading feature flags",i)}}},h5=Uint8Array,ox=Uint16Array,Fk=Uint32Array,N2e=new h5([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]),R2e=new h5([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]),aat=new h5([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Aat=function(t,e){for(var n=new ox(31),o=0;31>o;++o)n[o]=e+=1<<t[o-1];var i=new Fk(n[30]);for(o=1;30>o;++o)for(var r=n[o];n[o+1]>r;++r)i[r]=r-n[o]<<5|o;return[n,i]},cat=Aat(N2e,2),T2e=cat[1];cat[0][28]=258,T2e[258]=28;for(var lat=Aat(R2e,0)[1],gat=new ox(32768),ld=0;32768>ld;++ld){var Lk=(43690&ld)>>>1|(21845&ld)<<1;gat[ld]=((65280&(Lk=(61680&(Lk=(52428&Lk)>>>2|(13107&Lk)<<2))>>>4|(3855&Lk)<<4))>>>8|(255&Lk)<<8)>>>1}var gV=function(t,e,n){for(var o=t.length,i=0,r=new ox(e);o>i;++i)++r[t[i]-1];var s,a=new ox(e);for(i=0;e>i;++i)a[i]=a[i-1]+r[i-1]<<1;for(s=new ox(o),i=0;o>i;++i)s[i]=gat[a[t[i]-1]++]>>>15-t[i];return s},TM=new h5(288);for(ld=0;144>ld;++ld)TM[ld]=8;for(ld=144;256>ld;++ld)TM[ld]=9;for(ld=256;280>ld;++ld)TM[ld]=7;for(ld=280;288>ld;++ld)TM[ld]=8;var cne=new h5(32);for(ld=0;32>ld;++ld)cne[ld]=5;var KBn=gV(TM,9),VBn=gV(cne,5),uat=function(t){return(t/8|0)+(7&t&&1)},dat=function(t,e,n){(n==null||n>t.length)&&(n=t.length);var o=new(t instanceof ox?ox:t instanceof Fk?Fk:h5)(n-e);return o.set(t.subarray(e,n)),o},B8=function(t,e,n){var o=e/8|0;t[o]|=n<<=7&e,t[o+1]|=n>>>8},uV=function(t,e,n){var o=e/8|0;t[o]|=n<<=7&e,t[o+1]|=n>>>8,t[o+2]|=n>>>16},k2e=function(t,e){for(var n=[],o=0;t.length>o;++o)t[o]&&n.push({s:o,f:t[o]});var i=n.length,r=n.slice();if(!i)return[new h5(0),0];if(i==1){var s=new h5(n[0].s+1);return s[n[0].s]=1,[s,1]}n.sort(function(y,x){return y.f-x.f}),n.push({s:-1,f:25001});var a=n[0],A=n[1],c=0,l=1,g=2;for(n[0]={s:-1,f:a.f+A.f,l:a,r:A};l!=i-1;)a=n[n[g].f>n[c].f?c++:g++],A=n[c!=l&&n[g].f>n[c].f?c++:g++],n[l++]={s:-1,f:a.f+A.f,l:a,r:A};var u=r[0].s;for(o=1;i>o;++o)r[o].s>u&&(u=r[o].s);var h=new ox(u+1),d=F2e(n[l-1],h,0);if(d>e){o=0;var p=0,m=d-e,_=1<<m;for(r.sort(function(y,x){return h[x.s]-h[y.s]||y.f-x.f});i>o;++o){var f=r[o].s;if(e>=h[f])break;p+=_-(1<<d-h[f]),h[f]=e}for(p>>>=m;p>0;){var I=r[o].s;e>h[I]?p-=1<<e-h[I]++-1:++o}for(;o>=0&&p;--o){var C=r[o].s;h[C]==e&&(--h[C],++p)}d=e}return[new h5(h),d]},F2e=function(t,e,n){return t.s==-1?Math.max(F2e(t.l,e,n+1),F2e(t.r,e,n+1)):e[t.s]=n},hat=function(t){for(var e=t.length;e&&!t[--e];);for(var n=new ox(++e),o=0,i=t[0],r=1,s=function(A){n[o++]=A},a=1;e>=a;++a)if(t[a]==i&&a!=e)++r;else{if(!i&&r>2){for(;r>138;r-=138)s(32754);r>2&&(s(r>10?r-11<<5|28690:r-3<<5|12305),r=0)}else if(r>3){for(s(i),--r;r>6;r-=6)s(8304);r>2&&(s(r-3<<5|8208),r=0)}for(;r--;)s(i);r=1,i=t[a]}return[n.subarray(0,o),e]},dV=function(t,e){for(var n=0,o=0;e.length>o;++o)n+=t[o]*e[o];return n},L2e=function(t,e,n){var o=n.length,i=uat(e+2);t[i]=255&o,t[i+1]=o>>>8,t[i+2]=255^t[i],t[i+3]=255^t[i+1];for(var r=0;o>r;++r)t[i+r+4]=n[r];return 8*(i+4+o)},pat=function(t,e,n,o,i,r,s,a,A,c,l){B8(e,l++,n),++i[256];for(var g=k2e(i,15),u=g[0],h=g[1],d=k2e(r,15),p=d[0],m=d[1],_=hat(u),f=_[0],I=_[1],C=hat(p),y=C[0],x=C[1],E=new ox(19),B=0;f.length>B;++B)E[31&f[B]]++;for(B=0;y.length>B;++B)E[31&y[B]]++;for(var S=k2e(E,7),Q=S[0],w=S[1],M=19;M>4&&!Q[aat[M-1]];--M);var k,R,F,O,U=c+5<<3,Y=dV(i,TM)+dV(r,cne)+s,J=dV(i,u)+dV(r,p)+s+14+3*M+dV(E,Q)+(2*E[16]+3*E[17]+7*E[18]);if(Y>=U&&J>=U)return L2e(e,l,t.subarray(A,A+c));if(B8(e,l,1+(Y>J)),l+=2,Y>J){k=gV(u,h),R=u,F=gV(p,m),O=p;var ee=gV(Q,w);for(B8(e,l,I-257),B8(e,l+5,x-1),B8(e,l+10,M-4),l+=14,B=0;M>B;++B)B8(e,l+3*B,Q[aat[B]]);l+=3*M;for(var W=[f,y],q=0;2>q;++q){var ie=W[q];for(B=0;ie.length>B;++B)B8(e,l,ee[se=31&ie[B]]),l+=Q[se],se>15&&(B8(e,l,ie[B]>>>5&127),l+=ie[B]>>>12)}}else k=KBn,R=TM,F=VBn,O=cne;for(B=0;a>B;++B)if(o[B]>255){var se;uV(e,l,k[257+(se=o[B]>>>18&31)]),l+=R[se+257],se>7&&(B8(e,l,o[B]>>>23&31),l+=N2e[se]);var oe=31&o[B];uV(e,l,F[oe]),l+=O[oe],oe>3&&(uV(e,l,o[B]>>>5&8191),l+=R2e[oe])}else uV(e,l,k[o[B]]),l+=R[o[B]];return uV(e,l,k[256]),l+R[256]},zBn=new Fk([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),JBn=(function(){for(var t=new Fk(256),e=0;256>e;++e){for(var n=e,o=9;--o;)n=(1&n&&3988292384)^n>>>1;t[e]=n}return t})(),H2e=function(t,e,n){for(;n;++e)t[e]=n,n>>>=8};function WBn(t,e){e===void 0&&(e={});var n=(function(){var g=4294967295;return{p(u){for(var h=g,d=0;u.length>d;++d)h=JBn[255&h^u[d]]^h>>>8;g=h},d(){return 4294967295^g}}})(),o=t.length;n.p(t);var i,r,s,a,A,c=(a=10+((i=e).filename&&i.filename.length+1||0),A=8,(function(g,u,h,d,p,m){var _=g.length,f=new h5(d+_+5*(1+Math.floor(_/7e3))+p),I=f.subarray(d,f.length-p),C=0;if(!u||8>_)for(var y=0;_>=y;y+=65535){var x=y+65535;_>x?C=L2e(I,C,g.subarray(y,x)):(I[y]=m,C=L2e(I,C,g.subarray(y,_)))}else{for(var E=zBn[u-1],B=E>>>13,S=8191&E,Q=(1<<h)-1,w=new ox(32768),M=new ox(Q+1),k=Math.ceil(h/3),R=2*k,F=function(Ce){return(g[Ce]^g[Ce+1]<<k^g[Ce+2]<<R)&Q},O=new Fk(25e3),U=new ox(288),Y=new ox(32),J=0,ee=0,W=(y=0,0),q=0,ie=0;_>y;++y){var se=F(y),oe=32767&y,ge=M[se];if(w[oe]=ge,M[se]=oe,y>=q){var ue=_-y;if((J>7e3||W>24576)&&ue>423){C=pat(g,I,0,O,U,Y,ee,W,ie,y-ie,C),W=J=ee=0,ie=y;for(var Ie=0;286>Ie;++Ie)U[Ie]=0;for(Ie=0;30>Ie;++Ie)Y[Ie]=0}var le=2,_e=0,me=S,ye=oe-ge&32767;if(ue>2&&se==F(y-ye))for(var ve=Math.min(B,ue)-1,Pe=Math.min(32767,y),he=Math.min(258,ue);Pe>=ye&&--me&&oe!=ge;){if(g[y+le]==g[y+le-ye]){for(var Qe=0;he>Qe&&g[y+Qe]==g[y+Qe-ye];++Qe);if(Qe>le){if(le=Qe,_e=ye,Qe>ve)break;var we=Math.min(ye,Qe-2),Me=0;for(Ie=0;we>Ie;++Ie){var He=y-ye+Ie+32768&32767,Re=He-w[He]+32768&32767;Re>Me&&(Me=Re,ge=He)}}}ye+=(oe=ge)-(ge=w[oe])+32768&32767}if(_e){O[W++]=268435456|T2e[le]<<18|lat[_e];var Be=31&T2e[le],ke=31&lat[_e];ee+=N2e[Be]+R2e[ke],++U[257+Be],++Y[ke],q=y+le,++J}else O[W++]=g[y],++U[g[y]]}}C=pat(g,I,m,O,U,Y,ee,W,ie,y-ie,C)}return dat(f,0,d+uat(C)+p)})(r=t,(s=e).level==null?6:s.level,s.mem==null?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(r.length)))):12+s.mem,a,A,!0)),l=c.length;return(function(g,u){var h=u.filename;if(g[0]=31,g[1]=139,g[2]=8,g[8]=2>u.level?4:u.level==9?2:0,g[9]=3,u.mtime!=0&&H2e(g,4,Math.floor(new Date(u.mtime||Date.now())/1e3)),h){g[3]=8;for(var d=0;h.length>=d;++d)g[d+10]=h.charCodeAt(d)}})(c,e),H2e(c,l-8,n.d()),H2e(c,l-4,o),c}const jBn=!!bye||!!OK,mat=new WeakMap,_at="text/plain";let O2e=0,lne=!1;const fat=(t,e)=>{const[n,o]=t.split("#"),[i,r]=n.split("?");if(!r)return t;const s=r.split("&").filter(a=>a.split("=")[0]!==e).join("&");return`${i}${s?`?${s}`:""}${o?`#${o}`:""}`},hV=(t,e,n=!0)=>{var o;const[i,r]=t.split("?"),s=sn({},e),a=(o=r?.split("&").map(c=>{var l;const[g,u]=c.split("="),h=n&&(l=s[g])!==null&&l!==void 0?l:u;return delete s[g],`${g}=${h}`}))!==null&&o!==void 0?o:[],A=(function(c,l="&"){let g,u;const h=[];return vl(c,function(d,p){Eo(d)||Eo(p)||p==="undefined"||(g=encodeURIComponent((m=>m instanceof File)(d)?d.name:d.toString()),u=encodeURIComponent(p),h[h.length]=u+"="+g)}),h.join(l)})(s);return A&&a.push(A),a.length>0?`${i}?${a.join("&")}`:i},G2e=t=>{if(t.il)return t.il;const{data:e,compression:n}=t;if(!e)return;if(n===M3.GZipJS){const i=WBn((function(r){var s=r.length;if(typeof TextEncoder<"u")return new TextEncoder().encode(r);for(var a=new h5(r.length+(r.length>>>1)),A=0,c=function(h){a[A++]=h},l=0;s>l;++l){if(A+5>a.length){var g=new h5(A+8+(s-l<<1));g.set(a),a=g}var u=r.charCodeAt(l);128>u?c(u):2048>u?(c(192|u>>>6),c(128|63&u)):u>55295&&57344>u?(c(240|(u=65536+(1047552&u)|1023&r.charCodeAt(++l))>>>18),c(128|u>>>12&63),c(128|u>>>6&63),c(128|63&u)):(c(224|u>>>12),c(128|u>>>6&63),c(128|63&u))}return dat(a,0,A)})(Nk(e)),{mtime:0});return{contentType:_at,body:i.buffer.slice(i.byteOffset,i.byteOffset+i.byteLength),estimatedSize:i.byteLength}}if(n===M3.Base64){const i=(function(s){return s&&btoa(encodeURIComponent(s).replace(/%([0-9A-F]{2})/g,(a,A)=>String.fromCharCode(parseInt(A,16))))})(Nk(e)),r=(s=>"data="+encodeURIComponent(typeof s=="string"?s:Nk(s)))(i);return{contentType:"application/x-www-form-urlencoded",body:r,estimatedSize:new Blob([r]).size}}const o=Nk(e);return{contentType:"application/json",body:o,estimatedSize:new Blob([o]).size}},Iat=t=>{const e=()=>t.transport==="sendBeacon"?{url:hV(t.url,{compression:M3.Base64}),encodedBody:G2e(sn(sn({},t),{},{compression:M3.Base64,il:void 0}))}:{url:fat(t.url,"compression"),encodedBody:G2e(sn(sn({},t),{},{compression:void 0,il:void 0}))};let n;try{n=G2e(t)}catch(i){if(brt(t.compression,Rk(t.url,"compression")))return gi.error("Failed to gzip request body, sending uncompressed payload",i),e();throw i}return n&&brt(t.compression,Rk(t.url,"compression"))&&!((o=n.body)instanceof ArrayBuffer?Kye(new Uint8Array(o)):ArrayBuffer.isView(o)&&Kye(new Uint8Array(o.buffer,o.byteOffset,o.byteLength)))?(lne=!0,e()):{url:t.url,encodedBody:n};var o},Cat=t=>{try{return Iat(t)}catch(n){var e;return gi.error(n),void((e=t.callback)===null||e===void 0||e.call(t,{statusCode:0,error:n}))}},qBn=(function(){var t=Wg(function*(e){const n=yield(function(i){return Vye.apply(this,arguments)})(Nk(e.data),Ym.DEBUG,{rethrow:!0});if(!n)return e;const o=yield n.arrayBuffer();return sn(sn({},e),{},{il:{contentType:_at,body:o,estimatedSize:o.byteLength}})});return function(e){return t.apply(this,arguments)}})(),XBn=/Failed to fetch|NetworkError|Load failed/i,yat=t=>t?.name==="TypeError"&&XBn.test(t?.message||""),xat=t=>{try{const e=(function(n,o=Date.now()){if(typeof n!="string"||!n)return;const i=n.trim(),r=/^\d+\s*,/.test(i)?i.slice(0,i.indexOf(",")).trim():i;if(/^\d+$/.test(r)){const A=1e3*Math.min(Number(r),300);return A>0?A:void 0}if(!/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun)[a-z]*[ ,]/.test(r))return;const s=/^\w{3} \w{3} /.test(r)?r+" GMT":r,a=Date.parse(s)-o;return Number.isFinite(a)&&a>0?Math.min(a,Ute):void 0})(t());return Eo(e)?void 0:Math.min(e,3e4)}catch{return}},Eat=t=>{const e=Cat(t);if(!e)return;const n=new bye;mat.set(n,!0);const{url:o,encodedBody:i}=e;n.open(t.method||"GET",o,!0);const{contentType:r,body:s}=i??{};vl(t.headers,function(a,A){n.setRequestHeader(A,a)}),r&&n.setRequestHeader("Content-Type",r),t.timeout&&(n.timeout=t.timeout),n.onreadystatechange=()=>{if(n.readyState===4){var a;const A={statusCode:n.status,text:n.responseText};if(n.status===200)try{A.json=JSON.parse(n.responseText)}catch{}(a=t.callback)===null||a===void 0||a.call(t,A,xat(()=>n.getResponseHeader("Retry-After")))}},n.send(s)},Bat=t=>{const e=Cat(t);if(!e)return;const{url:n,encodedBody:o}=e,{contentType:i,body:r,estimatedSize:s}=o??{},a=new Headers;vl(t.headers,function(d,p){a.append(p,d)}),i&&a.append("Content-Type",i);let A=null,c=!1;if(yit){const d=new yit;A={signal:d.signal,timeout:setTimeout(()=>{c=!0;try{d.abort(crt("AbortError","PostHog request timed out"+((p=t.timeout)?` after ${p}ms`:"")))}catch(m){g(m)}var p},t.timeout)}}let l=!1;const g=d=>{var p;l||(l=!0,c&&d?.name==="AbortError"||yat(d)?gi.warn(d):gi.error(d),(p=t.callback)===null||p===void 0||p.call(t,{statusCode:0,error:d}))};let u=0;const h=()=>{O2e-=u,u=0,A&&clearTimeout(A.timeout)};try{const d=sn({method:t?.method||"GET",headers:a,referrerPolicy:"strict-origin",body:r,signal:A?.signal},t.fetchOptions),p=s??(Eo(r)?0:void 0);d.keepalive=d.method==="POST"&&!t.nl&&d.keepalive!==!1&&d.body===r&&!Eo(p)&&p>=0&&52428.8>O2e+p,d.keepalive&&(u=p,O2e+=u),OK(n,d).then(m=>m.text().then(_=>{var f;if(l)return;const I={statusCode:m.status,text:_};if(m.status===200)try{I.json=JSON.parse(_)}catch(C){gi.error(C)}l=!0,h(),(f=t.callback)===null||f===void 0||f.call(t,I,xat(()=>m.headers.get("Retry-After")))})).catch(m=>{h(),g(m)}).finally(h)}catch(d){h(),g(d)}},Y2e=t=>{try{var e;const{url:n,encodedBody:o}=Iat(t),{contentType:i,body:r,estimatedSize:s}=o??{};if(!r)return;const a=r instanceof Blob?r:new Blob([r],{type:i});if(F_.sendBeacon(n,a))return;const A=As(t.data)?t.data:(e=t.data)===null||e===void 0?void 0:e.batch;if(As(A)&&A.length>1&&(s??0)>16384){const c=Math.ceil(A.length/2),l=g=>As(t.data)?g:sn(sn({},t.data),{},{batch:g});return Y2e(sn(sn({},t),{},{data:l(A.slice(0,c))})),void Y2e(sn(sn({},t),{},{data:l(A.slice(c))}))}gi.warn(`Beacon of ~${s??0} bytes was rejected by the browser, falling back to ${OK?"fetch":"XHR"}`),OK?Bat(sn(sn({},t),{},{nl:!0})):Eat(t)}catch(n){gi.warn("Beacon send failed",n)}},bat=(t,e,n,o)=>{const i=o==="query"?e==="POST"?"sent_at":"_":void 0;return hV(n===M3.GZipJS?fat(t,"compression"):t,sn(sn({},i?{[i]:Date.now().toString()}:{}),n===M3.GZipJS?{}:{compression:n}))},$Bn=(()=>{const t=[];return OK&&t.push({transport:"fetch",method:Bat}),bye&&t.push({transport:"XHR",method:Eat}),F_?.sendBeacon&&t.push({transport:"sendBeacon",method:Y2e}),t})();let Sat=!jBn&&dy?.indexOf("MSIE")===-1&&dy?.indexOf("Mozilla")===-1;function Qat(t,e,n){var o,i,r;n&&(e=sn(sn({},e),{},{callback:s=>n(s)})),t.__loaded?Sat?t.__request_queue.push(e):t.rateLimiter.isServerRateLimited(e.batchKey)?e.fireCallbackOnDrop&&((i=e.callback)===null||i===void 0||i.call(e,{statusCode:429})):(e.transport=e.transport||t.config.api_transport,e.headers=sn(sn({},t.config.request_headers),e.headers),e.compression=e.compression==="best-available"?(o=t.compression)!==null&&o!==void 0?o:e.compressionFallback:e.compression,(Eo(t.config.disable_beacon)?t.config.__preview_disable_beacon:t.config.disable_beacon)&&(e.disableTransport=["sendBeacon"]),e.fetchOptions=e.fetchOptions||t.config.fetch_options,((s,a)=>{var A,c,l;const g=sn(sn({},s),{},{callback:a??(m=>{var _;return(_=s.callback)===null||_===void 0?void 0:_.call(s,m)})});g.timeout=g.timeout||6e4;const u=(A=g.transport)!==null&&A!==void 0?A:"fetch";u==="sendBeacon"&&Eo(g.compression)&&g.data&&(g.compression=M3.Base64),g.method==="POST"&&g.data&&(g.timestampMode==="capture-body"?g.data=(m=>{var _,f;const I=(As(m)?m:[m]).map(y=>sn(sn({},y),y.timestamp instanceof Date&&!isNaN(y.timestamp.getTime())?{timestamp:y.timestamp.toISOString()}:{})),C=I[0];return{api_key:(_=C==null||(f=C.properties)===null||f===void 0?void 0:f.token)!==null&&_!==void 0?_:C?.token,batch:I,sent_at:new Date().toISOString()}})(g.data):g.timestampMode==="body"&&(g.data=((m,_=new Date().toISOString())=>As(m)?m.map(f=>sn(sn({},f),{},{sent_at:_})):sn(sn({},m),{},{sent_at:_}))(g.data))),g.url=bat(g.url,g.method,g.compression,g.timestampMode);const h=$Bn.filter(m=>!g.disableTransport||!m.transport||!g.disableTransport.includes(m.transport)),d=(c=(l=(function(m,_){for(let f=0;m.length>f;f++)if(_(m[f]))return m[f]})(h,m=>m.transport===u))===null||l===void 0?void 0:l.method)!==null&&c!==void 0?c:h[0].method;if(!d)throw new Error("No available transport method");const p=m=>{try{d(m)}catch(f){var _;yat(f)?gi.warn(f):gi.error(f),(_=g.callback)===null||_===void 0||_.call(g,{statusCode:0,error:f})}};u!=="sendBeacon"&&!g.preferSyncCompression&&g.data&&g.compression===M3.GZipJS&&Y5n&&typeof Promise<"u"&&!lne?qBn(g).then(m=>{p(m)}).catch(m=>{if(Srt(m))return lne=!0,void p(sn(sn({},g),{},{compression:void 0,url:bat(s.url,s.method,void 0,s.timestampMode)}));(_=>{if(!_||typeof _!="object")return!1;const f="name"in _?String(_.name):"";return Srt(_)||f===Brt})(m)&&(lne=!0),p(g)}):p(g)})(e,(s,a)=>{var A,c,l;t.rateLimiter.checkForLimiting(s),400>s.statusCode||(A=(c=t.config).on_request_error)===null||A===void 0||A.call(c,s),n?n(s,a):(l=e.callback)===null||l===void 0||l.call(e,s)})):e.fireCallbackOnDrop&&((r=e.callback)===null||r===void 0||r.call(e,{statusCode:0}))}var ZBn=class{constructor(e,n){this.sl=!0,this.rl=[],this.ol=E9(n?.flush_interval_ms||3e3,250,5e3,gi.createLogger("flush interval"),3e3),this.al=e}enqueue(e){this.rl.push(e),this.ll||this.ul()}unload(){this.hl();const e=this.rl.length>0?this.cl():{},n=Object.values(e);[...n.filter(o=>o.url.indexOf("/e")===0),...n.filter(o=>o.url.indexOf("/e")!==0)].map(o=>{this.dl(o,"sendBeacon")})}enable(){this.sl=!1,this.ul()}ul(){this.sl||(this.ll=setTimeout(()=>{if(this.hl(),this.rl.length>0){const e=this.cl();for(const n in e)this.dl(e[n])}},this.ol))}dl(e,n){try{this.al(e,n)}catch(o){gi.error(o)}}hl(){clearTimeout(this.ll),this.ll=void 0}cl(){const e={};return vl(this.rl,n=>{var o;const i=n,r=((i?i.batchKey:null)||i.url)+(i.batchGroup?`:${i.batchGroup}`:"");Eo(e[r])&&(e[r]=sn(sn({},i),{},{data:[]})),(o=e[r].data)===null||o===void 0||o.push(i.data)}),this.rl=[],e}};const e9n=["retriesPerformedSoFar"];var t9n=class{constructor(e){this._instance=e,this.vl=!1,this.fl=3e3,this.rl=[],this.rl=[],this.pl=!0,this.resume()}resume(){if(!Eo(Fn)&&"onLine"in Fn.navigator){if(this.pl=Fn.navigator.onLine,this.gl)return;this.gl=()=>{this.pl=!0,this.ml()},this.yl=()=>{this.pl=!1},jc(Fn,"online",this.gl),jc(Fn,"offline",this.yl)}}get length(){return this.rl.length}retriableRequest(e,n){let{retriesPerformedSoFar:o}=e,i=vrt(e,e9n);I8(o)&&(i.url=hV(i.url,{retry_count:o})),Qat(this._instance,n?sn(sn({},i),{},{transport:n}):i,(r,s)=>{var a;if(r.statusCode!==200&&(400>r.statusCode||r.statusCode>=500)){if((r.statusCode===0?3:10)>(o??0))return void this.Ls(sn({retriesPerformedSoFar:o},i),s);r.statusCode===0&&gi.warn(`Request failed before receiving an HTTP response; this can happen due to network issues, CORS, browser blocking, or ad blockers. Stopped retrying after ${o??0} retries.`)}(a=i.callback)===null||a===void 0||a.call(i,r)})}Ls(e,n){const o=e.retriesPerformedSoFar||0;e.retriesPerformedSoFar=o+1;const i=Math.max((function(a){const A=3e3*Math.pow(2,a),c=A/2,l=Math.min(18e5,A),g=(Math.random()-.5)*(l-c);return Math.ceil(l+g)})(o),n??0),r=Date.now()+i;this.rl.push({retryAt:r,requestOptions:e});let s=`Enqueued failed request for retry in ${i}`;navigator.onLine||(s+=" (Browser is offline)"),gi.warn(s),this.vl||(this.vl=!0,this.bl())}bl(){if(this._l&&clearTimeout(this._l),this.rl.length===0)return this.vl=!1,void(this._l=void 0);this._l=setTimeout(()=>{this.pl&&this.rl.length>0&&this.ml(),this.bl()},this.fl)}ml(){const e=Date.now(),n=[],o=this.rl.filter(i=>e>i.retryAt||(n.push(i),!1));if(this.rl=n,o.length>0)for(const{requestOptions:i}of o)this.retriableRequest(i)}unload(){this._l&&(clearTimeout(this._l),this._l=void 0),this.vl=!1,Eo(Fn)||(this.gl&&(Fn.removeEventListener("online",this.gl),this.gl=void 0),this.yl&&(Fn.removeEventListener("offline",this.yl),this.yl=void 0));for(const{requestOptions:e}of this.rl)try{this._instance._send_request(sn(sn({},e),{},{transport:"sendBeacon"}))}catch(n){gi.error(n)}this.rl=[]}},n9n=class{constructor(e){this._instance=e,this.wl=()=>{var n,o,i,r;this.kl||(this.kl={});const s=this.scrollElement(),a=this.scrollY(),A=s?Math.max(0,s.scrollHeight-s.clientHeight):0,c=a+(s?.clientHeight||0),l=s?.scrollHeight||0;this.kl.lastScrollY=Math.ceil(a),this.kl.maxScrollY=Math.max(a,(n=this.kl.maxScrollY)!==null&&n!==void 0?n:0),this.kl.maxScrollHeight=Math.max(A,(o=this.kl.maxScrollHeight)!==null&&o!==void 0?o:0),this.kl.lastContentY=c,this.kl.maxContentY=Math.max(c,(i=this.kl.maxContentY)!==null&&i!==void 0?i:0),this.kl.maxContentHeight=Math.max(l,(r=this.kl.maxContentHeight)!==null&&r!==void 0?r:0)}}get Sl(){return this._instance.config.scroll_root_selector}getContext(){return this.kl}resetContext(){const e=this.kl;return this.kl=void 0,setTimeout(this.wl,0),e}startMeasuringScrollPosition(){jc(Fn,"scroll",this.wl,{capture:!0}),jc(Fn,"scrollend",this.wl,{capture:!0}),jc(Fn,"resize",this.wl)}scrollElement(){if(this.Sl){const o=As(this.Sl)?this.Sl:[this.Sl];for(const i of o){var e;const r=Fn==null||(e=Fn.document)===null||e===void 0?void 0:e.querySelector(i);if(r)return r}return}var n;return Fn==null||(n=Fn.document)===null||n===void 0?void 0:n.documentElement}xl(e){var n,o;const i=e==="y"?"scrollTop":"scrollLeft";if(this.Sl){const r=this.scrollElement();return r&&r[i]||0}return Fn?e==="y"?Fn.scrollY||Fn.pageYOffset||((n=Fn.document)===null||n===void 0||(n=n.documentElement)===null||n===void 0?void 0:n.scrollTop)||0:Fn.scrollX||Fn.pageXOffset||((o=Fn.document)===null||o===void 0||(o=o.documentElement)===null||o===void 0?void 0:o.scrollLeft)||0:0}scrollY(){return this.xl("y")}scrollX(){return this.xl("x")}};const o9n=t=>$st(t?.config.mask_personal_data_properties,t?.config.custom_personal_data_properties,t?.config.disable_capture_url_hashes);var vat=class{constructor(e,n,o,i){this.qe=r=>{const s=this.Cl();if(s&&s.sessionId===r)return;const a={sessionId:r,props:this.$l(this._instance)};this.Tl.register({[s2e]:a})},this._instance=e,this.Il=n,this.Tl=o,this.$l=i||o9n,this.Il.onSessionId(this.qe)}Cl(){return this.Tl.props[s2e]}getSetOnceProps(){var e;const n=(e=this.Cl())===null||e===void 0?void 0:e.props;return n?"r"in n?Zst(n,this._instance.config.disable_capture_url_hashes):{$referring_domain:n.referringDomain,$pathname:n.initialPathName,utm_source:n.utm_source,utm_campaign:n.utm_campaign,utm_medium:n.utm_medium,utm_content:n.utm_content,utm_term:n.utm_term}:{}}getSessionProps(){const e={};return vl(d2e(this.getSetOnceProps()),(n,o)=>{o==="$current_url"&&(o="url"),e[`$session_entry_${Qye(o)}`]=n}),e}},gne=class{on(e,n){return this.Ml[e]||(this.Ml[e]=[]),this.Ml[e].push(n),()=>{this.Ml[e]=this.Ml[e].filter(o=>o!==n)}}emit(e,n){for(const o of this.Ml[e]||[])o(n);for(const o of this.Ml["*"]||[])o(e,n)}constructor(){this.Ml={}}};const Hk=Ad("[SessionId]"),wat=864e5;var Pat=class{on(e,n){return this.El.on(e,n)}constructor(e,n,o){var i;if(this.Pl=null,this.Rl=null,this.Al=[],this.Fl=void 0,this.Ol=!1,this.El=new gne,this.Dl=(s,a)=>!(!I8(s)||!I8(a))&&Math.abs(s-a)>this.sessionTimeoutMs,!e.persistence)throw new Error("SessionIdManager requires a PostHogPersistence instance");if(e.config.cookieless_mode==="always")throw new Error('SessionIdManager cannot be used with cookieless_mode="always"');this.Mr=e.config,this.Tl=e.persistence,this.je=void 0,this.Xt=void 0,this._sessionStartTimestamp=null,this.Ll=void 0,this._sessionActivityTimestamp=null,this.Nl=n||F4,this.ql=o||F4;const r=this.Mr.persistence_name||this.Mr.token;if(this._sessionTimeoutMs=1e3*E9(this.Mr.session_idle_timeout_seconds||1800,60,36e3,Hk.createLogger("session_idle_timeout_seconds"),1800),e.register({$configured_session_timeout_ms:this._sessionTimeoutMs}),this.jl(),this.Bl="ph_"+r+"_window_id",this.Hl="ph_"+r+"_primary_window_exists",this.zl()){const s=Z0.Dt(this.Bl),a=Z0.Dt(this.Hl);s&&!a?this.je=s:Z0.Lt(this.Bl),Z0.$t(this.Hl,!0)}!((i=this.Mr.bootstrap)===null||i===void 0)&&i.sessionID&&this.setBootstrapSessionId(this.Mr.bootstrap.sessionID),this.Ul()}get sessionTimeoutMs(){return this._sessionTimeoutMs}onSessionId(e){return Eo(this.Al)&&(this.Al=[]),this.Al.push(e),this.Xt&&e(this.Xt,this.je),()=>{this.Al=this.Al.filter(n=>n!==e)}}zl(){return this.Mr.persistence!=="memory"&&!this.Tl.hi&&Z0.At()}Wl(e){e!==this.je&&(this.je=e,this.zl()&&Z0.$t(this.Bl,e))}Vl(){return this.je?this.je:this.zl()?Z0.Dt(this.Bl):null}Gl(e){const n=this.Pl;return!ad(n)&&!ad(e)&&5e3>Math.abs(e-n)}Zl(e,n,o){const i=n!==this._sessionActivityTimestamp,r=!(e!==this.Xt||o!==this._sessionStartTimestamp);this._sessionStartTimestamp=o,this._sessionActivityTimestamp=n,this.Xt=e,r&&!i||r&&this.Gl(n)||(this.Pl=n,this.Tl.register({[Sk]:[n,e,o]}))}Ql(){var e;const n=(e=this.Mr)===null||e===void 0?void 0:e.persistence_save_debounce_ms;return I8(n)&&n>0}Jl(){this.Ql()?this.Tl.refreshKey(Sk):(this.Tl.flush(),this.Tl.load())}Kl(){var e;if(ad(this._sessionActivityTimestamp)||this._sessionActivityTimestamp===this.Pl)return;this.Jl();const[,n,o]=this.Xl();n===this.Xt&&o===this._sessionStartTimestamp&&(this.Pl=this._sessionActivityTimestamp,this.Tl.register({[Sk]:[this._sessionActivityTimestamp,(e=this.Xt)!==null&&e!==void 0?e:null,this._sessionStartTimestamp]}),this.Tl.flush())}Yl(){const[e]=this.Xl(),n=I8(e)?e:0,o=I8(this._sessionActivityTimestamp)?this._sessionActivityTimestamp:0;return Math.max(n,o)}tu(e){return this.Jl(),this.Dl(e,this.Yl())}Xl(){const e=this.Tl.props[Sk];return As(e)&&e.length===2&&e.push(e[0]),e||[0,null,0]}resetSessionId(){this.Pl=null,this.Ll=void 0,clearTimeout(this.eu),this.eu=void 0,this.Zl(null,null,null)}setBootstrapSessionId(e,n=!1){const o=((i,r=new Date().getTime())=>{try{const s=(a=>{const A=a.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)})(i);return s>r+6e4?void Hk.error("Bootstrap sessionID cannot be in the future"):s}catch(s){return void Hk.error("Invalid sessionID in bootstrap",s)}})(e);return!Eo(o)&&(n?this.Ll={sessionId:e,sessionStartTimestamp:o}:this.Zl(e,new Date().getTime(),o),!0)}destroy(){this.Ol=!0,this.Kl(),clearTimeout(this.eu),this.eu=void 0,this.Fl&&Fn&&(Fn.removeEventListener(ene,this.Fl,{capture:!1}),this.Fl=void 0),this.Al=[]}Ul(){this.Fl=()=>{this.Kl(),this.zl()&&Z0.Lt(this.Hl)},jc(Fn,ene,this.Fl,{capture:!1})}checkAndGetSessionAndWindowId(e=!1,n=null,o=!1){if(this.Mr.cookieless_mode==="always")throw new Error('checkAndGetSessionAndWindowId should not be called with cookieless_mode="always"');const i=n||new Date().getTime(),r=this.Xt;if(o)this.Rl=i;else if(ad(this.Rl)||this.Rl>i||i-this.Rl>=1e3){var s,a;(s=(a=this.Tl).syncCookieProperties)===null||s===void 0||s.call(a),this.Rl=i}let[,A,c]=this.Xl();const l=!Eo(r)&&A!==r,g=this.Yl();let u=this.Vl();const h=this.Ll,d=!!h&&(h.sessionStartTimestamp>i+6e4||i-h.sessionStartTimestamp>wat),p=h?d:I8(c)&&Math.abs(i-c)>wat;let m=!1,_=l,f=!A||!!h;const I=A;let C=!f&&!e&&this.Dl(i,g);if(C&&(C=this.tu(i),C||Hk.info("cross-tab refresh kept the session alive",{sessionId:A}),[,A,c]=this.Xl(),C||(f=!A||!!h)),f||C||p){_=!1;const B=h&&!d;A=B?h.sessionId:this.Nl(),u=this.ql(),Hk.info("new session ID assigned",{sessionId:A,windowId:u,bootstrapped:!!B,changeReason:{noSessionId:f,activityTimeout:C,sessionPastMaximumLength:p}}),c=B?h.sessionStartTimestamp:i,this.Ll=void 0,m=!0}else u||(u=this.ql(),m=!0),_=_||A!==I,_&&(Hk.info("adopted cross-tab session id",{sessionId:A,windowId:u}),m=!0);const y=I8(g)&&e&&!p?g:i,x=I8(c)?c:new Date().getTime();this.Wl(u),this.Zl(A,y,x),e||this.jl();const E={noSessionId:f,activityTimeout:C,sessionPastMaximumLength:p,crossTabAdoption:_};return m&&this.Al.forEach(B=>B(A,u,E)),{sessionId:A,windowId:u,sessionStartTimestamp:x,changeReason:m?E:void 0,lastActivityTimestamp:g}}jl(){this.Ol||(clearTimeout(this.eu),this.eu=setTimeout(()=>{if(!this.Ol)if(this.tu(new Date().getTime())){const e=this.Xt;this.resetSessionId(),this.El.emit("forcedIdleReset",{idleSessionId:e})}else this.jl()},1.1*this.sessionTimeoutMs))}};const Mat=function(t,e){if(!t)return!1;const n=t.userAgent;if(n&&vit(n,e))return!0;try{const o=t?.userAgentData;if(o?.brands&&o.brands.some(i=>vit(i?.brand,e)))return!0}catch{}return!!t.webdriver};function Dat(){return(Dat=Wg(function*(){const t=F_?.userAgentData;if(t?.getHighEntropyValues)try{const e=yield t.getHighEntropyValues(["model"]),n=e?.model;return nA(n)&&n.length>0?n:void 0}catch(e){return void gi.info("Unable to resolve $device_model from userAgentData.getHighEntropyValues",e)}})).apply(this,arguments)}function i9n(t,e){let n=`$survey_${e}/${t.id}`;return t.current_iteration&&t.current_iteration>0&&(n=`$survey_${e}/${t.id}/${t.current_iteration}`),n}function Nat(t){var e;return!!(!((e=t.conditions)===null||e===void 0||(e=e.events)===null||e===void 0||(e=e.values)===null||e===void 0)&&e.length)}const une=(t,e)=>{if(!(n=>{try{new RegExp(n)}catch{return!1}return!0})(e))return!1;try{return new RegExp(e).test(t)}catch{return!1}},dne=t=>t.toLowerCase(),Rat={exact:(t,e)=>e.some(n=>t.some(o=>n===o)),is_not:(t,e)=>e.every(n=>t.every(o=>n!==o)),regex:(t,e)=>e.some(n=>t.some(o=>une(n,o))),not_regex:(t,e)=>e.every(n=>t.every(o=>!une(n,o))),icontains:(t,e)=>e.map(dne).some(n=>t.map(dne).some(o=>n.includes(o))),not_icontains:(t,e)=>e.map(dne).every(n=>t.map(dne).every(o=>!n.includes(o))),gt:(t,e)=>e.some(n=>{const o=parseFloat(n);return!isNaN(o)&&t.some(i=>o>parseFloat(i))}),lt:(t,e)=>e.some(n=>{const o=parseFloat(n);return!isNaN(o)&&t.some(i=>o<parseFloat(i))})};function Tat(t,e){return!t||Object.entries(t).every(([n,o])=>{const i=e?.[n];if(i==null)return!1;const r=Rat[o.operator];return!!r&&r(o.values.map(String),[String(i)])})}function U2e(t,e,n){return Nk({distinct_id:t,userPropertiesToSet:e,userPropertiesToSetOnce:n})}const K2e="custom",kat="i.posthog.com",r9n=/^\/static\//,s9n=["/s/","/e/","/i/"];var a9n=class{constructor(e){this.iu={},this.instance=e}get apiHost(){const e=this.instance.config.api_host.trim().replace(/\/$/,"");return e==="https://app.posthog.com"?"https://us.i.posthog.com":e}get flagsApiHost(){const e=this.instance.config.flags_api_host;return e?e.trim().replace(/\/$/,""):this.apiHost}get uiHost(){var e;let n=(e=this.instance.config.ui_host)===null||e===void 0?void 0:e.replace(/\/$/,"");return n||(n=this.apiHost.replace(`.${kat}`,".posthog.com")),n==="https://app.posthog.com"?"https://us.posthog.com":n}get region(){return this.iu[this.apiHost]||(this.iu[this.apiHost]=/https:\/\/(app|us|us-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?"us":/https:\/\/(eu|eu-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?"eu":K2e),this.iu[this.apiHost]}nu(e){if(!r9n.test(e))return;const n=this.instance.config.asset_host;return typeof n=="string"&&n.trim().replace(/\/$/,"")||void 0}su(e){const n=x8(e);return n?n.protocol+"//"+n.host+n.pathname:void 0}ru(e,n,o){if(e==="ui")return o;let i=o;const r=this.instance.config.rewriteRequestPath;if(r){var s;const a=((s=x8(o))===null||s===void 0?void 0:s.href)||o;i=r(new URL(a)).toString()}if(r&&e==="api"&&s9n.some(a=>n.indexOf(a)===0)){const a=this.su(i);if(a){const A=this.apiHost;let c=this.ou;c?.apiHost===A&&c.rewriteRequestPath===r||(c={apiHost:A,rewriteRequestPath:r,urls:new Set},this.ou=c),c.urls.add(a)}}return i}isIngestionEndpoint(e){const n=this.ou,o=this.su(e);return n?.apiHost===this.apiHost&&n.rewriteRequestPath===this.instance.config.rewriteRequestPath&&!!o&&n.urls.has(o)}endpointFor(e,n=""){if(n&&(n=n[0]==="/"?n:`/${n}`),e==="ui")return this.ru(e,n,this.uiHost+n);if(e==="flags")return this.ru(e,n,this.flagsApiHost+n);if(e==="assets"){const i=this.nu(n);if(i)return this.ru(e,n,`${i}${n}`)}if(this.region===K2e)return this.ru(e,n,this.apiHost+n);const o=kat+n;switch(e){case"assets":return this.ru(e,n,`https://${this.region}-assets.${o}`);case"api":return this.ru(e,n,`https://${this.region}.${o}`)}}};const _l=Ad("[Surveys]"),Fat=t=>{try{const e=(n=>((o,i)=>`seenSurvey_${(function(r){return r.current_iteration&&r.current_iteration>0?`${r.id}_${r.current_iteration}`:r.id})(i)}`)(0,n))(t);if(localStorage.getItem(e))return;localStorage.setItem(e,"true")}catch(e){_l.error("Failed to persist survey seen state",e)}},A9n=[P2e.Popover,P2e.Widget,P2e.API],c9n={ignoreConditions:!1,ignoreDelay:!1,displayType:D2e.Popover},l9n=Ad("[PostHog ExternalIntegrations]"),g9n={intercom:"intercom-integration",crispChat:"crisp-chat-integration"};var u9n=class{constructor(e){this._instance=e}Bo(e,n){var o,i;(o=Ur.__PosthogExtensions__)===null||o===void 0||(i=o.loadExternalDependency)===null||i===void 0||i.call(o,this._instance,e,r=>{if(r)return l9n.error("failed to load script",r);n()})}startIfEnabledOrStop(){var e;for(const[r,s]of Object.entries((e=this._instance.config.integrations)!==null&&e!==void 0?e:{})){var n,o,i;s&&!(!((n=Ur.__PosthogExtensions__)===null||n===void 0||(n=n.integrations)===null||n===void 0)&&n[r])&&this.Bo(g9n[r],()=>{var a;(a=Ur.__PosthogExtensions__)===null||a===void 0||(a=a.integrations)===null||a===void 0||(a=a[r])===null||a===void 0||a.start(this._instance)}),!s&&(!((o=Ur.__PosthogExtensions__)===null||o===void 0||(o=o.integrations)===null||o===void 0)&&o[r])&&((i=Ur.__PosthogExtensions__)===null||i===void 0||(i=i.integrations)===null||i===void 0||(i=i[r])===null||i===void 0||i.stop())}}},d9n=class{constructor(e,n){this.A=e,this.yo=n,this.au=new Map,this.$o=!1}add(e){var n=this;return Wg(function*(){if(n.$o)throw new Error("Cannot add an extension to a disposed ExtensionRuntime");if(n.au.has(e.name))throw new Error(`Browser extension "${e.name}" is already registered`);n.au.set(e.name,e);try{const o=e.setup(n.yo);o&&(yield o)}catch(o){const i=n.au.get(e.name)===e;i&&n.au.delete(e.name),n.A.error(`Failed to set up browser extension "${e.name}"`,o),i&&n.lu(e)}})()}getExtension(e){return this.au.get(e)}dispose(){if(this.$o)return;this.$o=!0;const e=Array.from(this.au.values()).reverse();this.au.clear();for(const n of e)this.lu(n)}lu(e){try{var n;const o=(n=e.dispose)===null||n===void 0?void 0:n.call(e);o&&L_(o.then)&&o.then(void 0,i=>{this.A.error(`Failed to dispose browser extension "${e.name}"`,i)})}catch(o){this.A.error(`Failed to dispose browser extension "${e.name}"`,o)}}},h9n=class{constructor(e){this._instance=e}initialize(){}get(e){const n=this._instance.persistence;if(typeof e=="string")return n?.get_property(e);const o={};for(const i of e){const r=n?.get_property(i);Eo(r)||(o[i]=r)}return o}set(e,n){var o;(o=this._instance.persistence)===null||o===void 0||o.register(typeof e=="string"?{[e]:n}:e)}remove(e){var n;(n=this._instance.persistence)===null||n===void 0||n.unregister(e)}};const Lat="extensionsRemoteConfig";var p9n=class{constructor(e){this.instance=e,this.$o=!1,this.A=gi,this.uu=e.hu,this.kv=new h9n(e),this.onEvent=n=>Ane(this.instance.on("eventCaptured",o=>{try{n({event:o.event,properties:o.properties})}catch(i){this.A.error("Browser extension event listener failed",i)}})),this.onRemoteConfig=n=>{if(this.$o)return Ane(()=>{});const o=r=>{try{n(r)}catch(s){this.A.error("Browser extension remote config listener failed",s)}},i=this.instance.cu.on(Lat,o);return this.uu&&o(this.uu),Ane(i)},this.du=new d9n(gi.createLogger("[BrowserExtensions]"),this)}get logger(){return this.A}get distinctId(){return this.instance.get_distinct_id()}get anonymousId(){var e;return(e=this.instance.get_property("$device_id"))!==null&&e!==void 0?e:this.distinctId}get deviceId(){const e=this.instance.get_property(jye);return typeof e=="string"?e:void 0}get library(){return{name:Ym.LIB_NAME,version:Ym.LIB_VERSION}}get initialPersonProperties(){var e,n;return(e=(n=this.instance.persistence)===null||n===void 0?void 0:n.get_initial_props())!==null&&e!==void 0?e:{}}get groups(){return this.instance.getGroups()}get session(){try{var e,n,o,i;const r=(e=this.instance.sessionManager)===null||e===void 0?void 0:e.checkAndGetSessionAndWindowId(!0);return{sessionId:(n=r?.sessionId)!==null&&n!==void 0?n:"",windowId:(o=r?.windowId)!==null&&o!==void 0?o:"",sessionStartTimestamp:(i=r?.sessionStartTimestamp)!==null&&i!==void 0?i:0}}catch{return{sessionId:"",windowId:"",sessionStartTimestamp:0}}}get canCapture(){return this.instance.is_capturing()}get projectToken(){return this.instance.config.token}add(e){return this.du.add(e)}getExtension(e){return this.du.getExtension(e)}capture(e,n,o){o?this.instance.capture(e,n,{timestamp:o.timestamp,uuid:o.uuid,$set:o.set,$set_once:o.setOnce}):this.instance.capture(e,n)}registerDynamicEventProperties(e){return Ane(this.instance.vu(e))}handleRemoteConfig(e){this.$o||(this.uu=e,this.instance.cu.emit(Lat,e))}sendRequest(e){var n=this;return Wg(function*(o,i={}){var r;const s=n.instance.requestRouter.endpointFor((r=i.target)!==null&&r!==void 0?r:"api",o),a={method:i.method,url:i.query?hV(s,i.query):s,data:i.body,headers:i.headers,timeout:i.timeoutMs,fireCallbackOnDrop:!0,transport:i.transport,compression:i.compression,compressionFallback:i.target==="flags"&&i.compression==="best-available"?Sye.Base64:void 0,timestampMode:i.sentAt};return i.transport==="sendBeacon"?(n.instance._send_request(a),{statusCode:202}):new Promise(A=>{a.callback=A,n.instance._send_request(a)})}).apply(this,arguments)}dispose(){this.$o||(this.$o=!0,this.du.dispose())}};const pV={};let V2e=0;const mV=()=>{},Hat='Consent opt in/out is not valid with cookieless_mode="always" and will be ignored',Ok="Surveys module not available",Oat="sanitize_properties is deprecated. Use before_send instead",Gat="Invalid value for property_denylist config: ",m9n=["$recording_status","$sdk_debug_recording_script_not_loaded","$sdk_debug_replay_url_trigger_status","$sdk_debug_replay_event_trigger_status","$sdk_debug_replay_linked_flag_trigger_status","$sdk_debug_replay_rrweb_error","$sdk_debug_replay_internal_buffer_length","$sdk_debug_replay_flushed_size"],_9n=["$feature_flag_called","$$heatmap","$snapshot"],Yat=t=>t.charAt(0)==="$"&&!as(_9n,t),f9n=/^[A-Za-z0-9_-]{1,400}$/,Uat=/^fb\.[0-9]+\.[0-9]+\.[A-Za-z0-9_-]+(?:\.[A-Za-z0-9_-]+)?$/,Kat=/^fb\.[0-9]+\.[0-9]+\.[0-9]+$/,I9n=["token","distinct_id",nst],_V="posthog",C9n=t=>{const e={};return t&&t!=="unset"&&("2025-11-30">t||(e.strictMinimumDuration=!0),"2026-05-30">t||(e.canvasCapture={resolutionScale:.6}),"2026-06-25">t||(e.streamNetworkBody=!0),"2026-08-30">t||(e.captureJsonLd=!0)),e},z2e=t=>{var e;return sn({api_host:"https://us.i.posthog.com",flags_api_host:null,ui_host:null,asset_host:null,token:"",autocapture:!0,cross_subdomain_cookie:_Bn(No?.location),persistence:"localStorage+cookie",persistence_name:"",cookie_persisted_properties:[],loaded:mV,save_campaign_params:!0,custom_campaign_params:[],custom_blocked_useragents:[],save_referrer:!0,capture_pageleave:"if_capture_pageview",defaults:t??"unset",__preview_deferred_init_extensions:!1,__preview_external_dependency_versioned_paths:!1,__preview_cookie_wins_on_conflict:!1,debug:sd&&nA(sd?.search)&&sd.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_conversations:!1,disable_product_tours:!1,disableDeviceModel:!1,reuseAnonymousId:!1,disable_external_dependency_loading:!1,strict_script_versioning:"fallback",enable_recording_console_log:void 0,secure_cookie:(Fn==null||(e=Fn.location)===null||e===void 0?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",consent_persistence_name:null,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,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_feature_flags_dedup_per_session:!1,advanced_enable_surveys:!1,advanced_disable_toolbar_metrics:!1,feature_flag_request_timeout_ms:3e3,feature_flag_request_max_retries:1,surveys_request_timeout_ms:1e4,on_request_error(n){gi.error("Bad HTTP status: "+n.statusCode+" "+n.text)},get_device_id:n=>n,capture_performance:void 0,name:"posthog",bootstrap:{},disable_compression:!1,session_idle_timeout_seconds:1800,person_profiles:ust,before_send:void 0,get_current_url:void 0,request_queue_config:{flush_interval_ms:3e3},error_tracking:{},_onCapture:mV},(n=>({rageclick:n&&n>="2026-05-30"?{content_ignorelist:bBn,ignore_text_selection:!0}:!n||"2025-11-30">n||{content_ignorelist:!0},capture_pageview:!n||"2025-05-24">n||"history_change",session_recording:C9n(n),external_scripts_inject_target:n&&n>="2026-01-30"?"head":"body",internal_or_test_user_hostname:n&&n>="2026-01-30"?/^(localhost|127\.0\.0\.1)$/:void 0,persistence_save_debounce_ms:n&&n>="2026-05-30"?250:0,split_storage:!(!n||"2026-05-30">n),detect_google_search_app:!(!n||"2026-05-30">n),disable_capture_url_hashes:!(!n||"2026-06-25">n),cookieWinsOnConflict:!(!n||n==="unset"||"2026-08-29">n)}))(t))},y9n=[["process_person","person_profiles"],["xhr_headers","request_headers"],["cookie_name","persistence_name"],["disable_cookie","disable_persistence"],["__preview_disable_beacon","disable_beacon"],["store_google","save_campaign_params"],["verbose","debug"],["__preview_cookie_wins_on_conflict","cookieWinsOnConflict"]],Vat=t=>{const e={};for(const[i,r]of y9n)Eo(t[i])||(e[r]=t[i]);const n=jg({},e,t),o=t.__preview_external_dependency_versioned_paths;return Eo(o)||(Eo(t.strict_script_versioning)&&(n.strict_script_versioning=!!o),nA(o)&&Eo(t.asset_host)&&(n.asset_host=o)),As(t.property_blacklist)&&(Eo(t.property_denylist)?n.property_denylist=t.property_blacklist:As(t.property_denylist)?n.property_denylist=[...t.property_blacklist,...t.property_denylist]:gi.error(Gat+t.property_denylist)),n};var x9n=class{constructor(){this.__forceAllowLocalhost=!1}get fu(){return this.__forceAllowLocalhost}set fu(e){gi.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=e}},fV=class EM{pu(e){if(!e)return;const n=this.au.indexOf(e);n!==-1&&this.au.splice(n,1)}gu(e,n){var o;return this.pu(e),this.au.push(n),(o=n.initialize)===null||o===void 0||o.call(n),n}mu(){return this.config.cookieless_mode==="always"||this.config.cookieless_mode==="on_reject"&&this.consent.isRejected()}yu(){if(this.bu||this.config.reuseAnonymousId||this.config.segment||this.mu())return;const e=this.config.persistence==="memory"||this.config.persistence==="sessionStorage";if(!e&&!this.config.disable_persistence||this._u)return;let n,o,i;e?(n=`persistence is set to '${this.config.persistence}'`,o=this.config.persistence==="memory"?"on every page load":"for every new browser tab or window",i="Either set persistence to 'localStorage+cookie', keep this persistence and pass a stable ID through bootstrap.distinctID, or enable reuseAnonymousId."):(n="persistence is disabled (disable_persistence is true)",o="on every page load",i="Either set disable_persistence to false, keep persistence disabled and pass a stable ID through bootstrap.distinctID, or enable reuseAnonymousId."),this.bu=!0,console.warn("[PostHog.js]",`${n} but no bootstrap.distinctID was provided. PostHog will mint a new distinct ID ${o}, so calling identify() merges a new ID onto the person each time. A person can then pass the distinct-ID limit and its events stop appearing on person pages and the session tab. ${i}`)}wu(){if(this.mu()||this.get_distinct_id()!=="$posthog_cookieless")return;const e=this.persistence;if(!e)return;this.ku()||e.load(!0);const n=this.get_distinct_id();if(!n||n==="$posthog_cookieless"){const o=this.config.get_device_id(F4());this.register({distinct_id:o,$device_id:o}),e.set_property(py,y8)}this.Su()}get decideEndpointWasHit(){var e,n;return(e=(n=this.featureFlags)===null||n===void 0?void 0:n.hasLoadedFlags)!==null&&e!==void 0&&e}get flagsEndpointWasHit(){var e,n;return(e=(n=this.featureFlags)===null||n===void 0?void 0:n.hasLoadedFlags)!==null&&e!==void 0&&e}constructor(){var e;this.xu=!1,this.Cu=!1,this.webPerformance=new x9n,this.$u=!1,this.version=Ym.LIB_VERSION,this.Tu=new Set,this.Iu="",this.cu=new gne,this.au=[],this.Mu=[],this.Eu=!1,this._u=!1,this.bu=!1,this._calculate_event_properties=this.calculateEventProperties.bind(this),this.config=z2e(),this.SentryIntegration=NBn,this.sentryIntegration=o=>(function(i,r){const s=Ust(i,r);return{name:Yst,processEvent:a=>s(a)}})(this,o),this.__request_queue=[],this.__loaded=!1,this.analyticsDefaultEndpoint="/e/",this.Pu=!1,this.Ru=null,this.Au=null,this.Fu=null,this.scrollManager=new n9n(this),this.pageViewManager=new Kst(this),this.rateLimiter=new UBn(this),this.requestRouter=new a9n(this),this.consent=new BBn(this),this.externalIntegrations=new u9n(this);const n=(e=EM.__defaultExtensionClasses)!==null&&e!==void 0?e:{};this.featureFlags=n.featureFlags&&new n.featureFlags(this),this.toolbar=n.toolbar&&new n.toolbar(this),this.surveys=n.surveys&&new n.surveys(this),this.conversations=n.conversations&&new n.conversations(this),this.logs=n.logs&&new n.logs(this),this.metrics=n.metrics&&new n.metrics(this),this.experiments=n.experiments&&new n.experiments(this),this.exceptions=n.exceptions&&new n.exceptions(this),this.people={set:(o,i,r)=>{const s=nA(o)?{[o]:i}:o;this.setPersonProperties(s),r?.({})},set_once:(o,i,r)=>{const s=nA(o)?{[o]:i}:o;this.setPersonProperties(void 0,s),r?.({})}},this.on("eventCaptured",o=>gi.info(`send "${o?.event}"`,o))}init(e,n,o){if(o&&o!==_V){var i;const r=(i=pV[o])!==null&&i!==void 0?i:new EM;return r._init(e,n,o),pV[o]=r,pV[_V][o]=r,r}return this._init(e,n,o)}_init(e,n={},o){var i,r,s;const a=nA(e)?e.trim():"";if(!a)return gi.critical("PostHog was initialized without a token. This likely indicates a misconfiguration. Please check the first argument passed to posthog.init()"),this;var A;if(this.__loaded)return a!==((A=this.config)===null||A===void 0?void 0:A.token)?console.warn("[PostHog.js]",`You have already initialized PostHog with a different project token! Re-initializing is a no-op, so events will keep going to the project this instance was initialized with. To capture into a second project, load PostHog once, then initialize a named instance after the SDK has loaded, e.g. posthog.init('${a}', { ... }, 'project2')`):console.warn("[PostHog.js]","You have already initialized PostHog! Re-initializing is a no-op"),this;this.__loaded=!0,this.config=z2e(n.defaults),n.debug=this.Ou(n.debug),this.Du=n,this.Lu=[],n.person_profiles?this.Au=n.person_profiles:n.process_person&&(this.Au=n.process_person);const c=z2e(n.defaults),l=Vat(n),g=jg({},c,l,{name:o,token:a});xA(c.rageclick)&&xA(l.rageclick)&&(g.rageclick=jg({},c.rageclick,l.rageclick)),xA(c.session_recording)&&xA(l.session_recording)&&(g.session_recording=jg({},c.session_recording,l.session_recording)),this.set_config(g),this.config.on_xhr_error&&gi.error("on_xhr_error is deprecated. Use on_request_error instead"),this.compression=n.disable_compression?void 0:M3.GZipJS;const u=this.ku();if(this.persistence=new w2e(this.config,u),this.sessionPersistence=this.config.persistence==="sessionStorage"||this.config.persistence==="memory"?this.persistence:new w2e(sn(sn({},this.config),{},{persistence:"sessionStorage"}),u,!1),this.Iu="ph_"+(this.config.persistence_name||this.config.token)+"_session_registered_properties",this.config.persistence!=="memory"&&!u&&Z0.At()){const _=Z0.Dt(this.Iu);As(_)&&_.forEach(f=>{nA(f)&&this.Tu.add(f)})}else Z0.Lt(this.Iu);const h=sn({},this.persistence.props),d=sn({},this.sessionPersistence.props);this.register({$initialization_time:new Date().toISOString()}),this.Nu=new ZBn((_,f)=>this.qu(_,f),this.config.request_queue_config),this.ju=new t9n(this),this.__request_queue=[];const p=this.mu();p||(this.sessionManager=new Pat(this),this.sessionPropsManager=new vat(this,this.sessionManager,this.persistence),this.sessionManager.onSessionId((_,f,I)=>{(I?.activityTimeout||I?.sessionPastMaximumLength||I?.crossTabAdoption)&&this.Bu()})),this.Hu(),this.config.__preview_deferred_init_extensions?(gi.info("Deferring extension initialization to improve startup performance"),setTimeout(()=>{this.zu(p)},0)):(gi.info("Initializing extensions synchronously"),this.zu(p)),Ym.DEBUG=Ym.DEBUG||this.config.debug,Ym.DEBUG&&gi.info("Starting in debug mode",{this:this,config:n,thisC:sn({},this.config),p:h,s:d}),this.config.identity_distinct_id&&!(!((i=n.bootstrap)===null||i===void 0)&&i.distinctID)&&(n.bootstrap=sn(sn({},n.bootstrap),{},{distinctID:this.config.identity_distinct_id,isIdentifiedID:!0}));const m=(r=n.bootstrap)===null||r===void 0?void 0:r.distinctID;if(this._u=!!m&&!YK(m),(s=n.bootstrap)===null||s===void 0?void 0:s.distinctID){const _=n.bootstrap.distinctID,f=this.get_distinct_id(),I=this.persistence.get_property(py);if(n.bootstrap.isIdentifiedID&&f!=null&&f!==_&&I==="anonymous")this.identify(_);else if(n.bootstrap.isIdentifiedID&&f!=null&&f!==_&&I==="identified")gi.warn("Bootstrap distinctID differs from an already-identified user. The existing identity is preserved. Call reset() before reinitializing if you intend to switch users.");else{const C=this.config.get_device_id(F4()),y=n.bootstrap.isIdentifiedID?C:_;this.persistence.set_property(py,n.bootstrap.isIdentifiedID?Zte:y8),this.register({distinct_id:_,$device_id:y})}}if(p)this.register_once({distinct_id:A2e,$device_id:null},"");else if(!this.get_distinct_id()){const _=this.config.get_device_id(F4());this.register_once({distinct_id:_,$device_id:_},""),this.persistence.set_property(py,y8)}return jc(Fn,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this),{passive:!1}),jc(Fn,"pageshow",()=>{var _;this.xu=!1,this.Cu||(_=this.ju)===null||_===void 0||_.resume()}),n.segment?Gst(this,()=>this.Uu()):this.Uu(),L_(this.config._onCapture)&&this.config._onCapture!==mV&&(gi.warn("onCapture is deprecated. Please use `before_send` instead"),this.on("eventCaptured",_=>this.config._onCapture(_.event,_))),this.config.ip&&gi.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.config.disableDeviceModel||(function(){return Dat.apply(this,arguments)})().then(_=>{_&&this.register({[qye]:_})}).catch(mV),this}Wu(e){const n=e;return nA(n.name)&&L_(n.setup)}Vu(e,n){this.Wu(e)?n.push(()=>{this.Gu().add(e).catch(()=>{var o;return(o=e.dispose)===null||o===void 0?void 0:o.call(e)}).catch(o=>{gi.error(`Failed to dispose browser extension "${e.name}"`,o)})}):this.au.push(e)}Hu(){var e,n,o;const i=(e=(n=this.config.__extensionClasses)===null||n===void 0?void 0:n.featureFlags)!==null&&e!==void 0?e:(o=EM.__defaultExtensionClasses)===null||o===void 0?void 0:o.featureFlags;var r,s,a;i&&(this.featureFlags&&this.featureFlags instanceof i||((r=this.Zu)===null||r===void 0||r.call(this),this.Zu=void 0,this.featureFlags=new i(this)),L_(this.featureFlags.onReloading)&&L_(this.featureFlags.setup)?this.Zu||(this.Zu=this.featureFlags.onReloading(()=>{this.cu.emit("featureFlagsReloading",!0)}),this.Gu().add(this.featureFlags)):(s=(a=this.featureFlags).initialize)===null||s===void 0||s.call(a))}zu(e){const n=performance.now(),o=sn(sn({},EM.__defaultExtensionClasses),this.config.__extensionClasses),i=[];var r,s,a,A,c,l,g;o.exceptions&&this.au.push(this.exceptions=(r=this.exceptions)!==null&&r!==void 0?r:new o.exceptions(this)),o.historyAutocapture&&this.au.push(this.historyAutocapture=new o.historyAutocapture(this)),o.tracingHeaders&&this.au.push(this.tracingHeaders=new o.tracingHeaders(this)),o.siteApps&&this.au.push(this.siteApps=new o.siteApps(this)),o.sessionRecording&&!e&&this.au.push(this.sessionRecording=new o.sessionRecording(this)),this.config.disable_scroll_properties||i.push(()=>{this.scrollManager.startMeasuringScrollPosition()}),o.autocapture&&this.Vu(this.autocapture=new o.autocapture(this),i),o.surveys&&this.Vu(this.surveys=(s=this.surveys)!==null&&s!==void 0?s:new o.surveys(this),i),o.logs&&this.Vu(this.logs=(a=this.logs)!==null&&a!==void 0?a:new o.logs(this),i),o.metrics&&this.au.push(this.metrics=(A=this.metrics)!==null&&A!==void 0?A:new o.metrics(this)),o.conversations&&this.au.push(this.conversations=(c=this.conversations)!==null&&c!==void 0?c:new o.conversations(this)),o.productTours&&this.au.push(this.productTours=new o.productTours(this)),o.heatmaps&&this.au.push(this.heatmaps=new o.heatmaps(this)),o.webVitalsAutocapture&&this.au.push(this.webVitalsAutocapture=new o.webVitalsAutocapture(this)),o.exceptionObserver&&this.au.push(this.exceptionObserver=new o.exceptionObserver(this)),o.deadClicksAutocapture&&this.au.push(this.deadClicksAutocapture=new o.deadClicksAutocapture(this,DBn)),o.toolbar&&this.au.push(this.toolbar=(l=this.toolbar)!==null&&l!==void 0?l:new o.toolbar(this)),o.experiments&&this.au.push(this.experiments=(g=this.experiments)!==null&&g!==void 0?g:new o.experiments(this)),this.au.forEach(u=>{u.initialize&&i.push(()=>{var h;(h=u.initialize)===null||h===void 0||h.call(u)})}),i.push(()=>{if(this.Qu){const u=this.Qu;this.Qu=void 0,this.au.forEach(h=>{var d;return(d=h.onRemoteConfig)===null||d===void 0?void 0:d.call(h,u)})}}),this.Ju(i,n)}Ju(e,n){for(;e.length>0;){if(this.config.__preview_deferred_init_extensions&&performance.now()-n>=30&&e.length>0)return void setTimeout(()=>{this.Ju(e,n)},0);const i=e.shift();if(i)try{i()}catch(r){gi.error("Error initializing extension:",r)}}const o=Math.round(performance.now()-n);this.register_for_session({[ost]:this.config.__preview_deferred_init_extensions?"deferred":"synchronous",[ist]:o}),this.config.__preview_deferred_init_extensions&&gi.info(`PostHog extensions initialized (${o}ms)`)}tl(e){var n;if(!No||!No.body)return gi.info("document not ready yet, trying again in 500 milliseconds..."),void setTimeout(()=>{this.tl(e)},500);if(this.config.__preview_deferred_init_extensions&&(this.Qu=e),this.hu=e,this.compression=void 0,e.ok){var o;const i=e.config;i.supportedCompression&&!this.config.disable_compression&&(this.compression=as(i.supportedCompression,M3.GZipJS)?M3.GZipJS:as(i.supportedCompression,M3.Base64)?M3.Base64:void 0),!((o=i.analytics)===null||o===void 0)&&o.endpoint&&(this.analyticsDefaultEndpoint=i.analytics.endpoint)}this.set_config({person_profiles:this.Au?this.Au:ust}),(n=this.Ku)===null||n===void 0||n.handleRemoteConfig(e),this.au.forEach(i=>{var r;return(r=i.onRemoteConfig)===null||r===void 0?void 0:r.call(i,e)})}Uu(){try{this.config.loaded(this)}catch(e){gi.critical("`loaded` function failed",e)}if(this.Xu(),this.config.internal_or_test_user_hostname&&sd?.hostname){const e=sd.hostname,n=this.config.internal_or_test_user_hostname;(typeof n=="string"?e===n:n.test(e))&&this.setInternalOrTestUser()}this.config.capture_pageview&&setTimeout(()=>{(this.consent.isOptedIn()||this.mu())&&this.Yu()},1),this.th=new sat(this),this.th.load()}Xu(){var e;this.is_capturing()&&this.config.request_batching&&((e=this.Nu)===null||e===void 0||e.enable())}_dom_loaded(){this.is_capturing()&&vk(this.__request_queue,e=>this.qu(e)),this.__request_queue=[],this.Xu()}_handle_unload(){var e,n,o,i,r,s;this.xu=!0,(e=this.surveys)===null||e===void 0||(n=e.handlePageUnload)===null||n===void 0||n.call(e),(o=this.metrics)===null||o===void 0||o.flush("sendBeacon"),this.config.request_batching?(this.eh()&&this.capture(dst),(i=this.logs)===null||i===void 0||i.flushLogs("sendBeacon"),(r=this.Nu)===null||r===void 0||r.unload(),(s=this.ju)===null||s===void 0||s.unload()):this.eh()&&this.capture(dst,null,{transport:"sendBeacon"})}_send_request(e){Qat(this,e)}qu(e,n){this.ju?this.ju.retriableRequest(e,n):this._send_request(n?sn(sn({},e),{},{transport:n}):e)}_execute_array(e){V2e++;try{let n;const o=[],i=[],r=[];vk(e,a=>{if(a)if(n=a[0],As(n))r.push(a);else if(L_(a))try{a.call(this)}catch(A){gi.error("Error executing queued PostHog call",a,A)}else As(a)&&n==="alias"?o.push(a):As(a)&&n.indexOf("capture")!==-1&&L_(this[n])?r.push(a):i.push(a)});const s=function(a,A){vk(a,function(c){try{if(As(c[0])){let l=A;vl(c,function(g){l=l[g[0]].apply(l,g.slice(1))})}else A[c[0]].apply(A,c.slice(1))}catch(l){gi.error("Error executing queued PostHog call",c,l)}})};s(o,this),s(i,this),s(r,this)}finally{V2e--}}push(e){if(V2e>0&&As(e)&&nA(e[0])){const n=EM.prototype[e[0]];return void(L_(n)&&n.apply(this,e.slice(1)))}this._execute_array([e])}get ih(){return{property:Urt,persistenceKey:bk,cookieName:"_fbc",pattern:Uat,register:(e,n)=>{var o;return(o=this.persistence)===null||o===void 0?void 0:o.register({[bk]:{value:e,delivered:n}})},unregister:()=>{var e;return(e=this.persistence)===null||e===void 0?void 0:e.unregister(bk)}}}get nh(){return{property:Krt,persistenceKey:JK,cookieName:"_fbp",pattern:Kat,register:(e,n)=>{var o;return(o=this.persistence)===null||o===void 0?void 0:o.register({[JK]:{value:e,delivered:n}})},unregister:()=>{var e;return(e=this.persistence)===null||e===void 0?void 0:e.unregister(JK)}}}sh(e){var n;const o=(n=this.persistence)===null||n===void 0?void 0:n.get_property(e.persistenceKey);return nA(o)&&e.pattern.test(o)?{value:o,delivered:!1}:xA(o)&&nA(o.value)&&e.pattern.test(o.value)?{value:o.value,delivered:o.delivered===!0}:void 0}rh(e,n,o){return n===o?.value?{value:n,pending:!o.delivered}:(e.register(n,!1),{value:n,pending:!0})}oh(e){if(!this.config.save_campaign_params||this.mu())return;const n=eV(e.cookieName);return nA(n)&&e.pattern.test(n)?n:void 0}ah(e,n,o,i){if(!this.persistence)return;const r=this.ih;this.persistence.refreshKey(r.persistenceKey);const s=this.sh(r);if(i)return void r.unregister();if(o)return nA(n)&&Uat.test(n)?this.rh(r,n,s):void r.unregister();const a=nA(e)&&f9n.test(e)?e:void 0,A=this.oh(r);return A&&((c,l,g)=>{const u=c.split(".");if(l)return u[3]===l;if(!g)return!0;const h=g.value.split(".");return u[3]===h[3]||Number(u[2])>Number(h[2])})(A,a,s)?this.rh(r,A,s):a?s?.value.split(".")[3]===a?{value:s.value,pending:!s.delivered}:this.rh(r,`fb.1.${Date.now()}.${a}`,s):s?{value:s.value,pending:!s.delivered}:void 0}uh(e,n,o){if(!this.persistence)return;const i=this.nh;this.persistence.refreshKey(i.persistenceKey);const r=this.sh(i);if(o)return void i.unregister();if(n)return nA(e)&&Kat.test(e)?this.rh(i,e,r):void i.unregister();const s=this.oh(i);return s?this.rh(i,s,r):r?{value:r.value,pending:!r.delivered}:void 0}hh(e,n){if(!this.persistence)return;this.persistence.refreshKey(e.persistenceKey);const o=this.sh(e);o?.value!==n||o.delivered||e.register(n,!0)}capture(e,n,o){var i,r;if(!(this.__loaded&&this.persistence&&this.sessionPersistence&&this.Nu))return void gi.uninitializedWarning("posthog.capture");if(!this.is_capturing())return;if(Eo(e)||!nA(e))return void gi.error("No event name provided to posthog.capture");this.wu();const s=!this.config.opt_out_useragent_filter&&this._is_bot();if(s&&!this.config.__preview_capture_bot_pageviews)return;const a=o?.skip_client_rate_limiting?void 0:this.rateLimiter.clientRateLimitContext();if(a?.isRateLimited)return void gi.critical("This capture call is ignored due to client rate limiting.");let A;n?.$current_url&&!nA(n?.$current_url)&&(gi.error("Invalid `$current_url` property provided to `posthog.capture`. Input must be a string. Ignoring provided value."),n==null||delete n.$current_url),e!=="$exception"||o?.dh||gi.warn("Using `posthog.capture('$exception')` is unreliable because it does not attach required metadata. Use `posthog.captureException(error)` instead, which attaches required metadata automatically."),this.sessionPersistence.update_search_keyword(),this.config.save_campaign_params&&(A=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();const c=new Date,l=o?.timestamp||c,g=Art(o?.uuid,F4);let u={uuid:g,event:e,properties:this.calculateEventProperties(e,n||{},l,g)};e==="$pageview"&&this.config.__preview_capture_bot_pageviews&&s&&(u.event="$bot_pageview",u.properties.$browser_type="bot"),a&&(u.properties.$lib_rate_limit_remaining_tokens=a.remainingTokens);const h=e==="$feature_flag_called"&&u.properties.$feature_flag_has_experiment===!1&&this.get_property("$minimal_flag_called_events")===!0;o?.$set&&!h&&(u.$set=o?.$set);const d=xA(n?.$set)?n.$set:void 0,p=As(n?.$unset)?n.$unset:[],m=o?.$unset||[],_=R=>{var F;const O=!!o?.$set&&R in o.$set;return{hasProvided:O||!!d&&R in d,provided:O?o==null||(F=o.$set)===null||F===void 0?void 0:F[R]:d?.[R],unset:p.indexOf(R)!==-1||m.indexOf(R)!==-1}},f=_(Urt),I=_(Krt),C=[{channel:this.ih,hasProvided:f.hasProvided,update:this.ah(A?.fbclid,f.provided,f.hasProvided,f.unset)},{channel:this.nh,hasProvided:I.hasProvided,update:this.uh(I.provided,I.hasProvided,I.unset)}];for(const{channel:R,hasProvided:F,update:O}of C)O&&u.properties.$process_person_profile===!0&&O.pending&&!F&&!h&&(u.$set=sn({[R.property]:O.value},u.$set));const y=o?.$unset;y&&(u.$unset=y);const x=h?void 0:this.fh(o?.$set_once,e!==pst,e===hst);if(x&&(u.$set_once=x),o?._noTruncate||(E=this.config.properties_string_max_length,u=(function(R,F){const O=new Set;return(function U(Y,J){if(Y!==Object(Y))return F?F(Y):Y;if(O.has(Y))return;let ee;if(O.add(Y),As(Y))ee=[],vk(Y,W=>{ee.push(U(W))});else{const W={};vl(xk(Y)?mst(Y):Y,(q,ie)=>{O.has(q)||(W[ie]=U(q))}),ee=W}return ee})(R)})(u,R=>nA(R)?R.slice(0,E):R)),u.timestamp=l,Eo(o?.timestamp)||(u.properties.$event_time_override_provided=!0,u.properties.$event_time_override_system_time=c),h&&(u.properties=((R,F=[])=>{const O={},U=Y=>{R[Y]!==void 0&&(O[Y]=R[Y])};return F4n.forEach(U),F.forEach(U),O})(u.properties,I9n)),e===D3.DISMISSED||e===D3.SENT){const R=n?.[M2e.SURVEY_ID],F=n?.[M2e.SURVEY_ITERATION];Fat({id:R,current_iteration:F}),u.$set=sn(sn({},u.$set),{},{[i9n({id:R,current_iteration:F},e===D3.SENT?"responded":"dismissed")]:!0})}else e===D3.SHOWN&&(u.$set=sn(sn({},u.$set),{},{[M2e.SURVEY_LAST_SEEN_DATE]:new Date().toISOString()}));var E;if(e===YBn.SHOWN){const R=n?.[iat.TOUR_TYPE];R&&(u.$set=sn(sn({},u.$set),{},{[`${iat.TOUR_LAST_SEEN_DATE}/${R}`]:new Date().toISOString()}))}const B=sn(sn({},u.properties.$set),u.$set);if(nx(B)||this.setPersonPropertiesForFlags(B),!Fs(this.config.before_send)){const R=this.Os(u);if(!R)return;u=R,u.uuid=Art(u.uuid,F4)}this.sessionRecording&&!this.Eu&&Yat(e)&&(this.Eu=!0,setTimeout(()=>this.Eu=!1,3e4));const S=C.filter(({channel:R,update:F})=>{var O,U,Y;const J=(O=(U=u.$set)===null||U===void 0?void 0:U[R.property])!==null&&O!==void 0?O:xA((Y=u.properties)===null||Y===void 0?void 0:Y.$set)?u.properties.$set[R.property]:void 0;return F?.pending&&J===F.value});this.cu.emit("eventCaptured",u);const Q=(i=o?._url)!==null&&i!==void 0?i:this.requestRouter.endpointFor("api",this.analyticsDefaultEndpoint),w=o?._batchKey==="recordings"||/\/s\/(?:\?|$)/.test(Q),M=sn(sn(sn({method:"POST",url:Q,data:u,compression:"best-available",preferSyncCompression:o?.send_instantly,timestampMode:w?"body":"capture-body",batchKey:o?._batchKey},w&&(!((r=u.properties)===null||r===void 0)&&r.$session_id)?{batchGroup:u.properties.$session_id+(u.properties.$window_id?`-${u.properties.$window_id}`:"")}:{}),o?.transport?{transport:o.transport}:{}),S.length?{fireCallbackOnDrop:!0,callback:R=>{if(R.statusCode>=200&&300>R.statusCode)for(const{channel:F,update:O}of S)this.hh(F,O.value)}}:{});if(!this.config.request_batching||o&&!o?._batchKey||o?.send_instantly||S.length){var k;let R;!M.transport&&!M.callback&&nx((k=this.config.request_headers)!==null&&k!==void 0?k:{})&&this.xu&&(R="sendBeacon"),this.qu(M,R)}else this.Nu.enqueue(M);return u}_addCaptureHook(e){return this.on("eventCaptured",n=>e(n.event,n))}getExtension(e){var n;return(n=this.Ku)===null||n===void 0?void 0:n.getExtension(e)}Gu(){var e;return(e=this.Ku)!==null&&e!==void 0?e:this.Ku=new p9n(this)}vu(e){this.Mu.push(e);let n=!0;return()=>{if(!n)return;n=!1;const o=this.Mu.indexOf(e);o!==-1&&this.Mu.splice(o,1)}}ph(e=!0){var n,o,i;return!!(!((n=this.persistence)===null||n===void 0)&&n.consumeCookieIdentityChange())&&(this.Fu=null,this.persistence.get_property("$user_state")==="anonymous"&&((i=this.sessionPersistence)===null||i===void 0||i.clear(),this.Tu.clear(),this.gh()),(o=this.featureFlags)===null||o===void 0||o.reset(),e&&this.reloadFeatureFlags(),!0)}calculateEventProperties(e,n,o,i,r){if(o=o||new Date,!this.persistence||!this.sessionPersistence)return n;this.persistence.syncCookieProperties(),this.ph();const s=r?void 0:this.persistence.remove_event_timer(e);let a=sn({},n);if(a.token=this.config.token,a.$config_defaults=this.config.defaults,this.mu()&&(a[nst]=!0),e==="$snapshot"){const f=sn(sn({},this.persistence.properties()),this.sessionPersistence.properties());return a.distinct_id=f.distinct_id,(!nA(a.distinct_id)&&!jd(a.distinct_id)||YK(a.distinct_id))&&gi.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),a}const A=(function(f,I,C,y=!1){var x,E,B,S;if(!dy)return{};const Q=f?[...Tk,...I||[]]:[],[w,M]=ort(dy),[k,R]=(function(se){for(let oe=0;rrt.length>oe;oe++){const[ge,ue,Ie]=rrt[oe],le=se.match(ge);if(le){const _e=Ie&&se.match(Ie)||le;return[ue,_e?.[1]||""]}}return["",""]})(dy),F=(function(){const se="u">typeof navigator?navigator:void 0;return se?.brave?{brave:!0}:{}})(),O={};Eo(C)||(O.detectGoogleSearchApp=C);const U={},Y=(x=navigator)===null||x===void 0||(x=x.userAgentData)===null||x===void 0?void 0:x.platform,J=(E=navigator)===null||E===void 0?void 0:E.maxTouchPoints,ee=Fn==null||(B=Fn.screen)===null||B===void 0?void 0:B.width,W=Fn==null||(S=Fn.screen)===null||S===void 0?void 0:S.height,q=Fn?.devicePixelRatio;Eo(Y)||(U.userAgentDataPlatform=Y),Eo(J)||(U.maxTouchPoints=J),Eo(ee)||(U.screenWidth=ee),Eo(W)||(U.screenHeight=W),Eo(q)||(U.devicePixelRatio=q);const ie=jg(d2e({$os:w,$os_version:M,$browser:trt(dy,navigator.vendor,F,O),$webview_app:k,$webview_app_version:R,$device:irt(dy),$device_type:r4n(dy,U),$timezone:eat(),$timezone_offset:HBn()}),{$current_url:AV(y?iQ(sd?.href):sd?.href,Q,cV),$host:sd?.host,$pathname:sd?.pathname,$raw_user_agent:dy.length>1e3?dy.substring(0,997)+"...":dy,$browser_version:i4n(dy,navigator.vendor,F,O),$browser_language:qst(),$browser_language_prefix:LBn(),$screen_height:Fn?.screen.height,$screen_width:Fn?.screen.width,$viewport_height:Fn?.innerHeight,$viewport_width:Fn?.innerWidth,$lib:f8.LIB_NAME,$lib_version:f8.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3});return f8.SDK_DIST_CHANNEL&&(ie.$sdk_dist_channel=f8.SDK_DIST_CHANNEL),ie})(this.config.mask_personal_data_properties,this.config.custom_personal_data_properties,this.config.detect_google_search_app,this.config.disable_capture_url_hashes);if(this.sessionManager){const{sessionId:f,windowId:I}=this.sessionManager.checkAndGetSessionAndWindowId(r,o.getTime(),!0);a.$session_id=f,a.$window_id=I}this.sessionPropsManager&&jg(a,this.sessionPropsManager.getSessionProps());try{var c;if(this.sessionRecording){const f=this.sessionRecording.sdkDebugProperties,I=!this.Eu&&Yat(e);for(const C in f)(I||as(m9n,C))&&(a[C]=f[C])}a.$sdk_debug_retry_queue_size=(c=this.ju)===null||c===void 0?void 0:c.length}catch(f){a.$sdk_debug_error_capturing_properties=String(f)}let l;if(this.requestRouter.region===K2e&&(a.$lib_custom_api_host=this.config.api_host),l=e!=="$pageview"||r?e!=="$pageleave"||r?this.pageViewManager.doEvent():this.pageViewManager.doPageLeave(o):this.pageViewManager.doPageView(o,i),a=jg(a,l),e==="$pageview"&&No&&(a.title=No.title),!Eo(s)){const f=o.getTime()-s;a.$duration=parseFloat((f/1e3).toFixed(3))}dy&&this.config.opt_out_useragent_filter&&(a.$browser_type=this._is_bot()?"bot":"browser");const g=this.persistence.properties(),u=this.sessionPersistence.properties(),h=a.$groups,d=g.$groups;xA(h)&&!nx(h)&&(a.$groups=sn(sn({},xA(d)?d:{}),h)),vl(["$referrer","$referring_domain"],f=>{f in g&&delete u[f]});const p={};if(this.Mu.length>0)for(const f of this.Mu.slice())try{jg(p,f())}catch(I){gi.error("Failed to produce browser extension event properties",I)}a=jg({},A,g,u,sn(sn({},p),a)),a.$is_identified=this._isIdentified(),As(this.config.property_denylist)?vl(this.config.property_denylist,function(f){delete a[f]}):gi.error(Gat+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);const m=this.config.sanitize_properties;m&&(gi.error(Oat),a=m(a,e));const _=this.mh();return a.$process_person_profile=_,_&&!r&&this.yh("_calculate_event_properties"),a}fh(e,n=!0,o=!1){var i;if(!this.persistence||!this.mh()||this.$u&&!o)return e;const r=this.persistence.get_initial_props(),s=(i=this.sessionPropsManager)===null||i===void 0?void 0:i.getSetOnceProps();let a=jg({},r,s||{},e||{});const A=this.config.sanitize_properties;return A&&(gi.error(Oat),a=A(a,"$set_once")),n&&(this.$u=!0),nx(a)?void 0:a}register(e,n){var o;(o=this.persistence)===null||o===void 0||o.register(e,n)}register_once(e,n,o){var i;(i=this.persistence)===null||i===void 0||i.register_once(e,n,o)}register_for_session(e){var n,o;(n=this.persistence)===null||n===void 0||n.syncCookieProperties(),this.ph(),(o=this.sessionPersistence)===null||o===void 0||o.register(e),Object.keys(e).forEach(i=>this.Tu.add(i)),this.gh()}unregister(e){var n;(n=this.persistence)===null||n===void 0||n.unregister(e)}unregister_for_session(e){var n;(n=this.sessionPersistence)===null||n===void 0||n.unregister(e),this.Tu.delete(e),this.gh()}bh(e,n){this.register({[e]:n})}Bu(){this.Tu.forEach(e=>{var n;(n=this.sessionPersistence)===null||n===void 0||n.unregister(e)}),this.Tu.clear(),this.gh()}gh(){var e;if(!this.Iu)return;if(this.config.persistence==="memory"||!((e=this.sessionPersistence)===null||e===void 0)&&e.hi||!Z0.At())return void Z0.Lt(this.Iu);const n=[];this.Tu.forEach(o=>n.push(o)),n.length>0?Z0.$t(this.Iu,n):Z0.Lt(this.Iu)}getFeatureFlag(e,n){var o;return(o=this.featureFlags)===null||o===void 0?void 0:o.getFeatureFlag(e,n)}getFeatureFlagPayload(e){var n;return(n=this.featureFlags)===null||n===void 0?void 0:n.getFeatureFlagPayload(e)}getFeatureFlagResult(e,n){var o;return(o=this.featureFlags)===null||o===void 0?void 0:o.getFeatureFlagResult(e,n)}getAllFeatureFlags(){var e,n;return(e=(n=this.featureFlags)===null||n===void 0?void 0:n.getAllFeatureFlags())!==null&&e!==void 0?e:[]}isFeatureEnabled(e,n){var o,i;return(o=(i=this.featureFlags)===null||i===void 0?void 0:i.isFeatureEnabled(e,n))!==null&&o!==void 0?o:n?.defaultValue}reloadFeatureFlags(){var e;(e=this.featureFlags)===null||e===void 0||e.reloadFeatureFlags()}updateFlags(e,n,o){var i;(i=this.featureFlags)===null||i===void 0||i.updateFlags(e,n,o)}updateEarlyAccessFeatureEnrollment(e,n,o){var i;(i=this.featureFlags)===null||i===void 0||i.updateEarlyAccessFeatureEnrollment(e,n,o)}getEarlyAccessFeatures(e,n=!1,o){var i;return(i=this.featureFlags)===null||i===void 0?void 0:i.getEarlyAccessFeatures(e,n,o)}on(e,n){return this.cu.on(e,n)}onFeatureFlags(e){return this.featureFlags?this.featureFlags.onFeatureFlags(e):(e([],{},{errorsLoading:!0}),()=>{})}onSurveysLoaded(e){return this.surveys?this.surveys.onSurveysLoaded(e):(e([],{isLoaded:!1,error:Ok}),()=>{})}onSessionId(e){var n,o;return(n=(o=this.sessionManager)===null||o===void 0?void 0:o.onSessionId(e))!==null&&n!==void 0?n:()=>{}}getSurveys(e,n=!1){this.surveys?this.surveys.getSurveys(e,n):e([],{isLoaded:!1,error:Ok})}getActiveMatchingSurveys(e,n=!1){this.surveys?this.surveys.getActiveMatchingSurveys(e,n):e([],{isLoaded:!1,error:Ok})}onActiveMatchingSurveysChanged(e){return this.surveys?this.surveys.onActiveMatchingSurveysChanged(e):(e([],{isLoaded:!1,error:Ok}),()=>{})}renderSurvey(e,n){var o;(o=this.surveys)===null||o===void 0||o.renderSurvey(e,n)}displaySurvey(e,n=c9n){var o;(o=this.surveys)===null||o===void 0||o.displaySurvey(e,n)}cancelPendingSurvey(e){var n;(n=this.surveys)===null||n===void 0||n.cancelPendingSurvey(e)}canRenderSurvey(e){var n,o;return(n=(o=this.surveys)===null||o===void 0?void 0:o.canRenderSurvey(e))!==null&&n!==void 0?n:{visible:!1,disabledReason:Ok}}canRenderSurveyAsync(e,n=!1){var o,i;return(o=(i=this.surveys)===null||i===void 0?void 0:i.canRenderSurveyAsync(e,n))!==null&&o!==void 0?o:Promise.resolve({visible:!1,disabledReason:Ok})}_h(e){return!e||YK(e)?(gi.critical("Unique user id has not been set in posthog.identify"),!1):e==="$posthog_cookieless"?(gi.critical(`The string "${e}" was set in posthog.identify which indicates an error. This ID is only used as a sentinel value.`),!1):!["distinct_id","distinctid"].includes(e.toLowerCase())&&!["undefined","null"].includes(e.toLowerCase())||(gi.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.`),!1)}identify(e,n,o){if(!this.__loaded||!this.persistence)return gi.uninitializedWarning("posthog.identify");if(jd(e)&&(e=e.toString(),gi.warn("The first argument to posthog.identify was a number, but it should be a string. It has been converted to a string.")),!this._h(e)||!this.yh("posthog.identify"))return;this.wu();const i=this.get_distinct_id(),r=this.persistence.syncCookieProperties()&&this.get_distinct_id()!==i,s=this.ph(!1),a=this.persistence.Fa();let A=!1;try{const l=this.get_distinct_id();this.register({$user_id:e}),this.get_property("$device_id")||this.register_once({$had_persisted_distinct_id:!0,$device_id:l},""),e!==l&&e!==this.get_property("__alias")&&(this.unregister(Xte),this.register({distinct_id:e}));const g=(this.persistence.get_property("$user_state")||"anonymous")===y8,u=e!==l,h=!u&&g;if(u&&g){var c;const d=this.config.reuseAnonymousId?{distinct_id:e}:{distinct_id:e,$anon_distinct_id:l};this.persistence.set_property(py,Zte),this.setPersonPropertiesForFlags({$set:n||{},$set_once:o||{}},!1),this.config.cookieWinsOnConflict&&this.persistence.Oa(),this.capture("$identify",d,{$set:n||{},$set_once:o||{}})&&(this.Fu=U2e(e,n,o)),(c=this.featureFlags)===null||c===void 0||c.setAnonymousDistinctId(this.config.reuseAnonymousId?void 0:l)}else if(h){this.persistence.set_property(py,Zte);const d=n||{},p=o||{};this.setPersonPropertiesForFlags({$set:d,$set_once:p},!1),this.config.cookieWinsOnConflict&&this.persistence.Oa(),this.capture("$set",{$set:d,$set_once:p})&&(this.Fu=U2e(e,n,o))}else(n||o)&&this.setPersonProperties(n,o);u||r||s?(this.reloadFeatureFlags(),this.featureFlags?this.featureFlags.resetFlagCallReported():this.unregister(AQ)):h&&(n||o)&&this.reloadFeatureFlags(),A=!0}finally{a&&this.persistence.Na(A)}}setPersonProperties(e,n){if(!e&&!n||!this.yh("posthog.setPersonProperties"))return;const o=U2e(this.get_distinct_id(),e,n);this.Fu!==o?(this.setPersonPropertiesForFlags({$set:e||{},$set_once:n||{}},!0),this.capture("$set",{$set:e||{},$set_once:n||{}})&&(this.Fu=o)):gi.info("A duplicate setPersonProperties call was made with the same properties. It has been ignored.")}unsetPersonProperties(e){var n;const o=(As(e)?e:[e]).filter(i=>nA(i)&&i.length>0);o.length!==0&&this.yh("posthog.unsetPersonProperties")&&((n=this.featureFlags)===null||n===void 0||n.unsetPersonPropertiesForFlags(o,!0),this.capture("$set",{$unset:o}),this.Fu=null)}group(e,n,o){var i;if(!e||!n)return void gi.error("posthog.group requires a group type and group key");(i=this.persistence)===null||i===void 0||i.syncCookieProperties(),this.ph();const r=this.getGroups(),s=r[e]!==n;if(s&&this.resetGroupPropertiesForFlags(e),this.register({$groups:sn(sn({},r),{},{[e]:n})}),(s||o)&&this.mh()){const a={$group_type:e,$group_key:n};o&&(a.$group_set=o),this.capture(pst,a)}o&&this.setGroupPropertiesForFlags({[e]:o}),s&&!o&&this.reloadFeatureFlags()}resetGroups(){this.register({$groups:{}}),this.resetGroupPropertiesForFlags(),this.reloadFeatureFlags()}setPersonPropertiesForFlags(e,n=!0){var o;(o=this.featureFlags)===null||o===void 0||o.setPersonPropertiesForFlags(e,n)}resetPersonPropertiesForFlags(e=!0){var n;(n=this.featureFlags)===null||n===void 0||n.resetPersonPropertiesForFlags(e)}setGroupPropertiesForFlags(e,n=!0){var o;this.yh("posthog.setGroupPropertiesForFlags")&&((o=this.featureFlags)===null||o===void 0||o.setGroupPropertiesForFlags(e,n))}resetGroupPropertiesForFlags(e){var n;(n=this.featureFlags)===null||n===void 0||n.resetGroupPropertiesForFlags(e)}reset(e){const n=hy(e)?e:e?.resetDeviceID,o=hy(e)||e==null?void 0:e.bootstrap;this.wh(n,!1,o)}wh(e,n=!1,o){var i,r,s,a,A,c;if(gi.info("reset"),!this.__loaded)return gi.uninitializedWarning("posthog.reset");const l=o?.sessionID;this.config.bootstrap=o||((i=this.Du)===null||i===void 0?void 0:i.bootstrap)||{},(r=this.featureFlags)===null||r===void 0||(s=r.updateConfig)===null||s===void 0||s.call(r,this.config,this.el());const g=this.get_property(jye),u=this.get_property(qye),h=this.get_property(WK);(a=this.sessionRecording)===null||a===void 0||a.flushBeforeIdentityReset();const d=this.is_capturing();this.consent.reset(),n||!d||this.is_capturing()||console.warn("[PostHog.js]","reset() cleared the stored consent, and capturing is now off because of `opt_out_capturing_by_default`. Call opt_in_capturing() again, and prefer calling reset() before opting in rather than after.");const p=(A=this.persistence)===null||A===void 0||(c=A.Fa)===null||c===void 0?void 0:c.call(A);let m=!1;try{var _,f,I,C,y,x,E,B,S,Q,w,M,k;if((_=this.persistence)===null||_===void 0||_.clear(),(f=this.sessionPersistence)===null||f===void 0||f.clear(),this.Tu.clear(),this.gh(),Eo(h)||(Q=this.persistence)===null||Q===void 0||Q.register({$session_recording_remote_config:h}),(I=this.surveys)===null||I===void 0||I.reset(),(C=this.featureFlags)===null||C===void 0||C.reset(),(y=this.conversations)===null||y===void 0||y.reset(),(x=this.logs)===null||x===void 0||x.reset(),(E=this.metrics)===null||E===void 0||E.reset(),(B=this.persistence)===null||B===void 0||B.set_property("$user_state","anonymous"),(S=this.sessionManager)===null||S===void 0||S.resetSessionId(),this.Fu=null,this.config.cookieless_mode==="always")this.register_once({distinct_id:A2e,$device_id:null},"");else{const O=this.config.get_device_id(F4());this.register_once({distinct_id:O,$device_id:e?O:g},""),e||Eo(u)||this.register({[qye]:u})}if(this.register({$last_posthog_reset:new Date().toISOString()},1),o&&(o.distinctID&&!this.mu()&&((k=this.persistence)===null||k===void 0||k.set_property("$user_state",o.isIdentifiedID?"identified":"anonymous"),this.register({distinct_id:o.distinctID})),(w=this.featureFlags)===null||w===void 0||w.initialize(),!Fs(l)&&!(!((M=this.sessionManager)===null||M===void 0)&&M.setBootstrapSessionId(l,!0)))){const O=sn({},o);delete O.sessionID,this.config.bootstrap=O}delete this.config.identity_distinct_id,delete this.config.identity_hash,delete this.config.identity_claims,m=!0}finally{var R,F;p&&((R=this.persistence)===null||R===void 0||(F=R.Na)===null||F===void 0||F.call(R,m))}this.reloadFeatureFlags()}shutdown(e){var n=this;return Wg(function*(){var o,i,r,s,a,A,c,l;if(n.__loaded){n.Cu=!0,n.Gu().dispose(),(o=n.sessionRecording)===null||o===void 0||o.dispose(),(i=n.logs)===null||i===void 0||i.flushLogs("sendBeacon"),(r=n.metrics)===null||r===void 0||r.flush("sendBeacon"),(s=n.metrics)===null||s===void 0||s.dispose(),(a=n.Nu)===null||a===void 0||a.unload(),(A=n.ju)===null||A===void 0||A.unload();try{var g;(g=n.featureFlags)===null||g===void 0||g.destroy()}catch(u){gi.error("Error while destroying feature flags",u)}(c=n.persistence)===null||c===void 0||c.destroy(),(l=n.sessionPersistence)===null||l===void 0||l.destroy()}else gi.uninitializedWarning("posthog.shutdown")})()}setIdentity(e,n){var o;delete this.config.identity_claims,this.config.identity_distinct_id=e,this.config.identity_hash=n,this.alias(e),(o=this.conversations)===null||o===void 0||o.kh()}clearIdentity(){var e;delete this.config.identity_distinct_id,delete this.config.identity_hash,delete this.config.identity_claims,(e=this.conversations)===null||e===void 0||e.Sh()}get_distinct_id(){return this.get_property("distinct_id")}getGroups(){return this.get_property("$groups")||{}}get_session_id(){var e,n;return(e=(n=this.sessionManager)===null||n===void 0?void 0:n.checkAndGetSessionAndWindowId(!0).sessionId)!==null&&e!==void 0?e:""}get_session_replay_url(e){if(!this.sessionManager)return"";const{sessionId:n,sessionStartTimestamp:o}=this.sessionManager.checkAndGetSessionAndWindowId(!0);let i=this.requestRouter.endpointFor("ui",`/project/${this.config.token}/replay/${n}`);if(e?.withTimestamp&&o){var r;const s=(r=e.timestampLookBack)!==null&&r!==void 0?r:10;if(!o)return i;i+=`?t=${Math.max(Math.floor((new Date().getTime()-o)/1e3)-s,0)}`}return i}alias(e,n){return e===this.get_property("$people_distinct_id")?(gi.critical("Attempting to create alias for existing People user - aborting."),-2):this.yh("posthog.alias")?(Eo(n)&&(n=this.get_distinct_id()),e!==n?(this.bh(Xte,e),this.capture("$create_alias",{alias:e,distinct_id:n})):(gi.warn("alias matches current distinct_id - skipping api call."),this.identify(e),-1)):void 0}set_config(e){const n=sn({},this.config);if(xA(e)){var o,i,r,s,a,A,c,l,g,u,h,d,p,m;jg(this.config,Vat(e));const f=this.ku();(o=this.persistence)===null||o===void 0||o.update_config(this.config,n,f),this.sessionPersistence=this.config.persistence==="sessionStorage"||this.config.persistence==="memory"?this.persistence:new w2e(sn(sn({},this.config),{},{persistence:"sessionStorage"}),f,!1);const I=this.Ou(this.config.debug);var _;hy(I)&&(this.config.debug=I),hy(this.config.debug)&&(this.config.debug?(Ym.DEBUG=!0,uc.At()&&uc.$t("ph_debug",!0),gi.info("set_config",{config:e,oldConfig:n,newConfig:sn({},this.config)})):(Ym.DEBUG=!1,uc.At()&&uc.Lt("ph_debug"))),(i=this.featureFlags)===null||i===void 0||(r=i.updateConfig)===null||r===void 0||r.call(i,this.config,this.el()),(s=this.exceptionObserver)===null||s===void 0||s.onConfigChange(),(a=this.exceptions)===null||a===void 0||a.onConfigChange(),(A=this.metrics)===null||A===void 0||A.onConfigChange(),(c=this.sessionRecording)===null||c===void 0||c.startIfEnabledOrStop(),(l=this.tracingHeaders)===null||l===void 0||l.startIfEnabledOrStop(),(g=this.autocapture)===null||g===void 0||g.startIfEnabled(),(u=this.heatmaps)===null||u===void 0||u.startIfEnabled(),("capture_pageview"in e||"disable_capture_url_hashes"in e)&&((_=this.historyAutocapture)===null||_===void 0||_.startIfEnabledOrStop()),(h=this.exceptionObserver)===null||h===void 0||h.startIfEnabledOrStop(),(d=this.deadClicksAutocapture)===null||d===void 0||d.startIfEnabledOrStop(),(p=this.surveys)===null||p===void 0||p.loadIfEnabled(),this.Su(),(m=this.externalIntegrations)===null||m===void 0||m.startIfEnabledOrStop(),!n.segment&&this.config.segment&&this.persistence&&Gst(this,mV,!1)}}_overrideSDKInfo(e,n){Ym.LIB_NAME=e,Ym.LIB_VERSION=n}startSessionRecording(e){const n=e===!0,o={sampling:n||!!e?.sampling,linked_flag:n||!!e?.linked_flag,url_trigger:n||!!e?.url_trigger,event_trigger:n||!!e?.event_trigger};var i,r,s,a,A;Object.values(o).some(Boolean)&&((i=this.sessionManager)===null||i===void 0||i.checkAndGetSessionAndWindowId(),o.sampling&&((r=this.sessionRecording)===null||r===void 0||r.overrideSampling()),o.linked_flag&&((s=this.sessionRecording)===null||s===void 0||s.overrideLinkedFlag()),o.url_trigger&&((a=this.sessionRecording)===null||a===void 0||a.overrideTrigger("url")),o.event_trigger&&((A=this.sessionRecording)===null||A===void 0||A.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===void 0)&&e.started)}captureException(e,n){try{if(!this.exceptions)return;const o=this.exceptions.buildProperties(e,{handled:!0,syntheticException:new Error("PostHog syntheticException")});return this.exceptions.sendExceptionEvent(sn(sn({},o),n))}catch{return}}addExceptionStep(e,n){var o;(o=this.exceptions)===null||o===void 0||o.addExceptionStep(e,n)}captureLog(e){var n;(n=this.logs)===null||n===void 0||n.captureLog(e)}get logger(){var e,n;return(e=(n=this.logs)===null||n===void 0?void 0:n.logger)!==null&&e!==void 0?e:EM.xh}startExceptionAutocapture(e){this.set_config({capture_exceptions:e==null||e})}stopExceptionAutocapture(){this.set_config({capture_exceptions:!1})}loadToolbar(e){var n,o;return(n=(o=this.toolbar)===null||o===void 0?void 0:o.loadToolbar(e))!==null&&n!==void 0&&n}get_property(e){var n;return(n=this.persistence)===null||n===void 0?void 0:n.props[e]}getSessionProperty(e){var n;return(n=this.sessionPersistence)===null||n===void 0?void 0:n.props[e]}toString(){var e;let n=(e=this.config.name)!==null&&e!==void 0?e:_V;return n!==_V&&(n="posthog."+n),n}_isIdentified(){var e,n;return((e=this.persistence)===null||e===void 0?void 0:e.get_property("$user_state"))==="identified"||((n=this.sessionPersistence)===null||n===void 0?void 0:n.get_property("$user_state"))==="identified"}mh(){var e,n;return!(this.config.person_profiles==="never"||this.config.person_profiles==="identified_only"&&!this._isIdentified()&&nx(this.getGroups())&&!(!((e=this.persistence)===null||e===void 0||(e=e.props)===null||e===void 0)&&e.__alias)&&!(!((n=this.persistence)===null||n===void 0||(n=n.props)===null||n===void 0)&&n.$epp))}eh(){return this.config.capture_pageleave===!0||this.config.capture_pageleave==="if_capture_pageview"&&!!this.config.capture_pageview}createPersonProfile(){this.mh()||this.yh("posthog.createPersonProfile")&&this.setPersonProperties({},{})}setInternalOrTestUser(){this.yh("posthog.setInternalOrTestUser")&&this.setPersonProperties({$internal_or_test_user:!0})}yh(e){return this.config.person_profiles==="never"?(gi.error(e+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this.yu(),this.bh(a2e,!0),!0)}ku(){if(this.config.cookieless_mode==="always")return!0;const e=this.consent.isOptedOut();return this.config.disable_persistence||e&&!(!this.config.opt_out_persistence_by_default&&this.config.cookieless_mode!=="on_reject")}Su(){var e,n;const o=this.ku();var i,r,s;return this.is_capturing()||(i=this.logs)===null||i===void 0||i.Ch(),((e=this.persistence)===null||e===void 0?void 0:e.hi)!==o&&((r=this.persistence)===null||r===void 0||r.set_disabled(o)),((n=this.sessionPersistence)===null||n===void 0?void 0:n.hi)!==o&&((s=this.sessionPersistence)===null||s===void 0||s.set_disabled(o)),o&&(this.Tu.clear(),this.gh()),o}opt_in_capturing(e){var n;if(this.config.cookieless_mode!=="always"){if(this.mu()){var o,i,r,s,a,A;(o=this.sessionRecording)===null||o===void 0||o.dispose({discardBufferedEvents:!0}),this.wh(!0,!0),(i=this.sessionManager)===null||i===void 0||i.destroy(),(r=this.pageViewManager)===null||r===void 0||r.destroy(),this.sessionManager=new Pat(this),this.pageViewManager=new Kst(this),this.persistence&&(this.sessionPropsManager=new vat(this,this.sessionManager,this.persistence));const h=(s=(a=this.config.__extensionClasses)===null||a===void 0?void 0:a.sessionRecording)!==null&&s!==void 0?s:(A=EM.__defaultExtensionClasses)===null||A===void 0?void 0:A.sessionRecording;var c,l;h&&(this.sessionRecording=this.gu(this.sessionRecording,new h(this)),this.hu&&((c=this.sessionRecording)===null||c===void 0||(l=c.onRemoteConfig)===null||l===void 0||l.call(c,this.hu)))}var g,u;this.consent.optInOut(!0),this.Su(),this.Xu(),(n=this.sessionRecording)===null||n===void 0||n.startIfEnabledOrStop(),this.config.cookieless_mode=="on_reject"&&((g=this.surveys)===null||g===void 0||g.loadIfEnabled()),(Eo(e?.captureEventName)||e?.captureEventName)&&this.capture((u=e?.captureEventName)!==null&&u!==void 0?u:"$opt_in",e?.captureProperties,{send_instantly:!0}),this.config.capture_pageview&&this.Yu()}else gi.warn(Hat)}opt_out_capturing(){if(this.config.cookieless_mode==="always")return void gi.warn(Hat);const e=this.config.cookieless_mode==="on_reject"?this.sessionRecording:void 0;var n,o;e?.dispose({discardBufferedEvents:!0}),this.config.cookieless_mode==="on_reject"&&this.consent.isOptedIn()&&this.wh(!0,!0),this.consent.optInOut(!1),this.Su(),this.config.cookieless_mode==="on_reject"&&(this.register({distinct_id:A2e,$device_id:null}),this.pu(e),this.sessionRecording=void 0,(n=this.sessionManager)===null||n===void 0||n.destroy(),(o=this.pageViewManager)===null||o===void 0||o.destroy(),this.sessionManager=void 0,this.sessionPropsManager=void 0,this.config.capture_pageview&&this.Yu(),this.Xu())}has_opted_in_capturing(){return this.consent.isOptedIn()}has_opted_out_capturing(){return this.consent.isOptedOut()}get_explicit_consent_status(){const e=this.consent.consent;return e===1?"granted":e===0?"denied":"pending"}is_capturing(){return this.config.cookieless_mode==="always"||(this.config.cookieless_mode==="on_reject"?this.consent.isRejected()||this.consent.isOptedIn():!this.has_opted_out_capturing())}clear_opt_in_out_capturing(){this.consent.reset(),this.Su()}_is_bot(){return F_?Mat(F_,this.config.custom_blocked_useragents):void 0}Yu(){No&&(No.visibilityState==="visible"?this.Pu||(this.Pu=!0,this.capture(u2e,{title:No.title},{send_instantly:!0}),this.Ru&&(No.removeEventListener(ZK,this.Ru),this.Ru=null)):this.Ru||(this.Ru=this.Yu.bind(this),jc(No,ZK,this.Ru)))}debug(e){e===!1?(Fn?.console.log("You've disabled debug mode."),this.set_config({debug:!1})):(Fn?.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)`."),this.set_config({debug:!0}))}el(){const e=this.Du||{};return"advanced_disable_flags"in e?!!e.advanced_disable_flags:this.config.advanced_disable_flags!==!1?!!this.config.advanced_disable_flags:this.config.advanced_disable_decide===!0?(gi.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):(function(n,o,i,r,s){const a=o in n&&!Fs(n[o]),A=i in n&&!Fs(n[i]);return a?n[o]:!!A&&(s&&s.warn(`Config field '${i}' is deprecated. Please use '${o}' instead. The old field will be removed in a future major version.`),n[i])})(e,"advanced_disable_flags","advanced_disable_decide",0,gi)}Os(e){var n;if(Fs(this.config.before_send))return e;const o=Object.keys((n=e.properties)!==null&&n!==void 0?n:{}).filter(J5n),i=As(this.config.before_send)?this.config.before_send:[this.config.before_send];let r=e;for(const s of i)try{if(r=s(r),Fs(r)){const a=`Event '${e.event}' was rejected in beforeSend function`;return z5n(e.event)?gi.warn(`${a}. This can cause unexpected behavior.`):gi.info(a),null}r.properties&&!nx(r.properties)||gi.warn(`Event '${e.event}' has no properties after beforeSend function, this is likely an error.`)}catch(a){return gi.error(`Error in beforeSend function for event '${e.event}':`,a),null}for(const s of o)if(r.properties&&Fs(r.properties[s]))return gi.warn(`Event '${e.event}' had its '${s}' property removed in a beforeSend function. This property is required for ingestion, so the event will be dropped.`),null;return r}getPageViewId(){var e;return(e=this.pageViewManager.Uo)===null||e===void 0?void 0:e.pageViewId}captureTraceFeedback(e,n){this.capture("$ai_feedback",{$ai_trace_id:String(e),$ai_feedback_text:n})}captureTraceMetric(e,n,o){this.capture("$ai_metric",{$ai_trace_id:String(e),$ai_metric_name:n,$ai_metric_value:String(o)})}Ou(e){const n=hy(e)&&!e,o=uc.At()&&uc.Ot("ph_debug")==="true";return!n&&(!!o||e)}};fV.__defaultExtensionClasses={},fV.xh=(()=>{const t=()=>{};return{trace:t,debug:t,info:t,warn:t,error:t,fatal:t}})(),(function(t,e){for(let n=0;e.length>n;n++)t.prototype[e[n]]=pBn(t.prototype[e[n]])})(fV,["identify"]);var zat=class{constructor(e){this.disabled=e===!1;const n=xA(e)?e:{};this.thresholdPx=n.threshold_px||30,this.timeoutMs=n.timeout_ms||1e3,this.clickCount=n.click_count||3,this.clicks=[]}isRageClick(e,n,o){if(this.disabled)return!1;const i=this.clicks[this.clicks.length-1];if(i&&Math.abs(e-i.x)+Math.abs(n-i.y)<this.thresholdPx&&this.timeoutMs>o-i.timestamp){if(this.clicks.push({x:e,y:n,timestamp:o}),this.clicks.length===this.clickCount)return!0}else this.clicks=[{x:e,y:n,timestamp:o}];return!1}};const J2e="$copy_autocapture",W2e=Ad("[AutoCapture]");function j2e(t,e){return e.length>t?e.slice(0,t)+"...":e}function E9n(t){if(t.previousElementSibling)return t.previousElementSibling;let e=t;do e=e.previousSibling;while(e&&!b9(e));return e}function B9n(t,{e,maskAllElementAttributes:n,maskAllText:o,elementAttributeIgnoreList:i,elementsChainAsString:r,disableCaptureUrlHashes:s}){var a,A;if(!b9(t))return{props:{}};const c=[t],l=new Set([t]);let g=t;for(;g.parentNode&&!j1(g,"body")&&1e3>c.length;){if(y2e(g.parentNode)){const x=g.parentNode.host;if(l.has(x))break;l.add(x),c.push(x),g=x;continue}if(!b9(g.parentNode)||l.has(g.parentNode))break;l.add(g.parentNode),c.push(g.parentNode),g=g.parentNode}const u=e.type==="click"&&t.namespaceURI==="http://www.w3.org/2000/svg"?c.findIndex(x=>j1(x,"button")||j1(x,"a")):-1;u>0&&(o=o||c.slice(0,u+1).some(x=>!Dk(x)||iV(x)));const h=[],d={};let p,m=!1,_=!1;if(vl(c,x=>{const E=Dk(x);if(j1(x,"a")&&!n&&!i?.includes("href")){const B=x.getAttribute("href");m=!!(E&&B&&rV(B))&&(s?iQ(B):B)}as(Mk(x),"ph-no-capture")&&(_=!0),h.push((function(B,S,Q,w,M=!1){const k=B.tagName.toLowerCase(),R={tag_name:k};E2e.indexOf(k)>-1&&!Q&&(R.$el_text=k.toLowerCase()==="a"||k.toLowerCase()==="button"?j2e(1024,Fst(B)):j2e(1024,nV(B)));const F=Mk(B);S||w?.includes("class")||0>=F.length||(R.classes=F.filter(function(J){return J!==""})),vl(B.attributes,function(J){var ee;if((!iV(B)||["name","id","class","aria-label"].indexOf(J.name)!==-1)&&!w?.includes(J.name)&&!S&&rV(J.value)&&(!nA(ee=J.name)||ee.substring(0,10)!=="_ngcontent"&&ee.substring(0,7)!=="_nghost")){let W=J.value;J.name==="class"&&(W=x2e(W).join(" ")),R["attr__"+J.name]=j2e(1024,J.name==="href"&&M?iQ(W):W)}});let O=1,U=1,Y=B;for(;Y=E9n(Y);)O++,Y.tagName===B.tagName&&U++;return R.nth_child=O,R.nth_of_type=U,R})(x,n,o,i,s)),vl((function(B){if(!Dk(B))return{};const S={};return vl(B.attributes,function(Q){if(Q.name&&Q.name.indexOf("data-ph-capture-attribute")===0){const w=Q.name.replace("data-ph-capture-attribute-",""),M=Q.value;w&&M&&rV(M)&&(S[w]=M)}}),S})(x),(B,S)=>{({}).hasOwnProperty.call(d,S)||(d[S]=B)})}),_)return{props:{},explicitNoCapture:_};if(u>0&&(t=c[u],h.splice(0,u)),o||(h[0].$el_text=j1(t,"a")||j1(t,"button")?Fst(t):nV(t)),m){var f,I;h[0].attr__href=m;const x=(f=x8(m))===null||f===void 0?void 0:f.host,E=Fn==null||(I=Fn.location)===null||I===void 0?void 0:I.host;x&&E&&x!==E&&(p=m)}return{props:jg((y=e.type,{$event_type:y,$ce_version:1}),r?{}:{$elements:h},{$elements_chain:(C=h,As(C)?(function(x){return x.map(E=>{var B,S;let Q="";if(E.tag_name&&(Q+=E.tag_name),E.attr_class){E.attr_class.sort();for(const k of E.attr_class)Q+=`.${k.replace(/"/g,"")}`}const w=sn(sn(sn(sn({},E.text?{text:E.text}:{}),{},{"nth-child":(B=E.nth_child)!==null&&B!==void 0?B:0,"nth-of-type":(S=E.nth_of_type)!==null&&S!==void 0?S:0},E.href?{href:E.href}:{}),E.attr_id?{attr_id:E.attr_id}:{}),E.attributes),M={};return tne(w).sort(([k],[R])=>(function(F,O){return O>F?-1:F>O?1:0})(k,R)).forEach(([k,R])=>M[Hst(k.toString())]=Hst(R.toString())),Q+=":",Q+=tne(M).map(([k,R])=>`${k}="${R}"`).join(""),Q}).join(";")})((function(x){return x.map(E=>{var B,S;const Q={text:(B=E.$el_text)===null||B===void 0?void 0:B.slice(0,400),tag_name:E.tag_name,href:(S=E.attr__href)===null||S===void 0?void 0:S.slice(0,2048),attr_class:PBn(E),attr_id:E.attr__id,nth_child:E.nth_child,nth_of_type:E.nth_of_type,attributes:{}};return tne(E).filter(([w])=>w.indexOf("attr__")===0).forEach(([w,M])=>Q.attributes[w]=M),Q})})(C)):"")},!((a=h[0])===null||a===void 0)&&a.$el_text?{$el_text:(A=h[0])===null||A===void 0?void 0:A.$el_text}:{},p&&e.type==="click"?{$external_click_url:p}:{},d),target:t};var C,y}var b9n=class{co(){this.do=void 0,clearTimeout(this.vo),this.vo=void 0}fo(e){var n;if(!Dk(e))return!0;const o=(n=this.po().css_selector_ignorelist)!==null&&n!==void 0?n:S2e,i=new Set;let r=e;for(;r;){if(i.size>=1e3||i.has(r))return!0;i.add(r);const s=r,a=Mk(s);if(as(a,"ph-no-capture")||as(a,"ph-sensitive")||iV(s)||o.some(c=>B2e(s,c)))return!0;const A=r.parentNode;r=y2e(A)?A.host:A&&b9(A)?A:null}return!1}mo(e){if(!this.isEnabled||e.type==="pointercancel")return void this.co();if(e.type==="pointerdown"){this.co();const i=oV(e);var n;return void(e.isPrimary&&e.button===0&&!e.ctrlKey&&i&&b9(i)&&(this.do={target:i,excluded:this.fo(i),id:e.pointerId,x:e.clientX,y:e.clientY,released:!1,distinctId:(n=this.yo)===null||n===void 0?void 0:n.distinctId}))}const o=this.do;o&&(e.pointerId!==o.id||Math.abs(e.clientX-o.x)>5||Math.abs(e.clientY-o.y)>5?this.co():e.type==="pointerup"&&(o.released=!0,this.vo=setTimeout(()=>this.co(),0)))}bo(e){var n;const o=this.do;this.co();const i=oV(e);if(o?.released&&o.target.isConnected&&o.distinctId===((n=this.yo)===null||n===void 0?void 0:n.distinctId)&&e.pointerId===o.id&&(e.detail>0||e.pointerType==="touch"||e.pointerType==="pen")&&e.button===0&&5>=Math.abs(e.clientX-o.x)&&5>=Math.abs(e.clientY-o.y)&&i&&(j1(i,"html")||j1(i,"body"))){var r;if(o.excluded)return null;const s=(r=this.po().css_selector_ignorelist)!==null&&r!==void 0?r:S2e;return[i,No?.documentElement,No?.body].some(a=>{if(!a)return!1;const A=Mk(a);return as(A,"ph-no-capture")||as(A,"ph-sensitive")||!Dk(a)||iV(a)||s.some(c=>B2e(a,c))})?null:o.target}}constructor(e){this._o=e,this.name="autocapture",this.wo=!1,this.ko=null,this.So=!1,this.xo=new Map,this.Co=!1,this.Mr={enabled:!1,rageclick:!1,maskAllElementAttributes:!1,maskAllText:!1,disableCaptureUrlHashes:!1,remoteRequestsDisabled:!1},this.$o=!1,this._o.refresh(this.Mr),this.rageclicks=new zat(this.Mr.rageclick),this.To=null}setup(e){this.Io(),this.yo=e;const n=e.onRemoteConfig(this.onRemoteConfig.bind(this));this.$o?n.dispose():(this.Mo=n,this.startIfEnabled())}dispose(){var e;this.$o||(this.$o=!0,this.yo=void 0,(e=this.Mo)===null||e===void 0||e.dispose(),this.Mo=void 0,this.xo.clear(),this.To=null,this.Eo())}po(){return this._o.refresh(this.Mr),this.Mr}Io(){var e,n;return this.po(),this.Mr.url_allowlist=(e=this.Mr.url_allowlist)===null||e===void 0?void 0:e.map(o=>new RegExp(o)),this.Mr.url_ignorelist=(n=this.Mr.url_ignorelist)===null||n===void 0?void 0:n.map(o=>new RegExp(o)),this.Mr}Po(){if(!this.isBrowserSupported())return void W2e.info("Disabling Automatic Event Collection because this browser is not supported");if(!Fn||!No)return;const e=this.Ro=n=>{n=n||Fn?.event;try{if(n.type==="blur")return void this.co();if(n.type.indexOf("pointer")===0)return void this.mo(n);const o=n.type==="click"?this.bo(n):void 0;if(ad(o))return;this.Ao(n,"$autocapture",o)}catch(o){W2e.error("Failed to capture event",o)}};if(jc(Fn,"blur",e),jc(No,"submit",e,{capture:!0}),jc(No,"change",e,{capture:!0}),jc(No,"click",e,{capture:!0}),vl(["pointerdown","pointermove","pointerup","pointercancel"],n=>{jc(No,n,e,{capture:!0})}),this.po().capture_copied_text){const n=this.Fo=o=>{o=o||Fn?.event;try{this.Ao(o,J2e)}catch(i){W2e.error("Failed to capture clipboard event",i)}};jc(No,"copy",n,{capture:!0}),jc(No,"cut",n,{capture:!0}),jc(No,"paste",n,{capture:!0})}}Eo(){this.co(),this.Ro&&(Fn?.removeEventListener("blur",this.Ro),vl(["pointerdown","pointermove","pointerup","pointercancel"],e=>{No?.removeEventListener(e,this.Ro,!0)}),No?.removeEventListener("submit",this.Ro,!0),No?.removeEventListener("change",this.Ro,!0),No?.removeEventListener("click",this.Ro,!0),this.Ro=void 0),this.Fo&&(No?.removeEventListener("copy",this.Fo,!0),No?.removeEventListener("cut",this.Fo,!0),No?.removeEventListener("paste",this.Fo,!0),this.Fo=void 0),this.wo=!1}startIfEnabled(){this.isEnabled||this.co(),!this.$o&&this.yo&&this.isEnabled&&!this.wo&&(this.Po(),this.wo=!0)}onRemoteConfig(e){if(this.$o)return;if(this.So=!0,!e.ok)return void this.startIfEnabled();const n=e.config;n.elementsChainAsString&&(this.Co=n.elementsChainAsString);const o=n.autocapture_opt_out;var i;hy(o)&&((i=this.yo)===null||i===void 0||i.kv.set("$autocapture_disabled_server_side",o),this.ko=o),this.startIfEnabled()}setElementSelectors(e,n=this){if(this.$o)return;e.size?this.xo.set(n,new Set(e)):this.xo.delete(n);const o=new Set;this.xo.forEach(i=>{i.forEach(r=>o.add(r))}),this.To=o}getElementSelectors(e,n){var o;const i=[];return(o=this.To)===null||o===void 0||o.forEach(r=>{const s=No?.querySelectorAll(r);s?.forEach(a=>{e!==a&&n!==a||as(i,r)||i.push(r)})}),i}get isEnabled(){var e,n;if(this.$o)return!1;const o=(e=this.yo)===null||e===void 0?void 0:e.kv.get(Vrt),i=this.ko,r=this.po();if(!r.remoteRequestsDisabled&&!this.So)return!1;const s=r.remoteRequestsDisabled&&!this.So;if(ad(i)&&!hy(o)&&!s)return!1;const a=(n=this.ko)!==null&&n!==void 0?n:!!o;return!!r.enabled&&!a}Ao(e,n="$autocapture",o){if(!this.isEnabled)return void this.co();let i=o||oV(e);Bst(i)&&(i=i.parentNode||null);const r=this.Io();var s;n==="$autocapture"&&e.type==="click"&&e instanceof MouseEvent&&r.rageclick&&(!((s=this.rageclicks)===null||s===void 0)&&s.isRageClick(e.clientX,e.clientY,e.timeStamp||new Date().getTime()))&&Mst(i,r.rageclick)&&this.Ao(e,"$rageclick",o);const a=n===J2e,A=a?sn(sn({},r),{},{dom_event_allowlist:void 0}):r;if(i&&(function(u,h,d,p,m,_){var f;if(!Fn||Q2e(u)||d?.url_allowlist&&!bst(d.url_allowlist,_)||d?.url_ignorelist&&bst(d.url_ignorelist,_))return!1;if(d?.dom_event_allowlist){const x=d.dom_event_allowlist;if(x&&!x.some(E=>h.type===E))return!1}const{parentIsUsefulElement:I,targetElementList:C}=Dst(u,p);if(!(function(x,E){const B=E?.element_allowlist;if(Eo(B))return!0;for(const S of x)if(B.some(Q=>S.tagName.toLowerCase()===Q))return!0;return!1})(C,d)||!b2e(C,d?.css_selector_allowlist)||b2e(C,(f=d?.css_selector_ignorelist)!==null&&f!==void 0?f:S2e))return!1;try{const x=Fn.getComputedStyle(u);if(x&&x.getPropertyValue("cursor")==="pointer"&&h.type==="click")return!0}catch{}const y=u.tagName.toLowerCase();switch(y){case"html":return!1;case"form":return(m||["submit"]).indexOf(h.type)>=0;case"input":case"select":case"textarea":return(m||["change","click"]).indexOf(h.type)>=0;default:return I?(m||["click"]).indexOf(h.type)>=0:(m||["click"]).indexOf(h.type)>=0&&(E2e.indexOf(y)>-1||u.getAttribute("contenteditable")==="true")}})(i,e,A,a,a?["copy","cut","paste"]:void 0,{config:{get_current_url:r.getCurrentUrl}})){var c;const{props:u,explicitNoCapture:h,target:d}=B9n(i,{e,maskAllElementAttributes:r.maskAllElementAttributes,maskAllText:r.maskAllText,elementAttributeIgnoreList:r.element_attribute_ignorelist,elementsChainAsString:this.Co,disableCaptureUrlHashes:r.disableCaptureUrlHashes});if(h)return!1;const p=this.getElementSelectors(i,d);if(p&&p.length>0&&(u.$element_selectors=p),n===J2e){const m=e.type||"clipboard";if(m!=="paste"){var l,g;const _=Fn==null||(l=Fn.getSelection())===null||l===void 0?void 0:l.toString(),f=Sst(_);if(!f)return!1;u.$selected_content=f,u.$clipboard_text_length=(g=_?.length)!==null&&g!==void 0?g:0}u.$copy_type=m}return(c=this.yo)===null||c===void 0||c.capture(n,u),!0}}isBrowserSupported(){return L_(No?.querySelectorAll)}},S9n=class{constructor(e){this._instance=e}refresh(e){const n=this._instance.config,o=xA(n.autocapture)?n.autocapture:void 0;e.enabled=!!n.autocapture,e.rageclick=n.rageclick,e.maskAllElementAttributes=n.mask_all_element_attributes,e.maskAllText=n.mask_all_text,e.disableCaptureUrlHashes=n.disable_capture_url_hashes,e.getCurrentUrl=n.get_current_url,e.remoteRequestsDisabled=this._instance.el(),e.url_allowlist=o?.url_allowlist,e.url_ignorelist=o?.url_ignorelist,e.dom_event_allowlist=o?.dom_event_allowlist,e.element_allowlist=o?.element_allowlist,e.css_selector_allowlist=o?.css_selector_allowlist,e.css_selector_ignorelist=o?.css_selector_ignorelist,e.element_attribute_ignorelist=o?.element_attribute_ignorelist,e.capture_copied_text=o?.capture_copied_text}};const IV=Ad("[ExceptionAutocapture]"),Jat=()=>{},Wat=t=>{var e;if(L_(t))return(e=t.__posthog_layer__)!==null&&e!==void 0?e:t.__rrweb_layer__};function CV(t,e,n){try{if(!(e in t))return Jat;const o={next:t[e]},i=n(function(...r){return o.next.apply(this,r)});return L_(i)&&(i.prototype=i.prototype||{},Object.defineProperties(i,{__posthog_wrapped__:{enumerable:!1,value:!0},__posthog_layer__:{enumerable:!1,value:o}})),t[e]=i,()=>{if(t[e]===i)return void(t[e]=o.next);let r=t[e],s=Wat(r);for(;s;){if(s.next===i)return void(s.next=o.next);r=s.next,s=Wat(r)}}}catch{return Jat}}const Q9n=Ad("[TracingHeaders]"),kM=Ad("[Web Vitals]"),jat=9e5,qat=["CLS","FCP","INP","LCP"],v9n=["INP","LCP"],w9n=["interactionTarget","interactionType","inputDelay","processingDuration","presentationDelay","loadState","target","url","timeToFirstByte","resourceLoadDelay","resourceLoadDuration","elementRenderDelay","largestShiftTarget","largestShiftTime","largestShiftValue","firstByteToFCP"],q2e="disabled",Xat="lazy_loading",b8=Ad("[SessionRecording]"),P9n=[c2e,l2e,rst,sst,ast,Ast,cst,lst,gst],M9n=Ad("[Heatmaps]");function X2e(t){return xA(t)&&"clientX"in t&&"clientY"in t&&jd(t.clientX)&&jd(t.clientY)}const hne=Ad("[Product Tours]"),$2e=t=>{var e;return!t.config.disable_product_tours&&!!(!((e=t.persistence)===null||e===void 0)&&e.get_property(o2e))},D9n=["$set_once","$set"],S9=Ad("[SiteApps]"),$at="Error while initializing PostHog app with config id ",Zat=(t,e)=>t?.then?t.then(e):e(t),Gk="SDK is not enabled or survey functionality is not yet loaded",eAt="Disabled. Not loading surveys.";var N9n=class{constructor(e,n){this._o=e,this.$h=n,this.name="surveys",this._surveyEventReceiver=null,this._surveyManager=null,this.Th=!1,this.Ih=!1,this.Mh=[],this.Eh=[],this.Ph=null,this.Rh=null,this.$o=!1,this.Ah=new Set,this.onRemoteConfig=o=>{if(this.$o||this.Mr.disableSurveys)return;if(!o.ok)return this.Ih=!0,this.Fh({isLoaded:!1,error:"Remote config unavailable. Not loading surveys."}),_l.warn("Remote config unavailable. Not loading surveys.");const i=o.config.surveys;if(Fs(i))return _l.warn("Flags not loaded yet. Not loading surveys.");this.Oh=hy(i)?i:i.length>0,_l.info(`flags response received, isSurveysEnabled: ${this.Oh}`),this.loadIfEnabled()},this.Fh=o=>{this.Eh.slice().forEach(i=>this.Dh(i,o))}}setup(e){if(!this.$o)return this.Lh=e,Zat(e.kv.initialize(),()=>{if(this.Lh!==e||this.$o)return;this.Lh=void 0,this.yo=e;const n=e.onRemoteConfig(this.onRemoteConfig);this.$o?n.dispose():(this.Mo=n,this.loadIfEnabled())})}dispose(){var e,n,o,i,r;this.$o||(this.$o=!0,this.Lh=void 0,this.yo=void 0,(e=this.Mo)===null||e===void 0||e.dispose(),this.Mo=void 0,(n=this._surveyEventReceiver)===null||n===void 0||n.dispose(),this._surveyEventReceiver=null,(o=this._surveyManager)===null||o===void 0||(i=o.dispose)===null||i===void 0||i.call(o),this._surveyManager=null,this.Mh=[],this.Eh.forEach(s=>{s.active=!1}),this.Eh=[],(r=this.Nh)===null||r===void 0||r.call(this),this.Nh=void 0,this.Ph=null,this.Ah.forEach(s=>clearTimeout(s)),this.Ah.clear())}get Mr(){return this._o.get()}initialize(){this.loadIfEnabled()}reset(){var e,n;(e=this._surveyManager)===null||e===void 0||(n=e.clearInMemoryInProgressSurveyState)===null||n===void 0||n.call(e);try{var o;(o=this._surveyEventReceiver)===null||o===void 0||o.reset(),localStorage.removeItem("lastSeenSurveyDate");const i=[];for(let r=0;r<localStorage.length;r++){const s=localStorage.key(r);(s?.startsWith("seenSurvey_")||s?.startsWith("inProgressSurvey_"))&&i.push(s)}i.forEach(r=>localStorage.removeItem(r))}catch{}this.Fh()}loadIfEnabled(){if(this.$o||!this.yo)return;const e=this.Mr;if(this._surveyManager)return;if(this.Th)return void _l.info("Already initializing surveys, skipping...");if(e.disableSurveys)return void _l.info(eAt);if(e.cookielessMode&&this._o.isOptedOut())return void _l.info("Not loading surveys in cookieless mode without consent.");const n=this._o.getExtensions();if(!n)return void this.qh("PostHog Extensions not found.");if(Eo(this.Oh)&&!e.advancedEnableSurveys)return;const o=this.Oh||e.advancedEnableSurveys;this.Th=!0,this.Ih=!1;try{const i=n.generateSurveys;if(i)return this.jh(i,o),void(this.Th=!1);const r=n.loadExternalDependency;if(!r)return this.qh(g2e),void(this.Th=!1);r(s=>{try{if(this.$o)return;const a=this._o.getExtensions();s||!a?.generateSurveys?this.qh("Could not load surveys script",s):this.jh(a.generateSurveys,o)}finally{this.Th=!1}})}catch(i){throw this.Th=!1,this.qh("Error initializing surveys",i),i}}jh(e,n){var o,i;if(this.$o)return;this._surveyManager=e(n),this._surveyEventReceiver=this._o.createEventReceiver(this.Fh);const r=(o=(i=this.yo)!==null&&i!==void 0?i:this.$h)===null||o===void 0?void 0:o.kv.get(qK);r&&this.Bh(r),_l.info("Surveys loaded successfully"),this.Hh(),this.Fh(),this.zh({isLoaded:!0})}qh(e,n){this.Ih=!0,_l.error(e,n),this.Fh({isLoaded:!1,error:e}),this.zh({isLoaded:!1,error:e})}onSurveysLoaded(e){return this.Mh.push(e),this._surveyManager&&this.zh({isLoaded:!0}),()=>{this.Mh=this.Mh.filter(n=>n!==e)}}getSurveys(e,n=!1){var o;const i=(o=this.yo)!==null&&o!==void 0?o:this.$h;if(!i||this.$o)return;if(this.Mr.disableSurveys)return _l.info(eAt),e([]);const r=i.kv.get(qK);if(r&&!n)return e(r,{isLoaded:!0}),void(this.Uh()&&this.getSurveys(()=>{},!0));if(this.Ph)return void this.Ph.then(({surveys:A,context:c})=>{this.$o||e(A,c)}).catch(A=>_l.error("Error in survey callback",A));const s=this.Wh("/api/surveys/",{method:"GET",query:{token:i.projectToken},sentAt:"query",timeoutMs:this.Mr.requestTimeoutMs}).then(A=>{try{return this.Vh(i,A)}catch(c){return _l.error("Error processing surveys response",c),this.Vh(i,{statusCode:0,error:c})}},A=>this.Vh(i,{statusCode:0,error:A}));this.Ph=s;const a=()=>{this.Ph===s&&(this.Ph=null)};s.then(A=>{a(),this.$o||(this.Fh(A.context),e(A.surveys,A.context))},a).catch(A=>_l.error("Error in survey callback",A))}Wh(e,n){const o=this.yo;return o?o.sendRequest(e,n):new Promise(i=>i({statusCode:0,error:new Error(Gk)}))}Vh(e,n){if(this.$o)return{surveys:[],context:{isLoaded:!1,error:Gk}};const o=n.statusCode;if(o!==200||!n.json){const r=`Surveys API could not be loaded, status: ${o}`;return o!==0?_l.error(r):n.error||_l.warn(r),this.Rh=Date.now(),{surveys:[],context:{isLoaded:!1,error:r}}}this.Rh=null;const i=n.json.surveys||[];return e.kv.set({[qK]:i,[$te]:Date.now()}),this.Bh(i),{surveys:i,context:{isLoaded:!0}}}Bh(e){var n;const o=e.filter(i=>(function(r){return!(!r.start_date||r.end_date)})(i)&&(Nat(i)||(function(r){var s;return!!(!((s=r.conditions)===null||s===void 0||(s=s.actions)===null||s===void 0||(s=s.values)===null||s===void 0)&&s.length)})(i)));(n=this._surveyEventReceiver)===null||n===void 0||n.replace(o)}Uh(){return this.Gh()&&!this.Ph&&!this.Zh()}Gh(){var e,n;const o=(e=(n=this.yo)!==null&&n!==void 0?n:this.$h)===null||e===void 0?void 0:e.kv.get($te);return jd(o)&&Date.now()-o>3e5}Zh(){return jd(this.Rh)&&3e5>Date.now()-this.Rh}markSurveyAsSeen(e,n){var o;const i={id:e,current_iteration:(o=n?.iteration)!==null&&o!==void 0?o:null};Fat(i);try{localStorage.setItem("lastSeenSurveyDate",new Date().toISOString())}catch{}this.Fh()}zh(e){for(const n of this.Mh)try{if(!e.isLoaded)return n([],e);this.getSurveys(n)}catch(o){_l.error("Error in survey callback",o)}}getActiveMatchingSurveys(e,n=!1){if(!Fs(this._surveyManager))return this._surveyManager.getActiveMatchingSurveys(e,n);_l.warn("init was not called")}onActiveMatchingSurveysChanged(e){var n,o;if(this.$o)return()=>{};const i={callback:e,active:!0,revision:0};this.Eh.push(i),this.Hh();const r=(n=(o=this.yo)!==null&&o!==void 0?o:this.$h)===null||n===void 0?void 0:n.kv.get(qK);return this.Mr.disableSurveys||!this._surveyManager&&this.Ih&&!this.Th||!r&&!Fs(this.Rh)&&!this.Ph?this.Dh(i,{isLoaded:!1}):this._surveyManager&&this.Dh(i),()=>{var s;i.active=!1,this.Eh=this.Eh.filter(a=>a!==i),this.Eh.length===0&&((s=this.Nh)===null||s===void 0||s.call(this),this.Nh=void 0)}}Hh(){var e,n,o;this._surveyManager&&this.Eh.length>0&&((e=this.Nh)!==null&&e!==void 0||(this.Nh=(n=(o=this._o).onMatchingConditionsChanged)===null||n===void 0?void 0:n.call(o,this.Fh)))}Dh(e,n){if(this.$o||!e.active)return;const o=++e.revision,i=r=>{if(!this.$o&&e.active&&o===e.revision)try{const s=n??{isLoaded:!0},a=JSON.stringify([r,s]);if(a===e.lastResult)return;e.lastResult=a,e.callback(r,s)}catch(s){_l.error("Error in active matching surveys callback",s)}};try{n&&!n.isLoaded?i([]):this.getActiveMatchingSurveys(i)}catch(r){_l.error("Error in active matching surveys callback",r)}}Qh(e){let n=null;return this.getSurveys(o=>{var i;n=(i=o.find(r=>r.id===e))!==null&&i!==void 0?i:null}),n}Jh(e){if(Fs(this._surveyManager))return{eligible:!1,reason:Gk};const n=typeof e=="string"?this.Qh(e):e;return n?this._surveyManager.checkSurveyEligibility(n):{eligible:!1,reason:"Survey not found"}}Kh(e){if(!this._o.isCapturing())return{eligible:!1,reason:"PostHog is not capturing, so a survey response cannot be recorded"};if(Fs(this._surveyManager))return{eligible:!1,reason:Gk};const n=typeof e=="string"?this.Qh(e):e;return n?this._surveyManager.checkSurveyRenderability(n):{eligible:!1,reason:"Survey not found"}}canRenderSurvey(e){if(Fs(this._surveyManager))return _l.warn("init was not called"),{visible:!1,disabledReason:Gk};const n=this.Kh(e);return{visible:n.eligible,disabledReason:n.reason}}canRenderSurveyAsync(e,n){return Fs(this._surveyManager)?(_l.warn("init was not called"),Promise.resolve({visible:!1,disabledReason:Gk})):new Promise(o=>{this.getSurveys(i=>{var r;const s=(r=i.find(a=>a.id===e))!==null&&r!==void 0?r:null;if(s){const a=this.Kh(s);o({visible:a.eligible,disabledReason:a.reason})}else o({visible:!1,disabledReason:"Survey not found"})},n)})}renderSurvey(e,n,o){var i;if(!this._o.isCapturing())return;if(Fs(this._surveyManager))return void _l.warn("init was not called");const r=typeof e=="string"?this.Qh(e):e;if(!r?.id)return void _l.warn("Survey not found");if(!A9n.includes(r.type))return void _l.warn(`Surveys of type ${r.type} cannot be rendered in the app`);const s=No?.querySelector(n);if(s){if(!((i=r.appearance)===null||i===void 0)&&i.surveyPopupDelaySeconds){_l.info(`Rendering survey ${r.id} with delay of ${r.appearance.surveyPopupDelaySeconds} seconds`);const a=setTimeout(()=>{var A,c;this.Ah.delete(a),!this.$o&&this._o.isCapturing()&&(_l.info(`Rendering survey ${r.id} with delay of ${(A=r.appearance)===null||A===void 0?void 0:A.surveyPopupDelaySeconds} seconds`),(c=this._surveyManager)===null||c===void 0||c.renderSurvey(r,s,o),_l.info(`Survey ${r.id} rendered`))},1e3*r.appearance.surveyPopupDelaySeconds);return void this.Ah.add(a)}this._surveyManager.renderSurvey(r,s,o)}else _l.warn("Survey element not found")}displaySurvey(e,n){var o;if(!this._o.isCapturing())return;if(Fs(this._surveyManager))return void _l.warn("init was not called");const i=this.Qh(e);if(!i)return void _l.warn("Survey not found");let r=i;if(!((o=i.appearance)===null||o===void 0)&&o.surveyPopupDelaySeconds&&n.ignoreDelay&&(r=sn(sn({},i),{},{appearance:sn(sn({},i.appearance),{},{surveyPopupDelaySeconds:0})})),n.displayType!==D2e.Popover&&n.initialResponses&&_l.warn("initialResponses is only supported for popover surveys. prefill will not be applied."),n.ignoreConditions===!1){const s=this.Jh(i);if(!s.eligible)return void _l.warn("Survey is not eligible to be displayed: ",s.reason)}n.displayType!==D2e.Inline?this._surveyManager.handlePopoverSurvey(r,n):this.renderSurvey(r,n.selector,n.properties)}cancelPendingSurvey(e){Fs(this._surveyManager)?_l.warn("init was not called"):this._surveyManager.cancelSurvey(e)}handlePageUnload(){var e,n;(e=this._surveyManager)===null||e===void 0||(n=e.handlePageUnload)===null||n===void 0||n.call(e)}};function Yk(t,e,n){if(Fs(t))return!1;switch(n){case"exact":return t===e;case"contains":{const o=e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/_/g,".").replace(/%/g,".*");return new RegExp(o,"i").test(t)}case"regex":try{return new RegExp(e).test(t)}catch{return!1}default:return!1}}var R9n=class{constructor(e){this._instance=e,this.Xh=new Set,this.Yh=new Set,this.tc=new gne,this.ec=(n,o)=>this.nc(n,o)&&this.sc(n,o)&&this.rc(n,o)&&this.oc(n,o),this.nc=(n,o)=>!o?.event||n?.event===o?.event}init(){var e,n;Eo((e=this._instance)===null||e===void 0?void 0:e._addCaptureHook)||(this.ac=(n=this._instance)===null||n===void 0?void 0:n._addCaptureHook((o,i)=>{this.on(o,i)}))}dispose(){var e,n;(e=this.ac)===null||e===void 0||e.call(this),this.ac=void 0,(n=this._instance)===null||n===void 0||(n=n.autocapture)===null||n===void 0||n.setElementSelectors(new Set,this),this.tc=new gne}register(e){var n,o;if(!Eo((n=this._instance)===null||n===void 0?void 0:n._addCaptureHook)&&(e.forEach(i=>{var r;this.Xh.add(i),(r=i.steps)===null||r===void 0||r.forEach(s=>{this.Yh.add(s?.event||"")})}),(o=this._instance)===null||o===void 0?void 0:o.autocapture)){const i=new Set;this.Xh.forEach(r=>{var s;(s=r.steps)===null||s===void 0||s.forEach(a=>{a?.selector&&i.add(a.selector)})}),this._instance.autocapture.setElementSelectors(i,this)}}replace(e){this.Xh.clear(),this.Yh.clear(),this.register(e)}on(e,n){n!=null&&e.length!=0&&(this.Yh.has(e)||this.Yh.has(n.event))&&this.Xh.forEach(o=>{this.lc(n,o)&&this.tc.emit("actionCaptured",o.name)})}uc(e){this.onAction("actionCaptured",n=>e(n))}lc(e,n){if(n?.steps==null)return!1;for(const o of n.steps)if(this.ec(e,o))return!0;return!1}onAction(e,n){return this.tc.on(e,n)}sc(e,n){if(n?.url){var o;const i=e==null||(o=e.properties)===null||o===void 0?void 0:o.$current_url;if(!i||typeof i!="string"||!Yk(i,n.url,n.url_matching||"contains"))return!1}return!0}rc(e,n){return!!this.hc(e,n)&&!!this.cc(e,n)&&!!this.dc(e,n)}hc(e,n){var o;if(!n?.href)return!0;const i=this.vc(e);if(i.length>0)return i.some(s=>Yk(s.href,n.href,n.href_matching||"exact"));const r=(e==null||(o=e.properties)===null||o===void 0?void 0:o.$elements_chain)||"";return!!r&&Yk((function(s){const a=s.match(/(?::|")href="(.*?)"/);return a?a[1]:""})(r),n.href,n.href_matching||"exact")}cc(e,n){var o;if(!n?.text)return!0;const i=this.vc(e);if(i.length>0)return i.some(c=>Yk(c.text,n.text,n.text_matching||"exact")||Yk(c.$el_text,n.text,n.text_matching||"exact"));const r=(e==null||(o=e.properties)===null||o===void 0?void 0:o.$elements_chain)||"";return!!r&&(s=(function(c){const l=[],g=/(?::|")text="(.*?)"/g;let u;for(;!Fs(u=g.exec(c));)l.includes(u[1])||l.push(u[1]);return l})(r),a=n.text,A=n.text_matching||"exact",s.some(c=>Yk(c,a,A)));var s,a,A}dc(e,n){var o,i;if(!n?.selector)return!0;const r=e==null||(o=e.properties)===null||o===void 0?void 0:o.$element_selectors;if(r?.includes(n.selector))return!0;const s=(e==null||(i=e.properties)===null||i===void 0?void 0:i.$elements_chain)||"";if(n.selector_regex&&s)try{return new RegExp(n.selector_regex).test(s)}catch{return!1}return!1}vc(e){var n;return(e==null||(n=e.properties)===null||n===void 0?void 0:n.$elements)==null?[]:e?.properties.$elements}oc(e,n){return!n?.properties||n.properties.length===0||Tat(n.properties.reduce((o,i)=>{const r=As(i.value)?i.value.map(String):i.value!=null?[String(i.value)]:[];return o[i.key]={values:r,operator:i.operator||"exact"},o},{}),e?.properties)}},T9n=class{constructor(e,n){var o,i;this.fc=[],this._instance=e,this.gc=n,this.mc=new Map,this.yc=new Map,this.bc=new Map,this._c=(o=this._instance)===null||o===void 0||(i=o.onSessionId)===null||i===void 0?void 0:i.call(o,r=>this.wc(r))}kc(e){return!1}Sc(){return null}xc(e){}Cc(){}$c(e,n){return!!e&&Tat(e.propertyFilters,n?.properties)}Tc(e,n){const o=new Map;return e.forEach(i=>{var r;(r=i.conditions)===null||r===void 0||(r=r[n])===null||r===void 0||(r=r.values)===null||r===void 0||r.forEach(s=>{if(s?.name){const a=o.get(s.name)||[];a.push(i.id),o.set(s.name,a)}})}),o}Ic(e,n,o){const i=(o===lV.Activation?this.mc:this.yc).get(e);let r=[];return this.Mc(s=>{r=s.filter(a=>i?.includes(a.id))}),r.filter(s=>{var a;const A=(a=s.conditions)===null||a===void 0||(a=a[o])===null||a===void 0||(a=a.values)===null||a===void 0?void 0:a.find(c=>c.name===e);return this.$c(A,n)})}register(e){this.Ec(e,!1)}replace(e){this.Ec(e,!0)}Ec(e,n){var o;Eo((o=this._instance)===null||o===void 0?void 0:o._addCaptureHook)||(this.Pc(e,n),this.Rc(e,n))}Rc(e,n){const o=e.filter(s=>{var a;return(a=s.conditions)===null||a===void 0||(a=a.actions)===null||a===void 0||(a=a.values)===null||a===void 0?void 0:a.length});var i;if(n&&this.bc.clear(),o.length===0)return void(n&&((i=this.Ac)===null||i===void 0||i.replace([])));this.Ac||(this.Ac=new R9n(this._instance),this.Ac.init(),this.Ac.uc(s=>this.onAction(s)));const r=[];o.forEach(s=>{var a;(a=s.conditions)===null||a===void 0||(a=a.actions)===null||a===void 0||a.values.forEach(A=>{if(r.push(A),A.name){var c;const l=(c=this.bc.get(A.name))!==null&&c!==void 0?c:[];l.includes(s.id)||l.push(s.id),this.bc.set(A.name,l)}})}),n?this.Ac.replace(r):this.Ac.register(r)}Fc(e,n){n.forEach((o,i)=>{var r;const s=(r=e.get(i))!==null&&r!==void 0?r:[];o.forEach(a=>{s.includes(a)||s.push(a)}),e.set(i,s)})}Pc(e,n){var o,i;const r=e.filter(c=>{var l,g;return((l=c.conditions)===null||l===void 0?void 0:l.events)&&((g=c.conditions)===null||g===void 0||(g=g.events)===null||g===void 0||(g=g.values)===null||g===void 0?void 0:g.length)>0}),s=e.filter(c=>{var l,g;return((l=c.conditions)===null||l===void 0?void 0:l.cancelEvents)&&((g=c.conditions)===null||g===void 0||(g=g.cancelEvents)===null||g===void 0||(g=g.values)===null||g===void 0?void 0:g.length)>0}),a=this.Tc(e,lV.Activation),A=this.Tc(e,lV.Cancellation);n?(this.mc=a,this.yc=A):(this.Fc(this.mc,a),this.Fc(this.yc,A)),(r.length!==0||s.length!==0||e.some(c=>{var l;return(l=c.conditions)===null||l===void 0||(l=l.actions)===null||l===void 0||(l=l.values)===null||l===void 0?void 0:l.length}))&&((o=this.ac)!==null&&o!==void 0||(this.ac=(i=this._instance)===null||i===void 0?void 0:i._addCaptureHook((c,l)=>{this.onEvent(c,l)})))}onEvent(e,n){var o,i;const r=this.Oc(),s=(n==null||(o=n.properties)===null||o===void 0?void 0:o.$survey_id)||(n==null||(i=n.properties)===null||i===void 0?void 0:i.$product_tour_id);if(s&&this.getActivatedIds().includes(s)){const A=this.Dc(e,s,n);if(A==="consume")return r.info("event consumed activated item, removing it",{event:e,itemId:s}),void this.Lc([s]);if(A==="persist")return r.info("shown item promoted to persisted activation",{event:e,itemId:s}),this.Nc(s),void this.qc([s])}if(this.yc.has(e)){const A=this.Ic(e,n,lV.Cancellation);A.length>0&&(r.info("cancel event matched, cancelling items",{event:e,itemsToCancel:A.map(c=>c.id)}),this.Lc(A.map(c=>c.id)),A.forEach(c=>this.jc(c.id)))}if(!this.mc.has(e))return;r.info("event name matched",{event:e,eventPayload:n,items:this.mc.get(e)});const a=this.Ic(e,n,lV.Activation);this.Bc(a.map(A=>A.id))}onAction(e){this.bc.has(e)&&this.Bc(this.bc.get(e)||[])}Bc(e){var n,o;if(e.length===0)return;const i=!!(!((n=this._instance)===null||n===void 0||(o=n.get_session_id)===null||o===void 0)&&o.call(n)),r=[];for(const s of e)i&&this.kc(s)?this.Nc(s)&&this.Hc(s):r.push(s);r.length>0&&(this.fc=[...new Set([...this.fc,...r])]),this.Oc().info("updating activated items",{activatedItems:this.getActivatedIds()}),this.zc()}Nc(e){this.fc=this.fc.filter(o=>o!==e);const n=this.Uc();return!n.includes(e)&&(this.Wc([...n,e]),this.Vc(),!0)}Lc(e){const n=new Set(e);this.fc=this.fc.filter(r=>!n.has(r));const o=this.Gc(),i=o.filter(r=>!n.has(r));i.length!==o.length&&(this.Wc(i),i.length===0&&this.Zc()),this.qc(e),this.zc()}zc(){try{var e;(e=this.gc)===null||e===void 0||e.call(this)}catch(n){this.Oc().error("Error while handling activated items change",n)}}Qc(){var e;const n=this.Sc();if(!n)return{};const o=(e=this._instance)===null||e===void 0||(e=e.persistence)===null||e===void 0?void 0:e.props[n];return o&&typeof o=="object"?o:{}}Hc(e){if(!this.Sc())return;const n=this.Qc();this.xc(sn(sn({},n),{},{[e]:Date.now()}))}qc(e){if(!this.Sc())return;const n=this.Qc(),o={};let i=!1;for(const[r,s]of Object.entries(n))e.includes(r)?i=!0:o[r]=s;i&&(nx(o)?this.Cc():this.xc(o))}Jc(){this.Sc()&&this.Cc()}getActivationTimestamp(e){if(!this.Uc().includes(e))return;const n=this.Qc()[e];return jd(n)?n:void 0}Gc(){var e;const n=this.Kc();return((e=this._instance)===null||e===void 0||(e=e.persistence)===null||e===void 0?void 0:e.props[n])||[]}Uc(){var e,n,o;const i=this.Gc();if(i.length===0)return[];const r=(e=this._instance)===null||e===void 0||(e=e.persistence)===null||e===void 0?void 0:e.props[this.Xc()],s=(n=this._instance)===null||n===void 0||(o=n.get_session_id)===null||o===void 0?void 0:o.call(n);return s&&r===s?i:[]}Vc(){var e,n;const o=(e=this._instance)===null||e===void 0||(n=e.get_session_id)===null||n===void 0?void 0:n.call(e);o&&this.Yc(o)}Zc(){this.td()}wc(e){var n;const o=(n=this._instance)===null||n===void 0||(n=n.persistence)===null||n===void 0?void 0:n.props[this.Xc()];if(o&&o!==e){const i=this.Gc(),r=this.Qc();i.length>0&&(this.Wc([]),i.filter(s=>jd(r[s])).forEach(s=>this.jc(s))),this.Zc(),this.Jc(),i.length>0&&this.zc()}}getActivatedIds(){return[...new Set([...this.Uc(),...this.fc])].filter(e=>!this.ed(e))}dispose(){var e,n,o;(e=this._c)===null||e===void 0||e.call(this),this._c=void 0,(n=this.ac)===null||n===void 0||n.call(this),this.ac=void 0,(o=this.Ac)===null||o===void 0||o.dispose(),this.Ac=void 0}reset(){this.fc=[],this.Gc().length>0&&this.Wc([]),this.Zc(),this.Jc(),this.zc()}getEventToItemsMap(){return this.mc}nd(){return this.Ac}},k9n=class extends T9n{constructor(e,n){super(e,n)}Kc(){return Xrt}Xc(){return $rt}Sc(){return Zrt}xc(e){var n;(n=this._instance)===null||n===void 0||(n=n.persistence)===null||n===void 0||n.register({$surveys_activated_timestamps:e})}Cc(){var e;(e=this._instance)===null||e===void 0||(e=e.persistence)===null||e===void 0||e.unregister("$surveys_activated_timestamps")}kc(e){var n;let o;this.Mc(r=>{o=r.find(s=>s.id===e)});const i=o==null||(n=o.appearance)===null||n===void 0?void 0:n.surveyPopupDelaySeconds;return jd(i)&&i>0}sd(){return D3.SHOWN}Mc(e){var n;(n=this._instance)===null||n===void 0||n.getSurveys(e)}jc(e){var n;(n=this._instance)===null||n===void 0||n.cancelPendingSurvey(e)}Oc(){return _l}Wc(e){var n;(n=this._instance)===null||n===void 0||(n=n.persistence)===null||n===void 0||n.register({$surveys_activated:e})}Yc(e){var n;(n=this._instance)===null||n===void 0||(n=n.persistence)===null||n===void 0||n.register({$surveys_activated_session:e})}td(){var e;(e=this._instance)===null||e===void 0||(e=e.persistence)===null||e===void 0||e.unregister("$surveys_activated_session")}ed(){return!1}Dc(e,n,o){var i;if(e===D3.SENT&&(o==null||(i=o.properties)===null||i===void 0?void 0:i.$survey_completed)===!1)return"ignore";let r;return this.Mc(s=>{r=s.find(a=>a.id===n)}),!r||(function(s){var a;return Nat(s)&&!!(!((a=s.conditions)===null||a===void 0||(a=a.events)===null||a===void 0)&&a.repeatedActivation)||s.schedule==="always"})(r)?e===D3.SHOWN?"consume":"ignore":e===D3.SHOWN?"persist":e===D3.DISMISSED||e===D3.SENT?"consume":"ignore"}getSurveys(){return this.getActivatedIds()}getEventToSurveys(){return this.getEventToItemsMap()}},F9n=class{constructor(e){this._instance=e}initialize(){}get(e){if(typeof e=="string")return this._instance.get_property(e);const n={};for(const o of e){const i=this._instance.get_property(o);Eo(i)||(n[o]=i)}return n}set(e,n){this._instance.register(typeof e=="string"?{[e]:n}:e)}remove(e){typeof e!="string"?e.forEach(n=>this._instance.unregister(n)):this._instance.unregister(e)}},L9n=class{constructor(e){this._instance=e}get(){const e=this._instance.config;return{disableSurveys:e.disable_surveys,cookielessMode:!!e.cookieless_mode,advancedEnableSurveys:e.advanced_enable_surveys,requestTimeoutMs:e.surveys_request_timeout_ms}}isOptedOut(){return this._instance.consent.isOptedOut()}isCapturing(){return this._instance.is_capturing()}getExtensions(){const e=Ur?.__PosthogExtensions__;if(!e)return;const{generateSurveys:n,loadExternalDependency:o}=e;return{generateSurveys:n?i=>n(this._instance,i):void 0,loadExternalDependency:o?i=>o(this._instance,"surveys",i):void 0}}createEventReceiver(e){return new k9n(this._instance,e)}onMatchingConditionsChanged(e){const n=this._instance._addCaptureHook(s=>{s!=="$pageview"&&s!==D3.SHOWN&&s!==D3.DISMISSED&&s!==D3.SENT||e()}),o=()=>e();jc(Fn,"PHSurveyShown",o);let i=!1;const r=this._instance.onFeatureFlags(()=>{i&&e()});return i=!0,()=>{i=!1,n(),r(),Fn?.removeEventListener("PHSurveyShown",o)}}};const H9n=Fn?.location?ine(Fn.location.hash,"__posthog")||ine(location.hash,"state"):null,tAt="_postHogToolbarParams",nAt=Ad("[Toolbar]"),oAt=Ad("[FeatureFlags]");var O9n=class{constructor(e,n=!1){this.rd=!1,this.update(e,n)}update(e,n){this.od=((o,i)=>{var r,s,a,A,c,l,g,u;return{bootstrap:{featureFlags:(r=(s=o.bootstrap)===null||s===void 0?void 0:s.featureFlags)!==null&&r!==void 0?r:void 0,featureFlagPayloads:(a=(A=o.bootstrap)===null||A===void 0?void 0:A.featureFlagPayloads)!==null&&a!==void 0?a:void 0},remoteRequestsDisabled:i,featureFlagsDisabled:!!o.advanced_disable_feature_flags,onlyEvaluateSurveyFeatureFlags:!!o.advanced_only_evaluate_survey_feature_flags,deduplicateCallsPerSession:!!o.advanced_feature_flags_dedup_per_session,cacheTtlMs:o.feature_flag_cache_ttl_ms,refreshIntervalMs:(c=o.remote_config_refresh_interval_ms)!==null&&c!==void 0?c:3e5,idleRefreshBackoff:Eo(o.remote_config_refresh_interval_ms),requestTimeoutMs:o.feature_flag_request_timeout_ms,requestMaxRetries:Math.max(0,(l=o.feature_flag_request_max_retries)!==null&&l!==void 0?l:1),compression:o.disable_compression?void 0:"best-available",evaluationContexts:(g=(u=o.evaluation_contexts)!==null&&u!==void 0?u:o.evaluation_environments)!==null&&g!==void 0?g:[],flagKeys:As(o.flag_keys)?o.flag_keys:void 0}})(e,n),!e.evaluation_environments||e.evaluation_contexts||this.rd||(oAt.warn("evaluation_environments is deprecated. Use evaluation_contexts instead. evaluation_environments will be removed in a future version."),this.rd=!0),Eo(e.flag_keys)||As(e.flag_keys)||oAt.error("Invalid flag_keys found:",e.flag_keys,"Expected array of non-empty strings")}get(){return this.od}};const iAt=Ad("[FeatureFlags]"),FM=Ad("[FeatureFlags]",{debugEnabled:!0}),Z2e=`" failed. Feature flags didn't load in time.`,G9n=[502,504],rAt=["click","keydown","wheel","touchstart","pointerdown"],sAt="connection_error",aAt=t=>{const e={};for(let n=0;t.length>n;n++)e[t[n]]=!0;return e},AAt=t=>{const e={};for(const[n,o]of tne(t||{}))o&&(e[n]=o);return e},cAt=t=>xk(t)&&(t.name==="RangeError"&&t.message.indexOf("Maximum call stack size exceeded")===0||t.name==="InternalError"&&t.message==="too much recursion"),L4=Ad("[Error tracking]"),exe="webkit-masked-url:",Y9n=[{value:"isolatedAPI.contexts.topHostname",exact:!1},{value:"No response from target",exact:!0}],U9n=["chrome-extension://","moz-extension://","safari-extension:","safari-web-extension:",exe],K9n=["__firefox__","__gCrWeb"],lAt="Refusing to render web experiment since the viewer is a likely bot",V9n={icontains:(t,e)=>e.toLowerCase().indexOf(t.toLowerCase())>-1,not_icontains:(t,e)=>e.toLowerCase().indexOf(t.toLowerCase())===-1,regex:(t,e)=>une(e,t),not_regex:(t,e)=>!une(e,t),exact:(t,e)=>e===t,is_not:(t,e)=>e!==t},p5=Ad("[Conversations]"),LM="Conversations not available yet.";function gAt(t,e){var n,o,i,r,s,a,A;const c=(n=t?.flushIntervalMs)!==null&&n!==void 0?n:3e3,l=(o=t?.maxBufferSize)!==null&&o!==void 0?o:100,g=e?.consoleCapture?void 0:(i=t?.maxLogsPerInterval)!==null&&i!==void 0?i:1e3,u=Eo(g)?Math.max(l,2048):Math.max(l,g),h=sn(sn({},(function(){let d="",p="";try{const m=F_?.userAgent;m&&([d,p]=ort(m))}catch{}return(function(m,_){const f=(function(I){if(I)return{}.hasOwnProperty.call(Drt,I)?Drt[I]:I})(m);return sn(sn({},f?{"os.name":f}:{}),_?{"os.version":_}:{})})(d,p)})()),t?.resourceAttributes);return{serviceName:(r=(s=h?.["service.name"])!==null&&s!==void 0?s:t?.serviceName)!==null&&r!==void 0?r:e?.serviceNameDefault,serviceVersion:(a=h?.["service.version"])!==null&&a!==void 0?a:t?.serviceVersion,environment:(A=h?.["deployment.environment"])!==null&&A!==void 0?A:t?.environment,resourceAttributes:h,beforeSend:t?.beforeSend,flushIntervalMs:c,maxBufferSize:l,maxQueueSize:u,maxBatchRecordsPerPost:100,rateCapWindowMs:c,maxLogsPerInterval:g,backgroundFlushBudgetMs:0,terminationFlushBudgetMs:0}}const z9n=["debug","log","warn","error","info"],J9n=t=>{for(;t?.__rrweb_original__;)t=t.__rrweb_original__;return t},uAt="console",dAt="__posthogHandledLogsRequestError",txe=(t,e)=>{const n=t instanceof Error?t:new Error(e);return n[dAt]=!0,n},hAt=t=>!!t&&typeof t=="object"&&t[dAt]===!0,pne=Ad("[NetworkMetrics]"),nxe=()=>{var t;return!(Fn==null||(t=Fn.performance)===null||t===void 0)&&t.now?Fn.performance.now():Date.now()},W9n={"http:":80,"https:":443},j9n=new Set(["CONNECT","DELETE","GET","HEAD","OPTIONS","PATCH","POST","PUT","TRACE"]),pAt=(t,e)=>{var n;const o=String(e);return{method:String(t).toUpperCase(),url:((n=x8(o))===null||n===void 0?void 0:n.href)||o}},oxe=(t,e,n,o,i,r,s=!1)=>{try{var a,A;const c=i();if(!c)return;const l=n||void 0,g=nxe()-o,u=x8(e.url);if(u&&u.protocol!=="http:"&&u.protocol!=="https:")return;const h={url:u?.href||e.url,method:e.method},d=L_(c.name)?c.name(h):nA(c.name)?c.name:"http.client.request.duration";if(!d)return;const p=s&&!l?void 0:((_,f)=>_?400>_?void 0:String(_):f?.name||"_OTHER")(l,r),m=sn(sn(sn(sn(sn({},(_=>{const f=j9n.has(_)?_:"_OTHER";return sn({"http.request.method":f},f==="_OTHER"&&_!==f?{"http.request.method_original":_}:{})})(h.method)),u?(_=>{return{"server.address":_.hostname.startsWith("[")&&_.hostname.endsWith("]")?_.hostname.slice(1,-1):_.hostname,"server.port":Number(_.port)||W9n[_.protocol],"url.scheme":_.protocol.slice(0,-1),"url.template":(f=_.pathname,f.split("/").map(I=>(C=>/^\d+$/.test(C)||C.length>=8&&/^[0-9a-f-]*\d[0-9a-f-]*$/i.test(C))(I)?":id":I).join("/"))};var f})(u):{}),l?{"http.response.status_code":l}:{}),p?{"error.type":p}:{}),(a=c.attributes)===null||a===void 0?void 0:a.call(c,h,{status:l,durationMs:g}));(A=t.metrics)===null||A===void 0||A.histogram(d,g,{unit:"ms",attributes:m})}catch(c){pne.error("Failed to record network metric",c)}},mAt=()=>{},q9n=(t,e)=>L_(Fn?.fetch)?CV(Fn,"fetch",n=>function(...o){const i=nxe(),r=n.apply(this,o);if(!e())return r;try{var s,a,A;const[c,l]=o,g=pAt((s=(a=l?.method)!==null&&a!==void 0?a:c?.method)!==null&&s!==void 0?s:"GET",(A=c?.url)!==null&&A!==void 0?A:c);return r.then(u=>(oxe(t,g,u?.status,i,e,void 0,!0),u),u=>{throw oxe(t,g,void 0,i,e,u),u})}catch(c){return pne.error("Failed to observe fetch",c),r}}):mAt,X9n=(t,e)=>{var n;const o=Fn==null||(n=Fn.XMLHttpRequest)===null||n===void 0?void 0:n.prototype;if(!o)return mAt;const i=new WeakMap,r=CV(o,"open",a=>function(...A){try{mat.has(this)||i.set(this,pAt(A[0],A[1]))}catch(c){pne.error("Failed to observe XHR open",c)}return a.apply(this,A)}),s=CV(o,"send",a=>function(...A){let c;try{const l=i.get(this);if(l&&e()){const g=nxe();c=()=>{this.removeEventListener("loadend",c),oxe(t,l,this.status,g,e)},jc(this,"loadend",c)}}catch(l){pne.error("Failed to observe XHR send",l)}try{return a.apply(this,A)}catch(l){throw c&&this.removeEventListener("loadend",c),l}});return()=>{r(),s()}},mne={featureFlags:class{constructor(t){this.name="featureFlags",this.ad=!1,this.featureFlagEventHandlers=[],this.A=iAt,this.ld={},this.ud={},this.hd=[],this.dd=!1,this.vd=!1,this.fd=0,this.pd=!1,this.gd=!1,this.md=!1,this.yd=!1,this.bd=0,this._d=!1,this.rn=()=>{const e=this.wd();this.bd=0,e&&this.reloadFeatureFlags()},this.kd=()=>{var e,n;const o=this.Sd,i=(e=this.xd)!==null&&e!==void 0?e:o;Eo(o)||Eo(i)||this.Mr.remoteRequestsDisabled||!No||No.visibilityState==="hidden"||Date.now()-((n=this.Cd)!==null&&n!==void 0?n:0)<i||(this.xd=this._d||!this.Mr.idleRefreshBackoff?o:Math.min(2*i,36e5),this._d=!1,this.reloadFeatureFlags(),this.$d())},this.Td=()=>{this._d&&this.xd===this.Sd||this.Id()},this.sn=()=>{No?.visibilityState==="visible"&&this.Id()},"get"in t?this._o=t:(this._instance=t,this.Md=new O9n(t.config,t.el()),this._o=this.Md)}updateConfig(t,e){var n;(n=this.Md)===null||n===void 0||n.update(t,e),this.yo&&this.Ed()}setup(t){return this.Lh=t,this.A=t.logger.createLogger("[FeatureFlags]"),Zat(t.kv.initialize(),()=>{this.Lh===t&&(this.Lh=void 0,this.yo=t,this.Pd(t))})}Pd(t){var e;if(this.yo===t)return Fn&&jc(Fn,"online",this.rn),this.Ed(),this.Rd=t.registerDynamicEventProperties(()=>this.Ad()?this.ld:this.ud),this.Fd=(e=this._instance)===null||e===void 0||(e=e.persistence)===null||e===void 0?void 0:e.onCrossTabFeatureFlagChange(()=>{this.Od(),this.Dd(),this.Ld()}),this.Dd(),this.initialize()}Id(){this._d=!0,this.xd=this.Sd,this.kd()}Ed(){const t=this.Mr.refreshIntervalMs,e=!this.Mr.remoteRequestsDisabled&&No&&!Eo(t)&&t>0?t:void 0;this.Mr.idleRefreshBackoff||(this.xd=e),e!==this.Sd&&(this.Nd(),Eo(e)||(this.Sd=e,this.xd=e,this.$d(),No?.addEventListener&&(jc(No,ZK,this.sn),vk(rAt,n=>{jc(No,n,this.Td,{capture:!0})}))))}$d(){Eo(this.Sd)||(Eo(this.qd)||clearInterval(this.qd),this.Cd=Date.now(),this.qd=setInterval(this.kd,this.Sd))}Nd(){var t;Eo(this.qd)||(clearInterval(this.qd),this.qd=void 0,No==null||(t=No.removeEventListener)===null||t===void 0||t.call(No,"visibilitychange",this.sn),vk(rAt,e=>{var n;No==null||(n=No.removeEventListener)===null||n===void 0||n.call(No,e,this.Td,{capture:!0})})),this.Sd=void 0,this.xd=void 0,this._d=!1,this.Cd=void 0}destroy(){this.jd()}dispose(){this.jd()}jd(){var t,e;this.Nd(),this.fd++,this.gd=!1,this.Lh=void 0,this.yo&&(this.Bd(),(t=this.Rd)===null||t===void 0||t.dispose(),this.Rd=void 0,(e=this.Fd)===null||e===void 0||e.call(this),this.Fd=void 0,this.hd=[],Fn?.removeEventListener("online",this.rn),this.yo=void 0)}get Mr(){return this._o.get()}Hd(t){var e;return this.zd&&t in this.zd?this.zd[t]:(e=this.yo)===null||e===void 0?void 0:e.kv.get(t)}Od(){return!!this.zd&&(this.zd=void 0,!0)}Ud(){var t;return!Eo((t=this.yo)===null||t===void 0?void 0:t.kv.get("$enabled_feature_flags"))&&this.Od()}$t(t){this.Wd(()=>{var e;return(e=this.yo)===null||e===void 0?void 0:e.kv.set(t)})}Vd(t,e,n){var o;if(!(!((o=this._instance)===null||o===void 0)&&o.persistence)||!t.$enabled_feature_flags)return;const i=this.Hd("$enabled_feature_flags")||{},r=t.$enabled_feature_flags||{},s=e.flags||e.featureFlags,a=e.flags?Object.entries(e.flags).filter(([,_])=>!_?.failed).map(([_])=>_):[],A=!!e.errorsWhileComputingFlags&&!!e.flags,c=A?a:n&&!As(s)?Object.keys(s||{}):Array.from(new Set([...Object.keys(i),...Object.keys(r)])),l=this.Hd("$feature_flag_payloads")||{},g=t.$feature_flag_payloads||{},u=A||n?c:Array.from(new Set([...Object.keys(l),...Object.keys(g)])),h=!A&&!n,d=!!h||c,p=!!h||u,m={[C8]:d,[k4]:d,[rQ]:p};t.$feature_flag_details&&(m[PM]=d);for(const _ of[MM,cQ,jK])Eo(t[_])||(m[_]=!0);this._instance.persistence.markCrossTabFeatureFlagChanges(m)}Lt(t){this.Wd(()=>{var e;return(e=this.yo)===null||e===void 0?void 0:e.kv.remove(t)})}Wd(t){try{t()}catch(e){this.A.error("Failed to update feature flag persistence",e)}}Dd(){const t={};for(const o of[C8,rQ,MM,B9]){const i=this.Hd(o);Eo(i)||(t[o]=i)}this.ld=t;const e=sn({},t),n=this.Hd(k4);if(n)for(const[o,i]of Object.entries(n))e[`$feature/${o}`]=i;this.ud=e}Ad(){const t=this.Mr.cacheTtlMs;if(!t||0>=t)return!1;const e=this.Hd(cQ);return typeof e!="number"||Date.now()-e>t}Gd(){return!!this.Ad()&&(this.yd||this.vd||(this.yd=!0,this.A.warn("Feature flag cache is stale, triggering refresh..."),this.reloadFeatureFlags()),!0)}Zd(){const t=this.Mr.evaluationContexts;return t?.length?t.filter(e=>{const n=e&&typeof e=="string"&&e.trim().length>0;return n||this.A.error("Invalid evaluation context found:",e,"Expected non-empty string"),n}):[]}Qd(){const t=this.Mr.flagKeys;if(!Eo(t))return t.filter(e=>{const n=e&&typeof e=="string"&&e.trim().length>0;return n||this.A.error("Invalid flag key found:",e,"Expected non-empty string"),n})}initialize(){var t,e;const n=this.Mr,o=(t=(e=n.bootstrap)===null||e===void 0?void 0:e.featureFlags)!==null&&t!==void 0?t:{};if(Object.keys(o).length){var i,r;const s=(i=(r=n.bootstrap)===null||r===void 0?void 0:r.featureFlagPayloads)!==null&&i!==void 0?i:{},a=Object.keys(o).filter(c=>!Eo(o[c])).reduce((c,l)=>(c[l]=o[l],c),{}),A=Object.keys(s).filter(c=>a[c]).reduce((c,l)=>(c[l]=s[l],c),{});return this.Jd({featureFlags:a,featureFlagPayloads:A},void 0,{persist:!1})}}updateFlags(t,e,n){var o,i;const r=n?.merge&&(o=this.Hd("$enabled_feature_flags"))!==null&&o!==void 0?o:{},s=n?.merge&&(i=this.Hd("$feature_flag_payloads"))!==null&&i!==void 0?i:{},a=sn(sn({},r),t),A=sn(sn({},s),e),c={};for(const[l,g]of Object.entries(a))c[l]={key:l,enabled:xrt(g),variant:Ert(g),reason:void 0,metadata:Eo(A?.[l])?void 0:{id:0,version:void 0,description:void 0,payload:A[l]}};this.Jd({flags:c})}get hasLoadedFlags(){return this.dd}getFlags(){return Object.keys(this.getFlagVariants())}getFlagsWithDetails(){const t=this.Hd(PM),e=this.Hd(B9),n=this.Hd(DM);if(!n&&!e)return t||{};const o=jg({},t||{}),i=[...new Set([...Object.keys(n||{}),...Object.keys(e||{})])];for(const a of i){var r;const A=o[a],c=e?.[a],l=Eo(c)?(r=A?.enabled)!==null&&r!==void 0&&r:!!c,g=Eo(c)?A?.variant:typeof c=="string"?c:void 0,u=n?.[a],h=sn(sn({},A),{},{enabled:l,variant:l?g??A?.variant:void 0});var s;l!==A?.enabled&&(h.original_enabled=A?.enabled),g!==A?.variant&&(h.original_variant=A?.variant),u&&(h.metadata=sn(sn({},A?.metadata),{},{payload:u,original_payload:A==null||(s=A.metadata)===null||s===void 0?void 0:s.payload})),o[a]=h}return this.ad||(this.A.warn(" Overriding feature flag details!",{flagDetails:t,overriddenPayloads:n,finalDetails:o}),this.ad=!0),o}getAllFeatureFlags(){const t=this.getFlagVariants(),e=this.getFlagPayloads();return Object.keys(t).map(n=>{const o=t[n];return{key:n,enabled:xrt(o),variant:Ert(o),payload:yrt(e[n])}})}getFlagVariants(){const t=this.Hd(k4),e=this.Hd(B9);if(!e)return t||{};const n=jg({},t||{}),o=Object.keys(e);for(let i=0;o.length>i;i++)n[o[i]]=e[o[i]];return this.ad||(this.A.warn(" Overriding feature flags!",{enabledFlags:t,overriddenFlags:e,finalFlags:n}),this.ad=!0),n}getFlagPayloads(){const t=this.Hd(rQ),e=this.Hd(DM);if(!e)return t||{};const n=jg({},t||{}),o=Object.keys(e);for(let i=0;o.length>i;i++)n[o[i]]=e[o[i]];return this.ad||(this.A.warn(" Overriding feature flag payloads!",{flagPayloads:t,overriddenPayloads:e,finalPayloads:n}),this.ad=!0),n}reloadFeatureFlags(){this.pd||this.Mr.featureFlagsDisabled||this.wd()||(this.vd&&(this.gd=!0),this.Kd||(this.hd.slice().forEach(t=>{try{t()}catch(e){this.A.error("Error while running feature flags reloading callback",e)}}),this.Kd=setTimeout(()=>{this.Xd()},5)))}Bd(){clearTimeout(this.Kd),this.Kd=void 0}onReloading(t){return this.hd.push(t),()=>{this.hd=this.hd.filter(e=>e!==t)}}ensureFlagsLoaded(){this.dd||this.vd||this.Kd||this.reloadFeatureFlags()}setAnonymousDistinctId(t){this.$anon_distinct_id=t}setReloadingPaused(t){this.pd=t}resetFlagCallReported(){this.Lt(AQ)}Xd(t){this.Bd();const e=this.yo;if(!e||this.Mr.remoteRequestsDisabled||this.wd())return;if(this.vd)return void(this.gd=!0);const n={token:e.projectToken,distinct_id:e.distinctId,groups:e.groups,$anon_distinct_id:this.$anon_distinct_id,person_properties:sn(sn(sn({},e.initialPersonProperties),this.Hd("$stored_person_properties")||{}),{},{$lib:e.library.name,$lib_version:e.library.version}),group_properties:this.Hd(aQ),timezone:eat()};Eo(e.deviceId)||(n.$device_id=e.deviceId),(t?.disableFlags||this.Mr.featureFlagsDisabled)&&(n.disable_flags=!0);const o=this.Zd();o.length&&(n.evaluation_contexts=o);const i=this.Qd();Eo(i)||(n.flag_keys=i);const r=this.Mr.onlyEvaluateSurveyFeatureFlags,s="/flags/?v=2"+(r?"&only_evaluate_survey_feature_flags=true":""),a=this.fd;this.vd=!0;const A=()=>{this.gd&&(this.gd=!1,this.Xd())},c=d=>{var p,m;const _=(p=d.json)!==null&&p!==void 0?p:{},f=d.statusCode!==200;if(this.vd=!1,a!==this.fd)return void A();if(this.Yd(d.statusCode),f||this.gd||(this.$anon_distinct_id=void 0),n.disable_flags&&!this.gd)return;this.md=!f;const I=[];d.error?I.push(d.error instanceof Error&&d.error.name==="AbortError"?"timeout":d.error instanceof Error?sAt:"unknown_error"):d.statusCode!==200&&I.push(`api_error_${d.statusCode}`),_.errorsWhileComputingFlags&&I.push("errors_while_computing_flags");const C=!!(!((m=_.quotaLimited)===null||m===void 0)&&m.includes("feature_flags"));C&&I.push("quota_limited"),this.$t({[$K]:I}),C?this.A.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."):n.disable_flags||this.Jd(_,f,{partialResponse:r}),A()},l=d=>{this.vd=!1,a===this.fd&&(this.$t({[$K]:[sAt]}),this.A.error("Feature flag request failed",d),this.Ud()&&this.Ld(!0)),A()};let g=this.Mr.requestMaxRetries;const u=()=>g>0&&a===this.fd,h=()=>{if(a!==this.fd||!this.yo||this.Mr.remoteRequestsDisabled)return this.vd=!1,void A();try{e.sendRequest(s,{target:"flags",method:"POST",body:n,compression:this.Mr.compression,sentAt:"body",timeoutMs:this.Mr.requestTimeoutMs}).then(d=>{if((p=>G9n.includes(p.statusCode)||(m=>m.statusCode===0&&m.error instanceof Error&&m.error.name==="AbortError")(p))(d)&&u())return g--,void setTimeout(h,500);c(d)}).catch(l)}catch(d){l(d)}};h()}wd(){return Vst(this.bd,3)}Yd(t){this.bd=zst(t,this.bd,3,()=>this.A.warn("Feature flag requests are failing before receiving an HTTP response; this can happen due to network issues, CORS, browser blocking, or ad blockers. Stopped refreshing feature flags; will try again when connectivity changes."))}getFeatureFlag(t,e={}){var n;if(e.fresh&&!this.md)return;if(!(this.dd||this.getFlags()&&this.getFlags().length>0))return void this.A.warn('getFeatureFlag for key "'+t+Z2e);if(this.Gd())return;const o=this.getFeatureFlagResult(t,e);return(n=o?.variant)!==null&&n!==void 0?n:o?.enabled}getFeatureFlagDetails(t){return this.getFlagsWithDetails()[t]}getFeatureFlagPayload(t){const e=this.getFeatureFlagResult(t,{send_event:!1});return e?.payload}getFeatureFlagResult(t,e={}){if(e.fresh&&!this.md)return;if(!(this.dd||this.getFlags()&&this.getFlags().length>0))return void this.A.warn('getFeatureFlagResult for key "'+t+Z2e);if(this.Gd())return;const n=this.getFlagVariants(),o=t in n,i=n[t],r=this.getFlagPayloads()[t],s=String(i),a=this.Hd("$feature_flag_request_id")||void 0,A=this.Hd("$feature_flag_evaluated_at")||void 0;let c,l=this.Hd("$flag_call_reported")||{};if(this.Mr.deduplicateCallsPerSession){var g;const S=(g=this.yo)===null||g===void 0?void 0:g.session.sessionId,Q=this.Hd(XK);S&&S!==Q&&(l={},c=S)}if(e.send_event||!("send_event"in e))if(t in l&&l[t].includes(s))c&&this.$t({[AQ]:l,[XK]:c});else{var u,h,d,p,m,_,f,I,C,y,x,E;As(l[t])?l[t].push(s):l[t]=[s],this.$t(sn({[AQ]:l},c?{[XK]:c}:{}));const S=this.getFeatureFlagDetails(t),Q=[...(u=this.Hd("$feature_flag_errors"))!==null&&u!==void 0?u:[]];Eo(i)&&Q.push("flag_missing");const w={$feature_flag:t,$feature_flag_response:i,$feature_flag_payload:r??null,$feature_flag_request_id:a,$feature_flag_evaluated_at:A,$feature_flag_bootstrapped_response:(h=(d=this.Mr.bootstrap)===null||d===void 0||(d=d.featureFlags)===null||d===void 0?void 0:d[t])!==null&&h!==void 0?h:null,$feature_flag_bootstrapped_payload:(p=(m=this.Mr.bootstrap)===null||m===void 0||(m=m.featureFlagPayloads)===null||m===void 0?void 0:m[t])!==null&&p!==void 0?p:null,$used_bootstrap_value:!this.md};Eo(S==null||(_=S.metadata)===null||_===void 0?void 0:_.has_experiment)||(w.$feature_flag_has_experiment=S.metadata.has_experiment),Eo(S==null||(f=S.metadata)===null||f===void 0?void 0:f.version)||(w.$feature_flag_version=S.metadata.version);const M=(I=S==null||(C=S.reason)===null||C===void 0?void 0:C.description)!==null&&I!==void 0?I:S==null||(y=S.reason)===null||y===void 0?void 0:y.code;var B;M&&(w.$feature_flag_reason=M),!(S==null||(x=S.metadata)===null||x===void 0)&&x.id&&(w.$feature_flag_id=S.metadata.id),Eo(S?.original_variant)&&Eo(S?.original_enabled)||(w.$feature_flag_original_response=Eo(S.original_variant)?S.original_enabled:S.original_variant),!(S==null||(E=S.metadata)===null||E===void 0)&&E.original_payload&&(w.$feature_flag_original_payload=S==null||(B=S.metadata)===null||B===void 0?void 0:B.original_payload),Q.length&&(w.$feature_flag_error=Q.join(",")),this.tv(w)}else c&&this.$t({[AQ]:l,[XK]:c});return o?{key:t,enabled:!!i,variant:typeof i=="string"?i:void 0,payload:yrt(r)}:void 0}tv(t){try{var e;(e=this.yo)===null||e===void 0||e.capture("$feature_flag_called",t)}catch(n){this.A.error("Failed to capture feature flag call",n)}}getRemoteConfigPayload(t,e){this.ev(t,e)}ev(t,e){var n=this;return Wg(function*(){const o=n.yo;if(!o)return;const i={distinct_id:o.distinctId,token:o.projectToken,person_properties:{$lib:o.library.name,$lib_version:o.library.version}},r=n.Zd();r.length&&(i.evaluation_contexts=r);const s=n.Qd();let a;Eo(s)||(i.flag_keys=s);try{var A;const c=(A=(yield o.sendRequest("/flags/?v=2",{target:"flags",method:"POST",body:i,compression:n.Mr.compression,sentAt:"body",timeoutMs:n.Mr.requestTimeoutMs})).json)===null||A===void 0?void 0:A.featureFlagPayloads;a=c?.[t]||void 0}catch(c){return void n.A.error("Remote config feature flag request failed",c)}try{e(a)}catch(c){n.A.error("Remote config feature flag callback failed",c)}})()}isFeatureEnabled(t,e={}){if(e.fresh&&!this.md)return e.defaultValue;if(!(this.dd||this.getFlags()&&this.getFlags().length>0))return this.A.warn('isFeatureEnabled for key "'+t+Z2e),e.defaultValue;const n=this.getFeatureFlag(t,e);return Eo(n)?e.defaultValue:!!n}addFeatureFlagsHandler(t){this.featureFlagEventHandlers.push(t)}removeFeatureFlagsHandler(t){this.featureFlagEventHandlers=this.featureFlagEventHandlers.filter(e=>e!==t)}receivedFeatureFlags(t,e,n){this.Jd(t,e,n)}Jd(t,e,n){if(!this.yo)return;this.dd=!0;const o=((i,r={},s={},a={},A,c=iAt)=>{const l=((I,C)=>{const y=I.flags;if(y){const x=Object.fromEntries(Object.keys(y).map(B=>{var S;return[B,(S=y[B].variant)!==null&&S!==void 0?S:y[B].enabled]})),E=Object.fromEntries(Object.keys(y).filter(B=>y[B].enabled).filter(B=>{var S;return!Eo((S=y[B].metadata)===null||S===void 0?void 0:S.payload)}).map(B=>{var S;return[B,(S=y[B].metadata)===null||S===void 0?void 0:S.payload]}));return sn(sn({},I),{},{featureFlags:x,featureFlagPayloads:E})}return I.featureFlags&&C.warn("Using an older version of the feature flags endpoint. Please upgrade your PostHog server to the latest version"),I})(i,c),g=l.flags,u=l.featureFlags,h=l.featureFlagPayloads;if(!u)return;const d=i.requestId,p=i.evaluatedAt;if(As(u)){c.warn("v1 of the feature flags endpoint is deprecated. Please use the latest version.");const I={};if(u)for(let C=0;u.length>C;C++)I[u[C]]=!0;return{[C8]:u,[k4]:I,[jK]:!1}}let m=u,_=h,f=g;if(A?.partialResponse){const I=Object.keys(m),C=_||{};m=sn(sn({},r),m),_=sn(sn({},s),C),I.forEach(y=>{y in C||_==null||delete _[y]}),f=sn(sn({},a),f)}else if(i.errorsWhileComputingFlags)if(g){const I=new Set(Object.keys(g).filter(y=>{var x;return!(!((x=g[y])===null||x===void 0)&&x.failed)}));m=sn(sn({},r),Object.fromEntries(Object.entries(m).filter(([y])=>I.has(y))));const C=Object.fromEntries(Object.entries(_||{}).filter(([y])=>I.has(y)));_=sn(sn({},s),C),I.forEach(y=>{y in C||_==null||delete _[y]}),f=sn(sn({},a),Object.fromEntries(Object.entries(f||{}).filter(([y])=>I.has(y))))}else m=sn(sn({},r),m),_=sn(sn({},s),_),f=sn(sn({},a),f);return sn(sn({[C8]:Object.keys(AAt(m)),[k4]:m||{},[rQ]:_||{},[PM]:f||{},[jK]:i.minimalFlagCalledEvents===!0},d?{[MM]:d}:{}),p?{[cQ]:p}:{})})(t,this.getFlagVariants(),this.getFlagPayloads(),this.getFlagsWithDetails(),n,this.A);if(o)if(n?.persist===!1){const i=!Eo(this.yo.kv.get(k4));this.zd=o,i||this.$t(o)}else this.Od(),this.Vd(o,t,!!n?.partialResponse),this.$t(o);else e&&this.Ud();e||(this.yd=!1),this.Ld(e)}override(t,e=!1){this.A.warn("override is deprecated. Please use overrideFeatureFlags instead."),this.overrideFeatureFlags({flags:t,suppressWarning:e})}overrideFeatureFlags(t){this.iv(t)}iv(t){if(this.yo){if(t===!1)return this.Lt([B9,DM]),this.Ld(),void FM.info("All overrides cleared");if(As(t))return this.$t({[B9]:aAt(t)}),this.Ld(),void FM.info("Flag overrides set",{flags:t});if(t&&typeof t=="object"&&("flags"in t||"payloads"in t)){var e;const n=t;this.ad=!!((e=n.suppressWarning)!==null&&e!==void 0&&e);const o={},i=n.flags,r=n.payloads;return i&&(o[B9]=As(i)?aAt(i):i),r&&(o[DM]=r),Object.keys(o).length&&this.$t(o),i===!1&&r===!1?this.Lt([B9,DM]):i===!1?this.Lt(B9):r===!1&&this.Lt(DM),this.Ld(),i===!1?FM.info("Flag overrides cleared"):i&&FM.info("Flag overrides set",{flags:i}),void(r===!1?FM.info("Payload overrides cleared"):r&&FM.info("Payload overrides set",{payloads:r}))}if(t&&typeof t=="object")return this.$t({[B9]:t}),this.Ld(),void FM.info("Flag overrides set",{flags:t});this.A.warn("Invalid overrideOptions provided to overrideFeatureFlags",{overrideOptions:t})}else this.A.warn("posthog.featureFlags.overrideFeatureFlags called before feature flags were ready")}onFeatureFlags(t){if(this.addFeatureFlagsHandler(t),this.dd){const{flags:e,flagVariants:n}=this.nv();try{t(e,n)}catch(o){this.A.error("Error while running feature flags callback",o)}}return()=>this.removeFeatureFlagsHandler(t)}updateEarlyAccessFeatureEnrollment(t,e,n){var o;const i=(this.Hd("$early_access_features")||[]).find(c=>c.flagKey===t),r={[`$feature_enrollment/${t}`]:e},s={$feature_flag:t,$feature_enrollment:e,$set:r};i&&(s.$early_access_feature_name=i.name),n&&(s.$feature_enrollment_stage=n);const a=sn(sn({},this.getFlagVariants()),{},{[t]:e});(o=this._instance)===null||o===void 0||(o=o.persistence)===null||o===void 0||o.markCrossTabFeatureFlagChanges({$active_feature_flags:[t],$enabled_feature_flags:[t],$stored_person_properties:Object.keys(r)}),this.$t({[C8]:Object.keys(AAt(a)),[k4]:a,[sQ]:sn(sn({},this.Hd("$stored_person_properties")||{}),r)}),this.Ld();try{var A;(A=this.yo)===null||A===void 0||A.capture("$feature_enrollment_update",s)}catch(c){this.A.error("Failed to capture early access feature enrollment",c)}}getEarlyAccessFeatures(t,e=!1,n){const o=this.Hd(i2e);!o||e?this.sv(t,n):t(o)}sv(t,e){var n=this;return Wg(function*(){const o=n.yo;if(!o)return;const i=e?`&${e.map(s=>`stage=${s}`).join("&")}`:"";let r;try{const s=yield o.sendRequest(`/api/early_access_features/?token=${o.projectToken}${i}`,{target:"api",method:"GET",sentAt:"query"});if(!s.json)return;r=s.json.earlyAccessFeatures,n.$t({[i2e]:r})}catch(s){return void n.A.error("Early access feature request failed",s)}try{t(r)}catch(s){n.A.error("Early access feature callback failed",s)}})()}nv(){const t=this.getFlags(),e=this.getFlagVariants();return{flags:t.filter(n=>e[n]),flagVariants:Object.keys(e).filter(n=>e[n]).reduce((n,o)=>(n[o]=e[o],n),{})}}Ld(t){this.Dd();const{flags:e,flagVariants:n}=this.nv();this.featureFlagEventHandlers.forEach(o=>{try{o(e,n,{errorsLoading:t})}catch(i){this.A.error("Error while running feature flags callback",i)}})}setPersonPropertiesForFlags(t,e=!0){this.rv(t,e)}rv(t,e=!0){const n=this.Hd("$stored_person_properties")||{},o=t?.$set||(t?.$set_once?{}:t),i=t?.$set_once,r={};if(i)for(const s in i)({}).hasOwnProperty.call(i,s)&&(s in n||(r[s]=i[s]));this.$t({[sQ]:sn(sn(sn({},n),r),o)}),e&&this.reloadFeatureFlags()}unsetPersonPropertiesForFlags(t,e=!0){const n=sn({},this.Hd("$stored_person_properties")||{});t.forEach(o=>{delete n[o]}),this.$t({[sQ]:n}),e&&this.reloadFeatureFlags()}resetPersonPropertiesForFlags(t=!0){this.Lt(sQ),t&&this.reloadFeatureFlags()}setGroupPropertiesForFlags(t,e=!0){const n=this.Hd("$stored_group_properties")||{},o=sn({},n);for(const i of Object.keys(t))o[i]=sn(sn({},n[i]),t[i]);this.$t({[aQ]:o}),e&&this.reloadFeatureFlags()}resetGroupPropertiesForFlags(t){if(t){const e=this.Hd("$stored_group_properties")||{};this.$t({[aQ]:sn(sn({},e),{},{[t]:{}})})}else this.Lt(aQ)}reset(){this.fd++,this.gd=!1,this.ld={},this.ud={},this.zd=void 0,this.dd=!1,this.pd=!1,this.md=!1,this.$anon_distinct_id=void 0,this.Bd(),this.ad=!1,this.bd=0}}},$9n={sessionRecording:class{get Mr(){return this._instance.config}get Tl(){return this._instance.persistence}get started(){var t;return!!(!((t=this.ov)===null||t===void 0)&&t.isStarted)}get status(){var t,e;return this.av==="awaiting_config"||this.av==="missing_config"?this.av:(t=(e=this.ov)===null||e===void 0?void 0:e.status)!==null&&t!==void 0?t:this.av}constructor(t){if(this._instance=t,this._forceAllowLocalhostNetworkCapture=!1,this.av=q2e,this.lv=void 0,this.uv=!1,this.Je=(()=>{var e,n;if(!No?.visibilityState||No.visibilityState==="visible")return!0;const o=Fn==null||(e=Fn.performance)===null||e===void 0||(n=e.getEntriesByType)===null||n===void 0?void 0:n.call(e,"visibility-state");return!o?.length||o.some(i=>i.name==="visible")})(),this.sn=()=>{var e,n;No?.visibilityState==="visible"&&(this.Je=!0,(e=this.ov)===null||e===void 0||(n=e.setDocumentWasEverVisible)===null||n===void 0||n.call(e,!0))},!this._instance.sessionManager)throw b8.error("started without valid sessionManager"),new Error("[SessionRecording] started without valid sessionManager. This is a bug.");if(this.Mr.cookieless_mode==="always")throw new Error('[SessionRecording] cannot be used with cookieless_mode="always"');No?.addEventListener&&jc(No,"visibilitychange",this.sn)}initialize(){this.startIfEnabledOrStop()}dispose({discardBufferedEvents:t=!1}={}){var e;this.uv=!0,No==null||(e=No.removeEventListener)===null||e===void 0||e.call(No,"visibilitychange",this.sn),t?this.hv(!0):this.stopRecording()}get dv(){var t;const e=!!(!((t=this._instance.get_property("$session_recording_remote_config"))===null||t===void 0)&&t.enabled),n=!this.Mr.disable_session_recording,o=this.Mr.disable_session_recording||this._instance.consent.isOptedOut();return Fn&&e&&n&&!o}startIfEnabledOrStop(t){var e;if(this.uv||this.dv&&(!((e=this.ov)===null||e===void 0)&&e.isStarted))return;const n=!Eo(Object.assign)&&!Eo(Array.from);this.dv&&n?(this.vv(t),b8.info("starting")):(this.av=q2e,this.stopRecording())}vv(t){var e,n;if(this.dv)if(this.av!=="awaiting_config"&&this.av!=="missing_config"&&(this.av=Xat),(Ur==null||(e=Ur.__PosthogExtensions__)===null||e===void 0||(e=e.rrweb)===null||e===void 0?void 0:e.record)&&((n=Ur.__PosthogExtensions__)===null||n===void 0?void 0:n.initSessionRecording))this.fv(t);else{var o,i;const r=this._instance.sessionManager;(o=Ur.__PosthogExtensions__)===null||o===void 0||(i=o.loadExternalDependency)===null||i===void 0||i.call(o,this._instance,this.pv,s=>{if(!this.uv&&this.dv&&this._instance.sessionManager===r)return s?(this._instance.register_for_session({$sdk_debug_recording_script_not_loaded:!0}),b8.error("could not load recorder",s)):void this.fv(t);this.av="disabled"})}}stopRecording(){var t,e;(t=this.lv)===null||t===void 0||t.call(this),this.lv=void 0,(e=this.ov)===null||e===void 0||e.stop()}hv(t=!1){var e,n;(e=this.lv)===null||e===void 0||e.call(this),this.lv=void 0,(n=this.ov)===null||n===void 0||n.discard({discardProducerEvents:t})}gv(){var t,e;(t=this.Tl)===null||t===void 0||t.unregister("$session_is_sampled"),(e=this.Tl)===null||e===void 0||e.unregister("$replay_sample_rate")}mv(t,e){if(Fs(t))return null;const n=jd(t)?t:parseFloat(t);return typeof(o=n)!="number"||!Number.isFinite(o)||0>o||o>1?(b8.warn(`${e} must be between 0 and 1. Ignoring invalid value:`,t),null):n;var o}yv(t){if(this.Tl){var e,n;const o=this.Tl,i=()=>{var r;const s=t.sessionRecording===!1?void 0:t.sessionRecording,a=this.mv((r=this.Mr.session_recording)===null||r===void 0?void 0:r.sampleRate,"session_recording.sampleRate"),A=this.mv(s?.sampleRate,"remote config sampleRate"),c=a??A;Fs(c)&&this.gv();const l=s?.minimumDurationMilliseconds;o.register({[WK]:sn(sn({cache_timestamp:Date.now(),enabled:!!s},s),{},{networkPayloadCapture:sn({capturePerformance:t.capturePerformance},s?.networkPayloadCapture),canvasRecording:{enabled:s?.recordCanvas,fps:s?.canvasFps,quality:s?.canvasQuality},sampleRate:c,minimumDurationMilliseconds:Eo(l)?null:l,endpoint:s?.endpoint,triggerMatchType:s?.triggerMatchType,masking:s?.masking,urlTriggers:s?.urlTriggers,version:s?.version,triggerGroups:s?.triggerGroups})})};i(),(e=this.lv)===null||e===void 0||e.call(this),this.lv=(n=this._instance.sessionManager)===null||n===void 0?void 0:n.onSessionId(i)}}onRemoteConfig(t){const e=t.ok?t.config:void 0;return e&&"sessionRecording"in e?e.sessionRecording===!1?(this.yv(e),void this.hv()):(this.yv(e),void this.startIfEnabledOrStop()):(this.av==="awaiting_config"&&(this.av="missing_config",this._instance.register_for_session({[l2e]:!0}),b8.warn("config refresh failed, recording will not start until page reload")),void this.startIfEnabledOrStop())}log(t,e="log"){var n;!((n=this.ov)===null||n===void 0)&&n.log?this.ov.log(t,e):b8.warn("log called before recorder was ready")}get pv(){var t,e;const n=(t=this._instance)===null||t===void 0||(t=t.persistence)===null||t===void 0?void 0:t.get_property(WK);return(n==null||(e=n.scriptConfig)===null||e===void 0?void 0:e.script)||"lazy-recorder"}bv(){const t=this._instance.get_property(WK);if(!t)return!1;let e;try{e=typeof t=="object"?t:JSON.parse(t)}catch(n){return b8.warn("persisted remote config for session recording is invalid and will be ignored",n),!1}return!Fs(e.cache_timestamp)&&36e5>=Date.now()-e.cache_timestamp}fv(t){var e,n,o;if(!this.uv&&this.dv&&this._instance.sessionManager){if(!(!((e=Ur.__PosthogExtensions__)===null||e===void 0)&&e.initSessionRecording))return b8.warn("Called on script loaded before session recording is available. This can be caused by adblockers."),void this._instance.register_for_session({[c2e]:!0});var i;if(this.ov||(this.ov=(i=Ur.__PosthogExtensions__)===null||i===void 0?void 0:i.initSessionRecording(this._instance,this.Je),this.ov._forceAllowLocalhostNetworkCapture=this._forceAllowLocalhostNetworkCapture),!this.bv())return this.av==="missing_config"||this.av==="awaiting_config"?void 0:(this.av="awaiting_config",b8.info("persisted remote config is stale, requesting fresh config before starting"),void new sat(this._instance).load());this.av=Xat,(n=(o=this.ov).setDocumentWasEverVisible)===null||n===void 0||n.call(o,this.Je),this.ov.start(t)}else this.av=q2e}onRRwebEmit(t){var e,n;(e=this.ov)===null||e===void 0||(n=e.onRRwebEmit)===null||n===void 0||n.call(e,t)}overrideLinkedFlag(){var t,e;this.ov||(e=this.Tl)===null||e===void 0||e.register({$replay_override_linked_flag:!0}),(t=this.ov)===null||t===void 0||t.overrideLinkedFlag()}overrideSampling(){var t,e;this.ov||(e=this.Tl)===null||e===void 0||e.register({$replay_override_sampling:!0}),(t=this.ov)===null||t===void 0||t.overrideSampling()}overrideTrigger(t){var e,n;this.ov||(n=this.Tl)===null||n===void 0||n.register({[t==="url"?"$replay_override_url_trigger":"$replay_override_event_trigger"]:!0}),(e=this.ov)===null||e===void 0||e.overrideTrigger(t)}get sdkDebugProperties(){var t;const e={};for(const o of P9n){var n;const i=(n=this._instance.sessionPersistence)===null||n===void 0?void 0:n.get_property(o);Eo(i)||(e[o]=i)}return sn(sn({},e),((t=this.ov)===null||t===void 0?void 0:t.sdkDebugProperties)||{$recording_status:this.status})}tryAddCustomEvent(t,e){var n;return!!(!((n=this.ov)===null||n===void 0)&&n.tryAddCustomEvent(t,e))}flushBeforeIdentityReset(){var t,e;(t=this.ov)===null||t===void 0||(e=t.flushBeforeIdentityReset)===null||e===void 0||e.call(t)}}},Z9n={autocapture:class extends b9n{constructor(t){super(new S9n(t)),this.instance=t}},historyAutocapture:class{constructor(t){this._v=!1,this._instance=t,this.wv=this.Sv()}initialize(){this.startIfEnabled()}get isEnabled(){const t=this.xv();return!!(t.path||t.search||this.Cv(t))}startIfEnabled(){this.isEnabled&&(gi.info("History API monitoring enabled, starting..."),this.monitorHistoryChanges())}startIfEnabledOrStop(){this.stop(),this.wv=this.Sv(),this.startIfEnabled()}stop(){this.$v&&this.$v(),this.$v=void 0,this.Tv&&this.Tv(),this.Tv=void 0,gi.info("History API monitoring stopped")}monitorHistoryChanges(){Fn&&Fn.history&&(this.Iv("pushState"),this.Iv("replaceState"),this.Mv(),this.Cv()&&this.Ev())}Iv(t){var e;if(!Fn||!((e=Fn.history[t])===null||e===void 0)&&e.__posthog_wrapped__)return;const n=this;CV(Fn.history,t,o=>function(i,r,s){var a;n.Pv(s)&&n.Rv(),o.call(this,i,r,s),n.Av(t,!n._v&&(Fn==null||(a=Fn.event)===null||a===void 0?void 0:a.type)!=="popstate")})}Sv(){const t=Fn?.location;if(t?.pathname)return{pathname:t.pathname,search:t.search,hash:t.hash}}xv(){const t=this._instance.config.capture_pageview;return t==="history_change"?{path:!0}:xA(t)?t:{}}Cv(t=this.xv()){return!!t.hash&&!this._instance.config.disable_capture_url_hashes}Fv(t){const e=this.xv(),n=this.wv;return!(!n||!(e.path&&t.pathname!==n.pathname||e.search&&t.search!==n.search||this.Cv(e)&&t.hash!==n.hash))}Av(t,e=!1){try{e||this.Rv();const n=this.Sv();if(!n)return;if(this.Fv(n)){const o=()=>this._instance.capture(u2e,{navigation_type:t});e?(this.Ov=o,Promise.resolve().then(()=>this.Rv())):o()}this.wv=n}catch(n){gi.error(`Error capturing ${t} pageview`,n)}}Pv(t){var e,n;return!(Fs(t)||!Fn)&&((e=x8(String(t)))===null||e===void 0?void 0:e.href)!==((n=Fn.location)===null||n===void 0?void 0:n.href)}Rv(){const t=this.Ov;if(t){this.Ov=void 0,this._v=!0;try{t()}catch(e){gi.error("Error capturing deferred pageview",e)}finally{this._v=!1}this.wv=this.Sv()}}Mv(){if(this.$v)return;const t=()=>{this.Av("popstate")};jc(Fn,"popstate",t),this.$v=()=>{Fn&&Fn.removeEventListener("popstate",t)}}Ev(){if(this.Tv)return;const t=()=>{this.Av("hashchange")};jc(Fn,"hashchange",t),this.Tv=()=>{Fn&&Fn.removeEventListener("hashchange",t)}}},heatmaps:class{get Mr(){return this.instance.config}constructor(t){var e;this.Dv=!1,this.wo=!1,this.Lv=null,this.instance=t,this.Dv=!!(!((e=this.instance.persistence)===null||e===void 0)&&e.props[$ye]),this.rageclicks=new zat(t.config.rageclick)}initialize(){this.startIfEnabled()}get flushIntervalMilliseconds(){let t=5e3;return xA(this.Mr.capture_heatmaps)&&this.Mr.capture_heatmaps.flush_interval_milliseconds&&(t=this.Mr.capture_heatmaps.flush_interval_milliseconds),t}get isEnabled(){return Fs(this.Mr.capture_heatmaps)?Fs(this.Mr.enable_heatmaps)?this.Dv:this.Mr.enable_heatmaps:this.Mr.capture_heatmaps!==!1}startIfEnabled(){if(this.isEnabled){if(this.wo)return;M9n.info("starting..."),this.Nv(),this.sn()}else{var t;clearInterval((t=this.Lv)!==null&&t!==void 0?t:void 0),this.qv(),this.getAndClearBuffer()}}onRemoteConfig(t){if(!t.ok)return;const e=t.config;if(!("heatmaps"in e))return;const n=!!e.heatmaps;this.instance.persistence&&this.instance.persistence.register({[$ye]:n}),this.Dv=n,this.startIfEnabled()}getAndClearBuffer(){const t=this.Rt;return this.Rt=void 0,t}jv(t){X2e(t.originalEvent)&&this.Cr(t.originalEvent,"deadclick")}sn(){this.Lv&&clearInterval(this.Lv),this.Lv=No?.visibilityState==="visible"?setInterval(this.ml.bind(this),this.flushIntervalMilliseconds):null}Nv(){Fn&&No&&(this.Bv=this.ml.bind(this),jc(Fn,ene,this.Bv),this.Hv=t=>this.Cr(t||Fn?.event),jc(No,"click",this.Hv,{capture:!0}),this.zv=t=>this.Uv(t||Fn?.event),jc(No,"mousemove",this.zv,{capture:!0}),this.Wv=new Ost(this.instance,MBn,this.jv.bind(this)),this.Wv.startIfEnabledOrStop(),this.Vv=this.sn.bind(this),jc(No,ZK,this.Vv),this.wo=!0)}qv(){var t;Fn&&No&&(this.Bv&&Fn.removeEventListener(ene,this.Bv),this.Hv&&No.removeEventListener("click",this.Hv,{capture:!0}),this.zv&&No.removeEventListener("mousemove",this.zv,{capture:!0}),this.Vv&&No.removeEventListener(ZK,this.Vv),clearTimeout(this.Gv),(t=this.Wv)===null||t===void 0||t.stop(),this.wo=!1)}Zv(t,e){const n=this.instance.scrollManager.scrollY(),o=this.instance.scrollManager.scrollX(),i=this.instance.scrollManager.scrollElement(),r=(function(s,a,A){let c=s;for(;c&&b9(c)&&!j1(c,"body");){if(c===A)return!1;let h;try{var l,g,u;h=(l=(g=(u=c.ownerDocument)===null||u===void 0?void 0:u.defaultView)!==null&&g!==void 0?g:Fn)===null||l===void 0?void 0:l.getComputedStyle(c).position}catch{return!1}if(as(a,h))return!0;c=Qst(c)}return!1})(oV(t),["fixed","sticky"],i);return{x:t.clientX+(r?0:o),y:t.clientY+(r?0:n),target_fixed:r,type:e}}Cr(t,e="click"){var n;if(Est(t.target)||!X2e(t))return;const o=this.Zv(t,e);!((n=this.rageclicks)===null||n===void 0)&&n.isRageClick(t.clientX,t.clientY,new Date().getTime())&&Mst(oV(t),this.instance.config.rageclick)&&this.Zs(sn(sn({},o),{},{type:"rageclick"})),this.Zs(o)}Uv(t){!Est(t.target)&&X2e(t)&&(clearTimeout(this.Gv),this.Gv=setTimeout(()=>{this.Zs(this.Zv(t,"mousemove"))},500))}Zs(t){if(!Fn)return;const e=this.Mr.disable_capture_url_hashes?iQ(Fn.location.href):Fn.location.href,n=this.Mr.custom_personal_data_properties,o=this.Mr.mask_personal_data_properties?[...Tk,...n||[]]:[],i=AV(e,o,cV);this.Rt=this.Rt||{},this.Rt[i]||(this.Rt[i]=[]),this.Rt[i].push(t)}ml(){this.Rt&&!nx(this.Rt)&&this.instance.capture("$$heatmap",{$heatmap_data:this.getAndClearBuffer()})}},deadClicksAutocapture:Ost,webVitalsAutocapture:class{constructor(t){var e;this._instance=t,this.Dv=!1,this.wo=!1,this.Rt={navigationKey:void 0,url:void 0,metrics:[],firstMetricTimestamp:void 0},this.Qv=()=>{clearTimeout(this.Jv),this.Jv=void 0,this.Rt.metrics.length!==0&&(this._instance.capture("$web_vitals",sn({$current_url:this.Rt.url},this.Rt.metrics.reduce((n,o)=>sn(sn({},n),{},{[`$web_vitals_${o.name}_event`]:sn({},o),[`$web_vitals_${o.name}_value`]:o.value}),{}))),this.Rt={navigationKey:void 0,url:void 0,metrics:[],firstMetricTimestamp:void 0})},this.Kv=n=>{var o;if(this.Rt=this.Rt||{navigationKey:void 0,url:void 0,metrics:[],firstMetricTimestamp:void 0},Fs(n?.name)||Fs(n?.value))return void kM.error("Invalid metric received",n);const i=typeof n.navigationURL=="string"?n.navigationURL:void 0,r=this.Xv(i);if(Eo(r))return;const s=jd(n.navigationId)||typeof n.navigationId=="string"?`navigation:${n.navigationId}`:`url:${r}`;if(this.Yv&&n.value>=this.Yv)return void kM.error("Ignoring metric with value >= "+this.Yv,n);this.Rt.navigationKey!==s&&(this.Qv(),this.Jv=setTimeout(this.Qv,this.flushToCaptureTimeoutMs)),Eo(this.Rt.navigationKey)&&(this.Rt.navigationKey=s,this.Rt.url=r),this.Rt.firstMetricTimestamp=Eo(this.Rt.firstMetricTimestamp)?Date.now():this.Rt.firstMetricTimestamp;const a=(o=this._instance.sessionManager)===null||o===void 0?void 0:o.checkAndGetSessionAndWindowId(!0),A=sn(sn(sn({},n),i?{navigationURL:r}:{}),{},{$current_url:r,timestamp:Date.now()});if(delete A.entries,xA(n.attribution)&&this.attributionMetrics.indexOf(n.name)>-1){const c={};for(const l of w9n){const g=l==="url"&&typeof n.attribution[l]=="string"?this.Xv(n.attribution[l]):n.attribution[l];Eo(g)||(c[l]=g)}A.attribution=c}else delete A.attribution;Eo(a)||(A.$session_id=a.sessionId,A.$window_id=a.windowId),this.Rt.metrics.push(A),this.Rt.metrics.length===this.allowedMetrics.length&&this.Qv()},this.tf=()=>{if(this.wo)return;let n,o,i,r,s=!1;const a=Ur.__PosthogExtensions__,A=a?.postHogWebVitalsCallbacksByFlavor,c=A?.[this.ef]||(this.ef==="web-vitals"&&Eo(A)?a?.postHogWebVitalsCallbacks:void 0);if(!Eo(c)){const u=c.withoutAttribution,h=this.attributionMetrics;s=!Eo(u),n=h.indexOf("LCP")>-1?c.onLCP:u?.onLCP||c.onLCP,o=h.indexOf("CLS")>-1?c.onCLS:u?.onCLS||c.onCLS,i=h.indexOf("FCP")>-1?c.onFCP:u?.onFCP||c.onFCP,r=h.indexOf("INP")>-1?c.onINP:u?.onINP||c.onINP}if(!(n&&o&&i&&r))return void kM.error("web vitals callbacks not loaded - not starting");const l={reportSoftNavs:this.useSoftNavs},g=s&&this.attributionMetrics.indexOf("INP")>-1?sn(sn({},l),{},{includeProcessedEventEntries:!1}):l;this.allowedMetrics.indexOf("LCP")>-1&&n(this.Kv.bind(this),l),this.allowedMetrics.indexOf("CLS")>-1&&o(this.Kv.bind(this),l),this.allowedMetrics.indexOf("FCP")>-1&&i(this.Kv.bind(this),l),this.allowedMetrics.indexOf("INP")>-1&&r(this.Kv.bind(this),g),this.wo=!0},this.Dv=!!(!((e=this._instance.persistence)===null||e===void 0)&&e.props[t2e]),this.startIfEnabled()}get if(){return this._instance.config.capture_performance}get allowedMetrics(){var t,e;const n=xA(this.if)?(t=this.if)===null||t===void 0?void 0:t.web_vitals_allowed_metrics:void 0;return Fs(n)?((e=this._instance.persistence)===null||e===void 0?void 0:e.props.$web_vitals_allowed_metrics)||qat:n}get flushToCaptureTimeoutMs(){return(xA(this.if)?this.if.web_vitals_delayed_flush_ms:void 0)||5e3}get attributionMetrics(){const t=xA(this.if)?this.if.web_vitals_attribution:void 0;return hy(t)?t?qat:[]:As(t)?t:v9n}get useAttribution(){return this.attributionMetrics.length>0}get useSoftNavs(){const t=xA(this.if)?this.if.__preview_web_vitals_soft_navs:void 0;return t!=null&&t}get Yv(){const t=xA(this.if)&&jd(this.if.__web_vitals_max_value)?this.if.__web_vitals_max_value:jat;return t>0&&6e4>=t?jat:t}get isEnabled(){const t=sd?.protocol;if(t!=="http:"&&t!=="https:")return kM.info("Web Vitals are disabled on non-http/https protocols"),!1;const e=xA(this.if)?this.if.web_vitals:hy(this.if)?this.if:void 0;return hy(e)?e:this.Dv}startIfEnabled(){this.isEnabled&&!this.wo&&(kM.info("enabled, starting..."),this.Bo(this.tf))}onRemoteConfig(t){if(!t.ok)return;const e=t.config;if(!("capturePerformance"in e))return;const n=xA(e.capturePerformance)&&!!e.capturePerformance.web_vitals,o=xA(e.capturePerformance)?e.capturePerformance.web_vitals_allowed_metrics:void 0;this._instance.persistence&&(this._instance.persistence.register({[t2e]:n}),this._instance.persistence.register({[Wrt]:o})),this.Dv=n,this.startIfEnabled()}get ef(){return this.useSoftNavs?this.useAttribution?"web-vitals-with-attribution-soft-navs":"web-vitals-soft-navs":this.useAttribution?"web-vitals-with-attribution":"web-vitals"}Bo(t){var e;const n=Ur.__PosthogExtensions__,o=this.ef,i=n?.postHogWebVitalsCallbacksByFlavor;i?.[o]||o==="web-vitals"&&Eo(i)&&n?.postHogWebVitalsCallbacks?t():n==null||(e=n.loadExternalDependency)===null||e===void 0||e.call(n,this._instance,o,r=>{r?kM.error("failed to load script",r):t()})}Xv(t){const e=t||Fn?.location.href;if(!e)return void kM.error("Could not determine current URL");const n=this._instance.config.disable_capture_url_hashes?iQ(e):e,o=this._instance.config.custom_personal_data_properties,i=this._instance.config.mask_personal_data_properties?[...Tk,...o||[]]:[];return AV(n,i,cV)}}},e7n={exceptionObserver:class{constructor(t){var e;this.tf=()=>{var n;if(!Fn||!this.isEnabled||!(!((n=Ur.__PosthogExtensions__)===null||n===void 0)&&n.errorWrappingFunctions))return;const o=Ur.__PosthogExtensions__.errorWrappingFunctions.wrapOnError,i=Ur.__PosthogExtensions__.errorWrappingFunctions.wrapUnhandledRejection,r=Ur.__PosthogExtensions__.errorWrappingFunctions.wrapConsoleError;try{!this.nf&&this.Mr.capture_unhandled_errors&&(this.nf=o(this.captureException.bind(this))),!this.sf&&this.Mr.capture_unhandled_rejections&&(this.sf=i(this.captureException.bind(this))),!this.rf&&this.Mr.capture_console_errors&&(this.rf=r(this.captureException.bind(this)))}catch(s){IV.error("failed to start",s),this.af()}},this._instance=t,this.lf=!!(!((e=this._instance.persistence)===null||e===void 0)&&e.props[Zye]),this.wt=new X5n(sn(sn({},(function(n={}){var o,i,r,s;return{refillRate:(o=(i=n.exceptionRateLimiterRefillRate)!==null&&i!==void 0?i:n.__exceptionRateLimiterRefillRate)!==null&&o!==void 0?o:1,bucketSize:(r=(s=n.exceptionRateLimiterBucketSize)!==null&&s!==void 0?s:n.__exceptionRateLimiterBucketSize)!==null&&r!==void 0?r:10}})(this._instance.config.error_tracking)),{},{refillInterval:1e4,A:IV})),this.Mr=this.uf(),this.startIfEnabledOrStop()}uf(){const t=this._instance.config.capture_exceptions;let e={capture_unhandled_errors:!1,capture_unhandled_rejections:!1,capture_console_errors:!1};return xA(t)?e=sn(sn({},e),t):(Eo(t)?this.lf:t)&&(e=sn(sn({},e),{},{capture_unhandled_errors:!0,capture_unhandled_rejections:!0})),e}get isEnabled(){return this.Mr.capture_console_errors||this.Mr.capture_unhandled_errors||this.Mr.capture_unhandled_rejections}startIfEnabledOrStop(){this.isEnabled?(IV.info("enabled"),this.af(),this.Bo(this.tf)):this.af()}Bo(t){var e,n,o;!((e=Ur.__PosthogExtensions__)===null||e===void 0)&&e.errorWrappingFunctions?t():(n=Ur.__PosthogExtensions__)===null||n===void 0||(o=n.loadExternalDependency)===null||o===void 0||o.call(n,this._instance,"exception-autocapture",i=>{if(i)return IV.error("failed to load script",i);t()})}af(){var t,e,n;(t=this.nf)===null||t===void 0||t.call(this),this.nf=void 0,(e=this.sf)===null||e===void 0||e.call(this),this.sf=void 0,(n=this.rf)===null||n===void 0||n.call(this),this.rf=void 0}onRemoteConfig(t){if(!t.ok)return;const e=t.config;"autocaptureExceptions"in e&&(this.lf=!!e.autocaptureExceptions||!1,this._instance.persistence&&this._instance.persistence.register({[Zye]:this.lf}),this.Mr=this.uf(),this.startIfEnabledOrStop())}onConfigChange(){this.Mr=this.uf()}captureException(t){try{var e,n,o;const i=(e=t==null||(n=t.$exception_list)===null||n===void 0||(n=n[0])===null||n===void 0?void 0:n.type)!==null&&e!==void 0?e:"Exception";if(this.wt.consumeRateLimit(i))return void IV.info("Skipping exception capture because of client rate limiting.",{exception:i});(o=this._instance.exceptions)===null||o===void 0||o.sendExceptionEvent(t)}catch{}}},exceptions:class{constructor(t){var e,n;this.hf=[],this.cf=new c4n([new B4n,new N4n,new S4n,new b4n,new M4n,new P4n,new v4n,new D4n],(function(o,...i){return(r,s=0)=>{const a=[],A=r.split(`
241
- `),c=Math.min(A.length,s+1e3),l=[];for(let h=s;c>h;h++){const d=A[h];if(d.length>1024)continue;const p=_rt.test(d)?d.replace(_rt,"$1"):d;if(!p.match(/\S*Error: /)){for(const m of i){const _=m(p,o);if(_){a.push(_);const f=C4n(a);if(f){for(let I=l.length-1;I>=0;I--){const C=l[I];if(f.start>=C.start+C.length)break;l.pop()}l.push(f)}break}}if(x4n(a,l)>=50)break}}const g=[...l].sort((h,d)=>d.start-h.start),u=g[g.length-1];if(u){const h=frt(a,u);a.splice(u.start-h,h);for(const d of g)d.start-=h}for(const h of g)y4n(a,h);return l.some(h=>h.start===0&&a.length===h.length)&&(function(h){const d=h.map(m=>`${m.function}|${m.filename}|${m.lineno}|${m.colno}|${m.module}`);let p=0;for(let m=1;d.length>m;m++)E4n(d,m,p)&&(p=m);h.push(...h.splice(0,p))})(a),(function(h){if(!h.length)return[];const d=Array.from(h);return d.reverse(),d.slice(0,50).map(p=>{return sn(sn({},p),{},{filename:p.filename||(m=d,m[m.length-1]||{}).filename,function:p.function||"?"});var m})})(a)}})("web:javascript",m4n,I4n)),this._instance=t,this.hf=(e=(n=this._instance.persistence)===null||n===void 0?void 0:n.get_property("$error_tracking_suppression_rules"))!==null&&e!==void 0?e:[],this.df=Jte(this.vf()),this.ff=new T4n(this.df)}onConfigChange(){this.df=Jte(this.vf()),this.ff.setConfig(this.df)}onRemoteConfig(t){var e,n,o;if(!t.ok)return;const i=t.config;if(!("errorTracking"in i))return;const r=(e=(n=i.errorTracking)===null||n===void 0?void 0:n.suppressionRules)!==null&&e!==void 0?e:[],s=(o=i.errorTracking)===null||o===void 0?void 0:o.captureExtensionExceptions;this.hf=r,this._instance.persistence&&this._instance.persistence.register({[zrt]:this.hf,[e2e]:s})}get pf(){var t;const e=!!this._instance.get_property(e2e),n=this._instance.config.error_tracking.captureExtensionExceptions;return(t=n??e)!==null&&t!==void 0&&t}buildProperties(t,e){return this.cf.buildFromUnknown(t,{syntheticException:e?.syntheticException,mechanism:{handled:e?.handled}})}addExceptionStep(t,e){if(this.df.enabled)try{if(!nA(t)||t.trim().length===0)return void L4.warn("Ignoring exception step because message must be a non-empty string");const{sanitizedProperties:n,droppedKeys:o}=(function(i){if(!i)return{sanitizedProperties:{},droppedKeys:[]};const r=[];return{sanitizedProperties:Object.keys(i).reduce((s,a)=>R4n.has(a)?(r.push(a),s):(s[a]=i[a],s),{}),droppedKeys:r}})(this.gf(e));o.length>0&&L4.warn("Ignoring reserved exception step fields",{droppedKeys:o}),this.ff.add(sn({[Vte]:t,[zte]:new Date().toISOString()},n))}catch(n){L4.error("Failed to add exception step. Ignoring breadcrumb.",n)}}sendExceptionEvent(t){try{const e=t.$exception_list;if(this.mf(e)){if(this.yf(e))return this.bf("Exception dropped: matched a suppression rule"),void L4.info("Skipping exception capture because a suppression rule matched");if(!this.pf&&this._f(e))return this.bf("Exception dropped: thrown by a browser extension"),void L4.info("Skipping exception capture because it was thrown by an extension");if(!this.pf&&this.wf(e))return this.bf("Exception dropped: thrown by an injected browser script"),void L4.info("Skipping exception capture because it was thrown by an injected browser script");if(!this._instance.config.error_tracking.__capturePostHogExceptions&&this.kf(e))return this.bf("Exception dropped: thrown by the PostHog SDK"),void L4.info("Skipping exception capture because it was thrown by the PostHog SDK")}const n=this.df.enabled&&Fs(t.$exception_steps)?this.Sf(t):t,o=(function(){const i=globalThis._posthogReleaseId;return typeof i=="string"&&i.length>0?i:void 0})();o&&(n.$release_id=o);try{const i=this._instance.capture("$exception",n,{_noTruncate:!0,_batchKey:"exceptionEvent",dh:!0});return i&&this.ff.clear(),i}catch(i){return cAt(i)||L4.error("Failed to capture exception event. Dropping this exception.",i),void this.ff.clear()}}catch(e){return void(cAt(e)||L4.error("Failed to process exception event. Ignoring this exception.",e))}}Sf(t){try{const e=this.ff.getAttachable();return e.length===0?t:sn(sn({},t),{},{$exception_steps:e})}catch(e){return L4.error("Failed to read buffered exception steps. Capturing exception without steps.",e),t}}bf(t){this.df.enabled&&this.ff.add({[Vte]:t,[zte]:new Date().toISOString()})}gf(t){return xA(t)?sn({},t):{}}vf(){var t,e;return(t=(e=this._instance.config.error_tracking)===null||e===void 0?void 0:e.exception_steps)!==null&&t!==void 0?t:{}}yf(t){if(t.length===0)return!1;try{const e=t.reduce((n,{type:o,value:i})=>(nA(o)&&o.length>0&&n.$exception_types.push(o),nA(i)&&i.length>0&&n.$exception_values.push(i),n),{$exception_types:[],$exception_values:[]});return this.hf.some(n=>{const o=n.values.map(i=>{const r=Rat[i.operator],s=e[i.key];if(!r||!s)return!1;const a=As(i.value)?i.value:[i.value];return a.length>0&&r(a,s)});return n.type==="OR"?o.some(Boolean):o.every(Boolean)})}catch(e){return L4.warn("Failed to evaluate suppression rules. Capturing the exception.",e),!1}}_f(t){const e=t.flatMap(o=>{var i,r;return(i=(r=o.stacktrace)===null||r===void 0?void 0:r.frames)!==null&&i!==void 0?i:[]}),n=e.filter(({filename:o})=>!!o&&U9n.some(i=>o.startsWith(i)));return n.length!==0&&(!n.every(({filename:o})=>!!o&&o.startsWith(exe))||t.some(({type:o,value:i})=>o==="NoResponse"||nA(i)&&Y9n.some(({value:r,exact:s})=>s?i===r:i.includes(r)))&&!e.some(({in_app:o,filename:i})=>o&&!i?.startsWith(exe)))}wf(t){return t.some(({value:e})=>nA(e)&&K9n.some(n=>e.includes(n)))}kf(t){if(t.length>0){var e,n,o,i;const r=(e=(n=t[0].stacktrace)===null||n===void 0?void 0:n.frames)!==null&&e!==void 0?e:[],s=r[r.length-1];return(o=s==null||(i=s.filename)===null||i===void 0?void 0:i.includes("posthog.com/static"))!==null&&o!==void 0&&o}return!1}mf(t){return!Fs(t)&&As(t)}}},t7n=sn({productTours:class{get Tl(){return this._instance.persistence}constructor(t){this.xf=null,this.Cf=null,this._instance=t}initialize(){this.loadIfEnabled()}onRemoteConfig(t){if(!t.ok)return;const e=t.config;if("productTours"in e){var n,o;if(this.Tl&&this.Tl.register({[o2e]:!!e.productTours}),!$2e(this._instance))return!this.xf&&Fs((n=this.Tl)===null||n===void 0?void 0:n.props.ph_product_tours)||hne.info("product tours disabled; stopping and clearing cached tours"),(o=this.xf)===null||o===void 0||o.stop(),this.xf=null,void this.clearCache();this.loadIfEnabled()}}loadIfEnabled(){!this.xf&&$2e(this._instance)&&this.Bo(()=>this.$f())}Bo(t){var e,n,o;!((e=Ur.__PosthogExtensions__)===null||e===void 0)&&e.generateProductTours?t():(n=Ur.__PosthogExtensions__)===null||n===void 0||(o=n.loadExternalDependency)===null||o===void 0||o.call(n,this._instance,"product-tours",i=>{i?hne.error("Could not load product tours script",i):t()})}$f(){var t;!this.xf&&(!((t=Ur.__PosthogExtensions__)===null||t===void 0)&&t.generateProductTours)&&(this.xf=Ur.__PosthogExtensions__.generateProductTours(this._instance,!0))}getProductTours(t,e=!1){if(As(this.Cf)&&!e)return void t(this.Cf,{isLoaded:!0});const n=this.Tl;if(n){const o=n.props[r2e];if(As(o)&&!e)return this.Cf=o,void t(o,{isLoaded:!0})}this._instance._send_request({url:this._instance.requestRouter.endpointFor("api",`/api/product_tours/?token=${this._instance.config.token}`),method:"GET",timestampMode:"query",callback:o=>{if(!$2e(this._instance))return void t([],{isLoaded:!0});const i=o.statusCode;if(i!==200||!o.json){const s=`Product Tours API could not be loaded, status: ${i}`;return i===0?o.error||hne.warn(s):hne.error(s),void t([],{isLoaded:!1,error:s})}const r=As(o.json.product_tours)?o.json.product_tours:[];this.Cf=r,n&&n.register({[r2e]:r}),t(r,{isLoaded:!0})}})}getActiveProductTours(t){Fs(this.xf)?t([],{isLoaded:!1,error:"Product tours not loaded"}):this.xf.getActiveProductTours(t)}showProductTour(t){var e;(e=this.xf)===null||e===void 0||e.showTourById(t)}previewTour(t){this.xf?this.xf.previewTour(t):this.Bo(()=>{var e;this.$f(),(e=this.xf)===null||e===void 0||e.previewTour(t)})}dismissProductTour(){var t;(t=this.xf)===null||t===void 0||t.dismissTour("user_clicked_skip")}nextStep(){var t;(t=this.xf)===null||t===void 0||t.nextStep()}previousStep(){var t;(t=this.xf)===null||t===void 0||t.previousStep()}clearCache(){var t;this.Cf=null,(t=this.Tl)===null||t===void 0||t.unregister("ph_product_tours")}resetTour(t){var e;(e=this.xf)===null||e===void 0||e.resetTour(t)}resetAllTours(){var t;(t=this.xf)===null||t===void 0||t.resetAllTours()}cancelPendingTour(t){var e;(e=this.xf)===null||e===void 0||e.cancelPendingTour(t)}}},mne),n7n={siteApps:class{constructor(t){this._instance=t,this.Tf=0,this.If=[],this.apps={}}get isEnabled(){return!!this._instance.config.opt_in_site_apps}Mf(t,e){if(!e)return;const n=this.globalsForEvent(e);this.If.push(n),this.If.length>1e3&&(this.If=this.If.slice(10))}get siteAppLoaders(){var t;return(t=Ur._POSTHOG_REMOTE_CONFIG)===null||t===void 0||(t=t[this._instance.config.token])===null||t===void 0?void 0:t.siteApps}initialize(){if(this.isEnabled){const t=this._instance._addCaptureHook(this.Mf.bind(this));this.Ef=()=>{t(),this.If=[],this.Ef=void 0}}}globalsForEvent(t){var e,n,o,i,r,s,a;if(!t)throw new Error("Event payload is required");const A={},c=this._instance.get_property("$groups")||[],l=this._instance.get_property("$stored_group_properties")||{};for(const[h,d]of Object.entries(l))A[h]={id:c[h],type:h,properties:d};const{$set_once:g,$set:u}=t;return{event:sn(sn({},vrt(t,D9n)),{},{properties:sn(sn(sn({},t.properties),u?{$set:sn(sn({},(e=(n=t.properties)===null||n===void 0?void 0:n.$set)!==null&&e!==void 0?e:{}),u)}:{}),g?{$set_once:sn(sn({},(o=(i=t.properties)===null||i===void 0?void 0:i.$set_once)!==null&&o!==void 0?o:{}),g)}:{}),elements_chain:(r=(s=t.properties)===null||s===void 0?void 0:s.$elements_chain)!==null&&r!==void 0?r:"",distinct_id:(a=t.properties)===null||a===void 0?void 0:a.distinct_id}),person:{properties:this._instance.get_property("$stored_person_properties")},groups:A}}Pf(t){var e;const n=(e=t.tagName)===null||e===void 0?void 0:e.toLowerCase();return n==="style"&&this._instance.config.prepare_external_dependency_stylesheet?this._instance.config.prepare_external_dependency_stylesheet(t)||(S9.error("prepare_external_dependency_stylesheet returned null"),null):n==="script"&&this._instance.config.prepare_external_dependency_script?this._instance.config.prepare_external_dependency_script(t)||(S9.error("prepare_external_dependency_script returned null"),null):t}Rf(){var t,e,n,o,i,r,s,a;if(!this._instance.config.prepare_external_dependency_stylesheet&&!this._instance.config.prepare_external_dependency_script)return()=>{};const A=No?.defaultView,c=A==null||(t=A.Node)===null||t===void 0?void 0:t.prototype;if(!A||!c)return()=>{};if(this.Tf++,this.Af)return this.Ff();const l=[],g=this,u=new WeakSet,h=(m,_,f)=>{if(!m?.[_])return;const I=m[_];m[_]=f(I),l.push(()=>{m[_]=I})},d=m=>{if(u.has(m))return m;const _=g.Pf(m);return _&&u.add(_),_},p=m=>m.map(_=>typeof _=="string"?_:d(_)).filter(_=>!ad(_));return h(c,"appendChild",m=>function(_){const f=d(_);return f?m.call(this,f):_}),h(c,"insertBefore",m=>function(_,f){const I=d(_);return I?m.call(this,I,f):_}),h(c,"replaceChild",m=>function(_,f){const I=d(_);return I?m.call(this,I,f):f}),[(e=A.Element)===null||e===void 0?void 0:e.prototype,(n=A.Document)===null||n===void 0?void 0:n.prototype,(o=A.DocumentFragment)===null||o===void 0?void 0:o.prototype].forEach(m=>{h(m,"append",_=>function(...f){return _.apply(this,p(f))}),h(m,"prepend",_=>function(...f){return _.apply(this,p(f))})}),[(i=A.Element)===null||i===void 0?void 0:i.prototype,(r=A.CharacterData)===null||r===void 0?void 0:r.prototype,(s=A.DocumentType)===null||s===void 0?void 0:s.prototype].forEach(m=>{h(m,"before",_=>function(...f){return _.apply(this,p(f))}),h(m,"after",_=>function(...f){return _.apply(this,p(f))}),h(m,"replaceWith",_=>function(...f){const I=p(f);return f.length&&!I.length?void 0:_.apply(this,I)})}),h((a=A.Element)===null||a===void 0?void 0:a.prototype,"insertAdjacentElement",m=>function(_,f){const I=d(f);return I?m.call(this,_,I):null}),this.Af=()=>{l.forEach(m=>m()),this.Af=void 0},this.Ff()}Ff(){let t=!1;return()=>{var e;t||(t=!0,this.Tf--,this.Tf===0&&((e=this.Af)===null||e===void 0||e.call(this)))}}Of(t,e=!0){const n=this.Rf();try{const o=t(n);return e&&n(),o}catch(o){throw n(),o}}setupSiteApp(t){const e=this.apps[t.id],n=()=>{var r;!e.errored&&this.If.length&&(S9.info(`Processing ${this.If.length} events for site app with id ${t.id}`),this.If.forEach(s=>this.Of(()=>{var a;return(a=e.processEvent)===null||a===void 0?void 0:a.call(e,s)})),e.processedBuffer=!0),Object.values(this.apps).every(s=>s.processedBuffer||s.errored)&&((r=this.Ef)===null||r===void 0||r.call(this))};let o=!1;const i=r=>{e.errored=!r,e.loaded=!0,S9.info(`Site app with id ${t.id} ${r?"loaded":"errored"}`),o&&n()};try{const{processEvent:r}=this.Of(s=>t.init({posthog:this._instance,callback(a){s(),i(a)}}),!1);r&&(e.processEvent=r),o=!0}catch(r){S9.error($at+t.id,r),i(!1)}if(o&&e.loaded)try{n()}catch(r){S9.error(`Error while processing buffered events PostHog app with config id ${t.id}`,r),e.errored=!0}}Df(){const t=this.siteAppLoaders||[];for(const e of t)this.apps[e.id]={id:e.id,loaded:!1,errored:!1,processedBuffer:!1};for(const e of t)this.setupSiteApp(e)}Lf(t){if(Object.keys(this.apps).length===0)return;const e=this.globalsForEvent(t);for(const n of Object.values(this.apps))try{this.Of(()=>{var o;return(o=n.processEvent)===null||o===void 0?void 0:o.call(n,e)})}catch(o){S9.error(`Error while processing event ${t.event} for site app ${n.id}`,o)}}onRemoteConfig(t){var e,n,o;if(!((e=this.siteAppLoaders)===null||e===void 0)&&e.length)return this.isEnabled?(this.Df(),void this._instance.on("eventCaptured",a=>this.Lf(a))):void S9.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.');if((n=this.Ef)===null||n===void 0||n.call(this),!t.ok)return;const i=t.config;if(!((o=i.siteApps)===null||o===void 0)&&o.length)if(this.isEnabled)for(const{id:a,url:A}of i.siteApps){var r,s;Ur[`__$$ph_site_app_${a}`]=this._instance,(r=Ur.__PosthogExtensions__)===null||r===void 0||(s=r.loadSiteApp)===null||s===void 0||s.call(r,this._instance,A,c=>{if(c)return S9.error($at+a,c)})}else S9.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}}},o7n={tracingHeaders:class{constructor(t){this._instance=t,this.Nf=void 0,this.qf=void 0,this.jf=void 0,this.tf=()=>{const e=this.Bf();var n,o;e?(Eo(this.Nf)&&(this.Nf=(n=Ur.__PosthogExtensions__)===null||n===void 0||(n=n.tracingHeadersPatchFns)===null||n===void 0?void 0:n._patchXHR(e,()=>this._instance.get_distinct_id(),this._instance.sessionManager)),Eo(this.qf)&&(this.qf=(o=Ur.__PosthogExtensions__)===null||o===void 0||(o=o.tracingHeadersPatchFns)===null||o===void 0?void 0:o._patchFetch(e,()=>this._instance.get_distinct_id(),this._instance.sessionManager))):this.af()}}initialize(){this.startIfEnabledOrStop()}Bo(t){var e,n,o;!((e=Ur.__PosthogExtensions__)===null||e===void 0)&&e.tracingHeadersPatchFns?t():(n=Ur.__PosthogExtensions__)===null||n===void 0||(o=n.loadExternalDependency)===null||o===void 0||o.call(n,this._instance,"tracing-headers",i=>{if(i)return Q9n.error("failed to load script",i);t()})}Hf(){var t,e;return(t=(e=this._instance.config.tracing_headers)!==null&&e!==void 0?e:this._instance.config.addTracingHeaders)!==null&&t!==void 0?t:this._instance.config.__add_tracing_headers}Bf(){const t=this.Hf();return As(t)?(As(this.jf)?this.jf.splice(0,this.jf.length,...t):this.jf=[...t],t.length>0?this.jf:void 0):(As(this.jf)&&this.jf.splice(0),this.jf=t||void 0,this.jf)}af(){var t,e;(t=this.Nf)===null||t===void 0||t.call(this),(e=this.qf)===null||e===void 0||e.call(this),this.Nf=void 0,this.qf=void 0}startIfEnabledOrStop(){this.Bf()?this.Bo(this.tf):this.af()}}},i7n=sn({surveys:class extends N9n{constructor(t){var e;super(new L9n(t),(e=t,{get projectToken(){return e.config.token},kv:new F9n(e)})),this._instance=t}Wh(t,e){const n=e.query?hV(t,e.query):t;return new Promise(o=>{var i;this._instance._send_request({method:e.method,url:this._instance.requestRouter.endpointFor((i=e.target)!==null&&i!==void 0?i:"api",n),data:e.body,headers:e.headers,timeout:e.timeoutMs,fireCallbackOnDrop:!0,transport:e.transport,compression:e.compression,timestampMode:e.sentAt,callback:o})})}}},mne),r7n={toolbar:class{constructor(t){this.instance=t}zf(t){Ur.ph_toolbar_state=t}Uf(){var t;return(t=Ur.ph_toolbar_state)!==null&&t!==void 0?t:0}initialize(){return this.maybeLoadToolbar()}maybeLoadToolbar(t=void 0,e=void 0,n=void 0){var o,i;if(h2e(this.instance.config)||!Fn||!No)return!1;t=(o=t)!==null&&o!==void 0?o:Fn.location,n=(i=n)!==null&&i!==void 0?i:Fn.history;try{if(!e){try{Fn.localStorage.setItem("test","test"),Fn.localStorage.removeItem("test")}catch{return!1}e=Fn?.localStorage}const r=H9n||ine(t.hash,"__posthog")||ine(t.hash,"state");let s;const a=r?lrt(()=>JSON.parse(atob(decodeURIComponent(r))))||lrt(()=>JSON.parse(decodeURIComponent(r))):null;return a&&a.action==="ph_authorize"?(s=a,s.source="url",s&&Object.keys(s).length>0&&(a.desiredHash?t.hash=a.desiredHash:n?n.replaceState(n.state,"",t.pathname+t.search):t.hash="")):(s=JSON.parse(e.getItem(tAt)||"{}"),s.source="localstorage",delete s.userIntent),!(!s.token||this.instance.config.token!==s.token||(this.loadToolbar(s),0))}catch{return!1}}Wf(t){const e=Ur.ph_load_toolbar||Ur.ph_load_editor;!Fs(e)&&L_(e)?e(t,this.instance):nAt.warn("No toolbar load function found")}loadToolbar(t){const e=!!No?.getElementById("__POSTHOG_TOOLBAR__");if(!Fn||e)return!1;const n=this.instance.requestRouter.region==="custom"&&this.instance.config.advanced_disable_toolbar_metrics,o=sn(sn({token:this.instance.config.token},t),{},{apiURL:this.instance.requestRouter.endpointFor("ui")},n?{instrument:!1}:{});if(Fn.localStorage.setItem(tAt,JSON.stringify(sn(sn({},o),{},{source:void 0}))),this.Uf()===2)this.Wf(o);else if(this.Uf()===0){var i,r;this.zf(1),(i=Ur.__PosthogExtensions__)===null||i===void 0||(r=i.loadExternalDependency)===null||r===void 0||r.call(i,this.instance,"toolbar",s=>{if(s)return nAt.error("[Toolbar] Failed to load",s),void this.zf(0);this.zf(2),this.Wf(o)}),jc(Fn,"turbolinks:load",()=>{this.zf(0),this.loadToolbar(o)})}return!0}Vf(t){return this.loadToolbar(t)}maybeLoadEditor(t=void 0,e=void 0,n=void 0){return this.maybeLoadToolbar(t,e,n)}}},s7n=sn({experiments:class ex{get Mr(){return this._instance.config}constructor(e){this._instance=e,this.getWebExperimentsAndEvaluateDisplayLogic=(n=!1)=>{this.getWebExperiments(o=>{ex.Gf("retrieved web experiments from the server"),this.Zf=new Map,o.forEach(i=>{if(i.feature_flag_key){var r;this.Zf&&(ex.Gf("setting flag key ",i.feature_flag_key," to web experiment ",i),(r=this.Zf)===null||r===void 0||r.set(i.feature_flag_key,i));const s=this._instance.getFeatureFlag(i.feature_flag_key);nA(s)&&i.variants[s]&&this.Qf(i.name,s,i.variants[s].transforms)}else if(i.variants)for(const s in i.variants){const a=i.variants[s];ex.Jf(a,this._instance)&&this.Qf(i.name,s,a.transforms)}})},n)},this._instance.onFeatureFlags(n=>{this.onFeatureFlags(n)})}initialize(){}onFeatureFlags(e){if(this._is_bot())ex.Gf(lAt);else if(!this.Mr.disable_web_experiments){if(Fs(this.Zf))return this.Zf=new Map,this.loadIfEnabled(),void this.previewWebExperiment();ex.Gf("applying feature flags",e),e.forEach(n=>{var o;if(this.Zf&&(!((o=this.Zf)===null||o===void 0)&&o.has(n))){var i;const r=this._instance.getFeatureFlag(n),s=(i=this.Zf)===null||i===void 0?void 0:i.get(n);r&&s?.variants[r]&&this.Qf(s.name,r,s.variants[r].transforms)}})}}previewWebExperiment(){const e=ex.getWindowLocation();if(e?.search){const n=Rk(e?.search,"__experiment_id"),o=Rk(e?.search,"__experiment_variant");n&&o&&(ex.Gf(`previewing web experiments ${n} && ${o}`),this.getWebExperiments(i=>{this.Kf(parseInt(n),o,i)},!1,!0))}}loadIfEnabled(){this.Mr.disable_web_experiments||this.getWebExperimentsAndEvaluateDisplayLogic()}getWebExperiments(e,n,o){if(this.Mr.disable_web_experiments&&!o)return e([]);const i=this._instance.get_property("$web_experiments");if(i&&!n)return e(i);this._instance._send_request({url:this._instance.requestRouter.endpointFor("api",`/api/web_experiments/?token=${this.Mr.token}`),method:"GET",timestampMode:"query",callback:r=>e(r.statusCode===200&&r.json&&r.json.experiments||[])})}Kf(e,n,o){const i=o.filter(r=>r.id===e);i&&i.length>0&&(ex.Gf(`Previewing web experiment [${i[0].name}] with variant [${n}]`),this.Qf(i[0].name,n,i[0].variants[n].transforms))}static Jf(e,n){return!Fs(e.conditions)&&ex.Xf(e,n)&&ex.Yf(e)}static Xf(e,n){var o;if(Fs(e.conditions)||Fs((o=e.conditions)===null||o===void 0?void 0:o.url))return!0;const i=ex.getWindowLocation();if(i){var r,s,a;const A=xst(n,i.href);return!(!((r=e.conditions)===null||r===void 0)&&r.url)||V9n[(s=(a=e.conditions)===null||a===void 0?void 0:a.urlMatchType)!==null&&s!==void 0?s:"icontains"](e.conditions.url,A)}return!1}static getWindowLocation(){return Fn?.location}static Yf(e){var n;if(Fs(e.conditions)||Fs((n=e.conditions)===null||n===void 0?void 0:n.utm))return!0;const o=Jst();if(o.utm_source){var i,r,s,a,A,c,l,g;const u=!(!((i=e.conditions)===null||i===void 0||(i=i.utm)===null||i===void 0)&&i.utm_campaign)||((r=e.conditions)===null||r===void 0||(r=r.utm)===null||r===void 0?void 0:r.utm_campaign)==o.utm_campaign,h=!(!((s=e.conditions)===null||s===void 0||(s=s.utm)===null||s===void 0)&&s.utm_source)||((a=e.conditions)===null||a===void 0||(a=a.utm)===null||a===void 0?void 0:a.utm_source)==o.utm_source,d=!(!((A=e.conditions)===null||A===void 0||(A=A.utm)===null||A===void 0)&&A.utm_medium)||((c=e.conditions)===null||c===void 0||(c=c.utm)===null||c===void 0?void 0:c.utm_medium)==o.utm_medium,p=!(!((l=e.conditions)===null||l===void 0||(l=l.utm)===null||l===void 0)&&l.utm_term)||((g=e.conditions)===null||g===void 0||(g=g.utm)===null||g===void 0?void 0:g.utm_term)==o.utm_term;return u&&d&&p&&h}return!1}static Gf(e,...n){gi.info(`[WebExperiments] ${e}`,n)}Qf(e,n,o){this._is_bot()?ex.Gf(lAt):n!=="control"?o.forEach(i=>{if(i.selector){var r;ex.Gf(`applying transform of variant ${n} for experiment ${e} `,i);const s=(r=document)===null||r===void 0?void 0:r.querySelectorAll(i.selector);s?.forEach(a=>{const A=a;i.html&&(A.innerHTML=i.html),i.css&&A.setAttribute("style",i.css)})}}):ex.Gf("Control variants leave the page unmodified.")}_is_bot(){return F_&&this._instance?Mat(F_,this.Mr.custom_blocked_useragents):void 0}}},mne),a7n={conversations:class{constructor(t){this._instance=t,this.tp=void 0,this._conversationsManager=null,this.ep=!1,this.ne=null,this.np=!1}initialize(){this.loadIfEnabled()}onRemoteConfig(t){if(this._instance.config.disable_conversations||(this.sp=t.ok,!t.ok))return;const e=t.config.conversations;Fs(e)||(hy(e)?this.tp=e:(this.tp=e.enabled,this.ne=e),this.loadIfEnabled())}reset(){var t;(t=this._conversationsManager)===null||t===void 0||t.reset(),this._conversationsManager=null,this.tp=void 0,this.ne=null,this.sp=void 0,this.np=!1}loadIfEnabled(){if(this._conversationsManager||this.ep||this._instance.config.disable_conversations||h2e(this._instance.config)||this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut())return;const t=Ur?.__PosthogExtensions__;if(t&&!Eo(this.tp)&&this.tp)if(this.ne&&this.ne.token){this.ep=!0;try{const e=t.initConversations;if(e)return this.rp(e),void(this.ep=!1);const n=t.loadExternalDependency;if(!n)return void this.op(g2e);n(this._instance,"conversations",o=>{o||!t.initConversations?this.op("Could not load conversations script",o):this.rp(t.initConversations),this.ep=!1})}catch(e){this.op("Error initializing conversations",e),this.ep=!1}}else p5.error("Conversations enabled but missing token in remote config.")}rp(t){if(this.ne)try{this._conversationsManager=t(this.ne,this._instance),this.np=!1,p5.info("Conversations loaded successfully")}catch(e){this.op("Error completing conversations initialization",e)}else p5.error("Cannot complete initialization: remote config is null")}op(t,e){p5.error(t,e),this._conversationsManager=null,this.ep=!1,this.np=!0}show(){this._conversationsManager?this._conversationsManager.show():p5.warn("Conversations not loaded yet.")}hide(){this._conversationsManager&&this._conversationsManager.hide()}isAvailable(){return this.tp===!0&&!ad(this._conversationsManager)}getUnavailableReason(){return this.isAvailable()?null:this._instance.config.disable_conversations?"disabled_by_config":h2e(this._instance.config)?"disabled_for_toolbar":this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut()?"consent_opted_out":this.sp===!1?"remote_config_failed":Eo(this.tp)?this.sp?"disabled_in_project":"remote_config_pending":this.tp?Fs(this.ne)||!this.ne.token?"missing_token":Ur?.__PosthogExtensions__?this.ep?"initializing":this.np?"load_failed":"not_loaded":"extensions_unavailable":"disabled_in_project"}isVisible(){var t,e;return(t=(e=this._conversationsManager)===null||e===void 0?void 0:e.isVisible())!==null&&t!==void 0&&t}sendMessage(t,e,n){var o=this;return Wg(function*(){return o._conversationsManager?o._conversationsManager.sendMessage(t,e,n):(p5.warn(LM),null)})()}getMessages(t,e){var n=this;return Wg(function*(){return n._conversationsManager?n._conversationsManager.getMessages(t,e):(p5.warn(LM),null)})()}markAsRead(t){var e=this;return Wg(function*(){return e._conversationsManager?e._conversationsManager.markAsRead(t):(p5.warn(LM),null)})()}getTickets(t){var e=this;return Wg(function*(){return e._conversationsManager?e._conversationsManager.getTickets(t):(p5.warn(LM),null)})()}requestRestoreLink(t){var e=this;return Wg(function*(){return e._conversationsManager?e._conversationsManager.requestRestoreLink(t):(p5.warn(LM),null)})()}restoreFromToken(t){var e=this;return Wg(function*(){return e._conversationsManager?e._conversationsManager.restoreFromToken(t):(p5.warn(LM),null)})()}restoreFromUrlToken(){var t=this;return Wg(function*(){return t._conversationsManager?t._conversationsManager.restoreFromUrlToken():(p5.warn(LM),null)})()}getCurrentTicketId(){var t,e;return(t=(e=this._conversationsManager)===null||e===void 0?void 0:e.getCurrentTicketId())!==null&&t!==void 0?t:null}getWidgetSessionId(){var t,e;return(t=(e=this._conversationsManager)===null||e===void 0?void 0:e.getWidgetSessionId())!==null&&t!==void 0?t:null}kh(){var t;(t=this._conversationsManager)===null||t===void 0||t.setIdentity()}Sh(){var t;(t=this._conversationsManager)===null||t===void 0||t.clearIdentity()}}},A7n={logs:class{constructor(t){var e;this._instance=t,this.name="logs",this.ap=!1,this.lp=!1,this.up=!1,this.A=Ad("[logs]"),this.hp=sn(sn({},this.A),{},{error:(...n)=>{n.some(hAt)||this.A.error(...n)}}),this.rl=[],this.cp=[],this.bd=0,this.$o=!1,this.dp=[],this.vp=[],this.fp=!1,this.pp=!1,this.gp=()=>{var n,o;this.$o||(this.bd=0,(n=this.mp)===null||n===void 0||n.onReconnect(),(o=this.yp)===null||o===void 0||o.onReconnect())},this._instance&&(!((e=this._instance.config.logs)===null||e===void 0)&&e.captureConsoleLogs)&&(this.ap=!0),Fn&&jc(Fn,"online",this.gp)}bp(t,e,n,o){var i;const r=gAt((i=this._instance)===null||i===void 0||(i=i.config)===null||i===void 0?void 0:i.logs,n);return[new V4n(this._p(t,e),r,this.hp,()=>this.wp(),s=>s(),void 0,o),r]}kp(){var t;const e=(t=this._instance)===null||t===void 0||(t=t.config)===null||t===void 0?void 0:t.logs;var n;return this.mp&&this.Sp===e||((n=this.mp)===null||n===void 0||n.reset(),this.Sp=e,[this.mp,this.xp]=this.bp(()=>this.rl,o=>{this.rl=o})),this.mp}Cp(){var t;const e=(t=this._instance)===null||t===void 0||(t=t.config)===null||t===void 0?void 0:t.logs;var n;return this.yp&&this.$p===e||((n=this.yp)===null||n===void 0||n.reset(),this.$p=e,[this.yp,this.Tp]=this.bp(()=>this.cp,o=>{this.cp=o},{serviceNameDefault:"posthog-browser-logs",consoleCapture:!0},uAt)),this.yp}setup(t){var e;if(this.$o)return;this.yo=t,!((e=this._instance)===null||e===void 0||(e=e.config)===null||e===void 0||(e=e.logs)===null||e===void 0)&&e.captureConsoleLogs&&(this.ap=!0),(this.ap||this.Ip()&&this.Mp())&&this.Ep();let n=!1;const o=t.onRemoteConfig(i=>{var r;n=i.ok&&((r=i.config.logs)===null||r===void 0?void 0:r.captureConsoleLogs)===!0,this.onRemoteConfig(i)});this.$o?o.dispose():(this.Mo=o,n||this.loadIfEnabled())}dispose(){var t,e,n,o;this.$o||(this.$o=!0,this.Pp(),(t=this.Mo)===null||t===void 0||t.dispose(),this.Mo=void 0,this.yo=void 0,this.up=!1,Fn?.removeEventListener("online",this.gp),(e=this.Rp)===null||e===void 0||e.call(this),this.Rp=void 0,(n=this.mp)===null||n===void 0||n.reset(),(o=this.yp)===null||o===void 0||o.reset())}onRemoteConfig(t){var e,n;if(this.$o)return;const o=t.ok?(e=t.config.logs)===null||e===void 0?void 0:e.captureConsoleLogs:void 0;Fs(o)?this.Ap():((n=this._instance)===null||n===void 0||(n=n.persistence)===null||n===void 0||n.register({$logs_capture_enabled_server_side:!!o}),o?(this.ap=!0,this.lp||this.Ep(),this.loadIfEnabled()):this.Ap())}reset(){var t,e,n,o;this.Pp(),(t=this.mp)===null||t===void 0||t.clearQueue(),this.rl=[],(e=this.mp)===null||e===void 0||e.reset(),(n=this.yp)===null||n===void 0||n.clearQueue(),this.cp=[],(o=this.yp)===null||o===void 0||o.reset(),this.bd=0}captureLog(t){this.$o||this.kp().captureLog(t)}captureConsoleLog(t){this.$o||this.Cp().captureLog(t)}captureBufferedConsoleLog(t,e,n){this.$o||this.Cp().captureLog(t,{context:e,occurredAtMs:n})}Mp(){var t;return!!(!((t=this._instance)===null||t===void 0||(t=t.persistence)===null||t===void 0||(t=t.props)===null||t===void 0)&&t[Jrt])}Ip(){var t,e,n;return!(!((t=this._instance)===null||t===void 0||(e=t.el)===null||e===void 0)&&e.call(t))||!!(!((n=Ur._POSTHOG_REMOTE_CONFIG)===null||n===void 0||(n=n[this._instance.config.token])===null||n===void 0)&&n.config)}Ch(){var t;this.Pp(),(t=this.yp)===null||t===void 0||t.clearQueue(),this.cp=[]}Ap(){this.ap||this.Pp()}Ep(){var t;if(this.fp||!Ur?.console)return;const e=gAt((t=this._instance)===null||t===void 0||(t=t.config)===null||t===void 0?void 0:t.logs).maxBufferSize;let n=!0;this.vp.push(()=>{n=!1});for(const o of z9n){let i;try{i=J9n(Ur.console[o])}catch{continue}i&&this.vp.push(CV(Ur.console,o,r=>{const s=(...a)=>{try{n&&this.Fp(o,a,e)}catch{}return r.apply(Ur.console,a)};return s.__rrweb_original__=i,s}))}this.fp=!0,this.Op=setTimeout(()=>{this.Pp()},3e4)}Fp(t,e,n){var o;if(this.fp&&!this.pp&&e.length!==0)if(!((o=this._instance)===null||o===void 0)&&o.is_capturing()){if(n>this.dp.length){this.pp=!0;try{this.dp.push({level:t,args:e,occurredAtMs:Date.now(),context:this.wp()})}finally{this.pp=!1}}}else this.Pp()}Pp(){if(this.dp=[],this.fp){this.fp=!1,this.Op&&(clearTimeout(this.Op),this.Op=void 0);for(const t of this.vp)t();this.vp=[]}}Dp(){const t=this.dp;return this.Pp(),t}get logger(){return this.Lp||(this.Lp={trace:(t,e)=>this.captureLog({body:t,level:"trace",attributes:e}),debug:(t,e)=>this.captureLog({body:t,level:"debug",attributes:e}),info:(t,e)=>this.captureLog({body:t,level:"info",attributes:e}),warn:(t,e)=>this.captureLog({body:t,level:"warn",attributes:e}),error:(t,e)=>this.captureLog({body:t,level:"error",attributes:e}),fatal:(t,e)=>this.captureLog({body:t,level:"fatal",attributes:e})}),this.Lp}flushLogs(t){t?this.Np(t):(this.mp&&this.mp.flush().catch(e=>this.qp(e)),this.yp&&this.yp.flush().catch(e=>this.qp(e)))}qp(t){hAt(t)||this.A.error("PostHog logs flush failed:",t)}loadIfEnabled(){if(this.$o||!this.ap||this.lp||this.up)return;const t=Ur?.__PosthogExtensions__;if(!t)return this.A.error("PostHog Extensions not found."),void this.Pp();const e=t.loadExternalDependency;if(!e)return this.A.error(g2e),void this.Pp();this.up=!0;try{e(this._instance,"logs",n=>{if(this.up=!1,this.$o||!this.ap)return;const o=t.logs;if(n||!o?.initializeLogs)this.A.error("Could not load logs script",n),this.Pp();else{var i;const a=this.Dp();var r,s;this.Rp=o.initializeLogs((i=this.yo)!==null&&i!==void 0?i:this._instance),this.lp=!0,a.length>0&&((r=o.replayConsoleBuffer)===null||r===void 0||r.call(o,(s=this.yo)!==null&&s!==void 0?s:this._instance,a))}})}catch(n){throw this.up=!1,n}}_p(t,e){const n=this._instance;return{get isDisabled(){return!1},get optedOut(){return!n.is_capturing()},getPersistedProperty:o=>o===x9.LogsQueue?t():void 0,setPersistedProperty(o,i){var r;o===x9.LogsQueue&&e((r=i)!==null&&r!==void 0?r:[])},js:o=>this.js(o),getLibraryId:()=>Ym.LIB_NAME,getLibraryVersion:()=>Ym.LIB_VERSION}}js(t){return new Promise(e=>{if(Vst(this.bd,3))return void e({kind:"fatal",error:txe(void 0,"logs endpoint is unreachable, dropping batch")});let n=!1;const o=r=>{n||(n=!0,clearTimeout(i),e(r))},i=setTimeout(()=>{this.A.warn("Logs request timed out before receiving a response"),o({kind:"retry-later",error:txe(void 0,"logs request timed out")})},9e4);this._instance._send_request({method:"POST",url:this.jp(),data:t,compression:"best-available",batchKey:"logs",fireCallbackOnDrop:!0,callback:r=>{const s=r.statusCode;if(this.Bp(s),s>=200&&300>s)o({kind:"ok"});else if(s===413)o({kind:"too-large"});else if(s!==0&&s!==408&&s!==429&&500>s)o({kind:"fatal",error:new Error(`logs request failed with status ${s}`)});else{var a;s===0?(r.error||this.A.warn("Logs request failed before receiving an HTTP response"),o({kind:"retry-later",error:txe(r.error,"logs request failed before receiving an HTTP response")})):o({kind:"retry-later",error:(a=r.error)!==null&&a!==void 0?a:new Error(`logs request failed with status ${s}`)})}}})})}Bp(t){(t!==0||this._instance.__loaded)&&(this.bd=zst(t,this.bd,3,()=>this.A.warn("Log requests are failing before receiving an HTTP response; this can happen due to network issues, CORS, browser blocking, or ad blockers. Stopped sending logs; will try again when connectivity changes.")))}Np(t){this.rl.length>0&&this.Hp(t,this.rl,this.xp,Ym.LIB_NAME,e=>{this.rl=e}),this.cp.length>0&&this.Hp(t,this.cp,this.Tp,uAt,e=>{this.cp=e})}Hp(t,e,n,o,i){if(e.length===0)return;const r=e.map(a=>a.record);i([]);const s=Trt(r,Rrt(n,Ym.LIB_NAME,Ym.LIB_VERSION),o,Ym.LIB_VERSION);this._instance._send_request({method:"POST",url:this.jp(),data:s,compression:"best-available",batchKey:"logs",transport:t})}jp(){return this._instance.requestRouter.endpointFor("api","/i/v1/logs")+"?token="+encodeURIComponent(this._instance.config.token)}wp(){var t;const e={};if(e.distinctId=this._instance.get_distinct_id(),this._instance.sessionManager){const{sessionId:n,windowId:o,sessionStartTimestamp:i,lastActivityTimestamp:r}=this._instance.sessionManager.checkAndGetSessionAndWindowId(!0);e.sessionId=n,e.windowId=o,Fs(i)||(e.sessionStartTimestamp=i),Fs(r)||(e.lastActivityTimestamp=r)}if(!(Ur==null||(t=Ur.location)===null||t===void 0)&&t.href&&(e.currentUrl=this._instance.config.disable_capture_url_hashes?iQ(Ur.location.href):Ur.location.href),this._instance.featureFlags){const n=this._instance.featureFlags.getFlags();n&&n.length>0&&(e.activeFeatureFlags=n)}return e}}},c7n={metrics:class{constructor(t){this._instance=t,this.A=Ad("[metrics]"),this.$o=!1}initialize(){this.onConfigChange()}onConfigChange(){var t;if(this.$o)return;const e=!!(!((t=this._instance.config.metrics)===null||t===void 0)&&t.network);e&&!this.zp?this.zp=(n=>{let o=!0;const i=()=>o?(a=>{var A;const c=(A=a.config.metrics)===null||A===void 0?void 0:A.network;return c===!0?{}:c||void 0})(n):void 0,r=q9n(n,i),s=X9n(n,i);return()=>{o=!1,r(),s()}})(this._instance):!e&&this.zp&&(this.zp(),this.zp=void 0)}kp(){var t;const e=(t=this._instance)===null||t===void 0||(t=t.config)===null||t===void 0?void 0:t.metrics;var n;return this.mp&&this.Sp===e||((n=this.mp)===null||n===void 0||n.reset(),this.Sp=e,this.mp=new z4n(this._p(),(function(o){var i,r,s,a,A;const c=o?.resourceAttributes;return{serviceName:(i=c?.["service.name"])!==null&&i!==void 0?i:o?.serviceName,serviceVersion:(r=c?.["service.version"])!==null&&r!==void 0?r:o?.serviceVersion,environment:(s=c?.["deployment.environment"])!==null&&s!==void 0?s:o?.environment,resourceAttributes:c,beforeSend:o?.beforeSend,flushIntervalMs:(a=o?.flushIntervalMs)!==null&&a!==void 0?a:1e4,maxSeriesPerFlush:(A=o?.maxSeriesPerFlush)!==null&&A!==void 0?A:1e3}})(e),this.A)),this.mp}count(t,e=1,n){this.kp().count(t,e,n)}gauge(t,e,n){this.kp().gauge(t,e,n)}histogram(t,e,n){this.kp().histogram(t,e,n)}flush(t){if(!this.mp)return Promise.resolve();if(t){const e=this.mp.drainWindow();return e&&this.Ys(e,t),Promise.resolve()}return this.mp.flush().catch(e=>this.A.error("PostHog metrics flush failed:",e))}reset(){var t;(t=this.mp)===null||t===void 0||t.reset()}dispose(){var t,e;this.$o=!0,(t=this.zp)===null||t===void 0||t.call(this),this.zp=void 0,(e=this.mp)===null||e===void 0||e.reset()}_p(){const t=this._instance,e=this;return{get isDisabled(){return!1},get optedOut(){return!t.is_capturing()},Ys:n=>e.Ys(n),getLibraryId:()=>Ym.LIB_NAME,getLibraryVersion:()=>Ym.LIB_VERSION}}Ys(t,e){return new Promise(n=>{let o=!1;const i=s=>{o||(o=!0,clearTimeout(r),n(s))},r=setTimeout(()=>i({kind:"retry-later",error:new Error("metrics request timed out")}),9e4);this._instance._send_request(sn(sn({method:"POST",url:this.Up(),data:t,compression:"best-available",batchKey:"metrics"},e&&{transport:e}),{},{fireCallbackOnDrop:!0,callback(s){const a=s.statusCode;if(a>=200&&300>a)i({kind:"ok"});else if(a===413)i({kind:"too-large"});else if(a!==0&&a!==408&&a!==429&&500>a)i({kind:"fatal",error:new Error(`metrics request failed with status ${a}`)});else{var A;i({kind:"retry-later",error:(A=s.error)!==null&&A!==void 0?A:new Error(`metrics request failed with status ${a}`)})}}}))})}Up(){return this._instance.requestRouter.endpointFor("api","/i/v1/metrics")+"?token="+encodeURIComponent(this._instance.config.token)}}};fV.__defaultExtensionClasses=sn({},sn(sn(sn(sn(sn(sn(sn(sn(sn(sn(sn(sn(sn({},mne),$9n),Z9n),e7n),t7n),n7n),i7n),o7n),r7n),s7n),a7n),A7n),c7n));var Uk=(function(){Ym.SDK_DIST_CHANNEL="npm";const t=pV[_V]=new fV;return(function(){function e(){e.done||(e.done=!0,Sat=!1,vl(pV,function(n){n._dom_loaded()}))}No?.addEventListener?No.readyState==="complete"?e():jc(No,"DOMContentLoaded",e,{capture:!1}):Fn&&gi.error("Browser doesn't support `document.addEventListener` so PostHog couldn't be initialized")})(),t})();class HM extends Error{response;request;options;constructor(e,n,o){const i=e.status||e.status===0?e.status:"",r=e.statusText??"",s=`${i} ${r}`.trim(),a=s?`status code ${s}`:"an unknown error";super(`Request failed with ${a}: ${n.method} ${n.url}`),this.name="HTTPError",this.response=e,this.request=n,this.options=o}}class _At extends Error{name="NonError";value;constructor(e){let n="Non-error value was thrown";try{typeof e=="string"?n=e:e&&typeof e=="object"&&"message"in e&&typeof e.message=="string"&&(n=e.message)}catch{}super(n),this.value=e}}class ixe extends Error{name="ForceRetryError";customDelay;code;customRequest;constructor(e){const n=e?.cause?e.cause instanceof Error?e.cause:new _At(e.cause):void 0;super(e?.code?`Forced retry: ${e.code}`:"Forced retry",n?{cause:n}:void 0),this.customDelay=e?.delay,this.code=e?.code,this.customRequest=e?.request}}const fAt=(()=>{let t=!1,e=!1;const n=typeof globalThis.ReadableStream=="function",o=typeof globalThis.Request=="function";if(n&&o)try{e=new globalThis.Request("https://empty.invalid",{body:new globalThis.ReadableStream,method:"POST",get duplex(){return t=!0,"half"}}).headers.has("Content-Type")}catch(i){if(i instanceof Error&&i.message==="unsupported BodyInit type")return!1;throw i}return t&&!e})(),l7n=typeof globalThis.AbortController=="function",IAt=typeof globalThis.AbortSignal=="function"&&typeof globalThis.AbortSignal.any=="function",g7n=typeof globalThis.ReadableStream=="function",u7n=typeof globalThis.FormData=="function",CAt=["get","post","put","patch","head","delete"],d7n={json:"application/json",text:"text/*",formData:"multipart/form-data",arrayBuffer:"*/*",blob:"*/*",bytes:"*/*"},rxe=2147483647,h7n=new TextEncoder().encode("------WebKitFormBoundaryaxpyiPgbbPti10Rw").length,yAt=Symbol("stop");class xAt{options;constructor(e){this.options=e}}const p7n=t=>new xAt(t),m7n={json:!0,parseJson:!0,stringifyJson:!0,searchParams:!0,prefixUrl:!0,retry:!0,timeout:!0,hooks:!0,throwHttpErrors:!0,onDownloadProgress:!0,onUploadProgress:!0,fetch:!0,context:!0},_7n={next:!0},f7n={method:!0,headers:!0,body:!0,mode:!0,credentials:!0,cache:!0,redirect:!0,referrer:!0,referrerPolicy:!0,integrity:!0,keepalive:!0,signal:!0,window:!0,duplex:!0},I7n=t=>{if(!t)return 0;if(t instanceof FormData){let e=0;for(const[n,o]of t)e+=h7n,e+=new TextEncoder().encode(`Content-Disposition: form-data; name="${n}"`).length,e+=typeof o=="string"?new TextEncoder().encode(o).length:o.size;return e}if(t instanceof Blob)return t.size;if(t instanceof ArrayBuffer)return t.byteLength;if(typeof t=="string")return new TextEncoder().encode(t).length;if(t instanceof URLSearchParams)return new TextEncoder().encode(t.toString()).length;if("byteLength"in t)return t.byteLength;if(typeof t=="object"&&t!==null)try{const e=JSON.stringify(t);return new TextEncoder().encode(e).length}catch{return 0}return 0},EAt=(t,e,n)=>{let o,i=0;return t.pipeThrough(new TransformStream({transform(r,s){if(s.enqueue(r),o){i+=o.byteLength;let a=e===0?0:i/e;a>=1&&(a=1-Number.EPSILON),n?.({percent:a,totalBytes:Math.max(e,i),transferredBytes:i},o)}o=r},flush(){o&&(i+=o.byteLength,n?.({percent:1,totalBytes:Math.max(e,i),transferredBytes:i},o))}}))},C7n=(t,e)=>{if(!t.body)return t;if(t.status===204)return new Response(null,{status:t.status,statusText:t.statusText,headers:t.headers});const n=Math.max(0,Number(t.headers.get("content-length"))||0);return new Response(EAt(t.body,n,e),{status:t.status,statusText:t.statusText,headers:t.headers})},y7n=(t,e,n)=>{if(!t.body)return t;const o=I7n(n??t.body);return new Request(t,{duplex:"half",body:EAt(t.body,o,e)})},OM=t=>t!==null&&typeof t=="object",_ne=(...t)=>{for(const e of t)if((!OM(e)||Array.isArray(e))&&e!==void 0)throw new TypeError("The `options` argument must be an object");return sxe({},...t)},BAt=(t={},e={})=>{const n=new globalThis.Headers(t),o=e instanceof globalThis.Headers,i=new globalThis.Headers(e);for(const[r,s]of i.entries())o&&s==="undefined"||s===void 0?n.delete(r):n.set(r,s);return n};function fne(t,e,n){return Object.hasOwn(e,n)&&e[n]===void 0?[]:sxe(t[n]??[],e[n]??[])}const bAt=(t={},e={})=>({beforeRequest:fne(t,e,"beforeRequest"),beforeRetry:fne(t,e,"beforeRetry"),afterResponse:fne(t,e,"afterResponse"),beforeError:fne(t,e,"beforeError")}),x7n=(t,e)=>{const n=new URLSearchParams;for(const o of[t,e])if(o!==void 0)if(o instanceof URLSearchParams)for(const[i,r]of o.entries())n.append(i,r);else if(Array.isArray(o))for(const i of o){if(!Array.isArray(i)||i.length!==2)throw new TypeError("Array search parameters must be provided in [[key, value], ...] format");n.append(String(i[0]),String(i[1]))}else if(OM(o))for(const[i,r]of Object.entries(o))r!==void 0&&n.append(i,String(r));else{const i=new URLSearchParams(o);for(const[r,s]of i.entries())n.append(r,s)}return n},sxe=(...t)=>{let e={},n={},o={},i;const r=[];for(const s of t)if(Array.isArray(s))Array.isArray(e)||(e=[]),e=[...e,...s];else if(OM(s)){for(let[a,A]of Object.entries(s)){if(a==="signal"&&A instanceof globalThis.AbortSignal){r.push(A);continue}if(a==="context"){if(A!=null&&(!OM(A)||Array.isArray(A)))throw new TypeError("The `context` option must be an object");e={...e,context:A==null?{}:{...e.context,...A}};continue}if(a==="searchParams"){A==null?i=void 0:i=i===void 0?A:x7n(i,A);continue}OM(A)&&a in e&&(A=sxe(e[a],A)),e={...e,[a]:A}}OM(s.hooks)&&(o=bAt(o,s.hooks),e.hooks=o),OM(s.headers)&&(n=BAt(n,s.headers),e.headers=n)}return i!==void 0&&(e.searchParams=i),r.length>0&&(r.length===1?e.signal=r[0]:IAt?e.signal=AbortSignal.any(r):e.signal=r.at(-1)),e},E7n=t=>CAt.includes(t)?t.toUpperCase():t,SAt={limit:2,methods:["get","put","head","delete","options","trace"],statusCodes:[408,413,429,500,502,503,504],afterStatusCodes:[413,429,503],maxRetryAfter:Number.POSITIVE_INFINITY,backoffLimit:Number.POSITIVE_INFINITY,delay:t=>.3*2**(t-1)*1e3,jitter:void 0,retryOnTimeout:!1},B7n=(t={})=>{if(typeof t=="number")return{...SAt,limit:t};if(t.methods&&!Array.isArray(t.methods))throw new Error("retry.methods must be an array");if(t.methods&&=t.methods.map(n=>n.toLowerCase()),t.statusCodes&&!Array.isArray(t.statusCodes))throw new Error("retry.statusCodes must be an array");const e=Object.fromEntries(Object.entries(t).filter(([,n])=>n!==void 0));return{...SAt,...e}};class axe extends Error{request;constructor(e){super(`Request timed out: ${e.method} ${e.url}`),this.name="TimeoutError",this.request=e}}async function b7n(t,e,n,o){return new Promise((i,r)=>{const s=setTimeout(()=>{n&&n.abort(),r(new axe(t))},o.timeout);o.fetch(t,e).then(i).catch(r).then(()=>{clearTimeout(s)})})}async function S7n(t,{signal:e}){return new Promise((n,o)=>{e&&(e.throwIfAborted(),e.addEventListener("abort",i,{once:!0}));function i(){clearTimeout(r),o(e.reason)}const r=setTimeout(()=>{e?.removeEventListener("abort",i),n()},t)})}const Q7n=(t,e)=>{const n={};for(const o in e)Object.hasOwn(e,o)&&!(o in f7n)&&!(o in m7n)&&(!(o in t)||o in _7n)&&(n[o]=e[o]);return n},v7n=t=>t===void 0?!1:Array.isArray(t)?t.length>0:t instanceof URLSearchParams?t.size>0:typeof t=="object"?Object.keys(t).length>0:typeof t=="string"?t.trim().length>0:!!t;function w7n(t){return t instanceof HM||t?.name===HM.name}function P7n(t){return t instanceof axe||t?.name===axe.name}let QAt=class Jnt{static create(e,n){const o=new Jnt(e,n),i=async()=>{if(typeof o.#e.timeout=="number"&&o.#e.timeout>rxe)throw new RangeError(`The \`timeout\` option cannot be greater than ${rxe}`);await Promise.resolve();let s=await o.#_();for(const a of o.#e.hooks.afterResponse){const A=o.#d(s.clone());let c;try{c=await a(o.request,o.#c(),A,{retryCount:o.#n})}catch(g){throw o.#r(A),o.#r(s),g}if(c instanceof xAt)throw o.#r(A),o.#r(s),new ixe(c.options);const l=c instanceof globalThis.Response?c:s;A!==l&&o.#r(A),s!==l&&o.#r(s),s=l}if(o.#d(s),!s.ok&&(typeof o.#e.throwHttpErrors=="function"?o.#e.throwHttpErrors(s.status):o.#e.throwHttpErrors)){let a=new HM(s,o.request,o.#c());for(const A of o.#e.hooks.beforeError)a=await A(a,{retryCount:o.#n});throw a}if(o.#e.onDownloadProgress){if(typeof o.#e.onDownloadProgress!="function")throw new TypeError("The `onDownloadProgress` option must be a function");if(!g7n)throw new Error("Streams are not supported in your environment. `ReadableStream` is missing.");const a=s.clone();return o.#r(s),C7n(a,o.#e.onDownloadProgress)}return s},r=o.#h(i).finally(()=>{const s=o.#s;o.#g(s?.body??void 0),o.#g(o.request.body??void 0)});for(const[s,a]of Object.entries(d7n))s==="bytes"&&typeof globalThis.Response?.prototype?.bytes!="function"||(r[s]=async()=>{o.request.headers.set("accept",o.request.headers.get("accept")||a);const A=await r;if(s==="json"){if(A.status===204)return"";const c=await A.text();return c===""?"":n.parseJson?n.parseJson(c):JSON.parse(c)}return A[s]()});return r}static#a(e){return e&&typeof e=="object"&&!Array.isArray(e)&&!(e instanceof URLSearchParams)?Object.fromEntries(Object.entries(e).filter(([,n])=>n!==void 0)):e}request;#o;#n=0;#t;#e;#s;#i;#A;constructor(e,n={}){if(this.#t=e,this.#e={...n,headers:BAt(this.#t.headers,n.headers),hooks:bAt({beforeRequest:[],beforeRetry:[],beforeError:[],afterResponse:[]},n.hooks),method:E7n(n.method??this.#t.method??"GET"),prefixUrl:String(n.prefixUrl||""),retry:B7n(n.retry),throwHttpErrors:n.throwHttpErrors??!0,timeout:n.timeout??1e4,fetch:n.fetch??globalThis.fetch.bind(globalThis),context:n.context??{}},typeof this.#t!="string"&&!(this.#t instanceof URL||this.#t instanceof globalThis.Request))throw new TypeError("`input` must be a string, URL, or Request");if(this.#e.prefixUrl&&typeof this.#t=="string"){if(this.#t.startsWith("/"))throw new Error("`input` must not begin with a slash when using `prefixUrl`");this.#e.prefixUrl.endsWith("/")||(this.#e.prefixUrl+="/"),this.#t=this.#e.prefixUrl+this.#t}l7n&&IAt&&(this.#i=this.#e.signal??this.#t.signal,this.#o=new globalThis.AbortController,this.#e.signal=this.#i?AbortSignal.any([this.#i,this.#o.signal]):this.#o.signal),fAt&&(this.#e.duplex="half"),this.#e.json!==void 0&&(this.#e.body=this.#e.stringifyJson?.(this.#e.json)??JSON.stringify(this.#e.json),this.#e.headers.set("content-type",this.#e.headers.get("content-type")??"application/json"));const o=n.headers&&new globalThis.Headers(n.headers).has("content-type");if(this.#t instanceof globalThis.Request&&(u7n&&this.#e.body instanceof globalThis.FormData||this.#e.body instanceof URLSearchParams)&&!o&&this.#e.headers.delete("content-type"),this.request=new globalThis.Request(this.#t,this.#e),v7n(this.#e.searchParams)){const r="?"+(typeof this.#e.searchParams=="string"?this.#e.searchParams.replace(/^\?/,""):new URLSearchParams(Jnt.#a(this.#e.searchParams)).toString()),s=this.request.url.replace(/(?:\?.*?)?(?=#|$)/,r);this.request=new globalThis.Request(s,this.#e)}if(this.#e.onUploadProgress){if(typeof this.#e.onUploadProgress!="function")throw new TypeError("The `onUploadProgress` option must be a function");if(!fAt)throw new Error("Request streams are not supported in your environment. The `duplex` option for `Request` is not available.");this.request=this.#p(this.request,this.#e.body??void 0)}}#l(){const e=this.#e.retry.delay(this.#n);let n=e;this.#e.retry.jitter===!0?n=Math.random()*e:typeof this.#e.retry.jitter=="function"&&(n=this.#e.retry.jitter(e),(!Number.isFinite(n)||n<0)&&(n=e));const o=this.#e.retry.backoffLimit??Number.POSITIVE_INFINITY;return Math.min(o,n)}async#m(e){if(this.#n++,this.#n>this.#e.retry.limit)throw e;const n=e instanceof Error?e:new _At(e);if(n instanceof ixe)return n.customDelay??this.#l();if(!this.#e.retry.methods.includes(this.request.method.toLowerCase()))throw e;if(this.#e.retry.shouldRetry!==void 0){const o=await this.#e.retry.shouldRetry({error:n,retryCount:this.#n});if(o===!1)throw e;if(o===!0)return this.#l()}if(P7n(e)&&!this.#e.retry.retryOnTimeout)throw e;if(w7n(e)){if(!this.#e.retry.statusCodes.includes(e.response.status))throw e;const o=e.response.headers.get("Retry-After")??e.response.headers.get("RateLimit-Reset")??e.response.headers.get("X-RateLimit-Retry-After")??e.response.headers.get("X-RateLimit-Reset")??e.response.headers.get("X-Rate-Limit-Reset");if(o&&this.#e.retry.afterStatusCodes.includes(e.response.status)){let i=Number(o)*1e3;Number.isNaN(i)?i=Date.parse(o)-Date.now():i>=Date.parse("2024-01-01")&&(i-=Date.now());const r=this.#e.retry.maxRetryAfter??i;return i<r?i:r}if(e.response.status===413)throw e}return this.#l()}#d(e){return this.#e.parseJson&&(e.json=async()=>this.#e.parseJson(await e.text())),e}#g(e){e&&e.cancel().catch(()=>{})}#r(e){this.#g(e.body??void 0)}async#h(e){try{return await e()}catch(n){const o=Math.min(await this.#m(n),rxe);if(this.#n<1)throw n;if(await S7n(o,this.#i?{signal:this.#i}:{}),n instanceof ixe&&n.customRequest){const i=this.#e.signal?new globalThis.Request(n.customRequest,{signal:this.#e.signal}):new globalThis.Request(n.customRequest);this.#u(i)}for(const i of this.#e.hooks.beforeRetry){const r=await i({request:this.request,options:this.#c(),error:n,retryCount:this.#n});if(r instanceof globalThis.Request){this.#u(r);break}if(r instanceof globalThis.Response)return r;if(r===yAt)return}return this.#h(e)}}async#_(){this.#o?.signal.aborted&&(this.#o=new globalThis.AbortController,this.#e.signal=this.#i?AbortSignal.any([this.#i,this.#o.signal]):this.#o.signal,this.request=new globalThis.Request(this.request,{signal:this.#e.signal}));for(const n of this.#e.hooks.beforeRequest){const o=await n(this.request,this.#c(),{retryCount:this.#n});if(o instanceof Response)return o;if(o instanceof globalThis.Request){this.#u(o);break}}const e=Q7n(this.request,this.#e);return this.#s=this.request,this.request=this.#s.clone(),this.#e.timeout===!1?this.#e.fetch(this.#s,e):b7n(this.#s,e,this.#o,this.#e)}#c(){if(!this.#A){const{hooks:e,...n}=this.#e;this.#A=Object.freeze(n)}return this.#A}#u(e){this.#A=void 0,this.request=this.#p(e)}#p(e,n){return!this.#e.onUploadProgress||!e.body?e:y7n(e,this.#e.onUploadProgress,n??this.#e.body??void 0)}};const Axe=t=>{const e=(n,o)=>QAt.create(n,_ne(t,o));for(const n of CAt)e[n]=(o,i)=>QAt.create(o,_ne(t,i,{method:n}));return e.create=n=>Axe(_ne(n)),e.extend=n=>(typeof n=="function"&&(n=n(t??{})),Axe(_ne(t,n))),e.stop=yAt,e.retry=p7n,e},M7n=Axe();class D7n extends HM{constructor(e,n,o,i){super(e,n,o),this.name="RegistryHTTPError",this.message=i}}function yV(t){return typeof window<"u"?window[t]:null}function GM(){const t=yV("TSCIRCUIT_REGISTRY_API_BASE_URL")||void 0||"https://registry-api.tscircuit.com",e=yV("TSCIRCUIT_REGISTRY_TOKEN");return M7n.create({prefixUrl:t,headers:{Authorization:`Bearer ${e}`},timeout:3e4,hooks:{afterResponse:[async(n,o,i)=>{if(i.ok)return i;let r=null;try{r=await i.clone().json()}catch(g){console.error("Failed to parse registry error response",g)}const s=r?.error?.message??r?.error?.error_message??r?.message,a=r?.error?.error_code??r?.error_code,A=new URL(i.url),l=[`Registry request failed for ${`${A.pathname}${A.search}`} (${i.status})`];throw s&&l.push(`Server message: ${s}`),a&&l.push(`Error code: ${a}`),new D7n(i,n,o,l.join(" | "))}]}})}function Ine(){return!!yV("TSCIRCUIT_REGISTRY_TOKEN")}const Cne={get:(t,e)=>GM().get(t,e),post:(t,e)=>GM().post(t,e),put:(t,e)=>GM().put(t,e),delete:(t,e)=>GM().delete(t,e),patch:(t,e)=>GM().patch(t,e)},N7n="phc_htd8AQjSfVEsFCLQMAiUooG4Q0DKBCjqYuQglc9V3Wo",R7n="https://postpig.tscircuit.com",vAt="runframe:anonymous-id",cxe=()=>typeof window<"u",wAt=t=>t.includes("localhost")||t.includes("127.0.0.1"),T7n=t=>{try{return new URL(t).hostname}catch{return null}},k7n=()=>{if(!cxe())return null;let t=null;return document.referrer&&(t=T7n(document.referrer)),t??window.location.hostname},F7n=()=>typeof crypto<"u"&&"randomUUID"in crypto?crypto.randomUUID():`${Date.now().toString(36)}-${Math.random().toString(36).slice(2)}`,L7n=()=>{if(!cxe())return null;try{const t=window.localStorage.getItem(vAt);if(t)return t;const e=F7n();return window.localStorage.setItem(vAt,e),e}catch{return null}},H7n=()=>yV("TSCIRCUIT_USE_RUNFRAME_FOR_CLI")===!0,PAt=()=>!cxe()||wAt(window.location.hostname)&&!H7n()?!1:(Uk.__loaded||Uk.init(N7n,{api_host:R7n,person_profiles:"always"}),!0),O7n=()=>{if(!PAt())return null;const t=k7n(),e=t!=null&&!wAt(t);let n=null;e||(n=L7n());let o,i;return e?(o=`domain:${t}`,i="domain"):(o=void 0,n&&(o=`anonymous:${n}`),i="anonymous_id"),{embedDomain:t,anonymousId:n,distinctId:o,identityType:i}},G7n=(t,{source:e,...n})=>{const o=O7n();if(!o)return;const{embedDomain:i,anonymousId:r,distinctId:s,identityType:a}=o;if(s){const A={};a==="domain"&&i&&(A.embed_domain=i),a==="anonymous_id"&&r&&(A.runframe_anonymous_id=r),Uk.identify(s,A)}Uk.capture(t,{...n,source:e,embed_domain:i,runframe_anonymous_id:r,identity_type:a})},Y7n=t=>{G7n("runframe_activity",t)};PAt();function U7n(t){const e=String.fromCodePoint(...t);return btoa(e)}var tm=Uint8Array,N3=Uint16Array,lxe=Int32Array,yne=new tm([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]),xne=new tm([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]),gxe=new tm([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),MAt=function(t,e){for(var n=new N3(31),o=0;o<31;++o)n[o]=e+=1<<t[o-1];for(var i=new lxe(n[30]),o=1;o<30;++o)for(var r=n[o];r<n[o+1];++r)i[r]=r-n[o]<<5|o;return{b:n,r:i}},DAt=MAt(yne,2),NAt=DAt.b,uxe=DAt.r;NAt[28]=258,uxe[258]=28;for(var RAt=MAt(xne,0),K7n=RAt.b,TAt=RAt.r,dxe=new N3(32768),gd=0;gd<32768;++gd){var uQ=(gd&43690)>>1|(gd&21845)<<1;uQ=(uQ&52428)>>2|(uQ&13107)<<2,uQ=(uQ&61680)>>4|(uQ&3855)<<4,dxe[gd]=((uQ&65280)>>8|(uQ&255)<<8)>>1}for(var Q9=(function(t,e,n){for(var o=t.length,i=0,r=new N3(e);i<o;++i)t[i]&&++r[t[i]-1];var s=new N3(e);for(i=1;i<e;++i)s[i]=s[i-1]+r[i-1]<<1;var a;if(n){a=new N3(1<<e);var A=15-e;for(i=0;i<o;++i)if(t[i])for(var c=i<<4|t[i],l=e-t[i],g=s[t[i]-1]++<<l,u=g|(1<<l)-1;g<=u;++g)a[dxe[g]>>A]=c}else for(a=new N3(o),i=0;i<o;++i)t[i]&&(a[i]=dxe[s[t[i]-1]++]>>15-t[i]);return a}),dQ=new tm(288),gd=0;gd<144;++gd)dQ[gd]=8;for(var gd=144;gd<256;++gd)dQ[gd]=9;for(var gd=256;gd<280;++gd)dQ[gd]=7;for(var gd=280;gd<288;++gd)dQ[gd]=8;for(var xV=new tm(32),gd=0;gd<32;++gd)xV[gd]=5;var V7n=Q9(dQ,9,0),z7n=Q9(dQ,9,1),J7n=Q9(xV,5,0),W7n=Q9(xV,5,1),hxe=function(t){for(var e=t[0],n=1;n<t.length;++n)t[n]>e&&(e=t[n]);return e},H4=function(t,e,n){var o=e/8|0;return(t[o]|t[o+1]<<8)>>(e&7)&n},pxe=function(t,e){var n=e/8|0;return(t[n]|t[n+1]<<8|t[n+2]<<16)>>(e&7)},mxe=function(t){return(t+7)/8|0},Kk=function(t,e,n){return(e==null||e<0)&&(e=0),(n==null||n>t.length)&&(n=t.length),new tm(t.subarray(e,n))},j7n=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],ix=function(t,e,n){var o=new Error(e||j7n[t]);if(o.code=t,Error.captureStackTrace&&Error.captureStackTrace(o,ix),!n)throw o;return o},kAt=function(t,e,n,o){var i=t.length,r=0;if(!i||e.f&&!e.l)return n||new tm(0);var s=!n,a=s||e.i!=2,A=e.i;s&&(n=new tm(i*3));var c=function(me){var ye=n.length;if(me>ye){var ve=new tm(Math.max(ye*2,me));ve.set(n),n=ve}},l=e.f||0,g=e.p||0,u=e.b||0,h=e.l,d=e.d,p=e.m,m=e.n,_=i*8;do{if(!h){l=H4(t,g,1);var f=H4(t,g+1,3);if(g+=3,f)if(f==1)h=z7n,d=W7n,p=9,m=5;else if(f==2){var x=H4(t,g,31)+257,E=H4(t,g+10,15)+4,B=x+H4(t,g+5,31)+1;g+=14;for(var S=new tm(B),Q=new tm(19),w=0;w<E;++w)Q[gxe[w]]=H4(t,g+w*3,7);g+=E*3;for(var M=hxe(Q),k=(1<<M)-1,R=Q9(Q,M,1),w=0;w<B;){var F=R[H4(t,g,k)];g+=F&15;var I=F>>4;if(I<16)S[w++]=I;else{var O=0,U=0;for(I==16?(U=3+H4(t,g,3),g+=2,O=S[w-1]):I==17?(U=3+H4(t,g,7),g+=3):I==18&&(U=11+H4(t,g,127),g+=7);U--;)S[w++]=O}}var Y=S.subarray(0,x),J=S.subarray(x);p=hxe(Y),m=hxe(J),h=Q9(Y,p,1),d=Q9(J,m,1)}else ix(1);else{var I=mxe(g)+4,C=t[I-4]|t[I-3]<<8,y=I+C;if(y>i){A&&ix(0);break}a&&c(u+C),n.set(t.subarray(I,y),u),e.b=u+=C,e.p=g=y*8,e.f=l;continue}if(g>_){A&&ix(0);break}}a&&c(u+131072);for(var ee=(1<<p)-1,W=(1<<m)-1,q=g;;q=g){var O=h[pxe(t,g)&ee],ie=O>>4;if(g+=O&15,g>_){A&&ix(0);break}if(O||ix(2),ie<256)n[u++]=ie;else if(ie==256){q=g,h=null;break}else{var se=ie-254;if(ie>264){var w=ie-257,oe=yne[w];se=H4(t,g,(1<<oe)-1)+NAt[w],g+=oe}var ge=d[pxe(t,g)&W],ue=ge>>4;ge||ix(3),g+=ge&15;var J=K7n[ue];if(ue>3){var oe=xne[ue];J+=pxe(t,g)&(1<<oe)-1,g+=oe}if(g>_){A&&ix(0);break}a&&c(u+131072);var Ie=u+se;if(u<J){var le=r-J,_e=Math.min(J,Ie);for(le+u<0&&ix(3);u<_e;++u)n[u]=o[le+u]}for(;u<Ie;++u)n[u]=n[u-J]}}e.l=h,e.p=q,e.b=u,e.f=l,h&&(l=1,e.m=p,e.d=d,e.n=m)}while(!l);return u!=n.length&&s?Kk(n,0,u):n.subarray(0,u)},S8=function(t,e,n){n<<=e&7;var o=e/8|0;t[o]|=n,t[o+1]|=n>>8},EV=function(t,e,n){n<<=e&7;var o=e/8|0;t[o]|=n,t[o+1]|=n>>8,t[o+2]|=n>>16},_xe=function(t,e){for(var n=[],o=0;o<t.length;++o)t[o]&&n.push({s:o,f:t[o]});var i=n.length,r=n.slice();if(!i)return{t:OAt,l:0};if(i==1){var s=new tm(n[0].s+1);return s[n[0].s]=1,{t:s,l:1}}n.sort(function(y,x){return y.f-x.f}),n.push({s:-1,f:25001});var a=n[0],A=n[1],c=0,l=1,g=2;for(n[0]={s:-1,f:a.f+A.f,l:a,r:A};l!=i-1;)a=n[n[c].f<n[g].f?c++:g++],A=n[c!=l&&n[c].f<n[g].f?c++:g++],n[l++]={s:-1,f:a.f+A.f,l:a,r:A};for(var u=r[0].s,o=1;o<i;++o)r[o].s>u&&(u=r[o].s);var h=new N3(u+1),d=fxe(n[l-1],h,0);if(d>e){var o=0,p=0,m=d-e,_=1<<m;for(r.sort(function(x,E){return h[E.s]-h[x.s]||x.f-E.f});o<i;++o){var f=r[o].s;if(h[f]>e)p+=_-(1<<d-h[f]),h[f]=e;else break}for(p>>=m;p>0;){var I=r[o].s;h[I]<e?p-=1<<e-h[I]++-1:++o}for(;o>=0&&p;--o){var C=r[o].s;h[C]==e&&(--h[C],++p)}d=e}return{t:new tm(h),l:d}},fxe=function(t,e,n){return t.s==-1?Math.max(fxe(t.l,e,n+1),fxe(t.r,e,n+1)):e[t.s]=n},FAt=function(t){for(var e=t.length;e&&!t[--e];);for(var n=new N3(++e),o=0,i=t[0],r=1,s=function(A){n[o++]=A},a=1;a<=e;++a)if(t[a]==i&&a!=e)++r;else{if(!i&&r>2){for(;r>138;r-=138)s(32754);r>2&&(s(r>10?r-11<<5|28690:r-3<<5|12305),r=0)}else if(r>3){for(s(i),--r;r>6;r-=6)s(8304);r>2&&(s(r-3<<5|8208),r=0)}for(;r--;)s(i);r=1,i=t[a]}return{c:n.subarray(0,o),n:e}},BV=function(t,e){for(var n=0,o=0;o<e.length;++o)n+=t[o]*e[o];return n},LAt=function(t,e,n){var o=n.length,i=mxe(e+2);t[i]=o&255,t[i+1]=o>>8,t[i+2]=t[i]^255,t[i+3]=t[i+1]^255;for(var r=0;r<o;++r)t[i+r+4]=n[r];return(i+4+o)*8},HAt=function(t,e,n,o,i,r,s,a,A,c,l){S8(e,l++,n),++i[256];for(var g=_xe(i,15),u=g.t,h=g.l,d=_xe(r,15),p=d.t,m=d.l,_=FAt(u),f=_.c,I=_.n,C=FAt(p),y=C.c,x=C.n,E=new N3(19),B=0;B<f.length;++B)++E[f[B]&31];for(var B=0;B<y.length;++B)++E[y[B]&31];for(var S=_xe(E,7),Q=S.t,w=S.l,M=19;M>4&&!Q[gxe[M-1]];--M);var k=c+5<<3,R=BV(i,dQ)+BV(r,xV)+s,F=BV(i,u)+BV(r,p)+s+14+3*M+BV(E,Q)+2*E[16]+3*E[17]+7*E[18];if(A>=0&&k<=R&&k<=F)return LAt(e,l,t.subarray(A,A+c));var O,U,Y,J;if(S8(e,l,1+(F<R)),l+=2,F<R){O=Q9(u,h,0),U=u,Y=Q9(p,m,0),J=p;var ee=Q9(Q,w,0);S8(e,l,I-257),S8(e,l+5,x-1),S8(e,l+10,M-4),l+=14;for(var B=0;B<M;++B)S8(e,l+3*B,Q[gxe[B]]);l+=3*M;for(var W=[f,y],q=0;q<2;++q)for(var ie=W[q],B=0;B<ie.length;++B){var se=ie[B]&31;S8(e,l,ee[se]),l+=Q[se],se>15&&(S8(e,l,ie[B]>>5&127),l+=ie[B]>>12)}}else O=V7n,U=dQ,Y=J7n,J=xV;for(var B=0;B<a;++B){var oe=o[B];if(oe>255){var se=oe>>18&31;EV(e,l,O[se+257]),l+=U[se+257],se>7&&(S8(e,l,oe>>23&31),l+=yne[se]);var ge=oe&31;EV(e,l,Y[ge]),l+=J[ge],ge>3&&(EV(e,l,oe>>5&8191),l+=xne[ge])}else EV(e,l,O[oe]),l+=U[oe]}return EV(e,l,O[256]),l+U[256]},q7n=new lxe([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),OAt=new tm(0),X7n=function(t,e,n,o,i,r){var s=r.z||t.length,a=new tm(o+s+5*(1+Math.ceil(s/7e3))+i),A=a.subarray(o,a.length-i),c=r.l,l=(r.r||0)&7;if(e){l&&(A[0]=r.r>>3);for(var g=q7n[e-1],u=g>>13,h=g&8191,d=(1<<n)-1,p=r.p||new N3(32768),m=r.h||new N3(d+1),_=Math.ceil(n/3),f=2*_,I=function(Pe){return(t[Pe]^t[Pe+1]<<_^t[Pe+2]<<f)&d},C=new lxe(25e3),y=new N3(288),x=new N3(32),E=0,B=0,S=r.i||0,Q=0,w=r.w||0,M=0;S+2<s;++S){var k=I(S),R=S&32767,F=m[k];if(p[R]=F,m[k]=R,w<=S){var O=s-S;if((E>7e3||Q>24576)&&(O>423||!c)){l=HAt(t,A,0,C,y,x,B,Q,M,S-M,l),Q=E=B=0,M=S;for(var U=0;U<286;++U)y[U]=0;for(var U=0;U<30;++U)x[U]=0}var Y=2,J=0,ee=h,W=R-F&32767;if(O>2&&k==I(S-W))for(var q=Math.min(u,O)-1,ie=Math.min(32767,S),se=Math.min(258,O);W<=ie&&--ee&&R!=F;){if(t[S+Y]==t[S+Y-W]){for(var oe=0;oe<se&&t[S+oe]==t[S+oe-W];++oe);if(oe>Y){if(Y=oe,J=W,oe>q)break;for(var ge=Math.min(W,oe-2),ue=0,U=0;U<ge;++U){var Ie=S-W+U&32767,le=p[Ie],_e=Ie-le&32767;_e>ue&&(ue=_e,F=Ie)}}}R=F,F=p[R],W+=R-F&32767}if(J){C[Q++]=268435456|uxe[Y]<<18|TAt[J];var me=uxe[Y]&31,ye=TAt[J]&31;B+=yne[me]+xne[ye],++y[257+me],++x[ye],w=S+Y,++E}else C[Q++]=t[S],++y[t[S]]}}for(S=Math.max(S,w);S<s;++S)C[Q++]=t[S],++y[t[S]];l=HAt(t,A,c,C,y,x,B,Q,M,S-M,l),c||(r.r=l&7|A[l/8|0]<<3,l-=7,r.h=m,r.p=p,r.i=S,r.w=w)}else{for(var S=r.w||0;S<s+c;S+=65535){var ve=S+65535;ve>=s&&(A[l/8|0]=c,ve=s),l=LAt(A,l+1,t.subarray(S,ve))}r.i=s}return Kk(a,0,o+mxe(l)+i)},$7n=(function(){for(var t=new Int32Array(256),e=0;e<256;++e){for(var n=e,o=9;--o;)n=(n&1&&-306674912)^n>>>1;t[e]=n}return t})(),Z7n=function(){var t=-1;return{p:function(e){for(var n=t,o=0;o<e.length;++o)n=$7n[n&255^e[o]]^n>>>8;t=n},d:function(){return~t}}},GAt=function(){var t=1,e=0;return{p:function(n){for(var o=t,i=e,r=n.length|0,s=0;s!=r;){for(var a=Math.min(s+2655,r);s<a;++s)i+=o+=n[s];o=(o&65535)+15*(o>>16),i=(i&65535)+15*(i>>16)}t=o,e=i},d:function(){return t%=65521,e%=65521,(t&255)<<24|(t&65280)<<8|(e&255)<<8|e>>8}}},YAt=function(t,e,n,o,i){if(!i&&(i={l:1},e.dictionary)){var r=e.dictionary.subarray(-32768),s=new tm(r.length+t.length);s.set(r),s.set(t,r.length),t=s,i.w=r.length}return X7n(t,e.level==null?6:e.level,e.mem==null?i.l?Math.ceil(Math.max(8,Math.min(13,Math.log(t.length)))*1.5):20:12+e.mem,n,o,i)},bV=function(t,e,n){for(;n;++e)t[e]=n,n>>>=8},e6n=function(t,e){var n=e.filename;if(t[0]=31,t[1]=139,t[2]=8,t[8]=e.level<2?4:e.level==9?2:0,t[9]=3,e.mtime!=0&&bV(t,4,Math.floor(new Date(e.mtime||Date.now())/1e3)),n){t[3]=8;for(var o=0;o<=n.length;++o)t[o+10]=n.charCodeAt(o)}},t6n=function(t){return 10+(t.filename?t.filename.length+1:0)},n6n=function(t,e){var n=e.level,o=n==0?0:n<6?1:n==9?3:2;if(t[0]=120,t[1]=o<<6|(e.dictionary&&32),t[1]|=31-(t[0]<<8|t[1])%31,e.dictionary){var i=GAt();i.p(e.dictionary),bV(t,2,i.d())}},UAt=function(t,e){return((t[0]&15)!=8||t[0]>>4>7||(t[0]<<8|t[1])%31)&&ix(6,"invalid zlib data"),(t[1]>>5&1)==+!e&&ix(6,"invalid zlib data: "+(t[1]&32?"need":"unexpected")+" dictionary"),(t[1]>>3&4)+2},Ixe=(function(){function t(e,n){typeof e=="function"&&(n=e,e={}),this.ondata=n;var o=e&&e.dictionary&&e.dictionary.subarray(-32768);this.s={i:0,b:o?o.length:0},this.o=new tm(32768),this.p=new tm(0),o&&this.o.set(o)}return t.prototype.e=function(e){if(this.ondata||ix(5),this.d&&ix(4),!this.p.length)this.p=e;else if(e.length){var n=new tm(this.p.length+e.length);n.set(this.p),n.set(e,this.p.length),this.p=n}},t.prototype.c=function(e){this.s.i=+(this.d=e||!1);var n=this.s.b,o=kAt(this.p,this.s,this.o);this.ondata(Kk(o,n,this.s.b),this.d),this.o=Kk(o,this.s.b-32768),this.s.b=this.o.length,this.p=Kk(this.p,this.s.p/8|0),this.s.p&=7},t.prototype.push=function(e,n){this.e(e),this.c(n)},t})();function Cxe(t,e){e||(e={});var n=Z7n(),o=t.length;n.p(t);var i=YAt(t,e,t6n(e),8),r=i.length;return e6n(i,e),bV(i,r-8,n.d()),bV(i,r-4,o),i}function KAt(t,e){e||(e={});var n=GAt();n.p(t);var o=YAt(t,e,e.dictionary?6:2,4);return n6n(o,e),bV(o,o.length-4,n.d()),o}var Ene=(function(){function t(e,n){Ixe.call(this,e,n),this.v=e&&e.dictionary?2:1}return t.prototype.push=function(e,n){if(Ixe.prototype.e.call(this,e),this.v){if(this.p.length<6&&!n)return;this.p=this.p.subarray(UAt(this.p,this.v-1)),this.v=0}n&&(this.p.length<4&&ix(6,"invalid zlib data"),this.p=this.p.subarray(0,-4)),Ixe.prototype.c.call(this,n)},t})();function o6n(t,e){return kAt(t.subarray(UAt(t,e),-4),{i:2},e,e)}var VAt=typeof TextEncoder<"u"&&new TextEncoder,i6n=typeof TextDecoder<"u"&&new TextDecoder,r6n=0;try{i6n.decode(OAt,{stream:!0}),r6n=1}catch{}function yxe(t,e){var n;if(VAt)return VAt.encode(t);for(var o=t.length,i=new tm(t.length+(t.length>>1)),r=0,s=function(c){i[r++]=c},n=0;n<o;++n){if(r+5>i.length){var a=new tm(r+8+(o-n<<1));a.set(i),i=a}var A=t.charCodeAt(n);A<128||e?s(A):A<2048?(s(192|A>>6),s(128|A&63)):A>55295&&A<57344?(A=65536+(A&1047552)|t.charCodeAt(++n)&1023,s(240|A>>18),s(128|A>>12&63),s(128|A>>6&63),s(128|A&63)):(s(224|A>>12),s(128|A>>6&63),s(128|A&63))}return Kk(i,0,r)}function s6n(t,e){const n=JSON.stringify(t),o=Cxe(yxe(n));return`https://tscircuit.com/editor?#data:application/gzip;base64,${U7n(o)}`}function zr(...t){return G5n(R4(t))}const zAt=t=>t.replace(/_/g," ").replace(/\b\w/g,e=>e.toUpperCase()),xxe=l5n,Bne=te.forwardRef(({className:t,...e},n)=>V.jsx(lit,{ref:n,className:zr("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",t),...e}));Bne.displayName=lit.displayName;const v9=te.forwardRef(({className:t,...e},n)=>V.jsx(git,{ref:n,className:zr("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",t),...e}));v9.displayName=git.displayName;const q1=te.forwardRef(({className:t,...e},n)=>V.jsx(uit,{ref:n,className:zr("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",t),...e}));q1.displayName=uit.displayName;const JAt="T1RUTwAJAIAAAwAQQ0ZGIFhQSpcAAAcwAABJ3U9TLzJqmmVhAAABAAAAAGBjbWFwFN0WswAABEwAAALEaGVhZC1P1HwAAACcAAAANmhoZWEDrgI1AAAA1AAAACRobXR44xAAAAAAURAAAAFQbWF4cABUUAAAAAD4AAAABm5hbWUZQ94BAAABYAAAAutwb3N0AAMAAAAABxAAAAAgAAEAAAABAADb+Z65Xw889QADA+gAAAAA5e9IsgAAAADl70iy/9P/PwKHAvkAAAADAAIAAAAAAAAAAQAAA6z/LAAAArQAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAFQAAFAAAFQAAAADArQB9AAFAAACigK7AAAAjAKKArsAAAHfADEBAgAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAABYWFhYAEAAIQB6A6z/LAAAAvkAwQAAAAEAAAAAAiwC1wAAAAAAAAAAACIBngABAAAAAAAAAAEAWQABAAAAAAABABEAAAABAAAAAAACAAcAMwABAAAAAAADABsA/AABAAAAAAAEABkASAABAAAAAAAFAAsA2wABAAAAAAAGABgAkwABAAAAAAAHAAEAWQABAAAAAAAIAAEAWQABAAAAAAAJAAEAWQABAAAAAAAKAAEAWQABAAAAAAALAAEAWQABAAAAAAAMAAEAWQABAAAAAAANAAEAWQABAAAAAAAOAAEAWQABAAAAAAAQABEAAAABAAAAAAARAAcAMwADAAEECQAAAAIAgwADAAEECQABACIAEQADAAEECQACAA4AOgADAAEECQADADYBFwADAAEECQAEADIAYQADAAEECQAFABYA5gADAAEECQAGADAAqwADAAEECQAHAAIAgwADAAEECQAIAAIAgwADAAEECQAJAAIAgwADAAEECQAKAAIAgwADAAEECQALAAIAgwADAAEECQAMAAIAgwADAAEECQANAAIAgwADAAEECQAOAAIAgwADAAEECQAQACIAEQADAAEECQARAA4AOlRzY2lyY3VpdEFscGhhYmV0AFQAcwBjAGkAcgBjAHUAaQB0AEEAbABwAGgAYQBiAGUAdFJlZ3VsYXIAUgBlAGcAdQBsAGEAclRzY2lyY3VpdEFscGhhYmV0IFJlZ3VsYXIAVABzAGMAaQByAGMAdQBpAHQAQQBsAHAAaABhAGIAZQB0ACAAUgBlAGcAdQBsAGEAclRzY2lyY3VpdEFscGhhYmV0UmVndWxhcgBUAHMAYwBpAHIAYwB1AGkAdABBAGwAcABoAGEAYgBlAHQAUgBlAGcAdQBsAGEAclZlcnNpb24gMC4xAFYAZQByAHMAaQBvAG4AIAAwAC4AMSA6VHNjaXJjdWl0QWxwaGFiZXQgUmVndWxhcgAgADoAVABzAGMAaQByAGMAdQBpAHQAQQBsAHAAaABhAGIAZQB0ACAAUgBlAGcAdQBsAGEAcgAAAAABAAMAAQAAAAwABAK4AAAAqgCAAAYAKgAAACEAIgAjACQAJwAoACkAKgArACwALQAuAC8AMAAxADIAMwA0ADUANgA3ADgAOQA8AD0APgBBAEIAQwBEAEUARgBHAEgASQBKAEsATABNAE4ATwBQAFEAUgBTAFQAVQBWAFcAWABZAFoAWwBcAF0AXgBfAGEAYgBjAGQAZQBmAGcAaABpAGoAawBsAG0AbgBvAHAAcQByAHMAdAB1AHYAdwB4AHkAev//AAAAAAAhACIAIwAkACcAKAApACoAKwAsAC0ALgAvADAAMQAyADMANAA1ADYANwA4ADkAPAA9AD4AQQBCAEMARABFAEYARwBIAEkASgBLAEwATQBOAE8AUABRAFIAUwBUAFUAVgBXAFgAWQBaAFsAXABdAF4AXwBhAGIAYwBkAGUAZgBnAGgAaQBqAGsAbABtAG4AbwBwAHEAcgBzAHQAdQB2AHcAeAB5AHr//wAA/+D/4P/g/+D/3v/e/97/3v/e/97/3v/e/97/3v/e/97/3v/e/97/3v/e/97/3v/c/9z/3P/a/9r/2v/a/9r/2v/a/9r/2v/a/9r/2v/a/9r/2v/a/9r/2v/a/9r/2v/a/9r/2v/a/9r/2v/a/9r/2v/a/9n/2f/Z/9n/2f/Z/9n/2f/Z/9n/2f/Z/9n/2f/Z/9n/2f/Z/9n/2f/Z/9n/2f/Z/9n/2QABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEABAEAAQEBGVRzY2lyY3VpdEFscGhhYmV0UmVndWxhcgABAQEo+BsA+BwC+B0D+B4Ei/tV+kD5SAUdAAABOQ8dAAAB4BGLHQAASd0SAFcBAQwlNj0+P0BBQkNERUZHSElKS0xNTk9QUVJTVFVWV1hZWltcXV5fYGFiY2RlZmdoaWprbG1ub3BxcnN0dXZ3eHl6e3x9fn+AgYKDhIWGh4iJiouMjY6PkFZlcnNpb24gMC4xVHNjaXJjdWl0QWxwaGFiZXQgUmVndWxhclRzY2lyY3VpdEFscGhhYmV0UmVndWxhciEiIyQnKCkqKywtLi8wMTIzNDU2Nzg5PD0+QUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVpbXF1eX2FiY2RlZmdoaWprbG1ub3BxcnN0dXZ3eHl6AAAAAYsBjAGNAY4BjwGQAZEBkgGTAZQBlQGWAZcBmAGZAZoBmwGcAZ0BngGfAaABoQGiAaMBpAGlAaYBpwGoAakBqgGrAawBrQGuAa8BsAGxAbIBswG0AbUBtgG3AbgBuQG6AbsBvAG9Ab4BvwHAAcEBwgHDAcQBxQHGAccByAHJAcoBywHMAc0BzgHPAdAB0QHSAdMB1AHVAdYB1wHYAdkB2gHbAdwB3QBUAgABAAQAeADuAgwFUgWPBmUHOwffCGMIzwkMCUgJhQq1CzwMhg5ADwwQUBHfEt8U3hYZFqIXFxeiGEIZtBsIHCccsh0sHpIfGh9XIC8gtiEFIjwjJSRTJWUmviftKXQp2CqzK0gsfS0ILW8uPy6iLuAvQy+2L/IxEDItM0A0XjWWNlQ39zjFOTk59zp9Oro76Dy1Pd8+/EAaQJVCDELOQ49EGEVZReRGgUdR+UgO+Uj37vlBFYv8VgWIewWBfQV8ggV6iAV6jgV8lAWBmQWImwWL+FYFjpsFlZkFmpQFnI8FnIcFmoIFlX0FL/z3Fe+LBZyIBZmCBZV9BY97BYd7BYF9BX2CBXqIBSeLBXqOBX2UBYGZBYebBY+bBZWZBZmUBQ75SPdm+UEVi/uBBYh7BYF9BXyCBXqIBXqOBXyUBYGZBYibBYv3gQWOmwWVmQWalAWcjwWchwWaggWVfQX3p3sVi/uBBYh7BYF9BXyCBXqIBXqOBXyUBYGZBYibBYv3gQWOmwWVmQWalAWcjwWchwWaggWVfQUO+Uj3XvcoFYAiBYZ7BYB/BXyDBXmJBXqQBX6VBYOaBYmbBZPgBSR/BXqMBXuSBX+YBYaaBYycBZOaBZiVBZyRBfcPmgWe91QFKH8FeYwFfJIFf5gFhZoFjZwFkpkFmZYFm5EF9wyZBZ33RgWQmgWWmAWakwWdjQWchgWYgQWUfAWMewV7+zIF9zifBZr3JgWQmgWWmAWbkwWcjQWchgWZgQWTfAWNewV++xMF8JcFnIoFm4QFl34FkHwFinoFg30FfoAFeoUF+w19BXj7VQXslwWdigWahAWXfwWRewWKegWDfQV+gAV6hgX7CnwFfvscBYZ7BX9/BXyDBXqJBXqQBX2VBYOaBYmbBZf3CQX7MM0V9zifBZ/3VAX7OHcFDvlI9/T5XhWL/awFiHoFgX4FfIEFeogFeo4FfJUFgpgFh5wFi/msBY+bBZSZBZqUBZyOBZyIBZqCBZV9BfcB+2YVNd0FgpkFiJsFjpsFlZkFmpQFnI4FnIcFmoIF4DkFlX0FjnoFh3sFgX4FfYIFeYgFeo4FQ9sV+z+bBXuQBX2VBYOaBYmbBZCbBZeYBZqTBZ2MBfc+ewWchgWZgAWTfQWMegWGfAWAfgV8gwX7LqUVKjgFe4MFeogFeo8FfZUFgpkFiJwFkJsFlZgF7d4FmpMFnI0FnIcFmYEFlH0FjnsFh3sFLD4VZvsHBYN8BX2BBXqGBXqMBXuTBYCYBYabBY2bBa/3CAWTmQWZlgWckAWciQWbgwWWfwWQewVkIRWkSQWNegWHewWAfgV8gwV6iQV6jwV9lQWCmQVyzQWJmwWPmwWWmQWakwWcjQWchwWZgQWdTxXUWgWXfwWRewWKewWEfAV+fwV7hgV5iwV7kgVCvQV/lwWFmgWLnAWTmgWYlgWbkQWdigXTWhX3fFkFm4QFl38FkXwFi3oFhHwFfoAFe4UFeYwF+3y8BXuSBX+XBYWaBYycBZKaBZeWBZyRBfedUhXVWgWWfwWSewWKewWEfAV+fwV6hgV6iwV7kgVCvAV/mAWFmgWLnAWTmgWXlgWckQWcigX2PBWjOAWMewWGewV/fgV8hAV5igV6kAV+lgWDmQVz3gWKmwWQmwWXmAWakgWdjAWbhgWZgAWp+xAVW/sHBYF9BX2BBXqIBXmOBX2UBYGYBYebBY6cBbz3BwWUmQWalQWcjgWciAWaggWVfQWPewU/+y8V+w5aBXqHBXmOBX2UBYGZBYebBY6bBZWZBZmUBfcOvQWcjgWciAWaggWVfgWPewWIewWBfQX7M00V+zObBXuQBX2WBYOZBYqcBZCaBZaYBZuTBZyMBfczewWchgWYgAWTfAWNewWFewWAfwV7gwX7VqAVNb0Ff5YFg5oFi5sFkZsFl5cFm5IFnIsFnIYF4FkFmIAFknwFjHoFhXwFf38Fe4QFeYoF+wzZFWbuBYmbBY+bBZaYBZqUBZyNBZyHBZmBBZR9BbAnBY17BYd7BYB+BXyDBXmIBXqQBX2VBQ75SPfu+UEVi/uBBYh7BYF9BXyCBXqIBXqOBXyUBYGZBYibBYv3gQWOmwWVmQWalAWcjwWchwWaggWVfQUO+Uj4Ko0VsmUFlX0FjnsFh3sFgX0FfYIFeYgFeo8FfZQFYrMFio0FiYwFY7sFiowFiowFYsMFiowFiowFY8oFio4FiY0FbcoFio4FiY4Fd8oFi44Fio0FgcMFi5IFi5IFlcMFjI0Fi44Fn8oFjY4FjI4FqcoFjY0FjI4Fs8oFjIwFjIwFtMMFjIwFjIwFs7sFjYwFjI0FtLMFmZQFnI8FnYgFmYIFlX0Fj3sFiHsFgX0FZGUFZV4FZFUFZE8Fb1AFeFEFg10Fk10FnlEFp1AFsk8FslUFDvlI95tWFYqJBWJjBX2CBXqHBXmOBX2UBYGZBYebBY6bBZWZBbKxBbG4BbLBBbLHBafGBZ7FBZO5BYO5BXjFBW/GBWTHBWTBBWW4BWSxBYGZBYibBY+bBZWZBZqUBZyOBZyHBZmCBbRjBYyJBY2KBbRbBYuKBY2KBbNTBYyKBYyKBbRMBYuIBY2JBapMBYuIBY2IBZ9MBYuIBYyJBZVTBYuEBYuEBYFTBYqJBYuIBXdMBYmIBYuIBWxMBYmJBYuIBWJMBYqKBYqKBWNTBYmKBYuKBWJbBQ75SPeU+FUV+zRWBXqIBXqPBX2VBYKZBYicBY+bBZaYBZqTBfc5wgUh9yQFhJoFi5sFkZsFmJYFm5IFnIsFm4UFmIAF8fsfBfH3HwWYlgWbkQWciwWchAWXgAWRewWLewWEfAUh+yQF9zlUBZqDBZZ+BY97BYh6BYJ9BX2BBXqHBXqOBfs0wAWL+yoFiHsFgX0FfIIFeogFeo4FfJQFgZkFiJsFDvlI95T39hWL90sFjpwFlZgFmpUFnI4FnIgFmoEFlX4FjnoFi/tLBfdpiwWciAWaggWVfQWOewWIegWBfgV8ggV6hwX7aYsFi/tLBYh7BYF9BXyCBXqIBXqOBXyUBYGZBYibBYv3SwX7aYsFeo8FfJQFgZgFiJwFjpsFlZkFmpQFnI4FDvlI96puFcJVBZV9BY56BYd7BYF+BXyCBXqIBXqOBX2VBTXfBYeRBYaRBYuMBYqMBYqSBYmSBYyMBYqMBY2SBYyTBYyLBYuMBZCRBY+RBfc/9zwFmpUFnI4FnIgFmoMFlX0Fj3sFiHsFgX0FDvlI90L35RX3kosFnIgFmoIFlX0FjnsFiHsFgX0FfIIFeogF+5KLBXqOBXyUBYGZBYibBY6bBZWZBZqUBQ75SPf/7RX7D4sFeY4FfZQFgZkFiJsFjpsFlZkFmZQFnY4F9w+LBZyIBZmCBZV9BY97BYd7BYF9BX2CBQ75SKOAFfhx+WMFl5cFm5EFnYwFm4UFmIAFknwFjHoFhXwF/HH9YwV/fwV7hQV5igV7kQV+lgWEmgWKnAUO+Uj4CfkPFUOeBUN4BUZQBWMvBYH7JQWj+wwFxi0F2F0FyYsF2LkFxukFo/cMBYH3JQVj5wVq9x4VjYoFkYgFkYgFjIoFjYoF4EEFi4sFjIoFj4UFkIUFi4oFjIoFuSEFjIQFjYUFlvsyBYqGBYuGBXH7GQWIhQWJhAVH+wIFiYoFiokFhocFh4YFiYoFiooFKVEFh4kFiIkFhooFh4oFh4sFh4oFM4sFh4wFh4sFh4wFhowFiI0Fh40FKcUFiowFiYwFh5AFho8Fio0FiowFRvcCBYmSBYiRBXH3GQWLkAWKkAWW9zIFjZEFjJIFufUFjIwFi4wFkJEFj5EFjIwFjIsF39UFjYwFjIwFkY4FkY4FjYwFjYsF6aMFjowFjowFkYoFkYwFjooFjooF6XMFDvlI9/v5ZRWQjgWNjAWNjAWSiwWSjQWMigWNiwWSigWSiQWMigWNiwWRhwWQhwWMigWNigWOhQWPhQWMigWLiQWMhQWNhAWL/REFh3sFgX0FfYIFeogFeY4FfZQFgZkFiJsFi/i2BTRFBXuDBXqJBXqPBX2WBYOZBYmbBY+bBZaYBfc19xUFDvlI90rmFffoiwWdiAWZggWVfQWOewWIewWBfQV9ggV5iAX8TosFg4wFg4wFiowFiosFhY8FhI8Fi4sFiowFhpEFh5EFi4wFiowFipIFiZIFi4wFi4wFjJIFjJIFjIwFi4wFj5EFj5EF9zn3PgX3L/dKBcTlBZezBYueBYOqBXeiBV6dBUaQBWaGBVBzBWttBX9mBYN9BX6ABXqGBXmNBXyTBYCYBYaaBYycBZu6BYuMBYyNBY+QBY6RBYyMBYyNBbi2BYuLBYuLBZOQBZKQBYuLBYuLBdWoBZCNBZGMBbqSBZCKBZCMBd2FBZKJBZKKBclxBYyKBY2LBZCHBZGHBYyKBY2JBaxlBYyKBYuKBY+FBY6EBYuKBYyKBZdeBYuFBYyGBYptBYqGBYuGBX1ZBYiFBYmGBUwpBYmJBYqJBfsy+04FiooFiooFDvlI9wqUFYeMBVObBXySBX+YBYabBY2bBZOaBZmVBZuQBZ2KBcB8BdeABeiJBb2WBdGxBbW2BZy5BYOvBWWzBUStBTSiBT2UBYiMBYiLBYWOBYaMBYmNBYiNBYePBYeOBYmOBYmNBYmQBYmQBYuOBYqOBYuQBYuRBYyNBYuOBY2QBY2QBY2NBY2OBY+PBY+PBY6MBY2NBZCNBZGNBY6LBY6MBduVBeKdBdGpBauoBZGqBXWtBV2uBUagBTyPBUp2BVZxBWhxBXyEBXmKBXuQBX2WBYOZBYqcBZCaBZeYBbCnBY+MBY6OBceoBY6MBY6NBdikBZOMBZSMBemGBZCKBZGKBd1yBZKIBZOHBcVeBZCGBZCGBa9UBY2EBY6FBYuKBYyKBYqEBYuDBYBQBYmHBYqHBYmIBYmHBYiIBYiHBVxfBYWGBYSHBUduBdFqBZGGBZKHBcBUBYyIBY6JBY2GBY6HBYuIBY2HBZZQBYuJBYyIBYqFBYuGBYqIBYuJBXNKBYuLBYuLBYeEBYaEBYuLBYuLBVZUBYWHBYaHBTlfBYWJBYWIBU19BYWLBYWKBSeNBYiMBYiLBTmWBQ75SPgF98IVi+oFj5sFlJgFmpUFnI4FnIgFmoEFlX4FjnsFiywF6YsFnIcFmoIFlX0FjnsFiHsFgX0FfIIFeogFLYsFi/s9BYh7BYF9BXyCBXqIBXqOBXyUBYKZBYebBYv3PQX71IsFhIwFhYwFiYwFiYsFhY8FhY0Fio0FiYwFh5AFh5AFi40FiY0FipEFiZEFi40Fi40FjJEFjJEFjI0Fi40Fj5EFjpAF+Ab4PgWYlgWcjwWcigWbgwWWfgWQfAWKegWCfQX7yfv5BQ75SKn5QRWOmwWVmQWalAWcjwX4WIsFnIcFmoIFlX0FjnsFiHsFgX0FfIIFeogF/CuLBYv7dwX3HakFk4sFk4wF9x57BZOIBZOJBcJuBZGGBZGHBbFiBYyJBYyKBY6FBY+FBYuKBYyJBaj7BAWLigWLigWLhAWMhAWKigWLiQV9UQWLiwWLigWHhAWIhAWLiwWKigVnXgWFhQWFhgVFYQWFiQWFiAU5dQWGigWGigU+hwWFjAWGiwVKlwWGjQWGjAVWogWGjgWFjwVUugWAmAWHmwWOmwWUmQWZlQWcjwWciQWaggW9YQW0eQXCgQXNjgXSngXFrgWlqwWUswVz5wVxpwVjoAX7DZkF+01iBYaLBYaKBYeMBYiKBYaNBYaMBYiNBYeMBYePBYeNBYmOBYiNBYmQBYiPBYuOBYmPBYuPBYqQBQ75SPch96QVi4sFi4sFbW4FioMFnlkFm24FtWEFtHIFzoEF2o8FxaMFsqoFnrMFjaoFf7MFeKwFcqQFZ5sFUJcFU44FU4MFU28F+yxcFYqPBYyRBYy5BYuLBYuLBY7cBY2RBYyRBafaBYyNBYuNBbTfBZCSBZCRBcC7BY6NBY2NBdC4BZGOBZCOBdykBYyLBYuLBeKlBZ2NBZuGBZmBBZN8BY17BYZ7BYB+BXyDBTRyBUFzBU9kBV5jBWdABXJEBYp7BZGOBZCPBdGtBZKNBZKOBc6UBZCLBY+LBcuJBY+KBY+LBc58BZCKBZCJBbt2BZKGBZKHBa5oBY6GBY+GBaNhBYyHBY2HBZpZBYyEBYyFBYlbBYuLBYuLBYmDBYmDBYuLBYuLBW9UBYuKBYqKBYaGBYeFBYqKBYqLBVhiBYaIBYaIBUNtBYOJBYOJBS+GBYeMBYaLBTmXBYqLBYqLBYSOBYOOBYuLBYqLBVasBYiPBYaNBVq8BYeQBYeQBXaxBYqOBYqOBXXHBYqSBYmTBQ75SPfP90gVg/saBYd7BYF+BXyCBXmJBXqPBX2VBYKZBYmbBZL3HAWMjQWLjQWc9wcFi4wFjI0Fms0FjI0Fi4wFnsYFjIwFi40FoL4FjIwFi40ForcFjIwFi40Fo7EFjIwFjI0FoqoFjI0FjIwFoqYFjYwF+96LBXmOBX2UBYGZBYibBY6bBZWZBZmUBZ2PBfhfiwWQigWQigWOigWPigWPiAWQiQWOiQWNiQWOhwWPhwWMiAWNiAWMhgWNhgWLiAWMiAWJhgWLhgWKiAWKiAWIhwWJhgWIiQWJiAWHiAWHiAVqeQV9gQVkaAV3dAV2bgV1aAV2YgV4WwV5UwV8TAUO+Uj3pvf2FUR0BUpaBXBZBYleBaZdBcVnBdlzBciJBeCmBb6wBaLEBYLEBWK1BTi2BVKfBdH3sxU4kQVLgAVXcwVrXQWVaQW4ZQW/bAXDeAWwlgXetQWdpgWMwwV1rwVr9wEVi4sFk4gFk4kFi4sFjIsF0GgFjokFj4kFjocFj4gFjYgFjYgFrVIFjIkFjYgFjIYFjYYFiogFjIgFiTwFi4gFi4kFiYUFioYFiYkFiogFbVwFiYkFiYgFh4gFh4cFiIoFiYkFUm4F0mYFkIcFkYcFw1IFjYcFj4gFjIcFjYgFjIYFjIcFmDoFi4kFi4kFioUFi4UFiokFiokFbDwFiYcFiogFh4cFiYgFiIgFiIkFR1sFhYgFhYcFJ2sFg4oFg4oFP40FhY0FhIsFMqcFho4FhY0FQ7gFio0FiYwFho8Fh5AFio0FiYwFZc0Fio4Fio4FipAFiZAFjI4Fio4Fjs0Fi4wFi4sFjZMFjZIFi4wFi4sFr80Fi4wFjIwFkJAFkJEFi4wFjIsF2sYFkY4Fko8FmI8FaZ8FiI4Fh40FUrwFiY0FiI4FiY8FiI8Fio4FiY4FeMsFi40Fi4wFipIFi5IFi4wFi4wFjpIFjZIFjIsFjI0Fu9IFjo4FjY4Fj44Fj44Fjo0Fjo0F0KsFkYwFkY0F15gFkIsFkYwF7YQFDvlI+Fr4mBWVnQV8xwVwqwVfoAVIkwVHgwVTdAVnagV+XwWYYAWvaQXDdAXMhAXMmgW8qgVf/BoVi4oFZ0IFgX4FfIIFeYgFeo8FfZUFgpkFiJsFj5sFr9QFtuoFwPcXBYuLBYuMBZKcBT55BYOKBYKLBTuUBYWNBYWMBUWoBYSPBYSQBVm6BYqNBYmMBYiQBYeQBYuOBYqNBXfNBYqOBYqOBYyQBYqQBYyOBYyPBZ/NBYyNBYuNBY+QBY6QBY2NBYyNBb26BZKPBZKQBdGnBZGMBZGNBduVBZGKBZGMBduBBZKJBZKJBcdvBYyKBYyLBZGGBZGHBYuKBYyKBbNcBYyKBYyKBY6FBY6FBYuJBYyKBZ83BYuFBYyEBYqJBYuJBYmFBYmGBYqHBUH7SAVW+xgFi4oFiooFXysFDvlI9y/3yxX4OvtDBZqBBZR9BY57BYd7BYF9BXyCBXqJBXqOBfyY92oFhI8FhY8FiowFiowFh5EFh5EFi4wFiosFipMFiZIFi4wFi4wFjZIFjJIFjIwFi4wFj5EFj5EFjIwFjIsFkY8Fko8F+Jj3agWcjwWciAWaggWVfgWPewWIegWCfQV8ggUO+Ui2+GkV+JiLBZyIBZqCBZV9BY57BYh7BYF9BXyCBXqIBfyYiwV6jgV8lAWBmQWImwWOmwWVmQWalAWc+4gV+JiLBZyIBZqCBZV9BY57BYh7BYF9BXyCBXqIBfyYiwV6jgV8lAWBmQWImwWOmwWVmQWalAUO+Uj44/fpFYyKBY+FBY+FBYuKBYyKBYyEBY2EBYuKBYuKBYmEBYqDBYqLBYuKBYeFBYeFBYqKBYqKBYWHBYSHBfyY+2oFeogFeo0FfJQFgZkFh5sFjpsFlJkFmpUF+Dv3QwX8O/dDBXyUBYKZBYicBY+bBZWYBZqUBZyOBZyHBfiY+2oFkocFkYcFDvlI+Ev3kxWGigX7q4sFi4sFLPtyBYF9BX2CBXqIBXmOBX2UBYGYBYecBY6bBfek+REFkJIFkJIFi4sFi4sFko8FkpAFi4sFjIsFk40Fk40FjIsFi4sFk4kFlIoFi4sFi4sFkoYFkocFjIsFi4sFkIQFj4QF97r9EQWPewWIegWBfgV9gQV6iAV5jgV9lAWBmAX7IvfIFfsB94AFJvuABQ75SPe++GUV2bYFlMsFTL8F+weeBSmGBYv7VgX32vxEFYSJBYmLBYmLBfv7hwWKiwWLiwWDjAWCjQWLiwWLiwWEjwWEkAWKiwWLiwWGkgWHkQWLjAWKiwWKkwWJkgWLjAWLiwWL+QoFjJIFjZIFi4wFi4wFkJEFjpEFjIwFjIwFkY8FkY8FjYsFjIwFkowFk40F9yWTBZCKBZCLBfcZdQWOigWPigWQiQWQiQWNiQWOiQXlQQWNiAWPiQWNhwWOhwWMhwWNiAWLhgWMhwWLhwWLhwV9+wAFiokFi4gFiIYFiYYFiYkFiogFh4cFh4cFiIoFiYkFSGYF9wJmBY6JBY+KBY+IBY+JBY2IBY6IBdE3BY6GBY6FBYyJBYuKBYyEBYyEBYX7AAWLiQWLiQWJhQWJhQWKiQWKiQVsWwWIiQWKiAWHiAWHhwWIigWIiQU+ZAWJigWJigVu3BXEqAWeqAWP3QVYyQX7JLsF+1CWBYv7nAUO+Uj4ZPclFaDbBZOZBZiXBZuQBZ2KBZuEBZd/BZF7BYp7BXIwBYqIBYqHBYiHBYmHBYiIBYmIBUNLBYiJBYmJBYaJBYaIBYiLBYiJBSl1BYuLBYuLBYOLBYKLBYuLBYuLBfsEnAWJiwWKjAWEjQWEjgWKjAWKiwVRsQWFkQWFkQVU3QWLiwWLiwWIkwWIkgWLiwWLiwVm918Fi5MFi5MFuvdeBYyMBYuNBY+RBY2RBY2MBYyNBc7XBYyMBYuLBZGQBZKQBYuLBYuLBdGsBZKNBZKOBdqVBYyLBYyLBZOKBZKLBYyKBY2LBfVqBYyLBYyLBZKHBZGHBYyLBYyKBcNZBYyLBYuKBZCFBY+FBYyKBYuLBapEBY57BYh7BYF9BXyCBXqIBXqOBXyVBYGYBXDJBWKwBTSlBU6EBVVxBVRNBWD7TAWt+04FuUgFtG8F6H0F2JwFDvlI93uVFYaKBfs1iAWLiwWKiwWDjAWDjQWKiwWLiwWEjwWEjwWLjAWKiwWHkgWGkQWLjAWLiwWJkwWJkgWMjAWKiwWT+QQFjJAFi5EFjY0Fi48Fj48FjY8FjY4FjY0FkI4Fj44Fjo0FjowFkIwFkY0F7pgFj4sFjowF14kFkYoFkIsF9xBrBYuLBYuLBZOHBZKIBYyLBYuKBeZIBYyKBYuLBZCFBZGFBYuLBYuKBb8wBY2FBY6GBaAsBYuHBYyHBY1EBYqHBYuIBYJOBYmHBYqHBXhXBYeFBYmGBUw8BYWGBYWGBTdZBYWJBYWIBfsdaAV53hX3EasF0rUFwM4Fm7UFlMAFicsFeOAFXtoFPsQF+wGnBUiMBVGDBYX8tAUO+Uj3EeUV+CGLBZyIBZqCBZV9BY57BYh7BYF9BXyCBXqIBfxOiwV6jgV8lAWCmQWHmwWL99MFi/fSBY+bBZSZBZqUBZyPBfhOiwWchwWaggWVfQWOewWIewWBfQV8ggV6iAX8IYsFi/t+BfeciwWdiAWZggWVfQWOewWIegWBfgV9ggV5hwX7nIsFDvlI9xf32hWL+6oFiHsFgX0FfYIFeYgFeo4FfZQFgZkFh5sFi/kRBY+bBZWZBZmUBZyPBZ2HBYyKBfgviwWciAWZggWVfQWPewWHewWBfQV9ggV6iAX8FYsFi/t4BffQiwWdiAWZggWVfQWOewWIewWBfQV9ggV5hwUO+Uj4fve0Ffs1iwV6jwV9lAWBmQWImwWOmwWVmQWZlAWdjgX3bIsFj4oFkIsFj4kFj4oFj4kFj4kFjogFj4kFjYgFjocFjYgFjYcFjIcFjYcFi4cFjIcFiocFi4cFXvtaBYqJBYuIBYiGBYiGBYmJBYqJBUtGBYmKBYqJBYWIBYaHBYmKBYmKBTpwBYqLBYuKBYOKBYOKBYqLBYqLBTWSBYSNBYSNBTmuBYWOBYaOBUfCBYaQBYaQBV/QBYuMBYqMBYmRBYiSBYuMBYuMBXf3UgWLkQWLkgWx90IFjIwFi40FjpEFjpEFjIwFjI0FzdsFjIwFi4wFkZAFkY8FjIwFjIsF37QFi4sFi4sFk40Fk44Fi4sFi4sF9xeVBZKKBZGLBfcQcQWbhQWXfwWRfAWLegWEfAV+gAV7hQV5iwX7CKMF+weCBUhrBVZJBWj7MwWe+0IFrlUFxFwF0W4Fz4UFx6AFvL8FDvlI+H74OhWL95sFj5sFlJkFmpQFnI8FnIcFmoIFlX0FjnsFi/0RBYh7BYF9BXyCBXqIBXqOBXyUBYKZBYebBYv3tgX8DosFi/u2BYd7BYJ9BXyCBXqIBXqOBXyUBYGZBYibBYv34AWL98UFjpsFlZkFmpQFnI8FnIcFmoIFlH0Fj3sFi/ubBQ75SPfu+UEVi/0RBYh7BYF9BXyCBXqIBXqOBXyUBYGZBYibBYv5EQWOmwWVmQWalAWcjwWchwWaggWVfQUO+Ui/9z4Vio4Fia8FjpsFlJkFmZUFnY4FnIkFmoIFlX4Fj3sFjGsFkXIFlXYFmXkFnX0FunoFzoQFu5EFwp8FoJkFnJ0Fl6EFk70FivhxBY6bBZWZBZqUBZyPBZyHBZqCBZR+BY96BYz8dAWKiAWLiAWCTgWJhQWJhAV5awWHhgWIhwVycQWHiAWIiAVtdwWGiQWGiAVKcwWGigWFigVRhAWGiwWGiwU8kwWFjAWFjAVRoQWFjwWFjQVvoQWHjwWHjgV2pQWJkAWIjwV+qAWKkAWJjwWEqwUO+Uj3Uff3FfsBOQWL+3UFiHsFgX0FfYIFeYgFeo4FfZQFgZkFh5sFi/kRBY+bBZWZBZmUBZyPBZ2HBZmCBZV9BY57BYv7xAX4Hve7BZuSBZyNBZyGBZiABZR8BYx7BYZ7BX9/Bfui+14F9+b70AWVfQWPewWHewWCfQV8ggV6iAV6jgV8lAUO+Uj3DOUV+CuLBZyIBZmCBZV9BY97BYd7BYF9BX2CBXqIBfxYiwV6jgV9lAWBmQWHmwWL+REFj5sFlZkFmZQFnI8FnYcFmYIFlX0FjnsFDvlI+KH5WxWOjwWNjQWNjQWRjQWPjgWOjAWOjAWRjAWRjAWOigWOiwWQiQWRigWNigWOigWQhwWPiAWNiQWNiQWOhgWOhgWMiQWMiAWLhgWNhQWL/REFh3sFgX0FfYIFeogFeY4FfZQFgZkFiJsFi/h1BftD+6wFiYkFiokFhocFh4cFiYkFiYoFhYkFhYgFiYsFiIoFhYwFhYoFiIwFiYsFhY4FhY0FiYwFiY0Fh48Fho8Fio0FiY0F+0P3rAWL/HUFiHsFgX0FfYIFeYgFeo4FfZQFgZkFh5sFi/kRBY2RBYuQBYyOBYyNBY6QBY6QBY2NBY2NBY+OBZCPBY6MBY2MBZGMBZCNBY6LBY6MBZGKBZGKBY6KBY6KBY+IBZGJBY2JBY2JBY6HBY+HBfdw+/UF93D39QUO+Uj4e/dPFYT4hgWOmwWVmQWZlAWcjwWdiAWZggWVfQWPewWU/REFioYFi4cFiocFiocFiYgFiYcFiIgFiIcFiIkFiIgFh4kFh4kFh4oFh4oFhosFh4oFhosFh4sFh40Fh4wFh40Fh4wFiI4Fh44FiI4FiI4F/BT4oQWL/IkFh3sFgn0FfIIFeogFeo4FfJQFgZkFiJsFi/kRBYyPBYuPBYyPBYyPBY6PBYyOBY6OBY6PBY6NBY6OBZCNBY+NBY+MBY6NBZCLBZCMBY+KBY+LBY+JBZCKBY+JBY6KBY+IBY+IBY2IBY6IBQ75SPgblBWFiAWJiwWJiwUzgAWKiwWKigWEjAWDjAWKiwWKiwUypQWJjAWIjAWGjgWGjgWJjQWJjAU62gWJjgWIjgWJjwWIjwWLjwWJjgVP96AFi40Fi4wFi5IFi5IFjIwFi40FxPddBY2PBYyPBY6OBY2PBY6NBY6PBdHEBYyMBYyMBZKOBZGOBY2LBYyMBfcOqQWPiwWPjAWQigWPjAWPiQWPiwX3B2cFjIoFjYsFkYcFkYgFjIoFjYkFzkoFjYgFjYkFjocFjYYFjIgFjIgFxfuJBYuDBYuDBW/7LgWIhAWJhQVYMgWKiQWLigWGhgWGhgWKigWKigUwTgWJigWKigUg0BXOkwXUvAW11gWl9x8FVvd1BVm8BTCoBShzBVdgBVj7RgXD+4sFy00FDvlI93j3xxWJigX7AooFi/uVBYd7BYF9BX2CBXqIBXmOBX2UBYGZBYibBYv5BQWMkQWMkgWMjAWLjQWPkQWOkAWNjAWMjQWQjwWRjwWNiwWMjAWSjQWRjAX3HZcFjosFj4sF9w6EBY+KBZCLBdp2BY+KBY+KBa96BZCIBZCIBcRbBYuKBYuLBZCFBZCEBYuLBYyLBaRXBY2EBY2EBZA/BYuJBYuJBYqFBYqFBYqJBYuJBXRcBYqJBYqJBYeHBYeFBYmKBYqKBWhxBYWIBYWIBVN2BYeKBYeJBTp8BYiLBYmLBfsCggWF4BX1kwXWmQW5nAWgmwWZpwWGxAV6sAVesQVxlwVEnQX7BpIFL4MFi/uJBQ75SPiTtRXQOQWTfAWNewWFewWAfwV7gwV6igV6kAV+lQVRzwVUYAWIigWJiQWGiQWGiAWHiwWIigU1fgWJjAWJigWEjAWFiwWJjAWIiwU0qQWJjAWIjAWGjgWGjgWJjgWJjAU75AWKjgWJjQWJkAWIkAWLjgWKjQVQ98MFi4sFi4sFi5MFi5MFi4sFi4wFw/d2BY2OBYyPBY2PBY6PBY2OBY2OBdDLBY2MBYyNBZGOBZGOBY2MBY2MBfcLrAWRjAWRjAWNigWOjAWRiQWRigX3BGMFjYoFjooFj4cFkYgFjIkFjYoFzUEFjIkFjYkFjYYFjoYFjIgFjIkFw/uoBYuEBYuEBW/7QgWJhQWJhQX7K0AVMfUFg5oFipsFkJsFlpcFm5MFnIwFnIYFmIEF0zcFmqkFpfc1BVb3lgVZxAU0qgUucQVXWgVY+2IFwvuvBctDBcx2BcmUBQ75SPfz+EoV3JcFrpgFoJsFlqIFjLMFfbkFgZYFd5gFcZUFQZsF+xSQBfsofgWL+10F90g8FftIhQWL+7cFh3oFgn4FfIEFeogFeo4FfJUFgZgFiJwFi/j8BYyRBYyRBYyNBYuNBY+QBY6RBY2MBYyNBZGOBZCPBY2MBY2MBZGMBZKNBfdUmwWOiwWOjAX3G4UFj4oFj4sF3HoFj4kFj4sFrX0Fj4kFj4kFp3kFj4cFkIgFoHQFi4oFjIsFjoQFj4UFi4oFjIoFnU0FjIUFjIUFiVQFi4sFiYMFiYMFi4sFeWQFiooFi4oFhoUFhoUFiosFi4oFaXAFhIgFhYcFXXoFhooFhokFNX8F94H7rQWTfQWNegWGewV/fwV8gwV5igV6kAV+lgX7nPfLBYOaBQ75SOXBFYaOBYqNBYiNBYmQBYeQBVr3AQWHnAWOmwWVmQWZlAWcjgWdiAWZggWVfgW3KgXNaQX3IIcF7bgFq/AFdsUFS68F+4ezBYiNBYiLBYaNBYaNBYmOBYiMBUu+BYiPBYiOBYmOBYiOBYqQBYmOBXrHBYuPBYqOBYuQBYuPBYyPBYyPBbT3DAWOkAWNkAWNjQWMjQWQjwWPjwXvzAWRjgWQjgWOiwWNjAWRiwWRjAX3R4IFjYoFjIwFkogFkooFjIoFjYoFkIcFkYcFjIoFjIoF1zAFknwFjXoFhXwFgH4Fe4QFeYoFe5AFfpYFTNYF+yOTBUBaBWssBZVoBbZoBfeDYwWTiQWTiAXfWgWQhwWQhwWNiQWMigWOhQWOhgWrNgWLhgWNhwWLhwWLiAWKhgWKhgVi+xgFi4oFiooFh4UFiIQFiosFiooFhYYFhYcFiosFiooF+xJRBYmLBYqKBYSKBYSJBYmLBYmLBfs2jwWJjAWJiwWFjQWEjAWJjAWJjAUzuQUO+Uj3yflsFfeiiwWchwWaggWVfQWOewWIewWBfQV8ggV6iAX7dYsFi/znBYh7BYF9BX2CBXmIBXqOBXyUBYKZBYebBYv45wX7hYsFeo4FfJQFgZkFiJsFjpsFlZkFmpQFnI8FDvlI+HT3hxWQ+E4Fj5sFlZkFmZQFnY4FnIcFmYIFlX0FjnsFhvxQBYqIBYyJBYFHBYqHBYqGBXdYBYmIBYmHBX53BYiHBYiIBW1sBYWHBYaHBVhxBYSJBYSJBU2BBYWLBYSLBTOUBYaNBYWMBUWlBYWPBYWOBVyvBYeQBYWQBWjCBYiRBYiRBXnSBYqPBYqOBYTsBYuNBYuMBYr39wWOmwWVmQWalAWcjwWchwWaggWVfgWOegWM+/UFki8Fm00Fp2EFr28FxXYF14IFu5MFsJ4FoqIFk5cFnLYFDvlI99H3NRX3a/ivBZSZBZqVBZyPBZyIBZqCBZV+BY97BYh6BfuS/REFi4sFi4oFhoUFh4QFi4sFiooFhIcFhYYFiosFi4sFg4kFg4oFiosFi4sFg4wFgowFi4wFiosFhI8FhI8Fi4sFi4wFhpEFhpEFi4wFi4sF+7j5EgWHmwWOmwWVmQWZlAWcjwWciAWaggWVfQUO+Uj4dvdYFdf4gwWQmwWXlwWbkgWcjAWchgWYgAWTfAWMegUq/REFiYcFioYFiYgFiocFiIgFiIcFiIkFiIgFh4kFh4kFh4oFh4kFh4sFhooFh4sFh4sFho0Fh4sFh40Fh40FiI4Fh40FiI4FiI4FiY8FiI4F+0b3/wX7Ofv2BYiHBYiGBYmJBYmJBYaIBYeHBYiKBYiKBYaKBYWJBYiLBYiLBYWMBYaLBYiNBYiLBYaOBYaOBYmNBYiNBYiPBYiPBYqOBYmOBYqQBYmQBTv5CQWNnAWTmQWYlgWckAWcigWbhAWWfgWRewXH/G8F9x/3vgWPkAWPkQWMjAWMjAWRjwWRjwWNiwWMjAWSjAWSjQWNiwWMiwWSiQWTigWMiwWMigWRhwWSiAWMigWMigWPhQWPhQUO+Uj3/Pf/FfeZ+7QFlH0FjXsFhnsFgH4FfIMFeYkFeo8FfpYF+5D3qQX7kPupBX6ABXqHBXmNBXyTBYCYBYabBY2bBZSZBfeZ97QF+5/3uwWCmQWJnAWQmwWWlwWalAWdjAWchwWYgQX3lvuxBfeW97EFmZUFm48FnYoFmoIFln8FkHsFiXoFgn0FDvlI9+j4EhWV++EFiHsFgn0FfYEFeogFeY0FfJQFgZkFh5sFgffjBfud96cFgpkFiJsFj5sFlpkFmpMFnI4FnIcFmYEF94n7kQX3k/eQBZqVBZyPBZyIBZqCBZV+BY96BYh7BYJ9BQ75SPci5RX4KosFnYgFmYIFlX0FjnsFiHsFgX0FfYIFeYgF/IKLBYWMBYaLBYiMBYeMBYeOBYaNBYmNBYiNBYiPBYePBYqOBYmOBYqQBYmPBYuPBYuOBYyQBYuQBYyOBYyOBY6PBY2QBfhP+M4F/CqLBXmOBX2UBYGZBYibBY6bBZWZBZmUBZ2PBfiCiwWRigWQigWOigWPigWPiQWQiAWNiQWOiQWOhwWPhwWMiAWNiAWMhwWNhgWLiAWLhwWKhgWLhgWKiAWKiAWIhwWJhgUO+Uj3h3QV9zaLBZyIBZmCBZV9BY97BYd7BYF9BX2CBXqHBftjiwV5jwV9lAWBmQWImwWL+Z8FjpsFlZkFmZQFnY4F92OLBZyIBZmCBZV9BY97BYd7BYF9BX2CBXqIBfs2iwUO+Ujw+VgV+HH9YwWRfAWKegWEfAV+gAV7hQV5jAV7kQV/lwX8cfljBYWaBYycBZKaBZiWBZuRBZ2KBZuFBQ75SPhWShWHewWBfQV9ggV6hwX7Y4sFeY8FfZQFgZkFiJsFjpsFlZkFmZQFnY4F9zaLBYv5SwX7NosFeY4FfZQFgZkFiJsFjpsFlZkFmZQFnY4F92OLBZyIBZmCBZV9BY97BQ75SPeo+WQVko8FjIsFjIwFkowFk40FjIoFjIwFk4kFkooFjIoFjIsFkocFkYcF9577ggWVfgWPewWIegWBfQV9ggV6hwV6jgV8lAX7f/dmBft/+2YFfIIFeogFeo8FfZQFgZkFiJwFj5sFlZgF9573ggUO+UiL+wEV+O6LBZyIBZqCBZV9BY57BYh7BYF9BXyCBXqIBfzuiwV6jgV8lAWBmQWImwWOmwWVmQWalAUO+Uj4POoVxcIFi/eQBVLBBVCnBS+LBVBvBUxQBWsvBYtQBaswBcpPBcdvBeaLBfcIZhWHiAWFhwVAZwWKigWJigWEigWFiQWJjAWJigX7BYsFiYwFiYoFhI0FhYwFiYwFiYwFQK8FhY8FhY8FP9MFiowFiowFiJEFh5EFiowFiowFZvYFipIFipIFi9IFjJIFjJEFsPcABYyNBYyMBY+RBY6RBYyMBYyMBdfTBZGPBZGPBdeuBYyMBY2MBZKMBZKNBYyKBY2MBfcFiwWMigWNjAWSiQWSigWMigWNigXWaAWQhwWQiAWLjwWPnAWUmAWalQWcjgWciAWagQWVfgWOegWL/IoFiHsFgX4FfIEFeogFeo4FfJUFgpgFh5sFDvlI9xOvFYaOBYuKBYd6BYF+BX2CBXqHBXmPBX2UBYGYBYicBYv5OAWOmwWVmQWZlAWdjgWciAWZggWVfQWPewWL+3YFkI4FkY8F1asFjIsFjIsFko0Fk40FjIoFjIwF9wSLBYyLBYuLBZOJBZOJBYyLBYuLBddrBZCHBZKIBdZKBYyKBY2KBY6FBY+GBYyJBYyKBbApBYyEBYyEBYtLBYqEBYqDBWYrBYqKBYqJBYeGBYiFBYmKBYqJBUBLBYWIBYWHBUBqBYqLBYqLBYSJBYOJBYqLBYqLBfsEiwWKjAWKigWDjQWEjQWKiwWKiwVBrAWA9w0VwlwFxnEF54sFx6UFycAFqdoFi70FbdsFTcAFT6QFL4sFUHIFVFwFDvlI+DLqFczNBZqVBZyPBZyIBZqDBZV9BY97BYl7BYF9BUVDBYWHBYWHBUZmBYiLBYmJBYWKBYWJBYiMBYmKBSGLBYmMBYiKBYWNBYWMBYmNBYmLBUSwBYWPBYWPBUXTBYqMBYqMBYeRBYeRBYuMBYqMBWn2BYqRBYqSBYvSBYyRBYySBa33AAWMjAWLjAWPkQWPkQWMjAWMjAXR0wWRjwWRjwXSrwWNiwWNjQWRjAWSjQWNigWNjAX1iwWNigWNjAWSiQWRigWNiQWNiwXRZwWRhwWRhwXRQwWVfQWNewWHewWBfQV8gwV6iAV6jwV8lQVKzQVWpgU3iwVVcAVRUAVtLgWLUAWoLwXGUAXCbwXdiwUO+Uj4PfUVwroFi/dxBVS6BVCkBS+LBU9yBU1WBW07BYtZBak8BclWBcdxBeeLBfcGYhWGiAWFhwVBagWKiwWKiwWEiQWDiQWKjAWKigX7BIsFiosFiosFhI0Fg40FiosFiosFQKwFhY8Fho4FP8sFio0FiYwFiJEFh5AFio0FiowFZusFipMFipIFi8sFjJIFjJIFsO0FjIwFjI0Fj5AFjpEFjYwFjIwF18wFkY4FkI8F16sFi4sFjIsFk40Fk40Fi4sFjIsF9wSLBYyKBYyMBZOJBZKJBYyLBYyLBdVrBZGHBZCIBYv3dgWPmwWVmQWZlAWcjgWdiAWZggWVfQWOewWL/TgFiHoFgX4FfYIFeYcFeo8FfZQFgZgFh5wFDvlI9x74IBV8YQX4GIsFg5QFZs0FbaYFS6cFJosFSm8F93r7/BXXzgWZlAWdjgWchwWZggWVfQWNegWIewWAfgU6QwWGiAWFhwU8ZgWJiwWKigWEigWEiQWJiwWKiwX7DYsFiosFiosFg40FhIwFiowFiosFOrAFhY8FhY4FO9MFiYwFiowFh5EFh5AFi40Fio0FY/YFipIFipIFi9IFjJIFjJIFs/cABYyNBYuNBY+QBY+QBYyNBY2MBdvTBZKOBZCPBdyvBYyLBYyMBZOMBZKNBYyLBYyLBfcNiwWMiwWMiwWTiQWSigWMigWMiwXbZwWQhwWRiAW1ZwWPhQWQhQWyRAWQewWJegWDfQV/ggWUhQWVfgWOegWIewWBfQV9ggV5iAX8SYsFi3UFrDAFz08FzG4F8IsFDvlI97n4VhWL/CQFiHsFgX0FfIIFeogFeo4FfJQFgZkFiJsFi/gkBfsGiwV6jgV8lQWCmAWHmwWPnAWUmAWalQWcjgX3BosFi8AFi40Fi40FjZEFjJEFjY0Fi4wFwOoFkZEFkJEFi4sFi4wFk44Fko8F9asFkowFkowF9YsFnIgFmoIFlX0FjnsFiHsFgX0FfIIFeogFKIsFOXIFZEUFi2EF9zuLBZyIBZqBBZV+BY56BYh7BYF+BXyBBXqIBQ75SPg99yMVwroFi/dxBVS7BVCkBS+LBU9yBU1WBW06BYtaBak7BclWBcdxBeeLBfcGYhWGiAWFhwVBagWKiwWKigWEigWDiQWKiwWKiwX7BIsFiosFiosFg40FhIwFiowFiosFQKwFhY8FhY4FQMwFiowFiYwFiJEFh5AFio0FiowFZuwFipIFipIFi8wFjJIFjJIFsOwFjI0FjI0Fj5AFjpAFjY0FjIwF1swFko4FkI8F16sFi4sFjIwFk4wFk40Fi4sFjIsF9wSLBYyLBYyLBZOJBZKKBYyKBYyLBdVrBZGHBZCIBYuLBY+cBZWYBZmVBZyOBZ2IBZmBBZV+BY56BYv8mAWKhAWKhAVmKgWKigWKiQWHhgWIhQWJigWKiQVlawWFhwWFhwVBbAWKigWKiwWEiQWDigWKiwWKiwX7BIsFiosFi4sFg4wFg40FiosFi4sFP6sFho8FhI8FQMsFio0FiYwFiJAFh5AFio0Fio0FZuwFiZwFj5sFlZgFm5QFnI0FnIcFmYEFlH0FrDQFyVYFx3EF54sFxqUFpKAFqdoFDvlI+L34CRWNhAWL+9AFiHsFgX0FfIIFeogFeo4FfJQFgZkFiJsFi/fIBW7TBVqfBSyLBU1yBS49BYv7vQWIewWBfQV8ggV6iAV6jgV8lAWBmQWImwWL+SwFjpsFlZkFmpQFnI4FnIgFmoIFlX0FjnsFi/uSBbKsBZGOBZGPBdeqBYyLBYuMBZOMBZONBYyLBYuLBfcGiwWMiwWLiwWTiQWTigWMigWLiwXXbAWLiwWLiwWShgWShwWLigWMiwWPhAWQhQWLigWLiwWxLAUO+Uj3mfmIFduLBZyIBZqCBZV9BY57BYh7BYF9BXyCBXqIBTuLBXqOBXyUBYGZBYibBY6bBZWZBZqUBfH7mRWL/E4FiHsFgX0FfIIFeogFeo4FfJQFgZkFiJsFi/hOBY6cBZWYBZqVBZyOBZyIBZqBBZV+BQ75SPgV+YgVyYsFnIgFmoIFlX0FjnsFiHsFgX0FfIIFeogFTYsFeo4FfJQFgpkFh5sFj5sFlJkFmpQF+wn+MhWGigWIjQWHiwUpqQV8kwWAmAWGmwWNmwWUmQWZlgWbjwWdiQXhcQXpoQWhyQWL+I4Fj5sFlJkFmpQFnI8FnIcFmoIFlX0FjnsFi/yVBYqEBYqFBWswBYiGBYmHBYmIBYmIBYeIBYeIBYiJBYiJBYaKBYaJBfsXbQWIiwWHigUO+Uj3f/eMFfsRLwWLIQWIewWBfQV8ggV6iAV6jgV8lAWCmQWHmwWL+SwFj5sFlJkFmpQFnI4FnIgFmoIFlX0FjnsFi/xXBff495sFm5IFnIwFnIYFmIEFk3wFjHoFhnwFgH4F+2v7MgX3mPtwBZV+BZB7BYh7BYJ9BX2BBXqHBXqNBXyTBQ75SPfu+WMVi/0xBYh7BYF9BXyCBXqIBXqOBXyUBYGZBYibBYv5MQWOmwWVmQWalAWcjwWchwWaggWVfQUO+Uj43/iYFZCGBYuKBYyJBYyFBY2EBYuKBYyJBYv8WwWHewWBfQV9ggV6iAV5jgV9lAWBmQWImwWL+EgFfJYFXIsFdHgFVDEFi/vmBYh7BYF9BX2CBXmIBXqOBX2UBYGZBYebBYv36gVo4wV1nAVdiwVzeAVVMQWL++YFh3sFgX0FfYIFeogFeY4FfZQFgZkFiJsFi/h9BY6cBZWYBZmVBZ2OBZyIBZmBBZV+BY2ABa2mBZGOBZGPBY2LBYyMBZKLBZKNBduLBZKJBZKLBYyKBY2LBZGHBZGIBbZoBYyJBY2KBY+GBY+GBYuJBY2JBZN1BZynBZCQBZCRBbWtBZGPBZGPBY2LBYyMBZKLBZKNBdyLBZKJBZKLBYyKBY2LBZGHBZGIBbZoBYyKBYyKBQ75SPi++B0VjIUFi/vyBYh7BYF9BXyCBXqIBXqOBXyUBYGZBYibBYv36wVt3QVaoQUtiwVPcAUsMwWL++AFiHsFgX0FfIIFeogFeo4FfJQFgZkFiJsFi/h9BY6cBZWYBZqVBZyOBZyIBZqBBZV+BY56BYtlBbCtBZKPBZCPBdiuBYyLBYyMBZKMBZONBYyLBYyLBfcGiwWMiwWNiwWSiQWSigWMigWNiwXWaAWMiwWLiwWShgWRhgWMiwWLiwWPhAWPhAWLiwWLiwWyIQUO+Uj37Ph4FTWLBVRwBU9PBWwvBYtQBaowBcdPBcNvBeCLBcKnBcfHBarmBYvGBWznBU/HBWH3AxWNjAWRiQWSigWNiQWNiwXTaAWRhgWRhwXTQwWLigWMiwWPhAWPhQWLigWMigWv+wAFjIUFjIQFi0QFioQFioUFZyAFiooFi4oFh4QFh4UFiosFi4oFQ0MFhYcFhYcFQ2YFiYsFiYkFhYoFhIkFiYwFiYoF+wCLBYmMBYmKBYSNBYWMBYmNBYmLBUOwBYWPBYWPBUPTBYuMBYqLBYeRBYeSBYuMBYqMBWf2BYqRBYqSBYvSBYySBYyRBa/3AAWMjAWLjAWPkQWPkgWMiwWLjAXT0wWSjwWQkAXTrgWNiwWNjQWSjAWRjQWNigWNjAX3AIsFDvlI9xTXFYWPBYv7dQWHewWCfQV8ggV6iAV6jgV8lAWBmQWImwWL+TMFjpwFlZgFmpUFnI4FnIgFmoEFlH4Fj3oFi4sFkY8FkI4F1asFjIsFjIwFk4wFko0FjIsFjIsF9wSLBYyLBYuLBZOJBZOKBYyKBYuLBdZsBZGHBZGHBdZLBY2KBYyJBY+GBY+GBYuJBY2JBa8rBY2EBYyDBYtLBYqEBYmEBWYsBYqJBYuJBYeGBYeFBYqKBYmKBUBLBYWHBYaIBUBqBYqLBYqKBYOKBYSJBYqLBYqLBfsEiwWKiwWKiwWDjQWEjAWKjAWKiwVBrAWA9w0VwlwFxnEF54sFx6UFyb8FqdoFi7wFbdsFTb8FT6QFL4sFUHIFVFwFDvlI+D33JRXCugWL924FVLoFUKQFL4sFT3IFTVcFbTsFi1oFqTwFyVcFx3EF54sF9wZiFYaIBYWHBUFqBYqLBYqLBYSJBYOJBYqMBYqKBfsEiwWKjAWKigWEjQWDjQWKiwWKiwVArAWGjgWFjwVAywWJjAWKjQWHkAWHkAWLjQWKjQVm6gWJkgWKkwWLywWMkgWNkgWw6wWMjQWLjQWPkAWPkQWMjAWNjAXWywWRjwWRjwXWqgWLiwWMjAWTjAWTjQWLiwWMiwX3BIsFjIsFjIsFkokFk4oFjIoFjIsF1WwFkIcFkYgFi4sFj5sFlJkFmpQFnI4FnIgFmoIFlX0FjnsFi/00BYh7BYF9BXyCBXqIBXqOBXyUBYKZBYebBQ75SPfp+MsVk40F9yaLBZyIBZmBBZV+BY96BYd7BYF+BX2BBXqIBfsdiwU4bgU5TwViNAWL+6MFiHsFgX0FfYIFeYgFeo4FfZQFgZkFh5sFi/h9BY+cBZWYBZmVBZyOBZ2IBZmBBZV+BY56BYtWBdTABZGNBZGPBeutBQ75SO6nFYSQBYuLBYuMBYeSBYeSBXLSBYmcBY+bBZaYBZuTBZyNBZyGBZmBBZN9BZ9TBbt0BfWLBeSsBbuhBYuoBVHCBfsBygX7BIsFiYsFiosFhI0FhIwFiowFiYwFQK8FhY8Fho8FiowFiYwFiJEFh5EFi4wFio0FipEFipIFi9IFjJMFjZMFi4sFi4wFkJEFj5IF1tMFjIsFjIwFkY8Fko8FjIsFi4wF764Fk4wFk40F9xGLBYyKBY2MBZKJBZKKBYyKBY2KBdZoBZmBBZN8BY17BYd7BYB+BXyDBXmJBXqPBUqqBSGLBTluBVRWBYtuBbN4BfcGiwWOigWPiwWQiQWQigWOigWPiQX3EEQFj4cFkIgF1kQFj4QFkIQFi4sFi4sFjYMFjIMFi0MFioUFioQFiooFi4kFh4UFiIYFiYoFiokFhYgFhoYFQGgFiYsFiYkFJ2cFg4oFg4kF+xGLBYmMBYmKBYWNBYSMBYmMBYqMBUCvBQ75SPdd+DEV+wyLBXqOBXyUBYGZBYibBY6bBZWZBZqUBZyOBfcMiwWL9zcFjpsFlZkFmpQFnI4FnIgFmoIFlX0FjnsFi/s3BfdDiwWciAWaggWVfQWOewWIewWBfQV8ggV6iAX7Q4sFi/uCBbNMBeF0BfOLBZyHBZqCBZV9BY57BYh7BYF9BXyCBXqIBfsCiwWFjAWFjAX7AqgFg48FhI4Fi4sFiowFhpEFhZAFVOIFio4FiY4FipAFiZAFjI4Fio4FDvlI+GX3SRWL9+AFjpsFlZkFmpQFnI4FnIgFmoIFlX0FjnsFi/x9BYh6BYF+BXyBBXqIBXqOBXyVBYGYBYicBYuyBWZpBYWHBYWHBT9oBYmKBYqKBYSKBYSJBYmMBYqKBfsGiwWJjAWKigWEjQWEjAWJjAWKjAU/rgWEkAWEkAWLiwWLiwWHkgWHkgVk9AWKkgWKkQWL9/IFjpsFlZkFmpQFnI4FnIgFmoIFlX0FjnsFi/vrBak6Bb10BeeLBcinBQ75SPfB9xcV92j4JgWWmAWakwWcjQWchwWZgQWUfQWNegWHewX7kfxyBYiHBYiGBYiJBYqJBYaIBYaIBYiKBYiKBYaKBYWKBYiLBYiLBYWMBYaMBYiMBYiMBYaOBYaOBYqNBYiNBYiQBYiPBfuQ+HIFhpsFjZwFlJkFmZUFnI8FnIkFmoMFln4FDvlI+Fj3TRX29+kFk5oFmZUFm5AFnYoFmoMFl34FkHsFiXsF+yr8cgWIhwWKhwWIiAWKhwWHiQWIhwWHiQWIiQWGiQWHiQWHiwWHigWHiwWGiwWHjAWHiwWHjQWGjQWIjQWHjQWIjwWIjQWJjwWIjgWKjwWIjwUg9+kFIPvpBYiHBYqHBYiIBYmHBYiJBYiHBYeJBYiJBYaJBYeJBYeLBYeKBYeLBYaLBYeMBYeLBYeNBYaNBYiNBYeNBYiPBYiNBYmPBYiOBYqPBYiPBfsq+HIFiZsFkJsFl5gFmpMFnYwFm4YFmYEFk3wF9wD76QX29+kFjY8FjI8Fjo4FjY8Fj44Fjo4Fjo0Fj40Fj40Fj40Fj4sFj4wFkIsFkIsFj4oFj4sFj4kFkIkFjokFjokFjogFj4gFjYcFjogFjIcFjYcFDvlI+AL3pxX3evtlBZV+BY97BYh7BYF9BX2BBXqIBXmOBX2UBft992YF+337ZgV9ggV5iAV6jgV9lQWBmQWImwWPmwWVmAX3evdlBft692UFgZgFh5sFjpwFlZgFmZUFnI4FnYgFmYMF9337ZwX3ffdnBZmTBZ2OBZyIBZmBBZV+BY56BYd7BYF+BQ75SOj7TxWDigWLiwWLiwVjiwV6jgV8lAWBmQWImwWOmwWVmQWalAWcjgWqiwXLpQXOwQXJ7gX7dfg4BYebBY2bBZSaBZiVBZyPBZ2JBZqDBZZ+BfdX/AEF91n4AQWWmAWakwWdjQWbhwWZgQWUfAWNewWGewX7gfxMBYuKBYqJBT37EQWGhQWGhgU9TAWEiAWGhwU8bAWLiwWLiwUO+Uj3UtkV98+LBZ2IBZmCBZV9BY57BYh7BYF9BX2CBXmIBfwsiwWEjAWFiwWJjQWIiwWGjgWGjgWJjQWJjAWHkAWHkAWKjQWKjQWKkQWJkAWLjgWLjQWMkQWLkQWNjQWLjQWPkAWOkQX38vguBfvPiwV5jgV9lAWBmQWImwWOmwWVmQWZlAWdjgX4LIsFkooFkYsFjYoFjooFkIgFkYgFjIkFjYoFj4YFj4YFjIkFjIkFjIUFjYYFi4gFi4kFioUFi4UFiYkFi4kFh4YFiIYFDgAAAAK0AAACtAAAArQAAAK0AAACtAAAArQAAAK0AAACtAAAArQAAAK0AAACtAAAArQAAAK0AAACtAAAArQAAAK0AAACtAAAArQAAAK0AAACtAAAArQAAAK0AAACtAAAArQAAAK0AAACtAAAArQAAAK0AAACtAAAArQAAAK0AAACtAAAArQAAAK0AAACtAAAArQAAAK0AAACtAAAArQAAAK0AAACtAAAArQAAAK0AAACtAAAArQAAAK0AAACtAAAArQAAAK0AAACtAAAArQAAAK0AAACtAAAArQAAAK0AAACtAAAArQAAAK0AAACtAAAArQAAAK0AAACtAAAArQAAAK0AAACtAAAArQAAAK0AAACtAAAArQAAAK0AAACtAAAArQAAAK0AAACtAAAArQAAAK0AAACtAAAArQAAAK0AAACtAAAArQAAAK0AAACtAAAArQAAA==";var Exe,WAt;function a6n(){if(WAt)return Exe;WAt=1,Exe=function(n){return n!=null&&(t(n)||e(n)||!!n._isBuffer)};function t(n){return!!n.constructor&&typeof n.constructor.isBuffer=="function"&&n.constructor.isBuffer(n)}function e(n){return typeof n.readFloatLE=="function"&&typeof n.slice=="function"&&t(n.slice(0,0))}return Exe}var Bxe,jAt;function A6n(){if(jAt)return Bxe;jAt=1;var t=a6n(),e=Object.prototype.toString;return Bxe=function(o){if(typeof o>"u")return"undefined";if(o===null)return"null";if(o===!0||o===!1||o instanceof Boolean)return"boolean";if(typeof o=="string"||o instanceof String)return"string";if(typeof o=="number"||o instanceof Number)return"number";if(typeof o=="function"||o instanceof Function)return"function";if(typeof Array.isArray<"u"&&Array.isArray(o))return"array";if(o instanceof RegExp)return"regexp";if(o instanceof Date)return"date";var i=e.call(o);return i==="[object RegExp]"?"regexp":i==="[object Date]"?"date":i==="[object Arguments]"?"arguments":i==="[object Error]"?"error":t(o)?"buffer":i==="[object Set]"?"set":i==="[object WeakSet]"?"weakset":i==="[object Map]"?"map":i==="[object WeakMap]"?"weakmap":i==="[object Symbol]"?"symbol":i==="[object Int8Array]"?"int8array":i==="[object Uint8Array]"?"uint8array":i==="[object Uint8ClampedArray]"?"uint8clampedarray":i==="[object Int16Array]"?"int16array":i==="[object Uint16Array]"?"uint16array":i==="[object Int32Array]"?"int32array":i==="[object Uint32Array]"?"uint32array":i==="[object Float32Array]"?"float32array":i==="[object Float64Array]"?"float64array":"object"},Bxe}var bxe={exports:{}},qAt;function c6n(){return qAt||(qAt=1,(function(t){(function(){function e(n,o){if(typeof o!="function")return n;var i={};for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(i[o(r,n[r])||r]=n[r]);return i}t.exports?t.exports=e:window.rename=e})()})(bxe)),bxe.exports}var Sxe,XAt;function l6n(){if(XAt)return Sxe;XAt=1;var t=A6n(),e=c6n();return Sxe=function n(o,i){var r=t(o);if(r!=="object"&&r!=="array")throw new Error("expected an object");var s=[];r==="object"&&(o=e(o,i),s={});for(var a in o)if(o.hasOwnProperty(a)){var A=o[a];t(A)==="object"||t(A)==="array"?s[a]=n(A,i):s[a]=A}return s},Sxe}var g6n=l6n();const u6n=uy(g6n);var Qxe={exports:{}},$At;function ZAt(){return $At||($At=1,(function(t){var e=Object.prototype.hasOwnProperty,n="~";function o(){}Object.create&&(o.prototype=Object.create(null),new o().__proto__||(n=!1));function i(s,a,A){this.fn=s,this.context=a,this.once=A||!1}function r(){this._events=new o,this._eventsCount=0}r.prototype.eventNames=function(){var a=[],A,c;if(this._eventsCount===0)return a;for(c in A=this._events)e.call(A,c)&&a.push(n?c.slice(1):c);return Object.getOwnPropertySymbols?a.concat(Object.getOwnPropertySymbols(A)):a},r.prototype.listeners=function(a,A){var c=n?n+a:a,l=this._events[c];if(A)return!!l;if(!l)return[];if(l.fn)return[l.fn];for(var g=0,u=l.length,h=new Array(u);g<u;g++)h[g]=l[g].fn;return h},r.prototype.emit=function(a,A,c,l,g,u){var h=n?n+a:a;if(!this._events[h])return!1;var d=this._events[h],p=arguments.length,m,_;if(d.fn){switch(d.once&&this.removeListener(a,d.fn,void 0,!0),p){case 1:return d.fn.call(d.context),!0;case 2:return d.fn.call(d.context,A),!0;case 3:return d.fn.call(d.context,A,c),!0;case 4:return d.fn.call(d.context,A,c,l),!0;case 5:return d.fn.call(d.context,A,c,l,g),!0;case 6:return d.fn.call(d.context,A,c,l,g,u),!0}for(_=1,m=new Array(p-1);_<p;_++)m[_-1]=arguments[_];d.fn.apply(d.context,m)}else{var f=d.length,I;for(_=0;_<f;_++)switch(d[_].once&&this.removeListener(a,d[_].fn,void 0,!0),p){case 1:d[_].fn.call(d[_].context);break;case 2:d[_].fn.call(d[_].context,A);break;case 3:d[_].fn.call(d[_].context,A,c);break;case 4:d[_].fn.call(d[_].context,A,c,l);break;default:if(!m)for(I=1,m=new Array(p-1);I<p;I++)m[I-1]=arguments[I];d[_].fn.apply(d[_].context,m)}}return!0},r.prototype.on=function(a,A,c){var l=new i(A,c||this),g=n?n+a:a;return this._events[g]?this._events[g].fn?this._events[g]=[this._events[g],l]:this._events[g].push(l):(this._events[g]=l,this._eventsCount++),this},r.prototype.once=function(a,A,c){var l=new i(A,c||this,!0),g=n?n+a:a;return this._events[g]?this._events[g].fn?this._events[g]=[this._events[g],l]:this._events[g].push(l):(this._events[g]=l,this._eventsCount++),this},r.prototype.removeListener=function(a,A,c,l){var g=n?n+a:a;if(!this._events[g])return this;if(!A)return--this._eventsCount===0?this._events=new o:delete this._events[g],this;var u=this._events[g];if(u.fn)u.fn===A&&(!l||u.once)&&(!c||u.context===c)&&(--this._eventsCount===0?this._events=new o:delete this._events[g]);else{for(var h=0,d=[],p=u.length;h<p;h++)(u[h].fn!==A||l&&!u[h].once||c&&u[h].context!==c)&&d.push(u[h]);d.length?this._events[g]=d.length===1?d[0]:d:--this._eventsCount===0?this._events=new o:delete this._events[g]}return this},r.prototype.removeAllListeners=function(a){var A;return a?(A=n?n+a:a,this._events[A]&&(--this._eventsCount===0?this._events=new o:delete this._events[A])):(this._events=new o,this._eventsCount=0),this},r.prototype.off=r.prototype.removeListener,r.prototype.addListener=r.prototype.on,r.prototype.setMaxListeners=function(){return this},r.prefixed=n,r.EventEmitter=r,t.exports=r})(Qxe)),Qxe.exports}var vxe,ect;function d6n(){if(ect)return vxe;ect=1;function t(c,l,g){return l in c?Object.defineProperty(c,l,{value:g,enumerable:!0,configurable:!0,writable:!0}):c[l]=g,c}var e=ZAt(),n=function(){},o={data:"state-data",cdata:"state-cdata",tagBegin:"state-tag-begin",tagName:"state-tag-name",tagEnd:"state-tag-end",attributeNameStart:"state-attribute-name-start",attributeName:"state-attribute-name",attributeNameEnd:"state-attribute-name-end",attributeValueBegin:"state-attribute-value-begin",attributeValue:"state-attribute-value"},i={lt:"action-lt",gt:"action-gt",space:"action-space",equal:"action-equal",quote:"action-quote",slash:"action-slash",char:"action-char",error:"action-error"},r={text:"text",openTag:"open-tag",closeTag:"close-tag",attributeName:"attribute-name",attributeValue:"attribute-value"},s={" ":i.space," ":i.space,"\n":i.space,"\r":i.space,"<":i.lt,">":i.gt,'"':i.quote,"'":i.quote,"=":i.equal,"/":i.slash},a=function(l){return s[l]||i.char},A=function(l){var g,u,h,d,p,m,_,f,I,C;l=Object.assign({debug:!1},l);var y=new e,x=o.data,E="",B="",S="",Q="",w="",M="",k=function(O,U){if(!(B[0]==="?"||B[0]==="!")){var Y={type:O,value:U};l.debug&&console.log("emit:",Y),y.emit("data",Y)}};y.stateMachine=(C={},t(C,o.data,(g={},t(g,i.lt,function(){E.trim()&&k(r.text,E),B="",w=!1,x=o.tagBegin}),t(g,i.char,function(F){E+=F}),g)),t(C,o.cdata,t({},i.char,function(F){E+=F,E.substr(-3)==="]]>"&&(k(r.text,E.slice(0,-3)),E="",x=o.data)})),t(C,o.tagBegin,(u={},t(u,i.space,n),t(u,i.char,function(F){B=F,x=o.tagName}),t(u,i.slash,function(){B="",w=!0}),u)),t(C,o.tagName,(h={},t(h,i.space,function(){w?x=o.tagEnd:(x=o.attributeNameStart,k(r.openTag,B))}),t(h,i.gt,function(){k(w?r.closeTag:r.openTag,B),E="",x=o.data}),t(h,i.slash,function(){x=o.tagEnd,k(r.openTag,B)}),t(h,i.char,function(F){B+=F,B==="![CDATA["&&(x=o.cdata,E="",B="")}),h)),t(C,o.tagEnd,(d={},t(d,i.gt,function(){k(r.closeTag,B),E="",x=o.data}),t(d,i.char,n),d)),t(C,o.attributeNameStart,(p={},t(p,i.char,function(F){S=F,x=o.attributeName}),t(p,i.gt,function(){E="",x=o.data}),t(p,i.space,n),t(p,i.slash,function(){w=!0,x=o.tagEnd}),p)),t(C,o.attributeName,(m={},t(m,i.space,function(){x=o.attributeNameEnd}),t(m,i.equal,function(){k(r.attributeName,S),x=o.attributeValueBegin}),t(m,i.gt,function(){Q="",k(r.attributeName,S),k(r.attributeValue,Q),E="",x=o.data}),t(m,i.slash,function(){w=!0,Q="",k(r.attributeName,S),k(r.attributeValue,Q),x=o.tagEnd}),t(m,i.char,function(F){S+=F}),m)),t(C,o.attributeNameEnd,(_={},t(_,i.space,n),t(_,i.equal,function(){k(r.attributeName,S),x=o.attributeValueBegin}),t(_,i.gt,function(){Q="",k(r.attributeName,S),k(r.attributeValue,Q),E="",x=o.data}),t(_,i.char,function(F){Q="",k(r.attributeName,S),k(r.attributeValue,Q),S=F,x=o.attributeName}),_)),t(C,o.attributeValueBegin,(f={},t(f,i.space,n),t(f,i.quote,function(F){M=F,Q="",x=o.attributeValue}),t(f,i.gt,function(){Q="",k(r.attributeValue,Q),E="",x=o.data}),t(f,i.char,function(F){M="",Q=F,x=o.attributeValue}),f)),t(C,o.attributeValue,(I={},t(I,i.space,function(F){M?Q+=F:(k(r.attributeValue,Q),x=o.attributeNameStart)}),t(I,i.quote,function(F){M===F?(k(r.attributeValue,Q),x=o.attributeNameStart):Q+=F}),t(I,i.gt,function(F){M?Q+=F:(k(r.attributeValue,Q),E="",x=o.data)}),t(I,i.slash,function(F){M?Q+=F:(k(r.attributeValue,Q),w=!0,x=o.tagEnd)}),t(I,i.char,function(F){Q+=F}),I)),C);var R=function(O){l.debug&&console.log(x,O);var U=y.stateMachine[x],Y=U[a(O)]||U[i.error]||U[i.char];Y(O)};return y.write=function(F){for(var O=F.length,U=0;U<O;U++)R(F[U])},y};return vxe={State:o,Action:i,Type:r,create:A},vxe}var wxe,tct;function h6n(){if(tct)return wxe;tct=1;var t=ZAt(),e=d6n(),n=e.Type,o={element:"element",text:"text"},i=function(A){return Object.assign({name:"",type:o.element,value:"",parent:null,attributes:{},children:[]},A)},r=function(A){A=Object.assign({stream:!1,parentNodes:!0,doneEvent:"done",tagPrefix:"tag:",emitTopLevelOnly:!1,debug:!1},A);var c=void 0,l=void 0,g=void 0,u=void 0,h=new t,d=function(m){switch(m.type){case n.openTag:if(g===null)g=l,g.name=m.value;else{var _=i({name:m.value,parent:g});g.children.push(_),g=_}break;case n.closeTag:var f=g.parent;if(A.parentNodes||(g.parent=null),g.name!==m.value)break;A.stream&&f===l&&(l.children=[],g.parent=null),(!A.emitTopLevelOnly||f===l)&&(h.emit(A.tagPrefix+g.name,g),h.emit("tag",g.name,g)),g===l&&(c.removeAllListeners("data"),h.emit(A.doneEvent,g),l=null),g=f;break;case n.text:g&&g.children.push(i({type:o.text,value:m.value,parent:A.parentNodes?g:null}));break;case n.attributeName:u=m.value,g.attributes[u]="";break;case n.attributeValue:g.attributes[u]=m.value;break}};return h.reset=function(){c=e.create({debug:A.debug}),c.on("data",d),l=i(),g=null,u="",h.parse=c.write},h.reset(),h},s=function(A,c){c=Object.assign({},c,{stream:!1,tagPrefix:":"});var l=r(c),g=void 0;return l.on("done",function(u){g=u}),l.parse(A),g};return wxe={parseSync:s,create:r,NodeType:o},wxe}var p6n=h6n(),m6n=function(e){var n=p6n.parseSync("<root>".concat(e,"</root>"),{parentNodes:!1}),o=n.children&&n.children.length>0&&n.children.every(function(i){return i.name==="svg"});if(o)return n.children.length===1?n.children[0]:n.children;throw Error("nothing to parse")},_6n=function(e){return u6n(e,function(n){return I6n(n)?n:f6n(n)})},f6n=function(e){return e.replace(/[-|:]([a-z])/gi,function(n,o){return o.toUpperCase()})},I6n=function(e){return/^(data|aria)(-\w+)/.test(e)},C6n=function(e){if(e){var n=String(e);return/[&<>]/.test(n)?"<![CDATA[".concat(n.replace(/]]>/,"]]]]><![CDATA[>"),"]]>"):n}return""},y6n=function(e){return String(e).replace(/&/g,"&amp;").replace(/'/g,"&apos;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;")},SV=function(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=n.transformNode,i=o===void 0?function(A){return A}:o,r=n.camelcase,s=r===void 0?!1:r,a=function(c){var l;return l=i(c),s&&(l=_6n(l)),l};return a(m6n(e))},nct=function t(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=n.transformAttr,i=o===void 0?function(h,d,p){return"".concat(h,'="').concat(p(d),'"')}:o,r=n.transformNode,s=r===void 0?function(h){return h}:r,a=n.selfClose,A=a===void 0?!0:a;if(Array.isArray(e))return e.map(function(h){return t(h,{transformAttr:i,selfClose:A,transformNode:s})}).join("");var c=s(e);if(c.type==="text")return C6n(c.value);var l="";for(var g in c.attributes){var u=i(g,c.attributes[g],y6n,c.name);l+=u?" ".concat(u):""}return c.children&&c.children.length>0||!A?"<".concat(c.name).concat(l,">").concat(t(c.children,{transformAttr:i,transformNode:s,selfClose:A}),"</").concat(c.name,">"):"<".concat(c.name).concat(l,"/>")},hQ=t=>{const e=Math.round(t*1e3)/1e3;return`${Number(e.toFixed(3))}mm`},oct=new Map([["T",1e12],["G",1e9],["M",1e6],["K",1e3],["k",1e3],["",1],["m",.001],["µ",1e-6],["μ",1e-6],["u",1e-6],["n",1e-9],["p",1e-12],["f",1e-15]]),x6n=[...oct.keys()];function ict(t){return oct.get(t)}var rct={Hz:{baseUnit:"Hz",variants:{MHz:1e6,kHz:1e3,Hz:1}},g:{baseUnit:"g",variants:{kg:1e3,g:1}},Ω:{baseUnit:"Ω",variants:{mΩ:.001,mohm:.001,mOhm:.001,milliohm:.001,Ω:1,ohm:1,Ohm:1,kΩ:1e3,KΩ:1e3,kohm:1e3,kOhm:1e3,KOhm:1e3,Kohm:1e3,MΩ:1e6,Mohm:1e6,MOhm:1e6,megohm:1e6,Megohm:1e6,GΩ:1e9,Gohm:1e9,GOhm:1e9,TΩ:1e12,Tohm:1e12,TOhm: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,μ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,μF:1e-6,uF:1e-6,mF:.001,F:1,kF:1e3,KF:1e3,MF:1e6}},H:{baseUnit:"H",variants:{pH:1e-12,nH:1e-9,µH:1e-6,μH:1e-6,uH:1e-6,mH:.001,H:1,kH:1e3,KH:1e3,MH:1e6}},ml:{baseUnit:"ml",variants:{ml:1,mL:1,l:1e3,L:1e3}},deg:{baseUnit:"deg",variants:{rad:180/Math.PI}},ms:{baseUnit:"ms",variants:{fs:1e-12,ps:1e-9,ns:1e-6,us:.001,µs:.001,μs:.001,ms:1,s:1e3}},mm:{baseUnit:"mm",variants:{nm:1e-6,µm:.001,μ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}}},Pxe=new Set;for(const[t,e]of Object.entries(rct)){Pxe.add(t);for(const n of Object.keys(e.variants))Pxe.add(n)}function E6n(t){for(const e of Object.values(rct)){if(t in e.variants)return{baseUnit:e.baseUnit,conversionFactor:e.variants[t]};for(const[n,o]of Object.entries(e.variants)){if(!t.endsWith(n))continue;const i=t.slice(0,-n.length),r=ict(i);if(r!=null)return{baseUnit:e.baseUnit,conversionFactor:r*o}}}return{baseUnit:t,conversionFactor:1}}function X1(t,e){if(t==null)return{parsedUnit:null,unitOfValue:null,value:null};if(typeof t=="string"&&t.match(/^-?[\d.]+$/))return{value:Number.parseFloat(t),parsedUnit:null,unitOfValue:null};if(typeof t=="number")return{value:t,parsedUnit:null,unitOfValue:null};if(typeof t=="object"&&"x"in t&&"y"in t){const c=X1(t.x,e),l=X1(t.x,e),g=X1(t.y,e);return l.value===null||g.value===null?{parsedUnit:null,unitOfValue:null,value:null}:{parsedUnit:c.parsedUnit,unitOfValue:c.unitOfValue,value:{x:l.value,y:g.value}}}const o=t.toString().split("").reverse().join("").match(/[^\d\s]+/)?.[0];if(!o)throw new Error(`Could not determine unit: "${t}"`);const i=o.split("").reverse().join(""),r=t.slice(0,-i.length),s=ict(i);if(e&&s!=null)return{parsedUnit:null,unitOfValue:e,value:Number.parseFloat(r)*s};if(s!=null&&!Pxe.has(i))return{parsedUnit:null,unitOfValue:null,value:Number.parseFloat(r)*s};const{baseUnit:a,conversionFactor:A}=E6n(i);return{parsedUnit:i,unitOfValue:a,value:A*Number.parseFloat(r)}}x6n.filter(t=>t!=="").sort((t,e)=>e.length-t.length).map(t=>t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).join("|");var Vk=[{value:1e12,symbol:"T"},{value:1e9,symbol:"G"},{value:1e6,symbol:"M"},{value:1e3,symbol:"k"},{value:1,symbol:""},{value:.001,symbol:"m"},{value:1e-6,symbol:"µ"},{value:1e-9,symbol:"n"},{value:1e-12,symbol:"p"}],B6n=Vk[Vk.length-1];function H_(t){if(t==null)return"";if(t===0)return"0";const e=Math.abs(t);let n=Vk.findIndex(s=>{const a=e/s.value;return a>=1&&a<1e3});n===-1&&(n=Vk.indexOf(B6n));let o=Vk[n],i=t/o.value;for(;n>0&&Math.abs(Number(i.toPrecision(3)))>=1e3;)n-=1,o=Vk[n],i=t/o.value;let r=i.toPrecision(3);return r.includes(".")&&!/\.0+$/.test(r)&&(r=r.replace(/0+$/,"")),r=r.replace(/\.0+$/,""),`${r}${o.symbol}`}var wl;(function(t){t.assertEqual=i=>{};function e(i){}t.assertIs=e;function n(i){throw new Error}t.assertNever=n,t.arrayToEnum=i=>{const r={};for(const s of i)r[s]=s;return r},t.getValidEnumValues=i=>{const r=t.objectKeys(i).filter(a=>typeof i[i[a]]!="number"),s={};for(const a of r)s[a]=i[a];return t.objectValues(s)},t.objectValues=i=>t.objectKeys(i).map(function(r){return i[r]}),t.objectKeys=typeof Object.keys=="function"?i=>Object.keys(i):i=>{const r=[];for(const s in i)Object.prototype.hasOwnProperty.call(i,s)&&r.push(s);return r},t.find=(i,r)=>{for(const s of i)if(r(s))return s},t.isInteger=typeof Number.isInteger=="function"?i=>Number.isInteger(i):i=>typeof i=="number"&&Number.isFinite(i)&&Math.floor(i)===i;function o(i,r=" | "){return i.map(s=>typeof s=="string"?`'${s}'`:s).join(r)}t.joinValues=o,t.jsonStringifyReplacer=(i,r)=>typeof r=="bigint"?r.toString():r})(wl||(wl={}));var sct;(function(t){t.mergeShapes=(e,n)=>({...e,...n})})(sct||(sct={}));const Sr=wl.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),pQ=t=>{switch(typeof t){case"undefined":return Sr.undefined;case"string":return Sr.string;case"number":return Number.isNaN(t)?Sr.nan:Sr.number;case"boolean":return Sr.boolean;case"function":return Sr.function;case"bigint":return Sr.bigint;case"symbol":return Sr.symbol;case"object":return Array.isArray(t)?Sr.array:t===null?Sr.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?Sr.promise:typeof Map<"u"&&t instanceof Map?Sr.map:typeof Set<"u"&&t instanceof Set?Sr.set:typeof Date<"u"&&t instanceof Date?Sr.date:Sr.object;default:return Sr.unknown}},lo=wl.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class m5 extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=o=>{this.issues=[...this.issues,o]},this.addIssues=(o=[])=>{this.issues=[...this.issues,...o]};const n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=e}format(e){const n=e||function(r){return r.message},o={_errors:[]},i=r=>{for(const s of r.issues)if(s.code==="invalid_union")s.unionErrors.map(i);else if(s.code==="invalid_return_type")i(s.returnTypeError);else if(s.code==="invalid_arguments")i(s.argumentsError);else if(s.path.length===0)o._errors.push(n(s));else{let a=o,A=0;for(;A<s.path.length;){const c=s.path[A];A===s.path.length-1?(a[c]=a[c]||{_errors:[]},a[c]._errors.push(n(s))):a[c]=a[c]||{_errors:[]},a=a[c],A++}}};return i(this),o}static assert(e){if(!(e instanceof m5))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,wl.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=n=>n.message){const n={},o=[];for(const i of this.issues)if(i.path.length>0){const r=i.path[0];n[r]=n[r]||[],n[r].push(e(i))}else o.push(e(i));return{formErrors:o,fieldErrors:n}}get formErrors(){return this.flatten()}}m5.create=t=>new m5(t);const QV=(t,e)=>{let n;switch(t.code){case lo.invalid_type:t.received===Sr.undefined?n="Required":n=`Expected ${t.expected}, received ${t.received}`;break;case lo.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(t.expected,wl.jsonStringifyReplacer)}`;break;case lo.unrecognized_keys:n=`Unrecognized key(s) in object: ${wl.joinValues(t.keys,", ")}`;break;case lo.invalid_union:n="Invalid input";break;case lo.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${wl.joinValues(t.options)}`;break;case lo.invalid_enum_value:n=`Invalid enum value. Expected ${wl.joinValues(t.options)}, received '${t.received}'`;break;case lo.invalid_arguments:n="Invalid function arguments";break;case lo.invalid_return_type:n="Invalid function return type";break;case lo.invalid_date:n="Invalid date";break;case lo.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(n=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?n=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?n=`Invalid input: must end with "${t.validation.endsWith}"`:wl.assertNever(t.validation):t.validation!=="regex"?n=`Invalid ${t.validation}`:n="Invalid";break;case lo.too_small:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="bigint"?n=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:n="Invalid input";break;case lo.too_big:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?n=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:n="Invalid input";break;case lo.custom:n="Invalid input";break;case lo.invalid_intersection_types:n="Intersection results could not be merged";break;case lo.not_multiple_of:n=`Number must be a multiple of ${t.multipleOf}`;break;case lo.not_finite:n="Number must be finite";break;default:n=e.defaultError,wl.assertNever(t)}return{message:n}};let b6n=QV;function Mxe(){return b6n}const Dxe=t=>{const{data:e,path:n,errorMaps:o,issueData:i}=t,r=[...n,...i.path||[]],s={...i,path:r};if(i.message!==void 0)return{...i,path:r,message:i.message};let a="";const A=o.filter(c=>!!c).slice().reverse();for(const c of A)a=c(s,{data:e,defaultError:a}).message;return{...i,path:r,message:a}};function rr(t,e){const n=Mxe(),o=Dxe({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,n,n===QV?void 0:QV].filter(i=>!!i)});t.common.issues.push(o)}class my{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,n){const o=[];for(const i of n){if(i.status==="aborted")return Zs;i.status==="dirty"&&e.dirty(),o.push(i.value)}return{status:e.value,value:o}}static async mergeObjectAsync(e,n){const o=[];for(const i of n){const r=await i.key,s=await i.value;o.push({key:r,value:s})}return my.mergeObjectSync(e,o)}static mergeObjectSync(e,n){const o={};for(const i of n){const{key:r,value:s}=i;if(r.status==="aborted"||s.status==="aborted")return Zs;r.status==="dirty"&&e.dirty(),s.status==="dirty"&&e.dirty(),r.value!=="__proto__"&&(typeof s.value<"u"||i.alwaysSet)&&(o[r.value]=s.value)}return{status:e.value,value:o}}}const Zs=Object.freeze({status:"aborted"}),vV=t=>({status:"dirty",value:t}),rx=t=>({status:"valid",value:t}),act=t=>t.status==="aborted",Act=t=>t.status==="dirty",zk=t=>t.status==="valid",bne=t=>typeof Promise<"u"&&t instanceof Promise;var is;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e?.message})(is||(is={}));class w9{constructor(e,n,o,i){this._cachedPath=[],this.parent=e,this.data=n,this._path=o,this._key=i}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 cct=(t,e)=>{if(zk(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const n=new m5(t.common.issues);return this._error=n,this._error}}};function EA(t){if(!t)return{};const{errorMap:e,invalid_type_error:n,required_error:o,description:i}=t;if(e&&(n||o))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:i}:{errorMap:(s,a)=>{const{message:A}=t;return s.code==="invalid_enum_value"?{message:A??a.defaultError}:typeof a.data>"u"?{message:A??o??a.defaultError}:s.code!=="invalid_type"?{message:a.defaultError}:{message:A??n??a.defaultError}},description:i}}class Bc{get description(){return this._def.description}_getType(e){return pQ(e.data)}_getOrReturnCtx(e,n){return n||{common:e.parent.common,data:e.data,parsedType:pQ(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new my,ctx:{common:e.parent.common,data:e.data,parsedType:pQ(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const n=this._parse(e);if(bne(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(e){const n=this._parse(e);return Promise.resolve(n)}parse(e,n){const o=this.safeParse(e,n);if(o.success)return o.data;throw o.error}safeParse(e,n){const o={common:{issues:[],async:n?.async??!1,contextualErrorMap:n?.errorMap},path:n?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:pQ(e)},i=this._parseSync({data:e,path:o.path,parent:o});return cct(o,i)}"~validate"(e){const n={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:pQ(e)};if(!this["~standard"].async)try{const o=this._parseSync({data:e,path:[],parent:n});return zk(o)?{value:o.value}:{issues:n.common.issues}}catch(o){o?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),n.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:n}).then(o=>zk(o)?{value:o.value}:{issues:n.common.issues})}async parseAsync(e,n){const o=await this.safeParseAsync(e,n);if(o.success)return o.data;throw o.error}async safeParseAsync(e,n){const o={common:{issues:[],contextualErrorMap:n?.errorMap,async:!0},path:n?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:pQ(e)},i=this._parse({data:e,path:o.path,parent:o}),r=await(bne(i)?i:Promise.resolve(i));return cct(o,r)}refine(e,n){const o=i=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(i):n;return this._refinement((i,r)=>{const s=e(i),a=()=>r.addIssue({code:lo.custom,...o(i)});return typeof Promise<"u"&&s instanceof Promise?s.then(A=>A?!0:(a(),!1)):s?!0:(a(),!1)})}refinement(e,n){return this._refinement((o,i)=>e(o)?!0:(i.addIssue(typeof n=="function"?n(o,i):n),!1))}_refinement(e){return new _Q({schema:this,typeName:Ea.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:n=>this["~validate"](n)}}optional(){return w8.create(this,this._def)}nullable(){return VM.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return M9.create(this)}promise(){return DV.create(this,this._def)}or(e){return vne.create([this,e],this._def)}and(e){return wne.create(this,e,this._def)}transform(e){return new _Q({...EA(this._def),schema:this,typeName:Ea.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const n=typeof e=="function"?e:()=>e;return new Dne({...EA(this._def),innerType:this,defaultValue:n,typeName:Ea.ZodDefault})}brand(){return new _ct({typeName:Ea.ZodBranded,type:this,...EA(this._def)})}catch(e){const n=typeof e=="function"?e:()=>e;return new Nne({...EA(this._def),innerType:this,catchValue:n,typeName:Ea.ZodCatch})}describe(e){const n=this.constructor;return new n({...this._def,description:e})}pipe(e){return Hxe.create(this,e)}readonly(){return Rne.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const S6n=/^c[^\s-]{8,}$/i,Q6n=/^[0-9a-z]+$/,v6n=/^[0-9A-HJKMNP-TV-Z]{26}$/i,w6n=/^[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,P6n=/^[a-z0-9_-]{21}$/i,M6n=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,D6n=/^[-+]?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)?)??$/,N6n=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,R6n="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let Nxe;const T6n=/^(?:(?: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])$/,k6n=/^(?:(?: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])$/,F6n=/^(([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]))$/,L6n=/^(([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])$/,H6n=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,O6n=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,lct="((\\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])))",G6n=new RegExp(`^${lct}$`);function gct(t){let e="[0-5]\\d";t.precision?e=`${e}\\.\\d{${t.precision}}`:t.precision==null&&(e=`${e}(\\.\\d+)?`);const n=t.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${n}`}function Y6n(t){return new RegExp(`^${gct(t)}$`)}function U6n(t){let e=`${lct}T${gct(t)}`;const n=[];return n.push(t.local?"Z?":"Z"),t.offset&&n.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${n.join("|")})`,new RegExp(`^${e}$`)}function K6n(t,e){return!!((e==="v4"||!e)&&T6n.test(t)||(e==="v6"||!e)&&F6n.test(t))}function V6n(t,e){if(!M6n.test(t))return!1;try{const[n]=t.split(".");if(!n)return!1;const o=n.replace(/-/g,"+").replace(/_/g,"/").padEnd(n.length+(4-n.length%4)%4,"="),i=JSON.parse(atob(o));return!(typeof i!="object"||i===null||"typ"in i&&i?.typ!=="JWT"||!i.alg||e&&i.alg!==e)}catch{return!1}}function z6n(t,e){return!!((e==="v4"||!e)&&k6n.test(t)||(e==="v6"||!e)&&L6n.test(t))}class P9 extends Bc{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==Sr.string){const r=this._getOrReturnCtx(e);return rr(r,{code:lo.invalid_type,expected:Sr.string,received:r.parsedType}),Zs}const o=new my;let i;for(const r of this._def.checks)if(r.kind==="min")e.data.length<r.value&&(i=this._getOrReturnCtx(e,i),rr(i,{code:lo.too_small,minimum:r.value,type:"string",inclusive:!0,exact:!1,message:r.message}),o.dirty());else if(r.kind==="max")e.data.length>r.value&&(i=this._getOrReturnCtx(e,i),rr(i,{code:lo.too_big,maximum:r.value,type:"string",inclusive:!0,exact:!1,message:r.message}),o.dirty());else if(r.kind==="length"){const s=e.data.length>r.value,a=e.data.length<r.value;(s||a)&&(i=this._getOrReturnCtx(e,i),s?rr(i,{code:lo.too_big,maximum:r.value,type:"string",inclusive:!0,exact:!0,message:r.message}):a&&rr(i,{code:lo.too_small,minimum:r.value,type:"string",inclusive:!0,exact:!0,message:r.message}),o.dirty())}else if(r.kind==="email")N6n.test(e.data)||(i=this._getOrReturnCtx(e,i),rr(i,{validation:"email",code:lo.invalid_string,message:r.message}),o.dirty());else if(r.kind==="emoji")Nxe||(Nxe=new RegExp(R6n,"u")),Nxe.test(e.data)||(i=this._getOrReturnCtx(e,i),rr(i,{validation:"emoji",code:lo.invalid_string,message:r.message}),o.dirty());else if(r.kind==="uuid")w6n.test(e.data)||(i=this._getOrReturnCtx(e,i),rr(i,{validation:"uuid",code:lo.invalid_string,message:r.message}),o.dirty());else if(r.kind==="nanoid")P6n.test(e.data)||(i=this._getOrReturnCtx(e,i),rr(i,{validation:"nanoid",code:lo.invalid_string,message:r.message}),o.dirty());else if(r.kind==="cuid")S6n.test(e.data)||(i=this._getOrReturnCtx(e,i),rr(i,{validation:"cuid",code:lo.invalid_string,message:r.message}),o.dirty());else if(r.kind==="cuid2")Q6n.test(e.data)||(i=this._getOrReturnCtx(e,i),rr(i,{validation:"cuid2",code:lo.invalid_string,message:r.message}),o.dirty());else if(r.kind==="ulid")v6n.test(e.data)||(i=this._getOrReturnCtx(e,i),rr(i,{validation:"ulid",code:lo.invalid_string,message:r.message}),o.dirty());else if(r.kind==="url")try{new URL(e.data)}catch{i=this._getOrReturnCtx(e,i),rr(i,{validation:"url",code:lo.invalid_string,message:r.message}),o.dirty()}else r.kind==="regex"?(r.regex.lastIndex=0,r.regex.test(e.data)||(i=this._getOrReturnCtx(e,i),rr(i,{validation:"regex",code:lo.invalid_string,message:r.message}),o.dirty())):r.kind==="trim"?e.data=e.data.trim():r.kind==="includes"?e.data.includes(r.value,r.position)||(i=this._getOrReturnCtx(e,i),rr(i,{code:lo.invalid_string,validation:{includes:r.value,position:r.position},message:r.message}),o.dirty()):r.kind==="toLowerCase"?e.data=e.data.toLowerCase():r.kind==="toUpperCase"?e.data=e.data.toUpperCase():r.kind==="startsWith"?e.data.startsWith(r.value)||(i=this._getOrReturnCtx(e,i),rr(i,{code:lo.invalid_string,validation:{startsWith:r.value},message:r.message}),o.dirty()):r.kind==="endsWith"?e.data.endsWith(r.value)||(i=this._getOrReturnCtx(e,i),rr(i,{code:lo.invalid_string,validation:{endsWith:r.value},message:r.message}),o.dirty()):r.kind==="datetime"?U6n(r).test(e.data)||(i=this._getOrReturnCtx(e,i),rr(i,{code:lo.invalid_string,validation:"datetime",message:r.message}),o.dirty()):r.kind==="date"?G6n.test(e.data)||(i=this._getOrReturnCtx(e,i),rr(i,{code:lo.invalid_string,validation:"date",message:r.message}),o.dirty()):r.kind==="time"?Y6n(r).test(e.data)||(i=this._getOrReturnCtx(e,i),rr(i,{code:lo.invalid_string,validation:"time",message:r.message}),o.dirty()):r.kind==="duration"?D6n.test(e.data)||(i=this._getOrReturnCtx(e,i),rr(i,{validation:"duration",code:lo.invalid_string,message:r.message}),o.dirty()):r.kind==="ip"?K6n(e.data,r.version)||(i=this._getOrReturnCtx(e,i),rr(i,{validation:"ip",code:lo.invalid_string,message:r.message}),o.dirty()):r.kind==="jwt"?V6n(e.data,r.alg)||(i=this._getOrReturnCtx(e,i),rr(i,{validation:"jwt",code:lo.invalid_string,message:r.message}),o.dirty()):r.kind==="cidr"?z6n(e.data,r.version)||(i=this._getOrReturnCtx(e,i),rr(i,{validation:"cidr",code:lo.invalid_string,message:r.message}),o.dirty()):r.kind==="base64"?H6n.test(e.data)||(i=this._getOrReturnCtx(e,i),rr(i,{validation:"base64",code:lo.invalid_string,message:r.message}),o.dirty()):r.kind==="base64url"?O6n.test(e.data)||(i=this._getOrReturnCtx(e,i),rr(i,{validation:"base64url",code:lo.invalid_string,message:r.message}),o.dirty()):wl.assertNever(r);return{status:o.value,value:e.data}}_regex(e,n,o){return this.refinement(i=>e.test(i),{validation:n,code:lo.invalid_string,...is.errToObj(o)})}_addCheck(e){return new P9({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...is.errToObj(e)})}url(e){return this._addCheck({kind:"url",...is.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...is.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...is.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...is.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...is.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...is.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...is.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...is.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...is.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...is.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...is.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...is.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?.precision>"u"?null:e?.precision,offset:e?.offset??!1,local:e?.local??!1,...is.errToObj(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?.precision>"u"?null:e?.precision,...is.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...is.errToObj(e)})}regex(e,n){return this._addCheck({kind:"regex",regex:e,...is.errToObj(n)})}includes(e,n){return this._addCheck({kind:"includes",value:e,position:n?.position,...is.errToObj(n?.message)})}startsWith(e,n){return this._addCheck({kind:"startsWith",value:e,...is.errToObj(n)})}endsWith(e,n){return this._addCheck({kind:"endsWith",value:e,...is.errToObj(n)})}min(e,n){return this._addCheck({kind:"min",value:e,...is.errToObj(n)})}max(e,n){return this._addCheck({kind:"max",value:e,...is.errToObj(n)})}length(e,n){return this._addCheck({kind:"length",value:e,...is.errToObj(n)})}nonempty(e){return this.min(1,is.errToObj(e))}trim(){return new P9({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new P9({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new P9({...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 n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxLength(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}}P9.create=t=>new P9({checks:[],typeName:Ea.ZodString,coerce:t?.coerce??!1,...EA(t)});function J6n(t,e){const n=(t.toString().split(".")[1]||"").length,o=(e.toString().split(".")[1]||"").length,i=n>o?n:o,r=Number.parseInt(t.toFixed(i).replace(".","")),s=Number.parseInt(e.toFixed(i).replace(".",""));return r%s/10**i}class YM extends Bc{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)!==Sr.number){const r=this._getOrReturnCtx(e);return rr(r,{code:lo.invalid_type,expected:Sr.number,received:r.parsedType}),Zs}let o;const i=new my;for(const r of this._def.checks)r.kind==="int"?wl.isInteger(e.data)||(o=this._getOrReturnCtx(e,o),rr(o,{code:lo.invalid_type,expected:"integer",received:"float",message:r.message}),i.dirty()):r.kind==="min"?(r.inclusive?e.data<r.value:e.data<=r.value)&&(o=this._getOrReturnCtx(e,o),rr(o,{code:lo.too_small,minimum:r.value,type:"number",inclusive:r.inclusive,exact:!1,message:r.message}),i.dirty()):r.kind==="max"?(r.inclusive?e.data>r.value:e.data>=r.value)&&(o=this._getOrReturnCtx(e,o),rr(o,{code:lo.too_big,maximum:r.value,type:"number",inclusive:r.inclusive,exact:!1,message:r.message}),i.dirty()):r.kind==="multipleOf"?J6n(e.data,r.value)!==0&&(o=this._getOrReturnCtx(e,o),rr(o,{code:lo.not_multiple_of,multipleOf:r.value,message:r.message}),i.dirty()):r.kind==="finite"?Number.isFinite(e.data)||(o=this._getOrReturnCtx(e,o),rr(o,{code:lo.not_finite,message:r.message}),i.dirty()):wl.assertNever(r);return{status:i.value,value:e.data}}gte(e,n){return this.setLimit("min",e,!0,is.toString(n))}gt(e,n){return this.setLimit("min",e,!1,is.toString(n))}lte(e,n){return this.setLimit("max",e,!0,is.toString(n))}lt(e,n){return this.setLimit("max",e,!1,is.toString(n))}setLimit(e,n,o,i){return new YM({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:o,message:is.toString(i)}]})}_addCheck(e){return new YM({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:is.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:is.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:is.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:is.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:is.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:is.toString(n)})}finite(e){return this._addCheck({kind:"finite",message:is.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:is.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:is.toString(e)})}get minValue(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&wl.isInteger(e.value))}get isFinite(){let e=null,n=null;for(const o of this._def.checks){if(o.kind==="finite"||o.kind==="int"||o.kind==="multipleOf")return!0;o.kind==="min"?(n===null||o.value>n)&&(n=o.value):o.kind==="max"&&(e===null||o.value<e)&&(e=o.value)}return Number.isFinite(n)&&Number.isFinite(e)}}YM.create=t=>new YM({checks:[],typeName:Ea.ZodNumber,coerce:t?.coerce||!1,...EA(t)});class UM extends Bc{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)!==Sr.bigint)return this._getInvalidInput(e);let o;const i=new my;for(const r of this._def.checks)r.kind==="min"?(r.inclusive?e.data<r.value:e.data<=r.value)&&(o=this._getOrReturnCtx(e,o),rr(o,{code:lo.too_small,type:"bigint",minimum:r.value,inclusive:r.inclusive,message:r.message}),i.dirty()):r.kind==="max"?(r.inclusive?e.data>r.value:e.data>=r.value)&&(o=this._getOrReturnCtx(e,o),rr(o,{code:lo.too_big,type:"bigint",maximum:r.value,inclusive:r.inclusive,message:r.message}),i.dirty()):r.kind==="multipleOf"?e.data%r.value!==BigInt(0)&&(o=this._getOrReturnCtx(e,o),rr(o,{code:lo.not_multiple_of,multipleOf:r.value,message:r.message}),i.dirty()):wl.assertNever(r);return{status:i.value,value:e.data}}_getInvalidInput(e){const n=this._getOrReturnCtx(e);return rr(n,{code:lo.invalid_type,expected:Sr.bigint,received:n.parsedType}),Zs}gte(e,n){return this.setLimit("min",e,!0,is.toString(n))}gt(e,n){return this.setLimit("min",e,!1,is.toString(n))}lte(e,n){return this.setLimit("max",e,!0,is.toString(n))}lt(e,n){return this.setLimit("max",e,!1,is.toString(n))}setLimit(e,n,o,i){return new UM({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:o,message:is.toString(i)}]})}_addCheck(e){return new UM({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:is.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:is.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:is.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:is.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:is.toString(n)})}get minValue(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}}UM.create=t=>new UM({checks:[],typeName:Ea.ZodBigInt,coerce:t?.coerce??!1,...EA(t)});class Sne extends Bc{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==Sr.boolean){const o=this._getOrReturnCtx(e);return rr(o,{code:lo.invalid_type,expected:Sr.boolean,received:o.parsedType}),Zs}return rx(e.data)}}Sne.create=t=>new Sne({typeName:Ea.ZodBoolean,coerce:t?.coerce||!1,...EA(t)});class Jk extends Bc{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==Sr.date){const r=this._getOrReturnCtx(e);return rr(r,{code:lo.invalid_type,expected:Sr.date,received:r.parsedType}),Zs}if(Number.isNaN(e.data.getTime())){const r=this._getOrReturnCtx(e);return rr(r,{code:lo.invalid_date}),Zs}const o=new my;let i;for(const r of this._def.checks)r.kind==="min"?e.data.getTime()<r.value&&(i=this._getOrReturnCtx(e,i),rr(i,{code:lo.too_small,message:r.message,inclusive:!0,exact:!1,minimum:r.value,type:"date"}),o.dirty()):r.kind==="max"?e.data.getTime()>r.value&&(i=this._getOrReturnCtx(e,i),rr(i,{code:lo.too_big,message:r.message,inclusive:!0,exact:!1,maximum:r.value,type:"date"}),o.dirty()):wl.assertNever(r);return{status:o.value,value:new Date(e.data.getTime())}}_addCheck(e){return new Jk({...this._def,checks:[...this._def.checks,e]})}min(e,n){return this._addCheck({kind:"min",value:e.getTime(),message:is.toString(n)})}max(e,n){return this._addCheck({kind:"max",value:e.getTime(),message:is.toString(n)})}get minDate(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e!=null?new Date(e):null}}Jk.create=t=>new Jk({checks:[],coerce:t?.coerce||!1,typeName:Ea.ZodDate,...EA(t)});class uct extends Bc{_parse(e){if(this._getType(e)!==Sr.symbol){const o=this._getOrReturnCtx(e);return rr(o,{code:lo.invalid_type,expected:Sr.symbol,received:o.parsedType}),Zs}return rx(e.data)}}uct.create=t=>new uct({typeName:Ea.ZodSymbol,...EA(t)});class Rxe extends Bc{_parse(e){if(this._getType(e)!==Sr.undefined){const o=this._getOrReturnCtx(e);return rr(o,{code:lo.invalid_type,expected:Sr.undefined,received:o.parsedType}),Zs}return rx(e.data)}}Rxe.create=t=>new Rxe({typeName:Ea.ZodUndefined,...EA(t)});class Qne extends Bc{_parse(e){if(this._getType(e)!==Sr.null){const o=this._getOrReturnCtx(e);return rr(o,{code:lo.invalid_type,expected:Sr.null,received:o.parsedType}),Zs}return rx(e.data)}}Qne.create=t=>new Qne({typeName:Ea.ZodNull,...EA(t)});class wV extends Bc{constructor(){super(...arguments),this._any=!0}_parse(e){return rx(e.data)}}wV.create=t=>new wV({typeName:Ea.ZodAny,...EA(t)});class Wk extends Bc{constructor(){super(...arguments),this._unknown=!0}_parse(e){return rx(e.data)}}Wk.create=t=>new Wk({typeName:Ea.ZodUnknown,...EA(t)});class mQ extends Bc{_parse(e){const n=this._getOrReturnCtx(e);return rr(n,{code:lo.invalid_type,expected:Sr.never,received:n.parsedType}),Zs}}mQ.create=t=>new mQ({typeName:Ea.ZodNever,...EA(t)});class dct extends Bc{_parse(e){if(this._getType(e)!==Sr.undefined){const o=this._getOrReturnCtx(e);return rr(o,{code:lo.invalid_type,expected:Sr.void,received:o.parsedType}),Zs}return rx(e.data)}}dct.create=t=>new dct({typeName:Ea.ZodVoid,...EA(t)});class M9 extends Bc{_parse(e){const{ctx:n,status:o}=this._processInputParams(e),i=this._def;if(n.parsedType!==Sr.array)return rr(n,{code:lo.invalid_type,expected:Sr.array,received:n.parsedType}),Zs;if(i.exactLength!==null){const s=n.data.length>i.exactLength.value,a=n.data.length<i.exactLength.value;(s||a)&&(rr(n,{code:s?lo.too_big:lo.too_small,minimum:a?i.exactLength.value:void 0,maximum:s?i.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:i.exactLength.message}),o.dirty())}if(i.minLength!==null&&n.data.length<i.minLength.value&&(rr(n,{code:lo.too_small,minimum:i.minLength.value,type:"array",inclusive:!0,exact:!1,message:i.minLength.message}),o.dirty()),i.maxLength!==null&&n.data.length>i.maxLength.value&&(rr(n,{code:lo.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,exact:!1,message:i.maxLength.message}),o.dirty()),n.common.async)return Promise.all([...n.data].map((s,a)=>i.type._parseAsync(new w9(n,s,n.path,a)))).then(s=>my.mergeArray(o,s));const r=[...n.data].map((s,a)=>i.type._parseSync(new w9(n,s,n.path,a)));return my.mergeArray(o,r)}get element(){return this._def.type}min(e,n){return new M9({...this._def,minLength:{value:e,message:is.toString(n)}})}max(e,n){return new M9({...this._def,maxLength:{value:e,message:is.toString(n)}})}length(e,n){return new M9({...this._def,exactLength:{value:e,message:is.toString(n)}})}nonempty(e){return this.min(1,e)}}M9.create=(t,e)=>new M9({type:t,minLength:null,maxLength:null,exactLength:null,typeName:Ea.ZodArray,...EA(e)});function jk(t){if(t instanceof Km){const e={};for(const n in t.shape){const o=t.shape[n];e[n]=w8.create(jk(o))}return new Km({...t._def,shape:()=>e})}else return t instanceof M9?new M9({...t._def,type:jk(t.element)}):t instanceof w8?w8.create(jk(t.unwrap())):t instanceof VM?VM.create(jk(t.unwrap())):t instanceof v8?v8.create(t.items.map(e=>jk(e))):t}class Km extends Bc{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(),n=wl.objectKeys(e);return this._cached={shape:e,keys:n},this._cached}_parse(e){if(this._getType(e)!==Sr.object){const c=this._getOrReturnCtx(e);return rr(c,{code:lo.invalid_type,expected:Sr.object,received:c.parsedType}),Zs}const{status:o,ctx:i}=this._processInputParams(e),{shape:r,keys:s}=this._getCached(),a=[];if(!(this._def.catchall instanceof mQ&&this._def.unknownKeys==="strip"))for(const c in i.data)s.includes(c)||a.push(c);const A=[];for(const c of s){const l=r[c],g=i.data[c];A.push({key:{status:"valid",value:c},value:l._parse(new w9(i,g,i.path,c)),alwaysSet:c in i.data})}if(this._def.catchall instanceof mQ){const c=this._def.unknownKeys;if(c==="passthrough")for(const l of a)A.push({key:{status:"valid",value:l},value:{status:"valid",value:i.data[l]}});else if(c==="strict")a.length>0&&(rr(i,{code:lo.unrecognized_keys,keys:a}),o.dirty());else if(c!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const c=this._def.catchall;for(const l of a){const g=i.data[l];A.push({key:{status:"valid",value:l},value:c._parse(new w9(i,g,i.path,l)),alwaysSet:l in i.data})}}return i.common.async?Promise.resolve().then(async()=>{const c=[];for(const l of A){const g=await l.key,u=await l.value;c.push({key:g,value:u,alwaysSet:l.alwaysSet})}return c}).then(c=>my.mergeObjectSync(o,c)):my.mergeObjectSync(o,A)}get shape(){return this._def.shape()}strict(e){return is.errToObj,new Km({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(n,o)=>{const i=this._def.errorMap?.(n,o).message??o.defaultError;return n.code==="unrecognized_keys"?{message:is.errToObj(e).message??i}:{message:i}}}:{}})}strip(){return new Km({...this._def,unknownKeys:"strip"})}passthrough(){return new Km({...this._def,unknownKeys:"passthrough"})}extend(e){return new Km({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new Km({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:Ea.ZodObject})}setKey(e,n){return this.augment({[e]:n})}catchall(e){return new Km({...this._def,catchall:e})}pick(e){const n={};for(const o of wl.objectKeys(e))e[o]&&this.shape[o]&&(n[o]=this.shape[o]);return new Km({...this._def,shape:()=>n})}omit(e){const n={};for(const o of wl.objectKeys(this.shape))e[o]||(n[o]=this.shape[o]);return new Km({...this._def,shape:()=>n})}deepPartial(){return jk(this)}partial(e){const n={};for(const o of wl.objectKeys(this.shape)){const i=this.shape[o];e&&!e[o]?n[o]=i:n[o]=i.optional()}return new Km({...this._def,shape:()=>n})}required(e){const n={};for(const o of wl.objectKeys(this.shape))if(e&&!e[o])n[o]=this.shape[o];else{let r=this.shape[o];for(;r instanceof w8;)r=r._def.innerType;n[o]=r}return new Km({...this._def,shape:()=>n})}keyof(){return pct(wl.objectKeys(this.shape))}}Km.create=(t,e)=>new Km({shape:()=>t,unknownKeys:"strip",catchall:mQ.create(),typeName:Ea.ZodObject,...EA(e)}),Km.strictCreate=(t,e)=>new Km({shape:()=>t,unknownKeys:"strict",catchall:mQ.create(),typeName:Ea.ZodObject,...EA(e)}),Km.lazycreate=(t,e)=>new Km({shape:t,unknownKeys:"strip",catchall:mQ.create(),typeName:Ea.ZodObject,...EA(e)});class vne extends Bc{_parse(e){const{ctx:n}=this._processInputParams(e),o=this._def.options;function i(r){for(const a of r)if(a.result.status==="valid")return a.result;for(const a of r)if(a.result.status==="dirty")return n.common.issues.push(...a.ctx.common.issues),a.result;const s=r.map(a=>new m5(a.ctx.common.issues));return rr(n,{code:lo.invalid_union,unionErrors:s}),Zs}if(n.common.async)return Promise.all(o.map(async r=>{const s={...n,common:{...n.common,issues:[]},parent:null};return{result:await r._parseAsync({data:n.data,path:n.path,parent:s}),ctx:s}})).then(i);{let r;const s=[];for(const A of o){const c={...n,common:{...n.common,issues:[]},parent:null},l=A._parseSync({data:n.data,path:n.path,parent:c});if(l.status==="valid")return l;l.status==="dirty"&&!r&&(r={result:l,ctx:c}),c.common.issues.length&&s.push(c.common.issues)}if(r)return n.common.issues.push(...r.ctx.common.issues),r.result;const a=s.map(A=>new m5(A));return rr(n,{code:lo.invalid_union,unionErrors:a}),Zs}}get options(){return this._def.options}}vne.create=(t,e)=>new vne({options:t,typeName:Ea.ZodUnion,...EA(e)});const Q8=t=>t instanceof Fxe?Q8(t.schema):t instanceof _Q?Q8(t.innerType()):t instanceof Mne?[t.value]:t instanceof KM?t.options:t instanceof Lxe?wl.objectValues(t.enum):t instanceof Dne?Q8(t._def.innerType):t instanceof Rxe?[void 0]:t instanceof Qne?[null]:t instanceof w8?[void 0,...Q8(t.unwrap())]:t instanceof VM?[null,...Q8(t.unwrap())]:t instanceof _ct||t instanceof Rne?Q8(t.unwrap()):t instanceof Nne?Q8(t._def.innerType):[];class Txe extends Bc{_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==Sr.object)return rr(n,{code:lo.invalid_type,expected:Sr.object,received:n.parsedType}),Zs;const o=this.discriminator,i=n.data[o],r=this.optionsMap.get(i);return r?n.common.async?r._parseAsync({data:n.data,path:n.path,parent:n}):r._parseSync({data:n.data,path:n.path,parent:n}):(rr(n,{code:lo.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[o]}),Zs)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,n,o){const i=new Map;for(const r of n){const s=Q8(r.shape[e]);if(!s.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(const a of s){if(i.has(a))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(a)}`);i.set(a,r)}}return new Txe({typeName:Ea.ZodDiscriminatedUnion,discriminator:e,options:n,optionsMap:i,...EA(o)})}}function kxe(t,e){const n=pQ(t),o=pQ(e);if(t===e)return{valid:!0,data:t};if(n===Sr.object&&o===Sr.object){const i=wl.objectKeys(e),r=wl.objectKeys(t).filter(a=>i.indexOf(a)!==-1),s={...t,...e};for(const a of r){const A=kxe(t[a],e[a]);if(!A.valid)return{valid:!1};s[a]=A.data}return{valid:!0,data:s}}else if(n===Sr.array&&o===Sr.array){if(t.length!==e.length)return{valid:!1};const i=[];for(let r=0;r<t.length;r++){const s=t[r],a=e[r],A=kxe(s,a);if(!A.valid)return{valid:!1};i.push(A.data)}return{valid:!0,data:i}}else return n===Sr.date&&o===Sr.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}class wne extends Bc{_parse(e){const{status:n,ctx:o}=this._processInputParams(e),i=(r,s)=>{if(act(r)||act(s))return Zs;const a=kxe(r.value,s.value);return a.valid?((Act(r)||Act(s))&&n.dirty(),{status:n.value,value:a.data}):(rr(o,{code:lo.invalid_intersection_types}),Zs)};return o.common.async?Promise.all([this._def.left._parseAsync({data:o.data,path:o.path,parent:o}),this._def.right._parseAsync({data:o.data,path:o.path,parent:o})]).then(([r,s])=>i(r,s)):i(this._def.left._parseSync({data:o.data,path:o.path,parent:o}),this._def.right._parseSync({data:o.data,path:o.path,parent:o}))}}wne.create=(t,e,n)=>new wne({left:t,right:e,typeName:Ea.ZodIntersection,...EA(n)});class v8 extends Bc{_parse(e){const{status:n,ctx:o}=this._processInputParams(e);if(o.parsedType!==Sr.array)return rr(o,{code:lo.invalid_type,expected:Sr.array,received:o.parsedType}),Zs;if(o.data.length<this._def.items.length)return rr(o,{code:lo.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),Zs;!this._def.rest&&o.data.length>this._def.items.length&&(rr(o,{code:lo.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());const r=[...o.data].map((s,a)=>{const A=this._def.items[a]||this._def.rest;return A?A._parse(new w9(o,s,o.path,a)):null}).filter(s=>!!s);return o.common.async?Promise.all(r).then(s=>my.mergeArray(n,s)):my.mergeArray(n,r)}get items(){return this._def.items}rest(e){return new v8({...this._def,rest:e})}}v8.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new v8({items:t,typeName:Ea.ZodTuple,rest:null,...EA(e)})};class Pne extends Bc{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:n,ctx:o}=this._processInputParams(e);if(o.parsedType!==Sr.object)return rr(o,{code:lo.invalid_type,expected:Sr.object,received:o.parsedType}),Zs;const i=[],r=this._def.keyType,s=this._def.valueType;for(const a in o.data)i.push({key:r._parse(new w9(o,a,o.path,a)),value:s._parse(new w9(o,o.data[a],o.path,a)),alwaysSet:a in o.data});return o.common.async?my.mergeObjectAsync(n,i):my.mergeObjectSync(n,i)}get element(){return this._def.valueType}static create(e,n,o){return n instanceof Bc?new Pne({keyType:e,valueType:n,typeName:Ea.ZodRecord,...EA(o)}):new Pne({keyType:P9.create(),valueType:e,typeName:Ea.ZodRecord,...EA(n)})}}class hct extends Bc{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:n,ctx:o}=this._processInputParams(e);if(o.parsedType!==Sr.map)return rr(o,{code:lo.invalid_type,expected:Sr.map,received:o.parsedType}),Zs;const i=this._def.keyType,r=this._def.valueType,s=[...o.data.entries()].map(([a,A],c)=>({key:i._parse(new w9(o,a,o.path,[c,"key"])),value:r._parse(new w9(o,A,o.path,[c,"value"]))}));if(o.common.async){const a=new Map;return Promise.resolve().then(async()=>{for(const A of s){const c=await A.key,l=await A.value;if(c.status==="aborted"||l.status==="aborted")return Zs;(c.status==="dirty"||l.status==="dirty")&&n.dirty(),a.set(c.value,l.value)}return{status:n.value,value:a}})}else{const a=new Map;for(const A of s){const c=A.key,l=A.value;if(c.status==="aborted"||l.status==="aborted")return Zs;(c.status==="dirty"||l.status==="dirty")&&n.dirty(),a.set(c.value,l.value)}return{status:n.value,value:a}}}}hct.create=(t,e,n)=>new hct({valueType:e,keyType:t,typeName:Ea.ZodMap,...EA(n)});class PV extends Bc{_parse(e){const{status:n,ctx:o}=this._processInputParams(e);if(o.parsedType!==Sr.set)return rr(o,{code:lo.invalid_type,expected:Sr.set,received:o.parsedType}),Zs;const i=this._def;i.minSize!==null&&o.data.size<i.minSize.value&&(rr(o,{code:lo.too_small,minimum:i.minSize.value,type:"set",inclusive:!0,exact:!1,message:i.minSize.message}),n.dirty()),i.maxSize!==null&&o.data.size>i.maxSize.value&&(rr(o,{code:lo.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),n.dirty());const r=this._def.valueType;function s(A){const c=new Set;for(const l of A){if(l.status==="aborted")return Zs;l.status==="dirty"&&n.dirty(),c.add(l.value)}return{status:n.value,value:c}}const a=[...o.data.values()].map((A,c)=>r._parse(new w9(o,A,o.path,c)));return o.common.async?Promise.all(a).then(A=>s(A)):s(a)}min(e,n){return new PV({...this._def,minSize:{value:e,message:is.toString(n)}})}max(e,n){return new PV({...this._def,maxSize:{value:e,message:is.toString(n)}})}size(e,n){return this.min(e,n).max(e,n)}nonempty(e){return this.min(1,e)}}PV.create=(t,e)=>new PV({valueType:t,minSize:null,maxSize:null,typeName:Ea.ZodSet,...EA(e)});class MV extends Bc{constructor(){super(...arguments),this.validate=this.implement}_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==Sr.function)return rr(n,{code:lo.invalid_type,expected:Sr.function,received:n.parsedType}),Zs;function o(a,A){return Dxe({data:a,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,Mxe(),QV].filter(c=>!!c),issueData:{code:lo.invalid_arguments,argumentsError:A}})}function i(a,A){return Dxe({data:a,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,Mxe(),QV].filter(c=>!!c),issueData:{code:lo.invalid_return_type,returnTypeError:A}})}const r={errorMap:n.common.contextualErrorMap},s=n.data;if(this._def.returns instanceof DV){const a=this;return rx(async function(...A){const c=new m5([]),l=await a._def.args.parseAsync(A,r).catch(h=>{throw c.addIssue(o(A,h)),c}),g=await Reflect.apply(s,this,l);return await a._def.returns._def.type.parseAsync(g,r).catch(h=>{throw c.addIssue(i(g,h)),c})})}else{const a=this;return rx(function(...A){const c=a._def.args.safeParse(A,r);if(!c.success)throw new m5([o(A,c.error)]);const l=Reflect.apply(s,this,c.data),g=a._def.returns.safeParse(l,r);if(!g.success)throw new m5([i(l,g.error)]);return g.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new MV({...this._def,args:v8.create(e).rest(Wk.create())})}returns(e){return new MV({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,n,o){return new MV({args:e||v8.create([]).rest(Wk.create()),returns:n||Wk.create(),typeName:Ea.ZodFunction,...EA(o)})}}class Fxe extends Bc{get schema(){return this._def.getter()}_parse(e){const{ctx:n}=this._processInputParams(e);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}}Fxe.create=(t,e)=>new Fxe({getter:t,typeName:Ea.ZodLazy,...EA(e)});class Mne extends Bc{_parse(e){if(e.data!==this._def.value){const n=this._getOrReturnCtx(e);return rr(n,{received:n.data,code:lo.invalid_literal,expected:this._def.value}),Zs}return{status:"valid",value:e.data}}get value(){return this._def.value}}Mne.create=(t,e)=>new Mne({value:t,typeName:Ea.ZodLiteral,...EA(e)});function pct(t,e){return new KM({values:t,typeName:Ea.ZodEnum,...EA(e)})}class KM extends Bc{_parse(e){if(typeof e.data!="string"){const n=this._getOrReturnCtx(e),o=this._def.values;return rr(n,{expected:wl.joinValues(o),received:n.parsedType,code:lo.invalid_type}),Zs}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){const n=this._getOrReturnCtx(e),o=this._def.values;return rr(n,{received:n.data,code:lo.invalid_enum_value,options:o}),Zs}return rx(e.data)}get options(){return this._def.values}get enum(){const e={};for(const n of this._def.values)e[n]=n;return e}get Values(){const e={};for(const n of this._def.values)e[n]=n;return e}get Enum(){const e={};for(const n of this._def.values)e[n]=n;return e}extract(e,n=this._def){return KM.create(e,{...this._def,...n})}exclude(e,n=this._def){return KM.create(this.options.filter(o=>!e.includes(o)),{...this._def,...n})}}KM.create=pct;class Lxe extends Bc{_parse(e){const n=wl.getValidEnumValues(this._def.values),o=this._getOrReturnCtx(e);if(o.parsedType!==Sr.string&&o.parsedType!==Sr.number){const i=wl.objectValues(n);return rr(o,{expected:wl.joinValues(i),received:o.parsedType,code:lo.invalid_type}),Zs}if(this._cache||(this._cache=new Set(wl.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){const i=wl.objectValues(n);return rr(o,{received:o.data,code:lo.invalid_enum_value,options:i}),Zs}return rx(e.data)}get enum(){return this._def.values}}Lxe.create=(t,e)=>new Lxe({values:t,typeName:Ea.ZodNativeEnum,...EA(e)});class DV extends Bc{unwrap(){return this._def.type}_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==Sr.promise&&n.common.async===!1)return rr(n,{code:lo.invalid_type,expected:Sr.promise,received:n.parsedType}),Zs;const o=n.parsedType===Sr.promise?n.data:Promise.resolve(n.data);return rx(o.then(i=>this._def.type.parseAsync(i,{path:n.path,errorMap:n.common.contextualErrorMap})))}}DV.create=(t,e)=>new DV({type:t,typeName:Ea.ZodPromise,...EA(e)});class _Q extends Bc{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Ea.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:n,ctx:o}=this._processInputParams(e),i=this._def.effect||null,r={addIssue:s=>{rr(o,s),s.fatal?n.abort():n.dirty()},get path(){return o.path}};if(r.addIssue=r.addIssue.bind(r),i.type==="preprocess"){const s=i.transform(o.data,r);if(o.common.async)return Promise.resolve(s).then(async a=>{if(n.value==="aborted")return Zs;const A=await this._def.schema._parseAsync({data:a,path:o.path,parent:o});return A.status==="aborted"?Zs:A.status==="dirty"||n.value==="dirty"?vV(A.value):A});{if(n.value==="aborted")return Zs;const a=this._def.schema._parseSync({data:s,path:o.path,parent:o});return a.status==="aborted"?Zs:a.status==="dirty"||n.value==="dirty"?vV(a.value):a}}if(i.type==="refinement"){const s=a=>{const A=i.refinement(a,r);if(o.common.async)return Promise.resolve(A);if(A instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return a};if(o.common.async===!1){const a=this._def.schema._parseSync({data:o.data,path:o.path,parent:o});return a.status==="aborted"?Zs:(a.status==="dirty"&&n.dirty(),s(a.value),{status:n.value,value:a.value})}else return this._def.schema._parseAsync({data:o.data,path:o.path,parent:o}).then(a=>a.status==="aborted"?Zs:(a.status==="dirty"&&n.dirty(),s(a.value).then(()=>({status:n.value,value:a.value}))))}if(i.type==="transform")if(o.common.async===!1){const s=this._def.schema._parseSync({data:o.data,path:o.path,parent:o});if(!zk(s))return Zs;const a=i.transform(s.value,r);if(a instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:a}}else return this._def.schema._parseAsync({data:o.data,path:o.path,parent:o}).then(s=>zk(s)?Promise.resolve(i.transform(s.value,r)).then(a=>({status:n.value,value:a})):Zs);wl.assertNever(i)}}_Q.create=(t,e,n)=>new _Q({schema:t,typeName:Ea.ZodEffects,effect:e,...EA(n)}),_Q.createWithPreprocess=(t,e,n)=>new _Q({schema:e,effect:{type:"preprocess",transform:t},typeName:Ea.ZodEffects,...EA(n)});class w8 extends Bc{_parse(e){return this._getType(e)===Sr.undefined?rx(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}w8.create=(t,e)=>new w8({innerType:t,typeName:Ea.ZodOptional,...EA(e)});class VM extends Bc{_parse(e){return this._getType(e)===Sr.null?rx(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}VM.create=(t,e)=>new VM({innerType:t,typeName:Ea.ZodNullable,...EA(e)});class Dne extends Bc{_parse(e){const{ctx:n}=this._processInputParams(e);let o=n.data;return n.parsedType===Sr.undefined&&(o=this._def.defaultValue()),this._def.innerType._parse({data:o,path:n.path,parent:n})}removeDefault(){return this._def.innerType}}Dne.create=(t,e)=>new Dne({innerType:t,typeName:Ea.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...EA(e)});class Nne extends Bc{_parse(e){const{ctx:n}=this._processInputParams(e),o={...n,common:{...n.common,issues:[]}},i=this._def.innerType._parse({data:o.data,path:o.path,parent:{...o}});return bne(i)?i.then(r=>({status:"valid",value:r.status==="valid"?r.value:this._def.catchValue({get error(){return new m5(o.common.issues)},input:o.data})})):{status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new m5(o.common.issues)},input:o.data})}}removeCatch(){return this._def.innerType}}Nne.create=(t,e)=>new Nne({innerType:t,typeName:Ea.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...EA(e)});class mct extends Bc{_parse(e){if(this._getType(e)!==Sr.nan){const o=this._getOrReturnCtx(e);return rr(o,{code:lo.invalid_type,expected:Sr.nan,received:o.parsedType}),Zs}return{status:"valid",value:e.data}}}mct.create=t=>new mct({typeName:Ea.ZodNaN,...EA(t)});class _ct extends Bc{_parse(e){const{ctx:n}=this._processInputParams(e),o=n.data;return this._def.type._parse({data:o,path:n.path,parent:n})}unwrap(){return this._def.type}}class Hxe extends Bc{_parse(e){const{status:n,ctx:o}=this._processInputParams(e);if(o.common.async)return(async()=>{const r=await this._def.in._parseAsync({data:o.data,path:o.path,parent:o});return r.status==="aborted"?Zs:r.status==="dirty"?(n.dirty(),vV(r.value)):this._def.out._parseAsync({data:r.value,path:o.path,parent:o})})();{const i=this._def.in._parseSync({data:o.data,path:o.path,parent:o});return i.status==="aborted"?Zs:i.status==="dirty"?(n.dirty(),{status:"dirty",value:i.value}):this._def.out._parseSync({data:i.value,path:o.path,parent:o})}}static create(e,n){return new Hxe({in:e,out:n,typeName:Ea.ZodPipeline})}}class Rne extends Bc{_parse(e){const n=this._def.innerType._parse(e),o=i=>(zk(i)&&(i.value=Object.freeze(i.value)),i);return bne(n)?n.then(i=>o(i)):o(n)}unwrap(){return this._def.innerType}}Rne.create=(t,e)=>new Rne({innerType:t,typeName:Ea.ZodReadonly,...EA(e)});function fct(t,e){const n=typeof t=="function"?t(e):typeof t=="string"?{message:t}:t;return typeof n=="string"?{message:n}:n}function P0(t,e={},n){return t?wV.create().superRefine((o,i)=>{const r=t(o);if(r instanceof Promise)return r.then(s=>{if(!s){const a=fct(e,o),A=a.fatal??n??!0;i.addIssue({code:"custom",...a,fatal:A})}});if(!r){const s=fct(e,o),a=s.fatal??n??!0;i.addIssue({code:"custom",...s,fatal:a})}}):wV.create()}var Ea;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(Ea||(Ea={}));const Z=P9.create,_t=YM.create;UM.create;const je=Sne.create;Jk.create;const Ict=Qne.create,ud=wV.create,Oxe=Wk.create;mQ.create;const dn=M9.create,Pt=Km.create,xo=vne.create,_y=Txe.create;wne.create;const fQ=v8.create,bc=Pne.create,IQ=MV.create,qe=Mne.create,Kn=KM.create,CQ=DV.create;w8.create,VM.create;const Cct=_Q.createWithPreprocess,_5={string:(t=>P9.create({...t,coerce:!0})),number:(t=>YM.create({...t,coerce:!0})),boolean:(t=>Sne.create({...t,coerce:!0})),bigint:(t=>UM.create({...t,coerce:!0})),date:(t=>Jk.create({...t,coerce:!0}))},W6n=Zs;var P8=Z().or(_t()).transform(t=>X1(t,"Ω").value),zM=Z().or(_t()).transform(t=>X1(t,"F").value).transform(t=>Number.parseFloat(t.toPrecision(12))),Tne=Z().or(_t()).transform(t=>X1(t,"H").value),O_=Z().or(_t()).transform(t=>X1(t,"V").value),ce=Z().or(_t()).transform(t=>X1(t).value),fy=Z().or(_t()).transform(t=>X1(t,"Hz").value),lt=ce,R3=Z().or(_t()).transform(t=>X1(t,"A").value),qk=Z().or(_t()).transform(t=>X1(t).value),j6n=qk,Pl=qk,yct=Z().datetime(),oA=Z().or(_t()).transform(t=>typeof t=="number"?t:t.endsWith("deg")?Number.parseFloat(t.split("deg")[0]):t.endsWith("rad")?Number.parseFloat(t.split("rad")[0])*180/Math.PI:Number.parseFloat(t)),xct=_t().or(Z().endsWith("mAh")).transform(t=>{if(typeof t=="string"){const e=t.replace("mAh",""),n=Number.parseFloat(e);if(Number.isNaN(n))throw new Error("Invalid capacity");return n}return t}).describe("Battery capacity in mAh"),Ti=Pt({x:lt,y:lt}),q6n=Ti,D9=Pt({x:lt,y:lt,z:lt}),X6n=D9,kne=Pt({width:_t(),height:_t()}),$6n=t=>{const e="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";return Array.from({length:t},()=>e[Math.floor(Math.random()*e.length)]).join("")},so=t=>Z().optional().default(()=>`${t}_${$6n(10)}`),M8=Kn(["top_left","top_center","top_right","center_left","center","center_right","bottom_left","bottom_center","bottom_right"]),Z6n=Kn(["top_silkscreen","bottom_silkscreen","top_copper","bottom_copper","top_soldermask","bottom_soldermask","top_fabrication_note","bottom_fabrication_note","top_user_note","bottom_user_note","top_courtyard","bottom_courtyard","inner1_copper","inner2_copper","inner3_copper","inner4_copper","inner5_copper","inner6_copper","inner7_copper","inner8_copper","edge_cuts","drill"]),Fne=Pt({project_relative_path:Z(),url:Z(),mimetype:Z()}),Lne=Ti.extend({rotation:oA.optional()}),Gxe=Pt({size:Ti.optional(),thickness:lt.optional()}),Ect=Pt({font:Gxe.optional()}),NV=Pt({value:Z(),at:Lne.optional(),layer:Z().optional(),uuid:Z().optional(),hide:je().optional(),effects:Ect.optional()}),Bct=Pt({Reference:NV.optional(),Value:NV.optional(),Datasheet:NV.optional(),Description:NV.optional()}),bct=Pt({through_hole:je().optional(),smd:je().optional(),exclude_from_pos_files:je().optional(),exclude_from_bom:je().optional()}),Sct=Pt({name:Z(),type:Z(),shape:Z().optional(),at:Lne.optional(),size:Ti.optional(),drill:lt.optional(),layers:dn(Z()).optional(),removeUnusedLayers:je().optional(),uuid:Z().optional()}),Qct=Pt({path:Z(),offset:D9.optional(),scale:D9.optional(),rotate:D9.optional()}),vct=Pt({footprintName:Z().optional(),version:xo([_t(),Z()]).optional(),generator:Z().optional(),generatorVersion:xo([_t(),Z()]).optional(),layer:Z().optional(),properties:Bct.optional(),attributes:bct.optional(),pads:dn(Sct).optional(),embeddedFonts:je().optional(),model:Qct.optional()}),wct=Pt({hide:je().optional()}),Pct=Pt({offset:lt.optional(),hide:je().optional()}),Mct=Pt({font:Gxe.optional(),justify:xo([Z(),dn(Z())]).optional(),hide:je().optional()}),yQ=Pt({value:Z(),id:xo([_t(),Z()]).optional(),at:Lne.optional(),effects:Mct.optional()}),Dct=Pt({Reference:yQ.optional(),Value:yQ.optional(),Footprint:yQ.optional(),Datasheet:yQ.optional(),Description:yQ.optional(),ki_keywords:yQ.optional(),ki_fp_filters:yQ.optional()}),Nct=Pt({symbolName:Z().optional(),extends:Z().optional(),pinNumbers:wct.optional(),pinNames:Pct.optional(),excludeFromSim:je().optional(),inBom:je().optional(),onBoard:je().optional(),properties:Dct.optional(),embeddedFonts:je().optional()}),Ml=Pt({error_type:Z(),message:Z(),is_fatal:je().optional()}),JM=Kn(["jlcpcb","macrofab","pcbway","digikey","mouser","lcsc"]),Bg=Pt({type:qe("source_component"),ftype:Z().optional(),source_component_id:Z(),name:Z(),manufacturer_part_number:Z().optional(),supplier_part_numbers:bc(JM,dn(Z())).optional(),display_value:Z().optional(),display_name:Z().optional(),are_pins_interchangeable:je().optional(),internally_connected_source_port_ids:dn(dn(Z())).optional(),source_group_id:Z().optional(),subcircuit_id:Z().optional()}),Yxe=Bg.extend({ftype:qe("simple_capacitor"),capacitance:zM,max_voltage_rating:O_.optional(),display_capacitance:Z().optional(),max_decoupling_trace_length:lt.optional()}),Uxe=Bg.extend({ftype:qe("simple_resistor"),resistance:P8,display_resistance:Z().optional()}),Hne=Bg.extend({ftype:qe("simple_diode")}),Rct=Bg.extend({ftype:qe("simple_fiducial")}),Kxe=Hne.extend({ftype:qe("simple_led"),color:Z().optional(),wavelength:Z().optional()}),Tct=Bg.extend({ftype:qe("simple_ground")}),Vxe=Bg.extend({ftype:qe("simple_chip")}),zxe=Bg.extend({ftype:qe("simple_power_source"),voltage:O_}),kct=Bg.extend({ftype:qe("simple_current_source"),current:R3,frequency:fy.optional(),peak_to_peak_current:R3.optional(),wave_shape:Kn(["sine","square","triangle","sawtooth","dc"]).optional().default("dc"),phase:_t().optional(),duty_cycle:_t().min(0).max(1).optional()}),Fct=Bg.extend({ftype:qe("simple_fuse"),current_rating_amps:_t().describe("Nominal current in amps the fuse is rated for"),voltage_rating_volts:_t().describe("Voltage rating in volts, e.g. ±5V would be 5")}),Lct=Bg.extend({ftype:qe("simple_ammeter")}),Hct=Pt({must_be_connected:je().optional(),provides_power:je().optional(),requires_power:je().optional(),provides_ground:je().optional(),requires_ground:je().optional(),provides_voltage:xo([Z(),_t()]).optional(),requires_voltage:xo([Z(),_t()]).optional(),do_not_connect:je().optional(),include_in_board_pinout:je().optional(),can_use_internal_pullup:je().optional(),is_using_internal_pullup:je().optional(),needs_external_pullup:je().optional(),can_use_internal_pulldown:je().optional(),is_using_internal_pulldown:je().optional(),needs_external_pulldown:je().optional(),can_use_open_drain:je().optional(),is_using_open_drain:je().optional(),can_use_push_pull:je().optional(),is_using_push_pull:je().optional(),should_have_decoupling_capacitor:je().optional(),recommended_decoupling_capacitor_capacitance:xo([Z(),_t()]).optional(),is_configured_for_i2c_sda:je().optional(),is_configured_for_i2c_scl:je().optional(),is_configured_for_spi_mosi:je().optional(),is_configured_for_spi_miso:je().optional(),is_configured_for_spi_sck:je().optional(),is_configured_for_spi_cs:je().optional(),is_configured_for_uart_tx:je().optional(),is_configured_for_uart_rx:je().optional(),supports_i2c_sda:je().optional(),supports_i2c_scl:je().optional(),supports_spi_mosi:je().optional(),supports_spi_miso:je().optional(),supports_spi_sck:je().optional(),supports_spi_cs:je().optional(),supports_uart_tx:je().optional(),supports_uart_rx:je().optional()}),Jxe=Bg.extend({ftype:qe("simple_battery"),capacity:xct}),Wxe=Bg.extend({ftype:qe("simple_inductor"),inductance:Tne,display_inductance:Z().optional(),max_current_rating:_t().optional()}),jxe=Bg.extend({ftype:qe("simple_push_button")}),qxe=Bg.extend({ftype:qe("simple_potentiometer"),max_resistance:P8,display_max_resistance:Z().optional()}),Oct=Bg.extend({ftype:qe("simple_crystal"),frequency:_t().describe("Frequency in Hz"),load_capacitance:_t().optional().describe("Load capacitance in pF"),pin_variant:Kn(["two_pin","four_pin"]).optional()}),Xxe=Bg.extend({ftype:qe("simple_pin_header"),pin_count:_t(),gender:Kn(["male","female"]).optional().default("male")}),Gct=["usb_c","m2","jst_sh","jst_gh","jst_zh","jst_ph","jst_xh","jst_vh"],Yct=Bg.extend({ftype:qe("simple_connector"),standard:Kn(Gct).optional(),pin_count:_t().int().positive().optional()}),$xe=Bg.extend({ftype:qe("simple_pinout")}),Zxe=Bg.extend({ftype:qe("simple_resonator"),load_capacitance:zM,equivalent_series_resistance:P8.optional(),frequency:fy}),e3e=Bg.extend({ftype:qe("simple_transistor"),transistor_type:Kn(["npn","pnp"])}),t3e=Bg.extend({ftype:qe("simple_test_point"),footprint_variant:Kn(["pad","through_hole"]).optional(),pad_shape:Kn(["rect","circle"]).optional(),pad_diameter:xo([_t(),Z()]).optional(),hole_diameter:xo([_t(),Z()]).optional(),width:xo([_t(),Z()]).optional(),height:xo([_t(),Z()]).optional()}),n3e=Bg.extend({ftype:qe("simple_mosfet"),channel_type:Kn(["n","p"]),mosfet_mode:Kn(["enhancement","depletion"])}),o3e=Bg.extend({ftype:qe("simple_op_amp")}),i3e=Bg.extend({ftype:qe("simple_switch")}),r3e=Pt({type:qe("source_project_metadata"),name:Z().optional(),software_used_string:Z().optional(),project_url:Z().optional(),source_filesystem_md5_hash:Z().optional(),created_at:yct.optional()}),Uct=Ml.extend({type:qe("source_missing_property_error"),source_missing_property_error_id:so("source_missing_property_error"),source_component_id:Z(),property_name:Z(),subcircuit_id:Z().optional(),error_type:qe("source_missing_property_error").default("source_missing_property_error")}).describe("The source code is missing a property"),Kct=Ml.extend({type:qe("source_failed_to_create_component_error"),source_failed_to_create_component_error_id:so("source_failed_to_create_component_error"),error_type:qe("source_failed_to_create_component_error").default("source_failed_to_create_component_error"),component_name:Z().optional(),subcircuit_id:Z().optional(),parent_source_component_id:Z().optional(),pcb_center:Pt({x:_t().optional(),y:_t().optional()}).optional(),schematic_center:Pt({x:_t().optional(),y:_t().optional()}).optional()}).describe("Error emitted when a component fails to be constructed"),s3e=Ml.extend({type:qe("source_invalid_component_property_error"),source_invalid_component_property_error_id:so("source_invalid_component_property_error"),source_component_id:Z(),property_name:Z(),property_value:Oxe().optional(),expected_format:Z().optional(),subcircuit_id:Z().optional(),error_type:qe("source_invalid_component_property_error").default("source_invalid_component_property_error")}).describe("The source component property is invalid"),a3e=Ml.extend({type:qe("source_trace_not_connected_error"),source_trace_not_connected_error_id:so("source_trace_not_connected_error"),error_type:qe("source_trace_not_connected_error").default("source_trace_not_connected_error"),subcircuit_id:Z().optional(),source_group_id:Z().optional(),source_trace_id:Z().optional(),connected_source_port_ids:dn(Z()).optional(),selectors_not_found:dn(Z()).optional()}).describe("Occurs when a source trace selector does not match any ports"),Vct=Pt({type:qe("source_property_ignored_warning"),source_property_ignored_warning_id:so("source_property_ignored_warning"),source_component_id:Z(),property_name:Z(),subcircuit_id:Z().optional(),error_type:qe("source_property_ignored_warning").default("source_property_ignored_warning"),message:Z()}).describe("The source property was ignored"),A3e=Pt({type:qe("source_pin_missing_trace_warning"),source_pin_missing_trace_warning_id:so("source_pin_missing_trace_warning"),warning_type:qe("source_pin_missing_trace_warning").default("source_pin_missing_trace_warning"),message:Z(),source_component_id:Z(),source_port_id:Z(),subcircuit_id:Z().optional()}).describe("Warning emitted when a source component pin is missing a trace connection"),c3e=Pt({type:qe("source_missing_manufacturer_part_number_warning"),source_missing_manufacturer_part_number_warning_id:so("source_missing_manufacturer_part_number_warning"),warning_type:qe("source_missing_manufacturer_part_number_warning").default("source_missing_manufacturer_part_number_warning"),message:Z(),source_component_id:Z(),standard:Z(),subcircuit_id:Z().optional()}).describe("Warning emitted when a standard connector is missing manufacturer part number"),l3e=Pt({type:qe("source_refdes_convention_warning"),source_refdes_convention_warning_id:so("source_refdes_convention_warning"),warning_type:qe("source_refdes_convention_warning").default("source_refdes_convention_warning"),message:Z(),source_component_id:Z(),refdes:Z(),source_component_ftype:Z(),expected_prefixes:dn(Z()),actual_prefix:Z().optional(),subcircuit_id:Z().optional()}).describe("Warning emitted when a source component reference designator does not match the component type convention"),zct=Bg.extend({ftype:qe("simple_voltage_probe")}),Jct=Bg.extend({ftype:qe("interconnect")}),g3e=Ml.extend({type:qe("source_i2c_misconfigured_error"),source_i2c_misconfigured_error_id:so("source_i2c_misconfigured_error"),error_type:qe("source_i2c_misconfigured_error").default("source_i2c_misconfigured_error"),source_port_ids:dn(Z())}).describe("Error emitted when incompatible I2C pins (e.g. SDA and SCL) are connected to the same net"),RV=Ml.extend({type:qe("source_component_misconfigured_error"),source_component_misconfigured_error_id:so("source_component_misconfigured_error"),error_type:qe("source_component_misconfigured_error").default("source_component_misconfigured_error"),source_component_ids:dn(Z()),source_port_ids:dn(Z()).optional()}).describe("Error emitted when one or more source components have an invalid or conflicting configuration"),Wct=Bg.extend({ftype:qe("simple_voltage_source"),voltage:O_,frequency:fy.optional(),peak_to_peak_voltage:O_.optional(),wave_shape:Kn(["sinewave","square","triangle","sawtooth"]).optional(),phase:oA.optional(),duty_cycle:_t().optional().describe("Duty cycle as a fraction (0 to 1)"),pulse_delay:Pl.optional(),rise_time:Pl.optional(),fall_time:Pl.optional(),pulse_width:Pl.optional(),period:Pl.optional()}),jct=xo([Uxe,Yxe,Hne,Rct,Kxe,Tct,Vxe,zxe,kct,Lct,Jxe,Wxe,jxe,qxe,Oct,Xxe,Yct,$xe,Zxe,i3e,e3e,t3e,n3e,o3e,Fct,zct,Jct,Wct,r3e,Uct,s3e,Kct,a3e,Vct,A3e,c3e,l3e,g3e,RV]),qct=Pt({type:qe("source_port"),pin_number:_t().optional(),port_hints:dn(Z()).optional(),name:Z(),source_port_id:Z(),source_component_id:Z().optional(),source_group_id:Z().optional(),most_frequently_referenced_by_name:Z().optional(),subcircuit_id:Z().optional(),subcircuit_connectivity_map_key:Z().optional()}).merge(Hct),Xct=Pt({type:qe("source_component_internal_connection"),source_component_internal_connection_id:Z(),source_component_id:Z(),source_port_ids:dn(Z()),subcircuit_id:Z().optional()}),$ct=Pt({type:qe("source_trace"),source_trace_id:Z(),connected_source_port_ids:dn(Z()),connected_source_net_ids:dn(Z()),subcircuit_id:Z().optional(),subcircuit_connectivity_map_key:Z().optional(),max_length:_t().optional(),max_via_count:_t().int().nonnegative().optional(),name:Z().optional(),min_trace_thickness:_t().optional(),display_name:Z().optional()}),Zct=Pt({type:qe("source_group"),source_group_id:Z(),subcircuit_id:Z().optional(),parent_subcircuit_id:Z().optional(),parent_source_group_id:Z().optional(),is_subcircuit:je().optional(),show_as_schematic_box:je().optional(),name:Z().optional(),was_automatically_named:je().optional()}),elt=Pt({type:qe("source_net"),source_net_id:Z(),name:Z(),member_source_group_ids:dn(Z()),is_power:je().optional(),is_ground:je().optional(),is_digital_signal:je().optional(),is_analog_signal:je().optional(),is_positive_voltage_source:je().optional(),trace_width:_t().optional(),subcircuit_id:Z().optional(),subcircuit_connectivity_map_key:Z().optional()}),tlt=Pt({type:qe("source_board"),source_board_id:Z(),source_group_id:Z(),title:Z().optional()}).describe("Defines a board in the source domain"),nlt=Ml.extend({type:qe("source_ambiguous_port_reference"),source_ambiguous_port_reference_id:so("source_ambiguous_port_reference"),error_type:qe("source_ambiguous_port_reference").default("source_ambiguous_port_reference"),source_port_id:Z().optional(),source_component_id:Z().optional()}).describe("Error emitted when a port hint matches multiple non-overlapping pads, making the port reference ambiguous"),olt=Pt({type:qe("source_pcb_ground_plane"),source_pcb_ground_plane_id:Z(),source_group_id:Z(),source_net_id:Z(),subcircuit_id:Z().optional()}).describe("Defines a ground plane in the source domain"),Xk=["top","bottom","inner1","inner2","inner3","inner4","inner5","inner6","inner7","inner8"],u3e=Kn(Xk),Pr=u3e.or(Pt({name:u3e})).transform(t=>typeof t=="string"?t:t.name),Vm=Kn(["top","bottom"]),ilt=Pt({type:qe("source_manually_placed_via"),source_manually_placed_via_id:Z(),source_group_id:Z(),source_net_id:Z().min(1).optional(),subcircuit_id:Z().optional(),source_trace_id:Z().optional()}).describe("Defines a via that is manually placed in the source domain"),rlt=Pt({type:qe("source_unnamed_trace_warning"),source_unnamed_trace_warning_id:so("source_unnamed_trace_warning"),warning_type:qe("source_unnamed_trace_warning").default("source_unnamed_trace_warning"),message:Z(),source_trace_id:Z(),subcircuit_id:Z().optional()}).describe("Warning emitted when a source trace is missing a name"),slt=Pt({type:qe("source_no_power_pin_defined_warning"),source_no_power_pin_defined_warning_id:so("source_no_power_pin_defined_warning"),warning_type:qe("source_no_power_pin_defined_warning").default("source_no_power_pin_defined_warning"),message:Z(),source_component_id:Z(),source_port_ids:dn(Z()),subcircuit_id:Z().optional()}).describe("Warning emitted when a chip has no source ports with requires_power=true"),alt=Pt({type:qe("source_no_ground_pin_defined_warning"),source_no_ground_pin_defined_warning_id:so("source_no_ground_pin_defined_warning"),warning_type:qe("source_no_ground_pin_defined_warning").default("source_no_ground_pin_defined_warning"),message:Z(),source_component_id:Z(),source_port_ids:dn(Z()),subcircuit_id:Z().optional()}).describe("Warning emitted when a chip has no source ports marked as ground pins"),Alt=Pt({type:qe("source_component_pins_underspecified_warning"),source_component_pins_underspecified_warning_id:so("source_component_pins_underspecified_warning"),warning_type:qe("source_component_pins_underspecified_warning").default("source_component_pins_underspecified_warning"),message:Z(),source_component_id:Z(),source_port_ids:dn(Z()),subcircuit_id:Z().optional()}).describe("Warning emitted when all ports on a source component are underspecified"),clt=Ml.extend({type:qe("source_pin_must_be_connected_error"),source_pin_must_be_connected_error_id:so("source_pin_must_be_connected_error"),error_type:qe("source_pin_must_be_connected_error").default("source_pin_must_be_connected_error"),source_component_id:Z(),source_port_id:Z(),subcircuit_id:Z().optional()}).describe("Error emitted when a pin with mustBeConnected attribute is not connected to any trace"),llt=Ml.extend({type:qe("unknown_error_finding_part"),unknown_error_finding_part_id:so("unknown_error_finding_part"),error_type:qe("unknown_error_finding_part").default("unknown_error_finding_part"),source_component_id:Z().optional(),subcircuit_id:Z().optional()}).describe("Error emitted when an unexpected error occurs while finding a part"),TV=Pt({type:qe("source_part_not_found_warning"),source_part_not_found_warning_id:so("source_part_not_found_warning"),warning_type:qe("source_part_not_found_warning").default("source_part_not_found_warning"),message:Z(),source_component_id:Z().optional(),subcircuit_id:Z().optional(),supplier_name:JM.optional(),manufacturer_part_number:Z().optional(),supplier_part_number:Z().optional(),part_name:Z().optional()}).describe("Warning emitted when a requested part can not be found"),glt=Pt({type:qe("source_confusing_net_name_warning"),source_confusing_net_name_warning_id:so("source_confusing_net_name_warning"),warning_type:qe("source_confusing_net_name_warning").default("source_confusing_net_name_warning"),message:Z(),source_net_ids:dn(Z()).min(2),net_name:Z(),subcircuit_id:Z().optional()}).describe("Warning emitted when electrically disconnected source nets share a name"),ult=Pt({type:qe("schematic_box"),schematic_sheet_id:Z().optional(),schematic_component_id:Z().optional(),schematic_symbol_id:Z().optional(),width:lt,height:lt,is_dashed:je().default(!1),x:lt,y:lt,subcircuit_id:Z().optional()}).describe("Draws a box on the schematic"),dlt=Pt({type:qe("schematic_path"),schematic_path_id:so("schematic_path"),schematic_sheet_id:Z().optional(),schematic_component_id:Z().optional(),schematic_symbol_id:Z().optional(),fill_color:Z().optional(),is_filled:je().optional(),is_dashed:je().default(!1),stroke_width:lt.nullable().optional(),stroke_color:Z().optional(),dash_length:lt.optional(),dash_gap:lt.optional(),points:dn(Ti),subcircuit_id:Z().optional()}),hlt=bc(Pt({left_margin:ce.optional(),right_margin:ce.optional(),top_margin:ce.optional(),bottom_margin:ce.optional()})),plt=Pt({left_size:_t(),right_size:_t(),top_size:_t().optional(),bottom_size:_t().optional()}),mlt=Pt({left_side:Pt({pins:dn(_t()),direction:Kn(["top-to-bottom","bottom-to-top"]).optional()}).optional(),right_side:Pt({pins:dn(_t()),direction:Kn(["top-to-bottom","bottom-to-top"]).optional()}).optional(),top_side:Pt({pins:dn(_t()),direction:Kn(["left-to-right","right-to-left"]).optional()}).optional(),bottom_side:Pt({pins:dn(_t()),direction:Kn(["left-to-right","right-to-left"]).optional()}).optional()}),_lt=xo([plt,mlt]),flt=Pt({type:qe("schematic_component"),size:kne,center:Ti,source_component_id:Z().optional(),schematic_component_id:Z(),schematic_sheet_id:Z().optional(),schematic_symbol_id:Z().optional(),pin_spacing:ce.optional(),pin_styles:hlt.optional(),box_width:ce.optional(),symbol_name:Z().optional(),port_arrangement:_lt.optional(),port_labels:bc(Z()).optional(),symbol_display_value:Z().optional(),subcircuit_id:Z().optional(),schematic_group_id:Z().optional(),is_schematic_group:je().optional(),source_group_id:Z().optional(),is_box_with_pins:je().optional().default(!0)}),e8n=Pt({kicad_symbol:Nct.optional()}).catchall(Oxe()),Ilt=Pt({type:qe("schematic_symbol"),schematic_symbol_id:Z(),name:Z().optional(),metadata:e8n.optional()}).describe("Defines a named schematic symbol that can be referenced by components."),Clt=Pt({type:qe("schematic_line"),schematic_line_id:so("schematic_line"),schematic_sheet_id:Z().optional(),schematic_component_id:Z().optional(),schematic_symbol_id:Z().optional(),x1:lt,y1:lt,x2:lt,y2:lt,stroke_width:lt.nullable().optional(),color:Z().default("#000000"),is_dashed:je().default(!1),dash_length:lt.optional(),dash_gap:lt.optional(),subcircuit_id:Z().optional()}).describe("Draws a styled line on the schematic"),ylt=Pt({type:qe("schematic_rect"),schematic_rect_id:so("schematic_rect"),schematic_sheet_id:Z().optional(),schematic_component_id:Z().optional(),schematic_symbol_id:Z().optional(),center:Ti,width:lt,height:lt,rotation:oA.default(0),stroke_width:lt.nullable().optional(),color:Z().default("#000000"),is_filled:je().default(!1),fill_color:Z().optional(),is_dashed:je().default(!1),subcircuit_id:Z().optional()}).describe("Draws a styled rectangle on the schematic"),xlt=Pt({type:qe("schematic_circle"),schematic_circle_id:so("schematic_circle"),schematic_sheet_id:Z().optional(),schematic_component_id:Z().optional(),schematic_symbol_id:Z().optional(),center:Ti,radius:lt,stroke_width:lt.nullable().optional(),color:Z().default("#000000"),is_filled:je().default(!1),fill_color:Z().optional(),is_dashed:je().default(!1),subcircuit_id:Z().optional()}).describe("Draws a styled circle on the schematic"),Elt=Pt({type:qe("schematic_arc"),schematic_arc_id:so("schematic_arc"),schematic_sheet_id:Z().optional(),schematic_component_id:Z().optional(),schematic_symbol_id:Z().optional(),center:Ti,radius:lt,start_angle_degrees:oA,end_angle_degrees:oA,direction:Kn(["clockwise","counterclockwise"]).default("counterclockwise"),stroke_width:lt.nullable().optional(),color:Z().default("#000000"),is_dashed:je().default(!1),subcircuit_id:Z().optional()}).describe("Draws a styled arc on the schematic"),Blt=Pt({type:qe("schematic_trace"),schematic_trace_id:Z(),schematic_sheet_id:Z().optional(),source_trace_id:Z().optional(),junctions:dn(Pt({x:_t(),y:_t()})),edges:dn(Pt({from:Pt({x:_t(),y:_t()}),to:Pt({x:_t(),y:_t()}),is_crossing:je().optional(),from_schematic_port_id:Z().optional(),to_schematic_port_id:Z().optional()})),subcircuit_id:Z().optional(),subcircuit_connectivity_map_key:Z().optional()}),t8n=Kn(["center","left","right","top","bottom"]),d3e=Pt({text:Z(),is_overlined:je().optional()}),blt=Pt({type:qe("schematic_text"),schematic_sheet_id:Z().optional(),schematic_component_id:Z().optional(),schematic_symbol_id:Z().optional(),schematic_text_id:Z(),source_trace_id:Z().optional(),text:Z(),text_parts:dn(d3e).min(1).optional(),display_superscript:Z().optional(),font_size:_t().default(.18),position:Pt({x:lt,y:lt}),rotation:_t().default(0),anchor:xo([t8n.describe("legacy"),M8]).default("center"),color:Z().default("#000000"),subcircuit_id:Z().optional()}),Slt=Pt({type:qe("schematic_port"),schematic_port_id:Z(),source_port_id:Z(),schematic_sheet_id:Z().optional(),schematic_component_id:Z().optional(),center:Ti,facing_direction:Kn(["up","down","left","right"]).optional(),distance_from_component_edge:_t().optional(),side_of_component:Kn(["top","bottom","left","right"]).optional(),true_ccw_index:_t().optional(),pin_number:_t().optional(),display_pin_label:Z().optional(),display_pin_label_text_parts:dn(d3e).min(1).optional(),display_pin_label_font_size:_t().positive().finite().optional(),subcircuit_id:Z().optional(),is_connected:je().optional(),is_internal_circuit_port:je().optional(),is_overlapping_internal_circuit_port:je().optional(),has_input_arrow:je().optional(),has_output_arrow:je().optional(),is_drawn_with_inversion_circle:je().optional()}).describe("Defines a port on a schematic component"),Qlt=Pt({type:qe("schematic_net_label"),schematic_net_label_id:so("schematic_net_label"),schematic_sheet_id:Z().optional(),schematic_trace_id:Z().optional(),source_trace_id:Z().optional(),source_net_id:Z(),center:Ti,anchor_position:Ti.optional(),anchor_side:Kn(["top","bottom","left","right"]),text:Z(),display_superscript:Z().optional(),symbol_name:Z().optional(),is_movable:je().optional(),subcircuit_id:Z().optional()}),vlt=Ml.extend({type:qe("schematic_error"),schematic_error_id:Z(),error_type:qe("schematic_port_not_found").default("schematic_port_not_found"),subcircuit_id:Z().optional()}).describe("Defines a schematic error on the schematic"),wlt=Ml.extend({type:qe("schematic_layout_error"),schematic_layout_error_id:so("schematic_layout_error"),error_type:qe("schematic_layout_error").default("schematic_layout_error"),source_group_id:Z(),schematic_group_id:Z(),subcircuit_id:Z().optional()}).describe("Error emitted when schematic layout fails for a group"),One=Pt({type:qe("schematic_debug_object"),label:Z().optional(),subcircuit_id:Z().optional()}),Plt=One.extend({shape:qe("rect"),center:Ti,size:kne}),Mlt=One.extend({shape:qe("line"),start:Ti,end:Ti}),Dlt=One.extend({shape:qe("point"),center:Ti}),Nlt=_y("shape",[Plt,Mlt,Dlt]),Rlt=Pt({type:qe("schematic_voltage_probe"),schematic_voltage_probe_id:Z(),schematic_sheet_id:Z().optional(),source_component_id:Z().optional(),name:Z().optional(),position:Ti,schematic_trace_id:Z(),voltage:O_.optional(),subcircuit_id:Z().optional(),color:Z().optional(),label_alignment:M8.optional()}).describe("Defines a voltage probe measurement point on a schematic trace"),h3e=Pt({type:qe("schematic_manual_edit_conflict_warning"),schematic_manual_edit_conflict_warning_id:so("schematic_manual_edit_conflict_warning"),warning_type:qe("schematic_manual_edit_conflict_warning").default("schematic_manual_edit_conflict_warning"),message:Z(),schematic_component_id:Z(),schematic_group_id:Z().optional(),subcircuit_id:Z().optional(),source_component_id:Z()}).describe("Warning emitted when a component has both manual placement and explicit schX/schY coordinates"),Tlt=Pt({type:qe("schematic_component_overlap_warning"),schematic_component_overlap_warning_id:so("schematic_component_overlap_warning"),warning_type:qe("schematic_component_overlap_warning").default("schematic_component_overlap_warning"),message:Z(),schematic_component_ids:fQ([Z(),Z()]),schematic_sheet_id:Z().optional()}).describe("Warning emitted when the rendered bounds of two schematic components overlap"),klt=Pt({type:qe("schematic_component_styling_warning"),schematic_component_styling_warning_id:so("schematic_component_styling_warning"),warning_type:qe("schematic_component_styling_warning").default("schematic_component_styling_warning"),message:Z(),schematic_component_id:Z(),styling_issue_type:Z(),schematic_port_ids:dn(Z()).optional(),source_component_id:Z().optional(),schematic_sheet_id:Z().optional(),subcircuit_id:Z().optional()}).describe("Warning emitted when a schematic component has a visual styling issue"),Flt=Pt({type:qe("schematic_element_outside_sheet_warning"),schematic_element_outside_sheet_warning_id:so("schematic_element_outside_sheet_warning"),warning_type:qe("schematic_element_outside_sheet_warning").default("schematic_element_outside_sheet_warning"),message:Z(),schematic_sheet_id:Z(),schematic_element_type:Kn(["schematic_component","schematic_net_label","schematic_trace"]),schematic_element_id:Z()}).describe("Warning emitted when a schematic component, net label, or trace extends outside its schematic sheet"),Llt=lt.pipe(_t().positive().finite()),Hlt=Pt({type:qe("schematic_graphic"),schematic_graphic_id:so("schematic_graphic"),schematic_sheet_id:Z().optional(),asset:Fne.optional(),svg_content:Z().optional(),width:Llt.optional(),height:Llt.optional()}).describe("References a graphic asset or inline SVG content with optional centered layout bounds on a schematic sheet").superRefine(({asset:t,svg_content:e},n)=>{t===void 0&&e===void 0&&n.addIssue({code:lo.custom,message:"At least one of asset or svg_content is required"})}),Olt=Pt({type:qe("schematic_group"),schematic_group_id:so("schematic_group"),schematic_sheet_id:Z().optional(),source_group_id:Z(),is_subcircuit:je().optional(),subcircuit_id:Z().optional(),width:ce,height:ce,center:Ti,schematic_component_ids:dn(Z()),show_as_schematic_box:je().optional(),name:Z().optional(),description:Z().optional()}).describe("Defines a group of components on the schematic"),Glt=Pt({type:qe("schematic_table"),schematic_table_id:so("schematic_table"),schematic_sheet_id:Z().optional(),anchor_position:Ti,column_widths:dn(lt),row_heights:dn(lt),cell_padding:lt.optional(),border_width:lt.optional(),subcircuit_id:Z().optional(),schematic_component_id:Z().optional(),anchor:M8.optional()}).describe("Defines a table on the schematic"),Ylt=Pt({type:qe("schematic_table_cell"),schematic_table_cell_id:so("schematic_table_cell"),schematic_sheet_id:Z().optional(),schematic_table_id:Z(),start_row_index:_t(),end_row_index:_t(),start_column_index:_t(),end_column_index:_t(),text:Z().optional(),center:Ti,width:lt,height:lt,horizontal_align:Kn(["left","center","right"]).optional(),vertical_align:Kn(["top","middle","bottom"]).optional(),font_size:lt.optional(),subcircuit_id:Z().optional()}).describe("Defines a cell within a schematic_table"),p3e=Kn(["a4","ansi_b"]),Ult=Pt({type:qe("schematic_sheet"),schematic_sheet_id:so("schematic_sheet"),name:Z().optional(),sheet_index:_t().optional(),sheet_size:p3e.optional(),sheet_width:_t().positive().optional(),sheet_height:_t().positive().optional(),subcircuit_id:Z().optional(),outline_color:Z().optional()}).describe("Defines a schematic sheet or page that components can be placed on"),Klt=Pt({type:qe("schematic_missing_sheet_warning"),schematic_missing_sheet_warning_id:so("schematic_missing_sheet_warning"),warning_type:qe("schematic_missing_sheet_warning").default("schematic_missing_sheet_warning"),message:Z()}).describe("Circuit-wide warning emitted when a schematic has no schematic sheet. Display as a banner without attaching it to a component or drawing a target outline or leader line."),Vlt=Pt({x:lt,y:lt,bulge:_t().optional()}),m3e=Pt({vertices:dn(Vlt)}),_3e=Pt({outer_ring:m3e,inner_rings:dn(m3e).default([])}),f3e={from_left:"from_left",from_right:"from_right",from_top:"from_top",from_bottom:"from_bottom",from_above:"from_above",from_below:"from_below",from_x_neg:"from_left",from_x_pos:"from_right",from_y_pos:"from_top",from_y_neg:"from_bottom",from_z_pos:"from_above",from_z_neg:"from_below",from_front:"from_top",from_back:"from_bottom"},n8n={from_left:{x:-1,y:0,z:0},from_right:{x:1,y:0,z:0},from_top:{x:0,y:1,z:0},from_bottom:{x:0,y:-1,z:0},from_above:{x:0,y:0,z:1},from_below:{x:0,y:0,z:-1}},zlt=Kn(["from_left","from_right","from_top","from_bottom","from_above","from_below","from_x_neg","from_x_pos","from_y_pos","from_y_neg","from_z_pos","from_z_neg","from_front","from_back"]).transform(t=>f3e[t]).describe('The side exposing the receptacle where the cable or mating part is attached, following the 2D PCB diagram convention, not a 3D viewport frame. In project coordinate space, "from_top" is +Y, "from_bottom" -Y, "from_left" -X, "from_right" +X, "from_above" +Z and "from_below" -Z. A receptacle on the +Y edge is "from_top" even though the plug moves in -Y as it seats. Cartesian spellings such as "from_y_pos" are accepted and normalized to the named values, as are the deprecated "from_front" (now "from_top") and "from_back" (now "from_bottom").'),kV=Kn(["leftside_top","leftside_bottom","rightside_top","rightside_bottom","topside_left","topside_right","bottomside_left","bottomside_right"]),o8n=[["leftside_top","bottomside_left","rightside_bottom","topside_right"],["leftside_bottom","bottomside_right","rightside_top","topside_left"]],i8n=(t,e)=>{for(const n of o8n){const o=n.indexOf(t),i=n.indexOf(e);if(o!==-1&&i!==-1)return(i-o+n.length)%n.length*90}return null},Jlt=Pt({x:lt,y:lt,via:je().optional(),via_to_layer:Pr.optional()}),r8n=dn(Jlt),N9=Pt({x:lt,y:lt,via:je().optional(),to_layer:Pr.optional(),trace_width:lt.optional()}),Wlt=Pt({min_trace_width:ce.optional(),min_board_edge_clearance:ce.optional(),min_via_hole_edge_to_via_hole_edge_clearance:ce.optional(),min_plated_hole_drill_edge_to_drill_edge_clearance:ce.optional(),min_trace_to_pad_edge_clearance:ce.optional(),min_pad_edge_to_pad_edge_clearance:ce.optional(),min_same_net_trace_edge_to_trace_edge_clearance:ce.optional(),min_different_net_trace_edge_to_trace_edge_clearance:ce.optional(),min_via_edge_to_pad_edge_clearance:ce.optional(),min_via_hole_diameter:ce.optional(),min_via_pad_diameter:ce.optional()}),jlt=Pt({type:qe("pcb_component"),pcb_component_id:so("pcb_component"),source_component_id:Z(),center:Ti,layer:Pr,rotation:oA,display_offset_x:Z().optional().describe("How to display the x offset for this part, usually corresponding with how the user specified it"),display_offset_y:Z().optional().describe("How to display the y offset for this part, usually corresponding with how the user specified it"),width:ce,height:ce,do_not_place:je().optional(),is_allowed_to_be_off_board:je().optional(),subcircuit_id:Z().optional(),pcb_group_id:Z().optional(),position_mode:Kn(["packed","relative_to_group_anchor","relative_to_another_component","none"]).optional(),anchor_position:Ti.optional(),anchor_alignment:M8.optional(),positioned_relative_to_pcb_group_id:Z().optional(),positioned_relative_to_pcb_board_id:Z().optional(),cable_insertion_center:Ti.optional(),insertion_direction:zlt.optional(),pin1_location:kV.optional().describe("Location of pin 1 on the unrotated, top-view component footprint"),supplier_pin1_location_map:bc(JM,kV).optional().describe("Pin 1 location for each supplier's unrotated, top-view footprint"),metadata:Pt({kicad_footprint:vct.optional()}).optional(),obstructs_within_bounds:je().default(!0).describe("Does this component take up all the space within its bounds on a layer. This is generally true except for when separated pin headers are being represented by a single component (in which case, chips can be placed between the pin headers) or for tall modules where chips fit underneath")}).describe("Defines a component on the PCB"),Gne=Pt({type:qe("pcb_debug_object"),pcb_debug_object_id:so("pcb_debug_object"),label:Z().optional(),subcircuit_id:Z().optional()}),qlt=Gne.extend({shape:qe("rect"),center:Ti,size:kne}),Xlt=Gne.extend({shape:qe("line"),start:Ti,end:Ti}),$lt=Gne.extend({shape:qe("point"),center:Ti}),Zlt=_y("shape",[qlt,Xlt,$lt]),e0t=Pt({type:qe("pcb_hole"),pcb_hole_id:so("pcb_hole"),pcb_group_id:Z().optional(),subcircuit_id:Z().optional(),pcb_component_id:Z().optional(),hole_shape:qe("circle"),hole_diameter:_t(),x:lt,y:lt,is_covered_with_solder_mask:je().optional(),soldermask_margin:_t().optional()}),s8n=e0t.describe("Defines a circular hole on the PCB"),t0t=Pt({type:qe("pcb_hole"),pcb_hole_id:so("pcb_hole"),pcb_group_id:Z().optional(),subcircuit_id:Z().optional(),pcb_component_id:Z().optional(),hole_shape:qe("rect"),hole_width:_t(),hole_height:_t(),x:lt,y:lt,is_covered_with_solder_mask:je().optional(),soldermask_margin:_t().optional()}),a8n=t0t.describe("Defines a rectangular (square-capable) hole on the PCB. Use equal width/height for square."),n0t=Pt({type:qe("pcb_hole"),pcb_hole_id:so("pcb_hole"),pcb_group_id:Z().optional(),subcircuit_id:Z().optional(),pcb_component_id:Z().optional(),hole_shape:Kn(["circle","square"]),hole_diameter:_t(),x:lt,y:lt,is_covered_with_solder_mask:je().optional(),soldermask_margin:_t().optional()}),A8n=n0t.describe("Defines a circular or square hole on the PCB"),o0t=Pt({type:qe("pcb_hole"),pcb_hole_id:so("pcb_hole"),pcb_group_id:Z().optional(),subcircuit_id:Z().optional(),pcb_component_id:Z().optional(),hole_shape:qe("oval"),hole_width:_t(),hole_height:_t(),x:lt,y:lt,is_covered_with_solder_mask:je().optional(),soldermask_margin:_t().optional()}),c8n=o0t.describe("Defines an oval hole on the PCB"),i0t=Pt({type:qe("pcb_hole"),pcb_hole_id:so("pcb_hole"),pcb_group_id:Z().optional(),subcircuit_id:Z().optional(),pcb_component_id:Z().optional(),hole_shape:qe("pill"),hole_width:_t(),hole_height:_t(),x:lt,y:lt,is_covered_with_solder_mask:je().optional(),soldermask_margin:_t().optional()}),l8n=i0t.describe("Defines a pill-shaped hole on the PCB"),r0t=Pt({type:qe("pcb_hole"),pcb_hole_id:so("pcb_hole"),pcb_group_id:Z().optional(),subcircuit_id:Z().optional(),pcb_component_id:Z().optional(),hole_shape:qe("rotated_pill"),hole_width:_t(),hole_height:_t(),x:lt,y:lt,ccw_rotation:oA,is_covered_with_solder_mask:je().optional(),soldermask_margin:_t().optional()}),g8n=r0t.describe("Defines a rotated pill-shaped hole on the PCB"),s0t=n0t.or(o0t).or(i0t).or(r0t).or(e0t).or(t0t),u8n=Pt({type:qe("pcb_plated_hole"),shape:qe("circle"),pcb_group_id:Z().optional(),subcircuit_id:Z().optional(),outer_diameter:_t(),hole_diameter:_t(),is_covered_with_solder_mask:je().optional(),x:lt,y:lt,layers:dn(Pr),port_hints:dn(Z()).optional(),pcb_component_id:Z().optional(),pcb_port_id:Z().optional(),pcb_plated_hole_id:so("pcb_plated_hole"),soldermask_margin:_t().optional()}),d8n=Pt({type:qe("pcb_plated_hole"),shape:Kn(["oval","pill"]),pcb_group_id:Z().optional(),subcircuit_id:Z().optional(),outer_width:_t(),outer_height:_t(),hole_width:_t(),hole_height:_t(),is_covered_with_solder_mask:je().optional(),x:lt,y:lt,ccw_rotation:oA,layers:dn(Pr),port_hints:dn(Z()).optional(),pcb_component_id:Z().optional(),pcb_port_id:Z().optional(),pcb_plated_hole_id:so("pcb_plated_hole"),soldermask_margin:_t().optional()}),h8n=Pt({type:qe("pcb_plated_hole"),shape:qe("circular_hole_with_rect_pad"),pcb_group_id:Z().optional(),subcircuit_id:Z().optional(),hole_shape:qe("circle"),pad_shape:qe("rect"),hole_diameter:_t(),rect_pad_width:_t(),rect_pad_height:_t(),rect_border_radius:_t().optional(),hole_offset_x:lt.default(0),hole_offset_y:lt.default(0),is_covered_with_solder_mask:je().optional(),x:lt,y:lt,layers:dn(Pr),port_hints:dn(Z()).optional(),pcb_component_id:Z().optional(),pcb_port_id:Z().optional(),pcb_plated_hole_id:so("pcb_plated_hole"),soldermask_margin:_t().optional(),rect_ccw_rotation:oA.optional()}),p8n=Pt({type:qe("pcb_plated_hole"),shape:qe("pill_hole_with_rect_pad"),pcb_group_id:Z().optional(),subcircuit_id:Z().optional(),hole_shape:qe("pill"),pad_shape:qe("rect"),hole_width:_t(),hole_height:_t(),rect_pad_width:_t(),rect_pad_height:_t(),rect_border_radius:_t().optional(),hole_offset_x:lt.default(0),hole_offset_y:lt.default(0),is_covered_with_solder_mask:je().optional(),x:lt,y:lt,layers:dn(Pr),port_hints:dn(Z()).optional(),pcb_component_id:Z().optional(),pcb_port_id:Z().optional(),pcb_plated_hole_id:so("pcb_plated_hole"),soldermask_margin:_t().optional()}),m8n=Pt({type:qe("pcb_plated_hole"),shape:qe("rotated_pill_hole_with_rect_pad"),pcb_group_id:Z().optional(),subcircuit_id:Z().optional(),hole_shape:qe("rotated_pill"),pad_shape:qe("rect"),hole_width:_t(),hole_height:_t(),hole_ccw_rotation:oA,rect_pad_width:_t(),rect_pad_height:_t(),rect_border_radius:_t().optional(),rect_ccw_rotation:oA,hole_offset_x:lt.default(0),hole_offset_y:lt.default(0),is_covered_with_solder_mask:je().optional(),x:lt,y:lt,layers:dn(Pr),port_hints:dn(Z()).optional(),pcb_component_id:Z().optional(),pcb_port_id:Z().optional(),pcb_plated_hole_id:so("pcb_plated_hole"),soldermask_margin:_t().optional()}),_8n=Pt({type:qe("pcb_plated_hole"),shape:qe("hole_with_polygon_pad"),pcb_group_id:Z().optional(),subcircuit_id:Z().optional(),hole_shape:Kn(["circle","oval","pill","rotated_pill"]),hole_diameter:_t().optional(),hole_width:_t().optional(),hole_height:_t().optional(),pad_outline:dn(Pt({x:lt,y:lt})).min(3),hole_offset_x:lt.default(0),hole_offset_y:lt.default(0),is_covered_with_solder_mask:je().optional(),x:lt,y:lt,layers:dn(Pr),port_hints:dn(Z()).optional(),pcb_component_id:Z().optional(),pcb_port_id:Z().optional(),pcb_plated_hole_id:so("pcb_plated_hole"),soldermask_margin:_t().optional(),ccw_rotation:oA.optional()}),a0t=xo([u8n,d8n,h8n,p8n,m8n,_8n]),A0t=Pt({type:qe("pcb_port"),pcb_port_id:so("pcb_port"),pcb_group_id:Z().optional(),subcircuit_id:Z().optional(),source_port_id:Z(),pcb_component_id:Z().optional(),x:lt,y:lt,layers:dn(Pr),is_board_pinout:je().optional()}).describe("Defines a port on the PCB"),f8n=Pt({type:qe("pcb_smtpad"),shape:qe("circle"),pcb_smtpad_id:so("pcb_smtpad"),pcb_group_id:Z().optional(),subcircuit_id:Z().optional(),x:lt,y:lt,radius:_t(),layer:Pr,port_hints:dn(Z()).optional(),pcb_component_id:Z().optional(),pcb_port_id:Z().optional(),is_covered_with_solder_mask:je().optional(),soldermask_margin:_t().optional(),solderpaste_margin:_t().optional()}),I8n=Pt({type:qe("pcb_smtpad"),shape:qe("rect"),pcb_smtpad_id:so("pcb_smtpad"),pcb_group_id:Z().optional(),subcircuit_id:Z().optional(),x:lt,y:lt,width:_t(),height:_t(),rect_border_radius:_t().optional(),corner_radius:_t().optional(),layer:Pr,port_hints:dn(Z()).optional(),pcb_component_id:Z().optional(),pcb_port_id:Z().optional(),is_covered_with_solder_mask:je().optional(),soldermask_margin:_t().optional(),soldermask_margin_left:_t().optional(),soldermask_margin_top:_t().optional(),soldermask_margin_right:_t().optional(),soldermask_margin_bottom:_t().optional(),solderpaste_margin:_t().optional()}),C8n=Pt({type:qe("pcb_smtpad"),shape:qe("rotated_rect"),pcb_smtpad_id:so("pcb_smtpad"),pcb_group_id:Z().optional(),subcircuit_id:Z().optional(),x:lt,y:lt,width:_t(),height:_t(),rect_border_radius:_t().optional(),corner_radius:_t().optional(),ccw_rotation:oA,layer:Pr,port_hints:dn(Z()).optional(),pcb_component_id:Z().optional(),pcb_port_id:Z().optional(),is_covered_with_solder_mask:je().optional(),soldermask_margin:_t().optional(),soldermask_margin_left:_t().optional(),soldermask_margin_top:_t().optional(),soldermask_margin_right:_t().optional(),soldermask_margin_bottom:_t().optional(),solderpaste_margin:_t().optional()}),c0t=Pt({type:qe("pcb_smtpad"),shape:qe("pill"),pcb_smtpad_id:so("pcb_smtpad"),pcb_group_id:Z().optional(),subcircuit_id:Z().optional(),x:lt,y:lt,width:_t(),height:_t(),radius:_t(),layer:Pr,port_hints:dn(Z()).optional(),pcb_component_id:Z().optional(),pcb_port_id:Z().optional(),is_covered_with_solder_mask:je().optional(),soldermask_margin:_t().optional(),solderpaste_margin:_t().optional()}),y8n=Pt({type:qe("pcb_smtpad"),shape:qe("rotated_pill"),pcb_smtpad_id:so("pcb_smtpad"),pcb_group_id:Z().optional(),subcircuit_id:Z().optional(),x:lt,y:lt,width:_t(),height:_t(),radius:_t(),ccw_rotation:oA,layer:Pr,port_hints:dn(Z()).optional(),pcb_component_id:Z().optional(),pcb_port_id:Z().optional(),is_covered_with_solder_mask:je().optional(),soldermask_margin:_t().optional(),solderpaste_margin:_t().optional()}),x8n=Pt({type:qe("pcb_smtpad"),shape:qe("polygon"),pcb_smtpad_id:so("pcb_smtpad"),pcb_group_id:Z().optional(),subcircuit_id:Z().optional(),points:dn(Ti),layer:Pr,port_hints:dn(Z()).optional(),pcb_component_id:Z().optional(),pcb_port_id:Z().optional(),is_covered_with_solder_mask:je().optional(),soldermask_margin:_t().optional(),solderpaste_margin:_t().optional()}),l0t=_y("shape",[f8n,I8n,C8n,y8n,c0t,x8n]).describe("Defines an SMT pad on the PCB"),E8n=Pt({type:qe("pcb_solder_paste"),shape:qe("circle"),pcb_solder_paste_id:so("pcb_solder_paste"),pcb_group_id:Z().optional(),subcircuit_id:Z().optional(),x:lt,y:lt,radius:_t(),layer:Pr,pcb_component_id:Z().optional(),pcb_smtpad_id:Z().optional()}),B8n=Pt({type:qe("pcb_solder_paste"),shape:qe("rect"),pcb_solder_paste_id:so("pcb_solder_paste"),pcb_group_id:Z().optional(),subcircuit_id:Z().optional(),x:lt,y:lt,width:_t(),height:_t(),layer:Pr,pcb_component_id:Z().optional(),pcb_smtpad_id:Z().optional()}),b8n=Pt({type:qe("pcb_solder_paste"),shape:qe("pill"),pcb_solder_paste_id:so("pcb_solder_paste"),pcb_group_id:Z().optional(),subcircuit_id:Z().optional(),x:lt,y:lt,width:_t(),height:_t(),radius:_t(),layer:Pr,pcb_component_id:Z().optional(),pcb_smtpad_id:Z().optional()}),S8n=Pt({type:qe("pcb_solder_paste"),shape:qe("rotated_rect"),pcb_solder_paste_id:so("pcb_solder_paste"),pcb_group_id:Z().optional(),subcircuit_id:Z().optional(),x:lt,y:lt,width:_t(),height:_t(),ccw_rotation:lt,layer:Pr,pcb_component_id:Z().optional(),pcb_smtpad_id:Z().optional()}),Q8n=Pt({type:qe("pcb_solder_paste"),shape:qe("rotated_pill"),pcb_solder_paste_id:so("pcb_solder_paste"),pcb_group_id:Z().optional(),subcircuit_id:Z().optional(),x:lt,y:lt,width:_t(),height:_t(),radius:_t(),ccw_rotation:oA,layer:Pr,pcb_component_id:Z().optional(),pcb_smtpad_id:Z().optional()}),v8n=Pt({type:qe("pcb_solder_paste"),shape:qe("oval"),pcb_solder_paste_id:so("pcb_solder_paste"),pcb_group_id:Z().optional(),subcircuit_id:Z().optional(),x:lt,y:lt,width:_t(),height:_t(),layer:Pr,pcb_component_id:Z().optional(),pcb_smtpad_id:Z().optional()}),g0t=xo([E8n,B8n,b8n,S8n,Q8n,v8n]).describe("Defines solderpaste on the PCB"),u0t=Pt({type:qe("pcb_text"),pcb_text_id:so("pcb_text"),pcb_group_id:Z().optional(),subcircuit_id:Z().optional(),text:Z(),center:Ti,layer:Pr,width:ce,height:ce,lines:_t(),align:Kn(["bottom-left"])}).describe("Defines text on the PCB"),d0t=Pt({route_type:qe("wire"),x:lt,y:lt,width:lt,copper_pour_id:Z().optional(),is_inside_copper_pour:je().optional(),start_pcb_port_id:Z().optional(),end_pcb_port_id:Z().optional(),layer:Pr}),h0t=Pt({route_type:qe("via"),x:lt,y:lt,copper_pour_id:Z().optional(),is_inside_copper_pour:je().optional(),hole_diameter:lt.optional(),outer_diameter:lt.optional(),from_layer:Pr,to_layer:Pr}),p0t=Pt({route_type:qe("through_pad"),start:Ti,end:Ti,width:lt,start_layer:Pr,end_layer:Pr,pcb_smtpad_id:Z().optional(),pcb_plated_hole_id:Z().optional()}),I3e=xo([d0t,h0t,p0t]),m0t=Pt({type:qe("pcb_trace"),source_trace_id:Z().optional(),pcb_component_id:Z().optional(),pcb_trace_id:so("pcb_trace"),pcb_group_id:Z().optional(),subcircuit_id:Z().optional(),route_thickness_mode:Kn(["constant","interpolated"]).default("constant").optional(),route_order_index:_t().optional(),should_round_corners:je().optional(),trace_length:_t().optional(),highlight_color:Z().optional(),route:dn(I3e)}).describe("Defines a trace on the PCB"),_0t=Pt({type:qe("pcb_trace_warning"),pcb_trace_warning_id:so("pcb_trace_warning"),warning_type:qe("pcb_trace_warning").default("pcb_trace_warning"),message:Z(),center:Ti.optional(),pcb_trace_id:Z(),source_trace_id:Z(),pcb_component_ids:dn(Z()),pcb_port_ids:dn(Z()),subcircuit_id:Z().optional()}).describe("Defines a trace warning on the PCB"),f0t=Pt({type:qe("pcb_trace_too_long_warning"),pcb_trace_too_long_warning_id:so("pcb_trace_too_long_warning"),warning_type:qe("pcb_trace_too_long_warning").default("pcb_trace_too_long_warning"),message:Z(),pcb_trace_id:Z(),source_net_id:Z().optional(),source_trace_id:Z().optional(),actual_trace_length:lt,maximum_trace_length:lt,subcircuit_id:Z().optional()}).describe("Warning emitted when a PCB trace is longer than its maximum allowed length"),I0t=Pt({type:qe("pcb_trace_too_many_vias_warning"),pcb_trace_too_many_vias_warning_id:so("pcb_trace_too_many_vias_warning"),warning_type:qe("pcb_trace_too_many_vias_warning").default("pcb_trace_too_many_vias_warning"),message:Z(),pcb_trace_id:Z(),source_net_id:Z().optional(),source_trace_id:Z().optional(),actual_via_count:_t().int().nonnegative(),maximum_via_count:_t().int().nonnegative(),subcircuit_id:Z().optional()}).describe("Warning emitted when a PCB trace has more vias than its maximum allowed count"),C0t=Ml.extend({type:qe("pcb_trace_error"),pcb_trace_error_id:so("pcb_trace_error"),error_type:qe("pcb_trace_error").default("pcb_trace_error"),center:Ti.optional(),pcb_trace_id:Z(),source_trace_id:Z(),pcb_component_ids:dn(Z()),pcb_port_ids:dn(Z()),subcircuit_id:Z().optional()}).describe("Defines a trace error on the PCB"),y0t=Ml.extend({type:qe("pcb_trace_missing_error"),pcb_trace_missing_error_id:so("pcb_trace_missing_error"),error_type:qe("pcb_trace_missing_error").default("pcb_trace_missing_error"),center:Ti.optional(),source_trace_id:Z(),pcb_component_ids:dn(Z()),pcb_port_ids:dn(Z()),subcircuit_id:Z().optional()}).describe("Defines an error when a source trace has no corresponding PCB trace"),x0t=Ml.extend({type:qe("pcb_port_not_matched_error"),pcb_error_id:so("pcb_error"),error_type:qe("pcb_port_not_matched_error").default("pcb_port_not_matched_error"),pcb_component_ids:dn(Z()),subcircuit_id:Z().optional()}).describe("Defines a trace error on the PCB where a port is not matched"),E0t=Ml.extend({type:qe("pcb_port_not_connected_error"),pcb_port_not_connected_error_id:so("pcb_port_not_connected_error"),error_type:qe("pcb_port_not_connected_error").default("pcb_port_not_connected_error"),pcb_port_ids:dn(Z()),pcb_component_ids:dn(Z()),subcircuit_id:Z().optional()}).describe("Defines an error when a pcb port is not connected to any trace"),B0t=Pt({type:qe("pcb_net"),pcb_net_id:so("pcb_net"),source_net_id:Z().optional(),highlight_color:Z().optional()}).describe("Defines a net on the PCB"),Yne=Pt({type:qe("pcb_via"),pcb_via_id:so("pcb_via"),pcb_group_id:Z().optional(),subcircuit_id:Z().optional(),subcircuit_connectivity_map_key:Z().optional(),x:lt,y:lt,outer_diameter:lt.default("0.6mm"),hole_diameter:lt.default("0.25mm"),from_layer:Pr.optional(),to_layer:Pr.optional(),layers:dn(Pr),pcb_trace_id:Z().optional(),source_trace_id:Z().optional(),source_net_id:Z().min(1).optional(),net_is_assignable:je().optional(),net_assigned:je().optional(),is_tented:je().optional(),tented_on_top:je().optional(),tented_on_bottom:je().optional()}).transform(({is_tented:t,...e})=>(t!==void 0&&(e.tented_on_top??=t,e.tented_on_bottom??=t),e)).describe("Defines a via on the PCB"),b0t=Pt({type:qe("pcb_board"),pcb_board_id:so("pcb_board"),pcb_panel_id:Z().optional(),carrier_pcb_board_id:Z().optional(),is_subcircuit:je().optional(),subcircuit_id:Z().optional(),is_mounted_to_carrier_board:je().optional(),is_via_in_pad_allowed:je().optional(),width:ce.optional(),height:ce.optional(),center:Ti,display_offset_x:Z().optional().describe("How to display the x offset for this board, usually corresponding with how the user specified it"),display_offset_y:Z().optional().describe("How to display the y offset for this board, usually corresponding with how the user specified it"),thickness:ce.optional().default(1.4),num_layers:_t().optional().default(4),allow_blind_and_buried_vias:je().optional().describe("Whether autorouters may generate blind and buried vias. False restricts newly generated vias to the full board stack."),outline:dn(Ti).optional(),shape:Kn(["rect","polygon"]).optional(),material:Kn(["fr4","fr1"]).default("fr4"),solder_mask_color:Z().optional(),silkscreen_color:Z().optional(),anchor_position:Ti.optional(),anchor_alignment:M8.optional(),position_mode:Kn(["relative_to_panel_anchor","none"]).optional()}).merge(Wlt).describe("Defines the board outline of the PCB"),S0t=Pt({type:qe("pcb_panel"),pcb_panel_id:so("pcb_panel"),width:ce,height:ce,center:Ti,thickness:ce.optional().default(1.4),covered_with_solder_mask:je().optional().default(!0)}).describe("Defines a PCB panel that can contain multiple boards"),Q0t=Ml.extend({type:qe("pcb_placement_error"),pcb_placement_error_id:so("pcb_placement_error"),error_type:qe("pcb_placement_error").default("pcb_placement_error"),subcircuit_id:Z().optional()}).describe("Defines a placement error on the PCB"),v0t=Ml.extend({type:qe("pcb_packing_error"),pcb_packing_error_id:so("pcb_packing_error"),error_type:qe("pcb_packing_error").default("pcb_packing_error"),pcb_group_id:Z().optional(),subcircuit_id:Z().optional()}).describe("Defines a failure to pack PCB components within layout bounds"),w0t=Ml.extend({type:qe("pcb_panelization_placement_error"),pcb_panelization_placement_error_id:so("pcb_panelization_placement_error"),error_type:qe("pcb_panelization_placement_error").default("pcb_panelization_placement_error"),pcb_panel_id:Z().optional(),pcb_board_id:Z().optional(),subcircuit_id:Z().optional()}).describe("Defines a panelization placement error on the PCB"),P0t=Pt({type:qe("pcb_trace_hint"),pcb_trace_hint_id:so("pcb_trace_hint"),pcb_port_id:Z(),pcb_component_id:Z(),route:dn(N9),subcircuit_id:Z().optional()}).describe("A hint that can be used during generation of a PCB trace"),M0t=Pt({type:qe("pcb_silkscreen_line"),pcb_silkscreen_line_id:so("pcb_silkscreen_line"),pcb_component_id:Z(),pcb_group_id:Z().optional(),subcircuit_id:Z().optional(),stroke_width:lt.default("0.1mm"),x1:lt,y1:lt,x2:lt,y2:lt,layer:Vm}).describe("Defines a silkscreen line on the PCB"),D0t=Pt({type:qe("pcb_silkscreen_path"),pcb_silkscreen_path_id:so("pcb_silkscreen_path"),pcb_component_id:Z(),pcb_group_id:Z().optional(),subcircuit_id:Z().optional(),layer:Vm,route:dn(Ti),stroke_width:ce}).describe("Defines a silkscreen path on the PCB"),N0t=Pt({type:qe("pcb_silkscreen_text"),pcb_silkscreen_text_id:so("pcb_silkscreen_text"),pcb_group_id:Z().optional(),subcircuit_id:Z().optional(),font:qe("tscircuit2024").default("tscircuit2024"),font_size:lt.default("0.2mm"),pcb_component_id:Z(),text:Z(),is_knockout:je().default(!1).optional(),knockout_padding:Pt({left:ce,top:ce,bottom:ce,right:ce}).default({left:"0.2mm",top:"0.2mm",bottom:"0.2mm",right:"0.2mm"}).optional(),ccw_rotation:_t().optional(),layer:Pr,is_mirrored:je().default(!1).optional(),anchor_position:Ti.default({x:0,y:0}),anchor_alignment:M8.default("center")}).describe("Defines silkscreen text on the PCB"),R0t=Pt({type:qe("pcb_copper_text"),pcb_copper_text_id:so("pcb_copper_text"),pcb_group_id:Z().optional(),subcircuit_id:Z().optional(),font:qe("tscircuit2024").default("tscircuit2024"),font_size:lt.default("0.2mm"),pcb_component_id:Z(),text:Z(),is_knockout:je().default(!1).optional(),knockout_padding:Pt({left:ce,top:ce,bottom:ce,right:ce}).default({left:"0.2mm",top:"0.2mm",bottom:"0.2mm",right:"0.2mm"}).optional(),ccw_rotation:_t().optional(),layer:Pr,is_mirrored:je().default(!1).optional(),anchor_position:Ti.default({x:0,y:0}),anchor_alignment:M8.default("center")}).describe("Defines copper text on the PCB"),T0t=Pt({type:qe("pcb_silkscreen_rect"),pcb_silkscreen_rect_id:so("pcb_silkscreen_rect"),pcb_component_id:Z(),pcb_group_id:Z().optional(),subcircuit_id:Z().optional(),center:Ti,width:ce,height:ce,layer:Pr,stroke_width:ce.default("1mm"),corner_radius:ce.optional(),is_filled:je().default(!0).optional(),has_stroke:je().optional(),is_stroke_dashed:je().optional(),ccw_rotation:_t().optional()}).describe("Defines a silkscreen rect on the PCB"),k0t=Pt({type:qe("pcb_silkscreen_circle"),pcb_silkscreen_circle_id:so("pcb_silkscreen_circle"),pcb_component_id:Z(),pcb_group_id:Z().optional(),subcircuit_id:Z().optional(),center:Ti,radius:ce,layer:Vm,stroke_width:ce.default("1mm"),is_filled:je().optional()}).describe("Defines a silkscreen circle on the PCB"),F0t=Pt({type:qe("pcb_silkscreen_oval"),pcb_silkscreen_oval_id:so("pcb_silkscreen_oval"),pcb_component_id:Z(),pcb_group_id:Z().optional(),subcircuit_id:Z().optional(),center:Ti,radius_x:lt,radius_y:lt,layer:Vm,ccw_rotation:oA.optional()}).describe("Defines a silkscreen oval on the PCB"),w8n=Pt({type:qe("pcb_silkscreen_graphic"),pcb_silkscreen_graphic_id:so("pcb_silkscreen_graphic"),pcb_component_id:Z(),pcb_group_id:Z().optional(),subcircuit_id:Z().optional(),layer:Vm,image_asset:Fne.optional()}),L0t=w8n.extend({shape:qe("brep"),brep_shape:_3e}).describe("Defines a BRep silkscreen graphic on the PCB"),H0t=_y("shape",[L0t]).describe("Defines a silkscreen graphic on the PCB"),O0t=Pt({type:qe("pcb_silkscreen_pill"),pcb_silkscreen_pill_id:so("pcb_silkscreen_pill"),pcb_component_id:Z(),pcb_group_id:Z().optional(),subcircuit_id:Z().optional(),center:Ti,width:ce,height:ce,layer:Pr,ccw_rotation:_t().optional()}).describe("Defines a silkscreen pill on the PCB"),C3e=Pt({type:qe("pcb_fabrication_note_text"),pcb_fabrication_note_text_id:so("pcb_fabrication_note_text"),subcircuit_id:Z().optional(),pcb_group_id:Z().optional(),font:qe("tscircuit2024").default("tscircuit2024"),font_size:lt.default("1mm"),pcb_component_id:Z(),text:Z(),ccw_rotation:_t().optional(),layer:Vm,anchor_position:Ti.default({x:0,y:0}),anchor_alignment:Kn(["center","top_left","top_right","bottom_left","bottom_right"]).default("center"),color:Z().optional()}).describe("Defines a fabrication note in text on the PCB, useful for leaving notes for assemblers or fabricators"),y3e=Pt({type:qe("pcb_fabrication_note_path"),pcb_fabrication_note_path_id:so("pcb_fabrication_note_path"),pcb_component_id:Z(),subcircuit_id:Z().optional(),layer:Pr,route:dn(Ti),stroke_width:ce,color:Z().optional()}).describe("Defines a fabrication path on the PCB for fabricators or assemblers"),x3e=Pt({type:qe("pcb_fabrication_note_rect"),pcb_fabrication_note_rect_id:so("pcb_fabrication_note_rect"),pcb_component_id:Z(),pcb_group_id:Z().optional(),subcircuit_id:Z().optional(),center:Ti,width:ce,height:ce,layer:Vm,stroke_width:ce.default("0.1mm"),corner_radius:ce.optional(),is_filled:je().optional(),has_stroke:je().optional(),is_stroke_dashed:je().optional(),color:Z().optional()}).describe("Defines a fabrication note rectangle on the PCB"),E3e=Pt({type:qe("pcb_fabrication_note_dimension"),pcb_fabrication_note_dimension_id:so("pcb_fabrication_note_dimension"),pcb_component_id:Z(),pcb_group_id:Z().optional(),subcircuit_id:Z().optional(),layer:Vm,from:Ti,to:Ti,text:Z().optional(),text_ccw_rotation:_t().optional(),offset:ce.optional(),offset_distance:ce.optional(),offset_direction:Pt({x:_t(),y:_t()}).optional(),font:qe("tscircuit2024").default("tscircuit2024"),font_size:ce.default("1mm"),color:Z().optional(),arrow_size:ce.default("1mm")}).describe("Defines a measurement annotation within PCB fabrication notes"),B3e=Pt({type:qe("pcb_note_text"),pcb_note_text_id:so("pcb_note_text"),pcb_component_id:Z().optional(),pcb_group_id:Z().optional(),subcircuit_id:Z().optional(),name:Z().optional(),font:qe("tscircuit2024").default("tscircuit2024"),font_size:lt.default("1mm"),text:Z().optional(),anchor_position:Ti.default({x:0,y:0}),anchor_alignment:Kn(["center","top_left","top_right","bottom_left","bottom_right"]).default("center"),layer:Vm.default("top"),is_mirrored_from_top_view:je().optional(),color:Z().optional()}).describe("Defines a documentation note in text on the PCB"),b3e=Pt({type:qe("pcb_note_rect"),pcb_note_rect_id:so("pcb_note_rect"),pcb_component_id:Z().optional(),pcb_group_id:Z().optional(),subcircuit_id:Z().optional(),name:Z().optional(),text:Z().optional(),center:Ti,width:ce,height:ce,layer:Vm.default("top"),stroke_width:ce.default("0.1mm"),corner_radius:ce.optional(),is_filled:je().optional(),has_stroke:je().optional(),is_stroke_dashed:je().optional(),color:Z().optional()}).describe("Defines a rectangular documentation note on the PCB"),S3e=Pt({type:qe("pcb_note_path"),pcb_note_path_id:so("pcb_note_path"),pcb_component_id:Z().optional(),pcb_group_id:Z().optional(),subcircuit_id:Z().optional(),name:Z().optional(),text:Z().optional(),route:dn(Ti),layer:Vm.default("top"),stroke_width:ce.default("0.1mm"),color:Z().optional()}).describe("Defines a polyline documentation note on the PCB"),Q3e=Pt({type:qe("pcb_note_line"),pcb_note_line_id:so("pcb_note_line"),pcb_component_id:Z().optional(),pcb_group_id:Z().optional(),subcircuit_id:Z().optional(),name:Z().optional(),text:Z().optional(),x1:lt,y1:lt,x2:lt,y2:lt,layer:Vm.default("top"),stroke_width:lt.default("0.1mm"),color:Z().optional(),is_dashed:je().optional()}).describe("Defines a straight documentation note line on the PCB"),v3e=Pt({type:qe("pcb_note_dimension"),pcb_note_dimension_id:so("pcb_note_dimension"),pcb_component_id:Z().optional(),pcb_group_id:Z().optional(),subcircuit_id:Z().optional(),name:Z().optional(),from:Ti,to:Ti,text:Z().optional(),text_ccw_rotation:_t().optional(),offset_distance:ce.optional(),offset_direction:Pt({x:_t(),y:_t()}).optional(),font:qe("tscircuit2024").default("tscircuit2024"),font_size:ce.default("1mm"),layer:Vm.default("top"),color:Z().optional(),arrow_size:ce.default("1mm")}).describe("Defines a measurement annotation within PCB documentation notes"),G0t=Ml.extend({type:qe("pcb_footprint_overlap_error"),pcb_error_id:so("pcb_error"),error_type:qe("pcb_footprint_overlap_error").default("pcb_footprint_overlap_error"),pcb_smtpad_ids:dn(Z()).optional(),pcb_plated_hole_ids:dn(Z()).optional(),pcb_hole_ids:dn(Z()).optional(),pcb_keepout_ids:dn(Z()).optional()}).describe("Error emitted when a pcb footprint overlaps with another element"),Y0t=Ml.extend({type:qe("pcb_courtyard_overlap_error"),pcb_error_id:so("pcb_error"),error_type:qe("pcb_courtyard_overlap_error").default("pcb_courtyard_overlap_error"),pcb_component_ids:fQ([Z(),Z()])}).describe("Error emitted when the courtyard (CrtYd) of one PCB component overlaps with the courtyard of another"),U0t=Pt({type:qe("pcb_keepout"),shape:qe("outline"),pcb_group_id:Z().optional(),subcircuit_id:Z().optional(),outline:dn(Ti).min(2),stroke_width:ce,pcb_keepout_id:Z(),layers:dn(Z()),description:Z().optional(),excluded_pcb_component_ids:dn(Z()).optional()}),w3e=Pt({type:qe("pcb_keepout"),shape:qe("rect"),pcb_group_id:Z().optional(),subcircuit_id:Z().optional(),center:Ti,width:lt,height:lt,pcb_keepout_id:Z(),layers:dn(Z()),description:Z().optional(),excluded_pcb_component_ids:dn(Z()).optional()}).or(Pt({type:qe("pcb_keepout"),shape:qe("circle"),pcb_group_id:Z().optional(),subcircuit_id:Z().optional(),center:Ti,radius:lt,pcb_keepout_id:Z(),layers:dn(Z()),description:Z().optional(),excluded_pcb_component_ids:dn(Z()).optional()})).or(U0t),Une=Pt({type:qe("pcb_cutout"),pcb_cutout_id:so("pcb_cutout"),pcb_component_id:Z().optional(),pcb_group_id:Z().optional(),subcircuit_id:Z().optional(),pcb_board_id:Z().optional(),pcb_panel_id:Z().optional()}),K0t=Une.extend({shape:qe("rect"),center:Ti,width:ce,height:ce,rotation:oA.optional(),corner_radius:ce.optional()}),V0t=Une.extend({shape:qe("circle"),center:Ti,radius:ce}),z0t=Une.extend({shape:qe("polygon"),points:dn(Ti)}),J0t=Une.extend({shape:qe("path"),route:dn(Ti),slot_width:ce,slot_length:ce.optional(),space_between_slots:ce.optional(),slot_corner_radius:ce.optional()}),P3e=_y("shape",[K0t,V0t,z0t,J0t]).describe("Defines a cutout on the PCB, removing board material."),W0t=Ml.extend({type:qe("pcb_missing_footprint_error"),pcb_missing_footprint_error_id:so("pcb_missing_footprint_error"),pcb_group_id:Z().optional(),subcircuit_id:Z().optional(),error_type:qe("pcb_missing_footprint_error").default("pcb_missing_footprint_error"),source_component_id:Z()}).describe("Defines a missing footprint error on the PCB"),FV=Ml.extend({type:qe("external_footprint_load_error"),external_footprint_load_error_id:so("external_footprint_load_error"),pcb_component_id:Z(),source_component_id:Z(),pcb_group_id:Z().optional(),subcircuit_id:Z().optional(),footprinter_string:Z().optional(),error_type:qe("external_footprint_load_error").default("external_footprint_load_error")}).describe("Defines an error when an external footprint fails to load"),M3e=Ml.extend({type:qe("circuit_json_footprint_load_error"),circuit_json_footprint_load_error_id:so("circuit_json_footprint_load_error"),pcb_component_id:Z(),source_component_id:Z(),pcb_group_id:Z().optional(),subcircuit_id:Z().optional(),error_type:qe("circuit_json_footprint_load_error").default("circuit_json_footprint_load_error"),circuit_json:dn(ud()).optional()}).describe("Defines an error when a circuit JSON footprint fails to load"),j0t=Pt({type:qe("pcb_group"),pcb_group_id:so("pcb_group"),source_group_id:Z(),is_subcircuit:je().optional(),subcircuit_id:Z().optional(),width:ce.optional(),height:ce.optional(),center:Ti,display_offset_x:Z().optional().describe("How to display the x offset for this group, usually corresponding with how the user specified it"),display_offset_y:Z().optional().describe("How to display the y offset for this group, usually corresponding with how the user specified it"),outline:dn(Ti).optional(),anchor_position:Ti.optional(),anchor_alignment:M8.default("center"),position_mode:Kn(["packed","relative_to_group_anchor","none"]).optional(),positioned_relative_to_pcb_group_id:Z().optional(),positioned_relative_to_pcb_board_id:Z().optional(),pcb_component_ids:dn(Z()),child_layout_mode:Kn(["packed","none"]).optional(),name:Z().optional(),description:Z().optional(),layout_mode:Z().optional(),autorouter_configuration:Pt({trace_clearance:ce}).optional(),autorouter_used_string:Z().optional()}).describe("Defines a group of components on the PCB"),q0t=Ml.extend({type:qe("pcb_autorouting_error"),pcb_error_id:so("pcb_autorouting_error"),error_type:qe("pcb_autorouting_error").default("pcb_autorouting_error"),subcircuit_id:Z().optional()}).describe("The autorouting has failed to route a portion of the board"),D3e=Pt({type:qe("pcb_manual_edit_conflict_warning"),pcb_manual_edit_conflict_warning_id:so("pcb_manual_edit_conflict_warning"),warning_type:qe("pcb_manual_edit_conflict_warning").default("pcb_manual_edit_conflict_warning"),message:Z(),pcb_component_id:Z(),pcb_group_id:Z().optional(),subcircuit_id:Z().optional(),source_component_id:Z()}).describe("Warning emitted when a component has both manual placement and explicit pcbX/pcbY coordinates"),X0t=Kn(["x-","x+","y+","y-"]),$0t=Pt({type:qe("pcb_connector_not_in_accessible_orientation_warning"),pcb_connector_not_in_accessible_orientation_warning_id:so("pcb_connector_not_in_accessible_orientation_warning"),warning_type:qe("pcb_connector_not_in_accessible_orientation_warning").default("pcb_connector_not_in_accessible_orientation_warning"),message:Z(),pcb_component_id:Z(),source_component_id:Z().optional(),pcb_board_id:Z().optional(),facing_direction:X0t,recommended_facing_direction:X0t,subcircuit_id:Z().optional()}).describe("Warning emitted when a connector PCB component is facing inward toward the board and should be reoriented to an outward-facing direction"),Z0t=Pt({type:qe("pcb_component_missing_courtyard_warning"),pcb_component_missing_courtyard_warning_id:so("pcb_component_missing_courtyard_warning"),warning_type:qe("pcb_component_missing_courtyard_warning").default("pcb_component_missing_courtyard_warning"),message:Z(),pcb_component_id:Z(),source_component_id:Z().optional(),subcircuit_id:Z().optional()}).describe("Warning emitted when a PCB component has no courtyard geometry"),N3e=Pt({type:qe("supplier_footprint_mismatch_warning"),supplier_footprint_mismatch_warning_id:so("supplier_footprint_mismatch_warning"),warning_type:qe("supplier_footprint_mismatch_warning").default("supplier_footprint_mismatch_warning"),message:Z(),source_component_id:Z(),pcb_component_id:Z().optional(),pcb_group_id:Z().optional(),subcircuit_id:Z().optional(),supplier_name:JM.optional(),supplier_part_number:Z().optional(),supplier_footprint_url:Z().optional(),footprint_copper_intersection_over_union:_t()}).describe("Warning emitted when a supplier part footprint does not match the expected footprint"),egt=Pt({type:qe("pcb_fabricator_extra_charge_warning"),pcb_fabricator_extra_charge_warning_id:so("pcb_fabricator_extra_charge_warning"),warning_type:qe("pcb_fabricator_extra_charge_warning").default("pcb_fabricator_extra_charge_warning"),message:Z(),fabricator_preset:Z(),pcb_board_id:Z().optional(),pcb_via_ids:dn(Z()).optional(),subcircuit_id:Z().optional()}).describe("Warning that a design feature incurs an extra charge for the selected fabricator preset, such as via hole diameters below 0.3 mm with JLCPCB economy or standard presets."),tgt=Pt({type:qe("pcb_breakout_point"),pcb_breakout_point_id:so("pcb_breakout_point"),pcb_group_id:Z(),subcircuit_id:Z().optional(),source_trace_id:Z().optional(),source_port_id:Z().optional(),source_net_id:Z().optional(),layer:Pr.optional(),x:lt,y:lt}).describe("Defines a routing target within a pcb_group for a source_trace or source_net"),ngt=Pt({type:qe("pcb_ground_plane"),pcb_ground_plane_id:so("pcb_ground_plane"),source_pcb_ground_plane_id:Z(),source_net_id:Z(),pcb_group_id:Z().optional(),subcircuit_id:Z().optional()}).describe("Defines a ground plane on the PCB"),ogt=Pt({type:qe("pcb_ground_plane_region"),pcb_ground_plane_region_id:so("pcb_ground_plane_region"),pcb_ground_plane_id:Z(),pcb_group_id:Z().optional(),subcircuit_id:Z().optional(),layer:Pr,points:dn(Ti)}).describe("Defines a polygon region of a ground plane"),igt=Pt({type:qe("pcb_thermal_spoke"),pcb_thermal_spoke_id:so("pcb_thermal_spoke"),pcb_ground_plane_id:Z(),shape:Z(),spoke_count:_t(),spoke_thickness:lt,spoke_inner_diameter:lt,spoke_outer_diameter:lt,pcb_plated_hole_id:Z().optional(),subcircuit_id:Z().optional()}).describe("Pattern for connecting a ground plane to a plated hole"),R3e=Pt({type:qe("pcb_copper_pour"),pcb_copper_pour_id:so("pcb_copper_pour"),pcb_group_id:Z().optional(),subcircuit_id:Z().optional(),layer:Pr,source_net_id:Z().optional(),covered_with_solder_mask:je().optional().default(!0)}),rgt=R3e.extend({shape:qe("rect"),center:Ti,width:ce,height:ce,rotation:oA.optional()}),sgt=R3e.extend({shape:qe("brep"),brep_shape:_3e}),agt=R3e.extend({shape:qe("polygon"),points:dn(Ti)}),T3e=_y("shape",[rgt,sgt,agt]).describe("Defines a copper pour on the PCB."),Agt=Ml.extend({type:qe("pcb_component_outside_board_error"),pcb_component_outside_board_error_id:so("pcb_component_outside_board_error"),error_type:qe("pcb_component_outside_board_error").default("pcb_component_outside_board_error"),pcb_component_id:Z(),pcb_board_id:Z(),component_center:Ti,component_bounds:Pt({min_x:_t(),max_x:_t(),min_y:_t(),max_y:_t()}),subcircuit_id:Z().optional(),source_component_id:Z().optional()}).describe("Error emitted when a PCB component is placed outside the board boundaries"),cgt=Ml.extend({type:qe("pcb_component_not_on_board_edge_error"),pcb_component_not_on_board_edge_error_id:so("pcb_component_not_on_board_edge_error"),error_type:qe("pcb_component_not_on_board_edge_error").default("pcb_component_not_on_board_edge_error"),pcb_component_id:Z(),pcb_board_id:Z(),component_center:Ti,pad_to_nearest_board_edge_distance:_t(),source_component_id:Z().optional(),subcircuit_id:Z().optional()}).describe("Error emitted when a component that must be placed on the board edge is centered away from the edge"),Kne=Ml.extend({type:qe("pcb_component_invalid_layer_error"),pcb_component_invalid_layer_error_id:so("pcb_component_invalid_layer_error"),error_type:qe("pcb_component_invalid_layer_error").default("pcb_component_invalid_layer_error"),pcb_component_id:Z().optional(),source_component_id:Z(),layer:Pr,subcircuit_id:Z().optional()}).describe("Error emitted when a component is placed on an invalid layer (components can only be on 'top' or 'bottom' layers)"),lgt=Ml.extend({type:qe("pcb_via_clearance_error"),pcb_error_id:so("pcb_error"),error_type:qe("pcb_via_clearance_error").default("pcb_via_clearance_error"),pcb_via_ids:dn(Z()).min(2),minimum_clearance:lt.optional(),actual_clearance:lt.optional(),pcb_center:Pt({x:_t().optional(),y:_t().optional()}).optional(),subcircuit_id:Z().optional()}).describe("Error emitted when vias are closer than the allowed clearance"),ggt=Ml.extend({type:qe("pcb_via_trace_clearance_error"),pcb_via_trace_clearance_error_id:so("pcb_via_trace_clearance_error"),error_type:qe("pcb_via_trace_clearance_error").default("pcb_via_trace_clearance_error"),pcb_via_id:Z(),pcb_trace_id:Z(),minimum_clearance:lt.optional(),actual_clearance:lt.optional(),center:Pt({x:_t().optional(),y:_t().optional()}).optional(),subcircuit_id:Z().optional()}).describe("Error emitted when a via and trace are closer than the allowed clearance"),ugt=Ml.extend({type:qe("pcb_pad_pad_clearance_error"),pcb_pad_pad_clearance_error_id:so("pcb_pad_pad_clearance_error"),error_type:qe("pcb_pad_pad_clearance_error").default("pcb_pad_pad_clearance_error"),pcb_pad_ids:dn(Z()).min(2),minimum_clearance:lt.optional(),actual_clearance:lt.optional(),center:Pt({x:_t().optional(),y:_t().optional()}).optional(),subcircuit_id:Z().optional()}).describe("Error emitted when pads are closer than the allowed clearance"),dgt=Ml.extend({type:qe("pcb_pad_trace_clearance_error"),pcb_pad_trace_clearance_error_id:so("pcb_pad_trace_clearance_error"),error_type:qe("pcb_pad_trace_clearance_error").default("pcb_pad_trace_clearance_error"),pcb_pad_id:Z(),pcb_trace_id:Z(),minimum_clearance:lt.optional(),actual_clearance:lt.optional(),center:Pt({x:_t().optional(),y:_t().optional()}).optional(),subcircuit_id:Z().optional()}).describe("Error emitted when a pad and trace are closer than allowed clearance"),k3e=Pt({type:qe("pcb_courtyard_rect"),pcb_courtyard_rect_id:so("pcb_courtyard_rect"),pcb_component_id:Z(),pcb_group_id:Z().optional(),subcircuit_id:Z().optional(),center:Ti,width:ce,height:ce,layer:Vm,ccw_rotation:oA.optional(),color:Z().optional()}).describe("Defines a courtyard rectangle on the PCB"),F3e=Pt({type:qe("pcb_courtyard_outline"),pcb_courtyard_outline_id:so("pcb_courtyard_outline"),pcb_component_id:Z(),pcb_group_id:Z().optional(),subcircuit_id:Z().optional(),layer:Vm,outline:dn(Ti).min(2)}).describe("Defines a courtyard outline on the PCB"),L3e=Pt({type:qe("pcb_courtyard_polygon"),pcb_courtyard_polygon_id:so("pcb_courtyard_polygon"),pcb_component_id:Z(),pcb_group_id:Z().optional(),subcircuit_id:Z().optional(),layer:Vm,points:dn(Ti).min(3),color:Z().optional()}).describe("Defines a courtyard polygon on the PCB"),H3e=Pt({type:qe("pcb_courtyard_circle"),pcb_courtyard_circle_id:so("pcb_courtyard_circle"),pcb_component_id:Z(),pcb_group_id:Z().optional(),subcircuit_id:Z().optional(),center:Ti,radius:ce,layer:Vm,color:Z().optional()}).describe("Defines a courtyard circle on the PCB"),O3e=Pt({type:qe("pcb_courtyard_pill"),pcb_courtyard_pill_id:so("pcb_courtyard_pill"),pcb_component_id:Z(),pcb_group_id:Z().optional(),subcircuit_id:Z().optional(),center:Ti,width:ce,height:ce,radius:ce,layer:Vm,color:Z().optional()}).describe("Defines a courtyard pill on the PCB"),P8n=["obj","stl","3mf","gltf","glb","step","wrl"],hgt=["x+","x-","y+","y-","z+","z-"],M8n={obj:"z+",stl:"z+","3mf":"z+",gltf:"y+",glb:"y+",step:"z+",wrl:"y+"},pgt=Pt({type:qe("cad_component"),cad_component_id:Z(),pcb_component_id:Z(),source_component_id:Z(),position:D9,rotation:D9.optional(),size:D9.optional(),layer:Pr.optional(),subcircuit_id:Z().optional(),footprinter_string:Z().optional(),model_obj_url:Z().optional(),model_stl_url:Z().optional(),model_3mf_url:Z().optional(),model_gltf_url:Z().optional(),model_glb_url:Z().optional(),model_step_url:Z().optional(),model_wrl_url:Z().optional(),model_asset:Fne.optional(),model_unit_to_mm_scale_factor:_t().optional(),model_board_normal_direction:Kn(hgt).optional().describe(`The direction in the model's coordinate space that is considered "up" or "coming out of the board surface"`),model_origin_position:D9.optional(),model_origin_alignment:Kn(["unknown","center","center_of_component_on_board_surface","bottom_center_of_component"]).optional(),model_object_fit:Kn(["contain_within_bounds","fill_bounds"]).optional().default("contain_within_bounds"),model_jscad:ud().optional(),show_as_translucent_model:je().optional(),show_as_bounding_box:je().optional(),show_hidden_edges:je().optional(),anchor_alignment:Kn(["center","center_of_component_on_board_surface"]).optional().default("center")}).describe("Defines a component on the PCB"),G3e=Kn(["sinewave","square","triangle","sawtooth"]),D8n=xo([Z(),_t()]).transform(t=>typeof t=="string"?t.endsWith("%")?parseFloat(t.slice(0,-1))/100:parseFloat(t):t).pipe(_t().min(0,"Duty cycle must be non-negative").max(1,"Duty cycle cannot be greater than 100%")),mgt=Pt({type:qe("simulation_voltage_source"),simulation_voltage_source_id:so("simulation_voltage_source"),is_dc_source:qe(!0).optional().default(!0),positive_source_port_id:Z().optional(),negative_source_port_id:Z().optional(),positive_source_net_id:Z().optional(),negative_source_net_id:Z().optional(),voltage:O_,ac_magnitude:O_.optional(),ac_phase:oA.optional()}).describe("Defines a DC voltage source for simulation"),_gt=Pt({type:qe("simulation_voltage_source"),simulation_voltage_source_id:so("simulation_voltage_source"),is_dc_source:qe(!1),terminal1_source_port_id:Z().optional(),terminal2_source_port_id:Z().optional(),terminal1_source_net_id:Z().optional(),terminal2_source_net_id:Z().optional(),voltage:O_.optional(),frequency:fy.optional(),peak_to_peak_voltage:O_.optional(),wave_shape:G3e.optional(),phase:oA.optional(),duty_cycle:D8n.optional(),pulse_delay:Pl.optional(),rise_time:Pl.optional(),fall_time:Pl.optional(),pulse_width:Pl.optional(),period:Pl.optional(),ac_magnitude:O_.optional(),ac_phase:oA.optional()}).describe("Defines an AC voltage source for simulation"),fgt=xo([mgt,_gt]).describe("Defines a voltage source for simulation"),N8n=xo([Z(),_t()]).transform(t=>typeof t=="string"?t.endsWith("%")?parseFloat(t.slice(0,-1))/100:parseFloat(t):t).pipe(_t().min(0,"Duty cycle must be non-negative").max(1,"Duty cycle cannot be greater than 100%")),Igt=Pt({type:qe("simulation_current_source"),simulation_current_source_id:so("simulation_current_source"),is_dc_source:qe(!0).optional().default(!0),positive_source_port_id:Z().optional(),negative_source_port_id:Z().optional(),positive_source_net_id:Z().optional(),negative_source_net_id:Z().optional(),current:R3,ac_magnitude:R3.optional(),ac_phase:oA.optional()}).describe("Defines a DC current source for simulation"),Cgt=Pt({type:qe("simulation_current_source"),simulation_current_source_id:so("simulation_current_source"),is_dc_source:qe(!1),terminal1_source_port_id:Z().optional(),terminal2_source_port_id:Z().optional(),terminal1_source_net_id:Z().optional(),terminal2_source_net_id:Z().optional(),current:R3.optional(),frequency:fy.optional(),peak_to_peak_current:R3.optional(),wave_shape:G3e.optional(),phase:oA.optional(),duty_cycle:N8n.optional(),ac_magnitude:R3.optional(),ac_phase:oA.optional()}).describe("Defines an AC current source for simulation"),ygt=xo([Igt,Cgt]).describe("Defines a current source for simulation"),Vne=P0(t=>t==="V"||t==="A"),Y3e=P0(t=>t==="Ω"||t==="F"||t==="H"||t==="V"||t==="A"),xgt=xo([qe("spice_dc_sweep"),qe("spice_dc_operating_point"),qe("spice_transient_analysis"),qe("spice_ac_analysis")]),Egt=Pt({method:Kn(["trap","gear"]).optional(),reltol:xo([_t(),Z()]).optional(),abstol:xo([_t(),Z()]).optional(),vntol:xo([_t(),Z()]).optional()}).describe("SPICE solver options for a simulation experiment"),Bgt=Pt({type:qe("simulation_experiment"),simulation_experiment_id:so("simulation_experiment"),name:Z(),experiment_type:xgt,time_per_step:qk.optional(),start_time_ms:Pl.optional(),end_time_ms:Pl.optional(),spice_options:Egt.optional(),dc_sweep_voltage_source_id:Z().optional(),dc_sweep_current_source_id:Z().optional(),dc_sweep_start:_t().optional(),dc_sweep_stop:_t().optional(),dc_sweep_step:_t().refine(t=>t!==0).optional(),dc_sweep_unit:Vne.optional(),ac_sweep_type:Kn(["linear","decade","octave"]).optional(),ac_samples_per_interval:_t().int().positive().optional(),ac_sample_count:_t().int().positive().optional(),ac_start_frequency_hz:_t().positive().optional(),ac_stop_frequency_hz:_t().positive().optional()}).superRefine((t,e)=>{if(t.experiment_type==="spice_dc_sweep"){const n=["dc_sweep_start","dc_sweep_stop","dc_sweep_step","dc_sweep_unit"];for(const r of n)t[r]===void 0&&e.addIssue({code:lo.custom,path:[r],message:`${r} is required for a DC sweep`});const o=t.dc_sweep_voltage_source_id!==void 0,i=t.dc_sweep_current_source_id!==void 0;o===i&&e.addIssue({code:lo.custom,path:["dc_sweep_voltage_source_id"],message:"Exactly one DC sweep voltage or current source ID is required"})}t.experiment_type==="spice_ac_analysis"&&(t.ac_sweep_type===void 0&&e.addIssue({code:lo.custom,path:["ac_sweep_type"],message:"ac_sweep_type is required for an AC analysis"}),t.ac_start_frequency_hz===void 0&&e.addIssue({code:lo.custom,path:["ac_start_frequency_hz"],message:"ac_start_frequency_hz is required for an AC analysis"}),t.ac_stop_frequency_hz===void 0&&e.addIssue({code:lo.custom,path:["ac_stop_frequency_hz"],message:"ac_stop_frequency_hz is required for an AC analysis"}),t.ac_sweep_type==="linear"&&t.ac_sample_count===void 0&&e.addIssue({code:lo.custom,path:["ac_sample_count"],message:"ac_sample_count is required for a linear AC analysis"}),(t.ac_sweep_type==="decade"||t.ac_sweep_type==="octave")&&t.ac_samples_per_interval===void 0&&e.addIssue({code:lo.custom,path:["ac_samples_per_interval"],message:"ac_samples_per_interval is required for decade and octave AC analyses"}))}).describe("Defines a simulation experiment configuration"),D8=Pt({simulation_parameter_sweep_id:Z(),sweep_index:_t().int().nonnegative(),parameter_value:_t(),parameter_unit:Y3e}),bgt=Pt({type:qe("simulation_transient_voltage_graph"),simulation_transient_voltage_graph_id:so("simulation_transient_voltage_graph"),simulation_experiment_id:Z(),simulation_parameter_sweep_coordinate:D8.optional(),timestamps_ms:dn(_t()).optional(),voltage_levels:dn(_t()),source_component_id:Z().optional(),subcircuit_connectivity_map_key:Z().optional(),time_per_step:qk,start_time_ms:Pl,end_time_ms:Pl,name:Z().optional(),color:Z().optional()}).describe("Stores voltage measurements over time for a simulation"),Sgt=Pt({type:qe("simulation_transient_current_graph"),simulation_transient_current_graph_id:so("simulation_transient_current_graph"),simulation_experiment_id:Z(),simulation_parameter_sweep_coordinate:D8.optional(),timestamps_ms:dn(_t()).optional(),current_levels:dn(_t()),source_component_id:Z().optional(),subcircuit_connectivity_map_key:Z().optional(),time_per_step:qk,start_time_ms:Pl,end_time_ms:Pl,name:Z().optional(),color:Z().optional()}).describe("Stores current measurements over time for a simulation"),Qgt=Pt({type:qe("simulation_switch"),simulation_switch_id:so("simulation_switch"),source_component_id:Z().optional(),closes_at:Pl.optional(),opens_at:Pl.optional(),starts_closed:je().optional(),switching_frequency:fy.optional()}).describe("Defines a switch for simulation timing control"),vgt=Pt({type:qe("simulation_voltage_probe"),simulation_voltage_probe_id:so("simulation_voltage_probe"),source_component_id:Z().optional(),name:Z().optional(),signal_input_source_port_id:Z().optional(),signal_input_source_net_id:Z().optional(),reference_input_source_port_id:Z().optional(),reference_input_source_net_id:Z().optional(),subcircuit_id:Z().optional(),color:Z().optional()}).describe("Defines a voltage probe for simulation. If a reference input is not provided, it measures against ground. If a reference input is provided, it measures the differential voltage between two points.").superRefine((t,e)=>{if(t.reference_input_source_port_id||t.reference_input_source_net_id){const o=!!t.signal_input_source_port_id||!!t.reference_input_source_port_id,i=!!t.signal_input_source_net_id||!!t.reference_input_source_net_id;o&&i?e.addIssue({code:lo.custom,message:"Cannot mix port and net connections in a differential probe."}):o?(!t.signal_input_source_port_id||!t.reference_input_source_port_id)&&e.addIssue({code:lo.custom,message:"Differential port probe requires both signal_input_source_port_id and reference_input_source_port_id."}):i&&(!t.signal_input_source_net_id||!t.reference_input_source_net_id)&&e.addIssue({code:lo.custom,message:"Differential net probe requires both signal_input_source_net_id and reference_input_source_net_id."})}else!!t.signal_input_source_port_id==!!t.signal_input_source_net_id&&e.addIssue({code:lo.custom,message:"A voltage probe must have exactly one of signal_input_source_port_id or signal_input_source_net_id."})}),wgt=Pt({type:qe("simulation_current_probe"),simulation_current_probe_id:so("simulation_current_probe"),source_component_id:Z().optional(),name:Z().optional(),positive_source_port_id:Z().optional(),negative_source_port_id:Z().optional(),positive_source_net_id:Z().optional(),negative_source_net_id:Z().optional(),subcircuit_id:Z().optional(),color:Z().optional()}).describe("Defines a current probe for simulation. It measures current flowing from the positive endpoint to the negative endpoint.").superRefine((t,e)=>{const n=!!t.positive_source_port_id,o=!!t.negative_source_port_id,i=!!t.positive_source_net_id,r=!!t.negative_source_net_id,s=n||o,a=i||r;if(s&&a){e.addIssue({code:lo.custom,message:"Cannot mix port and net connections in a current probe."});return}if(s){(!n||!o)&&e.addIssue({code:lo.custom,message:"Current probe using source ports requires both positive_source_port_id and negative_source_port_id."});return}if(a){(!i||!r)&&e.addIssue({code:lo.custom,message:"Current probe using source nets requires both positive_source_net_id and negative_source_net_id."});return}e.addIssue({code:lo.custom,message:"A current probe must have either positive/negative source port ids or positive/negative source net ids."})}),Pgt=Ml.extend({type:qe("simulation_unknown_experiment_error"),simulation_unknown_experiment_error_id:so("simulation_unknown_experiment_error"),error_type:qe("simulation_unknown_experiment_error").default("simulation_unknown_experiment_error"),simulation_experiment_id:Z().optional(),subcircuit_id:Z().optional()}).describe("An unknown error occurred during the simulation experiment."),R8n=Kn(["resistance","capacitance","inductance","voltage","current"]),LV=Pt({type:qe("simulation_parameter_sweep"),simulation_parameter_sweep_id:so("simulation_parameter_sweep"),simulation_experiment_id:Z(),name:Z().optional(),parameter_values:dn(_t()).min(1),parameter_unit:Y3e}),Mgt=_y("parameter_type",[LV.extend({parameter_type:qe("resistance"),resistor_source_component_id:Z()}),LV.extend({parameter_type:qe("capacitance"),capacitor_source_component_id:Z()}),LV.extend({parameter_type:qe("inductance"),inductor_source_component_id:Z()}),LV.extend({parameter_type:qe("voltage"),source_net_id:Z()}),LV.extend({parameter_type:qe("current"),current_source_component_id:Z()})]).describe("Repeats a simulation experiment over component parameter values"),Dgt=Pt({type:qe("simulation_dc_operating_point_voltage"),simulation_dc_operating_point_voltage_id:so("simulation_dc_operating_point_voltage"),simulation_experiment_id:Z(),simulation_parameter_sweep_coordinate:D8.optional(),simulation_voltage_probe_id:Z(),voltage:_t(),name:Z().optional(),color:Z().optional()}),Ngt=Pt({type:qe("simulation_dc_operating_point_current"),simulation_dc_operating_point_current_id:so("simulation_dc_operating_point_current"),simulation_experiment_id:Z(),simulation_parameter_sweep_coordinate:D8.optional(),simulation_current_probe_id:Z(),current:_t(),name:Z().optional(),color:Z().optional()}),Rgt=Pt({type:qe("simulation_dc_sweep_voltage_graph"),simulation_dc_sweep_voltage_graph_id:so("simulation_dc_sweep_voltage_graph"),simulation_experiment_id:Z(),simulation_parameter_sweep_coordinate:D8.optional(),simulation_voltage_probe_id:Z(),sweep_values:dn(_t()),sweep_unit:Vne,voltage_levels:dn(_t()),name:Z().optional(),color:Z().optional()}).refine(t=>t.sweep_values.length===t.voltage_levels.length,{message:"sweep_values and voltage_levels must have the same length"}),Tgt=Pt({type:qe("simulation_dc_sweep_current_graph"),simulation_dc_sweep_current_graph_id:so("simulation_dc_sweep_current_graph"),simulation_experiment_id:Z(),simulation_parameter_sweep_coordinate:D8.optional(),simulation_current_probe_id:Z(),sweep_values:dn(_t()),sweep_unit:Vne,current_levels:dn(_t()),name:Z().optional(),color:Z().optional()}).refine(t=>t.sweep_values.length===t.current_levels.length,{message:"sweep_values and current_levels must have the same length"}),U3e=Pt({re:_t(),im:_t()}),kgt=Pt({type:qe("simulation_ac_sweep_voltage_graph"),simulation_ac_sweep_voltage_graph_id:so("simulation_ac_sweep_voltage_graph"),simulation_experiment_id:Z(),simulation_parameter_sweep_coordinate:D8.optional(),simulation_voltage_probe_id:Z(),frequencies_hz:dn(_t()),complex_voltages:dn(U3e),name:Z().optional(),color:Z().optional()}).refine(t=>t.frequencies_hz.length===t.complex_voltages.length,{message:"frequencies_hz and complex_voltages must have the same length"}),Fgt=Pt({type:qe("simulation_ac_sweep_current_graph"),simulation_ac_sweep_current_graph_id:so("simulation_ac_sweep_current_graph"),simulation_experiment_id:Z(),simulation_parameter_sweep_coordinate:D8.optional(),simulation_current_probe_id:Z(),frequencies_hz:dn(_t()),complex_currents:dn(U3e),name:Z().optional(),color:Z().optional()}).refine(t=>t.frequencies_hz.length===t.complex_currents.length,{message:"frequencies_hz and complex_currents must have the same length"}),Lgt=Pt({type:qe("simulation_op_amp"),simulation_op_amp_id:so("simulation_op_amp"),source_component_id:Z().optional(),inverting_input_source_port_id:Z(),non_inverting_input_source_port_id:Z(),output_source_port_id:Z(),positive_supply_source_port_id:Z(),negative_supply_source_port_id:Z()}).describe("Defines a simple ideal operational amplifier for simulation"),Hgt=Pt({type:qe("simulation_spice_subcircuit"),simulation_spice_subcircuit_id:so("simulation_spice_subcircuit"),source_component_id:Z(),spice_pin_to_source_port_map:bc(Z(),Z()),subcircuit_source:Z()}).describe("Defines a custom SPICE subcircuit model for simulation"),Ogt=t=>t!==void 0,Ggt=Pt({type:qe("simulation_oscilloscope_trace"),simulation_oscilloscope_trace_id:so("simulation_oscilloscope_trace"),simulation_transient_voltage_graph_id:Z().optional(),simulation_transient_current_graph_id:Z().optional(),simulation_voltage_probe_id:Z().optional(),simulation_current_probe_id:Z().optional(),display_name:Z().optional(),color:Z().optional(),display_center_value:_t().optional(),display_center_offset_divs:_t().optional(),volts_per_div:_t().positive().optional(),amps_per_div:_t().positive().optional()}).describe("Defines how a simulation measurement is rendered as an oscilloscope-style trace.").superRefine((t,e)=>{const n=[t.simulation_transient_voltage_graph_id,t.simulation_voltage_probe_id].filter(Ogt).length,o=[t.simulation_transient_current_graph_id,t.simulation_current_probe_id].filter(Ogt).length;n+o!==1&&e.addIssue({code:lo.custom,message:"An oscilloscope trace must reference exactly one voltage graph, current graph, voltage probe, or current probe."}),n>0&&t.amps_per_div!==void 0&&e.addIssue({code:lo.custom,message:"Voltage oscilloscope traces must use volts_per_div, not amps_per_div."}),o>0&&t.volts_per_div!==void 0&&e.addIssue({code:lo.custom,message:"Current oscilloscope traces must use amps_per_div, not volts_per_div."})}),K3e=xo([$ct,qct,Xct,jct,elt,Zct,Vxe,Yxe,Hne,Kxe,Uxe,zxe,Jxe,Wxe,Xxe,$xe,Zxe,i3e,e3e,t3e,n3e,o3e,qxe,jxe,olt,ilt,tlt,r3e,s3e,a3e,A3e,rlt,glt,c3e,l3e,slt,alt,Alt,clt,llt,TV,g3e,RV,nlt,jlt,Zlt,s0t,W0t,FV,M3e,D3e,$0t,Z0t,N3e,egt,a0t,w3e,A0t,B0t,u0t,m0t,_0t,f0t,I0t,Yne,l0t,g0t,b0t,S0t,j0t,P0t,M0t,D0t,N0t,O0t,R0t,T0t,k0t,F0t,H0t,C0t,y0t,Q0t,v0t,w0t,x0t,E0t,lgt,ggt,ugt,dgt,y3e,C3e,x3e,E3e,B3e,b3e,S3e,Q3e,v3e,q0t,G0t,Y0t,tgt,P3e,ngt,ogt,igt,T3e,Agt,cgt,Kne,k3e,F3e,L3e,H3e,O3e,ult,blt,Clt,ylt,xlt,Elt,flt,Ilt,Slt,Blt,dlt,vlt,wlt,Qlt,Nlt,Rlt,h3e,Tlt,klt,Klt,Flt,Hlt,Olt,Ult,Glt,Ylt,pgt,fgt,ygt,Bgt,bgt,Sgt,Dgt,Ngt,Rgt,Tgt,kgt,Fgt,Mgt,Qgt,vgt,wgt,Ggt,Pgt,Lgt,Hgt]),O4=K3e;const R9=Object.freeze(Object.defineProperty({__proto__:null,all_layers:Xk,any_circuit_element:K3e,any_soup_element:O4,any_source_component:jct,asset:Fne,base_circuit_json_error:Ml,battery_capacity:xct,brep_shape:_3e,cadModelDefaultDirectionMap:M8n,cad_component:pgt,cad_model_axis_directions:hgt,cad_model_formats:P8n,capacitance:zM,circuit_json_footprint_load_error:M3e,current:R3,distance:lt,duration_ms:qk,experiment_type:xgt,external_footprint_load_error:FV,frequency:fy,getRotationBetweenPcbPin1Locations:i8n,getZodPrefixedIdWithDefault:so,inductance:Tne,insertionDirectionToCanonical:f3e,insertionDirectionToVector:n8n,insertion_direction:zlt,kicadAt:Lne,kicadEffects:Ect,kicadFont:Gxe,kicadFootprintAttributes:bct,kicadFootprintMetadata:vct,kicadFootprintModel:Qct,kicadFootprintPad:Sct,kicadFootprintProperties:Bct,kicadProperty:NV,kicadSymbolEffects:Mct,kicadSymbolMetadata:Nct,kicadSymbolPinNames:Pct,kicadSymbolPinNumbers:wct,kicadSymbolProperties:Dct,kicadSymbolProperty:yQ,layer_ref:Pr,layer_string:u3e,length:ce,manufacturing_drc_properties:Wlt,ms:Pl,ninePointAnchor:M8,parseAndConvertSiUnit:X1,pcbRenderLayer:Z6n,pcb_autorouting_error:q0t,pcb_board:b0t,pcb_breakout_point:tgt,pcb_component:jlt,pcb_component_invalid_layer_error:Kne,pcb_component_missing_courtyard_warning:Z0t,pcb_component_not_on_board_edge_error:cgt,pcb_component_outside_board_error:Agt,pcb_connector_not_in_accessible_orientation_warning:$0t,pcb_copper_pour:T3e,pcb_copper_pour_brep:sgt,pcb_copper_pour_polygon:agt,pcb_copper_pour_rect:rgt,pcb_copper_text:R0t,pcb_courtyard_circle:H3e,pcb_courtyard_outline:F3e,pcb_courtyard_overlap_error:Y0t,pcb_courtyard_pill:O3e,pcb_courtyard_polygon:L3e,pcb_courtyard_rect:k3e,pcb_cutout:P3e,pcb_cutout_circle:V0t,pcb_cutout_path:J0t,pcb_cutout_polygon:z0t,pcb_cutout_rect:K0t,pcb_debug_line:Xlt,pcb_debug_object:Zlt,pcb_debug_object_base:Gne,pcb_debug_point:$lt,pcb_debug_rect:qlt,pcb_fabrication_note_dimension:E3e,pcb_fabrication_note_path:y3e,pcb_fabrication_note_rect:x3e,pcb_fabrication_note_text:C3e,pcb_fabricator_extra_charge_warning:egt,pcb_footprint_overlap_error:G0t,pcb_ground_plane:ngt,pcb_ground_plane_region:ogt,pcb_group:j0t,pcb_hole:s0t,pcb_hole_circle_or_square_shape:A8n,pcb_hole_circle_shape:s8n,pcb_hole_oval_shape:c8n,pcb_hole_pill_shape:l8n,pcb_hole_rect_shape:a8n,pcb_hole_rotated_pill_shape:g8n,pcb_keepout:w3e,pcb_keepout_outline:U0t,pcb_manual_edit_conflict_warning:D3e,pcb_missing_footprint_error:W0t,pcb_net:B0t,pcb_note_dimension:v3e,pcb_note_line:Q3e,pcb_note_path:S3e,pcb_note_rect:b3e,pcb_note_text:B3e,pcb_packing_error:v0t,pcb_pad_pad_clearance_error:ugt,pcb_pad_trace_clearance_error:dgt,pcb_panel:S0t,pcb_panelization_placement_error:w0t,pcb_pin1_location:kV,pcb_placement_error:Q0t,pcb_plated_hole:a0t,pcb_port:A0t,pcb_port_not_connected_error:E0t,pcb_port_not_matched_error:x0t,pcb_route_hint:Jlt,pcb_route_hints:r8n,pcb_silkscreen_circle:k0t,pcb_silkscreen_graphic:H0t,pcb_silkscreen_graphic_brep:L0t,pcb_silkscreen_line:M0t,pcb_silkscreen_oval:F0t,pcb_silkscreen_path:D0t,pcb_silkscreen_pill:O0t,pcb_silkscreen_rect:T0t,pcb_silkscreen_text:N0t,pcb_smtpad:l0t,pcb_smtpad_pill:c0t,pcb_solder_paste:g0t,pcb_text:u0t,pcb_thermal_spoke:igt,pcb_trace:m0t,pcb_trace_error:C0t,pcb_trace_hint:P0t,pcb_trace_missing_error:y0t,pcb_trace_route_point:I3e,pcb_trace_route_point_through_pad:p0t,pcb_trace_route_point_via:h0t,pcb_trace_route_point_wire:d0t,pcb_trace_too_long_warning:f0t,pcb_trace_too_many_vias_warning:I0t,pcb_trace_warning:_0t,pcb_via:Yne,pcb_via_clearance_error:lgt,pcb_via_trace_clearance_error:ggt,point:Ti,point3:D9,point_with_bulge:Vlt,port_arrangement:_lt,position:q6n,position3:X6n,resistance:P8,ring:m3e,rotation:oA,route_hint_point:N9,schematic_arc:Elt,schematic_box:ult,schematic_circle:xlt,schematic_component:flt,schematic_component_overlap_warning:Tlt,schematic_component_port_arrangement_by_sides:mlt,schematic_component_port_arrangement_by_size:plt,schematic_component_styling_warning:klt,schematic_debug_line:Mlt,schematic_debug_object:Nlt,schematic_debug_object_base:One,schematic_debug_point:Dlt,schematic_debug_rect:Plt,schematic_element_outside_sheet_warning:Flt,schematic_error:vlt,schematic_graphic:Hlt,schematic_group:Olt,schematic_layout_error:wlt,schematic_line:Clt,schematic_manual_edit_conflict_warning:h3e,schematic_missing_sheet_warning:Klt,schematic_net_label:Qlt,schematic_path:dlt,schematic_pin_styles:hlt,schematic_port:Slt,schematic_rect:ylt,schematic_sheet:Ult,schematic_sheet_size:p3e,schematic_symbol:Ilt,schematic_table:Glt,schematic_table_cell:Ylt,schematic_text:blt,schematic_text_part:d3e,schematic_trace:Blt,schematic_voltage_probe:Rlt,simulation_ac_current_source:Cgt,simulation_ac_sweep_current_graph:Fgt,simulation_ac_sweep_voltage_graph:kgt,simulation_ac_voltage_source:_gt,simulation_complex_sample:U3e,simulation_current_probe:wgt,simulation_current_source:ygt,simulation_dc_current_source:Igt,simulation_dc_operating_point_current:Ngt,simulation_dc_operating_point_voltage:Dgt,simulation_dc_sweep_current_graph:Tgt,simulation_dc_sweep_unit:Vne,simulation_dc_sweep_voltage_graph:Rgt,simulation_dc_voltage_source:mgt,simulation_experiment:Bgt,simulation_op_amp:Lgt,simulation_oscilloscope_trace:Ggt,simulation_parameter_sweep:Mgt,simulation_parameter_sweep_coordinate:D8,simulation_parameter_type:R8n,simulation_parameter_unit:Y3e,simulation_spice_subcircuit:Hgt,simulation_switch:Qgt,simulation_transient_current_graph:Sgt,simulation_transient_voltage_graph:bgt,simulation_unknown_experiment_error:Pgt,simulation_voltage_probe:vgt,simulation_voltage_source:fgt,size:kne,source_ambiguous_port_reference:nlt,source_board:tlt,source_component_base:Bg,source_component_internal_connection:Xct,source_component_misconfigured_error:RV,source_component_pins_underspecified_warning:Alt,source_confusing_net_name_warning:glt,source_failed_to_create_component_error:Kct,source_group:Zct,source_i2c_misconfigured_error:g3e,source_interconnect:Jct,source_invalid_component_property_error:s3e,source_manually_placed_via:ilt,source_missing_manufacturer_part_number_warning:c3e,source_missing_property_error:Uct,source_net:elt,source_no_ground_pin_defined_warning:alt,source_no_power_pin_defined_warning:slt,source_part_not_found_warning:TV,source_pcb_ground_plane:olt,source_pin_attributes:Hct,source_pin_missing_trace_warning:A3e,source_pin_must_be_connected_error:clt,source_port:qct,source_project_metadata:r3e,source_property_ignored_warning:Vct,source_refdes_convention_warning:l3e,source_simple_ammeter:Lct,source_simple_battery:Jxe,source_simple_capacitor:Yxe,source_simple_chip:Vxe,source_simple_connector:Yct,source_simple_connector_standards:Gct,source_simple_crystal:Oct,source_simple_current_source:kct,source_simple_diode:Hne,source_simple_fiducial:Rct,source_simple_fuse:Fct,source_simple_ground:Tct,source_simple_inductor:Wxe,source_simple_led:Kxe,source_simple_mosfet:n3e,source_simple_op_amp:o3e,source_simple_pin_header:Xxe,source_simple_pinout:$xe,source_simple_potentiometer:qxe,source_simple_power_source:zxe,source_simple_push_button:jxe,source_simple_resistor:Uxe,source_simple_resonator:Zxe,source_simple_switch:i3e,source_simple_test_point:t3e,source_simple_transistor:e3e,source_simple_voltage_probe:zct,source_simple_voltage_source:Wct,source_trace:$ct,source_trace_not_connected_error:a3e,source_unnamed_trace_warning:rlt,spice_simulation_options:Egt,supplier_footprint_mismatch_warning:N3e,supplier_name:JM,time:j6n,timestamp:yct,unknown_error_finding_part:llt,visible_layer:Vm,voltage:O_,wave_shape:G3e},Symbol.toStringTag,{value:"Module"}));function hn(t,e){return Array.isArray(e)?[t.a*e[0]+t.c*e[1]+t.e,t.b*e[0]+t.d*e[1]+t.f]:{x:t.a*e.x+t.c*e.y+t.e,y:t.b*e.x+t.d*e.y+t.f}}const T8n=/^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 k8n(t){const e=t.match(T8n);if(e===null||e.length<7)throw new Error(`'${t}' 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 F8n(t){const{a:e,b:n,c:o,d:i,e:r,f:s}=t,a=e*i-n*o;return{a:i/a,b:n/-a,c:o/-a,d:e/a,e:(i*r-o*s)/-a,f:(n*r-e*s)/a}}function HV(t){return typeof t>"u"}function G_(t,e=0){return{a:1,c:0,e:t,b:0,d:1,f:e}}function OV(...t){t=Array.isArray(t[0])?t[0]:t;const e=(n,o)=>({a:n.a*o.a+n.c*o.b,c:n.a*o.c+n.c*o.d,e:n.a*o.e+n.c*o.f+n.e,b:n.b*o.a+n.d*o.b,d:n.b*o.c+n.d*o.d,f:n.b*o.e+n.d*o.f+n.f});switch(t.length){case 0:throw new Error("no matrices provided");case 1:return t[0];case 2:return e(t[0],t[1]);default:{const[n,o,...i]=t,r=e(n,o);return OV(r,...i)}}}function l0(...t){return OV(...t)}const{cos:L8n,sin:H8n}=Math;function N8(t,e,n){const o=L8n(t),i=H8n(t),r={a:o,c:-i,e:0,b:i,d:o,f:0};return HV(e)||HV(n)?r:OV([G_(e,n),r,G_(-e,-n)])}function sx(t,e=void 0,n=void 0,o=void 0){HV(e)&&(e=t);const i={a:t,c:0,e:0,b:0,d:e,f:0};return HV(n)||HV(o)?i:OV([G_(n,o),i,G_(-n,-o)])}function O8n(t){return R8(t)}function R8(t){return`matrix(${t.a},${t.b},${t.c},${t.d},${t.e},${t.f})`}function G8n(t,e=1e10){return{a:Math.round(t.a*e)/e,b:Math.round(t.b*e)/e,c:Math.round(t.c*e)/e,d:Math.round(t.d*e)/e,e:Math.round(t.e*e)/e,f:Math.round(t.f*e)/e}}function Y8n(t,e){const n=t[0].x!=null?t[0].x:t[0][0],o=t[0].y!=null?t[0].y:t[0][1],i=e[0].x!=null?e[0].x:e[0][0],r=e[0].y!=null?e[0].y:e[0][1],s=t[1].x!=null?t[1].x:t[1][0],a=t[1].y!=null?t[1].y:t[1][1],A=e[1].x!=null?e[1].x:e[1][0],c=e[1].y!=null?e[1].y:e[1][1],l=t[2].x!=null?t[2].x:t[2][0],g=t[2].y!=null?t[2].y:t[2][1],u=e[2].x!=null?e[2].x:e[2][0],h=e[2].y!=null?e[2].y:e[2][1],d={a:n-l,b:o-g,c:s-l,d:a-g,e:l,f:g},p={a:i-u,b:r-h,c:A-u,d:c-h,e:u,f:h},m=F8n(d),_=OV([p,m]);return G8n(_)}function U8n(t,e){function n(){this.constructor=t}n.prototype=e.prototype,t.prototype=new n}function zne(t,e,n,o){var i=Error.call(this,t);return Object.setPrototypeOf&&Object.setPrototypeOf(i,zne.prototype),i.expected=e,i.found=n,i.location=o,i.name="SyntaxError",i}U8n(zne,Error);function V3e(t,e,n){return n=n||" ",t.length>e?t:(e-=t.length,n+=n.repeat(e),t+n.slice(0,e))}zne.prototype.format=function(t){var e="Error: "+this.message;if(this.location){var n=null,o;for(o=0;o<t.length;o++)if(t[o].source===this.location.source){n=t[o].text.split(/\r\n|\n|\r/g);break}var i=this.location.start,r=this.location.source&&typeof this.location.source.offset=="function"?this.location.source.offset(i):i,s=this.location.source+":"+r.line+":"+r.column;if(n){var a=this.location.end,A=V3e("",r.line.toString().length," "),c=n[i.line-1],l=i.line===a.line?a.column:c.length+1,g=l-i.column||1;e+=`
239
+ root.render(<App />);`),v.unstable_strictMode===!0&&(L=!0),v.identifierPrefix!==void 0&&(j=v.identifierPrefix),v.onUncaughtError!==void 0&&(ae=v.onUncaughtError),v.onCaughtError!==void 0&&(fe=v.onCaughtError),v.onRecoverableError!==void 0&&(ze=v.onRecoverableError),v.unstable_transitionCallbacks!==void 0&&(At=v.unstable_transitionCallbacks)),v=Tt(b,1,!1,null,null,L,j,ae,fe,ze,At,null),b[X0]=v.current,XE(b),new F1(v)},TK.hydrateRoot=function(b,v,L){if(!_(b))throw Error("Target container is not a DOM element.");gp(b),v===void 0&&console.error("Must provide initial children as second argument to hydrateRoot. Example usage: hydrateRoot(domContainer, <App />)");var j=!1,ae="",fe=f4,ze=z0,At=bm,Mt=null,Vt=null;return L!=null&&(L.unstable_strictMode===!0&&(j=!0),L.identifierPrefix!==void 0&&(ae=L.identifierPrefix),L.onUncaughtError!==void 0&&(fe=L.onUncaughtError),L.onCaughtError!==void 0&&(ze=L.onCaughtError),L.onRecoverableError!==void 0&&(At=L.onRecoverableError),L.unstable_transitionCallbacks!==void 0&&(Mt=L.unstable_transitionCallbacks),L.formState!==void 0&&(Vt=L.formState)),v=Tt(b,1,!0,v,L??null,j,ae,fe,ze,At,Mt,Vt),v.context=ln(null),L=v.current,j=Gd(L),j=ct(j),ae=tp(j),ae.callback=null,y0(L,ae,j),L=j,v.current.lanes=L,Le(v,L),Cu(v),b[X0]=v.current,XE(b),new w_(v)},TK.version="19.1.0",typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})(),TK}var bot;function AEn(){if(bot)return Ete.exports;bot=1;var t={env:{}};function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function")){if(t.env.NODE_ENV!=="production")throw new Error("^_^");try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(n){console.error(n)}}}return t.env.NODE_ENV==="production"?(e(),Ete.exports=sEn()):Ete.exports=aEn(),Ete.exports}var cEn=AEn(),te=Q3();const ks=uy(te),u5=tx({__proto__:null,default:ks},[te]);var lEn=Object.defineProperty,_k=(t,e)=>lEn(t,"name",{value:e,configurable:!0}),Sot=!!(typeof window<"u"&&window.document&&window.document.createElement);function _r(t,e,{checkForDefaultPrevented:n=!0}={}){return _k(function(i){if(t?.(i),n===!1||!i||!i.defaultPrevented)return e?.(i)},"handleEvent")}_k(_r,"composeEventHandlers");function gEn(t){if(!Sot)throw new Error("Cannot access window outside of the DOM");return t?.ownerDocument?.defaultView??window}_k(gEn,"getOwnerWindow");function iye(t){if(!Sot)throw new Error("Cannot access document outside of the DOM");return t?.ownerDocument??document}_k(iye,"getOwnerDocument");function Qot(t,e=!1){const{activeElement:n}=iye(t);if(!n?.nodeName)return null;if(vot(n)&&n.contentDocument)return Qot(n.contentDocument.body,e);if(e){const o=n.getAttribute("aria-activedescendant");if(o){const i=iye(n).getElementById(o);if(i)return i}}return n}_k(Qot,"getActiveElement");function vot(t){return t.tagName==="IFRAME"}_k(vot,"isFrame");var uEn=Object.defineProperty,d5=(t,e)=>uEn(t,"name",{value:e,configurable:!0});function dEn(t,e){const n=te.createContext(e);n.displayName=t+"Context";const o=d5(r=>{const{children:s,...a}=r,A=te.useMemo(()=>a,Object.values(a));return V.jsx(n.Provider,{value:A,children:s})},"Provider");o.displayName=t+"Provider";function i(r,s={}){const{optional:a=!1}=s,A=te.useContext(n);if(A)return A;if(e!==void 0)return e;if(!a)throw new Error(`\`${r}\` must be used within \`${t}\``)}return d5(i,"useContext"),[o,i]}d5(dEn,"createContext");function v3(t,e=[]){let n=[];function o(r,s){const a=te.createContext(s);a.displayName=r+"Context";const A=n.length;n=[...n,s];const c=d5(g=>{const{scope:u,children:h,...d}=g,p=u?.[t]?.[A]||a,m=te.useMemo(()=>d,Object.values(d));return V.jsx(p.Provider,{value:m,children:h})},"Provider");c.displayName=r+"Provider";function l(g,u,h={}){const{optional:d=!1}=h,p=u?.[t]?.[A]||a,m=te.useContext(p);if(m)return m;if(s!==void 0)return s;if(!d)throw new Error(`\`${g}\` must be used within \`${r}\``)}return d5(l,"useContext"),[c,l]}d5(o,"createContext");const i=d5(()=>{const r=n.map(s=>te.createContext(s));return d5(function(a){const A=a?.[t]||r;return te.useMemo(()=>({[`__scope${t}`]:{...a,[t]:A}}),[a,A])},"useScope")},"createScope");return i.scopeName=t,[o,wot(i,...e)]}d5(v3,"createContextScope");function wot(...t){const e=t[0];if(t.length===1)return e;const n=d5(()=>{const o=t.map(i=>({useScope:i(),scopeName:i.scopeName}));return d5(function(r){const s=o.reduce((a,{useScope:A,scopeName:c})=>{const g=A(r)[`__scope${c}`];return{...a,...g}},{});return te.useMemo(()=>({[`__scope${e.scopeName}`]:s}),[s])},"useComposedScopes")},"createScope");return n.scopeName=e.scopeName,n}d5(wot,"composeContextScopes");var hEn=Object.defineProperty,rye=(t,e)=>hEn(t,"name",{value:e,configurable:!0});function sye(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}rye(sye,"setRef");function Pot(...t){return e=>{let n=!1;const o=t.map(i=>{const r=sye(i,e);return!n&&typeof r=="function"&&(n=!0),r});if(n)return()=>{for(let i=0;i<o.length;i++){const r=o[i];typeof r=="function"?r():sye(t[i],null)}}}}rye(Pot,"composeRefs");function lc(...t){return te.useCallback(Pot(...t),t)}rye(lc,"useComposedRefs");var pEn=Object.defineProperty,D4=(t,e)=>pEn(t,"name",{value:e,configurable:!0});function I9(t){const e=te.forwardRef((n,o)=>{let{children:i,...r}=n,s=null,a=!1;const A=[];aye(i)&&typeof Qte=="function"&&(i=Qte(i._payload)),te.Children.forEach(i,u=>{if(Tot(u)){a=!0;const h=u;let d="child"in h.props?h.props.child:h.props.children;aye(d)&&typeof Qte=="function"&&(d=Qte(d._payload)),s=_En(h,d),A.push(s?.props?.children)}else A.push(u)}),s?s=te.cloneElement(s,void 0,A):!a&&te.Children.count(i)===1&&te.isValidElement(i)&&(s=i);const c=s?Rot(s):void 0,l=lc(o,c);if(!s){if(i||i===0)throw new Error(a?CEn(t):IEn(t));return i}const g=Not(r,s.props??{});return s.type!==te.Fragment&&(g.ref=o?l:c),te.cloneElement(s,g)});return e.displayName=`${t}.Slot`,e}D4(I9,"createSlot");var mEn=I9("Slot"),Mot=Symbol.for("radix.slottable");function Dot(t){const e=D4(n=>"child"in n?n.children(n.child):n.children,"Slottable");return e.displayName=`${t}.Slottable`,e.__radixId=Mot,e}D4(Dot,"createSlottable");var _En=D4((t,e)=>{if("child"in t.props){const n=t.props.child;return te.isValidElement(n)?te.cloneElement(n,void 0,t.props.children(n.props.children)):null}return te.isValidElement(e)?e:null},"getSlottableElementFromSlottable");function Not(t,e){const n={...e};for(const o in e){const i=t[o],r=e[o];/^on[A-Z]/.test(o)?i&&r?n[o]=(...a)=>{const A=r(...a);return i(...a),A}:i&&(n[o]=i):o==="style"?n[o]={...i,...r}:o==="className"&&(n[o]=[i,r].filter(Boolean).join(" "))}return{...t,...n}}D4(Not,"mergeProps");function Rot(t){let e=Object.getOwnPropertyDescriptor(t.props,"ref")?.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=Object.getOwnPropertyDescriptor(t,"ref")?.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}D4(Rot,"getElementRef");function Tot(t){return te.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===Mot}D4(Tot,"isSlottable");var fEn=Symbol.for("react.lazy");function aye(t){return t!=null&&typeof t=="object"&&"$$typeof"in t&&t.$$typeof===fEn&&"_payload"in t&&kot(t._payload)}D4(aye,"isLazyComponent");function kot(t){return typeof t=="object"&&t!==null&&"then"in t}D4(kot,"isPromiseLike");var IEn=D4(t=>`${t} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,"createSlotError"),CEn=D4(t=>`${t} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,"createSlottableError"),Qte=u5[" use ".trim().toString()],yEn=Object.defineProperty,Uf=(t,e)=>yEn(t,"name",{value:e,configurable:!0});function vte(t){const e=t+"CollectionProvider",[n,o]=v3(e),[i,r]=n(e,{collectionRef:{current:null},itemMap:new Map}),s=Uf(p=>{const{scope:m,children:_}=p,f=te.useRef(null),I=te.useRef(new Map).current;return V.jsx(i,{scope:m,itemMap:I,collectionRef:f,children:_})},"CollectionProvider");s.displayName=e;const a=t+"CollectionSlot",A=I9(a),c=te.forwardRef((p,m)=>{const{scope:_,children:f}=p,I=r(a,_),C=lc(m,I.collectionRef);return V.jsx(A,{ref:C,children:f})});c.displayName=a;const l=t+"CollectionItemSlot",g="data-radix-collection-item",u=I9(l),h=te.forwardRef((p,m)=>{const{scope:_,children:f,...I}=p,C=te.useRef(null),y=lc(m,C),x=r(l,_);return te.useEffect(()=>(x.itemMap.set(C,{ref:C,...I}),()=>{x.itemMap.delete(C)})),V.jsx(u,{[g]:"",ref:y,children:f})});h.displayName=l;function d(p){const m=r(t+"CollectionConsumer",p);return te.useCallback(()=>{const f=m.collectionRef.current;if(!f)return[];const I=Array.from(f.querySelectorAll(`[${g}]`));return Array.from(m.itemMap.values()).sort((x,E)=>I.indexOf(x.ref.current)-I.indexOf(E.ref.current))},[m.collectionRef,m.itemMap])}return Uf(d,"useCollection"),[{Provider:s,Slot:c,ItemSlot:h},d,o]}Uf(vte,"createCollection");var Fot=new WeakMap,Aye=(wE=class extends Map{constructor(n){super(n);Vnt(this,u_);ste(this,u_,[...super.keys()]),Fot.set(this,!0)}set(n,o){return Fot.get(this)&&(this.has(n)?w0(this,u_)[w0(this,u_).indexOf(n)]=n:w0(this,u_).push(n)),super.set(n,o),this}insert(n,o,i){const r=this.has(o),s=w0(this,u_).length,a=cye(n);let A=a>=0?a:s+a;const c=A<0||A>=s?-1:A;if(c===this.size||r&&c===this.size-1||c===-1)return this.set(o,i),this;const l=this.size+(r?0:1);a<0&&A++;const g=[...w0(this,u_)];let u,h=!1;for(let d=A;d<l;d++)if(A===d){let p=g[d];g[d]===o&&(p=g[d+1]),r&&this.delete(o),u=this.get(p),this.set(o,i)}else{!h&&g[d-1]===o&&(h=!0);const p=g[h?d:d-1],m=u;u=this.get(p),this.delete(p),this.set(p,m)}return this}with(n,o,i){const r=new wE(this);return r.insert(n,o,i),r}before(n){const o=w0(this,u_).indexOf(n)-1;if(!(o<0))return this.entryAt(o)}setBefore(n,o,i){const r=w0(this,u_).indexOf(n);return r===-1?this:this.insert(r,o,i)}after(n){let o=w0(this,u_).indexOf(n);if(o=o===-1||o===this.size-1?-1:o+1,o!==-1)return this.entryAt(o)}setAfter(n,o,i){const r=w0(this,u_).indexOf(n);return r===-1?this:this.insert(r+1,o,i)}first(){return this.entryAt(0)}last(){return this.entryAt(-1)}clear(){return ste(this,u_,[]),super.clear()}delete(n){const o=super.delete(n);return o&&w0(this,u_).splice(w0(this,u_).indexOf(n),1),o}deleteAt(n){const o=this.keyAt(n);return o!==void 0?this.delete(o):!1}at(n){const o=wte(w0(this,u_),n);if(o!==void 0)return this.get(o)}entryAt(n){const o=wte(w0(this,u_),n);if(o!==void 0)return[o,this.get(o)]}indexOf(n){return w0(this,u_).indexOf(n)}keyAt(n){return wte(w0(this,u_),n)}from(n,o){const i=this.indexOf(n);if(i===-1)return;let r=i+o;return r<0&&(r=0),r>=this.size&&(r=this.size-1),this.at(r)}keyFrom(n,o){const i=this.indexOf(n);if(i===-1)return;let r=i+o;return r<0&&(r=0),r>=this.size&&(r=this.size-1),this.keyAt(r)}find(n,o){let i=0;for(const r of this){if(Reflect.apply(n,o,[r,i,this]))return r;i++}}findIndex(n,o){let i=0;for(const r of this){if(Reflect.apply(n,o,[r,i,this]))return i;i++}return-1}filter(n,o){const i=[];let r=0;for(const s of this)Reflect.apply(n,o,[s,r,this])&&i.push(s),r++;return new wE(i)}map(n,o){const i=[];let r=0;for(const s of this)i.push([s[0],Reflect.apply(n,o,[s,r,this])]),r++;return new wE(i)}reduce(...n){const[o,i]=n;let r=0,s=i??this.at(0);for(const a of this)r===0&&n.length===1?s=a:s=Reflect.apply(o,this,[s,a,r,this]),r++;return s}reduceRight(...n){const[o,i]=n;let r=i??this.at(-1);for(let s=this.size-1;s>=0;s--){const a=this.at(s);s===this.size-1&&n.length===1?r=a:r=Reflect.apply(o,this,[r,a,s,this])}return r}toSorted(n){const o=[...this.entries()].sort(n);return new wE(o)}toReversed(){const n=new wE;for(let o=this.size-1;o>=0;o--){const i=this.keyAt(o),r=this.get(i);n.set(i,r)}return n}toSpliced(...n){const o=[...this.entries()];return o.splice(...n),new wE(o)}slice(n,o){const i=new wE;let r=this.size-1;if(n===void 0)return i;n<0&&(n=n+this.size),o!==void 0&&o>0&&(r=o-1);for(let s=n;s<=r;s++){const a=this.keyAt(s),A=this.get(a);i.set(a,A)}return i}every(n,o){let i=0;for(const r of this){if(!Reflect.apply(n,o,[r,i,this]))return!1;i++}return!0}some(n,o){let i=0;for(const r of this){if(Reflect.apply(n,o,[r,i,this]))return!0;i++}return!1}},u_=new WeakMap,Uf(wE,"OrderedDict"),wE);function wte(t,e){if("at"in Array.prototype)return Array.prototype.at.call(t,e);const n=Lot(t,e);return n===-1?void 0:t[n]}Uf(wte,"at");function Lot(t,e){const n=t.length,o=cye(e),i=o>=0?o:n+o;return i<0||i>=n?-1:i}Uf(Lot,"toSafeIndex");function cye(t){return t!==t||t===0?0:Math.trunc(t)}Uf(cye,"toSafeInteger");function xEn(t){const e=t+"CollectionProvider",[n,o]=v3(e),[i,r]=n(e,{collectionElement:null,collectionRef:{current:null},collectionRefObject:{current:null},itemMap:new Aye,setItemMap:Uf(()=>{},"setItemMap")}),s=Uf(({state:I,...C})=>I?V.jsx(A,{...C,state:I}):V.jsx(a,{...C}),"CollectionProvider");s.displayName=e;const a=Uf(I=>{const C=m();return V.jsx(A,{...I,state:C})},"CollectionInit");a.displayName=e+"Init";const A=Uf(I=>{const{scope:C,children:y,state:x}=I,E=te.useRef(null),[B,S]=te.useState(null),Q=lc(E,S),[w,M]=x;return te.useEffect(()=>{if(!B)return;const k=Got(()=>{});return k.observe(B,{childList:!0,subtree:!0}),()=>{k.disconnect()}},[B]),V.jsx(i,{scope:C,itemMap:w,setItemMap:M,collectionRef:Q,collectionRefObject:E,collectionElement:B,children:y})},"CollectionProviderImpl");A.displayName=e+"Impl";const c=t+"CollectionSlot",l=I9(c),g=te.forwardRef((I,C)=>{const{scope:y,children:x}=I,E=r(c,y),B=lc(C,E.collectionRef);return V.jsx(l,{ref:B,children:x})});g.displayName=c;const u=t+"CollectionItemSlot",h="data-radix-collection-item",d=I9(u),p=te.forwardRef((I,C)=>{const{scope:y,children:x,...E}=I,B=te.useRef(null),[S,Q]=te.useState(null),w=lc(C,B,Q),M=r(u,y),{setItemMap:k}=M,R=te.useRef(E);Hot(R.current,E)||(R.current=E);const F=R.current;return te.useEffect(()=>{const O=F;return k(U=>S?U.has(S)?U.set(S,{...O,element:S}).toSorted(lye):(U.set(S,{...O,element:S}),U.toSorted(lye)):U),()=>{k(U=>!S||!U.has(S)?U:(U.delete(S),new Aye(U)))}},[S,F,k]),V.jsx(d,{[h]:"",ref:w,children:x})});p.displayName=u;function m(){return te.useState(new Aye)}Uf(m,"useInitCollection");function _(I){const{itemMap:C}=r(t+"CollectionConsumer",I);return C}return Uf(_,"useCollection"),[{Provider:s,Slot:g,ItemSlot:p},{createCollectionScope:o,useCollection:_,useInitCollection:m}]}Uf(xEn,"createCollection");function Hot(t,e){if(t===e)return!0;if(typeof t!="object"||typeof e!="object"||t==null||e==null)return!1;const n=Object.keys(t),o=Object.keys(e);if(n.length!==o.length)return!1;for(const i of n)if(!Object.prototype.hasOwnProperty.call(e,i)||t[i]!==e[i])return!1;return!0}Uf(Hot,"shallowEqual");function Oot(t,e){return!!(e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_PRECEDING)}Uf(Oot,"isElementPreceding");function lye(t,e){return!t[1].element||!e[1].element?0:Oot(t[1].element,e[1].element)?-1:1}Uf(lye,"sortByDocumentPosition");function Got(t){return new MutationObserver(n=>{for(const o of n)if(o.type==="childList"){t();return}})}Uf(Got,"getChildListObserver");var _p=globalThis?.document?te.useLayoutEffect:()=>{},EEn=Object.defineProperty,BEn=(t,e)=>EEn(t,"name",{value:e,configurable:!0}),bEn=u5[" useId ".trim().toString()]||(()=>{}),SEn=0;function w3(t){const[e,n]=te.useState(bEn());return _p(()=>{t||n(o=>o??String(SEn++))},[t]),t||(e?`radix-${e}`:"")}BEn(w3,"useId");var C9=oye();const Yot=uy(C9);var QEn=Object.defineProperty,vEn=(t,e)=>QEn(t,"name",{value:e,configurable:!0}),wEn=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],gc=wEn.reduce((t,e)=>{const n=I9(`Primitive.${e}`),o=te.forwardRef((i,r)=>{const{asChild:s,...a}=i,A=s?n:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),V.jsx(A,{...a,ref:r})});return o.displayName=`Primitive.${e}`,{...t,[e]:o}},{});function gye(t,e){t&&C9.flushSync(()=>t.dispatchEvent(e))}vEn(gye,"dispatchDiscreteCustomEvent");var PEn=Object.defineProperty,MEn=(t,e)=>PEn(t,"name",{value:e,configurable:!0});function P3(t){const e=te.useRef(t);return te.useEffect(()=>{e.current=t}),te.useMemo(()=>((...n)=>e.current?.(...n)),[])}MEn(P3,"useCallbackRef");var DEn=Object.defineProperty,NEn=(t,e)=>DEn(t,"name",{value:e,configurable:!0}),Uot=u5[" useEffectEvent ".trim().toString()],Kot=u5[" useInsertionEffect ".trim().toString()];function Vot(t){if(typeof Uot=="function")return Uot(t);const e=te.useRef(()=>{throw new Error("Cannot call an event handler while rendering.")});return typeof Kot=="function"?Kot(()=>{e.current=t}):_p(()=>{e.current=t}),te.useMemo(()=>((...n)=>e.current?.(...n)),[])}NEn(Vot,"useEffectEvent");var REn=Object.defineProperty,kK=(t,e)=>REn(t,"name",{value:e,configurable:!0}),TEn=u5[" useInsertionEffect ".trim().toString()]||_p;function y9({prop:t,defaultProp:e,onChange:n=kK(()=>{},"onChange"),caller:o}){const[i,r,s]=zot({defaultProp:e,onChange:n}),a=t!==void 0,A=a?t:i,c=te.useCallback(l=>{if(a){const g=Jot(l)?l(t):l;g!==t&&s.current?.(g)}else r(l)},[a,t,r,s]);return[A,c]}kK(y9,"useControllableState");function zot({defaultProp:t,onChange:e}){const[n,o]=te.useState(t),i=te.useRef(n),r=te.useRef(e);return TEn(()=>{r.current=e},[e]),te.useEffect(()=>{i.current!==n&&(r.current?.(n),i.current=n)},[n,i]),[n,o,r]}kK(zot,"useUncontrolledState");function Jot(t){return typeof t=="function"}kK(Jot,"isFunction");var Wot=Symbol("RADIX:SYNC_STATE");function kEn(t,e,n,o){const{prop:i,defaultProp:r,onChange:s,caller:a}=e,A=i!==void 0,c=Vot(s),l=[{...n,state:r}];o&&l.push(o);const[g,u]=te.useReducer((m,_)=>{if(_.type===Wot)return{...m,state:_.state};const f=t(m,_);return A&&!Object.is(f.state,m.state)&&c(f.state),f},...l),h=g.state,d=te.useRef(h);te.useEffect(()=>{d.current!==h&&(d.current=h,A||c(h))},[h,d,A]);const p=te.useMemo(()=>i!==void 0?{...g,state:i}:g,[g,i]);return te.useEffect(()=>{A&&!Object.is(i,g.state)&&u({type:Wot,state:i})},[i,g.state,A]),[p,u]}kK(kEn,"useControllableStateReducer");var FEn=Object.defineProperty,LEn=(t,e)=>FEn(t,"name",{value:e,configurable:!0}),HEn=te.createContext(void 0);function FK(t){const e=te.useContext(HEn);return t||e||"ltr"}LEn(FK,"useDirection");var OEn=Object.defineProperty,uye=(t,e)=>OEn(t,"name",{value:e,configurable:!0}),dye=!1;function jot(){const[t,e]=te.useState(dye);return te.useEffect(()=>{dye||(dye=!0,e(!0))},[]),t}uye(jot,"useIsHydrated");var qot=u5[" useSyncExternalStore ".trim().toString()];function Xot(){return()=>{}}uye(Xot,"subscribe");function $ot(){return qot(Xot,()=>!0,()=>!1)}uye($ot,"useIsHydratedModern");var GEn=typeof qot=="function"?$ot:jot,YEn=Object.defineProperty,vM=(t,e)=>YEn(t,"name",{value:e,configurable:!0}),hye="rovingFocusGroup.onEntryFocus",UEn={bubbles:!1,cancelable:!0},Pte="RovingFocusGroup",[pye,Zot,KEn]=vte(Pte),[VEn,Mte]=v3(Pte,[KEn]),[zEn,JEn]=VEn(Pte),WEn=te.forwardRef(vM(function(e,n){return V.jsx(pye.Provider,{scope:e.__scopeRovingFocusGroup,children:V.jsx(pye.Slot,{scope:e.__scopeRovingFocusGroup,children:V.jsx(jEn,{...e,ref:n})})})},"RovingFocusGroup")),jEn=te.forwardRef(vM(function(e,n){const{__scopeRovingFocusGroup:o,orientation:i,loop:r=!1,dir:s,currentTabStopId:a,defaultCurrentTabStopId:A,onCurrentTabStopIdChange:c,onEntryFocus:l,preventScrollOnEntryFocus:g=!1,...u}=e,h=te.useRef(null),d=lc(n,h),p=FK(s),[m,_]=y9({prop:a,defaultProp:A??null,onChange:c,caller:Pte}),[f,I]=te.useState(!1),C=P3(l),y=Zot(o),x=te.useRef(!1),[E,B]=te.useState(0);return te.useEffect(()=>{const S=h.current;if(S)return S.addEventListener(hye,C),()=>S.removeEventListener(hye,C)},[C]),V.jsx(zEn,{scope:o,orientation:i,dir:p,loop:r,currentTabStopId:m,onItemFocus:te.useCallback(S=>_(S),[_]),onItemShiftTab:te.useCallback(()=>I(!0),[]),onFocusableItemAdd:te.useCallback(()=>B(S=>S+1),[]),onFocusableItemRemove:te.useCallback(()=>B(S=>S-1),[]),children:V.jsx(gc.div,{tabIndex:f||E===0?-1:0,"data-orientation":i,...u,ref:d,style:{outline:"none",...e.style},onMouseDown:_r(e.onMouseDown,()=>{x.current=!0}),onFocus:_r(e.onFocus,S=>{const Q=!x.current;if(S.target===S.currentTarget&&Q&&!f){const w=new CustomEvent(hye,UEn);if(S.currentTarget.dispatchEvent(w),!w.defaultPrevented){const M=y().filter(U=>U.focusable),k=M.find(U=>U.active),R=M.find(U=>U.id===m),O=[k,R,...M].filter(Boolean).map(U=>U.ref.current);mye(O,g)}}x.current=!1}),onBlur:_r(e.onBlur,()=>I(!1))})})},"RovingFocusGroupImpl")),qEn="RovingFocusGroupItem",XEn=te.forwardRef(vM(function(e,n){const{__scopeRovingFocusGroup:o,focusable:i=!0,active:r=!1,tabStopId:s,children:a,...A}=e,c=w3(),l=s||c,g=JEn(qEn,o),u=g.currentTabStopId===l,h=Zot(o),{onFocusableItemAdd:d,onFocusableItemRemove:p,currentTabStopId:m}=g,_=GEn();return _p(()=>{if(!(!_||!i))return d(),()=>p()},[_,i,d,p]),te.useEffect(()=>{if(!(_||!i))return d(),()=>p()},[_,i,d,p]),V.jsx(pye.ItemSlot,{scope:o,id:l,focusable:i,active:r,children:V.jsx(gc.span,{tabIndex:u?0:-1,"data-orientation":g.orientation,...A,ref:n,onMouseDown:_r(e.onMouseDown,f=>{i?g.onItemFocus(l):f.preventDefault()}),onFocus:_r(e.onFocus,()=>g.onItemFocus(l)),onKeyDown:_r(e.onKeyDown,f=>{if(f.key==="Tab"&&f.shiftKey){g.onItemShiftTab();return}if(f.target!==f.currentTarget)return;const I=tit(f,g.orientation,g.dir);if(I!==void 0){if(f.metaKey||f.ctrlKey||f.altKey||f.shiftKey)return;f.preventDefault();let y=h().filter(x=>x.focusable).map(x=>x.ref.current);if(I==="last")y.reverse();else if(I==="prev"||I==="next"){I==="prev"&&y.reverse();const x=y.indexOf(f.currentTarget);y=g.loop?nit(y,x+1):y.slice(x+1)}setTimeout(()=>mye(y))}}),children:typeof a=="function"?a({isCurrentTabStop:u,hasTabStop:m!=null}):a})})},"RovingFocusGroupItem")),$En={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function eit(t,e){return e!=="rtl"?t:t==="ArrowLeft"?"ArrowRight":t==="ArrowRight"?"ArrowLeft":t}vM(eit,"getDirectionAwareKey");function tit(t,e,n){const o=eit(t.key,n);if(!(e==="vertical"&&["ArrowLeft","ArrowRight"].includes(o))&&!(e==="horizontal"&&["ArrowUp","ArrowDown"].includes(o)))return $En[o]}vM(tit,"getFocusIntent");function mye(t,e=!1){const n=document.activeElement;for(const o of t)if(o===n||(o.focus({preventScroll:e}),document.activeElement!==n))return}vM(mye,"focusFirst");function nit(t,e){return t.map((n,o)=>t[(e+o)%t.length])}vM(nit,"wrapArray");var oit=WEn,iit=XEn,ZEn=Object.defineProperty,m8=(t,e)=>ZEn(t,"name",{value:e,configurable:!0});function rit(t,e){return te.useReducer((n,o)=>e[n][o]??n,t)}m8(rit,"useStateMachine");var N4=m8(t=>{const{present:e,children:n}=t,o=sit(e),i=typeof n=="function"?n({present:o.isPresent}):te.Children.only(n),r=ait(o.ref,Ait(i));return typeof n=="function"||o.isPresent?te.cloneElement(i,{ref:r}):null},"Presence");function sit(t){const[e,n]=te.useState(),o=te.useRef(null),i=te.useRef(t),r=te.useRef("none"),s=te.useRef(void 0),a=t?"mounted":"unmounted",[A,c]=rit(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return te.useEffect(()=>{A==="mounted"?(r.current=s.current??fk(o.current),s.current=void 0):r.current="none"},[A]),_p(()=>{const l=o.current,g=i.current;if(g!==t){const h=r.current,d=fk(l);t?(s.current=d,c("MOUNT")):d==="none"||l?.display==="none"?c("UNMOUNT"):c(g&&h!==d?"ANIMATION_OUT":"UNMOUNT"),i.current=t}},[t,c]),_p(()=>{if(e){let l;const g=e.ownerDocument.defaultView??window,u=m8(d=>{const m=fk(o.current).includes(CSS.escape(d.animationName));if(d.target===e&&m&&(c("ANIMATION_END"),!i.current)){const _=e.style.animationFillMode;e.style.animationFillMode="forwards",l=g.setTimeout(()=>{e.style.animationFillMode==="forwards"&&(e.style.animationFillMode=_)})}},"handleAnimationEnd"),h=m8(d=>{d.target===e&&(r.current=fk(o.current))},"handleAnimationStart");return e.addEventListener("animationstart",h),e.addEventListener("animationcancel",u),e.addEventListener("animationend",u),()=>{g.clearTimeout(l),e.removeEventListener("animationstart",h),e.removeEventListener("animationcancel",u),e.removeEventListener("animationend",u)}}else c("ANIMATION_END")},[e,c]),{isPresent:["mounted","unmountSuspended"].includes(A),ref:te.useCallback(l=>{if(l){const g=getComputedStyle(l);o.current=g,s.current=fk(g)}else o.current=null;n(l)},[])}}m8(sit,"usePresence");function _ye(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}m8(_ye,"setRef");function ait(...t){const e=te.useRef(t);return e.current=t,te.useCallback(n=>{const o=e.current;let i=!1;const r=o.map(s=>{const a=_ye(s,n);return!i&&typeof a=="function"&&(i=!0),a});if(i)return()=>{for(let s=0;s<r.length;s++){const a=r[s];typeof a=="function"?a():_ye(o[s],null)}}},[])}m8(ait,"useStableComposedRefs");function fk(t){return t?.animationName||"none"}m8(fk,"getAnimationName");function Ait(t){let e=Object.getOwnPropertyDescriptor(t.props,"ref")?.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=Object.getOwnPropertyDescriptor(t,"ref")?.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}m8(Ait,"getElementRef");var e5n=Object.defineProperty,Ik=(t,e)=>e5n(t,"name",{value:e,configurable:!0}),fye="Tabs",[t5n,YAr]=v3(fye,[Mte]),cit=Mte(),[n5n,Iye]=t5n(fye),o5n=te.forwardRef(Ik(function(e,n){const{__scopeTabs:o,value:i,onValueChange:r,defaultValue:s,orientation:a="horizontal",dir:A,activationMode:c="automatic",...l}=e,g=FK(A),[u,h]=y9({prop:i,onChange:r,defaultProp:s??"",caller:fye});return V.jsx(n5n,{scope:o,baseId:w3(),value:u,onValueChange:h,orientation:a,dir:g,activationMode:c,children:V.jsx(gc.div,{dir:g,"data-orientation":a,...l,ref:n})})},"Tabs")),i5n="TabsList",r5n=te.forwardRef(Ik(function(e,n){const{__scopeTabs:o,loop:i=!0,...r}=e,s=Iye(i5n,o),a=cit(o);return V.jsx(oit,{asChild:!0,...a,orientation:s.orientation,dir:s.dir,loop:i,children:V.jsx(gc.div,{role:"tablist","aria-orientation":s.orientation,...r,ref:n})})},"TabsList")),s5n="TabsTrigger",a5n=te.forwardRef(Ik(function(e,n){const{__scopeTabs:o,value:i,disabled:r=!1,...s}=e,a=Iye(s5n,o),A=cit(o),c=Cye(a.baseId,i),l=yye(a.baseId,i),g=i===a.value;return V.jsx(iit,{asChild:!0,...A,focusable:!r,active:g,children:V.jsx(gc.button,{type:"button",role:"tab","aria-selected":g,"aria-controls":l,"data-state":g?"active":"inactive","data-disabled":r?"":void 0,disabled:r,id:c,...s,ref:n,onMouseDown:_r(e.onMouseDown,u=>{!r&&u.button===0&&u.ctrlKey===!1?a.onValueChange(i):u.preventDefault()}),onKeyDown:_r(e.onKeyDown,u=>{r||u.target!==u.currentTarget||[" ","Enter"].includes(u.key)&&a.onValueChange(i)}),onFocus:_r(e.onFocus,()=>{const u=a.activationMode!=="manual";!g&&!r&&u&&a.onValueChange(i)})})})},"TabsTrigger")),A5n="TabsContent",c5n=te.forwardRef(Ik(function(e,n){const{__scopeTabs:o,value:i,forceMount:r,children:s,...a}=e,A=Iye(A5n,o),c=Cye(A.baseId,i),l=yye(A.baseId,i),g=i===A.value,u=te.useRef(g);return te.useEffect(()=>{const h=requestAnimationFrame(()=>u.current=!1);return()=>cancelAnimationFrame(h)},[]),V.jsx(N4,{present:r||g,children:({present:h})=>V.jsx(gc.div,{"data-state":g?"active":"inactive","data-orientation":A.orientation,role:"tabpanel","aria-labelledby":c,hidden:!h,id:l,tabIndex:0,...a,ref:n,style:{...e.style,animationDuration:u.current?"0s":void 0},children:h&&s})})},"TabsContent"));function Cye(t,e){return`${t}-trigger-${e}`}Ik(Cye,"makeTriggerId");function yye(t,e){return`${t}-content-${e}`}Ik(yye,"makeContentId");var l5n=o5n,lit=r5n,git=a5n,uit=c5n;function dit(t){var e,n,o="";if(typeof t=="string"||typeof t=="number")o+=t;else if(typeof t=="object")if(Array.isArray(t)){var i=t.length;for(e=0;e<i;e++)t[e]&&(n=dit(t[e]))&&(o&&(o+=" "),o+=n)}else for(n in t)t[n]&&(o&&(o+=" "),o+=n);return o}function R4(){for(var t,e,n=0,o="",i=arguments.length;n<i;n++)(t=arguments[n])&&(e=dit(t))&&(o&&(o+=" "),o+=e);return o}const xye="-",g5n=t=>{const e=d5n(t),{conflictingClassGroups:n,conflictingClassGroupModifiers:o}=t;return{getClassGroupId:s=>{const a=s.split(xye);return a[0]===""&&a.length!==1&&a.shift(),hit(a,e)||u5n(s)},getConflictingClassGroupIds:(s,a)=>{const A=n[s]||[];return a&&o[s]?[...A,...o[s]]:A}}},hit=(t,e)=>{if(t.length===0)return e.classGroupId;const n=t[0],o=e.nextPart.get(n),i=o?hit(t.slice(1),o):void 0;if(i)return i;if(e.validators.length===0)return;const r=t.join(xye);return e.validators.find(({validator:s})=>s(r))?.classGroupId},pit=/^\[(.+)\]$/,u5n=t=>{if(pit.test(t)){const e=pit.exec(t)[1],n=e?.substring(0,e.indexOf(":"));if(n)return"arbitrary.."+n}},d5n=t=>{const{theme:e,prefix:n}=t,o={nextPart:new Map,validators:[]};return p5n(Object.entries(t.classGroups),n).forEach(([r,s])=>{Eye(s,o,r,e)}),o},Eye=(t,e,n,o)=>{t.forEach(i=>{if(typeof i=="string"){const r=i===""?e:mit(e,i);r.classGroupId=n;return}if(typeof i=="function"){if(h5n(i)){Eye(i(o),e,n,o);return}e.validators.push({validator:i,classGroupId:n});return}Object.entries(i).forEach(([r,s])=>{Eye(s,mit(e,r),n,o)})})},mit=(t,e)=>{let n=t;return e.split(xye).forEach(o=>{n.nextPart.has(o)||n.nextPart.set(o,{nextPart:new Map,validators:[]}),n=n.nextPart.get(o)}),n},h5n=t=>t.isThemeGetter,p5n=(t,e)=>e?t.map(([n,o])=>{const i=o.map(r=>typeof r=="string"?e+r:typeof r=="object"?Object.fromEntries(Object.entries(r).map(([s,a])=>[e+s,a])):r);return[n,i]}):t,m5n=t=>{if(t<1)return{get:()=>{},set:()=>{}};let e=0,n=new Map,o=new Map;const i=(r,s)=>{n.set(r,s),e++,e>t&&(e=0,o=n,n=new Map)};return{get(r){let s=n.get(r);if(s!==void 0)return s;if((s=o.get(r))!==void 0)return i(r,s),s},set(r,s){n.has(r)?n.set(r,s):i(r,s)}}},_it="!",_5n=t=>{const{separator:e,experimentalParseClassName:n}=t,o=e.length===1,i=e[0],r=e.length,s=a=>{const A=[];let c=0,l=0,g;for(let m=0;m<a.length;m++){let _=a[m];if(c===0){if(_===i&&(o||a.slice(m,m+r)===e)){A.push(a.slice(l,m)),l=m+r;continue}if(_==="/"){g=m;continue}}_==="["?c++:_==="]"&&c--}const u=A.length===0?a:a.substring(l),h=u.startsWith(_it),d=h?u.substring(1):u,p=g&&g>l?g-l:void 0;return{modifiers:A,hasImportantModifier:h,baseClassName:d,maybePostfixModifierPosition:p}};return n?a=>n({className:a,parseClassName:s}):s},f5n=t=>{if(t.length<=1)return t;const e=[];let n=[];return t.forEach(o=>{o[0]==="["?(e.push(...n.sort(),o),n=[]):n.push(o)}),e.push(...n.sort()),e},I5n=t=>({cache:m5n(t.cacheSize),parseClassName:_5n(t),...g5n(t)}),C5n=/\s+/,y5n=(t,e)=>{const{parseClassName:n,getClassGroupId:o,getConflictingClassGroupIds:i}=e,r=[],s=t.trim().split(C5n);let a="";for(let A=s.length-1;A>=0;A-=1){const c=s[A],{modifiers:l,hasImportantModifier:g,baseClassName:u,maybePostfixModifierPosition:h}=n(c);let d=!!h,p=o(d?u.substring(0,h):u);if(!p){if(!d){a=c+(a.length>0?" "+a:a);continue}if(p=o(u),!p){a=c+(a.length>0?" "+a:a);continue}d=!1}const m=f5n(l).join(":"),_=g?m+_it:m,f=_+p;if(r.includes(f))continue;r.push(f);const I=i(p,d);for(let C=0;C<I.length;++C){const y=I[C];r.push(_+y)}a=c+(a.length>0?" "+a:a)}return a};function x5n(){let t=0,e,n,o="";for(;t<arguments.length;)(e=arguments[t++])&&(n=fit(e))&&(o&&(o+=" "),o+=n);return o}const fit=t=>{if(typeof t=="string")return t;let e,n="";for(let o=0;o<t.length;o++)t[o]&&(e=fit(t[o]))&&(n&&(n+=" "),n+=e);return n};function E5n(t,...e){let n,o,i,r=s;function s(A){const c=e.reduce((l,g)=>g(l),t());return n=I5n(c),o=n.cache.get,i=n.cache.set,r=a,a(A)}function a(A){const c=o(A);if(c)return c;const l=y5n(A,n);return i(A,l),l}return function(){return r(x5n.apply(null,arguments))}}const rd=t=>{const e=n=>n[t]||[];return e.isThemeGetter=!0,e},Iit=/^\[(?:([a-z-]+):)?(.+)\]$/i,B5n=/^\d+\/\d+$/,b5n=new Set(["px","full","screen"]),S5n=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Q5n=/\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$/,v5n=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,w5n=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,P5n=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,_8=t=>Ck(t)||b5n.has(t)||B5n.test(t),nQ=t=>yk(t,"length",L5n),Ck=t=>!!t&&!Number.isNaN(Number(t)),Bye=t=>yk(t,"number",Ck),LK=t=>!!t&&Number.isInteger(Number(t)),M5n=t=>t.endsWith("%")&&Ck(t.slice(0,-1)),RA=t=>Iit.test(t),oQ=t=>S5n.test(t),D5n=new Set(["length","size","percentage"]),N5n=t=>yk(t,D5n,Cit),R5n=t=>yk(t,"position",Cit),T5n=new Set(["image","url"]),k5n=t=>yk(t,T5n,O5n),F5n=t=>yk(t,"",H5n),HK=()=>!0,yk=(t,e,n)=>{const o=Iit.exec(t);return o?o[1]?typeof e=="string"?o[1]===e:e.has(o[1]):n(o[2]):!1},L5n=t=>Q5n.test(t)&&!v5n.test(t),Cit=()=>!1,H5n=t=>w5n.test(t),O5n=t=>P5n.test(t),G5n=E5n(()=>{const t=rd("colors"),e=rd("spacing"),n=rd("blur"),o=rd("brightness"),i=rd("borderColor"),r=rd("borderRadius"),s=rd("borderSpacing"),a=rd("borderWidth"),A=rd("contrast"),c=rd("grayscale"),l=rd("hueRotate"),g=rd("invert"),u=rd("gap"),h=rd("gradientColorStops"),d=rd("gradientColorStopPositions"),p=rd("inset"),m=rd("margin"),_=rd("opacity"),f=rd("padding"),I=rd("saturate"),C=rd("scale"),y=rd("sepia"),x=rd("skew"),E=rd("space"),B=rd("translate"),S=()=>["auto","contain","none"],Q=()=>["auto","hidden","clip","visible","scroll"],w=()=>["auto",RA,e],M=()=>[RA,e],k=()=>["",_8,nQ],R=()=>["auto",Ck,RA],F=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],O=()=>["solid","dashed","dotted","double","none"],U=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],Y=()=>["start","end","center","between","around","evenly","stretch"],J=()=>["","0",RA],ee=()=>["auto","avoid","all","avoid-page","page","left","right","column"],W=()=>[Ck,RA];return{cacheSize:500,separator:":",theme:{colors:[HK],spacing:[_8,nQ],blur:["none","",oQ,RA],brightness:W(),borderColor:[t],borderRadius:["none","","full",oQ,RA],borderSpacing:M(),borderWidth:k(),contrast:W(),grayscale:J(),hueRotate:W(),invert:J(),gap:M(),gradientColorStops:[t],gradientColorStopPositions:[M5n,nQ],inset:w(),margin:w(),opacity:W(),padding:M(),saturate:W(),scale:W(),sepia:J(),skew:W(),space:M(),translate:M()},classGroups:{aspect:[{aspect:["auto","square","video",RA]}],container:["container"],columns:[{columns:[oQ]}],"break-after":[{"break-after":ee()}],"break-before":[{"break-before":ee()}],"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:[...F(),RA]}],overflow:[{overflow:Q()}],"overflow-x":[{"overflow-x":Q()}],"overflow-y":[{"overflow-y":Q()}],overscroll:[{overscroll:S()}],"overscroll-x":[{"overscroll-x":S()}],"overscroll-y":[{"overscroll-y":S()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[p]}],"inset-x":[{"inset-x":[p]}],"inset-y":[{"inset-y":[p]}],start:[{start:[p]}],end:[{end:[p]}],top:[{top:[p]}],right:[{right:[p]}],bottom:[{bottom:[p]}],left:[{left:[p]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",LK,RA]}],basis:[{basis:w()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",RA]}],grow:[{grow:J()}],shrink:[{shrink:J()}],order:[{order:["first","last","none",LK,RA]}],"grid-cols":[{"grid-cols":[HK]}],"col-start-end":[{col:["auto",{span:["full",LK,RA]},RA]}],"col-start":[{"col-start":R()}],"col-end":[{"col-end":R()}],"grid-rows":[{"grid-rows":[HK]}],"row-start-end":[{row:["auto",{span:[LK,RA]},RA]}],"row-start":[{"row-start":R()}],"row-end":[{"row-end":R()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",RA]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",RA]}],gap:[{gap:[u]}],"gap-x":[{"gap-x":[u]}],"gap-y":[{"gap-y":[u]}],"justify-content":[{justify:["normal",...Y()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...Y(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...Y(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[f]}],px:[{px:[f]}],py:[{py:[f]}],ps:[{ps:[f]}],pe:[{pe:[f]}],pt:[{pt:[f]}],pr:[{pr:[f]}],pb:[{pb:[f]}],pl:[{pl:[f]}],m:[{m:[m]}],mx:[{mx:[m]}],my:[{my:[m]}],ms:[{ms:[m]}],me:[{me:[m]}],mt:[{mt:[m]}],mr:[{mr:[m]}],mb:[{mb:[m]}],ml:[{ml:[m]}],"space-x":[{"space-x":[E]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[E]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",RA,e]}],"min-w":[{"min-w":[RA,e,"min","max","fit"]}],"max-w":[{"max-w":[RA,e,"none","full","min","max","fit","prose",{screen:[oQ]},oQ]}],h:[{h:[RA,e,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[RA,e,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[RA,e,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[RA,e,"auto","min","max","fit"]}],"font-size":[{text:["base",oQ,nQ]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Bye]}],"font-family":[{font:[HK]}],"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",RA]}],"line-clamp":[{"line-clamp":["none",Ck,Bye]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",_8,RA]}],"list-image":[{"list-image":["none",RA]}],"list-style-type":[{list:["none","disc","decimal",RA]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[t]}],"placeholder-opacity":[{"placeholder-opacity":[_]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[t]}],"text-opacity":[{"text-opacity":[_]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...O(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",_8,nQ]}],"underline-offset":[{"underline-offset":["auto",_8,RA]}],"text-decoration-color":[{decoration:[t]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:M()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",RA]}],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",RA]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[_]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...F(),R5n]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",N5n]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},k5n]}],"bg-color":[{bg:[t]}],"gradient-from-pos":[{from:[d]}],"gradient-via-pos":[{via:[d]}],"gradient-to-pos":[{to:[d]}],"gradient-from":[{from:[h]}],"gradient-via":[{via:[h]}],"gradient-to":[{to:[h]}],rounded:[{rounded:[r]}],"rounded-s":[{"rounded-s":[r]}],"rounded-e":[{"rounded-e":[r]}],"rounded-t":[{"rounded-t":[r]}],"rounded-r":[{"rounded-r":[r]}],"rounded-b":[{"rounded-b":[r]}],"rounded-l":[{"rounded-l":[r]}],"rounded-ss":[{"rounded-ss":[r]}],"rounded-se":[{"rounded-se":[r]}],"rounded-ee":[{"rounded-ee":[r]}],"rounded-es":[{"rounded-es":[r]}],"rounded-tl":[{"rounded-tl":[r]}],"rounded-tr":[{"rounded-tr":[r]}],"rounded-br":[{"rounded-br":[r]}],"rounded-bl":[{"rounded-bl":[r]}],"border-w":[{border:[a]}],"border-w-x":[{"border-x":[a]}],"border-w-y":[{"border-y":[a]}],"border-w-s":[{"border-s":[a]}],"border-w-e":[{"border-e":[a]}],"border-w-t":[{"border-t":[a]}],"border-w-r":[{"border-r":[a]}],"border-w-b":[{"border-b":[a]}],"border-w-l":[{"border-l":[a]}],"border-opacity":[{"border-opacity":[_]}],"border-style":[{border:[...O(),"hidden"]}],"divide-x":[{"divide-x":[a]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[a]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[_]}],"divide-style":[{divide:O()}],"border-color":[{border:[i]}],"border-color-x":[{"border-x":[i]}],"border-color-y":[{"border-y":[i]}],"border-color-s":[{"border-s":[i]}],"border-color-e":[{"border-e":[i]}],"border-color-t":[{"border-t":[i]}],"border-color-r":[{"border-r":[i]}],"border-color-b":[{"border-b":[i]}],"border-color-l":[{"border-l":[i]}],"divide-color":[{divide:[i]}],"outline-style":[{outline:["",...O()]}],"outline-offset":[{"outline-offset":[_8,RA]}],"outline-w":[{outline:[_8,nQ]}],"outline-color":[{outline:[t]}],"ring-w":[{ring:k()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[t]}],"ring-opacity":[{"ring-opacity":[_]}],"ring-offset-w":[{"ring-offset":[_8,nQ]}],"ring-offset-color":[{"ring-offset":[t]}],shadow:[{shadow:["","inner","none",oQ,F5n]}],"shadow-color":[{shadow:[HK]}],opacity:[{opacity:[_]}],"mix-blend":[{"mix-blend":[...U(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":U()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[o]}],contrast:[{contrast:[A]}],"drop-shadow":[{"drop-shadow":["","none",oQ,RA]}],grayscale:[{grayscale:[c]}],"hue-rotate":[{"hue-rotate":[l]}],invert:[{invert:[g]}],saturate:[{saturate:[I]}],sepia:[{sepia:[y]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[o]}],"backdrop-contrast":[{"backdrop-contrast":[A]}],"backdrop-grayscale":[{"backdrop-grayscale":[c]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[l]}],"backdrop-invert":[{"backdrop-invert":[g]}],"backdrop-opacity":[{"backdrop-opacity":[_]}],"backdrop-saturate":[{"backdrop-saturate":[I]}],"backdrop-sepia":[{"backdrop-sepia":[y]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[s]}],"border-spacing-x":[{"border-spacing-x":[s]}],"border-spacing-y":[{"border-spacing-y":[s]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",RA]}],duration:[{duration:W()}],ease:[{ease:["linear","in","out","in-out",RA]}],delay:[{delay:W()}],animate:[{animate:["none","spin","ping","pulse","bounce",RA]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[C]}],"scale-x":[{"scale-x":[C]}],"scale-y":[{"scale-y":[C]}],rotate:[{rotate:[LK,RA]}],"translate-x":[{"translate-x":[B]}],"translate-y":[{"translate-y":[B]}],"skew-x":[{"skew-x":[x]}],"skew-y":[{"skew-y":[x]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",RA]}],accent:[{accent:["auto",t]}],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",RA]}],"caret-color":[{caret:[t]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":M()}],"scroll-mx":[{"scroll-mx":M()}],"scroll-my":[{"scroll-my":M()}],"scroll-ms":[{"scroll-ms":M()}],"scroll-me":[{"scroll-me":M()}],"scroll-mt":[{"scroll-mt":M()}],"scroll-mr":[{"scroll-mr":M()}],"scroll-mb":[{"scroll-mb":M()}],"scroll-ml":[{"scroll-ml":M()}],"scroll-p":[{"scroll-p":M()}],"scroll-px":[{"scroll-px":M()}],"scroll-py":[{"scroll-py":M()}],"scroll-ps":[{"scroll-ps":M()}],"scroll-pe":[{"scroll-pe":M()}],"scroll-pt":[{"scroll-pt":M()}],"scroll-pr":[{"scroll-pr":M()}],"scroll-pb":[{"scroll-pb":M()}],"scroll-pl":[{"scroll-pl":M()}],"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",RA]}],fill:[{fill:[t,"none"]}],"stroke-w":[{stroke:[_8,nQ,Bye]}],stroke:[{stroke:[t,"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"]}}}),Fn="u">typeof window?window:void 0,gC="u">typeof globalThis?globalThis:Fn,F_=gC?.navigator,No=gC?.document,sd=gC?.location,OK=gC?.fetch,bye=gC?.XMLHttpRequest&&"withCredentials"in new gC.XMLHttpRequest?gC.XMLHttpRequest:void 0,yit=gC?.AbortController,Y5n=gC?.CompressionStream,dy=F_?.userAgent;function xit(){return!(!Fn||Fn.navigator.onLine===!1)}const GK=typeof globalThis<"u"?globalThis:Fn;GK&&typeof self>"u"&&(GK.self=GK),GK&&typeof File>"u"&&(GK.File=function(){});const Ur=Fn??{},U5n="0.9.0",f8={DEBUG:!1,LIB_VERSION:U5n,LIB_NAME:"browser-common"};var x9=(function(t){return t.AnonymousId="anonymous_id",t.DistinctId="distinct_id",t.Props="props",t.EnablePersonProcessing="enable_person_processing",t.PersonMode="person_mode",t.FeatureFlagDetails="feature_flag_details",t.FeatureFlags="feature_flags",t.FeatureFlagPayloads="feature_flag_payloads",t.BootstrapFeatureFlagDetails="bootstrap_feature_flag_details",t.BootstrapFeatureFlags="bootstrap_feature_flags",t.BootstrapFeatureFlagPayloads="bootstrap_feature_flag_payloads",t.OverrideFeatureFlags="override_feature_flags",t.Queue="queue",t.AiQueue="ai_queue",t.AiCaptureQueue="ai_capture_queue",t.LogsQueue="logs_queue",t.OptedOut="opted_out",t.SessionId="session_id",t.SessionStartTimestamp="session_start_timestamp",t.SessionLastTimestamp="session_timestamp",t.PersonProperties="person_properties",t.GroupProperties="group_properties",t.InstalledAppBuild="installed_app_build",t.InstalledAppVersion="installed_app_version",t.SessionReplay="session_replay",t.PushRegistered="push_registered",t.SessionReplayEventTriggerActivatedSession="session_replay_event_trigger_activated_session",t.SurveyLastSeenDate="survey_last_seen_date",t.SurveysInProgress="surveys_in_progress",t.SurveysSeen="surveys_seen",t.Surveys="surveys",t.RemoteConfig="remote_config",t.FlagsEndpointWasHit="flags_endpoint_was_hit",t.DeviceId="device_id",t})({}),Sye=(function(t){return t.GZipJS="gzip-js",t.Base64="base64",t})({});const K5n=["$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"],V5n=["token"];function as(t,e){return t.indexOf(e)!==-1}const Dte=function(t){return t.trim()},Qye=function(t){return t.replace(/^\$/,"")};function Eit(t){var e;const n=[];return(e=JSON.stringify(t,function(o,i){if(typeof i=="bigint")return i.toString();if(typeof i!="function"&&typeof i!="symbol"){if(i instanceof Error)return{name:i.name,message:i.message,stack:i.stack};if(i&&typeof i=="object"){for(;n.length>0&&n[n.length-1]!==this;)n.pop();if(n.includes(i))return"[Circular]";n.push(i)}return i}}))!==null&&e!==void 0?e:"null"}const Bit=Object.prototype,vye=Bit.hasOwnProperty,Nte=Bit.toString,As=Array.isArray||function(t){return Nte.call(t)==="[object Array]"},L_=t=>typeof t=="function",xA=t=>t===Object(t)&&!As(t),nx=t=>{if(xA(t)){for(const e in t)if(vye.call(t,e))return!1;return!0}return!1},Eo=t=>t===void 0,nA=t=>Nte.call(t)=="[object String]",YK=t=>nA(t)&&t.trim().length===0,ad=t=>t===null,Fs=t=>Eo(t)||ad(t),jd=t=>Nte.call(t)=="[object Number]"&&t==t,I8=t=>jd(t)&&t>0,hy=t=>Nte.call(t)==="[object Boolean]",z5n=t=>as(K5n,t),J5n=t=>as(V5n,t);function bit(t){return t===null||typeof t!="object"}function Rte(t,e){return{}.toString.call(t)===`[object ${e}]`}function xk(t){switch({}.toString.call(t)){case"[object Error]":case"[object Exception]":case"[object DOMException]":case"[object DOMError]":case"[object WebAssembly.Exception]":return!0;default:return Sit(t,Error)}}function wye(t){return"u">typeof Event&&Sit(t,Event)}function Sit(t,e){try{return t instanceof e}catch{return!1}}const W5n=[!0,"true",1,"1","yes"],Pye=t=>as(W5n,t),j5n=[!1,"false",0,"0","no"];function Qit(t,e,n,o,i,r,s){try{var a=t[r](s),A=a.value}catch(c){return void n(c)}a.done?e(A):Promise.resolve(A).then(o,i)}function Wg(t){return function(){var e=this,n=arguments;return new Promise(function(o,i){var r=t.apply(e,n);function s(A){Qit(r,o,i,s,a,"next",A)}function a(A){Qit(r,o,i,s,a,"throw",A)}s(void 0)})}}const q5n=["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","pinterestbot","prerender","rogerbot","screaming frog","sebot-wa","sitebulb","slackbot","slurp","trendictionbot","turnitin","twitterbot","vercel-screenshot","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"],vit=function(t,e=[]){if(!t)return!1;const n=t.toLowerCase();return q5n.concat(e).some(o=>{const i=o.toLowerCase();return n.indexOf(i)!==-1})};function E9(t,e,n,o,i){return e>n&&(o.warn("min cannot be greater than max."),e=n),jd(t)?t>n?(o.warn(" cannot be greater than max: "+n+". Using max value instead."),n):e>t?(o.warn(" cannot be less than min: "+e+". Using min value instead."),e):t:(o.warn(" must be a number. using max or fallback. max: "+n+", fallback: "+i),E9(i??n,e,n,o))}var X5n=class{constructor(e){this.C={},this.I=e.I,this.R=E9(e.bucketSize,0,100,e.A),this.$=E9(e.refillRate,0,this.R,e.A),this.O=E9(e.refillInterval,0,864e5,e.A)}F(e,n){const o=Math.floor((n-e.lastAccess)/this.O);o>0&&(e.tokens=Math.min(e.tokens+o*this.$,this.R),e.lastAccess=e.lastAccess+o*this.O)}consumeRateLimit(e){var n;const o=Date.now(),i=String(e);let r=this.C[i];return r?this.F(r,o):(r={tokens:this.R,lastAccess:o},this.C[i]=r),r.tokens===0||(r.tokens--,r.tokens===0&&((n=this.I)===null||n===void 0||n.call(this,e)),r.tokens===0)}stop(){this.C={}}};const Ek="Mobile",UK="Android",Tte="Tablet",wit="Android Tablet",Pit="iPad",Mit="Apple Watch",kte="Safari",Fte="BlackBerry",Dit="Samsung Internet",Lte="Chrome",Nit="Chrome iOS",Rit="Internet Explorer",Tit="Internet Explorer Mobile",kit="Opera",Fit="Microsoft Edge",Hte="Firefox",Lit="Firefox iOS",Ote="Nintendo",Gte="PlayStation",Yte="Xbox",Hit="Android Mobile",Oit="Mobile Safari",Mye="Windows",Git="Windows Phone",Yit="Nokia",Dye="Ouya",$5n="Generic "+Ek.toLowerCase(),Uit="Generic "+Tte.toLowerCase(),Nye="Konqueror",Kit="Oculus Browser",Vit="Vivaldi",zit="Yandex",Jit="Whale",Wit="DuckDuckGo",jit="Pale Moon",qit="Waterfox",Rye="Brave",Xit="Claude",$it="Codex",Zit="ChatGPT",ert="Google Search App",Tye=new RegExp("Version/(\\d+(\\.\\d+)?)"),kye=new RegExp("(Claude|Codex|ChatGPT)\\/(\\d+(\\.\\d+)?)"),Z5n=new RegExp(Yte,"i"),e4n=new RegExp("PlayStation \\w+","i"),t4n=new RegExp("Nintendo \\w+","i"),Fye=new RegExp("BlackBerry|PlayBook|BB10","i"),n4n={"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"},trt=function(t,e,n,o){return e=e||"",(function(r){return r?.brave?Rye:null})(n)||(o?.detectGoogleSearchApp&&as(t,"GSA/")?ert:as(t," OPR/")&&as(t,"Mini")?"Opera Mini":as(t," OPR/")?kit:Fye.test(t)?Fte:as(t,"IEMobile")||as(t,"WPDesktop")?Tit:as(t,"OculusBrowser")?Kit:as(t,"SamsungBrowser")?Dit:as(t,"Edge")||as(t,"Edg/")?Fit:as(t,"Vivaldi/")?Vit:as(t,"YaBrowser/")?zit:as(t,"Whale/")?Jit:as(t,"DuckDuckGo/")||as(t,"Ddg/")?Wit:as(t,"Claude/")?Xit:as(t,"Codex/")?$it:as(t,"ChatGPT/")?Zit:as(t,"FBIOS")?"Facebook Mobile":as(t,"UCWEB")||as(t,"UCBrowser")?"UC Browser":as(t,"CriOS")?Nit:as(t,"CrMo")||as(t,Lte)?Lte:as(t,UK)&&as(t,kte)?Hit:as(t,"FxiOS")?Lit:as(t.toLowerCase(),Nye.toLowerCase())?Nye:as(t,"Brave/")?Rye:((r,s)=>s&&as(s,"Apple")||(function(a){return as(a,kte)&&!as(a,Lte)&&!as(a,UK)})(r))(t,e)?as(t,Ek)?Oit:kte:as(t,"PaleMoon/")?jit:as(t,"Waterfox/")?qit:as(t,Hte)?Hte:as(t,"MSIE")||as(t,"Trident/")?Rit:as(t,"Gecko")?Hte:"")},o4n={[Tit]:[new RegExp("rv:(\\d+(\\.\\d+)?)")],[Fit]:[new RegExp("Edge?\\/(\\d+(\\.\\d+)?)")],[Lte]:[new RegExp("(Chrome|CrMo)\\/(\\d+(\\.\\d+)?)")],[Nit]:[new RegExp("CriOS\\/(\\d+(\\.\\d+)?)")],"UC Browser":[new RegExp("(UCBrowser|UCWEB)\\/(\\d+(\\.\\d+)?)")],[kte]:[Tye],[Oit]:[Tye],[kit]:[new RegExp("(Opera|OPR)\\/(\\d+(\\.\\d+)?)")],[Hte]:[new RegExp("Firefox\\/(\\d+(\\.\\d+)?)")],[Lit]:[new RegExp("FxiOS\\/(\\d+(\\.\\d+)?)")],[Nye]:[new RegExp("Konqueror[:/]?(\\d+(\\.\\d+)?)","i")],[Fte]:[new RegExp("BlackBerry (\\d+(\\.\\d+)?)"),Tye],[Hit]:[new RegExp("android\\s(\\d+(\\.\\d+)?)","i")],[Dit]:[new RegExp("SamsungBrowser\\/(\\d+(\\.\\d+)?)")],[Kit]:[new RegExp("OculusBrowser\\/(\\d+(\\.\\d+)?)")],[Vit]:[new RegExp("Vivaldi\\/(\\d+(\\.\\d+)?)")],[zit]:[new RegExp("YaBrowser\\/(\\d+(\\.\\d+)?)")],[Jit]:[new RegExp("Whale\\/(\\d+(\\.\\d+)?)")],[Rye]:[new RegExp("Brave\\/(\\d+(\\.\\d+)?)")],[Xit]:[kye],[$it]:[kye],[Zit]:[kye],[Wit]:[new RegExp("(DuckDuckGo|Ddg)\\/(\\d+(\\.\\d+)?)")],[jit]:[new RegExp("PaleMoon\\/(\\d+(\\.\\d+)?)")],[qit]:[new RegExp("Waterfox\\/(\\d+(\\.\\d+)?)")],[ert]:[new RegExp("GSA\\/(\\d+(\\.\\d+)?)")],[Rit]:[new RegExp("(rv:|MSIE )(\\d+(\\.\\d+)?)")],Mozilla:[new RegExp("rv:(\\d+(\\.\\d+)?)")]},i4n=function(t,e,n,o){const i=trt(t,e,n,o),r=o4n[i];if(Eo(r))return null;for(let s=0;r.length>s;s++){const a=t.match(r[s]);if(a)return parseFloat(a[a.length-2])}return null},nrt=[[new RegExp("Xbox; Xbox (.*?)[);]","i"),t=>[Yte,t&&t[1]||""]],[new RegExp(Ote,"i"),[Ote,""]],[new RegExp(Gte,"i"),[Gte,""]],[Fye,[Fte,""]],[new RegExp(Mye,"i"),(t,e)=>{if(/Phone/.test(e)||/WPDesktop/.test(e))return[Git,""];if(new RegExp(Ek).test(e)&&!/IEMobile\b/.test(e))return["Windows Mobile",""];const n=/Windows NT ([0-9.]+)/i.exec(e);if(n&&n[1]){let o=n4n[n[1]]||"";return/arm/i.test(e)&&(o="RT"),[Mye,o]}return[Mye,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,t=>t&&t[3]?["iOS",[t[3],t[4],t[5]||"0"].join(".")]:["iOS",""]],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,t=>{let e="";return t&&t.length>=3&&(e=Eo(t[2])?t[3]:t[2]),["watchOS",e]}],[new RegExp("(Android (\\d+)\\.(\\d+)\\.?(\\d+)?|Android)","i"),t=>t&&t[2]?[UK,[t[2],t[3],t[4]||"0"].join(".")]:[UK,""]],[/Mac OS X (\d+)[_.](\d+)[_.]?(\d+)?/i,t=>{const e=["Mac OS X",""];return t&&t[1]&&(e[1]=[t[1],t[2],t[3]||"0"].join(".")),e}],[/Mac/i,["Mac OS X",""]],[/CrOS/,["Chrome OS",""]],[/Linux|debian/i,["Linux",""]]],ort=function(t){for(let e=0;nrt.length>e;e++){const[n,o]=nrt[e],i=n.exec(t),r=i&&(L_(o)?o(i,t):o);if(r)return r}return["",""]},irt=function(t){return t4n.test(t)?Ote:e4n.test(t)?Gte:Z5n.test(t)?Yte:new RegExp(Dye,"i").test(t)?Dye:new RegExp("(Windows Phone|WPDesktop)","i").test(t)?Git:/iPad/.test(t)?Pit:/iPod/.test(t)?"iPod Touch":/iPhone/.test(t)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(t)?Mit:Fye.test(t)?Fte:/(kobo)\s(ereader|touch)/i.test(t)?"Kobo":new RegExp(Yit,"i").test(t)?Yit:/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i.test(t)||/(kf[a-z]+)( bui|\)).+silk\//i.test(t)?"Kindle Fire":/(Android|ZTE)/i.test(t)?new RegExp(Ek).test(t)&&!/(9138B|TB782B|Nexus [97]|pixel c|HUAWEISHT|BTV|noble nook|smart ultra 6)/i.test(t)||/pixel[\daxl ]{1,6}/i.test(t)&&!/pixel c/i.test(t)||/(huaweimed-al00|tah-|APA|SM-G92|i980|zte|U304AA)/i.test(t)||/lmy47v/i.test(t)&&!/QTAQZ3/i.test(t)?UK:wit:new RegExp("(pda|Mobile)","i").test(t)?$5n:new RegExp(Tte,"i").test(t)&&!new RegExp("Tablet pc","i").test(t)?Uit:""},r4n=function(t,e){var n;const o=irt(t);return o===Pit||o===wit||o==="Kobo"||o==="Kindle Fire"||o===Uit?Tte:o===Ote||o===Yte||o===Gte||o===Dye?"Console":o===Mit?"Wearable":o?Ek:e?.userAgentDataPlatform==="Android"&&((n=e?.maxTouchPoints)!==null&&n!==void 0?n:0)>0?600>Math.min((i=e?.screenWidth)!==null&&i!==void 0?i:0,(r=e?.screenHeight)!==null&&r!==void 0?r:0)/((s=e?.devicePixelRatio)!==null&&s!==void 0?s:1)?Ek:Tte:"Desktop";var i,r,s},Lye=/\bFBAV\/(\d+(?:\.\d+)*)/i,rrt=[[/\bInstagram(?:[ /](\d+(?:\.\d+)*))?\b/i,"Instagram"],[/\bBarcelona[ /](\d+(?:\.\d+)*)?/i,"Threads"],[/\b(?:MessengerForiOS|(?:FBAN|FB_IAB)\/Orca-Android)\b/i,"Messenger",Lye],[/\bFBAN\/EMA\b/i,"Facebook Lite",Lye],[/\b(?:FBIOS|(?:FBAN|FB_IAB)\/(?:FB4A|FBIOS))\b/i,"Facebook",Lye],[/\bLinkedInApp(?:\]?\/(\d+(?:\.\d+)*))?\b/i,"LinkedIn"],[/\bTwitter(?:Android| for (?:iPhone|iPad|Android))(?:\/(\d+(?:\.\d+)*))?\b/i,"Twitter"],[/\b(?:musical_ly|trill)(?:[_/](\d+\.\d+(?:\.\d+)*))?(?=\b|_)/i,"TikTok",/\bapp_version\/(\d+(?:\.\d+)*)/i],[/\b(?:MicroMessenger|WeChat)\/(\d+(?:\.\d+)*)?/i,"WeChat"],[/\bLine\/(\d+(?:\.\d+)*)?/i,"Line"],[/\bGSA\/(\d+(?:\.\d+)*)?/i,"Google"],[/\[Pinterest\/(?:iOS|Android)\b|\bPinterest(?: for (?:Android(?: Tablet)?|iOS))?\/(\d+(?:\.\d+)*)/i,"Pinterest"],[/\b(?:WA4A|WAiOS)\/(\d+(?:\.\d+)*)?/i,"WhatsApp"],[/\bSnapchat[ /](\d+(?:\.\d+)*)?/i,"Snapchat"],[/\bBing(?:Web|Sapphire)\/(\d+(?:\.\d+)*)?/i,"Bing"],[/\bNAVER\(inapp; search;/i,"Naver",/\bNAVER\(inapp; search;[^;)]*; (\d+(?:\.\d+)*)/i],[/\bKAKAOTALK[ /](\d+\.\d+(?:\.\d+)*)?/i,"KakaoTalk"]],Hye="[Truncated]",KK="[Unserializable]";function Bk(t){let e="";for(let n=0;t.length>n;n++){const o=t.charCodeAt(n);if(55296>o||o>56319)e+=56320>o||o>57343?t[n]:"�";else{const i=t.charCodeAt(n+1);56320>i||i>57343?e+="�":(e+=t[n]+t[n+1],n++)}}return e}function srt(t,e){if(!e)return t;let n=[];try{n=Object.keys(e)}catch{n=[]}for(const o of n){let i;try{i=e[o]}catch{i=KK}Object.defineProperty(t,o,{value:i,enumerable:!0,writable:!0,configurable:!0})}return t}const Ute=3e5;var art=class{record(e){if(e.kind==="too-large")return;if(e.kind!=="retry-later")return void this.reset();if(!e.retryAfterMs)return;const n=this.isOpen(),o=Date.now(),i=Math.min(e.retryAfterMs,Ute);if(!n)return this.ts=o,void(this.es=o+i);this.es=Math.max(this.es,Math.min(o+i,this.ts+Ute))}remainingMs(){const e=Date.now();if(this.ts-5e3>e)return this.reset(),0;const n=Math.min(Ute,Math.max(0,this.es-e));return n===0&&this.reset(),n}isOpen(){return this.remainingMs()>0}reset(){this.es=0,this.ts=0}constructor(){this.es=0,this.ts=0}};const s4n=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function Art(t,e){return typeof(n=t)=="string"&&s4n.test(n)?t:e();var n}function crt(t,e){const n=new Error(e);try{Object.defineProperty(n,"name",{value:t,writable:!0,enumerable:!0,configurable:!0})}catch{}return n}function iQ(t){return t&&t.split("#")[0]}function lrt(t){try{return t()}catch{return}}function grt(t,e){const n=setTimeout(t,e);return n!=null&&n.unref&&n?.unref(),n}function urt(t,e,n){return drt.apply(this,arguments)}function drt(){return(drt=Wg(function*(t,e,n){let o;try{return yield Promise.race([t,new Promise((i,r)=>{o=grt(()=>{try{n?.(),i()}catch(s){r(s)}},e)})])}finally{clearTimeout(o)}})).apply(this,arguments)}let Kte,hrt,Oye;function a4n(t){const e=globalThis._posthogChunkIds;if(!e)return;const n=Object.keys(e);return Oye&&n.length===hrt||(hrt=n.length,Oye=n.reduce((o,i)=>{Kte||(Kte={});const r=Kte[i];if(r)o[r[0]]=r[1];else{const s=t(i);for(let a=s.length-1;a>=0;a--){const A=s[a],c=A?.filename,l=e[i];if(c&&l){o[c]=l,Kte[i]=[c,l];break}}}return o},{})),Oye}function VK(t){return VK=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},VK(t)}function A4n(t,e,n){return(e=(function(o){var i=(function(r){if(VK(r)!="object"||!r)return r;var s=r[Symbol.toPrimitive];if(s!==void 0){var a=s.call(r,"string");if(VK(a)!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(r)})(o);return VK(i)=="symbol"?i:i+""})(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function prt(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,o)}return n}function sn(t){for(var e=1;arguments.length>e;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?prt(Object(n),!0).forEach(function(o){A4n(t,o,n[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):prt(Object(n)).forEach(function(o){Object.defineProperty(t,o,Object.getOwnPropertyDescriptor(n,o))})}return t}var c4n=class{constructor(e,n,o=[]){this.coercers=e,this.stackParser=n,this.modifiers=o}buildFromUnknown(e,n={}){const o=n&&n.mechanism||{handled:!0,type:"generic"},i=this.buildCoercingContext(o,n,0).apply(e),r=this.buildParsingContext(n),s=this.parseStacktrace(i,r);return{$exception_list:this.convertToExceptionList(s,o),$exception_level:"error"}}modifyFrames(e){var n=this;return Wg(function*(){for(const o of e)o.stacktrace&&o.stacktrace.frames&&As(o.stacktrace.frames)&&(o.stacktrace.frames=yield n.applyModifiers(o.stacktrace.frames));return e})()}coerceFallback(e){var n;return{type:"Error",value:"Unknown error",stack:(n=e.syntheticException)===null||n===void 0?void 0:n.stack,synthetic:!0}}parseStacktrace(e,n){var o;let i,r;if(e.cause!=null&&(i=this.parseStacktrace(e.cause,n)),e.stack!=""&&e.stack!=null)try{r=this.applyChunkIds(this.stackParser(e.stack,e.synthetic?n.skipFirstLines:0),n.chunkIdMap)}catch{}return sn(sn({},e),{},{cause:i,stack:r,errors:(o=e.errors)===null||o===void 0?void 0:o.map(s=>this.parseStacktrace(s,n))})}applyChunkIds(e,n){return e.map(o=>(o.filename&&n&&(o.chunk_id=n[o.filename]),o))}applyCoercers(e,n){for(const o of this.coercers)if(o.match(e))return o.coerce(e,n);return this.coerceFallback(n)}applyModifiers(e){var n=this;return Wg(function*(){let o=e;for(const i of n.modifiers)o=yield i(o);return o})()}convertToExceptionList(e,n){const o=[],i=(r,s,a)=>{var A;const c=o.length,l=s===void 0?sn(sn({type:typeof n.type=="string"&&n.type.length>0?n.type:"generic"},typeof n.handled=="boolean"?{handled:n.handled}:n.handled===void 0?{handled:!0}:{}),{},{synthetic:typeof n.synthetic=="boolean"?n.synthetic:r.synthetic,exception_id:c}):{type:"chained",source:a,synthetic:r.synthetic,exception_id:c,parent_id:s},g={type:r.type,value:r.value,mechanism:l};r.stack&&(g.stacktrace={type:"raw",frames:r.stack}),o.push(g),r.cause&&i(r.cause,c,"cause");for(const u of(A=r.errors)!==null&&A!==void 0?A:[])i(u,c,"member")};return i(e),o}buildParsingContext(e){var n;return{chunkIdMap:a4n(this.stackParser),skipFirstLines:(n=e.skipFirstLines)!==null&&n!==void 0?n:1}}getAggregateErrors(e){try{if(xk(e)){let o=Object.getPrototypeOf(e);for(let i=0;o&&100>i;i++){var n;const r=(n=Object.getOwnPropertyDescriptor(o,"constructor"))===null||n===void 0?void 0:n.value;if(typeof r=="function"&&r.name==="AggregateError"){const s=e.errors;return As(s)?s:void 0}o=Object.getPrototypeOf(o)}}}catch{}}buildCoercingContext(e,n,o=0){let i=0,r=0,s=!1;const a=new Set,A=[],c={},l=(h,d,p=0)=>{const m=g(d,p),_=m.apply;if(m.apply=E=>{A.push(h);try{return _(E)}finally{A.pop()}},p>4||p>0&&A.indexOf(h)!==-1)return this.coerceFallback(m);const f=typeof h=="object"&&h!==null||typeof h=="function";if(p===0&&i>=50||f&&a.has(h))return;f&&a.add(h),p===0&&i++;const I=this.getAggregateErrors(h);let C,y;s||(s=!!I);try{if(C=this.applyCoercers(h,m),!C)throw c}catch(E){if(E===c)return void(p===0&&i--);if(!s)throw E;C=this.coerceFallback(m)}if(!I||i>=50)return C;try{y=I.length}catch{return C}if(!Number.isInteger(y)||0>y||y>4294967295)return C;const x=[];for(let E=0;50>i&&1e3>r&&y>E;E++){let B;r++;try{B=m.next(I[E])}catch{i++,B=this.coerceFallback(g(d+1))}B&&x.push(B)}return sn(sn({},C),{},{errors:x})},g=(h,d=0)=>sn(sn({},n),{},{syntheticException:h==0?n.syntheticException:void 0,mechanism:h==0?e:{},apply(p){const m=l(p,h,d+1);if(!m)throw c;return m},next:p=>l(p,h+1)}),u=g(o);return sn(sn({},u),{},{apply:h=>{var d;return(d=l(h,o))!==null&&d!==void 0?d:this.coerceFallback(u)}})}};const l4n=/^([a-z][a-z0-9.+-]+):/i,g4n=["http","https","file","blob","app","capacitor","ionic","webpack","webpack-internal","ng"];function u4n(t){if(!t||t==="<anonymous>")return!1;const e=l4n.exec(t);return!e||g4n.includes(e[1].toLowerCase())}function Gye(t,e,n,o,i){const r={platform:t,filename:e,function:n==="<anonymous>"?"?":n,in_app:u4n(e)};return Eo(o)||(r.lineno=o),Eo(i)||(r.colno=i),r}const mrt=(t,e)=>{const n=t.indexOf("safari-extension")!==-1,o=t.indexOf("safari-web-extension")!==-1;return n||o?[t.indexOf("@")!==-1?t.split("@")[0]:"?",n?`safari-extension:${e}`:`safari-web-extension:${e}`]:[t,e]},d4n=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,h4n=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,p4n=/\((\S*)(?::(\d+))(?::(\d+))\)/,m4n=(t,e)=>{const n=d4n.exec(t);if(n){const[,i,r,s]=n;return Gye(e,i,"?",+r,+s)}const o=h4n.exec(t);if(o){if(o[2]&&o[2].indexOf("eval")===0){const s=p4n.exec(o[2]);s&&(o[2]=s[1],o[3]=s[2],o[4]=s[3])}const[i,r]=mrt(o[1]||"?",o[2]);return Gye(e,r,i,o[3]?+o[3]:void 0,o[4]?+o[4]:void 0)}},_4n=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,f4n=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,I4n=(t,e)=>{const n=_4n.exec(t);if(n){if(n[3]&&n[3].indexOf(" > eval")>-1){const r=f4n.exec(n[3]);r&&(n[1]=n[1]||"eval",n[3]=r[1],n[4]=r[2],n[5]="")}let o=n[3],i=n[1]||"?";return[i,o]=mrt(i,o),Gye(e,o,i,n[4]?+n[4]:void 0,n[5]?+n[5]:void 0)}},_rt=/\(error: (.*)\)/;function Yye(t,e){return t.filename===e.filename&&t.function===e.function&&t.module===e.module&&t.lineno===e.lineno&&t.colno===e.colno}function C4n(t){for(let e=1;10>=e;e++){const n=t.length-2*e;if(0>n)break;let o=!0;for(let i=0;e>i;i++)if(!Yye(t[n+i],t[n+e+i])){o=!1;break}if(o){for(let i=0;e>i;i++)t[n+i]=t[n+e+i];return t.length=n+e,{start:n,length:e}}}}function y4n(t,e){const n=e.start+e.length,o=Irt(t,e);o&&t.splice(n+o===t.length?n:e.start,o)}function frt(t,e){let n=e.start;for(;n>0&&Yye(t[n-1],t[n-1+e.length]);)n--;return e.start-n}function Irt(t,e){const n=e.start+e.length;let o=n;for(;t.length>o&&Yye(t[o],t[o-e.length]);)o++;return o-n}function x4n(t,e){const n=e[0];let o=t.length-(n?frt(t,n):0);for(const i of e)o-=Irt(t,i);return o}function E4n(t,e,n){for(let o=0;t.length>o;o++){const i=t[(e+o)%t.length],r=t[(n+o)%t.length];if(i!==r)return r>i}return!1}var B4n=class{match(e){return this.isDOMException(e)||this.isDOMError(e)}coerce(e,n){const o=nA(e.stack);return{type:this.getType(e),value:this.getValue(e),stack:o?e.stack:void 0,cause:e.cause?n.next(e.cause):void 0,synthetic:!1}}getType(e){return this.isDOMError(e)?"DOMError":"DOMException"}getValue(e){const n=e.name||(this.isDOMError(e)?"DOMError":"DOMException");return e.message?`${n}: ${e.message}`:n}isDOMException(e){return Rte(e,"DOMException")}isDOMError(e){return Rte(e,"DOMError")}},b4n=class{match(e){return xk(e)}coerce(e,n){var o;const i=this.getStack(e),r=i===void 0?(o=n.syntheticException)===null||o===void 0?void 0:o.stack:void 0,s=!!r;return{type:this.getType(e),value:this.getMessage(e,n),stack:i??r,cause:e.cause?n.next(e.cause):void 0,synthetic:s}}getType(e){return e.name||e.constructor.name}getMessage(e,n){const o=e.message;return String(o.error&&typeof o.error.message=="string"?o.error.message:o)}getStack(e){try{const n=e.stacktrace;if(typeof n=="string"&&n.length>0)return n;const o=e.stack;return typeof o=="string"&&o.length>0?o:void 0}catch{return}}},S4n=class{match(e){return!!Rte(e,"ErrorEvent")&&(e.error!=null||this.ar(e))}coerce(e,n){var o;if(e.error!=null)return n.apply(e.error);const i=n.apply(e.message);return sn(sn({},i),{},{stack:(o=this.lr(e))!==null&&o!==void 0?o:i.stack,synthetic:!0})}ar(e){return nA(e.message)&&e.message.length>0}lr(e){var n,o;const i=e,r=(n=i.lineno)!==null&&n!==void 0?n:0,s=(o=i.colno)!==null&&o!==void 0?o:0;if(nA(i.filename)&&i.filename.length!==0&&r!==0)return`Error
240
+ at ${i.filename}:${r}:${s}`}};const Q4n=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;var v4n=class{match(e){return typeof e=="string"}coerce(e,n){var o;const[i,r]=this.getInfos(e);return{type:i??"Error",value:r??e,stack:(o=n.syntheticException)===null||o===void 0?void 0:o.stack,synthetic:!0}}getInfos(e){let n="Error",o=e;const i=e.match(Q4n);return i&&(n=i[1],o=i[2]),[n,o]}};const w4n=["fatal","error","warning","log","info","debug"];function Crt(t,e=40){const n=Object.keys(t);if(n.sort(),!n.length)return"[object has no keys]";for(let o=n.length;o>0;o--){const i=n.slice(0,o).join(", ");if(e>=i.length)return o===n.length?i:i.length>e?`${i.slice(0,e)}...`:i}return""}var P4n=class{match(e){return typeof e=="object"&&e!==null}coerce(e,n){var o,i;const r=this.getErrorPropertyFromObject(e);return r?n.apply(r):{type:this.getType(e),value:this.getValue(e),stack:(o=this.getStack(e))!==null&&o!==void 0?o:(i=n.syntheticException)===null||i===void 0?void 0:i.stack,level:this.isSeverityLevel(e.level)?e.level:"error",synthetic:!0}}getType(e){if(wye(e))return e.constructor.name;const n="name"in e?e.name:void 0;return nA(n)&&!YK(n)?n:"Error"}getValue(e){if("name"in e&&typeof e.name=="string"){let o=`'${e.name}' captured as exception`;return"message"in e&&typeof e.message=="string"&&(o+=` with message: '${e.message}'`),o}if("message"in e&&typeof e.message=="string")return e.message;const n=this.getObjectClassName(e);return`${n&&n!=="Object"?`'${n}'`:"Object"} captured as exception with keys: ${Crt(e)}`}isSeverityLevel(e){return nA(e)&&!YK(e)&&w4n.indexOf(e)>=0}getStack(e){try{return nA(e.stacktrace)&&e.stacktrace.length>0?e.stacktrace:nA(e.stack)&&e.stack.length>0?e.stack:void 0}catch{return}}getErrorPropertyFromObject(e){for(const n in e)if({}.hasOwnProperty.call(e,n)){const o=e[n];if(xk(o))return o}}getObjectClassName(e){try{const n=Object.getPrototypeOf(e);return n?n.constructor.name:void 0}catch{return}}},M4n=class{match(e){return wye(e)}coerce(e,n){var o;const i=e.constructor.name;return{type:i,value:`${i} captured as exception with keys: ${Crt(e)}`,stack:(o=n.syntheticException)===null||o===void 0?void 0:o.stack,synthetic:!0}}},D4n=class{match(e){return bit(e)}coerce(e,n){var o;return{type:"Error",value:`Primitive value captured as exception: ${String(e)}`,stack:(o=n.syntheticException)===null||o===void 0?void 0:o.stack,synthetic:!0}}},N4n=class{match(e){return Rte(e,"PromiseRejectionEvent")||this.isCustomEventWrappingRejection(e)}isCustomEventWrappingRejection(e){if(!wye(e))return!1;try{const n=e.detail;return n!=null&&typeof n=="object"&&"reason"in n}catch{return!1}}coerce(e,n){var o;const i=this.getUnhandledRejectionReason(e);return bit(i)?{type:"UnhandledRejection",value:`Non-Error promise rejection captured with value: ${String(i)}`,stack:(o=n.syntheticException)===null||o===void 0?void 0:o.stack,synthetic:!0}:n.apply(i)}getUnhandledRejectionReason(e){try{if("reason"in e)return e.reason;if("detail"in e&&e.detail!=null&&typeof e.detail=="object"&&"reason"in e.detail)return e.detail.reason}catch{}return e}};const Vte="$message",zte="$timestamp",R4n=new Set([Vte,zte]),Uye={enabled:!0,max_bytes:32768};function Jte(t){var e;return t?{enabled:(e=t.enabled)!==null&&e!==void 0?e:Uye.enabled,max_bytes:k4n(t.max_bytes,Uye.max_bytes)}:sn({},Uye)}var T4n=class{constructor(e){this.ns=[],this.ss=0,this.Ir=Jte(e)}setConfig(e){this.Ir=Jte(e),this.rs()}add(e){const n=(function(i){let r;try{r=Eit(i)}catch{return}try{const s=JSON.parse(r);if(!xA(s))return;const a=s,A=a[Vte],c=a[zte];return!nA(A)||A.trim().length===0||!nA(c)&&!jd(c)?void 0:{step:a,json:r}}catch{return}})(e);if(!n)return;const o=(function(i){if("u">typeof TextEncoder)return new TextEncoder().encode(i).length;const r=encodeURIComponent(i);let s=0;for(let a=0;r.length>a;a++)r[a]==="%"?(s+=1,a+=2):s+=1;return s})(n.json);o>this.Ir.max_bytes||(this.ns.push({step:n.step,bytes:o}),this.ss+=o,this.rs())}getAttachable(){return this.ns.map(e=>e.step)}clear(){this.ns=[],this.ss=0}size(){return this.ns.length}rs(){for(;this.ss>this.Ir.max_bytes&&this.ns.length>0;){const e=this.ns.shift();e&&(this.ss-=e.bytes)}}};function k4n(t,e){if(!jd(t)||t===1/0||t===-1/0)return e;const n=Math.floor(t);return 0>n?e:n}const yrt=t=>{if(typeof t!="string")return t;try{return JSON.parse(t)}catch{return t}};function xrt(t){return typeof t=="string"||t}function Ert(t){return typeof t=="string"?t:void 0}const F4n=["$feature_flag","$feature_flag_response","$feature_flag_has_experiment","$feature_flag_id","$feature_flag_version","$feature_flag_reason","$feature_flag_request_id","$feature_flag_evaluated_at","$feature_flag_error","locally_evaluated","$groups","$process_person_profile","$geoip_disable","$current_url","$pathname","$referring_domain","utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid","gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx","$session_id","$window_id","$lib","$lib_version","$device_id","$is_server"],Brt="NativeGzipValidationError",Kye=t=>t.length>=2&&t[0]===31&&t[1]===139,brt=(t,e)=>t===Sye.GZipJS||e===Sye.GZipJS||e==="gzip",Srt=t=>!(!t||typeof t!="object")&&("name"in t?String(t.name):"")==="NotReadableError";let zK;const Wte=t=>{throw crt(Brt,`Native gzip produced invalid output: ${t}`)},L4n=(Qrt=Wg(function*(t,e){18>t.size&&Wte("too-short");const n=new Uint8Array(yield t.slice(0,10).arrayBuffer());Kye(n)&&n[2]===8||Wte("invalid-header");const o=new DataView(yield t.slice(t.size-8).arrayBuffer());o.getUint32(0,!0)!==(r=>{const s=(()=>{if(zK)return zK;zK=[];for(let A=0;256>A;A++){let c=A;for(let l=0;8>l;l++)c=1&c?3988292384^c>>>1:c>>>1;zK[A]=c>>>0}return zK})();let a=4294967295;for(let A=0;r.length>A;A++)a=s[255&(a^r[A])]^a>>>8;return(4294967295^a)>>>0})(e)&&Wte("invalid-crc");const i=e.length>>>0;o.getUint32(4,!0)!==i&&Wte("invalid-size")}),function(t,e){return Qrt.apply(this,arguments)});var Qrt;function Vye(){return Vye=Wg(function*(t,e=!0,n){try{const i=new TextEncoder().encode(t),r=new globalThis.CompressionStream("gzip"),s=r.writable.getWriter(),a=s.write(i).then(()=>s.close()).catch((o=Wg(function*(l){try{yield s.abort(l)}catch{}throw l}),function(l){return o.apply(this,arguments)})),A=new Response(r.readable).blob(),[c]=yield Promise.all([A,a]);return yield L4n(c,i),c}catch(i){if(n?.rethrow)throw i;return e&&console.error("Failed to gzip compress data",i),null}var o}),Vye.apply(this,arguments)}function vrt(t,e){if(t==null)return{};var n,o,i=(function(s,a){if(s==null)return{};var A={};for(var c in s)if({}.hasOwnProperty.call(s,c)){if(a.includes(c))continue;A[c]=s[c]}return A})(t,e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);for(o=0;r.length>o;o++)e.includes(n=r[o])||{}.propertyIsEnumerable.call(t,n)&&(i[n]=t[n])}return i}const H4n={}.propertyIsEnumerable;function jte(t,e){try{return wrt(t,e,{ancestors:new WeakSet,remainingNodes:1e4},0)}catch{return[]}}function zye(t,e,n,o){if(0>=n.remainingNodes)return{stringValue:Hye};if(n.remainingNodes--,hy(t))return{boolValue:t};if(typeof t=="bigint")return(function(i,r){const s=i.toString(),a=BigInt("9223372036854775808");return i>=a||-a>i?(r?.debug(`Attribute ${s} is outside the int64 range; encoding it as a string`),{stringValue:s}):{intValue:s}})(t,e);if(typeof t=="number"){if(!Number.isFinite(t))return{stringValue:String(t)};if(Number.isInteger(t)){if(Number.isSafeInteger(t))return{intValue:String(t)};if(typeof BigInt>"u")return{stringValue:String(t)};const i=BigInt(t).toString();return t>=9223372036854776e3||-9223372036854776e3>t?(e?.debug(`Attribute ${i} is outside the int64 range; encoding it as a string`),{stringValue:i}):{intValue:i}}return{doubleValue:t}}if(typeof t=="string")return{stringValue:Bk(t)};if(typeof t=="function")return{stringValue:"[Function]"};if(typeof t=="symbol")return{stringValue:String(t)};if(typeof t=="object"&&t!==null){if(n.ancestors.has(t))return{stringValue:"[Circular]"};if(o>=20)return{stringValue:Hye};if(t instanceof Date){const i=t.getTime(),r=Number.isFinite(i)?t.toISOString():String(t);return{stringValue:typeof r=="string"?Bk(r):String(r)}}n.ancestors.add(t);try{try{const i=t.toJSON;if(typeof i=="function")return zye(i.call(t),e,n,o+1)}catch{}return As(t)?{arrayValue:{values:O4n(t,e,n,o+1)}}:{kvlistValue:{values:wrt(t,e,n,o+1)}}}finally{n.ancestors.delete(t)}}return{stringValue:Bk(String(t))}}function O4n(t,e,n,o){const i=[],r=Math.min(t.length,1e3);let s=0;for(;r>s&&n.remainingNodes>0;s++)try{const a=s in t?t[s]:void 0;if(Fs(a))continue;i.push(zye(a,e,n,o))}catch{i.push({stringValue:KK})}return t.length>s&&i.push({stringValue:Hye}),i}function wrt(t,e,n,o){const i=[];for(const r in t)if(H4n.call(t,r)){if(!r){e?.debug("Dropping an attribute with an empty key");continue}if(i.length>=1e3||0>=n.remainingNodes){e?.debug("Attributes truncated: the value exceeds the OTLP encoder budget");break}try{const s=t[r];if(ad(s)||Eo(s))continue;i.push({key:Bk(r),value:zye(s,e,n,o)})}catch{i.push({key:Bk(r),value:{stringValue:KK}})}}return i}function Prt(t,e,n){return sn(sn(sn(sn({},srt({},t.resourceAttributes)),{},{"service.name":t.serviceName||"unknown_service"},t.environment&&{"deployment.environment":t.environment}),t.serviceVersion&&{"service.version":t.serviceVersion}),{},{"telemetry.sdk.name":e,"telemetry.sdk.version":n})}const G4n=["service.name","deployment.environment","service.version","telemetry.sdk.name","telemetry.sdk.version"];function Mrt(t,e){const n=srt({},t),o={};for(const i of G4n)({}).hasOwnProperty.call(n,i)&&(o[i]=n[i],delete n[i]);return[...jte(n,e),...jte(o,e)]}const Drt={darwin:"macOS",win32:"Windows",cygwin:"Windows",linux:"Linux",android:"Android",freebsd:"FreeBSD",openbsd:"OpenBSD",netbsd:"NetBSD",sunos:"SunOS",aix:"AIX",haiku:"Haiku","Mac OS X":"macOS"},Nrt={trace:{text:"TRACE",number:1},debug:{text:"DEBUG",number:5},info:{text:"INFO",number:9},warn:{text:"WARN",number:13},error:{text:"ERROR",number:17},fatal:{text:"FATAL",number:21}},Y4n=Nrt.info;function U4n(t){try{return Bk(String(t))}catch{return KK}}function K4n(t,e,n,o){const i=t.level||"info",{text:r,number:s}=Nrt[i]||Y4n,a=(function(u=Date.now()){return String(u)+"000000"})(jd(o)?o:void 0),A={};e.distinctId&&(A.posthogDistinctId=e.distinctId),e.sessionId&&(A.sessionId=e.sessionId),e.windowId&&(A["window.id"]=e.windowId),Fs(e.sessionStartTimestamp)||(A.sessionStartTimestamp=String(e.sessionStartTimestamp)),Fs(e.lastActivityTimestamp)||(A.lastActivityTimestamp=String(e.lastActivityTimestamp)),e.currentUrl&&(A["url.full"]=e.currentUrl),e.screenName&&(A["screen.name"]=e.screenName),e.appState&&(A["app.state"]=e.appState),e.activeFeatureFlags&&e.activeFeatureFlags.length>0&&(A.feature_flags=e.activeFeatureFlags);const c=sn({},A),l=t.attributes;if(l){let u=[];try{u=Object.keys(l)}catch{u=[]}for(const h of u){let d;try{d=l[h]}catch{d=KK}Object.defineProperty(c,h,{value:d,enumerable:!0,writable:!0,configurable:!0})}}const g={timeUnixNano:a,observedTimeUnixNano:a,severityNumber:s,severityText:r,body:{stringValue:U4n(t.body)},attributes:jte(c,n)};return t.trace_id&&(g.traceId=t.trace_id),t.span_id&&(g.spanId=t.span_id),Eo(t.trace_flags)||(g.flags=t.trace_flags),g}function Rrt(t,e,n){return Prt(t,e,n)}function Trt(t,e,n,o){return{resourceLogs:[{resource:{attributes:Mrt(e)},scopeLogs:[{scope:{name:n,version:o},logRecords:t}]}]}}var krt=class{constructor(e){this.ls=e,this.us=0}get pending(){return!!this.hs}arm(e){this.clear(),this.us=Date.now()+e,this.hs=grt(()=>{this.hs=void 0,this.ls()},e)}armNoEarlierThan(e){this.hs&&Date.now()+e<=this.us||this.arm(e)}clear(){this.hs&&(clearTimeout(this.hs),this.hs=void 0)}};function Frt(){return .75+.5*Math.random()}function Lrt(t,e,n,o){const i=Math.min(Math.max(0,e-1),6),r=t*Math.pow(2,i);return Math.round(Math.min(r,Math.max(o,t))*n)}var V4n=class{constructor(e,n,o,i,r,s=()=>Promise.resolve(),a){var A;this._instance=e,this.Ir=n,this.A=o,this.cs=i,this.ds=r,this.vs=s,this.fs=a,this.ps=new krt(()=>this.gs()),this.ys=null,this.bs=0,this._s=0,this.ws=new art,this.ks=0,this.Ss=1,this.xs=0,this.Cs=0,this.$s=!1,this.Ts=n.maxBufferSize,this.Is=Math.max((A=n.maxQueueSize)!==null&&A!==void 0?A:n.maxBufferSize,n.maxBufferSize),this.Ms=n.flushIntervalMs,this.Es=n.maxBatchRecordsPerPost,this.Ps=n.rateCapWindowMs,this.Rs=n.maxLogsPerInterval}clearQueue(){this._s++,this._instance.setPersistedProperty(x9.LogsQueue,[])}reset(){this.ps.clear(),this.xs=0,this.Cs=0,this.$s=!1,this.ks=0,this.Ss=1,this.ws.reset(),this.Es=this.Ir.maxBatchRecordsPerPost}onReconnect(){this.ks=0,this.Ss=1,this.ws.isOpen()?this.As()&&this.Fs():this.gs()}captureLog(e,n){var o;if(this._instance.isDisabled||this._instance.optedOut||!e?.body)return;const i=this.Os(e);if(i===null)return;if(!i.body)return void this.A.info("Log was rejected in beforeSend function");if(!this.Ds())return;const r={record:K4n(i,(o=n?.context)!==null&&o!==void 0?o:this.cs(),this.A,n?.occurredAtMs)};this.ds(()=>this.Ls(r))}Os(e){const n=this.Ir.beforeSend;if(!n)return e;const o=As(n)?n:[n];let i=e;for(const r of o)try{const s=r(i);if(!s)return this.A.info("Log was rejected in beforeSend function"),null;i=s}catch(s){return this.A.error("Error in beforeSend function for log:",s),null}return i}Ds(){if(this.Rs===void 0)return!0;const e=Date.now(),n=e-this.xs;return this.Ps>n&&n>=0||(this.xs=e,this.Cs=0,this.$s=!1),this.Rs>this.Cs?(this.Cs++,!0):(this.$s||(this.A.warn(`captureLog dropping logs: exceeded ${this.Rs} logs per ${this.Ps}ms`),this.$s=!0),!1)}flush(){var e=this;return Wg(function*(){if(!e._instance.isDisabled)return e.ys||(e.ys=e.Ns().finally(()=>{e.ys=null})),e.ys})()}Ns(){var e=this;return Wg(function*(){var n;e.ps.clear();let o=(n=e._instance.getPersistedProperty(x9.LogsQueue))!==null&&n!==void 0?n:[];if(o.length===0)return;const i=o.length;let r=0;for(;o.length>0&&i>r;){var s,a;const A=e._s;e.bs=0;const c=Math.min(o.length,e.Es),l=o.slice(0,c),g=Trt(l.map(h=>h.record),e.qs(),(s=e.fs)!==null&&s!==void 0?s:e._instance.getLibraryId(),e._instance.getLibraryVersion()),u=yield e._instance.js(g);if(e._s!==A)return;if(u.kind==="too-large"&&l.length>1)e.Es=Math.max(1,Math.floor(l.length/2)),e.A.warn(`Logs batch of size ${l.length} was too large for the ingestion endpoint, reducing batch size to ${e.Es}`);else if(e.ws.record(u),e.ps.pending&&e.ps.arm(Math.max(e.Ms,e.ws.remainingMs())),u.kind==="retry-later"||(u.kind==="too-large"?e.A.warn("Dropping a single log record with batch size 1 — the record is larger than the server cap and cannot be split further."):u.kind==="ok"&&e.Ir.maxBatchRecordsPerPost>e.Es&&(e.Es=Math.min(e.Ir.maxBatchRecordsPerPost,e.Es+1)),yield e.Bs(l.length),o=(a=e._instance.getPersistedProperty(x9.LogsQueue))!==null&&a!==void 0?a:[],r+=l.length,u.kind==="fatal"))throw u.error}})()}Bs(e){var n=this;return Wg(function*(){var o;const i=Math.max(0,e-n.bs),r=(o=n._instance.getPersistedProperty(x9.LogsQueue))!==null&&o!==void 0?o:[];n._instance.setPersistedProperty(x9.LogsQueue,r.slice(i)),yield n.vs()})()}qs(){return Rrt(this.Ir,this._instance.getLibraryId(),this._instance.getLibraryVersion())}Ls(e){var n;if(this._instance.optedOut)return;const o=(n=this._instance.getPersistedProperty(x9.LogsQueue))!==null&&n!==void 0?n:[];this.Is>o.length||(o.shift(),this.bs++,this.A.info("Logs queue is full, dropping oldest record.")),o.push(e),this._instance.setPersistedProperty(x9.LogsQueue,o),this.Ts>o.length||this.ws.isOpen()?this.Fs():this.gs()}Fs(){this.ps.pending||this.ps.arm(Math.max(this.Ms,this.ws.remainingMs()))}Hs(){return Math.max(Lrt(this.Ms,this.ks,this.Ss,3e4),this.ws.remainingMs())}As(){const e=this._instance.getPersistedProperty(x9.LogsQueue);return!!e&&e.length>0}shutdown(e){var n=this;return Wg(function*(){n.ps.clear();const o=n.flush().catch(()=>{});e!==void 0?yield urt(o,e):yield o})()}flushWithTimeout(e){var n=this;return Wg(function*(){const o=n.flush();yield urt(o,e,()=>{o.catch(()=>{})})})()}gs(){this.flush().then(()=>{this.ks=0,this.Ss=1},e=>{this.ks++,this.Ss=Frt(),this.A.error("PostHog logs flush failed:",e)}).finally(()=>{!this._instance.isDisabled&&this.As()&&this.ps.armNoEarlierThan(this.Hs())})}};const Jye=[0,5,10,25,50,75,100,250,500,750,1e3,2500,5e3,7500,1e4];function Hrt(t){return String(t)+"000000"}function Ort(t,e,n,o){let i="";return o&&(i=Object.keys(o).sort().map(r=>`${JSON.stringify(r)}:${JSON.stringify(o[r])}`).join(",")),`${t}\0${e}\0${n??""}\0${i}`}var z4n=class{constructor(e,n,o){this._instance=e,this.Ir=n,this.A=o,this.zs=new Map,this.ps=new krt(()=>this.flush().catch(i=>{this.A.error("Metrics flush failed:",i)})),this.ys=null,this.Us=!1,this.Ws=new Map,this.Vs=new Set,this.ws=new art,this.ks=0,this.Ss=1,this.Gs=0}count(e,n=1,o){this.Zs({name:e,type:"count",value:n,unit:o?.unit,attributes:o?.attributes})}gauge(e,n,o){this.Zs({name:e,type:"gauge",value:n,unit:o?.unit,attributes:o?.attributes})}histogram(e,n,o){this.Zs({name:e,type:"histogram",value:n,unit:o?.unit,attributes:o?.attributes})}flush(){var e=this;const n=this.ys,o=(function(){var i=Wg(function*(){n&&(yield n.catch(()=>{})),yield e.Qs()});return function(){return i.apply(this,arguments)}})()().finally(()=>{this.ys===o&&(this.ys=null)});return this.ys=o,o}drainWindow(){if(this.zs.size===0)return null;const e=this.zs;return this.zs=new Map,this.Us=!1,this.Ws=new Map,this.Vs=new Set,this.Js(e)}reset(){this.Gs++,this.ws.reset(),this.ks=0,this.Ss=1,this.ps.clear(),this.zs=new Map,this.ys=null,this.Us=!1,this.Ws=new Map,this.Vs=new Set}Zs(e){if(this._instance.isDisabled||this._instance.optedOut)return;const n=this.Os(e);if(n===null)return;if(!n.name||typeof n.name!="string")return void this.A.warn("Dropping metric with empty name");if(typeof n.value!="number"||!Number.isFinite(n.value))return void this.A.warn(`Dropping metric '${n.name}': value must be a finite number`);if(n.type==="count"&&0>n.value)return void this.A.warn(`Dropping count '${n.name}': counters are monotonic, value must be >= 0`);let o,i;try{o=n.attributes?sn({},n.attributes):void 0,i=Ort(n.type,n.name,n.unit,o)}catch(a){return void this.A.warn(`Dropping metric '${n.name}': attributes could not be serialized`,a)}let r=this.zs.get(i);if(!r){if(!this.Ks())return;r={name:n.name,type:n.type,unit:n.unit,attributes:o,windowStartMs:Date.now()},this.zs.set(i,r)}const s=this.Ws.get(n.name);s===void 0?this.Ws.set(n.name,n.type):s===n.type||this.Vs.has(n.name)||(this.Vs.add(n.name),this.A.warn(`Metric name '${n.name}' is already used as a ${s}; recording it as a ${n.type} too will blend both series in charts. Use a distinct name.`)),this.Xs(r,n.value),this.Fs()}Ks(){return this.Ir.maxSeriesPerFlush>this.zs.size||(this.Us||(this.Us=!0,this.A.warn(`Metric series cap reached (${this.Ir.maxSeriesPerFlush} per flush window); dropping new series until the next flush. Reduce attribute cardinality.`)),!1)}Xs(e,n){switch(e.type){case"count":var o;e.total=((o=e.total)!==null&&o!==void 0?o:0)+n;break;case"gauge":e.last=n;break;case"histogram":{e.hist||(e.hist={count:0,sum:0,min:n,max:n,bucketCounts:new Array(Jye.length+1).fill(0)});const i=e.hist;i.count+=1,i.sum+=n,i.min=Math.min(i.min,n),i.max=Math.max(i.max,n),i.bucketCounts[(function(r,s){for(let a=0;s.length>a;a++)if(s[a]>=r)return a;return s.length})(n,Jye)]+=1;break}}}Os(e){const n=this.Ir.beforeSend;if(!n)return e;const o=As(n)?n:[n];let i=e;for(const r of o)try{const s=r(i);if(!s)return this.A.info("Metric was rejected in beforeSend function"),null;i=s}catch(s){return this.A.error("Error in beforeSend function for metric:",s),null}return i}Fs(){this.ps.pending||this.ps.arm(this.Hs())}Hs(){return Math.max(Lrt(this.Ir.flushIntervalMs,this.ks,this.Ss,3e4),this.ws.remainingMs())}Qs(){var e=this;return Wg(function*(){if(e.ps.clear(),e.zs.size===0)return;const n=e.zs;e.zs=new Map,e.Us=!1,e.Ws=new Map,e.Vs=new Set;const o=e.Gs,i=yield e._instance.Ys(e.Js(n));if(o===e.Gs)switch(e.ws.record(i),i.kind==="retry-later"?(e.ks++,e.Ss=Frt()):(e.ks=0,e.Ss=1),e.ps.pending&&e.ps.arm(e.Hs()),i.kind){case"ok":return;case"retry-later":return e.ho(n),void e.ps.armNoEarlierThan(e.Hs());case"too-large":return void e.A.warn("Metrics batch exceeded the server size limit and was dropped");case"fatal":return void e.A.error("Failed to send metrics batch:",i.error)}})()}Js(e){return n=this.co(e),o=(function(s,a,A){return Prt(s,a,A)})(this.Ir,this._instance.getLibraryId(),this._instance.getLibraryVersion()),i=this._instance.getLibraryId(),r=this._instance.getLibraryVersion(),{resourceMetrics:[{resource:{attributes:Mrt(o)},scopeMetrics:[{scope:{name:i,version:r},metrics:n}]}]};var n,o,i,r}co(e){const n=Hrt(Date.now()),o=new Map;for(const a of e.values()){var i;const A=Ort(a.type,a.name,a.unit,void 0);let c=o.get(A);c||(c=sn({name:a.name},a.unit&&{unit:a.unit}),a.type==="count"?c.sum={aggregationTemporality:1,isMonotonic:!0,dataPoints:[]}:a.type==="gauge"?c.gauge={dataPoints:[]}:c.histogram={aggregationTemporality:1,dataPoints:[]},o.set(A,c));const l=jte((i=a.attributes)!==null&&i!==void 0?i:{},this.A),g=Hrt(a.windowStartMs);if(a.type==="count"){var r;const u={attributes:l,startTimeUnixNano:g,timeUnixNano:n,asDouble:(r=a.total)!==null&&r!==void 0?r:0};c.sum.dataPoints.push(u)}else if(a.type==="gauge"){var s;const u={attributes:l,timeUnixNano:n,asDouble:(s=a.last)!==null&&s!==void 0?s:0};c.gauge.dataPoints.push(u)}else a.hist&&c.histogram.dataPoints.push({attributes:l,startTimeUnixNano:g,timeUnixNano:n,count:a.hist.count,sum:a.hist.sum,min:a.hist.min,max:a.hist.max,bucketCounts:a.hist.bucketCounts,explicitBounds:Jye})}return Array.from(o.values())}ho(e){for(const[i,r]of e){const s=this.zs.get(i);if(s)switch(s.windowStartMs=Math.min(s.windowStartMs,r.windowStartMs),s.type){case"count":var n,o;s.total=((n=s.total)!==null&&n!==void 0?n:0)+((o=r.total)!==null&&o!==void 0?o:0);break;case"gauge":break;case"histogram":if(r.hist)if(s.hist){s.hist.count+=r.hist.count,s.hist.sum+=r.hist.sum,s.hist.min=Math.min(s.hist.min,r.hist.min),s.hist.max=Math.max(s.hist.max,r.hist.max);for(let a=0;s.hist.bucketCounts.length>a;a++)s.hist.bucketCounts[a]+=r.hist.bucketCounts[a]}else s.hist=r.hist}else this.Ks()&&this.zs.set(i,r)}}};const Grt=(t,{debugEnabled:e}={})=>{const n={N(o,...i){Fn&&(f8.DEBUG||Fn.POSTHOG_DEBUG||e)&&!Eo(Fn.console)&&Fn.console&&("__rrweb_original__"in Fn.console[o]?Fn.console[o].__rrweb_original__:Fn.console[o])(t,...i)},debug(...o){n.N("debug",...o)},info(...o){n.N("log",...o)},warn(...o){n.N("warn",...o)},error(...o){n.N("error",...o)},critical(...o){console.error(t,...o)},uninitializedWarning(o){n.error(`You must initialize PostHog before calling ${o}`)},createLogger:(o,i)=>Grt(`${t} ${o}`,i)};return n},gi=Grt("[PostHog.js]"),Ad=gi.createLogger,J4n=Ad("[ExternalScriptsLoader]"),qte=t=>{const e=No?.querySelectorAll("script");if(e){for(let n=0;e.length>n;n++)if(e[n].src===t||e[n].getAttribute("src")===t)return e[n]}},wM=(t,e,n)=>{if(t.config.disable_external_dependency_loading)return J4n.warn(`${e} was requested but loading of external scripts is disabled.`),n("Loading of external scripts is disabled");const o=qte(e);if(o){if(o.__posthog_loading_callback_fired)return n();const r=o.__posthog_loading_error;return r?n(r):(o.addEventListener("load",s=>{o.__posthog_loading_callback_fired=!0,n(void 0,s)}),void o.addEventListener("error",s=>{o.__posthog_loading_error=s,n(s)}))}const i=()=>{if(!No)return n("document not found");if(qte(e))return wM(t,e,n);let r=No.createElement("script");if(r.type="text/javascript",r.crossOrigin="anonymous",r.src=e,r.onload=a=>{r.__posthog_loading_callback_fired=!0,n(void 0,a)},r.onerror=a=>{r.__posthog_loading_error=a,n(a)},t.config.prepare_external_dependency_script&&(r=t.config.prepare_external_dependency_script(r)),!r)return n("prepare_external_dependency_script returned null");if(t.config.external_scripts_inject_target==="head")No.head.appendChild(r);else{const a=No.querySelectorAll("body > script");var s;a.length>0?(s=a[0].parentNode)===null||s===void 0||s.insertBefore(r,a[0]):No.body.appendChild(r)}};No?.body?i():No?.addEventListener("DOMContentLoaded",i)},Wye={},Yrt=(t,e)=>{let n=`/static/${e}.js?v=${t.version}`;return e==="toolbar"&&(n=`${n}&t=${Math.floor(Date.now()/3e5)*3e5}`),t.requestRouter.endpointFor("assets",n)};Ur.__PosthogExtensions__=Ur.__PosthogExtensions__||{},Ur.__PosthogExtensions__.loadExternalDependency=(t,e,n)=>{if(e==="remote-config"){const i=t.requestRouter.endpointFor("assets",`/array/${t.config.token}/config.js`);return void wM(t,i,n)}const o=t.config.strict_script_versioning;if(o){const i=t.requestRouter.endpointFor("assets",`/static/${t.version}/${e}.js`),r=Wye[i];if(o==="fallback"&&r){if(qte(r))return void wM(t,r,n);delete Wye[i]}return void wM(t,i,o==="fallback"?(s,a)=>{if(s)if(typeof s=="string")n(s);else{var A;const c=Yrt(t,e);Wye[i]=c;const l=qte(i);l==null||(A=l.parentNode)===null||A===void 0||A.removeChild(l),wM(t,c,n)}else n(void 0,a)}:n)}wM(t,Yrt(t,e),n)},Ur.__PosthogExtensions__.loadSiteApp=(t,e,n)=>{const o=t.requestRouter.endpointFor("api",e);wM(t,o,n)},f8.DEBUG=!1,f8.LIB_VERSION="1.435.3",f8.LIB_NAME="web";var Ym=f8;const W4n="$people_distinct_id",T4="distinct_id",jye="$device_id",qye="$device_model",Xte="__alias",j4n="__cmpns",Urt="$fbc",bk="$fbc_persistence",Krt="$fbp",JK="$fbp_persistence",Xye="__timers",Vrt="$autocapture_disabled_server_side",$ye="$heatmaps_enabled_server_side",Zye="$exception_capture_enabled_server_side",zrt="$error_tracking_suppression_rules",e2e="$error_tracking_capture_extension_exceptions",t2e="$web_vitals_enabled_server_side",n2e="$dead_clicks_enabled_server_side",o2e="$product_tours_enabled_server_side",Jrt="$logs_capture_enabled_server_side",Wrt="$web_vitals_allowed_metrics",WK="$session_recording_remote_config",q4n="$session_recording_enabled_server_side",X4n="$replay_sample_rate",$4n="$replay_override_sampling",Z4n="$replay_override_linked_flag",eBn="$replay_override_url_trigger",tBn="$replay_override_event_trigger",Sk="$sesid",jrt="$session_is_sampled",nBn="$session_past_minimum_duration",oBn="$session_recording_url_trigger_activated_session",iBn="$session_recording_event_trigger_activated_session",rBn="$debug_first_full_snapshot_timestamp",sBn="$sess_rec_flush_size",k4="$enabled_feature_flags",C8="$active_feature_flags",i2e="$early_access_features",PM="$feature_flag_details",rQ="$feature_flag_payloads",MM="$feature_flag_request_id",jK="$minimal_flag_called_events",B9="$override_feature_flags",DM="$override_feature_flag_payloads",sQ="$stored_person_properties",aQ="$stored_group_properties",qrt="$groups",qK="$surveys",$te="$surveys_loaded_at",Xrt="$surveys_activated",$rt="$surveys_activated_session",Zrt="$surveys_activated_timestamps",r2e="ph_product_tours",aBn="$product_tours_activated",ABn="$product_tours_activated_session",cBn="$conversations_widget_session_id",lBn="$conversations_ticket_id",gBn="$conversations_widget_state",uBn="$conversations_user_traits",AQ="$flag_call_reported",XK="$flag_call_reported_session_id",$K="$feature_flag_errors",cQ="$feature_flag_evaluated_at",py="$user_state",s2e="$client_session_props",dBn="$capture_rate_limit",est="$initial_campaign_params",tst="$initial_referrer_info",Qk="$initial_person_info",a2e="$epp",A2e="$posthog_cookieless",nst="$cookieless_mode",ost="$sdk_debug_extensions_init_method",ist="$sdk_debug_extensions_init_time_ms",c2e="$sdk_debug_recording_script_not_loaded",l2e="$sdk_debug_replay_stale_config",rst="$sdk_debug_replay_event_trigger_status",sst="$sdk_debug_replay_linked_flag_trigger_status",ast="$sdk_debug_replay_matched_recording_trigger_groups",Ast="$sdk_debug_replay_pending_trigger_conditions",cst="$sdk_debug_replay_remote_trigger_matching_config",lst="$sdk_debug_replay_trigger_groups_count",gst="$sdk_debug_replay_url_trigger_status",hBn="$session_recording_start_reason",g2e="PostHog loadExternalDependency extension not found.",y8="anonymous",Zte="identified",ust="identified_only",ZK="visibilitychange",ene="beforeunload",u2e="$pageview",dst="$pageleave",hst="$identify",pst="$groupidentify";function vk(t,e){As(t)&&t.forEach(e)}function vl(t,e){if(!Fs(t))if(As(t))t.forEach(e);else if((n=>n instanceof FormData)(t))t.forEach((n,o)=>e(n,o));else for(const n in t)vye.call(t,n)&&e(t[n],n)}const jg=function(t,...e){for(const n of e)for(const o in n)n[o]!==void 0&&(t[o]=n[o]);return t};function tne(t){const e=Object.keys(t);let n=e.length;const o=new Array(n);for(;n--;)o[n]=[e[n],t[e[n]]];return o}const pBn=function(t){return function(...e){try{return t.apply(this,e)}catch(n){gi.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),gi.critical(n)}}},d2e=function(t){const e={};return vl(t,function(n,o){(nA(n)&&n.length>0||jd(n))&&(e[o]=n)}),e};function mst(t){const e=sn({},t);for(const n of["name","message","stack","cause","errors"])try{n in t&&(e[n]=t[n])}catch{}return e}const mBn=["herokuapp.com","vercel.app","netlify.app"];function _Bn(t){const e=t?.hostname;if(!nA(e))return!1;const n=e.split(".").slice(-2).join(".");for(const o of mBn)if(n===o)return!1;return!0}function jc(t,e,n,o){const{capture:i=!1,passive:r=!0}=o??{};t?.addEventListener(e,n,{capture:i,passive:r})}function h2e(t){return t.name==="ph_toolbar_internal"}const eV=t=>{if(No){try{const e=t+"=",n=No.cookie.split(";").filter(o=>o.length);for(let o=0;n.length>o;o++){let i=n[o];for(;i.charAt(0)==" ";)i=i.substring(1,i.length);if(i.indexOf(e)===0)return decodeURIComponent(i.substring(e.length,i.length))}}catch{}return null}};Math.trunc||(Math.trunc=function(t){return 0>t?Math.ceil(t):Math.floor(t)}),Number.isInteger||(Number.isInteger=function(t){return jd(t)&&isFinite(t)&&Math.floor(t)===t});var fBn=class znt{constructor(e){if(this.bytes=e,e.length!==16)throw new TypeError("not 128-bit length")}static fromFieldsV7(e,n,o,i){if(!Number.isInteger(e)||!Number.isInteger(n)||!Number.isInteger(o)||!Number.isInteger(i)||0>e||0>n||0>o||0>i||e>0xffffffffffff||n>4095||o>1073741823||i>4294967295)throw new RangeError("invalid field value");const r=new Uint8Array(16);return r[0]=e/Math.pow(2,40),r[1]=e/Math.pow(2,32),r[2]=e/Math.pow(2,24),r[3]=e/Math.pow(2,16),r[4]=e/256,r[5]=e,r[6]=112|n>>>8,r[7]=n,r[8]=128|o>>>24,r[9]=o>>>16,r[10]=o>>>8,r[11]=o,r[12]=i>>>24,r[13]=i>>>16,r[14]=i>>>8,r[15]=i,new znt(r)}toString(){let e="";for(let n=0;this.bytes.length>n;n++)e=e+(this.bytes[n]>>>4).toString(16)+(15&this.bytes[n]).toString(16),n!==3&&n!==5&&n!==7&&n!==9||(e+="-");if(e.length!==36)throw new Error("Invalid UUIDv7 was generated");return e}clone(){return new znt(this.bytes.slice(0))}equals(e){return this.compareTo(e)===0}compareTo(e){for(let n=0;16>n;n++){const o=this.bytes[n]-e.bytes[n];if(o!==0)return Math.sign(o)}return 0}},IBn=class{generate(){const e=this.generateOrAbort();if(!Eo(e))return e;{this.Ct=0;const n=this.generateOrAbort();if(Eo(n))throw new Error("Could not generate UUID after timestamp reset");return n}}generateOrAbort(){const e=(()=>{const n=Date.now();return jd(n)&&isFinite(n)?Math.min(Math.max(Math.floor(n),0),0xffffffffffff):0})();if(e>this.Ct)this.Ct=e,this.Mt();else{if(this.Ct>=e+1e4)return;this.It++,this.It>4398046511103&&(this.Ct++,this.Mt())}return fBn.fromFieldsV7(this.Ct,Math.trunc(this.It/Math.pow(2,30)),this.It&Math.pow(2,30)-1,this.Tt.nextUint32())}Mt(){this.It=1024*this.Tt.nextUint32()+(1023&this.Tt.nextUint32())}constructor(){this.Ct=0,this.It=0,this.Tt=new CBn}};let _st=t=>{if("u">typeof UUIDV7_DENY_WEAK_RNG&&UUIDV7_DENY_WEAK_RNG)throw new Error("no cryptographically strong RNG available");for(let e=0;t.length>e;e++)t[e]=65536*Math.trunc(65536*Math.random())+Math.trunc(65536*Math.random());return t};Fn&&!Eo(Fn.crypto)&&crypto.getRandomValues&&(_st=t=>crypto.getRandomValues(t));var CBn=class{nextUint32(){return this.Rt.length>this.At||(_st(this.Rt),this.At=0),this.Rt[this.At++]}constructor(){this.Rt=new Uint32Array(8),this.At=1/0}};let fst;const F4=()=>yBn().toString(),yBn=()=>(fst||(fst=new IBn)).generate();let tV="";const xBn=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i;let wk=null;const cd={Et(){if(!ad(wk))return wk;if(wk=!1,No)try{const t=`__ph_cookie_support_${F4()}`;cd.$t(t,"xyz"),wk=eV(t)==='"xyz"',cd.Lt(t)}catch{wk=!1}return wk},Pt(t){gi.error("cookieStore error: "+t)},Ot:eV,Dt(t){let e;try{e=JSON.parse(cd.Ot(t))||{}}catch{}return e},$t(t,e,n,o,i){if(!No)return!1;try{let r="",s="";const a=(function(c,l){if(l){let g=(function(u,h=No){if(tV)return tV;if(!h||["localhost","127.0.0.1"].includes(u))return"";const d=u.split(".");let p=Math.min(d.length,8);const m="dmn_chk_"+F4();for(;!tV&&p--;){const _=d.slice(p).join("."),f=m+"=1;domain=."+_+";path=/";h.cookie=f+";max-age=3",h.cookie.includes(m)&&(h.cookie=f+";max-age=0",tV=_)}return tV})(c);if(!g){const u=(h=>{const d=h.match(xBn);return d?d[0]:""})(c);u!==g&&gi.info("Warning: cookie subdomain discovery mismatch",u,g),g=u}return g?"; domain=."+g:""}return""})(No.location.hostname,o);if(n){const c=new Date;c.setTime(c.getTime()+864e5*n),r="; expires="+c.toUTCString()}i&&(s="; secure");const A=t+"="+encodeURIComponent(JSON.stringify(e))+r+"; SameSite=Lax; path=/"+a+s;return A.length>3686.4&&gi.warn("cookieStore warning: large cookie, len="+A.length),No.cookie=A,!0}catch{return!1}},Lt(t,e){if(No?.cookie&&(!e||!ad(eV(t))))try{cd.$t(t,"",-1,e)}catch{return}}};let p2e=null;const uc={Et(){if(!ad(p2e))return p2e;let t=!0;if(Eo(Fn))t=!1;else try{const e="__mplssupport__";uc.$t(e,"xyz"),uc.Ot(e)!=='"xyz"'&&(t=!1),uc.Lt(e)}catch{t=!1}return t||gi.error("localStorage unsupported; falling back to cookie store"),p2e=t,t},Pt(t){gi.error("localStorage error: "+t)},Ot(t){try{return Fn?.localStorage.getItem(t)}catch(e){uc.Pt(e)}return null},Dt(t){try{return JSON.parse(uc.Ot(t))||{}}catch{}return null},$t(t,e){try{return Fn?.localStorage.setItem(t,JSON.stringify(e)),!0}catch(n){uc.Pt(n)}return!1},Lt(t){try{Fn?.localStorage.removeItem(t)}catch(e){uc.Pt(e)}}},m2e=[sQ,C8,k4,PM,rQ,MM,cQ,$K,AQ],NM=[jye,T4,Sk,jrt,a2e,Qk,bk,py],nne=t=>t+"_cpm",EBn=["__proto__","constructor","prototype"],_2e=t=>{if(!xA(t))return{};const e={};return Object.keys(t).forEach(n=>{EBn.indexOf(n)===-1&&(e[n]=t[n])}),e},f2e=(t,e=[])=>{const n={};return[...NM,...e].forEach(o=>{const i=t[o];Eo(i)||ad(i)||i===""||(n[o]=i)}),n},Ist=t=>{let e=5381,n=2166136261;for(let o=0;t.length>o;o++){const i=t.charCodeAt(o);e=33*e^i,n=Math.imul(n^i,16777619)}return t.length.toString(36)+"."+(e>>>0).toString(36)+"."+(n>>>0).toString(36)},Cst=(t,e)=>({p:e,f:Ist(JSON.stringify(t))}),yst=(t,e)=>{if(!e)return{properties:[],isValid:!1};try{const n=cd.Dt(nne(t)),o=n?.f===Ist(e)&&As(n.p);return{properties:o?n.p:[],isValid:o}}catch{return{properties:[],isValid:!1}}},I2e=(t,e)=>e+"|"+(cd.Ot(nne(t))||""),Pk={},C2e={Et:()=>!0,Pt(t){gi.error("memoryStorage error: "+t)},Ot:t=>t in Pk?Pk[t]:null,Dt:t=>t in Pk?Pk[t]:null,$t:(t,e)=>(Pk[t]=e,!0),Lt(t){delete Pk[t]}};let RM=null;const Z0={Et(){if(!ad(RM))return RM;if(RM=!0,Eo(Fn))RM=!1;else try{const t="__support__";Z0.$t(t,"xyz"),Z0.Ot(t)!=='"xyz"'&&(RM=!1),Z0.Lt(t)}catch{RM=!1}return RM},Pt(t){gi.error("sessionStorage error: ",t)},Ot(t){try{return Fn?.sessionStorage.getItem(t)}catch(e){Z0.Pt(e)}return null},Dt(t){try{return JSON.parse(Z0.Ot(t))||null}catch{}return null},$t(t,e){try{return Fn?.sessionStorage.setItem(t,JSON.stringify(e)),!0}catch(n){Z0.Pt(n)}return!1},Lt(t){try{Fn?.sessionStorage.removeItem(t)}catch(e){Z0.Pt(e)}}};var BBn=class{constructor(e){this._instance=e}get Ir(){return this._instance.config}get consent(){return this.Do()?0:this.Lo}isOptedOut(){return this.Ir.cookieless_mode==="always"||this.isRejected()||this.consent===-1&&this.Ir.cookieless_mode==="on_reject"}isOptedIn(){return!this.isOptedOut()}isExplicitlyOptedOut(){return this.consent===0}isRejected(){return this.consent===0||this.consent===-1&&this.Ir.opt_out_capturing_by_default}optInOut(e){this.No.$t(this.qo,e?1:0,this.Ir.cookie_expiration,this.Ir.cross_subdomain_cookie,this.Ir.secure_cookie)}reset(){this.No.Lt(this.qo,this.Ir.cross_subdomain_cookie)}get qo(){const{token:e,opt_out_capturing_cookie_prefix:n,consent_persistence_name:o}=this._instance.config;return o||(n?n+e:"__ph_opt_in_out_"+e)}get Lo(){const e=this.No.Ot(this.qo);return Pye(e)?1:as(j5n,e)?0:-1}get No(){const e=this.Ir.opt_out_capturing_persistence_type,n=e==="localStorage"?uc:cd,o=n.Et()?n:C2e;if(!this.jo||this.jo!==o){this.jo=o;const i=e==="localStorage"?cd:uc;i.Ot(this.qo)&&(this.jo.Ot(this.qo)||this.optInOut(Pye(i.Ot(this.qo))),i.Lt(this.qo,this.Ir.cross_subdomain_cookie))}return this.jo}Do(){return!!this.Ir.respect_dnt&&[F_?.doNotTrack,F_?.msDoNotTrack,Ur.doNotTrack,F_?.globalPrivacyControl].some(e=>Pye(e))}};function xst(t,e){var n;const o=t==null||(n=t.config)===null||n===void 0?void 0:n.get_current_url;if(!L_(o))return e;try{const i=o(e);return nA(i)&&i?i:e}catch(i){return gi.error("Error in get_current_url, falling back to window.location.href",i),e}}function Est(t){var e;return t instanceof Element&&(t.id==="__POSTHOG_TOOLBAR__"||!!(!((e=t.closest)===null||e===void 0)&&e.call(t,".toolbar-global-fade-container")))}function b9(t){return!!t&&t.nodeType===1}function j1(t,e){return!!t&&!!t.tagName&&t.tagName.toLowerCase()===e.toLowerCase()}function Bst(t){return!!t&&t.nodeType===3}function y2e(t){return!!t&&t.nodeType===11&&b9(t.host)}function x2e(t){return t?Dte(t).split(/\s+/):[]}function bst(t,e){const n=(function(o){var i;const r=Fn==null||(i=Fn.location)===null||i===void 0?void 0:i.href;return Eo(r)?void 0:xst(o,r)})(e);return!!(n&&t&&t.some(o=>n.match(o)))}function Mk(t){let e="";switch(typeof t.className){case"string":e=t.className;break;case"object":e=(t.className&&"baseVal"in t.className?t.className.baseVal:null)||t.getAttribute("class")||"";break;default:e=""}return x2e(e)}function Sst(t){return Fs(t)?null:Dte(t).split(/(\s+)/).filter(e=>rV(e)).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function nV(t){let e="";return Dk(t)&&!iV(t)&&t.childNodes&&t.childNodes.length&&vl(t.childNodes,function(n){var o;Bst(n)&&n.textContent&&(e+=(o=Sst(n.textContent))!==null&&o!==void 0?o:"")}),Dte(e)}function oV(t){var e;return Eo(t.target)?t.srcElement||null:!((e=t.target)===null||e===void 0)&&e.shadowRoot?t.composedPath()[0]||null:t.target||null}const E2e=["a","button","form","input","select","textarea","label"];function B2e(t,e){const n=t.matches||t.matchesSelector||t.msMatchesSelector||t.mozMatchesSelector||t.webkitMatchesSelector||t.oMatchesSelector;try{return!!n&&n.call(t,e)}catch{return!1}}function b2e(t,e){if(Eo(e))return!0;for(const n of t)if(e.some(o=>B2e(n,o)))return!0;return!1}function Qst(t){const e=t.parentNode;return!(!e||!b9(e))&&e}const S2e=[".ph-no-autocapture","[data-ph-no-autocapture]"],vst=["next","previous","prev",">","<"],bBn=[...vst,"+","-","−","–"],wst=(t,e)=>/[a-z0-9]/i.test(e)?t.includes(e):t===e,Pst=[".ph-no-rageclick",".ph-no-capture"],SBn=["","text","search","email","password","url","tel","number"];function Mst(t,e){if(!Fn||Q2e(t))return!1;let n,o,i;var r,s;if(hy(e)?(n=!!e&&Pst,o=void 0,i=!1):(n=(r=e?.css_selector_ignorelist)!==null&&r!==void 0?r:Pst,o=e?.content_ignorelist,i=(s=e?.ignore_text_selection)!==null&&s!==void 0&&s),n===!1||i&&(function(A){return!(!A||!b9(A))&&(!!j1(A,"textarea")||(j1(A,"input")?as(SBn,(A.getAttribute("type")||"").toLowerCase()):(function(c){var l;if(c.isContentEditable)return!0;const g=(l=c.getAttribute)===null||l===void 0?void 0:l.call(c,"contenteditable");return g==="true"||g===""})(A)))})(t))return!1;const{targetElementList:a}=Dst(t,!1);return!(function(A,c){if(A===!1||Eo(A))return!1;let l;if(A===!0)l=vst;else{if(!As(A))return!1;if(A.length>10)return gi.error("[PostHog] content_ignorelist array cannot exceed 10 items. Use css_selector_ignorelist for more complex matching."),!1;l=A.map(g=>g.toLowerCase())}return c.some(({safeText:g,ariaLabel:u})=>l.some(h=>wst(g,h)||wst(u,h)))})(o,a.map(A=>{var c;return{safeText:nV(A).toLowerCase(),ariaLabel:((c=A.getAttribute("aria-label"))===null||c===void 0?void 0:c.toLowerCase().trim())||""}}))&&!b2e(a,n)}const Q2e=t=>!t||j1(t,"html")||!b9(t),Dst=(t,e)=>{if(!Fn||Q2e(t))return{parentIsUsefulElement:!1,targetElementList:[]};let n=!1;const o=[t];let i=t;for(;i.parentNode&&!j1(i,"body");){if(y2e(i.parentNode)){o.push(i.parentNode.host),i=i.parentNode.host;continue}const r=Qst(i);if(!r)break;if(e||E2e.indexOf(r.tagName.toLowerCase())>-1)n=!0;else try{const s=Fn.getComputedStyle(r);s&&s.getPropertyValue("cursor")==="pointer"&&(n=!0)}catch{}o.push(r),i=r}return{parentIsUsefulElement:n,targetElementList:o}};function Dk(t){const e=new Set;let n=0;for(let r=t;r.parentNode&&!j1(r,"body");r=r.parentNode){if(n++>=1e3||e.has(r))return!1;e.add(r);const s=Mk(r);if(as(s,"ph-sensitive")||as(s,"ph-no-capture"))return!1}if(as(Mk(t),"ph-include"))return!0;const o=t.type||"";if(nA(o))switch(o.toLowerCase()){case"hidden":case"password":return!1}const i=t.name||t.id||"";return!nA(i)||!/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(i.replace(/[^a-zA-Z0-9]/g,""))}function iV(t){return!!(j1(t,"input")&&!["button","checkbox","submit","reset"].includes(t.type)||j1(t,"select")||j1(t,"textarea")||t.getAttribute("contenteditable")==="true")}const Nst=new RegExp("^(?:(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}))$"),Rst=/(^|[^0-9A-Za-z_])([0-9][0-9 -]*[0-9])(?=$|[^0-9A-Za-z_])/g,QBn=[16,15,14,13],vBn=new RegExp("^(\\d{3}-?\\d{2}-?\\d{4})$"),Tst=new RegExp("(^|[^0-9])((?!000|666)[0-9]{3}-?(?!00)[0-9]{2}-?(?!0000)[0-9]{4})(?=$|([^0-9]))","g"),kst=/[0-9A-Za-z_]/;function wBn(t){let e=0,n=!1;for(let o=t.length-1;o>=0;o--){let i=t.charCodeAt(o)-48;n&&(i*=2,i>9&&(i-=9)),e+=i,n=!n}return e%10==0}function rV(t,e=!0){return!(Fs(t)||nA(t)&&(t=Dte(t),(e?Nst.test((t||"").replace(/[- ]/g,"")):(function(n){let o;for(Rst.lastIndex=0;o=Rst.exec(n);){const i=o[2];if(!i)continue;const r=i.replace(/[- ]/g,"");for(let s=0;r.length>s;s++)for(const a of QBn){const A=s+a;if(r.length>=A){const c=r.slice(s,A);if(Nst.test(c)&&wBn(c))return!0}}}return!1})(t))||(e?vBn.test(t):(function(n){let o;for(Tst.lastIndex=0;o=Tst.exec(n);){const i=o[1],r=o[3];if(!(i&&r&&kst.test(i)&&kst.test(r)))return!0}return!1})(t))))}function Fst(t){let e=nV(t);return e=`${e} ${Lst(t)}`.trim(),rV(e)?e:""}function Lst(t){let e="";return t&&t.childNodes&&t.childNodes.length&&vl(t.childNodes,function(n){var o;if(n&&((o=n.tagName)===null||o===void 0?void 0:o.toLowerCase())==="span")try{const i=nV(n);e=`${e} ${i}`.trim(),n.childNodes&&n.childNodes.length&&(e=`${e} ${Lst(n)}`.trim())}catch(i){gi.error("[AutoCapture]",i)}}),e}function Hst(t){return t.replace(/"|\\"/g,'\\"')}function PBn(t){const e=t.attr__class;if(e)return As(e)?e:x2e(e)}const one=Ad("[Dead Clicks]"),MBn=()=>!0,DBn=t=>{var e;const n=!!(!((e=t.instance.persistence)===null||e===void 0)&&e.get_property(n2e)),o=t.instance.config.capture_dead_clicks;return hy(o)?o:!!xA(o)||n};var Ost=class{get lazyLoadedDeadClicksAutocapture(){return this.Bo}constructor(e,n,o){this.instance=e,this.isEnabled=n,this.onCapture=o,this.startIfEnabledOrStop()}onRemoteConfig(e){if(!e.ok)return;const n=e.config;"captureDeadClicks"in n&&(this.instance.persistence&&this.instance.persistence.register({[n2e]:n.captureDeadClicks}),this.startIfEnabledOrStop())}startIfEnabledOrStop(){this.isEnabled(this)?this.Ho(()=>{this.zo()}):this.stop()}Ho(e){var n,o,i;!((n=Ur.__PosthogExtensions__)===null||n===void 0)&&n.initDeadClicksAutocapture?e():(o=Ur.__PosthogExtensions__)===null||o===void 0||(i=o.loadExternalDependency)===null||i===void 0||i.call(o,this.instance,"dead-clicks-autocapture",r=>{r?one.error("failed to load script",r):e()})}zo(){var e;if(No){if(!this.Bo&&(!((e=Ur.__PosthogExtensions__)===null||e===void 0)&&e.initDeadClicksAutocapture)){const n=xA(this.instance.config.capture_dead_clicks)?sn({},this.instance.config.capture_dead_clicks):{};n.__onCapture=this.onCapture,this.onCapture&&(n.capture_dead_swipes=!1),this.Bo=Ur.__PosthogExtensions__.initDeadClicksAutocapture(this.instance,n),this.Bo.start(No),one.info("starting...")}}else one.error("`document` not found. Cannot start.")}stop(){this.Bo&&(this.Bo.stop(),this.Bo=void 0,one.info("stopping..."))}};const sV=Ad("[SegmentIntegration]");function Gst(t,e,n=!0){const o=t.config.segment;if(!o)return e();const{analytics:i,filterProperties:r}=(a=>L_(a.register))(s=o)?{analytics:s}:s;var s;(function(a,A,c,l){const g=h=>{const d=()=>h.anonymousId()||F4();a.config.get_device_id=d,l&&h.id()&&(a.register({distinct_id:h.id(),$device_id:d()}),a.persistence.set_property(py,Zte)),c(l?void 0:h.anonymousId()||void 0)},u=A.user();"then"in u&&L_(u.then)?u.then(g):g(u)})(t,i,a=>{i.register(((A,c,{filterProperties:l}={})=>{typeof Promise<"u"&&Promise.resolve||sV.warn("This browser does not have Promise support, and can not use the segment integration");const g=(u,h)=>{if(!h)return u;const d=!!c&&u.event.anonymousId===c&&!u.event.userId;d||u.event.userId||u.event.anonymousId===A.get_distinct_id()||(sV.info("No userId set, resetting PostHog"),A.reset()),d||(c=void 0),u.event.userId&&u.event.userId!==A.get_distinct_id()&&(sV.info("UserId set, identifying with PostHog"),A.identify(u.event.userId));let p=A.calculateEventProperties(h,u.event.properties);if(!Fs(l)){const m=u.event.properties||{},_={};for(const I of Object.keys(p))vye.call(m,I)||(_[I]=p[I]);const f=((I,C)=>{const y=As(I)?I:[I];let x=sn({},C);for(const E of y)try{if(x=E(x),Fs(x))return null}catch(B){return sV.error("Error in Segment filterProperties:",B),null}return x})(l,_);if(Fs(f))return u;p=f}return u.event.properties=Object.assign({},p,u.event.properties),u};return{name:"PostHog JS",type:"enrichment",version:"1.0.0",isLoaded(){return!0},load(){return Promise.resolve()},track(u){return g(u,u.event.event)},page(u){return g(u,u2e)},identify(u){return g(u,hst)},screen(u){return g(u,"$screen")}}})(t,a,{filterProperties:r})).then(()=>{e()},A=>{sV.error("Failed to register the Segment integration",A),e()})},n)}const Yst="posthog-js";function Ust(t,{organization:e,projectId:n,prefix:o,severityAllowList:i=["error"],sendExceptionsToPostHog:r=!0}={}){return s=>{var a,A,c,l,g;if(i!=="*"&&!i.includes(s.level)||!t.__loaded)return s;s.tags||(s.tags={});const u=t.requestRouter.endpointFor("ui",`/project/${t.config.token}/person/${t.get_distinct_id()}`);s.tags["PostHog Person URL"]=u,t.sessionRecordingStarted()&&(s.tags["PostHog Recording URL"]=t.get_session_replay_url({withTimestamp:!0}));const h=((a=s.exception)===null||a===void 0?void 0:a.values)||[],d=h.map(_=>sn(sn({},_),{},{stacktrace:_.stacktrace?sn(sn({},_.stacktrace),{},{type:"raw",frames:(_.stacktrace.frames||[]).map(f=>sn(sn({},f),{},{platform:"web:javascript"}))}):void 0})),p={$exception_message:((A=h[0])===null||A===void 0?void 0:A.value)||s.message,$exception_type:(c=h[0])===null||c===void 0?void 0:c.type,$exception_level:s.level,$exception_list:d,$sentry_event_id:s.event_id,$sentry_exception:s.exception,$sentry_exception_message:((l=h[0])===null||l===void 0?void 0:l.value)||s.message,$sentry_exception_type:(g=h[0])===null||g===void 0?void 0:g.type,$sentry_tags:s.tags};var m;return e&&n&&(p.$sentry_url=(o||"https://sentry.io/organizations/")+e+"/issues/?project="+n+"&query="+s.event_id),r&&((m=t.exceptions)===null||m===void 0||m.sendExceptionEvent(p)),s}}var NBn=class{constructor(e,n,o,i,r,s){this.name=Yst,this.setupOnce=function(a){a(Ust(e,{organization:n,projectId:o,prefix:i,severityAllowList:r,sendExceptionsToPostHog:s==null||s}))}}},Kst=class{constructor(e){this.Uo=(n,o,i)=>{i&&(i.noSessionId||i.activityTimeout||i.sessionPastMaximumLength||i.crossTabAdoption)&&(gi.info("[PageViewManager] Session rotated, clearing pageview state",{sessionId:n,changeReason:i}),this.Wo=void 0,this._instance.scrollManager.resetContext())},this._instance=e,this.Vo()}Vo(){var e;this.Go=(e=this._instance.sessionManager)===null||e===void 0?void 0:e.onSessionId(this.Uo)}destroy(){var e;(e=this.Go)===null||e===void 0||e.call(this),this.Go=void 0}doPageView(e,n){var o;const i=this.Zo(e,n);return this.Wo={pathname:(o=Fn?.location.pathname)!==null&&o!==void 0?o:"",pageViewId:n,timestamp:e},this._instance.scrollManager.resetContext(),i}doPageLeave(e){var n;return this.Zo(e,(n=this.Wo)===null||n===void 0?void 0:n.pageViewId)}doEvent(){var e;return{$pageview_id:(e=this.Wo)===null||e===void 0?void 0:e.pageViewId}}Zo(e,n){const o=this.Wo;if(!o)return{$pageview_id:n};let i={$pageview_id:n,$prev_pageview_id:o.pageViewId};const r=this._instance.scrollManager.getContext();if(r&&!this._instance.config.disable_scroll_properties){let{maxScrollHeight:s,lastScrollY:a,maxScrollY:A,maxContentHeight:c,lastContentY:l,maxContentY:g}=r;if(!(Eo(s)||Eo(a)||Eo(A)||Eo(c)||Eo(l)||Eo(g))){s=Math.ceil(s),a=Math.ceil(a),A=Math.ceil(A),c=Math.ceil(c),l=Math.ceil(l),g=Math.ceil(g);const u=s>1?E9(a/s,0,1,gi):1,h=s>1?E9(A/s,0,1,gi):1,d=c>1?E9(l/c,0,1,gi):1,p=c>1?E9(g/c,0,1,gi):1;i=jg(i,{$prev_pageview_last_scroll:a,$prev_pageview_last_scroll_percentage:u,$prev_pageview_max_scroll:A,$prev_pageview_max_scroll_percentage:h,$prev_pageview_last_content:l,$prev_pageview_last_content_percentage:d,$prev_pageview_max_content:g,$prev_pageview_max_content_percentage:p})}}return o.pathname&&(i.$prev_pageview_pathname=o.pathname),o.timestamp&&(i.$prev_pageview_duration=(e.getTime()-o.timestamp.getTime())/1e3),i}};const aV=["flags","surveys"],RBn={[W4n]:{exposure:"hidden"},[Xte]:{exposure:"hidden"},[j4n]:{exposure:"hidden"},[Xye]:{exposure:"hidden"},[bk]:{exposure:"hidden"},[JK]:{exposure:"hidden"},[Vrt]:{exposure:"event"},[$ye]:{exposure:"hidden"},[Jrt]:{exposure:"hidden"},[Zye]:{exposure:"event"},[zrt]:{exposure:"hidden"},[e2e]:{exposure:"event"},[t2e]:{exposure:"event"},[n2e]:{exposure:"event"},[o2e]:{exposure:"hidden"},[Wrt]:{exposure:"event"},[WK]:{exposure:"hidden"},[q4n]:{exposure:"hidden"},[Sk]:{exposure:"hidden"},[jrt]:{exposure:"event"},[X4n]:{exposure:"event",shouldSkipFromEventProperties:t=>ad(t)},[nBn]:{exposure:"event"},[oBn]:{exposure:"event"},[iBn]:{exposure:"event"},[rBn]:{exposure:"event"},[sBn]:{exposure:"hidden"},[k4]:{exposure:"hidden",storageGroup:"flags"},[C8]:{exposure:"hidden",storageGroup:"flags"},[i2e]:{exposure:"hidden"},[PM]:{exposure:"hidden",storageGroup:"flags"},[rQ]:{exposure:"hidden",storageGroup:"flags"},[MM]:{exposure:"hidden",storageGroup:"flags",volatile:!0},[jK]:{exposure:"hidden",storageGroup:"flags"},[B9]:{exposure:"hidden"},[DM]:{exposure:"hidden"},[sQ]:{exposure:"hidden"},[aQ]:{exposure:"hidden"},[qK]:{exposure:"hidden",storageGroup:"surveys"},[$te]:{exposure:"hidden",storageGroup:"surveys",volatile:!0},[Xrt]:{exposure:"event"},[$rt]:{exposure:"hidden"},[Zrt]:{exposure:"hidden"},[r2e]:{exposure:"hidden"},[aBn]:{exposure:"hidden"},[ABn]:{exposure:"hidden"},[cBn]:{exposure:"event"},[lBn]:{exposure:"event"},[gBn]:{exposure:"event"},[uBn]:{exposure:"event"},[AQ]:{exposure:"hidden"},[XK]:{exposure:"hidden"},[qrt]:{exposure:"event"},[$K]:{exposure:"hidden"},[cQ]:{exposure:"hidden",storageGroup:"flags",volatile:!0},[py]:{exposure:"hidden"},[s2e]:{exposure:"hidden"},[dBn]:{exposure:"hidden"},[est]:{exposure:"hidden"},[tst]:{exposure:"hidden"},[Qk]:{exposure:"hidden"},[a2e]:{exposure:"hidden"},[$4n]:{exposure:"event"},[Z4n]:{exposure:"event"},[eBn]:{exposure:"event"},[tBn]:{exposure:"event"},[ost]:{exposure:"event"},[ist]:{exposure:"event"},[c2e]:{exposure:"hidden"},[l2e]:{exposure:"hidden"},[rst]:{exposure:"hidden"},[sst]:{exposure:"hidden"},[ast]:{exposure:"hidden"},[Ast]:{exposure:"hidden"},[cst]:{exposure:"hidden"},[lst]:{exposure:"hidden"},[gst]:{exposure:"hidden"},[hBn]:{exposure:"event"}},TBn=[["$posthog_sr_group_event_trigger_",{exposure:"hidden"}],["$posthog_sr_group_url_trigger_",{exposure:"hidden"}],["$posthog_sr_group_sampling_",{exposure:"hidden"}]],Kf=t=>{const e=RBn[t];if(e)return e;for(const[n,o]of TBn)if(t.indexOf(n)===0)return o},Nk=(t,e)=>{try{let n;return JSON.stringify(t,(o,i)=>{var r;return xk(i)?((r=n)!==null&&r!==void 0||(n=new WeakMap),n.has(i)||n.set(i,mst(i)),n.get(i)):typeof i=="bigint"?i.toString():i},e)}catch{return Eit(t)}},x8=t=>{const e=No?.createElement("a");return Eo(e)?null:(e.href=t,e)},Rk=function(t,e){const n=((t.split("#")[0]||"").split(/\?(.*)/)[1]||"").replace(/^\?+/g,"").split("&");let o;for(let i=0;n.length>i;i++){const r=n[i].split("=");if(r[0]===e){o=r;break}}if(!As(o)||2>o.length)return"";{let i=o[1];try{i=decodeURIComponent(i)}catch{gi.error("Skipping decoding for malformed query param: "+i)}return i.replace(/\+/g," ")}},AV=function(t,e,n){if(!t||!e||!e.length)return t;const o=t.split("#"),i=o[1],r=(o[0]||"").split("?"),s=r[1],a=r[0],A=(s||"").split("&"),c=[];for(let g=0;A.length>g;g++){const u=A[g].split("=");As(u)&&(e.includes(u[0])?c.push(u[0]+"="+n):c.push(A[g]))}let l=a;return s!=null&&(l+="?"+c.join("&")),i!=null&&(l+="#"+i),l},ine=function(t,e){const n=t.match(new RegExp(e+"=([^&]*)"));return n?n[1]:null},Vst=(t,e)=>t>=e&&xit(),zst=(t,e,n,o)=>{if(t===0){if(xit()){const i=e+1;return i===n&&o(),i}return e}return 0},Tk=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx"],kBn=["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid",...Tk],cV="<masked>",FBn=["li_fat_id"];function Jst(t,e,n){if(!No)return{};const o=e?[...Tk,...n||[]]:[],i=Wst(AV(No.URL,o,cV),t),r=(function(){const s={};return vl(FBn,function(a){const A=eV(a);s[a]=A||null}),s})();return jg(r,i)}function Wst(t,e){const n=kBn.concat(e||[]),o={};return vl(n,function(i){const r=Rk(t,i);o[i]=r||null}),o}function jst(t){const e=(function(i){return i?i.search("https?://(.*)google.([^/?]*)")===0?"google":i.search("https?://(.*)bing.com")===0?"bing":i.search("https?://(.*)yahoo.com")===0?"yahoo":i.search("https?://(.*)duckduckgo.com")===0?"duckduckgo":null:null})(t),n=e!="yahoo"?"q":"p",o={};if(!ad(e)){o.$search_engine=e;const i=No?Rk(No.referrer,n):"";i.length&&(o.ph_keyword=i)}return o}function qst(){return navigator.language||navigator.userLanguage}function LBn(){const t=qst();return typeof t=="string"?t.split("-")[0]:void 0}const rne="$direct";function Xst(){return No?.referrer||rne}function $st(t,e,n=!1){const o=t?[...Tk,...e||[]]:[],i=n?iQ(sd?.href):sd?.href,r=i?.substring(0,1e3);return{r:Xst().substring(0,1e3),u:r?AV(r,o,cV):void 0}}function Zst(t,e=!1){var n;const{r:o,u:i}=t,r=e?iQ(i):i,s={$referrer:o,$referring_domain:o==null?void 0:o==rne?rne:(n=x8(o))===null||n===void 0?void 0:n.host};if(r){s.$current_url=r;const a=x8(r);s.$host=a?.host,s.$pathname=a?.pathname;const A=Wst(r);jg(s,A)}if(o){const a=jst(o);jg(s,a)}return s}function eat(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch{return}}function HBn(){try{return new Date().getTimezoneOffset()}catch{return}}const OBn={flags:cQ,surveys:$te},GBn=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"],sne=t=>`${t}_cookie_identity_change_pending`,ane=t=>{let e="",n=0;for(const o of t){const i=encodeURIComponent(JSON.stringify(o).slice(1,-1)).length;if(n+i>1e3)break;e+=o,n+=i}return e},Um="main",E8=[k4,C8,PM,rQ,MM,cQ,jK,sQ],v2e=t=>E8.indexOf(t)!==-1,tat=[bk,JK],nat=t=>tat.indexOf(t)!==-1,lQ=(t,e)=>{try{return JSON.stringify(t)===JSON.stringify(e)}catch{return t===e}},kk=t=>{if(!t)return{};const e=JSON.parse(t);return xA(e)?e:{}},oat=(t,e)=>{vl(t,(n,o)=>{const i=Kf(o);i&&i.exposure!=="event"||{}.hasOwnProperty.call(e,o)||delete t[o]})};var w2e=class{constructor(e,n,o=!0){if(this.Qo={},this.Jo=!1,this.Ko=!1,this.Xo=!1,this.Yo=!1,this.ta=!1,this.ea=new Map,this.ia=!1,this.na=!1,this.sa=!1,this.ra=new Set,this.oa=new Set,this.Ir=e,this.aa=o,this.props={},this.la=void 0,this.ua=(i=>{let r="";return i.token&&(r=i.token.replace(/\+/g,"PL").replace(/\//g,"SL").replace(/=/g,"EQ")),i.persistence_name?"ph_"+i.persistence_name:"ph_"+r+"_posthog"})(e),this.hi=e.disable_persistence||!!n,this.No=this.ha(e),this.Xo=this.ca(e),this.load(),this.da(),e.debug&&gi.info("Persistence loaded",e.persistence,sn({},this.props)),this.update_config(e,e,n),this.save(),Fn){const i=()=>this.flush();jc(Fn,"beforeunload",i,{capture:!1}),jc(Fn,"pagehide",i,{capture:!1}),this.va=r=>{if(this.Jo&&(!r.storageArea||r.storageArea===Fn?.localStorage)&&r.key)if(r.key!==this.ua){if(this.Xo){const s=aV.find(a=>r.key===this.fa(a));s&&this.pa(r.key,s)}}else this.pa(r.key,Um)},jc(Fn,"storage",this.va)}}markCrossTabFeatureFlagChanges(e){Object.entries(e).forEach(([n,o])=>{const i=this.ea.get(n);if(!v2e(n)||i===!0)return;if(o===!0)return void this.ga(n,!0);const r=new Set(i||[]);o.forEach(s=>r.add(s)),r.size&&this.ga(n,r)})}onCrossTabFeatureFlagChange(e){return this.oa.add(e),()=>this.oa.delete(e)}destroy(){this.va&&Fn&&(Fn.removeEventListener("storage",this.va),this.va=void 0),this.oa.clear()}pa(e,n,o=!0){if(this.hi)return!1;let i,r;try{if(r=uc.Ot(e),ad(r)){const A=this.ma(n);return A.storageValue=null,n!==Um&&(A.persisted=!1),!1}i=kk(r)}catch{return!1}const s=n===Um?i:uc.Dt(this.ua);if(s&&this.ya(s))return!1;const a=this.ba(i,n,o);return n===Um&&this.Xo&&!lQ(this._a().main,i)||this.wa(i,n,!0,r),a}ya(e){const n=this.props[T4],o=e[T4];return!Eo(n)&&!Eo(o)&&n!==o}wa(e,n,o,i){const r=this.ma(n);r.storageValue=i,n!==Um&&(r.persisted=o);try{r.fingerprint=this.ka(e,n)}catch{r.fingerprint=void 0}}ba(e,n,o){let i=!1;return E8.forEach(r=>{var s;const a=(s=Kf(r))===null||s===void 0?void 0:s.storageGroup;if(n===Um&&this.Xo&&a||n!==Um&&a!==n)return;const A=r in e,c=this.Sa(r,A?e[r]:void 0),l=this.ea.has(r)?r in this.props:A;l===r in this.props&&lQ(c,this.props[r])||(l?this.xa(r,c,!1):this.Ca(r,!1),i=!0)}),i&&o&&this.oa.forEach(r=>r()),i}$a(){if(!this.Jo)return!1;try{this.sa=!1;const e=uc.Ot(this.ua),n=this.ma(Um);let o,i=!1,r=!1;if(e!==n.storageValue)if(ad(e))n.storageValue=null;else{if(o=kk(e),this.sa=!this.na&&this.ya(o),this.sa)return!1;r=this.ba(o,Um,!1),!this.Xo||lQ(this._a().main,o)?this.wa(o,Um,!0,e):n.storageValue=e,i=!0}return this.Xo&&aV.forEach(s=>{const a=uc.Ot(this.fa(s)),A=this.ma(s),c=o||{},l=i&&E8.some(u=>{var h;return((h=Kf(u))===null||h===void 0?void 0:h.storageGroup)===s&&u in c});if(a===A.storageValue&&!l)return;if(ad(a))return A.storageValue=null,A.persisted=!1,void(l&&(r=this.ba(c,s,!1)||r));const g=kk(a);r=this.ba(g,s,!1)||r,this.wa(g,s,!0,a)}),r}catch{return!1}}ga(e,n){this.ea.set(e,n);const o=Kf(e);o?.volatile||(this.ma((this.Xo?o?.storageGroup:void 0)||Um).fingerprint=void 0,this.Ta(e))}Ia(){E8.forEach(e=>this.ea.set(e,!0))}da(){if(this.Jo)try{const e=uc.Ot(this.ua),n=kk(e);this.ma(Um).storageValue=e,E8.forEach(o=>{var i;const r=this.Xo?(i=Kf(o))===null||i===void 0?void 0:i.storageGroup:void 0,s=r?uc.Ot(this.fa(r)):null;if(r){const A=this.ma(r);A.storageValue=s,A.persisted=!ad(s)}const a=r&&!ad(s)?kk(s):n;o in this.props?this.Ma(o,a[o],this.props[o]):o in a&&this.ga(o,!0)})}catch{}}Sa(e,n){const o=this.ea.get(e);if(!o)return n;if(o===!0)return this.props[e];if(e==="$active_feature_flags"){const s=new Set(As(n)?n:[]),a=new Set(As(this.props[e])?this.props[e]:[]);return o.forEach(A=>a.has(A)?s.add(A):s.delete(A)),Array.from(s)}const i=xA(n)?sn({},n):{},r=xA(this.props[e])?this.props[e]:{};return o.forEach(s=>{s in r?i[s]=r[s]:delete i[s]}),i}Ma(e,n,o){if(!v2e(e))return;const i=this.ea.get(e);if(i===!0)return;let r=n;if(this.Jo)try{var s;const A=this.Xo?(s=Kf(e))===null||s===void 0?void 0:s.storageGroup:void 0,c=A?this.fa(A):this.ua;r=kk(uc.Ot(c))[e]}catch{}const a=new Set(i||[]);if(e==="$active_feature_flags"){if(!Eo(n)&&!As(n)||!Eo(r)&&!As(r)||!As(o))return void this.ga(e,!0);const A=new Set(n||[]),c=new Set(r||[]),l=new Set(o);new Set([...A,...l]).forEach(g=>{A.has(g)!==l.has(g)&&a.add(g)}),a.forEach(g=>{c.has(g)===l.has(g)&&a.delete(g)})}else{if(!xA(o))return void(lQ(r,o)?this.ea.delete(e):this.ga(e,!0));{if(!Eo(n)&&!xA(n)||Eo(n)&&nx(o)&&Eo(r))return void this.ga(e,!0);const A=xA(n)?n:{},c=xA(r)?r:{};new Set([...Object.keys(A),...Object.keys(o)]).forEach(l=>{l in A==l in o&&lQ(A[l],o[l])||a.add(l)}),a.forEach(l=>{l in c==l in o&&lQ(c[l],o[l])&&a.delete(l)})}}a.size?this.ga(e,a):this.ea.delete(e)}Ea(){var e;const n=(e=this.Ir)===null||e===void 0?void 0:e.persistence_save_debounce_ms;return jd(n)&&n>0?n:0}Pa(e){if(this.Ir.cookieWinsOnConflict&&this.Ir.persistence.toLowerCase()==="localstorage+cookie")if(e)try{const n=f2e(e,this.Ir.cookie_persisted_properties||[]),o=Cst(n,this.Ir.cookie_persisted_properties||[]),i=JSON.stringify(n)+"|"+JSON.stringify(o),r=cd.Ot(this.ua)||void 0;r&&I2e(this.ua,r)===i&&(this.Ra=i,this.Aa=r)}catch{}else try{const n=cd.Ot(this.ua)||void 0;this.Ra=n?I2e(this.ua,n):void 0,this.Aa=n}catch{}}syncCookieProperties(){return this.Fa(this.Ir)}Fa(e,n=!1){if(this.hi&&!n||this.ta||!e.cookieWinsOnConflict||e.persistence.toLowerCase()!=="localstorage+cookie")return!1;let o;try{o=cd.Ot(this.ua)||void 0}catch{}if(!o||o===this.Aa)return!1;const i=I2e(this.ua,o);let r;try{r=_2e(JSON.parse(o))}catch{return!1}if((cd.Ot(this.ua)||void 0)!==o)return!1;this.Ra=i,this.Aa=o;const s=yst(this.ua,o),a=[...NM,...s.properties],A={};if(Object.keys(r).forEach(m=>{const _=r[m];(Eo(_)||ad(_)||_===""||m==="$user_state"&&_!=="anonymous"&&_!=="identified")&&(A[m]=!0,delete r[m])}),nx(r))return!1;const c="distinct_id"in r||r.$user_state==="anonymous"||r.$user_state==="identified",l=this.props,g=l[T4],u=l[py],h=jg({},l);[...NM,...e.cookie_persisted_properties||[]].forEach(m=>{if(a.indexOf(m)!==-1&&!(m in r)&&!A[m]&&(c||m!=="distinct_id"&&m!=="$user_state")){const _=h[m];(s.isValid||NM.indexOf(m)===-1||_!==!1&&_!==0)&&delete h[m]}}),this.props=jg(h,r),E8.forEach(m=>{const _=m in this.props;m in l===_&&lQ(l[m],this.props[m])||(_?this.Ma(m,l[m],this.props[m]):this.ga(m,!0))}),!c||"$user_state"in r||"$user_state"in this.props||this.xa(py,y8);const d=this.props[T4],p=this.props[py];return!c||d===g&&p===u||(this.na=!0,this.Yo=!0,Z0.$t(sne(this.ua),!0),this.Ca(sQ),this.Ca(C8),this.Ca(k4),this.Ca(PM),this.Ca(rQ),this.Ca(MM),this.Ca(cQ),this.Ca($K),this.Ca(AQ),p!=="anonymous"||u!=="identified"&&r.$user_state!=="anonymous"&&(Eo(g)||d===g)||(oat(this.props,r),this.Ca(aQ)),p==="identified"?this.props.$user_id=d:delete this.props.$user_id,this.Ca(Xte)),!0}consumeCookieIdentityChange(){const e=sne(this.ua),n=this.Yo||!!Z0.Ot(e);return this.Yo=!1,n&&Z0.Lt(e),n}Oa(e=!1){return!(this.ta||this.hi&&!e||!this.Ir.cookieWinsOnConflict||this.Ir.persistence.toLowerCase()!=="localstorage+cookie"||(this.ta=!0,0))}Da(){this.ta&&(Eo(this.La)||(clearTimeout(this.La),this.La=void 0),delete this.Qo[Um],this.Na(!0))}qa(e=!0){if(this.ta)try{e?this.Da():Eo(this.La)||(clearTimeout(this.La),this.La=void 0)}finally{this.ta=!1}}isDisabled(){return!!this.hi}ha(e){GBn.indexOf(e.persistence.toLowerCase())===-1&&(gi.critical("Unknown persistence type "+e.persistence+"; falling back to localStorage+cookie"),e.persistence="localStorage+cookie");const n=((a=[],A=!1)=>{const c=[...NM,...a];return sn(sn({},uc),{},{Dt(l){try{let u,h={};try{u=cd.Ot(l)||void 0,h=u?_2e(JSON.parse(u)):{}}catch{}const d=JSON.parse(uc.Ot(l)||"{}");let p;if(A){const m=yst(l,u),_=[...NM,...m.properties],f={};Object.keys(h).forEach(C=>{const y=h[C];ad(y)||y===""||C==="$user_state"&&y!=="anonymous"&&y!=="identified"||(f[C]=y)});const I="distinct_id"in f||f.$user_state==="anonymous"||f.$user_state==="identified";if(Object.keys(f).length>0){var g;const C=d[T4],y=(g=d.$user_state)!==null&&g!==void 0?g:y8;c.forEach(x=>{if(_.indexOf(x)!==-1&&!(x in h)&&(I||x!=="distinct_id"&&x!=="$user_state")){const E=d[x];(m.isValid||NM.indexOf(x)===-1||E!==!1&&E!==0)&&delete d[x]}}),!I||"$user_state"in h||"$user_state"in d||(d[py]=y8),!I||("distinct_id"in f?f[T4]:d[T4])===C&&("$user_state"in f?f[py]:d[py])===y||(m2e.forEach(x=>delete d[x]),f.$user_state==="identified"&&"distinct_id"in f?d.$user_id=f[T4]:delete d.$user_id,f.$user_state!=="identified"&&(delete d[qrt],delete d[aQ]),delete d.__alias)}p=jg(d,f)}else p=jg(h,d);return uc.$t(l,p),p}catch{}return null},$t(l,g,u,h,d,p){const m=uc.$t(l,g,void 0,void 0,p);try{const _=f2e(g,a);if(Object.keys(_).length){if(A){const f=nne(l),I=Cst(_,a);if(cd.$t(f,I,u,h,d,p),cd.Ot(f)!==JSON.stringify(I)){cd.Lt(f,h);const C=f2e(g);return cd.$t(l,C,u,h,d,p),m}}cd.$t(l,_,u,h,d,p)}}catch(_){uc.Pt(_)}return m},Lt(l,g){try{Fn?.localStorage.removeItem(l),cd.Lt(l,g),cd.Lt(nne(l),g)}catch(u){uc.Pt(u)}}})})(e.cookie_persisted_properties||[],e.cookieWinsOnConflict);let o,i=!1,r=!1;const s=e.persistence.toLowerCase();return s==="localstorage"&&uc.Et()?(o=uc,r=!0):s==="localstorage+cookie"&&n.Et()?(o=n,r=!0,i=!0):s==="sessionstorage"&&Z0.Et()?o=Z0:s==="memory"?o=C2e:s==="cookie"&&cd.Et()?(o=cd,i=!0):n.Et()?(o=n,r=!0,i=!0):cd.Et()?(o=cd,i=!0):o=C2e,this.Jo=r,this.Ko=i,o}fa(e){return`${this.ua}__${e}`}ca(e){return this.Jo&&!!e.split_storage}properties(){const e={};return vl(this.props,(n,o)=>{const i=Kf(o);if(!i||i.exposure==="event"){var r;if(!(i==null||(r=i.shouldSkipFromEventProperties)===null||r===void 0)&&r.call(i,n))return;e[o]=n}}),e}load(e=!1){if(this.hi&&!e)return;const n=this.Ir.cookieWinsOnConflict&&this.Ir.persistence.toLowerCase()==="localstorage+cookie",o=n?uc.Dt(this.ua):null;let i={};if(n)try{i=_2e(cd.Dt(this.ua)),vl(i,(A,c)=>{(Eo(A)||ad(A)||A==="")&&delete i[c]})}catch{}const r=this.No.Dt(this.ua);if(r&&(this.props=jg({},r)),this.Xo&&this.ja(),n&&r){var s,a;const A=o?.[T4],c=(s=o?.$user_state)!==null&&s!==void 0?s:y8,l=r[T4],g=(a=r.$user_state)!==null&&a!==void 0?a:y8;if(l!==A||g!==c){this.Yo=!0,Z0.$t(sne(this.ua),!0);const u=jg({},this.props);m2e.forEach(d=>delete u[d]),g!=="anonymous"||c!=="identified"&&i.$user_state!=="anonymous"&&(Eo(A)||l===A)||(oat(u,i),delete u[aQ]),this.props=u;const h=new Set;m2e.forEach(d=>{var p;const m=(p=Kf(d))===null||p===void 0?void 0:p.storageGroup;m&&h.add(m)}),h.forEach(d=>{const p={};vl(this.props,(m,_)=>{var f;((f=Kf(_))===null||f===void 0?void 0:f.storageGroup)===d&&(p[_]=m)}),nx(p)?(uc.Lt(this.fa(d)),this.Qo[d]={}):uc.$t(this.fa(d),p)&&(this.Qo[d]={persisted:!0,fingerprint:this.ka(p,d)})})}}Z0.Ot(sne(this.ua))&&(this.Yo=!0)}ja(){for(const e of aV){const n=uc.Dt(this.fa(e));if(n&&!nx(n)){const o=this.ma(e);o.persisted=!0,this.Ba(e)||(o.fingerprint=this.ka(n,e)),this.Ha(e,n)||jg(this.props,n)}}}Ba(e){return Object.keys(this.props).some(n=>{var o;return((o=Kf(n))===null||o===void 0?void 0:o.storageGroup)===e})}Ha(e,n){const o=OBn[e];if(!o)return!1;const i=n[o],r=this.props[o];return jd(i)&&jd(r)&&r>i}refreshKey(e){var n;if(this.hi||this.ra.has(e))return;const o=this.Xo?(n=Kf(e))===null||n===void 0?void 0:n.storageGroup:void 0,i=o?uc.Dt(this.fa(o)):this.No.Dt(this.ua);if(i&&e in i)this.xa(e,i[e],!1);else{if(o){const r=this.No.Dt(this.ua);if(r&&e in r)return void this.xa(e,r[e],!1)}this.Ca(e,!1)}}save(){if(this.hi)return;const e=this.Ea();e>0?Eo(this.La)&&(this.La=setTimeout(()=>{this.La=void 0,this.Na()},e)):this.Na()}flush(){Eo(this.La)||(clearTimeout(this.La),this.La=void 0,this.Na())}Na(e=!1){if(this.hi||this.ta&&!e)return;e||(this.syncCookieProperties(),this.Ir.cookieWinsOnConflict&&this.Ir.persistence.toLowerCase()==="localstorage+cookie"||tat.forEach(r=>this.refreshKey(r)));const n=!e&&!this.ia;n||(this.sa=!1);const o=!!n&&this.$a();if(this.sa)return void(this.Ir.debug&&gi.warn("skipping persistence write because storage belongs to a different distinct ID"));if(this.Xo)return this.za(),void(o&&this.oa.forEach(r=>r()));const i=this.Ua(this.No,this.ua,this.props,Um);i==="written"&&this.Pa(this.props),i!=="failed"&&(this.ea.clear(),this.na=!1,this.ra.clear()),o&&this.oa.forEach(r=>r())}za(){const{main:e,groups:n}=this._a(),o=this.Ua(this.No,this.ua,e,Um);o==="written"&&this.Pa(e),o!=="failed"&&(this.na=!1,this.ra.clear(),E8.forEach(r=>{var s;!((s=Kf(r))===null||s===void 0)&&s.storageGroup||this.ea.delete(r)}));for(const r of aV){var i;const s=n[r];if(nx(s)&&!(!((i=this.Qo[r])===null||i===void 0)&&i.persisted)){E8.forEach(A=>{var c;((c=Kf(A))===null||c===void 0?void 0:c.storageGroup)===r&&this.ea.delete(A)});continue}const a=this.Ua(uc,this.fa(r),s,r);a!=="failed"&&E8.forEach(A=>{const c=Kf(A);c?.storageGroup!==r||a!=="written"&&c.volatile||this.ea.delete(A)})}}_a(){const e={},n={flags:{},surveys:{}};return vl(this.props,(o,i)=>{var r;const s=(r=Kf(i))===null||r===void 0?void 0:r.storageGroup;s?n[s][i]=o:e[i]=o}),{main:e,groups:n}}ka(e,n){if(n===Um)return JSON.stringify(e)+"|"+this.Wa+"|"+this.Va+"|"+this.Ga;const o={};return vl(e,(i,r)=>{var s;o[r]=!((s=Kf(r))===null||s===void 0)&&s.volatile?"__volatile__":i}),JSON.stringify(o)}Ua(e,n,o,i){const r=this.ma(i);if(i!==Um&&!r.dirty&&!Eo(r.fingerprint))return"skipped";let s;try{if(s=this.ka(o,i),s===r.fingerprint)return r.dirty=!1,"skipped"}catch{s=void 0}return e.$t(n,o,this.Wa,this.Va,this.Ga,this.Ir.debug)?(r.dirty=!1,i!==Um&&(r.persisted=!0),Eo(s)||(r.fingerprint=s),this.Jo&&(r.storageValue=uc.Ot(n)),"written"):(this.Ir.debug&&gi.warn(`failed to persist storage entry "${n}"; will retry on next save`),"failed")}remove({keepGroupEntries:e=!1}={}){if(this.Ia(),Eo(this.La)||(clearTimeout(this.La),this.La=void 0),this.No.Lt(this.ua,!1),this.No.Lt(this.ua,!0),!e&&this.aa)for(const n of aV)uc.Lt(this.fa(n));e?delete this.Qo[Um]:this.Qo={},this.Ra=void 0,this.Aa=void 0}clear(){this.remove(),this.props={}}register_once(e,n,o){if(xA(e)){this.syncCookieProperties(),Eo(n)&&(n="None"),this.Wa=Eo(o)?this.Za:o;let i=!1;if(vl(e,(r,s)=>{this.props.hasOwnProperty(s)&&this.props[s]!==n||(this.xa(s,r),i=!0)}),i)return this.save(),!0}return!1}register(e,n){if(xA(e)){this.syncCookieProperties(),this.Wa=Eo(n)?this.Za:n;let o=!1;if(vl(e,(i,r)=>{e.hasOwnProperty(r)&&(this.props[r]!==i||xA(i)||As(i))&&(this.xa(r,i),o=!0)}),o)return this.save(),!0}return!1}unregister(e){this.syncCookieProperties();const n=typeof e=="string"?[e]:e;let o=!1;for(const i of n)i in this.props&&(this.Ca(i),o=!0);o&&this.save()}update_campaign_params(){const e=No?.URL;if(e===this.la)return;const n=Jst(this.Ir.custom_campaign_params,this.Ir.mask_personal_data_properties,this.Ir.custom_personal_data_properties),o=!nx(d2e(n));return o&&this.register(n),this.la=e,o?n:void 0}update_search_keyword(){this.register((function(){const e=No?.referrer;return e?jst(e):{}})())}update_referrer_info(){var e;this.register_once({$referrer:Xst(),$referring_domain:No?.referrer&&((e=x8(No.referrer))===null||e===void 0?void 0:e.host)||rne},void 0)}set_initial_person_info(){if(this.props.$initial_campaign_params||this.props.$initial_referrer_info)return;const e=$st(this.Ir.mask_personal_data_properties,this.Ir.custom_personal_data_properties,this.Ir.disable_capture_url_hashes);this.register_once({[Qk]:this.Ko?{r:ane(e.r),u:e.u?ane(e.u):void 0}:e},void 0)}get_initial_props(){const e={};vl([tst,est],o=>{const i=this.props[o];i&&vl(i,function(r,s){e["$initial_"+Qye(s)]=r})});const n=this.props[Qk];if(n){const o=(function(i,r=!1){const s=Zst(i,r),a={};return vl(s,function(A,c){a[`$initial_${Qye(c)}`]=A}),a})(n,this.Ir.disable_capture_url_hashes);jg(e,o)}return e}safe_merge(e){return vl(this.props,function(n,o){o in e||(e[o]=n)}),e}update_config(e,n,o){const i=e.persistence!==n.persistence,r=!((d,p)=>{if(d.length!==p.length)return!1;const m=[...d].sort(),_=[...p].sort();return m.every((f,I)=>f===_[I])})(e.cookie_persisted_properties||[],n.cookie_persisted_properties||[]),s=i||r,a=e.cookieWinsOnConflict!==n.cookieWinsOnConflict,A=e.disable_persistence||!!o,c=!!this.hi&&!A;A||this.Fa(n,c),this.Ir=e,!A&&(i||r||a)&&(this.Ra=void 0,this.Aa=void 0,this.Fa(sn(sn({},e),{},{cookie_persisted_properties:n.cookie_persisted_properties}),c));const l=s||a?this.ha(e):this.No;this.Qa();const g=this.ca(e),u=s||g!==this.Xo,h=!A&&(u||e.cross_subdomain_cookie!==this.Va||e.secure_cookie!==this.Ga)&&this.Oa(c);this.ia=u;try{if(this.Za=this.Wa=e.cookie_expiration,this.set_disabled(A),this.set_cross_subdomain(e.cross_subdomain_cookie),this.set_secure(e.secure_cookie),u){const d=this.props;this.clear(),this.No=l,this.Xo=g,this.props=d,this.save()}else a&&(this.No=l,A||(delete this.Qo[Um],this.Na()))}finally{this.ia=!1,h&&this.qa()}}Qa(){const e=this.props[Qk];if(!this.Ko||!xA(e)||typeof e.r!="string")return;const n=ane(e.r),o=typeof e.u=="string"?ane(e.u):e.u;n===e.r&&o===e.u||this.xa(Qk,sn(sn({},e),{},{r:n,u:o}))}set_disabled(e){this.hi=e,this.hi?this.remove():this.save()}set_cross_subdomain(e){e!==this.Va&&(this.Va=e,this.remove({keepGroupEntries:!0}),this.save())}set_secure(e){e!==this.Ga&&(this.Ga=e,this.remove({keepGroupEntries:!0}),this.save())}set_event_timer(e,n){const o=this.props.__timers||{};o[e]=n,this.xa(Xye,o),this.save()}remove_event_timer(e){const n=this.props.__timers||{},o=n[e];return Eo(o)||(delete n[e],this.xa(Xye,n),this.save()),o}get_property(e){return this.props[e]}set_property(e,n){this.xa(e,n),this.save()}xa(e,n,o=!0){var i;const r=this.props[e];this.props[e]=n,o&&(e!=="distinct_id"&&e!=="$user_state"||r===n||(this.na=!0),nat(e)&&!lQ(r,n)&&this.ra.add(e),this.Ma(e,r,n),!((i=Kf(e))===null||i===void 0)&&i.volatile||this.Ta(e))}Ca(e,n=!0){delete this.props[e],n&&(v2e(e)&&this.ga(e,!0),nat(e)&&this.ra.add(e),this.Ta(e))}Ta(e){var n;const o=(n=Kf(e))===null||n===void 0?void 0:n.storageGroup;o&&(this.ma(o).dirty=!0)}ma(e){return this.Qo[e]||(this.Qo[e]={})}};const M3={GZipJS:"gzip-js",Base64:"base64"},lV={Activation:"events",Cancellation:"cancelEvents"},P2e={Popover:"popover",API:"api",Widget:"widget"},D3={SHOWN:"survey shown",DISMISSED:"survey dismissed",SENT:"survey sent"},M2e={SURVEY_ID:"$survey_id",SURVEY_ITERATION:"$survey_iteration",SURVEY_LAST_SEEN_DATE:"$survey_last_seen_date"},D2e={Popover:"popover",Inline:"inline"};function Ane(t){let e=!0;return{dispose(){if(e){e=!1;const n=t();n&&L_(n.then)&&n.then(void 0,()=>{})}}}}const YBn={SHOWN:"product tour shown"},iat={TOUR_LAST_SEEN_DATE:"$product_tour_last_seen_date",TOUR_TYPE:"$product_tour_type"},rat=Ad("[RateLimiter]");var UBn=class{constructor(e){this.serverLimits={},this.lastEventRateLimited=!1,this.checkForLimiting=n=>{const o=n.text;if(o&&o.length)try{(JSON.parse(o).quota_limited||[]).forEach(i=>{rat.info(`${i||"events"} is quota limited.`),this.serverLimits[i]=new Date().getTime()+6e4})}catch(i){return void rat.warn(`could not rate limit - continuing. Error: "${i?.message}"`,{text:o})}},this.instance=e,this.lastEventRateLimited=this.clientRateLimitContext(!0).isRateLimited}get captureEventsPerSecond(){var e;return((e=this.instance.config.rate_limiting)===null||e===void 0?void 0:e.events_per_second)||10}get captureEventsBurstLimit(){var e;return Math.max(((e=this.instance.config.rate_limiting)===null||e===void 0?void 0:e.events_burst_limit)||10*this.captureEventsPerSecond,this.captureEventsPerSecond)}clientRateLimitContext(e=!1){var n,o,i;const{captureEventsBurstLimit:r,captureEventsPerSecond:s}=this,a=new Date().getTime(),A=(n=(o=this.instance.persistence)===null||o===void 0?void 0:o.get_property("$capture_rate_limit"))!==null&&n!==void 0?n:{tokens:r,last:a};A.tokens+=(a-A.last)/1e3*s,A.last=a,A.tokens>r&&(A.tokens=r);const c=1>A.tokens;if(c||e||(A.tokens=Math.max(0,A.tokens-1)),c&&!e){const l=(jd(A.dropped)?A.dropped:0)+1;A.dropped=l,!this.lastEventRateLimited&&this.Ja(l)&&(A.dropped=0)}return this.lastEventRateLimited=c,(i=this.instance.persistence)===null||i===void 0||i.set_property("$capture_rate_limit",A),{isRateLimited:c,remainingTokens:A.tokens}}Ka(e){const n=this.instance.config.property_denylist;return!As(n)||!n.includes(e)}Xa(){var e;if(this.Ka("$current_url")&&this.Ka("$pathname")&&sd?.pathname)return`${(e=sd.origin)!==null&&e!==void 0?e:""}${sd.pathname}`}Ja(e){var n,o;const{captureEventsBurstLimit:i,captureEventsPerSecond:r}=this,s=this.Xa(),a=this.Ka("$session_id")?(n=(o=this.instance).get_session_id)===null||n===void 0?void 0:n.call(o):void 0,A=[`${e} event(s) dropped since the last warning`,s?`triggered on ${s}`:void 0,a?`session ${a}`:void 0].filter(Boolean).join(", ");return!!this.instance.capture("$$client_ingestion_warning",{$$client_ingestion_warning_message:`posthog-js client rate limited: ${A}. Config is set to ${r} events per second and ${i} events burst limit.`},{skip_client_rate_limiting:!0})}isServerRateLimited(e){const n=this.serverLimits[e||"events"]||!1;return n!==!1&&new Date().getTime()<n}};const gQ=Ad("[RemoteConfig]");var sat=class{constructor(e){this._instance=e}get remoteConfig(){var e;return(e=Ur._POSTHOG_REMOTE_CONFIG)===null||e===void 0||(e=e[this._instance.config.token])===null||e===void 0?void 0:e.config}Ya(e){var n,o,i;!((n=Ur.__PosthogExtensions__)===null||n===void 0)&&n.loadExternalDependency?(o=Ur.__PosthogExtensions__)===null||o===void 0||(i=o.loadExternalDependency)===null||i===void 0||i.call(o,this._instance,"remote-config",()=>e(this.remoteConfig)):e()}tl(e){this._instance._send_request({method:"GET",url:this._instance.requestRouter.endpointFor("assets",`/array/${this._instance.config.token}/config`),callback:e})}load(){try{if(this.remoteConfig)return gQ.info("Using preloaded remote config",this.remoteConfig),void this.el(this.remoteConfig);if(this._instance.il())return void gQ.warn("Remote config is disabled. Falling back to local config.");this.Ya(e=>{if(!e)return gQ.info("No config found after loading remote JS config. Falling back to JSON."),void this.tl(n=>{this.el(n.json,n)});this.el(e)})}catch(e){gQ.error("Error loading remote config",e),this.el()}}el(e,n){!e&&n&&(n.statusCode===0?n.error||gQ.warn("Failed to fetch remote config from PostHog."):gQ.error("Failed to fetch remote config from PostHog."));try{this._instance.el(e?{ok:!0,config:e}:{ok:!1})}catch(i){gQ.error("Error applying remote config",i)}if(e?.hasFeatureFlags!==!1&&!this._instance.config.advanced_disable_feature_flags_on_first_load)try{var o;(o=this._instance.featureFlags)===null||o===void 0||o.ensureFlagsLoaded()}catch(i){gQ.error("Error loading feature flags",i)}}},h5=Uint8Array,ox=Uint16Array,Fk=Uint32Array,N2e=new h5([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]),R2e=new h5([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]),aat=new h5([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Aat=function(t,e){for(var n=new ox(31),o=0;31>o;++o)n[o]=e+=1<<t[o-1];var i=new Fk(n[30]);for(o=1;30>o;++o)for(var r=n[o];n[o+1]>r;++r)i[r]=r-n[o]<<5|o;return[n,i]},cat=Aat(N2e,2),T2e=cat[1];cat[0][28]=258,T2e[258]=28;for(var lat=Aat(R2e,0)[1],gat=new ox(32768),ld=0;32768>ld;++ld){var Lk=(43690&ld)>>>1|(21845&ld)<<1;gat[ld]=((65280&(Lk=(61680&(Lk=(52428&Lk)>>>2|(13107&Lk)<<2))>>>4|(3855&Lk)<<4))>>>8|(255&Lk)<<8)>>>1}var gV=function(t,e,n){for(var o=t.length,i=0,r=new ox(e);o>i;++i)++r[t[i]-1];var s,a=new ox(e);for(i=0;e>i;++i)a[i]=a[i-1]+r[i-1]<<1;for(s=new ox(o),i=0;o>i;++i)s[i]=gat[a[t[i]-1]++]>>>15-t[i];return s},TM=new h5(288);for(ld=0;144>ld;++ld)TM[ld]=8;for(ld=144;256>ld;++ld)TM[ld]=9;for(ld=256;280>ld;++ld)TM[ld]=7;for(ld=280;288>ld;++ld)TM[ld]=8;var cne=new h5(32);for(ld=0;32>ld;++ld)cne[ld]=5;var KBn=gV(TM,9),VBn=gV(cne,5),uat=function(t){return(t/8|0)+(7&t&&1)},dat=function(t,e,n){(n==null||n>t.length)&&(n=t.length);var o=new(t instanceof ox?ox:t instanceof Fk?Fk:h5)(n-e);return o.set(t.subarray(e,n)),o},B8=function(t,e,n){var o=e/8|0;t[o]|=n<<=7&e,t[o+1]|=n>>>8},uV=function(t,e,n){var o=e/8|0;t[o]|=n<<=7&e,t[o+1]|=n>>>8,t[o+2]|=n>>>16},k2e=function(t,e){for(var n=[],o=0;t.length>o;++o)t[o]&&n.push({s:o,f:t[o]});var i=n.length,r=n.slice();if(!i)return[new h5(0),0];if(i==1){var s=new h5(n[0].s+1);return s[n[0].s]=1,[s,1]}n.sort(function(y,x){return y.f-x.f}),n.push({s:-1,f:25001});var a=n[0],A=n[1],c=0,l=1,g=2;for(n[0]={s:-1,f:a.f+A.f,l:a,r:A};l!=i-1;)a=n[n[g].f>n[c].f?c++:g++],A=n[c!=l&&n[g].f>n[c].f?c++:g++],n[l++]={s:-1,f:a.f+A.f,l:a,r:A};var u=r[0].s;for(o=1;i>o;++o)r[o].s>u&&(u=r[o].s);var h=new ox(u+1),d=F2e(n[l-1],h,0);if(d>e){o=0;var p=0,m=d-e,_=1<<m;for(r.sort(function(y,x){return h[x.s]-h[y.s]||y.f-x.f});i>o;++o){var f=r[o].s;if(e>=h[f])break;p+=_-(1<<d-h[f]),h[f]=e}for(p>>>=m;p>0;){var I=r[o].s;e>h[I]?p-=1<<e-h[I]++-1:++o}for(;o>=0&&p;--o){var C=r[o].s;h[C]==e&&(--h[C],++p)}d=e}return[new h5(h),d]},F2e=function(t,e,n){return t.s==-1?Math.max(F2e(t.l,e,n+1),F2e(t.r,e,n+1)):e[t.s]=n},hat=function(t){for(var e=t.length;e&&!t[--e];);for(var n=new ox(++e),o=0,i=t[0],r=1,s=function(A){n[o++]=A},a=1;e>=a;++a)if(t[a]==i&&a!=e)++r;else{if(!i&&r>2){for(;r>138;r-=138)s(32754);r>2&&(s(r>10?r-11<<5|28690:r-3<<5|12305),r=0)}else if(r>3){for(s(i),--r;r>6;r-=6)s(8304);r>2&&(s(r-3<<5|8208),r=0)}for(;r--;)s(i);r=1,i=t[a]}return[n.subarray(0,o),e]},dV=function(t,e){for(var n=0,o=0;e.length>o;++o)n+=t[o]*e[o];return n},L2e=function(t,e,n){var o=n.length,i=uat(e+2);t[i]=255&o,t[i+1]=o>>>8,t[i+2]=255^t[i],t[i+3]=255^t[i+1];for(var r=0;o>r;++r)t[i+r+4]=n[r];return 8*(i+4+o)},pat=function(t,e,n,o,i,r,s,a,A,c,l){B8(e,l++,n),++i[256];for(var g=k2e(i,15),u=g[0],h=g[1],d=k2e(r,15),p=d[0],m=d[1],_=hat(u),f=_[0],I=_[1],C=hat(p),y=C[0],x=C[1],E=new ox(19),B=0;f.length>B;++B)E[31&f[B]]++;for(B=0;y.length>B;++B)E[31&y[B]]++;for(var S=k2e(E,7),Q=S[0],w=S[1],M=19;M>4&&!Q[aat[M-1]];--M);var k,R,F,O,U=c+5<<3,Y=dV(i,TM)+dV(r,cne)+s,J=dV(i,u)+dV(r,p)+s+14+3*M+dV(E,Q)+(2*E[16]+3*E[17]+7*E[18]);if(Y>=U&&J>=U)return L2e(e,l,t.subarray(A,A+c));if(B8(e,l,1+(Y>J)),l+=2,Y>J){k=gV(u,h),R=u,F=gV(p,m),O=p;var ee=gV(Q,w);for(B8(e,l,I-257),B8(e,l+5,x-1),B8(e,l+10,M-4),l+=14,B=0;M>B;++B)B8(e,l+3*B,Q[aat[B]]);l+=3*M;for(var W=[f,y],q=0;2>q;++q){var ie=W[q];for(B=0;ie.length>B;++B)B8(e,l,ee[se=31&ie[B]]),l+=Q[se],se>15&&(B8(e,l,ie[B]>>>5&127),l+=ie[B]>>>12)}}else k=KBn,R=TM,F=VBn,O=cne;for(B=0;a>B;++B)if(o[B]>255){var se;uV(e,l,k[257+(se=o[B]>>>18&31)]),l+=R[se+257],se>7&&(B8(e,l,o[B]>>>23&31),l+=N2e[se]);var oe=31&o[B];uV(e,l,F[oe]),l+=O[oe],oe>3&&(uV(e,l,o[B]>>>5&8191),l+=R2e[oe])}else uV(e,l,k[o[B]]),l+=R[o[B]];return uV(e,l,k[256]),l+R[256]},zBn=new Fk([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),JBn=(function(){for(var t=new Fk(256),e=0;256>e;++e){for(var n=e,o=9;--o;)n=(1&n&&3988292384)^n>>>1;t[e]=n}return t})(),H2e=function(t,e,n){for(;n;++e)t[e]=n,n>>>=8};function WBn(t,e){e===void 0&&(e={});var n=(function(){var g=4294967295;return{p(u){for(var h=g,d=0;u.length>d;++d)h=JBn[255&h^u[d]]^h>>>8;g=h},d(){return 4294967295^g}}})(),o=t.length;n.p(t);var i,r,s,a,A,c=(a=10+((i=e).filename&&i.filename.length+1||0),A=8,(function(g,u,h,d,p,m){var _=g.length,f=new h5(d+_+5*(1+Math.floor(_/7e3))+p),I=f.subarray(d,f.length-p),C=0;if(!u||8>_)for(var y=0;_>=y;y+=65535){var x=y+65535;_>x?C=L2e(I,C,g.subarray(y,x)):(I[y]=m,C=L2e(I,C,g.subarray(y,_)))}else{for(var E=zBn[u-1],B=E>>>13,S=8191&E,Q=(1<<h)-1,w=new ox(32768),M=new ox(Q+1),k=Math.ceil(h/3),R=2*k,F=function(Ce){return(g[Ce]^g[Ce+1]<<k^g[Ce+2]<<R)&Q},O=new Fk(25e3),U=new ox(288),Y=new ox(32),J=0,ee=0,W=(y=0,0),q=0,ie=0;_>y;++y){var se=F(y),oe=32767&y,ge=M[se];if(w[oe]=ge,M[se]=oe,y>=q){var ue=_-y;if((J>7e3||W>24576)&&ue>423){C=pat(g,I,0,O,U,Y,ee,W,ie,y-ie,C),W=J=ee=0,ie=y;for(var Ie=0;286>Ie;++Ie)U[Ie]=0;for(Ie=0;30>Ie;++Ie)Y[Ie]=0}var le=2,_e=0,me=S,ye=oe-ge&32767;if(ue>2&&se==F(y-ye))for(var ve=Math.min(B,ue)-1,Pe=Math.min(32767,y),he=Math.min(258,ue);Pe>=ye&&--me&&oe!=ge;){if(g[y+le]==g[y+le-ye]){for(var Qe=0;he>Qe&&g[y+Qe]==g[y+Qe-ye];++Qe);if(Qe>le){if(le=Qe,_e=ye,Qe>ve)break;var we=Math.min(ye,Qe-2),Me=0;for(Ie=0;we>Ie;++Ie){var He=y-ye+Ie+32768&32767,Re=He-w[He]+32768&32767;Re>Me&&(Me=Re,ge=He)}}}ye+=(oe=ge)-(ge=w[oe])+32768&32767}if(_e){O[W++]=268435456|T2e[le]<<18|lat[_e];var Be=31&T2e[le],ke=31&lat[_e];ee+=N2e[Be]+R2e[ke],++U[257+Be],++Y[ke],q=y+le,++J}else O[W++]=g[y],++U[g[y]]}}C=pat(g,I,m,O,U,Y,ee,W,ie,y-ie,C)}return dat(f,0,d+uat(C)+p)})(r=t,(s=e).level==null?6:s.level,s.mem==null?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(r.length)))):12+s.mem,a,A,!0)),l=c.length;return(function(g,u){var h=u.filename;if(g[0]=31,g[1]=139,g[2]=8,g[8]=2>u.level?4:u.level==9?2:0,g[9]=3,u.mtime!=0&&H2e(g,4,Math.floor(new Date(u.mtime||Date.now())/1e3)),h){g[3]=8;for(var d=0;h.length>=d;++d)g[d+10]=h.charCodeAt(d)}})(c,e),H2e(c,l-8,n.d()),H2e(c,l-4,o),c}const jBn=!!bye||!!OK,mat=new WeakMap,_at="text/plain";let O2e=0,lne=!1;const fat=(t,e)=>{const[n,o]=t.split("#"),[i,r]=n.split("?");if(!r)return t;const s=r.split("&").filter(a=>a.split("=")[0]!==e).join("&");return`${i}${s?`?${s}`:""}${o?`#${o}`:""}`},hV=(t,e,n=!0)=>{var o;const[i,r]=t.split("?"),s=sn({},e),a=(o=r?.split("&").map(c=>{var l;const[g,u]=c.split("="),h=n&&(l=s[g])!==null&&l!==void 0?l:u;return delete s[g],`${g}=${h}`}))!==null&&o!==void 0?o:[],A=(function(c,l="&"){let g,u;const h=[];return vl(c,function(d,p){Eo(d)||Eo(p)||p==="undefined"||(g=encodeURIComponent((m=>m instanceof File)(d)?d.name:d.toString()),u=encodeURIComponent(p),h[h.length]=u+"="+g)}),h.join(l)})(s);return A&&a.push(A),a.length>0?`${i}?${a.join("&")}`:i},G2e=t=>{if(t.nl)return t.nl;const{data:e,compression:n}=t;if(!e)return;if(n===M3.GZipJS){const i=WBn((function(r){var s=r.length;if(typeof TextEncoder<"u")return new TextEncoder().encode(r);for(var a=new h5(r.length+(r.length>>>1)),A=0,c=function(h){a[A++]=h},l=0;s>l;++l){if(A+5>a.length){var g=new h5(A+8+(s-l<<1));g.set(a),a=g}var u=r.charCodeAt(l);128>u?c(u):2048>u?(c(192|u>>>6),c(128|63&u)):u>55295&&57344>u?(c(240|(u=65536+(1047552&u)|1023&r.charCodeAt(++l))>>>18),c(128|u>>>12&63),c(128|u>>>6&63),c(128|63&u)):(c(224|u>>>12),c(128|u>>>6&63),c(128|63&u))}return dat(a,0,A)})(Nk(e)),{mtime:0});return{contentType:_at,body:i.buffer.slice(i.byteOffset,i.byteOffset+i.byteLength),estimatedSize:i.byteLength}}if(n===M3.Base64){const i=(function(s){return s&&btoa(encodeURIComponent(s).replace(/%([0-9A-F]{2})/g,(a,A)=>String.fromCharCode(parseInt(A,16))))})(Nk(e)),r=(s=>"data="+encodeURIComponent(typeof s=="string"?s:Nk(s)))(i);return{contentType:"application/x-www-form-urlencoded",body:r,estimatedSize:new Blob([r]).size}}const o=Nk(e);return{contentType:"application/json",body:o,estimatedSize:new Blob([o]).size}},Iat=t=>{const e=()=>t.transport==="sendBeacon"?{url:hV(t.url,{compression:M3.Base64}),encodedBody:G2e(sn(sn({},t),{},{compression:M3.Base64,nl:void 0}))}:{url:fat(t.url,"compression"),encodedBody:G2e(sn(sn({},t),{},{compression:void 0,nl:void 0}))};let n;try{n=G2e(t)}catch(i){if(brt(t.compression,Rk(t.url,"compression")))return gi.error("Failed to gzip request body, sending uncompressed payload",i),e();throw i}return n&&brt(t.compression,Rk(t.url,"compression"))&&!((o=n.body)instanceof ArrayBuffer?Kye(new Uint8Array(o)):ArrayBuffer.isView(o)&&Kye(new Uint8Array(o.buffer,o.byteOffset,o.byteLength)))?(lne=!0,e()):{url:t.url,encodedBody:n};var o},Cat=t=>{try{return Iat(t)}catch(n){var e;return gi.error(n),void((e=t.callback)===null||e===void 0||e.call(t,{statusCode:0,error:n}))}},qBn=(function(){var t=Wg(function*(e){const n=yield(function(i){return Vye.apply(this,arguments)})(Nk(e.data),Ym.DEBUG,{rethrow:!0});if(!n)return e;const o=yield n.arrayBuffer();return sn(sn({},e),{},{nl:{contentType:_at,body:o,estimatedSize:o.byteLength}})});return function(e){return t.apply(this,arguments)}})(),XBn=/Failed to fetch|NetworkError|Load failed/i,yat=t=>t?.name==="TypeError"&&XBn.test(t?.message||""),xat=t=>{try{const e=(function(n,o=Date.now()){if(typeof n!="string"||!n)return;const i=n.trim(),r=/^\d+\s*,/.test(i)?i.slice(0,i.indexOf(",")).trim():i;if(/^\d+$/.test(r)){const A=1e3*Math.min(Number(r),300);return A>0?A:void 0}if(!/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun)[a-z]*[ ,]/.test(r))return;const s=/^\w{3} \w{3} /.test(r)?r+" GMT":r,a=Date.parse(s)-o;return Number.isFinite(a)&&a>0?Math.min(a,Ute):void 0})(t());return Eo(e)?void 0:Math.min(e,3e4)}catch{return}},Eat=t=>{const e=Cat(t);if(!e)return;const n=new bye;mat.set(n,!0);const{url:o,encodedBody:i}=e;n.open(t.method||"GET",o,!0);const{contentType:r,body:s}=i??{};vl(t.headers,function(a,A){n.setRequestHeader(A,a)}),r&&n.setRequestHeader("Content-Type",r),t.timeout&&(n.timeout=t.timeout),n.onreadystatechange=()=>{if(n.readyState===4){var a;const A={statusCode:n.status,text:n.responseText};if(n.status===200)try{A.json=JSON.parse(n.responseText)}catch{}(a=t.callback)===null||a===void 0||a.call(t,A,xat(()=>n.getResponseHeader("Retry-After")))}},n.send(s)},Bat=t=>{const e=Cat(t);if(!e)return;const{url:n,encodedBody:o}=e,{contentType:i,body:r,estimatedSize:s}=o??{},a=new Headers;vl(t.headers,function(d,p){a.append(p,d)}),i&&a.append("Content-Type",i);let A=null,c=!1;if(yit){const d=new yit;A={signal:d.signal,timeout:setTimeout(()=>{c=!0;try{d.abort(crt("AbortError","PostHog request timed out"+((p=t.timeout)?` after ${p}ms`:"")))}catch(m){g(m)}var p},t.timeout)}}let l=!1;const g=d=>{var p;l||(l=!0,c&&d?.name==="AbortError"||yat(d)?gi.warn(d):gi.error(d),(p=t.callback)===null||p===void 0||p.call(t,{statusCode:0,error:d}))};let u=0;const h=()=>{O2e-=u,u=0,A&&clearTimeout(A.timeout)};try{const d=sn({method:t?.method||"GET",headers:a,referrerPolicy:"strict-origin",body:r,signal:A?.signal},t.fetchOptions),p=s??(Eo(r)?0:void 0);d.keepalive=d.method==="POST"&&!t.sl&&d.keepalive!==!1&&d.body===r&&!Eo(p)&&p>=0&&52428.8>O2e+p,d.keepalive&&(u=p,O2e+=u),OK(n,d).then(m=>m.text().then(_=>{var f;if(l)return;const I={statusCode:m.status,text:_};if(m.status===200)try{I.json=JSON.parse(_)}catch(C){gi.error(C)}l=!0,h(),(f=t.callback)===null||f===void 0||f.call(t,I,xat(()=>m.headers.get("Retry-After")))})).catch(m=>{h(),g(m)}).finally(h)}catch(d){h(),g(d)}},Y2e=t=>{try{var e;const{url:n,encodedBody:o}=Iat(t),{contentType:i,body:r,estimatedSize:s}=o??{};if(!r)return;const a=r instanceof Blob?r:new Blob([r],{type:i});if(F_.sendBeacon(n,a))return;const A=As(t.data)?t.data:(e=t.data)===null||e===void 0?void 0:e.batch;if(As(A)&&A.length>1&&(s??0)>16384){const c=Math.ceil(A.length/2),l=g=>As(t.data)?g:sn(sn({},t.data),{},{batch:g});return Y2e(sn(sn({},t),{},{data:l(A.slice(0,c))})),void Y2e(sn(sn({},t),{},{data:l(A.slice(c))}))}gi.warn(`Beacon of ~${s??0} bytes was rejected by the browser, falling back to ${OK?"fetch":"XHR"}`),OK?Bat(sn(sn({},t),{},{sl:!0})):Eat(t)}catch(n){gi.warn("Beacon send failed",n)}},bat=(t,e,n,o)=>{const i=o==="query"?e==="POST"?"sent_at":"_":void 0;return hV(n===M3.GZipJS?fat(t,"compression"):t,sn(sn({},i?{[i]:Date.now().toString()}:{}),n===M3.GZipJS?{}:{compression:n}))},$Bn=(()=>{const t=[];return OK&&t.push({transport:"fetch",method:Bat}),bye&&t.push({transport:"XHR",method:Eat}),F_?.sendBeacon&&t.push({transport:"sendBeacon",method:Y2e}),t})();let Sat=!jBn&&dy?.indexOf("MSIE")===-1&&dy?.indexOf("Mozilla")===-1;function Qat(t,e,n){var o,i,r;n&&(e=sn(sn({},e),{},{callback:s=>n(s)})),t.__loaded?Sat?t.__request_queue.push(e):t.rateLimiter.isServerRateLimited(e.batchKey)?e.fireCallbackOnDrop&&((i=e.callback)===null||i===void 0||i.call(e,{statusCode:429})):(e.transport=e.transport||t.config.api_transport,e.headers=sn(sn({},t.config.request_headers),e.headers),e.compression=e.compression==="best-available"?(o=t.compression)!==null&&o!==void 0?o:e.compressionFallback:e.compression,(Eo(t.config.disable_beacon)?t.config.__preview_disable_beacon:t.config.disable_beacon)&&(e.disableTransport=["sendBeacon"]),e.fetchOptions=e.fetchOptions||t.config.fetch_options,((s,a)=>{var A,c,l;const g=sn(sn({},s),{},{callback:a??(m=>{var _;return(_=s.callback)===null||_===void 0?void 0:_.call(s,m)})});g.timeout=g.timeout||6e4;const u=(A=g.transport)!==null&&A!==void 0?A:"fetch";u==="sendBeacon"&&Eo(g.compression)&&g.data&&(g.compression=M3.Base64),g.method==="POST"&&g.data&&(g.timestampMode==="capture-body"?g.data=(m=>{var _,f;const I=(As(m)?m:[m]).map(y=>sn(sn({},y),y.timestamp instanceof Date&&!isNaN(y.timestamp.getTime())?{timestamp:y.timestamp.toISOString()}:{})),C=I[0];return{api_key:(_=C==null||(f=C.properties)===null||f===void 0?void 0:f.token)!==null&&_!==void 0?_:C?.token,batch:I,sent_at:new Date().toISOString()}})(g.data):g.timestampMode==="body"&&(g.data=((m,_=new Date().toISOString())=>As(m)?m.map(f=>sn(sn({},f),{},{sent_at:_})):sn(sn({},m),{},{sent_at:_}))(g.data))),g.url=bat(g.url,g.method,g.compression,g.timestampMode);const h=$Bn.filter(m=>!g.disableTransport||!m.transport||!g.disableTransport.includes(m.transport)),d=(c=(l=(function(m,_){for(let f=0;m.length>f;f++)if(_(m[f]))return m[f]})(h,m=>m.transport===u))===null||l===void 0?void 0:l.method)!==null&&c!==void 0?c:h[0].method;if(!d)throw new Error("No available transport method");const p=m=>{try{d(m)}catch(f){var _;yat(f)?gi.warn(f):gi.error(f),(_=g.callback)===null||_===void 0||_.call(g,{statusCode:0,error:f})}};u!=="sendBeacon"&&!g.preferSyncCompression&&g.data&&g.compression===M3.GZipJS&&Y5n&&typeof Promise<"u"&&!lne?qBn(g).then(m=>{p(m)}).catch(m=>{if(Srt(m))return lne=!0,void p(sn(sn({},g),{},{compression:void 0,url:bat(s.url,s.method,void 0,s.timestampMode)}));(_=>{if(!_||typeof _!="object")return!1;const f="name"in _?String(_.name):"";return Srt(_)||f===Brt})(m)&&(lne=!0),p(g)}):p(g)})(e,(s,a)=>{var A,c,l;t.rateLimiter.checkForLimiting(s),400>s.statusCode||(A=(c=t.config).on_request_error)===null||A===void 0||A.call(c,s),n?n(s,a):(l=e.callback)===null||l===void 0||l.call(e,s)})):e.fireCallbackOnDrop&&((r=e.callback)===null||r===void 0||r.call(e,{statusCode:0}))}var ZBn=class{constructor(e,n){this.rl=!0,this.ol=[],this.al=E9(n?.flush_interval_ms||3e3,250,5e3,gi.createLogger("flush interval"),3e3),this.ll=e}enqueue(e){this.ol.push(e),this.ul||this.hl()}unload(){this.cl();const e=this.ol.length>0?this.dl():{},n=Object.values(e);[...n.filter(o=>o.url.indexOf("/e")===0),...n.filter(o=>o.url.indexOf("/e")!==0)].map(o=>{this.vl(o,"sendBeacon")})}enable(){this.rl=!1,this.hl()}hl(){this.rl||(this.ul=setTimeout(()=>{if(this.cl(),this.ol.length>0){const e=this.dl();for(const n in e)this.vl(e[n])}},this.al))}vl(e,n){try{this.ll(e,n)}catch(o){gi.error(o)}}cl(){clearTimeout(this.ul),this.ul=void 0}dl(){const e={};return vl(this.ol,n=>{var o;const i=n,r=((i?i.batchKey:null)||i.url)+(i.batchGroup?`:${i.batchGroup}`:"");Eo(e[r])&&(e[r]=sn(sn({},i),{},{data:[]})),(o=e[r].data)===null||o===void 0||o.push(i.data)}),this.ol=[],e}};const e9n=["retriesPerformedSoFar"];var t9n=class{constructor(e){this._instance=e,this.fl=!1,this.pl=3e3,this.ol=[],this.ol=[],this.gl=!0,this.resume()}resume(){if(!Eo(Fn)&&"onLine"in Fn.navigator){if(this.gl=Fn.navigator.onLine,this.ml)return;this.ml=()=>{this.gl=!0,this.yl()},this.bl=()=>{this.gl=!1},jc(Fn,"online",this.ml),jc(Fn,"offline",this.bl)}}get length(){return this.ol.length}retriableRequest(e,n){let{retriesPerformedSoFar:o}=e,i=vrt(e,e9n);I8(o)&&(i.url=hV(i.url,{retry_count:o})),Qat(this._instance,n?sn(sn({},i),{},{transport:n}):i,(r,s)=>{var a;if(r.statusCode!==200&&(400>r.statusCode||r.statusCode>=500)){if((r.statusCode===0?3:10)>(o??0))return void this.Ls(sn({retriesPerformedSoFar:o},i),s);r.statusCode===0&&gi.warn(`Request failed before receiving an HTTP response; this can happen due to network issues, CORS, browser blocking, or ad blockers. Stopped retrying after ${o??0} retries.`)}(a=i.callback)===null||a===void 0||a.call(i,r)})}Ls(e,n){const o=e.retriesPerformedSoFar||0;e.retriesPerformedSoFar=o+1;const i=Math.max((function(a){const A=3e3*Math.pow(2,a),c=A/2,l=Math.min(18e5,A),g=(Math.random()-.5)*(l-c);return Math.ceil(l+g)})(o),n??0),r=Date.now()+i;this.ol.push({retryAt:r,requestOptions:e});let s=`Enqueued failed request for retry in ${i}`;navigator.onLine||(s+=" (Browser is offline)"),gi.warn(s),this.fl||(this.fl=!0,this._l())}_l(){if(this.wl&&clearTimeout(this.wl),this.ol.length===0)return this.fl=!1,void(this.wl=void 0);this.wl=setTimeout(()=>{this.gl&&this.ol.length>0&&this.yl(),this._l()},this.pl)}yl(){const e=Date.now(),n=[],o=this.ol.filter(i=>e>i.retryAt||(n.push(i),!1));if(this.ol=n,o.length>0)for(const{requestOptions:i}of o)this.retriableRequest(i)}unload(){this.wl&&(clearTimeout(this.wl),this.wl=void 0),this.fl=!1,Eo(Fn)||(this.ml&&(Fn.removeEventListener("online",this.ml),this.ml=void 0),this.bl&&(Fn.removeEventListener("offline",this.bl),this.bl=void 0));for(const{requestOptions:e}of this.ol)try{this._instance._send_request(sn(sn({},e),{},{transport:"sendBeacon"}))}catch(n){gi.error(n)}this.ol=[]}},n9n=class{constructor(e){this._instance=e,this.kl=()=>{var n,o,i,r;this.Sl||(this.Sl={});const s=this.scrollElement(),a=this.scrollY(),A=s?Math.max(0,s.scrollHeight-s.clientHeight):0,c=a+(s?.clientHeight||0),l=s?.scrollHeight||0;this.Sl.lastScrollY=Math.ceil(a),this.Sl.maxScrollY=Math.max(a,(n=this.Sl.maxScrollY)!==null&&n!==void 0?n:0),this.Sl.maxScrollHeight=Math.max(A,(o=this.Sl.maxScrollHeight)!==null&&o!==void 0?o:0),this.Sl.lastContentY=c,this.Sl.maxContentY=Math.max(c,(i=this.Sl.maxContentY)!==null&&i!==void 0?i:0),this.Sl.maxContentHeight=Math.max(l,(r=this.Sl.maxContentHeight)!==null&&r!==void 0?r:0)}}get xl(){return this._instance.config.scroll_root_selector}getContext(){return this.Sl}resetContext(){const e=this.Sl;return this.Sl=void 0,setTimeout(this.kl,0),e}startMeasuringScrollPosition(){jc(Fn,"scroll",this.kl,{capture:!0}),jc(Fn,"scrollend",this.kl,{capture:!0}),jc(Fn,"resize",this.kl)}scrollElement(){if(this.xl){const o=As(this.xl)?this.xl:[this.xl];for(const i of o){var e;const r=Fn==null||(e=Fn.document)===null||e===void 0?void 0:e.querySelector(i);if(r)return r}return}var n;return Fn==null||(n=Fn.document)===null||n===void 0?void 0:n.documentElement}Cl(e){var n,o;const i=e==="y"?"scrollTop":"scrollLeft";if(this.xl){const r=this.scrollElement();return r&&r[i]||0}return Fn?e==="y"?Fn.scrollY||Fn.pageYOffset||((n=Fn.document)===null||n===void 0||(n=n.documentElement)===null||n===void 0?void 0:n.scrollTop)||0:Fn.scrollX||Fn.pageXOffset||((o=Fn.document)===null||o===void 0||(o=o.documentElement)===null||o===void 0?void 0:o.scrollLeft)||0:0}scrollY(){return this.Cl("y")}scrollX(){return this.Cl("x")}};const o9n=t=>$st(t?.config.mask_personal_data_properties,t?.config.custom_personal_data_properties,t?.config.disable_capture_url_hashes);var vat=class{constructor(e,n,o,i){this.qe=r=>{const s=this.$l();if(s&&s.sessionId===r)return;const a={sessionId:r,props:this.Tl(this._instance)};this.Il.register({[s2e]:a})},this._instance=e,this.Ml=n,this.Il=o,this.Tl=i||o9n,this.Ml.onSessionId(this.qe)}$l(){return this.Il.props[s2e]}getSetOnceProps(){var e;const n=(e=this.$l())===null||e===void 0?void 0:e.props;return n?"r"in n?Zst(n,this._instance.config.disable_capture_url_hashes):{$referring_domain:n.referringDomain,$pathname:n.initialPathName,utm_source:n.utm_source,utm_campaign:n.utm_campaign,utm_medium:n.utm_medium,utm_content:n.utm_content,utm_term:n.utm_term}:{}}getSessionProps(){const e={};return vl(d2e(this.getSetOnceProps()),(n,o)=>{o==="$current_url"&&(o="url"),e[`$session_entry_${Qye(o)}`]=n}),e}},gne=class{on(e,n){return this.El[e]||(this.El[e]=[]),this.El[e].push(n),()=>{this.El[e]=this.El[e].filter(o=>o!==n)}}emit(e,n){for(const o of this.El[e]||[])o(n);for(const o of this.El["*"]||[])o(e,n)}constructor(){this.El={}}};const Hk=Ad("[SessionId]"),wat=864e5;var Pat=class{on(e,n){return this.Pl.on(e,n)}constructor(e,n,o){var i;if(this.Rl=null,this.Al=null,this.Fl=[],this.Ol=void 0,this.Dl=!1,this.Pl=new gne,this.Ll=(s,a)=>!(!I8(s)||!I8(a))&&Math.abs(s-a)>this.sessionTimeoutMs,!e.persistence)throw new Error("SessionIdManager requires a PostHogPersistence instance");if(e.config.cookieless_mode==="always")throw new Error('SessionIdManager cannot be used with cookieless_mode="always"');this.Ir=e.config,this.Il=e.persistence,this.je=void 0,this.Xt=void 0,this._sessionStartTimestamp=null,this.Nl=void 0,this._sessionActivityTimestamp=null,this.ql=n||F4,this.jl=o||F4;const r=this.Ir.persistence_name||this.Ir.token;if(this._sessionTimeoutMs=1e3*E9(this.Ir.session_idle_timeout_seconds||1800,60,36e3,Hk.createLogger("session_idle_timeout_seconds"),1800),e.register({$configured_session_timeout_ms:this._sessionTimeoutMs}),this.Bl(),this.Hl="ph_"+r+"_window_id",this.zl="ph_"+r+"_primary_window_exists",this.Ul()){const s=Z0.Dt(this.Hl),a=Z0.Dt(this.zl);s&&!a?this.je=s:Z0.Lt(this.Hl),Z0.$t(this.zl,!0)}!((i=this.Ir.bootstrap)===null||i===void 0)&&i.sessionID&&this.setBootstrapSessionId(this.Ir.bootstrap.sessionID),this.Wl()}get sessionTimeoutMs(){return this._sessionTimeoutMs}onSessionId(e){return Eo(this.Fl)&&(this.Fl=[]),this.Fl.push(e),this.Xt&&e(this.Xt,this.je),()=>{this.Fl=this.Fl.filter(n=>n!==e)}}Ul(){return this.Ir.persistence!=="memory"&&!this.Il.hi&&Z0.Et()}Vl(e){e!==this.je&&(this.je=e,this.Ul()&&Z0.$t(this.Hl,e))}Gl(){return this.je?this.je:this.Ul()?Z0.Dt(this.Hl):null}Zl(e){const n=this.Rl;return!ad(n)&&!ad(e)&&5e3>Math.abs(e-n)}Ql(e,n,o){const i=n!==this._sessionActivityTimestamp,r=!(e!==this.Xt||o!==this._sessionStartTimestamp);this._sessionStartTimestamp=o,this._sessionActivityTimestamp=n,this.Xt=e,r&&!i||r&&this.Zl(n)||(this.Rl=n,this.Il.register({[Sk]:[n,e,o]}))}Jl(){var e;const n=(e=this.Ir)===null||e===void 0?void 0:e.persistence_save_debounce_ms;return I8(n)&&n>0}Kl(){this.Jl()?this.Il.refreshKey(Sk):(this.Il.flush(),this.Il.load())}Xl(){var e;if(ad(this._sessionActivityTimestamp)||this._sessionActivityTimestamp===this.Rl)return;this.Kl();const[,n,o]=this.Yl();n===this.Xt&&o===this._sessionStartTimestamp&&(this.Rl=this._sessionActivityTimestamp,this.Il.register({[Sk]:[this._sessionActivityTimestamp,(e=this.Xt)!==null&&e!==void 0?e:null,this._sessionStartTimestamp]}),this.Il.flush())}tu(){const[e]=this.Yl(),n=I8(e)?e:0,o=I8(this._sessionActivityTimestamp)?this._sessionActivityTimestamp:0;return Math.max(n,o)}eu(e){return this.Kl(),this.Ll(e,this.tu())}Yl(){const e=this.Il.props[Sk];return As(e)&&e.length===2&&e.push(e[0]),e||[0,null,0]}resetSessionId(){this.Rl=null,this.Nl=void 0,clearTimeout(this.iu),this.iu=void 0,this.Ql(null,null,null)}setBootstrapSessionId(e,n=!1){const o=((i,r=new Date().getTime())=>{try{const s=(a=>{const A=a.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)})(i);return s>r+6e4?void Hk.error("Bootstrap sessionID cannot be in the future"):s}catch(s){return void Hk.error("Invalid sessionID in bootstrap",s)}})(e);return!Eo(o)&&(n?this.Nl={sessionId:e,sessionStartTimestamp:o}:this.Ql(e,new Date().getTime(),o),!0)}destroy(){this.Dl=!0,this.Xl(),clearTimeout(this.iu),this.iu=void 0,this.Ol&&Fn&&(Fn.removeEventListener(ene,this.Ol,{capture:!1}),this.Ol=void 0),this.Fl=[]}Wl(){this.Ol=()=>{this.Xl(),this.Ul()&&Z0.Lt(this.zl)},jc(Fn,ene,this.Ol,{capture:!1})}checkAndGetSessionAndWindowId(e=!1,n=null,o=!1){if(this.Ir.cookieless_mode==="always")throw new Error('checkAndGetSessionAndWindowId should not be called with cookieless_mode="always"');const i=n||new Date().getTime(),r=this.Xt;if(o)this.Al=i;else if(ad(this.Al)||this.Al>i||i-this.Al>=1e3){var s,a;(s=(a=this.Il).syncCookieProperties)===null||s===void 0||s.call(a),this.Al=i}let[,A,c]=this.Yl();const l=!Eo(r)&&A!==r,g=this.tu();let u=this.Gl();const h=this.Nl,d=!!h&&(h.sessionStartTimestamp>i+6e4||i-h.sessionStartTimestamp>wat),p=h?d:I8(c)&&Math.abs(i-c)>wat;let m=!1,_=l,f=!A||!!h;const I=A;let C=!f&&!e&&this.Ll(i,g);if(C&&(C=this.eu(i),C||Hk.info("cross-tab refresh kept the session alive",{sessionId:A}),[,A,c]=this.Yl(),C||(f=!A||!!h)),f||C||p){_=!1;const B=h&&!d;A=B?h.sessionId:this.ql(),u=this.jl(),Hk.info("new session ID assigned",{sessionId:A,windowId:u,bootstrapped:!!B,changeReason:{noSessionId:f,activityTimeout:C,sessionPastMaximumLength:p}}),c=B?h.sessionStartTimestamp:i,this.Nl=void 0,m=!0}else u||(u=this.jl(),m=!0),_=_||A!==I,_&&(Hk.info("adopted cross-tab session id",{sessionId:A,windowId:u}),m=!0);const y=I8(g)&&e&&!p?g:i,x=I8(c)?c:new Date().getTime();this.Vl(u),this.Ql(A,y,x),e||this.Bl();const E={noSessionId:f,activityTimeout:C,sessionPastMaximumLength:p,crossTabAdoption:_};return m&&this.Fl.forEach(B=>B(A,u,E)),{sessionId:A,windowId:u,sessionStartTimestamp:x,changeReason:m?E:void 0,lastActivityTimestamp:g}}Bl(){this.Dl||(clearTimeout(this.iu),this.iu=setTimeout(()=>{if(!this.Dl)if(this.eu(new Date().getTime())){const e=this.Xt;this.resetSessionId(),this.Pl.emit("forcedIdleReset",{idleSessionId:e})}else this.Bl()},1.1*this.sessionTimeoutMs))}};const Mat=function(t,e){if(!t)return!1;const n=t.userAgent;if(n&&vit(n,e))return!0;try{const o=t?.userAgentData;if(o?.brands&&o.brands.some(i=>vit(i?.brand,e)))return!0}catch{}return!!t.webdriver};function Dat(){return(Dat=Wg(function*(){const t=F_?.userAgentData;if(t?.getHighEntropyValues)try{const e=yield t.getHighEntropyValues(["model"]),n=e?.model;return nA(n)&&n.length>0?n:void 0}catch(e){return void gi.info("Unable to resolve $device_model from userAgentData.getHighEntropyValues",e)}})).apply(this,arguments)}function i9n(t,e){let n=`$survey_${e}/${t.id}`;return t.current_iteration&&t.current_iteration>0&&(n=`$survey_${e}/${t.id}/${t.current_iteration}`),n}function Nat(t){var e;return!!(!((e=t.conditions)===null||e===void 0||(e=e.events)===null||e===void 0||(e=e.values)===null||e===void 0)&&e.length)}const une=(t,e)=>{if(!(n=>{try{new RegExp(n)}catch{return!1}return!0})(e))return!1;try{return new RegExp(e).test(t)}catch{return!1}},dne=t=>t.toLowerCase(),Rat={exact:(t,e)=>e.some(n=>t.some(o=>n===o)),is_not:(t,e)=>e.every(n=>t.every(o=>n!==o)),regex:(t,e)=>e.some(n=>t.some(o=>une(n,o))),not_regex:(t,e)=>e.every(n=>t.every(o=>!une(n,o))),icontains:(t,e)=>e.map(dne).some(n=>t.map(dne).some(o=>n.includes(o))),not_icontains:(t,e)=>e.map(dne).every(n=>t.map(dne).every(o=>!n.includes(o))),gt:(t,e)=>e.some(n=>{const o=parseFloat(n);return!isNaN(o)&&t.some(i=>o>parseFloat(i))}),lt:(t,e)=>e.some(n=>{const o=parseFloat(n);return!isNaN(o)&&t.some(i=>o<parseFloat(i))})};function Tat(t,e){return!t||Object.entries(t).every(([n,o])=>{const i=e?.[n];if(i==null)return!1;const r=Rat[o.operator];return!!r&&r(o.values.map(String),[String(i)])})}function U2e(t,e,n){return Nk({distinct_id:t,userPropertiesToSet:e,userPropertiesToSetOnce:n})}const K2e="custom",kat="i.posthog.com",r9n=/^\/static\//,s9n=["/s/","/e/","/i/"];var a9n=class{constructor(e){this.nu={},this.instance=e}get apiHost(){const e=this.instance.config.api_host.trim().replace(/\/$/,"");return e==="https://app.posthog.com"?"https://us.i.posthog.com":e}get flagsApiHost(){const e=this.instance.config.flags_api_host;return e?e.trim().replace(/\/$/,""):this.apiHost}get uiHost(){var e;let n=(e=this.instance.config.ui_host)===null||e===void 0?void 0:e.replace(/\/$/,"");return n||(n=this.apiHost.replace(`.${kat}`,".posthog.com")),n==="https://app.posthog.com"?"https://us.posthog.com":n}get region(){return this.nu[this.apiHost]||(this.nu[this.apiHost]=/https:\/\/(app|us|us-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?"us":/https:\/\/(eu|eu-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?"eu":K2e),this.nu[this.apiHost]}su(e){if(!r9n.test(e))return;const n=this.instance.config.asset_host;return typeof n=="string"&&n.trim().replace(/\/$/,"")||void 0}ru(e){const n=x8(e);return n?n.protocol+"//"+n.host+n.pathname:void 0}ou(e,n,o){if(e==="ui")return o;let i=o;const r=this.instance.config.rewriteRequestPath;if(r){var s;const a=((s=x8(o))===null||s===void 0?void 0:s.href)||o;i=r(new URL(a)).toString()}if(r&&e==="api"&&s9n.some(a=>n.indexOf(a)===0)){const a=this.ru(i);if(a){const A=this.apiHost;let c=this.au;c?.apiHost===A&&c.rewriteRequestPath===r||(c={apiHost:A,rewriteRequestPath:r,urls:new Set},this.au=c),c.urls.add(a)}}return i}isIngestionEndpoint(e){const n=this.au,o=this.ru(e);return n?.apiHost===this.apiHost&&n.rewriteRequestPath===this.instance.config.rewriteRequestPath&&!!o&&n.urls.has(o)}endpointFor(e,n=""){if(n&&(n=n[0]==="/"?n:`/${n}`),e==="ui")return this.ou(e,n,this.uiHost+n);if(e==="flags")return this.ou(e,n,this.flagsApiHost+n);if(e==="assets"){const i=this.su(n);if(i)return this.ou(e,n,`${i}${n}`)}if(this.region===K2e)return this.ou(e,n,this.apiHost+n);const o=kat+n;switch(e){case"assets":return this.ou(e,n,`https://${this.region}-assets.${o}`);case"api":return this.ou(e,n,`https://${this.region}.${o}`)}}};const _l=Ad("[Surveys]"),Fat=t=>{try{const e=(n=>((o,i)=>`seenSurvey_${(function(r){return r.current_iteration&&r.current_iteration>0?`${r.id}_${r.current_iteration}`:r.id})(i)}`)(0,n))(t);if(localStorage.getItem(e))return;localStorage.setItem(e,"true")}catch(e){_l.error("Failed to persist survey seen state",e)}},A9n=[P2e.Popover,P2e.Widget,P2e.API],c9n={ignoreConditions:!1,ignoreDelay:!1,displayType:D2e.Popover},l9n=Ad("[PostHog ExternalIntegrations]"),g9n={intercom:"intercom-integration",crispChat:"crisp-chat-integration"};var u9n=class{constructor(e){this._instance=e}Ho(e,n){var o,i;(o=Ur.__PosthogExtensions__)===null||o===void 0||(i=o.loadExternalDependency)===null||i===void 0||i.call(o,this._instance,e,r=>{if(r)return l9n.error("failed to load script",r);n()})}startIfEnabledOrStop(){var e;for(const[r,s]of Object.entries((e=this._instance.config.integrations)!==null&&e!==void 0?e:{})){var n,o,i;s&&!(!((n=Ur.__PosthogExtensions__)===null||n===void 0||(n=n.integrations)===null||n===void 0)&&n[r])&&this.Ho(g9n[r],()=>{var a;(a=Ur.__PosthogExtensions__)===null||a===void 0||(a=a.integrations)===null||a===void 0||(a=a[r])===null||a===void 0||a.start(this._instance)}),!s&&(!((o=Ur.__PosthogExtensions__)===null||o===void 0||(o=o.integrations)===null||o===void 0)&&o[r])&&((i=Ur.__PosthogExtensions__)===null||i===void 0||(i=i.integrations)===null||i===void 0||(i=i[r])===null||i===void 0||i.stop())}}},d9n=class{constructor(e,n){this.A=e,this.bo=n,this.lu=new Map,this.To=!1}add(e){var n=this;return Wg(function*(){if(n.To)throw new Error("Cannot add an extension to a disposed ExtensionRuntime");if(n.lu.has(e.name))throw new Error(`Browser extension "${e.name}" is already registered`);n.lu.set(e.name,e);try{const o=e.setup(n.bo);o&&(yield o)}catch(o){const i=n.lu.get(e.name)===e;i&&n.lu.delete(e.name),n.A.error(`Failed to set up browser extension "${e.name}"`,o),i&&n.uu(e)}})()}getExtension(e){return this.lu.get(e)}dispose(){if(this.To)return;this.To=!0;const e=Array.from(this.lu.values()).reverse();this.lu.clear();for(const n of e)this.uu(n)}uu(e){try{var n;const o=(n=e.dispose)===null||n===void 0?void 0:n.call(e);o&&L_(o.then)&&o.then(void 0,i=>{this.A.error(`Failed to dispose browser extension "${e.name}"`,i)})}catch(o){this.A.error(`Failed to dispose browser extension "${e.name}"`,o)}}},h9n=class{constructor(e){this._instance=e}initialize(){}get(e){const n=this._instance.persistence;if(typeof e=="string")return n?.get_property(e);const o={};for(const i of e){const r=n?.get_property(i);Eo(r)||(o[i]=r)}return o}set(e,n){var o;(o=this._instance.persistence)===null||o===void 0||o.register(typeof e=="string"?{[e]:n}:e)}remove(e){var n;(n=this._instance.persistence)===null||n===void 0||n.unregister(e)}};const Lat="extensionsRemoteConfig";var p9n=class{constructor(e){this.instance=e,this.To=!1,this.A=gi,this.hu=e.cu,this.kv=new h9n(e),this.onEvent=n=>Ane(this.instance.on("eventCaptured",o=>{try{n({event:o.event,properties:o.properties})}catch(i){this.A.error("Browser extension event listener failed",i)}})),this.onRemoteConfig=n=>{if(this.To)return Ane(()=>{});const o=r=>{try{n(r)}catch(s){this.A.error("Browser extension remote config listener failed",s)}},i=this.instance.du.on(Lat,o);return this.hu&&o(this.hu),Ane(i)},this.vu=new d9n(gi.createLogger("[BrowserExtensions]"),this)}get logger(){return this.A}get distinctId(){return this.instance.get_distinct_id()}get anonymousId(){var e;return(e=this.instance.get_property("$device_id"))!==null&&e!==void 0?e:this.distinctId}get deviceId(){const e=this.instance.get_property(jye);return typeof e=="string"?e:void 0}get library(){return{name:Ym.LIB_NAME,version:Ym.LIB_VERSION}}get initialPersonProperties(){var e,n;return(e=(n=this.instance.persistence)===null||n===void 0?void 0:n.get_initial_props())!==null&&e!==void 0?e:{}}get groups(){return this.instance.getGroups()}get session(){try{var e,n,o,i;const r=(e=this.instance.sessionManager)===null||e===void 0?void 0:e.checkAndGetSessionAndWindowId(!0);return{sessionId:(n=r?.sessionId)!==null&&n!==void 0?n:"",windowId:(o=r?.windowId)!==null&&o!==void 0?o:"",sessionStartTimestamp:(i=r?.sessionStartTimestamp)!==null&&i!==void 0?i:0}}catch{return{sessionId:"",windowId:"",sessionStartTimestamp:0}}}get canCapture(){return this.instance.is_capturing()}get projectToken(){return this.instance.config.token}add(e){return this.vu.add(e)}getExtension(e){return this.vu.getExtension(e)}capture(e,n,o){o?this.instance.capture(e,n,{timestamp:o.timestamp,uuid:o.uuid,$set:o.set,$set_once:o.setOnce}):this.instance.capture(e,n)}registerDynamicEventProperties(e){return Ane(this.instance.fu(e))}handleRemoteConfig(e){this.To||(this.hu=e,this.instance.du.emit(Lat,e))}sendRequest(e){var n=this;return Wg(function*(o,i={}){var r;const s=n.instance.requestRouter.endpointFor((r=i.target)!==null&&r!==void 0?r:"api",o),a={method:i.method,url:i.query?hV(s,i.query):s,data:i.body,headers:i.headers,timeout:i.timeoutMs,fireCallbackOnDrop:!0,transport:i.transport,compression:i.compression,compressionFallback:i.target==="flags"&&i.compression==="best-available"?Sye.Base64:void 0,timestampMode:i.sentAt};return i.transport==="sendBeacon"?(n.instance._send_request(a),{statusCode:202}):new Promise(A=>{a.callback=A,n.instance._send_request(a)})}).apply(this,arguments)}dispose(){this.To||(this.To=!0,this.vu.dispose())}};const pV={};let V2e=0;const mV=()=>{},Hat='Consent opt in/out is not valid with cookieless_mode="always" and will be ignored',Ok="Surveys module not available",Oat="sanitize_properties is deprecated. Use before_send instead",Gat="Invalid value for property_denylist config: ",m9n=["$recording_status","$sdk_debug_recording_script_not_loaded","$sdk_debug_replay_url_trigger_status","$sdk_debug_replay_event_trigger_status","$sdk_debug_replay_linked_flag_trigger_status","$sdk_debug_replay_rrweb_error","$sdk_debug_replay_internal_buffer_length","$sdk_debug_replay_flushed_size"],_9n=["$feature_flag_called","$$heatmap","$snapshot"],Yat=t=>t.charAt(0)==="$"&&!as(_9n,t),f9n=/^[A-Za-z0-9_-]{1,400}$/,Uat=/^fb\.[0-9]+\.[0-9]+\.[A-Za-z0-9_-]+(?:\.[A-Za-z0-9_-]+)?$/,Kat=/^fb\.[0-9]+\.[0-9]+\.[0-9]+$/,I9n=["token","distinct_id",nst],_V="posthog",C9n=t=>{const e={};return t&&t!=="unset"&&("2025-11-30">t||(e.strictMinimumDuration=!0),"2026-05-30">t||(e.canvasCapture={resolutionScale:.6}),"2026-06-25">t||(e.streamNetworkBody=!0),"2026-08-30">t||(e.captureJsonLd=!0)),e},z2e=t=>{var e;return sn({api_host:"https://us.i.posthog.com",flags_api_host:null,ui_host:null,asset_host:null,token:"",autocapture:!0,cross_subdomain_cookie:_Bn(No?.location),persistence:"localStorage+cookie",persistence_name:"",cookie_persisted_properties:[],loaded:mV,save_campaign_params:!0,custom_campaign_params:[],custom_blocked_useragents:[],save_referrer:!0,capture_pageleave:"if_capture_pageview",defaults:t??"unset",__preview_deferred_init_extensions:!1,__preview_external_dependency_versioned_paths:!1,__preview_cookie_wins_on_conflict:!1,debug:sd&&nA(sd?.search)&&sd.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_conversations:!1,disable_product_tours:!1,disableDeviceModel:!1,reuseAnonymousId:!1,disable_external_dependency_loading:!1,strict_script_versioning:"fallback",enable_recording_console_log:void 0,secure_cookie:(Fn==null||(e=Fn.location)===null||e===void 0?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",consent_persistence_name:null,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,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_feature_flags_dedup_per_session:!1,advanced_enable_surveys:!1,advanced_disable_toolbar_metrics:!1,feature_flag_request_timeout_ms:3e3,feature_flag_request_max_retries:1,surveys_request_timeout_ms:1e4,on_request_error(n){gi.error("Bad HTTP status: "+n.statusCode+" "+n.text)},get_device_id:n=>n,capture_performance:void 0,name:"posthog",bootstrap:{},disable_compression:!1,session_idle_timeout_seconds:1800,person_profiles:ust,before_send:void 0,get_current_url:void 0,request_queue_config:{flush_interval_ms:3e3},error_tracking:{},_onCapture:mV},(n=>({rageclick:n&&n>="2026-05-30"?{content_ignorelist:bBn,ignore_text_selection:!0}:!n||"2025-11-30">n||{content_ignorelist:!0},capture_pageview:!n||"2025-05-24">n||"history_change",session_recording:C9n(n),external_scripts_inject_target:n&&n>="2026-01-30"?"head":"body",internal_or_test_user_hostname:n&&n>="2026-01-30"?/^(localhost|127\.0\.0\.1)$/:void 0,persistence_save_debounce_ms:n&&n>="2026-05-30"?250:0,split_storage:!(!n||"2026-05-30">n),detect_google_search_app:!(!n||"2026-05-30">n),disable_capture_url_hashes:!(!n||"2026-06-25">n),cookieWinsOnConflict:!(!n||n==="unset"||"2026-08-29">n)}))(t))},y9n=[["process_person","person_profiles"],["xhr_headers","request_headers"],["cookie_name","persistence_name"],["disable_cookie","disable_persistence"],["__preview_disable_beacon","disable_beacon"],["store_google","save_campaign_params"],["verbose","debug"],["__preview_cookie_wins_on_conflict","cookieWinsOnConflict"]],Vat=t=>{const e={};for(const[i,r]of y9n)Eo(t[i])||(e[r]=t[i]);const n=jg({},e,t),o=t.__preview_external_dependency_versioned_paths;return Eo(o)||(Eo(t.strict_script_versioning)&&(n.strict_script_versioning=!!o),nA(o)&&Eo(t.asset_host)&&(n.asset_host=o)),As(t.property_blacklist)&&(Eo(t.property_denylist)?n.property_denylist=t.property_blacklist:As(t.property_denylist)?n.property_denylist=[...t.property_blacklist,...t.property_denylist]:gi.error(Gat+t.property_denylist)),n};var x9n=class{constructor(){this.__forceAllowLocalhost=!1}get pu(){return this.__forceAllowLocalhost}set pu(e){gi.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=e}},fV=class EM{gu(e){if(!e)return;const n=this.lu.indexOf(e);n!==-1&&this.lu.splice(n,1)}mu(e,n){var o;return this.gu(e),this.lu.push(n),(o=n.initialize)===null||o===void 0||o.call(n),n}yu(){return this.config.cookieless_mode==="always"||this.config.cookieless_mode==="on_reject"&&this.consent.isRejected()}bu(){if(this._u||this.config.reuseAnonymousId||this.config.segment||this.yu())return;const e=this.config.persistence==="memory"||this.config.persistence==="sessionStorage";if(!e&&!this.config.disable_persistence||this.wu)return;let n,o,i;e?(n=`persistence is set to '${this.config.persistence}'`,o=this.config.persistence==="memory"?"on every page load":"for every new browser tab or window",i="Either set persistence to 'localStorage+cookie', keep this persistence and pass a stable ID through bootstrap.distinctID, or enable reuseAnonymousId."):(n="persistence is disabled (disable_persistence is true)",o="on every page load",i="Either set disable_persistence to false, keep persistence disabled and pass a stable ID through bootstrap.distinctID, or enable reuseAnonymousId."),this._u=!0,console.warn("[PostHog.js]",`${n} but no bootstrap.distinctID was provided. PostHog will mint a new distinct ID ${o}, so calling identify() merges a new ID onto the person each time. A person can then pass the distinct-ID limit and its events stop appearing on person pages and the session tab. ${i}`)}ku(){if(this.yu()||this.get_distinct_id()!=="$posthog_cookieless")return;const e=this.persistence;if(!e)return;this.Su()||e.load(!0);const n=this.get_distinct_id();if(!n||n==="$posthog_cookieless"){const o=this.config.get_device_id(F4());this.register({distinct_id:o,$device_id:o}),e.set_property(py,y8)}this.xu()}get decideEndpointWasHit(){var e,n;return(e=(n=this.featureFlags)===null||n===void 0?void 0:n.hasLoadedFlags)!==null&&e!==void 0&&e}get flagsEndpointWasHit(){var e,n;return(e=(n=this.featureFlags)===null||n===void 0?void 0:n.hasLoadedFlags)!==null&&e!==void 0&&e}constructor(){var e;this.Cu=!1,this.$u=!1,this.webPerformance=new x9n,this.Tu=!1,this.version=Ym.LIB_VERSION,this.Iu=new Set,this.Mu="",this.du=new gne,this.lu=[],this.Eu=[],this.Pu=!1,this.wu=!1,this._u=!1,this._calculate_event_properties=this.calculateEventProperties.bind(this),this.config=z2e(),this.SentryIntegration=NBn,this.sentryIntegration=o=>(function(i,r){const s=Ust(i,r);return{name:Yst,processEvent:a=>s(a)}})(this,o),this.__request_queue=[],this.__loaded=!1,this.analyticsDefaultEndpoint="/e/",this.Ru=!1,this.Au=null,this.Fu=null,this.Ou=null,this.scrollManager=new n9n(this),this.pageViewManager=new Kst(this),this.rateLimiter=new UBn(this),this.requestRouter=new a9n(this),this.consent=new BBn(this),this.externalIntegrations=new u9n(this);const n=(e=EM.__defaultExtensionClasses)!==null&&e!==void 0?e:{};this.featureFlags=n.featureFlags&&new n.featureFlags(this),this.toolbar=n.toolbar&&new n.toolbar(this),this.surveys=n.surveys&&new n.surveys(this),this.conversations=n.conversations&&new n.conversations(this),this.logs=n.logs&&new n.logs(this),this.metrics=n.metrics&&new n.metrics(this),this.experiments=n.experiments&&new n.experiments(this),this.exceptions=n.exceptions&&new n.exceptions(this),this.people={set:(o,i,r)=>{const s=nA(o)?{[o]:i}:o;this.setPersonProperties(s),r?.({})},set_once:(o,i,r)=>{const s=nA(o)?{[o]:i}:o;this.setPersonProperties(void 0,s),r?.({})}},this.on("eventCaptured",o=>gi.info(`send "${o?.event}"`,o))}init(e,n,o){if(o&&o!==_V){var i;const r=(i=pV[o])!==null&&i!==void 0?i:new EM;return r._init(e,n,o),pV[o]=r,pV[_V][o]=r,r}return this._init(e,n,o)}_init(e,n={},o){var i,r,s;const a=nA(e)?e.trim():"";if(!a)return gi.critical("PostHog was initialized without a token. This likely indicates a misconfiguration. Please check the first argument passed to posthog.init()"),this;var A;if(this.__loaded)return a!==((A=this.config)===null||A===void 0?void 0:A.token)?console.warn("[PostHog.js]",`You have already initialized PostHog with a different project token! Re-initializing is a no-op, so events will keep going to the project this instance was initialized with. To capture into a second project, load PostHog once, then initialize a named instance after the SDK has loaded, e.g. posthog.init('${a}', { ... }, 'project2')`):console.warn("[PostHog.js]","You have already initialized PostHog! Re-initializing is a no-op"),this;this.__loaded=!0,this.config=z2e(n.defaults),n.debug=this.Du(n.debug),this.Lu=n,this.Nu=[],n.person_profiles?this.Fu=n.person_profiles:n.process_person&&(this.Fu=n.process_person);const c=z2e(n.defaults),l=Vat(n),g=jg({},c,l,{name:o,token:a});xA(c.rageclick)&&xA(l.rageclick)&&(g.rageclick=jg({},c.rageclick,l.rageclick)),xA(c.session_recording)&&xA(l.session_recording)&&(g.session_recording=jg({},c.session_recording,l.session_recording)),this.set_config(g),this.config.on_xhr_error&&gi.error("on_xhr_error is deprecated. Use on_request_error instead"),this.compression=n.disable_compression?void 0:M3.GZipJS;const u=this.Su();if(this.persistence=new w2e(this.config,u),this.sessionPersistence=this.config.persistence==="sessionStorage"||this.config.persistence==="memory"?this.persistence:new w2e(sn(sn({},this.config),{},{persistence:"sessionStorage"}),u,!1),this.Mu="ph_"+(this.config.persistence_name||this.config.token)+"_session_registered_properties",this.config.persistence!=="memory"&&!u&&Z0.Et()){const _=Z0.Dt(this.Mu);As(_)&&_.forEach(f=>{nA(f)&&this.Iu.add(f)})}else Z0.Lt(this.Mu);const h=sn({},this.persistence.props),d=sn({},this.sessionPersistence.props);this.register({$initialization_time:new Date().toISOString()}),this.qu=new ZBn((_,f)=>this.ju(_,f),this.config.request_queue_config),this.Bu=new t9n(this),this.__request_queue=[];const p=this.yu();p||(this.sessionManager=new Pat(this),this.sessionPropsManager=new vat(this,this.sessionManager,this.persistence),this.sessionManager.onSessionId((_,f,I)=>{(I?.activityTimeout||I?.sessionPastMaximumLength||I?.crossTabAdoption)&&this.Hu()})),this.zu(),this.config.__preview_deferred_init_extensions?(gi.info("Deferring extension initialization to improve startup performance"),setTimeout(()=>{this.Uu(p)},0)):(gi.info("Initializing extensions synchronously"),this.Uu(p)),Ym.DEBUG=Ym.DEBUG||this.config.debug,Ym.DEBUG&&gi.info("Starting in debug mode",{this:this,config:n,thisC:sn({},this.config),p:h,s:d}),this.config.identity_distinct_id&&!(!((i=n.bootstrap)===null||i===void 0)&&i.distinctID)&&(n.bootstrap=sn(sn({},n.bootstrap),{},{distinctID:this.config.identity_distinct_id,isIdentifiedID:!0}));const m=(r=n.bootstrap)===null||r===void 0?void 0:r.distinctID;if(this.wu=!!m&&!YK(m),(s=n.bootstrap)===null||s===void 0?void 0:s.distinctID){const _=n.bootstrap.distinctID,f=this.get_distinct_id(),I=this.persistence.get_property(py);if(n.bootstrap.isIdentifiedID&&f!=null&&f!==_&&I==="anonymous")this.identify(_);else if(n.bootstrap.isIdentifiedID&&f!=null&&f!==_&&I==="identified")gi.warn("Bootstrap distinctID differs from an already-identified user. The existing identity is preserved. Call reset() before reinitializing if you intend to switch users.");else{const C=this.config.get_device_id(F4()),y=n.bootstrap.isIdentifiedID?C:_;this.persistence.set_property(py,n.bootstrap.isIdentifiedID?Zte:y8),this.register({distinct_id:_,$device_id:y})}}if(p)this.register_once({distinct_id:A2e,$device_id:null},"");else if(!this.get_distinct_id()){const _=this.config.get_device_id(F4());this.register_once({distinct_id:_,$device_id:_},""),this.persistence.set_property(py,y8)}return jc(Fn,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this),{passive:!1}),jc(Fn,"pageshow",()=>{var _;this.Cu=!1,this.$u||(_=this.Bu)===null||_===void 0||_.resume()}),n.segment?Gst(this,()=>this.Wu()):this.Wu(),L_(this.config._onCapture)&&this.config._onCapture!==mV&&(gi.warn("onCapture is deprecated. Please use `before_send` instead"),this.on("eventCaptured",_=>this.config._onCapture(_.event,_))),this.config.ip&&gi.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.config.disableDeviceModel||(function(){return Dat.apply(this,arguments)})().then(_=>{_&&this.register({[qye]:_})}).catch(mV),this}Vu(e){const n=e;return nA(n.name)&&L_(n.setup)}Gu(e,n){this.Vu(e)?n.push(()=>{this.Zu().add(e).catch(()=>{var o;return(o=e.dispose)===null||o===void 0?void 0:o.call(e)}).catch(o=>{gi.error(`Failed to dispose browser extension "${e.name}"`,o)})}):this.lu.push(e)}zu(){var e,n,o;const i=(e=(n=this.config.__extensionClasses)===null||n===void 0?void 0:n.featureFlags)!==null&&e!==void 0?e:(o=EM.__defaultExtensionClasses)===null||o===void 0?void 0:o.featureFlags;var r,s,a;i&&(this.featureFlags&&this.featureFlags instanceof i||((r=this.Qu)===null||r===void 0||r.call(this),this.Qu=void 0,this.featureFlags=new i(this)),L_(this.featureFlags.onReloading)&&L_(this.featureFlags.setup)?this.Qu||(this.Qu=this.featureFlags.onReloading(()=>{this.du.emit("featureFlagsReloading",!0)}),this.Zu().add(this.featureFlags)):(s=(a=this.featureFlags).initialize)===null||s===void 0||s.call(a))}Uu(e){const n=performance.now(),o=sn(sn({},EM.__defaultExtensionClasses),this.config.__extensionClasses),i=[];var r,s,a,A,c,l,g;o.exceptions&&this.lu.push(this.exceptions=(r=this.exceptions)!==null&&r!==void 0?r:new o.exceptions(this)),o.historyAutocapture&&this.lu.push(this.historyAutocapture=new o.historyAutocapture(this)),o.tracingHeaders&&this.lu.push(this.tracingHeaders=new o.tracingHeaders(this)),o.siteApps&&this.lu.push(this.siteApps=new o.siteApps(this)),o.sessionRecording&&!e&&this.lu.push(this.sessionRecording=new o.sessionRecording(this)),this.config.disable_scroll_properties||i.push(()=>{this.scrollManager.startMeasuringScrollPosition()}),o.autocapture&&this.Gu(this.autocapture=new o.autocapture(this),i),o.surveys&&this.Gu(this.surveys=(s=this.surveys)!==null&&s!==void 0?s:new o.surveys(this),i),o.logs&&this.Gu(this.logs=(a=this.logs)!==null&&a!==void 0?a:new o.logs(this),i),o.metrics&&this.lu.push(this.metrics=(A=this.metrics)!==null&&A!==void 0?A:new o.metrics(this)),o.conversations&&this.lu.push(this.conversations=(c=this.conversations)!==null&&c!==void 0?c:new o.conversations(this)),o.productTours&&this.lu.push(this.productTours=new o.productTours(this)),o.heatmaps&&this.lu.push(this.heatmaps=new o.heatmaps(this)),o.webVitalsAutocapture&&this.lu.push(this.webVitalsAutocapture=new o.webVitalsAutocapture(this)),o.exceptionObserver&&this.lu.push(this.exceptionObserver=new o.exceptionObserver(this)),o.deadClicksAutocapture&&this.lu.push(this.deadClicksAutocapture=new o.deadClicksAutocapture(this,DBn)),o.toolbar&&this.lu.push(this.toolbar=(l=this.toolbar)!==null&&l!==void 0?l:new o.toolbar(this)),o.experiments&&this.lu.push(this.experiments=(g=this.experiments)!==null&&g!==void 0?g:new o.experiments(this)),this.lu.forEach(u=>{u.initialize&&i.push(()=>{var h;(h=u.initialize)===null||h===void 0||h.call(u)})}),i.push(()=>{if(this.Ju){const u=this.Ju;this.Ju=void 0,this.lu.forEach(h=>{var d;return(d=h.onRemoteConfig)===null||d===void 0?void 0:d.call(h,u)})}}),this.Ku(i,n)}Ku(e,n){for(;e.length>0;){if(this.config.__preview_deferred_init_extensions&&performance.now()-n>=30&&e.length>0)return void setTimeout(()=>{this.Ku(e,n)},0);const i=e.shift();if(i)try{i()}catch(r){gi.error("Error initializing extension:",r)}}const o=Math.round(performance.now()-n);this.register_for_session({[ost]:this.config.__preview_deferred_init_extensions?"deferred":"synchronous",[ist]:o}),this.config.__preview_deferred_init_extensions&&gi.info(`PostHog extensions initialized (${o}ms)`)}el(e){var n;if(!No||!No.body)return gi.info("document not ready yet, trying again in 500 milliseconds..."),void setTimeout(()=>{this.el(e)},500);if(this.config.__preview_deferred_init_extensions&&(this.Ju=e),this.cu=e,this.compression=void 0,e.ok){var o;const i=e.config;i.supportedCompression&&!this.config.disable_compression&&(this.compression=as(i.supportedCompression,M3.GZipJS)?M3.GZipJS:as(i.supportedCompression,M3.Base64)?M3.Base64:void 0),!((o=i.analytics)===null||o===void 0)&&o.endpoint&&(this.analyticsDefaultEndpoint=i.analytics.endpoint)}this.set_config({person_profiles:this.Fu?this.Fu:ust}),(n=this.Xu)===null||n===void 0||n.handleRemoteConfig(e),this.lu.forEach(i=>{var r;return(r=i.onRemoteConfig)===null||r===void 0?void 0:r.call(i,e)})}Wu(){try{this.config.loaded(this)}catch(e){gi.critical("`loaded` function failed",e)}if(this.Yu(),this.config.internal_or_test_user_hostname&&sd?.hostname){const e=sd.hostname,n=this.config.internal_or_test_user_hostname;(typeof n=="string"?e===n:n.test(e))&&this.setInternalOrTestUser()}this.config.capture_pageview&&setTimeout(()=>{(this.consent.isOptedIn()||this.yu())&&this.th()},1),this.eh=new sat(this),this.eh.load()}Yu(){var e;this.is_capturing()&&this.config.request_batching&&((e=this.qu)===null||e===void 0||e.enable())}_dom_loaded(){this.is_capturing()&&vk(this.__request_queue,e=>this.ju(e)),this.__request_queue=[],this.Yu()}_handle_unload(){var e,n,o,i,r,s;this.Cu=!0,(e=this.surveys)===null||e===void 0||(n=e.handlePageUnload)===null||n===void 0||n.call(e),(o=this.metrics)===null||o===void 0||o.flush("sendBeacon"),this.config.request_batching?(this.ih()&&this.capture(dst),(i=this.logs)===null||i===void 0||i.flushLogs("sendBeacon"),(r=this.qu)===null||r===void 0||r.unload(),(s=this.Bu)===null||s===void 0||s.unload()):this.ih()&&this.capture(dst,null,{transport:"sendBeacon"})}_send_request(e){Qat(this,e)}ju(e,n){this.Bu?this.Bu.retriableRequest(e,n):this._send_request(n?sn(sn({},e),{},{transport:n}):e)}_execute_array(e){V2e++;try{let n;const o=[],i=[],r=[];vk(e,a=>{if(a)if(n=a[0],As(n))r.push(a);else if(L_(a))try{a.call(this)}catch(A){gi.error("Error executing queued PostHog call",a,A)}else As(a)&&n==="alias"?o.push(a):As(a)&&n.indexOf("capture")!==-1&&L_(this[n])?r.push(a):i.push(a)});const s=function(a,A){vk(a,function(c){try{if(As(c[0])){let l=A;vl(c,function(g){l=l[g[0]].apply(l,g.slice(1))})}else A[c[0]].apply(A,c.slice(1))}catch(l){gi.error("Error executing queued PostHog call",c,l)}})};s(o,this),s(i,this),s(r,this)}finally{V2e--}}push(e){if(V2e>0&&As(e)&&nA(e[0])){const n=EM.prototype[e[0]];return void(L_(n)&&n.apply(this,e.slice(1)))}this._execute_array([e])}get nh(){return{property:Urt,persistenceKey:bk,cookieName:"_fbc",pattern:Uat,register:(e,n)=>{var o;return(o=this.persistence)===null||o===void 0?void 0:o.register({[bk]:{value:e,delivered:n}})},unregister:()=>{var e;return(e=this.persistence)===null||e===void 0?void 0:e.unregister(bk)}}}get sh(){return{property:Krt,persistenceKey:JK,cookieName:"_fbp",pattern:Kat,register:(e,n)=>{var o;return(o=this.persistence)===null||o===void 0?void 0:o.register({[JK]:{value:e,delivered:n}})},unregister:()=>{var e;return(e=this.persistence)===null||e===void 0?void 0:e.unregister(JK)}}}rh(e){var n;const o=(n=this.persistence)===null||n===void 0?void 0:n.get_property(e.persistenceKey);return nA(o)&&e.pattern.test(o)?{value:o,delivered:!1}:xA(o)&&nA(o.value)&&e.pattern.test(o.value)?{value:o.value,delivered:o.delivered===!0}:void 0}oh(e,n,o){return n===o?.value?{value:n,pending:!o.delivered}:(e.register(n,!1),{value:n,pending:!0})}ah(e){if(!this.config.save_campaign_params||this.yu())return;const n=eV(e.cookieName);return nA(n)&&e.pattern.test(n)?n:void 0}uh(e,n,o,i){if(!this.persistence)return;const r=this.nh;this.persistence.refreshKey(r.persistenceKey);const s=this.rh(r);if(i)return void r.unregister();if(o)return nA(n)&&Uat.test(n)?this.oh(r,n,s):void r.unregister();const a=nA(e)&&f9n.test(e)?e:void 0,A=this.ah(r);return A&&((c,l,g)=>{const u=c.split(".");if(l)return u[3]===l;if(!g)return!0;const h=g.value.split(".");return u[3]===h[3]||Number(u[2])>Number(h[2])})(A,a,s)?this.oh(r,A,s):a?s?.value.split(".")[3]===a?{value:s.value,pending:!s.delivered}:this.oh(r,`fb.1.${Date.now()}.${a}`,s):s?{value:s.value,pending:!s.delivered}:void 0}hh(e,n,o){if(!this.persistence)return;const i=this.sh;this.persistence.refreshKey(i.persistenceKey);const r=this.rh(i);if(o)return void i.unregister();if(n)return nA(e)&&Kat.test(e)?this.oh(i,e,r):void i.unregister();const s=this.ah(i);return s?this.oh(i,s,r):r?{value:r.value,pending:!r.delivered}:void 0}dh(e,n){if(!this.persistence)return;this.persistence.refreshKey(e.persistenceKey);const o=this.rh(e);o?.value!==n||o.delivered||e.register(n,!0)}capture(e,n,o){var i,r;if(!(this.__loaded&&this.persistence&&this.sessionPersistence&&this.qu))return void gi.uninitializedWarning("posthog.capture");if(!this.is_capturing())return;if(Eo(e)||!nA(e))return void gi.error("No event name provided to posthog.capture");this.ku();const s=!this.config.opt_out_useragent_filter&&this._is_bot();if(s&&!this.config.__preview_capture_bot_pageviews)return;const a=o?.skip_client_rate_limiting?void 0:this.rateLimiter.clientRateLimitContext();if(a?.isRateLimited)return void gi.critical("This capture call is ignored due to client rate limiting.");let A;n?.$current_url&&!nA(n?.$current_url)&&(gi.error("Invalid `$current_url` property provided to `posthog.capture`. Input must be a string. Ignoring provided value."),n==null||delete n.$current_url),e!=="$exception"||o?.fh||gi.warn("Using `posthog.capture('$exception')` is unreliable because it does not attach required metadata. Use `posthog.captureException(error)` instead, which attaches required metadata automatically."),this.sessionPersistence.update_search_keyword(),this.config.save_campaign_params&&(A=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();const c=new Date,l=o?.timestamp||c,g=Art(o?.uuid,F4);let u={uuid:g,event:e,properties:this.calculateEventProperties(e,n||{},l,g)};e==="$pageview"&&this.config.__preview_capture_bot_pageviews&&s&&(u.event="$bot_pageview",u.properties.$browser_type="bot"),a&&(u.properties.$lib_rate_limit_remaining_tokens=a.remainingTokens);const h=e==="$feature_flag_called"&&u.properties.$feature_flag_has_experiment===!1&&this.get_property("$minimal_flag_called_events")===!0;o?.$set&&!h&&(u.$set=o?.$set);const d=xA(n?.$set)?n.$set:void 0,p=As(n?.$unset)?n.$unset:[],m=o?.$unset||[],_=R=>{var F;const O=!!o?.$set&&R in o.$set;return{hasProvided:O||!!d&&R in d,provided:O?o==null||(F=o.$set)===null||F===void 0?void 0:F[R]:d?.[R],unset:p.indexOf(R)!==-1||m.indexOf(R)!==-1}},f=_(Urt),I=_(Krt),C=[{channel:this.nh,hasProvided:f.hasProvided,update:this.uh(A?.fbclid,f.provided,f.hasProvided,f.unset)},{channel:this.sh,hasProvided:I.hasProvided,update:this.hh(I.provided,I.hasProvided,I.unset)}];for(const{channel:R,hasProvided:F,update:O}of C)O&&u.properties.$process_person_profile===!0&&O.pending&&!F&&!h&&(u.$set=sn({[R.property]:O.value},u.$set));const y=o?.$unset;y&&(u.$unset=y);const x=h?void 0:this.ph(o?.$set_once,e!==pst,e===hst);if(x&&(u.$set_once=x),o?._noTruncate||(E=this.config.properties_string_max_length,u=(function(R,F){const O=new Set;return(function U(Y,J){if(Y!==Object(Y))return F?F(Y):Y;if(O.has(Y))return;let ee;if(O.add(Y),As(Y))ee=[],vk(Y,W=>{ee.push(U(W))});else{const W={};vl(xk(Y)?mst(Y):Y,(q,ie)=>{O.has(q)||(W[ie]=U(q))}),ee=W}return ee})(R)})(u,R=>nA(R)?R.slice(0,E):R)),u.timestamp=l,Eo(o?.timestamp)||(u.properties.$event_time_override_provided=!0,u.properties.$event_time_override_system_time=c),h&&(u.properties=((R,F=[])=>{const O={},U=Y=>{R[Y]!==void 0&&(O[Y]=R[Y])};return F4n.forEach(U),F.forEach(U),O})(u.properties,I9n)),e===D3.DISMISSED||e===D3.SENT){const R=n?.[M2e.SURVEY_ID],F=n?.[M2e.SURVEY_ITERATION];Fat({id:R,current_iteration:F}),u.$set=sn(sn({},u.$set),{},{[i9n({id:R,current_iteration:F},e===D3.SENT?"responded":"dismissed")]:!0})}else e===D3.SHOWN&&(u.$set=sn(sn({},u.$set),{},{[M2e.SURVEY_LAST_SEEN_DATE]:new Date().toISOString()}));var E;if(e===YBn.SHOWN){const R=n?.[iat.TOUR_TYPE];R&&(u.$set=sn(sn({},u.$set),{},{[`${iat.TOUR_LAST_SEEN_DATE}/${R}`]:new Date().toISOString()}))}const B=sn(sn({},u.properties.$set),u.$set);if(nx(B)||this.setPersonPropertiesForFlags(B),!Fs(this.config.before_send)){const R=this.Os(u);if(!R)return;u=R,u.uuid=Art(u.uuid,F4)}this.sessionRecording&&!this.Pu&&Yat(e)&&(this.Pu=!0,setTimeout(()=>this.Pu=!1,3e4));const S=C.filter(({channel:R,update:F})=>{var O,U,Y;const J=(O=(U=u.$set)===null||U===void 0?void 0:U[R.property])!==null&&O!==void 0?O:xA((Y=u.properties)===null||Y===void 0?void 0:Y.$set)?u.properties.$set[R.property]:void 0;return F?.pending&&J===F.value});this.du.emit("eventCaptured",u);const Q=(i=o?._url)!==null&&i!==void 0?i:this.requestRouter.endpointFor("api",this.analyticsDefaultEndpoint),w=o?._batchKey==="recordings"||/\/s\/(?:\?|$)/.test(Q),M=sn(sn(sn({method:"POST",url:Q,data:u,compression:"best-available",preferSyncCompression:o?.send_instantly,timestampMode:w?"body":"capture-body",batchKey:o?._batchKey},w&&(!((r=u.properties)===null||r===void 0)&&r.$session_id)?{batchGroup:u.properties.$session_id+(u.properties.$window_id?`-${u.properties.$window_id}`:"")}:{}),o?.transport?{transport:o.transport}:{}),S.length?{fireCallbackOnDrop:!0,callback:R=>{if(R.statusCode>=200&&300>R.statusCode)for(const{channel:F,update:O}of S)this.dh(F,O.value)}}:{});if(!this.config.request_batching||o&&!o?._batchKey||o?.send_instantly||S.length){var k;let R;!M.transport&&!M.callback&&nx((k=this.config.request_headers)!==null&&k!==void 0?k:{})&&this.Cu&&(R="sendBeacon"),this.ju(M,R)}else this.qu.enqueue(M);return u}_addCaptureHook(e){return this.on("eventCaptured",n=>e(n.event,n))}getExtension(e){var n;return(n=this.Xu)===null||n===void 0?void 0:n.getExtension(e)}Zu(){var e;return(e=this.Xu)!==null&&e!==void 0?e:this.Xu=new p9n(this)}fu(e){this.Eu.push(e);let n=!0;return()=>{if(!n)return;n=!1;const o=this.Eu.indexOf(e);o!==-1&&this.Eu.splice(o,1)}}gh(e=!0){var n,o,i;return!!(!((n=this.persistence)===null||n===void 0)&&n.consumeCookieIdentityChange())&&(this.Ou=null,this.persistence.get_property("$user_state")==="anonymous"&&((i=this.sessionPersistence)===null||i===void 0||i.clear(),this.Iu.clear(),this.mh()),(o=this.featureFlags)===null||o===void 0||o.reset(),e&&this.reloadFeatureFlags(),!0)}calculateEventProperties(e,n,o,i,r){if(o=o||new Date,!this.persistence||!this.sessionPersistence)return n;this.persistence.syncCookieProperties(),this.gh();const s=r?void 0:this.persistence.remove_event_timer(e);let a=sn({},n);if(a.token=this.config.token,a.$config_defaults=this.config.defaults,this.yu()&&(a[nst]=!0),e==="$snapshot"){const f=sn(sn({},this.persistence.properties()),this.sessionPersistence.properties());return a.distinct_id=f.distinct_id,(!nA(a.distinct_id)&&!jd(a.distinct_id)||YK(a.distinct_id))&&gi.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),a}const A=(function(f,I,C,y=!1){var x,E,B,S;if(!dy)return{};const Q=f?[...Tk,...I||[]]:[],[w,M]=ort(dy),[k,R]=(function(se){for(let oe=0;rrt.length>oe;oe++){const[ge,ue,Ie]=rrt[oe],le=se.match(ge);if(le){const _e=Ie&&se.match(Ie)||le;return[ue,_e?.[1]||""]}}return["",""]})(dy),F=(function(){const se="u">typeof navigator?navigator:void 0;return se?.brave?{brave:!0}:{}})(),O={};Eo(C)||(O.detectGoogleSearchApp=C);const U={},Y=(x=navigator)===null||x===void 0||(x=x.userAgentData)===null||x===void 0?void 0:x.platform,J=(E=navigator)===null||E===void 0?void 0:E.maxTouchPoints,ee=Fn==null||(B=Fn.screen)===null||B===void 0?void 0:B.width,W=Fn==null||(S=Fn.screen)===null||S===void 0?void 0:S.height,q=Fn?.devicePixelRatio;Eo(Y)||(U.userAgentDataPlatform=Y),Eo(J)||(U.maxTouchPoints=J),Eo(ee)||(U.screenWidth=ee),Eo(W)||(U.screenHeight=W),Eo(q)||(U.devicePixelRatio=q);const ie=jg(d2e({$os:w,$os_version:M,$browser:trt(dy,navigator.vendor,F,O),$webview_app:k,$webview_app_version:R,$device:irt(dy),$device_type:r4n(dy,U),$timezone:eat(),$timezone_offset:HBn()}),{$current_url:AV(y?iQ(sd?.href):sd?.href,Q,cV),$host:sd?.host,$pathname:sd?.pathname,$raw_user_agent:dy.length>1e3?dy.substring(0,997)+"...":dy,$browser_version:i4n(dy,navigator.vendor,F,O),$browser_language:qst(),$browser_language_prefix:LBn(),$screen_height:Fn?.screen.height,$screen_width:Fn?.screen.width,$viewport_height:Fn?.innerHeight,$viewport_width:Fn?.innerWidth,$lib:f8.LIB_NAME,$lib_version:f8.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3});return f8.SDK_DIST_CHANNEL&&(ie.$sdk_dist_channel=f8.SDK_DIST_CHANNEL),ie})(this.config.mask_personal_data_properties,this.config.custom_personal_data_properties,this.config.detect_google_search_app,this.config.disable_capture_url_hashes);if(this.sessionManager){const{sessionId:f,windowId:I}=this.sessionManager.checkAndGetSessionAndWindowId(r,o.getTime(),!0);a.$session_id=f,a.$window_id=I}this.sessionPropsManager&&jg(a,this.sessionPropsManager.getSessionProps());try{var c;if(this.sessionRecording){const f=this.sessionRecording.sdkDebugProperties,I=!this.Pu&&Yat(e);for(const C in f)(I||as(m9n,C))&&(a[C]=f[C])}a.$sdk_debug_retry_queue_size=(c=this.Bu)===null||c===void 0?void 0:c.length}catch(f){a.$sdk_debug_error_capturing_properties=String(f)}let l;if(this.requestRouter.region===K2e&&(a.$lib_custom_api_host=this.config.api_host),l=e!=="$pageview"||r?e!=="$pageleave"||r?this.pageViewManager.doEvent():this.pageViewManager.doPageLeave(o):this.pageViewManager.doPageView(o,i),a=jg(a,l),e==="$pageview"&&No&&(a.title=No.title),!Eo(s)){const f=o.getTime()-s;a.$duration=parseFloat((f/1e3).toFixed(3))}dy&&this.config.opt_out_useragent_filter&&(a.$browser_type=this._is_bot()?"bot":"browser");const g=this.persistence.properties(),u=this.sessionPersistence.properties(),h=a.$groups,d=g.$groups;xA(h)&&!nx(h)&&(a.$groups=sn(sn({},xA(d)?d:{}),h)),vl(["$referrer","$referring_domain"],f=>{f in g&&delete u[f]});const p={};if(this.Eu.length>0)for(const f of this.Eu.slice())try{jg(p,f())}catch(I){gi.error("Failed to produce browser extension event properties",I)}a=jg({},A,g,u,sn(sn({},p),a)),a.$is_identified=this._isIdentified(),As(this.config.property_denylist)?vl(this.config.property_denylist,function(f){delete a[f]}):gi.error(Gat+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);const m=this.config.sanitize_properties;m&&(gi.error(Oat),a=m(a,e));const _=this.yh();return a.$process_person_profile=_,_&&!r&&this.bh("_calculate_event_properties"),a}ph(e,n=!0,o=!1){var i;if(!this.persistence||!this.yh()||this.Tu&&!o)return e;const r=this.persistence.get_initial_props(),s=(i=this.sessionPropsManager)===null||i===void 0?void 0:i.getSetOnceProps();let a=jg({},r,s||{},e||{});const A=this.config.sanitize_properties;return A&&(gi.error(Oat),a=A(a,"$set_once")),n&&(this.Tu=!0),nx(a)?void 0:a}register(e,n){var o;(o=this.persistence)===null||o===void 0||o.register(e,n)}register_once(e,n,o){var i;(i=this.persistence)===null||i===void 0||i.register_once(e,n,o)}register_for_session(e){var n,o;(n=this.persistence)===null||n===void 0||n.syncCookieProperties(),this.gh(),(o=this.sessionPersistence)===null||o===void 0||o.register(e),Object.keys(e).forEach(i=>this.Iu.add(i)),this.mh()}unregister(e){var n;(n=this.persistence)===null||n===void 0||n.unregister(e)}unregister_for_session(e){var n;(n=this.sessionPersistence)===null||n===void 0||n.unregister(e),this.Iu.delete(e),this.mh()}_h(e,n){this.register({[e]:n})}Hu(){this.Iu.forEach(e=>{var n;(n=this.sessionPersistence)===null||n===void 0||n.unregister(e)}),this.Iu.clear(),this.mh()}mh(){var e;if(!this.Mu)return;if(this.config.persistence==="memory"||!((e=this.sessionPersistence)===null||e===void 0)&&e.hi||!Z0.Et())return void Z0.Lt(this.Mu);const n=[];this.Iu.forEach(o=>n.push(o)),n.length>0?Z0.$t(this.Mu,n):Z0.Lt(this.Mu)}getFeatureFlag(e,n){var o;return(o=this.featureFlags)===null||o===void 0?void 0:o.getFeatureFlag(e,n)}getFeatureFlagPayload(e){var n;return(n=this.featureFlags)===null||n===void 0?void 0:n.getFeatureFlagPayload(e)}getFeatureFlagResult(e,n){var o;return(o=this.featureFlags)===null||o===void 0?void 0:o.getFeatureFlagResult(e,n)}getAllFeatureFlags(){var e,n;return(e=(n=this.featureFlags)===null||n===void 0?void 0:n.getAllFeatureFlags())!==null&&e!==void 0?e:[]}isFeatureEnabled(e,n){var o,i;return(o=(i=this.featureFlags)===null||i===void 0?void 0:i.isFeatureEnabled(e,n))!==null&&o!==void 0?o:n?.defaultValue}reloadFeatureFlags(){var e;(e=this.featureFlags)===null||e===void 0||e.reloadFeatureFlags()}updateFlags(e,n,o){var i;(i=this.featureFlags)===null||i===void 0||i.updateFlags(e,n,o)}updateEarlyAccessFeatureEnrollment(e,n,o){var i;(i=this.featureFlags)===null||i===void 0||i.updateEarlyAccessFeatureEnrollment(e,n,o)}getEarlyAccessFeatures(e,n=!1,o){var i;return(i=this.featureFlags)===null||i===void 0?void 0:i.getEarlyAccessFeatures(e,n,o)}on(e,n){return this.du.on(e,n)}onFeatureFlags(e){return this.featureFlags?this.featureFlags.onFeatureFlags(e):(e([],{},{errorsLoading:!0}),()=>{})}onSurveysLoaded(e){return this.surveys?this.surveys.onSurveysLoaded(e):(e([],{isLoaded:!1,error:Ok}),()=>{})}onSessionId(e){var n,o;return(n=(o=this.sessionManager)===null||o===void 0?void 0:o.onSessionId(e))!==null&&n!==void 0?n:()=>{}}getSurveys(e,n=!1){this.surveys?this.surveys.getSurveys(e,n):e([],{isLoaded:!1,error:Ok})}getActiveMatchingSurveys(e,n=!1){this.surveys?this.surveys.getActiveMatchingSurveys(e,n):e([],{isLoaded:!1,error:Ok})}onActiveMatchingSurveysChanged(e){return this.surveys?this.surveys.onActiveMatchingSurveysChanged(e):(e([],{isLoaded:!1,error:Ok}),()=>{})}renderSurvey(e,n){var o;(o=this.surveys)===null||o===void 0||o.renderSurvey(e,n)}displaySurvey(e,n=c9n){var o;(o=this.surveys)===null||o===void 0||o.displaySurvey(e,n)}cancelPendingSurvey(e){var n;(n=this.surveys)===null||n===void 0||n.cancelPendingSurvey(e)}canRenderSurvey(e){var n,o;return(n=(o=this.surveys)===null||o===void 0?void 0:o.canRenderSurvey(e))!==null&&n!==void 0?n:{visible:!1,disabledReason:Ok}}canRenderSurveyAsync(e,n=!1){var o,i;return(o=(i=this.surveys)===null||i===void 0?void 0:i.canRenderSurveyAsync(e,n))!==null&&o!==void 0?o:Promise.resolve({visible:!1,disabledReason:Ok})}wh(e){return!e||YK(e)?(gi.critical("Unique user id has not been set in posthog.identify"),!1):e==="$posthog_cookieless"?(gi.critical(`The string "${e}" was set in posthog.identify which indicates an error. This ID is only used as a sentinel value.`),!1):!["distinct_id","distinctid"].includes(e.toLowerCase())&&!["undefined","null"].includes(e.toLowerCase())||(gi.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.`),!1)}identify(e,n,o){if(!this.__loaded||!this.persistence)return gi.uninitializedWarning("posthog.identify");if(jd(e)&&(e=e.toString(),gi.warn("The first argument to posthog.identify was a number, but it should be a string. It has been converted to a string.")),!this.wh(e)||!this.bh("posthog.identify"))return;this.ku();const i=this.get_distinct_id(),r=this.persistence.syncCookieProperties()&&this.get_distinct_id()!==i,s=this.gh(!1),a=this.persistence.Oa();let A=!1;try{const l=this.get_distinct_id();this.register({$user_id:e}),this.get_property("$device_id")||this.register_once({$had_persisted_distinct_id:!0,$device_id:l},""),e!==l&&e!==this.get_property("__alias")&&(this.unregister(Xte),this.register({distinct_id:e}));const g=(this.persistence.get_property("$user_state")||"anonymous")===y8,u=e!==l,h=!u&&g;if(u&&g){var c;const d=this.config.reuseAnonymousId?{distinct_id:e}:{distinct_id:e,$anon_distinct_id:l};this.persistence.set_property(py,Zte),this.setPersonPropertiesForFlags({$set:n||{},$set_once:o||{}},!1),this.config.cookieWinsOnConflict&&this.persistence.Da(),this.capture("$identify",d,{$set:n||{},$set_once:o||{}})&&(this.Ou=U2e(e,n,o)),(c=this.featureFlags)===null||c===void 0||c.setAnonymousDistinctId(this.config.reuseAnonymousId?void 0:l)}else if(h){this.persistence.set_property(py,Zte);const d=n||{},p=o||{};this.setPersonPropertiesForFlags({$set:d,$set_once:p},!1),this.config.cookieWinsOnConflict&&this.persistence.Da(),this.capture("$set",{$set:d,$set_once:p})&&(this.Ou=U2e(e,n,o))}else(n||o)&&this.setPersonProperties(n,o);u||r||s?(this.reloadFeatureFlags(),this.featureFlags?this.featureFlags.resetFlagCallReported():this.unregister(AQ)):h&&(n||o)&&this.reloadFeatureFlags(),A=!0}finally{a&&this.persistence.qa(A)}}setPersonProperties(e,n){if(!e&&!n||!this.bh("posthog.setPersonProperties"))return;const o=U2e(this.get_distinct_id(),e,n);this.Ou!==o?(this.setPersonPropertiesForFlags({$set:e||{},$set_once:n||{}},!0),this.capture("$set",{$set:e||{},$set_once:n||{}})&&(this.Ou=o)):gi.info("A duplicate setPersonProperties call was made with the same properties. It has been ignored.")}unsetPersonProperties(e){var n;const o=(As(e)?e:[e]).filter(i=>nA(i)&&i.length>0);o.length!==0&&this.bh("posthog.unsetPersonProperties")&&((n=this.featureFlags)===null||n===void 0||n.unsetPersonPropertiesForFlags(o,!0),this.capture("$set",{$unset:o}),this.Ou=null)}group(e,n,o){var i;if(!e||!n)return void gi.error("posthog.group requires a group type and group key");(i=this.persistence)===null||i===void 0||i.syncCookieProperties(),this.gh();const r=this.getGroups(),s=r[e]!==n;if(s&&this.resetGroupPropertiesForFlags(e),this.register({$groups:sn(sn({},r),{},{[e]:n})}),(s||o)&&this.yh()){const a={$group_type:e,$group_key:n};o&&(a.$group_set=o),this.capture(pst,a)}o&&this.setGroupPropertiesForFlags({[e]:o}),s&&!o&&this.reloadFeatureFlags()}resetGroups(){this.register({$groups:{}}),this.resetGroupPropertiesForFlags(),this.reloadFeatureFlags()}setPersonPropertiesForFlags(e,n=!0){var o;(o=this.featureFlags)===null||o===void 0||o.setPersonPropertiesForFlags(e,n)}resetPersonPropertiesForFlags(e=!0){var n;(n=this.featureFlags)===null||n===void 0||n.resetPersonPropertiesForFlags(e)}setGroupPropertiesForFlags(e,n=!0){var o;this.bh("posthog.setGroupPropertiesForFlags")&&((o=this.featureFlags)===null||o===void 0||o.setGroupPropertiesForFlags(e,n))}resetGroupPropertiesForFlags(e){var n;(n=this.featureFlags)===null||n===void 0||n.resetGroupPropertiesForFlags(e)}reset(e){const n=hy(e)?e:e?.resetDeviceID,o=hy(e)||e==null?void 0:e.bootstrap;this.kh(n,!1,o)}kh(e,n=!1,o){var i,r,s,a,A,c;if(gi.info("reset"),!this.__loaded)return gi.uninitializedWarning("posthog.reset");const l=o?.sessionID;this.config.bootstrap=o||((i=this.Lu)===null||i===void 0?void 0:i.bootstrap)||{},(r=this.featureFlags)===null||r===void 0||(s=r.updateConfig)===null||s===void 0||s.call(r,this.config,this.il());const g=this.get_property(jye),u=this.get_property(qye),h=this.get_property(WK);(a=this.sessionRecording)===null||a===void 0||a.flushBeforeIdentityReset();const d=this.is_capturing();this.consent.reset(),n||!d||this.is_capturing()||console.warn("[PostHog.js]","reset() cleared the stored consent, and capturing is now off because of `opt_out_capturing_by_default`. Call opt_in_capturing() again, and prefer calling reset() before opting in rather than after.");const p=(A=this.persistence)===null||A===void 0||(c=A.Oa)===null||c===void 0?void 0:c.call(A);let m=!1;try{var _,f,I,C,y,x,E,B,S,Q,w,M,k;if((_=this.persistence)===null||_===void 0||_.clear(),(f=this.sessionPersistence)===null||f===void 0||f.clear(),this.Iu.clear(),this.mh(),Eo(h)||(Q=this.persistence)===null||Q===void 0||Q.register({$session_recording_remote_config:h}),(I=this.surveys)===null||I===void 0||I.reset(),(C=this.featureFlags)===null||C===void 0||C.reset(),(y=this.conversations)===null||y===void 0||y.reset(),(x=this.logs)===null||x===void 0||x.reset(),(E=this.metrics)===null||E===void 0||E.reset(),(B=this.persistence)===null||B===void 0||B.set_property("$user_state","anonymous"),(S=this.sessionManager)===null||S===void 0||S.resetSessionId(),this.Ou=null,this.config.cookieless_mode==="always")this.register_once({distinct_id:A2e,$device_id:null},"");else{const O=this.config.get_device_id(F4());this.register_once({distinct_id:O,$device_id:e?O:g},""),e||Eo(u)||this.register({[qye]:u})}if(this.register({$last_posthog_reset:new Date().toISOString()},1),o&&(o.distinctID&&!this.yu()&&((k=this.persistence)===null||k===void 0||k.set_property("$user_state",o.isIdentifiedID?"identified":"anonymous"),this.register({distinct_id:o.distinctID})),(w=this.featureFlags)===null||w===void 0||w.initialize(),!Fs(l)&&!(!((M=this.sessionManager)===null||M===void 0)&&M.setBootstrapSessionId(l,!0)))){const O=sn({},o);delete O.sessionID,this.config.bootstrap=O}delete this.config.identity_distinct_id,delete this.config.identity_hash,delete this.config.identity_claims,m=!0}finally{var R,F;p&&((R=this.persistence)===null||R===void 0||(F=R.qa)===null||F===void 0||F.call(R,m))}this.reloadFeatureFlags()}shutdown(e){var n=this;return Wg(function*(){var o,i,r,s,a,A,c,l;if(n.__loaded){n.$u=!0,n.Zu().dispose(),(o=n.sessionRecording)===null||o===void 0||o.dispose(),(i=n.logs)===null||i===void 0||i.flushLogs("sendBeacon"),(r=n.metrics)===null||r===void 0||r.flush("sendBeacon"),(s=n.metrics)===null||s===void 0||s.dispose(),(a=n.qu)===null||a===void 0||a.unload(),(A=n.Bu)===null||A===void 0||A.unload();try{var g;(g=n.featureFlags)===null||g===void 0||g.destroy()}catch(u){gi.error("Error while destroying feature flags",u)}(c=n.persistence)===null||c===void 0||c.destroy(),(l=n.sessionPersistence)===null||l===void 0||l.destroy()}else gi.uninitializedWarning("posthog.shutdown")})()}setIdentity(e,n){var o;delete this.config.identity_claims,this.config.identity_distinct_id=e,this.config.identity_hash=n,this.alias(e),(o=this.conversations)===null||o===void 0||o.Sh()}clearIdentity(){var e;delete this.config.identity_distinct_id,delete this.config.identity_hash,delete this.config.identity_claims,(e=this.conversations)===null||e===void 0||e.xh()}get_distinct_id(){return this.get_property("distinct_id")}getGroups(){return this.get_property("$groups")||{}}get_session_id(){var e,n;return(e=(n=this.sessionManager)===null||n===void 0?void 0:n.checkAndGetSessionAndWindowId(!0).sessionId)!==null&&e!==void 0?e:""}get_session_replay_url(e){if(!this.sessionManager)return"";const{sessionId:n,sessionStartTimestamp:o}=this.sessionManager.checkAndGetSessionAndWindowId(!0);let i=this.requestRouter.endpointFor("ui",`/project/${this.config.token}/replay/${n}`);if(e?.withTimestamp&&o){var r;const s=(r=e.timestampLookBack)!==null&&r!==void 0?r:10;if(!o)return i;i+=`?t=${Math.max(Math.floor((new Date().getTime()-o)/1e3)-s,0)}`}return i}alias(e,n){return e===this.get_property("$people_distinct_id")?(gi.critical("Attempting to create alias for existing People user - aborting."),-2):this.bh("posthog.alias")?(Eo(n)&&(n=this.get_distinct_id()),e!==n?(this._h(Xte,e),this.capture("$create_alias",{alias:e,distinct_id:n})):(gi.warn("alias matches current distinct_id - skipping api call."),this.identify(e),-1)):void 0}set_config(e){const n=sn({},this.config);if(xA(e)){var o,i,r,s,a,A,c,l,g,u,h,d,p,m;jg(this.config,Vat(e));const f=this.Su();(o=this.persistence)===null||o===void 0||o.update_config(this.config,n,f),this.sessionPersistence=this.config.persistence==="sessionStorage"||this.config.persistence==="memory"?this.persistence:new w2e(sn(sn({},this.config),{},{persistence:"sessionStorage"}),f,!1);const I=this.Du(this.config.debug);var _;hy(I)&&(this.config.debug=I),hy(this.config.debug)&&(this.config.debug?(Ym.DEBUG=!0,uc.Et()&&uc.$t("ph_debug",!0),gi.info("set_config",{config:e,oldConfig:n,newConfig:sn({},this.config)})):(Ym.DEBUG=!1,uc.Et()&&uc.Lt("ph_debug"))),(i=this.featureFlags)===null||i===void 0||(r=i.updateConfig)===null||r===void 0||r.call(i,this.config,this.il()),(s=this.exceptionObserver)===null||s===void 0||s.onConfigChange(),(a=this.exceptions)===null||a===void 0||a.onConfigChange(),(A=this.metrics)===null||A===void 0||A.onConfigChange(),(c=this.sessionRecording)===null||c===void 0||c.startIfEnabledOrStop(),(l=this.tracingHeaders)===null||l===void 0||l.startIfEnabledOrStop(),(g=this.autocapture)===null||g===void 0||g.startIfEnabled(),(u=this.heatmaps)===null||u===void 0||u.startIfEnabled(),("capture_pageview"in e||"disable_capture_url_hashes"in e)&&((_=this.historyAutocapture)===null||_===void 0||_.startIfEnabledOrStop()),(h=this.exceptionObserver)===null||h===void 0||h.startIfEnabledOrStop(),(d=this.deadClicksAutocapture)===null||d===void 0||d.startIfEnabledOrStop(),(p=this.surveys)===null||p===void 0||p.loadIfEnabled(),this.xu(),(m=this.externalIntegrations)===null||m===void 0||m.startIfEnabledOrStop(),!n.segment&&this.config.segment&&this.persistence&&Gst(this,mV,!1)}}_overrideSDKInfo(e,n){Ym.LIB_NAME=e,Ym.LIB_VERSION=n}startSessionRecording(e){const n=e===!0,o={sampling:n||!!e?.sampling,linked_flag:n||!!e?.linked_flag,url_trigger:n||!!e?.url_trigger,event_trigger:n||!!e?.event_trigger};var i,r,s,a,A;Object.values(o).some(Boolean)&&((i=this.sessionManager)===null||i===void 0||i.checkAndGetSessionAndWindowId(),o.sampling&&((r=this.sessionRecording)===null||r===void 0||r.overrideSampling()),o.linked_flag&&((s=this.sessionRecording)===null||s===void 0||s.overrideLinkedFlag()),o.url_trigger&&((a=this.sessionRecording)===null||a===void 0||a.overrideTrigger("url")),o.event_trigger&&((A=this.sessionRecording)===null||A===void 0||A.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===void 0)&&e.started)}captureException(e,n){try{if(!this.exceptions)return;const o=this.exceptions.buildProperties(e,{handled:!0,syntheticException:new Error("PostHog syntheticException")});return this.exceptions.sendExceptionEvent(sn(sn({},o),n))}catch{return}}addExceptionStep(e,n){var o;(o=this.exceptions)===null||o===void 0||o.addExceptionStep(e,n)}captureLog(e){var n;(n=this.logs)===null||n===void 0||n.captureLog(e)}get logger(){var e,n;return(e=(n=this.logs)===null||n===void 0?void 0:n.logger)!==null&&e!==void 0?e:EM.Ch}startExceptionAutocapture(e){this.set_config({capture_exceptions:e==null||e})}stopExceptionAutocapture(){this.set_config({capture_exceptions:!1})}loadToolbar(e){var n,o;return(n=(o=this.toolbar)===null||o===void 0?void 0:o.loadToolbar(e))!==null&&n!==void 0&&n}get_property(e){var n;return(n=this.persistence)===null||n===void 0?void 0:n.props[e]}getSessionProperty(e){var n;return(n=this.sessionPersistence)===null||n===void 0?void 0:n.props[e]}toString(){var e;let n=(e=this.config.name)!==null&&e!==void 0?e:_V;return n!==_V&&(n="posthog."+n),n}_isIdentified(){var e,n;return((e=this.persistence)===null||e===void 0?void 0:e.get_property("$user_state"))==="identified"||((n=this.sessionPersistence)===null||n===void 0?void 0:n.get_property("$user_state"))==="identified"}yh(){var e,n;return!(this.config.person_profiles==="never"||this.config.person_profiles==="identified_only"&&!this._isIdentified()&&nx(this.getGroups())&&!(!((e=this.persistence)===null||e===void 0||(e=e.props)===null||e===void 0)&&e.__alias)&&!(!((n=this.persistence)===null||n===void 0||(n=n.props)===null||n===void 0)&&n.$epp))}ih(){return this.config.capture_pageleave===!0||this.config.capture_pageleave==="if_capture_pageview"&&!!this.config.capture_pageview}createPersonProfile(){this.yh()||this.bh("posthog.createPersonProfile")&&this.setPersonProperties({},{})}setInternalOrTestUser(){this.bh("posthog.setInternalOrTestUser")&&this.setPersonProperties({$internal_or_test_user:!0})}bh(e){return this.config.person_profiles==="never"?(gi.error(e+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this.bu(),this._h(a2e,!0),!0)}Su(){if(this.config.cookieless_mode==="always")return!0;const e=this.consent.isOptedOut();return this.config.disable_persistence||e&&!(!this.config.opt_out_persistence_by_default&&this.config.cookieless_mode!=="on_reject")}xu(){var e,n;const o=this.Su();var i,r,s;return this.is_capturing()||(i=this.logs)===null||i===void 0||i.$h(),((e=this.persistence)===null||e===void 0?void 0:e.hi)!==o&&((r=this.persistence)===null||r===void 0||r.set_disabled(o)),((n=this.sessionPersistence)===null||n===void 0?void 0:n.hi)!==o&&((s=this.sessionPersistence)===null||s===void 0||s.set_disabled(o)),o&&(this.Iu.clear(),this.mh()),o}opt_in_capturing(e){var n;if(this.config.cookieless_mode!=="always"){if(this.yu()){var o,i,r,s,a,A;(o=this.sessionRecording)===null||o===void 0||o.dispose({discardBufferedEvents:!0}),this.kh(!0,!0),(i=this.sessionManager)===null||i===void 0||i.destroy(),(r=this.pageViewManager)===null||r===void 0||r.destroy(),this.sessionManager=new Pat(this),this.pageViewManager=new Kst(this),this.persistence&&(this.sessionPropsManager=new vat(this,this.sessionManager,this.persistence));const h=(s=(a=this.config.__extensionClasses)===null||a===void 0?void 0:a.sessionRecording)!==null&&s!==void 0?s:(A=EM.__defaultExtensionClasses)===null||A===void 0?void 0:A.sessionRecording;var c,l;h&&(this.sessionRecording=this.mu(this.sessionRecording,new h(this)),this.cu&&((c=this.sessionRecording)===null||c===void 0||(l=c.onRemoteConfig)===null||l===void 0||l.call(c,this.cu)))}var g,u;this.consent.optInOut(!0),this.xu(),this.Yu(),(n=this.sessionRecording)===null||n===void 0||n.startIfEnabledOrStop(),this.config.cookieless_mode=="on_reject"&&((g=this.surveys)===null||g===void 0||g.loadIfEnabled()),(Eo(e?.captureEventName)||e?.captureEventName)&&this.capture((u=e?.captureEventName)!==null&&u!==void 0?u:"$opt_in",e?.captureProperties,{send_instantly:!0}),this.config.capture_pageview&&this.th()}else gi.warn(Hat)}opt_out_capturing(){if(this.config.cookieless_mode==="always")return void gi.warn(Hat);const e=this.config.cookieless_mode==="on_reject"?this.sessionRecording:void 0;var n,o;e?.dispose({discardBufferedEvents:!0}),this.config.cookieless_mode==="on_reject"&&this.consent.isOptedIn()&&this.kh(!0,!0),this.consent.optInOut(!1),this.xu(),this.config.cookieless_mode==="on_reject"&&(this.register({distinct_id:A2e,$device_id:null}),this.gu(e),this.sessionRecording=void 0,(n=this.sessionManager)===null||n===void 0||n.destroy(),(o=this.pageViewManager)===null||o===void 0||o.destroy(),this.sessionManager=void 0,this.sessionPropsManager=void 0,this.config.capture_pageview&&this.th(),this.Yu())}has_opted_in_capturing(){return this.consent.isOptedIn()}has_opted_out_capturing(){return this.consent.isOptedOut()}get_explicit_consent_status(){const e=this.consent.consent;return e===1?"granted":e===0?"denied":"pending"}is_capturing(){return this.config.cookieless_mode==="always"||(this.config.cookieless_mode==="on_reject"?this.consent.isRejected()||this.consent.isOptedIn():!this.has_opted_out_capturing())}clear_opt_in_out_capturing(){this.consent.reset(),this.xu()}_is_bot(){return F_?Mat(F_,this.config.custom_blocked_useragents):void 0}th(){No&&(No.visibilityState==="visible"?this.Ru||(this.Ru=!0,this.capture(u2e,{title:No.title},{send_instantly:!0}),this.Au&&(No.removeEventListener(ZK,this.Au),this.Au=null)):this.Au||(this.Au=this.th.bind(this),jc(No,ZK,this.Au)))}debug(e){e===!1?(Fn?.console.log("You've disabled debug mode."),this.set_config({debug:!1})):(Fn?.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)`."),this.set_config({debug:!0}))}il(){const e=this.Lu||{};return"advanced_disable_flags"in e?!!e.advanced_disable_flags:this.config.advanced_disable_flags!==!1?!!this.config.advanced_disable_flags:this.config.advanced_disable_decide===!0?(gi.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):(function(n,o,i,r,s){const a=o in n&&!Fs(n[o]),A=i in n&&!Fs(n[i]);return a?n[o]:!!A&&(s&&s.warn(`Config field '${i}' is deprecated. Please use '${o}' instead. The old field will be removed in a future major version.`),n[i])})(e,"advanced_disable_flags","advanced_disable_decide",0,gi)}Os(e){var n;if(Fs(this.config.before_send))return e;const o=Object.keys((n=e.properties)!==null&&n!==void 0?n:{}).filter(J5n),i=As(this.config.before_send)?this.config.before_send:[this.config.before_send];let r=e;for(const s of i)try{if(r=s(r),Fs(r)){const a=`Event '${e.event}' was rejected in beforeSend function`;return z5n(e.event)?gi.warn(`${a}. This can cause unexpected behavior.`):gi.info(a),null}r.properties&&!nx(r.properties)||gi.warn(`Event '${e.event}' has no properties after beforeSend function, this is likely an error.`)}catch(a){return gi.error(`Error in beforeSend function for event '${e.event}':`,a),null}for(const s of o)if(r.properties&&Fs(r.properties[s]))return gi.warn(`Event '${e.event}' had its '${s}' property removed in a beforeSend function. This property is required for ingestion, so the event will be dropped.`),null;return r}getPageViewId(){var e;return(e=this.pageViewManager.Wo)===null||e===void 0?void 0:e.pageViewId}captureTraceFeedback(e,n){this.capture("$ai_feedback",{$ai_trace_id:String(e),$ai_feedback_text:n})}captureTraceMetric(e,n,o){this.capture("$ai_metric",{$ai_trace_id:String(e),$ai_metric_name:n,$ai_metric_value:String(o)})}Du(e){const n=hy(e)&&!e,o=uc.Et()&&uc.Ot("ph_debug")==="true";return!n&&(!!o||e)}};fV.__defaultExtensionClasses={},fV.Ch=(()=>{const t=()=>{};return{trace:t,debug:t,info:t,warn:t,error:t,fatal:t}})(),(function(t,e){for(let n=0;e.length>n;n++)t.prototype[e[n]]=pBn(t.prototype[e[n]])})(fV,["identify"]);var zat=class{constructor(e){this.disabled=e===!1;const n=xA(e)?e:{};this.thresholdPx=n.threshold_px||30,this.timeoutMs=n.timeout_ms||1e3,this.clickCount=n.click_count||3,this.clicks=[]}isRageClick(e,n,o){if(this.disabled)return!1;const i=this.clicks[this.clicks.length-1];if(i&&Math.abs(e-i.x)+Math.abs(n-i.y)<this.thresholdPx&&this.timeoutMs>o-i.timestamp){if(this.clicks.push({x:e,y:n,timestamp:o}),this.clicks.length===this.clickCount)return!0}else this.clicks=[{x:e,y:n,timestamp:o}];return!1}};const J2e="$copy_autocapture",W2e=Ad("[AutoCapture]");function j2e(t,e){return e.length>t?e.slice(0,t)+"...":e}function E9n(t){if(t.previousElementSibling)return t.previousElementSibling;let e=t;do e=e.previousSibling;while(e&&!b9(e));return e}function B9n(t,{e,maskAllElementAttributes:n,maskAllText:o,elementAttributeIgnoreList:i,elementsChainAsString:r,disableCaptureUrlHashes:s}){var a,A;if(!b9(t))return{props:{}};const c=[t],l=new Set([t]);let g=t;for(;g.parentNode&&!j1(g,"body")&&1e3>c.length;){if(y2e(g.parentNode)){const x=g.parentNode.host;if(l.has(x))break;l.add(x),c.push(x),g=x;continue}if(!b9(g.parentNode)||l.has(g.parentNode))break;l.add(g.parentNode),c.push(g.parentNode),g=g.parentNode}const u=e.type==="click"&&t.namespaceURI==="http://www.w3.org/2000/svg"?c.findIndex(x=>j1(x,"button")||j1(x,"a")):-1;u>0&&(o=o||c.slice(0,u+1).some(x=>!Dk(x)||iV(x)));const h=[],d={};let p,m=!1,_=!1;if(vl(c,x=>{const E=Dk(x);if(j1(x,"a")&&!n&&!i?.includes("href")){const B=x.getAttribute("href");m=!!(E&&B&&rV(B))&&(s?iQ(B):B)}as(Mk(x),"ph-no-capture")&&(_=!0),h.push((function(B,S,Q,w,M=!1){const k=B.tagName.toLowerCase(),R={tag_name:k};E2e.indexOf(k)>-1&&!Q&&(R.$el_text=k.toLowerCase()==="a"||k.toLowerCase()==="button"?j2e(1024,Fst(B)):j2e(1024,nV(B)));const F=Mk(B);S||w?.includes("class")||0>=F.length||(R.classes=F.filter(function(J){return J!==""})),vl(B.attributes,function(J){var ee;if((!iV(B)||["name","id","class","aria-label"].indexOf(J.name)!==-1)&&!w?.includes(J.name)&&!S&&rV(J.value)&&(!nA(ee=J.name)||ee.substring(0,10)!=="_ngcontent"&&ee.substring(0,7)!=="_nghost")){let W=J.value;J.name==="class"&&(W=x2e(W).join(" ")),R["attr__"+J.name]=j2e(1024,J.name==="href"&&M?iQ(W):W)}});let O=1,U=1,Y=B;for(;Y=E9n(Y);)O++,Y.tagName===B.tagName&&U++;return R.nth_child=O,R.nth_of_type=U,R})(x,n,o,i,s)),vl((function(B){if(!Dk(B))return{};const S={};return vl(B.attributes,function(Q){if(Q.name&&Q.name.indexOf("data-ph-capture-attribute")===0){const w=Q.name.replace("data-ph-capture-attribute-",""),M=Q.value;w&&M&&rV(M)&&(S[w]=M)}}),S})(x),(B,S)=>{({}).hasOwnProperty.call(d,S)||(d[S]=B)})}),_)return{props:{},explicitNoCapture:_};if(u>0&&(t=c[u],h.splice(0,u)),o||(h[0].$el_text=j1(t,"a")||j1(t,"button")?Fst(t):nV(t)),m){var f,I;h[0].attr__href=m;const x=(f=x8(m))===null||f===void 0?void 0:f.host,E=Fn==null||(I=Fn.location)===null||I===void 0?void 0:I.host;x&&E&&x!==E&&(p=m)}return{props:jg((y=e.type,{$event_type:y,$ce_version:1}),r?{}:{$elements:h},{$elements_chain:(C=h,As(C)?(function(x){return x.map(E=>{var B,S;let Q="";if(E.tag_name&&(Q+=E.tag_name),E.attr_class){E.attr_class.sort();for(const k of E.attr_class)Q+=`.${k.replace(/"/g,"")}`}const w=sn(sn(sn(sn({},E.text?{text:E.text}:{}),{},{"nth-child":(B=E.nth_child)!==null&&B!==void 0?B:0,"nth-of-type":(S=E.nth_of_type)!==null&&S!==void 0?S:0},E.href?{href:E.href}:{}),E.attr_id?{attr_id:E.attr_id}:{}),E.attributes),M={};return tne(w).sort(([k],[R])=>(function(F,O){return O>F?-1:F>O?1:0})(k,R)).forEach(([k,R])=>M[Hst(k.toString())]=Hst(R.toString())),Q+=":",Q+=tne(M).map(([k,R])=>`${k}="${R}"`).join(""),Q}).join(";")})((function(x){return x.map(E=>{var B,S;const Q={text:(B=E.$el_text)===null||B===void 0?void 0:B.slice(0,400),tag_name:E.tag_name,href:(S=E.attr__href)===null||S===void 0?void 0:S.slice(0,2048),attr_class:PBn(E),attr_id:E.attr__id,nth_child:E.nth_child,nth_of_type:E.nth_of_type,attributes:{}};return tne(E).filter(([w])=>w.indexOf("attr__")===0).forEach(([w,M])=>Q.attributes[w]=M),Q})})(C)):"")},!((a=h[0])===null||a===void 0)&&a.$el_text?{$el_text:(A=h[0])===null||A===void 0?void 0:A.$el_text}:{},p&&e.type==="click"?{$external_click_url:p}:{},d),target:t};var C,y}var b9n=class{do(){this.vo=void 0,clearTimeout(this.fo),this.fo=void 0}po(e){var n;if(!Dk(e))return!0;const o=(n=this.mo().css_selector_ignorelist)!==null&&n!==void 0?n:S2e,i=new Set;let r=e;for(;r;){if(i.size>=1e3||i.has(r))return!0;i.add(r);const s=r,a=Mk(s);if(as(a,"ph-no-capture")||as(a,"ph-sensitive")||iV(s)||o.some(c=>B2e(s,c)))return!0;const A=r.parentNode;r=y2e(A)?A.host:A&&b9(A)?A:null}return!1}yo(e){if(!this.isEnabled||e.type==="pointercancel")return void this.do();if(e.type==="pointerdown"){this.do();const i=oV(e);var n;return void(e.isPrimary&&e.button===0&&!e.ctrlKey&&i&&b9(i)&&(this.vo={target:i,excluded:this.po(i),id:e.pointerId,x:e.clientX,y:e.clientY,released:!1,distinctId:(n=this.bo)===null||n===void 0?void 0:n.distinctId}))}const o=this.vo;o&&(e.pointerId!==o.id||Math.abs(e.clientX-o.x)>5||Math.abs(e.clientY-o.y)>5?this.do():e.type==="pointerup"&&(o.released=!0,this.fo=setTimeout(()=>this.do(),0)))}_o(e){var n;const o=this.vo;this.do();const i=oV(e);if(o?.released&&o.target.isConnected&&o.distinctId===((n=this.bo)===null||n===void 0?void 0:n.distinctId)&&e.pointerId===o.id&&(e.detail>0||e.pointerType==="touch"||e.pointerType==="pen")&&e.button===0&&5>=Math.abs(e.clientX-o.x)&&5>=Math.abs(e.clientY-o.y)&&i&&(j1(i,"html")||j1(i,"body"))){var r;if(o.excluded)return null;const s=(r=this.mo().css_selector_ignorelist)!==null&&r!==void 0?r:S2e;return[i,No?.documentElement,No?.body].some(a=>{if(!a)return!1;const A=Mk(a);return as(A,"ph-no-capture")||as(A,"ph-sensitive")||!Dk(a)||iV(a)||s.some(c=>B2e(a,c))})?null:o.target}}constructor(e){this.wo=e,this.name="autocapture",this.ko=!1,this.So=null,this.xo=!1,this.Co=new Map,this.$o=!1,this.Ir={enabled:!1,rageclick:!1,maskAllElementAttributes:!1,maskAllText:!1,disableCaptureUrlHashes:!1,remoteRequestsDisabled:!1},this.To=!1,this.wo.refresh(this.Ir),this.rageclicks=new zat(this.Ir.rageclick),this.Io=null}setup(e){this.Mo(),this.bo=e;const n=e.onRemoteConfig(this.onRemoteConfig.bind(this));this.To?n.dispose():(this.Eo=n,this.startIfEnabled())}dispose(){var e;this.To||(this.To=!0,this.bo=void 0,(e=this.Eo)===null||e===void 0||e.dispose(),this.Eo=void 0,this.Co.clear(),this.Io=null,this.Po())}mo(){return this.wo.refresh(this.Ir),this.Ir}Mo(){var e,n;return this.mo(),this.Ir.url_allowlist=(e=this.Ir.url_allowlist)===null||e===void 0?void 0:e.map(o=>new RegExp(o)),this.Ir.url_ignorelist=(n=this.Ir.url_ignorelist)===null||n===void 0?void 0:n.map(o=>new RegExp(o)),this.Ir}Ro(){if(!this.isBrowserSupported())return void W2e.info("Disabling Automatic Event Collection because this browser is not supported");if(!Fn||!No)return;const e=this.Ao=n=>{n=n||Fn?.event;try{if(n.type==="blur")return void this.do();if(n.type.indexOf("pointer")===0)return void this.yo(n);const o=n.type==="click"?this._o(n):void 0;if(ad(o))return;this.Fo(n,"$autocapture",o)}catch(o){W2e.error("Failed to capture event",o)}};if(jc(Fn,"blur",e),jc(No,"submit",e,{capture:!0}),jc(No,"change",e,{capture:!0}),jc(No,"click",e,{capture:!0}),vl(["pointerdown","pointermove","pointerup","pointercancel"],n=>{jc(No,n,e,{capture:!0})}),this.mo().capture_copied_text){const n=this.Oo=o=>{o=o||Fn?.event;try{this.Fo(o,J2e)}catch(i){W2e.error("Failed to capture clipboard event",i)}};jc(No,"copy",n,{capture:!0}),jc(No,"cut",n,{capture:!0}),jc(No,"paste",n,{capture:!0})}}Po(){this.do(),this.Ao&&(Fn?.removeEventListener("blur",this.Ao),vl(["pointerdown","pointermove","pointerup","pointercancel"],e=>{No?.removeEventListener(e,this.Ao,!0)}),No?.removeEventListener("submit",this.Ao,!0),No?.removeEventListener("change",this.Ao,!0),No?.removeEventListener("click",this.Ao,!0),this.Ao=void 0),this.Oo&&(No?.removeEventListener("copy",this.Oo,!0),No?.removeEventListener("cut",this.Oo,!0),No?.removeEventListener("paste",this.Oo,!0),this.Oo=void 0),this.ko=!1}startIfEnabled(){this.isEnabled||this.do(),!this.To&&this.bo&&this.isEnabled&&!this.ko&&(this.Ro(),this.ko=!0)}onRemoteConfig(e){if(this.To)return;if(this.xo=!0,!e.ok)return void this.startIfEnabled();const n=e.config;n.elementsChainAsString&&(this.$o=n.elementsChainAsString);const o=n.autocapture_opt_out;var i;hy(o)&&((i=this.bo)===null||i===void 0||i.kv.set("$autocapture_disabled_server_side",o),this.So=o),this.startIfEnabled()}setElementSelectors(e,n=this){if(this.To)return;e.size?this.Co.set(n,new Set(e)):this.Co.delete(n);const o=new Set;this.Co.forEach(i=>{i.forEach(r=>o.add(r))}),this.Io=o}getElementSelectors(e,n){var o;const i=[];return(o=this.Io)===null||o===void 0||o.forEach(r=>{const s=No?.querySelectorAll(r);s?.forEach(a=>{e!==a&&n!==a||as(i,r)||i.push(r)})}),i}get isEnabled(){var e,n;if(this.To)return!1;const o=(e=this.bo)===null||e===void 0?void 0:e.kv.get(Vrt),i=this.So,r=this.mo();if(!r.remoteRequestsDisabled&&!this.xo)return!1;const s=r.remoteRequestsDisabled&&!this.xo;if(ad(i)&&!hy(o)&&!s)return!1;const a=(n=this.So)!==null&&n!==void 0?n:!!o;return!!r.enabled&&!a}Fo(e,n="$autocapture",o){if(!this.isEnabled)return void this.do();let i=o||oV(e);Bst(i)&&(i=i.parentNode||null);const r=this.Mo();var s;n==="$autocapture"&&e.type==="click"&&e instanceof MouseEvent&&r.rageclick&&(!((s=this.rageclicks)===null||s===void 0)&&s.isRageClick(e.clientX,e.clientY,e.timeStamp||new Date().getTime()))&&Mst(i,r.rageclick)&&this.Fo(e,"$rageclick",o);const a=n===J2e,A=a?sn(sn({},r),{},{dom_event_allowlist:void 0}):r;if(i&&(function(u,h,d,p,m,_){var f;if(!Fn||Q2e(u)||d?.url_allowlist&&!bst(d.url_allowlist,_)||d?.url_ignorelist&&bst(d.url_ignorelist,_))return!1;if(d?.dom_event_allowlist){const x=d.dom_event_allowlist;if(x&&!x.some(E=>h.type===E))return!1}const{parentIsUsefulElement:I,targetElementList:C}=Dst(u,p);if(!(function(x,E){const B=E?.element_allowlist;if(Eo(B))return!0;for(const S of x)if(B.some(Q=>S.tagName.toLowerCase()===Q))return!0;return!1})(C,d)||!b2e(C,d?.css_selector_allowlist)||b2e(C,(f=d?.css_selector_ignorelist)!==null&&f!==void 0?f:S2e))return!1;try{const x=Fn.getComputedStyle(u);if(x&&x.getPropertyValue("cursor")==="pointer"&&h.type==="click")return!0}catch{}const y=u.tagName.toLowerCase();switch(y){case"html":return!1;case"form":return(m||["submit"]).indexOf(h.type)>=0;case"input":case"select":case"textarea":return(m||["change","click"]).indexOf(h.type)>=0;default:return I?(m||["click"]).indexOf(h.type)>=0:(m||["click"]).indexOf(h.type)>=0&&(E2e.indexOf(y)>-1||u.getAttribute("contenteditable")==="true")}})(i,e,A,a,a?["copy","cut","paste"]:void 0,{config:{get_current_url:r.getCurrentUrl}})){var c;const{props:u,explicitNoCapture:h,target:d}=B9n(i,{e,maskAllElementAttributes:r.maskAllElementAttributes,maskAllText:r.maskAllText,elementAttributeIgnoreList:r.element_attribute_ignorelist,elementsChainAsString:this.$o,disableCaptureUrlHashes:r.disableCaptureUrlHashes});if(h)return!1;const p=this.getElementSelectors(i,d);if(p&&p.length>0&&(u.$element_selectors=p),n===J2e){const m=e.type||"clipboard";if(m!=="paste"){var l,g;const _=Fn==null||(l=Fn.getSelection())===null||l===void 0?void 0:l.toString(),f=Sst(_);if(!f)return!1;u.$selected_content=f,u.$clipboard_text_length=(g=_?.length)!==null&&g!==void 0?g:0}u.$copy_type=m}return(c=this.bo)===null||c===void 0||c.capture(n,u),!0}}isBrowserSupported(){return L_(No?.querySelectorAll)}},S9n=class{constructor(e){this._instance=e}refresh(e){const n=this._instance.config,o=xA(n.autocapture)?n.autocapture:void 0;e.enabled=!!n.autocapture,e.rageclick=n.rageclick,e.maskAllElementAttributes=n.mask_all_element_attributes,e.maskAllText=n.mask_all_text,e.disableCaptureUrlHashes=n.disable_capture_url_hashes,e.getCurrentUrl=n.get_current_url,e.remoteRequestsDisabled=this._instance.il(),e.url_allowlist=o?.url_allowlist,e.url_ignorelist=o?.url_ignorelist,e.dom_event_allowlist=o?.dom_event_allowlist,e.element_allowlist=o?.element_allowlist,e.css_selector_allowlist=o?.css_selector_allowlist,e.css_selector_ignorelist=o?.css_selector_ignorelist,e.element_attribute_ignorelist=o?.element_attribute_ignorelist,e.capture_copied_text=o?.capture_copied_text}};const IV=Ad("[ExceptionAutocapture]"),Jat=()=>{},Wat=t=>{var e;if(L_(t))return(e=t.__posthog_layer__)!==null&&e!==void 0?e:t.__rrweb_layer__};function CV(t,e,n){try{if(!(e in t))return Jat;const o={next:t[e]},i=n(function(...r){return o.next.apply(this,r)});return L_(i)&&(i.prototype=i.prototype||{},Object.defineProperties(i,{__posthog_wrapped__:{enumerable:!1,value:!0},__posthog_layer__:{enumerable:!1,value:o}})),t[e]=i,()=>{if(t[e]===i)return void(t[e]=o.next);let r=t[e],s=Wat(r);for(;s;){if(s.next===i)return void(s.next=o.next);r=s.next,s=Wat(r)}}}catch{return Jat}}const Q9n=Ad("[TracingHeaders]"),kM=Ad("[Web Vitals]"),jat=9e5,qat=["CLS","FCP","INP","LCP"],v9n=["INP","LCP"],w9n=["interactionTarget","interactionType","inputDelay","processingDuration","presentationDelay","loadState","target","url","timeToFirstByte","resourceLoadDelay","resourceLoadDuration","elementRenderDelay","largestShiftTarget","largestShiftTime","largestShiftValue","firstByteToFCP"],q2e="disabled",Xat="lazy_loading",b8=Ad("[SessionRecording]"),P9n=[c2e,l2e,rst,sst,ast,Ast,cst,lst,gst],M9n=Ad("[Heatmaps]");function X2e(t){return xA(t)&&"clientX"in t&&"clientY"in t&&jd(t.clientX)&&jd(t.clientY)}const hne=Ad("[Product Tours]"),$2e=t=>{var e;return!t.config.disable_product_tours&&!!(!((e=t.persistence)===null||e===void 0)&&e.get_property(o2e))},D9n=["$set_once","$set"],S9=Ad("[SiteApps]"),$at="Error while initializing PostHog app with config id ",Zat=(t,e)=>t?.then?t.then(e):e(t),Gk="SDK is not enabled or survey functionality is not yet loaded",eAt="Disabled. Not loading surveys.";var N9n=class{constructor(e,n){this.wo=e,this.Th=n,this.name="surveys",this._surveyEventReceiver=null,this._surveyManager=null,this.Ih=!1,this.Mh=!1,this.Eh=[],this.Ph=[],this.Rh=null,this.Ah=null,this.To=!1,this.Fh=new Set,this.onRemoteConfig=o=>{if(this.To||this.Ir.disableSurveys)return;if(!o.ok)return this.Mh=!0,this.Oh({isLoaded:!1,error:"Remote config unavailable. Not loading surveys."}),_l.warn("Remote config unavailable. Not loading surveys.");const i=o.config.surveys;if(Fs(i))return _l.warn("Flags not loaded yet. Not loading surveys.");this.Dh=hy(i)?i:i.length>0,_l.info(`flags response received, isSurveysEnabled: ${this.Dh}`),this.loadIfEnabled()},this.Oh=o=>{this.Ph.slice().forEach(i=>this.Lh(i,o))}}setup(e){if(!this.To)return this.Nh=e,Zat(e.kv.initialize(),()=>{if(this.Nh!==e||this.To)return;this.Nh=void 0,this.bo=e;const n=e.onRemoteConfig(this.onRemoteConfig);this.To?n.dispose():(this.Eo=n,this.loadIfEnabled())})}dispose(){var e,n,o,i,r;this.To||(this.To=!0,this.Nh=void 0,this.bo=void 0,(e=this.Eo)===null||e===void 0||e.dispose(),this.Eo=void 0,(n=this._surveyEventReceiver)===null||n===void 0||n.dispose(),this._surveyEventReceiver=null,(o=this._surveyManager)===null||o===void 0||(i=o.dispose)===null||i===void 0||i.call(o),this._surveyManager=null,this.Eh=[],this.Ph.forEach(s=>{s.active=!1}),this.Ph=[],(r=this.qh)===null||r===void 0||r.call(this),this.qh=void 0,this.Rh=null,this.Fh.forEach(s=>clearTimeout(s)),this.Fh.clear())}get Ir(){return this.wo.get()}initialize(){this.loadIfEnabled()}reset(){var e,n;(e=this._surveyManager)===null||e===void 0||(n=e.clearInMemoryInProgressSurveyState)===null||n===void 0||n.call(e);try{var o;(o=this._surveyEventReceiver)===null||o===void 0||o.reset(),localStorage.removeItem("lastSeenSurveyDate");const i=[];for(let r=0;r<localStorage.length;r++){const s=localStorage.key(r);(s?.startsWith("seenSurvey_")||s?.startsWith("inProgressSurvey_"))&&i.push(s)}i.forEach(r=>localStorage.removeItem(r))}catch{}this.Oh()}loadIfEnabled(){if(this.To||!this.bo)return;const e=this.Ir;if(this._surveyManager)return;if(this.Ih)return void _l.info("Already initializing surveys, skipping...");if(e.disableSurveys)return void _l.info(eAt);if(e.cookielessMode&&this.wo.isOptedOut())return void _l.info("Not loading surveys in cookieless mode without consent.");const n=this.wo.getExtensions();if(!n)return void this.jh("PostHog Extensions not found.");if(Eo(this.Dh)&&!e.advancedEnableSurveys)return;const o=this.Dh||e.advancedEnableSurveys;this.Ih=!0,this.Mh=!1;try{const i=n.generateSurveys;if(i)return this.Bh(i,o),void(this.Ih=!1);const r=n.loadExternalDependency;if(!r)return this.jh(g2e),void(this.Ih=!1);r(s=>{try{if(this.To)return;const a=this.wo.getExtensions();s||!a?.generateSurveys?this.jh("Could not load surveys script",s):this.Bh(a.generateSurveys,o)}finally{this.Ih=!1}})}catch(i){throw this.Ih=!1,this.jh("Error initializing surveys",i),i}}Bh(e,n){var o,i;if(this.To)return;this._surveyManager=e(n),this._surveyEventReceiver=this.wo.createEventReceiver(this.Oh);const r=(o=(i=this.bo)!==null&&i!==void 0?i:this.Th)===null||o===void 0?void 0:o.kv.get(qK);r&&this.Hh(r),_l.info("Surveys loaded successfully"),this.zh(),this.Oh(),this.Uh({isLoaded:!0})}jh(e,n){this.Mh=!0,_l.error(e,n),this.Oh({isLoaded:!1,error:e}),this.Uh({isLoaded:!1,error:e})}onSurveysLoaded(e){return this.Eh.push(e),this._surveyManager&&this.Uh({isLoaded:!0}),()=>{this.Eh=this.Eh.filter(n=>n!==e)}}getSurveys(e,n=!1){var o;const i=(o=this.bo)!==null&&o!==void 0?o:this.Th;if(!i||this.To)return;if(this.Ir.disableSurveys)return _l.info(eAt),e([]);const r=i.kv.get(qK);if(r&&!n)return e(r,{isLoaded:!0}),void(this.Wh()&&this.getSurveys(()=>{},!0));if(this.Rh)return void this.Rh.then(({surveys:A,context:c})=>{this.To||e(A,c)}).catch(A=>_l.error("Error in survey callback",A));const s=this.Vh("/api/surveys/",{method:"GET",query:{token:i.projectToken},sentAt:"query",timeoutMs:this.Ir.requestTimeoutMs}).then(A=>{try{return this.Gh(i,A)}catch(c){return _l.error("Error processing surveys response",c),this.Gh(i,{statusCode:0,error:c})}},A=>this.Gh(i,{statusCode:0,error:A}));this.Rh=s;const a=()=>{this.Rh===s&&(this.Rh=null)};s.then(A=>{a(),this.To||(this.Oh(A.context),e(A.surveys,A.context))},a).catch(A=>_l.error("Error in survey callback",A))}Vh(e,n){const o=this.bo;return o?o.sendRequest(e,n):new Promise(i=>i({statusCode:0,error:new Error(Gk)}))}Gh(e,n){if(this.To)return{surveys:[],context:{isLoaded:!1,error:Gk}};const o=n.statusCode;if(o!==200||!n.json){const r=`Surveys API could not be loaded, status: ${o}`;return o!==0?_l.error(r):n.error||_l.warn(r),this.Ah=Date.now(),{surveys:[],context:{isLoaded:!1,error:r}}}this.Ah=null;const i=n.json.surveys||[];return e.kv.set({[qK]:i,[$te]:Date.now()}),this.Hh(i),{surveys:i,context:{isLoaded:!0}}}Hh(e){var n;const o=e.filter(i=>(function(r){return!(!r.start_date||r.end_date)})(i)&&(Nat(i)||(function(r){var s;return!!(!((s=r.conditions)===null||s===void 0||(s=s.actions)===null||s===void 0||(s=s.values)===null||s===void 0)&&s.length)})(i)));(n=this._surveyEventReceiver)===null||n===void 0||n.replace(o)}Wh(){return this.Zh()&&!this.Rh&&!this.Qh()}Zh(){var e,n;const o=(e=(n=this.bo)!==null&&n!==void 0?n:this.Th)===null||e===void 0?void 0:e.kv.get($te);return jd(o)&&Date.now()-o>3e5}Qh(){return jd(this.Ah)&&3e5>Date.now()-this.Ah}markSurveyAsSeen(e,n){var o;const i={id:e,current_iteration:(o=n?.iteration)!==null&&o!==void 0?o:null};Fat(i);try{localStorage.setItem("lastSeenSurveyDate",new Date().toISOString())}catch{}this.Oh()}Uh(e){for(const n of this.Eh)try{if(!e.isLoaded)return n([],e);this.getSurveys(n)}catch(o){_l.error("Error in survey callback",o)}}getActiveMatchingSurveys(e,n=!1){if(!Fs(this._surveyManager))return this._surveyManager.getActiveMatchingSurveys(e,n);_l.warn("init was not called")}onActiveMatchingSurveysChanged(e){var n,o;if(this.To)return()=>{};const i={callback:e,active:!0,revision:0};this.Ph.push(i),this.zh();const r=(n=(o=this.bo)!==null&&o!==void 0?o:this.Th)===null||n===void 0?void 0:n.kv.get(qK);return this.Ir.disableSurveys||!this._surveyManager&&this.Mh&&!this.Ih||!r&&!Fs(this.Ah)&&!this.Rh?this.Lh(i,{isLoaded:!1}):this._surveyManager&&this.Lh(i),()=>{var s;i.active=!1,this.Ph=this.Ph.filter(a=>a!==i),this.Ph.length===0&&((s=this.qh)===null||s===void 0||s.call(this),this.qh=void 0)}}zh(){var e,n,o;this._surveyManager&&this.Ph.length>0&&((e=this.qh)!==null&&e!==void 0||(this.qh=(n=(o=this.wo).onMatchingConditionsChanged)===null||n===void 0?void 0:n.call(o,this.Oh)))}Lh(e,n){if(this.To||!e.active)return;const o=++e.revision,i=r=>{if(!this.To&&e.active&&o===e.revision)try{const s=n??{isLoaded:!0},a=JSON.stringify([r,s]);if(a===e.lastResult)return;e.lastResult=a,e.callback(r,s)}catch(s){_l.error("Error in active matching surveys callback",s)}};try{n&&!n.isLoaded?i([]):this.getActiveMatchingSurveys(i)}catch(r){_l.error("Error in active matching surveys callback",r)}}Jh(e){let n=null;return this.getSurveys(o=>{var i;n=(i=o.find(r=>r.id===e))!==null&&i!==void 0?i:null}),n}Kh(e){if(Fs(this._surveyManager))return{eligible:!1,reason:Gk};const n=typeof e=="string"?this.Jh(e):e;return n?this._surveyManager.checkSurveyEligibility(n):{eligible:!1,reason:"Survey not found"}}Xh(e){if(!this.wo.isCapturing())return{eligible:!1,reason:"PostHog is not capturing, so a survey response cannot be recorded"};if(Fs(this._surveyManager))return{eligible:!1,reason:Gk};const n=typeof e=="string"?this.Jh(e):e;return n?this._surveyManager.checkSurveyRenderability(n):{eligible:!1,reason:"Survey not found"}}canRenderSurvey(e){if(Fs(this._surveyManager))return _l.warn("init was not called"),{visible:!1,disabledReason:Gk};const n=this.Xh(e);return{visible:n.eligible,disabledReason:n.reason}}canRenderSurveyAsync(e,n){return Fs(this._surveyManager)?(_l.warn("init was not called"),Promise.resolve({visible:!1,disabledReason:Gk})):new Promise(o=>{this.getSurveys(i=>{var r;const s=(r=i.find(a=>a.id===e))!==null&&r!==void 0?r:null;if(s){const a=this.Xh(s);o({visible:a.eligible,disabledReason:a.reason})}else o({visible:!1,disabledReason:"Survey not found"})},n)})}renderSurvey(e,n,o){var i;if(!this.wo.isCapturing())return;if(Fs(this._surveyManager))return void _l.warn("init was not called");const r=typeof e=="string"?this.Jh(e):e;if(!r?.id)return void _l.warn("Survey not found");if(!A9n.includes(r.type))return void _l.warn(`Surveys of type ${r.type} cannot be rendered in the app`);const s=No?.querySelector(n);if(s){if(!((i=r.appearance)===null||i===void 0)&&i.surveyPopupDelaySeconds){_l.info(`Rendering survey ${r.id} with delay of ${r.appearance.surveyPopupDelaySeconds} seconds`);const a=setTimeout(()=>{var A,c;this.Fh.delete(a),!this.To&&this.wo.isCapturing()&&(_l.info(`Rendering survey ${r.id} with delay of ${(A=r.appearance)===null||A===void 0?void 0:A.surveyPopupDelaySeconds} seconds`),(c=this._surveyManager)===null||c===void 0||c.renderSurvey(r,s,o),_l.info(`Survey ${r.id} rendered`))},1e3*r.appearance.surveyPopupDelaySeconds);return void this.Fh.add(a)}this._surveyManager.renderSurvey(r,s,o)}else _l.warn("Survey element not found")}displaySurvey(e,n){var o;if(!this.wo.isCapturing())return;if(Fs(this._surveyManager))return void _l.warn("init was not called");const i=this.Jh(e);if(!i)return void _l.warn("Survey not found");let r=i;if(!((o=i.appearance)===null||o===void 0)&&o.surveyPopupDelaySeconds&&n.ignoreDelay&&(r=sn(sn({},i),{},{appearance:sn(sn({},i.appearance),{},{surveyPopupDelaySeconds:0})})),n.displayType!==D2e.Popover&&n.initialResponses&&_l.warn("initialResponses is only supported for popover surveys. prefill will not be applied."),n.ignoreConditions===!1){const s=this.Kh(i);if(!s.eligible)return void _l.warn("Survey is not eligible to be displayed: ",s.reason)}n.displayType!==D2e.Inline?this._surveyManager.handlePopoverSurvey(r,n):this.renderSurvey(r,n.selector,n.properties)}cancelPendingSurvey(e){Fs(this._surveyManager)?_l.warn("init was not called"):this._surveyManager.cancelSurvey(e)}handlePageUnload(){var e,n;(e=this._surveyManager)===null||e===void 0||(n=e.handlePageUnload)===null||n===void 0||n.call(e)}};function Yk(t,e,n){if(Fs(t))return!1;switch(n){case"exact":return t===e;case"contains":{const o=e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/_/g,".").replace(/%/g,".*");return new RegExp(o,"i").test(t)}case"regex":try{return new RegExp(e).test(t)}catch{return!1}default:return!1}}var R9n=class{constructor(e){this._instance=e,this.Yh=new Set,this.tc=new Set,this.ec=new gne,this.nc=(n,o)=>this.sc(n,o)&&this.rc(n,o)&&this.oc(n,o)&&this.ac(n,o),this.sc=(n,o)=>!o?.event||n?.event===o?.event}init(){var e,n;Eo((e=this._instance)===null||e===void 0?void 0:e._addCaptureHook)||(this.lc=(n=this._instance)===null||n===void 0?void 0:n._addCaptureHook((o,i)=>{this.on(o,i)}))}dispose(){var e,n;(e=this.lc)===null||e===void 0||e.call(this),this.lc=void 0,(n=this._instance)===null||n===void 0||(n=n.autocapture)===null||n===void 0||n.setElementSelectors(new Set,this),this.ec=new gne}register(e){var n,o;if(!Eo((n=this._instance)===null||n===void 0?void 0:n._addCaptureHook)&&(e.forEach(i=>{var r;this.Yh.add(i),(r=i.steps)===null||r===void 0||r.forEach(s=>{this.tc.add(s?.event||"")})}),(o=this._instance)===null||o===void 0?void 0:o.autocapture)){const i=new Set;this.Yh.forEach(r=>{var s;(s=r.steps)===null||s===void 0||s.forEach(a=>{a?.selector&&i.add(a.selector)})}),this._instance.autocapture.setElementSelectors(i,this)}}replace(e){this.Yh.clear(),this.tc.clear(),this.register(e)}on(e,n){n!=null&&e.length!=0&&(this.tc.has(e)||this.tc.has(n.event))&&this.Yh.forEach(o=>{this.uc(n,o)&&this.ec.emit("actionCaptured",o.name)})}hc(e){this.onAction("actionCaptured",n=>e(n))}uc(e,n){if(n?.steps==null)return!1;for(const o of n.steps)if(this.nc(e,o))return!0;return!1}onAction(e,n){return this.ec.on(e,n)}rc(e,n){if(n?.url){var o;const i=e==null||(o=e.properties)===null||o===void 0?void 0:o.$current_url;if(!i||typeof i!="string"||!Yk(i,n.url,n.url_matching||"contains"))return!1}return!0}oc(e,n){return!!this.cc(e,n)&&!!this.dc(e,n)&&!!this.vc(e,n)}cc(e,n){var o;if(!n?.href)return!0;const i=this.fc(e);if(i.length>0)return i.some(s=>Yk(s.href,n.href,n.href_matching||"exact"));const r=(e==null||(o=e.properties)===null||o===void 0?void 0:o.$elements_chain)||"";return!!r&&Yk((function(s){const a=s.match(/(?::|")href="(.*?)"/);return a?a[1]:""})(r),n.href,n.href_matching||"exact")}dc(e,n){var o;if(!n?.text)return!0;const i=this.fc(e);if(i.length>0)return i.some(c=>Yk(c.text,n.text,n.text_matching||"exact")||Yk(c.$el_text,n.text,n.text_matching||"exact"));const r=(e==null||(o=e.properties)===null||o===void 0?void 0:o.$elements_chain)||"";return!!r&&(s=(function(c){const l=[],g=/(?::|")text="(.*?)"/g;let u;for(;!Fs(u=g.exec(c));)l.includes(u[1])||l.push(u[1]);return l})(r),a=n.text,A=n.text_matching||"exact",s.some(c=>Yk(c,a,A)));var s,a,A}vc(e,n){var o,i;if(!n?.selector)return!0;const r=e==null||(o=e.properties)===null||o===void 0?void 0:o.$element_selectors;if(r?.includes(n.selector))return!0;const s=(e==null||(i=e.properties)===null||i===void 0?void 0:i.$elements_chain)||"";if(n.selector_regex&&s)try{return new RegExp(n.selector_regex).test(s)}catch{return!1}return!1}fc(e){var n;return(e==null||(n=e.properties)===null||n===void 0?void 0:n.$elements)==null?[]:e?.properties.$elements}ac(e,n){return!n?.properties||n.properties.length===0||Tat(n.properties.reduce((o,i)=>{const r=As(i.value)?i.value.map(String):i.value!=null?[String(i.value)]:[];return o[i.key]={values:r,operator:i.operator||"exact"},o},{}),e?.properties)}},T9n=class{constructor(e,n){var o,i;this.gc=[],this._instance=e,this.mc=n,this.yc=new Map,this.bc=new Map,this._c=new Map,this.wc=(o=this._instance)===null||o===void 0||(i=o.onSessionId)===null||i===void 0?void 0:i.call(o,r=>this.kc(r))}Sc(e){return!1}xc(){return null}Cc(e){}$c(){}Tc(e,n){return!!e&&Tat(e.propertyFilters,n?.properties)}Ic(e,n){const o=new Map;return e.forEach(i=>{var r;(r=i.conditions)===null||r===void 0||(r=r[n])===null||r===void 0||(r=r.values)===null||r===void 0||r.forEach(s=>{if(s?.name){const a=o.get(s.name)||[];a.push(i.id),o.set(s.name,a)}})}),o}Mc(e,n,o){const i=(o===lV.Activation?this.yc:this.bc).get(e);let r=[];return this.Ec(s=>{r=s.filter(a=>i?.includes(a.id))}),r.filter(s=>{var a;const A=(a=s.conditions)===null||a===void 0||(a=a[o])===null||a===void 0||(a=a.values)===null||a===void 0?void 0:a.find(c=>c.name===e);return this.Tc(A,n)})}register(e){this.Pc(e,!1)}replace(e){this.Pc(e,!0)}Pc(e,n){var o;Eo((o=this._instance)===null||o===void 0?void 0:o._addCaptureHook)||(this.Rc(e,n),this.Ac(e,n))}Ac(e,n){const o=e.filter(s=>{var a;return(a=s.conditions)===null||a===void 0||(a=a.actions)===null||a===void 0||(a=a.values)===null||a===void 0?void 0:a.length});var i;if(n&&this._c.clear(),o.length===0)return void(n&&((i=this.Fc)===null||i===void 0||i.replace([])));this.Fc||(this.Fc=new R9n(this._instance),this.Fc.init(),this.Fc.hc(s=>this.onAction(s)));const r=[];o.forEach(s=>{var a;(a=s.conditions)===null||a===void 0||(a=a.actions)===null||a===void 0||a.values.forEach(A=>{if(r.push(A),A.name){var c;const l=(c=this._c.get(A.name))!==null&&c!==void 0?c:[];l.includes(s.id)||l.push(s.id),this._c.set(A.name,l)}})}),n?this.Fc.replace(r):this.Fc.register(r)}Oc(e,n){n.forEach((o,i)=>{var r;const s=(r=e.get(i))!==null&&r!==void 0?r:[];o.forEach(a=>{s.includes(a)||s.push(a)}),e.set(i,s)})}Rc(e,n){var o,i;const r=e.filter(c=>{var l,g;return((l=c.conditions)===null||l===void 0?void 0:l.events)&&((g=c.conditions)===null||g===void 0||(g=g.events)===null||g===void 0||(g=g.values)===null||g===void 0?void 0:g.length)>0}),s=e.filter(c=>{var l,g;return((l=c.conditions)===null||l===void 0?void 0:l.cancelEvents)&&((g=c.conditions)===null||g===void 0||(g=g.cancelEvents)===null||g===void 0||(g=g.values)===null||g===void 0?void 0:g.length)>0}),a=this.Ic(e,lV.Activation),A=this.Ic(e,lV.Cancellation);n?(this.yc=a,this.bc=A):(this.Oc(this.yc,a),this.Oc(this.bc,A)),(r.length!==0||s.length!==0||e.some(c=>{var l;return(l=c.conditions)===null||l===void 0||(l=l.actions)===null||l===void 0||(l=l.values)===null||l===void 0?void 0:l.length}))&&((o=this.lc)!==null&&o!==void 0||(this.lc=(i=this._instance)===null||i===void 0?void 0:i._addCaptureHook((c,l)=>{this.onEvent(c,l)})))}onEvent(e,n){var o,i;const r=this.Dc(),s=(n==null||(o=n.properties)===null||o===void 0?void 0:o.$survey_id)||(n==null||(i=n.properties)===null||i===void 0?void 0:i.$product_tour_id);if(s&&this.getActivatedIds().includes(s)){const A=this.Lc(e,s,n);if(A==="consume")return r.info("event consumed activated item, removing it",{event:e,itemId:s}),void this.Nc([s]);if(A==="persist")return r.info("shown item promoted to persisted activation",{event:e,itemId:s}),this.qc(s),void this.jc([s])}if(this.bc.has(e)){const A=this.Mc(e,n,lV.Cancellation);A.length>0&&(r.info("cancel event matched, cancelling items",{event:e,itemsToCancel:A.map(c=>c.id)}),this.Nc(A.map(c=>c.id)),A.forEach(c=>this.Bc(c.id)))}if(!this.yc.has(e))return;r.info("event name matched",{event:e,eventPayload:n,items:this.yc.get(e)});const a=this.Mc(e,n,lV.Activation);this.Hc(a.map(A=>A.id))}onAction(e){this._c.has(e)&&this.Hc(this._c.get(e)||[])}Hc(e){var n,o;if(e.length===0)return;const i=!!(!((n=this._instance)===null||n===void 0||(o=n.get_session_id)===null||o===void 0)&&o.call(n)),r=[];for(const s of e)i&&this.Sc(s)?this.qc(s)&&this.zc(s):r.push(s);r.length>0&&(this.gc=[...new Set([...this.gc,...r])]),this.Dc().info("updating activated items",{activatedItems:this.getActivatedIds()}),this.Uc()}qc(e){this.gc=this.gc.filter(o=>o!==e);const n=this.Wc();return!n.includes(e)&&(this.Vc([...n,e]),this.Gc(),!0)}Nc(e){const n=new Set(e);this.gc=this.gc.filter(r=>!n.has(r));const o=this.Zc(),i=o.filter(r=>!n.has(r));i.length!==o.length&&(this.Vc(i),i.length===0&&this.Qc()),this.jc(e),this.Uc()}Uc(){try{var e;(e=this.mc)===null||e===void 0||e.call(this)}catch(n){this.Dc().error("Error while handling activated items change",n)}}Jc(){var e;const n=this.xc();if(!n)return{};const o=(e=this._instance)===null||e===void 0||(e=e.persistence)===null||e===void 0?void 0:e.props[n];return o&&typeof o=="object"?o:{}}zc(e){if(!this.xc())return;const n=this.Jc();this.Cc(sn(sn({},n),{},{[e]:Date.now()}))}jc(e){if(!this.xc())return;const n=this.Jc(),o={};let i=!1;for(const[r,s]of Object.entries(n))e.includes(r)?i=!0:o[r]=s;i&&(nx(o)?this.$c():this.Cc(o))}Kc(){this.xc()&&this.$c()}getActivationTimestamp(e){if(!this.Wc().includes(e))return;const n=this.Jc()[e];return jd(n)?n:void 0}Zc(){var e;const n=this.Xc();return((e=this._instance)===null||e===void 0||(e=e.persistence)===null||e===void 0?void 0:e.props[n])||[]}Wc(){var e,n,o;const i=this.Zc();if(i.length===0)return[];const r=(e=this._instance)===null||e===void 0||(e=e.persistence)===null||e===void 0?void 0:e.props[this.Yc()],s=(n=this._instance)===null||n===void 0||(o=n.get_session_id)===null||o===void 0?void 0:o.call(n);return s&&r===s?i:[]}Gc(){var e,n;const o=(e=this._instance)===null||e===void 0||(n=e.get_session_id)===null||n===void 0?void 0:n.call(e);o&&this.td(o)}Qc(){this.ed()}kc(e){var n;const o=(n=this._instance)===null||n===void 0||(n=n.persistence)===null||n===void 0?void 0:n.props[this.Yc()];if(o&&o!==e){const i=this.Zc(),r=this.Jc();i.length>0&&(this.Vc([]),i.filter(s=>jd(r[s])).forEach(s=>this.Bc(s))),this.Qc(),this.Kc(),i.length>0&&this.Uc()}}getActivatedIds(){return[...new Set([...this.Wc(),...this.gc])].filter(e=>!this.nd(e))}dispose(){var e,n,o;(e=this.wc)===null||e===void 0||e.call(this),this.wc=void 0,(n=this.lc)===null||n===void 0||n.call(this),this.lc=void 0,(o=this.Fc)===null||o===void 0||o.dispose(),this.Fc=void 0}reset(){this.gc=[],this.Zc().length>0&&this.Vc([]),this.Qc(),this.Kc(),this.Uc()}getEventToItemsMap(){return this.yc}sd(){return this.Fc}},k9n=class extends T9n{constructor(e,n){super(e,n)}Xc(){return Xrt}Yc(){return $rt}xc(){return Zrt}Cc(e){var n;(n=this._instance)===null||n===void 0||(n=n.persistence)===null||n===void 0||n.register({$surveys_activated_timestamps:e})}$c(){var e;(e=this._instance)===null||e===void 0||(e=e.persistence)===null||e===void 0||e.unregister("$surveys_activated_timestamps")}Sc(e){var n;let o;this.Ec(r=>{o=r.find(s=>s.id===e)});const i=o==null||(n=o.appearance)===null||n===void 0?void 0:n.surveyPopupDelaySeconds;return jd(i)&&i>0}rd(){return D3.SHOWN}Ec(e){var n;(n=this._instance)===null||n===void 0||n.getSurveys(e)}Bc(e){var n;(n=this._instance)===null||n===void 0||n.cancelPendingSurvey(e)}Dc(){return _l}Vc(e){var n;(n=this._instance)===null||n===void 0||(n=n.persistence)===null||n===void 0||n.register({$surveys_activated:e})}td(e){var n;(n=this._instance)===null||n===void 0||(n=n.persistence)===null||n===void 0||n.register({$surveys_activated_session:e})}ed(){var e;(e=this._instance)===null||e===void 0||(e=e.persistence)===null||e===void 0||e.unregister("$surveys_activated_session")}nd(){return!1}Lc(e,n,o){var i;if(e===D3.SENT&&(o==null||(i=o.properties)===null||i===void 0?void 0:i.$survey_completed)===!1)return"ignore";let r;return this.Ec(s=>{r=s.find(a=>a.id===n)}),!r||(function(s){var a;return Nat(s)&&!!(!((a=s.conditions)===null||a===void 0||(a=a.events)===null||a===void 0)&&a.repeatedActivation)||s.schedule==="always"})(r)?e===D3.SHOWN?"consume":"ignore":e===D3.SHOWN?"persist":e===D3.DISMISSED||e===D3.SENT?"consume":"ignore"}getSurveys(){return this.getActivatedIds()}getEventToSurveys(){return this.getEventToItemsMap()}},F9n=class{constructor(e){this._instance=e}initialize(){}get(e){if(typeof e=="string")return this._instance.get_property(e);const n={};for(const o of e){const i=this._instance.get_property(o);Eo(i)||(n[o]=i)}return n}set(e,n){this._instance.register(typeof e=="string"?{[e]:n}:e)}remove(e){typeof e!="string"?e.forEach(n=>this._instance.unregister(n)):this._instance.unregister(e)}},L9n=class{constructor(e){this._instance=e}get(){const e=this._instance.config;return{disableSurveys:e.disable_surveys,cookielessMode:!!e.cookieless_mode,advancedEnableSurveys:e.advanced_enable_surveys,requestTimeoutMs:e.surveys_request_timeout_ms}}isOptedOut(){return this._instance.consent.isOptedOut()}isCapturing(){return this._instance.is_capturing()}getExtensions(){const e=Ur?.__PosthogExtensions__;if(!e)return;const{generateSurveys:n,loadExternalDependency:o}=e;return{generateSurveys:n?i=>n(this._instance,i):void 0,loadExternalDependency:o?i=>o(this._instance,"surveys",i):void 0}}createEventReceiver(e){return new k9n(this._instance,e)}onMatchingConditionsChanged(e){const n=this._instance._addCaptureHook(s=>{s!=="$pageview"&&s!==D3.SHOWN&&s!==D3.DISMISSED&&s!==D3.SENT||e()}),o=()=>e();jc(Fn,"PHSurveyShown",o);let i=!1;const r=this._instance.onFeatureFlags(()=>{i&&e()});return i=!0,()=>{i=!1,n(),r(),Fn?.removeEventListener("PHSurveyShown",o)}}};const H9n=Fn?.location?ine(Fn.location.hash,"__posthog")||ine(location.hash,"state"):null,tAt="_postHogToolbarParams",nAt=Ad("[Toolbar]"),oAt=Ad("[FeatureFlags]");var O9n=class{constructor(e,n=!1){this.od=!1,this.update(e,n)}update(e,n){this.ad=((o,i)=>{var r,s,a,A,c,l,g,u;return{bootstrap:{featureFlags:(r=(s=o.bootstrap)===null||s===void 0?void 0:s.featureFlags)!==null&&r!==void 0?r:void 0,featureFlagPayloads:(a=(A=o.bootstrap)===null||A===void 0?void 0:A.featureFlagPayloads)!==null&&a!==void 0?a:void 0},remoteRequestsDisabled:i,featureFlagsDisabled:!!o.advanced_disable_feature_flags,onlyEvaluateSurveyFeatureFlags:!!o.advanced_only_evaluate_survey_feature_flags,deduplicateCallsPerSession:!!o.advanced_feature_flags_dedup_per_session,cacheTtlMs:o.feature_flag_cache_ttl_ms,refreshIntervalMs:(c=o.remote_config_refresh_interval_ms)!==null&&c!==void 0?c:3e5,idleRefreshBackoff:Eo(o.remote_config_refresh_interval_ms),requestTimeoutMs:o.feature_flag_request_timeout_ms,requestMaxRetries:Math.max(0,(l=o.feature_flag_request_max_retries)!==null&&l!==void 0?l:1),compression:o.disable_compression?void 0:"best-available",evaluationContexts:(g=(u=o.evaluation_contexts)!==null&&u!==void 0?u:o.evaluation_environments)!==null&&g!==void 0?g:[],flagKeys:As(o.flag_keys)?o.flag_keys:void 0}})(e,n),!e.evaluation_environments||e.evaluation_contexts||this.od||(oAt.warn("evaluation_environments is deprecated. Use evaluation_contexts instead. evaluation_environments will be removed in a future version."),this.od=!0),Eo(e.flag_keys)||As(e.flag_keys)||oAt.error("Invalid flag_keys found:",e.flag_keys,"Expected array of non-empty strings")}get(){return this.ad}};const iAt=Ad("[FeatureFlags]"),FM=Ad("[FeatureFlags]",{debugEnabled:!0}),Z2e=`" failed. Feature flags didn't load in time.`,G9n=[502,504],rAt=["click","keydown","wheel","touchstart","pointerdown"],sAt="connection_error",aAt=t=>{const e={};for(let n=0;t.length>n;n++)e[t[n]]=!0;return e},AAt=t=>{const e={};for(const[n,o]of tne(t||{}))o&&(e[n]=o);return e},cAt=t=>xk(t)&&(t.name==="RangeError"&&t.message.indexOf("Maximum call stack size exceeded")===0||t.name==="InternalError"&&t.message==="too much recursion"),L4=Ad("[Error tracking]"),exe="webkit-masked-url:",Y9n=[{value:"isolatedAPI.contexts.topHostname",exact:!1},{value:"No response from target",exact:!0}],U9n=["chrome-extension://","moz-extension://","safari-extension:","safari-web-extension:",exe],K9n=["__firefox__","__gCrWeb"],lAt="Refusing to render web experiment since the viewer is a likely bot",V9n={icontains:(t,e)=>e.toLowerCase().indexOf(t.toLowerCase())>-1,not_icontains:(t,e)=>e.toLowerCase().indexOf(t.toLowerCase())===-1,regex:(t,e)=>une(e,t),not_regex:(t,e)=>!une(e,t),exact:(t,e)=>e===t,is_not:(t,e)=>e!==t},p5=Ad("[Conversations]"),LM="Conversations not available yet.";function gAt(t,e){var n,o,i,r,s,a,A;const c=(n=t?.flushIntervalMs)!==null&&n!==void 0?n:3e3,l=(o=t?.maxBufferSize)!==null&&o!==void 0?o:100,g=e?.consoleCapture?void 0:(i=t?.maxLogsPerInterval)!==null&&i!==void 0?i:1e3,u=Eo(g)?Math.max(l,2048):Math.max(l,g),h=sn(sn({},(function(){let d="",p="";try{const m=F_?.userAgent;m&&([d,p]=ort(m))}catch{}return(function(m,_){const f=(function(I){if(I)return{}.hasOwnProperty.call(Drt,I)?Drt[I]:I})(m);return sn(sn({},f?{"os.name":f}:{}),_?{"os.version":_}:{})})(d,p)})()),t?.resourceAttributes);return{serviceName:(r=(s=h?.["service.name"])!==null&&s!==void 0?s:t?.serviceName)!==null&&r!==void 0?r:e?.serviceNameDefault,serviceVersion:(a=h?.["service.version"])!==null&&a!==void 0?a:t?.serviceVersion,environment:(A=h?.["deployment.environment"])!==null&&A!==void 0?A:t?.environment,resourceAttributes:h,beforeSend:t?.beforeSend,flushIntervalMs:c,maxBufferSize:l,maxQueueSize:u,maxBatchRecordsPerPost:100,rateCapWindowMs:c,maxLogsPerInterval:g,backgroundFlushBudgetMs:0,terminationFlushBudgetMs:0}}const z9n=["debug","log","warn","error","info"],J9n=t=>{for(;t?.__rrweb_original__;)t=t.__rrweb_original__;return t},uAt="console",dAt="__posthogHandledLogsRequestError",txe=(t,e)=>{const n=t instanceof Error?t:new Error(e);return n[dAt]=!0,n},hAt=t=>!!t&&typeof t=="object"&&t[dAt]===!0,pne=Ad("[NetworkMetrics]"),nxe=()=>{var t;return!(Fn==null||(t=Fn.performance)===null||t===void 0)&&t.now?Fn.performance.now():Date.now()},W9n={"http:":80,"https:":443},j9n=new Set(["CONNECT","DELETE","GET","HEAD","OPTIONS","PATCH","POST","PUT","TRACE"]),pAt=(t,e)=>{var n;const o=String(e);return{method:String(t).toUpperCase(),url:((n=x8(o))===null||n===void 0?void 0:n.href)||o}},oxe=(t,e,n,o,i,r,s=!1)=>{try{var a,A;const c=i();if(!c)return;const l=n||void 0,g=nxe()-o,u=x8(e.url);if(u&&u.protocol!=="http:"&&u.protocol!=="https:")return;const h={url:u?.href||e.url,method:e.method},d=L_(c.name)?c.name(h):nA(c.name)?c.name:"http.client.request.duration";if(!d)return;const p=s&&!l?void 0:((_,f)=>_?400>_?void 0:String(_):f?.name||"_OTHER")(l,r),m=sn(sn(sn(sn(sn({},(_=>{const f=j9n.has(_)?_:"_OTHER";return sn({"http.request.method":f},f==="_OTHER"&&_!==f?{"http.request.method_original":_}:{})})(h.method)),u?(_=>{return{"server.address":_.hostname.startsWith("[")&&_.hostname.endsWith("]")?_.hostname.slice(1,-1):_.hostname,"server.port":Number(_.port)||W9n[_.protocol],"url.scheme":_.protocol.slice(0,-1),"url.template":(f=_.pathname,f.split("/").map(I=>(C=>/^\d+$/.test(C)||C.length>=8&&/^[0-9a-f-]*\d[0-9a-f-]*$/i.test(C))(I)?":id":I).join("/"))};var f})(u):{}),l?{"http.response.status_code":l}:{}),p?{"error.type":p}:{}),(a=c.attributes)===null||a===void 0?void 0:a.call(c,h,{status:l,durationMs:g}));(A=t.metrics)===null||A===void 0||A.histogram(d,g,{unit:"ms",attributes:m})}catch(c){pne.error("Failed to record network metric",c)}},mAt=()=>{},q9n=(t,e)=>L_(Fn?.fetch)?CV(Fn,"fetch",n=>function(...o){const i=nxe(),r=n.apply(this,o);if(!e())return r;try{var s,a,A;const[c,l]=o,g=pAt((s=(a=l?.method)!==null&&a!==void 0?a:c?.method)!==null&&s!==void 0?s:"GET",(A=c?.url)!==null&&A!==void 0?A:c);return r.then(u=>(oxe(t,g,u?.status,i,e,void 0,!0),u),u=>{throw oxe(t,g,void 0,i,e,u),u})}catch(c){return pne.error("Failed to observe fetch",c),r}}):mAt,X9n=(t,e)=>{var n;const o=Fn==null||(n=Fn.XMLHttpRequest)===null||n===void 0?void 0:n.prototype;if(!o)return mAt;const i=new WeakMap,r=CV(o,"open",a=>function(...A){try{mat.has(this)||i.set(this,pAt(A[0],A[1]))}catch(c){pne.error("Failed to observe XHR open",c)}return a.apply(this,A)}),s=CV(o,"send",a=>function(...A){let c;try{const l=i.get(this);if(l&&e()){const g=nxe();c=()=>{this.removeEventListener("loadend",c),oxe(t,l,this.status,g,e)},jc(this,"loadend",c)}}catch(l){pne.error("Failed to observe XHR send",l)}try{return a.apply(this,A)}catch(l){throw c&&this.removeEventListener("loadend",c),l}});return()=>{r(),s()}},mne={featureFlags:class{constructor(t){this.name="featureFlags",this.ld=!1,this.featureFlagEventHandlers=[],this.A=iAt,this.ud={},this.hd={},this.dd=[],this.vd=!1,this.fd=!1,this.pd=0,this.gd=!1,this.md=!1,this.yd=!1,this.bd=!1,this._d=0,this.wd=!1,this.rn=()=>{const e=this.kd();this._d=0,e&&this.reloadFeatureFlags()},this.Sd=()=>{var e,n;const o=this.xd,i=(e=this.Cd)!==null&&e!==void 0?e:o;Eo(o)||Eo(i)||this.Ir.remoteRequestsDisabled||!No||No.visibilityState==="hidden"||Date.now()-((n=this.$d)!==null&&n!==void 0?n:0)<i||(this.Cd=this.wd||!this.Ir.idleRefreshBackoff?o:Math.min(2*i,36e5),this.wd=!1,this.reloadFeatureFlags(),this.Td())},this.Id=()=>{this.wd&&this.Cd===this.xd||this.Md()},this.sn=()=>{No?.visibilityState==="visible"&&this.Md()},"get"in t?this.wo=t:(this._instance=t,this.Ed=new O9n(t.config,t.il()),this.wo=this.Ed)}updateConfig(t,e){var n;(n=this.Ed)===null||n===void 0||n.update(t,e),this.bo&&this.Pd()}setup(t){return this.Nh=t,this.A=t.logger.createLogger("[FeatureFlags]"),Zat(t.kv.initialize(),()=>{this.Nh===t&&(this.Nh=void 0,this.bo=t,this.Rd(t))})}Rd(t){var e;if(this.bo===t)return Fn&&jc(Fn,"online",this.rn),this.Pd(),this.Ad=t.registerDynamicEventProperties(()=>this.Fd()?this.ud:this.hd),this.Od=(e=this._instance)===null||e===void 0||(e=e.persistence)===null||e===void 0?void 0:e.onCrossTabFeatureFlagChange(()=>{this.Dd(),this.Ld(),this.Nd()}),this.Ld(),this.initialize()}Md(){this.wd=!0,this.Cd=this.xd,this.Sd()}Pd(){const t=this.Ir.refreshIntervalMs,e=!this.Ir.remoteRequestsDisabled&&No&&!Eo(t)&&t>0?t:void 0;this.Ir.idleRefreshBackoff||(this.Cd=e),e!==this.xd&&(this.qd(),Eo(e)||(this.xd=e,this.Cd=e,this.Td(),No?.addEventListener&&(jc(No,ZK,this.sn),vk(rAt,n=>{jc(No,n,this.Id,{capture:!0})}))))}Td(){Eo(this.xd)||(Eo(this.jd)||clearInterval(this.jd),this.$d=Date.now(),this.jd=setInterval(this.Sd,this.xd))}qd(){var t;Eo(this.jd)||(clearInterval(this.jd),this.jd=void 0,No==null||(t=No.removeEventListener)===null||t===void 0||t.call(No,"visibilitychange",this.sn),vk(rAt,e=>{var n;No==null||(n=No.removeEventListener)===null||n===void 0||n.call(No,e,this.Id,{capture:!0})})),this.xd=void 0,this.Cd=void 0,this.wd=!1,this.$d=void 0}destroy(){this.Bd()}dispose(){this.Bd()}Bd(){var t,e;this.qd(),this.pd++,this.md=!1,this.Nh=void 0,this.bo&&(this.Hd(),(t=this.Ad)===null||t===void 0||t.dispose(),this.Ad=void 0,(e=this.Od)===null||e===void 0||e.call(this),this.Od=void 0,this.dd=[],Fn?.removeEventListener("online",this.rn),this.bo=void 0)}get Ir(){return this.wo.get()}zd(t){var e;return this.Ud&&t in this.Ud?this.Ud[t]:(e=this.bo)===null||e===void 0?void 0:e.kv.get(t)}Dd(){return!!this.Ud&&(this.Ud=void 0,!0)}Wd(){var t;return!Eo((t=this.bo)===null||t===void 0?void 0:t.kv.get("$enabled_feature_flags"))&&this.Dd()}$t(t){this.Vd(()=>{var e;return(e=this.bo)===null||e===void 0?void 0:e.kv.set(t)})}Gd(t,e,n){var o;if(!(!((o=this._instance)===null||o===void 0)&&o.persistence)||!t.$enabled_feature_flags)return;const i=this.zd("$enabled_feature_flags")||{},r=t.$enabled_feature_flags||{},s=e.flags||e.featureFlags,a=e.flags?Object.entries(e.flags).filter(([,_])=>!_?.failed).map(([_])=>_):[],A=!!e.errorsWhileComputingFlags&&!!e.flags,c=A?a:n&&!As(s)?Object.keys(s||{}):Array.from(new Set([...Object.keys(i),...Object.keys(r)])),l=this.zd("$feature_flag_payloads")||{},g=t.$feature_flag_payloads||{},u=A||n?c:Array.from(new Set([...Object.keys(l),...Object.keys(g)])),h=!A&&!n,d=!!h||c,p=!!h||u,m={[C8]:d,[k4]:d,[rQ]:p};t.$feature_flag_details&&(m[PM]=d);for(const _ of[MM,cQ,jK])Eo(t[_])||(m[_]=!0);this._instance.persistence.markCrossTabFeatureFlagChanges(m)}Lt(t){this.Vd(()=>{var e;return(e=this.bo)===null||e===void 0?void 0:e.kv.remove(t)})}Vd(t){try{t()}catch(e){this.A.error("Failed to update feature flag persistence",e)}}Ld(){const t={};for(const o of[C8,rQ,MM,B9]){const i=this.zd(o);Eo(i)||(t[o]=i)}this.ud=t;const e=sn({},t),n=this.zd(k4);if(n)for(const[o,i]of Object.entries(n))e[`$feature/${o}`]=i;this.hd=e}Fd(){const t=this.Ir.cacheTtlMs;if(!t||0>=t)return!1;const e=this.zd(cQ);return typeof e!="number"||Date.now()-e>t}Zd(){return!!this.Fd()&&(this.bd||this.fd||(this.bd=!0,this.A.warn("Feature flag cache is stale, triggering refresh..."),this.reloadFeatureFlags()),!0)}Qd(){const t=this.Ir.evaluationContexts;return t?.length?t.filter(e=>{const n=e&&typeof e=="string"&&e.trim().length>0;return n||this.A.error("Invalid evaluation context found:",e,"Expected non-empty string"),n}):[]}Jd(){const t=this.Ir.flagKeys;if(!Eo(t))return t.filter(e=>{const n=e&&typeof e=="string"&&e.trim().length>0;return n||this.A.error("Invalid flag key found:",e,"Expected non-empty string"),n})}initialize(){var t,e;const n=this.Ir,o=(t=(e=n.bootstrap)===null||e===void 0?void 0:e.featureFlags)!==null&&t!==void 0?t:{};if(Object.keys(o).length){var i,r;const s=(i=(r=n.bootstrap)===null||r===void 0?void 0:r.featureFlagPayloads)!==null&&i!==void 0?i:{},a=Object.keys(o).filter(c=>!Eo(o[c])).reduce((c,l)=>(c[l]=o[l],c),{}),A=Object.keys(s).filter(c=>a[c]).reduce((c,l)=>(c[l]=s[l],c),{});return this.Kd({featureFlags:a,featureFlagPayloads:A},void 0,{persist:!1})}}updateFlags(t,e,n){var o,i;const r=n?.merge&&(o=this.zd("$enabled_feature_flags"))!==null&&o!==void 0?o:{},s=n?.merge&&(i=this.zd("$feature_flag_payloads"))!==null&&i!==void 0?i:{},a=sn(sn({},r),t),A=sn(sn({},s),e),c={};for(const[l,g]of Object.entries(a))c[l]={key:l,enabled:xrt(g),variant:Ert(g),reason:void 0,metadata:Eo(A?.[l])?void 0:{id:0,version:void 0,description:void 0,payload:A[l]}};this.Kd({flags:c})}get hasLoadedFlags(){return this.vd}getFlags(){return Object.keys(this.getFlagVariants())}getFlagsWithDetails(){const t=this.zd(PM),e=this.zd(B9),n=this.zd(DM);if(!n&&!e)return t||{};const o=jg({},t||{}),i=[...new Set([...Object.keys(n||{}),...Object.keys(e||{})])];for(const a of i){var r;const A=o[a],c=e?.[a],l=Eo(c)?(r=A?.enabled)!==null&&r!==void 0&&r:!!c,g=Eo(c)?A?.variant:typeof c=="string"?c:void 0,u=n?.[a],h=sn(sn({},A),{},{enabled:l,variant:l?g??A?.variant:void 0});var s;l!==A?.enabled&&(h.original_enabled=A?.enabled),g!==A?.variant&&(h.original_variant=A?.variant),u&&(h.metadata=sn(sn({},A?.metadata),{},{payload:u,original_payload:A==null||(s=A.metadata)===null||s===void 0?void 0:s.payload})),o[a]=h}return this.ld||(this.A.warn(" Overriding feature flag details!",{flagDetails:t,overriddenPayloads:n,finalDetails:o}),this.ld=!0),o}getAllFeatureFlags(){const t=this.getFlagVariants(),e=this.getFlagPayloads();return Object.keys(t).map(n=>{const o=t[n];return{key:n,enabled:xrt(o),variant:Ert(o),payload:yrt(e[n])}})}getFlagVariants(){const t=this.zd(k4),e=this.zd(B9);if(!e)return t||{};const n=jg({},t||{}),o=Object.keys(e);for(let i=0;o.length>i;i++)n[o[i]]=e[o[i]];return this.ld||(this.A.warn(" Overriding feature flags!",{enabledFlags:t,overriddenFlags:e,finalFlags:n}),this.ld=!0),n}getFlagPayloads(){const t=this.zd(rQ),e=this.zd(DM);if(!e)return t||{};const n=jg({},t||{}),o=Object.keys(e);for(let i=0;o.length>i;i++)n[o[i]]=e[o[i]];return this.ld||(this.A.warn(" Overriding feature flag payloads!",{flagPayloads:t,overriddenPayloads:e,finalPayloads:n}),this.ld=!0),n}reloadFeatureFlags(){this.gd||this.Ir.featureFlagsDisabled||this.kd()||(this.fd&&(this.md=!0),this.Xd||(this.dd.slice().forEach(t=>{try{t()}catch(e){this.A.error("Error while running feature flags reloading callback",e)}}),this.Xd=setTimeout(()=>{this.Yd()},5)))}Hd(){clearTimeout(this.Xd),this.Xd=void 0}onReloading(t){return this.dd.push(t),()=>{this.dd=this.dd.filter(e=>e!==t)}}ensureFlagsLoaded(){this.vd||this.fd||this.Xd||this.reloadFeatureFlags()}setAnonymousDistinctId(t){this.$anon_distinct_id=t}setReloadingPaused(t){this.gd=t}resetFlagCallReported(){this.Lt(AQ)}Yd(t){this.Hd();const e=this.bo;if(!e||this.Ir.remoteRequestsDisabled||this.kd())return;if(this.fd)return void(this.md=!0);const n={token:e.projectToken,distinct_id:e.distinctId,groups:e.groups,$anon_distinct_id:this.$anon_distinct_id,person_properties:sn(sn(sn({},e.initialPersonProperties),this.zd("$stored_person_properties")||{}),{},{$lib:e.library.name,$lib_version:e.library.version}),group_properties:this.zd(aQ),timezone:eat()};Eo(e.deviceId)||(n.$device_id=e.deviceId),(t?.disableFlags||this.Ir.featureFlagsDisabled)&&(n.disable_flags=!0);const o=this.Qd();o.length&&(n.evaluation_contexts=o);const i=this.Jd();Eo(i)||(n.flag_keys=i);const r=this.Ir.onlyEvaluateSurveyFeatureFlags,s="/flags/?v=2"+(r?"&only_evaluate_survey_feature_flags=true":""),a=this.pd;this.fd=!0;const A=()=>{this.md&&(this.md=!1,this.Yd())},c=d=>{var p,m;const _=(p=d.json)!==null&&p!==void 0?p:{},f=d.statusCode!==200;if(this.fd=!1,a!==this.pd)return void A();if(this.tv(d.statusCode),f||this.md||(this.$anon_distinct_id=void 0),n.disable_flags&&!this.md)return;this.yd=!f;const I=[];d.error?I.push(d.error instanceof Error&&d.error.name==="AbortError"?"timeout":d.error instanceof Error?sAt:"unknown_error"):d.statusCode!==200&&I.push(`api_error_${d.statusCode}`),_.errorsWhileComputingFlags&&I.push("errors_while_computing_flags");const C=!!(!((m=_.quotaLimited)===null||m===void 0)&&m.includes("feature_flags"));C&&I.push("quota_limited"),this.$t({[$K]:I}),C?this.A.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."):n.disable_flags||this.Kd(_,f,{partialResponse:r}),A()},l=d=>{this.fd=!1,a===this.pd&&(this.$t({[$K]:[sAt]}),this.A.error("Feature flag request failed",d),this.Wd()&&this.Nd(!0)),A()};let g=this.Ir.requestMaxRetries;const u=()=>g>0&&a===this.pd,h=()=>{if(a!==this.pd||!this.bo||this.Ir.remoteRequestsDisabled)return this.fd=!1,void A();try{e.sendRequest(s,{target:"flags",method:"POST",body:n,compression:this.Ir.compression,sentAt:"body",timeoutMs:this.Ir.requestTimeoutMs}).then(d=>{if((p=>G9n.includes(p.statusCode)||(m=>m.statusCode===0&&m.error instanceof Error&&m.error.name==="AbortError")(p))(d)&&u())return g--,void setTimeout(h,500);c(d)}).catch(l)}catch(d){l(d)}};h()}kd(){return Vst(this._d,3)}tv(t){this._d=zst(t,this._d,3,()=>this.A.warn("Feature flag requests are failing before receiving an HTTP response; this can happen due to network issues, CORS, browser blocking, or ad blockers. Stopped refreshing feature flags; will try again when connectivity changes."))}getFeatureFlag(t,e={}){var n;if(e.fresh&&!this.yd)return;if(!(this.vd||this.getFlags()&&this.getFlags().length>0))return void this.A.warn('getFeatureFlag for key "'+t+Z2e);if(this.Zd())return;const o=this.getFeatureFlagResult(t,e);return(n=o?.variant)!==null&&n!==void 0?n:o?.enabled}getFeatureFlagDetails(t){return this.getFlagsWithDetails()[t]}getFeatureFlagPayload(t){const e=this.getFeatureFlagResult(t,{send_event:!1});return e?.payload}getFeatureFlagResult(t,e={}){if(e.fresh&&!this.yd)return;if(!(this.vd||this.getFlags()&&this.getFlags().length>0))return void this.A.warn('getFeatureFlagResult for key "'+t+Z2e);if(this.Zd())return;const n=this.getFlagVariants(),o=t in n,i=n[t],r=this.getFlagPayloads()[t],s=String(i),a=this.zd("$feature_flag_request_id")||void 0,A=this.zd("$feature_flag_evaluated_at")||void 0;let c,l=this.zd("$flag_call_reported")||{};if(this.Ir.deduplicateCallsPerSession){var g;const S=(g=this.bo)===null||g===void 0?void 0:g.session.sessionId,Q=this.zd(XK);S&&S!==Q&&(l={},c=S)}if(e.send_event||!("send_event"in e))if(t in l&&l[t].includes(s))c&&this.$t({[AQ]:l,[XK]:c});else{var u,h,d,p,m,_,f,I,C,y,x,E;As(l[t])?l[t].push(s):l[t]=[s],this.$t(sn({[AQ]:l},c?{[XK]:c}:{}));const S=this.getFeatureFlagDetails(t),Q=[...(u=this.zd("$feature_flag_errors"))!==null&&u!==void 0?u:[]];Eo(i)&&Q.push("flag_missing");const w={$feature_flag:t,$feature_flag_response:i,$feature_flag_payload:r??null,$feature_flag_request_id:a,$feature_flag_evaluated_at:A,$feature_flag_bootstrapped_response:(h=(d=this.Ir.bootstrap)===null||d===void 0||(d=d.featureFlags)===null||d===void 0?void 0:d[t])!==null&&h!==void 0?h:null,$feature_flag_bootstrapped_payload:(p=(m=this.Ir.bootstrap)===null||m===void 0||(m=m.featureFlagPayloads)===null||m===void 0?void 0:m[t])!==null&&p!==void 0?p:null,$used_bootstrap_value:!this.yd};Eo(S==null||(_=S.metadata)===null||_===void 0?void 0:_.has_experiment)||(w.$feature_flag_has_experiment=S.metadata.has_experiment),Eo(S==null||(f=S.metadata)===null||f===void 0?void 0:f.version)||(w.$feature_flag_version=S.metadata.version);const M=(I=S==null||(C=S.reason)===null||C===void 0?void 0:C.description)!==null&&I!==void 0?I:S==null||(y=S.reason)===null||y===void 0?void 0:y.code;var B;M&&(w.$feature_flag_reason=M),!(S==null||(x=S.metadata)===null||x===void 0)&&x.id&&(w.$feature_flag_id=S.metadata.id),Eo(S?.original_variant)&&Eo(S?.original_enabled)||(w.$feature_flag_original_response=Eo(S.original_variant)?S.original_enabled:S.original_variant),!(S==null||(E=S.metadata)===null||E===void 0)&&E.original_payload&&(w.$feature_flag_original_payload=S==null||(B=S.metadata)===null||B===void 0?void 0:B.original_payload),Q.length&&(w.$feature_flag_error=Q.join(",")),this.ev(w)}else c&&this.$t({[AQ]:l,[XK]:c});return o?{key:t,enabled:!!i,variant:typeof i=="string"?i:void 0,payload:yrt(r)}:void 0}ev(t){try{var e;(e=this.bo)===null||e===void 0||e.capture("$feature_flag_called",t)}catch(n){this.A.error("Failed to capture feature flag call",n)}}getRemoteConfigPayload(t,e){this.iv(t,e)}iv(t,e){var n=this;return Wg(function*(){const o=n.bo;if(!o)return;const i={distinct_id:o.distinctId,token:o.projectToken,person_properties:{$lib:o.library.name,$lib_version:o.library.version}},r=n.Qd();r.length&&(i.evaluation_contexts=r);const s=n.Jd();let a;Eo(s)||(i.flag_keys=s);try{var A;const c=(A=(yield o.sendRequest("/flags/?v=2",{target:"flags",method:"POST",body:i,compression:n.Ir.compression,sentAt:"body",timeoutMs:n.Ir.requestTimeoutMs})).json)===null||A===void 0?void 0:A.featureFlagPayloads;a=c?.[t]||void 0}catch(c){return void n.A.error("Remote config feature flag request failed",c)}try{e(a)}catch(c){n.A.error("Remote config feature flag callback failed",c)}})()}isFeatureEnabled(t,e={}){if(e.fresh&&!this.yd)return e.defaultValue;if(!(this.vd||this.getFlags()&&this.getFlags().length>0))return this.A.warn('isFeatureEnabled for key "'+t+Z2e),e.defaultValue;const n=this.getFeatureFlag(t,e);return Eo(n)?e.defaultValue:!!n}addFeatureFlagsHandler(t){this.featureFlagEventHandlers.push(t)}removeFeatureFlagsHandler(t){this.featureFlagEventHandlers=this.featureFlagEventHandlers.filter(e=>e!==t)}receivedFeatureFlags(t,e,n){this.Kd(t,e,n)}Kd(t,e,n){if(!this.bo)return;this.vd=!0;const o=((i,r={},s={},a={},A,c=iAt)=>{const l=((I,C)=>{const y=I.flags;if(y){const x=Object.fromEntries(Object.keys(y).map(B=>{var S;return[B,(S=y[B].variant)!==null&&S!==void 0?S:y[B].enabled]})),E=Object.fromEntries(Object.keys(y).filter(B=>y[B].enabled).filter(B=>{var S;return!Eo((S=y[B].metadata)===null||S===void 0?void 0:S.payload)}).map(B=>{var S;return[B,(S=y[B].metadata)===null||S===void 0?void 0:S.payload]}));return sn(sn({},I),{},{featureFlags:x,featureFlagPayloads:E})}return I.featureFlags&&C.warn("Using an older version of the feature flags endpoint. Please upgrade your PostHog server to the latest version"),I})(i,c),g=l.flags,u=l.featureFlags,h=l.featureFlagPayloads;if(!u)return;const d=i.requestId,p=i.evaluatedAt;if(As(u)){c.warn("v1 of the feature flags endpoint is deprecated. Please use the latest version.");const I={};if(u)for(let C=0;u.length>C;C++)I[u[C]]=!0;return{[C8]:u,[k4]:I,[jK]:!1}}let m=u,_=h,f=g;if(A?.partialResponse){const I=Object.keys(m),C=_||{};m=sn(sn({},r),m),_=sn(sn({},s),C),I.forEach(y=>{y in C||_==null||delete _[y]}),f=sn(sn({},a),f)}else if(i.errorsWhileComputingFlags)if(g){const I=new Set(Object.keys(g).filter(y=>{var x;return!(!((x=g[y])===null||x===void 0)&&x.failed)}));m=sn(sn({},r),Object.fromEntries(Object.entries(m).filter(([y])=>I.has(y))));const C=Object.fromEntries(Object.entries(_||{}).filter(([y])=>I.has(y)));_=sn(sn({},s),C),I.forEach(y=>{y in C||_==null||delete _[y]}),f=sn(sn({},a),Object.fromEntries(Object.entries(f||{}).filter(([y])=>I.has(y))))}else m=sn(sn({},r),m),_=sn(sn({},s),_),f=sn(sn({},a),f);return sn(sn({[C8]:Object.keys(AAt(m)),[k4]:m||{},[rQ]:_||{},[PM]:f||{},[jK]:i.minimalFlagCalledEvents===!0},d?{[MM]:d}:{}),p?{[cQ]:p}:{})})(t,this.getFlagVariants(),this.getFlagPayloads(),this.getFlagsWithDetails(),n,this.A);if(o)if(n?.persist===!1){const i=!Eo(this.bo.kv.get(k4));this.Ud=o,i||this.$t(o)}else this.Dd(),this.Gd(o,t,!!n?.partialResponse),this.$t(o);else e&&this.Wd();e||(this.bd=!1),this.Nd(e)}override(t,e=!1){this.A.warn("override is deprecated. Please use overrideFeatureFlags instead."),this.overrideFeatureFlags({flags:t,suppressWarning:e})}overrideFeatureFlags(t){this.nv(t)}nv(t){if(this.bo){if(t===!1)return this.Lt([B9,DM]),this.Nd(),void FM.info("All overrides cleared");if(As(t))return this.$t({[B9]:aAt(t)}),this.Nd(),void FM.info("Flag overrides set",{flags:t});if(t&&typeof t=="object"&&("flags"in t||"payloads"in t)){var e;const n=t;this.ld=!!((e=n.suppressWarning)!==null&&e!==void 0&&e);const o={},i=n.flags,r=n.payloads;return i&&(o[B9]=As(i)?aAt(i):i),r&&(o[DM]=r),Object.keys(o).length&&this.$t(o),i===!1&&r===!1?this.Lt([B9,DM]):i===!1?this.Lt(B9):r===!1&&this.Lt(DM),this.Nd(),i===!1?FM.info("Flag overrides cleared"):i&&FM.info("Flag overrides set",{flags:i}),void(r===!1?FM.info("Payload overrides cleared"):r&&FM.info("Payload overrides set",{payloads:r}))}if(t&&typeof t=="object")return this.$t({[B9]:t}),this.Nd(),void FM.info("Flag overrides set",{flags:t});this.A.warn("Invalid overrideOptions provided to overrideFeatureFlags",{overrideOptions:t})}else this.A.warn("posthog.featureFlags.overrideFeatureFlags called before feature flags were ready")}onFeatureFlags(t){if(this.addFeatureFlagsHandler(t),this.vd){const{flags:e,flagVariants:n}=this.sv();try{t(e,n)}catch(o){this.A.error("Error while running feature flags callback",o)}}return()=>this.removeFeatureFlagsHandler(t)}updateEarlyAccessFeatureEnrollment(t,e,n){var o;const i=(this.zd("$early_access_features")||[]).find(c=>c.flagKey===t),r={[`$feature_enrollment/${t}`]:e},s={$feature_flag:t,$feature_enrollment:e,$set:r};i&&(s.$early_access_feature_name=i.name),n&&(s.$feature_enrollment_stage=n);const a=sn(sn({},this.getFlagVariants()),{},{[t]:e});(o=this._instance)===null||o===void 0||(o=o.persistence)===null||o===void 0||o.markCrossTabFeatureFlagChanges({$active_feature_flags:[t],$enabled_feature_flags:[t],$stored_person_properties:Object.keys(r)}),this.$t({[C8]:Object.keys(AAt(a)),[k4]:a,[sQ]:sn(sn({},this.zd("$stored_person_properties")||{}),r)}),this.Nd();try{var A;(A=this.bo)===null||A===void 0||A.capture("$feature_enrollment_update",s)}catch(c){this.A.error("Failed to capture early access feature enrollment",c)}}getEarlyAccessFeatures(t,e=!1,n){const o=this.zd(i2e);!o||e?this.rv(t,n):t(o)}rv(t,e){var n=this;return Wg(function*(){const o=n.bo;if(!o)return;const i=e?`&${e.map(s=>`stage=${s}`).join("&")}`:"";let r;try{const s=yield o.sendRequest(`/api/early_access_features/?token=${o.projectToken}${i}`,{target:"api",method:"GET",sentAt:"query"});if(!s.json)return;r=s.json.earlyAccessFeatures,n.$t({[i2e]:r})}catch(s){return void n.A.error("Early access feature request failed",s)}try{t(r)}catch(s){n.A.error("Early access feature callback failed",s)}})()}sv(){const t=this.getFlags(),e=this.getFlagVariants();return{flags:t.filter(n=>e[n]),flagVariants:Object.keys(e).filter(n=>e[n]).reduce((n,o)=>(n[o]=e[o],n),{})}}Nd(t){this.Ld();const{flags:e,flagVariants:n}=this.sv();this.featureFlagEventHandlers.forEach(o=>{try{o(e,n,{errorsLoading:t})}catch(i){this.A.error("Error while running feature flags callback",i)}})}setPersonPropertiesForFlags(t,e=!0){this.ov(t,e)}ov(t,e=!0){const n=this.zd("$stored_person_properties")||{},o=t?.$set||(t?.$set_once?{}:t),i=t?.$set_once,r={};if(i)for(const s in i)({}).hasOwnProperty.call(i,s)&&(s in n||(r[s]=i[s]));this.$t({[sQ]:sn(sn(sn({},n),r),o)}),e&&this.reloadFeatureFlags()}unsetPersonPropertiesForFlags(t,e=!0){const n=sn({},this.zd("$stored_person_properties")||{});t.forEach(o=>{delete n[o]}),this.$t({[sQ]:n}),e&&this.reloadFeatureFlags()}resetPersonPropertiesForFlags(t=!0){this.Lt(sQ),t&&this.reloadFeatureFlags()}setGroupPropertiesForFlags(t,e=!0){const n=this.zd("$stored_group_properties")||{},o=sn({},n);for(const i of Object.keys(t))o[i]=sn(sn({},n[i]),t[i]);this.$t({[aQ]:o}),e&&this.reloadFeatureFlags()}resetGroupPropertiesForFlags(t){if(t){const e=this.zd("$stored_group_properties")||{};this.$t({[aQ]:sn(sn({},e),{},{[t]:{}})})}else this.Lt(aQ)}reset(){this.pd++,this.md=!1,this.ud={},this.hd={},this.Ud=void 0,this.vd=!1,this.gd=!1,this.yd=!1,this.$anon_distinct_id=void 0,this.Hd(),this.ld=!1,this._d=0}}},$9n={sessionRecording:class{get Ir(){return this._instance.config}get Il(){return this._instance.persistence}get started(){var t;return!!(!((t=this.av)===null||t===void 0)&&t.isStarted)}get status(){var t,e;return this.lv==="awaiting_config"||this.lv==="missing_config"?this.lv:(t=(e=this.av)===null||e===void 0?void 0:e.status)!==null&&t!==void 0?t:this.lv}constructor(t){if(this._instance=t,this._forceAllowLocalhostNetworkCapture=!1,this.lv=q2e,this.uv=void 0,this.hv=!1,this.Je=(()=>{var e,n;if(!No?.visibilityState||No.visibilityState==="visible")return!0;const o=Fn==null||(e=Fn.performance)===null||e===void 0||(n=e.getEntriesByType)===null||n===void 0?void 0:n.call(e,"visibility-state");return!o?.length||o.some(i=>i.name==="visible")})(),this.sn=()=>{var e,n;No?.visibilityState==="visible"&&(this.Je=!0,(e=this.av)===null||e===void 0||(n=e.setDocumentWasEverVisible)===null||n===void 0||n.call(e,!0))},!this._instance.sessionManager)throw b8.error("started without valid sessionManager"),new Error("[SessionRecording] started without valid sessionManager. This is a bug.");if(this.Ir.cookieless_mode==="always")throw new Error('[SessionRecording] cannot be used with cookieless_mode="always"');No?.addEventListener&&jc(No,"visibilitychange",this.sn)}initialize(){this.startIfEnabledOrStop()}dispose({discardBufferedEvents:t=!1}={}){var e;this.hv=!0,No==null||(e=No.removeEventListener)===null||e===void 0||e.call(No,"visibilitychange",this.sn),t?this.dv(!0):this.stopRecording()}get vv(){var t;const e=!!(!((t=this._instance.get_property("$session_recording_remote_config"))===null||t===void 0)&&t.enabled),n=!this.Ir.disable_session_recording,o=this.Ir.disable_session_recording||this._instance.consent.isOptedOut();return Fn&&e&&n&&!o}startIfEnabledOrStop(t){var e;if(this.hv||this.vv&&(!((e=this.av)===null||e===void 0)&&e.isStarted))return;const n=!Eo(Object.assign)&&!Eo(Array.from);this.vv&&n?(this.fv(t),b8.info("starting")):(this.lv=q2e,this.stopRecording())}fv(t){var e,n;if(this.vv)if(this.lv!=="awaiting_config"&&this.lv!=="missing_config"&&(this.lv=Xat),(Ur==null||(e=Ur.__PosthogExtensions__)===null||e===void 0||(e=e.rrweb)===null||e===void 0?void 0:e.record)&&((n=Ur.__PosthogExtensions__)===null||n===void 0?void 0:n.initSessionRecording))this.pv(t);else{var o,i;const r=this._instance.sessionManager;(o=Ur.__PosthogExtensions__)===null||o===void 0||(i=o.loadExternalDependency)===null||i===void 0||i.call(o,this._instance,this.gv,s=>{if(!this.hv&&this.vv&&this._instance.sessionManager===r)return s?(this._instance.register_for_session({$sdk_debug_recording_script_not_loaded:!0}),b8.error("could not load recorder",s)):void this.pv(t);this.lv="disabled"})}}stopRecording(){var t,e;(t=this.uv)===null||t===void 0||t.call(this),this.uv=void 0,(e=this.av)===null||e===void 0||e.stop()}dv(t=!1){var e,n;(e=this.uv)===null||e===void 0||e.call(this),this.uv=void 0,(n=this.av)===null||n===void 0||n.discard({discardProducerEvents:t})}mv(){var t,e;(t=this.Il)===null||t===void 0||t.unregister("$session_is_sampled"),(e=this.Il)===null||e===void 0||e.unregister("$replay_sample_rate")}yv(t,e){if(Fs(t))return null;const n=jd(t)?t:parseFloat(t);return typeof(o=n)!="number"||!Number.isFinite(o)||0>o||o>1?(b8.warn(`${e} must be between 0 and 1. Ignoring invalid value:`,t),null):n;var o}bv(t){if(this.Il){var e,n;const o=this.Il,i=()=>{var r;const s=t.sessionRecording===!1?void 0:t.sessionRecording,a=this.yv((r=this.Ir.session_recording)===null||r===void 0?void 0:r.sampleRate,"session_recording.sampleRate"),A=this.yv(s?.sampleRate,"remote config sampleRate"),c=a??A;Fs(c)&&this.mv();const l=s?.minimumDurationMilliseconds;o.register({[WK]:sn(sn({cache_timestamp:Date.now(),enabled:!!s},s),{},{networkPayloadCapture:sn({capturePerformance:t.capturePerformance},s?.networkPayloadCapture),canvasRecording:{enabled:s?.recordCanvas,fps:s?.canvasFps,quality:s?.canvasQuality},sampleRate:c,minimumDurationMilliseconds:Eo(l)?null:l,endpoint:s?.endpoint,triggerMatchType:s?.triggerMatchType,masking:s?.masking,urlTriggers:s?.urlTriggers,version:s?.version,triggerGroups:s?.triggerGroups})})};i(),(e=this.uv)===null||e===void 0||e.call(this),this.uv=(n=this._instance.sessionManager)===null||n===void 0?void 0:n.onSessionId(i)}}onRemoteConfig(t){const e=t.ok?t.config:void 0;return e&&"sessionRecording"in e?e.sessionRecording===!1?(this.bv(e),void this.dv()):(this.bv(e),void this.startIfEnabledOrStop()):(this.lv==="awaiting_config"&&(this.lv="missing_config",this._instance.register_for_session({[l2e]:!0}),b8.warn("config refresh failed, recording will not start until page reload")),void this.startIfEnabledOrStop())}log(t,e="log"){var n;!((n=this.av)===null||n===void 0)&&n.log?this.av.log(t,e):b8.warn("log called before recorder was ready")}get gv(){var t,e;const n=(t=this._instance)===null||t===void 0||(t=t.persistence)===null||t===void 0?void 0:t.get_property(WK);return(n==null||(e=n.scriptConfig)===null||e===void 0?void 0:e.script)||"lazy-recorder"}_v(){const t=this._instance.get_property(WK);if(!t)return!1;let e;try{e=typeof t=="object"?t:JSON.parse(t)}catch(n){return b8.warn("persisted remote config for session recording is invalid and will be ignored",n),!1}return!Fs(e.cache_timestamp)&&36e5>=Date.now()-e.cache_timestamp}pv(t){var e,n,o;if(!this.hv&&this.vv&&this._instance.sessionManager){if(!(!((e=Ur.__PosthogExtensions__)===null||e===void 0)&&e.initSessionRecording))return b8.warn("Called on script loaded before session recording is available. This can be caused by adblockers."),void this._instance.register_for_session({[c2e]:!0});var i;if(this.av||(this.av=(i=Ur.__PosthogExtensions__)===null||i===void 0?void 0:i.initSessionRecording(this._instance,this.Je),this.av._forceAllowLocalhostNetworkCapture=this._forceAllowLocalhostNetworkCapture),!this._v())return this.lv==="missing_config"||this.lv==="awaiting_config"?void 0:(this.lv="awaiting_config",b8.info("persisted remote config is stale, requesting fresh config before starting"),void new sat(this._instance).load());this.lv=Xat,(n=(o=this.av).setDocumentWasEverVisible)===null||n===void 0||n.call(o,this.Je),this.av.start(t)}else this.lv=q2e}onRRwebEmit(t){var e,n;(e=this.av)===null||e===void 0||(n=e.onRRwebEmit)===null||n===void 0||n.call(e,t)}overrideLinkedFlag(){var t,e;this.av||(e=this.Il)===null||e===void 0||e.register({$replay_override_linked_flag:!0}),(t=this.av)===null||t===void 0||t.overrideLinkedFlag()}overrideSampling(){var t,e;this.av||(e=this.Il)===null||e===void 0||e.register({$replay_override_sampling:!0}),(t=this.av)===null||t===void 0||t.overrideSampling()}overrideTrigger(t){var e,n;this.av||(n=this.Il)===null||n===void 0||n.register({[t==="url"?"$replay_override_url_trigger":"$replay_override_event_trigger"]:!0}),(e=this.av)===null||e===void 0||e.overrideTrigger(t)}get sdkDebugProperties(){var t;const e={};for(const o of P9n){var n;const i=(n=this._instance.sessionPersistence)===null||n===void 0?void 0:n.get_property(o);Eo(i)||(e[o]=i)}return sn(sn({},e),((t=this.av)===null||t===void 0?void 0:t.sdkDebugProperties)||{$recording_status:this.status})}tryAddCustomEvent(t,e){var n;return!!(!((n=this.av)===null||n===void 0)&&n.tryAddCustomEvent(t,e))}flushBeforeIdentityReset(){var t,e;(t=this.av)===null||t===void 0||(e=t.flushBeforeIdentityReset)===null||e===void 0||e.call(t)}}},Z9n={autocapture:class extends b9n{constructor(t){super(new S9n(t)),this.instance=t}},historyAutocapture:class{constructor(t){this.wv=!1,this._instance=t,this.Sv=this.xv()}initialize(){this.startIfEnabled()}get isEnabled(){const t=this.Cv();return!!(t.path||t.search||this.$v(t))}startIfEnabled(){this.isEnabled&&(gi.info("History API monitoring enabled, starting..."),this.monitorHistoryChanges())}startIfEnabledOrStop(){this.stop(),this.Sv=this.xv(),this.startIfEnabled()}stop(){this.Tv&&this.Tv(),this.Tv=void 0,this.Iv&&this.Iv(),this.Iv=void 0,gi.info("History API monitoring stopped")}monitorHistoryChanges(){Fn&&Fn.history&&(this.Mv("pushState"),this.Mv("replaceState"),this.Ev(),this.$v()&&this.Pv())}Mv(t){var e;if(!Fn||!((e=Fn.history[t])===null||e===void 0)&&e.__posthog_wrapped__)return;const n=this;CV(Fn.history,t,o=>function(i,r,s){var a;n.Rv(s)&&n.Av(),o.call(this,i,r,s),n.Fv(t,!n.wv&&(Fn==null||(a=Fn.event)===null||a===void 0?void 0:a.type)!=="popstate")})}xv(){const t=Fn?.location;if(t?.pathname)return{pathname:t.pathname,search:t.search,hash:t.hash}}Cv(){const t=this._instance.config.capture_pageview;return t==="history_change"?{path:!0}:xA(t)?t:{}}$v(t=this.Cv()){return!!t.hash&&!this._instance.config.disable_capture_url_hashes}Ov(t){const e=this.Cv(),n=this.Sv;return!(!n||!(e.path&&t.pathname!==n.pathname||e.search&&t.search!==n.search||this.$v(e)&&t.hash!==n.hash))}Fv(t,e=!1){try{e||this.Av();const n=this.xv();if(!n)return;if(this.Ov(n)){const o=()=>this._instance.capture(u2e,{navigation_type:t});e?(this.Dv=o,Promise.resolve().then(()=>this.Av())):o()}this.Sv=n}catch(n){gi.error(`Error capturing ${t} pageview`,n)}}Rv(t){var e,n;return!(Fs(t)||!Fn)&&((e=x8(String(t)))===null||e===void 0?void 0:e.href)!==((n=Fn.location)===null||n===void 0?void 0:n.href)}Av(){const t=this.Dv;if(t){this.Dv=void 0,this.wv=!0;try{t()}catch(e){gi.error("Error capturing deferred pageview",e)}finally{this.wv=!1}this.Sv=this.xv()}}Ev(){if(this.Tv)return;const t=()=>{this.Fv("popstate")};jc(Fn,"popstate",t),this.Tv=()=>{Fn&&Fn.removeEventListener("popstate",t)}}Pv(){if(this.Iv)return;const t=()=>{this.Fv("hashchange")};jc(Fn,"hashchange",t),this.Iv=()=>{Fn&&Fn.removeEventListener("hashchange",t)}}},heatmaps:class{get Ir(){return this.instance.config}constructor(t){var e;this.Lv=!1,this.ko=!1,this.Nv=null,this.instance=t,this.Lv=!!(!((e=this.instance.persistence)===null||e===void 0)&&e.props[$ye]),this.rageclicks=new zat(t.config.rageclick)}initialize(){this.startIfEnabled()}get flushIntervalMilliseconds(){let t=5e3;return xA(this.Ir.capture_heatmaps)&&this.Ir.capture_heatmaps.flush_interval_milliseconds&&(t=this.Ir.capture_heatmaps.flush_interval_milliseconds),t}get isEnabled(){return Fs(this.Ir.capture_heatmaps)?Fs(this.Ir.enable_heatmaps)?this.Lv:this.Ir.enable_heatmaps:this.Ir.capture_heatmaps!==!1}startIfEnabled(){if(this.isEnabled){if(this.ko)return;M9n.info("starting..."),this.qv(),this.sn()}else{var t;clearInterval((t=this.Nv)!==null&&t!==void 0?t:void 0),this.jv(),this.getAndClearBuffer()}}onRemoteConfig(t){if(!t.ok)return;const e=t.config;if(!("heatmaps"in e))return;const n=!!e.heatmaps;this.instance.persistence&&this.instance.persistence.register({[$ye]:n}),this.Lv=n,this.startIfEnabled()}getAndClearBuffer(){const t=this.Rt;return this.Rt=void 0,t}Bv(t){X2e(t.originalEvent)&&this.Mr(t.originalEvent,"deadclick")}sn(){this.Nv&&clearInterval(this.Nv),this.Nv=No?.visibilityState==="visible"?setInterval(this.yl.bind(this),this.flushIntervalMilliseconds):null}qv(){Fn&&No&&(this.Hv=this.yl.bind(this),jc(Fn,ene,this.Hv),this.zv=t=>this.Mr(t||Fn?.event),jc(No,"click",this.zv,{capture:!0}),this.Uv=t=>this.Wv(t||Fn?.event),jc(No,"mousemove",this.Uv,{capture:!0}),this.Vv=new Ost(this.instance,MBn,this.Bv.bind(this)),this.Vv.startIfEnabledOrStop(),this.Gv=this.sn.bind(this),jc(No,ZK,this.Gv),this.ko=!0)}jv(){var t;Fn&&No&&(this.Hv&&Fn.removeEventListener(ene,this.Hv),this.zv&&No.removeEventListener("click",this.zv,{capture:!0}),this.Uv&&No.removeEventListener("mousemove",this.Uv,{capture:!0}),this.Gv&&No.removeEventListener(ZK,this.Gv),clearTimeout(this.Zv),(t=this.Vv)===null||t===void 0||t.stop(),this.ko=!1)}Qv(t,e){const n=this.instance.scrollManager.scrollY(),o=this.instance.scrollManager.scrollX(),i=this.instance.scrollManager.scrollElement(),r=(function(s,a,A){let c=s;for(;c&&b9(c)&&!j1(c,"body");){if(c===A)return!1;let h;try{var l,g,u;h=(l=(g=(u=c.ownerDocument)===null||u===void 0?void 0:u.defaultView)!==null&&g!==void 0?g:Fn)===null||l===void 0?void 0:l.getComputedStyle(c).position}catch{return!1}if(as(a,h))return!0;c=Qst(c)}return!1})(oV(t),["fixed","sticky"],i);return{x:t.clientX+(r?0:o),y:t.clientY+(r?0:n),target_fixed:r,type:e}}Mr(t,e="click"){var n;if(Est(t.target)||!X2e(t))return;const o=this.Qv(t,e);!((n=this.rageclicks)===null||n===void 0)&&n.isRageClick(t.clientX,t.clientY,new Date().getTime())&&Mst(oV(t),this.instance.config.rageclick)&&this.Zs(sn(sn({},o),{},{type:"rageclick"})),this.Zs(o)}Wv(t){!Est(t.target)&&X2e(t)&&(clearTimeout(this.Zv),this.Zv=setTimeout(()=>{this.Zs(this.Qv(t,"mousemove"))},500))}Zs(t){if(!Fn)return;const e=this.Ir.disable_capture_url_hashes?iQ(Fn.location.href):Fn.location.href,n=this.Ir.custom_personal_data_properties,o=this.Ir.mask_personal_data_properties?[...Tk,...n||[]]:[],i=AV(e,o,cV);this.Rt=this.Rt||{},this.Rt[i]||(this.Rt[i]=[]),this.Rt[i].push(t)}yl(){this.Rt&&!nx(this.Rt)&&this.instance.capture("$$heatmap",{$heatmap_data:this.getAndClearBuffer()})}},deadClicksAutocapture:Ost,webVitalsAutocapture:class{constructor(t){var e;this._instance=t,this.Lv=!1,this.ko=!1,this.Rt={navigationKey:void 0,url:void 0,metrics:[],firstMetricTimestamp:void 0},this.Jv=()=>{clearTimeout(this.Kv),this.Kv=void 0,this.Rt.metrics.length!==0&&(this._instance.capture("$web_vitals",sn({$current_url:this.Rt.url},this.Rt.metrics.reduce((n,o)=>sn(sn({},n),{},{[`$web_vitals_${o.name}_event`]:sn({},o),[`$web_vitals_${o.name}_value`]:o.value}),{}))),this.Rt={navigationKey:void 0,url:void 0,metrics:[],firstMetricTimestamp:void 0})},this.Xv=n=>{var o;if(this.Rt=this.Rt||{navigationKey:void 0,url:void 0,metrics:[],firstMetricTimestamp:void 0},Fs(n?.name)||Fs(n?.value))return void kM.error("Invalid metric received",n);const i=typeof n.navigationURL=="string"?n.navigationURL:void 0,r=this.Yv(i);if(Eo(r))return;const s=jd(n.navigationId)||typeof n.navigationId=="string"?`navigation:${n.navigationId}`:`url:${r}`;if(this.tf&&n.value>=this.tf)return void kM.error("Ignoring metric with value >= "+this.tf,n);this.Rt.navigationKey!==s&&(this.Jv(),this.Kv=setTimeout(this.Jv,this.flushToCaptureTimeoutMs)),Eo(this.Rt.navigationKey)&&(this.Rt.navigationKey=s,this.Rt.url=r),this.Rt.firstMetricTimestamp=Eo(this.Rt.firstMetricTimestamp)?Date.now():this.Rt.firstMetricTimestamp;const a=(o=this._instance.sessionManager)===null||o===void 0?void 0:o.checkAndGetSessionAndWindowId(!0),A=sn(sn(sn({},n),i?{navigationURL:r}:{}),{},{$current_url:r,timestamp:Date.now()});if(delete A.entries,xA(n.attribution)&&this.attributionMetrics.indexOf(n.name)>-1){const c={};for(const l of w9n){const g=l==="url"&&typeof n.attribution[l]=="string"?this.Yv(n.attribution[l]):n.attribution[l];Eo(g)||(c[l]=g)}A.attribution=c}else delete A.attribution;Eo(a)||(A.$session_id=a.sessionId,A.$window_id=a.windowId),this.Rt.metrics.push(A),this.Rt.metrics.length===this.allowedMetrics.length&&this.Jv()},this.ef=()=>{if(this.ko)return;let n,o,i,r,s=!1;const a=Ur.__PosthogExtensions__,A=a?.postHogWebVitalsCallbacksByFlavor,c=A?.[this.if]||(this.if==="web-vitals"&&Eo(A)?a?.postHogWebVitalsCallbacks:void 0);if(!Eo(c)){const u=c.withoutAttribution,h=this.attributionMetrics;s=!Eo(u),n=h.indexOf("LCP")>-1?c.onLCP:u?.onLCP||c.onLCP,o=h.indexOf("CLS")>-1?c.onCLS:u?.onCLS||c.onCLS,i=h.indexOf("FCP")>-1?c.onFCP:u?.onFCP||c.onFCP,r=h.indexOf("INP")>-1?c.onINP:u?.onINP||c.onINP}if(!(n&&o&&i&&r))return void kM.error("web vitals callbacks not loaded - not starting");const l={reportSoftNavs:this.useSoftNavs},g=s&&this.attributionMetrics.indexOf("INP")>-1?sn(sn({},l),{},{includeProcessedEventEntries:!1}):l;this.allowedMetrics.indexOf("LCP")>-1&&n(this.Xv.bind(this),l),this.allowedMetrics.indexOf("CLS")>-1&&o(this.Xv.bind(this),l),this.allowedMetrics.indexOf("FCP")>-1&&i(this.Xv.bind(this),l),this.allowedMetrics.indexOf("INP")>-1&&r(this.Xv.bind(this),g),this.ko=!0},this.Lv=!!(!((e=this._instance.persistence)===null||e===void 0)&&e.props[t2e]),this.startIfEnabled()}get nf(){return this._instance.config.capture_performance}get allowedMetrics(){var t,e;const n=xA(this.nf)?(t=this.nf)===null||t===void 0?void 0:t.web_vitals_allowed_metrics:void 0;return Fs(n)?((e=this._instance.persistence)===null||e===void 0?void 0:e.props.$web_vitals_allowed_metrics)||qat:n}get flushToCaptureTimeoutMs(){return(xA(this.nf)?this.nf.web_vitals_delayed_flush_ms:void 0)||5e3}get attributionMetrics(){const t=xA(this.nf)?this.nf.web_vitals_attribution:void 0;return hy(t)?t?qat:[]:As(t)?t:v9n}get useAttribution(){return this.attributionMetrics.length>0}get useSoftNavs(){const t=xA(this.nf)?this.nf.__preview_web_vitals_soft_navs:void 0;return t!=null&&t}get tf(){const t=xA(this.nf)&&jd(this.nf.__web_vitals_max_value)?this.nf.__web_vitals_max_value:jat;return t>0&&6e4>=t?jat:t}get isEnabled(){const t=sd?.protocol;if(t!=="http:"&&t!=="https:")return kM.info("Web Vitals are disabled on non-http/https protocols"),!1;const e=xA(this.nf)?this.nf.web_vitals:hy(this.nf)?this.nf:void 0;return hy(e)?e:this.Lv}startIfEnabled(){this.isEnabled&&!this.ko&&(kM.info("enabled, starting..."),this.Ho(this.ef))}onRemoteConfig(t){if(!t.ok)return;const e=t.config;if(!("capturePerformance"in e))return;const n=xA(e.capturePerformance)&&!!e.capturePerformance.web_vitals,o=xA(e.capturePerformance)?e.capturePerformance.web_vitals_allowed_metrics:void 0;this._instance.persistence&&(this._instance.persistence.register({[t2e]:n}),this._instance.persistence.register({[Wrt]:o})),this.Lv=n,this.startIfEnabled()}get if(){return this.useSoftNavs?this.useAttribution?"web-vitals-with-attribution-soft-navs":"web-vitals-soft-navs":this.useAttribution?"web-vitals-with-attribution":"web-vitals"}Ho(t){var e;const n=Ur.__PosthogExtensions__,o=this.if,i=n?.postHogWebVitalsCallbacksByFlavor;i?.[o]||o==="web-vitals"&&Eo(i)&&n?.postHogWebVitalsCallbacks?t():n==null||(e=n.loadExternalDependency)===null||e===void 0||e.call(n,this._instance,o,r=>{r?kM.error("failed to load script",r):t()})}Yv(t){const e=t||Fn?.location.href;if(!e)return void kM.error("Could not determine current URL");const n=this._instance.config.disable_capture_url_hashes?iQ(e):e,o=this._instance.config.custom_personal_data_properties,i=this._instance.config.mask_personal_data_properties?[...Tk,...o||[]]:[];return AV(n,i,cV)}}},e7n={exceptionObserver:class{constructor(t){var e;this.ef=()=>{var n;if(!Fn||!this.isEnabled||!(!((n=Ur.__PosthogExtensions__)===null||n===void 0)&&n.errorWrappingFunctions))return;const o=Ur.__PosthogExtensions__.errorWrappingFunctions.wrapOnError,i=Ur.__PosthogExtensions__.errorWrappingFunctions.wrapUnhandledRejection,r=Ur.__PosthogExtensions__.errorWrappingFunctions.wrapConsoleError;try{!this.sf&&this.Ir.capture_unhandled_errors&&(this.sf=o(this.captureException.bind(this))),!this.rf&&this.Ir.capture_unhandled_rejections&&(this.rf=i(this.captureException.bind(this))),!this.af&&this.Ir.capture_console_errors&&(this.af=r(this.captureException.bind(this)))}catch(s){IV.error("failed to start",s),this.lf()}},this._instance=t,this.uf=!!(!((e=this._instance.persistence)===null||e===void 0)&&e.props[Zye]),this.wt=new X5n(sn(sn({},(function(n={}){var o,i,r,s;return{refillRate:(o=(i=n.exceptionRateLimiterRefillRate)!==null&&i!==void 0?i:n.__exceptionRateLimiterRefillRate)!==null&&o!==void 0?o:1,bucketSize:(r=(s=n.exceptionRateLimiterBucketSize)!==null&&s!==void 0?s:n.__exceptionRateLimiterBucketSize)!==null&&r!==void 0?r:10}})(this._instance.config.error_tracking)),{},{refillInterval:1e4,A:IV})),this.Ir=this.hf(),this.startIfEnabledOrStop()}hf(){const t=this._instance.config.capture_exceptions;let e={capture_unhandled_errors:!1,capture_unhandled_rejections:!1,capture_console_errors:!1};return xA(t)?e=sn(sn({},e),t):(Eo(t)?this.uf:t)&&(e=sn(sn({},e),{},{capture_unhandled_errors:!0,capture_unhandled_rejections:!0})),e}get isEnabled(){return this.Ir.capture_console_errors||this.Ir.capture_unhandled_errors||this.Ir.capture_unhandled_rejections}startIfEnabledOrStop(){this.isEnabled?(IV.info("enabled"),this.lf(),this.Ho(this.ef)):this.lf()}Ho(t){var e,n,o;!((e=Ur.__PosthogExtensions__)===null||e===void 0)&&e.errorWrappingFunctions?t():(n=Ur.__PosthogExtensions__)===null||n===void 0||(o=n.loadExternalDependency)===null||o===void 0||o.call(n,this._instance,"exception-autocapture",i=>{if(i)return IV.error("failed to load script",i);t()})}lf(){var t,e,n;(t=this.sf)===null||t===void 0||t.call(this),this.sf=void 0,(e=this.rf)===null||e===void 0||e.call(this),this.rf=void 0,(n=this.af)===null||n===void 0||n.call(this),this.af=void 0}onRemoteConfig(t){if(!t.ok)return;const e=t.config;"autocaptureExceptions"in e&&(this.uf=!!e.autocaptureExceptions||!1,this._instance.persistence&&this._instance.persistence.register({[Zye]:this.uf}),this.Ir=this.hf(),this.startIfEnabledOrStop())}onConfigChange(){this.Ir=this.hf()}captureException(t){try{var e,n,o;const i=(e=t==null||(n=t.$exception_list)===null||n===void 0||(n=n[0])===null||n===void 0?void 0:n.type)!==null&&e!==void 0?e:"Exception";if(this.wt.consumeRateLimit(i))return void IV.info("Skipping exception capture because of client rate limiting.",{exception:i});(o=this._instance.exceptions)===null||o===void 0||o.sendExceptionEvent(t)}catch{}}},exceptions:class{constructor(t){var e,n;this.cf=[],this.df=new c4n([new B4n,new N4n,new S4n,new b4n,new M4n,new P4n,new v4n,new D4n],(function(o,...i){return(r,s=0)=>{const a=[],A=r.split(`
241
+ `),c=Math.min(A.length,s+1e3),l=[];for(let h=s;c>h;h++){const d=A[h];if(d.length>1024)continue;const p=_rt.test(d)?d.replace(_rt,"$1"):d;if(!p.match(/\S*Error: /)){for(const m of i){const _=m(p,o);if(_){a.push(_);const f=C4n(a);if(f){for(let I=l.length-1;I>=0;I--){const C=l[I];if(f.start>=C.start+C.length)break;l.pop()}l.push(f)}break}}if(x4n(a,l)>=50)break}}const g=[...l].sort((h,d)=>d.start-h.start),u=g[g.length-1];if(u){const h=frt(a,u);a.splice(u.start-h,h);for(const d of g)d.start-=h}for(const h of g)y4n(a,h);return l.some(h=>h.start===0&&a.length===h.length)&&(function(h){const d=h.map(m=>`${m.function}|${m.filename}|${m.lineno}|${m.colno}|${m.module}`);let p=0;for(let m=1;d.length>m;m++)E4n(d,m,p)&&(p=m);h.push(...h.splice(0,p))})(a),(function(h){if(!h.length)return[];const d=Array.from(h);return d.reverse(),d.slice(0,50).map(p=>{return sn(sn({},p),{},{filename:p.filename||(m=d,m[m.length-1]||{}).filename,function:p.function||"?"});var m})})(a)}})("web:javascript",m4n,I4n)),this._instance=t,this.cf=(e=(n=this._instance.persistence)===null||n===void 0?void 0:n.get_property("$error_tracking_suppression_rules"))!==null&&e!==void 0?e:[],this.vf=Jte(this.ff()),this.pf=new T4n(this.vf)}onConfigChange(){this.vf=Jte(this.ff()),this.pf.setConfig(this.vf)}onRemoteConfig(t){var e,n,o;if(!t.ok)return;const i=t.config;if(!("errorTracking"in i))return;const r=(e=(n=i.errorTracking)===null||n===void 0?void 0:n.suppressionRules)!==null&&e!==void 0?e:[],s=(o=i.errorTracking)===null||o===void 0?void 0:o.captureExtensionExceptions;this.cf=r,this._instance.persistence&&this._instance.persistence.register({[zrt]:this.cf,[e2e]:s})}get gf(){var t;const e=!!this._instance.get_property(e2e),n=this._instance.config.error_tracking.captureExtensionExceptions;return(t=n??e)!==null&&t!==void 0&&t}buildProperties(t,e){return this.df.buildFromUnknown(t,{syntheticException:e?.syntheticException,mechanism:{handled:e?.handled}})}addExceptionStep(t,e){if(this.vf.enabled)try{if(!nA(t)||t.trim().length===0)return void L4.warn("Ignoring exception step because message must be a non-empty string");const{sanitizedProperties:n,droppedKeys:o}=(function(i){if(!i)return{sanitizedProperties:{},droppedKeys:[]};const r=[];return{sanitizedProperties:Object.keys(i).reduce((s,a)=>R4n.has(a)?(r.push(a),s):(s[a]=i[a],s),{}),droppedKeys:r}})(this.mf(e));o.length>0&&L4.warn("Ignoring reserved exception step fields",{droppedKeys:o}),this.pf.add(sn({[Vte]:t,[zte]:new Date().toISOString()},n))}catch(n){L4.error("Failed to add exception step. Ignoring breadcrumb.",n)}}sendExceptionEvent(t){try{const e=t.$exception_list;if(this.yf(e)){if(this.bf(e))return this._f("Exception dropped: matched a suppression rule"),void L4.info("Skipping exception capture because a suppression rule matched");if(!this.gf&&this.wf(e))return this._f("Exception dropped: thrown by a browser extension"),void L4.info("Skipping exception capture because it was thrown by an extension");if(!this.gf&&this.kf(e))return this._f("Exception dropped: thrown by an injected browser script"),void L4.info("Skipping exception capture because it was thrown by an injected browser script");if(!this._instance.config.error_tracking.__capturePostHogExceptions&&this.Sf(e))return this._f("Exception dropped: thrown by the PostHog SDK"),void L4.info("Skipping exception capture because it was thrown by the PostHog SDK")}const n=this.vf.enabled&&Fs(t.$exception_steps)?this.xf(t):t,o=(function(){const i=globalThis._posthogReleaseId;return typeof i=="string"&&i.length>0?i:void 0})();o&&(n.$release_id=o);try{const i=this._instance.capture("$exception",n,{_noTruncate:!0,_batchKey:"exceptionEvent",fh:!0});return i&&this.pf.clear(),i}catch(i){return cAt(i)||L4.error("Failed to capture exception event. Dropping this exception.",i),void this.pf.clear()}}catch(e){return void(cAt(e)||L4.error("Failed to process exception event. Ignoring this exception.",e))}}xf(t){try{const e=this.pf.getAttachable();return e.length===0?t:sn(sn({},t),{},{$exception_steps:e})}catch(e){return L4.error("Failed to read buffered exception steps. Capturing exception without steps.",e),t}}_f(t){this.vf.enabled&&this.pf.add({[Vte]:t,[zte]:new Date().toISOString()})}mf(t){return xA(t)?sn({},t):{}}ff(){var t,e;return(t=(e=this._instance.config.error_tracking)===null||e===void 0?void 0:e.exception_steps)!==null&&t!==void 0?t:{}}bf(t){if(t.length===0)return!1;try{const e=t.reduce((n,{type:o,value:i})=>(nA(o)&&o.length>0&&n.$exception_types.push(o),nA(i)&&i.length>0&&n.$exception_values.push(i),n),{$exception_types:[],$exception_values:[]});return this.cf.some(n=>{const o=n.values.map(i=>{const r=Rat[i.operator],s=e[i.key];if(!r||!s)return!1;const a=As(i.value)?i.value:[i.value];return a.length>0&&r(a,s)});return n.type==="OR"?o.some(Boolean):o.every(Boolean)})}catch(e){return L4.warn("Failed to evaluate suppression rules. Capturing the exception.",e),!1}}wf(t){const e=t.flatMap(o=>{var i,r;return(i=(r=o.stacktrace)===null||r===void 0?void 0:r.frames)!==null&&i!==void 0?i:[]}),n=e.filter(({filename:o})=>!!o&&U9n.some(i=>o.startsWith(i)));return n.length!==0&&(!n.every(({filename:o})=>!!o&&o.startsWith(exe))||t.some(({type:o,value:i})=>o==="NoResponse"||nA(i)&&Y9n.some(({value:r,exact:s})=>s?i===r:i.includes(r)))&&!e.some(({in_app:o,filename:i})=>o&&!i?.startsWith(exe)))}kf(t){return t.some(({value:e})=>nA(e)&&K9n.some(n=>e.includes(n)))}Sf(t){if(t.length>0){var e,n,o,i;const r=(e=(n=t[0].stacktrace)===null||n===void 0?void 0:n.frames)!==null&&e!==void 0?e:[],s=r[r.length-1];return(o=s==null||(i=s.filename)===null||i===void 0?void 0:i.includes("posthog.com/static"))!==null&&o!==void 0&&o}return!1}yf(t){return!Fs(t)&&As(t)}}},t7n=sn({productTours:class{get Il(){return this._instance.persistence}constructor(t){this.Cf=null,this.$f=null,this._instance=t}initialize(){this.loadIfEnabled()}onRemoteConfig(t){if(!t.ok)return;const e=t.config;if("productTours"in e){var n,o;if(this.Il&&this.Il.register({[o2e]:!!e.productTours}),!$2e(this._instance))return!this.Cf&&Fs((n=this.Il)===null||n===void 0?void 0:n.props.ph_product_tours)||hne.info("product tours disabled; stopping and clearing cached tours"),(o=this.Cf)===null||o===void 0||o.stop(),this.Cf=null,void this.clearCache();this.loadIfEnabled()}}loadIfEnabled(){!this.Cf&&$2e(this._instance)&&this.Ho(()=>this.Tf())}Ho(t){var e,n,o;!((e=Ur.__PosthogExtensions__)===null||e===void 0)&&e.generateProductTours?t():(n=Ur.__PosthogExtensions__)===null||n===void 0||(o=n.loadExternalDependency)===null||o===void 0||o.call(n,this._instance,"product-tours",i=>{i?hne.error("Could not load product tours script",i):t()})}Tf(){var t;!this.Cf&&(!((t=Ur.__PosthogExtensions__)===null||t===void 0)&&t.generateProductTours)&&(this.Cf=Ur.__PosthogExtensions__.generateProductTours(this._instance,!0))}getProductTours(t,e=!1){if(As(this.$f)&&!e)return void t(this.$f,{isLoaded:!0});const n=this.Il;if(n){const o=n.props[r2e];if(As(o)&&!e)return this.$f=o,void t(o,{isLoaded:!0})}this._instance._send_request({url:this._instance.requestRouter.endpointFor("api",`/api/product_tours/?token=${this._instance.config.token}`),method:"GET",timestampMode:"query",callback:o=>{if(!$2e(this._instance))return void t([],{isLoaded:!0});const i=o.statusCode;if(i!==200||!o.json){const s=`Product Tours API could not be loaded, status: ${i}`;return i===0?o.error||hne.warn(s):hne.error(s),void t([],{isLoaded:!1,error:s})}const r=As(o.json.product_tours)?o.json.product_tours:[];this.$f=r,n&&n.register({[r2e]:r}),t(r,{isLoaded:!0})}})}getActiveProductTours(t){Fs(this.Cf)?t([],{isLoaded:!1,error:"Product tours not loaded"}):this.Cf.getActiveProductTours(t)}showProductTour(t){var e;(e=this.Cf)===null||e===void 0||e.showTourById(t)}previewTour(t){this.Cf?this.Cf.previewTour(t):this.Ho(()=>{var e;this.Tf(),(e=this.Cf)===null||e===void 0||e.previewTour(t)})}dismissProductTour(){var t;(t=this.Cf)===null||t===void 0||t.dismissTour("user_clicked_skip")}nextStep(){var t;(t=this.Cf)===null||t===void 0||t.nextStep()}previousStep(){var t;(t=this.Cf)===null||t===void 0||t.previousStep()}clearCache(){var t;this.$f=null,(t=this.Il)===null||t===void 0||t.unregister("ph_product_tours")}resetTour(t){var e;(e=this.Cf)===null||e===void 0||e.resetTour(t)}resetAllTours(){var t;(t=this.Cf)===null||t===void 0||t.resetAllTours()}cancelPendingTour(t){var e;(e=this.Cf)===null||e===void 0||e.cancelPendingTour(t)}}},mne),n7n={siteApps:class{constructor(t){this._instance=t,this.If=0,this.Mf=[],this.apps={}}get isEnabled(){return!!this._instance.config.opt_in_site_apps}Ef(t,e){if(!e)return;const n=this.globalsForEvent(e);this.Mf.push(n),this.Mf.length>1e3&&(this.Mf=this.Mf.slice(10))}get siteAppLoaders(){var t;return(t=Ur._POSTHOG_REMOTE_CONFIG)===null||t===void 0||(t=t[this._instance.config.token])===null||t===void 0?void 0:t.siteApps}initialize(){if(this.isEnabled){const t=this._instance._addCaptureHook(this.Ef.bind(this));this.Pf=()=>{t(),this.Mf=[],this.Pf=void 0}}}globalsForEvent(t){var e,n,o,i,r,s,a;if(!t)throw new Error("Event payload is required");const A={},c=this._instance.get_property("$groups")||[],l=this._instance.get_property("$stored_group_properties")||{};for(const[h,d]of Object.entries(l))A[h]={id:c[h],type:h,properties:d};const{$set_once:g,$set:u}=t;return{event:sn(sn({},vrt(t,D9n)),{},{properties:sn(sn(sn({},t.properties),u?{$set:sn(sn({},(e=(n=t.properties)===null||n===void 0?void 0:n.$set)!==null&&e!==void 0?e:{}),u)}:{}),g?{$set_once:sn(sn({},(o=(i=t.properties)===null||i===void 0?void 0:i.$set_once)!==null&&o!==void 0?o:{}),g)}:{}),elements_chain:(r=(s=t.properties)===null||s===void 0?void 0:s.$elements_chain)!==null&&r!==void 0?r:"",distinct_id:(a=t.properties)===null||a===void 0?void 0:a.distinct_id}),person:{properties:this._instance.get_property("$stored_person_properties")},groups:A}}Rf(t){var e;const n=(e=t.tagName)===null||e===void 0?void 0:e.toLowerCase();return n==="style"&&this._instance.config.prepare_external_dependency_stylesheet?this._instance.config.prepare_external_dependency_stylesheet(t)||(S9.error("prepare_external_dependency_stylesheet returned null"),null):n==="script"&&this._instance.config.prepare_external_dependency_script?this._instance.config.prepare_external_dependency_script(t)||(S9.error("prepare_external_dependency_script returned null"),null):t}Af(){var t,e,n,o,i,r,s,a;if(!this._instance.config.prepare_external_dependency_stylesheet&&!this._instance.config.prepare_external_dependency_script)return()=>{};const A=No?.defaultView,c=A==null||(t=A.Node)===null||t===void 0?void 0:t.prototype;if(!A||!c)return()=>{};if(this.If++,this.Ff)return this.Of();const l=[],g=this,u=new WeakSet,h=(m,_,f)=>{if(!m?.[_])return;const I=m[_];m[_]=f(I),l.push(()=>{m[_]=I})},d=m=>{if(u.has(m))return m;const _=g.Rf(m);return _&&u.add(_),_},p=m=>m.map(_=>typeof _=="string"?_:d(_)).filter(_=>!ad(_));return h(c,"appendChild",m=>function(_){const f=d(_);return f?m.call(this,f):_}),h(c,"insertBefore",m=>function(_,f){const I=d(_);return I?m.call(this,I,f):_}),h(c,"replaceChild",m=>function(_,f){const I=d(_);return I?m.call(this,I,f):f}),[(e=A.Element)===null||e===void 0?void 0:e.prototype,(n=A.Document)===null||n===void 0?void 0:n.prototype,(o=A.DocumentFragment)===null||o===void 0?void 0:o.prototype].forEach(m=>{h(m,"append",_=>function(...f){return _.apply(this,p(f))}),h(m,"prepend",_=>function(...f){return _.apply(this,p(f))})}),[(i=A.Element)===null||i===void 0?void 0:i.prototype,(r=A.CharacterData)===null||r===void 0?void 0:r.prototype,(s=A.DocumentType)===null||s===void 0?void 0:s.prototype].forEach(m=>{h(m,"before",_=>function(...f){return _.apply(this,p(f))}),h(m,"after",_=>function(...f){return _.apply(this,p(f))}),h(m,"replaceWith",_=>function(...f){const I=p(f);return f.length&&!I.length?void 0:_.apply(this,I)})}),h((a=A.Element)===null||a===void 0?void 0:a.prototype,"insertAdjacentElement",m=>function(_,f){const I=d(f);return I?m.call(this,_,I):null}),this.Ff=()=>{l.forEach(m=>m()),this.Ff=void 0},this.Of()}Of(){let t=!1;return()=>{var e;t||(t=!0,this.If--,this.If===0&&((e=this.Ff)===null||e===void 0||e.call(this)))}}Df(t,e=!0){const n=this.Af();try{const o=t(n);return e&&n(),o}catch(o){throw n(),o}}setupSiteApp(t){const e=this.apps[t.id],n=()=>{var r;!e.errored&&this.Mf.length&&(S9.info(`Processing ${this.Mf.length} events for site app with id ${t.id}`),this.Mf.forEach(s=>this.Df(()=>{var a;return(a=e.processEvent)===null||a===void 0?void 0:a.call(e,s)})),e.processedBuffer=!0),Object.values(this.apps).every(s=>s.processedBuffer||s.errored)&&((r=this.Pf)===null||r===void 0||r.call(this))};let o=!1;const i=r=>{e.errored=!r,e.loaded=!0,S9.info(`Site app with id ${t.id} ${r?"loaded":"errored"}`),o&&n()};try{const{processEvent:r}=this.Df(s=>t.init({posthog:this._instance,callback(a){s(),i(a)}}),!1);r&&(e.processEvent=r),o=!0}catch(r){S9.error($at+t.id,r),i(!1)}if(o&&e.loaded)try{n()}catch(r){S9.error(`Error while processing buffered events PostHog app with config id ${t.id}`,r),e.errored=!0}}Lf(){const t=this.siteAppLoaders||[];for(const e of t)this.apps[e.id]={id:e.id,loaded:!1,errored:!1,processedBuffer:!1};for(const e of t)this.setupSiteApp(e)}Nf(t){if(Object.keys(this.apps).length===0)return;const e=this.globalsForEvent(t);for(const n of Object.values(this.apps))try{this.Df(()=>{var o;return(o=n.processEvent)===null||o===void 0?void 0:o.call(n,e)})}catch(o){S9.error(`Error while processing event ${t.event} for site app ${n.id}`,o)}}onRemoteConfig(t){var e,n,o;if(!((e=this.siteAppLoaders)===null||e===void 0)&&e.length)return this.isEnabled?(this.Lf(),void this._instance.on("eventCaptured",a=>this.Nf(a))):void S9.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.');if((n=this.Pf)===null||n===void 0||n.call(this),!t.ok)return;const i=t.config;if(!((o=i.siteApps)===null||o===void 0)&&o.length)if(this.isEnabled)for(const{id:a,url:A}of i.siteApps){var r,s;Ur[`__$$ph_site_app_${a}`]=this._instance,(r=Ur.__PosthogExtensions__)===null||r===void 0||(s=r.loadSiteApp)===null||s===void 0||s.call(r,this._instance,A,c=>{if(c)return S9.error($at+a,c)})}else S9.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}}},o7n={tracingHeaders:class{constructor(t){this._instance=t,this.qf=void 0,this.jf=void 0,this.Bf=void 0,this.ef=()=>{const e=this.Hf();var n,o;e?(Eo(this.qf)&&(this.qf=(n=Ur.__PosthogExtensions__)===null||n===void 0||(n=n.tracingHeadersPatchFns)===null||n===void 0?void 0:n._patchXHR(e,()=>this._instance.get_distinct_id(),this._instance.sessionManager)),Eo(this.jf)&&(this.jf=(o=Ur.__PosthogExtensions__)===null||o===void 0||(o=o.tracingHeadersPatchFns)===null||o===void 0?void 0:o._patchFetch(e,()=>this._instance.get_distinct_id(),this._instance.sessionManager))):this.lf()}}initialize(){this.startIfEnabledOrStop()}Ho(t){var e,n,o;!((e=Ur.__PosthogExtensions__)===null||e===void 0)&&e.tracingHeadersPatchFns?t():(n=Ur.__PosthogExtensions__)===null||n===void 0||(o=n.loadExternalDependency)===null||o===void 0||o.call(n,this._instance,"tracing-headers",i=>{if(i)return Q9n.error("failed to load script",i);t()})}zf(){var t,e;return(t=(e=this._instance.config.tracing_headers)!==null&&e!==void 0?e:this._instance.config.addTracingHeaders)!==null&&t!==void 0?t:this._instance.config.__add_tracing_headers}Hf(){const t=this.zf();return As(t)?(As(this.Bf)?this.Bf.splice(0,this.Bf.length,...t):this.Bf=[...t],t.length>0?this.Bf:void 0):(As(this.Bf)&&this.Bf.splice(0),this.Bf=t||void 0,this.Bf)}lf(){var t,e;(t=this.qf)===null||t===void 0||t.call(this),(e=this.jf)===null||e===void 0||e.call(this),this.qf=void 0,this.jf=void 0}startIfEnabledOrStop(){this.Hf()?this.Ho(this.ef):this.lf()}}},i7n=sn({surveys:class extends N9n{constructor(t){var e;super(new L9n(t),(e=t,{get projectToken(){return e.config.token},kv:new F9n(e)})),this._instance=t}Vh(t,e){const n=e.query?hV(t,e.query):t;return new Promise(o=>{var i;this._instance._send_request({method:e.method,url:this._instance.requestRouter.endpointFor((i=e.target)!==null&&i!==void 0?i:"api",n),data:e.body,headers:e.headers,timeout:e.timeoutMs,fireCallbackOnDrop:!0,transport:e.transport,compression:e.compression,timestampMode:e.sentAt,callback:o})})}}},mne),r7n={toolbar:class{constructor(t){this.instance=t}Uf(t){Ur.ph_toolbar_state=t}Wf(){var t;return(t=Ur.ph_toolbar_state)!==null&&t!==void 0?t:0}initialize(){return this.maybeLoadToolbar()}maybeLoadToolbar(t=void 0,e=void 0,n=void 0){var o,i;if(h2e(this.instance.config)||!Fn||!No)return!1;t=(o=t)!==null&&o!==void 0?o:Fn.location,n=(i=n)!==null&&i!==void 0?i:Fn.history;try{if(!e){try{Fn.localStorage.setItem("test","test"),Fn.localStorage.removeItem("test")}catch{return!1}e=Fn?.localStorage}const r=H9n||ine(t.hash,"__posthog")||ine(t.hash,"state");let s;const a=r?lrt(()=>JSON.parse(atob(decodeURIComponent(r))))||lrt(()=>JSON.parse(decodeURIComponent(r))):null;return a&&a.action==="ph_authorize"?(s=a,s.source="url",s&&Object.keys(s).length>0&&(a.desiredHash?t.hash=a.desiredHash:n?n.replaceState(n.state,"",t.pathname+t.search):t.hash="")):(s=JSON.parse(e.getItem(tAt)||"{}"),s.source="localstorage",delete s.userIntent),!(!s.token||this.instance.config.token!==s.token||(this.loadToolbar(s),0))}catch{return!1}}Vf(t){const e=Ur.ph_load_toolbar||Ur.ph_load_editor;!Fs(e)&&L_(e)?e(t,this.instance):nAt.warn("No toolbar load function found")}loadToolbar(t){const e=!!No?.getElementById("__POSTHOG_TOOLBAR__");if(!Fn||e)return!1;const n=this.instance.requestRouter.region==="custom"&&this.instance.config.advanced_disable_toolbar_metrics,o=sn(sn({token:this.instance.config.token},t),{},{apiURL:this.instance.requestRouter.endpointFor("ui")},n?{instrument:!1}:{});if(Fn.localStorage.setItem(tAt,JSON.stringify(sn(sn({},o),{},{source:void 0}))),this.Wf()===2)this.Vf(o);else if(this.Wf()===0){var i,r;this.Uf(1),(i=Ur.__PosthogExtensions__)===null||i===void 0||(r=i.loadExternalDependency)===null||r===void 0||r.call(i,this.instance,"toolbar",s=>{if(s)return nAt.error("[Toolbar] Failed to load",s),void this.Uf(0);this.Uf(2),this.Vf(o)}),jc(Fn,"turbolinks:load",()=>{this.Uf(0),this.loadToolbar(o)})}return!0}Gf(t){return this.loadToolbar(t)}maybeLoadEditor(t=void 0,e=void 0,n=void 0){return this.maybeLoadToolbar(t,e,n)}}},s7n=sn({experiments:class ex{get Ir(){return this._instance.config}constructor(e){this._instance=e,this.getWebExperimentsAndEvaluateDisplayLogic=(n=!1)=>{this.getWebExperiments(o=>{ex.Zf("retrieved web experiments from the server"),this.Qf=new Map,o.forEach(i=>{if(i.feature_flag_key){var r;this.Qf&&(ex.Zf("setting flag key ",i.feature_flag_key," to web experiment ",i),(r=this.Qf)===null||r===void 0||r.set(i.feature_flag_key,i));const s=this._instance.getFeatureFlag(i.feature_flag_key);nA(s)&&i.variants[s]&&this.Jf(i.name,s,i.variants[s].transforms)}else if(i.variants)for(const s in i.variants){const a=i.variants[s];ex.Kf(a,this._instance)&&this.Jf(i.name,s,a.transforms)}})},n)},this._instance.onFeatureFlags(n=>{this.onFeatureFlags(n)})}initialize(){}onFeatureFlags(e){if(this._is_bot())ex.Zf(lAt);else if(!this.Ir.disable_web_experiments){if(Fs(this.Qf))return this.Qf=new Map,this.loadIfEnabled(),void this.previewWebExperiment();ex.Zf("applying feature flags",e),e.forEach(n=>{var o;if(this.Qf&&(!((o=this.Qf)===null||o===void 0)&&o.has(n))){var i;const r=this._instance.getFeatureFlag(n),s=(i=this.Qf)===null||i===void 0?void 0:i.get(n);r&&s?.variants[r]&&this.Jf(s.name,r,s.variants[r].transforms)}})}}previewWebExperiment(){const e=ex.getWindowLocation();if(e?.search){const n=Rk(e?.search,"__experiment_id"),o=Rk(e?.search,"__experiment_variant");n&&o&&(ex.Zf(`previewing web experiments ${n} && ${o}`),this.getWebExperiments(i=>{this.Xf(parseInt(n),o,i)},!1,!0))}}loadIfEnabled(){this.Ir.disable_web_experiments||this.getWebExperimentsAndEvaluateDisplayLogic()}getWebExperiments(e,n,o){if(this.Ir.disable_web_experiments&&!o)return e([]);const i=this._instance.get_property("$web_experiments");if(i&&!n)return e(i);this._instance._send_request({url:this._instance.requestRouter.endpointFor("api",`/api/web_experiments/?token=${this.Ir.token}`),method:"GET",timestampMode:"query",callback:r=>e(r.statusCode===200&&r.json&&r.json.experiments||[])})}Xf(e,n,o){const i=o.filter(r=>r.id===e);i&&i.length>0&&(ex.Zf(`Previewing web experiment [${i[0].name}] with variant [${n}]`),this.Jf(i[0].name,n,i[0].variants[n].transforms))}static Kf(e,n){return!Fs(e.conditions)&&ex.Yf(e,n)&&ex.tp(e)}static Yf(e,n){var o;if(Fs(e.conditions)||Fs((o=e.conditions)===null||o===void 0?void 0:o.url))return!0;const i=ex.getWindowLocation();if(i){var r,s,a;const A=xst(n,i.href);return!(!((r=e.conditions)===null||r===void 0)&&r.url)||V9n[(s=(a=e.conditions)===null||a===void 0?void 0:a.urlMatchType)!==null&&s!==void 0?s:"icontains"](e.conditions.url,A)}return!1}static getWindowLocation(){return Fn?.location}static tp(e){var n;if(Fs(e.conditions)||Fs((n=e.conditions)===null||n===void 0?void 0:n.utm))return!0;const o=Jst();if(o.utm_source){var i,r,s,a,A,c,l,g;const u=!(!((i=e.conditions)===null||i===void 0||(i=i.utm)===null||i===void 0)&&i.utm_campaign)||((r=e.conditions)===null||r===void 0||(r=r.utm)===null||r===void 0?void 0:r.utm_campaign)==o.utm_campaign,h=!(!((s=e.conditions)===null||s===void 0||(s=s.utm)===null||s===void 0)&&s.utm_source)||((a=e.conditions)===null||a===void 0||(a=a.utm)===null||a===void 0?void 0:a.utm_source)==o.utm_source,d=!(!((A=e.conditions)===null||A===void 0||(A=A.utm)===null||A===void 0)&&A.utm_medium)||((c=e.conditions)===null||c===void 0||(c=c.utm)===null||c===void 0?void 0:c.utm_medium)==o.utm_medium,p=!(!((l=e.conditions)===null||l===void 0||(l=l.utm)===null||l===void 0)&&l.utm_term)||((g=e.conditions)===null||g===void 0||(g=g.utm)===null||g===void 0?void 0:g.utm_term)==o.utm_term;return u&&d&&p&&h}return!1}static Zf(e,...n){gi.info(`[WebExperiments] ${e}`,n)}Jf(e,n,o){this._is_bot()?ex.Zf(lAt):n!=="control"?o.forEach(i=>{if(i.selector){var r;ex.Zf(`applying transform of variant ${n} for experiment ${e} `,i);const s=(r=document)===null||r===void 0?void 0:r.querySelectorAll(i.selector);s?.forEach(a=>{const A=a;i.html&&(A.innerHTML=i.html),i.css&&A.setAttribute("style",i.css)})}}):ex.Zf("Control variants leave the page unmodified.")}_is_bot(){return F_&&this._instance?Mat(F_,this.Ir.custom_blocked_useragents):void 0}}},mne),a7n={conversations:class{constructor(t){this._instance=t,this.ep=void 0,this._conversationsManager=null,this.np=!1,this.ne=null,this.sp=!1}initialize(){this.loadIfEnabled()}onRemoteConfig(t){if(this._instance.config.disable_conversations||(this.rp=t.ok,!t.ok))return;const e=t.config.conversations;Fs(e)||(hy(e)?this.ep=e:(this.ep=e.enabled,this.ne=e),this.loadIfEnabled())}reset(){var t;(t=this._conversationsManager)===null||t===void 0||t.reset(),this._conversationsManager=null,this.ep=void 0,this.ne=null,this.rp=void 0,this.sp=!1}loadIfEnabled(){if(this._conversationsManager||this.np||this._instance.config.disable_conversations||h2e(this._instance.config)||this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut())return;const t=Ur?.__PosthogExtensions__;if(t&&!Eo(this.ep)&&this.ep)if(this.ne&&this.ne.token){this.np=!0;try{const e=t.initConversations;if(e)return this.op(e),void(this.np=!1);const n=t.loadExternalDependency;if(!n)return void this.ap(g2e);n(this._instance,"conversations",o=>{o||!t.initConversations?this.ap("Could not load conversations script",o):this.op(t.initConversations),this.np=!1})}catch(e){this.ap("Error initializing conversations",e),this.np=!1}}else p5.error("Conversations enabled but missing token in remote config.")}op(t){if(this.ne)try{this._conversationsManager=t(this.ne,this._instance),this.sp=!1,p5.info("Conversations loaded successfully")}catch(e){this.ap("Error completing conversations initialization",e)}else p5.error("Cannot complete initialization: remote config is null")}ap(t,e){p5.error(t,e),this._conversationsManager=null,this.np=!1,this.sp=!0}show(){this._conversationsManager?this._conversationsManager.show():p5.warn("Conversations not loaded yet.")}hide(){this._conversationsManager&&this._conversationsManager.hide()}isAvailable(){return this.ep===!0&&!ad(this._conversationsManager)}getUnavailableReason(){return this.isAvailable()?null:this._instance.config.disable_conversations?"disabled_by_config":h2e(this._instance.config)?"disabled_for_toolbar":this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut()?"consent_opted_out":this.rp===!1?"remote_config_failed":Eo(this.ep)?this.rp?"disabled_in_project":"remote_config_pending":this.ep?Fs(this.ne)||!this.ne.token?"missing_token":Ur?.__PosthogExtensions__?this.np?"initializing":this.sp?"load_failed":"not_loaded":"extensions_unavailable":"disabled_in_project"}isVisible(){var t,e;return(t=(e=this._conversationsManager)===null||e===void 0?void 0:e.isVisible())!==null&&t!==void 0&&t}sendMessage(t,e,n){var o=this;return Wg(function*(){return o._conversationsManager?o._conversationsManager.sendMessage(t,e,n):(p5.warn(LM),null)})()}getMessages(t,e){var n=this;return Wg(function*(){return n._conversationsManager?n._conversationsManager.getMessages(t,e):(p5.warn(LM),null)})()}markAsRead(t){var e=this;return Wg(function*(){return e._conversationsManager?e._conversationsManager.markAsRead(t):(p5.warn(LM),null)})()}getTickets(t){var e=this;return Wg(function*(){return e._conversationsManager?e._conversationsManager.getTickets(t):(p5.warn(LM),null)})()}requestRestoreLink(t){var e=this;return Wg(function*(){return e._conversationsManager?e._conversationsManager.requestRestoreLink(t):(p5.warn(LM),null)})()}restoreFromToken(t){var e=this;return Wg(function*(){return e._conversationsManager?e._conversationsManager.restoreFromToken(t):(p5.warn(LM),null)})()}restoreFromUrlToken(){var t=this;return Wg(function*(){return t._conversationsManager?t._conversationsManager.restoreFromUrlToken():(p5.warn(LM),null)})()}getCurrentTicketId(){var t,e;return(t=(e=this._conversationsManager)===null||e===void 0?void 0:e.getCurrentTicketId())!==null&&t!==void 0?t:null}getWidgetSessionId(){var t,e;return(t=(e=this._conversationsManager)===null||e===void 0?void 0:e.getWidgetSessionId())!==null&&t!==void 0?t:null}Sh(){var t;(t=this._conversationsManager)===null||t===void 0||t.setIdentity()}xh(){var t;(t=this._conversationsManager)===null||t===void 0||t.clearIdentity()}}},A7n={logs:class{constructor(t){var e;this._instance=t,this.name="logs",this.lp=!1,this.up=!1,this.hp=!1,this.A=Ad("[logs]"),this.cp=sn(sn({},this.A),{},{error:(...n)=>{n.some(hAt)||this.A.error(...n)}}),this.ol=[],this.dp=[],this._d=0,this.To=!1,this.vp=[],this.fp=[],this.pp=!1,this.gp=!1,this.mp=()=>{var n,o;this.To||(this._d=0,(n=this.yp)===null||n===void 0||n.onReconnect(),(o=this.bp)===null||o===void 0||o.onReconnect())},this._instance&&(!((e=this._instance.config.logs)===null||e===void 0)&&e.captureConsoleLogs)&&(this.lp=!0),Fn&&jc(Fn,"online",this.mp)}_p(t,e,n,o){var i;const r=gAt((i=this._instance)===null||i===void 0||(i=i.config)===null||i===void 0?void 0:i.logs,n);return[new V4n(this.wp(t,e),r,this.cp,()=>this.kp(),s=>s(),void 0,o),r]}Sp(){var t;const e=(t=this._instance)===null||t===void 0||(t=t.config)===null||t===void 0?void 0:t.logs;var n;return this.yp&&this.xp===e||((n=this.yp)===null||n===void 0||n.reset(),this.xp=e,[this.yp,this.Cp]=this._p(()=>this.ol,o=>{this.ol=o})),this.yp}$p(){var t;const e=(t=this._instance)===null||t===void 0||(t=t.config)===null||t===void 0?void 0:t.logs;var n;return this.bp&&this.Tp===e||((n=this.bp)===null||n===void 0||n.reset(),this.Tp=e,[this.bp,this.Ip]=this._p(()=>this.dp,o=>{this.dp=o},{serviceNameDefault:"posthog-browser-logs",consoleCapture:!0},uAt)),this.bp}setup(t){var e;if(this.To)return;this.bo=t,!((e=this._instance)===null||e===void 0||(e=e.config)===null||e===void 0||(e=e.logs)===null||e===void 0)&&e.captureConsoleLogs&&(this.lp=!0),(this.lp||this.Mp()&&this.Ep())&&this.Pp();let n=!1;const o=t.onRemoteConfig(i=>{var r;n=i.ok&&((r=i.config.logs)===null||r===void 0?void 0:r.captureConsoleLogs)===!0,this.onRemoteConfig(i)});this.To?o.dispose():(this.Eo=o,n||this.loadIfEnabled())}dispose(){var t,e,n,o;this.To||(this.To=!0,this.Rp(),(t=this.Eo)===null||t===void 0||t.dispose(),this.Eo=void 0,this.bo=void 0,this.hp=!1,Fn?.removeEventListener("online",this.mp),(e=this.Ap)===null||e===void 0||e.call(this),this.Ap=void 0,(n=this.yp)===null||n===void 0||n.reset(),(o=this.bp)===null||o===void 0||o.reset())}onRemoteConfig(t){var e,n;if(this.To)return;const o=t.ok?(e=t.config.logs)===null||e===void 0?void 0:e.captureConsoleLogs:void 0;Fs(o)?this.Fp():((n=this._instance)===null||n===void 0||(n=n.persistence)===null||n===void 0||n.register({$logs_capture_enabled_server_side:!!o}),o?(this.lp=!0,this.up||this.Pp(),this.loadIfEnabled()):this.Fp())}reset(){var t,e,n,o;this.Rp(),(t=this.yp)===null||t===void 0||t.clearQueue(),this.ol=[],(e=this.yp)===null||e===void 0||e.reset(),(n=this.bp)===null||n===void 0||n.clearQueue(),this.dp=[],(o=this.bp)===null||o===void 0||o.reset(),this._d=0}captureLog(t){this.To||this.Sp().captureLog(t)}captureConsoleLog(t){this.To||this.$p().captureLog(t)}captureBufferedConsoleLog(t,e,n){this.To||this.$p().captureLog(t,{context:e,occurredAtMs:n})}Ep(){var t;return!!(!((t=this._instance)===null||t===void 0||(t=t.persistence)===null||t===void 0||(t=t.props)===null||t===void 0)&&t[Jrt])}Mp(){var t,e,n;return!(!((t=this._instance)===null||t===void 0||(e=t.il)===null||e===void 0)&&e.call(t))||!!(!((n=Ur._POSTHOG_REMOTE_CONFIG)===null||n===void 0||(n=n[this._instance.config.token])===null||n===void 0)&&n.config)}$h(){var t;this.Rp(),(t=this.bp)===null||t===void 0||t.clearQueue(),this.dp=[]}Fp(){this.lp||this.Rp()}Pp(){var t;if(this.pp||!Ur?.console)return;const e=gAt((t=this._instance)===null||t===void 0||(t=t.config)===null||t===void 0?void 0:t.logs).maxBufferSize;let n=!0;this.fp.push(()=>{n=!1});for(const o of z9n){let i;try{i=J9n(Ur.console[o])}catch{continue}i&&this.fp.push(CV(Ur.console,o,r=>{const s=(...a)=>{try{n&&this.Op(o,a,e)}catch{}return r.apply(Ur.console,a)};return s.__rrweb_original__=i,s}))}this.pp=!0,this.Dp=setTimeout(()=>{this.Rp()},3e4)}Op(t,e,n){var o;if(this.pp&&!this.gp&&e.length!==0)if(!((o=this._instance)===null||o===void 0)&&o.is_capturing()){if(n>this.vp.length){this.gp=!0;try{this.vp.push({level:t,args:e,occurredAtMs:Date.now(),context:this.kp()})}finally{this.gp=!1}}}else this.Rp()}Rp(){if(this.vp=[],this.pp){this.pp=!1,this.Dp&&(clearTimeout(this.Dp),this.Dp=void 0);for(const t of this.fp)t();this.fp=[]}}Lp(){const t=this.vp;return this.Rp(),t}get logger(){return this.Np||(this.Np={trace:(t,e)=>this.captureLog({body:t,level:"trace",attributes:e}),debug:(t,e)=>this.captureLog({body:t,level:"debug",attributes:e}),info:(t,e)=>this.captureLog({body:t,level:"info",attributes:e}),warn:(t,e)=>this.captureLog({body:t,level:"warn",attributes:e}),error:(t,e)=>this.captureLog({body:t,level:"error",attributes:e}),fatal:(t,e)=>this.captureLog({body:t,level:"fatal",attributes:e})}),this.Np}flushLogs(t){t?this.qp(t):(this.yp&&this.yp.flush().catch(e=>this.jp(e)),this.bp&&this.bp.flush().catch(e=>this.jp(e)))}jp(t){hAt(t)||this.A.error("PostHog logs flush failed:",t)}loadIfEnabled(){if(this.To||!this.lp||this.up||this.hp)return;const t=Ur?.__PosthogExtensions__;if(!t)return this.A.error("PostHog Extensions not found."),void this.Rp();const e=t.loadExternalDependency;if(!e)return this.A.error(g2e),void this.Rp();this.hp=!0;try{e(this._instance,"logs",n=>{if(this.hp=!1,this.To||!this.lp)return;const o=t.logs;if(n||!o?.initializeLogs)this.A.error("Could not load logs script",n),this.Rp();else{var i;const a=this.Lp();var r,s;this.Ap=o.initializeLogs((i=this.bo)!==null&&i!==void 0?i:this._instance),this.up=!0,a.length>0&&((r=o.replayConsoleBuffer)===null||r===void 0||r.call(o,(s=this.bo)!==null&&s!==void 0?s:this._instance,a))}})}catch(n){throw this.hp=!1,n}}wp(t,e){const n=this._instance;return{get isDisabled(){return!1},get optedOut(){return!n.is_capturing()},getPersistedProperty:o=>o===x9.LogsQueue?t():void 0,setPersistedProperty(o,i){var r;o===x9.LogsQueue&&e((r=i)!==null&&r!==void 0?r:[])},js:o=>this.js(o),getLibraryId:()=>Ym.LIB_NAME,getLibraryVersion:()=>Ym.LIB_VERSION}}js(t){return new Promise(e=>{if(Vst(this._d,3))return void e({kind:"fatal",error:txe(void 0,"logs endpoint is unreachable, dropping batch")});let n=!1;const o=r=>{n||(n=!0,clearTimeout(i),e(r))},i=setTimeout(()=>{this.A.warn("Logs request timed out before receiving a response"),o({kind:"retry-later",error:txe(void 0,"logs request timed out")})},9e4);this._instance._send_request({method:"POST",url:this.Bp(),data:t,compression:"best-available",batchKey:"logs",fireCallbackOnDrop:!0,callback:r=>{const s=r.statusCode;if(this.Hp(s),s>=200&&300>s)o({kind:"ok"});else if(s===413)o({kind:"too-large"});else if(s!==0&&s!==408&&s!==429&&500>s)o({kind:"fatal",error:new Error(`logs request failed with status ${s}`)});else{var a;s===0?(r.error||this.A.warn("Logs request failed before receiving an HTTP response"),o({kind:"retry-later",error:txe(r.error,"logs request failed before receiving an HTTP response")})):o({kind:"retry-later",error:(a=r.error)!==null&&a!==void 0?a:new Error(`logs request failed with status ${s}`)})}}})})}Hp(t){(t!==0||this._instance.__loaded)&&(this._d=zst(t,this._d,3,()=>this.A.warn("Log requests are failing before receiving an HTTP response; this can happen due to network issues, CORS, browser blocking, or ad blockers. Stopped sending logs; will try again when connectivity changes.")))}qp(t){this.ol.length>0&&this.zp(t,this.ol,this.Cp,Ym.LIB_NAME,e=>{this.ol=e}),this.dp.length>0&&this.zp(t,this.dp,this.Ip,uAt,e=>{this.dp=e})}zp(t,e,n,o,i){if(e.length===0)return;const r=e.map(a=>a.record);i([]);const s=Trt(r,Rrt(n,Ym.LIB_NAME,Ym.LIB_VERSION),o,Ym.LIB_VERSION);this._instance._send_request({method:"POST",url:this.Bp(),data:s,compression:"best-available",batchKey:"logs",transport:t})}Bp(){return this._instance.requestRouter.endpointFor("api","/i/v1/logs")+"?token="+encodeURIComponent(this._instance.config.token)}kp(){var t;const e={};if(e.distinctId=this._instance.get_distinct_id(),this._instance.sessionManager){const{sessionId:n,windowId:o,sessionStartTimestamp:i,lastActivityTimestamp:r}=this._instance.sessionManager.checkAndGetSessionAndWindowId(!0);e.sessionId=n,e.windowId=o,Fs(i)||(e.sessionStartTimestamp=i),Fs(r)||(e.lastActivityTimestamp=r)}if(!(Ur==null||(t=Ur.location)===null||t===void 0)&&t.href&&(e.currentUrl=this._instance.config.disable_capture_url_hashes?iQ(Ur.location.href):Ur.location.href),this._instance.featureFlags){const n=this._instance.featureFlags.getFlags();n&&n.length>0&&(e.activeFeatureFlags=n)}return e}}},c7n={metrics:class{constructor(t){this._instance=t,this.A=Ad("[metrics]"),this.To=!1}initialize(){this.onConfigChange()}onConfigChange(){var t;if(this.To)return;const e=!!(!((t=this._instance.config.metrics)===null||t===void 0)&&t.network);e&&!this.Up?this.Up=(n=>{let o=!0;const i=()=>o?(a=>{var A;const c=(A=a.config.metrics)===null||A===void 0?void 0:A.network;return c===!0?{}:c||void 0})(n):void 0,r=q9n(n,i),s=X9n(n,i);return()=>{o=!1,r(),s()}})(this._instance):!e&&this.Up&&(this.Up(),this.Up=void 0)}Sp(){var t;const e=(t=this._instance)===null||t===void 0||(t=t.config)===null||t===void 0?void 0:t.metrics;var n;return this.yp&&this.xp===e||((n=this.yp)===null||n===void 0||n.reset(),this.xp=e,this.yp=new z4n(this.wp(),(function(o){var i,r,s,a,A;const c=o?.resourceAttributes;return{serviceName:(i=c?.["service.name"])!==null&&i!==void 0?i:o?.serviceName,serviceVersion:(r=c?.["service.version"])!==null&&r!==void 0?r:o?.serviceVersion,environment:(s=c?.["deployment.environment"])!==null&&s!==void 0?s:o?.environment,resourceAttributes:c,beforeSend:o?.beforeSend,flushIntervalMs:(a=o?.flushIntervalMs)!==null&&a!==void 0?a:1e4,maxSeriesPerFlush:(A=o?.maxSeriesPerFlush)!==null&&A!==void 0?A:1e3}})(e),this.A)),this.yp}count(t,e=1,n){this.Sp().count(t,e,n)}gauge(t,e,n){this.Sp().gauge(t,e,n)}histogram(t,e,n){this.Sp().histogram(t,e,n)}flush(t){if(!this.yp)return Promise.resolve();if(t){const e=this.yp.drainWindow();return e&&this.Ys(e,t),Promise.resolve()}return this.yp.flush().catch(e=>this.A.error("PostHog metrics flush failed:",e))}reset(){var t;(t=this.yp)===null||t===void 0||t.reset()}dispose(){var t,e;this.To=!0,(t=this.Up)===null||t===void 0||t.call(this),this.Up=void 0,(e=this.yp)===null||e===void 0||e.reset()}wp(){const t=this._instance,e=this;return{get isDisabled(){return!1},get optedOut(){return!t.is_capturing()},Ys:n=>e.Ys(n),getLibraryId:()=>Ym.LIB_NAME,getLibraryVersion:()=>Ym.LIB_VERSION}}Ys(t,e){return new Promise(n=>{let o=!1;const i=s=>{o||(o=!0,clearTimeout(r),n(s))},r=setTimeout(()=>i({kind:"retry-later",error:new Error("metrics request timed out")}),9e4);this._instance._send_request(sn(sn({method:"POST",url:this.Wp(),data:t,compression:"best-available",batchKey:"metrics"},e&&{transport:e}),{},{fireCallbackOnDrop:!0,callback(s){const a=s.statusCode;if(a>=200&&300>a)i({kind:"ok"});else if(a===413)i({kind:"too-large"});else if(a!==0&&a!==408&&a!==429&&500>a)i({kind:"fatal",error:new Error(`metrics request failed with status ${a}`)});else{var A;i({kind:"retry-later",error:(A=s.error)!==null&&A!==void 0?A:new Error(`metrics request failed with status ${a}`)})}}}))})}Wp(){return this._instance.requestRouter.endpointFor("api","/i/v1/metrics")+"?token="+encodeURIComponent(this._instance.config.token)}}};fV.__defaultExtensionClasses=sn({},sn(sn(sn(sn(sn(sn(sn(sn(sn(sn(sn(sn(sn({},mne),$9n),Z9n),e7n),t7n),n7n),i7n),o7n),r7n),s7n),a7n),A7n),c7n));var Uk=(function(){Ym.SDK_DIST_CHANNEL="npm";const t=pV[_V]=new fV;return(function(){function e(){e.done||(e.done=!0,Sat=!1,vl(pV,function(n){n._dom_loaded()}))}No?.addEventListener?No.readyState==="complete"?e():jc(No,"DOMContentLoaded",e,{capture:!1}):Fn&&gi.error("Browser doesn't support `document.addEventListener` so PostHog couldn't be initialized")})(),t})();class HM extends Error{response;request;options;constructor(e,n,o){const i=e.status||e.status===0?e.status:"",r=e.statusText??"",s=`${i} ${r}`.trim(),a=s?`status code ${s}`:"an unknown error";super(`Request failed with ${a}: ${n.method} ${n.url}`),this.name="HTTPError",this.response=e,this.request=n,this.options=o}}class _At extends Error{name="NonError";value;constructor(e){let n="Non-error value was thrown";try{typeof e=="string"?n=e:e&&typeof e=="object"&&"message"in e&&typeof e.message=="string"&&(n=e.message)}catch{}super(n),this.value=e}}class ixe extends Error{name="ForceRetryError";customDelay;code;customRequest;constructor(e){const n=e?.cause?e.cause instanceof Error?e.cause:new _At(e.cause):void 0;super(e?.code?`Forced retry: ${e.code}`:"Forced retry",n?{cause:n}:void 0),this.customDelay=e?.delay,this.code=e?.code,this.customRequest=e?.request}}const fAt=(()=>{let t=!1,e=!1;const n=typeof globalThis.ReadableStream=="function",o=typeof globalThis.Request=="function";if(n&&o)try{e=new globalThis.Request("https://empty.invalid",{body:new globalThis.ReadableStream,method:"POST",get duplex(){return t=!0,"half"}}).headers.has("Content-Type")}catch(i){if(i instanceof Error&&i.message==="unsupported BodyInit type")return!1;throw i}return t&&!e})(),l7n=typeof globalThis.AbortController=="function",IAt=typeof globalThis.AbortSignal=="function"&&typeof globalThis.AbortSignal.any=="function",g7n=typeof globalThis.ReadableStream=="function",u7n=typeof globalThis.FormData=="function",CAt=["get","post","put","patch","head","delete"],d7n={json:"application/json",text:"text/*",formData:"multipart/form-data",arrayBuffer:"*/*",blob:"*/*",bytes:"*/*"},rxe=2147483647,h7n=new TextEncoder().encode("------WebKitFormBoundaryaxpyiPgbbPti10Rw").length,yAt=Symbol("stop");class xAt{options;constructor(e){this.options=e}}const p7n=t=>new xAt(t),m7n={json:!0,parseJson:!0,stringifyJson:!0,searchParams:!0,prefixUrl:!0,retry:!0,timeout:!0,hooks:!0,throwHttpErrors:!0,onDownloadProgress:!0,onUploadProgress:!0,fetch:!0,context:!0},_7n={next:!0},f7n={method:!0,headers:!0,body:!0,mode:!0,credentials:!0,cache:!0,redirect:!0,referrer:!0,referrerPolicy:!0,integrity:!0,keepalive:!0,signal:!0,window:!0,duplex:!0},I7n=t=>{if(!t)return 0;if(t instanceof FormData){let e=0;for(const[n,o]of t)e+=h7n,e+=new TextEncoder().encode(`Content-Disposition: form-data; name="${n}"`).length,e+=typeof o=="string"?new TextEncoder().encode(o).length:o.size;return e}if(t instanceof Blob)return t.size;if(t instanceof ArrayBuffer)return t.byteLength;if(typeof t=="string")return new TextEncoder().encode(t).length;if(t instanceof URLSearchParams)return new TextEncoder().encode(t.toString()).length;if("byteLength"in t)return t.byteLength;if(typeof t=="object"&&t!==null)try{const e=JSON.stringify(t);return new TextEncoder().encode(e).length}catch{return 0}return 0},EAt=(t,e,n)=>{let o,i=0;return t.pipeThrough(new TransformStream({transform(r,s){if(s.enqueue(r),o){i+=o.byteLength;let a=e===0?0:i/e;a>=1&&(a=1-Number.EPSILON),n?.({percent:a,totalBytes:Math.max(e,i),transferredBytes:i},o)}o=r},flush(){o&&(i+=o.byteLength,n?.({percent:1,totalBytes:Math.max(e,i),transferredBytes:i},o))}}))},C7n=(t,e)=>{if(!t.body)return t;if(t.status===204)return new Response(null,{status:t.status,statusText:t.statusText,headers:t.headers});const n=Math.max(0,Number(t.headers.get("content-length"))||0);return new Response(EAt(t.body,n,e),{status:t.status,statusText:t.statusText,headers:t.headers})},y7n=(t,e,n)=>{if(!t.body)return t;const o=I7n(n??t.body);return new Request(t,{duplex:"half",body:EAt(t.body,o,e)})},OM=t=>t!==null&&typeof t=="object",_ne=(...t)=>{for(const e of t)if((!OM(e)||Array.isArray(e))&&e!==void 0)throw new TypeError("The `options` argument must be an object");return sxe({},...t)},BAt=(t={},e={})=>{const n=new globalThis.Headers(t),o=e instanceof globalThis.Headers,i=new globalThis.Headers(e);for(const[r,s]of i.entries())o&&s==="undefined"||s===void 0?n.delete(r):n.set(r,s);return n};function fne(t,e,n){return Object.hasOwn(e,n)&&e[n]===void 0?[]:sxe(t[n]??[],e[n]??[])}const bAt=(t={},e={})=>({beforeRequest:fne(t,e,"beforeRequest"),beforeRetry:fne(t,e,"beforeRetry"),afterResponse:fne(t,e,"afterResponse"),beforeError:fne(t,e,"beforeError")}),x7n=(t,e)=>{const n=new URLSearchParams;for(const o of[t,e])if(o!==void 0)if(o instanceof URLSearchParams)for(const[i,r]of o.entries())n.append(i,r);else if(Array.isArray(o))for(const i of o){if(!Array.isArray(i)||i.length!==2)throw new TypeError("Array search parameters must be provided in [[key, value], ...] format");n.append(String(i[0]),String(i[1]))}else if(OM(o))for(const[i,r]of Object.entries(o))r!==void 0&&n.append(i,String(r));else{const i=new URLSearchParams(o);for(const[r,s]of i.entries())n.append(r,s)}return n},sxe=(...t)=>{let e={},n={},o={},i;const r=[];for(const s of t)if(Array.isArray(s))Array.isArray(e)||(e=[]),e=[...e,...s];else if(OM(s)){for(let[a,A]of Object.entries(s)){if(a==="signal"&&A instanceof globalThis.AbortSignal){r.push(A);continue}if(a==="context"){if(A!=null&&(!OM(A)||Array.isArray(A)))throw new TypeError("The `context` option must be an object");e={...e,context:A==null?{}:{...e.context,...A}};continue}if(a==="searchParams"){A==null?i=void 0:i=i===void 0?A:x7n(i,A);continue}OM(A)&&a in e&&(A=sxe(e[a],A)),e={...e,[a]:A}}OM(s.hooks)&&(o=bAt(o,s.hooks),e.hooks=o),OM(s.headers)&&(n=BAt(n,s.headers),e.headers=n)}return i!==void 0&&(e.searchParams=i),r.length>0&&(r.length===1?e.signal=r[0]:IAt?e.signal=AbortSignal.any(r):e.signal=r.at(-1)),e},E7n=t=>CAt.includes(t)?t.toUpperCase():t,SAt={limit:2,methods:["get","put","head","delete","options","trace"],statusCodes:[408,413,429,500,502,503,504],afterStatusCodes:[413,429,503],maxRetryAfter:Number.POSITIVE_INFINITY,backoffLimit:Number.POSITIVE_INFINITY,delay:t=>.3*2**(t-1)*1e3,jitter:void 0,retryOnTimeout:!1},B7n=(t={})=>{if(typeof t=="number")return{...SAt,limit:t};if(t.methods&&!Array.isArray(t.methods))throw new Error("retry.methods must be an array");if(t.methods&&=t.methods.map(n=>n.toLowerCase()),t.statusCodes&&!Array.isArray(t.statusCodes))throw new Error("retry.statusCodes must be an array");const e=Object.fromEntries(Object.entries(t).filter(([,n])=>n!==void 0));return{...SAt,...e}};class axe extends Error{request;constructor(e){super(`Request timed out: ${e.method} ${e.url}`),this.name="TimeoutError",this.request=e}}async function b7n(t,e,n,o){return new Promise((i,r)=>{const s=setTimeout(()=>{n&&n.abort(),r(new axe(t))},o.timeout);o.fetch(t,e).then(i).catch(r).then(()=>{clearTimeout(s)})})}async function S7n(t,{signal:e}){return new Promise((n,o)=>{e&&(e.throwIfAborted(),e.addEventListener("abort",i,{once:!0}));function i(){clearTimeout(r),o(e.reason)}const r=setTimeout(()=>{e?.removeEventListener("abort",i),n()},t)})}const Q7n=(t,e)=>{const n={};for(const o in e)Object.hasOwn(e,o)&&!(o in f7n)&&!(o in m7n)&&(!(o in t)||o in _7n)&&(n[o]=e[o]);return n},v7n=t=>t===void 0?!1:Array.isArray(t)?t.length>0:t instanceof URLSearchParams?t.size>0:typeof t=="object"?Object.keys(t).length>0:typeof t=="string"?t.trim().length>0:!!t;function w7n(t){return t instanceof HM||t?.name===HM.name}function P7n(t){return t instanceof axe||t?.name===axe.name}let QAt=class Jnt{static create(e,n){const o=new Jnt(e,n),i=async()=>{if(typeof o.#e.timeout=="number"&&o.#e.timeout>rxe)throw new RangeError(`The \`timeout\` option cannot be greater than ${rxe}`);await Promise.resolve();let s=await o.#_();for(const a of o.#e.hooks.afterResponse){const A=o.#d(s.clone());let c;try{c=await a(o.request,o.#c(),A,{retryCount:o.#n})}catch(g){throw o.#r(A),o.#r(s),g}if(c instanceof xAt)throw o.#r(A),o.#r(s),new ixe(c.options);const l=c instanceof globalThis.Response?c:s;A!==l&&o.#r(A),s!==l&&o.#r(s),s=l}if(o.#d(s),!s.ok&&(typeof o.#e.throwHttpErrors=="function"?o.#e.throwHttpErrors(s.status):o.#e.throwHttpErrors)){let a=new HM(s,o.request,o.#c());for(const A of o.#e.hooks.beforeError)a=await A(a,{retryCount:o.#n});throw a}if(o.#e.onDownloadProgress){if(typeof o.#e.onDownloadProgress!="function")throw new TypeError("The `onDownloadProgress` option must be a function");if(!g7n)throw new Error("Streams are not supported in your environment. `ReadableStream` is missing.");const a=s.clone();return o.#r(s),C7n(a,o.#e.onDownloadProgress)}return s},r=o.#h(i).finally(()=>{const s=o.#s;o.#g(s?.body??void 0),o.#g(o.request.body??void 0)});for(const[s,a]of Object.entries(d7n))s==="bytes"&&typeof globalThis.Response?.prototype?.bytes!="function"||(r[s]=async()=>{o.request.headers.set("accept",o.request.headers.get("accept")||a);const A=await r;if(s==="json"){if(A.status===204)return"";const c=await A.text();return c===""?"":n.parseJson?n.parseJson(c):JSON.parse(c)}return A[s]()});return r}static#a(e){return e&&typeof e=="object"&&!Array.isArray(e)&&!(e instanceof URLSearchParams)?Object.fromEntries(Object.entries(e).filter(([,n])=>n!==void 0)):e}request;#o;#n=0;#t;#e;#s;#i;#A;constructor(e,n={}){if(this.#t=e,this.#e={...n,headers:BAt(this.#t.headers,n.headers),hooks:bAt({beforeRequest:[],beforeRetry:[],beforeError:[],afterResponse:[]},n.hooks),method:E7n(n.method??this.#t.method??"GET"),prefixUrl:String(n.prefixUrl||""),retry:B7n(n.retry),throwHttpErrors:n.throwHttpErrors??!0,timeout:n.timeout??1e4,fetch:n.fetch??globalThis.fetch.bind(globalThis),context:n.context??{}},typeof this.#t!="string"&&!(this.#t instanceof URL||this.#t instanceof globalThis.Request))throw new TypeError("`input` must be a string, URL, or Request");if(this.#e.prefixUrl&&typeof this.#t=="string"){if(this.#t.startsWith("/"))throw new Error("`input` must not begin with a slash when using `prefixUrl`");this.#e.prefixUrl.endsWith("/")||(this.#e.prefixUrl+="/"),this.#t=this.#e.prefixUrl+this.#t}l7n&&IAt&&(this.#i=this.#e.signal??this.#t.signal,this.#o=new globalThis.AbortController,this.#e.signal=this.#i?AbortSignal.any([this.#i,this.#o.signal]):this.#o.signal),fAt&&(this.#e.duplex="half"),this.#e.json!==void 0&&(this.#e.body=this.#e.stringifyJson?.(this.#e.json)??JSON.stringify(this.#e.json),this.#e.headers.set("content-type",this.#e.headers.get("content-type")??"application/json"));const o=n.headers&&new globalThis.Headers(n.headers).has("content-type");if(this.#t instanceof globalThis.Request&&(u7n&&this.#e.body instanceof globalThis.FormData||this.#e.body instanceof URLSearchParams)&&!o&&this.#e.headers.delete("content-type"),this.request=new globalThis.Request(this.#t,this.#e),v7n(this.#e.searchParams)){const r="?"+(typeof this.#e.searchParams=="string"?this.#e.searchParams.replace(/^\?/,""):new URLSearchParams(Jnt.#a(this.#e.searchParams)).toString()),s=this.request.url.replace(/(?:\?.*?)?(?=#|$)/,r);this.request=new globalThis.Request(s,this.#e)}if(this.#e.onUploadProgress){if(typeof this.#e.onUploadProgress!="function")throw new TypeError("The `onUploadProgress` option must be a function");if(!fAt)throw new Error("Request streams are not supported in your environment. The `duplex` option for `Request` is not available.");this.request=this.#p(this.request,this.#e.body??void 0)}}#l(){const e=this.#e.retry.delay(this.#n);let n=e;this.#e.retry.jitter===!0?n=Math.random()*e:typeof this.#e.retry.jitter=="function"&&(n=this.#e.retry.jitter(e),(!Number.isFinite(n)||n<0)&&(n=e));const o=this.#e.retry.backoffLimit??Number.POSITIVE_INFINITY;return Math.min(o,n)}async#m(e){if(this.#n++,this.#n>this.#e.retry.limit)throw e;const n=e instanceof Error?e:new _At(e);if(n instanceof ixe)return n.customDelay??this.#l();if(!this.#e.retry.methods.includes(this.request.method.toLowerCase()))throw e;if(this.#e.retry.shouldRetry!==void 0){const o=await this.#e.retry.shouldRetry({error:n,retryCount:this.#n});if(o===!1)throw e;if(o===!0)return this.#l()}if(P7n(e)&&!this.#e.retry.retryOnTimeout)throw e;if(w7n(e)){if(!this.#e.retry.statusCodes.includes(e.response.status))throw e;const o=e.response.headers.get("Retry-After")??e.response.headers.get("RateLimit-Reset")??e.response.headers.get("X-RateLimit-Retry-After")??e.response.headers.get("X-RateLimit-Reset")??e.response.headers.get("X-Rate-Limit-Reset");if(o&&this.#e.retry.afterStatusCodes.includes(e.response.status)){let i=Number(o)*1e3;Number.isNaN(i)?i=Date.parse(o)-Date.now():i>=Date.parse("2024-01-01")&&(i-=Date.now());const r=this.#e.retry.maxRetryAfter??i;return i<r?i:r}if(e.response.status===413)throw e}return this.#l()}#d(e){return this.#e.parseJson&&(e.json=async()=>this.#e.parseJson(await e.text())),e}#g(e){e&&e.cancel().catch(()=>{})}#r(e){this.#g(e.body??void 0)}async#h(e){try{return await e()}catch(n){const o=Math.min(await this.#m(n),rxe);if(this.#n<1)throw n;if(await S7n(o,this.#i?{signal:this.#i}:{}),n instanceof ixe&&n.customRequest){const i=this.#e.signal?new globalThis.Request(n.customRequest,{signal:this.#e.signal}):new globalThis.Request(n.customRequest);this.#u(i)}for(const i of this.#e.hooks.beforeRetry){const r=await i({request:this.request,options:this.#c(),error:n,retryCount:this.#n});if(r instanceof globalThis.Request){this.#u(r);break}if(r instanceof globalThis.Response)return r;if(r===yAt)return}return this.#h(e)}}async#_(){this.#o?.signal.aborted&&(this.#o=new globalThis.AbortController,this.#e.signal=this.#i?AbortSignal.any([this.#i,this.#o.signal]):this.#o.signal,this.request=new globalThis.Request(this.request,{signal:this.#e.signal}));for(const n of this.#e.hooks.beforeRequest){const o=await n(this.request,this.#c(),{retryCount:this.#n});if(o instanceof Response)return o;if(o instanceof globalThis.Request){this.#u(o);break}}const e=Q7n(this.request,this.#e);return this.#s=this.request,this.request=this.#s.clone(),this.#e.timeout===!1?this.#e.fetch(this.#s,e):b7n(this.#s,e,this.#o,this.#e)}#c(){if(!this.#A){const{hooks:e,...n}=this.#e;this.#A=Object.freeze(n)}return this.#A}#u(e){this.#A=void 0,this.request=this.#p(e)}#p(e,n){return!this.#e.onUploadProgress||!e.body?e:y7n(e,this.#e.onUploadProgress,n??this.#e.body??void 0)}};const Axe=t=>{const e=(n,o)=>QAt.create(n,_ne(t,o));for(const n of CAt)e[n]=(o,i)=>QAt.create(o,_ne(t,i,{method:n}));return e.create=n=>Axe(_ne(n)),e.extend=n=>(typeof n=="function"&&(n=n(t??{})),Axe(_ne(t,n))),e.stop=yAt,e.retry=p7n,e},M7n=Axe();class D7n extends HM{constructor(e,n,o,i){super(e,n,o),this.name="RegistryHTTPError",this.message=i}}function yV(t){return typeof window<"u"?window[t]:null}function GM(){const t=yV("TSCIRCUIT_REGISTRY_API_BASE_URL")||void 0||"https://registry-api.tscircuit.com",e=yV("TSCIRCUIT_REGISTRY_TOKEN");return M7n.create({prefixUrl:t,headers:{Authorization:`Bearer ${e}`},timeout:3e4,hooks:{afterResponse:[async(n,o,i)=>{if(i.ok)return i;let r=null;try{r=await i.clone().json()}catch(g){console.error("Failed to parse registry error response",g)}const s=r?.error?.message??r?.error?.error_message??r?.message,a=r?.error?.error_code??r?.error_code,A=new URL(i.url),l=[`Registry request failed for ${`${A.pathname}${A.search}`} (${i.status})`];throw s&&l.push(`Server message: ${s}`),a&&l.push(`Error code: ${a}`),new D7n(i,n,o,l.join(" | "))}]}})}function Ine(){return!!yV("TSCIRCUIT_REGISTRY_TOKEN")}const Cne={get:(t,e)=>GM().get(t,e),post:(t,e)=>GM().post(t,e),put:(t,e)=>GM().put(t,e),delete:(t,e)=>GM().delete(t,e),patch:(t,e)=>GM().patch(t,e)},N7n="phc_htd8AQjSfVEsFCLQMAiUooG4Q0DKBCjqYuQglc9V3Wo",R7n="https://postpig.tscircuit.com",vAt="runframe:anonymous-id",cxe=()=>typeof window<"u",wAt=t=>t.includes("localhost")||t.includes("127.0.0.1"),T7n=t=>{try{return new URL(t).hostname}catch{return null}},k7n=()=>{if(!cxe())return null;let t=null;return document.referrer&&(t=T7n(document.referrer)),t??window.location.hostname},F7n=()=>typeof crypto<"u"&&"randomUUID"in crypto?crypto.randomUUID():`${Date.now().toString(36)}-${Math.random().toString(36).slice(2)}`,L7n=()=>{if(!cxe())return null;try{const t=window.localStorage.getItem(vAt);if(t)return t;const e=F7n();return window.localStorage.setItem(vAt,e),e}catch{return null}},H7n=()=>yV("TSCIRCUIT_USE_RUNFRAME_FOR_CLI")===!0,PAt=()=>!cxe()||wAt(window.location.hostname)&&!H7n()?!1:(Uk.__loaded||Uk.init(N7n,{api_host:R7n,person_profiles:"always"}),!0),O7n=()=>{if(!PAt())return null;const t=k7n(),e=t!=null&&!wAt(t);let n=null;e||(n=L7n());let o,i;return e?(o=`domain:${t}`,i="domain"):(o=void 0,n&&(o=`anonymous:${n}`),i="anonymous_id"),{embedDomain:t,anonymousId:n,distinctId:o,identityType:i}},G7n=(t,{source:e,...n})=>{const o=O7n();if(!o)return;const{embedDomain:i,anonymousId:r,distinctId:s,identityType:a}=o;if(s){const A={};a==="domain"&&i&&(A.embed_domain=i),a==="anonymous_id"&&r&&(A.runframe_anonymous_id=r),Uk.identify(s,A)}Uk.capture(t,{...n,source:e,embed_domain:i,runframe_anonymous_id:r,identity_type:a})},Y7n=t=>{G7n("runframe_activity",t)};PAt();function U7n(t){const e=String.fromCodePoint(...t);return btoa(e)}var tm=Uint8Array,N3=Uint16Array,lxe=Int32Array,yne=new tm([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]),xne=new tm([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]),gxe=new tm([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),MAt=function(t,e){for(var n=new N3(31),o=0;o<31;++o)n[o]=e+=1<<t[o-1];for(var i=new lxe(n[30]),o=1;o<30;++o)for(var r=n[o];r<n[o+1];++r)i[r]=r-n[o]<<5|o;return{b:n,r:i}},DAt=MAt(yne,2),NAt=DAt.b,uxe=DAt.r;NAt[28]=258,uxe[258]=28;for(var RAt=MAt(xne,0),K7n=RAt.b,TAt=RAt.r,dxe=new N3(32768),gd=0;gd<32768;++gd){var uQ=(gd&43690)>>1|(gd&21845)<<1;uQ=(uQ&52428)>>2|(uQ&13107)<<2,uQ=(uQ&61680)>>4|(uQ&3855)<<4,dxe[gd]=((uQ&65280)>>8|(uQ&255)<<8)>>1}for(var Q9=(function(t,e,n){for(var o=t.length,i=0,r=new N3(e);i<o;++i)t[i]&&++r[t[i]-1];var s=new N3(e);for(i=1;i<e;++i)s[i]=s[i-1]+r[i-1]<<1;var a;if(n){a=new N3(1<<e);var A=15-e;for(i=0;i<o;++i)if(t[i])for(var c=i<<4|t[i],l=e-t[i],g=s[t[i]-1]++<<l,u=g|(1<<l)-1;g<=u;++g)a[dxe[g]>>A]=c}else for(a=new N3(o),i=0;i<o;++i)t[i]&&(a[i]=dxe[s[t[i]-1]++]>>15-t[i]);return a}),dQ=new tm(288),gd=0;gd<144;++gd)dQ[gd]=8;for(var gd=144;gd<256;++gd)dQ[gd]=9;for(var gd=256;gd<280;++gd)dQ[gd]=7;for(var gd=280;gd<288;++gd)dQ[gd]=8;for(var xV=new tm(32),gd=0;gd<32;++gd)xV[gd]=5;var V7n=Q9(dQ,9,0),z7n=Q9(dQ,9,1),J7n=Q9(xV,5,0),W7n=Q9(xV,5,1),hxe=function(t){for(var e=t[0],n=1;n<t.length;++n)t[n]>e&&(e=t[n]);return e},H4=function(t,e,n){var o=e/8|0;return(t[o]|t[o+1]<<8)>>(e&7)&n},pxe=function(t,e){var n=e/8|0;return(t[n]|t[n+1]<<8|t[n+2]<<16)>>(e&7)},mxe=function(t){return(t+7)/8|0},Kk=function(t,e,n){return(e==null||e<0)&&(e=0),(n==null||n>t.length)&&(n=t.length),new tm(t.subarray(e,n))},j7n=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],ix=function(t,e,n){var o=new Error(e||j7n[t]);if(o.code=t,Error.captureStackTrace&&Error.captureStackTrace(o,ix),!n)throw o;return o},kAt=function(t,e,n,o){var i=t.length,r=0;if(!i||e.f&&!e.l)return n||new tm(0);var s=!n,a=s||e.i!=2,A=e.i;s&&(n=new tm(i*3));var c=function(me){var ye=n.length;if(me>ye){var ve=new tm(Math.max(ye*2,me));ve.set(n),n=ve}},l=e.f||0,g=e.p||0,u=e.b||0,h=e.l,d=e.d,p=e.m,m=e.n,_=i*8;do{if(!h){l=H4(t,g,1);var f=H4(t,g+1,3);if(g+=3,f)if(f==1)h=z7n,d=W7n,p=9,m=5;else if(f==2){var x=H4(t,g,31)+257,E=H4(t,g+10,15)+4,B=x+H4(t,g+5,31)+1;g+=14;for(var S=new tm(B),Q=new tm(19),w=0;w<E;++w)Q[gxe[w]]=H4(t,g+w*3,7);g+=E*3;for(var M=hxe(Q),k=(1<<M)-1,R=Q9(Q,M,1),w=0;w<B;){var F=R[H4(t,g,k)];g+=F&15;var I=F>>4;if(I<16)S[w++]=I;else{var O=0,U=0;for(I==16?(U=3+H4(t,g,3),g+=2,O=S[w-1]):I==17?(U=3+H4(t,g,7),g+=3):I==18&&(U=11+H4(t,g,127),g+=7);U--;)S[w++]=O}}var Y=S.subarray(0,x),J=S.subarray(x);p=hxe(Y),m=hxe(J),h=Q9(Y,p,1),d=Q9(J,m,1)}else ix(1);else{var I=mxe(g)+4,C=t[I-4]|t[I-3]<<8,y=I+C;if(y>i){A&&ix(0);break}a&&c(u+C),n.set(t.subarray(I,y),u),e.b=u+=C,e.p=g=y*8,e.f=l;continue}if(g>_){A&&ix(0);break}}a&&c(u+131072);for(var ee=(1<<p)-1,W=(1<<m)-1,q=g;;q=g){var O=h[pxe(t,g)&ee],ie=O>>4;if(g+=O&15,g>_){A&&ix(0);break}if(O||ix(2),ie<256)n[u++]=ie;else if(ie==256){q=g,h=null;break}else{var se=ie-254;if(ie>264){var w=ie-257,oe=yne[w];se=H4(t,g,(1<<oe)-1)+NAt[w],g+=oe}var ge=d[pxe(t,g)&W],ue=ge>>4;ge||ix(3),g+=ge&15;var J=K7n[ue];if(ue>3){var oe=xne[ue];J+=pxe(t,g)&(1<<oe)-1,g+=oe}if(g>_){A&&ix(0);break}a&&c(u+131072);var Ie=u+se;if(u<J){var le=r-J,_e=Math.min(J,Ie);for(le+u<0&&ix(3);u<_e;++u)n[u]=o[le+u]}for(;u<Ie;++u)n[u]=n[u-J]}}e.l=h,e.p=q,e.b=u,e.f=l,h&&(l=1,e.m=p,e.d=d,e.n=m)}while(!l);return u!=n.length&&s?Kk(n,0,u):n.subarray(0,u)},S8=function(t,e,n){n<<=e&7;var o=e/8|0;t[o]|=n,t[o+1]|=n>>8},EV=function(t,e,n){n<<=e&7;var o=e/8|0;t[o]|=n,t[o+1]|=n>>8,t[o+2]|=n>>16},_xe=function(t,e){for(var n=[],o=0;o<t.length;++o)t[o]&&n.push({s:o,f:t[o]});var i=n.length,r=n.slice();if(!i)return{t:OAt,l:0};if(i==1){var s=new tm(n[0].s+1);return s[n[0].s]=1,{t:s,l:1}}n.sort(function(y,x){return y.f-x.f}),n.push({s:-1,f:25001});var a=n[0],A=n[1],c=0,l=1,g=2;for(n[0]={s:-1,f:a.f+A.f,l:a,r:A};l!=i-1;)a=n[n[c].f<n[g].f?c++:g++],A=n[c!=l&&n[c].f<n[g].f?c++:g++],n[l++]={s:-1,f:a.f+A.f,l:a,r:A};for(var u=r[0].s,o=1;o<i;++o)r[o].s>u&&(u=r[o].s);var h=new N3(u+1),d=fxe(n[l-1],h,0);if(d>e){var o=0,p=0,m=d-e,_=1<<m;for(r.sort(function(x,E){return h[E.s]-h[x.s]||x.f-E.f});o<i;++o){var f=r[o].s;if(h[f]>e)p+=_-(1<<d-h[f]),h[f]=e;else break}for(p>>=m;p>0;){var I=r[o].s;h[I]<e?p-=1<<e-h[I]++-1:++o}for(;o>=0&&p;--o){var C=r[o].s;h[C]==e&&(--h[C],++p)}d=e}return{t:new tm(h),l:d}},fxe=function(t,e,n){return t.s==-1?Math.max(fxe(t.l,e,n+1),fxe(t.r,e,n+1)):e[t.s]=n},FAt=function(t){for(var e=t.length;e&&!t[--e];);for(var n=new N3(++e),o=0,i=t[0],r=1,s=function(A){n[o++]=A},a=1;a<=e;++a)if(t[a]==i&&a!=e)++r;else{if(!i&&r>2){for(;r>138;r-=138)s(32754);r>2&&(s(r>10?r-11<<5|28690:r-3<<5|12305),r=0)}else if(r>3){for(s(i),--r;r>6;r-=6)s(8304);r>2&&(s(r-3<<5|8208),r=0)}for(;r--;)s(i);r=1,i=t[a]}return{c:n.subarray(0,o),n:e}},BV=function(t,e){for(var n=0,o=0;o<e.length;++o)n+=t[o]*e[o];return n},LAt=function(t,e,n){var o=n.length,i=mxe(e+2);t[i]=o&255,t[i+1]=o>>8,t[i+2]=t[i]^255,t[i+3]=t[i+1]^255;for(var r=0;r<o;++r)t[i+r+4]=n[r];return(i+4+o)*8},HAt=function(t,e,n,o,i,r,s,a,A,c,l){S8(e,l++,n),++i[256];for(var g=_xe(i,15),u=g.t,h=g.l,d=_xe(r,15),p=d.t,m=d.l,_=FAt(u),f=_.c,I=_.n,C=FAt(p),y=C.c,x=C.n,E=new N3(19),B=0;B<f.length;++B)++E[f[B]&31];for(var B=0;B<y.length;++B)++E[y[B]&31];for(var S=_xe(E,7),Q=S.t,w=S.l,M=19;M>4&&!Q[gxe[M-1]];--M);var k=c+5<<3,R=BV(i,dQ)+BV(r,xV)+s,F=BV(i,u)+BV(r,p)+s+14+3*M+BV(E,Q)+2*E[16]+3*E[17]+7*E[18];if(A>=0&&k<=R&&k<=F)return LAt(e,l,t.subarray(A,A+c));var O,U,Y,J;if(S8(e,l,1+(F<R)),l+=2,F<R){O=Q9(u,h,0),U=u,Y=Q9(p,m,0),J=p;var ee=Q9(Q,w,0);S8(e,l,I-257),S8(e,l+5,x-1),S8(e,l+10,M-4),l+=14;for(var B=0;B<M;++B)S8(e,l+3*B,Q[gxe[B]]);l+=3*M;for(var W=[f,y],q=0;q<2;++q)for(var ie=W[q],B=0;B<ie.length;++B){var se=ie[B]&31;S8(e,l,ee[se]),l+=Q[se],se>15&&(S8(e,l,ie[B]>>5&127),l+=ie[B]>>12)}}else O=V7n,U=dQ,Y=J7n,J=xV;for(var B=0;B<a;++B){var oe=o[B];if(oe>255){var se=oe>>18&31;EV(e,l,O[se+257]),l+=U[se+257],se>7&&(S8(e,l,oe>>23&31),l+=yne[se]);var ge=oe&31;EV(e,l,Y[ge]),l+=J[ge],ge>3&&(EV(e,l,oe>>5&8191),l+=xne[ge])}else EV(e,l,O[oe]),l+=U[oe]}return EV(e,l,O[256]),l+U[256]},q7n=new lxe([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),OAt=new tm(0),X7n=function(t,e,n,o,i,r){var s=r.z||t.length,a=new tm(o+s+5*(1+Math.ceil(s/7e3))+i),A=a.subarray(o,a.length-i),c=r.l,l=(r.r||0)&7;if(e){l&&(A[0]=r.r>>3);for(var g=q7n[e-1],u=g>>13,h=g&8191,d=(1<<n)-1,p=r.p||new N3(32768),m=r.h||new N3(d+1),_=Math.ceil(n/3),f=2*_,I=function(Pe){return(t[Pe]^t[Pe+1]<<_^t[Pe+2]<<f)&d},C=new lxe(25e3),y=new N3(288),x=new N3(32),E=0,B=0,S=r.i||0,Q=0,w=r.w||0,M=0;S+2<s;++S){var k=I(S),R=S&32767,F=m[k];if(p[R]=F,m[k]=R,w<=S){var O=s-S;if((E>7e3||Q>24576)&&(O>423||!c)){l=HAt(t,A,0,C,y,x,B,Q,M,S-M,l),Q=E=B=0,M=S;for(var U=0;U<286;++U)y[U]=0;for(var U=0;U<30;++U)x[U]=0}var Y=2,J=0,ee=h,W=R-F&32767;if(O>2&&k==I(S-W))for(var q=Math.min(u,O)-1,ie=Math.min(32767,S),se=Math.min(258,O);W<=ie&&--ee&&R!=F;){if(t[S+Y]==t[S+Y-W]){for(var oe=0;oe<se&&t[S+oe]==t[S+oe-W];++oe);if(oe>Y){if(Y=oe,J=W,oe>q)break;for(var ge=Math.min(W,oe-2),ue=0,U=0;U<ge;++U){var Ie=S-W+U&32767,le=p[Ie],_e=Ie-le&32767;_e>ue&&(ue=_e,F=Ie)}}}R=F,F=p[R],W+=R-F&32767}if(J){C[Q++]=268435456|uxe[Y]<<18|TAt[J];var me=uxe[Y]&31,ye=TAt[J]&31;B+=yne[me]+xne[ye],++y[257+me],++x[ye],w=S+Y,++E}else C[Q++]=t[S],++y[t[S]]}}for(S=Math.max(S,w);S<s;++S)C[Q++]=t[S],++y[t[S]];l=HAt(t,A,c,C,y,x,B,Q,M,S-M,l),c||(r.r=l&7|A[l/8|0]<<3,l-=7,r.h=m,r.p=p,r.i=S,r.w=w)}else{for(var S=r.w||0;S<s+c;S+=65535){var ve=S+65535;ve>=s&&(A[l/8|0]=c,ve=s),l=LAt(A,l+1,t.subarray(S,ve))}r.i=s}return Kk(a,0,o+mxe(l)+i)},$7n=(function(){for(var t=new Int32Array(256),e=0;e<256;++e){for(var n=e,o=9;--o;)n=(n&1&&-306674912)^n>>>1;t[e]=n}return t})(),Z7n=function(){var t=-1;return{p:function(e){for(var n=t,o=0;o<e.length;++o)n=$7n[n&255^e[o]]^n>>>8;t=n},d:function(){return~t}}},GAt=function(){var t=1,e=0;return{p:function(n){for(var o=t,i=e,r=n.length|0,s=0;s!=r;){for(var a=Math.min(s+2655,r);s<a;++s)i+=o+=n[s];o=(o&65535)+15*(o>>16),i=(i&65535)+15*(i>>16)}t=o,e=i},d:function(){return t%=65521,e%=65521,(t&255)<<24|(t&65280)<<8|(e&255)<<8|e>>8}}},YAt=function(t,e,n,o,i){if(!i&&(i={l:1},e.dictionary)){var r=e.dictionary.subarray(-32768),s=new tm(r.length+t.length);s.set(r),s.set(t,r.length),t=s,i.w=r.length}return X7n(t,e.level==null?6:e.level,e.mem==null?i.l?Math.ceil(Math.max(8,Math.min(13,Math.log(t.length)))*1.5):20:12+e.mem,n,o,i)},bV=function(t,e,n){for(;n;++e)t[e]=n,n>>>=8},e6n=function(t,e){var n=e.filename;if(t[0]=31,t[1]=139,t[2]=8,t[8]=e.level<2?4:e.level==9?2:0,t[9]=3,e.mtime!=0&&bV(t,4,Math.floor(new Date(e.mtime||Date.now())/1e3)),n){t[3]=8;for(var o=0;o<=n.length;++o)t[o+10]=n.charCodeAt(o)}},t6n=function(t){return 10+(t.filename?t.filename.length+1:0)},n6n=function(t,e){var n=e.level,o=n==0?0:n<6?1:n==9?3:2;if(t[0]=120,t[1]=o<<6|(e.dictionary&&32),t[1]|=31-(t[0]<<8|t[1])%31,e.dictionary){var i=GAt();i.p(e.dictionary),bV(t,2,i.d())}},UAt=function(t,e){return((t[0]&15)!=8||t[0]>>4>7||(t[0]<<8|t[1])%31)&&ix(6,"invalid zlib data"),(t[1]>>5&1)==+!e&&ix(6,"invalid zlib data: "+(t[1]&32?"need":"unexpected")+" dictionary"),(t[1]>>3&4)+2},Ixe=(function(){function t(e,n){typeof e=="function"&&(n=e,e={}),this.ondata=n;var o=e&&e.dictionary&&e.dictionary.subarray(-32768);this.s={i:0,b:o?o.length:0},this.o=new tm(32768),this.p=new tm(0),o&&this.o.set(o)}return t.prototype.e=function(e){if(this.ondata||ix(5),this.d&&ix(4),!this.p.length)this.p=e;else if(e.length){var n=new tm(this.p.length+e.length);n.set(this.p),n.set(e,this.p.length),this.p=n}},t.prototype.c=function(e){this.s.i=+(this.d=e||!1);var n=this.s.b,o=kAt(this.p,this.s,this.o);this.ondata(Kk(o,n,this.s.b),this.d),this.o=Kk(o,this.s.b-32768),this.s.b=this.o.length,this.p=Kk(this.p,this.s.p/8|0),this.s.p&=7},t.prototype.push=function(e,n){this.e(e),this.c(n)},t})();function Cxe(t,e){e||(e={});var n=Z7n(),o=t.length;n.p(t);var i=YAt(t,e,t6n(e),8),r=i.length;return e6n(i,e),bV(i,r-8,n.d()),bV(i,r-4,o),i}function KAt(t,e){e||(e={});var n=GAt();n.p(t);var o=YAt(t,e,e.dictionary?6:2,4);return n6n(o,e),bV(o,o.length-4,n.d()),o}var Ene=(function(){function t(e,n){Ixe.call(this,e,n),this.v=e&&e.dictionary?2:1}return t.prototype.push=function(e,n){if(Ixe.prototype.e.call(this,e),this.v){if(this.p.length<6&&!n)return;this.p=this.p.subarray(UAt(this.p,this.v-1)),this.v=0}n&&(this.p.length<4&&ix(6,"invalid zlib data"),this.p=this.p.subarray(0,-4)),Ixe.prototype.c.call(this,n)},t})();function o6n(t,e){return kAt(t.subarray(UAt(t,e),-4),{i:2},e,e)}var VAt=typeof TextEncoder<"u"&&new TextEncoder,i6n=typeof TextDecoder<"u"&&new TextDecoder,r6n=0;try{i6n.decode(OAt,{stream:!0}),r6n=1}catch{}function yxe(t,e){var n;if(VAt)return VAt.encode(t);for(var o=t.length,i=new tm(t.length+(t.length>>1)),r=0,s=function(c){i[r++]=c},n=0;n<o;++n){if(r+5>i.length){var a=new tm(r+8+(o-n<<1));a.set(i),i=a}var A=t.charCodeAt(n);A<128||e?s(A):A<2048?(s(192|A>>6),s(128|A&63)):A>55295&&A<57344?(A=65536+(A&1047552)|t.charCodeAt(++n)&1023,s(240|A>>18),s(128|A>>12&63),s(128|A>>6&63),s(128|A&63)):(s(224|A>>12),s(128|A>>6&63),s(128|A&63))}return Kk(i,0,r)}function s6n(t,e){const n=JSON.stringify(t),o=Cxe(yxe(n));return`https://tscircuit.com/editor?#data:application/gzip;base64,${U7n(o)}`}function zr(...t){return G5n(R4(t))}const zAt=t=>t.replace(/_/g," ").replace(/\b\w/g,e=>e.toUpperCase()),xxe=l5n,Bne=te.forwardRef(({className:t,...e},n)=>V.jsx(lit,{ref:n,className:zr("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",t),...e}));Bne.displayName=lit.displayName;const v9=te.forwardRef(({className:t,...e},n)=>V.jsx(git,{ref:n,className:zr("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",t),...e}));v9.displayName=git.displayName;const q1=te.forwardRef(({className:t,...e},n)=>V.jsx(uit,{ref:n,className:zr("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",t),...e}));q1.displayName=uit.displayName;const JAt="T1RUTwAJAIAAAwAQQ0ZGIFhQSpcAAAcwAABJ3U9TLzJqmmVhAAABAAAAAGBjbWFwFN0WswAABEwAAALEaGVhZC1P1HwAAACcAAAANmhoZWEDrgI1AAAA1AAAACRobXR44xAAAAAAURAAAAFQbWF4cABUUAAAAAD4AAAABm5hbWUZQ94BAAABYAAAAutwb3N0AAMAAAAABxAAAAAgAAEAAAABAADb+Z65Xw889QADA+gAAAAA5e9IsgAAAADl70iy/9P/PwKHAvkAAAADAAIAAAAAAAAAAQAAA6z/LAAAArQAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAFQAAFAAAFQAAAADArQB9AAFAAACigK7AAAAjAKKArsAAAHfADEBAgAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAABYWFhYAEAAIQB6A6z/LAAAAvkAwQAAAAEAAAAAAiwC1wAAAAAAAAAAACIBngABAAAAAAAAAAEAWQABAAAAAAABABEAAAABAAAAAAACAAcAMwABAAAAAAADABsA/AABAAAAAAAEABkASAABAAAAAAAFAAsA2wABAAAAAAAGABgAkwABAAAAAAAHAAEAWQABAAAAAAAIAAEAWQABAAAAAAAJAAEAWQABAAAAAAAKAAEAWQABAAAAAAALAAEAWQABAAAAAAAMAAEAWQABAAAAAAANAAEAWQABAAAAAAAOAAEAWQABAAAAAAAQABEAAAABAAAAAAARAAcAMwADAAEECQAAAAIAgwADAAEECQABACIAEQADAAEECQACAA4AOgADAAEECQADADYBFwADAAEECQAEADIAYQADAAEECQAFABYA5gADAAEECQAGADAAqwADAAEECQAHAAIAgwADAAEECQAIAAIAgwADAAEECQAJAAIAgwADAAEECQAKAAIAgwADAAEECQALAAIAgwADAAEECQAMAAIAgwADAAEECQANAAIAgwADAAEECQAOAAIAgwADAAEECQAQACIAEQADAAEECQARAA4AOlRzY2lyY3VpdEFscGhhYmV0AFQAcwBjAGkAcgBjAHUAaQB0AEEAbABwAGgAYQBiAGUAdFJlZ3VsYXIAUgBlAGcAdQBsAGEAclRzY2lyY3VpdEFscGhhYmV0IFJlZ3VsYXIAVABzAGMAaQByAGMAdQBpAHQAQQBsAHAAaABhAGIAZQB0ACAAUgBlAGcAdQBsAGEAclRzY2lyY3VpdEFscGhhYmV0UmVndWxhcgBUAHMAYwBpAHIAYwB1AGkAdABBAGwAcABoAGEAYgBlAHQAUgBlAGcAdQBsAGEAclZlcnNpb24gMC4xAFYAZQByAHMAaQBvAG4AIAAwAC4AMSA6VHNjaXJjdWl0QWxwaGFiZXQgUmVndWxhcgAgADoAVABzAGMAaQByAGMAdQBpAHQAQQBsAHAAaABhAGIAZQB0ACAAUgBlAGcAdQBsAGEAcgAAAAABAAMAAQAAAAwABAK4AAAAqgCAAAYAKgAAACEAIgAjACQAJwAoACkAKgArACwALQAuAC8AMAAxADIAMwA0ADUANgA3ADgAOQA8AD0APgBBAEIAQwBEAEUARgBHAEgASQBKAEsATABNAE4ATwBQAFEAUgBTAFQAVQBWAFcAWABZAFoAWwBcAF0AXgBfAGEAYgBjAGQAZQBmAGcAaABpAGoAawBsAG0AbgBvAHAAcQByAHMAdAB1AHYAdwB4AHkAev//AAAAAAAhACIAIwAkACcAKAApACoAKwAsAC0ALgAvADAAMQAyADMANAA1ADYANwA4ADkAPAA9AD4AQQBCAEMARABFAEYARwBIAEkASgBLAEwATQBOAE8AUABRAFIAUwBUAFUAVgBXAFgAWQBaAFsAXABdAF4AXwBhAGIAYwBkAGUAZgBnAGgAaQBqAGsAbABtAG4AbwBwAHEAcgBzAHQAdQB2AHcAeAB5AHr//wAA/+D/4P/g/+D/3v/e/97/3v/e/97/3v/e/97/3v/e/97/3v/e/97/3v/e/97/3v/c/9z/3P/a/9r/2v/a/9r/2v/a/9r/2v/a/9r/2v/a/9r/2v/a/9r/2v/a/9r/2v/a/9r/2v/a/9r/2v/a/9r/2v/a/9n/2f/Z/9n/2f/Z/9n/2f/Z/9n/2f/Z/9n/2f/Z/9n/2f/Z/9n/2f/Z/9n/2f/Z/9n/2QABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEABAEAAQEBGVRzY2lyY3VpdEFscGhhYmV0UmVndWxhcgABAQEo+BsA+BwC+B0D+B4Ei/tV+kD5SAUdAAABOQ8dAAAB4BGLHQAASd0SAFcBAQwlNj0+P0BBQkNERUZHSElKS0xNTk9QUVJTVFVWV1hZWltcXV5fYGFiY2RlZmdoaWprbG1ub3BxcnN0dXZ3eHl6e3x9fn+AgYKDhIWGh4iJiouMjY6PkFZlcnNpb24gMC4xVHNjaXJjdWl0QWxwaGFiZXQgUmVndWxhclRzY2lyY3VpdEFscGhhYmV0UmVndWxhciEiIyQnKCkqKywtLi8wMTIzNDU2Nzg5PD0+QUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVpbXF1eX2FiY2RlZmdoaWprbG1ub3BxcnN0dXZ3eHl6AAAAAYsBjAGNAY4BjwGQAZEBkgGTAZQBlQGWAZcBmAGZAZoBmwGcAZ0BngGfAaABoQGiAaMBpAGlAaYBpwGoAakBqgGrAawBrQGuAa8BsAGxAbIBswG0AbUBtgG3AbgBuQG6AbsBvAG9Ab4BvwHAAcEBwgHDAcQBxQHGAccByAHJAcoBywHMAc0BzgHPAdAB0QHSAdMB1AHVAdYB1wHYAdkB2gHbAdwB3QBUAgABAAQAeADuAgwFUgWPBmUHOwffCGMIzwkMCUgJhQq1CzwMhg5ADwwQUBHfEt8U3hYZFqIXFxeiGEIZtBsIHCccsh0sHpIfGh9XIC8gtiEFIjwjJSRTJWUmviftKXQp2CqzK0gsfS0ILW8uPy6iLuAvQy+2L/IxEDItM0A0XjWWNlQ39zjFOTk59zp9Oro76Dy1Pd8+/EAaQJVCDELOQ49EGEVZReRGgUdR+UgO+Uj37vlBFYv8VgWIewWBfQV8ggV6iAV6jgV8lAWBmQWImwWL+FYFjpsFlZkFmpQFnI8FnIcFmoIFlX0FL/z3Fe+LBZyIBZmCBZV9BY97BYd7BYF9BX2CBXqIBSeLBXqOBX2UBYGZBYebBY+bBZWZBZmUBQ75SPdm+UEVi/uBBYh7BYF9BXyCBXqIBXqOBXyUBYGZBYibBYv3gQWOmwWVmQWalAWcjwWchwWaggWVfQX3p3sVi/uBBYh7BYF9BXyCBXqIBXqOBXyUBYGZBYibBYv3gQWOmwWVmQWalAWcjwWchwWaggWVfQUO+Uj3XvcoFYAiBYZ7BYB/BXyDBXmJBXqQBX6VBYOaBYmbBZPgBSR/BXqMBXuSBX+YBYaaBYycBZOaBZiVBZyRBfcPmgWe91QFKH8FeYwFfJIFf5gFhZoFjZwFkpkFmZYFm5EF9wyZBZ33RgWQmgWWmAWakwWdjQWchgWYgQWUfAWMewV7+zIF9zifBZr3JgWQmgWWmAWbkwWcjQWchgWZgQWTfAWNewV++xMF8JcFnIoFm4QFl34FkHwFinoFg30FfoAFeoUF+w19BXj7VQXslwWdigWahAWXfwWRewWKegWDfQV+gAV6hgX7CnwFfvscBYZ7BX9/BXyDBXqJBXqQBX2VBYOaBYmbBZf3CQX7MM0V9zifBZ/3VAX7OHcFDvlI9/T5XhWL/awFiHoFgX4FfIEFeogFeo4FfJUFgpgFh5wFi/msBY+bBZSZBZqUBZyOBZyIBZqCBZV9BfcB+2YVNd0FgpkFiJsFjpsFlZkFmpQFnI4FnIcFmoIF4DkFlX0FjnoFh3sFgX4FfYIFeYgFeo4FQ9sV+z+bBXuQBX2VBYOaBYmbBZCbBZeYBZqTBZ2MBfc+ewWchgWZgAWTfQWMegWGfAWAfgV8gwX7LqUVKjgFe4MFeogFeo8FfZUFgpkFiJwFkJsFlZgF7d4FmpMFnI0FnIcFmYEFlH0FjnsFh3sFLD4VZvsHBYN8BX2BBXqGBXqMBXuTBYCYBYabBY2bBa/3CAWTmQWZlgWckAWciQWbgwWWfwWQewVkIRWkSQWNegWHewWAfgV8gwV6iQV6jwV9lQWCmQVyzQWJmwWPmwWWmQWakwWcjQWchwWZgQWdTxXUWgWXfwWRewWKewWEfAV+fwV7hgV5iwV7kgVCvQV/lwWFmgWLnAWTmgWYlgWbkQWdigXTWhX3fFkFm4QFl38FkXwFi3oFhHwFfoAFe4UFeYwF+3y8BXuSBX+XBYWaBYycBZKaBZeWBZyRBfedUhXVWgWWfwWSewWKewWEfAV+fwV6hgV6iwV7kgVCvAV/mAWFmgWLnAWTmgWXlgWckQWcigX2PBWjOAWMewWGewV/fgV8hAV5igV6kAV+lgWDmQVz3gWKmwWQmwWXmAWakgWdjAWbhgWZgAWp+xAVW/sHBYF9BX2BBXqIBXmOBX2UBYGYBYebBY6cBbz3BwWUmQWalQWcjgWciAWaggWVfQWPewU/+y8V+w5aBXqHBXmOBX2UBYGZBYebBY6bBZWZBZmUBfcOvQWcjgWciAWaggWVfgWPewWIewWBfQX7M00V+zObBXuQBX2WBYOZBYqcBZCaBZaYBZuTBZyMBfczewWchgWYgAWTfAWNewWFewWAfwV7gwX7VqAVNb0Ff5YFg5oFi5sFkZsFl5cFm5IFnIsFnIYF4FkFmIAFknwFjHoFhXwFf38Fe4QFeYoF+wzZFWbuBYmbBY+bBZaYBZqUBZyNBZyHBZmBBZR9BbAnBY17BYd7BYB+BXyDBXmIBXqQBX2VBQ75SPfu+UEVi/uBBYh7BYF9BXyCBXqIBXqOBXyUBYGZBYibBYv3gQWOmwWVmQWalAWcjwWchwWaggWVfQUO+Uj4Ko0VsmUFlX0FjnsFh3sFgX0FfYIFeYgFeo8FfZQFYrMFio0FiYwFY7sFiowFiowFYsMFiowFiowFY8oFio4FiY0FbcoFio4FiY4Fd8oFi44Fio0FgcMFi5IFi5IFlcMFjI0Fi44Fn8oFjY4FjI4FqcoFjY0FjI4Fs8oFjIwFjIwFtMMFjIwFjIwFs7sFjYwFjI0FtLMFmZQFnI8FnYgFmYIFlX0Fj3sFiHsFgX0FZGUFZV4FZFUFZE8Fb1AFeFEFg10Fk10FnlEFp1AFsk8FslUFDvlI95tWFYqJBWJjBX2CBXqHBXmOBX2UBYGZBYebBY6bBZWZBbKxBbG4BbLBBbLHBafGBZ7FBZO5BYO5BXjFBW/GBWTHBWTBBWW4BWSxBYGZBYibBY+bBZWZBZqUBZyOBZyHBZmCBbRjBYyJBY2KBbRbBYuKBY2KBbNTBYyKBYyKBbRMBYuIBY2JBapMBYuIBY2IBZ9MBYuIBYyJBZVTBYuEBYuEBYFTBYqJBYuIBXdMBYmIBYuIBWxMBYmJBYuIBWJMBYqKBYqKBWNTBYmKBYuKBWJbBQ75SPeU+FUV+zRWBXqIBXqPBX2VBYKZBYicBY+bBZaYBZqTBfc5wgUh9yQFhJoFi5sFkZsFmJYFm5IFnIsFm4UFmIAF8fsfBfH3HwWYlgWbkQWciwWchAWXgAWRewWLewWEfAUh+yQF9zlUBZqDBZZ+BY97BYh6BYJ9BX2BBXqHBXqOBfs0wAWL+yoFiHsFgX0FfIIFeogFeo4FfJQFgZkFiJsFDvlI95T39hWL90sFjpwFlZgFmpUFnI4FnIgFmoEFlX4FjnoFi/tLBfdpiwWciAWaggWVfQWOewWIegWBfgV8ggV6hwX7aYsFi/tLBYh7BYF9BXyCBXqIBXqOBXyUBYGZBYibBYv3SwX7aYsFeo8FfJQFgZgFiJwFjpsFlZkFmpQFnI4FDvlI96puFcJVBZV9BY56BYd7BYF+BXyCBXqIBXqOBX2VBTXfBYeRBYaRBYuMBYqMBYqSBYmSBYyMBYqMBY2SBYyTBYyLBYuMBZCRBY+RBfc/9zwFmpUFnI4FnIgFmoMFlX0Fj3sFiHsFgX0FDvlI90L35RX3kosFnIgFmoIFlX0FjnsFiHsFgX0FfIIFeogF+5KLBXqOBXyUBYGZBYibBY6bBZWZBZqUBQ75SPf/7RX7D4sFeY4FfZQFgZkFiJsFjpsFlZkFmZQFnY4F9w+LBZyIBZmCBZV9BY97BYd7BYF9BX2CBQ75SKOAFfhx+WMFl5cFm5EFnYwFm4UFmIAFknwFjHoFhXwF/HH9YwV/fwV7hQV5igV7kQV+lgWEmgWKnAUO+Uj4CfkPFUOeBUN4BUZQBWMvBYH7JQWj+wwFxi0F2F0FyYsF2LkFxukFo/cMBYH3JQVj5wVq9x4VjYoFkYgFkYgFjIoFjYoF4EEFi4sFjIoFj4UFkIUFi4oFjIoFuSEFjIQFjYUFlvsyBYqGBYuGBXH7GQWIhQWJhAVH+wIFiYoFiokFhocFh4YFiYoFiooFKVEFh4kFiIkFhooFh4oFh4sFh4oFM4sFh4wFh4sFh4wFhowFiI0Fh40FKcUFiowFiYwFh5AFho8Fio0FiowFRvcCBYmSBYiRBXH3GQWLkAWKkAWW9zIFjZEFjJIFufUFjIwFi4wFkJEFj5EFjIwFjIsF39UFjYwFjIwFkY4FkY4FjYwFjYsF6aMFjowFjowFkYoFkYwFjooFjooF6XMFDvlI9/v5ZRWQjgWNjAWNjAWSiwWSjQWMigWNiwWSigWSiQWMigWNiwWRhwWQhwWMigWNigWOhQWPhQWMigWLiQWMhQWNhAWL/REFh3sFgX0FfYIFeogFeY4FfZQFgZkFiJsFi/i2BTRFBXuDBXqJBXqPBX2WBYOZBYmbBY+bBZaYBfc19xUFDvlI90rmFffoiwWdiAWZggWVfQWOewWIewWBfQV9ggV5iAX8TosFg4wFg4wFiowFiosFhY8FhI8Fi4sFiowFhpEFh5EFi4wFiowFipIFiZIFi4wFi4wFjJIFjJIFjIwFi4wFj5EFj5EF9zn3PgX3L/dKBcTlBZezBYueBYOqBXeiBV6dBUaQBWaGBVBzBWttBX9mBYN9BX6ABXqGBXmNBXyTBYCYBYaaBYycBZu6BYuMBYyNBY+QBY6RBYyMBYyNBbi2BYuLBYuLBZOQBZKQBYuLBYuLBdWoBZCNBZGMBbqSBZCKBZCMBd2FBZKJBZKKBclxBYyKBY2LBZCHBZGHBYyKBY2JBaxlBYyKBYuKBY+FBY6EBYuKBYyKBZdeBYuFBYyGBYptBYqGBYuGBX1ZBYiFBYmGBUwpBYmJBYqJBfsy+04FiooFiooFDvlI9wqUFYeMBVObBXySBX+YBYabBY2bBZOaBZmVBZuQBZ2KBcB8BdeABeiJBb2WBdGxBbW2BZy5BYOvBWWzBUStBTSiBT2UBYiMBYiLBYWOBYaMBYmNBYiNBYePBYeOBYmOBYmNBYmQBYmQBYuOBYqOBYuQBYuRBYyNBYuOBY2QBY2QBY2NBY2OBY+PBY+PBY6MBY2NBZCNBZGNBY6LBY6MBduVBeKdBdGpBauoBZGqBXWtBV2uBUagBTyPBUp2BVZxBWhxBXyEBXmKBXuQBX2WBYOZBYqcBZCaBZeYBbCnBY+MBY6OBceoBY6MBY6NBdikBZOMBZSMBemGBZCKBZGKBd1yBZKIBZOHBcVeBZCGBZCGBa9UBY2EBY6FBYuKBYyKBYqEBYuDBYBQBYmHBYqHBYmIBYmHBYiIBYiHBVxfBYWGBYSHBUduBdFqBZGGBZKHBcBUBYyIBY6JBY2GBY6HBYuIBY2HBZZQBYuJBYyIBYqFBYuGBYqIBYuJBXNKBYuLBYuLBYeEBYaEBYuLBYuLBVZUBYWHBYaHBTlfBYWJBYWIBU19BYWLBYWKBSeNBYiMBYiLBTmWBQ75SPgF98IVi+oFj5sFlJgFmpUFnI4FnIgFmoEFlX4FjnsFiywF6YsFnIcFmoIFlX0FjnsFiHsFgX0FfIIFeogFLYsFi/s9BYh7BYF9BXyCBXqIBXqOBXyUBYKZBYebBYv3PQX71IsFhIwFhYwFiYwFiYsFhY8FhY0Fio0FiYwFh5AFh5AFi40FiY0FipEFiZEFi40Fi40FjJEFjJEFjI0Fi40Fj5EFjpAF+Ab4PgWYlgWcjwWcigWbgwWWfgWQfAWKegWCfQX7yfv5BQ75SKn5QRWOmwWVmQWalAWcjwX4WIsFnIcFmoIFlX0FjnsFiHsFgX0FfIIFeogF/CuLBYv7dwX3HakFk4sFk4wF9x57BZOIBZOJBcJuBZGGBZGHBbFiBYyJBYyKBY6FBY+FBYuKBYyJBaj7BAWLigWLigWLhAWMhAWKigWLiQV9UQWLiwWLigWHhAWIhAWLiwWKigVnXgWFhQWFhgVFYQWFiQWFiAU5dQWGigWGigU+hwWFjAWGiwVKlwWGjQWGjAVWogWGjgWFjwVUugWAmAWHmwWOmwWUmQWZlQWcjwWciQWaggW9YQW0eQXCgQXNjgXSngXFrgWlqwWUswVz5wVxpwVjoAX7DZkF+01iBYaLBYaKBYeMBYiKBYaNBYaMBYiNBYeMBYePBYeNBYmOBYiNBYmQBYiPBYuOBYmPBYuPBYqQBQ75SPch96QVi4sFi4sFbW4FioMFnlkFm24FtWEFtHIFzoEF2o8FxaMFsqoFnrMFjaoFf7MFeKwFcqQFZ5sFUJcFU44FU4MFU28F+yxcFYqPBYyRBYy5BYuLBYuLBY7cBY2RBYyRBafaBYyNBYuNBbTfBZCSBZCRBcC7BY6NBY2NBdC4BZGOBZCOBdykBYyLBYuLBeKlBZ2NBZuGBZmBBZN8BY17BYZ7BYB+BXyDBTRyBUFzBU9kBV5jBWdABXJEBYp7BZGOBZCPBdGtBZKNBZKOBc6UBZCLBY+LBcuJBY+KBY+LBc58BZCKBZCJBbt2BZKGBZKHBa5oBY6GBY+GBaNhBYyHBY2HBZpZBYyEBYyFBYlbBYuLBYuLBYmDBYmDBYuLBYuLBW9UBYuKBYqKBYaGBYeFBYqKBYqLBVhiBYaIBYaIBUNtBYOJBYOJBS+GBYeMBYaLBTmXBYqLBYqLBYSOBYOOBYuLBYqLBVasBYiPBYaNBVq8BYeQBYeQBXaxBYqOBYqOBXXHBYqSBYmTBQ75SPfP90gVg/saBYd7BYF+BXyCBXmJBXqPBX2VBYKZBYmbBZL3HAWMjQWLjQWc9wcFi4wFjI0Fms0FjI0Fi4wFnsYFjIwFi40FoL4FjIwFi40ForcFjIwFi40Fo7EFjIwFjI0FoqoFjI0FjIwFoqYFjYwF+96LBXmOBX2UBYGZBYibBY6bBZWZBZmUBZ2PBfhfiwWQigWQigWOigWPigWPiAWQiQWOiQWNiQWOhwWPhwWMiAWNiAWMhgWNhgWLiAWMiAWJhgWLhgWKiAWKiAWIhwWJhgWIiQWJiAWHiAWHiAVqeQV9gQVkaAV3dAV2bgV1aAV2YgV4WwV5UwV8TAUO+Uj3pvf2FUR0BUpaBXBZBYleBaZdBcVnBdlzBciJBeCmBb6wBaLEBYLEBWK1BTi2BVKfBdH3sxU4kQVLgAVXcwVrXQWVaQW4ZQW/bAXDeAWwlgXetQWdpgWMwwV1rwVr9wEVi4sFk4gFk4kFi4sFjIsF0GgFjokFj4kFjocFj4gFjYgFjYgFrVIFjIkFjYgFjIYFjYYFiogFjIgFiTwFi4gFi4kFiYUFioYFiYkFiogFbVwFiYkFiYgFh4gFh4cFiIoFiYkFUm4F0mYFkIcFkYcFw1IFjYcFj4gFjIcFjYgFjIYFjIcFmDoFi4kFi4kFioUFi4UFiokFiokFbDwFiYcFiogFh4cFiYgFiIgFiIkFR1sFhYgFhYcFJ2sFg4oFg4oFP40FhY0FhIsFMqcFho4FhY0FQ7gFio0FiYwFho8Fh5AFio0FiYwFZc0Fio4Fio4FipAFiZAFjI4Fio4Fjs0Fi4wFi4sFjZMFjZIFi4wFi4sFr80Fi4wFjIwFkJAFkJEFi4wFjIsF2sYFkY4Fko8FmI8FaZ8FiI4Fh40FUrwFiY0FiI4FiY8FiI8Fio4FiY4FeMsFi40Fi4wFipIFi5IFi4wFi4wFjpIFjZIFjIsFjI0Fu9IFjo4FjY4Fj44Fj44Fjo0Fjo0F0KsFkYwFkY0F15gFkIsFkYwF7YQFDvlI+Fr4mBWVnQV8xwVwqwVfoAVIkwVHgwVTdAVnagV+XwWYYAWvaQXDdAXMhAXMmgW8qgVf/BoVi4oFZ0IFgX4FfIIFeYgFeo8FfZUFgpkFiJsFj5sFr9QFtuoFwPcXBYuLBYuMBZKcBT55BYOKBYKLBTuUBYWNBYWMBUWoBYSPBYSQBVm6BYqNBYmMBYiQBYeQBYuOBYqNBXfNBYqOBYqOBYyQBYqQBYyOBYyPBZ/NBYyNBYuNBY+QBY6QBY2NBYyNBb26BZKPBZKQBdGnBZGMBZGNBduVBZGKBZGMBduBBZKJBZKJBcdvBYyKBYyLBZGGBZGHBYuKBYyKBbNcBYyKBYyKBY6FBY6FBYuJBYyKBZ83BYuFBYyEBYqJBYuJBYmFBYmGBYqHBUH7SAVW+xgFi4oFiooFXysFDvlI9y/3yxX4OvtDBZqBBZR9BY57BYd7BYF9BXyCBXqJBXqOBfyY92oFhI8FhY8FiowFiowFh5EFh5EFi4wFiosFipMFiZIFi4wFi4wFjZIFjJIFjIwFi4wFj5EFj5EFjIwFjIsFkY8Fko8F+Jj3agWcjwWciAWaggWVfgWPewWIegWCfQV8ggUO+Ui2+GkV+JiLBZyIBZqCBZV9BY57BYh7BYF9BXyCBXqIBfyYiwV6jgV8lAWBmQWImwWOmwWVmQWalAWc+4gV+JiLBZyIBZqCBZV9BY57BYh7BYF9BXyCBXqIBfyYiwV6jgV8lAWBmQWImwWOmwWVmQWalAUO+Uj44/fpFYyKBY+FBY+FBYuKBYyKBYyEBY2EBYuKBYuKBYmEBYqDBYqLBYuKBYeFBYeFBYqKBYqKBYWHBYSHBfyY+2oFeogFeo0FfJQFgZkFh5sFjpsFlJkFmpUF+Dv3QwX8O/dDBXyUBYKZBYicBY+bBZWYBZqUBZyOBZyHBfiY+2oFkocFkYcFDvlI+Ev3kxWGigX7q4sFi4sFLPtyBYF9BX2CBXqIBXmOBX2UBYGYBYecBY6bBfek+REFkJIFkJIFi4sFi4sFko8FkpAFi4sFjIsFk40Fk40FjIsFi4sFk4kFlIoFi4sFi4sFkoYFkocFjIsFi4sFkIQFj4QF97r9EQWPewWIegWBfgV9gQV6iAV5jgV9lAWBmAX7IvfIFfsB94AFJvuABQ75SPe++GUV2bYFlMsFTL8F+weeBSmGBYv7VgX32vxEFYSJBYmLBYmLBfv7hwWKiwWLiwWDjAWCjQWLiwWLiwWEjwWEkAWKiwWLiwWGkgWHkQWLjAWKiwWKkwWJkgWLjAWLiwWL+QoFjJIFjZIFi4wFi4wFkJEFjpEFjIwFjIwFkY8FkY8FjYsFjIwFkowFk40F9yWTBZCKBZCLBfcZdQWOigWPigWQiQWQiQWNiQWOiQXlQQWNiAWPiQWNhwWOhwWMhwWNiAWLhgWMhwWLhwWLhwV9+wAFiokFi4gFiIYFiYYFiYkFiogFh4cFh4cFiIoFiYkFSGYF9wJmBY6JBY+KBY+IBY+JBY2IBY6IBdE3BY6GBY6FBYyJBYuKBYyEBYyEBYX7AAWLiQWLiQWJhQWJhQWKiQWKiQVsWwWIiQWKiAWHiAWHhwWIigWIiQU+ZAWJigWJigVu3BXEqAWeqAWP3QVYyQX7JLsF+1CWBYv7nAUO+Uj4ZPclFaDbBZOZBZiXBZuQBZ2KBZuEBZd/BZF7BYp7BXIwBYqIBYqHBYiHBYmHBYiIBYmIBUNLBYiJBYmJBYaJBYaIBYiLBYiJBSl1BYuLBYuLBYOLBYKLBYuLBYuLBfsEnAWJiwWKjAWEjQWEjgWKjAWKiwVRsQWFkQWFkQVU3QWLiwWLiwWIkwWIkgWLiwWLiwVm918Fi5MFi5MFuvdeBYyMBYuNBY+RBY2RBY2MBYyNBc7XBYyMBYuLBZGQBZKQBYuLBYuLBdGsBZKNBZKOBdqVBYyLBYyLBZOKBZKLBYyKBY2LBfVqBYyLBYyLBZKHBZGHBYyLBYyKBcNZBYyLBYuKBZCFBY+FBYyKBYuLBapEBY57BYh7BYF9BXyCBXqIBXqOBXyVBYGYBXDJBWKwBTSlBU6EBVVxBVRNBWD7TAWt+04FuUgFtG8F6H0F2JwFDvlI93uVFYaKBfs1iAWLiwWKiwWDjAWDjQWKiwWLiwWEjwWEjwWLjAWKiwWHkgWGkQWLjAWLiwWJkwWJkgWMjAWKiwWT+QQFjJAFi5EFjY0Fi48Fj48FjY8FjY4FjY0FkI4Fj44Fjo0FjowFkIwFkY0F7pgFj4sFjowF14kFkYoFkIsF9xBrBYuLBYuLBZOHBZKIBYyLBYuKBeZIBYyKBYuLBZCFBZGFBYuLBYuKBb8wBY2FBY6GBaAsBYuHBYyHBY1EBYqHBYuIBYJOBYmHBYqHBXhXBYeFBYmGBUw8BYWGBYWGBTdZBYWJBYWIBfsdaAV53hX3EasF0rUFwM4Fm7UFlMAFicsFeOAFXtoFPsQF+wGnBUiMBVGDBYX8tAUO+Uj3EeUV+CGLBZyIBZqCBZV9BY57BYh7BYF9BXyCBXqIBfxOiwV6jgV8lAWCmQWHmwWL99MFi/fSBY+bBZSZBZqUBZyPBfhOiwWchwWaggWVfQWOewWIewWBfQV8ggV6iAX8IYsFi/t+BfeciwWdiAWZggWVfQWOewWIegWBfgV9ggV5hwX7nIsFDvlI9xf32hWL+6oFiHsFgX0FfYIFeYgFeo4FfZQFgZkFh5sFi/kRBY+bBZWZBZmUBZyPBZ2HBYyKBfgviwWciAWZggWVfQWPewWHewWBfQV9ggV6iAX8FYsFi/t4BffQiwWdiAWZggWVfQWOewWIewWBfQV9ggV5hwUO+Uj4fve0Ffs1iwV6jwV9lAWBmQWImwWOmwWVmQWZlAWdjgX3bIsFj4oFkIsFj4kFj4oFj4kFj4kFjogFj4kFjYgFjocFjYgFjYcFjIcFjYcFi4cFjIcFiocFi4cFXvtaBYqJBYuIBYiGBYiGBYmJBYqJBUtGBYmKBYqJBYWIBYaHBYmKBYmKBTpwBYqLBYuKBYOKBYOKBYqLBYqLBTWSBYSNBYSNBTmuBYWOBYaOBUfCBYaQBYaQBV/QBYuMBYqMBYmRBYiSBYuMBYuMBXf3UgWLkQWLkgWx90IFjIwFi40FjpEFjpEFjIwFjI0FzdsFjIwFi4wFkZAFkY8FjIwFjIsF37QFi4sFi4sFk40Fk44Fi4sFi4sF9xeVBZKKBZGLBfcQcQWbhQWXfwWRfAWLegWEfAV+gAV7hQV5iwX7CKMF+weCBUhrBVZJBWj7MwWe+0IFrlUFxFwF0W4Fz4UFx6AFvL8FDvlI+H74OhWL95sFj5sFlJkFmpQFnI8FnIcFmoIFlX0FjnsFi/0RBYh7BYF9BXyCBXqIBXqOBXyUBYKZBYebBYv3tgX8DosFi/u2BYd7BYJ9BXyCBXqIBXqOBXyUBYGZBYibBYv34AWL98UFjpsFlZkFmpQFnI8FnIcFmoIFlH0Fj3sFi/ubBQ75SPfu+UEVi/0RBYh7BYF9BXyCBXqIBXqOBXyUBYGZBYibBYv5EQWOmwWVmQWalAWcjwWchwWaggWVfQUO+Ui/9z4Vio4Fia8FjpsFlJkFmZUFnY4FnIkFmoIFlX4Fj3sFjGsFkXIFlXYFmXkFnX0FunoFzoQFu5EFwp8FoJkFnJ0Fl6EFk70FivhxBY6bBZWZBZqUBZyPBZyHBZqCBZR+BY96BYz8dAWKiAWLiAWCTgWJhQWJhAV5awWHhgWIhwVycQWHiAWIiAVtdwWGiQWGiAVKcwWGigWFigVRhAWGiwWGiwU8kwWFjAWFjAVRoQWFjwWFjQVvoQWHjwWHjgV2pQWJkAWIjwV+qAWKkAWJjwWEqwUO+Uj3Uff3FfsBOQWL+3UFiHsFgX0FfYIFeYgFeo4FfZQFgZkFh5sFi/kRBY+bBZWZBZmUBZyPBZ2HBZmCBZV9BY57BYv7xAX4Hve7BZuSBZyNBZyGBZiABZR8BYx7BYZ7BX9/Bfui+14F9+b70AWVfQWPewWHewWCfQV8ggV6iAV6jgV8lAUO+Uj3DOUV+CuLBZyIBZmCBZV9BY97BYd7BYF9BX2CBXqIBfxYiwV6jgV9lAWBmQWHmwWL+REFj5sFlZkFmZQFnI8FnYcFmYIFlX0FjnsFDvlI+KH5WxWOjwWNjQWNjQWRjQWPjgWOjAWOjAWRjAWRjAWOigWOiwWQiQWRigWNigWOigWQhwWPiAWNiQWNiQWOhgWOhgWMiQWMiAWLhgWNhQWL/REFh3sFgX0FfYIFeogFeY4FfZQFgZkFiJsFi/h1BftD+6wFiYkFiokFhocFh4cFiYkFiYoFhYkFhYgFiYsFiIoFhYwFhYoFiIwFiYsFhY4FhY0FiYwFiY0Fh48Fho8Fio0FiY0F+0P3rAWL/HUFiHsFgX0FfYIFeYgFeo4FfZQFgZkFh5sFi/kRBY2RBYuQBYyOBYyNBY6QBY6QBY2NBY2NBY+OBZCPBY6MBY2MBZGMBZCNBY6LBY6MBZGKBZGKBY6KBY6KBY+IBZGJBY2JBY2JBY6HBY+HBfdw+/UF93D39QUO+Uj4e/dPFYT4hgWOmwWVmQWZlAWcjwWdiAWZggWVfQWPewWU/REFioYFi4cFiocFiocFiYgFiYcFiIgFiIcFiIkFiIgFh4kFh4kFh4oFh4oFhosFh4oFhosFh4sFh40Fh4wFh40Fh4wFiI4Fh44FiI4FiI4F/BT4oQWL/IkFh3sFgn0FfIIFeogFeo4FfJQFgZkFiJsFi/kRBYyPBYuPBYyPBYyPBY6PBYyOBY6OBY6PBY6NBY6OBZCNBY+NBY+MBY6NBZCLBZCMBY+KBY+LBY+JBZCKBY+JBY6KBY+IBY+IBY2IBY6IBQ75SPgblBWFiAWJiwWJiwUzgAWKiwWKigWEjAWDjAWKiwWKiwUypQWJjAWIjAWGjgWGjgWJjQWJjAU62gWJjgWIjgWJjwWIjwWLjwWJjgVP96AFi40Fi4wFi5IFi5IFjIwFi40FxPddBY2PBYyPBY6OBY2PBY6NBY6PBdHEBYyMBYyMBZKOBZGOBY2LBYyMBfcOqQWPiwWPjAWQigWPjAWPiQWPiwX3B2cFjIoFjYsFkYcFkYgFjIoFjYkFzkoFjYgFjYkFjocFjYYFjIgFjIgFxfuJBYuDBYuDBW/7LgWIhAWJhQVYMgWKiQWLigWGhgWGhgWKigWKigUwTgWJigWKigUg0BXOkwXUvAW11gWl9x8FVvd1BVm8BTCoBShzBVdgBVj7RgXD+4sFy00FDvlI93j3xxWJigX7AooFi/uVBYd7BYF9BX2CBXqIBXmOBX2UBYGZBYibBYv5BQWMkQWMkgWMjAWLjQWPkQWOkAWNjAWMjQWQjwWRjwWNiwWMjAWSjQWRjAX3HZcFjosFj4sF9w6EBY+KBZCLBdp2BY+KBY+KBa96BZCIBZCIBcRbBYuKBYuLBZCFBZCEBYuLBYyLBaRXBY2EBY2EBZA/BYuJBYuJBYqFBYqFBYqJBYuJBXRcBYqJBYqJBYeHBYeFBYmKBYqKBWhxBYWIBYWIBVN2BYeKBYeJBTp8BYiLBYmLBfsCggWF4BX1kwXWmQW5nAWgmwWZpwWGxAV6sAVesQVxlwVEnQX7BpIFL4MFi/uJBQ75SPiTtRXQOQWTfAWNewWFewWAfwV7gwV6igV6kAV+lQVRzwVUYAWIigWJiQWGiQWGiAWHiwWIigU1fgWJjAWJigWEjAWFiwWJjAWIiwU0qQWJjAWIjAWGjgWGjgWJjgWJjAU75AWKjgWJjQWJkAWIkAWLjgWKjQVQ98MFi4sFi4sFi5MFi5MFi4sFi4wFw/d2BY2OBYyPBY2PBY6PBY2OBY2OBdDLBY2MBYyNBZGOBZGOBY2MBY2MBfcLrAWRjAWRjAWNigWOjAWRiQWRigX3BGMFjYoFjooFj4cFkYgFjIkFjYoFzUEFjIkFjYkFjYYFjoYFjIgFjIkFw/uoBYuEBYuEBW/7QgWJhQWJhQX7K0AVMfUFg5oFipsFkJsFlpcFm5MFnIwFnIYFmIEF0zcFmqkFpfc1BVb3lgVZxAU0qgUucQVXWgVY+2IFwvuvBctDBcx2BcmUBQ75SPfz+EoV3JcFrpgFoJsFlqIFjLMFfbkFgZYFd5gFcZUFQZsF+xSQBfsofgWL+10F90g8FftIhQWL+7cFh3oFgn4FfIEFeogFeo4FfJUFgZgFiJwFi/j8BYyRBYyRBYyNBYuNBY+QBY6RBY2MBYyNBZGOBZCPBY2MBY2MBZGMBZKNBfdUmwWOiwWOjAX3G4UFj4oFj4sF3HoFj4kFj4sFrX0Fj4kFj4kFp3kFj4cFkIgFoHQFi4oFjIsFjoQFj4UFi4oFjIoFnU0FjIUFjIUFiVQFi4sFiYMFiYMFi4sFeWQFiooFi4oFhoUFhoUFiosFi4oFaXAFhIgFhYcFXXoFhooFhokFNX8F94H7rQWTfQWNegWGewV/fwV8gwV5igV6kAV+lgX7nPfLBYOaBQ75SOXBFYaOBYqNBYiNBYmQBYeQBVr3AQWHnAWOmwWVmQWZlAWcjgWdiAWZggWVfgW3KgXNaQX3IIcF7bgFq/AFdsUFS68F+4ezBYiNBYiLBYaNBYaNBYmOBYiMBUu+BYiPBYiOBYmOBYiOBYqQBYmOBXrHBYuPBYqOBYuQBYuPBYyPBYyPBbT3DAWOkAWNkAWNjQWMjQWQjwWPjwXvzAWRjgWQjgWOiwWNjAWRiwWRjAX3R4IFjYoFjIwFkogFkooFjIoFjYoFkIcFkYcFjIoFjIoF1zAFknwFjXoFhXwFgH4Fe4QFeYoFe5AFfpYFTNYF+yOTBUBaBWssBZVoBbZoBfeDYwWTiQWTiAXfWgWQhwWQhwWNiQWMigWOhQWOhgWrNgWLhgWNhwWLhwWLiAWKhgWKhgVi+xgFi4oFiooFh4UFiIQFiosFiooFhYYFhYcFiosFiooF+xJRBYmLBYqKBYSKBYSJBYmLBYmLBfs2jwWJjAWJiwWFjQWEjAWJjAWJjAUzuQUO+Uj3yflsFfeiiwWchwWaggWVfQWOewWIewWBfQV8ggV6iAX7dYsFi/znBYh7BYF9BX2CBXmIBXqOBXyUBYKZBYebBYv45wX7hYsFeo4FfJQFgZkFiJsFjpsFlZkFmpQFnI8FDvlI+HT3hxWQ+E4Fj5sFlZkFmZQFnY4FnIcFmYIFlX0FjnsFhvxQBYqIBYyJBYFHBYqHBYqGBXdYBYmIBYmHBX53BYiHBYiIBW1sBYWHBYaHBVhxBYSJBYSJBU2BBYWLBYSLBTOUBYaNBYWMBUWlBYWPBYWOBVyvBYeQBYWQBWjCBYiRBYiRBXnSBYqPBYqOBYTsBYuNBYuMBYr39wWOmwWVmQWalAWcjwWchwWaggWVfgWOegWM+/UFki8Fm00Fp2EFr28FxXYF14IFu5MFsJ4FoqIFk5cFnLYFDvlI99H3NRX3a/ivBZSZBZqVBZyPBZyIBZqCBZV+BY97BYh6BfuS/REFi4sFi4oFhoUFh4QFi4sFiooFhIcFhYYFiosFi4sFg4kFg4oFiosFi4sFg4wFgowFi4wFiosFhI8FhI8Fi4sFi4wFhpEFhpEFi4wFi4sF+7j5EgWHmwWOmwWVmQWZlAWcjwWciAWaggWVfQUO+Uj4dvdYFdf4gwWQmwWXlwWbkgWcjAWchgWYgAWTfAWMegUq/REFiYcFioYFiYgFiocFiIgFiIcFiIkFiIgFh4kFh4kFh4oFh4kFh4sFhooFh4sFh4sFho0Fh4sFh40Fh40FiI4Fh40FiI4FiI4FiY8FiI4F+0b3/wX7Ofv2BYiHBYiGBYmJBYmJBYaIBYeHBYiKBYiKBYaKBYWJBYiLBYiLBYWMBYaLBYiNBYiLBYaOBYaOBYmNBYiNBYiPBYiPBYqOBYmOBYqQBYmQBTv5CQWNnAWTmQWYlgWckAWcigWbhAWWfgWRewXH/G8F9x/3vgWPkAWPkQWMjAWMjAWRjwWRjwWNiwWMjAWSjAWSjQWNiwWMiwWSiQWTigWMiwWMigWRhwWSiAWMigWMigWPhQWPhQUO+Uj3/Pf/FfeZ+7QFlH0FjXsFhnsFgH4FfIMFeYkFeo8FfpYF+5D3qQX7kPupBX6ABXqHBXmNBXyTBYCYBYabBY2bBZSZBfeZ97QF+5/3uwWCmQWJnAWQmwWWlwWalAWdjAWchwWYgQX3lvuxBfeW97EFmZUFm48FnYoFmoIFln8FkHsFiXoFgn0FDvlI9+j4EhWV++EFiHsFgn0FfYEFeogFeY0FfJQFgZkFh5sFgffjBfud96cFgpkFiJsFj5sFlpkFmpMFnI4FnIcFmYEF94n7kQX3k/eQBZqVBZyPBZyIBZqCBZV+BY96BYh7BYJ9BQ75SPci5RX4KosFnYgFmYIFlX0FjnsFiHsFgX0FfYIFeYgF/IKLBYWMBYaLBYiMBYeMBYeOBYaNBYmNBYiNBYiPBYePBYqOBYmOBYqQBYmPBYuPBYuOBYyQBYuQBYyOBYyOBY6PBY2QBfhP+M4F/CqLBXmOBX2UBYGZBYibBY6bBZWZBZmUBZ2PBfiCiwWRigWQigWOigWPigWPiQWQiAWNiQWOiQWOhwWPhwWMiAWNiAWMhwWNhgWLiAWLhwWKhgWLhgWKiAWKiAWIhwWJhgUO+Uj3h3QV9zaLBZyIBZmCBZV9BY97BYd7BYF9BX2CBXqHBftjiwV5jwV9lAWBmQWImwWL+Z8FjpsFlZkFmZQFnY4F92OLBZyIBZmCBZV9BY97BYd7BYF9BX2CBXqIBfs2iwUO+Ujw+VgV+HH9YwWRfAWKegWEfAV+gAV7hQV5jAV7kQV/lwX8cfljBYWaBYycBZKaBZiWBZuRBZ2KBZuFBQ75SPhWShWHewWBfQV9ggV6hwX7Y4sFeY8FfZQFgZkFiJsFjpsFlZkFmZQFnY4F9zaLBYv5SwX7NosFeY4FfZQFgZkFiJsFjpsFlZkFmZQFnY4F92OLBZyIBZmCBZV9BY97BQ75SPeo+WQVko8FjIsFjIwFkowFk40FjIoFjIwFk4kFkooFjIoFjIsFkocFkYcF9577ggWVfgWPewWIegWBfQV9ggV6hwV6jgV8lAX7f/dmBft/+2YFfIIFeogFeo8FfZQFgZkFiJwFj5sFlZgF9573ggUO+UiL+wEV+O6LBZyIBZqCBZV9BY57BYh7BYF9BXyCBXqIBfzuiwV6jgV8lAWBmQWImwWOmwWVmQWalAUO+Uj4POoVxcIFi/eQBVLBBVCnBS+LBVBvBUxQBWsvBYtQBaswBcpPBcdvBeaLBfcIZhWHiAWFhwVAZwWKigWJigWEigWFiQWJjAWJigX7BYsFiYwFiYoFhI0FhYwFiYwFiYwFQK8FhY8FhY8FP9MFiowFiowFiJEFh5EFiowFiowFZvYFipIFipIFi9IFjJIFjJEFsPcABYyNBYyMBY+RBY6RBYyMBYyMBdfTBZGPBZGPBdeuBYyMBY2MBZKMBZKNBYyKBY2MBfcFiwWMigWNjAWSiQWSigWMigWNigXWaAWQhwWQiAWLjwWPnAWUmAWalQWcjgWciAWagQWVfgWOegWL/IoFiHsFgX4FfIEFeogFeo4FfJUFgpgFh5sFDvlI9xOvFYaOBYuKBYd6BYF+BX2CBXqHBXmPBX2UBYGYBYicBYv5OAWOmwWVmQWZlAWdjgWciAWZggWVfQWPewWL+3YFkI4FkY8F1asFjIsFjIsFko0Fk40FjIoFjIwF9wSLBYyLBYuLBZOJBZOJBYyLBYuLBddrBZCHBZKIBdZKBYyKBY2KBY6FBY+GBYyJBYyKBbApBYyEBYyEBYtLBYqEBYqDBWYrBYqKBYqJBYeGBYiFBYmKBYqJBUBLBYWIBYWHBUBqBYqLBYqLBYSJBYOJBYqLBYqLBfsEiwWKjAWKigWDjQWEjQWKiwWKiwVBrAWA9w0VwlwFxnEF54sFx6UFycAFqdoFi70FbdsFTcAFT6QFL4sFUHIFVFwFDvlI+DLqFczNBZqVBZyPBZyIBZqDBZV9BY97BYl7BYF9BUVDBYWHBYWHBUZmBYiLBYmJBYWKBYWJBYiMBYmKBSGLBYmMBYiKBYWNBYWMBYmNBYmLBUSwBYWPBYWPBUXTBYqMBYqMBYeRBYeRBYuMBYqMBWn2BYqRBYqSBYvSBYyRBYySBa33AAWMjAWLjAWPkQWPkQWMjAWMjAXR0wWRjwWRjwXSrwWNiwWNjQWRjAWSjQWNigWNjAX1iwWNigWNjAWSiQWRigWNiQWNiwXRZwWRhwWRhwXRQwWVfQWNewWHewWBfQV8gwV6iAV6jwV8lQVKzQVWpgU3iwVVcAVRUAVtLgWLUAWoLwXGUAXCbwXdiwUO+Uj4PfUVwroFi/dxBVS6BVCkBS+LBU9yBU1WBW07BYtZBak8BclWBcdxBeeLBfcGYhWGiAWFhwVBagWKiwWKiwWEiQWDiQWKjAWKigX7BIsFiosFiosFhI0Fg40FiosFiosFQKwFhY8Fho4FP8sFio0FiYwFiJEFh5AFio0FiowFZusFipMFipIFi8sFjJIFjJIFsO0FjIwFjI0Fj5AFjpEFjYwFjIwF18wFkY4FkI8F16sFi4sFjIsFk40Fk40Fi4sFjIsF9wSLBYyKBYyMBZOJBZKJBYyLBYyLBdVrBZGHBZCIBYv3dgWPmwWVmQWZlAWcjgWdiAWZggWVfQWOewWL/TgFiHoFgX4FfYIFeYcFeo8FfZQFgZgFh5wFDvlI9x74IBV8YQX4GIsFg5QFZs0FbaYFS6cFJosFSm8F93r7/BXXzgWZlAWdjgWchwWZggWVfQWNegWIewWAfgU6QwWGiAWFhwU8ZgWJiwWKigWEigWEiQWJiwWKiwX7DYsFiosFiosFg40FhIwFiowFiosFOrAFhY8FhY4FO9MFiYwFiowFh5EFh5AFi40Fio0FY/YFipIFipIFi9IFjJIFjJIFs/cABYyNBYuNBY+QBY+QBYyNBY2MBdvTBZKOBZCPBdyvBYyLBYyMBZOMBZKNBYyLBYyLBfcNiwWMiwWMiwWTiQWSigWMigWMiwXbZwWQhwWRiAW1ZwWPhQWQhQWyRAWQewWJegWDfQV/ggWUhQWVfgWOegWIewWBfQV9ggV5iAX8SYsFi3UFrDAFz08FzG4F8IsFDvlI97n4VhWL/CQFiHsFgX0FfIIFeogFeo4FfJQFgZkFiJsFi/gkBfsGiwV6jgV8lQWCmAWHmwWPnAWUmAWalQWcjgX3BosFi8AFi40Fi40FjZEFjJEFjY0Fi4wFwOoFkZEFkJEFi4sFi4wFk44Fko8F9asFkowFkowF9YsFnIgFmoIFlX0FjnsFiHsFgX0FfIIFeogFKIsFOXIFZEUFi2EF9zuLBZyIBZqBBZV+BY56BYh7BYF+BXyBBXqIBQ75SPg99yMVwroFi/dxBVS7BVCkBS+LBU9yBU1WBW06BYtaBak7BclWBcdxBeeLBfcGYhWGiAWFhwVBagWKiwWKigWEigWDiQWKiwWKiwX7BIsFiosFiosFg40FhIwFiowFiosFQKwFhY8FhY4FQMwFiowFiYwFiJEFh5AFio0FiowFZuwFipIFipIFi8wFjJIFjJIFsOwFjI0FjI0Fj5AFjpAFjY0FjIwF1swFko4FkI8F16sFi4sFjIwFk4wFk40Fi4sFjIsF9wSLBYyLBYyLBZOJBZKKBYyKBYyLBdVrBZGHBZCIBYuLBY+cBZWYBZmVBZyOBZ2IBZmBBZV+BY56BYv8mAWKhAWKhAVmKgWKigWKiQWHhgWIhQWJigWKiQVlawWFhwWFhwVBbAWKigWKiwWEiQWDigWKiwWKiwX7BIsFiosFi4sFg4wFg40FiosFi4sFP6sFho8FhI8FQMsFio0FiYwFiJAFh5AFio0Fio0FZuwFiZwFj5sFlZgFm5QFnI0FnIcFmYEFlH0FrDQFyVYFx3EF54sFxqUFpKAFqdoFDvlI+L34CRWNhAWL+9AFiHsFgX0FfIIFeogFeo4FfJQFgZkFiJsFi/fIBW7TBVqfBSyLBU1yBS49BYv7vQWIewWBfQV8ggV6iAV6jgV8lAWBmQWImwWL+SwFjpsFlZkFmpQFnI4FnIgFmoIFlX0FjnsFi/uSBbKsBZGOBZGPBdeqBYyLBYuMBZOMBZONBYyLBYuLBfcGiwWMiwWLiwWTiQWTigWMigWLiwXXbAWLiwWLiwWShgWShwWLigWMiwWPhAWQhQWLigWLiwWxLAUO+Uj3mfmIFduLBZyIBZqCBZV9BY57BYh7BYF9BXyCBXqIBTuLBXqOBXyUBYGZBYibBY6bBZWZBZqUBfH7mRWL/E4FiHsFgX0FfIIFeogFeo4FfJQFgZkFiJsFi/hOBY6cBZWYBZqVBZyOBZyIBZqBBZV+BQ75SPgV+YgVyYsFnIgFmoIFlX0FjnsFiHsFgX0FfIIFeogFTYsFeo4FfJQFgpkFh5sFj5sFlJkFmpQF+wn+MhWGigWIjQWHiwUpqQV8kwWAmAWGmwWNmwWUmQWZlgWbjwWdiQXhcQXpoQWhyQWL+I4Fj5sFlJkFmpQFnI8FnIcFmoIFlX0FjnsFi/yVBYqEBYqFBWswBYiGBYmHBYmIBYmIBYeIBYeIBYiJBYiJBYaKBYaJBfsXbQWIiwWHigUO+Uj3f/eMFfsRLwWLIQWIewWBfQV8ggV6iAV6jgV8lAWCmQWHmwWL+SwFj5sFlJkFmpQFnI4FnIgFmoIFlX0FjnsFi/xXBff495sFm5IFnIwFnIYFmIEFk3wFjHoFhnwFgH4F+2v7MgX3mPtwBZV+BZB7BYh7BYJ9BX2BBXqHBXqNBXyTBQ75SPfu+WMVi/0xBYh7BYF9BXyCBXqIBXqOBXyUBYGZBYibBYv5MQWOmwWVmQWalAWcjwWchwWaggWVfQUO+Uj43/iYFZCGBYuKBYyJBYyFBY2EBYuKBYyJBYv8WwWHewWBfQV9ggV6iAV5jgV9lAWBmQWImwWL+EgFfJYFXIsFdHgFVDEFi/vmBYh7BYF9BX2CBXmIBXqOBX2UBYGZBYebBYv36gVo4wV1nAVdiwVzeAVVMQWL++YFh3sFgX0FfYIFeogFeY4FfZQFgZkFiJsFi/h9BY6cBZWYBZmVBZ2OBZyIBZmBBZV+BY2ABa2mBZGOBZGPBY2LBYyMBZKLBZKNBduLBZKJBZKLBYyKBY2LBZGHBZGIBbZoBYyJBY2KBY+GBY+GBYuJBY2JBZN1BZynBZCQBZCRBbWtBZGPBZGPBY2LBYyMBZKLBZKNBdyLBZKJBZKLBYyKBY2LBZGHBZGIBbZoBYyKBYyKBQ75SPi++B0VjIUFi/vyBYh7BYF9BXyCBXqIBXqOBXyUBYGZBYibBYv36wVt3QVaoQUtiwVPcAUsMwWL++AFiHsFgX0FfIIFeogFeo4FfJQFgZkFiJsFi/h9BY6cBZWYBZqVBZyOBZyIBZqBBZV+BY56BYtlBbCtBZKPBZCPBdiuBYyLBYyMBZKMBZONBYyLBYyLBfcGiwWMiwWNiwWSiQWSigWMigWNiwXWaAWMiwWLiwWShgWRhgWMiwWLiwWPhAWPhAWLiwWLiwWyIQUO+Uj37Ph4FTWLBVRwBU9PBWwvBYtQBaowBcdPBcNvBeCLBcKnBcfHBarmBYvGBWznBU/HBWH3AxWNjAWRiQWSigWNiQWNiwXTaAWRhgWRhwXTQwWLigWMiwWPhAWPhQWLigWMigWv+wAFjIUFjIQFi0QFioQFioUFZyAFiooFi4oFh4QFh4UFiosFi4oFQ0MFhYcFhYcFQ2YFiYsFiYkFhYoFhIkFiYwFiYoF+wCLBYmMBYmKBYSNBYWMBYmNBYmLBUOwBYWPBYWPBUPTBYuMBYqLBYeRBYeSBYuMBYqMBWf2BYqRBYqSBYvSBYySBYyRBa/3AAWMjAWLjAWPkQWPkgWMiwWLjAXT0wWSjwWQkAXTrgWNiwWNjQWSjAWRjQWNigWNjAX3AIsFDvlI9xTXFYWPBYv7dQWHewWCfQV8ggV6iAV6jgV8lAWBmQWImwWL+TMFjpwFlZgFmpUFnI4FnIgFmoEFlH4Fj3oFi4sFkY8FkI4F1asFjIsFjIwFk4wFko0FjIsFjIsF9wSLBYyLBYuLBZOJBZOKBYyKBYuLBdZsBZGHBZGHBdZLBY2KBYyJBY+GBY+GBYuJBY2JBa8rBY2EBYyDBYtLBYqEBYmEBWYsBYqJBYuJBYeGBYeFBYqKBYmKBUBLBYWHBYaIBUBqBYqLBYqKBYOKBYSJBYqLBYqLBfsEiwWKiwWKiwWDjQWEjAWKjAWKiwVBrAWA9w0VwlwFxnEF54sFx6UFyb8FqdoFi7wFbdsFTb8FT6QFL4sFUHIFVFwFDvlI+D33JRXCugWL924FVLoFUKQFL4sFT3IFTVcFbTsFi1oFqTwFyVcFx3EF54sF9wZiFYaIBYWHBUFqBYqLBYqLBYSJBYOJBYqMBYqKBfsEiwWKjAWKigWEjQWDjQWKiwWKiwVArAWGjgWFjwVAywWJjAWKjQWHkAWHkAWLjQWKjQVm6gWJkgWKkwWLywWMkgWNkgWw6wWMjQWLjQWPkAWPkQWMjAWNjAXWywWRjwWRjwXWqgWLiwWMjAWTjAWTjQWLiwWMiwX3BIsFjIsFjIsFkokFk4oFjIoFjIsF1WwFkIcFkYgFi4sFj5sFlJkFmpQFnI4FnIgFmoIFlX0FjnsFi/00BYh7BYF9BXyCBXqIBXqOBXyUBYKZBYebBQ75SPfp+MsVk40F9yaLBZyIBZmBBZV+BY96BYd7BYF+BX2BBXqIBfsdiwU4bgU5TwViNAWL+6MFiHsFgX0FfYIFeYgFeo4FfZQFgZkFh5sFi/h9BY+cBZWYBZmVBZyOBZ2IBZmBBZV+BY56BYtWBdTABZGNBZGPBeutBQ75SO6nFYSQBYuLBYuMBYeSBYeSBXLSBYmcBY+bBZaYBZuTBZyNBZyGBZmBBZN9BZ9TBbt0BfWLBeSsBbuhBYuoBVHCBfsBygX7BIsFiYsFiosFhI0FhIwFiowFiYwFQK8FhY8Fho8FiowFiYwFiJEFh5EFi4wFio0FipEFipIFi9IFjJMFjZMFi4sFi4wFkJEFj5IF1tMFjIsFjIwFkY8Fko8FjIsFi4wF764Fk4wFk40F9xGLBYyKBY2MBZKJBZKKBYyKBY2KBdZoBZmBBZN8BY17BYd7BYB+BXyDBXmJBXqPBUqqBSGLBTluBVRWBYtuBbN4BfcGiwWOigWPiwWQiQWQigWOigWPiQX3EEQFj4cFkIgF1kQFj4QFkIQFi4sFi4sFjYMFjIMFi0MFioUFioQFiooFi4kFh4UFiIYFiYoFiokFhYgFhoYFQGgFiYsFiYkFJ2cFg4oFg4kF+xGLBYmMBYmKBYWNBYSMBYmMBYqMBUCvBQ75SPdd+DEV+wyLBXqOBXyUBYGZBYibBY6bBZWZBZqUBZyOBfcMiwWL9zcFjpsFlZkFmpQFnI4FnIgFmoIFlX0FjnsFi/s3BfdDiwWciAWaggWVfQWOewWIewWBfQV8ggV6iAX7Q4sFi/uCBbNMBeF0BfOLBZyHBZqCBZV9BY57BYh7BYF9BXyCBXqIBfsCiwWFjAWFjAX7AqgFg48FhI4Fi4sFiowFhpEFhZAFVOIFio4FiY4FipAFiZAFjI4Fio4FDvlI+GX3SRWL9+AFjpsFlZkFmpQFnI4FnIgFmoIFlX0FjnsFi/x9BYh6BYF+BXyBBXqIBXqOBXyVBYGYBYicBYuyBWZpBYWHBYWHBT9oBYmKBYqKBYSKBYSJBYmMBYqKBfsGiwWJjAWKigWEjQWEjAWJjAWKjAU/rgWEkAWEkAWLiwWLiwWHkgWHkgVk9AWKkgWKkQWL9/IFjpsFlZkFmpQFnI4FnIgFmoIFlX0FjnsFi/vrBak6Bb10BeeLBcinBQ75SPfB9xcV92j4JgWWmAWakwWcjQWchwWZgQWUfQWNegWHewX7kfxyBYiHBYiGBYiJBYqJBYaIBYaIBYiKBYiKBYaKBYWKBYiLBYiLBYWMBYaMBYiMBYiMBYaOBYaOBYqNBYiNBYiQBYiPBfuQ+HIFhpsFjZwFlJkFmZUFnI8FnIkFmoMFln4FDvlI+Fj3TRX29+kFk5oFmZUFm5AFnYoFmoMFl34FkHsFiXsF+yr8cgWIhwWKhwWIiAWKhwWHiQWIhwWHiQWIiQWGiQWHiQWHiwWHigWHiwWGiwWHjAWHiwWHjQWGjQWIjQWHjQWIjwWIjQWJjwWIjgWKjwWIjwUg9+kFIPvpBYiHBYqHBYiIBYmHBYiJBYiHBYeJBYiJBYaJBYeJBYeLBYeKBYeLBYaLBYeMBYeLBYeNBYaNBYiNBYeNBYiPBYiNBYmPBYiOBYqPBYiPBfsq+HIFiZsFkJsFl5gFmpMFnYwFm4YFmYEFk3wF9wD76QX29+kFjY8FjI8Fjo4FjY8Fj44Fjo4Fjo0Fj40Fj40Fj40Fj4sFj4wFkIsFkIsFj4oFj4sFj4kFkIkFjokFjokFjogFj4gFjYcFjogFjIcFjYcFDvlI+AL3pxX3evtlBZV+BY97BYh7BYF9BX2BBXqIBXmOBX2UBft992YF+337ZgV9ggV5iAV6jgV9lQWBmQWImwWPmwWVmAX3evdlBft692UFgZgFh5sFjpwFlZgFmZUFnI4FnYgFmYMF9337ZwX3ffdnBZmTBZ2OBZyIBZmBBZV+BY56BYd7BYF+BQ75SOj7TxWDigWLiwWLiwVjiwV6jgV8lAWBmQWImwWOmwWVmQWalAWcjgWqiwXLpQXOwQXJ7gX7dfg4BYebBY2bBZSaBZiVBZyPBZ2JBZqDBZZ+BfdX/AEF91n4AQWWmAWakwWdjQWbhwWZgQWUfAWNewWGewX7gfxMBYuKBYqJBT37EQWGhQWGhgU9TAWEiAWGhwU8bAWLiwWLiwUO+Uj3UtkV98+LBZ2IBZmCBZV9BY57BYh7BYF9BX2CBXmIBfwsiwWEjAWFiwWJjQWIiwWGjgWGjgWJjQWJjAWHkAWHkAWKjQWKjQWKkQWJkAWLjgWLjQWMkQWLkQWNjQWLjQWPkAWOkQX38vguBfvPiwV5jgV9lAWBmQWImwWOmwWVmQWZlAWdjgX4LIsFkooFkYsFjYoFjooFkIgFkYgFjIkFjYoFj4YFj4YFjIkFjIkFjIUFjYYFi4gFi4kFioUFi4UFiYkFi4kFh4YFiIYFDgAAAAK0AAACtAAAArQAAAK0AAACtAAAArQAAAK0AAACtAAAArQAAAK0AAACtAAAArQAAAK0AAACtAAAArQAAAK0AAACtAAAArQAAAK0AAACtAAAArQAAAK0AAACtAAAArQAAAK0AAACtAAAArQAAAK0AAACtAAAArQAAAK0AAACtAAAArQAAAK0AAACtAAAArQAAAK0AAACtAAAArQAAAK0AAACtAAAArQAAAK0AAACtAAAArQAAAK0AAACtAAAArQAAAK0AAACtAAAArQAAAK0AAACtAAAArQAAAK0AAACtAAAArQAAAK0AAACtAAAArQAAAK0AAACtAAAArQAAAK0AAACtAAAArQAAAK0AAACtAAAArQAAAK0AAACtAAAArQAAAK0AAACtAAAArQAAAK0AAACtAAAArQAAAK0AAACtAAAArQAAAK0AAACtAAAArQAAA==";var Exe,WAt;function a6n(){if(WAt)return Exe;WAt=1,Exe=function(n){return n!=null&&(t(n)||e(n)||!!n._isBuffer)};function t(n){return!!n.constructor&&typeof n.constructor.isBuffer=="function"&&n.constructor.isBuffer(n)}function e(n){return typeof n.readFloatLE=="function"&&typeof n.slice=="function"&&t(n.slice(0,0))}return Exe}var Bxe,jAt;function A6n(){if(jAt)return Bxe;jAt=1;var t=a6n(),e=Object.prototype.toString;return Bxe=function(o){if(typeof o>"u")return"undefined";if(o===null)return"null";if(o===!0||o===!1||o instanceof Boolean)return"boolean";if(typeof o=="string"||o instanceof String)return"string";if(typeof o=="number"||o instanceof Number)return"number";if(typeof o=="function"||o instanceof Function)return"function";if(typeof Array.isArray<"u"&&Array.isArray(o))return"array";if(o instanceof RegExp)return"regexp";if(o instanceof Date)return"date";var i=e.call(o);return i==="[object RegExp]"?"regexp":i==="[object Date]"?"date":i==="[object Arguments]"?"arguments":i==="[object Error]"?"error":t(o)?"buffer":i==="[object Set]"?"set":i==="[object WeakSet]"?"weakset":i==="[object Map]"?"map":i==="[object WeakMap]"?"weakmap":i==="[object Symbol]"?"symbol":i==="[object Int8Array]"?"int8array":i==="[object Uint8Array]"?"uint8array":i==="[object Uint8ClampedArray]"?"uint8clampedarray":i==="[object Int16Array]"?"int16array":i==="[object Uint16Array]"?"uint16array":i==="[object Int32Array]"?"int32array":i==="[object Uint32Array]"?"uint32array":i==="[object Float32Array]"?"float32array":i==="[object Float64Array]"?"float64array":"object"},Bxe}var bxe={exports:{}},qAt;function c6n(){return qAt||(qAt=1,(function(t){(function(){function e(n,o){if(typeof o!="function")return n;var i={};for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(i[o(r,n[r])||r]=n[r]);return i}t.exports?t.exports=e:window.rename=e})()})(bxe)),bxe.exports}var Sxe,XAt;function l6n(){if(XAt)return Sxe;XAt=1;var t=A6n(),e=c6n();return Sxe=function n(o,i){var r=t(o);if(r!=="object"&&r!=="array")throw new Error("expected an object");var s=[];r==="object"&&(o=e(o,i),s={});for(var a in o)if(o.hasOwnProperty(a)){var A=o[a];t(A)==="object"||t(A)==="array"?s[a]=n(A,i):s[a]=A}return s},Sxe}var g6n=l6n();const u6n=uy(g6n);var Qxe={exports:{}},$At;function ZAt(){return $At||($At=1,(function(t){var e=Object.prototype.hasOwnProperty,n="~";function o(){}Object.create&&(o.prototype=Object.create(null),new o().__proto__||(n=!1));function i(s,a,A){this.fn=s,this.context=a,this.once=A||!1}function r(){this._events=new o,this._eventsCount=0}r.prototype.eventNames=function(){var a=[],A,c;if(this._eventsCount===0)return a;for(c in A=this._events)e.call(A,c)&&a.push(n?c.slice(1):c);return Object.getOwnPropertySymbols?a.concat(Object.getOwnPropertySymbols(A)):a},r.prototype.listeners=function(a,A){var c=n?n+a:a,l=this._events[c];if(A)return!!l;if(!l)return[];if(l.fn)return[l.fn];for(var g=0,u=l.length,h=new Array(u);g<u;g++)h[g]=l[g].fn;return h},r.prototype.emit=function(a,A,c,l,g,u){var h=n?n+a:a;if(!this._events[h])return!1;var d=this._events[h],p=arguments.length,m,_;if(d.fn){switch(d.once&&this.removeListener(a,d.fn,void 0,!0),p){case 1:return d.fn.call(d.context),!0;case 2:return d.fn.call(d.context,A),!0;case 3:return d.fn.call(d.context,A,c),!0;case 4:return d.fn.call(d.context,A,c,l),!0;case 5:return d.fn.call(d.context,A,c,l,g),!0;case 6:return d.fn.call(d.context,A,c,l,g,u),!0}for(_=1,m=new Array(p-1);_<p;_++)m[_-1]=arguments[_];d.fn.apply(d.context,m)}else{var f=d.length,I;for(_=0;_<f;_++)switch(d[_].once&&this.removeListener(a,d[_].fn,void 0,!0),p){case 1:d[_].fn.call(d[_].context);break;case 2:d[_].fn.call(d[_].context,A);break;case 3:d[_].fn.call(d[_].context,A,c);break;case 4:d[_].fn.call(d[_].context,A,c,l);break;default:if(!m)for(I=1,m=new Array(p-1);I<p;I++)m[I-1]=arguments[I];d[_].fn.apply(d[_].context,m)}}return!0},r.prototype.on=function(a,A,c){var l=new i(A,c||this),g=n?n+a:a;return this._events[g]?this._events[g].fn?this._events[g]=[this._events[g],l]:this._events[g].push(l):(this._events[g]=l,this._eventsCount++),this},r.prototype.once=function(a,A,c){var l=new i(A,c||this,!0),g=n?n+a:a;return this._events[g]?this._events[g].fn?this._events[g]=[this._events[g],l]:this._events[g].push(l):(this._events[g]=l,this._eventsCount++),this},r.prototype.removeListener=function(a,A,c,l){var g=n?n+a:a;if(!this._events[g])return this;if(!A)return--this._eventsCount===0?this._events=new o:delete this._events[g],this;var u=this._events[g];if(u.fn)u.fn===A&&(!l||u.once)&&(!c||u.context===c)&&(--this._eventsCount===0?this._events=new o:delete this._events[g]);else{for(var h=0,d=[],p=u.length;h<p;h++)(u[h].fn!==A||l&&!u[h].once||c&&u[h].context!==c)&&d.push(u[h]);d.length?this._events[g]=d.length===1?d[0]:d:--this._eventsCount===0?this._events=new o:delete this._events[g]}return this},r.prototype.removeAllListeners=function(a){var A;return a?(A=n?n+a:a,this._events[A]&&(--this._eventsCount===0?this._events=new o:delete this._events[A])):(this._events=new o,this._eventsCount=0),this},r.prototype.off=r.prototype.removeListener,r.prototype.addListener=r.prototype.on,r.prototype.setMaxListeners=function(){return this},r.prefixed=n,r.EventEmitter=r,t.exports=r})(Qxe)),Qxe.exports}var vxe,ect;function d6n(){if(ect)return vxe;ect=1;function t(c,l,g){return l in c?Object.defineProperty(c,l,{value:g,enumerable:!0,configurable:!0,writable:!0}):c[l]=g,c}var e=ZAt(),n=function(){},o={data:"state-data",cdata:"state-cdata",tagBegin:"state-tag-begin",tagName:"state-tag-name",tagEnd:"state-tag-end",attributeNameStart:"state-attribute-name-start",attributeName:"state-attribute-name",attributeNameEnd:"state-attribute-name-end",attributeValueBegin:"state-attribute-value-begin",attributeValue:"state-attribute-value"},i={lt:"action-lt",gt:"action-gt",space:"action-space",equal:"action-equal",quote:"action-quote",slash:"action-slash",char:"action-char",error:"action-error"},r={text:"text",openTag:"open-tag",closeTag:"close-tag",attributeName:"attribute-name",attributeValue:"attribute-value"},s={" ":i.space," ":i.space,"\n":i.space,"\r":i.space,"<":i.lt,">":i.gt,'"':i.quote,"'":i.quote,"=":i.equal,"/":i.slash},a=function(l){return s[l]||i.char},A=function(l){var g,u,h,d,p,m,_,f,I,C;l=Object.assign({debug:!1},l);var y=new e,x=o.data,E="",B="",S="",Q="",w="",M="",k=function(O,U){if(!(B[0]==="?"||B[0]==="!")){var Y={type:O,value:U};l.debug&&console.log("emit:",Y),y.emit("data",Y)}};y.stateMachine=(C={},t(C,o.data,(g={},t(g,i.lt,function(){E.trim()&&k(r.text,E),B="",w=!1,x=o.tagBegin}),t(g,i.char,function(F){E+=F}),g)),t(C,o.cdata,t({},i.char,function(F){E+=F,E.substr(-3)==="]]>"&&(k(r.text,E.slice(0,-3)),E="",x=o.data)})),t(C,o.tagBegin,(u={},t(u,i.space,n),t(u,i.char,function(F){B=F,x=o.tagName}),t(u,i.slash,function(){B="",w=!0}),u)),t(C,o.tagName,(h={},t(h,i.space,function(){w?x=o.tagEnd:(x=o.attributeNameStart,k(r.openTag,B))}),t(h,i.gt,function(){k(w?r.closeTag:r.openTag,B),E="",x=o.data}),t(h,i.slash,function(){x=o.tagEnd,k(r.openTag,B)}),t(h,i.char,function(F){B+=F,B==="![CDATA["&&(x=o.cdata,E="",B="")}),h)),t(C,o.tagEnd,(d={},t(d,i.gt,function(){k(r.closeTag,B),E="",x=o.data}),t(d,i.char,n),d)),t(C,o.attributeNameStart,(p={},t(p,i.char,function(F){S=F,x=o.attributeName}),t(p,i.gt,function(){E="",x=o.data}),t(p,i.space,n),t(p,i.slash,function(){w=!0,x=o.tagEnd}),p)),t(C,o.attributeName,(m={},t(m,i.space,function(){x=o.attributeNameEnd}),t(m,i.equal,function(){k(r.attributeName,S),x=o.attributeValueBegin}),t(m,i.gt,function(){Q="",k(r.attributeName,S),k(r.attributeValue,Q),E="",x=o.data}),t(m,i.slash,function(){w=!0,Q="",k(r.attributeName,S),k(r.attributeValue,Q),x=o.tagEnd}),t(m,i.char,function(F){S+=F}),m)),t(C,o.attributeNameEnd,(_={},t(_,i.space,n),t(_,i.equal,function(){k(r.attributeName,S),x=o.attributeValueBegin}),t(_,i.gt,function(){Q="",k(r.attributeName,S),k(r.attributeValue,Q),E="",x=o.data}),t(_,i.char,function(F){Q="",k(r.attributeName,S),k(r.attributeValue,Q),S=F,x=o.attributeName}),_)),t(C,o.attributeValueBegin,(f={},t(f,i.space,n),t(f,i.quote,function(F){M=F,Q="",x=o.attributeValue}),t(f,i.gt,function(){Q="",k(r.attributeValue,Q),E="",x=o.data}),t(f,i.char,function(F){M="",Q=F,x=o.attributeValue}),f)),t(C,o.attributeValue,(I={},t(I,i.space,function(F){M?Q+=F:(k(r.attributeValue,Q),x=o.attributeNameStart)}),t(I,i.quote,function(F){M===F?(k(r.attributeValue,Q),x=o.attributeNameStart):Q+=F}),t(I,i.gt,function(F){M?Q+=F:(k(r.attributeValue,Q),E="",x=o.data)}),t(I,i.slash,function(F){M?Q+=F:(k(r.attributeValue,Q),w=!0,x=o.tagEnd)}),t(I,i.char,function(F){Q+=F}),I)),C);var R=function(O){l.debug&&console.log(x,O);var U=y.stateMachine[x],Y=U[a(O)]||U[i.error]||U[i.char];Y(O)};return y.write=function(F){for(var O=F.length,U=0;U<O;U++)R(F[U])},y};return vxe={State:o,Action:i,Type:r,create:A},vxe}var wxe,tct;function h6n(){if(tct)return wxe;tct=1;var t=ZAt(),e=d6n(),n=e.Type,o={element:"element",text:"text"},i=function(A){return Object.assign({name:"",type:o.element,value:"",parent:null,attributes:{},children:[]},A)},r=function(A){A=Object.assign({stream:!1,parentNodes:!0,doneEvent:"done",tagPrefix:"tag:",emitTopLevelOnly:!1,debug:!1},A);var c=void 0,l=void 0,g=void 0,u=void 0,h=new t,d=function(m){switch(m.type){case n.openTag:if(g===null)g=l,g.name=m.value;else{var _=i({name:m.value,parent:g});g.children.push(_),g=_}break;case n.closeTag:var f=g.parent;if(A.parentNodes||(g.parent=null),g.name!==m.value)break;A.stream&&f===l&&(l.children=[],g.parent=null),(!A.emitTopLevelOnly||f===l)&&(h.emit(A.tagPrefix+g.name,g),h.emit("tag",g.name,g)),g===l&&(c.removeAllListeners("data"),h.emit(A.doneEvent,g),l=null),g=f;break;case n.text:g&&g.children.push(i({type:o.text,value:m.value,parent:A.parentNodes?g:null}));break;case n.attributeName:u=m.value,g.attributes[u]="";break;case n.attributeValue:g.attributes[u]=m.value;break}};return h.reset=function(){c=e.create({debug:A.debug}),c.on("data",d),l=i(),g=null,u="",h.parse=c.write},h.reset(),h},s=function(A,c){c=Object.assign({},c,{stream:!1,tagPrefix:":"});var l=r(c),g=void 0;return l.on("done",function(u){g=u}),l.parse(A),g};return wxe={parseSync:s,create:r,NodeType:o},wxe}var p6n=h6n(),m6n=function(e){var n=p6n.parseSync("<root>".concat(e,"</root>"),{parentNodes:!1}),o=n.children&&n.children.length>0&&n.children.every(function(i){return i.name==="svg"});if(o)return n.children.length===1?n.children[0]:n.children;throw Error("nothing to parse")},_6n=function(e){return u6n(e,function(n){return I6n(n)?n:f6n(n)})},f6n=function(e){return e.replace(/[-|:]([a-z])/gi,function(n,o){return o.toUpperCase()})},I6n=function(e){return/^(data|aria)(-\w+)/.test(e)},C6n=function(e){if(e){var n=String(e);return/[&<>]/.test(n)?"<![CDATA[".concat(n.replace(/]]>/,"]]]]><![CDATA[>"),"]]>"):n}return""},y6n=function(e){return String(e).replace(/&/g,"&amp;").replace(/'/g,"&apos;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;")},SV=function(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=n.transformNode,i=o===void 0?function(A){return A}:o,r=n.camelcase,s=r===void 0?!1:r,a=function(c){var l;return l=i(c),s&&(l=_6n(l)),l};return a(m6n(e))},nct=function t(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=n.transformAttr,i=o===void 0?function(h,d,p){return"".concat(h,'="').concat(p(d),'"')}:o,r=n.transformNode,s=r===void 0?function(h){return h}:r,a=n.selfClose,A=a===void 0?!0:a;if(Array.isArray(e))return e.map(function(h){return t(h,{transformAttr:i,selfClose:A,transformNode:s})}).join("");var c=s(e);if(c.type==="text")return C6n(c.value);var l="";for(var g in c.attributes){var u=i(g,c.attributes[g],y6n,c.name);l+=u?" ".concat(u):""}return c.children&&c.children.length>0||!A?"<".concat(c.name).concat(l,">").concat(t(c.children,{transformAttr:i,transformNode:s,selfClose:A}),"</").concat(c.name,">"):"<".concat(c.name).concat(l,"/>")},hQ=t=>{const e=Math.round(t*1e3)/1e3;return`${Number(e.toFixed(3))}mm`},oct=new Map([["T",1e12],["G",1e9],["M",1e6],["K",1e3],["k",1e3],["",1],["m",.001],["µ",1e-6],["μ",1e-6],["u",1e-6],["n",1e-9],["p",1e-12],["f",1e-15]]),x6n=[...oct.keys()];function ict(t){return oct.get(t)}var rct={Hz:{baseUnit:"Hz",variants:{MHz:1e6,kHz:1e3,Hz:1}},g:{baseUnit:"g",variants:{kg:1e3,g:1}},Ω:{baseUnit:"Ω",variants:{mΩ:.001,mohm:.001,mOhm:.001,milliohm:.001,Ω:1,ohm:1,Ohm:1,kΩ:1e3,KΩ:1e3,kohm:1e3,kOhm:1e3,KOhm:1e3,Kohm:1e3,MΩ:1e6,Mohm:1e6,MOhm:1e6,megohm:1e6,Megohm:1e6,GΩ:1e9,Gohm:1e9,GOhm:1e9,TΩ:1e12,Tohm:1e12,TOhm: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,μ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,μF:1e-6,uF:1e-6,mF:.001,F:1,kF:1e3,KF:1e3,MF:1e6}},H:{baseUnit:"H",variants:{pH:1e-12,nH:1e-9,µH:1e-6,μH:1e-6,uH:1e-6,mH:.001,H:1,kH:1e3,KH:1e3,MH:1e6}},ml:{baseUnit:"ml",variants:{ml:1,mL:1,l:1e3,L:1e3}},deg:{baseUnit:"deg",variants:{rad:180/Math.PI}},ms:{baseUnit:"ms",variants:{fs:1e-12,ps:1e-9,ns:1e-6,us:.001,µs:.001,μs:.001,ms:1,s:1e3}},mm:{baseUnit:"mm",variants:{nm:1e-6,µm:.001,μ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}}},Pxe=new Set;for(const[t,e]of Object.entries(rct)){Pxe.add(t);for(const n of Object.keys(e.variants))Pxe.add(n)}function E6n(t){for(const e of Object.values(rct)){if(t in e.variants)return{baseUnit:e.baseUnit,conversionFactor:e.variants[t]};for(const[n,o]of Object.entries(e.variants)){if(!t.endsWith(n))continue;const i=t.slice(0,-n.length),r=ict(i);if(r!=null)return{baseUnit:e.baseUnit,conversionFactor:r*o}}}return{baseUnit:t,conversionFactor:1}}function X1(t,e){if(t==null)return{parsedUnit:null,unitOfValue:null,value:null};if(typeof t=="string"&&t.match(/^-?[\d.]+$/))return{value:Number.parseFloat(t),parsedUnit:null,unitOfValue:null};if(typeof t=="number")return{value:t,parsedUnit:null,unitOfValue:null};if(typeof t=="object"&&"x"in t&&"y"in t){const c=X1(t.x,e),l=X1(t.x,e),g=X1(t.y,e);return l.value===null||g.value===null?{parsedUnit:null,unitOfValue:null,value:null}:{parsedUnit:c.parsedUnit,unitOfValue:c.unitOfValue,value:{x:l.value,y:g.value}}}const o=t.toString().split("").reverse().join("").match(/[^\d\s]+/)?.[0];if(!o)throw new Error(`Could not determine unit: "${t}"`);const i=o.split("").reverse().join(""),r=t.slice(0,-i.length),s=ict(i);if(e&&s!=null)return{parsedUnit:null,unitOfValue:e,value:Number.parseFloat(r)*s};if(s!=null&&!Pxe.has(i))return{parsedUnit:null,unitOfValue:null,value:Number.parseFloat(r)*s};const{baseUnit:a,conversionFactor:A}=E6n(i);return{parsedUnit:i,unitOfValue:a,value:A*Number.parseFloat(r)}}x6n.filter(t=>t!=="").sort((t,e)=>e.length-t.length).map(t=>t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).join("|");var Vk=[{value:1e12,symbol:"T"},{value:1e9,symbol:"G"},{value:1e6,symbol:"M"},{value:1e3,symbol:"k"},{value:1,symbol:""},{value:.001,symbol:"m"},{value:1e-6,symbol:"µ"},{value:1e-9,symbol:"n"},{value:1e-12,symbol:"p"}],B6n=Vk[Vk.length-1];function H_(t){if(t==null)return"";if(t===0)return"0";const e=Math.abs(t);let n=Vk.findIndex(s=>{const a=e/s.value;return a>=1&&a<1e3});n===-1&&(n=Vk.indexOf(B6n));let o=Vk[n],i=t/o.value;for(;n>0&&Math.abs(Number(i.toPrecision(3)))>=1e3;)n-=1,o=Vk[n],i=t/o.value;let r=i.toPrecision(3);return r.includes(".")&&!/\.0+$/.test(r)&&(r=r.replace(/0+$/,"")),r=r.replace(/\.0+$/,""),`${r}${o.symbol}`}var wl;(function(t){t.assertEqual=i=>{};function e(i){}t.assertIs=e;function n(i){throw new Error}t.assertNever=n,t.arrayToEnum=i=>{const r={};for(const s of i)r[s]=s;return r},t.getValidEnumValues=i=>{const r=t.objectKeys(i).filter(a=>typeof i[i[a]]!="number"),s={};for(const a of r)s[a]=i[a];return t.objectValues(s)},t.objectValues=i=>t.objectKeys(i).map(function(r){return i[r]}),t.objectKeys=typeof Object.keys=="function"?i=>Object.keys(i):i=>{const r=[];for(const s in i)Object.prototype.hasOwnProperty.call(i,s)&&r.push(s);return r},t.find=(i,r)=>{for(const s of i)if(r(s))return s},t.isInteger=typeof Number.isInteger=="function"?i=>Number.isInteger(i):i=>typeof i=="number"&&Number.isFinite(i)&&Math.floor(i)===i;function o(i,r=" | "){return i.map(s=>typeof s=="string"?`'${s}'`:s).join(r)}t.joinValues=o,t.jsonStringifyReplacer=(i,r)=>typeof r=="bigint"?r.toString():r})(wl||(wl={}));var sct;(function(t){t.mergeShapes=(e,n)=>({...e,...n})})(sct||(sct={}));const Sr=wl.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),pQ=t=>{switch(typeof t){case"undefined":return Sr.undefined;case"string":return Sr.string;case"number":return Number.isNaN(t)?Sr.nan:Sr.number;case"boolean":return Sr.boolean;case"function":return Sr.function;case"bigint":return Sr.bigint;case"symbol":return Sr.symbol;case"object":return Array.isArray(t)?Sr.array:t===null?Sr.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?Sr.promise:typeof Map<"u"&&t instanceof Map?Sr.map:typeof Set<"u"&&t instanceof Set?Sr.set:typeof Date<"u"&&t instanceof Date?Sr.date:Sr.object;default:return Sr.unknown}},lo=wl.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class m5 extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=o=>{this.issues=[...this.issues,o]},this.addIssues=(o=[])=>{this.issues=[...this.issues,...o]};const n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=e}format(e){const n=e||function(r){return r.message},o={_errors:[]},i=r=>{for(const s of r.issues)if(s.code==="invalid_union")s.unionErrors.map(i);else if(s.code==="invalid_return_type")i(s.returnTypeError);else if(s.code==="invalid_arguments")i(s.argumentsError);else if(s.path.length===0)o._errors.push(n(s));else{let a=o,A=0;for(;A<s.path.length;){const c=s.path[A];A===s.path.length-1?(a[c]=a[c]||{_errors:[]},a[c]._errors.push(n(s))):a[c]=a[c]||{_errors:[]},a=a[c],A++}}};return i(this),o}static assert(e){if(!(e instanceof m5))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,wl.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=n=>n.message){const n={},o=[];for(const i of this.issues)if(i.path.length>0){const r=i.path[0];n[r]=n[r]||[],n[r].push(e(i))}else o.push(e(i));return{formErrors:o,fieldErrors:n}}get formErrors(){return this.flatten()}}m5.create=t=>new m5(t);const QV=(t,e)=>{let n;switch(t.code){case lo.invalid_type:t.received===Sr.undefined?n="Required":n=`Expected ${t.expected}, received ${t.received}`;break;case lo.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(t.expected,wl.jsonStringifyReplacer)}`;break;case lo.unrecognized_keys:n=`Unrecognized key(s) in object: ${wl.joinValues(t.keys,", ")}`;break;case lo.invalid_union:n="Invalid input";break;case lo.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${wl.joinValues(t.options)}`;break;case lo.invalid_enum_value:n=`Invalid enum value. Expected ${wl.joinValues(t.options)}, received '${t.received}'`;break;case lo.invalid_arguments:n="Invalid function arguments";break;case lo.invalid_return_type:n="Invalid function return type";break;case lo.invalid_date:n="Invalid date";break;case lo.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(n=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?n=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?n=`Invalid input: must end with "${t.validation.endsWith}"`:wl.assertNever(t.validation):t.validation!=="regex"?n=`Invalid ${t.validation}`:n="Invalid";break;case lo.too_small:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="bigint"?n=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:n="Invalid input";break;case lo.too_big:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?n=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:n="Invalid input";break;case lo.custom:n="Invalid input";break;case lo.invalid_intersection_types:n="Intersection results could not be merged";break;case lo.not_multiple_of:n=`Number must be a multiple of ${t.multipleOf}`;break;case lo.not_finite:n="Number must be finite";break;default:n=e.defaultError,wl.assertNever(t)}return{message:n}};let b6n=QV;function Mxe(){return b6n}const Dxe=t=>{const{data:e,path:n,errorMaps:o,issueData:i}=t,r=[...n,...i.path||[]],s={...i,path:r};if(i.message!==void 0)return{...i,path:r,message:i.message};let a="";const A=o.filter(c=>!!c).slice().reverse();for(const c of A)a=c(s,{data:e,defaultError:a}).message;return{...i,path:r,message:a}};function rr(t,e){const n=Mxe(),o=Dxe({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,n,n===QV?void 0:QV].filter(i=>!!i)});t.common.issues.push(o)}class my{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,n){const o=[];for(const i of n){if(i.status==="aborted")return Zs;i.status==="dirty"&&e.dirty(),o.push(i.value)}return{status:e.value,value:o}}static async mergeObjectAsync(e,n){const o=[];for(const i of n){const r=await i.key,s=await i.value;o.push({key:r,value:s})}return my.mergeObjectSync(e,o)}static mergeObjectSync(e,n){const o={};for(const i of n){const{key:r,value:s}=i;if(r.status==="aborted"||s.status==="aborted")return Zs;r.status==="dirty"&&e.dirty(),s.status==="dirty"&&e.dirty(),r.value!=="__proto__"&&(typeof s.value<"u"||i.alwaysSet)&&(o[r.value]=s.value)}return{status:e.value,value:o}}}const Zs=Object.freeze({status:"aborted"}),vV=t=>({status:"dirty",value:t}),rx=t=>({status:"valid",value:t}),act=t=>t.status==="aborted",Act=t=>t.status==="dirty",zk=t=>t.status==="valid",bne=t=>typeof Promise<"u"&&t instanceof Promise;var is;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e?.message})(is||(is={}));class w9{constructor(e,n,o,i){this._cachedPath=[],this.parent=e,this.data=n,this._path=o,this._key=i}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 cct=(t,e)=>{if(zk(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const n=new m5(t.common.issues);return this._error=n,this._error}}};function EA(t){if(!t)return{};const{errorMap:e,invalid_type_error:n,required_error:o,description:i}=t;if(e&&(n||o))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:i}:{errorMap:(s,a)=>{const{message:A}=t;return s.code==="invalid_enum_value"?{message:A??a.defaultError}:typeof a.data>"u"?{message:A??o??a.defaultError}:s.code!=="invalid_type"?{message:a.defaultError}:{message:A??n??a.defaultError}},description:i}}class Bc{get description(){return this._def.description}_getType(e){return pQ(e.data)}_getOrReturnCtx(e,n){return n||{common:e.parent.common,data:e.data,parsedType:pQ(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new my,ctx:{common:e.parent.common,data:e.data,parsedType:pQ(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const n=this._parse(e);if(bne(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(e){const n=this._parse(e);return Promise.resolve(n)}parse(e,n){const o=this.safeParse(e,n);if(o.success)return o.data;throw o.error}safeParse(e,n){const o={common:{issues:[],async:n?.async??!1,contextualErrorMap:n?.errorMap},path:n?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:pQ(e)},i=this._parseSync({data:e,path:o.path,parent:o});return cct(o,i)}"~validate"(e){const n={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:pQ(e)};if(!this["~standard"].async)try{const o=this._parseSync({data:e,path:[],parent:n});return zk(o)?{value:o.value}:{issues:n.common.issues}}catch(o){o?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),n.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:n}).then(o=>zk(o)?{value:o.value}:{issues:n.common.issues})}async parseAsync(e,n){const o=await this.safeParseAsync(e,n);if(o.success)return o.data;throw o.error}async safeParseAsync(e,n){const o={common:{issues:[],contextualErrorMap:n?.errorMap,async:!0},path:n?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:pQ(e)},i=this._parse({data:e,path:o.path,parent:o}),r=await(bne(i)?i:Promise.resolve(i));return cct(o,r)}refine(e,n){const o=i=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(i):n;return this._refinement((i,r)=>{const s=e(i),a=()=>r.addIssue({code:lo.custom,...o(i)});return typeof Promise<"u"&&s instanceof Promise?s.then(A=>A?!0:(a(),!1)):s?!0:(a(),!1)})}refinement(e,n){return this._refinement((o,i)=>e(o)?!0:(i.addIssue(typeof n=="function"?n(o,i):n),!1))}_refinement(e){return new _Q({schema:this,typeName:Ea.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:n=>this["~validate"](n)}}optional(){return w8.create(this,this._def)}nullable(){return VM.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return M9.create(this)}promise(){return DV.create(this,this._def)}or(e){return vne.create([this,e],this._def)}and(e){return wne.create(this,e,this._def)}transform(e){return new _Q({...EA(this._def),schema:this,typeName:Ea.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const n=typeof e=="function"?e:()=>e;return new Dne({...EA(this._def),innerType:this,defaultValue:n,typeName:Ea.ZodDefault})}brand(){return new _ct({typeName:Ea.ZodBranded,type:this,...EA(this._def)})}catch(e){const n=typeof e=="function"?e:()=>e;return new Nne({...EA(this._def),innerType:this,catchValue:n,typeName:Ea.ZodCatch})}describe(e){const n=this.constructor;return new n({...this._def,description:e})}pipe(e){return Hxe.create(this,e)}readonly(){return Rne.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const S6n=/^c[^\s-]{8,}$/i,Q6n=/^[0-9a-z]+$/,v6n=/^[0-9A-HJKMNP-TV-Z]{26}$/i,w6n=/^[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,P6n=/^[a-z0-9_-]{21}$/i,M6n=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,D6n=/^[-+]?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)?)??$/,N6n=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,R6n="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let Nxe;const T6n=/^(?:(?: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])$/,k6n=/^(?:(?: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])$/,F6n=/^(([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]))$/,L6n=/^(([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])$/,H6n=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,O6n=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,lct="((\\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])))",G6n=new RegExp(`^${lct}$`);function gct(t){let e="[0-5]\\d";t.precision?e=`${e}\\.\\d{${t.precision}}`:t.precision==null&&(e=`${e}(\\.\\d+)?`);const n=t.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${n}`}function Y6n(t){return new RegExp(`^${gct(t)}$`)}function U6n(t){let e=`${lct}T${gct(t)}`;const n=[];return n.push(t.local?"Z?":"Z"),t.offset&&n.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${n.join("|")})`,new RegExp(`^${e}$`)}function K6n(t,e){return!!((e==="v4"||!e)&&T6n.test(t)||(e==="v6"||!e)&&F6n.test(t))}function V6n(t,e){if(!M6n.test(t))return!1;try{const[n]=t.split(".");if(!n)return!1;const o=n.replace(/-/g,"+").replace(/_/g,"/").padEnd(n.length+(4-n.length%4)%4,"="),i=JSON.parse(atob(o));return!(typeof i!="object"||i===null||"typ"in i&&i?.typ!=="JWT"||!i.alg||e&&i.alg!==e)}catch{return!1}}function z6n(t,e){return!!((e==="v4"||!e)&&k6n.test(t)||(e==="v6"||!e)&&L6n.test(t))}class P9 extends Bc{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==Sr.string){const r=this._getOrReturnCtx(e);return rr(r,{code:lo.invalid_type,expected:Sr.string,received:r.parsedType}),Zs}const o=new my;let i;for(const r of this._def.checks)if(r.kind==="min")e.data.length<r.value&&(i=this._getOrReturnCtx(e,i),rr(i,{code:lo.too_small,minimum:r.value,type:"string",inclusive:!0,exact:!1,message:r.message}),o.dirty());else if(r.kind==="max")e.data.length>r.value&&(i=this._getOrReturnCtx(e,i),rr(i,{code:lo.too_big,maximum:r.value,type:"string",inclusive:!0,exact:!1,message:r.message}),o.dirty());else if(r.kind==="length"){const s=e.data.length>r.value,a=e.data.length<r.value;(s||a)&&(i=this._getOrReturnCtx(e,i),s?rr(i,{code:lo.too_big,maximum:r.value,type:"string",inclusive:!0,exact:!0,message:r.message}):a&&rr(i,{code:lo.too_small,minimum:r.value,type:"string",inclusive:!0,exact:!0,message:r.message}),o.dirty())}else if(r.kind==="email")N6n.test(e.data)||(i=this._getOrReturnCtx(e,i),rr(i,{validation:"email",code:lo.invalid_string,message:r.message}),o.dirty());else if(r.kind==="emoji")Nxe||(Nxe=new RegExp(R6n,"u")),Nxe.test(e.data)||(i=this._getOrReturnCtx(e,i),rr(i,{validation:"emoji",code:lo.invalid_string,message:r.message}),o.dirty());else if(r.kind==="uuid")w6n.test(e.data)||(i=this._getOrReturnCtx(e,i),rr(i,{validation:"uuid",code:lo.invalid_string,message:r.message}),o.dirty());else if(r.kind==="nanoid")P6n.test(e.data)||(i=this._getOrReturnCtx(e,i),rr(i,{validation:"nanoid",code:lo.invalid_string,message:r.message}),o.dirty());else if(r.kind==="cuid")S6n.test(e.data)||(i=this._getOrReturnCtx(e,i),rr(i,{validation:"cuid",code:lo.invalid_string,message:r.message}),o.dirty());else if(r.kind==="cuid2")Q6n.test(e.data)||(i=this._getOrReturnCtx(e,i),rr(i,{validation:"cuid2",code:lo.invalid_string,message:r.message}),o.dirty());else if(r.kind==="ulid")v6n.test(e.data)||(i=this._getOrReturnCtx(e,i),rr(i,{validation:"ulid",code:lo.invalid_string,message:r.message}),o.dirty());else if(r.kind==="url")try{new URL(e.data)}catch{i=this._getOrReturnCtx(e,i),rr(i,{validation:"url",code:lo.invalid_string,message:r.message}),o.dirty()}else r.kind==="regex"?(r.regex.lastIndex=0,r.regex.test(e.data)||(i=this._getOrReturnCtx(e,i),rr(i,{validation:"regex",code:lo.invalid_string,message:r.message}),o.dirty())):r.kind==="trim"?e.data=e.data.trim():r.kind==="includes"?e.data.includes(r.value,r.position)||(i=this._getOrReturnCtx(e,i),rr(i,{code:lo.invalid_string,validation:{includes:r.value,position:r.position},message:r.message}),o.dirty()):r.kind==="toLowerCase"?e.data=e.data.toLowerCase():r.kind==="toUpperCase"?e.data=e.data.toUpperCase():r.kind==="startsWith"?e.data.startsWith(r.value)||(i=this._getOrReturnCtx(e,i),rr(i,{code:lo.invalid_string,validation:{startsWith:r.value},message:r.message}),o.dirty()):r.kind==="endsWith"?e.data.endsWith(r.value)||(i=this._getOrReturnCtx(e,i),rr(i,{code:lo.invalid_string,validation:{endsWith:r.value},message:r.message}),o.dirty()):r.kind==="datetime"?U6n(r).test(e.data)||(i=this._getOrReturnCtx(e,i),rr(i,{code:lo.invalid_string,validation:"datetime",message:r.message}),o.dirty()):r.kind==="date"?G6n.test(e.data)||(i=this._getOrReturnCtx(e,i),rr(i,{code:lo.invalid_string,validation:"date",message:r.message}),o.dirty()):r.kind==="time"?Y6n(r).test(e.data)||(i=this._getOrReturnCtx(e,i),rr(i,{code:lo.invalid_string,validation:"time",message:r.message}),o.dirty()):r.kind==="duration"?D6n.test(e.data)||(i=this._getOrReturnCtx(e,i),rr(i,{validation:"duration",code:lo.invalid_string,message:r.message}),o.dirty()):r.kind==="ip"?K6n(e.data,r.version)||(i=this._getOrReturnCtx(e,i),rr(i,{validation:"ip",code:lo.invalid_string,message:r.message}),o.dirty()):r.kind==="jwt"?V6n(e.data,r.alg)||(i=this._getOrReturnCtx(e,i),rr(i,{validation:"jwt",code:lo.invalid_string,message:r.message}),o.dirty()):r.kind==="cidr"?z6n(e.data,r.version)||(i=this._getOrReturnCtx(e,i),rr(i,{validation:"cidr",code:lo.invalid_string,message:r.message}),o.dirty()):r.kind==="base64"?H6n.test(e.data)||(i=this._getOrReturnCtx(e,i),rr(i,{validation:"base64",code:lo.invalid_string,message:r.message}),o.dirty()):r.kind==="base64url"?O6n.test(e.data)||(i=this._getOrReturnCtx(e,i),rr(i,{validation:"base64url",code:lo.invalid_string,message:r.message}),o.dirty()):wl.assertNever(r);return{status:o.value,value:e.data}}_regex(e,n,o){return this.refinement(i=>e.test(i),{validation:n,code:lo.invalid_string,...is.errToObj(o)})}_addCheck(e){return new P9({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...is.errToObj(e)})}url(e){return this._addCheck({kind:"url",...is.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...is.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...is.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...is.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...is.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...is.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...is.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...is.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...is.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...is.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...is.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...is.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?.precision>"u"?null:e?.precision,offset:e?.offset??!1,local:e?.local??!1,...is.errToObj(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?.precision>"u"?null:e?.precision,...is.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...is.errToObj(e)})}regex(e,n){return this._addCheck({kind:"regex",regex:e,...is.errToObj(n)})}includes(e,n){return this._addCheck({kind:"includes",value:e,position:n?.position,...is.errToObj(n?.message)})}startsWith(e,n){return this._addCheck({kind:"startsWith",value:e,...is.errToObj(n)})}endsWith(e,n){return this._addCheck({kind:"endsWith",value:e,...is.errToObj(n)})}min(e,n){return this._addCheck({kind:"min",value:e,...is.errToObj(n)})}max(e,n){return this._addCheck({kind:"max",value:e,...is.errToObj(n)})}length(e,n){return this._addCheck({kind:"length",value:e,...is.errToObj(n)})}nonempty(e){return this.min(1,is.errToObj(e))}trim(){return new P9({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new P9({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new P9({...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 n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxLength(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}}P9.create=t=>new P9({checks:[],typeName:Ea.ZodString,coerce:t?.coerce??!1,...EA(t)});function J6n(t,e){const n=(t.toString().split(".")[1]||"").length,o=(e.toString().split(".")[1]||"").length,i=n>o?n:o,r=Number.parseInt(t.toFixed(i).replace(".","")),s=Number.parseInt(e.toFixed(i).replace(".",""));return r%s/10**i}class YM extends Bc{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)!==Sr.number){const r=this._getOrReturnCtx(e);return rr(r,{code:lo.invalid_type,expected:Sr.number,received:r.parsedType}),Zs}let o;const i=new my;for(const r of this._def.checks)r.kind==="int"?wl.isInteger(e.data)||(o=this._getOrReturnCtx(e,o),rr(o,{code:lo.invalid_type,expected:"integer",received:"float",message:r.message}),i.dirty()):r.kind==="min"?(r.inclusive?e.data<r.value:e.data<=r.value)&&(o=this._getOrReturnCtx(e,o),rr(o,{code:lo.too_small,minimum:r.value,type:"number",inclusive:r.inclusive,exact:!1,message:r.message}),i.dirty()):r.kind==="max"?(r.inclusive?e.data>r.value:e.data>=r.value)&&(o=this._getOrReturnCtx(e,o),rr(o,{code:lo.too_big,maximum:r.value,type:"number",inclusive:r.inclusive,exact:!1,message:r.message}),i.dirty()):r.kind==="multipleOf"?J6n(e.data,r.value)!==0&&(o=this._getOrReturnCtx(e,o),rr(o,{code:lo.not_multiple_of,multipleOf:r.value,message:r.message}),i.dirty()):r.kind==="finite"?Number.isFinite(e.data)||(o=this._getOrReturnCtx(e,o),rr(o,{code:lo.not_finite,message:r.message}),i.dirty()):wl.assertNever(r);return{status:i.value,value:e.data}}gte(e,n){return this.setLimit("min",e,!0,is.toString(n))}gt(e,n){return this.setLimit("min",e,!1,is.toString(n))}lte(e,n){return this.setLimit("max",e,!0,is.toString(n))}lt(e,n){return this.setLimit("max",e,!1,is.toString(n))}setLimit(e,n,o,i){return new YM({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:o,message:is.toString(i)}]})}_addCheck(e){return new YM({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:is.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:is.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:is.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:is.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:is.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:is.toString(n)})}finite(e){return this._addCheck({kind:"finite",message:is.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:is.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:is.toString(e)})}get minValue(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&wl.isInteger(e.value))}get isFinite(){let e=null,n=null;for(const o of this._def.checks){if(o.kind==="finite"||o.kind==="int"||o.kind==="multipleOf")return!0;o.kind==="min"?(n===null||o.value>n)&&(n=o.value):o.kind==="max"&&(e===null||o.value<e)&&(e=o.value)}return Number.isFinite(n)&&Number.isFinite(e)}}YM.create=t=>new YM({checks:[],typeName:Ea.ZodNumber,coerce:t?.coerce||!1,...EA(t)});class UM extends Bc{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)!==Sr.bigint)return this._getInvalidInput(e);let o;const i=new my;for(const r of this._def.checks)r.kind==="min"?(r.inclusive?e.data<r.value:e.data<=r.value)&&(o=this._getOrReturnCtx(e,o),rr(o,{code:lo.too_small,type:"bigint",minimum:r.value,inclusive:r.inclusive,message:r.message}),i.dirty()):r.kind==="max"?(r.inclusive?e.data>r.value:e.data>=r.value)&&(o=this._getOrReturnCtx(e,o),rr(o,{code:lo.too_big,type:"bigint",maximum:r.value,inclusive:r.inclusive,message:r.message}),i.dirty()):r.kind==="multipleOf"?e.data%r.value!==BigInt(0)&&(o=this._getOrReturnCtx(e,o),rr(o,{code:lo.not_multiple_of,multipleOf:r.value,message:r.message}),i.dirty()):wl.assertNever(r);return{status:i.value,value:e.data}}_getInvalidInput(e){const n=this._getOrReturnCtx(e);return rr(n,{code:lo.invalid_type,expected:Sr.bigint,received:n.parsedType}),Zs}gte(e,n){return this.setLimit("min",e,!0,is.toString(n))}gt(e,n){return this.setLimit("min",e,!1,is.toString(n))}lte(e,n){return this.setLimit("max",e,!0,is.toString(n))}lt(e,n){return this.setLimit("max",e,!1,is.toString(n))}setLimit(e,n,o,i){return new UM({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:o,message:is.toString(i)}]})}_addCheck(e){return new UM({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:is.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:is.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:is.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:is.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:is.toString(n)})}get minValue(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}}UM.create=t=>new UM({checks:[],typeName:Ea.ZodBigInt,coerce:t?.coerce??!1,...EA(t)});class Sne extends Bc{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==Sr.boolean){const o=this._getOrReturnCtx(e);return rr(o,{code:lo.invalid_type,expected:Sr.boolean,received:o.parsedType}),Zs}return rx(e.data)}}Sne.create=t=>new Sne({typeName:Ea.ZodBoolean,coerce:t?.coerce||!1,...EA(t)});class Jk extends Bc{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==Sr.date){const r=this._getOrReturnCtx(e);return rr(r,{code:lo.invalid_type,expected:Sr.date,received:r.parsedType}),Zs}if(Number.isNaN(e.data.getTime())){const r=this._getOrReturnCtx(e);return rr(r,{code:lo.invalid_date}),Zs}const o=new my;let i;for(const r of this._def.checks)r.kind==="min"?e.data.getTime()<r.value&&(i=this._getOrReturnCtx(e,i),rr(i,{code:lo.too_small,message:r.message,inclusive:!0,exact:!1,minimum:r.value,type:"date"}),o.dirty()):r.kind==="max"?e.data.getTime()>r.value&&(i=this._getOrReturnCtx(e,i),rr(i,{code:lo.too_big,message:r.message,inclusive:!0,exact:!1,maximum:r.value,type:"date"}),o.dirty()):wl.assertNever(r);return{status:o.value,value:new Date(e.data.getTime())}}_addCheck(e){return new Jk({...this._def,checks:[...this._def.checks,e]})}min(e,n){return this._addCheck({kind:"min",value:e.getTime(),message:is.toString(n)})}max(e,n){return this._addCheck({kind:"max",value:e.getTime(),message:is.toString(n)})}get minDate(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e!=null?new Date(e):null}}Jk.create=t=>new Jk({checks:[],coerce:t?.coerce||!1,typeName:Ea.ZodDate,...EA(t)});class uct extends Bc{_parse(e){if(this._getType(e)!==Sr.symbol){const o=this._getOrReturnCtx(e);return rr(o,{code:lo.invalid_type,expected:Sr.symbol,received:o.parsedType}),Zs}return rx(e.data)}}uct.create=t=>new uct({typeName:Ea.ZodSymbol,...EA(t)});class Rxe extends Bc{_parse(e){if(this._getType(e)!==Sr.undefined){const o=this._getOrReturnCtx(e);return rr(o,{code:lo.invalid_type,expected:Sr.undefined,received:o.parsedType}),Zs}return rx(e.data)}}Rxe.create=t=>new Rxe({typeName:Ea.ZodUndefined,...EA(t)});class Qne extends Bc{_parse(e){if(this._getType(e)!==Sr.null){const o=this._getOrReturnCtx(e);return rr(o,{code:lo.invalid_type,expected:Sr.null,received:o.parsedType}),Zs}return rx(e.data)}}Qne.create=t=>new Qne({typeName:Ea.ZodNull,...EA(t)});class wV extends Bc{constructor(){super(...arguments),this._any=!0}_parse(e){return rx(e.data)}}wV.create=t=>new wV({typeName:Ea.ZodAny,...EA(t)});class Wk extends Bc{constructor(){super(...arguments),this._unknown=!0}_parse(e){return rx(e.data)}}Wk.create=t=>new Wk({typeName:Ea.ZodUnknown,...EA(t)});class mQ extends Bc{_parse(e){const n=this._getOrReturnCtx(e);return rr(n,{code:lo.invalid_type,expected:Sr.never,received:n.parsedType}),Zs}}mQ.create=t=>new mQ({typeName:Ea.ZodNever,...EA(t)});class dct extends Bc{_parse(e){if(this._getType(e)!==Sr.undefined){const o=this._getOrReturnCtx(e);return rr(o,{code:lo.invalid_type,expected:Sr.void,received:o.parsedType}),Zs}return rx(e.data)}}dct.create=t=>new dct({typeName:Ea.ZodVoid,...EA(t)});class M9 extends Bc{_parse(e){const{ctx:n,status:o}=this._processInputParams(e),i=this._def;if(n.parsedType!==Sr.array)return rr(n,{code:lo.invalid_type,expected:Sr.array,received:n.parsedType}),Zs;if(i.exactLength!==null){const s=n.data.length>i.exactLength.value,a=n.data.length<i.exactLength.value;(s||a)&&(rr(n,{code:s?lo.too_big:lo.too_small,minimum:a?i.exactLength.value:void 0,maximum:s?i.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:i.exactLength.message}),o.dirty())}if(i.minLength!==null&&n.data.length<i.minLength.value&&(rr(n,{code:lo.too_small,minimum:i.minLength.value,type:"array",inclusive:!0,exact:!1,message:i.minLength.message}),o.dirty()),i.maxLength!==null&&n.data.length>i.maxLength.value&&(rr(n,{code:lo.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,exact:!1,message:i.maxLength.message}),o.dirty()),n.common.async)return Promise.all([...n.data].map((s,a)=>i.type._parseAsync(new w9(n,s,n.path,a)))).then(s=>my.mergeArray(o,s));const r=[...n.data].map((s,a)=>i.type._parseSync(new w9(n,s,n.path,a)));return my.mergeArray(o,r)}get element(){return this._def.type}min(e,n){return new M9({...this._def,minLength:{value:e,message:is.toString(n)}})}max(e,n){return new M9({...this._def,maxLength:{value:e,message:is.toString(n)}})}length(e,n){return new M9({...this._def,exactLength:{value:e,message:is.toString(n)}})}nonempty(e){return this.min(1,e)}}M9.create=(t,e)=>new M9({type:t,minLength:null,maxLength:null,exactLength:null,typeName:Ea.ZodArray,...EA(e)});function jk(t){if(t instanceof Km){const e={};for(const n in t.shape){const o=t.shape[n];e[n]=w8.create(jk(o))}return new Km({...t._def,shape:()=>e})}else return t instanceof M9?new M9({...t._def,type:jk(t.element)}):t instanceof w8?w8.create(jk(t.unwrap())):t instanceof VM?VM.create(jk(t.unwrap())):t instanceof v8?v8.create(t.items.map(e=>jk(e))):t}class Km extends Bc{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(),n=wl.objectKeys(e);return this._cached={shape:e,keys:n},this._cached}_parse(e){if(this._getType(e)!==Sr.object){const c=this._getOrReturnCtx(e);return rr(c,{code:lo.invalid_type,expected:Sr.object,received:c.parsedType}),Zs}const{status:o,ctx:i}=this._processInputParams(e),{shape:r,keys:s}=this._getCached(),a=[];if(!(this._def.catchall instanceof mQ&&this._def.unknownKeys==="strip"))for(const c in i.data)s.includes(c)||a.push(c);const A=[];for(const c of s){const l=r[c],g=i.data[c];A.push({key:{status:"valid",value:c},value:l._parse(new w9(i,g,i.path,c)),alwaysSet:c in i.data})}if(this._def.catchall instanceof mQ){const c=this._def.unknownKeys;if(c==="passthrough")for(const l of a)A.push({key:{status:"valid",value:l},value:{status:"valid",value:i.data[l]}});else if(c==="strict")a.length>0&&(rr(i,{code:lo.unrecognized_keys,keys:a}),o.dirty());else if(c!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const c=this._def.catchall;for(const l of a){const g=i.data[l];A.push({key:{status:"valid",value:l},value:c._parse(new w9(i,g,i.path,l)),alwaysSet:l in i.data})}}return i.common.async?Promise.resolve().then(async()=>{const c=[];for(const l of A){const g=await l.key,u=await l.value;c.push({key:g,value:u,alwaysSet:l.alwaysSet})}return c}).then(c=>my.mergeObjectSync(o,c)):my.mergeObjectSync(o,A)}get shape(){return this._def.shape()}strict(e){return is.errToObj,new Km({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(n,o)=>{const i=this._def.errorMap?.(n,o).message??o.defaultError;return n.code==="unrecognized_keys"?{message:is.errToObj(e).message??i}:{message:i}}}:{}})}strip(){return new Km({...this._def,unknownKeys:"strip"})}passthrough(){return new Km({...this._def,unknownKeys:"passthrough"})}extend(e){return new Km({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new Km({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:Ea.ZodObject})}setKey(e,n){return this.augment({[e]:n})}catchall(e){return new Km({...this._def,catchall:e})}pick(e){const n={};for(const o of wl.objectKeys(e))e[o]&&this.shape[o]&&(n[o]=this.shape[o]);return new Km({...this._def,shape:()=>n})}omit(e){const n={};for(const o of wl.objectKeys(this.shape))e[o]||(n[o]=this.shape[o]);return new Km({...this._def,shape:()=>n})}deepPartial(){return jk(this)}partial(e){const n={};for(const o of wl.objectKeys(this.shape)){const i=this.shape[o];e&&!e[o]?n[o]=i:n[o]=i.optional()}return new Km({...this._def,shape:()=>n})}required(e){const n={};for(const o of wl.objectKeys(this.shape))if(e&&!e[o])n[o]=this.shape[o];else{let r=this.shape[o];for(;r instanceof w8;)r=r._def.innerType;n[o]=r}return new Km({...this._def,shape:()=>n})}keyof(){return pct(wl.objectKeys(this.shape))}}Km.create=(t,e)=>new Km({shape:()=>t,unknownKeys:"strip",catchall:mQ.create(),typeName:Ea.ZodObject,...EA(e)}),Km.strictCreate=(t,e)=>new Km({shape:()=>t,unknownKeys:"strict",catchall:mQ.create(),typeName:Ea.ZodObject,...EA(e)}),Km.lazycreate=(t,e)=>new Km({shape:t,unknownKeys:"strip",catchall:mQ.create(),typeName:Ea.ZodObject,...EA(e)});class vne extends Bc{_parse(e){const{ctx:n}=this._processInputParams(e),o=this._def.options;function i(r){for(const a of r)if(a.result.status==="valid")return a.result;for(const a of r)if(a.result.status==="dirty")return n.common.issues.push(...a.ctx.common.issues),a.result;const s=r.map(a=>new m5(a.ctx.common.issues));return rr(n,{code:lo.invalid_union,unionErrors:s}),Zs}if(n.common.async)return Promise.all(o.map(async r=>{const s={...n,common:{...n.common,issues:[]},parent:null};return{result:await r._parseAsync({data:n.data,path:n.path,parent:s}),ctx:s}})).then(i);{let r;const s=[];for(const A of o){const c={...n,common:{...n.common,issues:[]},parent:null},l=A._parseSync({data:n.data,path:n.path,parent:c});if(l.status==="valid")return l;l.status==="dirty"&&!r&&(r={result:l,ctx:c}),c.common.issues.length&&s.push(c.common.issues)}if(r)return n.common.issues.push(...r.ctx.common.issues),r.result;const a=s.map(A=>new m5(A));return rr(n,{code:lo.invalid_union,unionErrors:a}),Zs}}get options(){return this._def.options}}vne.create=(t,e)=>new vne({options:t,typeName:Ea.ZodUnion,...EA(e)});const Q8=t=>t instanceof Fxe?Q8(t.schema):t instanceof _Q?Q8(t.innerType()):t instanceof Mne?[t.value]:t instanceof KM?t.options:t instanceof Lxe?wl.objectValues(t.enum):t instanceof Dne?Q8(t._def.innerType):t instanceof Rxe?[void 0]:t instanceof Qne?[null]:t instanceof w8?[void 0,...Q8(t.unwrap())]:t instanceof VM?[null,...Q8(t.unwrap())]:t instanceof _ct||t instanceof Rne?Q8(t.unwrap()):t instanceof Nne?Q8(t._def.innerType):[];class Txe extends Bc{_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==Sr.object)return rr(n,{code:lo.invalid_type,expected:Sr.object,received:n.parsedType}),Zs;const o=this.discriminator,i=n.data[o],r=this.optionsMap.get(i);return r?n.common.async?r._parseAsync({data:n.data,path:n.path,parent:n}):r._parseSync({data:n.data,path:n.path,parent:n}):(rr(n,{code:lo.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[o]}),Zs)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,n,o){const i=new Map;for(const r of n){const s=Q8(r.shape[e]);if(!s.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(const a of s){if(i.has(a))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(a)}`);i.set(a,r)}}return new Txe({typeName:Ea.ZodDiscriminatedUnion,discriminator:e,options:n,optionsMap:i,...EA(o)})}}function kxe(t,e){const n=pQ(t),o=pQ(e);if(t===e)return{valid:!0,data:t};if(n===Sr.object&&o===Sr.object){const i=wl.objectKeys(e),r=wl.objectKeys(t).filter(a=>i.indexOf(a)!==-1),s={...t,...e};for(const a of r){const A=kxe(t[a],e[a]);if(!A.valid)return{valid:!1};s[a]=A.data}return{valid:!0,data:s}}else if(n===Sr.array&&o===Sr.array){if(t.length!==e.length)return{valid:!1};const i=[];for(let r=0;r<t.length;r++){const s=t[r],a=e[r],A=kxe(s,a);if(!A.valid)return{valid:!1};i.push(A.data)}return{valid:!0,data:i}}else return n===Sr.date&&o===Sr.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}class wne extends Bc{_parse(e){const{status:n,ctx:o}=this._processInputParams(e),i=(r,s)=>{if(act(r)||act(s))return Zs;const a=kxe(r.value,s.value);return a.valid?((Act(r)||Act(s))&&n.dirty(),{status:n.value,value:a.data}):(rr(o,{code:lo.invalid_intersection_types}),Zs)};return o.common.async?Promise.all([this._def.left._parseAsync({data:o.data,path:o.path,parent:o}),this._def.right._parseAsync({data:o.data,path:o.path,parent:o})]).then(([r,s])=>i(r,s)):i(this._def.left._parseSync({data:o.data,path:o.path,parent:o}),this._def.right._parseSync({data:o.data,path:o.path,parent:o}))}}wne.create=(t,e,n)=>new wne({left:t,right:e,typeName:Ea.ZodIntersection,...EA(n)});class v8 extends Bc{_parse(e){const{status:n,ctx:o}=this._processInputParams(e);if(o.parsedType!==Sr.array)return rr(o,{code:lo.invalid_type,expected:Sr.array,received:o.parsedType}),Zs;if(o.data.length<this._def.items.length)return rr(o,{code:lo.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),Zs;!this._def.rest&&o.data.length>this._def.items.length&&(rr(o,{code:lo.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());const r=[...o.data].map((s,a)=>{const A=this._def.items[a]||this._def.rest;return A?A._parse(new w9(o,s,o.path,a)):null}).filter(s=>!!s);return o.common.async?Promise.all(r).then(s=>my.mergeArray(n,s)):my.mergeArray(n,r)}get items(){return this._def.items}rest(e){return new v8({...this._def,rest:e})}}v8.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new v8({items:t,typeName:Ea.ZodTuple,rest:null,...EA(e)})};class Pne extends Bc{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:n,ctx:o}=this._processInputParams(e);if(o.parsedType!==Sr.object)return rr(o,{code:lo.invalid_type,expected:Sr.object,received:o.parsedType}),Zs;const i=[],r=this._def.keyType,s=this._def.valueType;for(const a in o.data)i.push({key:r._parse(new w9(o,a,o.path,a)),value:s._parse(new w9(o,o.data[a],o.path,a)),alwaysSet:a in o.data});return o.common.async?my.mergeObjectAsync(n,i):my.mergeObjectSync(n,i)}get element(){return this._def.valueType}static create(e,n,o){return n instanceof Bc?new Pne({keyType:e,valueType:n,typeName:Ea.ZodRecord,...EA(o)}):new Pne({keyType:P9.create(),valueType:e,typeName:Ea.ZodRecord,...EA(n)})}}class hct extends Bc{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:n,ctx:o}=this._processInputParams(e);if(o.parsedType!==Sr.map)return rr(o,{code:lo.invalid_type,expected:Sr.map,received:o.parsedType}),Zs;const i=this._def.keyType,r=this._def.valueType,s=[...o.data.entries()].map(([a,A],c)=>({key:i._parse(new w9(o,a,o.path,[c,"key"])),value:r._parse(new w9(o,A,o.path,[c,"value"]))}));if(o.common.async){const a=new Map;return Promise.resolve().then(async()=>{for(const A of s){const c=await A.key,l=await A.value;if(c.status==="aborted"||l.status==="aborted")return Zs;(c.status==="dirty"||l.status==="dirty")&&n.dirty(),a.set(c.value,l.value)}return{status:n.value,value:a}})}else{const a=new Map;for(const A of s){const c=A.key,l=A.value;if(c.status==="aborted"||l.status==="aborted")return Zs;(c.status==="dirty"||l.status==="dirty")&&n.dirty(),a.set(c.value,l.value)}return{status:n.value,value:a}}}}hct.create=(t,e,n)=>new hct({valueType:e,keyType:t,typeName:Ea.ZodMap,...EA(n)});class PV extends Bc{_parse(e){const{status:n,ctx:o}=this._processInputParams(e);if(o.parsedType!==Sr.set)return rr(o,{code:lo.invalid_type,expected:Sr.set,received:o.parsedType}),Zs;const i=this._def;i.minSize!==null&&o.data.size<i.minSize.value&&(rr(o,{code:lo.too_small,minimum:i.minSize.value,type:"set",inclusive:!0,exact:!1,message:i.minSize.message}),n.dirty()),i.maxSize!==null&&o.data.size>i.maxSize.value&&(rr(o,{code:lo.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),n.dirty());const r=this._def.valueType;function s(A){const c=new Set;for(const l of A){if(l.status==="aborted")return Zs;l.status==="dirty"&&n.dirty(),c.add(l.value)}return{status:n.value,value:c}}const a=[...o.data.values()].map((A,c)=>r._parse(new w9(o,A,o.path,c)));return o.common.async?Promise.all(a).then(A=>s(A)):s(a)}min(e,n){return new PV({...this._def,minSize:{value:e,message:is.toString(n)}})}max(e,n){return new PV({...this._def,maxSize:{value:e,message:is.toString(n)}})}size(e,n){return this.min(e,n).max(e,n)}nonempty(e){return this.min(1,e)}}PV.create=(t,e)=>new PV({valueType:t,minSize:null,maxSize:null,typeName:Ea.ZodSet,...EA(e)});class MV extends Bc{constructor(){super(...arguments),this.validate=this.implement}_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==Sr.function)return rr(n,{code:lo.invalid_type,expected:Sr.function,received:n.parsedType}),Zs;function o(a,A){return Dxe({data:a,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,Mxe(),QV].filter(c=>!!c),issueData:{code:lo.invalid_arguments,argumentsError:A}})}function i(a,A){return Dxe({data:a,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,Mxe(),QV].filter(c=>!!c),issueData:{code:lo.invalid_return_type,returnTypeError:A}})}const r={errorMap:n.common.contextualErrorMap},s=n.data;if(this._def.returns instanceof DV){const a=this;return rx(async function(...A){const c=new m5([]),l=await a._def.args.parseAsync(A,r).catch(h=>{throw c.addIssue(o(A,h)),c}),g=await Reflect.apply(s,this,l);return await a._def.returns._def.type.parseAsync(g,r).catch(h=>{throw c.addIssue(i(g,h)),c})})}else{const a=this;return rx(function(...A){const c=a._def.args.safeParse(A,r);if(!c.success)throw new m5([o(A,c.error)]);const l=Reflect.apply(s,this,c.data),g=a._def.returns.safeParse(l,r);if(!g.success)throw new m5([i(l,g.error)]);return g.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new MV({...this._def,args:v8.create(e).rest(Wk.create())})}returns(e){return new MV({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,n,o){return new MV({args:e||v8.create([]).rest(Wk.create()),returns:n||Wk.create(),typeName:Ea.ZodFunction,...EA(o)})}}class Fxe extends Bc{get schema(){return this._def.getter()}_parse(e){const{ctx:n}=this._processInputParams(e);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}}Fxe.create=(t,e)=>new Fxe({getter:t,typeName:Ea.ZodLazy,...EA(e)});class Mne extends Bc{_parse(e){if(e.data!==this._def.value){const n=this._getOrReturnCtx(e);return rr(n,{received:n.data,code:lo.invalid_literal,expected:this._def.value}),Zs}return{status:"valid",value:e.data}}get value(){return this._def.value}}Mne.create=(t,e)=>new Mne({value:t,typeName:Ea.ZodLiteral,...EA(e)});function pct(t,e){return new KM({values:t,typeName:Ea.ZodEnum,...EA(e)})}class KM extends Bc{_parse(e){if(typeof e.data!="string"){const n=this._getOrReturnCtx(e),o=this._def.values;return rr(n,{expected:wl.joinValues(o),received:n.parsedType,code:lo.invalid_type}),Zs}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){const n=this._getOrReturnCtx(e),o=this._def.values;return rr(n,{received:n.data,code:lo.invalid_enum_value,options:o}),Zs}return rx(e.data)}get options(){return this._def.values}get enum(){const e={};for(const n of this._def.values)e[n]=n;return e}get Values(){const e={};for(const n of this._def.values)e[n]=n;return e}get Enum(){const e={};for(const n of this._def.values)e[n]=n;return e}extract(e,n=this._def){return KM.create(e,{...this._def,...n})}exclude(e,n=this._def){return KM.create(this.options.filter(o=>!e.includes(o)),{...this._def,...n})}}KM.create=pct;class Lxe extends Bc{_parse(e){const n=wl.getValidEnumValues(this._def.values),o=this._getOrReturnCtx(e);if(o.parsedType!==Sr.string&&o.parsedType!==Sr.number){const i=wl.objectValues(n);return rr(o,{expected:wl.joinValues(i),received:o.parsedType,code:lo.invalid_type}),Zs}if(this._cache||(this._cache=new Set(wl.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){const i=wl.objectValues(n);return rr(o,{received:o.data,code:lo.invalid_enum_value,options:i}),Zs}return rx(e.data)}get enum(){return this._def.values}}Lxe.create=(t,e)=>new Lxe({values:t,typeName:Ea.ZodNativeEnum,...EA(e)});class DV extends Bc{unwrap(){return this._def.type}_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==Sr.promise&&n.common.async===!1)return rr(n,{code:lo.invalid_type,expected:Sr.promise,received:n.parsedType}),Zs;const o=n.parsedType===Sr.promise?n.data:Promise.resolve(n.data);return rx(o.then(i=>this._def.type.parseAsync(i,{path:n.path,errorMap:n.common.contextualErrorMap})))}}DV.create=(t,e)=>new DV({type:t,typeName:Ea.ZodPromise,...EA(e)});class _Q extends Bc{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Ea.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:n,ctx:o}=this._processInputParams(e),i=this._def.effect||null,r={addIssue:s=>{rr(o,s),s.fatal?n.abort():n.dirty()},get path(){return o.path}};if(r.addIssue=r.addIssue.bind(r),i.type==="preprocess"){const s=i.transform(o.data,r);if(o.common.async)return Promise.resolve(s).then(async a=>{if(n.value==="aborted")return Zs;const A=await this._def.schema._parseAsync({data:a,path:o.path,parent:o});return A.status==="aborted"?Zs:A.status==="dirty"||n.value==="dirty"?vV(A.value):A});{if(n.value==="aborted")return Zs;const a=this._def.schema._parseSync({data:s,path:o.path,parent:o});return a.status==="aborted"?Zs:a.status==="dirty"||n.value==="dirty"?vV(a.value):a}}if(i.type==="refinement"){const s=a=>{const A=i.refinement(a,r);if(o.common.async)return Promise.resolve(A);if(A instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return a};if(o.common.async===!1){const a=this._def.schema._parseSync({data:o.data,path:o.path,parent:o});return a.status==="aborted"?Zs:(a.status==="dirty"&&n.dirty(),s(a.value),{status:n.value,value:a.value})}else return this._def.schema._parseAsync({data:o.data,path:o.path,parent:o}).then(a=>a.status==="aborted"?Zs:(a.status==="dirty"&&n.dirty(),s(a.value).then(()=>({status:n.value,value:a.value}))))}if(i.type==="transform")if(o.common.async===!1){const s=this._def.schema._parseSync({data:o.data,path:o.path,parent:o});if(!zk(s))return Zs;const a=i.transform(s.value,r);if(a instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:a}}else return this._def.schema._parseAsync({data:o.data,path:o.path,parent:o}).then(s=>zk(s)?Promise.resolve(i.transform(s.value,r)).then(a=>({status:n.value,value:a})):Zs);wl.assertNever(i)}}_Q.create=(t,e,n)=>new _Q({schema:t,typeName:Ea.ZodEffects,effect:e,...EA(n)}),_Q.createWithPreprocess=(t,e,n)=>new _Q({schema:e,effect:{type:"preprocess",transform:t},typeName:Ea.ZodEffects,...EA(n)});class w8 extends Bc{_parse(e){return this._getType(e)===Sr.undefined?rx(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}w8.create=(t,e)=>new w8({innerType:t,typeName:Ea.ZodOptional,...EA(e)});class VM extends Bc{_parse(e){return this._getType(e)===Sr.null?rx(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}VM.create=(t,e)=>new VM({innerType:t,typeName:Ea.ZodNullable,...EA(e)});class Dne extends Bc{_parse(e){const{ctx:n}=this._processInputParams(e);let o=n.data;return n.parsedType===Sr.undefined&&(o=this._def.defaultValue()),this._def.innerType._parse({data:o,path:n.path,parent:n})}removeDefault(){return this._def.innerType}}Dne.create=(t,e)=>new Dne({innerType:t,typeName:Ea.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...EA(e)});class Nne extends Bc{_parse(e){const{ctx:n}=this._processInputParams(e),o={...n,common:{...n.common,issues:[]}},i=this._def.innerType._parse({data:o.data,path:o.path,parent:{...o}});return bne(i)?i.then(r=>({status:"valid",value:r.status==="valid"?r.value:this._def.catchValue({get error(){return new m5(o.common.issues)},input:o.data})})):{status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new m5(o.common.issues)},input:o.data})}}removeCatch(){return this._def.innerType}}Nne.create=(t,e)=>new Nne({innerType:t,typeName:Ea.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...EA(e)});class mct extends Bc{_parse(e){if(this._getType(e)!==Sr.nan){const o=this._getOrReturnCtx(e);return rr(o,{code:lo.invalid_type,expected:Sr.nan,received:o.parsedType}),Zs}return{status:"valid",value:e.data}}}mct.create=t=>new mct({typeName:Ea.ZodNaN,...EA(t)});class _ct extends Bc{_parse(e){const{ctx:n}=this._processInputParams(e),o=n.data;return this._def.type._parse({data:o,path:n.path,parent:n})}unwrap(){return this._def.type}}class Hxe extends Bc{_parse(e){const{status:n,ctx:o}=this._processInputParams(e);if(o.common.async)return(async()=>{const r=await this._def.in._parseAsync({data:o.data,path:o.path,parent:o});return r.status==="aborted"?Zs:r.status==="dirty"?(n.dirty(),vV(r.value)):this._def.out._parseAsync({data:r.value,path:o.path,parent:o})})();{const i=this._def.in._parseSync({data:o.data,path:o.path,parent:o});return i.status==="aborted"?Zs:i.status==="dirty"?(n.dirty(),{status:"dirty",value:i.value}):this._def.out._parseSync({data:i.value,path:o.path,parent:o})}}static create(e,n){return new Hxe({in:e,out:n,typeName:Ea.ZodPipeline})}}class Rne extends Bc{_parse(e){const n=this._def.innerType._parse(e),o=i=>(zk(i)&&(i.value=Object.freeze(i.value)),i);return bne(n)?n.then(i=>o(i)):o(n)}unwrap(){return this._def.innerType}}Rne.create=(t,e)=>new Rne({innerType:t,typeName:Ea.ZodReadonly,...EA(e)});function fct(t,e){const n=typeof t=="function"?t(e):typeof t=="string"?{message:t}:t;return typeof n=="string"?{message:n}:n}function P0(t,e={},n){return t?wV.create().superRefine((o,i)=>{const r=t(o);if(r instanceof Promise)return r.then(s=>{if(!s){const a=fct(e,o),A=a.fatal??n??!0;i.addIssue({code:"custom",...a,fatal:A})}});if(!r){const s=fct(e,o),a=s.fatal??n??!0;i.addIssue({code:"custom",...s,fatal:a})}}):wV.create()}var Ea;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(Ea||(Ea={}));const Z=P9.create,_t=YM.create;UM.create;const je=Sne.create;Jk.create;const Ict=Qne.create,ud=wV.create,Oxe=Wk.create;mQ.create;const dn=M9.create,Pt=Km.create,xo=vne.create,_y=Txe.create;wne.create;const fQ=v8.create,bc=Pne.create,IQ=MV.create,qe=Mne.create,Kn=KM.create,CQ=DV.create;w8.create,VM.create;const Cct=_Q.createWithPreprocess,_5={string:(t=>P9.create({...t,coerce:!0})),number:(t=>YM.create({...t,coerce:!0})),boolean:(t=>Sne.create({...t,coerce:!0})),bigint:(t=>UM.create({...t,coerce:!0})),date:(t=>Jk.create({...t,coerce:!0}))},W6n=Zs;var P8=Z().or(_t()).transform(t=>X1(t,"Ω").value),zM=Z().or(_t()).transform(t=>X1(t,"F").value).transform(t=>Number.parseFloat(t.toPrecision(12))),Tne=Z().or(_t()).transform(t=>X1(t,"H").value),O_=Z().or(_t()).transform(t=>X1(t,"V").value),ce=Z().or(_t()).transform(t=>X1(t).value),fy=Z().or(_t()).transform(t=>X1(t,"Hz").value),lt=ce,R3=Z().or(_t()).transform(t=>X1(t,"A").value),qk=Z().or(_t()).transform(t=>X1(t).value),j6n=qk,Pl=qk,yct=Z().datetime(),oA=Z().or(_t()).transform(t=>typeof t=="number"?t:t.endsWith("deg")?Number.parseFloat(t.split("deg")[0]):t.endsWith("rad")?Number.parseFloat(t.split("rad")[0])*180/Math.PI:Number.parseFloat(t)),xct=_t().or(Z().endsWith("mAh")).transform(t=>{if(typeof t=="string"){const e=t.replace("mAh",""),n=Number.parseFloat(e);if(Number.isNaN(n))throw new Error("Invalid capacity");return n}return t}).describe("Battery capacity in mAh"),Ti=Pt({x:lt,y:lt}),q6n=Ti,D9=Pt({x:lt,y:lt,z:lt}),X6n=D9,kne=Pt({width:_t(),height:_t()}),$6n=t=>{const e="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";return Array.from({length:t},()=>e[Math.floor(Math.random()*e.length)]).join("")},so=t=>Z().optional().default(()=>`${t}_${$6n(10)}`),M8=Kn(["top_left","top_center","top_right","center_left","center","center_right","bottom_left","bottom_center","bottom_right"]),Z6n=Kn(["top_silkscreen","bottom_silkscreen","top_copper","bottom_copper","top_soldermask","bottom_soldermask","top_fabrication_note","bottom_fabrication_note","top_user_note","bottom_user_note","top_courtyard","bottom_courtyard","inner1_copper","inner2_copper","inner3_copper","inner4_copper","inner5_copper","inner6_copper","inner7_copper","inner8_copper","edge_cuts","drill"]),Fne=Pt({project_relative_path:Z(),url:Z(),mimetype:Z()}),Lne=Ti.extend({rotation:oA.optional()}),Gxe=Pt({size:Ti.optional(),thickness:lt.optional()}),Ect=Pt({font:Gxe.optional()}),NV=Pt({value:Z(),at:Lne.optional(),layer:Z().optional(),uuid:Z().optional(),hide:je().optional(),effects:Ect.optional()}),Bct=Pt({Reference:NV.optional(),Value:NV.optional(),Datasheet:NV.optional(),Description:NV.optional()}),bct=Pt({through_hole:je().optional(),smd:je().optional(),exclude_from_pos_files:je().optional(),exclude_from_bom:je().optional()}),Sct=Pt({name:Z(),type:Z(),shape:Z().optional(),at:Lne.optional(),size:Ti.optional(),drill:lt.optional(),layers:dn(Z()).optional(),removeUnusedLayers:je().optional(),uuid:Z().optional()}),Qct=Pt({path:Z(),offset:D9.optional(),scale:D9.optional(),rotate:D9.optional()}),vct=Pt({footprintName:Z().optional(),version:xo([_t(),Z()]).optional(),generator:Z().optional(),generatorVersion:xo([_t(),Z()]).optional(),layer:Z().optional(),properties:Bct.optional(),attributes:bct.optional(),pads:dn(Sct).optional(),embeddedFonts:je().optional(),model:Qct.optional()}),wct=Pt({hide:je().optional()}),Pct=Pt({offset:lt.optional(),hide:je().optional()}),Mct=Pt({font:Gxe.optional(),justify:xo([Z(),dn(Z())]).optional(),hide:je().optional()}),yQ=Pt({value:Z(),id:xo([_t(),Z()]).optional(),at:Lne.optional(),effects:Mct.optional()}),Dct=Pt({Reference:yQ.optional(),Value:yQ.optional(),Footprint:yQ.optional(),Datasheet:yQ.optional(),Description:yQ.optional(),ki_keywords:yQ.optional(),ki_fp_filters:yQ.optional()}),Nct=Pt({symbolName:Z().optional(),extends:Z().optional(),pinNumbers:wct.optional(),pinNames:Pct.optional(),excludeFromSim:je().optional(),inBom:je().optional(),onBoard:je().optional(),properties:Dct.optional(),embeddedFonts:je().optional()}),Ml=Pt({error_type:Z(),message:Z(),is_fatal:je().optional()}),JM=Kn(["jlcpcb","macrofab","pcbway","digikey","mouser","lcsc"]),Bg=Pt({type:qe("source_component"),ftype:Z().optional(),source_component_id:Z(),name:Z(),manufacturer_part_number:Z().optional(),supplier_part_numbers:bc(JM,dn(Z())).optional(),display_value:Z().optional(),display_name:Z().optional(),are_pins_interchangeable:je().optional(),internally_connected_source_port_ids:dn(dn(Z())).optional(),source_group_id:Z().optional(),subcircuit_id:Z().optional()}),Yxe=Bg.extend({ftype:qe("simple_capacitor"),capacitance:zM,max_voltage_rating:O_.optional(),display_capacitance:Z().optional(),max_decoupling_trace_length:lt.optional()}),Uxe=Bg.extend({ftype:qe("simple_resistor"),resistance:P8,display_resistance:Z().optional()}),Hne=Bg.extend({ftype:qe("simple_diode")}),Rct=Bg.extend({ftype:qe("simple_fiducial")}),Kxe=Hne.extend({ftype:qe("simple_led"),color:Z().optional(),wavelength:Z().optional()}),Tct=Bg.extend({ftype:qe("simple_ground")}),Vxe=Bg.extend({ftype:qe("simple_chip")}),zxe=Bg.extend({ftype:qe("simple_power_source"),voltage:O_}),kct=Bg.extend({ftype:qe("simple_current_source"),current:R3,frequency:fy.optional(),peak_to_peak_current:R3.optional(),wave_shape:Kn(["sine","square","triangle","sawtooth","dc"]).optional().default("dc"),phase:_t().optional(),duty_cycle:_t().min(0).max(1).optional()}),Fct=Bg.extend({ftype:qe("simple_fuse"),current_rating_amps:_t().describe("Nominal current in amps the fuse is rated for"),voltage_rating_volts:_t().describe("Voltage rating in volts, e.g. ±5V would be 5")}),Lct=Bg.extend({ftype:qe("simple_ammeter")}),Hct=Pt({must_be_connected:je().optional(),provides_power:je().optional(),requires_power:je().optional(),provides_ground:je().optional(),requires_ground:je().optional(),provides_voltage:xo([Z(),_t()]).optional(),requires_voltage:xo([Z(),_t()]).optional(),do_not_connect:je().optional(),include_in_board_pinout:je().optional(),can_use_internal_pullup:je().optional(),is_using_internal_pullup:je().optional(),needs_external_pullup:je().optional(),can_use_internal_pulldown:je().optional(),is_using_internal_pulldown:je().optional(),needs_external_pulldown:je().optional(),can_use_open_drain:je().optional(),is_using_open_drain:je().optional(),can_use_push_pull:je().optional(),is_using_push_pull:je().optional(),should_have_decoupling_capacitor:je().optional(),recommended_decoupling_capacitor_capacitance:xo([Z(),_t()]).optional(),is_configured_for_i2c_sda:je().optional(),is_configured_for_i2c_scl:je().optional(),is_configured_for_spi_mosi:je().optional(),is_configured_for_spi_miso:je().optional(),is_configured_for_spi_sck:je().optional(),is_configured_for_spi_cs:je().optional(),is_configured_for_uart_tx:je().optional(),is_configured_for_uart_rx:je().optional(),supports_i2c_sda:je().optional(),supports_i2c_scl:je().optional(),supports_spi_mosi:je().optional(),supports_spi_miso:je().optional(),supports_spi_sck:je().optional(),supports_spi_cs:je().optional(),supports_uart_tx:je().optional(),supports_uart_rx:je().optional()}),Jxe=Bg.extend({ftype:qe("simple_battery"),capacity:xct}),Wxe=Bg.extend({ftype:qe("simple_inductor"),inductance:Tne,display_inductance:Z().optional(),max_current_rating:_t().optional()}),jxe=Bg.extend({ftype:qe("simple_push_button")}),qxe=Bg.extend({ftype:qe("simple_potentiometer"),max_resistance:P8,display_max_resistance:Z().optional()}),Oct=Bg.extend({ftype:qe("simple_crystal"),frequency:_t().describe("Frequency in Hz"),load_capacitance:_t().optional().describe("Load capacitance in pF"),pin_variant:Kn(["two_pin","four_pin"]).optional()}),Xxe=Bg.extend({ftype:qe("simple_pin_header"),pin_count:_t(),gender:Kn(["male","female"]).optional().default("male")}),Gct=["usb_c","m2","jst_sh","jst_gh","jst_zh","jst_ph","jst_xh","jst_vh"],Yct=Bg.extend({ftype:qe("simple_connector"),standard:Kn(Gct).optional(),pin_count:_t().int().positive().optional()}),$xe=Bg.extend({ftype:qe("simple_pinout")}),Zxe=Bg.extend({ftype:qe("simple_resonator"),load_capacitance:zM,equivalent_series_resistance:P8.optional(),frequency:fy}),e3e=Bg.extend({ftype:qe("simple_transistor"),transistor_type:Kn(["npn","pnp"])}),t3e=Bg.extend({ftype:qe("simple_test_point"),footprint_variant:Kn(["pad","through_hole"]).optional(),pad_shape:Kn(["rect","circle"]).optional(),pad_diameter:xo([_t(),Z()]).optional(),hole_diameter:xo([_t(),Z()]).optional(),width:xo([_t(),Z()]).optional(),height:xo([_t(),Z()]).optional()}),n3e=Bg.extend({ftype:qe("simple_mosfet"),channel_type:Kn(["n","p"]),mosfet_mode:Kn(["enhancement","depletion"])}),o3e=Bg.extend({ftype:qe("simple_op_amp")}),i3e=Bg.extend({ftype:qe("simple_switch")}),r3e=Pt({type:qe("source_project_metadata"),name:Z().optional(),software_used_string:Z().optional(),project_url:Z().optional(),source_filesystem_md5_hash:Z().optional(),created_at:yct.optional()}),Uct=Ml.extend({type:qe("source_missing_property_error"),source_missing_property_error_id:so("source_missing_property_error"),source_component_id:Z(),property_name:Z(),subcircuit_id:Z().optional(),error_type:qe("source_missing_property_error").default("source_missing_property_error")}).describe("The source code is missing a property"),Kct=Ml.extend({type:qe("source_failed_to_create_component_error"),source_failed_to_create_component_error_id:so("source_failed_to_create_component_error"),error_type:qe("source_failed_to_create_component_error").default("source_failed_to_create_component_error"),component_name:Z().optional(),subcircuit_id:Z().optional(),parent_source_component_id:Z().optional(),pcb_center:Pt({x:_t().optional(),y:_t().optional()}).optional(),schematic_center:Pt({x:_t().optional(),y:_t().optional()}).optional()}).describe("Error emitted when a component fails to be constructed"),s3e=Ml.extend({type:qe("source_invalid_component_property_error"),source_invalid_component_property_error_id:so("source_invalid_component_property_error"),source_component_id:Z(),property_name:Z(),property_value:Oxe().optional(),expected_format:Z().optional(),subcircuit_id:Z().optional(),error_type:qe("source_invalid_component_property_error").default("source_invalid_component_property_error")}).describe("The source component property is invalid"),a3e=Ml.extend({type:qe("source_trace_not_connected_error"),source_trace_not_connected_error_id:so("source_trace_not_connected_error"),error_type:qe("source_trace_not_connected_error").default("source_trace_not_connected_error"),subcircuit_id:Z().optional(),source_group_id:Z().optional(),source_trace_id:Z().optional(),connected_source_port_ids:dn(Z()).optional(),selectors_not_found:dn(Z()).optional()}).describe("Occurs when a source trace selector does not match any ports"),Vct=Pt({type:qe("source_property_ignored_warning"),source_property_ignored_warning_id:so("source_property_ignored_warning"),source_component_id:Z(),property_name:Z(),subcircuit_id:Z().optional(),error_type:qe("source_property_ignored_warning").default("source_property_ignored_warning"),message:Z()}).describe("The source property was ignored"),A3e=Pt({type:qe("source_pin_missing_trace_warning"),source_pin_missing_trace_warning_id:so("source_pin_missing_trace_warning"),warning_type:qe("source_pin_missing_trace_warning").default("source_pin_missing_trace_warning"),message:Z(),source_component_id:Z(),source_port_id:Z(),subcircuit_id:Z().optional()}).describe("Warning emitted when a source component pin is missing a trace connection"),c3e=Pt({type:qe("source_missing_manufacturer_part_number_warning"),source_missing_manufacturer_part_number_warning_id:so("source_missing_manufacturer_part_number_warning"),warning_type:qe("source_missing_manufacturer_part_number_warning").default("source_missing_manufacturer_part_number_warning"),message:Z(),source_component_id:Z(),standard:Z(),subcircuit_id:Z().optional()}).describe("Warning emitted when a standard connector is missing manufacturer part number"),l3e=Pt({type:qe("source_refdes_convention_warning"),source_refdes_convention_warning_id:so("source_refdes_convention_warning"),warning_type:qe("source_refdes_convention_warning").default("source_refdes_convention_warning"),message:Z(),source_component_id:Z(),refdes:Z(),source_component_ftype:Z(),expected_prefixes:dn(Z()),actual_prefix:Z().optional(),subcircuit_id:Z().optional()}).describe("Warning emitted when a source component reference designator does not match the component type convention"),zct=Bg.extend({ftype:qe("simple_voltage_probe")}),Jct=Bg.extend({ftype:qe("interconnect")}),g3e=Ml.extend({type:qe("source_i2c_misconfigured_error"),source_i2c_misconfigured_error_id:so("source_i2c_misconfigured_error"),error_type:qe("source_i2c_misconfigured_error").default("source_i2c_misconfigured_error"),source_port_ids:dn(Z())}).describe("Error emitted when incompatible I2C pins (e.g. SDA and SCL) are connected to the same net"),RV=Ml.extend({type:qe("source_component_misconfigured_error"),source_component_misconfigured_error_id:so("source_component_misconfigured_error"),error_type:qe("source_component_misconfigured_error").default("source_component_misconfigured_error"),source_component_ids:dn(Z()),source_port_ids:dn(Z()).optional()}).describe("Error emitted when one or more source components have an invalid or conflicting configuration"),Wct=Bg.extend({ftype:qe("simple_voltage_source"),voltage:O_,frequency:fy.optional(),peak_to_peak_voltage:O_.optional(),wave_shape:Kn(["sinewave","square","triangle","sawtooth"]).optional(),phase:oA.optional(),duty_cycle:_t().optional().describe("Duty cycle as a fraction (0 to 1)"),pulse_delay:Pl.optional(),rise_time:Pl.optional(),fall_time:Pl.optional(),pulse_width:Pl.optional(),period:Pl.optional()}),jct=xo([Uxe,Yxe,Hne,Rct,Kxe,Tct,Vxe,zxe,kct,Lct,Jxe,Wxe,jxe,qxe,Oct,Xxe,Yct,$xe,Zxe,i3e,e3e,t3e,n3e,o3e,Fct,zct,Jct,Wct,r3e,Uct,s3e,Kct,a3e,Vct,A3e,c3e,l3e,g3e,RV]),qct=Pt({type:qe("source_port"),pin_number:_t().optional(),port_hints:dn(Z()).optional(),name:Z(),source_port_id:Z(),source_component_id:Z().optional(),source_group_id:Z().optional(),most_frequently_referenced_by_name:Z().optional(),subcircuit_id:Z().optional(),subcircuit_connectivity_map_key:Z().optional()}).merge(Hct),Xct=Pt({type:qe("source_component_internal_connection"),source_component_internal_connection_id:Z(),source_component_id:Z(),source_port_ids:dn(Z()),subcircuit_id:Z().optional()}),$ct=Pt({type:qe("source_trace"),source_trace_id:Z(),connected_source_port_ids:dn(Z()),connected_source_net_ids:dn(Z()),subcircuit_id:Z().optional(),subcircuit_connectivity_map_key:Z().optional(),max_length:_t().optional(),max_via_count:_t().int().nonnegative().optional(),name:Z().optional(),min_trace_thickness:_t().optional(),display_name:Z().optional()}),Zct=Pt({type:qe("source_group"),source_group_id:Z(),subcircuit_id:Z().optional(),parent_subcircuit_id:Z().optional(),parent_source_group_id:Z().optional(),is_subcircuit:je().optional(),show_as_schematic_box:je().optional(),name:Z().optional(),was_automatically_named:je().optional()}),elt=Pt({type:qe("source_net"),source_net_id:Z(),name:Z(),member_source_group_ids:dn(Z()),is_power:je().optional(),is_ground:je().optional(),is_digital_signal:je().optional(),is_analog_signal:je().optional(),is_positive_voltage_source:je().optional(),trace_width:_t().optional(),subcircuit_id:Z().optional(),subcircuit_connectivity_map_key:Z().optional()}),tlt=Pt({type:qe("source_board"),source_board_id:Z(),source_group_id:Z(),title:Z().optional()}).describe("Defines a board in the source domain"),nlt=Ml.extend({type:qe("source_ambiguous_port_reference"),source_ambiguous_port_reference_id:so("source_ambiguous_port_reference"),error_type:qe("source_ambiguous_port_reference").default("source_ambiguous_port_reference"),source_port_id:Z().optional(),source_component_id:Z().optional()}).describe("Error emitted when a port hint matches multiple non-overlapping pads, making the port reference ambiguous"),olt=Pt({type:qe("source_pcb_ground_plane"),source_pcb_ground_plane_id:Z(),source_group_id:Z(),source_net_id:Z(),subcircuit_id:Z().optional()}).describe("Defines a ground plane in the source domain"),Xk=["top","bottom","inner1","inner2","inner3","inner4","inner5","inner6","inner7","inner8"],u3e=Kn(Xk),Pr=u3e.or(Pt({name:u3e})).transform(t=>typeof t=="string"?t:t.name),Vm=Kn(["top","bottom"]),ilt=Pt({type:qe("source_manually_placed_via"),source_manually_placed_via_id:Z(),source_group_id:Z(),source_net_id:Z().min(1).optional(),subcircuit_id:Z().optional(),source_trace_id:Z().optional()}).describe("Defines a via that is manually placed in the source domain"),rlt=Pt({type:qe("source_unnamed_trace_warning"),source_unnamed_trace_warning_id:so("source_unnamed_trace_warning"),warning_type:qe("source_unnamed_trace_warning").default("source_unnamed_trace_warning"),message:Z(),source_trace_id:Z(),subcircuit_id:Z().optional()}).describe("Warning emitted when a source trace is missing a name"),slt=Pt({type:qe("source_no_power_pin_defined_warning"),source_no_power_pin_defined_warning_id:so("source_no_power_pin_defined_warning"),warning_type:qe("source_no_power_pin_defined_warning").default("source_no_power_pin_defined_warning"),message:Z(),source_component_id:Z(),source_port_ids:dn(Z()),subcircuit_id:Z().optional()}).describe("Warning emitted when a chip has no source ports with requires_power=true"),alt=Pt({type:qe("source_no_ground_pin_defined_warning"),source_no_ground_pin_defined_warning_id:so("source_no_ground_pin_defined_warning"),warning_type:qe("source_no_ground_pin_defined_warning").default("source_no_ground_pin_defined_warning"),message:Z(),source_component_id:Z(),source_port_ids:dn(Z()),subcircuit_id:Z().optional()}).describe("Warning emitted when a chip has no source ports marked as ground pins"),Alt=Pt({type:qe("source_component_pins_underspecified_warning"),source_component_pins_underspecified_warning_id:so("source_component_pins_underspecified_warning"),warning_type:qe("source_component_pins_underspecified_warning").default("source_component_pins_underspecified_warning"),message:Z(),source_component_id:Z(),source_port_ids:dn(Z()),subcircuit_id:Z().optional()}).describe("Warning emitted when all ports on a source component are underspecified"),clt=Ml.extend({type:qe("source_pin_must_be_connected_error"),source_pin_must_be_connected_error_id:so("source_pin_must_be_connected_error"),error_type:qe("source_pin_must_be_connected_error").default("source_pin_must_be_connected_error"),source_component_id:Z(),source_port_id:Z(),subcircuit_id:Z().optional()}).describe("Error emitted when a pin with mustBeConnected attribute is not connected to any trace"),llt=Ml.extend({type:qe("unknown_error_finding_part"),unknown_error_finding_part_id:so("unknown_error_finding_part"),error_type:qe("unknown_error_finding_part").default("unknown_error_finding_part"),source_component_id:Z().optional(),subcircuit_id:Z().optional()}).describe("Error emitted when an unexpected error occurs while finding a part"),TV=Pt({type:qe("source_part_not_found_warning"),source_part_not_found_warning_id:so("source_part_not_found_warning"),warning_type:qe("source_part_not_found_warning").default("source_part_not_found_warning"),message:Z(),source_component_id:Z().optional(),subcircuit_id:Z().optional(),supplier_name:JM.optional(),manufacturer_part_number:Z().optional(),supplier_part_number:Z().optional(),part_name:Z().optional()}).describe("Warning emitted when a requested part can not be found"),glt=Pt({type:qe("source_confusing_net_name_warning"),source_confusing_net_name_warning_id:so("source_confusing_net_name_warning"),warning_type:qe("source_confusing_net_name_warning").default("source_confusing_net_name_warning"),message:Z(),source_net_ids:dn(Z()).min(2),net_name:Z(),subcircuit_id:Z().optional()}).describe("Warning emitted when electrically disconnected source nets share a name"),ult=Pt({type:qe("schematic_box"),schematic_sheet_id:Z().optional(),schematic_component_id:Z().optional(),schematic_symbol_id:Z().optional(),width:lt,height:lt,is_dashed:je().default(!1),x:lt,y:lt,subcircuit_id:Z().optional()}).describe("Draws a box on the schematic"),dlt=Pt({type:qe("schematic_path"),schematic_path_id:so("schematic_path"),schematic_sheet_id:Z().optional(),schematic_component_id:Z().optional(),schematic_symbol_id:Z().optional(),fill_color:Z().optional(),is_filled:je().optional(),is_dashed:je().default(!1),stroke_width:lt.nullable().optional(),stroke_color:Z().optional(),dash_length:lt.optional(),dash_gap:lt.optional(),points:dn(Ti),subcircuit_id:Z().optional()}),hlt=bc(Pt({left_margin:ce.optional(),right_margin:ce.optional(),top_margin:ce.optional(),bottom_margin:ce.optional()})),plt=Pt({left_size:_t(),right_size:_t(),top_size:_t().optional(),bottom_size:_t().optional()}),mlt=Pt({left_side:Pt({pins:dn(_t()),direction:Kn(["top-to-bottom","bottom-to-top"]).optional()}).optional(),right_side:Pt({pins:dn(_t()),direction:Kn(["top-to-bottom","bottom-to-top"]).optional()}).optional(),top_side:Pt({pins:dn(_t()),direction:Kn(["left-to-right","right-to-left"]).optional()}).optional(),bottom_side:Pt({pins:dn(_t()),direction:Kn(["left-to-right","right-to-left"]).optional()}).optional()}),_lt=xo([plt,mlt]),flt=Pt({type:qe("schematic_component"),size:kne,center:Ti,source_component_id:Z().optional(),schematic_component_id:Z(),schematic_sheet_id:Z().optional(),schematic_symbol_id:Z().optional(),pin_spacing:ce.optional(),pin_styles:hlt.optional(),box_width:ce.optional(),symbol_name:Z().optional(),port_arrangement:_lt.optional(),port_labels:bc(Z()).optional(),symbol_display_value:Z().optional(),subcircuit_id:Z().optional(),schematic_group_id:Z().optional(),is_schematic_group:je().optional(),source_group_id:Z().optional(),is_box_with_pins:je().optional().default(!0)}),e8n=Pt({kicad_symbol:Nct.optional()}).catchall(Oxe()),Ilt=Pt({type:qe("schematic_symbol"),schematic_symbol_id:Z(),name:Z().optional(),metadata:e8n.optional()}).describe("Defines a named schematic symbol that can be referenced by components."),Clt=Pt({type:qe("schematic_line"),schematic_line_id:so("schematic_line"),schematic_sheet_id:Z().optional(),schematic_component_id:Z().optional(),schematic_symbol_id:Z().optional(),x1:lt,y1:lt,x2:lt,y2:lt,stroke_width:lt.nullable().optional(),color:Z().default("#000000"),is_dashed:je().default(!1),dash_length:lt.optional(),dash_gap:lt.optional(),subcircuit_id:Z().optional()}).describe("Draws a styled line on the schematic"),ylt=Pt({type:qe("schematic_rect"),schematic_rect_id:so("schematic_rect"),schematic_sheet_id:Z().optional(),schematic_component_id:Z().optional(),schematic_symbol_id:Z().optional(),center:Ti,width:lt,height:lt,rotation:oA.default(0),stroke_width:lt.nullable().optional(),color:Z().default("#000000"),is_filled:je().default(!1),fill_color:Z().optional(),is_dashed:je().default(!1),subcircuit_id:Z().optional()}).describe("Draws a styled rectangle on the schematic"),xlt=Pt({type:qe("schematic_circle"),schematic_circle_id:so("schematic_circle"),schematic_sheet_id:Z().optional(),schematic_component_id:Z().optional(),schematic_symbol_id:Z().optional(),center:Ti,radius:lt,stroke_width:lt.nullable().optional(),color:Z().default("#000000"),is_filled:je().default(!1),fill_color:Z().optional(),is_dashed:je().default(!1),subcircuit_id:Z().optional()}).describe("Draws a styled circle on the schematic"),Elt=Pt({type:qe("schematic_arc"),schematic_arc_id:so("schematic_arc"),schematic_sheet_id:Z().optional(),schematic_component_id:Z().optional(),schematic_symbol_id:Z().optional(),center:Ti,radius:lt,start_angle_degrees:oA,end_angle_degrees:oA,direction:Kn(["clockwise","counterclockwise"]).default("counterclockwise"),stroke_width:lt.nullable().optional(),color:Z().default("#000000"),is_dashed:je().default(!1),subcircuit_id:Z().optional()}).describe("Draws a styled arc on the schematic"),Blt=Pt({type:qe("schematic_trace"),schematic_trace_id:Z(),schematic_sheet_id:Z().optional(),source_trace_id:Z().optional(),junctions:dn(Pt({x:_t(),y:_t()})),edges:dn(Pt({from:Pt({x:_t(),y:_t()}),to:Pt({x:_t(),y:_t()}),is_crossing:je().optional(),from_schematic_port_id:Z().optional(),to_schematic_port_id:Z().optional()})),subcircuit_id:Z().optional(),subcircuit_connectivity_map_key:Z().optional()}),t8n=Kn(["center","left","right","top","bottom"]),d3e=Pt({text:Z(),is_overlined:je().optional()}),blt=Pt({type:qe("schematic_text"),schematic_sheet_id:Z().optional(),schematic_component_id:Z().optional(),schematic_symbol_id:Z().optional(),schematic_text_id:Z(),source_trace_id:Z().optional(),text:Z(),text_parts:dn(d3e).min(1).optional(),display_superscript:Z().optional(),font_size:_t().default(.18),position:Pt({x:lt,y:lt}),rotation:_t().default(0),anchor:xo([t8n.describe("legacy"),M8]).default("center"),color:Z().default("#000000"),subcircuit_id:Z().optional()}),Slt=Pt({type:qe("schematic_port"),schematic_port_id:Z(),source_port_id:Z(),schematic_sheet_id:Z().optional(),schematic_component_id:Z().optional(),center:Ti,facing_direction:Kn(["up","down","left","right"]).optional(),distance_from_component_edge:_t().optional(),side_of_component:Kn(["top","bottom","left","right"]).optional(),true_ccw_index:_t().optional(),pin_number:_t().optional(),display_pin_label:Z().optional(),display_pin_label_text_parts:dn(d3e).min(1).optional(),display_pin_label_font_size:_t().positive().finite().optional(),subcircuit_id:Z().optional(),is_connected:je().optional(),is_internal_circuit_port:je().optional(),is_overlapping_internal_circuit_port:je().optional(),has_input_arrow:je().optional(),has_output_arrow:je().optional(),is_drawn_with_inversion_circle:je().optional()}).describe("Defines a port on a schematic component"),Qlt=Pt({type:qe("schematic_net_label"),schematic_net_label_id:so("schematic_net_label"),schematic_sheet_id:Z().optional(),schematic_trace_id:Z().optional(),source_trace_id:Z().optional(),source_net_id:Z(),center:Ti,anchor_position:Ti.optional(),anchor_side:Kn(["top","bottom","left","right"]),text:Z(),display_superscript:Z().optional(),symbol_name:Z().optional(),is_movable:je().optional(),subcircuit_id:Z().optional()}),vlt=Ml.extend({type:qe("schematic_error"),schematic_error_id:Z(),error_type:qe("schematic_port_not_found").default("schematic_port_not_found"),subcircuit_id:Z().optional()}).describe("Defines a schematic error on the schematic"),wlt=Ml.extend({type:qe("schematic_layout_error"),schematic_layout_error_id:so("schematic_layout_error"),error_type:qe("schematic_layout_error").default("schematic_layout_error"),source_group_id:Z(),schematic_group_id:Z(),subcircuit_id:Z().optional()}).describe("Error emitted when schematic layout fails for a group"),One=Pt({type:qe("schematic_debug_object"),label:Z().optional(),subcircuit_id:Z().optional()}),Plt=One.extend({shape:qe("rect"),center:Ti,size:kne}),Mlt=One.extend({shape:qe("line"),start:Ti,end:Ti}),Dlt=One.extend({shape:qe("point"),center:Ti}),Nlt=_y("shape",[Plt,Mlt,Dlt]),Rlt=Pt({type:qe("schematic_voltage_probe"),schematic_voltage_probe_id:Z(),schematic_sheet_id:Z().optional(),source_component_id:Z().optional(),name:Z().optional(),position:Ti,schematic_trace_id:Z(),voltage:O_.optional(),subcircuit_id:Z().optional(),color:Z().optional(),label_alignment:M8.optional()}).describe("Defines a voltage probe measurement point on a schematic trace"),h3e=Pt({type:qe("schematic_manual_edit_conflict_warning"),schematic_manual_edit_conflict_warning_id:so("schematic_manual_edit_conflict_warning"),warning_type:qe("schematic_manual_edit_conflict_warning").default("schematic_manual_edit_conflict_warning"),message:Z(),schematic_component_id:Z(),schematic_group_id:Z().optional(),subcircuit_id:Z().optional(),source_component_id:Z()}).describe("Warning emitted when a component has both manual placement and explicit schX/schY coordinates"),Tlt=Pt({type:qe("schematic_component_overlap_warning"),schematic_component_overlap_warning_id:so("schematic_component_overlap_warning"),warning_type:qe("schematic_component_overlap_warning").default("schematic_component_overlap_warning"),message:Z(),schematic_component_ids:fQ([Z(),Z()]),schematic_sheet_id:Z().optional()}).describe("Warning emitted when the rendered bounds of two schematic components overlap"),klt=Pt({type:qe("schematic_component_styling_warning"),schematic_component_styling_warning_id:so("schematic_component_styling_warning"),warning_type:qe("schematic_component_styling_warning").default("schematic_component_styling_warning"),message:Z(),schematic_component_id:Z(),styling_issue_type:Z(),schematic_port_ids:dn(Z()).optional(),source_component_id:Z().optional(),schematic_sheet_id:Z().optional(),subcircuit_id:Z().optional()}).describe("Warning emitted when a schematic component has a visual styling issue"),Flt=Pt({type:qe("schematic_element_outside_sheet_warning"),schematic_element_outside_sheet_warning_id:so("schematic_element_outside_sheet_warning"),warning_type:qe("schematic_element_outside_sheet_warning").default("schematic_element_outside_sheet_warning"),message:Z(),schematic_sheet_id:Z(),schematic_element_type:Kn(["schematic_component","schematic_net_label","schematic_trace"]),schematic_element_id:Z()}).describe("Warning emitted when a schematic component, net label, or trace extends outside its schematic sheet"),Llt=lt.pipe(_t().positive().finite()),Hlt=Pt({type:qe("schematic_graphic"),schematic_graphic_id:so("schematic_graphic"),schematic_sheet_id:Z().optional(),asset:Fne.optional(),svg_content:Z().optional(),width:Llt.optional(),height:Llt.optional()}).describe("References a graphic asset or inline SVG content with optional centered layout bounds on a schematic sheet").superRefine(({asset:t,svg_content:e},n)=>{t===void 0&&e===void 0&&n.addIssue({code:lo.custom,message:"At least one of asset or svg_content is required"})}),Olt=Pt({type:qe("schematic_group"),schematic_group_id:so("schematic_group"),schematic_sheet_id:Z().optional(),source_group_id:Z(),is_subcircuit:je().optional(),subcircuit_id:Z().optional(),width:ce,height:ce,center:Ti,schematic_component_ids:dn(Z()),show_as_schematic_box:je().optional(),name:Z().optional(),description:Z().optional()}).describe("Defines a group of components on the schematic"),Glt=Pt({type:qe("schematic_table"),schematic_table_id:so("schematic_table"),schematic_sheet_id:Z().optional(),anchor_position:Ti,column_widths:dn(lt),row_heights:dn(lt),cell_padding:lt.optional(),border_width:lt.optional(),subcircuit_id:Z().optional(),schematic_component_id:Z().optional(),anchor:M8.optional()}).describe("Defines a table on the schematic"),Ylt=Pt({type:qe("schematic_table_cell"),schematic_table_cell_id:so("schematic_table_cell"),schematic_sheet_id:Z().optional(),schematic_table_id:Z(),start_row_index:_t(),end_row_index:_t(),start_column_index:_t(),end_column_index:_t(),text:Z().optional(),center:Ti,width:lt,height:lt,horizontal_align:Kn(["left","center","right"]).optional(),vertical_align:Kn(["top","middle","bottom"]).optional(),font_size:lt.optional(),subcircuit_id:Z().optional()}).describe("Defines a cell within a schematic_table"),p3e=Kn(["a4","ansi_b"]),Ult=Pt({type:qe("schematic_sheet"),schematic_sheet_id:so("schematic_sheet"),name:Z().optional(),sheet_index:_t().optional(),sheet_size:p3e.optional(),sheet_width:_t().positive().optional(),sheet_height:_t().positive().optional(),subcircuit_id:Z().optional(),outline_color:Z().optional()}).describe("Defines a schematic sheet or page that components can be placed on"),Klt=Pt({type:qe("schematic_missing_sheet_warning"),schematic_missing_sheet_warning_id:so("schematic_missing_sheet_warning"),warning_type:qe("schematic_missing_sheet_warning").default("schematic_missing_sheet_warning"),message:Z()}).describe("Circuit-wide warning emitted when a schematic has no schematic sheet. Display as a banner without attaching it to a component or drawing a target outline or leader line."),Vlt=Pt({x:lt,y:lt,bulge:_t().optional()}),m3e=Pt({vertices:dn(Vlt)}),_3e=Pt({outer_ring:m3e,inner_rings:dn(m3e).default([])}),f3e={from_left:"from_left",from_right:"from_right",from_top:"from_top",from_bottom:"from_bottom",from_above:"from_above",from_below:"from_below",from_x_neg:"from_left",from_x_pos:"from_right",from_y_pos:"from_top",from_y_neg:"from_bottom",from_z_pos:"from_above",from_z_neg:"from_below",from_front:"from_top",from_back:"from_bottom"},n8n={from_left:{x:-1,y:0,z:0},from_right:{x:1,y:0,z:0},from_top:{x:0,y:1,z:0},from_bottom:{x:0,y:-1,z:0},from_above:{x:0,y:0,z:1},from_below:{x:0,y:0,z:-1}},zlt=Kn(["from_left","from_right","from_top","from_bottom","from_above","from_below","from_x_neg","from_x_pos","from_y_pos","from_y_neg","from_z_pos","from_z_neg","from_front","from_back"]).transform(t=>f3e[t]).describe('The side exposing the receptacle where the cable or mating part is attached, following the 2D PCB diagram convention, not a 3D viewport frame. In project coordinate space, "from_top" is +Y, "from_bottom" -Y, "from_left" -X, "from_right" +X, "from_above" +Z and "from_below" -Z. A receptacle on the +Y edge is "from_top" even though the plug moves in -Y as it seats. Cartesian spellings such as "from_y_pos" are accepted and normalized to the named values, as are the deprecated "from_front" (now "from_top") and "from_back" (now "from_bottom").'),kV=Kn(["leftside_top","leftside_bottom","rightside_top","rightside_bottom","topside_left","topside_right","bottomside_left","bottomside_right"]),o8n=[["leftside_top","bottomside_left","rightside_bottom","topside_right"],["leftside_bottom","bottomside_right","rightside_top","topside_left"]],i8n=(t,e)=>{for(const n of o8n){const o=n.indexOf(t),i=n.indexOf(e);if(o!==-1&&i!==-1)return(i-o+n.length)%n.length*90}return null},Jlt=Pt({x:lt,y:lt,via:je().optional(),via_to_layer:Pr.optional()}),r8n=dn(Jlt),N9=Pt({x:lt,y:lt,via:je().optional(),to_layer:Pr.optional(),trace_width:lt.optional()}),Wlt=Pt({min_trace_width:ce.optional(),min_board_edge_clearance:ce.optional(),min_via_hole_edge_to_via_hole_edge_clearance:ce.optional(),min_plated_hole_drill_edge_to_drill_edge_clearance:ce.optional(),min_trace_to_pad_edge_clearance:ce.optional(),min_pad_edge_to_pad_edge_clearance:ce.optional(),min_same_net_trace_edge_to_trace_edge_clearance:ce.optional(),min_different_net_trace_edge_to_trace_edge_clearance:ce.optional(),min_via_edge_to_pad_edge_clearance:ce.optional(),min_via_hole_diameter:ce.optional(),min_via_pad_diameter:ce.optional()}),jlt=Pt({type:qe("pcb_component"),pcb_component_id:so("pcb_component"),source_component_id:Z(),center:Ti,layer:Pr,rotation:oA,display_offset_x:Z().optional().describe("How to display the x offset for this part, usually corresponding with how the user specified it"),display_offset_y:Z().optional().describe("How to display the y offset for this part, usually corresponding with how the user specified it"),width:ce,height:ce,do_not_place:je().optional(),is_allowed_to_be_off_board:je().optional(),subcircuit_id:Z().optional(),pcb_group_id:Z().optional(),position_mode:Kn(["packed","relative_to_group_anchor","relative_to_another_component","none"]).optional(),anchor_position:Ti.optional(),anchor_alignment:M8.optional(),positioned_relative_to_pcb_group_id:Z().optional(),positioned_relative_to_pcb_board_id:Z().optional(),cable_insertion_center:Ti.optional(),insertion_direction:zlt.optional(),pin1_location:kV.optional().describe("Location of pin 1 on the unrotated, top-view component footprint"),supplier_pin1_location_map:bc(JM,kV).optional().describe("Pin 1 location for each supplier's unrotated, top-view footprint"),metadata:Pt({kicad_footprint:vct.optional()}).optional(),obstructs_within_bounds:je().default(!0).describe("Does this component take up all the space within its bounds on a layer. This is generally true except for when separated pin headers are being represented by a single component (in which case, chips can be placed between the pin headers) or for tall modules where chips fit underneath")}).describe("Defines a component on the PCB"),Gne=Pt({type:qe("pcb_debug_object"),pcb_debug_object_id:so("pcb_debug_object"),label:Z().optional(),subcircuit_id:Z().optional()}),qlt=Gne.extend({shape:qe("rect"),center:Ti,size:kne}),Xlt=Gne.extend({shape:qe("line"),start:Ti,end:Ti}),$lt=Gne.extend({shape:qe("point"),center:Ti}),Zlt=_y("shape",[qlt,Xlt,$lt]),e0t=Pt({type:qe("pcb_hole"),pcb_hole_id:so("pcb_hole"),pcb_group_id:Z().optional(),subcircuit_id:Z().optional(),pcb_component_id:Z().optional(),hole_shape:qe("circle"),hole_diameter:_t(),x:lt,y:lt,is_covered_with_solder_mask:je().optional(),soldermask_margin:_t().optional()}),s8n=e0t.describe("Defines a circular hole on the PCB"),t0t=Pt({type:qe("pcb_hole"),pcb_hole_id:so("pcb_hole"),pcb_group_id:Z().optional(),subcircuit_id:Z().optional(),pcb_component_id:Z().optional(),hole_shape:qe("rect"),hole_width:_t(),hole_height:_t(),x:lt,y:lt,is_covered_with_solder_mask:je().optional(),soldermask_margin:_t().optional()}),a8n=t0t.describe("Defines a rectangular (square-capable) hole on the PCB. Use equal width/height for square."),n0t=Pt({type:qe("pcb_hole"),pcb_hole_id:so("pcb_hole"),pcb_group_id:Z().optional(),subcircuit_id:Z().optional(),pcb_component_id:Z().optional(),hole_shape:Kn(["circle","square"]),hole_diameter:_t(),x:lt,y:lt,is_covered_with_solder_mask:je().optional(),soldermask_margin:_t().optional()}),A8n=n0t.describe("Defines a circular or square hole on the PCB"),o0t=Pt({type:qe("pcb_hole"),pcb_hole_id:so("pcb_hole"),pcb_group_id:Z().optional(),subcircuit_id:Z().optional(),pcb_component_id:Z().optional(),hole_shape:qe("oval"),hole_width:_t(),hole_height:_t(),x:lt,y:lt,is_covered_with_solder_mask:je().optional(),soldermask_margin:_t().optional()}),c8n=o0t.describe("Defines an oval hole on the PCB"),i0t=Pt({type:qe("pcb_hole"),pcb_hole_id:so("pcb_hole"),pcb_group_id:Z().optional(),subcircuit_id:Z().optional(),pcb_component_id:Z().optional(),hole_shape:qe("pill"),hole_width:_t(),hole_height:_t(),x:lt,y:lt,is_covered_with_solder_mask:je().optional(),soldermask_margin:_t().optional()}),l8n=i0t.describe("Defines a pill-shaped hole on the PCB"),r0t=Pt({type:qe("pcb_hole"),pcb_hole_id:so("pcb_hole"),pcb_group_id:Z().optional(),subcircuit_id:Z().optional(),pcb_component_id:Z().optional(),hole_shape:qe("rotated_pill"),hole_width:_t(),hole_height:_t(),x:lt,y:lt,ccw_rotation:oA,is_covered_with_solder_mask:je().optional(),soldermask_margin:_t().optional()}),g8n=r0t.describe("Defines a rotated pill-shaped hole on the PCB"),s0t=n0t.or(o0t).or(i0t).or(r0t).or(e0t).or(t0t),u8n=Pt({type:qe("pcb_plated_hole"),shape:qe("circle"),pcb_group_id:Z().optional(),subcircuit_id:Z().optional(),outer_diameter:_t(),hole_diameter:_t(),is_covered_with_solder_mask:je().optional(),x:lt,y:lt,layers:dn(Pr),port_hints:dn(Z()).optional(),pcb_component_id:Z().optional(),pcb_port_id:Z().optional(),pcb_plated_hole_id:so("pcb_plated_hole"),soldermask_margin:_t().optional()}),d8n=Pt({type:qe("pcb_plated_hole"),shape:Kn(["oval","pill"]),pcb_group_id:Z().optional(),subcircuit_id:Z().optional(),outer_width:_t(),outer_height:_t(),hole_width:_t(),hole_height:_t(),is_covered_with_solder_mask:je().optional(),x:lt,y:lt,ccw_rotation:oA,layers:dn(Pr),port_hints:dn(Z()).optional(),pcb_component_id:Z().optional(),pcb_port_id:Z().optional(),pcb_plated_hole_id:so("pcb_plated_hole"),soldermask_margin:_t().optional()}),h8n=Pt({type:qe("pcb_plated_hole"),shape:qe("circular_hole_with_rect_pad"),pcb_group_id:Z().optional(),subcircuit_id:Z().optional(),hole_shape:qe("circle"),pad_shape:qe("rect"),hole_diameter:_t(),rect_pad_width:_t(),rect_pad_height:_t(),rect_border_radius:_t().optional(),hole_offset_x:lt.default(0),hole_offset_y:lt.default(0),is_covered_with_solder_mask:je().optional(),x:lt,y:lt,layers:dn(Pr),port_hints:dn(Z()).optional(),pcb_component_id:Z().optional(),pcb_port_id:Z().optional(),pcb_plated_hole_id:so("pcb_plated_hole"),soldermask_margin:_t().optional(),rect_ccw_rotation:oA.optional()}),p8n=Pt({type:qe("pcb_plated_hole"),shape:qe("pill_hole_with_rect_pad"),pcb_group_id:Z().optional(),subcircuit_id:Z().optional(),hole_shape:qe("pill"),pad_shape:qe("rect"),hole_width:_t(),hole_height:_t(),rect_pad_width:_t(),rect_pad_height:_t(),rect_border_radius:_t().optional(),hole_offset_x:lt.default(0),hole_offset_y:lt.default(0),is_covered_with_solder_mask:je().optional(),x:lt,y:lt,layers:dn(Pr),port_hints:dn(Z()).optional(),pcb_component_id:Z().optional(),pcb_port_id:Z().optional(),pcb_plated_hole_id:so("pcb_plated_hole"),soldermask_margin:_t().optional()}),m8n=Pt({type:qe("pcb_plated_hole"),shape:qe("rotated_pill_hole_with_rect_pad"),pcb_group_id:Z().optional(),subcircuit_id:Z().optional(),hole_shape:qe("rotated_pill"),pad_shape:qe("rect"),hole_width:_t(),hole_height:_t(),hole_ccw_rotation:oA,rect_pad_width:_t(),rect_pad_height:_t(),rect_border_radius:_t().optional(),rect_ccw_rotation:oA,hole_offset_x:lt.default(0),hole_offset_y:lt.default(0),is_covered_with_solder_mask:je().optional(),x:lt,y:lt,layers:dn(Pr),port_hints:dn(Z()).optional(),pcb_component_id:Z().optional(),pcb_port_id:Z().optional(),pcb_plated_hole_id:so("pcb_plated_hole"),soldermask_margin:_t().optional()}),_8n=Pt({type:qe("pcb_plated_hole"),shape:qe("hole_with_polygon_pad"),pcb_group_id:Z().optional(),subcircuit_id:Z().optional(),hole_shape:Kn(["circle","oval","pill","rotated_pill"]),hole_diameter:_t().optional(),hole_width:_t().optional(),hole_height:_t().optional(),pad_outline:dn(Pt({x:lt,y:lt})).min(3),hole_offset_x:lt.default(0),hole_offset_y:lt.default(0),is_covered_with_solder_mask:je().optional(),x:lt,y:lt,layers:dn(Pr),port_hints:dn(Z()).optional(),pcb_component_id:Z().optional(),pcb_port_id:Z().optional(),pcb_plated_hole_id:so("pcb_plated_hole"),soldermask_margin:_t().optional(),ccw_rotation:oA.optional()}),a0t=xo([u8n,d8n,h8n,p8n,m8n,_8n]),A0t=Pt({type:qe("pcb_port"),pcb_port_id:so("pcb_port"),pcb_group_id:Z().optional(),subcircuit_id:Z().optional(),source_port_id:Z(),pcb_component_id:Z().optional(),x:lt,y:lt,layers:dn(Pr),is_board_pinout:je().optional()}).describe("Defines a port on the PCB"),f8n=Pt({type:qe("pcb_smtpad"),shape:qe("circle"),pcb_smtpad_id:so("pcb_smtpad"),pcb_group_id:Z().optional(),subcircuit_id:Z().optional(),x:lt,y:lt,radius:_t(),layer:Pr,port_hints:dn(Z()).optional(),pcb_component_id:Z().optional(),pcb_port_id:Z().optional(),is_covered_with_solder_mask:je().optional(),soldermask_margin:_t().optional(),solderpaste_margin:_t().optional()}),I8n=Pt({type:qe("pcb_smtpad"),shape:qe("rect"),pcb_smtpad_id:so("pcb_smtpad"),pcb_group_id:Z().optional(),subcircuit_id:Z().optional(),x:lt,y:lt,width:_t(),height:_t(),rect_border_radius:_t().optional(),corner_radius:_t().optional(),layer:Pr,port_hints:dn(Z()).optional(),pcb_component_id:Z().optional(),pcb_port_id:Z().optional(),is_covered_with_solder_mask:je().optional(),soldermask_margin:_t().optional(),soldermask_margin_left:_t().optional(),soldermask_margin_top:_t().optional(),soldermask_margin_right:_t().optional(),soldermask_margin_bottom:_t().optional(),solderpaste_margin:_t().optional()}),C8n=Pt({type:qe("pcb_smtpad"),shape:qe("rotated_rect"),pcb_smtpad_id:so("pcb_smtpad"),pcb_group_id:Z().optional(),subcircuit_id:Z().optional(),x:lt,y:lt,width:_t(),height:_t(),rect_border_radius:_t().optional(),corner_radius:_t().optional(),ccw_rotation:oA,layer:Pr,port_hints:dn(Z()).optional(),pcb_component_id:Z().optional(),pcb_port_id:Z().optional(),is_covered_with_solder_mask:je().optional(),soldermask_margin:_t().optional(),soldermask_margin_left:_t().optional(),soldermask_margin_top:_t().optional(),soldermask_margin_right:_t().optional(),soldermask_margin_bottom:_t().optional(),solderpaste_margin:_t().optional()}),c0t=Pt({type:qe("pcb_smtpad"),shape:qe("pill"),pcb_smtpad_id:so("pcb_smtpad"),pcb_group_id:Z().optional(),subcircuit_id:Z().optional(),x:lt,y:lt,width:_t(),height:_t(),radius:_t(),layer:Pr,port_hints:dn(Z()).optional(),pcb_component_id:Z().optional(),pcb_port_id:Z().optional(),is_covered_with_solder_mask:je().optional(),soldermask_margin:_t().optional(),solderpaste_margin:_t().optional()}),y8n=Pt({type:qe("pcb_smtpad"),shape:qe("rotated_pill"),pcb_smtpad_id:so("pcb_smtpad"),pcb_group_id:Z().optional(),subcircuit_id:Z().optional(),x:lt,y:lt,width:_t(),height:_t(),radius:_t(),ccw_rotation:oA,layer:Pr,port_hints:dn(Z()).optional(),pcb_component_id:Z().optional(),pcb_port_id:Z().optional(),is_covered_with_solder_mask:je().optional(),soldermask_margin:_t().optional(),solderpaste_margin:_t().optional()}),x8n=Pt({type:qe("pcb_smtpad"),shape:qe("polygon"),pcb_smtpad_id:so("pcb_smtpad"),pcb_group_id:Z().optional(),subcircuit_id:Z().optional(),points:dn(Ti),layer:Pr,port_hints:dn(Z()).optional(),pcb_component_id:Z().optional(),pcb_port_id:Z().optional(),is_covered_with_solder_mask:je().optional(),soldermask_margin:_t().optional(),solderpaste_margin:_t().optional()}),l0t=_y("shape",[f8n,I8n,C8n,y8n,c0t,x8n]).describe("Defines an SMT pad on the PCB"),E8n=Pt({type:qe("pcb_solder_paste"),shape:qe("circle"),pcb_solder_paste_id:so("pcb_solder_paste"),pcb_group_id:Z().optional(),subcircuit_id:Z().optional(),x:lt,y:lt,radius:_t(),layer:Pr,pcb_component_id:Z().optional(),pcb_smtpad_id:Z().optional()}),B8n=Pt({type:qe("pcb_solder_paste"),shape:qe("rect"),pcb_solder_paste_id:so("pcb_solder_paste"),pcb_group_id:Z().optional(),subcircuit_id:Z().optional(),x:lt,y:lt,width:_t(),height:_t(),layer:Pr,pcb_component_id:Z().optional(),pcb_smtpad_id:Z().optional()}),b8n=Pt({type:qe("pcb_solder_paste"),shape:qe("pill"),pcb_solder_paste_id:so("pcb_solder_paste"),pcb_group_id:Z().optional(),subcircuit_id:Z().optional(),x:lt,y:lt,width:_t(),height:_t(),radius:_t(),layer:Pr,pcb_component_id:Z().optional(),pcb_smtpad_id:Z().optional()}),S8n=Pt({type:qe("pcb_solder_paste"),shape:qe("rotated_rect"),pcb_solder_paste_id:so("pcb_solder_paste"),pcb_group_id:Z().optional(),subcircuit_id:Z().optional(),x:lt,y:lt,width:_t(),height:_t(),ccw_rotation:lt,layer:Pr,pcb_component_id:Z().optional(),pcb_smtpad_id:Z().optional()}),Q8n=Pt({type:qe("pcb_solder_paste"),shape:qe("rotated_pill"),pcb_solder_paste_id:so("pcb_solder_paste"),pcb_group_id:Z().optional(),subcircuit_id:Z().optional(),x:lt,y:lt,width:_t(),height:_t(),radius:_t(),ccw_rotation:oA,layer:Pr,pcb_component_id:Z().optional(),pcb_smtpad_id:Z().optional()}),v8n=Pt({type:qe("pcb_solder_paste"),shape:qe("oval"),pcb_solder_paste_id:so("pcb_solder_paste"),pcb_group_id:Z().optional(),subcircuit_id:Z().optional(),x:lt,y:lt,width:_t(),height:_t(),layer:Pr,pcb_component_id:Z().optional(),pcb_smtpad_id:Z().optional()}),g0t=xo([E8n,B8n,b8n,S8n,Q8n,v8n]).describe("Defines solderpaste on the PCB"),u0t=Pt({type:qe("pcb_text"),pcb_text_id:so("pcb_text"),pcb_group_id:Z().optional(),subcircuit_id:Z().optional(),text:Z(),center:Ti,layer:Pr,width:ce,height:ce,lines:_t(),align:Kn(["bottom-left"])}).describe("Defines text on the PCB"),d0t=Pt({route_type:qe("wire"),x:lt,y:lt,width:lt,copper_pour_id:Z().optional(),is_inside_copper_pour:je().optional(),start_pcb_port_id:Z().optional(),end_pcb_port_id:Z().optional(),layer:Pr}),h0t=Pt({route_type:qe("via"),x:lt,y:lt,copper_pour_id:Z().optional(),is_inside_copper_pour:je().optional(),hole_diameter:lt.optional(),outer_diameter:lt.optional(),from_layer:Pr,to_layer:Pr}),p0t=Pt({route_type:qe("through_pad"),start:Ti,end:Ti,width:lt,start_layer:Pr,end_layer:Pr,pcb_smtpad_id:Z().optional(),pcb_plated_hole_id:Z().optional()}),I3e=xo([d0t,h0t,p0t]),m0t=Pt({type:qe("pcb_trace"),source_trace_id:Z().optional(),pcb_component_id:Z().optional(),pcb_trace_id:so("pcb_trace"),pcb_group_id:Z().optional(),subcircuit_id:Z().optional(),route_thickness_mode:Kn(["constant","interpolated"]).default("constant").optional(),route_order_index:_t().optional(),should_round_corners:je().optional(),trace_length:_t().optional(),highlight_color:Z().optional(),route:dn(I3e)}).describe("Defines a trace on the PCB"),_0t=Pt({type:qe("pcb_trace_warning"),pcb_trace_warning_id:so("pcb_trace_warning"),warning_type:qe("pcb_trace_warning").default("pcb_trace_warning"),message:Z(),center:Ti.optional(),pcb_trace_id:Z(),source_trace_id:Z(),pcb_component_ids:dn(Z()),pcb_port_ids:dn(Z()),subcircuit_id:Z().optional()}).describe("Defines a trace warning on the PCB"),f0t=Pt({type:qe("pcb_trace_too_long_warning"),pcb_trace_too_long_warning_id:so("pcb_trace_too_long_warning"),warning_type:qe("pcb_trace_too_long_warning").default("pcb_trace_too_long_warning"),message:Z(),pcb_trace_id:Z(),source_net_id:Z().optional(),source_trace_id:Z().optional(),actual_trace_length:lt,maximum_trace_length:lt,subcircuit_id:Z().optional()}).describe("Warning emitted when a PCB trace is longer than its maximum allowed length"),I0t=Pt({type:qe("pcb_trace_too_many_vias_warning"),pcb_trace_too_many_vias_warning_id:so("pcb_trace_too_many_vias_warning"),warning_type:qe("pcb_trace_too_many_vias_warning").default("pcb_trace_too_many_vias_warning"),message:Z(),pcb_trace_id:Z(),source_net_id:Z().optional(),source_trace_id:Z().optional(),actual_via_count:_t().int().nonnegative(),maximum_via_count:_t().int().nonnegative(),subcircuit_id:Z().optional()}).describe("Warning emitted when a PCB trace has more vias than its maximum allowed count"),C0t=Ml.extend({type:qe("pcb_trace_error"),pcb_trace_error_id:so("pcb_trace_error"),error_type:qe("pcb_trace_error").default("pcb_trace_error"),center:Ti.optional(),pcb_trace_id:Z(),source_trace_id:Z(),pcb_component_ids:dn(Z()),pcb_port_ids:dn(Z()),subcircuit_id:Z().optional()}).describe("Defines a trace error on the PCB"),y0t=Ml.extend({type:qe("pcb_trace_missing_error"),pcb_trace_missing_error_id:so("pcb_trace_missing_error"),error_type:qe("pcb_trace_missing_error").default("pcb_trace_missing_error"),center:Ti.optional(),source_trace_id:Z(),pcb_component_ids:dn(Z()),pcb_port_ids:dn(Z()),subcircuit_id:Z().optional()}).describe("Defines an error when a source trace has no corresponding PCB trace"),x0t=Ml.extend({type:qe("pcb_port_not_matched_error"),pcb_error_id:so("pcb_error"),error_type:qe("pcb_port_not_matched_error").default("pcb_port_not_matched_error"),pcb_component_ids:dn(Z()),subcircuit_id:Z().optional()}).describe("Defines a trace error on the PCB where a port is not matched"),E0t=Ml.extend({type:qe("pcb_port_not_connected_error"),pcb_port_not_connected_error_id:so("pcb_port_not_connected_error"),error_type:qe("pcb_port_not_connected_error").default("pcb_port_not_connected_error"),pcb_port_ids:dn(Z()),pcb_component_ids:dn(Z()),subcircuit_id:Z().optional()}).describe("Defines an error when a pcb port is not connected to any trace"),B0t=Pt({type:qe("pcb_net"),pcb_net_id:so("pcb_net"),source_net_id:Z().optional(),highlight_color:Z().optional()}).describe("Defines a net on the PCB"),Yne=Pt({type:qe("pcb_via"),pcb_via_id:so("pcb_via"),pcb_group_id:Z().optional(),subcircuit_id:Z().optional(),subcircuit_connectivity_map_key:Z().optional(),x:lt,y:lt,outer_diameter:lt.default("0.6mm"),hole_diameter:lt.default("0.25mm"),from_layer:Pr.optional(),to_layer:Pr.optional(),layers:dn(Pr),pcb_trace_id:Z().optional(),source_trace_id:Z().optional(),source_net_id:Z().min(1).optional(),net_is_assignable:je().optional(),net_assigned:je().optional(),is_tented:je().optional(),tented_on_top:je().optional(),tented_on_bottom:je().optional()}).transform(({is_tented:t,...e})=>(t!==void 0&&(e.tented_on_top??=t,e.tented_on_bottom??=t),e)).describe("Defines a via on the PCB"),b0t=Pt({type:qe("pcb_board"),pcb_board_id:so("pcb_board"),pcb_panel_id:Z().optional(),carrier_pcb_board_id:Z().optional(),is_subcircuit:je().optional(),subcircuit_id:Z().optional(),is_mounted_to_carrier_board:je().optional(),is_via_in_pad_allowed:je().optional(),width:ce.optional(),height:ce.optional(),center:Ti,display_offset_x:Z().optional().describe("How to display the x offset for this board, usually corresponding with how the user specified it"),display_offset_y:Z().optional().describe("How to display the y offset for this board, usually corresponding with how the user specified it"),thickness:ce.optional().default(1.4),num_layers:_t().optional().default(4),allow_blind_and_buried_vias:je().optional().describe("Whether autorouters may generate blind and buried vias. False restricts newly generated vias to the full board stack."),outline:dn(Ti).optional(),shape:Kn(["rect","polygon"]).optional(),material:Kn(["fr4","fr1"]).default("fr4"),solder_mask_color:Z().optional(),silkscreen_color:Z().optional(),anchor_position:Ti.optional(),anchor_alignment:M8.optional(),position_mode:Kn(["relative_to_panel_anchor","none"]).optional()}).merge(Wlt).describe("Defines the board outline of the PCB"),S0t=Pt({type:qe("pcb_panel"),pcb_panel_id:so("pcb_panel"),width:ce,height:ce,center:Ti,thickness:ce.optional().default(1.4),covered_with_solder_mask:je().optional().default(!0)}).describe("Defines a PCB panel that can contain multiple boards"),Q0t=Ml.extend({type:qe("pcb_placement_error"),pcb_placement_error_id:so("pcb_placement_error"),error_type:qe("pcb_placement_error").default("pcb_placement_error"),subcircuit_id:Z().optional()}).describe("Defines a placement error on the PCB"),v0t=Ml.extend({type:qe("pcb_packing_error"),pcb_packing_error_id:so("pcb_packing_error"),error_type:qe("pcb_packing_error").default("pcb_packing_error"),pcb_group_id:Z().optional(),subcircuit_id:Z().optional()}).describe("Defines a failure to pack PCB components within layout bounds"),w0t=Ml.extend({type:qe("pcb_panelization_placement_error"),pcb_panelization_placement_error_id:so("pcb_panelization_placement_error"),error_type:qe("pcb_panelization_placement_error").default("pcb_panelization_placement_error"),pcb_panel_id:Z().optional(),pcb_board_id:Z().optional(),subcircuit_id:Z().optional()}).describe("Defines a panelization placement error on the PCB"),P0t=Pt({type:qe("pcb_trace_hint"),pcb_trace_hint_id:so("pcb_trace_hint"),pcb_port_id:Z(),pcb_component_id:Z(),route:dn(N9),subcircuit_id:Z().optional()}).describe("A hint that can be used during generation of a PCB trace"),M0t=Pt({type:qe("pcb_silkscreen_line"),pcb_silkscreen_line_id:so("pcb_silkscreen_line"),pcb_component_id:Z(),pcb_group_id:Z().optional(),subcircuit_id:Z().optional(),stroke_width:lt.default("0.1mm"),x1:lt,y1:lt,x2:lt,y2:lt,layer:Vm}).describe("Defines a silkscreen line on the PCB"),D0t=Pt({type:qe("pcb_silkscreen_path"),pcb_silkscreen_path_id:so("pcb_silkscreen_path"),pcb_component_id:Z(),pcb_group_id:Z().optional(),subcircuit_id:Z().optional(),layer:Vm,route:dn(Ti),stroke_width:ce}).describe("Defines a silkscreen path on the PCB"),N0t=Pt({type:qe("pcb_silkscreen_text"),pcb_silkscreen_text_id:so("pcb_silkscreen_text"),pcb_group_id:Z().optional(),subcircuit_id:Z().optional(),font:qe("tscircuit2024").default("tscircuit2024"),font_size:lt.default("0.2mm"),pcb_component_id:Z(),text:Z(),is_knockout:je().default(!1).optional(),knockout_padding:Pt({left:ce,top:ce,bottom:ce,right:ce}).default({left:"0.2mm",top:"0.2mm",bottom:"0.2mm",right:"0.2mm"}).optional(),ccw_rotation:_t().optional(),layer:Pr,is_mirrored:je().default(!1).optional(),anchor_position:Ti.default({x:0,y:0}),anchor_alignment:M8.default("center")}).describe("Defines silkscreen text on the PCB"),R0t=Pt({type:qe("pcb_copper_text"),pcb_copper_text_id:so("pcb_copper_text"),pcb_group_id:Z().optional(),subcircuit_id:Z().optional(),font:qe("tscircuit2024").default("tscircuit2024"),font_size:lt.default("0.2mm"),pcb_component_id:Z(),text:Z(),is_knockout:je().default(!1).optional(),knockout_padding:Pt({left:ce,top:ce,bottom:ce,right:ce}).default({left:"0.2mm",top:"0.2mm",bottom:"0.2mm",right:"0.2mm"}).optional(),ccw_rotation:_t().optional(),layer:Pr,is_mirrored:je().default(!1).optional(),anchor_position:Ti.default({x:0,y:0}),anchor_alignment:M8.default("center")}).describe("Defines copper text on the PCB"),T0t=Pt({type:qe("pcb_silkscreen_rect"),pcb_silkscreen_rect_id:so("pcb_silkscreen_rect"),pcb_component_id:Z(),pcb_group_id:Z().optional(),subcircuit_id:Z().optional(),center:Ti,width:ce,height:ce,layer:Pr,stroke_width:ce.default("1mm"),corner_radius:ce.optional(),is_filled:je().default(!0).optional(),has_stroke:je().optional(),is_stroke_dashed:je().optional(),ccw_rotation:_t().optional()}).describe("Defines a silkscreen rect on the PCB"),k0t=Pt({type:qe("pcb_silkscreen_circle"),pcb_silkscreen_circle_id:so("pcb_silkscreen_circle"),pcb_component_id:Z(),pcb_group_id:Z().optional(),subcircuit_id:Z().optional(),center:Ti,radius:ce,layer:Vm,stroke_width:ce.default("1mm"),is_filled:je().optional()}).describe("Defines a silkscreen circle on the PCB"),F0t=Pt({type:qe("pcb_silkscreen_oval"),pcb_silkscreen_oval_id:so("pcb_silkscreen_oval"),pcb_component_id:Z(),pcb_group_id:Z().optional(),subcircuit_id:Z().optional(),center:Ti,radius_x:lt,radius_y:lt,layer:Vm,ccw_rotation:oA.optional()}).describe("Defines a silkscreen oval on the PCB"),w8n=Pt({type:qe("pcb_silkscreen_graphic"),pcb_silkscreen_graphic_id:so("pcb_silkscreen_graphic"),pcb_component_id:Z(),pcb_group_id:Z().optional(),subcircuit_id:Z().optional(),layer:Vm,image_asset:Fne.optional()}),L0t=w8n.extend({shape:qe("brep"),brep_shape:_3e}).describe("Defines a BRep silkscreen graphic on the PCB"),H0t=_y("shape",[L0t]).describe("Defines a silkscreen graphic on the PCB"),O0t=Pt({type:qe("pcb_silkscreen_pill"),pcb_silkscreen_pill_id:so("pcb_silkscreen_pill"),pcb_component_id:Z(),pcb_group_id:Z().optional(),subcircuit_id:Z().optional(),center:Ti,width:ce,height:ce,layer:Pr,ccw_rotation:_t().optional()}).describe("Defines a silkscreen pill on the PCB"),C3e=Pt({type:qe("pcb_fabrication_note_text"),pcb_fabrication_note_text_id:so("pcb_fabrication_note_text"),subcircuit_id:Z().optional(),pcb_group_id:Z().optional(),font:qe("tscircuit2024").default("tscircuit2024"),font_size:lt.default("1mm"),pcb_component_id:Z(),text:Z(),ccw_rotation:_t().optional(),layer:Vm,anchor_position:Ti.default({x:0,y:0}),anchor_alignment:Kn(["center","top_left","top_right","bottom_left","bottom_right"]).default("center"),color:Z().optional()}).describe("Defines a fabrication note in text on the PCB, useful for leaving notes for assemblers or fabricators"),y3e=Pt({type:qe("pcb_fabrication_note_path"),pcb_fabrication_note_path_id:so("pcb_fabrication_note_path"),pcb_component_id:Z(),subcircuit_id:Z().optional(),layer:Pr,route:dn(Ti),stroke_width:ce,color:Z().optional()}).describe("Defines a fabrication path on the PCB for fabricators or assemblers"),x3e=Pt({type:qe("pcb_fabrication_note_rect"),pcb_fabrication_note_rect_id:so("pcb_fabrication_note_rect"),pcb_component_id:Z(),pcb_group_id:Z().optional(),subcircuit_id:Z().optional(),center:Ti,width:ce,height:ce,layer:Vm,stroke_width:ce.default("0.1mm"),corner_radius:ce.optional(),is_filled:je().optional(),has_stroke:je().optional(),is_stroke_dashed:je().optional(),color:Z().optional()}).describe("Defines a fabrication note rectangle on the PCB"),E3e=Pt({type:qe("pcb_fabrication_note_dimension"),pcb_fabrication_note_dimension_id:so("pcb_fabrication_note_dimension"),pcb_component_id:Z(),pcb_group_id:Z().optional(),subcircuit_id:Z().optional(),layer:Vm,from:Ti,to:Ti,text:Z().optional(),text_ccw_rotation:_t().optional(),offset:ce.optional(),offset_distance:ce.optional(),offset_direction:Pt({x:_t(),y:_t()}).optional(),font:qe("tscircuit2024").default("tscircuit2024"),font_size:ce.default("1mm"),color:Z().optional(),arrow_size:ce.default("1mm")}).describe("Defines a measurement annotation within PCB fabrication notes"),B3e=Pt({type:qe("pcb_note_text"),pcb_note_text_id:so("pcb_note_text"),pcb_component_id:Z().optional(),pcb_group_id:Z().optional(),subcircuit_id:Z().optional(),name:Z().optional(),font:qe("tscircuit2024").default("tscircuit2024"),font_size:lt.default("1mm"),text:Z().optional(),anchor_position:Ti.default({x:0,y:0}),anchor_alignment:Kn(["center","top_left","top_right","bottom_left","bottom_right"]).default("center"),layer:Vm.default("top"),is_mirrored_from_top_view:je().optional(),color:Z().optional()}).describe("Defines a documentation note in text on the PCB"),b3e=Pt({type:qe("pcb_note_rect"),pcb_note_rect_id:so("pcb_note_rect"),pcb_component_id:Z().optional(),pcb_group_id:Z().optional(),subcircuit_id:Z().optional(),name:Z().optional(),text:Z().optional(),center:Ti,width:ce,height:ce,layer:Vm.default("top"),stroke_width:ce.default("0.1mm"),corner_radius:ce.optional(),is_filled:je().optional(),has_stroke:je().optional(),is_stroke_dashed:je().optional(),color:Z().optional()}).describe("Defines a rectangular documentation note on the PCB"),S3e=Pt({type:qe("pcb_note_path"),pcb_note_path_id:so("pcb_note_path"),pcb_component_id:Z().optional(),pcb_group_id:Z().optional(),subcircuit_id:Z().optional(),name:Z().optional(),text:Z().optional(),route:dn(Ti),layer:Vm.default("top"),stroke_width:ce.default("0.1mm"),color:Z().optional()}).describe("Defines a polyline documentation note on the PCB"),Q3e=Pt({type:qe("pcb_note_line"),pcb_note_line_id:so("pcb_note_line"),pcb_component_id:Z().optional(),pcb_group_id:Z().optional(),subcircuit_id:Z().optional(),name:Z().optional(),text:Z().optional(),x1:lt,y1:lt,x2:lt,y2:lt,layer:Vm.default("top"),stroke_width:lt.default("0.1mm"),color:Z().optional(),is_dashed:je().optional()}).describe("Defines a straight documentation note line on the PCB"),v3e=Pt({type:qe("pcb_note_dimension"),pcb_note_dimension_id:so("pcb_note_dimension"),pcb_component_id:Z().optional(),pcb_group_id:Z().optional(),subcircuit_id:Z().optional(),name:Z().optional(),from:Ti,to:Ti,text:Z().optional(),text_ccw_rotation:_t().optional(),offset_distance:ce.optional(),offset_direction:Pt({x:_t(),y:_t()}).optional(),font:qe("tscircuit2024").default("tscircuit2024"),font_size:ce.default("1mm"),layer:Vm.default("top"),color:Z().optional(),arrow_size:ce.default("1mm")}).describe("Defines a measurement annotation within PCB documentation notes"),G0t=Ml.extend({type:qe("pcb_footprint_overlap_error"),pcb_error_id:so("pcb_error"),error_type:qe("pcb_footprint_overlap_error").default("pcb_footprint_overlap_error"),pcb_smtpad_ids:dn(Z()).optional(),pcb_plated_hole_ids:dn(Z()).optional(),pcb_hole_ids:dn(Z()).optional(),pcb_keepout_ids:dn(Z()).optional()}).describe("Error emitted when a pcb footprint overlaps with another element"),Y0t=Ml.extend({type:qe("pcb_courtyard_overlap_error"),pcb_error_id:so("pcb_error"),error_type:qe("pcb_courtyard_overlap_error").default("pcb_courtyard_overlap_error"),pcb_component_ids:fQ([Z(),Z()])}).describe("Error emitted when the courtyard (CrtYd) of one PCB component overlaps with the courtyard of another"),U0t=Pt({type:qe("pcb_keepout"),shape:qe("outline"),pcb_group_id:Z().optional(),subcircuit_id:Z().optional(),outline:dn(Ti).min(2),stroke_width:ce,pcb_keepout_id:Z(),layers:dn(Z()),description:Z().optional(),excluded_pcb_component_ids:dn(Z()).optional()}),w3e=Pt({type:qe("pcb_keepout"),shape:qe("rect"),pcb_group_id:Z().optional(),subcircuit_id:Z().optional(),center:Ti,width:lt,height:lt,pcb_keepout_id:Z(),layers:dn(Z()),description:Z().optional(),excluded_pcb_component_ids:dn(Z()).optional()}).or(Pt({type:qe("pcb_keepout"),shape:qe("circle"),pcb_group_id:Z().optional(),subcircuit_id:Z().optional(),center:Ti,radius:lt,pcb_keepout_id:Z(),layers:dn(Z()),description:Z().optional(),excluded_pcb_component_ids:dn(Z()).optional()})).or(U0t),Une=Pt({type:qe("pcb_cutout"),pcb_cutout_id:so("pcb_cutout"),pcb_component_id:Z().optional(),pcb_group_id:Z().optional(),subcircuit_id:Z().optional(),pcb_board_id:Z().optional(),pcb_panel_id:Z().optional()}),K0t=Une.extend({shape:qe("rect"),center:Ti,width:ce,height:ce,rotation:oA.optional(),corner_radius:ce.optional()}),V0t=Une.extend({shape:qe("circle"),center:Ti,radius:ce}),z0t=Une.extend({shape:qe("polygon"),points:dn(Ti)}),J0t=Une.extend({shape:qe("path"),route:dn(Ti),slot_width:ce,slot_length:ce.optional(),space_between_slots:ce.optional(),slot_corner_radius:ce.optional()}),P3e=_y("shape",[K0t,V0t,z0t,J0t]).describe("Defines a cutout on the PCB, removing board material."),W0t=Ml.extend({type:qe("pcb_missing_footprint_error"),pcb_missing_footprint_error_id:so("pcb_missing_footprint_error"),pcb_group_id:Z().optional(),subcircuit_id:Z().optional(),error_type:qe("pcb_missing_footprint_error").default("pcb_missing_footprint_error"),source_component_id:Z()}).describe("Defines a missing footprint error on the PCB"),FV=Ml.extend({type:qe("external_footprint_load_error"),external_footprint_load_error_id:so("external_footprint_load_error"),pcb_component_id:Z(),source_component_id:Z(),pcb_group_id:Z().optional(),subcircuit_id:Z().optional(),footprinter_string:Z().optional(),error_type:qe("external_footprint_load_error").default("external_footprint_load_error")}).describe("Defines an error when an external footprint fails to load"),M3e=Ml.extend({type:qe("circuit_json_footprint_load_error"),circuit_json_footprint_load_error_id:so("circuit_json_footprint_load_error"),pcb_component_id:Z(),source_component_id:Z(),pcb_group_id:Z().optional(),subcircuit_id:Z().optional(),error_type:qe("circuit_json_footprint_load_error").default("circuit_json_footprint_load_error"),circuit_json:dn(ud()).optional()}).describe("Defines an error when a circuit JSON footprint fails to load"),j0t=Pt({type:qe("pcb_group"),pcb_group_id:so("pcb_group"),source_group_id:Z(),is_subcircuit:je().optional(),subcircuit_id:Z().optional(),width:ce.optional(),height:ce.optional(),center:Ti,display_offset_x:Z().optional().describe("How to display the x offset for this group, usually corresponding with how the user specified it"),display_offset_y:Z().optional().describe("How to display the y offset for this group, usually corresponding with how the user specified it"),outline:dn(Ti).optional(),anchor_position:Ti.optional(),anchor_alignment:M8.default("center"),position_mode:Kn(["packed","relative_to_group_anchor","none"]).optional(),positioned_relative_to_pcb_group_id:Z().optional(),positioned_relative_to_pcb_board_id:Z().optional(),pcb_component_ids:dn(Z()),child_layout_mode:Kn(["packed","none"]).optional(),name:Z().optional(),description:Z().optional(),layout_mode:Z().optional(),autorouter_configuration:Pt({trace_clearance:ce}).optional(),autorouter_used_string:Z().optional()}).describe("Defines a group of components on the PCB"),q0t=Ml.extend({type:qe("pcb_autorouting_error"),pcb_error_id:so("pcb_autorouting_error"),error_type:qe("pcb_autorouting_error").default("pcb_autorouting_error"),subcircuit_id:Z().optional()}).describe("The autorouting has failed to route a portion of the board"),D3e=Pt({type:qe("pcb_manual_edit_conflict_warning"),pcb_manual_edit_conflict_warning_id:so("pcb_manual_edit_conflict_warning"),warning_type:qe("pcb_manual_edit_conflict_warning").default("pcb_manual_edit_conflict_warning"),message:Z(),pcb_component_id:Z(),pcb_group_id:Z().optional(),subcircuit_id:Z().optional(),source_component_id:Z()}).describe("Warning emitted when a component has both manual placement and explicit pcbX/pcbY coordinates"),X0t=Kn(["x-","x+","y+","y-"]),$0t=Pt({type:qe("pcb_connector_not_in_accessible_orientation_warning"),pcb_connector_not_in_accessible_orientation_warning_id:so("pcb_connector_not_in_accessible_orientation_warning"),warning_type:qe("pcb_connector_not_in_accessible_orientation_warning").default("pcb_connector_not_in_accessible_orientation_warning"),message:Z(),pcb_component_id:Z(),source_component_id:Z().optional(),pcb_board_id:Z().optional(),facing_direction:X0t,recommended_facing_direction:X0t,subcircuit_id:Z().optional()}).describe("Warning emitted when a connector PCB component is facing inward toward the board and should be reoriented to an outward-facing direction"),Z0t=Pt({type:qe("pcb_component_missing_courtyard_warning"),pcb_component_missing_courtyard_warning_id:so("pcb_component_missing_courtyard_warning"),warning_type:qe("pcb_component_missing_courtyard_warning").default("pcb_component_missing_courtyard_warning"),message:Z(),pcb_component_id:Z(),source_component_id:Z().optional(),subcircuit_id:Z().optional()}).describe("Warning emitted when a PCB component has no courtyard geometry"),N3e=Pt({type:qe("supplier_footprint_mismatch_warning"),supplier_footprint_mismatch_warning_id:so("supplier_footprint_mismatch_warning"),warning_type:qe("supplier_footprint_mismatch_warning").default("supplier_footprint_mismatch_warning"),message:Z(),source_component_id:Z(),pcb_component_id:Z().optional(),pcb_group_id:Z().optional(),subcircuit_id:Z().optional(),supplier_name:JM.optional(),supplier_part_number:Z().optional(),supplier_footprint_url:Z().optional(),footprint_copper_intersection_over_union:_t()}).describe("Warning emitted when a supplier part footprint does not match the expected footprint"),egt=Pt({type:qe("pcb_fabricator_extra_charge_warning"),pcb_fabricator_extra_charge_warning_id:so("pcb_fabricator_extra_charge_warning"),warning_type:qe("pcb_fabricator_extra_charge_warning").default("pcb_fabricator_extra_charge_warning"),message:Z(),fabricator_preset:Z(),pcb_board_id:Z().optional(),pcb_via_ids:dn(Z()).optional(),subcircuit_id:Z().optional()}).describe("Warning that a design feature incurs an extra charge for the selected fabricator preset, such as via hole diameters below 0.3 mm with JLCPCB economy or standard presets."),tgt=Pt({type:qe("pcb_breakout_point"),pcb_breakout_point_id:so("pcb_breakout_point"),pcb_group_id:Z(),subcircuit_id:Z().optional(),source_trace_id:Z().optional(),source_port_id:Z().optional(),source_net_id:Z().optional(),layer:Pr.optional(),x:lt,y:lt}).describe("Defines a routing target within a pcb_group for a source_trace or source_net"),ngt=Pt({type:qe("pcb_ground_plane"),pcb_ground_plane_id:so("pcb_ground_plane"),source_pcb_ground_plane_id:Z(),source_net_id:Z(),pcb_group_id:Z().optional(),subcircuit_id:Z().optional()}).describe("Defines a ground plane on the PCB"),ogt=Pt({type:qe("pcb_ground_plane_region"),pcb_ground_plane_region_id:so("pcb_ground_plane_region"),pcb_ground_plane_id:Z(),pcb_group_id:Z().optional(),subcircuit_id:Z().optional(),layer:Pr,points:dn(Ti)}).describe("Defines a polygon region of a ground plane"),igt=Pt({type:qe("pcb_thermal_spoke"),pcb_thermal_spoke_id:so("pcb_thermal_spoke"),pcb_ground_plane_id:Z(),shape:Z(),spoke_count:_t(),spoke_thickness:lt,spoke_inner_diameter:lt,spoke_outer_diameter:lt,pcb_plated_hole_id:Z().optional(),subcircuit_id:Z().optional()}).describe("Pattern for connecting a ground plane to a plated hole"),R3e=Pt({type:qe("pcb_copper_pour"),pcb_copper_pour_id:so("pcb_copper_pour"),pcb_group_id:Z().optional(),subcircuit_id:Z().optional(),layer:Pr,source_net_id:Z().optional(),covered_with_solder_mask:je().optional().default(!0)}),rgt=R3e.extend({shape:qe("rect"),center:Ti,width:ce,height:ce,rotation:oA.optional()}),sgt=R3e.extend({shape:qe("brep"),brep_shape:_3e}),agt=R3e.extend({shape:qe("polygon"),points:dn(Ti)}),T3e=_y("shape",[rgt,sgt,agt]).describe("Defines a copper pour on the PCB."),Agt=Ml.extend({type:qe("pcb_component_outside_board_error"),pcb_component_outside_board_error_id:so("pcb_component_outside_board_error"),error_type:qe("pcb_component_outside_board_error").default("pcb_component_outside_board_error"),pcb_component_id:Z(),pcb_board_id:Z(),component_center:Ti,component_bounds:Pt({min_x:_t(),max_x:_t(),min_y:_t(),max_y:_t()}),subcircuit_id:Z().optional(),source_component_id:Z().optional()}).describe("Error emitted when a PCB component is placed outside the board boundaries"),cgt=Ml.extend({type:qe("pcb_component_not_on_board_edge_error"),pcb_component_not_on_board_edge_error_id:so("pcb_component_not_on_board_edge_error"),error_type:qe("pcb_component_not_on_board_edge_error").default("pcb_component_not_on_board_edge_error"),pcb_component_id:Z(),pcb_board_id:Z(),component_center:Ti,pad_to_nearest_board_edge_distance:_t(),source_component_id:Z().optional(),subcircuit_id:Z().optional()}).describe("Error emitted when a component that must be placed on the board edge is centered away from the edge"),Kne=Ml.extend({type:qe("pcb_component_invalid_layer_error"),pcb_component_invalid_layer_error_id:so("pcb_component_invalid_layer_error"),error_type:qe("pcb_component_invalid_layer_error").default("pcb_component_invalid_layer_error"),pcb_component_id:Z().optional(),source_component_id:Z(),layer:Pr,subcircuit_id:Z().optional()}).describe("Error emitted when a component is placed on an invalid layer (components can only be on 'top' or 'bottom' layers)"),lgt=Ml.extend({type:qe("pcb_via_clearance_error"),pcb_error_id:so("pcb_error"),error_type:qe("pcb_via_clearance_error").default("pcb_via_clearance_error"),pcb_via_ids:dn(Z()).min(2),minimum_clearance:lt.optional(),actual_clearance:lt.optional(),pcb_center:Pt({x:_t().optional(),y:_t().optional()}).optional(),subcircuit_id:Z().optional()}).describe("Error emitted when vias are closer than the allowed clearance"),ggt=Ml.extend({type:qe("pcb_via_trace_clearance_error"),pcb_via_trace_clearance_error_id:so("pcb_via_trace_clearance_error"),error_type:qe("pcb_via_trace_clearance_error").default("pcb_via_trace_clearance_error"),pcb_via_id:Z(),pcb_trace_id:Z(),minimum_clearance:lt.optional(),actual_clearance:lt.optional(),center:Pt({x:_t().optional(),y:_t().optional()}).optional(),subcircuit_id:Z().optional()}).describe("Error emitted when a via and trace are closer than the allowed clearance"),ugt=Ml.extend({type:qe("pcb_pad_pad_clearance_error"),pcb_pad_pad_clearance_error_id:so("pcb_pad_pad_clearance_error"),error_type:qe("pcb_pad_pad_clearance_error").default("pcb_pad_pad_clearance_error"),pcb_pad_ids:dn(Z()).min(2),minimum_clearance:lt.optional(),actual_clearance:lt.optional(),center:Pt({x:_t().optional(),y:_t().optional()}).optional(),subcircuit_id:Z().optional()}).describe("Error emitted when pads are closer than the allowed clearance"),dgt=Ml.extend({type:qe("pcb_pad_trace_clearance_error"),pcb_pad_trace_clearance_error_id:so("pcb_pad_trace_clearance_error"),error_type:qe("pcb_pad_trace_clearance_error").default("pcb_pad_trace_clearance_error"),pcb_pad_id:Z(),pcb_trace_id:Z(),minimum_clearance:lt.optional(),actual_clearance:lt.optional(),center:Pt({x:_t().optional(),y:_t().optional()}).optional(),subcircuit_id:Z().optional()}).describe("Error emitted when a pad and trace are closer than allowed clearance"),k3e=Pt({type:qe("pcb_courtyard_rect"),pcb_courtyard_rect_id:so("pcb_courtyard_rect"),pcb_component_id:Z(),pcb_group_id:Z().optional(),subcircuit_id:Z().optional(),center:Ti,width:ce,height:ce,layer:Vm,ccw_rotation:oA.optional(),color:Z().optional()}).describe("Defines a courtyard rectangle on the PCB"),F3e=Pt({type:qe("pcb_courtyard_outline"),pcb_courtyard_outline_id:so("pcb_courtyard_outline"),pcb_component_id:Z(),pcb_group_id:Z().optional(),subcircuit_id:Z().optional(),layer:Vm,outline:dn(Ti).min(2)}).describe("Defines a courtyard outline on the PCB"),L3e=Pt({type:qe("pcb_courtyard_polygon"),pcb_courtyard_polygon_id:so("pcb_courtyard_polygon"),pcb_component_id:Z(),pcb_group_id:Z().optional(),subcircuit_id:Z().optional(),layer:Vm,points:dn(Ti).min(3),color:Z().optional()}).describe("Defines a courtyard polygon on the PCB"),H3e=Pt({type:qe("pcb_courtyard_circle"),pcb_courtyard_circle_id:so("pcb_courtyard_circle"),pcb_component_id:Z(),pcb_group_id:Z().optional(),subcircuit_id:Z().optional(),center:Ti,radius:ce,layer:Vm,color:Z().optional()}).describe("Defines a courtyard circle on the PCB"),O3e=Pt({type:qe("pcb_courtyard_pill"),pcb_courtyard_pill_id:so("pcb_courtyard_pill"),pcb_component_id:Z(),pcb_group_id:Z().optional(),subcircuit_id:Z().optional(),center:Ti,width:ce,height:ce,radius:ce,layer:Vm,color:Z().optional()}).describe("Defines a courtyard pill on the PCB"),P8n=["obj","stl","3mf","gltf","glb","step","wrl"],hgt=["x+","x-","y+","y-","z+","z-"],M8n={obj:"z+",stl:"z+","3mf":"z+",gltf:"y+",glb:"y+",step:"z+",wrl:"y+"},pgt=Pt({type:qe("cad_component"),cad_component_id:Z(),pcb_component_id:Z(),source_component_id:Z(),position:D9,rotation:D9.optional(),size:D9.optional(),layer:Pr.optional(),subcircuit_id:Z().optional(),footprinter_string:Z().optional(),model_obj_url:Z().optional(),model_stl_url:Z().optional(),model_3mf_url:Z().optional(),model_gltf_url:Z().optional(),model_glb_url:Z().optional(),model_step_url:Z().optional(),model_wrl_url:Z().optional(),model_asset:Fne.optional(),model_unit_to_mm_scale_factor:_t().optional(),model_board_normal_direction:Kn(hgt).optional().describe(`The direction in the model's coordinate space that is considered "up" or "coming out of the board surface"`),model_origin_position:D9.optional(),model_origin_alignment:Kn(["unknown","center","center_of_component_on_board_surface","bottom_center_of_component"]).optional(),model_object_fit:Kn(["contain_within_bounds","fill_bounds"]).optional().default("contain_within_bounds"),model_jscad:ud().optional(),show_as_translucent_model:je().optional(),show_as_bounding_box:je().optional(),show_hidden_edges:je().optional(),anchor_alignment:Kn(["center","center_of_component_on_board_surface"]).optional().default("center")}).describe("Defines a component on the PCB"),G3e=Kn(["sinewave","square","triangle","sawtooth"]),D8n=xo([Z(),_t()]).transform(t=>typeof t=="string"?t.endsWith("%")?parseFloat(t.slice(0,-1))/100:parseFloat(t):t).pipe(_t().min(0,"Duty cycle must be non-negative").max(1,"Duty cycle cannot be greater than 100%")),mgt=Pt({type:qe("simulation_voltage_source"),simulation_voltage_source_id:so("simulation_voltage_source"),is_dc_source:qe(!0).optional().default(!0),positive_source_port_id:Z().optional(),negative_source_port_id:Z().optional(),positive_source_net_id:Z().optional(),negative_source_net_id:Z().optional(),voltage:O_,ac_magnitude:O_.optional(),ac_phase:oA.optional()}).describe("Defines a DC voltage source for simulation"),_gt=Pt({type:qe("simulation_voltage_source"),simulation_voltage_source_id:so("simulation_voltage_source"),is_dc_source:qe(!1),terminal1_source_port_id:Z().optional(),terminal2_source_port_id:Z().optional(),terminal1_source_net_id:Z().optional(),terminal2_source_net_id:Z().optional(),voltage:O_.optional(),frequency:fy.optional(),peak_to_peak_voltage:O_.optional(),wave_shape:G3e.optional(),phase:oA.optional(),duty_cycle:D8n.optional(),pulse_delay:Pl.optional(),rise_time:Pl.optional(),fall_time:Pl.optional(),pulse_width:Pl.optional(),period:Pl.optional(),ac_magnitude:O_.optional(),ac_phase:oA.optional()}).describe("Defines an AC voltage source for simulation"),fgt=xo([mgt,_gt]).describe("Defines a voltage source for simulation"),N8n=xo([Z(),_t()]).transform(t=>typeof t=="string"?t.endsWith("%")?parseFloat(t.slice(0,-1))/100:parseFloat(t):t).pipe(_t().min(0,"Duty cycle must be non-negative").max(1,"Duty cycle cannot be greater than 100%")),Igt=Pt({type:qe("simulation_current_source"),simulation_current_source_id:so("simulation_current_source"),is_dc_source:qe(!0).optional().default(!0),positive_source_port_id:Z().optional(),negative_source_port_id:Z().optional(),positive_source_net_id:Z().optional(),negative_source_net_id:Z().optional(),current:R3,ac_magnitude:R3.optional(),ac_phase:oA.optional()}).describe("Defines a DC current source for simulation"),Cgt=Pt({type:qe("simulation_current_source"),simulation_current_source_id:so("simulation_current_source"),is_dc_source:qe(!1),terminal1_source_port_id:Z().optional(),terminal2_source_port_id:Z().optional(),terminal1_source_net_id:Z().optional(),terminal2_source_net_id:Z().optional(),current:R3.optional(),frequency:fy.optional(),peak_to_peak_current:R3.optional(),wave_shape:G3e.optional(),phase:oA.optional(),duty_cycle:N8n.optional(),ac_magnitude:R3.optional(),ac_phase:oA.optional()}).describe("Defines an AC current source for simulation"),ygt=xo([Igt,Cgt]).describe("Defines a current source for simulation"),Vne=P0(t=>t==="V"||t==="A"),Y3e=P0(t=>t==="Ω"||t==="F"||t==="H"||t==="V"||t==="A"),xgt=xo([qe("spice_dc_sweep"),qe("spice_dc_operating_point"),qe("spice_transient_analysis"),qe("spice_ac_analysis")]),Egt=Pt({method:Kn(["trap","gear"]).optional(),reltol:xo([_t(),Z()]).optional(),abstol:xo([_t(),Z()]).optional(),vntol:xo([_t(),Z()]).optional()}).describe("SPICE solver options for a simulation experiment"),Bgt=Pt({type:qe("simulation_experiment"),simulation_experiment_id:so("simulation_experiment"),name:Z(),experiment_type:xgt,time_per_step:qk.optional(),start_time_ms:Pl.optional(),end_time_ms:Pl.optional(),spice_options:Egt.optional(),dc_sweep_voltage_source_id:Z().optional(),dc_sweep_current_source_id:Z().optional(),dc_sweep_start:_t().optional(),dc_sweep_stop:_t().optional(),dc_sweep_step:_t().refine(t=>t!==0).optional(),dc_sweep_unit:Vne.optional(),ac_sweep_type:Kn(["linear","decade","octave"]).optional(),ac_samples_per_interval:_t().int().positive().optional(),ac_sample_count:_t().int().positive().optional(),ac_start_frequency_hz:_t().positive().optional(),ac_stop_frequency_hz:_t().positive().optional()}).superRefine((t,e)=>{if(t.experiment_type==="spice_dc_sweep"){const n=["dc_sweep_start","dc_sweep_stop","dc_sweep_step","dc_sweep_unit"];for(const r of n)t[r]===void 0&&e.addIssue({code:lo.custom,path:[r],message:`${r} is required for a DC sweep`});const o=t.dc_sweep_voltage_source_id!==void 0,i=t.dc_sweep_current_source_id!==void 0;o===i&&e.addIssue({code:lo.custom,path:["dc_sweep_voltage_source_id"],message:"Exactly one DC sweep voltage or current source ID is required"})}t.experiment_type==="spice_ac_analysis"&&(t.ac_sweep_type===void 0&&e.addIssue({code:lo.custom,path:["ac_sweep_type"],message:"ac_sweep_type is required for an AC analysis"}),t.ac_start_frequency_hz===void 0&&e.addIssue({code:lo.custom,path:["ac_start_frequency_hz"],message:"ac_start_frequency_hz is required for an AC analysis"}),t.ac_stop_frequency_hz===void 0&&e.addIssue({code:lo.custom,path:["ac_stop_frequency_hz"],message:"ac_stop_frequency_hz is required for an AC analysis"}),t.ac_sweep_type==="linear"&&t.ac_sample_count===void 0&&e.addIssue({code:lo.custom,path:["ac_sample_count"],message:"ac_sample_count is required for a linear AC analysis"}),(t.ac_sweep_type==="decade"||t.ac_sweep_type==="octave")&&t.ac_samples_per_interval===void 0&&e.addIssue({code:lo.custom,path:["ac_samples_per_interval"],message:"ac_samples_per_interval is required for decade and octave AC analyses"}))}).describe("Defines a simulation experiment configuration"),D8=Pt({simulation_parameter_sweep_id:Z(),sweep_index:_t().int().nonnegative(),parameter_value:_t(),parameter_unit:Y3e}),bgt=Pt({type:qe("simulation_transient_voltage_graph"),simulation_transient_voltage_graph_id:so("simulation_transient_voltage_graph"),simulation_experiment_id:Z(),simulation_parameter_sweep_coordinate:D8.optional(),timestamps_ms:dn(_t()).optional(),voltage_levels:dn(_t()),source_component_id:Z().optional(),subcircuit_connectivity_map_key:Z().optional(),time_per_step:qk,start_time_ms:Pl,end_time_ms:Pl,name:Z().optional(),color:Z().optional()}).describe("Stores voltage measurements over time for a simulation"),Sgt=Pt({type:qe("simulation_transient_current_graph"),simulation_transient_current_graph_id:so("simulation_transient_current_graph"),simulation_experiment_id:Z(),simulation_parameter_sweep_coordinate:D8.optional(),timestamps_ms:dn(_t()).optional(),current_levels:dn(_t()),source_component_id:Z().optional(),subcircuit_connectivity_map_key:Z().optional(),time_per_step:qk,start_time_ms:Pl,end_time_ms:Pl,name:Z().optional(),color:Z().optional()}).describe("Stores current measurements over time for a simulation"),Qgt=Pt({type:qe("simulation_switch"),simulation_switch_id:so("simulation_switch"),source_component_id:Z().optional(),closes_at:Pl.optional(),opens_at:Pl.optional(),starts_closed:je().optional(),switching_frequency:fy.optional()}).describe("Defines a switch for simulation timing control"),vgt=Pt({type:qe("simulation_voltage_probe"),simulation_voltage_probe_id:so("simulation_voltage_probe"),source_component_id:Z().optional(),name:Z().optional(),signal_input_source_port_id:Z().optional(),signal_input_source_net_id:Z().optional(),reference_input_source_port_id:Z().optional(),reference_input_source_net_id:Z().optional(),subcircuit_id:Z().optional(),color:Z().optional()}).describe("Defines a voltage probe for simulation. If a reference input is not provided, it measures against ground. If a reference input is provided, it measures the differential voltage between two points.").superRefine((t,e)=>{if(t.reference_input_source_port_id||t.reference_input_source_net_id){const o=!!t.signal_input_source_port_id||!!t.reference_input_source_port_id,i=!!t.signal_input_source_net_id||!!t.reference_input_source_net_id;o&&i?e.addIssue({code:lo.custom,message:"Cannot mix port and net connections in a differential probe."}):o?(!t.signal_input_source_port_id||!t.reference_input_source_port_id)&&e.addIssue({code:lo.custom,message:"Differential port probe requires both signal_input_source_port_id and reference_input_source_port_id."}):i&&(!t.signal_input_source_net_id||!t.reference_input_source_net_id)&&e.addIssue({code:lo.custom,message:"Differential net probe requires both signal_input_source_net_id and reference_input_source_net_id."})}else!!t.signal_input_source_port_id==!!t.signal_input_source_net_id&&e.addIssue({code:lo.custom,message:"A voltage probe must have exactly one of signal_input_source_port_id or signal_input_source_net_id."})}),wgt=Pt({type:qe("simulation_current_probe"),simulation_current_probe_id:so("simulation_current_probe"),source_component_id:Z().optional(),name:Z().optional(),positive_source_port_id:Z().optional(),negative_source_port_id:Z().optional(),positive_source_net_id:Z().optional(),negative_source_net_id:Z().optional(),subcircuit_id:Z().optional(),color:Z().optional()}).describe("Defines a current probe for simulation. It measures current flowing from the positive endpoint to the negative endpoint.").superRefine((t,e)=>{const n=!!t.positive_source_port_id,o=!!t.negative_source_port_id,i=!!t.positive_source_net_id,r=!!t.negative_source_net_id,s=n||o,a=i||r;if(s&&a){e.addIssue({code:lo.custom,message:"Cannot mix port and net connections in a current probe."});return}if(s){(!n||!o)&&e.addIssue({code:lo.custom,message:"Current probe using source ports requires both positive_source_port_id and negative_source_port_id."});return}if(a){(!i||!r)&&e.addIssue({code:lo.custom,message:"Current probe using source nets requires both positive_source_net_id and negative_source_net_id."});return}e.addIssue({code:lo.custom,message:"A current probe must have either positive/negative source port ids or positive/negative source net ids."})}),Pgt=Ml.extend({type:qe("simulation_unknown_experiment_error"),simulation_unknown_experiment_error_id:so("simulation_unknown_experiment_error"),error_type:qe("simulation_unknown_experiment_error").default("simulation_unknown_experiment_error"),simulation_experiment_id:Z().optional(),subcircuit_id:Z().optional()}).describe("An unknown error occurred during the simulation experiment."),R8n=Kn(["resistance","capacitance","inductance","voltage","current"]),LV=Pt({type:qe("simulation_parameter_sweep"),simulation_parameter_sweep_id:so("simulation_parameter_sweep"),simulation_experiment_id:Z(),name:Z().optional(),parameter_values:dn(_t()).min(1),parameter_unit:Y3e}),Mgt=_y("parameter_type",[LV.extend({parameter_type:qe("resistance"),resistor_source_component_id:Z()}),LV.extend({parameter_type:qe("capacitance"),capacitor_source_component_id:Z()}),LV.extend({parameter_type:qe("inductance"),inductor_source_component_id:Z()}),LV.extend({parameter_type:qe("voltage"),source_net_id:Z()}),LV.extend({parameter_type:qe("current"),current_source_component_id:Z()})]).describe("Repeats a simulation experiment over component parameter values"),Dgt=Pt({type:qe("simulation_dc_operating_point_voltage"),simulation_dc_operating_point_voltage_id:so("simulation_dc_operating_point_voltage"),simulation_experiment_id:Z(),simulation_parameter_sweep_coordinate:D8.optional(),simulation_voltage_probe_id:Z(),voltage:_t(),name:Z().optional(),color:Z().optional()}),Ngt=Pt({type:qe("simulation_dc_operating_point_current"),simulation_dc_operating_point_current_id:so("simulation_dc_operating_point_current"),simulation_experiment_id:Z(),simulation_parameter_sweep_coordinate:D8.optional(),simulation_current_probe_id:Z(),current:_t(),name:Z().optional(),color:Z().optional()}),Rgt=Pt({type:qe("simulation_dc_sweep_voltage_graph"),simulation_dc_sweep_voltage_graph_id:so("simulation_dc_sweep_voltage_graph"),simulation_experiment_id:Z(),simulation_parameter_sweep_coordinate:D8.optional(),simulation_voltage_probe_id:Z(),sweep_values:dn(_t()),sweep_unit:Vne,voltage_levels:dn(_t()),name:Z().optional(),color:Z().optional()}).refine(t=>t.sweep_values.length===t.voltage_levels.length,{message:"sweep_values and voltage_levels must have the same length"}),Tgt=Pt({type:qe("simulation_dc_sweep_current_graph"),simulation_dc_sweep_current_graph_id:so("simulation_dc_sweep_current_graph"),simulation_experiment_id:Z(),simulation_parameter_sweep_coordinate:D8.optional(),simulation_current_probe_id:Z(),sweep_values:dn(_t()),sweep_unit:Vne,current_levels:dn(_t()),name:Z().optional(),color:Z().optional()}).refine(t=>t.sweep_values.length===t.current_levels.length,{message:"sweep_values and current_levels must have the same length"}),U3e=Pt({re:_t(),im:_t()}),kgt=Pt({type:qe("simulation_ac_sweep_voltage_graph"),simulation_ac_sweep_voltage_graph_id:so("simulation_ac_sweep_voltage_graph"),simulation_experiment_id:Z(),simulation_parameter_sweep_coordinate:D8.optional(),simulation_voltage_probe_id:Z(),frequencies_hz:dn(_t()),complex_voltages:dn(U3e),name:Z().optional(),color:Z().optional()}).refine(t=>t.frequencies_hz.length===t.complex_voltages.length,{message:"frequencies_hz and complex_voltages must have the same length"}),Fgt=Pt({type:qe("simulation_ac_sweep_current_graph"),simulation_ac_sweep_current_graph_id:so("simulation_ac_sweep_current_graph"),simulation_experiment_id:Z(),simulation_parameter_sweep_coordinate:D8.optional(),simulation_current_probe_id:Z(),frequencies_hz:dn(_t()),complex_currents:dn(U3e),name:Z().optional(),color:Z().optional()}).refine(t=>t.frequencies_hz.length===t.complex_currents.length,{message:"frequencies_hz and complex_currents must have the same length"}),Lgt=Pt({type:qe("simulation_op_amp"),simulation_op_amp_id:so("simulation_op_amp"),source_component_id:Z().optional(),inverting_input_source_port_id:Z(),non_inverting_input_source_port_id:Z(),output_source_port_id:Z(),positive_supply_source_port_id:Z(),negative_supply_source_port_id:Z()}).describe("Defines a simple ideal operational amplifier for simulation"),Hgt=Pt({type:qe("simulation_spice_subcircuit"),simulation_spice_subcircuit_id:so("simulation_spice_subcircuit"),source_component_id:Z(),spice_pin_to_source_port_map:bc(Z(),Z()),subcircuit_source:Z()}).describe("Defines a custom SPICE subcircuit model for simulation"),Ogt=t=>t!==void 0,Ggt=Pt({type:qe("simulation_oscilloscope_trace"),simulation_oscilloscope_trace_id:so("simulation_oscilloscope_trace"),simulation_transient_voltage_graph_id:Z().optional(),simulation_transient_current_graph_id:Z().optional(),simulation_voltage_probe_id:Z().optional(),simulation_current_probe_id:Z().optional(),display_name:Z().optional(),color:Z().optional(),display_center_value:_t().optional(),display_center_offset_divs:_t().optional(),volts_per_div:_t().positive().optional(),amps_per_div:_t().positive().optional()}).describe("Defines how a simulation measurement is rendered as an oscilloscope-style trace.").superRefine((t,e)=>{const n=[t.simulation_transient_voltage_graph_id,t.simulation_voltage_probe_id].filter(Ogt).length,o=[t.simulation_transient_current_graph_id,t.simulation_current_probe_id].filter(Ogt).length;n+o!==1&&e.addIssue({code:lo.custom,message:"An oscilloscope trace must reference exactly one voltage graph, current graph, voltage probe, or current probe."}),n>0&&t.amps_per_div!==void 0&&e.addIssue({code:lo.custom,message:"Voltage oscilloscope traces must use volts_per_div, not amps_per_div."}),o>0&&t.volts_per_div!==void 0&&e.addIssue({code:lo.custom,message:"Current oscilloscope traces must use amps_per_div, not volts_per_div."})}),K3e=xo([$ct,qct,Xct,jct,elt,Zct,Vxe,Yxe,Hne,Kxe,Uxe,zxe,Jxe,Wxe,Xxe,$xe,Zxe,i3e,e3e,t3e,n3e,o3e,qxe,jxe,olt,ilt,tlt,r3e,s3e,a3e,A3e,rlt,glt,c3e,l3e,slt,alt,Alt,clt,llt,TV,g3e,RV,nlt,jlt,Zlt,s0t,W0t,FV,M3e,D3e,$0t,Z0t,N3e,egt,a0t,w3e,A0t,B0t,u0t,m0t,_0t,f0t,I0t,Yne,l0t,g0t,b0t,S0t,j0t,P0t,M0t,D0t,N0t,O0t,R0t,T0t,k0t,F0t,H0t,C0t,y0t,Q0t,v0t,w0t,x0t,E0t,lgt,ggt,ugt,dgt,y3e,C3e,x3e,E3e,B3e,b3e,S3e,Q3e,v3e,q0t,G0t,Y0t,tgt,P3e,ngt,ogt,igt,T3e,Agt,cgt,Kne,k3e,F3e,L3e,H3e,O3e,ult,blt,Clt,ylt,xlt,Elt,flt,Ilt,Slt,Blt,dlt,vlt,wlt,Qlt,Nlt,Rlt,h3e,Tlt,klt,Klt,Flt,Hlt,Olt,Ult,Glt,Ylt,pgt,fgt,ygt,Bgt,bgt,Sgt,Dgt,Ngt,Rgt,Tgt,kgt,Fgt,Mgt,Qgt,vgt,wgt,Ggt,Pgt,Lgt,Hgt]),O4=K3e;const R9=Object.freeze(Object.defineProperty({__proto__:null,all_layers:Xk,any_circuit_element:K3e,any_soup_element:O4,any_source_component:jct,asset:Fne,base_circuit_json_error:Ml,battery_capacity:xct,brep_shape:_3e,cadModelDefaultDirectionMap:M8n,cad_component:pgt,cad_model_axis_directions:hgt,cad_model_formats:P8n,capacitance:zM,circuit_json_footprint_load_error:M3e,current:R3,distance:lt,duration_ms:qk,experiment_type:xgt,external_footprint_load_error:FV,frequency:fy,getRotationBetweenPcbPin1Locations:i8n,getZodPrefixedIdWithDefault:so,inductance:Tne,insertionDirectionToCanonical:f3e,insertionDirectionToVector:n8n,insertion_direction:zlt,kicadAt:Lne,kicadEffects:Ect,kicadFont:Gxe,kicadFootprintAttributes:bct,kicadFootprintMetadata:vct,kicadFootprintModel:Qct,kicadFootprintPad:Sct,kicadFootprintProperties:Bct,kicadProperty:NV,kicadSymbolEffects:Mct,kicadSymbolMetadata:Nct,kicadSymbolPinNames:Pct,kicadSymbolPinNumbers:wct,kicadSymbolProperties:Dct,kicadSymbolProperty:yQ,layer_ref:Pr,layer_string:u3e,length:ce,manufacturing_drc_properties:Wlt,ms:Pl,ninePointAnchor:M8,parseAndConvertSiUnit:X1,pcbRenderLayer:Z6n,pcb_autorouting_error:q0t,pcb_board:b0t,pcb_breakout_point:tgt,pcb_component:jlt,pcb_component_invalid_layer_error:Kne,pcb_component_missing_courtyard_warning:Z0t,pcb_component_not_on_board_edge_error:cgt,pcb_component_outside_board_error:Agt,pcb_connector_not_in_accessible_orientation_warning:$0t,pcb_copper_pour:T3e,pcb_copper_pour_brep:sgt,pcb_copper_pour_polygon:agt,pcb_copper_pour_rect:rgt,pcb_copper_text:R0t,pcb_courtyard_circle:H3e,pcb_courtyard_outline:F3e,pcb_courtyard_overlap_error:Y0t,pcb_courtyard_pill:O3e,pcb_courtyard_polygon:L3e,pcb_courtyard_rect:k3e,pcb_cutout:P3e,pcb_cutout_circle:V0t,pcb_cutout_path:J0t,pcb_cutout_polygon:z0t,pcb_cutout_rect:K0t,pcb_debug_line:Xlt,pcb_debug_object:Zlt,pcb_debug_object_base:Gne,pcb_debug_point:$lt,pcb_debug_rect:qlt,pcb_fabrication_note_dimension:E3e,pcb_fabrication_note_path:y3e,pcb_fabrication_note_rect:x3e,pcb_fabrication_note_text:C3e,pcb_fabricator_extra_charge_warning:egt,pcb_footprint_overlap_error:G0t,pcb_ground_plane:ngt,pcb_ground_plane_region:ogt,pcb_group:j0t,pcb_hole:s0t,pcb_hole_circle_or_square_shape:A8n,pcb_hole_circle_shape:s8n,pcb_hole_oval_shape:c8n,pcb_hole_pill_shape:l8n,pcb_hole_rect_shape:a8n,pcb_hole_rotated_pill_shape:g8n,pcb_keepout:w3e,pcb_keepout_outline:U0t,pcb_manual_edit_conflict_warning:D3e,pcb_missing_footprint_error:W0t,pcb_net:B0t,pcb_note_dimension:v3e,pcb_note_line:Q3e,pcb_note_path:S3e,pcb_note_rect:b3e,pcb_note_text:B3e,pcb_packing_error:v0t,pcb_pad_pad_clearance_error:ugt,pcb_pad_trace_clearance_error:dgt,pcb_panel:S0t,pcb_panelization_placement_error:w0t,pcb_pin1_location:kV,pcb_placement_error:Q0t,pcb_plated_hole:a0t,pcb_port:A0t,pcb_port_not_connected_error:E0t,pcb_port_not_matched_error:x0t,pcb_route_hint:Jlt,pcb_route_hints:r8n,pcb_silkscreen_circle:k0t,pcb_silkscreen_graphic:H0t,pcb_silkscreen_graphic_brep:L0t,pcb_silkscreen_line:M0t,pcb_silkscreen_oval:F0t,pcb_silkscreen_path:D0t,pcb_silkscreen_pill:O0t,pcb_silkscreen_rect:T0t,pcb_silkscreen_text:N0t,pcb_smtpad:l0t,pcb_smtpad_pill:c0t,pcb_solder_paste:g0t,pcb_text:u0t,pcb_thermal_spoke:igt,pcb_trace:m0t,pcb_trace_error:C0t,pcb_trace_hint:P0t,pcb_trace_missing_error:y0t,pcb_trace_route_point:I3e,pcb_trace_route_point_through_pad:p0t,pcb_trace_route_point_via:h0t,pcb_trace_route_point_wire:d0t,pcb_trace_too_long_warning:f0t,pcb_trace_too_many_vias_warning:I0t,pcb_trace_warning:_0t,pcb_via:Yne,pcb_via_clearance_error:lgt,pcb_via_trace_clearance_error:ggt,point:Ti,point3:D9,point_with_bulge:Vlt,port_arrangement:_lt,position:q6n,position3:X6n,resistance:P8,ring:m3e,rotation:oA,route_hint_point:N9,schematic_arc:Elt,schematic_box:ult,schematic_circle:xlt,schematic_component:flt,schematic_component_overlap_warning:Tlt,schematic_component_port_arrangement_by_sides:mlt,schematic_component_port_arrangement_by_size:plt,schematic_component_styling_warning:klt,schematic_debug_line:Mlt,schematic_debug_object:Nlt,schematic_debug_object_base:One,schematic_debug_point:Dlt,schematic_debug_rect:Plt,schematic_element_outside_sheet_warning:Flt,schematic_error:vlt,schematic_graphic:Hlt,schematic_group:Olt,schematic_layout_error:wlt,schematic_line:Clt,schematic_manual_edit_conflict_warning:h3e,schematic_missing_sheet_warning:Klt,schematic_net_label:Qlt,schematic_path:dlt,schematic_pin_styles:hlt,schematic_port:Slt,schematic_rect:ylt,schematic_sheet:Ult,schematic_sheet_size:p3e,schematic_symbol:Ilt,schematic_table:Glt,schematic_table_cell:Ylt,schematic_text:blt,schematic_text_part:d3e,schematic_trace:Blt,schematic_voltage_probe:Rlt,simulation_ac_current_source:Cgt,simulation_ac_sweep_current_graph:Fgt,simulation_ac_sweep_voltage_graph:kgt,simulation_ac_voltage_source:_gt,simulation_complex_sample:U3e,simulation_current_probe:wgt,simulation_current_source:ygt,simulation_dc_current_source:Igt,simulation_dc_operating_point_current:Ngt,simulation_dc_operating_point_voltage:Dgt,simulation_dc_sweep_current_graph:Tgt,simulation_dc_sweep_unit:Vne,simulation_dc_sweep_voltage_graph:Rgt,simulation_dc_voltage_source:mgt,simulation_experiment:Bgt,simulation_op_amp:Lgt,simulation_oscilloscope_trace:Ggt,simulation_parameter_sweep:Mgt,simulation_parameter_sweep_coordinate:D8,simulation_parameter_type:R8n,simulation_parameter_unit:Y3e,simulation_spice_subcircuit:Hgt,simulation_switch:Qgt,simulation_transient_current_graph:Sgt,simulation_transient_voltage_graph:bgt,simulation_unknown_experiment_error:Pgt,simulation_voltage_probe:vgt,simulation_voltage_source:fgt,size:kne,source_ambiguous_port_reference:nlt,source_board:tlt,source_component_base:Bg,source_component_internal_connection:Xct,source_component_misconfigured_error:RV,source_component_pins_underspecified_warning:Alt,source_confusing_net_name_warning:glt,source_failed_to_create_component_error:Kct,source_group:Zct,source_i2c_misconfigured_error:g3e,source_interconnect:Jct,source_invalid_component_property_error:s3e,source_manually_placed_via:ilt,source_missing_manufacturer_part_number_warning:c3e,source_missing_property_error:Uct,source_net:elt,source_no_ground_pin_defined_warning:alt,source_no_power_pin_defined_warning:slt,source_part_not_found_warning:TV,source_pcb_ground_plane:olt,source_pin_attributes:Hct,source_pin_missing_trace_warning:A3e,source_pin_must_be_connected_error:clt,source_port:qct,source_project_metadata:r3e,source_property_ignored_warning:Vct,source_refdes_convention_warning:l3e,source_simple_ammeter:Lct,source_simple_battery:Jxe,source_simple_capacitor:Yxe,source_simple_chip:Vxe,source_simple_connector:Yct,source_simple_connector_standards:Gct,source_simple_crystal:Oct,source_simple_current_source:kct,source_simple_diode:Hne,source_simple_fiducial:Rct,source_simple_fuse:Fct,source_simple_ground:Tct,source_simple_inductor:Wxe,source_simple_led:Kxe,source_simple_mosfet:n3e,source_simple_op_amp:o3e,source_simple_pin_header:Xxe,source_simple_pinout:$xe,source_simple_potentiometer:qxe,source_simple_power_source:zxe,source_simple_push_button:jxe,source_simple_resistor:Uxe,source_simple_resonator:Zxe,source_simple_switch:i3e,source_simple_test_point:t3e,source_simple_transistor:e3e,source_simple_voltage_probe:zct,source_simple_voltage_source:Wct,source_trace:$ct,source_trace_not_connected_error:a3e,source_unnamed_trace_warning:rlt,spice_simulation_options:Egt,supplier_footprint_mismatch_warning:N3e,supplier_name:JM,time:j6n,timestamp:yct,unknown_error_finding_part:llt,visible_layer:Vm,voltage:O_,wave_shape:G3e},Symbol.toStringTag,{value:"Module"}));function hn(t,e){return Array.isArray(e)?[t.a*e[0]+t.c*e[1]+t.e,t.b*e[0]+t.d*e[1]+t.f]:{x:t.a*e.x+t.c*e.y+t.e,y:t.b*e.x+t.d*e.y+t.f}}const T8n=/^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 k8n(t){const e=t.match(T8n);if(e===null||e.length<7)throw new Error(`'${t}' 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 F8n(t){const{a:e,b:n,c:o,d:i,e:r,f:s}=t,a=e*i-n*o;return{a:i/a,b:n/-a,c:o/-a,d:e/a,e:(i*r-o*s)/-a,f:(n*r-e*s)/a}}function HV(t){return typeof t>"u"}function G_(t,e=0){return{a:1,c:0,e:t,b:0,d:1,f:e}}function OV(...t){t=Array.isArray(t[0])?t[0]:t;const e=(n,o)=>({a:n.a*o.a+n.c*o.b,c:n.a*o.c+n.c*o.d,e:n.a*o.e+n.c*o.f+n.e,b:n.b*o.a+n.d*o.b,d:n.b*o.c+n.d*o.d,f:n.b*o.e+n.d*o.f+n.f});switch(t.length){case 0:throw new Error("no matrices provided");case 1:return t[0];case 2:return e(t[0],t[1]);default:{const[n,o,...i]=t,r=e(n,o);return OV(r,...i)}}}function l0(...t){return OV(...t)}const{cos:L8n,sin:H8n}=Math;function N8(t,e,n){const o=L8n(t),i=H8n(t),r={a:o,c:-i,e:0,b:i,d:o,f:0};return HV(e)||HV(n)?r:OV([G_(e,n),r,G_(-e,-n)])}function sx(t,e=void 0,n=void 0,o=void 0){HV(e)&&(e=t);const i={a:t,c:0,e:0,b:0,d:e,f:0};return HV(n)||HV(o)?i:OV([G_(n,o),i,G_(-n,-o)])}function O8n(t){return R8(t)}function R8(t){return`matrix(${t.a},${t.b},${t.c},${t.d},${t.e},${t.f})`}function G8n(t,e=1e10){return{a:Math.round(t.a*e)/e,b:Math.round(t.b*e)/e,c:Math.round(t.c*e)/e,d:Math.round(t.d*e)/e,e:Math.round(t.e*e)/e,f:Math.round(t.f*e)/e}}function Y8n(t,e){const n=t[0].x!=null?t[0].x:t[0][0],o=t[0].y!=null?t[0].y:t[0][1],i=e[0].x!=null?e[0].x:e[0][0],r=e[0].y!=null?e[0].y:e[0][1],s=t[1].x!=null?t[1].x:t[1][0],a=t[1].y!=null?t[1].y:t[1][1],A=e[1].x!=null?e[1].x:e[1][0],c=e[1].y!=null?e[1].y:e[1][1],l=t[2].x!=null?t[2].x:t[2][0],g=t[2].y!=null?t[2].y:t[2][1],u=e[2].x!=null?e[2].x:e[2][0],h=e[2].y!=null?e[2].y:e[2][1],d={a:n-l,b:o-g,c:s-l,d:a-g,e:l,f:g},p={a:i-u,b:r-h,c:A-u,d:c-h,e:u,f:h},m=F8n(d),_=OV([p,m]);return G8n(_)}function U8n(t,e){function n(){this.constructor=t}n.prototype=e.prototype,t.prototype=new n}function zne(t,e,n,o){var i=Error.call(this,t);return Object.setPrototypeOf&&Object.setPrototypeOf(i,zne.prototype),i.expected=e,i.found=n,i.location=o,i.name="SyntaxError",i}U8n(zne,Error);function V3e(t,e,n){return n=n||" ",t.length>e?t:(e-=t.length,n+=n.repeat(e),t+n.slice(0,e))}zne.prototype.format=function(t){var e="Error: "+this.message;if(this.location){var n=null,o;for(o=0;o<t.length;o++)if(t[o].source===this.location.source){n=t[o].text.split(/\r\n|\n|\r/g);break}var i=this.location.start,r=this.location.source&&typeof this.location.source.offset=="function"?this.location.source.offset(i):i,s=this.location.source+":"+r.line+":"+r.column;if(n){var a=this.location.end,A=V3e("",r.line.toString().length," "),c=n[i.line-1],l=i.line===a.line?a.column:c.length+1,g=l-i.column||1;e+=`
242
242
  --> `+s+`
243
243
  `+A+` |
244
244
  `+r.line+" | "+c+`
@@ -5664,7 +5664,7 @@ test("${c} should solve problem correctly", () => {
5664
5664
  // Add more specific assertions based on expected output
5665
5665
  // expect(solver.netLabelPlacementSolver!.netLabelPlacements).toMatchInlineSnapshot()
5666
5666
  })
5667
- `,g=new Blob([l],{type:"text/plain"}),u=URL.createObjectURL(g),h=document.createElement("a");h.href=u,h.download=`${c}.test.ts`,h.click(),URL.revokeObjectURL(u)}catch(A){alert(`Error generating test.ts for ${t.getSolverName()}: ${A instanceof Error?A.message:String(A)}`)}o(!1)};return V.jsxs("div",{className:`relative ${e}`,ref:i,children:[V.jsx("button",{className:"px-2 py-1 rounded text-xs cursor-pointer",onClick:()=>o(!n),title:`Download options for ${t.getSolverName()}`,children:t.getSolverName()}),n&&V.jsxs("div",{className:"absolute top-full left-0 mt-1 bg-white border border-gray-300 rounded shadow-lg z-10 min-w-[150px]",children:[V.jsx("button",{className:"w-full text-left px-3 py-2 hover:bg-gray-100 text-xs",onClick:r,children:"Download JSON"}),V.jsx("button",{className:"w-full text-left px-3 py-2 hover:bg-gray-100 text-xs",onClick:s,children:"Download page.tsx"}),V.jsx("button",{className:"w-full text-left px-3 py-2 hover:bg-gray-100 text-xs",onClick:a,children:"Download test.ts"})]})]})},Mdn=t=>t.activeSubSolver?[t,...Mdn(t.activeSubSolver)]:[t],jFi=({solver:t})=>{const e=Mdn(t);return V.jsx("div",{className:"flex gap-1 items-center text-sm pt-1",children:e.map((n,o)=>V.jsxs("div",{className:"flex items-center",children:[o>0&&V.jsx("span",{className:"text-gray-400 mx-1",children:"→"}),V.jsx(WFi,{solver:n})]},n.getSolverName()))})},qFi=({solver:t,triggerRender:e,animationSpeed:n=25,renderer:o,onRendererChange:i,onAnimationSpeedChange:r,onDownloadVisualization:s,onSolverStarted:a,onSolverCompleted:A})=>{const[c,l]=te.useReducer(B=>!B,!1),g=te.useRef(void 0),u=te.useRef(null),h="solver-debugger-last-iteration",[d,p]=te.useState(null),m=te.useRef(null),_=te.useMemo(()=>[{label:"Slow",value:250,description:"250ms"},{label:"Normal",value:100,description:"100ms"},{label:"Fast",value:10,description:"10ms"},{label:"Fast (2x)",value:5,description:"5ms"},{label:"Fast (10x)",value:1,description:"1ms"},{label:"Fast 20x",value:.5,description:"2 steps / 1ms"},{label:"Fast 100x",value:.1,description:"10 steps / 1ms"}],[]),f=()=>{const B=Math.max(1,n),S=n<1?Math.round(1/n):1;g.current=setInterval(()=>{if(t.solved||t.failed){g.current&&(clearInterval(g.current),g.current=void 0),l(),e(),A&&t.solved&&A(t);return}for(let Q=0;Q<S&&!(t.solved||t.failed);Q++)t.step();e()},B)},I=()=>{g.current&&(clearInterval(g.current),g.current=void 0)},C=()=>{!t.solved&&!t.failed&&(t.step(),e())},y=()=>{!t.solved&&!t.failed&&(a&&a(t),t.solve(),e(),A&&A(t))},x=()=>{c?(I(),l()):(l(),f())},E=()=>{if(t.solved||t.failed||c)return;u.current===null&&typeof window<"u"&&(u.current=window.localStorage.getItem(h));const B=window.prompt("Step until which iteration?",u.current??`${t.iterations}`);if(B===null)return;u.current=B,typeof window<"u"&&window.localStorage.setItem(h,B);const S=Number(B);if(!Number.isFinite(S)){window.alert("Please enter a valid number for the iteration");return}for(;t.iterations<S&&!t.solved&&!t.failed;)t.step();e(),t.solved&&A&&A(t)};return te.useEffect(()=>()=>{I()},[]),te.useEffect(()=>{(t.solved||t.failed)&&c&&(I(),l())},[t.solved,t.failed,c]),te.useEffect(()=>{c&&(I(),f())},[n,c]),te.useEffect(()=>{if(typeof document>"u")return;const B=S=>{m.current&&!m.current.contains(S.target)&&p(null)};return document.addEventListener("mousedown",B),()=>{document.removeEventListener("mousedown",B)}},[]),V.jsxs("div",{className:"space-y-2 p-2 border-b",children:[V.jsx("div",{className:"flex items-center",children:V.jsxs("div",{className:"flex items-center gap-2",ref:m,children:[V.jsxs("div",{className:"flex h-9 items-center space-x-1 rounded-md border border-slate-200 bg-white p-1 shadow-sm",children:[V.jsxs("div",{className:"relative",children:[V.jsx("button",{type:"button",onClick:()=>p(d==="renderer"?null:"renderer"),className:"flex select-none items-center rounded-sm px-3 py-1 text-sm font-medium outline-none focus:bg-slate-100 data-[state=open]:bg-slate-100","data-state":d==="renderer"?"open":"closed",children:"Renderer"}),d==="renderer"&&V.jsx("div",{className:"absolute left-0 z-50 mt-1 min-w-[10rem] rounded-md border border-slate-200 bg-white p-1 text-slate-950 shadow-md",children:["vector","canvas"].map(B=>V.jsxs("button",{type:"button",onClick:()=>{i(B),p(null)},className:"flex w-full items-center rounded-sm px-2 py-1.5 text-sm hover:bg-slate-100",children:[B==="vector"?"Vector":"Canvas",o===B&&V.jsx("span",{className:"ml-auto text-xs text-slate-500",children:"✓"})]},B))})]}),V.jsxs("div",{className:"relative",children:[V.jsx("button",{type:"button",onClick:()=>p(d==="debug"?null:"debug"),className:"flex select-none items-center rounded-sm px-3 py-1 text-sm font-medium outline-none focus:bg-slate-100 data-[state=open]:bg-slate-100","data-state":d==="debug"?"open":"closed",children:"Debug"}),d==="debug"&&V.jsx("div",{className:"absolute left-0 z-50 mt-1 min-w-[12rem] rounded-md border border-slate-200 bg-white p-1 text-slate-950 shadow-md",children:V.jsx("button",{type:"button",onClick:()=>{s(),p(null)},className:"flex w-full items-center rounded-sm px-2 py-1.5 text-sm hover:bg-slate-100",children:"Download Visualization"})})]}),V.jsxs("div",{className:"relative",children:[V.jsx("button",{type:"button",onClick:()=>p(d==="animation"?null:"animation"),className:"flex select-none items-center rounded-sm px-3 py-1 text-sm font-medium outline-none focus:bg-slate-100 data-[state=open]:bg-slate-100","data-state":d==="animation"?"open":"closed",children:"Animation"}),d==="animation"&&V.jsx("div",{className:"absolute left-0 z-50 mt-1 min-w-[12rem] rounded-md border border-slate-200 bg-white p-1 text-slate-950 shadow-md",children:_.map(B=>V.jsxs("button",{type:"button",onClick:()=>{r(B.value),p(null)},className:"flex w-full items-center rounded-sm px-2 py-1.5 text-sm hover:bg-slate-100",children:[B.label,V.jsx("span",{className:"ml-auto text-xs text-slate-500",children:B.description}),n===B.value&&V.jsx("span",{className:"ml-2 text-xs text-slate-500",children:"✓"})]},B.value))})]})]}),V.jsx(jFi,{solver:t})]})}),V.jsxs("div",{className:"flex gap-2 items-center flex-wrap",children:[V.jsx("button",{onClick:C,disabled:t.solved||t.failed||c,className:"bg-blue-500 hover:bg-blue-600 disabled:bg-gray-300 text-white px-3 py-1 rounded text-sm",children:"Step"}),V.jsx("button",{onClick:y,disabled:t.solved||t.failed||c,className:"bg-green-500 hover:bg-green-600 disabled:bg-gray-300 text-white px-3 py-1 rounded text-sm",children:"Solve"}),V.jsx("button",{onClick:x,disabled:t.solved||t.failed,className:`px-3 py-1 rounded text-white text-sm ${c?"bg-red-500 hover:bg-red-600":"bg-yellow-500 hover:bg-yellow-600"} disabled:bg-gray-300`,children:c?"Stop":"Animate"}),V.jsx("button",{onClick:E,disabled:t.solved||t.failed||c,className:"bg-orange-500 hover:bg-orange-600 disabled:bg-gray-300 text-white px-3 py-1 rounded text-sm",children:"Step Until Iteration"}),V.jsxs("div",{className:"text-sm text-gray-600",children:["Iterations: ",t.iterations]}),t.timeToSolve!==void 0&&V.jsxs("div",{className:"text-sm text-gray-600",children:["Time: ",(t.timeToSolve/1e3).toFixed(3),"s"]}),t.solved&&V.jsx("div",{className:"px-2 py-1 bg-green-100 text-green-800 rounded text-sm",children:"Solved"}),t.failed&&V.jsx("div",{className:"px-2 py-1 bg-red-100 text-red-800 rounded text-sm",children:"Failed"})]}),t.error&&V.jsxs("div",{className:"text-red-600 text-sm",children:["Error: ",t.error]})]})},XFi=t=>t!==null&&"pipelineDef"in t&&Array.isArray(t.pipelineDef),$Fi=(t,e,n)=>{const o=t.currentPipelineStageIndex;return e<o?"Completed":e===o&&t.activeSubSolver?t.activeSubSolver.failed?"Failed":"In Progress":"Not Started"},ZFi=(t,e)=>{const o=t.pipelineDef[e].solverName,i=$Fi(t,e),r=t[o],s=t.firstIterationOfStage?.[o]??(e===t.currentPipelineStageIndex?t.iterations:null),a=t.iterations;let A=0;if(i==="Completed"){const u=t.pipelineDef[e+1],h=u?t.firstIterationOfStage?.[u.solverName]:void 0;h!==void 0&&s!==null?A=h-s:s!==null&&(A=a-s)}else i==="In Progress"&&s!==null&&(A=a-s);const c=t.timeSpentOnStage?.[o]??0;let l=0;i==="Completed"?l=1:i==="In Progress"&&r&&(l=r.progress??0);const g=r?.stats??null;return{index:e,name:o,status:i,firstIteration:s,iterations:A,progress:l,timeSpent:c,stats:g&&Object.keys(g).length>0?g:null,solverInstance:r??null}},eLi=({status:t})=>{const e={"Not Started":"text-blue-600","In Progress":"text-yellow-600",Completed:"text-green-600",Failed:"text-red-600"};return V.jsx("span",{className:`font-medium ${e[t]}`,children:t})},tLi=({progress:t})=>{if(t===0)return null;const e=Math.round(t*100);return V.jsxs("div",{className:"flex items-center gap-2",children:[V.jsx("div",{className:"w-20 h-2 bg-gray-200 rounded overflow-hidden",children:V.jsx("div",{className:"h-full bg-blue-500 transition-all duration-200",style:{width:`${e}%`}})}),V.jsxs("span",{className:"text-xs text-gray-500",children:[e,"%"]})]})},Ddn=t=>{if(typeof t=="string")return t;if(typeof t=="number"||typeof t=="boolean"||typeof t=="bigint"||t==null)return String(t);if(typeof t=="object")try{return JSON.stringify(t)}catch{return String(t)}return String(t)},nLi=t=>Object.entries(t).map(([e,n])=>`${e}: ${Ddn(n)}`).join(", "),oLi=({stats:t})=>{if(!t||Object.keys(t).length===0)return V.jsx("span",{children:"-"});const e=Object.entries(t),n=nLi(t);return V.jsxs("details",{className:"cursor-pointer",children:[V.jsx("summary",{className:"whitespace-nowrap overflow-hidden text-ellipsis max-w-[200px]",children:n}),V.jsx("div",{className:"mt-1 text-xs",children:e.map(([o,i])=>V.jsxs("div",{children:[o,": ",Ddn(i)]},o))})]})},Tje=t=>{if(t===null||typeof t!="object")return t;if(Array.isArray(t))return t.map(Tje);const e={};for(const[n,o]of Object.entries(t))n.startsWith("_")||(e[n]=Tje(o));return e},iLi=(t,e)=>{try{if(typeof t.getConstructorParams!="function"){alert(`getConstructorParams() is not implemented for ${e}`);return}const n=Tje(t.getConstructorParams()),o=new Blob([JSON.stringify(n,null,2)],{type:"application/json"}),i=URL.createObjectURL(o),r=document.createElement("a");r.href=i,r.download=`${e}_input.json`,r.click(),URL.revokeObjectURL(i)}catch(n){alert(`Error downloading input for ${e}: ${n instanceof Error?n.message:String(n)}`)}},rLi=({expanded:t})=>V.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",className:`w-4 h-4 transition-transform duration-200 ${t?"rotate-90":""}`,children:V.jsx("path",{fillRule:"evenodd",d:"M4.5 5.653c0-1.426 1.529-2.33 2.779-1.643l11.54 6.348c1.295.712 1.295 2.573 0 3.285L7.28 19.991c-1.25.687-2.779-.217-2.779-1.643V5.653z",clipRule:"evenodd"})}),Ndn=t=>{let e=t;for(;e.activeSubSolver;)e=e.activeSubSolver;return e},Rdn=({solver:t,onStepUntilPhase:e,onDownloadInput:n,isNested:o=!1,indentLevel:i=0,triggerRender:r})=>{const[s,a]=te.useState(new Set),A=t.pipelineDef.map((m,_)=>ZFi(t,_)),c=m=>{a(_=>{const f=new Set(_);return f.has(m)?f.delete(m):f.add(m),f})},l=m=>{e?.(m)},g=m=>{m.solverInstance&&(n?n(m.solverInstance,m.name):iLi(m.solverInstance,m.name))},u=m=>`${(m/1e3).toFixed(2)}s`,h=()=>{if(!t.solved&&!t.failed){const m=t.activeSubSolver;for(;!t.solved&&!t.failed&&(t.step(),!(t.activeSubSolver&&t.activeSubSolver!==m)););r?.()}},d=()=>{if(!t.solved&&!t.failed){const m=Ndn(t);for(;!t.solved&&!t.failed&&(t.step(),Ndn(t)===m););r?.()}},p=i*24;return V.jsxs("div",{className:o?"":"border-t border-gray-200",children:[!o&&V.jsxs("div",{className:"px-4 py-2 bg-gray-50 border-b border-gray-200 flex items-center justify-between",children:[V.jsx("h3",{className:"text-sm font-semibold text-gray-700",children:"Pipeline Stages"}),V.jsxs("div",{className:"flex gap-2",children:[V.jsx("button",{onClick:d,disabled:t.solved||t.failed,className:"bg-indigo-500 hover:bg-indigo-600 disabled:bg-gray-300 disabled:cursor-not-allowed cursor-pointer text-white px-3 py-1 rounded text-sm",children:"Next Solver"}),V.jsx("button",{onClick:h,disabled:t.solved||t.failed,className:"bg-purple-500 hover:bg-purple-600 disabled:bg-gray-300 disabled:cursor-not-allowed cursor-pointer text-white px-3 py-1 rounded text-sm",children:"Next Stage"})]})]}),V.jsx("div",{className:"overflow-x-auto",children:V.jsxs("table",{className:"w-full text-sm",children:[!o&&V.jsx("thead",{children:V.jsxs("tr",{className:"bg-gray-50 border-b border-gray-200",children:[V.jsx("th",{className:"px-4 py-2 text-left font-semibold text-gray-700",children:"Stage"}),V.jsx("th",{className:"px-4 py-2 text-left font-semibold text-gray-700",children:"Status"}),V.jsxs("th",{className:"px-4 py-2 text-center font-semibold text-gray-700",children:["i",V.jsx("sub",{children:"0"})]}),V.jsx("th",{className:"px-4 py-2 text-left font-semibold text-gray-700",children:"Iterations"}),V.jsx("th",{className:"px-4 py-2 text-left font-semibold text-gray-700",children:"Progress"}),V.jsx("th",{className:"px-4 py-2 text-left font-semibold text-gray-700",children:"Time"}),V.jsx("th",{className:"px-4 py-2 text-left font-semibold text-gray-700",children:"Stats"}),V.jsx("th",{className:"px-4 py-2 text-left font-semibold text-gray-700",children:"Input"})]})}),V.jsx("tbody",{children:A.map(m=>{const _=XFi(m.solverInstance),f=s.has(m.name);return V.jsxs(ks.Fragment,{children:[V.jsxs("tr",{className:`border-b border-gray-100 ${m.status==="In Progress"?"bg-yellow-50":""}`,children:[V.jsx("td",{className:"px-4 py-2",children:V.jsxs("div",{className:"flex items-center gap-2",style:{paddingLeft:p},children:[_?V.jsx("button",{onClick:()=>c(m.name),className:"text-gray-500 hover:text-gray-700",title:f?"Collapse":"Expand",children:V.jsx(rLi,{expanded:f})}):V.jsx("span",{className:"w-4"}),V.jsx("span",{className:"text-gray-400 w-6",children:String(m.index+1).padStart(2,"0")}),V.jsx("button",{onClick:()=>l(m.name),disabled:m.status==="Completed"||t.solved||t.failed,className:"text-blue-500 hover:text-blue-700 disabled:text-gray-300 disabled:cursor-not-allowed",title:`Step until ${m.name} completes`,children:V.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",className:"w-4 h-4",children:V.jsx("path",{fillRule:"evenodd",d:"M4.5 5.653c0-1.426 1.529-2.33 2.779-1.643l11.54 6.348c1.295.712 1.295 2.573 0 3.285L7.28 19.991c-1.25.687-2.779-.217-2.779-1.643V5.653z",clipRule:"evenodd"})})}),V.jsx("span",{className:"font-medium text-gray-900",children:m.name})]})}),V.jsx("td",{className:"px-4 py-2",children:V.jsx(eLi,{status:m.status})}),V.jsx("td",{className:"px-4 py-2 text-center text-gray-600",children:m.firstIteration!==null?m.firstIteration:""}),V.jsx("td",{className:"px-4 py-2 text-gray-600",children:m.iterations}),V.jsx("td",{className:"px-4 py-2",children:V.jsx(tLi,{progress:m.progress})}),V.jsx("td",{className:"px-4 py-2 text-gray-600",children:u(m.timeSpent)}),V.jsx("td",{className:"px-4 py-2 text-gray-500",children:V.jsx(oLi,{stats:m.stats})}),V.jsx("td",{className:"px-4 py-2",children:m.solverInstance?V.jsxs("button",{onClick:()=>g(m),className:"flex items-center gap-1 text-blue-500 hover:text-blue-700",title:`Download input for ${m.name}`,children:[V.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",className:"w-4 h-4",children:V.jsx("path",{fillRule:"evenodd",d:"M12 2.25a.75.75 0 01.75.75v11.69l3.22-3.22a.75.75 0 111.06 1.06l-4.5 4.5a.75.75 0 01-1.06 0l-4.5-4.5a.75.75 0 111.06-1.06l3.22 3.22V3a.75.75 0 01.75-.75zm-9 13.5a.75.75 0 01.75.75v2.25a1.5 1.5 0 001.5 1.5h13.5a1.5 1.5 0 001.5-1.5V16.5a.75.75 0 011.5 0v2.25a3 3 0 01-3 3H5.25a3 3 0 01-3-3V16.5a.75.75 0 01.75-.75z",clipRule:"evenodd"})}),V.jsx("span",{children:"Input"})]}):null})]}),_&&f&&V.jsx("tr",{children:V.jsx("td",{colSpan:8,className:"p-0",children:V.jsx(Rdn,{solver:m.solverInstance,onStepUntilPhase:e,onDownloadInput:n,isNested:!0,indentLevel:i+1,triggerRender:r})})})]},m.name)})})]})})]})};function sLi({graphics:t}){const e=t.points??[],n=t.lines??[],o=t.rects??[],i=t.circles??[],r=t.texts??[];let s=Number.POSITIVE_INFINITY,a=Number.POSITIVE_INFINITY,A=Number.NEGATIVE_INFINITY,c=Number.NEGATIVE_INFINITY;const l=(m,_)=>{typeof m=="number"&&(m<s&&(s=m),m>A&&(A=m)),typeof _=="number"&&(_<a&&(a=_),_>c&&(c=_))};for(const m of e)l(m.x,m.y);for(const m of n){const _=m.points??[];for(const f of _)l(f.x,f.y)}for(const m of o){const _=m.x??0,f=m.y??0,I=m.width??0,C=m.height??0;l(_,f),l(_+I,f+C)}for(const m of i){const _=m.x??0,f=m.y??0,I=m.radius??1;l(_-I,f-I),l(_+I,f+I)}for(const m of r)l(m.x,m.y);(!isFinite(s)||!isFinite(a)||!isFinite(A)||!isFinite(c))&&(s=-20,a=-20,A=20,c=20);const g=10,u=s-g,h=a-g,d=Math.max(1,A-s+2*g),p=Math.max(1,c-a+2*g);return V.jsxs("svg",{className:"w-full h-[400px] bg-white",viewBox:`${u} ${h} ${d} ${p}`,role:"img","aria-label":"Graphics fallback",children:[o.map((m,_)=>V.jsx("rect",{x:m.x??0,y:m.y??0,width:m.width??0,height:m.height??0,fill:"none",stroke:m.strokeColor??"black",strokeWidth:m.strokeWidth??1},`rect-${_}`)),n.map((m,_)=>V.jsx("polyline",{fill:"none",stroke:m.strokeColor??"black",strokeWidth:m.strokeWidth??1,points:(m.points??[]).map(f=>`${f.x??0},${f.y??0}`).join(" ")},`line-${_}`)),i.map((m,_)=>V.jsx("circle",{cx:m.x??0,cy:m.y??0,r:m.radius??1.5,fill:m.fillColor??"none",stroke:m.strokeColor??"black",strokeWidth:m.strokeWidth??1},`circle-${_}`)),e.map((m,_)=>V.jsx("circle",{cx:m.x??0,cy:m.y??0,r:m.radius??1.5,fill:m.color??"black"},`point-${_}`)),r.map((m,_)=>V.jsx("text",{x:m.x??0,y:m.y??0,fontSize:m.fontSize??10,fill:m.color??"black",children:m.text??""},`text-${_}`))]})}var aLi=class extends ks.Component{constructor(t){super(t),this.state={hasError:!1}}static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(t){console.error("InteractiveGraphics render error:",t)}render(){return this.state.hasError?this.props.fallback:this.props.children}},ALi=({solver:t,createSolver:e,animationSpeed:n=25,onSolverStarted:o,onSolverCompleted:i})=>{const[r,s]=te.useReducer(f=>f+1,0),[a]=te.useState(()=>{if(e)return e();if(!t)throw new Error("GenericSolverDebugger requires solver or createSolver");return t}),[A,c]=te.useState(()=>typeof window>"u"?"vector":window.localStorage.getItem("solver-utils-renderer")==="canvas"?"canvas":"vector"),[l,g]=te.useState(n),u=te.useMemo(()=>{try{return a.visualize()||{points:[],lines:[],rects:[],circles:[]}}catch(f){return console.error("Visualization error:",f),{points:[],lines:[],rects:[],circles:[]}}},[a,r]),h=te.useMemo(()=>(u.rects?.length||0)===0&&(u.lines?.length||0)===0&&(u.points?.length||0)===0&&(u.circles?.length||0)===0,[u]);te.useEffect(()=>{if(!(typeof document>"u")&&!document.querySelector('script[src="https://cdn.jsdelivr.net/npm/@tailwindcss/browser@4"]')){const f=document.createElement("script");f.src="https://cdn.jsdelivr.net/npm/@tailwindcss/browser@4",document.head.appendChild(f)}},[]),te.useEffect(()=>{g(n)},[n]);const d=a.pipelineDef!==void 0,p=f=>{const I=a;if(!a.solved&&!a.failed){for(;!a.solved&&!a.failed&&I.currentPipelineStageIndex<=I.pipelineDef.findIndex(C=>C.solverName===f);)a.step();s()}},m=()=>{const f=JSON.stringify(u,null,2),I=new Blob([f],{type:"application/json"}),C=URL.createObjectURL(I),y=document.createElement("a");y.download="visualization.json",y.href=C,document.body.appendChild(y),y.click(),document.body.removeChild(y),URL.revokeObjectURL(C)},_=f=>{c(f),typeof window<"u"&&window.localStorage.setItem("solver-utils-renderer",f)};return V.jsxs("div",{children:[V.jsx(qFi,{solver:a,triggerRender:s,animationSpeed:l,renderer:A,onRendererChange:_,onAnimationSpeedChange:g,onDownloadVisualization:m,onSolverStarted:o,onSolverCompleted:i}),h?V.jsx("div",{className:"p-4 text-gray-500",children:"No Graphics Yet"}):V.jsx(aLi,{fallback:V.jsx(sLi,{graphics:u}),children:A==="canvas"?V.jsx(JFi,{graphics:u}):V.jsx(KFi,{graphics:u})}),d&&V.jsx(Rdn,{solver:a,onStepUntilPhase:p,triggerRender:s})]})};const cLi=()=>{te.useEffect(()=>{const t="tailwind-cdn-script";if(document.getElementById(t)||window.tailwind)return;const e=document.createElement("div");e.className="hidden",document.body.appendChild(e);const n=window.getComputedStyle(e).display==="none";if(document.body.removeChild(e),n)return;const o=document.createElement("script");o.id=t,o.src="https://cdn.tailwindcss.com",document.head.appendChild(o)},[])},lLi=1e3,EE=(t,e)=>{const{fileName:n,mimeType:o="text/plain"}=e,i=t instanceof Blob?t:new Blob([t],{type:o}),r=URL.createObjectURL(i),s=document.createElement("a");s.href=r,s.download=n,s.target="_blank",s.rel="noopener noreferrer",s.style.display="none",document.body.appendChild(s),s.click(),document.body.removeChild(s),setTimeout(()=>{URL.revokeObjectURL(r)},lLi)},kje=t=>{let e=t.trim().replace(/[\\/:*?"<>|]/g,"_").replace(/[\x00-\x1f]/g,"").replace(/^\.+/,"").replace(/\.+$/,"").replace(/\s+/g," ").replace(/_+/g,"_");return/^(con|prn|aux|nul|com[0-9]|lpt[0-9])$/i.test(e)&&(e=`_${e}`),e=e.slice(0,200),e||"untitled"},gLi=t=>{const e=t.solverConstructorArgs??[t.solverParams];if(t.solverName!=="AutoroutingPipelineSolver7_MultiGraph"||e.length!==1)return e;const[{input:n,options:o}]=e;return[n,o]},J6="https://github.com/tscircuit/tscircuit-autorouter/issues/new",Tdn="https://github.com/tscircuit/copper-pour-solver/issues/new",kdn="https://github.com/tscircuit/calculate-packing/issues/new",uLi="https://github.com/tscircuit/matchpack/issues/new",Fdn="https://github.com/tscircuit/schematic-trace-solver/issues/new?template=json-bug-report.yml",dLi={PackSolver2:kdn,LayoutPipelineSolver:uLi,AutoroutingPipelineSolver:J6,AssignableAutoroutingPipeline2:J6,AssignableAutoroutingPipeline3:J6,AutoroutingPipeline1_OriginalUnravel:J6,AutoroutingPipelineSolver3_HgPortPointPathing:J6,AutoroutingPipelineSolver4:J6,AutoroutingPipelineSolver5:J6,AutoroutingPipelineSolver7_MultiGraph:J6,AutoroutingPipelineSolver8:J6,CopperPourPipelineSolver:Tdn,SchematicTracePipelineSolver:Fdn},hLi=t=>t.toLowerCase().includes("pack")?d7i:t.toLowerCase().includes("rout")?NAn:r7i,Ldn=t=>{const e=dLi[t];if(e)return e;const n=t.toLowerCase();return n.includes("autorout")?J6:n.includes("schematic")&&n.includes("trace")?Fdn:n.includes("copperpour")?Tdn:n.includes("pack")?kdn:null},pLi=t=>`${kje(`${t.componentName}-${t.solverName}`)}-solver-input.json`,Hdn=t=>{EE(JSON.stringify(t.solverParams,null,2),{fileName:pLi(t),mimeType:"application/json"})},mLi=({solverEvent:t})=>{const e=Ldn(t.solverName);return V.jsxs("div",{className:"rf-flex rf-items-center rf-justify-end rf-gap-2 rf-border-b rf-border-gray-200 rf-bg-gray-50 rf-px-4 rf-py-2",children:[V.jsxs(Zc,{type:"button",variant:"outline",size:"sm",onClick:()=>Hdn(t),children:[V.jsx(V$,{className:"rf-w-4 rf-h-4"}),"Download"]}),e?V.jsx(Zc,{asChild:!0,variant:"outline",size:"sm",children:V.jsxs("a",{href:e,target:"_blank",rel:"noopener noreferrer",children:[V.jsx(Ope,{className:"rf-w-4 rf-h-4"}),"Report"]})}):V.jsxs(Zc,{type:"button",variant:"outline",size:"sm",disabled:!0,title:"No report link configured for this solver",children:[V.jsx(Ope,{className:"rf-w-4 rf-h-4"}),"Report"]})]})},_Li=({solverEvent:t})=>{const e=Ldn(t.solverName);return e?V.jsx(Zc,{asChild:!0,variant:"ghost",size:"icon",className:"rf-h-8 rf-w-8",children:V.jsx("a",{href:e,target:"_blank",rel:"noopener noreferrer",title:"Report solver bug","aria-label":"Report solver bug",children:V.jsx(Ope,{className:"rf-w-4 rf-h-4"})})}):V.jsx(Zc,{type:"button",variant:"ghost",size:"icon",className:"rf-h-8 rf-w-8",disabled:!0,title:"No report link configured for this solver","aria-label":"Report solver bug",children:V.jsx(Ope,{className:"rf-w-4 rf-h-4"})})},fLi=({solverEvents:t=[]})=>{const[e,n]=te.useState(null);cLi();const o=te.useMemo(()=>{const a=new Map;for(const A of t){const c=`${A.componentName}-${A.solverName}`;a.set(c,A)}return a},[t]),i=te.useMemo(()=>Array.from(o.keys()),[o]),r=e?o.get(e):null,s=te.useMemo(()=>{if(!r)return{instance:null,error:null,classFound:!1};const a=QRe[r.solverName];if(!a)return{instance:null,error:`Solver class "${r.solverName}" not found in SOLVERS registry. Available: ${Object.keys(QRe).join(", ")}`,classFound:!1};try{return{instance:new a(...gLi(r)),error:null,classFound:!0}}catch(A){const c=A instanceof Error?A.message:String(A);return console.error("Failed to reconstruct solver:",A),{instance:null,error:`Failed to instantiate solver: ${c}`,classFound:!0}}},[r]);return t.length===0?V.jsx("div",{className:"rf-p-4",children:V.jsx("div",{className:"rf-bg-gray-50 rf-rounded-md rf-border rf-border-gray-200",children:V.jsxs("div",{className:"rf-p-4",children:[V.jsx("h3",{className:"rf-text-lg rf-font-semibold rf-text-gray-800 rf-mb-3",children:"No Solvers Detected"}),V.jsx("p",{className:"rf-text-sm rf-text-gray-600",children:"Solvers will appear here when the circuit runs. Solvers are used for tasks like component packing and autorouting."})]})})}):V.jsxs("div",{className:"rf-flex rf-h-full rf-overflow-hidden",children:[V.jsxs("div",{className:"rf-w-64 rf-border-r rf-border-gray-200 rf-overflow-y-auto rf-flex-shrink-0",children:[V.jsxs("div",{className:"rf-text-xs rf-font-semibold rf-text-gray-500 rf-px-3 rf-py-2 rf-bg-gray-50 rf-border-b rf-border-gray-200",children:[i.length," ",i.length===1?"Solver":"Solvers"]}),i.map(a=>{const A=o.get(a),c=e===a;return V.jsx("div",{className:`rf-px-3 rf-py-2 rf-cursor-pointer rf-border-b rf-border-gray-100 ${c?"rf-bg-blue-50 rf-border-l-2 rf-border-l-blue-500":"hover:rf-bg-gray-50"}`,onClick:()=>n(a),children:(()=>{const l=hLi(A.solverName);return V.jsxs("div",{className:"rf-flex rf-items-center rf-gap-2",children:[V.jsx(l,{className:"rf-w-4 rf-h-4 rf-text-blue-500 rf-flex-shrink-0"}),V.jsxs("div",{className:"rf-flex-1 rf-min-w-0",children:[V.jsx("div",{className:"rf-text-sm rf-font-medium rf-text-gray-800 rf-truncate",children:A.componentName}),V.jsx("div",{className:"rf-text-xs rf-text-gray-500 rf-truncate",children:A.solverName})]})]})})()},a)})]}),V.jsx("div",{className:"rf-flex-1 rf-overflow-hidden",children:r?s.instance?V.jsxs("div",{className:"rf-flex rf-h-full rf-flex-col rf-overflow-y-auto",children:[V.jsx(mLi,{solverEvent:r}),V.jsx("div",{className:"rf-min-h-0 rf-flex-1",children:V.jsx(KB,{fallback:V.jsx("div",{className:"rf-p-4",children:V.jsxs("div",{className:"rf-bg-red-50 rf-rounded-md rf-border rf-border-red-200 rf-p-4",children:[V.jsx("h3",{className:"rf-text-lg rf-font-semibold rf-text-red-800 rf-mb-2",children:"Error Loading Solver Debugger"}),V.jsxs("p",{className:"rf-text-sm rf-text-red-600",children:["Failed to render the solver debugger for"," ",r.solverName]})]})}),children:V.jsx(ALi,{solver:s.instance})})})]}):V.jsxs("div",{className:"rf-p-4",children:[V.jsxs("div",{className:"rf-mb-4",children:[V.jsx("h3",{className:"rf-text-lg rf-font-semibold rf-text-gray-800",children:r.solverName}),V.jsxs("p",{className:"rf-text-sm rf-text-gray-500",children:["Component: ",r.componentName]})]}),s.error&&V.jsx("div",{className:`rf-rounded-md rf-border rf-p-4 rf-mb-4 ${s.classFound?"rf-bg-red-50 rf-border-red-200":"rf-bg-yellow-50 rf-border-yellow-200"}`,children:V.jsx("p",{className:`rf-text-sm ${s.classFound?"rf-text-red-700":"rf-text-yellow-700"}`,children:s.error})}),V.jsxs("div",{className:"rf-border rf-border-gray-200 rf-rounded-md rf-overflow-hidden",children:[V.jsxs("div",{className:"rf-px-3 rf-py-2 rf-bg-gray-50 rf-flex rf-items-center rf-justify-between rf-gap-2",children:[V.jsx("span",{className:"rf-text-sm rf-font-medium rf-text-gray-700",children:"Solver Parameters"}),V.jsxs("div",{className:"rf-flex rf-items-center rf-gap-1",children:[V.jsx(_Li,{solverEvent:r}),V.jsx(Zc,{type:"button",variant:"ghost",size:"icon",className:"rf-h-8 rf-w-8","aria-label":"Download solver input JSON",title:"Download solver input JSON",onClick:()=>Hdn(r),children:V.jsx(V$,{className:"rf-w-4 rf-h-4"})})]})]}),V.jsx("div",{className:"rf-p-3 rf-bg-white rf-border-t rf-border-gray-200",children:V.jsx("pre",{className:"rf-text-xs rf-font-mono rf-text-gray-600 rf-whitespace-pre-wrap rf-overflow-x-auto",children:JSON.stringify(r.solverParams,null,2)})})]})]}):V.jsx("div",{className:"rf-flex rf-items-center rf-justify-center rf-h-full",children:V.jsx("p",{className:"rf-text-sm rf-text-gray-500",children:"Select a solver from the list to view details"})})})]})},ILi=new Map([["custom","Custom"],["fanout","Fanout"],["single_layer_fanout","Single layer fanout"],["tscircuit_simplify","Simplify"]]),CLi=new Set(["tscircuit","default","auto","auto_local"]);function yLi(t){if(t==="FanoutSolver")return"Fanout";if(t==="AutoroutingPipelineSolver11_Simplification")return"Simplify";const e=t.match(/^AutoroutingPipeline(?:Solver)?(\d+)(?:_|$)/);if(e)return`Pipeline${e[1]}`;const n=t.match(/^AssignableAutoroutingPipeline(\d+)$/);return n?`Assignable${n[1]}`:t}function xLi(t){const e=t.autorouterName?.trim(),n=e?.replace(/-/g,"_"),o=n&&ILi.get(n);if(o)return o;if(n&&!CLi.has(n))return e;const i=t.solverName?.trim();if(i)return yLi(i);const r=t.autorouterVersion?.trim();if(r){const s=r.match(/^beta[_-]pipeline(\d+)$/);return s?`Pipeline${s[1]}`:r==="latest"?"default":r}return e?"default":"Unknown"}const Fje="#fbbf24";function ELi(t){const e=t.endSimpleRouteJson?.traces??[],n=new Set(e.flatMap(i=>[i.pcb_trace_id,i.__replaces_pcb_trace_id].filter(r=>r!==void 0)));return[...(t.startSimpleRouteJson?.traces??[]).filter(i=>!n.has(i.pcb_trace_id)),...e]}function Odn(t){const e=new Map((t.startSimpleRouteJson?.traces??[]).map(n=>[n.pcb_trace_id,n]));return(t.endSimpleRouteJson?.traces??[]).filter(n=>{const o=e.get(n.pcb_trace_id);return!o||!!n.__replaces_pcb_trace_id&&n.__replaces_pcb_trace_id!==o.__replaces_pcb_trace_id||JSON.stringify(o.route)!==JSON.stringify(n.route)}).map(n=>n.pcb_trace_id)}function BLi(t,e){return{outer_diameter:t.via_diameter??e.minViaPadDiameter??e.min_via_pad_diameter??e.minViaDiameter??.6,hole_diameter:t.via_hole_diameter??e.minViaHoleDiameter??e.min_via_hole_diameter??.3}}function Gdn(t,e){const n=[];for(const a of t.route)a.route_type==="wire"?n.push({...a,layer:a.layer}):a.route_type==="via"?n.push({route_type:"via",x:a.x,y:a.y,from_layer:a.from_layer,to_layer:a.to_layer,...BLi(a,e)}):a.route_type==="through_obstacle"&&n.push({route_type:"through_pad",start:{...a.start},end:{...a.end},width:a.width,start_layer:a.from_layer,end_layer:a.to_layer,pcb_smtpad_id:a.circuitJsonMetadata?.pcb_smtpad_id,pcb_plated_hole_id:a.circuitJsonMetadata?.pcb_plated_hole_id});const o=a=>{let A=-1,c=Number.POSITIVE_INFINITY;return n.forEach((l,g)=>{if(l.route_type!=="wire")return;const u=Math.hypot(l.x-a.x,l.y-a.y);u<c&&(c=u,A=g)}),A},i=t.route.filter(a=>a.route_type==="jumper").map(a=>[o(a.start),o(a.end)].sort((A,c)=>A-c)).filter(([a,A])=>a>=0&&A>a).sort(([a],[A])=>a-A),r=[];let s=0;for(const[a,A]of i)a>=s&&r.push(n.slice(s,a+1)),s=Math.max(s,A);return s<n.length&&r.push(n.slice(s)),r}function bLi(t){const e=[],n=[],o=t.endSimpleRouteJson;if(!o)return{lines:e,circles:n};const i=new Set(Odn(t));for(const r of o.traces??[])if(i.has(r.pcb_trace_id))for(const s of Gdn(r,o)){let a;for(const A of s){if(A.route_type==="through_pad"){a={...A.end,layer:A.end_layer,width:A.width};continue}const c=A.route_type==="wire"?A.layer:A.from_layer;a&&a.layer===c&&(a.x!==A.x||a.y!==A.y)&&e.push({points:[{x:a.x,y:a.y},{x:A.x,y:A.y}],strokeWidth:A.route_type==="wire"?A.width:a.width,strokeColor:Fje,layer:c}),A.route_type==="via"&&n.push({center:{x:A.x,y:A.y},radius:A.outer_diameter/2,stroke:Fje,fill:"transparent"}),a={x:A.x,y:A.y,layer:A.route_type==="wire"?A.layer:A.to_layer,width:A.route_type==="wire"?A.width:a?.width??o.minTraceWidth}}}return{coordinateSystem:"cartesian",lines:e,circles:n}}function SLi(t){const e=JSON.stringify(t);let n=2166136261;for(let o=0;o<e.length;o++)n=Math.imul(n^e.charCodeAt(o),16777619);return(n>>>0).toString(36)}const QLi=new Set(["pcb_trace","pcb_via","pcb_copper_pour","pcb_ground_plane","pcb_ground_plane_region","pcb_thermal_spoke","pcb_breakout_point"]);function vLi(t,e,n){const o=n==="input"?e.startSimpleRouteJson??e.errorSimpleRouteJson:e.endSimpleRouteJson,i=t.filter(c=>!QLi.has(c.type)&&!c.type.endsWith("_error")&&!c.type.endsWith("_warning"));if(!o)return i;const r=n==="input"?o.traces??[]:ELi(e),s=new Set(t.filter(c=>c.type==="source_trace").map(c=>c.source_trace_id)),a=["top",...Array.from({length:Math.max(0,o.layerCount-2)},(c,l)=>`inner${l+1}`),...o.layerCount>1?["bottom"]:[]],A=[];for(const c of r){const g=o.connections.find(h=>h.name===c.connection_name||h.source_trace_id===c.connection_name)?.source_trace_id??c.connection_name??"",u=Gdn(c,o);for(const[h,d]of u.entries()){const p={type:"pcb_trace",pcb_trace_id:`${e.id}_${n}_${c.pcb_trace_id}_${h}_${SLi(d)}`,subcircuit_id:e.subcircuit_id??void 0,source_trace_id:s.has(g)?g:void 0,route:d};A.push(p);for(const[m,_]of d.entries()){if(_.route_type!=="via")continue;const f=a.indexOf(_.from_layer),I=a.indexOf(_.to_layer),C={type:"pcb_via",pcb_via_id:`${p.pcb_trace_id}_via_${m}`,pcb_trace_id:p.pcb_trace_id,subcircuit_id:e.subcircuit_id??void 0,x:_.x,y:_.y,outer_diameter:_.outer_diameter,hole_diameter:_.hole_diameter,layers:f>=0&&I>=0?a.slice(Math.min(f,I),Math.max(f,I)+1):[_.from_layer,_.to_layer]};A.push(C)}}}return[...i,...A]}const Lje=(t,e)=>t.phaseName||`Phase ${t.phaseOrdinal??e+1}`,Ydn=t=>t.componentDisplayName?.match(/name="([^"]+)"/)?.[1]?.replace(/^\./,"")||t.componentDisplayName||t.subcircuit_id||"Board",Udn=t=>t.startSimpleRouteJson??t.endSimpleRouteJson??t.errorSimpleRouteJson,wLi={is_showing_autorouting:!0,is_showing_rats_nest:!1,is_showing_drc_errors:!1,is_showing_drc_warnings:!1,is_showing_pcb_groups:!1},PLi=({circuitJson:t,phases:e=[],isRunning:n=!1})=>{const[o,i]=te.useState(null),[r,s]=te.useState("output"),[a,A]=te.useState(!0),[c,l]=te.useState(!1),g=te.useRef(null),[u,h]=te.useState(480),d=o?e.findIndex(R=>R.id===o.id&&Udn(R)===Udn(o)):-1,p=d<0?e.length-1:d,m=e[p],_=d<0,f=!!m?.endSimpleRouteJson,I=m?.startSimpleRouteJson??m?.errorSimpleRouteJson,C=!!I,y=r==="output"&&!f?"input":r==="input"&&!C?"output":r,x=y==="input"?I:m?.endSimpleRouteJson,E=te.useMemo(()=>!m||!x?null:vLi(t??[],m,y),[t,m,x,y]),B=te.useMemo(()=>m&&y==="output"&&a?bLi(m):{lines:[],circles:[]},[m,y,a]);if(te.useLayoutEffect(()=>{const R=g.current;if(!R)return;const F=()=>h(Math.max(360,R.clientHeight));F();const O=new ResizeObserver(F);return O.observe(R),()=>O.disconnect()},[!!m]),!m)return V.jsxs("div",{className:"rf-flex rf-min-h-[400px] rf-flex-col rf-items-center rf-justify-center rf-gap-3 rf-p-8 rf-text-center",children:[V.jsx(NAn,{className:"rf-h-7 rf-w-7 rf-text-blue-500"}),V.jsx("h3",{className:"rf-text-base rf-font-medium",children:n?"Waiting for autorouting":"No autorouting captures"}),V.jsx("p",{className:"rf-max-w-md rf-text-sm rf-text-gray-500",children:n?"Phases appear as the circuit routes. Each capture includes its input and output on the PCB.":"Run a circuit with autorouting enabled to inspect its phases. A circuit JSON file alone does not include routing history."})]});const S=Lje(m,p),Q=m.status==="running"&&n,w=!f,M=I?.connections.length,k=E?.filter(R=>R.type==="pcb_trace").length??0;return V.jsxs("div",{className:"rf-flex rf-h-full rf-min-h-[620px] rf-flex-col rf-bg-white md:rf-flex-row","data-testid":"autorouting-explorer",children:[V.jsxs("aside",{className:"rf-flex rf-shrink-0 rf-flex-col rf-border-b rf-border-gray-200 md:rf-w-52 md:rf-border-b-0 md:rf-border-r","aria-label":"Routing phases",children:[V.jsxs("div",{className:"rf-flex rf-items-center rf-justify-between rf-px-3 rf-py-2 rf-text-xs rf-text-gray-500",children:[V.jsx("span",{children:"Routing phases"}),V.jsx("span",{children:e.length})]}),V.jsx("div",{className:"rf-flex rf-gap-1 rf-overflow-x-auto rf-px-1.5 rf-pb-1.5 md:rf-flex-col md:rf-overflow-x-hidden md:rf-overflow-y-auto",children:e.map((R,F)=>{const O=Odn(R).length,U=R.endSimpleRouteJson?`${O} ${O===1?"trace":"traces"} routed`:R.status==="error"?"Failed":R.status==="running"&&n?"Routing…":"No output";return V.jsxs("button",{type:"button","aria-pressed":F===p,title:`${Ydn(R)} · ${U}`,onClick:()=>i(R),className:zr("rf-flex rf-min-w-[192px] rf-items-start rf-gap-2 rf-rounded-md rf-border rf-px-2 rf-py-2 rf-text-left md:rf-min-w-0",F===p?"rf-border-blue-200 rf-bg-blue-50":"rf-border-transparent hover:rf-bg-gray-50"),children:[V.jsx("span",{className:zr("rf-flex rf-h-5 rf-w-5 rf-shrink-0 rf-items-center rf-justify-center rf-rounded-full rf-text-[11px]",F===p?"rf-bg-blue-600 rf-text-white":"rf-bg-gray-100 rf-text-gray-500"),children:F+1}),V.jsxs("span",{className:"rf-min-w-0 rf-flex-1",children:[V.jsxs("span",{className:"rf-flex rf-items-center rf-gap-1",children:[V.jsx("span",{className:"rf-min-w-0 rf-flex-1 rf-truncate rf-text-xs rf-font-medium rf-leading-5 rf-text-gray-800",title:Lje(R,F),children:Lje(R,F)}),R.status==="complete"?V.jsx(K$,{"aria-label":"Captured",className:"rf-h-3 rf-w-3 rf-shrink-0 rf-text-green-600"}):R.status==="error"?V.jsx($ze,{"aria-label":"Failed",className:"rf-h-3 rf-w-3 rf-shrink-0 rf-text-red-500"}):n?V.jsx(a4,{"aria-label":"Routing",className:"rf-h-3 rf-w-3 rf-shrink-0 rf-animate-spin rf-text-blue-500"}):null]}),V.jsxs("span",{className:"rf-block rf-text-[11px] rf-leading-4 rf-text-gray-500",children:[xLi(R)," · ",U]})]})]},R.id)})})]}),V.jsxs("div",{className:"rf-flex rf-min-w-0 rf-flex-1 rf-flex-col",children:[V.jsxs("div",{className:"rf-flex rf-flex-wrap rf-items-center rf-gap-3 rf-border-b rf-border-gray-200 rf-px-4 rf-py-3",children:[V.jsxs("h3",{className:"rf-mr-auto rf-flex rf-items-center rf-gap-2 rf-text-sm rf-font-medium",children:[S,V.jsxs("span",{className:"rf-text-xs rf-font-normal rf-text-gray-500",children:[p+1," of ",e.length]})]}),n&&V.jsx("button",{type:"button",onClick:()=>i(null),disabled:_,className:"rf-text-xs rf-text-blue-600 disabled:rf-text-gray-500",children:_?"Following latest":"Follow latest"}),V.jsx("div",{className:"rf-flex rf-rounded-md rf-bg-gray-100 rf-p-1","aria-label":"Phase snapshot",children:["input","output"].map(R=>V.jsx("button",{type:"button","aria-pressed":y===R,disabled:R==="input"?!C:!f,onClick:()=>s(R),className:zr("rf-rounded rf-px-3 rf-py-1 rf-text-xs disabled:rf-opacity-40",y===R?"rf-bg-white rf-text-gray-900 rf-shadow-sm":"rf-text-gray-500"),children:R==="input"?"Input":"Output"},R))})]}),V.jsxs("div",{className:"rf-flex rf-flex-wrap rf-items-center rf-justify-between rf-gap-2 rf-px-4 rf-py-2 rf-text-xs rf-text-gray-600",children:[V.jsxs("label",{className:"rf-flex rf-items-center rf-gap-2",children:[V.jsx("input",{type:"checkbox",checked:a,disabled:y!=="output",onChange:R=>A(R.target.checked),className:"rf-accent-blue-600"}),V.jsx("span",{"aria-hidden":"true",className:"rf-inline-block rf-h-0.5 rf-w-3",style:{backgroundColor:Fje}}),"Highlight changes (all layers)"]}),V.jsxs("span",{children:[y==="input"?"Before this phase":"After this phase"," ","· ",k," traces"]})]}),w&&V.jsx("div",{className:zr("rf-border-y rf-px-4 rf-py-2 rf-text-xs",m.status==="error"?"rf-border-red-100 rf-bg-red-50 rf-text-red-700":"rf-border-blue-100 rf-bg-blue-50 rf-text-blue-700"),role:"status",children:m.status==="error"?`Routing failed: ${m.error?.message||"No output was captured."}`:Q?"Routing in progress. Showing captured input until output is available.":"No output was captured for this phase. Showing the available input."}),V.jsx("div",{ref:g,className:"rf-relative rf-min-h-[360px] rf-flex-1","data-testid":"autorouting-pcb",children:E?V.jsx(vje,{circuitJson:E,height:u,allowEditing:!1,clickToInteractEnabled:!1,initialState:wLi,debugGraphics:B}):V.jsx("div",{className:"rf-p-6 rf-text-sm rf-text-gray-500",children:"No PCB snapshot available for this capture."})}),V.jsxs("div",{className:"rf-flex rf-flex-wrap rf-items-center rf-justify-between rf-gap-2 rf-border-t rf-border-gray-200 rf-px-4 rf-py-3 rf-text-xs rf-text-gray-500",children:[V.jsxs("span",{children:[M===void 0?"Input unavailable":`${M} input connections`,` · ${Ydn(m)}`]}),V.jsxs("div",{className:"rf-flex rf-items-center rf-gap-4",children:[V.jsxs("button",{type:"button",disabled:!x,onClick:()=>EE(JSON.stringify(x,null,2),{fileName:`${m.id}-${y}.srj.json`,mimeType:"application/json"}),className:"rf-flex rf-items-center rf-gap-1 disabled:rf-opacity-40",children:[V.jsx(V$,{className:"rf-h-3 rf-w-3"}),"Download SRJ"]}),V.jsxs("button",{type:"button","aria-expanded":c,onClick:()=>l(!c),className:"rf-flex rf-items-center rf-gap-1",children:[V.jsx(KY,{className:zr("rf-h-3 rf-w-3",c&&"rf-rotate-90")}),"Inspect SRJ"]})]})]}),c&&V.jsx("pre",{className:"rf-m-0 rf-max-h-64 rf-overflow-auto rf-border-t rf-border-gray-200 rf-bg-gray-50 rf-p-4 rf-text-xs","aria-label":`${S} ${y} SRJ`,children:x?JSON.stringify(x,null,2):"No snapshot captured."})]})]})},Kdn=({errorMessage:t,errorStack:e,circuitJsonErrors:n})=>{te.useEffect(()=>{if(t){const o=new Error(t);e&&(o.stack=e);try{Uk.captureException(o)}catch{}}},[t,e]),te.useEffect(()=>{if(n&&n.length>0)for(const o of n){const i=new Error(o.message||"Circuit JSON Error");o.stack&&(i.stack=o.stack);try{Uk.captureException(i,{error_type:o.type})}catch{}}},[n])},MLi=t=>{te.useEffect(()=>{try{Y7n(t)}catch{}},[t.source,t.component,t.isWebEmbedded,t.activeTab])},Vdn="0.0.2854",DLi={version:Vdn},Hje={BASE_URL:"/",DEV:!1,MODE:"production",PROD:!0,SSR:!1},Oje=new Map,M_e=t=>{const e=Oje.get(t);return e?Object.fromEntries(Object.entries(e.stores).map(([n,o])=>[n,o.getState()])):{}},NLi=(t,e,n)=>{if(t===void 0)return{type:"untracked",connection:e.connect(n)};const o=Oje.get(n.name);if(o)return{type:"tracked",store:t,...o};const i={connection:e.connect(n),stores:{}};return Oje.set(n.name,i),{type:"tracked",store:t,...i}},zdn=(t,e={})=>(n,o,i)=>{const{enabled:r,anonymousActionType:s,store:a,...A}=e;let c;try{c=(r??(Hje?"production":void 0)!=="production")&&window.__REDUX_DEVTOOLS_EXTENSION__}catch{}if(!c)return(Hje?"production":void 0)!=="production"&&r&&console.warn("[zustand devtools middleware] Please install/enable Redux devtools extension"),t(n,o,i);const{connection:l,...g}=NLi(a,c,A);let u=!0;i.setState=(p,m,_)=>{const f=n(p,m);if(!u)return f;const I=_===void 0?{type:s||"anonymous"}:typeof _=="string"?{type:_}:_;return a===void 0?(l?.send(I,o()),f):(l?.send({...I,type:`${a}/${I.type}`},{...M_e(A.name),[a]:i.getState()}),f)};const h=(...p)=>{const m=u;u=!1,n(...p),u=m},d=t(i.setState,o,i);if(g.type==="untracked"?l?.init(d):(g.stores[g.store]=i,l?.init(Object.fromEntries(Object.entries(g.stores).map(([p,m])=>[p,p===g.store?d:m.getState()])))),i.dispatchFromDevtools&&typeof i.dispatch=="function"){let p=!1;const m=i.dispatch;i.dispatch=(..._)=>{(Hje?"production":void 0)!=="production"&&_[0].type==="__setState"&&!p&&(console.warn('[zustand devtools middleware] "__setState" action type is reserved to set state from the devtools. Avoid using it.'),p=!0),m(..._)}}return l.subscribe(p=>{var m;switch(p.type){case"ACTION":if(typeof p.payload!="string"){console.error("[zustand devtools middleware] Unsupported action format");return}return Gje(p.payload,_=>{if(_.type==="__setState"){if(a===void 0){h(_.state);return}Object.keys(_.state).length!==1&&console.error(`
5667
+ `,g=new Blob([l],{type:"text/plain"}),u=URL.createObjectURL(g),h=document.createElement("a");h.href=u,h.download=`${c}.test.ts`,h.click(),URL.revokeObjectURL(u)}catch(A){alert(`Error generating test.ts for ${t.getSolverName()}: ${A instanceof Error?A.message:String(A)}`)}o(!1)};return V.jsxs("div",{className:`relative ${e}`,ref:i,children:[V.jsx("button",{className:"px-2 py-1 rounded text-xs cursor-pointer",onClick:()=>o(!n),title:`Download options for ${t.getSolverName()}`,children:t.getSolverName()}),n&&V.jsxs("div",{className:"absolute top-full left-0 mt-1 bg-white border border-gray-300 rounded shadow-lg z-10 min-w-[150px]",children:[V.jsx("button",{className:"w-full text-left px-3 py-2 hover:bg-gray-100 text-xs",onClick:r,children:"Download JSON"}),V.jsx("button",{className:"w-full text-left px-3 py-2 hover:bg-gray-100 text-xs",onClick:s,children:"Download page.tsx"}),V.jsx("button",{className:"w-full text-left px-3 py-2 hover:bg-gray-100 text-xs",onClick:a,children:"Download test.ts"})]})]})},Mdn=t=>t.activeSubSolver?[t,...Mdn(t.activeSubSolver)]:[t],jFi=({solver:t})=>{const e=Mdn(t);return V.jsx("div",{className:"flex gap-1 items-center text-sm pt-1",children:e.map((n,o)=>V.jsxs("div",{className:"flex items-center",children:[o>0&&V.jsx("span",{className:"text-gray-400 mx-1",children:"→"}),V.jsx(WFi,{solver:n})]},n.getSolverName()))})},qFi=({solver:t,triggerRender:e,animationSpeed:n=25,renderer:o,onRendererChange:i,onAnimationSpeedChange:r,onDownloadVisualization:s,onSolverStarted:a,onSolverCompleted:A})=>{const[c,l]=te.useReducer(B=>!B,!1),g=te.useRef(void 0),u=te.useRef(null),h="solver-debugger-last-iteration",[d,p]=te.useState(null),m=te.useRef(null),_=te.useMemo(()=>[{label:"Slow",value:250,description:"250ms"},{label:"Normal",value:100,description:"100ms"},{label:"Fast",value:10,description:"10ms"},{label:"Fast (2x)",value:5,description:"5ms"},{label:"Fast (10x)",value:1,description:"1ms"},{label:"Fast 20x",value:.5,description:"2 steps / 1ms"},{label:"Fast 100x",value:.1,description:"10 steps / 1ms"}],[]),f=()=>{const B=Math.max(1,n),S=n<1?Math.round(1/n):1;g.current=setInterval(()=>{if(t.solved||t.failed){g.current&&(clearInterval(g.current),g.current=void 0),l(),e(),A&&t.solved&&A(t);return}for(let Q=0;Q<S&&!(t.solved||t.failed);Q++)t.step();e()},B)},I=()=>{g.current&&(clearInterval(g.current),g.current=void 0)},C=()=>{!t.solved&&!t.failed&&(t.step(),e())},y=()=>{!t.solved&&!t.failed&&(a&&a(t),t.solve(),e(),A&&A(t))},x=()=>{c?(I(),l()):(l(),f())},E=()=>{if(t.solved||t.failed||c)return;u.current===null&&typeof window<"u"&&(u.current=window.localStorage.getItem(h));const B=window.prompt("Step until which iteration?",u.current??`${t.iterations}`);if(B===null)return;u.current=B,typeof window<"u"&&window.localStorage.setItem(h,B);const S=Number(B);if(!Number.isFinite(S)){window.alert("Please enter a valid number for the iteration");return}for(;t.iterations<S&&!t.solved&&!t.failed;)t.step();e(),t.solved&&A&&A(t)};return te.useEffect(()=>()=>{I()},[]),te.useEffect(()=>{(t.solved||t.failed)&&c&&(I(),l())},[t.solved,t.failed,c]),te.useEffect(()=>{c&&(I(),f())},[n,c]),te.useEffect(()=>{if(typeof document>"u")return;const B=S=>{m.current&&!m.current.contains(S.target)&&p(null)};return document.addEventListener("mousedown",B),()=>{document.removeEventListener("mousedown",B)}},[]),V.jsxs("div",{className:"space-y-2 p-2 border-b",children:[V.jsx("div",{className:"flex items-center",children:V.jsxs("div",{className:"flex items-center gap-2",ref:m,children:[V.jsxs("div",{className:"flex h-9 items-center space-x-1 rounded-md border border-slate-200 bg-white p-1 shadow-sm",children:[V.jsxs("div",{className:"relative",children:[V.jsx("button",{type:"button",onClick:()=>p(d==="renderer"?null:"renderer"),className:"flex select-none items-center rounded-sm px-3 py-1 text-sm font-medium outline-none focus:bg-slate-100 data-[state=open]:bg-slate-100","data-state":d==="renderer"?"open":"closed",children:"Renderer"}),d==="renderer"&&V.jsx("div",{className:"absolute left-0 z-50 mt-1 min-w-[10rem] rounded-md border border-slate-200 bg-white p-1 text-slate-950 shadow-md",children:["vector","canvas"].map(B=>V.jsxs("button",{type:"button",onClick:()=>{i(B),p(null)},className:"flex w-full items-center rounded-sm px-2 py-1.5 text-sm hover:bg-slate-100",children:[B==="vector"?"Vector":"Canvas",o===B&&V.jsx("span",{className:"ml-auto text-xs text-slate-500",children:"✓"})]},B))})]}),V.jsxs("div",{className:"relative",children:[V.jsx("button",{type:"button",onClick:()=>p(d==="debug"?null:"debug"),className:"flex select-none items-center rounded-sm px-3 py-1 text-sm font-medium outline-none focus:bg-slate-100 data-[state=open]:bg-slate-100","data-state":d==="debug"?"open":"closed",children:"Debug"}),d==="debug"&&V.jsx("div",{className:"absolute left-0 z-50 mt-1 min-w-[12rem] rounded-md border border-slate-200 bg-white p-1 text-slate-950 shadow-md",children:V.jsx("button",{type:"button",onClick:()=>{s(),p(null)},className:"flex w-full items-center rounded-sm px-2 py-1.5 text-sm hover:bg-slate-100",children:"Download Visualization"})})]}),V.jsxs("div",{className:"relative",children:[V.jsx("button",{type:"button",onClick:()=>p(d==="animation"?null:"animation"),className:"flex select-none items-center rounded-sm px-3 py-1 text-sm font-medium outline-none focus:bg-slate-100 data-[state=open]:bg-slate-100","data-state":d==="animation"?"open":"closed",children:"Animation"}),d==="animation"&&V.jsx("div",{className:"absolute left-0 z-50 mt-1 min-w-[12rem] rounded-md border border-slate-200 bg-white p-1 text-slate-950 shadow-md",children:_.map(B=>V.jsxs("button",{type:"button",onClick:()=>{r(B.value),p(null)},className:"flex w-full items-center rounded-sm px-2 py-1.5 text-sm hover:bg-slate-100",children:[B.label,V.jsx("span",{className:"ml-auto text-xs text-slate-500",children:B.description}),n===B.value&&V.jsx("span",{className:"ml-2 text-xs text-slate-500",children:"✓"})]},B.value))})]})]}),V.jsx(jFi,{solver:t})]})}),V.jsxs("div",{className:"flex gap-2 items-center flex-wrap",children:[V.jsx("button",{onClick:C,disabled:t.solved||t.failed||c,className:"bg-blue-500 hover:bg-blue-600 disabled:bg-gray-300 text-white px-3 py-1 rounded text-sm",children:"Step"}),V.jsx("button",{onClick:y,disabled:t.solved||t.failed||c,className:"bg-green-500 hover:bg-green-600 disabled:bg-gray-300 text-white px-3 py-1 rounded text-sm",children:"Solve"}),V.jsx("button",{onClick:x,disabled:t.solved||t.failed,className:`px-3 py-1 rounded text-white text-sm ${c?"bg-red-500 hover:bg-red-600":"bg-yellow-500 hover:bg-yellow-600"} disabled:bg-gray-300`,children:c?"Stop":"Animate"}),V.jsx("button",{onClick:E,disabled:t.solved||t.failed||c,className:"bg-orange-500 hover:bg-orange-600 disabled:bg-gray-300 text-white px-3 py-1 rounded text-sm",children:"Step Until Iteration"}),V.jsxs("div",{className:"text-sm text-gray-600",children:["Iterations: ",t.iterations]}),t.timeToSolve!==void 0&&V.jsxs("div",{className:"text-sm text-gray-600",children:["Time: ",(t.timeToSolve/1e3).toFixed(3),"s"]}),t.solved&&V.jsx("div",{className:"px-2 py-1 bg-green-100 text-green-800 rounded text-sm",children:"Solved"}),t.failed&&V.jsx("div",{className:"px-2 py-1 bg-red-100 text-red-800 rounded text-sm",children:"Failed"})]}),t.error&&V.jsxs("div",{className:"text-red-600 text-sm",children:["Error: ",t.error]})]})},XFi=t=>t!==null&&"pipelineDef"in t&&Array.isArray(t.pipelineDef),$Fi=(t,e,n)=>{const o=t.currentPipelineStageIndex;return e<o?"Completed":e===o&&t.activeSubSolver?t.activeSubSolver.failed?"Failed":"In Progress":"Not Started"},ZFi=(t,e)=>{const o=t.pipelineDef[e].solverName,i=$Fi(t,e),r=t[o],s=t.firstIterationOfStage?.[o]??(e===t.currentPipelineStageIndex?t.iterations:null),a=t.iterations;let A=0;if(i==="Completed"){const u=t.pipelineDef[e+1],h=u?t.firstIterationOfStage?.[u.solverName]:void 0;h!==void 0&&s!==null?A=h-s:s!==null&&(A=a-s)}else i==="In Progress"&&s!==null&&(A=a-s);const c=t.timeSpentOnStage?.[o]??0;let l=0;i==="Completed"?l=1:i==="In Progress"&&r&&(l=r.progress??0);const g=r?.stats??null;return{index:e,name:o,status:i,firstIteration:s,iterations:A,progress:l,timeSpent:c,stats:g&&Object.keys(g).length>0?g:null,solverInstance:r??null}},eLi=({status:t})=>{const e={"Not Started":"text-blue-600","In Progress":"text-yellow-600",Completed:"text-green-600",Failed:"text-red-600"};return V.jsx("span",{className:`font-medium ${e[t]}`,children:t})},tLi=({progress:t})=>{if(t===0)return null;const e=Math.round(t*100);return V.jsxs("div",{className:"flex items-center gap-2",children:[V.jsx("div",{className:"w-20 h-2 bg-gray-200 rounded overflow-hidden",children:V.jsx("div",{className:"h-full bg-blue-500 transition-all duration-200",style:{width:`${e}%`}})}),V.jsxs("span",{className:"text-xs text-gray-500",children:[e,"%"]})]})},Ddn=t=>{if(typeof t=="string")return t;if(typeof t=="number"||typeof t=="boolean"||typeof t=="bigint"||t==null)return String(t);if(typeof t=="object")try{return JSON.stringify(t)}catch{return String(t)}return String(t)},nLi=t=>Object.entries(t).map(([e,n])=>`${e}: ${Ddn(n)}`).join(", "),oLi=({stats:t})=>{if(!t||Object.keys(t).length===0)return V.jsx("span",{children:"-"});const e=Object.entries(t),n=nLi(t);return V.jsxs("details",{className:"cursor-pointer",children:[V.jsx("summary",{className:"whitespace-nowrap overflow-hidden text-ellipsis max-w-[200px]",children:n}),V.jsx("div",{className:"mt-1 text-xs",children:e.map(([o,i])=>V.jsxs("div",{children:[o,": ",Ddn(i)]},o))})]})},Tje=t=>{if(t===null||typeof t!="object")return t;if(Array.isArray(t))return t.map(Tje);const e={};for(const[n,o]of Object.entries(t))n.startsWith("_")||(e[n]=Tje(o));return e},iLi=(t,e)=>{try{if(typeof t.getConstructorParams!="function"){alert(`getConstructorParams() is not implemented for ${e}`);return}const n=Tje(t.getConstructorParams()),o=new Blob([JSON.stringify(n,null,2)],{type:"application/json"}),i=URL.createObjectURL(o),r=document.createElement("a");r.href=i,r.download=`${e}_input.json`,r.click(),URL.revokeObjectURL(i)}catch(n){alert(`Error downloading input for ${e}: ${n instanceof Error?n.message:String(n)}`)}},rLi=({expanded:t})=>V.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",className:`w-4 h-4 transition-transform duration-200 ${t?"rotate-90":""}`,children:V.jsx("path",{fillRule:"evenodd",d:"M4.5 5.653c0-1.426 1.529-2.33 2.779-1.643l11.54 6.348c1.295.712 1.295 2.573 0 3.285L7.28 19.991c-1.25.687-2.779-.217-2.779-1.643V5.653z",clipRule:"evenodd"})}),Ndn=t=>{let e=t;for(;e.activeSubSolver;)e=e.activeSubSolver;return e},Rdn=({solver:t,onStepUntilPhase:e,onDownloadInput:n,isNested:o=!1,indentLevel:i=0,triggerRender:r})=>{const[s,a]=te.useState(new Set),A=t.pipelineDef.map((m,_)=>ZFi(t,_)),c=m=>{a(_=>{const f=new Set(_);return f.has(m)?f.delete(m):f.add(m),f})},l=m=>{e?.(m)},g=m=>{m.solverInstance&&(n?n(m.solverInstance,m.name):iLi(m.solverInstance,m.name))},u=m=>`${(m/1e3).toFixed(2)}s`,h=()=>{if(!t.solved&&!t.failed){const m=t.activeSubSolver;for(;!t.solved&&!t.failed&&(t.step(),!(t.activeSubSolver&&t.activeSubSolver!==m)););r?.()}},d=()=>{if(!t.solved&&!t.failed){const m=Ndn(t);for(;!t.solved&&!t.failed&&(t.step(),Ndn(t)===m););r?.()}},p=i*24;return V.jsxs("div",{className:o?"":"border-t border-gray-200",children:[!o&&V.jsxs("div",{className:"px-4 py-2 bg-gray-50 border-b border-gray-200 flex items-center justify-between",children:[V.jsx("h3",{className:"text-sm font-semibold text-gray-700",children:"Pipeline Stages"}),V.jsxs("div",{className:"flex gap-2",children:[V.jsx("button",{onClick:d,disabled:t.solved||t.failed,className:"bg-indigo-500 hover:bg-indigo-600 disabled:bg-gray-300 disabled:cursor-not-allowed cursor-pointer text-white px-3 py-1 rounded text-sm",children:"Next Solver"}),V.jsx("button",{onClick:h,disabled:t.solved||t.failed,className:"bg-purple-500 hover:bg-purple-600 disabled:bg-gray-300 disabled:cursor-not-allowed cursor-pointer text-white px-3 py-1 rounded text-sm",children:"Next Stage"})]})]}),V.jsx("div",{className:"overflow-x-auto",children:V.jsxs("table",{className:"w-full text-sm",children:[!o&&V.jsx("thead",{children:V.jsxs("tr",{className:"bg-gray-50 border-b border-gray-200",children:[V.jsx("th",{className:"px-4 py-2 text-left font-semibold text-gray-700",children:"Stage"}),V.jsx("th",{className:"px-4 py-2 text-left font-semibold text-gray-700",children:"Status"}),V.jsxs("th",{className:"px-4 py-2 text-center font-semibold text-gray-700",children:["i",V.jsx("sub",{children:"0"})]}),V.jsx("th",{className:"px-4 py-2 text-left font-semibold text-gray-700",children:"Iterations"}),V.jsx("th",{className:"px-4 py-2 text-left font-semibold text-gray-700",children:"Progress"}),V.jsx("th",{className:"px-4 py-2 text-left font-semibold text-gray-700",children:"Time"}),V.jsx("th",{className:"px-4 py-2 text-left font-semibold text-gray-700",children:"Stats"}),V.jsx("th",{className:"px-4 py-2 text-left font-semibold text-gray-700",children:"Input"})]})}),V.jsx("tbody",{children:A.map(m=>{const _=XFi(m.solverInstance),f=s.has(m.name);return V.jsxs(ks.Fragment,{children:[V.jsxs("tr",{className:`border-b border-gray-100 ${m.status==="In Progress"?"bg-yellow-50":""}`,children:[V.jsx("td",{className:"px-4 py-2",children:V.jsxs("div",{className:"flex items-center gap-2",style:{paddingLeft:p},children:[_?V.jsx("button",{onClick:()=>c(m.name),className:"text-gray-500 hover:text-gray-700",title:f?"Collapse":"Expand",children:V.jsx(rLi,{expanded:f})}):V.jsx("span",{className:"w-4"}),V.jsx("span",{className:"text-gray-400 w-6",children:String(m.index+1).padStart(2,"0")}),V.jsx("button",{onClick:()=>l(m.name),disabled:m.status==="Completed"||t.solved||t.failed,className:"text-blue-500 hover:text-blue-700 disabled:text-gray-300 disabled:cursor-not-allowed",title:`Step until ${m.name} completes`,children:V.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",className:"w-4 h-4",children:V.jsx("path",{fillRule:"evenodd",d:"M4.5 5.653c0-1.426 1.529-2.33 2.779-1.643l11.54 6.348c1.295.712 1.295 2.573 0 3.285L7.28 19.991c-1.25.687-2.779-.217-2.779-1.643V5.653z",clipRule:"evenodd"})})}),V.jsx("span",{className:"font-medium text-gray-900",children:m.name})]})}),V.jsx("td",{className:"px-4 py-2",children:V.jsx(eLi,{status:m.status})}),V.jsx("td",{className:"px-4 py-2 text-center text-gray-600",children:m.firstIteration!==null?m.firstIteration:""}),V.jsx("td",{className:"px-4 py-2 text-gray-600",children:m.iterations}),V.jsx("td",{className:"px-4 py-2",children:V.jsx(tLi,{progress:m.progress})}),V.jsx("td",{className:"px-4 py-2 text-gray-600",children:u(m.timeSpent)}),V.jsx("td",{className:"px-4 py-2 text-gray-500",children:V.jsx(oLi,{stats:m.stats})}),V.jsx("td",{className:"px-4 py-2",children:m.solverInstance?V.jsxs("button",{onClick:()=>g(m),className:"flex items-center gap-1 text-blue-500 hover:text-blue-700",title:`Download input for ${m.name}`,children:[V.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",className:"w-4 h-4",children:V.jsx("path",{fillRule:"evenodd",d:"M12 2.25a.75.75 0 01.75.75v11.69l3.22-3.22a.75.75 0 111.06 1.06l-4.5 4.5a.75.75 0 01-1.06 0l-4.5-4.5a.75.75 0 111.06-1.06l3.22 3.22V3a.75.75 0 01.75-.75zm-9 13.5a.75.75 0 01.75.75v2.25a1.5 1.5 0 001.5 1.5h13.5a1.5 1.5 0 001.5-1.5V16.5a.75.75 0 011.5 0v2.25a3 3 0 01-3 3H5.25a3 3 0 01-3-3V16.5a.75.75 0 01.75-.75z",clipRule:"evenodd"})}),V.jsx("span",{children:"Input"})]}):null})]}),_&&f&&V.jsx("tr",{children:V.jsx("td",{colSpan:8,className:"p-0",children:V.jsx(Rdn,{solver:m.solverInstance,onStepUntilPhase:e,onDownloadInput:n,isNested:!0,indentLevel:i+1,triggerRender:r})})})]},m.name)})})]})})]})};function sLi({graphics:t}){const e=t.points??[],n=t.lines??[],o=t.rects??[],i=t.circles??[],r=t.texts??[];let s=Number.POSITIVE_INFINITY,a=Number.POSITIVE_INFINITY,A=Number.NEGATIVE_INFINITY,c=Number.NEGATIVE_INFINITY;const l=(m,_)=>{typeof m=="number"&&(m<s&&(s=m),m>A&&(A=m)),typeof _=="number"&&(_<a&&(a=_),_>c&&(c=_))};for(const m of e)l(m.x,m.y);for(const m of n){const _=m.points??[];for(const f of _)l(f.x,f.y)}for(const m of o){const _=m.x??0,f=m.y??0,I=m.width??0,C=m.height??0;l(_,f),l(_+I,f+C)}for(const m of i){const _=m.x??0,f=m.y??0,I=m.radius??1;l(_-I,f-I),l(_+I,f+I)}for(const m of r)l(m.x,m.y);(!isFinite(s)||!isFinite(a)||!isFinite(A)||!isFinite(c))&&(s=-20,a=-20,A=20,c=20);const g=10,u=s-g,h=a-g,d=Math.max(1,A-s+2*g),p=Math.max(1,c-a+2*g);return V.jsxs("svg",{className:"w-full h-[400px] bg-white",viewBox:`${u} ${h} ${d} ${p}`,role:"img","aria-label":"Graphics fallback",children:[o.map((m,_)=>V.jsx("rect",{x:m.x??0,y:m.y??0,width:m.width??0,height:m.height??0,fill:"none",stroke:m.strokeColor??"black",strokeWidth:m.strokeWidth??1},`rect-${_}`)),n.map((m,_)=>V.jsx("polyline",{fill:"none",stroke:m.strokeColor??"black",strokeWidth:m.strokeWidth??1,points:(m.points??[]).map(f=>`${f.x??0},${f.y??0}`).join(" ")},`line-${_}`)),i.map((m,_)=>V.jsx("circle",{cx:m.x??0,cy:m.y??0,r:m.radius??1.5,fill:m.fillColor??"none",stroke:m.strokeColor??"black",strokeWidth:m.strokeWidth??1},`circle-${_}`)),e.map((m,_)=>V.jsx("circle",{cx:m.x??0,cy:m.y??0,r:m.radius??1.5,fill:m.color??"black"},`point-${_}`)),r.map((m,_)=>V.jsx("text",{x:m.x??0,y:m.y??0,fontSize:m.fontSize??10,fill:m.color??"black",children:m.text??""},`text-${_}`))]})}var aLi=class extends ks.Component{constructor(t){super(t),this.state={hasError:!1}}static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(t){console.error("InteractiveGraphics render error:",t)}render(){return this.state.hasError?this.props.fallback:this.props.children}},ALi=({solver:t,createSolver:e,animationSpeed:n=25,onSolverStarted:o,onSolverCompleted:i})=>{const[r,s]=te.useReducer(f=>f+1,0),[a]=te.useState(()=>{if(e)return e();if(!t)throw new Error("GenericSolverDebugger requires solver or createSolver");return t}),[A,c]=te.useState(()=>typeof window>"u"?"vector":window.localStorage.getItem("solver-utils-renderer")==="canvas"?"canvas":"vector"),[l,g]=te.useState(n),u=te.useMemo(()=>{try{return a.visualize()||{points:[],lines:[],rects:[],circles:[]}}catch(f){return console.error("Visualization error:",f),{points:[],lines:[],rects:[],circles:[]}}},[a,r]),h=te.useMemo(()=>(u.rects?.length||0)===0&&(u.lines?.length||0)===0&&(u.points?.length||0)===0&&(u.circles?.length||0)===0,[u]);te.useEffect(()=>{if(!(typeof document>"u")&&!document.querySelector('script[src="https://cdn.jsdelivr.net/npm/@tailwindcss/browser@4"]')){const f=document.createElement("script");f.src="https://cdn.jsdelivr.net/npm/@tailwindcss/browser@4",document.head.appendChild(f)}},[]),te.useEffect(()=>{g(n)},[n]);const d=a.pipelineDef!==void 0,p=f=>{const I=a;if(!a.solved&&!a.failed){for(;!a.solved&&!a.failed&&I.currentPipelineStageIndex<=I.pipelineDef.findIndex(C=>C.solverName===f);)a.step();s()}},m=()=>{const f=JSON.stringify(u,null,2),I=new Blob([f],{type:"application/json"}),C=URL.createObjectURL(I),y=document.createElement("a");y.download="visualization.json",y.href=C,document.body.appendChild(y),y.click(),document.body.removeChild(y),URL.revokeObjectURL(C)},_=f=>{c(f),typeof window<"u"&&window.localStorage.setItem("solver-utils-renderer",f)};return V.jsxs("div",{children:[V.jsx(qFi,{solver:a,triggerRender:s,animationSpeed:l,renderer:A,onRendererChange:_,onAnimationSpeedChange:g,onDownloadVisualization:m,onSolverStarted:o,onSolverCompleted:i}),h?V.jsx("div",{className:"p-4 text-gray-500",children:"No Graphics Yet"}):V.jsx(aLi,{fallback:V.jsx(sLi,{graphics:u}),children:A==="canvas"?V.jsx(JFi,{graphics:u}):V.jsx(KFi,{graphics:u})}),d&&V.jsx(Rdn,{solver:a,onStepUntilPhase:p,triggerRender:s})]})};const cLi=()=>{te.useEffect(()=>{const t="tailwind-cdn-script";if(document.getElementById(t)||window.tailwind)return;const e=document.createElement("div");e.className="hidden",document.body.appendChild(e);const n=window.getComputedStyle(e).display==="none";if(document.body.removeChild(e),n)return;const o=document.createElement("script");o.id=t,o.src="https://cdn.tailwindcss.com",document.head.appendChild(o)},[])},lLi=1e3,EE=(t,e)=>{const{fileName:n,mimeType:o="text/plain"}=e,i=t instanceof Blob?t:new Blob([t],{type:o}),r=URL.createObjectURL(i),s=document.createElement("a");s.href=r,s.download=n,s.target="_blank",s.rel="noopener noreferrer",s.style.display="none",document.body.appendChild(s),s.click(),document.body.removeChild(s),setTimeout(()=>{URL.revokeObjectURL(r)},lLi)},kje=t=>{let e=t.trim().replace(/[\\/:*?"<>|]/g,"_").replace(/[\x00-\x1f]/g,"").replace(/^\.+/,"").replace(/\.+$/,"").replace(/\s+/g," ").replace(/_+/g,"_");return/^(con|prn|aux|nul|com[0-9]|lpt[0-9])$/i.test(e)&&(e=`_${e}`),e=e.slice(0,200),e||"untitled"},gLi=t=>{const e=t.solverConstructorArgs??[t.solverParams];if(t.solverName!=="AutoroutingPipelineSolver7_MultiGraph"||e.length!==1)return e;const[{input:n,options:o}]=e;return[n,o]},J6="https://github.com/tscircuit/tscircuit-autorouter/issues/new",Tdn="https://github.com/tscircuit/copper-pour-solver/issues/new",kdn="https://github.com/tscircuit/calculate-packing/issues/new",uLi="https://github.com/tscircuit/matchpack/issues/new",Fdn="https://github.com/tscircuit/schematic-trace-solver/issues/new?template=json-bug-report.yml",dLi={PackSolver2:kdn,LayoutPipelineSolver:uLi,AutoroutingPipelineSolver:J6,AssignableAutoroutingPipeline2:J6,AssignableAutoroutingPipeline3:J6,AutoroutingPipeline1_OriginalUnravel:J6,AutoroutingPipelineSolver3_HgPortPointPathing:J6,AutoroutingPipelineSolver4:J6,AutoroutingPipelineSolver5:J6,AutoroutingPipelineSolver7_MultiGraph:J6,AutoroutingPipelineSolver8:J6,CopperPourPipelineSolver:Tdn,SchematicTracePipelineSolver:Fdn},hLi=t=>t.toLowerCase().includes("pack")?d7i:t.toLowerCase().includes("rout")?NAn:r7i,Ldn=t=>{const e=dLi[t];if(e)return e;const n=t.toLowerCase();return n.includes("autorout")?J6:n.includes("schematic")&&n.includes("trace")?Fdn:n.includes("copperpour")?Tdn:n.includes("pack")?kdn:null},pLi=t=>`${kje(`${t.componentName}-${t.solverName}`)}-solver-input.json`,Hdn=t=>{EE(JSON.stringify(t.solverParams,null,2),{fileName:pLi(t),mimeType:"application/json"})},mLi=({solverEvent:t})=>{const e=Ldn(t.solverName);return V.jsxs("div",{className:"rf-flex rf-items-center rf-justify-end rf-gap-2 rf-border-b rf-border-gray-200 rf-bg-gray-50 rf-px-4 rf-py-2",children:[V.jsxs(Zc,{type:"button",variant:"outline",size:"sm",onClick:()=>Hdn(t),children:[V.jsx(V$,{className:"rf-w-4 rf-h-4"}),"Download"]}),e?V.jsx(Zc,{asChild:!0,variant:"outline",size:"sm",children:V.jsxs("a",{href:e,target:"_blank",rel:"noopener noreferrer",children:[V.jsx(Ope,{className:"rf-w-4 rf-h-4"}),"Report"]})}):V.jsxs(Zc,{type:"button",variant:"outline",size:"sm",disabled:!0,title:"No report link configured for this solver",children:[V.jsx(Ope,{className:"rf-w-4 rf-h-4"}),"Report"]})]})},_Li=({solverEvent:t})=>{const e=Ldn(t.solverName);return e?V.jsx(Zc,{asChild:!0,variant:"ghost",size:"icon",className:"rf-h-8 rf-w-8",children:V.jsx("a",{href:e,target:"_blank",rel:"noopener noreferrer",title:"Report solver bug","aria-label":"Report solver bug",children:V.jsx(Ope,{className:"rf-w-4 rf-h-4"})})}):V.jsx(Zc,{type:"button",variant:"ghost",size:"icon",className:"rf-h-8 rf-w-8",disabled:!0,title:"No report link configured for this solver","aria-label":"Report solver bug",children:V.jsx(Ope,{className:"rf-w-4 rf-h-4"})})},fLi=({solverEvents:t=[]})=>{const[e,n]=te.useState(null);cLi();const o=te.useMemo(()=>{const a=new Map;for(const A of t){const c=`${A.componentName}-${A.solverName}`;a.set(c,A)}return a},[t]),i=te.useMemo(()=>Array.from(o.keys()),[o]),r=e?o.get(e):null,s=te.useMemo(()=>{if(!r)return{instance:null,error:null,classFound:!1};const a=QRe[r.solverName];if(!a)return{instance:null,error:`Solver class "${r.solverName}" not found in SOLVERS registry. Available: ${Object.keys(QRe).join(", ")}`,classFound:!1};try{return{instance:new a(...gLi(r)),error:null,classFound:!0}}catch(A){const c=A instanceof Error?A.message:String(A);return console.error("Failed to reconstruct solver:",A),{instance:null,error:`Failed to instantiate solver: ${c}`,classFound:!0}}},[r]);return t.length===0?V.jsx("div",{className:"rf-p-4",children:V.jsx("div",{className:"rf-bg-gray-50 rf-rounded-md rf-border rf-border-gray-200",children:V.jsxs("div",{className:"rf-p-4",children:[V.jsx("h3",{className:"rf-text-lg rf-font-semibold rf-text-gray-800 rf-mb-3",children:"No Solvers Detected"}),V.jsx("p",{className:"rf-text-sm rf-text-gray-600",children:"Solvers will appear here when the circuit runs. Solvers are used for tasks like component packing and autorouting."})]})})}):V.jsxs("div",{className:"rf-flex rf-h-full rf-overflow-hidden",children:[V.jsxs("div",{className:"rf-w-64 rf-border-r rf-border-gray-200 rf-overflow-y-auto rf-flex-shrink-0",children:[V.jsxs("div",{className:"rf-text-xs rf-font-semibold rf-text-gray-500 rf-px-3 rf-py-2 rf-bg-gray-50 rf-border-b rf-border-gray-200",children:[i.length," ",i.length===1?"Solver":"Solvers"]}),i.map(a=>{const A=o.get(a),c=e===a;return V.jsx("div",{className:`rf-px-3 rf-py-2 rf-cursor-pointer rf-border-b rf-border-gray-100 ${c?"rf-bg-blue-50 rf-border-l-2 rf-border-l-blue-500":"hover:rf-bg-gray-50"}`,onClick:()=>n(a),children:(()=>{const l=hLi(A.solverName);return V.jsxs("div",{className:"rf-flex rf-items-center rf-gap-2",children:[V.jsx(l,{className:"rf-w-4 rf-h-4 rf-text-blue-500 rf-flex-shrink-0"}),V.jsxs("div",{className:"rf-flex-1 rf-min-w-0",children:[V.jsx("div",{className:"rf-text-sm rf-font-medium rf-text-gray-800 rf-truncate",children:A.componentName}),V.jsx("div",{className:"rf-text-xs rf-text-gray-500 rf-truncate",children:A.solverName})]})]})})()},a)})]}),V.jsx("div",{className:"rf-flex-1 rf-overflow-hidden",children:r?s.instance?V.jsxs("div",{className:"rf-flex rf-h-full rf-flex-col rf-overflow-y-auto",children:[V.jsx(mLi,{solverEvent:r}),V.jsx("div",{className:"rf-min-h-0 rf-flex-1",children:V.jsx(KB,{fallback:V.jsx("div",{className:"rf-p-4",children:V.jsxs("div",{className:"rf-bg-red-50 rf-rounded-md rf-border rf-border-red-200 rf-p-4",children:[V.jsx("h3",{className:"rf-text-lg rf-font-semibold rf-text-red-800 rf-mb-2",children:"Error Loading Solver Debugger"}),V.jsxs("p",{className:"rf-text-sm rf-text-red-600",children:["Failed to render the solver debugger for"," ",r.solverName]})]})}),children:V.jsx(ALi,{solver:s.instance})})})]}):V.jsxs("div",{className:"rf-p-4",children:[V.jsxs("div",{className:"rf-mb-4",children:[V.jsx("h3",{className:"rf-text-lg rf-font-semibold rf-text-gray-800",children:r.solverName}),V.jsxs("p",{className:"rf-text-sm rf-text-gray-500",children:["Component: ",r.componentName]})]}),s.error&&V.jsx("div",{className:`rf-rounded-md rf-border rf-p-4 rf-mb-4 ${s.classFound?"rf-bg-red-50 rf-border-red-200":"rf-bg-yellow-50 rf-border-yellow-200"}`,children:V.jsx("p",{className:`rf-text-sm ${s.classFound?"rf-text-red-700":"rf-text-yellow-700"}`,children:s.error})}),V.jsxs("div",{className:"rf-border rf-border-gray-200 rf-rounded-md rf-overflow-hidden",children:[V.jsxs("div",{className:"rf-px-3 rf-py-2 rf-bg-gray-50 rf-flex rf-items-center rf-justify-between rf-gap-2",children:[V.jsx("span",{className:"rf-text-sm rf-font-medium rf-text-gray-700",children:"Solver Parameters"}),V.jsxs("div",{className:"rf-flex rf-items-center rf-gap-1",children:[V.jsx(_Li,{solverEvent:r}),V.jsx(Zc,{type:"button",variant:"ghost",size:"icon",className:"rf-h-8 rf-w-8","aria-label":"Download solver input JSON",title:"Download solver input JSON",onClick:()=>Hdn(r),children:V.jsx(V$,{className:"rf-w-4 rf-h-4"})})]})]}),V.jsx("div",{className:"rf-p-3 rf-bg-white rf-border-t rf-border-gray-200",children:V.jsx("pre",{className:"rf-text-xs rf-font-mono rf-text-gray-600 rf-whitespace-pre-wrap rf-overflow-x-auto",children:JSON.stringify(r.solverParams,null,2)})})]})]}):V.jsx("div",{className:"rf-flex rf-items-center rf-justify-center rf-h-full",children:V.jsx("p",{className:"rf-text-sm rf-text-gray-500",children:"Select a solver from the list to view details"})})})]})},ILi=new Map([["custom","Custom"],["fanout","Fanout"],["single_layer_fanout","Single layer fanout"],["tscircuit_simplify","Simplify"]]),CLi=new Set(["tscircuit","default","auto","auto_local"]);function yLi(t){if(t==="FanoutSolver")return"Fanout";if(t==="AutoroutingPipelineSolver11_Simplification")return"Simplify";const e=t.match(/^AutoroutingPipeline(?:Solver)?(\d+)(?:_|$)/);if(e)return`Pipeline${e[1]}`;const n=t.match(/^AssignableAutoroutingPipeline(\d+)$/);return n?`Assignable${n[1]}`:t}function xLi(t){const e=t.autorouterName?.trim(),n=e?.replace(/-/g,"_"),o=n&&ILi.get(n);if(o)return o;if(n&&!CLi.has(n))return e;const i=t.solverName?.trim();if(i)return yLi(i);const r=t.autorouterVersion?.trim();if(r){const s=r.match(/^beta[_-]pipeline(\d+)$/);return s?`Pipeline${s[1]}`:r==="latest"?"default":r}return e?"default":"Unknown"}const Fje="#fbbf24";function ELi(t){const e=t.endSimpleRouteJson?.traces??[],n=new Set(e.flatMap(i=>[i.pcb_trace_id,i.__replaces_pcb_trace_id].filter(r=>r!==void 0)));return[...(t.startSimpleRouteJson?.traces??[]).filter(i=>!n.has(i.pcb_trace_id)),...e]}function Odn(t){const e=new Map((t.startSimpleRouteJson?.traces??[]).map(n=>[n.pcb_trace_id,n]));return(t.endSimpleRouteJson?.traces??[]).filter(n=>{const o=e.get(n.pcb_trace_id);return!o||!!n.__replaces_pcb_trace_id&&n.__replaces_pcb_trace_id!==o.__replaces_pcb_trace_id||JSON.stringify(o.route)!==JSON.stringify(n.route)}).map(n=>n.pcb_trace_id)}function BLi(t,e){return{outer_diameter:t.via_diameter??e.minViaPadDiameter??e.min_via_pad_diameter??e.minViaDiameter??.6,hole_diameter:t.via_hole_diameter??e.minViaHoleDiameter??e.min_via_hole_diameter??.3}}function Gdn(t,e){const n=[];for(const a of t.route)a.route_type==="wire"?n.push({...a,layer:a.layer}):a.route_type==="via"?n.push({route_type:"via",x:a.x,y:a.y,from_layer:a.from_layer,to_layer:a.to_layer,...BLi(a,e)}):a.route_type==="through_obstacle"&&n.push({route_type:"through_pad",start:{...a.start},end:{...a.end},width:a.width,start_layer:a.from_layer,end_layer:a.to_layer,pcb_smtpad_id:a.circuitJsonMetadata?.pcb_smtpad_id,pcb_plated_hole_id:a.circuitJsonMetadata?.pcb_plated_hole_id});const o=a=>{let A=-1,c=Number.POSITIVE_INFINITY;return n.forEach((l,g)=>{if(l.route_type!=="wire")return;const u=Math.hypot(l.x-a.x,l.y-a.y);u<c&&(c=u,A=g)}),A},i=t.route.filter(a=>a.route_type==="jumper").map(a=>[o(a.start),o(a.end)].sort((A,c)=>A-c)).filter(([a,A])=>a>=0&&A>a).sort(([a],[A])=>a-A),r=[];let s=0;for(const[a,A]of i)a>=s&&r.push(n.slice(s,a+1)),s=Math.max(s,A);return s<n.length&&r.push(n.slice(s)),r}function bLi(t){const e=[],n=[],o=t.endSimpleRouteJson;if(!o)return{lines:e,circles:n};const i=new Set(Odn(t));for(const r of o.traces??[])if(i.has(r.pcb_trace_id))for(const s of Gdn(r,o)){let a;for(const A of s){if(A.route_type==="through_pad"){a={...A.end,layer:A.end_layer,width:A.width};continue}const c=A.route_type==="wire"?A.layer:A.from_layer;a&&a.layer===c&&(a.x!==A.x||a.y!==A.y)&&e.push({points:[{x:a.x,y:a.y},{x:A.x,y:A.y}],strokeWidth:A.route_type==="wire"?A.width:a.width,strokeColor:Fje,layer:c}),A.route_type==="via"&&n.push({center:{x:A.x,y:A.y},radius:A.outer_diameter/2,stroke:Fje,fill:"transparent"}),a={x:A.x,y:A.y,layer:A.route_type==="wire"?A.layer:A.to_layer,width:A.route_type==="wire"?A.width:a?.width??o.minTraceWidth}}}return{coordinateSystem:"cartesian",lines:e,circles:n}}function SLi(t){const e=JSON.stringify(t);let n=2166136261;for(let o=0;o<e.length;o++)n=Math.imul(n^e.charCodeAt(o),16777619);return(n>>>0).toString(36)}const QLi=new Set(["pcb_trace","pcb_via","pcb_copper_pour","pcb_ground_plane","pcb_ground_plane_region","pcb_thermal_spoke","pcb_breakout_point"]);function vLi(t,e,n){const o=n==="input"?e.startSimpleRouteJson??e.errorSimpleRouteJson:e.endSimpleRouteJson,i=t.filter(c=>!QLi.has(c.type)&&!c.type.endsWith("_error")&&!c.type.endsWith("_warning"));if(!o)return i;const r=n==="input"?o.traces??[]:ELi(e),s=new Set(t.filter(c=>c.type==="source_trace").map(c=>c.source_trace_id)),a=["top",...Array.from({length:Math.max(0,o.layerCount-2)},(c,l)=>`inner${l+1}`),...o.layerCount>1?["bottom"]:[]],A=[];for(const c of r){const g=o.connections.find(h=>h.name===c.connection_name||h.source_trace_id===c.connection_name)?.source_trace_id??c.connection_name??"",u=Gdn(c,o);for(const[h,d]of u.entries()){const p={type:"pcb_trace",pcb_trace_id:`${e.id}_${n}_${c.pcb_trace_id}_${h}_${SLi(d)}`,subcircuit_id:e.subcircuit_id??void 0,source_trace_id:s.has(g)?g:void 0,route:d};A.push(p);for(const[m,_]of d.entries()){if(_.route_type!=="via")continue;const f=a.indexOf(_.from_layer),I=a.indexOf(_.to_layer),C={type:"pcb_via",pcb_via_id:`${p.pcb_trace_id}_via_${m}`,pcb_trace_id:p.pcb_trace_id,subcircuit_id:e.subcircuit_id??void 0,x:_.x,y:_.y,outer_diameter:_.outer_diameter,hole_diameter:_.hole_diameter,layers:f>=0&&I>=0?a.slice(Math.min(f,I),Math.max(f,I)+1):[_.from_layer,_.to_layer]};A.push(C)}}}return[...i,...A]}const Lje=(t,e)=>t.phaseName||`Phase ${t.phaseOrdinal??e+1}`,Ydn=t=>t.componentDisplayName?.match(/name="([^"]+)"/)?.[1]?.replace(/^\./,"")||t.componentDisplayName||t.subcircuit_id||"Board",Udn=t=>t.startSimpleRouteJson??t.endSimpleRouteJson??t.errorSimpleRouteJson,wLi={is_showing_autorouting:!0,is_showing_rats_nest:!1,is_showing_drc_errors:!1,is_showing_drc_warnings:!1,is_showing_pcb_groups:!1},PLi=({circuitJson:t,phases:e=[],isRunning:n=!1})=>{const[o,i]=te.useState(null),[r,s]=te.useState("output"),[a,A]=te.useState(!0),[c,l]=te.useState(!1),g=te.useRef(null),[u,h]=te.useState(480),d=o?e.findIndex(R=>R.id===o.id&&Udn(R)===Udn(o)):-1,p=d<0?e.length-1:d,m=e[p],_=d<0,f=!!m?.endSimpleRouteJson,I=m?.startSimpleRouteJson??m?.errorSimpleRouteJson,C=!!I,y=r==="output"&&!f?"input":r==="input"&&!C?"output":r,x=y==="input"?I:m?.endSimpleRouteJson,E=te.useMemo(()=>!m||!x?null:vLi(t??[],m,y),[t,m,x,y]),B=te.useMemo(()=>m&&y==="output"&&a?bLi(m):{lines:[],circles:[]},[m,y,a]);if(te.useLayoutEffect(()=>{const R=g.current;if(!R)return;const F=()=>h(Math.max(360,R.clientHeight));F();const O=new ResizeObserver(F);return O.observe(R),()=>O.disconnect()},[!!m]),!m)return V.jsxs("div",{className:"rf-flex rf-min-h-[400px] rf-flex-col rf-items-center rf-justify-center rf-gap-3 rf-p-8 rf-text-center",children:[V.jsx(NAn,{className:"rf-h-7 rf-w-7 rf-text-blue-500"}),V.jsx("h3",{className:"rf-text-base rf-font-medium",children:n?"Waiting for autorouting":"No autorouting captures"}),V.jsx("p",{className:"rf-max-w-md rf-text-sm rf-text-gray-500",children:n?"Phases appear as the circuit routes. Each capture includes its input and output on the PCB.":"Run a circuit with autorouting enabled to inspect its phases. A circuit JSON file alone does not include routing history."})]});const S=Lje(m,p),Q=m.status==="running"&&n,w=!f,M=I?.connections.length,k=E?.filter(R=>R.type==="pcb_trace").length??0;return V.jsxs("div",{className:"rf-flex rf-h-full rf-min-h-[620px] rf-flex-col rf-bg-white md:rf-flex-row","data-testid":"autorouting-explorer",children:[V.jsxs("aside",{className:"rf-flex rf-shrink-0 rf-flex-col rf-border-b rf-border-gray-200 md:rf-w-52 md:rf-border-b-0 md:rf-border-r","aria-label":"Routing phases",children:[V.jsxs("div",{className:"rf-flex rf-items-center rf-justify-between rf-px-3 rf-py-2 rf-text-xs rf-text-gray-500",children:[V.jsx("span",{children:"Routing phases"}),V.jsx("span",{children:e.length})]}),V.jsx("div",{className:"rf-flex rf-gap-1 rf-overflow-x-auto rf-px-1.5 rf-pb-1.5 md:rf-flex-col md:rf-overflow-x-hidden md:rf-overflow-y-auto",children:e.map((R,F)=>{const O=Odn(R).length,U=R.endSimpleRouteJson?`${O} ${O===1?"trace":"traces"} routed`:R.status==="error"?"Failed":R.status==="running"&&n?"Routing…":"No output";return V.jsxs("button",{type:"button","aria-pressed":F===p,title:`${Ydn(R)} · ${U}`,onClick:()=>i(R),className:zr("rf-flex rf-min-w-[192px] rf-items-start rf-gap-2 rf-rounded-md rf-border rf-px-2 rf-py-2 rf-text-left md:rf-min-w-0",F===p?"rf-border-blue-200 rf-bg-blue-50":"rf-border-transparent hover:rf-bg-gray-50"),children:[V.jsx("span",{className:zr("rf-flex rf-h-5 rf-w-5 rf-shrink-0 rf-items-center rf-justify-center rf-rounded-full rf-text-[11px]",F===p?"rf-bg-blue-600 rf-text-white":"rf-bg-gray-100 rf-text-gray-500"),children:F+1}),V.jsxs("span",{className:"rf-min-w-0 rf-flex-1",children:[V.jsxs("span",{className:"rf-flex rf-items-center rf-gap-1",children:[V.jsx("span",{className:"rf-min-w-0 rf-flex-1 rf-truncate rf-text-xs rf-font-medium rf-leading-5 rf-text-gray-800",title:Lje(R,F),children:Lje(R,F)}),R.status==="complete"?V.jsx(K$,{"aria-label":"Captured",className:"rf-h-3 rf-w-3 rf-shrink-0 rf-text-green-600"}):R.status==="error"?V.jsx($ze,{"aria-label":"Failed",className:"rf-h-3 rf-w-3 rf-shrink-0 rf-text-red-500"}):n?V.jsx(a4,{"aria-label":"Routing",className:"rf-h-3 rf-w-3 rf-shrink-0 rf-animate-spin rf-text-blue-500"}):null]}),V.jsxs("span",{className:"rf-block rf-text-[11px] rf-leading-4 rf-text-gray-500",children:[xLi(R)," · ",U]})]})]},R.id)})})]}),V.jsxs("div",{className:"rf-flex rf-min-w-0 rf-flex-1 rf-flex-col",children:[V.jsxs("div",{className:"rf-flex rf-flex-wrap rf-items-center rf-gap-3 rf-border-b rf-border-gray-200 rf-px-4 rf-py-3",children:[V.jsxs("h3",{className:"rf-mr-auto rf-flex rf-items-center rf-gap-2 rf-text-sm rf-font-medium",children:[S,V.jsxs("span",{className:"rf-text-xs rf-font-normal rf-text-gray-500",children:[p+1," of ",e.length]})]}),n&&V.jsx("button",{type:"button",onClick:()=>i(null),disabled:_,className:"rf-text-xs rf-text-blue-600 disabled:rf-text-gray-500",children:_?"Following latest":"Follow latest"}),V.jsx("div",{className:"rf-flex rf-rounded-md rf-bg-gray-100 rf-p-1","aria-label":"Phase snapshot",children:["input","output"].map(R=>V.jsx("button",{type:"button","aria-pressed":y===R,disabled:R==="input"?!C:!f,onClick:()=>s(R),className:zr("rf-rounded rf-px-3 rf-py-1 rf-text-xs disabled:rf-opacity-40",y===R?"rf-bg-white rf-text-gray-900 rf-shadow-sm":"rf-text-gray-500"),children:R==="input"?"Input":"Output"},R))})]}),V.jsxs("div",{className:"rf-flex rf-flex-wrap rf-items-center rf-justify-between rf-gap-2 rf-px-4 rf-py-2 rf-text-xs rf-text-gray-600",children:[V.jsxs("label",{className:"rf-flex rf-items-center rf-gap-2",children:[V.jsx("input",{type:"checkbox",checked:a,disabled:y!=="output",onChange:R=>A(R.target.checked),className:"rf-accent-blue-600"}),V.jsx("span",{"aria-hidden":"true",className:"rf-inline-block rf-h-0.5 rf-w-3",style:{backgroundColor:Fje}}),"Highlight changes (all layers)"]}),V.jsxs("span",{children:[y==="input"?"Before this phase":"After this phase"," ","· ",k," traces"]})]}),w&&V.jsx("div",{className:zr("rf-border-y rf-px-4 rf-py-2 rf-text-xs",m.status==="error"?"rf-border-red-100 rf-bg-red-50 rf-text-red-700":"rf-border-blue-100 rf-bg-blue-50 rf-text-blue-700"),role:"status",children:m.status==="error"?`Routing failed: ${m.error?.message||"No output was captured."}`:Q?"Routing in progress. Showing captured input until output is available.":"No output was captured for this phase. Showing the available input."}),V.jsx("div",{ref:g,className:"rf-relative rf-min-h-[360px] rf-flex-1","data-testid":"autorouting-pcb",children:E?V.jsx(vje,{circuitJson:E,height:u,allowEditing:!1,clickToInteractEnabled:!1,initialState:wLi,debugGraphics:B}):V.jsx("div",{className:"rf-p-6 rf-text-sm rf-text-gray-500",children:"No PCB snapshot available for this capture."})}),V.jsxs("div",{className:"rf-flex rf-flex-wrap rf-items-center rf-justify-between rf-gap-2 rf-border-t rf-border-gray-200 rf-px-4 rf-py-3 rf-text-xs rf-text-gray-500",children:[V.jsxs("span",{children:[M===void 0?"Input unavailable":`${M} input connections`,` · ${Ydn(m)}`]}),V.jsxs("div",{className:"rf-flex rf-items-center rf-gap-4",children:[V.jsxs("button",{type:"button",disabled:!x,onClick:()=>EE(JSON.stringify(x,null,2),{fileName:`${m.id}-${y}.srj.json`,mimeType:"application/json"}),className:"rf-flex rf-items-center rf-gap-1 disabled:rf-opacity-40",children:[V.jsx(V$,{className:"rf-h-3 rf-w-3"}),"Download SRJ"]}),V.jsxs("button",{type:"button","aria-expanded":c,onClick:()=>l(!c),className:"rf-flex rf-items-center rf-gap-1",children:[V.jsx(KY,{className:zr("rf-h-3 rf-w-3",c&&"rf-rotate-90")}),"Inspect SRJ"]})]})]}),c&&V.jsx("pre",{className:"rf-m-0 rf-max-h-64 rf-overflow-auto rf-border-t rf-border-gray-200 rf-bg-gray-50 rf-p-4 rf-text-xs","aria-label":`${S} ${y} SRJ`,children:x?JSON.stringify(x,null,2):"No snapshot captured."})]})]})},Kdn=({errorMessage:t,errorStack:e,circuitJsonErrors:n})=>{te.useEffect(()=>{if(t){const o=new Error(t);e&&(o.stack=e);try{Uk.captureException(o)}catch{}}},[t,e]),te.useEffect(()=>{if(n&&n.length>0)for(const o of n){const i=new Error(o.message||"Circuit JSON Error");o.stack&&(i.stack=o.stack);try{Uk.captureException(i,{error_type:o.type})}catch{}}},[n])},MLi=t=>{te.useEffect(()=>{try{Y7n(t)}catch{}},[t.source,t.component,t.isWebEmbedded,t.activeTab])},Vdn="0.0.2856",DLi={version:Vdn},Hje={BASE_URL:"/",DEV:!1,MODE:"production",PROD:!0,SSR:!1},Oje=new Map,M_e=t=>{const e=Oje.get(t);return e?Object.fromEntries(Object.entries(e.stores).map(([n,o])=>[n,o.getState()])):{}},NLi=(t,e,n)=>{if(t===void 0)return{type:"untracked",connection:e.connect(n)};const o=Oje.get(n.name);if(o)return{type:"tracked",store:t,...o};const i={connection:e.connect(n),stores:{}};return Oje.set(n.name,i),{type:"tracked",store:t,...i}},zdn=(t,e={})=>(n,o,i)=>{const{enabled:r,anonymousActionType:s,store:a,...A}=e;let c;try{c=(r??(Hje?"production":void 0)!=="production")&&window.__REDUX_DEVTOOLS_EXTENSION__}catch{}if(!c)return(Hje?"production":void 0)!=="production"&&r&&console.warn("[zustand devtools middleware] Please install/enable Redux devtools extension"),t(n,o,i);const{connection:l,...g}=NLi(a,c,A);let u=!0;i.setState=(p,m,_)=>{const f=n(p,m);if(!u)return f;const I=_===void 0?{type:s||"anonymous"}:typeof _=="string"?{type:_}:_;return a===void 0?(l?.send(I,o()),f):(l?.send({...I,type:`${a}/${I.type}`},{...M_e(A.name),[a]:i.getState()}),f)};const h=(...p)=>{const m=u;u=!1,n(...p),u=m},d=t(i.setState,o,i);if(g.type==="untracked"?l?.init(d):(g.stores[g.store]=i,l?.init(Object.fromEntries(Object.entries(g.stores).map(([p,m])=>[p,p===g.store?d:m.getState()])))),i.dispatchFromDevtools&&typeof i.dispatch=="function"){let p=!1;const m=i.dispatch;i.dispatch=(..._)=>{(Hje?"production":void 0)!=="production"&&_[0].type==="__setState"&&!p&&(console.warn('[zustand devtools middleware] "__setState" action type is reserved to set state from the devtools. Avoid using it.'),p=!0),m(..._)}}return l.subscribe(p=>{var m;switch(p.type){case"ACTION":if(typeof p.payload!="string"){console.error("[zustand devtools middleware] Unsupported action format");return}return Gje(p.payload,_=>{if(_.type==="__setState"){if(a===void 0){h(_.state);return}Object.keys(_.state).length!==1&&console.error(`
5668
5668
  [zustand devtools middleware] Unsupported __setState action format.
5669
5669
  When using 'store' option in devtools(), the 'state' should have only one key, which is a value of 'store' that was passed in devtools(),
5670
5670
  and value of this only key should be a state object. Example: { "type": "__setState", "state": { "abc123Store": { "foo": "bar" } } }